diff --git a/.gitignore b/.gitignore
index 803c297..dd264ef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@
 **/*.iml
 **/*.pyc
 **/*.swn
+tools/boot.out
diff --git a/Android.mk b/Android.mk
index d560276..46d2374 100644
--- a/Android.mk
+++ b/Android.mk
@@ -343,43 +343,6 @@
 # "include $(BUILD_...)".
 LOCAL_PATH := $(art_path)
 
-# Create canonical name -> file name symlink in the symbol directory for the
-# debug APEX. The symbol files for it are installed to
-# $(TARGET_OUT_UNSTRIPPED)/apex/com.android.art.debug. However, since it's
-# available via /apex/com.android.art at runtime, create a symlink so that
-# $(TARGET_OUT_UNSTRIPPED)/apex/com.android.art is linked to
-# $(TARGET_OUT_UNSTRIPPED)/apex/$(TARGET_ART_APEX). We skip this for the release
-# APEX which has com.android.art as $(TARGET_ART_APEX). Note that installation
-# of the symlink is triggered by the apex_manifest.pb file which is the file
-# that is guaranteed to be created regardless of the value of
-# TARGET_FLATTEN_APEX.
-# TODO(b/171419613): the symlink is disabled because the
-# $OUT/symbols/apex/com.android.art name is taken by the com.android.art apex
-# even when com.android.art.debug is selected by TARGET_ART_APEX.
-# Disabling the symlink means that symbols for the com.android.art.debug apex
-# will not be found.
-ifeq ($(TARGET_FLATTEN_APEX),true)
-art_apex_manifest_file := $(PRODUCT_OUT)/system/apex/$(TARGET_ART_APEX)/apex_manifest.pb
-else
-art_apex_manifest_file := $(PRODUCT_OUT)/apex/$(TARGET_ART_APEX)/apex_manifest.pb
-endif
-
-art_apex_symlink_timestamp := $(call intermediates-dir-for,FAKE,com.android.art)/symlink.timestamp
-$(art_apex_manifest_file): $(art_apex_symlink_timestamp)
-$(art_apex_manifest_file): PRIVATE_LINK_NAME := $(TARGET_OUT_UNSTRIPPED)/apex/com.android.art
-$(art_apex_symlink_timestamp):
-#ifeq ($(TARGET_ART_APEX),com.android.art)
-#	$(hide) if [ -L $(PRIVATE_LINK_NAME) ]; then rm -f $(PRIVATE_LINK_NAME); fi
-#else
-#	$(hide) mkdir -p $(dir $(PRIVATE_LINK_NAME))
-#	$(hide) rm -rf $(PRIVATE_LINK_NAME)
-#	$(hide) ln -sf $(TARGET_ART_APEX) $(PRIVATE_LINK_NAME)
-#endif
-	$(hide) touch $@
-$(art_apex_symlink_timestamp): .KATI_SYMLINK_OUTPUTS := $(PRIVATE_LINK_NAME)
-
-art_apex_manifest_file :=
-
 ####################################################################################################
 # Fake packages to ensure generation of libopenjdkd when one builds with mm/mmm/mmma.
 #
@@ -446,7 +409,6 @@
   lib/libadbconnection.so \
   lib/libandroidio.so \
   lib/libartbase.so \
-  lib/libart-compiler.so \
   lib/libart-dexlayout.so \
   lib/libart-disassembler.so \
   lib/libartpalette.so \
@@ -474,7 +436,6 @@
   lib64/libadbconnection.so \
   lib64/libandroidio.so \
   lib64/libartbase.so \
-  lib64/libart-compiler.so \
   lib64/libart-dexlayout.so \
   lib64/libart-disassembler.so \
   lib64/libartpalette.so \
@@ -531,12 +492,14 @@
   lib64/libicuuc.so \
 
 PRIVATE_STATSD_APEX_DEPENDENCY_LIBS := \
+  lib/libstatspull.so \
   lib/libstatssocket.so \
+  lib64/libstatspull.so \
   lib64/libstatssocket.so \
 
-# Extracts files from an APEX into a location. The APEX can be either a .apex
-# file in $(TARGET_OUT)/apex, or a directory in the same location. Files are
-# extracted to $(TARGET_OUT) with the same relative paths as under the APEX
+# Extracts files from an APEX into a location. The APEX can be either a .apex or
+# .capex file in $(TARGET_OUT)/apex, or a directory in the same location. Files
+# are extracted to $(TARGET_OUT) with the same relative paths as under the APEX
 # root.
 # $(1): APEX base name
 # $(2): List of files to extract, with paths relative to the APEX root
@@ -547,13 +510,15 @@
   apex_root=$(TARGET_OUT)/apex && \
   apex_file=$$apex_root/$(1).apex && \
   apex_dir=$$apex_root/$(1) && \
+  if [ ! -f $$apex_file ]; then \
+    apex_file=$$apex_root/$(1).capex; \
+  fi && \
   if [ -f $$apex_file ]; then \
     rm -rf $$apex_dir && \
     mkdir -p $$apex_dir && \
     debugfs=$(HOST_OUT)/bin/debugfs_static && \
-    blkid=$(HOST_OUT)/bin/blkid_static && \
     fsckerofs=$(HOST_OUT)/bin/fsck.erofs && \
-    $(HOST_OUT)/bin/deapexer --debugfs_path $$debugfs --blkid_path $$blkid \
+    $(HOST_OUT)/bin/deapexer --debugfs_path $$debugfs \
 		--fsckerofs_path $$fsckerofs extract $$apex_file $$apex_dir; \
   fi && \
   for f in $(2); do \
@@ -592,7 +557,9 @@
                        $(CONSCRYPT_APEX) \
                        $(I18N_APEX) \
                        $(STATSD_APEX) \
-                       $(TZDATA_APEX)
+                       $(TZDATA_APEX) \
+                       $(HOST_OUT)/bin/generate-boot-image64 \
+                       $(HOST_OUT)/bin/dex2oat64
 	$(call extract-from-apex,$(RELEASE_ART_APEX),\
 	  $(PRIVATE_ART_APEX_DEPENDENCY_LIBS) $(PRIVATE_ART_APEX_DEPENDENCY_FILES))
 	# The Runtime APEX has the Bionic libs in ${LIB}/bionic subdirectories,
@@ -612,6 +579,15 @@
 	$(call extract-from-apex,$(STATSD_APEX),\
 	  $(PRIVATE_STATSD_APEX_DEPENDENCY_LIBS))
 	$(call extract-from-apex,$(TZDATA_APEX),)
+	rm -rf $(PRODUCT_OUT)/apex/art_boot_images && \
+	  mkdir -p $(PRODUCT_OUT)/apex/art_boot_images/javalib && \
+	  $(HOST_OUT)/bin/generate-boot-image64 \
+	    --output-dir=$(PRODUCT_OUT)/apex/art_boot_images/javalib \
+	    --compiler-filter=speed \
+	    --use-profile=false \
+	    --dex2oat-bin=$(HOST_OUT)/bin/dex2oat64 \
+	    --android-root=$(TARGET_OUT) \
+	    --instruction-set=$(TARGET_ARCH)
 
 ########################################################################
 # Phony target for only building what go/lem requires for pushing ART on /data.
@@ -637,8 +613,7 @@
                         $(TARGET_OUT_EXECUTABLES)/dex2oat_wrapper \
                         $(ART_TARGET_PLATFORM_DEPENDENCIES) \
                         $(ART_TARGET_SHARED_LIBRARY_BENCHMARK) \
-			$(TARGET_OUT_SHARED_LIBRARIES)/libgolemtiagent.so \
-                        $(PRODUCT_OUT)/apex/art_boot_images/javalib/$(TARGET_ARCH)/boot.art \
+                        $(TARGET_OUT_SHARED_LIBRARIES)/libgolemtiagent.so \
                         standalone-apex-files
 	# remove debug libraries from public.libraries.txt because golem builds
 	# won't have it.
@@ -779,6 +754,10 @@
 # Clear locally used variables.
 TEST_ART_TARGET_SYNC_DEPS :=
 
+# These files only exist if this flag is off. WITH_DEXPREOPT_ART_BOOT_IMG_ONLY is the
+# minimal dexpreopt mode we use on eng builds for build speed.
+ifneq ($(WITH_DEXPREOPT_ART_BOOT_IMG_ONLY),true)
+
 # Helper target that depends on boot image creation.
 #
 # Can be used, for example, to dump initialization failures:
@@ -794,6 +773,8 @@
   $(HOST_OUT_EXECUTABLES)/dex2oatds \
   $(HOST_OUT_EXECUTABLES)/profman
 
+endif # TARGET_BUILD_VARIANT == eng
+
 ########################################################################
 
 # Build a target that contains dex public SDK stubs for SDK version in the list.
diff --git a/OWNERS b/OWNERS
index cfaa94b..9965354 100644
--- a/OWNERS
+++ b/OWNERS
@@ -7,15 +7,14 @@
 mythria@google.com
 ngeoffray@google.com
 rpl@google.com
+scianciulli@google.com
+skvadrik@google.com
 solanes@google.com
 vmarko@google.com
 
 # Core Libraries.
 miguelaranda@google.com
 mingaleev@google.com
-nikitai@google.com
-oth@google.com
 prb@google.com
-skvadrik@google.com
 sorinbasca@google.com
 vichang@google.com
diff --git a/OWNERS_boot_profile b/OWNERS_boot_profile
new file mode 100644
index 0000000..b4b2f80
--- /dev/null
+++ b/OWNERS_boot_profile
@@ -0,0 +1,4 @@
+# Owners of boot image and system server profiles.
+islamelbanna@google.com
+ngeoffray@google.com
+vmarko@google.com
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 084f3d7..038aaf9 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -14,9 +14,6 @@
       "name": "art-run-test-004-InterfaceTest[com.google.android.art.apex]"
     },
     {
-      "name": "art-run-test-004-NativeAllocations[com.google.android.art.apex]"
-    },
-    {
       "name": "art-run-test-004-checker-UnsafeTest18[com.google.android.art.apex]"
     },
     {
@@ -44,7 +41,7 @@
       "name": "art-run-test-014-math3[com.google.android.art.apex]"
     },
     {
-      "name": "art-run-test-015-switch[com.google.android.art.apex]"
+      "name": "art-run-test-015-checker-switch[com.google.android.art.apex]"
     },
     {
       "name": "art-run-test-016-intern[com.google.android.art.apex]"
@@ -491,6 +488,21 @@
       "name": "art-run-test-2260-checker-inline-unimplemented-intrinsics[com.google.android.art.apex]"
     },
     {
+      "name": "art-run-test-2262-checker-return-sinking[com.google.android.art.apex]"
+    },
+    {
+      "name": "art-run-test-2265-checker-select-binary-unary[com.google.android.art.apex]"
+    },
+    {
+      "name": "art-run-test-2266-checker-remove-empty-ifs[com.google.android.art.apex]"
+    },
+    {
+      "name": "art-run-test-2268-checker-remove-dead-phis[com.google.android.art.apex]"
+    },
+    {
+      "name": "art-run-test-2269-checker-constant-folding-instrinsics[com.google.android.art.apex]"
+    },
+    {
       "name": "art-run-test-300-package-override[com.google.android.art.apex]"
     },
     {
@@ -1178,6 +1190,9 @@
       "name": "art-run-test-660-checker-simd-sad[com.google.android.art.apex]"
     },
     {
+      "name": "art-run-test-661-checker-simd-cf-loops[com.google.android.art.apex]"
+    },
+    {
       "name": "art-run-test-661-checker-simd-reduc[com.google.android.art.apex]"
     },
     {
@@ -1322,6 +1337,12 @@
       "name": "art-run-test-843-default-interface[com.google.android.art.apex]"
     },
     {
+      "name": "art-run-test-851-null-instanceof[com.google.android.art.apex]"
+    },
+    {
+      "name": "art-run-test-853-checker-inlining[com.google.android.art.apex]"
+    },
+    {
       "name": "art-run-test-963-default-range-smali[com.google.android.art.apex]"
     },
     {
@@ -1436,9 +1457,6 @@
       "name": "art-run-test-004-InterfaceTest"
     },
     {
-      "name": "art-run-test-004-NativeAllocations"
-    },
-    {
       "name": "art-run-test-004-checker-UnsafeTest18"
     },
     {
@@ -1466,7 +1484,7 @@
       "name": "art-run-test-014-math3"
     },
     {
-      "name": "art-run-test-015-switch"
+      "name": "art-run-test-015-checker-switch"
     },
     {
       "name": "art-run-test-016-intern"
@@ -1913,6 +1931,21 @@
       "name": "art-run-test-2260-checker-inline-unimplemented-intrinsics"
     },
     {
+      "name": "art-run-test-2262-checker-return-sinking"
+    },
+    {
+      "name": "art-run-test-2265-checker-select-binary-unary"
+    },
+    {
+      "name": "art-run-test-2266-checker-remove-empty-ifs"
+    },
+    {
+      "name": "art-run-test-2268-checker-remove-dead-phis"
+    },
+    {
+      "name": "art-run-test-2269-checker-constant-folding-instrinsics"
+    },
+    {
       "name": "art-run-test-300-package-override"
     },
     {
@@ -2600,6 +2633,9 @@
       "name": "art-run-test-660-checker-simd-sad"
     },
     {
+      "name": "art-run-test-661-checker-simd-cf-loops"
+    },
+    {
       "name": "art-run-test-661-checker-simd-reduc"
     },
     {
@@ -2744,6 +2780,12 @@
       "name": "art-run-test-843-default-interface"
     },
     {
+      "name": "art-run-test-851-null-instanceof"
+    },
+    {
+      "name": "art-run-test-853-checker-inlining"
+    },
+    {
       "name": "art-run-test-963-default-range-smali"
     },
     {
@@ -2824,6 +2866,9 @@
       "name": "ArtServiceTests"
     },
     {
+      "name": "BootImageProfileTest"
+    },
+    {
       "name": "art-apex-update-rollback"
     },
     {
@@ -2842,9 +2887,6 @@
       "name": "art-run-test-004-InterfaceTest"
     },
     {
-      "name": "art-run-test-004-NativeAllocations"
-    },
-    {
       "name": "art-run-test-004-checker-UnsafeTest18"
     },
     {
@@ -2872,7 +2914,7 @@
       "name": "art-run-test-014-math3"
     },
     {
-      "name": "art-run-test-015-switch"
+      "name": "art-run-test-015-checker-switch"
     },
     {
       "name": "art-run-test-016-intern"
@@ -3319,6 +3361,21 @@
       "name": "art-run-test-2260-checker-inline-unimplemented-intrinsics"
     },
     {
+      "name": "art-run-test-2262-checker-return-sinking"
+    },
+    {
+      "name": "art-run-test-2265-checker-select-binary-unary"
+    },
+    {
+      "name": "art-run-test-2266-checker-remove-empty-ifs"
+    },
+    {
+      "name": "art-run-test-2268-checker-remove-dead-phis"
+    },
+    {
+      "name": "art-run-test-2269-checker-constant-folding-instrinsics"
+    },
+    {
       "name": "art-run-test-300-package-override"
     },
     {
@@ -4006,6 +4063,9 @@
       "name": "art-run-test-660-checker-simd-sad"
     },
     {
+      "name": "art-run-test-661-checker-simd-cf-loops"
+    },
+    {
       "name": "art-run-test-661-checker-simd-reduc"
     },
     {
@@ -4150,6 +4210,12 @@
       "name": "art-run-test-843-default-interface"
     },
     {
+      "name": "art-run-test-851-null-instanceof"
+    },
+    {
+      "name": "art-run-test-853-checker-inlining"
+    },
+    {
       "name": "art-run-test-963-default-range-smali"
     },
     {
@@ -4229,5 +4295,16 @@
     {
       "name": "ComposHostTestCases"
     }
+  ],
+  "postsubmit": [
+    {
+      "name": "art-run-test-2247-checker-write-barrier-elimination"
+    },
+    {
+      "name": "art-run-test-2273-checker-unreachable-intrinsics"
+    },
+    {
+      "name": "art_standalone_dexopt_chroot_setup_tests"
+    }
   ]
 }
diff --git a/adbconnection/Android.bp b/adbconnection/Android.bp
index ecad650..ed8fa38 100644
--- a/adbconnection/Android.bp
+++ b/adbconnection/Android.bp
@@ -28,7 +28,10 @@
 cc_defaults {
     name: "adbconnection-defaults",
     host_supported: true,
-    srcs: ["adbconnection.cc"],
+    srcs: [
+        "adbconnection.cc",
+        "jdwpargs.cc",
+    ],
     defaults: ["art_defaults"],
 
     // Note that this tool needs to be built for both 32-bit and 64-bit since it requires
diff --git a/adbconnection/adbconnection.cc b/adbconnection/adbconnection.cc
index 239fe31..55eac93 100644
--- a/adbconnection/adbconnection.cc
+++ b/adbconnection/adbconnection.cc
@@ -14,15 +14,23 @@
  * limitations under the License.
  */
 
+#include "adbconnection.h"
+
+#include <jni.h>
+#include <sys/eventfd.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+#include <sys/un.h>
+
 #include <array>
 #include <cstddef>
 #include <iterator>
 
-#include "adbconnection.h"
-
 #include "adbconnection/client.h"
 #include "android-base/endian.h"
 #include "android-base/stringprintf.h"
+#include "android-base/unique_fd.h"
 #include "art_field-inl.h"
 #include "art_method-alloc-inl.h"
 #include "base/file_utils.h"
@@ -32,27 +40,19 @@
 #include "base/mutex.h"
 #include "base/socket_peer_is_trusted.h"
 #include "debugger.h"
+#include "fd_transport.h"
+#include "jdwpargs.h"
 #include "jni/java_vm_ext.h"
 #include "jni/jni_env_ext.h"
 #include "mirror/class-alloc-inl.h"
 #include "mirror/throwable.h"
 #include "nativehelper/scoped_local_ref.h"
+#include "poll.h"
 #include "runtime-inl.h"
 #include "runtime_callbacks.h"
 #include "scoped_thread_state_change-inl.h"
 #include "well_known_classes.h"
 
-#include "fd_transport.h"
-
-#include "poll.h"
-
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-#include <sys/un.h>
-#include <sys/eventfd.h>
-#include <jni.h>
-
 namespace adbconnection {
 
 static constexpr size_t kJdwpHeaderLen = 11U;
@@ -484,10 +484,6 @@
   }
 }
 
-android::base::unique_fd AdbConnectionState::ReadFdFromAdb() {
-  return android::base::unique_fd(adbconnection_client_receive_jdwp_fd(control_ctx_.get()));
-}
-
 bool AdbConnectionState::SetupAdbConnection() {
   int sleep_ms = 500;
   const int sleep_max_ms = 2 * 1000;
@@ -552,18 +548,17 @@
     while (!shutting_down_ && control_ctx_) {
       bool should_listen_on_connection = !agent_has_socket_ && !sent_agent_fds_;
       struct pollfd pollfds[4] = {
-        { sleep_event_fd_, POLLIN, 0 },
-        // -1 as an fd causes it to be ignored by poll
-        { (agent_loaded_ ? local_agent_control_sock_ : -1), POLLIN, 0 },
-        // Check for the control_sock_ actually going away. Only do this if we don't have an active
-        // connection.
-        { (adb_connection_socket_ == -1 ? adbconnection_client_pollfd(control_ctx_.get()) : -1),
-          POLLIN | POLLRDHUP, 0 },
-        // if we have not loaded the agent either the adb_connection_socket_ is -1 meaning we don't
-        // have a real connection yet or the socket through adb needs to be listened to for incoming
-        // data that the agent or this plugin can handle.
-        { should_listen_on_connection ? adb_connection_socket_ : -1, POLLIN | POLLRDHUP, 0 }
-      };
+          {sleep_event_fd_, POLLIN, 0},
+          // -1 as an fd causes it to be ignored by poll
+          {(agent_loaded_ ? local_agent_control_sock_ : -1), POLLIN, 0},
+          // Check for the control_sock_ actually going away. We always monitor for POLLIN, even if
+          // we already have an adbd socket. This allows to reject incoming debugger connection if
+          // there is already have one connected.
+          {adbconnection_client_pollfd(control_ctx_.get()), POLLIN | POLLRDHUP, 0},
+          // if we have not loaded the agent either the adb_connection_socket_ is -1 meaning we
+          // don't have a real connection yet or the socket through adb needs to be listened to for
+          // incoming data that the agent or this plugin can handle.
+          {should_listen_on_connection ? adb_connection_socket_ : -1, POLLIN | POLLRDHUP, 0}};
       int res = TEMP_FAILURE_RETRY(poll(pollfds, 4, -1));
       if (res < 0) {
         PLOG(ERROR) << "Failed to poll!";
@@ -860,19 +855,65 @@
   return res;
 }
 
+#if defined(__ANDROID__)
+void FixLogfile(JdwpArgs& parameters) {
+  const std::string kLogfile = "logfile";
+  // On Android, an app will not have write access to the cwd (which is "/").
+  // If a relative path was provided, we need to patch it with a writable
+  // location. For now, we use /data/data/<PKG_NAME>.
+  // Note that /data/local/tmp/ was also considered but it not a good candidate since apps don't
+  // have write access to it.
+
+  if (!parameters.contains(kLogfile)) {
+    return;
+  }
+
+  std::string& logfile = parameters.get(kLogfile);
+  if (logfile.front() == '/') {
+    // We only fix logfile if it is not using an absolute path
+    return;
+  }
+
+  std::string packageName = art::Runtime::Current()->GetProcessPackageName();
+  if (packageName.empty()) {
+    VLOG(jdwp) << "Unable to fix relative path logfile='" + logfile + "' without package name.";
+    return;
+  }
+  parameters.put(kLogfile, "/data/data/" + packageName + "/" + logfile);
+}
+#else
+void FixLogfile(JdwpArgs&) {}
+#endif
+
 std::string AdbConnectionState::MakeAgentArg() {
   const std::string& opts = art::Runtime::Current()->GetJdwpOptions();
   DCHECK(ValidateJdwpOptions(opts));
+
+  VLOG(jdwp) << "Raw jdwp options '" + opts + "'";
+  JdwpArgs parameters = JdwpArgs(opts);
+
+  // See the comment above for why we need to be server=y. Since the agent defaults to server=n
+  // we must always set it.
+  parameters.put("server", "y");
+
+  // See the comment above for why we need to be suspend=n. Since the agent defaults to
+  // suspend=y we must always set it.
+  parameters.put("suspend", "n");
+
+  std::string ddm_already_active = "n";
+  if (notified_ddm_active_) {
+    ddm_already_active = "y";
+  }
+  parameters.put("ddm_already_active", ddm_already_active);
+
+  parameters.put("transport", "dt_fd_forward");
+  parameters.put("address", std::to_string(remote_agent_control_sock_));
+
+  // If logfile is relative, we need to fix it.
+  FixLogfile(parameters);
+
   // TODO Get agent_name_ from something user settable?
-  return agent_name_ + "=" + opts + (opts.empty() ? "" : ",") +
-      "ddm_already_active=" + (notified_ddm_active_ ? "y" : "n") + "," +
-      // See the comment above for why we need to be server=y. Since the agent defaults to server=n
-      // we will add it if it wasn't already present for the convenience of the user.
-      (ContainsArgument(opts, "server=y") ? "" : "server=y,") +
-      // See the comment above for why we need to be suspend=n. Since the agent defaults to
-      // suspend=y we will add it if it wasn't already present.
-      (ContainsArgument(opts, "suspend=n") ? "" : "suspend=n,") +
-      "transport=dt_fd_forward,address=" + std::to_string(remote_agent_control_sock_);
+  return agent_name_ + "=" + parameters.join();
 }
 
 void AdbConnectionState::StopDebuggerThreads() {
diff --git a/adbconnection/adbconnection.h b/adbconnection/adbconnection.h
index 6500b79..b6309e7 100644
--- a/adbconnection/adbconnection.h
+++ b/adbconnection/adbconnection.h
@@ -17,25 +17,22 @@
 #ifndef ART_ADBCONNECTION_ADBCONNECTION_H_
 #define ART_ADBCONNECTION_ADBCONNECTION_H_
 
+#include <jni.h>
 #include <stdint.h>
-#include <memory>
-#include <vector>
-#include <limits>
-
-#include "android-base/unique_fd.h"
-#include "adbconnection/client.h"
-
-#include "base/mutex.h"
-#include "base/array_ref.h"
-#include "runtime_callbacks.h"
-
 #include <sys/socket.h>
 #include <sys/un.h>
-#include <jni.h>
+
+#include <limits>
+#include <memory>
+#include <vector>
+
+#include "adbconnection/client.h"
+#include "base/array_ref.h"
+#include "base/mutex.h"
+#include "runtime_callbacks.h"
 
 namespace adbconnection {
 
-static constexpr char kJdwpControlName[] = "\0jdwp-control";
 static constexpr char kAdbConnectionThreadName[] = "ADB-JDWP Connection Control Thread";
 
 // The default jdwp agent name.
@@ -103,8 +100,6 @@
 
   std::string MakeAgentArg();
 
-  android::base::unique_fd ReadFdFromAdb();
-
   void SendAgentFds(bool require_handshake);
 
   void CloseFds();
diff --git a/adbconnection/jdwpargs.cc b/adbconnection/jdwpargs.cc
new file mode 100644
index 0000000..732713e
--- /dev/null
+++ b/adbconnection/jdwpargs.cc
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "jdwpargs.h"
+
+#include <algorithm>
+#include <sstream>
+
+#include "base/logging.h"  // For VLOG.
+
+namespace adbconnection {
+
+JdwpArgs::JdwpArgs(const std::string& opts) {
+  std::stringstream ss(opts);
+
+  // Split on ',' character
+  while (!ss.eof()) {
+    std::string w;
+    getline(ss, w, ',');
+
+    // Trim spaces
+    w.erase(std::remove_if(w.begin(), w.end(), ::isspace), w.end());
+
+    // Extract key=value
+    auto pos = w.find('=');
+
+    // Check for bad format such as no '=' or '=' at either extremity
+    if (pos == std::string::npos || w.back() == '=' || w.front() == '=') {
+      VLOG(jdwp) << "Skipping jdwp parameters '" << opts << "', token='" << w << "'";
+      continue;
+    }
+
+    // Set
+    std::string key = w.substr(0, pos);
+    std::string value = w.substr(pos + 1);
+    put(key, value);
+    VLOG(jdwp) << "Found jdwp parameters '" << key << "'='" << value << "'";
+  }
+}
+
+void JdwpArgs::put(const std::string& key, const std::string& value) {
+  if (store.find(key) == store.end()) {
+    keys.emplace_back(key);
+  }
+
+  store[key] = value;
+}
+
+std::string JdwpArgs::join() {
+  std::string opts;
+  for (const auto& key : keys) {
+    opts += key + "=" + store[key] + ",";
+  }
+
+  // Remove the trailing comma if there is one
+  if (opts.length() >= 2) {
+    opts = opts.substr(0, opts.length() - 1);
+  }
+
+  return opts;
+}
+}  // namespace adbconnection
diff --git a/adbconnection/jdwpargs.h b/adbconnection/jdwpargs.h
new file mode 100644
index 0000000..c1c69e2
--- /dev/null
+++ b/adbconnection/jdwpargs.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_ADBCONNECTION_JDWPARGS_H_
+#define ART_ADBCONNECTION_JDWPARGS_H_
+
+#include <string>
+#include <unordered_map>
+#include <vector>
+
+namespace adbconnection {
+
+// A key/value store which respects order of insertion when join the values.
+// This is necessary for jdwp agent parameter. e.g.: key "transport", must be
+// issued before "address", otherwise oj-libjdpw will crash.
+//
+// If a key were to be re-inserted (a.k.a overwritten), the first insertion
+// will be used for order.
+class JdwpArgs {
+ public:
+  explicit JdwpArgs(const std::string& opts);
+  ~JdwpArgs() = default;
+
+  // Add a key / value
+  void put(const std::string& key, const std::string& value);
+
+  bool contains(const std::string& key) { return store.find(key) != store.end(); }
+
+  std::string& get(const std::string& key) { return store[key]; }
+
+  // Concatenate all key/value into a command separated list of "key=value" entries.
+  std::string join();
+
+ private:
+  std::vector<std::string> keys;
+  std::unordered_map<std::string, std::string> store;
+};
+
+}  // namespace adbconnection
+
+#endif  // ART_ADBCONNECTION_JDWPARGS_H_
diff --git a/artd/Android.bp b/artd/Android.bp
index 4862914..50f5428 100644
--- a/artd/Android.bp
+++ b/artd/Android.bp
@@ -35,8 +35,6 @@
         "profman_headers",
     ],
     shared_libs: [
-        "libartservice",
-        "libarttools", // Contains "libc++fs".
         "libbase",
         "libbinder_ndk",
         "libselinux",
@@ -56,6 +54,9 @@
     shared_libs: [
         "libart",
         "libartbase",
+        "libartservice",
+        "libarttools", // Contains "libc++fs".
+        "libdexfile",
     ],
     apex_available: [
         "com.android.art",
@@ -66,12 +67,8 @@
 art_cc_defaults {
     name: "art_artd_tests_defaults",
     defaults: ["artd_defaults"],
-    shared_libs: [
-        "libz", // libziparchive dependency; must be repeated here since it's a static lib.
-    ],
     static_libs: [
         "libgmock",
-        "libziparchive",
     ],
     srcs: [
         "artd_test.cc",
@@ -96,6 +93,11 @@
         "art_gtest_defaults",
         "art_artd_tests_defaults",
     ],
+    shared_libs: [
+        "libartservice",
+        "libarttools",
+        "libdexfile",
+    ],
 }
 
 // Standalone version of ART gtest `art_artd_tests`, not bundled with the ART
@@ -106,5 +108,40 @@
         "art_standalone_gtest_defaults",
         "art_artd_tests_defaults",
     ],
+    static_libs: [
+        "libartservice",
+        "libarttools",
+        "libdexfile",
+    ],
     test_config_template: "art_standalone_artd_tests.xml",
 }
+
+cc_fuzz {
+    name: "artd_fuzzer",
+    defaults: [
+        "service_fuzzer_defaults",
+        "art_module_source_build_defaults",
+        "artd_defaults",
+        // Fuzzer is on a special variant, different from the APEX variant. When
+        // linking against "libdexfile" as a shared library, the build system
+        // incorrectly picks the platform variant, which only exposes system
+        // APIs. As a workaround, we link against "libdexfile" as a static
+        // library.
+        "libdexfile_static_defaults",
+    ],
+    host_supported: true,
+    srcs: ["artd_fuzzer.cc"],
+    shared_libs: [
+        "libart",
+        "libartbase",
+        "libartservice",
+        "libarttools",
+        "libdexfile",
+        "liblog",
+    ],
+    fuzz_config: {
+        cc: [
+            "art-module-team@google.com",
+        ],
+    },
+}
diff --git a/artd/art_standalone_artd_tests.xml b/artd/art_standalone_artd_tests.xml
index 8a48b84..a5c6c99 100644
--- a/artd/art_standalone_artd_tests.xml
+++ b/artd/art_standalone_artd_tests.xml
@@ -15,6 +15,9 @@
 -->
 <!-- Note: This test config file for {MODULE} is generated from a template. -->
 <configuration description="Runs {MODULE}.">
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
+
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
         <option name="cleanup" value="true" />
         <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}/{MODULE}" />
@@ -30,8 +33,6 @@
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp/{MODULE}" />
         <option name="module-name" value="{MODULE}" />
-        <option name="ld-library-path-32" value="/apex/com.android.art/lib" />
-        <option name="ld-library-path-64" value="/apex/com.android.art/lib64" />
     </test>
 
     <!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
diff --git a/artd/artd.cc b/artd/artd.cc
index 8df6a70..c44013b 100644
--- a/artd/artd.cc
+++ b/artd/artd.cc
@@ -25,10 +25,12 @@
 
 #include <climits>
 #include <csignal>
+#include <cstddef>
 #include <cstdint>
 #include <cstring>
 #include <filesystem>
 #include <functional>
+#include <iterator>
 #include <map>
 #include <memory>
 #include <mutex>
@@ -61,14 +63,17 @@
 #include "base/globals.h"
 #include "base/logging.h"
 #include "base/macros.h"
+#include "base/mem_map.h"
+#include "base/memfd.h"
 #include "base/os.h"
 #include "base/zip_archive.h"
 #include "cmdline_types.h"
+#include "dex/dex_file_loader.h"
 #include "exec_utils.h"
 #include "file_utils.h"
 #include "fstab/fstab.h"
-#include "oat_file_assistant.h"
-#include "oat_file_assistant_context.h"
+#include "oat/oat_file_assistant.h"
+#include "oat/oat_file_assistant_context.h"
 #include "path_utils.h"
 #include "profman/profman_result.h"
 #include "selinux/android.h"
@@ -82,6 +87,7 @@
 namespace {
 
 using ::aidl::com::android::server::art::ArtdDexoptResult;
+using ::aidl::com::android::server::art::ArtifactsLocation;
 using ::aidl::com::android::server::art::ArtifactsPath;
 using ::aidl::com::android::server::art::CopyAndRewriteProfileResult;
 using ::aidl::com::android::server::art::DexMetadataPath;
@@ -97,8 +103,10 @@
 using ::aidl::com::android::server::art::OutputProfile;
 using ::aidl::com::android::server::art::PriorityClass;
 using ::aidl::com::android::server::art::ProfilePath;
+using ::aidl::com::android::server::art::RuntimeArtifactsPath;
 using ::aidl::com::android::server::art::VdexPath;
 using ::android::base::Dirname;
+using ::android::base::ErrnoError;
 using ::android::base::Error;
 using ::android::base::Join;
 using ::android::base::make_scope_guard;
@@ -112,10 +120,10 @@
 using ::art::tools::CmdlineBuilder;
 using ::ndk::ScopedAStatus;
 
-using ArtifactsLocation = GetDexoptNeededResult::ArtifactsLocation;
 using TmpProfilePath = ProfilePath::TmpProfilePath;
 
 constexpr const char* kServiceName = "artd";
+constexpr const char* kPreRebootServiceName = "artd_pre_reboot";
 constexpr const char* kArtdCancellationSignalType = "ArtdCancellationSignal";
 
 // Timeout for short operations, such as merging profiles.
@@ -335,7 +343,8 @@
 }
 
 Result<void> SetLogVerbosity() {
-  std::string options = android::base::GetProperty("dalvik.vm.artd-verbose", /*default_value=*/"");
+  std::string options =
+      android::base::GetProperty("dalvik.vm.artd-verbose", /*default_value=*/"oat");
   if (options.empty()) {
     return {};
   }
@@ -396,6 +405,83 @@
   return bad_profile("The profile is in the wrong format or an I/O error has occurred");
 }
 
+// Returns the fd on success, or an invalid fd if the dex file contains no profile, or error if any
+// error occurs.
+Result<File> ExtractEmbeddedProfileToFd(const std::string& dex_path) {
+  std::unique_ptr<File> dex_file = OR_RETURN(OpenFileForReading(dex_path));
+
+  std::string error_msg;
+  uint32_t magic;
+  if (!ReadMagicAndReset(dex_file->Fd(), &magic, &error_msg)) {
+    return Error() << error_msg;
+  }
+  if (!IsZipMagic(magic)) {
+    if (DexFileLoader::IsMagicValid(magic)) {
+      // The dex file can be a plain dex file. This is expected.
+      return File();
+    }
+    return Error() << "File is neither a zip file nor a plain dex file";
+  }
+
+  std::unique_ptr<ZipArchive> zip_archive(
+      ZipArchive::OpenFromOwnedFd(dex_file->Fd(), dex_path.c_str(), &error_msg));
+  if (zip_archive == nullptr) {
+    return Error() << error_msg;
+  }
+  constexpr const char* kEmbeddedProfileEntry = "assets/art-profile/baseline.prof";
+  std::unique_ptr<ZipEntry> zip_entry(zip_archive->Find(kEmbeddedProfileEntry, &error_msg));
+  size_t size;
+  if (zip_entry == nullptr || (size = zip_entry->GetUncompressedLength()) == 0) {
+    // From system/libziparchive/zip_error.cpp.
+    constexpr const char* kEntryNotFound = "Entry not found";
+    if (error_msg != kEntryNotFound) {
+      LOG(WARNING) << ART_FORMAT(
+          "Failed to find zip entry '{}' in '{}': {}", kEmbeddedProfileEntry, dex_path, error_msg);
+    }
+    // The dex file doesn't necessarily contain a profile. This is expected.
+    return File();
+  }
+
+  // The name is for debugging only.
+  std::string memfd_name =
+      ART_FORMAT("{} extracted in memory from {}", kEmbeddedProfileEntry, dex_path);
+  File memfd(memfd_create(memfd_name.c_str(), /*flags=*/0),
+             memfd_name,
+             /*check_usage=*/false);
+  if (!memfd.IsValid()) {
+    return ErrnoError() << "Failed to create memfd";
+  }
+  if (ftruncate(memfd.Fd(), size) != 0) {
+    return ErrnoError() << "Failed to ftruncate memfd";
+  }
+  // Map with MAP_SHARED because we're feeding the fd to profman.
+  MemMap mem_map = MemMap::MapFile(size,
+                                   PROT_READ | PROT_WRITE,
+                                   MAP_SHARED,
+                                   memfd.Fd(),
+                                   /*start=*/0,
+                                   /*low_4gb=*/false,
+                                   memfd_name.c_str(),
+                                   &error_msg);
+  if (!mem_map.IsValid()) {
+    return Errorf("Failed to mmap memfd: {}", error_msg);
+  }
+  if (!zip_entry->ExtractToMemory(mem_map.Begin(), &error_msg)) {
+    return Errorf("Failed to extract '{}': {}", kEmbeddedProfileEntry, error_msg);
+  }
+
+  // Reopen the memfd with readonly to make SELinux happy when the fd is passed to a child process
+  // who doesn't have write permission. (b/303909581)
+  std::string path = ART_FORMAT("/proc/self/fd/{}", memfd.Fd());
+  File memfd_readonly(
+      open(path.c_str(), O_RDONLY), memfd_name, /*check_usage=*/false, /*read_only_mode=*/true);
+  if (!memfd_readonly.IsOpened()) {
+    return ErrnoErrorf("Failed to open file '{}' ('{}')", path, memfd_name);
+  }
+
+  return memfd_readonly;
+}
+
 class FdLogger {
  public:
   void Add(const NewFile& file) { fd_mapping_.emplace_back(file.Fd(), file.TempPath()); }
@@ -425,17 +511,24 @@
 
 }  // namespace
 
-#define OR_RETURN_ERROR(func, expr)         \
-  ({                                        \
-    decltype(expr)&& tmp = (expr);          \
-    if (!tmp.ok()) {                        \
-      return (func)(tmp.error().message()); \
-    }                                       \
-    std::move(tmp).value();                 \
+#define OR_RETURN_ERROR(func, expr)                           \
+  ({                                                          \
+    decltype(expr)&& __or_return_error_tmp = (expr);          \
+    if (!__or_return_error_tmp.ok()) {                        \
+      return (func)(__or_return_error_tmp.error().message()); \
+    }                                                         \
+    std::move(__or_return_error_tmp).value();                 \
   })
 
 #define OR_RETURN_FATAL(expr)     OR_RETURN_ERROR(Fatal, expr)
 #define OR_RETURN_NON_FATAL(expr) OR_RETURN_ERROR(NonFatal, expr)
+#define OR_LOG_AND_RETURN_OK(expr)     \
+  OR_RETURN_ERROR(                     \
+      [](const std::string& message) { \
+        LOG(ERROR) << message;         \
+        return ScopedAStatus::ok();    \
+      },                               \
+      expr)
 
 ScopedAStatus Artd::isAlive(bool* _aidl_return) {
   *_aidl_return = true;
@@ -477,10 +570,13 @@
   }
 
   std::string ignored_odex_status;
+  OatFileAssistant::Location location;
   oat_file_assistant->GetOptimizationStatus(&_aidl_return->locationDebugString,
                                             &_aidl_return->compilerFilter,
                                             &_aidl_return->compilationReason,
-                                            &ignored_odex_status);
+                                            &ignored_odex_status,
+                                            &location);
+  _aidl_return->artifactsLocation = ArtifactsLocationToAidl(location);
 
   // We ignore odex_status because it is not meaningful. It can only be either "up-to-date",
   // "apk-more-recent", or "io-error-no-oat", which means it doesn't give us information in addition
@@ -543,13 +639,12 @@
   return ScopedAStatus::ok();
 }
 
-ndk::ScopedAStatus Artd::copyAndRewriteProfile(const ProfilePath& in_src,
-                                               OutputProfile* in_dst,
-                                               const std::string& in_dexFile,
-                                               CopyAndRewriteProfileResult* _aidl_return) {
-  std::string src_path = OR_RETURN_FATAL(BuildProfileOrDmPath(in_src));
-  std::string dst_path = OR_RETURN_FATAL(BuildFinalProfilePath(in_dst->profilePath));
-  OR_RETURN_FATAL(ValidateDexPath(in_dexFile));
+ndk::ScopedAStatus Artd::CopyAndRewriteProfileImpl(File src,
+                                                   OutputProfile* dst_aidl,
+                                                   const std::string& dex_path,
+                                                   CopyAndRewriteProfileResult* aidl_return) {
+  std::string dst_path = OR_RETURN_FATAL(BuildFinalProfilePath(dst_aidl->profilePath));
+  OR_RETURN_FATAL(ValidateDexPath(dex_path));
 
   FdLogger fd_logger;
 
@@ -559,24 +654,15 @@
   CmdlineBuilder args;
   args.Add(OR_RETURN_FATAL(GetProfman())).Add("--copy-and-update-profile-key");
 
-  Result<std::unique_ptr<File>> src = OpenFileForReading(src_path);
-  if (!src.ok()) {
-    if (src.error().code() == ENOENT) {
-      _aidl_return->status = CopyAndRewriteProfileResult::Status::NO_PROFILE;
-      return ScopedAStatus::ok();
-    }
-    return NonFatal(
-        ART_FORMAT("Failed to open src profile '{}': {}", src_path, src.error().message()));
-  }
-  args.Add("--profile-file-fd=%d", src.value()->Fd());
-  fd_logger.Add(*src.value());
+  args.Add("--profile-file-fd=%d", src.Fd());
+  fd_logger.Add(src);
 
-  std::unique_ptr<File> dex_file = OR_RETURN_NON_FATAL(OpenFileForReading(in_dexFile));
+  std::unique_ptr<File> dex_file = OR_RETURN_NON_FATAL(OpenFileForReading(dex_path));
   args.Add("--apk-fd=%d", dex_file->Fd());
   fd_logger.Add(*dex_file);
 
   std::unique_ptr<NewFile> dst =
-      OR_RETURN_NON_FATAL(NewFile::Create(dst_path, in_dst->fsPermission));
+      OR_RETURN_NON_FATAL(NewFile::Create(dst_path, dst_aidl->fsPermission));
   args.Add("--reference-profile-file-fd=%d", dst->Fd());
   fd_logger.Add(*dst);
 
@@ -594,8 +680,8 @@
 
   if (result.value() == ProfmanResult::kCopyAndUpdateNoMatch ||
       result.value() == ProfmanResult::kCopyAndUpdateErrorFailedToLoadProfile) {
-    *_aidl_return = AnalyzeCopyAndRewriteProfileFailure(
-        src->get(), static_cast<ProfmanResult::CopyAndUpdateResult>(result.value()));
+    *aidl_return = AnalyzeCopyAndRewriteProfileFailure(
+        &src, static_cast<ProfmanResult::CopyAndUpdateResult>(result.value()));
     return ScopedAStatus::ok();
   }
 
@@ -604,12 +690,49 @@
   }
 
   OR_RETURN_NON_FATAL(dst->Keep());
-  _aidl_return->status = CopyAndRewriteProfileResult::Status::SUCCESS;
-  in_dst->profilePath.id = dst->TempId();
-  in_dst->profilePath.tmpPath = dst->TempPath();
+  aidl_return->status = CopyAndRewriteProfileResult::Status::SUCCESS;
+  dst_aidl->profilePath.id = dst->TempId();
+  dst_aidl->profilePath.tmpPath = dst->TempPath();
   return ScopedAStatus::ok();
 }
 
+ndk::ScopedAStatus Artd::copyAndRewriteProfile(const ProfilePath& in_src,
+                                               OutputProfile* in_dst,
+                                               const std::string& in_dexFile,
+                                               CopyAndRewriteProfileResult* _aidl_return) {
+  std::string src_path = OR_RETURN_FATAL(BuildProfileOrDmPath(in_src));
+
+  Result<std::unique_ptr<File>> src = OpenFileForReading(src_path);
+  if (!src.ok()) {
+    if (src.error().code() == ENOENT) {
+      _aidl_return->status = CopyAndRewriteProfileResult::Status::NO_PROFILE;
+      return ScopedAStatus::ok();
+    }
+    return NonFatal(
+        ART_FORMAT("Failed to open src profile '{}': {}", src_path, src.error().message()));
+  }
+
+  return CopyAndRewriteProfileImpl(std::move(*src.value()), in_dst, in_dexFile, _aidl_return);
+}
+
+ndk::ScopedAStatus Artd::copyAndRewriteEmbeddedProfile(OutputProfile* in_dst,
+                                                       const std::string& in_dexFile,
+                                                       CopyAndRewriteProfileResult* _aidl_return) {
+  OR_RETURN_FATAL(ValidateDexPath(in_dexFile));
+
+  Result<File> src = ExtractEmbeddedProfileToFd(in_dexFile);
+  if (!src.ok()) {
+    return NonFatal(ART_FORMAT(
+        "Failed to extract profile from dex file '{}': {}", in_dexFile, src.error().message()));
+  }
+  if (!src->IsValid()) {
+    _aidl_return->status = CopyAndRewriteProfileResult::Status::NO_PROFILE;
+    return ScopedAStatus::ok();
+  }
+
+  return CopyAndRewriteProfileImpl(std::move(src.value()), in_dst, in_dexFile, _aidl_return);
+}
+
 ndk::ScopedAStatus Artd::commitTmpProfile(const TmpProfilePath& in_profile) {
   std::string tmp_profile_path = OR_RETURN_FATAL(BuildTmpProfilePath(in_profile));
   std::string ref_profile_path = OR_RETURN_FATAL(BuildFinalProfilePath(in_profile));
@@ -862,7 +985,7 @@
 
   std::unique_ptr<ClassLoaderContext> context = nullptr;
   if (in_classLoaderContext.has_value()) {
-    context = ClassLoaderContext::Create(in_classLoaderContext->c_str());
+    context = ClassLoaderContext::Create(in_classLoaderContext.value());
     if (context == nullptr) {
       return Fatal(
           ART_FORMAT("Class loader context '{}' is invalid", in_classLoaderContext.value()));
@@ -951,7 +1074,7 @@
   std::vector<std::unique_ptr<File>> context_files;
   if (context != nullptr) {
     std::vector<std::string> flattened_context = context->FlattenDexPaths();
-    std::string dex_dir = Dirname(in_dexFile.c_str());
+    std::string dex_dir = Dirname(in_dexFile);
     std::vector<int> context_fds;
     for (const std::string& context_element : flattened_context) {
       std::string context_path = std::filesystem::path(dex_dir).append(context_element);
@@ -1099,6 +1222,7 @@
 ScopedAStatus Artd::cleanup(const std::vector<ProfilePath>& in_profilesToKeep,
                             const std::vector<ArtifactsPath>& in_artifactsToKeep,
                             const std::vector<VdexPath>& in_vdexFilesToKeep,
+                            const std::vector<RuntimeArtifactsPath>& in_runtimeArtifactsToKeep,
                             int64_t* _aidl_return) {
   std::unordered_set<std::string> files_to_keep;
   for (const ProfilePath& profile : in_profilesToKeep) {
@@ -1113,8 +1237,16 @@
   for (const VdexPath& vdex : in_vdexFilesToKeep) {
     files_to_keep.insert(OR_RETURN_FATAL(BuildVdexPath(vdex)));
   }
+  std::string android_data = OR_RETURN_NON_FATAL(GetAndroidDataOrError());
+  std::string android_expand = OR_RETURN_NON_FATAL(GetAndroidExpandOrError());
+  for (const RuntimeArtifactsPath& runtime_image_path : in_runtimeArtifactsToKeep) {
+    OR_RETURN_FATAL(ValidateRuntimeArtifactsPath(runtime_image_path));
+    std::vector<std::string> files =
+        ListRuntimeArtifactsFiles(android_data, android_expand, runtime_image_path);
+    std::move(files.begin(), files.end(), std::inserter(files_to_keep, files_to_keep.end()));
+  }
   *_aidl_return = 0;
-  for (const std::string& file : OR_RETURN_NON_FATAL(ListManagedFiles())) {
+  for (const std::string& file : ListManagedFiles(android_data, android_expand)) {
     if (files_to_keep.find(file) == files_to_keep.end()) {
       LOG(INFO) << ART_FORMAT("Cleaning up obsolete file '{}'", file);
       *_aidl_return += GetSizeAndDeleteFile(file);
@@ -1154,11 +1286,59 @@
   return NonFatal(ART_FORMAT("Fstab entries not found for '{}'", in_dexFile));
 }
 
+ScopedAStatus Artd::deleteRuntimeArtifacts(const RuntimeArtifactsPath& in_runtimeArtifactsPath,
+                                           int64_t* _aidl_return) {
+  OR_RETURN_FATAL(ValidateRuntimeArtifactsPath(in_runtimeArtifactsPath));
+  *_aidl_return = 0;
+  std::string android_data = OR_LOG_AND_RETURN_OK(GetAndroidDataOrError());
+  std::string android_expand = OR_LOG_AND_RETURN_OK(GetAndroidExpandOrError());
+  for (const std::string& file :
+       ListRuntimeArtifactsFiles(android_data, android_expand, in_runtimeArtifactsPath)) {
+    *_aidl_return += GetSizeAndDeleteFile(file);
+  }
+  return ScopedAStatus::ok();
+}
+
+ScopedAStatus Artd::getArtifactsSize(const ArtifactsPath& in_artifactsPath, int64_t* _aidl_return) {
+  std::string oat_path = OR_RETURN_FATAL(BuildOatPath(in_artifactsPath));
+  *_aidl_return = 0;
+  *_aidl_return += GetSize(oat_path).value_or(0);
+  *_aidl_return += GetSize(OatPathToVdexPath(oat_path)).value_or(0);
+  *_aidl_return += GetSize(OatPathToArtPath(oat_path)).value_or(0);
+  return ScopedAStatus::ok();
+}
+
+ScopedAStatus Artd::getVdexFileSize(const VdexPath& in_vdexPath, int64_t* _aidl_return) {
+  std::string vdex_path = OR_RETURN_FATAL(BuildVdexPath(in_vdexPath));
+  *_aidl_return = GetSize(vdex_path).value_or(0);
+  return ScopedAStatus::ok();
+}
+
+ScopedAStatus Artd::getRuntimeArtifactsSize(const RuntimeArtifactsPath& in_runtimeArtifactsPath,
+                                            int64_t* _aidl_return) {
+  OR_RETURN_FATAL(ValidateRuntimeArtifactsPath(in_runtimeArtifactsPath));
+  *_aidl_return = 0;
+  std::string android_data = OR_LOG_AND_RETURN_OK(GetAndroidDataOrError());
+  std::string android_expand = OR_LOG_AND_RETURN_OK(GetAndroidExpandOrError());
+  for (const std::string& file :
+       ListRuntimeArtifactsFiles(android_data, android_expand, in_runtimeArtifactsPath)) {
+    *_aidl_return += GetSize(file).value_or(0);
+  }
+  return ScopedAStatus::ok();
+}
+
+ScopedAStatus Artd::getProfileSize(const ProfilePath& in_profile, int64_t* _aidl_return) {
+  std::string profile_path = OR_RETURN_FATAL(BuildProfileOrDmPath(in_profile));
+  *_aidl_return = GetSize(profile_path).value_or(0);
+  return ScopedAStatus::ok();
+}
+
 Result<void> Artd::Start() {
   OR_RETURN(SetLogVerbosity());
+  MemMap::Init();
 
-  ScopedAStatus status = ScopedAStatus::fromStatus(
-      AServiceManager_registerLazyService(this->asBinder().get(), kServiceName));
+  ScopedAStatus status = ScopedAStatus::fromStatus(AServiceManager_registerLazyService(
+      this->asBinder().get(), options_.is_pre_reboot ? kPreRebootServiceName : kServiceName));
   if (!status.isOk()) {
     return Error() << status.getDescription();
   }
diff --git a/artd/artd.h b/artd/artd.h
index da85a03..f1dc18a 100644
--- a/artd/artd.h
+++ b/artd/artd.h
@@ -39,13 +39,19 @@
 #include "android/binder_auto_utils.h"
 #include "base/os.h"
 #include "exec_utils.h"
-#include "oat_file_assistant_context.h"
+#include "oat/oat_file_assistant_context.h"
 #include "tools/cmdline_builder.h"
 #include "tools/system_properties.h"
 
 namespace art {
 namespace artd {
 
+struct Options {
+  // If true, this artd instance is for Pre-reboot Dexopt. It runs in a chroot environment that is
+  // set up by dexopt_chroot_setup.
+  bool is_pre_reboot = false;
+};
+
 class ArtdCancellationSignal : public aidl::com::android::server::art::BnArtdCancellationSignal {
  public:
   explicit ArtdCancellationSignal(std::function<int(pid_t, int)> kill_func)
@@ -69,12 +75,14 @@
 
 class Artd : public aidl::com::android::server::art::BnArtd {
  public:
-  explicit Artd(std::unique_ptr<art::tools::SystemProperties> props =
+  explicit Artd(Options&& options,
+                std::unique_ptr<art::tools::SystemProperties> props =
                     std::make_unique<art::tools::SystemProperties>(),
                 std::unique_ptr<ExecUtils> exec_utils = std::make_unique<ExecUtils>(),
                 std::function<int(pid_t, int)> kill_func = kill,
                 std::function<int(int, struct stat*)> fstat_func = fstat)
-      : props_(std::move(props)),
+      : options_(std::move(options)),
+        props_(std::move(props)),
         exec_utils_(std::move(exec_utils)),
         kill_(std::move(kill_func)),
         fstat_(std::move(fstat_func)) {}
@@ -101,6 +109,11 @@
       const std::string& in_dexFile,
       aidl::com::android::server::art::CopyAndRewriteProfileResult* _aidl_return) override;
 
+  ndk::ScopedAStatus copyAndRewriteEmbeddedProfile(
+      aidl::com::android::server::art::OutputProfile* in_dst,
+      const std::string& in_dexFile,
+      aidl::com::android::server::art::CopyAndRewriteProfileResult* _aidl_return) override;
+
   ndk::ScopedAStatus commitTmpProfile(
       const aidl::com::android::server::art::ProfilePath::TmpProfilePath& in_profile) override;
 
@@ -162,10 +175,30 @@
       const std::vector<aidl::com::android::server::art::ProfilePath>& in_profilesToKeep,
       const std::vector<aidl::com::android::server::art::ArtifactsPath>& in_artifactsToKeep,
       const std::vector<aidl::com::android::server::art::VdexPath>& in_vdexFilesToKeep,
+      const std::vector<aidl::com::android::server::art::RuntimeArtifactsPath>&
+          in_runtimeArtifactsToKeep,
       int64_t* _aidl_return) override;
 
   ndk::ScopedAStatus isInDalvikCache(const std::string& in_dexFile, bool* _aidl_return) override;
 
+  ndk::ScopedAStatus deleteRuntimeArtifacts(
+      const aidl::com::android::server::art::RuntimeArtifactsPath& in_runtimeArtifactsPath,
+      int64_t* _aidl_return) override;
+
+  ndk::ScopedAStatus getArtifactsSize(
+      const aidl::com::android::server::art::ArtifactsPath& in_artifactsPath,
+      int64_t* _aidl_return) override;
+
+  ndk::ScopedAStatus getVdexFileSize(const aidl::com::android::server::art::VdexPath& in_vdexPath,
+                                     int64_t* _aidl_return) override;
+
+  ndk::ScopedAStatus getRuntimeArtifactsSize(
+      const aidl::com::android::server::art::RuntimeArtifactsPath& in_runtimeArtifactsPath,
+      int64_t* _aidl_return) override;
+
+  ndk::ScopedAStatus getProfileSize(const aidl::com::android::server::art::ProfilePath& in_profile,
+                                    int64_t* _aidl_return) override;
+
   android::base::Result<void> Start();
 
  private:
@@ -215,6 +248,12 @@
 
   android::base::Result<struct stat> Fstat(const art::File& file) const;
 
+  ndk::ScopedAStatus CopyAndRewriteProfileImpl(
+      File src,
+      aidl::com::android::server::art::OutputProfile* dst_aidl,
+      const std::string& dex_path,
+      aidl::com::android::server::art::CopyAndRewriteProfileResult* aidl_return);
+
   std::mutex cache_mu_;
   std::optional<std::vector<std::string>> cached_boot_image_locations_ GUARDED_BY(cache_mu_);
   std::optional<std::vector<std::string>> cached_boot_class_path_ GUARDED_BY(cache_mu_);
@@ -225,6 +264,7 @@
   std::mutex ofa_context_mu_;
   std::unique_ptr<OatFileAssistantContext> ofa_context_ GUARDED_BY(ofa_context_mu_);
 
+  const Options options_;
   const std::unique_ptr<art::tools::SystemProperties> props_;
   const std::unique_ptr<ExecUtils> exec_utils_;
   const std::function<int(pid_t, int)> kill_;
diff --git a/artd/artd_fuzzer.cc b/artd/artd_fuzzer.cc
new file mode 100644
index 0000000..23d9a90
--- /dev/null
+++ b/artd/artd_fuzzer.cc
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "artd.h"
+#include "fuzzbinder/libbinder_ndk_driver.h"
+#include "fuzzer/FuzzedDataProvider.h"
+
+using ::android::fuzzService;
+using ::art::artd::Artd;
+using ::ndk::SharedRefBase;
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  auto artd = SharedRefBase::make<Artd>(art::artd::Options());
+
+  fuzzService(artd->asBinder().get(), FuzzedDataProvider(data, size));
+
+  return 0;
+}
diff --git a/artd/artd_main.cc b/artd/artd_main.cc
index 3644eba..212e9c4 100644
--- a/artd/artd_main.cc
+++ b/artd/artd_main.cc
@@ -22,10 +22,39 @@
 #include "android/binder_process.h"
 #include "artd.h"
 
-int main(int argc ATTRIBUTE_UNUSED, char* argv[]) {
+namespace art {
+namespace artd {
+namespace {
+
+constexpr int kErrorUsage = 100;
+
+[[noreturn]] void ParseError(const std::string& error_msg) {
+  LOG(ERROR) << error_msg;
+  std::cerr << error_msg << "\n";
+  exit(kErrorUsage);
+}
+
+Options ParseOptions(int argc, char** argv) {
+  Options options;
+  for (int i = 1; i < argc; i++) {
+    std::string_view arg = argv[i];
+    if (arg == "--pre-reboot") {
+      options.is_pre_reboot = true;
+    } else {
+      ParseError("Unknown option " + std::string(arg));
+    }
+  }
+  return options;
+}
+
+}  // namespace
+}  // namespace artd
+}  // namespace art
+
+int main([[maybe_unused]] int argc, char* argv[]) {
   android::base::InitLogging(argv);
 
-  auto artd = ndk::SharedRefBase::make<art::artd::Artd>();
+  auto artd = ndk::SharedRefBase::make<art::artd::Artd>(art::artd::ParseOptions(argc, argv));
 
   LOG(INFO) << "Starting artd";
 
diff --git a/artd/artd_test.cc b/artd/artd_test.cc
index f1806e1..8a70446 100644
--- a/artd/artd_test.cc
+++ b/artd/artd_test.cc
@@ -26,6 +26,7 @@
 #include <condition_variable>
 #include <csignal>
 #include <cstdio>
+#include <cstring>
 #include <filesystem>
 #include <functional>
 #include <memory>
@@ -57,7 +58,7 @@
 #include "exec_utils.h"
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 #include "path_utils.h"
 #include "profman/profman_result.h"
 #include "testing.h"
@@ -76,12 +77,12 @@
 using ::aidl::com::android::server::art::DexoptOptions;
 using ::aidl::com::android::server::art::FileVisibility;
 using ::aidl::com::android::server::art::FsPermission;
-using ::aidl::com::android::server::art::GetDexoptStatusResult;
 using ::aidl::com::android::server::art::IArtdCancellationSignal;
 using ::aidl::com::android::server::art::OutputArtifacts;
 using ::aidl::com::android::server::art::OutputProfile;
 using ::aidl::com::android::server::art::PriorityClass;
 using ::aidl::com::android::server::art::ProfilePath;
+using ::aidl::com::android::server::art::RuntimeArtifactsPath;
 using ::aidl::com::android::server::art::VdexPath;
 using ::android::base::Append;
 using ::android::base::Error;
@@ -120,7 +121,7 @@
 using PrimaryRefProfilePath = ProfilePath::PrimaryRefProfilePath;
 using TmpProfilePath = ProfilePath::TmpProfilePath;
 
-constexpr uid_t kRootUid = 0;
+using std::literals::operator""s;  // NOLINT
 
 ScopeGuard<std::function<void()>> ScopedSetLogger(android::base::LogFunction&& logger) {
   android::base::LogFunction old_logger = android::base::SetLogger(std::move(logger));
@@ -319,7 +320,8 @@
     EXPECT_CALL(*mock_props_, GetProperty).Times(AnyNumber()).WillRepeatedly(Return(""));
     auto mock_exec_utils = std::make_unique<MockExecUtils>();
     mock_exec_utils_ = mock_exec_utils.get();
-    artd_ = ndk::SharedRefBase::make<Artd>(std::move(mock_props),
+    artd_ = ndk::SharedRefBase::make<Artd>(Options(),
+                                           std::move(mock_props),
                                            std::move(mock_exec_utils),
                                            mock_kill_.AsStdFunction(),
                                            mock_fstat_.AsStdFunction());
@@ -328,6 +330,8 @@
     // Remove the trailing '/';
     scratch_path_.resize(scratch_path_.length() - 1);
 
+    TestOnlySetListRootDir(scratch_path_);
+
     ON_CALL(mock_fstat_, Call).WillByDefault(fstat);
 
     // Use an arbitrary existing directory as ART root.
@@ -399,7 +403,7 @@
                  std::shared_ptr<IArtdCancellationSignal> cancellation_signal = nullptr) {
     RunDexopt(Property(&ndk::ScopedAStatus::getExceptionCode, expected_status),
               std::move(aidl_return_matcher),
-              cancellation_signal);
+              std::move(cancellation_signal));
   }
 
   void RunDexopt(Matcher<ndk::ScopedAStatus> status_matcher,
@@ -429,11 +433,14 @@
     }
   }
 
+  template <bool kExpectOk>
+  using RunCopyAndRewriteProfileResult = Result<
+      std::pair<std::conditional_t<kExpectOk, CopyAndRewriteProfileResult, ndk::ScopedAStatus>,
+                OutputProfile>>;
+
   // Runs `copyAndRewriteProfile` with `tmp_profile_path_` and `dex_file_`.
   template <bool kExpectOk = true>
-  Result<std::pair<std::conditional_t<kExpectOk, CopyAndRewriteProfileResult, ndk::ScopedAStatus>,
-                   OutputProfile>>
-  RunCopyAndRewriteProfile() {
+  RunCopyAndRewriteProfileResult<kExpectOk> RunCopyAndRewriteProfile() {
     OutputProfile dst{.profilePath = tmp_profile_path_,
                       .fsPermission = FsPermission{.uid = -1, .gid = -1}};
     dst.profilePath.id = "";
@@ -452,6 +459,26 @@
     }
   }
 
+  // Runs `copyAndRewriteEmbeddedProfile` with `dex_file_`.
+  template <bool kExpectOk = true>
+  RunCopyAndRewriteProfileResult<kExpectOk> RunCopyAndRewriteEmbeddedProfile() {
+    OutputProfile dst{.profilePath = tmp_profile_path_,
+                      .fsPermission = FsPermission{.uid = -1, .gid = -1}};
+    dst.profilePath.id = "";
+    dst.profilePath.tmpPath = "";
+
+    CopyAndRewriteProfileResult result;
+    ndk::ScopedAStatus status = artd_->copyAndRewriteEmbeddedProfile(&dst, dex_file_, &result);
+    if constexpr (kExpectOk) {
+      if (!status.isOk()) {
+        return Error() << status.getMessage();
+      }
+      return std::make_pair(std::move(result), std::move(dst));
+    } else {
+      return std::make_pair(std::move(status), std::move(dst));
+    }
+  }
+
   void CreateFile(const std::string& filename, const std::string& content = "") {
     std::filesystem::path path(filename);
     std::filesystem::create_directories(path.parent_path());
@@ -461,8 +488,10 @@
   void CreateZipWithSingleEntry(const std::string& filename,
                                 const std::string& entry_name,
                                 const std::string& content = "") {
+    std::filesystem::path path(filename);
+    std::filesystem::create_directories(path.parent_path());
     std::unique_ptr<File> file(OS::CreateEmptyFileWriteOnly(filename.c_str()));
-    ASSERT_NE(file, nullptr);
+    ASSERT_NE(file, nullptr) << strerror(errno);
     file->MarkUnchecked();  // `writer.Finish()` flushes the file and the destructor closes it.
     ZipWriter writer(fdopen(file->Fd(), "wb"));
     ASSERT_EQ(writer.StartEntry(entry_name, /*flags=*/0), 0);
@@ -537,7 +566,7 @@
   }
 };
 
-TEST_F(ArtdTest, ConstantsAreInSync) { EXPECT_EQ(ArtConstants::REASON_VDEX, kReasonVdex); }
+TEST_F(ArtdTest, ConstantsAreInSync) { EXPECT_STREQ(ArtConstants::REASON_VDEX, kReasonVdex); }
 
 TEST_F(ArtdTest, isAlive) {
   bool result = false;
@@ -1534,6 +1563,85 @@
   EXPECT_THAT(dst.profilePath.tmpPath, IsEmpty());
 }
 
+TEST_F(ArtdTest, copyAndRewriteEmbeddedProfileSuccess) {
+  CreateZipWithSingleEntry(dex_file_, "assets/art-profile/baseline.prof", "valid_profile");
+
+  EXPECT_CALL(
+      *mock_exec_utils_,
+      DoExecAndReturnCode(
+          AllOf(WhenSplitBy(
+                    "--",
+                    AllOf(Contains(art_root_ + "/bin/art_exec"), Contains("--drop-capabilities")),
+                    AllOf(Contains(art_root_ + "/bin/profman"),
+                          Contains("--copy-and-update-profile-key"),
+                          Contains(Flag("--profile-file-fd=", FdHasContent("valid_profile"))),
+                          Contains(Flag("--apk-fd=", FdOf(dex_file_))))),
+                HasKeepFdsFor("--profile-file-fd=", "--reference-profile-file-fd=", "--apk-fd=")),
+          _,
+          _))
+      .WillOnce(DoAll(WithArg<0>(WriteToFdFlag("--reference-profile-file-fd=", "def")),
+                      Return(ProfmanResult::kCopyAndUpdateSuccess)));
+
+  auto [result, dst] = OR_FAIL(RunCopyAndRewriteEmbeddedProfile());
+
+  EXPECT_EQ(result.status, CopyAndRewriteProfileResult::Status::SUCCESS);
+  EXPECT_THAT(dst.profilePath.id, Not(IsEmpty()));
+  std::string real_path = OR_FATAL(BuildTmpProfilePath(dst.profilePath));
+  EXPECT_EQ(dst.profilePath.tmpPath, real_path);
+  CheckContent(real_path, "def");
+}
+
+// The input is a plain dex file.
+TEST_F(ArtdTest, copyAndRewriteEmbeddedProfileNoProfilePlainDex) {
+  constexpr const char* kDexMagic = "dex\n";
+  CreateFile(dex_file_, kDexMagic + "dex_code"s);
+
+  auto [result, dst] = OR_FAIL(RunCopyAndRewriteEmbeddedProfile());
+
+  EXPECT_EQ(result.status, CopyAndRewriteProfileResult::Status::NO_PROFILE);
+  EXPECT_THAT(dst.profilePath.id, IsEmpty());
+  EXPECT_THAT(dst.profilePath.tmpPath, IsEmpty());
+}
+
+// The input is neither a zip nor a plain dex file.
+TEST_F(ArtdTest, copyAndRewriteEmbeddedProfileNotZipNotDex) {
+  CreateFile(dex_file_, "wrong_format");
+
+  auto [status, dst] = OR_FAIL(RunCopyAndRewriteEmbeddedProfile</*kExpectOk=*/false>());
+
+  EXPECT_FALSE(status.isOk());
+  EXPECT_EQ(status.getExceptionCode(), EX_SERVICE_SPECIFIC);
+  EXPECT_THAT(status.getMessage(), HasSubstr("File is neither a zip file nor a plain dex file"));
+  EXPECT_THAT(dst.profilePath.id, IsEmpty());
+  EXPECT_THAT(dst.profilePath.tmpPath, IsEmpty());
+}
+
+// The input is a zip file without a profile entry.
+TEST_F(ArtdTest, copyAndRewriteEmbeddedProfileNoProfileZipNoEntry) {
+  CreateZipWithSingleEntry(dex_file_, "classes.dex", "dex_code");
+
+  auto [result, dst] = OR_FAIL(RunCopyAndRewriteEmbeddedProfile());
+
+  EXPECT_EQ(result.status, CopyAndRewriteProfileResult::Status::NO_PROFILE);
+  EXPECT_THAT(dst.profilePath.id, IsEmpty());
+  EXPECT_THAT(dst.profilePath.tmpPath, IsEmpty());
+}
+
+// The input is a zip file with a profile entry that doesn't match itself.
+TEST_F(ArtdTest, copyAndRewriteEmbeddedProfileBadProfileNoMatch) {
+  CreateZipWithSingleEntry(dex_file_, "assets/art-profile/baseline.prof", "no_match");
+
+  EXPECT_CALL(*mock_exec_utils_, DoExecAndReturnCode(_, _, _))
+      .WillOnce(Return(ProfmanResult::kCopyAndUpdateNoMatch));
+
+  auto [result, dst] = OR_FAIL(RunCopyAndRewriteEmbeddedProfile());
+
+  EXPECT_EQ(result.status, CopyAndRewriteProfileResult::Status::BAD_PROFILE);
+  EXPECT_THAT(result.errorMsg, HasSubstr("The profile does not match the APK"));
+  EXPECT_THAT(dst.profilePath.id, IsEmpty());
+  EXPECT_THAT(dst.profilePath.tmpPath, IsEmpty());
+}
+
 TEST_F(ArtdTest, commitTmpProfile) {
   std::string tmp_profile_file = OR_FATAL(BuildTmpProfilePath(tmp_profile_path_));
   CreateFile(tmp_profile_file);
@@ -1973,11 +2081,6 @@
 }
 
 TEST_F(ArtdTest, cleanup) {
-  // TODO(b/289037540): Fix this.
-  if (getuid() != kRootUid) {
-    GTEST_SKIP() << "This test requires root access";
-  }
-
   std::vector<std::string> gc_removed_files;
   std::vector<std::string> gc_kept_files;
 
@@ -2017,6 +2120,13 @@
   CreateGcKeptFile(android_data_ + "/user_de/0/com.android.foo/aaa/oat/arm64/2.odex");
   CreateGcKeptFile(android_data_ + "/user_de/0/com.android.foo/aaa/oat/arm64/2.vdex");
   CreateGcKeptFile(android_data_ + "/user_de/0/com.android.foo/aaa/oat/arm64/2.art");
+  CreateGcKeptFile(android_data_ + "/user_de/0/com.android.foo/cache/oat_primary/arm64/base.art");
+  CreateGcKeptFile(android_data_ + "/user/0/com.android.foo/cache/oat_primary/arm64/base.art");
+  CreateGcKeptFile(android_data_ + "/user/1/com.android.foo/cache/oat_primary/arm64/base.art");
+  CreateGcKeptFile(android_expand_ +
+                   "/123456-7890/user/1/com.android.foo/cache/oat_primary/arm64/base.art");
+  CreateGcKeptFile(android_data_ +
+                   "/user/0/com.android.foo/cache/not_oat_dir/oat_primary/arm64/base.art");
 
   // Files to remove.
   CreateGcRemovedFile(android_data_ + "/misc/profiles/ref/com.android.foo/primary.prof");
@@ -2051,6 +2161,12 @@
   CreateGcRemovedFile(android_data_ +
                       "/user_de/0/com.android.foo/aaa/bbb/oat/arm64/1.art.123456.tmp");
   CreateGcRemovedFile(android_data_ + "/user_de/0/com.android.bar/aaa/oat/arm64/1.vdex");
+  CreateGcRemovedFile(android_data_ +
+                      "/user/0/com.android.different_package/cache/oat_primary/arm64/base.art");
+  CreateGcRemovedFile(android_data_ +
+                      "/user/0/com.android.foo/cache/oat_primary/arm64/different_dex.art");
+  CreateGcRemovedFile(android_data_ +
+                      "/user/0/com.android.foo/cache/oat_primary/different_isa/base.art");
 
   int64_t aidl_return;
   ASSERT_TRUE(
@@ -2082,6 +2198,10 @@
                       .isa = "arm64",
                       .isInDalvikCache = false}},
               },
+              {
+                  RuntimeArtifactsPath{
+                      .packageName = "com.android.foo", .dexPath = "/a/b/base.apk", .isa = "arm64"},
+              },
               &aidl_return)
           .isOk());
 
@@ -2120,6 +2240,203 @@
   EXPECT_THAT(is_in_dalvik_cache("/foo"), HasValue(true));
 }
 
+TEST_F(ArtdTest, deleteRuntimeArtifacts) {
+  std::vector<std::string> removed_files;
+  std::vector<std::string> kept_files;
+
+  auto CreateRemovedFile = [&](const std::string& path) {
+    CreateFile(path);
+    removed_files.push_back(path);
+  };
+
+  auto CreateKeptFile = [&](const std::string& path) {
+    CreateFile(path);
+    kept_files.push_back(path);
+  };
+
+  CreateKeptFile(android_data_ +
+                 "/user/0/com.android.different_package/cache/oat_primary/arm64/base.art");
+  CreateKeptFile(android_data_ +
+                 "/user/0/com.android.foo/cache/oat_primary/arm64/different_dex.art");
+  CreateKeptFile(android_data_ +
+                 "/user/0/com.android.foo/cache/oat_primary/different_isa/base.art");
+  CreateKeptFile(android_data_ +
+                 "/user/0/com.android.foo/cache/not_oat_dir/oat_primary/arm64/base.art");
+
+  CreateRemovedFile(android_data_ + "/user_de/0/com.android.foo/cache/oat_primary/arm64/base.art");
+  CreateRemovedFile(android_data_ + "/user/0/com.android.foo/cache/oat_primary/arm64/base.art");
+  CreateRemovedFile(android_data_ + "/user/1/com.android.foo/cache/oat_primary/arm64/base.art");
+  CreateRemovedFile(android_expand_ +
+                    "/123456-7890/user/1/com.android.foo/cache/oat_primary/arm64/base.art");
+
+  int64_t aidl_return;
+  ASSERT_TRUE(
+      artd_
+          ->deleteRuntimeArtifacts(
+              {.packageName = "com.android.foo", .dexPath = "/a/b/base.apk", .isa = "arm64"},
+              &aidl_return)
+          .isOk());
+
+  for (const std::string& path : removed_files) {
+    EXPECT_FALSE(std::filesystem::exists(path)) << ART_FORMAT("'{}' should be removed", path);
+  }
+
+  for (const std::string& path : kept_files) {
+    EXPECT_TRUE(std::filesystem::exists(path)) << ART_FORMAT("'{}' should be kept", path);
+  }
+}
+
+TEST_F(ArtdTest, deleteRuntimeArtifactsAndroidDataNotExist) {
+  // Will be cleaned up by `android_data_env_`
+  setenv("ANDROID_DATA", "/non-existing", /*replace=*/1);
+
+  auto scoped_set_logger = ScopedSetLogger(mock_logger_.AsStdFunction());
+  EXPECT_CALL(mock_logger_,
+              Call(_, _, _, _, _, HasSubstr("Failed to find directory /non-existing")));
+
+  int64_t aidl_return;
+  ASSERT_TRUE(
+      artd_
+          ->deleteRuntimeArtifacts(
+              {.packageName = "com.android.foo", .dexPath = "/a/b/base.apk", .isa = "arm64"},
+              &aidl_return)
+          .isOk());
+
+  EXPECT_EQ(aidl_return, 0);
+}
+
+TEST_F(ArtdTest, deleteRuntimeArtifactsSpecialChars) {
+  std::vector<std::string> removed_files;
+  std::vector<std::string> kept_files;
+
+  auto CreateRemovedFile = [&](const std::string& path) {
+    CreateFile(path);
+    removed_files.push_back(path);
+  };
+
+  auto CreateKeptFile = [&](const std::string& path) {
+    CreateFile(path);
+    kept_files.push_back(path);
+  };
+
+  CreateKeptFile(android_data_ + "/user/0/com.android.foo/cache/oat_primary/arm64/base.art");
+
+  CreateRemovedFile(android_data_ + "/user/0/*/cache/oat_primary/arm64/base.art");
+  CreateRemovedFile(android_data_ + "/user/0/com.android.foo/cache/oat_primary/*/base.art");
+  CreateRemovedFile(android_data_ + "/user/0/com.android.foo/cache/oat_primary/arm64/*.art");
+
+  int64_t aidl_return;
+  ASSERT_TRUE(
+      artd_
+          ->deleteRuntimeArtifacts({.packageName = "*", .dexPath = "/a/b/base.apk", .isa = "arm64"},
+                                   &aidl_return)
+          .isOk());
+  ASSERT_TRUE(artd_
+                  ->deleteRuntimeArtifacts(
+                      {.packageName = "com.android.foo", .dexPath = "/a/b/*.apk", .isa = "arm64"},
+                      &aidl_return)
+                  .isOk());
+  ASSERT_TRUE(artd_
+                  ->deleteRuntimeArtifacts(
+                      {.packageName = "com.android.foo", .dexPath = "/a/b/base.apk", .isa = "*"},
+                      &aidl_return)
+                  .isOk());
+
+  for (const std::string& path : removed_files) {
+    EXPECT_FALSE(std::filesystem::exists(path)) << ART_FORMAT("'{}' should be removed", path);
+  }
+
+  for (const std::string& path : kept_files) {
+    EXPECT_TRUE(std::filesystem::exists(path)) << ART_FORMAT("'{}' should be kept", path);
+  }
+}
+
+TEST_F(ArtdTest, getArtifactsSize) {
+  std::string oat_dir = scratch_path_ + "/a/oat/arm64";
+  CreateFile(oat_dir + "/b.odex", std::string(1, '*'));
+  CreateFile(oat_dir + "/b.vdex", std::string(2, '*'));
+  CreateFile(oat_dir + "/b.art", std::string(4, '*'));
+
+  // Irrelevant.
+  CreateFile(oat_dir + "/c.vdex", std::string(8, '*'));
+
+  int64_t aidl_return = -1;
+  ASSERT_TRUE(
+      artd_
+          ->getArtifactsSize(
+              {.dexPath = scratch_path_ + "/a/b.apk", .isa = "arm64", .isInDalvikCache = false},
+              &aidl_return)
+          .isOk());
+  EXPECT_EQ(aidl_return, 1 + 2 + 4);
+}
+
+TEST_F(ArtdTest, getVdexFileSize) {
+  std::string oat_dir = scratch_path_ + "/a/oat/arm64";
+  CreateFile(oat_dir + "/b.vdex", std::string(1, '*'));
+
+  // Irrelevant.
+  CreateFile(oat_dir + "/b.odex", std::string(2, '*'));
+  CreateFile(oat_dir + "/b.art", std::string(4, '*'));
+  CreateFile(oat_dir + "/c.vdex", std::string(8, '*'));
+
+  int64_t aidl_return = -1;
+  ASSERT_TRUE(artd_
+                  ->getVdexFileSize(ArtifactsPath{.dexPath = scratch_path_ + "/a/b.apk",
+                                                  .isa = "arm64",
+                                                  .isInDalvikCache = false},
+                                    &aidl_return)
+                  .isOk());
+  EXPECT_EQ(aidl_return, 1);
+}
+
+TEST_F(ArtdTest, getRuntimeArtifactsSize) {
+  CreateFile(android_data_ + "/user_de/0/com.android.foo/cache/oat_primary/arm64/base.art",
+             std::string(1, '*'));
+  CreateFile(android_data_ + "/user/0/com.android.foo/cache/oat_primary/arm64/base.art",
+             std::string(2, '*'));
+  CreateFile(android_data_ + "/user/1/com.android.foo/cache/oat_primary/arm64/base.art",
+             std::string(4, '*'));
+  CreateFile(
+      android_expand_ + "/123456-7890/user/1/com.android.foo/cache/oat_primary/arm64/base.art",
+      std::string(8, '*'));
+
+  // Irrelevant.
+  CreateFile(android_expand_ + "/user/0/com.android.foo/cache/oat_primary/arm64/different_dex.art",
+             std::string(16, '*'));
+
+  int64_t aidl_return = -1;
+  ASSERT_TRUE(
+      artd_
+          ->getRuntimeArtifactsSize(
+              {.packageName = "com.android.foo", .dexPath = "/a/b/base.apk", .isa = "arm64"},
+              &aidl_return)
+          .isOk());
+
+  EXPECT_EQ(aidl_return, 1 + 2 + 4 + 8);
+}
+
+TEST_F(ArtdTest, getProfileSize) {
+  CreateFile(android_data_ + "/misc/profiles/cur/0/com.android.foo/primary.prof",
+             std::string(1, '*'));
+
+  // Irrelevant.
+  CreateFile(android_data_ + "/misc/profiles/cur/0/com.android.foo/split_0.split.prof",
+             std::string(2, '*'));
+  CreateFile(android_data_ + "/misc/profiles/cur/0/com.android.bar/primary.prof",
+             std::string(4, '*'));
+  CreateFile(android_data_ + "/misc/profiles/ref/com.android.foo/primary.prof",
+             std::string(8, '*'));
+
+  int64_t aidl_return = -1;
+  ASSERT_TRUE(artd_
+                  ->getProfileSize(
+                      PrimaryCurProfilePath{
+                          .userId = 0, .packageName = "com.android.foo", .profileName = "primary"},
+                      &aidl_return)
+                  .isOk());
+  EXPECT_EQ(aidl_return, 1);
+}
+
 }  // namespace
 }  // namespace artd
 }  // namespace art
diff --git a/artd/binder/com/android/server/art/ArtifactsLocation.aidl b/artd/binder/com/android/server/art/ArtifactsLocation.aidl
new file mode 100644
index 0000000..1084456
--- /dev/null
+++ b/artd/binder/com/android/server/art/ArtifactsLocation.aidl
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.art;
+
+/** @hide */
+@Backing(type="int")
+enum ArtifactsLocation {
+    /** No usable artifacts. */
+    NONE_OR_ERROR = 0,
+    /** In the global "dalvik-cache" folder. */
+    DALVIK_CACHE = 1,
+    /** In the "oat" folder next to the dex file. */
+    NEXT_TO_DEX = 2,
+    /** In the dex metadata file. This means the only usable artifact is the VDEX file. */
+    DM = 3,
+}
diff --git a/artd/binder/com/android/server/art/GetDexoptNeededResult.aidl b/artd/binder/com/android/server/art/GetDexoptNeededResult.aidl
index 8e361b4..dcf6e6b 100644
--- a/artd/binder/com/android/server/art/GetDexoptNeededResult.aidl
+++ b/artd/binder/com/android/server/art/GetDexoptNeededResult.aidl
@@ -26,24 +26,17 @@
     boolean isDexoptNeeded;
     /** Whether there is a usable VDEX file. Note that this can be true even if dexopt is needed. */
     boolean isVdexUsable;
-    /** The location of the best usable artifacts. */
-    ArtifactsLocation artifactsLocation = ArtifactsLocation.NONE_OR_ERROR;
+
+    /**
+     * The location of the best usable artifacts (the ones picked by OatFileAssistant::GetBestInfo
+     * and used by the runtime).
+     */
+    com.android.server.art.ArtifactsLocation artifactsLocation =
+            com.android.server.art.ArtifactsLocation.NONE_OR_ERROR;
     /**
      * True if the dex file has dex code. (The dex file is a .jar/.apk file that has .dex entries,
      * or is a .dex file.) False otherwise. (The dex file is a .jar/.apk file that has no .dex
      * entries.)
      */
     boolean hasDexCode;
-
-    @Backing(type="int")
-    enum ArtifactsLocation {
-        /** No usable artifacts. */
-        NONE_OR_ERROR = 0,
-        /** In the global "dalvik-cache" folder. */
-        DALVIK_CACHE = 1,
-        /** In the "oat" folder next to the dex file. */
-        NEXT_TO_DEX = 2,
-        /** In the dex metadata file. This means the only usable artifact is the VDEX file. */
-        DM = 3,
-    }
 }
diff --git a/artd/binder/com/android/server/art/GetDexoptStatusResult.aidl b/artd/binder/com/android/server/art/GetDexoptStatusResult.aidl
index 08786ca..0d46744 100644
--- a/artd/binder/com/android/server/art/GetDexoptStatusResult.aidl
+++ b/artd/binder/com/android/server/art/GetDexoptStatusResult.aidl
@@ -18,7 +18,7 @@
 
 /**
  * The result of {@code IArtd.getDexoptStatus}. Each field corresponds to a field in
- * {@code com.android.server.art.model.DexoptStatus.DexFileDexoptStatus}.
+ * {@code com.android.server.art.model.DexoptStatus.DexContainerFileDexoptStatus}.
  *
  * @hide
  */
@@ -26,4 +26,11 @@
     @utf8InCpp String compilerFilter;
     @utf8InCpp String compilationReason;
     @utf8InCpp String locationDebugString;
+
+    /**
+     * The location of the best usable artifacts (the ones picked by OatFileAssistant::GetBestInfo
+     * and used by the runtime).
+     */
+    com.android.server.art.ArtifactsLocation artifactsLocation =
+            com.android.server.art.ArtifactsLocation.NONE_OR_ERROR;
 }
diff --git a/artd/binder/com/android/server/art/IArtd.aidl b/artd/binder/com/android/server/art/IArtd.aidl
index 5465795..f8c4e5f 100644
--- a/artd/binder/com/android/server/art/IArtd.aidl
+++ b/artd/binder/com/android/server/art/IArtd.aidl
@@ -22,7 +22,10 @@
     boolean isAlive();
 
     /**
-     * Deletes artifacts and returns the released space, in bytes.
+     * Deletes dexopt artifacts and returns the released space, in bytes.
+     *
+     * Note that this method doesn't delete runtime artifacts. To delete them, call
+     * `deleteRuntimeArtifacts`.
      *
      * Throws fatal errors. Logs and ignores non-fatal errors.
      */
@@ -57,6 +60,15 @@
             inout com.android.server.art.OutputProfile dst, @utf8InCpp String dexFile);
 
     /**
+     * Similar to above. The difference is that the profile is not taken from a separate file but
+     * taken from `dexFile` itself. Specifically, if `dexFile` is a zip file, the profile is taken
+     * from `assets/art-profile/baseline.prof` in the zip. Returns `NO_PROFILE` if `dexFile` is not
+     * a zip file or it doesn't contain a profile.
+     */
+    com.android.server.art.CopyAndRewriteProfileResult copyAndRewriteEmbeddedProfile(
+            inout com.android.server.art.OutputProfile dst, @utf8InCpp String dexFile);
+
+    /**
      * Moves the temporary profile to the permanent location.
      *
      * Throws fatal and non-fatal errors.
@@ -169,7 +181,8 @@
      */
     long cleanup(in List<com.android.server.art.ProfilePath> profilesToKeep,
             in List<com.android.server.art.ArtifactsPath> artifactsToKeep,
-            in List<com.android.server.art.VdexPath> vdexFilesToKeep);
+            in List<com.android.server.art.VdexPath> vdexFilesToKeep,
+            in List<com.android.server.art.RuntimeArtifactsPath> runtimeArtifactsToKeep);
 
     /**
      * Returns whether the artifacts of the primary dex files should be in the global dalvik-cache
@@ -178,4 +191,47 @@
      * Throws fatal and non-fatal errors.
      */
     boolean isInDalvikCache(@utf8InCpp String dexFile);
+
+    /**
+     * Deletes runtime artifacts and returns the released space, in bytes.
+     *
+     * Throws fatal errors. Logs and ignores non-fatal errors.
+     */
+    long deleteRuntimeArtifacts(
+            in com.android.server.art.RuntimeArtifactsPath runtimeArtifactsPath);
+
+    /**
+     * Returns the size of the dexopt artifacts, in bytes, or 0 if they don't exist or a non-fatal
+     * error occurred.
+     *
+     * Throws fatal errors. Logs and ignores non-fatal errors.
+     */
+    long getArtifactsSize(in com.android.server.art.ArtifactsPath artifactsPath);
+
+    /**
+     * Returns the size of the vdex file, in bytes, or 0 if it doesn't exist or a non-fatal error
+     * occurred.
+     *
+     * Throws fatal errors. Logs and ignores non-fatal errors.
+     */
+    long getVdexFileSize(in com.android.server.art.VdexPath vdexPath);
+
+    /**
+     * Returns the size of the runtime artifacts, in bytes, or 0 if they don't exist or a non-fatal
+     * error occurred.
+     *
+     * Throws fatal errors. Logs and ignores non-fatal errors.
+     */
+    long getRuntimeArtifactsSize(
+            in com.android.server.art.RuntimeArtifactsPath runtimeArtifactsPath);
+
+    /**
+     * Returns the size of the profile, in bytes, or 0 if it doesn't exist or a non-fatal error
+     * occurred.
+     *
+     * Operates on the whole DM file if given one.
+     *
+     * Throws fatal errors. Logs and ignores non-fatal errors.
+     */
+    long getProfileSize(in com.android.server.art.ProfilePath profile);
 }
diff --git a/artd/binder/com/android/server/art/RuntimeArtifactsPath.aidl b/artd/binder/com/android/server/art/RuntimeArtifactsPath.aidl
new file mode 100644
index 0000000..4096ea9
--- /dev/null
+++ b/artd/binder/com/android/server/art/RuntimeArtifactsPath.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.art;
+
+/**
+ * Represents the path to the runtime artifacts of a dex file (i.e., ART files generated by the
+ * runtime, not by dexopt).
+ *
+ * @hide
+ */
+parcelable RuntimeArtifactsPath {
+    /** The name of the package. */
+    @utf8InCpp String packageName;
+    /** The absolute path starting with '/' to the dex file (i.e., APK or JAR file). */
+    @utf8InCpp String dexPath;
+    /** The instruction set of the dexopt artifacts. */
+    @utf8InCpp String isa;
+}
diff --git a/artd/path_utils.cc b/artd/path_utils.cc
index 95e4395..3d3a92f 100644
--- a/artd/path_utils.cc
+++ b/artd/path_utils.cc
@@ -29,7 +29,8 @@
 #include "base/macros.h"
 #include "file_utils.h"
 #include "fstab/fstab.h"
-#include "oat_file_assistant.h"
+#include "oat/oat_file_assistant.h"
+#include "runtime_image.h"
 #include "service.h"
 #include "tools/tools.h"
 
@@ -41,6 +42,7 @@
 using ::aidl::com::android::server::art::ArtifactsPath;
 using ::aidl::com::android::server::art::DexMetadataPath;
 using ::aidl::com::android::server::art::ProfilePath;
+using ::aidl::com::android::server::art::RuntimeArtifactsPath;
 using ::aidl::com::android::server::art::VdexPath;
 using ::android::base::Error;
 using ::android::base::Result;
@@ -60,6 +62,11 @@
 using TmpProfilePath = ProfilePath::TmpProfilePath;
 using WritableProfilePath = ProfilePath::WritableProfilePath;
 
+// Only to be changed for testing.
+std::string_view gListRootDir = "/";
+
+}  // namespace
+
 Result<std::string> GetAndroidDataOrError() {
   std::string error_msg;
   std::string result = GetAndroidDataSafe(&error_msg);
@@ -87,12 +94,8 @@
   return result;
 }
 
-}  // namespace
-
-Result<std::vector<std::string>> ListManagedFiles() {
-  std::string android_data = OR_RETURN(GetAndroidDataOrError());
-  std::string android_expand = OR_RETURN(GetAndroidExpandOrError());
-
+std::vector<std::string> ListManagedFiles(const std::string& android_data,
+                                          const std::string& android_expand) {
   // See `art::tools::Glob` for the syntax.
   std::vector<std::string> patterns = {
       // Profiles for primary dex files.
@@ -104,20 +107,52 @@
   for (const std::string& data_root : {android_data, android_expand + "/*"}) {
     // Artifacts for primary dex files.
     patterns.push_back(data_root + "/app/*/*/oat/**");
-    // Profiles and artifacts for secondary dex files. Those files are in app data directories, so
-    // we use more granular patterns to avoid accidentally deleting apps' files.
+
     for (const char* user_dir : {"/user", "/user_de"}) {
-      std::string secondary_oat_dir = data_root + user_dir + "/*/*/**/oat";
+      std::string data_dir = data_root + user_dir + "/*/*";
+      // Profiles and artifacts for secondary dex files. Those files are in app data directories, so
+      // we use more granular patterns to avoid accidentally deleting apps' files.
+      std::string secondary_oat_dir = data_dir + "/**/oat";
       for (const char* maybe_tmp_suffix : {"", ".*.tmp"}) {
         patterns.push_back(secondary_oat_dir + "/*.prof" + maybe_tmp_suffix);
         patterns.push_back(secondary_oat_dir + "/*/*.odex" + maybe_tmp_suffix);
         patterns.push_back(secondary_oat_dir + "/*/*.vdex" + maybe_tmp_suffix);
         patterns.push_back(secondary_oat_dir + "/*/*.art" + maybe_tmp_suffix);
       }
+      // Runtime image files.
+      patterns.push_back(RuntimeImage::GetRuntimeImageDir(data_dir) + "**");
     }
   }
 
-  return tools::Glob(patterns);
+  return tools::Glob(patterns, gListRootDir);
+}
+
+std::vector<std::string> ListRuntimeArtifactsFiles(
+    const std::string& android_data,
+    const std::string& android_expand,
+    const RuntimeArtifactsPath& runtime_artifacts_path) {
+  // See `art::tools::Glob` for the syntax.
+  std::vector<std::string> patterns;
+
+  for (const std::string& data_root : {android_data, android_expand + "/*"}) {
+    for (const char* user_dir : {"/user", "/user_de"}) {
+      std::string data_dir =
+          data_root + user_dir + "/*/" + tools::EscapeGlob(runtime_artifacts_path.packageName);
+      patterns.push_back(
+          RuntimeImage::GetRuntimeImagePath(data_dir,
+                                            tools::EscapeGlob(runtime_artifacts_path.dexPath),
+                                            tools::EscapeGlob(runtime_artifacts_path.isa)));
+    }
+  }
+
+  return tools::Glob(patterns, gListRootDir);
+}
+
+Result<void> ValidateRuntimeArtifactsPath(const RuntimeArtifactsPath& runtime_artifacts_path) {
+  OR_RETURN(ValidatePathElement(runtime_artifacts_path.packageName, "packageName"));
+  OR_RETURN(ValidatePathElement(runtime_artifacts_path.isa, "isa"));
+  OR_RETURN(ValidateDexPath(runtime_artifacts_path.dexPath));
+  return {};
 }
 
 Result<std::string> BuildArtBinPath(const std::string& binary_name) {
@@ -202,7 +237,8 @@
       // No default. All cases should be explicitly handled, or the compilation will fail.
   }
   // This should never happen. Just in case we get a non-enumerator value.
-  LOG(FATAL) << ART_FORMAT("Unexpected writable profile path type {}", final_path.getTag());
+  LOG(FATAL) << ART_FORMAT("Unexpected writable profile path type {}",
+                           fmt::underlying(final_path.getTag()));
 }
 
 Result<std::string> BuildTmpProfilePath(const TmpProfilePath& tmp_profile_path) {
@@ -235,7 +271,8 @@
       // No default. All cases should be explicitly handled, or the compilation will fail.
   }
   // This should never happen. Just in case we get a non-enumerator value.
-  LOG(FATAL) << ART_FORMAT("Unexpected profile path type {}", profile_path.getTag());
+  LOG(FATAL) << ART_FORMAT("Unexpected profile path type {}",
+                           fmt::underlying(profile_path.getTag()));
 }
 
 Result<std::string> BuildVdexPath(const VdexPath& vdex_path) {
@@ -244,7 +281,8 @@
 }
 
 bool PathStartsWith(std::string_view path, std::string_view prefix) {
-  CHECK(!prefix.empty() && !path.empty() && prefix[0] == '/' && path[0] == '/');
+  CHECK(!prefix.empty() && !path.empty() && prefix[0] == '/' && path[0] == '/')
+      << ART_FORMAT("path={}, prefix={}", path, prefix);
   android::base::ConsumeSuffix(&prefix, "/");
   return StartsWith(path, prefix) &&
          (path.length() == prefix.length() || path[prefix.length()] == '/');
@@ -257,6 +295,13 @@
   }
   std::vector<FstabEntry> entries;
   for (FstabEntry& entry : fstab) {
+    // Ignore swap areas as a swap area doesn't have a meaningful `mount_point` (a.k.a., `fs_file`)
+    // field, according to fstab(5). In addition, ignore any other entries whose mount points are
+    // not absolute paths, just in case there are other fs types that also have an meaningless mount
+    // point.
+    if (entry.fs_type == "swap" || !StartsWith(entry.mount_point, '/')) {
+      continue;
+    }
     if (PathStartsWith(path, entry.mount_point)) {
       entries.push_back(std::move(entry));
     }
@@ -264,5 +309,7 @@
   return entries;
 }
 
+void TestOnlySetListRootDir(std::string_view root_dir) { gListRootDir = root_dir; }
+
 }  // namespace artd
 }  // namespace art
diff --git a/artd/path_utils.h b/artd/path_utils.h
index 62d6005..b42b639 100644
--- a/artd/path_utils.h
+++ b/artd/path_utils.h
@@ -28,8 +28,23 @@
 namespace art {
 namespace artd {
 
+android::base::Result<std::string> GetAndroidDataOrError();
+
+android::base::Result<std::string> GetAndroidExpandOrError();
+
+android::base::Result<std::string> GetArtRootOrError();
+
 // Returns all existing files that are managed by artd.
-android::base::Result<std::vector<std::string>> ListManagedFiles();
+std::vector<std::string> ListManagedFiles(const std::string& android_data,
+                                          const std::string& android_expand);
+
+std::vector<std::string> ListRuntimeArtifactsFiles(
+    const std::string& android_data,
+    const std::string& android_expand,
+    const aidl::com::android::server::art::RuntimeArtifactsPath& runtime_artifacts_path);
+
+android::base::Result<void> ValidateRuntimeArtifactsPath(
+    const aidl::com::android::server::art::RuntimeArtifactsPath& runtime_artifacts_path);
 
 android::base::Result<std::string> BuildArtBinPath(const std::string& binary_name);
 
@@ -90,6 +105,11 @@
 android::base::Result<std::vector<android::fs_mgr::FstabEntry>> GetProcMountsEntriesForPath(
     const std::string& path);
 
+// Sets the root dir for `ListManagedFiles` and `ListRuntimeImageFiles`.
+// The passed string must be alive until the test ends.
+// For testing use only.
+void TestOnlySetListRootDir(std::string_view root_dir);
+
 }  // namespace artd
 }  // namespace art
 
diff --git a/artd/path_utils_test.cc b/artd/path_utils_test.cc
index 6266907..47b503f 100644
--- a/artd/path_utils_test.cc
+++ b/artd/path_utils_test.cc
@@ -28,7 +28,6 @@
 using ::aidl::com::android::server::art::ArtifactsPath;
 using ::aidl::com::android::server::art::DexMetadataPath;
 using ::aidl::com::android::server::art::ProfilePath;
-using ::aidl::com::android::server::art::VdexPath;
 using ::android::base::testing::HasError;
 using ::android::base::testing::HasValue;
 using ::android::base::testing::WithMessage;
diff --git a/benchmark/golem-tiagent/golem-tiagent.cc b/benchmark/golem-tiagent/golem-tiagent.cc
index be2c727..9fe0644 100644
--- a/benchmark/golem-tiagent/golem-tiagent.cc
+++ b/benchmark/golem-tiagent/golem-tiagent.cc
@@ -35,9 +35,9 @@
   }
 }
 
-static void JNICALL VMInitCallback(jvmtiEnv *jenv ATTRIBUTE_UNUSED,
+static void JNICALL VMInitCallback([[maybe_unused]] jvmtiEnv* jenv,
                                    JNIEnv* jni_env,
-                                   jthread thread ATTRIBUTE_UNUSED) {
+                                   [[maybe_unused]] jthread thread) {
   // Set a breakpoint on a rare method that we won't expect to be hit.
   // java.lang.Thread.stop is deprecated and not expected to be used.
   jclass cl = jni_env->FindClass("java/lang/Thread");
@@ -57,8 +57,8 @@
 }
 
 extern "C" JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM* vm,
-                                               char* options ATTRIBUTE_UNUSED,
-                                               void* reserved ATTRIBUTE_UNUSED) {
+                                               [[maybe_unused]] char* options,
+                                               [[maybe_unused]] void* reserved) {
   // Setup jvmti_env
   if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0) != 0) {
     LOG(ERROR) << "Unable to get jvmti env!";
diff --git a/build/Android.bp b/build/Android.bp
index 77f7313..a405df4 100644
--- a/build/Android.bp
+++ b/build/Android.bp
@@ -34,8 +34,10 @@
     "bugprone-argument-comment",
     "bugprone-lambda-function-name",
     "bugprone-macro-parentheses",
+    "bugprone-macro-repeated-side-effects",
     "bugprone-unused-raii", // Protect scoped things like MutexLock.
     "bugprone-unused-return-value",
+    "bugprone-use-after-move",
     "bugprone-virtual-near-miss",
     "misc-unused-using-decls",
     "modernize-use-bool-literals",
@@ -43,6 +45,7 @@
     "performance-faster-string-find",
     "performance-for-range-copy",
     "performance-implicit-conversion-in-loop",
+    "performance-inefficient-string-concatenation",
     "performance-inefficient-vector-operation",
     "performance-no-automatic-move",
     "performance-noexcept-move-constructor",
@@ -61,6 +64,7 @@
     // We have lots of C-style variadic functions, and are OK with them. JNI ensures
     // that working around this warning would be extra-painful.
     "-cert-dcl50-cpp",
+    "-misc-redundant-expression",
     // "Modernization" we don't agree with.
     "-modernize-use-auto",
     "-modernize-return-braced-init-list",
@@ -74,6 +78,7 @@
 soong_config_module_type_import {
     from: "art/build/SoongConfig.bp",
     module_types: [
+        "art_debug_defaults",
         "art_module_art_global_defaults",
         "art_module_cc_defaults",
         "art_module_java_defaults",
@@ -87,6 +92,8 @@
 
     name: "art_defaults",
 
+    cpp_std: "gnu++17", // TODO(b/311052584): fix C++20 build and revert this line
+
     // Disable all ART Soong modules by default when ART prebuilts are in use.
     // TODO(b/172480617): Clean up when sources are gone from the platform tree
     // and we no longer need to support sources present when prebuilts are used.
@@ -317,6 +324,14 @@
             cflags: ["-Wno-frame-larger-than="],
         },
     },
+    soong_config_variables: {
+        art_debug_opt_flag: {
+            cflags: ["%s"],
+            conditions_default: {
+                cflags: ["-Og"],
+            },
+        },
+    },
 }
 
 // A version of conscrypt only for enabling the "-hostdex" version to test ART on host.
diff --git a/build/Android.cpplint.mk b/build/Android.cpplint.mk
index ab70e97..6eeaa49 100644
--- a/build/Android.cpplint.mk
+++ b/build/Android.cpplint.mk
@@ -26,9 +26,8 @@
 # Everything that could be moved to CPPLINT.cfg has moved there.
 # Please add new settings to CPPLINT.cfg over adding new flags in this file.
 
-ART_CPPLINT_FLAGS :=
 # No output when there are no errors.
-ART_CPPLINT_QUIET := --quiet
+ART_CPPLINT_FLAGS := --quiet
 
 #  1) Get list of all .h & .cc files in the art directory.
 #  2) Prepends 'art/' to each of them to make the full name.
@@ -58,7 +57,7 @@
 art_cpplint_touch := $$(OUT_CPPLINT)/$$(subst /,__,$$(art_cpplint_file))
 
 $$(art_cpplint_touch): $$(art_cpplint_file) $(ART_CPPLINT) $(ART_CPPLINT_CFG) art/build/Android.cpplint.mk
-	$(hide) $(ART_CPPLINT) $(ART_CPPLINT_QUIET) $(ART_CPPLINT_FLAGS) $$<
+	$(hide) $(ART_CPPLINT) $(ART_CPPLINT_FLAGS) $$<
 	$(hide) mkdir -p $$(dir $$@)
 	$(hide) touch $$@
 
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index 770e988..750c62d 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -40,14 +40,12 @@
 my_files += $(foreach infix,_ _VDEX_,$(foreach suffix,$(HOST_ARCH) $(HOST_2ND_ARCH), \
   $(DEXPREOPT_IMAGE$(infix)BUILT_INSTALLED_art_host_$(suffix))))
 # `dexpreopt_bootjars.go` uses a single source of input regardless of variants, so we should use the
-# same source for `CORE_IMG_JARS` to avoid checksum mismatches on the oat files. We can still use
-# the host variant of `conscrypt` and `core-icu4j` because they don't go into the primary boot image
-# that is used in host gtests, and hence can't lead to checksum mismatches.
+# same source to avoid checksum mismatches on the oat files.
 my_files += \
   $(foreach jar,$(CORE_IMG_JARS),\
     $(OUT_DIR)/soong/dexpreopt_$(TARGET_ARCH)/dex_artjars_input/$(jar).jar:apex/com.android.art/javalib/$(jar).jar) \
-  $(HOST_OUT_JAVA_LIBRARIES)/conscrypt-hostdex.jar:apex/com.android.conscrypt/javalib/conscrypt.jar\
-  $(HOST_OUT_JAVA_LIBRARIES)/core-icu4j-hostdex.jar:apex/com.android.i18n/javalib/core-icu4j.jar \
+  $(OUT_DIR)/soong/dexpreopt_$(TARGET_ARCH)/dex_artjars_input/conscrypt.jar:apex/com.android.conscrypt/javalib/conscrypt.jar\
+  $(OUT_DIR)/soong/dexpreopt_$(TARGET_ARCH)/dex_artjars_input/core-icu4j.jar:apex/com.android.i18n/javalib/core-icu4j.jar \
   $(icu_data_file):com.android.i18n/etc/icu/$(notdir $(icu_data_file))
 
 # Create phony module that will copy all the data files into testcases directory.
@@ -138,6 +136,7 @@
 
 ART_TEST_MODULES_TARGET := $(ART_TEST_MODULES_COMMON) \
     art_artd_tests \
+    art_dexopt_chroot_setup_tests \
     art_odrefresh_tests \
 
 ART_TEST_MODULES_HOST := $(ART_TEST_MODULES_COMMON)
@@ -147,6 +146,7 @@
   # can build the libbinder_ndk dependency. It is not available as a prebuilt on
   # master-art.
   ART_TEST_MODULES_HOST += art_artd_tests
+  ART_TEST_MODULES_HOST += art_dexopt_chroot_setup_tests
 endif
 
 ART_TARGET_GTEST_NAMES := $(foreach tm,$(ART_TEST_MODULES_TARGET),\
diff --git a/build/README.md b/build/README.md
index a94d0fc..7b4e402 100644
--- a/build/README.md
+++ b/build/README.md
@@ -8,10 +8,6 @@
 The recommended way to build the ART Module is to use the `master-art` manifest,
 which only has the sources and dependencies required for the module.
 
-Currently it is also possible to build ART directly from sources in a platform
-build, i.e. as has been the traditional way up until Android S. However that
-method is being phased out.
-
 The ART Module is available as a debug variant, `com.android.art.debug.apex`,
 which has extra internal consistency checks enabled, and some debug tools. A
 device cannot have both the non-debug and debug variants installed at once - it
@@ -35,22 +31,20 @@
 
 2.  Set up the development environment:
 
+    See
+    [art/test/README.chroot.md](https://android.googlesource.com/platform/art/+/refs/heads/main/test/README.chroot.md)
+    for details on how to set up the environment on `master-art`, but the
+    `lunch` step can be skipped. Instead use `banchan` to initialize an
+    unbundled module build:
+
     ```
+    source build/envsetup.sh
     banchan com.android.art <arch>
-    export SOONG_ALLOW_MISSING_DEPENDENCIES=true BUILD_BROKEN_DISABLE_BAZEL=true
     ```
 
-    For Google internal builds on the internal master-art branch, specify
-    instead the Google variant of the module and product:
-
-    ```
-    banchan com.google.android.art mainline_modules_<arch>
-    export SOONG_ALLOW_MISSING_DEPENDENCIES=true BUILD_BROKEN_DISABLE_BAZEL=true
-    ```
-
-    `<arch>` is the device architecture, one of `arm`, `arm64`, `x86`, or
-    `x86_64`. Regardless of the device architecture, the build also includes the
-    usual host architectures, and 64/32-bit multilib for the 64-bit products.
+    `<arch>` is the device architecture - use `hmm` to see the options.
+    Regardless of the device architecture, the build also includes the usual
+    host architectures, and 64/32-bit multilib for the 64-bit products.
 
     To build the debug variant of the module, specify `com.android.art.debug`
     instead of `com.android.art`. It is also possible to list both.
diff --git a/build/SoongConfig.bp b/build/SoongConfig.bp
index a37721d..0a7e154 100644
--- a/build/SoongConfig.bp
+++ b/build/SoongConfig.bp
@@ -93,3 +93,11 @@
     bool_variables: ["source_build"],
     properties: ["enabled"],
 }
+
+soong_config_module_type {
+    name: "art_debug_defaults",
+    module_type: "cc_defaults",
+    config_namespace: "art_module",
+    value_variables: ["art_debug_opt_flag"],
+    properties: ["cflags"],
+}
diff --git a/build/apex/Android.bp b/build/apex/Android.bp
index 5b419e5..fed90e4 100644
--- a/build/apex/Android.bp
+++ b/build/apex/Android.bp
@@ -20,18 +20,18 @@
     ],
 }
 
-// Modules listed in LOCAL_REQUIRED_MODULES for module art-runtime in art/Android.mk.
-// - Base requirements (binaries for which both 32- and 64-bit versions are built, if possible).
-art_runtime_base_binaries_both = [
+// Binaries for which both 32- and 64-bit versions are built, if possible.
+art_runtime_binaries_both = [
     "dalvikvm",
-]
-art_runtime_base_binaries_both_on_device_first_on_host = [
     "dex2oat",
 ]
-// - Base requirements (binaries for which the "first" version is preferred on device
-//  (likely 64-bit) and on host).
-art_runtime_base_binaries_first_on_device_first_on_host = [
+
+// Binaries for which the "first" version is preferred.
+art_runtime_binaries_first = [
+    "dexdump",
+    "dexlist",
     "dexoptanalyzer",
+    "oatdump",
     "profman",
 ]
 
@@ -58,13 +58,13 @@
     "libadbconnection",
     // TODO(b/124476339): Clean up the following libraries once "required"
     // dependencies work with APEX libraries.
-    "libart-compiler",
     "libdt_fd_forward",
     "libdt_socket",
     "libjdwp",
     "libnpt",
     "libopenjdkjvm",
     "libopenjdkjvmti",
+    "libperfetto_hprof",
     // TODO(chriswailes): Make libarttools a dependency for another target
     // when such a target exists
     "libarttools",
@@ -76,98 +76,42 @@
 art_runtime_base_broken_native_shared_libs = ["libart-broken"] +
     art_runtime_base_native_shared_libs_minus_libart
 
-art_runtime_base_native_device_only_shared_libs = [
-    "libperfetto_hprof",
-]
-
-bionic_native_shared_libs = [
-    // External API (having APEX stubs).
-    "libc",
-    "libm",
-    "libdl",
-]
-
-bionic_binaries_both = [
-    "linker",
-    // To validate the zip file generated by cloud server.
-    "ziptool",
-]
-
-// - Debug variants (binaries for which the "first" version is preferred on device
-//  (likely 64-bit) and on host).
-art_runtime_debug_binaries_first_on_device_first_on_host = [
-    "dexoptanalyzerd",
-    "profmand",
-]
-art_runtime_debug_binaries_both_on_device_first_on_host = [
-    "dex2oatd",
-]
-
 // - Debug variants (libraries).
 art_runtime_debug_native_shared_libs = [
     "libadbconnectiond",
     "libartd",
-    "libartd-compiler",
     "libdexfiled",
     "libopenjdkjvmd",
     "libopenjdkjvmtid",
-]
-
-art_runtime_base_native_device_only_debug_shared_libs = [
     "libperfetto_hprofd",
-]
-
-// Libraries needed to execute ART run-tests.
-// TODO(b/124476339): When bug 124476339 is fixed, add these libraries as `runtime_libs`
-// dependencies of `libartd-compiler`, and remove `art_runtime_run_test_libs`.
-art_runtime_run_test_libs = [
+    // Libraries needed to execute ART run-tests.
+    // TODO(b/124476339): When bug 124476339 is fixed, add these libraries as `runtime_libs`
+    // dependencies of `libartd-compiler`, and remove them here.
     "libart-disassembler",
     "libartd-disassembler",
 ]
 
-// Tools common to both device APEX and host APEX. Derived from art-tools in art/Android.mk.
-art_tools_common_binaries = [
-    "dexdump",
-    "dexlist",
-]
-
-// Tools common to both device and host debug APEXes.
-art_tools_debug_binaries = [
-    "dexanalyze",
-    "dexdiag",
-    "dexlayout",
-    "dexlayoutd",
-]
-
-art_tools_debug_binaries_both = [
+// Debug binaries for which both 32- and 64-bit versions are built, if possible.
+art_debug_binaries_both = [
+    "dex2oatd",
     "imgdiag",
     "imgdiagd",
 ]
 
-// Tools exclusively for the device APEX derived from art-tools in art/Android.mk.
-art_tools_device_only_binaries = [
-    // oatdump cannot link with host linux_bionic due to not using clang lld;
-    // TODO: Make it work with clang lld.
-    "oatdump",
-]
-// Same, but for only for debug packages.
-art_tools_debug_device_only_binaries = [
-    // oatdumpd cannot link with host linux_bionic due to not using clang lld;
-    // TODO: Make it work with clang lld.
+// Debug binaries for which the "first" version is preferred.
+art_debug_binaries_first = [
+    "dexanalyze",
+    "dexdiag",
+    "dexlayout",
+    "dexlayoutd",
+    "dexoptanalyzerd",
     "oatdumpd",
-]
-
-// Tools exclusively for the host APEX derived from art-tools in art/Android.mk.
-art_tools_host_only_binaries = [
-    // FIXME: Does not work as-is, because `ahat` is defined in tools/ahat/Android.mk
-    // (same issue as for `libart_fake` above).
-    //"ahat",
-    "hprof-conv",
+    "profmand",
 ]
 
 // Core Java libraries.
 // This list must be the same as art-bootclasspath-fragment because it's that which is pulled in
-// through bootclasspath_fragments below. (com.android.art-device-defaults-minus-odrefresh)
+// through bootclasspath_fragments below. (com.android.art-defaults-minus-odrefresh)
 libcore_java_libs = [
     "core-oj",
     "core-libart",
@@ -212,14 +156,6 @@
     "libopenjdkd",
 ]
 
-// Temporary library includes for b/123591866 as all libraries are moved into the main art-apex.
-art_runtime_libraries_zipapex = [
-    "libnativebridge",
-    "libnativeloader",
-    "libnativehelper",
-    "libcutils",
-]
-
 android_app_certificate {
     name: "com.android.art.certificate",
     certificate: "com.android.art",
@@ -231,8 +167,9 @@
     private_key: "com.android.art.pem",
 }
 
+// Default shared by all ART APEXes.
 art_module_apex_defaults {
-    name: "com.android.art-defaults",
+    name: "com.android.art-base-defaults",
 
     // Enable if ART_MODULE_BUILD_FROM_SOURCE is true
     enabled: false,
@@ -259,11 +196,11 @@
     installable: false,
 }
 
-// Default values shared by device ART APEXes.
+// Default values shared by APEXes except test_broken_com.android.art.
 apex_defaults {
-    name: "com.android.art-device-defaults-minus-odrefresh",
+    name: "com.android.art-defaults-minus-odrefresh",
     defaults: [
-        "com.android.art-defaults",
+        "com.android.art-base-defaults",
         "s-launched-apex-module",
     ],
     compile_multilib: "both",
@@ -272,7 +209,6 @@
     systemserverclasspath_fragments: ["art-systemserverclasspath-fragment"],
     compat_configs: ["libcore-platform-compat-config"],
     native_shared_libs: art_runtime_base_native_shared_libs +
-        art_runtime_base_native_device_only_shared_libs +
         libcore_native_shared_libs,
     jni_libs: [
         "libartservice",
@@ -281,16 +217,14 @@
         "art_boot",
         "art_exec",
         "artd",
+        "dexopt_chroot_setup",
     ],
     multilib: {
         both: {
-            binaries: art_runtime_base_binaries_both +
-                art_runtime_base_binaries_both_on_device_first_on_host,
+            binaries: art_runtime_binaries_both,
         },
         first: {
-            binaries: art_runtime_base_binaries_first_on_device_first_on_host +
-                art_tools_common_binaries +
-                art_tools_device_only_binaries,
+            binaries: art_runtime_binaries_first,
         },
     },
     key: "com.android.art.key",
@@ -302,19 +236,12 @@
         "com.android.art.init.rc",
         "current_sdkinfo",
     ],
-    // ART APEXes depend on bouncycastle which is disabled for PDK builds.
-    // Since the dependency is disabled, ART APEXes can't be built either.
-    // Disable the APEXes too. See b/157267166.
-    product_variables: {
-        pdk: {
-            enabled: false,
-        },
-    },
 }
 
+// Default values shared by Release, Debug, and Testing APEXes.
 apex_defaults {
-    name: "com.android.art-device-defaults",
-    defaults: ["com.android.art-device-defaults-minus-odrefresh"],
+    name: "com.android.art-defaults",
+    defaults: ["com.android.art-defaults-minus-odrefresh"],
     multilib: {
         first: {
             binaries: ["odrefresh"],
@@ -322,26 +249,21 @@
     },
 }
 
-// Default values shared by (device) Debug and Testing ART APEXes.
+// Default values shared by Debug and Testing ART APEXes.
 apex_defaults {
     name: "com.android.art-devel-defaults",
-    defaults: ["com.android.art-device-defaults"],
-    native_shared_libs: art_runtime_base_native_device_only_debug_shared_libs +
-        art_runtime_run_test_libs +
-        art_runtime_debug_native_shared_libs +
+    defaults: ["com.android.art-defaults"],
+    native_shared_libs: art_runtime_debug_native_shared_libs +
         libcore_debug_native_shared_libs,
     jni_libs: [
         "libartserviced",
     ],
     multilib: {
         both: {
-            binaries: art_tools_debug_binaries_both +
-                art_runtime_debug_binaries_both_on_device_first_on_host,
+            binaries: art_debug_binaries_both,
         },
         first: {
-            binaries: art_runtime_debug_binaries_first_on_device_first_on_host +
-                art_tools_debug_binaries +
-                art_tools_debug_device_only_binaries,
+            binaries: art_debug_binaries_first,
         },
     },
 }
@@ -353,16 +275,19 @@
     // Use of "s-launched-apex-module" does not imply that this is a released
     // module.
     defaults: [
-        "com.android.art-defaults",
+        "com.android.art-base-defaults",
         "s-launched-apex-module",
     ],
 
-    // Only include native libraries in this test APEX. Don't include
-    // binaries (and maybe other artifacts) for now, as they pull
-    // the "non-broken" `libart` module into this test APEX and
-    // overwrite `libart-broken`. Maybe consider creating "broken"
-    // variants of binaries (and other artifacts)?
+    // Only include native libraries in this test APEX. The intention
+    // was to not include binaries (and maybe other artifacts) for now,
+    // as they'd pull the "non-broken" `libart` module into this test
+    // APEX and overwrite `libart-broken`. However, with
+    // unwanted_transitive_deps we can ensure `libart` gets excluded
+    // anyway.
+    // TODO(mast): Add back the binaries and clean this up.
     native_shared_libs: art_runtime_base_broken_native_shared_libs,
+    unwanted_transitive_deps: ["libart"],
     compile_multilib: "both",
 
     key: "com.android.art.key",
@@ -375,7 +300,7 @@
 
 apex_test {
     name: "test_jitzygote_com.android.art",
-    defaults: ["com.android.art-device-defaults-minus-odrefresh"],
+    defaults: ["com.android.art-defaults-minus-odrefresh"],
     multilib: {
         first: {
             binaries: ["odrefresh_broken"],
@@ -393,7 +318,7 @@
 // storage-constrained devices in userdebug and eng builds.
 apex {
     name: "com.android.art",
-    defaults: ["com.android.art-device-defaults"],
+    defaults: ["com.android.art-defaults"],
     certificate: ":com.android.art.certificate",
 }
 
@@ -417,6 +342,7 @@
     "art_dexdump_tests",
     "art_dexlayout_tests",
     "art_dexlist_tests",
+    "art_dexopt_chroot_setup_tests",
     "art_disassembler_tests",
     "art_dexoptanalyzer_tests",
     "art_imgdiag_tests",
@@ -461,65 +387,10 @@
     future_updatable: true,
 }
 
-// TODO: Do this better. art_apex_test_host will disable host builds when
-// HOST_PREFER_32_BIT is set. We cannot simply use com.android.art.debug
-// because binaries have different multilib classes and 'multilib: {}' isn't
-// supported by target: { ... }.
-// See b/120617876 for more information.
-art_apex_test_host {
+// TODO(b/279835185) This is a placeholder to satisfy the current references.
+//   Remove this when all references are removed.
+host_snapshot {
     name: "com.android.art.host",
-    defaults: ["com.android.art-defaults"],
-    compile_multilib: "both",
-    payload_type: "zip",
-    host_supported: true,
-    device_supported: false,
-    manifest: "manifest-art.json",
-    updatable: false,
-    java_libs: libcore_java_libs,
-    ignore_system_library_special_case: true,
-    native_shared_libs: art_runtime_base_native_shared_libs +
-        art_runtime_debug_native_shared_libs +
-        libcore_native_shared_libs +
-        libcore_debug_native_shared_libs +
-        art_runtime_libraries_zipapex +
-        art_runtime_run_test_libs,
-    multilib: {
-        both: {
-            binaries: art_runtime_base_binaries_both +
-                art_tools_debug_binaries_both,
-        },
-        first: {
-            binaries: art_runtime_base_binaries_both_on_device_first_on_host +
-                art_runtime_base_binaries_first_on_device_first_on_host +
-                art_runtime_debug_binaries_first_on_device_first_on_host +
-                art_runtime_debug_binaries_both_on_device_first_on_host +
-                art_tools_common_binaries +
-                art_tools_debug_binaries + // Host APEX is always debug.
-                art_tools_host_only_binaries,
-        },
-    },
-    key: "com.android.art.key",
-    target: {
-        darwin: {
-            enabled: false,
-        },
-        linux_bionic: {
-            multilib: {
-                both: {
-                    native_shared_libs: bionic_native_shared_libs,
-                    binaries: bionic_binaries_both,
-                },
-            },
-        },
-    },
-    // ART APEXes depend on bouncycastle which is disabled for PDK builds.
-    // Since the dependency is disabled, ART APEXes can't be built either.
-    // Disable the APEXes too. See b/157267166.
-    product_variables: {
-        pdk: {
-            enabled: false,
-        },
-    },
 }
 
 python_binary_host {
@@ -534,7 +405,6 @@
     " --deapexer $(location deapexer)" +
     " --debugfs $(location debugfs_static)" +
     " --fsckerofs $(location fsck.erofs)" +
-    " --blkid $(location blkid_static)" +
     " --tmpdir $(genDir)"
 
 // The non-flattened APEXes are always checked, as they are always generated
@@ -544,7 +414,6 @@
     defaults: ["art_module_source_build_genrule_defaults"],
     tools: [
         "art-apex-tester",
-        "blkid_static",
         "deapexer",
         "debugfs_static",
         "fsck.erofs",
diff --git a/build/apex/art.rc b/build/apex/art.rc
index 563ee97..b3eea29 100644
--- a/build/apex/art.rc
+++ b/build/apex/art.rc
@@ -12,7 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# A lazy service that is started and stopped dynamically as needed.
+# A service that handles dexopt. See art/artd/README.md. It's a lazy service
+# that is started and stopped dynamically as needed.
 service artd /apex/com.android.art/bin/artd
     interface aidl artd
     disabled  # Prevents the service from automatically starting at boot.
@@ -22,8 +23,33 @@
     group artd
     capabilities DAC_OVERRIDE DAC_READ_SEARCH FOWNER CHOWN
 
+# Same as above, but for Pre-reboot Dexopt. It runs in a chroot environment that
+# is set up by dexopt_chroot_setup. It's a lazy service that is started and
+# stopped dynamically as needed.
+service artd_pre_reboot /apex/com.android.art/bin/art_exec --chroot=/mnt/pre_reboot_dexopt -- /apex/com.android.art/bin/artd --pre-reboot
+    interface aidl artd_pre_reboot
+    disabled  # Prevents the service from automatically starting at boot.
+    oneshot  # Prevents the service from automatically restarting each time it is stopped.
+    class core
+    user artd
+    group artd
+    capabilities DAC_OVERRIDE DAC_READ_SEARCH FOWNER CHOWN SYS_CHROOT
+    seclabel u:r:artd:s0
+
+# A service that sets up the chroot environment for Pre-reboot Dexopt. See
+# art/dexopt_chroot_setup/README.md. It's a lazy service that is started and
+# stopped dynamically as needed.
+service dexopt_chroot_setup /apex/com.android.art/bin/dexopt_chroot_setup
+    interface aidl dexopt_chroot_setup
+    disabled  # Prevents the service from automatically starting at boot.
+    oneshot  # Prevents the service from automatically restarting each time it is stopped.
+    class core
+    user artd
+    group artd
+
 # Run at boot in Android U and later.
 service art_boot /apex/com.android.art/bin/art_boot
     disabled  # Started explicitly from system/core/rootdir/init.rc
     oneshot
     class core
+    user root
diff --git a/build/apex/art_apex_test.py b/build/apex/art_apex_test.py
index e10d979..a124031 100755
--- a/build/apex/art_apex_test.py
+++ b/build/apex/art_apex_test.py
@@ -66,13 +66,13 @@
 
 
 def extract_apex(apex_path, deapexer_path, debugfs_path, fsckerofs_path,
-                 blkid_path, tmpdir):
+                 tmpdir):
   _, apex_name = os.path.split(apex_path)
   extract_path = os.path.join(tmpdir, apex_name)
   if os.path.exists(extract_path):
     shutil.rmtree(extract_path)
   subprocess.check_call([deapexer_path, '--debugfs', debugfs_path,
-                         '--fsckerofs', fsckerofs_path, '--blkid', blkid_path,
+                         '--fsckerofs', fsckerofs_path,
                          'extract', apex_path, extract_path],
                         stdout=subprocess.DEVNULL)
   return extract_path
@@ -475,7 +475,6 @@
     # Check internal libraries for ART.
     self._checker.check_native_library('libadbconnection')
     self._checker.check_native_library('libart')
-    self._checker.check_native_library('libart-compiler')
     self._checker.check_native_library('libart-dexlayout')
     self._checker.check_native_library('libart-disassembler')
     self._checker.check_native_library('libartbase')
@@ -553,6 +552,7 @@
     self._checker.check_executable('art_boot')
     self._checker.check_executable('art_exec')
     self._checker.check_executable('artd')
+    self._checker.check_executable('dexopt_chroot_setup')
     self._checker.check_executable('oatdump')
     self._checker.check_executable("odrefresh")
     self._checker.check_symlinked_multilib_executable('dex2oat')
@@ -622,7 +622,6 @@
     self._checker.check_native_library('libadbconnectiond')
     self._checker.check_native_library('libartbased')
     self._checker.check_native_library('libartd')
-    self._checker.check_native_library('libartd-compiler')
     self._checker.check_native_library('libartd-dexlayout')
     self._checker.check_native_library('libartd-disassembler')
     self._checker.check_native_library('libopenjdkjvmd')
@@ -683,6 +682,7 @@
     self._checker.check_art_test_executable('art_dexdump_tests')
     self._checker.check_art_test_executable('art_dexlayout_tests')
     self._checker.check_art_test_executable('art_dexlist_tests')
+    self._checker.check_art_test_executable('art_dexopt_chroot_setup_tests')
     self._checker.check_art_test_executable('art_dexoptanalyzer_tests')
     self._checker.check_art_test_executable('art_disassembler_tests')
     self._checker.check_art_test_executable('art_imgdiag_tests')
@@ -699,11 +699,6 @@
     self._checker.check_art_test_executable('art_runtime_tests')
     self._checker.check_art_test_executable('art_sigchain_tests')
 
-    # Check ART test (internal) libraries.
-    self._checker.check_native_library('libartd-gtest')
-    self._checker.check_native_library('libartd-simulator-container')
-    self._checker.check_native_library('libartbased-testing')
-
     # Check ART test tools.
     self._checker.check_executable('signal_dumper')
 
@@ -763,6 +758,8 @@
     self._checker.check_art_test_data('art-gtest-jars-Dex2oatVdexPublicSdkDex.dex')
     self._checker.check_art_test_data('art-gtest-jars-SuperWithAccessChecks.dex')
 
+    # Fuzzer cases
+    self._checker.check_art_test_data("fuzzer_corpus.zip")
 
 class NoSuperfluousBinariesChecker:
   def __init__(self, checker):
@@ -905,9 +902,6 @@
     if not test_args.fsckerofs:
       logging.error("Need fsck.erofs.")
       return 1
-    if not test_args.blkid:
-      logging.error("Need blkid.")
-      return 1
 
   if test_args.host:
     # Host APEX.
@@ -947,7 +941,7 @@
         # Extract the apex. It would be nice to use the output from "deapexer list"
         # to avoid this work, but it doesn't provide info about executable bits.
         apex_dir = extract_apex(test_args.apex, test_args.deapexer, test_args.debugfs,
-                                test_args.fsckerofs, test_args.blkid, test_args.tmpdir)
+                                test_args.fsckerofs, test_args.tmpdir)
       apex_provider = TargetApexProvider(apex_dir)
   except (zipfile.BadZipFile, zipfile.LargeZipFile) as e:
     logging.error('Failed to create provider: %s', e)
@@ -1034,7 +1028,6 @@
   test_args = test_parser.parse_args(['unused'])  # For consistency.
   test_args.debugfs = '%s/bin/debugfs' % host_out
   test_args.fsckerofs = '%s/bin/fsck.erofs' % host_out
-  test_args.blkid = '%s/bin/blkid_static' % host_out
   test_args.tmpdir = '.'
   test_args.tree = False
   test_args.list = False
@@ -1091,7 +1084,6 @@
   parser.add_argument('--deapexer', help='Path to deapexer')
   parser.add_argument('--debugfs', help='Path to debugfs')
   parser.add_argument('--fsckerofs', help='Path to fsck.erofs')
-  parser.add_argument('--blkid', help='Path to blkid')
 
   parser.add_argument('--bitness', help='Bitness to check', choices=BITNESS_ALL,
                       default=BITNESS_AUTO)
diff --git a/build/apex/runtests.sh b/build/apex/runtests.sh
index cdbb7c0..760d011 100755
--- a/build/apex/runtests.sh
+++ b/build/apex/runtests.sh
@@ -46,7 +46,6 @@
   HOST_OUT
   PRODUCT_COMPRESSED_APEX
   PRODUCT_OUT
-  TARGET_FLATTEN_APEX
 )
 vars="$($ANDROID_BUILD_TOP/build/soong/soong_ui.bash \
         --dumpvars-mode --vars="${query_build_vars[*]}")"
@@ -60,26 +59,22 @@
 fi
 
 deapex_binaries=(
-  blkid_static
   deapexer
   debugfs_static
   fsck.erofs
 )
 
-have_deapex_binaries=false
-if [[ "$TARGET_FLATTEN_APEX" != true ]]; then
-  have_deapex_binaries=true
-  for f in ${deapex_binaries[@]}; do
-    if [ ! -e "$HOST_OUT/bin/$f" ]; then
-      have_deapex_binaries=false
-    fi
-  done
-  if $have_deapex_binaries; then :; else
-    deapex_targets=( ${deapex_binaries[@]/%/-host} )
-    say "Building host binaries for deapexer: ${deapex_targets[*]}"
-    build/soong/soong_ui.bash --make-mode ${deapex_targets[@]} || \
-      die "Failed to build: ${deapex_targets[*]}"
+have_deapex_binaries=true
+for f in ${deapex_binaries[@]}; do
+  if [ ! -e "$HOST_OUT/bin/$f" ]; then
+    have_deapex_binaries=false
   fi
+done
+if $have_deapex_binaries; then :; else
+  deapex_targets=( ${deapex_binaries[@]/%/-host} )
+  say "Building host binaries for deapexer: ${deapex_targets[*]}"
+  build/soong/soong_ui.bash --make-mode ${deapex_targets[@]} || \
+    die "Failed to build: ${deapex_targets[*]}"
 fi
 
 # Fail early.
@@ -100,7 +95,7 @@
   -l, --list-files    list the contents of the ext4 image (\`find\`-like style)
   -t, --print-tree    list the contents of the ext4 image (\`tree\`-like style)
   -s, --print-sizes   print the size in bytes of each file when listing contents
-  --bitness=32|64|multilib|auto  passed on to art_apex_test.py for non-host APEXes
+  --bitness=32|64|multilib|auto  passed on to art_apex_test.py
   -h, --help          display this help and exit
 
 EOF
@@ -167,11 +162,6 @@
     "com.android.art.debug"
     "com.android.art.testing"
   )
-  if [[ "$HOST_PREFER_32_BIT" = true ]]; then
-    say "Skipping com.android.art.host, as \`HOST_PREFER_32_BIT\` equals \`true\`"
-  else
-    apex_modules+=("com.android.art.host")
-  fi
 fi
 
 # Build the APEX packages (optional).
@@ -197,37 +187,23 @@
 
   art_apex_test_args="--tmpdir $work_dir"
   test_only_args=""
-  if [[ $apex_module = *.host ]]; then
-    apex_path="$HOST_OUT/apex/${apex_module}.zipapex"
-    art_apex_test_args="$art_apex_test_args --host"
-    test_only_args="--flavor debug"
-    # The host APEX is always built multilib.
-    art_apex_test_args="$art_apex_test_args --bitness=multilib"
+  art_apex_test_args="$art_apex_test_args $device_bitness_arg"
+  # Note: The Testing ART APEX is never built as a Compressed APEX.
+  if [[ "$PRODUCT_COMPRESSED_APEX" = true && $apex_module != *.testing ]]; then
+    apex_path="$PRODUCT_OUT/system/apex/${apex_module}.capex"
   else
-    art_apex_test_args="$art_apex_test_args $device_bitness_arg"
-    if [[ "$TARGET_FLATTEN_APEX" = true ]]; then
-      apex_path="$PRODUCT_OUT/system/apex/${apex_module}"
-      art_apex_test_args="$art_apex_test_args --flattened"
-    else
-      # Note: The Testing ART APEX is never built as a Compressed APEX.
-      if [[ "$PRODUCT_COMPRESSED_APEX" = true && $apex_module != *.testing ]]; then
-        apex_path="$PRODUCT_OUT/system/apex/${apex_module}.capex"
-      else
-        apex_path="$PRODUCT_OUT/system/apex/${apex_module}.apex"
-      fi
-    fi
-    if $have_deapex_binaries; then
-      art_apex_test_args="$art_apex_test_args --deapexer $HOST_OUT/bin/deapexer"
-      art_apex_test_args="$art_apex_test_args --debugfs $HOST_OUT/bin/debugfs_static"
-      art_apex_test_args="$art_apex_test_args --fsckerofs $HOST_OUT/bin/fsck.erofs"
-      art_apex_test_args="$art_apex_test_args --blkid $HOST_OUT/bin/blkid_static"
-    fi
-    case $apex_module in
-      (*.debug)   test_only_args="--flavor debug";;
-      (*.testing) test_only_args="--flavor testing";;
-      (*)         test_only_args="--flavor release";;
-    esac
+    apex_path="$PRODUCT_OUT/system/apex/${apex_module}.apex"
   fi
+  if $have_deapex_binaries; then
+    art_apex_test_args="$art_apex_test_args --deapexer $HOST_OUT/bin/deapexer"
+    art_apex_test_args="$art_apex_test_args --debugfs $HOST_OUT/bin/debugfs_static"
+    art_apex_test_args="$art_apex_test_args --fsckerofs $HOST_OUT/bin/fsck.erofs"
+  fi
+  case $apex_module in
+    (*.debug)   test_only_args="--flavor debug";;
+    (*.testing) test_only_args="--flavor testing";;
+    (*)         test_only_args="--flavor release";;
+  esac
   say "APEX package path: $apex_path"
 
   # List the contents of the APEX image (optional).
diff --git a/build/art.go b/build/art.go
index f03a528..34e3c15 100644
--- a/build/art.go
+++ b/build/art.go
@@ -16,7 +16,6 @@
 
 import (
 	"fmt"
-	"log"
 	"path/filepath"
 	"strings"
 	"sync"
@@ -24,7 +23,6 @@
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
-	"android/soong/apex"
 	"android/soong/cc"
 	"android/soong/cc/config"
 )
@@ -105,6 +103,10 @@
 			"-DART_STACK_OVERFLOW_GAP_x86_64=8192")
 	}
 
+	if ctx.Config().NoBionicPageSizeMacro() {
+		cflags = append(cflags, "-DART_PAGE_SIZE_AGNOSTIC=1")
+	}
+
 	if ctx.Config().IsEnvTrue("ART_ENABLE_ADDRESS_SANITIZER") {
 		// Used to enable full sanitization, i.e., user poisoning, under ASAN.
 		cflags = append(cflags, "-DART_ENABLE_ADDRESS_SANITIZER=1")
@@ -118,15 +120,6 @@
 	return cflags, asflags
 }
 
-func debugFlags(ctx android.LoadHookContext) []string {
-	var cflags []string
-
-	opt := ctx.Config().GetenvWithDefault("ART_DEBUG_OPT_FLAG", "-O2")
-	cflags = append(cflags, opt)
-
-	return cflags
-}
-
 func deviceFlags(ctx android.LoadHookContext) []string {
 	var cflags []string
 	deviceFrameSizeLimit := 1736
@@ -233,16 +226,6 @@
 	ctx.AppendProperties(p)
 }
 
-func debugDefaults(ctx android.LoadHookContext) {
-	type props struct {
-		Cflags []string
-	}
-
-	p := &props{}
-	p.Cflags = debugFlags(ctx)
-	ctx.AppendProperties(p)
-}
-
 func customLinker(ctx android.LoadHookContext) {
 	linker := ctx.Config().Getenv("CUSTOM_TARGET_LINKER")
 	type props struct {
@@ -345,11 +328,7 @@
 		"art_cc_test",
 		"art_cc_test_library",
 		"art_cc_defaults",
-		"libart_cc_defaults",
-		"libart_static_cc_defaults",
 		"art_global_defaults",
-		"art_debug_defaults",
-		"art_apex_test_host",
 	}
 	android.AddNeverAllowRules(
 		android.NeverAllow().
@@ -362,40 +341,7 @@
 	android.RegisterModuleType("art_cc_test", artTest)
 	android.RegisterModuleType("art_cc_test_library", artTestLibrary)
 	android.RegisterModuleType("art_cc_defaults", artDefaultsFactory)
-	android.RegisterModuleType("libart_cc_defaults", libartDefaultsFactory)
-	android.RegisterModuleType("libart_static_cc_defaults", libartStaticDefaultsFactory)
 	android.RegisterModuleType("art_global_defaults", artGlobalDefaultsFactory)
-	android.RegisterModuleType("art_debug_defaults", artDebugDefaultsFactory)
-
-	// TODO: This makes the module disable itself for host if HOST_PREFER_32_BIT is
-	// set. We need this because the multilib types of binaries listed in the apex
-	// rule must match the declared type. This is normally not difficult but HOST_PREFER_32_BIT
-	// changes this to 'prefer32' on all host binaries. Since HOST_PREFER_32_BIT is
-	// only used for testing we can just disable the module.
-	// See b/120617876 for more information.
-	android.RegisterModuleType("art_apex_test_host", artHostTestApexBundleFactory)
-}
-
-func artHostTestApexBundleFactory() android.Module {
-	module := apex.ApexBundleFactory(true)
-	android.AddLoadHook(module, func(ctx android.LoadHookContext) {
-		if ctx.Config().IsEnvTrue("HOST_PREFER_32_BIT") {
-			type props struct {
-				Target struct {
-					Host struct {
-						Enabled *bool
-					}
-				}
-			}
-
-			p := &props{}
-			p.Target.Host.Enabled = proptools.BoolPtr(false)
-			ctx.AppendProperties(p)
-			log.Print("Disabling host build of " + ctx.ModuleName() + " for HOST_PREFER_32_BIT=true")
-		}
-	})
-
-	return module
 }
 
 func artGlobalDefaultsFactory() android.Module {
@@ -406,13 +352,6 @@
 	return module
 }
 
-func artDebugDefaultsFactory() android.Module {
-	module := artDefaultsFactory()
-	android.AddLoadHook(module, debugDefaults)
-
-	return module
-}
-
 func artDefaultsFactory() android.Module {
 	c := &codegenProperties{}
 	module := cc.DefaultsFactory(c)
@@ -421,22 +360,6 @@
 	return module
 }
 
-func libartDefaultsFactory() android.Module {
-	c := &codegenProperties{}
-	module := cc.DefaultsFactory(c)
-	android.AddLoadHook(module, func(ctx android.LoadHookContext) { codegen(ctx, c, staticAndSharedLibrary) })
-
-	return module
-}
-
-func libartStaticDefaultsFactory() android.Module {
-	c := &codegenProperties{}
-	module := cc.DefaultsFactory(c)
-	android.AddLoadHook(module, func(ctx android.LoadHookContext) { codegen(ctx, c, staticLibrary) })
-
-	return module
-}
-
 func artLibrary() android.Module {
 	module := cc.LibraryFactory()
 
@@ -467,8 +390,7 @@
 }
 
 func artTest() android.Module {
-	// Disable bp2build.
-	module := cc.NewTest(android.HostAndDeviceSupported, false /* bazelable */).Init()
+	module := cc.NewTest(android.HostAndDeviceSupported).Init()
 
 	installCodegenCustomizer(module, binary)
 
diff --git a/build/boot/Android.bp b/build/boot/Android.bp
index 292bb6f..a2fa55c 100644
--- a/build/boot/Android.bp
+++ b/build/boot/Android.bp
@@ -21,9 +21,52 @@
     default_applicable_licenses: ["art_license"],
 }
 
+// TODO: b/319697968 - Remove the conditional logic and let art-bootclasspath-fragment always
+// depend on the exportable stubs once metalava fully supports flagged api handling.
+soong_config_module_type {
+    name: "art_bootclasspath_fragment_soong_config_defaults",
+    module_type: "java_defaults",
+    config_namespace: "ANDROID",
+    bool_variables: [
+        "release_hidden_api_exportable_stubs",
+    ],
+    properties: [
+        "core_platform_api.stub_libs",
+    ],
+}
+
+art_bootclasspath_fragment_soong_config_defaults {
+    name: "art-bootclasspath-fragment-soong-config-defaults",
+    soong_config_variables: {
+        release_hidden_api_exportable_stubs: {
+            // When "RELEASE_HIDDEN_API_EXPORTABLE_STUBS" build flag is set,
+            // depend on the exportable stubs
+            core_platform_api: {
+                stub_libs: [
+                    // Core platform (aka. module_lib) stubs for all the non-coverage contents.
+                    "art.module.public.api.stubs.exportable.module_lib",
+                ],
+            },
+            conditions_default: {
+                // When "RELEASE_HIDDEN_API_EXPORTABLE_STUBS" build flag is not set,
+                // depend on the everything stubs
+                core_platform_api: {
+                    stub_libs: [
+                        // Core platform (aka. module_lib) stubs for all the non-coverage contents.
+                        "art.module.public.api.stubs.module_lib",
+                    ],
+                },
+            },
+        },
+    },
+}
+
 // Encapsulate the contributions made by the com.android.art to the bootclasspath.
 bootclasspath_fragment {
     name: "art-bootclasspath-fragment",
+    defaults: [
+        "art-bootclasspath-fragment-soong-config-defaults",
+    ],
     image_name: "art",
     // Must match the ART_APEX_JARS set in build/make/core/envsetup.mk
     contents: [
@@ -41,12 +84,6 @@
             "art.module.public.api",
         ],
     },
-    core_platform_api: {
-        stub_libs: [
-            // Core platform (aka. module_lib) stubs for all the non-coverage contents.
-            "art.module.public.api.stubs.module_lib",
-        ],
-    },
 
     // Additional properties to append when coverage is enabled, i.e. when
     // EMMA_INSTRUMENT_FRAMEWORK=true
@@ -105,6 +142,7 @@
         // result in a build failure due to inconsistent flags.
         package_prefixes: [
             "android.compat",
+            "android.crypto.hpke",
             "com.android.okhttp",
             "com.android.org.bouncycastle",
             "com.android.org.kxml2",
diff --git a/build/boot/boot-image-profile.txt b/build/boot/boot-image-profile.txt
index a2828fe..d3fe127 100644
--- a/build/boot/boot-image-profile.txt
+++ b/build/boot/boot-image-profile.txt
@@ -34,9 +34,9 @@
 HSPLandroid/system/Os;->fstat(Ljava/io/FileDescriptor;)Landroid/system/StructStat;
 HSPLandroid/system/Os;->getpeername(Ljava/io/FileDescriptor;)Ljava/net/SocketAddress;
 HSPLandroid/system/Os;->getpgid(I)I
-HSPLandroid/system/Os;->getpid()I+]Llibcore/io/Os;Landroid/app/ActivityThread$AndroidOs;
-HSPLandroid/system/Os;->gettid()I+]Llibcore/io/Os;Landroid/app/ActivityThread$AndroidOs;
-HSPLandroid/system/Os;->getuid()I+]Llibcore/io/Os;Landroid/app/ActivityThread$AndroidOs;
+HSPLandroid/system/Os;->getpid()I
+HSPLandroid/system/Os;->gettid()I
+HSPLandroid/system/Os;->getuid()I
 HSPLandroid/system/Os;->getxattr(Ljava/lang/String;Ljava/lang/String;)[B
 HSPLandroid/system/Os;->ioctlInt(Ljava/io/FileDescriptor;I)I
 HSPLandroid/system/Os;->listen(Ljava/io/FileDescriptor;I)V
@@ -141,12 +141,12 @@
 HSPLcom/android/okhttp/Headers$Builder;->build()Lcom/android/okhttp/Headers;
 HSPLcom/android/okhttp/Headers$Builder;->checkNameAndValue(Ljava/lang/String;Ljava/lang/String;)V
 HSPLcom/android/okhttp/Headers$Builder;->get(Ljava/lang/String;)Ljava/lang/String;
-HSPLcom/android/okhttp/Headers$Builder;->removeAll(Ljava/lang/String;)Lcom/android/okhttp/Headers$Builder;+]Ljava/lang/String;Ljava/lang/String;]Ljava/util/List;Ljava/util/ArrayList;
+HSPLcom/android/okhttp/Headers$Builder;->removeAll(Ljava/lang/String;)Lcom/android/okhttp/Headers$Builder;
 HSPLcom/android/okhttp/Headers$Builder;->set(Ljava/lang/String;Ljava/lang/String;)Lcom/android/okhttp/Headers$Builder;
 HSPLcom/android/okhttp/Headers;-><init>(Lcom/android/okhttp/Headers$Builder;)V
 HSPLcom/android/okhttp/Headers;-><init>(Lcom/android/okhttp/Headers$Builder;Lcom/android/okhttp/Headers$1;)V
 HSPLcom/android/okhttp/Headers;->get(Ljava/lang/String;)Ljava/lang/String;
-HSPLcom/android/okhttp/Headers;->get([Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+]Ljava/lang/String;Ljava/lang/String;
+HSPLcom/android/okhttp/Headers;->get([Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
 HSPLcom/android/okhttp/Headers;->name(I)Ljava/lang/String;
 HSPLcom/android/okhttp/Headers;->newBuilder()Lcom/android/okhttp/Headers$Builder;
 HSPLcom/android/okhttp/Headers;->size()I
@@ -182,7 +182,7 @@
 HSPLcom/android/okhttp/HttpUrl;-><init>(Lcom/android/okhttp/HttpUrl$Builder;)V
 HSPLcom/android/okhttp/HttpUrl;-><init>(Lcom/android/okhttp/HttpUrl$Builder;Lcom/android/okhttp/HttpUrl$1;)V
 HSPLcom/android/okhttp/HttpUrl;->access$200(Ljava/lang/String;IILjava/lang/String;)I
-HSPLcom/android/okhttp/HttpUrl;->canonicalize(Ljava/lang/String;IILjava/lang/String;ZZZZ)Ljava/lang/String;+]Ljava/lang/String;Ljava/lang/String;
+HSPLcom/android/okhttp/HttpUrl;->canonicalize(Ljava/lang/String;IILjava/lang/String;ZZZZ)Ljava/lang/String;
 HSPLcom/android/okhttp/HttpUrl;->canonicalize(Ljava/lang/String;Ljava/lang/String;ZZZZ)Ljava/lang/String;
 HSPLcom/android/okhttp/HttpUrl;->decodeHexDigit(C)I
 HSPLcom/android/okhttp/HttpUrl;->defaultPort(Ljava/lang/String;)I
@@ -202,7 +202,7 @@
 HSPLcom/android/okhttp/HttpUrl;->newBuilder()Lcom/android/okhttp/HttpUrl$Builder;
 HSPLcom/android/okhttp/HttpUrl;->pathSegmentsToString(Ljava/lang/StringBuilder;Ljava/util/List;)V
 HSPLcom/android/okhttp/HttpUrl;->percentDecode(Lcom/android/okhttp/okio/Buffer;Ljava/lang/String;IIZ)V
-HSPLcom/android/okhttp/HttpUrl;->percentDecode(Ljava/lang/String;IIZ)Ljava/lang/String;+]Ljava/lang/String;Ljava/lang/String;
+HSPLcom/android/okhttp/HttpUrl;->percentDecode(Ljava/lang/String;IIZ)Ljava/lang/String;
 HSPLcom/android/okhttp/HttpUrl;->percentDecode(Ljava/lang/String;Z)Ljava/lang/String;
 HSPLcom/android/okhttp/HttpUrl;->percentDecode(Ljava/util/List;Z)Ljava/util/List;
 HSPLcom/android/okhttp/HttpUrl;->port()I
@@ -471,8 +471,8 @@
 HSPLcom/android/okhttp/internal/http/HttpEngine;->writingRequestHeaders()V
 HSPLcom/android/okhttp/internal/http/HttpMethod;->permitsRequestBody(Ljava/lang/String;)Z
 HSPLcom/android/okhttp/internal/http/HttpMethod;->requiresRequestBody(Ljava/lang/String;)Z
-HSPLcom/android/okhttp/internal/http/OkHeaders$1;->compare(Ljava/lang/Object;Ljava/lang/Object;)I+]Lcom/android/okhttp/internal/http/OkHeaders$1;Lcom/android/okhttp/internal/http/OkHeaders$1;
-HSPLcom/android/okhttp/internal/http/OkHeaders$1;->compare(Ljava/lang/String;Ljava/lang/String;)I+]Ljava/util/Comparator;Ljava/lang/String$CaseInsensitiveComparator;
+HSPLcom/android/okhttp/internal/http/OkHeaders$1;->compare(Ljava/lang/Object;Ljava/lang/Object;)I
+HSPLcom/android/okhttp/internal/http/OkHeaders$1;->compare(Ljava/lang/String;Ljava/lang/String;)I
 HSPLcom/android/okhttp/internal/http/OkHeaders;->contentLength(Lcom/android/okhttp/Headers;)J
 HSPLcom/android/okhttp/internal/http/OkHeaders;->contentLength(Lcom/android/okhttp/Request;)J
 HSPLcom/android/okhttp/internal/http/OkHeaders;->contentLength(Lcom/android/okhttp/Response;)J
@@ -682,17 +682,17 @@
 HSPLcom/android/okhttp/okio/Buffer;->readShort()S
 HSPLcom/android/okhttp/okio/Buffer;->readString(JLjava/nio/charset/Charset;)Ljava/lang/String;
 HSPLcom/android/okhttp/okio/Buffer;->readUtf8()Ljava/lang/String;
-HSPLcom/android/okhttp/okio/Buffer;->readUtf8(J)Ljava/lang/String;+]Lcom/android/okhttp/okio/Buffer;Lcom/android/okhttp/okio/Buffer;
-HSPLcom/android/okhttp/okio/Buffer;->readUtf8Line(J)Ljava/lang/String;+]Lcom/android/okhttp/okio/Buffer;Lcom/android/okhttp/okio/Buffer;
+HSPLcom/android/okhttp/okio/Buffer;->readUtf8(J)Ljava/lang/String;
+HSPLcom/android/okhttp/okio/Buffer;->readUtf8Line(J)Ljava/lang/String;
 HSPLcom/android/okhttp/okio/Buffer;->size()J
-HSPLcom/android/okhttp/okio/Buffer;->skip(J)V+]Lcom/android/okhttp/okio/Segment;Lcom/android/okhttp/okio/Segment;
+HSPLcom/android/okhttp/okio/Buffer;->skip(J)V
 HSPLcom/android/okhttp/okio/Buffer;->writableSegment(I)Lcom/android/okhttp/okio/Segment;
 HSPLcom/android/okhttp/okio/Buffer;->write(Lcom/android/okhttp/okio/Buffer;J)V
 HSPLcom/android/okhttp/okio/Buffer;->write([BII)Lcom/android/okhttp/okio/Buffer;
 HSPLcom/android/okhttp/okio/Buffer;->writeByte(I)Lcom/android/okhttp/okio/Buffer;
 HSPLcom/android/okhttp/okio/Buffer;->writeHexadecimalUnsignedLong(J)Lcom/android/okhttp/okio/Buffer;
 HSPLcom/android/okhttp/okio/Buffer;->writeUtf8(Ljava/lang/String;)Lcom/android/okhttp/okio/Buffer;
-HSPLcom/android/okhttp/okio/Buffer;->writeUtf8(Ljava/lang/String;II)Lcom/android/okhttp/okio/Buffer;+]Lcom/android/okhttp/okio/Buffer;Lcom/android/okhttp/okio/Buffer;
+HSPLcom/android/okhttp/okio/Buffer;->writeUtf8(Ljava/lang/String;II)Lcom/android/okhttp/okio/Buffer;
 HSPLcom/android/okhttp/okio/Buffer;->writeUtf8CodePoint(I)Lcom/android/okhttp/okio/Buffer;
 HSPLcom/android/okhttp/okio/ByteString;-><init>([B)V
 HSPLcom/android/okhttp/okio/ByteString;->hex()Ljava/lang/String;
@@ -757,15 +757,15 @@
 HSPLcom/android/okhttp/okio/RealBufferedSource;->buffer()Lcom/android/okhttp/okio/Buffer;
 HSPLcom/android/okhttp/okio/RealBufferedSource;->close()V
 HSPLcom/android/okhttp/okio/RealBufferedSource;->exhausted()Z
-HSPLcom/android/okhttp/okio/RealBufferedSource;->indexOf(B)J+]Lcom/android/okhttp/okio/RealBufferedSource;Lcom/android/okhttp/okio/RealBufferedSource;
-HSPLcom/android/okhttp/okio/RealBufferedSource;->indexOf(BJ)J+]Lcom/android/okhttp/okio/Buffer;Lcom/android/okhttp/okio/Buffer;]Lcom/android/okhttp/okio/Source;Lcom/android/okhttp/okio/AsyncTimeout$2;
+HSPLcom/android/okhttp/okio/RealBufferedSource;->indexOf(B)J
+HSPLcom/android/okhttp/okio/RealBufferedSource;->indexOf(BJ)J
 HSPLcom/android/okhttp/okio/RealBufferedSource;->inputStream()Ljava/io/InputStream;
 HSPLcom/android/okhttp/okio/RealBufferedSource;->read(Lcom/android/okhttp/okio/Buffer;J)J
-HSPLcom/android/okhttp/okio/RealBufferedSource;->readHexadecimalUnsignedLong()J+]Lcom/android/okhttp/okio/Buffer;Lcom/android/okhttp/okio/Buffer;]Lcom/android/okhttp/okio/RealBufferedSource;Lcom/android/okhttp/okio/RealBufferedSource;
+HSPLcom/android/okhttp/okio/RealBufferedSource;->readHexadecimalUnsignedLong()J
 HSPLcom/android/okhttp/okio/RealBufferedSource;->readIntLe()I
 HSPLcom/android/okhttp/okio/RealBufferedSource;->readShort()S
-HSPLcom/android/okhttp/okio/RealBufferedSource;->readUtf8LineStrict()Ljava/lang/String;+]Lcom/android/okhttp/okio/Buffer;Lcom/android/okhttp/okio/Buffer;]Lcom/android/okhttp/okio/RealBufferedSource;Lcom/android/okhttp/okio/RealBufferedSource;
-HSPLcom/android/okhttp/okio/RealBufferedSource;->request(J)Z+]Lcom/android/okhttp/okio/Source;Lcom/android/okhttp/okio/AsyncTimeout$2;
+HSPLcom/android/okhttp/okio/RealBufferedSource;->readUtf8LineStrict()Ljava/lang/String;
+HSPLcom/android/okhttp/okio/RealBufferedSource;->request(J)Z
 HSPLcom/android/okhttp/okio/RealBufferedSource;->require(J)V
 HSPLcom/android/okhttp/okio/RealBufferedSource;->skip(J)V
 HSPLcom/android/okhttp/okio/RealBufferedSource;->timeout()Lcom/android/okhttp/okio/Timeout;
@@ -791,33 +791,25 @@
 HSPLcom/android/okhttp/okio/Util;->checkOffsetAndCount(JJJ)V
 HSPLcom/android/okhttp/okio/Util;->reverseBytesInt(I)I
 HSPLcom/android/org/bouncycastle/asn1/ASN1BitString;-><init>([BI)V
-HSPLcom/android/org/bouncycastle/asn1/ASN1BitString;->fromInputStream(ILjava/io/InputStream;)Lcom/android/org/bouncycastle/asn1/ASN1BitString;
 HSPLcom/android/org/bouncycastle/asn1/ASN1EncodableVector;-><init>()V
 HSPLcom/android/org/bouncycastle/asn1/ASN1EncodableVector;-><init>(I)V
 HSPLcom/android/org/bouncycastle/asn1/ASN1EncodableVector;->add(Lcom/android/org/bouncycastle/asn1/ASN1Encodable;)V
 HSPLcom/android/org/bouncycastle/asn1/ASN1EncodableVector;->get(I)Lcom/android/org/bouncycastle/asn1/ASN1Encodable;
-HSPLcom/android/org/bouncycastle/asn1/ASN1EncodableVector;->size()I
-HSPLcom/android/org/bouncycastle/asn1/ASN1EncodableVector;->takeElements()[Lcom/android/org/bouncycastle/asn1/ASN1Encodable;
 HSPLcom/android/org/bouncycastle/asn1/ASN1InputStream;-><init>(Ljava/io/InputStream;)V
-HSPLcom/android/org/bouncycastle/asn1/ASN1InputStream;-><init>(Ljava/io/InputStream;I)V
 HSPLcom/android/org/bouncycastle/asn1/ASN1InputStream;-><init>(Ljava/io/InputStream;IZ)V
 HSPLcom/android/org/bouncycastle/asn1/ASN1InputStream;-><init>([B)V
 HSPLcom/android/org/bouncycastle/asn1/ASN1InputStream;->buildObject(III)Lcom/android/org/bouncycastle/asn1/ASN1Primitive;
 HSPLcom/android/org/bouncycastle/asn1/ASN1InputStream;->createPrimitiveDERObject(ILcom/android/org/bouncycastle/asn1/DefiniteLengthInputStream;[[B)Lcom/android/org/bouncycastle/asn1/ASN1Primitive;
 HSPLcom/android/org/bouncycastle/asn1/ASN1InputStream;->getBuffer(Lcom/android/org/bouncycastle/asn1/DefiniteLengthInputStream;[[B)[B
-HSPLcom/android/org/bouncycastle/asn1/ASN1InputStream;->readLength()I
 HSPLcom/android/org/bouncycastle/asn1/ASN1InputStream;->readLength(Ljava/io/InputStream;IZ)I
 HSPLcom/android/org/bouncycastle/asn1/ASN1InputStream;->readObject()Lcom/android/org/bouncycastle/asn1/ASN1Primitive;
-HSPLcom/android/org/bouncycastle/asn1/ASN1InputStream;->readTagNumber(Ljava/io/InputStream;I)I
 HSPLcom/android/org/bouncycastle/asn1/ASN1InputStream;->readVector(Lcom/android/org/bouncycastle/asn1/DefiniteLengthInputStream;)Lcom/android/org/bouncycastle/asn1/ASN1EncodableVector;
 HSPLcom/android/org/bouncycastle/asn1/ASN1Integer;-><init>(Ljava/math/BigInteger;)V
-HSPLcom/android/org/bouncycastle/asn1/ASN1Integer;-><init>([BZ)V
 HSPLcom/android/org/bouncycastle/asn1/ASN1Integer;->encode(Lcom/android/org/bouncycastle/asn1/ASN1OutputStream;Z)V
 HSPLcom/android/org/bouncycastle/asn1/ASN1Integer;->encodedLength()I
 HSPLcom/android/org/bouncycastle/asn1/ASN1Integer;->getInstance(Ljava/lang/Object;)Lcom/android/org/bouncycastle/asn1/ASN1Integer;
 HSPLcom/android/org/bouncycastle/asn1/ASN1Integer;->getValue()Ljava/math/BigInteger;
 HSPLcom/android/org/bouncycastle/asn1/ASN1Integer;->isMalformed([B)Z
-HSPLcom/android/org/bouncycastle/asn1/ASN1Object;-><init>()V
 HSPLcom/android/org/bouncycastle/asn1/ASN1Object;->getEncoded()[B
 HSPLcom/android/org/bouncycastle/asn1/ASN1Object;->getEncoded(Ljava/lang/String;)[B
 HSPLcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier$OidHandle;-><init>([B)V
@@ -828,20 +820,15 @@
 HSPLcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier;->doOutput(Ljava/io/ByteArrayOutputStream;)V
 HSPLcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier;->encode(Lcom/android/org/bouncycastle/asn1/ASN1OutputStream;Z)V
 HSPLcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier;->encodedLength()I
-HSPLcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier;->fromOctetString([B)Lcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier;
 HSPLcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier;->getBody()[B
-HSPLcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier;->getId()Ljava/lang/String;
-HSPLcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier;->getInstance(Ljava/lang/Object;)Lcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier;
 HSPLcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier;->hashCode()I
 HSPLcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier;->writeField(Ljava/io/ByteArrayOutputStream;J)V
 HSPLcom/android/org/bouncycastle/asn1/ASN1OutputStream;-><init>(Ljava/io/OutputStream;)V
-HSPLcom/android/org/bouncycastle/asn1/ASN1OutputStream;->flushInternal()V
 HSPLcom/android/org/bouncycastle/asn1/ASN1OutputStream;->write(I)V
 HSPLcom/android/org/bouncycastle/asn1/ASN1OutputStream;->write([BII)V
 HSPLcom/android/org/bouncycastle/asn1/ASN1OutputStream;->writeEncoded(ZI[B)V
 HSPLcom/android/org/bouncycastle/asn1/ASN1OutputStream;->writeLength(I)V
 HSPLcom/android/org/bouncycastle/asn1/ASN1OutputStream;->writeObject(Lcom/android/org/bouncycastle/asn1/ASN1Encodable;)V
-HSPLcom/android/org/bouncycastle/asn1/ASN1Primitive;-><init>()V
 HSPLcom/android/org/bouncycastle/asn1/ASN1Primitive;->equals(Lcom/android/org/bouncycastle/asn1/ASN1Primitive;)Z
 HSPLcom/android/org/bouncycastle/asn1/ASN1Primitive;->fromByteArray([B)Lcom/android/org/bouncycastle/asn1/ASN1Primitive;
 HSPLcom/android/org/bouncycastle/asn1/ASN1Primitive;->toASN1Primitive()Lcom/android/org/bouncycastle/asn1/ASN1Primitive;
@@ -858,58 +845,26 @@
 HSPLcom/android/org/bouncycastle/asn1/ASN1Set;-><init>()V
 HSPLcom/android/org/bouncycastle/asn1/ASN1Set;-><init>(Lcom/android/org/bouncycastle/asn1/ASN1EncodableVector;Z)V
 HSPLcom/android/org/bouncycastle/asn1/ASN1Set;->getInstance(Ljava/lang/Object;)Lcom/android/org/bouncycastle/asn1/ASN1Set;
-HSPLcom/android/org/bouncycastle/asn1/ASN1Set;->getObjectAt(I)Lcom/android/org/bouncycastle/asn1/ASN1Encodable;
-HSPLcom/android/org/bouncycastle/asn1/ASN1Set;->getObjects()Ljava/util/Enumeration;
-HSPLcom/android/org/bouncycastle/asn1/ASN1Set;->size()I
-HSPLcom/android/org/bouncycastle/asn1/ASN1TaggedObject;->getObject()Lcom/android/org/bouncycastle/asn1/ASN1Primitive;
-HSPLcom/android/org/bouncycastle/asn1/DERBitString;-><init>([BI)V
 HSPLcom/android/org/bouncycastle/asn1/DERBitString;->getInstance(Ljava/lang/Object;)Lcom/android/org/bouncycastle/asn1/DERBitString;
-HSPLcom/android/org/bouncycastle/asn1/DERFactory;->createSequence(Lcom/android/org/bouncycastle/asn1/ASN1EncodableVector;)Lcom/android/org/bouncycastle/asn1/ASN1Sequence;
 HSPLcom/android/org/bouncycastle/asn1/DERNull;->encodedLength()I
-HSPLcom/android/org/bouncycastle/asn1/DEROutputStream;-><init>(Ljava/io/OutputStream;)V
 HSPLcom/android/org/bouncycastle/asn1/DEROutputStream;->getDERSubStream()Lcom/android/org/bouncycastle/asn1/DEROutputStream;
-HSPLcom/android/org/bouncycastle/asn1/DERSequence;-><init>()V
-HSPLcom/android/org/bouncycastle/asn1/DERSequence;-><init>(Lcom/android/org/bouncycastle/asn1/ASN1EncodableVector;)V
 HSPLcom/android/org/bouncycastle/asn1/DERSequence;->encode(Lcom/android/org/bouncycastle/asn1/ASN1OutputStream;Z)V
 HSPLcom/android/org/bouncycastle/asn1/DERSequence;->encodedLength()I
 HSPLcom/android/org/bouncycastle/asn1/DERSequence;->getBodyLength()I
 HSPLcom/android/org/bouncycastle/asn1/DERSequence;->toDERObject()Lcom/android/org/bouncycastle/asn1/ASN1Primitive;
 HSPLcom/android/org/bouncycastle/asn1/DLFactory;-><clinit>()V
-HSPLcom/android/org/bouncycastle/asn1/DLFactory;->createSequence(Lcom/android/org/bouncycastle/asn1/ASN1EncodableVector;)Lcom/android/org/bouncycastle/asn1/ASN1Sequence;
-HSPLcom/android/org/bouncycastle/asn1/DLSequence;-><init>()V
 HSPLcom/android/org/bouncycastle/asn1/DLSequence;-><init>(Lcom/android/org/bouncycastle/asn1/ASN1EncodableVector;)V
-HSPLcom/android/org/bouncycastle/asn1/DefiniteLengthInputStream;->getRemaining()I
 HSPLcom/android/org/bouncycastle/asn1/DefiniteLengthInputStream;->read()I
 HSPLcom/android/org/bouncycastle/asn1/DefiniteLengthInputStream;->read([BII)I
-HSPLcom/android/org/bouncycastle/asn1/DefiniteLengthInputStream;->readAllIntoByteArray([B)V
 HSPLcom/android/org/bouncycastle/asn1/DefiniteLengthInputStream;->toByteArray()[B
-HSPLcom/android/org/bouncycastle/asn1/LimitedInputStream;-><init>(Ljava/io/InputStream;I)V
-HSPLcom/android/org/bouncycastle/asn1/LimitedInputStream;->getLimit()I
-HSPLcom/android/org/bouncycastle/asn1/LimitedInputStream;->setParentEofDetect(Z)V
-HSPLcom/android/org/bouncycastle/asn1/OIDTokenizer;-><init>(Ljava/lang/String;)V
-HSPLcom/android/org/bouncycastle/asn1/OIDTokenizer;->hasMoreTokens()Z
-HSPLcom/android/org/bouncycastle/asn1/OIDTokenizer;->nextToken()Ljava/lang/String;
 HSPLcom/android/org/bouncycastle/asn1/StreamUtil;->calculateBodyLength(I)I
 HSPLcom/android/org/bouncycastle/asn1/StreamUtil;->findLimit(Ljava/io/InputStream;)I
-HSPLcom/android/org/bouncycastle/asn1/x509/AlgorithmIdentifier;-><init>(Lcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier;Lcom/android/org/bouncycastle/asn1/ASN1Encodable;)V
-HSPLcom/android/org/bouncycastle/asn1/x509/AlgorithmIdentifier;-><init>(Lcom/android/org/bouncycastle/asn1/ASN1Sequence;)V
-HSPLcom/android/org/bouncycastle/asn1/x509/AlgorithmIdentifier;->getAlgorithm()Lcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier;
 HSPLcom/android/org/bouncycastle/asn1/x509/AlgorithmIdentifier;->getInstance(Ljava/lang/Object;)Lcom/android/org/bouncycastle/asn1/x509/AlgorithmIdentifier;
-HSPLcom/android/org/bouncycastle/asn1/x509/AlgorithmIdentifier;->getParameters()Lcom/android/org/bouncycastle/asn1/ASN1Encodable;
 HSPLcom/android/org/bouncycastle/asn1/x509/AlgorithmIdentifier;->toASN1Primitive()Lcom/android/org/bouncycastle/asn1/ASN1Primitive;
-HSPLcom/android/org/bouncycastle/asn1/x509/SubjectPublicKeyInfo;-><init>(Lcom/android/org/bouncycastle/asn1/ASN1Sequence;)V
 HSPLcom/android/org/bouncycastle/asn1/x509/SubjectPublicKeyInfo;->getInstance(Ljava/lang/Object;)Lcom/android/org/bouncycastle/asn1/x509/SubjectPublicKeyInfo;
-HSPLcom/android/org/bouncycastle/crypto/BufferedBlockCipher;-><init>()V
-HSPLcom/android/org/bouncycastle/crypto/BufferedBlockCipher;->getBlockSize()I
-HSPLcom/android/org/bouncycastle/crypto/BufferedBlockCipher;->getUnderlyingCipher()Lcom/android/org/bouncycastle/crypto/BlockCipher;
 HSPLcom/android/org/bouncycastle/crypto/BufferedBlockCipher;->reset()V
 HSPLcom/android/org/bouncycastle/crypto/CryptoServicesRegistrar;->getSecureRandom()Ljava/security/SecureRandom;
-HSPLcom/android/org/bouncycastle/crypto/PBEParametersGenerator;-><init>()V
 HSPLcom/android/org/bouncycastle/crypto/PBEParametersGenerator;->PKCS12PasswordToBytes([C)[B
-HSPLcom/android/org/bouncycastle/crypto/PBEParametersGenerator;->PKCS5PasswordToUTF8Bytes([C)[B
-HSPLcom/android/org/bouncycastle/crypto/PBEParametersGenerator;->init([B[BI)V
-HSPLcom/android/org/bouncycastle/crypto/digests/AndroidDigestFactory;->getSHA1()Lcom/android/org/bouncycastle/crypto/Digest;
-HSPLcom/android/org/bouncycastle/crypto/digests/AndroidDigestFactoryOpenSSL;->getSHA1()Lcom/android/org/bouncycastle/crypto/Digest;
 HSPLcom/android/org/bouncycastle/crypto/digests/OpenSSLDigest$SHA1;-><init>()V
 HSPLcom/android/org/bouncycastle/crypto/digests/OpenSSLDigest;-><init>(Ljava/lang/String;I)V
 HSPLcom/android/org/bouncycastle/crypto/digests/OpenSSLDigest;->doFinal([BI)I
@@ -918,12 +873,10 @@
 HSPLcom/android/org/bouncycastle/crypto/digests/OpenSSLDigest;->reset()V
 HSPLcom/android/org/bouncycastle/crypto/digests/OpenSSLDigest;->update([BII)V
 HSPLcom/android/org/bouncycastle/crypto/engines/AESEngine;-><init>()V
-HSPLcom/android/org/bouncycastle/crypto/engines/AESEngine;->generateWorkingKey([BZ)[[I
 HSPLcom/android/org/bouncycastle/crypto/engines/AESEngine;->getAlgorithmName()Ljava/lang/String;
 HSPLcom/android/org/bouncycastle/crypto/engines/AESEngine;->getBlockSize()I
 HSPLcom/android/org/bouncycastle/crypto/engines/AESEngine;->init(ZLcom/android/org/bouncycastle/crypto/CipherParameters;)V
 HSPLcom/android/org/bouncycastle/crypto/engines/AESEngine;->packBlock([BI)V
-HSPLcom/android/org/bouncycastle/crypto/engines/AESEngine;->processBlock([BI[BI)I
 HSPLcom/android/org/bouncycastle/crypto/engines/AESEngine;->reset()V
 HSPLcom/android/org/bouncycastle/crypto/engines/AESEngine;->shift(II)I
 HSPLcom/android/org/bouncycastle/crypto/engines/AESEngine;->subWord(I)I
@@ -931,50 +884,28 @@
 HSPLcom/android/org/bouncycastle/crypto/engines/DESEngine;-><clinit>()V
 HSPLcom/android/org/bouncycastle/crypto/engines/DESEngine;-><init>()V
 HSPLcom/android/org/bouncycastle/crypto/engines/DESEngine;->generateWorkingKey(Z[B)[I
-HSPLcom/android/org/bouncycastle/crypto/generators/PKCS12ParametersGenerator;-><init>(Lcom/android/org/bouncycastle/crypto/Digest;)V
-HSPLcom/android/org/bouncycastle/crypto/generators/PKCS12ParametersGenerator;->adjust([BI[B)V
 HSPLcom/android/org/bouncycastle/crypto/generators/PKCS12ParametersGenerator;->generateDerivedKey(II)[B
-HSPLcom/android/org/bouncycastle/crypto/generators/PKCS5S2ParametersGenerator;-><init>(Lcom/android/org/bouncycastle/crypto/Digest;)V
-HSPLcom/android/org/bouncycastle/crypto/generators/PKCS5S2ParametersGenerator;->F([BI[B[BI)V
-HSPLcom/android/org/bouncycastle/crypto/generators/PKCS5S2ParametersGenerator;->generateDerivedKey(I)[B
-HSPLcom/android/org/bouncycastle/crypto/generators/PKCS5S2ParametersGenerator;->generateDerivedMacParameters(I)Lcom/android/org/bouncycastle/crypto/CipherParameters;
-HSPLcom/android/org/bouncycastle/crypto/generators/PKCS5S2ParametersGenerator;->generateDerivedParameters(I)Lcom/android/org/bouncycastle/crypto/CipherParameters;
 HSPLcom/android/org/bouncycastle/crypto/macs/HMac;-><clinit>()V
-HSPLcom/android/org/bouncycastle/crypto/macs/HMac;-><init>(Lcom/android/org/bouncycastle/crypto/Digest;)V
-HSPLcom/android/org/bouncycastle/crypto/macs/HMac;-><init>(Lcom/android/org/bouncycastle/crypto/Digest;I)V
-HSPLcom/android/org/bouncycastle/crypto/macs/HMac;->doFinal([BI)I
-HSPLcom/android/org/bouncycastle/crypto/macs/HMac;->getByteLength(Lcom/android/org/bouncycastle/crypto/Digest;)I
 HSPLcom/android/org/bouncycastle/crypto/macs/HMac;->getMacSize()I
 HSPLcom/android/org/bouncycastle/crypto/macs/HMac;->init(Lcom/android/org/bouncycastle/crypto/CipherParameters;)V
 HSPLcom/android/org/bouncycastle/crypto/macs/HMac;->update([BII)V
-HSPLcom/android/org/bouncycastle/crypto/macs/HMac;->xorPad([BIB)V
 HSPLcom/android/org/bouncycastle/crypto/modes/CBCBlockCipher;-><init>(Lcom/android/org/bouncycastle/crypto/BlockCipher;)V
 HSPLcom/android/org/bouncycastle/crypto/modes/CBCBlockCipher;->getBlockSize()I
 HSPLcom/android/org/bouncycastle/crypto/modes/CBCBlockCipher;->init(ZLcom/android/org/bouncycastle/crypto/CipherParameters;)V
 HSPLcom/android/org/bouncycastle/crypto/modes/CBCBlockCipher;->reset()V
-HSPLcom/android/org/bouncycastle/crypto/paddings/PKCS7Padding;-><init>()V
 HSPLcom/android/org/bouncycastle/crypto/paddings/PKCS7Padding;->init(Ljava/security/SecureRandom;)V
 HSPLcom/android/org/bouncycastle/crypto/paddings/PKCS7Padding;->padCount([B)I
-HSPLcom/android/org/bouncycastle/crypto/paddings/PaddedBufferedBlockCipher;-><init>(Lcom/android/org/bouncycastle/crypto/BlockCipher;)V
 HSPLcom/android/org/bouncycastle/crypto/paddings/PaddedBufferedBlockCipher;-><init>(Lcom/android/org/bouncycastle/crypto/BlockCipher;Lcom/android/org/bouncycastle/crypto/paddings/BlockCipherPadding;)V
 HSPLcom/android/org/bouncycastle/crypto/paddings/PaddedBufferedBlockCipher;->doFinal([BI)I
 HSPLcom/android/org/bouncycastle/crypto/paddings/PaddedBufferedBlockCipher;->getOutputSize(I)I
 HSPLcom/android/org/bouncycastle/crypto/paddings/PaddedBufferedBlockCipher;->getUpdateOutputSize(I)I
 HSPLcom/android/org/bouncycastle/crypto/paddings/PaddedBufferedBlockCipher;->init(ZLcom/android/org/bouncycastle/crypto/CipherParameters;)V
-HSPLcom/android/org/bouncycastle/crypto/paddings/PaddedBufferedBlockCipher;->processBytes([BII[BI)I
 HSPLcom/android/org/bouncycastle/crypto/params/AsymmetricKeyParameter;-><init>(Z)V
 HSPLcom/android/org/bouncycastle/crypto/params/DSAKeyParameters;-><init>(ZLcom/android/org/bouncycastle/crypto/params/DSAParameters;)V
 HSPLcom/android/org/bouncycastle/crypto/params/DSAParameters;-><init>(Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;)V
-HSPLcom/android/org/bouncycastle/crypto/params/DSAParameters;->getP()Ljava/math/BigInteger;
-HSPLcom/android/org/bouncycastle/crypto/params/DSAParameters;->getQ()Ljava/math/BigInteger;
 HSPLcom/android/org/bouncycastle/crypto/params/DSAPublicKeyParameters;-><init>(Ljava/math/BigInteger;Lcom/android/org/bouncycastle/crypto/params/DSAParameters;)V
-HSPLcom/android/org/bouncycastle/crypto/params/DSAPublicKeyParameters;->validate(Ljava/math/BigInteger;Lcom/android/org/bouncycastle/crypto/params/DSAParameters;)Ljava/math/BigInteger;
 HSPLcom/android/org/bouncycastle/crypto/params/KeyParameter;-><init>([B)V
-HSPLcom/android/org/bouncycastle/crypto/params/KeyParameter;-><init>([BII)V
-HSPLcom/android/org/bouncycastle/crypto/params/KeyParameter;->getKey()[B
 HSPLcom/android/org/bouncycastle/crypto/params/ParametersWithIV;-><init>(Lcom/android/org/bouncycastle/crypto/CipherParameters;[BII)V
-HSPLcom/android/org/bouncycastle/crypto/params/ParametersWithIV;->getIV()[B
-HSPLcom/android/org/bouncycastle/crypto/params/ParametersWithIV;->getParameters()Lcom/android/org/bouncycastle/crypto/CipherParameters;
 HSPLcom/android/org/bouncycastle/jcajce/provider/asymmetric/dsa/BCDSAPublicKey;->getParams()Ljava/security/interfaces/DSAParams;
 HSPLcom/android/org/bouncycastle/jcajce/provider/asymmetric/dsa/BCDSAPublicKey;->getY()Ljava/math/BigInteger;
 HSPLcom/android/org/bouncycastle/jcajce/provider/asymmetric/dsa/BCDSAPublicKey;->hashCode()I
@@ -982,16 +913,12 @@
 HSPLcom/android/org/bouncycastle/jcajce/provider/asymmetric/dsa/DSAUtil;->toDSAParameters(Ljava/security/interfaces/DSAParams;)Lcom/android/org/bouncycastle/crypto/params/DSAParameters;
 HSPLcom/android/org/bouncycastle/jcajce/provider/keystore/bc/BcKeyStoreSpi$Std;-><init>()V
 HSPLcom/android/org/bouncycastle/jcajce/provider/keystore/bc/BcKeyStoreSpi$StoreEntry;-><init>(Lcom/android/org/bouncycastle/jcajce/provider/keystore/bc/BcKeyStoreSpi;Ljava/lang/String;Ljava/security/cert/Certificate;)V
-HSPLcom/android/org/bouncycastle/jcajce/provider/keystore/bc/BcKeyStoreSpi$StoreEntry;->getObject()Ljava/lang/Object;
-HSPLcom/android/org/bouncycastle/jcajce/provider/keystore/bc/BcKeyStoreSpi$StoreEntry;->getType()I
 HSPLcom/android/org/bouncycastle/jcajce/provider/keystore/bc/BcKeyStoreSpi;-><init>(I)V
 HSPLcom/android/org/bouncycastle/jcajce/provider/keystore/bc/BcKeyStoreSpi;->engineAliases()Ljava/util/Enumeration;
 HSPLcom/android/org/bouncycastle/jcajce/provider/keystore/bc/BcKeyStoreSpi;->engineGetCertificate(Ljava/lang/String;)Ljava/security/cert/Certificate;
 HSPLcom/android/org/bouncycastle/jcajce/provider/keystore/bc/BcKeyStoreSpi;->engineLoad(Ljava/io/InputStream;[C)V
 HSPLcom/android/org/bouncycastle/jcajce/provider/keystore/bc/BcKeyStoreSpi;->engineSetCertificateEntry(Ljava/lang/String;Ljava/security/cert/Certificate;)V
 HSPLcom/android/org/bouncycastle/jcajce/provider/keystore/bc/BcKeyStoreSpi;->engineSize()I
-HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/AES$ECB$1;-><init>()V
-HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/AES$ECB$1;->get()Lcom/android/org/bouncycastle/crypto/BlockCipher;
 HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/AES$ECB;-><init>()V
 HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BCPBEKey;-><init>(Ljava/lang/String;Lcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier;IIIILjavax/crypto/spec/PBEKeySpec;Lcom/android/org/bouncycastle/crypto/CipherParameters;)V
 HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BCPBEKey;->getEncoded()[B
@@ -1000,21 +927,14 @@
 HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BaseBlockCipher$BufferedGenericBlockCipher;->doFinal([BI)I
 HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BaseBlockCipher$BufferedGenericBlockCipher;->getOutputSize(I)I
 HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BaseBlockCipher$BufferedGenericBlockCipher;->init(ZLcom/android/org/bouncycastle/crypto/CipherParameters;)V
-HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BaseBlockCipher$BufferedGenericBlockCipher;->processBytes([BII[BI)I
-HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BaseBlockCipher;-><init>(Lcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BlockCipherProvider;)V
 HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BaseBlockCipher;->engineDoFinal([BII)[B
 HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BaseBlockCipher;->engineGetOutputSize(I)I
 HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BaseBlockCipher;->engineInit(ILjava/security/Key;Ljava/security/spec/AlgorithmParameterSpec;Ljava/security/SecureRandom;)V
-HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BaseSecretKeyFactory;-><init>(Ljava/lang/String;Lcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier;)V
 HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BaseWrapCipher;-><init>()V
 HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/util/PBE$Util;->convertPassword(ILjavax/crypto/spec/PBEKeySpec;)[B
 HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/util/PBE$Util;->makePBEGenerator(II)Lcom/android/org/bouncycastle/crypto/PBEParametersGenerator;
 HSPLcom/android/org/bouncycastle/jcajce/provider/symmetric/util/PBE$Util;->makePBEMacParameters(Ljavax/crypto/spec/PBEKeySpec;III)Lcom/android/org/bouncycastle/crypto/CipherParameters;
 HSPLcom/android/org/bouncycastle/jcajce/util/BCJcaJceHelper;-><init>()V
-HSPLcom/android/org/bouncycastle/jcajce/util/BCJcaJceHelper;->getBouncyCastleProvider()Ljava/security/Provider;
-HSPLcom/android/org/bouncycastle/jcajce/util/DefaultJcaJceHelper;-><init>()V
-HSPLcom/android/org/bouncycastle/jcajce/util/DefaultJcaJceHelper;->createCertificateFactory(Ljava/lang/String;)Ljava/security/cert/CertificateFactory;
-HSPLcom/android/org/bouncycastle/jcajce/util/ProviderJcaJceHelper;-><init>(Ljava/security/Provider;)V
 HSPLcom/android/org/bouncycastle/jce/provider/CertStoreCollectionSpi;-><init>(Ljava/security/cert/CertStoreParameters;)V
 HSPLcom/android/org/bouncycastle/util/Arrays;->areEqual([B[B)Z
 HSPLcom/android/org/bouncycastle/util/Arrays;->clone([B)[B
@@ -1023,18 +943,12 @@
 HSPLcom/android/org/bouncycastle/util/Arrays;->hashCode([B)I
 HSPLcom/android/org/bouncycastle/util/BigIntegers;-><clinit>()V
 HSPLcom/android/org/bouncycastle/util/Integers;->valueOf(I)Ljava/lang/Integer;
-HSPLcom/android/org/bouncycastle/util/Pack;->intToBigEndian(I[BI)V
 HSPLcom/android/org/bouncycastle/util/Pack;->littleEndianToInt([BI)I
-HSPLcom/android/org/bouncycastle/util/Properties$1;-><init>(Ljava/lang/String;)V
 HSPLcom/android/org/bouncycastle/util/Properties$1;->run()Ljava/lang/Object;
 HSPLcom/android/org/bouncycastle/util/Properties;->isOverrideSet(Ljava/lang/String;)Z
-HSPLcom/android/org/bouncycastle/util/Strings;->toUTF8ByteArray([C)[B
-HSPLcom/android/org/bouncycastle/util/Strings;->toUTF8ByteArray([CLjava/io/OutputStream;)V
 HSPLcom/android/org/bouncycastle/util/Strings;->toUpperCase(Ljava/lang/String;)Ljava/lang/String;
-HSPLcom/android/org/bouncycastle/util/io/Streams;->readFully(Ljava/io/InputStream;[B)I
-HSPLcom/android/org/bouncycastle/util/io/Streams;->readFully(Ljava/io/InputStream;[BII)I
 HSPLcom/android/org/kxml2/io/KXmlParser;-><init>()V
-HSPLcom/android/org/kxml2/io/KXmlParser;->adjustNsp()Z+]Lcom/android/org/kxml2/io/KXmlParser;Lcom/android/org/kxml2/io/KXmlParser;]Ljava/lang/String;Ljava/lang/String;
+HSPLcom/android/org/kxml2/io/KXmlParser;->adjustNsp()Z+]Ljava/lang/String;Ljava/lang/String;]Lcom/android/org/kxml2/io/KXmlParser;Lcom/android/org/kxml2/io/KXmlParser;
 HSPLcom/android/org/kxml2/io/KXmlParser;->close()V
 HSPLcom/android/org/kxml2/io/KXmlParser;->ensureCapacity([Ljava/lang/String;I)[Ljava/lang/String;
 HSPLcom/android/org/kxml2/io/KXmlParser;->fillBuffer(I)Z+]Ljava/io/Reader;Ljava/io/InputStreamReader;
@@ -1063,7 +977,7 @@
 HSPLcom/android/org/kxml2/io/KXmlParser;->read([C)V
 HSPLcom/android/org/kxml2/io/KXmlParser;->readComment(Z)Ljava/lang/String;
 HSPLcom/android/org/kxml2/io/KXmlParser;->readEndTag()V
-HSPLcom/android/org/kxml2/io/KXmlParser;->readEntity(Ljava/lang/StringBuilder;ZZLcom/android/org/kxml2/io/KXmlParser$ValueContext;)V+]Ljava/lang/String;Ljava/lang/String;]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/util/Map;Ljava/util/HashMap;
+HSPLcom/android/org/kxml2/io/KXmlParser;->readEntity(Ljava/lang/StringBuilder;ZZLcom/android/org/kxml2/io/KXmlParser$ValueContext;)V
 HSPLcom/android/org/kxml2/io/KXmlParser;->readName()Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Llibcore/internal/StringPool;Llibcore/internal/StringPool;
 HSPLcom/android/org/kxml2/io/KXmlParser;->readUntil([CZ)Ljava/lang/String;
 HSPLcom/android/org/kxml2/io/KXmlParser;->readValue(CZZLcom/android/org/kxml2/io/KXmlParser$ValueContext;)Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Llibcore/internal/StringPool;Llibcore/internal/StringPool;
@@ -1093,7 +1007,7 @@
 HSPLdalvik/system/BaseDexClassLoader;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/ClassLoader;[Ljava/lang/ClassLoader;[Ljava/lang/ClassLoader;)V
 HSPLdalvik/system/BaseDexClassLoader;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/ClassLoader;[Ljava/lang/ClassLoader;[Ljava/lang/ClassLoader;Z)V
 HSPLdalvik/system/BaseDexClassLoader;->addNativePath(Ljava/util/Collection;)V
-HSPLdalvik/system/BaseDexClassLoader;->findClass(Ljava/lang/String;)Ljava/lang/Class;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ldalvik/system/DexPathList;Ldalvik/system/DexPathList;]Ljava/util/List;Ljava/util/ArrayList;]Ljava/lang/ClassLoader;Ldalvik/system/PathClassLoader;]Ljava/util/Iterator;Ljava/util/ArrayList$Itr;]Ljava/lang/ClassNotFoundException;Ljava/lang/ClassNotFoundException;
+HSPLdalvik/system/BaseDexClassLoader;->findClass(Ljava/lang/String;)Ljava/lang/Class;
 HSPLdalvik/system/BaseDexClassLoader;->findLibrary(Ljava/lang/String;)Ljava/lang/String;
 HSPLdalvik/system/BaseDexClassLoader;->findResource(Ljava/lang/String;)Ljava/net/URL;
 HSPLdalvik/system/BaseDexClassLoader;->findResources(Ljava/lang/String;)Ljava/util/Enumeration;
@@ -1110,16 +1024,16 @@
 HSPLdalvik/system/BlockGuard$2;->onPathAccess(Ljava/lang/String;)V
 HSPLdalvik/system/BlockGuard$3;->initialValue()Ldalvik/system/BlockGuard$Policy;
 HSPLdalvik/system/BlockGuard$3;->initialValue()Ljava/lang/Object;
-HSPLdalvik/system/BlockGuard;->getThreadPolicy()Ldalvik/system/BlockGuard$Policy;+]Ljava/lang/ThreadLocal;Ldalvik/system/BlockGuard$3;
+HSPLdalvik/system/BlockGuard;->getThreadPolicy()Ldalvik/system/BlockGuard$Policy;
 HSPLdalvik/system/BlockGuard;->getVmPolicy()Ldalvik/system/BlockGuard$VmPolicy;
-HSPLdalvik/system/BlockGuard;->setThreadPolicy(Ldalvik/system/BlockGuard$Policy;)V+]Ljava/lang/ThreadLocal;Ldalvik/system/BlockGuard$3;
+HSPLdalvik/system/BlockGuard;->setThreadPolicy(Ldalvik/system/BlockGuard$Policy;)V
 HSPLdalvik/system/BlockGuard;->setVmPolicy(Ldalvik/system/BlockGuard$VmPolicy;)V
 HSPLdalvik/system/CloseGuard;-><init>()V
 HSPLdalvik/system/CloseGuard;->close()V
 HSPLdalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard;
 HSPLdalvik/system/CloseGuard;->getReporter()Ldalvik/system/CloseGuard$Reporter;
-HSPLdalvik/system/CloseGuard;->open(Ljava/lang/String;)V+]Ldalvik/system/CloseGuard;Ldalvik/system/CloseGuard;
-HSPLdalvik/system/CloseGuard;->openWithCallSite(Ljava/lang/String;Ljava/lang/String;)V+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
+HSPLdalvik/system/CloseGuard;->open(Ljava/lang/String;)V
+HSPLdalvik/system/CloseGuard;->openWithCallSite(Ljava/lang/String;Ljava/lang/String;)V
 HSPLdalvik/system/CloseGuard;->setEnabled(Z)V
 HSPLdalvik/system/CloseGuard;->setReporter(Ldalvik/system/CloseGuard$Reporter;)V
 HSPLdalvik/system/CloseGuard;->warnIfOpen()V
@@ -1141,7 +1055,7 @@
 HSPLdalvik/system/DexPathList$Element;->findClass(Ljava/lang/String;Ljava/lang/ClassLoader;Ljava/util/List;)Ljava/lang/Class;
 HSPLdalvik/system/DexPathList$Element;->findResource(Ljava/lang/String;)Ljava/net/URL;
 HSPLdalvik/system/DexPathList$Element;->maybeInit()V
-HSPLdalvik/system/DexPathList$Element;->toString()Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/lang/Boolean;Ljava/lang/Boolean;
+HSPLdalvik/system/DexPathList$Element;->toString()Ljava/lang/String;
 HSPLdalvik/system/DexPathList$NativeLibraryElement;-><init>(Ljava/io/File;)V
 HSPLdalvik/system/DexPathList$NativeLibraryElement;-><init>(Ljava/io/File;Ljava/lang/String;)V
 HSPLdalvik/system/DexPathList$NativeLibraryElement;->equals(Ljava/lang/Object;)Z
@@ -1180,7 +1094,7 @@
 HSPLdalvik/system/VMRuntime;->getSdkVersion()I
 HSPLdalvik/system/VMRuntime;->getTargetSdkVersion()I
 HSPLdalvik/system/VMRuntime;->hiddenApiUsed(ILjava/lang/String;Ljava/lang/String;IZ)V
-HSPLdalvik/system/VMRuntime;->notifyNativeAllocation()V+]Ldalvik/system/VMRuntime;Ldalvik/system/VMRuntime;]Ljava/util/concurrent/atomic/AtomicInteger;Ljava/util/concurrent/atomic/AtomicInteger;
+HSPLdalvik/system/VMRuntime;->notifyNativeAllocation()V
 HSPLdalvik/system/VMRuntime;->registerNativeAllocation(I)V
 HSPLdalvik/system/VMRuntime;->registerNativeFree(I)V
 HSPLdalvik/system/VMRuntime;->runFinalization(J)V
@@ -1192,6 +1106,7 @@
 HSPLdalvik/system/ZipPathValidator$Callback;->onZipEntryAccess(Ljava/lang/String;)V
 HSPLdalvik/system/ZipPathValidator;->clearCallback()V
 HSPLdalvik/system/ZipPathValidator;->getInstance()Ldalvik/system/ZipPathValidator$Callback;
+HSPLdalvik/system/ZipPathValidator;->isClear()Z
 HSPLdalvik/system/ZipPathValidator;->setCallback(Ldalvik/system/ZipPathValidator$Callback;)V
 HSPLdalvik/system/ZygoteHooks;->cleanLocaleCaches()V
 HSPLdalvik/system/ZygoteHooks;->gcAndFinalize()V
@@ -1200,7 +1115,6 @@
 HSPLdalvik/system/ZygoteHooks;->postForkChild(IZZLjava/lang/String;)V
 HSPLdalvik/system/ZygoteHooks;->postForkCommon()V
 HSPLdalvik/system/ZygoteHooks;->preFork()V
-HSPLdalvik/system/ZygoteHooks;->waitUntilAllThreadsStopped()V
 HSPLjava/io/Bits;->getBoolean([BI)Z
 HSPLjava/io/Bits;->getDouble([BI)D
 HSPLjava/io/Bits;->getFloat([BI)F
@@ -1229,8 +1143,8 @@
 HSPLjava/io/BufferedInputStream;->skip(J)J
 HSPLjava/io/BufferedOutputStream;-><init>(Ljava/io/OutputStream;)V
 HSPLjava/io/BufferedOutputStream;-><init>(Ljava/io/OutputStream;I)V
-HSPLjava/io/BufferedOutputStream;->flush()V+]Ljava/io/OutputStream;Ljava/io/FileOutputStream;
-HSPLjava/io/BufferedOutputStream;->flushBuffer()V+]Ljava/io/OutputStream;Ljava/io/FileOutputStream;
+HSPLjava/io/BufferedOutputStream;->flush()V
+HSPLjava/io/BufferedOutputStream;->flushBuffer()V
 HSPLjava/io/BufferedOutputStream;->write(I)V
 HSPLjava/io/BufferedOutputStream;->write([BII)V
 HSPLjava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
@@ -1242,7 +1156,7 @@
 HSPLjava/io/BufferedReader;->read([CII)I
 HSPLjava/io/BufferedReader;->read1([CII)I
 HSPLjava/io/BufferedReader;->readLine()Ljava/lang/String;
-HSPLjava/io/BufferedReader;->readLine(Z)Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
+HSPLjava/io/BufferedReader;->readLine(Z)Ljava/lang/String;
 HSPLjava/io/BufferedWriter;-><init>(Ljava/io/Writer;)V
 HSPLjava/io/BufferedWriter;-><init>(Ljava/io/Writer;I)V
 HSPLjava/io/BufferedWriter;->close()V
@@ -1253,7 +1167,7 @@
 HSPLjava/io/BufferedWriter;->newLine()V
 HSPLjava/io/BufferedWriter;->write(I)V
 HSPLjava/io/BufferedWriter;->write(Ljava/lang/String;II)V
-HSPLjava/io/BufferedWriter;->write([CII)V+]Ljava/io/BufferedWriter;Ljava/io/BufferedWriter;
+HSPLjava/io/BufferedWriter;->write([CII)V
 HSPLjava/io/ByteArrayInputStream;-><init>([B)V
 HSPLjava/io/ByteArrayInputStream;-><init>([BII)V
 HSPLjava/io/ByteArrayInputStream;->available()I
@@ -1291,8 +1205,8 @@
 HSPLjava/io/DataInputStream;->readBoolean()Z
 HSPLjava/io/DataInputStream;->readByte()B
 HSPLjava/io/DataInputStream;->readFully([B)V
-HSPLjava/io/DataInputStream;->readFully([BII)V+]Ljava/io/InputStream;Ljava/io/BufferedInputStream;,Ljava/io/ByteArrayInputStream;,Ljava/io/ObjectInputStream$BlockDataInputStream;
-HSPLjava/io/DataInputStream;->readInt()I+]Ljava/io/DataInputStream;Ljava/io/DataInputStream;
+HSPLjava/io/DataInputStream;->readFully([BII)V
+HSPLjava/io/DataInputStream;->readInt()I
 HSPLjava/io/DataInputStream;->readLong()J
 HSPLjava/io/DataInputStream;->readShort()S
 HSPLjava/io/DataInputStream;->readUTF()Ljava/lang/String;
@@ -1304,46 +1218,46 @@
 HSPLjava/io/DataOutputStream;->flush()V
 HSPLjava/io/DataOutputStream;->incCount(I)V
 HSPLjava/io/DataOutputStream;->write(I)V
-HSPLjava/io/DataOutputStream;->write([BII)V+]Ljava/io/OutputStream;missing_types
+HSPLjava/io/DataOutputStream;->write([BII)V
 HSPLjava/io/DataOutputStream;->writeBoolean(Z)V
 HSPLjava/io/DataOutputStream;->writeByte(I)V
-HSPLjava/io/DataOutputStream;->writeInt(I)V+]Ljava/io/OutputStream;missing_types
+HSPLjava/io/DataOutputStream;->writeInt(I)V
 HSPLjava/io/DataOutputStream;->writeLong(J)V
 HSPLjava/io/DataOutputStream;->writeShort(I)V
 HSPLjava/io/DataOutputStream;->writeUTF(Ljava/lang/String;)V
-HSPLjava/io/DataOutputStream;->writeUTF(Ljava/lang/String;Ljava/io/DataOutput;)I+]Ljava/io/DataOutput;Ljava/io/DataOutputStream;
+HSPLjava/io/DataOutputStream;->writeUTF(Ljava/lang/String;Ljava/io/DataOutput;)I
 HSPLjava/io/EOFException;-><init>()V
 HSPLjava/io/EOFException;-><init>(Ljava/lang/String;)V
 HSPLjava/io/ExpiringCache;->clear()V
 HSPLjava/io/File$TempDirectory;->generateFile(Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)Ljava/io/File;
-HSPLjava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V+]Ljava/io/FileSystem;Ljava/io/UnixFileSystem;
-HSPLjava/io/File;-><init>(Ljava/lang/String;)V+]Ljava/io/FileSystem;Ljava/io/UnixFileSystem;
+HSPLjava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
+HSPLjava/io/File;-><init>(Ljava/lang/String;)V
 HSPLjava/io/File;-><init>(Ljava/lang/String;I)V
 HSPLjava/io/File;-><init>(Ljava/lang/String;Ljava/io/File;)V
 HSPLjava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
 HSPLjava/io/File;->canExecute()Z
 HSPLjava/io/File;->canRead()Z
 HSPLjava/io/File;->canWrite()Z
-HSPLjava/io/File;->compareTo(Ljava/io/File;)I+]Ljava/io/FileSystem;Ljava/io/UnixFileSystem;
+HSPLjava/io/File;->compareTo(Ljava/io/File;)I
 HSPLjava/io/File;->compareTo(Ljava/lang/Object;)I
 HSPLjava/io/File;->createNewFile()Z
 HSPLjava/io/File;->createTempFile(Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)Ljava/io/File;
 HSPLjava/io/File;->delete()Z
 HSPLjava/io/File;->equals(Ljava/lang/Object;)Z
-HSPLjava/io/File;->exists()Z+]Ljava/io/File;Ljava/io/File;]Ljava/io/FileSystem;Ljava/io/UnixFileSystem;
+HSPLjava/io/File;->exists()Z
 HSPLjava/io/File;->getAbsoluteFile()Ljava/io/File;
 HSPLjava/io/File;->getAbsolutePath()Ljava/lang/String;
 HSPLjava/io/File;->getCanonicalFile()Ljava/io/File;
 HSPLjava/io/File;->getCanonicalPath()Ljava/lang/String;
 HSPLjava/io/File;->getFreeSpace()J
-HSPLjava/io/File;->getName()Ljava/lang/String;+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/io/File;->getName()Ljava/lang/String;
 HSPLjava/io/File;->getParent()Ljava/lang/String;
 HSPLjava/io/File;->getParentFile()Ljava/io/File;
 HSPLjava/io/File;->getPath()Ljava/lang/String;
 HSPLjava/io/File;->getPrefixLength()I
 HSPLjava/io/File;->getTotalSpace()J
 HSPLjava/io/File;->getUsableSpace()J
-HSPLjava/io/File;->hashCode()I+]Ljava/io/FileSystem;Ljava/io/UnixFileSystem;
+HSPLjava/io/File;->hashCode()I
 HSPLjava/io/File;->isAbsolute()Z
 HSPLjava/io/File;->isDirectory()Z
 HSPLjava/io/File;->isFile()Z
@@ -1379,7 +1293,7 @@
 HSPLjava/io/FileDescriptor;->setInt$(I)V
 HSPLjava/io/FileDescriptor;->setOwnerId$(J)V
 HSPLjava/io/FileDescriptor;->valid()Z
-HSPLjava/io/FileInputStream;-><init>(Ljava/io/File;)V+]Ljava/io/File;Ljava/io/File;]Ldalvik/system/CloseGuard;Ldalvik/system/CloseGuard;
+HSPLjava/io/FileInputStream;-><init>(Ljava/io/File;)V
 HSPLjava/io/FileInputStream;-><init>(Ljava/io/FileDescriptor;)V
 HSPLjava/io/FileInputStream;-><init>(Ljava/io/FileDescriptor;Z)V
 HSPLjava/io/FileInputStream;-><init>(Ljava/lang/String;)V
@@ -1389,8 +1303,8 @@
 HSPLjava/io/FileInputStream;->getChannel()Ljava/nio/channels/FileChannel;
 HSPLjava/io/FileInputStream;->getFD()Ljava/io/FileDescriptor;
 HSPLjava/io/FileInputStream;->read()I
-HSPLjava/io/FileInputStream;->read([B)I+]Ljava/io/FileInputStream;Ljava/io/FileInputStream;
-HSPLjava/io/FileInputStream;->read([BII)I+]Llibcore/io/IoTracker;Llibcore/io/IoTracker;
+HSPLjava/io/FileInputStream;->read([B)I
+HSPLjava/io/FileInputStream;->read([BII)I
 HSPLjava/io/FileInputStream;->skip(J)J
 HSPLjava/io/FileNotFoundException;-><init>(Ljava/lang/String;)V
 HSPLjava/io/FileOutputStream;-><init>(Ljava/io/File;)V
@@ -1405,7 +1319,7 @@
 HSPLjava/io/FileOutputStream;->getFD()Ljava/io/FileDescriptor;
 HSPLjava/io/FileOutputStream;->write(I)V
 HSPLjava/io/FileOutputStream;->write([B)V
-HSPLjava/io/FileOutputStream;->write([BII)V+]Llibcore/io/IoTracker;Llibcore/io/IoTracker;
+HSPLjava/io/FileOutputStream;->write([BII)V
 HSPLjava/io/FileReader;-><init>(Ljava/io/File;)V
 HSPLjava/io/FileReader;-><init>(Ljava/lang/String;)V
 HSPLjava/io/FileWriter;-><init>(Ljava/io/File;)V
@@ -1415,9 +1329,9 @@
 HSPLjava/io/FilterInputStream;->close()V
 HSPLjava/io/FilterInputStream;->mark(I)V
 HSPLjava/io/FilterInputStream;->markSupported()Z
-HSPLjava/io/FilterInputStream;->read()I+]Ljava/io/InputStream;Ljava/io/BufferedInputStream;,Ljava/io/PushbackInputStream;,Ljava/io/ByteArrayInputStream;,Ljava/io/FileInputStream;
+HSPLjava/io/FilterInputStream;->read()I
 HSPLjava/io/FilterInputStream;->read([B)I
-HSPLjava/io/FilterInputStream;->read([BII)I+]Ljava/io/InputStream;missing_types
+HSPLjava/io/FilterInputStream;->read([BII)I
 HSPLjava/io/FilterInputStream;->reset()V
 HSPLjava/io/FilterInputStream;->skip(J)J
 HSPLjava/io/FilterOutputStream;-><init>(Ljava/io/OutputStream;)V
@@ -1450,25 +1364,25 @@
 HSPLjava/io/ObjectInputStream$BlockDataInputStream;->close()V
 HSPLjava/io/ObjectInputStream$BlockDataInputStream;->currentBlockRemaining()I
 HSPLjava/io/ObjectInputStream$BlockDataInputStream;->getBlockDataMode()Z
-HSPLjava/io/ObjectInputStream$BlockDataInputStream;->peek()I+]Ljava/io/ObjectInputStream$PeekInputStream;Ljava/io/ObjectInputStream$PeekInputStream;
-HSPLjava/io/ObjectInputStream$BlockDataInputStream;->peekByte()B+]Ljava/io/ObjectInputStream$BlockDataInputStream;Ljava/io/ObjectInputStream$BlockDataInputStream;
-HSPLjava/io/ObjectInputStream$BlockDataInputStream;->read()I+]Ljava/io/ObjectInputStream$PeekInputStream;Ljava/io/ObjectInputStream$PeekInputStream;
+HSPLjava/io/ObjectInputStream$BlockDataInputStream;->peek()I
+HSPLjava/io/ObjectInputStream$BlockDataInputStream;->peekByte()B
+HSPLjava/io/ObjectInputStream$BlockDataInputStream;->read()I
 HSPLjava/io/ObjectInputStream$BlockDataInputStream;->read([BII)I
 HSPLjava/io/ObjectInputStream$BlockDataInputStream;->read([BIIZ)I
 HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readBlockHeader(Z)I
 HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readBoolean()Z
-HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readByte()B+]Ljava/io/ObjectInputStream$BlockDataInputStream;Ljava/io/ObjectInputStream$BlockDataInputStream;
+HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readByte()B
 HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readFloat()F
 HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readFully([BIIZ)V
-HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readInt()I+]Ljava/io/ObjectInputStream$PeekInputStream;Ljava/io/ObjectInputStream$PeekInputStream;]Ljava/io/DataInputStream;Ljava/io/DataInputStream;
-HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readLong()J+]Ljava/io/ObjectInputStream$PeekInputStream;Ljava/io/ObjectInputStream$PeekInputStream;
-HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readShort()S+]Ljava/io/ObjectInputStream$PeekInputStream;Ljava/io/ObjectInputStream$PeekInputStream;
-HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readUTF()Ljava/lang/String;+]Ljava/io/ObjectInputStream$BlockDataInputStream;Ljava/io/ObjectInputStream$BlockDataInputStream;
-HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readUTFBody(J)Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/io/ObjectInputStream$PeekInputStream;Ljava/io/ObjectInputStream$PeekInputStream;
+HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readInt()I
+HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readLong()J
+HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readShort()S
+HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readUTF()Ljava/lang/String;
+HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readUTFBody(J)Ljava/lang/String;
 HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readUTFChar(Ljava/lang/StringBuilder;J)I
-HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readUTFSpan(Ljava/lang/StringBuilder;J)J+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
-HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readUnsignedShort()I+]Ljava/io/ObjectInputStream$PeekInputStream;Ljava/io/ObjectInputStream$PeekInputStream;
-HSPLjava/io/ObjectInputStream$BlockDataInputStream;->refill()V+]Ljava/io/ObjectInputStream$PeekInputStream;Ljava/io/ObjectInputStream$PeekInputStream;
+HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readUTFSpan(Ljava/lang/StringBuilder;J)J
+HSPLjava/io/ObjectInputStream$BlockDataInputStream;->readUnsignedShort()I
+HSPLjava/io/ObjectInputStream$BlockDataInputStream;->refill()V
 HSPLjava/io/ObjectInputStream$BlockDataInputStream;->setBlockDataMode(Z)Z
 HSPLjava/io/ObjectInputStream$BlockDataInputStream;->skipBlockData()V
 HSPLjava/io/ObjectInputStream$GetField;-><init>()V
@@ -1489,23 +1403,23 @@
 HSPLjava/io/ObjectInputStream$HandleTable;->grow()V
 HSPLjava/io/ObjectInputStream$HandleTable;->lookupException(I)Ljava/lang/ClassNotFoundException;
 HSPLjava/io/ObjectInputStream$HandleTable;->lookupObject(I)Ljava/lang/Object;
-HSPLjava/io/ObjectInputStream$HandleTable;->markDependency(II)V+]Ljava/io/ObjectInputStream$HandleTable$HandleList;Ljava/io/ObjectInputStream$HandleTable$HandleList;
+HSPLjava/io/ObjectInputStream$HandleTable;->markDependency(II)V
 HSPLjava/io/ObjectInputStream$HandleTable;->setObject(ILjava/lang/Object;)V
 HSPLjava/io/ObjectInputStream$HandleTable;->size()I
 HSPLjava/io/ObjectInputStream$PeekInputStream;-><init>(Ljava/io/InputStream;)V
-HSPLjava/io/ObjectInputStream$PeekInputStream;->close()V+]Ljava/io/InputStream;Ljava/io/ByteArrayInputStream;
-HSPLjava/io/ObjectInputStream$PeekInputStream;->peek()I+]Ljava/io/InputStream;missing_types
-HSPLjava/io/ObjectInputStream$PeekInputStream;->read()I+]Ljava/io/InputStream;Ljava/io/ByteArrayInputStream;
-HSPLjava/io/ObjectInputStream$PeekInputStream;->read([BII)I+]Ljava/io/InputStream;missing_types
-HSPLjava/io/ObjectInputStream$PeekInputStream;->readFully([BII)V+]Ljava/io/ObjectInputStream$PeekInputStream;Ljava/io/ObjectInputStream$PeekInputStream;
+HSPLjava/io/ObjectInputStream$PeekInputStream;->close()V
+HSPLjava/io/ObjectInputStream$PeekInputStream;->peek()I
+HSPLjava/io/ObjectInputStream$PeekInputStream;->read()I
+HSPLjava/io/ObjectInputStream$PeekInputStream;->read([BII)I
+HSPLjava/io/ObjectInputStream$PeekInputStream;->readFully([BII)V
 HSPLjava/io/ObjectInputStream$ValidationList;-><init>()V
 HSPLjava/io/ObjectInputStream$ValidationList;->clear()V
 HSPLjava/io/ObjectInputStream$ValidationList;->doCallbacks()V
-HSPLjava/io/ObjectInputStream;-><init>(Ljava/io/InputStream;)V+]Ljava/io/ObjectInputStream;Ljava/io/ObjectInputStream;]Ljava/io/ObjectInputStream$BlockDataInputStream;Ljava/io/ObjectInputStream$BlockDataInputStream;
+HSPLjava/io/ObjectInputStream;-><init>(Ljava/io/InputStream;)V
 HSPLjava/io/ObjectInputStream;->checkResolve(Ljava/lang/Object;)Ljava/lang/Object;
-HSPLjava/io/ObjectInputStream;->clear()V+]Ljava/io/ObjectInputStream$ValidationList;Ljava/io/ObjectInputStream$ValidationList;]Ljava/io/ObjectInputStream$HandleTable;Ljava/io/ObjectInputStream$HandleTable;
-HSPLjava/io/ObjectInputStream;->close()V+]Ljava/io/ObjectInputStream$BlockDataInputStream;Ljava/io/ObjectInputStream$BlockDataInputStream;
-HSPLjava/io/ObjectInputStream;->defaultReadFields(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V+]Ljava/io/ObjectInputStream$BlockDataInputStream;Ljava/io/ObjectInputStream$BlockDataInputStream;]Ljava/io/ObjectStreamClass;Ljava/io/ObjectStreamClass;]Ljava/io/ObjectStreamField;Ljava/io/ObjectStreamField;]Ljava/io/ObjectInputStream$HandleTable;Ljava/io/ObjectInputStream$HandleTable;]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/io/ObjectInputStream;->clear()V
+HSPLjava/io/ObjectInputStream;->close()V
+HSPLjava/io/ObjectInputStream;->defaultReadFields(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V
 HSPLjava/io/ObjectInputStream;->defaultReadObject()V
 HSPLjava/io/ObjectInputStream;->isCustomSubclass()Z
 HSPLjava/io/ObjectInputStream;->latestUserDefinedLoader()Ljava/lang/ClassLoader;
@@ -1517,34 +1431,34 @@
 HSPLjava/io/ObjectInputStream;->readEnum(Z)Ljava/lang/Enum;
 HSPLjava/io/ObjectInputStream;->readFields()Ljava/io/ObjectInputStream$GetField;
 HSPLjava/io/ObjectInputStream;->readFloat()F
-HSPLjava/io/ObjectInputStream;->readHandle(Z)Ljava/lang/Object;+]Ljava/io/ObjectInputStream$BlockDataInputStream;Ljava/io/ObjectInputStream$BlockDataInputStream;]Ljava/io/ObjectInputStream$HandleTable;Ljava/io/ObjectInputStream$HandleTable;
-HSPLjava/io/ObjectInputStream;->readInt()I+]Ljava/io/ObjectInputStream$BlockDataInputStream;Ljava/io/ObjectInputStream$BlockDataInputStream;
+HSPLjava/io/ObjectInputStream;->readHandle(Z)Ljava/lang/Object;
+HSPLjava/io/ObjectInputStream;->readInt()I
 HSPLjava/io/ObjectInputStream;->readLong()J
-HSPLjava/io/ObjectInputStream;->readNonProxyDesc(Z)Ljava/io/ObjectStreamClass;+]Ljava/io/ObjectInputStream;Ljava/io/ObjectInputStream;,Landroid/os/Parcel$2;]Ljava/io/ObjectInputStream$BlockDataInputStream;Ljava/io/ObjectInputStream$BlockDataInputStream;]Ljava/io/ObjectStreamClass;Ljava/io/ObjectStreamClass;]Ljava/io/ObjectInputStream$HandleTable;Ljava/io/ObjectInputStream$HandleTable;
+HSPLjava/io/ObjectInputStream;->readNonProxyDesc(Z)Ljava/io/ObjectStreamClass;
 HSPLjava/io/ObjectInputStream;->readNull()Ljava/lang/Object;
 HSPLjava/io/ObjectInputStream;->readObject()Ljava/lang/Object;
-HSPLjava/io/ObjectInputStream;->readObject0(Z)Ljava/lang/Object;+]Ljava/io/ObjectInputStream$BlockDataInputStream;Ljava/io/ObjectInputStream$BlockDataInputStream;
-HSPLjava/io/ObjectInputStream;->readOrdinaryObject(Z)Ljava/lang/Object;+]Ljava/io/ObjectInputStream$BlockDataInputStream;Ljava/io/ObjectInputStream$BlockDataInputStream;]Ljava/io/ObjectStreamClass;Ljava/io/ObjectStreamClass;]Ljava/io/ObjectInputStream$HandleTable;Ljava/io/ObjectInputStream$HandleTable;
-HSPLjava/io/ObjectInputStream;->readSerialData(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V+]Ljava/io/ObjectInputStream$BlockDataInputStream;Ljava/io/ObjectInputStream$BlockDataInputStream;]Ljava/io/ObjectStreamClass;Ljava/io/ObjectStreamClass;]Ljava/io/ObjectInputStream$HandleTable;Ljava/io/ObjectInputStream$HandleTable;]Ljava/io/SerialCallbackContext;Ljava/io/SerialCallbackContext;
+HSPLjava/io/ObjectInputStream;->readObject0(Z)Ljava/lang/Object;
+HSPLjava/io/ObjectInputStream;->readOrdinaryObject(Z)Ljava/lang/Object;
+HSPLjava/io/ObjectInputStream;->readSerialData(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V
 HSPLjava/io/ObjectInputStream;->readShort()S
-HSPLjava/io/ObjectInputStream;->readStreamHeader()V+]Ljava/io/ObjectInputStream$BlockDataInputStream;Ljava/io/ObjectInputStream$BlockDataInputStream;
-HSPLjava/io/ObjectInputStream;->readString(Z)Ljava/lang/String;+]Ljava/io/ObjectInputStream$BlockDataInputStream;Ljava/io/ObjectInputStream$BlockDataInputStream;]Ljava/io/ObjectInputStream$HandleTable;Ljava/io/ObjectInputStream$HandleTable;
+HSPLjava/io/ObjectInputStream;->readStreamHeader()V
+HSPLjava/io/ObjectInputStream;->readString(Z)Ljava/lang/String;
 HSPLjava/io/ObjectInputStream;->readTypeString()Ljava/lang/String;
-HSPLjava/io/ObjectInputStream;->readUTF()Ljava/lang/String;+]Ljava/io/ObjectInputStream$BlockDataInputStream;Ljava/io/ObjectInputStream$BlockDataInputStream;
+HSPLjava/io/ObjectInputStream;->readUTF()Ljava/lang/String;
 HSPLjava/io/ObjectInputStream;->resolveClass(Ljava/io/ObjectStreamClass;)Ljava/lang/Class;
-HSPLjava/io/ObjectInputStream;->skipCustomData()V+]Ljava/io/ObjectInputStream$BlockDataInputStream;Ljava/io/ObjectInputStream$BlockDataInputStream;
+HSPLjava/io/ObjectInputStream;->skipCustomData()V
 HSPLjava/io/ObjectInputStream;->verifySubclass()V
 HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;-><init>(Ljava/io/OutputStream;)V
 HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;->close()V
-HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;->drain()V+]Ljava/io/OutputStream;Ljava/io/ByteArrayOutputStream;
+HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;->drain()V
 HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;->flush()V
-HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;->getUTFLength(Ljava/lang/String;)J+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;->getUTFLength(Ljava/lang/String;)J
 HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;->setBlockDataMode(Z)Z
 HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;->warnIfClosed()V
 HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;->write([BIIZ)V
 HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;->writeBlockHeader(I)V
 HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;->writeByte(I)V
-HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;->writeBytes(Ljava/lang/String;)V+]Ljava/lang/String;Ljava/lang/String;]Ljava/io/ObjectOutputStream$BlockDataOutputStream;Ljava/io/ObjectOutputStream$BlockDataOutputStream;
+HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;->writeBytes(Ljava/lang/String;)V
 HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;->writeFloat(F)V
 HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;->writeInt(I)V
 HSPLjava/io/ObjectOutputStream$BlockDataOutputStream;->writeLong(J)V
@@ -1574,7 +1488,7 @@
 HSPLjava/io/ObjectOutputStream;-><init>(Ljava/io/OutputStream;)V
 HSPLjava/io/ObjectOutputStream;->annotateClass(Ljava/lang/Class;)V
 HSPLjava/io/ObjectOutputStream;->close()V
-HSPLjava/io/ObjectOutputStream;->defaultWriteFields(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V+]Ljava/io/ObjectStreamClass;Ljava/io/ObjectStreamClass;]Ljava/io/ObjectStreamField;Ljava/io/ObjectStreamField;]Ljava/io/ObjectOutputStream$BlockDataOutputStream;Ljava/io/ObjectOutputStream$BlockDataOutputStream;]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/io/ObjectOutputStream;->defaultWriteFields(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V
 HSPLjava/io/ObjectOutputStream;->defaultWriteObject()V
 HSPLjava/io/ObjectOutputStream;->flush()V
 HSPLjava/io/ObjectOutputStream;->isCustomSubclass()Z
@@ -1587,18 +1501,18 @@
 HSPLjava/io/ObjectOutputStream;->writeEnum(Ljava/lang/Enum;Ljava/io/ObjectStreamClass;Z)V
 HSPLjava/io/ObjectOutputStream;->writeFields()V
 HSPLjava/io/ObjectOutputStream;->writeFloat(F)V
-HSPLjava/io/ObjectOutputStream;->writeHandle(I)V+]Ljava/io/ObjectOutputStream$BlockDataOutputStream;Ljava/io/ObjectOutputStream$BlockDataOutputStream;
+HSPLjava/io/ObjectOutputStream;->writeHandle(I)V
 HSPLjava/io/ObjectOutputStream;->writeInt(I)V
 HSPLjava/io/ObjectOutputStream;->writeLong(J)V
 HSPLjava/io/ObjectOutputStream;->writeNonProxyDesc(Ljava/io/ObjectStreamClass;Z)V
 HSPLjava/io/ObjectOutputStream;->writeNull()V
 HSPLjava/io/ObjectOutputStream;->writeObject(Ljava/lang/Object;)V
-HSPLjava/io/ObjectOutputStream;->writeObject0(Ljava/lang/Object;Z)V+]Ljava/io/ObjectOutputStream$ReplaceTable;Ljava/io/ObjectOutputStream$ReplaceTable;]Ljava/lang/Object;megamorphic_types]Ljava/io/ObjectOutputStream$HandleTable;Ljava/io/ObjectOutputStream$HandleTable;]Ljava/io/ObjectStreamClass;Ljava/io/ObjectStreamClass;]Ljava/io/ObjectOutputStream$BlockDataOutputStream;Ljava/io/ObjectOutputStream$BlockDataOutputStream;]Ljava/lang/Class;Ljava/lang/Class;
-HSPLjava/io/ObjectOutputStream;->writeOrdinaryObject(Ljava/lang/Object;Ljava/io/ObjectStreamClass;Z)V+]Ljava/io/ObjectOutputStream$HandleTable;Ljava/io/ObjectOutputStream$HandleTable;]Ljava/io/ObjectStreamClass;Ljava/io/ObjectStreamClass;]Ljava/io/ObjectOutputStream$BlockDataOutputStream;Ljava/io/ObjectOutputStream$BlockDataOutputStream;
+HSPLjava/io/ObjectOutputStream;->writeObject0(Ljava/lang/Object;Z)V
+HSPLjava/io/ObjectOutputStream;->writeOrdinaryObject(Ljava/lang/Object;Ljava/io/ObjectStreamClass;Z)V
 HSPLjava/io/ObjectOutputStream;->writeSerialData(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V
 HSPLjava/io/ObjectOutputStream;->writeShort(I)V
 HSPLjava/io/ObjectOutputStream;->writeStreamHeader()V
-HSPLjava/io/ObjectOutputStream;->writeString(Ljava/lang/String;Z)V+]Ljava/io/ObjectOutputStream$HandleTable;Ljava/io/ObjectOutputStream$HandleTable;]Ljava/io/ObjectOutputStream$BlockDataOutputStream;Ljava/io/ObjectOutputStream$BlockDataOutputStream;
+HSPLjava/io/ObjectOutputStream;->writeString(Ljava/lang/String;Z)V
 HSPLjava/io/ObjectOutputStream;->writeTypeString(Ljava/lang/String;)V
 HSPLjava/io/ObjectOutputStream;->writeUTF(Ljava/lang/String;)V
 HSPLjava/io/ObjectStreamClass$1;-><init>(Ljava/io/ObjectStreamClass;)V
@@ -1629,10 +1543,10 @@
 HSPLjava/io/ObjectStreamClass$FieldReflector;->getFields()[Ljava/io/ObjectStreamField;
 HSPLjava/io/ObjectStreamClass$FieldReflector;->getObjFieldValues(Ljava/lang/Object;[Ljava/lang/Object;)V
 HSPLjava/io/ObjectStreamClass$FieldReflector;->getPrimFieldValues(Ljava/lang/Object;[B)V
-HSPLjava/io/ObjectStreamClass$FieldReflector;->setObjFieldValues(Ljava/lang/Object;[Ljava/lang/Object;)V+]Ljava/lang/Class;Ljava/lang/Class;
-HSPLjava/io/ObjectStreamClass$FieldReflector;->setPrimFieldValues(Ljava/lang/Object;[B)V+]Lsun/misc/Unsafe;Lsun/misc/Unsafe;
-HSPLjava/io/ObjectStreamClass$FieldReflectorKey;-><init>(Ljava/lang/Class;[Ljava/io/ObjectStreamField;Ljava/lang/ref/ReferenceQueue;)V+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/lang/String;Ljava/lang/String;]Ljava/io/ObjectStreamField;Ljava/io/ObjectStreamField;
-HSPLjava/io/ObjectStreamClass$FieldReflectorKey;->equals(Ljava/lang/Object;)Z+]Ljava/io/ObjectStreamClass$FieldReflectorKey;Ljava/io/ObjectStreamClass$FieldReflectorKey;
+HSPLjava/io/ObjectStreamClass$FieldReflector;->setObjFieldValues(Ljava/lang/Object;[Ljava/lang/Object;)V
+HSPLjava/io/ObjectStreamClass$FieldReflector;->setPrimFieldValues(Ljava/lang/Object;[B)V
+HSPLjava/io/ObjectStreamClass$FieldReflectorKey;-><init>(Ljava/lang/Class;[Ljava/io/ObjectStreamField;Ljava/lang/ref/ReferenceQueue;)V
+HSPLjava/io/ObjectStreamClass$FieldReflectorKey;->equals(Ljava/lang/Object;)Z
 HSPLjava/io/ObjectStreamClass$FieldReflectorKey;->hashCode()I
 HSPLjava/io/ObjectStreamClass$MemberSignature;-><init>(Ljava/lang/reflect/Constructor;)V
 HSPLjava/io/ObjectStreamClass$MemberSignature;-><init>(Ljava/lang/reflect/Field;)V
@@ -1663,12 +1577,12 @@
 HSPLjava/io/ObjectStreamClass;->checkDefaultSerialize()V
 HSPLjava/io/ObjectStreamClass;->checkDeserialize()V
 HSPLjava/io/ObjectStreamClass;->checkSerialize()V
-HSPLjava/io/ObjectStreamClass;->classNamesEqual(Ljava/lang/String;Ljava/lang/String;)Z+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/io/ObjectStreamClass;->classNamesEqual(Ljava/lang/String;Ljava/lang/String;)Z
 HSPLjava/io/ObjectStreamClass;->computeDefaultSUID(Ljava/lang/Class;)J
-HSPLjava/io/ObjectStreamClass;->computeFieldOffsets()V+]Ljava/io/ObjectStreamField;Ljava/io/ObjectStreamField;
+HSPLjava/io/ObjectStreamClass;->computeFieldOffsets()V
 HSPLjava/io/ObjectStreamClass;->forClass()Ljava/lang/Class;
 HSPLjava/io/ObjectStreamClass;->getClassDataLayout()[Ljava/io/ObjectStreamClass$ClassDataSlot;
-HSPLjava/io/ObjectStreamClass;->getClassDataLayout0()[Ljava/io/ObjectStreamClass$ClassDataSlot;+]Ljava/util/HashSet;Ljava/util/HashSet;]Ljava/lang/Class;Ljava/lang/Class;]Ljava/util/ArrayList;Ljava/util/ArrayList;
+HSPLjava/io/ObjectStreamClass;->getClassDataLayout0()[Ljava/io/ObjectStreamClass$ClassDataSlot;
 HSPLjava/io/ObjectStreamClass;->getClassSignature(Ljava/lang/Class;)Ljava/lang/String;
 HSPLjava/io/ObjectStreamClass;->getDeclaredSUID(Ljava/lang/Class;)Ljava/lang/Long;
 HSPLjava/io/ObjectStreamClass;->getDeclaredSerialFields(Ljava/lang/Class;)[Ljava/io/ObjectStreamField;
@@ -1684,10 +1598,10 @@
 HSPLjava/io/ObjectStreamClass;->getPrimDataSize()I
 HSPLjava/io/ObjectStreamClass;->getPrimFieldValues(Ljava/lang/Object;[B)V
 HSPLjava/io/ObjectStreamClass;->getPrivateMethod(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;Ljava/lang/Class;)Ljava/lang/reflect/Method;
-HSPLjava/io/ObjectStreamClass;->getReflector([Ljava/io/ObjectStreamField;Ljava/io/ObjectStreamClass;)Ljava/io/ObjectStreamClass$FieldReflector;+]Ljava/lang/ref/Reference;Ljava/lang/ref/SoftReference;]Ljava/util/concurrent/ConcurrentMap;Ljava/util/concurrent/ConcurrentHashMap;
+HSPLjava/io/ObjectStreamClass;->getReflector([Ljava/io/ObjectStreamField;Ljava/io/ObjectStreamClass;)Ljava/io/ObjectStreamClass$FieldReflector;
 HSPLjava/io/ObjectStreamClass;->getResolveException()Ljava/lang/ClassNotFoundException;
 HSPLjava/io/ObjectStreamClass;->getSerialFields(Ljava/lang/Class;)[Ljava/io/ObjectStreamField;
-HSPLjava/io/ObjectStreamClass;->getSerialVersionUID()J+]Ljava/lang/Long;Ljava/lang/Long;
+HSPLjava/io/ObjectStreamClass;->getSerialVersionUID()J
 HSPLjava/io/ObjectStreamClass;->getSerializableConstructor(Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
 HSPLjava/io/ObjectStreamClass;->getSuperDesc()Ljava/io/ObjectStreamClass;
 HSPLjava/io/ObjectStreamClass;->getVariantFor(Ljava/lang/Class;)Ljava/io/ObjectStreamClass;
@@ -1696,7 +1610,7 @@
 HSPLjava/io/ObjectStreamClass;->hasWriteObjectData()Z
 HSPLjava/io/ObjectStreamClass;->hasWriteObjectMethod()Z
 HSPLjava/io/ObjectStreamClass;->hasWriteReplaceMethod()Z
-HSPLjava/io/ObjectStreamClass;->initNonProxy(Ljava/io/ObjectStreamClass;Ljava/lang/Class;Ljava/lang/ClassNotFoundException;Ljava/io/ObjectStreamClass;)V+]Ljava/io/ObjectStreamClass$FieldReflector;Ljava/io/ObjectStreamClass$FieldReflector;]Ljava/io/ObjectStreamClass;Ljava/io/ObjectStreamClass;]Ljava/lang/Long;Ljava/lang/Long;]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/io/ObjectStreamClass;->initNonProxy(Ljava/io/ObjectStreamClass;Ljava/lang/Class;Ljava/lang/ClassNotFoundException;Ljava/io/ObjectStreamClass;)V
 HSPLjava/io/ObjectStreamClass;->invokeReadObject(Ljava/lang/Object;Ljava/io/ObjectInputStream;)V
 HSPLjava/io/ObjectStreamClass;->invokeReadResolve(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/io/ObjectStreamClass;->invokeWriteObject(Ljava/lang/Object;Ljava/io/ObjectOutputStream;)V
@@ -1705,19 +1619,20 @@
 HSPLjava/io/ObjectStreamClass;->isExternalizable()Z
 HSPLjava/io/ObjectStreamClass;->isInstantiable()Z
 HSPLjava/io/ObjectStreamClass;->isProxy()Z
-HSPLjava/io/ObjectStreamClass;->lookup(Ljava/lang/Class;Z)Ljava/io/ObjectStreamClass;+]Ljava/lang/ref/Reference;Ljava/lang/ref/SoftReference;]Ljava/util/concurrent/ConcurrentMap;Ljava/util/concurrent/ConcurrentHashMap;]Ljava/io/ObjectStreamClass$EntryFuture;Ljava/io/ObjectStreamClass$EntryFuture;]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/io/ObjectStreamClass;->isRecord()Z
+HSPLjava/io/ObjectStreamClass;->lookup(Ljava/lang/Class;Z)Ljava/io/ObjectStreamClass;
 HSPLjava/io/ObjectStreamClass;->matchFields([Ljava/io/ObjectStreamField;Ljava/io/ObjectStreamClass;)[Ljava/io/ObjectStreamField;
 HSPLjava/io/ObjectStreamClass;->newInstance()Ljava/lang/Object;
 HSPLjava/io/ObjectStreamClass;->packageEquals(Ljava/lang/Class;Ljava/lang/Class;)Z
 HSPLjava/io/ObjectStreamClass;->processQueue(Ljava/lang/ref/ReferenceQueue;Ljava/util/concurrent/ConcurrentMap;)V
-HSPLjava/io/ObjectStreamClass;->readNonProxy(Ljava/io/ObjectInputStream;)V+]Ljava/io/ObjectInputStream;Ljava/io/ObjectInputStream;,Landroid/os/Parcel$2;
+HSPLjava/io/ObjectStreamClass;->readNonProxy(Ljava/io/ObjectInputStream;)V
 HSPLjava/io/ObjectStreamClass;->requireInitialized()V
 HSPLjava/io/ObjectStreamClass;->setObjFieldValues(Ljava/lang/Object;[Ljava/lang/Object;)V
 HSPLjava/io/ObjectStreamClass;->setPrimFieldValues(Ljava/lang/Object;[B)V
 HSPLjava/io/ObjectStreamClass;->writeNonProxy(Ljava/io/ObjectOutputStream;)V
 HSPLjava/io/ObjectStreamField;-><init>(Ljava/lang/String;Ljava/lang/Class;)V
 HSPLjava/io/ObjectStreamField;-><init>(Ljava/lang/String;Ljava/lang/Class;Z)V
-HSPLjava/io/ObjectStreamField;-><init>(Ljava/lang/String;Ljava/lang/String;Z)V+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/io/ObjectStreamField;-><init>(Ljava/lang/String;Ljava/lang/String;Z)V
 HSPLjava/io/ObjectStreamField;-><init>(Ljava/lang/reflect/Field;ZZ)V
 HSPLjava/io/ObjectStreamField;->compareTo(Ljava/lang/Object;)I
 HSPLjava/io/ObjectStreamField;->getClassSignature(Ljava/lang/Class;)Ljava/lang/String;
@@ -1755,27 +1670,27 @@
 HSPLjava/io/PrintWriter;-><init>(Ljava/io/Writer;)V
 HSPLjava/io/PrintWriter;-><init>(Ljava/io/Writer;Z)V
 HSPLjava/io/PrintWriter;->append(C)Ljava/io/PrintWriter;
-HSPLjava/io/PrintWriter;->append(Ljava/lang/CharSequence;)Ljava/io/PrintWriter;+]Ljava/io/PrintWriter;Lcom/android/internal/util/FastPrintWriter;
+HSPLjava/io/PrintWriter;->append(Ljava/lang/CharSequence;)Ljava/io/PrintWriter;
 HSPLjava/io/PrintWriter;->append(Ljava/lang/CharSequence;)Ljava/lang/Appendable;
 HSPLjava/io/PrintWriter;->close()V
 HSPLjava/io/PrintWriter;->ensureOpen()V
-HSPLjava/io/PrintWriter;->flush()V+]Ljava/io/Writer;Landroid/util/Log$ImmediateLogWriter;
+HSPLjava/io/PrintWriter;->flush()V
 HSPLjava/io/PrintWriter;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/PrintWriter;
-HSPLjava/io/PrintWriter;->newLine()V+]Ljava/io/Writer;missing_types
+HSPLjava/io/PrintWriter;->newLine()V
 HSPLjava/io/PrintWriter;->print(C)V
 HSPLjava/io/PrintWriter;->print(I)V
 HSPLjava/io/PrintWriter;->print(J)V
-HSPLjava/io/PrintWriter;->print(Ljava/lang/String;)V+]Ljava/io/PrintWriter;Lcom/android/internal/util/LineBreakBufferedWriter;,Ljava/io/PrintWriter;
+HSPLjava/io/PrintWriter;->print(Ljava/lang/String;)V
 HSPLjava/io/PrintWriter;->print(Z)V
 HSPLjava/io/PrintWriter;->printf(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/PrintWriter;
 HSPLjava/io/PrintWriter;->println()V
 HSPLjava/io/PrintWriter;->println(I)V
-HSPLjava/io/PrintWriter;->println(Ljava/lang/Object;)V+]Ljava/io/PrintWriter;Lcom/android/internal/util/LineBreakBufferedWriter;
-HSPLjava/io/PrintWriter;->println(Ljava/lang/String;)V+]Ljava/io/PrintWriter;Lcom/android/internal/util/LineBreakBufferedWriter;,Ljava/io/PrintWriter;
+HSPLjava/io/PrintWriter;->println(Ljava/lang/Object;)V
+HSPLjava/io/PrintWriter;->println(Ljava/lang/String;)V
 HSPLjava/io/PrintWriter;->write(I)V
-HSPLjava/io/PrintWriter;->write(Ljava/lang/String;)V+]Ljava/io/PrintWriter;Lcom/android/internal/util/LineBreakBufferedWriter;,Ljava/io/PrintWriter;
+HSPLjava/io/PrintWriter;->write(Ljava/lang/String;)V
 HSPLjava/io/PrintWriter;->write(Ljava/lang/String;II)V
-HSPLjava/io/PrintWriter;->write([CII)V+]Ljava/io/Writer;Landroid/util/Log$ImmediateLogWriter;
+HSPLjava/io/PrintWriter;->write([CII)V
 HSPLjava/io/PushbackInputStream;-><init>(Ljava/io/InputStream;I)V
 HSPLjava/io/PushbackInputStream;->close()V
 HSPLjava/io/PushbackInputStream;->ensureOpen()V
@@ -1800,10 +1715,11 @@
 HSPLjava/io/RandomAccessFile;->read([B)I
 HSPLjava/io/RandomAccessFile;->read([BII)I
 HSPLjava/io/RandomAccessFile;->readByte()B
-HSPLjava/io/RandomAccessFile;->readBytes([BII)I+]Llibcore/io/IoTracker;Llibcore/io/IoTracker;
+HSPLjava/io/RandomAccessFile;->readBytes([BII)I
 HSPLjava/io/RandomAccessFile;->readFully([B)V
 HSPLjava/io/RandomAccessFile;->readFully([BII)V
 HSPLjava/io/RandomAccessFile;->readInt()I
+HSPLjava/io/RandomAccessFile;->readLine()Ljava/lang/String;+]Ljava/lang/StringBuffer;Ljava/lang/StringBuffer;]Ljava/io/RandomAccessFile;Ljava/io/RandomAccessFile;
 HSPLjava/io/RandomAccessFile;->seek(J)V
 HSPLjava/io/RandomAccessFile;->setLength(J)V
 HSPLjava/io/RandomAccessFile;->write(I)V
@@ -1831,40 +1747,40 @@
 HSPLjava/io/StringReader;->close()V
 HSPLjava/io/StringReader;->ensureOpen()V
 HSPLjava/io/StringReader;->read()I
-HSPLjava/io/StringReader;->read([CII)I+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/io/StringReader;->read([CII)I
 HSPLjava/io/StringWriter;-><init>()V
 HSPLjava/io/StringWriter;-><init>(I)V
 HSPLjava/io/StringWriter;->append(C)Ljava/io/StringWriter;
 HSPLjava/io/StringWriter;->append(C)Ljava/io/Writer;
-HSPLjava/io/StringWriter;->append(Ljava/lang/CharSequence;)Ljava/io/StringWriter;+]Ljava/io/StringWriter;Ljava/io/StringWriter;
-HSPLjava/io/StringWriter;->append(Ljava/lang/CharSequence;)Ljava/io/Writer;+]Ljava/io/StringWriter;Ljava/io/StringWriter;
+HSPLjava/io/StringWriter;->append(Ljava/lang/CharSequence;)Ljava/io/StringWriter;
+HSPLjava/io/StringWriter;->append(Ljava/lang/CharSequence;)Ljava/io/Writer;
 HSPLjava/io/StringWriter;->close()V
 HSPLjava/io/StringWriter;->flush()V
 HSPLjava/io/StringWriter;->getBuffer()Ljava/lang/StringBuffer;
 HSPLjava/io/StringWriter;->toString()Ljava/lang/String;
-HSPLjava/io/StringWriter;->write(I)V+]Ljava/lang/StringBuffer;Ljava/lang/StringBuffer;
-HSPLjava/io/StringWriter;->write(Ljava/lang/String;)V+]Ljava/lang/StringBuffer;Ljava/lang/StringBuffer;
-HSPLjava/io/StringWriter;->write(Ljava/lang/String;II)V+]Ljava/lang/StringBuffer;Ljava/lang/StringBuffer;
+HSPLjava/io/StringWriter;->write(I)V
+HSPLjava/io/StringWriter;->write(Ljava/lang/String;)V
+HSPLjava/io/StringWriter;->write(Ljava/lang/String;II)V
 HSPLjava/io/StringWriter;->write([CII)V
 HSPLjava/io/UnixFileSystem;->canonicalize(Ljava/lang/String;)Ljava/lang/String;
-HSPLjava/io/UnixFileSystem;->checkAccess(Ljava/io/File;I)Z+]Ljava/io/File;Ljava/io/File;]Llibcore/io/Os;Landroid/app/ActivityThread$AndroidOs;
-HSPLjava/io/UnixFileSystem;->compare(Ljava/io/File;Ljava/io/File;)I+]Ljava/io/File;Ljava/io/File;
+HSPLjava/io/UnixFileSystem;->checkAccess(Ljava/io/File;I)Z
+HSPLjava/io/UnixFileSystem;->compare(Ljava/io/File;Ljava/io/File;)I
 HSPLjava/io/UnixFileSystem;->createDirectory(Ljava/io/File;)Z
 HSPLjava/io/UnixFileSystem;->createFileExclusively(Ljava/lang/String;)Z
 HSPLjava/io/UnixFileSystem;->delete(Ljava/io/File;)Z
-HSPLjava/io/UnixFileSystem;->getBooleanAttributes(Ljava/io/File;)I+]Ljava/io/File;Ljava/io/File;]Ldalvik/system/BlockGuard$VmPolicy;Ldalvik/system/BlockGuard$2;,Landroid/os/StrictMode$5;]Ldalvik/system/BlockGuard$Policy;Ldalvik/system/BlockGuard$1;,Landroid/os/StrictMode$AndroidBlockGuardPolicy;
+HSPLjava/io/UnixFileSystem;->getBooleanAttributes(Ljava/io/File;)I
 HSPLjava/io/UnixFileSystem;->getDefaultParent()Ljava/lang/String;
 HSPLjava/io/UnixFileSystem;->getLastModifiedTime(Ljava/io/File;)J
 HSPLjava/io/UnixFileSystem;->getLength(Ljava/io/File;)J
 HSPLjava/io/UnixFileSystem;->getSpace(Ljava/io/File;I)J
-HSPLjava/io/UnixFileSystem;->hashCode(Ljava/io/File;)I+]Ljava/lang/String;Ljava/lang/String;]Ljava/io/File;Ljava/io/File;
+HSPLjava/io/UnixFileSystem;->hashCode(Ljava/io/File;)I
 HSPLjava/io/UnixFileSystem;->isAbsolute(Ljava/io/File;)Z
-HSPLjava/io/UnixFileSystem;->list(Ljava/io/File;)[Ljava/lang/String;+]Ljava/io/File;Ljava/io/File;]Ldalvik/system/BlockGuard$VmPolicy;Ldalvik/system/BlockGuard$2;,Landroid/os/StrictMode$5;]Ldalvik/system/BlockGuard$Policy;Ldalvik/system/BlockGuard$1;,Landroid/os/StrictMode$AndroidBlockGuardPolicy;
-HSPLjava/io/UnixFileSystem;->normalize(Ljava/lang/String;)Ljava/lang/String;+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/io/UnixFileSystem;->list(Ljava/io/File;)[Ljava/lang/String;
+HSPLjava/io/UnixFileSystem;->normalize(Ljava/lang/String;)Ljava/lang/String;
 HSPLjava/io/UnixFileSystem;->prefixLength(Ljava/lang/String;)I
 HSPLjava/io/UnixFileSystem;->rename(Ljava/io/File;Ljava/io/File;)Z
 HSPLjava/io/UnixFileSystem;->resolve(Ljava/io/File;)Ljava/lang/String;
-HSPLjava/io/UnixFileSystem;->resolve(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
+HSPLjava/io/UnixFileSystem;->resolve(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
 HSPLjava/io/UnixFileSystem;->setLastModifiedTime(Ljava/io/File;J)Z
 HSPLjava/io/UnixFileSystem;->setPermission(Ljava/io/File;IZZ)Z
 HSPLjava/io/Writer;-><init>()V
@@ -1876,20 +1792,20 @@
 HSPLjava/lang/AbstractStringBuilder;->append(C)Ljava/lang/AbstractStringBuilder;+]Ljava/lang/AbstractStringBuilder;Ljava/lang/StringBuilder;,Ljava/lang/StringBuffer;
 HSPLjava/lang/AbstractStringBuilder;->append(D)Ljava/lang/AbstractStringBuilder;
 HSPLjava/lang/AbstractStringBuilder;->append(F)Ljava/lang/AbstractStringBuilder;
-HSPLjava/lang/AbstractStringBuilder;->append(I)Ljava/lang/AbstractStringBuilder;+]Ljava/lang/AbstractStringBuilder;Ljava/lang/StringBuilder;,Ljava/lang/StringBuffer;
-HSPLjava/lang/AbstractStringBuilder;->append(J)Ljava/lang/AbstractStringBuilder;+]Ljava/lang/AbstractStringBuilder;Ljava/lang/StringBuilder;
+HSPLjava/lang/AbstractStringBuilder;->append(I)Ljava/lang/AbstractStringBuilder;
+HSPLjava/lang/AbstractStringBuilder;->append(J)Ljava/lang/AbstractStringBuilder;
 HSPLjava/lang/AbstractStringBuilder;->append(Ljava/lang/AbstractStringBuilder;)Ljava/lang/AbstractStringBuilder;
-HSPLjava/lang/AbstractStringBuilder;->append(Ljava/lang/CharSequence;)Ljava/lang/AbstractStringBuilder;+]Ljava/lang/CharSequence;Ljava/nio/HeapCharBuffer;,Landroid/icu/impl/FormattedStringBuilder;]Ljava/lang/AbstractStringBuilder;Ljava/lang/StringBuilder;,Ljava/lang/StringBuffer;
-HSPLjava/lang/AbstractStringBuilder;->append(Ljava/lang/CharSequence;II)Ljava/lang/AbstractStringBuilder;+]Ljava/lang/CharSequence;Ljava/lang/String;,Landroid/icu/impl/FormattedStringBuilder;,Ljava/nio/HeapCharBuffer;
-HSPLjava/lang/AbstractStringBuilder;->append(Ljava/lang/String;)Ljava/lang/AbstractStringBuilder;
+HSPLjava/lang/AbstractStringBuilder;->append(Ljava/lang/CharSequence;)Ljava/lang/AbstractStringBuilder;
+HSPLjava/lang/AbstractStringBuilder;->append(Ljava/lang/CharSequence;II)Ljava/lang/AbstractStringBuilder;
+HSPLjava/lang/AbstractStringBuilder;->append(Ljava/lang/String;)Ljava/lang/AbstractStringBuilder;+]Ljava/lang/String;Ljava/lang/String;
 HSPLjava/lang/AbstractStringBuilder;->append(Ljava/lang/StringBuffer;)Ljava/lang/AbstractStringBuilder;
 HSPLjava/lang/AbstractStringBuilder;->append(Z)Ljava/lang/AbstractStringBuilder;
 HSPLjava/lang/AbstractStringBuilder;->append([CII)Ljava/lang/AbstractStringBuilder;
-HSPLjava/lang/AbstractStringBuilder;->appendChars(Ljava/lang/CharSequence;II)V+]Ljava/lang/CharSequence;Ljava/lang/String;,Ljava/nio/HeapCharBuffer;,Landroid/icu/impl/FormattedStringBuilder;]Ljava/lang/AbstractStringBuilder;Ljava/lang/StringBuilder;,Ljava/lang/StringBuffer;
+HSPLjava/lang/AbstractStringBuilder;->appendChars(Ljava/lang/CharSequence;II)V
 HSPLjava/lang/AbstractStringBuilder;->appendChars([CII)V+]Ljava/lang/AbstractStringBuilder;Ljava/lang/StringBuilder;,Ljava/lang/StringBuffer;
-HSPLjava/lang/AbstractStringBuilder;->appendCodePoint(I)Ljava/lang/AbstractStringBuilder;+]Ljava/lang/AbstractStringBuilder;Ljava/lang/StringBuilder;
+HSPLjava/lang/AbstractStringBuilder;->appendCodePoint(I)Ljava/lang/AbstractStringBuilder;
 HSPLjava/lang/AbstractStringBuilder;->appendNull()Ljava/lang/AbstractStringBuilder;
-HSPLjava/lang/AbstractStringBuilder;->charAt(I)C+]Ljava/lang/AbstractStringBuilder;Ljava/lang/StringBuilder;,Ljava/lang/StringBuffer;
+HSPLjava/lang/AbstractStringBuilder;->charAt(I)C
 HSPLjava/lang/AbstractStringBuilder;->checkRange(III)V
 HSPLjava/lang/AbstractStringBuilder;->checkRangeSIOOBE(III)V
 HSPLjava/lang/AbstractStringBuilder;->codePointAt(I)I
@@ -1902,7 +1818,7 @@
 HSPLjava/lang/AbstractStringBuilder;->getCoder()B
 HSPLjava/lang/AbstractStringBuilder;->indexOf(Ljava/lang/String;)I
 HSPLjava/lang/AbstractStringBuilder;->indexOf(Ljava/lang/String;I)I
-HSPLjava/lang/AbstractStringBuilder;->insert(IC)Ljava/lang/AbstractStringBuilder;+]Ljava/lang/AbstractStringBuilder;Ljava/lang/StringBuilder;
+HSPLjava/lang/AbstractStringBuilder;->insert(IC)Ljava/lang/AbstractStringBuilder;
 HSPLjava/lang/AbstractStringBuilder;->insert(II)Ljava/lang/AbstractStringBuilder;
 HSPLjava/lang/AbstractStringBuilder;->insert(ILjava/lang/String;)Ljava/lang/AbstractStringBuilder;
 HSPLjava/lang/AbstractStringBuilder;->isLatin1()Z
@@ -1917,14 +1833,14 @@
 HSPLjava/lang/AbstractStringBuilder;->shift(II)V
 HSPLjava/lang/AbstractStringBuilder;->subSequence(II)Ljava/lang/CharSequence;
 HSPLjava/lang/AbstractStringBuilder;->substring(I)Ljava/lang/String;
-HSPLjava/lang/AbstractStringBuilder;->substring(II)Ljava/lang/String;+]Ljava/lang/AbstractStringBuilder;Ljava/lang/StringBuilder;
+HSPLjava/lang/AbstractStringBuilder;->substring(II)Ljava/lang/String;
 HSPLjava/lang/ArrayIndexOutOfBoundsException;-><init>(Ljava/lang/String;)V
 HSPLjava/lang/Boolean;-><init>(Z)V
 HSPLjava/lang/Boolean;->booleanValue()Z
 HSPLjava/lang/Boolean;->compare(ZZ)I
 HSPLjava/lang/Boolean;->compareTo(Ljava/lang/Boolean;)I
 HSPLjava/lang/Boolean;->compareTo(Ljava/lang/Object;)I
-HSPLjava/lang/Boolean;->equals(Ljava/lang/Object;)Z+]Ljava/lang/Boolean;Ljava/lang/Boolean;
+HSPLjava/lang/Boolean;->equals(Ljava/lang/Object;)Z
 HSPLjava/lang/Boolean;->getBoolean(Ljava/lang/String;)Z
 HSPLjava/lang/Boolean;->hashCode()I
 HSPLjava/lang/Boolean;->hashCode(Z)I
@@ -1951,8 +1867,8 @@
 HSPLjava/lang/Byte;->toString(B)Ljava/lang/String;
 HSPLjava/lang/Byte;->toUnsignedInt(B)I
 HSPLjava/lang/Byte;->valueOf(B)Ljava/lang/Byte;
-HSPLjava/lang/CaseMapper;->toLowerCase(Ljava/util/Locale;Ljava/lang/String;)Ljava/lang/String;+]Ljava/util/Locale;Ljava/util/Locale;
-HSPLjava/lang/CaseMapper;->toUpperCase(Ljava/util/Locale;Ljava/lang/String;I)Ljava/lang/String;+]Ljava/util/Locale;Ljava/util/Locale;
+HSPLjava/lang/CaseMapper;->toLowerCase(Ljava/util/Locale;Ljava/lang/String;)Ljava/lang/String;+]Ljava/lang/String;Ljava/lang/String;]Ljava/util/Locale;Ljava/util/Locale;
+HSPLjava/lang/CaseMapper;->toUpperCase(Ljava/util/Locale;Ljava/lang/String;I)Ljava/lang/String;
 HSPLjava/lang/CaseMapper;->upperIndex(I)I
 HSPLjava/lang/Character$Subset;->equals(Ljava/lang/Object;)Z
 HSPLjava/lang/Character$Subset;->hashCode()I
@@ -1960,7 +1876,7 @@
 HSPLjava/lang/Character;-><init>(C)V
 HSPLjava/lang/Character;->charCount(I)I
 HSPLjava/lang/Character;->charValue()C
-HSPLjava/lang/Character;->codePointAt(Ljava/lang/CharSequence;I)I+]Ljava/lang/CharSequence;megamorphic_types
+HSPLjava/lang/Character;->codePointAt(Ljava/lang/CharSequence;I)I
 HSPLjava/lang/Character;->codePointAtImpl([CII)I
 HSPLjava/lang/Character;->codePointBefore(Ljava/lang/CharSequence;I)I
 HSPLjava/lang/Character;->codePointCount(Ljava/lang/CharSequence;II)I
@@ -2014,24 +1930,24 @@
 HSPLjava/lang/Character;->toUpperCase(I)I
 HSPLjava/lang/Character;->valueOf(C)Ljava/lang/Character;
 HSPLjava/lang/Class;->asSubclass(Ljava/lang/Class;)Ljava/lang/Class;
-HSPLjava/lang/Class;->cast(Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/lang/Class;Ljava/lang/Class;
-HSPLjava/lang/Class;->classNameImpliesTopLevel()Z+]Ljava/lang/String;Ljava/lang/String;]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/lang/Class;->cast(Ljava/lang/Object;)Ljava/lang/Object;
+HSPLjava/lang/Class;->classNameImpliesTopLevel()Z
 HSPLjava/lang/Class;->desiredAssertionStatus()Z
 HSPLjava/lang/Class;->findInterfaceMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
 HSPLjava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
 HSPLjava/lang/Class;->forName(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;
 HSPLjava/lang/Class;->getAccessFlags()I
-HSPLjava/lang/Class;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;+]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/lang/Class;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;
 HSPLjava/lang/Class;->getCanonicalName()Ljava/lang/String;
-HSPLjava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;+]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;
 HSPLjava/lang/Class;->getComponentType()Ljava/lang/Class;
 HSPLjava/lang/Class;->getConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
-HSPLjava/lang/Class;->getConstructor0([Ljava/lang/Class;I)Ljava/lang/reflect/Constructor;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/lang/Class;Ljava/lang/Class;]Ljava/lang/reflect/Constructor;Ljava/lang/reflect/Constructor;
+HSPLjava/lang/Class;->getConstructor0([Ljava/lang/Class;I)Ljava/lang/reflect/Constructor;
 HSPLjava/lang/Class;->getConstructors()[Ljava/lang/reflect/Constructor;
 HSPLjava/lang/Class;->getDeclaredConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
 HSPLjava/lang/Class;->getDeclaredConstructors()[Ljava/lang/reflect/Constructor;
 HSPLjava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
-HSPLjava/lang/Class;->getDeclaredMethods()[Ljava/lang/reflect/Method;+]Ljava/lang/reflect/Method;Ljava/lang/reflect/Method;]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/lang/Class;->getDeclaredMethods()[Ljava/lang/reflect/Method;
 HSPLjava/lang/Class;->getEnclosingConstructor()Ljava/lang/reflect/Constructor;
 HSPLjava/lang/Class;->getEnclosingMethod()Ljava/lang/reflect/Method;
 HSPLjava/lang/Class;->getEnumConstants()[Ljava/lang/Object;
@@ -2039,12 +1955,12 @@
 HSPLjava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field;
 HSPLjava/lang/Class;->getFields()[Ljava/lang/reflect/Field;
 HSPLjava/lang/Class;->getGenericInterfaces()[Ljava/lang/reflect/Type;
-HSPLjava/lang/Class;->getGenericSuperclass()Ljava/lang/reflect/Type;+]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/lang/Class;->getGenericSuperclass()Ljava/lang/reflect/Type;
 HSPLjava/lang/Class;->getInterfaces()[Ljava/lang/Class;
 HSPLjava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
 HSPLjava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;Z)Ljava/lang/reflect/Method;
 HSPLjava/lang/Class;->getMethods()[Ljava/lang/reflect/Method;
-HSPLjava/lang/Class;->getModifiers()I+]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/lang/Class;->getModifiers()I
 HSPLjava/lang/Class;->getName()Ljava/lang/String;
 HSPLjava/lang/Class;->getPackage()Ljava/lang/Package;
 HSPLjava/lang/Class;->getPackageName()Ljava/lang/String;
@@ -2053,19 +1969,19 @@
 HSPLjava/lang/Class;->getPublicMethodRecursive(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
 HSPLjava/lang/Class;->getPublicMethodsInternal(Ljava/util/List;)V
 HSPLjava/lang/Class;->getResourceAsStream(Ljava/lang/String;)Ljava/io/InputStream;
-HSPLjava/lang/Class;->getSignatureAttribute()Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
-HSPLjava/lang/Class;->getSimpleName()Ljava/lang/String;+]Ljava/lang/String;Ljava/lang/String;]Ljava/lang/Class;Ljava/lang/Class;
-HSPLjava/lang/Class;->getSuperclass()Ljava/lang/Class;+]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/lang/Class;->getSignatureAttribute()Ljava/lang/String;
+HSPLjava/lang/Class;->getSimpleName()Ljava/lang/String;
+HSPLjava/lang/Class;->getSuperclass()Ljava/lang/Class;
 HSPLjava/lang/Class;->getTypeName()Ljava/lang/String;
 HSPLjava/lang/Class;->getTypeParameters()[Ljava/lang/reflect/TypeVariable;
 HSPLjava/lang/Class;->isAnnotation()Z
 HSPLjava/lang/Class;->isAnnotationPresent(Ljava/lang/Class;)Z
-HSPLjava/lang/Class;->isArray()Z+]Ljava/lang/Class;Ljava/lang/Class;
-HSPLjava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z+]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/lang/Class;->isArray()Z
+HSPLjava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z
 HSPLjava/lang/Class;->isEnum()Z
-HSPLjava/lang/Class;->isInstance(Ljava/lang/Object;)Z+]Ljava/lang/Object;missing_types]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/lang/Class;->isInstance(Ljava/lang/Object;)Z
 HSPLjava/lang/Class;->isInterface()Z
-HSPLjava/lang/Class;->isLocalClass()Z+]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/lang/Class;->isLocalClass()Z
 HSPLjava/lang/Class;->isLocalOrAnonymousClass()Z
 HSPLjava/lang/Class;->isMemberClass()Z
 HSPLjava/lang/Class;->isPrimitive()Z
@@ -2075,7 +1991,6 @@
 HSPLjava/lang/ClassCastException;-><init>(Ljava/lang/String;)V
 HSPLjava/lang/ClassLoader;-><init>()V
 HSPLjava/lang/ClassLoader;-><init>(Ljava/lang/ClassLoader;)V
-HSPLjava/lang/ClassLoader;-><init>(Ljava/lang/Void;Ljava/lang/ClassLoader;)V
 HSPLjava/lang/ClassLoader;->checkCreateClassLoader()Ljava/lang/Void;
 HSPLjava/lang/ClassLoader;->definePackage(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/net/URL;)Ljava/lang/Package;
 HSPLjava/lang/ClassLoader;->findLoadedClass(Ljava/lang/String;)Ljava/lang/Class;
@@ -2095,11 +2010,11 @@
 HSPLjava/lang/Daemons$Daemon;->isRunning()Z
 HSPLjava/lang/Daemons$Daemon;->run()V
 HSPLjava/lang/Daemons$Daemon;->startInternal()V
-HSPLjava/lang/Daemons$Daemon;->startPostZygoteFork()V
 HSPLjava/lang/Daemons$Daemon;->stop()V
 HSPLjava/lang/Daemons$FinalizerDaemon;->-$$Nest$fgetprogressCounter(Ljava/lang/Daemons$FinalizerDaemon;)Ljava/util/concurrent/atomic/AtomicInteger;
 HSPLjava/lang/Daemons$FinalizerDaemon;->-$$Nest$sfgetINSTANCE()Ljava/lang/Daemons$FinalizerDaemon;
-HSPLjava/lang/Daemons$FinalizerDaemon;->doFinalize(Ljava/lang/ref/FinalizerReference;)V+]Ljava/lang/Object;missing_types]Ljava/lang/ref/FinalizerReference;Ljava/lang/ref/FinalizerReference;
+HSPLjava/lang/Daemons$FinalizerDaemon;->doFinalize(Ljava/lang/ref/FinalizerReference;)V
+HSPLjava/lang/Daemons$FinalizerDaemon;->processReference(Ljava/lang/Object;)V+]Ljava/lang/ref/FinalizerReference;Ljava/lang/ref/FinalizerReference;
 HSPLjava/lang/Daemons$FinalizerDaemon;->runInternal()V
 HSPLjava/lang/Daemons$FinalizerWatchdogDaemon;->-$$Nest$mmonitoringNeeded(Ljava/lang/Daemons$FinalizerWatchdogDaemon;I)V
 HSPLjava/lang/Daemons$FinalizerWatchdogDaemon;->-$$Nest$mmonitoringNotNeeded(Ljava/lang/Daemons$FinalizerWatchdogDaemon;I)V
@@ -2117,7 +2032,6 @@
 HSPLjava/lang/Daemons$ReferenceQueueDaemon;->-$$Nest$fgetprogressCounter(Ljava/lang/Daemons$ReferenceQueueDaemon;)Ljava/util/concurrent/atomic/AtomicInteger;
 HSPLjava/lang/Daemons$ReferenceQueueDaemon;->-$$Nest$sfgetINSTANCE()Ljava/lang/Daemons$ReferenceQueueDaemon;
 HSPLjava/lang/Daemons$ReferenceQueueDaemon;->runInternal()V
-HSPLjava/lang/Daemons;->-$$Nest$sfgetPOST_ZYGOTE_START_LATCH()Ljava/util/concurrent/CountDownLatch;
 HSPLjava/lang/Daemons;->startPostZygoteFork()V
 HSPLjava/lang/Daemons;->stop()V
 HSPLjava/lang/Double;-><init>(D)V
@@ -2154,7 +2068,7 @@
 HSPLjava/lang/Enum;->name()Ljava/lang/String;
 HSPLjava/lang/Enum;->ordinal()I
 HSPLjava/lang/Enum;->toString()Ljava/lang/String;
-HSPLjava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;+]Ljava/lang/Enum;missing_types
+HSPLjava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
 HSPLjava/lang/Error;-><init>(Ljava/lang/String;)V
 HSPLjava/lang/Exception;-><init>()V
 HSPLjava/lang/Exception;-><init>(Ljava/lang/String;)V
@@ -2198,11 +2112,11 @@
 HSPLjava/lang/Integer;->byteValue()B
 HSPLjava/lang/Integer;->compare(II)I
 HSPLjava/lang/Integer;->compareTo(Ljava/lang/Integer;)I
-HSPLjava/lang/Integer;->compareTo(Ljava/lang/Object;)I+]Ljava/lang/Integer;Ljava/lang/Integer;
+HSPLjava/lang/Integer;->compareTo(Ljava/lang/Object;)I
 HSPLjava/lang/Integer;->decode(Ljava/lang/String;)Ljava/lang/Integer;
 HSPLjava/lang/Integer;->divideUnsigned(II)I
 HSPLjava/lang/Integer;->doubleValue()D
-HSPLjava/lang/Integer;->equals(Ljava/lang/Object;)Z+]Ljava/lang/Integer;Ljava/lang/Integer;
+HSPLjava/lang/Integer;->equals(Ljava/lang/Object;)Z
 HSPLjava/lang/Integer;->floatValue()F
 HSPLjava/lang/Integer;->formatUnsignedInt(II[BII)V
 HSPLjava/lang/Integer;->getChars(II[B)I
@@ -2241,13 +2155,13 @@
 HSPLjava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
 HSPLjava/lang/Integer;->valueOf(Ljava/lang/String;I)Ljava/lang/Integer;
 HSPLjava/lang/InterruptedException;-><init>()V
-HSPLjava/lang/Iterable;->forEach(Ljava/util/function/Consumer;)V+]Ljava/util/function/Consumer;missing_types]Ljava/util/Iterator;missing_types]Ljava/lang/Iterable;missing_types
+HSPLjava/lang/Iterable;->forEach(Ljava/util/function/Consumer;)V+]Ljava/util/function/Consumer;Ljava/util/ArrayDeque$$ExternalSyntheticLambda1;,Lcom/android/internal/app/LocaleStore$$ExternalSyntheticLambda0;]Ljava/util/Iterator;Ljava/util/AbstractList$Itr;,Ljava/util/HashMap$KeyIterator;,Ljava/util/WeakHashMap$KeyIterator;]Ljava/lang/Iterable;Ljava/util/HashSet;,Ljava/util/WeakHashMap$KeySet;
 HSPLjava/lang/LinkageError;-><init>(Ljava/lang/String;)V
 HSPLjava/lang/Long;-><init>(J)V
 HSPLjava/lang/Long;->bitCount(J)I
 HSPLjava/lang/Long;->compare(JJ)I
 HSPLjava/lang/Long;->compareTo(Ljava/lang/Long;)I
-HSPLjava/lang/Long;->compareTo(Ljava/lang/Object;)I+]Ljava/lang/Long;Ljava/lang/Long;
+HSPLjava/lang/Long;->compareTo(Ljava/lang/Object;)I
 HSPLjava/lang/Long;->compareUnsigned(JJ)I
 HSPLjava/lang/Long;->decode(Ljava/lang/String;)Ljava/lang/Long;
 HSPLjava/lang/Long;->divideUnsigned(JJ)J
@@ -2268,7 +2182,7 @@
 HSPLjava/lang/Long;->numberOfTrailingZeros(J)I
 HSPLjava/lang/Long;->parseLong(Ljava/lang/CharSequence;III)J
 HSPLjava/lang/Long;->parseLong(Ljava/lang/String;)J
-HSPLjava/lang/Long;->parseLong(Ljava/lang/String;I)J
+HSPLjava/lang/Long;->parseLong(Ljava/lang/String;I)J+]Ljava/lang/String;Ljava/lang/String;
 HSPLjava/lang/Long;->reverse(J)J
 HSPLjava/lang/Long;->reverseBytes(J)J
 HSPLjava/lang/Long;->rotateLeft(JI)J
@@ -2315,7 +2229,7 @@
 HSPLjava/lang/Math;->nextAfter(DD)D
 HSPLjava/lang/Math;->powerOfTwoD(I)D
 HSPLjava/lang/Math;->powerOfTwoF(I)F
-HSPLjava/lang/Math;->random()D+]Ljava/util/Random;Ljava/util/Random;
+HSPLjava/lang/Math;->random()D
 HSPLjava/lang/Math;->randomLongInternal()J
 HSPLjava/lang/Math;->round(D)J
 HSPLjava/lang/Math;->round(F)I
@@ -2335,7 +2249,6 @@
 HSPLjava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
 HSPLjava/lang/Number;-><init>()V
 HSPLjava/lang/NumberFormatException;-><init>(Ljava/lang/String;)V
-HSPLjava/lang/NumberFormatException;->forInputString(Ljava/lang/String;)Ljava/lang/NumberFormatException;
 HSPLjava/lang/NumberFormatException;->forInputString(Ljava/lang/String;I)Ljava/lang/NumberFormatException;
 HSPLjava/lang/Object;-><init>()V
 HSPLjava/lang/Object;->clone()Ljava/lang/Object;
@@ -2344,7 +2257,7 @@
 HSPLjava/lang/Object;->getClass()Ljava/lang/Class;
 HSPLjava/lang/Object;->hashCode()I
 HSPLjava/lang/Object;->identityHashCode(Ljava/lang/Object;)I
-HSPLjava/lang/Object;->toString()Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/lang/Object;missing_types]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/lang/Object;->toString()Ljava/lang/String;
 HSPLjava/lang/Object;->wait()V
 HSPLjava/lang/Object;->wait(J)V
 HSPLjava/lang/Package;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/net/URL;Ljava/lang/ClassLoader;)V
@@ -2397,10 +2310,10 @@
 HSPLjava/lang/StackTraceElement;->getFileName()Ljava/lang/String;
 HSPLjava/lang/StackTraceElement;->getLineNumber()I
 HSPLjava/lang/StackTraceElement;->getMethodName()Ljava/lang/String;
-HSPLjava/lang/StackTraceElement;->hashCode()I+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/lang/StackTraceElement;->hashCode()I
 HSPLjava/lang/StackTraceElement;->isNativeMethod()Z
-HSPLjava/lang/StackTraceElement;->toString()Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/lang/StackTraceElement;Ljava/lang/StackTraceElement;
-HSPLjava/lang/String$CaseInsensitiveComparator;->compare(Ljava/lang/Object;Ljava/lang/Object;)I+]Ljava/lang/String$CaseInsensitiveComparator;Ljava/lang/String$CaseInsensitiveComparator;
+HSPLjava/lang/StackTraceElement;->toString()Ljava/lang/String;
+HSPLjava/lang/String$CaseInsensitiveComparator;->compare(Ljava/lang/Object;Ljava/lang/Object;)I
 HSPLjava/lang/String$CaseInsensitiveComparator;->compare(Ljava/lang/String;Ljava/lang/String;)I
 HSPLjava/lang/String;->checkBoundsBeginEnd(III)V
 HSPLjava/lang/String;->checkBoundsOffCount(III)V
@@ -2409,35 +2322,35 @@
 HSPLjava/lang/String;->codePointAt(I)I
 HSPLjava/lang/String;->codePointCount(II)I
 HSPLjava/lang/String;->coder()B
-HSPLjava/lang/String;->compareTo(Ljava/lang/Object;)I
+HSPLjava/lang/String;->compareTo(Ljava/lang/Object;)I+]Ljava/lang/String;Ljava/lang/String;
 HSPLjava/lang/String;->compareToIgnoreCase(Ljava/lang/String;)I
-HSPLjava/lang/String;->contains(Ljava/lang/CharSequence;)Z+]Ljava/lang/String;Ljava/lang/String;]Ljava/lang/CharSequence;Ljava/lang/String;
+HSPLjava/lang/String;->contains(Ljava/lang/CharSequence;)Z
 HSPLjava/lang/String;->contentEquals(Ljava/lang/CharSequence;)Z
 HSPLjava/lang/String;->copyValueOf([C)Ljava/lang/String;
-HSPLjava/lang/String;->endsWith(Ljava/lang/String;)Z+]Ljava/lang/String;Ljava/lang/String;
-HSPLjava/lang/String;->equals(Ljava/lang/Object;)Z
-HSPLjava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/lang/String;->endsWith(Ljava/lang/String;)Z
+HSPLjava/lang/String;->equals(Ljava/lang/Object;)Z+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
 HSPLjava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
-HSPLjava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;+]Ljava/util/Formatter;Ljava/util/Formatter;
-HSPLjava/lang/String;->getBytes()[B+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
+HSPLjava/lang/String;->getBytes()[B
 HSPLjava/lang/String;->getBytes(Ljava/lang/String;)[B
 HSPLjava/lang/String;->getBytes(Ljava/nio/charset/Charset;)[B
 HSPLjava/lang/String;->getBytes([BIB)V+]Ljava/lang/String;Ljava/lang/String;
 HSPLjava/lang/String;->getChars(II[CI)V
 HSPLjava/lang/String;->getChars([CI)V
-HSPLjava/lang/String;->hashCode()I
+HSPLjava/lang/String;->hashCode()I+]Ljava/lang/String;Ljava/lang/String;
 HSPLjava/lang/String;->indexOf(I)I
-HSPLjava/lang/String;->indexOf(II)I
+HSPLjava/lang/String;->indexOf(II)I+]Ljava/lang/String;Ljava/lang/String;
 HSPLjava/lang/String;->indexOf(Ljava/lang/String;)I+]Ljava/lang/String;Ljava/lang/String;
 HSPLjava/lang/String;->indexOf(Ljava/lang/String;I)I
-HSPLjava/lang/String;->indexOf(Ljava/lang/String;Ljava/lang/String;I)I
-HSPLjava/lang/String;->indexOf([BBILjava/lang/String;I)I+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/lang/String;->indexOf(Ljava/lang/String;Ljava/lang/String;I)I+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/lang/String;->indexOf([BBILjava/lang/String;I)I
 HSPLjava/lang/String;->isEmpty()Z
 HSPLjava/lang/String;->join(Ljava/lang/CharSequence;Ljava/lang/Iterable;)Ljava/lang/String;
 HSPLjava/lang/String;->join(Ljava/lang/CharSequence;[Ljava/lang/CharSequence;)Ljava/lang/String;
-HSPLjava/lang/String;->lastIndexOf(I)I+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/lang/String;->lastIndexOf(I)I
 HSPLjava/lang/String;->lastIndexOf(II)I
-HSPLjava/lang/String;->lastIndexOf(Ljava/lang/String;)I+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/lang/String;->lastIndexOf(Ljava/lang/String;)I
 HSPLjava/lang/String;->lastIndexOf(Ljava/lang/String;I)I
 HSPLjava/lang/String;->lastIndexOf(Ljava/lang/String;Ljava/lang/String;I)I
 HSPLjava/lang/String;->lastIndexOf([BBILjava/lang/String;I)I
@@ -2447,14 +2360,14 @@
 HSPLjava/lang/String;->regionMatches(ILjava/lang/String;II)Z
 HSPLjava/lang/String;->regionMatches(ZILjava/lang/String;II)Z
 HSPLjava/lang/String;->replace(CC)Ljava/lang/String;
-HSPLjava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;+]Ljava/lang/String;Ljava/lang/String;]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/lang/CharSequence;Ljava/lang/String;
+HSPLjava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
 HSPLjava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
 HSPLjava/lang/String;->replaceFirst(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
 HSPLjava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
 HSPLjava/lang/String;->split(Ljava/lang/String;I)[Ljava/lang/String;
-HSPLjava/lang/String;->startsWith(Ljava/lang/String;)Z+]Ljava/lang/String;Ljava/lang/String;
-HSPLjava/lang/String;->startsWith(Ljava/lang/String;I)Z
-HSPLjava/lang/String;->subSequence(II)Ljava/lang/CharSequence;+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/lang/String;->startsWith(Ljava/lang/String;)Z
+HSPLjava/lang/String;->startsWith(Ljava/lang/String;I)Z+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/lang/String;->subSequence(II)Ljava/lang/CharSequence;
 HSPLjava/lang/String;->substring(I)Ljava/lang/String;
 HSPLjava/lang/String;->substring(II)Ljava/lang/String;
 HSPLjava/lang/String;->toLowerCase()Ljava/lang/String;
@@ -2462,13 +2375,13 @@
 HSPLjava/lang/String;->toString()Ljava/lang/String;
 HSPLjava/lang/String;->toUpperCase()Ljava/lang/String;
 HSPLjava/lang/String;->toUpperCase(Ljava/util/Locale;)Ljava/lang/String;
-HSPLjava/lang/String;->trim()Ljava/lang/String;+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/lang/String;->trim()Ljava/lang/String;
 HSPLjava/lang/String;->valueOf(C)Ljava/lang/String;
 HSPLjava/lang/String;->valueOf(D)Ljava/lang/String;
 HSPLjava/lang/String;->valueOf(F)Ljava/lang/String;
 HSPLjava/lang/String;->valueOf(I)Ljava/lang/String;
 HSPLjava/lang/String;->valueOf(J)Ljava/lang/String;
-HSPLjava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;+]Ljava/lang/Object;megamorphic_types
+HSPLjava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
 HSPLjava/lang/String;->valueOf(Z)Ljava/lang/String;
 HSPLjava/lang/String;->valueOf([C)Ljava/lang/String;
 HSPLjava/lang/StringBuffer;-><init>()V
@@ -2498,20 +2411,21 @@
 HSPLjava/lang/StringBuilder;-><init>()V
 HSPLjava/lang/StringBuilder;-><init>(I)V
 HSPLjava/lang/StringBuilder;-><init>(Ljava/lang/CharSequence;)V
-HSPLjava/lang/StringBuilder;-><init>(Ljava/lang/String;)V+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
+HSPLjava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
+HSPLjava/lang/StringBuilder;->append(C)Ljava/lang/AbstractStringBuilder;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
 HSPLjava/lang/StringBuilder;->append(C)Ljava/lang/Appendable;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
 HSPLjava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
 HSPLjava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;
 HSPLjava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
 HSPLjava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
 HSPLjava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
-HSPLjava/lang/StringBuilder;->append(Ljava/lang/CharSequence;)Ljava/lang/Appendable;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
+HSPLjava/lang/StringBuilder;->append(Ljava/lang/CharSequence;)Ljava/lang/Appendable;
 HSPLjava/lang/StringBuilder;->append(Ljava/lang/CharSequence;)Ljava/lang/StringBuilder;
 HSPLjava/lang/StringBuilder;->append(Ljava/lang/CharSequence;II)Ljava/lang/AbstractStringBuilder;
-HSPLjava/lang/StringBuilder;->append(Ljava/lang/CharSequence;II)Ljava/lang/Appendable;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
+HSPLjava/lang/StringBuilder;->append(Ljava/lang/CharSequence;II)Ljava/lang/Appendable;
 HSPLjava/lang/StringBuilder;->append(Ljava/lang/CharSequence;II)Ljava/lang/StringBuilder;
 HSPLjava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
-HSPLjava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/AbstractStringBuilder;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
+HSPLjava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/AbstractStringBuilder;
 HSPLjava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
 HSPLjava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
 HSPLjava/lang/StringBuilder;->append([C)Ljava/lang/StringBuilder;
@@ -2543,7 +2457,7 @@
 HSPLjava/lang/StringFactory;->newStringFromBytes([BI)Ljava/lang/String;
 HSPLjava/lang/StringFactory;->newStringFromBytes([BII)Ljava/lang/String;
 HSPLjava/lang/StringFactory;->newStringFromBytes([BIILjava/lang/String;)Ljava/lang/String;
-HSPLjava/lang/StringFactory;->newStringFromBytes([BIILjava/nio/charset/Charset;)Ljava/lang/String;+]Ljava/nio/charset/Charset;Lcom/android/icu/charset/CharsetICU;
+HSPLjava/lang/StringFactory;->newStringFromBytes([BIILjava/nio/charset/Charset;)Ljava/lang/String;
 HSPLjava/lang/StringFactory;->newStringFromBytes([BLjava/lang/String;)Ljava/lang/String;
 HSPLjava/lang/StringFactory;->newStringFromBytes([BLjava/nio/charset/Charset;)Ljava/lang/String;
 HSPLjava/lang/StringFactory;->newStringFromChars([C)Ljava/lang/String;
@@ -2575,7 +2489,7 @@
 HSPLjava/lang/System;->clearProperty(Ljava/lang/String;)Ljava/lang/String;
 HSPLjava/lang/System;->gc()V
 HSPLjava/lang/System;->getProperties()Ljava/util/Properties;
-HSPLjava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;+]Ljava/util/Properties;Ljava/lang/System$PropertiesWithNonOverrideableDefaults;
+HSPLjava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;
 HSPLjava/lang/System;->getProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
 HSPLjava/lang/System;->getSecurityManager()Ljava/lang/SecurityManager;
 HSPLjava/lang/System;->getenv(Ljava/lang/String;)Ljava/lang/String;
@@ -2596,7 +2510,7 @@
 HSPLjava/lang/Thread;-><init>(Ljava/lang/String;)V
 HSPLjava/lang/Thread;-><init>(Ljava/lang/ThreadGroup;Ljava/lang/Runnable;Ljava/lang/String;)V
 HSPLjava/lang/Thread;-><init>(Ljava/lang/ThreadGroup;Ljava/lang/Runnable;Ljava/lang/String;J)V
-HSPLjava/lang/Thread;-><init>(Ljava/lang/ThreadGroup;Ljava/lang/Runnable;Ljava/lang/String;JLjava/security/AccessControlContext;Z)V+]Ljava/lang/Thread;missing_types]Ljava/lang/ThreadGroup;Ljava/lang/ThreadGroup;
+HSPLjava/lang/Thread;-><init>(Ljava/lang/ThreadGroup;Ljava/lang/Runnable;Ljava/lang/String;JLjava/security/AccessControlContext;Z)V
 HSPLjava/lang/Thread;-><init>(Ljava/lang/ThreadGroup;Ljava/lang/String;)V
 HSPLjava/lang/Thread;-><init>(Ljava/lang/ThreadGroup;Ljava/lang/String;IZ)V
 HSPLjava/lang/Thread;->activeCount()I
@@ -2643,7 +2557,7 @@
 HSPLjava/lang/ThreadGroup;->checkAccess()V
 HSPLjava/lang/ThreadGroup;->checkParentAccess(Ljava/lang/ThreadGroup;)Ljava/lang/Void;
 HSPLjava/lang/ThreadGroup;->enumerate([Ljava/lang/Thread;)I
-HSPLjava/lang/ThreadGroup;->enumerate([Ljava/lang/Thread;IZ)I+]Ljava/lang/Thread;missing_types
+HSPLjava/lang/ThreadGroup;->enumerate([Ljava/lang/Thread;IZ)I
 HSPLjava/lang/ThreadGroup;->enumerate([Ljava/lang/ThreadGroup;)I
 HSPLjava/lang/ThreadGroup;->enumerate([Ljava/lang/ThreadGroup;IZ)I
 HSPLjava/lang/ThreadGroup;->getMaxPriority()I
@@ -2660,13 +2574,13 @@
 HSPLjava/lang/ThreadLocal$ThreadLocalMap;-><init>(Ljava/lang/ThreadLocal;Ljava/lang/Object;)V
 HSPLjava/lang/ThreadLocal$ThreadLocalMap;->cleanSomeSlots(II)Z
 HSPLjava/lang/ThreadLocal$ThreadLocalMap;->expungeStaleEntries()V
-HSPLjava/lang/ThreadLocal$ThreadLocalMap;->expungeStaleEntry(I)I+]Ljava/lang/ThreadLocal$ThreadLocalMap$Entry;Ljava/lang/ThreadLocal$ThreadLocalMap$Entry;
-HSPLjava/lang/ThreadLocal$ThreadLocalMap;->getEntry(Ljava/lang/ThreadLocal;)Ljava/lang/ThreadLocal$ThreadLocalMap$Entry;
+HSPLjava/lang/ThreadLocal$ThreadLocalMap;->expungeStaleEntry(I)I
+HSPLjava/lang/ThreadLocal$ThreadLocalMap;->getEntry(Ljava/lang/ThreadLocal;)Ljava/lang/ThreadLocal$ThreadLocalMap$Entry;+]Ljava/lang/ThreadLocal$ThreadLocalMap$Entry;Ljava/lang/ThreadLocal$ThreadLocalMap$Entry;
 HSPLjava/lang/ThreadLocal$ThreadLocalMap;->getEntryAfterMiss(Ljava/lang/ThreadLocal;ILjava/lang/ThreadLocal$ThreadLocalMap$Entry;)Ljava/lang/ThreadLocal$ThreadLocalMap$Entry;
 HSPLjava/lang/ThreadLocal$ThreadLocalMap;->nextIndex(II)I
 HSPLjava/lang/ThreadLocal$ThreadLocalMap;->prevIndex(II)I
 HSPLjava/lang/ThreadLocal$ThreadLocalMap;->rehash()V
-HSPLjava/lang/ThreadLocal$ThreadLocalMap;->remove(Ljava/lang/ThreadLocal;)V+]Ljava/lang/ThreadLocal$ThreadLocalMap$Entry;Ljava/lang/ThreadLocal$ThreadLocalMap$Entry;
+HSPLjava/lang/ThreadLocal$ThreadLocalMap;->remove(Ljava/lang/ThreadLocal;)V
 HSPLjava/lang/ThreadLocal$ThreadLocalMap;->replaceStaleEntry(Ljava/lang/ThreadLocal;Ljava/lang/Object;I)V
 HSPLjava/lang/ThreadLocal$ThreadLocalMap;->resize()V
 HSPLjava/lang/ThreadLocal$ThreadLocalMap;->set(Ljava/lang/ThreadLocal;Ljava/lang/Object;)V
@@ -2675,13 +2589,13 @@
 HSPLjava/lang/ThreadLocal;-><init>()V
 HSPLjava/lang/ThreadLocal;->createInheritedMap(Ljava/lang/ThreadLocal$ThreadLocalMap;)Ljava/lang/ThreadLocal$ThreadLocalMap;
 HSPLjava/lang/ThreadLocal;->createMap(Ljava/lang/Thread;Ljava/lang/Object;)V
-HSPLjava/lang/ThreadLocal;->get()Ljava/lang/Object;+]Ljava/lang/ThreadLocal;megamorphic_types
+HSPLjava/lang/ThreadLocal;->get()Ljava/lang/Object;+]Ljava/lang/ThreadLocal;missing_types
 HSPLjava/lang/ThreadLocal;->getMap(Ljava/lang/Thread;)Ljava/lang/ThreadLocal$ThreadLocalMap;
 HSPLjava/lang/ThreadLocal;->initialValue()Ljava/lang/Object;
 HSPLjava/lang/ThreadLocal;->nextHashCode()I
-HSPLjava/lang/ThreadLocal;->remove()V+]Ljava/lang/ThreadLocal;Ljava/util/concurrent/locks/ReentrantReadWriteLock$Sync$ThreadLocalHoldCounter;,Ljava/lang/ThreadLocal;
-HSPLjava/lang/ThreadLocal;->set(Ljava/lang/Object;)V+]Ljava/lang/ThreadLocal;missing_types
-HSPLjava/lang/ThreadLocal;->setInitialValue()Ljava/lang/Object;+]Ljava/lang/ThreadLocal;missing_types
+HSPLjava/lang/ThreadLocal;->remove()V
+HSPLjava/lang/ThreadLocal;->set(Ljava/lang/Object;)V
+HSPLjava/lang/ThreadLocal;->setInitialValue()Ljava/lang/Object;
 HSPLjava/lang/ThreadLocal;->withInitial(Ljava/util/function/Supplier;)Ljava/lang/ThreadLocal;
 HSPLjava/lang/Throwable$PrintStreamOrWriter;-><init>()V
 HSPLjava/lang/Throwable$PrintStreamOrWriter;-><init>(Ljava/lang/Throwable$PrintStreamOrWriter-IA;)V
@@ -2690,9 +2604,9 @@
 HSPLjava/lang/Throwable$WrappedPrintStream;->println(Ljava/lang/Object;)V
 HSPLjava/lang/Throwable$WrappedPrintWriter;-><init>(Ljava/io/PrintWriter;)V
 HSPLjava/lang/Throwable$WrappedPrintWriter;->lock()Ljava/lang/Object;
-HSPLjava/lang/Throwable$WrappedPrintWriter;->println(Ljava/lang/Object;)V+]Ljava/io/PrintWriter;Lcom/android/internal/util/LineBreakBufferedWriter;,Lcom/android/internal/util/FastPrintWriter;,Ljava/io/PrintWriter;
-HSPLjava/lang/Throwable;-><init>()V+]Ljava/lang/Throwable;missing_types
-HSPLjava/lang/Throwable;-><init>(Ljava/lang/String;)V+]Ljava/lang/Throwable;missing_types
+HSPLjava/lang/Throwable$WrappedPrintWriter;->println(Ljava/lang/Object;)V
+HSPLjava/lang/Throwable;-><init>()V
+HSPLjava/lang/Throwable;-><init>(Ljava/lang/String;)V
 HSPLjava/lang/Throwable;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
 HSPLjava/lang/Throwable;-><init>(Ljava/lang/String;Ljava/lang/Throwable;ZZ)V
 HSPLjava/lang/Throwable;-><init>(Ljava/lang/Throwable;)V
@@ -2709,10 +2623,10 @@
 HSPLjava/lang/Throwable;->printStackTrace()V
 HSPLjava/lang/Throwable;->printStackTrace(Ljava/io/PrintStream;)V
 HSPLjava/lang/Throwable;->printStackTrace(Ljava/io/PrintWriter;)V
-HSPLjava/lang/Throwable;->printStackTrace(Ljava/lang/Throwable$PrintStreamOrWriter;)V+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/lang/Throwable$PrintStreamOrWriter;Ljava/lang/Throwable$WrappedPrintWriter;]Ljava/lang/Throwable;missing_types]Ljava/util/Set;Ljava/util/Collections$SetFromMap;
+HSPLjava/lang/Throwable;->printStackTrace(Ljava/lang/Throwable$PrintStreamOrWriter;)V
 HSPLjava/lang/Throwable;->readObject(Ljava/io/ObjectInputStream;)V
 HSPLjava/lang/Throwable;->setStackTrace([Ljava/lang/StackTraceElement;)V
-HSPLjava/lang/Throwable;->toString()Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/lang/Object;missing_types]Ljava/lang/Throwable;missing_types]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/lang/Throwable;->toString()Ljava/lang/String;
 HSPLjava/lang/Throwable;->writeObject(Ljava/io/ObjectOutputStream;)V
 HSPLjava/lang/UNIXProcess$2;-><init>(Ljava/lang/UNIXProcess;[I)V
 HSPLjava/lang/UNIXProcess$2;->run()Ljava/lang/Object;
@@ -2738,7 +2652,7 @@
 HSPLjava/lang/UnsupportedOperationException;-><init>()V
 HSPLjava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V
 HSPLjava/lang/VMClassLoader;->getResource(Ljava/lang/String;)Ljava/net/URL;
-HSPLjava/lang/VMClassLoader;->getResources(Ljava/lang/String;)Ljava/util/List;+]Llibcore/io/ClassPathURLStreamHandler;Llibcore/io/ClassPathURLStreamHandler;
+HSPLjava/lang/VMClassLoader;->getResources(Ljava/lang/String;)Ljava/util/List;
 HSPLjava/lang/invoke/FieldVarHandle;-><init>(Ljava/lang/reflect/Field;Ljava/lang/Class;)V
 HSPLjava/lang/invoke/FieldVarHandle;->create(Ljava/lang/reflect/Field;)Ljava/lang/invoke/FieldVarHandle;
 HSPLjava/lang/invoke/MethodHandle;-><init>(JILjava/lang/invoke/MethodType;)V
@@ -2814,8 +2728,8 @@
 HSPLjava/lang/ref/Reference;->refersTo(Ljava/lang/Object;)Z
 HSPLjava/lang/ref/ReferenceQueue;-><init>()V
 HSPLjava/lang/ref/ReferenceQueue;->add(Ljava/lang/ref/Reference;)V
-HSPLjava/lang/ref/ReferenceQueue;->enqueueLocked(Ljava/lang/ref/Reference;)Z+]Lsun/misc/Cleaner;Lsun/misc/Cleaner;
-HSPLjava/lang/ref/ReferenceQueue;->enqueuePending(Ljava/lang/ref/Reference;Ljava/util/concurrent/atomic/AtomicInteger;)V+]Ljava/lang/Object;Ljava/lang/Object;]Ljava/util/concurrent/atomic/AtomicInteger;Ljava/util/concurrent/atomic/AtomicInteger;
+HSPLjava/lang/ref/ReferenceQueue;->enqueueLocked(Ljava/lang/ref/Reference;)Z
+HSPLjava/lang/ref/ReferenceQueue;->enqueuePending(Ljava/lang/ref/Reference;Ljava/util/concurrent/atomic/AtomicInteger;)V
 HSPLjava/lang/ref/ReferenceQueue;->poll()Ljava/lang/ref/Reference;
 HSPLjava/lang/ref/ReferenceQueue;->reallyPollLocked()Ljava/lang/ref/Reference;
 HSPLjava/lang/ref/ReferenceQueue;->remove()Ljava/lang/ref/Reference;
@@ -2829,10 +2743,10 @@
 HSPLjava/lang/reflect/AccessibleObject;->getAnnotations()[Ljava/lang/annotation/Annotation;
 HSPLjava/lang/reflect/AccessibleObject;->isAccessible()Z
 HSPLjava/lang/reflect/AccessibleObject;->setAccessible(Z)V
-HSPLjava/lang/reflect/AccessibleObject;->setAccessible0(Ljava/lang/reflect/AccessibleObject;Z)V+]Ljava/lang/reflect/Constructor;Ljava/lang/reflect/Constructor;
+HSPLjava/lang/reflect/AccessibleObject;->setAccessible0(Ljava/lang/reflect/AccessibleObject;Z)V
 HSPLjava/lang/reflect/Array;->get(Ljava/lang/Object;I)Ljava/lang/Object;
 HSPLjava/lang/reflect/Array;->getLength(Ljava/lang/Object;)I
-HSPLjava/lang/reflect/Array;->newArray(Ljava/lang/Class;I)Ljava/lang/Object;+]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/lang/reflect/Array;->newArray(Ljava/lang/Class;I)Ljava/lang/Object;
 HSPLjava/lang/reflect/Array;->newInstance(Ljava/lang/Class;I)Ljava/lang/Object;
 HSPLjava/lang/reflect/Array;->newInstance(Ljava/lang/Class;[I)Ljava/lang/Object;
 HSPLjava/lang/reflect/Array;->set(Ljava/lang/Object;ILjava/lang/Object;)V
@@ -2872,32 +2786,32 @@
 HSPLjava/lang/reflect/Executable;->sharedToString(IZ[Ljava/lang/Class;[Ljava/lang/Class;)Ljava/lang/String;
 HSPLjava/lang/reflect/Field;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;
 HSPLjava/lang/reflect/Field;->getDeclaringClass()Ljava/lang/Class;
-HSPLjava/lang/reflect/Field;->getGenericType()Ljava/lang/reflect/Type;+]Ljava/lang/reflect/Field;Ljava/lang/reflect/Field;]Ljava/lang/Class;Ljava/lang/Class;]Llibcore/reflect/GenericSignatureParser;Llibcore/reflect/GenericSignatureParser;
+HSPLjava/lang/reflect/Field;->getGenericType()Ljava/lang/reflect/Type;
 HSPLjava/lang/reflect/Field;->getModifiers()I
-HSPLjava/lang/reflect/Field;->getName()Ljava/lang/String;+]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/lang/reflect/Field;->getName()Ljava/lang/String;
 HSPLjava/lang/reflect/Field;->getOffset()I
-HSPLjava/lang/reflect/Field;->getSignatureAttribute()Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
+HSPLjava/lang/reflect/Field;->getSignatureAttribute()Ljava/lang/String;
 HSPLjava/lang/reflect/Field;->getType()Ljava/lang/Class;
 HSPLjava/lang/reflect/Field;->hashCode()I
 HSPLjava/lang/reflect/Field;->isAnnotationPresent(Ljava/lang/Class;)Z
 HSPLjava/lang/reflect/Field;->isEnumConstant()Z
-HSPLjava/lang/reflect/Field;->isSynthetic()Z+]Ljava/lang/reflect/Field;Ljava/lang/reflect/Field;
+HSPLjava/lang/reflect/Field;->isSynthetic()Z
 HSPLjava/lang/reflect/InvocationTargetException;-><init>(Ljava/lang/Throwable;)V
 HSPLjava/lang/reflect/InvocationTargetException;->getCause()Ljava/lang/Throwable;
 HSPLjava/lang/reflect/Method$1;->compare(Ljava/lang/Object;Ljava/lang/Object;)I
 HSPLjava/lang/reflect/Method$1;->compare(Ljava/lang/reflect/Method;Ljava/lang/reflect/Method;)I
 HSPLjava/lang/reflect/Method;->equalNameAndParameters(Ljava/lang/reflect/Method;)Z
-HSPLjava/lang/reflect/Method;->equals(Ljava/lang/Object;)Z+]Ljava/lang/Object;Ljava/lang/Class;]Ljava/lang/reflect/Method;Ljava/lang/reflect/Method;
+HSPLjava/lang/reflect/Method;->equals(Ljava/lang/Object;)Z
 HSPLjava/lang/reflect/Method;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;
 HSPLjava/lang/reflect/Method;->getDeclaredAnnotations()[Ljava/lang/annotation/Annotation;
 HSPLjava/lang/reflect/Method;->getDeclaringClass()Ljava/lang/Class;
 HSPLjava/lang/reflect/Method;->getGenericParameterTypes()[Ljava/lang/reflect/Type;
 HSPLjava/lang/reflect/Method;->getGenericReturnType()Ljava/lang/reflect/Type;
 HSPLjava/lang/reflect/Method;->getModifiers()I
-HSPLjava/lang/reflect/Method;->getName()Ljava/lang/String;+]Ljava/lang/reflect/Method;Ljava/lang/reflect/Method;
+HSPLjava/lang/reflect/Method;->getName()Ljava/lang/String;
 HSPLjava/lang/reflect/Method;->getParameterAnnotations()[[Ljava/lang/annotation/Annotation;
 HSPLjava/lang/reflect/Method;->getParameterTypes()[Ljava/lang/Class;
-HSPLjava/lang/reflect/Method;->getReturnType()Ljava/lang/Class;+]Ljava/lang/reflect/Method;Ljava/lang/reflect/Method;
+HSPLjava/lang/reflect/Method;->getReturnType()Ljava/lang/Class;
 HSPLjava/lang/reflect/Method;->hashCode()I
 HSPLjava/lang/reflect/Method;->isBridge()Z
 HSPLjava/lang/reflect/Method;->isDefault()Z
@@ -2936,9 +2850,9 @@
 HSPLjava/lang/reflect/Proxy;->getMethodsRecursive([Ljava/lang/Class;Ljava/util/List;)V
 HSPLjava/lang/reflect/Proxy;->getProxyClass0(Ljava/lang/ClassLoader;[Ljava/lang/Class;)Ljava/lang/Class;
 HSPLjava/lang/reflect/Proxy;->intersectExceptions([Ljava/lang/Class;[Ljava/lang/Class;)[Ljava/lang/Class;
-HSPLjava/lang/reflect/Proxy;->invoke(Ljava/lang/reflect/Proxy;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/lang/reflect/InvocationHandler;Llibcore/reflect/AnnotationFactory;
+HSPLjava/lang/reflect/Proxy;->invoke(Ljava/lang/reflect/Proxy;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/lang/reflect/Proxy;->isProxyClass(Ljava/lang/Class;)Z
-HSPLjava/lang/reflect/Proxy;->newProxyInstance(Ljava/lang/ClassLoader;[Ljava/lang/Class;Ljava/lang/reflect/InvocationHandler;)Ljava/lang/Object;+][Ljava/lang/Class;[Ljava/lang/Class;]Ljava/lang/Class;Ljava/lang/Class;]Ljava/lang/reflect/Constructor;Ljava/lang/reflect/Constructor;
+HSPLjava/lang/reflect/Proxy;->newProxyInstance(Ljava/lang/ClassLoader;[Ljava/lang/Class;Ljava/lang/reflect/InvocationHandler;)Ljava/lang/Object;
 HSPLjava/lang/reflect/Proxy;->validateReturnTypes(Ljava/util/List;)V
 HSPLjava/lang/reflect/WeakCache$CacheKey;-><init>(Ljava/lang/Object;Ljava/lang/ref/ReferenceQueue;)V
 HSPLjava/lang/reflect/WeakCache$CacheKey;->equals(Ljava/lang/Object;)Z
@@ -2951,7 +2865,7 @@
 HSPLjava/lang/reflect/WeakCache;->-$$Nest$fgetreverseMap(Ljava/lang/reflect/WeakCache;)Ljava/util/concurrent/ConcurrentMap;
 HSPLjava/lang/reflect/WeakCache;->-$$Nest$fgetvalueFactory(Ljava/lang/reflect/WeakCache;)Ljava/util/function/BiFunction;
 HSPLjava/lang/reflect/WeakCache;->expungeStaleEntries()V
-HSPLjava/lang/reflect/WeakCache;->get(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/util/function/BiFunction;Ljava/lang/reflect/Proxy$KeyFactory;]Ljava/util/concurrent/ConcurrentMap;Ljava/util/concurrent/ConcurrentHashMap;]Ljava/util/function/Supplier;Ljava/lang/reflect/WeakCache$CacheValue;
+HSPLjava/lang/reflect/WeakCache;->get(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/math/BigDecimal;-><init>(I)V
 HSPLjava/math/BigDecimal;-><init>(J)V
 HSPLjava/math/BigDecimal;-><init>(Ljava/lang/String;)V
@@ -3167,7 +3081,7 @@
 HSPLjava/net/DatagramSocket;->getImpl()Ljava/net/DatagramSocketImpl;
 HSPLjava/net/DatagramSocket;->isBound()Z
 HSPLjava/net/DatagramSocket;->isClosed()Z
-HSPLjava/net/DatagramSocket;->receive(Ljava/net/DatagramPacket;)V+]Ljava/net/DatagramSocket;Ljava/net/DatagramSocket;,Ljava/net/MulticastSocket;]Ljava/net/DatagramSocketImpl;Ljava/net/PlainDatagramSocketImpl;
+HSPLjava/net/DatagramSocket;->receive(Ljava/net/DatagramPacket;)V
 HSPLjava/net/DatagramSocket;->send(Ljava/net/DatagramPacket;)V
 HSPLjava/net/DatagramSocket;->setReuseAddress(Z)V
 HSPLjava/net/DatagramSocket;->setSoTimeout(I)V
@@ -3330,7 +3244,7 @@
 HSPLjava/net/PlainDatagramSocketImpl;->bind0(ILjava/net/InetAddress;)V
 HSPLjava/net/PlainDatagramSocketImpl;->datagramSocketClose()V
 HSPLjava/net/PlainDatagramSocketImpl;->datagramSocketCreate()V
-HSPLjava/net/PlainDatagramSocketImpl;->doRecv(Ljava/net/DatagramPacket;I)V+]Ljava/net/DatagramPacket;Ljava/net/DatagramPacket;]Ljava/net/PlainDatagramSocketImpl;Ljava/net/PlainDatagramSocketImpl;
+HSPLjava/net/PlainDatagramSocketImpl;->doRecv(Ljava/net/DatagramPacket;I)V
 HSPLjava/net/PlainDatagramSocketImpl;->receive0(Ljava/net/DatagramPacket;)V
 HSPLjava/net/PlainDatagramSocketImpl;->send(Ljava/net/DatagramPacket;)V
 HSPLjava/net/PlainDatagramSocketImpl;->socketSetOption(ILjava/lang/Object;)V
@@ -3546,29 +3460,28 @@
 HSPLjava/net/URLConnection;->setReadTimeout(I)V
 HSPLjava/net/URLConnection;->setUseCaches(Z)V
 HSPLjava/net/URLDecoder;->decode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
-HSPLjava/net/URLDecoder;->decode(Ljava/lang/String;Ljava/nio/charset/Charset;)Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
+HSPLjava/net/URLDecoder;->decode(Ljava/lang/String;Ljava/nio/charset/Charset;)Ljava/lang/String;
 HSPLjava/net/URLDecoder;->isValidHexChar(C)Z
 HSPLjava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
-HSPLjava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/nio/charset/Charset;)Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/lang/String;Ljava/lang/String;]Ljava/util/BitSet;Ljava/util/BitSet;]Ljava/io/CharArrayWriter;Ljava/io/CharArrayWriter;
+HSPLjava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/nio/charset/Charset;)Ljava/lang/String;
 HSPLjava/net/URLStreamHandler;-><init>()V
-HSPLjava/net/URLStreamHandler;->parseURL(Ljava/net/URL;Ljava/lang/String;II)V+]Ljava/net/URLStreamHandler;Lcom/android/okhttp/HttpsHandler;]Ljava/lang/String;Ljava/lang/String;]Ljava/net/URL;Ljava/net/URL;
+HSPLjava/net/URLStreamHandler;->parseURL(Ljava/net/URL;Ljava/lang/String;II)V
 HSPLjava/net/URLStreamHandler;->setURL(Ljava/net/URL;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
 HSPLjava/net/URLStreamHandler;->toExternalForm(Ljava/net/URL;)Ljava/lang/String;
 HSPLjava/net/UnknownHostException;-><init>(Ljava/lang/String;)V
-HSPLjava/nio/Bits;->byteOrder()Ljava/nio/ByteOrder;
 HSPLjava/nio/Bits;->char0(C)B
 HSPLjava/nio/Bits;->char1(C)B
 HSPLjava/nio/Bits;->getFloat(Ljava/nio/ByteBuffer;IZ)F
 HSPLjava/nio/Bits;->getFloatL(Ljava/nio/ByteBuffer;I)F
 HSPLjava/nio/Bits;->getInt(Ljava/nio/ByteBuffer;IZ)I
-HSPLjava/nio/Bits;->getIntB(Ljava/nio/ByteBuffer;I)I+]Ljava/nio/ByteBuffer;Ljava/nio/HeapByteBuffer;
+HSPLjava/nio/Bits;->getIntB(Ljava/nio/ByteBuffer;I)I
 HSPLjava/nio/Bits;->getIntL(Ljava/nio/ByteBuffer;I)I
 HSPLjava/nio/Bits;->getLong(Ljava/nio/ByteBuffer;IZ)J
 HSPLjava/nio/Bits;->getLongB(Ljava/nio/ByteBuffer;I)J
 HSPLjava/nio/Bits;->getLongL(Ljava/nio/ByteBuffer;I)J
 HSPLjava/nio/Bits;->getShort(Ljava/nio/ByteBuffer;IZ)S
 HSPLjava/nio/Bits;->getShortB(Ljava/nio/ByteBuffer;I)S
-HSPLjava/nio/Bits;->getShortL(Ljava/nio/ByteBuffer;I)S
+HSPLjava/nio/Bits;->getShortL(Ljava/nio/ByteBuffer;I)S+]Ljava/nio/ByteBuffer;Ljava/nio/HeapByteBuffer;
 HSPLjava/nio/Bits;->int0(I)B
 HSPLjava/nio/Bits;->int1(I)B
 HSPLjava/nio/Bits;->int2(I)B
@@ -3584,7 +3497,6 @@
 HSPLjava/nio/Bits;->makeInt(BBBB)I
 HSPLjava/nio/Bits;->makeLong(BBBBBBBB)J
 HSPLjava/nio/Bits;->makeShort(BB)S
-HSPLjava/nio/Bits;->pageCount(J)I
 HSPLjava/nio/Bits;->pageSize()I
 HSPLjava/nio/Bits;->putChar(Ljava/nio/ByteBuffer;ICZ)V
 HSPLjava/nio/Bits;->putCharB(Ljava/nio/ByteBuffer;IC)V
@@ -3598,11 +3510,10 @@
 HSPLjava/nio/Bits;->putLongL(Ljava/nio/ByteBuffer;IJ)V
 HSPLjava/nio/Bits;->putShort(Ljava/nio/ByteBuffer;ISZ)V
 HSPLjava/nio/Bits;->putShortB(Ljava/nio/ByteBuffer;IS)V
-HSPLjava/nio/Bits;->putShortL(Ljava/nio/ByteBuffer;IS)V
+HSPLjava/nio/Bits;->putShortL(Ljava/nio/ByteBuffer;IS)V+]Ljava/nio/ByteBuffer;Ljava/nio/HeapByteBuffer;
 HSPLjava/nio/Bits;->short0(S)B
 HSPLjava/nio/Bits;->short1(S)B
-HSPLjava/nio/Bits;->unsafe()Lsun/misc/Unsafe;
-HSPLjava/nio/Buffer;-><init>(IIIII)V+]Ljava/nio/Buffer;megamorphic_types
+HSPLjava/nio/Buffer;-><init>(IIIII)V
 HSPLjava/nio/Buffer;->capacity()I
 HSPLjava/nio/Buffer;->checkBounds(III)V
 HSPLjava/nio/Buffer;->checkIndex(I)I
@@ -3635,7 +3546,6 @@
 HSPLjava/nio/ByteBuffer;->compare(BB)I
 HSPLjava/nio/ByteBuffer;->compareTo(Ljava/lang/Object;)I
 HSPLjava/nio/ByteBuffer;->compareTo(Ljava/nio/ByteBuffer;)I
-HSPLjava/nio/ByteBuffer;->equals(BB)Z
 HSPLjava/nio/ByteBuffer;->equals(Ljava/lang/Object;)Z
 HSPLjava/nio/ByteBuffer;->flip()Ljava/nio/Buffer;
 HSPLjava/nio/ByteBuffer;->get([B)Ljava/nio/ByteBuffer;
@@ -3654,7 +3564,7 @@
 HSPLjava/nio/ByteBuffer;->wrap([BII)Ljava/nio/ByteBuffer;
 HSPLjava/nio/ByteBufferAsCharBuffer;-><init>(Ljava/nio/ByteBuffer;IIIIILjava/nio/ByteOrder;)V
 HSPLjava/nio/ByteBufferAsCharBuffer;->duplicate()Ljava/nio/CharBuffer;
-HSPLjava/nio/ByteBufferAsCharBuffer;->get(I)C+]Ljava/nio/ByteBuffer;Ljava/nio/DirectByteBuffer;]Ljava/nio/ByteBufferAsCharBuffer;Ljava/nio/ByteBufferAsCharBuffer;
+HSPLjava/nio/ByteBufferAsCharBuffer;->get(I)C
 HSPLjava/nio/ByteBufferAsCharBuffer;->get([CII)Ljava/nio/CharBuffer;
 HSPLjava/nio/ByteBufferAsCharBuffer;->isDirect()Z
 HSPLjava/nio/ByteBufferAsCharBuffer;->ix(I)I
@@ -3684,7 +3594,7 @@
 HSPLjava/nio/CharBuffer;->allocate(I)Ljava/nio/CharBuffer;
 HSPLjava/nio/CharBuffer;->array()[C
 HSPLjava/nio/CharBuffer;->arrayOffset()I
-HSPLjava/nio/CharBuffer;->charAt(I)C+]Ljava/nio/CharBuffer;Ljava/nio/HeapCharBuffer;,Ljava/nio/ByteBufferAsCharBuffer;
+HSPLjava/nio/CharBuffer;->charAt(I)C
 HSPLjava/nio/CharBuffer;->clear()Ljava/nio/Buffer;
 HSPLjava/nio/CharBuffer;->flip()Ljava/nio/Buffer;
 HSPLjava/nio/CharBuffer;->get([C)Ljava/nio/CharBuffer;
@@ -3709,15 +3619,15 @@
 HSPLjava/nio/DirectByteBuffer;->asCharBuffer()Ljava/nio/CharBuffer;
 HSPLjava/nio/DirectByteBuffer;->asFloatBuffer()Ljava/nio/FloatBuffer;
 HSPLjava/nio/DirectByteBuffer;->asIntBuffer()Ljava/nio/IntBuffer;
-HSPLjava/nio/DirectByteBuffer;->asReadOnlyBuffer()Ljava/nio/ByteBuffer;+]Ljava/nio/DirectByteBuffer;Ljava/nio/DirectByteBuffer;
+HSPLjava/nio/DirectByteBuffer;->asReadOnlyBuffer()Ljava/nio/ByteBuffer;
 HSPLjava/nio/DirectByteBuffer;->asShortBuffer()Ljava/nio/ShortBuffer;
 HSPLjava/nio/DirectByteBuffer;->cleaner()Lsun/misc/Cleaner;
 HSPLjava/nio/DirectByteBuffer;->duplicate()Ljava/nio/ByteBuffer;
 HSPLjava/nio/DirectByteBuffer;->duplicate()Ljava/nio/MappedByteBuffer;
 HSPLjava/nio/DirectByteBuffer;->get()B
-HSPLjava/nio/DirectByteBuffer;->get(I)B
+HSPLjava/nio/DirectByteBuffer;->get(I)B+]Ljava/nio/DirectByteBuffer;Ljava/nio/DirectByteBuffer;
 HSPLjava/nio/DirectByteBuffer;->get(J)B
-HSPLjava/nio/DirectByteBuffer;->get([BII)Ljava/nio/ByteBuffer;+]Ljava/nio/DirectByteBuffer;Ljava/nio/DirectByteBuffer;
+HSPLjava/nio/DirectByteBuffer;->get([BII)Ljava/nio/ByteBuffer;
 HSPLjava/nio/DirectByteBuffer;->getChar()C
 HSPLjava/nio/DirectByteBuffer;->getChar(I)C
 HSPLjava/nio/DirectByteBuffer;->getCharUnchecked(I)C
@@ -3739,7 +3649,7 @@
 HSPLjava/nio/DirectByteBuffer;->put(IB)Ljava/nio/ByteBuffer;
 HSPLjava/nio/DirectByteBuffer;->put(JB)Ljava/nio/ByteBuffer;
 HSPLjava/nio/DirectByteBuffer;->put(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;
-HSPLjava/nio/DirectByteBuffer;->put([BII)Ljava/nio/ByteBuffer;+]Ljava/nio/DirectByteBuffer;Ljava/nio/DirectByteBuffer;
+HSPLjava/nio/DirectByteBuffer;->put([BII)Ljava/nio/ByteBuffer;
 HSPLjava/nio/DirectByteBuffer;->putDouble(JD)Ljava/nio/ByteBuffer;
 HSPLjava/nio/DirectByteBuffer;->putFloat(JF)Ljava/nio/ByteBuffer;
 HSPLjava/nio/DirectByteBuffer;->putFloatUnchecked(IF)V
@@ -3771,24 +3681,24 @@
 HSPLjava/nio/HeapByteBuffer;->asShortBuffer()Ljava/nio/ShortBuffer;
 HSPLjava/nio/HeapByteBuffer;->compact()Ljava/nio/ByteBuffer;
 HSPLjava/nio/HeapByteBuffer;->duplicate()Ljava/nio/ByteBuffer;
-HSPLjava/nio/HeapByteBuffer;->get()B+]Ljava/nio/HeapByteBuffer;Ljava/nio/HeapByteBuffer;
-HSPLjava/nio/HeapByteBuffer;->get(I)B
-HSPLjava/nio/HeapByteBuffer;->get([BII)Ljava/nio/ByteBuffer;+]Ljava/nio/HeapByteBuffer;Ljava/nio/HeapByteBuffer;
+HSPLjava/nio/HeapByteBuffer;->get()B
+HSPLjava/nio/HeapByteBuffer;->get(I)B+]Ljava/nio/HeapByteBuffer;Ljava/nio/HeapByteBuffer;
+HSPLjava/nio/HeapByteBuffer;->get([BII)Ljava/nio/ByteBuffer;
 HSPLjava/nio/HeapByteBuffer;->getFloat()F
 HSPLjava/nio/HeapByteBuffer;->getFloat(I)F
-HSPLjava/nio/HeapByteBuffer;->getInt()I+]Ljava/nio/HeapByteBuffer;Ljava/nio/HeapByteBuffer;
+HSPLjava/nio/HeapByteBuffer;->getInt()I
 HSPLjava/nio/HeapByteBuffer;->getInt(I)I
 HSPLjava/nio/HeapByteBuffer;->getLong()J
 HSPLjava/nio/HeapByteBuffer;->getLong(I)J
 HSPLjava/nio/HeapByteBuffer;->getShort()S
-HSPLjava/nio/HeapByteBuffer;->getShort(I)S
+HSPLjava/nio/HeapByteBuffer;->getShort(I)S+]Ljava/nio/HeapByteBuffer;Ljava/nio/HeapByteBuffer;
 HSPLjava/nio/HeapByteBuffer;->getUnchecked(I[III)V
 HSPLjava/nio/HeapByteBuffer;->getUnchecked(I[SII)V
 HSPLjava/nio/HeapByteBuffer;->isDirect()Z
 HSPLjava/nio/HeapByteBuffer;->isReadOnly()Z
 HSPLjava/nio/HeapByteBuffer;->ix(I)I
 HSPLjava/nio/HeapByteBuffer;->put(B)Ljava/nio/ByteBuffer;
-HSPLjava/nio/HeapByteBuffer;->put(IB)Ljava/nio/ByteBuffer;
+HSPLjava/nio/HeapByteBuffer;->put(IB)Ljava/nio/ByteBuffer;+]Ljava/nio/HeapByteBuffer;Ljava/nio/HeapByteBuffer;
 HSPLjava/nio/HeapByteBuffer;->put([BII)Ljava/nio/ByteBuffer;
 HSPLjava/nio/HeapByteBuffer;->putChar(C)Ljava/nio/ByteBuffer;
 HSPLjava/nio/HeapByteBuffer;->putFloat(F)Ljava/nio/ByteBuffer;
@@ -3796,7 +3706,7 @@
 HSPLjava/nio/HeapByteBuffer;->putInt(II)Ljava/nio/ByteBuffer;
 HSPLjava/nio/HeapByteBuffer;->putLong(IJ)Ljava/nio/ByteBuffer;
 HSPLjava/nio/HeapByteBuffer;->putLong(J)Ljava/nio/ByteBuffer;
-HSPLjava/nio/HeapByteBuffer;->putShort(IS)Ljava/nio/ByteBuffer;
+HSPLjava/nio/HeapByteBuffer;->putShort(IS)Ljava/nio/ByteBuffer;+]Ljava/nio/HeapByteBuffer;Ljava/nio/HeapByteBuffer;
 HSPLjava/nio/HeapByteBuffer;->putShort(S)Ljava/nio/ByteBuffer;
 HSPLjava/nio/HeapByteBuffer;->slice()Ljava/nio/ByteBuffer;
 HSPLjava/nio/HeapCharBuffer;-><init>(II)V
@@ -3826,16 +3736,15 @@
 HSPLjava/nio/LongBuffer;->limit(I)Ljava/nio/Buffer;
 HSPLjava/nio/LongBuffer;->position(I)Ljava/nio/Buffer;
 HSPLjava/nio/MappedByteBuffer;-><init>(IIII)V
-HSPLjava/nio/MappedByteBuffer;-><init>(IIIILjava/io/FileDescriptor;)V
 HSPLjava/nio/MappedByteBuffer;-><init>(IIII[BI)V
 HSPLjava/nio/MappedByteBuffer;->checkMapped()V
-HSPLjava/nio/MappedByteBuffer;->load()Ljava/nio/MappedByteBuffer;
+HSPLjava/nio/MappedByteBuffer;->load()Ljava/nio/MappedByteBuffer;+]Ljava/nio/MappedByteBuffer;Ljava/nio/DirectByteBuffer;]Lsun/misc/Unsafe;Lsun/misc/Unsafe;
 HSPLjava/nio/MappedByteBuffer;->mappingAddress(J)J
 HSPLjava/nio/MappedByteBuffer;->mappingLength(J)J
 HSPLjava/nio/MappedByteBuffer;->mappingOffset()J
 HSPLjava/nio/NIOAccess;->getBaseArray(Ljava/nio/Buffer;)Ljava/lang/Object;
 HSPLjava/nio/NIOAccess;->getBaseArrayOffset(Ljava/nio/Buffer;)I
-HSPLjava/nio/NioUtils;->freeDirectBuffer(Ljava/nio/ByteBuffer;)V+]Ljava/nio/DirectByteBuffer$MemoryRef;Ljava/nio/DirectByteBuffer$MemoryRef;
+HSPLjava/nio/NioUtils;->freeDirectBuffer(Ljava/nio/ByteBuffer;)V
 HSPLjava/nio/ShortBuffer;-><init>(IIII)V
 HSPLjava/nio/ShortBuffer;-><init>(IIII[SI)V
 HSPLjava/nio/ShortBuffer;->get([S)Ljava/nio/ShortBuffer;
@@ -3874,7 +3783,7 @@
 HSPLjava/nio/channels/spi/AbstractInterruptibleChannel;-><init>()V
 HSPLjava/nio/channels/spi/AbstractInterruptibleChannel;->begin()V
 HSPLjava/nio/channels/spi/AbstractInterruptibleChannel;->blockedOn(Lsun/nio/ch/Interruptible;)V
-HSPLjava/nio/channels/spi/AbstractInterruptibleChannel;->close()V+]Ljava/nio/channels/spi/AbstractInterruptibleChannel;Lsun/nio/ch/FileChannelImpl;
+HSPLjava/nio/channels/spi/AbstractInterruptibleChannel;->close()V
 HSPLjava/nio/channels/spi/AbstractInterruptibleChannel;->end(Z)V
 HSPLjava/nio/channels/spi/AbstractInterruptibleChannel;->isOpen()Z
 HSPLjava/nio/channels/spi/AbstractSelectableChannel;-><init>(Ljava/nio/channels/spi/SelectorProvider;)V
@@ -3918,7 +3827,7 @@
 HSPLjava/nio/charset/Charset;->forName(Ljava/lang/String;)Ljava/nio/charset/Charset;
 HSPLjava/nio/charset/Charset;->forNameUEE(Ljava/lang/String;)Ljava/nio/charset/Charset;
 HSPLjava/nio/charset/Charset;->isSupported(Ljava/lang/String;)Z
-HSPLjava/nio/charset/Charset;->lookup(Ljava/lang/String;)Ljava/nio/charset/Charset;+]Ljava/util/Map$Entry;Ljava/util/AbstractMap$SimpleImmutableEntry;
+HSPLjava/nio/charset/Charset;->lookup(Ljava/lang/String;)Ljava/nio/charset/Charset;
 HSPLjava/nio/charset/Charset;->lookup2(Ljava/lang/String;)Ljava/nio/charset/Charset;
 HSPLjava/nio/charset/Charset;->name()Ljava/lang/String;
 HSPLjava/nio/charset/CharsetDecoder;-><init>(Ljava/nio/charset/Charset;FF)V
@@ -3926,7 +3835,7 @@
 HSPLjava/nio/charset/CharsetDecoder;->averageCharsPerByte()F
 HSPLjava/nio/charset/CharsetDecoder;->charset()Ljava/nio/charset/Charset;
 HSPLjava/nio/charset/CharsetDecoder;->decode(Ljava/nio/ByteBuffer;)Ljava/nio/CharBuffer;
-HSPLjava/nio/charset/CharsetDecoder;->decode(Ljava/nio/ByteBuffer;Ljava/nio/CharBuffer;Z)Ljava/nio/charset/CoderResult;+]Ljava/nio/ByteBuffer;Ljava/nio/HeapByteBuffer;]Ljava/nio/charset/CoderResult;Ljava/nio/charset/CoderResult;]Ljava/nio/charset/CharsetDecoder;Lcom/android/icu/charset/CharsetDecoderICU;
+HSPLjava/nio/charset/CharsetDecoder;->decode(Ljava/nio/ByteBuffer;Ljava/nio/CharBuffer;Z)Ljava/nio/charset/CoderResult;
 HSPLjava/nio/charset/CharsetDecoder;->flush(Ljava/nio/CharBuffer;)Ljava/nio/charset/CoderResult;+]Ljava/nio/charset/CoderResult;Ljava/nio/charset/CoderResult;]Ljava/nio/charset/CharsetDecoder;Lcom/android/icu/charset/CharsetDecoderICU;
 HSPLjava/nio/charset/CharsetDecoder;->implFlush(Ljava/nio/CharBuffer;)Ljava/nio/charset/CoderResult;
 HSPLjava/nio/charset/CharsetDecoder;->implOnMalformedInput(Ljava/nio/charset/CodingErrorAction;)V
@@ -3934,9 +3843,9 @@
 HSPLjava/nio/charset/CharsetDecoder;->implReset()V
 HSPLjava/nio/charset/CharsetDecoder;->malformedInputAction()Ljava/nio/charset/CodingErrorAction;
 HSPLjava/nio/charset/CharsetDecoder;->maxCharsPerByte()F
-HSPLjava/nio/charset/CharsetDecoder;->onMalformedInput(Ljava/nio/charset/CodingErrorAction;)Ljava/nio/charset/CharsetDecoder;+]Ljava/nio/charset/CharsetDecoder;Lcom/android/icu/charset/CharsetDecoderICU;
+HSPLjava/nio/charset/CharsetDecoder;->onMalformedInput(Ljava/nio/charset/CodingErrorAction;)Ljava/nio/charset/CharsetDecoder;
 HSPLjava/nio/charset/CharsetDecoder;->onUnmappableCharacter(Ljava/nio/charset/CodingErrorAction;)Ljava/nio/charset/CharsetDecoder;
-HSPLjava/nio/charset/CharsetDecoder;->replaceWith(Ljava/lang/String;)Ljava/nio/charset/CharsetDecoder;+]Ljava/nio/charset/CharsetDecoder;Lcom/android/icu/charset/CharsetDecoderICU;
+HSPLjava/nio/charset/CharsetDecoder;->replaceWith(Ljava/lang/String;)Ljava/nio/charset/CharsetDecoder;
 HSPLjava/nio/charset/CharsetDecoder;->replacement()Ljava/lang/String;
 HSPLjava/nio/charset/CharsetDecoder;->reset()Ljava/nio/charset/CharsetDecoder;+]Ljava/nio/charset/CharsetDecoder;Lcom/android/icu/charset/CharsetDecoderICU;
 HSPLjava/nio/charset/CharsetDecoder;->unmappableCharacterAction()Ljava/nio/charset/CodingErrorAction;
@@ -3948,8 +3857,8 @@
 HSPLjava/nio/charset/CharsetEncoder;->canEncode(Ljava/nio/CharBuffer;)Z
 HSPLjava/nio/charset/CharsetEncoder;->charset()Ljava/nio/charset/Charset;
 HSPLjava/nio/charset/CharsetEncoder;->encode(Ljava/nio/CharBuffer;)Ljava/nio/ByteBuffer;
-HSPLjava/nio/charset/CharsetEncoder;->encode(Ljava/nio/CharBuffer;Ljava/nio/ByteBuffer;Z)Ljava/nio/charset/CoderResult;+]Ljava/nio/CharBuffer;Ljava/nio/HeapCharBuffer;]Ljava/nio/charset/CharsetEncoder;Lcom/android/icu/charset/CharsetEncoderICU;]Ljava/nio/charset/CoderResult;Ljava/nio/charset/CoderResult;
-HSPLjava/nio/charset/CharsetEncoder;->flush(Ljava/nio/ByteBuffer;)Ljava/nio/charset/CoderResult;+]Ljava/nio/charset/CharsetEncoder;Lcom/android/icu/charset/CharsetEncoderICU;]Ljava/nio/charset/CoderResult;Ljava/nio/charset/CoderResult;
+HSPLjava/nio/charset/CharsetEncoder;->encode(Ljava/nio/CharBuffer;Ljava/nio/ByteBuffer;Z)Ljava/nio/charset/CoderResult;
+HSPLjava/nio/charset/CharsetEncoder;->flush(Ljava/nio/ByteBuffer;)Ljava/nio/charset/CoderResult;
 HSPLjava/nio/charset/CharsetEncoder;->implFlush(Ljava/nio/ByteBuffer;)Ljava/nio/charset/CoderResult;
 HSPLjava/nio/charset/CharsetEncoder;->implOnMalformedInput(Ljava/nio/charset/CodingErrorAction;)V
 HSPLjava/nio/charset/CharsetEncoder;->implOnUnmappableCharacter(Ljava/nio/charset/CodingErrorAction;)V
@@ -3960,7 +3869,7 @@
 HSPLjava/nio/charset/CharsetEncoder;->onUnmappableCharacter(Ljava/nio/charset/CodingErrorAction;)Ljava/nio/charset/CharsetEncoder;
 HSPLjava/nio/charset/CharsetEncoder;->replaceWith([B)Ljava/nio/charset/CharsetEncoder;
 HSPLjava/nio/charset/CharsetEncoder;->replacement()[B
-HSPLjava/nio/charset/CharsetEncoder;->reset()Ljava/nio/charset/CharsetEncoder;+]Ljava/nio/charset/CharsetEncoder;Lcom/android/icu/charset/CharsetEncoderICU;
+HSPLjava/nio/charset/CharsetEncoder;->reset()Ljava/nio/charset/CharsetEncoder;
 HSPLjava/nio/charset/CharsetEncoder;->unmappableCharacterAction()Ljava/nio/charset/CodingErrorAction;
 HSPLjava/nio/charset/CoderResult;->isError()Z
 HSPLjava/nio/charset/CoderResult;->isOverflow()Z
@@ -4049,7 +3958,7 @@
 HSPLjava/security/MessageDigest$Delegate;->engineReset()V
 HSPLjava/security/MessageDigest$Delegate;->engineUpdate(B)V
 HSPLjava/security/MessageDigest$Delegate;->engineUpdate(Ljava/nio/ByteBuffer;)V
-HSPLjava/security/MessageDigest$Delegate;->engineUpdate([BII)V+]Ljava/security/MessageDigestSpi;missing_types
+HSPLjava/security/MessageDigest$Delegate;->engineUpdate([BII)V
 HSPLjava/security/MessageDigest;-><init>(Ljava/lang/String;)V
 HSPLjava/security/MessageDigest;->digest()[B
 HSPLjava/security/MessageDigest;->digest([B)[B
@@ -4081,20 +3990,20 @@
 HSPLjava/security/Provider$Service;->getAlgorithm()Ljava/lang/String;
 HSPLjava/security/Provider$Service;->getAttribute(Ljava/lang/String;)Ljava/lang/String;
 HSPLjava/security/Provider$Service;->getClassName()Ljava/lang/String;
-HSPLjava/security/Provider$Service;->getImplClass()Ljava/lang/Class;+]Ljava/lang/ref/Reference;Ljava/lang/ref/WeakReference;
+HSPLjava/security/Provider$Service;->getImplClass()Ljava/lang/Class;
 HSPLjava/security/Provider$Service;->getKeyClass(Ljava/lang/String;)Ljava/lang/Class;
 HSPLjava/security/Provider$Service;->getProvider()Ljava/security/Provider;
 HSPLjava/security/Provider$Service;->getType()Ljava/lang/String;
 HSPLjava/security/Provider$Service;->hasKeyAttributes()Z
 HSPLjava/security/Provider$Service;->isValid()Z
-HSPLjava/security/Provider$Service;->newInstance(Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/security/Provider;missing_types]Ljava/util/Map;Ljava/util/HashMap;]Ljava/lang/Class;Ljava/lang/Class;]Ljava/lang/reflect/Constructor;Ljava/lang/reflect/Constructor;
+HSPLjava/security/Provider$Service;->newInstance(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/security/Provider$Service;->supportsKeyClass(Ljava/security/Key;)Z
 HSPLjava/security/Provider$Service;->supportsKeyFormat(Ljava/security/Key;)Z
 HSPLjava/security/Provider$Service;->supportsParameter(Ljava/lang/Object;)Z
 HSPLjava/security/Provider$ServiceKey;-><init>(Ljava/lang/String;Ljava/lang/String;Z)V
 HSPLjava/security/Provider$ServiceKey;-><init>(Ljava/lang/String;Ljava/lang/String;ZLjava/security/Provider$ServiceKey-IA;)V
 HSPLjava/security/Provider$ServiceKey;->equals(Ljava/lang/Object;)Z
-HSPLjava/security/Provider$ServiceKey;->hashCode()I+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/security/Provider$ServiceKey;->hashCode()I
 HSPLjava/security/Provider$ServiceKey;->matches(Ljava/lang/String;Ljava/lang/String;)Z
 HSPLjava/security/Provider$UString;-><init>(Ljava/lang/String;)V
 HSPLjava/security/Provider$UString;->equals(Ljava/lang/Object;)Z
@@ -4107,11 +4016,11 @@
 HSPLjava/security/Provider;->ensureLegacyParsed()V
 HSPLjava/security/Provider;->getEngineName(Ljava/lang/String;)Ljava/lang/String;
 HSPLjava/security/Provider;->getName()Ljava/lang/String;
-HSPLjava/security/Provider;->getService(Ljava/lang/String;Ljava/lang/String;)Ljava/security/Provider$Service;+]Ljava/security/Provider$ServiceKey;Ljava/security/Provider$ServiceKey;]Ljava/util/Map;Ljava/util/LinkedHashMap;
+HSPLjava/security/Provider;->getService(Ljava/lang/String;Ljava/lang/String;)Ljava/security/Provider$Service;
 HSPLjava/security/Provider;->getServices()Ljava/util/Set;
 HSPLjava/security/Provider;->getTypeAndAlgorithm(Ljava/lang/String;)[Ljava/lang/String;
 HSPLjava/security/Provider;->implPut(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
-HSPLjava/security/Provider;->parseLegacyPut(Ljava/lang/String;Ljava/lang/String;)V+]Ljava/lang/String;Ljava/lang/String;]Ljava/security/Provider$Service;Ljava/security/Provider$Service;]Ljava/util/Map;Ljava/util/LinkedHashMap;
+HSPLjava/security/Provider;->parseLegacyPut(Ljava/lang/String;Ljava/lang/String;)V
 HSPLjava/security/Provider;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/security/Provider;->putId()V
 HSPLjava/security/Provider;->removeInvalidServices(Ljava/util/Map;)V
@@ -4122,13 +4031,12 @@
 HSPLjava/security/SecureRandom;->getInstance(Ljava/lang/String;)Ljava/security/SecureRandom;
 HSPLjava/security/SecureRandom;->getPrngAlgorithm()Ljava/lang/String;
 HSPLjava/security/SecureRandom;->getProvider()Ljava/security/Provider;
-HSPLjava/security/SecureRandom;->getSecureRandomSpi()Ljava/security/SecureRandomSpi;
 HSPLjava/security/SecureRandom;->next(I)I
 HSPLjava/security/SecureRandom;->nextBytes([B)V
 HSPLjava/security/SecureRandom;->setSeed(J)V
 HSPLjava/security/SecureRandomSpi;-><init>()V
 HSPLjava/security/Security;->addProvider(Ljava/security/Provider;)I
-HSPLjava/security/Security;->getImpl(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/Object;+]Lsun/security/jca/GetInstance$Instance;Lsun/security/jca/GetInstance$Instance;
+HSPLjava/security/Security;->getImpl(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/Object;
 HSPLjava/security/Security;->getImpl(Ljava/lang/String;Ljava/lang/String;Ljava/security/Provider;)[Ljava/lang/Object;
 HSPLjava/security/Security;->getProperty(Ljava/lang/String;)Ljava/lang/String;
 HSPLjava/security/Security;->getProvider(Ljava/lang/String;)Ljava/security/Provider;
@@ -4273,7 +4181,7 @@
 HSPLjava/text/Collator;->setDecomposition(I)V
 HSPLjava/text/Collator;->setStrength(I)V
 HSPLjava/text/DateFormat;-><init>()V
-HSPLjava/text/DateFormat;->format(Ljava/lang/Object;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;+]Ljava/lang/Number;Ljava/lang/Long;]Ljava/text/DateFormat;Ljava/text/SimpleDateFormat;
+HSPLjava/text/DateFormat;->format(Ljava/lang/Object;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;
 HSPLjava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
 HSPLjava/text/DateFormat;->get(IIILjava/util/Locale;)Ljava/text/DateFormat;
 HSPLjava/text/DateFormat;->getDateInstance(ILjava/util/Locale;)Ljava/text/DateFormat;
@@ -4305,7 +4213,7 @@
 HSPLjava/text/DecimalFormat;->clone()Ljava/lang/Object;
 HSPLjava/text/DecimalFormat;->equals(Ljava/lang/Object;)Z
 HSPLjava/text/DecimalFormat;->format(DLjava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;
-HSPLjava/text/DecimalFormat;->format(JLjava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;+]Ljava/text/FieldPosition;Ljava/text/DontCareFieldPosition;]Landroid/icu/text/DecimalFormat;Landroid/icu/text/DecimalFormat;
+HSPLjava/text/DecimalFormat;->format(JLjava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;
 HSPLjava/text/DecimalFormat;->format(Ljava/lang/Object;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;
 HSPLjava/text/DecimalFormat;->getDecimalFormatSymbols()Ljava/text/DecimalFormatSymbols;
 HSPLjava/text/DecimalFormat;->getIcuFieldPosition(Ljava/text/FieldPosition;)Ljava/text/FieldPosition;
@@ -4320,29 +4228,29 @@
 HSPLjava/text/DecimalFormat;->initPattern(Ljava/lang/String;)V
 HSPLjava/text/DecimalFormat;->isParseBigDecimal()Z
 HSPLjava/text/DecimalFormat;->isParseIntegerOnly()Z
-HSPLjava/text/DecimalFormat;->parse(Ljava/lang/String;Ljava/text/ParsePosition;)Ljava/lang/Number;+]Ljava/lang/Object;Ljava/lang/Long;]Ljava/text/DecimalFormat;Ljava/text/DecimalFormat;]Landroid/icu/text/DecimalFormat;Landroid/icu/text/DecimalFormat;
+HSPLjava/text/DecimalFormat;->parse(Ljava/lang/String;Ljava/text/ParsePosition;)Ljava/lang/Number;
 HSPLjava/text/DecimalFormat;->setDecimalSeparatorAlwaysShown(Z)V
 HSPLjava/text/DecimalFormat;->setGroupingUsed(Z)V
 HSPLjava/text/DecimalFormat;->setMaximumFractionDigits(I)V
-HSPLjava/text/DecimalFormat;->setMaximumIntegerDigits(I)V+]Ljava/text/DecimalFormat;Ljava/text/DecimalFormat;]Landroid/icu/text/DecimalFormat;Landroid/icu/text/DecimalFormat;
+HSPLjava/text/DecimalFormat;->setMaximumIntegerDigits(I)V
 HSPLjava/text/DecimalFormat;->setMinimumFractionDigits(I)V
-HSPLjava/text/DecimalFormat;->setMinimumIntegerDigits(I)V+]Ljava/text/DecimalFormat;Ljava/text/DecimalFormat;]Landroid/icu/text/DecimalFormat;Landroid/icu/text/DecimalFormat;
+HSPLjava/text/DecimalFormat;->setMinimumIntegerDigits(I)V
 HSPLjava/text/DecimalFormat;->setParseIntegerOnly(Z)V
 HSPLjava/text/DecimalFormat;->toPattern()Ljava/lang/String;
-HSPLjava/text/DecimalFormat;->updateFieldsFromIcu()V+]Landroid/icu/text/DecimalFormat;Landroid/icu/text/DecimalFormat;
+HSPLjava/text/DecimalFormat;->updateFieldsFromIcu()V
 HSPLjava/text/DecimalFormatSymbols;-><init>(Ljava/util/Locale;)V
 HSPLjava/text/DecimalFormatSymbols;->clone()Ljava/lang/Object;
 HSPLjava/text/DecimalFormatSymbols;->findNonFormatChar(Ljava/lang/String;C)C
-HSPLjava/text/DecimalFormatSymbols;->fromIcuInstance(Landroid/icu/text/DecimalFormatSymbols;)Ljava/text/DecimalFormatSymbols;+]Ljava/text/DecimalFormatSymbols;Ljava/text/DecimalFormatSymbols;]Landroid/icu/text/DecimalFormatSymbols;Landroid/icu/text/DecimalFormatSymbols;]Landroid/icu/util/Currency;Landroid/icu/util/Currency;
+HSPLjava/text/DecimalFormatSymbols;->fromIcuInstance(Landroid/icu/text/DecimalFormatSymbols;)Ljava/text/DecimalFormatSymbols;
 HSPLjava/text/DecimalFormatSymbols;->getCurrency()Ljava/util/Currency;
 HSPLjava/text/DecimalFormatSymbols;->getDecimalSeparator()C
 HSPLjava/text/DecimalFormatSymbols;->getGroupingSeparator()C
-HSPLjava/text/DecimalFormatSymbols;->getIcuDecimalFormatSymbols()Landroid/icu/text/DecimalFormatSymbols;+]Ljava/text/DecimalFormatSymbols;Ljava/text/DecimalFormatSymbols;]Ljava/util/Currency;Ljava/util/Currency;]Landroid/icu/text/DecimalFormatSymbols;Landroid/icu/text/DecimalFormatSymbols;
+HSPLjava/text/DecimalFormatSymbols;->getIcuDecimalFormatSymbols()Landroid/icu/text/DecimalFormatSymbols;
 HSPLjava/text/DecimalFormatSymbols;->getInfinity()Ljava/lang/String;
 HSPLjava/text/DecimalFormatSymbols;->getInstance(Ljava/util/Locale;)Ljava/text/DecimalFormatSymbols;
 HSPLjava/text/DecimalFormatSymbols;->getNaN()Ljava/lang/String;
 HSPLjava/text/DecimalFormatSymbols;->getZeroDigit()C
-HSPLjava/text/DecimalFormatSymbols;->initialize(Ljava/util/Locale;)V+]Llibcore/icu/DecimalFormatData;Llibcore/icu/DecimalFormatData;
+HSPLjava/text/DecimalFormatSymbols;->initialize(Ljava/util/Locale;)V
 HSPLjava/text/DecimalFormatSymbols;->initializeCurrency(Ljava/util/Locale;)V
 HSPLjava/text/DecimalFormatSymbols;->maybeStripMarkers(Ljava/lang/String;C)C
 HSPLjava/text/DecimalFormatSymbols;->setCurrency(Ljava/util/Currency;)V
@@ -4376,7 +4284,7 @@
 HSPLjava/text/FieldPosition;->setEndIndex(I)V
 HSPLjava/text/Format;-><init>()V
 HSPLjava/text/Format;->clone()Ljava/lang/Object;
-HSPLjava/text/Format;->format(Ljava/lang/Object;)Ljava/lang/String;+]Ljava/lang/StringBuffer;Ljava/lang/StringBuffer;]Ljava/text/Format;Ljava/text/SimpleDateFormat;
+HSPLjava/text/Format;->format(Ljava/lang/Object;)Ljava/lang/String;
 HSPLjava/text/IcuIteratorWrapper;-><init>(Landroid/icu/text/BreakIterator;)V
 HSPLjava/text/IcuIteratorWrapper;->checkOffset(ILjava/text/CharacterIterator;)V
 HSPLjava/text/IcuIteratorWrapper;->following(I)I
@@ -4429,8 +4337,8 @@
 HSPLjava/text/SimpleDateFormat;->checkNegativeNumberExpression()V
 HSPLjava/text/SimpleDateFormat;->compile(Ljava/lang/String;)[C
 HSPLjava/text/SimpleDateFormat;->encode(IILjava/lang/StringBuilder;)V
-HSPLjava/text/SimpleDateFormat;->format(Ljava/util/Date;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;+]Ljava/text/FieldPosition;Ljava/text/FieldPosition;
-HSPLjava/text/SimpleDateFormat;->format(Ljava/util/Date;Ljava/lang/StringBuffer;Ljava/text/Format$FieldDelegate;)Ljava/lang/StringBuffer;+]Ljava/lang/StringBuffer;Ljava/lang/StringBuffer;]Ljava/util/Calendar;Ljava/util/GregorianCalendar;
+HSPLjava/text/SimpleDateFormat;->format(Ljava/util/Date;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;
+HSPLjava/text/SimpleDateFormat;->format(Ljava/util/Date;Ljava/lang/StringBuffer;Ljava/text/Format$FieldDelegate;)Ljava/lang/StringBuffer;
 HSPLjava/text/SimpleDateFormat;->formatMonth(IIILjava/lang/StringBuffer;ZZII)Ljava/lang/String;
 HSPLjava/text/SimpleDateFormat;->formatWeekday(IIZZ)Ljava/lang/String;
 HSPLjava/text/SimpleDateFormat;->getDateTimeFormat(IILjava/util/Locale;)Ljava/lang/String;
@@ -4443,15 +4351,15 @@
 HSPLjava/text/SimpleDateFormat;->matchString(Ljava/lang/String;II[Ljava/lang/String;Ljava/text/CalendarBuilder;)I
 HSPLjava/text/SimpleDateFormat;->parse(Ljava/lang/String;Ljava/text/ParsePosition;)Ljava/util/Date;
 HSPLjava/text/SimpleDateFormat;->parseAmbiguousDatesAsAfter(Ljava/util/Date;)V
-HSPLjava/text/SimpleDateFormat;->parseInternal(Ljava/lang/String;Ljava/text/ParsePosition;)Ljava/util/Date;+]Ljava/text/CalendarBuilder;Ljava/text/CalendarBuilder;]Ljava/util/Calendar;Ljava/util/GregorianCalendar;
+HSPLjava/text/SimpleDateFormat;->parseInternal(Ljava/lang/String;Ljava/text/ParsePosition;)Ljava/util/Date;
 HSPLjava/text/SimpleDateFormat;->parseMonth(Ljava/lang/String;IIIILjava/text/ParsePosition;ZZLjava/text/CalendarBuilder;)I
 HSPLjava/text/SimpleDateFormat;->parseWeekday(Ljava/lang/String;IIZZLjava/text/CalendarBuilder;)I
 HSPLjava/text/SimpleDateFormat;->shouldObeyCount(II)Z
 HSPLjava/text/SimpleDateFormat;->subFormat(IILjava/text/Format$FieldDelegate;Ljava/lang/StringBuffer;Z)V
-HSPLjava/text/SimpleDateFormat;->subParse(Ljava/lang/String;IIIZ[ZLjava/text/ParsePosition;ZLjava/text/CalendarBuilder;)I+]Ljava/lang/String;Ljava/lang/String;]Ljava/text/ParsePosition;Ljava/text/ParsePosition;]Ljava/text/CalendarBuilder;Ljava/text/CalendarBuilder;]Ljava/lang/Number;Ljava/lang/Long;]Ljava/text/NumberFormat;Ljava/text/DecimalFormat;
+HSPLjava/text/SimpleDateFormat;->subParse(Ljava/lang/String;IIIZ[ZLjava/text/ParsePosition;ZLjava/text/CalendarBuilder;)I
 HSPLjava/text/SimpleDateFormat;->subParseNumericZone(Ljava/lang/String;IIIZLjava/text/CalendarBuilder;)I
 HSPLjava/text/SimpleDateFormat;->toPattern()Ljava/lang/String;
-HSPLjava/text/SimpleDateFormat;->useDateFormatSymbols()Z+]Ljava/lang/Object;Ljava/util/GregorianCalendar;]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/text/SimpleDateFormat;->useDateFormatSymbols()Z
 HSPLjava/text/SimpleDateFormat;->zeroPaddingNumber(IIILjava/lang/StringBuffer;)V
 HSPLjava/text/StringCharacterIterator;-><init>(Ljava/lang/String;)V
 HSPLjava/text/StringCharacterIterator;-><init>(Ljava/lang/String;I)V
@@ -4643,7 +4551,7 @@
 HSPLjava/time/chrono/ChronoLocalDate;->isSupported(Ljava/time/temporal/TemporalField;)Z
 HSPLjava/time/chrono/ChronoLocalDateTime;->getChronology()Ljava/time/chrono/Chronology;
 HSPLjava/time/chrono/ChronoLocalDateTime;->query(Ljava/time/temporal/TemporalQuery;)Ljava/lang/Object;
-HSPLjava/time/chrono/ChronoLocalDateTime;->toEpochSecond(Ljava/time/ZoneOffset;)J+]Ljava/time/ZoneOffset;Ljava/time/ZoneOffset;]Ljava/time/LocalTime;Ljava/time/LocalTime;]Ljava/time/chrono/ChronoLocalDateTime;Ljava/time/LocalDateTime;]Ljava/time/chrono/ChronoLocalDate;Ljava/time/LocalDate;
+HSPLjava/time/chrono/ChronoLocalDateTime;->toEpochSecond(Ljava/time/ZoneOffset;)J
 HSPLjava/time/chrono/ChronoZonedDateTime;->getChronology()Ljava/time/chrono/Chronology;
 HSPLjava/time/chrono/ChronoZonedDateTime;->query(Ljava/time/temporal/TemporalQuery;)Ljava/lang/Object;
 HSPLjava/time/chrono/ChronoZonedDateTime;->toEpochSecond()J+]Ljava/time/ZoneOffset;Ljava/time/ZoneOffset;]Ljava/time/LocalTime;Ljava/time/LocalTime;]Ljava/time/chrono/ChronoZonedDateTime;Ljava/time/ZonedDateTime;]Ljava/time/chrono/ChronoLocalDate;Ljava/time/LocalDate;
@@ -4755,7 +4663,6 @@
 HSPLjava/time/temporal/TemporalAccessor;->range(Ljava/time/temporal/TemporalField;)Ljava/time/temporal/ValueRange;
 HSPLjava/time/temporal/TemporalAdjusters$$ExternalSyntheticLambda11;-><init>(I)V
 HSPLjava/time/temporal/TemporalAdjusters$$ExternalSyntheticLambda11;->adjustInto(Ljava/time/temporal/Temporal;)Ljava/time/temporal/Temporal;
-HSPLjava/time/temporal/TemporalAdjusters$$ExternalSyntheticLambda1;-><init>(I)V
 HSPLjava/time/temporal/TemporalAdjusters$$ExternalSyntheticLambda1;->adjustInto(Ljava/time/temporal/Temporal;)Ljava/time/temporal/Temporal;
 HSPLjava/time/temporal/TemporalAdjusters;->lambda$nextOrSame$10(ILjava/time/temporal/Temporal;)Ljava/time/temporal/Temporal;
 HSPLjava/time/temporal/TemporalAdjusters;->lambda$previousOrSame$12(ILjava/time/temporal/Temporal;)Ljava/time/temporal/Temporal;
@@ -4810,21 +4717,21 @@
 HSPLjava/time/zone/ZoneRulesProvider;->getProvider(Ljava/lang/String;)Ljava/time/zone/ZoneRulesProvider;
 HSPLjava/time/zone/ZoneRulesProvider;->getRules(Ljava/lang/String;Z)Ljava/time/zone/ZoneRules;
 HSPLjava/util/AbstractCollection;-><init>()V
-HSPLjava/util/AbstractCollection;->addAll(Ljava/util/Collection;)Z+]Ljava/util/AbstractCollection;Ljava/util/HashSet;,Ljava/util/LinkedHashSet;]Ljava/util/Collection;megamorphic_types]Ljava/util/Iterator;megamorphic_types
+HSPLjava/util/AbstractCollection;->addAll(Ljava/util/Collection;)Z
 HSPLjava/util/AbstractCollection;->clear()V
 HSPLjava/util/AbstractCollection;->contains(Ljava/lang/Object;)Z
 HSPLjava/util/AbstractCollection;->containsAll(Ljava/util/Collection;)Z
-HSPLjava/util/AbstractCollection;->isEmpty()Z+]Ljava/util/AbstractCollection;missing_types
+HSPLjava/util/AbstractCollection;->isEmpty()Z
 HSPLjava/util/AbstractCollection;->remove(Ljava/lang/Object;)Z
 HSPLjava/util/AbstractCollection;->removeAll(Ljava/util/Collection;)Z
 HSPLjava/util/AbstractCollection;->retainAll(Ljava/util/Collection;)Z
-HSPLjava/util/AbstractCollection;->toArray()[Ljava/lang/Object;+]Ljava/util/AbstractCollection;missing_types]Ljava/util/Iterator;missing_types
+HSPLjava/util/AbstractCollection;->toArray()[Ljava/lang/Object;
 HSPLjava/util/AbstractCollection;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
 HSPLjava/util/AbstractCollection;->toString()Ljava/lang/String;
 HSPLjava/util/AbstractList$Itr;-><init>(Ljava/util/AbstractList;)V
 HSPLjava/util/AbstractList$Itr;-><init>(Ljava/util/AbstractList;Ljava/util/AbstractList$Itr-IA;)V
 HSPLjava/util/AbstractList$Itr;->checkForComodification()V
-HSPLjava/util/AbstractList$Itr;->hasNext()Z+]Ljava/util/AbstractList;missing_types
+HSPLjava/util/AbstractList$Itr;->hasNext()Z
 HSPLjava/util/AbstractList$Itr;->next()Ljava/lang/Object;+]Ljava/util/AbstractList$Itr;Ljava/util/AbstractList$Itr;,Ljava/util/AbstractList$ListItr;]Ljava/util/AbstractList;missing_types
 HSPLjava/util/AbstractList$ListItr;-><init>(Ljava/util/AbstractList;I)V
 HSPLjava/util/AbstractList$ListItr;->hasPrevious()Z
@@ -4872,7 +4779,7 @@
 HSPLjava/util/AbstractMap$SimpleEntry;->getKey()Ljava/lang/Object;
 HSPLjava/util/AbstractMap$SimpleEntry;->getValue()Ljava/lang/Object;
 HSPLjava/util/AbstractMap$SimpleImmutableEntry;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
-HSPLjava/util/AbstractMap$SimpleImmutableEntry;-><init>(Ljava/util/Map$Entry;)V+]Ljava/util/Map$Entry;Ljava/util/TreeMap$TreeMapEntry;
+HSPLjava/util/AbstractMap$SimpleImmutableEntry;-><init>(Ljava/util/Map$Entry;)V
 HSPLjava/util/AbstractMap$SimpleImmutableEntry;->equals(Ljava/lang/Object;)Z
 HSPLjava/util/AbstractMap$SimpleImmutableEntry;->getKey()Ljava/lang/Object;
 HSPLjava/util/AbstractMap$SimpleImmutableEntry;->getValue()Ljava/lang/Object;
@@ -4881,11 +4788,11 @@
 HSPLjava/util/AbstractMap;->clear()V
 HSPLjava/util/AbstractMap;->clone()Ljava/lang/Object;
 HSPLjava/util/AbstractMap;->eq(Ljava/lang/Object;Ljava/lang/Object;)Z
-HSPLjava/util/AbstractMap;->equals(Ljava/lang/Object;)Z+]Ljava/util/Map$Entry;Ljava/util/LinkedHashMap$LinkedHashMapEntry;]Ljava/lang/Object;missing_types]Ljava/util/AbstractMap;Ljava/util/LinkedHashMap;]Ljava/util/Map;Ljava/util/LinkedHashMap;]Ljava/util/Iterator;Ljava/util/LinkedHashMap$LinkedEntryIterator;]Ljava/util/Set;Ljava/util/LinkedHashMap$LinkedEntrySet;
+HSPLjava/util/AbstractMap;->equals(Ljava/lang/Object;)Z
 HSPLjava/util/AbstractMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/AbstractMap;->hashCode()I
-HSPLjava/util/AbstractMap;->isEmpty()Z+]Ljava/util/AbstractMap;missing_types
-HSPLjava/util/AbstractMap;->putAll(Ljava/util/Map;)V+]Ljava/util/Map$Entry;Ljava/util/AbstractMap$SimpleImmutableEntry;]Ljava/util/Map;Ljava/util/Collections$SingletonMap;]Ljava/util/Iterator;Ljava/util/Collections$1;]Ljava/util/Set;Ljava/util/Collections$SingletonSet;
+HSPLjava/util/AbstractMap;->isEmpty()Z
+HSPLjava/util/AbstractMap;->putAll(Ljava/util/Map;)V
 HSPLjava/util/AbstractMap;->size()I
 HSPLjava/util/AbstractMap;->toString()Ljava/lang/String;
 HSPLjava/util/AbstractMap;->values()Ljava/util/Collection;
@@ -4912,8 +4819,8 @@
 HSPLjava/util/ArrayDeque;-><init>()V
 HSPLjava/util/ArrayDeque;-><init>(I)V
 HSPLjava/util/ArrayDeque;-><init>(Ljava/util/Collection;)V
-HSPLjava/util/ArrayDeque;->add(Ljava/lang/Object;)Z+]Ljava/util/ArrayDeque;Ljava/util/ArrayDeque;
-HSPLjava/util/ArrayDeque;->addAll(Ljava/util/Collection;)Z+]Ljava/util/ArrayDeque;Ljava/util/ArrayDeque;]Ljava/util/Collection;Ljava/util/ArrayDeque;
+HSPLjava/util/ArrayDeque;->add(Ljava/lang/Object;)Z
+HSPLjava/util/ArrayDeque;->addAll(Ljava/util/Collection;)Z
 HSPLjava/util/ArrayDeque;->addFirst(Ljava/lang/Object;)V
 HSPLjava/util/ArrayDeque;->addLast(Ljava/lang/Object;)V
 HSPLjava/util/ArrayDeque;->checkInvariants()V
@@ -4925,7 +4832,7 @@
 HSPLjava/util/ArrayDeque;->delete(I)Z
 HSPLjava/util/ArrayDeque;->descendingIterator()Ljava/util/Iterator;
 HSPLjava/util/ArrayDeque;->elementAt([Ljava/lang/Object;I)Ljava/lang/Object;
-HSPLjava/util/ArrayDeque;->forEach(Ljava/util/function/Consumer;)V+]Ljava/util/function/Consumer;Ljava/util/ArrayDeque$$ExternalSyntheticLambda1;
+HSPLjava/util/ArrayDeque;->forEach(Ljava/util/function/Consumer;)V
 HSPLjava/util/ArrayDeque;->getFirst()Ljava/lang/Object;
 HSPLjava/util/ArrayDeque;->getLast()Ljava/lang/Object;
 HSPLjava/util/ArrayDeque;->grow(I)V
@@ -4937,14 +4844,14 @@
 HSPLjava/util/ArrayDeque;->peek()Ljava/lang/Object;
 HSPLjava/util/ArrayDeque;->peekFirst()Ljava/lang/Object;
 HSPLjava/util/ArrayDeque;->peekLast()Ljava/lang/Object;
-HSPLjava/util/ArrayDeque;->poll()Ljava/lang/Object;+]Ljava/util/ArrayDeque;Ljava/util/ArrayDeque;
+HSPLjava/util/ArrayDeque;->poll()Ljava/lang/Object;
 HSPLjava/util/ArrayDeque;->pollFirst()Ljava/lang/Object;
 HSPLjava/util/ArrayDeque;->pollLast()Ljava/lang/Object;
 HSPLjava/util/ArrayDeque;->pop()Ljava/lang/Object;
 HSPLjava/util/ArrayDeque;->push(Ljava/lang/Object;)V
-HSPLjava/util/ArrayDeque;->remove()Ljava/lang/Object;+]Ljava/util/ArrayDeque;Ljava/util/ArrayDeque;
+HSPLjava/util/ArrayDeque;->remove()Ljava/lang/Object;
 HSPLjava/util/ArrayDeque;->remove(Ljava/lang/Object;)Z
-HSPLjava/util/ArrayDeque;->removeFirst()Ljava/lang/Object;+]Ljava/util/ArrayDeque;Ljava/util/ArrayDeque;
+HSPLjava/util/ArrayDeque;->removeFirst()Ljava/lang/Object;
 HSPLjava/util/ArrayDeque;->removeFirstOccurrence(Ljava/lang/Object;)Z
 HSPLjava/util/ArrayDeque;->removeLast()Ljava/lang/Object;
 HSPLjava/util/ArrayDeque;->size()I
@@ -4971,7 +4878,7 @@
 HSPLjava/util/ArrayList$SubList$1;-><init>(Ljava/util/ArrayList$SubList;I)V
 HSPLjava/util/ArrayList$SubList$1;->checkForComodification()V
 HSPLjava/util/ArrayList$SubList$1;->hasNext()Z
-HSPLjava/util/ArrayList$SubList$1;->next()Ljava/lang/Object;+]Ljava/util/ArrayList$SubList$1;Ljava/util/ArrayList$SubList$1;
+HSPLjava/util/ArrayList$SubList$1;->next()Ljava/lang/Object;
 HSPLjava/util/ArrayList$SubList;->-$$Nest$fgetoffset(Ljava/util/ArrayList$SubList;)I
 HSPLjava/util/ArrayList$SubList;->-$$Nest$fgetroot(Ljava/util/ArrayList$SubList;)Ljava/util/ArrayList;
 HSPLjava/util/ArrayList$SubList;->-$$Nest$fgetsize(Ljava/util/ArrayList$SubList;)I
@@ -4989,12 +4896,12 @@
 HSPLjava/util/ArrayList;->-$$Nest$fgetsize(Ljava/util/ArrayList;)I
 HSPLjava/util/ArrayList;-><init>()V
 HSPLjava/util/ArrayList;-><init>(I)V
-HSPLjava/util/ArrayList;-><init>(Ljava/util/Collection;)V+]Ljava/lang/Object;Landroid/net/Uri$PathSegments;]Ljava/util/Collection;Ljava/util/Collections$EmptyList;,Landroid/net/Uri$PathSegments;
+HSPLjava/util/ArrayList;-><init>(Ljava/util/Collection;)V
 HSPLjava/util/ArrayList;->add(ILjava/lang/Object;)V
 HSPLjava/util/ArrayList;->add(Ljava/lang/Object;)Z
 HSPLjava/util/ArrayList;->add(Ljava/lang/Object;[Ljava/lang/Object;I)V
 HSPLjava/util/ArrayList;->addAll(ILjava/util/Collection;)Z
-HSPLjava/util/ArrayList;->addAll(Ljava/util/Collection;)Z+]Ljava/util/Collection;missing_types
+HSPLjava/util/ArrayList;->addAll(Ljava/util/Collection;)Z
 HSPLjava/util/ArrayList;->batchRemove(Ljava/util/Collection;ZII)Z
 HSPLjava/util/ArrayList;->checkForComodification(I)V
 HSPLjava/util/ArrayList;->clear()V
@@ -5003,18 +4910,18 @@
 HSPLjava/util/ArrayList;->elementAt([Ljava/lang/Object;I)Ljava/lang/Object;
 HSPLjava/util/ArrayList;->elementData(I)Ljava/lang/Object;
 HSPLjava/util/ArrayList;->ensureCapacity(I)V
-HSPLjava/util/ArrayList;->equals(Ljava/lang/Object;)Z+]Ljava/lang/Object;Ljava/util/ArrayList;
+HSPLjava/util/ArrayList;->equals(Ljava/lang/Object;)Z
 HSPLjava/util/ArrayList;->equalsArrayList(Ljava/util/ArrayList;)Z
 HSPLjava/util/ArrayList;->equalsRange(Ljava/util/List;II)Z
 HSPLjava/util/ArrayList;->fastRemove([Ljava/lang/Object;I)V
 HSPLjava/util/ArrayList;->forEach(Ljava/util/function/Consumer;)V
-HSPLjava/util/ArrayList;->get(I)Ljava/lang/Object;+]Ljava/util/ArrayList;missing_types
+HSPLjava/util/ArrayList;->get(I)Ljava/lang/Object;
 HSPLjava/util/ArrayList;->grow()[Ljava/lang/Object;
 HSPLjava/util/ArrayList;->grow(I)[Ljava/lang/Object;
 HSPLjava/util/ArrayList;->hashCode()I
 HSPLjava/util/ArrayList;->hashCodeRange(II)I
-HSPLjava/util/ArrayList;->indexOf(Ljava/lang/Object;)I+]Ljava/util/ArrayList;Ljava/util/ArrayList;
-HSPLjava/util/ArrayList;->indexOfRange(Ljava/lang/Object;II)I+]Ljava/lang/Object;missing_types
+HSPLjava/util/ArrayList;->indexOf(Ljava/lang/Object;)I
+HSPLjava/util/ArrayList;->indexOfRange(Ljava/lang/Object;II)I
 HSPLjava/util/ArrayList;->isEmpty()Z
 HSPLjava/util/ArrayList;->iterator()Ljava/util/Iterator;
 HSPLjava/util/ArrayList;->lastIndexOf(Ljava/lang/Object;)I
@@ -5029,14 +4936,14 @@
 HSPLjava/util/ArrayList;->removeIf(Ljava/util/function/Predicate;II)Z
 HSPLjava/util/ArrayList;->removeRange(II)V
 HSPLjava/util/ArrayList;->retainAll(Ljava/util/Collection;)Z
-HSPLjava/util/ArrayList;->set(ILjava/lang/Object;)Ljava/lang/Object;+]Ljava/util/ArrayList;Ljava/util/ArrayList;
+HSPLjava/util/ArrayList;->set(ILjava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/ArrayList;->shiftTailOverGap([Ljava/lang/Object;II)V
 HSPLjava/util/ArrayList;->size()I
 HSPLjava/util/ArrayList;->sort(Ljava/util/Comparator;)V
 HSPLjava/util/ArrayList;->spliterator()Ljava/util/Spliterator;
 HSPLjava/util/ArrayList;->subList(II)Ljava/util/List;
 HSPLjava/util/ArrayList;->toArray()[Ljava/lang/Object;
-HSPLjava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;+]Ljava/lang/Object;missing_types
+HSPLjava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
 HSPLjava/util/ArrayList;->trimToSize()V
 HSPLjava/util/ArrayList;->writeObject(Ljava/io/ObjectOutputStream;)V
 HSPLjava/util/Arrays$ArrayItr;-><init>([Ljava/lang/Object;)V
@@ -5052,7 +4959,7 @@
 HSPLjava/util/Arrays$ArrayList;->size()I
 HSPLjava/util/Arrays$ArrayList;->sort(Ljava/util/Comparator;)V
 HSPLjava/util/Arrays$ArrayList;->spliterator()Ljava/util/Spliterator;
-HSPLjava/util/Arrays$ArrayList;->toArray()[Ljava/lang/Object;+][Ljava/lang/Object;missing_types
+HSPLjava/util/Arrays$ArrayList;->toArray()[Ljava/lang/Object;
 HSPLjava/util/Arrays$ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
 HSPLjava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
 HSPLjava/util/Arrays;->binarySearch([CC)I
@@ -5073,8 +4980,8 @@
 HSPLjava/util/Arrays;->copyOf([FI)[F
 HSPLjava/util/Arrays;->copyOf([II)[I
 HSPLjava/util/Arrays;->copyOf([JI)[J
-HSPLjava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;+]Ljava/lang/Object;missing_types
-HSPLjava/util/Arrays;->copyOf([Ljava/lang/Object;ILjava/lang/Class;)[Ljava/lang/Object;+]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
+HSPLjava/util/Arrays;->copyOf([Ljava/lang/Object;ILjava/lang/Class;)[Ljava/lang/Object;
 HSPLjava/util/Arrays;->copyOf([ZI)[Z
 HSPLjava/util/Arrays;->copyOfRange([BII)[B
 HSPLjava/util/Arrays;->copyOfRange([CII)[C
@@ -5110,7 +5017,7 @@
 HSPLjava/util/Arrays;->hashCode([F)I
 HSPLjava/util/Arrays;->hashCode([I)I
 HSPLjava/util/Arrays;->hashCode([J)I
-HSPLjava/util/Arrays;->hashCode([Ljava/lang/Object;)I
+HSPLjava/util/Arrays;->hashCode([Ljava/lang/Object;)I+]Ljava/lang/Object;missing_types
 HSPLjava/util/Arrays;->rangeCheck(III)V
 HSPLjava/util/Arrays;->sort([C)V
 HSPLjava/util/Arrays;->sort([F)V
@@ -5127,7 +5034,7 @@
 HSPLjava/util/Arrays;->stream([III)Ljava/util/stream/IntStream;
 HSPLjava/util/Arrays;->stream([Ljava/lang/Object;)Ljava/util/stream/Stream;
 HSPLjava/util/Arrays;->stream([Ljava/lang/Object;II)Ljava/util/stream/Stream;
-HSPLjava/util/Arrays;->toString([B)Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
+HSPLjava/util/Arrays;->toString([B)Ljava/lang/String;
 HSPLjava/util/Arrays;->toString([F)Ljava/lang/String;
 HSPLjava/util/Arrays;->toString([I)Ljava/lang/String;
 HSPLjava/util/Arrays;->toString([J)Ljava/lang/String;
@@ -5147,7 +5054,7 @@
 HSPLjava/util/BitSet;->checkRange(II)V
 HSPLjava/util/BitSet;->clear()V
 HSPLjava/util/BitSet;->clear(I)V
-HSPLjava/util/BitSet;->clone()Ljava/lang/Object;+][J[J
+HSPLjava/util/BitSet;->clone()Ljava/lang/Object;
 HSPLjava/util/BitSet;->ensureCapacity(I)V
 HSPLjava/util/BitSet;->equals(Ljava/lang/Object;)Z
 HSPLjava/util/BitSet;->expandTo(I)V
@@ -5167,7 +5074,7 @@
 HSPLjava/util/BitSet;->size()I
 HSPLjava/util/BitSet;->toString()Ljava/lang/String;
 HSPLjava/util/BitSet;->trimToSize()V
-HSPLjava/util/BitSet;->valueOf(Ljava/nio/ByteBuffer;)Ljava/util/BitSet;+]Ljava/nio/ByteBuffer;Ljava/nio/HeapByteBuffer;
+HSPLjava/util/BitSet;->valueOf(Ljava/nio/ByteBuffer;)Ljava/util/BitSet;
 HSPLjava/util/BitSet;->valueOf([J)Ljava/util/BitSet;
 HSPLjava/util/BitSet;->wordIndex(I)I
 HSPLjava/util/Calendar;-><init>()V
@@ -5181,7 +5088,7 @@
 HSPLjava/util/Calendar;->complete()V
 HSPLjava/util/Calendar;->createCalendar(Ljava/util/TimeZone;Ljava/util/Locale;)Ljava/util/Calendar;
 HSPLjava/util/Calendar;->defaultTimeZone(Ljava/util/Locale;)Ljava/util/TimeZone;
-HSPLjava/util/Calendar;->get(I)I+]Ljava/util/Calendar;Ljava/util/GregorianCalendar;
+HSPLjava/util/Calendar;->get(I)I
 HSPLjava/util/Calendar;->getFirstDayOfWeek()I
 HSPLjava/util/Calendar;->getInstance()Ljava/util/Calendar;
 HSPLjava/util/Calendar;->getInstance(Ljava/util/Locale;)Ljava/util/Calendar;
@@ -5209,13 +5116,13 @@
 HSPLjava/util/Calendar;->setFieldsComputed(I)V
 HSPLjava/util/Calendar;->setFieldsNormalized(I)V
 HSPLjava/util/Calendar;->setLenient(Z)V
-HSPLjava/util/Calendar;->setTime(Ljava/util/Date;)V+]Ljava/util/Date;Ljava/util/Date;]Ljava/util/Calendar;Ljava/util/GregorianCalendar;
+HSPLjava/util/Calendar;->setTime(Ljava/util/Date;)V
 HSPLjava/util/Calendar;->setTimeInMillis(J)V
 HSPLjava/util/Calendar;->setTimeZone(Ljava/util/TimeZone;)V
-HSPLjava/util/Calendar;->setWeekCountData(Ljava/util/Locale;)V+]Ljava/util/concurrent/ConcurrentMap;Ljava/util/concurrent/ConcurrentHashMap;]Ljava/lang/Integer;Ljava/lang/Integer;
+HSPLjava/util/Calendar;->setWeekCountData(Ljava/util/Locale;)V
 HSPLjava/util/Calendar;->setZoneShared(Z)V
 HSPLjava/util/Calendar;->updateTime()V
-HSPLjava/util/Collection;->removeIf(Ljava/util/function/Predicate;)Z+]Ljava/util/Collection;Landroid/util/MapCollections$ValuesCollection;,Ljava/util/HashMap$EntrySet;]Ljava/util/Iterator;Landroid/util/MapCollections$ArrayIterator;,Ljava/util/HashMap$EntryIterator;
+HSPLjava/util/Collection;->removeIf(Ljava/util/function/Predicate;)Z+]Ljava/util/Collection;Landroid/util/MapCollections$ValuesCollection;]Ljava/util/Iterator;Landroid/util/MapCollections$ArrayIterator;
 HSPLjava/util/Collection;->spliterator()Ljava/util/Spliterator;
 HSPLjava/util/Collection;->stream()Ljava/util/stream/Stream;+]Ljava/util/Collection;megamorphic_types
 HSPLjava/util/Collections$1;-><init>(Ljava/lang/Object;)V
@@ -5300,12 +5207,12 @@
 HSPLjava/util/Collections$SynchronizedCollection;->isEmpty()Z
 HSPLjava/util/Collections$SynchronizedCollection;->iterator()Ljava/util/Iterator;
 HSPLjava/util/Collections$SynchronizedCollection;->remove(Ljava/lang/Object;)Z
-HSPLjava/util/Collections$SynchronizedCollection;->size()I+]Ljava/util/Collection;Ljava/util/ArrayList;
+HSPLjava/util/Collections$SynchronizedCollection;->size()I
 HSPLjava/util/Collections$SynchronizedCollection;->toArray()[Ljava/lang/Object;
-HSPLjava/util/Collections$SynchronizedCollection;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;+]Ljava/util/Collection;Ljava/util/ArrayList;
+HSPLjava/util/Collections$SynchronizedCollection;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
 HSPLjava/util/Collections$SynchronizedCollection;->toString()Ljava/lang/String;
 HSPLjava/util/Collections$SynchronizedList;-><init>(Ljava/util/List;)V
-HSPLjava/util/Collections$SynchronizedList;->get(I)Ljava/lang/Object;+]Ljava/util/List;Ljava/util/ArrayList;
+HSPLjava/util/Collections$SynchronizedList;->get(I)Ljava/lang/Object;
 HSPLjava/util/Collections$SynchronizedMap;-><init>(Ljava/util/Map;)V
 HSPLjava/util/Collections$SynchronizedMap;->clear()V
 HSPLjava/util/Collections$SynchronizedMap;->containsKey(Ljava/lang/Object;)Z
@@ -5323,16 +5230,16 @@
 HSPLjava/util/Collections$SynchronizedSet;-><init>(Ljava/util/Set;)V
 HSPLjava/util/Collections$SynchronizedSet;-><init>(Ljava/util/Set;Ljava/lang/Object;)V
 HSPLjava/util/Collections$SynchronizedSet;->equals(Ljava/lang/Object;)Z
-HSPLjava/util/Collections$UnmodifiableCollection$1;-><init>(Ljava/util/Collections$UnmodifiableCollection;)V+]Ljava/util/Collection;missing_types
-HSPLjava/util/Collections$UnmodifiableCollection$1;->hasNext()Z+]Ljava/util/Iterator;megamorphic_types
-HSPLjava/util/Collections$UnmodifiableCollection$1;->next()Ljava/lang/Object;+]Ljava/util/Iterator;megamorphic_types
+HSPLjava/util/Collections$UnmodifiableCollection$1;-><init>(Ljava/util/Collections$UnmodifiableCollection;)V
+HSPLjava/util/Collections$UnmodifiableCollection$1;->hasNext()Z
+HSPLjava/util/Collections$UnmodifiableCollection$1;->next()Ljava/lang/Object;
 HSPLjava/util/Collections$UnmodifiableCollection;-><init>(Ljava/util/Collection;)V
-HSPLjava/util/Collections$UnmodifiableCollection;->contains(Ljava/lang/Object;)Z+]Ljava/util/Collection;megamorphic_types
+HSPLjava/util/Collections$UnmodifiableCollection;->contains(Ljava/lang/Object;)Z
 HSPLjava/util/Collections$UnmodifiableCollection;->containsAll(Ljava/util/Collection;)Z
 HSPLjava/util/Collections$UnmodifiableCollection;->forEach(Ljava/util/function/Consumer;)V
-HSPLjava/util/Collections$UnmodifiableCollection;->isEmpty()Z+]Ljava/util/Collection;Ljava/util/ArrayList;,Ljava/util/TreeMap$KeySet;
+HSPLjava/util/Collections$UnmodifiableCollection;->isEmpty()Z
 HSPLjava/util/Collections$UnmodifiableCollection;->iterator()Ljava/util/Iterator;
-HSPLjava/util/Collections$UnmodifiableCollection;->size()I+]Ljava/util/Collection;missing_types
+HSPLjava/util/Collections$UnmodifiableCollection;->size()I
 HSPLjava/util/Collections$UnmodifiableCollection;->stream()Ljava/util/stream/Stream;
 HSPLjava/util/Collections$UnmodifiableCollection;->toArray()[Ljava/lang/Object;
 HSPLjava/util/Collections$UnmodifiableCollection;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
@@ -5343,7 +5250,7 @@
 HSPLjava/util/Collections$UnmodifiableList$1;->nextIndex()I
 HSPLjava/util/Collections$UnmodifiableList;-><init>(Ljava/util/List;)V
 HSPLjava/util/Collections$UnmodifiableList;->equals(Ljava/lang/Object;)Z
-HSPLjava/util/Collections$UnmodifiableList;->get(I)Ljava/lang/Object;+]Ljava/util/List;missing_types
+HSPLjava/util/Collections$UnmodifiableList;->get(I)Ljava/lang/Object;
 HSPLjava/util/Collections$UnmodifiableList;->hashCode()I
 HSPLjava/util/Collections$UnmodifiableList;->indexOf(Ljava/lang/Object;)I
 HSPLjava/util/Collections$UnmodifiableList;->listIterator()Ljava/util/ListIterator;
@@ -5362,7 +5269,7 @@
 HSPLjava/util/Collections$UnmodifiableMap;->entrySet()Ljava/util/Set;
 HSPLjava/util/Collections$UnmodifiableMap;->equals(Ljava/lang/Object;)Z
 HSPLjava/util/Collections$UnmodifiableMap;->forEach(Ljava/util/function/BiConsumer;)V
-HSPLjava/util/Collections$UnmodifiableMap;->get(Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/util/Map;missing_types
+HSPLjava/util/Collections$UnmodifiableMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/Collections$UnmodifiableMap;->hashCode()I
 HSPLjava/util/Collections$UnmodifiableMap;->isEmpty()Z
 HSPLjava/util/Collections$UnmodifiableMap;->keySet()Ljava/util/Set;
@@ -5375,7 +5282,7 @@
 HSPLjava/util/Collections$UnmodifiableSet;->equals(Ljava/lang/Object;)Z
 HSPLjava/util/Collections$UnmodifiableSortedMap;-><init>(Ljava/util/SortedMap;)V
 HSPLjava/util/Collections$UnmodifiableSortedSet;-><init>(Ljava/util/SortedSet;)V
-HSPLjava/util/Collections;->addAll(Ljava/util/Collection;[Ljava/lang/Object;)Z+]Ljava/util/Collection;Ljava/util/ArrayList;
+HSPLjava/util/Collections;->addAll(Ljava/util/Collection;[Ljava/lang/Object;)Z
 HSPLjava/util/Collections;->binarySearch(Ljava/util/List;Ljava/lang/Object;)I
 HSPLjava/util/Collections;->binarySearch(Ljava/util/List;Ljava/lang/Object;Ljava/util/Comparator;)I
 HSPLjava/util/Collections;->disjoint(Ljava/util/Collection;Ljava/util/Collection;)Z
@@ -5387,8 +5294,8 @@
 HSPLjava/util/Collections;->emptySet()Ljava/util/Set;
 HSPLjava/util/Collections;->enumeration(Ljava/util/Collection;)Ljava/util/Enumeration;
 HSPLjava/util/Collections;->eq(Ljava/lang/Object;Ljava/lang/Object;)Z
-HSPLjava/util/Collections;->indexedBinarySearch(Ljava/util/List;Ljava/lang/Object;)I+]Ljava/util/List;Ljava/util/ArrayList;]Ljava/lang/Comparable;Ljava/lang/Integer;
-HSPLjava/util/Collections;->indexedBinarySearch(Ljava/util/List;Ljava/lang/Object;Ljava/util/Comparator;)I
+HSPLjava/util/Collections;->indexedBinarySearch(Ljava/util/List;Ljava/lang/Object;)I
+HSPLjava/util/Collections;->indexedBinarySearch(Ljava/util/List;Ljava/lang/Object;Ljava/util/Comparator;)I+]Ljava/util/List;missing_types
 HSPLjava/util/Collections;->list(Ljava/util/Enumeration;)Ljava/util/ArrayList;
 HSPLjava/util/Collections;->max(Ljava/util/Collection;)Ljava/lang/Object;
 HSPLjava/util/Collections;->max(Ljava/util/Collection;Ljava/util/Comparator;)Ljava/lang/Object;
@@ -5416,8 +5323,8 @@
 HSPLjava/util/Collections;->synchronizedSet(Ljava/util/Set;)Ljava/util/Set;
 HSPLjava/util/Collections;->synchronizedSet(Ljava/util/Set;Ljava/lang/Object;)Ljava/util/Set;
 HSPLjava/util/Collections;->unmodifiableCollection(Ljava/util/Collection;)Ljava/util/Collection;
-HSPLjava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;+]Ljava/lang/Object;missing_types
-HSPLjava/util/Collections;->unmodifiableMap(Ljava/util/Map;)Ljava/util/Map;+]Ljava/lang/Object;missing_types
+HSPLjava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;
+HSPLjava/util/Collections;->unmodifiableMap(Ljava/util/Map;)Ljava/util/Map;
 HSPLjava/util/Collections;->unmodifiableSet(Ljava/util/Set;)Ljava/util/Set;
 HSPLjava/util/Collections;->unmodifiableSortedMap(Ljava/util/SortedMap;)Ljava/util/SortedMap;
 HSPLjava/util/Collections;->unmodifiableSortedSet(Ljava/util/SortedSet;)Ljava/util/SortedSet;
@@ -5438,10 +5345,8 @@
 HSPLjava/util/ComparableTimSort;->sort([Ljava/lang/Object;II[Ljava/lang/Object;II)V
 HSPLjava/util/Comparator$$ExternalSyntheticLambda1;-><init>(Ljava/util/Comparator;Ljava/util/Comparator;)V
 HSPLjava/util/Comparator$$ExternalSyntheticLambda1;->compare(Ljava/lang/Object;Ljava/lang/Object;)I
-HSPLjava/util/Comparator$$ExternalSyntheticLambda3;-><init>(Ljava/util/function/ToIntFunction;)V
 HSPLjava/util/Comparator$$ExternalSyntheticLambda3;->compare(Ljava/lang/Object;Ljava/lang/Object;)I
 HSPLjava/util/Comparator$$ExternalSyntheticLambda4;-><init>(Ljava/util/function/ToLongFunction;)V
-HSPLjava/util/Comparator$$ExternalSyntheticLambda5;-><init>(Ljava/util/function/Function;)V
 HSPLjava/util/Comparator$$ExternalSyntheticLambda5;->compare(Ljava/lang/Object;Ljava/lang/Object;)I
 HSPLjava/util/Comparator;->comparing(Ljava/util/function/Function;)Ljava/util/Comparator;
 HSPLjava/util/Comparator;->comparingInt(Ljava/util/function/ToIntFunction;)Ljava/util/Comparator;
@@ -5460,7 +5365,7 @@
 HSPLjava/util/Currency;-><init>(Landroid/icu/util/Currency;)V
 HSPLjava/util/Currency;->getCurrencyCode()Ljava/lang/String;
 HSPLjava/util/Currency;->getInstance(Ljava/lang/String;)Ljava/util/Currency;
-HSPLjava/util/Currency;->getInstance(Ljava/util/Locale;)Ljava/util/Currency;+]Ljava/util/Locale;Ljava/util/Locale;]Landroid/icu/util/Currency;Landroid/icu/util/Currency;
+HSPLjava/util/Currency;->getInstance(Ljava/util/Locale;)Ljava/util/Currency;
 HSPLjava/util/Currency;->getSymbol(Ljava/util/Locale;)Ljava/lang/String;
 HSPLjava/util/Date;-><init>()V
 HSPLjava/util/Date;-><init>(J)V
@@ -5528,9 +5433,9 @@
 HSPLjava/util/EnumMap;->clear()V
 HSPLjava/util/EnumMap;->containsKey(Ljava/lang/Object;)Z
 HSPLjava/util/EnumMap;->entrySet()Ljava/util/Set;
-HSPLjava/util/EnumMap;->get(Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/lang/Enum;missing_types
+HSPLjava/util/EnumMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/EnumMap;->getKeyUniverse(Ljava/lang/Class;)[Ljava/lang/Enum;
-HSPLjava/util/EnumMap;->isValidKey(Ljava/lang/Object;)Z+]Ljava/lang/Object;missing_types
+HSPLjava/util/EnumMap;->isValidKey(Ljava/lang/Object;)Z
 HSPLjava/util/EnumMap;->keySet()Ljava/util/Set;
 HSPLjava/util/EnumMap;->maskNull(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/EnumMap;->put(Ljava/lang/Enum;Ljava/lang/Object;)Ljava/lang/Object;
@@ -5567,16 +5472,15 @@
 HSPLjava/util/Formatter$FixedString;->print(Ljava/lang/Object;Ljava/util/Locale;)V
 HSPLjava/util/Formatter$Flags;->-$$Nest$madd(Ljava/util/Formatter$Flags;Ljava/util/Formatter$Flags;)Ljava/util/Formatter$Flags;
 HSPLjava/util/Formatter$Flags;-><init>(I)V
-HSPLjava/util/Formatter$Flags;->add(Ljava/util/Formatter$Flags;)Ljava/util/Formatter$Flags;+]Ljava/util/Formatter$Flags;Ljava/util/Formatter$Flags;
-HSPLjava/util/Formatter$Flags;->contains(Ljava/util/Formatter$Flags;)Z+]Ljava/util/Formatter$Flags;Ljava/util/Formatter$Flags;
+HSPLjava/util/Formatter$Flags;->add(Ljava/util/Formatter$Flags;)Ljava/util/Formatter$Flags;
+HSPLjava/util/Formatter$Flags;->contains(Ljava/util/Formatter$Flags;)Z
 HSPLjava/util/Formatter$Flags;->parse(C)Ljava/util/Formatter$Flags;
-HSPLjava/util/Formatter$Flags;->parse(Ljava/lang/String;II)Ljava/util/Formatter$Flags;+]Ljava/util/Formatter$Flags;Ljava/util/Formatter$Flags;
+HSPLjava/util/Formatter$Flags;->parse(Ljava/lang/String;II)Ljava/util/Formatter$Flags;
 HSPLjava/util/Formatter$Flags;->valueOf()I
 HSPLjava/util/Formatter$FormatSpecifier;-><init>(Ljava/util/Formatter;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
 HSPLjava/util/Formatter$FormatSpecifier;->addZeros(Ljava/lang/StringBuilder;I)V
 HSPLjava/util/Formatter$FormatSpecifier;->adjustWidth(ILjava/util/Formatter$Flags;Z)I
-HSPLjava/util/Formatter$FormatSpecifier;->appendJustified(Ljava/lang/Appendable;Ljava/lang/CharSequence;)Ljava/lang/Appendable;+]Ljava/util/Formatter$Flags;Ljava/util/Formatter$Flags;]Ljava/lang/CharSequence;Ljava/lang/String;,Ljava/lang/StringBuilder;]Ljava/lang/Appendable;Ljava/lang/StringBuilder;
-HSPLjava/util/Formatter$FormatSpecifier;->checkBadFlags([Ljava/util/Formatter$Flags;)V+]Ljava/util/Formatter$Flags;Ljava/util/Formatter$Flags;
+HSPLjava/util/Formatter$FormatSpecifier;->checkBadFlags([Ljava/util/Formatter$Flags;)V
 HSPLjava/util/Formatter$FormatSpecifier;->checkCharacter()V
 HSPLjava/util/Formatter$FormatSpecifier;->checkDateTime()V
 HSPLjava/util/Formatter$FormatSpecifier;->checkFloat()V
@@ -5584,15 +5488,11 @@
 HSPLjava/util/Formatter$FormatSpecifier;->checkInteger()V
 HSPLjava/util/Formatter$FormatSpecifier;->checkNumeric()V
 HSPLjava/util/Formatter$FormatSpecifier;->checkText()V
-HSPLjava/util/Formatter$FormatSpecifier;->conversion(C)C
-HSPLjava/util/Formatter$FormatSpecifier;->flags(Ljava/lang/String;)Ljava/util/Formatter$Flags;+]Ljava/util/Formatter$Flags;Ljava/util/Formatter$Flags;
 HSPLjava/util/Formatter$FormatSpecifier;->getZero(Ljava/util/Locale;)C
 HSPLjava/util/Formatter$FormatSpecifier;->index()I
-HSPLjava/util/Formatter$FormatSpecifier;->index(Ljava/lang/String;)I
 HSPLjava/util/Formatter$FormatSpecifier;->leadingSign(Ljava/lang/StringBuilder;Z)Ljava/lang/StringBuilder;
 HSPLjava/util/Formatter$FormatSpecifier;->localizedMagnitude(Ljava/lang/StringBuilder;JLjava/util/Formatter$Flags;ILjava/util/Locale;)Ljava/lang/StringBuilder;
-HSPLjava/util/Formatter$FormatSpecifier;->localizedMagnitude(Ljava/lang/StringBuilder;Ljava/lang/CharSequence;ILjava/util/Formatter$Flags;ILjava/util/Locale;)Ljava/lang/StringBuilder;+]Ljava/text/DecimalFormatSymbols;Ljava/text/DecimalFormatSymbols;]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/util/Formatter$Flags;Ljava/util/Formatter$Flags;]Ljava/util/Locale;Ljava/util/Locale;]Ljava/lang/CharSequence;Ljava/lang/String;,Ljava/lang/StringBuilder;
-HSPLjava/util/Formatter$FormatSpecifier;->precision(Ljava/lang/String;)I
+HSPLjava/util/Formatter$FormatSpecifier;->localizedMagnitude(Ljava/lang/StringBuilder;Ljava/lang/CharSequence;ILjava/util/Formatter$Flags;ILjava/util/Locale;)Ljava/lang/StringBuilder;
 HSPLjava/util/Formatter$FormatSpecifier;->print(BLjava/util/Locale;)V
 HSPLjava/util/Formatter$FormatSpecifier;->print(DLjava/util/Locale;)V
 HSPLjava/util/Formatter$FormatSpecifier;->print(FLjava/util/Locale;)V
@@ -5605,25 +5505,23 @@
 HSPLjava/util/Formatter$FormatSpecifier;->print(Ljava/math/BigInteger;Ljava/util/Locale;)V
 HSPLjava/util/Formatter$FormatSpecifier;->print(Ljava/util/Calendar;CLjava/util/Locale;)V
 HSPLjava/util/Formatter$FormatSpecifier;->printBoolean(Ljava/lang/Object;Ljava/util/Locale;)V
-HSPLjava/util/Formatter$FormatSpecifier;->printCharacter(Ljava/lang/Object;Ljava/util/Locale;)V+]Ljava/lang/Character;Ljava/lang/Character;
+HSPLjava/util/Formatter$FormatSpecifier;->printCharacter(Ljava/lang/Object;Ljava/util/Locale;)V
 HSPLjava/util/Formatter$FormatSpecifier;->printDateTime(Ljava/lang/Object;Ljava/util/Locale;)V
 HSPLjava/util/Formatter$FormatSpecifier;->printFloat(Ljava/lang/Object;Ljava/util/Locale;)V
-HSPLjava/util/Formatter$FormatSpecifier;->printInteger(Ljava/lang/Object;Ljava/util/Locale;)V+]Ljava/lang/Integer;Ljava/lang/Integer;]Ljava/lang/Long;Ljava/lang/Long;]Ljava/lang/Byte;Ljava/lang/Byte;
+HSPLjava/util/Formatter$FormatSpecifier;->printInteger(Ljava/lang/Object;Ljava/util/Locale;)V
 HSPLjava/util/Formatter$FormatSpecifier;->printString(Ljava/lang/Object;Ljava/util/Locale;)V
 HSPLjava/util/Formatter$FormatSpecifier;->trailingSign(Ljava/lang/StringBuilder;Z)Ljava/lang/StringBuilder;
 HSPLjava/util/Formatter$FormatSpecifier;->trailingZeros(Ljava/lang/StringBuilder;I)V
-HSPLjava/util/Formatter$FormatSpecifier;->width(Ljava/lang/String;)I
-HSPLjava/util/Formatter$FormatSpecifierParser;-><init>(Ljava/util/Formatter;Ljava/lang/String;I)V+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
+HSPLjava/util/Formatter$FormatSpecifierParser;-><init>(Ljava/util/Formatter;Ljava/lang/String;I)V
 HSPLjava/util/Formatter$FormatSpecifierParser;->advance()C
 HSPLjava/util/Formatter$FormatSpecifierParser;->back(I)V
 HSPLjava/util/Formatter$FormatSpecifierParser;->getEndIdx()I
 HSPLjava/util/Formatter$FormatSpecifierParser;->getFormatSpecifier()Ljava/util/Formatter$FormatSpecifier;
 HSPLjava/util/Formatter$FormatSpecifierParser;->isEnd()Z
-HSPLjava/util/Formatter$FormatSpecifierParser;->nextInt()Ljava/lang/String;+]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/util/Formatter$FormatSpecifierParser;->nextInt()Ljava/lang/String;
 HSPLjava/util/Formatter$FormatSpecifierParser;->nextIsInt()Z
 HSPLjava/util/Formatter$FormatSpecifierParser;->peek()C
 HSPLjava/util/Formatter;->-$$Nest$fgeta(Ljava/util/Formatter;)Ljava/lang/Appendable;
-HSPLjava/util/Formatter;->-$$Nest$fgetzero(Ljava/util/Formatter;)C
 HSPLjava/util/Formatter;-><init>()V
 HSPLjava/util/Formatter;-><init>(Ljava/lang/Appendable;)V
 HSPLjava/util/Formatter;-><init>(Ljava/lang/Appendable;Ljava/util/Locale;)V
@@ -5632,25 +5530,24 @@
 HSPLjava/util/Formatter;->close()V
 HSPLjava/util/Formatter;->ensureOpen()V
 HSPLjava/util/Formatter;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/util/Formatter;
-HSPLjava/util/Formatter;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/util/Formatter;+]Ljava/util/List;Ljava/util/ArrayList;]Ljava/util/Formatter$FormatString;Ljava/util/Formatter$FixedString;,Ljava/util/Formatter$FormatSpecifier;]Ljava/util/Iterator;Ljava/util/ArrayList$Itr;
-HSPLjava/util/Formatter;->getZero(Ljava/util/Locale;)C+]Ljava/util/Locale;Ljava/util/Locale;]Llibcore/icu/DecimalFormatData;Llibcore/icu/DecimalFormatData;
+HSPLjava/util/Formatter;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/util/Formatter;
 HSPLjava/util/Formatter;->locale()Ljava/util/Locale;
 HSPLjava/util/Formatter;->nonNullAppendable(Ljava/lang/Appendable;)Ljava/lang/Appendable;
 HSPLjava/util/Formatter;->out()Ljava/lang/Appendable;
-HSPLjava/util/Formatter;->parse(Ljava/lang/String;)Ljava/util/List;+]Ljava/util/Formatter$FormatSpecifierParser;Ljava/util/Formatter$FormatSpecifierParser;]Ljava/util/ArrayList;Ljava/util/ArrayList;
+HSPLjava/util/Formatter;->parse(Ljava/lang/String;)Ljava/util/List;
 HSPLjava/util/Formatter;->toString()Ljava/lang/String;
-HSPLjava/util/GregorianCalendar;-><init>()V+]Ljava/util/GregorianCalendar;Ljava/util/GregorianCalendar;
+HSPLjava/util/GregorianCalendar;-><init>()V
 HSPLjava/util/GregorianCalendar;-><init>(IIIIII)V
 HSPLjava/util/GregorianCalendar;-><init>(IIIIIII)V
 HSPLjava/util/GregorianCalendar;-><init>(Ljava/util/TimeZone;)V
-HSPLjava/util/GregorianCalendar;-><init>(Ljava/util/TimeZone;Ljava/util/Locale;)V+]Lsun/util/calendar/Gregorian;Lsun/util/calendar/Gregorian;]Ljava/util/GregorianCalendar;Ljava/util/GregorianCalendar;
+HSPLjava/util/GregorianCalendar;-><init>(Ljava/util/TimeZone;Ljava/util/Locale;)V
 HSPLjava/util/GregorianCalendar;->add(II)V
 HSPLjava/util/GregorianCalendar;->adjustDstOffsetForInvalidWallClock(JLjava/util/TimeZone;I)I
 HSPLjava/util/GregorianCalendar;->adjustForZoneAndDaylightSavingsTime(IJLjava/util/TimeZone;)J
 HSPLjava/util/GregorianCalendar;->clone()Ljava/lang/Object;
-HSPLjava/util/GregorianCalendar;->computeFields()V+]Ljava/util/GregorianCalendar;Ljava/util/GregorianCalendar;
-HSPLjava/util/GregorianCalendar;->computeFields(II)I+]Lsun/util/calendar/Gregorian;Lsun/util/calendar/Gregorian;]Ljava/util/GregorianCalendar;Ljava/util/GregorianCalendar;]Lsun/util/calendar/BaseCalendar$Date;Lsun/util/calendar/Gregorian$Date;]Lsun/util/calendar/BaseCalendar;Lsun/util/calendar/Gregorian;]Llibcore/util/ZoneInfo;Llibcore/util/ZoneInfo;]Ljava/util/TimeZone;Ljava/util/SimpleTimeZone;
-HSPLjava/util/GregorianCalendar;->computeTime()V+]Ljava/util/GregorianCalendar;Ljava/util/GregorianCalendar;
+HSPLjava/util/GregorianCalendar;->computeFields()V
+HSPLjava/util/GregorianCalendar;->computeFields(II)I
+HSPLjava/util/GregorianCalendar;->computeTime()V
 HSPLjava/util/GregorianCalendar;->getActualMaximum(I)I
 HSPLjava/util/GregorianCalendar;->getCalendarDate(J)Lsun/util/calendar/BaseCalendar$Date;
 HSPLjava/util/GregorianCalendar;->getCurrentFixedDate()J
@@ -5662,7 +5559,7 @@
 HSPLjava/util/GregorianCalendar;->getMinimum(I)I
 HSPLjava/util/GregorianCalendar;->getNormalizedCalendar()Ljava/util/GregorianCalendar;
 HSPLjava/util/GregorianCalendar;->getTimeZone()Ljava/util/TimeZone;
-HSPLjava/util/GregorianCalendar;->getWeekNumber(JJ)I+]Ljava/util/GregorianCalendar;Ljava/util/GregorianCalendar;
+HSPLjava/util/GregorianCalendar;->getWeekNumber(JJ)I
 HSPLjava/util/GregorianCalendar;->internalGetEra()I
 HSPLjava/util/GregorianCalendar;->isCutoverYear(I)Z
 HSPLjava/util/GregorianCalendar;->isLeapYear(I)Z
@@ -5673,8 +5570,8 @@
 HSPLjava/util/GregorianCalendar;->setGregorianChange(Ljava/util/Date;)V
 HSPLjava/util/GregorianCalendar;->setTimeZone(Ljava/util/TimeZone;)V
 HSPLjava/util/HashMap$EntryIterator;-><init>(Ljava/util/HashMap;)V
-HSPLjava/util/HashMap$EntryIterator;->next()Ljava/lang/Object;+]Ljava/util/HashMap$EntryIterator;Ljava/util/HashMap$EntryIterator;
-HSPLjava/util/HashMap$EntryIterator;->next()Ljava/util/Map$Entry;+]Ljava/util/HashMap$EntryIterator;Ljava/util/HashMap$EntryIterator;
+HSPLjava/util/HashMap$EntryIterator;->next()Ljava/lang/Object;
+HSPLjava/util/HashMap$EntryIterator;->next()Ljava/util/Map$Entry;
 HSPLjava/util/HashMap$EntrySet;-><init>(Ljava/util/HashMap;)V
 HSPLjava/util/HashMap$EntrySet;->iterator()Ljava/util/Iterator;
 HSPLjava/util/HashMap$EntrySet;->size()I
@@ -5689,7 +5586,7 @@
 HSPLjava/util/HashMap$HashMapSpliterator;->estimateSize()J
 HSPLjava/util/HashMap$HashMapSpliterator;->getFence()I
 HSPLjava/util/HashMap$KeyIterator;-><init>(Ljava/util/HashMap;)V
-HSPLjava/util/HashMap$KeyIterator;->next()Ljava/lang/Object;+]Ljava/util/HashMap$KeyIterator;Ljava/util/HashMap$KeyIterator;
+HSPLjava/util/HashMap$KeyIterator;->next()Ljava/lang/Object;
 HSPLjava/util/HashMap$KeySet;-><init>(Ljava/util/HashMap;)V
 HSPLjava/util/HashMap$KeySet;->contains(Ljava/lang/Object;)Z
 HSPLjava/util/HashMap$KeySet;->forEach(Ljava/util/function/Consumer;)V
@@ -5700,7 +5597,7 @@
 HSPLjava/util/HashMap$KeySet;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
 HSPLjava/util/HashMap$KeySpliterator;-><init>(Ljava/util/HashMap;IIII)V
 HSPLjava/util/HashMap$KeySpliterator;->characteristics()I
-HSPLjava/util/HashMap$KeySpliterator;->forEachRemaining(Ljava/util/function/Consumer;)V+]Ljava/util/function/Consumer;Ljava/util/stream/ReferencePipeline$4$1;
+HSPLjava/util/HashMap$KeySpliterator;->forEachRemaining(Ljava/util/function/Consumer;)V
 HSPLjava/util/HashMap$KeySpliterator;->tryAdvance(Ljava/util/function/Consumer;)Z
 HSPLjava/util/HashMap$Node;-><init>(ILjava/lang/Object;Ljava/lang/Object;Ljava/util/HashMap$Node;)V
 HSPLjava/util/HashMap$Node;->getKey()Ljava/lang/Object;
@@ -5734,7 +5631,7 @@
 HSPLjava/util/HashMap;-><init>()V
 HSPLjava/util/HashMap;-><init>(I)V
 HSPLjava/util/HashMap;-><init>(IF)V
-HSPLjava/util/HashMap;-><init>(Ljava/util/Map;)V+]Ljava/util/HashMap;Ljava/util/HashMap;
+HSPLjava/util/HashMap;-><init>(Ljava/util/Map;)V
 HSPLjava/util/HashMap;->afterNodeAccess(Ljava/util/HashMap$Node;)V
 HSPLjava/util/HashMap;->afterNodeInsertion(Z)V
 HSPLjava/util/HashMap;->afterNodeRemoval(Ljava/util/HashMap$Node;)V
@@ -5742,14 +5639,14 @@
 HSPLjava/util/HashMap;->clear()V
 HSPLjava/util/HashMap;->clone()Ljava/lang/Object;
 HSPLjava/util/HashMap;->computeIfAbsent(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;
-HSPLjava/util/HashMap;->containsKey(Ljava/lang/Object;)Z+]Ljava/util/HashMap;missing_types
+HSPLjava/util/HashMap;->containsKey(Ljava/lang/Object;)Z
 HSPLjava/util/HashMap;->containsValue(Ljava/lang/Object;)Z
 HSPLjava/util/HashMap;->entrySet()Ljava/util/Set;
 HSPLjava/util/HashMap;->forEach(Ljava/util/function/BiConsumer;)V
-HSPLjava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/util/HashMap;missing_types
-HSPLjava/util/HashMap;->getNode(Ljava/lang/Object;)Ljava/util/HashMap$Node;+]Ljava/lang/Object;megamorphic_types
+HSPLjava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
+HSPLjava/util/HashMap;->getNode(Ljava/lang/Object;)Ljava/util/HashMap$Node;
 HSPLjava/util/HashMap;->getOrDefault(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
-HSPLjava/util/HashMap;->hash(Ljava/lang/Object;)I+]Ljava/lang/Object;megamorphic_types
+HSPLjava/util/HashMap;->hash(Ljava/lang/Object;)I
 HSPLjava/util/HashMap;->internalWriteEntries(Ljava/io/ObjectOutputStream;)V
 HSPLjava/util/HashMap;->isEmpty()Z
 HSPLjava/util/HashMap;->keySet()Ljava/util/Set;
@@ -5759,15 +5656,15 @@
 HSPLjava/util/HashMap;->newNode(ILjava/lang/Object;Ljava/lang/Object;Ljava/util/HashMap$Node;)Ljava/util/HashMap$Node;
 HSPLjava/util/HashMap;->newTreeNode(ILjava/lang/Object;Ljava/lang/Object;Ljava/util/HashMap$Node;)Ljava/util/HashMap$TreeNode;
 HSPLjava/util/HashMap;->prepareArray([Ljava/lang/Object;)[Ljava/lang/Object;
-HSPLjava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/util/HashMap;missing_types
+HSPLjava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/HashMap;->putAll(Ljava/util/Map;)V
 HSPLjava/util/HashMap;->putIfAbsent(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
-HSPLjava/util/HashMap;->putMapEntries(Ljava/util/Map;Z)V+]Ljava/util/HashMap;missing_types]Ljava/util/Map$Entry;megamorphic_types]Ljava/util/Map;missing_types]Ljava/util/Iterator;missing_types]Ljava/util/Set;missing_types
-HSPLjava/util/HashMap;->putVal(ILjava/lang/Object;Ljava/lang/Object;ZZ)Ljava/lang/Object;+]Ljava/util/HashMap;missing_types]Ljava/lang/Object;megamorphic_types]Ljava/util/HashMap$TreeNode;Ljava/util/HashMap$TreeNode;
+HSPLjava/util/HashMap;->putMapEntries(Ljava/util/Map;Z)V
+HSPLjava/util/HashMap;->putVal(ILjava/lang/Object;Ljava/lang/Object;ZZ)Ljava/lang/Object;
 HSPLjava/util/HashMap;->readObject(Ljava/io/ObjectInputStream;)V
 HSPLjava/util/HashMap;->reinitialize()V
-HSPLjava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/util/HashMap;missing_types
-HSPLjava/util/HashMap;->removeNode(ILjava/lang/Object;Ljava/lang/Object;ZZ)Ljava/util/HashMap$Node;+]Ljava/util/HashMap;missing_types]Ljava/lang/Object;missing_types
+HSPLjava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
+HSPLjava/util/HashMap;->removeNode(ILjava/lang/Object;Ljava/lang/Object;ZZ)Ljava/util/HashMap$Node;
 HSPLjava/util/HashMap;->replacementNode(Ljava/util/HashMap$Node;Ljava/util/HashMap$Node;)Ljava/util/HashMap$Node;
 HSPLjava/util/HashMap;->replacementTreeNode(Ljava/util/HashMap$Node;Ljava/util/HashMap$Node;)Ljava/util/HashMap$TreeNode;
 HSPLjava/util/HashMap;->resize()[Ljava/util/HashMap$Node;
@@ -5782,15 +5679,15 @@
 HSPLjava/util/HashSet;-><init>(IF)V
 HSPLjava/util/HashSet;-><init>(IFZ)V
 HSPLjava/util/HashSet;-><init>(Ljava/util/Collection;)V
-HSPLjava/util/HashSet;->add(Ljava/lang/Object;)Z+]Ljava/util/HashMap;Ljava/util/HashMap;,Ljava/util/LinkedHashMap;
+HSPLjava/util/HashSet;->add(Ljava/lang/Object;)Z
 HSPLjava/util/HashSet;->clear()V
 HSPLjava/util/HashSet;->clone()Ljava/lang/Object;
-HSPLjava/util/HashSet;->contains(Ljava/lang/Object;)Z+]Ljava/util/HashMap;Ljava/util/HashMap;,Ljava/util/LinkedHashMap;
+HSPLjava/util/HashSet;->contains(Ljava/lang/Object;)Z
 HSPLjava/util/HashSet;->isEmpty()Z
-HSPLjava/util/HashSet;->iterator()Ljava/util/Iterator;+]Ljava/util/HashMap;Ljava/util/HashMap;,Ljava/util/LinkedHashMap;]Ljava/util/Set;Ljava/util/HashMap$KeySet;,Ljava/util/LinkedHashMap$LinkedKeySet;
+HSPLjava/util/HashSet;->iterator()Ljava/util/Iterator;
 HSPLjava/util/HashSet;->readObject(Ljava/io/ObjectInputStream;)V
-HSPLjava/util/HashSet;->remove(Ljava/lang/Object;)Z+]Ljava/util/HashMap;Ljava/util/HashMap;
-HSPLjava/util/HashSet;->size()I+]Ljava/util/HashMap;Ljava/util/HashMap;,Ljava/util/LinkedHashMap;
+HSPLjava/util/HashSet;->remove(Ljava/lang/Object;)Z
+HSPLjava/util/HashSet;->size()I
 HSPLjava/util/HashSet;->spliterator()Ljava/util/Spliterator;
 HSPLjava/util/HashSet;->writeObject(Ljava/io/ObjectOutputStream;)V
 HSPLjava/util/Hashtable$EntrySet;-><init>(Ljava/util/Hashtable;)V
@@ -5820,7 +5717,7 @@
 HSPLjava/util/Hashtable;->clone()Ljava/lang/Object;
 HSPLjava/util/Hashtable;->containsKey(Ljava/lang/Object;)Z
 HSPLjava/util/Hashtable;->entrySet()Ljava/util/Set;
-HSPLjava/util/Hashtable;->get(Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/lang/Object;Ljava/lang/String;
+HSPLjava/util/Hashtable;->get(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/Hashtable;->getEnumeration(I)Ljava/util/Enumeration;
 HSPLjava/util/Hashtable;->getIterator(I)Ljava/util/Iterator;
 HSPLjava/util/Hashtable;->isEmpty()Z
@@ -5894,13 +5791,13 @@
 HSPLjava/util/ImmutableCollections$MapN;-><init>([Ljava/lang/Object;)V
 HSPLjava/util/ImmutableCollections$MapN;->containsKey(Ljava/lang/Object;)Z
 HSPLjava/util/ImmutableCollections$MapN;->get(Ljava/lang/Object;)Ljava/lang/Object;
-HSPLjava/util/ImmutableCollections$MapN;->probe(Ljava/lang/Object;)I+]Ljava/lang/Object;Ljava/lang/String;
+HSPLjava/util/ImmutableCollections$MapN;->probe(Ljava/lang/Object;)I
 HSPLjava/util/ImmutableCollections$SetN;-><init>([Ljava/lang/Object;)V
 HSPLjava/util/ImmutableCollections$SetN;->contains(Ljava/lang/Object;)Z
 HSPLjava/util/ImmutableCollections$SetN;->probe(Ljava/lang/Object;)I
 HSPLjava/util/ImmutableCollections;-><clinit>()V
 HSPLjava/util/ImmutableCollections;->listCopy(Ljava/util/Collection;)Ljava/util/List;
-HSPLjava/util/Iterator;->forEachRemaining(Ljava/util/function/Consumer;)V+]Ljava/util/function/Consumer;missing_types]Ljava/util/Iterator;Landroid/util/MapCollections$ArrayIterator;
+HSPLjava/util/Iterator;->forEachRemaining(Ljava/util/function/Consumer;)V+]Ljava/util/function/Consumer;megamorphic_types]Ljava/util/Iterator;Landroid/util/MapCollections$ArrayIterator;
 HSPLjava/util/JumboEnumSet$EnumSetIterator;-><init>(Ljava/util/JumboEnumSet;)V
 HSPLjava/util/JumboEnumSet$EnumSetIterator;->hasNext()Z
 HSPLjava/util/JumboEnumSet$EnumSetIterator;->next()Ljava/lang/Enum;
@@ -5915,26 +5812,17 @@
 HSPLjava/util/KeyValueHolder;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
 HSPLjava/util/KeyValueHolder;->getKey()Ljava/lang/Object;
 HSPLjava/util/KeyValueHolder;->getValue()Ljava/lang/Object;
-HSPLjava/util/LinkedHashMap$LinkedEntryIterator;-><init>(Ljava/util/LinkedHashMap;)V
-HSPLjava/util/LinkedHashMap$LinkedEntryIterator;->next()Ljava/lang/Object;+]Ljava/util/LinkedHashMap$LinkedEntryIterator;Ljava/util/LinkedHashMap$LinkedEntryIterator;
-HSPLjava/util/LinkedHashMap$LinkedEntryIterator;->next()Ljava/util/Map$Entry;+]Ljava/util/LinkedHashMap$LinkedEntryIterator;Ljava/util/LinkedHashMap$LinkedEntryIterator;
-HSPLjava/util/LinkedHashMap$LinkedEntrySet;-><init>(Ljava/util/LinkedHashMap;)V
+HSPLjava/util/LinkedHashMap$LinkedEntryIterator;->next()Ljava/lang/Object;
+HSPLjava/util/LinkedHashMap$LinkedEntryIterator;->next()Ljava/util/Map$Entry;
 HSPLjava/util/LinkedHashMap$LinkedEntrySet;->iterator()Ljava/util/Iterator;
 HSPLjava/util/LinkedHashMap$LinkedEntrySet;->size()I
-HSPLjava/util/LinkedHashMap$LinkedHashIterator;-><init>(Ljava/util/LinkedHashMap;)V
 HSPLjava/util/LinkedHashMap$LinkedHashIterator;->hasNext()Z
-HSPLjava/util/LinkedHashMap$LinkedHashIterator;->nextNode()Ljava/util/LinkedHashMap$LinkedHashMapEntry;
 HSPLjava/util/LinkedHashMap$LinkedHashIterator;->remove()V
-HSPLjava/util/LinkedHashMap$LinkedHashMapEntry;-><init>(ILjava/lang/Object;Ljava/lang/Object;Ljava/util/HashMap$Node;)V
-HSPLjava/util/LinkedHashMap$LinkedKeyIterator;-><init>(Ljava/util/LinkedHashMap;)V
 HSPLjava/util/LinkedHashMap$LinkedKeyIterator;->next()Ljava/lang/Object;
-HSPLjava/util/LinkedHashMap$LinkedKeySet;-><init>(Ljava/util/LinkedHashMap;)V
 HSPLjava/util/LinkedHashMap$LinkedKeySet;->contains(Ljava/lang/Object;)Z
 HSPLjava/util/LinkedHashMap$LinkedKeySet;->iterator()Ljava/util/Iterator;
 HSPLjava/util/LinkedHashMap$LinkedKeySet;->size()I
-HSPLjava/util/LinkedHashMap$LinkedValueIterator;-><init>(Ljava/util/LinkedHashMap;)V
 HSPLjava/util/LinkedHashMap$LinkedValueIterator;->next()Ljava/lang/Object;
-HSPLjava/util/LinkedHashMap$LinkedValues;-><init>(Ljava/util/LinkedHashMap;)V
 HSPLjava/util/LinkedHashMap$LinkedValues;->iterator()Ljava/util/Iterator;
 HSPLjava/util/LinkedHashMap$LinkedValues;->size()I
 HSPLjava/util/LinkedHashMap;-><init>()V
@@ -5943,20 +5831,18 @@
 HSPLjava/util/LinkedHashMap;-><init>(IFZ)V
 HSPLjava/util/LinkedHashMap;-><init>(Ljava/util/Map;)V
 HSPLjava/util/LinkedHashMap;->afterNodeAccess(Ljava/util/HashMap$Node;)V
-HSPLjava/util/LinkedHashMap;->afterNodeInsertion(Z)V+]Ljava/util/LinkedHashMap;missing_types
+HSPLjava/util/LinkedHashMap;->afterNodeInsertion(Z)V
 HSPLjava/util/LinkedHashMap;->afterNodeRemoval(Ljava/util/HashMap$Node;)V
 HSPLjava/util/LinkedHashMap;->clear()V
 HSPLjava/util/LinkedHashMap;->eldest()Ljava/util/Map$Entry;
 HSPLjava/util/LinkedHashMap;->entrySet()Ljava/util/Set;
-HSPLjava/util/LinkedHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/util/LinkedHashMap;missing_types
+HSPLjava/util/LinkedHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/LinkedHashMap;->keySet()Ljava/util/Set;
-HSPLjava/util/LinkedHashMap;->linkNodeLast(Ljava/util/LinkedHashMap$LinkedHashMapEntry;)V
 HSPLjava/util/LinkedHashMap;->newNode(ILjava/lang/Object;Ljava/lang/Object;Ljava/util/HashMap$Node;)Ljava/util/HashMap$Node;
 HSPLjava/util/LinkedHashMap;->newTreeNode(ILjava/lang/Object;Ljava/lang/Object;Ljava/util/HashMap$Node;)Ljava/util/HashMap$TreeNode;
 HSPLjava/util/LinkedHashMap;->reinitialize()V
 HSPLjava/util/LinkedHashMap;->removeEldestEntry(Ljava/util/Map$Entry;)Z
 HSPLjava/util/LinkedHashMap;->replacementTreeNode(Ljava/util/HashMap$Node;Ljava/util/HashMap$Node;)Ljava/util/HashMap$TreeNode;
-HSPLjava/util/LinkedHashMap;->transferLinks(Ljava/util/LinkedHashMap$LinkedHashMapEntry;Ljava/util/LinkedHashMap$LinkedHashMapEntry;)V
 HSPLjava/util/LinkedHashMap;->values()Ljava/util/Collection;
 HSPLjava/util/LinkedHashSet;-><init>()V
 HSPLjava/util/LinkedHashSet;-><init>(I)V
@@ -5967,14 +5853,14 @@
 HSPLjava/util/LinkedList$ListItr;->hasNext()Z
 HSPLjava/util/LinkedList$ListItr;->hasPrevious()Z
 HSPLjava/util/LinkedList$ListItr;->next()Ljava/lang/Object;
-HSPLjava/util/LinkedList$ListItr;->previous()Ljava/lang/Object;+]Ljava/util/LinkedList$ListItr;Ljava/util/LinkedList$ListItr;
+HSPLjava/util/LinkedList$ListItr;->previous()Ljava/lang/Object;
 HSPLjava/util/LinkedList$ListItr;->remove()V
 HSPLjava/util/LinkedList$ListItr;->set(Ljava/lang/Object;)V
 HSPLjava/util/LinkedList$Node;-><init>(Ljava/util/LinkedList$Node;Ljava/lang/Object;Ljava/util/LinkedList$Node;)V
 HSPLjava/util/LinkedList;-><init>()V
 HSPLjava/util/LinkedList;-><init>(Ljava/util/Collection;)V
 HSPLjava/util/LinkedList;->add(ILjava/lang/Object;)V
-HSPLjava/util/LinkedList;->add(Ljava/lang/Object;)Z+]Ljava/util/LinkedList;missing_types
+HSPLjava/util/LinkedList;->add(Ljava/lang/Object;)Z
 HSPLjava/util/LinkedList;->addAll(ILjava/util/Collection;)Z
 HSPLjava/util/LinkedList;->addAll(Ljava/util/Collection;)Z
 HSPLjava/util/LinkedList;->addFirst(Ljava/lang/Object;)V
@@ -6005,7 +5891,7 @@
 HSPLjava/util/LinkedList;->pop()Ljava/lang/Object;
 HSPLjava/util/LinkedList;->push(Ljava/lang/Object;)V
 HSPLjava/util/LinkedList;->remove()Ljava/lang/Object;
-HSPLjava/util/LinkedList;->remove(I)Ljava/lang/Object;+]Ljava/util/LinkedList;Ljava/util/LinkedList;
+HSPLjava/util/LinkedList;->remove(I)Ljava/lang/Object;
 HSPLjava/util/LinkedList;->remove(Ljava/lang/Object;)Z
 HSPLjava/util/LinkedList;->removeFirst()Ljava/lang/Object;
 HSPLjava/util/LinkedList;->removeLast()Ljava/lang/Object;
@@ -6022,7 +5908,7 @@
 HSPLjava/util/List;->of(Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/List;
 HSPLjava/util/List;->of(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/List;
 HSPLjava/util/List;->of([Ljava/lang/Object;)Ljava/util/List;
-HSPLjava/util/List;->sort(Ljava/util/Comparator;)V+]Ljava/util/ListIterator;Ljava/util/LinkedList$ListItr;,Ljava/util/ArrayList$SubList$1;]Ljava/util/List;Ljava/util/LinkedList;,Ljava/util/ArrayList$SubList;
+HSPLjava/util/List;->sort(Ljava/util/Comparator;)V
 HSPLjava/util/List;->spliterator()Ljava/util/Spliterator;
 HSPLjava/util/Locale$Builder;-><init>()V
 HSPLjava/util/Locale$Builder;->build()Ljava/util/Locale;
@@ -6046,14 +5932,14 @@
 HSPLjava/util/Locale;->cleanCache()V
 HSPLjava/util/Locale;->clone()Ljava/lang/Object;
 HSPLjava/util/Locale;->convertOldISOCodes(Ljava/lang/String;)Ljava/lang/String;
-HSPLjava/util/Locale;->equals(Ljava/lang/Object;)Z+]Lsun/util/locale/BaseLocale;Lsun/util/locale/BaseLocale;
+HSPLjava/util/Locale;->equals(Ljava/lang/Object;)Z
 HSPLjava/util/Locale;->forLanguageTag(Ljava/lang/String;)Ljava/util/Locale;
 HSPLjava/util/Locale;->getAvailableLocales()[Ljava/util/Locale;
 HSPLjava/util/Locale;->getBaseLocale()Lsun/util/locale/BaseLocale;
 HSPLjava/util/Locale;->getCompatibilityExtensions(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lsun/util/locale/LocaleExtensions;
-HSPLjava/util/Locale;->getCountry()Ljava/lang/String;+]Lsun/util/locale/BaseLocale;Lsun/util/locale/BaseLocale;
+HSPLjava/util/Locale;->getCountry()Ljava/lang/String;
 HSPLjava/util/Locale;->getDefault()Ljava/util/Locale;
-HSPLjava/util/Locale;->getDefault(Ljava/util/Locale$Category;)Ljava/util/Locale;+]Ljava/util/Locale$Category;Ljava/util/Locale$Category;
+HSPLjava/util/Locale;->getDefault(Ljava/util/Locale$Category;)Ljava/util/Locale;
 HSPLjava/util/Locale;->getDisplayCountry(Ljava/util/Locale;)Ljava/lang/String;
 HSPLjava/util/Locale;->getDisplayLanguage()Ljava/lang/String;
 HSPLjava/util/Locale;->getDisplayLanguage(Ljava/util/Locale;)Ljava/lang/String;
@@ -6063,10 +5949,10 @@
 HSPLjava/util/Locale;->getISOLanguages()[Ljava/lang/String;
 HSPLjava/util/Locale;->getInstance(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lsun/util/locale/LocaleExtensions;)Ljava/util/Locale;
 HSPLjava/util/Locale;->getInstance(Lsun/util/locale/BaseLocale;Lsun/util/locale/LocaleExtensions;)Ljava/util/Locale;
-HSPLjava/util/Locale;->getLanguage()Ljava/lang/String;+]Lsun/util/locale/BaseLocale;Lsun/util/locale/BaseLocale;
+HSPLjava/util/Locale;->getLanguage()Ljava/lang/String;
 HSPLjava/util/Locale;->getScript()Ljava/lang/String;
 HSPLjava/util/Locale;->getUnicodeLocaleType(Ljava/lang/String;)Ljava/lang/String;
-HSPLjava/util/Locale;->getVariant()Ljava/lang/String;+]Lsun/util/locale/BaseLocale;Lsun/util/locale/BaseLocale;
+HSPLjava/util/Locale;->getVariant()Ljava/lang/String;
 HSPLjava/util/Locale;->hasExtensions()Z
 HSPLjava/util/Locale;->hashCode()I
 HSPLjava/util/Locale;->isUnicodeExtensionKey(Ljava/lang/String;)Z
@@ -6077,21 +5963,21 @@
 HSPLjava/util/Locale;->readResolve()Ljava/lang/Object;
 HSPLjava/util/Locale;->setDefault(Ljava/util/Locale$Category;Ljava/util/Locale;)V
 HSPLjava/util/Locale;->setDefault(Ljava/util/Locale;)V
-HSPLjava/util/Locale;->toLanguageTag()Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Lsun/util/locale/LanguageTag;Lsun/util/locale/LanguageTag;]Ljava/util/List;Ljava/util/Collections$EmptyList;]Ljava/util/Iterator;Ljava/util/Collections$EmptyIterator;
-HSPLjava/util/Locale;->toString()Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Lsun/util/locale/BaseLocale;Lsun/util/locale/BaseLocale;
+HSPLjava/util/Locale;->toLanguageTag()Ljava/lang/String;
+HSPLjava/util/Locale;->toString()Ljava/lang/String;
 HSPLjava/util/Locale;->writeObject(Ljava/io/ObjectOutputStream;)V
 HSPLjava/util/Map;->computeIfAbsent(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;+]Ljava/util/function/Function;missing_types]Ljava/util/Map;Landroid/util/ArrayMap;
 HSPLjava/util/Map;->forEach(Ljava/util/function/BiConsumer;)V
-HSPLjava/util/Map;->getOrDefault(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/util/Map;Landroid/util/ArrayMap;,Ljava/util/ImmutableCollections$MapN;
+HSPLjava/util/Map;->getOrDefault(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/util/Map;Landroid/util/ArrayMap;
 HSPLjava/util/Map;->of(Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/Map;
 HSPLjava/util/MissingResourceException;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
 HSPLjava/util/NoSuchElementException;-><init>()V
 HSPLjava/util/NoSuchElementException;-><init>(Ljava/lang/String;)V
 HSPLjava/util/Objects;->checkFromIndexSize(III)I
 HSPLjava/util/Objects;->checkIndex(II)I
-HSPLjava/util/Objects;->equals(Ljava/lang/Object;Ljava/lang/Object;)Z+]Ljava/lang/Object;megamorphic_types
+HSPLjava/util/Objects;->equals(Ljava/lang/Object;Ljava/lang/Object;)Z
 HSPLjava/util/Objects;->hash([Ljava/lang/Object;)I
-HSPLjava/util/Objects;->hashCode(Ljava/lang/Object;)I+]Ljava/lang/Object;Ljava/lang/String;,Ljava/lang/Integer;,Ljava/lang/Long;
+HSPLjava/util/Objects;->hashCode(Ljava/lang/Object;)I
 HSPLjava/util/Objects;->nonNull(Ljava/lang/Object;)Z
 HSPLjava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/Objects;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
@@ -6154,17 +6040,14 @@
 HSPLjava/util/PriorityQueue;->size()I
 HSPLjava/util/PriorityQueue;->toArray()[Ljava/lang/Object;
 HSPLjava/util/PriorityQueue;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
-HSPLjava/util/Properties$LineReader;-><init>(Ljava/util/Properties;Ljava/io/InputStream;)V
-HSPLjava/util/Properties$LineReader;-><init>(Ljava/util/Properties;Ljava/io/Reader;)V
 HSPLjava/util/Properties$LineReader;->readLine()I
 HSPLjava/util/Properties;-><init>()V
 HSPLjava/util/Properties;-><init>(Ljava/util/Properties;)V
-HSPLjava/util/Properties;->getProperty(Ljava/lang/String;)Ljava/lang/String;+]Ljava/util/Properties;Ljava/util/Properties;
+HSPLjava/util/Properties;->getProperty(Ljava/lang/String;)Ljava/lang/String;
 HSPLjava/util/Properties;->getProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
 HSPLjava/util/Properties;->load(Ljava/io/InputStream;)V
 HSPLjava/util/Properties;->load(Ljava/io/Reader;)V
 HSPLjava/util/Properties;->load0(Ljava/util/Properties$LineReader;)V
-HSPLjava/util/Properties;->loadConvert([CII[C)Ljava/lang/String;
 HSPLjava/util/Properties;->saveConvert(Ljava/lang/String;ZZ)Ljava/lang/String;
 HSPLjava/util/Properties;->setProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;
 HSPLjava/util/Properties;->store(Ljava/io/OutputStream;Ljava/lang/String;)V
@@ -6199,7 +6082,7 @@
 HSPLjava/util/RegularEnumSet;->addAll(Ljava/util/Collection;)Z
 HSPLjava/util/RegularEnumSet;->clear()V
 HSPLjava/util/RegularEnumSet;->complement()V
-HSPLjava/util/RegularEnumSet;->contains(Ljava/lang/Object;)Z+]Ljava/lang/Object;missing_types]Ljava/lang/Enum;missing_types
+HSPLjava/util/RegularEnumSet;->contains(Ljava/lang/Object;)Z
 HSPLjava/util/RegularEnumSet;->containsAll(Ljava/util/Collection;)Z
 HSPLjava/util/RegularEnumSet;->equals(Ljava/lang/Object;)Z
 HSPLjava/util/RegularEnumSet;->isEmpty()Z
@@ -6263,21 +6146,8 @@
 HSPLjava/util/Scanner;->translateSavedIndexes(I)V
 HSPLjava/util/Scanner;->useDelimiter(Ljava/lang/String;)Ljava/util/Scanner;
 HSPLjava/util/Scanner;->useLocale(Ljava/util/Locale;)Ljava/util/Scanner;
-HSPLjava/util/ServiceLoader$1;-><init>(Ljava/util/ServiceLoader;)V
-HSPLjava/util/ServiceLoader$1;->hasNext()Z
-HSPLjava/util/ServiceLoader$1;->next()Ljava/lang/Object;
-HSPLjava/util/ServiceLoader$LazyIterator;-><init>(Ljava/util/ServiceLoader;Ljava/lang/Class;Ljava/lang/ClassLoader;)V
-HSPLjava/util/ServiceLoader$LazyIterator;->hasNext()Z
-HSPLjava/util/ServiceLoader$LazyIterator;->hasNextService()Z
-HSPLjava/util/ServiceLoader$LazyIterator;->next()Ljava/lang/Object;
-HSPLjava/util/ServiceLoader$LazyIterator;->nextService()Ljava/lang/Object;
-HSPLjava/util/ServiceLoader;->-$$Nest$fgetlookupIterator(Ljava/util/ServiceLoader;)Ljava/util/ServiceLoader$LazyIterator;
-HSPLjava/util/ServiceLoader;->-$$Nest$fgetproviders(Ljava/util/ServiceLoader;)Ljava/util/LinkedHashMap;
-HSPLjava/util/ServiceLoader;-><init>(Ljava/lang/Class;Ljava/lang/ClassLoader;)V
 HSPLjava/util/ServiceLoader;->iterator()Ljava/util/Iterator;
 HSPLjava/util/ServiceLoader;->load(Ljava/lang/Class;Ljava/lang/ClassLoader;)Ljava/util/ServiceLoader;
-HSPLjava/util/ServiceLoader;->parse(Ljava/lang/Class;Ljava/net/URL;)Ljava/util/Iterator;
-HSPLjava/util/ServiceLoader;->parseLine(Ljava/lang/Class;Ljava/net/URL;Ljava/io/BufferedReader;ILjava/util/List;)I
 HSPLjava/util/ServiceLoader;->reload()V
 HSPLjava/util/Set;->of(Ljava/lang/Object;)Ljava/util/Set;
 HSPLjava/util/Set;->of(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/Set;
@@ -6289,7 +6159,7 @@
 HSPLjava/util/SimpleTimeZone;->getOffsets(J[I)I
 HSPLjava/util/SimpleTimeZone;->getRawOffset()I
 HSPLjava/util/SimpleTimeZone;->hasSameRules(Ljava/util/TimeZone;)Z
-HSPLjava/util/Spliterator$OfInt;->forEachRemaining(Ljava/util/function/Consumer;)V+]Ljava/util/Spliterator$OfInt;Ljava/util/Spliterators$IntArraySpliterator;,Ljava/util/stream/Streams$RangeIntSpliterator;
+HSPLjava/util/Spliterator$OfInt;->forEachRemaining(Ljava/util/function/Consumer;)V+]Ljava/util/Spliterator$OfInt;Ljava/util/Spliterators$IntArraySpliterator;
 HSPLjava/util/Spliterator;->getExactSizeIfKnown()J+]Ljava/util/Spliterator;megamorphic_types
 HSPLjava/util/Spliterators$ArraySpliterator;-><init>([Ljava/lang/Object;I)V
 HSPLjava/util/Spliterators$ArraySpliterator;-><init>([Ljava/lang/Object;III)V
@@ -6380,8 +6250,6 @@
 HSPLjava/util/TimeZone;->setDefault(Ljava/util/TimeZone;)V
 HSPLjava/util/TimeZone;->setID(Ljava/lang/String;)V
 HSPLjava/util/TimeZone;->toZoneId()Ljava/time/ZoneId;
-HSPLjava/util/Timer$1;-><init>(Ljava/util/Timer;)V
-HSPLjava/util/Timer$1;->finalize()V
 HSPLjava/util/Timer;-><init>()V
 HSPLjava/util/Timer;-><init>(Ljava/lang/String;)V
 HSPLjava/util/Timer;-><init>(Ljava/lang/String;Z)V
@@ -6405,10 +6273,10 @@
 HSPLjava/util/TreeMap$DescendingSubMap;->keyIterator()Ljava/util/Iterator;
 HSPLjava/util/TreeMap$DescendingSubMap;->subLowest()Ljava/util/TreeMap$TreeMapEntry;
 HSPLjava/util/TreeMap$EntryIterator;-><init>(Ljava/util/TreeMap;Ljava/util/TreeMap$TreeMapEntry;)V
-HSPLjava/util/TreeMap$EntryIterator;->next()Ljava/lang/Object;+]Ljava/util/TreeMap$EntryIterator;Ljava/util/TreeMap$EntryIterator;
-HSPLjava/util/TreeMap$EntryIterator;->next()Ljava/util/Map$Entry;+]Ljava/util/TreeMap$EntryIterator;Ljava/util/TreeMap$EntryIterator;
+HSPLjava/util/TreeMap$EntryIterator;->next()Ljava/lang/Object;
+HSPLjava/util/TreeMap$EntryIterator;->next()Ljava/util/Map$Entry;
 HSPLjava/util/TreeMap$EntrySet;-><init>(Ljava/util/TreeMap;)V
-HSPLjava/util/TreeMap$EntrySet;->iterator()Ljava/util/Iterator;+]Ljava/util/TreeMap;Ljava/util/TreeMap;
+HSPLjava/util/TreeMap$EntrySet;->iterator()Ljava/util/Iterator;
 HSPLjava/util/TreeMap$EntrySet;->size()I
 HSPLjava/util/TreeMap$KeyIterator;-><init>(Ljava/util/TreeMap;Ljava/util/TreeMap$TreeMapEntry;)V
 HSPLjava/util/TreeMap$KeyIterator;->next()Ljava/lang/Object;
@@ -6466,12 +6334,12 @@
 HSPLjava/util/TreeMap;->buildFromSorted(IIIILjava/util/Iterator;Ljava/io/ObjectInputStream;Ljava/lang/Object;)Ljava/util/TreeMap$TreeMapEntry;
 HSPLjava/util/TreeMap;->buildFromSorted(ILjava/util/Iterator;Ljava/io/ObjectInputStream;Ljava/lang/Object;)V
 HSPLjava/util/TreeMap;->ceilingEntry(Ljava/lang/Object;)Ljava/util/Map$Entry;
-HSPLjava/util/TreeMap;->ceilingKey(Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/util/TreeMap;Ljava/util/TreeMap;
+HSPLjava/util/TreeMap;->ceilingKey(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/TreeMap;->clear()V
 HSPLjava/util/TreeMap;->clone()Ljava/lang/Object;
 HSPLjava/util/TreeMap;->colorOf(Ljava/util/TreeMap$TreeMapEntry;)Z
 HSPLjava/util/TreeMap;->comparator()Ljava/util/Comparator;
-HSPLjava/util/TreeMap;->compare(Ljava/lang/Object;Ljava/lang/Object;)I+]Ljava/util/Comparator;missing_types]Ljava/lang/Comparable;missing_types
+HSPLjava/util/TreeMap;->compare(Ljava/lang/Object;Ljava/lang/Object;)I
 HSPLjava/util/TreeMap;->computeRedLevel(I)I
 HSPLjava/util/TreeMap;->containsKey(Ljava/lang/Object;)Z
 HSPLjava/util/TreeMap;->deleteEntry(Ljava/util/TreeMap$TreeMapEntry;)V
@@ -6486,8 +6354,8 @@
 HSPLjava/util/TreeMap;->floorKey(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/TreeMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/TreeMap;->getCeilingEntry(Ljava/lang/Object;)Ljava/util/TreeMap$TreeMapEntry;
-HSPLjava/util/TreeMap;->getEntry(Ljava/lang/Object;)Ljava/util/TreeMap$TreeMapEntry;+]Ljava/util/TreeMap;Ljava/util/TreeMap;]Ljava/lang/Comparable;missing_types
-HSPLjava/util/TreeMap;->getEntryUsingComparator(Ljava/lang/Object;)Ljava/util/TreeMap$TreeMapEntry;+]Ljava/util/Comparator;missing_types
+HSPLjava/util/TreeMap;->getEntry(Ljava/lang/Object;)Ljava/util/TreeMap$TreeMapEntry;
+HSPLjava/util/TreeMap;->getEntryUsingComparator(Ljava/lang/Object;)Ljava/util/TreeMap$TreeMapEntry;
 HSPLjava/util/TreeMap;->getFirstEntry()Ljava/util/TreeMap$TreeMapEntry;
 HSPLjava/util/TreeMap;->getFloorEntry(Ljava/lang/Object;)Ljava/util/TreeMap$TreeMapEntry;
 HSPLjava/util/TreeMap;->getHigherEntry(Ljava/lang/Object;)Ljava/util/TreeMap$TreeMapEntry;
@@ -6505,9 +6373,9 @@
 HSPLjava/util/TreeMap;->parentOf(Ljava/util/TreeMap$TreeMapEntry;)Ljava/util/TreeMap$TreeMapEntry;
 HSPLjava/util/TreeMap;->pollFirstEntry()Ljava/util/Map$Entry;
 HSPLjava/util/TreeMap;->predecessor(Ljava/util/TreeMap$TreeMapEntry;)Ljava/util/TreeMap$TreeMapEntry;
-HSPLjava/util/TreeMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/util/Comparator;missing_types]Ljava/util/TreeMap$TreeMapEntry;Ljava/util/TreeMap$TreeMapEntry;]Ljava/util/TreeMap;Ljava/util/TreeMap;]Ljava/lang/Comparable;missing_types
+HSPLjava/util/TreeMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/util/Comparator;Ljava/lang/String$CaseInsensitiveComparator;]Ljava/util/TreeMap;Ljava/util/TreeMap;]Ljava/lang/Comparable;Ljava/lang/String;,Ljava/lang/Long;
 HSPLjava/util/TreeMap;->putAll(Ljava/util/Map;)V
-HSPLjava/util/TreeMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/util/TreeMap;Ljava/util/TreeMap;
+HSPLjava/util/TreeMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/TreeMap;->rightOf(Ljava/util/TreeMap$TreeMapEntry;)Ljava/util/TreeMap$TreeMapEntry;
 HSPLjava/util/TreeMap;->rotateLeft(Ljava/util/TreeMap$TreeMapEntry;)V
 HSPLjava/util/TreeMap;->rotateRight(Ljava/util/TreeMap$TreeMapEntry;)V
@@ -6532,7 +6400,7 @@
 HSPLjava/util/TreeSet;->descendingSet()Ljava/util/NavigableSet;
 HSPLjava/util/TreeSet;->first()Ljava/lang/Object;
 HSPLjava/util/TreeSet;->floor(Ljava/lang/Object;)Ljava/lang/Object;
-HSPLjava/util/TreeSet;->isEmpty()Z+]Ljava/util/NavigableMap;Ljava/util/TreeMap;
+HSPLjava/util/TreeSet;->isEmpty()Z
 HSPLjava/util/TreeSet;->iterator()Ljava/util/Iterator;
 HSPLjava/util/TreeSet;->last()Ljava/lang/Object;
 HSPLjava/util/TreeSet;->remove(Ljava/lang/Object;)Z
@@ -6544,13 +6412,13 @@
 HSPLjava/util/UUID;->digits(JI)Ljava/lang/String;
 HSPLjava/util/UUID;->equals(Ljava/lang/Object;)Z
 HSPLjava/util/UUID;->fromString(Ljava/lang/String;)Ljava/util/UUID;
-HSPLjava/util/UUID;->fromStringJava8(Ljava/lang/String;)Ljava/util/UUID;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/lang/String;Ljava/lang/String;]Ljava/lang/Long;Ljava/lang/Long;
+HSPLjava/util/UUID;->fromStringJava8(Ljava/lang/String;)Ljava/util/UUID;
 HSPLjava/util/UUID;->getLeastSignificantBits()J
 HSPLjava/util/UUID;->getMostSignificantBits()J
 HSPLjava/util/UUID;->hashCode()I
 HSPLjava/util/UUID;->nameUUIDFromBytes([B)Ljava/util/UUID;
 HSPLjava/util/UUID;->randomUUID()Ljava/util/UUID;
-HSPLjava/util/UUID;->toString()Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
+HSPLjava/util/UUID;->toString()Ljava/lang/String;
 HSPLjava/util/Vector$1;-><init>(Ljava/util/Vector;)V
 HSPLjava/util/Vector$1;->hasMoreElements()Z
 HSPLjava/util/Vector$1;->nextElement()Ljava/lang/Object;
@@ -6591,7 +6459,7 @@
 HSPLjava/util/WeakHashMap$EntrySet;-><init>(Ljava/util/WeakHashMap;)V
 HSPLjava/util/WeakHashMap$EntrySet;->iterator()Ljava/util/Iterator;
 HSPLjava/util/WeakHashMap$HashIterator;-><init>(Ljava/util/WeakHashMap;)V
-HSPLjava/util/WeakHashMap$HashIterator;->hasNext()Z+]Ljava/util/WeakHashMap$Entry;Ljava/util/WeakHashMap$Entry;
+HSPLjava/util/WeakHashMap$HashIterator;->hasNext()Z
 HSPLjava/util/WeakHashMap$HashIterator;->nextEntry()Ljava/util/WeakHashMap$Entry;
 HSPLjava/util/WeakHashMap$KeyIterator;-><init>(Ljava/util/WeakHashMap;)V
 HSPLjava/util/WeakHashMap$KeyIterator;-><init>(Ljava/util/WeakHashMap;Ljava/util/WeakHashMap$KeyIterator-IA;)V
@@ -6610,11 +6478,11 @@
 HSPLjava/util/WeakHashMap;->clear()V
 HSPLjava/util/WeakHashMap;->containsKey(Ljava/lang/Object;)Z
 HSPLjava/util/WeakHashMap;->entrySet()Ljava/util/Set;
-HSPLjava/util/WeakHashMap;->expungeStaleEntries()V+]Ljava/lang/ref/ReferenceQueue;Ljava/lang/ref/ReferenceQueue;
-HSPLjava/util/WeakHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/util/WeakHashMap;Ljava/util/WeakHashMap;]Ljava/util/WeakHashMap$Entry;Ljava/util/WeakHashMap$Entry;
+HSPLjava/util/WeakHashMap;->expungeStaleEntries()V
+HSPLjava/util/WeakHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/WeakHashMap;->getEntry(Ljava/lang/Object;)Ljava/util/WeakHashMap$Entry;
 HSPLjava/util/WeakHashMap;->getTable()[Ljava/util/WeakHashMap$Entry;
-HSPLjava/util/WeakHashMap;->hash(Ljava/lang/Object;)I+]Ljava/lang/Object;missing_types
+HSPLjava/util/WeakHashMap;->hash(Ljava/lang/Object;)I
 HSPLjava/util/WeakHashMap;->indexFor(II)I
 HSPLjava/util/WeakHashMap;->isEmpty()Z
 HSPLjava/util/WeakHashMap;->keySet()Ljava/util/Set;
@@ -6685,7 +6553,7 @@
 HSPLjava/util/concurrent/ConcurrentHashMap$BaseIterator;->remove()V
 HSPLjava/util/concurrent/ConcurrentHashMap$CollectionView;-><init>(Ljava/util/concurrent/ConcurrentHashMap;)V
 HSPLjava/util/concurrent/ConcurrentHashMap$CollectionView;->size()I
-HSPLjava/util/concurrent/ConcurrentHashMap$CollectionView;->toArray()[Ljava/lang/Object;+]Ljava/util/concurrent/ConcurrentHashMap;Ljava/util/concurrent/ConcurrentHashMap;]Ljava/util/Iterator;Ljava/util/concurrent/ConcurrentHashMap$ValueIterator;,Ljava/util/concurrent/ConcurrentHashMap$KeyIterator;]Ljava/util/concurrent/ConcurrentHashMap$CollectionView;Ljava/util/concurrent/ConcurrentHashMap$KeySetView;,Ljava/util/concurrent/ConcurrentHashMap$ValuesView;
+HSPLjava/util/concurrent/ConcurrentHashMap$CollectionView;->toArray()[Ljava/lang/Object;
 HSPLjava/util/concurrent/ConcurrentHashMap$CounterCell;-><init>(J)V
 HSPLjava/util/concurrent/ConcurrentHashMap$EntryIterator;-><init>([Ljava/util/concurrent/ConcurrentHashMap$Node;IIILjava/util/concurrent/ConcurrentHashMap;)V
 HSPLjava/util/concurrent/ConcurrentHashMap$EntryIterator;->next()Ljava/lang/Object;
@@ -6695,7 +6563,7 @@
 HSPLjava/util/concurrent/ConcurrentHashMap$ForwardingNode;-><init>([Ljava/util/concurrent/ConcurrentHashMap$Node;)V
 HSPLjava/util/concurrent/ConcurrentHashMap$ForwardingNode;->find(ILjava/lang/Object;)Ljava/util/concurrent/ConcurrentHashMap$Node;
 HSPLjava/util/concurrent/ConcurrentHashMap$KeyIterator;-><init>([Ljava/util/concurrent/ConcurrentHashMap$Node;IIILjava/util/concurrent/ConcurrentHashMap;)V
-HSPLjava/util/concurrent/ConcurrentHashMap$KeyIterator;->next()Ljava/lang/Object;+]Ljava/util/concurrent/ConcurrentHashMap$KeyIterator;Ljava/util/concurrent/ConcurrentHashMap$KeyIterator;
+HSPLjava/util/concurrent/ConcurrentHashMap$KeyIterator;->next()Ljava/lang/Object;
 HSPLjava/util/concurrent/ConcurrentHashMap$KeySetView;-><init>(Ljava/util/concurrent/ConcurrentHashMap;Ljava/lang/Object;)V
 HSPLjava/util/concurrent/ConcurrentHashMap$KeySetView;->iterator()Ljava/util/Iterator;
 HSPLjava/util/concurrent/ConcurrentHashMap$KeySetView;->spliterator()Ljava/util/Spliterator;
@@ -6725,7 +6593,7 @@
 HSPLjava/util/concurrent/ConcurrentHashMap;->entrySet()Ljava/util/Set;
 HSPLjava/util/concurrent/ConcurrentHashMap;->forEach(Ljava/util/function/BiConsumer;)V
 HSPLjava/util/concurrent/ConcurrentHashMap;->fullAddCount(JZ)V
-HSPLjava/util/concurrent/ConcurrentHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/lang/Object;megamorphic_types
+HSPLjava/util/concurrent/ConcurrentHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/concurrent/ConcurrentHashMap;->getOrDefault(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/concurrent/ConcurrentHashMap;->helpTransfer([Ljava/util/concurrent/ConcurrentHashMap$Node;Ljava/util/concurrent/ConcurrentHashMap$Node;)[Ljava/util/concurrent/ConcurrentHashMap$Node;
 HSPLjava/util/concurrent/ConcurrentHashMap;->initTable()[Ljava/util/concurrent/ConcurrentHashMap$Node;
@@ -6735,17 +6603,17 @@
 HSPLjava/util/concurrent/ConcurrentHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/concurrent/ConcurrentHashMap;->putAll(Ljava/util/Map;)V
 HSPLjava/util/concurrent/ConcurrentHashMap;->putIfAbsent(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
-HSPLjava/util/concurrent/ConcurrentHashMap;->putVal(Ljava/lang/Object;Ljava/lang/Object;Z)Ljava/lang/Object;+]Ljava/lang/Object;Lsun/util/locale/BaseLocale$Key;
+HSPLjava/util/concurrent/ConcurrentHashMap;->putVal(Ljava/lang/Object;Ljava/lang/Object;Z)Ljava/lang/Object;
 HSPLjava/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;Ljava/lang/Object;)Z
 HSPLjava/util/concurrent/ConcurrentHashMap;->replace(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z
-HSPLjava/util/concurrent/ConcurrentHashMap;->replaceNode(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/lang/Object;Lsun/nio/ch/FileKey;,Ljava/lang/reflect/Proxy$Key1;,Lsun/util/locale/BaseLocale;
+HSPLjava/util/concurrent/ConcurrentHashMap;->replaceNode(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/concurrent/ConcurrentHashMap;->resizeStamp(I)I
 HSPLjava/util/concurrent/ConcurrentHashMap;->setTabAt([Ljava/util/concurrent/ConcurrentHashMap$Node;ILjava/util/concurrent/ConcurrentHashMap$Node;)V
 HSPLjava/util/concurrent/ConcurrentHashMap;->size()I
 HSPLjava/util/concurrent/ConcurrentHashMap;->spread(I)I
 HSPLjava/util/concurrent/ConcurrentHashMap;->sumCount()J
-HSPLjava/util/concurrent/ConcurrentHashMap;->tabAt([Ljava/util/concurrent/ConcurrentHashMap$Node;I)Ljava/util/concurrent/ConcurrentHashMap$Node;+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
+HSPLjava/util/concurrent/ConcurrentHashMap;->tabAt([Ljava/util/concurrent/ConcurrentHashMap$Node;I)Ljava/util/concurrent/ConcurrentHashMap$Node;
 HSPLjava/util/concurrent/ConcurrentHashMap;->tableSizeFor(I)I
 HSPLjava/util/concurrent/ConcurrentHashMap;->transfer([Ljava/util/concurrent/ConcurrentHashMap$Node;[Ljava/util/concurrent/ConcurrentHashMap$Node;)V
 HSPLjava/util/concurrent/ConcurrentHashMap;->treeifyBin([Ljava/util/concurrent/ConcurrentHashMap$Node;I)V
@@ -6771,7 +6639,6 @@
 HSPLjava/util/concurrent/ConcurrentLinkedDeque;->unlinkLast(Ljava/util/concurrent/ConcurrentLinkedDeque$Node;Ljava/util/concurrent/ConcurrentLinkedDeque$Node;)V
 HSPLjava/util/concurrent/ConcurrentLinkedDeque;->updateHead()V
 HSPLjava/util/concurrent/ConcurrentLinkedDeque;->updateTail()V
-HSPLjava/util/concurrent/ConcurrentLinkedQueue$$ExternalSyntheticLambda0;-><init>()V
 HSPLjava/util/concurrent/ConcurrentLinkedQueue$$ExternalSyntheticLambda0;->test(Ljava/lang/Object;)Z
 HSPLjava/util/concurrent/ConcurrentLinkedQueue$Itr;-><init>(Ljava/util/concurrent/ConcurrentLinkedQueue;)V
 HSPLjava/util/concurrent/ConcurrentLinkedQueue$Itr;->hasNext()Z
@@ -6790,7 +6657,7 @@
 HSPLjava/util/concurrent/ConcurrentLinkedQueue;->lambda$clear$2(Ljava/lang/Object;)Z
 HSPLjava/util/concurrent/ConcurrentLinkedQueue;->offer(Ljava/lang/Object;)Z
 HSPLjava/util/concurrent/ConcurrentLinkedQueue;->peek()Ljava/lang/Object;
-HSPLjava/util/concurrent/ConcurrentLinkedQueue;->poll()Ljava/lang/Object;+]Ljava/util/concurrent/ConcurrentLinkedQueue;Ljava/util/concurrent/ConcurrentLinkedQueue;]Ljava/util/concurrent/ConcurrentLinkedQueue$Node;Ljava/util/concurrent/ConcurrentLinkedQueue$Node;
+HSPLjava/util/concurrent/ConcurrentLinkedQueue;->poll()Ljava/lang/Object;
 HSPLjava/util/concurrent/ConcurrentLinkedQueue;->remove(Ljava/lang/Object;)Z
 HSPLjava/util/concurrent/ConcurrentLinkedQueue;->size()I
 HSPLjava/util/concurrent/ConcurrentLinkedQueue;->succ(Ljava/util/concurrent/ConcurrentLinkedQueue$Node;)Ljava/util/concurrent/ConcurrentLinkedQueue$Node;
@@ -6821,9 +6688,9 @@
 HSPLjava/util/concurrent/CopyOnWriteArrayList$$ExternalSyntheticLambda2;->test(Ljava/lang/Object;)Z
 HSPLjava/util/concurrent/CopyOnWriteArrayList$COWIterator;-><init>([Ljava/lang/Object;I)V
 HSPLjava/util/concurrent/CopyOnWriteArrayList$COWIterator;->hasNext()Z
-HSPLjava/util/concurrent/CopyOnWriteArrayList$COWIterator;->next()Ljava/lang/Object;+]Ljava/util/concurrent/CopyOnWriteArrayList$COWIterator;Ljava/util/concurrent/CopyOnWriteArrayList$COWIterator;
-HSPLjava/util/concurrent/CopyOnWriteArrayList;-><init>()V+]Ljava/util/concurrent/CopyOnWriteArrayList;Ljava/util/concurrent/CopyOnWriteArrayList;
-HSPLjava/util/concurrent/CopyOnWriteArrayList;-><init>(Ljava/util/Collection;)V+]Ljava/lang/Object;Ljava/util/concurrent/CopyOnWriteArrayList;]Ljava/util/concurrent/CopyOnWriteArrayList;Ljava/util/concurrent/CopyOnWriteArrayList;
+HSPLjava/util/concurrent/CopyOnWriteArrayList$COWIterator;->next()Ljava/lang/Object;
+HSPLjava/util/concurrent/CopyOnWriteArrayList;-><init>()V
+HSPLjava/util/concurrent/CopyOnWriteArrayList;-><init>(Ljava/util/Collection;)V
 HSPLjava/util/concurrent/CopyOnWriteArrayList;-><init>([Ljava/lang/Object;)V
 HSPLjava/util/concurrent/CopyOnWriteArrayList;->add(ILjava/lang/Object;)V
 HSPLjava/util/concurrent/CopyOnWriteArrayList;->add(Ljava/lang/Object;)Z
@@ -6840,20 +6707,20 @@
 HSPLjava/util/concurrent/CopyOnWriteArrayList;->getArray()[Ljava/lang/Object;
 HSPLjava/util/concurrent/CopyOnWriteArrayList;->indexOf(Ljava/lang/Object;)I
 HSPLjava/util/concurrent/CopyOnWriteArrayList;->indexOfRange(Ljava/lang/Object;[Ljava/lang/Object;II)I
-HSPLjava/util/concurrent/CopyOnWriteArrayList;->isEmpty()Z+]Ljava/util/concurrent/CopyOnWriteArrayList;missing_types
-HSPLjava/util/concurrent/CopyOnWriteArrayList;->iterator()Ljava/util/Iterator;+]Ljava/util/concurrent/CopyOnWriteArrayList;missing_types
+HSPLjava/util/concurrent/CopyOnWriteArrayList;->isEmpty()Z
+HSPLjava/util/concurrent/CopyOnWriteArrayList;->iterator()Ljava/util/Iterator;
 HSPLjava/util/concurrent/CopyOnWriteArrayList;->lambda$removeAll$0(Ljava/util/Collection;Ljava/lang/Object;)Z
 HSPLjava/util/concurrent/CopyOnWriteArrayList;->remove(I)Ljava/lang/Object;
 HSPLjava/util/concurrent/CopyOnWriteArrayList;->remove(Ljava/lang/Object;)Z
 HSPLjava/util/concurrent/CopyOnWriteArrayList;->remove(Ljava/lang/Object;[Ljava/lang/Object;I)Z
 HSPLjava/util/concurrent/CopyOnWriteArrayList;->removeAll(Ljava/util/Collection;)Z
 HSPLjava/util/concurrent/CopyOnWriteArrayList;->setArray([Ljava/lang/Object;)V
-HSPLjava/util/concurrent/CopyOnWriteArrayList;->size()I+]Ljava/util/concurrent/CopyOnWriteArrayList;missing_types
+HSPLjava/util/concurrent/CopyOnWriteArrayList;->size()I
 HSPLjava/util/concurrent/CopyOnWriteArrayList;->toArray()[Ljava/lang/Object;
-HSPLjava/util/concurrent/CopyOnWriteArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;+]Ljava/lang/Object;[Ljava/util/logging/Handler;]Ljava/util/concurrent/CopyOnWriteArrayList;Ljava/util/concurrent/CopyOnWriteArrayList;
+HSPLjava/util/concurrent/CopyOnWriteArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
 HSPLjava/util/concurrent/CopyOnWriteArrayList;->toString()Ljava/lang/String;
 HSPLjava/util/concurrent/CopyOnWriteArraySet;-><init>()V
-HSPLjava/util/concurrent/CopyOnWriteArraySet;-><init>(Ljava/util/Collection;)V+]Ljava/lang/Object;Ljava/util/concurrent/CopyOnWriteArraySet;
+HSPLjava/util/concurrent/CopyOnWriteArraySet;-><init>(Ljava/util/Collection;)V
 HSPLjava/util/concurrent/CopyOnWriteArraySet;->add(Ljava/lang/Object;)Z
 HSPLjava/util/concurrent/CopyOnWriteArraySet;->addAll(Ljava/util/Collection;)Z
 HSPLjava/util/concurrent/CopyOnWriteArraySet;->clear()V
@@ -6910,7 +6777,7 @@
 HSPLjava/util/concurrent/Executors;->unconfigurableExecutorService(Ljava/util/concurrent/ExecutorService;)Ljava/util/concurrent/ExecutorService;
 HSPLjava/util/concurrent/Executors;->unconfigurableScheduledExecutorService(Ljava/util/concurrent/ScheduledExecutorService;)Ljava/util/concurrent/ScheduledExecutorService;
 HSPLjava/util/concurrent/ForkJoinPool;->managedBlock(Ljava/util/concurrent/ForkJoinPool$ManagedBlocker;)V
-HSPLjava/util/concurrent/ForkJoinPool;->unmanagedBlock(Ljava/util/concurrent/ForkJoinPool$ManagedBlocker;)V+]Ljava/util/concurrent/ForkJoinPool$ManagedBlocker;Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;
+HSPLjava/util/concurrent/ForkJoinPool;->unmanagedBlock(Ljava/util/concurrent/ForkJoinPool$ManagedBlocker;)V
 HSPLjava/util/concurrent/ForkJoinTask;-><init>()V
 HSPLjava/util/concurrent/FutureTask$WaitNode;-><init>()V
 HSPLjava/util/concurrent/FutureTask;-><init>(Ljava/lang/Runnable;Ljava/lang/Object;)V
@@ -6918,7 +6785,7 @@
 HSPLjava/util/concurrent/FutureTask;->awaitDone(ZJ)I
 HSPLjava/util/concurrent/FutureTask;->cancel(Z)Z
 HSPLjava/util/concurrent/FutureTask;->done()V
-HSPLjava/util/concurrent/FutureTask;->finishCompletion()V+]Ljava/util/concurrent/FutureTask;missing_types
+HSPLjava/util/concurrent/FutureTask;->finishCompletion()V
 HSPLjava/util/concurrent/FutureTask;->get()Ljava/lang/Object;
 HSPLjava/util/concurrent/FutureTask;->get(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;
 HSPLjava/util/concurrent/FutureTask;->handlePossibleCancellationInterrupt(I)V
@@ -6926,7 +6793,7 @@
 HSPLjava/util/concurrent/FutureTask;->isDone()Z
 HSPLjava/util/concurrent/FutureTask;->removeWaiter(Ljava/util/concurrent/FutureTask$WaitNode;)V
 HSPLjava/util/concurrent/FutureTask;->report(I)Ljava/lang/Object;
-HSPLjava/util/concurrent/FutureTask;->run()V+]Ljava/util/concurrent/Callable;missing_types]Ljava/util/concurrent/FutureTask;missing_types
+HSPLjava/util/concurrent/FutureTask;->run()V
 HSPLjava/util/concurrent/FutureTask;->runAndReset()Z
 HSPLjava/util/concurrent/FutureTask;->set(Ljava/lang/Object;)V
 HSPLjava/util/concurrent/FutureTask;->setException(Ljava/lang/Throwable;)V
@@ -6965,9 +6832,9 @@
 HSPLjava/util/concurrent/LinkedBlockingQueue;->poll()Ljava/lang/Object;
 HSPLjava/util/concurrent/LinkedBlockingQueue;->poll(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;
 HSPLjava/util/concurrent/LinkedBlockingQueue;->put(Ljava/lang/Object;)V
-HSPLjava/util/concurrent/LinkedBlockingQueue;->signalNotEmpty()V+]Ljava/util/concurrent/locks/ReentrantLock;Ljava/util/concurrent/locks/ReentrantLock;]Ljava/util/concurrent/locks/Condition;Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;
+HSPLjava/util/concurrent/LinkedBlockingQueue;->signalNotEmpty()V
 HSPLjava/util/concurrent/LinkedBlockingQueue;->signalNotFull()V
-HSPLjava/util/concurrent/LinkedBlockingQueue;->size()I+]Ljava/util/concurrent/atomic/AtomicInteger;Ljava/util/concurrent/atomic/AtomicInteger;
+HSPLjava/util/concurrent/LinkedBlockingQueue;->size()I
 HSPLjava/util/concurrent/LinkedBlockingQueue;->take()Ljava/lang/Object;
 HSPLjava/util/concurrent/PriorityBlockingQueue;-><init>()V
 HSPLjava/util/concurrent/PriorityBlockingQueue;-><init>(ILjava/util/Comparator;)V
@@ -7001,14 +6868,14 @@
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->grow()V
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->indexOf(Ljava/lang/Object;)I
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->isEmpty()Z
-HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->iterator()Ljava/util/Iterator;+]Ljava/util/concurrent/locks/ReentrantLock;Ljava/util/concurrent/locks/ReentrantLock;
-HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->offer(Ljava/lang/Runnable;)Z+]Ljava/util/concurrent/locks/ReentrantLock;Ljava/util/concurrent/locks/ReentrantLock;]Ljava/util/concurrent/locks/Condition;Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;
+HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->iterator()Ljava/util/Iterator;
+HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->offer(Ljava/lang/Runnable;)Z
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->poll(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->poll(JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/RunnableScheduledFuture;
-HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->remove(Ljava/lang/Object;)Z+]Ljava/util/concurrent/locks/ReentrantLock;Ljava/util/concurrent/locks/ReentrantLock;
+HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->remove(Ljava/lang/Object;)Z
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->setIndex(Ljava/util/concurrent/RunnableScheduledFuture;I)V
-HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->siftDown(ILjava/util/concurrent/RunnableScheduledFuture;)V+]Ljava/util/concurrent/RunnableScheduledFuture;Ljava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;
-HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->siftUp(ILjava/util/concurrent/RunnableScheduledFuture;)V+]Ljava/util/concurrent/RunnableScheduledFuture;Ljava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;
+HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->siftDown(ILjava/util/concurrent/RunnableScheduledFuture;)V
+HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->siftUp(ILjava/util/concurrent/RunnableScheduledFuture;)V
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->size()I
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->take()Ljava/lang/Object;
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;->take()Ljava/util/concurrent/RunnableScheduledFuture;
@@ -7016,8 +6883,8 @@
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;-><init>(Ljava/util/concurrent/ScheduledThreadPoolExecutor;Ljava/lang/Runnable;Ljava/lang/Object;JJ)V
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;-><init>(Ljava/util/concurrent/ScheduledThreadPoolExecutor;Ljava/lang/Runnable;Ljava/lang/Object;JJJ)V
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;-><init>(Ljava/util/concurrent/ScheduledThreadPoolExecutor;Ljava/util/concurrent/Callable;JJ)V
-HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;->cancel(Z)Z+]Ljava/util/concurrent/ScheduledThreadPoolExecutor;missing_types
-HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;->compareTo(Ljava/lang/Object;)I+]Ljava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;Ljava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;
+HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;->cancel(Z)Z
+HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;->compareTo(Ljava/lang/Object;)I
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;->compareTo(Ljava/util/concurrent/Delayed;)I
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;->getDelay(Ljava/util/concurrent/TimeUnit;)J
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;->isPeriodic()Z
@@ -7029,13 +6896,13 @@
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->canRunInCurrentRunState(Ljava/util/concurrent/RunnableScheduledFuture;)Z
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->decorateTask(Ljava/lang/Runnable;Ljava/util/concurrent/RunnableScheduledFuture;)Ljava/util/concurrent/RunnableScheduledFuture;
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->decorateTask(Ljava/util/concurrent/Callable;Ljava/util/concurrent/RunnableScheduledFuture;)Ljava/util/concurrent/RunnableScheduledFuture;
-HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->delayedExecute(Ljava/util/concurrent/RunnableScheduledFuture;)V+]Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;]Ljava/util/concurrent/ScheduledThreadPoolExecutor;missing_types
+HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->delayedExecute(Ljava/util/concurrent/RunnableScheduledFuture;)V
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->execute(Ljava/lang/Runnable;)V
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->getContinueExistingPeriodicTasksAfterShutdownPolicy()Z
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->getExecuteExistingDelayedTasksAfterShutdownPolicy()Z
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->onShutdown()V
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->reExecutePeriodic(Ljava/util/concurrent/RunnableScheduledFuture;)V
-HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->schedule(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;+]Ljava/util/concurrent/ScheduledThreadPoolExecutor;missing_types]Ljava/util/concurrent/atomic/AtomicLong;Ljava/util/concurrent/atomic/AtomicLong;
+HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->schedule(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->schedule(Ljava/util/concurrent/Callable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->scheduleAtFixedRate(Ljava/lang/Runnable;JJLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->scheduleWithFixedDelay(Ljava/lang/Runnable;JJLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
@@ -7045,7 +6912,7 @@
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->submit(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->submit(Ljava/util/concurrent/Callable;)Ljava/util/concurrent/Future;
 HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->triggerTime(J)J
-HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->triggerTime(JLjava/util/concurrent/TimeUnit;)J+]Ljava/util/concurrent/ScheduledThreadPoolExecutor;missing_types]Ljava/util/concurrent/TimeUnit;Ljava/util/concurrent/TimeUnit;
+HSPLjava/util/concurrent/ScheduledThreadPoolExecutor;->triggerTime(JLjava/util/concurrent/TimeUnit;)J
 HSPLjava/util/concurrent/Semaphore$FairSync;-><init>(I)V
 HSPLjava/util/concurrent/Semaphore$FairSync;->tryAcquireShared(I)I
 HSPLjava/util/concurrent/Semaphore$NonfairSync;-><init>(I)V
@@ -7081,8 +6948,8 @@
 HSPLjava/util/concurrent/SynchronousQueue;-><init>()V
 HSPLjava/util/concurrent/SynchronousQueue;-><init>(Z)V
 HSPLjava/util/concurrent/SynchronousQueue;->isEmpty()Z
-HSPLjava/util/concurrent/SynchronousQueue;->offer(Ljava/lang/Object;)Z+]Ljava/util/concurrent/SynchronousQueue$Transferer;Ljava/util/concurrent/SynchronousQueue$TransferStack;
-HSPLjava/util/concurrent/SynchronousQueue;->poll(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;+]Ljava/util/concurrent/SynchronousQueue$Transferer;Ljava/util/concurrent/SynchronousQueue$TransferStack;]Ljava/util/concurrent/TimeUnit;Ljava/util/concurrent/TimeUnit;
+HSPLjava/util/concurrent/SynchronousQueue;->offer(Ljava/lang/Object;)Z
+HSPLjava/util/concurrent/SynchronousQueue;->poll(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;
 HSPLjava/util/concurrent/SynchronousQueue;->size()I
 HSPLjava/util/concurrent/SynchronousQueue;->take()Ljava/lang/Object;
 HSPLjava/util/concurrent/ThreadLocalRandom;-><clinit>()V
@@ -7091,7 +6958,6 @@
 HSPLjava/util/concurrent/ThreadLocalRandom;->getProbe()I
 HSPLjava/util/concurrent/ThreadLocalRandom;->localInit()V
 HSPLjava/util/concurrent/ThreadLocalRandom;->mix32(J)I
-HSPLjava/util/concurrent/ThreadLocalRandom;->mix64(J)J
 HSPLjava/util/concurrent/ThreadLocalRandom;->nextInt()I
 HSPLjava/util/concurrent/ThreadLocalRandom;->nextSecondarySeed()I
 HSPLjava/util/concurrent/ThreadLocalRandom;->nextSeed()J
@@ -7101,12 +6967,12 @@
 HSPLjava/util/concurrent/ThreadPoolExecutor$Worker;->interruptIfStarted()V
 HSPLjava/util/concurrent/ThreadPoolExecutor$Worker;->isHeldExclusively()Z
 HSPLjava/util/concurrent/ThreadPoolExecutor$Worker;->isLocked()Z
-HSPLjava/util/concurrent/ThreadPoolExecutor$Worker;->lock()V+]Ljava/util/concurrent/ThreadPoolExecutor$Worker;Ljava/util/concurrent/ThreadPoolExecutor$Worker;
+HSPLjava/util/concurrent/ThreadPoolExecutor$Worker;->lock()V
 HSPLjava/util/concurrent/ThreadPoolExecutor$Worker;->run()V
-HSPLjava/util/concurrent/ThreadPoolExecutor$Worker;->tryAcquire(I)Z+]Ljava/util/concurrent/ThreadPoolExecutor$Worker;Ljava/util/concurrent/ThreadPoolExecutor$Worker;
+HSPLjava/util/concurrent/ThreadPoolExecutor$Worker;->tryAcquire(I)Z
 HSPLjava/util/concurrent/ThreadPoolExecutor$Worker;->tryLock()Z
-HSPLjava/util/concurrent/ThreadPoolExecutor$Worker;->tryRelease(I)Z+]Ljava/util/concurrent/ThreadPoolExecutor$Worker;Ljava/util/concurrent/ThreadPoolExecutor$Worker;
-HSPLjava/util/concurrent/ThreadPoolExecutor$Worker;->unlock()V+]Ljava/util/concurrent/ThreadPoolExecutor$Worker;Ljava/util/concurrent/ThreadPoolExecutor$Worker;
+HSPLjava/util/concurrent/ThreadPoolExecutor$Worker;->tryRelease(I)Z
+HSPLjava/util/concurrent/ThreadPoolExecutor$Worker;->unlock()V
 HSPLjava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;)V
 HSPLjava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/RejectedExecutionHandler;)V
 HSPLjava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;)V
@@ -7123,7 +6989,7 @@
 HSPLjava/util/concurrent/ThreadPoolExecutor;->ctlOf(II)I
 HSPLjava/util/concurrent/ThreadPoolExecutor;->decrementWorkerCount()V
 HSPLjava/util/concurrent/ThreadPoolExecutor;->drainQueue()Ljava/util/List;
-HSPLjava/util/concurrent/ThreadPoolExecutor;->ensurePrestart()V+]Ljava/util/concurrent/atomic/AtomicInteger;Ljava/util/concurrent/atomic/AtomicInteger;
+HSPLjava/util/concurrent/ThreadPoolExecutor;->ensurePrestart()V
 HSPLjava/util/concurrent/ThreadPoolExecutor;->execute(Ljava/lang/Runnable;)V
 HSPLjava/util/concurrent/ThreadPoolExecutor;->finalize()V
 HSPLjava/util/concurrent/ThreadPoolExecutor;->getCorePoolSize()I
@@ -7136,18 +7002,18 @@
 HSPLjava/util/concurrent/ThreadPoolExecutor;->interruptIdleWorkers(Z)V
 HSPLjava/util/concurrent/ThreadPoolExecutor;->interruptWorkers()V
 HSPLjava/util/concurrent/ThreadPoolExecutor;->isRunning(I)Z
-HSPLjava/util/concurrent/ThreadPoolExecutor;->isShutdown()Z+]Ljava/util/concurrent/atomic/AtomicInteger;Ljava/util/concurrent/atomic/AtomicInteger;
+HSPLjava/util/concurrent/ThreadPoolExecutor;->isShutdown()Z
 HSPLjava/util/concurrent/ThreadPoolExecutor;->isTerminated()Z
 HSPLjava/util/concurrent/ThreadPoolExecutor;->onShutdown()V
 HSPLjava/util/concurrent/ThreadPoolExecutor;->prestartAllCoreThreads()I
 HSPLjava/util/concurrent/ThreadPoolExecutor;->prestartCoreThread()Z
-HSPLjava/util/concurrent/ThreadPoolExecutor;->processWorkerExit(Ljava/util/concurrent/ThreadPoolExecutor$Worker;Z)V+]Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;,Ljava/util/concurrent/SynchronousQueue;,Ljava/util/concurrent/LinkedBlockingQueue;]Ljava/util/concurrent/ThreadPoolExecutor;missing_types]Ljava/util/concurrent/locks/ReentrantLock;Ljava/util/concurrent/locks/ReentrantLock;]Ljava/util/HashSet;Ljava/util/HashSet;]Ljava/util/concurrent/atomic/AtomicInteger;Ljava/util/concurrent/atomic/AtomicInteger;
-HSPLjava/util/concurrent/ThreadPoolExecutor;->purge()V+]Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;]Ljava/util/concurrent/ThreadPoolExecutor;Ljava/util/concurrent/ScheduledThreadPoolExecutor;]Ljava/util/Iterator;Ljava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue$Itr;
-HSPLjava/util/concurrent/ThreadPoolExecutor;->remove(Ljava/lang/Runnable;)Z+]Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;]Ljava/util/concurrent/ThreadPoolExecutor;missing_types
+HSPLjava/util/concurrent/ThreadPoolExecutor;->processWorkerExit(Ljava/util/concurrent/ThreadPoolExecutor$Worker;Z)V
+HSPLjava/util/concurrent/ThreadPoolExecutor;->purge()V
+HSPLjava/util/concurrent/ThreadPoolExecutor;->remove(Ljava/lang/Runnable;)Z
 HSPLjava/util/concurrent/ThreadPoolExecutor;->runStateAtLeast(II)Z
 HSPLjava/util/concurrent/ThreadPoolExecutor;->runStateLessThan(II)Z
 HSPLjava/util/concurrent/ThreadPoolExecutor;->runStateOf(I)I
-HSPLjava/util/concurrent/ThreadPoolExecutor;->runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+]Ljava/util/concurrent/ThreadPoolExecutor;Ljava/util/concurrent/ScheduledThreadPoolExecutor;]Ljava/util/concurrent/atomic/AtomicInteger;Ljava/util/concurrent/atomic/AtomicInteger;]Ljava/lang/Runnable;Ljava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;]Ljava/util/concurrent/ThreadPoolExecutor$Worker;Ljava/util/concurrent/ThreadPoolExecutor$Worker;
+HSPLjava/util/concurrent/ThreadPoolExecutor;->runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V
 HSPLjava/util/concurrent/ThreadPoolExecutor;->setCorePoolSize(I)V
 HSPLjava/util/concurrent/ThreadPoolExecutor;->setKeepAliveTime(JLjava/util/concurrent/TimeUnit;)V
 HSPLjava/util/concurrent/ThreadPoolExecutor;->setMaximumPoolSize(I)V
@@ -7157,7 +7023,7 @@
 HSPLjava/util/concurrent/ThreadPoolExecutor;->shutdownNow()Ljava/util/List;
 HSPLjava/util/concurrent/ThreadPoolExecutor;->terminated()V
 HSPLjava/util/concurrent/ThreadPoolExecutor;->toString()Ljava/lang/String;
-HSPLjava/util/concurrent/ThreadPoolExecutor;->tryTerminate()V+]Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/LinkedBlockingQueue;,Ljava/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue;]Ljava/util/concurrent/ThreadPoolExecutor;Ljava/util/concurrent/ThreadPoolExecutor;,Ljava/util/concurrent/ScheduledThreadPoolExecutor;]Ljava/util/concurrent/locks/ReentrantLock;Ljava/util/concurrent/locks/ReentrantLock;]Ljava/util/concurrent/locks/Condition;Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;]Ljava/util/concurrent/atomic/AtomicInteger;Ljava/util/concurrent/atomic/AtomicInteger;
+HSPLjava/util/concurrent/ThreadPoolExecutor;->tryTerminate()V
 HSPLjava/util/concurrent/ThreadPoolExecutor;->workerCountOf(I)I
 HSPLjava/util/concurrent/TimeUnit;->convert(JLjava/util/concurrent/TimeUnit;)J
 HSPLjava/util/concurrent/TimeUnit;->cvt(JJJ)J
@@ -7199,7 +7065,8 @@
 HSPLjava/util/concurrent/atomic/AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl;->accessCheck(Ljava/lang/Object;)V
 HSPLjava/util/concurrent/atomic/AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl;->compareAndSet(Ljava/lang/Object;II)Z
 HSPLjava/util/concurrent/atomic/AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl;->decrementAndGet(Ljava/lang/Object;)I
-HSPLjava/util/concurrent/atomic/AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl;->getAndAdd(Ljava/lang/Object;I)I+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
+HSPLjava/util/concurrent/atomic/AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl;->getAndAdd(Ljava/lang/Object;I)I
+HSPLjava/util/concurrent/atomic/AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl;->getAndIncrement(Ljava/lang/Object;)I
 HSPLjava/util/concurrent/atomic/AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl;->incrementAndGet(Ljava/lang/Object;)I
 HSPLjava/util/concurrent/atomic/AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl;->set(Ljava/lang/Object;I)V
 HSPLjava/util/concurrent/atomic/AtomicIntegerFieldUpdater;-><init>()V
@@ -7218,10 +7085,11 @@
 HSPLjava/util/concurrent/atomic/AtomicLong;->set(J)V
 HSPLjava/util/concurrent/atomic/AtomicLong;->toString()Ljava/lang/String;
 HSPLjava/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater;-><init>(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Class;)V
-HSPLjava/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater;->accessCheck(Ljava/lang/Object;)V+]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater;->accessCheck(Ljava/lang/Object;)V
 HSPLjava/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater;->addAndGet(Ljava/lang/Object;J)J
 HSPLjava/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater;->compareAndSet(Ljava/lang/Object;JJ)Z
-HSPLjava/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater;->getAndAdd(Ljava/lang/Object;J)J+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
+HSPLjava/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater;->getAndAdd(Ljava/lang/Object;J)J
+HSPLjava/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater;->getAndIncrement(Ljava/lang/Object;)J+]Ljava/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater;Ljava/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater;
 HSPLjava/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater;->incrementAndGet(Ljava/lang/Object;)J
 HSPLjava/util/concurrent/atomic/AtomicLongFieldUpdater;-><init>()V
 HSPLjava/util/concurrent/atomic/AtomicLongFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;
@@ -7245,12 +7113,12 @@
 HSPLjava/util/concurrent/atomic/AtomicReferenceArray;->set(ILjava/lang/Object;)V
 HSPLjava/util/concurrent/atomic/AtomicReferenceArray;->setRelease(ILjava/lang/Object;)V
 HSPLjava/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl;-><init>(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Class;)V
-HSPLjava/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl;->accessCheck(Ljava/lang/Object;)V+]Ljava/lang/Class;Ljava/lang/Class;
-HSPLjava/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
+HSPLjava/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl;->accessCheck(Ljava/lang/Object;)V
+HSPLjava/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z
 HSPLjava/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl;->get(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl;->getAndSet(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
-HSPLjava/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl;->lazySet(Ljava/lang/Object;Ljava/lang/Object;)V+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
-HSPLjava/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl;->valueCheck(Ljava/lang/Object;)V+]Ljava/lang/Class;Ljava/lang/Class;
+HSPLjava/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl;->lazySet(Ljava/lang/Object;Ljava/lang/Object;)V
+HSPLjava/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl;->valueCheck(Ljava/lang/Object;)V
 HSPLjava/util/concurrent/atomic/AtomicReferenceFieldUpdater;-><init>()V
 HSPLjava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;
 HSPLjava/util/concurrent/atomic/LongAdder;-><init>()V
@@ -7266,13 +7134,13 @@
 HSPLjava/util/concurrent/locks/AbstractOwnableSynchronizer;->getExclusiveOwnerThread()Ljava/lang/Thread;
 HSPLjava/util/concurrent/locks/AbstractOwnableSynchronizer;->setExclusiveOwnerThread(Ljava/lang/Thread;)V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;-><init>()V
-HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;->block()Z+]Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;
+HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;->block()Z
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;->isReleasable()Z
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;-><init>(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer;)V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;->await()V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;->awaitNanos(J)J
-HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;->canReacquire(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;)Z+]Ljava/util/concurrent/locks/AbstractQueuedSynchronizer;Ljava/util/concurrent/locks/ReentrantLock$NonfairSync;
-HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;->doSignal(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;Z)V+]Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;]Ljava/util/concurrent/locks/AbstractQueuedSynchronizer;Ljava/util/concurrent/locks/ReentrantLock$NonfairSync;
+HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;->canReacquire(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;)Z
+HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;->doSignal(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;Z)V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;->enableWait(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;)I
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;->hasWaiters()Z
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;->isOwnedBy(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer;)Z
@@ -7281,23 +7149,23 @@
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;->unlinkCancelledWaiters(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;)V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$ExclusiveNode;-><init>()V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;-><init>()V
-HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;->clearStatus()V+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
-HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;->getAndUnsetStatus(I)I+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
-HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;->setPrevRelaxed(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;)V+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
+HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;->clearStatus()V
+HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;->getAndUnsetStatus(I)I
+HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;->setPrevRelaxed(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;)V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;->setStatusRelaxed(I)V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer$SharedNode;-><init>()V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->-$$Nest$sfgetU()Ljdk/internal/misc/Unsafe;
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;-><init>()V
-HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->acquire(I)V+]Ljava/util/concurrent/locks/AbstractQueuedSynchronizer;Ljava/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync;,Ljava/util/concurrent/locks/ReentrantLock$NonfairSync;,Ljava/util/concurrent/ThreadPoolExecutor$Worker;
+HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->acquire(I)V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->acquire(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;IZZZJ)I
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->acquireInterruptibly(I)V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->acquireShared(I)V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->acquireSharedInterruptibly(I)V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->apparentlyFirstQueuedIsExclusive()Z
-HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->casTail(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;)Z+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
+HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->casTail(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;)Z
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->cleanQueue()V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->compareAndSetState(II)Z
-HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->enqueue(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;)V+]Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;
+HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->enqueue(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;)V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->getFirstQueuedThread()Ljava/lang/Thread;
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->getState()I
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->hasQueuedPredecessors()Z
@@ -7305,44 +7173,44 @@
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->hasWaiters(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;)Z
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->isEnqueued(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;)Z
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->owns(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;)Z
-HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->release(I)Z+]Ljava/util/concurrent/locks/AbstractQueuedSynchronizer;Ljava/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync;,Ljava/util/concurrent/locks/ReentrantLock$NonfairSync;,Ljava/util/concurrent/ThreadPoolExecutor$Worker;
-HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->releaseShared(I)Z+]Ljava/util/concurrent/locks/AbstractQueuedSynchronizer;Ljava/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync;,Ljava/util/concurrent/CountDownLatch$Sync;
+HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->release(I)Z
+HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->releaseShared(I)Z
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->setState(I)V
-HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->signalNext(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;)V+]Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ExclusiveNode;,Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode;,Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$SharedNode;
+HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->signalNext(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;)V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->signalNextIfShared(Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$Node;)V
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->tryAcquireNanos(IJ)Z
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->tryAcquireSharedNanos(IJ)Z
 HSPLjava/util/concurrent/locks/AbstractQueuedSynchronizer;->tryInitializeHead()V
-HSPLjava/util/concurrent/locks/LockSupport;->park()V+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
+HSPLjava/util/concurrent/locks/LockSupport;->park()V
 HSPLjava/util/concurrent/locks/LockSupport;->park(Ljava/lang/Object;)V
 HSPLjava/util/concurrent/locks/LockSupport;->parkNanos(J)V
-HSPLjava/util/concurrent/locks/LockSupport;->parkNanos(Ljava/lang/Object;J)V+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
-HSPLjava/util/concurrent/locks/LockSupport;->setBlocker(Ljava/lang/Thread;Ljava/lang/Object;)V+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
-HSPLjava/util/concurrent/locks/LockSupport;->setCurrentBlocker(Ljava/lang/Object;)V+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
-HSPLjava/util/concurrent/locks/LockSupport;->unpark(Ljava/lang/Thread;)V+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
+HSPLjava/util/concurrent/locks/LockSupport;->parkNanos(Ljava/lang/Object;J)V
+HSPLjava/util/concurrent/locks/LockSupport;->setBlocker(Ljava/lang/Thread;Ljava/lang/Object;)V
+HSPLjava/util/concurrent/locks/LockSupport;->setCurrentBlocker(Ljava/lang/Object;)V
+HSPLjava/util/concurrent/locks/LockSupport;->unpark(Ljava/lang/Thread;)V
 HSPLjava/util/concurrent/locks/ReentrantLock$FairSync;-><init>()V
-HSPLjava/util/concurrent/locks/ReentrantLock$FairSync;->initialTryLock()Z+]Ljava/util/concurrent/locks/ReentrantLock$FairSync;Ljava/util/concurrent/locks/ReentrantLock$FairSync;
+HSPLjava/util/concurrent/locks/ReentrantLock$FairSync;->initialTryLock()Z
 HSPLjava/util/concurrent/locks/ReentrantLock$FairSync;->tryAcquire(I)Z
 HSPLjava/util/concurrent/locks/ReentrantLock$NonfairSync;-><init>()V
-HSPLjava/util/concurrent/locks/ReentrantLock$NonfairSync;->initialTryLock()Z+]Ljava/util/concurrent/locks/ReentrantLock$NonfairSync;Ljava/util/concurrent/locks/ReentrantLock$NonfairSync;
-HSPLjava/util/concurrent/locks/ReentrantLock$NonfairSync;->tryAcquire(I)Z+]Ljava/util/concurrent/locks/ReentrantLock$NonfairSync;Ljava/util/concurrent/locks/ReentrantLock$NonfairSync;
+HSPLjava/util/concurrent/locks/ReentrantLock$NonfairSync;->initialTryLock()Z
+HSPLjava/util/concurrent/locks/ReentrantLock$NonfairSync;->tryAcquire(I)Z
 HSPLjava/util/concurrent/locks/ReentrantLock$Sync;-><init>()V
 HSPLjava/util/concurrent/locks/ReentrantLock$Sync;->isHeldExclusively()Z
-HSPLjava/util/concurrent/locks/ReentrantLock$Sync;->lock()V+]Ljava/util/concurrent/locks/ReentrantLock$Sync;Ljava/util/concurrent/locks/ReentrantLock$NonfairSync;
-HSPLjava/util/concurrent/locks/ReentrantLock$Sync;->lockInterruptibly()V+]Ljava/util/concurrent/locks/ReentrantLock$Sync;Ljava/util/concurrent/locks/ReentrantLock$NonfairSync;
+HSPLjava/util/concurrent/locks/ReentrantLock$Sync;->lock()V
+HSPLjava/util/concurrent/locks/ReentrantLock$Sync;->lockInterruptibly()V
 HSPLjava/util/concurrent/locks/ReentrantLock$Sync;->newCondition()Ljava/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject;
-HSPLjava/util/concurrent/locks/ReentrantLock$Sync;->tryLock()Z+]Ljava/util/concurrent/locks/ReentrantLock$Sync;Ljava/util/concurrent/locks/ReentrantLock$NonfairSync;
-HSPLjava/util/concurrent/locks/ReentrantLock$Sync;->tryRelease(I)Z+]Ljava/util/concurrent/locks/ReentrantLock$Sync;Ljava/util/concurrent/locks/ReentrantLock$NonfairSync;
+HSPLjava/util/concurrent/locks/ReentrantLock$Sync;->tryLock()Z
+HSPLjava/util/concurrent/locks/ReentrantLock$Sync;->tryRelease(I)Z
 HSPLjava/util/concurrent/locks/ReentrantLock;-><init>()V
 HSPLjava/util/concurrent/locks/ReentrantLock;-><init>(Z)V
 HSPLjava/util/concurrent/locks/ReentrantLock;->hasWaiters(Ljava/util/concurrent/locks/Condition;)Z
 HSPLjava/util/concurrent/locks/ReentrantLock;->isHeldByCurrentThread()Z
-HSPLjava/util/concurrent/locks/ReentrantLock;->lock()V+]Ljava/util/concurrent/locks/ReentrantLock$Sync;Ljava/util/concurrent/locks/ReentrantLock$NonfairSync;
-HSPLjava/util/concurrent/locks/ReentrantLock;->lockInterruptibly()V+]Ljava/util/concurrent/locks/ReentrantLock$Sync;Ljava/util/concurrent/locks/ReentrantLock$NonfairSync;
+HSPLjava/util/concurrent/locks/ReentrantLock;->lock()V
+HSPLjava/util/concurrent/locks/ReentrantLock;->lockInterruptibly()V
 HSPLjava/util/concurrent/locks/ReentrantLock;->newCondition()Ljava/util/concurrent/locks/Condition;
 HSPLjava/util/concurrent/locks/ReentrantLock;->tryLock()Z
 HSPLjava/util/concurrent/locks/ReentrantLock;->tryLock(JLjava/util/concurrent/TimeUnit;)Z
-HSPLjava/util/concurrent/locks/ReentrantLock;->unlock()V+]Ljava/util/concurrent/locks/ReentrantLock$Sync;Ljava/util/concurrent/locks/ReentrantLock$NonfairSync;
+HSPLjava/util/concurrent/locks/ReentrantLock;->unlock()V
 HSPLjava/util/concurrent/locks/ReentrantReadWriteLock$FairSync;-><init>()V
 HSPLjava/util/concurrent/locks/ReentrantReadWriteLock$FairSync;->readerShouldBlock()Z
 HSPLjava/util/concurrent/locks/ReentrantReadWriteLock$FairSync;->writerShouldBlock()Z
@@ -7363,26 +7231,24 @@
 HSPLjava/util/concurrent/locks/ReentrantReadWriteLock$Sync;->getReadLockCount()I
 HSPLjava/util/concurrent/locks/ReentrantReadWriteLock$Sync;->isHeldExclusively()Z
 HSPLjava/util/concurrent/locks/ReentrantReadWriteLock$Sync;->sharedCount(I)I
-HSPLjava/util/concurrent/locks/ReentrantReadWriteLock$Sync;->tryAcquire(I)Z+]Ljava/util/concurrent/locks/ReentrantReadWriteLock$Sync;Ljava/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync;
-HSPLjava/util/concurrent/locks/ReentrantReadWriteLock$Sync;->tryAcquireShared(I)I+]Ljava/util/concurrent/locks/ReentrantReadWriteLock$Sync$ThreadLocalHoldCounter;Ljava/util/concurrent/locks/ReentrantReadWriteLock$Sync$ThreadLocalHoldCounter;]Ljava/util/concurrent/locks/ReentrantReadWriteLock$Sync;Ljava/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync;
+HSPLjava/util/concurrent/locks/ReentrantReadWriteLock$Sync;->tryAcquire(I)Z
+HSPLjava/util/concurrent/locks/ReentrantReadWriteLock$Sync;->tryAcquireShared(I)I
 HSPLjava/util/concurrent/locks/ReentrantReadWriteLock$Sync;->tryRelease(I)Z
-HSPLjava/util/concurrent/locks/ReentrantReadWriteLock$Sync;->tryReleaseShared(I)Z+]Ljava/util/concurrent/locks/ReentrantReadWriteLock$Sync$ThreadLocalHoldCounter;Ljava/util/concurrent/locks/ReentrantReadWriteLock$Sync$ThreadLocalHoldCounter;]Ljava/util/concurrent/locks/ReentrantReadWriteLock$Sync;Ljava/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync;
+HSPLjava/util/concurrent/locks/ReentrantReadWriteLock$Sync;->tryReleaseShared(I)Z
 HSPLjava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;-><init>(Ljava/util/concurrent/locks/ReentrantReadWriteLock;)V
 HSPLjava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;->lock()V
 HSPLjava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;->unlock()V
 HSPLjava/util/concurrent/locks/ReentrantReadWriteLock;-><init>()V
 HSPLjava/util/concurrent/locks/ReentrantReadWriteLock;-><init>(Z)V
 HSPLjava/util/concurrent/locks/ReentrantReadWriteLock;->getReadHoldCount()I
-HSPLjava/util/concurrent/locks/ReentrantReadWriteLock;->readLock()Ljava/util/concurrent/locks/Lock;+]Ljava/util/concurrent/locks/ReentrantReadWriteLock;Ljava/util/concurrent/locks/ReentrantReadWriteLock;
+HSPLjava/util/concurrent/locks/ReentrantReadWriteLock;->readLock()Ljava/util/concurrent/locks/Lock;
 HSPLjava/util/concurrent/locks/ReentrantReadWriteLock;->readLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;
 HSPLjava/util/concurrent/locks/ReentrantReadWriteLock;->writeLock()Ljava/util/concurrent/locks/Lock;
 HSPLjava/util/concurrent/locks/ReentrantReadWriteLock;->writeLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
 HSPLjava/util/function/BinaryOperator$$ExternalSyntheticLambda0;-><init>(Ljava/util/Comparator;)V
 HSPLjava/util/function/BinaryOperator;->maxBy(Ljava/util/Comparator;)Ljava/util/function/BinaryOperator;
-HSPLjava/util/function/DoubleUnaryOperator$$ExternalSyntheticLambda1;-><init>(Ljava/util/function/DoubleUnaryOperator;Ljava/util/function/DoubleUnaryOperator;)V
 HSPLjava/util/function/DoubleUnaryOperator$$ExternalSyntheticLambda1;->applyAsDouble(D)D
 HSPLjava/util/function/DoubleUnaryOperator;->andThen(Ljava/util/function/DoubleUnaryOperator;)Ljava/util/function/DoubleUnaryOperator;
-HSPLjava/util/function/Function$$ExternalSyntheticLambda1;-><init>()V
 HSPLjava/util/function/Function$$ExternalSyntheticLambda1;->apply(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/function/Function$$ExternalSyntheticLambda2;->apply(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/function/Function;->identity()Ljava/util/function/Function;
@@ -7397,11 +7263,11 @@
 HSPLjava/util/jar/Attributes;->entrySet()Ljava/util/Set;
 HSPLjava/util/jar/Attributes;->get(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/jar/Attributes;->getValue(Ljava/util/jar/Attributes$Name;)Ljava/lang/String;
-HSPLjava/util/jar/Attributes;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/util/Map;Ljava/util/LinkedHashMap;
-HSPLjava/util/jar/Attributes;->putValue(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+]Ljava/util/jar/Attributes;Ljava/util/jar/Attributes;
+HSPLjava/util/jar/Attributes;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
+HSPLjava/util/jar/Attributes;->putValue(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
 HSPLjava/util/jar/Attributes;->read(Ljava/util/jar/Manifest$FastInputStream;[B)V
-HSPLjava/util/jar/Attributes;->read(Ljava/util/jar/Manifest$FastInputStream;[BLjava/lang/String;I)I+]Ljava/util/jar/Attributes;Ljava/util/jar/Attributes;]Ljava/util/jar/Manifest$FastInputStream;Ljava/util/jar/Manifest$FastInputStream;
-HSPLjava/util/jar/Attributes;->size()I+]Ljava/util/Map;Ljava/util/LinkedHashMap;
+HSPLjava/util/jar/Attributes;->read(Ljava/util/jar/Manifest$FastInputStream;[BLjava/lang/String;I)I
+HSPLjava/util/jar/Attributes;->size()I
 HSPLjava/util/jar/JarEntry;-><init>(Ljava/util/zip/ZipEntry;)V
 HSPLjava/util/jar/JarFile$JarFileEntry;-><init>(Ljava/util/jar/JarFile;Ljava/util/zip/ZipEntry;)V
 HSPLjava/util/jar/JarFile;-><init>(Ljava/io/File;ZI)V
@@ -7432,7 +7298,7 @@
 HSPLjava/util/jar/Manifest$FastInputStream;-><init>(Ljava/io/InputStream;I)V
 HSPLjava/util/jar/Manifest$FastInputStream;->fill()V
 HSPLjava/util/jar/Manifest$FastInputStream;->peek()B
-HSPLjava/util/jar/Manifest$FastInputStream;->readLine([B)I+]Ljava/util/jar/Manifest$FastInputStream;Ljava/util/jar/Manifest$FastInputStream;
+HSPLjava/util/jar/Manifest$FastInputStream;->readLine([B)I
 HSPLjava/util/jar/Manifest$FastInputStream;->readLine([BII)I
 HSPLjava/util/jar/Manifest;-><init>()V
 HSPLjava/util/jar/Manifest;-><init>(Ljava/io/InputStream;)V
@@ -7451,7 +7317,7 @@
 HSPLjava/util/logging/FileHandler$MeteredStream;-><init>(Ljava/util/logging/FileHandler;Ljava/io/OutputStream;I)V
 HSPLjava/util/logging/FileHandler$MeteredStream;->close()V
 HSPLjava/util/logging/FileHandler$MeteredStream;->flush()V
-HSPLjava/util/logging/FileHandler$MeteredStream;->write([BII)V+]Ljava/io/OutputStream;Ljava/io/BufferedOutputStream;
+HSPLjava/util/logging/FileHandler$MeteredStream;->write([BII)V
 HSPLjava/util/logging/FileHandler;->-$$Nest$mrotate(Ljava/util/logging/FileHandler;)V
 HSPLjava/util/logging/FileHandler;-><clinit>()V
 HSPLjava/util/logging/FileHandler;-><init>(Ljava/lang/String;IIZ)V
@@ -7460,7 +7326,7 @@
 HSPLjava/util/logging/FileHandler;->isParentWritable(Ljava/nio/file/Path;)Z
 HSPLjava/util/logging/FileHandler;->open(Ljava/io/File;Z)V
 HSPLjava/util/logging/FileHandler;->openFiles()V
-HSPLjava/util/logging/FileHandler;->publish(Ljava/util/logging/LogRecord;)V+]Ljava/util/logging/FileHandler;Ljava/util/logging/FileHandler;
+HSPLjava/util/logging/FileHandler;->publish(Ljava/util/logging/LogRecord;)V
 HSPLjava/util/logging/FileHandler;->rotate()V
 HSPLjava/util/logging/Formatter;-><init>()V
 HSPLjava/util/logging/Formatter;->getHead(Ljava/util/logging/Handler;)Ljava/lang/String;
@@ -7471,7 +7337,7 @@
 HSPLjava/util/logging/Handler;->getFilter()Ljava/util/logging/Filter;
 HSPLjava/util/logging/Handler;->getFormatter()Ljava/util/logging/Formatter;
 HSPLjava/util/logging/Handler;->getLevel()Ljava/util/logging/Level;
-HSPLjava/util/logging/Handler;->isLoggable(Ljava/util/logging/LogRecord;)Z+]Ljava/util/logging/Handler;Ljava/util/logging/FileHandler;]Ljava/util/logging/Level;Ljava/util/logging/Level;]Ljava/util/logging/LogRecord;Ljava/util/logging/LogRecord;
+HSPLjava/util/logging/Handler;->isLoggable(Ljava/util/logging/LogRecord;)Z
 HSPLjava/util/logging/Handler;->setEncoding(Ljava/lang/String;)V
 HSPLjava/util/logging/Handler;->setErrorManager(Ljava/util/logging/ErrorManager;)V
 HSPLjava/util/logging/Handler;->setFilter(Ljava/util/logging/Filter;)V
@@ -7538,7 +7404,7 @@
 HSPLjava/util/logging/LogManager;->parseClassNames(Ljava/lang/String;)[Ljava/lang/String;
 HSPLjava/util/logging/LogManager;->reset()V
 HSPLjava/util/logging/LogManager;->resetLogger(Ljava/util/logging/Logger;)V
-HSPLjava/util/logging/LogRecord;-><init>(Ljava/util/logging/Level;Ljava/lang/String;)V+]Ljava/lang/Object;Ljava/util/logging/Level;]Ljava/util/concurrent/atomic/AtomicLong;Ljava/util/concurrent/atomic/AtomicLong;
+HSPLjava/util/logging/LogRecord;-><init>(Ljava/util/logging/Level;Ljava/lang/String;)V
 HSPLjava/util/logging/LogRecord;->defaultThreadID()I
 HSPLjava/util/logging/LogRecord;->getLevel()Ljava/util/logging/Level;
 HSPLjava/util/logging/LogRecord;->getLoggerName()Ljava/lang/String;
@@ -7559,12 +7425,12 @@
 HSPLjava/util/logging/Logger;->addHandler(Ljava/util/logging/Handler;)V
 HSPLjava/util/logging/Logger;->checkPermission()V
 HSPLjava/util/logging/Logger;->demandLogger(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)Ljava/util/logging/Logger;
-HSPLjava/util/logging/Logger;->doLog(Ljava/util/logging/LogRecord;)V+]Ljava/util/logging/LogRecord;Ljava/util/logging/LogRecord;]Ljava/util/logging/Logger;Ljava/util/logging/Logger;
+HSPLjava/util/logging/Logger;->doLog(Ljava/util/logging/LogRecord;)V
 HSPLjava/util/logging/Logger;->doSetParent(Ljava/util/logging/Logger;)V
 HSPLjava/util/logging/Logger;->findResourceBundle(Ljava/lang/String;Z)Ljava/util/ResourceBundle;
 HSPLjava/util/logging/Logger;->findSystemResourceBundle(Ljava/util/Locale;)Ljava/util/ResourceBundle;
 HSPLjava/util/logging/Logger;->getCallersClassLoader()Ljava/lang/ClassLoader;
-HSPLjava/util/logging/Logger;->getEffectiveLoggerBundle()Ljava/util/logging/Logger$LoggerBundle;+]Ljava/util/logging/Logger$LoggerBundle;Ljava/util/logging/Logger$LoggerBundle;]Ljava/util/logging/Logger;Ljava/util/logging/LogManager$RootLogger;,Ljava/util/logging/Logger;
+HSPLjava/util/logging/Logger;->getEffectiveLoggerBundle()Ljava/util/logging/Logger$LoggerBundle;
 HSPLjava/util/logging/Logger;->getHandlers()[Ljava/util/logging/Handler;
 HSPLjava/util/logging/Logger;->getLogger(Ljava/lang/String;)Ljava/util/logging/Logger;
 HSPLjava/util/logging/Logger;->getName()Ljava/lang/String;
@@ -7574,10 +7440,10 @@
 HSPLjava/util/logging/Logger;->getResourceBundleName()Ljava/lang/String;
 HSPLjava/util/logging/Logger;->getUseParentHandlers()Z
 HSPLjava/util/logging/Logger;->info(Ljava/lang/String;)V
-HSPLjava/util/logging/Logger;->isLoggable(Ljava/util/logging/Level;)Z+]Ljava/util/logging/Level;Ljava/util/logging/Level;
+HSPLjava/util/logging/Logger;->isLoggable(Ljava/util/logging/Level;)Z
 HSPLjava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;)V
-HSPLjava/util/logging/Logger;->log(Ljava/util/logging/LogRecord;)V+]Ljava/util/logging/Handler;Ljava/util/logging/FileHandler;]Ljava/util/logging/LogRecord;Ljava/util/logging/LogRecord;]Ljava/util/logging/Logger;Ljava/util/logging/Logger;
-HSPLjava/util/logging/Logger;->logp(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V+]Ljava/util/logging/LogRecord;Ljava/util/logging/LogRecord;]Ljava/util/logging/Logger;Ljava/util/logging/Logger;
+HSPLjava/util/logging/Logger;->log(Ljava/util/logging/LogRecord;)V
+HSPLjava/util/logging/Logger;->logp(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
 HSPLjava/util/logging/Logger;->logp(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V
 HSPLjava/util/logging/Logger;->logp(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
 HSPLjava/util/logging/Logger;->removeChildLogger(Ljava/util/logging/LogManager$LoggerWeakRef;)V
@@ -7596,45 +7462,46 @@
 HSPLjava/util/logging/StreamHandler;-><init>()V
 HSPLjava/util/logging/StreamHandler;->close()V
 HSPLjava/util/logging/StreamHandler;->configure()V
-HSPLjava/util/logging/StreamHandler;->flush()V+]Ljava/io/Writer;Ljava/io/OutputStreamWriter;
+HSPLjava/util/logging/StreamHandler;->flush()V
 HSPLjava/util/logging/StreamHandler;->flushAndClose()V
 HSPLjava/util/logging/StreamHandler;->isLoggable(Ljava/util/logging/LogRecord;)Z
-HSPLjava/util/logging/StreamHandler;->publish(Ljava/util/logging/LogRecord;)V+]Ljava/io/Writer;Ljava/io/OutputStreamWriter;]Ljava/util/logging/StreamHandler;Ljava/util/logging/FileHandler;
+HSPLjava/util/logging/StreamHandler;->publish(Ljava/util/logging/LogRecord;)V
 HSPLjava/util/logging/StreamHandler;->setEncoding(Ljava/lang/String;)V
 HSPLjava/util/logging/StreamHandler;->setOutputStream(Ljava/io/OutputStream;)V
 HSPLjava/util/logging/XMLFormatter;-><init>()V
-HSPLjava/util/regex/Matcher;-><init>(Ljava/util/regex/Pattern;Ljava/lang/CharSequence;)V+]Ljava/util/regex/Matcher;Ljava/util/regex/Matcher;
-HSPLjava/util/regex/Matcher;->appendEvaluated(Ljava/lang/StringBuilder;Ljava/lang/String;)V+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
+HSPLjava/util/regex/Matcher;-><init>(Ljava/util/regex/Pattern;Ljava/lang/CharSequence;)V
+HSPLjava/util/regex/Matcher;->appendEvaluated(Ljava/lang/StringBuilder;Ljava/lang/String;)V
+HSPLjava/util/regex/Matcher;->appendExpandedReplacement(Ljava/lang/String;Ljava/lang/StringBuilder;)Ljava/lang/StringBuilder;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/util/regex/Matcher;Ljava/util/regex/Matcher;
 HSPLjava/util/regex/Matcher;->appendReplacement(Ljava/lang/StringBuffer;Ljava/lang/String;)Ljava/util/regex/Matcher;
-HSPLjava/util/regex/Matcher;->appendReplacement(Ljava/lang/StringBuilder;Ljava/lang/String;)Ljava/util/regex/Matcher;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/util/regex/Matcher;Ljava/util/regex/Matcher;
-HSPLjava/util/regex/Matcher;->appendReplacementInternal(Ljava/lang/StringBuilder;Ljava/lang/String;)V+]Ljava/util/regex/Matcher;Ljava/util/regex/Matcher;
+HSPLjava/util/regex/Matcher;->appendReplacement(Ljava/lang/StringBuilder;Ljava/lang/String;)Ljava/util/regex/Matcher;
+HSPLjava/util/regex/Matcher;->appendReplacementInternal(Ljava/lang/StringBuilder;Ljava/lang/String;)V
 HSPLjava/util/regex/Matcher;->appendTail(Ljava/lang/StringBuffer;)Ljava/lang/StringBuffer;
-HSPLjava/util/regex/Matcher;->appendTail(Ljava/lang/StringBuilder;)Ljava/lang/StringBuilder;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/lang/String;Ljava/lang/String;
+HSPLjava/util/regex/Matcher;->appendTail(Ljava/lang/StringBuilder;)Ljava/lang/StringBuilder;
 HSPLjava/util/regex/Matcher;->end()I
 HSPLjava/util/regex/Matcher;->end(I)I
 HSPLjava/util/regex/Matcher;->ensureMatch()V
-HSPLjava/util/regex/Matcher;->find()Z+]Lcom/android/icu/util/regex/MatcherNative;Lcom/android/icu/util/regex/MatcherNative;
+HSPLjava/util/regex/Matcher;->find()Z
 HSPLjava/util/regex/Matcher;->find(I)Z
 HSPLjava/util/regex/Matcher;->getSubSequence(II)Ljava/lang/CharSequence;
 HSPLjava/util/regex/Matcher;->getTextLength()I
 HSPLjava/util/regex/Matcher;->group()Ljava/lang/String;
 HSPLjava/util/regex/Matcher;->group(I)Ljava/lang/String;
-HSPLjava/util/regex/Matcher;->groupCount()I+]Lcom/android/icu/util/regex/MatcherNative;Lcom/android/icu/util/regex/MatcherNative;
+HSPLjava/util/regex/Matcher;->groupCount()I
 HSPLjava/util/regex/Matcher;->hitEnd()Z
-HSPLjava/util/regex/Matcher;->lookingAt()Z+]Lcom/android/icu/util/regex/MatcherNative;Lcom/android/icu/util/regex/MatcherNative;
-HSPLjava/util/regex/Matcher;->matches()Z+]Lcom/android/icu/util/regex/MatcherNative;Lcom/android/icu/util/regex/MatcherNative;
+HSPLjava/util/regex/Matcher;->lookingAt()Z
+HSPLjava/util/regex/Matcher;->matches()Z
 HSPLjava/util/regex/Matcher;->pattern()Ljava/util/regex/Pattern;
 HSPLjava/util/regex/Matcher;->region(II)Ljava/util/regex/Matcher;
-HSPLjava/util/regex/Matcher;->replaceAll(Ljava/lang/String;)Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/lang/String;Ljava/lang/String;]Ljava/util/regex/Matcher;Ljava/util/regex/Matcher;
+HSPLjava/util/regex/Matcher;->replaceAll(Ljava/lang/String;)Ljava/lang/String;
 HSPLjava/util/regex/Matcher;->replaceFirst(Ljava/lang/String;)Ljava/lang/String;
-HSPLjava/util/regex/Matcher;->reset()Ljava/util/regex/Matcher;+]Ljava/lang/CharSequence;Ljava/lang/String;
-HSPLjava/util/regex/Matcher;->reset(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;+]Ljava/lang/CharSequence;Ljava/lang/String;,Ljava/lang/StringBuilder;
-HSPLjava/util/regex/Matcher;->reset(Ljava/lang/CharSequence;II)Ljava/util/regex/Matcher;+]Ljava/lang/CharSequence;Ljava/lang/String;
-HSPLjava/util/regex/Matcher;->resetForInput()V+]Lcom/android/icu/util/regex/MatcherNative;Lcom/android/icu/util/regex/MatcherNative;
+HSPLjava/util/regex/Matcher;->reset()Ljava/util/regex/Matcher;
+HSPLjava/util/regex/Matcher;->reset(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
+HSPLjava/util/regex/Matcher;->reset(Ljava/lang/CharSequence;II)Ljava/util/regex/Matcher;
+HSPLjava/util/regex/Matcher;->resetForInput()V
 HSPLjava/util/regex/Matcher;->start()I
 HSPLjava/util/regex/Matcher;->start(I)I
 HSPLjava/util/regex/Matcher;->useAnchoringBounds(Z)Ljava/util/regex/Matcher;
-HSPLjava/util/regex/Matcher;->usePattern(Ljava/util/regex/Pattern;)Ljava/util/regex/Matcher;+]Ljava/util/regex/Matcher;Ljava/util/regex/Matcher;
+HSPLjava/util/regex/Matcher;->usePattern(Ljava/util/regex/Pattern;)Ljava/util/regex/Matcher;
 HSPLjava/util/regex/Matcher;->useTransparentBounds(Z)Ljava/util/regex/Matcher;
 HSPLjava/util/regex/Pattern;-><init>(Ljava/lang/String;I)V
 HSPLjava/util/regex/Pattern;->compile()V
@@ -7646,12 +7513,12 @@
 HSPLjava/util/regex/Pattern;->pattern()Ljava/lang/String;
 HSPLjava/util/regex/Pattern;->quote(Ljava/lang/String;)Ljava/lang/String;
 HSPLjava/util/regex/Pattern;->split(Ljava/lang/CharSequence;)[Ljava/lang/String;
-HSPLjava/util/regex/Pattern;->split(Ljava/lang/CharSequence;I)[Ljava/lang/String;+]Ljava/util/List;Ljava/util/ArrayList$SubList;]Ljava/lang/CharSequence;Ljava/lang/String;]Ljava/util/regex/Pattern;Ljava/util/regex/Pattern;]Ljava/util/regex/Matcher;Ljava/util/regex/Matcher;]Ljava/util/ArrayList;Ljava/util/ArrayList;
+HSPLjava/util/regex/Pattern;->split(Ljava/lang/CharSequence;I)[Ljava/lang/String;
 HSPLjava/util/regex/Pattern;->toString()Ljava/lang/String;
 HSPLjava/util/stream/AbstractPipeline;-><init>(Ljava/util/Spliterator;IZ)V
-HSPLjava/util/stream/AbstractPipeline;-><init>(Ljava/util/stream/AbstractPipeline;I)V+]Ljava/util/stream/AbstractPipeline;Ljava/util/stream/IntPipeline$4;,Ljava/util/stream/SortedOps$OfRef;,Ljava/util/stream/ReferencePipeline$3;,Ljava/util/stream/ReferencePipeline$4;
+HSPLjava/util/stream/AbstractPipeline;-><init>(Ljava/util/stream/AbstractPipeline;I)V
 HSPLjava/util/stream/AbstractPipeline;->close()V
-HSPLjava/util/stream/AbstractPipeline;->copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+]Ljava/util/Spliterator;Ljava/util/Spliterators$IntArraySpliterator;,Ljava/util/HashMap$KeySpliterator;]Ljava/util/stream/AbstractPipeline;Ljava/util/stream/IntPipeline$4;,Ljava/util/stream/ReferencePipeline$4;]Ljava/util/stream/Sink;Ljava/util/stream/ReferencePipeline$4$1;,Ljava/util/stream/IntPipeline$4$1;]Ljava/util/stream/StreamOpFlag;Ljava/util/stream/StreamOpFlag;
+HSPLjava/util/stream/AbstractPipeline;->copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V
 HSPLjava/util/stream/AbstractPipeline;->evaluate(Ljava/util/Spliterator;ZLjava/util/function/IntFunction;)Ljava/util/stream/Node;
 HSPLjava/util/stream/AbstractPipeline;->evaluate(Ljava/util/stream/TerminalOp;)Ljava/lang/Object;
 HSPLjava/util/stream/AbstractPipeline;->evaluateToArrayNode(Ljava/util/function/IntFunction;)Ljava/util/stream/Node;
@@ -7660,7 +7527,7 @@
 HSPLjava/util/stream/AbstractPipeline;->isParallel()Z
 HSPLjava/util/stream/AbstractPipeline;->onClose(Ljava/lang/Runnable;)Ljava/util/stream/BaseStream;
 HSPLjava/util/stream/AbstractPipeline;->sequential()Ljava/util/stream/BaseStream;
-HSPLjava/util/stream/AbstractPipeline;->sourceSpliterator(I)Ljava/util/Spliterator;+]Ljava/util/stream/AbstractPipeline;Ljava/util/stream/IntPipeline$4;,Ljava/util/stream/ReferencePipeline$4;
+HSPLjava/util/stream/AbstractPipeline;->sourceSpliterator(I)Ljava/util/Spliterator;
 HSPLjava/util/stream/AbstractPipeline;->sourceStageSpliterator()Ljava/util/Spliterator;
 HSPLjava/util/stream/AbstractPipeline;->spliterator()Ljava/util/Spliterator;
 HSPLjava/util/stream/AbstractPipeline;->wrapAndCopyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)Ljava/util/stream/Sink;
@@ -7668,30 +7535,11 @@
 HSPLjava/util/stream/AbstractSpinedBuffer;-><init>()V
 HSPLjava/util/stream/AbstractSpinedBuffer;->count()J
 HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda0;-><init>()V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda0;->accept(Ljava/lang/Object;Ljava/lang/Object;)V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda15;-><init>()V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda1;-><init>()V
 HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda20;->accept(Ljava/lang/Object;Ljava/lang/Object;)V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda21;->accept(Ljava/lang/Object;Ljava/lang/Object;)V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda24;-><init>(Ljava/util/function/BinaryOperator;)V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda39;->accept(Ljava/lang/Object;Ljava/lang/Object;)V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda41;-><init>()V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda41;->get()Ljava/lang/Object;
 HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda42;-><init>()V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda42;->accept(Ljava/lang/Object;Ljava/lang/Object;)V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda50;-><init>(Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;)V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda50;->get()Ljava/lang/Object;
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda51;-><init>()V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda51;->accept(Ljava/lang/Object;Ljava/lang/Object;)V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda52;-><init>()V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda53;-><init>()V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda53;->apply(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda65;->get()Ljava/lang/Object;
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda66;->get()Ljava/lang/Object;
 HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda74;-><init>()V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda74;->get()Ljava/lang/Object;
 HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda75;-><init>()V
-HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda75;->accept(Ljava/lang/Object;Ljava/lang/Object;)V
 HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda76;-><init>()V
 HSPLjava/util/stream/Collectors$$ExternalSyntheticLambda87;-><init>()V
 HSPLjava/util/stream/Collectors$CollectorImpl;-><init>(Ljava/util/function/Supplier;Ljava/util/function/BiConsumer;Ljava/util/function/BinaryOperator;Ljava/util/Set;)V
@@ -7729,10 +7577,6 @@
 HSPLjava/util/stream/DoublePipeline;-><init>(Ljava/util/stream/AbstractPipeline;I)V
 HSPLjava/util/stream/DoublePipeline;->max()Ljava/util/OptionalDouble;
 HSPLjava/util/stream/DoublePipeline;->reduce(Ljava/util/function/DoubleBinaryOperator;)Ljava/util/OptionalDouble;
-HSPLjava/util/stream/FindOps$$ExternalSyntheticLambda4;-><init>()V
-HSPLjava/util/stream/FindOps$$ExternalSyntheticLambda5;-><init>()V
-HSPLjava/util/stream/FindOps$$ExternalSyntheticLambda5;->get()Ljava/lang/Object;
-HSPLjava/util/stream/FindOps$$ExternalSyntheticLambda7;->get()Ljava/lang/Object;
 HSPLjava/util/stream/FindOps$FindOp;-><init>(ZLjava/util/stream/StreamShape;Ljava/lang/Object;Ljava/util/function/Predicate;Ljava/util/function/Supplier;)V
 HSPLjava/util/stream/FindOps$FindOp;->evaluateSequential(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;)Ljava/lang/Object;
 HSPLjava/util/stream/FindOps$FindOp;->getOpFlags()I
@@ -7751,19 +7595,11 @@
 HSPLjava/util/stream/ForEachOps$ForEachOp;->get()Ljava/lang/Void;
 HSPLjava/util/stream/ForEachOps$ForEachOp;->getOpFlags()I
 HSPLjava/util/stream/ForEachOps;->makeRef(Ljava/util/function/Consumer;Z)Ljava/util/stream/TerminalOp;
-HSPLjava/util/stream/IntPipeline$$ExternalSyntheticLambda13;->applyAsInt(II)I
 HSPLjava/util/stream/IntPipeline$$ExternalSyntheticLambda7;-><init>()V
-HSPLjava/util/stream/IntPipeline$$ExternalSyntheticLambda7;->apply(I)Ljava/lang/Object;
 HSPLjava/util/stream/IntPipeline$$ExternalSyntheticLambda8;-><init>()V
-HSPLjava/util/stream/IntPipeline$$ExternalSyntheticLambda8;->apply(I)Ljava/lang/Object;
 HSPLjava/util/stream/IntPipeline$4$1;-><init>(Ljava/util/stream/IntPipeline$4;Ljava/util/stream/Sink;)V
 HSPLjava/util/stream/IntPipeline$4$1;->accept(I)V
-HSPLjava/util/stream/IntPipeline$4;-><init>(Ljava/util/stream/IntPipeline;Ljava/util/stream/AbstractPipeline;Ljava/util/stream/StreamShape;ILjava/util/function/IntFunction;)V
 HSPLjava/util/stream/IntPipeline$4;->opWrapSink(ILjava/util/stream/Sink;)Ljava/util/stream/Sink;
-HSPLjava/util/stream/IntPipeline$9$1;-><init>(Ljava/util/stream/IntPipeline$9;Ljava/util/stream/Sink;)V
-HSPLjava/util/stream/IntPipeline$9$1;->accept(I)V
-HSPLjava/util/stream/IntPipeline$9$1;->begin(J)V
-HSPLjava/util/stream/IntPipeline$9;-><init>(Ljava/util/stream/IntPipeline;Ljava/util/stream/AbstractPipeline;Ljava/util/stream/StreamShape;ILjava/util/function/IntPredicate;)V
 HSPLjava/util/stream/IntPipeline$9;->opWrapSink(ILjava/util/stream/Sink;)Ljava/util/stream/Sink;
 HSPLjava/util/stream/IntPipeline$Head;-><init>(Ljava/util/Spliterator;IZ)V
 HSPLjava/util/stream/IntPipeline$Head;->forEach(Ljava/util/function/IntConsumer;)V
@@ -7788,14 +7624,11 @@
 HSPLjava/util/stream/IntStream;->range(II)Ljava/util/stream/IntStream;
 HSPLjava/util/stream/IntStream;->rangeClosed(II)Ljava/util/stream/IntStream;
 HSPLjava/util/stream/LongPipeline$$ExternalSyntheticLambda4;-><init>()V
-HSPLjava/util/stream/LongPipeline$$ExternalSyntheticLambda7;-><init>()V
-HSPLjava/util/stream/LongPipeline$$ExternalSyntheticLambda7;->applyAsLong(JJ)J
 HSPLjava/util/stream/LongPipeline$StatelessOp;-><init>(Ljava/util/stream/AbstractPipeline;Ljava/util/stream/StreamShape;I)V
 HSPLjava/util/stream/LongPipeline$StatelessOp;->opIsStateful()Z
 HSPLjava/util/stream/LongPipeline;-><init>(Ljava/util/stream/AbstractPipeline;I)V
 HSPLjava/util/stream/LongPipeline;->reduce(JLjava/util/function/LongBinaryOperator;)J
 HSPLjava/util/stream/LongPipeline;->sum()J
-HSPLjava/util/stream/MatchOps$$ExternalSyntheticLambda0;-><init>(Ljava/util/stream/MatchOps$MatchKind;Ljava/util/function/IntPredicate;)V
 HSPLjava/util/stream/MatchOps$$ExternalSyntheticLambda0;->get()Ljava/lang/Object;
 HSPLjava/util/stream/MatchOps$$ExternalSyntheticLambda1;->get()Ljava/lang/Object;
 HSPLjava/util/stream/MatchOps$$ExternalSyntheticLambda3;->get()Ljava/lang/Object;
@@ -7846,8 +7679,6 @@
 HSPLjava/util/stream/Nodes;->flattenInt(Ljava/util/stream/Node$OfInt;)Ljava/util/stream/Node$OfInt;
 HSPLjava/util/stream/Nodes;->intBuilder(J)Ljava/util/stream/Node$Builder$OfInt;
 HSPLjava/util/stream/PipelineHelper;-><init>()V
-HSPLjava/util/stream/ReduceOps$12;-><init>(Ljava/util/stream/StreamShape;Ljava/util/function/DoubleBinaryOperator;)V
-HSPLjava/util/stream/ReduceOps$12;->makeSink()Ljava/util/stream/ReduceOps$12ReducingSink;
 HSPLjava/util/stream/ReduceOps$12;->makeSink()Ljava/util/stream/ReduceOps$AccumulatingSink;
 HSPLjava/util/stream/ReduceOps$12ReducingSink;-><init>(Ljava/util/function/DoubleBinaryOperator;)V
 HSPLjava/util/stream/ReduceOps$12ReducingSink;->accept(D)V
@@ -7869,16 +7700,12 @@
 HSPLjava/util/stream/ReduceOps$3ReducingSink;-><init>(Ljava/util/function/Supplier;Ljava/util/function/BiConsumer;Ljava/util/function/BinaryOperator;)V
 HSPLjava/util/stream/ReduceOps$3ReducingSink;->accept(Ljava/lang/Object;)V
 HSPLjava/util/stream/ReduceOps$3ReducingSink;->begin(J)V
-HSPLjava/util/stream/ReduceOps$5;-><init>(Ljava/util/stream/StreamShape;Ljava/util/function/IntBinaryOperator;I)V
-HSPLjava/util/stream/ReduceOps$5;->makeSink()Ljava/util/stream/ReduceOps$5ReducingSink;
 HSPLjava/util/stream/ReduceOps$5;->makeSink()Ljava/util/stream/ReduceOps$AccumulatingSink;
 HSPLjava/util/stream/ReduceOps$5ReducingSink;-><init>(ILjava/util/function/IntBinaryOperator;)V
 HSPLjava/util/stream/ReduceOps$5ReducingSink;->accept(I)V
 HSPLjava/util/stream/ReduceOps$5ReducingSink;->begin(J)V
 HSPLjava/util/stream/ReduceOps$5ReducingSink;->get()Ljava/lang/Integer;
 HSPLjava/util/stream/ReduceOps$5ReducingSink;->get()Ljava/lang/Object;
-HSPLjava/util/stream/ReduceOps$8;-><init>(Ljava/util/stream/StreamShape;Ljava/util/function/LongBinaryOperator;J)V
-HSPLjava/util/stream/ReduceOps$8;->makeSink()Ljava/util/stream/ReduceOps$8ReducingSink;
 HSPLjava/util/stream/ReduceOps$8;->makeSink()Ljava/util/stream/ReduceOps$AccumulatingSink;
 HSPLjava/util/stream/ReduceOps$8ReducingSink;-><init>(JLjava/util/function/LongBinaryOperator;)V
 HSPLjava/util/stream/ReduceOps$8ReducingSink;->accept(J)V
@@ -7893,9 +7720,7 @@
 HSPLjava/util/stream/ReduceOps;->makeInt(ILjava/util/function/IntBinaryOperator;)Ljava/util/stream/TerminalOp;
 HSPLjava/util/stream/ReduceOps;->makeLong(JLjava/util/function/LongBinaryOperator;)Ljava/util/stream/TerminalOp;
 HSPLjava/util/stream/ReduceOps;->makeRef(Ljava/util/function/BinaryOperator;)Ljava/util/stream/TerminalOp;
-HSPLjava/util/stream/ReduceOps;->makeRef(Ljava/util/stream/Collector;)Ljava/util/stream/TerminalOp;+]Ljava/util/stream/Collector;Ljava/util/stream/Collectors$CollectorImpl;
-HSPLjava/util/stream/ReferencePipeline$$ExternalSyntheticLambda2;-><init>()V
-HSPLjava/util/stream/ReferencePipeline$$ExternalSyntheticLambda2;->applyAsLong(Ljava/lang/Object;)J
+HSPLjava/util/stream/ReduceOps;->makeRef(Ljava/util/stream/Collector;)Ljava/util/stream/TerminalOp;
 HSPLjava/util/stream/ReferencePipeline$2$1;-><init>(Ljava/util/stream/ReferencePipeline$2;Ljava/util/stream/Sink;)V
 HSPLjava/util/stream/ReferencePipeline$2$1;->accept(Ljava/lang/Object;)V
 HSPLjava/util/stream/ReferencePipeline$2$1;->begin(J)V
@@ -7941,7 +7766,6 @@
 HSPLjava/util/stream/ReferencePipeline;->flatMap(Ljava/util/function/Function;)Ljava/util/stream/Stream;
 HSPLjava/util/stream/ReferencePipeline;->forEach(Ljava/util/function/Consumer;)V
 HSPLjava/util/stream/ReferencePipeline;->forEachWithCancel(Ljava/util/Spliterator;Ljava/util/stream/Sink;)Z
-HSPLjava/util/stream/ReferencePipeline;->lambda$count$2(Ljava/lang/Object;)J
 HSPLjava/util/stream/ReferencePipeline;->makeNodeBuilder(JLjava/util/function/IntFunction;)Ljava/util/stream/Node$Builder;
 HSPLjava/util/stream/ReferencePipeline;->map(Ljava/util/function/Function;)Ljava/util/stream/Stream;
 HSPLjava/util/stream/ReferencePipeline;->mapToDouble(Ljava/util/function/ToDoubleFunction;)Ljava/util/stream/DoubleStream;
@@ -8027,7 +7851,6 @@
 HSPLjava/util/zip/Deflater;->deflate([BIII)I
 HSPLjava/util/zip/Deflater;->end()V
 HSPLjava/util/zip/Deflater;->ensureOpen()V
-HSPLjava/util/zip/Deflater;->finalize()V
 HSPLjava/util/zip/Deflater;->finish()V
 HSPLjava/util/zip/Deflater;->finished()Z
 HSPLjava/util/zip/Deflater;->getBytesRead()J
@@ -8068,9 +7891,7 @@
 HSPLjava/util/zip/Inflater;-><init>()V
 HSPLjava/util/zip/Inflater;-><init>(Z)V
 HSPLjava/util/zip/Inflater;->end()V
-HSPLjava/util/zip/Inflater;->ended()Z
 HSPLjava/util/zip/Inflater;->ensureOpen()V
-HSPLjava/util/zip/Inflater;->finalize()V
 HSPLjava/util/zip/Inflater;->finished()Z
 HSPLjava/util/zip/Inflater;->getBytesRead()J
 HSPLjava/util/zip/Inflater;->getBytesWritten()J
@@ -8093,10 +7914,10 @@
 HSPLjava/util/zip/ZStreamRef;->address()J
 HSPLjava/util/zip/ZStreamRef;->clear()V
 HSPLjava/util/zip/ZipCoder;-><init>(Ljava/nio/charset/Charset;)V
-HSPLjava/util/zip/ZipCoder;->decoder()Ljava/nio/charset/CharsetDecoder;+]Ljava/nio/charset/Charset;Lcom/android/icu/charset/CharsetICU;]Ljava/nio/charset/CharsetDecoder;Lcom/android/icu/charset/CharsetDecoderICU;
+HSPLjava/util/zip/ZipCoder;->decoder()Ljava/nio/charset/CharsetDecoder;
 HSPLjava/util/zip/ZipCoder;->encoder()Ljava/nio/charset/CharsetEncoder;
 HSPLjava/util/zip/ZipCoder;->get(Ljava/nio/charset/Charset;)Ljava/util/zip/ZipCoder;
-HSPLjava/util/zip/ZipCoder;->getBytes(Ljava/lang/String;)[B+]Ljava/lang/String;Ljava/lang/String;]Ljava/nio/ByteBuffer;Ljava/nio/HeapByteBuffer;]Ljava/nio/charset/CharsetEncoder;Lcom/android/icu/charset/CharsetEncoderICU;]Ljava/nio/charset/CoderResult;Ljava/nio/charset/CoderResult;
+HSPLjava/util/zip/ZipCoder;->getBytes(Ljava/lang/String;)[B
 HSPLjava/util/zip/ZipCoder;->isUTF8()Z
 HSPLjava/util/zip/ZipCoder;->toString([BI)Ljava/lang/String;+]Ljava/nio/CharBuffer;Ljava/nio/HeapCharBuffer;]Ljava/nio/charset/CoderResult;Ljava/nio/charset/CoderResult;]Ljava/nio/charset/CharsetDecoder;Lcom/android/icu/charset/CharsetDecoderICU;
 HSPLjava/util/zip/ZipEntry;-><init>()V
@@ -8108,22 +7929,16 @@
 HSPLjava/util/zip/ZipEntry;->getName()Ljava/lang/String;
 HSPLjava/util/zip/ZipEntry;->getSize()J
 HSPLjava/util/zip/ZipEntry;->isDirectory()Z
-HSPLjava/util/zip/ZipEntry;->setExtra0([BZ)V
-HSPLjava/util/zip/ZipFile$ZipEntryIterator;-><init>(Ljava/util/zip/ZipFile;)V
 HSPLjava/util/zip/ZipFile$ZipEntryIterator;->hasMoreElements()Z
 HSPLjava/util/zip/ZipFile$ZipEntryIterator;->hasNext()Z
 HSPLjava/util/zip/ZipFile$ZipEntryIterator;->next()Ljava/util/zip/ZipEntry;
 HSPLjava/util/zip/ZipFile$ZipEntryIterator;->nextElement()Ljava/lang/Object;
 HSPLjava/util/zip/ZipFile$ZipEntryIterator;->nextElement()Ljava/util/zip/ZipEntry;
-HSPLjava/util/zip/ZipFile$ZipFileInflaterInputStream;-><init>(Ljava/util/zip/ZipFile;Ljava/util/zip/ZipFile$ZipFileInputStream;Ljava/util/zip/Inflater;I)V
 HSPLjava/util/zip/ZipFile$ZipFileInflaterInputStream;->available()I
 HSPLjava/util/zip/ZipFile$ZipFileInflaterInputStream;->close()V
 HSPLjava/util/zip/ZipFile$ZipFileInflaterInputStream;->fill()V
-HSPLjava/util/zip/ZipFile$ZipFileInflaterInputStream;->finalize()V
-HSPLjava/util/zip/ZipFile$ZipFileInputStream;-><init>(Ljava/util/zip/ZipFile;J)V
 HSPLjava/util/zip/ZipFile$ZipFileInputStream;->available()I
 HSPLjava/util/zip/ZipFile$ZipFileInputStream;->close()V
-HSPLjava/util/zip/ZipFile$ZipFileInputStream;->finalize()V
 HSPLjava/util/zip/ZipFile$ZipFileInputStream;->read()I
 HSPLjava/util/zip/ZipFile$ZipFileInputStream;->read([BII)I
 HSPLjava/util/zip/ZipFile$ZipFileInputStream;->size()J
@@ -8131,18 +7946,14 @@
 HSPLjava/util/zip/ZipFile;-><init>(Ljava/io/File;)V
 HSPLjava/util/zip/ZipFile;-><init>(Ljava/io/File;I)V
 HSPLjava/util/zip/ZipFile;-><init>(Ljava/io/File;ILjava/nio/charset/Charset;)V
+HSPLjava/util/zip/ZipFile;-><init>(Ljava/io/File;ILjava/nio/charset/Charset;Z)V
 HSPLjava/util/zip/ZipFile;-><init>(Ljava/lang/String;)V
 HSPLjava/util/zip/ZipFile;->close()V
 HSPLjava/util/zip/ZipFile;->ensureOpen()V
 HSPLjava/util/zip/ZipFile;->ensureOpenOrZipException()V
 HSPLjava/util/zip/ZipFile;->entries()Ljava/util/Enumeration;
-HSPLjava/util/zip/ZipFile;->finalize()V
-HSPLjava/util/zip/ZipFile;->getEntry(Ljava/lang/String;)Ljava/util/zip/ZipEntry;+]Ljava/util/zip/ZipCoder;Ljava/util/zip/ZipCoder;
-HSPLjava/util/zip/ZipFile;->getInflater()Ljava/util/zip/Inflater;
+HSPLjava/util/zip/ZipFile;->getEntry(Ljava/lang/String;)Ljava/util/zip/ZipEntry;
 HSPLjava/util/zip/ZipFile;->getInputStream(Ljava/util/zip/ZipEntry;)Ljava/io/InputStream;
-HSPLjava/util/zip/ZipFile;->getZipEntry(Ljava/lang/String;J)Ljava/util/zip/ZipEntry;
-HSPLjava/util/zip/ZipFile;->onZipEntryAccess([BI)V+]Ldalvik/system/ZipPathValidator$Callback;Ldalvik/system/ZipPathValidator$1;]Ljava/util/zip/ZipCoder;Ljava/util/zip/ZipCoder;
-HSPLjava/util/zip/ZipFile;->releaseInflater(Ljava/util/zip/Inflater;)V
 HSPLjava/util/zip/ZipInputStream;-><init>(Ljava/io/InputStream;)V
 HSPLjava/util/zip/ZipInputStream;-><init>(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
 HSPLjava/util/zip/ZipInputStream;->close()V
@@ -8389,7 +8200,7 @@
 HSPLjdk/internal/math/FloatingDecimal$1;->initialValue()Ljava/lang/Object;
 HSPLjdk/internal/math/FloatingDecimal$1;->initialValue()Ljdk/internal/math/FloatingDecimal$BinaryToASCIIBuffer;
 HSPLjdk/internal/math/FloatingDecimal$ASCIIToBinaryBuffer;-><init>(ZI[CI)V
-HSPLjdk/internal/math/FloatingDecimal$ASCIIToBinaryBuffer;->doubleValue()D+]Ljdk/internal/math/FDBigInteger;Ljdk/internal/math/FDBigInteger;
+HSPLjdk/internal/math/FloatingDecimal$ASCIIToBinaryBuffer;->doubleValue()D
 HSPLjdk/internal/math/FloatingDecimal$ASCIIToBinaryBuffer;->floatValue()F
 HSPLjdk/internal/math/FloatingDecimal$BinaryToASCIIBuffer;->-$$Nest$mdtoa(Ljdk/internal/math/FloatingDecimal$BinaryToASCIIBuffer;IJIZ)V
 HSPLjdk/internal/math/FloatingDecimal$BinaryToASCIIBuffer;->-$$Nest$msetSign(Ljdk/internal/math/FloatingDecimal$BinaryToASCIIBuffer;Z)V
@@ -8415,7 +8226,7 @@
 HSPLjdk/internal/math/FloatingDecimal;->getBinaryToASCIIConverter(F)Ljdk/internal/math/FloatingDecimal$BinaryToASCIIConverter;
 HSPLjdk/internal/math/FloatingDecimal;->parseDouble(Ljava/lang/String;)D
 HSPLjdk/internal/math/FloatingDecimal;->parseFloat(Ljava/lang/String;)F
-HSPLjdk/internal/math/FloatingDecimal;->readJavaFormatString(Ljava/lang/String;)Ljdk/internal/math/FloatingDecimal$ASCIIToBinaryConverter;+]Ljava/lang/String;Ljava/lang/String;]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
+HSPLjdk/internal/math/FloatingDecimal;->readJavaFormatString(Ljava/lang/String;)Ljdk/internal/math/FloatingDecimal$ASCIIToBinaryConverter;
 HSPLjdk/internal/math/FloatingDecimal;->toJavaFormatString(D)Ljava/lang/String;
 HSPLjdk/internal/math/FloatingDecimal;->toJavaFormatString(F)Ljava/lang/String;
 HSPLjdk/internal/math/FormattedFloatingDecimal$1;-><init>()V
@@ -8437,7 +8248,7 @@
 HSPLjdk/internal/misc/Unsafe;->compareAndSetObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z
 HSPLjdk/internal/misc/Unsafe;->getAndAddInt(Ljava/lang/Object;JI)I
 HSPLjdk/internal/misc/Unsafe;->getAndAddLong(Ljava/lang/Object;JJ)J
-HSPLjdk/internal/misc/Unsafe;->getAndBitwiseAndInt(Ljava/lang/Object;JI)I+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
+HSPLjdk/internal/misc/Unsafe;->getAndBitwiseAndInt(Ljava/lang/Object;JI)I
 HSPLjdk/internal/misc/Unsafe;->getAndSetInt(Ljava/lang/Object;JI)I
 HSPLjdk/internal/misc/Unsafe;->getAndSetLong(Ljava/lang/Object;JJ)J
 HSPLjdk/internal/misc/Unsafe;->getAndSetObject(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;
@@ -8448,7 +8259,7 @@
 HSPLjdk/internal/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object;
 HSPLjdk/internal/misc/Unsafe;->getObjectAcquire(Ljava/lang/Object;J)Ljava/lang/Object;
 HSPLjdk/internal/misc/Unsafe;->getObjectVolatile(Ljava/lang/Object;J)Ljava/lang/Object;
-HSPLjdk/internal/misc/Unsafe;->getReferenceAcquire(Ljava/lang/Object;J)Ljava/lang/Object;+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
+HSPLjdk/internal/misc/Unsafe;->getReferenceAcquire(Ljava/lang/Object;J)Ljava/lang/Object;
 HSPLjdk/internal/misc/Unsafe;->getUnsafe()Ljdk/internal/misc/Unsafe;
 HSPLjdk/internal/misc/Unsafe;->makeLong(II)J
 HSPLjdk/internal/misc/Unsafe;->objectFieldOffset(Ljava/lang/Class;Ljava/lang/String;)J
@@ -8460,11 +8271,11 @@
 HSPLjdk/internal/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V
 HSPLjdk/internal/misc/Unsafe;->putObjectRelease(Ljava/lang/Object;JLjava/lang/Object;)V
 HSPLjdk/internal/misc/Unsafe;->putObjectVolatile(Ljava/lang/Object;JLjava/lang/Object;)V
-HSPLjdk/internal/misc/Unsafe;->putReferenceOpaque(Ljava/lang/Object;JLjava/lang/Object;)V+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
-HSPLjdk/internal/misc/Unsafe;->putReferenceRelease(Ljava/lang/Object;JLjava/lang/Object;)V+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
+HSPLjdk/internal/misc/Unsafe;->putReferenceOpaque(Ljava/lang/Object;JLjava/lang/Object;)V
+HSPLjdk/internal/misc/Unsafe;->putReferenceRelease(Ljava/lang/Object;JLjava/lang/Object;)V
 HSPLjdk/internal/misc/Unsafe;->toUnsignedLong(I)J
 HSPLjdk/internal/misc/Unsafe;->weakCompareAndSetInt(Ljava/lang/Object;JII)Z
-HSPLjdk/internal/misc/Unsafe;->weakCompareAndSetReference(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
+HSPLjdk/internal/misc/Unsafe;->weakCompareAndSetReference(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z
 HSPLjdk/internal/misc/VM;->getSavedProperty(Ljava/lang/String;)Ljava/lang/String;
 HSPLjdk/internal/reflect/Reflection;->getCallerClass()Ljava/lang/Class;
 HSPLjdk/internal/util/ArraysSupport;->mismatch([B[BI)I
@@ -8472,7 +8283,8 @@
 HSPLjdk/internal/util/ArraysSupport;->mismatch([I[II)I
 HSPLjdk/internal/util/ArraysSupport;->mismatch([J[JI)I
 HSPLjdk/internal/util/ArraysSupport;->mismatch([Z[ZI)I
-HSPLjdk/internal/util/ArraysSupport;->vectorizedMismatch(Ljava/lang/Object;JLjava/lang/Object;JII)I+]Ljdk/internal/misc/Unsafe;Ljdk/internal/misc/Unsafe;
+HSPLjdk/internal/util/ArraysSupport;->newLength(III)I
+HSPLjdk/internal/util/ArraysSupport;->vectorizedMismatch(Ljava/lang/Object;JLjava/lang/Object;JII)I
 HSPLjdk/internal/util/Preconditions;->checkFromIndexSize(IIILjava/util/function/BiFunction;)I
 HSPLjdk/internal/util/Preconditions;->checkIndex(IILjava/util/function/BiFunction;)I
 HSPLlibcore/content/type/MimeMap$Builder$Element;-><init>(Ljava/lang/String;Z)V
@@ -8499,7 +8311,6 @@
 HSPLlibcore/icu/DecimalFormatData;->getInstance(Ljava/util/Locale;)Llibcore/icu/DecimalFormatData;
 HSPLlibcore/icu/DecimalFormatData;->getMinusSign()Ljava/lang/String;
 HSPLlibcore/icu/DecimalFormatData;->getMonetaryGroupSeparator()Ljava/lang/String;
-HSPLlibcore/icu/DecimalFormatData;->getMonetarySeparator()Ljava/lang/String;
 HSPLlibcore/icu/DecimalFormatData;->getNaN()Ljava/lang/String;
 HSPLlibcore/icu/DecimalFormatData;->getNumberPattern()Ljava/lang/String;
 HSPLlibcore/icu/DecimalFormatData;->getPatternSeparator()C
@@ -8520,7 +8331,7 @@
 HSPLlibcore/icu/ICU;->transformIcuDateTimePattern(Ljava/lang/String;)Ljava/lang/String;
 HSPLlibcore/icu/ICU;->transformIcuDateTimePattern_forJavaText(Ljava/lang/String;)Ljava/lang/String;
 HSPLlibcore/icu/LocaleData;->get(Ljava/util/Locale;)Llibcore/icu/LocaleData;
-HSPLlibcore/icu/LocaleData;->getCompatibleLocaleForBug159514442(Ljava/util/Locale;)Ljava/util/Locale;+]Ldalvik/system/VMRuntime;Ldalvik/system/VMRuntime;]Ljava/util/Locale;Ljava/util/Locale;
+HSPLlibcore/icu/LocaleData;->getCompatibleLocaleForBug159514442(Ljava/util/Locale;)Ljava/util/Locale;
 HSPLlibcore/icu/LocaleData;->initLocaleData(Ljava/util/Locale;)Llibcore/icu/LocaleData;
 HSPLlibcore/icu/LocaleData;->initializeCalendarData(Ljava/util/Locale;)V
 HSPLlibcore/icu/LocaleData;->initializeDateFormatData(Ljava/util/Locale;)V
@@ -8532,7 +8343,7 @@
 HSPLlibcore/internal/StringPool;->contentEquals(Ljava/lang/String;[CII)Z
 HSPLlibcore/internal/StringPool;->get([CII)Ljava/lang/String;
 HSPLlibcore/io/BlockGuardOs;->accept(Ljava/io/FileDescriptor;Ljava/net/SocketAddress;)Ljava/io/FileDescriptor;
-HSPLlibcore/io/BlockGuardOs;->access(Ljava/lang/String;I)Z+]Ldalvik/system/BlockGuard$VmPolicy;Ldalvik/system/BlockGuard$2;,Landroid/os/StrictMode$5;]Ldalvik/system/BlockGuard$Policy;Ldalvik/system/BlockGuard$1;,Landroid/os/StrictMode$AndroidBlockGuardPolicy;
+HSPLlibcore/io/BlockGuardOs;->access(Ljava/lang/String;I)Z
 HSPLlibcore/io/BlockGuardOs;->android_getaddrinfo(Ljava/lang/String;Landroid/system/StructAddrinfo;I)[Ljava/net/InetAddress;
 HSPLlibcore/io/BlockGuardOs;->chmod(Ljava/lang/String;I)V
 HSPLlibcore/io/BlockGuardOs;->close(Ljava/io/FileDescriptor;)V
@@ -8555,7 +8366,7 @@
 HSPLlibcore/io/BlockGuardOs;->poll([Landroid/system/StructPollfd;I)I
 HSPLlibcore/io/BlockGuardOs;->posix_fallocate(Ljava/io/FileDescriptor;JJ)V
 HSPLlibcore/io/BlockGuardOs;->pread(Ljava/io/FileDescriptor;[BIIJ)I
-HSPLlibcore/io/BlockGuardOs;->read(Ljava/io/FileDescriptor;[BII)I+]Ldalvik/system/BlockGuard$Policy;Ldalvik/system/BlockGuard$1;,Landroid/os/StrictMode$AndroidBlockGuardPolicy;
+HSPLlibcore/io/BlockGuardOs;->read(Ljava/io/FileDescriptor;[BII)I
 HSPLlibcore/io/BlockGuardOs;->readlink(Ljava/lang/String;)Ljava/lang/String;
 HSPLlibcore/io/BlockGuardOs;->recvfrom(Ljava/io/FileDescriptor;[BIIILjava/net/InetSocketAddress;)I
 HSPLlibcore/io/BlockGuardOs;->remove(Ljava/lang/String;)V
@@ -8566,19 +8377,19 @@
 HSPLlibcore/io/BlockGuardOs;->stat(Ljava/lang/String;)Landroid/system/StructStat;
 HSPLlibcore/io/BlockGuardOs;->statvfs(Ljava/lang/String;)Landroid/system/StructStatVfs;
 HSPLlibcore/io/BlockGuardOs;->tagSocket(Ljava/io/FileDescriptor;)Ljava/io/FileDescriptor;
-HSPLlibcore/io/BlockGuardOs;->write(Ljava/io/FileDescriptor;[BII)I+]Ldalvik/system/BlockGuard$Policy;Ldalvik/system/BlockGuard$1;,Landroid/os/StrictMode$AndroidBlockGuardPolicy;
+HSPLlibcore/io/BlockGuardOs;->write(Ljava/io/FileDescriptor;[BII)I
 HSPLlibcore/io/ClassPathURLStreamHandler$ClassPathURLConnection$1;-><init>(Llibcore/io/ClassPathURLStreamHandler$ClassPathURLConnection;Ljava/io/InputStream;)V
 HSPLlibcore/io/ClassPathURLStreamHandler$ClassPathURLConnection$1;->close()V
 HSPLlibcore/io/ClassPathURLStreamHandler$ClassPathURLConnection;-><init>(Llibcore/io/ClassPathURLStreamHandler;Ljava/net/URL;)V
 HSPLlibcore/io/ClassPathURLStreamHandler$ClassPathURLConnection;->connect()V
 HSPLlibcore/io/ClassPathURLStreamHandler$ClassPathURLConnection;->getInputStream()Ljava/io/InputStream;
 HSPLlibcore/io/ClassPathURLStreamHandler;-><init>(Ljava/lang/String;)V
-HSPLlibcore/io/ClassPathURLStreamHandler;->getEntryUrlOrNull(Ljava/lang/String;)Ljava/net/URL;+]Ljava/util/jar/JarFile;Ljava/util/jar/JarFile;
+HSPLlibcore/io/ClassPathURLStreamHandler;->getEntryUrlOrNull(Ljava/lang/String;)Ljava/net/URL;
 HSPLlibcore/io/ClassPathURLStreamHandler;->isEntryStored(Ljava/lang/String;)Z
 HSPLlibcore/io/ClassPathURLStreamHandler;->openConnection(Ljava/net/URL;)Ljava/net/URLConnection;
 HSPLlibcore/io/ForwardingOs;-><init>(Llibcore/io/Os;)V
 HSPLlibcore/io/ForwardingOs;->accept(Ljava/io/FileDescriptor;Ljava/net/SocketAddress;)Ljava/io/FileDescriptor;
-HSPLlibcore/io/ForwardingOs;->access(Ljava/lang/String;I)Z+]Llibcore/io/Os;Llibcore/io/BlockGuardOs;,Llibcore/io/Linux;
+HSPLlibcore/io/ForwardingOs;->access(Ljava/lang/String;I)Z
 HSPLlibcore/io/ForwardingOs;->android_fdsan_exchange_owner_tag(Ljava/io/FileDescriptor;JJ)V
 HSPLlibcore/io/ForwardingOs;->android_getaddrinfo(Ljava/lang/String;Landroid/system/StructAddrinfo;I)[Ljava/net/InetAddress;
 HSPLlibcore/io/ForwardingOs;->bind(Ljava/io/FileDescriptor;Ljava/net/InetAddress;I)V
@@ -8599,12 +8410,12 @@
 HSPLlibcore/io/ForwardingOs;->getnameinfo(Ljava/net/InetAddress;I)Ljava/lang/String;
 HSPLlibcore/io/ForwardingOs;->getpeername(Ljava/io/FileDescriptor;)Ljava/net/SocketAddress;
 HSPLlibcore/io/ForwardingOs;->getpgid(I)I
-HSPLlibcore/io/ForwardingOs;->getpid()I+]Llibcore/io/Os;Llibcore/io/BlockGuardOs;,Llibcore/io/Linux;
+HSPLlibcore/io/ForwardingOs;->getpid()I
 HSPLlibcore/io/ForwardingOs;->getsockname(Ljava/io/FileDescriptor;)Ljava/net/SocketAddress;
 HSPLlibcore/io/ForwardingOs;->getsockoptInt(Ljava/io/FileDescriptor;II)I
 HSPLlibcore/io/ForwardingOs;->getsockoptLinger(Ljava/io/FileDescriptor;II)Landroid/system/StructLinger;
-HSPLlibcore/io/ForwardingOs;->gettid()I+]Llibcore/io/Os;Llibcore/io/BlockGuardOs;,Llibcore/io/Linux;
-HSPLlibcore/io/ForwardingOs;->getuid()I+]Llibcore/io/Os;Llibcore/io/BlockGuardOs;,Llibcore/io/Linux;
+HSPLlibcore/io/ForwardingOs;->gettid()I
+HSPLlibcore/io/ForwardingOs;->getuid()I
 HSPLlibcore/io/ForwardingOs;->getxattr(Ljava/lang/String;Ljava/lang/String;)[B
 HSPLlibcore/io/ForwardingOs;->if_nametoindex(Ljava/lang/String;)I
 HSPLlibcore/io/ForwardingOs;->ioctlInt(Ljava/io/FileDescriptor;I)I
@@ -8618,7 +8429,7 @@
 HSPLlibcore/io/ForwardingOs;->poll([Landroid/system/StructPollfd;I)I
 HSPLlibcore/io/ForwardingOs;->posix_fallocate(Ljava/io/FileDescriptor;JJ)V
 HSPLlibcore/io/ForwardingOs;->pread(Ljava/io/FileDescriptor;[BIIJ)I
-HSPLlibcore/io/ForwardingOs;->read(Ljava/io/FileDescriptor;[BII)I+]Llibcore/io/Os;Llibcore/io/BlockGuardOs;,Llibcore/io/Linux;
+HSPLlibcore/io/ForwardingOs;->read(Ljava/io/FileDescriptor;[BII)I
 HSPLlibcore/io/ForwardingOs;->readlink(Ljava/lang/String;)Ljava/lang/String;
 HSPLlibcore/io/ForwardingOs;->recvfrom(Ljava/io/FileDescriptor;[BIIILjava/net/InetSocketAddress;)I
 HSPLlibcore/io/ForwardingOs;->remove(Ljava/lang/String;)V
@@ -8637,7 +8448,7 @@
 HSPLlibcore/io/ForwardingOs;->statvfs(Ljava/lang/String;)Landroid/system/StructStatVfs;
 HSPLlibcore/io/ForwardingOs;->strerror(I)Ljava/lang/String;
 HSPLlibcore/io/ForwardingOs;->sysconf(I)J
-HSPLlibcore/io/ForwardingOs;->write(Ljava/io/FileDescriptor;[BII)I+]Llibcore/io/Os;Llibcore/io/BlockGuardOs;,Llibcore/io/Linux;
+HSPLlibcore/io/ForwardingOs;->write(Ljava/io/FileDescriptor;[BII)I
 HSPLlibcore/io/IoBridge;->bind(Ljava/io/FileDescriptor;Ljava/net/InetAddress;I)V
 HSPLlibcore/io/IoBridge;->booleanFromInt(I)Z
 HSPLlibcore/io/IoBridge;->booleanToInt(Z)I
@@ -8652,17 +8463,17 @@
 HSPLlibcore/io/IoBridge;->open(Ljava/lang/String;I)Ljava/io/FileDescriptor;
 HSPLlibcore/io/IoBridge;->poll(Ljava/io/FileDescriptor;II)V
 HSPLlibcore/io/IoBridge;->postRecvfrom(ZLjava/net/DatagramPacket;Ljava/net/InetSocketAddress;I)I
-HSPLlibcore/io/IoBridge;->read(Ljava/io/FileDescriptor;[BII)I+]Llibcore/io/Os;Landroid/app/ActivityThread$AndroidOs;
+HSPLlibcore/io/IoBridge;->read(Ljava/io/FileDescriptor;[BII)I
 HSPLlibcore/io/IoBridge;->recvfrom(ZLjava/io/FileDescriptor;[BIIILjava/net/DatagramPacket;Z)I
 HSPLlibcore/io/IoBridge;->sendto(Ljava/io/FileDescriptor;[BIIILjava/net/InetAddress;I)I
 HSPLlibcore/io/IoBridge;->setSocketOption(Ljava/io/FileDescriptor;ILjava/lang/Object;)V
 HSPLlibcore/io/IoBridge;->setSocketOptionErrno(Ljava/io/FileDescriptor;ILjava/lang/Object;)V
 HSPLlibcore/io/IoBridge;->socket(III)Ljava/io/FileDescriptor;
-HSPLlibcore/io/IoBridge;->write(Ljava/io/FileDescriptor;[BII)V+]Llibcore/io/Os;Landroid/app/ActivityThread$AndroidOs;
+HSPLlibcore/io/IoBridge;->write(Ljava/io/FileDescriptor;[BII)V
 HSPLlibcore/io/IoTracker;-><init>()V
 HSPLlibcore/io/IoTracker;->reset()V
-HSPLlibcore/io/IoTracker;->trackIo(I)V+]Ldalvik/system/BlockGuard$Policy;Ldalvik/system/BlockGuard$1;,Landroid/os/StrictMode$AndroidBlockGuardPolicy;
-HSPLlibcore/io/IoTracker;->trackIo(ILlibcore/io/IoTracker$Mode;)V+]Llibcore/io/IoTracker;Llibcore/io/IoTracker;
+HSPLlibcore/io/IoTracker;->trackIo(I)V
+HSPLlibcore/io/IoTracker;->trackIo(ILlibcore/io/IoTracker$Mode;)V
 HSPLlibcore/io/IoUtils;->acquireRawFd(Ljava/io/FileDescriptor;)I
 HSPLlibcore/io/IoUtils;->canOpenReadOnly(Ljava/lang/String;)Z
 HSPLlibcore/io/IoUtils;->close(Ljava/io/FileDescriptor;)V
@@ -8708,37 +8519,37 @@
 HSPLlibcore/net/http/HttpURLConnectionFactory;->openConnection(Ljava/net/URL;Ljavax/net/SocketFactory;Ljava/net/Proxy;)Ljava/net/URLConnection;
 HSPLlibcore/net/http/HttpURLConnectionFactory;->setDns(Llibcore/net/http/Dns;)V
 HSPLlibcore/net/http/HttpURLConnectionFactory;->setNewConnectionPool(IJLjava/util/concurrent/TimeUnit;)V
-HSPLlibcore/reflect/AnnotationFactory;-><init>(Ljava/lang/Class;[Llibcore/reflect/AnnotationMember;)V+]Llibcore/reflect/AnnotationMember;Llibcore/reflect/AnnotationMember;
+HSPLlibcore/reflect/AnnotationFactory;-><init>(Ljava/lang/Class;[Llibcore/reflect/AnnotationMember;)V
 HSPLlibcore/reflect/AnnotationFactory;->createAnnotation(Ljava/lang/Class;[Llibcore/reflect/AnnotationMember;)Ljava/lang/annotation/Annotation;
 HSPLlibcore/reflect/AnnotationFactory;->getElementsDescription(Ljava/lang/Class;)[Llibcore/reflect/AnnotationMember;
-HSPLlibcore/reflect/AnnotationFactory;->invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/lang/reflect/Method;Ljava/lang/reflect/Method;]Llibcore/reflect/AnnotationMember;Llibcore/reflect/AnnotationMember;
+HSPLlibcore/reflect/AnnotationFactory;->invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;
 HSPLlibcore/reflect/AnnotationMember;-><init>(Ljava/lang/String;Ljava/lang/Object;)V
 HSPLlibcore/reflect/AnnotationMember;-><init>(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/reflect/Method;)V
 HSPLlibcore/reflect/AnnotationMember;->copyValue()Ljava/lang/Object;
 HSPLlibcore/reflect/AnnotationMember;->setDefinition(Llibcore/reflect/AnnotationMember;)Llibcore/reflect/AnnotationMember;
-HSPLlibcore/reflect/AnnotationMember;->validateValue()Ljava/lang/Object;+]Ljava/lang/Object;missing_types]Llibcore/reflect/AnnotationMember;Llibcore/reflect/AnnotationMember;
+HSPLlibcore/reflect/AnnotationMember;->validateValue()Ljava/lang/Object;
 HSPLlibcore/reflect/GenericArrayTypeImpl;->getGenericComponentType()Ljava/lang/reflect/Type;
 HSPLlibcore/reflect/GenericSignatureParser;-><init>(Ljava/lang/ClassLoader;)V
-HSPLlibcore/reflect/GenericSignatureParser;->expect(C)V+]Llibcore/reflect/GenericSignatureParser;Llibcore/reflect/GenericSignatureParser;
+HSPLlibcore/reflect/GenericSignatureParser;->expect(C)V
 HSPLlibcore/reflect/GenericSignatureParser;->isStopSymbol(C)Z
 HSPLlibcore/reflect/GenericSignatureParser;->parseClassSignature()V
-HSPLlibcore/reflect/GenericSignatureParser;->parseClassTypeSignature()Ljava/lang/reflect/Type;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Llibcore/reflect/GenericSignatureParser;Llibcore/reflect/GenericSignatureParser;
+HSPLlibcore/reflect/GenericSignatureParser;->parseClassTypeSignature()Ljava/lang/reflect/Type;
 HSPLlibcore/reflect/GenericSignatureParser;->parseFieldTypeSignature()Ljava/lang/reflect/Type;
 HSPLlibcore/reflect/GenericSignatureParser;->parseForClass(Ljava/lang/reflect/GenericDeclaration;Ljava/lang/String;)V
 HSPLlibcore/reflect/GenericSignatureParser;->parseForConstructor(Ljava/lang/reflect/GenericDeclaration;Ljava/lang/String;[Ljava/lang/Class;)V
-HSPLlibcore/reflect/GenericSignatureParser;->parseForField(Ljava/lang/reflect/GenericDeclaration;Ljava/lang/String;)V+]Llibcore/reflect/GenericSignatureParser;Llibcore/reflect/GenericSignatureParser;
+HSPLlibcore/reflect/GenericSignatureParser;->parseForField(Ljava/lang/reflect/GenericDeclaration;Ljava/lang/String;)V
 HSPLlibcore/reflect/GenericSignatureParser;->parseForMethod(Ljava/lang/reflect/GenericDeclaration;Ljava/lang/String;[Ljava/lang/Class;)V
 HSPLlibcore/reflect/GenericSignatureParser;->parseFormalTypeParameter()Llibcore/reflect/TypeVariableImpl;
 HSPLlibcore/reflect/GenericSignatureParser;->parseMethodTypeSignature([Ljava/lang/Class;)V
 HSPLlibcore/reflect/GenericSignatureParser;->parseOptFormalTypeParameters()V
-HSPLlibcore/reflect/GenericSignatureParser;->parseOptTypeArguments()Llibcore/reflect/ListOfTypes;+]Llibcore/reflect/ListOfTypes;Llibcore/reflect/ListOfTypes;]Llibcore/reflect/GenericSignatureParser;Llibcore/reflect/GenericSignatureParser;
+HSPLlibcore/reflect/GenericSignatureParser;->parseOptTypeArguments()Llibcore/reflect/ListOfTypes;
 HSPLlibcore/reflect/GenericSignatureParser;->parseReturnType()Ljava/lang/reflect/Type;
 HSPLlibcore/reflect/GenericSignatureParser;->parseTypeArgument()Ljava/lang/reflect/Type;
 HSPLlibcore/reflect/GenericSignatureParser;->parseTypeSignature()Ljava/lang/reflect/Type;
 HSPLlibcore/reflect/GenericSignatureParser;->parseTypeVariableSignature()Llibcore/reflect/TypeVariableImpl;
-HSPLlibcore/reflect/GenericSignatureParser;->scanIdentifier()V+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Llibcore/reflect/GenericSignatureParser;Llibcore/reflect/GenericSignatureParser;
+HSPLlibcore/reflect/GenericSignatureParser;->scanIdentifier()V
 HSPLlibcore/reflect/GenericSignatureParser;->scanSymbol()V
-HSPLlibcore/reflect/GenericSignatureParser;->setInput(Ljava/lang/reflect/GenericDeclaration;Ljava/lang/String;)V+]Ljava/lang/String;Ljava/lang/String;]Llibcore/reflect/GenericSignatureParser;Llibcore/reflect/GenericSignatureParser;
+HSPLlibcore/reflect/GenericSignatureParser;->setInput(Ljava/lang/reflect/GenericDeclaration;Ljava/lang/String;)V
 HSPLlibcore/reflect/ListOfTypes;-><init>(I)V
 HSPLlibcore/reflect/ListOfTypes;-><init>([Ljava/lang/reflect/Type;)V
 HSPLlibcore/reflect/ListOfTypes;->add(Ljava/lang/reflect/Type;)V
@@ -8753,7 +8564,7 @@
 HSPLlibcore/reflect/ParameterizedTypeImpl;->getActualTypeArguments()[Ljava/lang/reflect/Type;
 HSPLlibcore/reflect/ParameterizedTypeImpl;->getOwnerType()Ljava/lang/reflect/Type;
 HSPLlibcore/reflect/ParameterizedTypeImpl;->getRawType()Ljava/lang/Class;
-HSPLlibcore/reflect/ParameterizedTypeImpl;->getRawType()Ljava/lang/reflect/Type;+]Llibcore/reflect/ParameterizedTypeImpl;Llibcore/reflect/ParameterizedTypeImpl;
+HSPLlibcore/reflect/ParameterizedTypeImpl;->getRawType()Ljava/lang/reflect/Type;
 HSPLlibcore/reflect/ParameterizedTypeImpl;->getResolvedType()Ljava/lang/reflect/Type;
 HSPLlibcore/reflect/TypeVariableImpl;-><init>(Ljava/lang/reflect/GenericDeclaration;Ljava/lang/String;)V
 HSPLlibcore/reflect/TypeVariableImpl;-><init>(Ljava/lang/reflect/GenericDeclaration;Ljava/lang/String;Llibcore/reflect/ListOfTypes;)V
@@ -8801,19 +8612,19 @@
 HSPLlibcore/util/NativeAllocationRegistry;->createMalloced(Ljava/lang/ClassLoader;J)Llibcore/util/NativeAllocationRegistry;
 HSPLlibcore/util/NativeAllocationRegistry;->createMalloced(Ljava/lang/ClassLoader;JJ)Llibcore/util/NativeAllocationRegistry;
 HSPLlibcore/util/NativeAllocationRegistry;->createNonmalloced(Ljava/lang/ClassLoader;JJ)Llibcore/util/NativeAllocationRegistry;
-HSPLlibcore/util/NativeAllocationRegistry;->registerNativeAllocation(J)V+]Ldalvik/system/VMRuntime;Ldalvik/system/VMRuntime;
-HSPLlibcore/util/NativeAllocationRegistry;->registerNativeAllocation(Ljava/lang/Object;J)Ljava/lang/Runnable;+]Llibcore/util/NativeAllocationRegistry$CleanerThunk;Llibcore/util/NativeAllocationRegistry$CleanerThunk;
-HSPLlibcore/util/NativeAllocationRegistry;->registerNativeFree(J)V+]Ldalvik/system/VMRuntime;Ldalvik/system/VMRuntime;
+HSPLlibcore/util/NativeAllocationRegistry;->registerNativeAllocation(J)V
+HSPLlibcore/util/NativeAllocationRegistry;->registerNativeAllocation(Ljava/lang/Object;J)Ljava/lang/Runnable;
+HSPLlibcore/util/NativeAllocationRegistry;->registerNativeFree(J)V
 HSPLlibcore/util/SneakyThrow;->sneakyThrow(Ljava/lang/Throwable;)V
 HSPLlibcore/util/SneakyThrow;->sneakyThrow_(Ljava/lang/Throwable;)V
 HSPLlibcore/util/XmlObjectFactory;->newXmlPullParser()Lorg/xmlpull/v1/XmlPullParser;
-HSPLlibcore/util/ZoneInfo;-><init>(Lcom/android/i18n/timezone/ZoneInfoData;IZ)V+]Lcom/android/i18n/timezone/ZoneInfoData;Lcom/android/i18n/timezone/ZoneInfoData;]Llibcore/util/ZoneInfo;Llibcore/util/ZoneInfo;
+HSPLlibcore/util/ZoneInfo;-><init>(Lcom/android/i18n/timezone/ZoneInfoData;IZ)V
 HSPLlibcore/util/ZoneInfo;->clone()Ljava/lang/Object;
 HSPLlibcore/util/ZoneInfo;->createZoneInfo(Lcom/android/i18n/timezone/ZoneInfoData;)Llibcore/util/ZoneInfo;
 HSPLlibcore/util/ZoneInfo;->createZoneInfo(Lcom/android/i18n/timezone/ZoneInfoData;J)Llibcore/util/ZoneInfo;
 HSPLlibcore/util/ZoneInfo;->getDSTSavings()I
 HSPLlibcore/util/ZoneInfo;->getOffset(J)I
-HSPLlibcore/util/ZoneInfo;->getOffsetsByUtcTime(J[I)I+]Lcom/android/i18n/timezone/ZoneInfoData;Lcom/android/i18n/timezone/ZoneInfoData;
+HSPLlibcore/util/ZoneInfo;->getOffsetsByUtcTime(J[I)I
 HSPLlibcore/util/ZoneInfo;->getRawOffset()I
 HSPLlibcore/util/ZoneInfo;->hasSameRules(Ljava/util/TimeZone;)Z
 HSPLlibcore/util/ZoneInfo;->hashCode()I
@@ -8974,17 +8785,17 @@
 HSPLorg/json/JSONStringer;->newline()V
 HSPLorg/json/JSONStringer;->object()Lorg/json/JSONStringer;
 HSPLorg/json/JSONStringer;->open(Lorg/json/JSONStringer$Scope;Ljava/lang/String;)Lorg/json/JSONStringer;
-HSPLorg/json/JSONStringer;->peek()Lorg/json/JSONStringer$Scope;+]Ljava/util/List;Ljava/util/ArrayList;
-HSPLorg/json/JSONStringer;->replaceTop(Lorg/json/JSONStringer$Scope;)V+]Ljava/util/List;Ljava/util/ArrayList;
-HSPLorg/json/JSONStringer;->string(Ljava/lang/String;)V+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;
+HSPLorg/json/JSONStringer;->peek()Lorg/json/JSONStringer$Scope;
+HSPLorg/json/JSONStringer;->replaceTop(Lorg/json/JSONStringer$Scope;)V
+HSPLorg/json/JSONStringer;->string(Ljava/lang/String;)V
 HSPLorg/json/JSONStringer;->toString()Ljava/lang/String;
 HSPLorg/json/JSONStringer;->value(Ljava/lang/Object;)Lorg/json/JSONStringer;
 HSPLorg/json/JSONTokener;-><init>(Ljava/lang/String;)V
 HSPLorg/json/JSONTokener;->nextCleanInternal()I
-HSPLorg/json/JSONTokener;->nextString(C)Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/lang/String;Ljava/lang/String;
-HSPLorg/json/JSONTokener;->nextToInternal(Ljava/lang/String;)Ljava/lang/String;+]Ljava/lang/String;Ljava/lang/String;
-HSPLorg/json/JSONTokener;->nextValue()Ljava/lang/Object;+]Lorg/json/JSONTokener;Lorg/json/JSONTokener;
-HSPLorg/json/JSONTokener;->readArray()Lorg/json/JSONArray;+]Lorg/json/JSONTokener;Lorg/json/JSONTokener;]Lorg/json/JSONArray;Lorg/json/JSONArray;
+HSPLorg/json/JSONTokener;->nextString(C)Ljava/lang/String;
+HSPLorg/json/JSONTokener;->nextToInternal(Ljava/lang/String;)Ljava/lang/String;
+HSPLorg/json/JSONTokener;->nextValue()Ljava/lang/Object;
+HSPLorg/json/JSONTokener;->readArray()Lorg/json/JSONArray;
 HSPLorg/json/JSONTokener;->readEscapeCharacter()C
 HSPLorg/json/JSONTokener;->readLiteral()Ljava/lang/Object;
 HSPLorg/json/JSONTokener;->readObject()Lorg/json/JSONObject;
@@ -9024,14 +8835,15 @@
 HSPLsun/misc/ASCIICaseInsensitiveComparator;->toLower(I)I
 HSPLsun/misc/Cleaner;-><init>(Ljava/lang/Object;Ljava/lang/Runnable;)V
 HSPLsun/misc/Cleaner;->add(Lsun/misc/Cleaner;)Lsun/misc/Cleaner;
-HSPLsun/misc/Cleaner;->clean()V+]Ljava/lang/Runnable;Landroid/graphics/HardwareRenderer$DestroyContextRunnable;,Llibcore/util/NativeAllocationRegistry$CleanerThunk;
+HSPLsun/misc/Cleaner;->clean()V
 HSPLsun/misc/Cleaner;->create(Ljava/lang/Object;Ljava/lang/Runnable;)Lsun/misc/Cleaner;
+HSPLsun/misc/Cleaner;->isCleanerQueue(Ljava/lang/ref/ReferenceQueue;)Z
 HSPLsun/misc/Cleaner;->remove(Lsun/misc/Cleaner;)Z
 HSPLsun/misc/CompoundEnumeration;-><init>([Ljava/util/Enumeration;)V
 HSPLsun/misc/CompoundEnumeration;->hasMoreElements()Z
 HSPLsun/misc/CompoundEnumeration;->next()Z
 HSPLsun/misc/CompoundEnumeration;->nextElement()Ljava/lang/Object;
-HSPLsun/misc/IOUtils;->readFully(Ljava/io/InputStream;IZ)[B+]Ljava/io/InputStream;Lsun/security/util/DerInputBuffer;,Ljava/io/ByteArrayInputStream;
+HSPLsun/misc/IOUtils;->readFully(Ljava/io/InputStream;IZ)[B
 HSPLsun/misc/LRUCache;-><init>(I)V
 HSPLsun/misc/LRUCache;->forName(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLsun/misc/LRUCache;->moveToFront([Ljava/lang/Object;I)V
@@ -9252,11 +9064,11 @@
 HSPLsun/nio/cs/StreamEncoder;->implClose()V
 HSPLsun/nio/cs/StreamEncoder;->implFlush()V
 HSPLsun/nio/cs/StreamEncoder;->implFlushBuffer()V
-HSPLsun/nio/cs/StreamEncoder;->implWrite([CII)V+]Ljava/nio/CharBuffer;Ljava/nio/HeapCharBuffer;]Ljava/nio/charset/CharsetEncoder;Lcom/android/icu/charset/CharsetEncoderICU;]Ljava/nio/charset/CoderResult;Ljava/nio/charset/CoderResult;
+HSPLsun/nio/cs/StreamEncoder;->implWrite([CII)V
 HSPLsun/nio/cs/StreamEncoder;->write(I)V
 HSPLsun/nio/cs/StreamEncoder;->write(Ljava/lang/String;II)V
 HSPLsun/nio/cs/StreamEncoder;->write([CII)V
-HSPLsun/nio/cs/StreamEncoder;->writeBytes()V+]Ljava/nio/ByteBuffer;Ljava/nio/HeapByteBuffer;]Ljava/io/OutputStream;Ljava/util/logging/FileHandler$MeteredStream;,Ljava/io/FileOutputStream;
+HSPLsun/nio/cs/StreamEncoder;->writeBytes()V
 HSPLsun/nio/cs/ThreadLocalCoders$1;->create(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLsun/nio/cs/ThreadLocalCoders$1;->hasName(Ljava/lang/Object;Ljava/lang/Object;)Z
 HSPLsun/nio/cs/ThreadLocalCoders$2;->create(Ljava/lang/Object;)Ljava/lang/Object;
@@ -9397,11 +9209,11 @@
 HSPLsun/security/jca/GetInstance$Instance;-><init>(Ljava/security/Provider;Ljava/lang/Object;Lsun/security/jca/GetInstance$Instance-IA;)V
 HSPLsun/security/jca/GetInstance$Instance;->toArray()[Ljava/lang/Object;
 HSPLsun/security/jca/GetInstance;->checkSuperClass(Ljava/security/Provider$Service;Ljava/lang/Class;Ljava/lang/Class;)V
-HSPLsun/security/jca/GetInstance;->getInstance(Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;)Lsun/security/jca/GetInstance$Instance;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Lsun/security/jca/ProviderList;Lsun/security/jca/ProviderList;
+HSPLsun/security/jca/GetInstance;->getInstance(Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;)Lsun/security/jca/GetInstance$Instance;
 HSPLsun/security/jca/GetInstance;->getInstance(Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)Lsun/security/jca/GetInstance$Instance;
 HSPLsun/security/jca/GetInstance;->getInstance(Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)Lsun/security/jca/GetInstance$Instance;
 HSPLsun/security/jca/GetInstance;->getInstance(Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;Ljava/security/Provider;)Lsun/security/jca/GetInstance$Instance;
-HSPLsun/security/jca/GetInstance;->getInstance(Ljava/security/Provider$Service;Ljava/lang/Class;)Lsun/security/jca/GetInstance$Instance;+]Ljava/security/Provider$Service;Ljava/security/Provider$Service;
+HSPLsun/security/jca/GetInstance;->getInstance(Ljava/security/Provider$Service;Ljava/lang/Class;)Lsun/security/jca/GetInstance$Instance;
 HSPLsun/security/jca/GetInstance;->getInstance(Ljava/security/Provider$Service;Ljava/lang/Class;Ljava/lang/Object;)Lsun/security/jca/GetInstance$Instance;
 HSPLsun/security/jca/GetInstance;->getService(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/security/Provider$Service;
 HSPLsun/security/jca/GetInstance;->getService(Ljava/lang/String;Ljava/lang/String;Ljava/security/Provider;)Ljava/security/Provider$Service;
@@ -9433,7 +9245,7 @@
 HSPLsun/security/jca/ProviderList;->getProvider(I)Ljava/security/Provider;
 HSPLsun/security/jca/ProviderList;->getProvider(Ljava/lang/String;)Ljava/security/Provider;
 HSPLsun/security/jca/ProviderList;->getProviderConfig(Ljava/lang/String;)Lsun/security/jca/ProviderConfig;
-HSPLsun/security/jca/ProviderList;->getService(Ljava/lang/String;Ljava/lang/String;)Ljava/security/Provider$Service;+]Lsun/security/jca/ProviderList;Lsun/security/jca/ProviderList;]Ljava/security/Provider;missing_types
+HSPLsun/security/jca/ProviderList;->getService(Ljava/lang/String;Ljava/lang/String;)Ljava/security/Provider$Service;
 HSPLsun/security/jca/ProviderList;->getServices(Ljava/lang/String;Ljava/lang/String;)Ljava/util/List;
 HSPLsun/security/jca/ProviderList;->insertAt(Lsun/security/jca/ProviderList;Ljava/security/Provider;I)Lsun/security/jca/ProviderList;
 HSPLsun/security/jca/ProviderList;->loadAll()I
@@ -9567,7 +9379,7 @@
 HSPLsun/security/provider/certpath/PolicyChecker;->processParents(IZZLsun/security/provider/certpath/PolicyNodeImpl;Ljava/lang/String;Ljava/util/Set;Z)Z
 HSPLsun/security/provider/certpath/PolicyChecker;->processPolicies(ILjava/util/Set;IIIZLsun/security/provider/certpath/PolicyNodeImpl;Lsun/security/x509/X509CertImpl;Z)Lsun/security/provider/certpath/PolicyNodeImpl;
 HSPLsun/security/provider/certpath/PolicyChecker;->processPolicyMappings(Lsun/security/x509/X509CertImpl;IILsun/security/provider/certpath/PolicyNodeImpl;ZLjava/util/Set;)Lsun/security/provider/certpath/PolicyNodeImpl;
-HSPLsun/security/provider/certpath/PolicyNodeImpl;-><init>(Lsun/security/provider/certpath/PolicyNodeImpl;Ljava/lang/String;Ljava/util/Set;ZLjava/util/Set;Z)V+]Lsun/security/provider/certpath/PolicyNodeImpl;Lsun/security/provider/certpath/PolicyNodeImpl;
+HSPLsun/security/provider/certpath/PolicyNodeImpl;-><init>(Lsun/security/provider/certpath/PolicyNodeImpl;Ljava/lang/String;Ljava/util/Set;ZLjava/util/Set;Z)V
 HSPLsun/security/provider/certpath/PolicyNodeImpl;-><init>(Lsun/security/provider/certpath/PolicyNodeImpl;Lsun/security/provider/certpath/PolicyNodeImpl;)V
 HSPLsun/security/provider/certpath/PolicyNodeImpl;->addChild(Lsun/security/provider/certpath/PolicyNodeImpl;)V
 HSPLsun/security/provider/certpath/PolicyNodeImpl;->copyTree()Lsun/security/provider/certpath/PolicyNodeImpl;
@@ -9621,7 +9433,7 @@
 HSPLsun/security/util/DerIndefLenConverter;->isLongForm(I)Z
 HSPLsun/security/util/DerInputBuffer;-><init>([B)V
 HSPLsun/security/util/DerInputBuffer;-><init>([BII)V
-HSPLsun/security/util/DerInputBuffer;->dup()Lsun/security/util/DerInputBuffer;+]Lsun/security/util/DerInputBuffer;Lsun/security/util/DerInputBuffer;]Ljava/lang/Object;Lsun/security/util/DerInputBuffer;
+HSPLsun/security/util/DerInputBuffer;->dup()Lsun/security/util/DerInputBuffer;
 HSPLsun/security/util/DerInputBuffer;->getBigInteger(IZ)Ljava/math/BigInteger;
 HSPLsun/security/util/DerInputBuffer;->getBitString()[B
 HSPLsun/security/util/DerInputBuffer;->getBitString(I)[B
@@ -9634,34 +9446,34 @@
 HSPLsun/security/util/DerInputBuffer;->getUnalignedBitString()Lsun/security/util/BitArray;
 HSPLsun/security/util/DerInputBuffer;->peek()I
 HSPLsun/security/util/DerInputBuffer;->toByteArray()[B
-HSPLsun/security/util/DerInputBuffer;->truncate(I)V+]Lsun/security/util/DerInputBuffer;Lsun/security/util/DerInputBuffer;
-HSPLsun/security/util/DerInputStream;-><init>(Lsun/security/util/DerInputBuffer;)V+]Lsun/security/util/DerInputBuffer;Lsun/security/util/DerInputBuffer;
+HSPLsun/security/util/DerInputBuffer;->truncate(I)V
+HSPLsun/security/util/DerInputStream;-><init>(Lsun/security/util/DerInputBuffer;)V
 HSPLsun/security/util/DerInputStream;-><init>([B)V
-HSPLsun/security/util/DerInputStream;->available()I+]Lsun/security/util/DerInputBuffer;Lsun/security/util/DerInputBuffer;
+HSPLsun/security/util/DerInputStream;->available()I
 HSPLsun/security/util/DerInputStream;->getBigInteger()Ljava/math/BigInteger;
-HSPLsun/security/util/DerInputStream;->getByte()I+]Lsun/security/util/DerInputBuffer;Lsun/security/util/DerInputBuffer;
+HSPLsun/security/util/DerInputStream;->getByte()I
 HSPLsun/security/util/DerInputStream;->getBytes([B)V
 HSPLsun/security/util/DerInputStream;->getDerValue()Lsun/security/util/DerValue;
 HSPLsun/security/util/DerInputStream;->getEnumerated()I
 HSPLsun/security/util/DerInputStream;->getGeneralizedTime()Ljava/util/Date;
 HSPLsun/security/util/DerInputStream;->getLength()I
 HSPLsun/security/util/DerInputStream;->getLength(ILjava/io/InputStream;)I
-HSPLsun/security/util/DerInputStream;->getLength(Ljava/io/InputStream;)I+]Ljava/io/InputStream;Lsun/security/util/DerInputBuffer;
+HSPLsun/security/util/DerInputStream;->getLength(Ljava/io/InputStream;)I
 HSPLsun/security/util/DerInputStream;->getOID()Lsun/security/util/ObjectIdentifier;
 HSPLsun/security/util/DerInputStream;->getOctetString()[B
 HSPLsun/security/util/DerInputStream;->getSequence(I)[Lsun/security/util/DerValue;
-HSPLsun/security/util/DerInputStream;->getSequence(IZ)[Lsun/security/util/DerValue;+]Lsun/security/util/DerInputBuffer;Lsun/security/util/DerInputBuffer;]Lsun/security/util/DerInputStream;Lsun/security/util/DerInputStream;
-HSPLsun/security/util/DerInputStream;->getSet(I)[Lsun/security/util/DerValue;+]Lsun/security/util/DerInputBuffer;Lsun/security/util/DerInputBuffer;]Lsun/security/util/DerInputStream;Lsun/security/util/DerInputStream;
+HSPLsun/security/util/DerInputStream;->getSequence(IZ)[Lsun/security/util/DerValue;
+HSPLsun/security/util/DerInputStream;->getSet(I)[Lsun/security/util/DerValue;
 HSPLsun/security/util/DerInputStream;->getSet(IZ)[Lsun/security/util/DerValue;
 HSPLsun/security/util/DerInputStream;->getSet(IZZ)[Lsun/security/util/DerValue;
 HSPLsun/security/util/DerInputStream;->getUTCTime()Ljava/util/Date;
 HSPLsun/security/util/DerInputStream;->getUnalignedBitString()Lsun/security/util/BitArray;
-HSPLsun/security/util/DerInputStream;->init([BIIZ)V+]Lsun/security/util/DerInputBuffer;Lsun/security/util/DerInputBuffer;
+HSPLsun/security/util/DerInputStream;->init([BIIZ)V
 HSPLsun/security/util/DerInputStream;->mark(I)V
 HSPLsun/security/util/DerInputStream;->peekByte()I
 HSPLsun/security/util/DerInputStream;->readVector(I)[Lsun/security/util/DerValue;
-HSPLsun/security/util/DerInputStream;->readVector(IZ)[Lsun/security/util/DerValue;+]Lsun/security/util/DerInputBuffer;Lsun/security/util/DerInputBuffer;]Ljava/util/Vector;Ljava/util/Vector;]Lsun/security/util/DerInputStream;Lsun/security/util/DerInputStream;
-HSPLsun/security/util/DerInputStream;->reset()V+]Lsun/security/util/DerInputBuffer;Lsun/security/util/DerInputBuffer;
+HSPLsun/security/util/DerInputStream;->readVector(IZ)[Lsun/security/util/DerValue;
+HSPLsun/security/util/DerInputStream;->reset()V
 HSPLsun/security/util/DerInputStream;->subStream(IZ)Lsun/security/util/DerInputStream;
 HSPLsun/security/util/DerInputStream;->toByteArray()[B
 HSPLsun/security/util/DerOutputStream;-><init>()V
@@ -9678,14 +9490,14 @@
 HSPLsun/security/util/DerValue;-><init>(B[B)V
 HSPLsun/security/util/DerValue;-><init>(Ljava/io/InputStream;)V
 HSPLsun/security/util/DerValue;-><init>(Ljava/lang/String;)V
-HSPLsun/security/util/DerValue;-><init>(Lsun/security/util/DerInputBuffer;Z)V+]Lsun/security/util/DerInputBuffer;Lsun/security/util/DerInputBuffer;
+HSPLsun/security/util/DerValue;-><init>(Lsun/security/util/DerInputBuffer;Z)V
 HSPLsun/security/util/DerValue;-><init>([B)V
-HSPLsun/security/util/DerValue;->encode(Lsun/security/util/DerOutputStream;)V+]Lsun/security/util/DerInputBuffer;Lsun/security/util/DerInputBuffer;]Lsun/security/util/DerOutputStream;Lsun/security/util/DerOutputStream;
+HSPLsun/security/util/DerValue;->encode(Lsun/security/util/DerOutputStream;)V
 HSPLsun/security/util/DerValue;->getBigInteger()Ljava/math/BigInteger;
 HSPLsun/security/util/DerValue;->getBitString()[B
 HSPLsun/security/util/DerValue;->getBoolean()Z
 HSPLsun/security/util/DerValue;->getData()Lsun/security/util/DerInputStream;
-HSPLsun/security/util/DerValue;->getDataBytes()[B+]Lsun/security/util/DerInputStream;Lsun/security/util/DerInputStream;
+HSPLsun/security/util/DerValue;->getDataBytes()[B
 HSPLsun/security/util/DerValue;->getIA5String()Ljava/lang/String;
 HSPLsun/security/util/DerValue;->getInteger()I
 HSPLsun/security/util/DerValue;->getOID()Lsun/security/util/ObjectIdentifier;
@@ -9694,14 +9506,14 @@
 HSPLsun/security/util/DerValue;->getTag()B
 HSPLsun/security/util/DerValue;->getUnalignedBitString()Lsun/security/util/BitArray;
 HSPLsun/security/util/DerValue;->init(BLjava/lang/String;)Lsun/security/util/DerInputStream;
-HSPLsun/security/util/DerValue;->init(ZLjava/io/InputStream;)Lsun/security/util/DerInputStream;+]Ljava/io/InputStream;Lsun/security/util/DerInputBuffer;,Ljava/io/ByteArrayInputStream;
+HSPLsun/security/util/DerValue;->init(ZLjava/io/InputStream;)Lsun/security/util/DerInputStream;
 HSPLsun/security/util/DerValue;->isConstructed()Z
 HSPLsun/security/util/DerValue;->isContextSpecific()Z
 HSPLsun/security/util/DerValue;->isContextSpecific(B)Z
 HSPLsun/security/util/DerValue;->isPrintableStringChar(C)Z
 HSPLsun/security/util/DerValue;->length()I
 HSPLsun/security/util/DerValue;->resetTag(B)V
-HSPLsun/security/util/DerValue;->toByteArray()[B+]Lsun/security/util/DerValue;Lsun/security/util/DerValue;]Lsun/security/util/DerOutputStream;Lsun/security/util/DerOutputStream;]Lsun/security/util/DerInputStream;Lsun/security/util/DerInputStream;
+HSPLsun/security/util/DerValue;->toByteArray()[B
 HSPLsun/security/util/DerValue;->toDerInputStream()Lsun/security/util/DerInputStream;
 HSPLsun/security/util/DisabledAlgorithmConstraints$Constraints;->getConstraints(Ljava/lang/String;)Ljava/util/Set;
 HSPLsun/security/util/DisabledAlgorithmConstraints$Constraints;->permits(Ljava/security/Key;)Z
@@ -9736,12 +9548,12 @@
 HSPLsun/security/util/MemoryCache;->newEntry(Ljava/lang/Object;Ljava/lang/Object;JLjava/lang/ref/ReferenceQueue;)Lsun/security/util/MemoryCache$CacheEntry;
 HSPLsun/security/util/MemoryCache;->put(Ljava/lang/Object;Ljava/lang/Object;)V
 HSPLsun/security/util/ObjectIdentifier;-><init>(Lsun/security/util/DerInputBuffer;)V
-HSPLsun/security/util/ObjectIdentifier;-><init>(Lsun/security/util/DerInputStream;)V+]Lsun/security/util/DerInputStream;Lsun/security/util/DerInputStream;
+HSPLsun/security/util/ObjectIdentifier;-><init>(Lsun/security/util/DerInputStream;)V
 HSPLsun/security/util/ObjectIdentifier;->check([B)V
 HSPLsun/security/util/ObjectIdentifier;->encode(Lsun/security/util/DerOutputStream;)V
 HSPLsun/security/util/ObjectIdentifier;->equals(Ljava/lang/Object;)Z
 HSPLsun/security/util/ObjectIdentifier;->hashCode()I
-HSPLsun/security/util/ObjectIdentifier;->toString()Ljava/lang/String;+]Ljava/lang/StringBuffer;Ljava/lang/StringBuffer;
+HSPLsun/security/util/ObjectIdentifier;->toString()Ljava/lang/String;
 HSPLsun/security/util/SignatureFileVerifier;-><init>(Ljava/util/ArrayList;Lsun/security/util/ManifestDigester;Ljava/lang/String;[B)V
 HSPLsun/security/util/SignatureFileVerifier;->getDigest(Ljava/lang/String;)Ljava/security/MessageDigest;
 HSPLsun/security/util/SignatureFileVerifier;->getSigners([Lsun/security/pkcs/SignerInfo;Lsun/security/pkcs/PKCS7;)[Ljava/security/CodeSigner;
@@ -9755,16 +9567,16 @@
 HSPLsun/security/util/SignatureFileVerifier;->verifyManifestHash(Ljava/util/jar/Manifest;Lsun/security/util/ManifestDigester;Ljava/util/List;)Z
 HSPLsun/security/x509/AVA;-><init>(Ljava/io/Reader;ILjava/util/Map;)V
 HSPLsun/security/x509/AVA;-><init>(Ljava/io/Reader;Ljava/util/Map;)V
-HSPLsun/security/x509/AVA;-><init>(Lsun/security/util/DerValue;)V+]Lsun/security/util/DerInputStream;Lsun/security/util/DerInputStream;
+HSPLsun/security/x509/AVA;-><init>(Lsun/security/util/DerValue;)V
 HSPLsun/security/x509/AVA;->derEncode(Ljava/io/OutputStream;)V
 HSPLsun/security/x509/AVA;->isDerString(Lsun/security/util/DerValue;Z)Z
 HSPLsun/security/x509/AVA;->isTerminator(II)Z
 HSPLsun/security/x509/AVA;->parseString(Ljava/io/Reader;IILjava/lang/StringBuilder;)Lsun/security/util/DerValue;
 HSPLsun/security/x509/AVA;->readChar(Ljava/io/Reader;Ljava/lang/String;)I
 HSPLsun/security/x509/AVA;->toKeyword(ILjava/util/Map;)Ljava/lang/String;
-HSPLsun/security/x509/AVA;->toRFC2253CanonicalString()Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Ljava/lang/String;Ljava/lang/String;]Lsun/security/util/DerValue;Lsun/security/util/DerValue;
+HSPLsun/security/x509/AVA;->toRFC2253CanonicalString()Ljava/lang/String;
 HSPLsun/security/x509/AVA;->toRFC2253String(Ljava/util/Map;)Ljava/lang/String;
-HSPLsun/security/x509/AVAKeyword;->getKeyword(Lsun/security/util/ObjectIdentifier;ILjava/util/Map;)Ljava/lang/String;+]Lsun/security/util/ObjectIdentifier;Lsun/security/util/ObjectIdentifier;]Ljava/util/Map;Ljava/util/HashMap;,Ljava/util/Collections$EmptyMap;
+HSPLsun/security/x509/AVAKeyword;->getKeyword(Lsun/security/util/ObjectIdentifier;ILjava/util/Map;)Ljava/lang/String;
 HSPLsun/security/x509/AVAKeyword;->getOID(Ljava/lang/String;ILjava/util/Map;)Lsun/security/util/ObjectIdentifier;
 HSPLsun/security/x509/AVAKeyword;->isCompliant(I)Z
 HSPLsun/security/x509/AccessDescription;-><init>(Lsun/security/util/DerValue;)V
@@ -9847,7 +9659,7 @@
 HSPLsun/security/x509/PolicyInformation;->getPolicyIdentifier()Lsun/security/x509/CertificatePolicyId;
 HSPLsun/security/x509/PolicyInformation;->getPolicyQualifiers()Ljava/util/Set;
 HSPLsun/security/x509/RDN;-><init>(Ljava/lang/String;Ljava/util/Map;)V
-HSPLsun/security/x509/RDN;-><init>(Lsun/security/util/DerValue;)V+]Lsun/security/util/DerValue;Lsun/security/util/DerValue;]Lsun/security/util/DerInputStream;Lsun/security/util/DerInputStream;
+HSPLsun/security/x509/RDN;-><init>(Lsun/security/util/DerValue;)V
 HSPLsun/security/x509/RDN;->encode(Lsun/security/util/DerOutputStream;)V
 HSPLsun/security/x509/RDN;->toRFC2253String(Ljava/util/Map;)Ljava/lang/String;
 HSPLsun/security/x509/RDN;->toRFC2253String(Z)Ljava/lang/String;
@@ -9871,20 +9683,20 @@
 HSPLsun/security/x509/X500Name;->asX500Principal()Ljavax/security/auth/x500/X500Principal;
 HSPLsun/security/x509/X500Name;->checkNoNewLinesNorTabsAtBeginningOfDN(Ljava/lang/String;)V
 HSPLsun/security/x509/X500Name;->countQuotes(Ljava/lang/String;II)I
-HSPLsun/security/x509/X500Name;->equals(Ljava/lang/Object;)Z+]Lsun/security/x509/X500Name;Lsun/security/x509/X500Name;
+HSPLsun/security/x509/X500Name;->equals(Ljava/lang/Object;)Z
 HSPLsun/security/x509/X500Name;->escaped(IILjava/lang/String;)Z
 HSPLsun/security/x509/X500Name;->generateRFC2253DN(Ljava/util/Map;)Ljava/lang/String;
 HSPLsun/security/x509/X500Name;->getEncoded()[B
 HSPLsun/security/x509/X500Name;->getEncodedInternal()[B
-HSPLsun/security/x509/X500Name;->getRFC2253CanonicalName()Ljava/lang/String;+]Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;]Lsun/security/x509/RDN;Lsun/security/x509/RDN;
+HSPLsun/security/x509/X500Name;->getRFC2253CanonicalName()Ljava/lang/String;
 HSPLsun/security/x509/X500Name;->getRFC2253Name()Ljava/lang/String;
 HSPLsun/security/x509/X500Name;->getRFC2253Name(Ljava/util/Map;)Ljava/lang/String;
 HSPLsun/security/x509/X500Name;->hashCode()I
 HSPLsun/security/x509/X500Name;->intern(Lsun/security/util/ObjectIdentifier;)Lsun/security/util/ObjectIdentifier;
 HSPLsun/security/x509/X500Name;->isEmpty()Z
-HSPLsun/security/x509/X500Name;->parseDER(Lsun/security/util/DerInputStream;)V+]Lsun/security/util/DerInputStream;Lsun/security/util/DerInputStream;
+HSPLsun/security/x509/X500Name;->parseDER(Lsun/security/util/DerInputStream;)V
 HSPLsun/security/x509/X500Name;->parseDN(Ljava/lang/String;Ljava/util/Map;)V
-HSPLsun/security/x509/X509AttributeName;-><init>(Ljava/lang/String;)V+]Ljava/lang/String;Ljava/lang/String;
+HSPLsun/security/x509/X509AttributeName;-><init>(Ljava/lang/String;)V
 HSPLsun/security/x509/X509AttributeName;->getPrefix()Ljava/lang/String;
 HSPLsun/security/x509/X509AttributeName;->getSuffix()Ljava/lang/String;
 HSPLsun/security/x509/X509CertImpl;-><init>([B)V
@@ -9941,10 +9753,10 @@
 HSPLsun/util/calendar/BaseCalendar$Date;->hit(J)Z
 HSPLsun/util/calendar/BaseCalendar$Date;->setCache(IJI)V
 HSPLsun/util/calendar/BaseCalendar;-><init>()V
-HSPLsun/util/calendar/BaseCalendar;->getCalendarDateFromFixedDate(Lsun/util/calendar/CalendarDate;J)V+]Lsun/util/calendar/BaseCalendar$Date;Lsun/util/calendar/Gregorian$Date;]Lsun/util/calendar/BaseCalendar;Lsun/util/calendar/Gregorian;
+HSPLsun/util/calendar/BaseCalendar;->getCalendarDateFromFixedDate(Lsun/util/calendar/CalendarDate;J)V
 HSPLsun/util/calendar/BaseCalendar;->getDayOfWeekFromFixedDate(J)I
 HSPLsun/util/calendar/BaseCalendar;->getDayOfYear(III)J
-HSPLsun/util/calendar/BaseCalendar;->getFixedDate(IIILsun/util/calendar/BaseCalendar$Date;)J+]Lsun/util/calendar/BaseCalendar$Date;Lsun/util/calendar/Gregorian$Date;]Lsun/util/calendar/BaseCalendar;Lsun/util/calendar/Gregorian;
+HSPLsun/util/calendar/BaseCalendar;->getFixedDate(IIILsun/util/calendar/BaseCalendar$Date;)J
 HSPLsun/util/calendar/BaseCalendar;->getFixedDate(Lsun/util/calendar/CalendarDate;)J
 HSPLsun/util/calendar/BaseCalendar;->getGregorianYearFromFixedDate(J)I
 HSPLsun/util/calendar/BaseCalendar;->isLeapYear(I)Z
@@ -9953,7 +9765,7 @@
 HSPLsun/util/calendar/CalendarDate;-><init>(Ljava/util/TimeZone;)V
 HSPLsun/util/calendar/CalendarDate;->clone()Ljava/lang/Object;
 HSPLsun/util/calendar/CalendarDate;->getDayOfMonth()I
-HSPLsun/util/calendar/CalendarDate;->getDayOfWeek()I+]Lsun/util/calendar/CalendarDate;Lsun/util/calendar/Gregorian$Date;
+HSPLsun/util/calendar/CalendarDate;->getDayOfWeek()I
 HSPLsun/util/calendar/CalendarDate;->getEra()Lsun/util/calendar/Era;
 HSPLsun/util/calendar/CalendarDate;->getHours()I
 HSPLsun/util/calendar/CalendarDate;->getMillis()I
@@ -9995,7 +9807,7 @@
 HSPLsun/util/calendar/CalendarUtils;->mod(JJ)J
 HSPLsun/util/calendar/CalendarUtils;->sprintf0d(Ljava/lang/StringBuilder;II)Ljava/lang/StringBuilder;
 HSPLsun/util/calendar/Gregorian$Date;-><init>(Ljava/util/TimeZone;)V
-HSPLsun/util/calendar/Gregorian$Date;->getNormalizedYear()I+]Lsun/util/calendar/Gregorian$Date;Lsun/util/calendar/Gregorian$Date;
+HSPLsun/util/calendar/Gregorian$Date;->getNormalizedYear()I
 HSPLsun/util/calendar/Gregorian$Date;->setNormalizedYear(I)V
 HSPLsun/util/calendar/Gregorian;->getCalendarDate(JLjava/util/TimeZone;)Lsun/util/calendar/CalendarDate;
 HSPLsun/util/calendar/Gregorian;->getCalendarDate(JLjava/util/TimeZone;)Lsun/util/calendar/Gregorian$Date;
@@ -10025,7 +9837,7 @@
 HSPLsun/util/locale/BaseLocale$Key;->hashCode()I
 HSPLsun/util/locale/BaseLocale$Key;->hashCode(Lsun/util/locale/BaseLocale;)I
 HSPLsun/util/locale/BaseLocale$Key;->normalize(Lsun/util/locale/BaseLocale$Key;)Lsun/util/locale/BaseLocale$Key;
-HSPLsun/util/locale/BaseLocale;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V+]Ljava/lang/String;Ljava/lang/String;
+HSPLsun/util/locale/BaseLocale;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V
 HSPLsun/util/locale/BaseLocale;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLsun/util/locale/BaseLocale-IA;)V
 HSPLsun/util/locale/BaseLocale;->cleanCache()V
 HSPLsun/util/locale/BaseLocale;->equals(Ljava/lang/Object;)Z
@@ -10075,7 +9887,7 @@
 HSPLsun/util/locale/LocaleObjectCache$CacheEntry;-><init>(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/ref/ReferenceQueue;)V
 HSPLsun/util/locale/LocaleObjectCache$CacheEntry;->getKey()Ljava/lang/Object;
 HSPLsun/util/locale/LocaleObjectCache;->cleanStaleEntries()V
-HSPLsun/util/locale/LocaleObjectCache;->get(Ljava/lang/Object;)Ljava/lang/Object;+]Ljava/util/concurrent/ConcurrentMap;Ljava/util/concurrent/ConcurrentHashMap;]Lsun/util/locale/LocaleObjectCache;Lsun/util/locale/BaseLocale$Cache;]Lsun/util/locale/LocaleObjectCache$CacheEntry;Lsun/util/locale/LocaleObjectCache$CacheEntry;
+HSPLsun/util/locale/LocaleObjectCache;->get(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLsun/util/locale/LocaleObjectCache;->normalizeKey(Ljava/lang/Object;)Ljava/lang/Object;
 HSPLsun/util/locale/LocaleUtils;->caseIgnoreMatch(Ljava/lang/String;Ljava/lang/String;)Z
 HSPLsun/util/locale/LocaleUtils;->isAlpha(C)Z
@@ -10166,6 +9978,7 @@
 Lcom/android/okhttp/Connection;
 Lcom/android/okhttp/ConnectionPool$1;
 Lcom/android/okhttp/ConnectionPool;
+Lcom/android/okhttp/ConnectionSpec$1;
 Lcom/android/okhttp/ConnectionSpec$Builder;
 Lcom/android/okhttp/ConnectionSpec;
 Lcom/android/okhttp/ConnectionSpecs;
@@ -10173,6 +9986,7 @@
 Lcom/android/okhttp/Dns$1;
 Lcom/android/okhttp/Dns;
 Lcom/android/okhttp/Handshake;
+Lcom/android/okhttp/Headers$1;
 Lcom/android/okhttp/Headers$Builder;
 Lcom/android/okhttp/Headers;
 Lcom/android/okhttp/HttpHandler$CleartextURLFilter;
@@ -10190,10 +10004,12 @@
 Lcom/android/okhttp/OkUrlFactories;
 Lcom/android/okhttp/OkUrlFactory;
 Lcom/android/okhttp/Protocol;
+Lcom/android/okhttp/Request$1;
 Lcom/android/okhttp/Request$Builder;
 Lcom/android/okhttp/Request;
 Lcom/android/okhttp/RequestBody$2;
 Lcom/android/okhttp/RequestBody;
+Lcom/android/okhttp/Response$1;
 Lcom/android/okhttp/Response$Builder;
 Lcom/android/okhttp/Response;
 Lcom/android/okhttp/ResponseBody;
@@ -10208,6 +10024,7 @@
 Lcom/android/okhttp/internal/FaultHidingSink;
 Lcom/android/okhttp/internal/Internal;
 Lcom/android/okhttp/internal/InternalCache;
+Lcom/android/okhttp/internal/NamedRunnable;
 Lcom/android/okhttp/internal/OptionalMethod;
 Lcom/android/okhttp/internal/Platform;
 Lcom/android/okhttp/internal/RouteDatabase;
@@ -10216,6 +10033,7 @@
 Lcom/android/okhttp/internal/Util;
 Lcom/android/okhttp/internal/Version;
 Lcom/android/okhttp/internal/framed/FrameWriter;
+Lcom/android/okhttp/internal/framed/FramedConnection$1;
 Lcom/android/okhttp/internal/framed/FramedConnection$Builder;
 Lcom/android/okhttp/internal/framed/FramedConnection$Listener$1;
 Lcom/android/okhttp/internal/framed/FramedConnection$Listener;
@@ -10226,9 +10044,11 @@
 Lcom/android/okhttp/internal/framed/Settings;
 Lcom/android/okhttp/internal/http/AuthenticatorAdapter;
 Lcom/android/okhttp/internal/http/CacheRequest;
+Lcom/android/okhttp/internal/http/CacheStrategy$1;
 Lcom/android/okhttp/internal/http/CacheStrategy$Factory;
 Lcom/android/okhttp/internal/http/CacheStrategy;
 Lcom/android/okhttp/internal/http/HeaderParser;
+Lcom/android/okhttp/internal/http/Http1xStream$1;
 Lcom/android/okhttp/internal/http/Http1xStream$AbstractSource;
 Lcom/android/okhttp/internal/http/Http1xStream$ChunkedSink;
 Lcom/android/okhttp/internal/http/Http1xStream$ChunkedSource;
@@ -10299,7 +10119,6 @@
 Lcom/android/okhttp/okio/Timeout;
 Lcom/android/okhttp/okio/Util;
 Lcom/android/org/bouncycastle/asn1/ASN1ApplicationSpecific;
-Lcom/android/org/bouncycastle/asn1/ASN1ApplicationSpecificParser;
 Lcom/android/org/bouncycastle/asn1/ASN1BitString;
 Lcom/android/org/bouncycastle/asn1/ASN1Boolean;
 Lcom/android/org/bouncycastle/asn1/ASN1Choice;
@@ -10311,7 +10130,6 @@
 Lcom/android/org/bouncycastle/asn1/ASN1GeneralizedTime;
 Lcom/android/org/bouncycastle/asn1/ASN1InputStream;
 Lcom/android/org/bouncycastle/asn1/ASN1Integer;
-Lcom/android/org/bouncycastle/asn1/ASN1Null;
 Lcom/android/org/bouncycastle/asn1/ASN1Object;
 Lcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier$OidHandle;
 Lcom/android/org/bouncycastle/asn1/ASN1ObjectIdentifier;
@@ -10328,7 +10146,6 @@
 Lcom/android/org/bouncycastle/asn1/ASN1StreamParser;
 Lcom/android/org/bouncycastle/asn1/ASN1String;
 Lcom/android/org/bouncycastle/asn1/ASN1TaggedObject;
-Lcom/android/org/bouncycastle/asn1/ASN1TaggedObjectParser;
 Lcom/android/org/bouncycastle/asn1/ASN1UTCTime;
 Lcom/android/org/bouncycastle/asn1/BERApplicationSpecific;
 Lcom/android/org/bouncycastle/asn1/BERApplicationSpecificParser;
@@ -10339,16 +10156,13 @@
 Lcom/android/org/bouncycastle/asn1/BERSet;
 Lcom/android/org/bouncycastle/asn1/BERSetParser;
 Lcom/android/org/bouncycastle/asn1/BERTaggedObjectParser;
-Lcom/android/org/bouncycastle/asn1/BERTags;
 Lcom/android/org/bouncycastle/asn1/ConstructedOctetStream;
 Lcom/android/org/bouncycastle/asn1/DERBMPString;
 Lcom/android/org/bouncycastle/asn1/DERBitString;
 Lcom/android/org/bouncycastle/asn1/DERExternalParser;
-Lcom/android/org/bouncycastle/asn1/DERFactory;
 Lcom/android/org/bouncycastle/asn1/DERGeneralString;
 Lcom/android/org/bouncycastle/asn1/DERGraphicString;
 Lcom/android/org/bouncycastle/asn1/DERIA5String;
-Lcom/android/org/bouncycastle/asn1/DERInteger;
 Lcom/android/org/bouncycastle/asn1/DERNull;
 Lcom/android/org/bouncycastle/asn1/DERNumericString;
 Lcom/android/org/bouncycastle/asn1/DEROctetString;
@@ -10373,16 +10187,13 @@
 Lcom/android/org/bouncycastle/asn1/IndefiniteLengthInputStream;
 Lcom/android/org/bouncycastle/asn1/LazyEncodedSequence;
 Lcom/android/org/bouncycastle/asn1/LimitedInputStream;
-Lcom/android/org/bouncycastle/asn1/OIDTokenizer;
 Lcom/android/org/bouncycastle/asn1/StreamUtil;
 Lcom/android/org/bouncycastle/asn1/bc/BCObjectIdentifiers;
-Lcom/android/org/bouncycastle/asn1/iana/IANAObjectIdentifiers;
 Lcom/android/org/bouncycastle/asn1/misc/MiscObjectIdentifiers;
 Lcom/android/org/bouncycastle/asn1/nist/NISTObjectIdentifiers;
 Lcom/android/org/bouncycastle/asn1/oiw/OIWObjectIdentifiers;
 Lcom/android/org/bouncycastle/asn1/pkcs/PKCSObjectIdentifiers;
 Lcom/android/org/bouncycastle/asn1/x500/X500Name;
-Lcom/android/org/bouncycastle/asn1/x500/X500NameStyle;
 Lcom/android/org/bouncycastle/asn1/x500/style/AbstractX500NameStyle;
 Lcom/android/org/bouncycastle/asn1/x500/style/BCStyle;
 Lcom/android/org/bouncycastle/asn1/x509/AlgorithmIdentifier;
@@ -10390,8 +10201,6 @@
 Lcom/android/org/bouncycastle/asn1/x509/DSAParameter;
 Lcom/android/org/bouncycastle/asn1/x509/SubjectPublicKeyInfo;
 Lcom/android/org/bouncycastle/asn1/x509/Time;
-Lcom/android/org/bouncycastle/asn1/x509/V3TBSCertificateGenerator;
-Lcom/android/org/bouncycastle/asn1/x509/X509ExtensionsGenerator;
 Lcom/android/org/bouncycastle/asn1/x509/X509Name;
 Lcom/android/org/bouncycastle/asn1/x509/X509ObjectIdentifiers;
 Lcom/android/org/bouncycastle/asn1/x9/X9ECParameters;
@@ -10414,7 +10223,6 @@
 Lcom/android/org/bouncycastle/crypto/Wrapper;
 Lcom/android/org/bouncycastle/crypto/digests/AndroidDigestFactory;
 Lcom/android/org/bouncycastle/crypto/digests/AndroidDigestFactoryBouncyCastle;
-Lcom/android/org/bouncycastle/crypto/digests/AndroidDigestFactoryInterface;
 Lcom/android/org/bouncycastle/crypto/digests/AndroidDigestFactoryOpenSSL;
 Lcom/android/org/bouncycastle/crypto/digests/EncodableDigest;
 Lcom/android/org/bouncycastle/crypto/digests/GeneralDigest;
@@ -10430,7 +10238,6 @@
 Lcom/android/org/bouncycastle/crypto/generators/PKCS5S2ParametersGenerator;
 Lcom/android/org/bouncycastle/crypto/io/MacInputStream;
 Lcom/android/org/bouncycastle/crypto/macs/HMac;
-Lcom/android/org/bouncycastle/crypto/modes/AEADCipher;
 Lcom/android/org/bouncycastle/crypto/modes/CBCBlockCipher;
 Lcom/android/org/bouncycastle/crypto/paddings/BlockCipherPadding;
 Lcom/android/org/bouncycastle/crypto/paddings/PKCS7Padding;
@@ -10446,25 +10253,17 @@
 Lcom/android/org/bouncycastle/crypto/params/KeyParameter;
 Lcom/android/org/bouncycastle/crypto/params/ParametersWithIV;
 Lcom/android/org/bouncycastle/crypto/params/ParametersWithRandom;
-Lcom/android/org/bouncycastle/jcajce/PBKDFKey;
 Lcom/android/org/bouncycastle/jcajce/PKCS12Key;
-Lcom/android/org/bouncycastle/jcajce/PKCS12KeyWithParameters;
 Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/DH$Mappings;
 Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/DH;
 Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/DSA$Mappings;
-Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/EC$Mappings;
-Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/EC;
 Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/RSA$Mappings;
 Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/RSA;
-Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/X509$Mappings;
 Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/dh/KeyFactorySpi;
 Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/dsa/BCDSAPublicKey;
 Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/dsa/DSAUtil;
 Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/dsa/KeyFactorySpi;
-Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/ec/KeyFactorySpi$EC;
-Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/ec/KeyFactorySpi;
 Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi$NoPadding;
-Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi;
 Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/rsa/KeyFactorySpi;
 Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/rsa/RSAUtil;
 Lcom/android/org/bouncycastle/jcajce/provider/asymmetric/util/BaseCipherSpi;
@@ -10477,8 +10276,6 @@
 Lcom/android/org/bouncycastle/jcajce/provider/config/ProviderConfiguration;
 Lcom/android/org/bouncycastle/jcajce/provider/config/ProviderConfigurationPermission;
 Lcom/android/org/bouncycastle/jcajce/provider/digest/DigestAlgorithmProvider;
-Lcom/android/org/bouncycastle/jcajce/provider/digest/MD5$Mappings;
-Lcom/android/org/bouncycastle/jcajce/provider/digest/MD5;
 Lcom/android/org/bouncycastle/jcajce/provider/digest/SHA1$Mappings;
 Lcom/android/org/bouncycastle/jcajce/provider/digest/SHA1;
 Lcom/android/org/bouncycastle/jcajce/provider/digest/SHA224$Mappings;
@@ -10494,7 +10291,6 @@
 Lcom/android/org/bouncycastle/jcajce/provider/keystore/bc/BcKeyStoreSpi$Std;
 Lcom/android/org/bouncycastle/jcajce/provider/keystore/bc/BcKeyStoreSpi$StoreEntry;
 Lcom/android/org/bouncycastle/jcajce/provider/keystore/bc/BcKeyStoreSpi;
-Lcom/android/org/bouncycastle/jcajce/provider/symmetric/AES$ECB$1;
 Lcom/android/org/bouncycastle/jcajce/provider/symmetric/AES$ECB;
 Lcom/android/org/bouncycastle/jcajce/provider/symmetric/AES$Mappings;
 Lcom/android/org/bouncycastle/jcajce/provider/symmetric/AES;
@@ -10529,7 +10325,6 @@
 Lcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BaseWrapCipher$ErasableOutputStream;
 Lcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BaseWrapCipher$InvalidKeyOrParametersException;
 Lcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BaseWrapCipher;
-Lcom/android/org/bouncycastle/jcajce/provider/symmetric/util/BlockCipherProvider;
 Lcom/android/org/bouncycastle/jcajce/provider/symmetric/util/ClassUtil;
 Lcom/android/org/bouncycastle/jcajce/provider/symmetric/util/GcmSpecUtil$2;
 Lcom/android/org/bouncycastle/jcajce/provider/symmetric/util/GcmSpecUtil;
@@ -10539,39 +10334,29 @@
 Lcom/android/org/bouncycastle/jcajce/provider/util/AsymmetricAlgorithmProvider;
 Lcom/android/org/bouncycastle/jcajce/provider/util/AsymmetricKeyInfoConverter;
 Lcom/android/org/bouncycastle/jcajce/provider/util/DigestFactory;
-Lcom/android/org/bouncycastle/jcajce/spec/AEADParameterSpec;
 Lcom/android/org/bouncycastle/jcajce/spec/PBKDF2KeySpec;
 Lcom/android/org/bouncycastle/jcajce/util/BCJcaJceHelper;
 Lcom/android/org/bouncycastle/jcajce/util/DefaultJcaJceHelper;
 Lcom/android/org/bouncycastle/jcajce/util/JcaJceHelper;
-Lcom/android/org/bouncycastle/jcajce/util/ProviderJcaJceHelper;
 Lcom/android/org/bouncycastle/jce/X509Principal;
-Lcom/android/org/bouncycastle/jce/interfaces/BCKeyStore;
 Lcom/android/org/bouncycastle/jce/interfaces/PKCS12BagAttributeCarrier;
 Lcom/android/org/bouncycastle/jce/provider/BouncyCastleProvider$1;
 Lcom/android/org/bouncycastle/jce/provider/BouncyCastleProvider$PrivateProvider;
 Lcom/android/org/bouncycastle/jce/provider/BouncyCastleProvider;
 Lcom/android/org/bouncycastle/jce/provider/BouncyCastleProviderConfiguration;
 Lcom/android/org/bouncycastle/jce/provider/CertStoreCollectionSpi;
-Lcom/android/org/bouncycastle/jce/provider/X509CertificateObject;
-Lcom/android/org/bouncycastle/jce/spec/ECKeySpec;
-Lcom/android/org/bouncycastle/jce/spec/ECPublicKeySpec;
 Lcom/android/org/bouncycastle/util/Arrays;
 Lcom/android/org/bouncycastle/util/BigIntegers;
-Lcom/android/org/bouncycastle/util/Encodable;
 Lcom/android/org/bouncycastle/util/Integers;
-Lcom/android/org/bouncycastle/util/Iterable;
 Lcom/android/org/bouncycastle/util/Memoable;
 Lcom/android/org/bouncycastle/util/Pack;
 Lcom/android/org/bouncycastle/util/Properties$1;
 Lcom/android/org/bouncycastle/util/Properties;
 Lcom/android/org/bouncycastle/util/Strings$1;
 Lcom/android/org/bouncycastle/util/Strings;
-Lcom/android/org/bouncycastle/util/encoders/Encoder;
 Lcom/android/org/bouncycastle/util/encoders/Hex;
 Lcom/android/org/bouncycastle/util/encoders/HexEncoder;
 Lcom/android/org/bouncycastle/util/io/Streams;
-Lcom/android/org/bouncycastle/x509/X509V3CertificateGenerator;
 Lcom/android/org/kxml2/io/KXmlParser$ContentSource;
 Lcom/android/org/kxml2/io/KXmlParser$ValueContext;
 Lcom/android/org/kxml2/io/KXmlParser;
@@ -10697,6 +10482,7 @@
 Ljava/io/ObjectOutputStream$ReplaceTable;
 Ljava/io/ObjectOutputStream;
 Ljava/io/ObjectStreamClass$$ExternalSyntheticLambda0;
+Ljava/io/ObjectStreamClass$$ExternalSyntheticLambda1;
 Ljava/io/ObjectStreamClass$1;
 Ljava/io/ObjectStreamClass$2;
 Ljava/io/ObjectStreamClass$3;
@@ -10705,7 +10491,9 @@
 Ljava/io/ObjectStreamClass$Caches;
 Ljava/io/ObjectStreamClass$ClassDataSlot;
 Ljava/io/ObjectStreamClass$DefaultSUIDCompatibilityListener;
+Ljava/io/ObjectStreamClass$DeserializationConstructorsCache;
 Ljava/io/ObjectStreamClass$EntryFuture$1;
+Ljava/io/ObjectStreamClass$EntryFuture-IA;
 Ljava/io/ObjectStreamClass$EntryFuture;
 Ljava/io/ObjectStreamClass$ExceptionInfo;
 Ljava/io/ObjectStreamClass$FieldReflector;
@@ -10843,6 +10631,7 @@
 Ljava/lang/ProcessEnvironment;
 Ljava/lang/ProcessImpl;
 Ljava/lang/Readable;
+Ljava/lang/Record;
 Ljava/lang/ReflectiveOperationException;
 Ljava/lang/Runnable;
 Ljava/lang/Runtime;
@@ -10895,6 +10684,7 @@
 Ljava/lang/ThreadLocal$ThreadLocalMap-IA;
 Ljava/lang/ThreadLocal$ThreadLocalMap;
 Ljava/lang/ThreadLocal;
+Ljava/lang/Throwable$PrintStreamOrWriter-IA;
 Ljava/lang/Throwable$PrintStreamOrWriter;
 Ljava/lang/Throwable$SentinelHolder;
 Ljava/lang/Throwable$WrappedPrintStream;
@@ -10923,6 +10713,24 @@
 Ljava/lang/annotation/Inherited;
 Ljava/lang/annotation/Retention;
 Ljava/lang/annotation/Target;
+Ljava/lang/constant/ClassDesc;
+Ljava/lang/constant/Constable;
+Ljava/lang/constant/ConstantDesc;
+Ljava/lang/constant/ConstantDescs;
+Ljava/lang/constant/ConstantUtils;
+Ljava/lang/constant/DirectMethodHandleDesc$1;
+Ljava/lang/constant/DirectMethodHandleDesc$Kind;
+Ljava/lang/constant/DirectMethodHandleDesc;
+Ljava/lang/constant/DirectMethodHandleDescImpl$1;
+Ljava/lang/constant/DirectMethodHandleDescImpl;
+Ljava/lang/constant/DynamicConstantDesc$AnonymousDynamicConstantDesc;
+Ljava/lang/constant/DynamicConstantDesc;
+Ljava/lang/constant/MethodHandleDesc$1;
+Ljava/lang/constant/MethodHandleDesc;
+Ljava/lang/constant/MethodTypeDesc;
+Ljava/lang/constant/MethodTypeDescImpl;
+Ljava/lang/constant/PrimitiveClassDescImpl;
+Ljava/lang/constant/ReferenceClassDescImpl;
 Ljava/lang/invoke/ArrayElementVarHandle;
 Ljava/lang/invoke/ByteArrayViewVarHandle;
 Ljava/lang/invoke/ByteBufferViewVarHandle;
@@ -10999,8 +10807,10 @@
 Ljava/lang/invoke/VarHandle$1;
 Ljava/lang/invoke/VarHandle$AccessMode;
 Ljava/lang/invoke/VarHandle$AccessType;
+Ljava/lang/invoke/VarHandle$VarHandleDesc$Kind;
 Ljava/lang/invoke/VarHandle;
 Ljava/lang/invoke/WrongMethodTypeException;
+Ljava/lang/ref/Cleaner$Cleanable;
 Ljava/lang/ref/FinalizerReference$Sentinel-IA;
 Ljava/lang/ref/FinalizerReference$Sentinel;
 Ljava/lang/ref/FinalizerReference;
@@ -11039,6 +10849,7 @@
 Ljava/lang/reflect/Proxy$ProxyClassFactory-IA;
 Ljava/lang/reflect/Proxy$ProxyClassFactory;
 Ljava/lang/reflect/Proxy;
+Ljava/lang/reflect/RecordComponent;
 Ljava/lang/reflect/ReflectPermission;
 Ljava/lang/reflect/Type;
 Ljava/lang/reflect/TypeVariable;
@@ -11101,6 +10912,7 @@
 Ljava/net/IDN;
 Ljava/net/InMemoryCookieStore;
 Ljava/net/Inet4Address;
+Ljava/net/Inet6Address$Inet6AddressHolder-IA;
 Ljava/net/Inet6Address$Inet6AddressHolder;
 Ljava/net/Inet6Address;
 Ljava/net/Inet6AddressImpl;
@@ -11108,6 +10920,7 @@
 Ljava/net/InetAddress$InetAddressHolder;
 Ljava/net/InetAddress;
 Ljava/net/InetAddressImpl;
+Ljava/net/InetSocketAddress$InetSocketAddressHolder-IA;
 Ljava/net/InetSocketAddress$InetSocketAddressHolder;
 Ljava/net/InetSocketAddress;
 Ljava/net/InterfaceAddress;
@@ -11347,7 +11160,9 @@
 Ljava/security/PrivilegedExceptionAction;
 Ljava/security/ProtectionDomain;
 Ljava/security/Provider$EngineDescription;
+Ljava/security/Provider$Service-IA;
 Ljava/security/Provider$Service;
+Ljava/security/Provider$ServiceKey-IA;
 Ljava/security/Provider$ServiceKey;
 Ljava/security/Provider$UString;
 Ljava/security/Provider;
@@ -11469,6 +11284,7 @@
 Ljava/text/DecimalFormatSymbols;
 Ljava/text/DontCareFieldPosition$1;
 Ljava/text/DontCareFieldPosition;
+Ljava/text/FieldPosition$Delegate-IA;
 Ljava/text/FieldPosition$Delegate;
 Ljava/text/FieldPosition;
 Ljava/text/Format$Field;
@@ -11484,6 +11300,7 @@
 Ljava/text/Normalizer$Form;
 Ljava/text/Normalizer;
 Ljava/text/NumberFormat$Field;
+Ljava/text/NumberFormat$Style;
 Ljava/text/NumberFormat;
 Ljava/text/ParseException;
 Ljava/text/ParsePosition;
@@ -11537,7 +11354,9 @@
 Ljava/time/format/DateTimeFormatterBuilder$NumberPrinterParser;
 Ljava/time/format/DateTimeFormatterBuilder$OffsetIdPrinterParser;
 Ljava/time/format/DateTimeFormatterBuilder$PadPrinterParserDecorator;
+Ljava/time/format/DateTimeFormatterBuilder$PrefixTree$CI-IA;
 Ljava/time/format/DateTimeFormatterBuilder$PrefixTree$CI;
+Ljava/time/format/DateTimeFormatterBuilder$PrefixTree-IA;
 Ljava/time/format/DateTimeFormatterBuilder$PrefixTree;
 Ljava/time/format/DateTimeFormatterBuilder$SettingsParser;
 Ljava/time/format/DateTimeFormatterBuilder$StringLiteralPrinterParser;
@@ -11719,18 +11538,27 @@
 Ljava/util/Date;
 Ljava/util/Deque;
 Ljava/util/Dictionary;
+Ljava/util/DualPivotQuicksort$Sorter-IA;
 Ljava/util/DualPivotQuicksort$Sorter;
 Ljava/util/DualPivotQuicksort;
 Ljava/util/DuplicateFormatFlagsException;
 Ljava/util/EmptyStackException;
 Ljava/util/EnumMap$1;
+Ljava/util/EnumMap$EntryIterator$Entry-IA;
 Ljava/util/EnumMap$EntryIterator$Entry;
+Ljava/util/EnumMap$EntryIterator-IA;
 Ljava/util/EnumMap$EntryIterator;
+Ljava/util/EnumMap$EntrySet-IA;
 Ljava/util/EnumMap$EntrySet;
+Ljava/util/EnumMap$EnumMapIterator-IA;
 Ljava/util/EnumMap$EnumMapIterator;
+Ljava/util/EnumMap$KeyIterator-IA;
 Ljava/util/EnumMap$KeyIterator;
+Ljava/util/EnumMap$KeySet-IA;
 Ljava/util/EnumMap$KeySet;
+Ljava/util/EnumMap$ValueIterator-IA;
 Ljava/util/EnumMap$ValueIterator;
+Ljava/util/EnumMap$Values-IA;
 Ljava/util/EnumMap$Values;
 Ljava/util/EnumMap;
 Ljava/util/EnumSet$SerializationProxy;
@@ -11765,19 +11593,30 @@
 Ljava/util/HashMap$Values;
 Ljava/util/HashMap;
 Ljava/util/HashSet;
+Ljava/util/Hashtable$EntrySet-IA;
 Ljava/util/Hashtable$EntrySet;
 Ljava/util/Hashtable$Enumerator;
 Ljava/util/Hashtable$HashtableEntry;
+Ljava/util/Hashtable$KeySet-IA;
 Ljava/util/Hashtable$KeySet;
+Ljava/util/Hashtable$ValueCollection-IA;
 Ljava/util/Hashtable$ValueCollection;
 Ljava/util/Hashtable;
+Ljava/util/IdentityHashMap$EntryIterator$Entry-IA;
 Ljava/util/IdentityHashMap$EntryIterator$Entry;
+Ljava/util/IdentityHashMap$EntryIterator-IA;
 Ljava/util/IdentityHashMap$EntryIterator;
+Ljava/util/IdentityHashMap$EntrySet-IA;
 Ljava/util/IdentityHashMap$EntrySet;
+Ljava/util/IdentityHashMap$IdentityHashMapIterator-IA;
 Ljava/util/IdentityHashMap$IdentityHashMapIterator;
+Ljava/util/IdentityHashMap$KeyIterator-IA;
 Ljava/util/IdentityHashMap$KeyIterator;
+Ljava/util/IdentityHashMap$KeySet-IA;
 Ljava/util/IdentityHashMap$KeySet;
+Ljava/util/IdentityHashMap$ValueIterator-IA;
 Ljava/util/IdentityHashMap$ValueIterator;
+Ljava/util/IdentityHashMap$Values-IA;
 Ljava/util/IdentityHashMap$Values;
 Ljava/util/IdentityHashMap;
 Ljava/util/IllegalFormatCodePointException;
@@ -11793,6 +11632,7 @@
 Ljava/util/ImmutableCollections$AbstractImmutableSet;
 Ljava/util/ImmutableCollections$List12;
 Ljava/util/ImmutableCollections$ListItr;
+Ljava/util/ImmutableCollections$ListN-IA;
 Ljava/util/ImmutableCollections$ListN;
 Ljava/util/ImmutableCollections$Map1;
 Ljava/util/ImmutableCollections$MapN$1;
@@ -11810,13 +11650,13 @@
 Ljava/util/LinkedHashMap$LinkedEntryIterator;
 Ljava/util/LinkedHashMap$LinkedEntrySet;
 Ljava/util/LinkedHashMap$LinkedHashIterator;
-Ljava/util/LinkedHashMap$LinkedHashMapEntry;
 Ljava/util/LinkedHashMap$LinkedKeyIterator;
 Ljava/util/LinkedHashMap$LinkedKeySet;
 Ljava/util/LinkedHashMap$LinkedValueIterator;
 Ljava/util/LinkedHashMap$LinkedValues;
 Ljava/util/LinkedHashMap;
 Ljava/util/LinkedHashSet;
+Ljava/util/LinkedList$DescendingIterator-IA;
 Ljava/util/LinkedList$DescendingIterator;
 Ljava/util/LinkedList$ListItr;
 Ljava/util/LinkedList$Node;
@@ -11834,8 +11674,10 @@
 Ljava/util/Locale$IsoCountryCode$3;
 Ljava/util/Locale$IsoCountryCode;
 Ljava/util/Locale$LanguageRange;
+Ljava/util/Locale$LocaleKey-IA;
 Ljava/util/Locale$LocaleKey;
 Ljava/util/Locale$NoImagePreloadHolder;
+Ljava/util/Locale-IA;
 Ljava/util/Locale;
 Ljava/util/Map$Entry;
 Ljava/util/Map;
@@ -11882,7 +11724,6 @@
 Ljava/util/Scanner;
 Ljava/util/ServiceConfigurationError;
 Ljava/util/ServiceLoader$1;
-Ljava/util/ServiceLoader$LazyIterator;
 Ljava/util/ServiceLoader;
 Ljava/util/Set;
 Ljava/util/SimpleTimeZone$Cache;
@@ -11909,7 +11750,6 @@
 Ljava/util/TaskQueue;
 Ljava/util/TimSort;
 Ljava/util/TimeZone;
-Ljava/util/Timer$1;
 Ljava/util/Timer;
 Ljava/util/TimerTask;
 Ljava/util/TimerThread;
@@ -11940,16 +11780,20 @@
 Ljava/util/UnknownFormatConversionException;
 Ljava/util/UnknownFormatFlagsException;
 Ljava/util/Vector$1;
+Ljava/util/Vector$Itr-IA;
 Ljava/util/Vector$Itr;
 Ljava/util/Vector;
 Ljava/util/WeakHashMap$Entry;
+Ljava/util/WeakHashMap$EntryIterator-IA;
 Ljava/util/WeakHashMap$EntryIterator;
 Ljava/util/WeakHashMap$EntrySet-IA;
 Ljava/util/WeakHashMap$EntrySet;
 Ljava/util/WeakHashMap$HashIterator;
+Ljava/util/WeakHashMap$KeyIterator-IA;
 Ljava/util/WeakHashMap$KeyIterator;
 Ljava/util/WeakHashMap$KeySet-IA;
 Ljava/util/WeakHashMap$KeySet;
+Ljava/util/WeakHashMap$ValueIterator-IA;
 Ljava/util/WeakHashMap$ValueIterator;
 Ljava/util/WeakHashMap$Values-IA;
 Ljava/util/WeakHashMap$Values;
@@ -12211,6 +12055,7 @@
 Ljava/util/logging/ConsoleHandler;
 Ljava/util/logging/ErrorManager;
 Ljava/util/logging/FileHandler$1;
+Ljava/util/logging/FileHandler$InitializationErrorManager-IA;
 Ljava/util/logging/FileHandler$InitializationErrorManager;
 Ljava/util/logging/FileHandler$MeteredStream;
 Ljava/util/logging/FileHandler;
@@ -12309,10 +12154,6 @@
 Ljava/util/stream/DoublePipeline$StatelessOp;
 Ljava/util/stream/DoublePipeline;
 Ljava/util/stream/DoubleStream;
-Ljava/util/stream/FindOps$$ExternalSyntheticLambda0;
-Ljava/util/stream/FindOps$$ExternalSyntheticLambda4;
-Ljava/util/stream/FindOps$$ExternalSyntheticLambda5;
-Ljava/util/stream/FindOps$$ExternalSyntheticLambda7;
 Ljava/util/stream/FindOps$FindOp;
 Ljava/util/stream/FindOps$FindSink$OfInt;
 Ljava/util/stream/FindOps$FindSink$OfRef;
@@ -12323,13 +12164,11 @@
 Ljava/util/stream/ForEachOps$ForEachOp;
 Ljava/util/stream/ForEachOps;
 Ljava/util/stream/IntPipeline$$ExternalSyntheticLambda0;
-Ljava/util/stream/IntPipeline$$ExternalSyntheticLambda13;
 Ljava/util/stream/IntPipeline$$ExternalSyntheticLambda1;
 Ljava/util/stream/IntPipeline$$ExternalSyntheticLambda7;
 Ljava/util/stream/IntPipeline$$ExternalSyntheticLambda8;
 Ljava/util/stream/IntPipeline$4$1;
 Ljava/util/stream/IntPipeline$4;
-Ljava/util/stream/IntPipeline$9$1;
 Ljava/util/stream/IntPipeline$9;
 Ljava/util/stream/IntPipeline$Head;
 Ljava/util/stream/IntPipeline$StatelessOp;
@@ -12369,8 +12208,11 @@
 Ljava/util/stream/Nodes$IntFixedNodeBuilder;
 Ljava/util/stream/Nodes$IntSpinedNodeBuilder;
 Ljava/util/stream/Nodes$SpinedNodeBuilder;
+Ljava/util/stream/Nodes$ToArrayTask$OfInt-IA;
 Ljava/util/stream/Nodes$ToArrayTask$OfInt;
+Ljava/util/stream/Nodes$ToArrayTask$OfPrimitive-IA;
 Ljava/util/stream/Nodes$ToArrayTask$OfPrimitive;
+Ljava/util/stream/Nodes$ToArrayTask$OfRef-IA;
 Ljava/util/stream/Nodes$ToArrayTask$OfRef;
 Ljava/util/stream/Nodes$ToArrayTask;
 Ljava/util/stream/Nodes;
@@ -12392,7 +12234,6 @@
 Ljava/util/stream/ReduceOps$ReduceOp;
 Ljava/util/stream/ReduceOps;
 Ljava/util/stream/ReferencePipeline$$ExternalSyntheticLambda1;
-Ljava/util/stream/ReferencePipeline$$ExternalSyntheticLambda2;
 Ljava/util/stream/ReferencePipeline$2$1;
 Ljava/util/stream/ReferencePipeline$2;
 Ljava/util/stream/ReferencePipeline$3$1;
@@ -12440,6 +12281,7 @@
 Ljava/util/stream/StreamSupport;
 Ljava/util/stream/Streams$1;
 Ljava/util/stream/Streams$2;
+Ljava/util/stream/Streams$AbstractStreamBuilderImpl-IA;
 Ljava/util/stream/Streams$AbstractStreamBuilderImpl;
 Ljava/util/stream/Streams$ConcatSpliterator$OfRef;
 Ljava/util/stream/Streams$ConcatSpliterator;
@@ -12608,13 +12450,13 @@
 Ljdk/internal/math/FormattedFloatingDecimal$2;
 Ljdk/internal/math/FormattedFloatingDecimal$Form;
 Ljdk/internal/math/FormattedFloatingDecimal;
-Ljdk/internal/misc/JavaObjectInputStreamAccess;
-Ljdk/internal/misc/SharedSecrets;
 Ljdk/internal/misc/TerminatingThreadLocal$1;
 Ljdk/internal/misc/TerminatingThreadLocal;
 Ljdk/internal/misc/Unsafe;
 Ljdk/internal/misc/UnsafeConstants;
 Ljdk/internal/misc/VM;
+Ljdk/internal/ref/CleanerImpl$PhantomCleanableRef;
+Ljdk/internal/ref/PhantomCleanable;
 Ljdk/internal/reflect/Reflection;
 Ljdk/internal/util/ArraysSupport;
 Ljdk/internal/util/Preconditions;
@@ -12623,6 +12465,7 @@
 Llibcore/content/type/MimeMap$Builder$Element;
 Llibcore/content/type/MimeMap$Builder;
 Llibcore/content/type/MimeMap$MemoizingSupplier;
+Llibcore/content/type/MimeMap-IA;
 Llibcore/content/type/MimeMap;
 Llibcore/icu/CollationKeyICU;
 Llibcore/icu/DateIntervalFormat;
@@ -12653,7 +12496,6 @@
 Llibcore/io/NioBufferIterator;
 Llibcore/io/Os;
 Llibcore/io/Streams;
-Llibcore/math/MathUtils;
 Llibcore/math/NativeBN;
 Llibcore/net/InetAddressUtils;
 Llibcore/net/NetworkSecurityPolicy$DefaultNetworkSecurityPolicy;
@@ -12673,6 +12515,7 @@
 Llibcore/reflect/ListOfTypes;
 Llibcore/reflect/ListOfVariables;
 Llibcore/reflect/ParameterizedTypeImpl;
+Llibcore/reflect/RecordComponents;
 Llibcore/reflect/TypeVariableImpl;
 Llibcore/reflect/Types;
 Llibcore/reflect/WildcardTypeImpl;
@@ -12696,7 +12539,9 @@
 Lorg/apache/harmony/dalvik/ddmc/DdmVmInternal;
 Lorg/apache/harmony/xml/ExpatAttributes;
 Lorg/apache/harmony/xml/ExpatException;
+Lorg/apache/harmony/xml/ExpatParser$CurrentAttributes-IA;
 Lorg/apache/harmony/xml/ExpatParser$CurrentAttributes;
+Lorg/apache/harmony/xml/ExpatParser$ExpatLocator-IA;
 Lorg/apache/harmony/xml/ExpatParser$ExpatLocator;
 Lorg/apache/harmony/xml/ExpatParser$ParseException;
 Lorg/apache/harmony/xml/ExpatParser;
@@ -12785,9 +12630,7 @@
 Lsun/misc/CompoundEnumeration;
 Lsun/misc/HexDumpEncoder;
 Lsun/misc/IOUtils;
-Lsun/misc/JavaIOFileDescriptorAccess;
 Lsun/misc/LRUCache;
-Lsun/misc/SharedSecrets;
 Lsun/misc/Unsafe;
 Lsun/misc/VM;
 Lsun/misc/Version;
@@ -12816,6 +12659,7 @@
 Lsun/nio/ch/DefaultSelectorProvider;
 Lsun/nio/ch/DirectBuffer;
 Lsun/nio/ch/FileChannelImpl$SimpleFileLockTable;
+Lsun/nio/ch/FileChannelImpl$Unmapper-IA;
 Lsun/nio/ch/FileChannelImpl$Unmapper;
 Lsun/nio/ch/FileChannelImpl;
 Lsun/nio/ch/FileDescriptorHolderSocketImpl;
@@ -12902,6 +12746,7 @@
 Lsun/security/action/GetBooleanAction;
 Lsun/security/action/GetIntegerAction;
 Lsun/security/action/GetPropertyAction;
+Lsun/security/jca/GetInstance$Instance-IA;
 Lsun/security/jca/GetInstance$Instance;
 Lsun/security/jca/GetInstance;
 Lsun/security/jca/JCAUtil$CachedSecureRandomHolder;
@@ -12941,6 +12786,7 @@
 Lsun/security/provider/certpath/OCSP;
 Lsun/security/provider/certpath/OCSPResponse$1;
 Lsun/security/provider/certpath/OCSPResponse$ResponseStatus;
+Lsun/security/provider/certpath/OCSPResponse$SingleResponse-IA;
 Lsun/security/provider/certpath/OCSPResponse$SingleResponse;
 Lsun/security/provider/certpath/OCSPResponse;
 Lsun/security/provider/certpath/PKIX$ValidatorParams;
@@ -12952,6 +12798,7 @@
 Lsun/security/provider/certpath/RevocationChecker$1;
 Lsun/security/provider/certpath/RevocationChecker$2;
 Lsun/security/provider/certpath/RevocationChecker$Mode;
+Lsun/security/provider/certpath/RevocationChecker$RevocationProperties-IA;
 Lsun/security/provider/certpath/RevocationChecker$RevocationProperties;
 Lsun/security/provider/certpath/RevocationChecker;
 Lsun/security/timestamp/TimestampToken;
@@ -13081,9 +12928,12 @@
 Lsun/util/calendar/JulianCalendar;
 Lsun/util/calendar/LocalGregorianCalendar;
 Lsun/util/locale/BaseLocale$Cache;
+Lsun/util/locale/BaseLocale$Key-IA;
 Lsun/util/locale/BaseLocale$Key;
+Lsun/util/locale/BaseLocale-IA;
 Lsun/util/locale/BaseLocale;
 Lsun/util/locale/Extension;
+Lsun/util/locale/InternalLocaleBuilder$CaseInsensitiveChar-IA;
 Lsun/util/locale/InternalLocaleBuilder$CaseInsensitiveChar;
 Lsun/util/locale/InternalLocaleBuilder;
 Lsun/util/locale/LanguageTag;
@@ -13133,34 +12983,28 @@
 [Lcom/android/org/kxml2/io/KXmlParser$ValueContext;
 [Ldalvik/system/DexPathList$Element;
 [Ldalvik/system/DexPathList$NativeLibraryElement;
-[Ljava/io/Closeable;
 [Ljava/io/File$PathStatus;
 [Ljava/io/File;
-[Ljava/io/FileDescriptor;
-[Ljava/io/IOException;
 [Ljava/io/ObjectInputStream$HandleTable$HandleList;
 [Ljava/io/ObjectStreamClass$ClassDataSlot;
 [Ljava/io/ObjectStreamClass$MemberSignature;
 [Ljava/io/ObjectStreamField;
-[Ljava/io/Serializable;
-[Ljava/lang/Boolean;
 [Ljava/lang/Byte;
 [Ljava/lang/CharSequence;
 [Ljava/lang/Character$UnicodeBlock;
 [Ljava/lang/Character;
 [Ljava/lang/Class;
-[Ljava/lang/ClassLoader;
 [Ljava/lang/ClassValue$Entry;
 [Ljava/lang/Comparable;
 [Ljava/lang/Daemons$Daemon;
 [Ljava/lang/Double;
 [Ljava/lang/Enum;
-[Ljava/lang/Float;
 [Ljava/lang/Integer;
 [Ljava/lang/Long;
 [Ljava/lang/Number;
 [Ljava/lang/Object;
 [Ljava/lang/Package;
+[Ljava/lang/ProcessBuilder$Redirect;
 [Ljava/lang/Runnable;
 [Ljava/lang/Short;
 [Ljava/lang/StackTraceElement;
@@ -13172,24 +13016,28 @@
 [Ljava/lang/ThreadGroup;
 [Ljava/lang/ThreadLocal$ThreadLocalMap$Entry;
 [Ljava/lang/Throwable;
-[Ljava/lang/Void;
 [Ljava/lang/annotation/Annotation;
+[Ljava/lang/constant/ClassDesc;
+[Ljava/lang/constant/Constable;
+[Ljava/lang/constant/ConstantDesc;
+[Ljava/lang/constant/DirectMethodHandleDesc$Kind;
 [Ljava/lang/invoke/MethodHandle;
 [Ljava/lang/invoke/MethodType;
 [Ljava/lang/invoke/TypeDescriptor$OfField;
 [Ljava/lang/invoke/VarHandle$AccessMode;
 [Ljava/lang/invoke/VarHandle$AccessType;
+[Ljava/lang/invoke/VarHandle$VarHandleDesc$Kind;
 [Ljava/lang/ref/WeakReference;
 [Ljava/lang/reflect/AccessibleObject;
 [Ljava/lang/reflect/Constructor;
 [Ljava/lang/reflect/Field;
 [Ljava/lang/reflect/Method;
 [Ljava/lang/reflect/Parameter;
+[Ljava/lang/reflect/RecordComponent;
 [Ljava/lang/reflect/Type;
 [Ljava/lang/reflect/TypeVariable;
 [Ljava/math/BigDecimal;
 [Ljava/math/BigInteger;
-[Ljava/math/MathContext;
 [Ljava/math/RoundingMode;
 [Ljava/net/Authenticator$RequestorType;
 [Ljava/net/InetAddress;
@@ -13210,7 +13058,6 @@
 [Ljava/nio/file/attribute/FileAttribute;
 [Ljava/security/CodeSigner;
 [Ljava/security/CryptoPrimitive;
-[Ljava/security/MessageDigest;
 [Ljava/security/Permission;
 [Ljava/security/Principal;
 [Ljava/security/ProtectionDomain;
@@ -13223,10 +13070,8 @@
 [Ljava/security/cert/X509CRL;
 [Ljava/security/cert/X509Certificate;
 [Ljava/text/DateFormat$Field;
-[Ljava/text/DateFormat;
 [Ljava/text/Format;
 [Ljava/text/Normalizer$Form;
-[Ljava/time/Clock;
 [Ljava/time/DayOfWeek;
 [Ljava/time/LocalDateTime;
 [Ljava/time/LocalTime;
@@ -13246,12 +13091,10 @@
 [Ljava/time/zone/ZoneOffsetTransition;
 [Ljava/time/zone/ZoneOffsetTransitionRule$TimeDefinition;
 [Ljava/time/zone/ZoneOffsetTransitionRule;
-[Ljava/util/ArrayList;
 [Ljava/util/Comparators$NaturalOrderComparator;
 [Ljava/util/Enumeration;
 [Ljava/util/Formatter$Flags;
 [Ljava/util/HashMap$Node;
-[Ljava/util/HashMap;
 [Ljava/util/Hashtable$HashtableEntry;
 [Ljava/util/List;
 [Ljava/util/Locale$Category;
@@ -13259,9 +13102,7 @@
 [Ljava/util/Locale$IsoCountryCode;
 [Ljava/util/Locale;
 [Ljava/util/Map$Entry;
-[Ljava/util/Set;
 [Ljava/util/TimerTask;
-[Ljava/util/UUID;
 [Ljava/util/WeakHashMap$Entry;
 [Ljava/util/concurrent/ConcurrentHashMap$CounterCell;
 [Ljava/util/concurrent/ConcurrentHashMap$Node;
@@ -13286,7 +13127,6 @@
 [Ljavax/net/ssl/SSLEngineResult$Status;
 [Ljavax/net/ssl/TrustManager;
 [Ljavax/security/auth/callback/Callback;
-[Ljavax/security/auth/x500/X500Principal;
 [Ljavax/security/cert/X509Certificate;
 [Ljdk/internal/math/FDBigInteger;
 [Ljdk/internal/math/FormattedFloatingDecimal$Form;
@@ -13304,6 +13144,7 @@
 [Lsun/security/provider/certpath/OCSP$RevocationStatus$CertStatus;
 [Lsun/security/provider/certpath/OCSPResponse$ResponseStatus;
 [Lsun/security/provider/certpath/RevocationChecker$Mode;
+[Lsun/security/util/DerEncoder;
 [Lsun/security/util/DerOutputStream;
 [Lsun/security/util/DerValue;
 [Lsun/security/util/DisabledAlgorithmConstraints$Constraint$Operator;
@@ -13317,22 +13158,14 @@
 [S
 [Z
 [[B
-[[C
 [[D
-[[F
 [[I
 [[J
 [[Ljava/lang/Byte;
 [[Ljava/lang/Class;
-[[Ljava/lang/Long;
 [[Ljava/lang/Object;
 [[Ljava/lang/String;
 [[Ljava/lang/annotation/Annotation;
 [[Ljava/lang/invoke/MethodHandle;
 [[Ljava/math/BigInteger;
-[[Ljava/security/cert/Certificate;
-[[Ljava/security/cert/X509Certificate;
-[[S
 [[Z
-[[[B
-[[[I
diff --git a/build/boot/preloaded-classes b/build/boot/preloaded-classes
index 2264b95..0e338bb 100644
--- a/build/boot/preloaded-classes
+++ b/build/boot/preloaded-classes
@@ -204,7 +204,6 @@
 com.android.okhttp.okio.Timeout
 com.android.okhttp.okio.Util
 com.android.org.bouncycastle.asn1.ASN1ApplicationSpecific
-com.android.org.bouncycastle.asn1.ASN1ApplicationSpecificParser
 com.android.org.bouncycastle.asn1.ASN1BitString
 com.android.org.bouncycastle.asn1.ASN1Boolean
 com.android.org.bouncycastle.asn1.ASN1Choice
@@ -216,7 +215,6 @@
 com.android.org.bouncycastle.asn1.ASN1GeneralizedTime
 com.android.org.bouncycastle.asn1.ASN1InputStream
 com.android.org.bouncycastle.asn1.ASN1Integer
-com.android.org.bouncycastle.asn1.ASN1Null
 com.android.org.bouncycastle.asn1.ASN1Object
 com.android.org.bouncycastle.asn1.ASN1ObjectIdentifier$OidHandle
 com.android.org.bouncycastle.asn1.ASN1ObjectIdentifier
@@ -233,7 +231,6 @@
 com.android.org.bouncycastle.asn1.ASN1StreamParser
 com.android.org.bouncycastle.asn1.ASN1String
 com.android.org.bouncycastle.asn1.ASN1TaggedObject
-com.android.org.bouncycastle.asn1.ASN1TaggedObjectParser
 com.android.org.bouncycastle.asn1.ASN1UTCTime
 com.android.org.bouncycastle.asn1.BERApplicationSpecific
 com.android.org.bouncycastle.asn1.BERApplicationSpecificParser
@@ -244,16 +241,13 @@
 com.android.org.bouncycastle.asn1.BERSet
 com.android.org.bouncycastle.asn1.BERSetParser
 com.android.org.bouncycastle.asn1.BERTaggedObjectParser
-com.android.org.bouncycastle.asn1.BERTags
 com.android.org.bouncycastle.asn1.ConstructedOctetStream
 com.android.org.bouncycastle.asn1.DERBMPString
 com.android.org.bouncycastle.asn1.DERBitString
 com.android.org.bouncycastle.asn1.DERExternalParser
-com.android.org.bouncycastle.asn1.DERFactory
 com.android.org.bouncycastle.asn1.DERGeneralString
 com.android.org.bouncycastle.asn1.DERGraphicString
 com.android.org.bouncycastle.asn1.DERIA5String
-com.android.org.bouncycastle.asn1.DERInteger
 com.android.org.bouncycastle.asn1.DERNull
 com.android.org.bouncycastle.asn1.DERNumericString
 com.android.org.bouncycastle.asn1.DEROctetString
@@ -278,16 +272,13 @@
 com.android.org.bouncycastle.asn1.IndefiniteLengthInputStream
 com.android.org.bouncycastle.asn1.LazyEncodedSequence
 com.android.org.bouncycastle.asn1.LimitedInputStream
-com.android.org.bouncycastle.asn1.OIDTokenizer
 com.android.org.bouncycastle.asn1.StreamUtil
 com.android.org.bouncycastle.asn1.bc.BCObjectIdentifiers
-com.android.org.bouncycastle.asn1.iana.IANAObjectIdentifiers
 com.android.org.bouncycastle.asn1.misc.MiscObjectIdentifiers
 com.android.org.bouncycastle.asn1.nist.NISTObjectIdentifiers
 com.android.org.bouncycastle.asn1.oiw.OIWObjectIdentifiers
 com.android.org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers
 com.android.org.bouncycastle.asn1.x500.X500Name
-com.android.org.bouncycastle.asn1.x500.X500NameStyle
 com.android.org.bouncycastle.asn1.x500.style.AbstractX500NameStyle
 com.android.org.bouncycastle.asn1.x500.style.BCStyle
 com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier
@@ -295,8 +286,6 @@
 com.android.org.bouncycastle.asn1.x509.DSAParameter
 com.android.org.bouncycastle.asn1.x509.SubjectPublicKeyInfo
 com.android.org.bouncycastle.asn1.x509.Time
-com.android.org.bouncycastle.asn1.x509.V3TBSCertificateGenerator
-com.android.org.bouncycastle.asn1.x509.X509ExtensionsGenerator
 com.android.org.bouncycastle.asn1.x509.X509Name
 com.android.org.bouncycastle.asn1.x509.X509ObjectIdentifiers
 com.android.org.bouncycastle.asn1.x9.X9ECParameters
@@ -319,7 +308,6 @@
 com.android.org.bouncycastle.crypto.Wrapper
 com.android.org.bouncycastle.crypto.digests.AndroidDigestFactory
 com.android.org.bouncycastle.crypto.digests.AndroidDigestFactoryBouncyCastle
-com.android.org.bouncycastle.crypto.digests.AndroidDigestFactoryInterface
 com.android.org.bouncycastle.crypto.digests.AndroidDigestFactoryOpenSSL
 com.android.org.bouncycastle.crypto.digests.EncodableDigest
 com.android.org.bouncycastle.crypto.digests.GeneralDigest
@@ -335,7 +323,6 @@
 com.android.org.bouncycastle.crypto.generators.PKCS5S2ParametersGenerator
 com.android.org.bouncycastle.crypto.io.MacInputStream
 com.android.org.bouncycastle.crypto.macs.HMac
-com.android.org.bouncycastle.crypto.modes.AEADCipher
 com.android.org.bouncycastle.crypto.modes.CBCBlockCipher
 com.android.org.bouncycastle.crypto.paddings.BlockCipherPadding
 com.android.org.bouncycastle.crypto.paddings.PKCS7Padding
@@ -351,25 +338,17 @@
 com.android.org.bouncycastle.crypto.params.KeyParameter
 com.android.org.bouncycastle.crypto.params.ParametersWithIV
 com.android.org.bouncycastle.crypto.params.ParametersWithRandom
-com.android.org.bouncycastle.jcajce.PBKDFKey
 com.android.org.bouncycastle.jcajce.PKCS12Key
-com.android.org.bouncycastle.jcajce.PKCS12KeyWithParameters
 com.android.org.bouncycastle.jcajce.provider.asymmetric.DH$Mappings
 com.android.org.bouncycastle.jcajce.provider.asymmetric.DH
 com.android.org.bouncycastle.jcajce.provider.asymmetric.DSA$Mappings
-com.android.org.bouncycastle.jcajce.provider.asymmetric.EC$Mappings
-com.android.org.bouncycastle.jcajce.provider.asymmetric.EC
 com.android.org.bouncycastle.jcajce.provider.asymmetric.RSA$Mappings
 com.android.org.bouncycastle.jcajce.provider.asymmetric.RSA
-com.android.org.bouncycastle.jcajce.provider.asymmetric.X509$Mappings
 com.android.org.bouncycastle.jcajce.provider.asymmetric.dh.KeyFactorySpi
 com.android.org.bouncycastle.jcajce.provider.asymmetric.dsa.BCDSAPublicKey
 com.android.org.bouncycastle.jcajce.provider.asymmetric.dsa.DSAUtil
 com.android.org.bouncycastle.jcajce.provider.asymmetric.dsa.KeyFactorySpi
-com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.KeyFactorySpi$EC
-com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.KeyFactorySpi
 com.android.org.bouncycastle.jcajce.provider.asymmetric.rsa.CipherSpi$NoPadding
-com.android.org.bouncycastle.jcajce.provider.asymmetric.rsa.CipherSpi
 com.android.org.bouncycastle.jcajce.provider.asymmetric.rsa.KeyFactorySpi
 com.android.org.bouncycastle.jcajce.provider.asymmetric.rsa.RSAUtil
 com.android.org.bouncycastle.jcajce.provider.asymmetric.util.BaseCipherSpi
@@ -382,8 +361,6 @@
 com.android.org.bouncycastle.jcajce.provider.config.ProviderConfiguration
 com.android.org.bouncycastle.jcajce.provider.config.ProviderConfigurationPermission
 com.android.org.bouncycastle.jcajce.provider.digest.DigestAlgorithmProvider
-com.android.org.bouncycastle.jcajce.provider.digest.MD5$Mappings
-com.android.org.bouncycastle.jcajce.provider.digest.MD5
 com.android.org.bouncycastle.jcajce.provider.digest.SHA1$Mappings
 com.android.org.bouncycastle.jcajce.provider.digest.SHA1
 com.android.org.bouncycastle.jcajce.provider.digest.SHA224$Mappings
@@ -399,7 +376,6 @@
 com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi$Std
 com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi$StoreEntry
 com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi
-com.android.org.bouncycastle.jcajce.provider.symmetric.AES$ECB$1
 com.android.org.bouncycastle.jcajce.provider.symmetric.AES$ECB
 com.android.org.bouncycastle.jcajce.provider.symmetric.AES$Mappings
 com.android.org.bouncycastle.jcajce.provider.symmetric.AES
@@ -434,7 +410,6 @@
 com.android.org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher$ErasableOutputStream
 com.android.org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher$InvalidKeyOrParametersException
 com.android.org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher
-com.android.org.bouncycastle.jcajce.provider.symmetric.util.BlockCipherProvider
 com.android.org.bouncycastle.jcajce.provider.symmetric.util.ClassUtil
 com.android.org.bouncycastle.jcajce.provider.symmetric.util.GcmSpecUtil$2
 com.android.org.bouncycastle.jcajce.provider.symmetric.util.GcmSpecUtil
@@ -444,39 +419,29 @@
 com.android.org.bouncycastle.jcajce.provider.util.AsymmetricAlgorithmProvider
 com.android.org.bouncycastle.jcajce.provider.util.AsymmetricKeyInfoConverter
 com.android.org.bouncycastle.jcajce.provider.util.DigestFactory
-com.android.org.bouncycastle.jcajce.spec.AEADParameterSpec
 com.android.org.bouncycastle.jcajce.spec.PBKDF2KeySpec
 com.android.org.bouncycastle.jcajce.util.BCJcaJceHelper
 com.android.org.bouncycastle.jcajce.util.DefaultJcaJceHelper
 com.android.org.bouncycastle.jcajce.util.JcaJceHelper
-com.android.org.bouncycastle.jcajce.util.ProviderJcaJceHelper
 com.android.org.bouncycastle.jce.X509Principal
-com.android.org.bouncycastle.jce.interfaces.BCKeyStore
 com.android.org.bouncycastle.jce.interfaces.PKCS12BagAttributeCarrier
 com.android.org.bouncycastle.jce.provider.BouncyCastleProvider$1
 com.android.org.bouncycastle.jce.provider.BouncyCastleProvider$PrivateProvider
 com.android.org.bouncycastle.jce.provider.BouncyCastleProvider
 com.android.org.bouncycastle.jce.provider.BouncyCastleProviderConfiguration
 com.android.org.bouncycastle.jce.provider.CertStoreCollectionSpi
-com.android.org.bouncycastle.jce.provider.X509CertificateObject
-com.android.org.bouncycastle.jce.spec.ECKeySpec
-com.android.org.bouncycastle.jce.spec.ECPublicKeySpec
 com.android.org.bouncycastle.util.Arrays
 com.android.org.bouncycastle.util.BigIntegers
-com.android.org.bouncycastle.util.Encodable
 com.android.org.bouncycastle.util.Integers
-com.android.org.bouncycastle.util.Iterable
 com.android.org.bouncycastle.util.Memoable
 com.android.org.bouncycastle.util.Pack
 com.android.org.bouncycastle.util.Properties$1
 com.android.org.bouncycastle.util.Properties
 com.android.org.bouncycastle.util.Strings$1
 com.android.org.bouncycastle.util.Strings
-com.android.org.bouncycastle.util.encoders.Encoder
 com.android.org.bouncycastle.util.encoders.Hex
 com.android.org.bouncycastle.util.encoders.HexEncoder
 com.android.org.bouncycastle.util.io.Streams
-com.android.org.bouncycastle.x509.X509V3CertificateGenerator
 com.android.org.kxml2.io.KXmlParser$ContentSource
 com.android.org.kxml2.io.KXmlParser$ValueContext
 com.android.org.kxml2.io.KXmlParser
@@ -602,6 +567,7 @@
 java.io.ObjectOutputStream$ReplaceTable
 java.io.ObjectOutputStream
 java.io.ObjectStreamClass$$ExternalSyntheticLambda0
+java.io.ObjectStreamClass$$ExternalSyntheticLambda1
 java.io.ObjectStreamClass$1
 java.io.ObjectStreamClass$2
 java.io.ObjectStreamClass$3
@@ -610,6 +576,7 @@
 java.io.ObjectStreamClass$Caches
 java.io.ObjectStreamClass$ClassDataSlot
 java.io.ObjectStreamClass$DefaultSUIDCompatibilityListener
+java.io.ObjectStreamClass$DeserializationConstructorsCache
 java.io.ObjectStreamClass$EntryFuture$1
 java.io.ObjectStreamClass$EntryFuture
 java.io.ObjectStreamClass$ExceptionInfo
@@ -640,6 +607,7 @@
 java.io.StringBufferInputStream
 java.io.StringReader
 java.io.StringWriter
+java.io.SyncFailedException
 java.io.UTFDataFormatException
 java.io.UncheckedIOException
 java.io.UnixFileSystem
@@ -747,6 +715,7 @@
 java.lang.ProcessEnvironment
 java.lang.ProcessImpl
 java.lang.Readable
+java.lang.Record
 java.lang.ReflectiveOperationException
 java.lang.Runnable
 java.lang.Runtime
@@ -827,6 +796,24 @@
 java.lang.annotation.Inherited
 java.lang.annotation.Retention
 java.lang.annotation.Target
+java.lang.constant.ClassDesc
+java.lang.constant.Constable
+java.lang.constant.ConstantDesc
+java.lang.constant.ConstantDescs
+java.lang.constant.ConstantUtils
+java.lang.constant.DirectMethodHandleDesc$1
+java.lang.constant.DirectMethodHandleDesc$Kind
+java.lang.constant.DirectMethodHandleDesc
+java.lang.constant.DirectMethodHandleDescImpl$1
+java.lang.constant.DirectMethodHandleDescImpl
+java.lang.constant.DynamicConstantDesc$AnonymousDynamicConstantDesc
+java.lang.constant.DynamicConstantDesc
+java.lang.constant.MethodHandleDesc$1
+java.lang.constant.MethodHandleDesc
+java.lang.constant.MethodTypeDesc
+java.lang.constant.MethodTypeDescImpl
+java.lang.constant.PrimitiveClassDescImpl
+java.lang.constant.ReferenceClassDescImpl
 java.lang.invoke.ArrayElementVarHandle
 java.lang.invoke.ByteArrayViewVarHandle
 java.lang.invoke.ByteBufferViewVarHandle
@@ -903,8 +890,10 @@
 java.lang.invoke.VarHandle$1
 java.lang.invoke.VarHandle$AccessMode
 java.lang.invoke.VarHandle$AccessType
+java.lang.invoke.VarHandle$VarHandleDesc$Kind
 java.lang.invoke.VarHandle
 java.lang.invoke.WrongMethodTypeException
+java.lang.ref.Cleaner$Cleanable
 java.lang.ref.FinalizerReference$Sentinel-IA
 java.lang.ref.FinalizerReference$Sentinel
 java.lang.ref.FinalizerReference
@@ -943,6 +932,7 @@
 java.lang.reflect.Proxy$ProxyClassFactory-IA
 java.lang.reflect.Proxy$ProxyClassFactory
 java.lang.reflect.Proxy
+java.lang.reflect.RecordComponent
 java.lang.reflect.ReflectPermission
 java.lang.reflect.Type
 java.lang.reflect.TypeVariable
@@ -1713,7 +1703,6 @@
 java.util.LinkedHashMap$LinkedEntryIterator
 java.util.LinkedHashMap$LinkedEntrySet
 java.util.LinkedHashMap$LinkedHashIterator
-java.util.LinkedHashMap$LinkedHashMapEntry
 java.util.LinkedHashMap$LinkedKeyIterator
 java.util.LinkedHashMap$LinkedKeySet
 java.util.LinkedHashMap$LinkedValueIterator
@@ -1785,7 +1774,6 @@
 java.util.Scanner
 java.util.ServiceConfigurationError
 java.util.ServiceLoader$1
-java.util.ServiceLoader$LazyIterator
 java.util.ServiceLoader
 java.util.Set
 java.util.SimpleTimeZone$Cache
@@ -1812,7 +1800,6 @@
 java.util.TaskQueue
 java.util.TimSort
 java.util.TimeZone
-java.util.Timer$1
 java.util.Timer
 java.util.TimerTask
 java.util.TimerThread
@@ -2211,10 +2198,6 @@
 java.util.stream.DoublePipeline$StatelessOp
 java.util.stream.DoublePipeline
 java.util.stream.DoubleStream
-java.util.stream.FindOps$$ExternalSyntheticLambda0
-java.util.stream.FindOps$$ExternalSyntheticLambda4
-java.util.stream.FindOps$$ExternalSyntheticLambda5
-java.util.stream.FindOps$$ExternalSyntheticLambda7
 java.util.stream.FindOps$FindOp
 java.util.stream.FindOps$FindSink$OfInt
 java.util.stream.FindOps$FindSink$OfRef
@@ -2225,13 +2208,11 @@
 java.util.stream.ForEachOps$ForEachOp
 java.util.stream.ForEachOps
 java.util.stream.IntPipeline$$ExternalSyntheticLambda0
-java.util.stream.IntPipeline$$ExternalSyntheticLambda13
 java.util.stream.IntPipeline$$ExternalSyntheticLambda1
 java.util.stream.IntPipeline$$ExternalSyntheticLambda7
 java.util.stream.IntPipeline$$ExternalSyntheticLambda8
 java.util.stream.IntPipeline$4$1
 java.util.stream.IntPipeline$4
-java.util.stream.IntPipeline$9$1
 java.util.stream.IntPipeline$9
 java.util.stream.IntPipeline$Head
 java.util.stream.IntPipeline$StatelessOp
@@ -2294,7 +2275,6 @@
 java.util.stream.ReduceOps$ReduceOp
 java.util.stream.ReduceOps
 java.util.stream.ReferencePipeline$$ExternalSyntheticLambda1
-java.util.stream.ReferencePipeline$$ExternalSyntheticLambda2
 java.util.stream.ReferencePipeline$2$1
 java.util.stream.ReferencePipeline$2
 java.util.stream.ReferencePipeline$3$1
@@ -2509,13 +2489,13 @@
 jdk.internal.math.FormattedFloatingDecimal$2
 jdk.internal.math.FormattedFloatingDecimal$Form
 jdk.internal.math.FormattedFloatingDecimal
-jdk.internal.misc.JavaObjectInputStreamAccess
-jdk.internal.misc.SharedSecrets
 jdk.internal.misc.TerminatingThreadLocal$1
 jdk.internal.misc.TerminatingThreadLocal
 jdk.internal.misc.Unsafe
 jdk.internal.misc.UnsafeConstants
 jdk.internal.misc.VM
+jdk.internal.ref.CleanerImpl$PhantomCleanableRef
+jdk.internal.ref.PhantomCleanable
 jdk.internal.reflect.Reflection
 jdk.internal.util.ArraysSupport
 jdk.internal.util.Preconditions
@@ -2554,7 +2534,6 @@
 libcore.io.NioBufferIterator
 libcore.io.Os
 libcore.io.Streams
-libcore.math.MathUtils
 libcore.math.NativeBN
 libcore.net.InetAddressUtils
 libcore.net.NetworkSecurityPolicy$DefaultNetworkSecurityPolicy
@@ -2574,6 +2553,7 @@
 libcore.reflect.ListOfTypes
 libcore.reflect.ListOfVariables
 libcore.reflect.ParameterizedTypeImpl
+libcore.reflect.RecordComponents
 libcore.reflect.TypeVariableImpl
 libcore.reflect.Types
 libcore.reflect.WildcardTypeImpl
@@ -2686,9 +2666,7 @@
 sun.misc.CompoundEnumeration
 sun.misc.HexDumpEncoder
 sun.misc.IOUtils
-sun.misc.JavaIOFileDescriptorAccess
 sun.misc.LRUCache
-sun.misc.SharedSecrets
 sun.misc.Unsafe
 sun.misc.VM
 sun.misc.Version
@@ -3033,29 +3011,22 @@
 [Lcom.android.org.kxml2.io.KXmlParser$ValueContext;
 [Ldalvik.system.DexPathList$Element;
 [Ldalvik.system.DexPathList$NativeLibraryElement;
-[Ljava.io.Closeable;
 [Ljava.io.File$PathStatus;
 [Ljava.io.File;
-[Ljava.io.FileDescriptor;
-[Ljava.io.IOException;
 [Ljava.io.ObjectInputStream$HandleTable$HandleList;
 [Ljava.io.ObjectStreamClass$ClassDataSlot;
 [Ljava.io.ObjectStreamClass$MemberSignature;
 [Ljava.io.ObjectStreamField;
-[Ljava.io.Serializable;
-[Ljava.lang.Boolean;
 [Ljava.lang.Byte;
 [Ljava.lang.CharSequence;
 [Ljava.lang.Character$UnicodeBlock;
 [Ljava.lang.Character;
 [Ljava.lang.Class;
-[Ljava.lang.ClassLoader;
 [Ljava.lang.ClassValue$Entry;
 [Ljava.lang.Comparable;
 [Ljava.lang.Daemons$Daemon;
 [Ljava.lang.Double;
 [Ljava.lang.Enum;
-[Ljava.lang.Float;
 [Ljava.lang.Integer;
 [Ljava.lang.Long;
 [Ljava.lang.Number;
@@ -3072,24 +3043,28 @@
 [Ljava.lang.ThreadGroup;
 [Ljava.lang.ThreadLocal$ThreadLocalMap$Entry;
 [Ljava.lang.Throwable;
-[Ljava.lang.Void;
 [Ljava.lang.annotation.Annotation;
+[Ljava.lang.constant.ClassDesc;
+[Ljava.lang.constant.Constable;
+[Ljava.lang.constant.ConstantDesc;
+[Ljava.lang.constant.DirectMethodHandleDesc$Kind;
 [Ljava.lang.invoke.MethodHandle;
 [Ljava.lang.invoke.MethodType;
 [Ljava.lang.invoke.TypeDescriptor$OfField;
 [Ljava.lang.invoke.VarHandle$AccessMode;
 [Ljava.lang.invoke.VarHandle$AccessType;
+[Ljava.lang.invoke.VarHandle$VarHandleDesc$Kind;
 [Ljava.lang.ref.WeakReference;
 [Ljava.lang.reflect.AccessibleObject;
 [Ljava.lang.reflect.Constructor;
 [Ljava.lang.reflect.Field;
 [Ljava.lang.reflect.Method;
 [Ljava.lang.reflect.Parameter;
+[Ljava.lang.reflect.RecordComponent;
 [Ljava.lang.reflect.Type;
 [Ljava.lang.reflect.TypeVariable;
 [Ljava.math.BigDecimal;
 [Ljava.math.BigInteger;
-[Ljava.math.MathContext;
 [Ljava.math.RoundingMode;
 [Ljava.net.Authenticator$RequestorType;
 [Ljava.net.InetAddress;
@@ -3110,7 +3085,6 @@
 [Ljava.nio.file.attribute.FileAttribute;
 [Ljava.security.CodeSigner;
 [Ljava.security.CryptoPrimitive;
-[Ljava.security.MessageDigest;
 [Ljava.security.Permission;
 [Ljava.security.Principal;
 [Ljava.security.ProtectionDomain;
@@ -3123,10 +3097,8 @@
 [Ljava.security.cert.X509CRL;
 [Ljava.security.cert.X509Certificate;
 [Ljava.text.DateFormat$Field;
-[Ljava.text.DateFormat;
 [Ljava.text.Format;
 [Ljava.text.Normalizer$Form;
-[Ljava.time.Clock;
 [Ljava.time.DayOfWeek;
 [Ljava.time.LocalDateTime;
 [Ljava.time.LocalTime;
@@ -3146,12 +3118,10 @@
 [Ljava.time.zone.ZoneOffsetTransition;
 [Ljava.time.zone.ZoneOffsetTransitionRule$TimeDefinition;
 [Ljava.time.zone.ZoneOffsetTransitionRule;
-[Ljava.util.ArrayList;
 [Ljava.util.Comparators$NaturalOrderComparator;
 [Ljava.util.Enumeration;
 [Ljava.util.Formatter$Flags;
 [Ljava.util.HashMap$Node;
-[Ljava.util.HashMap;
 [Ljava.util.Hashtable$HashtableEntry;
 [Ljava.util.List;
 [Ljava.util.Locale$Category;
@@ -3159,9 +3129,7 @@
 [Ljava.util.Locale$IsoCountryCode;
 [Ljava.util.Locale;
 [Ljava.util.Map$Entry;
-[Ljava.util.Set;
 [Ljava.util.TimerTask;
-[Ljava.util.UUID;
 [Ljava.util.WeakHashMap$Entry;
 [Ljava.util.concurrent.ConcurrentHashMap$CounterCell;
 [Ljava.util.concurrent.ConcurrentHashMap$Node;
@@ -3186,7 +3154,6 @@
 [Ljavax.net.ssl.SSLEngineResult$Status;
 [Ljavax.net.ssl.TrustManager;
 [Ljavax.security.auth.callback.Callback;
-[Ljavax.security.auth.x500.X500Principal;
 [Ljavax.security.cert.X509Certificate;
 [Ljdk.internal.math.FDBigInteger;
 [Ljdk.internal.math.FormattedFloatingDecimal$Form;
@@ -3217,22 +3184,14 @@
 [S
 [Z
 [[B
-[[C
 [[D
-[[F
 [[I
 [[J
 [[Ljava.lang.Byte;
 [[Ljava.lang.Class;
-[[Ljava.lang.Long;
 [[Ljava.lang.Object;
 [[Ljava.lang.String;
 [[Ljava.lang.annotation.Annotation;
 [[Ljava.lang.invoke.MethodHandle;
 [[Ljava.math.BigInteger;
-[[Ljava.security.cert.Certificate;
-[[Ljava.security.cert.X509Certificate;
-[[S
 [[Z
-[[[B
-[[[I
diff --git a/build/go.work b/build/go.work
index f3a0829..f5f427e 100644
--- a/build/go.work
+++ b/build/go.work
@@ -4,8 +4,6 @@
 	.
 	../../external/go-cmp
 	../../external/golang-protobuf
-	../../prebuilts/bazel/common/proto/analysis_v2
-	../../prebuilts/bazel/common/proto/build
 	../../build/blueprint
 	../../build/soong
 )
@@ -15,7 +13,5 @@
 	github.com/google/blueprint v0.0.0 => ../../build/blueprint
 	github.com/google/go-cmp v0.0.0 => ../../external/go-cmp
 	google.golang.org/protobuf v0.0.0 => ../../external/golang-protobuf
-	prebuilts/bazel/common/proto/analysis_v2 v0.0.0 => ../../prebuilts/bazel/common/proto/analysis_v2
-	prebuilts/bazel/common/proto/build v0.0.0 => ../../prebuilts/bazel/common/proto/build
 	android/soong v0.0.0 => ../../build/soong
 )
diff --git a/build/makevars.go b/build/makevars.go
index cc8b9cd..00124ec 100644
--- a/build/makevars.go
+++ b/build/makevars.go
@@ -34,7 +34,7 @@
 		"bin/llvm-addr2line",
 		"bin/llvm-dwarfdump",
 		"bin/llvm-objdump",
-		"lib/libc++.so.1",
+		"lib/libc++.so",
 	}
 )
 
@@ -56,7 +56,7 @@
 	sort.Strings(testNames)
 
 	for _, name := range testNames {
-		ctx.Strict("ART_TEST_LIST_"+name, strings.Join(testMap[name], " "))
+		ctx.Strict("ART_TEST_LIST_"+name, strings.Join(android.FirstUniqueStrings(testMap[name]), " "))
 	}
 
 	// Create list of copy commands to install the content of the testcases directory.
diff --git a/cmdline/cmdline.h b/cmdline/cmdline.h
index b8ca7d0..958f80d 100644
--- a/cmdline/cmdline.h
+++ b/cmdline/cmdline.h
@@ -22,16 +22,20 @@
 
 #include <fstream>
 #include <iostream>
+#include <memory>
 #include <string>
 #include <string_view>
+#include <vector>
 
 #include "android-base/stringprintf.h"
-
+#include "android-base/strings.h"
 #include "base/file_utils.h"
 #include "base/logging.h"
 #include "base/mutex.h"
 #include "base/string_view_cpp20.h"
+#include "base/utils.h"
 #include "noop_compiler_callbacks.h"
+#include "oat/oat_file_assistant_context.h"
 #include "runtime.h"
 
 #if !defined(NDEBUG)
@@ -42,55 +46,9 @@
 
 namespace art {
 
-// TODO: Move to <runtime/utils.h> and remove all copies of this function.
-static bool LocationToFilename(const std::string& location, InstructionSet isa,
-                               std::string* filename) {
-  bool has_system = false;
-  bool has_cache = false;
-  // image_location = /system/framework/boot.art
-  // system_image_filename = /system/framework/<image_isa>/boot.art
-  std::string system_filename(GetSystemImageFilename(location.c_str(), isa));
-  if (OS::FileExists(system_filename.c_str())) {
-    has_system = true;
-  }
-
-  bool have_android_data = false;
-  bool dalvik_cache_exists = false;
-  bool is_global_cache = false;
-  std::string dalvik_cache;
-  GetDalvikCache(GetInstructionSetString(isa), false, &dalvik_cache,
-                 &have_android_data, &dalvik_cache_exists, &is_global_cache);
-
-  std::string cache_filename;
-  if (have_android_data && dalvik_cache_exists) {
-    // Always set output location even if it does not exist,
-    // so that the caller knows where to create the image.
-    //
-    // image_location = /system/framework/boot.art
-    // *image_filename = /data/dalvik-cache/<image_isa>/boot.art
-    std::string error_msg;
-    if (GetDalvikCacheFilename(location.c_str(), dalvik_cache.c_str(),
-                               &cache_filename, &error_msg)) {
-      has_cache = true;
-    }
-  }
-  if (has_system) {
-    *filename = system_filename;
-    return true;
-  } else if (has_cache) {
-    *filename = cache_filename;
-    return true;
-  } else {
-    *filename = system_filename;
-    return false;
-  }
-}
-
-static Runtime* StartRuntime(const char* boot_image_location,
+static Runtime* StartRuntime(const std::vector<std::string>& boot_image_locations,
                              InstructionSet instruction_set,
                              const std::vector<const char*>& runtime_args) {
-  CHECK(boot_image_location != nullptr);
-
   RuntimeOptions options;
 
   // We are more like a compiler than a run-time. We don't want to execute code.
@@ -101,9 +59,12 @@
 
   // Boot image location.
   {
-    std::string boot_image_option;
-    boot_image_option += "-Ximage:";
-    boot_image_option += boot_image_location;
+    std::string boot_image_option = "-Ximage:";
+    if (!boot_image_locations.empty()) {
+      boot_image_option += android::base::Join(boot_image_locations, ':');
+    } else {
+      boot_image_option += GetJitZygoteBootImageLocation();
+    }
     options.push_back(std::make_pair(boot_image_option, nullptr));
   }
 
@@ -155,7 +116,7 @@
       const char* const raw_option = argv[i];
       const std::string_view option(raw_option);
       if (StartsWith(option, "--boot-image=")) {
-        boot_image_location_ = raw_option + strlen("--boot-image=");
+        Split(raw_option + strlen("--boot-image="), ':', &boot_image_locations_);
       } else if (StartsWith(option, "--instruction-set=")) {
         const char* const instruction_set_str = raw_option + strlen("--instruction-set=");
         instruction_set_ = GetInstructionSetFromString(instruction_set_str);
@@ -197,6 +158,11 @@
       }
     }
 
+    if (instruction_set_ == InstructionSet::kNone) {
+      LOG(WARNING) << "No instruction set given, assuming " << GetInstructionSetString(kRuntimeISA);
+      instruction_set_ = kRuntimeISA;
+    }
+
     DBG_LOG << "will call parse checks";
 
     {
@@ -241,8 +207,14 @@
     return usage;
   }
 
-  // Specified by --boot-image.
-  const char* boot_image_location_ = nullptr;
+  // Specified by --runtime-arg -Xbootclasspath or default.
+  std::vector<std::string> boot_class_path_;
+  // Specified by --runtime-arg -Xbootclasspath-locations or default.
+  std::vector<std::string> boot_class_path_locations_;
+  // True if `boot_class_path_` is the default one.
+  bool is_default_boot_class_path_ = false;
+  // Specified by --boot-image or inferred.
+  std::vector<std::string> boot_image_locations_;
   // Specified by --instruction-set.
   InstructionSet instruction_set_ = InstructionSet::kNone;
   // Runtime arguments specified by --runtime-arg.
@@ -254,82 +226,141 @@
 
   virtual ~CmdlineArgs() {}
 
+  // Checks for --boot-image location.
   bool ParseCheckBootImage(std::string* error_msg) {
-    if (boot_image_location_ == nullptr) {
-      *error_msg = "--boot-image must be specified";
+    if (boot_image_locations_.empty()) {
+      LOG(WARNING) << "--boot-image not specified. Starting runtime in imageless mode";
+      return true;
+    }
+
+    const std::string& boot_image_location = boot_image_locations_[0];
+    size_t file_name_idx = boot_image_location.rfind('/');
+    if (file_name_idx == std::string::npos) {  // Prevent a InsertIsaDirectory check failure.
+      *error_msg = "Boot image location must have a / in it";
       return false;
     }
-    if (instruction_set_ == InstructionSet::kNone) {
-      LOG(WARNING) << "No instruction set given, assuming " << GetInstructionSetString(kRuntimeISA);
-      instruction_set_ = kRuntimeISA;
-    }
 
-    DBG_LOG << "boot image location: " << boot_image_location_;
+    // Don't let image locations with the 'arch' in it through, since it's not a location.
+    // This prevents a common error "Could not create an image space..." when initing the Runtime.
+    if (file_name_idx > 0) {
+      size_t ancestor_dirs_idx = boot_image_location.rfind('/', file_name_idx - 1);
 
-    // Checks for --boot-image location.
-    {
-      std::string boot_image_location = boot_image_location_;
-      size_t separator_pos = boot_image_location.find(':');
-      if (separator_pos != std::string::npos) {
-        boot_image_location = boot_image_location.substr(/*pos*/ 0u, /*size*/ separator_pos);
-      }
-      size_t file_name_idx = boot_image_location.rfind('/');
-      if (file_name_idx == std::string::npos) {  // Prevent a InsertIsaDirectory check failure.
-        *error_msg = "Boot image location must have a / in it";
-        return false;
+      std::string parent_dir_name;
+      if (ancestor_dirs_idx != std::string::npos) {
+          parent_dir_name = boot_image_location.substr(/*pos=*/ancestor_dirs_idx + 1,
+                                                       /*n=*/file_name_idx - ancestor_dirs_idx - 1);
+      } else {
+          parent_dir_name = boot_image_location.substr(/*pos=*/0,
+                                                       /*n=*/file_name_idx);
       }
 
-      // Don't let image locations with the 'arch' in it through, since it's not a location.
-      // This prevents a common error "Could not create an image space..." when initing the Runtime.
-      if (file_name_idx != std::string::npos) {
-        std::string no_file_name = boot_image_location.substr(0, file_name_idx);
-        size_t ancestor_dirs_idx = no_file_name.rfind('/');
+      DBG_LOG << "boot_image_location parent_dir_name was " << parent_dir_name;
 
-        std::string parent_dir_name;
-        if (ancestor_dirs_idx != std::string::npos) {
-          parent_dir_name = no_file_name.substr(ancestor_dirs_idx + 1);
-        } else {
-          parent_dir_name = no_file_name;
-        }
-
-        DBG_LOG << "boot_image_location parent_dir_name was " << parent_dir_name;
-
-        if (GetInstructionSetFromString(parent_dir_name.c_str()) != InstructionSet::kNone) {
+      if (GetInstructionSetFromString(parent_dir_name.c_str()) != InstructionSet::kNone) {
           *error_msg = "Do not specify the architecture as part of the boot image location";
           return false;
-        }
       }
-
-      // Check that the boot image location points to a valid file name.
-      std::string file_name;
-      if (!LocationToFilename(boot_image_location, instruction_set_, &file_name)) {
-        *error_msg = android::base::StringPrintf(
-            "No corresponding file for location '%s' (filename '%s') exists",
-            boot_image_location.c_str(),
-            file_name.c_str());
-        return false;
-      }
-
-      DBG_LOG << "boot_image_filename does exist: " << file_name;
     }
 
     return true;
   }
 
-  void PrintUsage() {
-    fprintf(stderr, "%s", GetUsage().c_str());
+  void PrintUsage() { fprintf(stderr, "%s", GetUsage().c_str()); }
+
+  std::unique_ptr<OatFileAssistantContext> GetOatFileAssistantContext(std::string* error_msg) {
+    if (boot_class_path_.empty()) {
+      *error_msg = "Boot classpath is empty";
+      return nullptr;
+    }
+
+    CHECK(!boot_class_path_locations_.empty());
+
+    return std::make_unique<OatFileAssistantContext>(
+        std::make_unique<OatFileAssistantContext::RuntimeOptions>(
+            OatFileAssistantContext::RuntimeOptions{
+                .image_locations = boot_image_locations_,
+                .boot_class_path = boot_class_path_,
+                .boot_class_path_locations = boot_class_path_locations_,
+            }));
   }
 
  protected:
-  virtual ParseStatus ParseCustom(const char* raw_option ATTRIBUTE_UNUSED,
-                                  size_t raw_option_length ATTRIBUTE_UNUSED,
-                                  std::string* error_msg ATTRIBUTE_UNUSED) {
+  virtual ParseStatus ParseCustom([[maybe_unused]] const char* raw_option,
+                                  [[maybe_unused]] size_t raw_option_length,
+                                  [[maybe_unused]] std::string* error_msg) {
     return kParseUnknownArgument;
   }
 
-  virtual ParseStatus ParseChecks(std::string* error_msg ATTRIBUTE_UNUSED) {
+  virtual ParseStatus ParseChecks([[maybe_unused]] std::string* error_msg) {
+    ParseBootclasspath();
+    if (boot_image_locations_.empty()) {
+      InferBootImage();
+    }
     return kParseOk;
   }
+
+ private:
+  void ParseBootclasspath() {
+    std::optional<std::string_view> bcp_str = std::nullopt;
+    std::optional<std::string_view> bcp_location_str = std::nullopt;
+    for (const char* arg : runtime_args_) {
+      if (StartsWith(arg, "-Xbootclasspath:")) {
+          bcp_str = arg + strlen("-Xbootclasspath:");
+      }
+      if (StartsWith(arg, "-Xbootclasspath-locations:")) {
+          bcp_location_str = arg + strlen("-Xbootclasspath-locations:");
+      }
+    }
+
+    if (bcp_str.has_value() && bcp_location_str.has_value()) {
+      Split(*bcp_str, ':', &boot_class_path_);
+      Split(*bcp_location_str, ':', &boot_class_path_locations_);
+    } else if (bcp_str.has_value()) {
+      Split(*bcp_str, ':', &boot_class_path_);
+      boot_class_path_locations_ = boot_class_path_;
+    } else {
+      // Try the default.
+      const char* env_value = getenv("BOOTCLASSPATH");
+      if (env_value != nullptr && strlen(env_value) > 0) {
+          Split(env_value, ':', &boot_class_path_);
+          boot_class_path_locations_ = boot_class_path_;
+          is_default_boot_class_path_ = true;
+      }
+    }
+  }
+
+  // Infers the boot image on a best-effort basis.
+  // The inference logic aligns with installd/artd + dex2oat.
+  void InferBootImage() {
+    // The boot image inference only makes sense on device.
+    if (!kIsTargetAndroid) {
+      return;
+    }
+
+    // The inferred boot image can only be used with the default bootclasspath.
+    if (boot_class_path_.empty() || !is_default_boot_class_path_) {
+      return;
+    }
+
+    std::string error_msg;
+    std::string boot_image = GetBootImageLocationForDefaultBcpRespectingSysProps(&error_msg);
+    if (boot_image.empty()) {
+      LOG(WARNING) << "Failed to infer boot image: " << error_msg;
+      return;
+    }
+
+    LOG(INFO) << "Inferred boot image: " << boot_image;
+    Split(boot_image, ':', &boot_image_locations_);
+
+    // Verify the inferred boot image.
+    std::unique_ptr<OatFileAssistantContext> ofa_context = GetOatFileAssistantContext(&error_msg);
+    CHECK_NE(ofa_context, nullptr);
+    size_t verified_boot_image_count = ofa_context->GetBootImageInfoList(instruction_set_).size();
+    if (verified_boot_image_count != boot_image_locations_.size()) {
+      LOG(WARNING) << "Failed to verify inferred boot image";
+      boot_image_locations_.resize(verified_boot_image_count);
+    }
+  }
 };
 
 template <typename Args = CmdlineArgs>
@@ -414,7 +445,7 @@
   Runtime* CreateRuntime(CmdlineArgs* args) {
     CHECK(args != nullptr);
 
-    return StartRuntime(args->boot_image_location_, args->instruction_set_, args_->runtime_args_);
+    return StartRuntime(args->boot_image_locations_, args->instruction_set_, args_->runtime_args_);
   }
 };
 }  // namespace art
diff --git a/cmdline/cmdline_parser_test.cc b/cmdline/cmdline_parser_test.cc
index effbee9..93218bf 100644
--- a/cmdline/cmdline_parser_test.cc
+++ b/cmdline/cmdline_parser_test.cc
@@ -75,12 +75,13 @@
   // that are nevertheless equal.
   // If a test is failing because the structs aren't "equal" when they really are
   // then it's recommended to implement operator== for it instead.
-  template <typename T, typename ... Ignore>
-  bool UsuallyEquals(const T& expected, const T& actual,
-                     const Ignore& ... more ATTRIBUTE_UNUSED,
-                     typename std::enable_if<std::is_pod<T>::value>::type* = nullptr,
-                     typename std::enable_if<!detail::SupportsEqualityOperator<T>::value>::type* = nullptr
-                     ) {
+  template <typename T, typename... Ignore>
+  bool UsuallyEquals(
+      const T& expected,
+      const T& actual,
+      [[maybe_unused]] const Ignore&... more,
+      typename std::enable_if<std::is_pod<T>::value>::type* = nullptr,
+      typename std::enable_if<!detail::SupportsEqualityOperator<T>::value>::type* = nullptr) {
     return memcmp(std::addressof(expected), std::addressof(actual), sizeof(T)) == 0;
   }
 
@@ -326,8 +327,7 @@
   }
 }  // TEST_F
 
-// TODO: Enable this b/19274810
-TEST_F(CmdlineParserTest, DISABLED_TestXGcOption) {
+TEST_F(CmdlineParserTest, TestXGcOption) {
   /*
    * Test success
    */
@@ -487,7 +487,7 @@
 * -Xps-*
 */
 TEST_F(CmdlineParserTest, ProfileSaverOptions) {
-  ProfileSaverOptions opt = ProfileSaverOptions(true, 1, 2, 3, 4, 5, 6, 7, 8, "abc", true);
+  ProfileSaverOptions opt = ProfileSaverOptions(true, 1, 2, 3, 4, 5, 6, 7, 8, 9, "abc", true);
 
   EXPECT_SINGLE_PARSE_VALUE(opt,
                             "-Xjitsaveprofilinginfo "
@@ -499,6 +499,7 @@
                             "-Xps-min-classes-to-save:6 "
                             "-Xps-min-notification-before-wake:7 "
                             "-Xps-max-notification-before-wake:8 "
+                            "-Xps-inline-cache-threshold:9 "
                             "-Xps-profile-path:abc "
                             "-Xps-profile-boot-class-path",
                             M::ProfileSaverOpts);
diff --git a/cmdline/cmdline_type_parser.h b/cmdline/cmdline_type_parser.h
index 82a76f4..10e28f3 100644
--- a/cmdline/cmdline_type_parser.h
+++ b/cmdline/cmdline_type_parser.h
@@ -34,7 +34,7 @@
   //
   // e.g. if the argument definition was "foo:_", and the user-provided input was "foo:bar",
   // then args is "bar".
-  Result Parse(const std::string& args ATTRIBUTE_UNUSED) {
+  Result Parse([[maybe_unused]] const std::string& args) {
     assert(false);
     return Result::Failure("Missing type specialization and/or value map");
   }
@@ -46,8 +46,8 @@
   //
   // If the initial value does not exist yet, a default value is created by
   // value-initializing with 'T()'.
-  Result ParseAndAppend(const std::string& args ATTRIBUTE_UNUSED,
-                        T& existing_value ATTRIBUTE_UNUSED) {
+  Result ParseAndAppend([[maybe_unused]] const std::string& args,
+                        [[maybe_unused]] T& existing_value) {
     assert(false);
     return Result::Failure("Missing type specialization and/or value map");
   }
diff --git a/cmdline/cmdline_types.h b/cmdline/cmdline_types.h
index b16f069..7cacfde 100644
--- a/cmdline/cmdline_types.h
+++ b/cmdline/cmdline_types.h
@@ -18,6 +18,7 @@
 
 #define CMDLINE_NDEBUG 1  // Do not output any debugging information for parsing.
 
+#include <cstdint>
 #include <list>
 #include <ostream>
 
@@ -258,6 +259,17 @@
 };
 
 template <>
+struct CmdlineType<uint16_t> : CmdlineTypeParser<uint16_t> {
+  Result Parse(const std::string& str) {
+    return ParseNumeric<uint16_t>(str);
+  }
+
+  static const char* Name() { return "unsigned 16-bit integer"; }
+  static const char* DescribeType() { return "unsigned 16-bit integer value"; }
+};
+
+
+template <>
 struct CmdlineType<int> : CmdlineTypeParser<int> {
   Result Parse(const std::string& str) {
     return ParseNumeric<int>(str);
@@ -849,6 +861,11 @@
              &ProfileSaverOptions::max_notification_before_wake_,
              type_parser.Parse(suffix));
     }
+    if (android::base::StartsWith(option, "inline-cache-threshold:")) {
+      CmdlineType<uint16_t> type_parser;
+      return ParseInto(
+          existing, &ProfileSaverOptions::inline_cache_threshold_, type_parser.Parse(suffix));
+    }
     if (android::base::StartsWith(option, "profile-path:")) {
       existing.profile_path_ = suffix;
       return Result::SuccessNoValue();
diff --git a/cmdline/token_range.h b/cmdline/token_range.h
index e917e1d..f662ca6 100644
--- a/cmdline/token_range.h
+++ b/cmdline/token_range.h
@@ -55,7 +55,7 @@
 
 #if 0
   // Copying-from-vector constructor.
-  TokenRange(const TokenList& token_list ATTRIBUTE_UNUSED,
+  TokenRange([[maybe_unused]] const TokenList& token_list,
              TokenList::const_iterator it_begin,
              TokenList::const_iterator it_end)
     : token_list_(new TokenList(it_begin, it_end)),
diff --git a/compiler/Android.bp b/compiler/Android.bp
index a879bd8..e0c1744 100644
--- a/compiler/Android.bp
+++ b/compiler/Android.bp
@@ -28,6 +28,106 @@
     default_applicable_licenses: ["art_license"],
 }
 
+// Common dependencies for libart-compiler_deps and libartd-compiler_deps.
+cc_defaults {
+    name: "libart-compiler_common_deps",
+    shared_libs: [
+        "libbase",
+        "liblzma", // libelffile(d) dependency; must be repeated here since it's a static lib.
+        "libartpalette",
+    ],
+    header_libs: [
+        "libart_headers",
+        "libart_generated_headers",
+    ],
+}
+
+// Dependencies of libart-compiler, used to propagate libart-compiler deps when static linking.
+art_cc_defaults {
+    name: "libart-compiler_deps",
+    defaults: ["libart-compiler_common_deps"],
+    shared_libs: [
+        "libartbase",
+        "libprofile",
+        "libdexfile",
+    ],
+    static_libs: ["libelffile"],
+    codegen: {
+        arm: {
+            // VIXL assembly support for ARM targets.
+            static_libs: [
+                "libvixl",
+            ],
+        },
+        arm64: {
+            // VIXL assembly support for ARM64 targets.
+            static_libs: [
+                "libvixl",
+            ],
+        },
+    },
+    // In order to save memory on device `art::HGraphVisualizerDisassembler` loads
+    // `libart-disassembler.so` dynamically. Host builds of `libart-compiler` depend on
+    // `libart-disassembler` directly with `shared_libs` or `static_libs`.
+    target: {
+        host: {
+            shared: {
+                shared_libs: [
+                    "libart-disassembler",
+                ],
+            },
+        },
+        android: {
+            runtime_libs: [
+                "libart-disassembler",
+            ],
+        },
+    },
+}
+
+// Dependencies of libartd-compiler, used to propagate libartd-compiler deps when static linking.
+art_cc_defaults {
+    name: "libartd-compiler_deps",
+    defaults: ["libart-compiler_common_deps"],
+    shared_libs: [
+        "libartbased",
+        "libprofiled",
+        "libdexfiled",
+    ],
+    static_libs: ["libelffiled"],
+    codegen: {
+        arm: {
+            // VIXL assembly support for ARM targets.
+            static_libs: [
+                "libvixld",
+            ],
+        },
+        arm64: {
+            // VIXL assembly support for ARM64 targets.
+            static_libs: [
+                "libvixld",
+            ],
+        },
+    },
+    // In order to save memory on device `art::HGraphVisualizerDisassembler` loads
+    // `libartd-disassembler.so` dynamically. Host builds of `libartd-compiler` depend on
+    // `libartd-disassembler` directly with `shared_libs` or `static_libs`.
+    target: {
+        host: {
+            shared: {
+                shared_libs: [
+                    "libartd-disassembler",
+                ],
+            },
+        },
+        android: {
+            runtime_libs: [
+                "libartd-disassembler",
+            ],
+        },
+    },
+}
+
 art_cc_defaults {
     name: "libart-compiler-defaults",
     defaults: ["art_defaults"],
@@ -46,6 +146,7 @@
         "optimizing/bounds_check_elimination.cc",
         "optimizing/builder.cc",
         "optimizing/cha_guard_optimization.cc",
+        "optimizing/code_generation_data.cc",
         "optimizing/code_generator.cc",
         "optimizing/code_generator_utils.cc",
         "optimizing/code_sinking.cc",
@@ -54,7 +155,6 @@
         "optimizing/data_type.cc",
         "optimizing/dead_code_elimination.cc",
         "optimizing/escape.cc",
-        "optimizing/execution_subgraph.cc",
         "optimizing/graph_checker.cc",
         "optimizing/graph_visualizer.cc",
         "optimizing/gvn.cc",
@@ -77,10 +177,10 @@
         "optimizing/optimizing_compiler.cc",
         "optimizing/parallel_move_resolver.cc",
         "optimizing/prepare_for_register_allocation.cc",
+        "optimizing/profiling_info_builder.cc",
         "optimizing/reference_type_propagation.cc",
         "optimizing/register_allocation_resolver.cc",
         "optimizing/register_allocator.cc",
-        "optimizing/register_allocator_graph_color.cc",
         "optimizing/register_allocator_linear_scan.cc",
         "optimizing/select_generator.cc",
         "optimizing/scheduler.cc",
@@ -122,6 +222,7 @@
                 "optimizing/code_generator_arm64.cc",
                 "optimizing/code_generator_vector_arm64_neon.cc",
                 "optimizing/code_generator_vector_arm64_sve.cc",
+                "optimizing/jit_patches_arm64.cc",
                 "optimizing/scheduler_arm64.cc",
                 "optimizing/instruction_simplifier_arm64.cc",
                 "optimizing/intrinsics_arm64.cc",
@@ -132,6 +233,12 @@
         },
         riscv64: {
             srcs: [
+                "jni/quick/riscv64/calling_convention_riscv64.cc",
+                "optimizing/code_generator_riscv64.cc",
+                "optimizing/critical_native_abi_fixup_riscv64.cc",
+                "optimizing/intrinsics_riscv64.cc",
+                "utils/riscv64/assembler_riscv64.cc",
+                "utils/riscv64/jni_macro_assembler_riscv64.cc",
                 "utils/riscv64/managed_register_riscv64.cc",
             ],
         },
@@ -163,14 +270,7 @@
             ],
         },
     },
-    static: {
-        cflags: ["-DART_STATIC_LIBART_COMPILER"],
-    },
     generated_sources: ["art_compiler_operator_srcs"],
-    shared_libs: [
-        "libbase",
-        "liblzma", // libelffile(d) dependency; must be repeated here since it's a static lib.
-    ],
     header_libs: [
         "art_cmdlineparser_headers", // For compiler_options.
         "art_disassembler_headers",
@@ -178,8 +278,6 @@
     ],
 
     export_include_dirs: ["."],
-    // Not using .map.txt because this is an internal API
-    version_script: "libart-compiler.map",
 }
 
 cc_defaults {
@@ -204,41 +302,12 @@
     output_extension: "operator_out.cc",
 }
 
-art_cc_library {
+art_cc_library_static {
     name: "libart-compiler",
     defaults: [
         "libart-compiler-defaults",
-        "dex2oat-pgo-defaults",
-        "art_hugepage_defaults",
+        "libart-compiler_deps",
     ],
-    codegen: {
-        arm: {
-            // VIXL assembly support for ARM targets.
-            static_libs: [
-                "libvixl",
-            ],
-        },
-        arm64: {
-            // VIXL assembly support for ARM64 targets.
-            static_libs: [
-                "libvixl",
-            ],
-        },
-    },
-    shared_libs: [
-        "libart",
-        "libartbase",
-        "libartpalette",
-        "libprofile",
-        "libdexfile",
-    ],
-    static_libs: ["libelffile"],
-    runtime_libs: [
-        // `art::HGraphVisualizerDisassembler::HGraphVisualizerDisassembler` may dynamically load
-        // `libart-disassembler.so`.
-        "libart-disassembler",
-    ],
-
     target: {
         android: {
             lto: {
@@ -253,12 +322,22 @@
     ],
 }
 
+// For static linking with gtests. Same as `libart-compiler`, but without LTO.
+// When gtests static link a library with LTO enabled, they are also built with LTO.
+// This makes the build process use a lot of memory. b/277207452
+art_cc_library_static {
+    name: "libart-compiler-for-test",
+    defaults: [
+        "libart-compiler-defaults",
+        "libart-compiler_deps",
+    ],
+}
+
 cc_defaults {
     name: "libart-compiler_static_defaults",
     defaults: [
         "libart-compiler_static_base_defaults",
         "libart-disassembler_static_defaults",
-        "libart_static_defaults",
         "libartbase_static_defaults",
         "libdexfile_static_defaults",
         "libprofile_static_defaults",
@@ -266,48 +345,28 @@
     whole_static_libs: ["libart-compiler"],
 }
 
-art_cc_library {
+// libart-compiler_static_defaults for standalone gtests.
+// Uses libart-for-test_static_defaults instead of libart_static_defaults.
+// Uses libart-compiler-for-test instead of libart-compiler.
+cc_defaults {
+    name: "libart-compiler-for-test_static_defaults",
+    defaults: [
+        "libart-compiler_static_base_defaults",
+        "libart-disassembler_static_defaults",
+        "libartbase_static_defaults",
+        "libdexfile_static_defaults",
+        "libprofile_static_defaults",
+    ],
+    whole_static_libs: ["libart-compiler-for-test"],
+}
+
+art_cc_library_static {
     name: "libartd-compiler",
     defaults: [
         "art_debug_defaults",
         "libart-compiler-defaults",
+        "libartd-compiler_deps",
     ],
-    codegen: {
-        arm: {
-            // VIXL assembly support for ARM targets.
-            static_libs: [
-                "libvixld",
-            ],
-            // Export vixl headers as they are included in this library's headers used by tests.
-            export_static_lib_headers: [
-                "libvixld",
-            ],
-        },
-        arm64: {
-            // VIXL assembly support for ARM64 targets.
-            static_libs: [
-                "libvixld",
-            ],
-            // Export vixl headers as they are included in this library's headers used by tests.
-            export_static_lib_headers: [
-                "libvixld",
-            ],
-        },
-    },
-    shared_libs: [
-        "libartbased",
-        "libartd",
-        "libartpalette",
-        "libprofiled",
-        "libdexfiled",
-    ],
-    static_libs: ["libelffiled"],
-    runtime_libs: [
-        // `art::HGraphVisualizerDisassembler::HGraphVisualizerDisassembler` may dynamically load
-        // `libartd-disassembler.so`.
-        "libartd-disassembler",
-    ],
-
     apex_available: [
         "com.android.art.debug",
         // TODO(b/183882457): This lib doesn't go into com.android.art, but
@@ -323,49 +382,68 @@
         "libart-compiler_static_base_defaults",
         "libartbased_static_defaults",
         "libartd-disassembler_static_defaults",
-        "libartd_static_defaults",
         "libdexfiled_static_defaults",
         "libprofiled_static_defaults",
     ],
     whole_static_libs: ["libartd-compiler"],
 }
 
+// libartd-compiler_static_defaults for gtests.
+// Uses libartd-for-test_static_defaults instead of libart_static_defaults.
+// Note that `libartd-compiler-for-test` is not required here, because `libartd-compiler`
+// doesn't use LTO.
+cc_defaults {
+    name: "libartd-compiler-for-test_static_defaults",
+    defaults: [
+        "libart-compiler_static_base_defaults",
+        "libartbased_static_defaults",
+        "libartd-disassembler_static_defaults",
+        "libdexfiled_static_defaults",
+        "libprofiled_static_defaults",
+    ],
+    whole_static_libs: ["libartd-compiler"],
+}
+
+// Export headers required by `libart-runtime` to use JIT from `libart-compiler`.
+cc_library_headers {
+    name: "libart-compiler_jit_headers",
+    defaults: ["art_defaults"],
+    host_supported: true,
+    export_include_dirs: ["export"],
+    apex_available: [
+        "com.android.art",
+        "com.android.art.debug",
+        "test_broken_com.android.art",
+    ],
+}
+
 // Properties common to `libart-compiler-gtest` and `libartd-compiler-gtest`.
 art_cc_defaults {
     name: "libart-compiler-gtest-common",
     srcs: [
         "common_compiler_test.cc",
     ],
-    shared_libs: [
-        "libbase",
+    header_libs: [
+        "libart_headers",
     ],
 }
 
-art_cc_library {
+art_cc_library_static {
     name: "libart-compiler-gtest",
     defaults: [
         "libart-gtest-defaults",
         "libart-compiler-gtest-common",
-    ],
-    shared_libs: [
-        "libart-compiler",
-        "libart-disassembler",
-        "libartbase-art-gtest",
-        "libart-runtime-gtest",
+        "libart-compiler-for-test_static_defaults",
     ],
 }
 
-art_cc_library {
+art_cc_library_static {
     name: "libartd-compiler-gtest",
     defaults: [
-        "libartd-gtest-defaults",
+        "art_debug_defaults",
+        "libart-gtest-defaults",
         "libart-compiler-gtest-common",
-    ],
-    shared_libs: [
-        "libartd-compiler",
-        "libartd-disassembler",
-        "libartbased-art-gtest",
-        "libartd-runtime-gtest",
+        "libartd-compiler-for-test_static_defaults",
     ],
 }
 
@@ -381,7 +459,6 @@
         "jni/jni_compiler_test.cc",
         "optimizing/codegen_test.cc",
         "optimizing/constant_folding_test.cc",
-        "optimizing/execution_subgraph_test.cc",
         "optimizing/induction_var_range_test.cc",
         "optimizing/load_store_elimination_test.cc",
         "optimizing/ssa_test.cc",
@@ -426,13 +503,10 @@
         "utils/atomic_dex_ref_map_test.cc",
         "utils/dedupe_set_test.cc",
 
-        "jni/jni_cfi_test.cc",
         "optimizing/codegen_test.cc",
-        "optimizing/execution_subgraph_test.cc",
         "optimizing/instruction_simplifier_test.cc",
         "optimizing/load_store_analysis_test.cc",
         "optimizing/load_store_elimination_test.cc",
-        "optimizing/optimizing_cfi_test.cc",
         "optimizing/scheduler_test.cc",
     ],
 
@@ -474,11 +548,6 @@
         "libnativehelper_header_only",
     ],
 
-    shared_libs: [
-        "libnativeloader",
-        "libunwindstack",
-    ],
-
     target: {
         host: {
             shared_libs: [
@@ -496,15 +565,8 @@
         "art_gtest_defaults",
         "art_compiler_tests_defaults",
     ],
-    shared_libs: [
-        "libprofiled",
-        "libartd-simulator-container",
-        "liblzma",
-    ],
     static_libs: [
-        "libartd-compiler",
-        "libelffiled",
-        "libvixld",
+        "libartd-simulator-container",
     ],
 }
 
@@ -516,21 +578,8 @@
         "art_compiler_tests_defaults",
     ],
     data: [":generate-boot-image"],
-    shared_libs: [
-        "libprofile",
-        "liblzma",
-        "libartpalette",
-    ],
     static_libs: [
-        // For now, link `libart-simulator-container` statically for simplicity,
-        // to save the added complexity to package it in test suites (along with
-        // other test artifacts) and install it on device during tests.
-        // TODO(b/192070541): Consider linking `libart-simulator-container`
-        // dynamically.
         "libart-simulator-container",
-        "libart-compiler",
-        "libelffile",
-        "libvixl",
     ],
     test_config: "art_standalone_compiler_tests.xml",
 }
@@ -541,6 +590,10 @@
     defaults: [
         "art_gtest_defaults",
     ],
+    srcs: [
+        "jni/jni_cfi_test.cc",
+        "optimizing/optimizing_cfi_test.cc",
+    ],
     tidy_timeout_srcs: [
         "utils/x86/assembler_x86_test.cc",
         "utils/x86_64/assembler_x86_64_test.cc",
@@ -551,6 +604,12 @@
                 "utils/assembler_thumb_test.cc",
             ],
         },
+        riscv64: {
+            srcs: [
+                "utils/riscv64/assembler_riscv64_test.cc",
+                "utils/riscv64/jni_macro_assembler_riscv64_test.cc",
+            ],
+        },
         x86: {
             srcs: [
                 "utils/x86/assembler_x86_test.cc",
@@ -562,12 +621,7 @@
             ],
         },
     },
-    shared_libs: [
-        "liblzma",
-    ],
     static_libs: [
-        "libartd-compiler",
-        "libelffiled",
         "libvixld",
     ],
 }
diff --git a/compiler/art_standalone_compiler_tests.xml b/compiler/art_standalone_compiler_tests.xml
index 394ac8d..c2065dd 100644
--- a/compiler/art_standalone_compiler_tests.xml
+++ b/compiler/art_standalone_compiler_tests.xml
@@ -15,6 +15,7 @@
 -->
 <configuration description="Runs art_standalone_compiler_tests.">
     <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
 
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
         <option name="cleanup" value="true" />
@@ -46,8 +47,6 @@
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp/art_standalone_compiler_tests" />
         <option name="module-name" value="art_standalone_compiler_tests" />
-        <option name="ld-library-path-32" value="/apex/com.android.art/lib" />
-        <option name="ld-library-path-64" value="/apex/com.android.art/lib64" />
     </test>
 
     <!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
diff --git a/compiler/cfi_test.h b/compiler/cfi_test.h
index e65bee8..6835e92 100644
--- a/compiler/cfi_test.h
+++ b/compiler/cfi_test.h
@@ -131,7 +131,7 @@
         }
         // Use the .cfi_ prefix.
         new_line = ".cfi_" + new_line.substr(FindEndOf(new_line, "DW_CFA_"));
-        output->push_back(address + ": " + new_line);
+        output->push_back(ART_FORMAT("{}: {}", address, new_line));
       }
     }
   }
diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc
index 442b96e..d2cf3ae 100644
--- a/compiler/common_compiler_test.cc
+++ b/compiler/common_compiler_test.cc
@@ -37,7 +37,7 @@
 #include "mirror/class_loader.h"
 #include "mirror/dex_cache.h"
 #include "mirror/object-inl.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread-current-inl.h"
 #include "utils/atomic_dex_ref_map-inl.h"
@@ -51,15 +51,16 @@
   CodeAndMetadata(ArrayRef<const uint8_t> code,
                   ArrayRef<const uint8_t> vmap_table,
                   InstructionSet instruction_set) {
+    const size_t page_size = MemMap::GetPageSize();
     const uint32_t code_size = code.size();
     CHECK_NE(code_size, 0u);
     const uint32_t vmap_table_offset = vmap_table.empty() ? 0u
         : sizeof(OatQuickMethodHeader) + vmap_table.size();
     OatQuickMethodHeader method_header(vmap_table_offset);
     const size_t code_alignment = GetInstructionSetCodeAlignment(instruction_set);
-    DCHECK_ALIGNED_PARAM(kPageSize, code_alignment);
+    DCHECK_ALIGNED_PARAM(page_size, code_alignment);
     const uint32_t code_offset = RoundUp(vmap_table.size() + sizeof(method_header), code_alignment);
-    const uint32_t capacity = RoundUp(code_offset + code_size, kPageSize);
+    const uint32_t capacity = RoundUp(code_offset + code_size, page_size);
 
     // Create a memfd handle with sufficient capacity.
     android::base::unique_fd mem_fd(art::memfd_create_compat("test code", /*flags=*/ 0));
@@ -133,9 +134,9 @@
   CompiledMethod* CreateCompiledMethod(InstructionSet instruction_set,
                                        ArrayRef<const uint8_t> code,
                                        ArrayRef<const uint8_t> stack_map,
-                                       ArrayRef<const uint8_t> cfi ATTRIBUTE_UNUSED,
+                                       [[maybe_unused]] ArrayRef<const uint8_t> cfi,
                                        ArrayRef<const linker::LinkerPatch> patches,
-                                       bool is_intrinsic ATTRIBUTE_UNUSED) override {
+                                       [[maybe_unused]] bool is_intrinsic) override {
     // Supports only one method at a time.
     CHECK_EQ(instruction_set_, InstructionSet::kNone);
     CHECK_NE(instruction_set, InstructionSet::kNone);
@@ -150,15 +151,15 @@
     return reinterpret_cast<CompiledMethod*>(this);
   }
 
-  ArrayRef<const uint8_t> GetThunkCode(const linker::LinkerPatch& patch ATTRIBUTE_UNUSED,
-                                       /*out*/ std::string* debug_name  ATTRIBUTE_UNUSED) override {
+  ArrayRef<const uint8_t> GetThunkCode([[maybe_unused]] const linker::LinkerPatch& patch,
+                                       [[maybe_unused]] /*out*/ std::string* debug_name) override {
     LOG(FATAL) << "Unsupported.";
     UNREACHABLE();
   }
 
-  void SetThunkCode(const linker::LinkerPatch& patch ATTRIBUTE_UNUSED,
-                    ArrayRef<const uint8_t> code ATTRIBUTE_UNUSED,
-                    const std::string& debug_name ATTRIBUTE_UNUSED) override {
+  void SetThunkCode([[maybe_unused]] const linker::LinkerPatch& patch,
+                    [[maybe_unused]] ArrayRef<const uint8_t> code,
+                    [[maybe_unused]] const std::string& debug_name) override {
     LOG(FATAL) << "Unsupported.";
     UNREACHABLE();
   }
@@ -187,6 +188,7 @@
 std::unique_ptr<CompilerOptions> CommonCompilerTestImpl::CreateCompilerOptions(
     InstructionSet instruction_set, const std::string& variant) {
   std::unique_ptr<CompilerOptions> compiler_options = std::make_unique<CompilerOptions>();
+  compiler_options->emit_read_barrier_ = gUseReadBarrier;
   compiler_options->instruction_set_ = instruction_set;
   std::string error_msg;
   compiler_options->instruction_set_features_ =
@@ -249,7 +251,7 @@
 }
 
 void CommonCompilerTestImpl::SetUpRuntimeOptionsImpl() {
-  compiler_options_.reset(new CompilerOptions);
+  compiler_options_ = CreateCompilerOptions(instruction_set_, "default");
   ApplyInstructionSet();
 }
 
diff --git a/compiler/common_compiler_test.h b/compiler/common_compiler_test.h
index f3cd132..9b49c93 100644
--- a/compiler/common_compiler_test.h
+++ b/compiler/common_compiler_test.h
@@ -27,7 +27,7 @@
 #include "base/macros.h"
 #include "common_runtime_test.h"
 #include "compiler.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 
 namespace art HIDDEN {
 namespace mirror {
diff --git a/compiler/compiler.cc b/compiler/compiler.cc
index e2587c1..0e040ac 100644
--- a/compiler/compiler.cc
+++ b/compiler/compiler.cc
@@ -22,7 +22,7 @@
 #include "base/utils.h"
 #include "dex/code_item_accessors-inl.h"
 #include "dex/dex_file.h"
-#include "oat.h"
+#include "oat/oat.h"
 #include "optimizing/optimizing_compiler.h"
 
 namespace art HIDDEN {
diff --git a/compiler/compiler.h b/compiler/compiler.h
index ce785bb..6c317f7 100644
--- a/compiler/compiler.h
+++ b/compiler/compiler.h
@@ -73,12 +73,12 @@
                                      const DexFile& dex_file,
                                      Handle<mirror::DexCache> dex_cache) const = 0;
 
-  virtual bool JitCompile(Thread* self ATTRIBUTE_UNUSED,
-                          jit::JitCodeCache* code_cache ATTRIBUTE_UNUSED,
-                          jit::JitMemoryRegion* region ATTRIBUTE_UNUSED,
-                          ArtMethod* method ATTRIBUTE_UNUSED,
-                          CompilationKind compilation_kind ATTRIBUTE_UNUSED,
-                          jit::JitLogger* jit_logger ATTRIBUTE_UNUSED)
+  virtual bool JitCompile([[maybe_unused]] Thread* self,
+                          [[maybe_unused]] jit::JitCodeCache* code_cache,
+                          [[maybe_unused]] jit::JitMemoryRegion* region,
+                          [[maybe_unused]] ArtMethod* method,
+                          [[maybe_unused]] CompilationKind compilation_kind,
+                          [[maybe_unused]] jit::JitLogger* jit_logger)
       REQUIRES_SHARED(Locks::mutator_lock_) {
     return false;
   }
diff --git a/compiler/debug/dwarf/dwarf_test.cc b/compiler/debug/dwarf/dwarf_test.cc
index 14c92b2..87a94b4 100644
--- a/compiler/debug/dwarf/dwarf_test.cc
+++ b/compiler/debug/dwarf/dwarf_test.cc
@@ -234,10 +234,10 @@
   opcodes.SetISA(5);
   opcodes.EndSequence();
   opcodes.DefineFile("file.c", 0, 1000, 2000);
-  DW_CHECK_NEXT("Address            Line   Column File   ISA Discriminator Flags");
-  DW_CHECK_NEXT("------------------ ------ ------ ------ --- ------------- -------------");
-  DW_CHECK_NEXT("0x0000000001000000      1      0      1   0             0  is_stmt");
-  DW_CHECK_NEXT("0x0000000001000100      3      4      2   5             0  basic_block prologue_end epilogue_begin end_sequence");
+  DW_CHECK_NEXT("Address            Line   Column File   ISA Discriminator OpIndex Flags");
+  DW_CHECK_NEXT("------------------ ------ ------ ------ --- ------------- ------- -------------");
+  DW_CHECK_NEXT("0x0000000001000000      1      0      1   0             0       0  is_stmt");
+  DW_CHECK_NEXT("0x0000000001000100      3      4      2   5             0       0  basic_block prologue_end epilogue_begin end_sequence");
 
   WriteDebugLineTable(include_directories, files, opcodes, &debug_line_data_);
 
@@ -256,8 +256,8 @@
   DW_CHECK(".debug_line contents:");
   DW_CHECK("file_names[  1]:");
   DW_CHECK("           name: \"file.c\"");
-  DW_CHECK("Address            Line   Column File   ISA Discriminator Flags");
-  DW_CHECK("------------------ ------ ------ ------ --- ------------- -------------");
+  DW_CHECK("Address            Line   Column File   ISA Discriminator OpIndex Flags");
+  DW_CHECK("------------------ ------ ------ ------ --- ------------- ------- -------------");
   for (int addr_delta = 0; addr_delta < 80; addr_delta += 2) {
     for (int line_delta = 16; line_delta >= -16; --line_delta) {
       pc += addr_delta;
@@ -267,7 +267,7 @@
       ASSERT_EQ(opcodes.CurrentAddress(), pc);
       ASSERT_EQ(opcodes.CurrentLine(), line);
       char expected[1024];
-      sprintf(expected, "0x%016x %6i      0      1   0             0", pc, line);
+      sprintf(expected, "0x%016x %6i      0      1   0             0       0", pc, line);
       DW_CHECK_NEXT(expected);
     }
   }
diff --git a/compiler/debug/elf_debug_frame_writer.h b/compiler/debug/elf_debug_frame_writer.h
index 6b72262..fe98a57 100644
--- a/compiler/debug/elf_debug_frame_writer.h
+++ b/compiler/debug/elf_debug_frame_writer.h
@@ -90,7 +90,26 @@
       return;
     }
     case InstructionSet::kRiscv64: {
-      UNIMPLEMENTED(FATAL);
+      dwarf::DebugFrameOpCodeWriter<> opcodes;
+      opcodes.DefCFA(Reg::Riscv64Core(2), 0);  // X2(SP).
+      // core registers.
+      for (int reg = 3; reg < 32; reg++) {  // Skip X0 (Zero), X1 (RA) and X2 (SP).
+        if ((reg >= 5 && reg < 8) || (reg >= 10 && reg < 18) || reg >= 28) {
+          opcodes.Undefined(Reg::Riscv64Core(reg));
+        } else {
+          opcodes.SameValue(Reg::Riscv64Core(reg));
+        }
+      }
+      // fp registers.
+      for (int reg = 0; reg < 32; reg++) {
+        if (reg < 8 || (reg >=10 && reg < 18) || reg >= 28) {
+          opcodes.Undefined(Reg::Riscv64Fp(reg));
+        } else {
+          opcodes.SameValue(Reg::Riscv64Fp(reg));
+        }
+      }
+      auto return_reg = Reg::Riscv64Core(1);  // X1(RA).
+      WriteCIE(is64bit, return_reg, opcodes, buffer);
       return;
     }
     case InstructionSet::kX86: {
diff --git a/compiler/debug/elf_debug_info_writer.h b/compiler/debug/elf_debug_info_writer.h
index 9915a24..50d3f2b 100644
--- a/compiler/debug/elf_debug_info_writer.h
+++ b/compiler/debug/elf_debug_info_writer.h
@@ -37,7 +37,7 @@
 #include "mirror/array.h"
 #include "mirror/class-inl.h"
 #include "mirror/class.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 #include "obj_ptr-inl.h"
 
 namespace art HIDDEN {
diff --git a/compiler/debug/elf_debug_line_writer.h b/compiler/debug/elf_debug_line_writer.h
index 4896bc1..2664bbb 100644
--- a/compiler/debug/elf_debug_line_writer.h
+++ b/compiler/debug/elf_debug_line_writer.h
@@ -27,8 +27,8 @@
 #include "dwarf/debug_line_opcode_writer.h"
 #include "dwarf/headers.h"
 #include "elf/elf_builder.h"
-#include "oat_file.h"
-#include "stack_map.h"
+#include "oat/oat_file.h"
+#include "oat/stack_map.h"
 
 namespace art HIDDEN {
 namespace debug {
@@ -194,7 +194,7 @@
           } else {
             directory_index = it->second;
           }
-          full_path = package_name + "/" + file_name;
+          full_path = ART_FORMAT("{}/{}", package_name, file_name);
         }
 
         // Add file entry.
diff --git a/compiler/debug/elf_debug_loc_writer.h b/compiler/debug/elf_debug_loc_writer.h
index 8cf476e..9ff97b5 100644
--- a/compiler/debug/elf_debug_loc_writer.h
+++ b/compiler/debug/elf_debug_loc_writer.h
@@ -25,7 +25,7 @@
 #include "debug/method_debug_info.h"
 #include "dwarf/debug_info_entry_writer.h"
 #include "dwarf/register.h"
-#include "stack_map.h"
+#include "oat/stack_map.h"
 
 namespace art HIDDEN {
 namespace debug {
diff --git a/compiler/debug/elf_debug_writer.cc b/compiler/debug/elf_debug_writer.cc
index 8f64d73..4d349da 100644
--- a/compiler/debug/elf_debug_writer.cc
+++ b/compiler/debug/elf_debug_writer.cc
@@ -35,7 +35,7 @@
 #include "elf/elf_utils.h"
 #include "elf/xz_utils.h"
 #include "jit/debugger_interface.h"
-#include "oat.h"
+#include "oat/oat.h"
 #include "stream/vector_output_stream.h"
 
 namespace art HIDDEN {
@@ -113,7 +113,7 @@
 template <typename ElfTypes>
 static std::vector<uint8_t> MakeMiniDebugInfoInternal(
     InstructionSet isa,
-    const InstructionSetFeatures* features ATTRIBUTE_UNUSED,
+    [[maybe_unused]] const InstructionSetFeatures* features,
     typename ElfTypes::Addr text_section_address,
     size_t text_section_size,
     typename ElfTypes::Addr dex_section_address,
@@ -172,11 +172,10 @@
   }
 }
 
-std::vector<uint8_t> MakeElfFileForJIT(
-    InstructionSet isa,
-    const InstructionSetFeatures* features ATTRIBUTE_UNUSED,
-    bool mini_debug_info,
-    const MethodDebugInfo& method_info) {
+std::vector<uint8_t> MakeElfFileForJIT(InstructionSet isa,
+                                       [[maybe_unused]] const InstructionSetFeatures* features,
+                                       bool mini_debug_info,
+                                       const MethodDebugInfo& method_info) {
   using ElfTypes = ElfRuntimeTypes;
   CHECK_EQ(sizeof(ElfTypes::Addr), static_cast<size_t>(GetInstructionSetPointerSize(isa)));
   CHECK_EQ(method_info.is_code_address_text_relative, false);
@@ -213,13 +212,12 @@
       DCHECK_EQ(sym.st_size, method_info.code_size);
       num_syms++;
     });
-    reader.VisitDebugFrame([&](const Reader::CIE* cie ATTRIBUTE_UNUSED) {
-      num_cies++;
-    }, [&](const Reader::FDE* fde, const Reader::CIE* cie ATTRIBUTE_UNUSED) {
-      DCHECK_EQ(fde->sym_addr, method_info.code_address);
-      DCHECK_EQ(fde->sym_size, method_info.code_size);
-      num_fdes++;
-    });
+    reader.VisitDebugFrame([&]([[maybe_unused]] const Reader::CIE* cie) { num_cies++; },
+                           [&](const Reader::FDE* fde, [[maybe_unused]] const Reader::CIE* cie) {
+                             DCHECK_EQ(fde->sym_addr, method_info.code_address);
+                             DCHECK_EQ(fde->sym_size, method_info.code_size);
+                             num_fdes++;
+                           });
     DCHECK_EQ(num_syms, 1u);
     DCHECK_LE(num_cies, 1u);
     DCHECK_LE(num_fdes, 1u);
@@ -302,18 +300,20 @@
     // ART always produces the same CIE, so we copy the first one and ignore the rest.
     bool copied_cie = false;
     for (Reader& reader : readers) {
-      reader.VisitDebugFrame([&](const Reader::CIE* cie) {
-        if (!copied_cie) {
-          debug_frame->WriteFully(cie->data(), cie->size());
-          copied_cie = true;
-        }
-      }, [&](const Reader::FDE* fde, const Reader::CIE* cie ATTRIBUTE_UNUSED) {
-        DCHECK(copied_cie);
-        DCHECK_EQ(fde->cie_pointer, 0);
-        if (!is_removed_symbol(fde->sym_addr)) {
-          debug_frame->WriteFully(fde->data(), fde->size());
-        }
-      });
+      reader.VisitDebugFrame(
+          [&](const Reader::CIE* cie) {
+            if (!copied_cie) {
+              debug_frame->WriteFully(cie->data(), cie->size());
+              copied_cie = true;
+            }
+          },
+          [&](const Reader::FDE* fde, [[maybe_unused]] const Reader::CIE* cie) {
+            DCHECK(copied_cie);
+            DCHECK_EQ(fde->cie_pointer, 0);
+            if (!is_removed_symbol(fde->sym_addr)) {
+              debug_frame->WriteFully(fde->data(), fde->size());
+            }
+          });
     }
     debug_frame->End();
 
@@ -348,9 +348,8 @@
 
 std::vector<uint8_t> WriteDebugElfFileForClasses(
     InstructionSet isa,
-    const InstructionSetFeatures* features ATTRIBUTE_UNUSED,
-    const ArrayRef<mirror::Class*>& types)
-    REQUIRES_SHARED(Locks::mutator_lock_) {
+    [[maybe_unused]] const InstructionSetFeatures* features,
+    const ArrayRef<mirror::Class*>& types) REQUIRES_SHARED(Locks::mutator_lock_) {
   using ElfTypes = ElfRuntimeTypes;
   CHECK_EQ(sizeof(ElfTypes::Addr), static_cast<size_t>(GetInstructionSetPointerSize(isa)));
   std::vector<uint8_t> buffer;
diff --git a/compiler/dex/inline_method_analyser.cc b/compiler/dex/inline_method_analyser.cc
index 381db3d..91944b0 100644
--- a/compiler/dex/inline_method_analyser.cc
+++ b/compiler/dex/inline_method_analyser.cc
@@ -152,8 +152,7 @@
   if (kIsDebugBuild && target_method != nullptr) {
     CHECK(!target_method->IsStatic());
     CHECK(target_method->IsConstructor());
-    CHECK(target_method->GetDeclaringClass() == method->GetDeclaringClass() ||
-          target_method->GetDeclaringClass() == method->GetDeclaringClass()->GetSuperClass());
+    CHECK(method->GetDeclaringClass()->IsSubClass(target_method->GetDeclaringClass()));
   }
   return target_method;
 }
@@ -256,11 +255,11 @@
                           /*inout*/ ConstructorIPutData (&iputs)[kMaxConstructorIPuts])
     REQUIRES_SHARED(Locks::mutator_lock_) {
   // On entry we should not have any IPUTs yet.
-  DCHECK_EQ(0, std::count_if(
+  DCHECK(std::all_of(
       iputs,
       iputs + arraysize(iputs),
       [](const ConstructorIPutData& iput_data) {
-        return iput_data.field_index != DexFile::kDexNoIndex16;
+        return iput_data.field_index == DexFile::kDexNoIndex16;
       }));
 
   // Limit the maximum number of code units we're willing to match.
@@ -396,56 +395,36 @@
   return true;
 }
 
-static_assert(InlineMethodAnalyser::IsInstructionIGet(Instruction::IGET), "iget type");
-static_assert(InlineMethodAnalyser::IsInstructionIGet(Instruction::IGET_WIDE), "iget_wide type");
-static_assert(InlineMethodAnalyser::IsInstructionIGet(Instruction::IGET_OBJECT),
-              "iget_object type");
-static_assert(InlineMethodAnalyser::IsInstructionIGet(Instruction::IGET_BOOLEAN),
-              "iget_boolean type");
-static_assert(InlineMethodAnalyser::IsInstructionIGet(Instruction::IGET_BYTE), "iget_byte type");
-static_assert(InlineMethodAnalyser::IsInstructionIGet(Instruction::IGET_CHAR), "iget_char type");
-static_assert(InlineMethodAnalyser::IsInstructionIGet(Instruction::IGET_SHORT), "iget_short type");
-static_assert(InlineMethodAnalyser::IsInstructionIPut(Instruction::IPUT), "iput type");
-static_assert(InlineMethodAnalyser::IsInstructionIPut(Instruction::IPUT_WIDE), "iput_wide type");
-static_assert(InlineMethodAnalyser::IsInstructionIPut(Instruction::IPUT_OBJECT),
-              "iput_object type");
-static_assert(InlineMethodAnalyser::IsInstructionIPut(Instruction::IPUT_BOOLEAN),
-              "iput_boolean type");
-static_assert(InlineMethodAnalyser::IsInstructionIPut(Instruction::IPUT_BYTE), "iput_byte type");
-static_assert(InlineMethodAnalyser::IsInstructionIPut(Instruction::IPUT_CHAR), "iput_char type");
-static_assert(InlineMethodAnalyser::IsInstructionIPut(Instruction::IPUT_SHORT), "iput_short type");
-static_assert(InlineMethodAnalyser::IGetVariant(Instruction::IGET) ==
-    InlineMethodAnalyser::IPutVariant(Instruction::IPUT), "iget/iput variant");
-static_assert(InlineMethodAnalyser::IGetVariant(Instruction::IGET_WIDE) ==
-    InlineMethodAnalyser::IPutVariant(Instruction::IPUT_WIDE), "iget/iput_wide variant");
-static_assert(InlineMethodAnalyser::IGetVariant(Instruction::IGET_OBJECT) ==
-    InlineMethodAnalyser::IPutVariant(Instruction::IPUT_OBJECT), "iget/iput_object variant");
-static_assert(InlineMethodAnalyser::IGetVariant(Instruction::IGET_BOOLEAN) ==
-    InlineMethodAnalyser::IPutVariant(Instruction::IPUT_BOOLEAN), "iget/iput_boolean variant");
-static_assert(InlineMethodAnalyser::IGetVariant(Instruction::IGET_BYTE) ==
-    InlineMethodAnalyser::IPutVariant(Instruction::IPUT_BYTE), "iget/iput_byte variant");
-static_assert(InlineMethodAnalyser::IGetVariant(Instruction::IGET_CHAR) ==
-    InlineMethodAnalyser::IPutVariant(Instruction::IPUT_CHAR), "iget/iput_char variant");
-static_assert(InlineMethodAnalyser::IGetVariant(Instruction::IGET_SHORT) ==
-    InlineMethodAnalyser::IPutVariant(Instruction::IPUT_SHORT), "iget/iput_short variant");
+static_assert(IsInstructionIGet(Instruction::IGET));
+static_assert(IsInstructionIGet(Instruction::IGET_WIDE));
+static_assert(IsInstructionIGet(Instruction::IGET_OBJECT));
+static_assert(IsInstructionIGet(Instruction::IGET_BOOLEAN));
+static_assert(IsInstructionIGet(Instruction::IGET_BYTE));
+static_assert(IsInstructionIGet(Instruction::IGET_CHAR));
+static_assert(IsInstructionIGet(Instruction::IGET_SHORT));
+static_assert(IsInstructionIPut(Instruction::IPUT));
+static_assert(IsInstructionIPut(Instruction::IPUT_WIDE));
+static_assert(IsInstructionIPut(Instruction::IPUT_OBJECT));
+static_assert(IsInstructionIPut(Instruction::IPUT_BOOLEAN));
+static_assert(IsInstructionIPut(Instruction::IPUT_BYTE));
+static_assert(IsInstructionIPut(Instruction::IPUT_CHAR));
+static_assert(IsInstructionIPut(Instruction::IPUT_SHORT));
+static_assert(IGetMemAccessType(Instruction::IGET) == IPutMemAccessType(Instruction::IPUT));
+static_assert(
+    IGetMemAccessType(Instruction::IGET_WIDE) == IPutMemAccessType(Instruction::IPUT_WIDE));
+static_assert(
+    IGetMemAccessType(Instruction::IGET_OBJECT) == IPutMemAccessType(Instruction::IPUT_OBJECT));
+static_assert(
+    IGetMemAccessType(Instruction::IGET_BOOLEAN) == IPutMemAccessType(Instruction::IPUT_BOOLEAN));
+static_assert(
+    IGetMemAccessType(Instruction::IGET_BYTE) == IPutMemAccessType(Instruction::IPUT_BYTE));
+static_assert(
+    IGetMemAccessType(Instruction::IGET_CHAR) == IPutMemAccessType(Instruction::IPUT_CHAR));
+static_assert(
+    IGetMemAccessType(Instruction::IGET_SHORT) == IPutMemAccessType(Instruction::IPUT_SHORT));
 
-bool InlineMethodAnalyser::AnalyseMethodCode(ArtMethod* method, InlineMethod* result) {
-  CodeItemDataAccessor code_item(method->DexInstructionData());
-  if (!code_item.HasCodeItem()) {
-    // Native or abstract.
-    return false;
-  }
-  return AnalyseMethodCode(&code_item,
-                           MethodReference(method->GetDexFile(), method->GetDexMethodIndex()),
-                           method->IsStatic(),
-                           method,
-                           result);
-}
-
-bool InlineMethodAnalyser::AnalyseMethodCode(const CodeItemDataAccessor* code_item,
-                                             const MethodReference& method_ref,
-                                             bool is_static,
-                                             ArtMethod* method,
+bool InlineMethodAnalyser::AnalyseMethodCode(ArtMethod* method,
+                                             const CodeItemDataAccessor* code_item,
                                              InlineMethod* result) {
   // We currently support only plain return or 2-instruction methods.
 
@@ -488,11 +467,7 @@
     case Instruction::IGET_CHAR:
     case Instruction::IGET_SHORT:
     case Instruction::IGET_WIDE:
-    // TODO: Add handling for JIT.
-    // case Instruction::IGET_QUICK:
-    // case Instruction::IGET_WIDE_QUICK:
-    // case Instruction::IGET_OBJECT_QUICK:
-      return AnalyseIGetMethod(code_item, method_ref, is_static, method, result);
+      return AnalyseIGetMethod(method, code_item, result);
     case Instruction::IPUT:
     case Instruction::IPUT_OBJECT:
     case Instruction::IPUT_BOOLEAN:
@@ -500,19 +475,16 @@
     case Instruction::IPUT_CHAR:
     case Instruction::IPUT_SHORT:
     case Instruction::IPUT_WIDE:
-      // TODO: Add handling for JIT.
-    // case Instruction::IPUT_QUICK:
-    // case Instruction::IPUT_WIDE_QUICK:
-    // case Instruction::IPUT_OBJECT_QUICK:
-      return AnalyseIPutMethod(code_item, method_ref, is_static, method, result);
+      return AnalyseIPutMethod(method, code_item, result);
     default:
       return false;
   }
 }
 
-bool InlineMethodAnalyser::IsSyntheticAccessor(MethodReference ref) {
-  const dex::MethodId& method_id = ref.dex_file->GetMethodId(ref.index);
-  const char* method_name = ref.dex_file->GetMethodName(method_id);
+bool InlineMethodAnalyser::IsSyntheticAccessor(ArtMethod* method) {
+  const DexFile* dex_file = method->GetDexFile();
+  const dex::MethodId& method_id = dex_file->GetMethodId(method->GetDexMethodIndex());
+  const char* method_name = dex_file->GetMethodName(method_id);
   // javac names synthetic accessors "access$nnn",
   // jack names them "-getN", "-putN", "-wrapN".
   return strncmp(method_name, "access$", strlen("access$")) == 0 ||
@@ -572,10 +544,8 @@
   return true;
 }
 
-bool InlineMethodAnalyser::AnalyseIGetMethod(const CodeItemDataAccessor* code_item,
-                                             const MethodReference& method_ref,
-                                             bool is_static,
-                                             ArtMethod* method,
+bool InlineMethodAnalyser::AnalyseIGetMethod(ArtMethod* method,
+                                             const CodeItemDataAccessor* code_item,
                                              InlineMethod* result) {
   DexInstructionIterator instruction = code_item->begin();
   Instruction::Code opcode = instruction->Opcode();
@@ -607,39 +577,37 @@
     return false;  // Not returning the value retrieved by IGET?
   }
 
-  if (is_static || object_arg != 0u) {
-    // TODO: Implement inlining of IGET on non-"this" registers (needs correct stack trace for NPE).
-    // Allow synthetic accessors. We don't care about losing their stack frame in NPE.
-    if (!IsSyntheticAccessor(method_ref)) {
-      return false;
-    }
-  }
-
   // InlineIGetIPutData::object_arg is only 4 bits wide.
   static constexpr uint16_t kMaxObjectArg = 15u;
   if (object_arg > kMaxObjectArg) {
     return false;
   }
 
-  if (result != nullptr) {
-    InlineIGetIPutData* data = &result->d.ifield_data;
-    if (!ComputeSpecialAccessorInfo(method, field_idx, false, data)) {
+  bool is_static = method->IsStatic();
+  if (is_static || object_arg != 0u) {
+    // TODO: Implement inlining of IGET on non-"this" registers (needs correct stack trace for NPE).
+    // Allow synthetic accessors. We don't care about losing their stack frame in NPE.
+    if (!IsSyntheticAccessor(method)) {
       return false;
     }
-    result->opcode = kInlineOpIGet;
-    data->op_variant = IGetVariant(opcode);
-    data->method_is_static = is_static ? 1u : 0u;
-    data->object_arg = object_arg;  // Allow IGET on any register, not just "this".
-    data->src_arg = 0u;
-    data->return_arg_plus1 = 0u;
   }
+
+  DCHECK(result != nullptr);
+  InlineIGetIPutData* data = &result->d.ifield_data;
+  if (!ComputeSpecialAccessorInfo(method, field_idx, false, data)) {
+    return false;
+  }
+  result->opcode = kInlineOpIGet;
+  data->op_variant = enum_cast<uint16_t>(IGetMemAccessType(opcode));
+  data->method_is_static = is_static ? 1u : 0u;
+  data->object_arg = object_arg;  // Allow IGET on any register, not just "this".
+  data->src_arg = 0u;
+  data->return_arg_plus1 = 0u;
   return true;
 }
 
-bool InlineMethodAnalyser::AnalyseIPutMethod(const CodeItemDataAccessor* code_item,
-                                             const MethodReference& method_ref,
-                                             bool is_static,
-                                             ArtMethod* method,
+bool InlineMethodAnalyser::AnalyseIPutMethod(ArtMethod* method,
+                                             const CodeItemDataAccessor* code_item,
                                              InlineMethod* result) {
   DexInstructionIterator instruction = code_item->begin();
   Instruction::Code opcode = instruction->Opcode();
@@ -673,14 +641,6 @@
   uint32_t object_arg = object_reg - arg_start;
   uint32_t src_arg = src_reg - arg_start;
 
-  if (is_static || object_arg != 0u) {
-    // TODO: Implement inlining of IPUT on non-"this" registers (needs correct stack trace for NPE).
-    // Allow synthetic accessors. We don't care about losing their stack frame in NPE.
-    if (!IsSyntheticAccessor(method_ref)) {
-      return false;
-    }
-  }
-
   // InlineIGetIPutData::object_arg/src_arg/return_arg_plus1 are each only 4 bits wide.
   static constexpr uint16_t kMaxObjectArg = 15u;
   static constexpr uint16_t kMaxSrcArg = 15u;
@@ -689,18 +649,26 @@
     return false;
   }
 
-  if (result != nullptr) {
-    InlineIGetIPutData* data = &result->d.ifield_data;
-    if (!ComputeSpecialAccessorInfo(method, field_idx, true, data)) {
+  bool is_static = method->IsStatic();
+  if (is_static || object_arg != 0u) {
+    // TODO: Implement inlining of IPUT on non-"this" registers (needs correct stack trace for NPE).
+    // Allow synthetic accessors. We don't care about losing their stack frame in NPE.
+    if (!IsSyntheticAccessor(method)) {
       return false;
     }
-    result->opcode = kInlineOpIPut;
-    data->op_variant = IPutVariant(opcode);
-    data->method_is_static = is_static ? 1u : 0u;
-    data->object_arg = object_arg;  // Allow IPUT on any register, not just "this".
-    data->src_arg = src_arg;
-    data->return_arg_plus1 = return_arg_plus1;
   }
+
+  DCHECK(result != nullptr);
+  InlineIGetIPutData* data = &result->d.ifield_data;
+  if (!ComputeSpecialAccessorInfo(method, field_idx, true, data)) {
+    return false;
+  }
+  result->opcode = kInlineOpIPut;
+  data->op_variant = enum_cast<uint16_t>(IPutMemAccessType(opcode));
+  data->method_is_static = is_static ? 1u : 0u;
+  data->object_arg = object_arg;  // Allow IPUT on any register, not just "this".
+  data->src_arg = src_arg;
+  data->return_arg_plus1 = return_arg_plus1;
   return true;
 }
 
diff --git a/compiler/dex/inline_method_analyser.h b/compiler/dex/inline_method_analyser.h
index 99d07c6..4cd5b82 100644
--- a/compiler/dex/inline_method_analyser.h
+++ b/compiler/dex/inline_method_analyser.h
@@ -21,7 +21,6 @@
 #include "base/mutex.h"
 #include "dex/dex_file.h"
 #include "dex/dex_instruction.h"
-#include "dex/method_reference.h"
 
 /*
  * NOTE: This code is part of the quick compiler. It lives in the runtime
@@ -100,47 +99,23 @@
    *
    * @return true if the method is a candidate for inlining, false otherwise.
    */
-  static bool AnalyseMethodCode(ArtMethod* method, InlineMethod* result)
+  static bool AnalyseMethodCode(ArtMethod* method,
+                                const CodeItemDataAccessor* code_item,
+                                InlineMethod* result)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  static constexpr bool IsInstructionIGet(Instruction::Code opcode) {
-    return Instruction::IGET <= opcode && opcode <= Instruction::IGET_SHORT;
-  }
-
-  static constexpr bool IsInstructionIPut(Instruction::Code opcode) {
-    return Instruction::IPUT <= opcode && opcode <= Instruction::IPUT_SHORT;
-  }
-
-  static constexpr uint16_t IGetVariant(Instruction::Code opcode) {
-    return opcode - Instruction::IGET;
-  }
-
-  static constexpr uint16_t IPutVariant(Instruction::Code opcode) {
-    return opcode - Instruction::IPUT;
-  }
-
   // Determines whether the method is a synthetic accessor (method name starts with "access$").
-  static bool IsSyntheticAccessor(MethodReference ref);
+  static bool IsSyntheticAccessor(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_);
 
  private:
-  static bool AnalyseMethodCode(const CodeItemDataAccessor* code_item,
-                                const MethodReference& method_ref,
-                                bool is_static,
-                                ArtMethod* method,
-                                InlineMethod* result)
-      REQUIRES_SHARED(Locks::mutator_lock_);
   static bool AnalyseReturnMethod(const CodeItemDataAccessor* code_item, InlineMethod* result);
   static bool AnalyseConstMethod(const CodeItemDataAccessor* code_item, InlineMethod* result);
-  static bool AnalyseIGetMethod(const CodeItemDataAccessor* code_item,
-                                const MethodReference& method_ref,
-                                bool is_static,
-                                ArtMethod* method,
+  static bool AnalyseIGetMethod(ArtMethod* method,
+                                const CodeItemDataAccessor* code_item,
                                 InlineMethod* result)
       REQUIRES_SHARED(Locks::mutator_lock_);
-  static bool AnalyseIPutMethod(const CodeItemDataAccessor* code_item,
-                                const MethodReference& method_ref,
-                                bool is_static,
-                                ArtMethod* method,
+  static bool AnalyseIPutMethod(ArtMethod* method,
+                                const CodeItemDataAccessor* code_item,
                                 InlineMethod* result)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
diff --git a/compiler/driver/compiler_options.cc b/compiler/driver/compiler_options.cc
index 603596f..36943a0 100644
--- a/compiler/driver/compiler_options.cc
+++ b/compiler/driver/compiler_options.cc
@@ -40,8 +40,6 @@
 CompilerOptions::CompilerOptions()
     : compiler_filter_(CompilerFilter::kDefaultCompilerFilter),
       huge_method_threshold_(kDefaultHugeMethodThreshold),
-      large_method_threshold_(kDefaultLargeMethodThreshold),
-      num_dex_methods_threshold_(kDefaultNumDexMethodsThreshold),
       inline_max_code_units_(kUnsetInlineMaxCodeUnits),
       instruction_set_(kRuntimeISA == InstructionSet::kArm ? InstructionSet::kThumb2 : kRuntimeISA),
       instruction_set_features_(nullptr),
@@ -52,19 +50,20 @@
       image_type_(ImageType::kNone),
       multi_image_(false),
       compile_art_test_(false),
+      emit_read_barrier_(false),
       baseline_(false),
       debuggable_(false),
       generate_debug_info_(kDefaultGenerateDebugInfo),
       generate_mini_debug_info_(kDefaultGenerateMiniDebugInfo),
       generate_build_id_(false),
-      implicit_null_checks_(true),
+      implicit_null_checks_(false),
       implicit_so_checks_(true),
       implicit_suspend_checks_(false),
       compile_pic_(false),
       dump_timings_(false),
       dump_pass_timings_(false),
       dump_stats_(false),
-      top_k_profile_threshold_(kDefaultTopKProfileThreshold),
+      profile_branches_(false),
       profile_compilation_info_(nullptr),
       verbose_methods_(),
       abort_on_hard_verifier_failure_(false),
@@ -121,9 +120,10 @@
   if (option == "linear-scan") {
     register_allocation_strategy_ = RegisterAllocator::Strategy::kRegisterAllocatorLinearScan;
   } else if (option == "graph-color") {
-    register_allocation_strategy_ = RegisterAllocator::Strategy::kRegisterAllocatorGraphColor;
+    LOG(ERROR) << "Graph coloring allocator has been removed, using linear scan instead.";
+    register_allocation_strategy_ = RegisterAllocator::Strategy::kRegisterAllocatorLinearScan;
   } else {
-    *error_msg = "Unrecognized register allocation strategy. Try linear-scan, or graph-color.";
+    *error_msg = "Unrecognized register allocation strategy. Try linear-scan.";
     return false;
   }
   return true;
diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h
index c8a41ce..6b3e26f 100644
--- a/compiler/driver/compiler_options.h
+++ b/compiler/driver/compiler_options.h
@@ -42,6 +42,7 @@
 
 namespace linker {
 class Arm64RelativePatcherTest;
+class Thumb2RelativePatcherTest;
 }  // namespace linker
 
 class ArtMethod;
@@ -59,15 +60,16 @@
 
 class CompilerOptions final {
  public:
-  // Guide heuristics to determine whether to compile method if profile data not available.
-  static const size_t kDefaultHugeMethodThreshold = 10000;
-  static const size_t kDefaultLargeMethodThreshold = 600;
-  static const size_t kDefaultNumDexMethodsThreshold = 900;
-  static constexpr double kDefaultTopKProfileThreshold = 90.0;
-  static const bool kDefaultGenerateDebugInfo = false;
-  static const bool kDefaultGenerateMiniDebugInfo = true;
-  static const size_t kDefaultInlineMaxCodeUnits = 32;
+  // Default values for parameters set via flags.
+  static constexpr bool kDefaultGenerateDebugInfo = false;
+  static constexpr bool kDefaultGenerateMiniDebugInfo = true;
+  static constexpr size_t kDefaultHugeMethodThreshold = 10000;
+  static constexpr size_t kDefaultInlineMaxCodeUnits = 32;
+  // Token to represent no value set for `inline_max_code_units_`.
   static constexpr size_t kUnsetInlineMaxCodeUnits = -1;
+  // We set a lower inlining threshold for baseline to reduce code size and compilation time. This
+  // cannot be changed via flags.
+  static constexpr size_t kBaselineInlineMaxCodeUnits = 14;
 
   enum class CompilerType : uint8_t {
     kAotCompiler,             // AOT compiler.
@@ -115,31 +117,17 @@
   }
 
   bool IsAnyCompilationEnabled() const {
-    return CompilerFilter::IsAnyCompilationEnabled(compiler_filter_) &&
-           // TODO(riscv64): remove this when we have compiler support for RISC-V
-           GetInstructionSet() != InstructionSet::kRiscv64;
+    return CompilerFilter::IsAnyCompilationEnabled(compiler_filter_);
   }
 
   size_t GetHugeMethodThreshold() const {
     return huge_method_threshold_;
   }
 
-  size_t GetLargeMethodThreshold() const {
-    return large_method_threshold_;
-  }
-
   bool IsHugeMethod(size_t num_dalvik_instructions) const {
     return num_dalvik_instructions > huge_method_threshold_;
   }
 
-  bool IsLargeMethod(size_t num_dalvik_instructions) const {
-    return num_dalvik_instructions > large_method_threshold_;
-  }
-
-  size_t GetNumDexMethodsThreshold() const {
-    return num_dex_methods_threshold_;
-  }
-
   size_t GetInlineMaxCodeUnits() const {
     return inline_max_code_units_;
   }
@@ -147,8 +135,8 @@
     inline_max_code_units_ = units;
   }
 
-  double GetTopKProfileThreshold() const {
-    return top_k_profile_threshold_;
+  bool EmitReadBarrier() const {
+    return emit_read_barrier_;
   }
 
   bool GetDebuggable() const {
@@ -227,6 +215,10 @@
     return baseline_;
   }
 
+  bool ProfileBranches() const {
+    return profile_branches_;
+  }
+
   // Are we compiling an app image?
   bool IsAppImage() const {
     return image_type_ == ImageType::kAppImage;
@@ -395,8 +387,6 @@
 
   CompilerFilter::Filter compiler_filter_;
   size_t huge_method_threshold_;
-  size_t large_method_threshold_;
-  size_t num_dex_methods_threshold_;
   size_t inline_max_code_units_;
 
   InstructionSet instruction_set_;
@@ -422,6 +412,7 @@
   ImageType image_type_;
   bool multi_image_;
   bool compile_art_test_;
+  bool emit_read_barrier_;
   bool baseline_;
   bool debuggable_;
   bool generate_debug_info_;
@@ -434,9 +425,7 @@
   bool dump_timings_;
   bool dump_pass_timings_;
   bool dump_stats_;
-
-  // When using a profile file only the top K% of the profiled samples will be compiled.
-  double top_k_profile_threshold_;
+  bool profile_branches_;
 
   // Info for profile guided compilation.
   const ProfileCompilationInfo* profile_compilation_info_;
@@ -504,6 +493,7 @@
   friend class jit::JitCompiler;
   friend class verifier::VerifierDepsTest;
   friend class linker::Arm64RelativePatcherTest;
+  friend class linker::Thumb2RelativePatcherTest;
 
   template <class Base>
   friend bool ReadCompilerOptions(Base& map, CompilerOptions* options, std::string* error_msg);
diff --git a/compiler/driver/compiler_options_map-inl.h b/compiler/driver/compiler_options_map-inl.h
index 79a5962..317b286 100644
--- a/compiler/driver/compiler_options_map-inl.h
+++ b/compiler/driver/compiler_options_map-inl.h
@@ -57,8 +57,6 @@
   }
   map.AssignIfExists(Base::CompileArtTest, &options->compile_art_test_);
   map.AssignIfExists(Base::HugeMethodMaxThreshold, &options->huge_method_threshold_);
-  map.AssignIfExists(Base::LargeMethodMaxThreshold, &options->large_method_threshold_);
-  map.AssignIfExists(Base::NumDexMethodsThreshold, &options->num_dex_methods_threshold_);
   map.AssignIfExists(Base::InlineMaxCodeUnitsThreshold, &options->inline_max_code_units_);
   map.AssignIfExists(Base::GenerateDebugInfo, &options->generate_debug_info_);
   map.AssignIfExists(Base::GenerateMiniDebugInfo, &options->generate_mini_debug_info_);
@@ -69,7 +67,9 @@
   if (map.Exists(Base::Baseline)) {
     options->baseline_ = true;
   }
-  map.AssignIfExists(Base::TopKProfileThreshold, &options->top_k_profile_threshold_);
+  if (map.Exists(Base::ProfileBranches)) {
+    options->profile_branches_ = true;
+  }
   map.AssignIfExists(Base::AbortOnHardVerifierFailure, &options->abort_on_hard_verifier_failure_);
   map.AssignIfExists(Base::AbortOnSoftVerifierFailure, &options->abort_on_soft_verifier_failure_);
   if (map.Exists(Base::DumpInitFailures)) {
@@ -117,7 +117,7 @@
 #pragma GCC diagnostic ignored "-Wframe-larger-than="
 
 template <typename Map, typename Builder>
-inline void AddCompilerOptionsArgumentParserOptions(Builder& b) {
+NO_INLINE void AddCompilerOptionsArgumentParserOptions(Builder& b) {
   // clang-format off
   b.
       Define("--compiler-filter=_")
@@ -133,16 +133,6 @@
           .template WithType<unsigned int>()
           .WithHelp("threshold size for a huge method for compiler filter tuning.")
           .IntoKey(Map::HugeMethodMaxThreshold)
-      .Define("--large-method-max=_")
-          .template WithType<unsigned int>()
-          .WithHelp("threshold size for a large method for compiler filter tuning.")
-          .IntoKey(Map::LargeMethodMaxThreshold)
-      .Define("--num-dex-methods=_")
-          .template WithType<unsigned int>()
-          .WithHelp("threshold size for a small dex file for compiler filter tuning. If the input\n"
-                    "has fewer than this many methods and the filter is not interpret-only or\n"
-                    "verify-none or verify-at-runtime, overrides the filter to use speed")
-          .IntoKey(Map::NumDexMethodsThreshold)
       .Define("--inline-max-code-units=_")
           .template WithType<unsigned int>()
           .WithHelp("the maximum code units that a methodcan have to be considered for inlining.\n"
@@ -206,9 +196,9 @@
           .WithHelp("Produce code using the baseline compilation")
           .IntoKey(Map::Baseline)
 
-      .Define("--top-k-profile-threshold=_")
-          .template WithType<double>().WithRange(0.0, 100.0)
-          .IntoKey(Map::TopKProfileThreshold)
+      .Define("--profile-branches")
+          .WithHelp("Profile branches in baseline generated code")
+          .IntoKey(Map::ProfileBranches)
 
       .Define({"--abort-on-hard-verifier-error", "--no-abort-on-hard-verifier-error"})
           .WithValues({true, false})
@@ -256,7 +246,13 @@
       .Define("--max-image-block-size=_")
           .template WithType<unsigned int>()
           .WithHelp("Maximum solid block size for compressed images.")
-          .IntoKey(Map::MaxImageBlockSize);
+          .IntoKey(Map::MaxImageBlockSize)
+      // Obsolete flags
+      .Ignore({
+        "--num-dex-methods=_",
+        "--top-k-profile-threshold=_",
+        "--large-method-max=_",
+      });
   // clang-format on
 }
 
diff --git a/compiler/driver/compiler_options_map.def b/compiler/driver/compiler_options_map.def
index b1398c9..767a86c 100644
--- a/compiler/driver/compiler_options_map.def
+++ b/compiler/driver/compiler_options_map.def
@@ -40,15 +40,13 @@
 COMPILER_OPTIONS_KEY (bool,                        CompileArtTest)
 COMPILER_OPTIONS_KEY (Unit,                        PIC)
 COMPILER_OPTIONS_KEY (unsigned int,                HugeMethodMaxThreshold)
-COMPILER_OPTIONS_KEY (unsigned int,                LargeMethodMaxThreshold)
-COMPILER_OPTIONS_KEY (unsigned int,                NumDexMethodsThreshold)
 COMPILER_OPTIONS_KEY (unsigned int,                InlineMaxCodeUnitsThreshold)
 COMPILER_OPTIONS_KEY (bool,                        GenerateDebugInfo)
 COMPILER_OPTIONS_KEY (bool,                        GenerateMiniDebugInfo)
 COMPILER_OPTIONS_KEY (bool,                        GenerateBuildID)
 COMPILER_OPTIONS_KEY (Unit,                        Debuggable)
 COMPILER_OPTIONS_KEY (Unit,                        Baseline)
-COMPILER_OPTIONS_KEY (double,                      TopKProfileThreshold)
+COMPILER_OPTIONS_KEY (Unit,                        ProfileBranches)
 COMPILER_OPTIONS_KEY (bool,                        AbortOnHardVerifierFailure)
 COMPILER_OPTIONS_KEY (bool,                        AbortOnSoftVerifierFailure)
 COMPILER_OPTIONS_KEY (bool,                        ResolveStartupConstStrings, false)
diff --git a/compiler/exception_test.cc b/compiler/exception_test.cc
index 82c4998..b90b082 100644
--- a/compiler/exception_test.cc
+++ b/compiler/exception_test.cc
@@ -38,7 +38,7 @@
 #include "mirror/object-inl.h"
 #include "mirror/object_array-inl.h"
 #include "mirror/stack_trace_element-inl.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "obj_ptr-inl.h"
 #include "optimizing/stack_map_stream.h"
 #include "runtime-inl.h"
@@ -69,9 +69,10 @@
 
     dex_ = my_klass_->GetDexCache()->GetDexFile();
 
+    std::vector<uint8_t> fake_code;
     uint32_t code_size = 12;
     for (size_t i = 0 ; i < code_size; i++) {
-      fake_code_.push_back(0x70 | i);
+      fake_code.push_back(0x70 | i);
     }
 
     const uint32_t native_pc_offset = 4u;
@@ -96,16 +97,23 @@
     const size_t header_size = sizeof(OatQuickMethodHeader);
     const size_t code_alignment = GetInstructionSetCodeAlignment(kRuntimeISA);
 
-    fake_header_code_and_maps_.resize(stack_maps_size + header_size + code_size + code_alignment);
-    // NB: The start of the vector might not have been allocated the desired alignment.
+    fake_header_code_and_maps_size_ = stack_maps_size + header_size + code_size + code_alignment;
+    // Use mmap to make sure we get untagged memory here. Real code gets allocated using
+    // mspace_memalign which is never tagged.
+    fake_header_code_and_maps_ = static_cast<uint8_t*>(mmap(nullptr,
+                                                            fake_header_code_and_maps_size_,
+                                                            PROT_READ | PROT_WRITE,
+                                                            MAP_PRIVATE | MAP_ANONYMOUS,
+                                                            -1,
+                                                            0));
     uint8_t* code_ptr =
       AlignUp(&fake_header_code_and_maps_[stack_maps_size + header_size], code_alignment);
 
     memcpy(&fake_header_code_and_maps_[0], stack_map.data(), stack_maps_size);
-    OatQuickMethodHeader method_header(code_ptr - fake_header_code_and_maps_.data());
+    OatQuickMethodHeader method_header(code_ptr - fake_header_code_and_maps_);
     static_assert(std::is_trivially_copyable<OatQuickMethodHeader>::value, "Cannot use memcpy");
     memcpy(code_ptr - header_size, &method_header, header_size);
-    memcpy(code_ptr, fake_code_.data(), fake_code_.size());
+    memcpy(code_ptr, fake_code.data(), fake_code.size());
 
     if (kRuntimeISA == InstructionSet::kArm) {
       // Check that the Thumb2 adjustment will be a NOP, see EntryPointToCodePointer().
@@ -123,10 +131,12 @@
     method_g_->SetEntryPointFromQuickCompiledCode(code_ptr);
   }
 
+  void TearDown() override { munmap(fake_header_code_and_maps_, fake_header_code_and_maps_size_); }
+
   const DexFile* dex_;
 
-  std::vector<uint8_t> fake_code_;
-  std::vector<uint8_t> fake_header_code_and_maps_;
+  size_t fake_header_code_and_maps_size_;
+  uint8_t* fake_header_code_and_maps_;
 
   ArtMethod* method_f_;
   ArtMethod* method_g_;
diff --git a/compiler/export/jit_create.h b/compiler/export/jit_create.h
new file mode 100644
index 0000000..53dd45e
--- /dev/null
+++ b/compiler/export/jit_create.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_COMPILER_EXPORT_JIT_CREATE_H_
+#define ART_COMPILER_EXPORT_JIT_CREATE_H_
+
+#include "base/macros.h"
+
+namespace art HIDDEN {
+namespace jit {
+
+class JitCompilerInterface;
+
+// Used in `libart-runtime` to create `libart-compiler` JIT.
+JitCompilerInterface* jit_create();
+
+}  // namespace jit
+}  // namespace art
+
+#endif  // ART_COMPILER_EXPORT_JIT_CREATE_H_
diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc
index e672367..c14d5d3 100644
--- a/compiler/jit/jit_compiler.cc
+++ b/compiler/jit/jit_compiler.cc
@@ -17,7 +17,6 @@
 #include "jit_compiler.h"
 
 #include "android-base/stringprintf.h"
-
 #include "arch/instruction_set.h"
 #include "arch/instruction_set_features.h"
 #include "art_method-inl.h"
@@ -29,6 +28,7 @@
 #include "compiler.h"
 #include "debug/elf_debug_writer.h"
 #include "driver/compiler_options.h"
+#include "export/jit_create.h"
 #include "jit/debugger_interface.h"
 #include "jit/jit.h"
 #include "jit/jit_code_cache.h"
@@ -66,6 +66,9 @@
   // JIT is never PIC, no matter what the runtime compiler options specify.
   compiler_options_->SetNonPic();
 
+  // Set the appropriate read barrier option.
+  compiler_options_->emit_read_barrier_ = gUseReadBarrier;
+
   // If the options don't provide whether we generate debuggable code, set
   // debuggability based on the runtime value.
   if (!compiler_options_->GetDebuggable()) {
@@ -125,7 +128,7 @@
   }
 }
 
-EXPORT extern "C" JitCompilerInterface* jit_load() {
+JitCompilerInterface* jit_create() {
   VLOG(jit) << "Create jit compiler";
   auto* const jit_compiler = JitCompiler::Create();
   CHECK(jit_compiler != nullptr);
@@ -188,6 +191,7 @@
 
   // Do the compilation.
   bool success = false;
+  Jit* jit = runtime->GetJit();
   {
     TimingLogger::ScopedTiming t2(compilation_kind == CompilationKind::kOsr
                                       ? "Compiling OSR"
@@ -195,7 +199,7 @@
                                           ? "Compiling optimized"
                                           : "Compiling baseline",
                                   &logger);
-    JitCodeCache* const code_cache = runtime->GetJit()->GetCodeCache();
+    JitCodeCache* const code_cache = jit->GetCodeCache();
     metrics::AutoTimer timer{runtime->GetMetrics()->JitMethodCompileTotalTime()};
     success = compiler_->JitCompile(
         self, code_cache, region, method, compilation_kind, jit_logger_.get());
@@ -207,14 +211,14 @@
     runtime->GetMetrics()->JitMethodCompileCountDelta()->AddOne();
   }
 
-  // Trim maps to reduce memory usage.
-  // TODO: move this to an idle phase.
-  {
+  // If we don't have a new task following this compile,
+  // trim maps to reduce memory usage.
+  if (jit->GetThreadPool() == nullptr || jit->GetThreadPool()->GetTaskCount(self) == 0) {
     TimingLogger::ScopedTiming t2("TrimMaps", &logger);
     runtime->GetJitArenaPool()->TrimMaps();
   }
 
-  runtime->GetJit()->AddTimingLogger(logger);
+  jit->AddTimingLogger(logger);
   return success;
 }
 
@@ -222,5 +226,9 @@
   return compiler_options_->IsBaseline();
 }
 
+uint32_t JitCompiler::GetInlineMaxCodeUnits() const {
+  return compiler_options_->GetInlineMaxCodeUnits();
+}
+
 }  // namespace jit
 }  // namespace art
diff --git a/compiler/jit/jit_compiler.h b/compiler/jit/jit_compiler.h
index 5a919fb..66aa545 100644
--- a/compiler/jit/jit_compiler.h
+++ b/compiler/jit/jit_compiler.h
@@ -64,6 +64,8 @@
                                          bool compress,
                                          /*out*/ size_t* num_symbols) override;
 
+  uint32_t GetInlineMaxCodeUnits() const override;
+
  private:
   std::unique_ptr<CompilerOptions> compiler_options_;
   std::unique_ptr<Compiler> compiler_;
diff --git a/compiler/jit/jit_logger.cc b/compiler/jit/jit_logger.cc
index 3284526..f192ce7 100644
--- a/compiler/jit/jit_logger.cc
+++ b/compiler/jit/jit_logger.cc
@@ -22,7 +22,7 @@
 #include "base/unix_file/fd_file.h"
 #include "jit/jit.h"
 #include "jit/jit_code_cache.h"
-#include "oat_file-inl.h"
+#include "oat/oat_file-inl.h"
 
 namespace art HIDDEN {
 namespace jit {
@@ -211,7 +211,7 @@
   int fd = jit_dump_file_->Fd();
   // The 'perf inject' tool requires that the jit-PID.dump file
   // must have a mmap(PROT_READ|PROT_EXEC) record in perf.data.
-  marker_address_ = mmap(nullptr, kPageSize, PROT_READ | PROT_EXEC, MAP_PRIVATE, fd, 0);
+  marker_address_ = mmap(nullptr, MemMap::GetPageSize(), PROT_READ | PROT_EXEC, MAP_PRIVATE, fd, 0);
   if (marker_address_ == MAP_FAILED) {
     LOG(WARNING) << "Failed to create record in perf.data. JITed code profiling will not work.";
     return;
@@ -220,7 +220,7 @@
 
 void JitLogger::CloseMarkerFile() {
   if (marker_address_ != nullptr) {
-    munmap(marker_address_, kPageSize);
+    munmap(marker_address_, MemMap::GetPageSize());
   }
 }
 
diff --git a/compiler/jit/jit_logger.h b/compiler/jit/jit_logger.h
index 9d1f307..79f47f8 100644
--- a/compiler/jit/jit_logger.h
+++ b/compiler/jit/jit_logger.h
@@ -53,7 +53,7 @@
 //
 //     Command line Example:
 //       $ perf record -k mono dalvikvm -Xcompiler-option --generate-debug-info -cp <classpath> Test
-//       $ perf inject -i perf.data -o perf.data.jitted
+//       $ perf inject -j -i perf.data -o perf.data.jitted
 //       $ perf report -i perf.data.jitted
 //       $ perf annotate -i perf.data.jitted
 //     NOTE:
diff --git a/compiler/jni/jni_cfi_test.cc b/compiler/jni/jni_cfi_test.cc
index 70cf2d4..6c9803f 100644
--- a/compiler/jni/jni_cfi_test.cc
+++ b/compiler/jni/jni_cfi_test.cc
@@ -33,9 +33,6 @@
 
 namespace art HIDDEN {
 
-// Run the tests only on host.
-#ifndef ART_TARGET_ANDROID
-
 class JNICFITest : public CFITest {
  public:
   // Enable this flag to generate the expected outputs.
@@ -99,7 +96,7 @@
     jni_asm->FinalizeCode();
     std::vector<uint8_t> actual_asm(jni_asm->CodeSize());
     MemoryRegion code(&actual_asm[0], actual_asm.size());
-    jni_asm->FinalizeInstructions(code);
+    jni_asm->CopyInstructions(code);
     ASSERT_EQ(jni_asm->cfi().GetCurrentCFAOffset(), frame_size);
     const std::vector<uint8_t>& actual_cfi = *(jni_asm->cfi().data());
 
@@ -125,31 +122,20 @@
     TestImpl(InstructionSet::isa, #isa, expected_asm, expected_cfi);  \
   }
 
-// We can't use compile-time macros for read-barrier as the introduction
-// of userfaultfd-GC has made it a runtime choice.
-#define TEST_ISA_ONLY_CC(isa)                                           \
-  TEST_F(JNICFITest, isa) {                                             \
-    if (kUseBakerReadBarrier && gUseReadBarrier) {                      \
-      std::vector<uint8_t> expected_asm(expected_asm_##isa,             \
-          expected_asm_##isa + arraysize(expected_asm_##isa));          \
-      std::vector<uint8_t> expected_cfi(expected_cfi_##isa,             \
-          expected_cfi_##isa + arraysize(expected_cfi_##isa));          \
-      TestImpl(InstructionSet::isa, #isa, expected_asm, expected_cfi);  \
-    }                                                                   \
-  }
-
 #ifdef ART_ENABLE_CODEGEN_arm
-// Run the tests for ARM only with Baker read barriers, as the
-// expected generated code contains a Marking Register refresh
-// instruction.
-TEST_ISA_ONLY_CC(kThumb2)
+// Run the tests for ARM only if the Marking Register is reserved as the
+// expected generated code contains a Marking Register refresh instruction.
+#if defined(RESERVE_MARKING_REGISTER)
+TEST_ISA(kThumb2)
+#endif
 #endif
 
 #ifdef ART_ENABLE_CODEGEN_arm64
-// Run the tests for ARM64 only with Baker read barriers, as the
-// expected generated code contains a Marking Register refresh
-// instruction.
-TEST_ISA_ONLY_CC(kArm64)
+// Run the tests for ARM64 only if the Marking Register is reserved as the
+// expected generated code contains a Marking Register refresh instruction.
+#if defined(RESERVE_MARKING_REGISTER)
+TEST_ISA(kArm64)
+#endif
 #endif
 
 #ifdef ART_ENABLE_CODEGEN_x86
@@ -160,6 +146,4 @@
 TEST_ISA(kX86_64)
 #endif
 
-#endif  // ART_TARGET_ANDROID
-
 }  // namespace art
diff --git a/compiler/jni/jni_cfi_test_expected.inc b/compiler/jni/jni_cfi_test_expected.inc
index 3fe8226..47a67c7 100644
--- a/compiler/jni/jni_cfi_test_expected.inc
+++ b/compiler/jni/jni_cfi_test_expected.inc
@@ -1,9 +1,12 @@
 // TODO These arrays should be generated automatically or have instructions for re-creation.
+// For now, the gc_is_marking offset can be adjusted by tweaking the last CL that made a
+// similar change.
+
 static constexpr uint8_t expected_asm_kThumb2[] = {
     0x2D, 0xE9, 0xE0, 0x4D, 0x2D, 0xED, 0x10, 0x8A, 0x81, 0xB0, 0x00, 0x90,
     0x19, 0x91, 0x8D, 0xED, 0x1A, 0x0A, 0x1B, 0x92, 0x1C, 0x93, 0x88, 0xB0,
     0x08, 0xB0, 0x01, 0xB0, 0xBD, 0xEC, 0x10, 0x8A, 0xBD, 0xE8, 0xE0, 0x4D,
-    0xD9, 0xF8, 0x24, 0x80, 0x70, 0x47,
+    0xD9, 0xF8, 0x20, 0x80, 0x70, 0x47,
 };
 static constexpr uint8_t expected_cfi_kThumb2[] = {
     0x44, 0x0E, 0x1C, 0x85, 0x07, 0x86, 0x06, 0x87, 0x05, 0x88, 0x04, 0x8A,
@@ -86,7 +89,7 @@
 // 0x00000024: .cfi_restore: r10
 // 0x00000024: .cfi_restore: r11
 // 0x00000024: .cfi_restore: r14
-// 0x00000024: ldr r8, [tr, #36] ; is_gc_marking
+// 0x00000024: ldr r8, [tr, #32] ; is_gc_marking
 // 0x00000028: bx lr
 // 0x0000002a: .cfi_restore_state
 // 0x0000002a: .cfi_def_cfa_offset: 112
@@ -101,7 +104,7 @@
     0xF3, 0x53, 0x45, 0xA9, 0xF5, 0x5B, 0x46, 0xA9, 0xF7, 0x63, 0x47, 0xA9,
     0xF9, 0x6B, 0x48, 0xA9, 0xFB, 0x73, 0x49, 0xA9, 0xFD, 0x7B, 0x4A, 0xA9,
     0xE8, 0x27, 0x41, 0x6D, 0xEA, 0x2F, 0x42, 0x6D, 0xEC, 0x37, 0x43, 0x6D,
-    0xEE, 0x3F, 0x44, 0x6D, 0x74, 0x26, 0x40, 0xB9, 0xFF, 0xC3, 0x02, 0x91,
+    0xEE, 0x3F, 0x44, 0x6D, 0x74, 0x22, 0x40, 0xB9, 0xFF, 0xC3, 0x02, 0x91,
     0xC0, 0x03, 0x5F, 0xD6,
 };
 static constexpr uint8_t expected_cfi_kArm64[] = {
@@ -188,7 +191,7 @@
 // 0x0000006c: ldp d14, d15, [sp, #64]
 // 0x00000070: .cfi_restore_extended: r78
 // 0x00000070: .cfi_restore_extended: r79
-// 0x00000070: ldr w20, [tr, #48] ; is_gc_marking
+// 0x00000070: ldr w20, [tr, #32] ; is_gc_marking
 // 0x00000074: add sp, sp, #0xb0 (176)
 // 0x00000078: .cfi_def_cfa_offset: 0
 // 0x00000078: ret
diff --git a/compiler/jni/jni_compiler_test.cc b/compiler/jni/jni_compiler_test.cc
index 397db25..77ebff6 100644
--- a/compiler/jni/jni_compiler_test.cc
+++ b/compiler/jni/jni_compiler_test.cc
@@ -42,7 +42,7 @@
 #include "mirror/stack_trace_element-inl.h"
 #include "nativehelper/ScopedLocalRef.h"
 #include "nativeloader/native_loader.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "runtime.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread-inl.h"
@@ -175,9 +175,8 @@
 
 // SFINAE for non-ref-types. Always 0.
 template <typename T>
-size_t count_nonnull_refs_single_helper(T arg ATTRIBUTE_UNUSED,
-                                        typename std::enable_if<!jni_type_traits<T>::is_ref>::type*
-                                            = nullptr) {
+size_t count_nonnull_refs_single_helper(
+    [[maybe_unused]] T arg, typename std::enable_if<!jni_type_traits<T>::is_ref>::type* = nullptr) {
   return 0;
 }
 
@@ -591,10 +590,9 @@
 
 class CountReferencesVisitor : public RootVisitor {
  public:
-  void VisitRoots(mirror::Object*** roots ATTRIBUTE_UNUSED,
+  void VisitRoots([[maybe_unused]] mirror::Object*** roots,
                   size_t count,
-                  const RootInfo& info) override
-      REQUIRES_SHARED(Locks::mutator_lock_) {
+                  const RootInfo& info) override REQUIRES_SHARED(Locks::mutator_lock_) {
     if (info.GetType() == art::RootType::kRootJavaFrame) {
       const JavaFrameRootInfo& jrfi = static_cast<const JavaFrameRootInfo&>(info);
       if (jrfi.GetVReg() == JavaFrameRootInfo::kNativeReferenceArgument) {
@@ -604,10 +602,9 @@
     }
   }
 
-  void VisitRoots(mirror::CompressedReference<mirror::Object>** roots ATTRIBUTE_UNUSED,
-                  size_t count ATTRIBUTE_UNUSED,
-                  const RootInfo& info) override
-      REQUIRES_SHARED(Locks::mutator_lock_) {
+  void VisitRoots([[maybe_unused]] mirror::CompressedReference<mirror::Object>** roots,
+                  [[maybe_unused]] size_t count,
+                  const RootInfo& info) override REQUIRES_SHARED(Locks::mutator_lock_) {
     CHECK_NE(info.GetType(), art::RootType::kRootJavaFrame);
   }
 
@@ -980,8 +977,8 @@
 JNI_TEST(CompileAndRunIntObjectObjectMethod)
 
 int gJava_MyClassNatives_fooSII_calls[kJniKindCount] = {};
-jint Java_MyClassNatives_fooSII(JNIEnv* env ATTRIBUTE_UNUSED,
-                                jclass klass ATTRIBUTE_UNUSED,
+jint Java_MyClassNatives_fooSII([[maybe_unused]] JNIEnv* env,
+                                [[maybe_unused]] jclass klass,
                                 jint x,
                                 jint y) {
   gJava_MyClassNatives_fooSII_calls[gCurrentJni]++;
@@ -1003,8 +1000,8 @@
 JNI_TEST_CRITICAL(CompileAndRunStaticIntIntMethod)
 
 int gJava_MyClassNatives_fooSDD_calls[kJniKindCount] = {};
-jdouble Java_MyClassNatives_fooSDD(JNIEnv* env ATTRIBUTE_UNUSED,
-                                   jclass klass ATTRIBUTE_UNUSED,
+jdouble Java_MyClassNatives_fooSDD([[maybe_unused]] JNIEnv* env,
+                                   [[maybe_unused]] jclass klass,
                                    jdouble x,
                                    jdouble y) {
   gJava_MyClassNatives_fooSDD_calls[gCurrentJni]++;
@@ -1676,8 +1673,8 @@
 
 JNI_TEST(CompileAndRunFloatFloatMethod)
 
-void Java_MyClassNatives_checkParameterAlign(JNIEnv* env ATTRIBUTE_UNUSED,
-                                             jobject thisObj ATTRIBUTE_UNUSED,
+void Java_MyClassNatives_checkParameterAlign([[maybe_unused]] JNIEnv* env,
+                                             [[maybe_unused]] jobject thisObj,
                                              jint i1,
                                              jlong l1) {
   EXPECT_EQ(i1, 1234);
diff --git a/compiler/jni/quick/arm/calling_convention_arm.cc b/compiler/jni/quick/arm/calling_convention_arm.cc
index d81ca77..826474f 100644
--- a/compiler/jni/quick/arm/calling_convention_arm.cc
+++ b/compiler/jni/quick/arm/calling_convention_arm.cc
@@ -409,18 +409,17 @@
 
 ArrayRef<const ManagedRegister> ArmJniCallingConvention::ArgumentScratchRegisters() const {
   DCHECK(!IsCriticalNative());
-  // Exclude r0 or r0-r1 if they are used as return registers.
+  ArrayRef<const ManagedRegister> scratch_regs(kHFCoreArgumentRegisters);
+  // Exclude return registers (R0-R1) even if unused. Using the same scratch registers helps
+  // making more JNI stubs identical for better reuse, such as deduplicating them in oat files.
   static_assert(kHFCoreArgumentRegisters[0].Equals(ArmManagedRegister::FromCoreRegister(R0)));
   static_assert(kHFCoreArgumentRegisters[1].Equals(ArmManagedRegister::FromCoreRegister(R1)));
-  ArrayRef<const ManagedRegister> scratch_regs(kHFCoreArgumentRegisters);
-  ArmManagedRegister return_reg = ReturnRegister().AsArm();
-  auto return_reg_overlaps = [return_reg](ManagedRegister reg) {
-    return return_reg.Overlaps(reg.AsArm());
-  };
-  if (return_reg_overlaps(scratch_regs[0])) {
-    scratch_regs = scratch_regs.SubArray(/*pos=*/ return_reg_overlaps(scratch_regs[1]) ? 2u : 1u);
-  }
-  DCHECK(std::none_of(scratch_regs.begin(), scratch_regs.end(), return_reg_overlaps));
+  scratch_regs = scratch_regs.SubArray(/*pos=*/ 2u);
+  DCHECK(std::none_of(scratch_regs.begin(),
+                      scratch_regs.end(),
+                      [return_reg = ReturnRegister().AsArm()](ManagedRegister reg) {
+                        return return_reg.Overlaps(reg.AsArm());
+                      }));
   return scratch_regs;
 }
 
diff --git a/compiler/jni/quick/arm64/calling_convention_arm64.cc b/compiler/jni/quick/arm64/calling_convention_arm64.cc
index e716502..3ccbb71 100644
--- a/compiler/jni/quick/arm64/calling_convention_arm64.cc
+++ b/compiler/jni/quick/arm64/calling_convention_arm64.cc
@@ -254,17 +254,16 @@
 
 ArrayRef<const ManagedRegister> Arm64JniCallingConvention::ArgumentScratchRegisters() const {
   DCHECK(!IsCriticalNative());
-  // Exclude x0 if it's used as a return register.
-  static_assert(kXArgumentRegisters[0].Equals(Arm64ManagedRegister::FromXRegister(X0)));
   ArrayRef<const ManagedRegister> scratch_regs(kXArgumentRegisters);
-  Arm64ManagedRegister return_reg = ReturnRegister().AsArm64();
-  auto return_reg_overlaps = [return_reg](ManagedRegister reg) {
-    return return_reg.Overlaps(reg.AsArm64());
-  };
-  if (return_reg_overlaps(scratch_regs[0])) {
-    scratch_regs = scratch_regs.SubArray(/*pos=*/ 1u);
-  }
-  DCHECK(std::none_of(scratch_regs.begin(), scratch_regs.end(), return_reg_overlaps));
+  // Exclude return register (X0) even if unused. Using the same scratch registers helps
+  // making more JNI stubs identical for better reuse, such as deduplicating them in oat files.
+  static_assert(kXArgumentRegisters[0].Equals(Arm64ManagedRegister::FromXRegister(X0)));
+  scratch_regs = scratch_regs.SubArray(/*pos=*/ 1u);
+  DCHECK(std::none_of(scratch_regs.begin(),
+                      scratch_regs.end(),
+                      [return_reg = ReturnRegister().AsArm64()](ManagedRegister reg) {
+                        return return_reg.Overlaps(reg.AsArm64());
+                      }));
   return scratch_regs;
 }
 
@@ -323,7 +322,7 @@
       static_assert(kCalleeSaveRegisters[lr_index].Equals(
                         Arm64ManagedRegister::FromXRegister(LR)));
       return ArrayRef<const ManagedRegister>(kCalleeSaveRegisters).SubArray(
-          /*pos*/ lr_index, /*length=*/ 1u);
+          /*pos=*/ lr_index, /*length=*/ 1u);
     }
   } else {
     return ArrayRef<const ManagedRegister>(kCalleeSaveRegisters);
diff --git a/compiler/jni/quick/calling_convention.cc b/compiler/jni/quick/calling_convention.cc
index 2b9da6b..459beb0 100644
--- a/compiler/jni/quick/calling_convention.cc
+++ b/compiler/jni/quick/calling_convention.cc
@@ -29,6 +29,10 @@
 #include "jni/quick/arm64/calling_convention_arm64.h"
 #endif
 
+#ifdef ART_ENABLE_CODEGEN_riscv64
+#include "jni/quick/riscv64/calling_convention_riscv64.h"
+#endif
+
 #ifdef ART_ENABLE_CODEGEN_x86
 #include "jni/quick/x86/calling_convention_x86.h"
 #endif
@@ -61,6 +65,12 @@
           new (allocator) arm64::Arm64ManagedRuntimeCallingConvention(
               is_static, is_synchronized, shorty));
 #endif
+#ifdef ART_ENABLE_CODEGEN_riscv64
+    case InstructionSet::kRiscv64:
+      return std::unique_ptr<ManagedRuntimeCallingConvention>(
+          new (allocator) riscv64::Riscv64ManagedRuntimeCallingConvention(
+              is_static, is_synchronized, shorty));
+#endif
 #ifdef ART_ENABLE_CODEGEN_x86
     case InstructionSet::kX86:
       return std::unique_ptr<ManagedRuntimeCallingConvention>(
@@ -114,7 +124,7 @@
 }
 
 size_t ManagedRuntimeCallingConvention::CurrentParamSize() {
-  return ParamSize(itr_args_);
+  return ParamSize(itr_args_, /*reference_size=*/ sizeof(mirror::HeapReference<mirror::Object>));
 }
 
 bool ManagedRuntimeCallingConvention::IsCurrentParamAReference() {
@@ -156,6 +166,12 @@
           new (allocator) arm64::Arm64JniCallingConvention(
               is_static, is_synchronized, is_fast_native, is_critical_native, shorty));
 #endif
+#ifdef ART_ENABLE_CODEGEN_riscv64
+    case InstructionSet::kRiscv64:
+      return std::unique_ptr<JniCallingConvention>(
+          new (allocator) riscv64::Riscv64JniCallingConvention(
+              is_static, is_synchronized, is_fast_native, is_critical_native, shorty));
+#endif
 #ifdef ART_ENABLE_CODEGEN_x86
     case InstructionSet::kX86:
       return std::unique_ptr<JniCallingConvention>(
@@ -188,7 +204,7 @@
   if (IsCurrentArgExtraForJni()) {
     return true;
   } else {
-    unsigned int arg_pos = GetIteratorPositionWithinShorty();
+    size_t arg_pos = GetIteratorPositionWithinShorty();
     return arg_pos < NumArgs();
   }
 }
@@ -220,7 +236,7 @@
                               &return_value)) {
     return return_value;
   } else {
-    int arg_pos = GetIteratorPositionWithinShorty();
+    size_t arg_pos = GetIteratorPositionWithinShorty();
     return IsParamAReference(arg_pos);
   }
 }
@@ -242,7 +258,7 @@
                               &return_value)) {
     return return_value;
   } else {
-    int arg_pos = GetIteratorPositionWithinShorty();
+    size_t arg_pos = GetIteratorPositionWithinShorty();
     return IsParamAFloatOrDouble(arg_pos);
   }
 }
@@ -256,7 +272,7 @@
                               &return_value)) {
     return return_value;
   } else {
-    int arg_pos = GetIteratorPositionWithinShorty();
+    size_t arg_pos = GetIteratorPositionWithinShorty();
     return IsParamADouble(arg_pos);
   }
 }
@@ -270,7 +286,7 @@
                               &return_value)) {
     return return_value;
   } else {
-    int arg_pos = GetIteratorPositionWithinShorty();
+    size_t arg_pos = GetIteratorPositionWithinShorty();
     return IsParamALong(arg_pos);
   }
 }
@@ -279,8 +295,9 @@
   if (IsCurrentArgExtraForJni()) {
     return static_cast<size_t>(frame_pointer_size_);  // JNIEnv or jobject/jclass
   } else {
-    int arg_pos = GetIteratorPositionWithinShorty();
-    return ParamSize(arg_pos);
+    size_t arg_pos = GetIteratorPositionWithinShorty();
+    // References are converted to `jobject` for the native call. Pass `frame_pointer_size_`.
+    return ParamSize(arg_pos, /*reference_size=*/ static_cast<size_t>(frame_pointer_size_));
   }
 }
 
@@ -305,7 +322,7 @@
   }
 }
 
-unsigned int JniCallingConvention::GetIteratorPositionWithinShorty() const {
+size_t JniCallingConvention::GetIteratorPositionWithinShorty() const {
   // We need to subtract out the extra JNI arguments if we want to use this iterator position
   // with the inherited CallingConvention member functions, which rely on scanning the shorty.
   // Note that our shorty does *not* include the JNIEnv, jclass/jobject parameters.
diff --git a/compiler/jni/quick/calling_convention.h b/compiler/jni/quick/calling_convention.h
index 0187b14..b8b4cc1 100644
--- a/compiler/jni/quick/calling_convention.h
+++ b/compiler/jni/quick/calling_convention.h
@@ -178,14 +178,18 @@
   size_t NumReferenceArgs() const {
     return num_ref_args_;
   }
-  size_t ParamSize(unsigned int param) const {
+  size_t ParamSize(size_t param, size_t reference_size) const {
     DCHECK_LT(param, NumArgs());
     if (IsStatic()) {
       param++;  // 0th argument must skip return value at start of the shorty
     } else if (param == 0) {
-      return sizeof(mirror::HeapReference<mirror::Object>);  // this argument
+      return reference_size;  // this argument
     }
-    size_t result = Primitive::ComponentSize(Primitive::GetType(shorty_[param]));
+    Primitive::Type type = Primitive::GetType(shorty_[param]);
+    if (type == Primitive::kPrimNot) {
+      return reference_size;
+    }
+    size_t result = Primitive::ComponentSize(type);
     if (result >= 1 && result < 4) {
       result = 4;
     }
@@ -320,9 +324,11 @@
   virtual ArrayRef<const ManagedRegister> CalleeSaveRegisters() const = 0;
 
   // Subset of core callee save registers that can be used for arbitrary purposes after
-  // constructing the JNI transition frame. These should be managed callee-saves as well.
+  // constructing the JNI transition frame. These should be both managed and native callee-saves.
   // These should not include special purpose registers such as thread register.
-  // JNI compiler currently requires at least 3 callee save scratch registers.
+  // JNI compiler currently requires at least 4 callee save scratch registers, except for x86
+  // where we have only 3 such registers but all args are passed on stack, so the method register
+  // is never clobbered by argument moves and does not need to be preserved elsewhere.
   virtual ArrayRef<const ManagedRegister> CalleeSaveScratchRegisters() const = 0;
 
   // Subset of core argument registers that can be used for arbitrary purposes after
@@ -344,7 +350,7 @@
     return IsCurrentParamALong() || IsCurrentParamADouble();
   }
   bool IsCurrentParamJniEnv();
-  size_t CurrentParamSize() const;
+  virtual size_t CurrentParamSize() const;
   virtual bool IsCurrentParamInRegister() = 0;
   virtual bool IsCurrentParamOnStack() = 0;
   virtual ManagedRegister CurrentParamRegister() = 0;
@@ -352,10 +358,6 @@
 
   virtual ~JniCallingConvention() {}
 
-  static constexpr size_t SavedLocalReferenceCookieSize() {
-    return 4u;
-  }
-
   bool IsFastNative() const {
     return is_fast_native_;
   }
@@ -432,7 +434,7 @@
   bool HasSelfClass() const;
 
   // Returns the position of itr_args_, fixed up by removing the offset of extra JNI arguments.
-  unsigned int GetIteratorPositionWithinShorty() const;
+  size_t GetIteratorPositionWithinShorty() const;
 
   // Is the current argument (at the iterator) an extra argument for JNI?
   bool IsCurrentArgExtraForJni() const;
diff --git a/compiler/jni/quick/jni_compiler.cc b/compiler/jni/quick/jni_compiler.cc
index 763d379..c721825 100644
--- a/compiler/jni/quick/jni_compiler.cc
+++ b/compiler/jni/quick/jni_compiler.cc
@@ -38,6 +38,7 @@
 #include "entrypoints/quick/quick_entrypoints.h"
 #include "instrumentation.h"
 #include "jni/jni_env_ext.h"
+#include "jni/local_reference_table.h"
 #include "runtime.h"
 #include "thread.h"
 #include "utils/arm/managed_register_arm.h"
@@ -51,19 +52,6 @@
 
 namespace art HIDDEN {
 
-constexpr size_t kIRTCookieSize = JniCallingConvention::SavedLocalReferenceCookieSize();
-
-template <PointerSize kPointerSize>
-static void PushLocalReferenceFrame(JNIMacroAssembler<kPointerSize>* jni_asm,
-                                    ManagedRegister jni_env_reg,
-                                    ManagedRegister saved_cookie_reg,
-                                    ManagedRegister temp_reg);
-template <PointerSize kPointerSize>
-static void PopLocalReferenceFrame(JNIMacroAssembler<kPointerSize>* jni_asm,
-                                   ManagedRegister jni_env_reg,
-                                   ManagedRegister saved_cookie_reg,
-                                   ManagedRegister temp_reg);
-
 template <PointerSize kPointerSize>
 static void SetNativeParameter(JNIMacroAssembler<kPointerSize>* jni_asm,
                                JniCallingConvention* jni_conv,
@@ -109,6 +97,7 @@
   // i.e. if the method was annotated with @CriticalNative
   const bool is_critical_native = (access_flags & kAccCriticalNative) != 0u;
 
+  bool emit_read_barrier = compiler_options.EmitReadBarrier();
   bool is_debuggable = compiler_options.GetDebuggable();
   bool needs_entry_exit_hooks = is_debuggable && compiler_options.IsJitCompiler();
   // We don't support JITing stubs for critical native methods in debuggable runtimes yet.
@@ -208,7 +197,7 @@
   //      Skip this for @CriticalNative because we're not passing a `jclass` to the native method.
   std::unique_ptr<JNIMacroLabel> jclass_read_barrier_slow_path;
   std::unique_ptr<JNIMacroLabel> jclass_read_barrier_return;
-  if (gUseReadBarrier && is_static && LIKELY(!is_critical_native)) {
+  if (emit_read_barrier && is_static && LIKELY(!is_critical_native)) {
     jclass_read_barrier_slow_path = __ CreateLabel();
     jclass_read_barrier_return = __ CreateLabel();
 
@@ -305,22 +294,30 @@
   // 3. Push local reference frame.
   // Skip this for @CriticalNative methods, they cannot use any references.
   ManagedRegister jni_env_reg = ManagedRegister::NoRegister();
-  ManagedRegister saved_cookie_reg = ManagedRegister::NoRegister();
+  ManagedRegister previous_state_reg = ManagedRegister::NoRegister();
+  ManagedRegister current_state_reg = ManagedRegister::NoRegister();
   ManagedRegister callee_save_temp = ManagedRegister::NoRegister();
   if (LIKELY(!is_critical_native)) {
     // To pop the local reference frame later, we shall need the JNI environment pointer
     // as well as the cookie, so we preserve them across calls in callee-save registers.
     CHECK_GE(callee_save_scratch_regs.size(), 3u);  // At least 3 for each supported architecture.
     jni_env_reg = callee_save_scratch_regs[0];
-    saved_cookie_reg = __ CoreRegisterWithSize(callee_save_scratch_regs[1], kIRTCookieSize);
-    callee_save_temp = __ CoreRegisterWithSize(callee_save_scratch_regs[2], kIRTCookieSize);
+    constexpr size_t kLRTSegmentStateSize = sizeof(jni::LRTSegmentState);
+    previous_state_reg = __ CoreRegisterWithSize(callee_save_scratch_regs[1], kLRTSegmentStateSize);
+    current_state_reg = __ CoreRegisterWithSize(callee_save_scratch_regs[2], kLRTSegmentStateSize);
+    if (callee_save_scratch_regs.size() >= 4) {
+      callee_save_temp = callee_save_scratch_regs[3];
+    }
+    const MemberOffset previous_state_offset = JNIEnvExt::LrtPreviousStateOffset(kPointerSize);
 
     // Load the JNI environment pointer.
     __ LoadRawPtrFromThread(jni_env_reg, Thread::JniEnvOffset<kPointerSize>());
 
-    // Push the local reference frame.
-    PushLocalReferenceFrame<kPointerSize>(
-        jni_asm.get(), jni_env_reg, saved_cookie_reg, callee_save_temp);
+    // Load the local reference frame states.
+    __ LoadLocalReferenceTableStates(jni_env_reg, previous_state_reg, current_state_reg);
+
+    // Store the current state as the previous state (push the LRT frame).
+    __ Store(jni_env_reg, previous_state_offset, current_state_reg, kLRTSegmentStateSize);
   }
 
   // 4. Make the main native call.
@@ -343,6 +340,7 @@
   refs.clear();
   mr_conv->ResetIterator(FrameOffset(current_frame_size));
   main_jni_conv->ResetIterator(FrameOffset(main_out_arg_size));
+  bool check_method_not_clobbered = false;
   if (UNLIKELY(is_critical_native)) {
     // Move the method pointer to the hidden argument register.
     // TODO: Pass this as the last argument, not first. Change ARM assembler
@@ -353,10 +351,16 @@
   } else {
     main_jni_conv->Next();    // Skip JNIEnv*.
     FrameOffset method_offset(current_out_arg_size + mr_conv->MethodStackOffset().SizeValue());
-    if (!is_static || main_jni_conv->IsCurrentParamOnStack()) {
+    if (main_jni_conv->IsCurrentParamOnStack()) {
+      // This is for x86 only. The method shall not be clobbered by argument moves
+      // because all arguments are passed on the stack to the native method.
+      check_method_not_clobbered = true;
+      DCHECK(callee_save_temp.IsNoRegister());
+    } else if (!is_static) {
       // The method shall not be available in the `jclass` argument register.
       // Make sure it is available in `callee_save_temp` for the call below.
       // (The old method register can be clobbered by argument moves.)
+      DCHECK(!callee_save_temp.IsNoRegister());
       ManagedRegister new_method_reg = __ CoreRegisterWithSize(callee_save_temp, kRawPointerSize);
       DCHECK(!method_register.IsNoRegister());
       __ Move(new_method_reg, method_register, kRawPointerSize);
@@ -387,8 +391,8 @@
     DCHECK(main_jni_conv->HasNext());
     static_assert(kObjectReferenceSize == 4u);
     bool is_reference = mr_conv->IsCurrentParamAReference();
-    size_t src_size = (!is_reference && mr_conv->IsCurrentParamALongOrDouble()) ? 8u : 4u;
-    size_t dest_size = is_reference ? kRawPointerSize : src_size;
+    size_t src_size = mr_conv->CurrentParamSize();
+    size_t dest_size = main_jni_conv->CurrentParamSize();
     src_args.push_back(mr_conv->IsCurrentParamInRegister()
         ? ArgumentLocation(mr_conv->CurrentParamRegister(), src_size)
         : ArgumentLocation(mr_conv->CurrentParamStackOffset(), src_size));
@@ -398,6 +402,10 @@
     refs.push_back(is_reference ? mr_conv->CurrentParamStackOffset() : kInvalidReferenceOffset);
   }
   DCHECK(!main_jni_conv->HasNext());
+  DCHECK_IMPLIES(check_method_not_clobbered,
+                 std::all_of(dest_args.begin(),
+                             dest_args.end(),
+                             [](const ArgumentLocation& loc) { return !loc.IsRegister(); }));
   __ MoveArguments(ArrayRef<ArgumentLocation>(dest_args),
                    ArrayRef<ArgumentLocation>(src_args),
                    ArrayRef<FrameOffset>(refs));
@@ -524,8 +532,10 @@
 
   // 6. Pop local reference frame.
   if (LIKELY(!is_critical_native)) {
-    PopLocalReferenceFrame<kPointerSize>(
-        jni_asm.get(), jni_env_reg, saved_cookie_reg, callee_save_temp);
+    __ StoreLocalReferenceTableStates(jni_env_reg, previous_state_reg, current_state_reg);
+    // For x86, the `callee_save_temp` is not valid, so let's simply change it to one
+    // of the callee save registers that we don't need anymore for all architectures.
+    callee_save_temp = current_state_reg;
   }
 
   // 7. Return from the JNI stub.
@@ -549,10 +559,10 @@
       FrameOffset method_offset = mr_conv->MethodStackOffset();
       __ Load(temp, method_offset, kRawPointerSize);
       DCHECK_EQ(ArtMethod::DeclaringClassOffset().SizeValue(), 0u);
-      __ Load(to_lock, temp, MemberOffset(0u), kObjectReferenceSize);
+      __ LoadGcRootWithoutReadBarrier(to_lock, temp, MemberOffset(0u));
     } else {
       // Pass the `this` argument from its spill slot.
-      __ Load(to_lock, mr_conv->CurrentParamStackOffset(), kObjectReferenceSize);
+      __ LoadStackReference(to_lock, mr_conv->CurrentParamStackOffset());
     }
     __ CallFromThread(QUICK_ENTRYPOINT_OFFSET(kPointerSize, pJniUnlockObject));
   }
@@ -601,7 +611,7 @@
 
   // 8.1. Read barrier slow path for the declaring class in the method for a static call.
   //      Skip this for @CriticalNative because we're not passing a `jclass` to the native method.
-  if (gUseReadBarrier && is_static && !is_critical_native) {
+  if (emit_read_barrier && is_static && !is_critical_native) {
     __ Bind(jclass_read_barrier_slow_path.get());
 
     // Construct slow path for read barrier:
@@ -621,7 +631,7 @@
           main_jni_conv->CalleeSaveScratchRegisters()[0], kObjectReferenceSize);
       // Load the declaring class reference.
       DCHECK_EQ(ArtMethod::DeclaringClassOffset().SizeValue(), 0u);
-      __ Load(temp, method_register, MemberOffset(0u), kObjectReferenceSize);
+      __ LoadGcRootWithoutReadBarrier(temp, method_register, MemberOffset(0u));
       // Return to main path if the class object is marked.
       __ TestMarkBit(temp, jclass_read_barrier_return.get(), JNIMacroUnaryCondition::kNotZero);
     }
@@ -657,8 +667,7 @@
         jni_asm->cfi().AdjustCFAOffset(main_out_arg_size);
         __ DecreaseFrameSize(main_out_arg_size);
       }
-      PopLocalReferenceFrame<kPointerSize>(
-          jni_asm.get(), jni_env_reg, saved_cookie_reg, callee_save_temp);
+      __ StoreLocalReferenceTableStates(jni_env_reg, previous_state_reg, current_state_reg);
     }
     DCHECK_EQ(jni_asm->cfi().GetCurrentCFAOffset(), static_cast<int>(current_frame_size));
     __ DeliverPendingException();
@@ -724,7 +733,7 @@
   size_t cs = __ CodeSize();
   std::vector<uint8_t> managed_code(cs);
   MemoryRegion code(&managed_code[0], managed_code.size());
-  __ FinalizeInstructions(code);
+  __ CopyInstructions(code);
 
   return JniCompiledMethod(instruction_set,
                            std::move(managed_code),
@@ -735,40 +744,6 @@
 }
 
 template <PointerSize kPointerSize>
-static void PushLocalReferenceFrame(JNIMacroAssembler<kPointerSize>* jni_asm,
-                                    ManagedRegister jni_env_reg,
-                                    ManagedRegister saved_cookie_reg,
-                                    ManagedRegister temp_reg) {
-  const size_t kRawPointerSize = static_cast<size_t>(kPointerSize);
-  const MemberOffset jni_env_cookie_offset = JNIEnvExt::LocalRefCookieOffset(kRawPointerSize);
-  const MemberOffset jni_env_segment_state_offset = JNIEnvExt::SegmentStateOffset(kRawPointerSize);
-
-  // Load the old cookie that we shall need to restore.
-  __ Load(saved_cookie_reg, jni_env_reg, jni_env_cookie_offset, kIRTCookieSize);
-
-  // Set the cookie in JNI environment to the current segment state.
-  __ Load(temp_reg, jni_env_reg, jni_env_segment_state_offset, kIRTCookieSize);
-  __ Store(jni_env_reg, jni_env_cookie_offset, temp_reg, kIRTCookieSize);
-}
-
-template <PointerSize kPointerSize>
-static void PopLocalReferenceFrame(JNIMacroAssembler<kPointerSize>* jni_asm,
-                                   ManagedRegister jni_env_reg,
-                                   ManagedRegister saved_cookie_reg,
-                                   ManagedRegister temp_reg) {
-  const size_t kRawPointerSize = static_cast<size_t>(kPointerSize);
-  const MemberOffset jni_env_cookie_offset = JNIEnvExt::LocalRefCookieOffset(kRawPointerSize);
-  const MemberOffset jni_env_segment_state_offset = JNIEnvExt::SegmentStateOffset(kRawPointerSize);
-
-  // Set the current segment state to the current cookie in JNI environment.
-  __ Load(temp_reg, jni_env_reg, jni_env_cookie_offset, kIRTCookieSize);
-  __ Store(jni_env_reg, jni_env_segment_state_offset, temp_reg, kIRTCookieSize);
-
-  // Restore the cookie in JNI environment to the saved value.
-  __ Store(jni_env_reg, jni_env_cookie_offset, saved_cookie_reg, kIRTCookieSize);
-}
-
-template <PointerSize kPointerSize>
 static void SetNativeParameter(JNIMacroAssembler<kPointerSize>* jni_asm,
                                JniCallingConvention* jni_conv,
                                ManagedRegister in_reg) {
diff --git a/compiler/jni/quick/riscv64/calling_convention_riscv64.cc b/compiler/jni/quick/riscv64/calling_convention_riscv64.cc
new file mode 100644
index 0000000..195d7c1
--- /dev/null
+++ b/compiler/jni/quick/riscv64/calling_convention_riscv64.cc
@@ -0,0 +1,428 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "calling_convention_riscv64.h"
+
+#include <android-base/logging.h>
+
+#include "arch/instruction_set.h"
+#include "arch/riscv64/jni_frame_riscv64.h"
+#include "utils/riscv64/managed_register_riscv64.h"
+
+namespace art HIDDEN {
+namespace riscv64 {
+
+static constexpr ManagedRegister kXArgumentRegisters[] = {
+    Riscv64ManagedRegister::FromXRegister(A0),
+    Riscv64ManagedRegister::FromXRegister(A1),
+    Riscv64ManagedRegister::FromXRegister(A2),
+    Riscv64ManagedRegister::FromXRegister(A3),
+    Riscv64ManagedRegister::FromXRegister(A4),
+    Riscv64ManagedRegister::FromXRegister(A5),
+    Riscv64ManagedRegister::FromXRegister(A6),
+    Riscv64ManagedRegister::FromXRegister(A7),
+};
+static_assert(kMaxIntLikeArgumentRegisters == arraysize(kXArgumentRegisters));
+
+static const FRegister kFArgumentRegisters[] = {
+  FA0, FA1, FA2, FA3, FA4, FA5, FA6, FA7
+};
+static_assert(kMaxFloatOrDoubleArgumentRegisters == arraysize(kFArgumentRegisters));
+
+static constexpr ManagedRegister kCalleeSaveRegisters[] = {
+    // Core registers.
+    Riscv64ManagedRegister::FromXRegister(S0),
+    // ART thread register (TR = S1) is not saved on the stack.
+    Riscv64ManagedRegister::FromXRegister(S2),
+    Riscv64ManagedRegister::FromXRegister(S3),
+    Riscv64ManagedRegister::FromXRegister(S4),
+    Riscv64ManagedRegister::FromXRegister(S5),
+    Riscv64ManagedRegister::FromXRegister(S6),
+    Riscv64ManagedRegister::FromXRegister(S7),
+    Riscv64ManagedRegister::FromXRegister(S8),
+    Riscv64ManagedRegister::FromXRegister(S9),
+    Riscv64ManagedRegister::FromXRegister(S10),
+    Riscv64ManagedRegister::FromXRegister(S11),
+    Riscv64ManagedRegister::FromXRegister(RA),
+
+    // Hard float registers.
+    Riscv64ManagedRegister::FromFRegister(FS0),
+    Riscv64ManagedRegister::FromFRegister(FS1),
+    Riscv64ManagedRegister::FromFRegister(FS2),
+    Riscv64ManagedRegister::FromFRegister(FS3),
+    Riscv64ManagedRegister::FromFRegister(FS4),
+    Riscv64ManagedRegister::FromFRegister(FS5),
+    Riscv64ManagedRegister::FromFRegister(FS6),
+    Riscv64ManagedRegister::FromFRegister(FS7),
+    Riscv64ManagedRegister::FromFRegister(FS8),
+    Riscv64ManagedRegister::FromFRegister(FS9),
+    Riscv64ManagedRegister::FromFRegister(FS10),
+    Riscv64ManagedRegister::FromFRegister(FS11),
+};
+
+template <size_t size>
+static constexpr uint32_t CalculateCoreCalleeSpillMask(
+    const ManagedRegister (&callee_saves)[size]) {
+  uint32_t result = 0u;
+  for (auto&& r : callee_saves) {
+    if (r.AsRiscv64().IsXRegister()) {
+      result |= (1u << r.AsRiscv64().AsXRegister());
+    }
+  }
+  return result;
+}
+
+template <size_t size>
+static constexpr uint32_t CalculateFpCalleeSpillMask(const ManagedRegister (&callee_saves)[size]) {
+  uint32_t result = 0u;
+  for (auto&& r : callee_saves) {
+    if (r.AsRiscv64().IsFRegister()) {
+      result |= (1u << r.AsRiscv64().AsFRegister());
+    }
+  }
+  return result;
+}
+
+static constexpr uint32_t kCoreCalleeSpillMask = CalculateCoreCalleeSpillMask(kCalleeSaveRegisters);
+static constexpr uint32_t kFpCalleeSpillMask = CalculateFpCalleeSpillMask(kCalleeSaveRegisters);
+
+static constexpr ManagedRegister kNativeCalleeSaveRegisters[] = {
+    // Core registers.
+    Riscv64ManagedRegister::FromXRegister(S0),
+    Riscv64ManagedRegister::FromXRegister(S1),
+    Riscv64ManagedRegister::FromXRegister(S2),
+    Riscv64ManagedRegister::FromXRegister(S3),
+    Riscv64ManagedRegister::FromXRegister(S4),
+    Riscv64ManagedRegister::FromXRegister(S5),
+    Riscv64ManagedRegister::FromXRegister(S6),
+    Riscv64ManagedRegister::FromXRegister(S7),
+    Riscv64ManagedRegister::FromXRegister(S8),
+    Riscv64ManagedRegister::FromXRegister(S9),
+    Riscv64ManagedRegister::FromXRegister(S10),
+    Riscv64ManagedRegister::FromXRegister(S11),
+    Riscv64ManagedRegister::FromXRegister(RA),
+
+    // Hard float registers.
+    Riscv64ManagedRegister::FromFRegister(FS0),
+    Riscv64ManagedRegister::FromFRegister(FS1),
+    Riscv64ManagedRegister::FromFRegister(FS2),
+    Riscv64ManagedRegister::FromFRegister(FS3),
+    Riscv64ManagedRegister::FromFRegister(FS4),
+    Riscv64ManagedRegister::FromFRegister(FS5),
+    Riscv64ManagedRegister::FromFRegister(FS6),
+    Riscv64ManagedRegister::FromFRegister(FS7),
+    Riscv64ManagedRegister::FromFRegister(FS8),
+    Riscv64ManagedRegister::FromFRegister(FS9),
+    Riscv64ManagedRegister::FromFRegister(FS10),
+    Riscv64ManagedRegister::FromFRegister(FS11),
+};
+
+static constexpr uint32_t kNativeCoreCalleeSpillMask =
+    CalculateCoreCalleeSpillMask(kNativeCalleeSaveRegisters);
+static constexpr uint32_t kNativeFpCalleeSpillMask =
+    CalculateFpCalleeSpillMask(kNativeCalleeSaveRegisters);
+
+static ManagedRegister ReturnRegisterForShorty(const char* shorty) {
+  if (shorty[0] == 'F' || shorty[0] == 'D') {
+    return Riscv64ManagedRegister::FromFRegister(FA0);
+  } else if (shorty[0] == 'V') {
+    return Riscv64ManagedRegister::NoRegister();
+  } else {
+    // All other return types use A0. Note that there is no managed type wide enough to use A1/FA1.
+    return Riscv64ManagedRegister::FromXRegister(A0);
+  }
+}
+
+// Managed runtime calling convention
+
+ManagedRegister Riscv64ManagedRuntimeCallingConvention::ReturnRegister() const {
+  return ReturnRegisterForShorty(GetShorty());
+}
+
+ManagedRegister Riscv64ManagedRuntimeCallingConvention::MethodRegister() {
+  return Riscv64ManagedRegister::FromXRegister(A0);
+}
+
+ManagedRegister Riscv64ManagedRuntimeCallingConvention::ArgumentRegisterForMethodExitHook() {
+  DCHECK(!Riscv64ManagedRegister::FromXRegister(A4).Overlaps(ReturnRegister().AsRiscv64()));
+  return Riscv64ManagedRegister::FromXRegister(A4);
+}
+
+bool Riscv64ManagedRuntimeCallingConvention::IsCurrentParamInRegister() {
+  // Note: The managed ABI does not pass FP args in general purpose registers.
+  // This differs from the native ABI which does that after using all FP arg registers.
+  if (IsCurrentParamAFloatOrDouble()) {
+    return itr_float_and_doubles_ < kMaxFloatOrDoubleArgumentRegisters;
+  } else {
+    size_t non_fp_arg_number = itr_args_ - itr_float_and_doubles_;
+    return /* method */ 1u + non_fp_arg_number < kMaxIntLikeArgumentRegisters;
+  }
+}
+
+bool Riscv64ManagedRuntimeCallingConvention::IsCurrentParamOnStack() {
+  return !IsCurrentParamInRegister();
+}
+
+ManagedRegister Riscv64ManagedRuntimeCallingConvention::CurrentParamRegister() {
+  DCHECK(IsCurrentParamInRegister());
+  if (IsCurrentParamAFloatOrDouble()) {
+    return Riscv64ManagedRegister::FromFRegister(kFArgumentRegisters[itr_float_and_doubles_]);
+  } else {
+    size_t non_fp_arg_number = itr_args_ - itr_float_and_doubles_;
+    return kXArgumentRegisters[/* method */ 1u + non_fp_arg_number];
+  }
+}
+
+FrameOffset Riscv64ManagedRuntimeCallingConvention::CurrentParamStackOffset() {
+  return FrameOffset(displacement_.Int32Value() +  // displacement
+                     kFramePointerSize +  // Method ref
+                     (itr_slots_ * sizeof(uint32_t)));  // offset into in args
+}
+
+// JNI calling convention
+
+Riscv64JniCallingConvention::Riscv64JniCallingConvention(bool is_static,
+                                                         bool is_synchronized,
+                                                         bool is_fast_native,
+                                                         bool is_critical_native,
+                                                         const char* shorty)
+    : JniCallingConvention(is_static,
+                           is_synchronized,
+                           is_fast_native,
+                           is_critical_native,
+                           shorty,
+                           kRiscv64PointerSize) {
+}
+
+ManagedRegister Riscv64JniCallingConvention::ReturnRegister() const {
+  return ReturnRegisterForShorty(GetShorty());
+}
+
+ManagedRegister Riscv64JniCallingConvention::IntReturnRegister() const {
+  return Riscv64ManagedRegister::FromXRegister(A0);
+}
+
+size_t Riscv64JniCallingConvention::FrameSize() const {
+  if (is_critical_native_) {
+    CHECK(!SpillsMethod());
+    CHECK(!HasLocalReferenceSegmentState());
+    return 0u;  // There is no managed frame for @CriticalNative.
+  }
+
+  // Method*, callee save area size, local reference segment state
+  DCHECK(SpillsMethod());
+  size_t method_ptr_size = static_cast<size_t>(kFramePointerSize);
+  size_t callee_save_area_size = CalleeSaveRegisters().size() * kFramePointerSize;
+  size_t total_size = method_ptr_size + callee_save_area_size;
+
+  DCHECK(HasLocalReferenceSegmentState());
+  // Cookie is saved in one of the spilled registers.
+
+  return RoundUp(total_size, kStackAlignment);
+}
+
+size_t Riscv64JniCallingConvention::OutFrameSize() const {
+  // Count param args, including JNIEnv* and jclass*.
+  size_t all_args = NumberOfExtraArgumentsForJni() + NumArgs();
+  size_t num_fp_args = NumFloatOrDoubleArgs();
+  DCHECK_GE(all_args, num_fp_args);
+  size_t num_non_fp_args = all_args - num_fp_args;
+  // The size of outgoing arguments.
+  size_t size = GetNativeOutArgsSize(num_fp_args, num_non_fp_args);
+
+  // @CriticalNative can use tail call as all managed callee saves are preserved by AAPCS64.
+  static_assert((kCoreCalleeSpillMask & ~kNativeCoreCalleeSpillMask) == 0u);
+  static_assert((kFpCalleeSpillMask & ~kNativeFpCalleeSpillMask) == 0u);
+
+  // For @CriticalNative, we can make a tail call if there are no stack args.
+  // Otherwise, add space for return PC.
+  // Note: Result does not neeed to be zero- or sign-extended.
+  DCHECK(!RequiresSmallResultTypeExtension());
+  if (is_critical_native_ && size != 0u) {
+    size += kFramePointerSize;  // We need to spill RA with the args.
+  }
+  size_t out_args_size = RoundUp(size, kNativeStackAlignment);
+  if (UNLIKELY(IsCriticalNative())) {
+    DCHECK_EQ(out_args_size, GetCriticalNativeStubFrameSize(GetShorty(), NumArgs() + 1u));
+  }
+  return out_args_size;
+}
+
+ArrayRef<const ManagedRegister> Riscv64JniCallingConvention::CalleeSaveRegisters() const {
+  if (UNLIKELY(IsCriticalNative())) {
+    if (UseTailCall()) {
+      return ArrayRef<const ManagedRegister>();  // Do not spill anything.
+    } else {
+      // Spill RA with out args.
+      static_assert((kCoreCalleeSpillMask & (1 << RA)) != 0u);  // Contains RA.
+      constexpr size_t ra_index = POPCOUNT(kCoreCalleeSpillMask) - 1u;
+      static_assert(kCalleeSaveRegisters[ra_index].Equals(
+                        Riscv64ManagedRegister::FromXRegister(RA)));
+      return ArrayRef<const ManagedRegister>(kCalleeSaveRegisters).SubArray(
+          /*pos=*/ ra_index, /*length=*/ 1u);
+    }
+  } else {
+    return ArrayRef<const ManagedRegister>(kCalleeSaveRegisters);
+  }
+}
+
+ArrayRef<const ManagedRegister> Riscv64JniCallingConvention::CalleeSaveScratchRegisters() const {
+  DCHECK(!IsCriticalNative());
+  // Use S3-S11 from managed callee saves. All these registers are also native callee saves.
+  constexpr size_t kStart = 2u;
+  constexpr size_t kLength = 9u;
+  static_assert(kCalleeSaveRegisters[kStart].Equals(Riscv64ManagedRegister::FromXRegister(S3)));
+  static_assert(kCalleeSaveRegisters[kStart + kLength - 1u].Equals(
+                    Riscv64ManagedRegister::FromXRegister(S11)));
+  static_assert((kCoreCalleeSpillMask & ~kNativeCoreCalleeSpillMask) == 0u);
+  return ArrayRef<const ManagedRegister>(kCalleeSaveRegisters).SubArray(kStart, kLength);
+}
+
+ArrayRef<const ManagedRegister> Riscv64JniCallingConvention::ArgumentScratchRegisters() const {
+  DCHECK(!IsCriticalNative());
+  ArrayRef<const ManagedRegister> scratch_regs(kXArgumentRegisters);
+  // Exclude return register (A0) even if unused. Using the same scratch registers helps
+  // making more JNI stubs identical for better reuse, such as deduplicating them in oat files.
+  static_assert(kXArgumentRegisters[0].Equals(Riscv64ManagedRegister::FromXRegister(A0)));
+  scratch_regs = scratch_regs.SubArray(/*pos=*/ 1u);
+  DCHECK(std::none_of(scratch_regs.begin(),
+                      scratch_regs.end(),
+                      [return_reg = ReturnRegister().AsRiscv64()](ManagedRegister reg) {
+                        return return_reg.Overlaps(reg.AsRiscv64());
+                      }));
+  return scratch_regs;
+}
+
+uint32_t Riscv64JniCallingConvention::CoreSpillMask() const {
+  return is_critical_native_ ? 0u : kCoreCalleeSpillMask;
+}
+
+uint32_t Riscv64JniCallingConvention::FpSpillMask() const {
+  return is_critical_native_ ? 0u : kFpCalleeSpillMask;
+}
+
+size_t Riscv64JniCallingConvention::CurrentParamSize() const {
+  if (IsCurrentArgExtraForJni()) {
+    return static_cast<size_t>(frame_pointer_size_);  // JNIEnv or jobject/jclass
+  } else {
+    size_t arg_pos = GetIteratorPositionWithinShorty();
+    DCHECK_LT(arg_pos, NumArgs());
+    if (IsStatic()) {
+      ++arg_pos;  // 0th argument must skip return value at start of the shorty
+    } else if (arg_pos == 0) {
+      return static_cast<size_t>(kRiscv64PointerSize);  // this argument
+    }
+    // The riscv64 native calling convention specifies that integers narrower than XLEN (64)
+    // bits are "widened according to the sign of their type up to 32 bits, then sign-extended
+    // to XLEN bits." Thus, everything other than `float` (which has the high 32 bits undefined)
+    // is passed as 64 bits, whether in register, or on the stack.
+    return (GetShorty()[arg_pos] == 'F') ? 4u : static_cast<size_t>(kRiscv64PointerSize);
+  }
+}
+
+bool Riscv64JniCallingConvention::IsCurrentParamInRegister() {
+  // FP args use FPRs, then GPRs and only then the stack.
+  if (itr_float_and_doubles_ < kMaxFloatOrDoubleArgumentRegisters) {
+    if (IsCurrentParamAFloatOrDouble()) {
+      return true;
+    } else {
+      size_t num_non_fp_args = itr_args_ - itr_float_and_doubles_;
+      return num_non_fp_args < kMaxIntLikeArgumentRegisters;
+    }
+  } else {
+    return (itr_args_ < kMaxFloatOrDoubleArgumentRegisters + kMaxIntLikeArgumentRegisters);
+  }
+}
+
+bool Riscv64JniCallingConvention::IsCurrentParamOnStack() {
+  return !IsCurrentParamInRegister();
+}
+
+ManagedRegister Riscv64JniCallingConvention::CurrentParamRegister() {
+  // FP args use FPRs, then GPRs and only then the stack.
+  CHECK(IsCurrentParamInRegister());
+  if (itr_float_and_doubles_ < kMaxFloatOrDoubleArgumentRegisters) {
+    if (IsCurrentParamAFloatOrDouble()) {
+      return Riscv64ManagedRegister::FromFRegister(kFArgumentRegisters[itr_float_and_doubles_]);
+    } else {
+      size_t num_non_fp_args = itr_args_ - itr_float_and_doubles_;
+      DCHECK_LT(num_non_fp_args, kMaxIntLikeArgumentRegisters);
+      return kXArgumentRegisters[num_non_fp_args];
+    }
+  } else {
+    // This argument is in a GPR, whether it's a FP arg or a non-FP arg.
+    DCHECK_LT(itr_args_, kMaxFloatOrDoubleArgumentRegisters + kMaxIntLikeArgumentRegisters);
+    return kXArgumentRegisters[itr_args_ - kMaxFloatOrDoubleArgumentRegisters];
+  }
+}
+
+FrameOffset Riscv64JniCallingConvention::CurrentParamStackOffset() {
+  CHECK(IsCurrentParamOnStack());
+  // Account for FP arguments passed through FA0-FA7.
+  // All other args are passed through A0-A7 (even FP args) and the stack.
+  size_t num_gpr_and_stack_args =
+      itr_args_ - std::min<size_t>(kMaxFloatOrDoubleArgumentRegisters, itr_float_and_doubles_);
+  size_t args_on_stack =
+      num_gpr_and_stack_args - std::min(kMaxIntLikeArgumentRegisters, num_gpr_and_stack_args);
+  size_t offset = displacement_.Int32Value() - OutFrameSize() + (args_on_stack * kFramePointerSize);
+  CHECK_LT(offset, OutFrameSize());
+  return FrameOffset(offset);
+}
+
+bool Riscv64JniCallingConvention::RequiresSmallResultTypeExtension() const {
+  // RISC-V native calling convention requires values to be returned the way that the first
+  // argument would be passed. Arguments are zero-/sign-extended to 32 bits based on their
+  // type, then sign-extended to 64 bits. This is the same as in the ART mamaged ABI.
+  // (Not applicable to FP args which are returned in `FA0`. A `float` is NaN-boxed.)
+  return false;
+}
+
+// T0 is neither managed callee-save, nor argument register. It is suitable for use as the
+// locking argument for synchronized methods and hidden argument for @CriticalNative methods.
+static void AssertT0IsNeitherCalleeSaveNorArgumentRegister() {
+  // TODO: Change to static_assert; std::none_of should be constexpr since C++20.
+  DCHECK(std::none_of(kCalleeSaveRegisters,
+                      kCalleeSaveRegisters + std::size(kCalleeSaveRegisters),
+                      [](ManagedRegister callee_save) constexpr {
+                        return callee_save.Equals(Riscv64ManagedRegister::FromXRegister(T0));
+                      }));
+  DCHECK(std::none_of(kXArgumentRegisters,
+                      kXArgumentRegisters + std::size(kXArgumentRegisters),
+                      [](ManagedRegister arg) { return arg.AsRiscv64().AsXRegister() == T0; }));
+}
+
+ManagedRegister Riscv64JniCallingConvention::LockingArgumentRegister() const {
+  DCHECK(!IsFastNative());
+  DCHECK(!IsCriticalNative());
+  DCHECK(IsSynchronized());
+  AssertT0IsNeitherCalleeSaveNorArgumentRegister();
+  return Riscv64ManagedRegister::FromXRegister(T0);
+}
+
+ManagedRegister Riscv64JniCallingConvention::HiddenArgumentRegister() const {
+  DCHECK(IsCriticalNative());
+  AssertT0IsNeitherCalleeSaveNorArgumentRegister();
+  return Riscv64ManagedRegister::FromXRegister(T0);
+}
+
+// Whether to use tail call (used only for @CriticalNative).
+bool Riscv64JniCallingConvention::UseTailCall() const {
+  CHECK(IsCriticalNative());
+  return OutFrameSize() == 0u;
+}
+
+}  // namespace riscv64
+}  // namespace art
diff --git a/compiler/jni/quick/riscv64/calling_convention_riscv64.h b/compiler/jni/quick/riscv64/calling_convention_riscv64.h
new file mode 100644
index 0000000..5add183
--- /dev/null
+++ b/compiler/jni/quick/riscv64/calling_convention_riscv64.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_COMPILER_JNI_QUICK_RISCV64_CALLING_CONVENTION_RISCV64_H_
+#define ART_COMPILER_JNI_QUICK_RISCV64_CALLING_CONVENTION_RISCV64_H_
+
+#include "base/enums.h"
+#include "base/macros.h"
+#include "jni/quick/calling_convention.h"
+
+namespace art HIDDEN {
+namespace riscv64 {
+
+class Riscv64ManagedRuntimeCallingConvention final : public ManagedRuntimeCallingConvention {
+ public:
+  Riscv64ManagedRuntimeCallingConvention(bool is_static, bool is_synchronized, const char* shorty)
+      : ManagedRuntimeCallingConvention(is_static,
+                                        is_synchronized,
+                                        shorty,
+                                        PointerSize::k64) {}
+  ~Riscv64ManagedRuntimeCallingConvention() override {}
+  // Calling convention
+  ManagedRegister ReturnRegister() const override;
+  // Managed runtime calling convention
+  ManagedRegister MethodRegister() override;
+  ManagedRegister ArgumentRegisterForMethodExitHook() override;
+  bool IsCurrentParamInRegister() override;
+  bool IsCurrentParamOnStack() override;
+  ManagedRegister CurrentParamRegister() override;
+  FrameOffset CurrentParamStackOffset() override;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(Riscv64ManagedRuntimeCallingConvention);
+};
+
+class Riscv64JniCallingConvention final : public JniCallingConvention {
+ public:
+  Riscv64JniCallingConvention(bool is_static,
+                              bool is_synchronized,
+                              bool is_fast_native,
+                              bool is_critical_native,
+                              const char* shorty);
+  ~Riscv64JniCallingConvention() override {}
+  // Calling convention
+  ManagedRegister ReturnRegister() const override;
+  ManagedRegister IntReturnRegister() const override;
+  // JNI calling convention
+  size_t FrameSize() const override;
+  size_t OutFrameSize() const override;
+  ArrayRef<const ManagedRegister> CalleeSaveRegisters() const override;
+  ArrayRef<const ManagedRegister> CalleeSaveScratchRegisters() const override;
+  ArrayRef<const ManagedRegister> ArgumentScratchRegisters() const override;
+  uint32_t CoreSpillMask() const override;
+  uint32_t FpSpillMask() const override;
+  size_t CurrentParamSize() const override;
+  bool IsCurrentParamInRegister() override;
+  bool IsCurrentParamOnStack() override;
+  ManagedRegister CurrentParamRegister() override;
+  FrameOffset CurrentParamStackOffset() override;
+  bool RequiresSmallResultTypeExtension() const override;
+
+  // Locking argument register, used to pass the synchronization object for calls
+  // to `JniLockObject()` and `JniUnlockObject()`.
+  ManagedRegister LockingArgumentRegister() const override;
+
+  // Hidden argument register, used to pass the method pointer for @CriticalNative call.
+  ManagedRegister HiddenArgumentRegister() const override;
+
+  // Whether to use tail call (used only for @CriticalNative).
+  bool UseTailCall() const override;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(Riscv64JniCallingConvention);
+};
+
+}  // namespace riscv64
+}  // namespace art
+
+#endif  // ART_COMPILER_JNI_QUICK_RISCV64_CALLING_CONVENTION_RISCV64_H_
diff --git a/compiler/jni/quick/x86/calling_convention_x86.cc b/compiler/jni/quick/x86/calling_convention_x86.cc
index 598e8e7..e692cff 100644
--- a/compiler/jni/quick/x86/calling_convention_x86.cc
+++ b/compiler/jni/quick/x86/calling_convention_x86.cc
@@ -84,28 +84,21 @@
 
 ArrayRef<const ManagedRegister> X86JniCallingConvention::ArgumentScratchRegisters() const {
   DCHECK(!IsCriticalNative());
-  // Exclude EAX or EAX/EDX if they are used as return registers.
-  // Due to the odd ordering of argument registers, use a re-ordered array (pull EDX forward).
-  static constexpr ManagedRegister kArgumentRegisters[] = {
-      X86ManagedRegister::FromCpuRegister(EAX),
-      X86ManagedRegister::FromCpuRegister(EDX),
+  // Exclude return registers (EAX/EDX) even if unused. Using the same scratch registers helps
+  // making more JNI stubs identical for better reuse, such as deduplicating them in oat files.
+  // Due to the odd ordering of argument registers, use a separate register array.
+  static constexpr ManagedRegister kArgumentScratchRegisters[] = {
       X86ManagedRegister::FromCpuRegister(ECX),
       X86ManagedRegister::FromCpuRegister(EBX),
   };
-  static_assert(arraysize(kArgumentRegisters) == kManagedCoreArgumentRegistersCount);
-  static_assert(kManagedCoreArgumentRegisters[0].Equals(kArgumentRegisters[0]));
-  static_assert(kManagedCoreArgumentRegisters[1].Equals(kArgumentRegisters[2]));
-  static_assert(kManagedCoreArgumentRegisters[2].Equals(kArgumentRegisters[1]));
-  static_assert(kManagedCoreArgumentRegisters[3].Equals(kArgumentRegisters[3]));
-  ArrayRef<const ManagedRegister> scratch_regs(kArgumentRegisters);
-  X86ManagedRegister return_reg = ReturnRegister().AsX86();
-  auto return_reg_overlaps = [return_reg](ManagedRegister reg) {
-    return return_reg.Overlaps(reg.AsX86());
-  };
-  if (return_reg_overlaps(scratch_regs[0])) {
-    scratch_regs = scratch_regs.SubArray(/*pos=*/ return_reg_overlaps(scratch_regs[1]) ? 2u : 1u);
-  }
-  DCHECK(std::none_of(scratch_regs.begin(), scratch_regs.end(), return_reg_overlaps));
+  static_assert(kManagedCoreArgumentRegisters[1].Equals(kArgumentScratchRegisters[0]));
+  static_assert(kManagedCoreArgumentRegisters[3].Equals(kArgumentScratchRegisters[1]));
+  ArrayRef<const ManagedRegister> scratch_regs(kArgumentScratchRegisters);
+  DCHECK(std::none_of(scratch_regs.begin(),
+                      scratch_regs.end(),
+                      [return_reg = ReturnRegister().AsX86()](ManagedRegister reg) {
+                        return return_reg.Overlaps(reg.AsX86());
+                      }));
   return scratch_regs;
 }
 
diff --git a/compiler/jni/quick/x86_64/calling_convention_x86_64.cc b/compiler/jni/quick/x86_64/calling_convention_x86_64.cc
index 9d0761d..f0aa07e 100644
--- a/compiler/jni/quick/x86_64/calling_convention_x86_64.cc
+++ b/compiler/jni/quick/x86_64/calling_convention_x86_64.cc
@@ -107,17 +107,15 @@
 ArrayRef<const ManagedRegister> X86_64JniCallingConvention::ArgumentScratchRegisters() const {
   DCHECK(!IsCriticalNative());
   ArrayRef<const ManagedRegister> scratch_regs(kCoreArgumentRegisters);
-  if (kIsDebugBuild) {
-    X86_64ManagedRegister return_reg = ReturnRegister().AsX86_64();
-    auto return_reg_overlaps = [return_reg](ManagedRegister reg) {
-      return return_reg.Overlaps(reg.AsX86_64());
-    };
-    CHECK(std::none_of(scratch_regs.begin(), scratch_regs.end(), return_reg_overlaps));
-  }
+  DCHECK(std::none_of(scratch_regs.begin(),
+                      scratch_regs.end(),
+                      [return_reg = ReturnRegister().AsX86_64()](ManagedRegister reg) {
+                        return return_reg.Overlaps(reg.AsX86_64());
+                      }));
   return scratch_regs;
 }
 
-static ManagedRegister ReturnRegisterForShorty(const char* shorty, bool jni ATTRIBUTE_UNUSED) {
+static ManagedRegister ReturnRegisterForShorty(const char* shorty, [[maybe_unused]] bool jni) {
   if (shorty[0] == 'F' || shorty[0] == 'D') {
     return X86_64ManagedRegister::FromXmmRegister(XMM0);
   } else if (shorty[0] == 'J') {
diff --git a/compiler/linker/linker_patch.h b/compiler/linker/linker_patch.h
index 8ed7fce..1330882 100644
--- a/compiler/linker/linker_patch.h
+++ b/compiler/linker/linker_patch.h
@@ -56,6 +56,7 @@
     kPackageTypeBssEntry,
     kStringRelative,
     kStringBssEntry,
+    kMethodTypeBssEntry,
     kCallEntrypoint,
     kBakerReadBarrierBranch,
   };
@@ -176,6 +177,16 @@
     return patch;
   }
 
+  static LinkerPatch MethodTypeBssEntryPatch(size_t literal_offset,
+                                             const DexFile* target_dex_file,
+                                             uint32_t pc_insn_offset,
+                                             uint32_t target_proto_idx) {
+    LinkerPatch patch(literal_offset, Type::kMethodTypeBssEntry, target_dex_file);
+    patch.proto_idx_ = target_proto_idx;
+    patch.pc_insn_offset_ = pc_insn_offset;
+    return patch;
+  }
+
   static LinkerPatch CallEntrypointPatch(size_t literal_offset,
                                          uint32_t entrypoint_offset) {
     LinkerPatch patch(literal_offset,
@@ -253,6 +264,16 @@
     return dex::StringIndex(string_idx_);
   }
 
+  const DexFile* TargetProtoDexFile() const {
+    DCHECK(patch_type_ == Type::kMethodTypeBssEntry);
+    return target_dex_file_;
+  }
+
+  dex::ProtoIndex TargetProtoIndex() const {
+    DCHECK(patch_type_ == Type::kMethodTypeBssEntry);
+    return dex::ProtoIndex(proto_idx_);
+  }
+
   uint32_t PcInsnOffset() const {
     DCHECK(patch_type_ == Type::kIntrinsicReference ||
            patch_type_ == Type::kDataBimgRelRo ||
@@ -305,12 +326,14 @@
     uint32_t method_idx_;         // Method index for Call/Method patches.
     uint32_t type_idx_;           // Type index for Type patches.
     uint32_t string_idx_;         // String index for String patches.
+    uint32_t proto_idx_;          // Proto index for MethodType patches.
     uint32_t intrinsic_data_;     // Data for IntrinsicObjects.
     uint32_t entrypoint_offset_;  // Entrypoint offset in the Thread object.
     uint32_t baker_custom_value1_;
     static_assert(sizeof(method_idx_) == sizeof(cmp1_), "needed by relational operators");
     static_assert(sizeof(type_idx_) == sizeof(cmp1_), "needed by relational operators");
     static_assert(sizeof(string_idx_) == sizeof(cmp1_), "needed by relational operators");
+    static_assert(sizeof(proto_idx_) == sizeof(cmp1_), "needed by relational operators");
     static_assert(sizeof(intrinsic_data_) == sizeof(cmp1_), "needed by relational operators");
     static_assert(sizeof(baker_custom_value1_) == sizeof(cmp1_), "needed by relational operators");
   };
diff --git a/compiler/linker/output_stream_test.cc b/compiler/linker/output_stream_test.cc
index 22b174f..6b62874 100644
--- a/compiler/linker/output_stream_test.cc
+++ b/compiler/linker/output_stream_test.cc
@@ -107,13 +107,13 @@
           flush_called(false) { }
     ~CheckingOutputStream() override {}
 
-    bool WriteFully(const void* buffer ATTRIBUTE_UNUSED,
-                    size_t byte_count ATTRIBUTE_UNUSED) override {
+    bool WriteFully([[maybe_unused]] const void* buffer,
+                    [[maybe_unused]] size_t byte_count) override {
       LOG(FATAL) << "UNREACHABLE";
       UNREACHABLE();
     }
 
-    off_t Seek(off_t offset ATTRIBUTE_UNUSED, Whence whence ATTRIBUTE_UNUSED) override {
+    off_t Seek([[maybe_unused]] off_t offset, [[maybe_unused]] Whence whence) override {
       LOG(FATAL) << "UNREACHABLE";
       UNREACHABLE();
     }
diff --git a/compiler/optimizing/block_builder.cc b/compiler/optimizing/block_builder.cc
index 703584c..12c260a 100644
--- a/compiler/optimizing/block_builder.cc
+++ b/compiler/optimizing/block_builder.cc
@@ -20,7 +20,6 @@
 #include "dex/bytecode_utils.h"
 #include "dex/code_item_accessors-inl.h"
 #include "dex/dex_file_exception_helpers.h"
-#include "quicken_info.h"
 
 namespace art HIDDEN {
 
@@ -39,10 +38,7 @@
                       nullptr,
                       local_allocator->Adapter(kArenaAllocGraphBuilder)),
       throwing_blocks_(kDefaultNumberOfThrowingBlocks,
-                       local_allocator->Adapter(kArenaAllocGraphBuilder)),
-      number_of_branches_(0u),
-      quicken_index_for_dex_pc_(std::less<uint32_t>(),
-                                local_allocator->Adapter(kArenaAllocGraphBuilder)) {}
+                       local_allocator->Adapter(kArenaAllocGraphBuilder)) {}
 
 HBasicBlock* HBasicBlockBuilder::MaybeCreateBlockAt(uint32_t dex_pc) {
   return MaybeCreateBlockAt(dex_pc, dex_pc);
@@ -104,10 +100,8 @@
     const Instruction& instruction = pair.Inst();
 
     if (instruction.IsBranch()) {
-      number_of_branches_++;
       MaybeCreateBlockAt(dex_pc + instruction.GetTargetOffset());
     } else if (instruction.IsSwitch()) {
-      number_of_branches_++;  // count as at least one branch (b/77652521)
       DexSwitchTable table(instruction, dex_pc);
       for (DexSwitchTableIterator s_it(table); !s_it.Done(); s_it.Advance()) {
         MaybeCreateBlockAt(dex_pc + s_it.CurrentTargetOffset());
@@ -147,7 +141,6 @@
   HBasicBlock* block = graph_->GetEntryBlock();
   graph_->AddBlock(block);
 
-  size_t quicken_index = 0;
   bool is_throwing_block = false;
   // Calculate the qucikening index here instead of CreateBranchTargets since it's easier to
   // calculate in dex_pc order.
@@ -158,8 +151,6 @@
     // Check if this dex_pc address starts a new basic block.
     HBasicBlock* next_block = GetBlockAt(dex_pc);
     if (next_block != nullptr) {
-      // We only need quicken index entries for basic block boundaries.
-      quicken_index_for_dex_pc_.Put(dex_pc, quicken_index);
       if (block != nullptr) {
         // Last instruction did not end its basic block but a new one starts here.
         // It must have been a block falling through into the next one.
@@ -169,10 +160,6 @@
       is_throwing_block = false;
       graph_->AddBlock(block);
     }
-    // Make sure to increment this before the continues.
-    if (QuickenInfoTable::NeedsIndexForInstruction(&instruction)) {
-      ++quicken_index;
-    }
 
     if (block == nullptr) {
       // Ignore dead code.
@@ -483,8 +470,4 @@
   body->AddSuccessor(exit_block);
 }
 
-size_t HBasicBlockBuilder::GetQuickenIndex(uint32_t dex_pc) const {
-  return quicken_index_for_dex_pc_.Get(dex_pc);
-}
-
 }  // namespace art
diff --git a/compiler/optimizing/block_builder.h b/compiler/optimizing/block_builder.h
index 8668ef8..ce1fb6f 100644
--- a/compiler/optimizing/block_builder.h
+++ b/compiler/optimizing/block_builder.h
@@ -42,11 +42,8 @@
   // Creates basic blocks in `graph_` for compiling an intrinsic.
   void BuildIntrinsic();
 
-  size_t GetNumberOfBranches() const { return number_of_branches_; }
   HBasicBlock* GetBlockAt(uint32_t dex_pc) const { return branch_targets_[dex_pc]; }
 
-  size_t GetQuickenIndex(uint32_t dex_pc) const;
-
  private:
   // Creates a basic block starting at given `dex_pc`.
   HBasicBlock* MaybeCreateBlockAt(uint32_t dex_pc);
@@ -81,10 +78,6 @@
   ScopedArenaAllocator* const local_allocator_;
   ScopedArenaVector<HBasicBlock*> branch_targets_;
   ScopedArenaVector<HBasicBlock*> throwing_blocks_;
-  size_t number_of_branches_;
-
-  // A table to quickly find the quicken index for the first instruction of a basic block.
-  ScopedArenaSafeMap<uint32_t, uint32_t> quicken_index_for_dex_pc_;
 
   static constexpr size_t kDefaultNumberOfThrowingBlocks = 2u;
 
diff --git a/compiler/optimizing/bounds_check_elimination.cc b/compiler/optimizing/bounds_check_elimination.cc
index 919abfd..c0d4c37 100644
--- a/compiler/optimizing/bounds_check_elimination.cc
+++ b/compiler/optimizing/bounds_check_elimination.cc
@@ -1047,14 +1047,14 @@
 
     HDiv* div = nullptr;
     int64_t const_divisor = 0;
-    if (HMul* mul = instruction->GetRight()->AsMul()) {
+    if (HMul* mul = instruction->GetRight()->AsMulOrNull()) {
       if (!mul->GetLeft()->IsDiv() || !mul->GetRight()->IsConstant()) {
         return false;
       }
       div = mul->GetLeft()->AsDiv();
       const_divisor = Int64FromConstant(mul->GetRight()->AsConstant());
-    } else if (HAdd* add = instruction->GetRight()->AsAdd()) {
-      HShl* shl = add->GetRight()->AsShl();
+    } else if (HAdd* add = instruction->GetRight()->AsAddOrNull()) {
+      HShl* shl = add->GetRight()->AsShlOrNull();
       if (!is_needed_shl(shl)) {
         return false;
       }
@@ -1070,8 +1070,8 @@
         return false;
       }
       const_divisor = (1LL << n) + 1;
-    } else if (HSub* sub = instruction->GetRight()->AsSub()) {
-      HShl* shl = sub->GetLeft()->AsShl();
+    } else if (HSub* sub = instruction->GetRight()->AsSubOrNull()) {
+      HShl* shl = sub->GetLeft()->AsShlOrNull();
       if (!is_needed_shl(shl)) {
         return false;
       }
@@ -1378,8 +1378,7 @@
                                     HInstruction* array_length,
                                     HInstruction* base,
                                     int32_t min_c, int32_t max_c) {
-    HBoundsCheck* bounds_check =
-        first_index_bounds_check_map_.Get(array_length->GetId())->AsBoundsCheck();
+    HBoundsCheck* bounds_check = first_index_bounds_check_map_.Get(array_length->GetId());
     // Construct deoptimization on single or double bounds on range [base-min_c,base+max_c],
     // for example either for a[0]..a[3] just 3 or for a[base-1]..a[base+3] both base-1
     // and base+3, since we made the assumption any in between value may occur too.
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc
index 48d1a9d..1dea396 100644
--- a/compiler/optimizing/builder.cc
+++ b/compiler/optimizing/builder.cc
@@ -63,7 +63,7 @@
       compilation_stats_(nullptr),
       return_type_(return_type) {}
 
-bool HGraphBuilder::SkipCompilation(size_t number_of_branches) {
+bool HGraphBuilder::SkipCompilation() {
   if (code_generator_ == nullptr) {
     // Note that the codegen is null when unit testing.
     return false;
@@ -84,15 +84,6 @@
     return true;
   }
 
-  // If it's large and contains no branches, it's likely to be machine generated initialization.
-  if (compiler_options.IsLargeMethod(code_units) && (number_of_branches == 0)) {
-    VLOG(compiler) << "Skip compilation of large method with no branch "
-                   << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex())
-                   << ": " << code_units << " code units";
-    MaybeRecordStat(compilation_stats_, MethodCompilationStat::kNotCompiledLargeMethodNoBranches);
-    return true;
-  }
-
   return false;
 }
 
@@ -129,9 +120,9 @@
     return kAnalysisInvalidBytecode;
   }
 
-  // 2) Decide whether to skip this method based on its code size and number
-  //    of branches.
-  if (SkipCompilation(block_builder.GetNumberOfBranches())) {
+  // 2) Decide whether to skip compiling this method based on e.g. the compiler filter and method's
+  // code size.
+  if (SkipCompilation()) {
     return kAnalysisSkipped;
   }
 
diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h
index ef225d9..b81b2f0 100644
--- a/compiler/optimizing/builder.h
+++ b/compiler/optimizing/builder.h
@@ -53,7 +53,7 @@
   static constexpr const char* kBuilderPassName = "builder";
 
  private:
-  bool SkipCompilation(size_t number_of_branches);
+  bool SkipCompilation();
 
   HGraph* const graph_;
   const DexFile* const dex_file_;
diff --git a/compiler/optimizing/code_generation_data.cc b/compiler/optimizing/code_generation_data.cc
new file mode 100644
index 0000000..7b23d46
--- /dev/null
+++ b/compiler/optimizing/code_generation_data.cc
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "class_linker.h"
+#include "code_generation_data.h"
+#include "code_generator.h"
+#include "intern_table.h"
+#include "mirror/object-inl.h"
+#include "runtime.h"
+
+namespace art HIDDEN {
+
+void CodeGenerationData::EmitJitRoots(
+    /*out*/std::vector<Handle<mirror::Object>>* roots) {
+  DCHECK(roots->empty());
+  roots->reserve(GetNumberOfJitRoots());
+  ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
+  size_t index = 0;
+  for (auto& entry : jit_string_roots_) {
+    // Update the `roots` with the string, and replace the address temporarily
+    // stored to the index in the table.
+    uint64_t address = entry.second;
+    roots->emplace_back(reinterpret_cast<StackReference<mirror::Object>*>(address));
+    DCHECK(roots->back() != nullptr);
+    DCHECK(roots->back()->IsString());
+    entry.second = index;
+    // Ensure the string is strongly interned. This is a requirement on how the JIT
+    // handles strings. b/32995596
+    class_linker->GetInternTable()->InternStrong(roots->back()->AsString());
+    ++index;
+  }
+  for (auto& entry : jit_class_roots_) {
+    // Update the `roots` with the class, and replace the address temporarily
+    // stored to the index in the table.
+    uint64_t address = entry.second;
+    roots->emplace_back(reinterpret_cast<StackReference<mirror::Object>*>(address));
+    DCHECK(roots->back() != nullptr);
+    DCHECK(roots->back()->IsClass());
+    entry.second = index;
+    ++index;
+  }
+}
+
+}  // namespace art
diff --git a/compiler/optimizing/code_generation_data.h b/compiler/optimizing/code_generation_data.h
new file mode 100644
index 0000000..e78ba8f
--- /dev/null
+++ b/compiler/optimizing/code_generation_data.h
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_COMPILER_OPTIMIZING_CODE_GENERATION_DATA_H_
+#define ART_COMPILER_OPTIMIZING_CODE_GENERATION_DATA_H_
+
+#include <memory>
+
+#include "arch/instruction_set.h"
+#include "base/scoped_arena_allocator.h"
+#include "base/scoped_arena_containers.h"
+#include "code_generator.h"
+#include "dex/string_reference.h"
+#include "dex/type_reference.h"
+#include "handle.h"
+#include "mirror/class.h"
+#include "mirror/object.h"
+#include "mirror/string.h"
+#include "stack_map_stream.h"
+
+namespace art HIDDEN {
+
+class CodeGenerationData : public DeletableArenaObject<kArenaAllocCodeGenerator> {
+ public:
+  static std::unique_ptr<CodeGenerationData> Create(ArenaStack* arena_stack,
+                                                    InstructionSet instruction_set) {
+    ScopedArenaAllocator allocator(arena_stack);
+    void* memory = allocator.Alloc<CodeGenerationData>(kArenaAllocCodeGenerator);
+    return std::unique_ptr<CodeGenerationData>(
+        ::new (memory) CodeGenerationData(std::move(allocator), instruction_set));
+  }
+
+  ScopedArenaAllocator* GetScopedAllocator() {
+    return &allocator_;
+  }
+
+  void AddSlowPath(SlowPathCode* slow_path) {
+    slow_paths_.emplace_back(std::unique_ptr<SlowPathCode>(slow_path));
+  }
+
+  ArrayRef<const std::unique_ptr<SlowPathCode>> GetSlowPaths() const {
+    return ArrayRef<const std::unique_ptr<SlowPathCode>>(slow_paths_);
+  }
+
+  StackMapStream* GetStackMapStream() { return &stack_map_stream_; }
+
+  void ReserveJitStringRoot(StringReference string_reference, Handle<mirror::String> string) {
+    jit_string_roots_.Overwrite(string_reference,
+                                reinterpret_cast64<uint64_t>(string.GetReference()));
+  }
+
+  uint64_t GetJitStringRootIndex(StringReference string_reference) const {
+    return jit_string_roots_.Get(string_reference);
+  }
+
+  size_t GetNumberOfJitStringRoots() const {
+    return jit_string_roots_.size();
+  }
+
+  void ReserveJitClassRoot(TypeReference type_reference, Handle<mirror::Class> klass) {
+    jit_class_roots_.Overwrite(type_reference, reinterpret_cast64<uint64_t>(klass.GetReference()));
+  }
+
+  uint64_t GetJitClassRootIndex(TypeReference type_reference) const {
+    return jit_class_roots_.Get(type_reference);
+  }
+
+  size_t GetNumberOfJitClassRoots() const {
+    return jit_class_roots_.size();
+  }
+
+  size_t GetNumberOfJitRoots() const {
+    return GetNumberOfJitStringRoots() + GetNumberOfJitClassRoots();
+  }
+
+  void EmitJitRoots(/*out*/std::vector<Handle<mirror::Object>>* roots)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+
+ private:
+  CodeGenerationData(ScopedArenaAllocator&& allocator, InstructionSet instruction_set)
+      : allocator_(std::move(allocator)),
+        stack_map_stream_(&allocator_, instruction_set),
+        slow_paths_(allocator_.Adapter(kArenaAllocCodeGenerator)),
+        jit_string_roots_(StringReferenceValueComparator(),
+                          allocator_.Adapter(kArenaAllocCodeGenerator)),
+        jit_class_roots_(TypeReferenceValueComparator(),
+                         allocator_.Adapter(kArenaAllocCodeGenerator)) {
+    slow_paths_.reserve(kDefaultSlowPathsCapacity);
+  }
+
+  static constexpr size_t kDefaultSlowPathsCapacity = 8;
+
+  ScopedArenaAllocator allocator_;
+  StackMapStream stack_map_stream_;
+  ScopedArenaVector<std::unique_ptr<SlowPathCode>> slow_paths_;
+
+  // Maps a StringReference (dex_file, string_index) to the index in the literal table.
+  // Entries are initially added with a pointer in the handle zone, and `EmitJitRoots`
+  // will compute all the indices.
+  ScopedArenaSafeMap<StringReference, uint64_t, StringReferenceValueComparator> jit_string_roots_;
+
+  // Maps a ClassReference (dex_file, type_index) to the index in the literal table.
+  // Entries are initially added with a pointer in the handle zone, and `EmitJitRoots`
+  // will compute all the indices.
+  ScopedArenaSafeMap<TypeReference, uint64_t, TypeReferenceValueComparator> jit_class_roots_;
+};
+
+}  // namespace art
+
+#endif  // ART_COMPILER_OPTIMIZING_CODE_GENERATION_DATA_H_
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc
index c9f42b5..c734922 100644
--- a/compiler/optimizing/code_generator.cc
+++ b/compiler/optimizing/code_generator.cc
@@ -44,10 +44,10 @@
 #include "base/leb128.h"
 #include "class_linker.h"
 #include "class_root-inl.h"
+#include "code_generation_data.h"
 #include "dex/bytecode_utils.h"
 #include "dex/code_item_accessors-inl.h"
 #include "graph_visualizer.h"
-#include "image.h"
 #include "gc/space/image_space.h"
 #include "intern_table.h"
 #include "intrinsics.h"
@@ -59,7 +59,8 @@
 #include "parallel_move_resolver.h"
 #include "scoped_thread_state_change-inl.h"
 #include "ssa_liveness_analysis.h"
-#include "stack_map.h"
+#include "oat/image.h"
+#include "oat/stack_map.h"
 #include "stack_map_stream.h"
 #include "string_builder_append.h"
 #include "thread-current-inl.h"
@@ -141,120 +142,40 @@
   return true;
 }
 
-class CodeGenerator::CodeGenerationData : public DeletableArenaObject<kArenaAllocCodeGenerator> {
- public:
-  static std::unique_ptr<CodeGenerationData> Create(ArenaStack* arena_stack,
-                                                    InstructionSet instruction_set) {
-    ScopedArenaAllocator allocator(arena_stack);
-    void* memory = allocator.Alloc<CodeGenerationData>(kArenaAllocCodeGenerator);
-    return std::unique_ptr<CodeGenerationData>(
-        ::new (memory) CodeGenerationData(std::move(allocator), instruction_set));
-  }
+bool CodeGenerator::EmitReadBarrier() const {
+  return GetCompilerOptions().EmitReadBarrier();
+}
 
-  ScopedArenaAllocator* GetScopedAllocator() {
-    return &allocator_;
-  }
+bool CodeGenerator::EmitBakerReadBarrier() const {
+  return kUseBakerReadBarrier && GetCompilerOptions().EmitReadBarrier();
+}
 
-  void AddSlowPath(SlowPathCode* slow_path) {
-    slow_paths_.emplace_back(std::unique_ptr<SlowPathCode>(slow_path));
-  }
+bool CodeGenerator::EmitNonBakerReadBarrier() const {
+  return !kUseBakerReadBarrier && GetCompilerOptions().EmitReadBarrier();
+}
 
-  ArrayRef<const std::unique_ptr<SlowPathCode>> GetSlowPaths() const {
-    return ArrayRef<const std::unique_ptr<SlowPathCode>>(slow_paths_);
-  }
+ReadBarrierOption CodeGenerator::GetCompilerReadBarrierOption() const {
+  return EmitReadBarrier() ? kWithReadBarrier : kWithoutReadBarrier;
+}
 
-  StackMapStream* GetStackMapStream() { return &stack_map_stream_; }
+bool CodeGenerator::ShouldCheckGCCard(DataType::Type type,
+                                      HInstruction* value,
+                                      WriteBarrierKind write_barrier_kind) const {
+  const CompilerOptions& options = GetCompilerOptions();
+  const bool result =
+      // Check the GC card in debug mode,
+      options.EmitRunTimeChecksInDebugMode() &&
+      // only for CC GC,
+      options.EmitReadBarrier() &&
+      // and if we eliminated the write barrier in WBE.
+      !StoreNeedsWriteBarrier(type, value, write_barrier_kind) &&
+      CodeGenerator::StoreNeedsWriteBarrier(type, value);
 
-  void ReserveJitStringRoot(StringReference string_reference, Handle<mirror::String> string) {
-    jit_string_roots_.Overwrite(string_reference,
-                                reinterpret_cast64<uint64_t>(string.GetReference()));
-  }
+  DCHECK_IMPLIES(result, write_barrier_kind == WriteBarrierKind::kDontEmit);
+  DCHECK_IMPLIES(
+      result, !(GetGraph()->IsCompilingBaseline() && compiler_options_.ProfileBranches()));
 
-  uint64_t GetJitStringRootIndex(StringReference string_reference) const {
-    return jit_string_roots_.Get(string_reference);
-  }
-
-  size_t GetNumberOfJitStringRoots() const {
-    return jit_string_roots_.size();
-  }
-
-  void ReserveJitClassRoot(TypeReference type_reference, Handle<mirror::Class> klass) {
-    jit_class_roots_.Overwrite(type_reference, reinterpret_cast64<uint64_t>(klass.GetReference()));
-  }
-
-  uint64_t GetJitClassRootIndex(TypeReference type_reference) const {
-    return jit_class_roots_.Get(type_reference);
-  }
-
-  size_t GetNumberOfJitClassRoots() const {
-    return jit_class_roots_.size();
-  }
-
-  size_t GetNumberOfJitRoots() const {
-    return GetNumberOfJitStringRoots() + GetNumberOfJitClassRoots();
-  }
-
-  void EmitJitRoots(/*out*/std::vector<Handle<mirror::Object>>* roots)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-
- private:
-  CodeGenerationData(ScopedArenaAllocator&& allocator, InstructionSet instruction_set)
-      : allocator_(std::move(allocator)),
-        stack_map_stream_(&allocator_, instruction_set),
-        slow_paths_(allocator_.Adapter(kArenaAllocCodeGenerator)),
-        jit_string_roots_(StringReferenceValueComparator(),
-                          allocator_.Adapter(kArenaAllocCodeGenerator)),
-        jit_class_roots_(TypeReferenceValueComparator(),
-                         allocator_.Adapter(kArenaAllocCodeGenerator)) {
-    slow_paths_.reserve(kDefaultSlowPathsCapacity);
-  }
-
-  static constexpr size_t kDefaultSlowPathsCapacity = 8;
-
-  ScopedArenaAllocator allocator_;
-  StackMapStream stack_map_stream_;
-  ScopedArenaVector<std::unique_ptr<SlowPathCode>> slow_paths_;
-
-  // Maps a StringReference (dex_file, string_index) to the index in the literal table.
-  // Entries are intially added with a pointer in the handle zone, and `EmitJitRoots`
-  // will compute all the indices.
-  ScopedArenaSafeMap<StringReference, uint64_t, StringReferenceValueComparator> jit_string_roots_;
-
-  // Maps a ClassReference (dex_file, type_index) to the index in the literal table.
-  // Entries are intially added with a pointer in the handle zone, and `EmitJitRoots`
-  // will compute all the indices.
-  ScopedArenaSafeMap<TypeReference, uint64_t, TypeReferenceValueComparator> jit_class_roots_;
-};
-
-void CodeGenerator::CodeGenerationData::EmitJitRoots(
-    /*out*/std::vector<Handle<mirror::Object>>* roots) {
-  DCHECK(roots->empty());
-  roots->reserve(GetNumberOfJitRoots());
-  ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
-  size_t index = 0;
-  for (auto& entry : jit_string_roots_) {
-    // Update the `roots` with the string, and replace the address temporarily
-    // stored to the index in the table.
-    uint64_t address = entry.second;
-    roots->emplace_back(reinterpret_cast<StackReference<mirror::Object>*>(address));
-    DCHECK(roots->back() != nullptr);
-    DCHECK(roots->back()->IsString());
-    entry.second = index;
-    // Ensure the string is strongly interned. This is a requirement on how the JIT
-    // handles strings. b/32995596
-    class_linker->GetInternTable()->InternStrong(roots->back()->AsString());
-    ++index;
-  }
-  for (auto& entry : jit_class_roots_) {
-    // Update the `roots` with the class, and replace the address temporarily
-    // stored to the index in the table.
-    uint64_t address = entry.second;
-    roots->emplace_back(reinterpret_cast<StackReference<mirror::Object>*>(address));
-    DCHECK(roots->back() != nullptr);
-    DCHECK(roots->back()->IsClass());
-    entry.second = index;
-    ++index;
-  }
+  return result;
 }
 
 ScopedArenaAllocator* CodeGenerator::GetScopedAllocator() {
@@ -288,8 +209,8 @@
   return code_generation_data_->GetJitClassRootIndex(type_reference);
 }
 
-void CodeGenerator::EmitJitRootPatches(uint8_t* code ATTRIBUTE_UNUSED,
-                                       const uint8_t* roots_data ATTRIBUTE_UNUSED) {
+void CodeGenerator::EmitJitRootPatches([[maybe_unused]] uint8_t* code,
+                                       [[maybe_unused]] const uint8_t* roots_data) {
   DCHECK(code_generation_data_ != nullptr);
   DCHECK_EQ(code_generation_data_->GetNumberOfJitStringRoots(), 0u);
   DCHECK_EQ(code_generation_data_->GetNumberOfJitClassRoots(), 0u);
@@ -378,7 +299,7 @@
   code_generation_data_ = CodeGenerationData::Create(graph_->GetArenaStack(), GetInstructionSet());
 }
 
-void CodeGenerator::Compile(CodeAllocator* allocator) {
+void CodeGenerator::Compile() {
   InitializeCodeGenerationData();
 
   // The register allocator already called `InitializeCodeGeneration`,
@@ -394,7 +315,8 @@
                                    fpu_spill_mask_,
                                    GetGraph()->GetNumberOfVRegs(),
                                    GetGraph()->IsCompilingBaseline(),
-                                   GetGraph()->IsDebuggable());
+                                   GetGraph()->IsDebuggable(),
+                                   GetGraph()->HasShouldDeoptimizeFlag());
 
   size_t frame_start = GetAssembler()->CodeSize();
   GenerateFrameEntry();
@@ -443,32 +365,28 @@
   }
 
   // Finalize instructions in assember;
-  Finalize(allocator);
+  Finalize();
 
   GetStackMapStream()->EndMethod(GetAssembler()->CodeSize());
 }
 
-void CodeGenerator::Finalize(CodeAllocator* allocator) {
-  size_t code_size = GetAssembler()->CodeSize();
-  uint8_t* buffer = allocator->Allocate(code_size);
-
-  MemoryRegion code(buffer, code_size);
-  GetAssembler()->FinalizeInstructions(code);
+void CodeGenerator::Finalize() {
+  GetAssembler()->FinalizeCode();
 }
 
 void CodeGenerator::EmitLinkerPatches(
-    ArenaVector<linker::LinkerPatch>* linker_patches ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] ArenaVector<linker::LinkerPatch>* linker_patches) {
   // No linker patches by default.
 }
 
-bool CodeGenerator::NeedsThunkCode(const linker::LinkerPatch& patch ATTRIBUTE_UNUSED) const {
+bool CodeGenerator::NeedsThunkCode([[maybe_unused]] const linker::LinkerPatch& patch) const {
   // Code generators that create patches requiring thunk compilation should override this function.
   return false;
 }
 
-void CodeGenerator::EmitThunkCode(const linker::LinkerPatch& patch ATTRIBUTE_UNUSED,
-                                  /*out*/ ArenaVector<uint8_t>* code ATTRIBUTE_UNUSED,
-                                  /*out*/ std::string* debug_name ATTRIBUTE_UNUSED) {
+void CodeGenerator::EmitThunkCode([[maybe_unused]] const linker::LinkerPatch& patch,
+                                  [[maybe_unused]] /*out*/ ArenaVector<uint8_t>* code,
+                                  [[maybe_unused]] /*out*/ std::string* debug_name) {
   // Code generators that create patches requiring thunk compilation should override this function.
   LOG(FATAL) << "Unexpected call to EmitThunkCode().";
 }
@@ -730,7 +648,7 @@
   }
 
   // Note that pSetXXStatic/pGetXXStatic always takes/returns an int or int64
-  // regardless of the the type. Because of that we forced to special case
+  // regardless of the type. Because of that we forced to special case
   // the access to floating point values.
   if (is_get) {
     if (DataType::IsFloatingPointType(field_type)) {
@@ -745,8 +663,8 @@
       locations->SetOut(calling_convention.GetReturnLocation(field_type));
     }
   } else {
-     size_t set_index = is_instance ? 1 : 0;
-     if (DataType::IsFloatingPointType(field_type)) {
+    size_t set_index = is_instance ? 1 : 0;
+    if (DataType::IsFloatingPointType(field_type)) {
       // The set value comes from a float location while the calling convention
       // expects it in a regular register location. Allocate a temp for it and
       // make the transfer at codegen.
@@ -1028,6 +946,12 @@
           new (allocator) arm64::CodeGeneratorARM64(graph, compiler_options, stats));
     }
 #endif
+#ifdef ART_ENABLE_CODEGEN_riscv64
+    case InstructionSet::kRiscv64: {
+      return std::unique_ptr<CodeGenerator>(
+          new (allocator) riscv64::CodeGeneratorRISCV64(graph, compiler_options, stats));
+    }
+#endif
 #ifdef ART_ENABLE_CODEGEN_x86
     case InstructionSet::kX86: {
       return std::unique_ptr<CodeGenerator>(
@@ -1704,6 +1628,17 @@
   GetMoveResolver()->EmitNativeCode(&parallel_move);
 }
 
+bool CodeGenerator::StoreNeedsWriteBarrier(DataType::Type type,
+                                           HInstruction* value,
+                                           WriteBarrierKind write_barrier_kind) const {
+  // Check that null value is not represented as an integer constant.
+  DCHECK_IMPLIES(type == DataType::Type::kReference, !value->IsIntConstant());
+  // Branch profiling currently doesn't support running optimizations.
+  return (GetGraph()->IsCompilingBaseline() && compiler_options_.ProfileBranches())
+            ? CodeGenerator::StoreNeedsWriteBarrier(type, value)
+            : write_barrier_kind != WriteBarrierKind::kDontEmit;
+}
+
 void CodeGenerator::ValidateInvokeRuntime(QuickEntrypointEnum entrypoint,
                                           HInstruction* instruction,
                                           SlowPathCode* slow_path) {
@@ -1736,10 +1671,8 @@
              // When (non-Baker) read barriers are enabled, some instructions
              // use a slow path to emit a read barrier, which does not trigger
              // GC.
-             (gUseReadBarrier &&
-              !kUseBakerReadBarrier &&
+             (EmitNonBakerReadBarrier() &&
               (instruction->IsInstanceFieldGet() ||
-               instruction->IsPredicatedInstanceFieldGet() ||
                instruction->IsStaticFieldGet() ||
                instruction->IsArrayGet() ||
                instruction->IsLoadClass() ||
@@ -1776,11 +1709,11 @@
   // PC-related information.
   DCHECK(kUseBakerReadBarrier);
   DCHECK(instruction->IsInstanceFieldGet() ||
-         instruction->IsPredicatedInstanceFieldGet() ||
          instruction->IsStaticFieldGet() ||
          instruction->IsArrayGet() ||
          instruction->IsArraySet() ||
          instruction->IsLoadClass() ||
+         instruction->IsLoadMethodType() ||
          instruction->IsLoadString() ||
          instruction->IsInstanceOf() ||
          instruction->IsCheckCast() ||
@@ -1831,26 +1764,28 @@
   }
 }
 
-void CodeGenerator::CreateSystemArrayCopyLocationSummary(HInvoke* invoke) {
+LocationSummary* CodeGenerator::CreateSystemArrayCopyLocationSummary(
+    HInvoke* invoke, int32_t length_threshold, size_t num_temps) {
   // Check to see if we have known failures that will cause us to have to bail out
   // to the runtime, and just generate the runtime call directly.
-  HIntConstant* src_pos = invoke->InputAt(1)->AsIntConstant();
-  HIntConstant* dest_pos = invoke->InputAt(3)->AsIntConstant();
+  HIntConstant* src_pos = invoke->InputAt(1)->AsIntConstantOrNull();
+  HIntConstant* dest_pos = invoke->InputAt(3)->AsIntConstantOrNull();
 
   // The positions must be non-negative.
   if ((src_pos != nullptr && src_pos->GetValue() < 0) ||
       (dest_pos != nullptr && dest_pos->GetValue() < 0)) {
     // We will have to fail anyways.
-    return;
+    return nullptr;
   }
 
-  // The length must be >= 0.
-  HIntConstant* length = invoke->InputAt(4)->AsIntConstant();
+  // The length must be >= 0. If a positive `length_threshold` is provided, lengths
+  // greater or equal to the threshold are also handled by the normal implementation.
+  HIntConstant* length = invoke->InputAt(4)->AsIntConstantOrNull();
   if (length != nullptr) {
     int32_t len = length->GetValue();
-    if (len < 0) {
+    if (len < 0 || (length_threshold > 0 && len >= length_threshold)) {
       // Just call as normal.
-      return;
+      return nullptr;
     }
   }
 
@@ -1859,13 +1794,13 @@
   if (optimizations.GetDestinationIsSource()) {
     if (src_pos != nullptr && dest_pos != nullptr && src_pos->GetValue() < dest_pos->GetValue()) {
       // We only support backward copying if source and destination are the same.
-      return;
+      return nullptr;
     }
   }
 
   if (optimizations.GetDestinationIsPrimitiveArray() || optimizations.GetSourceIsPrimitiveArray()) {
     // We currently don't intrinsify primitive copying.
-    return;
+    return nullptr;
   }
 
   ArenaAllocator* allocator = invoke->GetBlock()->GetGraph()->GetAllocator();
@@ -1879,9 +1814,10 @@
   locations->SetInAt(3, Location::RegisterOrConstant(invoke->InputAt(3)));
   locations->SetInAt(4, Location::RegisterOrConstant(invoke->InputAt(4)));
 
-  locations->AddTemp(Location::RequiresRegister());
-  locations->AddTemp(Location::RequiresRegister());
-  locations->AddTemp(Location::RequiresRegister());
+  if (num_temps != 0u) {
+    locations->AddRegisterTemps(num_temps);
+  }
+  return locations;
 }
 
 void CodeGenerator::EmitJitRoots(uint8_t* code,
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h
index 9872efa..c54c96c 100644
--- a/compiler/optimizing/code_generator.h
+++ b/compiler/optimizing/code_generator.h
@@ -34,7 +34,7 @@
 #include "graph_visualizer.h"
 #include "locations.h"
 #include "nodes.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "optimizing_compiler_stats.h"
 #include "read_barrier_option.h"
 #include "stack.h"
@@ -59,9 +59,6 @@
 // Maximum value for a primitive long.
 static int64_t constexpr kPrimLongMax = INT64_C(0x7fffffffffffffff);
 
-static const ReadBarrierOption gCompilerReadBarrierOption =
-    gUseReadBarrier ? kWithReadBarrier : kWithoutReadBarrier;
-
 constexpr size_t status_lsb_position = SubtypeCheckBits::BitStructSizeOf();
 constexpr size_t status_byte_offset =
     mirror::Class::StatusOffset().SizeValue() + (status_lsb_position / kBitsPerByte);
@@ -73,6 +70,7 @@
     enum_cast<uint32_t>(ClassStatus::kInitialized) << (status_lsb_position % kBitsPerByte);
 
 class Assembler;
+class CodeGenerationData;
 class CodeGenerator;
 class CompilerOptions;
 class StackMapStream;
@@ -82,18 +80,6 @@
 class LinkerPatch;
 }  // namespace linker
 
-class CodeAllocator {
- public:
-  CodeAllocator() {}
-  virtual ~CodeAllocator() {}
-
-  virtual uint8_t* Allocate(size_t size) = 0;
-  virtual ArrayRef<const uint8_t> GetMemory() const = 0;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(CodeAllocator);
-};
-
 class SlowPathCode : public DeletableArenaObject<kArenaAllocSlowPaths> {
  public:
   explicit SlowPathCode(HInstruction* instruction) : instruction_(instruction) {
@@ -200,7 +186,7 @@
 class CodeGenerator : public DeletableArenaObject<kArenaAllocCodeGenerator> {
  public:
   // Compiles the graph to executable instructions.
-  void Compile(CodeAllocator* allocator);
+  void Compile();
   static std::unique_ptr<CodeGenerator> Create(HGraph* graph,
                                                const CompilerOptions& compiler_options,
                                                OptimizingCompilerStats* stats = nullptr);
@@ -221,7 +207,7 @@
   }
 
   virtual void Initialize() = 0;
-  virtual void Finalize(CodeAllocator* allocator);
+  virtual void Finalize();
   virtual void EmitLinkerPatches(ArenaVector<linker::LinkerPatch>* linker_patches);
   virtual bool NeedsThunkCode(const linker::LinkerPatch& patch) const;
   virtual void EmitThunkCode(const linker::LinkerPatch& patch,
@@ -265,6 +251,10 @@
 
   uint32_t GetFrameSize() const { return frame_size_; }
   void SetFrameSize(uint32_t size) { frame_size_ = size; }
+  uint32_t GetMaximumFrameSize() const {
+    return GetStackOverflowReservedBytes(GetInstructionSet());
+  }
+
   uint32_t GetCoreSpillMask() const { return core_spill_mask_; }
   uint32_t GetFpuSpillMask() const { return fpu_spill_mask_; }
 
@@ -278,20 +268,10 @@
     fpu_spill_mask_ = allocated_registers_.GetFloatingPointRegisters() & fpu_callee_save_mask_;
   }
 
-  static uint32_t ComputeRegisterMask(const int* registers, size_t length) {
-    uint32_t mask = 0;
-    for (size_t i = 0, e = length; i < e; ++i) {
-      mask |= (1 << registers[i]);
-    }
-    return mask;
-  }
-
   virtual void DumpCoreRegister(std::ostream& stream, int reg) const = 0;
   virtual void DumpFloatingPointRegister(std::ostream& stream, int reg) const = 0;
   virtual InstructionSet GetInstructionSet() const = 0;
 
-  const CompilerOptions& GetCompilerOptions() const { return compiler_options_; }
-
   // Saves the register in the stack. Returns the size taken on stack.
   virtual size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) = 0;
   // Restores the register from the stack. Returns the size taken on stack.
@@ -398,6 +378,17 @@
   // TODO: Replace with a catch-entering instruction that records the environment.
   void RecordCatchBlockInfo();
 
+  const CompilerOptions& GetCompilerOptions() const { return compiler_options_; }
+  bool EmitReadBarrier() const;
+  bool EmitBakerReadBarrier() const;
+  bool EmitNonBakerReadBarrier() const;
+  ReadBarrierOption GetCompilerReadBarrierOption() const;
+
+  // Returns true if we should check the GC card for consistency purposes.
+  bool ShouldCheckGCCard(DataType::Type type,
+                         HInstruction* value,
+                         WriteBarrierKind write_barrier_kind) const;
+
   // Get the ScopedArenaAllocator used for codegen memory allocation.
   ScopedArenaAllocator* GetScopedAllocator();
 
@@ -469,7 +460,7 @@
                          Location to2,
                          DataType::Type type2);
 
-  static bool InstanceOfNeedsReadBarrier(HInstanceOf* instance_of) {
+  bool InstanceOfNeedsReadBarrier(HInstanceOf* instance_of) {
     // Used only for kExactCheck, kAbstractClassCheck, kClassHierarchyCheck and kArrayObjectCheck.
     DCHECK(instance_of->GetTypeCheckKind() == TypeCheckKind::kExactCheck ||
            instance_of->GetTypeCheckKind() == TypeCheckKind::kAbstractClassCheck ||
@@ -479,14 +470,14 @@
     // If the target class is in the boot image, it's non-moveable and it doesn't matter
     // if we compare it with a from-space or to-space reference, the result is the same.
     // It's OK to traverse a class hierarchy jumping between from-space and to-space.
-    return gUseReadBarrier && !instance_of->GetTargetClass()->IsInBootImage();
+    return EmitReadBarrier() && !instance_of->GetTargetClass()->IsInBootImage();
   }
 
-  static ReadBarrierOption ReadBarrierOptionForInstanceOf(HInstanceOf* instance_of) {
+  ReadBarrierOption ReadBarrierOptionForInstanceOf(HInstanceOf* instance_of) {
     return InstanceOfNeedsReadBarrier(instance_of) ? kWithReadBarrier : kWithoutReadBarrier;
   }
 
-  static bool IsTypeCheckSlowPathFatal(HCheckCast* check_cast) {
+  bool IsTypeCheckSlowPathFatal(HCheckCast* check_cast) {
     switch (check_cast->GetTypeCheckKind()) {
       case TypeCheckKind::kExactCheck:
       case TypeCheckKind::kAbstractClassCheck:
@@ -494,7 +485,7 @@
       case TypeCheckKind::kArrayObjectCheck:
       case TypeCheckKind::kInterfaceCheck: {
         bool needs_read_barrier =
-            gUseReadBarrier && !check_cast->GetTargetClass()->IsInBootImage();
+            EmitReadBarrier() && !check_cast->GetTargetClass()->IsInBootImage();
         // We do not emit read barriers for HCheckCast, so we can get false negatives
         // and the slow path shall re-check and simply return if the cast is actually OK.
         return !needs_read_barrier;
@@ -509,7 +500,7 @@
     UNREACHABLE();
   }
 
-  static LocationSummary::CallKind GetCheckCastCallKind(HCheckCast* check_cast) {
+  LocationSummary::CallKind GetCheckCastCallKind(HCheckCast* check_cast) {
     return (IsTypeCheckSlowPathFatal(check_cast) && !check_cast->CanThrowIntoCatchBlock())
         ? LocationSummary::kNoCall  // In fact, call on a fatal (non-returning) slow path.
         : LocationSummary::kCallOnSlowPath;
@@ -521,6 +512,11 @@
     return type == DataType::Type::kReference && !value->IsNullConstant();
   }
 
+  // If we are compiling a graph with the WBE pass enabled, we want to honor the WriteBarrierKind
+  // set during the WBE pass.
+  bool StoreNeedsWriteBarrier(DataType::Type type,
+                              HInstruction* value,
+                              WriteBarrierKind write_barrier_kind) const;
 
   // Performs checks pertaining to an InvokeRuntime call.
   void ValidateInvokeRuntime(QuickEntrypointEnum entrypoint,
@@ -613,7 +609,7 @@
       if (kIsDebugBuild) {
         uint32_t shorty_len;
         const char* shorty = GetCriticalNativeShorty(invoke, &shorty_len);
-        DCHECK_EQ(GetCriticalNativeDirectCallFrameSize(shorty, shorty_len), out_frame_size);
+        CHECK_EQ(GetCriticalNativeDirectCallFrameSize(shorty, shorty_len), out_frame_size);
       }
       if (out_frame_size != 0u) {
         FinishCriticalNativeFrameSetup(out_frame_size, &parallel_move);
@@ -667,7 +663,8 @@
   static uint32_t GetBootImageOffset(ClassRoot class_root);
   static uint32_t GetBootImageOffsetOfIntrinsicDeclaringClass(HInvoke* invoke);
 
-  static void CreateSystemArrayCopyLocationSummary(HInvoke* invoke);
+  static LocationSummary* CreateSystemArrayCopyLocationSummary(
+      HInvoke* invoke, int32_t length_threshold = -1, size_t num_temps = 3);
 
   void SetDisassemblyInformation(DisassemblyInformation* info) { disasm_info_ = info; }
   DisassemblyInformation* GetDisassemblyInformation() const { return disasm_info_; }
@@ -687,7 +684,7 @@
   virtual HLoadClass::LoadKind GetSupportedLoadClassKind(
       HLoadClass::LoadKind desired_class_load_kind) = 0;
 
-  static LocationSummary::CallKind GetLoadStringCallKind(HLoadString* load) {
+  LocationSummary::CallKind GetLoadStringCallKind(HLoadString* load) {
     switch (load->GetLoadKind()) {
       case HLoadString::LoadKind::kBssEntry:
         DCHECK(load->NeedsEnvironment());
@@ -697,7 +694,7 @@
         return LocationSummary::kCallOnMainOnly;
       case HLoadString::LoadKind::kJitTableAddress:
         DCHECK(!load->NeedsEnvironment());
-        return gUseReadBarrier
+        return EmitReadBarrier()
             ? LocationSummary::kCallOnSlowPath
             : LocationSummary::kNoCall;
         break;
@@ -731,6 +728,11 @@
   static QuickEntrypointEnum GetArrayAllocationEntrypoint(HNewArray* new_array);
   static ScaleFactor ScaleFactorForType(DataType::Type type);
 
+  ArrayRef<const uint8_t> GetCode() const {
+    return ArrayRef<const uint8_t>(GetAssembler().CodeBufferBaseAddress(),
+                                   GetAssembler().CodeSize());
+  }
+
  protected:
   // Patch info used for recording locations of required linker patches and their targets,
   // i.e. target method, string, type or code identified by their dex file and index,
@@ -761,6 +763,15 @@
   virtual HGraphVisitor* GetLocationBuilder() = 0;
   virtual HGraphVisitor* GetInstructionVisitor() = 0;
 
+  template <typename RegType>
+  static uint32_t ComputeRegisterMask(const RegType* registers, size_t length) {
+    uint32_t mask = 0;
+    for (size_t i = 0, e = length; i < e; ++i) {
+      mask |= (1 << registers[i]);
+    }
+    return mask;
+  }
+
   // Returns the location of the first spilled entry for floating point registers,
   // relative to the stack pointer.
   uint32_t GetFpuSpillStart() const {
@@ -814,6 +825,10 @@
 
   StackMapStream* GetStackMapStream();
 
+  CodeGenerationData* GetCodeGenerationData() {
+    return code_generation_data_.get();
+  }
+
   void ReserveJitStringRoot(StringReference string_reference, Handle<mirror::String> string);
   uint64_t GetJitStringRootIndex(StringReference string_reference);
   void ReserveJitClassRoot(TypeReference type_reference, Handle<mirror::Class> klass);
@@ -848,8 +863,6 @@
   DisassemblyInformation* disasm_info_;
 
  private:
-  class CodeGenerationData;
-
   void InitializeCodeGenerationData();
   size_t GetStackOffsetOfSavedRegister(size_t index);
   void GenerateSlowPaths();
diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc
index 41db9a2..50b8648 100644
--- a/compiler/optimizing/code_generator_arm64.cc
+++ b/compiler/optimizing/code_generator_arm64.cc
@@ -35,7 +35,9 @@
 #include "interpreter/mterp/nterp.h"
 #include "intrinsics.h"
 #include "intrinsics_arm64.h"
+#include "intrinsics_list.h"
 #include "intrinsics_utils.h"
+#include "jit/profiling_info.h"
 #include "linker/linker_patch.h"
 #include "lock_word.h"
 #include "mirror/array-inl.h"
@@ -44,7 +46,9 @@
 #include "offsets.h"
 #include "optimizing/common_arm64.h"
 #include "optimizing/nodes.h"
+#include "profiling_info_builder.h"
 #include "thread.h"
+#include "trace.h"
 #include "utils/arm64/assembler_arm64.h"
 #include "utils/assembler.h"
 #include "utils/stack_checks.h"
@@ -88,6 +92,9 @@
 using helpers::WRegisterFrom;
 using helpers::XRegisterFrom;
 
+// TODO(mythria): Expand SystemRegister in vixl to include this value.
+uint16_t SYS_CNTVCT_EL0 = SystemRegisterEncoder<1, 3, 14, 0, 2>::value;
+
 // The compare/jump sequence will generate about (1.5 * num_entries + 3) instructions. While jump
 // table version generates 7 instructions and num_entries literals. Compare/jump sequence will
 // generates less code/data with a small num_entries.
@@ -582,7 +589,6 @@
         obj_(obj),
         offset_(offset),
         index_(index) {
-    DCHECK(gUseReadBarrier);
     // If `obj` is equal to `out` or `ref`, it means the initial object
     // has been overwritten by (or after) the heap object reference load
     // to be instrumented, e.g.:
@@ -597,13 +603,13 @@
   }
 
   void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitReadBarrier());
     CodeGeneratorARM64* arm64_codegen = down_cast<CodeGeneratorARM64*>(codegen);
     LocationSummary* locations = instruction_->GetLocations();
     DataType::Type type = DataType::Type::kReference;
     DCHECK(locations->CanCall());
     DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(out_.reg()));
     DCHECK(instruction_->IsInstanceFieldGet() ||
-           instruction_->IsPredicatedInstanceFieldGet() ||
            instruction_->IsStaticFieldGet() ||
            instruction_->IsArrayGet() ||
            instruction_->IsInstanceOf() ||
@@ -680,9 +686,9 @@
         DCHECK(instruction_->IsInvoke()) << instruction_->DebugName();
         DCHECK(instruction_->GetLocations()->Intrinsified());
         HInvoke* invoke = instruction_->AsInvoke();
-        DCHECK(IsUnsafeGetObject(invoke) ||
+        DCHECK(IsUnsafeGetReference(invoke) ||
                IsVarHandleGet(invoke) ||
-               IsUnsafeCASObject(invoke) ||
+               IsUnsafeCASReference(invoke) ||
                IsVarHandleCASFamily(invoke)) << invoke->GetIntrinsic();
         DCHECK_EQ(offset_, 0u);
         DCHECK(index_.IsRegister());
@@ -761,10 +767,10 @@
  public:
   ReadBarrierForRootSlowPathARM64(HInstruction* instruction, Location out, Location root)
       : SlowPathCodeARM64(instruction), out_(out), root_(root) {
-    DCHECK(gUseReadBarrier);
   }
 
   void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitReadBarrier());
     LocationSummary* locations = instruction_->GetLocations();
     DataType::Type type = DataType::Type::kReference;
     DCHECK(locations->CanCall());
@@ -842,16 +848,32 @@
 
 class CompileOptimizedSlowPathARM64 : public SlowPathCodeARM64 {
  public:
-  CompileOptimizedSlowPathARM64() : SlowPathCodeARM64(/* instruction= */ nullptr) {}
+  CompileOptimizedSlowPathARM64(HSuspendCheck* check, Register profiling_info)
+      : SlowPathCodeARM64(check),
+        profiling_info_(profiling_info) {}
 
   void EmitNativeCode(CodeGenerator* codegen) override {
     uint32_t entrypoint_offset =
         GetThreadOffset<kArm64PointerSize>(kQuickCompileOptimized).Int32Value();
     __ Bind(GetEntryLabel());
+    CodeGeneratorARM64* arm64_codegen = down_cast<CodeGeneratorARM64*>(codegen);
+    UseScratchRegisterScope temps(arm64_codegen->GetVIXLAssembler());
+    Register counter = temps.AcquireW();
+    __ Mov(counter, ProfilingInfo::GetOptimizeThreshold());
+    __ Strh(counter,
+            MemOperand(profiling_info_, ProfilingInfo::BaselineHotnessCountOffset().Int32Value()));
+    if (instruction_ != nullptr) {
+      // Only saves live vector regs for SIMD.
+      SaveLiveRegisters(codegen, instruction_->GetLocations());
+    }
     __ Ldr(lr, MemOperand(tr, entrypoint_offset));
     // Note: we don't record the call here (and therefore don't generate a stack
     // map), as the entrypoint should never be suspended.
     __ Blr(lr);
+    if (instruction_ != nullptr) {
+      // Only restores live vector regs for SIMD.
+      RestoreLiveRegisters(codegen, instruction_->GetLocations());
+    }
     __ B(GetExitLabel());
   }
 
@@ -860,6 +882,10 @@
   }
 
  private:
+  // The register where the profiling info is stored when entering the slow
+  // path.
+  Register profiling_info_;
+
   DISALLOW_COPY_AND_ASSIGN(CompileOptimizedSlowPathARM64);
 };
 
@@ -936,6 +962,7 @@
 }
 
 namespace detail {
+
 // Mark which intrinsics we don't have handcrafted code for.
 template <Intrinsics T>
 struct IsUnimplemented {
@@ -950,15 +977,13 @@
 UNIMPLEMENTED_INTRINSIC_LIST_ARM64(TRUE_OVERRIDE)
 #undef TRUE_OVERRIDE
 
-#include "intrinsics_list.h"
 static constexpr bool kIsIntrinsicUnimplemented[] = {
-  false,  // kNone
+    false,  // kNone
 #define IS_UNIMPLEMENTED(Intrinsic, ...) \
-  IsUnimplemented<Intrinsics::k##Intrinsic>().is_unimplemented,
-  INTRINSICS_LIST(IS_UNIMPLEMENTED)
+    IsUnimplemented<Intrinsics::k##Intrinsic>().is_unimplemented,
+    ART_INTRINSICS_LIST(IS_UNIMPLEMENTED)
 #undef IS_UNIMPLEMENTED
 };
-#undef INTRINSICS_LIST
 
 }  // namespace detail
 
@@ -995,14 +1020,7 @@
       boot_image_other_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
       call_entrypoint_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
       baker_read_barrier_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
-      uint32_literals_(std::less<uint32_t>(),
-                       graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
-      uint64_literals_(std::less<uint64_t>(),
-                       graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
-      jit_string_patches_(StringReferenceValueComparator(),
-                          graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
-      jit_class_patches_(TypeReferenceValueComparator(),
-                         graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
+      jit_patches_(&assembler_, graph->GetAllocator()),
       jit_baker_read_barrier_slow_paths_(std::less<uint32_t>(),
                                          graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)) {
   // Save the link register (containing the return address) to mimic Quick.
@@ -1036,7 +1054,7 @@
   }
 }
 
-void CodeGeneratorARM64::Finalize(CodeAllocator* allocator) {
+void CodeGeneratorARM64::Finalize() {
   EmitJumpTables();
 
   // Emit JIT baker read barrier slow paths.
@@ -1051,11 +1069,11 @@
   // Ensure we emit the literal pool.
   __ FinalizeCode();
 
-  CodeGenerator::Finalize(allocator);
+  CodeGenerator::Finalize();
 
   // Verify Baker read barrier linker patches.
   if (kIsDebugBuild) {
-    ArrayRef<const uint8_t> code = allocator->GetMemory();
+    ArrayRef<const uint8_t> code(GetCode());
     for (const BakerReadBarrierPatchInfo& info : baker_read_barrier_patches_) {
       DCHECK(info.label.IsBound());
       uint32_t literal_offset = info.label.GetLocation();
@@ -1192,8 +1210,9 @@
 void InstructionCodeGeneratorARM64::GenerateMethodEntryExitHook(HInstruction* instruction) {
   MacroAssembler* masm = GetVIXLAssembler();
   UseScratchRegisterScope temps(masm);
-  Register temp = temps.AcquireX();
-  Register value = temps.AcquireW();
+  Register addr = temps.AcquireX();
+  Register index = temps.AcquireX();
+  Register value = index.W();
 
   SlowPathCodeARM64* slow_path =
       new (codegen_->GetScopedAllocator()) MethodEntryExitHooksSlowPathARM64(instruction);
@@ -1213,9 +1232,44 @@
   MemberOffset  offset = instruction->IsMethodExitHook() ?
       instrumentation::Instrumentation::HaveMethodExitListenersOffset() :
       instrumentation::Instrumentation::HaveMethodEntryListenersOffset();
-  __ Mov(temp, address + offset.Int32Value());
-  __ Ldrb(value, MemOperand(temp, 0));
-  __ Cbnz(value, slow_path->GetEntryLabel());
+  __ Mov(addr, address + offset.Int32Value());
+  __ Ldrb(value, MemOperand(addr, 0));
+  __ Cmp(value, Operand(instrumentation::Instrumentation::kFastTraceListeners));
+  // Check if there are any method entry / exit listeners. If no, continue.
+  __ B(lt, slow_path->GetExitLabel());
+  // Check if there are any slow (jvmti / trace with thread cpu time) method entry / exit listeners.
+  // If yes, just take the slow path.
+  __ B(gt, slow_path->GetEntryLabel());
+
+  // Check if there is place in the buffer to store a new entry, if no, take slow path.
+  uint32_t trace_buffer_index_offset =
+      Thread::TraceBufferIndexOffset<kArm64PointerSize>().Int32Value();
+  __ Ldr(index, MemOperand(tr, trace_buffer_index_offset));
+  __ Subs(index, index, kNumEntriesForWallClock);
+  __ B(lt, slow_path->GetEntryLabel());
+
+  // Update the index in the `Thread`.
+  __ Str(index, MemOperand(tr, trace_buffer_index_offset));
+  // Calculate the entry address in the buffer.
+  // addr = base_addr + sizeof(void*) * index;
+  __ Ldr(addr, MemOperand(tr, Thread::TraceBufferPtrOffset<kArm64PointerSize>().SizeValue()));
+  __ ComputeAddress(addr, MemOperand(addr, index, LSL, TIMES_8));
+
+  Register tmp = index;
+  // Record method pointer and trace action.
+  __ Ldr(tmp, MemOperand(sp, 0));
+  // Use last two bits to encode trace method action. For MethodEntry it is 0
+  // so no need to set the bits since they are 0 already.
+  if (instruction->IsMethodExitHook()) {
+    DCHECK_GE(ArtMethod::Alignment(kRuntimePointerSize), static_cast<size_t>(4));
+    static_assert(enum_cast<int32_t>(TraceAction::kTraceMethodEnter) == 0);
+    static_assert(enum_cast<int32_t>(TraceAction::kTraceMethodExit) == 1);
+    __ Orr(tmp, tmp, Operand(enum_cast<int32_t>(TraceAction::kTraceMethodExit)));
+  }
+  __ Str(tmp, MemOperand(addr, kMethodOffsetInBytes));
+  // Record the timestamp.
+  __ Mrs(tmp, (SystemRegister)SYS_CNTVCT_EL0);
+  __ Str(tmp, MemOperand(addr, kTimestampOffsetInBytes));
   __ Bind(slow_path->GetExitLabel());
 }
 
@@ -1235,7 +1289,7 @@
   GenerateMethodEntryExitHook(instruction);
 }
 
-void CodeGeneratorARM64::MaybeIncrementHotness(bool is_frame_entry) {
+void CodeGeneratorARM64::MaybeIncrementHotness(HSuspendCheck* suspend_check, bool is_frame_entry) {
   MacroAssembler* masm = GetVIXLAssembler();
   if (GetCompilerOptions().CountHotnessInCompiledCode()) {
     UseScratchRegisterScope temps(masm);
@@ -1253,22 +1307,23 @@
     __ Bind(&done);
   }
 
-  if (GetGraph()->IsCompilingBaseline() && !Runtime::Current()->IsAotCompiler()) {
-    SlowPathCodeARM64* slow_path = new (GetScopedAllocator()) CompileOptimizedSlowPathARM64();
-    AddSlowPath(slow_path);
+  if (GetGraph()->IsCompilingBaseline() &&
+      GetGraph()->IsUsefulOptimizing() &&
+      !Runtime::Current()->IsAotCompiler()) {
     ProfilingInfo* info = GetGraph()->GetProfilingInfo();
     DCHECK(info != nullptr);
     DCHECK(!HasEmptyFrame());
     uint64_t address = reinterpret_cast64<uint64_t>(info);
-    vixl::aarch64::Label done;
     UseScratchRegisterScope temps(masm);
-    Register temp = temps.AcquireX();
     Register counter = temps.AcquireW();
-    __ Ldr(temp, DeduplicateUint64Literal(address));
-    __ Ldrh(counter, MemOperand(temp, ProfilingInfo::BaselineHotnessCountOffset().Int32Value()));
+    SlowPathCodeARM64* slow_path = new (GetScopedAllocator()) CompileOptimizedSlowPathARM64(
+        suspend_check, /* profiling_info= */ lr);
+    AddSlowPath(slow_path);
+    __ Ldr(lr, jit_patches_.DeduplicateUint64Literal(address));
+    __ Ldrh(counter, MemOperand(lr, ProfilingInfo::BaselineHotnessCountOffset().Int32Value()));
     __ Cbz(counter, slow_path->GetEntryLabel());
     __ Add(counter, counter, -1);
-    __ Strh(counter, MemOperand(temp, ProfilingInfo::BaselineHotnessCountOffset().Int32Value()));
+    __ Strh(counter, MemOperand(lr, ProfilingInfo::BaselineHotnessCountOffset().Int32Value()));
     __ Bind(slow_path->GetExitLabel());
   }
 }
@@ -1343,6 +1398,9 @@
   }
 
   if (!HasEmptyFrame()) {
+    // Make sure the frame size isn't unreasonably large.
+    DCHECK_LE(GetFrameSize(), GetMaximumFrameSize());
+
     // Stack layout:
     //      sp[frame_size - 8]        : lr.
     //      ...                       : other preserved core registers.
@@ -1386,7 +1444,7 @@
       __ Str(wzr, MemOperand(sp, GetStackOffsetOfShouldDeoptimizeFlag()));
     }
   }
-  MaybeIncrementHotness(/* is_frame_entry= */ true);
+  MaybeIncrementHotness(/* suspend_check= */ nullptr, /* is_frame_entry= */ true);
   MaybeGenerateMarkingRegisterCheck(/* code= */ __LINE__);
 }
 
@@ -1454,18 +1512,24 @@
   }
 }
 
-void CodeGeneratorARM64::MarkGCCard(Register object, Register value, bool emit_null_check) {
-  UseScratchRegisterScope temps(GetVIXLAssembler());
-  Register card = temps.AcquireX();
-  Register temp = temps.AcquireW();   // Index within the CardTable - 32bit.
+void CodeGeneratorARM64::MaybeMarkGCCard(Register object, Register value, bool emit_null_check) {
   vixl::aarch64::Label done;
   if (emit_null_check) {
     __ Cbz(value, &done);
   }
+  MarkGCCard(object);
+  if (emit_null_check) {
+    __ Bind(&done);
+  }
+}
+
+void CodeGeneratorARM64::MarkGCCard(Register object) {
+  UseScratchRegisterScope temps(GetVIXLAssembler());
+  Register card = temps.AcquireX();
+  Register temp = temps.AcquireW();  // Index within the CardTable - 32bit.
   // Load the address of the card table into `card`.
   __ Ldr(card, MemOperand(tr, Thread::CardTableOffset<kArm64PointerSize>().Int32Value()));
-  // Calculate the offset (in the card table) of the card corresponding to
-  // `object`.
+  // Calculate the offset (in the card table) of the card corresponding to `object`.
   __ Lsr(temp, object, gc::accounting::CardTable::kCardShift);
   // Write the `art::gc::accounting::CardTable::kCardDirty` value into the
   // `object`'s card.
@@ -1481,9 +1545,24 @@
   // of the card to mark; and 2. to load the `kCardDirty` value) saves a load
   // (no need to explicitly load `kCardDirty` as an immediate value).
   __ Strb(card, MemOperand(card, temp.X()));
-  if (emit_null_check) {
-    __ Bind(&done);
-  }
+}
+
+void CodeGeneratorARM64::CheckGCCardIsValid(Register object) {
+  UseScratchRegisterScope temps(GetVIXLAssembler());
+  Register card = temps.AcquireX();
+  Register temp = temps.AcquireW();  // Index within the CardTable - 32bit.
+  vixl::aarch64::Label done;
+  // Load the address of the card table into `card`.
+  __ Ldr(card, MemOperand(tr, Thread::CardTableOffset<kArm64PointerSize>().Int32Value()));
+  // Calculate the offset (in the card table) of the card corresponding to `object`.
+  __ Lsr(temp, object, gc::accounting::CardTable::kCardShift);
+  // assert (!clean || !self->is_gc_marking)
+  __ Ldrb(temp, MemOperand(card, temp.X()));
+  static_assert(gc::accounting::CardTable::kCardClean == 0);
+  __ Cbnz(temp, &done);
+  __ Cbz(mr, &done);
+  __ Unreachable();
+  __ Bind(&done);
 }
 
 void CodeGeneratorARM64::SetupBlockedRegisters() const {
@@ -1532,15 +1611,15 @@
   return kArm64WordSize;
 }
 
-size_t CodeGeneratorARM64::SaveFloatingPointRegister(size_t stack_index ATTRIBUTE_UNUSED,
-                                                     uint32_t reg_id ATTRIBUTE_UNUSED) {
+size_t CodeGeneratorARM64::SaveFloatingPointRegister([[maybe_unused]] size_t stack_index,
+                                                     [[maybe_unused]] uint32_t reg_id) {
   LOG(FATAL) << "FP registers shouldn't be saved/restored individually, "
              << "use SaveRestoreLiveRegistersHelper";
   UNREACHABLE();
 }
 
-size_t CodeGeneratorARM64::RestoreFloatingPointRegister(size_t stack_index ATTRIBUTE_UNUSED,
-                                                        uint32_t reg_id ATTRIBUTE_UNUSED) {
+size_t CodeGeneratorARM64::RestoreFloatingPointRegister([[maybe_unused]] size_t stack_index,
+                                                        [[maybe_unused]] uint32_t reg_id) {
   LOG(FATAL) << "FP registers shouldn't be saved/restored individually, "
              << "use SaveRestoreLiveRegistersHelper";
   UNREACHABLE();
@@ -2136,14 +2215,10 @@
 
 void LocationsBuilderARM64::HandleFieldGet(HInstruction* instruction,
                                            const FieldInfo& field_info) {
-  DCHECK(instruction->IsInstanceFieldGet() ||
-         instruction->IsStaticFieldGet() ||
-         instruction->IsPredicatedInstanceFieldGet());
-
-  bool is_predicated = instruction->IsPredicatedInstanceFieldGet();
+  DCHECK(instruction->IsInstanceFieldGet() || instruction->IsStaticFieldGet());
 
   bool object_field_get_with_read_barrier =
-      gUseReadBarrier && (instruction->GetType() == DataType::Type::kReference);
+      (instruction->GetType() == DataType::Type::kReference) && codegen_->EmitReadBarrier();
   LocationSummary* locations =
       new (GetGraph()->GetAllocator()) LocationSummary(instruction,
                                                        object_field_get_with_read_barrier
@@ -2160,37 +2235,24 @@
     }
   }
   // Input for object receiver.
-  locations->SetInAt(is_predicated ? 1 : 0, Location::RequiresRegister());
+  locations->SetInAt(0, Location::RequiresRegister());
   if (DataType::IsFloatingPointType(instruction->GetType())) {
-    if (is_predicated) {
-      locations->SetInAt(0, Location::RequiresFpuRegister());
-      locations->SetOut(Location::SameAsFirstInput());
-    } else {
-      locations->SetOut(Location::RequiresFpuRegister());
-    }
+    locations->SetOut(Location::RequiresFpuRegister());
   } else {
-    if (is_predicated) {
-      locations->SetInAt(0, Location::RequiresRegister());
-      locations->SetOut(Location::SameAsFirstInput());
-    } else {
-      // The output overlaps for an object field get when read barriers
-      // are enabled: we do not want the load to overwrite the object's
-      // location, as we need it to emit the read barrier.
-      locations->SetOut(Location::RequiresRegister(),
-                        object_field_get_with_read_barrier ? Location::kOutputOverlap
-                                                           : Location::kNoOutputOverlap);
-    }
+    // The output overlaps for an object field get when read barriers
+    // are enabled: we do not want the load to overwrite the object's
+    // location, as we need it to emit the read barrier.
+    locations->SetOut(
+        Location::RequiresRegister(),
+        object_field_get_with_read_barrier ? Location::kOutputOverlap : Location::kNoOutputOverlap);
   }
 }
 
 void InstructionCodeGeneratorARM64::HandleFieldGet(HInstruction* instruction,
                                                    const FieldInfo& field_info) {
-  DCHECK(instruction->IsInstanceFieldGet() ||
-         instruction->IsStaticFieldGet() ||
-         instruction->IsPredicatedInstanceFieldGet());
-  bool is_predicated = instruction->IsPredicatedInstanceFieldGet();
+  DCHECK(instruction->IsInstanceFieldGet() || instruction->IsStaticFieldGet());
   LocationSummary* locations = instruction->GetLocations();
-  uint32_t receiver_input = is_predicated ? 1 : 0;
+  uint32_t receiver_input = 0;
   Location base_loc = locations->InAt(receiver_input);
   Location out = locations->Out();
   uint32_t offset = field_info.GetFieldOffset().Uint32Value();
@@ -2199,8 +2261,7 @@
   MemOperand field =
       HeapOperand(InputRegisterAt(instruction, receiver_input), field_info.GetFieldOffset());
 
-  if (gUseReadBarrier && kUseBakerReadBarrier &&
-      load_type == DataType::Type::kReference) {
+  if (load_type == DataType::Type::kReference && codegen_->EmitBakerReadBarrier()) {
     // Object FieldGet with Baker's read barrier case.
     // /* HeapReference<Object> */ out = *(base + offset)
     Register base = RegisterFrom(base_loc, DataType::Type::kReference);
@@ -2261,20 +2322,12 @@
                                                    bool value_can_be_null,
                                                    WriteBarrierKind write_barrier_kind) {
   DCHECK(instruction->IsInstanceFieldSet() || instruction->IsStaticFieldSet());
-  bool is_predicated =
-      instruction->IsInstanceFieldSet() && instruction->AsInstanceFieldSet()->GetIsPredicatedSet();
 
   Register obj = InputRegisterAt(instruction, 0);
   CPURegister value = InputCPURegisterOrZeroRegAt(instruction, 1);
   CPURegister source = value;
   Offset offset = field_info.GetFieldOffset();
   DataType::Type field_type = field_info.GetFieldType();
-  std::optional<vixl::aarch64::Label> pred_is_null;
-  if (is_predicated) {
-    pred_is_null.emplace();
-    __ Cbz(obj, &*pred_is_null);
-  }
-
   {
     // We use a block to end the scratch scope before the write barrier, thus
     // freeing the temporary registers so they can be used in `MarkGCCard`.
@@ -2299,16 +2352,18 @@
     }
   }
 
-  if (CodeGenerator::StoreNeedsWriteBarrier(field_type, instruction->InputAt(1)) &&
-      write_barrier_kind != WriteBarrierKind::kDontEmit) {
-    codegen_->MarkGCCard(
+  const bool needs_write_barrier =
+      codegen_->StoreNeedsWriteBarrier(field_type, instruction->InputAt(1), write_barrier_kind);
+
+  if (needs_write_barrier) {
+    DCHECK_IMPLIES(Register(value).IsZero(),
+                   write_barrier_kind == WriteBarrierKind::kEmitBeingReliedOn);
+    codegen_->MaybeMarkGCCard(
         obj,
         Register(value),
-        value_can_be_null && write_barrier_kind == WriteBarrierKind::kEmitWithNullCheck);
-  }
-
-  if (is_predicated) {
-    __ Bind(&*pred_is_null);
+        value_can_be_null && write_barrier_kind == WriteBarrierKind::kEmitNotBeingReliedOn);
+  } else if (codegen_->ShouldCheckGCCard(field_type, instruction->InputAt(1), write_barrier_kind)) {
+    codegen_->CheckGCCardIsValid(obj);
   }
 }
 
@@ -2647,7 +2702,7 @@
 
 void LocationsBuilderARM64::VisitArrayGet(HArrayGet* instruction) {
   bool object_array_get_with_read_barrier =
-      gUseReadBarrier && (instruction->GetType() == DataType::Type::kReference);
+      (instruction->GetType() == DataType::Type::kReference) && codegen_->EmitReadBarrier();
   LocationSummary* locations =
       new (GetGraph()->GetAllocator()) LocationSummary(instruction,
                                                        object_array_get_with_read_barrier
@@ -2703,10 +2758,9 @@
   // does not support the HIntermediateAddress instruction.
   DCHECK(!((type == DataType::Type::kReference) &&
            instruction->GetArray()->IsIntermediateAddress() &&
-           gUseReadBarrier &&
-           !kUseBakerReadBarrier));
+           codegen_->EmitNonBakerReadBarrier()));
 
-  if (type == DataType::Type::kReference && gUseReadBarrier && kUseBakerReadBarrier) {
+  if (type == DataType::Type::kReference && codegen_->EmitBakerReadBarrier()) {
     // Object ArrayGet with Baker's read barrier case.
     // Note that a potential implicit null check is handled in the
     // CodeGeneratorARM64::GenerateArrayLoadWithBakerReadBarrier call.
@@ -2863,8 +2917,9 @@
   DataType::Type value_type = instruction->GetComponentType();
   LocationSummary* locations = instruction->GetLocations();
   bool needs_type_check = instruction->NeedsTypeCheck();
+  const WriteBarrierKind write_barrier_kind = instruction->GetWriteBarrierKind();
   bool needs_write_barrier =
-      CodeGenerator::StoreNeedsWriteBarrier(value_type, instruction->GetValue());
+      codegen_->StoreNeedsWriteBarrier(value_type, instruction->GetValue(), write_barrier_kind);
 
   Register array = InputRegisterAt(instruction, 0);
   CPURegister value = InputCPURegisterOrZeroRegAt(instruction, 2);
@@ -2875,13 +2930,17 @@
   MacroAssembler* masm = GetVIXLAssembler();
 
   if (!needs_write_barrier) {
+    if (codegen_->ShouldCheckGCCard(value_type, instruction->GetValue(), write_barrier_kind)) {
+      codegen_->CheckGCCardIsValid(array);
+    }
+
     DCHECK(!needs_type_check);
+    UseScratchRegisterScope temps(masm);
     if (index.IsConstant()) {
       offset += Int64FromLocation(index) << DataType::SizeShift(value_type);
       destination = HeapOperand(array, offset);
     } else {
-      UseScratchRegisterScope temps(masm);
-      Register temp = temps.AcquireSameSizeAs(array);
+      Register temp_dest = temps.AcquireSameSizeAs(array);
       if (instruction->GetArray()->IsIntermediateAddress()) {
         // We do not need to compute the intermediate address from the array: the
         // input instruction has done it already. See the comment in
@@ -2890,101 +2949,115 @@
           HIntermediateAddress* interm_addr = instruction->GetArray()->AsIntermediateAddress();
           DCHECK(interm_addr->GetOffset()->AsIntConstant()->GetValueAsUint64() == offset);
         }
-        temp = array;
+        temp_dest = array;
       } else {
-        __ Add(temp, array, offset);
+        __ Add(temp_dest, array, offset);
       }
-      destination = HeapOperand(temp,
+      destination = HeapOperand(temp_dest,
                                 XRegisterFrom(index),
                                 LSL,
                                 DataType::SizeShift(value_type));
     }
+
+    if (kPoisonHeapReferences && value_type == DataType::Type::kReference) {
+      DCHECK(value.IsW());
+      Register temp_src = temps.AcquireW();
+      __ Mov(temp_src, value.W());
+      GetAssembler()->PoisonHeapReference(temp_src.W());
+      source = temp_src;
+    }
+
     {
       // Ensure that between store and MaybeRecordImplicitNullCheck there are no pools emitted.
       EmissionCheckScope guard(GetVIXLAssembler(), kMaxMacroInstructionSizeInBytes);
-      codegen_->Store(value_type, value, destination);
+      codegen_->Store(value_type, source, destination);
       codegen_->MaybeRecordImplicitNullCheck(instruction);
     }
   } else {
     DCHECK(!instruction->GetArray()->IsIntermediateAddress());
-
-    bool can_value_be_null = instruction->GetValueCanBeNull();
-    vixl::aarch64::Label do_store;
-    if (can_value_be_null) {
-      __ Cbz(Register(value), &do_store);
-    }
-
+    bool can_value_be_null = true;
     SlowPathCodeARM64* slow_path = nullptr;
-    if (needs_type_check) {
-      slow_path = new (codegen_->GetScopedAllocator()) ArraySetSlowPathARM64(instruction);
-      codegen_->AddSlowPath(slow_path);
-
-      const uint32_t class_offset = mirror::Object::ClassOffset().Int32Value();
-      const uint32_t super_offset = mirror::Class::SuperClassOffset().Int32Value();
-      const uint32_t component_offset = mirror::Class::ComponentTypeOffset().Int32Value();
-
-      UseScratchRegisterScope temps(masm);
-      Register temp = temps.AcquireSameSizeAs(array);
-      Register temp2 = temps.AcquireSameSizeAs(array);
-
-      // Note that when Baker read barriers are enabled, the type
-      // checks are performed without read barriers.  This is fine,
-      // even in the case where a class object is in the from-space
-      // after the flip, as a comparison involving such a type would
-      // not produce a false positive; it may of course produce a
-      // false negative, in which case we would take the ArraySet
-      // slow path.
-
-      // /* HeapReference<Class> */ temp = array->klass_
-      {
-        // Ensure that between load and MaybeRecordImplicitNullCheck there are no pools emitted.
-        EmissionCheckScope guard(GetVIXLAssembler(), kMaxMacroInstructionSizeInBytes);
-        __ Ldr(temp, HeapOperand(array, class_offset));
-        codegen_->MaybeRecordImplicitNullCheck(instruction);
+    if (!Register(value).IsZero()) {
+      can_value_be_null = instruction->GetValueCanBeNull();
+      vixl::aarch64::Label do_store;
+      if (can_value_be_null) {
+        __ Cbz(Register(value), &do_store);
       }
-      GetAssembler()->MaybeUnpoisonHeapReference(temp);
 
-      // /* HeapReference<Class> */ temp = temp->component_type_
-      __ Ldr(temp, HeapOperand(temp, component_offset));
-      // /* HeapReference<Class> */ temp2 = value->klass_
-      __ Ldr(temp2, HeapOperand(Register(value), class_offset));
-      // If heap poisoning is enabled, no need to unpoison `temp`
-      // nor `temp2`, as we are comparing two poisoned references.
-      __ Cmp(temp, temp2);
+      if (needs_type_check) {
+        slow_path = new (codegen_->GetScopedAllocator()) ArraySetSlowPathARM64(instruction);
+        codegen_->AddSlowPath(slow_path);
 
-      if (instruction->StaticTypeOfArrayIsObjectArray()) {
-        vixl::aarch64::Label do_put;
-        __ B(eq, &do_put);
-        // If heap poisoning is enabled, the `temp` reference has
-        // not been unpoisoned yet; unpoison it now.
+        const uint32_t class_offset = mirror::Object::ClassOffset().Int32Value();
+        const uint32_t super_offset = mirror::Class::SuperClassOffset().Int32Value();
+        const uint32_t component_offset = mirror::Class::ComponentTypeOffset().Int32Value();
+
+        UseScratchRegisterScope temps(masm);
+        Register temp = temps.AcquireSameSizeAs(array);
+        Register temp2 = temps.AcquireSameSizeAs(array);
+
+        // Note that when Baker read barriers are enabled, the type
+        // checks are performed without read barriers.  This is fine,
+        // even in the case where a class object is in the from-space
+        // after the flip, as a comparison involving such a type would
+        // not produce a false positive; it may of course produce a
+        // false negative, in which case we would take the ArraySet
+        // slow path.
+
+        // /* HeapReference<Class> */ temp = array->klass_
+        {
+          // Ensure that between load and MaybeRecordImplicitNullCheck there are no pools emitted.
+          EmissionCheckScope guard(GetVIXLAssembler(), kMaxMacroInstructionSizeInBytes);
+          __ Ldr(temp, HeapOperand(array, class_offset));
+          codegen_->MaybeRecordImplicitNullCheck(instruction);
+        }
         GetAssembler()->MaybeUnpoisonHeapReference(temp);
 
-        // /* HeapReference<Class> */ temp = temp->super_class_
-        __ Ldr(temp, HeapOperand(temp, super_offset));
-        // If heap poisoning is enabled, no need to unpoison
-        // `temp`, as we are comparing against null below.
-        __ Cbnz(temp, slow_path->GetEntryLabel());
-        __ Bind(&do_put);
-      } else {
-        __ B(ne, slow_path->GetEntryLabel());
+        // /* HeapReference<Class> */ temp = temp->component_type_
+        __ Ldr(temp, HeapOperand(temp, component_offset));
+        // /* HeapReference<Class> */ temp2 = value->klass_
+        __ Ldr(temp2, HeapOperand(Register(value), class_offset));
+        // If heap poisoning is enabled, no need to unpoison `temp`
+        // nor `temp2`, as we are comparing two poisoned references.
+        __ Cmp(temp, temp2);
+
+        if (instruction->StaticTypeOfArrayIsObjectArray()) {
+          vixl::aarch64::Label do_put;
+          __ B(eq, &do_put);
+          // If heap poisoning is enabled, the `temp` reference has
+          // not been unpoisoned yet; unpoison it now.
+          GetAssembler()->MaybeUnpoisonHeapReference(temp);
+
+          // /* HeapReference<Class> */ temp = temp->super_class_
+          __ Ldr(temp, HeapOperand(temp, super_offset));
+          // If heap poisoning is enabled, no need to unpoison
+          // `temp`, as we are comparing against null below.
+          __ Cbnz(temp, slow_path->GetEntryLabel());
+          __ Bind(&do_put);
+        } else {
+          __ B(ne, slow_path->GetEntryLabel());
+        }
+      }
+
+      if (can_value_be_null) {
+        DCHECK(do_store.IsLinked());
+        __ Bind(&do_store);
       }
     }
 
-    if (instruction->GetWriteBarrierKind() != WriteBarrierKind::kDontEmit) {
-      DCHECK_EQ(instruction->GetWriteBarrierKind(), WriteBarrierKind::kEmitNoNullCheck)
-          << " Already null checked so we shouldn't do it again.";
-      codegen_->MarkGCCard(array, value.W(), /* emit_null_check= */ false);
-    }
-
-    if (can_value_be_null) {
-      DCHECK(do_store.IsLinked());
-      __ Bind(&do_store);
-    }
+    DCHECK_NE(write_barrier_kind, WriteBarrierKind::kDontEmit);
+    // TODO(solanes): The WriteBarrierKind::kEmitNotBeingReliedOn case should be able to skip this
+    // write barrier when its value is null (without an extra cbz since we already checked if the
+    // value is null for the type check). This will be done as a follow-up since it is a runtime
+    // optimization that needs extra care.
+    DCHECK_IMPLIES(Register(value).IsZero(),
+                   write_barrier_kind == WriteBarrierKind::kEmitBeingReliedOn);
+    codegen_->MarkGCCard(array);
 
     UseScratchRegisterScope temps(masm);
     if (kPoisonHeapReferences) {
-      Register temp_source = temps.AcquireSameSizeAs(array);
-        DCHECK(value.IsW());
+      DCHECK(value.IsW());
+      Register temp_source = temps.AcquireW();
       __ Mov(temp_source, value.W());
       GetAssembler()->PoisonHeapReference(temp_source);
       source = temp_source;
@@ -3647,7 +3720,7 @@
 }
 
 void InstructionCodeGeneratorARM64::VisitDoubleConstant(
-    HDoubleConstant* constant ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HDoubleConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -3655,8 +3728,7 @@
   exit->SetLocations(nullptr);
 }
 
-void InstructionCodeGeneratorARM64::VisitExit(HExit* exit ATTRIBUTE_UNUSED) {
-}
+void InstructionCodeGeneratorARM64::VisitExit([[maybe_unused]] HExit* exit) {}
 
 void LocationsBuilderARM64::VisitFloatConstant(HFloatConstant* constant) {
   LocationSummary* locations =
@@ -3664,7 +3736,7 @@
   locations->SetOut(Location::ConstantLocation(constant));
 }
 
-void InstructionCodeGeneratorARM64::VisitFloatConstant(HFloatConstant* constant ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorARM64::VisitFloatConstant([[maybe_unused]] HFloatConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -3679,7 +3751,7 @@
   HLoopInformation* info = block->GetLoopInformation();
 
   if (info != nullptr && info->IsBackEdge(*block) && info->HasSuspendCheck()) {
-    codegen_->MaybeIncrementHotness(/* is_frame_entry= */ false);
+    codegen_->MaybeIncrementHotness(info->GetSuspendCheck(), /* is_frame_entry= */ false);
     GenerateSuspendCheck(info->GetSuspendCheck(), successor);
     return;  // `GenerateSuspendCheck()` emitted the jump.
   }
@@ -3747,7 +3819,7 @@
     // The condition instruction has been materialized, compare the output to 0.
     Location cond_val = instruction->GetLocations()->InAt(condition_input_index);
     DCHECK(cond_val.IsRegister());
-      if (true_target == nullptr) {
+    if (true_target == nullptr) {
       __ Cbz(InputRegisterAt(instruction, condition_input_index), false_target);
     } else {
       __ Cbnz(InputRegisterAt(instruction, condition_input_index), true_target);
@@ -3835,6 +3907,35 @@
   if (codegen_->GoesToNextBlock(if_instr->GetBlock(), false_successor)) {
     false_target = nullptr;
   }
+  if (IsBooleanValueOrMaterializedCondition(if_instr->InputAt(0))) {
+    if (GetGraph()->IsCompilingBaseline() &&
+        codegen_->GetCompilerOptions().ProfileBranches() &&
+        !Runtime::Current()->IsAotCompiler()) {
+      DCHECK(if_instr->InputAt(0)->IsCondition());
+      ProfilingInfo* info = GetGraph()->GetProfilingInfo();
+      DCHECK(info != nullptr);
+      BranchCache* cache = info->GetBranchCache(if_instr->GetDexPc());
+      // Currently, not all If branches are profiled.
+      if (cache != nullptr) {
+        uint64_t address =
+            reinterpret_cast64<uint64_t>(cache) + BranchCache::FalseOffset().Int32Value();
+        static_assert(
+            BranchCache::TrueOffset().Int32Value() - BranchCache::FalseOffset().Int32Value() == 2,
+            "Unexpected offsets for BranchCache");
+        vixl::aarch64::Label done;
+        UseScratchRegisterScope temps(GetVIXLAssembler());
+        Register temp = temps.AcquireX();
+        Register counter = temps.AcquireW();
+        Register condition = InputRegisterAt(if_instr, 0).X();
+        __ Mov(temp, address);
+        __ Ldrh(counter, MemOperand(temp, condition, LSL, 1));
+        __ Add(counter, counter, 1);
+        __ Tbnz(counter, 16, &done);
+        __ Strh(counter, MemOperand(temp, condition, LSL, 1));
+        __ Bind(&done);
+      }
+    }
+  }
   GenerateTestAndBranch(if_instr, /* condition_input_index= */ 0, true_target, false_target);
 }
 
@@ -3876,7 +3977,7 @@
 }
 
 static inline Condition GetConditionForSelect(HCondition* condition) {
-  IfCondition cond = condition->AsCondition()->GetCondition();
+  IfCondition cond = condition->GetCondition();
   return IsConditionOnFloatingPointValues(condition) ? ARM64FPCondition(cond, condition->IsGtBias())
                                                      : ARM64Condition(cond);
 }
@@ -3888,8 +3989,8 @@
     locations->SetInAt(1, Location::RequiresFpuRegister());
     locations->SetOut(Location::RequiresFpuRegister(), Location::kNoOutputOverlap);
   } else {
-    HConstant* cst_true_value = select->GetTrueValue()->AsConstant();
-    HConstant* cst_false_value = select->GetFalseValue()->AsConstant();
+    HConstant* cst_true_value = select->GetTrueValue()->AsConstantOrNull();
+    HConstant* cst_false_value = select->GetFalseValue()->AsConstantOrNull();
     bool is_true_value_constant = cst_true_value != nullptr;
     bool is_false_value_constant = cst_false_value != nullptr;
     // Ask VIXL whether we should synthesize constants in registers.
@@ -3972,23 +4073,10 @@
   __ Nop();
 }
 
-void LocationsBuilderARM64::VisitPredicatedInstanceFieldGet(
-    HPredicatedInstanceFieldGet* instruction) {
-  HandleFieldGet(instruction, instruction->GetFieldInfo());
-}
-
 void LocationsBuilderARM64::VisitInstanceFieldGet(HInstanceFieldGet* instruction) {
   HandleFieldGet(instruction, instruction->GetFieldInfo());
 }
 
-void InstructionCodeGeneratorARM64::VisitPredicatedInstanceFieldGet(
-    HPredicatedInstanceFieldGet* instruction) {
-  vixl::aarch64::Label finish;
-  __ Cbz(InputRegisterAt(instruction, 1), &finish);
-  HandleFieldGet(instruction, instruction->GetFieldInfo());
-  __ Bind(&finish);
-}
-
 void InstructionCodeGeneratorARM64::VisitInstanceFieldGet(HInstanceFieldGet* instruction) {
   HandleFieldGet(instruction, instruction->GetFieldInfo());
 }
@@ -4005,8 +4093,8 @@
 }
 
 // Temp is used for read barrier.
-static size_t NumberOfInstanceOfTemps(TypeCheckKind type_check_kind) {
-  if (gUseReadBarrier &&
+static size_t NumberOfInstanceOfTemps(bool emit_read_barrier, TypeCheckKind type_check_kind) {
+  if (emit_read_barrier &&
       (kUseBakerReadBarrier ||
           type_check_kind == TypeCheckKind::kAbstractClassCheck ||
           type_check_kind == TypeCheckKind::kClassHierarchyCheck ||
@@ -4019,11 +4107,11 @@
 // Interface case has 3 temps, one for holding the number of interfaces, one for the current
 // interface pointer, one for loading the current interface.
 // The other checks have one temp for loading the object's class.
-static size_t NumberOfCheckCastTemps(TypeCheckKind type_check_kind) {
+static size_t NumberOfCheckCastTemps(bool emit_read_barrier, TypeCheckKind type_check_kind) {
   if (type_check_kind == TypeCheckKind::kInterfaceCheck) {
     return 3;
   }
-  return 1 + NumberOfInstanceOfTemps(type_check_kind);
+  return 1 + NumberOfInstanceOfTemps(emit_read_barrier, type_check_kind);
 }
 
 void LocationsBuilderARM64::VisitInstanceOf(HInstanceOf* instruction) {
@@ -4035,7 +4123,7 @@
     case TypeCheckKind::kAbstractClassCheck:
     case TypeCheckKind::kClassHierarchyCheck:
     case TypeCheckKind::kArrayObjectCheck: {
-      bool needs_read_barrier = CodeGenerator::InstanceOfNeedsReadBarrier(instruction);
+      bool needs_read_barrier = codegen_->InstanceOfNeedsReadBarrier(instruction);
       call_kind = needs_read_barrier ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall;
       baker_read_barrier_slow_path = kUseBakerReadBarrier && needs_read_barrier;
       break;
@@ -4066,7 +4154,8 @@
   // Note that TypeCheckSlowPathARM64 uses this register too.
   locations->SetOut(Location::RequiresRegister(), Location::kOutputOverlap);
   // Add temps if necessary for read barriers.
-  locations->AddRegisterTemps(NumberOfInstanceOfTemps(type_check_kind));
+  locations->AddRegisterTemps(
+      NumberOfInstanceOfTemps(codegen_->EmitReadBarrier(), type_check_kind));
 }
 
 void InstructionCodeGeneratorARM64::VisitInstanceOf(HInstanceOf* instruction) {
@@ -4079,7 +4168,7 @@
       : InputRegisterAt(instruction, 1);
   Location out_loc = locations->Out();
   Register out = OutputRegister(instruction);
-  const size_t num_temps = NumberOfInstanceOfTemps(type_check_kind);
+  const size_t num_temps = NumberOfInstanceOfTemps(codegen_->EmitReadBarrier(), type_check_kind);
   DCHECK_LE(num_temps, 1u);
   Location maybe_temp_loc = (num_temps >= 1) ? locations->GetTemp(0) : Location::NoLocation();
   uint32_t class_offset = mirror::Object::ClassOffset().Int32Value();
@@ -4099,7 +4188,7 @@
   switch (type_check_kind) {
     case TypeCheckKind::kExactCheck: {
       ReadBarrierOption read_barrier_option =
-          CodeGenerator::ReadBarrierOptionForInstanceOf(instruction);
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
       // /* HeapReference<Class> */ out = obj->klass_
       GenerateReferenceLoadTwoRegisters(instruction,
                                         out_loc,
@@ -4117,7 +4206,7 @@
 
     case TypeCheckKind::kAbstractClassCheck: {
       ReadBarrierOption read_barrier_option =
-          CodeGenerator::ReadBarrierOptionForInstanceOf(instruction);
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
       // /* HeapReference<Class> */ out = obj->klass_
       GenerateReferenceLoadTwoRegisters(instruction,
                                         out_loc,
@@ -4148,7 +4237,7 @@
 
     case TypeCheckKind::kClassHierarchyCheck: {
       ReadBarrierOption read_barrier_option =
-          CodeGenerator::ReadBarrierOptionForInstanceOf(instruction);
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
       // /* HeapReference<Class> */ out = obj->klass_
       GenerateReferenceLoadTwoRegisters(instruction,
                                         out_loc,
@@ -4180,7 +4269,7 @@
 
     case TypeCheckKind::kArrayObjectCheck: {
       ReadBarrierOption read_barrier_option =
-          CodeGenerator::ReadBarrierOptionForInstanceOf(instruction);
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
       // /* HeapReference<Class> */ out = obj->klass_
       GenerateReferenceLoadTwoRegisters(instruction,
                                         out_loc,
@@ -4297,7 +4386,7 @@
 
 void LocationsBuilderARM64::VisitCheckCast(HCheckCast* instruction) {
   TypeCheckKind type_check_kind = instruction->GetTypeCheckKind();
-  LocationSummary::CallKind call_kind = CodeGenerator::GetCheckCastCallKind(instruction);
+  LocationSummary::CallKind call_kind = codegen_->GetCheckCastCallKind(instruction);
   LocationSummary* locations =
       new (GetGraph()->GetAllocator()) LocationSummary(instruction, call_kind);
   locations->SetInAt(0, Location::RequiresRegister());
@@ -4308,8 +4397,7 @@
   } else {
     locations->SetInAt(1, Location::RequiresRegister());
   }
-  // Add temps for read barriers and other uses. One is used by TypeCheckSlowPathARM64.
-  locations->AddRegisterTemps(NumberOfCheckCastTemps(type_check_kind));
+  locations->AddRegisterTemps(NumberOfCheckCastTemps(codegen_->EmitReadBarrier(), type_check_kind));
 }
 
 void InstructionCodeGeneratorARM64::VisitCheckCast(HCheckCast* instruction) {
@@ -4320,7 +4408,7 @@
   Register cls = (type_check_kind == TypeCheckKind::kBitstringCheck)
       ? Register()
       : InputRegisterAt(instruction, 1);
-  const size_t num_temps = NumberOfCheckCastTemps(type_check_kind);
+  const size_t num_temps = NumberOfCheckCastTemps(codegen_->EmitReadBarrier(), type_check_kind);
   DCHECK_GE(num_temps, 1u);
   DCHECK_LE(num_temps, 3u);
   Location temp_loc = locations->GetTemp(0);
@@ -4336,7 +4424,7 @@
   const uint32_t object_array_data_offset =
       mirror::Array::DataOffset(kHeapReferenceSize).Uint32Value();
 
-  bool is_type_check_slow_path_fatal = CodeGenerator::IsTypeCheckSlowPathFatal(instruction);
+  bool is_type_check_slow_path_fatal = codegen_->IsTypeCheckSlowPathFatal(instruction);
   SlowPathCodeARM64* type_check_slow_path =
       new (codegen_->GetScopedAllocator()) TypeCheckSlowPathARM64(
           instruction, is_type_check_slow_path_fatal);
@@ -4478,12 +4566,11 @@
                                         kWithoutReadBarrier);
 
       // /* HeapReference<Class> */ temp = temp->iftable_
-      GenerateReferenceLoadTwoRegisters(instruction,
-                                        temp_loc,
-                                        temp_loc,
-                                        iftable_offset,
-                                        maybe_temp2_loc,
-                                        kWithoutReadBarrier);
+      GenerateReferenceLoadOneRegister(instruction,
+                                       temp_loc,
+                                       iftable_offset,
+                                       maybe_temp2_loc,
+                                       kWithoutReadBarrier);
       // Iftable is never null.
       __ Ldr(WRegisterFrom(maybe_temp2_loc), HeapOperand(temp.W(), array_length_offset));
       // Loop through the iftable and check if any class matches.
@@ -4525,7 +4612,7 @@
   locations->SetOut(Location::ConstantLocation(constant));
 }
 
-void InstructionCodeGeneratorARM64::VisitIntConstant(HIntConstant* constant ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorARM64::VisitIntConstant([[maybe_unused]] HIntConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -4534,7 +4621,7 @@
   locations->SetOut(Location::ConstantLocation(constant));
 }
 
-void InstructionCodeGeneratorARM64::VisitNullConstant(HNullConstant* constant ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorARM64::VisitNullConstant([[maybe_unused]] HNullConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -4566,24 +4653,27 @@
 void CodeGeneratorARM64::MaybeGenerateInlineCacheCheck(HInstruction* instruction,
                                                        Register klass) {
   DCHECK_EQ(klass.GetCode(), 0u);
-  // We know the destination of an intrinsic, so no need to record inline
-  // caches.
-  if (!instruction->GetLocations()->Intrinsified() &&
-      GetGraph()->IsCompilingBaseline() &&
-      !Runtime::Current()->IsAotCompiler()) {
-    DCHECK(!instruction->GetEnvironment()->IsFromInlinedInvoke());
+  if (ProfilingInfoBuilder::IsInlineCacheUseful(instruction->AsInvoke(), this)) {
     ProfilingInfo* info = GetGraph()->GetProfilingInfo();
     DCHECK(info != nullptr);
-    InlineCache* cache = info->GetInlineCache(instruction->GetDexPc());
-    uint64_t address = reinterpret_cast64<uint64_t>(cache);
-    vixl::aarch64::Label done;
-    __ Mov(x8, address);
-    __ Ldr(x9, MemOperand(x8, InlineCache::ClassesOffset().Int32Value()));
-    // Fast path for a monomorphic cache.
-    __ Cmp(klass, x9);
-    __ B(eq, &done);
-    InvokeRuntime(kQuickUpdateInlineCache, instruction, instruction->GetDexPc());
-    __ Bind(&done);
+    InlineCache* cache = ProfilingInfoBuilder::GetInlineCache(
+        info, GetCompilerOptions(), instruction->AsInvoke());
+    if (cache != nullptr) {
+      uint64_t address = reinterpret_cast64<uint64_t>(cache);
+      vixl::aarch64::Label done;
+      __ Mov(x8, address);
+      __ Ldr(w9, MemOperand(x8, InlineCache::ClassesOffset().Int32Value()));
+      // Fast path for a monomorphic cache.
+      __ Cmp(klass.W(), w9);
+      __ B(eq, &done);
+      InvokeRuntime(kQuickUpdateInlineCache, instruction, instruction->GetDexPc());
+      __ Bind(&done);
+    } else {
+      // This is unexpected, but we don't guarantee stable compilation across
+      // JIT runs so just warn about it.
+      ScopedObjectAccess soa(Thread::Current());
+      LOG(WARNING) << "Missing inline cache for " << GetGraph()->GetArtMethod()->PrettyMethod();
+    }
   }
 }
 
@@ -4709,8 +4799,8 @@
 }
 
 HInvokeStaticOrDirect::DispatchInfo CodeGeneratorARM64::GetSupportedInvokeStaticOrDirectDispatch(
-      const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info,
-      ArtMethod* method ATTRIBUTE_UNUSED) {
+    const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info,
+    [[maybe_unused]] ArtMethod* method) {
   // On ARM64 we support all dispatch types.
   return desired_dispatch_info;
 }
@@ -4749,7 +4839,8 @@
     case MethodLoadKind::kJitDirectAddress: {
       // Load method address from literal pool.
       __ Ldr(XRegisterFrom(temp),
-             DeduplicateUint64Literal(reinterpret_cast<uint64_t>(invoke->GetResolvedMethod())));
+             jit_patches_.DeduplicateUint64Literal(
+                 reinterpret_cast<uint64_t>(invoke->GetResolvedMethod())));
       break;
     }
     case MethodLoadKind::kRuntimeCall: {
@@ -4775,14 +4866,12 @@
       __ Ldr(XRegisterFrom(temp), MemOperand(tr, offset));
       break;
     }
-    case MethodLoadKind::kRecursive: {
+    case MethodLoadKind::kRecursive:
       callee_method = invoke->GetLocations()->InAt(invoke->GetCurrentMethodIndex());
       break;
-    }
-    case MethodLoadKind::kRuntimeCall: {
+    case MethodLoadKind::kRuntimeCall:
       GenerateInvokeStaticOrDirectRuntimeCall(invoke, temp, slow_path);
       return;  // No code pointer retrieval; the runtime performs the call directly.
-    }
     case MethodLoadKind::kBootImageLinkTimePcRelative:
       DCHECK(GetCompilerOptions().IsBootImage() || GetCompilerOptions().IsBootImageExtension());
       if (invoke->GetCodePtrLocation() == CodePtrLocation::kCallCriticalNative) {
@@ -4798,10 +4887,9 @@
         break;
       }
       FALLTHROUGH_INTENDED;
-    default: {
+    default:
       LoadMethod(invoke->GetMethodLoadKind(), temp, invoke);
       break;
-    }
   }
 
   auto call_lr = [&]() {
@@ -4906,6 +4994,7 @@
   }
   // Instead of simply (possibly) unpoisoning `temp` here, we should
   // emit a read barrier for the previous class reference load.
+  // However this is not required in practice, as this is an
   // intermediate/temporary reference and because the current
   // concurrent copying collector keeps the from-space memory
   // intact/accessible until the end of the marking phase (the
@@ -5090,25 +5179,8 @@
   return label;
 }
 
-vixl::aarch64::Literal<uint32_t>* CodeGeneratorARM64::DeduplicateBootImageAddressLiteral(
-    uint64_t address) {
-  return DeduplicateUint32Literal(dchecked_integral_cast<uint32_t>(address));
-}
-
-vixl::aarch64::Literal<uint32_t>* CodeGeneratorARM64::DeduplicateJitStringLiteral(
-    const DexFile& dex_file, dex::StringIndex string_index, Handle<mirror::String> handle) {
-  ReserveJitStringRoot(StringReference(&dex_file, string_index), handle);
-  return jit_string_patches_.GetOrCreate(
-      StringReference(&dex_file, string_index),
-      [this]() { return __ CreateLiteralDestroyedWithPool<uint32_t>(/* value= */ 0u); });
-}
-
-vixl::aarch64::Literal<uint32_t>* CodeGeneratorARM64::DeduplicateJitClassLiteral(
-    const DexFile& dex_file, dex::TypeIndex type_index, Handle<mirror::Class> handle) {
-  ReserveJitClassRoot(TypeReference(&dex_file, type_index), handle);
-  return jit_class_patches_.GetOrCreate(
-      TypeReference(&dex_file, type_index),
-      [this]() { return __ CreateLiteralDestroyedWithPool<uint32_t>(/* value= */ 0u); });
+void CodeGeneratorARM64::EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) {
+  jit_patches_.EmitJitRootPatches(code, roots_data, *GetCodeGenerationData());
 }
 
 void CodeGeneratorARM64::EmitAdrpPlaceholder(vixl::aarch64::Label* fixup_label,
@@ -5171,7 +5243,7 @@
 
 void CodeGeneratorARM64::LoadTypeForBootImageIntrinsic(vixl::aarch64::Register reg,
                                                        TypeReference target_type) {
-  // Load the class the same way as for HLoadClass::LoadKind::kBootImageLinkTimePcRelative.
+  // Load the type the same way as for HLoadClass::LoadKind::kBootImageLinkTimePcRelative.
   DCHECK(GetCompilerOptions().IsBootImage() || GetCompilerOptions().IsBootImageExtension());
   // Add ADRP with its PC-relative type patch.
   vixl::aarch64::Label* adrp_label =
@@ -5332,19 +5404,7 @@
   assembler.FinalizeCode();
   code->resize(assembler.CodeSize());
   MemoryRegion code_region(code->data(), code->size());
-  assembler.FinalizeInstructions(code_region);
-}
-
-vixl::aarch64::Literal<uint32_t>* CodeGeneratorARM64::DeduplicateUint32Literal(uint32_t value) {
-  return uint32_literals_.GetOrCreate(
-      value,
-      [this, value]() { return __ CreateLiteralDestroyedWithPool<uint32_t>(value); });
-}
-
-vixl::aarch64::Literal<uint64_t>* CodeGeneratorARM64::DeduplicateUint64Literal(uint64_t value) {
-  return uint64_literals_.GetOrCreate(
-      value,
-      [this, value]() { return __ CreateLiteralDestroyedWithPool<uint64_t>(value); });
+  assembler.CopyInstructions(code_region);
 }
 
 void InstructionCodeGeneratorARM64::VisitInvokeStaticOrDirect(HInvokeStaticOrDirect* invoke) {
@@ -5370,13 +5430,8 @@
     return;
   }
 
-  {
-    // Ensure that between the BLR (emitted by GenerateVirtualCall) and RecordPcInfo there
-    // are no pools emitted.
-    EmissionCheckScope guard(GetVIXLAssembler(), kInvokeCodeMarginSizeInBytes);
-    codegen_->GenerateVirtualCall(invoke, invoke->GetLocations()->GetTemp(0));
-    DCHECK(!codegen_->IsLeafMethod());
-  }
+  codegen_->GenerateVirtualCall(invoke, invoke->GetLocations()->GetTemp(0));
+  DCHECK(!codegen_->IsLeafMethod());
 
   codegen_->MaybeGenerateMarkingRegisterCheck(/* code= */ __LINE__);
 }
@@ -5421,7 +5476,7 @@
             load_kind == HLoadClass::LoadKind::kBssEntryPublic ||
                 load_kind == HLoadClass::LoadKind::kBssEntryPackage);
 
-  const bool requires_read_barrier = gUseReadBarrier && !cls->IsInBootImage();
+  const bool requires_read_barrier = !cls->IsInBootImage() && codegen_->EmitReadBarrier();
   LocationSummary::CallKind call_kind = (cls->NeedsEnvironment() || requires_read_barrier)
       ? LocationSummary::kCallOnSlowPath
       : LocationSummary::kNoCall;
@@ -5434,12 +5489,14 @@
     locations->SetInAt(0, Location::RequiresRegister());
   }
   locations->SetOut(Location::RequiresRegister());
-  if (cls->GetLoadKind() == HLoadClass::LoadKind::kBssEntry) {
-    if (!gUseReadBarrier || kUseBakerReadBarrier) {
+  if (load_kind == HLoadClass::LoadKind::kBssEntry ||
+      load_kind == HLoadClass::LoadKind::kBssEntryPublic ||
+      load_kind == HLoadClass::LoadKind::kBssEntryPackage) {
+    if (codegen_->EmitNonBakerReadBarrier()) {
+      // For non-Baker read barrier we have a temp-clobbering call.
+    } else {
       // Rely on the type resolution or initialization and marking to save everything we need.
       locations->SetCustomSlowPathCallerSaves(OneRegInReferenceOutSaveEverythingCallerSaves());
-    } else {
-      // For non-Baker read barrier we have a temp-clobbering call.
     }
   }
 }
@@ -5460,9 +5517,8 @@
   Location out_loc = cls->GetLocations()->Out();
   Register out = OutputRegister(cls);
 
-  const ReadBarrierOption read_barrier_option = cls->IsInBootImage()
-      ? kWithoutReadBarrier
-      : gCompilerReadBarrierOption;
+  const ReadBarrierOption read_barrier_option =
+      cls->IsInBootImage() ? kWithoutReadBarrier : codegen_->GetCompilerReadBarrierOption();
   bool generate_null_check = false;
   switch (load_kind) {
     case HLoadClass::LoadKind::kReferrersClass: {
@@ -5600,7 +5656,7 @@
   new (GetGraph()->GetAllocator()) LocationSummary(clear, LocationSummary::kNoCall);
 }
 
-void InstructionCodeGeneratorARM64::VisitClearException(HClearException* clear ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorARM64::VisitClearException([[maybe_unused]] HClearException* clear) {
   __ Str(wzr, GetExceptionTlsAddress());
 }
 
@@ -5623,7 +5679,7 @@
 }
 
 void LocationsBuilderARM64::VisitLoadString(HLoadString* load) {
-  LocationSummary::CallKind call_kind = CodeGenerator::GetLoadStringCallKind(load);
+  LocationSummary::CallKind call_kind = codegen_->GetLoadStringCallKind(load);
   LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(load, call_kind);
   if (load->GetLoadKind() == HLoadString::LoadKind::kRuntimeCall) {
     InvokeRuntimeCallingConvention calling_convention;
@@ -5631,11 +5687,11 @@
   } else {
     locations->SetOut(Location::RequiresRegister());
     if (load->GetLoadKind() == HLoadString::LoadKind::kBssEntry) {
-      if (!gUseReadBarrier || kUseBakerReadBarrier) {
+      if (codegen_->EmitNonBakerReadBarrier()) {
+        // For non-Baker read barrier we have a temp-clobbering call.
+      } else {
         // Rely on the pResolveString and marking to save everything we need.
         locations->SetCustomSlowPathCallerSaves(OneRegInReferenceOutSaveEverythingCallerSaves());
-      } else {
-        // For non-Baker read barrier we have a temp-clobbering call.
       }
     }
   }
@@ -5685,7 +5741,7 @@
                                         temp,
                                         /* offset placeholder */ 0u,
                                         ldr_label,
-                                        gCompilerReadBarrierOption);
+                                        codegen_->GetCompilerReadBarrierOption());
       SlowPathCodeARM64* slow_path =
           new (codegen_->GetScopedAllocator()) LoadStringSlowPathARM64(load);
       codegen_->AddSlowPath(slow_path);
@@ -5709,14 +5765,13 @@
                                         out.X(),
                                         /* offset= */ 0,
                                         /* fixup_label= */ nullptr,
-                                        gCompilerReadBarrierOption);
+                                        codegen_->GetCompilerReadBarrierOption());
       return;
     }
     default:
       break;
   }
 
-  // TODO: Re-add the compiler code to do string dex cache lookup again.
   InvokeRuntimeCallingConvention calling_convention;
   DCHECK_EQ(calling_convention.GetRegisterAt(0).GetCode(), out.GetCode());
   __ Mov(calling_convention.GetRegisterAt(0).W(), load->GetStringIndex().index_);
@@ -5730,7 +5785,7 @@
   locations->SetOut(Location::ConstantLocation(constant));
 }
 
-void InstructionCodeGeneratorARM64::VisitLongConstant(HLongConstant* constant ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorARM64::VisitLongConstant([[maybe_unused]] HLongConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -5930,7 +5985,7 @@
   HandleBinaryOp(instruction);
 }
 
-void LocationsBuilderARM64::VisitParallelMove(HParallelMove* instruction ATTRIBUTE_UNUSED) {
+void LocationsBuilderARM64::VisitParallelMove([[maybe_unused]] HParallelMove* instruction) {
   LOG(FATAL) << "Unreachable";
 }
 
@@ -5957,7 +6012,7 @@
 }
 
 void InstructionCodeGeneratorARM64::VisitParameterValue(
-    HParameterValue* instruction ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HParameterValue* instruction) {
   // Nothing to do, the parameter is already at its location.
 }
 
@@ -5968,7 +6023,7 @@
 }
 
 void InstructionCodeGeneratorARM64::VisitCurrentMethod(
-    HCurrentMethod* instruction ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HCurrentMethod* instruction) {
   // Nothing to do, the method is already at its location.
 }
 
@@ -5980,7 +6035,7 @@
   locations->SetOut(Location::Any());
 }
 
-void InstructionCodeGeneratorARM64::VisitPhi(HPhi* instruction ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorARM64::VisitPhi([[maybe_unused]] HPhi* instruction) {
   LOG(FATAL) << "Unreachable";
 }
 
@@ -6175,7 +6230,7 @@
 }
 
 void InstructionCodeGeneratorARM64::VisitConstructorFence(
-    HConstructorFence* constructor_fence ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HConstructorFence* constructor_fence) {
   codegen_->GenerateMemoryBarrier(MemBarrierKind::kStoreStore);
 }
 
@@ -6215,7 +6270,7 @@
   instruction->SetLocations(nullptr);
 }
 
-void InstructionCodeGeneratorARM64::VisitReturnVoid(HReturnVoid* instruction ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorARM64::VisitReturnVoid([[maybe_unused]] HReturnVoid* instruction) {
   codegen_->GenerateFrameExit();
 }
 
@@ -6353,6 +6408,9 @@
   // In suspend check slow path, usually there are no caller-save registers at all.
   // If SIMD instructions are present, however, we force spilling all live SIMD
   // registers in full width (since the runtime only saves/restores lower part).
+  // Note that only a suspend check can see live SIMD registers. In the
+  // loop optimization, we make sure this does not happen for any other slow
+  // path.
   locations->SetCustomSlowPathCallerSaves(
       GetGraph()->HasSIMD() ? RegisterSet::AllFpu() : RegisterSet::Empty());
 }
@@ -6467,12 +6525,12 @@
   HandleBinaryOp(instruction);
 }
 
-void LocationsBuilderARM64::VisitBoundType(HBoundType* instruction ATTRIBUTE_UNUSED) {
+void LocationsBuilderARM64::VisitBoundType([[maybe_unused]] HBoundType* instruction) {
   // Nothing to do, this should be removed during prepare for register allocator.
   LOG(FATAL) << "Unreachable";
 }
 
-void InstructionCodeGeneratorARM64::VisitBoundType(HBoundType* instruction ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorARM64::VisitBoundType([[maybe_unused]] HBoundType* instruction) {
   // Nothing to do, this should be removed during prepare for register allocator.
   LOG(FATAL) << "Unreachable";
 }
@@ -6573,7 +6631,7 @@
   DataType::Type type = DataType::Type::kReference;
   Register out_reg = RegisterFrom(out, type);
   if (read_barrier_option == kWithReadBarrier) {
-    CHECK(gUseReadBarrier);
+    DCHECK(codegen_->EmitReadBarrier());
     if (kUseBakerReadBarrier) {
       // Load with fast path based Baker's read barrier.
       // /* HeapReference<Object> */ out = *(out + offset)
@@ -6614,7 +6672,7 @@
   Register out_reg = RegisterFrom(out, type);
   Register obj_reg = RegisterFrom(obj, type);
   if (read_barrier_option == kWithReadBarrier) {
-    CHECK(gUseReadBarrier);
+    DCHECK(codegen_->EmitReadBarrier());
     if (kUseBakerReadBarrier) {
       // Load with fast path based Baker's read barrier.
       // /* HeapReference<Object> */ out = *(obj + offset)
@@ -6649,7 +6707,7 @@
   DCHECK(fixup_label == nullptr || offset == 0u);
   Register root_reg = RegisterFrom(root, DataType::Type::kReference);
   if (read_barrier_option == kWithReadBarrier) {
-    DCHECK(gUseReadBarrier);
+    DCHECK(EmitReadBarrier());
     if (kUseBakerReadBarrier) {
       // Fast path implementation of art::ReadBarrier::BarrierForRoot when
       // Baker's read barrier are used.
@@ -6712,11 +6770,10 @@
   MaybeGenerateMarkingRegisterCheck(/* code= */ __LINE__);
 }
 
-void CodeGeneratorARM64::GenerateIntrinsicCasMoveWithBakerReadBarrier(
+void CodeGeneratorARM64::GenerateIntrinsicMoveWithBakerReadBarrier(
     vixl::aarch64::Register marked_old_value,
     vixl::aarch64::Register old_value) {
-  DCHECK(gUseReadBarrier);
-  DCHECK(kUseBakerReadBarrier);
+  DCHECK(EmitBakerReadBarrier());
 
   // Similar to the Baker RB path in GenerateGcRootFieldLoad(), with a MOV instead of LDR.
   uint32_t custom_data = EncodeBakerReadBarrierGcRootData(marked_old_value.GetCode());
@@ -6737,8 +6794,7 @@
                                                                const vixl::aarch64::MemOperand& src,
                                                                bool needs_null_check,
                                                                bool use_load_acquire) {
-  DCHECK(gUseReadBarrier);
-  DCHECK(kUseBakerReadBarrier);
+  DCHECK(EmitBakerReadBarrier());
 
   // Query `art::Thread::Current()->GetIsGcMarking()` (stored in the
   // Marking Register) to decide whether we need to enter the slow
@@ -6833,8 +6889,7 @@
                                                                uint32_t data_offset,
                                                                Location index,
                                                                bool needs_null_check) {
-  DCHECK(gUseReadBarrier);
-  DCHECK(kUseBakerReadBarrier);
+  DCHECK(EmitBakerReadBarrier());
 
   static_assert(
       sizeof(mirror::HeapReference<mirror::Object>) == sizeof(int32_t),
@@ -6911,7 +6966,7 @@
 
 void CodeGeneratorARM64::MaybeGenerateMarkingRegisterCheck(int code, Location temp_loc) {
   // The following condition is a compile-time one, so it does not have a run-time cost.
-  if (kIsDebugBuild && gUseReadBarrier && kUseBakerReadBarrier) {
+  if (kIsDebugBuild && EmitBakerReadBarrier()) {
     // The following condition is a run-time one; it is executed after the
     // previous compile-time test, to avoid penalizing non-debug builds.
     if (GetCompilerOptions().EmitRunTimeChecksInDebugMode()) {
@@ -6940,7 +6995,7 @@
                                                  Location obj,
                                                  uint32_t offset,
                                                  Location index) {
-  DCHECK(gUseReadBarrier);
+  DCHECK(EmitReadBarrier());
 
   // Insert a slow path based read barrier *after* the reference load.
   //
@@ -6965,7 +7020,7 @@
                                                       Location obj,
                                                       uint32_t offset,
                                                       Location index) {
-  if (gUseReadBarrier) {
+  if (EmitReadBarrier()) {
     // Baker's read barriers shall be handled by the fast path
     // (CodeGeneratorARM64::GenerateReferenceLoadWithBakerReadBarrier).
     DCHECK(!kUseBakerReadBarrier);
@@ -6980,7 +7035,7 @@
 void CodeGeneratorARM64::GenerateReadBarrierForRootSlow(HInstruction* instruction,
                                                         Location out,
                                                         Location root) {
-  DCHECK(gUseReadBarrier);
+  DCHECK(EmitReadBarrier());
 
   // Insert a slow path based read barrier *after* the GC root load.
   //
@@ -7018,32 +7073,6 @@
   }
 }
 
-static void PatchJitRootUse(uint8_t* code,
-                            const uint8_t* roots_data,
-                            vixl::aarch64::Literal<uint32_t>* literal,
-                            uint64_t index_in_table) {
-  uint32_t literal_offset = literal->GetOffset();
-  uintptr_t address =
-      reinterpret_cast<uintptr_t>(roots_data) + index_in_table * sizeof(GcRoot<mirror::Object>);
-  uint8_t* data = code + literal_offset;
-  reinterpret_cast<uint32_t*>(data)[0] = dchecked_integral_cast<uint32_t>(address);
-}
-
-void CodeGeneratorARM64::EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) {
-  for (const auto& entry : jit_string_patches_) {
-    const StringReference& string_reference = entry.first;
-    vixl::aarch64::Literal<uint32_t>* table_entry_literal = entry.second;
-    uint64_t index_in_table = GetJitStringRootIndex(string_reference);
-    PatchJitRootUse(code, roots_data, table_entry_literal, index_in_table);
-  }
-  for (const auto& entry : jit_class_patches_) {
-    const TypeReference& type_reference = entry.first;
-    vixl::aarch64::Literal<uint32_t>* table_entry_literal = entry.second;
-    uint64_t index_in_table = GetJitClassRootIndex(type_reference);
-    PatchJitRootUse(code, roots_data, table_entry_literal, index_in_table);
-  }
-}
-
 MemOperand InstructionCodeGeneratorARM64::VecNEONAddress(
     HVecMemoryOperation* instruction,
     UseScratchRegisterScope* temps_scope,
diff --git a/compiler/optimizing/code_generator_arm64.h b/compiler/optimizing/code_generator_arm64.h
index 6190364..d10fb30 100644
--- a/compiler/optimizing/code_generator_arm64.h
+++ b/compiler/optimizing/code_generator_arm64.h
@@ -26,6 +26,7 @@
 #include "dex/string_reference.h"
 #include "dex/type_reference.h"
 #include "driver/compiler_options.h"
+#include "jit_patches_arm64.h"
 #include "nodes.h"
 #include "parallel_move_resolver.h"
 #include "utils/arm64/assembler_arm64.h"
@@ -50,30 +51,29 @@
 // Use a local definition to prevent copying mistakes.
 static constexpr size_t kArm64WordSize = static_cast<size_t>(kArm64PointerSize);
 
-// These constants are used as an approximate margin when emission of veneer and literal pools
+// This constant is used as an approximate margin when emission of veneer and literal pools
 // must be blocked.
 static constexpr int kMaxMacroInstructionSizeInBytes = 15 * vixl::aarch64::kInstructionSize;
-static constexpr int kInvokeCodeMarginSizeInBytes = 6 * kMaxMacroInstructionSizeInBytes;
 
 static const vixl::aarch64::Register kParameterCoreRegisters[] = {
-  vixl::aarch64::x1,
-  vixl::aarch64::x2,
-  vixl::aarch64::x3,
-  vixl::aarch64::x4,
-  vixl::aarch64::x5,
-  vixl::aarch64::x6,
-  vixl::aarch64::x7
+    vixl::aarch64::x1,
+    vixl::aarch64::x2,
+    vixl::aarch64::x3,
+    vixl::aarch64::x4,
+    vixl::aarch64::x5,
+    vixl::aarch64::x6,
+    vixl::aarch64::x7
 };
 static constexpr size_t kParameterCoreRegistersLength = arraysize(kParameterCoreRegisters);
 static const vixl::aarch64::VRegister kParameterFPRegisters[] = {
-  vixl::aarch64::d0,
-  vixl::aarch64::d1,
-  vixl::aarch64::d2,
-  vixl::aarch64::d3,
-  vixl::aarch64::d4,
-  vixl::aarch64::d5,
-  vixl::aarch64::d6,
-  vixl::aarch64::d7
+    vixl::aarch64::d0,
+    vixl::aarch64::d1,
+    vixl::aarch64::d2,
+    vixl::aarch64::d3,
+    vixl::aarch64::d4,
+    vixl::aarch64::d5,
+    vixl::aarch64::d6,
+    vixl::aarch64::d7
 };
 static constexpr size_t kParameterFPRegistersLength = arraysize(kParameterFPRegisters);
 
@@ -116,7 +116,7 @@
     vixl::aarch64::CPURegister::kRegister,
     vixl::aarch64::kXRegSize,
     (kReserveMarkingRegister ? vixl::aarch64::x21.GetCode() : vixl::aarch64::x20.GetCode()),
-     vixl::aarch64::x30.GetCode());
+    vixl::aarch64::x30.GetCode());
 const vixl::aarch64::CPURegList callee_saved_fp_registers(vixl::aarch64::CPURegister::kVRegister,
                                                           vixl::aarch64::kDRegSize,
                                                           vixl::aarch64::d8.GetCode(),
@@ -144,19 +144,8 @@
   V(SystemArrayCopyByte)                      \
   V(SystemArrayCopyInt)                       \
   /* 1.8 */                                   \
-  V(UnsafeGetAndAddInt)                       \
-  V(UnsafeGetAndAddLong)                      \
-  V(UnsafeGetAndSetInt)                       \
-  V(UnsafeGetAndSetLong)                      \
-  V(UnsafeGetAndSetObject)                    \
   V(MethodHandleInvokeExact)                  \
-  V(MethodHandleInvoke)                       \
-  /* OpenJDK 11 */                            \
-  V(JdkUnsafeGetAndAddInt)                    \
-  V(JdkUnsafeGetAndAddLong)                   \
-  V(JdkUnsafeGetAndSetInt)                    \
-  V(JdkUnsafeGetAndSetLong)                   \
-  V(JdkUnsafeGetAndSetObject)
+  V(MethodHandleInvoke)
 
 class SlowPathCodeARM64 : public SlowPathCode {
  public:
@@ -192,34 +181,34 @@
   DISALLOW_COPY_AND_ASSIGN(JumpTableARM64);
 };
 
-static const vixl::aarch64::Register kRuntimeParameterCoreRegisters[] =
-    { vixl::aarch64::x0,
-      vixl::aarch64::x1,
-      vixl::aarch64::x2,
-      vixl::aarch64::x3,
-      vixl::aarch64::x4,
-      vixl::aarch64::x5,
-      vixl::aarch64::x6,
-      vixl::aarch64::x7 };
+static const vixl::aarch64::Register kRuntimeParameterCoreRegisters[] = {
+    vixl::aarch64::x0,
+    vixl::aarch64::x1,
+    vixl::aarch64::x2,
+    vixl::aarch64::x3,
+    vixl::aarch64::x4,
+    vixl::aarch64::x5,
+    vixl::aarch64::x6,
+    vixl::aarch64::x7
+};
 static constexpr size_t kRuntimeParameterCoreRegistersLength =
     arraysize(kRuntimeParameterCoreRegisters);
-static const vixl::aarch64::VRegister kRuntimeParameterFpuRegisters[] =
-    { vixl::aarch64::d0,
-      vixl::aarch64::d1,
-      vixl::aarch64::d2,
-      vixl::aarch64::d3,
-      vixl::aarch64::d4,
-      vixl::aarch64::d5,
-      vixl::aarch64::d6,
-      vixl::aarch64::d7 };
+static const vixl::aarch64::VRegister kRuntimeParameterFpuRegisters[] = {
+    vixl::aarch64::d0,
+    vixl::aarch64::d1,
+    vixl::aarch64::d2,
+    vixl::aarch64::d3,
+    vixl::aarch64::d4,
+    vixl::aarch64::d5,
+    vixl::aarch64::d6,
+    vixl::aarch64::d7
+};
 static constexpr size_t kRuntimeParameterFpuRegistersLength =
     arraysize(kRuntimeParameterCoreRegisters);
 
 class InvokeRuntimeCallingConvention : public CallingConvention<vixl::aarch64::Register,
                                                                 vixl::aarch64::VRegister> {
  public:
-  static constexpr size_t kParameterCoreRegistersLength = arraysize(kParameterCoreRegisters);
-
   InvokeRuntimeCallingConvention()
       : CallingConvention(kRuntimeParameterCoreRegisters,
                           kRuntimeParameterCoreRegistersLength,
@@ -304,16 +293,16 @@
   Location GetFieldIndexLocation() const override {
     return helpers::LocationFrom(vixl::aarch64::x0);
   }
-  Location GetReturnLocation(DataType::Type type ATTRIBUTE_UNUSED) const override {
+  Location GetReturnLocation([[maybe_unused]] DataType::Type type) const override {
     return helpers::LocationFrom(vixl::aarch64::x0);
   }
-  Location GetSetValueLocation(DataType::Type type ATTRIBUTE_UNUSED,
+  Location GetSetValueLocation([[maybe_unused]] DataType::Type type,
                                bool is_instance) const override {
     return is_instance
         ? helpers::LocationFrom(vixl::aarch64::x2)
         : helpers::LocationFrom(vixl::aarch64::x1);
   }
-  Location GetFpuLocation(DataType::Type type ATTRIBUTE_UNUSED) const override {
+  Location GetFpuLocation([[maybe_unused]] DataType::Type type) const override {
     return helpers::LocationFrom(vixl::aarch64::d0);
   }
 
@@ -551,12 +540,31 @@
   // register size (full SIMD register is used).
   void ValidateVectorLength(HVecOperation* instr) const;
 
-  // Returns default predicate register which is used as governing vector predicate
-  // to implement predicated loop execution.
+  vixl::aarch64::PRegister GetVecGoverningPReg(HVecOperation* instr) {
+    return GetVecPredSetFixedOutPReg(instr->GetGoverningPredicate());
+  }
+
+  // Returns a fixed p-reg for predicate setting instruction.
   //
-  // TODO: This is a hack to be addressed when register allocator supports SIMD types.
-  static vixl::aarch64::PRegister LoopPReg() {
-    return vixl::aarch64::p0;
+  // Currently we only support diamond CF loops for predicated vectorization; also we don't have
+  // register allocator support for vector predicates. Thus we use fixed P-regs for loop main,
+  // True and False predicates as a temporary solution.
+  //
+  // TODO: Support SIMD types and registers in ART.
+  static vixl::aarch64::PRegister GetVecPredSetFixedOutPReg(HVecPredSetOperation* instr) {
+    if (instr->IsVecPredWhile() || instr->IsVecPredSetAll()) {
+      // VecPredWhile and VecPredSetAll live ranges never overlap due to the current vectorization
+      // scheme: the former only is live inside a vectorized loop and the later is never in a
+      // loop and never spans across loops.
+      return vixl::aarch64::p0;
+    } else if (instr->IsVecPredNot()) {
+      // This relies on the fact that we only use PredNot manually in the autovectorizer,
+      // so there is only one of them in each loop.
+      return vixl::aarch64::p1;
+    } else {
+      DCHECK(instr->IsVecCondition());
+      return vixl::aarch64::p2;
+    }
   }
 };
 
@@ -650,10 +658,20 @@
   const Arm64Assembler& GetAssembler() const override { return assembler_; }
   vixl::aarch64::MacroAssembler* GetVIXLAssembler() { return GetAssembler()->GetVIXLAssembler(); }
 
-  // Emit a write barrier.
-  void MarkGCCard(vixl::aarch64::Register object,
-                  vixl::aarch64::Register value,
-                  bool emit_null_check);
+  // Emit a write barrier if:
+  // A) emit_null_check is false
+  // B) emit_null_check is true, and value is not null.
+  void MaybeMarkGCCard(vixl::aarch64::Register object,
+                       vixl::aarch64::Register value,
+                       bool emit_null_check);
+
+  // Emit a write barrier unconditionally.
+  void MarkGCCard(vixl::aarch64::Register object);
+
+  // Crash if the card table is not valid. This check is only emitted for the CC GC. We assert
+  // `(!clean || !self->is_gc_marking)`, since the card table should not be set to clean when the CC
+  // GC is marking for eliminated write barriers.
+  void CheckGCCardIsValid(vixl::aarch64::Register object);
 
   void GenerateMemoryBarrier(MemBarrierKind kind);
 
@@ -698,7 +716,7 @@
     return jump_tables_.back().get();
   }
 
-  void Finalize(CodeAllocator* allocator) override;
+  void Finalize() override;
 
   // Code generation helpers.
   void MoveConstant(vixl::aarch64::CPURegister destination, HConstant* constant);
@@ -737,9 +755,7 @@
 
   ParallelMoveResolverARM64* GetMoveResolver() override { return &move_resolver_; }
 
-  bool NeedsTwoRegisters(DataType::Type type ATTRIBUTE_UNUSED) const override {
-    return false;
-  }
+  bool NeedsTwoRegisters([[maybe_unused]] DataType::Type type) const override { return false; }
 
   // Check if the desired_string_load_kind is supported. If it is, return it,
   // otherwise return a fall-back kind that should be used instead.
@@ -838,13 +854,21 @@
   // the associated patch for AOT or slow path for JIT.
   void EmitBakerReadBarrierCbnz(uint32_t custom_data);
 
-  vixl::aarch64::Literal<uint32_t>* DeduplicateBootImageAddressLiteral(uint64_t address);
+  vixl::aarch64::Literal<uint32_t>* DeduplicateBootImageAddressLiteral(uint64_t address) {
+    return jit_patches_.DeduplicateBootImageAddressLiteral(address);
+  }
   vixl::aarch64::Literal<uint32_t>* DeduplicateJitStringLiteral(const DexFile& dex_file,
                                                                 dex::StringIndex string_index,
-                                                                Handle<mirror::String> handle);
+                                                                Handle<mirror::String> handle) {
+    return jit_patches_.DeduplicateJitStringLiteral(
+        dex_file, string_index, handle, GetCodeGenerationData());
+  }
   vixl::aarch64::Literal<uint32_t>* DeduplicateJitClassLiteral(const DexFile& dex_file,
-                                                               dex::TypeIndex string_index,
-                                                               Handle<mirror::Class> handle);
+                                                               dex::TypeIndex class_index,
+                                                               Handle<mirror::Class> handle) {
+    return jit_patches_.DeduplicateJitClassLiteral(
+        dex_file, class_index, handle, GetCodeGenerationData());
+  }
 
   void EmitAdrpPlaceholder(vixl::aarch64::Label* fixup_label, vixl::aarch64::Register reg);
   void EmitAddPlaceholder(vixl::aarch64::Label* fixup_label,
@@ -879,9 +903,9 @@
                                uint32_t offset,
                                vixl::aarch64::Label* fixup_label,
                                ReadBarrierOption read_barrier_option);
-  // Generate MOV for the `old_value` in intrinsic CAS and mark it with Baker read barrier.
-  void GenerateIntrinsicCasMoveWithBakerReadBarrier(vixl::aarch64::Register marked_old_value,
-                                                    vixl::aarch64::Register old_value);
+  // Generate MOV for the `old_value` in intrinsic and mark it with Baker read barrier.
+  void GenerateIntrinsicMoveWithBakerReadBarrier(vixl::aarch64::Register marked_old_value,
+                                                 vixl::aarch64::Register old_value);
   // Fast path implementation of ReadBarrier::Barrier for a heap
   // reference field load when Baker's read barriers are used.
   // Overload suitable for Unsafe.getObject/-Volatile() intrinsic.
@@ -1003,7 +1027,7 @@
   }
 
   void MaybeGenerateInlineCacheCheck(HInstruction* instruction, vixl::aarch64::Register klass);
-  void MaybeIncrementHotness(bool is_frame_entry);
+  void MaybeIncrementHotness(HSuspendCheck* suspend_check, bool is_frame_entry);
 
   bool CanUseImplicitSuspendCheck() const;
 
@@ -1074,18 +1098,6 @@
                                     uint32_t encoded_data,
                                     /*out*/ std::string* debug_name);
 
-  using Uint64ToLiteralMap = ArenaSafeMap<uint64_t, vixl::aarch64::Literal<uint64_t>*>;
-  using Uint32ToLiteralMap = ArenaSafeMap<uint32_t, vixl::aarch64::Literal<uint32_t>*>;
-  using StringToLiteralMap = ArenaSafeMap<StringReference,
-                                          vixl::aarch64::Literal<uint32_t>*,
-                                          StringReferenceValueComparator>;
-  using TypeToLiteralMap = ArenaSafeMap<TypeReference,
-                                        vixl::aarch64::Literal<uint32_t>*,
-                                        TypeReferenceValueComparator>;
-
-  vixl::aarch64::Literal<uint32_t>* DeduplicateUint32Literal(uint32_t value);
-  vixl::aarch64::Literal<uint64_t>* DeduplicateUint64Literal(uint64_t value);
-
   // The PcRelativePatchInfo is used for PC-relative addressing of methods/strings/types,
   // whether through .data.bimg.rel.ro, .bss, or directly in the boot image.
   struct PcRelativePatchInfo : PatchInfo<vixl::aarch64::Label> {
@@ -1158,14 +1170,7 @@
   // Baker read barrier patch info.
   ArenaDeque<BakerReadBarrierPatchInfo> baker_read_barrier_patches_;
 
-  // Deduplication map for 32-bit literals, used for JIT for boot image addresses.
-  Uint32ToLiteralMap uint32_literals_;
-  // Deduplication map for 64-bit literals, used for JIT for method address or method code.
-  Uint64ToLiteralMap uint64_literals_;
-  // Patches for string literals in JIT compiled code.
-  StringToLiteralMap jit_string_patches_;
-  // Patches for class literals in JIT compiled code.
-  TypeToLiteralMap jit_class_patches_;
+  JitPatchesARM64 jit_patches_;
 
   // Baker read barrier slow paths, mapping custom data (uint32_t) to label.
   // Wrap the label to work around vixl::aarch64::Label being non-copyable
diff --git a/compiler/optimizing/code_generator_arm_vixl.cc b/compiler/optimizing/code_generator_arm_vixl.cc
index d69e770..0ed3f8b 100644
--- a/compiler/optimizing/code_generator_arm_vixl.cc
+++ b/compiler/optimizing/code_generator_arm_vixl.cc
@@ -22,6 +22,7 @@
 #include "art_method-inl.h"
 #include "base/bit_utils.h"
 #include "base/bit_utils_iterator.h"
+#include "base/globals.h"
 #include "class_root-inl.h"
 #include "class_table.h"
 #include "code_generator_utils.h"
@@ -33,13 +34,17 @@
 #include "interpreter/mterp/nterp.h"
 #include "intrinsics.h"
 #include "intrinsics_arm_vixl.h"
+#include "intrinsics_list.h"
 #include "intrinsics_utils.h"
+#include "jit/profiling_info.h"
 #include "linker/linker_patch.h"
 #include "mirror/array-inl.h"
 #include "mirror/class-inl.h"
 #include "mirror/var_handle.h"
+#include "profiling_info_builder.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread.h"
+#include "trace.h"
 #include "utils/arm/assembler_arm_vixl.h"
 #include "utils/arm/managed_register_arm.h"
 #include "utils/assembler.h"
@@ -147,7 +152,7 @@
   RegisterSet caller_saves = RegisterSet::Empty();
   caller_saves.Add(LocationFrom(calling_convention.GetRegisterAt(0)));
   // TODO: Add GetReturnLocation() to the calling convention so that we can DCHECK()
-  // that the the kPrimNot result register is the same as the first argument register.
+  // that the kPrimNot result register is the same as the first argument register.
   return caller_saves;
 }
 
@@ -295,31 +300,6 @@
   }
 }
 
-static StoreOperandType GetStoreOperandType(DataType::Type type) {
-  switch (type) {
-    case DataType::Type::kReference:
-      return kStoreWord;
-    case DataType::Type::kBool:
-    case DataType::Type::kUint8:
-    case DataType::Type::kInt8:
-      return kStoreByte;
-    case DataType::Type::kUint16:
-    case DataType::Type::kInt16:
-      return kStoreHalfword;
-    case DataType::Type::kInt32:
-      return kStoreWord;
-    case DataType::Type::kInt64:
-      return kStoreWordPair;
-    case DataType::Type::kFloat32:
-      return kStoreSWord;
-    case DataType::Type::kFloat64:
-      return kStoreDWord;
-    default:
-      LOG(FATAL) << "Unreachable type " << type;
-      UNREACHABLE();
-  }
-}
-
 void SlowPathCodeARMVIXL::SaveLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) {
   size_t stack_offset = codegen->GetFirstRegisterSlotInSlowPath();
   size_t orig_offset = stack_offset;
@@ -743,7 +723,6 @@
         obj_(obj),
         offset_(offset),
         index_(index) {
-    DCHECK(gUseReadBarrier);
     // If `obj` is equal to `out` or `ref`, it means the initial object
     // has been overwritten by (or after) the heap object reference load
     // to be instrumented, e.g.:
@@ -758,13 +737,13 @@
   }
 
   void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitReadBarrier());
     CodeGeneratorARMVIXL* arm_codegen = down_cast<CodeGeneratorARMVIXL*>(codegen);
     LocationSummary* locations = instruction_->GetLocations();
     vixl32::Register reg_out = RegisterFrom(out_);
     DCHECK(locations->CanCall());
     DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(reg_out.GetCode()));
     DCHECK(instruction_->IsInstanceFieldGet() ||
-           instruction_->IsPredicatedInstanceFieldGet() ||
            instruction_->IsStaticFieldGet() ||
            instruction_->IsArrayGet() ||
            instruction_->IsInstanceOf() ||
@@ -840,7 +819,9 @@
         DCHECK(instruction_->IsInvoke()) << instruction_->DebugName();
         DCHECK(instruction_->GetLocations()->Intrinsified());
         HInvoke* invoke = instruction_->AsInvoke();
-        DCHECK(IsUnsafeGetObject(invoke) || IsVarHandleGet(invoke) || IsVarHandleCASFamily(invoke))
+        DCHECK(IsUnsafeGetReference(invoke) ||
+               IsVarHandleGet(invoke) ||
+               IsVarHandleCASFamily(invoke))
             << invoke->GetIntrinsic();
         DCHECK_EQ(offset_, 0U);
         // Though UnsafeGet's offset location is a register pair, we only pass the low
@@ -921,10 +902,10 @@
  public:
   ReadBarrierForRootSlowPathARMVIXL(HInstruction* instruction, Location out, Location root)
       : SlowPathCodeARMVIXL(instruction), out_(out), root_(root) {
-    DCHECK(gUseReadBarrier);
   }
 
   void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitReadBarrier());
     LocationSummary* locations = instruction_->GetLocations();
     vixl32::Register reg_out = RegisterFrom(out_);
     DCHECK(locations->CanCall());
@@ -992,12 +973,21 @@
 
 class CompileOptimizedSlowPathARMVIXL : public SlowPathCodeARMVIXL {
  public:
-  CompileOptimizedSlowPathARMVIXL() : SlowPathCodeARMVIXL(/* instruction= */ nullptr) {}
+  CompileOptimizedSlowPathARMVIXL(HSuspendCheck* suspend_check,
+                                  vixl32::Register profiling_info)
+      : SlowPathCodeARMVIXL(suspend_check),
+        profiling_info_(profiling_info) {}
 
   void EmitNativeCode(CodeGenerator* codegen) override {
     uint32_t entry_point_offset =
         GetThreadOffset<kArmPointerSize>(kQuickCompileOptimized).Int32Value();
     __ Bind(GetEntryLabel());
+    CodeGeneratorARMVIXL* arm_codegen = down_cast<CodeGeneratorARMVIXL*>(codegen);
+    UseScratchRegisterScope temps(arm_codegen->GetVIXLAssembler());
+    vixl32::Register tmp = temps.Acquire();
+    __ Mov(tmp, ProfilingInfo::GetOptimizeThreshold());
+    __ Strh(tmp,
+            MemOperand(profiling_info_, ProfilingInfo::BaselineHotnessCountOffset().Int32Value()));
     __ Ldr(lr, MemOperand(tr, entry_point_offset));
     // Note: we don't record the call here (and therefore don't generate a stack
     // map), as the entrypoint should never be suspended.
@@ -1010,6 +1000,8 @@
   }
 
  private:
+  vixl32::Register profiling_info_;
+
   DISALLOW_COPY_AND_ASSIGN(CompileOptimizedSlowPathARMVIXL);
 };
 
@@ -1102,27 +1094,27 @@
 }
 
 // Saves the register in the stack. Returns the size taken on stack.
-size_t CodeGeneratorARMVIXL::SaveCoreRegister(size_t stack_index ATTRIBUTE_UNUSED,
-                                              uint32_t reg_id ATTRIBUTE_UNUSED) {
+size_t CodeGeneratorARMVIXL::SaveCoreRegister([[maybe_unused]] size_t stack_index,
+                                              [[maybe_unused]] uint32_t reg_id) {
   TODO_VIXL32(FATAL);
   UNREACHABLE();
 }
 
 // Restores the register from the stack. Returns the size taken on stack.
-size_t CodeGeneratorARMVIXL::RestoreCoreRegister(size_t stack_index ATTRIBUTE_UNUSED,
-                                                 uint32_t reg_id ATTRIBUTE_UNUSED) {
+size_t CodeGeneratorARMVIXL::RestoreCoreRegister([[maybe_unused]] size_t stack_index,
+                                                 [[maybe_unused]] uint32_t reg_id) {
   TODO_VIXL32(FATAL);
   UNREACHABLE();
 }
 
-size_t CodeGeneratorARMVIXL::SaveFloatingPointRegister(size_t stack_index ATTRIBUTE_UNUSED,
-                                                       uint32_t reg_id ATTRIBUTE_UNUSED) {
+size_t CodeGeneratorARMVIXL::SaveFloatingPointRegister([[maybe_unused]] size_t stack_index,
+                                                       [[maybe_unused]] uint32_t reg_id) {
   TODO_VIXL32(FATAL);
   UNREACHABLE();
 }
 
-size_t CodeGeneratorARMVIXL::RestoreFloatingPointRegister(size_t stack_index ATTRIBUTE_UNUSED,
-                                                          uint32_t reg_id ATTRIBUTE_UNUSED) {
+size_t CodeGeneratorARMVIXL::RestoreFloatingPointRegister([[maybe_unused]] size_t stack_index,
+                                                          [[maybe_unused]] uint32_t reg_id) {
   TODO_VIXL32(FATAL);
   UNREACHABLE();
 }
@@ -1908,6 +1900,7 @@
 }
 
 namespace detail {
+
 // Mark which intrinsics we don't have handcrafted code for.
 template <Intrinsics T>
 struct IsUnimplemented {
@@ -1922,15 +1915,13 @@
 UNIMPLEMENTED_INTRINSIC_LIST_ARM(TRUE_OVERRIDE)
 #undef TRUE_OVERRIDE
 
-#include "intrinsics_list.h"
 static constexpr bool kIsIntrinsicUnimplemented[] = {
-  false,  // kNone
+    false,  // kNone
 #define IS_UNIMPLEMENTED(Intrinsic, ...) \
-  IsUnimplemented<Intrinsics::k##Intrinsic>().is_unimplemented,
-  INTRINSICS_LIST(IS_UNIMPLEMENTED)
+    IsUnimplemented<Intrinsics::k##Intrinsic>().is_unimplemented,
+    ART_INTRINSICS_LIST(IS_UNIMPLEMENTED)
 #undef IS_UNIMPLEMENTED
 };
-#undef INTRINSICS_LIST
 
 }  // namespace detail
 
@@ -2024,7 +2015,7 @@
 
 #define __ reinterpret_cast<ArmVIXLAssembler*>(GetAssembler())->GetVIXLAssembler()->  // NOLINT
 
-void CodeGeneratorARMVIXL::Finalize(CodeAllocator* allocator) {
+void CodeGeneratorARMVIXL::Finalize() {
   FixJumpTables();
 
   // Emit JIT baker read barrier slow paths.
@@ -2037,11 +2028,11 @@
   }
 
   GetAssembler()->FinalizeCode();
-  CodeGenerator::Finalize(allocator);
+  CodeGenerator::Finalize();
 
   // Verify Baker read barrier linker patches.
   if (kIsDebugBuild) {
-    ArrayRef<const uint8_t> code = allocator->GetMemory();
+    ArrayRef<const uint8_t> code(GetCode());
     for (const BakerReadBarrierPatchInfo& info : baker_read_barrier_patches_) {
       DCHECK(info.label.IsBound());
       uint32_t literal_offset = info.label.GetLocation();
@@ -2188,11 +2179,16 @@
   LocationSummary* locations = new (GetGraph()->GetAllocator())
       LocationSummary(method_hook, LocationSummary::kCallOnSlowPath);
   locations->SetInAt(0, parameter_visitor_.GetReturnLocation(method_hook->InputAt(0)->GetType()));
+  // We need three temporary registers, two to load the timestamp counter (64-bit value) and one to
+  // compute the address to store the timestamp counter.
+  locations->AddRegisterTemps(3);
 }
 
 void InstructionCodeGeneratorARMVIXL::GenerateMethodEntryExitHook(HInstruction* instruction) {
-  UseScratchRegisterScope temps(GetVIXLAssembler());
-  vixl32::Register temp = temps.Acquire();
+  LocationSummary* locations = instruction->GetLocations();
+  vixl32::Register addr = RegisterFrom(locations->GetTemp(0));
+  vixl32::Register value = RegisterFrom(locations->GetTemp(1));
+  vixl32::Register tmp = RegisterFrom(locations->GetTemp(2));
 
   SlowPathCodeARMVIXL* slow_path =
       new (codegen_->GetScopedAllocator()) MethodEntryExitHooksSlowPathARMVIXL(instruction);
@@ -2204,20 +2200,61 @@
     // if it is just non-zero. kCHA bit isn't used in debuggable runtimes as cha optimization is
     // disabled in debuggable runtime. The other bit is used when this method itself requires a
     // deoptimization due to redefinition. So it is safe to just check for non-zero value here.
-    GetAssembler()->LoadFromOffset(kLoadWord,
-                                   temp,
-                                   sp,
-                                   codegen_->GetStackOffsetOfShouldDeoptimizeFlag());
-    __ CompareAndBranchIfNonZero(temp, slow_path->GetEntryLabel());
+    GetAssembler()->LoadFromOffset(
+        kLoadWord, value, sp, codegen_->GetStackOffsetOfShouldDeoptimizeFlag());
+    __ CompareAndBranchIfNonZero(value, slow_path->GetEntryLabel());
   }
 
   MemberOffset  offset = instruction->IsMethodExitHook() ?
       instrumentation::Instrumentation::HaveMethodExitListenersOffset() :
       instrumentation::Instrumentation::HaveMethodEntryListenersOffset();
   uint32_t address = reinterpret_cast32<uint32_t>(Runtime::Current()->GetInstrumentation());
-  __ Mov(temp, address + offset.Int32Value());
-  __ Ldrb(temp, MemOperand(temp, 0));
-  __ CompareAndBranchIfNonZero(temp, slow_path->GetEntryLabel());
+  __ Mov(addr, address + offset.Int32Value());
+  __ Ldrb(value, MemOperand(addr, 0));
+  __ Cmp(value, instrumentation::Instrumentation::kFastTraceListeners);
+  // Check if there are any trace method entry / exit listeners. If no, continue.
+  __ B(lt, slow_path->GetExitLabel());
+  // Check if there are any slow (jvmti / trace with thread cpu time) method entry / exit listeners.
+  // If yes, just take the slow path.
+  __ B(gt, slow_path->GetEntryLabel());
+
+  // Check if there is place in the buffer to store a new entry, if no, take slow path.
+  uint32_t trace_buffer_index_offset =
+      Thread::TraceBufferIndexOffset<kArmPointerSize>().Int32Value();
+  vixl32::Register index = value;
+  __ Ldr(index, MemOperand(tr, trace_buffer_index_offset));
+  __ Subs(index, index, kNumEntriesForWallClock);
+  __ B(lt, slow_path->GetEntryLabel());
+
+  // Update the index in the `Thread`.
+  __ Str(index, MemOperand(tr, trace_buffer_index_offset));
+  // Calculate the entry address in the buffer.
+  // addr = base_addr + sizeof(void*) * index
+  __ Ldr(addr, MemOperand(tr, Thread::TraceBufferPtrOffset<kArmPointerSize>().SizeValue()));
+  __ Add(addr, addr, Operand(index, LSL, TIMES_4));
+
+  // Record method pointer and trace action.
+  __ Ldr(tmp, MemOperand(sp, 0));
+  // Use last two bits to encode trace method action. For MethodEntry it is 0
+  // so no need to set the bits since they are 0 already.
+  if (instruction->IsMethodExitHook()) {
+    DCHECK_GE(ArtMethod::Alignment(kRuntimePointerSize), static_cast<size_t>(4));
+    static_assert(enum_cast<int32_t>(TraceAction::kTraceMethodEnter) == 0);
+    static_assert(enum_cast<int32_t>(TraceAction::kTraceMethodExit) == 1);
+    __ Orr(tmp, tmp, Operand(enum_cast<int32_t>(TraceAction::kTraceMethodExit)));
+  }
+  __ Str(tmp, MemOperand(addr, kMethodOffsetInBytes));
+
+  vixl32::Register tmp1 = index;
+  // See Architecture Reference Manual ARMv7-A and ARMv7-R edition section B4.1.34.
+  __ Mrrc(/* lower 32-bit */ tmp,
+          /* higher 32-bit */ tmp1,
+          /* coproc= */ 15,
+          /* opc1= */ 1,
+          /* crm= */ 14);
+  static_assert(kHighTimestampOffsetInBytes ==
+                kTimestampOffsetInBytes + static_cast<uint32_t>(kRuntimePointerSize));
+  __ Strd(tmp, tmp1, MemOperand(addr, kTimestampOffsetInBytes));
   __ Bind(slow_path->GetExitLabel());
 }
 
@@ -2228,7 +2265,11 @@
 }
 
 void LocationsBuilderARMVIXL::VisitMethodEntryHook(HMethodEntryHook* method_hook) {
-  new (GetGraph()->GetAllocator()) LocationSummary(method_hook, LocationSummary::kCallOnSlowPath);
+  LocationSummary* locations = new (GetGraph()->GetAllocator())
+      LocationSummary(method_hook, LocationSummary::kCallOnSlowPath);
+  // We need three temporary registers, two to load the timestamp counter (64-bit value) and one to
+  // compute the address to store the timestamp counter.
+  locations->AddRegisterTemps(3);
 }
 
 void InstructionCodeGeneratorARMVIXL::VisitMethodEntryHook(HMethodEntryHook* instruction) {
@@ -2237,7 +2278,8 @@
   GenerateMethodEntryExitHook(instruction);
 }
 
-void CodeGeneratorARMVIXL::MaybeIncrementHotness(bool is_frame_entry) {
+void CodeGeneratorARMVIXL::MaybeIncrementHotness(HSuspendCheck* suspend_check,
+                                                 bool is_frame_entry) {
   if (GetCompilerOptions().CountHotnessInCompiledCode()) {
     UseScratchRegisterScope temps(GetVIXLAssembler());
     vixl32::Register temp = temps.Acquire();
@@ -2261,15 +2303,18 @@
     }
   }
 
-  if (GetGraph()->IsCompilingBaseline() && !Runtime::Current()->IsAotCompiler()) {
-    SlowPathCodeARMVIXL* slow_path = new (GetScopedAllocator()) CompileOptimizedSlowPathARMVIXL();
-    AddSlowPath(slow_path);
+  if (GetGraph()->IsCompilingBaseline() &&
+      GetGraph()->IsUsefulOptimizing() &&
+      !Runtime::Current()->IsAotCompiler()) {
     ProfilingInfo* info = GetGraph()->GetProfilingInfo();
     DCHECK(info != nullptr);
     DCHECK(!HasEmptyFrame());
     uint32_t address = reinterpret_cast32<uint32_t>(info);
     UseScratchRegisterScope temps(GetVIXLAssembler());
     vixl32::Register tmp = temps.Acquire();
+    SlowPathCodeARMVIXL* slow_path = new (GetScopedAllocator()) CompileOptimizedSlowPathARMVIXL(
+        suspend_check, /* profiling_info= */ lr);
+    AddSlowPath(slow_path);
     __ Mov(lr, address);
     __ Ldrh(tmp, MemOperand(lr, ProfilingInfo::BaselineHotnessCountOffset().Int32Value()));
     __ Adds(tmp, tmp, -1);
@@ -2343,10 +2388,13 @@
   if (HasEmptyFrame()) {
     // Ensure that the CFI opcode list is not empty.
     GetAssembler()->cfi().Nop();
-    MaybeIncrementHotness(/* is_frame_entry= */ true);
+    MaybeIncrementHotness(/* suspend_check= */ nullptr, /* is_frame_entry= */ true);
     return;
   }
 
+  // Make sure the frame size isn't unreasonably large.
+  DCHECK_LE(GetFrameSize(), GetMaximumFrameSize());
+
   if (!skip_overflow_check) {
     // Using r4 instead of IP saves 2 bytes.
     UseScratchRegisterScope temps(GetVIXLAssembler());
@@ -2443,7 +2491,7 @@
     GetAssembler()->StoreToOffset(kStoreWord, temp, sp, GetStackOffsetOfShouldDeoptimizeFlag());
   }
 
-  MaybeIncrementHotness(/* is_frame_entry= */ true);
+  MaybeIncrementHotness(/* suspend_check= */ nullptr, /* is_frame_entry= */ true);
   MaybeGenerateMarkingRegisterCheck(/* code= */ 1);
 }
 
@@ -2788,7 +2836,7 @@
   HLoopInformation* info = block->GetLoopInformation();
 
   if (info != nullptr && info->IsBackEdge(*block) && info->HasSuspendCheck()) {
-    codegen_->MaybeIncrementHotness(/* is_frame_entry= */ false);
+    codegen_->MaybeIncrementHotness(info->GetSuspendCheck(), /* is_frame_entry= */ false);
     GenerateSuspendCheck(info->GetSuspendCheck(), successor);
     return;
   }
@@ -2824,8 +2872,7 @@
   exit->SetLocations(nullptr);
 }
 
-void InstructionCodeGeneratorARMVIXL::VisitExit(HExit* exit ATTRIBUTE_UNUSED) {
-}
+void InstructionCodeGeneratorARMVIXL::VisitExit([[maybe_unused]] HExit* exit) {}
 
 void InstructionCodeGeneratorARMVIXL::GenerateCompareTestAndBranch(HCondition* condition,
                                                                    vixl32::Label* true_target,
@@ -2963,6 +3010,11 @@
   LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(if_instr);
   if (IsBooleanValueOrMaterializedCondition(if_instr->InputAt(0))) {
     locations->SetInAt(0, Location::RequiresRegister());
+    if (GetGraph()->IsCompilingBaseline() &&
+        codegen_->GetCompilerOptions().ProfileBranches() &&
+        !Runtime::Current()->IsAotCompiler()) {
+      locations->AddTemp(Location::RequiresRegister());
+    }
   }
 }
 
@@ -2973,6 +3025,36 @@
       nullptr : codegen_->GetLabelOf(true_successor);
   vixl32::Label* false_target = codegen_->GoesToNextBlock(if_instr->GetBlock(), false_successor) ?
       nullptr : codegen_->GetLabelOf(false_successor);
+  if (IsBooleanValueOrMaterializedCondition(if_instr->InputAt(0))) {
+    if (GetGraph()->IsCompilingBaseline() &&
+        codegen_->GetCompilerOptions().ProfileBranches() &&
+        !Runtime::Current()->IsAotCompiler()) {
+      DCHECK(if_instr->InputAt(0)->IsCondition());
+      ProfilingInfo* info = GetGraph()->GetProfilingInfo();
+      DCHECK(info != nullptr);
+      BranchCache* cache = info->GetBranchCache(if_instr->GetDexPc());
+      // Currently, not all If branches are profiled.
+      if (cache != nullptr) {
+        uint32_t address =
+            reinterpret_cast32<uint32_t>(cache) + BranchCache::FalseOffset().Int32Value();
+        static_assert(
+            BranchCache::TrueOffset().Int32Value() - BranchCache::FalseOffset().Int32Value() == 2,
+            "Unexpected offsets for BranchCache");
+        vixl32::Label done;
+        UseScratchRegisterScope temps(GetVIXLAssembler());
+        vixl32::Register temp = temps.Acquire();
+        vixl32::Register counter = RegisterFrom(if_instr->GetLocations()->GetTemp(0));
+        vixl32::Register condition = InputRegisterAt(if_instr, 0);
+        __ Mov(temp, address);
+        __ Ldrh(counter, MemOperand(temp, condition, LSL, 1));
+        __ Adds(counter, counter, 1);
+        __ Uxth(counter, counter);
+        __ CompareAndBranchIfZero(counter, &done);
+        __ Strh(counter, MemOperand(temp, condition, LSL, 1));
+        __ Bind(&done);
+      }
+    }
+  }
   GenerateTestAndBranch(if_instr, /* condition_input_index= */ 0, true_target, false_target);
 }
 
@@ -3422,7 +3504,7 @@
   locations->SetOut(Location::ConstantLocation(constant));
 }
 
-void InstructionCodeGeneratorARMVIXL::VisitIntConstant(HIntConstant* constant ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorARMVIXL::VisitIntConstant([[maybe_unused]] HIntConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -3432,7 +3514,7 @@
   locations->SetOut(Location::ConstantLocation(constant));
 }
 
-void InstructionCodeGeneratorARMVIXL::VisitNullConstant(HNullConstant* constant ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorARMVIXL::VisitNullConstant([[maybe_unused]] HNullConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -3442,7 +3524,7 @@
   locations->SetOut(Location::ConstantLocation(constant));
 }
 
-void InstructionCodeGeneratorARMVIXL::VisitLongConstant(HLongConstant* constant ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorARMVIXL::VisitLongConstant([[maybe_unused]] HLongConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -3453,7 +3535,7 @@
 }
 
 void InstructionCodeGeneratorARMVIXL::VisitFloatConstant(
-    HFloatConstant* constant ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HFloatConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -3464,7 +3546,7 @@
 }
 
 void InstructionCodeGeneratorARMVIXL::VisitDoubleConstant(
-    HDoubleConstant* constant ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HDoubleConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -3473,7 +3555,7 @@
 }
 
 void InstructionCodeGeneratorARMVIXL::VisitConstructorFence(
-    HConstructorFence* constructor_fence ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HConstructorFence* constructor_fence) {
   codegen_->GenerateMemoryBarrier(MemBarrierKind::kStoreStore);
 }
 
@@ -3489,7 +3571,7 @@
   ret->SetLocations(nullptr);
 }
 
-void InstructionCodeGeneratorARMVIXL::VisitReturnVoid(HReturnVoid* ret ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorARMVIXL::VisitReturnVoid([[maybe_unused]] HReturnVoid* ret) {
   codegen_->GenerateFrameExit();
 }
 
@@ -3612,26 +3694,28 @@
 void CodeGeneratorARMVIXL::MaybeGenerateInlineCacheCheck(HInstruction* instruction,
                                                          vixl32::Register klass) {
   DCHECK_EQ(r0.GetCode(), klass.GetCode());
-  // We know the destination of an intrinsic, so no need to record inline
-  // caches.
-  if (!instruction->GetLocations()->Intrinsified() &&
-      GetGraph()->IsCompilingBaseline() &&
-      !Runtime::Current()->IsAotCompiler()) {
-    DCHECK(!instruction->GetEnvironment()->IsFromInlinedInvoke());
+  if (ProfilingInfoBuilder::IsInlineCacheUseful(instruction->AsInvoke(), this)) {
     ProfilingInfo* info = GetGraph()->GetProfilingInfo();
-    DCHECK(info != nullptr);
-    InlineCache* cache = info->GetInlineCache(instruction->GetDexPc());
-    uint32_t address = reinterpret_cast32<uint32_t>(cache);
-    vixl32::Label done;
-    UseScratchRegisterScope temps(GetVIXLAssembler());
-    temps.Exclude(ip);
-    __ Mov(r4, address);
-    __ Ldr(ip, MemOperand(r4, InlineCache::ClassesOffset().Int32Value()));
-    // Fast path for a monomorphic cache.
-    __ Cmp(klass, ip);
-    __ B(eq, &done, /* is_far_target= */ false);
-    InvokeRuntime(kQuickUpdateInlineCache, instruction, instruction->GetDexPc());
-    __ Bind(&done);
+    InlineCache* cache = ProfilingInfoBuilder::GetInlineCache(
+        info, GetCompilerOptions(), instruction->AsInvoke());
+    if (cache != nullptr) {
+      uint32_t address = reinterpret_cast32<uint32_t>(cache);
+      vixl32::Label done;
+      UseScratchRegisterScope temps(GetVIXLAssembler());
+      temps.Exclude(ip);
+      __ Mov(r4, address);
+      __ Ldr(ip, MemOperand(r4, InlineCache::ClassesOffset().Int32Value()));
+      // Fast path for a monomorphic cache.
+      __ Cmp(klass, ip);
+      __ B(eq, &done, /* is_far_target= */ false);
+      InvokeRuntime(kQuickUpdateInlineCache, instruction, instruction->GetDexPc());
+      __ Bind(&done);
+    } else {
+      // This is unexpected, but we don't guarantee stable compilation across
+      // JIT runs so just warn about it.
+      ScopedObjectAccess soa(Thread::Current());
+      LOG(WARNING) << "Missing inline cache for " << GetGraph()->GetArtMethod()->PrettyMethod();
+    }
   }
 }
 
@@ -5617,7 +5701,7 @@
 }
 
 void InstructionCodeGeneratorARMVIXL::VisitParameterValue(
-    HParameterValue* instruction ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HParameterValue* instruction) {
   // Nothing to do, the parameter is already at its location.
 }
 
@@ -5628,7 +5712,7 @@
 }
 
 void InstructionCodeGeneratorARMVIXL::VisitCurrentMethod(
-    HCurrentMethod* instruction ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HCurrentMethod* instruction) {
   // Nothing to do, the method is already at its location.
 }
 
@@ -5769,7 +5853,7 @@
   locations->SetOut(Location::Any());
 }
 
-void InstructionCodeGeneratorARMVIXL::VisitPhi(HPhi* instruction ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorARMVIXL::VisitPhi([[maybe_unused]] HPhi* instruction) {
   LOG(FATAL) << "Unreachable";
 }
 
@@ -5856,16 +5940,15 @@
       && is_wide
       && !codegen_->GetInstructionSetFeatures().HasAtomicLdrdAndStrd();
   bool needs_write_barrier =
-      CodeGenerator::StoreNeedsWriteBarrier(field_type, instruction->InputAt(1));
+      codegen_->StoreNeedsWriteBarrier(field_type, instruction->InputAt(1), write_barrier_kind);
+  bool check_gc_card =
+      codegen_->ShouldCheckGCCard(field_type, instruction->InputAt(1), write_barrier_kind);
+
   // Temporary registers for the write barrier.
   // TODO: consider renaming StoreNeedsWriteBarrier to StoreNeedsGCMark.
-  if (needs_write_barrier) {
-    if (write_barrier_kind != WriteBarrierKind::kDontEmit) {
-      locations->AddTemp(Location::RequiresRegister());
-      locations->AddTemp(Location::RequiresRegister());
-    } else if (kPoisonHeapReferences) {
-      locations->AddTemp(Location::RequiresRegister());
-    }
+  if (needs_write_barrier || check_gc_card) {
+    locations->AddTemp(Location::RequiresRegister());
+    locations->AddTemp(Location::RequiresRegister());
   } else if (generate_volatile) {
     // ARM encoding have some additional constraints for ldrexd/strexd:
     // - registers need to be consecutive
@@ -5881,6 +5964,8 @@
       locations->AddTemp(LocationFrom(r2));
       locations->AddTemp(LocationFrom(r3));
     }
+  } else if (kPoisonHeapReferences && field_type == DataType::Type::kReference) {
+    locations->AddTemp(Location::RequiresRegister());
   }
 }
 
@@ -5893,21 +5978,13 @@
   LocationSummary* locations = instruction->GetLocations();
   vixl32::Register base = InputRegisterAt(instruction, 0);
   Location value = locations->InAt(1);
-  std::optional<vixl::aarch32::Label> pred_is_null;
 
-  bool is_predicated =
-      instruction->IsInstanceFieldSet() && instruction->AsInstanceFieldSet()->GetIsPredicatedSet();
   bool is_volatile = field_info.IsVolatile();
   bool atomic_ldrd_strd = codegen_->GetInstructionSetFeatures().HasAtomicLdrdAndStrd();
   DataType::Type field_type = field_info.GetFieldType();
   uint32_t offset = field_info.GetFieldOffset().Uint32Value();
   bool needs_write_barrier =
-      CodeGenerator::StoreNeedsWriteBarrier(field_type, instruction->InputAt(1));
-
-  if (is_predicated) {
-    pred_is_null.emplace();
-    __ CompareAndBranchIfZero(base, &*pred_is_null, /* is_far_target= */ false);
-  }
+      codegen_->StoreNeedsWriteBarrier(field_type, instruction->InputAt(1), write_barrier_kind);
 
   if (is_volatile) {
     codegen_->GenerateMemoryBarrier(MemBarrierKind::kAnyStore);
@@ -5930,10 +6007,7 @@
 
     case DataType::Type::kReference: {
       vixl32::Register value_reg = RegisterFrom(value);
-      if (kPoisonHeapReferences && needs_write_barrier) {
-        // Note that in the case where `value` is a null reference,
-        // we do not enter this block, as a null reference does not
-        // need poisoning.
+      if (kPoisonHeapReferences) {
         DCHECK_EQ(field_type, DataType::Type::kReference);
         value_reg = RegisterFrom(locations->GetTemp(0));
         __ Mov(value_reg, RegisterFrom(value));
@@ -6003,36 +6077,32 @@
       UNREACHABLE();
   }
 
-  if (CodeGenerator::StoreNeedsWriteBarrier(field_type, instruction->InputAt(1)) &&
-      write_barrier_kind != WriteBarrierKind::kDontEmit) {
+  if (needs_write_barrier) {
     vixl32::Register temp = RegisterFrom(locations->GetTemp(0));
     vixl32::Register card = RegisterFrom(locations->GetTemp(1));
-    codegen_->MarkGCCard(
+    codegen_->MaybeMarkGCCard(
         temp,
         card,
         base,
         RegisterFrom(value),
-        value_can_be_null && write_barrier_kind == WriteBarrierKind::kEmitWithNullCheck);
+        value_can_be_null && write_barrier_kind == WriteBarrierKind::kEmitNotBeingReliedOn);
+  } else if (codegen_->ShouldCheckGCCard(field_type, instruction->InputAt(1), write_barrier_kind)) {
+    vixl32::Register temp = RegisterFrom(locations->GetTemp(0));
+    vixl32::Register card = RegisterFrom(locations->GetTemp(1));
+    codegen_->CheckGCCardIsValid(temp, card, base);
   }
 
   if (is_volatile) {
     codegen_->GenerateMemoryBarrier(MemBarrierKind::kAnyAny);
   }
-
-  if (is_predicated) {
-    __ Bind(&*pred_is_null);
-  }
 }
 
 void LocationsBuilderARMVIXL::HandleFieldGet(HInstruction* instruction,
                                              const FieldInfo& field_info) {
-  DCHECK(instruction->IsInstanceFieldGet() ||
-         instruction->IsStaticFieldGet() ||
-         instruction->IsPredicatedInstanceFieldGet());
+  DCHECK(instruction->IsInstanceFieldGet() || instruction->IsStaticFieldGet());
 
   bool object_field_get_with_read_barrier =
-      gUseReadBarrier && (field_info.GetFieldType() == DataType::Type::kReference);
-  bool is_predicated = instruction->IsPredicatedInstanceFieldGet();
+      (field_info.GetFieldType() == DataType::Type::kReference) && codegen_->EmitReadBarrier();
   LocationSummary* locations =
       new (GetGraph()->GetAllocator()) LocationSummary(instruction,
                                                        object_field_get_with_read_barrier
@@ -6042,7 +6112,7 @@
     locations->SetCustomSlowPathCallerSaves(RegisterSet::Empty());  // No caller-save registers.
   }
   // Input for object receiver.
-  locations->SetInAt(is_predicated ? 1 : 0, Location::RequiresRegister());
+  locations->SetInAt(0, Location::RequiresRegister());
 
   bool volatile_for_double = field_info.IsVolatile()
       && (field_info.GetFieldType() == DataType::Type::kFloat64)
@@ -6057,20 +6127,10 @@
       object_field_get_with_read_barrier;
 
   if (DataType::IsFloatingPointType(instruction->GetType())) {
-    if (is_predicated) {
-      locations->SetInAt(0, Location::RequiresFpuRegister());
-      locations->SetOut(Location::SameAsFirstInput());
-    } else {
-      locations->SetOut(Location::RequiresFpuRegister());
-    }
+    locations->SetOut(Location::RequiresFpuRegister());
   } else {
-    if (is_predicated) {
-      locations->SetInAt(0, Location::RequiresRegister());
-      locations->SetOut(Location::SameAsFirstInput());
-    } else {
-      locations->SetOut(Location::RequiresRegister(),
-                        (overlap ? Location::kOutputOverlap : Location::kNoOutputOverlap));
-    }
+    locations->SetOut(Location::RequiresRegister(),
+                      (overlap ? Location::kOutputOverlap : Location::kNoOutputOverlap));
   }
   if (volatile_for_double) {
     // ARM encoding have some additional constraints for ldrexd/strexd:
@@ -6104,8 +6164,7 @@
 Location LocationsBuilderARMVIXL::ArmEncodableConstantOrRegister(HInstruction* constant,
                                                                  Opcode opcode) {
   DCHECK(!DataType::IsFloatingPointType(constant->GetType()));
-  if (constant->IsConstant() &&
-      CanEncodeConstantAsImmediate(constant->AsConstant(), opcode)) {
+  if (constant->IsConstant() && CanEncodeConstantAsImmediate(constant->AsConstant(), opcode)) {
     return Location::ConstantLocation(constant);
   }
   return Location::RequiresRegister();
@@ -6171,12 +6230,10 @@
 
 void InstructionCodeGeneratorARMVIXL::HandleFieldGet(HInstruction* instruction,
                                                      const FieldInfo& field_info) {
-  DCHECK(instruction->IsInstanceFieldGet() ||
-         instruction->IsStaticFieldGet() ||
-         instruction->IsPredicatedInstanceFieldGet());
+  DCHECK(instruction->IsInstanceFieldGet() || instruction->IsStaticFieldGet());
 
   LocationSummary* locations = instruction->GetLocations();
-  uint32_t receiver_input = instruction->IsPredicatedInstanceFieldGet() ? 1 : 0;
+  uint32_t receiver_input = 0;
   vixl32::Register base = InputRegisterAt(instruction, receiver_input);
   Location out = locations->Out();
   bool is_volatile = field_info.IsVolatile();
@@ -6202,7 +6259,7 @@
 
     case DataType::Type::kReference: {
       // /* HeapReference<Object> */ out = *(base + offset)
-      if (gUseReadBarrier && kUseBakerReadBarrier) {
+      if (codegen_->EmitBakerReadBarrier()) {
         Location maybe_temp = (locations->GetTempCount() != 0) ? locations->GetTemp(0) : Location();
         // Note that a potential implicit null check is handled in this
         // CodeGeneratorARMVIXL::GenerateFieldLoadWithBakerReadBarrier call.
@@ -6299,19 +6356,6 @@
   HandleFieldGet(instruction, instruction->GetFieldInfo());
 }
 
-void LocationsBuilderARMVIXL::VisitPredicatedInstanceFieldGet(
-    HPredicatedInstanceFieldGet* instruction) {
-  HandleFieldGet(instruction, instruction->GetFieldInfo());
-}
-
-void InstructionCodeGeneratorARMVIXL::VisitPredicatedInstanceFieldGet(
-    HPredicatedInstanceFieldGet* instruction) {
-  vixl::aarch32::Label finish;
-  __ CompareAndBranchIfZero(InputRegisterAt(instruction, 1), &finish, false);
-  HandleFieldGet(instruction, instruction->GetFieldInfo());
-  __ Bind(&finish);
-}
-
 void InstructionCodeGeneratorARMVIXL::VisitInstanceFieldGet(HInstanceFieldGet* instruction) {
   HandleFieldGet(instruction, instruction->GetFieldInfo());
 }
@@ -6512,7 +6556,7 @@
 
 void LocationsBuilderARMVIXL::VisitArrayGet(HArrayGet* instruction) {
   bool object_array_get_with_read_barrier =
-      gUseReadBarrier && (instruction->GetType() == DataType::Type::kReference);
+      (instruction->GetType() == DataType::Type::kReference) && codegen_->EmitReadBarrier();
   LocationSummary* locations =
       new (GetGraph()->GetAllocator()) LocationSummary(instruction,
                                                        object_array_get_with_read_barrier
@@ -6660,14 +6704,14 @@
       // The read barrier instrumentation of object ArrayGet
       // instructions does not support the HIntermediateAddress
       // instruction.
-      DCHECK(!(has_intermediate_address && gUseReadBarrier));
+      DCHECK(!(has_intermediate_address && codegen_->EmitReadBarrier()));
 
       static_assert(
           sizeof(mirror::HeapReference<mirror::Object>) == sizeof(int32_t),
           "art::mirror::HeapReference<art::mirror::Object> and int32_t have different sizes.");
       // /* HeapReference<Object> */ out =
       //     *(obj + data_offset + index * sizeof(HeapReference<Object>))
-      if (gUseReadBarrier && kUseBakerReadBarrier) {
+      if (codegen_->EmitBakerReadBarrier()) {
         // Note that a potential implicit null check is handled in this
         // CodeGeneratorARMVIXL::GenerateArrayLoadWithBakerReadBarrier call.
         DCHECK(!instruction->CanDoImplicitNullCheckOn(instruction->InputAt(0)));
@@ -6798,8 +6842,12 @@
 void LocationsBuilderARMVIXL::VisitArraySet(HArraySet* instruction) {
   DataType::Type value_type = instruction->GetComponentType();
 
+  const WriteBarrierKind write_barrier_kind = instruction->GetWriteBarrierKind();
   bool needs_write_barrier =
-      CodeGenerator::StoreNeedsWriteBarrier(value_type, instruction->GetValue());
+      codegen_->StoreNeedsWriteBarrier(value_type, instruction->GetValue(), write_barrier_kind);
+  bool check_gc_card =
+      codegen_->ShouldCheckGCCard(value_type, instruction->GetValue(), write_barrier_kind);
+
   bool needs_type_check = instruction->NeedsTypeCheck();
 
   LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(
@@ -6813,12 +6861,13 @@
   } else {
     locations->SetInAt(2, Location::RequiresRegister());
   }
-  if (needs_write_barrier) {
-    // Temporary registers for the write barrier or register poisoning.
-    // TODO(solanes): We could reduce the temp usage but it requires some non-trivial refactoring of
-    // InstructionCodeGeneratorARMVIXL::VisitArraySet.
+  if (needs_write_barrier || check_gc_card || instruction->NeedsTypeCheck()) {
+    // Temporary registers for type checking, write barrier, checking the dirty bit, or register
+    // poisoning.
     locations->AddTemp(Location::RequiresRegister());
     locations->AddTemp(Location::RequiresRegister());
+  } else if (kPoisonHeapReferences && value_type == DataType::Type::kReference) {
+    locations->AddTemp(Location::RequiresRegister());
   }
 }
 
@@ -6828,8 +6877,9 @@
   Location index = locations->InAt(1);
   DataType::Type value_type = instruction->GetComponentType();
   bool needs_type_check = instruction->NeedsTypeCheck();
+  const WriteBarrierKind write_barrier_kind = instruction->GetWriteBarrierKind();
   bool needs_write_barrier =
-      CodeGenerator::StoreNeedsWriteBarrier(value_type, instruction->GetValue());
+      codegen_->StoreNeedsWriteBarrier(value_type, instruction->GetValue(), write_barrier_kind);
   uint32_t data_offset =
       mirror::Array::DataOffset(DataType::Size(value_type)).Uint32Value();
   Location value_loc = locations->InAt(2);
@@ -6898,17 +6948,18 @@
           codegen_->StoreToShiftedRegOffset(value_type, value_loc, temp, RegisterFrom(index));
         }
         codegen_->MaybeRecordImplicitNullCheck(instruction);
-        DCHECK(!needs_write_barrier);
+        if (write_barrier_kind == WriteBarrierKind::kEmitBeingReliedOn) {
+          // We need to set a write barrier here even though we are writing null, since this write
+          // barrier is being relied on.
+          DCHECK(needs_write_barrier);
+          vixl32::Register temp1 = RegisterFrom(locations->GetTemp(0));
+          vixl32::Register temp2 = RegisterFrom(locations->GetTemp(1));
+          codegen_->MarkGCCard(temp1, temp2, array);
+        }
         DCHECK(!needs_type_check);
         break;
       }
 
-      DCHECK(needs_write_barrier);
-      Location temp1_loc = locations->GetTemp(0);
-      vixl32::Register temp1 = RegisterFrom(temp1_loc);
-      Location temp2_loc = locations->GetTemp(1);
-      vixl32::Register temp2 = RegisterFrom(temp2_loc);
-
       bool can_value_be_null = instruction->GetValueCanBeNull();
       vixl32::Label do_store;
       if (can_value_be_null) {
@@ -6932,6 +6983,9 @@
         // negative, in which case we would take the ArraySet slow
         // path.
 
+        vixl32::Register temp1 = RegisterFrom(locations->GetTemp(0));
+        vixl32::Register temp2 = RegisterFrom(locations->GetTemp(1));
+
         {
           // Ensure we record the pc position immediately after the `ldr` instruction.
           ExactAssemblyScope aas(GetVIXLAssembler(),
@@ -6969,22 +7023,29 @@
         }
       }
 
-      if (instruction->GetWriteBarrierKind() != WriteBarrierKind::kDontEmit) {
-        DCHECK_EQ(instruction->GetWriteBarrierKind(), WriteBarrierKind::kEmitNoNullCheck)
-            << " Already null checked so we shouldn't do it again.";
-        codegen_->MarkGCCard(temp1, temp2, array, value, /* emit_null_check= */ false);
-      }
-
       if (can_value_be_null) {
         DCHECK(do_store.IsReferenced());
         __ Bind(&do_store);
       }
 
+      if (needs_write_barrier) {
+        // TODO(solanes): The WriteBarrierKind::kEmitNotBeingReliedOn case should be able to skip
+        // this write barrier when its value is null (without an extra CompareAndBranchIfZero since
+        // we already checked if the value is null for the type check). This will be done as a
+        // follow-up since it is a runtime optimization that needs extra care.
+        vixl32::Register temp1 = RegisterFrom(locations->GetTemp(0));
+        vixl32::Register temp2 = RegisterFrom(locations->GetTemp(1));
+        codegen_->MarkGCCard(temp1, temp2, array);
+      } else if (codegen_->ShouldCheckGCCard(
+                     value_type, instruction->GetValue(), write_barrier_kind)) {
+        vixl32::Register temp1 = RegisterFrom(locations->GetTemp(0));
+        vixl32::Register temp2 = RegisterFrom(locations->GetTemp(1));
+        codegen_->CheckGCCardIsValid(temp1, temp2, array);
+      }
+
       vixl32::Register source = value;
       if (kPoisonHeapReferences) {
-        // Note that in the case where `value` is a null reference,
-        // we do not enter this block, as a null reference does not
-        // need poisoning.
+        vixl32::Register temp1 = RegisterFrom(locations->GetTemp(0));
         DCHECK_EQ(value_type, DataType::Type::kReference);
         __ Mov(temp1, value);
         GetAssembler()->PoisonHeapReference(temp1);
@@ -7200,20 +7261,28 @@
   }
 }
 
-void CodeGeneratorARMVIXL::MarkGCCard(vixl32::Register temp,
-                                      vixl32::Register card,
-                                      vixl32::Register object,
-                                      vixl32::Register value,
-                                      bool emit_null_check) {
+void CodeGeneratorARMVIXL::MaybeMarkGCCard(vixl32::Register temp,
+                                           vixl32::Register card,
+                                           vixl32::Register object,
+                                           vixl32::Register value,
+                                           bool emit_null_check) {
   vixl32::Label is_null;
   if (emit_null_check) {
     __ CompareAndBranchIfZero(value, &is_null, /* is_far_target=*/ false);
   }
+  MarkGCCard(temp, card, object);
+  if (emit_null_check) {
+    __ Bind(&is_null);
+  }
+}
+
+void CodeGeneratorARMVIXL::MarkGCCard(vixl32::Register temp,
+                                      vixl32::Register card,
+                                      vixl32::Register object) {
   // Load the address of the card table into `card`.
   GetAssembler()->LoadFromOffset(
       kLoadWord, card, tr, Thread::CardTableOffset<kArmPointerSize>().Int32Value());
-  // Calculate the offset (in the card table) of the card corresponding to
-  // `object`.
+  // Calculate the offset (in the card table) of the card corresponding to `object`.
   __ Lsr(temp, object, Operand::From(gc::accounting::CardTable::kCardShift));
   // Write the `art::gc::accounting::CardTable::kCardDirty` value into the
   // `object`'s card.
@@ -7229,12 +7298,27 @@
   // of the card to mark; and 2. to load the `kCardDirty` value) saves a load
   // (no need to explicitly load `kCardDirty` as an immediate value).
   __ Strb(card, MemOperand(card, temp));
-  if (emit_null_check) {
-    __ Bind(&is_null);
-  }
 }
 
-void LocationsBuilderARMVIXL::VisitParallelMove(HParallelMove* instruction ATTRIBUTE_UNUSED) {
+void CodeGeneratorARMVIXL::CheckGCCardIsValid(vixl32::Register temp,
+                                              vixl32::Register card,
+                                              vixl32::Register object) {
+  vixl32::Label done;
+  // Load the address of the card table into `card`.
+  GetAssembler()->LoadFromOffset(
+      kLoadWord, card, tr, Thread::CardTableOffset<kArmPointerSize>().Int32Value());
+  // Calculate the offset (in the card table) of the card corresponding to `object`.
+  __ Lsr(temp, object, Operand::From(gc::accounting::CardTable::kCardShift));
+  // assert (!clean || !self->is_gc_marking)
+  __ Ldrb(temp, MemOperand(card, temp));
+  static_assert(gc::accounting::CardTable::kCardClean == 0);
+  __ CompareAndBranchIfNonZero(temp, &done, /*is_far_target=*/false);
+  __ CompareAndBranchIfZero(mr, &done, /*is_far_target=*/false);
+  __ Bkpt(0);
+  __ Bind(&done);
+}
+
+void LocationsBuilderARMVIXL::VisitParallelMove([[maybe_unused]] HParallelMove* instruction) {
   LOG(FATAL) << "Unreachable";
 }
 
@@ -7591,7 +7675,7 @@
             load_kind == HLoadClass::LoadKind::kBssEntryPublic ||
                 load_kind == HLoadClass::LoadKind::kBssEntryPackage);
 
-  const bool requires_read_barrier = gUseReadBarrier && !cls->IsInBootImage();
+  const bool requires_read_barrier = !cls->IsInBootImage() && codegen_->EmitReadBarrier();
   LocationSummary::CallKind call_kind = (cls->NeedsEnvironment() || requires_read_barrier)
       ? LocationSummary::kCallOnSlowPath
       : LocationSummary::kNoCall;
@@ -7604,12 +7688,14 @@
     locations->SetInAt(0, Location::RequiresRegister());
   }
   locations->SetOut(Location::RequiresRegister());
-  if (load_kind == HLoadClass::LoadKind::kBssEntry) {
-    if (!gUseReadBarrier || kUseBakerReadBarrier) {
+  if (load_kind == HLoadClass::LoadKind::kBssEntry ||
+      load_kind == HLoadClass::LoadKind::kBssEntryPublic ||
+      load_kind == HLoadClass::LoadKind::kBssEntryPackage) {
+    if (codegen_->EmitNonBakerReadBarrier()) {
+      // For non-Baker read barrier we have a temp-clobbering call.
+    } else {
       // Rely on the type resolution or initialization and marking to save everything we need.
       locations->SetCustomSlowPathCallerSaves(OneRegInReferenceOutSaveEverythingCallerSaves());
-    } else {
-      // For non-Baker read barrier we have a temp-clobbering call.
     }
   }
 }
@@ -7631,9 +7717,8 @@
   Location out_loc = locations->Out();
   vixl32::Register out = OutputRegister(cls);
 
-  const ReadBarrierOption read_barrier_option = cls->IsInBootImage()
-      ? kWithoutReadBarrier
-      : gCompilerReadBarrierOption;
+  const ReadBarrierOption read_barrier_option =
+      cls->IsInBootImage() ? kWithoutReadBarrier : codegen_->GetCompilerReadBarrierOption();
   bool generate_null_check = false;
   switch (load_kind) {
     case HLoadClass::LoadKind::kReferrersClass: {
@@ -7840,7 +7925,7 @@
 }
 
 void LocationsBuilderARMVIXL::VisitLoadString(HLoadString* load) {
-  LocationSummary::CallKind call_kind = CodeGenerator::GetLoadStringCallKind(load);
+  LocationSummary::CallKind call_kind = codegen_->GetLoadStringCallKind(load);
   LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(load, call_kind);
   HLoadString::LoadKind load_kind = load->GetLoadKind();
   if (load_kind == HLoadString::LoadKind::kRuntimeCall) {
@@ -7848,11 +7933,11 @@
   } else {
     locations->SetOut(Location::RequiresRegister());
     if (load_kind == HLoadString::LoadKind::kBssEntry) {
-      if (!gUseReadBarrier || kUseBakerReadBarrier) {
+      if (codegen_->EmitNonBakerReadBarrier()) {
+        // For non-Baker read barrier we have a temp-clobbering call.
+      } else {
         // Rely on the pResolveString and marking to save everything we need, including temps.
         locations->SetCustomSlowPathCallerSaves(OneRegInReferenceOutSaveEverythingCallerSaves());
-      } else {
-        // For non-Baker read barrier we have a temp-clobbering call.
       }
     }
   }
@@ -7887,7 +7972,7 @@
       codegen_->EmitMovwMovtPlaceholder(labels, out);
       // All aligned loads are implicitly atomic consume operations on ARM.
       codegen_->GenerateGcRootFieldLoad(
-          load, out_loc, out, /*offset=*/ 0, gCompilerReadBarrierOption);
+          load, out_loc, out, /*offset=*/0, codegen_->GetCompilerReadBarrierOption());
       LoadStringSlowPathARMVIXL* slow_path =
           new (codegen_->GetScopedAllocator()) LoadStringSlowPathARMVIXL(load);
       codegen_->AddSlowPath(slow_path);
@@ -7908,14 +7993,13 @@
                                                         load->GetString()));
       // /* GcRoot<mirror::String> */ out = *out
       codegen_->GenerateGcRootFieldLoad(
-          load, out_loc, out, /*offset=*/ 0, gCompilerReadBarrierOption);
+          load, out_loc, out, /*offset=*/0, codegen_->GetCompilerReadBarrierOption());
       return;
     }
     default:
       break;
   }
 
-  // TODO: Re-add the compiler code to do string dex cache lookup again.
   DCHECK_EQ(load->GetLoadKind(), HLoadString::LoadKind::kRuntimeCall);
   InvokeRuntimeCallingConventionARMVIXL calling_convention;
   __ Mov(calling_convention.GetRegisterAt(0), load->GetStringIndex().index_);
@@ -7944,7 +8028,7 @@
   new (GetGraph()->GetAllocator()) LocationSummary(clear, LocationSummary::kNoCall);
 }
 
-void InstructionCodeGeneratorARMVIXL::VisitClearException(HClearException* clear ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorARMVIXL::VisitClearException([[maybe_unused]] HClearException* clear) {
   UseScratchRegisterScope temps(GetVIXLAssembler());
   vixl32::Register temp = temps.Acquire();
   __ Mov(temp, 0);
@@ -7964,8 +8048,8 @@
 }
 
 // Temp is used for read barrier.
-static size_t NumberOfInstanceOfTemps(TypeCheckKind type_check_kind) {
-  if (gUseReadBarrier &&
+static size_t NumberOfInstanceOfTemps(bool emit_read_barrier, TypeCheckKind type_check_kind) {
+  if (emit_read_barrier &&
        (kUseBakerReadBarrier ||
           type_check_kind == TypeCheckKind::kAbstractClassCheck ||
           type_check_kind == TypeCheckKind::kClassHierarchyCheck ||
@@ -7978,11 +8062,11 @@
 // Interface case has 3 temps, one for holding the number of interfaces, one for the current
 // interface pointer, one for loading the current interface.
 // The other checks have one temp for loading the object's class.
-static size_t NumberOfCheckCastTemps(TypeCheckKind type_check_kind) {
+static size_t NumberOfCheckCastTemps(bool emit_read_barrier, TypeCheckKind type_check_kind) {
   if (type_check_kind == TypeCheckKind::kInterfaceCheck) {
     return 3;
   }
-  return 1 + NumberOfInstanceOfTemps(type_check_kind);
+  return 1 + NumberOfInstanceOfTemps(emit_read_barrier, type_check_kind);
 }
 
 void LocationsBuilderARMVIXL::VisitInstanceOf(HInstanceOf* instruction) {
@@ -7994,7 +8078,7 @@
     case TypeCheckKind::kAbstractClassCheck:
     case TypeCheckKind::kClassHierarchyCheck:
     case TypeCheckKind::kArrayObjectCheck: {
-      bool needs_read_barrier = CodeGenerator::InstanceOfNeedsReadBarrier(instruction);
+      bool needs_read_barrier = codegen_->InstanceOfNeedsReadBarrier(instruction);
       call_kind = needs_read_barrier ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall;
       baker_read_barrier_slow_path = kUseBakerReadBarrier && needs_read_barrier;
       break;
@@ -8024,7 +8108,8 @@
   // The "out" register is used as a temporary, so it overlaps with the inputs.
   // Note that TypeCheckSlowPathARM uses this register too.
   locations->SetOut(Location::RequiresRegister(), Location::kOutputOverlap);
-  locations->AddRegisterTemps(NumberOfInstanceOfTemps(type_check_kind));
+  locations->AddRegisterTemps(
+      NumberOfInstanceOfTemps(codegen_->EmitReadBarrier(), type_check_kind));
 }
 
 void InstructionCodeGeneratorARMVIXL::VisitInstanceOf(HInstanceOf* instruction) {
@@ -8037,7 +8122,7 @@
       : InputRegisterAt(instruction, 1);
   Location out_loc = locations->Out();
   vixl32::Register out = OutputRegister(instruction);
-  const size_t num_temps = NumberOfInstanceOfTemps(type_check_kind);
+  const size_t num_temps = NumberOfInstanceOfTemps(codegen_->EmitReadBarrier(), type_check_kind);
   DCHECK_LE(num_temps, 1u);
   Location maybe_temp_loc = (num_temps >= 1) ? locations->GetTemp(0) : Location::NoLocation();
   uint32_t class_offset = mirror::Object::ClassOffset().Int32Value();
@@ -8059,7 +8144,7 @@
   switch (type_check_kind) {
     case TypeCheckKind::kExactCheck: {
       ReadBarrierOption read_barrier_option =
-          CodeGenerator::ReadBarrierOptionForInstanceOf(instruction);
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
       // /* HeapReference<Class> */ out = obj->klass_
       GenerateReferenceLoadTwoRegisters(instruction,
                                         out_loc,
@@ -8094,7 +8179,7 @@
 
     case TypeCheckKind::kAbstractClassCheck: {
       ReadBarrierOption read_barrier_option =
-          CodeGenerator::ReadBarrierOptionForInstanceOf(instruction);
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
       // /* HeapReference<Class> */ out = obj->klass_
       GenerateReferenceLoadTwoRegisters(instruction,
                                         out_loc,
@@ -8122,7 +8207,7 @@
 
     case TypeCheckKind::kClassHierarchyCheck: {
       ReadBarrierOption read_barrier_option =
-          CodeGenerator::ReadBarrierOptionForInstanceOf(instruction);
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
       // /* HeapReference<Class> */ out = obj->klass_
       GenerateReferenceLoadTwoRegisters(instruction,
                                         out_loc,
@@ -8178,7 +8263,7 @@
 
     case TypeCheckKind::kArrayObjectCheck: {
       ReadBarrierOption read_barrier_option =
-          CodeGenerator::ReadBarrierOptionForInstanceOf(instruction);
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
       // /* HeapReference<Class> */ out = obj->klass_
       GenerateReferenceLoadTwoRegisters(instruction,
                                         out_loc,
@@ -8307,7 +8392,7 @@
 
 void LocationsBuilderARMVIXL::VisitCheckCast(HCheckCast* instruction) {
   TypeCheckKind type_check_kind = instruction->GetTypeCheckKind();
-  LocationSummary::CallKind call_kind = CodeGenerator::GetCheckCastCallKind(instruction);
+  LocationSummary::CallKind call_kind = codegen_->GetCheckCastCallKind(instruction);
   LocationSummary* locations =
       new (GetGraph()->GetAllocator()) LocationSummary(instruction, call_kind);
   locations->SetInAt(0, Location::RequiresRegister());
@@ -8318,7 +8403,8 @@
   } else {
     locations->SetInAt(1, Location::RequiresRegister());
   }
-  locations->AddRegisterTemps(NumberOfCheckCastTemps(type_check_kind));
+  locations->AddRegisterTemps(
+      NumberOfCheckCastTemps(codegen_->EmitReadBarrier(), type_check_kind));
 }
 
 void InstructionCodeGeneratorARMVIXL::VisitCheckCast(HCheckCast* instruction) {
@@ -8331,7 +8417,7 @@
       : InputRegisterAt(instruction, 1);
   Location temp_loc = locations->GetTemp(0);
   vixl32::Register temp = RegisterFrom(temp_loc);
-  const size_t num_temps = NumberOfCheckCastTemps(type_check_kind);
+  const size_t num_temps = NumberOfCheckCastTemps(codegen_->EmitReadBarrier(), type_check_kind);
   DCHECK_LE(num_temps, 3u);
   Location maybe_temp2_loc = (num_temps >= 2) ? locations->GetTemp(1) : Location::NoLocation();
   Location maybe_temp3_loc = (num_temps >= 3) ? locations->GetTemp(2) : Location::NoLocation();
@@ -8344,7 +8430,7 @@
   const uint32_t object_array_data_offset =
       mirror::Array::DataOffset(kHeapReferenceSize).Uint32Value();
 
-  bool is_type_check_slow_path_fatal = CodeGenerator::IsTypeCheckSlowPathFatal(instruction);
+  bool is_type_check_slow_path_fatal = codegen_->IsTypeCheckSlowPathFatal(instruction);
   SlowPathCodeARMVIXL* type_check_slow_path =
       new (codegen_->GetScopedAllocator()) TypeCheckSlowPathARMVIXL(
           instruction, is_type_check_slow_path_fatal);
@@ -8490,12 +8576,11 @@
                                         kWithoutReadBarrier);
 
       // /* HeapReference<Class> */ temp = temp->iftable_
-      GenerateReferenceLoadTwoRegisters(instruction,
-                                        temp_loc,
-                                        temp_loc,
-                                        iftable_offset,
-                                        maybe_temp2_loc,
-                                        kWithoutReadBarrier);
+      GenerateReferenceLoadOneRegister(instruction,
+                                       temp_loc,
+                                       iftable_offset,
+                                       maybe_temp2_loc,
+                                       kWithoutReadBarrier);
       // Iftable is never null.
       __ Ldr(RegisterFrom(maybe_temp2_loc), MemOperand(temp, array_length_offset));
       // Loop through the iftable and check if any class matches.
@@ -8900,7 +8985,7 @@
     ReadBarrierOption read_barrier_option) {
   vixl32::Register out_reg = RegisterFrom(out);
   if (read_barrier_option == kWithReadBarrier) {
-    CHECK(gUseReadBarrier);
+    DCHECK(codegen_->EmitReadBarrier());
     DCHECK(maybe_temp.IsRegister()) << maybe_temp;
     if (kUseBakerReadBarrier) {
       // Load with fast path based Baker's read barrier.
@@ -8935,7 +9020,7 @@
   vixl32::Register out_reg = RegisterFrom(out);
   vixl32::Register obj_reg = RegisterFrom(obj);
   if (read_barrier_option == kWithReadBarrier) {
-    CHECK(gUseReadBarrier);
+    DCHECK(codegen_->EmitReadBarrier());
     if (kUseBakerReadBarrier) {
       DCHECK(maybe_temp.IsRegister()) << maybe_temp;
       // Load with fast path based Baker's read barrier.
@@ -8964,7 +9049,7 @@
     ReadBarrierOption read_barrier_option) {
   vixl32::Register root_reg = RegisterFrom(root);
   if (read_barrier_option == kWithReadBarrier) {
-    DCHECK(gUseReadBarrier);
+    DCHECK(EmitReadBarrier());
     if (kUseBakerReadBarrier) {
       // Fast path implementation of art::ReadBarrier::BarrierForRoot when
       // Baker's read barrier are used.
@@ -9025,11 +9110,10 @@
   MaybeGenerateMarkingRegisterCheck(/* code= */ 20);
 }
 
-void CodeGeneratorARMVIXL::GenerateIntrinsicCasMoveWithBakerReadBarrier(
+void CodeGeneratorARMVIXL::GenerateIntrinsicMoveWithBakerReadBarrier(
     vixl::aarch32::Register marked_old_value,
     vixl::aarch32::Register old_value) {
-  DCHECK(gUseReadBarrier);
-  DCHECK(kUseBakerReadBarrier);
+  DCHECK(EmitBakerReadBarrier());
 
   // Similar to the Baker RB path in GenerateGcRootFieldLoad(), with a MOV instead of LDR.
   // For low registers, we can reuse the GC root narrow entrypoint, for high registers
@@ -9062,8 +9146,7 @@
                                                                  vixl32::Register obj,
                                                                  const vixl32::MemOperand& src,
                                                                  bool needs_null_check) {
-  DCHECK(gUseReadBarrier);
-  DCHECK(kUseBakerReadBarrier);
+  DCHECK(EmitBakerReadBarrier());
 
   // Query `art::Thread::Current()->GetIsGcMarking()` (stored in the
   // Marking Register) to decide whether we need to enter the slow
@@ -9155,8 +9238,7 @@
                                                                  Location index,
                                                                  Location temp,
                                                                  bool needs_null_check) {
-  DCHECK(gUseReadBarrier);
-  DCHECK(kUseBakerReadBarrier);
+  DCHECK(EmitBakerReadBarrier());
 
   static_assert(
       sizeof(mirror::HeapReference<mirror::Object>) == sizeof(int32_t),
@@ -9221,7 +9303,7 @@
 
 void CodeGeneratorARMVIXL::MaybeGenerateMarkingRegisterCheck(int code, Location temp_loc) {
   // The following condition is a compile-time one, so it does not have a run-time cost.
-  if (kIsDebugBuild && gUseReadBarrier && kUseBakerReadBarrier) {
+  if (kIsDebugBuild && EmitBakerReadBarrier()) {
     // The following condition is a run-time one; it is executed after the
     // previous compile-time test, to avoid penalizing non-debug builds.
     if (GetCompilerOptions().EmitRunTimeChecksInDebugMode()) {
@@ -9251,7 +9333,7 @@
                                                    Location obj,
                                                    uint32_t offset,
                                                    Location index) {
-  DCHECK(gUseReadBarrier);
+  DCHECK(EmitReadBarrier());
 
   // Insert a slow path based read barrier *after* the reference load.
   //
@@ -9277,7 +9359,7 @@
                                                         Location obj,
                                                         uint32_t offset,
                                                         Location index) {
-  if (gUseReadBarrier) {
+  if (EmitReadBarrier()) {
     // Baker's read barriers shall be handled by the fast path
     // (CodeGeneratorARMVIXL::GenerateReferenceLoadWithBakerReadBarrier).
     DCHECK(!kUseBakerReadBarrier);
@@ -9292,7 +9374,7 @@
 void CodeGeneratorARMVIXL::GenerateReadBarrierForRootSlow(HInstruction* instruction,
                                                           Location out,
                                                           Location root) {
-  DCHECK(gUseReadBarrier);
+  DCHECK(EmitReadBarrier());
 
   // Insert a slow path based read barrier *after* the GC root load.
   //
@@ -9667,7 +9749,7 @@
 
 void CodeGeneratorARMVIXL::LoadTypeForBootImageIntrinsic(vixl::aarch32::Register reg,
                                                          TypeReference target_type) {
-  // Load the class the same way as for HLoadClass::LoadKind::kBootImageLinkTimePcRelative.
+  // Load the type the same way as for HLoadClass::LoadKind::kBootImageLinkTimePcRelative.
   DCHECK(GetCompilerOptions().IsBootImage() || GetCompilerOptions().IsBootImageExtension());
   PcRelativePatchInfo* labels =
       NewBootImageTypePatch(*target_type.dex_file, target_type.TypeIndex());
@@ -9828,7 +9910,7 @@
   assembler.FinalizeCode();
   code->resize(assembler.CodeSize());
   MemoryRegion code_region(code->data(), code->size());
-  assembler.FinalizeInstructions(code_region);
+  assembler.CopyInstructions(code_region);
 }
 
 VIXLUInt32Literal* CodeGeneratorARMVIXL::DeduplicateUint32Literal(
@@ -9867,12 +9949,12 @@
   }
 }
 
-void LocationsBuilderARMVIXL::VisitBoundType(HBoundType* instruction ATTRIBUTE_UNUSED) {
+void LocationsBuilderARMVIXL::VisitBoundType([[maybe_unused]] HBoundType* instruction) {
   // Nothing to do, this should be removed during prepare for register allocator.
   LOG(FATAL) << "Unreachable";
 }
 
-void InstructionCodeGeneratorARMVIXL::VisitBoundType(HBoundType* instruction ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorARMVIXL::VisitBoundType([[maybe_unused]] HBoundType* instruction) {
   // Nothing to do, this should be removed during prepare for register allocator.
   LOG(FATAL) << "Unreachable";
 }
diff --git a/compiler/optimizing/code_generator_arm_vixl.h b/compiler/optimizing/code_generator_arm_vixl.h
index f5abe69..35686df 100644
--- a/compiler/optimizing/code_generator_arm_vixl.h
+++ b/compiler/optimizing/code_generator_arm_vixl.h
@@ -162,22 +162,37 @@
   /* 1.8 */                                                                \
   V(MathFmaDouble)                                                         \
   V(MathFmaFloat)                                                          \
-  V(UnsafeGetAndAddInt)                                                    \
-  V(UnsafeGetAndAddLong)                                                   \
-  V(UnsafeGetAndSetInt)                                                    \
-  V(UnsafeGetAndSetLong)                                                   \
-  V(UnsafeGetAndSetObject)                                                 \
   V(MethodHandleInvokeExact)                                               \
   V(MethodHandleInvoke)                                                    \
   /* OpenJDK 11 */                                                         \
   V(JdkUnsafeCASLong) /* High register pressure */                         \
-  V(JdkUnsafeGetAndAddInt)                                                 \
-  V(JdkUnsafeGetAndAddLong)                                                \
-  V(JdkUnsafeGetAndSetInt)                                                 \
-  V(JdkUnsafeGetAndSetLong)                                                \
-  V(JdkUnsafeGetAndSetObject)                                              \
   V(JdkUnsafeCompareAndSetLong)
 
+ALWAYS_INLINE inline StoreOperandType GetStoreOperandType(DataType::Type type) {
+  switch (type) {
+    case DataType::Type::kReference:
+      return kStoreWord;
+    case DataType::Type::kBool:
+    case DataType::Type::kUint8:
+    case DataType::Type::kInt8:
+      return kStoreByte;
+    case DataType::Type::kUint16:
+    case DataType::Type::kInt16:
+      return kStoreHalfword;
+    case DataType::Type::kInt32:
+      return kStoreWord;
+    case DataType::Type::kInt64:
+      return kStoreWordPair;
+    case DataType::Type::kFloat32:
+      return kStoreSWord;
+    case DataType::Type::kFloat64:
+      return kStoreDWord;
+    default:
+      LOG(FATAL) << "Unreachable type " << type;
+      UNREACHABLE();
+  }
+}
+
 class JumpTableARMVIXL : public DeletableArenaObject<kArenaAllocSwitchTable> {
  public:
   explicit JumpTableARMVIXL(HPackedSwitch* switch_instr)
@@ -600,12 +615,26 @@
                                            HInstruction* instruction,
                                            SlowPathCode* slow_path);
 
-  // Emit a write barrier.
+  // Emit a write barrier if:
+  // A) emit_null_check is false
+  // B) emit_null_check is true, and value is not null.
+  void MaybeMarkGCCard(vixl::aarch32::Register temp,
+                       vixl::aarch32::Register card,
+                       vixl::aarch32::Register object,
+                       vixl::aarch32::Register value,
+                       bool emit_null_check);
+
+  // Emit a write barrier unconditionally.
   void MarkGCCard(vixl::aarch32::Register temp,
                   vixl::aarch32::Register card,
-                  vixl::aarch32::Register object,
-                  vixl::aarch32::Register value,
-                  bool emit_null_check);
+                  vixl::aarch32::Register object);
+
+  // Crash if the card table is not valid. This check is only emitted for the CC GC. We assert
+  // `(!clean || !self->is_gc_marking)`, since the card table should not be set to clean when the CC
+  // GC is marking for eliminated write barriers.
+  void CheckGCCardIsValid(vixl::aarch32::Register temp,
+                          vixl::aarch32::Register card,
+                          vixl::aarch32::Register object);
 
   void GenerateMemoryBarrier(MemBarrierKind kind);
 
@@ -620,7 +649,7 @@
     block_labels_.resize(GetGraph()->GetBlocks().size());
   }
 
-  void Finalize(CodeAllocator* allocator) override;
+  void Finalize() override;
 
   bool NeedsTwoRegisters(DataType::Type type) const override {
     return type == DataType::Type::kFloat64 || type == DataType::Type::kInt64;
@@ -725,9 +754,9 @@
                                vixl::aarch32::Register obj,
                                uint32_t offset,
                                ReadBarrierOption read_barrier_option);
-  // Generate MOV for an intrinsic CAS to mark the old value with Baker read barrier.
-  void GenerateIntrinsicCasMoveWithBakerReadBarrier(vixl::aarch32::Register marked_old_value,
-                                                    vixl::aarch32::Register old_value);
+  // Generate MOV for an intrinsic to mark the old value with Baker read barrier.
+  void GenerateIntrinsicMoveWithBakerReadBarrier(vixl::aarch32::Register marked_old_value,
+                                                 vixl::aarch32::Register old_value);
   // Fast path implementation of ReadBarrier::Barrier for a heap
   // reference field load when Baker's read barriers are used.
   // Overload suitable for Unsafe.getObject/-Volatile() intrinsic.
@@ -870,7 +899,7 @@
   }
 
   void MaybeGenerateInlineCacheCheck(HInstruction* instruction, vixl32::Register klass);
-  void MaybeIncrementHotness(bool is_frame_entry);
+  void MaybeIncrementHotness(HSuspendCheck* suspend_check, bool is_frame_entry);
 
  private:
   // Encoding of thunk type and data for link-time generated thunks for Baker read barriers.
diff --git a/compiler/optimizing/code_generator_riscv64.cc b/compiler/optimizing/code_generator_riscv64.cc
new file mode 100644
index 0000000..abbd74a
--- /dev/null
+++ b/compiler/optimizing/code_generator_riscv64.cc
@@ -0,0 +1,6942 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "code_generator_riscv64.h"
+
+#include "android-base/logging.h"
+#include "android-base/macros.h"
+#include "arch/riscv64/jni_frame_riscv64.h"
+#include "arch/riscv64/registers_riscv64.h"
+#include "base/arena_containers.h"
+#include "base/macros.h"
+#include "class_root-inl.h"
+#include "code_generator_utils.h"
+#include "dwarf/register.h"
+#include "gc/heap.h"
+#include "gc/space/image_space.h"
+#include "heap_poisoning.h"
+#include "intrinsics_list.h"
+#include "intrinsics_riscv64.h"
+#include "jit/profiling_info.h"
+#include "linker/linker_patch.h"
+#include "mirror/class-inl.h"
+#include "optimizing/nodes.h"
+#include "optimizing/profiling_info_builder.h"
+#include "runtime.h"
+#include "scoped_thread_state_change-inl.h"
+#include "stack_map_stream.h"
+#include "trace.h"
+#include "utils/label.h"
+#include "utils/riscv64/assembler_riscv64.h"
+#include "utils/stack_checks.h"
+
+namespace art HIDDEN {
+namespace riscv64 {
+
+// Placeholder values embedded in instructions, patched at link time.
+constexpr uint32_t kLinkTimeOffsetPlaceholderHigh = 0x12345;
+constexpr uint32_t kLinkTimeOffsetPlaceholderLow = 0x678;
+
+// Compare-and-jump packed switch generates approx. 3 + 1.5 * N 32-bit
+// instructions for N cases.
+// Table-based packed switch generates approx. 10 32-bit instructions
+// and N 32-bit data words for N cases.
+// We switch to the table-based method starting with 6 entries.
+static constexpr uint32_t kPackedSwitchCompareJumpThreshold = 6;
+
+static constexpr XRegister kCoreCalleeSaves[] = {
+    // S1(TR) is excluded as the ART thread register.
+    S0, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11, RA
+};
+
+static constexpr FRegister kFpuCalleeSaves[] = {
+    FS0, FS1, FS2, FS3, FS4, FS5, FS6, FS7, FS8, FS9, FS10, FS11
+};
+
+#define QUICK_ENTRY_POINT(x) QUICK_ENTRYPOINT_OFFSET(kRiscv64PointerSize, x).Int32Value()
+
+Location RegisterOrZeroBitPatternLocation(HInstruction* instruction) {
+  DCHECK(!DataType::IsFloatingPointType(instruction->GetType()));
+  return IsZeroBitPattern(instruction)
+      ? Location::ConstantLocation(instruction)
+      : Location::RequiresRegister();
+}
+
+Location FpuRegisterOrZeroBitPatternLocation(HInstruction* instruction) {
+  DCHECK(DataType::IsFloatingPointType(instruction->GetType()));
+  return IsZeroBitPattern(instruction)
+      ? Location::ConstantLocation(instruction)
+      : Location::RequiresFpuRegister();
+}
+
+XRegister InputXRegisterOrZero(Location location) {
+  if (location.IsConstant()) {
+    DCHECK(location.GetConstant()->IsZeroBitPattern());
+    return Zero;
+  } else {
+    return location.AsRegister<XRegister>();
+  }
+}
+
+Location ValueLocationForStore(HInstruction* value) {
+  if (IsZeroBitPattern(value)) {
+    return Location::ConstantLocation(value);
+  } else if (DataType::IsFloatingPointType(value->GetType())) {
+    return Location::RequiresFpuRegister();
+  } else {
+    return Location::RequiresRegister();
+  }
+}
+
+Location Riscv64ReturnLocation(DataType::Type return_type) {
+  switch (return_type) {
+    case DataType::Type::kBool:
+    case DataType::Type::kUint8:
+    case DataType::Type::kInt8:
+    case DataType::Type::kUint16:
+    case DataType::Type::kInt16:
+    case DataType::Type::kUint32:
+    case DataType::Type::kInt32:
+    case DataType::Type::kReference:
+    case DataType::Type::kUint64:
+    case DataType::Type::kInt64:
+      return Location::RegisterLocation(A0);
+
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64:
+      return Location::FpuRegisterLocation(FA0);
+
+    case DataType::Type::kVoid:
+      return Location::NoLocation();
+  }
+  UNREACHABLE();
+}
+
+static RegisterSet OneRegInReferenceOutSaveEverythingCallerSaves() {
+  InvokeRuntimeCallingConvention calling_convention;
+  RegisterSet caller_saves = RegisterSet::Empty();
+  caller_saves.Add(Location::RegisterLocation(calling_convention.GetRegisterAt(0)));
+  DCHECK_EQ(
+      calling_convention.GetRegisterAt(0),
+      calling_convention.GetReturnLocation(DataType::Type::kReference).AsRegister<XRegister>());
+  return caller_saves;
+}
+
+template <ClassStatus kStatus>
+static constexpr int64_t ShiftedSignExtendedClassStatusValue() {
+  // This is used only for status values that have the highest bit set.
+  static_assert(CLZ(enum_cast<uint32_t>(kStatus)) == status_lsb_position);
+  constexpr uint32_t kShiftedStatusValue = enum_cast<uint32_t>(kStatus) << status_lsb_position;
+  static_assert(kShiftedStatusValue >= 0x80000000u);
+  return static_cast<int64_t>(kShiftedStatusValue) - (INT64_C(1) << 32);
+}
+
+// Split a 64-bit address used by JIT to the nearest 4KiB-aligned base address and a 12-bit
+// signed offset. It is usually cheaper to materialize the aligned address than the full address.
+std::pair<uint64_t, int32_t> SplitJitAddress(uint64_t address) {
+  uint64_t bits0_11 = address & UINT64_C(0xfff);
+  uint64_t bit11 = address & UINT64_C(0x800);
+  // Round the address to nearest 4KiB address because the `imm12` has range [-0x800, 0x800).
+  uint64_t base_address = (address & ~UINT64_C(0xfff)) + (bit11 << 1);
+  int32_t imm12 = dchecked_integral_cast<int32_t>(bits0_11) -
+                  dchecked_integral_cast<int32_t>(bit11 << 1);
+  return {base_address, imm12};
+}
+
+int32_t ReadBarrierMarkEntrypointOffset(Location ref) {
+  DCHECK(ref.IsRegister());
+  int reg = ref.reg();
+  DCHECK(T0 <= reg && reg <= T6 && reg != TR) << reg;
+  // Note: Entrypoints for registers X30 (T5) and X31 (T6) are stored in entries
+  // for X0 (Zero) and X1 (RA) because these are not valid registers for marking
+  // and we currently have slots only up to register 29.
+  int entry_point_number = (reg >= 30) ? reg - 30 : reg;
+  return Thread::ReadBarrierMarkEntryPointsOffset<kRiscv64PointerSize>(entry_point_number);
+}
+
+Location InvokeRuntimeCallingConvention::GetReturnLocation(DataType::Type return_type) {
+  return Riscv64ReturnLocation(return_type);
+}
+
+Location InvokeDexCallingConventionVisitorRISCV64::GetReturnLocation(DataType::Type type) const {
+  return Riscv64ReturnLocation(type);
+}
+
+Location InvokeDexCallingConventionVisitorRISCV64::GetMethodLocation() const {
+  return Location::RegisterLocation(kArtMethodRegister);
+}
+
+Location InvokeDexCallingConventionVisitorRISCV64::GetNextLocation(DataType::Type type) {
+  Location next_location;
+  if (type == DataType::Type::kVoid) {
+    LOG(FATAL) << "Unexpected parameter type " << type;
+  }
+
+  // Note: Unlike the RISC-V C/C++ calling convention, managed ABI does not use
+  // GPRs to pass FP args when we run out of FPRs.
+  if (DataType::IsFloatingPointType(type) &&
+      float_index_ < calling_convention.GetNumberOfFpuRegisters()) {
+    next_location =
+        Location::FpuRegisterLocation(calling_convention.GetFpuRegisterAt(float_index_++));
+  } else if (!DataType::IsFloatingPointType(type) &&
+             (gp_index_ < calling_convention.GetNumberOfRegisters())) {
+    next_location = Location::RegisterLocation(calling_convention.GetRegisterAt(gp_index_++));
+  } else {
+    size_t stack_offset = calling_convention.GetStackOffsetOf(stack_index_);
+    next_location = DataType::Is64BitType(type) ? Location::DoubleStackSlot(stack_offset) :
+                                                  Location::StackSlot(stack_offset);
+  }
+
+  // Space on the stack is reserved for all arguments.
+  stack_index_ += DataType::Is64BitType(type) ? 2 : 1;
+
+  return next_location;
+}
+
+Location CriticalNativeCallingConventionVisitorRiscv64::GetNextLocation(DataType::Type type) {
+  DCHECK_NE(type, DataType::Type::kReference);
+
+  Location location = Location::NoLocation();
+  if (DataType::IsFloatingPointType(type)) {
+    if (fpr_index_ < kParameterFpuRegistersLength) {
+      location = Location::FpuRegisterLocation(kParameterFpuRegisters[fpr_index_]);
+      ++fpr_index_;
+    } else {
+      // Native ABI allows passing excessive FP args in GPRs. This is facilitated by
+      // inserting fake conversion intrinsic calls (`Double.doubleToRawLongBits()`
+      // or `Float.floatToRawIntBits()`) by `CriticalNativeAbiFixupRiscv64`.
+      // Remaining FP args shall be passed on the stack.
+      CHECK_EQ(gpr_index_, kRuntimeParameterCoreRegistersLength);
+    }
+  } else {
+    // Native ABI uses the same core registers as a runtime call.
+    if (gpr_index_ < kRuntimeParameterCoreRegistersLength) {
+      location = Location::RegisterLocation(kRuntimeParameterCoreRegisters[gpr_index_]);
+      ++gpr_index_;
+    }
+  }
+  if (location.IsInvalid()) {
+    // Only a `float` gets a single slot. Integral args need to be sign-extended to 64 bits.
+    if (type == DataType::Type::kFloat32) {
+      location = Location::StackSlot(stack_offset_);
+    } else {
+      location = Location::DoubleStackSlot(stack_offset_);
+    }
+    stack_offset_ += kFramePointerSize;
+
+    if (for_register_allocation_) {
+      location = Location::Any();
+    }
+  }
+  return location;
+}
+
+Location CriticalNativeCallingConventionVisitorRiscv64::GetReturnLocation(
+    DataType::Type type) const {
+  // The result is returned the same way in native ABI and managed ABI. No result conversion is
+  // needed, see comments in `Riscv64JniCallingConvention::RequiresSmallResultTypeExtension()`.
+  InvokeDexCallingConventionVisitorRISCV64 dex_calling_convention;
+  return dex_calling_convention.GetReturnLocation(type);
+}
+
+Location CriticalNativeCallingConventionVisitorRiscv64::GetMethodLocation() const {
+  // Pass the method in the hidden argument T0.
+  return Location::RegisterLocation(T0);
+}
+
+#define __ down_cast<CodeGeneratorRISCV64*>(codegen)->GetAssembler()->  // NOLINT
+
+void LocationsBuilderRISCV64::HandleInvoke(HInvoke* instruction) {
+  InvokeDexCallingConventionVisitorRISCV64 calling_convention_visitor;
+  CodeGenerator::CreateCommonInvokeLocationSummary(instruction, &calling_convention_visitor);
+}
+
+class CompileOptimizedSlowPathRISCV64 : public SlowPathCodeRISCV64 {
+ public:
+  CompileOptimizedSlowPathRISCV64(HSuspendCheck* suspend_check, XRegister base, int32_t imm12)
+      : SlowPathCodeRISCV64(suspend_check),
+        base_(base),
+        imm12_(imm12) {}
+
+  void EmitNativeCode(CodeGenerator* codegen) override {
+    uint32_t entrypoint_offset =
+        GetThreadOffset<kRiscv64PointerSize>(kQuickCompileOptimized).Int32Value();
+    __ Bind(GetEntryLabel());
+    CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen);
+    riscv64::ScratchRegisterScope srs(riscv64_codegen->GetAssembler());
+    XRegister counter = srs.AllocateXRegister();
+    __ LoadConst32(counter, ProfilingInfo::GetOptimizeThreshold());
+    __ Sh(counter, base_, imm12_);
+    if (instruction_ != nullptr) {
+      // Only saves live vector regs for SIMD.
+      SaveLiveRegisters(codegen, instruction_->GetLocations());
+    }
+    __ Loadd(RA, TR, entrypoint_offset);
+    // Note: we don't record the call here (and therefore don't generate a stack
+    // map), as the entrypoint should never be suspended.
+    __ Jalr(RA);
+    if (instruction_ != nullptr) {
+      // Only restores live vector regs for SIMD.
+      RestoreLiveRegisters(codegen, instruction_->GetLocations());
+    }
+    __ J(GetExitLabel());
+  }
+
+  const char* GetDescription() const override { return "CompileOptimizedSlowPath"; }
+
+ private:
+  XRegister base_;
+  const int32_t imm12_;
+
+  DISALLOW_COPY_AND_ASSIGN(CompileOptimizedSlowPathRISCV64);
+};
+
+class SuspendCheckSlowPathRISCV64 : public SlowPathCodeRISCV64 {
+ public:
+  SuspendCheckSlowPathRISCV64(HSuspendCheck* instruction, HBasicBlock* successor)
+      : SlowPathCodeRISCV64(instruction), successor_(successor) {}
+
+  void EmitNativeCode(CodeGenerator* codegen) override {
+    LocationSummary* locations = instruction_->GetLocations();
+    CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen);
+    __ Bind(GetEntryLabel());
+    SaveLiveRegisters(codegen, locations);  // Only saves live vector registers for SIMD.
+    riscv64_codegen->InvokeRuntime(kQuickTestSuspend, instruction_, instruction_->GetDexPc(), this);
+    CheckEntrypointTypes<kQuickTestSuspend, void, void>();
+    RestoreLiveRegisters(codegen, locations);  // Only restores live vector registers for SIMD.
+    if (successor_ == nullptr) {
+      __ J(GetReturnLabel());
+    } else {
+      __ J(riscv64_codegen->GetLabelOf(successor_));
+    }
+  }
+
+  Riscv64Label* GetReturnLabel() {
+    DCHECK(successor_ == nullptr);
+    return &return_label_;
+  }
+
+  const char* GetDescription() const override { return "SuspendCheckSlowPathRISCV64"; }
+
+  HBasicBlock* GetSuccessor() const { return successor_; }
+
+ private:
+  // If not null, the block to branch to after the suspend check.
+  HBasicBlock* const successor_;
+
+  // If `successor_` is null, the label to branch to after the suspend check.
+  Riscv64Label return_label_;
+
+  DISALLOW_COPY_AND_ASSIGN(SuspendCheckSlowPathRISCV64);
+};
+
+class NullCheckSlowPathRISCV64 : public SlowPathCodeRISCV64 {
+ public:
+  explicit NullCheckSlowPathRISCV64(HNullCheck* instr) : SlowPathCodeRISCV64(instr) {}
+
+  void EmitNativeCode(CodeGenerator* codegen) override {
+    CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen);
+    __ Bind(GetEntryLabel());
+    if (instruction_->CanThrowIntoCatchBlock()) {
+      // Live registers will be restored in the catch block if caught.
+      SaveLiveRegisters(codegen, instruction_->GetLocations());
+    }
+    riscv64_codegen->InvokeRuntime(
+        kQuickThrowNullPointer, instruction_, instruction_->GetDexPc(), this);
+    CheckEntrypointTypes<kQuickThrowNullPointer, void, void>();
+  }
+
+  bool IsFatal() const override { return true; }
+
+  const char* GetDescription() const override { return "NullCheckSlowPathRISCV64"; }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(NullCheckSlowPathRISCV64);
+};
+
+class BoundsCheckSlowPathRISCV64 : public SlowPathCodeRISCV64 {
+ public:
+  explicit BoundsCheckSlowPathRISCV64(HBoundsCheck* instruction)
+      : SlowPathCodeRISCV64(instruction) {}
+
+  void EmitNativeCode(CodeGenerator* codegen) override {
+    LocationSummary* locations = instruction_->GetLocations();
+    CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen);
+    __ Bind(GetEntryLabel());
+    if (instruction_->CanThrowIntoCatchBlock()) {
+      // Live registers will be restored in the catch block if caught.
+      SaveLiveRegisters(codegen, instruction_->GetLocations());
+    }
+    // We're moving two locations to locations that could overlap, so we need a parallel
+    // move resolver.
+    InvokeRuntimeCallingConvention calling_convention;
+    codegen->EmitParallelMoves(locations->InAt(0),
+                               Location::RegisterLocation(calling_convention.GetRegisterAt(0)),
+                               DataType::Type::kInt32,
+                               locations->InAt(1),
+                               Location::RegisterLocation(calling_convention.GetRegisterAt(1)),
+                               DataType::Type::kInt32);
+    QuickEntrypointEnum entrypoint = instruction_->AsBoundsCheck()->IsStringCharAt() ?
+                                         kQuickThrowStringBounds :
+                                         kQuickThrowArrayBounds;
+    riscv64_codegen->InvokeRuntime(entrypoint, instruction_, instruction_->GetDexPc(), this);
+    CheckEntrypointTypes<kQuickThrowStringBounds, void, int32_t, int32_t>();
+    CheckEntrypointTypes<kQuickThrowArrayBounds, void, int32_t, int32_t>();
+  }
+
+  bool IsFatal() const override { return true; }
+
+  const char* GetDescription() const override { return "BoundsCheckSlowPathRISCV64"; }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(BoundsCheckSlowPathRISCV64);
+};
+
+class LoadClassSlowPathRISCV64 : public SlowPathCodeRISCV64 {
+ public:
+  LoadClassSlowPathRISCV64(HLoadClass* cls, HInstruction* at) : SlowPathCodeRISCV64(at), cls_(cls) {
+    DCHECK(at->IsLoadClass() || at->IsClinitCheck());
+    DCHECK_EQ(instruction_->IsLoadClass(), cls_ == instruction_);
+  }
+
+  void EmitNativeCode(CodeGenerator* codegen) override {
+    LocationSummary* locations = instruction_->GetLocations();
+    Location out = locations->Out();
+    const uint32_t dex_pc = instruction_->GetDexPc();
+    bool must_resolve_type = instruction_->IsLoadClass() && cls_->MustResolveTypeOnSlowPath();
+    bool must_do_clinit = instruction_->IsClinitCheck() || cls_->MustGenerateClinitCheck();
+
+    CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen);
+    __ Bind(GetEntryLabel());
+    SaveLiveRegisters(codegen, locations);
+
+    InvokeRuntimeCallingConvention calling_convention;
+    if (must_resolve_type) {
+      DCHECK(IsSameDexFile(cls_->GetDexFile(), riscv64_codegen->GetGraph()->GetDexFile()) ||
+             riscv64_codegen->GetCompilerOptions().WithinOatFile(&cls_->GetDexFile()) ||
+             ContainsElement(Runtime::Current()->GetClassLinker()->GetBootClassPath(),
+                             &cls_->GetDexFile()));
+      dex::TypeIndex type_index = cls_->GetTypeIndex();
+      __ LoadConst32(calling_convention.GetRegisterAt(0), type_index.index_);
+      if (cls_->NeedsAccessCheck()) {
+        CheckEntrypointTypes<kQuickResolveTypeAndVerifyAccess, void*, uint32_t>();
+        riscv64_codegen->InvokeRuntime(
+            kQuickResolveTypeAndVerifyAccess, instruction_, dex_pc, this);
+      } else {
+        CheckEntrypointTypes<kQuickResolveType, void*, uint32_t>();
+        riscv64_codegen->InvokeRuntime(kQuickResolveType, instruction_, dex_pc, this);
+      }
+      // If we also must_do_clinit, the resolved type is now in the correct register.
+    } else {
+      DCHECK(must_do_clinit);
+      Location source = instruction_->IsLoadClass() ? out : locations->InAt(0);
+      riscv64_codegen->MoveLocation(
+          Location::RegisterLocation(calling_convention.GetRegisterAt(0)), source, cls_->GetType());
+    }
+    if (must_do_clinit) {
+      riscv64_codegen->InvokeRuntime(kQuickInitializeStaticStorage, instruction_, dex_pc, this);
+      CheckEntrypointTypes<kQuickInitializeStaticStorage, void*, mirror::Class*>();
+    }
+
+    // Move the class to the desired location.
+    if (out.IsValid()) {
+      DCHECK(out.IsRegister() && !locations->GetLiveRegisters()->ContainsCoreRegister(out.reg()));
+      DataType::Type type = DataType::Type::kReference;
+      DCHECK_EQ(type, instruction_->GetType());
+      riscv64_codegen->MoveLocation(out, calling_convention.GetReturnLocation(type), type);
+    }
+    RestoreLiveRegisters(codegen, locations);
+
+    __ J(GetExitLabel());
+  }
+
+  const char* GetDescription() const override { return "LoadClassSlowPathRISCV64"; }
+
+ private:
+  // The class this slow path will load.
+  HLoadClass* const cls_;
+
+  DISALLOW_COPY_AND_ASSIGN(LoadClassSlowPathRISCV64);
+};
+
+class DeoptimizationSlowPathRISCV64 : public SlowPathCodeRISCV64 {
+ public:
+  explicit DeoptimizationSlowPathRISCV64(HDeoptimize* instruction)
+      : SlowPathCodeRISCV64(instruction) {}
+
+  void EmitNativeCode(CodeGenerator* codegen) override {
+    CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen);
+    __ Bind(GetEntryLabel());
+    LocationSummary* locations = instruction_->GetLocations();
+    SaveLiveRegisters(codegen, locations);
+    InvokeRuntimeCallingConvention calling_convention;
+    __ LoadConst32(calling_convention.GetRegisterAt(0),
+                   static_cast<uint32_t>(instruction_->AsDeoptimize()->GetDeoptimizationKind()));
+    riscv64_codegen->InvokeRuntime(kQuickDeoptimize, instruction_, instruction_->GetDexPc(), this);
+    CheckEntrypointTypes<kQuickDeoptimize, void, DeoptimizationKind>();
+  }
+
+  const char* GetDescription() const override { return "DeoptimizationSlowPathRISCV64"; }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(DeoptimizationSlowPathRISCV64);
+};
+
+// Slow path generating a read barrier for a GC root.
+class ReadBarrierForRootSlowPathRISCV64 : public SlowPathCodeRISCV64 {
+ public:
+  ReadBarrierForRootSlowPathRISCV64(HInstruction* instruction, Location out, Location root)
+      : SlowPathCodeRISCV64(instruction), out_(out), root_(root) {
+  }
+
+  void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitReadBarrier());
+    LocationSummary* locations = instruction_->GetLocations();
+    DataType::Type type = DataType::Type::kReference;
+    XRegister reg_out = out_.AsRegister<XRegister>();
+    DCHECK(locations->CanCall());
+    DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(reg_out));
+    DCHECK(instruction_->IsLoadClass() ||
+           instruction_->IsLoadString() ||
+           (instruction_->IsInvoke() && instruction_->GetLocations()->Intrinsified()))
+        << "Unexpected instruction in read barrier for GC root slow path: "
+        << instruction_->DebugName();
+
+    __ Bind(GetEntryLabel());
+    SaveLiveRegisters(codegen, locations);
+
+    InvokeRuntimeCallingConvention calling_convention;
+    CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen);
+    riscv64_codegen->MoveLocation(Location::RegisterLocation(calling_convention.GetRegisterAt(0)),
+                                  root_,
+                                  DataType::Type::kReference);
+    riscv64_codegen->InvokeRuntime(kQuickReadBarrierForRootSlow,
+                                   instruction_,
+                                   instruction_->GetDexPc(),
+                                   this);
+    CheckEntrypointTypes<kQuickReadBarrierForRootSlow, mirror::Object*, GcRoot<mirror::Object>*>();
+    riscv64_codegen->MoveLocation(out_, calling_convention.GetReturnLocation(type), type);
+
+    RestoreLiveRegisters(codegen, locations);
+    __ J(GetExitLabel());
+  }
+
+  const char* GetDescription() const override { return "ReadBarrierForRootSlowPathRISCV64"; }
+
+ private:
+  const Location out_;
+  const Location root_;
+
+  DISALLOW_COPY_AND_ASSIGN(ReadBarrierForRootSlowPathRISCV64);
+};
+
+class MethodEntryExitHooksSlowPathRISCV64 : public SlowPathCodeRISCV64 {
+ public:
+  explicit MethodEntryExitHooksSlowPathRISCV64(HInstruction* instruction)
+      : SlowPathCodeRISCV64(instruction) {}
+
+  void EmitNativeCode(CodeGenerator* codegen) override {
+    LocationSummary* locations = instruction_->GetLocations();
+    QuickEntrypointEnum entry_point =
+        (instruction_->IsMethodEntryHook()) ? kQuickMethodEntryHook : kQuickMethodExitHook;
+    CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen);
+    __ Bind(GetEntryLabel());
+    SaveLiveRegisters(codegen, locations);
+    if (instruction_->IsMethodExitHook()) {
+      __ Li(A4, riscv64_codegen->GetFrameSize());
+    }
+    riscv64_codegen->InvokeRuntime(entry_point, instruction_, instruction_->GetDexPc(), this);
+    RestoreLiveRegisters(codegen, locations);
+    __ J(GetExitLabel());
+  }
+
+  const char* GetDescription() const override {
+    return "MethodEntryExitHooksSlowPathRISCV";
+  }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(MethodEntryExitHooksSlowPathRISCV64);
+};
+
+class ArraySetSlowPathRISCV64 : public SlowPathCodeRISCV64 {
+ public:
+  explicit ArraySetSlowPathRISCV64(HInstruction* instruction) : SlowPathCodeRISCV64(instruction) {}
+
+  void EmitNativeCode(CodeGenerator* codegen) override {
+    LocationSummary* locations = instruction_->GetLocations();
+    __ Bind(GetEntryLabel());
+    SaveLiveRegisters(codegen, locations);
+
+    InvokeRuntimeCallingConvention calling_convention;
+    HParallelMove parallel_move(codegen->GetGraph()->GetAllocator());
+    parallel_move.AddMove(
+        locations->InAt(0),
+        Location::RegisterLocation(calling_convention.GetRegisterAt(0)),
+        DataType::Type::kReference,
+        nullptr);
+    parallel_move.AddMove(
+        locations->InAt(1),
+        Location::RegisterLocation(calling_convention.GetRegisterAt(1)),
+        DataType::Type::kInt32,
+        nullptr);
+    parallel_move.AddMove(
+        locations->InAt(2),
+        Location::RegisterLocation(calling_convention.GetRegisterAt(2)),
+        DataType::Type::kReference,
+        nullptr);
+    codegen->GetMoveResolver()->EmitNativeCode(&parallel_move);
+
+    CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen);
+    riscv64_codegen->InvokeRuntime(kQuickAputObject, instruction_, instruction_->GetDexPc(), this);
+    CheckEntrypointTypes<kQuickAputObject, void, mirror::Array*, int32_t, mirror::Object*>();
+    RestoreLiveRegisters(codegen, locations);
+    __ J(GetExitLabel());
+  }
+
+  const char* GetDescription() const override { return "ArraySetSlowPathRISCV64"; }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(ArraySetSlowPathRISCV64);
+};
+
+class TypeCheckSlowPathRISCV64 : public SlowPathCodeRISCV64 {
+ public:
+  explicit TypeCheckSlowPathRISCV64(HInstruction* instruction, bool is_fatal)
+      : SlowPathCodeRISCV64(instruction), is_fatal_(is_fatal) {}
+
+  void EmitNativeCode(CodeGenerator* codegen) override {
+    LocationSummary* locations = instruction_->GetLocations();
+
+    uint32_t dex_pc = instruction_->GetDexPc();
+    DCHECK(instruction_->IsCheckCast()
+           || !locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg()));
+    CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen);
+
+    __ Bind(GetEntryLabel());
+    if (!is_fatal_ || instruction_->CanThrowIntoCatchBlock()) {
+      SaveLiveRegisters(codegen, locations);
+    }
+
+    // We're moving two locations to locations that could overlap, so we need a parallel
+    // move resolver.
+    InvokeRuntimeCallingConvention calling_convention;
+    codegen->EmitParallelMoves(locations->InAt(0),
+                               Location::RegisterLocation(calling_convention.GetRegisterAt(0)),
+                               DataType::Type::kReference,
+                               locations->InAt(1),
+                               Location::RegisterLocation(calling_convention.GetRegisterAt(1)),
+                               DataType::Type::kReference);
+    if (instruction_->IsInstanceOf()) {
+      riscv64_codegen->InvokeRuntime(kQuickInstanceofNonTrivial, instruction_, dex_pc, this);
+      CheckEntrypointTypes<kQuickInstanceofNonTrivial, size_t, mirror::Object*, mirror::Class*>();
+      DataType::Type ret_type = instruction_->GetType();
+      Location ret_loc = calling_convention.GetReturnLocation(ret_type);
+      riscv64_codegen->MoveLocation(locations->Out(), ret_loc, ret_type);
+    } else {
+      DCHECK(instruction_->IsCheckCast());
+      riscv64_codegen->InvokeRuntime(kQuickCheckInstanceOf, instruction_, dex_pc, this);
+      CheckEntrypointTypes<kQuickCheckInstanceOf, void, mirror::Object*, mirror::Class*>();
+    }
+
+    if (!is_fatal_) {
+      RestoreLiveRegisters(codegen, locations);
+      __ J(GetExitLabel());
+    }
+  }
+
+  const char* GetDescription() const override { return "TypeCheckSlowPathRISCV64"; }
+
+  bool IsFatal() const override { return is_fatal_; }
+
+ private:
+  const bool is_fatal_;
+
+  DISALLOW_COPY_AND_ASSIGN(TypeCheckSlowPathRISCV64);
+};
+
+class DivZeroCheckSlowPathRISCV64 : public SlowPathCodeRISCV64 {
+ public:
+  explicit DivZeroCheckSlowPathRISCV64(HDivZeroCheck* instruction)
+      : SlowPathCodeRISCV64(instruction) {}
+
+  void EmitNativeCode(CodeGenerator* codegen) override {
+    CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen);
+    __ Bind(GetEntryLabel());
+    riscv64_codegen->InvokeRuntime(
+        kQuickThrowDivZero, instruction_, instruction_->GetDexPc(), this);
+    CheckEntrypointTypes<kQuickThrowDivZero, void, void>();
+  }
+
+  bool IsFatal() const override { return true; }
+
+  const char* GetDescription() const override { return "DivZeroCheckSlowPathRISCV64"; }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(DivZeroCheckSlowPathRISCV64);
+};
+
+class ReadBarrierMarkSlowPathRISCV64 : public SlowPathCodeRISCV64 {
+ public:
+  ReadBarrierMarkSlowPathRISCV64(HInstruction* instruction, Location ref, Location entrypoint)
+      : SlowPathCodeRISCV64(instruction), ref_(ref), entrypoint_(entrypoint) {
+    DCHECK(entrypoint.IsRegister());
+  }
+
+  const char* GetDescription() const override { return "ReadBarrierMarkSlowPathRISCV64"; }
+
+  void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitReadBarrier());
+    LocationSummary* locations = instruction_->GetLocations();
+    XRegister ref_reg = ref_.AsRegister<XRegister>();
+    DCHECK(locations->CanCall());
+    DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(ref_reg)) << ref_reg;
+    DCHECK(instruction_->IsInstanceFieldGet() ||
+           instruction_->IsStaticFieldGet() ||
+           instruction_->IsArrayGet() ||
+           instruction_->IsArraySet() ||
+           instruction_->IsLoadClass() ||
+           instruction_->IsLoadString() ||
+           instruction_->IsInstanceOf() ||
+           instruction_->IsCheckCast() ||
+           (instruction_->IsInvoke() && instruction_->GetLocations()->Intrinsified()))
+        << "Unexpected instruction in read barrier marking slow path: "
+        << instruction_->DebugName();
+
+    __ Bind(GetEntryLabel());
+    // No need to save live registers; it's taken care of by the
+    // entrypoint. Also, there is no need to update the stack mask,
+    // as this runtime call will not trigger a garbage collection.
+    CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen);
+    DCHECK(ref_reg >= T0 && ref_reg != TR);
+
+    // "Compact" slow path, saving two moves.
+    //
+    // Instead of using the standard runtime calling convention (input
+    // and output in A0 and V0 respectively):
+    //
+    //   A0 <- ref
+    //   V0 <- ReadBarrierMark(A0)
+    //   ref <- V0
+    //
+    // we just use rX (the register containing `ref`) as input and output
+    // of a dedicated entrypoint:
+    //
+    //   rX <- ReadBarrierMarkRegX(rX)
+    //
+    riscv64_codegen->ValidateInvokeRuntimeWithoutRecordingPcInfo(instruction_, this);
+    DCHECK_NE(entrypoint_.AsRegister<XRegister>(), TMP);  // A taken branch can clobber `TMP`.
+    __ Jalr(entrypoint_.AsRegister<XRegister>());  // Clobbers `RA` (used as the `entrypoint_`).
+    __ J(GetExitLabel());
+  }
+
+ private:
+  // The location (register) of the marked object reference.
+  const Location ref_;
+
+  // The location of the already loaded entrypoint.
+  const Location entrypoint_;
+
+  DISALLOW_COPY_AND_ASSIGN(ReadBarrierMarkSlowPathRISCV64);
+};
+
+class LoadStringSlowPathRISCV64 : public SlowPathCodeRISCV64 {
+ public:
+  explicit LoadStringSlowPathRISCV64(HLoadString* instruction)
+      : SlowPathCodeRISCV64(instruction) {}
+
+  void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(instruction_->IsLoadString());
+    DCHECK_EQ(instruction_->AsLoadString()->GetLoadKind(), HLoadString::LoadKind::kBssEntry);
+    LocationSummary* locations = instruction_->GetLocations();
+    DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg()));
+    const dex::StringIndex string_index = instruction_->AsLoadString()->GetStringIndex();
+    CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen);
+    InvokeRuntimeCallingConvention calling_convention;
+    __ Bind(GetEntryLabel());
+    SaveLiveRegisters(codegen, locations);
+
+    __ LoadConst32(calling_convention.GetRegisterAt(0), string_index.index_);
+    riscv64_codegen->InvokeRuntime(
+        kQuickResolveString, instruction_, instruction_->GetDexPc(), this);
+    CheckEntrypointTypes<kQuickResolveString, void*, uint32_t>();
+
+    DataType::Type type = DataType::Type::kReference;
+    DCHECK_EQ(type, instruction_->GetType());
+    riscv64_codegen->MoveLocation(
+        locations->Out(), calling_convention.GetReturnLocation(type), type);
+    RestoreLiveRegisters(codegen, locations);
+
+    __ J(GetExitLabel());
+  }
+
+  const char* GetDescription() const override { return "LoadStringSlowPathRISCV64"; }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(LoadStringSlowPathRISCV64);
+};
+
+#undef __
+#define __ down_cast<Riscv64Assembler*>(GetAssembler())->  // NOLINT
+
+template <typename Reg,
+          void (Riscv64Assembler::*opS)(Reg, FRegister, FRegister),
+          void (Riscv64Assembler::*opD)(Reg, FRegister, FRegister)>
+inline void InstructionCodeGeneratorRISCV64::FpBinOp(
+    Reg rd, FRegister rs1, FRegister rs2, DataType::Type type) {
+  Riscv64Assembler* assembler = down_cast<CodeGeneratorRISCV64*>(codegen_)->GetAssembler();
+  if (type == DataType::Type::kFloat32) {
+    (assembler->*opS)(rd, rs1, rs2);
+  } else {
+    DCHECK_EQ(type, DataType::Type::kFloat64);
+    (assembler->*opD)(rd, rs1, rs2);
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::FAdd(
+    FRegister rd, FRegister rs1, FRegister rs2, DataType::Type type) {
+  FpBinOp<FRegister, &Riscv64Assembler::FAddS, &Riscv64Assembler::FAddD>(rd, rs1, rs2, type);
+}
+
+inline void InstructionCodeGeneratorRISCV64::FSub(
+    FRegister rd, FRegister rs1, FRegister rs2, DataType::Type type) {
+  FpBinOp<FRegister, &Riscv64Assembler::FSubS, &Riscv64Assembler::FSubD>(rd, rs1, rs2, type);
+}
+
+inline void InstructionCodeGeneratorRISCV64::FDiv(
+    FRegister rd, FRegister rs1, FRegister rs2, DataType::Type type) {
+  FpBinOp<FRegister, &Riscv64Assembler::FDivS, &Riscv64Assembler::FDivD>(rd, rs1, rs2, type);
+}
+
+inline void InstructionCodeGeneratorRISCV64::FMul(
+    FRegister rd, FRegister rs1, FRegister rs2, DataType::Type type) {
+  FpBinOp<FRegister, &Riscv64Assembler::FMulS, &Riscv64Assembler::FMulD>(rd, rs1, rs2, type);
+}
+
+inline void InstructionCodeGeneratorRISCV64::FMin(
+    FRegister rd, FRegister rs1, FRegister rs2, DataType::Type type) {
+  FpBinOp<FRegister, &Riscv64Assembler::FMinS, &Riscv64Assembler::FMinD>(rd, rs1, rs2, type);
+}
+
+inline void InstructionCodeGeneratorRISCV64::FMax(
+    FRegister rd, FRegister rs1, FRegister rs2, DataType::Type type) {
+  FpBinOp<FRegister, &Riscv64Assembler::FMaxS, &Riscv64Assembler::FMaxD>(rd, rs1, rs2, type);
+}
+
+inline void InstructionCodeGeneratorRISCV64::FEq(
+    XRegister rd, FRegister rs1, FRegister rs2, DataType::Type type) {
+  FpBinOp<XRegister, &Riscv64Assembler::FEqS, &Riscv64Assembler::FEqD>(rd, rs1, rs2, type);
+}
+
+inline void InstructionCodeGeneratorRISCV64::FLt(
+    XRegister rd, FRegister rs1, FRegister rs2, DataType::Type type) {
+  FpBinOp<XRegister, &Riscv64Assembler::FLtS, &Riscv64Assembler::FLtD>(rd, rs1, rs2, type);
+}
+
+inline void InstructionCodeGeneratorRISCV64::FLe(
+    XRegister rd, FRegister rs1, FRegister rs2, DataType::Type type) {
+  FpBinOp<XRegister, &Riscv64Assembler::FLeS, &Riscv64Assembler::FLeD>(rd, rs1, rs2, type);
+}
+
+template <typename Reg,
+          void (Riscv64Assembler::*opS)(Reg, FRegister),
+          void (Riscv64Assembler::*opD)(Reg, FRegister)>
+inline void InstructionCodeGeneratorRISCV64::FpUnOp(
+    Reg rd, FRegister rs1, DataType::Type type) {
+  Riscv64Assembler* assembler = down_cast<CodeGeneratorRISCV64*>(codegen_)->GetAssembler();
+  if (type == DataType::Type::kFloat32) {
+    (assembler->*opS)(rd, rs1);
+  } else {
+    DCHECK_EQ(type, DataType::Type::kFloat64);
+    (assembler->*opD)(rd, rs1);
+  }
+}
+
+inline void InstructionCodeGeneratorRISCV64::FAbs(
+    FRegister rd, FRegister rs1, DataType::Type type) {
+  FpUnOp<FRegister, &Riscv64Assembler::FAbsS, &Riscv64Assembler::FAbsD>(rd, rs1, type);
+}
+
+inline void InstructionCodeGeneratorRISCV64::FNeg(
+    FRegister rd, FRegister rs1, DataType::Type type) {
+  FpUnOp<FRegister, &Riscv64Assembler::FNegS, &Riscv64Assembler::FNegD>(rd, rs1, type);
+}
+
+inline void InstructionCodeGeneratorRISCV64::FMv(
+    FRegister rd, FRegister rs1, DataType::Type type) {
+  FpUnOp<FRegister, &Riscv64Assembler::FMvS, &Riscv64Assembler::FMvD>(rd, rs1, type);
+}
+
+inline void InstructionCodeGeneratorRISCV64::FMvX(
+    XRegister rd, FRegister rs1, DataType::Type type) {
+  FpUnOp<XRegister, &Riscv64Assembler::FMvXW, &Riscv64Assembler::FMvXD>(rd, rs1, type);
+}
+
+void InstructionCodeGeneratorRISCV64::FClass(
+    XRegister rd, FRegister rs1, DataType::Type type) {
+  FpUnOp<XRegister, &Riscv64Assembler::FClassS, &Riscv64Assembler::FClassD>(rd, rs1, type);
+}
+
+void InstructionCodeGeneratorRISCV64::Load(
+    Location out, XRegister rs1, int32_t offset, DataType::Type type) {
+  switch (type) {
+    case DataType::Type::kBool:
+    case DataType::Type::kUint8:
+      __ Loadbu(out.AsRegister<XRegister>(), rs1, offset);
+      break;
+    case DataType::Type::kInt8:
+      __ Loadb(out.AsRegister<XRegister>(), rs1, offset);
+      break;
+    case DataType::Type::kUint16:
+      __ Loadhu(out.AsRegister<XRegister>(), rs1, offset);
+      break;
+    case DataType::Type::kInt16:
+      __ Loadh(out.AsRegister<XRegister>(), rs1, offset);
+      break;
+    case DataType::Type::kInt32:
+      __ Loadw(out.AsRegister<XRegister>(), rs1, offset);
+      break;
+    case DataType::Type::kInt64:
+      __ Loadd(out.AsRegister<XRegister>(), rs1, offset);
+      break;
+    case DataType::Type::kReference:
+      __ Loadwu(out.AsRegister<XRegister>(), rs1, offset);
+      break;
+    case DataType::Type::kFloat32:
+      __ FLoadw(out.AsFpuRegister<FRegister>(), rs1, offset);
+      break;
+    case DataType::Type::kFloat64:
+      __ FLoadd(out.AsFpuRegister<FRegister>(), rs1, offset);
+      break;
+    case DataType::Type::kUint32:
+    case DataType::Type::kUint64:
+    case DataType::Type::kVoid:
+      LOG(FATAL) << "Unreachable type " << type;
+      UNREACHABLE();
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::Store(
+    Location value, XRegister rs1, int32_t offset, DataType::Type type) {
+  DCHECK_IMPLIES(value.IsConstant(), IsZeroBitPattern(value.GetConstant()));
+  if (kPoisonHeapReferences && type == DataType::Type::kReference && !value.IsConstant()) {
+    riscv64::ScratchRegisterScope srs(GetAssembler());
+    XRegister tmp = srs.AllocateXRegister();
+    __ Mv(tmp, value.AsRegister<XRegister>());
+    codegen_->PoisonHeapReference(tmp);
+    __ Storew(tmp, rs1, offset);
+    return;
+  }
+  switch (type) {
+    case DataType::Type::kBool:
+    case DataType::Type::kUint8:
+    case DataType::Type::kInt8:
+      __ Storeb(InputXRegisterOrZero(value), rs1, offset);
+      break;
+    case DataType::Type::kUint16:
+    case DataType::Type::kInt16:
+      __ Storeh(InputXRegisterOrZero(value), rs1, offset);
+      break;
+    case DataType::Type::kFloat32:
+      if (!value.IsConstant()) {
+        __ FStorew(value.AsFpuRegister<FRegister>(), rs1, offset);
+        break;
+      }
+      FALLTHROUGH_INTENDED;
+    case DataType::Type::kInt32:
+    case DataType::Type::kReference:
+      __ Storew(InputXRegisterOrZero(value), rs1, offset);
+      break;
+    case DataType::Type::kFloat64:
+      if (!value.IsConstant()) {
+        __ FStored(value.AsFpuRegister<FRegister>(), rs1, offset);
+        break;
+      }
+      FALLTHROUGH_INTENDED;
+    case DataType::Type::kInt64:
+      __ Stored(InputXRegisterOrZero(value), rs1, offset);
+      break;
+    case DataType::Type::kUint32:
+    case DataType::Type::kUint64:
+    case DataType::Type::kVoid:
+      LOG(FATAL) << "Unreachable type " << type;
+      UNREACHABLE();
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::StoreSeqCst(Location value,
+                                                  XRegister rs1,
+                                                  int32_t offset,
+                                                  DataType::Type type,
+                                                  HInstruction* instruction) {
+  if (DataType::Size(type) >= 4u) {
+    // Use AMOSWAP for 32-bit and 64-bit data types.
+    ScratchRegisterScope srs(GetAssembler());
+    XRegister swap_src = kNoXRegister;
+    if (kPoisonHeapReferences && type == DataType::Type::kReference && !value.IsConstant()) {
+      swap_src = srs.AllocateXRegister();
+      __ Mv(swap_src, value.AsRegister<XRegister>());
+      codegen_->PoisonHeapReference(swap_src);
+    } else if (DataType::IsFloatingPointType(type) && !value.IsConstant()) {
+      swap_src = srs.AllocateXRegister();
+      FMvX(swap_src, value.AsFpuRegister<FRegister>(), type);
+    } else {
+      swap_src = InputXRegisterOrZero(value);
+    }
+    XRegister addr = rs1;
+    if (offset != 0) {
+      addr = srs.AllocateXRegister();
+      __ AddConst64(addr, rs1, offset);
+    }
+    if (DataType::Is64BitType(type)) {
+      __ AmoSwapD(Zero, swap_src, addr, AqRl::kRelease);
+    } else {
+      __ AmoSwapW(Zero, swap_src, addr, AqRl::kRelease);
+    }
+    if (instruction != nullptr) {
+      codegen_->MaybeRecordImplicitNullCheck(instruction);
+    }
+  } else {
+    // Use fences for smaller data types.
+    codegen_->GenerateMemoryBarrier(MemBarrierKind::kAnyStore);
+    Store(value, rs1, offset, type);
+    if (instruction != nullptr) {
+      codegen_->MaybeRecordImplicitNullCheck(instruction);
+    }
+    codegen_->GenerateMemoryBarrier(MemBarrierKind::kAnyAny);
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::ShNAdd(
+    XRegister rd, XRegister rs1, XRegister rs2, DataType::Type type) {
+  switch (type) {
+    case DataType::Type::kBool:
+    case DataType::Type::kUint8:
+    case DataType::Type::kInt8:
+      DCHECK_EQ(DataType::SizeShift(type), 0u);
+      __ Add(rd, rs1, rs2);
+      break;
+    case DataType::Type::kUint16:
+    case DataType::Type::kInt16:
+      DCHECK_EQ(DataType::SizeShift(type), 1u);
+      __ Sh1Add(rd, rs1, rs2);
+      break;
+    case DataType::Type::kInt32:
+    case DataType::Type::kReference:
+    case DataType::Type::kFloat32:
+      DCHECK_EQ(DataType::SizeShift(type), 2u);
+      __ Sh2Add(rd, rs1, rs2);
+      break;
+    case DataType::Type::kInt64:
+    case DataType::Type::kFloat64:
+      DCHECK_EQ(DataType::SizeShift(type), 3u);
+      __ Sh3Add(rd, rs1, rs2);
+      break;
+    case DataType::Type::kUint32:
+    case DataType::Type::kUint64:
+    case DataType::Type::kVoid:
+      LOG(FATAL) << "Unreachable type " << type;
+      UNREACHABLE();
+  }
+}
+
+Riscv64Assembler* ParallelMoveResolverRISCV64::GetAssembler() const {
+  return codegen_->GetAssembler();
+}
+
+void ParallelMoveResolverRISCV64::EmitMove(size_t index) {
+  MoveOperands* move = moves_[index];
+  codegen_->MoveLocation(move->GetDestination(), move->GetSource(), move->GetType());
+}
+
+void ParallelMoveResolverRISCV64::EmitSwap(size_t index) {
+  MoveOperands* move = moves_[index];
+  codegen_->SwapLocations(move->GetDestination(), move->GetSource(), move->GetType());
+}
+
+void ParallelMoveResolverRISCV64::SpillScratch([[maybe_unused]] int reg) {
+  LOG(FATAL) << "Unimplemented";
+  UNREACHABLE();
+}
+
+void ParallelMoveResolverRISCV64::RestoreScratch([[maybe_unused]] int reg) {
+  LOG(FATAL) << "Unimplemented";
+  UNREACHABLE();
+}
+
+void ParallelMoveResolverRISCV64::Exchange(int index1, int index2, bool double_slot) {
+  // We have 2 scratch X registers and 1 scratch F register that we can use. We prefer
+  // to use X registers for the swap but if both offsets are too big, we need to reserve
+  // one of the X registers for address adjustment and use an F register.
+  bool use_fp_tmp2 = false;
+  if (!IsInt<12>(index2)) {
+    if (!IsInt<12>(index1)) {
+      use_fp_tmp2 = true;
+    } else {
+      std::swap(index1, index2);
+    }
+  }
+  DCHECK_IMPLIES(!IsInt<12>(index2), use_fp_tmp2);
+
+  Location loc1(double_slot ? Location::DoubleStackSlot(index1) : Location::StackSlot(index1));
+  Location loc2(double_slot ? Location::DoubleStackSlot(index2) : Location::StackSlot(index2));
+  riscv64::ScratchRegisterScope srs(GetAssembler());
+  Location tmp = Location::RegisterLocation(srs.AllocateXRegister());
+  DataType::Type tmp_type = double_slot ? DataType::Type::kInt64 : DataType::Type::kInt32;
+  Location tmp2 = use_fp_tmp2
+      ? Location::FpuRegisterLocation(srs.AllocateFRegister())
+      : Location::RegisterLocation(srs.AllocateXRegister());
+  DataType::Type tmp2_type = use_fp_tmp2
+      ? (double_slot ? DataType::Type::kFloat64 : DataType::Type::kFloat32)
+      : tmp_type;
+
+  codegen_->MoveLocation(tmp, loc1, tmp_type);
+  codegen_->MoveLocation(tmp2, loc2, tmp2_type);
+  if (use_fp_tmp2) {
+    codegen_->MoveLocation(loc2, tmp, tmp_type);
+  } else {
+    // We cannot use `Stored()` or `Storew()` via `MoveLocation()` because we have
+    // no more scratch registers available. Use `Sd()` or `Sw()` explicitly.
+    DCHECK(IsInt<12>(index2));
+    if (double_slot) {
+      __ Sd(tmp.AsRegister<XRegister>(), SP, index2);
+    } else {
+      __ Sw(tmp.AsRegister<XRegister>(), SP, index2);
+    }
+    srs.FreeXRegister(tmp.AsRegister<XRegister>());  // Free a temporary for `MoveLocation()`.
+  }
+  codegen_->MoveLocation(loc1, tmp2, tmp2_type);
+}
+
+InstructionCodeGeneratorRISCV64::InstructionCodeGeneratorRISCV64(HGraph* graph,
+                                                                 CodeGeneratorRISCV64* codegen)
+    : InstructionCodeGenerator(graph, codegen),
+      assembler_(codegen->GetAssembler()),
+      codegen_(codegen) {}
+
+void InstructionCodeGeneratorRISCV64::GenerateClassInitializationCheck(
+    SlowPathCodeRISCV64* slow_path, XRegister class_reg) {
+  ScratchRegisterScope srs(GetAssembler());
+  XRegister tmp = srs.AllocateXRegister();
+  XRegister tmp2 = srs.AllocateXRegister();
+
+  // We shall load the full 32-bit status word with sign-extension and compare as unsigned
+  // to a sign-extended shifted status value. This yields the same comparison as loading and
+  // materializing unsigned but the constant is materialized with a single LUI instruction.
+  __ Loadw(tmp, class_reg, mirror::Class::StatusOffset().SizeValue());  // Sign-extended.
+  __ Li(tmp2, ShiftedSignExtendedClassStatusValue<ClassStatus::kVisiblyInitialized>());
+  __ Bltu(tmp, tmp2, slow_path->GetEntryLabel());
+  __ Bind(slow_path->GetExitLabel());
+}
+
+void InstructionCodeGeneratorRISCV64::GenerateBitstringTypeCheckCompare(
+    HTypeCheckInstruction* instruction, XRegister temp) {
+  UNUSED(instruction);
+  UNUSED(temp);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::GenerateSuspendCheck(HSuspendCheck* instruction,
+                                                           HBasicBlock* successor) {
+  if (instruction->IsNoOp()) {
+    if (successor != nullptr) {
+      __ J(codegen_->GetLabelOf(successor));
+    }
+    return;
+  }
+
+  if (codegen_->CanUseImplicitSuspendCheck()) {
+    LOG(FATAL) << "Unimplemented ImplicitSuspendCheck";
+    return;
+  }
+
+  SuspendCheckSlowPathRISCV64* slow_path =
+      down_cast<SuspendCheckSlowPathRISCV64*>(instruction->GetSlowPath());
+
+  if (slow_path == nullptr) {
+    slow_path =
+        new (codegen_->GetScopedAllocator()) SuspendCheckSlowPathRISCV64(instruction, successor);
+    instruction->SetSlowPath(slow_path);
+    codegen_->AddSlowPath(slow_path);
+    if (successor != nullptr) {
+      DCHECK(successor->IsLoopHeader());
+    }
+  } else {
+    DCHECK_EQ(slow_path->GetSuccessor(), successor);
+  }
+
+  ScratchRegisterScope srs(GetAssembler());
+  XRegister tmp = srs.AllocateXRegister();
+  __ Loadw(tmp, TR, Thread::ThreadFlagsOffset<kRiscv64PointerSize>().Int32Value());
+  static_assert(Thread::SuspendOrCheckpointRequestFlags() != std::numeric_limits<uint32_t>::max());
+  static_assert(IsPowerOfTwo(Thread::SuspendOrCheckpointRequestFlags() + 1u));
+  // Shift out other bits. Use an instruction that can be 16-bit with the "C" Standard Extension.
+  __ Slli(tmp, tmp, CLZ(static_cast<uint64_t>(Thread::SuspendOrCheckpointRequestFlags())));
+  if (successor == nullptr) {
+    __ Bnez(tmp, slow_path->GetEntryLabel());
+    __ Bind(slow_path->GetReturnLabel());
+  } else {
+    __ Beqz(tmp, codegen_->GetLabelOf(successor));
+    __ J(slow_path->GetEntryLabel());
+    // slow_path will return to GetLabelOf(successor).
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::GenerateReferenceLoadOneRegister(
+    HInstruction* instruction,
+    Location out,
+    uint32_t offset,
+    Location maybe_temp,
+    ReadBarrierOption read_barrier_option) {
+  XRegister out_reg = out.AsRegister<XRegister>();
+  if (read_barrier_option == kWithReadBarrier) {
+    DCHECK(codegen_->EmitReadBarrier());
+    if (kUseBakerReadBarrier) {
+      // Load with fast path based Baker's read barrier.
+      // /* HeapReference<Object> */ out = *(out + offset)
+      codegen_->GenerateFieldLoadWithBakerReadBarrier(instruction,
+                                                      out,
+                                                      out_reg,
+                                                      offset,
+                                                      maybe_temp,
+                                                      /* needs_null_check= */ false);
+    } else {
+      // Load with slow path based read barrier.
+      // Save the value of `out` into `maybe_temp` before overwriting it
+      // in the following move operation, as we will need it for the
+      // read barrier below.
+      __ Mv(maybe_temp.AsRegister<XRegister>(), out_reg);
+      // /* HeapReference<Object> */ out = *(out + offset)
+      __ Loadwu(out_reg, out_reg, offset);
+      codegen_->GenerateReadBarrierSlow(instruction, out, out, maybe_temp, offset);
+    }
+  } else {
+    // Plain load with no read barrier.
+    // /* HeapReference<Object> */ out = *(out + offset)
+    __ Loadwu(out_reg, out_reg, offset);
+    codegen_->MaybeUnpoisonHeapReference(out_reg);
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::GenerateReferenceLoadTwoRegisters(
+    HInstruction* instruction,
+    Location out,
+    Location obj,
+    uint32_t offset,
+    Location maybe_temp,
+    ReadBarrierOption read_barrier_option) {
+  XRegister out_reg = out.AsRegister<XRegister>();
+  XRegister obj_reg = obj.AsRegister<XRegister>();
+  if (read_barrier_option == kWithReadBarrier) {
+    DCHECK(codegen_->EmitReadBarrier());
+    if (kUseBakerReadBarrier) {
+      // Load with fast path based Baker's read barrier.
+      // /* HeapReference<Object> */ out = *(obj + offset)
+      codegen_->GenerateFieldLoadWithBakerReadBarrier(instruction,
+                                                      out,
+                                                      obj_reg,
+                                                      offset,
+                                                      maybe_temp,
+                                                      /* needs_null_check= */ false);
+    } else {
+      // Load with slow path based read barrier.
+      // /* HeapReference<Object> */ out = *(obj + offset)
+      __ Loadwu(out_reg, obj_reg, offset);
+      codegen_->GenerateReadBarrierSlow(instruction, out, out, obj, offset);
+    }
+  } else {
+    // Plain load with no read barrier.
+    // /* HeapReference<Object> */ out = *(obj + offset)
+    __ Loadwu(out_reg, obj_reg, offset);
+    codegen_->MaybeUnpoisonHeapReference(out_reg);
+  }
+}
+
+SlowPathCodeRISCV64* CodeGeneratorRISCV64::AddGcRootBakerBarrierBarrierSlowPath(
+    HInstruction* instruction, Location root, Location temp) {
+  SlowPathCodeRISCV64* slow_path =
+      new (GetScopedAllocator()) ReadBarrierMarkSlowPathRISCV64(instruction, root, temp);
+  AddSlowPath(slow_path);
+  return slow_path;
+}
+
+void CodeGeneratorRISCV64::EmitBakerReadBarierMarkingCheck(
+    SlowPathCodeRISCV64* slow_path, Location root, Location temp) {
+  const int32_t entry_point_offset = ReadBarrierMarkEntrypointOffset(root);
+  // Loading the entrypoint does not require a load acquire since it is only changed when
+  // threads are suspended or running a checkpoint.
+  __ Loadd(temp.AsRegister<XRegister>(), TR, entry_point_offset);
+  __ Bnez(temp.AsRegister<XRegister>(), slow_path->GetEntryLabel());
+  __ Bind(slow_path->GetExitLabel());
+}
+
+void CodeGeneratorRISCV64::GenerateGcRootFieldLoad(HInstruction* instruction,
+                                                   Location root,
+                                                   XRegister obj,
+                                                   uint32_t offset,
+                                                   ReadBarrierOption read_barrier_option,
+                                                   Riscv64Label* label_low) {
+  DCHECK_IMPLIES(label_low != nullptr, offset == kLinkTimeOffsetPlaceholderLow) << offset;
+  XRegister root_reg = root.AsRegister<XRegister>();
+  if (read_barrier_option == kWithReadBarrier) {
+    DCHECK(EmitReadBarrier());
+    if (kUseBakerReadBarrier) {
+      // Note that we do not actually check the value of `GetIsGcMarking()`
+      // to decide whether to mark the loaded GC root or not.  Instead, we
+      // load into `temp` (T6) the read barrier mark entry point corresponding
+      // to register `root`. If `temp` is null, it means that `GetIsGcMarking()`
+      // is false, and vice versa.
+      //
+      //     GcRoot<mirror::Object> root = *(obj+offset);  // Original reference load.
+      //     temp = Thread::Current()->pReadBarrierMarkReg ## root.reg()
+      //     if (temp != null) {
+      //       root = temp(root)
+      //     }
+      //
+      // TODO(riscv64): Introduce a "marking register" that holds the pointer to one of the
+      // register marking entrypoints if marking (null if not marking) and make sure that
+      // marking entrypoints for other registers are at known offsets, so that we can call
+      // them using the "marking register" plus the offset embedded in the JALR instruction.
+
+      if (label_low != nullptr) {
+        __ Bind(label_low);
+      }
+      // /* GcRoot<mirror::Object> */ root = *(obj + offset)
+      __ Loadwu(root_reg, obj, offset);
+      static_assert(
+          sizeof(mirror::CompressedReference<mirror::Object>) == sizeof(GcRoot<mirror::Object>),
+          "art::mirror::CompressedReference<mirror::Object> and art::GcRoot<mirror::Object> "
+          "have different sizes.");
+      static_assert(sizeof(mirror::CompressedReference<mirror::Object>) == sizeof(int32_t),
+                    "art::mirror::CompressedReference<mirror::Object> and int32_t "
+                    "have different sizes.");
+
+      // Use RA as temp. It is clobbered in the slow path anyway.
+      Location temp = Location::RegisterLocation(RA);
+      SlowPathCodeRISCV64* slow_path =
+          AddGcRootBakerBarrierBarrierSlowPath(instruction, root, temp);
+      EmitBakerReadBarierMarkingCheck(slow_path, root, temp);
+    } else {
+      // GC root loaded through a slow path for read barriers other
+      // than Baker's.
+      // /* GcRoot<mirror::Object>* */ root = obj + offset
+      if (label_low != nullptr) {
+        __ Bind(label_low);
+      }
+      __ AddConst32(root_reg, obj, offset);
+      // /* mirror::Object* */ root = root->Read()
+      GenerateReadBarrierForRootSlow(instruction, root, root);
+    }
+  } else {
+    // Plain GC root load with no read barrier.
+    // /* GcRoot<mirror::Object> */ root = *(obj + offset)
+    if (label_low != nullptr) {
+      __ Bind(label_low);
+    }
+    __ Loadwu(root_reg, obj, offset);
+    // Note that GC roots are not affected by heap poisoning, thus we
+    // do not have to unpoison `root_reg` here.
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::GenerateTestAndBranch(HInstruction* instruction,
+                                                            size_t condition_input_index,
+                                                            Riscv64Label* true_target,
+                                                            Riscv64Label* false_target) {
+  HInstruction* cond = instruction->InputAt(condition_input_index);
+
+  if (true_target == nullptr && false_target == nullptr) {
+    // Nothing to do. The code always falls through.
+    return;
+  } else if (cond->IsIntConstant()) {
+    // Constant condition, statically compared against "true" (integer value 1).
+    if (cond->AsIntConstant()->IsTrue()) {
+      if (true_target != nullptr) {
+        __ J(true_target);
+      }
+    } else {
+      DCHECK(cond->AsIntConstant()->IsFalse()) << cond->AsIntConstant()->GetValue();
+      if (false_target != nullptr) {
+        __ J(false_target);
+      }
+    }
+    return;
+  }
+
+  // The following code generates these patterns:
+  //  (1) true_target == nullptr && false_target != nullptr
+  //        - opposite condition true => branch to false_target
+  //  (2) true_target != nullptr && false_target == nullptr
+  //        - condition true => branch to true_target
+  //  (3) true_target != nullptr && false_target != nullptr
+  //        - condition true => branch to true_target
+  //        - branch to false_target
+  if (IsBooleanValueOrMaterializedCondition(cond)) {
+    // The condition instruction has been materialized, compare the output to 0.
+    Location cond_val = instruction->GetLocations()->InAt(condition_input_index);
+    DCHECK(cond_val.IsRegister());
+    if (true_target == nullptr) {
+      __ Beqz(cond_val.AsRegister<XRegister>(), false_target);
+    } else {
+      __ Bnez(cond_val.AsRegister<XRegister>(), true_target);
+    }
+  } else {
+    // The condition instruction has not been materialized, use its inputs as
+    // the comparison and its condition as the branch condition.
+    HCondition* condition = cond->AsCondition();
+    DataType::Type type = condition->InputAt(0)->GetType();
+    LocationSummary* locations = condition->GetLocations();
+    IfCondition if_cond = condition->GetCondition();
+    Riscv64Label* branch_target = true_target;
+
+    if (true_target == nullptr) {
+      if_cond = condition->GetOppositeCondition();
+      branch_target = false_target;
+    }
+
+    switch (type) {
+      case DataType::Type::kFloat32:
+      case DataType::Type::kFloat64:
+        GenerateFpCondition(if_cond, condition->IsGtBias(), type, locations, branch_target);
+        break;
+      default:
+        // Integral types and reference equality.
+        GenerateIntLongCompareAndBranch(if_cond, locations, branch_target);
+        break;
+    }
+  }
+
+  // If neither branch falls through (case 3), the conditional branch to `true_target`
+  // was already emitted (case 2) and we need to emit a jump to `false_target`.
+  if (true_target != nullptr && false_target != nullptr) {
+    __ J(false_target);
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::DivRemOneOrMinusOne(HBinaryOperation* instruction) {
+  DCHECK(instruction->IsDiv() || instruction->IsRem());
+  DataType::Type type = instruction->GetResultType();
+
+  LocationSummary* locations = instruction->GetLocations();
+  Location second = locations->InAt(1);
+  DCHECK(second.IsConstant());
+
+  XRegister out = locations->Out().AsRegister<XRegister>();
+  XRegister dividend = locations->InAt(0).AsRegister<XRegister>();
+  int64_t imm = Int64FromConstant(second.GetConstant());
+  DCHECK(imm == 1 || imm == -1);
+
+  if (instruction->IsRem()) {
+    __ Mv(out, Zero);
+  } else {
+    if (imm == -1) {
+      if (type == DataType::Type::kInt32) {
+        __ Subw(out, Zero, dividend);
+      } else {
+        DCHECK_EQ(type, DataType::Type::kInt64);
+        __ Sub(out, Zero, dividend);
+      }
+    } else if (out != dividend) {
+      __ Mv(out, dividend);
+    }
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::DivRemByPowerOfTwo(HBinaryOperation* instruction) {
+  DCHECK(instruction->IsDiv() || instruction->IsRem());
+  DataType::Type type = instruction->GetResultType();
+  DCHECK(type == DataType::Type::kInt32 || type == DataType::Type::kInt64) << type;
+
+  LocationSummary* locations = instruction->GetLocations();
+  Location second = locations->InAt(1);
+  DCHECK(second.IsConstant());
+
+  XRegister out = locations->Out().AsRegister<XRegister>();
+  XRegister dividend = locations->InAt(0).AsRegister<XRegister>();
+  int64_t imm = Int64FromConstant(second.GetConstant());
+  int64_t abs_imm = static_cast<uint64_t>(AbsOrMin(imm));
+  int ctz_imm = CTZ(abs_imm);
+  DCHECK_GE(ctz_imm, 1);  // Division by +/-1 is handled by `DivRemOneOrMinusOne()`.
+
+  ScratchRegisterScope srs(GetAssembler());
+  XRegister tmp = srs.AllocateXRegister();
+  // Calculate the negative dividend adjustment `tmp = dividend < 0 ? abs_imm - 1 : 0`.
+  // This adjustment is needed for rounding the division result towards zero.
+  if (type == DataType::Type::kInt32 || ctz_imm == 1) {
+    // A 32-bit dividend is sign-extended to 64-bit, so we can use the upper bits.
+    // And for a 64-bit division by +/-2, we need just the sign bit.
+    DCHECK_IMPLIES(type == DataType::Type::kInt32, ctz_imm < 32);
+    __ Srli(tmp, dividend, 64 - ctz_imm);
+  } else {
+    // For other 64-bit divisions, we need to replicate the sign bit.
+    __ Srai(tmp, dividend, 63);
+    __ Srli(tmp, tmp, 64 - ctz_imm);
+  }
+  // The rest of the calculation can use 64-bit operations even for 32-bit div/rem.
+  __ Add(tmp, tmp, dividend);
+  if (instruction->IsDiv()) {
+    __ Srai(out, tmp, ctz_imm);
+    if (imm < 0) {
+      __ Neg(out, out);
+    }
+  } else {
+    if (ctz_imm <= 11) {
+      __ Andi(tmp, tmp, -abs_imm);
+    } else {
+      ScratchRegisterScope srs2(GetAssembler());
+      XRegister tmp2 = srs2.AllocateXRegister();
+      __ Li(tmp2, -abs_imm);
+      __ And(tmp, tmp, tmp2);
+    }
+    __ Sub(out, dividend, tmp);
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::GenerateDivRemWithAnyConstant(HBinaryOperation* instruction) {
+  DCHECK(instruction->IsDiv() || instruction->IsRem());
+  LocationSummary* locations = instruction->GetLocations();
+  XRegister dividend = locations->InAt(0).AsRegister<XRegister>();
+  XRegister out = locations->Out().AsRegister<XRegister>();
+  Location second = locations->InAt(1);
+  int64_t imm = Int64FromConstant(second.GetConstant());
+  DataType::Type type = instruction->GetResultType();
+  ScratchRegisterScope srs(GetAssembler());
+  XRegister tmp = srs.AllocateXRegister();
+
+  // TODO: optimize with constant.
+  __ LoadConst64(tmp, imm);
+  if (instruction->IsDiv()) {
+    if (type == DataType::Type::kInt32) {
+      __ Divw(out, dividend, tmp);
+    } else {
+      __ Div(out, dividend, tmp);
+    }
+  } else {
+    if (type == DataType::Type::kInt32)  {
+      __ Remw(out, dividend, tmp);
+    } else {
+      __ Rem(out, dividend, tmp);
+    }
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::GenerateDivRemIntegral(HBinaryOperation* instruction) {
+  DCHECK(instruction->IsDiv() || instruction->IsRem());
+  DataType::Type type = instruction->GetResultType();
+  DCHECK(type == DataType::Type::kInt32 || type == DataType::Type::kInt64) << type;
+
+  LocationSummary* locations = instruction->GetLocations();
+  XRegister out = locations->Out().AsRegister<XRegister>();
+  Location second = locations->InAt(1);
+
+  if (second.IsConstant()) {
+    int64_t imm = Int64FromConstant(second.GetConstant());
+    if (imm == 0) {
+      // Do not generate anything. DivZeroCheck would prevent any code to be executed.
+    } else if (imm == 1 || imm == -1) {
+      DivRemOneOrMinusOne(instruction);
+    } else if (IsPowerOfTwo(AbsOrMin(imm))) {
+      DivRemByPowerOfTwo(instruction);
+    } else {
+      DCHECK(imm <= -2 || imm >= 2);
+      GenerateDivRemWithAnyConstant(instruction);
+    }
+  } else {
+    XRegister dividend = locations->InAt(0).AsRegister<XRegister>();
+    XRegister divisor = second.AsRegister<XRegister>();
+    if (instruction->IsDiv()) {
+      if (type == DataType::Type::kInt32) {
+        __ Divw(out, dividend, divisor);
+      } else {
+        __ Div(out, dividend, divisor);
+      }
+    } else {
+      if (type == DataType::Type::kInt32) {
+        __ Remw(out, dividend, divisor);
+      } else {
+        __ Rem(out, dividend, divisor);
+      }
+    }
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::GenerateIntLongCondition(IfCondition cond,
+                                                               LocationSummary* locations) {
+  XRegister rd = locations->Out().AsRegister<XRegister>();
+  GenerateIntLongCondition(cond, locations, rd, /*to_all_bits=*/ false);
+}
+
+void InstructionCodeGeneratorRISCV64::GenerateIntLongCondition(IfCondition cond,
+                                                               LocationSummary* locations,
+                                                               XRegister rd,
+                                                               bool to_all_bits) {
+  XRegister rs1 = locations->InAt(0).AsRegister<XRegister>();
+  Location rs2_location = locations->InAt(1);
+  bool use_imm = rs2_location.IsConstant();
+  int64_t imm = use_imm ? CodeGenerator::GetInt64ValueOf(rs2_location.GetConstant()) : 0;
+  XRegister rs2 = use_imm ? kNoXRegister : rs2_location.AsRegister<XRegister>();
+  bool reverse_condition = false;
+  switch (cond) {
+    case kCondEQ:
+    case kCondNE:
+      if (!use_imm) {
+        __ Sub(rd, rs1, rs2);  // SUB is OK here even for 32-bit comparison.
+      } else if (imm != 0) {
+        DCHECK(IsInt<12>(-imm));
+        __ Addi(rd, rs1, -imm);  // ADDI is OK here even for 32-bit comparison.
+      }  // else test `rs1` directly without subtraction for `use_imm && imm == 0`.
+      if (cond == kCondEQ) {
+        __ Seqz(rd, (use_imm && imm == 0) ? rs1 : rd);
+      } else {
+        __ Snez(rd, (use_imm && imm == 0) ? rs1 : rd);
+      }
+      break;
+
+    case kCondLT:
+    case kCondGE:
+      if (use_imm) {
+        DCHECK(IsInt<12>(imm));
+        __ Slti(rd, rs1, imm);
+      } else {
+        __ Slt(rd, rs1, rs2);
+      }
+      // Calculate `rs1 >= rhs` as `!(rs1 < rhs)` since there's only the SLT but no SGE.
+      reverse_condition = (cond == kCondGE);
+      break;
+
+    case kCondLE:
+    case kCondGT:
+      if (use_imm) {
+        // Calculate `rs1 <= imm` as `rs1 < imm + 1`.
+        DCHECK(IsInt<12>(imm + 1));  // The value that overflows would fail this check.
+        __ Slti(rd, rs1, imm + 1);
+      } else {
+        __ Slt(rd, rs2, rs1);
+      }
+      // Calculate `rs1 > imm` as `!(rs1 < imm + 1)` and calculate
+      // `rs1 <= rs2` as `!(rs2 < rs1)` since there's only the SLT but no SGE.
+      reverse_condition = ((cond == kCondGT) == use_imm);
+      break;
+
+    case kCondB:
+    case kCondAE:
+      if (use_imm) {
+        // Sltiu sign-extends its 12-bit immediate operand before the comparison
+        // and thus lets us compare directly with unsigned values in the ranges
+        // [0, 0x7ff] and [0x[ffffffff]fffff800, 0x[ffffffff]ffffffff].
+        DCHECK(IsInt<12>(imm));
+        __ Sltiu(rd, rs1, imm);
+      } else {
+        __ Sltu(rd, rs1, rs2);
+      }
+      // Calculate `rs1 AE rhs` as `!(rs1 B rhs)` since there's only the SLTU but no SGEU.
+      reverse_condition = (cond == kCondAE);
+      break;
+
+    case kCondBE:
+    case kCondA:
+      if (use_imm) {
+        // Calculate `rs1 BE imm` as `rs1 B imm + 1`.
+        // Sltiu sign-extends its 12-bit immediate operand before the comparison
+        // and thus lets us compare directly with unsigned values in the ranges
+        // [0, 0x7ff] and [0x[ffffffff]fffff800, 0x[ffffffff]ffffffff].
+        DCHECK(IsInt<12>(imm + 1));  // The value that overflows would fail this check.
+        __ Sltiu(rd, rs1, imm + 1);
+      } else {
+        __ Sltu(rd, rs2, rs1);
+      }
+      // Calculate `rs1 A imm` as `!(rs1 B imm + 1)` and calculate
+      // `rs1 BE rs2` as `!(rs2 B rs1)` since there's only the SLTU but no SGEU.
+      reverse_condition = ((cond == kCondA) == use_imm);
+      break;
+  }
+  if (to_all_bits) {
+    // Store the result to all bits; in other words, "true" is represented by -1.
+    if (reverse_condition) {
+      __ Addi(rd, rd, -1);  // 0 -> -1, 1 -> 0
+    } else {
+      __ Neg(rd, rd);  // 0 -> 0, 1 -> -1
+    }
+  } else {
+    if (reverse_condition) {
+      __ Xori(rd, rd, 1);
+    }
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::GenerateIntLongCompareAndBranch(IfCondition cond,
+                                                                      LocationSummary* locations,
+                                                                      Riscv64Label* label) {
+  XRegister left = locations->InAt(0).AsRegister<XRegister>();
+  Location right_location = locations->InAt(1);
+  if (right_location.IsConstant()) {
+    DCHECK_EQ(CodeGenerator::GetInt64ValueOf(right_location.GetConstant()), 0);
+    switch (cond) {
+      case kCondEQ:
+      case kCondBE:  // <= 0 if zero
+        __ Beqz(left, label);
+        break;
+      case kCondNE:
+      case kCondA:  // > 0 if non-zero
+        __ Bnez(left, label);
+        break;
+      case kCondLT:
+        __ Bltz(left, label);
+        break;
+      case kCondGE:
+        __ Bgez(left, label);
+        break;
+      case kCondLE:
+        __ Blez(left, label);
+        break;
+      case kCondGT:
+        __ Bgtz(left, label);
+        break;
+      case kCondB:  // always false
+        break;
+      case kCondAE:  // always true
+        __ J(label);
+        break;
+    }
+  } else {
+    XRegister right_reg = right_location.AsRegister<XRegister>();
+    switch (cond) {
+      case kCondEQ:
+        __ Beq(left, right_reg, label);
+        break;
+      case kCondNE:
+        __ Bne(left, right_reg, label);
+        break;
+      case kCondLT:
+        __ Blt(left, right_reg, label);
+        break;
+      case kCondGE:
+        __ Bge(left, right_reg, label);
+        break;
+      case kCondLE:
+        __ Ble(left, right_reg, label);
+        break;
+      case kCondGT:
+        __ Bgt(left, right_reg, label);
+        break;
+      case kCondB:
+        __ Bltu(left, right_reg, label);
+        break;
+      case kCondAE:
+        __ Bgeu(left, right_reg, label);
+        break;
+      case kCondBE:
+        __ Bleu(left, right_reg, label);
+        break;
+      case kCondA:
+        __ Bgtu(left, right_reg, label);
+        break;
+    }
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::GenerateFpCondition(IfCondition cond,
+                                                          bool gt_bias,
+                                                          DataType::Type type,
+                                                          LocationSummary* locations,
+                                                          Riscv64Label* label) {
+  DCHECK_EQ(label != nullptr, locations->Out().IsInvalid());
+  ScratchRegisterScope srs(GetAssembler());
+  XRegister rd =
+      (label != nullptr) ? srs.AllocateXRegister() : locations->Out().AsRegister<XRegister>();
+  GenerateFpCondition(cond, gt_bias, type, locations, label, rd, /*to_all_bits=*/ false);
+}
+
+void InstructionCodeGeneratorRISCV64::GenerateFpCondition(IfCondition cond,
+                                                          bool gt_bias,
+                                                          DataType::Type type,
+                                                          LocationSummary* locations,
+                                                          Riscv64Label* label,
+                                                          XRegister rd,
+                                                          bool to_all_bits) {
+  // RISCV-V FP compare instructions yield the following values:
+  //                      l<r  l=r  l>r Unordered
+  //             FEQ l,r   0    1    0    0
+  //             FLT l,r   1    0    0    0
+  //             FLT r,l   0    0    1    0
+  //             FLE l,r   1    1    0    0
+  //             FLE r,l   0    1    1    0
+  //
+  // We can calculate the `Compare` results using the following formulas:
+  //                      l<r  l=r  l>r Unordered
+  //     Compare/gt_bias  -1    0    1    1       = ((FLE l,r) ^ 1) - (FLT l,r)
+  //     Compare/lt_bias  -1    0    1   -1       = ((FLE r,l) - 1) + (FLT r,l)
+  // These are emitted in `VisitCompare()`.
+  //
+  // This function emits a fused `Condition(Compare(., .), 0)`. If we compare the
+  // `Compare` results above with 0, we get the following values and formulas:
+  //                      l<r  l=r  l>r Unordered
+  //     CondEQ/-          0    1    0    0       = (FEQ l, r)
+  //     CondNE/-          1    0    1    1       = (FEQ l, r) ^ 1
+  //     CondLT/gt_bias    1    0    0    0       = (FLT l,r)
+  //     CondLT/lt_bias    1    0    0    1       = (FLE r,l) ^ 1
+  //     CondLE/gt_bias    1    1    0    0       = (FLE l,r)
+  //     CondLE/lt_bias    1    1    0    1       = (FLT r,l) ^ 1
+  //     CondGT/gt_bias    0    0    1    1       = (FLE l,r) ^ 1
+  //     CondGT/lt_bias    0    0    1    0       = (FLT r,l)
+  //     CondGE/gt_bias    0    1    1    1       = (FLT l,r) ^ 1
+  //     CondGE/lt_bias    0    1    1    0       = (FLE r,l)
+  // (CondEQ/CondNE comparison with zero yields the same result with gt_bias and lt_bias.)
+  //
+  // If the condition is not materialized, the `^ 1` is not emitted,
+  // instead the condition is reversed by emitting BEQZ instead of BNEZ.
+
+  FRegister rs1 = locations->InAt(0).AsFpuRegister<FRegister>();
+  FRegister rs2 = locations->InAt(1).AsFpuRegister<FRegister>();
+
+  bool reverse_condition = false;
+  switch (cond) {
+    case kCondEQ:
+      FEq(rd, rs1, rs2, type);
+      break;
+    case kCondNE:
+      FEq(rd, rs1, rs2, type);
+      reverse_condition = true;
+      break;
+    case kCondLT:
+      if (gt_bias) {
+        FLt(rd, rs1, rs2, type);
+      } else {
+        FLe(rd, rs2, rs1, type);
+        reverse_condition = true;
+      }
+      break;
+    case kCondLE:
+      if (gt_bias) {
+        FLe(rd, rs1, rs2, type);
+      } else {
+        FLt(rd, rs2, rs1, type);
+        reverse_condition = true;
+      }
+      break;
+    case kCondGT:
+      if (gt_bias) {
+        FLe(rd, rs1, rs2, type);
+        reverse_condition = true;
+      } else {
+        FLt(rd, rs2, rs1, type);
+      }
+      break;
+    case kCondGE:
+      if (gt_bias) {
+        FLt(rd, rs1, rs2, type);
+        reverse_condition = true;
+      } else {
+        FLe(rd, rs2, rs1, type);
+      }
+      break;
+    default:
+      LOG(FATAL) << "Unexpected floating-point condition " << cond;
+      UNREACHABLE();
+  }
+
+  if (label != nullptr) {
+    if (reverse_condition) {
+      __ Beqz(rd, label);
+    } else {
+      __ Bnez(rd, label);
+    }
+  } else if (to_all_bits) {
+    // Store the result to all bits; in other words, "true" is represented by -1.
+    if (reverse_condition) {
+      __ Addi(rd, rd, -1);  // 0 -> -1, 1 -> 0
+    } else {
+      __ Neg(rd, rd);  // 0 -> 0, 1 -> -1
+    }
+  } else {
+    if (reverse_condition) {
+      __ Xori(rd, rd, 1);
+    }
+  }
+}
+
+void CodeGeneratorRISCV64::GenerateFieldLoadWithBakerReadBarrier(HInstruction* instruction,
+                                                                 Location ref,
+                                                                 XRegister obj,
+                                                                 uint32_t offset,
+                                                                 Location temp,
+                                                                 bool needs_null_check) {
+  GenerateReferenceLoadWithBakerReadBarrier(
+      instruction, ref, obj, offset, /*index=*/ Location::NoLocation(), temp, needs_null_check);
+}
+
+void CodeGeneratorRISCV64::GenerateArrayLoadWithBakerReadBarrier(HInstruction* instruction,
+                                                                 Location ref,
+                                                                 XRegister obj,
+                                                                 uint32_t data_offset,
+                                                                 Location index,
+                                                                 Location temp,
+                                                                 bool needs_null_check) {
+  GenerateReferenceLoadWithBakerReadBarrier(
+      instruction, ref, obj, data_offset, index, temp, needs_null_check);
+}
+
+void CodeGeneratorRISCV64::GenerateReferenceLoadWithBakerReadBarrier(HInstruction* instruction,
+                                                                     Location ref,
+                                                                     XRegister obj,
+                                                                     uint32_t offset,
+                                                                     Location index,
+                                                                     Location temp,
+                                                                     bool needs_null_check) {
+  // For now, use the same approach as for GC roots plus unpoison the reference if needed.
+  // TODO(riscv64): Implement checking if the holder is black.
+  UNUSED(temp);
+
+  DCHECK(EmitBakerReadBarrier());
+  XRegister reg = ref.AsRegister<XRegister>();
+  if (index.IsValid()) {
+    DCHECK(!needs_null_check);
+    DCHECK(index.IsRegister());
+    DataType::Type type = DataType::Type::kReference;
+    DCHECK_EQ(type, instruction->GetType());
+    if (instruction->IsArrayGet()) {
+      // /* HeapReference<Object> */ ref = *(obj + index * element_size + offset)
+      instruction_visitor_.ShNAdd(reg, index.AsRegister<XRegister>(), obj, type);
+    } else {
+      // /* HeapReference<Object> */ ref = *(obj + index + offset)
+      DCHECK(instruction->IsInvoke());
+      DCHECK(instruction->GetLocations()->Intrinsified());
+      __ Add(reg, index.AsRegister<XRegister>(), obj);
+    }
+    __ Loadwu(reg, reg, offset);
+  } else {
+    // /* HeapReference<Object> */ ref = *(obj + offset)
+    __ Loadwu(reg, obj, offset);
+    if (needs_null_check) {
+      MaybeRecordImplicitNullCheck(instruction);
+    }
+  }
+  MaybeUnpoisonHeapReference(reg);
+
+  // Slow path marking the reference.
+  XRegister tmp = RA;  // Use RA as temp. It is clobbered in the slow path anyway.
+  SlowPathCodeRISCV64* slow_path = new (GetScopedAllocator()) ReadBarrierMarkSlowPathRISCV64(
+      instruction, ref, Location::RegisterLocation(tmp));
+  AddSlowPath(slow_path);
+
+  const int32_t entry_point_offset = ReadBarrierMarkEntrypointOffset(ref);
+  // Loading the entrypoint does not require a load acquire since it is only changed when
+  // threads are suspended or running a checkpoint.
+  __ Loadd(tmp, TR, entry_point_offset);
+  __ Bnez(tmp, slow_path->GetEntryLabel());
+  __ Bind(slow_path->GetExitLabel());
+}
+
+SlowPathCodeRISCV64* CodeGeneratorRISCV64::AddReadBarrierSlowPath(HInstruction* instruction,
+                                                                  Location out,
+                                                                  Location ref,
+                                                                  Location obj,
+                                                                  uint32_t offset,
+                                                                  Location index) {
+  UNUSED(instruction);
+  UNUSED(out);
+  UNUSED(ref);
+  UNUSED(obj);
+  UNUSED(offset);
+  UNUSED(index);
+  LOG(FATAL) << "Unimplemented";
+  UNREACHABLE();
+}
+
+void CodeGeneratorRISCV64::GenerateReadBarrierSlow(HInstruction* instruction,
+                                                   Location out,
+                                                   Location ref,
+                                                   Location obj,
+                                                   uint32_t offset,
+                                                   Location index) {
+  UNUSED(instruction);
+  UNUSED(out);
+  UNUSED(ref);
+  UNUSED(obj);
+  UNUSED(offset);
+  UNUSED(index);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void CodeGeneratorRISCV64::MaybeGenerateReadBarrierSlow(HInstruction* instruction,
+                                                        Location out,
+                                                        Location ref,
+                                                        Location obj,
+                                                        uint32_t offset,
+                                                        Location index) {
+  if (EmitReadBarrier()) {
+    // Baker's read barriers shall be handled by the fast path
+    // (CodeGeneratorRISCV64::GenerateReferenceLoadWithBakerReadBarrier).
+    DCHECK(!kUseBakerReadBarrier);
+    // If heap poisoning is enabled, unpoisoning will be taken care of
+    // by the runtime within the slow path.
+    GenerateReadBarrierSlow(instruction, out, ref, obj, offset, index);
+  } else if (kPoisonHeapReferences) {
+    UnpoisonHeapReference(out.AsRegister<XRegister>());
+  }
+}
+
+void CodeGeneratorRISCV64::GenerateReadBarrierForRootSlow(HInstruction* instruction,
+                                                          Location out,
+                                                          Location root) {
+  DCHECK(EmitReadBarrier());
+
+  // Insert a slow path based read barrier *after* the GC root load.
+  //
+  // Note that GC roots are not affected by heap poisoning, so we do
+  // not need to do anything special for this here.
+  SlowPathCodeRISCV64* slow_path =
+      new (GetScopedAllocator()) ReadBarrierForRootSlowPathRISCV64(instruction, out, root);
+  AddSlowPath(slow_path);
+
+  __ J(slow_path->GetEntryLabel());
+  __ Bind(slow_path->GetExitLabel());
+}
+
+void InstructionCodeGeneratorRISCV64::HandleGoto(HInstruction* instruction,
+                                                 HBasicBlock* successor) {
+  if (successor->IsExitBlock()) {
+    DCHECK(instruction->GetPrevious()->AlwaysThrows());
+    return;  // no code needed
+  }
+
+  HBasicBlock* block = instruction->GetBlock();
+  HInstruction* previous = instruction->GetPrevious();
+  HLoopInformation* info = block->GetLoopInformation();
+
+  if (info != nullptr && info->IsBackEdge(*block) && info->HasSuspendCheck()) {
+    codegen_->MaybeIncrementHotness(info->GetSuspendCheck(), /*is_frame_entry=*/ false);
+    GenerateSuspendCheck(info->GetSuspendCheck(), successor);
+    return;  // `GenerateSuspendCheck()` emitted the jump.
+  }
+  if (block->IsEntryBlock() && previous != nullptr && previous->IsSuspendCheck()) {
+    GenerateSuspendCheck(previous->AsSuspendCheck(), nullptr);
+  }
+  if (!codegen_->GoesToNextBlock(block, successor)) {
+    __ J(codegen_->GetLabelOf(successor));
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::GenPackedSwitchWithCompares(XRegister adjusted,
+                                                                  XRegister temp,
+                                                                  uint32_t num_entries,
+                                                                  HBasicBlock* switch_block) {
+  // Note: The `adjusted` register holds `value - lower_bound`. If the `lower_bound` is 0,
+  // `adjusted` is the original `value` register and we must not clobber it. Otherwise,
+  // `adjusted` is the `temp`. The caller already emitted the `adjusted < num_entries` check.
+
+  // Create a set of compare/jumps.
+  ArrayRef<HBasicBlock* const> successors(switch_block->GetSuccessors());
+  uint32_t index = 0;
+  for (; num_entries - index >= 2u; index += 2u) {
+    // Jump to `successors[index]` if `value == lower_bound + index`.
+    // Note that `adjusted` holds `value - lower_bound - index`.
+    __ Beqz(adjusted, codegen_->GetLabelOf(successors[index]));
+    if (num_entries - index == 2u) {
+      break;  // The last entry shall match, so the branch shall be unconditional.
+    }
+    // Jump to `successors[index + 1]` if `value == lower_bound + index + 1`.
+    // Modify `adjusted` to hold `value - lower_bound - index - 2` for this comparison.
+    __ Addi(temp, adjusted, -2);
+    adjusted = temp;
+    __ Bltz(adjusted, codegen_->GetLabelOf(successors[index + 1]));
+  }
+  // For the last entry, unconditionally jump to `successors[num_entries - 1]`.
+  __ J(codegen_->GetLabelOf(successors[num_entries - 1u]));
+}
+
+void InstructionCodeGeneratorRISCV64::GenTableBasedPackedSwitch(XRegister adjusted,
+                                                                XRegister temp,
+                                                                uint32_t num_entries,
+                                                                HBasicBlock* switch_block) {
+  // Note: The `adjusted` register holds `value - lower_bound`. If the `lower_bound` is 0,
+  // `adjusted` is the original `value` register and we must not clobber it. Otherwise,
+  // `adjusted` is the `temp`. The caller already emitted the `adjusted < num_entries` check.
+
+  // Create a jump table.
+  ArenaVector<Riscv64Label*> labels(num_entries,
+                                    __ GetAllocator()->Adapter(kArenaAllocSwitchTable));
+  const ArenaVector<HBasicBlock*>& successors = switch_block->GetSuccessors();
+  for (uint32_t i = 0; i < num_entries; i++) {
+    labels[i] = codegen_->GetLabelOf(successors[i]);
+  }
+  JumpTable* table = __ CreateJumpTable(std::move(labels));
+
+  // Load the address of the jump table.
+  // Note: The `LoadLabelAddress()` emits AUIPC+ADD. It is possible to avoid the ADD and
+  // instead embed that offset in the LW below as well as all jump table entries but
+  // that would need some invasive changes in the jump table handling in the assembler.
+  ScratchRegisterScope srs(GetAssembler());
+  XRegister table_base = srs.AllocateXRegister();
+  __ LoadLabelAddress(table_base, table->GetLabel());
+
+  // Load the PC difference from the jump table.
+  // TODO(riscv64): Use SH2ADD from the Zba extension.
+  __ Slli(temp, adjusted, 2);
+  __ Add(temp, temp, table_base);
+  __ Lw(temp, temp, 0);
+
+  // Compute the absolute target address by adding the table start address
+  // (the table contains offsets to targets relative to its start).
+  __ Add(temp, temp, table_base);
+  // And jump.
+  __ Jr(temp);
+}
+
+int32_t InstructionCodeGeneratorRISCV64::VecAddress(LocationSummary* locations,
+                                                    size_t size,
+                                                    /*out*/ XRegister* adjusted_base) {
+  UNUSED(locations);
+  UNUSED(size);
+  UNUSED(adjusted_base);
+  LOG(FATAL) << "Unimplemented";
+  UNREACHABLE();
+}
+
+void LocationsBuilderRISCV64::HandleBinaryOp(HBinaryOperation* instruction) {
+  DCHECK_EQ(instruction->InputCount(), 2u);
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  DataType::Type type = instruction->GetResultType();
+  switch (type) {
+    case DataType::Type::kInt32:
+    case DataType::Type::kInt64: {
+      locations->SetInAt(0, Location::RequiresRegister());
+      HInstruction* right = instruction->InputAt(1);
+      bool can_use_imm = false;
+      if (instruction->IsMin() || instruction->IsMax()) {
+        can_use_imm = IsZeroBitPattern(instruction);
+      } else if (right->IsConstant()) {
+        int64_t imm = CodeGenerator::GetInt64ValueOf(right->AsConstant());
+        can_use_imm = IsInt<12>(instruction->IsSub() ? -imm : imm);
+      }
+      if (can_use_imm) {
+        locations->SetInAt(1, Location::ConstantLocation(right));
+      } else {
+        locations->SetInAt(1, Location::RequiresRegister());
+      }
+      locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+      break;
+    }
+
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64:
+      locations->SetInAt(0, Location::RequiresFpuRegister());
+      locations->SetInAt(1, Location::RequiresFpuRegister());
+      if (instruction->IsMin() || instruction->IsMax()) {
+        locations->SetOut(Location::RequiresFpuRegister(), Location::kOutputOverlap);
+      } else {
+        locations->SetOut(Location::RequiresFpuRegister(), Location::kNoOutputOverlap);
+      }
+      break;
+
+    default:
+      LOG(FATAL) << "Unexpected " << instruction->DebugName() << " type " << type;
+      UNREACHABLE();
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::HandleBinaryOp(HBinaryOperation* instruction) {
+  DataType::Type type = instruction->GetType();
+  LocationSummary* locations = instruction->GetLocations();
+
+  switch (type) {
+    case DataType::Type::kInt32:
+    case DataType::Type::kInt64: {
+      XRegister rd = locations->Out().AsRegister<XRegister>();
+      XRegister rs1 = locations->InAt(0).AsRegister<XRegister>();
+      Location rs2_location = locations->InAt(1);
+
+      bool use_imm = rs2_location.IsConstant();
+      XRegister rs2 = use_imm ? kNoXRegister : rs2_location.AsRegister<XRegister>();
+      int64_t imm = use_imm ? CodeGenerator::GetInt64ValueOf(rs2_location.GetConstant()) : 0;
+
+      if (instruction->IsAnd()) {
+        if (use_imm) {
+          __ Andi(rd, rs1, imm);
+        } else {
+          __ And(rd, rs1, rs2);
+        }
+      } else if (instruction->IsOr()) {
+        if (use_imm) {
+          __ Ori(rd, rs1, imm);
+        } else {
+          __ Or(rd, rs1, rs2);
+        }
+      } else if (instruction->IsXor()) {
+        if (use_imm) {
+          __ Xori(rd, rs1, imm);
+        } else {
+          __ Xor(rd, rs1, rs2);
+        }
+      } else if (instruction->IsAdd() || instruction->IsSub()) {
+        if (type == DataType::Type::kInt32) {
+          if (use_imm) {
+            __ Addiw(rd, rs1, instruction->IsSub() ? -imm : imm);
+          } else if (instruction->IsAdd()) {
+            __ Addw(rd, rs1, rs2);
+          } else {
+            DCHECK(instruction->IsSub());
+            __ Subw(rd, rs1, rs2);
+          }
+        } else {
+          if (use_imm) {
+            __ Addi(rd, rs1, instruction->IsSub() ? -imm : imm);
+          } else if (instruction->IsAdd()) {
+            __ Add(rd, rs1, rs2);
+          } else {
+            DCHECK(instruction->IsSub());
+            __ Sub(rd, rs1, rs2);
+          }
+        }
+      } else if (instruction->IsMin()) {
+        DCHECK_IMPLIES(use_imm, imm == 0);
+        __ Min(rd, rs1, use_imm ? Zero : rs2);
+      } else {
+        DCHECK(instruction->IsMax());
+        DCHECK_IMPLIES(use_imm, imm == 0);
+        __ Max(rd, rs1, use_imm ? Zero : rs2);
+      }
+      break;
+    }
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64: {
+      FRegister rd = locations->Out().AsFpuRegister<FRegister>();
+      FRegister rs1 = locations->InAt(0).AsFpuRegister<FRegister>();
+      FRegister rs2 = locations->InAt(1).AsFpuRegister<FRegister>();
+      if (instruction->IsAdd()) {
+        FAdd(rd, rs1, rs2, type);
+      } else if (instruction->IsSub()) {
+        FSub(rd, rs1, rs2, type);
+      } else {
+        DCHECK(instruction->IsMin() || instruction->IsMax());
+        // If one of the operands is NaN and the other is not, riscv64 instructions FMIN/FMAX
+        // return the other operand while we want to return the NaN operand.
+        DCHECK_NE(rd, rs1);  // Requested `Location::kOutputOverlap`.
+        DCHECK_NE(rd, rs2);  // Requested `Location::kOutputOverlap`.
+        ScratchRegisterScope srs(GetAssembler());
+        XRegister tmp = srs.AllocateXRegister();
+        XRegister tmp2 = srs.AllocateXRegister();
+        Riscv64Label done;
+        // Return `rs1` if it's NaN.
+        FClass(tmp, rs1, type);
+        __ Li(tmp2, kFClassNaNMinValue);
+        FMv(rd, rs1, type);
+        __ Bgeu(tmp, tmp2, &done);
+        // Return `rs2` if it's NaN.
+        FClass(tmp, rs2, type);
+        FMv(rd, rs2, type);
+        __ Bgeu(tmp, tmp2, &done);
+        // Calculate Min/Max for non-NaN arguments.
+        if (instruction->IsMin()) {
+          FMin(rd, rs1, rs2, type);
+        } else {
+          FMax(rd, rs1, rs2, type);
+        }
+        __ Bind(&done);
+      }
+      break;
+    }
+    default:
+      LOG(FATAL) << "Unexpected binary operation type " << type;
+      UNREACHABLE();
+  }
+}
+
+void LocationsBuilderRISCV64::HandleCondition(HCondition* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  switch (instruction->InputAt(0)->GetType()) {
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64:
+      locations->SetInAt(0, Location::RequiresFpuRegister());
+      locations->SetInAt(1, Location::RequiresFpuRegister());
+      break;
+
+    default: {
+      locations->SetInAt(0, Location::RequiresRegister());
+      HInstruction* rhs = instruction->InputAt(1);
+      bool use_imm = false;
+      if (rhs->IsConstant()) {
+        int64_t imm = CodeGenerator::GetInt64ValueOf(rhs->AsConstant());
+        if (instruction->IsEmittedAtUseSite()) {
+          // For `HIf`, materialize all non-zero constants with an `HParallelMove`.
+          // Note: For certain constants and conditions, the code could be improved.
+          // For example, 2048 takes two instructions to materialize but the negative
+          // -2048 could be embedded in ADDI for EQ/NE comparison.
+          use_imm = (imm == 0);
+        } else {
+          // Constants that cannot be embedded in an instruction's 12-bit immediate shall be
+          // materialized with an `HParallelMove`. This simplifies the code and avoids cases
+          // with arithmetic overflow. Adjust the `imm` if needed for a particular instruction.
+          switch (instruction->GetCondition()) {
+            case kCondEQ:
+            case kCondNE:
+              imm = -imm;  // ADDI with negative immediate (there is no SUBI).
+              break;
+            case kCondLE:
+            case kCondGT:
+            case kCondBE:
+            case kCondA:
+              imm += 1;    // SLTI/SLTIU with adjusted immediate (there is no SLEI/SLEIU).
+              break;
+            default:
+              break;
+          }
+          use_imm = IsInt<12>(imm);
+        }
+      }
+      if (use_imm) {
+        locations->SetInAt(1, Location::ConstantLocation(rhs));
+      } else {
+        locations->SetInAt(1, Location::RequiresRegister());
+      }
+      break;
+    }
+  }
+  if (!instruction->IsEmittedAtUseSite()) {
+    locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::HandleCondition(HCondition* instruction) {
+  if (instruction->IsEmittedAtUseSite()) {
+    return;
+  }
+
+  DataType::Type type = instruction->InputAt(0)->GetType();
+  LocationSummary* locations = instruction->GetLocations();
+  switch (type) {
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64:
+      GenerateFpCondition(instruction->GetCondition(), instruction->IsGtBias(), type, locations);
+      return;
+    default:
+      // Integral types and reference equality.
+      GenerateIntLongCondition(instruction->GetCondition(), locations);
+      return;
+  }
+}
+
+void LocationsBuilderRISCV64::HandleShift(HBinaryOperation* instruction) {
+  DCHECK(instruction->IsShl() ||
+         instruction->IsShr() ||
+         instruction->IsUShr() ||
+         instruction->IsRor());
+
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  DataType::Type type = instruction->GetResultType();
+  switch (type) {
+    case DataType::Type::kInt32:
+    case DataType::Type::kInt64: {
+      locations->SetInAt(0, Location::RequiresRegister());
+      locations->SetInAt(1, Location::RegisterOrConstant(instruction->InputAt(1)));
+      locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+      break;
+    }
+    default:
+      LOG(FATAL) << "Unexpected shift type " << type;
+      UNREACHABLE();
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::HandleShift(HBinaryOperation* instruction) {
+  DCHECK(instruction->IsShl() ||
+         instruction->IsShr() ||
+         instruction->IsUShr() ||
+         instruction->IsRor());
+  LocationSummary* locations = instruction->GetLocations();
+  DataType::Type type = instruction->GetType();
+
+  switch (type) {
+    case DataType::Type::kInt32:
+    case DataType::Type::kInt64: {
+      XRegister rd = locations->Out().AsRegister<XRegister>();
+      XRegister rs1 = locations->InAt(0).AsRegister<XRegister>();
+      Location rs2_location = locations->InAt(1);
+
+      if (rs2_location.IsConstant()) {
+        int64_t imm = CodeGenerator::GetInt64ValueOf(rs2_location.GetConstant());
+        uint32_t shamt =
+            imm & (type == DataType::Type::kInt32 ? kMaxIntShiftDistance : kMaxLongShiftDistance);
+
+        if (shamt == 0) {
+          if (rd != rs1) {
+            __ Mv(rd, rs1);
+          }
+        } else if (type == DataType::Type::kInt32) {
+          if (instruction->IsShl()) {
+            __ Slliw(rd, rs1, shamt);
+          } else if (instruction->IsShr()) {
+            __ Sraiw(rd, rs1, shamt);
+          } else if (instruction->IsUShr()) {
+            __ Srliw(rd, rs1, shamt);
+          } else {
+            DCHECK(instruction->IsRor());
+            __ Roriw(rd, rs1, shamt);
+          }
+        } else {
+          if (instruction->IsShl()) {
+            __ Slli(rd, rs1, shamt);
+          } else if (instruction->IsShr()) {
+            __ Srai(rd, rs1, shamt);
+          } else if (instruction->IsUShr()) {
+            __ Srli(rd, rs1, shamt);
+          } else {
+            DCHECK(instruction->IsRor());
+            __ Rori(rd, rs1, shamt);
+          }
+        }
+      } else {
+        XRegister rs2 = rs2_location.AsRegister<XRegister>();
+        if (type == DataType::Type::kInt32) {
+          if (instruction->IsShl()) {
+            __ Sllw(rd, rs1, rs2);
+          } else if (instruction->IsShr()) {
+            __ Sraw(rd, rs1, rs2);
+          } else if (instruction->IsUShr()) {
+            __ Srlw(rd, rs1, rs2);
+          } else {
+            DCHECK(instruction->IsRor());
+            __ Rorw(rd, rs1, rs2);
+          }
+        } else {
+          if (instruction->IsShl()) {
+            __ Sll(rd, rs1, rs2);
+          } else if (instruction->IsShr()) {
+            __ Sra(rd, rs1, rs2);
+          } else if (instruction->IsUShr()) {
+            __ Srl(rd, rs1, rs2);
+          } else {
+            DCHECK(instruction->IsRor());
+            __ Ror(rd, rs1, rs2);
+          }
+        }
+      }
+      break;
+    }
+    default:
+      LOG(FATAL) << "Unexpected shift operation type " << type;
+  }
+}
+
+void CodeGeneratorRISCV64::MaybeMarkGCCard(XRegister object,
+                                           XRegister value,
+                                           bool value_can_be_null) {
+  Riscv64Label done;
+  if (value_can_be_null) {
+    __ Beqz(value, &done);
+  }
+  MarkGCCard(object);
+  __ Bind(&done);
+}
+
+void CodeGeneratorRISCV64::MarkGCCard(XRegister object) {
+  ScratchRegisterScope srs(GetAssembler());
+  XRegister card = srs.AllocateXRegister();
+  XRegister temp = srs.AllocateXRegister();
+  // Load the address of the card table into `card`.
+  __ Loadd(card, TR, Thread::CardTableOffset<kRiscv64PointerSize>().Int32Value());
+
+  // Calculate the address of the card corresponding to `object`.
+  __ Srli(temp, object, gc::accounting::CardTable::kCardShift);
+  __ Add(temp, card, temp);
+  // Write the `art::gc::accounting::CardTable::kCardDirty` value into the
+  // `object`'s card.
+  //
+  // Register `card` contains the address of the card table. Note that the card
+  // table's base is biased during its creation so that it always starts at an
+  // address whose least-significant byte is equal to `kCardDirty` (see
+  // art::gc::accounting::CardTable::Create). Therefore the SB instruction
+  // below writes the `kCardDirty` (byte) value into the `object`'s card
+  // (located at `card + object >> kCardShift`).
+  //
+  // This dual use of the value in register `card` (1. to calculate the location
+  // of the card to mark; and 2. to load the `kCardDirty` value) saves a load
+  // (no need to explicitly load `kCardDirty` as an immediate value).
+  __ Sb(card, temp, 0);  // No scratch register left for `Storeb()`.
+}
+
+void CodeGeneratorRISCV64::CheckGCCardIsValid(XRegister object) {
+  Riscv64Label done;
+  ScratchRegisterScope srs(GetAssembler());
+  XRegister card = srs.AllocateXRegister();
+  XRegister temp = srs.AllocateXRegister();
+  // Load the address of the card table into `card`.
+  __ Loadd(card, TR, Thread::CardTableOffset<kRiscv64PointerSize>().Int32Value());
+
+  // Calculate the address of the card corresponding to `object`.
+  __ Srli(temp, object, gc::accounting::CardTable::kCardShift);
+  __ Add(temp, card, temp);
+  // assert (!clean || !self->is_gc_marking)
+  __ Lb(temp, temp, 0);
+  static_assert(gc::accounting::CardTable::kCardClean == 0);
+  __ Bnez(temp, &done);
+  __ Loadw(temp, TR, Thread::IsGcMarkingOffset<kRiscv64PointerSize>().Int32Value());
+  __ Beqz(temp, &done);
+  __ Unimp();
+  __ Bind(&done);
+}
+
+void LocationsBuilderRISCV64::HandleFieldSet(HInstruction* instruction) {
+  LocationSummary* locations =
+      new (GetGraph()->GetAllocator()) LocationSummary(instruction, LocationSummary::kNoCall);
+  locations->SetInAt(0, Location::RequiresRegister());
+  locations->SetInAt(1, ValueLocationForStore(instruction->InputAt(1)));
+}
+
+void InstructionCodeGeneratorRISCV64::HandleFieldSet(HInstruction* instruction,
+                                                     const FieldInfo& field_info,
+                                                     bool value_can_be_null,
+                                                     WriteBarrierKind write_barrier_kind) {
+  DataType::Type type = field_info.GetFieldType();
+  LocationSummary* locations = instruction->GetLocations();
+  XRegister obj = locations->InAt(0).AsRegister<XRegister>();
+  Location value = locations->InAt(1);
+  DCHECK_IMPLIES(value.IsConstant(), IsZeroBitPattern(value.GetConstant()));
+  bool is_volatile = field_info.IsVolatile();
+  uint32_t offset = field_info.GetFieldOffset().Uint32Value();
+
+  if (is_volatile) {
+    StoreSeqCst(value, obj, offset, type, instruction);
+  } else {
+    Store(value, obj, offset, type);
+    codegen_->MaybeRecordImplicitNullCheck(instruction);
+  }
+
+  bool needs_write_barrier =
+      codegen_->StoreNeedsWriteBarrier(type, instruction->InputAt(1), write_barrier_kind);
+  if (needs_write_barrier) {
+    if (value.IsConstant()) {
+      DCHECK_EQ(write_barrier_kind, WriteBarrierKind::kEmitBeingReliedOn);
+      codegen_->MarkGCCard(obj);
+    } else {
+      codegen_->MaybeMarkGCCard(
+          obj,
+          value.AsRegister<XRegister>(),
+          value_can_be_null && write_barrier_kind == WriteBarrierKind::kEmitNotBeingReliedOn);
+    }
+  } else if (codegen_->ShouldCheckGCCard(type, instruction->InputAt(1), write_barrier_kind)) {
+    codegen_->CheckGCCardIsValid(obj);
+  }
+}
+
+void LocationsBuilderRISCV64::HandleFieldGet(HInstruction* instruction) {
+  DCHECK(instruction->IsInstanceFieldGet() || instruction->IsStaticFieldGet());
+
+  bool object_field_get_with_read_barrier =
+      (instruction->GetType() == DataType::Type::kReference) && codegen_->EmitReadBarrier();
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(
+      instruction,
+      object_field_get_with_read_barrier
+          ? LocationSummary::kCallOnSlowPath
+          : LocationSummary::kNoCall);
+
+  // Input for object receiver.
+  locations->SetInAt(0, Location::RequiresRegister());
+
+  if (DataType::IsFloatingPointType(instruction->GetType())) {
+    locations->SetOut(Location::RequiresFpuRegister());
+  } else {
+    // The output overlaps for an object field get when read barriers
+    // are enabled: we do not want the load to overwrite the object's
+    // location, as we need it to emit the read barrier.
+    locations->SetOut(
+        Location::RequiresRegister(),
+        object_field_get_with_read_barrier ? Location::kOutputOverlap : Location::kNoOutputOverlap);
+  }
+
+  if (object_field_get_with_read_barrier && kUseBakerReadBarrier) {
+    locations->SetCustomSlowPathCallerSaves(RegisterSet::Empty());  // No caller-save registers.
+    // We need a temporary register for the read barrier marking slow
+    // path in CodeGeneratorRISCV64::GenerateFieldLoadWithBakerReadBarrier.
+    locations->AddTemp(Location::RequiresRegister());
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::HandleFieldGet(HInstruction* instruction,
+                                                     const FieldInfo& field_info) {
+  DCHECK(instruction->IsInstanceFieldGet() || instruction->IsStaticFieldGet());
+  DCHECK_EQ(DataType::Size(field_info.GetFieldType()), DataType::Size(instruction->GetType()));
+  DataType::Type type = instruction->GetType();
+  LocationSummary* locations = instruction->GetLocations();
+  Location obj_loc = locations->InAt(0);
+  XRegister obj = obj_loc.AsRegister<XRegister>();
+  Location dst_loc = locations->Out();
+  bool is_volatile = field_info.IsVolatile();
+  uint32_t offset = field_info.GetFieldOffset().Uint32Value();
+
+  if (is_volatile) {
+    codegen_->GenerateMemoryBarrier(MemBarrierKind::kAnyAny);
+  }
+
+  if (type == DataType::Type::kReference && codegen_->EmitBakerReadBarrier()) {
+    // /* HeapReference<Object> */ dst = *(obj + offset)
+    Location temp_loc = locations->GetTemp(0);
+    // Note that a potential implicit null check is handled in this
+    // CodeGeneratorRISCV64::GenerateFieldLoadWithBakerReadBarrier call.
+    codegen_->GenerateFieldLoadWithBakerReadBarrier(instruction,
+                                                    dst_loc,
+                                                    obj,
+                                                    offset,
+                                                    temp_loc,
+                                                    /* needs_null_check= */ true);
+  } else {
+    Load(dst_loc, obj, offset, type);
+    codegen_->MaybeRecordImplicitNullCheck(instruction);
+  }
+
+  if (is_volatile) {
+    codegen_->GenerateMemoryBarrier(MemBarrierKind::kLoadAny);
+  }
+
+  if (type == DataType::Type::kReference && !codegen_->EmitBakerReadBarrier()) {
+    // If read barriers are enabled, emit read barriers other than
+    // Baker's using a slow path (and also unpoison the loaded
+    // reference, if heap poisoning is enabled).
+    codegen_->MaybeGenerateReadBarrierSlow(instruction, dst_loc, dst_loc, obj_loc, offset);
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::GenerateMethodEntryExitHook(HInstruction* instruction) {
+  SlowPathCodeRISCV64* slow_path =
+      new (codegen_->GetScopedAllocator()) MethodEntryExitHooksSlowPathRISCV64(instruction);
+  codegen_->AddSlowPath(slow_path);
+
+  ScratchRegisterScope temps(GetAssembler());
+  XRegister tmp = temps.AllocateXRegister();
+
+  if (instruction->IsMethodExitHook()) {
+    // Check if we are required to check if the caller needs a deoptimization. Strictly speaking it
+    // would be sufficient to check if CheckCallerForDeopt bit is set. Though it is faster to check
+    // if it is just non-zero. kCHA bit isn't used in debuggable runtimes as cha optimization is
+    // disabled in debuggable runtime. The other bit is used when this method itself requires a
+    // deoptimization due to redefinition. So it is safe to just check for non-zero value here.
+    __ Loadwu(tmp, SP, codegen_->GetStackOffsetOfShouldDeoptimizeFlag());
+    __ Bnez(tmp, slow_path->GetEntryLabel());
+  }
+
+  uint64_t hook_offset = instruction->IsMethodExitHook() ?
+      instrumentation::Instrumentation::HaveMethodExitListenersOffset().SizeValue() :
+      instrumentation::Instrumentation::HaveMethodEntryListenersOffset().SizeValue();
+  auto [base_hook_address, hook_imm12] = SplitJitAddress(
+      reinterpret_cast64<uint64_t>(Runtime::Current()->GetInstrumentation()) + hook_offset);
+  __ LoadConst64(tmp, base_hook_address);
+  __ Lbu(tmp, tmp, hook_imm12);
+  // Check if there are any method entry / exit listeners. If no, continue.
+  __ Beqz(tmp, slow_path->GetExitLabel());
+  // Check if there are any slow (jvmti / trace with thread cpu time) method entry / exit listeners.
+  // If yes, just take the slow path.
+  static_assert(instrumentation::Instrumentation::kFastTraceListeners == 1u);
+  __ Addi(tmp, tmp, -1);
+  __ Bnez(tmp, slow_path->GetEntryLabel());
+
+  // Check if there is place in the buffer to store a new entry, if no, take the slow path.
+  int32_t trace_buffer_index_offset =
+      Thread::TraceBufferIndexOffset<kRiscv64PointerSize>().Int32Value();
+  __ Loadd(tmp, TR, trace_buffer_index_offset);
+  __ Addi(tmp, tmp, -dchecked_integral_cast<int32_t>(kNumEntriesForWallClock));
+  __ Bltz(tmp, slow_path->GetEntryLabel());
+
+  // Update the index in the `Thread`.
+  __ Stored(tmp, TR, trace_buffer_index_offset);
+
+  // Allocate second core scratch register. We can no longer use `Stored()`
+  // and similar macro instructions because there is no core scratch register left.
+  XRegister tmp2 = temps.AllocateXRegister();
+
+  // Calculate the entry address in the buffer.
+  // /*addr*/ tmp = TR->GetMethodTraceBuffer() + sizeof(void*) * /*index*/ tmp;
+  __ Loadd(tmp2, TR, Thread::TraceBufferPtrOffset<kRiscv64PointerSize>().SizeValue());
+  __ Sh3Add(tmp, tmp, tmp2);
+
+  // Record method pointer and trace action.
+  __ Ld(tmp2, SP, 0);
+  // Use last two bits to encode trace method action. For MethodEntry it is 0
+  // so no need to set the bits since they are 0 already.
+  DCHECK_GE(ArtMethod::Alignment(kRuntimePointerSize), static_cast<size_t>(4));
+  static_assert(enum_cast<int32_t>(TraceAction::kTraceMethodEnter) == 0);
+  static_assert(enum_cast<int32_t>(TraceAction::kTraceMethodExit) == 1);
+  if (instruction->IsMethodExitHook()) {
+    __ Ori(tmp2, tmp2, enum_cast<int32_t>(TraceAction::kTraceMethodExit));
+  }
+  static_assert(IsInt<12>(kMethodOffsetInBytes));  // No free scratch register for `Stored()`.
+  __ Sd(tmp2, tmp, kMethodOffsetInBytes);
+
+  // Record the timestamp.
+  __ RdTime(tmp2);
+  static_assert(IsInt<12>(kTimestampOffsetInBytes));  // No free scratch register for `Stored()`.
+  __ Sd(tmp2, tmp, kTimestampOffsetInBytes);
+
+  __ Bind(slow_path->GetExitLabel());
+}
+
+void LocationsBuilderRISCV64::VisitAbove(HAbove* instruction) {
+  HandleCondition(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitAbove(HAbove* instruction) {
+  HandleCondition(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitAboveOrEqual(HAboveOrEqual* instruction) {
+  HandleCondition(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitAboveOrEqual(HAboveOrEqual* instruction) {
+  HandleCondition(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitAbs(HAbs* abs) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(abs);
+  switch (abs->GetResultType()) {
+    case DataType::Type::kInt32:
+    case DataType::Type::kInt64:
+      locations->SetInAt(0, Location::RequiresRegister());
+      locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+      break;
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64:
+      locations->SetInAt(0, Location::RequiresFpuRegister());
+      locations->SetOut(Location::RequiresFpuRegister(), Location::kNoOutputOverlap);
+      break;
+    default:
+      LOG(FATAL) << "Unexpected abs type " << abs->GetResultType();
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::VisitAbs(HAbs* abs) {
+  LocationSummary* locations = abs->GetLocations();
+  switch (abs->GetResultType()) {
+    case DataType::Type::kInt32: {
+      XRegister in = locations->InAt(0).AsRegister<XRegister>();
+      XRegister out = locations->Out().AsRegister<XRegister>();
+      ScratchRegisterScope srs(GetAssembler());
+      XRegister tmp = srs.AllocateXRegister();
+      __ Sraiw(tmp, in, 31);
+      __ Xor(out, in, tmp);
+      __ Subw(out, out, tmp);
+      break;
+    }
+    case DataType::Type::kInt64: {
+      XRegister in = locations->InAt(0).AsRegister<XRegister>();
+      XRegister out = locations->Out().AsRegister<XRegister>();
+      ScratchRegisterScope srs(GetAssembler());
+      XRegister tmp = srs.AllocateXRegister();
+      __ Srai(tmp, in, 63);
+      __ Xor(out, in, tmp);
+      __ Sub(out, out, tmp);
+      break;
+    }
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64:
+      FAbs(locations->Out().AsFpuRegister<FRegister>(),
+           locations->InAt(0).AsFpuRegister<FRegister>(),
+           abs->GetResultType());
+      break;
+    default:
+      LOG(FATAL) << "Unexpected abs type " << abs->GetResultType();
+  }
+}
+
+void LocationsBuilderRISCV64::VisitAdd(HAdd* instruction) {
+  HandleBinaryOp(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitAdd(HAdd* instruction) {
+  HandleBinaryOp(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitAnd(HAnd* instruction) {
+  HandleBinaryOp(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitAnd(HAnd* instruction) {
+  HandleBinaryOp(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitArrayGet(HArrayGet* instruction) {
+  DataType::Type type = instruction->GetType();
+  bool object_array_get_with_read_barrier =
+      (type == DataType::Type::kReference) && codegen_->EmitReadBarrier();
+  LocationSummary* locations = new (GetGraph()->GetAllocator())
+      LocationSummary(instruction,
+                      object_array_get_with_read_barrier ? LocationSummary::kCallOnSlowPath :
+                                                           LocationSummary::kNoCall);
+  locations->SetInAt(0, Location::RequiresRegister());
+  locations->SetInAt(1, Location::RegisterOrConstant(instruction->InputAt(1)));
+  if (DataType::IsFloatingPointType(type)) {
+    locations->SetOut(Location::RequiresFpuRegister(), Location::kNoOutputOverlap);
+  } else {
+    // The output overlaps in the case of an object array get with
+    // read barriers enabled: we do not want the move to overwrite the
+    // array's location, as we need it to emit the read barrier.
+    locations->SetOut(
+        Location::RequiresRegister(),
+        object_array_get_with_read_barrier ? Location::kOutputOverlap : Location::kNoOutputOverlap);
+  }
+  if (object_array_get_with_read_barrier && kUseBakerReadBarrier) {
+    locations->SetCustomSlowPathCallerSaves(RegisterSet::Empty());  // No caller-save registers.
+    // We need a temporary register for the read barrier marking slow
+    // path in CodeGeneratorRISCV64::GenerateArrayLoadWithBakerReadBarrier.
+    locations->AddTemp(Location::RequiresRegister());
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::VisitArrayGet(HArrayGet* instruction) {
+  LocationSummary* locations = instruction->GetLocations();
+  Location obj_loc = locations->InAt(0);
+  XRegister obj = obj_loc.AsRegister<XRegister>();
+  Location out_loc = locations->Out();
+  Location index = locations->InAt(1);
+  uint32_t data_offset = CodeGenerator::GetArrayDataOffset(instruction);
+  DataType::Type type = instruction->GetType();
+  const bool maybe_compressed_char_at =
+      mirror::kUseStringCompression && instruction->IsStringCharAt();
+
+  Riscv64Label string_char_at_done;
+  if (maybe_compressed_char_at) {
+    DCHECK_EQ(type, DataType::Type::kUint16);
+    uint32_t count_offset = mirror::String::CountOffset().Uint32Value();
+    Riscv64Label uncompressed_load;
+    {
+      ScratchRegisterScope srs(GetAssembler());
+      XRegister tmp = srs.AllocateXRegister();
+      __ Loadw(tmp, obj, count_offset);
+      codegen_->MaybeRecordImplicitNullCheck(instruction);
+      __ Andi(tmp, tmp, 0x1);
+      static_assert(static_cast<uint32_t>(mirror::StringCompressionFlag::kCompressed) == 0u,
+                    "Expecting 0=compressed, 1=uncompressed");
+      __ Bnez(tmp, &uncompressed_load);
+    }
+    XRegister out = out_loc.AsRegister<XRegister>();
+    if (index.IsConstant()) {
+        int32_t const_index = index.GetConstant()->AsIntConstant()->GetValue();
+      __ Loadbu(out, obj, data_offset + const_index);
+    } else {
+      __ Add(out, obj, index.AsRegister<XRegister>());
+      __ Loadbu(out, out, data_offset);
+    }
+    __ J(&string_char_at_done);
+    __ Bind(&uncompressed_load);
+  }
+
+  if (type == DataType::Type::kReference && codegen_->EmitBakerReadBarrier()) {
+    static_assert(
+        sizeof(mirror::HeapReference<mirror::Object>) == sizeof(int32_t),
+        "art::mirror::HeapReference<art::mirror::Object> and int32_t have different sizes.");
+    // /* HeapReference<Object> */ out =
+    //     *(obj + data_offset + index * sizeof(HeapReference<Object>))
+    // Note that a potential implicit null check could be handled in these
+    // `CodeGeneratorRISCV64::Generate{Array,Field}LoadWithBakerReadBarrier()` calls
+    // but we currently do not support implicit null checks on `HArrayGet`.
+    DCHECK(!instruction->CanDoImplicitNullCheckOn(instruction->InputAt(0)));
+    Location temp = locations->GetTemp(0);
+    if (index.IsConstant()) {
+      // Array load with a constant index can be treated as a field load.
+      static constexpr size_t shift = DataType::SizeShift(DataType::Type::kReference);
+      size_t offset = (index.GetConstant()->AsIntConstant()->GetValue() << shift) + data_offset;
+      codegen_->GenerateFieldLoadWithBakerReadBarrier(instruction,
+                                                      out_loc,
+                                                      obj,
+                                                      offset,
+                                                      temp,
+                                                      /* needs_null_check= */ false);
+    } else {
+      codegen_->GenerateArrayLoadWithBakerReadBarrier(instruction,
+                                                      out_loc,
+                                                      obj,
+                                                      data_offset,
+                                                      index,
+                                                      temp,
+                                                      /* needs_null_check= */ false);
+    }
+  } else if (index.IsConstant()) {
+    int32_t const_index = index.GetConstant()->AsIntConstant()->GetValue();
+    int32_t offset = data_offset + (const_index << DataType::SizeShift(type));
+    Load(out_loc, obj, offset, type);
+    if (!maybe_compressed_char_at) {
+      codegen_->MaybeRecordImplicitNullCheck(instruction);
+    }
+    if (type == DataType::Type::kReference) {
+      DCHECK(!codegen_->EmitBakerReadBarrier());
+      // If read barriers are enabled, emit read barriers other than Baker's using
+      // a slow path (and also unpoison the loaded reference, if heap poisoning is enabled).
+      codegen_->MaybeGenerateReadBarrierSlow(instruction, out_loc, out_loc, obj_loc, offset);
+    }
+  } else {
+    ScratchRegisterScope srs(GetAssembler());
+    XRegister tmp = srs.AllocateXRegister();
+    ShNAdd(tmp, index.AsRegister<XRegister>(), obj, type);
+    Load(out_loc, tmp, data_offset, type);
+    if (!maybe_compressed_char_at) {
+      codegen_->MaybeRecordImplicitNullCheck(instruction);
+    }
+    if (type == DataType::Type::kReference) {
+      DCHECK(!codegen_->EmitBakerReadBarrier());
+      // If read barriers are enabled, emit read barriers other than Baker's using
+      // a slow path (and also unpoison the loaded reference, if heap poisoning is enabled).
+      codegen_->MaybeGenerateReadBarrierSlow(
+          instruction, out_loc, out_loc, obj_loc, data_offset, index);
+    }
+  }
+
+  if (maybe_compressed_char_at) {
+    __ Bind(&string_char_at_done);
+  }
+}
+
+void LocationsBuilderRISCV64::VisitArrayLength(HArrayLength* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  locations->SetInAt(0, Location::RequiresRegister());
+  locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitArrayLength(HArrayLength* instruction) {
+  LocationSummary* locations = instruction->GetLocations();
+  uint32_t offset = CodeGenerator::GetArrayLengthOffset(instruction);
+  XRegister obj = locations->InAt(0).AsRegister<XRegister>();
+  XRegister out = locations->Out().AsRegister<XRegister>();
+  __ Loadwu(out, obj, offset);  // Unsigned for string length; does not matter for other arrays.
+  codegen_->MaybeRecordImplicitNullCheck(instruction);
+  // Mask out compression flag from String's array length.
+  if (mirror::kUseStringCompression && instruction->IsStringLength()) {
+    __ Srli(out, out, 1u);
+  }
+}
+
+void LocationsBuilderRISCV64::VisitArraySet(HArraySet* instruction) {
+  bool needs_type_check = instruction->NeedsTypeCheck();
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(
+      instruction,
+      needs_type_check ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall);
+  locations->SetInAt(0, Location::RequiresRegister());
+  locations->SetInAt(1, Location::RegisterOrConstant(instruction->InputAt(1)));
+  locations->SetInAt(2, ValueLocationForStore(instruction->GetValue()));
+  if (kPoisonHeapReferences &&
+      instruction->GetComponentType() == DataType::Type::kReference &&
+      !locations->InAt(1).IsConstant() &&
+      !locations->InAt(2).IsConstant()) {
+    locations->AddTemp(Location::RequiresRegister());
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::VisitArraySet(HArraySet* instruction) {
+  LocationSummary* locations = instruction->GetLocations();
+  XRegister array = locations->InAt(0).AsRegister<XRegister>();
+  Location index = locations->InAt(1);
+  Location value = locations->InAt(2);
+  DataType::Type value_type = instruction->GetComponentType();
+  bool needs_type_check = instruction->NeedsTypeCheck();
+  const WriteBarrierKind write_barrier_kind = instruction->GetWriteBarrierKind();
+  bool needs_write_barrier =
+      codegen_->StoreNeedsWriteBarrier(value_type, instruction->GetValue(), write_barrier_kind);
+  size_t data_offset = mirror::Array::DataOffset(DataType::Size(value_type)).Uint32Value();
+  SlowPathCodeRISCV64* slow_path = nullptr;
+
+  if (needs_write_barrier) {
+    DCHECK_EQ(value_type, DataType::Type::kReference);
+    DCHECK_IMPLIES(value.IsConstant(), value.GetConstant()->IsArithmeticZero());
+    const bool storing_constant_zero = value.IsConstant();
+    if (!storing_constant_zero) {
+      Riscv64Label do_store;
+
+      bool can_value_be_null = instruction->GetValueCanBeNull();
+      if (can_value_be_null) {
+        __ Beqz(value.AsRegister<XRegister>(), &do_store);
+      }
+
+      if (needs_type_check) {
+        slow_path = new (codegen_->GetScopedAllocator()) ArraySetSlowPathRISCV64(instruction);
+        codegen_->AddSlowPath(slow_path);
+
+        uint32_t class_offset = mirror::Object::ClassOffset().Int32Value();
+        uint32_t super_offset = mirror::Class::SuperClassOffset().Int32Value();
+        uint32_t component_offset = mirror::Class::ComponentTypeOffset().Int32Value();
+
+        ScratchRegisterScope srs(GetAssembler());
+        XRegister temp1 = srs.AllocateXRegister();
+        XRegister temp2 = srs.AllocateXRegister();
+
+        // Note that when read barriers are enabled, the type checks are performed
+        // without read barriers.  This is fine, even in the case where a class object
+        // is in the from-space after the flip, as a comparison involving such a type
+        // would not produce a false positive; it may of course produce a false
+        // negative, in which case we would take the ArraySet slow path.
+
+        // /* HeapReference<Class> */ temp1 = array->klass_
+        __ Loadwu(temp1, array, class_offset);
+        codegen_->MaybeRecordImplicitNullCheck(instruction);
+        codegen_->MaybeUnpoisonHeapReference(temp1);
+
+        // /* HeapReference<Class> */ temp2 = temp1->component_type_
+        __ Loadwu(temp2, temp1, component_offset);
+        // /* HeapReference<Class> */ temp1 = value->klass_
+        __ Loadwu(temp1, value.AsRegister<XRegister>(), class_offset);
+        // If heap poisoning is enabled, no need to unpoison `temp1`
+        // nor `temp2`, as we are comparing two poisoned references.
+        if (instruction->StaticTypeOfArrayIsObjectArray()) {
+          Riscv64Label do_put;
+          __ Beq(temp1, temp2, &do_put);
+          // If heap poisoning is enabled, the `temp2` reference has
+          // not been unpoisoned yet; unpoison it now.
+          codegen_->MaybeUnpoisonHeapReference(temp2);
+
+          // /* HeapReference<Class> */ temp1 = temp2->super_class_
+          __ Loadwu(temp1, temp2, super_offset);
+          // If heap poisoning is enabled, no need to unpoison
+          // `temp1`, as we are comparing against null below.
+          __ Bnez(temp1, slow_path->GetEntryLabel());
+          __ Bind(&do_put);
+        } else {
+          __ Bne(temp1, temp2, slow_path->GetEntryLabel());
+        }
+      }
+
+      if (can_value_be_null) {
+        __ Bind(&do_store);
+      }
+    }
+
+    DCHECK_NE(write_barrier_kind, WriteBarrierKind::kDontEmit);
+    // TODO(solanes): The WriteBarrierKind::kEmitNotBeingReliedOn case should be able to skip
+    // this write barrier when its value is null (without an extra Beqz since we already checked
+    // if the value is null for the type check). This will be done as a follow-up since it is a
+    // runtime optimization that needs extra care.
+    DCHECK_IMPLIES(storing_constant_zero,
+                   write_barrier_kind == WriteBarrierKind::kEmitBeingReliedOn);
+    codegen_->MarkGCCard(array);
+  } else if (codegen_->ShouldCheckGCCard(value_type, instruction->GetValue(), write_barrier_kind)) {
+    codegen_->CheckGCCardIsValid(array);
+  }
+
+  if (index.IsConstant()) {
+    int32_t const_index = index.GetConstant()->AsIntConstant()->GetValue();
+    int32_t offset = data_offset + (const_index << DataType::SizeShift(value_type));
+    Store(value, array, offset, value_type);
+  } else {
+    ScratchRegisterScope srs(GetAssembler());
+    // Heap poisoning needs two scratch registers in `Store()`, except for null constants.
+    XRegister tmp =
+        (kPoisonHeapReferences && value_type == DataType::Type::kReference && !value.IsConstant())
+            ? locations->GetTemp(0).AsRegister<XRegister>()
+            : srs.AllocateXRegister();
+    ShNAdd(tmp, index.AsRegister<XRegister>(), array, value_type);
+    Store(value, tmp, data_offset, value_type);
+  }
+  // There must be no instructions between the `Store()` and the `MaybeRecordImplicitNullCheck()`.
+  // We can avoid this if the type check makes the null check unconditionally.
+  DCHECK_IMPLIES(needs_type_check, needs_write_barrier);
+  if (!(needs_type_check && !instruction->GetValueCanBeNull())) {
+    codegen_->MaybeRecordImplicitNullCheck(instruction);
+  }
+
+  if (slow_path != nullptr) {
+    __ Bind(slow_path->GetExitLabel());
+  }
+}
+
+void LocationsBuilderRISCV64::VisitBelow(HBelow* instruction) {
+  HandleCondition(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitBelow(HBelow* instruction) {
+  HandleCondition(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitBelowOrEqual(HBelowOrEqual* instruction) {
+  HandleCondition(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitBelowOrEqual(HBelowOrEqual* instruction) {
+  HandleCondition(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitBooleanNot(HBooleanNot* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  locations->SetInAt(0, Location::RequiresRegister());
+  locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitBooleanNot(HBooleanNot* instruction) {
+  LocationSummary* locations = instruction->GetLocations();
+  __ Xori(locations->Out().AsRegister<XRegister>(), locations->InAt(0).AsRegister<XRegister>(), 1);
+}
+
+void LocationsBuilderRISCV64::VisitBoundsCheck(HBoundsCheck* instruction) {
+  RegisterSet caller_saves = RegisterSet::Empty();
+  InvokeRuntimeCallingConvention calling_convention;
+  caller_saves.Add(Location::RegisterLocation(calling_convention.GetRegisterAt(0)));
+  caller_saves.Add(Location::RegisterLocation(calling_convention.GetRegisterAt(1)));
+  LocationSummary* locations = codegen_->CreateThrowingSlowPathLocations(instruction, caller_saves);
+
+  HInstruction* index = instruction->InputAt(0);
+  HInstruction* length = instruction->InputAt(1);
+
+  bool const_index = false;
+  bool const_length = false;
+
+  if (length->IsConstant()) {
+    if (index->IsConstant()) {
+      const_index = true;
+      const_length = true;
+    } else {
+      int32_t length_value = length->AsIntConstant()->GetValue();
+      if (length_value == 0 || length_value == 1) {
+        const_length = true;
+      }
+    }
+  } else if (index->IsConstant()) {
+    int32_t index_value = index->AsIntConstant()->GetValue();
+    if (index_value <= 0) {
+      const_index = true;
+    }
+  }
+
+  locations->SetInAt(
+      0,
+      const_index ? Location::ConstantLocation(index) : Location::RequiresRegister());
+  locations->SetInAt(
+      1,
+      const_length ? Location::ConstantLocation(length) : Location::RequiresRegister());
+}
+
+void InstructionCodeGeneratorRISCV64::VisitBoundsCheck(HBoundsCheck* instruction) {
+  LocationSummary* locations = instruction->GetLocations();
+  Location index_loc = locations->InAt(0);
+  Location length_loc = locations->InAt(1);
+
+  if (length_loc.IsConstant()) {
+    int32_t length = length_loc.GetConstant()->AsIntConstant()->GetValue();
+    if (index_loc.IsConstant()) {
+      int32_t index = index_loc.GetConstant()->AsIntConstant()->GetValue();
+      if (index < 0 || index >= length) {
+        BoundsCheckSlowPathRISCV64* slow_path =
+            new (codegen_->GetScopedAllocator()) BoundsCheckSlowPathRISCV64(instruction);
+        codegen_->AddSlowPath(slow_path);
+        __ J(slow_path->GetEntryLabel());
+      } else {
+        // Nothing to be done.
+      }
+      return;
+    }
+
+    BoundsCheckSlowPathRISCV64* slow_path =
+        new (codegen_->GetScopedAllocator()) BoundsCheckSlowPathRISCV64(instruction);
+    codegen_->AddSlowPath(slow_path);
+    XRegister index = index_loc.AsRegister<XRegister>();
+    if (length == 0) {
+      __ J(slow_path->GetEntryLabel());
+    } else {
+      DCHECK_EQ(length, 1);
+      __ Bnez(index, slow_path->GetEntryLabel());
+    }
+  } else {
+    XRegister length = length_loc.AsRegister<XRegister>();
+    BoundsCheckSlowPathRISCV64* slow_path =
+        new (codegen_->GetScopedAllocator()) BoundsCheckSlowPathRISCV64(instruction);
+    codegen_->AddSlowPath(slow_path);
+    if (index_loc.IsConstant()) {
+      int32_t index = index_loc.GetConstant()->AsIntConstant()->GetValue();
+      if (index < 0) {
+        __ J(slow_path->GetEntryLabel());
+      } else {
+        DCHECK_EQ(index, 0);
+        __ Blez(length, slow_path->GetEntryLabel());
+      }
+    } else {
+      XRegister index = index_loc.AsRegister<XRegister>();
+      __ Bgeu(index, length, slow_path->GetEntryLabel());
+    }
+  }
+}
+
+void LocationsBuilderRISCV64::VisitBoundType([[maybe_unused]] HBoundType* instruction) {
+  // Nothing to do, this should be removed during prepare for register allocator.
+  LOG(FATAL) << "Unreachable";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitBoundType([[maybe_unused]] HBoundType* instruction) {
+  // Nothing to do, this should be removed during prepare for register allocator.
+  LOG(FATAL) << "Unreachable";
+}
+
+// Temp is used for read barrier.
+static size_t NumberOfInstanceOfTemps(bool emit_read_barrier, TypeCheckKind type_check_kind) {
+  if (emit_read_barrier &&
+      (kUseBakerReadBarrier ||
+       type_check_kind == TypeCheckKind::kAbstractClassCheck ||
+       type_check_kind == TypeCheckKind::kClassHierarchyCheck ||
+       type_check_kind == TypeCheckKind::kArrayObjectCheck)) {
+    return 1;
+  }
+  return 0;
+}
+
+// Interface case has 3 temps, one for holding the number of interfaces, one for the current
+// interface pointer, one for loading the current interface.
+// The other checks have one temp for loading the object's class and maybe a temp for read barrier.
+static size_t NumberOfCheckCastTemps(bool emit_read_barrier, TypeCheckKind type_check_kind) {
+  if (type_check_kind == TypeCheckKind::kInterfaceCheck) {
+    return 3;
+  }
+  return 1 + NumberOfInstanceOfTemps(emit_read_barrier, type_check_kind);
+}
+
+void LocationsBuilderRISCV64::VisitCheckCast(HCheckCast* instruction) {
+  TypeCheckKind type_check_kind = instruction->GetTypeCheckKind();
+  LocationSummary::CallKind call_kind = codegen_->GetCheckCastCallKind(instruction);
+  LocationSummary* locations =
+      new (GetGraph()->GetAllocator()) LocationSummary(instruction, call_kind);
+  locations->SetInAt(0, Location::RequiresRegister());
+  if (type_check_kind == TypeCheckKind::kBitstringCheck) {
+    locations->SetInAt(1, Location::ConstantLocation(instruction->InputAt(1)));
+    locations->SetInAt(2, Location::ConstantLocation(instruction->InputAt(2)));
+    locations->SetInAt(3, Location::ConstantLocation(instruction->InputAt(3)));
+  } else {
+    locations->SetInAt(1, Location::RequiresRegister());
+  }
+  locations->AddRegisterTemps(NumberOfCheckCastTemps(codegen_->EmitReadBarrier(), type_check_kind));
+}
+
+void InstructionCodeGeneratorRISCV64::VisitCheckCast(HCheckCast* instruction) {
+TypeCheckKind type_check_kind = instruction->GetTypeCheckKind();
+  LocationSummary* locations = instruction->GetLocations();
+  Location obj_loc = locations->InAt(0);
+  XRegister obj = obj_loc.AsRegister<XRegister>();
+  Location cls = (type_check_kind == TypeCheckKind::kBitstringCheck)
+      ? Location::NoLocation()
+      : locations->InAt(1);
+  Location temp_loc = locations->GetTemp(0);
+  XRegister temp = temp_loc.AsRegister<XRegister>();
+  const size_t num_temps = NumberOfCheckCastTemps(codegen_->EmitReadBarrier(), type_check_kind);
+  DCHECK_GE(num_temps, 1u);
+  DCHECK_LE(num_temps, 3u);
+  Location maybe_temp2_loc = (num_temps >= 2) ? locations->GetTemp(1) : Location::NoLocation();
+  Location maybe_temp3_loc = (num_temps >= 3) ? locations->GetTemp(2) : Location::NoLocation();
+  const uint32_t class_offset = mirror::Object::ClassOffset().Int32Value();
+  const uint32_t super_offset = mirror::Class::SuperClassOffset().Int32Value();
+  const uint32_t component_offset = mirror::Class::ComponentTypeOffset().Int32Value();
+  const uint32_t primitive_offset = mirror::Class::PrimitiveTypeOffset().Int32Value();
+  const uint32_t iftable_offset = mirror::Class::IfTableOffset().Uint32Value();
+  const uint32_t array_length_offset = mirror::Array::LengthOffset().Uint32Value();
+  const uint32_t object_array_data_offset =
+      mirror::Array::DataOffset(kHeapReferenceSize).Uint32Value();
+  Riscv64Label done;
+
+  bool is_type_check_slow_path_fatal = codegen_->IsTypeCheckSlowPathFatal(instruction);
+  SlowPathCodeRISCV64* slow_path =
+      new (codegen_->GetScopedAllocator()) TypeCheckSlowPathRISCV64(
+          instruction, is_type_check_slow_path_fatal);
+  codegen_->AddSlowPath(slow_path);
+
+  // Avoid this check if we know `obj` is not null.
+  if (instruction->MustDoNullCheck()) {
+    __ Beqz(obj, &done);
+  }
+
+  switch (type_check_kind) {
+    case TypeCheckKind::kExactCheck:
+    case TypeCheckKind::kArrayCheck: {
+      // /* HeapReference<Class> */ temp = obj->klass_
+      GenerateReferenceLoadTwoRegisters(instruction,
+                                        temp_loc,
+                                        obj_loc,
+                                        class_offset,
+                                        maybe_temp2_loc,
+                                        kWithoutReadBarrier);
+      // Jump to slow path for throwing the exception or doing a
+      // more involved array check.
+      __ Bne(temp, cls.AsRegister<XRegister>(), slow_path->GetEntryLabel());
+      break;
+    }
+
+    case TypeCheckKind::kAbstractClassCheck: {
+      // /* HeapReference<Class> */ temp = obj->klass_
+      GenerateReferenceLoadTwoRegisters(instruction,
+                                        temp_loc,
+                                        obj_loc,
+                                        class_offset,
+                                        maybe_temp2_loc,
+                                        kWithoutReadBarrier);
+      // If the class is abstract, we eagerly fetch the super class of the
+      // object to avoid doing a comparison we know will fail.
+      Riscv64Label loop;
+      __ Bind(&loop);
+      // /* HeapReference<Class> */ temp = temp->super_class_
+      GenerateReferenceLoadOneRegister(instruction,
+                                       temp_loc,
+                                       super_offset,
+                                       maybe_temp2_loc,
+                                       kWithoutReadBarrier);
+      // If the class reference currently in `temp` is null, jump to the slow path to throw the
+      // exception.
+      __ Beqz(temp, slow_path->GetEntryLabel());
+      // Otherwise, compare the classes.
+      __ Bne(temp, cls.AsRegister<XRegister>(), &loop);
+      break;
+    }
+
+    case TypeCheckKind::kClassHierarchyCheck: {
+      // /* HeapReference<Class> */ temp = obj->klass_
+      GenerateReferenceLoadTwoRegisters(instruction,
+                                        temp_loc,
+                                        obj_loc,
+                                        class_offset,
+                                        maybe_temp2_loc,
+                                        kWithoutReadBarrier);
+      // Walk over the class hierarchy to find a match.
+      Riscv64Label loop;
+      __ Bind(&loop);
+      __ Beq(temp, cls.AsRegister<XRegister>(), &done);
+      // /* HeapReference<Class> */ temp = temp->super_class_
+      GenerateReferenceLoadOneRegister(instruction,
+                                       temp_loc,
+                                       super_offset,
+                                       maybe_temp2_loc,
+                                       kWithoutReadBarrier);
+      // If the class reference currently in `temp` is null, jump to the slow path to throw the
+      // exception. Otherwise, jump to the beginning of the loop.
+      __ Bnez(temp, &loop);
+      __ J(slow_path->GetEntryLabel());
+      break;
+    }
+
+    case TypeCheckKind::kArrayObjectCheck: {
+      // /* HeapReference<Class> */ temp = obj->klass_
+      GenerateReferenceLoadTwoRegisters(instruction,
+                                        temp_loc,
+                                        obj_loc,
+                                        class_offset,
+                                        maybe_temp2_loc,
+                                        kWithoutReadBarrier);
+      // Do an exact check.
+      __ Beq(temp, cls.AsRegister<XRegister>(), &done);
+      // Otherwise, we need to check that the object's class is a non-primitive array.
+      // /* HeapReference<Class> */ temp = temp->component_type_
+      GenerateReferenceLoadOneRegister(instruction,
+                                       temp_loc,
+                                       component_offset,
+                                       maybe_temp2_loc,
+                                       kWithoutReadBarrier);
+      // If the component type is null, jump to the slow path to throw the exception.
+      __ Beqz(temp, slow_path->GetEntryLabel());
+      // Otherwise, the object is indeed an array, further check that this component
+      // type is not a primitive type.
+      __ Loadhu(temp, temp, primitive_offset);
+      static_assert(Primitive::kPrimNot == 0, "Expected 0 for kPrimNot");
+      __ Bnez(temp, slow_path->GetEntryLabel());
+      break;
+    }
+
+    case TypeCheckKind::kUnresolvedCheck:
+      // We always go into the type check slow path for the unresolved check case.
+      // We cannot directly call the CheckCast runtime entry point
+      // without resorting to a type checking slow path here (i.e. by
+      // calling InvokeRuntime directly), as it would require to
+      // assign fixed registers for the inputs of this HInstanceOf
+      // instruction (following the runtime calling convention), which
+      // might be cluttered by the potential first read barrier
+      // emission at the beginning of this method.
+      __ J(slow_path->GetEntryLabel());
+      break;
+
+    case TypeCheckKind::kInterfaceCheck: {
+      // Avoid read barriers to improve performance of the fast path. We can not get false
+      // positives by doing this. False negatives are handled by the slow path.
+      // /* HeapReference<Class> */ temp = obj->klass_
+      GenerateReferenceLoadTwoRegisters(instruction,
+                                        temp_loc,
+                                        obj_loc,
+                                        class_offset,
+                                        maybe_temp2_loc,
+                                        kWithoutReadBarrier);
+      // /* HeapReference<Class> */ temp = temp->iftable_
+      GenerateReferenceLoadOneRegister(instruction,
+                                       temp_loc,
+                                       iftable_offset,
+                                       maybe_temp2_loc,
+                                       kWithoutReadBarrier);
+      XRegister temp2 = maybe_temp2_loc.AsRegister<XRegister>();
+      XRegister temp3 = maybe_temp3_loc.AsRegister<XRegister>();
+      // Iftable is never null.
+      __ Loadw(temp2, temp, array_length_offset);
+      // Loop through the iftable and check if any class matches.
+      Riscv64Label loop;
+      __ Bind(&loop);
+      __ Beqz(temp2, slow_path->GetEntryLabel());
+      __ Lwu(temp3, temp, object_array_data_offset);
+      codegen_->MaybeUnpoisonHeapReference(temp3);
+      // Go to next interface.
+      __ Addi(temp, temp, 2 * kHeapReferenceSize);
+      __ Addi(temp2, temp2, -2);
+      // Compare the classes and continue the loop if they do not match.
+      __ Bne(temp3, cls.AsRegister<XRegister>(), &loop);
+      break;
+    }
+
+    case TypeCheckKind::kBitstringCheck: {
+      // /* HeapReference<Class> */ temp = obj->klass_
+      GenerateReferenceLoadTwoRegisters(instruction,
+                                        temp_loc,
+                                        obj_loc,
+                                        class_offset,
+                                        maybe_temp2_loc,
+                                        kWithoutReadBarrier);
+
+      GenerateBitstringTypeCheckCompare(instruction, temp);
+      __ Bnez(temp, slow_path->GetEntryLabel());
+      break;
+    }
+  }
+
+  __ Bind(&done);
+  __ Bind(slow_path->GetExitLabel());
+}
+
+void LocationsBuilderRISCV64::VisitClassTableGet(HClassTableGet* instruction) {
+  LocationSummary* locations =
+      new (GetGraph()->GetAllocator()) LocationSummary(instruction, LocationSummary::kNoCall);
+  locations->SetInAt(0, Location::RequiresRegister());
+  locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitClassTableGet(HClassTableGet* instruction) {
+  LocationSummary* locations = instruction->GetLocations();
+  XRegister in = locations->InAt(0).AsRegister<XRegister>();
+  XRegister out = locations->Out().AsRegister<XRegister>();
+  if (instruction->GetTableKind() == HClassTableGet::TableKind::kVTable) {
+    MemberOffset method_offset =
+        mirror::Class::EmbeddedVTableEntryOffset(instruction->GetIndex(), kRiscv64PointerSize);
+    __ Loadd(out, in, method_offset.SizeValue());
+  } else {
+    uint32_t method_offset = dchecked_integral_cast<uint32_t>(
+        ImTable::OffsetOfElement(instruction->GetIndex(), kRiscv64PointerSize));
+    __ Loadd(out, in, mirror::Class::ImtPtrOffset(kRiscv64PointerSize).Uint32Value());
+    __ Loadd(out, out, method_offset);
+  }
+}
+
+static int32_t GetExceptionTlsOffset() {
+  return Thread::ExceptionOffset<kRiscv64PointerSize>().Int32Value();
+}
+
+void LocationsBuilderRISCV64::VisitClearException(HClearException* instruction) {
+  new (GetGraph()->GetAllocator()) LocationSummary(instruction, LocationSummary::kNoCall);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitClearException(
+    [[maybe_unused]] HClearException* instruction) {
+  __ Stored(Zero, TR, GetExceptionTlsOffset());
+}
+
+void LocationsBuilderRISCV64::VisitClinitCheck(HClinitCheck* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(
+      instruction, LocationSummary::kCallOnSlowPath);
+  locations->SetInAt(0, Location::RequiresRegister());
+  if (instruction->HasUses()) {
+    locations->SetOut(Location::SameAsFirstInput());
+  }
+  // Rely on the type initialization to save everything we need.
+  locations->SetCustomSlowPathCallerSaves(OneRegInReferenceOutSaveEverythingCallerSaves());
+}
+
+void InstructionCodeGeneratorRISCV64::VisitClinitCheck(HClinitCheck* instruction) {
+  // We assume the class is not null.
+  SlowPathCodeRISCV64* slow_path = new (codegen_->GetScopedAllocator()) LoadClassSlowPathRISCV64(
+      instruction->GetLoadClass(), instruction);
+  codegen_->AddSlowPath(slow_path);
+  GenerateClassInitializationCheck(slow_path,
+                                   instruction->GetLocations()->InAt(0).AsRegister<XRegister>());
+}
+
+void LocationsBuilderRISCV64::VisitCompare(HCompare* instruction) {
+  DataType::Type in_type = instruction->InputAt(0)->GetType();
+
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+
+  switch (in_type) {
+    case DataType::Type::kBool:
+    case DataType::Type::kUint8:
+    case DataType::Type::kInt8:
+    case DataType::Type::kUint16:
+    case DataType::Type::kInt16:
+    case DataType::Type::kInt32:
+    case DataType::Type::kInt64:
+      locations->SetInAt(0, Location::RequiresRegister());
+      locations->SetInAt(1, RegisterOrZeroBitPatternLocation(instruction->InputAt(1)));
+      locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+      break;
+
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64:
+      locations->SetInAt(0, Location::RequiresFpuRegister());
+      locations->SetInAt(1, Location::RequiresFpuRegister());
+      locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+      break;
+
+    default:
+      LOG(FATAL) << "Unexpected type for compare operation " << in_type;
+      UNREACHABLE();
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::VisitCompare(HCompare* instruction) {
+  LocationSummary* locations = instruction->GetLocations();
+  XRegister result = locations->Out().AsRegister<XRegister>();
+  DataType::Type in_type = instruction->InputAt(0)->GetType();
+
+  //  0 if: left == right
+  //  1 if: left  > right
+  // -1 if: left  < right
+  switch (in_type) {
+    case DataType::Type::kBool:
+    case DataType::Type::kUint8:
+    case DataType::Type::kInt8:
+    case DataType::Type::kUint16:
+    case DataType::Type::kInt16:
+    case DataType::Type::kInt32:
+    case DataType::Type::kInt64: {
+      XRegister left = locations->InAt(0).AsRegister<XRegister>();
+      XRegister right = InputXRegisterOrZero(locations->InAt(1));
+      ScratchRegisterScope srs(GetAssembler());
+      XRegister tmp = srs.AllocateXRegister();
+      __ Slt(tmp, left, right);
+      __ Slt(result, right, left);
+      __ Sub(result, result, tmp);
+      break;
+    }
+
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64: {
+      FRegister left = locations->InAt(0).AsFpuRegister<FRegister>();
+      FRegister right = locations->InAt(1).AsFpuRegister<FRegister>();
+      ScratchRegisterScope srs(GetAssembler());
+      XRegister tmp = srs.AllocateXRegister();
+      if (instruction->IsGtBias()) {
+        // ((FLE l,r) ^ 1) - (FLT l,r); see `GenerateFpCondition()`.
+        FLe(tmp, left, right, in_type);
+        FLt(result, left, right, in_type);
+        __ Xori(tmp, tmp, 1);
+        __ Sub(result, tmp, result);
+      } else {
+        // ((FLE r,l) - 1) + (FLT r,l); see `GenerateFpCondition()`.
+        FLe(tmp, right, left, in_type);
+        FLt(result, right, left, in_type);
+        __ Addi(tmp, tmp, -1);
+        __ Add(result, result, tmp);
+      }
+      break;
+    }
+
+    default:
+      LOG(FATAL) << "Unimplemented compare type " << in_type;
+  }
+}
+
+void LocationsBuilderRISCV64::VisitConstructorFence(HConstructorFence* instruction) {
+  instruction->SetLocations(nullptr);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitConstructorFence(
+    [[maybe_unused]] HConstructorFence* instruction) {
+  codegen_->GenerateMemoryBarrier(MemBarrierKind::kStoreStore);
+}
+
+void LocationsBuilderRISCV64::VisitCurrentMethod(HCurrentMethod* instruction) {
+  LocationSummary* locations =
+      new (GetGraph()->GetAllocator()) LocationSummary(instruction, LocationSummary::kNoCall);
+  locations->SetOut(Location::RegisterLocation(kArtMethodRegister));
+}
+
+void InstructionCodeGeneratorRISCV64::VisitCurrentMethod(
+    [[maybe_unused]] HCurrentMethod* instruction) {
+  // Nothing to do, the method is already at its location.
+}
+
+void LocationsBuilderRISCV64::VisitShouldDeoptimizeFlag(HShouldDeoptimizeFlag* instruction) {
+  LocationSummary* locations =
+      new (GetGraph()->GetAllocator()) LocationSummary(instruction, LocationSummary::kNoCall);
+  locations->SetOut(Location::RequiresRegister());
+}
+
+void InstructionCodeGeneratorRISCV64::VisitShouldDeoptimizeFlag(
+    HShouldDeoptimizeFlag* instruction) {
+  __ Loadw(instruction->GetLocations()->Out().AsRegister<XRegister>(),
+           SP,
+           codegen_->GetStackOffsetOfShouldDeoptimizeFlag());
+}
+
+void LocationsBuilderRISCV64::VisitDeoptimize(HDeoptimize* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator())
+      LocationSummary(instruction, LocationSummary::kCallOnSlowPath);
+  InvokeRuntimeCallingConvention calling_convention;
+  RegisterSet caller_saves = RegisterSet::Empty();
+  caller_saves.Add(Location::RegisterLocation(calling_convention.GetRegisterAt(0)));
+  locations->SetCustomSlowPathCallerSaves(caller_saves);
+  if (IsBooleanValueOrMaterializedCondition(instruction->InputAt(0))) {
+    locations->SetInAt(0, Location::RequiresRegister());
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::VisitDeoptimize(HDeoptimize* instruction) {
+  SlowPathCodeRISCV64* slow_path =
+      deopt_slow_paths_.NewSlowPath<DeoptimizationSlowPathRISCV64>(instruction);
+  GenerateTestAndBranch(instruction,
+                        /* condition_input_index= */ 0,
+                        slow_path->GetEntryLabel(),
+                        /* false_target= */ nullptr);
+}
+
+void LocationsBuilderRISCV64::VisitDiv(HDiv* instruction) {
+  LocationSummary* locations =
+      new (GetGraph()->GetAllocator()) LocationSummary(instruction, LocationSummary::kNoCall);
+  switch (instruction->GetResultType()) {
+    case DataType::Type::kInt32:
+    case DataType::Type::kInt64:
+      locations->SetInAt(0, Location::RequiresRegister());
+      locations->SetInAt(1, Location::RegisterOrConstant(instruction->InputAt(1)));
+      locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+      break;
+
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64:
+      locations->SetInAt(0, Location::RequiresFpuRegister());
+      locations->SetInAt(1, Location::RequiresFpuRegister());
+      locations->SetOut(Location::RequiresFpuRegister(), Location::kNoOutputOverlap);
+      break;
+
+    default:
+      LOG(FATAL) << "Unexpected div type " << instruction->GetResultType();
+      UNREACHABLE();
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::VisitDiv(HDiv* instruction) {
+  DataType::Type type = instruction->GetType();
+  LocationSummary* locations = instruction->GetLocations();
+
+  switch (type) {
+    case DataType::Type::kInt32:
+    case DataType::Type::kInt64:
+      GenerateDivRemIntegral(instruction);
+      break;
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64: {
+      FRegister dst = locations->Out().AsFpuRegister<FRegister>();
+      FRegister lhs = locations->InAt(0).AsFpuRegister<FRegister>();
+      FRegister rhs = locations->InAt(1).AsFpuRegister<FRegister>();
+      FDiv(dst, lhs, rhs, type);
+      break;
+    }
+    default:
+      LOG(FATAL) << "Unexpected div type " << type;
+      UNREACHABLE();
+  }
+}
+
+void LocationsBuilderRISCV64::VisitDivZeroCheck(HDivZeroCheck* instruction) {
+  LocationSummary* locations = codegen_->CreateThrowingSlowPathLocations(instruction);
+  locations->SetInAt(0, Location::RegisterOrConstant(instruction->InputAt(0)));
+}
+
+void InstructionCodeGeneratorRISCV64::VisitDivZeroCheck(HDivZeroCheck* instruction) {
+  SlowPathCodeRISCV64* slow_path =
+      new (codegen_->GetScopedAllocator()) DivZeroCheckSlowPathRISCV64(instruction);
+  codegen_->AddSlowPath(slow_path);
+  Location value = instruction->GetLocations()->InAt(0);
+
+  DataType::Type type = instruction->GetType();
+
+  if (!DataType::IsIntegralType(type)) {
+    LOG(FATAL) << "Unexpected type " << type << " for DivZeroCheck.";
+    UNREACHABLE();
+  }
+
+  if (value.IsConstant()) {
+    int64_t divisor = codegen_->GetInt64ValueOf(value.GetConstant()->AsConstant());
+    if (divisor == 0) {
+      __ J(slow_path->GetEntryLabel());
+    } else {
+      // A division by a non-null constant is valid. We don't need to perform
+      // any check, so simply fall through.
+    }
+  } else {
+    __ Beqz(value.AsRegister<XRegister>(), slow_path->GetEntryLabel());
+  }
+}
+
+void LocationsBuilderRISCV64::VisitDoubleConstant(HDoubleConstant* instruction) {
+  LocationSummary* locations =
+      new (GetGraph()->GetAllocator()) LocationSummary(instruction, LocationSummary::kNoCall);
+  locations->SetOut(Location::ConstantLocation(instruction));
+}
+
+void InstructionCodeGeneratorRISCV64::VisitDoubleConstant(
+    [[maybe_unused]] HDoubleConstant* instruction) {
+  // Will be generated at use site.
+}
+
+void LocationsBuilderRISCV64::VisitEqual(HEqual* instruction) {
+  HandleCondition(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitEqual(HEqual* instruction) {
+  HandleCondition(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitExit(HExit* instruction) {
+  instruction->SetLocations(nullptr);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitExit([[maybe_unused]] HExit* instruction) {}
+
+void LocationsBuilderRISCV64::VisitFloatConstant(HFloatConstant* instruction) {
+  LocationSummary* locations =
+      new (GetGraph()->GetAllocator()) LocationSummary(instruction, LocationSummary::kNoCall);
+  locations->SetOut(Location::ConstantLocation(instruction));
+}
+
+void InstructionCodeGeneratorRISCV64::VisitFloatConstant(
+    [[maybe_unused]] HFloatConstant* instruction) {
+  // Will be generated at use site.
+}
+
+void LocationsBuilderRISCV64::VisitGoto(HGoto* instruction) {
+  instruction->SetLocations(nullptr);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitGoto(HGoto* instruction) {
+  HandleGoto(instruction, instruction->GetSuccessor());
+}
+
+void LocationsBuilderRISCV64::VisitGreaterThan(HGreaterThan* instruction) {
+  HandleCondition(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitGreaterThan(HGreaterThan* instruction) {
+  HandleCondition(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitGreaterThanOrEqual(HGreaterThanOrEqual* instruction) {
+  HandleCondition(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitGreaterThanOrEqual(HGreaterThanOrEqual* instruction) {
+  HandleCondition(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitIf(HIf* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  if (IsBooleanValueOrMaterializedCondition(instruction->InputAt(0))) {
+    locations->SetInAt(0, Location::RequiresRegister());
+    if (GetGraph()->IsCompilingBaseline() &&
+        codegen_->GetCompilerOptions().ProfileBranches() &&
+        !Runtime::Current()->IsAotCompiler()) {
+      DCHECK(instruction->InputAt(0)->IsCondition());
+      ProfilingInfo* info = GetGraph()->GetProfilingInfo();
+      DCHECK(info != nullptr);
+      BranchCache* cache = info->GetBranchCache(instruction->GetDexPc());
+      if (cache != nullptr) {
+        locations->AddTemp(Location::RequiresRegister());
+      }
+    }
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::VisitIf(HIf* instruction) {
+  HBasicBlock* true_successor = instruction->IfTrueSuccessor();
+  HBasicBlock* false_successor = instruction->IfFalseSuccessor();
+  Riscv64Label* true_target = codegen_->GoesToNextBlock(instruction->GetBlock(), true_successor)
+      ? nullptr
+      : codegen_->GetLabelOf(true_successor);
+  Riscv64Label* false_target = codegen_->GoesToNextBlock(instruction->GetBlock(), false_successor)
+      ? nullptr
+      : codegen_->GetLabelOf(false_successor);
+  if (IsBooleanValueOrMaterializedCondition(instruction->InputAt(0))) {
+    if (GetGraph()->IsCompilingBaseline() &&
+        codegen_->GetCompilerOptions().ProfileBranches() &&
+        !Runtime::Current()->IsAotCompiler()) {
+      DCHECK(instruction->InputAt(0)->IsCondition());
+      ProfilingInfo* info = GetGraph()->GetProfilingInfo();
+      DCHECK(info != nullptr);
+      BranchCache* cache = info->GetBranchCache(instruction->GetDexPc());
+      // Currently, not all If branches are profiled.
+      if (cache != nullptr) {
+        uint64_t address =
+            reinterpret_cast64<uint64_t>(cache) + BranchCache::FalseOffset().Int32Value();
+        static_assert(
+            BranchCache::TrueOffset().Int32Value() - BranchCache::FalseOffset().Int32Value() == 2,
+            "Unexpected offsets for BranchCache");
+        Riscv64Label done;
+        XRegister condition = instruction->GetLocations()->InAt(0).AsRegister<XRegister>();
+        XRegister temp = instruction->GetLocations()->GetTemp(0).AsRegister<XRegister>();
+        __ LoadConst64(temp, address);
+        __ Sh1Add(temp, condition, temp);
+        ScratchRegisterScope srs(GetAssembler());
+        XRegister counter = srs.AllocateXRegister();
+        __ Loadhu(counter, temp, 0);
+        __ Addi(counter, counter, 1);
+        {
+          ScratchRegisterScope srs2(GetAssembler());
+          XRegister overflow = srs2.AllocateXRegister();
+          __ Srli(overflow, counter, 16);
+          __ Bnez(overflow, &done);
+        }
+        __ Storeh(counter, temp, 0);
+        __ Bind(&done);
+      }
+    }
+  }
+  GenerateTestAndBranch(instruction, /* condition_input_index= */ 0, true_target, false_target);
+}
+
+void LocationsBuilderRISCV64::VisitInstanceFieldGet(HInstanceFieldGet* instruction) {
+  HandleFieldGet(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitInstanceFieldGet(HInstanceFieldGet* instruction) {
+  HandleFieldGet(instruction, instruction->GetFieldInfo());
+}
+
+void LocationsBuilderRISCV64::VisitInstanceFieldSet(HInstanceFieldSet* instruction) {
+  HandleFieldSet(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitInstanceFieldSet(HInstanceFieldSet* instruction) {
+  HandleFieldSet(instruction,
+                 instruction->GetFieldInfo(),
+                 instruction->GetValueCanBeNull(),
+                 instruction->GetWriteBarrierKind());
+}
+
+void LocationsBuilderRISCV64::VisitInstanceOf(HInstanceOf* instruction) {
+  LocationSummary::CallKind call_kind = LocationSummary::kNoCall;
+  TypeCheckKind type_check_kind = instruction->GetTypeCheckKind();
+  bool baker_read_barrier_slow_path = false;
+  switch (type_check_kind) {
+    case TypeCheckKind::kExactCheck:
+    case TypeCheckKind::kAbstractClassCheck:
+    case TypeCheckKind::kClassHierarchyCheck:
+    case TypeCheckKind::kArrayObjectCheck: {
+      bool needs_read_barrier = codegen_->InstanceOfNeedsReadBarrier(instruction);
+      call_kind = needs_read_barrier ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall;
+      baker_read_barrier_slow_path = kUseBakerReadBarrier && needs_read_barrier;
+      break;
+    }
+    case TypeCheckKind::kArrayCheck:
+    case TypeCheckKind::kUnresolvedCheck:
+    case TypeCheckKind::kInterfaceCheck:
+      call_kind = LocationSummary::kCallOnSlowPath;
+      break;
+    case TypeCheckKind::kBitstringCheck:
+      break;
+  }
+
+  LocationSummary* locations =
+      new (GetGraph()->GetAllocator()) LocationSummary(instruction, call_kind);
+  if (baker_read_barrier_slow_path) {
+    locations->SetCustomSlowPathCallerSaves(RegisterSet::Empty());  // No caller-save registers.
+  }
+  locations->SetInAt(0, Location::RequiresRegister());
+  if (type_check_kind == TypeCheckKind::kBitstringCheck) {
+    locations->SetInAt(1, Location::ConstantLocation(instruction->InputAt(1)));
+    locations->SetInAt(2, Location::ConstantLocation(instruction->InputAt(2)));
+    locations->SetInAt(3, Location::ConstantLocation(instruction->InputAt(3)));
+  } else {
+    locations->SetInAt(1, Location::RequiresRegister());
+  }
+  // The output does overlap inputs.
+  // Note that TypeCheckSlowPathRISCV64 uses this register too.
+  locations->SetOut(Location::RequiresRegister(), Location::kOutputOverlap);
+  locations->AddRegisterTemps(
+      NumberOfInstanceOfTemps(codegen_->EmitReadBarrier(), type_check_kind));
+}
+
+void InstructionCodeGeneratorRISCV64::VisitInstanceOf(HInstanceOf* instruction) {
+  TypeCheckKind type_check_kind = instruction->GetTypeCheckKind();
+  LocationSummary* locations = instruction->GetLocations();
+  Location obj_loc = locations->InAt(0);
+  XRegister obj = obj_loc.AsRegister<XRegister>();
+  Location cls = (type_check_kind == TypeCheckKind::kBitstringCheck)
+      ? Location::NoLocation()
+      : locations->InAt(1);
+  Location out_loc = locations->Out();
+  XRegister out = out_loc.AsRegister<XRegister>();
+  const size_t num_temps = NumberOfInstanceOfTemps(codegen_->EmitReadBarrier(), type_check_kind);
+  DCHECK_LE(num_temps, 1u);
+  Location maybe_temp_loc = (num_temps >= 1) ? locations->GetTemp(0) : Location::NoLocation();
+  uint32_t class_offset = mirror::Object::ClassOffset().Int32Value();
+  uint32_t super_offset = mirror::Class::SuperClassOffset().Int32Value();
+  uint32_t component_offset = mirror::Class::ComponentTypeOffset().Int32Value();
+  uint32_t primitive_offset = mirror::Class::PrimitiveTypeOffset().Int32Value();
+  Riscv64Label done;
+  SlowPathCodeRISCV64* slow_path = nullptr;
+
+  // Return 0 if `obj` is null.
+  // Avoid this check if we know `obj` is not null.
+  if (instruction->MustDoNullCheck()) {
+    __ Mv(out, Zero);
+    __ Beqz(obj, &done);
+  }
+
+  switch (type_check_kind) {
+    case TypeCheckKind::kExactCheck: {
+      ReadBarrierOption read_barrier_option =
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
+      // /* HeapReference<Class> */ out = obj->klass_
+      GenerateReferenceLoadTwoRegisters(
+          instruction, out_loc, obj_loc, class_offset, maybe_temp_loc, read_barrier_option);
+      // Classes must be equal for the instanceof to succeed.
+      __ Xor(out, out, cls.AsRegister<XRegister>());
+      __ Seqz(out, out);
+      break;
+    }
+
+    case TypeCheckKind::kAbstractClassCheck: {
+      ReadBarrierOption read_barrier_option =
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
+      // /* HeapReference<Class> */ out = obj->klass_
+      GenerateReferenceLoadTwoRegisters(
+          instruction, out_loc, obj_loc, class_offset, maybe_temp_loc, read_barrier_option);
+      // If the class is abstract, we eagerly fetch the super class of the
+      // object to avoid doing a comparison we know will fail.
+      Riscv64Label loop;
+      __ Bind(&loop);
+      // /* HeapReference<Class> */ out = out->super_class_
+      GenerateReferenceLoadOneRegister(
+          instruction, out_loc, super_offset, maybe_temp_loc, read_barrier_option);
+      // If `out` is null, we use it for the result, and jump to `done`.
+      __ Beqz(out, &done);
+      __ Bne(out, cls.AsRegister<XRegister>(), &loop);
+      __ LoadConst32(out, 1);
+      break;
+    }
+
+    case TypeCheckKind::kClassHierarchyCheck: {
+      ReadBarrierOption read_barrier_option =
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
+      // /* HeapReference<Class> */ out = obj->klass_
+      GenerateReferenceLoadTwoRegisters(
+          instruction, out_loc, obj_loc, class_offset, maybe_temp_loc, read_barrier_option);
+      // Walk over the class hierarchy to find a match.
+      Riscv64Label loop, success;
+      __ Bind(&loop);
+      __ Beq(out, cls.AsRegister<XRegister>(), &success);
+      // /* HeapReference<Class> */ out = out->super_class_
+      GenerateReferenceLoadOneRegister(
+          instruction, out_loc, super_offset, maybe_temp_loc, read_barrier_option);
+      __ Bnez(out, &loop);
+      // If `out` is null, we use it for the result, and jump to `done`.
+      __ J(&done);
+      __ Bind(&success);
+      __ LoadConst32(out, 1);
+      break;
+    }
+
+    case TypeCheckKind::kArrayObjectCheck: {
+      ReadBarrierOption read_barrier_option =
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
+      // FIXME(riscv64): We currently have marking entrypoints for 29 registers.
+      // We need to either store entrypoint for register `N` in entry `N-A` where
+      // `A` can be up to 5 (Zero, RA, SP, GP, TP are not valid registers for
+      // marking), or define two more entrypoints, or request an additional temp
+      // from the register allocator instead of using a scratch register.
+      ScratchRegisterScope srs(GetAssembler());
+      Location tmp = Location::RegisterLocation(srs.AllocateXRegister());
+      // /* HeapReference<Class> */ tmp = obj->klass_
+      GenerateReferenceLoadTwoRegisters(
+          instruction, tmp, obj_loc, class_offset, maybe_temp_loc, read_barrier_option);
+      // Do an exact check.
+      __ LoadConst32(out, 1);
+      __ Beq(tmp.AsRegister<XRegister>(), cls.AsRegister<XRegister>(), &done);
+      // Otherwise, we need to check that the object's class is a non-primitive array.
+      // /* HeapReference<Class> */ out = out->component_type_
+      GenerateReferenceLoadTwoRegisters(
+          instruction, out_loc, tmp, component_offset, maybe_temp_loc, read_barrier_option);
+      // If `out` is null, we use it for the result, and jump to `done`.
+      __ Beqz(out, &done);
+      __ Loadhu(out, out, primitive_offset);
+      static_assert(Primitive::kPrimNot == 0, "Expected 0 for kPrimNot");
+      __ Seqz(out, out);
+      break;
+    }
+
+    case TypeCheckKind::kArrayCheck: {
+      // No read barrier since the slow path will retry upon failure.
+      // /* HeapReference<Class> */ out = obj->klass_
+      GenerateReferenceLoadTwoRegisters(
+          instruction, out_loc, obj_loc, class_offset, maybe_temp_loc, kWithoutReadBarrier);
+      DCHECK(locations->OnlyCallsOnSlowPath());
+      slow_path = new (codegen_->GetScopedAllocator())
+          TypeCheckSlowPathRISCV64(instruction, /* is_fatal= */ false);
+      codegen_->AddSlowPath(slow_path);
+      __ Bne(out, cls.AsRegister<XRegister>(), slow_path->GetEntryLabel());
+      __ LoadConst32(out, 1);
+      break;
+    }
+
+    case TypeCheckKind::kUnresolvedCheck:
+    case TypeCheckKind::kInterfaceCheck: {
+      // Note that we indeed only call on slow path, but we always go
+      // into the slow path for the unresolved and interface check
+      // cases.
+      //
+      // We cannot directly call the InstanceofNonTrivial runtime
+      // entry point without resorting to a type checking slow path
+      // here (i.e. by calling InvokeRuntime directly), as it would
+      // require to assign fixed registers for the inputs of this
+      // HInstanceOf instruction (following the runtime calling
+      // convention), which might be cluttered by the potential first
+      // read barrier emission at the beginning of this method.
+      //
+      // TODO: Introduce a new runtime entry point taking the object
+      // to test (instead of its class) as argument, and let it deal
+      // with the read barrier issues. This will let us refactor this
+      // case of the `switch` code as it was previously (with a direct
+      // call to the runtime not using a type checking slow path).
+      // This should also be beneficial for the other cases above.
+      DCHECK(locations->OnlyCallsOnSlowPath());
+      slow_path = new (codegen_->GetScopedAllocator()) TypeCheckSlowPathRISCV64(
+          instruction, /* is_fatal= */ false);
+      codegen_->AddSlowPath(slow_path);
+      __ J(slow_path->GetEntryLabel());
+      break;
+    }
+
+    case TypeCheckKind::kBitstringCheck: {
+      // /* HeapReference<Class> */ temp = obj->klass_
+      GenerateReferenceLoadTwoRegisters(
+          instruction, out_loc, obj_loc, class_offset, maybe_temp_loc, kWithoutReadBarrier);
+
+      GenerateBitstringTypeCheckCompare(instruction, out);
+      __ Beqz(out, out);
+      break;
+    }
+  }
+
+  __ Bind(&done);
+
+  if (slow_path != nullptr) {
+    __ Bind(slow_path->GetExitLabel());
+  }
+}
+
+void LocationsBuilderRISCV64::VisitIntConstant(HIntConstant* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  locations->SetOut(Location::ConstantLocation(instruction));
+}
+
+void InstructionCodeGeneratorRISCV64::VisitIntConstant([[maybe_unused]] HIntConstant* instruction) {
+  // Will be generated at use site.
+}
+
+void LocationsBuilderRISCV64::VisitIntermediateAddress(HIntermediateAddress* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitIntermediateAddress(HIntermediateAddress* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitInvokeUnresolved(HInvokeUnresolved* instruction) {
+  // The trampoline uses the same calling convention as dex calling conventions, except
+  // instead of loading arg0/A0 with the target Method*, arg0/A0 will contain the method_idx.
+  HandleInvoke(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitInvokeUnresolved(HInvokeUnresolved* instruction) {
+  codegen_->GenerateInvokeUnresolvedRuntimeCall(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitInvokeInterface(HInvokeInterface* instruction) {
+  HandleInvoke(instruction);
+  // Use T0 as the hidden argument for `art_quick_imt_conflict_trampoline`.
+  if (instruction->GetHiddenArgumentLoadKind() == MethodLoadKind::kRecursive) {
+    instruction->GetLocations()->SetInAt(instruction->GetNumberOfArguments() - 1,
+                                         Location::RegisterLocation(T0));
+  } else {
+    instruction->GetLocations()->AddTemp(Location::RegisterLocation(T0));
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::VisitInvokeInterface(HInvokeInterface* instruction) {
+  LocationSummary* locations = instruction->GetLocations();
+  XRegister temp = locations->GetTemp(0).AsRegister<XRegister>();
+  XRegister receiver = locations->InAt(0).AsRegister<XRegister>();
+  int32_t class_offset = mirror::Object::ClassOffset().Int32Value();
+  Offset entry_point = ArtMethod::EntryPointFromQuickCompiledCodeOffset(kRiscv64PointerSize);
+
+  // /* HeapReference<Class> */ temp = receiver->klass_
+  __ Loadwu(temp, receiver, class_offset);
+  codegen_->MaybeRecordImplicitNullCheck(instruction);
+  // Instead of simply (possibly) unpoisoning `temp` here, we should
+  // emit a read barrier for the previous class reference load.
+  // However this is not required in practice, as this is an
+  // intermediate/temporary reference and because the current
+  // concurrent copying collector keeps the from-space memory
+  // intact/accessible until the end of the marking phase (the
+  // concurrent copying collector may not in the future).
+  codegen_->MaybeUnpoisonHeapReference(temp);
+
+  // If we're compiling baseline, update the inline cache.
+  codegen_->MaybeGenerateInlineCacheCheck(instruction, temp);
+
+  // The register T0 is required to be used for the hidden argument in
+  // `art_quick_imt_conflict_trampoline`.
+  if (instruction->GetHiddenArgumentLoadKind() != MethodLoadKind::kRecursive &&
+      instruction->GetHiddenArgumentLoadKind() != MethodLoadKind::kRuntimeCall) {
+    Location hidden_reg = instruction->GetLocations()->GetTemp(1);
+    // Load the resolved interface method in the hidden argument register T0.
+    DCHECK_EQ(T0, hidden_reg.AsRegister<XRegister>());
+    codegen_->LoadMethod(instruction->GetHiddenArgumentLoadKind(), hidden_reg, instruction);
+  }
+
+  __ Loadd(temp, temp, mirror::Class::ImtPtrOffset(kRiscv64PointerSize).Uint32Value());
+  uint32_t method_offset = static_cast<uint32_t>(ImTable::OffsetOfElement(
+      instruction->GetImtIndex(), kRiscv64PointerSize));
+  // temp = temp->GetImtEntryAt(method_offset);
+  __ Loadd(temp, temp, method_offset);
+  if (instruction->GetHiddenArgumentLoadKind() == MethodLoadKind::kRuntimeCall) {
+    // We pass the method from the IMT in case of a conflict. This will ensure
+    // we go into the runtime to resolve the actual method.
+    Location hidden_reg = instruction->GetLocations()->GetTemp(1);
+    DCHECK_EQ(T0, hidden_reg.AsRegister<XRegister>());
+    __ Mv(hidden_reg.AsRegister<XRegister>(), temp);
+  }
+  // RA = temp->GetEntryPoint();
+  __ Loadd(RA, temp, entry_point.Int32Value());
+
+  // RA();
+  __ Jalr(RA);
+  DCHECK(!codegen_->IsLeafMethod());
+  codegen_->RecordPcInfo(instruction, instruction->GetDexPc());
+}
+
+void LocationsBuilderRISCV64::VisitInvokeStaticOrDirect(HInvokeStaticOrDirect* instruction) {
+  // Explicit clinit checks triggered by static invokes must have been pruned by
+  // art::PrepareForRegisterAllocation.
+  DCHECK(!instruction->IsStaticWithExplicitClinitCheck());
+
+  IntrinsicLocationsBuilderRISCV64 intrinsic(GetGraph()->GetAllocator(), codegen_);
+  if (intrinsic.TryDispatch(instruction)) {
+    return;
+  }
+
+  if (instruction->GetCodePtrLocation() == CodePtrLocation::kCallCriticalNative) {
+    CriticalNativeCallingConventionVisitorRiscv64 calling_convention_visitor(
+        /*for_register_allocation=*/ true);
+    CodeGenerator::CreateCommonInvokeLocationSummary(instruction, &calling_convention_visitor);
+  } else {
+    HandleInvoke(instruction);
+  }
+}
+
+static bool TryGenerateIntrinsicCode(HInvoke* invoke, CodeGeneratorRISCV64* codegen) {
+  if (invoke->GetLocations()->Intrinsified()) {
+    IntrinsicCodeGeneratorRISCV64 intrinsic(codegen);
+    intrinsic.Dispatch(invoke);
+    return true;
+  }
+  return false;
+}
+
+void InstructionCodeGeneratorRISCV64::VisitInvokeStaticOrDirect(
+    HInvokeStaticOrDirect* instruction) {
+  // Explicit clinit checks triggered by static invokes must have been pruned by
+  // art::PrepareForRegisterAllocation.
+  DCHECK(!instruction->IsStaticWithExplicitClinitCheck());
+
+  if (TryGenerateIntrinsicCode(instruction, codegen_)) {
+    return;
+  }
+
+  LocationSummary* locations = instruction->GetLocations();
+  codegen_->GenerateStaticOrDirectCall(
+      instruction, locations->HasTemps() ? locations->GetTemp(0) : Location::NoLocation());
+}
+
+void LocationsBuilderRISCV64::VisitInvokeVirtual(HInvokeVirtual* instruction) {
+  IntrinsicLocationsBuilderRISCV64 intrinsic(GetGraph()->GetAllocator(), codegen_);
+  if (intrinsic.TryDispatch(instruction)) {
+    return;
+  }
+
+  HandleInvoke(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitInvokeVirtual(HInvokeVirtual* instruction) {
+  if (TryGenerateIntrinsicCode(instruction, codegen_)) {
+    return;
+  }
+
+  codegen_->GenerateVirtualCall(instruction, instruction->GetLocations()->GetTemp(0));
+  DCHECK(!codegen_->IsLeafMethod());
+}
+
+void LocationsBuilderRISCV64::VisitInvokePolymorphic(HInvokePolymorphic* instruction) {
+  IntrinsicLocationsBuilderRISCV64 intrinsic(GetGraph()->GetAllocator(), codegen_);
+  if (intrinsic.TryDispatch(instruction)) {
+    return;
+  }
+  HandleInvoke(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitInvokePolymorphic(HInvokePolymorphic* instruction) {
+  if (TryGenerateIntrinsicCode(instruction, codegen_)) {
+    return;
+  }
+  codegen_->GenerateInvokePolymorphicCall(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitInvokeCustom(HInvokeCustom* instruction) {
+  HandleInvoke(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitInvokeCustom(HInvokeCustom* instruction) {
+  codegen_->GenerateInvokeCustomCall(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitLessThan(HLessThan* instruction) {
+  HandleCondition(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitLessThan(HLessThan* instruction) {
+  HandleCondition(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitLessThanOrEqual(HLessThanOrEqual* instruction) {
+  HandleCondition(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitLessThanOrEqual(HLessThanOrEqual* instruction) {
+  HandleCondition(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitLoadClass(HLoadClass* instruction) {
+  HLoadClass::LoadKind load_kind = instruction->GetLoadKind();
+  if (load_kind == HLoadClass::LoadKind::kRuntimeCall) {
+    InvokeRuntimeCallingConvention calling_convention;
+    Location loc = Location::RegisterLocation(calling_convention.GetRegisterAt(0));
+    DCHECK_EQ(DataType::Type::kReference, instruction->GetType());
+    DCHECK(loc.Equals(calling_convention.GetReturnLocation(DataType::Type::kReference)));
+    CodeGenerator::CreateLoadClassRuntimeCallLocationSummary(instruction, loc, loc);
+    return;
+  }
+  DCHECK_EQ(instruction->NeedsAccessCheck(),
+            load_kind == HLoadClass::LoadKind::kBssEntryPublic ||
+                load_kind == HLoadClass::LoadKind::kBssEntryPackage);
+
+  const bool requires_read_barrier = !instruction->IsInBootImage() && codegen_->EmitReadBarrier();
+  LocationSummary::CallKind call_kind = (instruction->NeedsEnvironment() || requires_read_barrier)
+      ? LocationSummary::kCallOnSlowPath
+      : LocationSummary::kNoCall;
+  LocationSummary* locations =
+      new (GetGraph()->GetAllocator()) LocationSummary(instruction, call_kind);
+  if (kUseBakerReadBarrier && requires_read_barrier && !instruction->NeedsEnvironment()) {
+    locations->SetCustomSlowPathCallerSaves(RegisterSet::Empty());  // No caller-save registers.
+  }
+  if (load_kind == HLoadClass::LoadKind::kReferrersClass) {
+    locations->SetInAt(0, Location::RequiresRegister());
+  }
+  locations->SetOut(Location::RequiresRegister());
+  if (load_kind == HLoadClass::LoadKind::kBssEntry ||
+      load_kind == HLoadClass::LoadKind::kBssEntryPublic ||
+      load_kind == HLoadClass::LoadKind::kBssEntryPackage) {
+    if (codegen_->EmitNonBakerReadBarrier()) {
+      // For non-Baker read barriers we have a temp-clobbering call.
+    } else {
+      // Rely on the type resolution or initialization and marking to save everything we need.
+      locations->SetCustomSlowPathCallerSaves(OneRegInReferenceOutSaveEverythingCallerSaves());
+    }
+  }
+}
+
+// NO_THREAD_SAFETY_ANALYSIS as we manipulate handles whose internal object we know does not
+// move.
+void InstructionCodeGeneratorRISCV64::VisitLoadClass(HLoadClass* instruction)
+    NO_THREAD_SAFETY_ANALYSIS {
+  HLoadClass::LoadKind load_kind = instruction->GetLoadKind();
+  if (load_kind == HLoadClass::LoadKind::kRuntimeCall) {
+    codegen_->GenerateLoadClassRuntimeCall(instruction);
+    return;
+  }
+  DCHECK_EQ(instruction->NeedsAccessCheck(),
+            load_kind == HLoadClass::LoadKind::kBssEntryPublic ||
+                load_kind == HLoadClass::LoadKind::kBssEntryPackage);
+
+  LocationSummary* locations = instruction->GetLocations();
+  Location out_loc = locations->Out();
+  XRegister out = out_loc.AsRegister<XRegister>();
+  const ReadBarrierOption read_barrier_option =
+      instruction->IsInBootImage() ? kWithoutReadBarrier : codegen_->GetCompilerReadBarrierOption();
+  bool generate_null_check = false;
+  switch (load_kind) {
+    case HLoadClass::LoadKind::kReferrersClass: {
+      DCHECK(!instruction->CanCallRuntime());
+      DCHECK(!instruction->MustGenerateClinitCheck());
+      // /* GcRoot<mirror::Class> */ out = current_method->declaring_class_
+      XRegister current_method = locations->InAt(0).AsRegister<XRegister>();
+      codegen_->GenerateGcRootFieldLoad(instruction,
+                                        out_loc,
+                                        current_method,
+                                        ArtMethod::DeclaringClassOffset().Int32Value(),
+                                        read_barrier_option);
+      break;
+    }
+    case HLoadClass::LoadKind::kBootImageLinkTimePcRelative: {
+      DCHECK(codegen_->GetCompilerOptions().IsBootImage() ||
+             codegen_->GetCompilerOptions().IsBootImageExtension());
+      DCHECK_EQ(read_barrier_option, kWithoutReadBarrier);
+      CodeGeneratorRISCV64::PcRelativePatchInfo* info_high =
+          codegen_->NewBootImageTypePatch(instruction->GetDexFile(), instruction->GetTypeIndex());
+      codegen_->EmitPcRelativeAuipcPlaceholder(info_high, out);
+      CodeGeneratorRISCV64::PcRelativePatchInfo* info_low =
+          codegen_->NewBootImageTypePatch(
+              instruction->GetDexFile(), instruction->GetTypeIndex(), info_high);
+      codegen_->EmitPcRelativeAddiPlaceholder(info_low, out, out);
+      break;
+    }
+    case HLoadClass::LoadKind::kBootImageRelRo: {
+      DCHECK(!codegen_->GetCompilerOptions().IsBootImage());
+      uint32_t boot_image_offset = codegen_->GetBootImageOffset(instruction);
+      codegen_->LoadBootImageRelRoEntry(out, boot_image_offset);
+      break;
+    }
+    case HLoadClass::LoadKind::kBssEntry:
+    case HLoadClass::LoadKind::kBssEntryPublic:
+    case HLoadClass::LoadKind::kBssEntryPackage: {
+      CodeGeneratorRISCV64::PcRelativePatchInfo* bss_info_high =
+          codegen_->NewTypeBssEntryPatch(instruction);
+      codegen_->EmitPcRelativeAuipcPlaceholder(bss_info_high, out);
+      CodeGeneratorRISCV64::PcRelativePatchInfo* info_low = codegen_->NewTypeBssEntryPatch(
+          instruction, bss_info_high);
+      codegen_->GenerateGcRootFieldLoad(instruction,
+                                        out_loc,
+                                        out,
+                                        /* offset= */ kLinkTimeOffsetPlaceholderLow,
+                                        read_barrier_option,
+                                        &info_low->label);
+      generate_null_check = true;
+      break;
+    }
+    case HLoadClass::LoadKind::kJitBootImageAddress: {
+      DCHECK_EQ(read_barrier_option, kWithoutReadBarrier);
+      uint32_t address = reinterpret_cast32<uint32_t>(instruction->GetClass().Get());
+      DCHECK_NE(address, 0u);
+      __ Loadwu(out, codegen_->DeduplicateBootImageAddressLiteral(address));
+      break;
+    }
+    case HLoadClass::LoadKind::kJitTableAddress:
+      __ Loadwu(out, codegen_->DeduplicateJitClassLiteral(instruction->GetDexFile(),
+                                                          instruction->GetTypeIndex(),
+                                                          instruction->GetClass()));
+      codegen_->GenerateGcRootFieldLoad(
+          instruction, out_loc, out, /* offset= */ 0, read_barrier_option);
+      break;
+    case HLoadClass::LoadKind::kRuntimeCall:
+    case HLoadClass::LoadKind::kInvalid:
+      LOG(FATAL) << "UNREACHABLE";
+      UNREACHABLE();
+  }
+
+  if (generate_null_check || instruction->MustGenerateClinitCheck()) {
+    DCHECK(instruction->CanCallRuntime());
+    SlowPathCodeRISCV64* slow_path =
+        new (codegen_->GetScopedAllocator()) LoadClassSlowPathRISCV64(instruction, instruction);
+    codegen_->AddSlowPath(slow_path);
+    if (generate_null_check) {
+      __ Beqz(out, slow_path->GetEntryLabel());
+    }
+    if (instruction->MustGenerateClinitCheck()) {
+      GenerateClassInitializationCheck(slow_path, out);
+    } else {
+      __ Bind(slow_path->GetExitLabel());
+    }
+  }
+}
+
+void LocationsBuilderRISCV64::VisitLoadException(HLoadException* instruction) {
+  LocationSummary* locations =
+      new (GetGraph()->GetAllocator()) LocationSummary(instruction, LocationSummary::kNoCall);
+  locations->SetOut(Location::RequiresRegister());
+}
+
+void InstructionCodeGeneratorRISCV64::VisitLoadException(HLoadException* instruction) {
+  XRegister out = instruction->GetLocations()->Out().AsRegister<XRegister>();
+  __ Loadwu(out, TR, GetExceptionTlsOffset());
+}
+
+void LocationsBuilderRISCV64::VisitLoadMethodHandle(HLoadMethodHandle* instruction) {
+  InvokeRuntimeCallingConvention calling_convention;
+  Location loc = Location::RegisterLocation(calling_convention.GetRegisterAt(0));
+  CodeGenerator::CreateLoadMethodHandleRuntimeCallLocationSummary(instruction, loc, loc);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitLoadMethodHandle(HLoadMethodHandle* instruction) {
+  codegen_->GenerateLoadMethodHandleRuntimeCall(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitLoadMethodType(HLoadMethodType* instruction) {
+  InvokeRuntimeCallingConvention calling_convention;
+  Location loc = Location::RegisterLocation(calling_convention.GetRegisterAt(0));
+  CodeGenerator::CreateLoadMethodTypeRuntimeCallLocationSummary(instruction, loc, loc);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitLoadMethodType(HLoadMethodType* instruction) {
+  codegen_->GenerateLoadMethodTypeRuntimeCall(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitLoadString(HLoadString* instruction) {
+  HLoadString::LoadKind load_kind = instruction->GetLoadKind();
+  LocationSummary::CallKind call_kind = codegen_->GetLoadStringCallKind(instruction);
+  LocationSummary* locations =
+      new (GetGraph()->GetAllocator()) LocationSummary(instruction, call_kind);
+  if (load_kind == HLoadString::LoadKind::kRuntimeCall) {
+    InvokeRuntimeCallingConvention calling_convention;
+    DCHECK_EQ(DataType::Type::kReference, instruction->GetType());
+    locations->SetOut(calling_convention.GetReturnLocation(DataType::Type::kReference));
+  } else {
+    locations->SetOut(Location::RequiresRegister());
+    if (load_kind == HLoadString::LoadKind::kBssEntry) {
+      if (codegen_->EmitNonBakerReadBarrier()) {
+        // For non-Baker read barriers we have a temp-clobbering call.
+      } else {
+        // Rely on the pResolveString and marking to save everything we need.
+        locations->SetCustomSlowPathCallerSaves(OneRegInReferenceOutSaveEverythingCallerSaves());
+      }
+    }
+  }
+}
+
+// NO_THREAD_SAFETY_ANALYSIS as we manipulate handles whose internal object we know does not
+// move.
+void InstructionCodeGeneratorRISCV64::VisitLoadString(HLoadString* instruction)
+    NO_THREAD_SAFETY_ANALYSIS {
+  HLoadString::LoadKind load_kind = instruction->GetLoadKind();
+  LocationSummary* locations = instruction->GetLocations();
+  Location out_loc = locations->Out();
+  XRegister out = out_loc.AsRegister<XRegister>();
+
+  switch (load_kind) {
+    case HLoadString::LoadKind::kBootImageLinkTimePcRelative: {
+      DCHECK(codegen_->GetCompilerOptions().IsBootImage() ||
+             codegen_->GetCompilerOptions().IsBootImageExtension());
+      CodeGeneratorRISCV64::PcRelativePatchInfo* info_high = codegen_->NewBootImageStringPatch(
+          instruction->GetDexFile(), instruction->GetStringIndex());
+      codegen_->EmitPcRelativeAuipcPlaceholder(info_high, out);
+      CodeGeneratorRISCV64::PcRelativePatchInfo* info_low = codegen_->NewBootImageStringPatch(
+          instruction->GetDexFile(), instruction->GetStringIndex(), info_high);
+      codegen_->EmitPcRelativeAddiPlaceholder(info_low, out, out);
+      return;
+    }
+    case HLoadString::LoadKind::kBootImageRelRo: {
+      DCHECK(!codegen_->GetCompilerOptions().IsBootImage());
+      uint32_t boot_image_offset = codegen_->GetBootImageOffset(instruction);
+      codegen_->LoadBootImageRelRoEntry(out, boot_image_offset);
+      return;
+    }
+    case HLoadString::LoadKind::kBssEntry: {
+      CodeGeneratorRISCV64::PcRelativePatchInfo* info_high = codegen_->NewStringBssEntryPatch(
+          instruction->GetDexFile(), instruction->GetStringIndex());
+      codegen_->EmitPcRelativeAuipcPlaceholder(info_high, out);
+      CodeGeneratorRISCV64::PcRelativePatchInfo* info_low = codegen_->NewStringBssEntryPatch(
+          instruction->GetDexFile(), instruction->GetStringIndex(), info_high);
+      codegen_->GenerateGcRootFieldLoad(instruction,
+                                        out_loc,
+                                        out,
+                                        /* offset= */ kLinkTimeOffsetPlaceholderLow,
+                                        codegen_->GetCompilerReadBarrierOption(),
+                                        &info_low->label);
+      SlowPathCodeRISCV64* slow_path =
+          new (codegen_->GetScopedAllocator()) LoadStringSlowPathRISCV64(instruction);
+      codegen_->AddSlowPath(slow_path);
+      __ Beqz(out, slow_path->GetEntryLabel());
+      __ Bind(slow_path->GetExitLabel());
+      return;
+    }
+    case HLoadString::LoadKind::kJitBootImageAddress: {
+      uint32_t address = reinterpret_cast32<uint32_t>(instruction->GetString().Get());
+      DCHECK_NE(address, 0u);
+      __ Loadwu(out, codegen_->DeduplicateBootImageAddressLiteral(address));
+      return;
+    }
+    case HLoadString::LoadKind::kJitTableAddress:
+      __ Loadwu(
+          out,
+          codegen_->DeduplicateJitStringLiteral(
+              instruction->GetDexFile(), instruction->GetStringIndex(), instruction->GetString()));
+      codegen_->GenerateGcRootFieldLoad(
+          instruction, out_loc, out, 0, codegen_->GetCompilerReadBarrierOption());
+      return;
+    default:
+      break;
+  }
+
+  DCHECK(load_kind == HLoadString::LoadKind::kRuntimeCall);
+  InvokeRuntimeCallingConvention calling_convention;
+  DCHECK(calling_convention.GetReturnLocation(DataType::Type::kReference).Equals(out_loc));
+  __ LoadConst32(calling_convention.GetRegisterAt(0), instruction->GetStringIndex().index_);
+  codegen_->InvokeRuntime(kQuickResolveString, instruction, instruction->GetDexPc());
+  CheckEntrypointTypes<kQuickResolveString, void*, uint32_t>();
+}
+
+void LocationsBuilderRISCV64::VisitLongConstant(HLongConstant* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  locations->SetOut(Location::ConstantLocation(instruction));
+}
+
+void InstructionCodeGeneratorRISCV64::VisitLongConstant(
+    [[maybe_unused]] HLongConstant* instruction) {
+  // Will be generated at use site.
+}
+
+void LocationsBuilderRISCV64::VisitMax(HMax* instruction) {
+  HandleBinaryOp(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitMax(HMax* instruction) {
+  HandleBinaryOp(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitMemoryBarrier(HMemoryBarrier* instruction) {
+  instruction->SetLocations(nullptr);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitMemoryBarrier(HMemoryBarrier* instruction) {
+  codegen_->GenerateMemoryBarrier(instruction->GetBarrierKind());
+}
+
+void LocationsBuilderRISCV64::VisitMethodEntryHook(HMethodEntryHook* instruction) {
+  new (GetGraph()->GetAllocator()) LocationSummary(instruction, LocationSummary::kCallOnSlowPath);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitMethodEntryHook(HMethodEntryHook* instruction) {
+  DCHECK(codegen_->GetCompilerOptions().IsJitCompiler() && GetGraph()->IsDebuggable());
+  DCHECK(codegen_->RequiresCurrentMethod());
+  GenerateMethodEntryExitHook(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitMethodExitHook(HMethodExitHook* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator())
+      LocationSummary(instruction, LocationSummary::kCallOnSlowPath);
+  DataType::Type return_type = instruction->InputAt(0)->GetType();
+  locations->SetInAt(0, Riscv64ReturnLocation(return_type));
+}
+
+void InstructionCodeGeneratorRISCV64::VisitMethodExitHook(HMethodExitHook* instruction) {
+  DCHECK(codegen_->GetCompilerOptions().IsJitCompiler() && GetGraph()->IsDebuggable());
+  DCHECK(codegen_->RequiresCurrentMethod());
+  GenerateMethodEntryExitHook(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitMin(HMin* instruction) {
+  HandleBinaryOp(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitMin(HMin* instruction) {
+  HandleBinaryOp(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitMonitorOperation(HMonitorOperation* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(
+      instruction, LocationSummary::kCallOnMainOnly);
+  InvokeRuntimeCallingConvention calling_convention;
+  locations->SetInAt(0, Location::RegisterLocation(calling_convention.GetRegisterAt(0)));
+}
+
+void InstructionCodeGeneratorRISCV64::VisitMonitorOperation(HMonitorOperation* instruction) {
+  codegen_->InvokeRuntime(instruction->IsEnter() ? kQuickLockObject : kQuickUnlockObject,
+                          instruction,
+                          instruction->GetDexPc());
+  if (instruction->IsEnter()) {
+    CheckEntrypointTypes<kQuickLockObject, void, mirror::Object*>();
+  } else {
+    CheckEntrypointTypes<kQuickUnlockObject, void, mirror::Object*>();
+  }
+}
+
+void LocationsBuilderRISCV64::VisitMul(HMul* instruction) {
+  LocationSummary* locations =
+      new (GetGraph()->GetAllocator()) LocationSummary(instruction, LocationSummary::kNoCall);
+  switch (instruction->GetResultType()) {
+    case DataType::Type::kInt32:
+    case DataType::Type::kInt64:
+      locations->SetInAt(0, Location::RequiresRegister());
+      locations->SetInAt(1, Location::RequiresRegister());
+      locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+      break;
+
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64:
+      locations->SetInAt(0, Location::RequiresFpuRegister());
+      locations->SetInAt(1, Location::RequiresFpuRegister());
+      locations->SetOut(Location::RequiresFpuRegister(), Location::kNoOutputOverlap);
+      break;
+
+    default:
+      LOG(FATAL) << "Unexpected mul type " << instruction->GetResultType();
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::VisitMul(HMul* instruction) {
+  LocationSummary* locations = instruction->GetLocations();
+  switch (instruction->GetResultType()) {
+    case DataType::Type::kInt32:
+      __ Mulw(locations->Out().AsRegister<XRegister>(),
+              locations->InAt(0).AsRegister<XRegister>(),
+              locations->InAt(1).AsRegister<XRegister>());
+      break;
+
+    case DataType::Type::kInt64:
+      __ Mul(locations->Out().AsRegister<XRegister>(),
+             locations->InAt(0).AsRegister<XRegister>(),
+             locations->InAt(1).AsRegister<XRegister>());
+      break;
+
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64:
+      FMul(locations->Out().AsFpuRegister<FRegister>(),
+           locations->InAt(0).AsFpuRegister<FRegister>(),
+           locations->InAt(1).AsFpuRegister<FRegister>(),
+           instruction->GetResultType());
+      break;
+
+    default:
+      LOG(FATAL) << "Unexpected mul type " << instruction->GetResultType();
+  }
+}
+
+void LocationsBuilderRISCV64::VisitNeg(HNeg* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  switch (instruction->GetResultType()) {
+    case DataType::Type::kInt32:
+    case DataType::Type::kInt64:
+      locations->SetInAt(0, Location::RequiresRegister());
+      locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+      break;
+
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64:
+      locations->SetInAt(0, Location::RequiresFpuRegister());
+      locations->SetOut(Location::RequiresFpuRegister(), Location::kNoOutputOverlap);
+      break;
+
+    default:
+      LOG(FATAL) << "Unexpected neg type " << instruction->GetResultType();
+      UNREACHABLE();
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::VisitNeg(HNeg* instruction) {
+  LocationSummary* locations = instruction->GetLocations();
+  switch (instruction->GetResultType()) {
+    case DataType::Type::kInt32:
+      __ NegW(locations->Out().AsRegister<XRegister>(), locations->InAt(0).AsRegister<XRegister>());
+      break;
+
+    case DataType::Type::kInt64:
+      __ Neg(locations->Out().AsRegister<XRegister>(), locations->InAt(0).AsRegister<XRegister>());
+      break;
+
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64:
+      FNeg(locations->Out().AsFpuRegister<FRegister>(),
+           locations->InAt(0).AsFpuRegister<FRegister>(),
+           instruction->GetResultType());
+      break;
+
+    default:
+      LOG(FATAL) << "Unexpected neg type " << instruction->GetResultType();
+      UNREACHABLE();
+  }
+}
+
+void LocationsBuilderRISCV64::VisitNewArray(HNewArray* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator())
+      LocationSummary(instruction, LocationSummary::kCallOnMainOnly);
+  InvokeRuntimeCallingConvention calling_convention;
+  locations->SetOut(calling_convention.GetReturnLocation(DataType::Type::kReference));
+  locations->SetInAt(0, Location::RegisterLocation(calling_convention.GetRegisterAt(0)));
+  locations->SetInAt(1, Location::RegisterLocation(calling_convention.GetRegisterAt(1)));
+}
+
+void InstructionCodeGeneratorRISCV64::VisitNewArray(HNewArray* instruction) {
+  QuickEntrypointEnum entrypoint = CodeGenerator::GetArrayAllocationEntrypoint(instruction);
+  codegen_->InvokeRuntime(entrypoint, instruction, instruction->GetDexPc());
+  CheckEntrypointTypes<kQuickAllocArrayResolved, void*, mirror::Class*, int32_t>();
+  DCHECK(!codegen_->IsLeafMethod());
+}
+
+void LocationsBuilderRISCV64::VisitNewInstance(HNewInstance* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(
+      instruction, LocationSummary::kCallOnMainOnly);
+  InvokeRuntimeCallingConvention calling_convention;
+  locations->SetInAt(0, Location::RegisterLocation(calling_convention.GetRegisterAt(0)));
+  locations->SetOut(calling_convention.GetReturnLocation(DataType::Type::kReference));
+}
+
+void InstructionCodeGeneratorRISCV64::VisitNewInstance(HNewInstance* instruction) {
+  codegen_->InvokeRuntime(instruction->GetEntrypoint(), instruction, instruction->GetDexPc());
+  CheckEntrypointTypes<kQuickAllocObjectWithChecks, void*, mirror::Class*>();
+}
+
+void LocationsBuilderRISCV64::VisitNop(HNop* instruction) {
+  new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitNop([[maybe_unused]] HNop* instruction) {
+  // The environment recording already happened in CodeGenerator::Compile.
+}
+
+void LocationsBuilderRISCV64::VisitNot(HNot* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  locations->SetInAt(0, Location::RequiresRegister());
+  locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitNot(HNot* instruction) {
+  LocationSummary* locations = instruction->GetLocations();
+  switch (instruction->GetResultType()) {
+    case DataType::Type::kInt32:
+    case DataType::Type::kInt64:
+      __ Not(locations->Out().AsRegister<XRegister>(), locations->InAt(0).AsRegister<XRegister>());
+      break;
+
+    default:
+      LOG(FATAL) << "Unexpected type for not operation " << instruction->GetResultType();
+      UNREACHABLE();
+  }
+}
+
+void LocationsBuilderRISCV64::VisitNotEqual(HNotEqual* instruction) {
+  HandleCondition(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitNotEqual(HNotEqual* instruction) {
+  HandleCondition(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitNullConstant(HNullConstant* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  locations->SetOut(Location::ConstantLocation(instruction));
+}
+
+void InstructionCodeGeneratorRISCV64::VisitNullConstant(
+    [[maybe_unused]] HNullConstant* instruction) {
+  // Will be generated at use site.
+}
+
+void LocationsBuilderRISCV64::VisitNullCheck(HNullCheck* instruction) {
+  LocationSummary* locations = codegen_->CreateThrowingSlowPathLocations(instruction);
+  locations->SetInAt(0, Location::RequiresRegister());
+}
+
+void InstructionCodeGeneratorRISCV64::VisitNullCheck(HNullCheck* instruction) {
+  codegen_->GenerateNullCheck(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitOr(HOr* instruction) {
+  HandleBinaryOp(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitOr(HOr* instruction) {
+  HandleBinaryOp(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitPackedSwitch(HPackedSwitch* instruction) {
+  LocationSummary* locations =
+      new (GetGraph()->GetAllocator()) LocationSummary(instruction, LocationSummary::kNoCall);
+  locations->SetInAt(0, Location::RequiresRegister());
+}
+
+void InstructionCodeGeneratorRISCV64::VisitPackedSwitch(HPackedSwitch* instruction) {
+  int32_t lower_bound = instruction->GetStartValue();
+  uint32_t num_entries = instruction->GetNumEntries();
+  LocationSummary* locations = instruction->GetLocations();
+  XRegister value = locations->InAt(0).AsRegister<XRegister>();
+  HBasicBlock* switch_block = instruction->GetBlock();
+  HBasicBlock* default_block = instruction->GetDefaultBlock();
+
+  // Prepare a temporary register and an adjusted zero-based value.
+  ScratchRegisterScope srs(GetAssembler());
+  XRegister temp = srs.AllocateXRegister();
+  XRegister adjusted = value;
+  if (lower_bound != 0) {
+    adjusted = temp;
+    __ AddConst32(temp, value, -lower_bound);
+  }
+
+  // Jump to the default block if the index is out of the packed switch value range.
+  // Note: We could save one instruction for `num_entries == 1` with BNEZ but the
+  // `HInstructionBuilder` transforms that case to an `HIf`, so let's keep the code simple.
+  CHECK_NE(num_entries, 0u);  // `HInstructionBuilder` creates a `HGoto` for empty packed-switch.
+  {
+    ScratchRegisterScope srs2(GetAssembler());
+    XRegister temp2 = srs2.AllocateXRegister();
+    __ LoadConst32(temp2, num_entries);
+    __ Bgeu(adjusted, temp2, codegen_->GetLabelOf(default_block));  // Can clobber `TMP` if taken.
+  }
+
+  if (num_entries >= kPackedSwitchCompareJumpThreshold) {
+    GenTableBasedPackedSwitch(adjusted, temp, num_entries, switch_block);
+  } else {
+    GenPackedSwitchWithCompares(adjusted, temp, num_entries, switch_block);
+  }
+}
+
+void LocationsBuilderRISCV64::VisitParallelMove([[maybe_unused]] HParallelMove* instruction) {
+  LOG(FATAL) << "Unreachable";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitParallelMove(HParallelMove* instruction) {
+  if (instruction->GetNext()->IsSuspendCheck() &&
+      instruction->GetBlock()->GetLoopInformation() != nullptr) {
+    HSuspendCheck* suspend_check = instruction->GetNext()->AsSuspendCheck();
+    // The back edge will generate the suspend check.
+    codegen_->ClearSpillSlotsFromLoopPhisInStackMap(suspend_check, instruction);
+  }
+
+  codegen_->GetMoveResolver()->EmitNativeCode(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitParameterValue(HParameterValue* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  Location location = parameter_visitor_.GetNextLocation(instruction->GetType());
+  if (location.IsStackSlot()) {
+    location = Location::StackSlot(location.GetStackIndex() + codegen_->GetFrameSize());
+  } else if (location.IsDoubleStackSlot()) {
+    location = Location::DoubleStackSlot(location.GetStackIndex() + codegen_->GetFrameSize());
+  }
+  locations->SetOut(location);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitParameterValue(
+    [[maybe_unused]] HParameterValue* instruction) {
+  // Nothing to do, the parameter is already at its location.
+}
+
+void LocationsBuilderRISCV64::VisitPhi(HPhi* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  for (size_t i = 0, e = locations->GetInputCount(); i < e; ++i) {
+    locations->SetInAt(i, Location::Any());
+  }
+  locations->SetOut(Location::Any());
+}
+
+void InstructionCodeGeneratorRISCV64::VisitPhi([[maybe_unused]] HPhi* instruction) {
+  LOG(FATAL) << "Unreachable";
+}
+
+void LocationsBuilderRISCV64::VisitRem(HRem* instruction) {
+  DataType::Type type = instruction->GetResultType();
+  LocationSummary::CallKind call_kind =
+      DataType::IsFloatingPointType(type) ? LocationSummary::kCallOnMainOnly
+                                          : LocationSummary::kNoCall;
+  LocationSummary* locations =
+      new (GetGraph()->GetAllocator()) LocationSummary(instruction, call_kind);
+
+  switch (type) {
+    case DataType::Type::kInt32:
+    case DataType::Type::kInt64:
+      locations->SetInAt(0, Location::RequiresRegister());
+      locations->SetInAt(1, Location::RegisterOrConstant(instruction->InputAt(1)));
+      locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+      break;
+
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64: {
+      InvokeRuntimeCallingConvention calling_convention;
+      locations->SetInAt(0, Location::FpuRegisterLocation(calling_convention.GetFpuRegisterAt(0)));
+      locations->SetInAt(1, Location::FpuRegisterLocation(calling_convention.GetFpuRegisterAt(1)));
+      locations->SetOut(calling_convention.GetReturnLocation(type));
+      break;
+    }
+
+    default:
+      LOG(FATAL) << "Unexpected rem type " << type;
+      UNREACHABLE();
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::VisitRem(HRem* instruction) {
+  DataType::Type type = instruction->GetType();
+
+  switch (type) {
+    case DataType::Type::kInt32:
+    case DataType::Type::kInt64:
+      GenerateDivRemIntegral(instruction);
+      break;
+
+    case DataType::Type::kFloat32:
+    case DataType::Type::kFloat64: {
+      QuickEntrypointEnum entrypoint =
+          (type == DataType::Type::kFloat32) ? kQuickFmodf : kQuickFmod;
+      codegen_->InvokeRuntime(entrypoint, instruction, instruction->GetDexPc());
+      if (type == DataType::Type::kFloat32) {
+        CheckEntrypointTypes<kQuickFmodf, float, float, float>();
+      } else {
+        CheckEntrypointTypes<kQuickFmod, double, double, double>();
+      }
+      break;
+    }
+    default:
+      LOG(FATAL) << "Unexpected rem type " << type;
+      UNREACHABLE();
+  }
+}
+
+void LocationsBuilderRISCV64::VisitReturn(HReturn* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  DataType::Type return_type = instruction->InputAt(0)->GetType();
+  DCHECK_NE(return_type, DataType::Type::kVoid);
+  locations->SetInAt(0, Riscv64ReturnLocation(return_type));
+}
+
+void InstructionCodeGeneratorRISCV64::VisitReturn(HReturn* instruction) {
+  if (GetGraph()->IsCompilingOsr()) {
+    // To simplify callers of an OSR method, we put a floating point return value
+    // in both floating point and core return registers.
+    DataType::Type type = instruction->InputAt(0)->GetType();
+    if (DataType::IsFloatingPointType(type)) {
+      FMvX(A0, FA0, type);
+    }
+  }
+  codegen_->GenerateFrameExit();
+}
+
+void LocationsBuilderRISCV64::VisitReturnVoid(HReturnVoid* instruction) {
+  instruction->SetLocations(nullptr);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitReturnVoid([[maybe_unused]] HReturnVoid* instruction) {
+  codegen_->GenerateFrameExit();
+}
+
+void LocationsBuilderRISCV64::VisitRor(HRor* instruction) {
+  HandleShift(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitRor(HRor* instruction) {
+  HandleShift(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitShl(HShl* instruction) {
+  HandleShift(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitShl(HShl* instruction) {
+  HandleShift(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitShr(HShr* instruction) {
+  HandleShift(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitShr(HShr* instruction) {
+  HandleShift(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitStaticFieldGet(HStaticFieldGet* instruction) {
+  HandleFieldGet(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitStaticFieldGet(HStaticFieldGet* instruction) {
+  HandleFieldGet(instruction, instruction->GetFieldInfo());
+}
+
+void LocationsBuilderRISCV64::VisitStaticFieldSet(HStaticFieldSet* instruction) {
+  HandleFieldSet(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitStaticFieldSet(HStaticFieldSet* instruction) {
+  HandleFieldSet(instruction,
+                 instruction->GetFieldInfo(),
+                 instruction->GetValueCanBeNull(),
+                 instruction->GetWriteBarrierKind());
+}
+
+void LocationsBuilderRISCV64::VisitStringBuilderAppend(HStringBuilderAppend* instruction) {
+  codegen_->CreateStringBuilderAppendLocations(instruction, Location::RegisterLocation(A0));
+}
+
+void InstructionCodeGeneratorRISCV64::VisitStringBuilderAppend(HStringBuilderAppend* instruction) {
+  __ LoadConst32(A0, instruction->GetFormat()->GetValue());
+  codegen_->InvokeRuntime(kQuickStringBuilderAppend, instruction, instruction->GetDexPc());
+}
+
+void LocationsBuilderRISCV64::VisitUnresolvedInstanceFieldGet(
+    HUnresolvedInstanceFieldGet* instruction) {
+  FieldAccessCallingConventionRISCV64 calling_convention;
+  codegen_->CreateUnresolvedFieldLocationSummary(
+      instruction, instruction->GetFieldType(), calling_convention);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitUnresolvedInstanceFieldGet(
+    HUnresolvedInstanceFieldGet* instruction) {
+  FieldAccessCallingConventionRISCV64 calling_convention;
+  codegen_->GenerateUnresolvedFieldAccess(instruction,
+                                          instruction->GetFieldType(),
+                                          instruction->GetFieldIndex(),
+                                          instruction->GetDexPc(),
+                                          calling_convention);
+}
+
+void LocationsBuilderRISCV64::VisitUnresolvedInstanceFieldSet(
+    HUnresolvedInstanceFieldSet* instruction) {
+  FieldAccessCallingConventionRISCV64 calling_convention;
+  codegen_->CreateUnresolvedFieldLocationSummary(
+      instruction, instruction->GetFieldType(), calling_convention);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitUnresolvedInstanceFieldSet(
+    HUnresolvedInstanceFieldSet* instruction) {
+  FieldAccessCallingConventionRISCV64 calling_convention;
+  codegen_->GenerateUnresolvedFieldAccess(instruction,
+                                          instruction->GetFieldType(),
+                                          instruction->GetFieldIndex(),
+                                          instruction->GetDexPc(),
+                                          calling_convention);
+}
+
+void LocationsBuilderRISCV64::VisitUnresolvedStaticFieldGet(
+    HUnresolvedStaticFieldGet* instruction) {
+  FieldAccessCallingConventionRISCV64 calling_convention;
+  codegen_->CreateUnresolvedFieldLocationSummary(
+      instruction, instruction->GetFieldType(), calling_convention);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitUnresolvedStaticFieldGet(
+    HUnresolvedStaticFieldGet* instruction) {
+  FieldAccessCallingConventionRISCV64 calling_convention;
+  codegen_->GenerateUnresolvedFieldAccess(instruction,
+                                          instruction->GetFieldType(),
+                                          instruction->GetFieldIndex(),
+                                          instruction->GetDexPc(),
+                                          calling_convention);
+}
+
+void LocationsBuilderRISCV64::VisitUnresolvedStaticFieldSet(
+    HUnresolvedStaticFieldSet* instruction) {
+  FieldAccessCallingConventionRISCV64 calling_convention;
+  codegen_->CreateUnresolvedFieldLocationSummary(
+      instruction, instruction->GetFieldType(), calling_convention);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitUnresolvedStaticFieldSet(
+    HUnresolvedStaticFieldSet* instruction) {
+  FieldAccessCallingConventionRISCV64 calling_convention;
+  codegen_->GenerateUnresolvedFieldAccess(instruction,
+                                          instruction->GetFieldType(),
+                                          instruction->GetFieldIndex(),
+                                          instruction->GetDexPc(),
+                                          calling_convention);
+}
+
+void LocationsBuilderRISCV64::VisitSelect(HSelect* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  if (DataType::IsFloatingPointType(instruction->GetType())) {
+    locations->SetInAt(0, FpuRegisterOrZeroBitPatternLocation(instruction->GetFalseValue()));
+    locations->SetInAt(1, FpuRegisterOrZeroBitPatternLocation(instruction->GetTrueValue()));
+    locations->SetOut(Location::RequiresFpuRegister(), Location::kNoOutputOverlap);
+    if (!locations->InAt(0).IsConstant() && !locations->InAt(1).IsConstant()) {
+      locations->AddTemp(Location::RequiresRegister());
+    }
+  }  else {
+    locations->SetInAt(0, RegisterOrZeroBitPatternLocation(instruction->GetFalseValue()));
+    locations->SetInAt(1, RegisterOrZeroBitPatternLocation(instruction->GetTrueValue()));
+    locations->SetOut(Location::RequiresRegister(), Location::kOutputOverlap);
+  }
+
+  if (IsBooleanValueOrMaterializedCondition(instruction->GetCondition())) {
+    locations->SetInAt(2, Location::RequiresRegister());
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::VisitSelect(HSelect* instruction) {
+  LocationSummary* locations = instruction->GetLocations();
+  HInstruction* cond = instruction->GetCondition();
+  ScratchRegisterScope srs(GetAssembler());
+  XRegister tmp = srs.AllocateXRegister();
+  if (!IsBooleanValueOrMaterializedCondition(cond)) {
+    DataType::Type cond_type = cond->InputAt(0)->GetType();
+    IfCondition if_cond = cond->AsCondition()->GetCondition();
+    if (DataType::IsFloatingPointType(cond_type)) {
+      GenerateFpCondition(if_cond,
+                          cond->AsCondition()->IsGtBias(),
+                          cond_type,
+                          cond->GetLocations(),
+                          /*label=*/ nullptr,
+                          tmp,
+                          /*to_all_bits=*/ true);
+    } else {
+      GenerateIntLongCondition(if_cond, cond->GetLocations(), tmp, /*to_all_bits=*/ true);
+    }
+  } else {
+    // TODO(riscv64): Remove the normalizing SNEZ when we can ensure that booleans
+    // have only values 0 and 1. b/279302742
+    __ Snez(tmp, locations->InAt(2).AsRegister<XRegister>());
+    __ Neg(tmp, tmp);
+  }
+
+  XRegister true_reg, false_reg, xor_reg, out_reg;
+  DataType::Type type = instruction->GetType();
+  if (DataType::IsFloatingPointType(type)) {
+    if (locations->InAt(0).IsConstant()) {
+      DCHECK(locations->InAt(0).GetConstant()->IsZeroBitPattern());
+      false_reg = Zero;
+    } else {
+      false_reg = srs.AllocateXRegister();
+      FMvX(false_reg, locations->InAt(0).AsFpuRegister<FRegister>(), type);
+    }
+    if (locations->InAt(1).IsConstant()) {
+      DCHECK(locations->InAt(1).GetConstant()->IsZeroBitPattern());
+      true_reg = Zero;
+    } else {
+      true_reg = (false_reg == Zero) ? srs.AllocateXRegister()
+                                     : locations->GetTemp(0).AsRegister<XRegister>();
+      FMvX(true_reg, locations->InAt(1).AsFpuRegister<FRegister>(), type);
+    }
+    // We can clobber the "true value" with the XOR result.
+    // Note: The XOR is not emitted if `true_reg == Zero`, see below.
+    xor_reg = true_reg;
+    out_reg = tmp;
+  } else {
+    false_reg = InputXRegisterOrZero(locations->InAt(0));
+    true_reg = InputXRegisterOrZero(locations->InAt(1));
+    xor_reg = srs.AllocateXRegister();
+    out_reg = locations->Out().AsRegister<XRegister>();
+  }
+
+  // We use a branch-free implementation of `HSelect`.
+  // With `tmp` initialized to 0 for `false` and -1 for `true`:
+  //     xor xor_reg, false_reg, true_reg
+  //     and tmp, tmp, xor_reg
+  //     xor out_reg, tmp, false_reg
+  if (false_reg == Zero) {
+    xor_reg = true_reg;
+  } else if (true_reg == Zero) {
+    xor_reg = false_reg;
+  } else {
+    DCHECK_NE(xor_reg, Zero);
+    __ Xor(xor_reg, false_reg, true_reg);
+  }
+  __ And(tmp, tmp, xor_reg);
+  __ Xor(out_reg, tmp, false_reg);
+
+  if (type == DataType::Type::kFloat64) {
+    __ FMvDX(locations->Out().AsFpuRegister<FRegister>(), out_reg);
+  } else if (type == DataType::Type::kFloat32) {
+    __ FMvWX(locations->Out().AsFpuRegister<FRegister>(), out_reg);
+  }
+}
+
+void LocationsBuilderRISCV64::VisitSub(HSub* instruction) {
+  HandleBinaryOp(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitSub(HSub* instruction) {
+  HandleBinaryOp(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitSuspendCheck(HSuspendCheck* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator())
+      LocationSummary(instruction, LocationSummary::kCallOnSlowPath);
+  // In suspend check slow path, usually there are no caller-save registers at all.
+  // If SIMD instructions are present, however, we force spilling all live SIMD
+  // registers in full width (since the runtime only saves/restores lower part).
+  locations->SetCustomSlowPathCallerSaves(GetGraph()->HasSIMD() ? RegisterSet::AllFpu() :
+                                                                  RegisterSet::Empty());
+}
+
+void InstructionCodeGeneratorRISCV64::VisitSuspendCheck(HSuspendCheck* instruction) {
+  HBasicBlock* block = instruction->GetBlock();
+  if (block->GetLoopInformation() != nullptr) {
+    DCHECK(block->GetLoopInformation()->GetSuspendCheck() == instruction);
+    // The back edge will generate the suspend check.
+    return;
+  }
+  if (block->IsEntryBlock() && instruction->GetNext()->IsGoto()) {
+    // The goto will generate the suspend check.
+    return;
+  }
+  GenerateSuspendCheck(instruction, nullptr);
+}
+
+void LocationsBuilderRISCV64::VisitThrow(HThrow* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator())
+      LocationSummary(instruction, LocationSummary::kCallOnMainOnly);
+  InvokeRuntimeCallingConvention calling_convention;
+  locations->SetInAt(0, Location::RegisterLocation(calling_convention.GetRegisterAt(0)));
+}
+
+void InstructionCodeGeneratorRISCV64::VisitThrow(HThrow* instruction) {
+  codegen_->InvokeRuntime(kQuickDeliverException, instruction, instruction->GetDexPc());
+  CheckEntrypointTypes<kQuickDeliverException, void, mirror::Object*>();
+}
+
+void LocationsBuilderRISCV64::VisitTryBoundary(HTryBoundary* instruction) {
+  instruction->SetLocations(nullptr);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitTryBoundary(HTryBoundary* instruction) {
+  HBasicBlock* successor = instruction->GetNormalFlowSuccessor();
+  if (!successor->IsExitBlock()) {
+    HandleGoto(instruction, successor);
+  }
+}
+
+void LocationsBuilderRISCV64::VisitTypeConversion(HTypeConversion* instruction) {
+  DataType::Type input_type = instruction->GetInputType();
+  DataType::Type result_type = instruction->GetResultType();
+  DCHECK(!DataType::IsTypeConversionImplicit(input_type, result_type))
+      << input_type << " -> " << result_type;
+
+  if ((input_type == DataType::Type::kReference) || (input_type == DataType::Type::kVoid) ||
+      (result_type == DataType::Type::kReference) || (result_type == DataType::Type::kVoid)) {
+    LOG(FATAL) << "Unexpected type conversion from " << input_type << " to " << result_type;
+  }
+
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+
+  if (DataType::IsFloatingPointType(input_type)) {
+    locations->SetInAt(0, Location::RequiresFpuRegister());
+  } else {
+    locations->SetInAt(0, Location::RequiresRegister());
+  }
+
+  if (DataType::IsFloatingPointType(result_type)) {
+    locations->SetOut(Location::RequiresFpuRegister(), Location::kNoOutputOverlap);
+  } else {
+    locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+  }
+}
+
+void InstructionCodeGeneratorRISCV64::VisitTypeConversion(HTypeConversion* instruction) {
+  LocationSummary* locations = instruction->GetLocations();
+  DataType::Type result_type = instruction->GetResultType();
+  DataType::Type input_type = instruction->GetInputType();
+
+  DCHECK(!DataType::IsTypeConversionImplicit(input_type, result_type))
+      << input_type << " -> " << result_type;
+
+  if (DataType::IsIntegralType(result_type) && DataType::IsIntegralType(input_type)) {
+    XRegister dst = locations->Out().AsRegister<XRegister>();
+    XRegister src = locations->InAt(0).AsRegister<XRegister>();
+    switch (result_type) {
+      case DataType::Type::kUint8:
+        __ ZextB(dst, src);
+        break;
+      case DataType::Type::kInt8:
+        __ SextB(dst, src);
+        break;
+      case DataType::Type::kUint16:
+        __ ZextH(dst, src);
+        break;
+      case DataType::Type::kInt16:
+        __ SextH(dst, src);
+        break;
+      case DataType::Type::kInt32:
+      case DataType::Type::kInt64:
+        // Sign-extend 32-bit int into bits 32 through 63 for int-to-long and long-to-int
+        // conversions, except when the input and output registers are the same and we are not
+        // converting longs to shorter types. In these cases, do nothing.
+        if ((input_type == DataType::Type::kInt64) || (dst != src)) {
+          __ Addiw(dst, src, 0);
+        }
+        break;
+
+      default:
+        LOG(FATAL) << "Unexpected type conversion from " << input_type
+                   << " to " << result_type;
+        UNREACHABLE();
+    }
+  } else if (DataType::IsFloatingPointType(result_type) && DataType::IsIntegralType(input_type)) {
+    FRegister dst = locations->Out().AsFpuRegister<FRegister>();
+    XRegister src = locations->InAt(0).AsRegister<XRegister>();
+    if (input_type == DataType::Type::kInt64) {
+      if (result_type == DataType::Type::kFloat32) {
+        __ FCvtSL(dst, src, FPRoundingMode::kRNE);
+      } else {
+        __ FCvtDL(dst, src, FPRoundingMode::kRNE);
+      }
+    } else {
+      if (result_type == DataType::Type::kFloat32) {
+        __ FCvtSW(dst, src, FPRoundingMode::kRNE);
+      } else {
+        __ FCvtDW(dst, src);  // No rounding.
+      }
+    }
+  } else if (DataType::IsIntegralType(result_type) && DataType::IsFloatingPointType(input_type)) {
+    CHECK(result_type == DataType::Type::kInt32 || result_type == DataType::Type::kInt64);
+    XRegister dst = locations->Out().AsRegister<XRegister>();
+    FRegister src = locations->InAt(0).AsFpuRegister<FRegister>();
+    if (result_type == DataType::Type::kInt64) {
+      if (input_type == DataType::Type::kFloat32) {
+        __ FCvtLS(dst, src, FPRoundingMode::kRTZ);
+      } else {
+        __ FCvtLD(dst, src, FPRoundingMode::kRTZ);
+      }
+    } else {
+      if (input_type == DataType::Type::kFloat32) {
+        __ FCvtWS(dst, src, FPRoundingMode::kRTZ);
+      } else {
+        __ FCvtWD(dst, src, FPRoundingMode::kRTZ);
+      }
+    }
+    // For NaN inputs we need to return 0.
+    ScratchRegisterScope srs(GetAssembler());
+    XRegister tmp = srs.AllocateXRegister();
+    FClass(tmp, src, input_type);
+    __ Sltiu(tmp, tmp, kFClassNaNMinValue);  // 0 for NaN, 1 otherwise.
+    __ Neg(tmp, tmp);  // 0 for NaN, -1 otherwise.
+    __ And(dst, dst, tmp);  // Cleared for NaN.
+  } else if (DataType::IsFloatingPointType(result_type) &&
+             DataType::IsFloatingPointType(input_type)) {
+    FRegister dst = locations->Out().AsFpuRegister<FRegister>();
+    FRegister src = locations->InAt(0).AsFpuRegister<FRegister>();
+    if (result_type == DataType::Type::kFloat32) {
+      __ FCvtSD(dst, src);
+    } else {
+      __ FCvtDS(dst, src);
+    }
+  } else {
+    LOG(FATAL) << "Unexpected or unimplemented type conversion from " << input_type
+                << " to " << result_type;
+    UNREACHABLE();
+  }
+}
+
+void LocationsBuilderRISCV64::VisitUShr(HUShr* instruction) {
+  HandleShift(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitUShr(HUShr* instruction) {
+  HandleShift(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitXor(HXor* instruction) {
+  HandleBinaryOp(instruction);
+}
+
+void InstructionCodeGeneratorRISCV64::VisitXor(HXor* instruction) {
+  HandleBinaryOp(instruction);
+}
+
+void LocationsBuilderRISCV64::VisitVecReplicateScalar(HVecReplicateScalar* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecReplicateScalar(HVecReplicateScalar* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecExtractScalar(HVecExtractScalar* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecExtractScalar(HVecExtractScalar* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecReduce(HVecReduce* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecReduce(HVecReduce* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecCnv(HVecCnv* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecCnv(HVecCnv* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecNeg(HVecNeg* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecNeg(HVecNeg* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecAbs(HVecAbs* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecAbs(HVecAbs* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecNot(HVecNot* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecNot(HVecNot* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecAdd(HVecAdd* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecAdd(HVecAdd* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecHalvingAdd(HVecHalvingAdd* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecHalvingAdd(HVecHalvingAdd* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecSub(HVecSub* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecSub(HVecSub* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecMul(HVecMul* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecMul(HVecMul* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecDiv(HVecDiv* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecDiv(HVecDiv* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecMin(HVecMin* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecMin(HVecMin* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecMax(HVecMax* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecMax(HVecMax* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecAnd(HVecAnd* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecAnd(HVecAnd* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecAndNot(HVecAndNot* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecAndNot(HVecAndNot* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecOr(HVecOr* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecOr(HVecOr* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecXor(HVecXor* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecXor(HVecXor* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecSaturationAdd(HVecSaturationAdd* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecSaturationAdd(HVecSaturationAdd* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecSaturationSub(HVecSaturationSub* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecSaturationSub(HVecSaturationSub* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecShl(HVecShl* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecShl(HVecShl* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecShr(HVecShr* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecShr(HVecShr* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecUShr(HVecUShr* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecUShr(HVecUShr* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecSetScalars(HVecSetScalars* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecSetScalars(HVecSetScalars* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecMultiplyAccumulate(HVecMultiplyAccumulate* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecMultiplyAccumulate(
+    HVecMultiplyAccumulate* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecSADAccumulate(HVecSADAccumulate* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecSADAccumulate(HVecSADAccumulate* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecDotProd(HVecDotProd* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecDotProd(HVecDotProd* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecLoad(HVecLoad* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecLoad(HVecLoad* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecStore(HVecStore* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecStore(HVecStore* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecPredSetAll(HVecPredSetAll* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecPredSetAll(HVecPredSetAll* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecPredWhile(HVecPredWhile* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecPredWhile(HVecPredWhile* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecPredToBoolean(HVecPredToBoolean* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecPredToBoolean(HVecPredToBoolean* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecCondition(HVecCondition* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecCondition(HVecCondition* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void LocationsBuilderRISCV64::VisitVecPredNot(HVecPredNot* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+void InstructionCodeGeneratorRISCV64::VisitVecPredNot(HVecPredNot* instruction) {
+  UNUSED(instruction);
+  LOG(FATAL) << "Unimplemented";
+}
+
+namespace detail {
+
+// Mark which intrinsics we don't have handcrafted code for.
+template <Intrinsics T>
+struct IsUnimplemented {
+  bool is_unimplemented = false;
+};
+
+#define TRUE_OVERRIDE(Name)                     \
+  template <>                                   \
+  struct IsUnimplemented<Intrinsics::k##Name> { \
+    bool is_unimplemented = true;               \
+  };
+UNIMPLEMENTED_INTRINSIC_LIST_RISCV64(TRUE_OVERRIDE)
+#undef TRUE_OVERRIDE
+
+static constexpr bool kIsIntrinsicUnimplemented[] = {
+    false,  // kNone
+#define IS_UNIMPLEMENTED(Intrinsic, ...) \
+    IsUnimplemented<Intrinsics::k##Intrinsic>().is_unimplemented,
+    ART_INTRINSICS_LIST(IS_UNIMPLEMENTED)
+#undef IS_UNIMPLEMENTED
+};
+
+}  // namespace detail
+
+CodeGeneratorRISCV64::CodeGeneratorRISCV64(HGraph* graph,
+                                           const CompilerOptions& compiler_options,
+                                           OptimizingCompilerStats* stats)
+    : CodeGenerator(graph,
+                    kNumberOfXRegisters,
+                    kNumberOfFRegisters,
+                    /*number_of_register_pairs=*/ 0u,
+                    ComputeRegisterMask(kCoreCalleeSaves, arraysize(kCoreCalleeSaves)),
+                    ComputeRegisterMask(kFpuCalleeSaves, arraysize(kFpuCalleeSaves)),
+                    compiler_options,
+                    stats,
+                    ArrayRef<const bool>(detail::kIsIntrinsicUnimplemented)),
+      assembler_(graph->GetAllocator(),
+                 compiler_options.GetInstructionSetFeatures()->AsRiscv64InstructionSetFeatures()),
+      location_builder_(graph, this),
+      instruction_visitor_(graph, this),
+      block_labels_(nullptr),
+      move_resolver_(graph->GetAllocator(), this),
+      uint32_literals_(std::less<uint32_t>(),
+                       graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
+      uint64_literals_(std::less<uint64_t>(),
+                       graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
+      boot_image_method_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
+      method_bss_entry_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
+      boot_image_type_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
+      type_bss_entry_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
+      public_type_bss_entry_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
+      package_type_bss_entry_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
+      boot_image_string_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
+      string_bss_entry_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
+      boot_image_jni_entrypoint_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
+      boot_image_other_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
+      jit_string_patches_(StringReferenceValueComparator(),
+                          graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
+      jit_class_patches_(TypeReferenceValueComparator(),
+                         graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)) {
+  // Always mark the RA register to be saved.
+  AddAllocatedRegister(Location::RegisterLocation(RA));
+}
+
+void CodeGeneratorRISCV64::MaybeIncrementHotness(HSuspendCheck* suspend_check,
+                                                 bool is_frame_entry) {
+  if (GetCompilerOptions().CountHotnessInCompiledCode()) {
+    ScratchRegisterScope srs(GetAssembler());
+    XRegister method = is_frame_entry ? kArtMethodRegister : srs.AllocateXRegister();
+    if (!is_frame_entry) {
+      __ Loadd(method, SP, 0);
+    }
+    XRegister counter = srs.AllocateXRegister();
+    __ Loadhu(counter, method, ArtMethod::HotnessCountOffset().Int32Value());
+    Riscv64Label done;
+    DCHECK_EQ(0u, interpreter::kNterpHotnessValue);
+    __ Beqz(counter, &done);  // Can clobber `TMP` if taken.
+    __ Addi(counter, counter, -1);
+    // We may not have another scratch register available for `Storeh`()`,
+    // so we must use the `Sh()` function directly.
+    static_assert(IsInt<12>(ArtMethod::HotnessCountOffset().Int32Value()));
+    __ Sh(counter, method, ArtMethod::HotnessCountOffset().Int32Value());
+    __ Bind(&done);
+  }
+
+  if (GetGraph()->IsCompilingBaseline() &&
+      GetGraph()->IsUsefulOptimizing() &&
+      !Runtime::Current()->IsAotCompiler()) {
+    ProfilingInfo* info = GetGraph()->GetProfilingInfo();
+    DCHECK(info != nullptr);
+    DCHECK(!HasEmptyFrame());
+    uint64_t address = reinterpret_cast64<uint64_t>(info) +
+                       ProfilingInfo::BaselineHotnessCountOffset().SizeValue();
+    auto [base_address, imm12] = SplitJitAddress(address);
+    ScratchRegisterScope srs(GetAssembler());
+    XRegister counter = srs.AllocateXRegister();
+    XRegister tmp = RA;
+    __ LoadConst64(tmp, base_address);
+    SlowPathCodeRISCV64* slow_path =
+        new (GetScopedAllocator()) CompileOptimizedSlowPathRISCV64(suspend_check, tmp, imm12);
+    AddSlowPath(slow_path);
+    __ Lhu(counter, tmp, imm12);
+    __ Beqz(counter, slow_path->GetEntryLabel());  // Can clobber `TMP` if taken.
+    __ Addi(counter, counter, -1);
+    __ Sh(counter, tmp, imm12);
+    __ Bind(slow_path->GetExitLabel());
+  }
+}
+
+bool CodeGeneratorRISCV64::CanUseImplicitSuspendCheck() const {
+  // TODO(riscv64): Implement implicit suspend checks to reduce code size.
+  return false;
+}
+
+void CodeGeneratorRISCV64::GenerateMemoryBarrier(MemBarrierKind kind) {
+  switch (kind) {
+    case MemBarrierKind::kAnyAny:
+      __ Fence(/*pred=*/ kFenceRead | kFenceWrite, /*succ=*/ kFenceRead | kFenceWrite);
+      break;
+    case MemBarrierKind::kAnyStore:
+      __ Fence(/*pred=*/ kFenceRead | kFenceWrite, /*succ=*/ kFenceWrite);
+      break;
+    case MemBarrierKind::kLoadAny:
+      __ Fence(/*pred=*/ kFenceRead, /*succ=*/ kFenceRead | kFenceWrite);
+      break;
+    case MemBarrierKind::kStoreStore:
+      __ Fence(/*pred=*/ kFenceWrite, /*succ=*/ kFenceWrite);
+      break;
+
+    default:
+      LOG(FATAL) << "Unexpected memory barrier " << kind;
+      UNREACHABLE();
+  }
+}
+
+void CodeGeneratorRISCV64::GenerateFrameEntry() {
+  // Check if we need to generate the clinit check. We will jump to the
+  // resolution stub if the class is not initialized and the executing thread is
+  // not the thread initializing it.
+  // We do this before constructing the frame to get the correct stack trace if
+  // an exception is thrown.
+  if (GetCompilerOptions().ShouldCompileWithClinitCheck(GetGraph()->GetArtMethod())) {
+    Riscv64Label resolution;
+    Riscv64Label memory_barrier;
+
+    ScratchRegisterScope srs(GetAssembler());
+    XRegister tmp = srs.AllocateXRegister();
+    XRegister tmp2 = srs.AllocateXRegister();
+
+    // We don't emit a read barrier here to save on code size. We rely on the
+    // resolution trampoline to do a clinit check before re-entering this code.
+    __ Loadwu(tmp2, kArtMethodRegister, ArtMethod::DeclaringClassOffset().Int32Value());
+
+    // We shall load the full 32-bit status word with sign-extension and compare as unsigned
+    // to sign-extended shifted status values. This yields the same comparison as loading and
+    // materializing unsigned but the constant is materialized with a single LUI instruction.
+    __ Loadw(tmp, tmp2, mirror::Class::StatusOffset().SizeValue());  // Sign-extended.
+
+    // Check if we're visibly initialized.
+    __ Li(tmp2, ShiftedSignExtendedClassStatusValue<ClassStatus::kVisiblyInitialized>());
+    __ Bgeu(tmp, tmp2, &frame_entry_label_);  // Can clobber `TMP` if taken.
+
+    // Check if we're initialized and jump to code that does a memory barrier if so.
+    __ Li(tmp2, ShiftedSignExtendedClassStatusValue<ClassStatus::kInitialized>());
+    __ Bgeu(tmp, tmp2, &memory_barrier);  // Can clobber `TMP` if taken.
+
+    // Check if we're initializing and the thread initializing is the one
+    // executing the code.
+    __ Li(tmp2, ShiftedSignExtendedClassStatusValue<ClassStatus::kInitializing>());
+    __ Bltu(tmp, tmp2, &resolution);  // Can clobber `TMP` if taken.
+
+    __ Loadwu(tmp2, kArtMethodRegister, ArtMethod::DeclaringClassOffset().Int32Value());
+    __ Loadw(tmp, tmp2, mirror::Class::ClinitThreadIdOffset().Int32Value());
+    __ Loadw(tmp2, TR, Thread::TidOffset<kRiscv64PointerSize>().Int32Value());
+    __ Beq(tmp, tmp2, &frame_entry_label_);
+    __ Bind(&resolution);
+
+    // Jump to the resolution stub.
+    ThreadOffset64 entrypoint_offset =
+        GetThreadOffset<kRiscv64PointerSize>(kQuickQuickResolutionTrampoline);
+    __ Loadd(tmp, TR, entrypoint_offset.Int32Value());
+    __ Jr(tmp);
+
+    __ Bind(&memory_barrier);
+    GenerateMemoryBarrier(MemBarrierKind::kAnyAny);
+  }
+  __ Bind(&frame_entry_label_);
+
+  bool do_overflow_check =
+      FrameNeedsStackCheck(GetFrameSize(), InstructionSet::kRiscv64) || !IsLeafMethod();
+
+  if (do_overflow_check) {
+    DCHECK(GetCompilerOptions().GetImplicitStackOverflowChecks());
+    __ Loadw(
+        Zero, SP, -static_cast<int32_t>(GetStackOverflowReservedBytes(InstructionSet::kRiscv64)));
+    RecordPcInfo(nullptr, 0);
+  }
+
+  if (!HasEmptyFrame()) {
+    // Make sure the frame size isn't unreasonably large.
+    DCHECK_LE(GetFrameSize(), GetMaximumFrameSize());
+
+    // Spill callee-saved registers.
+
+    uint32_t frame_size = GetFrameSize();
+
+    IncreaseFrame(frame_size);
+
+    uint32_t offset = frame_size;
+    for (size_t i = arraysize(kCoreCalleeSaves); i != 0; ) {
+      --i;
+      XRegister reg = kCoreCalleeSaves[i];
+      if (allocated_registers_.ContainsCoreRegister(reg)) {
+        offset -= kRiscv64DoublewordSize;
+        __ Stored(reg, SP, offset);
+        __ cfi().RelOffset(dwarf::Reg::Riscv64Core(reg), offset);
+      }
+    }
+
+    for (size_t i = arraysize(kFpuCalleeSaves); i != 0; ) {
+      --i;
+      FRegister reg = kFpuCalleeSaves[i];
+      if (allocated_registers_.ContainsFloatingPointRegister(reg)) {
+        offset -= kRiscv64DoublewordSize;
+        __ FStored(reg, SP, offset);
+        __ cfi().RelOffset(dwarf::Reg::Riscv64Fp(reg), offset);
+      }
+    }
+
+    // Save the current method if we need it. Note that we do not
+    // do this in HCurrentMethod, as the instruction might have been removed
+    // in the SSA graph.
+    if (RequiresCurrentMethod()) {
+      __ Stored(kArtMethodRegister, SP, 0);
+    }
+
+    if (GetGraph()->HasShouldDeoptimizeFlag()) {
+      // Initialize should_deoptimize flag to 0.
+      __ Storew(Zero, SP, GetStackOffsetOfShouldDeoptimizeFlag());
+    }
+  }
+  MaybeIncrementHotness(/* suspend_check= */ nullptr, /*is_frame_entry=*/ true);
+}
+
+void CodeGeneratorRISCV64::GenerateFrameExit() {
+  __ cfi().RememberState();
+
+  if (!HasEmptyFrame()) {
+    // Restore callee-saved registers.
+
+    // For better instruction scheduling restore RA before other registers.
+    uint32_t offset = GetFrameSize();
+    for (size_t i = arraysize(kCoreCalleeSaves); i != 0; ) {
+      --i;
+      XRegister reg = kCoreCalleeSaves[i];
+      if (allocated_registers_.ContainsCoreRegister(reg)) {
+        offset -= kRiscv64DoublewordSize;
+        __ Loadd(reg, SP, offset);
+        __ cfi().Restore(dwarf::Reg::Riscv64Core(reg));
+      }
+    }
+
+    for (size_t i = arraysize(kFpuCalleeSaves); i != 0; ) {
+      --i;
+      FRegister reg = kFpuCalleeSaves[i];
+      if (allocated_registers_.ContainsFloatingPointRegister(reg)) {
+        offset -= kRiscv64DoublewordSize;
+        __ FLoadd(reg, SP, offset);
+        __ cfi().Restore(dwarf::Reg::Riscv64Fp(reg));
+      }
+    }
+
+    DecreaseFrame(GetFrameSize());
+  }
+
+  __ Jr(RA);
+
+  __ cfi().RestoreState();
+  __ cfi().DefCFAOffset(GetFrameSize());
+}
+
+void CodeGeneratorRISCV64::Bind(HBasicBlock* block) { __ Bind(GetLabelOf(block)); }
+
+void CodeGeneratorRISCV64::MoveConstant(Location destination, int32_t value) {
+  DCHECK(destination.IsRegister());
+  __ LoadConst32(destination.AsRegister<XRegister>(), value);
+}
+
+void CodeGeneratorRISCV64::MoveLocation(Location destination,
+                                        Location source,
+                                        DataType::Type dst_type) {
+  if (source.Equals(destination)) {
+    return;
+  }
+
+  // A valid move type can always be inferred from the destination and source locations.
+  // When moving from and to a register, the `dst_type` can be used to generate 32-bit instead
+  // of 64-bit moves but it's generally OK to use 64-bit moves for 32-bit values in registers.
+  bool unspecified_type = (dst_type == DataType::Type::kVoid);
+  // TODO(riscv64): Is the destination type known in all cases?
+  // TODO(riscv64): Can unspecified `dst_type` move 32-bit GPR to FPR without NaN-boxing?
+  CHECK(!unspecified_type);
+
+  if (destination.IsRegister() || destination.IsFpuRegister()) {
+    if (unspecified_type) {
+      HConstant* src_cst = source.IsConstant() ? source.GetConstant() : nullptr;
+      if (source.IsStackSlot() ||
+          (src_cst != nullptr &&
+           (src_cst->IsIntConstant() || src_cst->IsFloatConstant() || src_cst->IsNullConstant()))) {
+        // For stack slots and 32-bit constants, a 32-bit type is appropriate.
+        dst_type = destination.IsRegister() ? DataType::Type::kInt32 : DataType::Type::kFloat32;
+      } else {
+        // If the source is a double stack slot or a 64-bit constant, a 64-bit type
+        // is appropriate. Else the source is a register, and since the type has not
+        // been specified, we chose a 64-bit type to force a 64-bit move.
+        dst_type = destination.IsRegister() ? DataType::Type::kInt64 : DataType::Type::kFloat64;
+      }
+    }
+    DCHECK((destination.IsFpuRegister() && DataType::IsFloatingPointType(dst_type)) ||
+           (destination.IsRegister() && !DataType::IsFloatingPointType(dst_type)));
+
+    if (source.IsStackSlot() || source.IsDoubleStackSlot()) {
+      // Move to GPR/FPR from stack
+      if (DataType::IsFloatingPointType(dst_type)) {
+        if (DataType::Is64BitType(dst_type)) {
+          __ FLoadd(destination.AsFpuRegister<FRegister>(), SP, source.GetStackIndex());
+        } else {
+          __ FLoadw(destination.AsFpuRegister<FRegister>(), SP, source.GetStackIndex());
+        }
+      } else {
+        if (DataType::Is64BitType(dst_type)) {
+          __ Loadd(destination.AsRegister<XRegister>(), SP, source.GetStackIndex());
+        } else if (dst_type == DataType::Type::kReference) {
+          __ Loadwu(destination.AsRegister<XRegister>(), SP, source.GetStackIndex());
+        } else {
+          __ Loadw(destination.AsRegister<XRegister>(), SP, source.GetStackIndex());
+        }
+      }
+    } else if (source.IsConstant()) {
+      // Move to GPR/FPR from constant
+      // TODO(riscv64): Consider using literals for difficult-to-materialize 64-bit constants.
+      int64_t value = GetInt64ValueOf(source.GetConstant()->AsConstant());
+      ScratchRegisterScope srs(GetAssembler());
+      XRegister gpr = DataType::IsFloatingPointType(dst_type)
+          ? srs.AllocateXRegister()
+          : destination.AsRegister<XRegister>();
+      if (DataType::IsFloatingPointType(dst_type) && value == 0) {
+        gpr = Zero;  // Note: The scratch register allocated above shall not be used.
+      } else {
+        // Note: For `float` we load the sign-extended value here as it can sometimes yield
+        // a shorter instruction sequence. The higher 32 bits shall be ignored during the
+        // transfer to FP reg and the result shall be correctly NaN-boxed.
+        __ LoadConst64(gpr, value);
+      }
+      if (dst_type == DataType::Type::kFloat32) {
+        __ FMvWX(destination.AsFpuRegister<FRegister>(), gpr);
+      } else if (dst_type == DataType::Type::kFloat64) {
+        __ FMvDX(destination.AsFpuRegister<FRegister>(), gpr);
+      }
+    } else if (source.IsRegister()) {
+      if (destination.IsRegister()) {
+        // Move to GPR from GPR
+        __ Mv(destination.AsRegister<XRegister>(), source.AsRegister<XRegister>());
+      } else {
+        DCHECK(destination.IsFpuRegister());
+        if (DataType::Is64BitType(dst_type)) {
+          __ FMvDX(destination.AsFpuRegister<FRegister>(), source.AsRegister<XRegister>());
+        } else {
+          __ FMvWX(destination.AsFpuRegister<FRegister>(), source.AsRegister<XRegister>());
+        }
+      }
+    } else if (source.IsFpuRegister()) {
+      if (destination.IsFpuRegister()) {
+        if (GetGraph()->HasSIMD()) {
+          LOG(FATAL) << "Vector extension is unsupported";
+          UNREACHABLE();
+        } else {
+          // Move to FPR from FPR
+          if (dst_type == DataType::Type::kFloat32) {
+            __ FMvS(destination.AsFpuRegister<FRegister>(), source.AsFpuRegister<FRegister>());
+          } else {
+            DCHECK_EQ(dst_type, DataType::Type::kFloat64);
+            __ FMvD(destination.AsFpuRegister<FRegister>(), source.AsFpuRegister<FRegister>());
+          }
+        }
+      } else {
+        DCHECK(destination.IsRegister());
+        if (DataType::Is64BitType(dst_type)) {
+          __ FMvXD(destination.AsRegister<XRegister>(), source.AsFpuRegister<FRegister>());
+        } else {
+          __ FMvXW(destination.AsRegister<XRegister>(), source.AsFpuRegister<FRegister>());
+        }
+      }
+    }
+  } else if (destination.IsSIMDStackSlot()) {
+    LOG(FATAL) << "SIMD is unsupported";
+    UNREACHABLE();
+  } else {  // The destination is not a register. It must be a stack slot.
+    DCHECK(destination.IsStackSlot() || destination.IsDoubleStackSlot());
+    if (source.IsRegister() || source.IsFpuRegister()) {
+      if (unspecified_type) {
+        if (source.IsRegister()) {
+          dst_type = destination.IsStackSlot() ? DataType::Type::kInt32 : DataType::Type::kInt64;
+        } else {
+          dst_type =
+              destination.IsStackSlot() ? DataType::Type::kFloat32 : DataType::Type::kFloat64;
+        }
+      }
+      DCHECK_EQ(source.IsFpuRegister(), DataType::IsFloatingPointType(dst_type));
+      // For direct @CriticalNative calls, we need to sign-extend narrow integral args
+      // to 64 bits, so widening integral values is allowed. Narrowing is forbidden.
+      DCHECK_IMPLIES(DataType::IsFloatingPointType(dst_type) || destination.IsStackSlot(),
+                     destination.IsDoubleStackSlot() == DataType::Is64BitType(dst_type));
+      // Move to stack from GPR/FPR
+      if (destination.IsDoubleStackSlot()) {
+        if (source.IsRegister()) {
+          __ Stored(source.AsRegister<XRegister>(), SP, destination.GetStackIndex());
+        } else {
+          __ FStored(source.AsFpuRegister<FRegister>(), SP, destination.GetStackIndex());
+        }
+      } else {
+        if (source.IsRegister()) {
+          __ Storew(source.AsRegister<XRegister>(), SP, destination.GetStackIndex());
+        } else {
+          __ FStorew(source.AsFpuRegister<FRegister>(), SP, destination.GetStackIndex());
+        }
+      }
+    } else if (source.IsConstant()) {
+      // Move to stack from constant
+      int64_t value = GetInt64ValueOf(source.GetConstant());
+      ScratchRegisterScope srs(GetAssembler());
+      XRegister gpr = (value != 0) ? srs.AllocateXRegister() : Zero;
+      if (value != 0) {
+        __ LoadConst64(gpr, value);
+      }
+      if (destination.IsStackSlot()) {
+        __ Storew(gpr, SP, destination.GetStackIndex());
+      } else {
+        DCHECK(destination.IsDoubleStackSlot());
+        __ Stored(gpr, SP, destination.GetStackIndex());
+      }
+    } else {
+      DCHECK(source.IsStackSlot() || source.IsDoubleStackSlot());
+      // For direct @CriticalNative calls, we need to sign-extend narrow integral args
+      // to 64 bits, so widening move is allowed. Narrowing move is forbidden.
+      DCHECK_IMPLIES(destination.IsStackSlot(), source.IsStackSlot());
+      // Move to stack from stack
+      ScratchRegisterScope srs(GetAssembler());
+      XRegister tmp = srs.AllocateXRegister();
+      if (source.IsStackSlot()) {
+        __ Loadw(tmp, SP, source.GetStackIndex());
+      } else {
+        __ Loadd(tmp, SP, source.GetStackIndex());
+      }
+      if (destination.IsStackSlot()) {
+        __ Storew(tmp, SP, destination.GetStackIndex());
+      } else {
+        __ Stored(tmp, SP, destination.GetStackIndex());
+      }
+    }
+  }
+}
+
+void CodeGeneratorRISCV64::AddLocationAsTemp(Location location, LocationSummary* locations) {
+  if (location.IsRegister()) {
+    locations->AddTemp(location);
+  } else {
+    UNIMPLEMENTED(FATAL) << "AddLocationAsTemp not implemented for location " << location;
+  }
+}
+
+void CodeGeneratorRISCV64::SetupBlockedRegisters() const {
+  // ZERO, GP, SP, RA, TP and TR(S1) are reserved and can't be allocated.
+  blocked_core_registers_[Zero] = true;
+  blocked_core_registers_[GP] = true;
+  blocked_core_registers_[SP] = true;
+  blocked_core_registers_[RA] = true;
+  blocked_core_registers_[TP] = true;
+  blocked_core_registers_[TR] = true;  // ART Thread register.
+
+  // TMP(T6), TMP2(T5) and FTMP(FT11) are used as temporary/scratch registers.
+  blocked_core_registers_[TMP] = true;
+  blocked_core_registers_[TMP2] = true;
+  blocked_fpu_registers_[FTMP] = true;
+
+  if (GetGraph()->IsDebuggable()) {
+    // Stubs do not save callee-save floating point registers. If the graph
+    // is debuggable, we need to deal with these registers differently. For
+    // now, just block them.
+    for (size_t i = 0; i < arraysize(kFpuCalleeSaves); ++i) {
+      blocked_fpu_registers_[kFpuCalleeSaves[i]] = true;
+    }
+  }
+}
+
+size_t CodeGeneratorRISCV64::SaveCoreRegister(size_t stack_index, uint32_t reg_id) {
+  __ Stored(XRegister(reg_id), SP, stack_index);
+  return kRiscv64DoublewordSize;
+}
+
+size_t CodeGeneratorRISCV64::RestoreCoreRegister(size_t stack_index, uint32_t reg_id) {
+  __ Loadd(XRegister(reg_id), SP, stack_index);
+  return kRiscv64DoublewordSize;
+}
+
+size_t CodeGeneratorRISCV64::SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) {
+  if (GetGraph()->HasSIMD()) {
+    // TODO(riscv64): RISC-V vector extension.
+    UNIMPLEMENTED(FATAL) << "Vector extension is unsupported";
+    UNREACHABLE();
+  }
+  __ FStored(FRegister(reg_id), SP, stack_index);
+  return kRiscv64FloatRegSizeInBytes;
+}
+
+size_t CodeGeneratorRISCV64::RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) {
+  if (GetGraph()->HasSIMD()) {
+    // TODO(riscv64): RISC-V vector extension.
+    UNIMPLEMENTED(FATAL) << "Vector extension is unsupported";
+    UNREACHABLE();
+  }
+  __ FLoadd(FRegister(reg_id), SP, stack_index);
+  return kRiscv64FloatRegSizeInBytes;
+}
+
+void CodeGeneratorRISCV64::DumpCoreRegister(std::ostream& stream, int reg) const {
+  stream << XRegister(reg);
+}
+
+void CodeGeneratorRISCV64::DumpFloatingPointRegister(std::ostream& stream, int reg) const {
+  stream << FRegister(reg);
+}
+
+const Riscv64InstructionSetFeatures& CodeGeneratorRISCV64::GetInstructionSetFeatures() const {
+  return *GetCompilerOptions().GetInstructionSetFeatures()->AsRiscv64InstructionSetFeatures();
+}
+
+void CodeGeneratorRISCV64::Finalize() {
+  // Ensure that we fix up branches and literal loads and emit the literal pool.
+  __ FinalizeCode();
+
+  // Adjust native pc offsets in stack maps.
+  StackMapStream* stack_map_stream = GetStackMapStream();
+  for (size_t i = 0, num = stack_map_stream->GetNumberOfStackMaps(); i != num; ++i) {
+    uint32_t old_position = stack_map_stream->GetStackMapNativePcOffset(i);
+    uint32_t new_position = __ GetAdjustedPosition(old_position);
+    DCHECK_GE(new_position, old_position);
+    stack_map_stream->SetStackMapNativePcOffset(i, new_position);
+  }
+
+  // Adjust pc offsets for the disassembly information.
+  if (disasm_info_ != nullptr) {
+    GeneratedCodeInterval* frame_entry_interval = disasm_info_->GetFrameEntryInterval();
+    frame_entry_interval->start = __ GetAdjustedPosition(frame_entry_interval->start);
+    frame_entry_interval->end = __ GetAdjustedPosition(frame_entry_interval->end);
+    for (auto& entry : *disasm_info_->GetInstructionIntervals()) {
+      entry.second.start = __ GetAdjustedPosition(entry.second.start);
+      entry.second.end = __ GetAdjustedPosition(entry.second.end);
+    }
+    for (auto& entry : *disasm_info_->GetSlowPathIntervals()) {
+      entry.code_interval.start = __ GetAdjustedPosition(entry.code_interval.start);
+      entry.code_interval.end = __ GetAdjustedPosition(entry.code_interval.end);
+    }
+  }
+}
+
+// Generate code to invoke a runtime entry point.
+void CodeGeneratorRISCV64::InvokeRuntime(QuickEntrypointEnum entrypoint,
+                                         HInstruction* instruction,
+                                         uint32_t dex_pc,
+                                         SlowPathCode* slow_path) {
+  ValidateInvokeRuntime(entrypoint, instruction, slow_path);
+
+  ThreadOffset64 entrypoint_offset = GetThreadOffset<kRiscv64PointerSize>(entrypoint);
+
+  // TODO(riscv64): Reduce code size for AOT by using shared trampolines for slow path
+  // runtime calls across the entire oat file.
+  __ Loadd(RA, TR, entrypoint_offset.Int32Value());
+  __ Jalr(RA);
+  if (EntrypointRequiresStackMap(entrypoint)) {
+    RecordPcInfo(instruction, dex_pc, slow_path);
+  }
+}
+
+// Generate code to invoke a runtime entry point, but do not record
+// PC-related information in a stack map.
+void CodeGeneratorRISCV64::InvokeRuntimeWithoutRecordingPcInfo(int32_t entry_point_offset,
+                                                               HInstruction* instruction,
+                                                               SlowPathCode* slow_path) {
+  ValidateInvokeRuntimeWithoutRecordingPcInfo(instruction, slow_path);
+  __ Loadd(RA, TR, entry_point_offset);
+  __ Jalr(RA);
+}
+
+void CodeGeneratorRISCV64::IncreaseFrame(size_t adjustment) {
+  int32_t adjustment32 = dchecked_integral_cast<int32_t>(adjustment);
+  __ AddConst64(SP, SP, -adjustment32);
+  GetAssembler()->cfi().AdjustCFAOffset(adjustment32);
+}
+
+void CodeGeneratorRISCV64::DecreaseFrame(size_t adjustment) {
+  int32_t adjustment32 = dchecked_integral_cast<int32_t>(adjustment);
+  __ AddConst64(SP, SP, adjustment32);
+  GetAssembler()->cfi().AdjustCFAOffset(-adjustment32);
+}
+
+void CodeGeneratorRISCV64::GenerateNop() {
+  __ Nop();
+}
+
+void CodeGeneratorRISCV64::GenerateImplicitNullCheck(HNullCheck* instruction) {
+  if (CanMoveNullCheckToUser(instruction)) {
+    return;
+  }
+  Location obj = instruction->GetLocations()->InAt(0);
+
+  __ Lw(Zero, obj.AsRegister<XRegister>(), 0);
+  RecordPcInfo(instruction, instruction->GetDexPc());
+}
+
+void CodeGeneratorRISCV64::GenerateExplicitNullCheck(HNullCheck* instruction) {
+  SlowPathCodeRISCV64* slow_path = new (GetScopedAllocator()) NullCheckSlowPathRISCV64(instruction);
+  AddSlowPath(slow_path);
+
+  Location obj = instruction->GetLocations()->InAt(0);
+
+  __ Beqz(obj.AsRegister<XRegister>(), slow_path->GetEntryLabel());
+}
+
+HLoadString::LoadKind CodeGeneratorRISCV64::GetSupportedLoadStringKind(
+    HLoadString::LoadKind desired_string_load_kind) {
+  switch (desired_string_load_kind) {
+    case HLoadString::LoadKind::kBootImageLinkTimePcRelative:
+    case HLoadString::LoadKind::kBootImageRelRo:
+    case HLoadString::LoadKind::kBssEntry:
+      DCHECK(!Runtime::Current()->UseJitCompilation());
+      break;
+    case HLoadString::LoadKind::kJitBootImageAddress:
+    case HLoadString::LoadKind::kJitTableAddress:
+      DCHECK(Runtime::Current()->UseJitCompilation());
+      break;
+    case HLoadString::LoadKind::kRuntimeCall:
+      break;
+  }
+  return desired_string_load_kind;
+}
+
+HLoadClass::LoadKind CodeGeneratorRISCV64::GetSupportedLoadClassKind(
+    HLoadClass::LoadKind desired_class_load_kind) {
+  switch (desired_class_load_kind) {
+    case HLoadClass::LoadKind::kInvalid:
+      LOG(FATAL) << "UNREACHABLE";
+      UNREACHABLE();
+    case HLoadClass::LoadKind::kReferrersClass:
+      break;
+    case HLoadClass::LoadKind::kBootImageLinkTimePcRelative:
+    case HLoadClass::LoadKind::kBootImageRelRo:
+    case HLoadClass::LoadKind::kBssEntry:
+    case HLoadClass::LoadKind::kBssEntryPublic:
+    case HLoadClass::LoadKind::kBssEntryPackage:
+      DCHECK(!Runtime::Current()->UseJitCompilation());
+      break;
+    case HLoadClass::LoadKind::kJitBootImageAddress:
+    case HLoadClass::LoadKind::kJitTableAddress:
+      DCHECK(Runtime::Current()->UseJitCompilation());
+      break;
+    case HLoadClass::LoadKind::kRuntimeCall:
+      break;
+  }
+  return desired_class_load_kind;
+}
+
+HInvokeStaticOrDirect::DispatchInfo CodeGeneratorRISCV64::GetSupportedInvokeStaticOrDirectDispatch(
+    const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info, ArtMethod* method) {
+  UNUSED(method);
+  // On RISCV64 we support all dispatch types.
+  return desired_dispatch_info;
+}
+
+CodeGeneratorRISCV64::PcRelativePatchInfo* CodeGeneratorRISCV64::NewBootImageIntrinsicPatch(
+    uint32_t intrinsic_data, const PcRelativePatchInfo* info_high) {
+  return NewPcRelativePatch(
+      /* dex_file= */ nullptr, intrinsic_data, info_high, &boot_image_other_patches_);
+}
+
+CodeGeneratorRISCV64::PcRelativePatchInfo* CodeGeneratorRISCV64::NewBootImageRelRoPatch(
+    uint32_t boot_image_offset, const PcRelativePatchInfo* info_high) {
+  return NewPcRelativePatch(
+      /* dex_file= */ nullptr, boot_image_offset, info_high, &boot_image_other_patches_);
+}
+
+CodeGeneratorRISCV64::PcRelativePatchInfo* CodeGeneratorRISCV64::NewBootImageMethodPatch(
+    MethodReference target_method, const PcRelativePatchInfo* info_high) {
+  return NewPcRelativePatch(
+      target_method.dex_file, target_method.index, info_high, &boot_image_method_patches_);
+}
+
+CodeGeneratorRISCV64::PcRelativePatchInfo* CodeGeneratorRISCV64::NewMethodBssEntryPatch(
+    MethodReference target_method, const PcRelativePatchInfo* info_high) {
+  return NewPcRelativePatch(
+      target_method.dex_file, target_method.index, info_high, &method_bss_entry_patches_);
+}
+
+CodeGeneratorRISCV64::PcRelativePatchInfo* CodeGeneratorRISCV64::NewBootImageTypePatch(
+    const DexFile& dex_file, dex::TypeIndex type_index, const PcRelativePatchInfo* info_high) {
+  return NewPcRelativePatch(&dex_file, type_index.index_, info_high, &boot_image_type_patches_);
+}
+
+CodeGeneratorRISCV64::PcRelativePatchInfo* CodeGeneratorRISCV64::NewBootImageJniEntrypointPatch(
+    MethodReference target_method, const PcRelativePatchInfo* info_high) {
+  return NewPcRelativePatch(
+      target_method.dex_file, target_method.index, info_high, &boot_image_jni_entrypoint_patches_);
+}
+
+CodeGeneratorRISCV64::PcRelativePatchInfo* CodeGeneratorRISCV64::NewTypeBssEntryPatch(
+    HLoadClass* load_class,
+    const PcRelativePatchInfo* info_high) {
+  const DexFile& dex_file = load_class->GetDexFile();
+  dex::TypeIndex type_index = load_class->GetTypeIndex();
+  ArenaDeque<PcRelativePatchInfo>* patches = nullptr;
+  switch (load_class->GetLoadKind()) {
+    case HLoadClass::LoadKind::kBssEntry:
+      patches = &type_bss_entry_patches_;
+      break;
+    case HLoadClass::LoadKind::kBssEntryPublic:
+      patches = &public_type_bss_entry_patches_;
+      break;
+    case HLoadClass::LoadKind::kBssEntryPackage:
+      patches = &package_type_bss_entry_patches_;
+      break;
+    default:
+      LOG(FATAL) << "Unexpected load kind: " << load_class->GetLoadKind();
+      UNREACHABLE();
+  }
+  return NewPcRelativePatch(&dex_file, type_index.index_, info_high, patches);
+}
+
+CodeGeneratorRISCV64::PcRelativePatchInfo* CodeGeneratorRISCV64::NewBootImageStringPatch(
+    const DexFile& dex_file, dex::StringIndex string_index, const PcRelativePatchInfo* info_high) {
+  return NewPcRelativePatch(&dex_file, string_index.index_, info_high, &boot_image_string_patches_);
+}
+
+CodeGeneratorRISCV64::PcRelativePatchInfo* CodeGeneratorRISCV64::NewStringBssEntryPatch(
+    const DexFile& dex_file, dex::StringIndex string_index, const PcRelativePatchInfo* info_high) {
+  return NewPcRelativePatch(&dex_file, string_index.index_, info_high, &string_bss_entry_patches_);
+}
+
+CodeGeneratorRISCV64::PcRelativePatchInfo* CodeGeneratorRISCV64::NewPcRelativePatch(
+    const DexFile* dex_file,
+    uint32_t offset_or_index,
+    const PcRelativePatchInfo* info_high,
+    ArenaDeque<PcRelativePatchInfo>* patches) {
+  patches->emplace_back(dex_file, offset_or_index, info_high);
+  return &patches->back();
+}
+
+Literal* CodeGeneratorRISCV64::DeduplicateUint32Literal(uint32_t value) {
+  return uint32_literals_.GetOrCreate(value,
+                                      [this, value]() { return __ NewLiteral<uint32_t>(value); });
+}
+
+Literal* CodeGeneratorRISCV64::DeduplicateUint64Literal(uint64_t value) {
+  return uint64_literals_.GetOrCreate(value,
+                                      [this, value]() { return __ NewLiteral<uint64_t>(value); });
+}
+
+Literal* CodeGeneratorRISCV64::DeduplicateBootImageAddressLiteral(uint64_t address) {
+  return DeduplicateUint32Literal(dchecked_integral_cast<uint32_t>(address));
+}
+
+Literal* CodeGeneratorRISCV64::DeduplicateJitStringLiteral(const DexFile& dex_file,
+                                                           dex::StringIndex string_index,
+                                                           Handle<mirror::String> handle) {
+  ReserveJitStringRoot(StringReference(&dex_file, string_index), handle);
+  return jit_string_patches_.GetOrCreate(
+      StringReference(&dex_file, string_index),
+      [this]() { return __ NewLiteral<uint32_t>(/* value= */ 0u); });
+}
+
+Literal* CodeGeneratorRISCV64::DeduplicateJitClassLiteral(const DexFile& dex_file,
+                                                          dex::TypeIndex type_index,
+                                                          Handle<mirror::Class> handle) {
+  ReserveJitClassRoot(TypeReference(&dex_file, type_index), handle);
+  return jit_class_patches_.GetOrCreate(
+      TypeReference(&dex_file, type_index),
+      [this]() { return __ NewLiteral<uint32_t>(/* value= */ 0u); });
+}
+
+void CodeGeneratorRISCV64::PatchJitRootUse(uint8_t* code,
+                                          const uint8_t* roots_data,
+                                          const Literal* literal,
+                                          uint64_t index_in_table) const {
+  uint32_t literal_offset = GetAssembler().GetLabelLocation(literal->GetLabel());
+  uintptr_t address =
+      reinterpret_cast<uintptr_t>(roots_data) + index_in_table * sizeof(GcRoot<mirror::Object>);
+  reinterpret_cast<uint32_t*>(code + literal_offset)[0] = dchecked_integral_cast<uint32_t>(address);
+}
+
+void CodeGeneratorRISCV64::EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) {
+  for (const auto& entry : jit_string_patches_) {
+    const StringReference& string_reference = entry.first;
+    Literal* table_entry_literal = entry.second;
+    uint64_t index_in_table = GetJitStringRootIndex(string_reference);
+    PatchJitRootUse(code, roots_data, table_entry_literal, index_in_table);
+  }
+  for (const auto& entry : jit_class_patches_) {
+    const TypeReference& type_reference = entry.first;
+    Literal* table_entry_literal = entry.second;
+    uint64_t index_in_table = GetJitClassRootIndex(type_reference);
+    PatchJitRootUse(code, roots_data, table_entry_literal, index_in_table);
+  }
+}
+
+void CodeGeneratorRISCV64::EmitPcRelativeAuipcPlaceholder(PcRelativePatchInfo* info_high,
+                                                          XRegister out) {
+  DCHECK(info_high->pc_insn_label == &info_high->label);
+  __ Bind(&info_high->label);
+  __ Auipc(out, /*imm20=*/ kLinkTimeOffsetPlaceholderHigh);
+}
+
+void CodeGeneratorRISCV64::EmitPcRelativeAddiPlaceholder(PcRelativePatchInfo* info_low,
+                                                         XRegister rd,
+                                                         XRegister rs1) {
+  DCHECK(info_low->pc_insn_label != &info_low->label);
+  __ Bind(&info_low->label);
+  __ Addi(rd, rs1, /*imm12=*/ kLinkTimeOffsetPlaceholderLow);
+}
+
+void CodeGeneratorRISCV64::EmitPcRelativeLwuPlaceholder(PcRelativePatchInfo* info_low,
+                                                        XRegister rd,
+                                                        XRegister rs1) {
+  DCHECK(info_low->pc_insn_label != &info_low->label);
+  __ Bind(&info_low->label);
+  __ Lwu(rd, rs1, /*offset=*/ kLinkTimeOffsetPlaceholderLow);
+}
+
+void CodeGeneratorRISCV64::EmitPcRelativeLdPlaceholder(PcRelativePatchInfo* info_low,
+                                                       XRegister rd,
+                                                       XRegister rs1) {
+  DCHECK(info_low->pc_insn_label != &info_low->label);
+  __ Bind(&info_low->label);
+  __ Ld(rd, rs1, /*offset=*/ kLinkTimeOffsetPlaceholderLow);
+}
+
+template <linker::LinkerPatch (*Factory)(size_t, const DexFile*, uint32_t, uint32_t)>
+inline void CodeGeneratorRISCV64::EmitPcRelativeLinkerPatches(
+    const ArenaDeque<PcRelativePatchInfo>& infos,
+    ArenaVector<linker::LinkerPatch>* linker_patches) {
+  for (const PcRelativePatchInfo& info : infos) {
+    linker_patches->push_back(Factory(__ GetLabelLocation(&info.label),
+                                      info.target_dex_file,
+                                      __ GetLabelLocation(info.pc_insn_label),
+                                      info.offset_or_index));
+  }
+}
+
+template <linker::LinkerPatch (*Factory)(size_t, uint32_t, uint32_t)>
+linker::LinkerPatch NoDexFileAdapter(size_t literal_offset,
+                                     const DexFile* target_dex_file,
+                                     uint32_t pc_insn_offset,
+                                     uint32_t boot_image_offset) {
+  DCHECK(target_dex_file == nullptr);  // Unused for these patches, should be null.
+  return Factory(literal_offset, pc_insn_offset, boot_image_offset);
+}
+
+void CodeGeneratorRISCV64::EmitLinkerPatches(ArenaVector<linker::LinkerPatch>* linker_patches) {
+  DCHECK(linker_patches->empty());
+  size_t size =
+      boot_image_method_patches_.size() +
+      method_bss_entry_patches_.size() +
+      boot_image_type_patches_.size() +
+      type_bss_entry_patches_.size() +
+      public_type_bss_entry_patches_.size() +
+      package_type_bss_entry_patches_.size() +
+      boot_image_string_patches_.size() +
+      string_bss_entry_patches_.size() +
+      boot_image_jni_entrypoint_patches_.size() +
+      boot_image_other_patches_.size();
+  linker_patches->reserve(size);
+  if (GetCompilerOptions().IsBootImage() || GetCompilerOptions().IsBootImageExtension()) {
+    EmitPcRelativeLinkerPatches<linker::LinkerPatch::RelativeMethodPatch>(
+        boot_image_method_patches_, linker_patches);
+    EmitPcRelativeLinkerPatches<linker::LinkerPatch::RelativeTypePatch>(
+        boot_image_type_patches_, linker_patches);
+    EmitPcRelativeLinkerPatches<linker::LinkerPatch::RelativeStringPatch>(
+        boot_image_string_patches_, linker_patches);
+  } else {
+    DCHECK(boot_image_method_patches_.empty());
+    DCHECK(boot_image_type_patches_.empty());
+    DCHECK(boot_image_string_patches_.empty());
+  }
+  if (GetCompilerOptions().IsBootImage()) {
+    EmitPcRelativeLinkerPatches<NoDexFileAdapter<linker::LinkerPatch::IntrinsicReferencePatch>>(
+        boot_image_other_patches_, linker_patches);
+  } else {
+    EmitPcRelativeLinkerPatches<NoDexFileAdapter<linker::LinkerPatch::DataBimgRelRoPatch>>(
+        boot_image_other_patches_, linker_patches);
+  }
+  EmitPcRelativeLinkerPatches<linker::LinkerPatch::MethodBssEntryPatch>(
+      method_bss_entry_patches_, linker_patches);
+  EmitPcRelativeLinkerPatches<linker::LinkerPatch::TypeBssEntryPatch>(
+      type_bss_entry_patches_, linker_patches);
+  EmitPcRelativeLinkerPatches<linker::LinkerPatch::PublicTypeBssEntryPatch>(
+      public_type_bss_entry_patches_, linker_patches);
+  EmitPcRelativeLinkerPatches<linker::LinkerPatch::PackageTypeBssEntryPatch>(
+      package_type_bss_entry_patches_, linker_patches);
+  EmitPcRelativeLinkerPatches<linker::LinkerPatch::StringBssEntryPatch>(
+      string_bss_entry_patches_, linker_patches);
+  EmitPcRelativeLinkerPatches<linker::LinkerPatch::RelativeJniEntrypointPatch>(
+      boot_image_jni_entrypoint_patches_, linker_patches);
+  DCHECK_EQ(size, linker_patches->size());
+}
+
+void CodeGeneratorRISCV64::LoadTypeForBootImageIntrinsic(XRegister dest,
+                                                         TypeReference target_type) {
+  // Load the type the same way as for HLoadClass::LoadKind::kBootImageLinkTimePcRelative.
+  DCHECK(GetCompilerOptions().IsBootImage() || GetCompilerOptions().IsBootImageExtension());
+  PcRelativePatchInfo* info_high =
+      NewBootImageTypePatch(*target_type.dex_file, target_type.TypeIndex());
+  EmitPcRelativeAuipcPlaceholder(info_high, dest);
+  PcRelativePatchInfo* info_low =
+      NewBootImageTypePatch(*target_type.dex_file, target_type.TypeIndex(), info_high);
+  EmitPcRelativeAddiPlaceholder(info_low, dest, dest);
+}
+
+void CodeGeneratorRISCV64::LoadBootImageRelRoEntry(XRegister dest, uint32_t boot_image_offset) {
+  PcRelativePatchInfo* info_high = NewBootImageRelRoPatch(boot_image_offset);
+  EmitPcRelativeAuipcPlaceholder(info_high, dest);
+  PcRelativePatchInfo* info_low = NewBootImageRelRoPatch(boot_image_offset, info_high);
+  // Note: Boot image is in the low 4GiB and the entry is always 32-bit, so emit a 32-bit load.
+  EmitPcRelativeLwuPlaceholder(info_low, dest, dest);
+}
+
+void CodeGeneratorRISCV64::LoadBootImageAddress(XRegister dest, uint32_t boot_image_reference) {
+  if (GetCompilerOptions().IsBootImage()) {
+    PcRelativePatchInfo* info_high = NewBootImageIntrinsicPatch(boot_image_reference);
+    EmitPcRelativeAuipcPlaceholder(info_high, dest);
+    PcRelativePatchInfo* info_low = NewBootImageIntrinsicPatch(boot_image_reference, info_high);
+    EmitPcRelativeAddiPlaceholder(info_low, dest, dest);
+  } else if (GetCompilerOptions().GetCompilePic()) {
+    LoadBootImageRelRoEntry(dest, boot_image_reference);
+  } else {
+    DCHECK(GetCompilerOptions().IsJitCompiler());
+    gc::Heap* heap = Runtime::Current()->GetHeap();
+    DCHECK(!heap->GetBootImageSpaces().empty());
+    const uint8_t* address = heap->GetBootImageSpaces()[0]->Begin() + boot_image_reference;
+    // Note: Boot image is in the low 4GiB (usually the low 2GiB, requiring just LUI+ADDI).
+    // We may not have an available scratch register for `LoadConst64()` but it never
+    // emits better code than `Li()` for 32-bit unsigned constants anyway.
+    __ Li(dest, reinterpret_cast32<uint32_t>(address));
+  }
+}
+
+void CodeGeneratorRISCV64::LoadIntrinsicDeclaringClass(XRegister dest, HInvoke* invoke) {
+  DCHECK_NE(invoke->GetIntrinsic(), Intrinsics::kNone);
+  if (GetCompilerOptions().IsBootImage()) {
+    MethodReference target_method = invoke->GetResolvedMethodReference();
+    dex::TypeIndex type_idx = target_method.dex_file->GetMethodId(target_method.index).class_idx_;
+    LoadTypeForBootImageIntrinsic(dest, TypeReference(target_method.dex_file, type_idx));
+  } else {
+    uint32_t boot_image_offset = GetBootImageOffsetOfIntrinsicDeclaringClass(invoke);
+    LoadBootImageAddress(dest, boot_image_offset);
+  }
+}
+
+void CodeGeneratorRISCV64::LoadClassRootForIntrinsic(XRegister dest, ClassRoot class_root) {
+  if (GetCompilerOptions().IsBootImage()) {
+    ScopedObjectAccess soa(Thread::Current());
+    ObjPtr<mirror::Class> klass = GetClassRoot(class_root);
+    TypeReference target_type(&klass->GetDexFile(), klass->GetDexTypeIndex());
+    LoadTypeForBootImageIntrinsic(dest, target_type);
+  } else {
+    uint32_t boot_image_offset = GetBootImageOffset(class_root);
+    LoadBootImageAddress(dest, boot_image_offset);
+  }
+}
+
+void CodeGeneratorRISCV64::LoadMethod(MethodLoadKind load_kind, Location temp, HInvoke* invoke) {
+  switch (load_kind) {
+    case MethodLoadKind::kBootImageLinkTimePcRelative: {
+      DCHECK(GetCompilerOptions().IsBootImage() || GetCompilerOptions().IsBootImageExtension());
+      CodeGeneratorRISCV64::PcRelativePatchInfo* info_high =
+          NewBootImageMethodPatch(invoke->GetResolvedMethodReference());
+      EmitPcRelativeAuipcPlaceholder(info_high, temp.AsRegister<XRegister>());
+      CodeGeneratorRISCV64::PcRelativePatchInfo* info_low =
+          NewBootImageMethodPatch(invoke->GetResolvedMethodReference(), info_high);
+      EmitPcRelativeAddiPlaceholder(
+          info_low, temp.AsRegister<XRegister>(), temp.AsRegister<XRegister>());
+      break;
+    }
+    case MethodLoadKind::kBootImageRelRo: {
+      uint32_t boot_image_offset = GetBootImageOffset(invoke);
+      LoadBootImageRelRoEntry(temp.AsRegister<XRegister>(), boot_image_offset);
+      break;
+    }
+    case MethodLoadKind::kBssEntry: {
+      PcRelativePatchInfo* info_high = NewMethodBssEntryPatch(invoke->GetMethodReference());
+      EmitPcRelativeAuipcPlaceholder(info_high, temp.AsRegister<XRegister>());
+      PcRelativePatchInfo* info_low =
+          NewMethodBssEntryPatch(invoke->GetMethodReference(), info_high);
+      EmitPcRelativeLdPlaceholder(
+          info_low, temp.AsRegister<XRegister>(), temp.AsRegister<XRegister>());
+      break;
+    }
+    case MethodLoadKind::kJitDirectAddress: {
+      __ LoadConst64(temp.AsRegister<XRegister>(),
+                     reinterpret_cast<uint64_t>(invoke->GetResolvedMethod()));
+      break;
+    }
+    case MethodLoadKind::kRuntimeCall: {
+      // Test situation, don't do anything.
+      break;
+    }
+    default: {
+      LOG(FATAL) << "Load kind should have already been handled " << load_kind;
+      UNREACHABLE();
+    }
+  }
+}
+
+void CodeGeneratorRISCV64::GenerateStaticOrDirectCall(HInvokeStaticOrDirect* invoke,
+                                                      Location temp,
+                                                      SlowPathCode* slow_path) {
+  // All registers are assumed to be correctly set up per the calling convention.
+  Location callee_method = temp;  // For all kinds except kRecursive, callee will be in temp.
+
+  switch (invoke->GetMethodLoadKind()) {
+    case MethodLoadKind::kStringInit: {
+      // temp = thread->string_init_entrypoint
+      uint32_t offset =
+          GetThreadOffset<kRiscv64PointerSize>(invoke->GetStringInitEntryPoint()).Int32Value();
+      __ Loadd(temp.AsRegister<XRegister>(), TR, offset);
+      break;
+    }
+    case MethodLoadKind::kRecursive:
+      callee_method = invoke->GetLocations()->InAt(invoke->GetCurrentMethodIndex());
+      break;
+    case MethodLoadKind::kRuntimeCall:
+      GenerateInvokeStaticOrDirectRuntimeCall(invoke, temp, slow_path);
+      return;  // No code pointer retrieval; the runtime performs the call directly.
+    case MethodLoadKind::kBootImageLinkTimePcRelative:
+      DCHECK(GetCompilerOptions().IsBootImage() || GetCompilerOptions().IsBootImageExtension());
+      if (invoke->GetCodePtrLocation() == CodePtrLocation::kCallCriticalNative) {
+        // Do not materialize the method pointer, load directly the entrypoint.
+        CodeGeneratorRISCV64::PcRelativePatchInfo* info_high =
+            NewBootImageJniEntrypointPatch(invoke->GetResolvedMethodReference());
+        EmitPcRelativeAuipcPlaceholder(info_high, RA);
+        CodeGeneratorRISCV64::PcRelativePatchInfo* info_low =
+            NewBootImageJniEntrypointPatch(invoke->GetResolvedMethodReference(), info_high);
+        EmitPcRelativeLdPlaceholder(info_low, RA, RA);
+        break;
+      }
+      FALLTHROUGH_INTENDED;
+    default:
+      LoadMethod(invoke->GetMethodLoadKind(), temp, invoke);
+      break;
+  }
+
+  switch (invoke->GetCodePtrLocation()) {
+    case CodePtrLocation::kCallSelf:
+      DCHECK(!GetGraph()->HasShouldDeoptimizeFlag());
+      __ Jal(&frame_entry_label_);
+      RecordPcInfo(invoke, invoke->GetDexPc(), slow_path);
+      break;
+    case CodePtrLocation::kCallArtMethod:
+      // RA = callee_method->entry_point_from_quick_compiled_code_;
+      __ Loadd(RA,
+               callee_method.AsRegister<XRegister>(),
+               ArtMethod::EntryPointFromQuickCompiledCodeOffset(kRiscv64PointerSize).Int32Value());
+      // RA()
+      __ Jalr(RA);
+      RecordPcInfo(invoke, invoke->GetDexPc(), slow_path);
+      break;
+    case CodePtrLocation::kCallCriticalNative: {
+      size_t out_frame_size =
+          PrepareCriticalNativeCall<CriticalNativeCallingConventionVisitorRiscv64,
+                                    kNativeStackAlignment,
+                                    GetCriticalNativeDirectCallFrameSize>(invoke);
+      if (invoke->GetMethodLoadKind() == MethodLoadKind::kBootImageLinkTimePcRelative) {
+        // Entrypoint is already loaded in RA.
+      } else {
+        // RA = callee_method->ptr_sized_fields_.data_;  // EntryPointFromJni
+        MemberOffset offset = ArtMethod::EntryPointFromJniOffset(kRiscv64PointerSize);
+        __ Loadd(RA, callee_method.AsRegister<XRegister>(), offset.Int32Value());
+      }
+      __ Jalr(RA);
+      RecordPcInfo(invoke, invoke->GetDexPc(), slow_path);
+      // The result is returned the same way in native ABI and managed ABI. No result conversion is
+      // needed, see comments in `Riscv64JniCallingConvention::RequiresSmallResultTypeExtension()`.
+      if (out_frame_size != 0u) {
+        DecreaseFrame(out_frame_size);
+      }
+      break;
+    }
+  }
+
+  DCHECK(!IsLeafMethod());
+}
+
+void CodeGeneratorRISCV64::MaybeGenerateInlineCacheCheck(HInstruction* instruction,
+                                                         XRegister klass) {
+  if (ProfilingInfoBuilder::IsInlineCacheUseful(instruction->AsInvoke(), this)) {
+    ProfilingInfo* info = GetGraph()->GetProfilingInfo();
+    DCHECK(info != nullptr);
+    InlineCache* cache = ProfilingInfoBuilder::GetInlineCache(
+        info, GetCompilerOptions(), instruction->AsInvoke());
+    if (cache != nullptr) {
+      uint64_t address = reinterpret_cast64<uint64_t>(cache);
+      Riscv64Label done;
+      // The `art_quick_update_inline_cache` expects the inline cache in T5.
+      XRegister ic_reg = T5;
+      ScratchRegisterScope srs(GetAssembler());
+      DCHECK_EQ(srs.AvailableXRegisters(), 2u);
+      srs.ExcludeXRegister(ic_reg);
+      DCHECK_EQ(srs.AvailableXRegisters(), 1u);
+      __ LoadConst64(ic_reg, address);
+      {
+        ScratchRegisterScope srs2(GetAssembler());
+        XRegister tmp = srs2.AllocateXRegister();
+        __ Loadd(tmp, ic_reg, InlineCache::ClassesOffset().Int32Value());
+        // Fast path for a monomorphic cache.
+        __ Beq(klass, tmp, &done);
+      }
+      InvokeRuntime(kQuickUpdateInlineCache, instruction, instruction->GetDexPc());
+      __ Bind(&done);
+    } else {
+      // This is unexpected, but we don't guarantee stable compilation across
+      // JIT runs so just warn about it.
+      ScopedObjectAccess soa(Thread::Current());
+      LOG(WARNING) << "Missing inline cache for " << GetGraph()->GetArtMethod()->PrettyMethod();
+    }
+  }
+}
+
+void CodeGeneratorRISCV64::GenerateVirtualCall(HInvokeVirtual* invoke,
+                                               Location temp_location,
+                                               SlowPathCode* slow_path) {
+  // Use the calling convention instead of the location of the receiver, as
+  // intrinsics may have put the receiver in a different register. In the intrinsics
+  // slow path, the arguments have been moved to the right place, so here we are
+  // guaranteed that the receiver is the first register of the calling convention.
+  InvokeDexCallingConvention calling_convention;
+  XRegister receiver = calling_convention.GetRegisterAt(0);
+  XRegister temp = temp_location.AsRegister<XRegister>();
+  MemberOffset method_offset =
+      mirror::Class::EmbeddedVTableEntryOffset(invoke->GetVTableIndex(), kRiscv64PointerSize);
+  MemberOffset class_offset = mirror::Object::ClassOffset();
+  Offset entry_point = ArtMethod::EntryPointFromQuickCompiledCodeOffset(kRiscv64PointerSize);
+
+  // temp = object->GetClass();
+  __ Loadwu(temp, receiver, class_offset.Int32Value());
+  MaybeRecordImplicitNullCheck(invoke);
+  // Instead of simply (possibly) unpoisoning `temp` here, we should
+  // emit a read barrier for the previous class reference load.
+  // However this is not required in practice, as this is an
+  // intermediate/temporary reference and because the current
+  // concurrent copying collector keeps the from-space memory
+  // intact/accessible until the end of the marking phase (the
+  // concurrent copying collector may not in the future).
+  MaybeUnpoisonHeapReference(temp);
+
+  // If we're compiling baseline, update the inline cache.
+  MaybeGenerateInlineCacheCheck(invoke, temp);
+
+  // temp = temp->GetMethodAt(method_offset);
+  __ Loadd(temp, temp, method_offset.Int32Value());
+  // RA = temp->GetEntryPoint();
+  __ Loadd(RA, temp, entry_point.Int32Value());
+  // RA();
+  __ Jalr(RA);
+  RecordPcInfo(invoke, invoke->GetDexPc(), slow_path);
+}
+
+void CodeGeneratorRISCV64::MoveFromReturnRegister(Location trg, DataType::Type type) {
+  if (!trg.IsValid()) {
+    DCHECK_EQ(type, DataType::Type::kVoid);
+    return;
+  }
+
+  DCHECK_NE(type, DataType::Type::kVoid);
+
+  if (DataType::IsIntegralType(type) || type == DataType::Type::kReference) {
+    XRegister trg_reg = trg.AsRegister<XRegister>();
+    XRegister res_reg = Riscv64ReturnLocation(type).AsRegister<XRegister>();
+    if (trg_reg != res_reg) {
+      __ Mv(trg_reg, res_reg);
+    }
+  } else {
+    FRegister trg_reg = trg.AsFpuRegister<FRegister>();
+    FRegister res_reg = Riscv64ReturnLocation(type).AsFpuRegister<FRegister>();
+    if (trg_reg != res_reg) {
+      __ FMvD(trg_reg, res_reg);  // 64-bit move is OK also for `float`.
+    }
+  }
+}
+
+void CodeGeneratorRISCV64::PoisonHeapReference(XRegister reg) {
+  __ Sub(reg, Zero, reg);  // Negate the ref.
+  __ ZextW(reg, reg);      // Zero-extend the 32-bit ref.
+}
+
+void CodeGeneratorRISCV64::UnpoisonHeapReference(XRegister reg) {
+  __ Sub(reg, Zero, reg);  // Negate the ref.
+  __ ZextW(reg, reg);      // Zero-extend the 32-bit ref.
+}
+
+void CodeGeneratorRISCV64::MaybePoisonHeapReference(XRegister reg) {
+  if (kPoisonHeapReferences) {
+    PoisonHeapReference(reg);
+  }
+}
+
+void CodeGeneratorRISCV64::MaybeUnpoisonHeapReference(XRegister reg) {
+  if (kPoisonHeapReferences) {
+    UnpoisonHeapReference(reg);
+  }
+}
+
+void CodeGeneratorRISCV64::SwapLocations(Location loc1, Location loc2, DataType::Type type) {
+  DCHECK(!loc1.IsConstant());
+  DCHECK(!loc2.IsConstant());
+
+  if (loc1.Equals(loc2)) {
+    return;
+  }
+
+  bool is_slot1 = loc1.IsStackSlot() || loc1.IsDoubleStackSlot();
+  bool is_slot2 = loc2.IsStackSlot() || loc2.IsDoubleStackSlot();
+  bool is_simd1 = loc1.IsSIMDStackSlot();
+  bool is_simd2 = loc2.IsSIMDStackSlot();
+  bool is_fp_reg1 = loc1.IsFpuRegister();
+  bool is_fp_reg2 = loc2.IsFpuRegister();
+
+  if ((is_slot1 != is_slot2) ||
+      (loc2.IsRegister() && loc1.IsRegister()) ||
+      (is_fp_reg2 && is_fp_reg1)) {
+    if ((is_fp_reg2 && is_fp_reg1) && GetGraph()->HasSIMD()) {
+      LOG(FATAL) << "Unsupported";
+      UNREACHABLE();
+    }
+    ScratchRegisterScope srs(GetAssembler());
+    Location tmp = (is_fp_reg2 || is_fp_reg1)
+        ? Location::FpuRegisterLocation(srs.AllocateFRegister())
+        : Location::RegisterLocation(srs.AllocateXRegister());
+    MoveLocation(tmp, loc1, type);
+    MoveLocation(loc1, loc2, type);
+    MoveLocation(loc2, tmp, type);
+  } else if (is_slot1 && is_slot2) {
+    move_resolver_.Exchange(loc1.GetStackIndex(), loc2.GetStackIndex(), loc1.IsDoubleStackSlot());
+  } else if (is_simd1 && is_simd2) {
+    // TODO(riscv64): Add VECTOR/SIMD later.
+    UNIMPLEMENTED(FATAL) << "Vector extension is unsupported";
+  } else if ((is_fp_reg1 && is_simd2) || (is_fp_reg2 && is_simd1)) {
+    // TODO(riscv64): Add VECTOR/SIMD later.
+    UNIMPLEMENTED(FATAL) << "Vector extension is unsupported";
+  } else {
+    LOG(FATAL) << "Unimplemented swap between locations " << loc1 << " and " << loc2;
+  }
+}
+
+}  // namespace riscv64
+}  // namespace art
diff --git a/compiler/optimizing/code_generator_riscv64.h b/compiler/optimizing/code_generator_riscv64.h
index 405b39a..653e83d 100644
--- a/compiler/optimizing/code_generator_riscv64.h
+++ b/compiler/optimizing/code_generator_riscv64.h
@@ -17,7 +17,834 @@
 #ifndef ART_COMPILER_OPTIMIZING_CODE_GENERATOR_RISCV64_H_
 #define ART_COMPILER_OPTIMIZING_CODE_GENERATOR_RISCV64_H_
 
+#include "android-base/logging.h"
+#include "arch/riscv64/registers_riscv64.h"
+#include "base/macros.h"
 #include "code_generator.h"
 #include "driver/compiler_options.h"
+#include "intrinsics_list.h"
+#include "optimizing/locations.h"
+#include "parallel_move_resolver.h"
+#include "utils/riscv64/assembler_riscv64.h"
+
+namespace art HIDDEN {
+namespace riscv64 {
+
+// InvokeDexCallingConvention registers
+static constexpr XRegister kParameterCoreRegisters[] = {A1, A2, A3, A4, A5, A6, A7};
+static constexpr size_t kParameterCoreRegistersLength = arraysize(kParameterCoreRegisters);
+
+static constexpr FRegister kParameterFpuRegisters[] = {FA0, FA1, FA2, FA3, FA4, FA5, FA6, FA7};
+static constexpr size_t kParameterFpuRegistersLength = arraysize(kParameterFpuRegisters);
+
+// InvokeRuntimeCallingConvention registers
+static constexpr XRegister kRuntimeParameterCoreRegisters[] = {A0, A1, A2, A3, A4, A5, A6, A7};
+static constexpr size_t kRuntimeParameterCoreRegistersLength =
+    arraysize(kRuntimeParameterCoreRegisters);
+
+static constexpr FRegister kRuntimeParameterFpuRegisters[] = {
+    FA0, FA1, FA2, FA3, FA4, FA5, FA6, FA7
+};
+static constexpr size_t kRuntimeParameterFpuRegistersLength =
+    arraysize(kRuntimeParameterFpuRegisters);
+
+// FCLASS returns a 10-bit classification mask with the two highest bits marking NaNs
+// (signaling and quiet). To detect a NaN, we can compare (either BGE or BGEU, the sign
+// bit is always clear) the result with the `kFClassNaNMinValue`.
+static_assert(kSignalingNaN == 0x100);
+static_assert(kQuietNaN == 0x200);
+static constexpr int32_t kFClassNaNMinValue = 0x100;
+
+#define UNIMPLEMENTED_INTRINSIC_LIST_RISCV64(V) \
+  V(SystemArrayCopyByte)                        \
+  V(SystemArrayCopyChar)                        \
+  V(SystemArrayCopyInt)                         \
+  V(FP16Ceil)                                   \
+  V(FP16Compare)                                \
+  V(FP16Floor)                                  \
+  V(FP16Rint)                                   \
+  V(FP16ToFloat)                                \
+  V(FP16ToHalf)                                 \
+  V(FP16Greater)                                \
+  V(FP16GreaterEquals)                          \
+  V(FP16Less)                                   \
+  V(FP16LessEquals)                             \
+  V(FP16Min)                                    \
+  V(FP16Max)                                    \
+  V(StringCompareTo)                            \
+  V(StringEquals)                               \
+  V(StringGetCharsNoCheck)                      \
+  V(StringStringIndexOf)                        \
+  V(StringStringIndexOfAfter)                   \
+  V(StringBufferAppend)                         \
+  V(StringBufferLength)                         \
+  V(StringBufferToString)                       \
+  V(StringBuilderAppendObject)                  \
+  V(StringBuilderAppendString)                  \
+  V(StringBuilderAppendCharSequence)            \
+  V(StringBuilderAppendCharArray)               \
+  V(StringBuilderAppendBoolean)                 \
+  V(StringBuilderAppendChar)                    \
+  V(StringBuilderAppendInt)                     \
+  V(StringBuilderAppendLong)                    \
+  V(StringBuilderAppendFloat)                   \
+  V(StringBuilderAppendDouble)                  \
+  V(StringBuilderLength)                        \
+  V(StringBuilderToString)                      \
+  V(CRC32Update)                                \
+  V(CRC32UpdateBytes)                           \
+  V(CRC32UpdateByteBuffer)                      \
+  V(MethodHandleInvokeExact)                    \
+  V(MethodHandleInvoke)
+
+// Method register on invoke.
+static const XRegister kArtMethodRegister = A0;
+
+// Helper functions used by codegen as well as intrinsics.
+XRegister InputXRegisterOrZero(Location location);
+int32_t ReadBarrierMarkEntrypointOffset(Location ref);
+
+class CodeGeneratorRISCV64;
+
+class InvokeRuntimeCallingConvention : public CallingConvention<XRegister, FRegister> {
+ public:
+  InvokeRuntimeCallingConvention()
+      : CallingConvention(kRuntimeParameterCoreRegisters,
+                          kRuntimeParameterCoreRegistersLength,
+                          kRuntimeParameterFpuRegisters,
+                          kRuntimeParameterFpuRegistersLength,
+                          kRiscv64PointerSize) {}
+
+  Location GetReturnLocation(DataType::Type return_type);
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(InvokeRuntimeCallingConvention);
+};
+
+class InvokeDexCallingConvention : public CallingConvention<XRegister, FRegister> {
+ public:
+  InvokeDexCallingConvention()
+      : CallingConvention(kParameterCoreRegisters,
+                          kParameterCoreRegistersLength,
+                          kParameterFpuRegisters,
+                          kParameterFpuRegistersLength,
+                          kRiscv64PointerSize) {}
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(InvokeDexCallingConvention);
+};
+
+class InvokeDexCallingConventionVisitorRISCV64 : public InvokeDexCallingConventionVisitor {
+ public:
+  InvokeDexCallingConventionVisitorRISCV64() {}
+  virtual ~InvokeDexCallingConventionVisitorRISCV64() {}
+
+  Location GetNextLocation(DataType::Type type) override;
+  Location GetReturnLocation(DataType::Type type) const override;
+  Location GetMethodLocation() const override;
+
+ private:
+  InvokeDexCallingConvention calling_convention;
+
+  DISALLOW_COPY_AND_ASSIGN(InvokeDexCallingConventionVisitorRISCV64);
+};
+
+class CriticalNativeCallingConventionVisitorRiscv64 : public InvokeDexCallingConventionVisitor {
+ public:
+  explicit CriticalNativeCallingConventionVisitorRiscv64(bool for_register_allocation)
+      : for_register_allocation_(for_register_allocation) {}
+
+  virtual ~CriticalNativeCallingConventionVisitorRiscv64() {}
+
+  Location GetNextLocation(DataType::Type type) override;
+  Location GetReturnLocation(DataType::Type type) const override;
+  Location GetMethodLocation() const override;
+
+  size_t GetStackOffset() const { return stack_offset_; }
+
+ private:
+  // Register allocator does not support adjusting frame size, so we cannot provide final locations
+  // of stack arguments for register allocation. We ask the register allocator for any location and
+  // move these arguments to the right place after adjusting the SP when generating the call.
+  const bool for_register_allocation_;
+  size_t gpr_index_ = 0u;
+  size_t fpr_index_ = 0u;
+  size_t stack_offset_ = 0u;
+
+  DISALLOW_COPY_AND_ASSIGN(CriticalNativeCallingConventionVisitorRiscv64);
+};
+
+class SlowPathCodeRISCV64 : public SlowPathCode {
+ public:
+  explicit SlowPathCodeRISCV64(HInstruction* instruction)
+      : SlowPathCode(instruction), entry_label_(), exit_label_() {}
+
+  Riscv64Label* GetEntryLabel() { return &entry_label_; }
+  Riscv64Label* GetExitLabel() { return &exit_label_; }
+
+ private:
+  Riscv64Label entry_label_;
+  Riscv64Label exit_label_;
+
+  DISALLOW_COPY_AND_ASSIGN(SlowPathCodeRISCV64);
+};
+
+class ParallelMoveResolverRISCV64 : public ParallelMoveResolverWithSwap {
+ public:
+  ParallelMoveResolverRISCV64(ArenaAllocator* allocator, CodeGeneratorRISCV64* codegen)
+      : ParallelMoveResolverWithSwap(allocator), codegen_(codegen) {}
+
+  void EmitMove(size_t index) override;
+  void EmitSwap(size_t index) override;
+  void SpillScratch(int reg) override;
+  void RestoreScratch(int reg) override;
+
+  void Exchange(int index1, int index2, bool double_slot);
+
+  Riscv64Assembler* GetAssembler() const;
+
+ private:
+  CodeGeneratorRISCV64* const codegen_;
+
+  DISALLOW_COPY_AND_ASSIGN(ParallelMoveResolverRISCV64);
+};
+
+class FieldAccessCallingConventionRISCV64 : public FieldAccessCallingConvention {
+ public:
+  FieldAccessCallingConventionRISCV64() {}
+
+  Location GetObjectLocation() const override {
+    return Location::RegisterLocation(A1);
+  }
+  Location GetFieldIndexLocation() const override {
+    return Location::RegisterLocation(A0);
+  }
+  Location GetReturnLocation(DataType::Type type ATTRIBUTE_UNUSED) const override {
+    return Location::RegisterLocation(A0);
+  }
+  Location GetSetValueLocation(DataType::Type type ATTRIBUTE_UNUSED,
+                               bool is_instance) const override {
+    return is_instance
+        ? Location::RegisterLocation(A2)
+        : Location::RegisterLocation(A1);
+  }
+  Location GetFpuLocation(DataType::Type type ATTRIBUTE_UNUSED) const override {
+    return Location::FpuRegisterLocation(FA0);
+  }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(FieldAccessCallingConventionRISCV64);
+};
+
+class LocationsBuilderRISCV64 : public HGraphVisitor {
+ public:
+  LocationsBuilderRISCV64(HGraph* graph, CodeGeneratorRISCV64* codegen)
+      : HGraphVisitor(graph), codegen_(codegen) {}
+
+#define DECLARE_VISIT_INSTRUCTION(name, super) void Visit##name(H##name* instr) override;
+
+  FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION)
+  FOR_EACH_CONCRETE_INSTRUCTION_RISCV64(DECLARE_VISIT_INSTRUCTION)
+
+#undef DECLARE_VISIT_INSTRUCTION
+
+  void VisitInstruction(HInstruction* instruction) override {
+    LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id "
+               << instruction->GetId() << ")";
+  }
+
+ protected:
+  void HandleInvoke(HInvoke* invoke);
+  void HandleBinaryOp(HBinaryOperation* operation);
+  void HandleCondition(HCondition* instruction);
+  void HandleShift(HBinaryOperation* operation);
+  void HandleFieldSet(HInstruction* instruction);
+  void HandleFieldGet(HInstruction* instruction);
+
+  InvokeDexCallingConventionVisitorRISCV64 parameter_visitor_;
+
+  CodeGeneratorRISCV64* const codegen_;
+
+  DISALLOW_COPY_AND_ASSIGN(LocationsBuilderRISCV64);
+};
+
+class InstructionCodeGeneratorRISCV64 : public InstructionCodeGenerator {
+ public:
+  InstructionCodeGeneratorRISCV64(HGraph* graph, CodeGeneratorRISCV64* codegen);
+
+#define DECLARE_VISIT_INSTRUCTION(name, super) void Visit##name(H##name* instr) override;
+
+  FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION)
+  FOR_EACH_CONCRETE_INSTRUCTION_RISCV64(DECLARE_VISIT_INSTRUCTION)
+
+#undef DECLARE_VISIT_INSTRUCTION
+
+  void VisitInstruction(HInstruction* instruction) override {
+    LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id "
+               << instruction->GetId() << ")";
+  }
+
+  Riscv64Assembler* GetAssembler() const { return assembler_; }
+
+  void GenerateMemoryBarrier(MemBarrierKind kind);
+
+  void FAdd(FRegister rd, FRegister rs1, FRegister rs2, DataType::Type type);
+  void FClass(XRegister rd, FRegister rs1, DataType::Type type);
+
+  void Load(Location out, XRegister rs1, int32_t offset, DataType::Type type);
+  void Store(Location value, XRegister rs1, int32_t offset, DataType::Type type);
+
+  // Sequentially consistent store. Used for volatile fields and intrinsics.
+  // The `instruction` argument is for recording an implicit null check stack map with the
+  // store instruction which may not be the last instruction emitted by `StoreSeqCst()`.
+  void StoreSeqCst(Location value,
+                   XRegister rs1,
+                   int32_t offset,
+                   DataType::Type type,
+                   HInstruction* instruction = nullptr);
+
+  void ShNAdd(XRegister rd, XRegister rs1, XRegister rs2, DataType::Type type);
+
+ protected:
+  void GenerateClassInitializationCheck(SlowPathCodeRISCV64* slow_path, XRegister class_reg);
+  void GenerateBitstringTypeCheckCompare(HTypeCheckInstruction* check, XRegister temp);
+  void GenerateSuspendCheck(HSuspendCheck* check, HBasicBlock* successor);
+  void HandleBinaryOp(HBinaryOperation* operation);
+  void HandleCondition(HCondition* instruction);
+  void HandleShift(HBinaryOperation* operation);
+  void HandleFieldSet(HInstruction* instruction,
+                      const FieldInfo& field_info,
+                      bool value_can_be_null,
+                      WriteBarrierKind write_barrier_kind);
+  void HandleFieldGet(HInstruction* instruction, const FieldInfo& field_info);
+
+  // Generate a heap reference load using one register `out`:
+  //
+  //   out <- *(out + offset)
+  //
+  // while honoring heap poisoning and/or read barriers (if any).
+  //
+  // Location `maybe_temp` is used when generating a read barrier and
+  // shall be a register in that case; it may be an invalid location
+  // otherwise.
+  void GenerateReferenceLoadOneRegister(HInstruction* instruction,
+                                        Location out,
+                                        uint32_t offset,
+                                        Location maybe_temp,
+                                        ReadBarrierOption read_barrier_option);
+  // Generate a heap reference load using two different registers
+  // `out` and `obj`:
+  //
+  //   out <- *(obj + offset)
+  //
+  // while honoring heap poisoning and/or read barriers (if any).
+  //
+  // Location `maybe_temp` is used when generating a Baker's (fast
+  // path) read barrier and shall be a register in that case; it may
+  // be an invalid location otherwise.
+  void GenerateReferenceLoadTwoRegisters(HInstruction* instruction,
+                                         Location out,
+                                         Location obj,
+                                         uint32_t offset,
+                                         Location maybe_temp,
+                                         ReadBarrierOption read_barrier_option);
+
+  void GenerateTestAndBranch(HInstruction* instruction,
+                             size_t condition_input_index,
+                             Riscv64Label* true_target,
+                             Riscv64Label* false_target);
+  void DivRemOneOrMinusOne(HBinaryOperation* instruction);
+  void DivRemByPowerOfTwo(HBinaryOperation* instruction);
+  void GenerateDivRemWithAnyConstant(HBinaryOperation* instruction);
+  void GenerateDivRemIntegral(HBinaryOperation* instruction);
+  void GenerateIntLongCondition(IfCondition cond, LocationSummary* locations);
+  void GenerateIntLongCondition(IfCondition cond,
+                                LocationSummary* locations,
+                                XRegister rd,
+                                bool to_all_bits);
+  void GenerateIntLongCompareAndBranch(IfCondition cond,
+                                       LocationSummary* locations,
+                                       Riscv64Label* label);
+  void GenerateFpCondition(IfCondition cond,
+                           bool gt_bias,
+                           DataType::Type type,
+                           LocationSummary* locations,
+                           Riscv64Label* label = nullptr);
+  void GenerateFpCondition(IfCondition cond,
+                           bool gt_bias,
+                           DataType::Type type,
+                           LocationSummary* locations,
+                           Riscv64Label* label,
+                           XRegister rd,
+                           bool to_all_bits);
+  void GenerateMethodEntryExitHook(HInstruction* instruction);
+  void HandleGoto(HInstruction* got, HBasicBlock* successor);
+  void GenPackedSwitchWithCompares(XRegister adjusted,
+                                   XRegister temp,
+                                   uint32_t num_entries,
+                                   HBasicBlock* switch_block);
+  void GenTableBasedPackedSwitch(XRegister adjusted,
+                                 XRegister temp,
+                                 uint32_t num_entries,
+                                 HBasicBlock* switch_block);
+  int32_t VecAddress(LocationSummary* locations,
+                     size_t size,
+                     /*out*/ XRegister* adjusted_base);
+
+  template <typename Reg,
+            void (Riscv64Assembler::*opS)(Reg, FRegister, FRegister),
+            void (Riscv64Assembler::*opD)(Reg, FRegister, FRegister)>
+  void FpBinOp(Reg rd, FRegister rs1, FRegister rs2, DataType::Type type);
+  void FSub(FRegister rd, FRegister rs1, FRegister rs2, DataType::Type type);
+  void FDiv(FRegister rd, FRegister rs1, FRegister rs2, DataType::Type type);
+  void FMul(FRegister rd, FRegister rs1, FRegister rs2, DataType::Type type);
+  void FMin(FRegister rd, FRegister rs1, FRegister rs2, DataType::Type type);
+  void FMax(FRegister rd, FRegister rs1, FRegister rs2, DataType::Type type);
+  void FEq(XRegister rd, FRegister rs1, FRegister rs2, DataType::Type type);
+  void FLt(XRegister rd, FRegister rs1, FRegister rs2, DataType::Type type);
+  void FLe(XRegister rd, FRegister rs1, FRegister rs2, DataType::Type type);
+
+  template <typename Reg,
+            void (Riscv64Assembler::*opS)(Reg, FRegister),
+            void (Riscv64Assembler::*opD)(Reg, FRegister)>
+  void FpUnOp(Reg rd, FRegister rs1, DataType::Type type);
+  void FAbs(FRegister rd, FRegister rs1, DataType::Type type);
+  void FNeg(FRegister rd, FRegister rs1, DataType::Type type);
+  void FMv(FRegister rd, FRegister rs1, DataType::Type type);
+  void FMvX(XRegister rd, FRegister rs1, DataType::Type type);
+
+  Riscv64Assembler* const assembler_;
+  CodeGeneratorRISCV64* const codegen_;
+
+  DISALLOW_COPY_AND_ASSIGN(InstructionCodeGeneratorRISCV64);
+};
+
+class CodeGeneratorRISCV64 : public CodeGenerator {
+ public:
+  CodeGeneratorRISCV64(HGraph* graph,
+                       const CompilerOptions& compiler_options,
+                       OptimizingCompilerStats* stats = nullptr);
+  virtual ~CodeGeneratorRISCV64() {}
+
+  void GenerateFrameEntry() override;
+  void GenerateFrameExit() override;
+
+  void Bind(HBasicBlock* block) override;
+
+  size_t GetWordSize() const override {
+    // The "word" for the compiler is the core register size (64-bit for riscv64) while the
+    // riscv64 assembler uses "word" for 32-bit values and "double word" for 64-bit values.
+    return kRiscv64DoublewordSize;
+  }
+
+  bool SupportsPredicatedSIMD() const override {
+    // TODO(riscv64): Check the vector extension.
+    return false;
+  }
+
+  // Get FP register width in bytes for spilling/restoring in the slow paths.
+  //
+  // Note: In SIMD graphs this should return SIMD register width as all FP and SIMD registers
+  // alias and live SIMD registers are forced to be spilled in full size in the slow paths.
+  size_t GetSlowPathFPWidth() const override {
+    // Default implementation.
+    return GetCalleePreservedFPWidth();
+  }
+
+  size_t GetCalleePreservedFPWidth() const override {
+    return kRiscv64FloatRegSizeInBytes;
+  };
+
+  size_t GetSIMDRegisterWidth() const override {
+    // TODO(riscv64): Implement SIMD with the Vector extension.
+    // Note: HLoopOptimization calls this function even for an ISA without SIMD support.
+    return kRiscv64FloatRegSizeInBytes;
+  };
+
+  uintptr_t GetAddressOf(HBasicBlock* block) override {
+    return assembler_.GetLabelLocation(GetLabelOf(block));
+  };
+
+  Riscv64Label* GetLabelOf(HBasicBlock* block) const {
+    return CommonGetLabelOf<Riscv64Label>(block_labels_, block);
+  }
+
+  void Initialize() override { block_labels_ = CommonInitializeLabels<Riscv64Label>(); }
+
+  void MoveConstant(Location destination, int32_t value) override;
+  void MoveLocation(Location destination, Location source, DataType::Type dst_type) override;
+  void AddLocationAsTemp(Location location, LocationSummary* locations) override;
+
+  Riscv64Assembler* GetAssembler() override { return &assembler_; }
+  const Riscv64Assembler& GetAssembler() const override { return assembler_; }
+
+  HGraphVisitor* GetLocationBuilder() override { return &location_builder_; }
+
+  InstructionCodeGeneratorRISCV64* GetInstructionVisitor() override {
+    return &instruction_visitor_;
+  }
+
+  void MaybeGenerateInlineCacheCheck(HInstruction* instruction, XRegister klass);
+
+  void SetupBlockedRegisters() const override;
+
+  size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) override;
+  size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) override;
+  size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) override;
+  size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) override;
+
+  void DumpCoreRegister(std::ostream& stream, int reg) const override;
+  void DumpFloatingPointRegister(std::ostream& stream, int reg) const override;
+
+  InstructionSet GetInstructionSet() const override { return InstructionSet::kRiscv64; }
+
+  const Riscv64InstructionSetFeatures& GetInstructionSetFeatures() const;
+
+  uint32_t GetPreferredSlotsAlignment() const override {
+    return static_cast<uint32_t>(kRiscv64PointerSize);
+  }
+
+  void Finalize() override;
+
+  // Generate code to invoke a runtime entry point.
+  void InvokeRuntime(QuickEntrypointEnum entrypoint,
+                     HInstruction* instruction,
+                     uint32_t dex_pc,
+                     SlowPathCode* slow_path = nullptr) override;
+
+  // Generate code to invoke a runtime entry point, but do not record
+  // PC-related information in a stack map.
+  void InvokeRuntimeWithoutRecordingPcInfo(int32_t entry_point_offset,
+                                           HInstruction* instruction,
+                                           SlowPathCode* slow_path);
+
+  ParallelMoveResolver* GetMoveResolver() override { return &move_resolver_; }
+
+  bool NeedsTwoRegisters([[maybe_unused]] DataType::Type type) const override { return false; }
+
+  void IncreaseFrame(size_t adjustment) override;
+  void DecreaseFrame(size_t adjustment) override;
+
+  void GenerateNop() override;
+
+  void GenerateImplicitNullCheck(HNullCheck* instruction) override;
+  void GenerateExplicitNullCheck(HNullCheck* instruction) override;
+
+  // Check if the desired_string_load_kind is supported. If it is, return it,
+  // otherwise return a fall-back kind that should be used instead.
+  HLoadString::LoadKind GetSupportedLoadStringKind(
+      HLoadString::LoadKind desired_string_load_kind) override;
+
+  // Check if the desired_class_load_kind is supported. If it is, return it,
+  // otherwise return a fall-back kind that should be used instead.
+  HLoadClass::LoadKind GetSupportedLoadClassKind(
+      HLoadClass::LoadKind desired_class_load_kind) override;
+
+  // Check if the desired_dispatch_info is supported. If it is, return it,
+  // otherwise return a fall-back info that should be used instead.
+  HInvokeStaticOrDirect::DispatchInfo GetSupportedInvokeStaticOrDirectDispatch(
+      const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info, ArtMethod* method) override;
+
+  // The PcRelativePatchInfo is used for PC-relative addressing of methods/strings/types,
+  // whether through .data.bimg.rel.ro, .bss, or directly in the boot image.
+  //
+  // The 20-bit and 12-bit parts of the 32-bit PC-relative offset are patched separately,
+  // necessitating two patches/infos. There can be more than two patches/infos if the
+  // instruction supplying the high part is shared with e.g. a slow path, while the low
+  // part is supplied by separate instructions, e.g.:
+  //     auipc r1, high       // patch
+  //     lwu   r2, low(r1)    // patch
+  //     beqz  r2, slow_path
+  //   back:
+  //     ...
+  //   slow_path:
+  //     ...
+  //     sw    r2, low(r1)    // patch
+  //     j     back
+  struct PcRelativePatchInfo : PatchInfo<Riscv64Label> {
+    PcRelativePatchInfo(const DexFile* dex_file,
+                        uint32_t off_or_idx,
+                        const PcRelativePatchInfo* info_high)
+        : PatchInfo<Riscv64Label>(dex_file, off_or_idx),
+          pc_insn_label(info_high != nullptr ? &info_high->label : &label) {
+      DCHECK_IMPLIES(info_high != nullptr, info_high->pc_insn_label == &info_high->label);
+    }
+
+    // Pointer to the info for the high part patch or nullptr if this is the high part patch info.
+    const Riscv64Label* pc_insn_label;
+
+   private:
+    PcRelativePatchInfo(PcRelativePatchInfo&& other) = delete;
+    DISALLOW_COPY_AND_ASSIGN(PcRelativePatchInfo);
+  };
+
+  PcRelativePatchInfo* NewBootImageIntrinsicPatch(uint32_t intrinsic_data,
+                                                  const PcRelativePatchInfo* info_high = nullptr);
+  PcRelativePatchInfo* NewBootImageRelRoPatch(uint32_t boot_image_offset,
+                                              const PcRelativePatchInfo* info_high = nullptr);
+  PcRelativePatchInfo* NewBootImageMethodPatch(MethodReference target_method,
+                                               const PcRelativePatchInfo* info_high = nullptr);
+  PcRelativePatchInfo* NewMethodBssEntryPatch(MethodReference target_method,
+                                              const PcRelativePatchInfo* info_high = nullptr);
+  PcRelativePatchInfo* NewBootImageJniEntrypointPatch(
+      MethodReference target_method, const PcRelativePatchInfo* info_high = nullptr);
+
+  PcRelativePatchInfo* NewBootImageTypePatch(const DexFile& dex_file,
+                                             dex::TypeIndex type_index,
+                                             const PcRelativePatchInfo* info_high = nullptr);
+  PcRelativePatchInfo* NewTypeBssEntryPatch(HLoadClass* load_class,
+                                            const PcRelativePatchInfo* info_high = nullptr);
+  PcRelativePatchInfo* NewBootImageStringPatch(const DexFile& dex_file,
+                                               dex::StringIndex string_index,
+                                               const PcRelativePatchInfo* info_high = nullptr);
+  PcRelativePatchInfo* NewStringBssEntryPatch(const DexFile& dex_file,
+                                              dex::StringIndex string_index,
+                                              const PcRelativePatchInfo* info_high = nullptr);
+
+  void EmitPcRelativeAuipcPlaceholder(PcRelativePatchInfo* info_high, XRegister out);
+  void EmitPcRelativeAddiPlaceholder(PcRelativePatchInfo* info_low, XRegister rd, XRegister rs1);
+  void EmitPcRelativeLwuPlaceholder(PcRelativePatchInfo* info_low, XRegister rd, XRegister rs1);
+  void EmitPcRelativeLdPlaceholder(PcRelativePatchInfo* info_low, XRegister rd, XRegister rs1);
+
+  void EmitLinkerPatches(ArenaVector<linker::LinkerPatch>* linker_patches) override;
+
+  Literal* DeduplicateBootImageAddressLiteral(uint64_t address);
+  void PatchJitRootUse(uint8_t* code,
+                       const uint8_t* roots_data,
+                       const Literal* literal,
+                       uint64_t index_in_table) const;
+  Literal* DeduplicateJitStringLiteral(const DexFile& dex_file,
+                                       dex::StringIndex string_index,
+                                       Handle<mirror::String> handle);
+  Literal* DeduplicateJitClassLiteral(const DexFile& dex_file,
+                                      dex::TypeIndex type_index,
+                                      Handle<mirror::Class> handle);
+  void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) override;
+
+  void LoadTypeForBootImageIntrinsic(XRegister dest, TypeReference target_type);
+  void LoadBootImageRelRoEntry(XRegister dest, uint32_t boot_image_offset);
+  void LoadBootImageAddress(XRegister dest, uint32_t boot_image_reference);
+  void LoadIntrinsicDeclaringClass(XRegister dest, HInvoke* invoke);
+  void LoadClassRootForIntrinsic(XRegister dest, ClassRoot class_root);
+
+  void LoadMethod(MethodLoadKind load_kind, Location temp, HInvoke* invoke);
+  void GenerateStaticOrDirectCall(HInvokeStaticOrDirect* invoke,
+                                  Location temp,
+                                  SlowPathCode* slow_path = nullptr) override;
+  void GenerateVirtualCall(HInvokeVirtual* invoke,
+                           Location temp,
+                           SlowPathCode* slow_path = nullptr) override;
+  void MoveFromReturnRegister(Location trg, DataType::Type type) override;
+
+  void GenerateMemoryBarrier(MemBarrierKind kind);
+
+  void MaybeIncrementHotness(HSuspendCheck* suspend_check, bool is_frame_entry);
+
+  bool CanUseImplicitSuspendCheck() const;
+
+
+  // Create slow path for a Baker read barrier for a GC root load within `instruction`.
+  SlowPathCodeRISCV64* AddGcRootBakerBarrierBarrierSlowPath(
+      HInstruction* instruction, Location root, Location temp);
+
+  // Emit marking check for a Baker read barrier for a GC root load within `instruction`.
+  void EmitBakerReadBarierMarkingCheck(
+      SlowPathCodeRISCV64* slow_path, Location root, Location temp);
+
+  // Generate a GC root reference load:
+  //
+  //   root <- *(obj + offset)
+  //
+  // while honoring read barriers (if any).
+  void GenerateGcRootFieldLoad(HInstruction* instruction,
+                               Location root,
+                               XRegister obj,
+                               uint32_t offset,
+                               ReadBarrierOption read_barrier_option,
+                               Riscv64Label* label_low = nullptr);
+
+  // Fast path implementation of ReadBarrier::Barrier for a heap
+  // reference field load when Baker's read barriers are used.
+  void GenerateFieldLoadWithBakerReadBarrier(HInstruction* instruction,
+                                             Location ref,
+                                             XRegister obj,
+                                             uint32_t offset,
+                                             Location temp,
+                                             bool needs_null_check);
+  // Fast path implementation of ReadBarrier::Barrier for a heap
+  // reference array load when Baker's read barriers are used.
+  void GenerateArrayLoadWithBakerReadBarrier(HInstruction* instruction,
+                                             Location ref,
+                                             XRegister obj,
+                                             uint32_t data_offset,
+                                             Location index,
+                                             Location temp,
+                                             bool needs_null_check);
+  // Factored implementation, used by GenerateFieldLoadWithBakerReadBarrier,
+  // GenerateArrayLoadWithBakerReadBarrier and intrinsics.
+  void GenerateReferenceLoadWithBakerReadBarrier(HInstruction* instruction,
+                                                 Location ref,
+                                                 XRegister obj,
+                                                 uint32_t offset,
+                                                 Location index,
+                                                 Location temp,
+                                                 bool needs_null_check);
+
+  // Create slow path for a read barrier for a heap reference within `instruction`.
+  //
+  // This is a helper function for GenerateReadBarrierSlow() that has the same
+  // arguments. The creation and adding of the slow path is exposed for intrinsics
+  // that cannot use GenerateReadBarrierSlow() from their own slow paths.
+  SlowPathCodeRISCV64* AddReadBarrierSlowPath(HInstruction* instruction,
+                                              Location out,
+                                              Location ref,
+                                              Location obj,
+                                              uint32_t offset,
+                                              Location index);
+
+  // Generate a read barrier for a heap reference within `instruction`
+  // using a slow path.
+  //
+  // A read barrier for an object reference read from the heap is
+  // implemented as a call to the artReadBarrierSlow runtime entry
+  // point, which is passed the values in locations `ref`, `obj`, and
+  // `offset`:
+  //
+  //   mirror::Object* artReadBarrierSlow(mirror::Object* ref,
+  //                                      mirror::Object* obj,
+  //                                      uint32_t offset);
+  //
+  // The `out` location contains the value returned by
+  // artReadBarrierSlow.
+  //
+  // When `index` is provided (i.e. for array accesses), the offset
+  // value passed to artReadBarrierSlow is adjusted to take `index`
+  // into account.
+  void GenerateReadBarrierSlow(HInstruction* instruction,
+                               Location out,
+                               Location ref,
+                               Location obj,
+                               uint32_t offset,
+                               Location index = Location::NoLocation());
+
+  // If read barriers are enabled, generate a read barrier for a heap
+  // reference using a slow path. If heap poisoning is enabled, also
+  // unpoison the reference in `out`.
+  void MaybeGenerateReadBarrierSlow(HInstruction* instruction,
+                                    Location out,
+                                    Location ref,
+                                    Location obj,
+                                    uint32_t offset,
+                                    Location index = Location::NoLocation());
+
+  // Generate a read barrier for a GC root within `instruction` using
+  // a slow path.
+  //
+  // A read barrier for an object reference GC root is implemented as
+  // a call to the artReadBarrierForRootSlow runtime entry point,
+  // which is passed the value in location `root`:
+  //
+  //   mirror::Object* artReadBarrierForRootSlow(GcRoot<mirror::Object>* root);
+  //
+  // The `out` location contains the value returned by
+  // artReadBarrierForRootSlow.
+  void GenerateReadBarrierForRootSlow(HInstruction* instruction, Location out, Location root);
+
+  // Emit a write barrier if:
+  // A) emit_null_check is false
+  // B) emit_null_check is true, and value is not null.
+  void MaybeMarkGCCard(XRegister object, XRegister value, bool emit_null_check);
+
+  // Emit a write barrier unconditionally.
+  void MarkGCCard(XRegister object);
+
+  // Crash if the card table is not valid. This check is only emitted for the CC GC. We assert
+  // `(!clean || !self->is_gc_marking)`, since the card table should not be set to clean when the CC
+  // GC is marking for eliminated write barriers.
+  void CheckGCCardIsValid(XRegister object);
+
+  //
+  // Heap poisoning.
+  //
+
+  // Poison a heap reference contained in `reg`.
+  void PoisonHeapReference(XRegister reg);
+
+  // Unpoison a heap reference contained in `reg`.
+  void UnpoisonHeapReference(XRegister reg);
+
+  // Poison a heap reference contained in `reg` if heap poisoning is enabled.
+  void MaybePoisonHeapReference(XRegister reg);
+
+  // Unpoison a heap reference contained in `reg` if heap poisoning is enabled.
+  void MaybeUnpoisonHeapReference(XRegister reg);
+
+  void SwapLocations(Location loc1, Location loc2, DataType::Type type);
+
+ private:
+  using Uint32ToLiteralMap = ArenaSafeMap<uint32_t, Literal*>;
+  using Uint64ToLiteralMap = ArenaSafeMap<uint64_t, Literal*>;
+  using StringToLiteralMap =
+      ArenaSafeMap<StringReference, Literal*, StringReferenceValueComparator>;
+  using TypeToLiteralMap = ArenaSafeMap<TypeReference, Literal*, TypeReferenceValueComparator>;
+
+  Literal* DeduplicateUint32Literal(uint32_t value);
+  Literal* DeduplicateUint64Literal(uint64_t value);
+
+  PcRelativePatchInfo* NewPcRelativePatch(const DexFile* dex_file,
+                                          uint32_t offset_or_index,
+                                          const PcRelativePatchInfo* info_high,
+                                          ArenaDeque<PcRelativePatchInfo>* patches);
+
+  template <linker::LinkerPatch (*Factory)(size_t, const DexFile*, uint32_t, uint32_t)>
+  void EmitPcRelativeLinkerPatches(const ArenaDeque<PcRelativePatchInfo>& infos,
+                                   ArenaVector<linker::LinkerPatch>* linker_patches);
+
+  Riscv64Assembler assembler_;
+  LocationsBuilderRISCV64 location_builder_;
+  InstructionCodeGeneratorRISCV64 instruction_visitor_;
+  Riscv64Label frame_entry_label_;
+
+  // Labels for each block that will be compiled.
+  Riscv64Label* block_labels_;  // Indexed by block id.
+
+  ParallelMoveResolverRISCV64 move_resolver_;
+
+  // Deduplication map for 32-bit literals, used for non-patchable boot image addresses.
+  Uint32ToLiteralMap uint32_literals_;
+  // Deduplication map for 64-bit literals, used for non-patchable method address or method code
+  // address.
+  Uint64ToLiteralMap uint64_literals_;
+
+  // PC-relative method patch info for kBootImageLinkTimePcRelative.
+  ArenaDeque<PcRelativePatchInfo> boot_image_method_patches_;
+  // PC-relative method patch info for kBssEntry.
+  ArenaDeque<PcRelativePatchInfo> method_bss_entry_patches_;
+  // PC-relative type patch info for kBootImageLinkTimePcRelative.
+  ArenaDeque<PcRelativePatchInfo> boot_image_type_patches_;
+  // PC-relative type patch info for kBssEntry.
+  ArenaDeque<PcRelativePatchInfo> type_bss_entry_patches_;
+  // PC-relative public type patch info for kBssEntryPublic.
+  ArenaDeque<PcRelativePatchInfo> public_type_bss_entry_patches_;
+  // PC-relative package type patch info for kBssEntryPackage.
+  ArenaDeque<PcRelativePatchInfo> package_type_bss_entry_patches_;
+  // PC-relative String patch info for kBootImageLinkTimePcRelative.
+  ArenaDeque<PcRelativePatchInfo> boot_image_string_patches_;
+  // PC-relative String patch info for kBssEntry.
+  ArenaDeque<PcRelativePatchInfo> string_bss_entry_patches_;
+  // PC-relative method patch info for kBootImageLinkTimePcRelative+kCallCriticalNative.
+  ArenaDeque<PcRelativePatchInfo> boot_image_jni_entrypoint_patches_;
+  // PC-relative patch info for IntrinsicObjects for the boot image,
+  // and for method/type/string patches for kBootImageRelRo otherwise.
+  ArenaDeque<PcRelativePatchInfo> boot_image_other_patches_;
+
+  // Patches for string root accesses in JIT compiled code.
+  StringToLiteralMap jit_string_patches_;
+  // Patches for class root accesses in JIT compiled code.
+  TypeToLiteralMap jit_class_patches_;
+};
+
+}  // namespace riscv64
+}  // namespace art
 
 #endif  // ART_COMPILER_OPTIMIZING_CODE_GENERATOR_RISCV64_H_
diff --git a/compiler/optimizing/code_generator_vector_arm64_neon.cc b/compiler/optimizing/code_generator_vector_arm64_neon.cc
index 6b6e25c..848b5e7 100644
--- a/compiler/optimizing/code_generator_vector_arm64_neon.cc
+++ b/compiler/optimizing/code_generator_vector_arm64_neon.cc
@@ -61,10 +61,8 @@
 //  - constant location - if 'constant' is an actual constant and its value can be
 //    encoded into the instruction.
 //  - register location otherwise.
-inline Location NEONEncodableConstantOrRegister(HInstruction* constant,
-                                                HInstruction* instr) {
-  if (constant->IsConstant()
-      && NEONCanEncodeConstantAsImmediate(constant->AsConstant(), instr)) {
+inline Location NEONEncodableConstantOrRegister(HInstruction* constant, HInstruction* instr) {
+  if (constant->IsConstant() && NEONCanEncodeConstantAsImmediate(constant->AsConstant(), instr)) {
     return Location::ConstantLocation(constant);
   }
 
@@ -1533,12 +1531,32 @@
   UNREACHABLE();
 }
 
-void LocationsBuilderARM64Neon::VisitVecPredCondition(HVecPredCondition* instruction) {
+void LocationsBuilderARM64Neon::VisitVecPredToBoolean(HVecPredToBoolean* instruction) {
   LOG(FATAL) << "No SIMD for " << instruction->GetId();
   UNREACHABLE();
 }
 
-void InstructionCodeGeneratorARM64Neon::VisitVecPredCondition(HVecPredCondition* instruction) {
+void InstructionCodeGeneratorARM64Neon::VisitVecPredToBoolean(HVecPredToBoolean* instruction) {
+  LOG(FATAL) << "No SIMD for " << instruction->GetId();
+  UNREACHABLE();
+}
+
+void LocationsBuilderARM64Neon::VisitVecCondition(HVecCondition* instruction) {
+  LOG(FATAL) << "No SIMD for " << instruction->GetId();
+  UNREACHABLE();
+}
+
+void InstructionCodeGeneratorARM64Neon::VisitVecCondition(HVecCondition* instruction) {
+  LOG(FATAL) << "No SIMD for " << instruction->GetId();
+  UNREACHABLE();
+}
+
+void LocationsBuilderARM64Neon::VisitVecPredNot(HVecPredNot* instruction) {
+  LOG(FATAL) << "No SIMD for " << instruction->GetId();
+  UNREACHABLE();
+}
+
+void InstructionCodeGeneratorARM64Neon::VisitVecPredNot(HVecPredNot* instruction) {
   LOG(FATAL) << "No SIMD for " << instruction->GetId();
   UNREACHABLE();
 }
diff --git a/compiler/optimizing/code_generator_vector_arm64_sve.cc b/compiler/optimizing/code_generator_vector_arm64_sve.cc
index fe15791..ef79932 100644
--- a/compiler/optimizing/code_generator_vector_arm64_sve.cc
+++ b/compiler/optimizing/code_generator_vector_arm64_sve.cc
@@ -62,8 +62,7 @@
 //    encoded into the instruction.
 //  - register location otherwise.
 inline Location SVEEncodableConstantOrRegister(HInstruction* constant, HInstruction* instr) {
-  if (constant->IsConstant()
-      && SVECanEncodeConstantAsImmediate(constant->AsConstant(), instr)) {
+  if (constant->IsConstant() && SVECanEncodeConstantAsImmediate(constant->AsConstant(), instr)) {
     return Location::ConstantLocation(constant);
   }
 
@@ -246,7 +245,7 @@
   LocationSummary* locations = instruction->GetLocations();
   const ZRegister src = ZRegisterFrom(locations->InAt(0));
   const VRegister dst = DRegisterFrom(locations->Out());
-  const PRegister p_reg = LoopPReg();
+  const PRegister p_reg = GetVecGoverningPReg(instruction);
   ValidateVectorLength(instruction);
   switch (instruction->GetPackedType()) {
     case DataType::Type::kInt32:
@@ -284,7 +283,7 @@
   LocationSummary* locations = instruction->GetLocations();
   const ZRegister src = ZRegisterFrom(locations->InAt(0));
   const ZRegister dst = ZRegisterFrom(locations->Out());
-  const PRegisterM p_reg = LoopPReg().Merging();
+  const PRegisterM p_reg = GetVecGoverningPReg(instruction).Merging();
   DataType::Type from = instruction->GetInputType();
   DataType::Type to = instruction->GetResultType();
   ValidateVectorLength(instruction);
@@ -304,7 +303,7 @@
   LocationSummary* locations = instruction->GetLocations();
   const ZRegister src = ZRegisterFrom(locations->InAt(0));
   const ZRegister dst = ZRegisterFrom(locations->Out());
-  const PRegisterM p_reg = LoopPReg().Merging();
+  const PRegisterM p_reg = GetVecGoverningPReg(instruction).Merging();
   ValidateVectorLength(instruction);
   switch (instruction->GetPackedType()) {
     case DataType::Type::kUint8:
@@ -342,7 +341,7 @@
   LocationSummary* locations = instruction->GetLocations();
   const ZRegister src = ZRegisterFrom(locations->InAt(0));
   const ZRegister dst = ZRegisterFrom(locations->Out());
-  const PRegisterM p_reg = LoopPReg().Merging();
+  const PRegisterM p_reg = GetVecGoverningPReg(instruction).Merging();
   ValidateVectorLength(instruction);
   switch (instruction->GetPackedType()) {
     case DataType::Type::kInt8:
@@ -378,7 +377,7 @@
   LocationSummary* locations = instruction->GetLocations();
   const ZRegister src = ZRegisterFrom(locations->InAt(0));
   const ZRegister dst = ZRegisterFrom(locations->Out());
-  const PRegisterM p_reg = LoopPReg().Merging();
+  const PRegisterM p_reg = GetVecGoverningPReg(instruction).Merging();
   ValidateVectorLength(instruction);
   switch (instruction->GetPackedType()) {
     case DataType::Type::kBool:  // special case boolean-not
@@ -438,7 +437,7 @@
   const ZRegister lhs = ZRegisterFrom(locations->InAt(0));
   const ZRegister rhs = ZRegisterFrom(locations->InAt(1));
   const ZRegister dst = ZRegisterFrom(locations->Out());
-  const PRegisterM p_reg = LoopPReg().Merging();
+  const PRegisterM p_reg = GetVecGoverningPReg(instruction).Merging();
   ValidateVectorLength(instruction);
   switch (instruction->GetPackedType()) {
     case DataType::Type::kUint8:
@@ -497,7 +496,7 @@
   const ZRegister lhs = ZRegisterFrom(locations->InAt(0));
   const ZRegister rhs = ZRegisterFrom(locations->InAt(1));
   const ZRegister dst = ZRegisterFrom(locations->Out());
-  const PRegisterM p_reg = LoopPReg().Merging();
+  const PRegisterM p_reg = GetVecGoverningPReg(instruction).Merging();
   ValidateVectorLength(instruction);
   switch (instruction->GetPackedType()) {
     case DataType::Type::kUint8:
@@ -546,7 +545,7 @@
   const ZRegister lhs = ZRegisterFrom(locations->InAt(0));
   const ZRegister rhs = ZRegisterFrom(locations->InAt(1));
   const ZRegister dst = ZRegisterFrom(locations->Out());
-  const PRegisterM p_reg = LoopPReg().Merging();
+  const PRegisterM p_reg = GetVecGoverningPReg(instruction).Merging();
   ValidateVectorLength(instruction);
   switch (instruction->GetPackedType()) {
     case DataType::Type::kUint8:
@@ -585,7 +584,7 @@
   const ZRegister lhs = ZRegisterFrom(locations->InAt(0));
   const ZRegister rhs = ZRegisterFrom(locations->InAt(1));
   const ZRegister dst = ZRegisterFrom(locations->Out());
-  const PRegisterM p_reg = LoopPReg().Merging();
+  const PRegisterM p_reg = GetVecGoverningPReg(instruction).Merging();
   ValidateVectorLength(instruction);
 
   // Note: VIXL guarantees StrictNaNPropagation for Fdiv.
@@ -633,7 +632,7 @@
   const ZRegister lhs = ZRegisterFrom(locations->InAt(0));
   const ZRegister rhs = ZRegisterFrom(locations->InAt(1));
   const ZRegister dst = ZRegisterFrom(locations->Out());
-  const PRegisterM p_reg = LoopPReg().Merging();
+  const PRegisterM p_reg = GetVecGoverningPReg(instruction).Merging();
   ValidateVectorLength(instruction);
   switch (instruction->GetPackedType()) {
     case DataType::Type::kBool:
@@ -678,7 +677,7 @@
   const ZRegister lhs = ZRegisterFrom(locations->InAt(0));
   const ZRegister rhs = ZRegisterFrom(locations->InAt(1));
   const ZRegister dst = ZRegisterFrom(locations->Out());
-  const PRegisterM p_reg = LoopPReg().Merging();
+  const PRegisterM p_reg = GetVecGoverningPReg(instruction).Merging();
   ValidateVectorLength(instruction);
   switch (instruction->GetPackedType()) {
     case DataType::Type::kBool:
@@ -714,7 +713,7 @@
   const ZRegister lhs = ZRegisterFrom(locations->InAt(0));
   const ZRegister rhs = ZRegisterFrom(locations->InAt(1));
   const ZRegister dst = ZRegisterFrom(locations->Out());
-  const PRegisterM p_reg = LoopPReg().Merging();
+  const PRegisterM p_reg = GetVecGoverningPReg(instruction).Merging();
   ValidateVectorLength(instruction);
   switch (instruction->GetPackedType()) {
     case DataType::Type::kBool:
@@ -769,7 +768,7 @@
   LocationSummary* locations = instruction->GetLocations();
   const ZRegister lhs = ZRegisterFrom(locations->InAt(0));
   const ZRegister dst = ZRegisterFrom(locations->Out());
-  const PRegisterM p_reg = LoopPReg().Merging();
+  const PRegisterM p_reg = GetVecGoverningPReg(instruction).Merging();
   int32_t value = locations->InAt(1).GetConstant()->AsIntConstant()->GetValue();
   ValidateVectorLength(instruction);
   switch (instruction->GetPackedType()) {
@@ -802,7 +801,7 @@
   LocationSummary* locations = instruction->GetLocations();
   const ZRegister lhs = ZRegisterFrom(locations->InAt(0));
   const ZRegister dst = ZRegisterFrom(locations->Out());
-  const PRegisterM p_reg = LoopPReg().Merging();
+  const PRegisterM p_reg = GetVecGoverningPReg(instruction).Merging();
   int32_t value = locations->InAt(1).GetConstant()->AsIntConstant()->GetValue();
   ValidateVectorLength(instruction);
   switch (instruction->GetPackedType()) {
@@ -835,7 +834,7 @@
   LocationSummary* locations = instruction->GetLocations();
   const ZRegister lhs = ZRegisterFrom(locations->InAt(0));
   const ZRegister dst = ZRegisterFrom(locations->Out());
-  const PRegisterM p_reg = LoopPReg().Merging();
+  const PRegisterM p_reg = GetVecGoverningPReg(instruction).Merging();
   int32_t value = locations->InAt(1).GetConstant()->AsIntConstant()->GetValue();
   ValidateVectorLength(instruction);
   switch (instruction->GetPackedType()) {
@@ -966,7 +965,7 @@
   const ZRegister acc = ZRegisterFrom(locations->InAt(0));
   const ZRegister left = ZRegisterFrom(locations->InAt(1));
   const ZRegister right = ZRegisterFrom(locations->InAt(2));
-  const PRegisterM p_reg = LoopPReg().Merging();
+  const PRegisterM p_reg = GetVecGoverningPReg(instruction).Merging();
 
   DCHECK(locations->InAt(0).Equals(locations->Out()));
   ValidateVectorLength(instruction);
@@ -1029,7 +1028,7 @@
   const ZRegister acc = ZRegisterFrom(locations->InAt(0));
   const ZRegister left = ZRegisterFrom(locations->InAt(1));
   const ZRegister right = ZRegisterFrom(locations->InAt(2));
-  const PRegisterM p_reg = LoopPReg().Merging();
+  const PRegisterM p_reg = GetVecGoverningPReg(instruction).Merging();
   HVecOperation* a = instruction->InputAt(1)->AsVecOperation();
   HVecOperation* b = instruction->InputAt(2)->AsVecOperation();
   DCHECK_EQ(HVecOperation::ToSignedType(a->GetPackedType()),
@@ -1099,7 +1098,7 @@
   const ZRegister reg = ZRegisterFrom(locations->Out());
   UseScratchRegisterScope temps(GetVIXLAssembler());
   Register scratch;
-  const PRegisterZ p_reg = LoopPReg().Zeroing();
+  const PRegisterZ p_reg = GetVecGoverningPReg(instruction).Zeroing();
   ValidateVectorLength(instruction);
 
   switch (instruction->GetPackedType()) {
@@ -1141,7 +1140,7 @@
   const ZRegister reg = ZRegisterFrom(locations->InAt(2));
   UseScratchRegisterScope temps(GetVIXLAssembler());
   Register scratch;
-  const PRegisterZ p_reg = LoopPReg().Zeroing();
+  const PRegisterZ p_reg = GetVecGoverningPReg(instruction).Zeroing();
   ValidateVectorLength(instruction);
 
   switch (instruction->GetPackedType()) {
@@ -1182,25 +1181,25 @@
 void InstructionCodeGeneratorARM64Sve::VisitVecPredSetAll(HVecPredSetAll* instruction) {
   // Instruction is not predicated, see nodes_vector.h
   DCHECK(!instruction->IsPredicated());
-  const PRegister p_reg = LoopPReg();
+  const PRegister output_p_reg = GetVecPredSetFixedOutPReg(instruction);
 
   switch (instruction->GetPackedType()) {
     case DataType::Type::kBool:
     case DataType::Type::kUint8:
     case DataType::Type::kInt8:
-      __ Ptrue(p_reg.VnB(), vixl::aarch64::SVE_ALL);
+      __ Ptrue(output_p_reg.VnB(), vixl::aarch64::SVE_ALL);
       break;
     case DataType::Type::kUint16:
     case DataType::Type::kInt16:
-      __ Ptrue(p_reg.VnH(), vixl::aarch64::SVE_ALL);
+      __ Ptrue(output_p_reg.VnH(), vixl::aarch64::SVE_ALL);
       break;
     case DataType::Type::kInt32:
     case DataType::Type::kFloat32:
-      __ Ptrue(p_reg.VnS(), vixl::aarch64::SVE_ALL);
+      __ Ptrue(output_p_reg.VnS(), vixl::aarch64::SVE_ALL);
       break;
     case DataType::Type::kInt64:
     case DataType::Type::kFloat64:
-      __ Ptrue(p_reg.VnD(), vixl::aarch64::SVE_ALL);
+      __ Ptrue(output_p_reg.VnD(), vixl::aarch64::SVE_ALL);
       break;
     default:
       LOG(FATAL) << "Unsupported SIMD type: " << instruction->GetPackedType();
@@ -1208,6 +1207,67 @@
   }
 }
 
+void LocationsBuilderARM64Sve::VisitVecCondition(HVecCondition* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  locations->SetInAt(0, Location::RequiresFpuRegister());
+  locations->SetInAt(1, Location::RequiresFpuRegister());
+  locations->SetOut(Location::RequiresRegister());
+}
+
+void InstructionCodeGeneratorARM64Sve::VisitVecCondition(HVecCondition* instruction) {
+  DCHECK(instruction->IsPredicated());
+  LocationSummary* locations = instruction->GetLocations();
+  const ZRegister left = ZRegisterFrom(locations->InAt(0));
+  const ZRegister right = ZRegisterFrom(locations->InAt(1));
+  const PRegisterZ p_reg = GetVecGoverningPReg(instruction).Zeroing();
+  const PRegister output_p_reg = GetVecPredSetFixedOutPReg(instruction);
+
+  HVecOperation* a = instruction->InputAt(0)->AsVecOperation();
+  HVecOperation* b = instruction->InputAt(1)->AsVecOperation();
+  DCHECK_EQ(HVecOperation::ToSignedType(a->GetPackedType()),
+            HVecOperation::ToSignedType(b->GetPackedType()));
+  ValidateVectorLength(instruction);
+
+  // TODO: Support other condition OPs and types.
+  switch (instruction->GetPackedType()) {
+    case DataType::Type::kUint8:
+    case DataType::Type::kInt8:
+      __ Cmpeq(output_p_reg.VnB(), p_reg, left.VnB(), right.VnB());
+      break;
+    case DataType::Type::kUint16:
+    case DataType::Type::kInt16:
+      __ Cmpeq(output_p_reg.VnH(), p_reg, left.VnH(), right.VnH());
+      break;
+    case DataType::Type::kInt32:
+      __ Cmpeq(output_p_reg.VnS(), p_reg, left.VnS(), right.VnS());
+      break;
+    case DataType::Type::kInt64:
+      __ Cmpeq(output_p_reg.VnD(), p_reg, left.VnD(), right.VnD());
+      break;
+    default:
+      LOG(FATAL) << "Unsupported SIMD type: " << instruction->GetPackedType();
+      UNREACHABLE();
+  }
+}
+
+void LocationsBuilderARM64Sve::VisitVecPredNot(HVecPredNot* instruction) {
+  LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
+  DCHECK(instruction->InputAt(0)->IsVecPredSetOperation());
+  locations->SetInAt(0, Location::NoLocation());
+  locations->SetOut(Location::RequiresRegister());
+}
+
+void InstructionCodeGeneratorARM64Sve::VisitVecPredNot(HVecPredNot* instruction) {
+  DCHECK(instruction->IsPredicated());
+
+  const PRegister input_p_reg = GetVecPredSetFixedOutPReg(
+      instruction->InputAt(0)->AsVecPredSetOperation());
+  const PRegister control_p_reg = GetVecGoverningPReg(instruction);
+  const PRegister output_p_reg = GetVecPredSetFixedOutPReg(instruction);
+
+  __ Not(output_p_reg.VnB(), control_p_reg.Zeroing(), input_p_reg.VnB());
+}
+
 void LocationsBuilderARM64Sve::VisitVecPredWhile(HVecPredWhile* instruction) {
   LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
   locations->SetInAt(0, Location::RequiresRegister());
@@ -1218,8 +1278,8 @@
   // Semantically, the out location of this instruction and predicate inputs locations of
   // its users should be a fixed predicate register (similar to
   // Location::RegisterLocation(int reg)). But the register allocator (RA) doesn't support
-  // SIMD regs (e.g. predicate), so LoopPReg() is used explicitly without exposing it
-  // to the RA.
+  // SIMD regs (e.g. predicate), so fixed registers are used explicitly without exposing it
+  // to the RA (through GetVecPredSetFixedOutPReg()).
   //
   // To make the RA happy Location::NoLocation() was used for all the vector instructions
   // predicate inputs; but for the PredSetOperations (e.g. VecPredWhile) Location::NoLocation()
@@ -1241,21 +1301,22 @@
   DCHECK(instruction->GetCondKind() == HVecPredWhile::CondKind::kLO);
   Register left = InputRegisterAt(instruction, 0);
   Register right = InputRegisterAt(instruction, 1);
+  const PRegister output_p_reg = GetVecPredSetFixedOutPReg(instruction);
 
   DCHECK_EQ(codegen_->GetSIMDRegisterWidth() % instruction->GetVectorLength(), 0u);
 
   switch (codegen_->GetSIMDRegisterWidth() / instruction->GetVectorLength()) {
     case 1u:
-      __ Whilelo(LoopPReg().VnB(), left, right);
+      __ Whilelo(output_p_reg.VnB(), left, right);
       break;
     case 2u:
-      __ Whilelo(LoopPReg().VnH(), left, right);
+      __ Whilelo(output_p_reg.VnH(), left, right);
       break;
     case 4u:
-      __ Whilelo(LoopPReg().VnS(), left, right);
+      __ Whilelo(output_p_reg.VnS(), left, right);
       break;
     case 8u:
-      __ Whilelo(LoopPReg().VnD(), left, right);
+      __ Whilelo(output_p_reg.VnD(), left, right);
       break;
     default:
       LOG(FATAL) << "Unsupported SIMD type: " << instruction->GetPackedType();
@@ -1263,20 +1324,20 @@
   }
 }
 
-void LocationsBuilderARM64Sve::VisitVecPredCondition(HVecPredCondition* instruction) {
+void LocationsBuilderARM64Sve::VisitVecPredToBoolean(HVecPredToBoolean* instruction) {
   LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(instruction);
   locations->SetInAt(0, Location::NoLocation());
   // Result of the operation - a boolean value in a core register.
   locations->SetOut(Location::RequiresRegister());
 }
 
-void InstructionCodeGeneratorARM64Sve::VisitVecPredCondition(HVecPredCondition* instruction) {
+void InstructionCodeGeneratorARM64Sve::VisitVecPredToBoolean(HVecPredToBoolean* instruction) {
   // Instruction is not predicated, see nodes_vector.h
   DCHECK(!instruction->IsPredicated());
   Register reg = OutputRegister(instruction);
-  // Currently VecPredCondition is only used as part of vectorized loop check condition
+  // Currently VecPredToBoolean is only used as part of vectorized loop check condition
   // evaluation.
-  DCHECK(instruction->GetPCondKind() == HVecPredCondition::PCondKind::kNFirst);
+  DCHECK(instruction->GetPCondKind() == HVecPredToBoolean::PCondKind::kNFirst);
   __ Cset(reg, pl);
 }
 
diff --git a/compiler/optimizing/code_generator_vector_arm_vixl.cc b/compiler/optimizing/code_generator_vector_arm_vixl.cc
index e8ecf28..70f22af 100644
--- a/compiler/optimizing/code_generator_vector_arm_vixl.cc
+++ b/compiler/optimizing/code_generator_vector_arm_vixl.cc
@@ -1069,12 +1069,32 @@
   UNREACHABLE();
 }
 
-void LocationsBuilderARMVIXL::VisitVecPredCondition(HVecPredCondition* instruction) {
+void LocationsBuilderARMVIXL::VisitVecPredToBoolean(HVecPredToBoolean* instruction) {
   LOG(FATAL) << "No SIMD for " << instruction->GetId();
   UNREACHABLE();
 }
 
-void InstructionCodeGeneratorARMVIXL::VisitVecPredCondition(HVecPredCondition* instruction) {
+void InstructionCodeGeneratorARMVIXL::VisitVecPredToBoolean(HVecPredToBoolean* instruction) {
+  LOG(FATAL) << "No SIMD for " << instruction->GetId();
+  UNREACHABLE();
+}
+
+void LocationsBuilderARMVIXL::VisitVecCondition(HVecCondition* instruction) {
+  LOG(FATAL) << "No SIMD for " << instruction->GetId();
+  UNREACHABLE();
+}
+
+void InstructionCodeGeneratorARMVIXL::VisitVecCondition(HVecCondition* instruction) {
+  LOG(FATAL) << "No SIMD for " << instruction->GetId();
+  UNREACHABLE();
+}
+
+void LocationsBuilderARMVIXL::VisitVecPredNot(HVecPredNot* instruction) {
+  LOG(FATAL) << "No SIMD for " << instruction->GetId();
+  UNREACHABLE();
+}
+
+void InstructionCodeGeneratorARMVIXL::VisitVecPredNot(HVecPredNot* instruction) {
   LOG(FATAL) << "No SIMD for " << instruction->GetId();
   UNREACHABLE();
 }
diff --git a/compiler/optimizing/code_generator_vector_x86.cc b/compiler/optimizing/code_generator_vector_x86.cc
index 343a6e1..1f9b257 100644
--- a/compiler/optimizing/code_generator_vector_x86.cc
+++ b/compiler/optimizing/code_generator_vector_x86.cc
@@ -1401,12 +1401,32 @@
   UNREACHABLE();
 }
 
-void LocationsBuilderX86::VisitVecPredCondition(HVecPredCondition* instruction) {
+void LocationsBuilderX86::VisitVecPredToBoolean(HVecPredToBoolean* instruction) {
   LOG(FATAL) << "No SIMD for " << instruction->GetId();
   UNREACHABLE();
 }
 
-void InstructionCodeGeneratorX86::VisitVecPredCondition(HVecPredCondition* instruction) {
+void InstructionCodeGeneratorX86::VisitVecPredToBoolean(HVecPredToBoolean* instruction) {
+  LOG(FATAL) << "No SIMD for " << instruction->GetId();
+  UNREACHABLE();
+}
+
+void LocationsBuilderX86::VisitVecCondition(HVecCondition* instruction) {
+  LOG(FATAL) << "No SIMD for " << instruction->GetId();
+  UNREACHABLE();
+}
+
+void InstructionCodeGeneratorX86::VisitVecCondition(HVecCondition* instruction) {
+  LOG(FATAL) << "No SIMD for " << instruction->GetId();
+  UNREACHABLE();
+}
+
+void LocationsBuilderX86::VisitVecPredNot(HVecPredNot* instruction) {
+  LOG(FATAL) << "No SIMD for " << instruction->GetId();
+  UNREACHABLE();
+}
+
+void InstructionCodeGeneratorX86::VisitVecPredNot(HVecPredNot* instruction) {
   LOG(FATAL) << "No SIMD for " << instruction->GetId();
   UNREACHABLE();
 }
diff --git a/compiler/optimizing/code_generator_vector_x86_64.cc b/compiler/optimizing/code_generator_vector_x86_64.cc
index fb6e4e7..47afa3b 100644
--- a/compiler/optimizing/code_generator_vector_x86_64.cc
+++ b/compiler/optimizing/code_generator_vector_x86_64.cc
@@ -1374,12 +1374,32 @@
   UNREACHABLE();
 }
 
-void LocationsBuilderX86_64::VisitVecPredCondition(HVecPredCondition* instruction) {
+void LocationsBuilderX86_64::VisitVecPredToBoolean(HVecPredToBoolean* instruction) {
   LOG(FATAL) << "No SIMD for " << instruction->GetId();
   UNREACHABLE();
 }
 
-void InstructionCodeGeneratorX86_64::VisitVecPredCondition(HVecPredCondition* instruction) {
+void InstructionCodeGeneratorX86_64::VisitVecPredToBoolean(HVecPredToBoolean* instruction) {
+  LOG(FATAL) << "No SIMD for " << instruction->GetId();
+  UNREACHABLE();
+}
+
+void LocationsBuilderX86_64::VisitVecCondition(HVecCondition* instruction) {
+  LOG(FATAL) << "No SIMD for " << instruction->GetId();
+  UNREACHABLE();
+}
+
+void InstructionCodeGeneratorX86_64::VisitVecCondition(HVecCondition* instruction) {
+  LOG(FATAL) << "No SIMD for " << instruction->GetId();
+  UNREACHABLE();
+}
+
+void LocationsBuilderX86_64::VisitVecPredNot(HVecPredNot* instruction) {
+  LOG(FATAL) << "No SIMD for " << instruction->GetId();
+  UNREACHABLE();
+}
+
+void InstructionCodeGeneratorX86_64::VisitVecPredNot(HVecPredNot* instruction) {
   LOG(FATAL) << "No SIMD for " << instruction->GetId();
   UNREACHABLE();
 }
diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc
index cb1cecc..21d3492 100644
--- a/compiler/optimizing/code_generator_x86.cc
+++ b/compiler/optimizing/code_generator_x86.cc
@@ -27,6 +27,7 @@
 #include "heap_poisoning.h"
 #include "interpreter/mterp/nterp.h"
 #include "intrinsics.h"
+#include "intrinsics_list.h"
 #include "intrinsics_utils.h"
 #include "intrinsics_x86.h"
 #include "jit/profiling_info.h"
@@ -36,11 +37,14 @@
 #include "mirror/class-inl.h"
 #include "mirror/var_handle.h"
 #include "optimizing/nodes.h"
+#include "profiling_info_builder.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread.h"
+#include "trace.h"
 #include "utils/assembler.h"
 #include "utils/stack_checks.h"
 #include "utils/x86/assembler_x86.h"
+#include "utils/x86/constants_x86.h"
 #include "utils/x86/managed_register_x86.h"
 
 namespace art HIDDEN {
@@ -66,7 +70,7 @@
   RegisterSet caller_saves = RegisterSet::Empty();
   caller_saves.Add(Location::RegisterLocation(calling_convention.GetRegisterAt(0)));
   // TODO: Add GetReturnLocation() to the calling convention so that we can DCHECK()
-  // that the the kPrimNot result register is the same as the first argument register.
+  // that the kPrimNot result register is the same as the first argument register.
   return caller_saves;
 }
 
@@ -503,18 +507,17 @@
       : SlowPathCode(instruction),
         ref_(ref),
         unpoison_ref_before_marking_(unpoison_ref_before_marking) {
-    DCHECK(gUseReadBarrier);
   }
 
   const char* GetDescription() const override { return "ReadBarrierMarkSlowPathX86"; }
 
   void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitReadBarrier());
     LocationSummary* locations = instruction_->GetLocations();
     Register ref_reg = ref_.AsRegister<Register>();
     DCHECK(locations->CanCall());
     DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(ref_reg)) << ref_reg;
     DCHECK(instruction_->IsInstanceFieldGet() ||
-           instruction_->IsPredicatedInstanceFieldGet() ||
            instruction_->IsStaticFieldGet() ||
            instruction_->IsArrayGet() ||
            instruction_->IsArraySet() ||
@@ -590,12 +593,12 @@
         field_addr_(field_addr),
         unpoison_ref_before_marking_(unpoison_ref_before_marking),
         temp_(temp) {
-    DCHECK(gUseReadBarrier);
   }
 
   const char* GetDescription() const override { return "ReadBarrierMarkAndUpdateFieldSlowPathX86"; }
 
   void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitReadBarrier());
     LocationSummary* locations = instruction_->GetLocations();
     Register ref_reg = ref_.AsRegister<Register>();
     DCHECK(locations->CanCall());
@@ -604,7 +607,9 @@
         << "Unexpected instruction in read barrier marking and field updating slow path: "
         << instruction_->DebugName();
     HInvoke* invoke = instruction_->AsInvoke();
-    DCHECK(IsUnsafeCASObject(invoke) || IsVarHandleCASFamily(invoke)) << invoke->GetIntrinsic();
+    DCHECK(IsUnsafeCASReference(invoke) ||
+           IsUnsafeGetAndSetReference(invoke) ||
+           IsVarHandleCASFamily(invoke)) << invoke->GetIntrinsic();
 
     __ Bind(GetEntryLabel());
     if (unpoison_ref_before_marking_) {
@@ -650,7 +655,7 @@
     __ cmpl(temp_, ref_reg);
     __ j(kEqual, &done);
 
-    // Update the the holder's field atomically.  This may fail if
+    // Update the holder's field atomically.  This may fail if
     // mutator updates before us, but it's OK.  This is achieved
     // using a strong compare-and-set (CAS) operation with relaxed
     // memory synchronization ordering, where the expected value is
@@ -744,7 +749,6 @@
         obj_(obj),
         offset_(offset),
         index_(index) {
-    DCHECK(gUseReadBarrier);
     // If `obj` is equal to `out` or `ref`, it means the initial object
     // has been overwritten by (or after) the heap object reference load
     // to be instrumented, e.g.:
@@ -759,13 +763,13 @@
   }
 
   void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitReadBarrier());
     CodeGeneratorX86* x86_codegen = down_cast<CodeGeneratorX86*>(codegen);
     LocationSummary* locations = instruction_->GetLocations();
     Register reg_out = out_.AsRegister<Register>();
     DCHECK(locations->CanCall());
     DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(reg_out));
     DCHECK(instruction_->IsInstanceFieldGet() ||
-           instruction_->IsPredicatedInstanceFieldGet() ||
            instruction_->IsStaticFieldGet() ||
            instruction_->IsArrayGet() ||
            instruction_->IsInstanceOf() ||
@@ -838,9 +842,11 @@
         DCHECK(instruction_->GetLocations()->Intrinsified());
         DCHECK((instruction_->AsInvoke()->GetIntrinsic() == Intrinsics::kUnsafeGetObject) ||
                (instruction_->AsInvoke()->GetIntrinsic() == Intrinsics::kUnsafeGetObjectVolatile) ||
-               (instruction_->AsInvoke()->GetIntrinsic() == Intrinsics::kJdkUnsafeGetObject) ||
-               (instruction_->AsInvoke()->GetIntrinsic() == Intrinsics::kJdkUnsafeGetObjectVolatile) ||
-               (instruction_->AsInvoke()->GetIntrinsic() == Intrinsics::kJdkUnsafeGetObjectAcquire))
+               (instruction_->AsInvoke()->GetIntrinsic() == Intrinsics::kJdkUnsafeGetReference) ||
+               (instruction_->AsInvoke()->GetIntrinsic() ==
+                    Intrinsics::kJdkUnsafeGetReferenceVolatile) ||
+               (instruction_->AsInvoke()->GetIntrinsic() ==
+                    Intrinsics::kJdkUnsafeGetReferenceAcquire))
             << instruction_->AsInvoke()->GetIntrinsic();
         DCHECK_EQ(offset_, 0U);
         DCHECK(index_.IsRegisterPair());
@@ -918,10 +924,10 @@
  public:
   ReadBarrierForRootSlowPathX86(HInstruction* instruction, Location out, Location root)
       : SlowPathCode(instruction), out_(out), root_(root) {
-    DCHECK(gUseReadBarrier);
   }
 
   void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitReadBarrier());
     LocationSummary* locations = instruction_->GetLocations();
     Register reg_out = out_.AsRegister<Register>();
     DCHECK(locations->CanCall());
@@ -985,13 +991,24 @@
 
 class CompileOptimizedSlowPathX86 : public SlowPathCode {
  public:
-  CompileOptimizedSlowPathX86() : SlowPathCode(/* instruction= */ nullptr) {}
+  CompileOptimizedSlowPathX86(HSuspendCheck* suspend_check, uint32_t counter_address)
+      : SlowPathCode(suspend_check),
+        counter_address_(counter_address) {}
 
   void EmitNativeCode(CodeGenerator* codegen) override {
     CodeGeneratorX86* x86_codegen = down_cast<CodeGeneratorX86*>(codegen);
     __ Bind(GetEntryLabel());
+    __ movw(Address::Absolute(counter_address_), Immediate(ProfilingInfo::GetOptimizeThreshold()));
+    if (instruction_ != nullptr) {
+      // Only saves full width XMM for SIMD.
+      SaveLiveRegisters(codegen, instruction_->GetLocations());
+    }
     x86_codegen->GenerateInvokeRuntime(
         GetThreadOffset<kX86PointerSize>(kQuickCompileOptimized).Int32Value());
+    if (instruction_ != nullptr) {
+      // Only restores full width XMM for SIMD.
+      RestoreLiveRegisters(codegen, instruction_->GetLocations());
+    }
     __ jmp(GetExitLabel());
   }
 
@@ -1000,6 +1017,8 @@
   }
 
  private:
+  uint32_t counter_address_;
+
   DISALLOW_COPY_AND_ASSIGN(CompileOptimizedSlowPathX86);
 };
 
@@ -1107,6 +1126,7 @@
 }
 
 namespace detail {
+
 // Mark which intrinsics we don't have handcrafted code for.
 template <Intrinsics T>
 struct IsUnimplemented {
@@ -1121,15 +1141,13 @@
 UNIMPLEMENTED_INTRINSIC_LIST_X86(TRUE_OVERRIDE)
 #undef TRUE_OVERRIDE
 
-#include "intrinsics_list.h"
 static constexpr bool kIsIntrinsicUnimplemented[] = {
-  false,  // kNone
+    false,  // kNone
 #define IS_UNIMPLEMENTED(Intrinsic, ...) \
-  IsUnimplemented<Intrinsics::k##Intrinsic>().is_unimplemented,
-  INTRINSICS_LIST(IS_UNIMPLEMENTED)
+    IsUnimplemented<Intrinsics::k##Intrinsic>().is_unimplemented,
+    ART_INTRINSICS_LIST(IS_UNIMPLEMENTED)
 #undef IS_UNIMPLEMENTED
 };
-#undef INTRINSICS_LIST
 
 }  // namespace detail
 
@@ -1140,8 +1158,7 @@
                     kNumberOfCpuRegisters,
                     kNumberOfXmmRegisters,
                     kNumberOfRegisterPairs,
-                    ComputeRegisterMask(reinterpret_cast<const int*>(kCoreCalleeSaves),
-                                        arraysize(kCoreCalleeSaves))
+                    ComputeRegisterMask(kCoreCalleeSaves, arraysize(kCoreCalleeSaves))
                         | (1 << kFakeReturnRegister),
                     0,
                     compiler_options,
@@ -1221,12 +1238,18 @@
   LocationSummary* locations = new (GetGraph()->GetAllocator())
       LocationSummary(method_hook, LocationSummary::kCallOnSlowPath);
   SetInForReturnValue(method_hook, locations);
+  // We use rdtsc to obtain a timestamp for tracing. rdtsc returns the results in EAX + EDX.
+  locations->AddTemp(Location::RegisterLocation(EAX));
+  locations->AddTemp(Location::RegisterLocation(EDX));
+  // An additional temporary register to hold address to store the timestamp counter.
+  locations->AddTemp(Location::RequiresRegister());
 }
 
 void InstructionCodeGeneratorX86::GenerateMethodEntryExitHook(HInstruction* instruction) {
   SlowPathCode* slow_path =
       new (codegen_->GetScopedAllocator()) MethodEntryExitHooksSlowPathX86(instruction);
   codegen_->AddSlowPath(slow_path);
+  LocationSummary* locations = instruction->GetLocations();
 
   if (instruction->IsMethodExitHook()) {
     // Check if we are required to check if the caller needs a deoptimization. Strictly speaking it
@@ -1242,8 +1265,51 @@
   MemberOffset  offset = instruction->IsMethodExitHook() ?
       instrumentation::Instrumentation::HaveMethodExitListenersOffset() :
       instrumentation::Instrumentation::HaveMethodEntryListenersOffset();
-  __ cmpb(Address::Absolute(address + offset.Int32Value()), Immediate(0));
-  __ j(kNotEqual, slow_path->GetEntryLabel());
+  __ cmpb(Address::Absolute(address + offset.Int32Value()),
+          Immediate(instrumentation::Instrumentation::kFastTraceListeners));
+  // Check if there are any trace method entry / exit listeners. If no, continue.
+  __ j(kLess, slow_path->GetExitLabel());
+  // Check if there are any slow (jvmti / trace with thread cpu time) method entry / exit listeners.
+  // If yes, just take the slow path.
+  __ j(kGreater, slow_path->GetEntryLabel());
+
+  // For entry_addr use the first temp that isn't EAX or EDX. We need this after
+  // rdtsc which returns values in EAX + EDX.
+  Register entry_addr = locations->GetTemp(2).AsRegister<Register>();
+  Register index = locations->GetTemp(1).AsRegister<Register>();
+
+  // Check if there is place in the buffer for a new entry, if no, take slow path.
+  uint32_t trace_buffer_ptr = Thread::TraceBufferPtrOffset<kX86PointerSize>().Int32Value();
+  uint64_t trace_buffer_index_offset =
+      Thread::TraceBufferIndexOffset<kX86PointerSize>().Int32Value();
+
+  __ fs()->movl(index, Address::Absolute(trace_buffer_index_offset));
+  __ subl(index, Immediate(kNumEntriesForWallClock));
+  __ j(kLess, slow_path->GetEntryLabel());
+
+  // Update the index in the `Thread`.
+  __ fs()->movl(Address::Absolute(trace_buffer_index_offset), index);
+  // Calculate the entry address in the buffer.
+  // entry_addr = base_addr + sizeof(void*) * index
+  __ fs()->movl(entry_addr, Address::Absolute(trace_buffer_ptr));
+  __ leal(entry_addr, Address(entry_addr, index, TIMES_4, 0));
+
+  // Record method pointer and trace action.
+  Register method = index;
+  __ movl(method, Address(ESP, kCurrentMethodStackOffset));
+  // Use last two bits to encode trace method action. For MethodEntry it is 0
+  // so no need to set the bits since they are 0 already.
+  if (instruction->IsMethodExitHook()) {
+    DCHECK_GE(ArtMethod::Alignment(kRuntimePointerSize), static_cast<size_t>(4));
+    static_assert(enum_cast<int32_t>(TraceAction::kTraceMethodEnter) == 0);
+    static_assert(enum_cast<int32_t>(TraceAction::kTraceMethodExit) == 1);
+    __ orl(method, Immediate(enum_cast<int32_t>(TraceAction::kTraceMethodExit)));
+  }
+  __ movl(Address(entry_addr, kMethodOffsetInBytes), method);
+  // Get the timestamp. rdtsc returns timestamp in EAX + EDX.
+  __ rdtsc();
+  __ movl(Address(entry_addr, kTimestampOffsetInBytes), EAX);
+  __ movl(Address(entry_addr, kHighTimestampOffsetInBytes), EDX);
   __ Bind(slow_path->GetExitLabel());
 }
 
@@ -1254,7 +1320,13 @@
 }
 
 void LocationsBuilderX86::VisitMethodEntryHook(HMethodEntryHook* method_hook) {
-  new (GetGraph()->GetAllocator()) LocationSummary(method_hook, LocationSummary::kCallOnSlowPath);
+  LocationSummary* locations = new (GetGraph()->GetAllocator())
+      LocationSummary(method_hook, LocationSummary::kCallOnSlowPath);
+  // We use rdtsc to obtain a timestamp for tracing. rdtsc returns the results in EAX + EDX.
+  locations->AddTemp(Location::RegisterLocation(EAX));
+  locations->AddTemp(Location::RegisterLocation(EDX));
+  // An additional temporary register to hold address to store the timestamp counter.
+  locations->AddTemp(Location::RequiresRegister());
 }
 
 void InstructionCodeGeneratorX86::VisitMethodEntryHook(HMethodEntryHook* instruction) {
@@ -1263,7 +1335,7 @@
   GenerateMethodEntryExitHook(instruction);
 }
 
-void CodeGeneratorX86::MaybeIncrementHotness(bool is_frame_entry) {
+void CodeGeneratorX86::MaybeIncrementHotness(HSuspendCheck* suspend_check, bool is_frame_entry) {
   if (GetCompilerOptions().CountHotnessInCompiledCode()) {
     Register reg = EAX;
     if (is_frame_entry) {
@@ -1285,14 +1357,17 @@
     }
   }
 
-  if (GetGraph()->IsCompilingBaseline() && !Runtime::Current()->IsAotCompiler()) {
-    SlowPathCode* slow_path = new (GetScopedAllocator()) CompileOptimizedSlowPathX86();
-    AddSlowPath(slow_path);
+  if (GetGraph()->IsCompilingBaseline() &&
+      GetGraph()->IsUsefulOptimizing() &&
+      !Runtime::Current()->IsAotCompiler()) {
     ProfilingInfo* info = GetGraph()->GetProfilingInfo();
     DCHECK(info != nullptr);
     uint32_t address = reinterpret_cast32<uint32_t>(info) +
         ProfilingInfo::BaselineHotnessCountOffset().Int32Value();
     DCHECK(!HasEmptyFrame());
+    SlowPathCode* slow_path =
+        new (GetScopedAllocator()) CompileOptimizedSlowPathX86(suspend_check, address);
+    AddSlowPath(slow_path);
     // With multiple threads, this can overflow. This is OK, we will eventually get to see
     // it reaching 0. Also, at this point we have no register available to look
     // at the counter directly.
@@ -1354,6 +1429,9 @@
   }
 
   if (!HasEmptyFrame()) {
+    // Make sure the frame size isn't unreasonably large.
+    DCHECK_LE(GetFrameSize(), GetMaximumFrameSize());
+
     for (int i = arraysize(kCoreCalleeSaves) - 1; i >= 0; --i) {
       Register reg = kCoreCalleeSaves[i];
       if (allocated_registers_.ContainsCoreRegister(reg)) {
@@ -1378,7 +1456,7 @@
     }
   }
 
-  MaybeIncrementHotness(/* is_frame_entry= */ true);
+  MaybeIncrementHotness(/* suspend_check= */ nullptr, /* is_frame_entry= */ true);
 }
 
 void CodeGeneratorX86::GenerateFrameExit() {
@@ -1700,7 +1778,7 @@
       __ movsd(dst.AsFpuRegister<XmmRegister>(), src);
       break;
     case DataType::Type::kReference:
-      DCHECK(!gUseReadBarrier);
+      DCHECK(!EmitReadBarrier());
       __ movl(dst.AsRegister<Register>(), src);
       __ MaybeUnpoisonHeapReference(dst.AsRegister<Register>());
       break;
@@ -1829,7 +1907,7 @@
 
   HLoopInformation* info = block->GetLoopInformation();
   if (info != nullptr && info->IsBackEdge(*block) && info->HasSuspendCheck()) {
-    codegen_->MaybeIncrementHotness(/* is_frame_entry= */ false);
+    codegen_->MaybeIncrementHotness(info->GetSuspendCheck(), /* is_frame_entry= */ false);
     GenerateSuspendCheck(info->GetSuspendCheck(), successor);
     return;
   }
@@ -1865,8 +1943,7 @@
   exit->SetLocations(nullptr);
 }
 
-void InstructionCodeGeneratorX86::VisitExit(HExit* exit ATTRIBUTE_UNUSED) {
-}
+void InstructionCodeGeneratorX86::VisitExit([[maybe_unused]] HExit* exit) {}
 
 template<class LabelType>
 void InstructionCodeGeneratorX86::GenerateFPJumps(HCondition* cond,
@@ -1981,7 +2058,7 @@
                                                     Location rhs,
                                                     HInstruction* insn,
                                                     bool is_double) {
-  HX86LoadFromConstantTable* const_area = insn->InputAt(1)->AsX86LoadFromConstantTable();
+  HX86LoadFromConstantTable* const_area = insn->InputAt(1)->AsX86LoadFromConstantTableOrNull();
   if (is_double) {
     if (rhs.IsFpuRegister()) {
       __ ucomisd(lhs.AsFpuRegister<XmmRegister>(), rhs.AsFpuRegister<XmmRegister>());
@@ -2053,14 +2130,18 @@
   }
 }
 
-static bool AreEflagsSetFrom(HInstruction* cond, HInstruction* branch) {
+static bool AreEflagsSetFrom(HInstruction* cond,
+                             HInstruction* branch,
+                             const CompilerOptions& compiler_options) {
   // Moves may affect the eflags register (move zero uses xorl), so the EFLAGS
   // are set only strictly before `branch`. We can't use the eflags on long/FP
   // conditions if they are materialized due to the complex branching.
   return cond->IsCondition() &&
          cond->GetNext() == branch &&
          cond->InputAt(0)->GetType() != DataType::Type::kInt64 &&
-         !DataType::IsFloatingPointType(cond->InputAt(0)->GetType());
+         !DataType::IsFloatingPointType(cond->InputAt(0)->GetType()) &&
+         !(cond->GetBlock()->GetGraph()->IsCompilingBaseline() &&
+           compiler_options.ProfileBranches());
 }
 
 template<class LabelType>
@@ -2097,7 +2178,7 @@
   //        - condition true => branch to true_target
   //        - branch to false_target
   if (IsBooleanValueOrMaterializedCondition(cond)) {
-    if (AreEflagsSetFrom(cond, instruction)) {
+    if (AreEflagsSetFrom(cond, instruction, codegen_->GetCompilerOptions())) {
       if (true_target == nullptr) {
         __ j(X86Condition(cond->AsCondition()->GetOppositeCondition()), false_target);
       } else {
@@ -2151,7 +2232,15 @@
 void LocationsBuilderX86::VisitIf(HIf* if_instr) {
   LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(if_instr);
   if (IsBooleanValueOrMaterializedCondition(if_instr->InputAt(0))) {
-    locations->SetInAt(0, Location::Any());
+    if (GetGraph()->IsCompilingBaseline() &&
+        codegen_->GetCompilerOptions().ProfileBranches() &&
+        !Runtime::Current()->IsAotCompiler()) {
+      locations->SetInAt(0, Location::RequiresRegister());
+      locations->AddTemp(Location::RequiresRegister());
+      locations->AddTemp(Location::RequiresRegister());
+    } else {
+      locations->SetInAt(0, Location::Any());
+    }
   }
 }
 
@@ -2162,6 +2251,34 @@
       nullptr : codegen_->GetLabelOf(true_successor);
   Label* false_target = codegen_->GoesToNextBlock(if_instr->GetBlock(), false_successor) ?
       nullptr : codegen_->GetLabelOf(false_successor);
+  if (IsBooleanValueOrMaterializedCondition(if_instr->InputAt(0))) {
+    if (GetGraph()->IsCompilingBaseline() &&
+        codegen_->GetCompilerOptions().ProfileBranches() &&
+        !Runtime::Current()->IsAotCompiler()) {
+      DCHECK(if_instr->InputAt(0)->IsCondition());
+      Register temp = if_instr->GetLocations()->GetTemp(0).AsRegister<Register>();
+      Register counter = if_instr->GetLocations()->GetTemp(1).AsRegister<Register>();
+      ProfilingInfo* info = GetGraph()->GetProfilingInfo();
+      DCHECK(info != nullptr);
+      BranchCache* cache = info->GetBranchCache(if_instr->GetDexPc());
+      // Currently, not all If branches are profiled.
+      if (cache != nullptr) {
+        uint64_t address =
+            reinterpret_cast64<uint64_t>(cache) + BranchCache::FalseOffset().Int32Value();
+        static_assert(
+            BranchCache::TrueOffset().Int32Value() - BranchCache::FalseOffset().Int32Value() == 2,
+            "Unexpected offsets for BranchCache");
+        NearLabel done;
+        Location lhs = if_instr->GetLocations()->InAt(0);
+        __ movl(temp, Immediate(address));
+        __ movzxw(counter, Address(temp, lhs.AsRegister<Register>(), TIMES_2, 0));
+        __ addw(counter, Immediate(1));
+        __ j(kEqual, &done);
+        __ movw(Address(temp, lhs.AsRegister<Register>(), TIMES_2, 0), counter);
+        __ Bind(&done);
+      }
+    }
+  }
   GenerateTestAndBranch(if_instr, /* condition_input_index= */ 0, true_target, false_target);
 }
 
@@ -2257,7 +2374,7 @@
       if (!condition->IsEmittedAtUseSite()) {
         // This was a previously materialized condition.
         // Can we use the existing condition code?
-        if (AreEflagsSetFrom(condition, select)) {
+        if (AreEflagsSetFrom(condition, select, codegen_->GetCompilerOptions())) {
           // Materialization was the previous instruction. Condition codes are right.
           cond = X86Condition(condition->GetCondition());
         } else {
@@ -2506,7 +2623,7 @@
   locations->SetOut(Location::ConstantLocation(constant));
 }
 
-void InstructionCodeGeneratorX86::VisitIntConstant(HIntConstant* constant ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86::VisitIntConstant([[maybe_unused]] HIntConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -2516,7 +2633,7 @@
   locations->SetOut(Location::ConstantLocation(constant));
 }
 
-void InstructionCodeGeneratorX86::VisitNullConstant(HNullConstant* constant ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86::VisitNullConstant([[maybe_unused]] HNullConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -2526,7 +2643,7 @@
   locations->SetOut(Location::ConstantLocation(constant));
 }
 
-void InstructionCodeGeneratorX86::VisitLongConstant(HLongConstant* constant ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86::VisitLongConstant([[maybe_unused]] HLongConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -2536,7 +2653,7 @@
   locations->SetOut(Location::ConstantLocation(constant));
 }
 
-void InstructionCodeGeneratorX86::VisitFloatConstant(HFloatConstant* constant ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86::VisitFloatConstant([[maybe_unused]] HFloatConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -2546,7 +2663,7 @@
   locations->SetOut(Location::ConstantLocation(constant));
 }
 
-void InstructionCodeGeneratorX86::VisitDoubleConstant(HDoubleConstant* constant ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86::VisitDoubleConstant([[maybe_unused]] HDoubleConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -2555,7 +2672,7 @@
 }
 
 void InstructionCodeGeneratorX86::VisitConstructorFence(
-    HConstructorFence* constructor_fence ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HConstructorFence* constructor_fence) {
   codegen_->GenerateMemoryBarrier(MemBarrierKind::kStoreStore);
 }
 
@@ -2571,7 +2688,7 @@
   ret->SetLocations(nullptr);
 }
 
-void InstructionCodeGeneratorX86::VisitReturnVoid(HReturnVoid* ret ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86::VisitReturnVoid([[maybe_unused]] HReturnVoid* ret) {
   codegen_->GenerateFrameExit();
 }
 
@@ -2697,7 +2814,7 @@
 
   HandleInvoke(invoke);
 
-  if (GetGraph()->IsCompilingBaseline() && !Runtime::Current()->IsAotCompiler()) {
+  if (ProfilingInfoBuilder::IsInlineCacheUseful(invoke, codegen_)) {
     // Add one temporary for inline cache update.
     invoke->GetLocations()->AddTemp(Location::RegisterLocation(EBP));
   }
@@ -2725,7 +2842,7 @@
   // Add the hidden argument.
   invoke->GetLocations()->AddTemp(Location::FpuRegisterLocation(XMM7));
 
-  if (GetGraph()->IsCompilingBaseline() && !Runtime::Current()->IsAotCompiler()) {
+  if (ProfilingInfoBuilder::IsInlineCacheUseful(invoke, codegen_)) {
     // Add one temporary for inline cache update.
     invoke->GetLocations()->AddTemp(Location::RegisterLocation(EBP));
   }
@@ -2743,29 +2860,31 @@
 
 void CodeGeneratorX86::MaybeGenerateInlineCacheCheck(HInstruction* instruction, Register klass) {
   DCHECK_EQ(EAX, klass);
-  // We know the destination of an intrinsic, so no need to record inline
-  // caches (also the intrinsic location builder doesn't request an additional
-  // temporary).
-  if (!instruction->GetLocations()->Intrinsified() &&
-      GetGraph()->IsCompilingBaseline() &&
-      !Runtime::Current()->IsAotCompiler()) {
-    DCHECK(!instruction->GetEnvironment()->IsFromInlinedInvoke());
+  if (ProfilingInfoBuilder::IsInlineCacheUseful(instruction->AsInvoke(), this)) {
     ProfilingInfo* info = GetGraph()->GetProfilingInfo();
     DCHECK(info != nullptr);
-    InlineCache* cache = info->GetInlineCache(instruction->GetDexPc());
-    uint32_t address = reinterpret_cast32<uint32_t>(cache);
-    if (kIsDebugBuild) {
-      uint32_t temp_index = instruction->GetLocations()->GetTempCount() - 1u;
-      CHECK_EQ(EBP, instruction->GetLocations()->GetTemp(temp_index).AsRegister<Register>());
+    InlineCache* cache = ProfilingInfoBuilder::GetInlineCache(
+        info, GetCompilerOptions(), instruction->AsInvoke());
+    if (cache != nullptr) {
+      uint32_t address = reinterpret_cast32<uint32_t>(cache);
+      if (kIsDebugBuild) {
+        uint32_t temp_index = instruction->GetLocations()->GetTempCount() - 1u;
+        CHECK_EQ(EBP, instruction->GetLocations()->GetTemp(temp_index).AsRegister<Register>());
+      }
+      Register temp = EBP;
+      NearLabel done;
+      __ movl(temp, Immediate(address));
+      // Fast path for a monomorphic cache.
+      __ cmpl(klass, Address(temp, InlineCache::ClassesOffset().Int32Value()));
+      __ j(kEqual, &done);
+      GenerateInvokeRuntime(GetThreadOffset<kX86PointerSize>(kQuickUpdateInlineCache).Int32Value());
+      __ Bind(&done);
+    } else {
+      // This is unexpected, but we don't guarantee stable compilation across
+      // JIT runs so just warn about it.
+      ScopedObjectAccess soa(Thread::Current());
+      LOG(WARNING) << "Missing inline cache for " << GetGraph()->GetArtMethod()->PrettyMethod();
     }
-    Register temp = EBP;
-    NearLabel done;
-    __ movl(temp, Immediate(address));
-    // Fast path for a monomorphic cache.
-    __ cmpl(klass, Address(temp, InlineCache::ClassesOffset().Int32Value()));
-    __ j(kEqual, &done);
-    GenerateInvokeRuntime(GetThreadOffset<kX86PointerSize>(kQuickUpdateInlineCache).Int32Value());
-    __ Bind(&done);
   }
 }
 
@@ -2954,10 +3073,10 @@
                                                  constant_area));
     __ xorps(out.AsFpuRegister<XmmRegister>(), mask);
   } else {
-     __ movsd(mask, codegen_->LiteralInt64Address(INT64_C(0x8000000000000000),
-                                                  neg->GetBaseMethodAddress(),
-                                                  constant_area));
-     __ xorpd(out.AsFpuRegister<XmmRegister>(), mask);
+    __ movsd(mask, codegen_->LiteralInt64Address(INT64_C(0x8000000000000000),
+                                                 neg->GetBaseMethodAddress(),
+                                                 constant_area));
+    __ xorpd(out.AsFpuRegister<XmmRegister>(), mask);
   }
 }
 
@@ -5086,8 +5205,7 @@
 }
 
 void InstructionCodeGeneratorX86::VisitParameterValue(
-    HParameterValue* instruction ATTRIBUTE_UNUSED) {
-}
+    [[maybe_unused]] HParameterValue* instruction) {}
 
 void LocationsBuilderX86::VisitCurrentMethod(HCurrentMethod* instruction) {
   LocationSummary* locations =
@@ -5095,7 +5213,7 @@
   locations->SetOut(Location::RegisterLocation(kMethodRegisterArgument));
 }
 
-void InstructionCodeGeneratorX86::VisitCurrentMethod(HCurrentMethod* instruction ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86::VisitCurrentMethod([[maybe_unused]] HCurrentMethod* instruction) {
 }
 
 void LocationsBuilderX86::VisitClassTableGet(HClassTableGet* instruction) {
@@ -5294,7 +5412,7 @@
   locations->SetOut(Location::Any());
 }
 
-void InstructionCodeGeneratorX86::VisitPhi(HPhi* instruction ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86::VisitPhi([[maybe_unused]] HPhi* instruction) {
   LOG(FATAL) << "Unreachable";
 }
 
@@ -5323,8 +5441,8 @@
 }
 
 HInvokeStaticOrDirect::DispatchInfo CodeGeneratorX86::GetSupportedInvokeStaticOrDirectDispatch(
-      const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info,
-      ArtMethod* method ATTRIBUTE_UNUSED) {
+    const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info,
+    [[maybe_unused]] ArtMethod* method) {
   return desired_dispatch_info;
 }
 
@@ -5679,7 +5797,7 @@
 void CodeGeneratorX86::LoadIntrinsicDeclaringClass(Register reg, HInvokeStaticOrDirect* invoke) {
   DCHECK_NE(invoke->GetIntrinsic(), Intrinsics::kNone);
   if (GetCompilerOptions().IsBootImage()) {
-    // Load the class the same way as for HLoadClass::LoadKind::kBootImageLinkTimePcRelative.
+    // Load the type the same way as for HLoadClass::LoadKind::kBootImageLinkTimePcRelative.
     HX86ComputeBaseMethodAddress* method_address =
         invoke->InputAt(invoke->GetSpecialInputIndex())->AsX86ComputeBaseMethodAddress();
     DCHECK(method_address != nullptr);
@@ -5770,17 +5888,23 @@
   DCHECK_EQ(size, linker_patches->size());
 }
 
-void CodeGeneratorX86::MarkGCCard(
+void CodeGeneratorX86::MaybeMarkGCCard(
     Register temp, Register card, Register object, Register value, bool emit_null_check) {
   NearLabel is_null;
   if (emit_null_check) {
     __ testl(value, value);
     __ j(kEqual, &is_null);
   }
+  MarkGCCard(temp, card, object);
+  if (emit_null_check) {
+    __ Bind(&is_null);
+  }
+}
+
+void CodeGeneratorX86::MarkGCCard(Register temp, Register card, Register object) {
   // Load the address of the card table into `card`.
   __ fs()->movl(card, Address::Absolute(Thread::CardTableOffset<kX86PointerSize>().Int32Value()));
-  // Calculate the offset (in the card table) of the card corresponding to
-  // `object`.
+  // Calculate the offset (in the card table) of the card corresponding to `object`.
   __ movl(temp, object);
   __ shrl(temp, Immediate(gc::accounting::CardTable::kCardShift));
   // Write the `art::gc::accounting::CardTable::kCardDirty` value into the
@@ -5798,51 +5922,53 @@
   // (no need to explicitly load `kCardDirty` as an immediate value).
   __ movb(Address(temp, card, TIMES_1, 0),
           X86ManagedRegister::FromCpuRegister(card).AsByteRegister());
-  if (emit_null_check) {
-    __ Bind(&is_null);
-  }
+}
+
+void CodeGeneratorX86::CheckGCCardIsValid(Register temp, Register card, Register object) {
+  NearLabel done;
+  __ j(kEqual, &done);
+  // Load the address of the card table into `card`.
+  __ fs()->movl(card, Address::Absolute(Thread::CardTableOffset<kX86PointerSize>().Int32Value()));
+  // Calculate the offset (in the card table) of the card corresponding to `object`.
+  __ movl(temp, object);
+  __ shrl(temp, Immediate(gc::accounting::CardTable::kCardShift));
+  // assert (!clean || !self->is_gc_marking)
+  __ cmpb(Address(temp, card, TIMES_1, 0), Immediate(gc::accounting::CardTable::kCardClean));
+  __ j(kNotEqual, &done);
+  __ fs()->cmpl(Address::Absolute(Thread::IsGcMarkingOffset<kX86PointerSize>()), Immediate(0));
+  __ j(kEqual, &done);
+  __ int3();
+  __ Bind(&done);
 }
 
 void LocationsBuilderX86::HandleFieldGet(HInstruction* instruction, const FieldInfo& field_info) {
-  DCHECK(instruction->IsInstanceFieldGet() ||
-         instruction->IsStaticFieldGet() ||
-         instruction->IsPredicatedInstanceFieldGet());
+  DCHECK(instruction->IsInstanceFieldGet() || instruction->IsStaticFieldGet());
 
   bool object_field_get_with_read_barrier =
-      gUseReadBarrier && (instruction->GetType() == DataType::Type::kReference);
-  bool is_predicated = instruction->IsPredicatedInstanceFieldGet();
+      (instruction->GetType() == DataType::Type::kReference) && codegen_->EmitReadBarrier();
   LocationSummary* locations =
       new (GetGraph()->GetAllocator()) LocationSummary(instruction,
-                                                       gUseReadBarrier
+                                                       codegen_->EmitReadBarrier()
                                                            ? LocationSummary::kCallOnSlowPath
                                                            : LocationSummary::kNoCall);
   if (object_field_get_with_read_barrier && kUseBakerReadBarrier) {
     locations->SetCustomSlowPathCallerSaves(RegisterSet::Empty());  // No caller-save registers.
   }
   // receiver_input
-  locations->SetInAt(is_predicated ? 1 : 0, Location::RequiresRegister());
-  if (is_predicated) {
-    if (DataType::IsFloatingPointType(instruction->GetType())) {
-      locations->SetInAt(0, Location::RequiresFpuRegister());
-    } else {
-      locations->SetInAt(0, Location::RequiresRegister());
-    }
-  }
+  locations->SetInAt(0, Location::RequiresRegister());
   if (DataType::IsFloatingPointType(instruction->GetType())) {
-    locations->SetOut(is_predicated ? Location::SameAsFirstInput()
-                                    : Location::RequiresFpuRegister());
+    locations->SetOut(Location::RequiresFpuRegister());
   } else {
     // The output overlaps in case of long: we don't want the low move
     // to overwrite the object's location.  Likewise, in the case of
     // an object field get with read barriers enabled, we do not want
     // the move to overwrite the object's location, as we need it to emit
     // the read barrier.
-    locations->SetOut(is_predicated ? Location::SameAsFirstInput() : Location::RequiresRegister(),
-                      (object_field_get_with_read_barrier ||
-                       instruction->GetType() == DataType::Type::kInt64 ||
-                       is_predicated)
-                          ? Location::kOutputOverlap
-                          : Location::kNoOutputOverlap);
+    locations->SetOut(
+        Location::RequiresRegister(),
+        (object_field_get_with_read_barrier || instruction->GetType() == DataType::Type::kInt64)
+            ? Location::kOutputOverlap
+            : Location::kNoOutputOverlap);
   }
 
   if (field_info.IsVolatile() && (field_info.GetFieldType() == DataType::Type::kInt64)) {
@@ -5856,12 +5982,10 @@
 
 void InstructionCodeGeneratorX86::HandleFieldGet(HInstruction* instruction,
                                                  const FieldInfo& field_info) {
-  DCHECK(instruction->IsInstanceFieldGet() ||
-         instruction->IsStaticFieldGet() ||
-         instruction->IsPredicatedInstanceFieldGet());
+  DCHECK(instruction->IsInstanceFieldGet() || instruction->IsStaticFieldGet());
 
   LocationSummary* locations = instruction->GetLocations();
-  Location base_loc = locations->InAt(instruction->IsPredicatedInstanceFieldGet() ? 1 : 0);
+  Location base_loc = locations->InAt(0);
   Register base = base_loc.AsRegister<Register>();
   Location out = locations->Out();
   bool is_volatile = field_info.IsVolatile();
@@ -5871,7 +5995,7 @@
 
   if (load_type == DataType::Type::kReference) {
     // /* HeapReference<Object> */ out = *(base + offset)
-    if (gUseReadBarrier && kUseBakerReadBarrier) {
+    if (codegen_->EmitBakerReadBarrier()) {
       // Note that a potential implicit null check is handled in this
       // CodeGeneratorX86::GenerateFieldLoadWithBakerReadBarrier call.
       codegen_->GenerateFieldLoadWithBakerReadBarrier(
@@ -5940,14 +6064,17 @@
   } else {
     locations->SetInAt(1, Location::RegisterOrConstant(instruction->InputAt(1)));
 
-    if (CodeGenerator::StoreNeedsWriteBarrier(field_type, instruction->InputAt(1))) {
-      if (write_barrier_kind != WriteBarrierKind::kDontEmit) {
-        locations->AddTemp(Location::RequiresRegister());
-        // Ensure the card is in a byte register.
-        locations->AddTemp(Location::RegisterLocation(ECX));
-      } else if (kPoisonHeapReferences) {
-        locations->AddTemp(Location::RequiresRegister());
-      }
+    bool needs_write_barrier =
+        codegen_->StoreNeedsWriteBarrier(field_type, instruction->InputAt(1), write_barrier_kind);
+    bool check_gc_card =
+        codegen_->ShouldCheckGCCard(field_type, instruction->InputAt(1), write_barrier_kind);
+
+    if (needs_write_barrier || check_gc_card) {
+      locations->AddTemp(Location::RequiresRegister());
+      // Ensure the card is in a byte register.
+      locations->AddTemp(Location::RegisterLocation(ECX));
+    } else if (kPoisonHeapReferences && field_type == DataType::Type::kReference) {
+      locations->AddTemp(Location::RequiresRegister());
     }
   }
 }
@@ -5963,7 +6090,7 @@
   LocationSummary* locations = instruction->GetLocations();
   Location value = locations->InAt(value_index);
   bool needs_write_barrier =
-      CodeGenerator::StoreNeedsWriteBarrier(field_type, instruction->InputAt(value_index));
+      codegen_->StoreNeedsWriteBarrier(field_type, instruction->InputAt(1), write_barrier_kind);
 
   if (is_volatile) {
     codegen_->GenerateMemoryBarrier(MemBarrierKind::kAnyStore);
@@ -5995,15 +6122,19 @@
 
     case DataType::Type::kInt32:
     case DataType::Type::kReference: {
-      if (kPoisonHeapReferences && needs_write_barrier) {
-        // Note that in the case where `value` is a null reference,
-        // we do not enter this block, as the reference does not
-        // need poisoning.
-        DCHECK_EQ(field_type, DataType::Type::kReference);
-        Register temp = locations->GetTemp(0).AsRegister<Register>();
-        __ movl(temp, value.AsRegister<Register>());
-        __ PoisonHeapReference(temp);
-        __ movl(field_addr, temp);
+      if (kPoisonHeapReferences && field_type == DataType::Type::kReference) {
+        if (value.IsConstant()) {
+          DCHECK(value.GetConstant()->IsNullConstant())
+              << "constant value " << CodeGenerator::GetInt32ValueOf(value.GetConstant())
+              << " is not null. Instruction " << *instruction;
+          // No need to poison null, just do a movl.
+          __ movl(field_addr, Immediate(0));
+        } else {
+          Register temp = locations->GetTemp(0).AsRegister<Register>();
+          __ movl(temp, value.AsRegister<Register>());
+          __ PoisonHeapReference(temp);
+          __ movl(field_addr, temp);
+        }
       } else if (value.IsConstant()) {
         int32_t v = CodeGenerator::GetInt32ValueOf(value.GetConstant());
         __ movl(field_addr, Immediate(v));
@@ -6072,15 +6203,38 @@
     codegen_->MaybeRecordImplicitNullCheck(instruction);
   }
 
-  if (needs_write_barrier && write_barrier_kind != WriteBarrierKind::kDontEmit) {
+  if (needs_write_barrier) {
     Register temp = locations->GetTemp(0).AsRegister<Register>();
     Register card = locations->GetTemp(1).AsRegister<Register>();
-    codegen_->MarkGCCard(
-        temp,
-        card,
-        base,
-        value.AsRegister<Register>(),
-        value_can_be_null && write_barrier_kind == WriteBarrierKind::kEmitWithNullCheck);
+    if (value.IsConstant()) {
+      DCHECK(value.GetConstant()->IsNullConstant())
+          << "constant value " << CodeGenerator::GetInt32ValueOf(value.GetConstant())
+          << " is not null. Instruction: " << *instruction;
+      if (write_barrier_kind == WriteBarrierKind::kEmitBeingReliedOn) {
+        codegen_->MarkGCCard(temp, card, base);
+      }
+    } else {
+      codegen_->MaybeMarkGCCard(
+          temp,
+          card,
+          base,
+          value.AsRegister<Register>(),
+          value_can_be_null && write_barrier_kind == WriteBarrierKind::kEmitNotBeingReliedOn);
+    }
+  } else if (codegen_->ShouldCheckGCCard(field_type, instruction->InputAt(1), write_barrier_kind)) {
+    if (value.IsConstant()) {
+      // If we are storing a constant for a reference, we are in the case where we are storing
+      // null but we cannot skip it as this write barrier is being relied on by coalesced write
+      // barriers.
+      DCHECK(value.GetConstant()->IsNullConstant())
+          << "constant value " << CodeGenerator::GetInt32ValueOf(value.GetConstant())
+          << " is not null. Instruction: " << *instruction;
+      // No need to check the dirty bit as this value is null.
+    } else {
+      Register temp = locations->GetTemp(0).AsRegister<Register>();
+      Register card = locations->GetTemp(1).AsRegister<Register>();
+      codegen_->CheckGCCardIsValid(temp, card, base);
+    }
   }
 
   if (is_volatile) {
@@ -6099,17 +6253,8 @@
   bool is_volatile = field_info.IsVolatile();
   DataType::Type field_type = field_info.GetFieldType();
   uint32_t offset = field_info.GetFieldOffset().Uint32Value();
-  bool is_predicated =
-      instruction->IsInstanceFieldSet() && instruction->AsInstanceFieldSet()->GetIsPredicatedSet();
-
   Address field_addr(base, offset);
 
-  NearLabel pred_is_null;
-  if (is_predicated) {
-    __ testl(base, base);
-    __ j(kEqual, &pred_is_null);
-  }
-
   HandleFieldSet(instruction,
                  /* value_index= */ 1,
                  field_type,
@@ -6118,10 +6263,6 @@
                  is_volatile,
                  value_can_be_null,
                  write_barrier_kind);
-
-  if (is_predicated) {
-    __ Bind(&pred_is_null);
-  }
 }
 
 void LocationsBuilderX86::VisitStaticFieldGet(HStaticFieldGet* instruction) {
@@ -6154,25 +6295,10 @@
                  instruction->GetWriteBarrierKind());
 }
 
-void LocationsBuilderX86::VisitPredicatedInstanceFieldGet(
-    HPredicatedInstanceFieldGet* instruction) {
-  HandleFieldGet(instruction, instruction->GetFieldInfo());
-}
-
 void LocationsBuilderX86::VisitInstanceFieldGet(HInstanceFieldGet* instruction) {
   HandleFieldGet(instruction, instruction->GetFieldInfo());
 }
 
-void InstructionCodeGeneratorX86::VisitPredicatedInstanceFieldGet(
-    HPredicatedInstanceFieldGet* instruction) {
-  NearLabel finish;
-  LocationSummary* locations = instruction->GetLocations();
-  Register recv = locations->InAt(1).AsRegister<Register>();
-  __ testl(recv, recv);
-  __ j(kZero, &finish);
-  HandleFieldGet(instruction, instruction->GetFieldInfo());
-  __ Bind(&finish);
-}
 void InstructionCodeGeneratorX86::VisitInstanceFieldGet(HInstanceFieldGet* instruction) {
   HandleFieldGet(instruction, instruction->GetFieldInfo());
 }
@@ -6299,7 +6425,7 @@
 
 void LocationsBuilderX86::VisitArrayGet(HArrayGet* instruction) {
   bool object_array_get_with_read_barrier =
-      gUseReadBarrier && (instruction->GetType() == DataType::Type::kReference);
+      (instruction->GetType() == DataType::Type::kReference) && codegen_->EmitReadBarrier();
   LocationSummary* locations =
       new (GetGraph()->GetAllocator()) LocationSummary(instruction,
                                                        object_array_get_with_read_barrier
@@ -6341,7 +6467,7 @@
         "art::mirror::HeapReference<art::mirror::Object> and int32_t have different sizes.");
     // /* HeapReference<Object> */ out =
     //     *(obj + data_offset + index * sizeof(HeapReference<Object>))
-    if (gUseReadBarrier && kUseBakerReadBarrier) {
+    if (codegen_->EmitBakerReadBarrier()) {
       // Note that a potential implicit null check is handled in this
       // CodeGeneratorX86::GenerateArrayLoadWithBakerReadBarrier call.
       codegen_->GenerateArrayLoadWithBakerReadBarrier(
@@ -6389,8 +6515,11 @@
 void LocationsBuilderX86::VisitArraySet(HArraySet* instruction) {
   DataType::Type value_type = instruction->GetComponentType();
 
+  WriteBarrierKind write_barrier_kind = instruction->GetWriteBarrierKind();
   bool needs_write_barrier =
-      CodeGenerator::StoreNeedsWriteBarrier(value_type, instruction->GetValue());
+      codegen_->StoreNeedsWriteBarrier(value_type, instruction->GetValue(), write_barrier_kind);
+  bool check_gc_card =
+      codegen_->ShouldCheckGCCard(value_type, instruction->GetValue(), write_barrier_kind);
   bool needs_type_check = instruction->NeedsTypeCheck();
 
   LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(
@@ -6411,13 +6540,14 @@
   } else {
     locations->SetInAt(2, Location::RegisterOrConstant(instruction->InputAt(2)));
   }
-  if (needs_write_barrier) {
-    // Used by reference poisoning or emitting write barrier.
+  if (needs_write_barrier || check_gc_card) {
+    // Used by reference poisoning, type checking, emitting, or checking a write barrier.
     locations->AddTemp(Location::RequiresRegister());
-    if (instruction->GetWriteBarrierKind() != WriteBarrierKind::kDontEmit) {
-      // Only used when emitting a write barrier. Ensure the card is in a byte register.
-      locations->AddTemp(Location::RegisterLocation(ECX));
-    }
+    // Only used when emitting or checking a write barrier. Ensure the card is in a byte register.
+    locations->AddTemp(Location::RegisterLocation(ECX));
+  } else if ((kPoisonHeapReferences && value_type == DataType::Type::kReference) ||
+             instruction->NeedsTypeCheck()) {
+    locations->AddTemp(Location::RequiresRegister());
   }
 }
 
@@ -6429,8 +6559,9 @@
   Location value = locations->InAt(2);
   DataType::Type value_type = instruction->GetComponentType();
   bool needs_type_check = instruction->NeedsTypeCheck();
+  WriteBarrierKind write_barrier_kind = instruction->GetWriteBarrierKind();
   bool needs_write_barrier =
-      CodeGenerator::StoreNeedsWriteBarrier(value_type, instruction->GetValue());
+      codegen_->StoreNeedsWriteBarrier(value_type, instruction->GetValue(), write_barrier_kind);
 
   switch (value_type) {
     case DataType::Type::kBool:
@@ -6470,16 +6601,19 @@
         DCHECK(value.IsConstant()) << value;
         __ movl(address, Immediate(0));
         codegen_->MaybeRecordImplicitNullCheck(instruction);
-        DCHECK(!needs_write_barrier);
+        if (write_barrier_kind == WriteBarrierKind::kEmitBeingReliedOn) {
+          // We need to set a write barrier here even though we are writing null, since this write
+          // barrier is being relied on.
+          DCHECK(needs_write_barrier);
+          Register temp = locations->GetTemp(0).AsRegister<Register>();
+          Register card = locations->GetTemp(1).AsRegister<Register>();
+          codegen_->MarkGCCard(temp, card, array);
+        }
         DCHECK(!needs_type_check);
         break;
       }
 
-      DCHECK(needs_write_barrier);
       Register register_value = value.AsRegister<Register>();
-      Location temp_loc = locations->GetTemp(0);
-      Register temp = temp_loc.AsRegister<Register>();
-
       bool can_value_be_null = instruction->GetValueCanBeNull();
       NearLabel do_store;
       if (can_value_be_null) {
@@ -6504,6 +6638,7 @@
         // false negative, in which case we would take the ArraySet
         // slow path.
 
+        Register temp = locations->GetTemp(0).AsRegister<Register>();
         // /* HeapReference<Class> */ temp = array->klass_
         __ movl(temp, Address(array, class_offset));
         codegen_->MaybeRecordImplicitNullCheck(instruction);
@@ -6534,24 +6669,29 @@
         }
       }
 
-      if (instruction->GetWriteBarrierKind() != WriteBarrierKind::kDontEmit) {
-        DCHECK_EQ(instruction->GetWriteBarrierKind(), WriteBarrierKind::kEmitNoNullCheck)
-            << " Already null checked so we shouldn't do it again.";
-        Register card = locations->GetTemp(1).AsRegister<Register>();
-        codegen_->MarkGCCard(temp,
-                             card,
-                             array,
-                             value.AsRegister<Register>(),
-                             /* emit_null_check= */ false);
-      }
-
       if (can_value_be_null) {
         DCHECK(do_store.IsLinked());
         __ Bind(&do_store);
       }
 
+      if (needs_write_barrier) {
+        // TODO(solanes): The WriteBarrierKind::kEmitNotBeingReliedOn case should be able to skip
+        // this write barrier when its value is null (without an extra testl since we already
+        // checked if the value is null for the type check). This will be done as a follow-up since
+        // it is a runtime optimization that needs extra care.
+        Register temp = locations->GetTemp(0).AsRegister<Register>();
+        Register card = locations->GetTemp(1).AsRegister<Register>();
+        codegen_->MarkGCCard(temp, card, array);
+      } else if (codegen_->ShouldCheckGCCard(
+                     value_type, instruction->GetValue(), write_barrier_kind)) {
+        Register temp = locations->GetTemp(0).AsRegister<Register>();
+        Register card = locations->GetTemp(1).AsRegister<Register>();
+        codegen_->CheckGCCardIsValid(temp, card, array);
+      }
+
       Register source = register_value;
       if (kPoisonHeapReferences) {
+        Register temp = locations->GetTemp(0).AsRegister<Register>();
         __ movl(temp, register_value);
         __ PoisonHeapReference(temp);
         source = temp;
@@ -6749,7 +6889,7 @@
   }
 }
 
-void LocationsBuilderX86::VisitParallelMove(HParallelMove* instruction ATTRIBUTE_UNUSED) {
+void LocationsBuilderX86::VisitParallelMove([[maybe_unused]] HParallelMove* instruction) {
   LOG(FATAL) << "Unreachable";
 }
 
@@ -7163,7 +7303,7 @@
             load_kind == HLoadClass::LoadKind::kBssEntryPublic ||
                 load_kind == HLoadClass::LoadKind::kBssEntryPackage);
 
-  const bool requires_read_barrier = gUseReadBarrier && !cls->IsInBootImage();
+  const bool requires_read_barrier = !cls->IsInBootImage() && codegen_->EmitReadBarrier();
   LocationSummary::CallKind call_kind = (cls->NeedsEnvironment() || requires_read_barrier)
       ? LocationSummary::kCallOnSlowPath
       : LocationSummary::kNoCall;
@@ -7177,11 +7317,11 @@
   }
   locations->SetOut(Location::RequiresRegister());
   if (call_kind == LocationSummary::kCallOnSlowPath && cls->HasPcRelativeLoadKind()) {
-    if (!gUseReadBarrier || kUseBakerReadBarrier) {
+    if (codegen_->EmitNonBakerReadBarrier()) {
+      // For non-Baker read barrier we have a temp-clobbering call.
+    } else {
       // Rely on the type resolution and/or initialization to save everything.
       locations->SetCustomSlowPathCallerSaves(OneRegInReferenceOutSaveEverythingCallerSaves());
-    } else {
-      // For non-Baker read barrier we have a temp-clobbering call.
     }
   }
 }
@@ -7213,9 +7353,8 @@
   Register out = out_loc.AsRegister<Register>();
 
   bool generate_null_check = false;
-  const ReadBarrierOption read_barrier_option = cls->IsInBootImage()
-      ? kWithoutReadBarrier
-      : gCompilerReadBarrierOption;
+  const ReadBarrierOption read_barrier_option =
+      cls->IsInBootImage() ? kWithoutReadBarrier : codegen_->GetCompilerReadBarrierOption();
   switch (load_kind) {
     case HLoadClass::LoadKind::kReferrersClass: {
       DCHECK(!cls->CanCallRuntime());
@@ -7383,7 +7522,7 @@
 }
 
 void LocationsBuilderX86::VisitLoadString(HLoadString* load) {
-  LocationSummary::CallKind call_kind = CodeGenerator::GetLoadStringCallKind(load);
+  LocationSummary::CallKind call_kind = codegen_->GetLoadStringCallKind(load);
   LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(load, call_kind);
   HLoadString::LoadKind load_kind = load->GetLoadKind();
   if (load_kind == HLoadString::LoadKind::kBootImageLinkTimePcRelative ||
@@ -7396,11 +7535,11 @@
   } else {
     locations->SetOut(Location::RequiresRegister());
     if (load_kind == HLoadString::LoadKind::kBssEntry) {
-      if (!gUseReadBarrier || kUseBakerReadBarrier) {
+      if (codegen_->EmitNonBakerReadBarrier()) {
+        // For non-Baker read barrier we have a temp-clobbering call.
+      } else {
         // Rely on the pResolveString to save everything.
         locations->SetCustomSlowPathCallerSaves(OneRegInReferenceOutSaveEverythingCallerSaves());
-      } else {
-        // For non-Baker read barrier we have a temp-clobbering call.
       }
     }
   }
@@ -7445,7 +7584,8 @@
       Address address = Address(method_address, CodeGeneratorX86::kPlaceholder32BitOffset);
       Label* fixup_label = codegen_->NewStringBssEntryPatch(load);
       // /* GcRoot<mirror::String> */ out = *address  /* PC-relative */
-      GenerateGcRootFieldLoad(load, out_loc, address, fixup_label, gCompilerReadBarrierOption);
+      GenerateGcRootFieldLoad(
+          load, out_loc, address, fixup_label, codegen_->GetCompilerReadBarrierOption());
       // No need for memory fence, thanks to the x86 memory model.
       SlowPathCode* slow_path = new (codegen_->GetScopedAllocator()) LoadStringSlowPathX86(load);
       codegen_->AddSlowPath(slow_path);
@@ -7465,14 +7605,14 @@
       Label* fixup_label = codegen_->NewJitRootStringPatch(
           load->GetDexFile(), load->GetStringIndex(), load->GetString());
       // /* GcRoot<mirror::String> */ out = *address
-      GenerateGcRootFieldLoad(load, out_loc, address, fixup_label, gCompilerReadBarrierOption);
+      GenerateGcRootFieldLoad(
+          load, out_loc, address, fixup_label, codegen_->GetCompilerReadBarrierOption());
       return;
     }
     default:
       break;
   }
 
-  // TODO: Re-add the compiler code to do string dex cache lookup again.
   InvokeRuntimeCallingConvention calling_convention;
   DCHECK_EQ(calling_convention.GetRegisterAt(0), out);
   __ movl(calling_convention.GetRegisterAt(0), Immediate(load->GetStringIndex().index_));
@@ -7498,7 +7638,7 @@
   new (GetGraph()->GetAllocator()) LocationSummary(clear, LocationSummary::kNoCall);
 }
 
-void InstructionCodeGeneratorX86::VisitClearException(HClearException* clear ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86::VisitClearException([[maybe_unused]] HClearException* clear) {
   __ fs()->movl(GetExceptionTlsAddress(), Immediate(0));
 }
 
@@ -7515,8 +7655,8 @@
 }
 
 // Temp is used for read barrier.
-static size_t NumberOfInstanceOfTemps(TypeCheckKind type_check_kind) {
-  if (gUseReadBarrier &&
+static size_t NumberOfInstanceOfTemps(bool emit_read_barrier, TypeCheckKind type_check_kind) {
+  if (emit_read_barrier &&
       !kUseBakerReadBarrier &&
       (type_check_kind == TypeCheckKind::kAbstractClassCheck ||
        type_check_kind == TypeCheckKind::kClassHierarchyCheck ||
@@ -7529,11 +7669,11 @@
 // Interface case has 2 temps, one for holding the number of interfaces, one for the current
 // interface pointer, the current interface is compared in memory.
 // The other checks have one temp for loading the object's class.
-static size_t NumberOfCheckCastTemps(TypeCheckKind type_check_kind) {
+static size_t NumberOfCheckCastTemps(bool emit_read_barrier, TypeCheckKind type_check_kind) {
   if (type_check_kind == TypeCheckKind::kInterfaceCheck) {
     return 2;
   }
-  return 1 + NumberOfInstanceOfTemps(type_check_kind);
+  return 1 + NumberOfInstanceOfTemps(emit_read_barrier, type_check_kind);
 }
 
 void LocationsBuilderX86::VisitInstanceOf(HInstanceOf* instruction) {
@@ -7545,7 +7685,7 @@
     case TypeCheckKind::kAbstractClassCheck:
     case TypeCheckKind::kClassHierarchyCheck:
     case TypeCheckKind::kArrayObjectCheck: {
-      bool needs_read_barrier = CodeGenerator::InstanceOfNeedsReadBarrier(instruction);
+      bool needs_read_barrier = codegen_->InstanceOfNeedsReadBarrier(instruction);
       call_kind = needs_read_barrier ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall;
       baker_read_barrier_slow_path = kUseBakerReadBarrier && needs_read_barrier;
       break;
@@ -7575,7 +7715,8 @@
   // Note that TypeCheckSlowPathX86 uses this "out" register too.
   locations->SetOut(Location::RequiresRegister());
   // When read barriers are enabled, we need a temporary register for some cases.
-  locations->AddRegisterTemps(NumberOfInstanceOfTemps(type_check_kind));
+  locations->AddRegisterTemps(
+      NumberOfInstanceOfTemps(codegen_->EmitReadBarrier(), type_check_kind));
 }
 
 void InstructionCodeGeneratorX86::VisitInstanceOf(HInstanceOf* instruction) {
@@ -7586,7 +7727,7 @@
   Location cls = locations->InAt(1);
   Location out_loc = locations->Out();
   Register out = out_loc.AsRegister<Register>();
-  const size_t num_temps = NumberOfInstanceOfTemps(type_check_kind);
+  const size_t num_temps = NumberOfInstanceOfTemps(codegen_->EmitReadBarrier(), type_check_kind);
   DCHECK_LE(num_temps, 1u);
   Location maybe_temp_loc = (num_temps >= 1) ? locations->GetTemp(0) : Location::NoLocation();
   uint32_t class_offset = mirror::Object::ClassOffset().Int32Value();
@@ -7606,7 +7747,7 @@
   switch (type_check_kind) {
     case TypeCheckKind::kExactCheck: {
       ReadBarrierOption read_barrier_option =
-          CodeGenerator::ReadBarrierOptionForInstanceOf(instruction);
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
       // /* HeapReference<Class> */ out = obj->klass_
       GenerateReferenceLoadTwoRegisters(instruction,
                                         out_loc,
@@ -7629,7 +7770,7 @@
 
     case TypeCheckKind::kAbstractClassCheck: {
       ReadBarrierOption read_barrier_option =
-          CodeGenerator::ReadBarrierOptionForInstanceOf(instruction);
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
       // /* HeapReference<Class> */ out = obj->klass_
       GenerateReferenceLoadTwoRegisters(instruction,
                                         out_loc,
@@ -7665,7 +7806,7 @@
 
     case TypeCheckKind::kClassHierarchyCheck: {
       ReadBarrierOption read_barrier_option =
-          CodeGenerator::ReadBarrierOptionForInstanceOf(instruction);
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
       // /* HeapReference<Class> */ out = obj->klass_
       GenerateReferenceLoadTwoRegisters(instruction,
                                         out_loc,
@@ -7702,7 +7843,7 @@
 
     case TypeCheckKind::kArrayObjectCheck: {
       ReadBarrierOption read_barrier_option =
-          CodeGenerator::ReadBarrierOptionForInstanceOf(instruction);
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
       // /* HeapReference<Class> */ out = obj->klass_
       GenerateReferenceLoadTwoRegisters(instruction,
                                         out_loc,
@@ -7825,7 +7966,7 @@
 
 void LocationsBuilderX86::VisitCheckCast(HCheckCast* instruction) {
   TypeCheckKind type_check_kind = instruction->GetTypeCheckKind();
-  LocationSummary::CallKind call_kind = CodeGenerator::GetCheckCastCallKind(instruction);
+  LocationSummary::CallKind call_kind = codegen_->GetCheckCastCallKind(instruction);
   LocationSummary* locations =
       new (GetGraph()->GetAllocator()) LocationSummary(instruction, call_kind);
   locations->SetInAt(0, Location::RequiresRegister());
@@ -7840,8 +7981,7 @@
   } else {
     locations->SetInAt(1, Location::Any());
   }
-  // Add temps for read barriers and other uses. One is used by TypeCheckSlowPathX86.
-  locations->AddRegisterTemps(NumberOfCheckCastTemps(type_check_kind));
+  locations->AddRegisterTemps(NumberOfCheckCastTemps(codegen_->EmitReadBarrier(), type_check_kind));
 }
 
 void InstructionCodeGeneratorX86::VisitCheckCast(HCheckCast* instruction) {
@@ -7852,7 +7992,7 @@
   Location cls = locations->InAt(1);
   Location temp_loc = locations->GetTemp(0);
   Register temp = temp_loc.AsRegister<Register>();
-  const size_t num_temps = NumberOfCheckCastTemps(type_check_kind);
+  const size_t num_temps = NumberOfCheckCastTemps(codegen_->EmitReadBarrier(), type_check_kind);
   DCHECK_GE(num_temps, 1u);
   DCHECK_LE(num_temps, 2u);
   Location maybe_temp2_loc = (num_temps >= 2) ? locations->GetTemp(1) : Location::NoLocation();
@@ -7865,7 +8005,7 @@
   const uint32_t object_array_data_offset =
       mirror::Array::DataOffset(kHeapReferenceSize).Uint32Value();
 
-  bool is_type_check_slow_path_fatal = CodeGenerator::IsTypeCheckSlowPathFatal(instruction);
+  bool is_type_check_slow_path_fatal = codegen_->IsTypeCheckSlowPathFatal(instruction);
   SlowPathCode* type_check_slow_path =
       new (codegen_->GetScopedAllocator()) TypeCheckSlowPathX86(
           instruction, is_type_check_slow_path_fatal);
@@ -8028,11 +8168,11 @@
                                         kWithoutReadBarrier);
 
       // /* HeapReference<Class> */ temp = temp->iftable_
-      GenerateReferenceLoadTwoRegisters(instruction,
-                                        temp_loc,
-                                        temp_loc,
-                                        iftable_offset,
-                                        kWithoutReadBarrier);
+      GenerateReferenceLoadOneRegister(instruction,
+                                       temp_loc,
+                                       iftable_offset,
+                                       maybe_temp2_loc,
+                                       kWithoutReadBarrier);
       // Iftable is never null.
       __ movl(maybe_temp2_loc.AsRegister<Register>(), Address(temp, array_length_offset));
       // Maybe poison the `cls` for direct comparison with memory.
@@ -8288,7 +8428,7 @@
     ReadBarrierOption read_barrier_option) {
   Register out_reg = out.AsRegister<Register>();
   if (read_barrier_option == kWithReadBarrier) {
-    CHECK(gUseReadBarrier);
+    DCHECK(codegen_->EmitReadBarrier());
     if (kUseBakerReadBarrier) {
       // Load with fast path based Baker's read barrier.
       // /* HeapReference<Object> */ out = *(out + offset)
@@ -8322,7 +8462,7 @@
   Register out_reg = out.AsRegister<Register>();
   Register obj_reg = obj.AsRegister<Register>();
   if (read_barrier_option == kWithReadBarrier) {
-    CHECK(gUseReadBarrier);
+    DCHECK(codegen_->EmitReadBarrier());
     if (kUseBakerReadBarrier) {
       // Load with fast path based Baker's read barrier.
       // /* HeapReference<Object> */ out = *(obj + offset)
@@ -8350,7 +8490,7 @@
     ReadBarrierOption read_barrier_option) {
   Register root_reg = root.AsRegister<Register>();
   if (read_barrier_option == kWithReadBarrier) {
-    DCHECK(gUseReadBarrier);
+    DCHECK(codegen_->EmitReadBarrier());
     if (kUseBakerReadBarrier) {
       // Fast path implementation of art::ReadBarrier::BarrierForRoot when
       // Baker's read barrier are used:
@@ -8414,8 +8554,7 @@
                                                              Register obj,
                                                              uint32_t offset,
                                                              bool needs_null_check) {
-  DCHECK(gUseReadBarrier);
-  DCHECK(kUseBakerReadBarrier);
+  DCHECK(EmitBakerReadBarrier());
 
   // /* HeapReference<Object> */ ref = *(obj + offset)
   Address src(obj, offset);
@@ -8428,8 +8567,7 @@
                                                              uint32_t data_offset,
                                                              Location index,
                                                              bool needs_null_check) {
-  DCHECK(gUseReadBarrier);
-  DCHECK(kUseBakerReadBarrier);
+  DCHECK(EmitBakerReadBarrier());
 
   static_assert(
       sizeof(mirror::HeapReference<mirror::Object>) == sizeof(int32_t),
@@ -8447,8 +8585,7 @@
                                                                  bool needs_null_check,
                                                                  bool always_update_field,
                                                                  Register* temp) {
-  DCHECK(gUseReadBarrier);
-  DCHECK(kUseBakerReadBarrier);
+  DCHECK(EmitBakerReadBarrier());
 
   // In slow path based read barriers, the read barrier call is
   // inserted after the original load. However, in fast path based
@@ -8528,7 +8665,7 @@
                                                Location obj,
                                                uint32_t offset,
                                                Location index) {
-  DCHECK(gUseReadBarrier);
+  DCHECK(EmitReadBarrier());
 
   // Insert a slow path based read barrier *after* the reference load.
   //
@@ -8555,7 +8692,7 @@
                                                     Location obj,
                                                     uint32_t offset,
                                                     Location index) {
-  if (gUseReadBarrier) {
+  if (EmitReadBarrier()) {
     // Baker's read barriers shall be handled by the fast path
     // (CodeGeneratorX86::GenerateReferenceLoadWithBakerReadBarrier).
     DCHECK(!kUseBakerReadBarrier);
@@ -8570,7 +8707,7 @@
 void CodeGeneratorX86::GenerateReadBarrierForRootSlow(HInstruction* instruction,
                                                       Location out,
                                                       Location root) {
-  DCHECK(gUseReadBarrier);
+  DCHECK(EmitReadBarrier());
 
   // Insert a slow path based read barrier *after* the GC root load.
   //
@@ -8584,12 +8721,12 @@
   __ Bind(slow_path->GetExitLabel());
 }
 
-void LocationsBuilderX86::VisitBoundType(HBoundType* instruction ATTRIBUTE_UNUSED) {
+void LocationsBuilderX86::VisitBoundType([[maybe_unused]] HBoundType* instruction) {
   // Nothing to do, this should be removed during prepare for register allocator.
   LOG(FATAL) << "Unreachable";
 }
 
-void InstructionCodeGeneratorX86::VisitBoundType(HBoundType* instruction ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86::VisitBoundType([[maybe_unused]] HBoundType* instruction) {
   // Nothing to do, this should be removed during prepare for register allocator.
   LOG(FATAL) << "Unreachable";
 }
@@ -8782,13 +8919,15 @@
     case DataType::Type::kFloat32:
       __ movss(out.AsFpuRegister<XmmRegister>(),
                codegen_->LiteralFloatAddress(
-                  value->AsFloatConstant()->GetValue(), insn->GetBaseMethodAddress(), const_area));
+                   value->AsFloatConstant()->GetValue(), insn->GetBaseMethodAddress(), const_area));
       break;
 
     case DataType::Type::kFloat64:
       __ movsd(out.AsFpuRegister<XmmRegister>(),
                codegen_->LiteralDoubleAddress(
-                  value->AsDoubleConstant()->GetValue(), insn->GetBaseMethodAddress(), const_area));
+                   value->AsDoubleConstant()->GetValue(),
+                   insn->GetBaseMethodAddress(),
+                   const_area));
       break;
 
     case DataType::Type::kInt32:
@@ -8877,7 +9016,7 @@
   const HX86PackedSwitch* switch_instr_;
 };
 
-void CodeGeneratorX86::Finalize(CodeAllocator* allocator) {
+void CodeGeneratorX86::Finalize() {
   // Generate the constant area if needed.
   X86Assembler* assembler = GetAssembler();
 
@@ -8897,7 +9036,7 @@
   }
 
   // And finish up.
-  CodeGenerator::Finalize(allocator);
+  CodeGenerator::Finalize();
 }
 
 Address CodeGeneratorX86::LiteralDoubleAddress(double v,
@@ -8968,9 +9107,9 @@
                                        Location index,
                                        ScaleFactor scale,
                                        uint32_t data_offset) {
-  return index.IsConstant() ?
-      Address(obj, (index.GetConstant()->AsIntConstant()->GetValue() << scale) + data_offset) :
-      Address(obj, index.AsRegister<Register>(), scale, data_offset);
+  return index.IsConstant()
+      ? Address(obj, (index.GetConstant()->AsIntConstant()->GetValue() << scale) + data_offset)
+      : Address(obj, index.AsRegister<Register>(), scale, data_offset);
 }
 
 Address CodeGeneratorX86::LiteralCaseTable(HX86PackedSwitch* switch_instr,
@@ -9025,7 +9164,7 @@
       reinterpret_cast<uintptr_t>(roots_data) + index_in_table * sizeof(GcRoot<mirror::Object>);
   using unaligned_uint32_t __attribute__((__aligned__(1))) = uint32_t;
   reinterpret_cast<unaligned_uint32_t*>(code + code_offset)[0] =
-     dchecked_integral_cast<uint32_t>(address);
+      dchecked_integral_cast<uint32_t>(address);
 }
 
 void CodeGeneratorX86::EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) {
@@ -9042,13 +9181,13 @@
   }
 }
 
-void LocationsBuilderX86::VisitIntermediateAddress(HIntermediateAddress* instruction
-                                                   ATTRIBUTE_UNUSED) {
+void LocationsBuilderX86::VisitIntermediateAddress(
+    [[maybe_unused]] HIntermediateAddress* instruction) {
   LOG(FATAL) << "Unreachable";
 }
 
-void InstructionCodeGeneratorX86::VisitIntermediateAddress(HIntermediateAddress* instruction
-                                                           ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86::VisitIntermediateAddress(
+    [[maybe_unused]] HIntermediateAddress* instruction) {
   LOG(FATAL) << "Unreachable";
 }
 
diff --git a/compiler/optimizing/code_generator_x86.h b/compiler/optimizing/code_generator_x86.h
index d27155f..007ec81 100644
--- a/compiler/optimizing/code_generator_x86.h
+++ b/compiler/optimizing/code_generator_x86.h
@@ -89,19 +89,8 @@
   V(StringBuilderLength)                    \
   V(StringBuilderToString)                  \
   /* 1.8 */                                 \
-  V(UnsafeGetAndAddInt)                     \
-  V(UnsafeGetAndAddLong)                    \
-  V(UnsafeGetAndSetInt)                     \
-  V(UnsafeGetAndSetLong)                    \
-  V(UnsafeGetAndSetObject)                  \
   V(MethodHandleInvokeExact)                \
-  V(MethodHandleInvoke)                     \
-  /* OpenJDK 11 */                          \
-  V(JdkUnsafeGetAndAddInt)                  \
-  V(JdkUnsafeGetAndAddLong)                 \
-  V(JdkUnsafeGetAndSetInt)                  \
-  V(JdkUnsafeGetAndSetLong)                 \
-  V(JdkUnsafeGetAndSetObject)
+  V(MethodHandleInvoke)
 
 class InvokeRuntimeCallingConvention : public CallingConvention<Register, XmmRegister> {
  public:
@@ -196,7 +185,7 @@
             ? Location::RegisterLocation(EDX)
             : Location::RegisterLocation(ECX));
   }
-  Location GetFpuLocation(DataType::Type type ATTRIBUTE_UNUSED) const override {
+  Location GetFpuLocation([[maybe_unused]] DataType::Type type) const override {
     return Location::FpuRegisterLocation(XMM0);
   }
 
@@ -578,10 +567,20 @@
                        uint64_t index_in_table) const;
   void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) override;
 
-  // Emit a write barrier.
-  void MarkGCCard(
+  // Emit a write barrier if:
+  // A) emit_null_check is false
+  // B) emit_null_check is true, and value is not null.
+  void MaybeMarkGCCard(
       Register temp, Register card, Register object, Register value, bool emit_null_check);
 
+  // Emit a write barrier unconditionally.
+  void MarkGCCard(Register temp, Register card, Register object);
+
+  // Crash if the card table is not valid. This check is only emitted for the CC GC. We assert
+  // `(!clean || !self->is_gc_marking)`, since the card table should not be set to clean when the CC
+  // GC is marking for eliminated write barriers.
+  void CheckGCCardIsValid(Register temp, Register card, Register object);
+
   void GenerateMemoryBarrier(MemBarrierKind kind);
 
   Label* GetLabelOf(HBasicBlock* block) const {
@@ -635,7 +634,7 @@
 
   Address LiteralCaseTable(HX86PackedSwitch* switch_instr, Register reg, Register value);
 
-  void Finalize(CodeAllocator* allocator) override;
+  void Finalize() override;
 
   // Fast path implementation of ReadBarrier::Barrier for a heap
   // reference field load when Baker's read barriers are used.
@@ -739,7 +738,7 @@
   void GenerateExplicitNullCheck(HNullCheck* instruction) override;
 
   void MaybeGenerateInlineCacheCheck(HInstruction* instruction, Register klass);
-  void MaybeIncrementHotness(bool is_frame_entry);
+  void MaybeIncrementHotness(HSuspendCheck* suspend_check, bool is_frame_entry);
 
   // When we don't know the proper offset for the value, we use kPlaceholder32BitOffset.
   // The correct value will be inserted when processing Assembler fixups.
diff --git a/compiler/optimizing/code_generator_x86_64.cc b/compiler/optimizing/code_generator_x86_64.cc
index eea6b20..af6c625 100644
--- a/compiler/optimizing/code_generator_x86_64.cc
+++ b/compiler/optimizing/code_generator_x86_64.cc
@@ -27,6 +27,7 @@
 #include "heap_poisoning.h"
 #include "interpreter/mterp/nterp.h"
 #include "intrinsics.h"
+#include "intrinsics_list.h"
 #include "intrinsics_utils.h"
 #include "intrinsics_x86_64.h"
 #include "jit/profiling_info.h"
@@ -37,8 +38,10 @@
 #include "mirror/object_reference.h"
 #include "mirror/var_handle.h"
 #include "optimizing/nodes.h"
+#include "profiling_info_builder.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread.h"
+#include "trace.h"
 #include "utils/assembler.h"
 #include "utils/stack_checks.h"
 #include "utils/x86_64/assembler_x86_64.h"
@@ -267,6 +270,38 @@
   DISALLOW_COPY_AND_ASSIGN(BoundsCheckSlowPathX86_64);
 };
 
+class LoadMethodTypeSlowPathX86_64: public SlowPathCode {
+ public:
+  explicit LoadMethodTypeSlowPathX86_64(HLoadMethodType* mt) : SlowPathCode(mt) {}
+
+  void EmitNativeCode(CodeGenerator* codegen) override {
+    LocationSummary* locations = instruction_->GetLocations();
+    DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg()));
+
+    CodeGeneratorX86_64* x86_64_codegen = down_cast<CodeGeneratorX86_64*>(codegen);
+    __ Bind(GetEntryLabel());
+    SaveLiveRegisters(codegen, locations);
+
+    const dex::ProtoIndex proto_index = instruction_->AsLoadMethodType()->GetProtoIndex();
+    // Custom calling convention: RAX serves as both input and output.
+    __ movl(CpuRegister(RAX), Immediate(proto_index.index_));
+    x86_64_codegen->InvokeRuntime(kQuickResolveMethodType,
+                                  instruction_,
+                                  instruction_->GetDexPc(),
+                                  this);
+    CheckEntrypointTypes<kQuickResolveMethodType, void*, uint32_t>();
+    x86_64_codegen->Move(locations->Out(), Location::RegisterLocation(RAX));
+    RestoreLiveRegisters(codegen, locations);
+
+    __ jmp(GetExitLabel());
+  }
+
+  const char* GetDescription() const override { return "LoadMethodTypeSlowPathX86_64"; }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(LoadMethodTypeSlowPathX86_64);
+};
+
 class LoadClassSlowPathX86_64 : public SlowPathCode {
  public:
   LoadClassSlowPathX86_64(HLoadClass* cls, HInstruction* at)
@@ -510,23 +545,23 @@
       : SlowPathCode(instruction),
         ref_(ref),
         unpoison_ref_before_marking_(unpoison_ref_before_marking) {
-    DCHECK(gUseReadBarrier);
   }
 
   const char* GetDescription() const override { return "ReadBarrierMarkSlowPathX86_64"; }
 
   void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitReadBarrier());
     LocationSummary* locations = instruction_->GetLocations();
     CpuRegister ref_cpu_reg = ref_.AsRegister<CpuRegister>();
     Register ref_reg = ref_cpu_reg.AsRegister();
     DCHECK(locations->CanCall());
     DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(ref_reg)) << ref_reg;
     DCHECK(instruction_->IsInstanceFieldGet() ||
-           instruction_->IsPredicatedInstanceFieldGet() ||
            instruction_->IsStaticFieldGet() ||
            instruction_->IsArrayGet() ||
            instruction_->IsArraySet() ||
            instruction_->IsLoadClass() ||
+           instruction_->IsLoadMethodType() ||
            instruction_->IsLoadString() ||
            instruction_->IsInstanceOf() ||
            instruction_->IsCheckCast() ||
@@ -601,7 +636,6 @@
         unpoison_ref_before_marking_(unpoison_ref_before_marking),
         temp1_(temp1),
         temp2_(temp2) {
-    DCHECK(gUseReadBarrier);
   }
 
   const char* GetDescription() const override {
@@ -609,6 +643,7 @@
   }
 
   void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitReadBarrier());
     LocationSummary* locations = instruction_->GetLocations();
     CpuRegister ref_cpu_reg = ref_.AsRegister<CpuRegister>();
     Register ref_reg = ref_cpu_reg.AsRegister();
@@ -618,7 +653,9 @@
         << "Unexpected instruction in read barrier marking and field updating slow path: "
         << instruction_->DebugName();
     HInvoke* invoke = instruction_->AsInvoke();
-    DCHECK(IsUnsafeCASObject(invoke) || IsVarHandleCASFamily(invoke)) << invoke->GetIntrinsic();
+    DCHECK(IsUnsafeCASReference(invoke) ||
+           IsUnsafeGetAndSetReference(invoke) ||
+           IsVarHandleCASFamily(invoke)) << invoke->GetIntrinsic();
 
     __ Bind(GetEntryLabel());
     if (unpoison_ref_before_marking_) {
@@ -665,7 +702,7 @@
     __ cmpl(temp1_, ref_cpu_reg);
     __ j(kEqual, &done);
 
-    // Update the the holder's field atomically.  This may fail if
+    // Update the holder's field atomically.  This may fail if
     // mutator updates before us, but it's OK.  This is achived
     // using a strong compare-and-set (CAS) operation with relaxed
     // memory synchronization ordering, where the expected value is
@@ -761,7 +798,6 @@
         obj_(obj),
         offset_(offset),
         index_(index) {
-    DCHECK(gUseReadBarrier);
     // If `obj` is equal to `out` or `ref`, it means the initial
     // object has been overwritten by (or after) the heap object
     // reference load to be instrumented, e.g.:
@@ -776,13 +812,13 @@
 }
 
   void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitReadBarrier());
     CodeGeneratorX86_64* x86_64_codegen = down_cast<CodeGeneratorX86_64*>(codegen);
     LocationSummary* locations = instruction_->GetLocations();
     CpuRegister reg_out = out_.AsRegister<CpuRegister>();
     DCHECK(locations->CanCall());
     DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(reg_out.AsRegister())) << out_;
     DCHECK(instruction_->IsInstanceFieldGet() ||
-           instruction_->IsPredicatedInstanceFieldGet() ||
            instruction_->IsStaticFieldGet() ||
            instruction_->IsArrayGet() ||
            instruction_->IsInstanceOf() ||
@@ -855,9 +891,11 @@
         DCHECK(instruction_->GetLocations()->Intrinsified());
         DCHECK((instruction_->AsInvoke()->GetIntrinsic() == Intrinsics::kUnsafeGetObject) ||
                (instruction_->AsInvoke()->GetIntrinsic() == Intrinsics::kUnsafeGetObjectVolatile) ||
-               (instruction_->AsInvoke()->GetIntrinsic() == Intrinsics::kJdkUnsafeGetObject) ||
-               (instruction_->AsInvoke()->GetIntrinsic() == Intrinsics::kJdkUnsafeGetObjectVolatile) ||
-               (instruction_->AsInvoke()->GetIntrinsic() == Intrinsics::kJdkUnsafeGetObjectAcquire))
+               (instruction_->AsInvoke()->GetIntrinsic() == Intrinsics::kJdkUnsafeGetReference) ||
+               (instruction_->AsInvoke()->GetIntrinsic() ==
+                    Intrinsics::kJdkUnsafeGetReferenceVolatile) ||
+               (instruction_->AsInvoke()->GetIntrinsic() ==
+                    Intrinsics::kJdkUnsafeGetReferenceAcquire))
             << instruction_->AsInvoke()->GetIntrinsic();
         DCHECK_EQ(offset_, 0U);
         DCHECK(index_.IsRegister());
@@ -937,10 +975,10 @@
  public:
   ReadBarrierForRootSlowPathX86_64(HInstruction* instruction, Location out, Location root)
       : SlowPathCode(instruction), out_(out), root_(root) {
-    DCHECK(gUseReadBarrier);
   }
 
   void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitReadBarrier());
     LocationSummary* locations = instruction_->GetLocations();
     DCHECK(locations->CanCall());
     DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(out_.reg()));
@@ -1005,13 +1043,25 @@
 
 class CompileOptimizedSlowPathX86_64 : public SlowPathCode {
  public:
-  CompileOptimizedSlowPathX86_64() : SlowPathCode(/* instruction= */ nullptr) {}
+  CompileOptimizedSlowPathX86_64(HSuspendCheck* suspend_check, uint64_t counter_address)
+      : SlowPathCode(suspend_check),
+        counter_address_(counter_address) {}
 
   void EmitNativeCode(CodeGenerator* codegen) override {
     CodeGeneratorX86_64* x86_64_codegen = down_cast<CodeGeneratorX86_64*>(codegen);
     __ Bind(GetEntryLabel());
+    __ movq(CpuRegister(TMP), Immediate(counter_address_));
+    __ movw(Address(CpuRegister(TMP), 0), Immediate(ProfilingInfo::GetOptimizeThreshold()));
+    if (instruction_ != nullptr) {
+      // Only saves full width XMM for SIMD.
+      SaveLiveRegisters(codegen, instruction_->GetLocations());
+    }
     x86_64_codegen->GenerateInvokeRuntime(
         GetThreadOffset<kX86_64PointerSize>(kQuickCompileOptimized).Int32Value());
+    if (instruction_ != nullptr) {
+      // Only restores full width XMM for SIMD.
+      RestoreLiveRegisters(codegen, instruction_->GetLocations());
+    }
     __ jmp(GetExitLabel());
   }
 
@@ -1020,6 +1070,8 @@
   }
 
  private:
+  uint64_t counter_address_;
+
   DISALLOW_COPY_AND_ASSIGN(CompileOptimizedSlowPathX86_64);
 };
 
@@ -1070,8 +1122,8 @@
 }
 
 HInvokeStaticOrDirect::DispatchInfo CodeGeneratorX86_64::GetSupportedInvokeStaticOrDirectDispatch(
-      const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info,
-      ArtMethod* method ATTRIBUTE_UNUSED) {
+    const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info,
+    [[maybe_unused]] ArtMethod* method) {
   return desired_dispatch_info;
 }
 
@@ -1308,6 +1360,12 @@
   return &string_bss_entry_patches_.back().label;
 }
 
+Label* CodeGeneratorX86_64::NewMethodTypeBssEntryPatch(HLoadMethodType* load_method_type) {
+  method_type_bss_entry_patches_.emplace_back(
+      &load_method_type->GetDexFile(), load_method_type->GetProtoIndex().index_);
+  return &method_type_bss_entry_patches_.back().label;
+}
+
 void CodeGeneratorX86_64::RecordBootImageJniEntrypointPatch(HInvokeStaticOrDirect* invoke) {
   boot_image_jni_entrypoint_patches_.emplace_back(invoke->GetResolvedMethodReference().dex_file,
                                                   invoke->GetResolvedMethodReference().index);
@@ -1335,7 +1393,7 @@
 void CodeGeneratorX86_64::LoadIntrinsicDeclaringClass(CpuRegister reg, HInvoke* invoke) {
   DCHECK_NE(invoke->GetIntrinsic(), Intrinsics::kNone);
   if (GetCompilerOptions().IsBootImage()) {
-    // Load the class the same way as for HLoadClass::LoadKind::kBootImageLinkTimePcRelative.
+    // Load the type the same way as for HLoadClass::LoadKind::kBootImageLinkTimePcRelative.
     __ leal(reg,
             Address::Absolute(CodeGeneratorX86_64::kPlaceholder32BitOffset, /* no_rip= */ false));
     MethodReference target_method = invoke->GetResolvedMethodReference();
@@ -1395,6 +1453,7 @@
       package_type_bss_entry_patches_.size() +
       boot_image_string_patches_.size() +
       string_bss_entry_patches_.size() +
+      method_type_bss_entry_patches_.size() +
       boot_image_jni_entrypoint_patches_.size() +
       boot_image_other_patches_.size();
   linker_patches->reserve(size);
@@ -1427,6 +1486,8 @@
       package_type_bss_entry_patches_, linker_patches);
   EmitPcRelativeLinkerPatches<linker::LinkerPatch::StringBssEntryPatch>(
       string_bss_entry_patches_, linker_patches);
+  EmitPcRelativeLinkerPatches<linker::LinkerPatch::MethodTypeBssEntryPatch>(
+      method_type_bss_entry_patches_, linker_patches);
   EmitPcRelativeLinkerPatches<linker::LinkerPatch::RelativeJniEntrypointPatch>(
       boot_image_jni_entrypoint_patches_, linker_patches);
   DCHECK_EQ(size, linker_patches->size());
@@ -1495,6 +1556,7 @@
 }
 
 namespace detail {
+
 // Mark which intrinsics we don't have handcrafted code for.
 template <Intrinsics T>
 struct IsUnimplemented {
@@ -1509,15 +1571,13 @@
 UNIMPLEMENTED_INTRINSIC_LIST_X86_64(TRUE_OVERRIDE)
 #undef TRUE_OVERRIDE
 
-#include "intrinsics_list.h"
 static constexpr bool kIsIntrinsicUnimplemented[] = {
-  false,  // kNone
+    false,  // kNone
 #define IS_UNIMPLEMENTED(Intrinsic, ...) \
-  IsUnimplemented<Intrinsics::k##Intrinsic>().is_unimplemented,
-  INTRINSICS_LIST(IS_UNIMPLEMENTED)
+    IsUnimplemented<Intrinsics::k##Intrinsic>().is_unimplemented,
+    ART_INTRINSICS_LIST(IS_UNIMPLEMENTED)
 #undef IS_UNIMPLEMENTED
 };
-#undef INTRINSICS_LIST
 
 }  // namespace detail
 
@@ -1531,11 +1591,9 @@
                     kNumberOfCpuRegisters,
                     kNumberOfFloatRegisters,
                     kNumberOfCpuRegisterPairs,
-                    ComputeRegisterMask(reinterpret_cast<const int*>(kCoreCalleeSaves),
-                                        arraysize(kCoreCalleeSaves))
+                    ComputeRegisterMask(kCoreCalleeSaves, arraysize(kCoreCalleeSaves))
                         | (1 << kFakeReturnRegister),
-                    ComputeRegisterMask(reinterpret_cast<const int*>(kFpuCalleeSaves),
-                                        arraysize(kFpuCalleeSaves)),
+                    ComputeRegisterMask(kFpuCalleeSaves, arraysize(kFpuCalleeSaves)),
                     compiler_options,
                     stats,
                     ArrayRef<const bool>(detail::kIsIntrinsicUnimplemented)),
@@ -1554,6 +1612,7 @@
       package_type_bss_entry_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
       boot_image_string_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
       string_bss_entry_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
+      method_type_bss_entry_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
       boot_image_jni_entrypoint_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
       boot_image_other_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
       jit_string_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)),
@@ -1585,12 +1644,18 @@
 }
 
 void LocationsBuilderX86_64::VisitMethodEntryHook(HMethodEntryHook* method_hook) {
-  new (GetGraph()->GetAllocator()) LocationSummary(method_hook, LocationSummary::kCallOnSlowPath);
+  LocationSummary* locations = new (GetGraph()->GetAllocator())
+      LocationSummary(method_hook, LocationSummary::kCallOnSlowPath);
+  // We use rdtsc to record the timestamp for method profiling. rdtsc returns
+  // two 32-bit values in EAX + EDX even on 64-bit architectures.
+  locations->AddTemp(Location::RegisterLocation(RAX));
+  locations->AddTemp(Location::RegisterLocation(RDX));
 }
 
 void InstructionCodeGeneratorX86_64::GenerateMethodEntryExitHook(HInstruction* instruction) {
   SlowPathCode* slow_path =
       new (codegen_->GetScopedAllocator()) MethodEntryExitHooksSlowPathX86_64(instruction);
+  LocationSummary* locations = instruction->GetLocations();
   codegen_->AddSlowPath(slow_path);
 
   if (instruction->IsMethodExitHook()) {
@@ -1609,8 +1674,51 @@
       instrumentation::Instrumentation::HaveMethodExitListenersOffset()
       : instrumentation::Instrumentation::HaveMethodEntryListenersOffset();
   __ movq(CpuRegister(TMP), Immediate(address + offset.Int32Value()));
-  __ cmpb(Address(CpuRegister(TMP), 0), Immediate(0));
-  __ j(kNotEqual, slow_path->GetEntryLabel());
+  __ cmpb(Address(CpuRegister(TMP), 0),
+          Immediate(instrumentation::Instrumentation::kFastTraceListeners));
+  // Check if there are any method entry / exit listeners. If no, continue with execution.
+  __ j(kLess, slow_path->GetExitLabel());
+  // Check if there are any slow method entry / exit listeners. If yes, take the slow path.
+  __ j(kGreater, slow_path->GetEntryLabel());
+
+  // Check if there is place in the buffer for a new entry, if no, take slow path.
+  CpuRegister index = locations->GetTemp(0).AsRegister<CpuRegister>();
+  CpuRegister entry_addr = CpuRegister(TMP);
+  uint64_t trace_buffer_index_offset =
+      Thread::TraceBufferIndexOffset<kX86_64PointerSize>().SizeValue();
+  __ gs()->movq(CpuRegister(index),
+                Address::Absolute(trace_buffer_index_offset, /* no_rip= */ true));
+  __ subq(CpuRegister(index), Immediate(kNumEntriesForWallClock));
+  __ j(kLess, slow_path->GetEntryLabel());
+
+  // Update the index in the `Thread`.
+  __ gs()->movq(Address::Absolute(trace_buffer_index_offset, /* no_rip= */ true),
+                CpuRegister(index));
+  // Calculate the entry address in the buffer.
+  // entry_addr = base_addr + sizeof(void*) * index
+  __ gs()->movq(entry_addr,
+                Address::Absolute(Thread::TraceBufferPtrOffset<kX86_64PointerSize>().SizeValue(),
+                                  /* no_rip= */ true));
+  __ leaq(CpuRegister(entry_addr),
+          Address(CpuRegister(entry_addr), CpuRegister(index), TIMES_8, 0));
+
+  // Record method pointer and action.
+  CpuRegister method = index;
+  __ movq(CpuRegister(method), Address(CpuRegister(RSP), kCurrentMethodStackOffset));
+  // Use last two bits to encode trace method action. For MethodEntry it is 0
+  // so no need to set the bits since they are 0 already.
+  if (instruction->IsMethodExitHook()) {
+    DCHECK_GE(ArtMethod::Alignment(kRuntimePointerSize), static_cast<size_t>(4));
+    static_assert(enum_cast<int32_t>(TraceAction::kTraceMethodEnter) == 0);
+    static_assert(enum_cast<int32_t>(TraceAction::kTraceMethodExit) == 1);
+    __ orq(method, Immediate(enum_cast<int32_t>(TraceAction::kTraceMethodExit)));
+  }
+  __ movq(Address(entry_addr, kMethodOffsetInBytes), CpuRegister(method));
+  // Get the timestamp. rdtsc returns timestamp in RAX + RDX even in 64-bit architectures.
+  __ rdtsc();
+  __ shlq(CpuRegister(RDX), Immediate(32));
+  __ orq(CpuRegister(RAX), CpuRegister(RDX));
+  __ movq(Address(entry_addr, kTimestampOffsetInBytes), CpuRegister(RAX));
   __ Bind(slow_path->GetExitLabel());
 }
 
@@ -1651,6 +1759,10 @@
   LocationSummary* locations = new (GetGraph()->GetAllocator())
       LocationSummary(method_hook, LocationSummary::kCallOnSlowPath);
   SetInForReturnValue(method_hook, locations);
+  // We use rdtsc to record the timestamp for method profiling. rdtsc returns
+  // two 32-bit values in EAX + EDX even on 64-bit architectures.
+  locations->AddTemp(Location::RegisterLocation(RAX));
+  locations->AddTemp(Location::RegisterLocation(RDX));
 }
 
 void InstructionCodeGeneratorX86_64::VisitMethodExitHook(HMethodExitHook* instruction) {
@@ -1659,7 +1771,7 @@
   GenerateMethodEntryExitHook(instruction);
 }
 
-void CodeGeneratorX86_64::MaybeIncrementHotness(bool is_frame_entry) {
+void CodeGeneratorX86_64::MaybeIncrementHotness(HSuspendCheck* suspend_check, bool is_frame_entry) {
   if (GetCompilerOptions().CountHotnessInCompiledCode()) {
     NearLabel overflow;
     Register method = kMethodRegisterArgument;
@@ -1676,21 +1788,24 @@
     __ Bind(&overflow);
   }
 
-  if (GetGraph()->IsCompilingBaseline() && !Runtime::Current()->IsAotCompiler()) {
-    SlowPathCode* slow_path = new (GetScopedAllocator()) CompileOptimizedSlowPathX86_64();
-    AddSlowPath(slow_path);
+  if (GetGraph()->IsCompilingBaseline() &&
+      GetGraph()->IsUsefulOptimizing() &&
+      !Runtime::Current()->IsAotCompiler()) {
     ProfilingInfo* info = GetGraph()->GetProfilingInfo();
     DCHECK(info != nullptr);
     CHECK(!HasEmptyFrame());
-    uint64_t address = reinterpret_cast64<uint64_t>(info);
+    uint64_t address = reinterpret_cast64<uint64_t>(info) +
+        ProfilingInfo::BaselineHotnessCountOffset().Int32Value();
+    SlowPathCode* slow_path =
+        new (GetScopedAllocator()) CompileOptimizedSlowPathX86_64(suspend_check, address);
+    AddSlowPath(slow_path);
     // Note: if the address was in the 32bit range, we could use
     // Address::Absolute and avoid this movq.
     __ movq(CpuRegister(TMP), Immediate(address));
     // With multiple threads, this can overflow. This is OK, we will eventually get to see
     // it reaching 0. Also, at this point we have no register available to look
     // at the counter directly.
-    __ addw(Address(CpuRegister(TMP), ProfilingInfo::BaselineHotnessCountOffset().Int32Value()),
-            Immediate(-1));
+    __ addw(Address(CpuRegister(TMP), 0), Immediate(-1));
     __ j(kEqual, slow_path->GetEntryLabel());
     __ Bind(slow_path->GetExitLabel());
   }
@@ -1749,6 +1864,9 @@
   }
 
   if (!HasEmptyFrame()) {
+    // Make sure the frame size isn't unreasonably large.
+    DCHECK_LE(GetFrameSize(), GetMaximumFrameSize());
+
     for (int i = arraysize(kCoreCalleeSaves) - 1; i >= 0; --i) {
       Register reg = kCoreCalleeSaves[i];
       if (allocated_registers_.ContainsCoreRegister(reg)) {
@@ -1787,7 +1905,7 @@
     }
   }
 
-  MaybeIncrementHotness(/* is_frame_entry= */ true);
+  MaybeIncrementHotness(/* suspend_check= */ nullptr, /* is_frame_entry= */ true);
 }
 
 void CodeGeneratorX86_64::GenerateFrameExit() {
@@ -1949,8 +2067,9 @@
   Load64BitValue(location.AsRegister<CpuRegister>(), static_cast<int64_t>(value));
 }
 
-void CodeGeneratorX86_64::MoveLocation(
-    Location dst, Location src, DataType::Type dst_type ATTRIBUTE_UNUSED) {
+void CodeGeneratorX86_64::MoveLocation(Location dst,
+                                       Location src,
+                                       [[maybe_unused]] DataType::Type dst_type) {
   Move(dst, src);
 }
 
@@ -1973,7 +2092,7 @@
 
   HLoopInformation* info = block->GetLoopInformation();
   if (info != nullptr && info->IsBackEdge(*block) && info->HasSuspendCheck()) {
-    codegen_->MaybeIncrementHotness(/* is_frame_entry= */ false);
+    codegen_->MaybeIncrementHotness(info->GetSuspendCheck(), /* is_frame_entry= */ false);
     GenerateSuspendCheck(info->GetSuspendCheck(), successor);
     return;
   }
@@ -2009,8 +2128,7 @@
   exit->SetLocations(nullptr);
 }
 
-void InstructionCodeGeneratorX86_64::VisitExit(HExit* exit ATTRIBUTE_UNUSED) {
-}
+void InstructionCodeGeneratorX86_64::VisitExit([[maybe_unused]] HExit* exit) {}
 
 template<class LabelType>
 void InstructionCodeGeneratorX86_64::GenerateFPJumps(HCondition* cond,
@@ -2051,7 +2169,7 @@
       } else if (right.IsConstant()) {
         __ ucomiss(left.AsFpuRegister<XmmRegister>(),
                    codegen_->LiteralFloatAddress(
-                     right.GetConstant()->AsFloatConstant()->GetValue()));
+                       right.GetConstant()->AsFloatConstant()->GetValue()));
       } else {
         DCHECK(right.IsStackSlot());
         __ ucomiss(left.AsFpuRegister<XmmRegister>(),
@@ -2065,7 +2183,7 @@
       } else if (right.IsConstant()) {
         __ ucomisd(left.AsFpuRegister<XmmRegister>(),
                    codegen_->LiteralDoubleAddress(
-                     right.GetConstant()->AsDoubleConstant()->GetValue()));
+                       right.GetConstant()->AsDoubleConstant()->GetValue()));
       } else {
         DCHECK(right.IsDoubleStackSlot());
         __ ucomisd(left.AsFpuRegister<XmmRegister>(),
@@ -2119,13 +2237,17 @@
   }
 }
 
-static bool AreEflagsSetFrom(HInstruction* cond, HInstruction* branch) {
+static bool AreEflagsSetFrom(HInstruction* cond,
+                             HInstruction* branch,
+                             const CompilerOptions& compiler_options) {
   // Moves may affect the eflags register (move zero uses xorl), so the EFLAGS
   // are set only strictly before `branch`. We can't use the eflags on long
   // conditions if they are materialized due to the complex branching.
   return cond->IsCondition() &&
          cond->GetNext() == branch &&
-         !DataType::IsFloatingPointType(cond->InputAt(0)->GetType());
+         !DataType::IsFloatingPointType(cond->InputAt(0)->GetType()) &&
+         !(cond->GetBlock()->GetGraph()->IsCompilingBaseline() &&
+           compiler_options.ProfileBranches());
 }
 
 template<class LabelType>
@@ -2162,7 +2284,7 @@
   //        - condition true => branch to true_target
   //        - branch to false_target
   if (IsBooleanValueOrMaterializedCondition(cond)) {
-    if (AreEflagsSetFrom(cond, instruction)) {
+    if (AreEflagsSetFrom(cond, instruction, codegen_->GetCompilerOptions())) {
       if (true_target == nullptr) {
         __ j(X86_64IntegerCondition(cond->AsCondition()->GetOppositeCondition()), false_target);
       } else {
@@ -2215,7 +2337,14 @@
 void LocationsBuilderX86_64::VisitIf(HIf* if_instr) {
   LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(if_instr);
   if (IsBooleanValueOrMaterializedCondition(if_instr->InputAt(0))) {
-    locations->SetInAt(0, Location::Any());
+    if (GetGraph()->IsCompilingBaseline() &&
+        codegen_->GetCompilerOptions().ProfileBranches() &&
+        !Runtime::Current()->IsAotCompiler()) {
+      locations->SetInAt(0, Location::RequiresRegister());
+      locations->AddTemp(Location::RequiresRegister());
+    } else {
+      locations->SetInAt(0, Location::Any());
+    }
   }
 }
 
@@ -2226,6 +2355,33 @@
       nullptr : codegen_->GetLabelOf(true_successor);
   Label* false_target = codegen_->GoesToNextBlock(if_instr->GetBlock(), false_successor) ?
       nullptr : codegen_->GetLabelOf(false_successor);
+  if (IsBooleanValueOrMaterializedCondition(if_instr->InputAt(0))) {
+    if (GetGraph()->IsCompilingBaseline() &&
+        codegen_->GetCompilerOptions().ProfileBranches() &&
+        !Runtime::Current()->IsAotCompiler()) {
+      DCHECK(if_instr->InputAt(0)->IsCondition());
+      CpuRegister temp = if_instr->GetLocations()->GetTemp(0).AsRegister<CpuRegister>();
+      ProfilingInfo* info = GetGraph()->GetProfilingInfo();
+      DCHECK(info != nullptr);
+      BranchCache* cache = info->GetBranchCache(if_instr->GetDexPc());
+      // Currently, not all If branches are profiled.
+      if (cache != nullptr) {
+        uint64_t address =
+            reinterpret_cast64<uint64_t>(cache) + BranchCache::FalseOffset().Int32Value();
+        static_assert(
+            BranchCache::TrueOffset().Int32Value() - BranchCache::FalseOffset().Int32Value() == 2,
+            "Unexpected offsets for BranchCache");
+        NearLabel done;
+        Location lhs = if_instr->GetLocations()->InAt(0);
+        __ movq(CpuRegister(TMP), Immediate(address));
+        __ movzxw(temp, Address(CpuRegister(TMP), lhs.AsRegister<CpuRegister>(), TIMES_2, 0));
+        __ addw(temp, Immediate(1));
+        __ j(kZero, &done);
+        __ movw(Address(CpuRegister(TMP), lhs.AsRegister<CpuRegister>(), TIMES_2, 0), temp);
+        __ Bind(&done);
+      }
+    }
+  }
   GenerateTestAndBranch(if_instr, /* condition_input_index= */ 0, true_target, false_target);
 }
 
@@ -2318,7 +2474,7 @@
       if (!condition->IsEmittedAtUseSite()) {
         // This was a previously materialized condition.
         // Can we use the existing condition code?
-        if (AreEflagsSetFrom(condition, select)) {
+        if (AreEflagsSetFrom(condition, select, codegen_->GetCompilerOptions())) {
           // Materialization was the previous instruction.  Condition codes are right.
           cond = X86_64IntegerCondition(condition->GetCondition());
         } else {
@@ -2657,7 +2813,7 @@
   locations->SetOut(Location::ConstantLocation(constant));
 }
 
-void InstructionCodeGeneratorX86_64::VisitIntConstant(HIntConstant* constant ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86_64::VisitIntConstant([[maybe_unused]] HIntConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -2667,7 +2823,7 @@
   locations->SetOut(Location::ConstantLocation(constant));
 }
 
-void InstructionCodeGeneratorX86_64::VisitNullConstant(HNullConstant* constant ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86_64::VisitNullConstant([[maybe_unused]] HNullConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -2677,7 +2833,7 @@
   locations->SetOut(Location::ConstantLocation(constant));
 }
 
-void InstructionCodeGeneratorX86_64::VisitLongConstant(HLongConstant* constant ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86_64::VisitLongConstant([[maybe_unused]] HLongConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -2687,7 +2843,7 @@
   locations->SetOut(Location::ConstantLocation(constant));
 }
 
-void InstructionCodeGeneratorX86_64::VisitFloatConstant(HFloatConstant* constant ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86_64::VisitFloatConstant([[maybe_unused]] HFloatConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -2698,7 +2854,7 @@
 }
 
 void InstructionCodeGeneratorX86_64::VisitDoubleConstant(
-    HDoubleConstant* constant ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HDoubleConstant* constant) {
   // Will be generated at use site.
 }
 
@@ -2707,7 +2863,7 @@
 }
 
 void InstructionCodeGeneratorX86_64::VisitConstructorFence(
-    HConstructorFence* constructor_fence ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HConstructorFence* constructor_fence) {
   codegen_->GenerateMemoryBarrier(MemBarrierKind::kStoreStore);
 }
 
@@ -2723,7 +2879,7 @@
   ret->SetLocations(nullptr);
 }
 
-void InstructionCodeGeneratorX86_64::VisitReturnVoid(HReturnVoid* ret ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86_64::VisitReturnVoid([[maybe_unused]] HReturnVoid* ret) {
   codegen_->GenerateFrameExit();
 }
 
@@ -2996,23 +3152,27 @@
 void CodeGeneratorX86_64::MaybeGenerateInlineCacheCheck(HInstruction* instruction,
                                                         CpuRegister klass) {
   DCHECK_EQ(RDI, klass.AsRegister());
-  // We know the destination of an intrinsic, so no need to record inline
-  // caches.
-  if (!instruction->GetLocations()->Intrinsified() &&
-      GetGraph()->IsCompilingBaseline() &&
-      !Runtime::Current()->IsAotCompiler()) {
+  if (ProfilingInfoBuilder::IsInlineCacheUseful(instruction->AsInvoke(), this)) {
     ProfilingInfo* info = GetGraph()->GetProfilingInfo();
     DCHECK(info != nullptr);
-    InlineCache* cache = info->GetInlineCache(instruction->GetDexPc());
-    uint64_t address = reinterpret_cast64<uint64_t>(cache);
-    NearLabel done;
-    __ movq(CpuRegister(TMP), Immediate(address));
-    // Fast path for a monomorphic cache.
-    __ cmpl(Address(CpuRegister(TMP), InlineCache::ClassesOffset().Int32Value()), klass);
-    __ j(kEqual, &done);
-    GenerateInvokeRuntime(
-        GetThreadOffset<kX86_64PointerSize>(kQuickUpdateInlineCache).Int32Value());
-    __ Bind(&done);
+    InlineCache* cache = ProfilingInfoBuilder::GetInlineCache(
+        info, GetCompilerOptions(), instruction->AsInvoke());
+    if (cache != nullptr) {
+      uint64_t address = reinterpret_cast64<uint64_t>(cache);
+      NearLabel done;
+      __ movq(CpuRegister(TMP), Immediate(address));
+      // Fast path for a monomorphic cache.
+      __ cmpl(Address(CpuRegister(TMP), InlineCache::ClassesOffset().Int32Value()), klass);
+      __ j(kEqual, &done);
+      GenerateInvokeRuntime(
+          GetThreadOffset<kX86_64PointerSize>(kQuickUpdateInlineCache).Int32Value());
+      __ Bind(&done);
+    } else {
+      // This is unexpected, but we don't guarantee stable compilation across
+      // JIT runs so just warn about it.
+      ScopedObjectAccess soa(Thread::Current());
+      LOG(WARNING) << "Missing inline cache for " << GetGraph()->GetArtMethod()->PrettyMethod();
+    }
   }
 }
 
@@ -4972,7 +5132,7 @@
 }
 
 void InstructionCodeGeneratorX86_64::VisitParameterValue(
-    HParameterValue* instruction ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HParameterValue* instruction) {
   // Nothing to do, the parameter is already at its location.
 }
 
@@ -4983,7 +5143,7 @@
 }
 
 void InstructionCodeGeneratorX86_64::VisitCurrentMethod(
-    HCurrentMethod* instruction ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HCurrentMethod* instruction) {
   // Nothing to do, the method is already at its location.
 }
 
@@ -5062,7 +5222,7 @@
   locations->SetOut(Location::Any());
 }
 
-void InstructionCodeGeneratorX86_64::VisitPhi(HPhi* instruction ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86_64::VisitPhi([[maybe_unused]] HPhi* instruction) {
   LOG(FATAL) << "Unimplemented";
 }
 
@@ -5091,13 +5251,10 @@
 }
 
 void LocationsBuilderX86_64::HandleFieldGet(HInstruction* instruction) {
-  DCHECK(instruction->IsInstanceFieldGet() ||
-         instruction->IsStaticFieldGet() ||
-         instruction->IsPredicatedInstanceFieldGet());
+  DCHECK(instruction->IsInstanceFieldGet() || instruction->IsStaticFieldGet());
 
   bool object_field_get_with_read_barrier =
-      gUseReadBarrier && (instruction->GetType() == DataType::Type::kReference);
-  bool is_predicated = instruction->IsPredicatedInstanceFieldGet();
+      (instruction->GetType() == DataType::Type::kReference) && codegen_->EmitReadBarrier();
   LocationSummary* locations =
       new (GetGraph()->GetAllocator()) LocationSummary(instruction,
                                                        object_field_get_with_read_barrier
@@ -5107,37 +5264,26 @@
     locations->SetCustomSlowPathCallerSaves(RegisterSet::Empty());  // No caller-save registers.
   }
   // receiver_input
-  locations->SetInAt(is_predicated ? 1 : 0, Location::RequiresRegister());
-  if (is_predicated) {
-    if (DataType::IsFloatingPointType(instruction->GetType())) {
-      locations->SetInAt(0, Location::RequiresFpuRegister());
-    } else {
-      locations->SetInAt(0, Location::RequiresRegister());
-    }
-  }
+  locations->SetInAt(0, Location::RequiresRegister());
   if (DataType::IsFloatingPointType(instruction->GetType())) {
-    locations->SetOut(is_predicated ? Location::SameAsFirstInput()
-                                    : Location::RequiresFpuRegister());
+    locations->SetOut(Location::RequiresFpuRegister());
   } else {
     // The output overlaps for an object field get when read barriers are
     // enabled: we do not want the move to overwrite the object's location, as
     // we need it to emit the read barrier. For predicated instructions we can
     // always overlap since the output is SameAsFirst and the default value.
-    locations->SetOut(is_predicated ? Location::SameAsFirstInput() : Location::RequiresRegister(),
-                      object_field_get_with_read_barrier || is_predicated
-                          ? Location::kOutputOverlap
-                          : Location::kNoOutputOverlap);
+    locations->SetOut(
+        Location::RequiresRegister(),
+        object_field_get_with_read_barrier ? Location::kOutputOverlap : Location::kNoOutputOverlap);
   }
 }
 
 void InstructionCodeGeneratorX86_64::HandleFieldGet(HInstruction* instruction,
                                                     const FieldInfo& field_info) {
-  DCHECK(instruction->IsInstanceFieldGet() ||
-         instruction->IsStaticFieldGet() ||
-         instruction->IsPredicatedInstanceFieldGet());
+  DCHECK(instruction->IsInstanceFieldGet() || instruction->IsStaticFieldGet());
 
   LocationSummary* locations = instruction->GetLocations();
-  Location base_loc = locations->InAt(instruction->IsPredicatedInstanceFieldGet() ? 1 : 0);
+  Location base_loc = locations->InAt(0);
   CpuRegister base = base_loc.AsRegister<CpuRegister>();
   Location out = locations->Out();
   bool is_volatile = field_info.IsVolatile();
@@ -5147,7 +5293,7 @@
 
   if (load_type == DataType::Type::kReference) {
     // /* HeapReference<Object> */ out = *(base + offset)
-    if (gUseReadBarrier && kUseBakerReadBarrier) {
+    if (codegen_->EmitBakerReadBarrier()) {
       // Note that a potential implicit null check is handled in this
       // CodeGeneratorX86_64::GenerateFieldLoadWithBakerReadBarrier call.
       codegen_->GenerateFieldLoadWithBakerReadBarrier(
@@ -5176,7 +5322,8 @@
 }
 
 void LocationsBuilderX86_64::HandleFieldSet(HInstruction* instruction,
-                                            const FieldInfo& field_info) {
+                                            const FieldInfo& field_info,
+                                            WriteBarrierKind write_barrier_kind) {
   DCHECK(instruction->IsInstanceFieldSet() || instruction->IsStaticFieldSet());
 
   LocationSummary* locations =
@@ -5184,7 +5331,9 @@
   DataType::Type field_type = field_info.GetFieldType();
   bool is_volatile = field_info.IsVolatile();
   bool needs_write_barrier =
-      CodeGenerator::StoreNeedsWriteBarrier(field_type, instruction->InputAt(1));
+      codegen_->StoreNeedsWriteBarrier(field_type, instruction->InputAt(1), write_barrier_kind);
+  bool check_gc_card =
+      codegen_->ShouldCheckGCCard(field_type, instruction->InputAt(1), write_barrier_kind);
 
   locations->SetInAt(0, Location::RequiresRegister());
   if (DataType::IsFloatingPointType(instruction->InputAt(1)->GetType())) {
@@ -5204,14 +5353,13 @@
   }
 
   // TODO(solanes): We could reduce the temp usage but it requires some non-trivial refactoring of
-  // InstructionCodeGeneratorX86_64::HandleFieldSet.
-  if (needs_write_barrier) {
+  // InstructionCodeGeneratorX86_64::HandleFieldSet, GenerateVarHandleSet due to `extra_temp_index`.
+  if (needs_write_barrier ||
+      check_gc_card ||
+      (kPoisonHeapReferences && field_type == DataType::Type::kReference)) {
     // Temporary registers for the write barrier.
     locations->AddTemp(Location::RequiresRegister());
     locations->AddTemp(Location::RequiresRegister());  // Possibly used for reference poisoning too.
-  } else if (kPoisonHeapReferences && field_type == DataType::Type::kReference) {
-    // Temporary register for the reference poisoning.
-    locations->AddTemp(Location::RequiresRegister());
   }
 }
 
@@ -5385,16 +5533,35 @@
     codegen_->MaybeRecordImplicitNullCheck(instruction);
   }
 
-  if (CodeGenerator::StoreNeedsWriteBarrier(field_type, instruction->InputAt(value_index)) &&
-      write_barrier_kind != WriteBarrierKind::kDontEmit) {
+  bool needs_write_barrier =
+      codegen_->StoreNeedsWriteBarrier(field_type, instruction->InputAt(1), write_barrier_kind);
+  if (needs_write_barrier) {
+    if (value.IsConstant()) {
+      DCHECK(value.GetConstant()->IsNullConstant());
+      if (write_barrier_kind == WriteBarrierKind::kEmitBeingReliedOn) {
+        DCHECK_NE(extra_temp_index, 0u);
+        CpuRegister temp = locations->GetTemp(0).AsRegister<CpuRegister>();
+        CpuRegister card = locations->GetTemp(extra_temp_index).AsRegister<CpuRegister>();
+        codegen_->MarkGCCard(temp, card, base);
+      }
+    } else {
+      DCHECK_NE(extra_temp_index, 0u);
+      CpuRegister temp = locations->GetTemp(0).AsRegister<CpuRegister>();
+      CpuRegister card = locations->GetTemp(extra_temp_index).AsRegister<CpuRegister>();
+      codegen_->MaybeMarkGCCard(
+          temp,
+          card,
+          base,
+          value.AsRegister<CpuRegister>(),
+          value_can_be_null && write_barrier_kind == WriteBarrierKind::kEmitNotBeingReliedOn);
+    }
+  } else if (codegen_->ShouldCheckGCCard(
+                 field_type, instruction->InputAt(value_index), write_barrier_kind)) {
+    DCHECK_NE(extra_temp_index, 0u);
+    DCHECK(value.IsRegister());
     CpuRegister temp = locations->GetTemp(0).AsRegister<CpuRegister>();
     CpuRegister card = locations->GetTemp(extra_temp_index).AsRegister<CpuRegister>();
-    codegen_->MarkGCCard(
-        temp,
-        card,
-        base,
-        value.AsRegister<CpuRegister>(),
-        value_can_be_null && write_barrier_kind == WriteBarrierKind::kEmitWithNullCheck);
+    codegen_->CheckGCCardIsValid(temp, card, base);
   }
 
   if (is_volatile) {
@@ -5413,14 +5580,6 @@
   bool is_volatile = field_info.IsVolatile();
   DataType::Type field_type = field_info.GetFieldType();
   uint32_t offset = field_info.GetFieldOffset().Uint32Value();
-  bool is_predicated =
-      instruction->IsInstanceFieldSet() && instruction->AsInstanceFieldSet()->GetIsPredicatedSet();
-
-  NearLabel pred_is_null;
-  if (is_predicated) {
-    __ testl(base, base);
-    __ j(kZero, &pred_is_null);
-  }
 
   HandleFieldSet(instruction,
                  /*value_index=*/ 1,
@@ -5433,14 +5592,10 @@
                  value_can_be_null,
                  /*byte_swap=*/ false,
                  write_barrier_kind);
-
-  if (is_predicated) {
-    __ Bind(&pred_is_null);
-  }
 }
 
 void LocationsBuilderX86_64::VisitInstanceFieldSet(HInstanceFieldSet* instruction) {
-  HandleFieldSet(instruction, instruction->GetFieldInfo());
+  HandleFieldSet(instruction, instruction->GetFieldInfo(), instruction->GetWriteBarrierKind());
 }
 
 void InstructionCodeGeneratorX86_64::VisitInstanceFieldSet(HInstanceFieldSet* instruction) {
@@ -5450,26 +5605,10 @@
                  instruction->GetWriteBarrierKind());
 }
 
-void LocationsBuilderX86_64::VisitPredicatedInstanceFieldGet(
-    HPredicatedInstanceFieldGet* instruction) {
-  HandleFieldGet(instruction);
-}
-
 void LocationsBuilderX86_64::VisitInstanceFieldGet(HInstanceFieldGet* instruction) {
   HandleFieldGet(instruction);
 }
 
-void InstructionCodeGeneratorX86_64::VisitPredicatedInstanceFieldGet(
-    HPredicatedInstanceFieldGet* instruction) {
-  NearLabel finish;
-  LocationSummary* locations = instruction->GetLocations();
-  CpuRegister target = locations->InAt(1).AsRegister<CpuRegister>();
-  __ testl(target, target);
-  __ j(kZero, &finish);
-  HandleFieldGet(instruction, instruction->GetFieldInfo());
-  __ Bind(&finish);
-}
-
 void InstructionCodeGeneratorX86_64::VisitInstanceFieldGet(HInstanceFieldGet* instruction) {
   HandleFieldGet(instruction, instruction->GetFieldInfo());
 }
@@ -5483,7 +5622,7 @@
 }
 
 void LocationsBuilderX86_64::VisitStaticFieldSet(HStaticFieldSet* instruction) {
-  HandleFieldSet(instruction, instruction->GetFieldInfo());
+  HandleFieldSet(instruction, instruction->GetFieldInfo(), instruction->GetWriteBarrierKind());
 }
 
 void InstructionCodeGeneratorX86_64::VisitStaticFieldSet(HStaticFieldSet* instruction) {
@@ -5615,7 +5754,7 @@
 
 void LocationsBuilderX86_64::VisitArrayGet(HArrayGet* instruction) {
   bool object_array_get_with_read_barrier =
-      gUseReadBarrier && (instruction->GetType() == DataType::Type::kReference);
+      (instruction->GetType() == DataType::Type::kReference) && codegen_->EmitReadBarrier();
   LocationSummary* locations =
       new (GetGraph()->GetAllocator()) LocationSummary(instruction,
                                                        object_array_get_with_read_barrier
@@ -5653,7 +5792,7 @@
         "art::mirror::HeapReference<art::mirror::Object> and int32_t have different sizes.");
     // /* HeapReference<Object> */ out =
     //     *(obj + data_offset + index * sizeof(HeapReference<Object>))
-    if (gUseReadBarrier && kUseBakerReadBarrier) {
+    if (codegen_->EmitBakerReadBarrier()) {
       // Note that a potential implicit null check is handled in this
       // CodeGeneratorX86_64::GenerateArrayLoadWithBakerReadBarrier call.
       codegen_->GenerateArrayLoadWithBakerReadBarrier(
@@ -5704,8 +5843,11 @@
 void LocationsBuilderX86_64::VisitArraySet(HArraySet* instruction) {
   DataType::Type value_type = instruction->GetComponentType();
 
+  WriteBarrierKind write_barrier_kind = instruction->GetWriteBarrierKind();
   bool needs_write_barrier =
-      CodeGenerator::StoreNeedsWriteBarrier(value_type, instruction->GetValue());
+      codegen_->StoreNeedsWriteBarrier(value_type, instruction->GetValue(), write_barrier_kind);
+  bool check_gc_card =
+      codegen_->ShouldCheckGCCard(value_type, instruction->GetValue(), write_barrier_kind);
   bool needs_type_check = instruction->NeedsTypeCheck();
 
   LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(
@@ -5720,13 +5862,16 @@
     locations->SetInAt(2, Location::RegisterOrConstant(instruction->InputAt(2)));
   }
 
-  if (needs_write_barrier) {
-    // Used by reference poisoning or emitting write barrier.
+  if (needs_write_barrier || check_gc_card) {
+    // Used by reference poisoning, type checking, emitting write barrier, or checking write
+    // barrier.
     locations->AddTemp(Location::RequiresRegister());
-    if (instruction->GetWriteBarrierKind() != WriteBarrierKind::kDontEmit) {
-      // Only used when emitting a write barrier.
-      locations->AddTemp(Location::RequiresRegister());
-    }
+    // Only used when emitting a write barrier, or when checking for the card table.
+    locations->AddTemp(Location::RequiresRegister());
+  } else if ((kPoisonHeapReferences && value_type == DataType::Type::kReference) ||
+             instruction->NeedsTypeCheck()) {
+    // Used for poisoning or type checking.
+    locations->AddTemp(Location::RequiresRegister());
   }
 }
 
@@ -5738,8 +5883,9 @@
   Location value = locations->InAt(2);
   DataType::Type value_type = instruction->GetComponentType();
   bool needs_type_check = instruction->NeedsTypeCheck();
+  const WriteBarrierKind write_barrier_kind = instruction->GetWriteBarrierKind();
   bool needs_write_barrier =
-      CodeGenerator::StoreNeedsWriteBarrier(value_type, instruction->GetValue());
+      codegen_->StoreNeedsWriteBarrier(value_type, instruction->GetValue(), write_barrier_kind);
 
   switch (value_type) {
     case DataType::Type::kBool:
@@ -5780,16 +5926,19 @@
         DCHECK(value.IsConstant()) << value;
         __ movl(address, Immediate(0));
         codegen_->MaybeRecordImplicitNullCheck(instruction);
-        DCHECK(!needs_write_barrier);
+        if (write_barrier_kind == WriteBarrierKind::kEmitBeingReliedOn) {
+          // We need to set a write barrier here even though we are writing null, since this write
+          // barrier is being relied on.
+          DCHECK(needs_write_barrier);
+          CpuRegister temp = locations->GetTemp(0).AsRegister<CpuRegister>();
+          CpuRegister card = locations->GetTemp(1).AsRegister<CpuRegister>();
+          codegen_->MarkGCCard(temp, card, array);
+        }
         DCHECK(!needs_type_check);
         break;
       }
 
-      DCHECK(needs_write_barrier);
       CpuRegister register_value = value.AsRegister<CpuRegister>();
-      Location temp_loc = locations->GetTemp(0);
-      CpuRegister temp = temp_loc.AsRegister<CpuRegister>();
-
       bool can_value_be_null = instruction->GetValueCanBeNull();
       NearLabel do_store;
       if (can_value_be_null) {
@@ -5814,6 +5963,7 @@
         // false negative, in which case we would take the ArraySet
         // slow path.
 
+        CpuRegister temp = locations->GetTemp(0).AsRegister<CpuRegister>();
         // /* HeapReference<Class> */ temp = array->klass_
         __ movl(temp, Address(array, class_offset));
         codegen_->MaybeRecordImplicitNullCheck(instruction);
@@ -5844,24 +5994,30 @@
         }
       }
 
-      if (instruction->GetWriteBarrierKind() != WriteBarrierKind::kDontEmit) {
-        DCHECK_EQ(instruction->GetWriteBarrierKind(), WriteBarrierKind::kEmitNoNullCheck)
-            << " Already null checked so we shouldn't do it again.";
-        CpuRegister card = locations->GetTemp(1).AsRegister<CpuRegister>();
-        codegen_->MarkGCCard(temp,
-                             card,
-                             array,
-                             value.AsRegister<CpuRegister>(),
-                             /* emit_null_check= */ false);
-      }
-
       if (can_value_be_null) {
         DCHECK(do_store.IsLinked());
         __ Bind(&do_store);
       }
 
+      if (needs_write_barrier) {
+        // TODO(solanes): The WriteBarrierKind::kEmitNotBeingReliedOn case should be able to skip
+        // this write barrier when its value is null (without an extra testl since we already
+        // checked if the value is null for the type check). This will be done as a follow-up since
+        // it is a runtime optimization that needs extra care.
+        CpuRegister temp = locations->GetTemp(0).AsRegister<CpuRegister>();
+        CpuRegister card = locations->GetTemp(1).AsRegister<CpuRegister>();
+        codegen_->MarkGCCard(temp, card, array);
+      } else if (codegen_->ShouldCheckGCCard(
+                     value_type, instruction->GetValue(), write_barrier_kind)) {
+        CpuRegister temp = locations->GetTemp(0).AsRegister<CpuRegister>();
+        CpuRegister card = locations->GetTemp(1).AsRegister<CpuRegister>();
+        codegen_->CheckGCCardIsValid(temp, card, array);
+      }
+
       Location source = value;
       if (kPoisonHeapReferences) {
+        Location temp_loc = locations->GetTemp(0);
+        CpuRegister temp = temp_loc.AsRegister<CpuRegister>();
         __ movl(temp, register_value);
         __ PoisonHeapReference(temp);
         source = temp_loc;
@@ -5930,8 +6086,7 @@
         __ movsd(address, value.AsFpuRegister<XmmRegister>());
         codegen_->MaybeRecordImplicitNullCheck(instruction);
       } else {
-        int64_t v =
-            bit_cast<int64_t, double>(value.GetConstant()->AsDoubleConstant()->GetValue());
+        int64_t v = bit_cast<int64_t, double>(value.GetConstant()->AsDoubleConstant()->GetValue());
         Address address_high =
             CodeGeneratorX86_64::ArrayAddress(array, index, TIMES_8, offset + sizeof(int32_t));
         codegen_->MoveInt64ToAddress(address, address_high, v, instruction);
@@ -6048,21 +6203,28 @@
   }
 }
 
-void CodeGeneratorX86_64::MarkGCCard(CpuRegister temp,
-                                     CpuRegister card,
-                                     CpuRegister object,
-                                     CpuRegister value,
-                                     bool emit_null_check) {
+void CodeGeneratorX86_64::MaybeMarkGCCard(CpuRegister temp,
+                                          CpuRegister card,
+                                          CpuRegister object,
+                                          CpuRegister value,
+                                          bool emit_null_check) {
   NearLabel is_null;
   if (emit_null_check) {
     __ testl(value, value);
     __ j(kEqual, &is_null);
   }
+  MarkGCCard(temp, card, object);
+  if (emit_null_check) {
+    __ Bind(&is_null);
+  }
+}
+
+void CodeGeneratorX86_64::MarkGCCard(CpuRegister temp, CpuRegister card, CpuRegister object) {
   // Load the address of the card table into `card`.
-  __ gs()->movq(card, Address::Absolute(Thread::CardTableOffset<kX86_64PointerSize>().Int32Value(),
-                                        /* no_rip= */ true));
-  // Calculate the offset (in the card table) of the card corresponding to
-  // `object`.
+  __ gs()->movq(card,
+                Address::Absolute(Thread::CardTableOffset<kX86_64PointerSize>().Int32Value(),
+                                  /* no_rip= */ true));
+  // Calculate the offset (in the card table) of the card corresponding to `object`.
   __ movq(temp, object);
   __ shrq(temp, Immediate(gc::accounting::CardTable::kCardShift));
   // Write the `art::gc::accounting::CardTable::kCardDirty` value into the
@@ -6079,12 +6241,30 @@
   // of the card to mark; and 2. to load the `kCardDirty` value) saves a load
   // (no need to explicitly load `kCardDirty` as an immediate value).
   __ movb(Address(temp, card, TIMES_1, 0), card);
-  if (emit_null_check) {
-    __ Bind(&is_null);
-  }
 }
 
-void LocationsBuilderX86_64::VisitParallelMove(HParallelMove* instruction ATTRIBUTE_UNUSED) {
+void CodeGeneratorX86_64::CheckGCCardIsValid(CpuRegister temp,
+                                             CpuRegister card,
+                                             CpuRegister object) {
+  NearLabel done;
+  // Load the address of the card table into `card`.
+  __ gs()->movq(card,
+                Address::Absolute(Thread::CardTableOffset<kX86_64PointerSize>().Int32Value(),
+                                  /* no_rip= */ true));
+  // Calculate the offset (in the card table) of the card corresponding to `object`.
+  __ movq(temp, object);
+  __ shrq(temp, Immediate(gc::accounting::CardTable::kCardShift));
+  // assert (!clean || !self->is_gc_marking)
+  __ cmpb(Address(temp, card, TIMES_1, 0), Immediate(gc::accounting::CardTable::kCardClean));
+  __ j(kNotEqual, &done);
+  __ gs()->cmpl(Address::Absolute(Thread::IsGcMarkingOffset<kX86_64PointerSize>(), true),
+                Immediate(0));
+  __ j(kEqual, &done);
+  __ int3();
+  __ Bind(&done);
+}
+
+void LocationsBuilderX86_64::VisitParallelMove([[maybe_unused]] HParallelMove* instruction) {
   LOG(FATAL) << "Unimplemented";
 }
 
@@ -6458,7 +6638,7 @@
             load_kind == HLoadClass::LoadKind::kBssEntryPublic ||
                 load_kind == HLoadClass::LoadKind::kBssEntryPackage);
 
-  const bool requires_read_barrier = gUseReadBarrier && !cls->IsInBootImage();
+  const bool requires_read_barrier = !cls->IsInBootImage() && codegen_->EmitReadBarrier();
   LocationSummary::CallKind call_kind = (cls->NeedsEnvironment() || requires_read_barrier)
       ? LocationSummary::kCallOnSlowPath
       : LocationSummary::kNoCall;
@@ -6471,12 +6651,14 @@
     locations->SetInAt(0, Location::RequiresRegister());
   }
   locations->SetOut(Location::RequiresRegister());
-  if (load_kind == HLoadClass::LoadKind::kBssEntry) {
-    if (!gUseReadBarrier || kUseBakerReadBarrier) {
+  if (load_kind == HLoadClass::LoadKind::kBssEntry ||
+      load_kind == HLoadClass::LoadKind::kBssEntryPublic ||
+      load_kind == HLoadClass::LoadKind::kBssEntryPackage) {
+    if (codegen_->EmitNonBakerReadBarrier()) {
+      // For non-Baker read barrier we have a temp-clobbering call.
+    } else {
       // Rely on the type resolution and/or initialization to save everything.
       locations->SetCustomSlowPathCallerSaves(OneRegInReferenceOutSaveEverythingCallerSaves());
-    } else {
-      // For non-Baker read barrier we have a temp-clobbering call.
     }
   }
 }
@@ -6507,9 +6689,8 @@
   Location out_loc = locations->Out();
   CpuRegister out = out_loc.AsRegister<CpuRegister>();
 
-  const ReadBarrierOption read_barrier_option = cls->IsInBootImage()
-      ? kWithoutReadBarrier
-      : gCompilerReadBarrierOption;
+  const ReadBarrierOption read_barrier_option =
+      cls->IsInBootImage() ? kWithoutReadBarrier : codegen_->GetCompilerReadBarrierOption();
   bool generate_null_check = false;
   switch (load_kind) {
     case HLoadClass::LoadKind::kReferrersClass: {
@@ -6612,13 +6793,50 @@
 }
 
 void LocationsBuilderX86_64::VisitLoadMethodType(HLoadMethodType* load) {
-  // Custom calling convention: RAX serves as both input and output.
-  Location location = Location::RegisterLocation(RAX);
-  CodeGenerator::CreateLoadMethodTypeRuntimeCallLocationSummary(load, location, location);
+  LocationSummary* locations =
+      new (GetGraph()->GetAllocator()) LocationSummary(load, LocationSummary::kCallOnSlowPath);
+  if (load->GetLoadKind() == HLoadMethodType::LoadKind::kRuntimeCall) {
+      Location location = Location::RegisterLocation(RAX);
+      CodeGenerator::CreateLoadMethodTypeRuntimeCallLocationSummary(load, location, location);
+  } else {
+    DCHECK_EQ(load->GetLoadKind(), HLoadMethodType::LoadKind::kBssEntry);
+    locations->SetOut(Location::RequiresRegister());
+    if (codegen_->EmitNonBakerReadBarrier()) {
+      // For non-Baker read barrier we have a temp-clobbering call.
+    } else {
+      // Rely on the pResolveMethodType to save everything.
+      locations->SetCustomSlowPathCallerSaves(OneRegInReferenceOutSaveEverythingCallerSaves());
+    }
+  }
 }
 
 void InstructionCodeGeneratorX86_64::VisitLoadMethodType(HLoadMethodType* load) {
-  codegen_->GenerateLoadMethodTypeRuntimeCall(load);
+  LocationSummary* locations = load->GetLocations();
+  Location out_loc = locations->Out();
+  CpuRegister out = out_loc.AsRegister<CpuRegister>();
+
+  switch (load->GetLoadKind()) {
+    case HLoadMethodType::LoadKind::kBssEntry: {
+      Address address = Address::Absolute(CodeGeneratorX86_64::kPlaceholder32BitOffset,
+                                          /* no_rip= */ false);
+      Label* fixup_label = codegen_->NewMethodTypeBssEntryPatch(load);
+      // /* GcRoot<mirror::MethodType> */ out = *address  /* PC-relative */
+      GenerateGcRootFieldLoad(
+          load, out_loc, address, fixup_label, codegen_->GetCompilerReadBarrierOption());
+      // No need for memory fence, thanks to the x86-64 memory model.
+      SlowPathCode* slow_path =
+          new (codegen_->GetScopedAllocator()) LoadMethodTypeSlowPathX86_64(load);
+      codegen_->AddSlowPath(slow_path);
+      __ testl(out, out);
+      __ j(kEqual, slow_path->GetEntryLabel());
+      __ Bind(slow_path->GetExitLabel());
+      return;
+    }
+    default:
+      DCHECK_EQ(load->GetLoadKind(), HLoadMethodType::LoadKind::kRuntimeCall);
+      codegen_->GenerateLoadMethodTypeRuntimeCall(load);
+      break;
+  }
 }
 
 void InstructionCodeGeneratorX86_64::VisitClinitCheck(HClinitCheck* check) {
@@ -6649,18 +6867,18 @@
 }
 
 void LocationsBuilderX86_64::VisitLoadString(HLoadString* load) {
-  LocationSummary::CallKind call_kind = CodeGenerator::GetLoadStringCallKind(load);
+  LocationSummary::CallKind call_kind = codegen_->GetLoadStringCallKind(load);
   LocationSummary* locations = new (GetGraph()->GetAllocator()) LocationSummary(load, call_kind);
   if (load->GetLoadKind() == HLoadString::LoadKind::kRuntimeCall) {
     locations->SetOut(Location::RegisterLocation(RAX));
   } else {
     locations->SetOut(Location::RequiresRegister());
     if (load->GetLoadKind() == HLoadString::LoadKind::kBssEntry) {
-      if (!gUseReadBarrier || kUseBakerReadBarrier) {
+      if (codegen_->EmitNonBakerReadBarrier()) {
+        // For non-Baker read barrier we have a temp-clobbering call.
+      } else {
         // Rely on the pResolveString to save everything.
         locations->SetCustomSlowPathCallerSaves(OneRegInReferenceOutSaveEverythingCallerSaves());
-      } else {
-        // For non-Baker read barrier we have a temp-clobbering call.
       }
     }
   }
@@ -6704,7 +6922,8 @@
                                           /* no_rip= */ false);
       Label* fixup_label = codegen_->NewStringBssEntryPatch(load);
       // /* GcRoot<mirror::Class> */ out = *address  /* PC-relative */
-      GenerateGcRootFieldLoad(load, out_loc, address, fixup_label, gCompilerReadBarrierOption);
+      GenerateGcRootFieldLoad(
+          load, out_loc, address, fixup_label, codegen_->GetCompilerReadBarrierOption());
       // No need for memory fence, thanks to the x86-64 memory model.
       SlowPathCode* slow_path = new (codegen_->GetScopedAllocator()) LoadStringSlowPathX86_64(load);
       codegen_->AddSlowPath(slow_path);
@@ -6725,14 +6944,14 @@
       Label* fixup_label = codegen_->NewJitRootStringPatch(
           load->GetDexFile(), load->GetStringIndex(), load->GetString());
       // /* GcRoot<mirror::String> */ out = *address
-      GenerateGcRootFieldLoad(load, out_loc, address, fixup_label, gCompilerReadBarrierOption);
+      GenerateGcRootFieldLoad(
+          load, out_loc, address, fixup_label, codegen_->GetCompilerReadBarrierOption());
       return;
     }
     default:
       break;
   }
 
-  // TODO: Re-add the compiler code to do string dex cache lookup again.
   // Custom calling convention: RAX serves as both input and output.
   __ movl(CpuRegister(RAX), Immediate(load->GetStringIndex().index_));
   codegen_->InvokeRuntime(kQuickResolveString,
@@ -6760,7 +6979,7 @@
   new (GetGraph()->GetAllocator()) LocationSummary(clear, LocationSummary::kNoCall);
 }
 
-void InstructionCodeGeneratorX86_64::VisitClearException(HClearException* clear ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86_64::VisitClearException([[maybe_unused]] HClearException* clear) {
   __ gs()->movl(GetExceptionTlsAddress(), Immediate(0));
 }
 
@@ -6777,8 +6996,8 @@
 }
 
 // Temp is used for read barrier.
-static size_t NumberOfInstanceOfTemps(TypeCheckKind type_check_kind) {
-  if (gUseReadBarrier &&
+static size_t NumberOfInstanceOfTemps(bool emit_read_barrier, TypeCheckKind type_check_kind) {
+  if (emit_read_barrier &&
       !kUseBakerReadBarrier &&
       (type_check_kind == TypeCheckKind::kAbstractClassCheck ||
        type_check_kind == TypeCheckKind::kClassHierarchyCheck ||
@@ -6791,11 +7010,11 @@
 // Interface case has 2 temps, one for holding the number of interfaces, one for the current
 // interface pointer, the current interface is compared in memory.
 // The other checks have one temp for loading the object's class.
-static size_t NumberOfCheckCastTemps(TypeCheckKind type_check_kind) {
+static size_t NumberOfCheckCastTemps(bool emit_read_barrier, TypeCheckKind type_check_kind) {
   if (type_check_kind == TypeCheckKind::kInterfaceCheck) {
     return 2;
   }
-  return 1 + NumberOfInstanceOfTemps(type_check_kind);
+  return 1 + NumberOfInstanceOfTemps(emit_read_barrier, type_check_kind);
 }
 
 void LocationsBuilderX86_64::VisitInstanceOf(HInstanceOf* instruction) {
@@ -6807,7 +7026,7 @@
     case TypeCheckKind::kAbstractClassCheck:
     case TypeCheckKind::kClassHierarchyCheck:
     case TypeCheckKind::kArrayObjectCheck: {
-      bool needs_read_barrier = CodeGenerator::InstanceOfNeedsReadBarrier(instruction);
+      bool needs_read_barrier = codegen_->InstanceOfNeedsReadBarrier(instruction);
       call_kind = needs_read_barrier ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall;
       baker_read_barrier_slow_path = kUseBakerReadBarrier && needs_read_barrier;
       break;
@@ -6836,7 +7055,8 @@
   }
   // Note that TypeCheckSlowPathX86_64 uses this "out" register too.
   locations->SetOut(Location::RequiresRegister());
-  locations->AddRegisterTemps(NumberOfInstanceOfTemps(type_check_kind));
+  locations->AddRegisterTemps(
+      NumberOfInstanceOfTemps(codegen_->EmitReadBarrier(), type_check_kind));
 }
 
 void InstructionCodeGeneratorX86_64::VisitInstanceOf(HInstanceOf* instruction) {
@@ -6847,7 +7067,7 @@
   Location cls = locations->InAt(1);
   Location out_loc =  locations->Out();
   CpuRegister out = out_loc.AsRegister<CpuRegister>();
-  const size_t num_temps = NumberOfInstanceOfTemps(type_check_kind);
+  const size_t num_temps = NumberOfInstanceOfTemps(codegen_->EmitReadBarrier(), type_check_kind);
   DCHECK_LE(num_temps, 1u);
   Location maybe_temp_loc = (num_temps >= 1u) ? locations->GetTemp(0) : Location::NoLocation();
   uint32_t class_offset = mirror::Object::ClassOffset().Int32Value();
@@ -6867,7 +7087,7 @@
   switch (type_check_kind) {
     case TypeCheckKind::kExactCheck: {
       ReadBarrierOption read_barrier_option =
-          CodeGenerator::ReadBarrierOptionForInstanceOf(instruction);
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
       // /* HeapReference<Class> */ out = obj->klass_
       GenerateReferenceLoadTwoRegisters(instruction,
                                         out_loc,
@@ -6895,7 +7115,7 @@
 
     case TypeCheckKind::kAbstractClassCheck: {
       ReadBarrierOption read_barrier_option =
-          CodeGenerator::ReadBarrierOptionForInstanceOf(instruction);
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
       // /* HeapReference<Class> */ out = obj->klass_
       GenerateReferenceLoadTwoRegisters(instruction,
                                         out_loc,
@@ -6931,7 +7151,7 @@
 
     case TypeCheckKind::kClassHierarchyCheck: {
       ReadBarrierOption read_barrier_option =
-          CodeGenerator::ReadBarrierOptionForInstanceOf(instruction);
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
       // /* HeapReference<Class> */ out = obj->klass_
       GenerateReferenceLoadTwoRegisters(instruction,
                                         out_loc,
@@ -6968,7 +7188,7 @@
 
     case TypeCheckKind::kArrayObjectCheck: {
       ReadBarrierOption read_barrier_option =
-          CodeGenerator::ReadBarrierOptionForInstanceOf(instruction);
+          codegen_->ReadBarrierOptionForInstanceOf(instruction);
       // /* HeapReference<Class> */ out = obj->klass_
       GenerateReferenceLoadTwoRegisters(instruction,
                                         out_loc,
@@ -7097,7 +7317,7 @@
 
 void LocationsBuilderX86_64::VisitCheckCast(HCheckCast* instruction) {
   TypeCheckKind type_check_kind = instruction->GetTypeCheckKind();
-  LocationSummary::CallKind call_kind = CodeGenerator::GetCheckCastCallKind(instruction);
+  LocationSummary::CallKind call_kind = codegen_->GetCheckCastCallKind(instruction);
   LocationSummary* locations =
       new (GetGraph()->GetAllocator()) LocationSummary(instruction, call_kind);
   locations->SetInAt(0, Location::RequiresRegister());
@@ -7112,8 +7332,7 @@
   } else {
     locations->SetInAt(1, Location::Any());
   }
-  // Add temps for read barriers and other uses. One is used by TypeCheckSlowPathX86.
-  locations->AddRegisterTemps(NumberOfCheckCastTemps(type_check_kind));
+  locations->AddRegisterTemps(NumberOfCheckCastTemps(codegen_->EmitReadBarrier(), type_check_kind));
 }
 
 void InstructionCodeGeneratorX86_64::VisitCheckCast(HCheckCast* instruction) {
@@ -7124,7 +7343,7 @@
   Location cls = locations->InAt(1);
   Location temp_loc = locations->GetTemp(0);
   CpuRegister temp = temp_loc.AsRegister<CpuRegister>();
-  const size_t num_temps = NumberOfCheckCastTemps(type_check_kind);
+  const size_t num_temps = NumberOfCheckCastTemps(codegen_->EmitReadBarrier(), type_check_kind);
   DCHECK_GE(num_temps, 1u);
   DCHECK_LE(num_temps, 2u);
   Location maybe_temp2_loc = (num_temps >= 2u) ? locations->GetTemp(1) : Location::NoLocation();
@@ -7137,7 +7356,7 @@
   const uint32_t object_array_data_offset =
       mirror::Array::DataOffset(kHeapReferenceSize).Uint32Value();
 
-  bool is_type_check_slow_path_fatal = CodeGenerator::IsTypeCheckSlowPathFatal(instruction);
+  bool is_type_check_slow_path_fatal = codegen_->IsTypeCheckSlowPathFatal(instruction);
   SlowPathCode* type_check_slow_path =
       new (codegen_->GetScopedAllocator()) TypeCheckSlowPathX86_64(
           instruction, is_type_check_slow_path_fatal);
@@ -7301,11 +7520,11 @@
                                         kWithoutReadBarrier);
 
       // /* HeapReference<Class> */ temp = temp->iftable_
-      GenerateReferenceLoadTwoRegisters(instruction,
-                                        temp_loc,
-                                        temp_loc,
-                                        iftable_offset,
-                                        kWithoutReadBarrier);
+      GenerateReferenceLoadOneRegister(instruction,
+                                       temp_loc,
+                                       iftable_offset,
+                                       maybe_temp2_loc,
+                                       kWithoutReadBarrier);
       // Iftable is never null.
       __ movl(maybe_temp2_loc.AsRegister<CpuRegister>(), Address(temp, array_length_offset));
       // Maybe poison the `cls` for direct comparison with memory.
@@ -7532,7 +7751,7 @@
     ReadBarrierOption read_barrier_option) {
   CpuRegister out_reg = out.AsRegister<CpuRegister>();
   if (read_barrier_option == kWithReadBarrier) {
-    CHECK(gUseReadBarrier);
+    DCHECK(codegen_->EmitReadBarrier());
     if (kUseBakerReadBarrier) {
       // Load with fast path based Baker's read barrier.
       // /* HeapReference<Object> */ out = *(out + offset)
@@ -7566,7 +7785,7 @@
   CpuRegister out_reg = out.AsRegister<CpuRegister>();
   CpuRegister obj_reg = obj.AsRegister<CpuRegister>();
   if (read_barrier_option == kWithReadBarrier) {
-    CHECK(gUseReadBarrier);
+    DCHECK(codegen_->EmitReadBarrier());
     if (kUseBakerReadBarrier) {
       // Load with fast path based Baker's read barrier.
       // /* HeapReference<Object> */ out = *(obj + offset)
@@ -7594,7 +7813,7 @@
     ReadBarrierOption read_barrier_option) {
   CpuRegister root_reg = root.AsRegister<CpuRegister>();
   if (read_barrier_option == kWithReadBarrier) {
-    DCHECK(gUseReadBarrier);
+    DCHECK(codegen_->EmitReadBarrier());
     if (kUseBakerReadBarrier) {
       // Fast path implementation of art::ReadBarrier::BarrierForRoot when
       // Baker's read barrier are used:
@@ -7658,8 +7877,7 @@
                                                                 CpuRegister obj,
                                                                 uint32_t offset,
                                                                 bool needs_null_check) {
-  DCHECK(gUseReadBarrier);
-  DCHECK(kUseBakerReadBarrier);
+  DCHECK(EmitBakerReadBarrier());
 
   // /* HeapReference<Object> */ ref = *(obj + offset)
   Address src(obj, offset);
@@ -7672,8 +7890,7 @@
                                                                 uint32_t data_offset,
                                                                 Location index,
                                                                 bool needs_null_check) {
-  DCHECK(gUseReadBarrier);
-  DCHECK(kUseBakerReadBarrier);
+  DCHECK(EmitBakerReadBarrier());
 
   static_assert(
       sizeof(mirror::HeapReference<mirror::Object>) == sizeof(int32_t),
@@ -7692,8 +7909,7 @@
                                                                     bool always_update_field,
                                                                     CpuRegister* temp1,
                                                                     CpuRegister* temp2) {
-  DCHECK(gUseReadBarrier);
-  DCHECK(kUseBakerReadBarrier);
+  DCHECK(EmitBakerReadBarrier());
 
   // In slow path based read barriers, the read barrier call is
   // inserted after the original load. However, in fast path based
@@ -7774,7 +7990,7 @@
                                                   Location obj,
                                                   uint32_t offset,
                                                   Location index) {
-  DCHECK(gUseReadBarrier);
+  DCHECK(EmitReadBarrier());
 
   // Insert a slow path based read barrier *after* the reference load.
   //
@@ -7801,7 +8017,7 @@
                                                        Location obj,
                                                        uint32_t offset,
                                                        Location index) {
-  if (gUseReadBarrier) {
+  if (EmitReadBarrier()) {
     // Baker's read barriers shall be handled by the fast path
     // (CodeGeneratorX86_64::GenerateReferenceLoadWithBakerReadBarrier).
     DCHECK(!kUseBakerReadBarrier);
@@ -7816,7 +8032,7 @@
 void CodeGeneratorX86_64::GenerateReadBarrierForRootSlow(HInstruction* instruction,
                                                          Location out,
                                                          Location root) {
-  DCHECK(gUseReadBarrier);
+  DCHECK(EmitReadBarrier());
 
   // Insert a slow path based read barrier *after* the GC root load.
   //
@@ -7830,12 +8046,12 @@
   __ Bind(slow_path->GetExitLabel());
 }
 
-void LocationsBuilderX86_64::VisitBoundType(HBoundType* instruction ATTRIBUTE_UNUSED) {
+void LocationsBuilderX86_64::VisitBoundType([[maybe_unused]] HBoundType* instruction) {
   // Nothing to do, this should be removed during prepare for register allocator.
   LOG(FATAL) << "Unreachable";
 }
 
-void InstructionCodeGeneratorX86_64::VisitBoundType(HBoundType* instruction ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86_64::VisitBoundType([[maybe_unused]] HBoundType* instruction) {
   // Nothing to do, this should be removed during prepare for register allocator.
   LOG(FATAL) << "Unreachable";
 }
@@ -7930,13 +8146,13 @@
   __ jmp(temp_reg);
 }
 
-void LocationsBuilderX86_64::VisitIntermediateAddress(HIntermediateAddress* instruction
-                                                      ATTRIBUTE_UNUSED) {
+void LocationsBuilderX86_64::VisitIntermediateAddress(
+    [[maybe_unused]] HIntermediateAddress* instruction) {
   LOG(FATAL) << "Unreachable";
 }
 
-void InstructionCodeGeneratorX86_64::VisitIntermediateAddress(HIntermediateAddress* instruction
-                                                              ATTRIBUTE_UNUSED) {
+void InstructionCodeGeneratorX86_64::VisitIntermediateAddress(
+    [[maybe_unused]] HIntermediateAddress* instruction) {
   LOG(FATAL) << "Unreachable";
 }
 
@@ -8037,9 +8253,9 @@
                                           Location index,
                                           ScaleFactor scale,
                                           uint32_t data_offset) {
-  return index.IsConstant() ?
-      Address(obj, (index.GetConstant()->AsIntConstant()->GetValue() << scale) + data_offset) :
-      Address(obj, index.AsRegister<CpuRegister>(), scale, data_offset);
+  return index.IsConstant()
+      ? Address(obj, (index.GetConstant()->AsIntConstant()->GetValue() << scale) + data_offset)
+      : Address(obj, index.AsRegister<CpuRegister>(), scale, data_offset);
 }
 
 void CodeGeneratorX86_64::Store64BitValueToStack(Location dest, int64_t value) {
@@ -8119,7 +8335,7 @@
   const HPackedSwitch* switch_instr_;
 };
 
-void CodeGeneratorX86_64::Finalize(CodeAllocator* allocator) {
+void CodeGeneratorX86_64::Finalize() {
   // Generate the constant area if needed.
   X86_64Assembler* assembler = GetAssembler();
   if (!assembler->IsConstantAreaEmpty() || !fixups_to_jump_tables_.empty()) {
@@ -8137,7 +8353,7 @@
   }
 
   // And finish up.
-  CodeGenerator::Finalize(allocator);
+  CodeGenerator::Finalize();
 }
 
 Address CodeGeneratorX86_64::LiteralDoubleAddress(double v) {
@@ -8217,7 +8433,7 @@
       reinterpret_cast<uintptr_t>(roots_data) + index_in_table * sizeof(GcRoot<mirror::Object>);
   using unaligned_uint32_t __attribute__((__aligned__(1))) = uint32_t;
   reinterpret_cast<unaligned_uint32_t*>(code + code_offset)[0] =
-     dchecked_integral_cast<uint32_t>(address);
+      dchecked_integral_cast<uint32_t>(address);
 }
 
 void CodeGeneratorX86_64::EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) {
diff --git a/compiler/optimizing/code_generator_x86_64.h b/compiler/optimizing/code_generator_x86_64.h
index dff2e79..b8e2456 100644
--- a/compiler/optimizing/code_generator_x86_64.h
+++ b/compiler/optimizing/code_generator_x86_64.h
@@ -87,19 +87,8 @@
   V(StringBuilderLength)                       \
   V(StringBuilderToString)                     \
   /* 1.8 */                                    \
-  V(UnsafeGetAndAddInt)                        \
-  V(UnsafeGetAndAddLong)                       \
-  V(UnsafeGetAndSetInt)                        \
-  V(UnsafeGetAndSetLong)                       \
-  V(UnsafeGetAndSetObject)                     \
   V(MethodHandleInvokeExact)                   \
-  V(MethodHandleInvoke)                        \
-  /* OpenJDK 11 */                             \
-  V(JdkUnsafeGetAndAddInt)                     \
-  V(JdkUnsafeGetAndAddLong)                    \
-  V(JdkUnsafeGetAndSetInt)                     \
-  V(JdkUnsafeGetAndSetLong)                    \
-  V(JdkUnsafeGetAndSetObject)
+  V(MethodHandleInvoke)
 
 class InvokeRuntimeCallingConvention : public CallingConvention<Register, FloatRegister> {
  public:
@@ -162,16 +151,16 @@
   Location GetFieldIndexLocation() const override {
     return Location::RegisterLocation(RDI);
   }
-  Location GetReturnLocation(DataType::Type type ATTRIBUTE_UNUSED) const override {
+  Location GetReturnLocation([[maybe_unused]] DataType::Type type) const override {
     return Location::RegisterLocation(RAX);
   }
-  Location GetSetValueLocation(DataType::Type type ATTRIBUTE_UNUSED, bool is_instance)
-      const override {
+  Location GetSetValueLocation([[maybe_unused]] DataType::Type type,
+                               bool is_instance) const override {
     return is_instance
         ? Location::RegisterLocation(RDX)
         : Location::RegisterLocation(RSI);
   }
-  Location GetFpuLocation(DataType::Type type ATTRIBUTE_UNUSED) const override {
+  Location GetFpuLocation([[maybe_unused]] DataType::Type type) const override {
     return Location::FpuRegisterLocation(XMM0);
   }
 
@@ -248,7 +237,9 @@
   void HandleBitwiseOperation(HBinaryOperation* operation);
   void HandleCondition(HCondition* condition);
   void HandleShift(HBinaryOperation* operation);
-  void HandleFieldSet(HInstruction* instruction, const FieldInfo& field_info);
+  void HandleFieldSet(HInstruction* instruction,
+                      const FieldInfo& field_info,
+                      WriteBarrierKind write_barrier_kind);
   void HandleFieldGet(HInstruction* instruction);
   bool CpuHasAvxFeatureFlag();
   bool CpuHasAvx2FeatureFlag();
@@ -468,7 +459,7 @@
   void SetupBlockedRegisters() const override;
   void DumpCoreRegister(std::ostream& stream, int reg) const override;
   void DumpFloatingPointRegister(std::ostream& stream, int reg) const override;
-  void Finalize(CodeAllocator* allocator) override;
+  void Finalize() override;
 
   InstructionSet GetInstructionSet() const override {
     return InstructionSet::kX86_64;
@@ -480,12 +471,22 @@
 
   const X86_64InstructionSetFeatures& GetInstructionSetFeatures() const;
 
-  // Emit a write barrier.
-  void MarkGCCard(CpuRegister temp,
-                  CpuRegister card,
-                  CpuRegister object,
-                  CpuRegister value,
-                  bool emit_null_check);
+  // Emit a write barrier if:
+  // A) emit_null_check is false
+  // B) emit_null_check is true, and value is not null.
+  void MaybeMarkGCCard(CpuRegister temp,
+                       CpuRegister card,
+                       CpuRegister object,
+                       CpuRegister value,
+                       bool emit_null_check);
+
+  // Emit a write barrier unconditionally.
+  void MarkGCCard(CpuRegister temp, CpuRegister card, CpuRegister object);
+
+  // Crash if the card table is not valid. This check is only emitted for the CC GC. We assert
+  // `(!clean || !self->is_gc_marking)`, since the card table should not be set to clean when the CC
+  // GC is marking for eliminated write barriers.
+  void CheckGCCardIsValid(CpuRegister temp, CpuRegister card, CpuRegister object);
 
   void GenerateMemoryBarrier(MemBarrierKind kind);
 
@@ -502,9 +503,7 @@
     block_labels_ = CommonInitializeLabels<Label>();
   }
 
-  bool NeedsTwoRegisters(DataType::Type type ATTRIBUTE_UNUSED) const override {
-    return false;
-  }
+  bool NeedsTwoRegisters([[maybe_unused]] DataType::Type type) const override { return false; }
 
   // Check if the desired_string_load_kind is supported. If it is, return it,
   // otherwise return a fall-back kind that should be used instead.
@@ -536,6 +535,7 @@
   Label* NewTypeBssEntryPatch(HLoadClass* load_class);
   void RecordBootImageStringPatch(HLoadString* load_string);
   Label* NewStringBssEntryPatch(HLoadString* load_string);
+  Label* NewMethodTypeBssEntryPatch(HLoadMethodType* load_method_type);
   void RecordBootImageJniEntrypointPatch(HInvokeStaticOrDirect* invoke);
   Label* NewJitRootStringPatch(const DexFile& dex_file,
                                dex::StringIndex string_index,
@@ -707,7 +707,7 @@
   void GenerateExplicitNullCheck(HNullCheck* instruction) override;
   void MaybeGenerateInlineCacheCheck(HInstruction* instruction, CpuRegister cls);
 
-  void MaybeIncrementHotness(bool is_frame_entry);
+  void MaybeIncrementHotness(HSuspendCheck* suspend_check, bool is_frame_entry);
 
   static void BlockNonVolatileXmmRegisters(LocationSummary* locations);
 
@@ -748,6 +748,8 @@
   ArenaDeque<PatchInfo<Label>> boot_image_string_patches_;
   // PC-relative String patch info for kBssEntry.
   ArenaDeque<PatchInfo<Label>> string_bss_entry_patches_;
+  // PC-relative MethodType patch info for kBssEntry.
+  ArenaDeque<PatchInfo<Label>> method_type_bss_entry_patches_;
   // PC-relative method patch info for kBootImageLinkTimePcRelative+kCallCriticalNative.
   ArenaDeque<PatchInfo<Label>> boot_image_jni_entrypoint_patches_;
   // PC-relative patch info for IntrinsicObjects for the boot image,
diff --git a/compiler/optimizing/code_sinking.cc b/compiler/optimizing/code_sinking.cc
index d759a16..a237181 100644
--- a/compiler/optimizing/code_sinking.cc
+++ b/compiler/optimizing/code_sinking.cc
@@ -16,6 +16,9 @@
 
 #include "code_sinking.h"
 
+#include <sstream>
+
+#include "android-base/logging.h"
 #include "base/arena_bit_vector.h"
 #include "base/array_ref.h"
 #include "base/bit_vector-inl.h"
@@ -134,7 +137,6 @@
   // hard to test, as LSE removes them.
   if (instruction->IsStaticFieldGet() ||
       instruction->IsInstanceFieldGet() ||
-      instruction->IsPredicatedInstanceFieldGet() ||
       instruction->IsArrayGet()) {
     return false;
   }
@@ -335,10 +337,6 @@
   processed_instructions.ClearAllBits();
   ArenaBitVector post_dominated(&allocator, graph_->GetBlocks().size(), /* expandable= */ false);
   post_dominated.ClearAllBits();
-  ArenaBitVector instructions_that_can_move(
-      &allocator, number_of_instructions, /* expandable= */ false);
-  instructions_that_can_move.ClearAllBits();
-  ScopedArenaVector<HInstruction*> move_in_order(allocator.Adapter(kArenaAllocMisc));
 
   // Step (1): Visit post order to get a subset of blocks post dominated by `end_block`.
   // TODO(ngeoffray): Getting the full set of post-dominated should be done by
@@ -411,6 +409,13 @@
   HBasicBlock* common_dominator = finder.Get();
 
   // Step (2): iterate over the worklist to find sinking candidates.
+  ArenaBitVector instructions_that_can_move(
+      &allocator, number_of_instructions, /* expandable= */ false);
+  instructions_that_can_move.ClearAllBits();
+  ScopedArenaVector<ScopedArenaVector<HInstruction*>> instructions_to_move(
+      graph_->GetBlocks().size(),
+      ScopedArenaVector<HInstruction*>(allocator.Adapter(kArenaAllocMisc)),
+      allocator.Adapter(kArenaAllocMisc));
   while (!worklist.empty()) {
     HInstruction* instruction = worklist.back();
     if (processed_instructions.IsBitSet(instruction->GetId())) {
@@ -467,7 +472,7 @@
       // Instruction is a candidate for being sunk. Mark it as such, remove it from the
       // work list, and add its inputs to the work list.
       instructions_that_can_move.SetBit(instruction->GetId());
-      move_in_order.push_back(instruction);
+      instructions_to_move[instruction->GetBlock()->GetBlockId()].push_back(instruction);
       processed_instructions.SetBit(instruction->GetId());
       worklist.pop_back();
       AddInputs(instruction, processed_instructions, post_dominated, &worklist);
@@ -493,14 +498,50 @@
     }
   }
 
-  // Make sure we process instructions in dominated order. This is required for heap
-  // stores.
-  std::sort(move_in_order.begin(), move_in_order.end(), [](HInstruction* a, HInstruction* b) {
-    return b->StrictlyDominates(a);
-  });
+  // We want to process the instructions in reverse dominated order. This is required for heap
+  // stores. To guarantee this (including the transitivity of incomparability) we have some extra
+  // bookkeeping.
+  ScopedArenaVector<HInstruction*> instructions_to_move_sorted(allocator.Adapter(kArenaAllocMisc));
+  for (HBasicBlock* block : graph_->GetPostOrder()) {
+    const int block_id = block->GetBlockId();
+
+    // Order the block itself first.
+    std::sort(instructions_to_move[block_id].begin(),
+              instructions_to_move[block_id].end(),
+              [&block](HInstruction* a, HInstruction* b) {
+                return block->GetInstructions().FoundBefore(b, a);
+              });
+
+    for (HInstruction* instruction : instructions_to_move[block_id]) {
+      instructions_to_move_sorted.push_back(instruction);
+    }
+  }
+
+  if (kIsDebugBuild) {
+    // We should have ordered the instructions in reverse dominated order. This means that
+    // instructions shouldn't dominate instructions that come after it in the vector.
+    for (size_t i = 0; i < instructions_to_move_sorted.size(); ++i) {
+      for (size_t j = i + 1; j < instructions_to_move_sorted.size(); ++j) {
+        if (instructions_to_move_sorted[i]->StrictlyDominates(instructions_to_move_sorted[j])) {
+          std::stringstream ss;
+          graph_->Dump(ss, nullptr);
+          ss << "\n"
+             << "{";
+          for (HInstruction* instr : instructions_to_move_sorted) {
+            ss << *instr << " in block: " << instr->GetBlock() << ", ";
+          }
+          ss << "}\n";
+          ss << "i = " << i << " which is " << *instructions_to_move_sorted[i]
+             << "strictly dominates j = " << j << " which is " << *instructions_to_move_sorted[j]
+             << "\n";
+          LOG(FATAL) << "Unexpected ordering of code sinking instructions: " << ss.str();
+        }
+      }
+    }
+  }
 
   // Step (3): Try to move sinking candidates.
-  for (HInstruction* instruction : move_in_order) {
+  for (HInstruction* instruction : instructions_to_move_sorted) {
     HInstruction* position = nullptr;
     if (instruction->IsArraySet()
             || instruction->IsInstanceFieldSet()
diff --git a/compiler/optimizing/codegen_test.cc b/compiler/optimizing/codegen_test.cc
index 2d9acc4..c72d3ea 100644
--- a/compiler/optimizing/codegen_test.cc
+++ b/compiler/optimizing/codegen_test.cc
@@ -733,8 +733,7 @@
   move->AddMove(Location::StackSlot(8192), Location::StackSlot(0), DataType::Type::kInt32, nullptr);
   codegen.GetMoveResolver()->EmitNativeCode(move);
 
-  InternalCodeAllocator code_allocator;
-  codegen.Finalize(&code_allocator);
+  codegen.Finalize();
 }
 #endif
 
@@ -785,8 +784,7 @@
                 nullptr);
   codegen.GetMoveResolver()->EmitNativeCode(move);
 
-  InternalCodeAllocator code_allocator;
-  codegen.Finalize(&code_allocator);
+  codegen.Finalize();
 }
 
 // Check that ParallelMoveResolver works fine for ARM64 for both cases when SIMD is on and off.
@@ -798,7 +796,7 @@
 
   codegen.Initialize();
 
-  graph->SetHasSIMD(true);
+  graph->SetHasTraditionalSIMD(true);
   for (int i = 0; i < 2; i++) {
     HParallelMove* move = new (graph->GetAllocator()) HParallelMove(graph->GetAllocator());
     move->AddMove(Location::SIMDStackSlot(0),
@@ -818,11 +816,10 @@
                   DataType::Type::kFloat64,
                   nullptr);
     codegen.GetMoveResolver()->EmitNativeCode(move);
-    graph->SetHasSIMD(false);
+    graph->SetHasTraditionalSIMD(false);
   }
 
-  InternalCodeAllocator code_allocator;
-  codegen.Finalize(&code_allocator);
+  codegen.Finalize();
 }
 
 // Check that ART ISA Features are propagated to VIXL for arm64 (using cortex-a75 as example).
@@ -867,7 +864,7 @@
   arm64::CodeGeneratorARM64 codegen(graph, *compiler_options);
 
   codegen.Initialize();
-  graph->SetHasSIMD(true);
+  graph->SetHasTraditionalSIMD(true);
 
   DCHECK_EQ(arm64::callee_saved_fp_registers.GetCount(), 8);
   vixl::aarch64::CPURegList reg_list = arm64::callee_saved_fp_registers;
@@ -887,7 +884,8 @@
   arm64::CodeGeneratorARM64 codegen(graph, *compiler_options);
 
   codegen.Initialize();
-  graph->SetHasSIMD(false);
+  graph->SetHasTraditionalSIMD(false);
+  graph->SetHasPredicatedSIMD(false);
 
   DCHECK_EQ(arm64::callee_saved_fp_registers.GetCount(), 8);
   vixl::aarch64::CPURegList reg_list = arm64::callee_saved_fp_registers;
diff --git a/compiler/optimizing/codegen_test_utils.h b/compiler/optimizing/codegen_test_utils.h
index 7af9d0f..a8425c9 100644
--- a/compiler/optimizing/codegen_test_utils.h
+++ b/compiler/optimizing/codegen_test_utils.h
@@ -103,8 +103,8 @@
     blocked_core_registers_[arm::R7] = false;
   }
 
-  void MaybeGenerateMarkingRegisterCheck(int code ATTRIBUTE_UNUSED,
-                                         Location temp_loc ATTRIBUTE_UNUSED) override {
+  void MaybeGenerateMarkingRegisterCheck([[maybe_unused]] int code,
+                                         [[maybe_unused]] Location temp_loc) override {
     // When turned on, the marking register checks in
     // CodeGeneratorARMVIXL::MaybeGenerateMarkingRegisterCheck expects the
     // Thread Register and the Marking Register to be set to
@@ -135,8 +135,8 @@
   TestCodeGeneratorARM64(HGraph* graph, const CompilerOptions& compiler_options)
       : arm64::CodeGeneratorARM64(graph, compiler_options) {}
 
-  void MaybeGenerateMarkingRegisterCheck(int codem ATTRIBUTE_UNUSED,
-                                         Location temp_loc ATTRIBUTE_UNUSED) override {
+  void MaybeGenerateMarkingRegisterCheck([[maybe_unused]] int codem,
+                                         [[maybe_unused]] Location temp_loc) override {
     // When turned on, the marking register checks in
     // CodeGeneratorARM64::MaybeGenerateMarkingRegisterCheck expect the
     // Thread Register and the Marking Register to be set to
@@ -167,28 +167,6 @@
 };
 #endif
 
-class InternalCodeAllocator : public CodeAllocator {
- public:
-  InternalCodeAllocator() : size_(0) { }
-
-  uint8_t* Allocate(size_t size) override {
-    size_ = size;
-    memory_.reset(new uint8_t[size]);
-    return memory_.get();
-  }
-
-  size_t GetSize() const { return size_; }
-  ArrayRef<const uint8_t> GetMemory() const override {
-    return ArrayRef<const uint8_t>(memory_.get(), size_);
-  }
-
- private:
-  size_t size_;
-  std::unique_ptr<uint8_t[]> memory_;
-
-  DISALLOW_COPY_AND_ASSIGN(InternalCodeAllocator);
-};
-
 static bool CanExecuteOnHardware(InstructionSet target_isa) {
   return (target_isa == kRuntimeISA)
       // Handle the special case of ARM, with two instructions sets (ARM32 and Thumb-2).
@@ -247,8 +225,7 @@
 }
 
 template <typename Expected>
-static void Run(const InternalCodeAllocator& allocator,
-                const CodeGenerator& codegen,
+static void Run(const CodeGenerator& codegen,
                 bool has_result,
                 Expected expected) {
   InstructionSet target_isa = codegen.GetInstructionSet();
@@ -260,7 +237,7 @@
   };
   CodeHolder code_holder;
   const void* method_code =
-      code_holder.MakeExecutable(allocator.GetMemory(), ArrayRef<const uint8_t>(), target_isa);
+      code_holder.MakeExecutable(codegen.GetCode(), ArrayRef<const uint8_t>(), target_isa);
 
   using fptr = Expected (*)();
   fptr f = reinterpret_cast<fptr>(reinterpret_cast<uintptr_t>(method_code));
@@ -294,9 +271,8 @@
     register_allocator->AllocateRegisters();
   }
   hook_before_codegen(graph);
-  InternalCodeAllocator allocator;
-  codegen->Compile(&allocator);
-  Run(allocator, *codegen, has_result, expected);
+  codegen->Compile();
+  Run(*codegen, has_result, expected);
 }
 
 template <typename Expected>
diff --git a/compiler/optimizing/common_arm64.h b/compiler/optimizing/common_arm64.h
index 20b0e38..e2ef8d5 100644
--- a/compiler/optimizing/common_arm64.h
+++ b/compiler/optimizing/common_arm64.h
@@ -311,10 +311,8 @@
   }
 }
 
-inline Location ARM64EncodableConstantOrRegister(HInstruction* constant,
-                                                 HInstruction* instr) {
-  if (constant->IsConstant()
-      && Arm64CanEncodeConstantAsImmediate(constant->AsConstant(), instr)) {
+inline Location ARM64EncodableConstantOrRegister(HInstruction* constant, HInstruction* instr) {
+  if (constant->IsConstant() && Arm64CanEncodeConstantAsImmediate(constant->AsConstant(), instr)) {
     return Location::ConstantLocation(constant);
   }
 
diff --git a/compiler/optimizing/constant_folding.cc b/compiler/optimizing/constant_folding.cc
index 06d19e3..52cbfe8 100644
--- a/compiler/optimizing/constant_folding.cc
+++ b/compiler/optimizing/constant_folding.cc
@@ -18,7 +18,11 @@
 
 #include <algorithm>
 
+#include "base/bit_utils.h"
+#include "base/casts.h"
+#include "base/logging.h"
 #include "dex/dex_file-inl.h"
+#include "intrinsics_enum.h"
 #include "optimizing/data_type.h"
 #include "optimizing/nodes.h"
 
@@ -28,8 +32,8 @@
 // as constants.
 class HConstantFoldingVisitor final : public HGraphDelegateVisitor {
  public:
-  HConstantFoldingVisitor(HGraph* graph, OptimizingCompilerStats* stats, bool use_all_optimizations)
-      : HGraphDelegateVisitor(graph, stats), use_all_optimizations_(use_all_optimizations) {}
+  explicit HConstantFoldingVisitor(HGraph* graph, OptimizingCompilerStats* stats)
+      : HGraphDelegateVisitor(graph, stats) {}
 
  private:
   void VisitBasicBlock(HBasicBlock* block) override;
@@ -37,15 +41,30 @@
   void VisitUnaryOperation(HUnaryOperation* inst) override;
   void VisitBinaryOperation(HBinaryOperation* inst) override;
 
+  // Tries to replace constants in binary operations like:
+  // * BinaryOp(Select(false_constant, true_constant, condition), other_constant), or
+  // * BinaryOp(other_constant, Select(false_constant, true_constant, condition))
+  // with consolidated constants. For example, Add(Select(10, 20, condition), 5) can be replaced
+  // with Select(15, 25, condition).
+  bool TryRemoveBinaryOperationViaSelect(HBinaryOperation* inst);
+
   void VisitArrayLength(HArrayLength* inst) override;
   void VisitDivZeroCheck(HDivZeroCheck* inst) override;
   void VisitIf(HIf* inst) override;
+  void VisitInvoke(HInvoke* inst) override;
   void VisitTypeConversion(HTypeConversion* inst) override;
 
   void PropagateValue(HBasicBlock* starting_block, HInstruction* variable, HConstant* constant);
 
-  // Use all optimizations without restrictions.
-  bool use_all_optimizations_;
+  // Intrinsics foldings
+  void FoldReverseIntrinsic(HInvoke* invoke);
+  void FoldReverseBytesIntrinsic(HInvoke* invoke);
+  void FoldBitCountIntrinsic(HInvoke* invoke);
+  void FoldDivideUnsignedIntrinsic(HInvoke* invoke);
+  void FoldHighestOneBitIntrinsic(HInvoke* invoke);
+  void FoldLowestOneBitIntrinsic(HInvoke* invoke);
+  void FoldNumberOfLeadingZerosIntrinsic(HInvoke* invoke);
+  void FoldNumberOfTrailingZerosIntrinsic(HInvoke* invoke);
 
   DISALLOW_COPY_AND_ASSIGN(HConstantFoldingVisitor);
 };
@@ -87,7 +106,7 @@
 
 
 bool HConstantFolding::Run() {
-  HConstantFoldingVisitor visitor(graph_, stats_, use_all_optimizations_);
+  HConstantFoldingVisitor visitor(graph_, stats_);
   // Process basic blocks in reverse post-order in the dominator tree,
   // so that an instruction turned into a constant, used as input of
   // another instruction, may possibly be used to turn that second
@@ -98,12 +117,9 @@
 
 
 void HConstantFoldingVisitor::VisitBasicBlock(HBasicBlock* block) {
-  // Traverse this block's instructions (phis don't need to be
-  // processed) in (forward) order and replace the ones that can be
-  // statically evaluated by a compile-time counterpart.
-  for (HInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) {
-    it.Current()->Accept(this);
-  }
+  // Traverse this block's instructions (phis don't need to be processed) in (forward) order
+  // and replace the ones that can be statically evaluated by a compile-time counterpart.
+  VisitNonPhiInstructions(block);
 }
 
 void HConstantFoldingVisitor::VisitUnaryOperation(HUnaryOperation* inst) {
@@ -113,9 +129,69 @@
   if (constant != nullptr) {
     inst->ReplaceWith(constant);
     inst->GetBlock()->RemoveInstruction(inst);
+  } else if (inst->InputAt(0)->IsSelect() && inst->InputAt(0)->HasOnlyOneNonEnvironmentUse()) {
+    // Try to replace the select's inputs in Select+UnaryOperation cases. We can do this if both
+    // inputs to the select are constants, and this is the only use of the select.
+    HSelect* select = inst->InputAt(0)->AsSelect();
+    HConstant* false_constant = inst->TryStaticEvaluation(select->GetFalseValue());
+    if (false_constant == nullptr) {
+      return;
+    }
+    HConstant* true_constant = inst->TryStaticEvaluation(select->GetTrueValue());
+    if (true_constant == nullptr) {
+      return;
+    }
+    DCHECK_EQ(select->InputAt(0), select->GetFalseValue());
+    DCHECK_EQ(select->InputAt(1), select->GetTrueValue());
+    select->ReplaceInput(false_constant, 0);
+    select->ReplaceInput(true_constant, 1);
+    select->UpdateType();
+    inst->ReplaceWith(select);
+    inst->GetBlock()->RemoveInstruction(inst);
   }
 }
 
+bool HConstantFoldingVisitor::TryRemoveBinaryOperationViaSelect(HBinaryOperation* inst) {
+  if (inst->GetLeft()->IsSelect() == inst->GetRight()->IsSelect()) {
+    // If both of them are constants, VisitBinaryOperation already tried the static evaluation. If
+    // both of them are selects, then we can't simplify.
+    // TODO(solanes): Technically, if both of them are selects we could simplify iff both select's
+    // conditions are equal e.g. Add(Select(1, 2, cond), Select(3, 4, cond)) could be replaced with
+    // Select(4, 6, cond). This seems very unlikely to happen so we don't implement it.
+    return false;
+  }
+
+  const bool left_is_select = inst->GetLeft()->IsSelect();
+  HSelect* select = left_is_select ? inst->GetLeft()->AsSelect() : inst->GetRight()->AsSelect();
+  HInstruction* maybe_constant = left_is_select ? inst->GetRight() : inst->GetLeft();
+
+  if (select->HasOnlyOneNonEnvironmentUse()) {
+    // Try to replace the select's inputs in Select+BinaryOperation. We can do this if both
+    // inputs to the select are constants, and this is the only use of the select.
+    HConstant* false_constant =
+        inst->TryStaticEvaluation(left_is_select ? select->GetFalseValue() : maybe_constant,
+                                  left_is_select ? maybe_constant : select->GetFalseValue());
+    if (false_constant == nullptr) {
+      return false;
+    }
+    HConstant* true_constant =
+        inst->TryStaticEvaluation(left_is_select ? select->GetTrueValue() : maybe_constant,
+                                  left_is_select ? maybe_constant : select->GetTrueValue());
+    if (true_constant == nullptr) {
+      return false;
+    }
+    DCHECK_EQ(select->InputAt(0), select->GetFalseValue());
+    DCHECK_EQ(select->InputAt(1), select->GetTrueValue());
+    select->ReplaceInput(false_constant, 0);
+    select->ReplaceInput(true_constant, 1);
+    select->UpdateType();
+    inst->ReplaceWith(select);
+    inst->GetBlock()->RemoveInstruction(inst);
+    return true;
+  }
+  return false;
+}
+
 void HConstantFoldingVisitor::VisitBinaryOperation(HBinaryOperation* inst) {
   // Constant folding: replace `op(a, b)' with a constant at
   // compile time if `a' and `b' are both constants.
@@ -123,6 +199,8 @@
   if (constant != nullptr) {
     inst->ReplaceWith(constant);
     inst->GetBlock()->RemoveInstruction(inst);
+  } else if (TryRemoveBinaryOperationViaSelect(inst)) {
+    // Already replaced inside TryRemoveBinaryOperationViaSelect.
   } else {
     InstructionWithAbsorbingInputSimplifier simplifier(GetGraph());
     inst->Accept(&simplifier);
@@ -148,14 +226,11 @@
     uses_before = variable->GetUses().SizeSlow();
   }
 
-  if (variable->GetUses().HasExactlyOneElement()) {
-    // Nothing to do, since we only have the `if (variable)` use or the `condition` use.
-    return;
+  if (!variable->GetUses().HasExactlyOneElement()) {
+    variable->ReplaceUsesDominatedBy(
+        starting_block->GetFirstInstruction(), constant, /* strictly_dominated= */ false);
   }
 
-  variable->ReplaceUsesDominatedBy(
-      starting_block->GetFirstInstruction(), constant, /* strictly_dominated= */ false);
-
   if (recording_stats) {
     uses_after = variable->GetUses().SizeSlow();
     DCHECK_GE(uses_after, 1u) << "we must at least have the use in the if clause.";
@@ -165,12 +240,6 @@
 }
 
 void HConstantFoldingVisitor::VisitIf(HIf* inst) {
-  // This optimization can take a lot of compile time since we have a lot of If instructions in
-  // graphs.
-  if (!use_all_optimizations_) {
-    return;
-  }
-
   // Consistency check: the true and false successors do not dominate each other.
   DCHECK(!inst->IfTrueSuccessor()->Dominates(inst->IfFalseSuccessor()) &&
          !inst->IfFalseSuccessor()->Dominates(inst->IfTrueSuccessor()));
@@ -281,6 +350,245 @@
   }
 }
 
+void HConstantFoldingVisitor::VisitInvoke(HInvoke* inst) {
+  switch (inst->GetIntrinsic()) {
+    case Intrinsics::kIntegerReverse:
+    case Intrinsics::kLongReverse:
+      FoldReverseIntrinsic(inst);
+      break;
+    case Intrinsics::kIntegerReverseBytes:
+    case Intrinsics::kLongReverseBytes:
+    case Intrinsics::kShortReverseBytes:
+      FoldReverseBytesIntrinsic(inst);
+      break;
+    case Intrinsics::kIntegerBitCount:
+    case Intrinsics::kLongBitCount:
+      FoldBitCountIntrinsic(inst);
+      break;
+    case Intrinsics::kIntegerDivideUnsigned:
+    case Intrinsics::kLongDivideUnsigned:
+      FoldDivideUnsignedIntrinsic(inst);
+      break;
+    case Intrinsics::kIntegerHighestOneBit:
+    case Intrinsics::kLongHighestOneBit:
+      FoldHighestOneBitIntrinsic(inst);
+      break;
+    case Intrinsics::kIntegerLowestOneBit:
+    case Intrinsics::kLongLowestOneBit:
+      FoldLowestOneBitIntrinsic(inst);
+      break;
+    case Intrinsics::kIntegerNumberOfLeadingZeros:
+    case Intrinsics::kLongNumberOfLeadingZeros:
+      FoldNumberOfLeadingZerosIntrinsic(inst);
+      break;
+    case Intrinsics::kIntegerNumberOfTrailingZeros:
+    case Intrinsics::kLongNumberOfTrailingZeros:
+      FoldNumberOfTrailingZerosIntrinsic(inst);
+      break;
+    default:
+      break;
+  }
+}
+
+void HConstantFoldingVisitor::FoldReverseIntrinsic(HInvoke* inst) {
+  DCHECK(inst->GetIntrinsic() == Intrinsics::kIntegerReverse ||
+         inst->GetIntrinsic() == Intrinsics::kLongReverse);
+
+  HInstruction* input = inst->InputAt(0);
+  if (!input->IsConstant()) {
+    return;
+  }
+
+  // Integer and Long intrinsics have different return types.
+  if (inst->GetIntrinsic() == Intrinsics::kIntegerReverse) {
+    DCHECK(input->IsIntConstant());
+    inst->ReplaceWith(
+        GetGraph()->GetIntConstant(ReverseBits32(input->AsIntConstant()->GetValue())));
+  } else {
+    DCHECK(input->IsLongConstant());
+    inst->ReplaceWith(
+        GetGraph()->GetLongConstant(ReverseBits64(input->AsLongConstant()->GetValue())));
+  }
+  inst->GetBlock()->RemoveInstruction(inst);
+}
+
+void HConstantFoldingVisitor::FoldReverseBytesIntrinsic(HInvoke* inst) {
+  DCHECK(inst->GetIntrinsic() == Intrinsics::kIntegerReverseBytes ||
+         inst->GetIntrinsic() == Intrinsics::kLongReverseBytes ||
+         inst->GetIntrinsic() == Intrinsics::kShortReverseBytes);
+
+  HInstruction* input = inst->InputAt(0);
+  if (!input->IsConstant()) {
+    return;
+  }
+
+  // Integer, Long, and Short intrinsics have different return types.
+  if (inst->GetIntrinsic() == Intrinsics::kIntegerReverseBytes) {
+    DCHECK(input->IsIntConstant());
+    inst->ReplaceWith(GetGraph()->GetIntConstant(BSWAP(input->AsIntConstant()->GetValue())));
+  } else if (inst->GetIntrinsic() == Intrinsics::kLongReverseBytes) {
+    DCHECK(input->IsLongConstant());
+    inst->ReplaceWith(GetGraph()->GetLongConstant(BSWAP(input->AsLongConstant()->GetValue())));
+  } else {
+    DCHECK(input->IsIntConstant());
+    inst->ReplaceWith(GetGraph()->GetIntConstant(
+        BSWAP(dchecked_integral_cast<int16_t>(input->AsIntConstant()->GetValue()))));
+  }
+  inst->GetBlock()->RemoveInstruction(inst);
+}
+
+void HConstantFoldingVisitor::FoldBitCountIntrinsic(HInvoke* inst) {
+  DCHECK(inst->GetIntrinsic() == Intrinsics::kIntegerBitCount ||
+         inst->GetIntrinsic() == Intrinsics::kLongBitCount);
+
+  HInstruction* input = inst->InputAt(0);
+  if (!input->IsConstant()) {
+    return;
+  }
+
+  DCHECK_IMPLIES(inst->GetIntrinsic() == Intrinsics::kIntegerBitCount, input->IsIntConstant());
+  DCHECK_IMPLIES(inst->GetIntrinsic() == Intrinsics::kLongBitCount, input->IsLongConstant());
+
+  // Note that both the Integer and Long intrinsics return an int as a result.
+  int result = inst->GetIntrinsic() == Intrinsics::kIntegerBitCount ?
+                   POPCOUNT(input->AsIntConstant()->GetValue()) :
+                   POPCOUNT(input->AsLongConstant()->GetValue());
+  inst->ReplaceWith(GetGraph()->GetIntConstant(result));
+  inst->GetBlock()->RemoveInstruction(inst);
+}
+
+void HConstantFoldingVisitor::FoldDivideUnsignedIntrinsic(HInvoke* inst) {
+  DCHECK(inst->GetIntrinsic() == Intrinsics::kIntegerDivideUnsigned ||
+         inst->GetIntrinsic() == Intrinsics::kLongDivideUnsigned);
+
+  HInstruction* divisor = inst->InputAt(1);
+  if (!divisor->IsConstant()) {
+    return;
+  }
+  DCHECK_IMPLIES(inst->GetIntrinsic() == Intrinsics::kIntegerDivideUnsigned,
+                 divisor->IsIntConstant());
+  DCHECK_IMPLIES(inst->GetIntrinsic() == Intrinsics::kLongDivideUnsigned,
+                 divisor->IsLongConstant());
+  const bool is_int_intrinsic = inst->GetIntrinsic() == Intrinsics::kIntegerDivideUnsigned;
+  if ((is_int_intrinsic && divisor->AsIntConstant()->IsArithmeticZero()) ||
+      (!is_int_intrinsic && divisor->AsLongConstant()->IsArithmeticZero())) {
+    // We will be throwing, don't constant fold.
+    inst->SetAlwaysThrows(true);
+    GetGraph()->SetHasAlwaysThrowingInvokes(true);
+    return;
+  }
+
+  HInstruction* dividend = inst->InputAt(0);
+  if (!dividend->IsConstant()) {
+    return;
+  }
+  DCHECK_IMPLIES(inst->GetIntrinsic() == Intrinsics::kIntegerDivideUnsigned,
+                 dividend->IsIntConstant());
+  DCHECK_IMPLIES(inst->GetIntrinsic() == Intrinsics::kLongDivideUnsigned,
+                 dividend->IsLongConstant());
+
+  if (is_int_intrinsic) {
+    uint32_t dividend_val =
+        dchecked_integral_cast<uint32_t>(dividend->AsIntConstant()->GetValueAsUint64());
+    uint32_t divisor_val =
+        dchecked_integral_cast<uint32_t>(divisor->AsIntConstant()->GetValueAsUint64());
+    inst->ReplaceWith(GetGraph()->GetIntConstant(static_cast<int32_t>(dividend_val / divisor_val)));
+  } else {
+    uint64_t dividend_val = dividend->AsLongConstant()->GetValueAsUint64();
+    uint64_t divisor_val = divisor->AsLongConstant()->GetValueAsUint64();
+    inst->ReplaceWith(
+        GetGraph()->GetLongConstant(static_cast<int64_t>(dividend_val / divisor_val)));
+  }
+
+  inst->GetBlock()->RemoveInstruction(inst);
+}
+
+void HConstantFoldingVisitor::FoldHighestOneBitIntrinsic(HInvoke* inst) {
+  DCHECK(inst->GetIntrinsic() == Intrinsics::kIntegerHighestOneBit ||
+         inst->GetIntrinsic() == Intrinsics::kLongHighestOneBit);
+
+  HInstruction* input = inst->InputAt(0);
+  if (!input->IsConstant()) {
+    return;
+  }
+
+  // Integer and Long intrinsics have different return types.
+  if (inst->GetIntrinsic() == Intrinsics::kIntegerHighestOneBit) {
+    DCHECK(input->IsIntConstant());
+    inst->ReplaceWith(
+        GetGraph()->GetIntConstant(HighestOneBitValue(input->AsIntConstant()->GetValue())));
+  } else {
+    DCHECK(input->IsLongConstant());
+    inst->ReplaceWith(
+        GetGraph()->GetLongConstant(HighestOneBitValue(input->AsLongConstant()->GetValue())));
+  }
+  inst->GetBlock()->RemoveInstruction(inst);
+}
+
+void HConstantFoldingVisitor::FoldLowestOneBitIntrinsic(HInvoke* inst) {
+  DCHECK(inst->GetIntrinsic() == Intrinsics::kIntegerLowestOneBit ||
+         inst->GetIntrinsic() == Intrinsics::kLongLowestOneBit);
+
+  HInstruction* input = inst->InputAt(0);
+  if (!input->IsConstant()) {
+    return;
+  }
+
+  // Integer and Long intrinsics have different return types.
+  if (inst->GetIntrinsic() == Intrinsics::kIntegerLowestOneBit) {
+    DCHECK(input->IsIntConstant());
+    inst->ReplaceWith(
+        GetGraph()->GetIntConstant(LowestOneBitValue(input->AsIntConstant()->GetValue())));
+  } else {
+    DCHECK(input->IsLongConstant());
+    inst->ReplaceWith(
+        GetGraph()->GetLongConstant(LowestOneBitValue(input->AsLongConstant()->GetValue())));
+  }
+  inst->GetBlock()->RemoveInstruction(inst);
+}
+
+void HConstantFoldingVisitor::FoldNumberOfLeadingZerosIntrinsic(HInvoke* inst) {
+  DCHECK(inst->GetIntrinsic() == Intrinsics::kIntegerNumberOfLeadingZeros ||
+         inst->GetIntrinsic() == Intrinsics::kLongNumberOfLeadingZeros);
+
+  HInstruction* input = inst->InputAt(0);
+  if (!input->IsConstant()) {
+    return;
+  }
+
+  DCHECK_IMPLIES(inst->GetIntrinsic() == Intrinsics::kIntegerNumberOfLeadingZeros,
+                 input->IsIntConstant());
+  DCHECK_IMPLIES(inst->GetIntrinsic() == Intrinsics::kLongNumberOfLeadingZeros,
+                 input->IsLongConstant());
+
+  // Note that both the Integer and Long intrinsics return an int as a result.
+  int result = input->IsIntConstant() ? JAVASTYLE_CLZ(input->AsIntConstant()->GetValue()) :
+                                        JAVASTYLE_CLZ(input->AsLongConstant()->GetValue());
+  inst->ReplaceWith(GetGraph()->GetIntConstant(result));
+  inst->GetBlock()->RemoveInstruction(inst);
+}
+
+void HConstantFoldingVisitor::FoldNumberOfTrailingZerosIntrinsic(HInvoke* inst) {
+  DCHECK(inst->GetIntrinsic() == Intrinsics::kIntegerNumberOfTrailingZeros ||
+         inst->GetIntrinsic() == Intrinsics::kLongNumberOfTrailingZeros);
+
+  HInstruction* input = inst->InputAt(0);
+  if (!input->IsConstant()) {
+    return;
+  }
+
+  DCHECK_IMPLIES(inst->GetIntrinsic() == Intrinsics::kIntegerNumberOfTrailingZeros,
+                 input->IsIntConstant());
+  DCHECK_IMPLIES(inst->GetIntrinsic() == Intrinsics::kLongNumberOfTrailingZeros,
+                 input->IsLongConstant());
+
+  // Note that both the Integer and Long intrinsics return an int as a result.
+  int result = input->IsIntConstant() ? JAVASTYLE_CTZ(input->AsIntConstant()->GetValue()) :
+                                        JAVASTYLE_CTZ(input->AsLongConstant()->GetValue());
+  inst->ReplaceWith(GetGraph()->GetIntConstant(result));
+  inst->GetBlock()->RemoveInstruction(inst);
+}
+
 void HConstantFoldingVisitor::VisitArrayLength(HArrayLength* inst) {
   HInstruction* input = inst->InputAt(0);
   if (input->IsLoadString()) {
@@ -299,6 +607,25 @@
   if (constant != nullptr) {
     inst->ReplaceWith(constant);
     inst->GetBlock()->RemoveInstruction(inst);
+  } else if (inst->InputAt(0)->IsSelect() && inst->InputAt(0)->HasOnlyOneNonEnvironmentUse()) {
+    // Try to replace the select's inputs in Select+TypeConversion. We can do this if both
+    // inputs to the select are constants, and this is the only use of the select.
+    HSelect* select = inst->InputAt(0)->AsSelect();
+    HConstant* false_constant = inst->TryStaticEvaluation(select->GetFalseValue());
+    if (false_constant == nullptr) {
+      return;
+    }
+    HConstant* true_constant = inst->TryStaticEvaluation(select->GetTrueValue());
+    if (true_constant == nullptr) {
+      return;
+    }
+    DCHECK_EQ(select->InputAt(0), select->GetFalseValue());
+    DCHECK_EQ(select->InputAt(1), select->GetTrueValue());
+    select->ReplaceInput(false_constant, 0);
+    select->ReplaceInput(true_constant, 1);
+    select->UpdateType();
+    inst->ReplaceWith(select);
+    inst->GetBlock()->RemoveInstruction(inst);
   }
 }
 
@@ -549,18 +876,35 @@
 
 void InstructionWithAbsorbingInputSimplifier::VisitOr(HOr* instruction) {
   HConstant* input_cst = instruction->GetConstantRight();
-
-  if (input_cst == nullptr) {
-    return;
-  }
-
-  if (Int64FromConstant(input_cst) == -1) {
+  if (input_cst != nullptr && Int64FromConstant(input_cst) == -1) {
     // Replace code looking like
     //    OR dst, src, 0xFFF...FF
     // with
     //    CONSTANT 0xFFF...FF
     instruction->ReplaceWith(input_cst);
     instruction->GetBlock()->RemoveInstruction(instruction);
+    return;
+  }
+
+  HInstruction* left = instruction->GetLeft();
+  HInstruction* right = instruction->GetRight();
+  if (left->IsNot() ^ right->IsNot()) {
+    // Replace code looking like
+    //    NOT notsrc, src
+    //    OR  dst, notsrc, src
+    // with
+    //    CONSTANT 0xFFF...FF
+    HInstruction* hnot = (left->IsNot() ? left : right);
+    HInstruction* hother = (left->IsNot() ? right : left);
+    HInstruction* src = hnot->AsNot()->GetInput();
+
+    if (src == hother) {
+      DCHECK(instruction->GetType() == DataType::Type::kInt32 ||
+             instruction->GetType() == DataType::Type::kInt64);
+      instruction->ReplaceWith(GetGraph()->GetConstant(instruction->GetType(), -1));
+      instruction->GetBlock()->RemoveInstruction(instruction);
+      return;
+    }
   }
 }
 
@@ -583,7 +927,7 @@
     block->RemoveInstruction(instruction);
   }
 
-  HConstant* cst_right = instruction->GetRight()->AsConstant();
+  HConstant* cst_right = instruction->GetRight()->AsConstantOrNull();
   if (((cst_right != nullptr) &&
        (cst_right->IsOne() || cst_right->IsMinusOne())) ||
       (instruction->GetLeft() == instruction->GetRight())) {
@@ -647,6 +991,28 @@
     HBasicBlock* block = instruction->GetBlock();
     instruction->ReplaceWith(GetGraph()->GetConstant(type, 0));
     block->RemoveInstruction(instruction);
+    return;
+  }
+
+  HInstruction* left = instruction->GetLeft();
+  HInstruction* right = instruction->GetRight();
+  if (left->IsNot() ^ right->IsNot()) {
+    // Replace code looking like
+    //    NOT notsrc, src
+    //    XOR dst, notsrc, src
+    // with
+    //    CONSTANT 0xFFF...FF
+    HInstruction* hnot = (left->IsNot() ? left : right);
+    HInstruction* hother = (left->IsNot() ? right : left);
+    HInstruction* src = hnot->AsNot()->GetInput();
+
+    if (src == hother) {
+      DCHECK(instruction->GetType() == DataType::Type::kInt32 ||
+             instruction->GetType() == DataType::Type::kInt64);
+      instruction->ReplaceWith(GetGraph()->GetConstant(instruction->GetType(), -1));
+      instruction->GetBlock()->RemoveInstruction(instruction);
+      return;
+    }
   }
 }
 
diff --git a/compiler/optimizing/constant_folding.h b/compiler/optimizing/constant_folding.h
index 29648e9..73ac3ce 100644
--- a/compiler/optimizing/constant_folding.h
+++ b/compiler/optimizing/constant_folding.h
@@ -43,18 +43,14 @@
  public:
   HConstantFolding(HGraph* graph,
                    OptimizingCompilerStats* stats = nullptr,
-                   const char* name = kConstantFoldingPassName,
-                   bool use_all_optimizations = false)
-      : HOptimization(graph, name, stats), use_all_optimizations_(use_all_optimizations) {}
+                   const char* name = kConstantFoldingPassName)
+      : HOptimization(graph, name, stats) {}
 
   bool Run() override;
 
   static constexpr const char* kConstantFoldingPassName = "constant_folding";
 
  private:
-  // Use all optimizations without restrictions.
-  bool use_all_optimizations_;
-
   DISALLOW_COPY_AND_ASSIGN(HConstantFolding);
 };
 
diff --git a/compiler/optimizing/constant_folding_test.cc b/compiler/optimizing/constant_folding_test.cc
index 741fd3f..689d771 100644
--- a/compiler/optimizing/constant_folding_test.cc
+++ b/compiler/optimizing/constant_folding_test.cc
@@ -60,9 +60,7 @@
     std::string actual_before = printer_before.str();
     EXPECT_EQ(expected_before, actual_before);
 
-    HConstantFolding constant_folding(
-        graph_, /* stats= */ nullptr, "constant_folding", /* use_all_optimizations= */ true);
-    constant_folding.Run();
+    HConstantFolding(graph_, /* stats= */ nullptr, "constant_folding").Run();
     GraphChecker graph_checker_cf(graph_);
     graph_checker_cf.Run();
     ASSERT_TRUE(graph_checker_cf.IsValid());
@@ -551,7 +549,7 @@
  *
  * The intent of this test is to ensure that all constant expressions
  * are actually evaluated at compile-time, thanks to the reverse
- * (forward) post-order traversal of the the dominator tree.
+ * (forward) post-order traversal of the dominator tree.
  *
  *                              16-bit
  *                              offset
diff --git a/compiler/optimizing/constructor_fence_redundancy_elimination.cc b/compiler/optimizing/constructor_fence_redundancy_elimination.cc
index d9b7652..30c33dd 100644
--- a/compiler/optimizing/constructor_fence_redundancy_elimination.cc
+++ b/compiler/optimizing/constructor_fence_redundancy_elimination.cc
@@ -17,6 +17,8 @@
 #include "constructor_fence_redundancy_elimination.h"
 
 #include "base/arena_allocator.h"
+#include "base/arena_bit_vector.h"
+#include "base/bit_vector-inl.h"
 #include "base/scoped_arena_allocator.h"
 #include "base/scoped_arena_containers.h"
 
@@ -31,12 +33,12 @@
       : HGraphVisitor(graph),
         scoped_allocator_(graph->GetArenaStack()),
         candidate_fences_(scoped_allocator_.Adapter(kArenaAllocCFRE)),
-        candidate_fence_targets_(scoped_allocator_.Adapter(kArenaAllocCFRE)),
+        candidate_fence_targets_(std::nullopt),
         stats_(stats) {}
 
   void VisitBasicBlock(HBasicBlock* block) override {
-    // Visit all instructions in block.
-    HGraphVisitor::VisitBasicBlock(block);
+    // Visit all non-Phi instructions in the block.
+    VisitNonPhiInstructions(block);
 
     // If there were any unmerged fences left, merge them together,
     // the objects are considered 'published' at the end of the block.
@@ -46,8 +48,15 @@
   void VisitConstructorFence(HConstructorFence* constructor_fence) override {
     candidate_fences_.push_back(constructor_fence);
 
-    for (size_t input_idx = 0; input_idx < constructor_fence->InputCount(); ++input_idx) {
-      candidate_fence_targets_.insert(constructor_fence->InputAt(input_idx));
+    if (!candidate_fence_targets_.has_value()) {
+      size_t number_of_instructions = GetGraph()->GetCurrentInstructionId();
+      candidate_fence_targets_.emplace(
+          &scoped_allocator_, number_of_instructions, /*expandable=*/ false, kArenaAllocCFRE);
+      candidate_fence_targets_->ClearAllBits();
+    }
+
+    for (HInstruction* input : constructor_fence->GetInputs()) {
+      candidate_fence_targets_->SetBit(input->GetId());
     }
   }
 
@@ -78,7 +87,7 @@
     VisitSetLocation(instruction, value);
   }
 
-  void VisitDeoptimize(HDeoptimize* instruction ATTRIBUTE_UNUSED) override {
+  void VisitDeoptimize([[maybe_unused]] HDeoptimize* instruction) override {
     // Pessimize: Merge all fences.
     MergeCandidateFences();
   }
@@ -151,7 +160,13 @@
     }
   }
 
-  void VisitSetLocation(HInstruction* inst ATTRIBUTE_UNUSED, HInstruction* store_input) {
+  void VisitSetLocation([[maybe_unused]] HInstruction* inst, HInstruction* store_input) {
+    if (candidate_fences_.empty()) {
+      // There is no need to look at inputs if there are no candidate fence targets.
+      DCHECK_IMPLIES(candidate_fence_targets_.has_value(),
+                     !candidate_fence_targets_->IsAnyBitSet());
+      return;
+    }
     // An object is considered "published" if it's stored onto the heap.
     // Sidenote: A later "LSE" pass can still remove the fence if it proves the
     // object doesn't actually escape.
@@ -163,8 +178,14 @@
   }
 
   bool HasInterestingPublishTargetAsInput(HInstruction* inst) {
-    for (size_t input_count = 0; input_count < inst->InputCount(); ++input_count) {
-      if (IsInterestingPublishTarget(inst->InputAt(input_count))) {
+    if (candidate_fences_.empty()) {
+      // There is no need to look at inputs if there are no candidate fence targets.
+      DCHECK_IMPLIES(candidate_fence_targets_.has_value(),
+                     !candidate_fence_targets_->IsAnyBitSet());
+      return false;
+    }
+    for (HInstruction* input : inst->GetInputs()) {
+      if (IsInterestingPublishTarget(input)) {
         return true;
       }
     }
@@ -182,10 +203,13 @@
     }
 
     // The merge target is always the "last" candidate fence.
-    HConstructorFence* merge_target = candidate_fences_[candidate_fences_.size() - 1];
+    HConstructorFence* merge_target = candidate_fences_.back();
+    candidate_fences_.pop_back();
 
     for (HConstructorFence* fence : candidate_fences_) {
-      MaybeMerge(merge_target, fence);
+      DCHECK_NE(merge_target, fence);
+      merge_target->Merge(fence);
+      MaybeRecordStat(stats_, MethodCompilationStat::kConstructorFenceRemovedCFRE);
     }
 
     if (kCfreLogFenceInputCount) {
@@ -198,25 +222,15 @@
     // there is no benefit to this extra complexity unless we also reordered
     // the stores to come later.
     candidate_fences_.clear();
-    candidate_fence_targets_.clear();
+    DCHECK(candidate_fence_targets_.has_value());
+    candidate_fence_targets_->ClearAllBits();
   }
 
   // A publishing 'store' is only interesting if the value being stored
   // is one of the fence `targets` in `candidate_fences`.
   bool IsInterestingPublishTarget(HInstruction* store_input) const {
-    return candidate_fence_targets_.find(store_input) != candidate_fence_targets_.end();
-  }
-
-  void MaybeMerge(HConstructorFence* target, HConstructorFence* src) {
-    if (target == src) {
-      return;  // Don't merge a fence into itself.
-      // This is mostly for stats-purposes, we don't want to count merge(x,x)
-      // as removing a fence because it's a no-op.
-    }
-
-    target->Merge(src);
-
-    MaybeRecordStat(stats_, MethodCompilationStat::kConstructorFenceRemovedCFRE);
+    DCHECK(candidate_fence_targets_.has_value());
+    return candidate_fence_targets_->IsBitSet(store_input->GetId());
   }
 
   // Phase-local heap memory allocator for CFRE optimizer.
@@ -232,7 +246,7 @@
 
   // Stores a set of the fence targets, to allow faster lookup of whether
   // a detected publish is a target of one of the candidate fences.
-  ScopedArenaHashSet<HInstruction*> candidate_fence_targets_;
+  std::optional<ArenaBitVector> candidate_fence_targets_;
 
   // Used to record stats about the optimization.
   OptimizingCompilerStats* const stats_;
diff --git a/compiler/optimizing/critical_native_abi_fixup_arm.cc b/compiler/optimizing/critical_native_abi_fixup_arm.cc
index 77e1566..4b1dec0 100644
--- a/compiler/optimizing/critical_native_abi_fixup_arm.cc
+++ b/compiler/optimizing/critical_native_abi_fixup_arm.cc
@@ -16,12 +16,8 @@
 
 #include "critical_native_abi_fixup_arm.h"
 
-#include "art_method-inl.h"
 #include "intrinsics.h"
-#include "jni/jni_internal.h"
 #include "nodes.h"
-#include "scoped_thread_state_change-inl.h"
-#include "well_known_classes.h"
 
 namespace art HIDDEN {
 namespace arm {
@@ -43,46 +39,7 @@
       break;  // Remaining arguments are passed on stack.
     }
     if (DataType::IsFloatingPointType(input_type)) {
-      bool is_double = (input_type == DataType::Type::kFloat64);
-      DataType::Type converted_type = is_double ? DataType::Type::kInt64 : DataType::Type::kInt32;
-      ArtMethod* resolved_method = is_double
-          ? WellKnownClasses::java_lang_Double_doubleToRawLongBits
-          : WellKnownClasses::java_lang_Float_floatToRawIntBits;
-      DCHECK(resolved_method != nullptr);
-      DCHECK(resolved_method->IsIntrinsic());
-      MethodReference target_method(nullptr, 0);
-      {
-        ScopedObjectAccess soa(Thread::Current());
-        target_method =
-            MethodReference(resolved_method->GetDexFile(), resolved_method->GetDexMethodIndex());
-      }
-      // Use arbitrary dispatch info that does not require the method argument.
-      HInvokeStaticOrDirect::DispatchInfo dispatch_info = {
-          MethodLoadKind::kBssEntry,
-          CodePtrLocation::kCallArtMethod,
-          /*method_load_data=*/ 0u
-      };
-      HBasicBlock* block = invoke->GetBlock();
-      ArenaAllocator* allocator = block->GetGraph()->GetAllocator();
-      HInvokeStaticOrDirect* new_input = new (allocator) HInvokeStaticOrDirect(
-          allocator,
-          /*number_of_arguments=*/ 1u,
-          converted_type,
-          invoke->GetDexPc(),
-          /*method_reference=*/ MethodReference(nullptr, dex::kDexNoIndex),
-          resolved_method,
-          dispatch_info,
-          kStatic,
-          target_method,
-          HInvokeStaticOrDirect::ClinitCheckRequirement::kNone,
-          !block->GetGraph()->IsDebuggable());
-      // The intrinsic has no side effects and does not need environment or dex cache on ARM.
-      new_input->SetSideEffects(SideEffects::None());
-      IntrinsicOptimizations opt(new_input);
-      opt.SetDoesNotNeedEnvironment();
-      new_input->SetRawInputAt(0u, input);
-      block->InsertInstructionBefore(new_input, invoke);
-      invoke->ReplaceInput(new_input, i);
+      InsertFpToIntegralIntrinsic(invoke, i);
     }
     reg = next_reg;
   }
diff --git a/compiler/optimizing/critical_native_abi_fixup_riscv64.cc b/compiler/optimizing/critical_native_abi_fixup_riscv64.cc
new file mode 100644
index 0000000..c2c98d1
--- /dev/null
+++ b/compiler/optimizing/critical_native_abi_fixup_riscv64.cc
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "critical_native_abi_fixup_riscv64.h"
+
+#include "arch/riscv64/jni_frame_riscv64.h"
+#include "intrinsics.h"
+#include "nodes.h"
+
+namespace art HIDDEN {
+namespace riscv64 {
+
+// Fix up FP arguments passed in core registers for call to @CriticalNative by inserting fake calls
+// to Float.floatToRawIntBits() or Double.doubleToRawLongBits() to satisfy type consistency checks.
+static void FixUpArguments(HInvokeStaticOrDirect* invoke) {
+  DCHECK_EQ(invoke->GetCodePtrLocation(), CodePtrLocation::kCallCriticalNative);
+  size_t core_reg = 0u;
+  size_t fp_reg = 0u;
+  for (size_t i = 0, num_args = invoke->GetNumberOfArguments(); i != num_args; ++i) {
+    if (core_reg == kMaxIntLikeArgumentRegisters) {
+      break;  // Remaining arguments are passed in FP regs or on the stack.
+    }
+    HInstruction* input = invoke->InputAt(i);
+    DataType::Type input_type = input->GetType();
+    if (DataType::IsFloatingPointType(input_type)) {
+      if (fp_reg < kMaxFloatOrDoubleArgumentRegisters) {
+        ++fp_reg;
+      } else {
+        DCHECK_LT(core_reg, kMaxIntLikeArgumentRegisters);
+        InsertFpToIntegralIntrinsic(invoke, i);
+        ++core_reg;
+      }
+    } else {
+      ++core_reg;
+    }
+  }
+}
+
+bool CriticalNativeAbiFixupRiscv64::Run() {
+  if (!graph_->HasDirectCriticalNativeCall()) {
+    return false;
+  }
+
+  for (HBasicBlock* block : graph_->GetReversePostOrder()) {
+    for (HInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) {
+      HInstruction* instruction = it.Current();
+      if (instruction->IsInvokeStaticOrDirect() &&
+          instruction->AsInvokeStaticOrDirect()->GetCodePtrLocation() ==
+              CodePtrLocation::kCallCriticalNative) {
+        FixUpArguments(instruction->AsInvokeStaticOrDirect());
+      }
+    }
+  }
+  return true;
+}
+
+}  // namespace riscv64
+}  // namespace art
diff --git a/compiler/optimizing/critical_native_abi_fixup_riscv64.h b/compiler/optimizing/critical_native_abi_fixup_riscv64.h
new file mode 100644
index 0000000..dc76cff
--- /dev/null
+++ b/compiler/optimizing/critical_native_abi_fixup_riscv64.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_COMPILER_OPTIMIZING_CRITICAL_NATIVE_ABI_FIXUP_RISCV64_H_
+#define ART_COMPILER_OPTIMIZING_CRITICAL_NATIVE_ABI_FIXUP_RISCV64_H_
+
+#include "base/macros.h"
+#include "nodes.h"
+#include "optimization.h"
+
+namespace art HIDDEN {
+namespace riscv64 {
+
+class CriticalNativeAbiFixupRiscv64 : public HOptimization {
+ public:
+  CriticalNativeAbiFixupRiscv64(HGraph* graph, OptimizingCompilerStats* stats)
+      : HOptimization(graph, kCriticalNativeAbiFixupRiscv64PassName, stats) {}
+
+  static constexpr const char* kCriticalNativeAbiFixupRiscv64PassName =
+      "critical_native_abi_fixup_riscv64";
+
+  bool Run() override;
+};
+
+}  // namespace riscv64
+}  // namespace art
+
+#endif  // ART_COMPILER_OPTIMIZING_CRITICAL_NATIVE_ABI_FIXUP_RISCV64_H_
diff --git a/compiler/optimizing/data_type.h b/compiler/optimizing/data_type.h
index b6d9519..40d5e56 100644
--- a/compiler/optimizing/data_type.h
+++ b/compiler/optimizing/data_type.h
@@ -101,6 +101,27 @@
     }
   }
 
+  static constexpr Type SignedIntegralTypeFromSize(size_t size) {
+    switch (size) {
+      case 0:
+      case 1:
+        return Type::kInt8;
+      case 2:
+        return Type::kInt16;
+      case 3:
+      case 4:
+        return Type::kInt32;
+      case 5:
+      case 6:
+      case 7:
+      case 8:
+        return Type::kInt64;
+      default:
+        LOG(FATAL) << "Invalid size " << size;
+        UNREACHABLE();
+    }
+  }
+
   static bool IsFloatingPointType(Type type) {
     return type == Type::kFloat32 || type == Type::kFloat64;
   }
diff --git a/compiler/optimizing/dead_code_elimination.cc b/compiler/optimizing/dead_code_elimination.cc
index cf49e39..fe1361c 100644
--- a/compiler/optimizing/dead_code_elimination.cc
+++ b/compiler/optimizing/dead_code_elimination.cc
@@ -24,6 +24,7 @@
 #include "base/scoped_arena_containers.h"
 #include "base/stl_util.h"
 #include "optimizing/nodes.h"
+#include "optimizing/nodes_vector.h"
 #include "ssa_phi_elimination.h"
 
 namespace art HIDDEN {
@@ -311,9 +312,7 @@
 
   // We need to re-analyze the graph in order to run DCE afterwards.
   if (rerun_dominance_and_loop_analysis) {
-    graph_->ClearLoopInformation();
-    graph_->ClearDominanceInformation();
-    graph_->BuildDominatorTree();
+    graph_->RecomputeDominatorTree();
     return true;
   }
   return false;
@@ -437,9 +436,7 @@
   // We need to re-analyze the graph in order to run DCE afterwards.
   if (simplified_one_or_more_ifs) {
     if (rerun_dominance_and_loop_analysis) {
-      graph_->ClearLoopInformation();
-      graph_->ClearDominanceInformation();
-      graph_->BuildDominatorTree();
+      graph_->RecomputeDominatorTree();
     } else {
       graph_->ClearDominanceInformation();
       // We have introduced critical edges, remove them.
@@ -592,19 +589,24 @@
 }
 
 struct HDeadCodeElimination::TryBelongingInformation {
-  explicit TryBelongingInformation(ScopedArenaAllocator* allocator)
-      : blocks_in_try(allocator->Adapter(kArenaAllocDCE)),
-        coalesced_try_entries(allocator->Adapter(kArenaAllocDCE)) {}
+  TryBelongingInformation(HGraph* graph, ScopedArenaAllocator* allocator)
+      : blocks_in_try(allocator, graph->GetBlocks().size(), /*expandable=*/false, kArenaAllocDCE),
+        coalesced_try_entries(
+            allocator, graph->GetBlocks().size(), /*expandable=*/false, kArenaAllocDCE) {
+    blocks_in_try.ClearAllBits();
+    coalesced_try_entries.ClearAllBits();
+  }
 
   // Which blocks belong in the try.
-  ScopedArenaSet<HBasicBlock*> blocks_in_try;
+  ArenaBitVector blocks_in_try;
   // Which other try entries are referencing this same try.
-  ScopedArenaSet<HBasicBlock*> coalesced_try_entries;
+  ArenaBitVector coalesced_try_entries;
 };
 
 bool HDeadCodeElimination::CanPerformTryRemoval(const TryBelongingInformation& try_belonging_info) {
-  for (HBasicBlock* block : try_belonging_info.blocks_in_try) {
-    for (HInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) {
+  const ArenaVector<HBasicBlock*>& blocks = graph_->GetBlocks();
+  for (uint32_t i : try_belonging_info.blocks_in_try.Indexes()) {
+    for (HInstructionIterator it(blocks[i]->GetInstructions()); !it.Done(); it.Advance()) {
       if (it.Current()->CanThrow()) {
         return false;
       }
@@ -647,14 +649,17 @@
   DCHECK(try_entry->GetLastInstruction()->AsTryBoundary()->IsEntry());
   DisconnectHandlersAndUpdateTryBoundary(try_entry, any_block_in_loop);
 
-  for (HBasicBlock* other_try_entry : try_belonging_info.coalesced_try_entries) {
+  const ArenaVector<HBasicBlock*>& blocks = graph_->GetBlocks();
+  for (uint32_t i : try_belonging_info.coalesced_try_entries.Indexes()) {
+    HBasicBlock* other_try_entry = blocks[i];
     DCHECK(other_try_entry->EndsWithTryBoundary());
     DCHECK(other_try_entry->GetLastInstruction()->AsTryBoundary()->IsEntry());
     DisconnectHandlersAndUpdateTryBoundary(other_try_entry, any_block_in_loop);
   }
 
   // Update the blocks in the try.
-  for (HBasicBlock* block : try_belonging_info.blocks_in_try) {
+  for (uint32_t i : try_belonging_info.blocks_in_try.Indexes()) {
+    HBasicBlock* block = blocks[i];
     // Update the try catch information since now the try doesn't exist.
     block->SetTryCatchInformation(nullptr);
     if (block->IsInLoop()) {
@@ -697,33 +702,35 @@
   ScopedArenaAllocator allocator(graph_->GetArenaStack());
 
   // Collect which blocks are part of which try.
-  std::unordered_map<HBasicBlock*, TryBelongingInformation> tries;
+  ScopedArenaUnorderedMap<HBasicBlock*, TryBelongingInformation> tries(
+      allocator.Adapter(kArenaAllocDCE));
   for (HBasicBlock* block : graph_->GetReversePostOrderSkipEntryBlock()) {
     if (block->IsTryBlock()) {
       HBasicBlock* key = block->GetTryCatchInformation()->GetTryEntry().GetBlock();
       auto it = tries.find(key);
       if (it == tries.end()) {
-        it = tries.insert({key, TryBelongingInformation(&allocator)}).first;
+        it = tries.insert({key, TryBelongingInformation(graph_, &allocator)}).first;
       }
-      it->second.blocks_in_try.insert(block);
+      it->second.blocks_in_try.SetBit(block->GetBlockId());
     }
   }
 
   // Deduplicate the tries which have different try entries but they are really the same try.
   for (auto it = tries.begin(); it != tries.end(); it++) {
-    DCHECK(it->first->EndsWithTryBoundary());
-    HTryBoundary* try_boundary = it->first->GetLastInstruction()->AsTryBoundary();
+    HBasicBlock* block = it->first;
+    DCHECK(block->EndsWithTryBoundary());
+    HTryBoundary* try_boundary = block->GetLastInstruction()->AsTryBoundary();
     for (auto other_it = next(it); other_it != tries.end(); /*other_it++ in the loop*/) {
-      DCHECK(other_it->first->EndsWithTryBoundary());
-      HTryBoundary* other_try_boundary = other_it->first->GetLastInstruction()->AsTryBoundary();
+      HBasicBlock* other_block = other_it->first;
+      DCHECK(other_block->EndsWithTryBoundary());
+      HTryBoundary* other_try_boundary = other_block->GetLastInstruction()->AsTryBoundary();
       if (try_boundary->HasSameExceptionHandlersAs(*other_try_boundary)) {
         // Merge the entries as they are really the same one.
         // Block merging.
-        it->second.blocks_in_try.insert(other_it->second.blocks_in_try.begin(),
-                                        other_it->second.blocks_in_try.end());
+        it->second.blocks_in_try.Union(&other_it->second.blocks_in_try);
 
         // Add the coalesced try entry to update it too.
-        it->second.coalesced_try_entries.insert(other_it->first);
+        it->second.coalesced_try_entries.SetBit(other_block->GetBlockId());
 
         // Erase the other entry.
         other_it = tries.erase(other_it);
@@ -773,6 +780,96 @@
   }
 }
 
+bool HDeadCodeElimination::RemoveEmptyIfs() {
+  bool did_opt = false;
+  for (HBasicBlock* block : graph_->GetPostOrder()) {
+    if (!block->EndsWithIf()) {
+      continue;
+    }
+
+    HIf* if_instr = block->GetLastInstruction()->AsIf();
+    HBasicBlock* true_block = if_instr->IfTrueSuccessor();
+    HBasicBlock* false_block = if_instr->IfFalseSuccessor();
+
+    // We can use `visited_blocks` to detect cases like
+    //    1
+    //   / \
+    //  2  3
+    //  \ /
+    //   4  ...
+    //   | /
+    //   5
+    // where 2, 3, and 4 are single HGoto blocks, and block 5 has Phis.
+    ScopedArenaAllocator allocator(graph_->GetArenaStack());
+    ArenaBitVector visited_blocks(
+        &allocator, graph_->GetBlocks().size(), /*expandable=*/ false, kArenaAllocDCE);
+    visited_blocks.ClearAllBits();
+    HBasicBlock* merge_true = true_block;
+    visited_blocks.SetBit(merge_true->GetBlockId());
+    while (merge_true->IsSingleGoto()) {
+      merge_true = merge_true->GetSuccessors()[0];
+      visited_blocks.SetBit(merge_true->GetBlockId());
+    }
+
+    HBasicBlock* merge_false = false_block;
+    while (!visited_blocks.IsBitSet(merge_false->GetBlockId()) && merge_false->IsSingleGoto()) {
+      merge_false = merge_false->GetSuccessors()[0];
+    }
+
+    if (!visited_blocks.IsBitSet(merge_false->GetBlockId()) || !merge_false->GetPhis().IsEmpty()) {
+      // TODO(solanes): We could allow Phis iff both branches have the same value for all Phis. This
+      // may not be covered by SsaRedundantPhiElimination in cases like `HPhi[A,A,B]` where the Phi
+      // itself is not redundant for the general case but it is for a pair of branches.
+      continue;
+    }
+
+    // Data structures to help remove now-dead instructions.
+    ScopedArenaQueue<HInstruction*> maybe_remove(allocator.Adapter(kArenaAllocDCE));
+    ArenaBitVector visited(
+        &allocator, graph_->GetCurrentInstructionId(), /*expandable=*/ false, kArenaAllocDCE);
+    visited.ClearAllBits();
+    maybe_remove.push(if_instr->InputAt(0));
+    visited.SetBit(if_instr->GetId());
+
+    // Swap HIf with HGoto
+    block->ReplaceAndRemoveInstructionWith(
+        if_instr, new (graph_->GetAllocator()) HGoto(if_instr->GetDexPc()));
+
+    // Reconnect blocks
+    block->RemoveSuccessor(true_block);
+    block->RemoveSuccessor(false_block);
+    true_block->RemovePredecessor(block);
+    false_block->RemovePredecessor(block);
+    block->AddSuccessor(merge_false);
+
+    // Remove now dead instructions e.g. comparisons that are only used as input to the if
+    // instruction. This can allow for further removal of other empty ifs.
+    while (!maybe_remove.empty()) {
+      HInstruction* instr = maybe_remove.front();
+      maybe_remove.pop();
+      if (instr->IsDeadAndRemovable()) {
+        for (HInstruction* input : instr->GetInputs()) {
+          if (visited.IsBitSet(input->GetId())) {
+            continue;
+          }
+          visited.SetBit(input->GetId());
+          maybe_remove.push(input);
+        }
+        instr->GetBlock()->RemoveInstructionOrPhi(instr);
+        MaybeRecordStat(stats_, MethodCompilationStat::kRemovedDeadInstruction);
+      }
+    }
+
+    did_opt = true;
+  }
+
+  if (did_opt) {
+    graph_->RecomputeDominatorTree();
+  }
+
+  return did_opt;
+}
+
 bool HDeadCodeElimination::RemoveDeadBlocks(bool force_recomputation,
                                             bool force_loop_recomputation) {
   DCHECK_IMPLIES(force_loop_recomputation, force_recomputation);
@@ -807,9 +904,7 @@
   // dominator tree and try block membership.
   if (removed_one_or_more_blocks || force_recomputation) {
     if (rerun_dominance_and_loop_analysis || force_loop_recomputation) {
-      graph_->ClearLoopInformation();
-      graph_->ClearDominanceInformation();
-      graph_->BuildDominatorTree();
+      graph_->RecomputeDominatorTree();
     } else {
       graph_->ClearDominanceInformation();
       graph_->ComputeDominanceInformation();
@@ -837,12 +932,23 @@
         MaybeRecordStat(stats_, MethodCompilationStat::kRemovedDeadInstruction);
       }
     }
+
+    // Same for Phis.
+    for (HBackwardInstructionIterator phi_it(block->GetPhis()); !phi_it.Done(); phi_it.Advance()) {
+      DCHECK(phi_it.Current()->IsPhi());
+      HPhi* phi = phi_it.Current()->AsPhi();
+      if (phi->IsPhiDeadAndRemovable()) {
+        block->RemovePhi(phi);
+        MaybeRecordStat(stats_, MethodCompilationStat::kRemovedDeadPhi);
+      }
+    }
   }
 }
 
 void HDeadCodeElimination::UpdateGraphFlags() {
   bool has_monitor_operations = false;
-  bool has_simd = false;
+  bool has_traditional_simd = false;
+  bool has_predicated_simd = false;
   bool has_bounds_checks = false;
   bool has_always_throwing_invokes = false;
 
@@ -852,7 +958,12 @@
       if (instruction->IsMonitorOperation()) {
         has_monitor_operations = true;
       } else if (instruction->IsVecOperation()) {
-        has_simd = true;
+        HVecOperation* vec_instruction = instruction->AsVecOperation();
+        if (vec_instruction->IsPredicated()) {
+          has_predicated_simd = true;
+        } else {
+          has_traditional_simd = true;
+        }
       } else if (instruction->IsBoundsCheck()) {
         has_bounds_checks = true;
       } else if (instruction->IsInvoke() && instruction->AsInvoke()->AlwaysThrows()) {
@@ -862,7 +973,8 @@
   }
 
   graph_->SetHasMonitorOperations(has_monitor_operations);
-  graph_->SetHasSIMD(has_simd);
+  graph_->SetHasTraditionalSIMD(has_traditional_simd);
+  graph_->SetHasPredicatedSIMD(has_predicated_simd);
   graph_->SetHasBoundsChecks(has_bounds_checks);
   graph_->SetHasAlwaysThrowingInvokes(has_always_throwing_invokes);
 }
@@ -877,6 +989,7 @@
     bool did_any_simplification = false;
     did_any_simplification |= SimplifyAlwaysThrows();
     did_any_simplification |= SimplifyIfs();
+    did_any_simplification |= RemoveEmptyIfs();
     did_any_simplification |= RemoveDeadBlocks();
     // We call RemoveDeadBlocks before RemoveUnneededTries to remove the dead blocks from the
     // previous optimizations. Otherwise, we might detect that a try has throwing instructions but
diff --git a/compiler/optimizing/dead_code_elimination.h b/compiler/optimizing/dead_code_elimination.h
index ddd01f7..789962f 100644
--- a/compiler/optimizing/dead_code_elimination.h
+++ b/compiler/optimizing/dead_code_elimination.h
@@ -40,6 +40,17 @@
  private:
   void MaybeRecordDeadBlock(HBasicBlock* block);
   void MaybeRecordSimplifyIf();
+  // Detects and remove ifs that are empty e.g. it turns
+  //     1
+  //    / \
+  //   2   3
+  //   \  /
+  //    4
+  // where 2 and 3 are single goto blocks and 4 doesn't contain a Phi into:
+  //    1
+  //    |
+  //    4
+  bool RemoveEmptyIfs();
   // If `force_recomputation` is true, we will recompute the dominance information even when we
   // didn't delete any blocks. `force_loop_recomputation` is similar but it also forces the loop
   // information recomputation.
diff --git a/compiler/optimizing/dead_code_elimination_test.cc b/compiler/optimizing/dead_code_elimination_test.cc
index b789434..4082ec5 100644
--- a/compiler/optimizing/dead_code_elimination_test.cc
+++ b/compiler/optimizing/dead_code_elimination_test.cc
@@ -99,8 +99,9 @@
 
   // Expected difference after dead code elimination.
   diff_t expected_diff = {
-    { "  3: IntConstant [9, 8, 5]\n",  "  3: IntConstant [8, 5]\n" },
-    { "  8: Phi(4, 3) [9]\n",          "  8: Phi(4, 3)\n" },
+    { "  3: IntConstant [9, 8, 5]\n",  "  3: IntConstant [5]\n" },
+    { "  4: IntConstant [8, 5]\n",     "  4: IntConstant [5]\n" },
+    { "  8: Phi(4, 3) [9]\n",          removed },
     { "  9: Add(8, 3)\n",              removed }
   };
   std::string expected_after = Patch(expected_before, expected_diff);
@@ -114,7 +115,7 @@
  *
  * The intent of this test is to ensure that all dead instructions are
  * actually pruned at compile-time, thanks to the (backward)
- * post-order traversal of the the dominator tree.
+ * post-order traversal of the dominator tree.
  *
  *                              16-bit
  *                              offset
diff --git a/compiler/optimizing/execution_subgraph.cc b/compiler/optimizing/execution_subgraph.cc
deleted file mode 100644
index 06aabbe..0000000
--- a/compiler/optimizing/execution_subgraph.cc
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "execution_subgraph.h"
-
-#include <algorithm>
-#include <unordered_set>
-
-#include "android-base/macros.h"
-#include "base/arena_allocator.h"
-#include "base/arena_bit_vector.h"
-#include "base/globals.h"
-#include "base/scoped_arena_allocator.h"
-#include "nodes.h"
-
-namespace art HIDDEN {
-
-ExecutionSubgraph::ExecutionSubgraph(HGraph* graph, ScopedArenaAllocator* allocator)
-    : graph_(graph),
-      allocator_(allocator),
-      allowed_successors_(graph_->GetBlocks().size(),
-                          ~(std::bitset<kMaxFilterableSuccessors> {}),
-                          allocator_->Adapter(kArenaAllocLSA)),
-      unreachable_blocks_(
-          allocator_, graph_->GetBlocks().size(), /*expandable=*/ false, kArenaAllocLSA),
-      valid_(true),
-      needs_prune_(false),
-      finalized_(false) {
-  if (valid_) {
-    DCHECK(std::all_of(graph->GetBlocks().begin(), graph->GetBlocks().end(), [](HBasicBlock* it) {
-      return it == nullptr || it->GetSuccessors().size() <= kMaxFilterableSuccessors;
-    }));
-  }
-}
-
-void ExecutionSubgraph::RemoveBlock(const HBasicBlock* to_remove) {
-  if (!valid_) {
-    return;
-  }
-  uint32_t id = to_remove->GetBlockId();
-  if (unreachable_blocks_.IsBitSet(id)) {
-    if (kIsDebugBuild) {
-      // This isn't really needed but it's good to have this so it functions as
-      // a DCHECK that we always call Prune after removing any block.
-      needs_prune_ = true;
-    }
-    return;
-  }
-  unreachable_blocks_.SetBit(id);
-  for (HBasicBlock* pred : to_remove->GetPredecessors()) {
-    std::bitset<kMaxFilterableSuccessors> allowed_successors {};
-    // ZipCount iterates over both the successors and the index of them at the same time.
-    for (auto [succ, i] : ZipCount(MakeIterationRange(pred->GetSuccessors()))) {
-      if (succ != to_remove) {
-        allowed_successors.set(i);
-      }
-    }
-    LimitBlockSuccessors(pred, allowed_successors);
-  }
-}
-
-// Removes sink nodes.
-void ExecutionSubgraph::Prune() {
-  if (UNLIKELY(!valid_)) {
-    return;
-  }
-  needs_prune_ = false;
-  // This is the record of the edges that were both (1) explored and (2) reached
-  // the exit node.
-  {
-    // Allocator for temporary values.
-    ScopedArenaAllocator temporaries(graph_->GetArenaStack());
-    ScopedArenaVector<std::bitset<kMaxFilterableSuccessors>> results(
-        graph_->GetBlocks().size(), temporaries.Adapter(kArenaAllocLSA));
-    unreachable_blocks_.ClearAllBits();
-    // Fills up the 'results' map with what we need to add to update
-    // allowed_successors in order to prune sink nodes.
-    bool start_reaches_end = false;
-    // This is basically a DFS of the graph with some edges skipped.
-    {
-      const size_t num_blocks = graph_->GetBlocks().size();
-      constexpr ssize_t kUnvisitedSuccIdx = -1;
-      ArenaBitVector visiting(&temporaries, num_blocks, false, kArenaAllocLSA);
-      // How many of the successors of each block we have already examined. This
-      // has three states.
-      // (1) kUnvisitedSuccIdx: we have not examined any edges,
-      // (2) 0 <= val < # of successors: we have examined 'val' successors/are
-      // currently examining successors_[val],
-      // (3) kMaxFilterableSuccessors: We have examined all of the successors of
-      // the block (the 'result' is final).
-      ScopedArenaVector<ssize_t> last_succ_seen(
-          num_blocks, kUnvisitedSuccIdx, temporaries.Adapter(kArenaAllocLSA));
-      // A stack of which blocks we are visiting in this DFS traversal. Does not
-      // include the current-block. Used with last_succ_seen to figure out which
-      // bits to set if we find a path to the end/loop.
-      ScopedArenaVector<uint32_t> current_path(temporaries.Adapter(kArenaAllocLSA));
-      // Just ensure we have enough space. The allocator will be cleared shortly
-      // anyway so this is fast.
-      current_path.reserve(num_blocks);
-      // Current block we are examining. Modified only by 'push_block' and 'pop_block'
-      const HBasicBlock* cur_block = graph_->GetEntryBlock();
-      // Used to note a recur where we will start iterating on 'blk' and save
-      // where we are. We must 'continue' immediately after this.
-      auto push_block = [&](const HBasicBlock* blk) {
-        DCHECK(std::find(current_path.cbegin(), current_path.cend(), cur_block->GetBlockId()) ==
-               current_path.end());
-        if (kIsDebugBuild) {
-          std::for_each(current_path.cbegin(), current_path.cend(), [&](auto id) {
-            DCHECK_GT(last_succ_seen[id], kUnvisitedSuccIdx) << id;
-            DCHECK_LT(last_succ_seen[id], static_cast<ssize_t>(kMaxFilterableSuccessors)) << id;
-          });
-        }
-        current_path.push_back(cur_block->GetBlockId());
-        visiting.SetBit(cur_block->GetBlockId());
-        cur_block = blk;
-      };
-      // Used to note that we have fully explored a block and should return back
-      // up. Sets cur_block appropriately. We must 'continue' immediately after
-      // calling this.
-      auto pop_block = [&]() {
-        if (UNLIKELY(current_path.empty())) {
-          // Should only happen if entry-blocks successors are exhausted.
-          DCHECK_GE(last_succ_seen[graph_->GetEntryBlock()->GetBlockId()],
-                    static_cast<ssize_t>(graph_->GetEntryBlock()->GetSuccessors().size()));
-          cur_block = nullptr;
-        } else {
-          const HBasicBlock* last = graph_->GetBlocks()[current_path.back()];
-          visiting.ClearBit(current_path.back());
-          current_path.pop_back();
-          cur_block = last;
-        }
-      };
-      // Mark the current path as a path to the end. This is in contrast to paths
-      // that end in (eg) removed blocks.
-      auto propagate_true = [&]() {
-        for (uint32_t id : current_path) {
-          DCHECK_GT(last_succ_seen[id], kUnvisitedSuccIdx);
-          DCHECK_LT(last_succ_seen[id], static_cast<ssize_t>(kMaxFilterableSuccessors));
-          results[id].set(last_succ_seen[id]);
-        }
-      };
-      ssize_t num_entry_succ = graph_->GetEntryBlock()->GetSuccessors().size();
-      // As long as the entry-block has not explored all successors we still have
-      // work to do.
-      const uint32_t entry_block_id = graph_->GetEntryBlock()->GetBlockId();
-      while (num_entry_succ > last_succ_seen[entry_block_id]) {
-        DCHECK(cur_block != nullptr);
-        uint32_t id = cur_block->GetBlockId();
-        DCHECK((current_path.empty() && cur_block == graph_->GetEntryBlock()) ||
-               current_path.front() == graph_->GetEntryBlock()->GetBlockId())
-            << "current path size: " << current_path.size()
-            << " cur_block id: " << cur_block->GetBlockId() << " entry id "
-            << graph_->GetEntryBlock()->GetBlockId();
-        if (visiting.IsBitSet(id)) {
-          // TODO We should support infinite loops as well.
-          start_reaches_end = false;
-          break;
-        }
-        std::bitset<kMaxFilterableSuccessors>& result = results[id];
-        if (cur_block == graph_->GetExitBlock()) {
-          start_reaches_end = true;
-          propagate_true();
-          pop_block();
-          continue;
-        } else if (last_succ_seen[id] == kMaxFilterableSuccessors) {
-          // Already fully explored.
-          if (result.any()) {
-            propagate_true();
-          }
-          pop_block();
-          continue;
-        }
-        // NB This is a pointer. Modifications modify the last_succ_seen.
-        ssize_t* cur_succ = &last_succ_seen[id];
-        std::bitset<kMaxFilterableSuccessors> succ_bitmap = GetAllowedSuccessors(cur_block);
-        // Get next successor allowed.
-        while (++(*cur_succ) < static_cast<ssize_t>(kMaxFilterableSuccessors) &&
-               !succ_bitmap.test(*cur_succ)) {
-          DCHECK_GE(*cur_succ, 0);
-        }
-        if (*cur_succ >= static_cast<ssize_t>(cur_block->GetSuccessors().size())) {
-          // No more successors. Mark that we've checked everything. Later visits
-          // to this node can use the existing data.
-          DCHECK_LE(*cur_succ, static_cast<ssize_t>(kMaxFilterableSuccessors));
-          *cur_succ = kMaxFilterableSuccessors;
-          pop_block();
-          continue;
-        }
-        const HBasicBlock* nxt = cur_block->GetSuccessors()[*cur_succ];
-        DCHECK(nxt != nullptr) << "id: " << *cur_succ
-                               << " max: " << cur_block->GetSuccessors().size();
-        if (visiting.IsBitSet(nxt->GetBlockId())) {
-          // This is a loop. Mark it and continue on. Mark allowed-successor on
-          // this block's results as well.
-          result.set(*cur_succ);
-          propagate_true();
-        } else {
-          // Not a loop yet. Recur.
-          push_block(nxt);
-        }
-      }
-    }
-    // If we can't reach the end then there is no path through the graph without
-    // hitting excluded blocks
-    if (UNLIKELY(!start_reaches_end)) {
-      valid_ = false;
-      return;
-    }
-    // Mark blocks we didn't see in the ReachesEnd flood-fill
-    for (const HBasicBlock* blk : graph_->GetBlocks()) {
-      if (blk != nullptr &&
-          results[blk->GetBlockId()].none() &&
-          blk != graph_->GetExitBlock() &&
-          blk != graph_->GetEntryBlock()) {
-        // We never visited this block, must be unreachable.
-        unreachable_blocks_.SetBit(blk->GetBlockId());
-      }
-    }
-    // write the new data.
-    memcpy(allowed_successors_.data(),
-           results.data(),
-           results.size() * sizeof(std::bitset<kMaxFilterableSuccessors>));
-  }
-  RecalculateExcludedCohort();
-}
-
-void ExecutionSubgraph::RemoveConcavity() {
-  if (UNLIKELY(!valid_)) {
-    return;
-  }
-  DCHECK(!needs_prune_);
-  for (const HBasicBlock* blk : graph_->GetBlocks()) {
-    if (blk == nullptr || unreachable_blocks_.IsBitSet(blk->GetBlockId())) {
-      continue;
-    }
-    uint32_t blkid = blk->GetBlockId();
-    if (std::any_of(unreachable_blocks_.Indexes().begin(),
-                    unreachable_blocks_.Indexes().end(),
-                    [&](uint32_t skipped) { return graph_->PathBetween(skipped, blkid); }) &&
-        std::any_of(unreachable_blocks_.Indexes().begin(),
-                    unreachable_blocks_.Indexes().end(),
-                    [&](uint32_t skipped) { return graph_->PathBetween(blkid, skipped); })) {
-      RemoveBlock(blk);
-    }
-  }
-  Prune();
-}
-
-void ExecutionSubgraph::RecalculateExcludedCohort() {
-  DCHECK(!needs_prune_);
-  excluded_list_.emplace(allocator_->Adapter(kArenaAllocLSA));
-  ScopedArenaVector<ExcludedCohort>& res = excluded_list_.value();
-  // Make a copy of unreachable_blocks_;
-  ArenaBitVector unreachable(allocator_, graph_->GetBlocks().size(), false, kArenaAllocLSA);
-  unreachable.Copy(&unreachable_blocks_);
-  // Split cohorts with union-find
-  while (unreachable.IsAnyBitSet()) {
-    res.emplace_back(allocator_, graph_);
-    ExcludedCohort& cohort = res.back();
-    // We don't allocate except for the queue beyond here so create another arena to save memory.
-    ScopedArenaAllocator alloc(graph_->GetArenaStack());
-    ScopedArenaQueue<const HBasicBlock*> worklist(alloc.Adapter(kArenaAllocLSA));
-    // Select an arbitrary node
-    const HBasicBlock* first = graph_->GetBlocks()[unreachable.GetHighestBitSet()];
-    worklist.push(first);
-    do {
-      // Flood-fill both forwards and backwards.
-      const HBasicBlock* cur = worklist.front();
-      worklist.pop();
-      if (!unreachable.IsBitSet(cur->GetBlockId())) {
-        // Already visited or reachable somewhere else.
-        continue;
-      }
-      unreachable.ClearBit(cur->GetBlockId());
-      cohort.blocks_.SetBit(cur->GetBlockId());
-      // don't bother filtering here, it's done next go-around
-      for (const HBasicBlock* pred : cur->GetPredecessors()) {
-        worklist.push(pred);
-      }
-      for (const HBasicBlock* succ : cur->GetSuccessors()) {
-        worklist.push(succ);
-      }
-    } while (!worklist.empty());
-  }
-  // Figure out entry & exit nodes.
-  for (ExcludedCohort& cohort : res) {
-    DCHECK(cohort.blocks_.IsAnyBitSet());
-    auto is_external = [&](const HBasicBlock* ext) -> bool {
-      return !cohort.blocks_.IsBitSet(ext->GetBlockId());
-    };
-    for (const HBasicBlock* blk : cohort.Blocks()) {
-      const auto& preds = blk->GetPredecessors();
-      const auto& succs = blk->GetSuccessors();
-      if (std::any_of(preds.cbegin(), preds.cend(), is_external)) {
-        cohort.entry_blocks_.SetBit(blk->GetBlockId());
-      }
-      if (std::any_of(succs.cbegin(), succs.cend(), is_external)) {
-        cohort.exit_blocks_.SetBit(blk->GetBlockId());
-      }
-    }
-  }
-}
-
-std::ostream& operator<<(std::ostream& os, const ExecutionSubgraph::ExcludedCohort& ex) {
-  ex.Dump(os);
-  return os;
-}
-
-void ExecutionSubgraph::ExcludedCohort::Dump(std::ostream& os) const {
-  auto dump = [&](BitVecBlockRange arr) {
-    os << "[";
-    bool first = true;
-    for (const HBasicBlock* b : arr) {
-      if (!first) {
-        os << ", ";
-      }
-      first = false;
-      os << b->GetBlockId();
-    }
-    os << "]";
-  };
-  auto dump_blocks = [&]() {
-    os << "[";
-    bool first = true;
-    for (const HBasicBlock* b : Blocks()) {
-      if (!entry_blocks_.IsBitSet(b->GetBlockId()) && !exit_blocks_.IsBitSet(b->GetBlockId())) {
-        if (!first) {
-          os << ", ";
-        }
-        first = false;
-        os << b->GetBlockId();
-      }
-    }
-    os << "]";
-  };
-
-  os << "{ entry: ";
-  dump(EntryBlocks());
-  os << ", interior: ";
-  dump_blocks();
-  os << ", exit: ";
-  dump(ExitBlocks());
-  os << "}";
-}
-
-}  // namespace art
diff --git a/compiler/optimizing/execution_subgraph.h b/compiler/optimizing/execution_subgraph.h
deleted file mode 100644
index 5ddf17d..0000000
--- a/compiler/optimizing/execution_subgraph.h
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ART_COMPILER_OPTIMIZING_EXECUTION_SUBGRAPH_H_
-#define ART_COMPILER_OPTIMIZING_EXECUTION_SUBGRAPH_H_
-
-#include <algorithm>
-#include <sstream>
-
-#include "base/arena_allocator.h"
-#include "base/arena_bit_vector.h"
-#include "base/arena_containers.h"
-#include "base/array_ref.h"
-#include "base/bit_vector-inl.h"
-#include "base/globals.h"
-#include "base/iteration_range.h"
-#include "base/macros.h"
-#include "base/mutex.h"
-#include "base/scoped_arena_allocator.h"
-#include "base/scoped_arena_containers.h"
-#include "base/stl_util.h"
-#include "base/transform_iterator.h"
-#include "nodes.h"
-
-namespace art HIDDEN {
-
-// Helper for transforming blocks to block_ids.
-class BlockToBlockIdTransformer {
- public:
-  BlockToBlockIdTransformer(BlockToBlockIdTransformer&&) = default;
-  BlockToBlockIdTransformer(const BlockToBlockIdTransformer&) = default;
-  BlockToBlockIdTransformer() {}
-
-  inline uint32_t operator()(const HBasicBlock* b) const {
-    return b->GetBlockId();
-  }
-};
-
-// Helper for transforming block ids to blocks.
-class BlockIdToBlockTransformer {
- public:
-  BlockIdToBlockTransformer(BlockIdToBlockTransformer&&) = default;
-  BlockIdToBlockTransformer(const BlockIdToBlockTransformer&) = default;
-  explicit BlockIdToBlockTransformer(const HGraph* graph) : graph_(graph) {}
-
-  inline const HGraph* GetGraph() const {
-    return graph_;
-  }
-
-  inline HBasicBlock* GetBlock(uint32_t id) const {
-    DCHECK_LT(id, graph_->GetBlocks().size()) << graph_->PrettyMethod();
-    HBasicBlock* blk = graph_->GetBlocks()[id];
-    DCHECK(blk != nullptr);
-    return blk;
-  }
-
-  inline HBasicBlock* operator()(uint32_t id) const {
-    return GetBlock(id);
-  }
-
- private:
-  const HGraph* const graph_;
-};
-
-class BlockIdFilterThunk {
- public:
-  explicit BlockIdFilterThunk(const BitVector& i) : inner_(i) {}
-  BlockIdFilterThunk(BlockIdFilterThunk&& other) noexcept = default;
-  BlockIdFilterThunk(const BlockIdFilterThunk&) = default;
-
-  bool operator()(const HBasicBlock* b) const {
-    return inner_.IsBitSet(b->GetBlockId());
-  }
-
- private:
-  const BitVector& inner_;
-};
-
-// A representation of a particular section of the graph. The graph is split
-// into an excluded and included area and is used to track escapes.
-//
-// This object is a view of the graph and is not updated as the graph is
-// changed.
-//
-// This is implemented by removing various escape points from the subgraph using
-// the 'RemoveBlock' function. Once all required blocks are removed one will
-// 'Finalize' the subgraph. This will extend the removed area to include:
-// (1) Any block which inevitably leads to (post-dominates) a removed block
-// (2) any block which is between 2 removed blocks
-//
-// This allows us to create a set of 'ExcludedCohorts' which are the
-// well-connected subsets of the graph made up of removed blocks. These cohorts
-// have a set of entry and exit blocks which act as the boundary of the cohort.
-// Since we removed blocks between 2 excluded blocks it is impossible for any
-// cohort-exit block to reach any cohort-entry block. This means we can use the
-// boundary between the cohort and the rest of the graph to insert
-// materialization blocks for partial LSE.
-//
-// TODO We really should expand this to take into account where the object
-// allocation takes place directly. Currently we always act as though it were
-// allocated in the entry block. This is a massively simplifying assumption but
-// means we can't partially remove objects that are repeatedly allocated in a
-// loop.
-class ExecutionSubgraph : public DeletableArenaObject<kArenaAllocLSA> {
- public:
-  using BitVecBlockRange =
-      IterationRange<TransformIterator<BitVector::IndexIterator, BlockIdToBlockTransformer>>;
-  using FilteredBitVecBlockRange = IterationRange<
-      FilterIterator<ArenaVector<HBasicBlock*>::const_iterator, BlockIdFilterThunk>>;
-
-  // A set of connected blocks which are connected and removed from the
-  // ExecutionSubgraph. See above comment for explanation.
-  class ExcludedCohort : public ArenaObject<kArenaAllocLSA> {
-   public:
-    ExcludedCohort(ExcludedCohort&&) = default;
-    ExcludedCohort(const ExcludedCohort&) = delete;
-    explicit ExcludedCohort(ScopedArenaAllocator* allocator, HGraph* graph)
-        : graph_(graph),
-          entry_blocks_(allocator, graph_->GetBlocks().size(), false, kArenaAllocLSA),
-          exit_blocks_(allocator, graph_->GetBlocks().size(), false, kArenaAllocLSA),
-          blocks_(allocator, graph_->GetBlocks().size(), false, kArenaAllocLSA) {}
-
-    ~ExcludedCohort() = default;
-
-    // All blocks in the cohort.
-    BitVecBlockRange Blocks() const {
-      return BlockIterRange(blocks_);
-    }
-
-    // Blocks that have predecessors outside of the cohort. These blocks will
-    // need to have PHIs/control-flow added to create the escaping value.
-    BitVecBlockRange EntryBlocks() const {
-      return BlockIterRange(entry_blocks_);
-    }
-
-    FilteredBitVecBlockRange EntryBlocksReversePostOrder() const {
-      return Filter(MakeIterationRange(graph_->GetReversePostOrder()),
-                    BlockIdFilterThunk(entry_blocks_));
-    }
-
-    bool IsEntryBlock(const HBasicBlock* blk) const {
-      return entry_blocks_.IsBitSet(blk->GetBlockId());
-    }
-
-    // Blocks that have successors outside of the cohort. The successors of
-    // these blocks will need to have PHI's to restore state.
-    BitVecBlockRange ExitBlocks() const {
-      return BlockIterRange(exit_blocks_);
-    }
-
-    bool operator==(const ExcludedCohort& other) const {
-      return blocks_.Equal(&other.blocks_);
-    }
-
-    bool ContainsBlock(const HBasicBlock* blk) const {
-      return blocks_.IsBitSet(blk->GetBlockId());
-    }
-
-    // Returns true if there is a path from 'blk' to any block in this cohort.
-    // NB blocks contained within the cohort are not considered to be succeeded
-    // by the cohort (i.e. this function will return false).
-    bool SucceedsBlock(const HBasicBlock* blk) const {
-      if (ContainsBlock(blk)) {
-        return false;
-      }
-      auto idxs = entry_blocks_.Indexes();
-      return std::any_of(idxs.begin(), idxs.end(), [&](uint32_t entry) -> bool {
-        return blk->GetGraph()->PathBetween(blk->GetBlockId(), entry);
-      });
-    }
-
-    // Returns true if there is a path from any block in this cohort to 'blk'.
-    // NB blocks contained within the cohort are not considered to be preceded
-    // by the cohort (i.e. this function will return false).
-    bool PrecedesBlock(const HBasicBlock* blk) const {
-      if (ContainsBlock(blk)) {
-        return false;
-      }
-      auto idxs = exit_blocks_.Indexes();
-      return std::any_of(idxs.begin(), idxs.end(), [&](uint32_t exit) -> bool {
-        return blk->GetGraph()->PathBetween(exit, blk->GetBlockId());
-      });
-    }
-
-    void Dump(std::ostream& os) const;
-
-   private:
-    BitVecBlockRange BlockIterRange(const ArenaBitVector& bv) const {
-      auto indexes = bv.Indexes();
-      BitVecBlockRange res = MakeTransformRange(indexes, BlockIdToBlockTransformer(graph_));
-      return res;
-    }
-
-    ExcludedCohort() = delete;
-
-    HGraph* graph_;
-    ArenaBitVector entry_blocks_;
-    ArenaBitVector exit_blocks_;
-    ArenaBitVector blocks_;
-
-    friend class ExecutionSubgraph;
-    friend class LoadStoreAnalysisTest;
-  };
-
-  // The number of successors we can track on a single block. Graphs which
-  // contain a block with a branching factor greater than this will not be
-  // analysed. This is used to both limit the memory usage of analysis to
-  // reasonable levels and ensure that the analysis will complete in a
-  // reasonable amount of time. It also simplifies the implementation somewhat
-  // to have a constant branching factor.
-  static constexpr uint32_t kMaxFilterableSuccessors = 8;
-
-  // Instantiate a subgraph. The subgraph can be instantiated only if partial-escape
-  // analysis is desired (eg not when being used for instruction scheduling) and
-  // when the branching factor in the graph is not too high. These conditions
-  // are determined once and passed down for performance reasons.
-  ExecutionSubgraph(HGraph* graph, ScopedArenaAllocator* allocator);
-
-  void Invalidate() {
-    valid_ = false;
-  }
-
-  // A block is contained by the ExecutionSubgraph if it is reachable. This
-  // means it has not been removed explicitly or via pruning/concavity removal.
-  // Finalization is needed to call this function.
-  // See RemoveConcavity and Prune for more information.
-  bool ContainsBlock(const HBasicBlock* blk) const {
-    DCHECK_IMPLIES(finalized_, !needs_prune_);
-    if (!valid_) {
-      return false;
-    }
-    return !unreachable_blocks_.IsBitSet(blk->GetBlockId());
-  }
-
-  // Mark the block as removed from the subgraph.
-  void RemoveBlock(const HBasicBlock* to_remove);
-
-  // Called when no more updates will be done to the subgraph. Calculate the
-  // final subgraph
-  void Finalize() {
-    Prune();
-    RemoveConcavity();
-    finalized_ = true;
-  }
-
-  BitVecBlockRange UnreachableBlocks() const {
-    auto idxs = unreachable_blocks_.Indexes();
-    return MakeTransformRange(idxs, BlockIdToBlockTransformer(graph_));
-  }
-
-  // Returns true if all allowed execution paths from start eventually reach the
-  // graph's exit block (or diverge).
-  bool IsValid() const {
-    return valid_;
-  }
-
-  ArrayRef<const ExcludedCohort> GetExcludedCohorts() const {
-    DCHECK_IMPLIES(valid_, !needs_prune_);
-    if (!valid_ || !unreachable_blocks_.IsAnyBitSet()) {
-      return ArrayRef<const ExcludedCohort>();
-    } else {
-      return ArrayRef<const ExcludedCohort>(*excluded_list_);
-    }
-  }
-
-  // Helper class to create reachable blocks iterator.
-  class ContainsFunctor {
-   public:
-    bool operator()(HBasicBlock* blk) const {
-      return subgraph_->ContainsBlock(blk);
-    }
-
-   private:
-    explicit ContainsFunctor(const ExecutionSubgraph* subgraph) : subgraph_(subgraph) {}
-    const ExecutionSubgraph* const subgraph_;
-    friend class ExecutionSubgraph;
-  };
-  // Returns an iterator over reachable blocks (filtered as we go). This is primarilly for testing.
-  IterationRange<
-      FilterIterator<typename ArenaVector<HBasicBlock*>::const_iterator, ContainsFunctor>>
-  ReachableBlocks() const {
-    return Filter(MakeIterationRange(graph_->GetBlocks()), ContainsFunctor(this));
-  }
-
-  static bool CanAnalyse(HGraph* graph) {
-    // If there are any blocks with more than kMaxFilterableSuccessors we can't
-    // analyse the graph. We avoid this case to prevent excessive memory and
-    // time usage while allowing a simpler algorithm with a fixed-width
-    // branching factor.
-    return std::all_of(graph->GetBlocks().begin(), graph->GetBlocks().end(), [](HBasicBlock* blk) {
-      return blk == nullptr || blk->GetSuccessors().size() <= kMaxFilterableSuccessors;
-    });
-  }
-
- private:
-  std::bitset<kMaxFilterableSuccessors> GetAllowedSuccessors(const HBasicBlock* blk) const {
-    DCHECK(valid_);
-    return allowed_successors_[blk->GetBlockId()];
-  }
-
-  void LimitBlockSuccessors(const HBasicBlock* block,
-                            std::bitset<kMaxFilterableSuccessors> allowed) {
-    needs_prune_ = true;
-    allowed_successors_[block->GetBlockId()] &= allowed;
-  }
-
-  // Remove nodes which both precede and follow any exclusions. This ensures we don't need to deal
-  // with only conditionally materializing objects depending on if we already materialized them
-  // Ensure that for all blocks A, B, C: Unreachable(A) && Unreachable(C) && PathBetween(A, B) &&
-  // PathBetween(A, C) implies Unreachable(B). This simplifies later transforms since it ensures
-  // that no execution can leave and then re-enter any exclusion.
-  void RemoveConcavity();
-
-  // Removes sink nodes. Sink nodes are nodes where there is no execution which
-  // avoids all removed nodes.
-  void Prune();
-
-  void RecalculateExcludedCohort();
-
-  HGraph* graph_;
-  ScopedArenaAllocator* allocator_;
-  // The map from block_id -> allowed-successors.
-  // This is the canonical representation of this subgraph. If a bit in the
-  // bitset is not set then the corresponding outgoing edge of that block is not
-  // considered traversable.
-  ScopedArenaVector<std::bitset<kMaxFilterableSuccessors>> allowed_successors_;
-  // Helper that holds which blocks we are able to reach. Only valid if
-  // 'needs_prune_ == false'.
-  ArenaBitVector unreachable_blocks_;
-  // A list of the excluded-cohorts of this subgraph. This is only valid when
-  // 'needs_prune_ == false'
-  std::optional<ScopedArenaVector<ExcludedCohort>> excluded_list_;
-  // Bool to hold if there is at least one known path from the start block to
-  // the end in this graph. Used to short-circuit computation.
-  bool valid_;
-  // True if the subgraph is consistent and can be queried. Modifying the
-  // subgraph clears this and requires a prune to restore.
-  bool needs_prune_;
-  // True if no more modification of the subgraph is permitted.
-  bool finalized_;
-
-  friend class ExecutionSubgraphTest;
-  friend class LoadStoreAnalysisTest;
-
-  DISALLOW_COPY_AND_ASSIGN(ExecutionSubgraph);
-};
-
-std::ostream& operator<<(std::ostream& os, const ExecutionSubgraph::ExcludedCohort& ex);
-
-}  // namespace art
-
-#endif  // ART_COMPILER_OPTIMIZING_EXECUTION_SUBGRAPH_H_
diff --git a/compiler/optimizing/execution_subgraph_test.cc b/compiler/optimizing/execution_subgraph_test.cc
deleted file mode 100644
index 921ef05..0000000
--- a/compiler/optimizing/execution_subgraph_test.cc
+++ /dev/null
@@ -1,975 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "execution_subgraph_test.h"
-
-#include <array>
-#include <sstream>
-#include <string_view>
-#include <unordered_map>
-#include <unordered_set>
-
-#include "base/scoped_arena_allocator.h"
-#include "base/stl_util.h"
-#include "class_root.h"
-#include "dex/dex_file_types.h"
-#include "dex/method_reference.h"
-#include "entrypoints/quick/quick_entrypoints_enum.h"
-#include "execution_subgraph.h"
-#include "gtest/gtest.h"
-#include "handle.h"
-#include "handle_scope.h"
-#include "nodes.h"
-#include "optimizing/data_type.h"
-#include "optimizing_unit_test.h"
-#include "scoped_thread_state_change.h"
-
-namespace art HIDDEN {
-
-using BlockSet = std::unordered_set<const HBasicBlock*>;
-
-// Helper that checks validity directly.
-bool ExecutionSubgraphTestHelper::CalculateValidity(HGraph* graph, const ExecutionSubgraph* esg) {
-  bool reached_end = false;
-  std::queue<const HBasicBlock*> worklist;
-  std::unordered_set<const HBasicBlock*> visited;
-  worklist.push(graph->GetEntryBlock());
-  while (!worklist.empty()) {
-    const HBasicBlock* cur = worklist.front();
-    worklist.pop();
-    if (visited.find(cur) != visited.end()) {
-      continue;
-    } else {
-      visited.insert(cur);
-    }
-    if (cur == graph->GetExitBlock()) {
-      reached_end = true;
-      continue;
-    }
-    bool has_succ = false;
-    for (const HBasicBlock* succ : cur->GetSuccessors()) {
-      DCHECK(succ != nullptr) << "Bad successors on block " << cur->GetBlockId();
-      if (!esg->ContainsBlock(succ)) {
-        continue;
-      }
-      has_succ = true;
-      worklist.push(succ);
-    }
-    if (!has_succ) {
-      // We aren't at the end and have nowhere to go so fail.
-      return false;
-    }
-  }
-  return reached_end;
-}
-
-class ExecutionSubgraphTest : public OptimizingUnitTest {
- public:
-  ExecutionSubgraphTest() : graph_(CreateGraph()) {}
-
-  AdjacencyListGraph SetupFromAdjacencyList(const std::string_view entry_name,
-                                            const std::string_view exit_name,
-                                            const std::vector<AdjacencyListGraph::Edge>& adj) {
-    return AdjacencyListGraph(graph_, GetAllocator(), entry_name, exit_name, adj);
-  }
-
-  bool IsValidSubgraph(const ExecutionSubgraph* esg) {
-    return ExecutionSubgraphTestHelper::CalculateValidity(graph_, esg);
-  }
-
-  bool IsValidSubgraph(const ExecutionSubgraph& esg) {
-    return ExecutionSubgraphTestHelper::CalculateValidity(graph_, &esg);
-  }
-
-  HGraph* graph_;
-};
-
-// Some comparators used by these tests to avoid having to deal with various set types.
-template <typename BLKS, typename = std::enable_if_t<!std::is_same_v<BlockSet, BLKS>>>
-bool operator==(const BlockSet& bs, const BLKS& sas) {
-  std::unordered_set<const HBasicBlock*> us(sas.begin(), sas.end());
-  return bs == us;
-}
-template <typename BLKS, typename = std::enable_if_t<!std::is_same_v<BlockSet, BLKS>>>
-bool operator==(const BLKS& sas, const BlockSet& bs) {
-  return bs == sas;
-}
-template <typename BLKS, typename = std::enable_if_t<!std::is_same_v<BlockSet, BLKS>>>
-bool operator!=(const BlockSet& bs, const BLKS& sas) {
-  return !(bs == sas);
-}
-template <typename BLKS, typename = std::enable_if_t<!std::is_same_v<BlockSet, BLKS>>>
-bool operator!=(const BLKS& sas, const BlockSet& bs) {
-  return !(bs == sas);
-}
-
-// +-------+       +-------+
-// | right | <--   | entry |
-// +-------+       +-------+
-//   |               |
-//   |               |
-//   |               v
-//   |           + - - - - - +
-//   |           '  removed  '
-//   |           '           '
-//   |           ' +-------+ '
-//   |           ' | left  | '
-//   |           ' +-------+ '
-//   |           '           '
-//   |           + - - - - - +
-//   |               |
-//   |               |
-//   |               v
-//   |             +-------+
-//   +--------->   | exit  |
-//                 +-------+
-TEST_F(ExecutionSubgraphTest, Basic) {
-  AdjacencyListGraph blks(SetupFromAdjacencyList(
-      "entry",
-      "exit",
-      { { "entry", "left" }, { "entry", "right" }, { "left", "exit" }, { "right", "exit" } }));
-  ASSERT_TRUE(ExecutionSubgraph::CanAnalyse(graph_));
-  ExecutionSubgraph esg(graph_, GetScopedAllocator());
-  esg.RemoveBlock(blks.Get("left"));
-  esg.Finalize();
-  ASSERT_TRUE(esg.IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  std::unordered_set<const HBasicBlock*> contents(esg.ReachableBlocks().begin(),
-                                                  esg.ReachableBlocks().end());
-
-  ASSERT_EQ(contents.size(), 3u);
-  ASSERT_TRUE(contents.find(blks.Get("left")) == contents.end());
-
-  ASSERT_TRUE(contents.find(blks.Get("right")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("entry")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("exit")) != contents.end());
-  esg.RemoveBlock(blks.Get("right"));
-  esg.Finalize();
-  std::unordered_set<const HBasicBlock*> contents_2(esg.ReachableBlocks().begin(),
-                                                    esg.ReachableBlocks().end());
-  ASSERT_EQ(contents_2.size(), 0u);
-}
-
-//                   +-------+         +-------+
-//                   | right |   <--   | entry |
-//                   +-------+         +-------+
-//                     |                 |
-//                     |                 |
-//                     |                 v
-//                     |             + - - - - - - - - - - - - - - - - - - - -+
-//                     |             '             indirectly_removed         '
-//                     |             '                                        '
-//                     |             ' +-------+                      +-----+ '
-//                     |             ' |  l1   | -------------------> | l1r | '
-//                     |             ' +-------+                      +-----+ '
-//                     |             '   |                              |     '
-//                     |             '   |                              |     '
-//                     |             '   v                              |     '
-//                     |             ' +-------+                        |     '
-//                     |             ' |  l1l  |                        |     '
-//                     |             ' +-------+                        |     '
-//                     |             '   |                              |     '
-//                     |             '   |                              |     '
-//                     |             '   |                              |     '
-// + - - - - - - - -+  |      +- - -     |                              |     '
-// '                '  |      +-         v                              |     '
-// ' +-----+           |               +----------------+               |     '
-// ' | l2r | <---------+-------------- |  l2 (removed)  | <-------------+     '
-// ' +-----+           |               +----------------+                     '
-// '   |            '  |      +-         |                                    '
-// '   |       - - -+  |      +- - -     |         - - - - - - - - - - - - - -+
-// '   |     '         |             '   |       '
-// '   |     '         |             '   |       '
-// '   |     '         |             '   v       '
-// '   |     '         |             ' +-------+ '
-// '   |     '         |             ' |  l2l  | '
-// '   |     '         |             ' +-------+ '
-// '   |     '         |             '   |       '
-// '   |     '         |             '   |       '
-// '   |     '         |             '   |       '
-// '   |       - - -+  |      +- - -     |       '
-// '   |            '  |      +-         v       '
-// '   |               |               +-------+ '
-// '   +---------------+-------------> |  l3   | '
-// '                   |               +-------+ '
-// '                '  |      +-                 '
-// + - - - - - - - -+  |      +- - - - - - - - - +
-//                     |                 |
-//                     |                 |
-//                     |                 v
-//                     |               +-------+
-//                     +----------->   | exit  |
-//                                     +-------+
-TEST_F(ExecutionSubgraphTest, Propagation) {
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 { { "entry", "l1" },
-                                                   { "l1", "l1l" },
-                                                   { "l1", "l1r" },
-                                                   { "l1l", "l2" },
-                                                   { "l1r", "l2" },
-                                                   { "l2", "l2l" },
-                                                   { "l2", "l2r" },
-                                                   { "l2l", "l3" },
-                                                   { "l2r", "l3" },
-                                                   { "l3", "exit" },
-                                                   { "entry", "right" },
-                                                   { "right", "exit" } }));
-  ASSERT_TRUE(ExecutionSubgraph::CanAnalyse(graph_));
-  ExecutionSubgraph esg(graph_, GetScopedAllocator());
-  esg.RemoveBlock(blks.Get("l2"));
-  esg.Finalize();
-  ASSERT_TRUE(esg.IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  std::unordered_set<const HBasicBlock*> contents(esg.ReachableBlocks().begin(),
-                                                  esg.ReachableBlocks().end());
-
-  // ASSERT_EQ(contents.size(), 3u);
-  // Not present, no path through.
-  ASSERT_TRUE(contents.find(blks.Get("l1")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l2")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l3")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l1l")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l1r")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l2l")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l2r")) == contents.end());
-
-  // present, path through.
-  ASSERT_TRUE(contents.find(blks.Get("right")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("entry")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("exit")) != contents.end());
-}
-
-// +------------------------------------+
-// |                                    |
-// |  +-------+       +-------+         |
-// |  | right | <--   | entry |         |
-// |  +-------+       +-------+         |
-// |    |               |               |
-// |    |               |               |
-// |    |               v               |
-// |    |             +-------+       +--------+
-// +----+--------->   |  l1   |   --> | l1loop |
-//      |             +-------+       +--------+
-//      |               |
-//      |               |
-//      |               v
-//      |           +- - - - - -+
-//      |           '  removed  '
-//      |           '           '
-//      |           ' +-------+ '
-//      |           ' |  l2   | '
-//      |           ' +-------+ '
-//      |           '           '
-//      |           +- - - - - -+
-//      |               |
-//      |               |
-//      |               v
-//      |             +-------+
-//      +--------->   | exit  |
-//                    +-------+
-TEST_F(ExecutionSubgraphTest, PropagationLoop) {
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 { { "entry", "l1" },
-                                                   { "l1", "l2" },
-                                                   { "l1", "l1loop" },
-                                                   { "l1loop", "l1" },
-                                                   { "l2", "exit" },
-                                                   { "entry", "right" },
-                                                   { "right", "exit" } }));
-  ASSERT_TRUE(ExecutionSubgraph::CanAnalyse(graph_));
-  ExecutionSubgraph esg(graph_, GetScopedAllocator());
-  esg.RemoveBlock(blks.Get("l2"));
-  esg.Finalize();
-  ASSERT_TRUE(esg.IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  std::unordered_set<const HBasicBlock*> contents(esg.ReachableBlocks().begin(),
-                                                  esg.ReachableBlocks().end());
-
-  ASSERT_EQ(contents.size(), 5u);
-
-  // Not present, no path through.
-  ASSERT_TRUE(contents.find(blks.Get("l2")) == contents.end());
-
-  // present, path through.
-  // Since the loop can diverge we should leave it in the execution subgraph.
-  ASSERT_TRUE(contents.find(blks.Get("l1")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l1loop")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("right")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("entry")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("exit")) != contents.end());
-}
-
-// +--------------------------------+
-// |                                |
-// |  +-------+     +-------+       |
-// |  | right | <-- | entry |       |
-// |  +-------+     +-------+       |
-// |    |             |             |
-// |    |             |             |
-// |    |             v             |
-// |    |           +-------+     +--------+
-// +----+---------> |  l1   | --> | l1loop |
-//      |           +-------+     +--------+
-//      |             |
-//      |             |
-//      |             v
-//      |           +-------+
-//      |           |  l2   |
-//      |           +-------+
-//      |             |
-//      |             |
-//      |             v
-//      |           +-------+
-//      +---------> | exit  |
-//                  +-------+
-TEST_F(ExecutionSubgraphTest, PropagationLoop2) {
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 { { "entry", "l1" },
-                                                   { "l1", "l2" },
-                                                   { "l1", "l1loop" },
-                                                   { "l1loop", "l1" },
-                                                   { "l2", "exit" },
-                                                   { "entry", "right" },
-                                                   { "right", "exit" } }));
-  ASSERT_TRUE(ExecutionSubgraph::CanAnalyse(graph_));
-  ExecutionSubgraph esg(graph_, GetScopedAllocator());
-  esg.RemoveBlock(blks.Get("l1"));
-  esg.Finalize();
-  ASSERT_TRUE(esg.IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  std::unordered_set<const HBasicBlock*> contents(esg.ReachableBlocks().begin(),
-                                                  esg.ReachableBlocks().end());
-
-  ASSERT_EQ(contents.size(), 3u);
-
-  // Not present, no path through.
-  ASSERT_TRUE(contents.find(blks.Get("l1")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l1loop")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l2")) == contents.end());
-
-  // present, path through.
-  ASSERT_TRUE(contents.find(blks.Get("right")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("entry")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("exit")) != contents.end());
-}
-
-// +--------------------------------+
-// |                                |
-// |  +-------+     +-------+       |
-// |  | right | <-- | entry |       |
-// |  +-------+     +-------+       |
-// |    |             |             |
-// |    |             |             |
-// |    |             v             |
-// |    |           +-------+     +--------+
-// +----+---------> |  l1   | --> | l1loop |
-//      |           +-------+     +--------+
-//      |             |
-//      |             |
-//      |             v
-//      |           +-------+
-//      |           |  l2   |
-//      |           +-------+
-//      |             |
-//      |             |
-//      |             v
-//      |           +-------+
-//      +---------> | exit  |
-//                  +-------+
-TEST_F(ExecutionSubgraphTest, PropagationLoop3) {
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 { { "entry", "l1" },
-                                                   { "l1", "l2" },
-                                                   { "l1", "l1loop" },
-                                                   { "l1loop", "l1" },
-                                                   { "l2", "exit" },
-                                                   { "entry", "right" },
-                                                   { "right", "exit" } }));
-  ASSERT_TRUE(ExecutionSubgraph::CanAnalyse(graph_));
-  ExecutionSubgraph esg(graph_, GetScopedAllocator());
-  esg.RemoveBlock(blks.Get("l1loop"));
-  esg.Finalize();
-  ASSERT_TRUE(esg.IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  std::unordered_set<const HBasicBlock*> contents(esg.ReachableBlocks().begin(),
-                                                  esg.ReachableBlocks().end());
-
-  ASSERT_EQ(contents.size(), 3u);
-
-  // Not present, no path through. If we got to l1 loop then we must merge back
-  // with l1 and l2 so they're bad too.
-  ASSERT_TRUE(contents.find(blks.Get("l1loop")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l1")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l2")) == contents.end());
-
-  // present, path through.
-  ASSERT_TRUE(contents.find(blks.Get("right")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("entry")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("exit")) != contents.end());
-}
-
-//            ┌───────┐       ┌──────────────┐
-//            │ right │ ◀──   │    entry     │
-//            └───────┘       └──────────────┘
-//              │               │
-//              │               │
-//              ▼               ▼
-// ┌────┐     ┌───────┐       ┌──────────────┐
-// │ l2 │ ──▶ │ exit  │  ┌─   │      l1      │   ◀┐
-// └────┘     └───────┘  │    └──────────────┘    │
-//   ▲                   │      │                 │
-//   └───────────────────┘      │                 │
-//                              ▼                 │
-//                            ┌──────────────┐    │  ┌──────────────┐
-//                       ┌─   │    l1loop    │    │  │ l1loop_right │ ◀┐
-//                       │    └──────────────┘    │  └──────────────┘  │
-//                       │      │                 │    │               │
-//                       │      │                 │    │               │
-//                       │      ▼                 │    │               │
-//                       │  ┌−−−−−−−−−−−−−−−−−−┐  │    │               │
-//                       │  ╎     removed      ╎  │    │               │
-//                       │  ╎                  ╎  │    │               │
-//                       │  ╎ ┌──────────────┐ ╎  │    │               │
-//                       │  ╎ │ l1loop_left  │ ╎  │    │               │
-//                       │  ╎ └──────────────┘ ╎  │    │               │
-//                       │  ╎                  ╎  │    │               │
-//                       │  └−−−−−−−−−−−−−−−−−−┘  │    │               │
-//                       │      │                 │    │               │
-//                       │      │                 │    │               │
-//                       │      ▼                 │    │               │
-//                       │    ┌──────────────┐    │    │               │
-//                       │    │ l1loop_merge │   ─┘    │               │
-//                       │    └──────────────┘         │               │
-//                       │      ▲                      │               │
-//                       │      └──────────────────────┘               │
-//                       │                                             │
-//                       │                                             │
-//                       └─────────────────────────────────────────────┘
-
-TEST_F(ExecutionSubgraphTest, PropagationLoop4) {
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "l1"},
-                                                  {"l1", "l2"},
-                                                  {"l1", "l1loop"},
-                                                  {"l1loop", "l1loop_left"},
-                                                  {"l1loop", "l1loop_right"},
-                                                  {"l1loop_left", "l1loop_merge"},
-                                                  {"l1loop_right", "l1loop_merge"},
-                                                  {"l1loop_merge", "l1"},
-                                                  {"l2", "exit"},
-                                                  {"entry", "right"},
-                                                  {"right", "exit"}}));
-  ASSERT_TRUE(ExecutionSubgraph::CanAnalyse(graph_));
-  ExecutionSubgraph esg(graph_, GetScopedAllocator());
-  esg.RemoveBlock(blks.Get("l1loop_left"));
-  esg.Finalize();
-  ASSERT_TRUE(esg.IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  std::unordered_set<const HBasicBlock*> contents(esg.ReachableBlocks().begin(),
-                                                  esg.ReachableBlocks().end());
-
-  ASSERT_EQ(contents.size(), 3u);
-
-  // Not present, no path through. If we got to l1 loop then we must merge back
-  // with l1 and l2 so they're bad too.
-  ASSERT_TRUE(contents.find(blks.Get("l1loop")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l1")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l1loop_left")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l1loop_right")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l1loop_merge")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l2")) == contents.end());
-
-  // present, path through.
-  ASSERT_TRUE(contents.find(blks.Get("right")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("entry")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("exit")) != contents.end());
-}
-
-// +------------------------------------------------------+
-// |                                                      |
-// |  +--------------+       +-------------+              |
-// |  |    right     | <--   |    entry    |              |
-// |  +--------------+       +-------------+              |
-// |    |                      |                          |
-// |    |                      |                          |
-// |    v                      v                          |
-// |  +--------------+       +--------------------+     +----+
-// +> |     exit     |  +>   |         l1         | --> | l2 |
-//    +--------------+  |    +--------------------+     +----+
-//                      |      |                ^
-//      +---------------+      |                |
-//      |                      v                |
-//    +--------------+       +-------------+    |
-//    | l1loop_right | <--   |   l1loop    |    |
-//    +--------------+       +-------------+    |
-//                             |                |
-//                             |                |
-//                             v                |
-//                         + - - - - - - - - +  |
-//                         '     removed     '  |
-//                         '                 '  |
-//                         ' +-------------+ '  |
-//                         ' | l1loop_left | ' -+
-//                         ' +-------------+ '
-//                         '                 '
-//                         + - - - - - - - - +
-TEST_F(ExecutionSubgraphTest, PropagationLoop5) {
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "l1"},
-                                                  {"l1", "l2"},
-                                                  {"l1", "l1loop"},
-                                                  {"l1loop", "l1loop_left"},
-                                                  {"l1loop", "l1loop_right"},
-                                                  {"l1loop_left", "l1"},
-                                                  {"l1loop_right", "l1"},
-                                                  {"l2", "exit"},
-                                                  {"entry", "right"},
-                                                  {"right", "exit"}}));
-  ASSERT_TRUE(ExecutionSubgraph::CanAnalyse(graph_));
-  ExecutionSubgraph esg(graph_, GetScopedAllocator());
-  esg.RemoveBlock(blks.Get("l1loop_left"));
-  esg.Finalize();
-  ASSERT_TRUE(esg.IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  std::unordered_set<const HBasicBlock*> contents(esg.ReachableBlocks().begin(),
-                                                  esg.ReachableBlocks().end());
-
-  ASSERT_EQ(contents.size(), 3u);
-
-  // Not present, no path through. If we got to l1 loop then we must merge back
-  // with l1 and l2 so they're bad too.
-  ASSERT_TRUE(contents.find(blks.Get("l1loop")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l1")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l1loop_left")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l1loop_right")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("l2")) == contents.end());
-
-  // present, path through.
-  ASSERT_TRUE(contents.find(blks.Get("right")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("entry")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("exit")) != contents.end());
-}
-
-TEST_F(ExecutionSubgraphTest, Invalid) {
-  AdjacencyListGraph blks(SetupFromAdjacencyList(
-      "entry",
-      "exit",
-      { { "entry", "left" }, { "entry", "right" }, { "left", "exit" }, { "right", "exit" } }));
-  ASSERT_TRUE(ExecutionSubgraph::CanAnalyse(graph_));
-  ExecutionSubgraph esg(graph_, GetScopedAllocator());
-  esg.RemoveBlock(blks.Get("left"));
-  esg.RemoveBlock(blks.Get("right"));
-  esg.Finalize();
-
-  ASSERT_FALSE(esg.IsValid());
-  ASSERT_FALSE(IsValidSubgraph(esg));
-  std::unordered_set<const HBasicBlock*> contents(esg.ReachableBlocks().begin(),
-                                                  esg.ReachableBlocks().end());
-
-  ASSERT_EQ(contents.size(), 0u);
-}
-// Sibling branches are disconnected.
-TEST_F(ExecutionSubgraphTest, Exclusions) {
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 { { "entry", "a" },
-                                                   { "entry", "b" },
-                                                   { "entry", "c" },
-                                                   { "a", "exit" },
-                                                   { "b", "exit" },
-                                                   { "c", "exit" } }));
-  ASSERT_TRUE(ExecutionSubgraph::CanAnalyse(graph_));
-  ExecutionSubgraph esg(graph_, GetScopedAllocator());
-  esg.RemoveBlock(blks.Get("a"));
-  esg.RemoveBlock(blks.Get("c"));
-  esg.Finalize();
-  ASSERT_TRUE(esg.IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  std::unordered_set<const HBasicBlock*> contents(esg.ReachableBlocks().begin(),
-                                                  esg.ReachableBlocks().end());
-
-  ASSERT_EQ(contents.size(), 3u);
-  // Not present, no path through.
-  ASSERT_TRUE(contents.find(blks.Get("a")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("c")) == contents.end());
-
-  // present, path through.
-  ASSERT_TRUE(contents.find(blks.Get("entry")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("exit")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("b")) != contents.end());
-
-  ArrayRef<const ExecutionSubgraph::ExcludedCohort> exclusions(esg.GetExcludedCohorts());
-  ASSERT_EQ(exclusions.size(), 2u);
-  std::unordered_set<const HBasicBlock*> exclude_a({ blks.Get("a") });
-  std::unordered_set<const HBasicBlock*> exclude_c({ blks.Get("c") });
-  ASSERT_TRUE(std::find_if(exclusions.cbegin(),
-                           exclusions.cend(),
-                           [&](const ExecutionSubgraph::ExcludedCohort& it) {
-                             return it.Blocks() == exclude_a;
-                           }) != exclusions.cend());
-  ASSERT_TRUE(std::find_if(exclusions.cbegin(),
-                           exclusions.cend(),
-                           [&](const ExecutionSubgraph::ExcludedCohort& it) {
-                             return it.Blocks() == exclude_c;
-                           }) != exclusions.cend());
-}
-
-// Sibling branches are disconnected.
-//                                      +- - - - - - - - - - - - - - - - - - - - - - +
-//                                      '                      remove_c              '
-//                                      '                                            '
-//                                      ' +-----------+                              '
-//                                      ' | c_begin_2 | -------------------------+   '
-//                                      ' +-----------+                          |   '
-//                                      '                                        |   '
-//                                      +- - - - - - - - - - - - - - - - - -     |   '
-//                                          ^                                '   |   '
-//                                          |                                '   |   '
-//                                          |                                '   |   '
-//                   + - - - - - -+                                          '   |   '
-//                   '  remove_a  '                                          '   |   '
-//                   '            '                                          '   |   '
-//                   ' +--------+ '       +-----------+                 +---+'   |   '
-//                   ' | **a**  | ' <--   |   entry   |   -->           | b |'   |   '
-//                   ' +--------+ '       +-----------+                 +---+'   |   '
-//                   '            '                                          '   |   '
-//                   + - - - - - -+                                          '   |   '
-//                       |                  |                             |  '   |   '
-//                       |                  |                             |  '   |   '
-//                       |                  v                             |  '   |   '
-//                       |              +- - - - - - - -+                 |  '   |   '
-//                       |              '               '                 |  '   |   '
-//                       |              ' +-----------+ '                 |  '   |   '
-//                       |              ' | c_begin_1 | '                 |  '   |   '
-//                       |              ' +-----------+ '                 |  '   |   '
-//                       |              '   |           '                 |  '   |   '
-//                       |              '   |           '                 |  '   |   '
-//                       |              '   |           '                 |  '   |   '
-// + - - - - - - - - -+  |       + - - -    |            - - - - - - - +  |  '   |   '
-// '                  '  |       +          v                          '  |  +   |   '
-// ' +---------+         |                +-----------+                   |      |   '
-// ' | c_end_2 | <-------+--------------- | **c_mid** | <-----------------+------+   '
-// ' +---------+         |                +-----------+                   |          '
-// '                  '  |       +          |                          '  |  +       '
-// + - - - - - - - - -+  |       + - - -    |            - - - - - - - +  |  + - - - +
-//     |                 |              '   |           '                 |
-//     |                 |              '   |           '                 |
-//     |                 |              '   v           '                 |
-//     |                 |              ' +-----------+ '                 |
-//     |                 |              ' |  c_end_1  | '                 |
-//     |                 |              ' +-----------+ '                 |
-//     |                 |              '               '                 |
-//     |                 |              +- - - - - - - -+                 |
-//     |                 |                  |                             |
-//     |                 |                  |                             |
-//     |                 |                  v                             v
-//     |                 |                +---------------------------------+
-//     |                 +------------>   |              exit               |
-//     |                                  +---------------------------------+
-//     |                                    ^
-//     +------------------------------------+
-TEST_F(ExecutionSubgraphTest, ExclusionExtended) {
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 { { "entry", "a" },
-                                                   { "entry", "b" },
-                                                   { "entry", "c_begin_1" },
-                                                   { "entry", "c_begin_2" },
-                                                   { "c_begin_1", "c_mid" },
-                                                   { "c_begin_2", "c_mid" },
-                                                   { "c_mid", "c_end_1" },
-                                                   { "c_mid", "c_end_2" },
-                                                   { "a", "exit" },
-                                                   { "b", "exit" },
-                                                   { "c_end_1", "exit" },
-                                                   { "c_end_2", "exit" } }));
-  ASSERT_TRUE(ExecutionSubgraph::CanAnalyse(graph_));
-  ExecutionSubgraph esg(graph_, GetScopedAllocator());
-  esg.RemoveBlock(blks.Get("a"));
-  esg.RemoveBlock(blks.Get("c_mid"));
-  esg.Finalize();
-  ASSERT_TRUE(esg.IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  std::unordered_set<const HBasicBlock*> contents(esg.ReachableBlocks().begin(),
-                                                  esg.ReachableBlocks().end());
-
-  ASSERT_EQ(contents.size(), 3u);
-  // Not present, no path through.
-  ASSERT_TRUE(contents.find(blks.Get("a")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("c_begin_1")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("c_begin_2")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("c_mid")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("c_end_1")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("c_end_2")) == contents.end());
-
-  // present, path through.
-  ASSERT_TRUE(contents.find(blks.Get("entry")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("exit")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("b")) != contents.end());
-
-  ArrayRef<const ExecutionSubgraph::ExcludedCohort> exclusions(esg.GetExcludedCohorts());
-  ASSERT_EQ(exclusions.size(), 2u);
-  BlockSet exclude_a({ blks.Get("a") });
-  BlockSet exclude_c({ blks.Get("c_begin_1"),
-                       blks.Get("c_begin_2"),
-                       blks.Get("c_mid"),
-                       blks.Get("c_end_1"),
-                       blks.Get("c_end_2") });
-  ASSERT_TRUE(std::find_if(exclusions.cbegin(),
-                           exclusions.cend(),
-                           [&](const ExecutionSubgraph::ExcludedCohort& it) {
-                             return it.Blocks() == exclude_a;
-                           }) != exclusions.cend());
-  ASSERT_TRUE(
-      std::find_if(
-          exclusions.cbegin(), exclusions.cend(), [&](const ExecutionSubgraph::ExcludedCohort& it) {
-            return it.Blocks() == exclude_c &&
-                   BlockSet({ blks.Get("c_begin_1"), blks.Get("c_begin_2") }) == it.EntryBlocks() &&
-                   BlockSet({ blks.Get("c_end_1"), blks.Get("c_end_2") }) == it.ExitBlocks();
-          }) != exclusions.cend());
-}
-
-//    ┌───────┐     ┌────────────┐
-// ┌─ │ right │ ◀── │   entry    │
-// │  └───────┘     └────────────┘
-// │                  │
-// │                  │
-// │                  ▼
-// │                ┌────────────┐
-// │                │  esc_top   │
-// │                └────────────┘
-// │                  │
-// │                  │
-// │                  ▼
-// │                ┌────────────┐
-// └──────────────▶ │   middle   │ ─┐
-//                  └────────────┘  │
-//                    │             │
-//                    │             │
-//                    ▼             │
-//                  ┌────────────┐  │
-//                  │ esc_bottom │  │
-//                  └────────────┘  │
-//                    │             │
-//                    │             │
-//                    ▼             │
-//                  ┌────────────┐  │
-//                  │    exit    │ ◀┘
-//                  └────────────┘
-TEST_F(ExecutionSubgraphTest, InAndOutEscape) {
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 { { "entry", "esc_top" },
-                                                   { "entry", "right" },
-                                                   { "esc_top", "middle" },
-                                                   { "right", "middle" },
-                                                   { "middle", "exit" },
-                                                   { "middle", "esc_bottom" },
-                                                   { "esc_bottom", "exit" } }));
-
-  ASSERT_TRUE(ExecutionSubgraph::CanAnalyse(graph_));
-  ExecutionSubgraph esg(graph_, GetScopedAllocator());
-  esg.RemoveBlock(blks.Get("esc_top"));
-  esg.RemoveBlock(blks.Get("esc_bottom"));
-  esg.Finalize();
-
-  std::unordered_set<const HBasicBlock*> contents(esg.ReachableBlocks().begin(),
-                                                  esg.ReachableBlocks().end());
-  ASSERT_EQ(contents.size(), 0u);
-  ASSERT_FALSE(esg.IsValid());
-  ASSERT_FALSE(IsValidSubgraph(esg));
-
-  ASSERT_EQ(contents.size(), 0u);
-}
-
-// Test with max number of successors and no removals.
-TEST_F(ExecutionSubgraphTest, BigNodes) {
-  std::vector<std::string> mid_blocks;
-  for (auto i : Range(ExecutionSubgraph::kMaxFilterableSuccessors)) {
-    std::ostringstream oss;
-    oss << "blk" << i;
-    mid_blocks.push_back(oss.str().c_str());
-  }
-  ASSERT_EQ(mid_blocks.size(), ExecutionSubgraph::kMaxFilterableSuccessors);
-  std::vector<AdjacencyListGraph::Edge> edges;
-  for (const auto& mid : mid_blocks) {
-    edges.emplace_back("entry", mid);
-    edges.emplace_back(mid, "exit");
-  }
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry", "exit", edges));
-  ASSERT_TRUE(ExecutionSubgraph::CanAnalyse(graph_));
-  ExecutionSubgraph esg(graph_, GetScopedAllocator());
-  esg.Finalize();
-  ASSERT_TRUE(esg.IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  std::unordered_set<const HBasicBlock*> contents(esg.ReachableBlocks().begin(),
-                                                  esg.ReachableBlocks().end());
-
-  for (const auto& mid : mid_blocks) {
-    EXPECT_TRUE(contents.find(blks.Get(mid)) != contents.end()) << mid;
-  }
-  // + 2 for entry and exit nodes.
-  ASSERT_EQ(contents.size(), ExecutionSubgraph::kMaxFilterableSuccessors + 2);
-}
-
-// Test with max number of successors and some removals.
-TEST_F(ExecutionSubgraphTest, BigNodesMissing) {
-  std::vector<std::string> mid_blocks;
-  for (auto i : Range(ExecutionSubgraph::kMaxFilterableSuccessors)) {
-    std::ostringstream oss;
-    oss << "blk" << i;
-    mid_blocks.push_back(oss.str());
-  }
-  std::vector<AdjacencyListGraph::Edge> edges;
-  for (const auto& mid : mid_blocks) {
-    edges.emplace_back("entry", mid);
-    edges.emplace_back(mid, "exit");
-  }
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry", "exit", edges));
-  ASSERT_TRUE(ExecutionSubgraph::CanAnalyse(graph_));
-  ExecutionSubgraph esg(graph_, GetScopedAllocator());
-  esg.RemoveBlock(blks.Get("blk2"));
-  esg.RemoveBlock(blks.Get("blk4"));
-  esg.Finalize();
-  ASSERT_TRUE(esg.IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  std::unordered_set<const HBasicBlock*> contents(esg.ReachableBlocks().begin(),
-                                                  esg.ReachableBlocks().end());
-
-  ASSERT_EQ(contents.size(), ExecutionSubgraph::kMaxFilterableSuccessors + 2 - 2);
-
-  // Not present, no path through.
-  ASSERT_TRUE(contents.find(blks.Get("blk2")) == contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("blk4")) == contents.end());
-}
-
-// Test with max number of successors and all successors removed.
-TEST_F(ExecutionSubgraphTest, BigNodesNoPath) {
-  std::vector<std::string> mid_blocks;
-  for (auto i : Range(ExecutionSubgraph::kMaxFilterableSuccessors)) {
-    std::ostringstream oss;
-    oss << "blk" << i;
-    mid_blocks.push_back(oss.str());
-  }
-  std::vector<AdjacencyListGraph::Edge> edges;
-  for (const auto& mid : mid_blocks) {
-    edges.emplace_back("entry", mid);
-    edges.emplace_back(mid, "exit");
-  }
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry", "exit", edges));
-  ASSERT_TRUE(ExecutionSubgraph::CanAnalyse(graph_));
-  ExecutionSubgraph esg(graph_, GetScopedAllocator());
-  for (const auto& mid : mid_blocks) {
-    esg.RemoveBlock(blks.Get(mid));
-  }
-  esg.Finalize();
-  ASSERT_FALSE(esg.IsValid());
-  ASSERT_FALSE(IsValidSubgraph(esg));
-}
-
-// Test with max number of successors
-TEST_F(ExecutionSubgraphTest, CanAnalyseBig) {
-  // Make an absurdly huge and well connected graph. This should be pretty worst-case scenario.
-  constexpr size_t kNumBlocks = ExecutionSubgraph::kMaxFilterableSuccessors + 1000;
-  std::vector<std::string> mid_blocks;
-  for (auto i : Range(kNumBlocks)) {
-    std::ostringstream oss;
-    oss << "blk" << i;
-    mid_blocks.push_back(oss.str());
-  }
-  std::vector<AdjacencyListGraph::Edge> edges;
-  for (auto cur : Range(kNumBlocks)) {
-    for (auto nxt :
-         Range(cur + 1,
-               std::min(cur + ExecutionSubgraph::kMaxFilterableSuccessors + 1, kNumBlocks))) {
-      edges.emplace_back(mid_blocks[cur], mid_blocks[nxt]);
-    }
-  }
-  AdjacencyListGraph blks(SetupFromAdjacencyList(mid_blocks.front(), mid_blocks.back(), edges));
-  ASSERT_TRUE(ExecutionSubgraph::CanAnalyse(graph_));
-
-  ExecutionSubgraph esg(graph_, GetScopedAllocator());
-  esg.Finalize();
-  ASSERT_TRUE(esg.IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  std::unordered_set<const HBasicBlock*> contents(esg.ReachableBlocks().begin(),
-                                                  esg.ReachableBlocks().end());
-
-  ASSERT_EQ(contents.size(), kNumBlocks);
-}
-
-// Test with many successors
-TEST_F(ExecutionSubgraphTest, CanAnalyseBig2) {
-  // Make an absurdly huge and well connected graph. This should be pretty worst-case scenario.
-  constexpr size_t kNumBlocks = ExecutionSubgraph::kMaxFilterableSuccessors + 1000;
-  constexpr size_t kTestMaxSuccessors = ExecutionSubgraph::kMaxFilterableSuccessors - 1;
-  std::vector<std::string> mid_blocks;
-  for (auto i : Range(kNumBlocks)) {
-    std::ostringstream oss;
-    oss << "blk" << i;
-    mid_blocks.push_back(oss.str());
-  }
-  std::vector<AdjacencyListGraph::Edge> edges;
-  for (auto cur : Range(kNumBlocks)) {
-    for (auto nxt : Range(cur + 1, std::min(cur + 1 + kTestMaxSuccessors, kNumBlocks))) {
-      edges.emplace_back(mid_blocks[cur], mid_blocks[nxt]);
-    }
-  }
-  edges.emplace_back(mid_blocks.front(), mid_blocks.back());
-  AdjacencyListGraph blks(SetupFromAdjacencyList(mid_blocks.front(), mid_blocks.back(), edges));
-  ASSERT_TRUE(ExecutionSubgraph::CanAnalyse(graph_));
-  ExecutionSubgraph esg(graph_, GetScopedAllocator());
-  constexpr size_t kToRemoveIdx = kNumBlocks / 2;
-  HBasicBlock* remove_implicit = blks.Get(mid_blocks[kToRemoveIdx]);
-  for (HBasicBlock* pred : remove_implicit->GetPredecessors()) {
-    esg.RemoveBlock(pred);
-  }
-  esg.Finalize();
-  EXPECT_TRUE(esg.IsValid());
-  EXPECT_TRUE(IsValidSubgraph(esg));
-  std::unordered_set<const HBasicBlock*> contents(esg.ReachableBlocks().begin(),
-                                                  esg.ReachableBlocks().end());
-
-  // Only entry and exit. The middle ones should eliminate everything else.
-  EXPECT_EQ(contents.size(), 2u);
-  EXPECT_TRUE(contents.find(remove_implicit) == contents.end());
-  EXPECT_TRUE(contents.find(blks.Get(mid_blocks.front())) != contents.end());
-  EXPECT_TRUE(contents.find(blks.Get(mid_blocks.back())) != contents.end());
-}
-
-// Test with too many successors
-TEST_F(ExecutionSubgraphTest, CanNotAnalyseBig) {
-  std::vector<std::string> mid_blocks;
-  for (auto i : Range(ExecutionSubgraph::kMaxFilterableSuccessors + 4)) {
-    std::ostringstream oss;
-    oss << "blk" << i;
-    mid_blocks.push_back(oss.str());
-  }
-  std::vector<AdjacencyListGraph::Edge> edges;
-  for (const auto& mid : mid_blocks) {
-    edges.emplace_back("entry", mid);
-    edges.emplace_back(mid, "exit");
-  }
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry", "exit", edges));
-  ASSERT_FALSE(ExecutionSubgraph::CanAnalyse(graph_));
-}
-}  // namespace art
diff --git a/compiler/optimizing/execution_subgraph_test.h b/compiler/optimizing/execution_subgraph_test.h
deleted file mode 100644
index cee105a..0000000
--- a/compiler/optimizing/execution_subgraph_test.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ART_COMPILER_OPTIMIZING_EXECUTION_SUBGRAPH_TEST_H_
-#define ART_COMPILER_OPTIMIZING_EXECUTION_SUBGRAPH_TEST_H_
-
-#include "android-base/macros.h"
-
-#include "base/macros.h"
-
-namespace art HIDDEN {
-
-class HGraph;
-class ExecutionSubgraph;
-
-class ExecutionSubgraphTestHelper {
- public:
-  static bool CalculateValidity(HGraph* graph, const ExecutionSubgraph* subgraph);
-
- private:
-  ExecutionSubgraphTestHelper() = delete;
-
-  DISALLOW_COPY_AND_ASSIGN(ExecutionSubgraphTestHelper);
-};
-}  // namespace art
-
-#endif  // ART_COMPILER_OPTIMIZING_EXECUTION_SUBGRAPH_TEST_H_
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc
index 190b362..b061b40 100644
--- a/compiler/optimizing/graph_checker.cc
+++ b/compiler/optimizing/graph_checker.cc
@@ -27,8 +27,11 @@
 #include "base/scoped_arena_containers.h"
 #include "code_generator.h"
 #include "handle.h"
+#include "intrinsics.h"
 #include "mirror/class.h"
+#include "nodes.h"
 #include "obj_ptr-inl.h"
+#include "optimizing/data_type.h"
 #include "scoped_thread_state_change-inl.h"
 #include "subtype_check.h"
 
@@ -168,52 +171,68 @@
 void GraphChecker::VisitBasicBlock(HBasicBlock* block) {
   current_block_ = block;
 
-  // Use local allocator for allocating memory.
-  ScopedArenaAllocator allocator(GetGraph()->GetArenaStack());
+  {
+    // Use local allocator for allocating memory. We use C++ scopes (i.e. `{}`) to reclaim the
+    // memory as soon as possible, and to end the scope of this `ScopedArenaAllocator`.
+    ScopedArenaAllocator allocator(GetGraph()->GetArenaStack());
 
-  // Check consistency with respect to predecessors of `block`.
-  // Note: Counting duplicates with a sorted vector uses up to 6x less memory
-  // than ArenaSafeMap<HBasicBlock*, size_t> and also allows storage reuse.
-  ScopedArenaVector<HBasicBlock*> sorted_predecessors(allocator.Adapter(kArenaAllocGraphChecker));
-  sorted_predecessors.assign(block->GetPredecessors().begin(), block->GetPredecessors().end());
-  std::sort(sorted_predecessors.begin(), sorted_predecessors.end());
-  for (auto it = sorted_predecessors.begin(), end = sorted_predecessors.end(); it != end; ) {
-    HBasicBlock* p = *it++;
-    size_t p_count_in_block_predecessors = 1u;
-    for (; it != end && *it == p; ++it) {
-      ++p_count_in_block_predecessors;
+    {
+      // Check consistency with respect to predecessors of `block`.
+      // Note: Counting duplicates with a sorted vector uses up to 6x less memory
+      // than ArenaSafeMap<HBasicBlock*, size_t> and also allows storage reuse.
+      ScopedArenaVector<HBasicBlock*> sorted_predecessors(
+          allocator.Adapter(kArenaAllocGraphChecker));
+      sorted_predecessors.assign(block->GetPredecessors().begin(), block->GetPredecessors().end());
+      std::sort(sorted_predecessors.begin(), sorted_predecessors.end());
+      for (auto it = sorted_predecessors.begin(), end = sorted_predecessors.end(); it != end;) {
+        HBasicBlock* p = *it++;
+        size_t p_count_in_block_predecessors = 1u;
+        for (; it != end && *it == p; ++it) {
+          ++p_count_in_block_predecessors;
+        }
+        size_t block_count_in_p_successors =
+            std::count(p->GetSuccessors().begin(), p->GetSuccessors().end(), block);
+        if (p_count_in_block_predecessors != block_count_in_p_successors) {
+          AddError(StringPrintf(
+              "Block %d lists %zu occurrences of block %d in its predecessors, whereas "
+              "block %d lists %zu occurrences of block %d in its successors.",
+              block->GetBlockId(),
+              p_count_in_block_predecessors,
+              p->GetBlockId(),
+              p->GetBlockId(),
+              block_count_in_p_successors,
+              block->GetBlockId()));
+        }
+      }
     }
-    size_t block_count_in_p_successors =
-        std::count(p->GetSuccessors().begin(), p->GetSuccessors().end(), block);
-    if (p_count_in_block_predecessors != block_count_in_p_successors) {
-      AddError(StringPrintf(
-          "Block %d lists %zu occurrences of block %d in its predecessors, whereas "
-          "block %d lists %zu occurrences of block %d in its successors.",
-          block->GetBlockId(), p_count_in_block_predecessors, p->GetBlockId(),
-          p->GetBlockId(), block_count_in_p_successors, block->GetBlockId()));
-    }
-  }
 
-  // Check consistency with respect to successors of `block`.
-  // Note: Counting duplicates with a sorted vector uses up to 6x less memory
-  // than ArenaSafeMap<HBasicBlock*, size_t> and also allows storage reuse.
-  ScopedArenaVector<HBasicBlock*> sorted_successors(allocator.Adapter(kArenaAllocGraphChecker));
-  sorted_successors.assign(block->GetSuccessors().begin(), block->GetSuccessors().end());
-  std::sort(sorted_successors.begin(), sorted_successors.end());
-  for (auto it = sorted_successors.begin(), end = sorted_successors.end(); it != end; ) {
-    HBasicBlock* s = *it++;
-    size_t s_count_in_block_successors = 1u;
-    for (; it != end && *it == s; ++it) {
-      ++s_count_in_block_successors;
-    }
-    size_t block_count_in_s_predecessors =
-        std::count(s->GetPredecessors().begin(), s->GetPredecessors().end(), block);
-    if (s_count_in_block_successors != block_count_in_s_predecessors) {
-      AddError(StringPrintf(
-          "Block %d lists %zu occurrences of block %d in its successors, whereas "
-          "block %d lists %zu occurrences of block %d in its predecessors.",
-          block->GetBlockId(), s_count_in_block_successors, s->GetBlockId(),
-          s->GetBlockId(), block_count_in_s_predecessors, block->GetBlockId()));
+    {
+      // Check consistency with respect to successors of `block`.
+      // Note: Counting duplicates with a sorted vector uses up to 6x less memory
+      // than ArenaSafeMap<HBasicBlock*, size_t> and also allows storage reuse.
+      ScopedArenaVector<HBasicBlock*> sorted_successors(allocator.Adapter(kArenaAllocGraphChecker));
+      sorted_successors.assign(block->GetSuccessors().begin(), block->GetSuccessors().end());
+      std::sort(sorted_successors.begin(), sorted_successors.end());
+      for (auto it = sorted_successors.begin(), end = sorted_successors.end(); it != end;) {
+        HBasicBlock* s = *it++;
+        size_t s_count_in_block_successors = 1u;
+        for (; it != end && *it == s; ++it) {
+          ++s_count_in_block_successors;
+        }
+        size_t block_count_in_s_predecessors =
+            std::count(s->GetPredecessors().begin(), s->GetPredecessors().end(), block);
+        if (s_count_in_block_successors != block_count_in_s_predecessors) {
+          AddError(
+              StringPrintf("Block %d lists %zu occurrences of block %d in its successors, whereas "
+                           "block %d lists %zu occurrences of block %d in its predecessors.",
+                           block->GetBlockId(),
+                           s_count_in_block_successors,
+                           s->GetBlockId(),
+                           s->GetBlockId(),
+                           block_count_in_s_predecessors,
+                           block->GetBlockId()));
+        }
+      }
     }
   }
 
@@ -285,10 +304,11 @@
                             current_block_->GetBlockId()));
     }
     if (current->GetNext() == nullptr && current != block->GetLastInstruction()) {
-      AddError(StringPrintf("The recorded last instruction of block %d does not match "
-                            "the actual last instruction %d.",
-                            current_block_->GetBlockId(),
-                            current->GetId()));
+      AddError(
+          StringPrintf("The recorded last instruction of block %d does not match "
+                       "the actual last instruction %d.",
+                       current_block_->GetBlockId(),
+                       current->GetId()));
     }
     current->Accept(this);
   }
@@ -506,6 +526,26 @@
   flag_info_.seen_monitor_operation = true;
 }
 
+bool GraphChecker::ContainedInItsBlockList(HInstruction* instruction) {
+  HBasicBlock* block = instruction->GetBlock();
+  ScopedArenaSafeMap<HBasicBlock*, ScopedArenaHashSet<HInstruction*>>& instruction_set =
+      instruction->IsPhi() ? phis_per_block_ : instructions_per_block_;
+  auto map_it = instruction_set.find(block);
+  if (map_it == instruction_set.end()) {
+    // Populate extra bookkeeping.
+    map_it = instruction_set.insert(
+        {block, ScopedArenaHashSet<HInstruction*>(allocator_.Adapter(kArenaAllocGraphChecker))})
+        .first;
+    const HInstructionList& instruction_list = instruction->IsPhi() ?
+                                                   instruction->GetBlock()->GetPhis() :
+                                                   instruction->GetBlock()->GetInstructions();
+    for (HInstructionIterator list_it(instruction_list); !list_it.Done(); list_it.Advance()) {
+        map_it->second.insert(list_it.Current());
+    }
+  }
+  return map_it->second.find(instruction) != map_it->second.end();
+}
+
 void GraphChecker::VisitInstruction(HInstruction* instruction) {
   if (seen_ids_.IsBitSet(instruction->GetId())) {
     AddError(StringPrintf("Instruction id %d is duplicate in graph.",
@@ -528,23 +568,19 @@
                           instruction->GetBlock()->GetBlockId()));
   }
 
-  // Ensure the inputs of `instruction` are defined in a block of the graph.
+  // Ensure the inputs of `instruction` are defined in a block of the graph, and the entry in the
+  // use list is consistent.
   for (HInstruction* input : instruction->GetInputs()) {
     if (input->GetBlock() == nullptr) {
       AddError(StringPrintf("Input %d of instruction %d is not in any "
                             "basic block of the control-flow graph.",
                             input->GetId(),
                             instruction->GetId()));
-    } else {
-      const HInstructionList& list = input->IsPhi()
-          ? input->GetBlock()->GetPhis()
-          : input->GetBlock()->GetInstructions();
-      if (!list.Contains(input)) {
+    } else if (!ContainedInItsBlockList(input)) {
         AddError(StringPrintf("Input %d of instruction %d is not defined "
                               "in a basic block of the control-flow graph.",
                               input->GetId(),
                               instruction->GetId()));
-      }
     }
   }
 
@@ -552,10 +588,7 @@
   // and the entry in the use list is consistent.
   for (const HUseListNode<HInstruction*>& use : instruction->GetUses()) {
     HInstruction* user = use.GetUser();
-    const HInstructionList& list = user->IsPhi()
-        ? user->GetBlock()->GetPhis()
-        : user->GetBlock()->GetInstructions();
-    if (!list.Contains(user)) {
+    if (!ContainedInItsBlockList(user)) {
       AddError(StringPrintf("User %s:%d of instruction %d is not defined "
                             "in a basic block of the control-flow graph.",
                             user->DebugName(),
@@ -587,36 +620,56 @@
   }
 
   // Ensure 'instruction' has pointers to its inputs' use entries.
-  auto&& input_records = instruction->GetInputRecords();
-  for (size_t i = 0; i < input_records.size(); ++i) {
-    const HUserRecord<HInstruction*>& input_record = input_records[i];
-    HInstruction* input = input_record.GetInstruction();
-    if ((input_record.GetBeforeUseNode() == input->GetUses().end()) ||
-        (input_record.GetUseNode() == input->GetUses().end()) ||
-        !input->GetUses().ContainsNode(*input_record.GetUseNode()) ||
-        (input_record.GetUseNode()->GetIndex() != i)) {
-      AddError(StringPrintf("Instruction %s:%d has an invalid iterator before use entry "
-                            "at input %u (%s:%d).",
-                            instruction->DebugName(),
-                            instruction->GetId(),
-                            static_cast<unsigned>(i),
-                            input->DebugName(),
-                            input->GetId()));
+  {
+    auto&& input_records = instruction->GetInputRecords();
+    for (size_t i = 0; i < input_records.size(); ++i) {
+      const HUserRecord<HInstruction*>& input_record = input_records[i];
+      HInstruction* input = input_record.GetInstruction();
+
+      // Populate bookkeeping, if needed. See comment in graph_checker.h for uses_per_instruction_.
+      auto it = uses_per_instruction_.find(input->GetId());
+      if (it == uses_per_instruction_.end()) {
+        it = uses_per_instruction_
+                 .insert({input->GetId(),
+                          ScopedArenaSet<const art::HUseListNode<art::HInstruction*>*>(
+                              allocator_.Adapter(kArenaAllocGraphChecker))})
+                 .first;
+        for (auto&& use : input->GetUses()) {
+          it->second.insert(std::addressof(use));
+        }
+      }
+
+      if ((input_record.GetBeforeUseNode() == input->GetUses().end()) ||
+          (input_record.GetUseNode() == input->GetUses().end()) ||
+          (it->second.find(std::addressof(*input_record.GetUseNode())) == it->second.end()) ||
+          (input_record.GetUseNode()->GetIndex() != i)) {
+        AddError(
+            StringPrintf("Instruction %s:%d has an invalid iterator before use entry "
+                         "at input %u (%s:%d).",
+                         instruction->DebugName(),
+                         instruction->GetId(),
+                         static_cast<unsigned>(i),
+                         input->DebugName(),
+                         input->GetId()));
+      }
     }
   }
 
   // Ensure an instruction dominates all its uses.
   for (const HUseListNode<HInstruction*>& use : instruction->GetUses()) {
     HInstruction* user = use.GetUser();
-    if (!user->IsPhi() && !instruction->StrictlyDominates(user)) {
-      AddError(StringPrintf("Instruction %s:%d in block %d does not dominate "
-                            "use %s:%d in block %d.",
-                            instruction->DebugName(),
-                            instruction->GetId(),
-                            current_block_->GetBlockId(),
-                            user->DebugName(),
-                            user->GetId(),
-                            user->GetBlock()->GetBlockId()));
+    if (!user->IsPhi() && (instruction->GetBlock() == user->GetBlock()
+                               ? seen_ids_.IsBitSet(user->GetId())
+                               : !instruction->GetBlock()->Dominates(user->GetBlock()))) {
+      AddError(
+          StringPrintf("Instruction %s:%d in block %d does not dominate "
+                       "use %s:%d in block %d.",
+                       instruction->DebugName(),
+                       instruction->GetId(),
+                       current_block_->GetBlockId(),
+                       user->DebugName(),
+                       user->GetId(),
+                       user->GetBlock()->GetBlockId()));
     }
   }
 
@@ -628,22 +681,24 @@
                           current_block_->GetBlockId()));
   }
 
-  // Ensure an instruction having an environment is dominated by the
-  // instructions contained in the environment.
-  for (HEnvironment* environment = instruction->GetEnvironment();
-       environment != nullptr;
-       environment = environment->GetParent()) {
-    for (size_t i = 0, e = environment->Size(); i < e; ++i) {
-      HInstruction* env_instruction = environment->GetInstructionAt(i);
-      if (env_instruction != nullptr
-          && !env_instruction->StrictlyDominates(instruction)) {
-        AddError(StringPrintf("Instruction %d in environment of instruction %d "
-                              "from block %d does not dominate instruction %d.",
-                              env_instruction->GetId(),
-                              instruction->GetId(),
-                              current_block_->GetBlockId(),
-                              instruction->GetId()));
-      }
+  // Ensure an instruction dominates all its environment uses.
+  for (const HUseListNode<HEnvironment*>& use : instruction->GetEnvUses()) {
+    HInstruction* user = use.GetUser()->GetHolder();
+    if (user->IsPhi()) {
+      AddError(StringPrintf("Phi %d shouldn't have an environment", instruction->GetId()));
+    }
+    if (instruction->GetBlock() == user->GetBlock()
+            ? seen_ids_.IsBitSet(user->GetId())
+            : !instruction->GetBlock()->Dominates(user->GetBlock())) {
+      AddError(
+          StringPrintf("Instruction %s:%d in block %d does not dominate "
+                       "environment use %s:%d in block %d.",
+                       instruction->DebugName(),
+                       instruction->GetId(),
+                       current_block_->GetBlockId(),
+                       user->DebugName(),
+                       user->GetId(),
+                       user->GetBlock()->GetBlockId()));
     }
   }
 
@@ -660,14 +715,15 @@
       for (HInstructionIterator phi_it(catch_block->GetPhis()); !phi_it.Done(); phi_it.Advance()) {
         HPhi* catch_phi = phi_it.Current()->AsPhi();
         if (environment->GetInstructionAt(catch_phi->GetRegNumber()) == nullptr) {
-          AddError(StringPrintf("Instruction %s:%d throws into catch block %d "
-                                "with catch phi %d for vreg %d but its "
-                                "corresponding environment slot is empty.",
-                                instruction->DebugName(),
-                                instruction->GetId(),
-                                catch_block->GetBlockId(),
-                                catch_phi->GetId(),
-                                catch_phi->GetRegNumber()));
+          AddError(
+              StringPrintf("Instruction %s:%d throws into catch block %d "
+                           "with catch phi %d for vreg %d but its "
+                           "corresponding environment slot is empty.",
+                           instruction->DebugName(),
+                           instruction->GetId(),
+                           catch_block->GetBlockId(),
+                           catch_phi->GetId(),
+                           catch_phi->GetRegNumber()));
         }
       }
     }
@@ -688,10 +744,23 @@
     }
     flag_info_.seen_always_throwing_invokes = true;
   }
+
+  // Check for intrinsics which should have been replaced by intermediate representation in the
+  // instruction builder.
+  if (!IsValidIntrinsicAfterBuilder(invoke->GetIntrinsic())) {
+    AddError(
+        StringPrintf("The graph contains the instrinsic %d which should have been replaced in the "
+                     "instruction builder: %s:%d in block %d.",
+                     enum_cast<int>(invoke->GetIntrinsic()),
+                     invoke->DebugName(),
+                     invoke->GetId(),
+                     invoke->GetBlock()->GetBlockId()));
+  }
 }
 
 void GraphChecker::VisitInvokeStaticOrDirect(HInvokeStaticOrDirect* invoke) {
-  // We call VisitInvoke and not VisitInstruction to de-duplicate the always throwing code check.
+  // We call VisitInvoke and not VisitInstruction to de-duplicate the common code: always throwing
+  // and instrinsic checks.
   VisitInvoke(invoke);
 
   if (invoke->IsStaticWithExplicitClinitCheck()) {
@@ -944,8 +1013,7 @@
 static bool IsConstantEquivalent(const HInstruction* insn1,
                                  const HInstruction* insn2,
                                  BitVector* visited) {
-  if (insn1->IsPhi() &&
-      insn1->AsPhi()->IsVRegEquivalentOf(insn2)) {
+  if (insn1->IsPhi() && insn1->AsPhi()->IsVRegEquivalentOf(insn2)) {
     HConstInputsRef insn1_inputs = insn1->GetInputs();
     HConstInputsRef insn2_inputs = insn2->GetInputs();
     if (insn1_inputs.size() != insn2_inputs.size()) {
@@ -1213,6 +1281,26 @@
   }
 }
 
+HInstruction* HuntForOriginalReference(HInstruction* ref) {
+  // An original reference can be transformed by instructions like:
+  //   i0 NewArray
+  //   i1 HInstruction(i0)  <-- NullCheck, BoundType, IntermediateAddress.
+  //   i2 ArraySet(i1, index, value)
+  DCHECK(ref != nullptr);
+  while (ref->IsNullCheck() || ref->IsBoundType() || ref->IsIntermediateAddress()) {
+    ref = ref->InputAt(0);
+  }
+  return ref;
+}
+
+bool IsRemovedWriteBarrier(DataType::Type type,
+                           WriteBarrierKind write_barrier_kind,
+                           HInstruction* value) {
+  return write_barrier_kind == WriteBarrierKind::kDontEmit &&
+         type == DataType::Type::kReference &&
+         !HuntForOriginalReference(value)->IsNullConstant();
+}
+
 void GraphChecker::VisitArraySet(HArraySet* instruction) {
   VisitInstruction(instruction);
 
@@ -1226,6 +1314,80 @@
                      StrBool(instruction->NeedsTypeCheck()),
                      StrBool(instruction->GetSideEffects().Includes(SideEffects::CanTriggerGC()))));
   }
+
+  if (IsRemovedWriteBarrier(instruction->GetComponentType(),
+                            instruction->GetWriteBarrierKind(),
+                            instruction->GetValue())) {
+    CheckWriteBarrier(instruction, [](HInstruction* it_instr) {
+      return it_instr->AsArraySet()->GetWriteBarrierKind();
+    });
+  }
+}
+
+void GraphChecker::VisitInstanceFieldSet(HInstanceFieldSet* instruction) {
+  VisitInstruction(instruction);
+  if (IsRemovedWriteBarrier(instruction->GetFieldType(),
+                            instruction->GetWriteBarrierKind(),
+                            instruction->GetValue())) {
+    CheckWriteBarrier(instruction, [](HInstruction* it_instr) {
+      return it_instr->AsInstanceFieldSet()->GetWriteBarrierKind();
+    });
+  }
+}
+
+void GraphChecker::VisitStaticFieldSet(HStaticFieldSet* instruction) {
+  VisitInstruction(instruction);
+  if (IsRemovedWriteBarrier(instruction->GetFieldType(),
+                            instruction->GetWriteBarrierKind(),
+                            instruction->GetValue())) {
+    CheckWriteBarrier(instruction, [](HInstruction* it_instr) {
+      return it_instr->AsStaticFieldSet()->GetWriteBarrierKind();
+    });
+  }
+}
+
+template <typename GetWriteBarrierKind>
+void GraphChecker::CheckWriteBarrier(HInstruction* instruction,
+                                     GetWriteBarrierKind&& get_write_barrier_kind) {
+  DCHECK(instruction->IsStaticFieldSet() ||
+         instruction->IsInstanceFieldSet() ||
+         instruction->IsArraySet());
+
+  // For removed write barriers, we expect that the write barrier they are relying on is:
+  // A) In the same block, and
+  // B) There's no instruction between them that can trigger a GC.
+  HInstruction* object = HuntForOriginalReference(instruction->InputAt(0));
+  bool found = false;
+  for (HBackwardInstructionIterator it(instruction); !it.Done(); it.Advance()) {
+    if (instruction->GetKind() == it.Current()->GetKind() &&
+        object == HuntForOriginalReference(it.Current()->InputAt(0)) &&
+        get_write_barrier_kind(it.Current()) == WriteBarrierKind::kEmitBeingReliedOn) {
+      // Found the write barrier we are relying on.
+      found = true;
+      break;
+    }
+
+    // We check the `SideEffects::CanTriggerGC` after failing to find the write barrier since having
+    // a write barrier that's relying on an ArraySet that can trigger GC is fine because the card
+    // table is marked after the GC happens.
+    if (it.Current()->GetSideEffects().Includes(SideEffects::CanTriggerGC())) {
+      AddError(
+          StringPrintf("%s %d from block %d was expecting a write barrier and it didn't find "
+                       "any. %s %d can trigger GC",
+                       instruction->DebugName(),
+                       instruction->GetId(),
+                       instruction->GetBlock()->GetBlockId(),
+                       it.Current()->DebugName(),
+                       it.Current()->GetId()));
+    }
+  }
+
+  if (!found) {
+    AddError(StringPrintf("%s %d in block %d didn't find a write barrier to latch onto",
+                          instruction->DebugName(),
+                          instruction->GetId(),
+                          instruction->GetBlock()->GetBlockId()));
+  }
 }
 
 void GraphChecker::VisitBinaryOperation(HBinaryOperation* op) {
diff --git a/compiler/optimizing/graph_checker.h b/compiler/optimizing/graph_checker.h
index d6644f3..541a9cc 100644
--- a/compiler/optimizing/graph_checker.h
+++ b/compiler/optimizing/graph_checker.h
@@ -22,7 +22,7 @@
 #include "base/arena_bit_vector.h"
 #include "base/bit_vector-inl.h"
 #include "base/macros.h"
-#include "base/scoped_arena_allocator.h"
+#include "base/scoped_arena_containers.h"
 #include "nodes.h"
 
 namespace art HIDDEN {
@@ -30,17 +30,20 @@
 class CodeGenerator;
 
 // A control-flow graph visitor performing various checks.
-class GraphChecker : public HGraphDelegateVisitor {
+class GraphChecker final : public HGraphDelegateVisitor {
  public:
   explicit GraphChecker(HGraph* graph,
                         CodeGenerator* codegen = nullptr,
                         const char* dump_prefix = "art::GraphChecker: ")
-    : HGraphDelegateVisitor(graph),
-      errors_(graph->GetAllocator()->Adapter(kArenaAllocGraphChecker)),
-      dump_prefix_(dump_prefix),
-      allocator_(graph->GetArenaStack()),
-      seen_ids_(&allocator_, graph->GetCurrentInstructionId(), false, kArenaAllocGraphChecker),
-      codegen_(codegen) {
+      : HGraphDelegateVisitor(graph),
+        errors_(graph->GetAllocator()->Adapter(kArenaAllocGraphChecker)),
+        dump_prefix_(dump_prefix),
+        allocator_(graph->GetArenaStack()),
+        seen_ids_(&allocator_, graph->GetCurrentInstructionId(), false, kArenaAllocGraphChecker),
+        uses_per_instruction_(allocator_.Adapter(kArenaAllocGraphChecker)),
+        instructions_per_block_(allocator_.Adapter(kArenaAllocGraphChecker)),
+        phis_per_block_(allocator_.Adapter(kArenaAllocGraphChecker)),
+        codegen_(codegen) {
     seen_ids_.ClearAllBits();
   }
 
@@ -56,6 +59,8 @@
   void VisitPhi(HPhi* phi) override;
 
   void VisitArraySet(HArraySet* instruction) override;
+  void VisitInstanceFieldSet(HInstanceFieldSet* instruction) override;
+  void VisitStaticFieldSet(HStaticFieldSet* instruction) override;
   void VisitBinaryOperation(HBinaryOperation* op) override;
   void VisitBooleanNot(HBooleanNot* instruction) override;
   void VisitBoundType(HBoundType* instruction) override;
@@ -90,6 +95,9 @@
   void HandleLoop(HBasicBlock* loop_header);
   void HandleBooleanInput(HInstruction* instruction, size_t input_index);
 
+  template <typename GetWriteBarrierKind>
+  void CheckWriteBarrier(HInstruction* instruction, GetWriteBarrierKind&& get_write_barrier_kind);
+
   // Was the last visit of the graph valid?
   bool IsValid() const {
     return errors_.empty();
@@ -107,7 +115,7 @@
     }
   }
 
- protected:
+ private:
   // Report a new error.
   void AddError(const std::string& error) {
     errors_.push_back(error);
@@ -118,17 +126,33 @@
   // Errors encountered while checking the graph.
   ArenaVector<std::string> errors_;
 
- private:
   void VisitReversePostOrder();
 
   // Checks that the graph's flags are set correctly.
   void CheckGraphFlags();
 
+  // Checks if `instruction` is in its block's instruction/phi list. To do so, it searches
+  // instructions_per_block_/phis_per_block_ which are set versions of that. If the set to
+  // check hasn't been populated yet, it does so now.
+  bool ContainedInItsBlockList(HInstruction* instruction);
+
   // String displayed before dumped errors.
   const char* const dump_prefix_;
   ScopedArenaAllocator allocator_;
   ArenaBitVector seen_ids_;
 
+  // As part of VisitInstruction, we verify that the instruction's input_record is present in the
+  // corresponding input's GetUses. If an instruction is used in many places (e.g. 200K+ uses), the
+  // linear search through GetUses is too slow. We can use bookkeeping to search in a set, instead
+  // of a list.
+  ScopedArenaSafeMap<int, ScopedArenaSet<const art::HUseListNode<art::HInstruction*>*>>
+      uses_per_instruction_;
+
+  // Extra bookkeeping to increase GraphChecker's speed while asking if an instruction is contained
+  // in a list of instructions/phis.
+  ScopedArenaSafeMap<HBasicBlock*, ScopedArenaHashSet<HInstruction*>> instructions_per_block_;
+  ScopedArenaSafeMap<HBasicBlock*, ScopedArenaHashSet<HInstruction*>> phis_per_block_;
+
   // Used to access target information.
   CodeGenerator* codegen_;
 
diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc
index 73bdd1e..6696c1e 100644
--- a/compiler/optimizing/graph_visualizer.cc
+++ b/compiler/optimizing/graph_visualizer.cc
@@ -115,7 +115,9 @@
   }
 }
 
-#ifndef ART_STATIC_LIBART_COMPILER
+// On target: load `libart-disassembler` only when required (to save on memory).
+// On host: `libart-disassembler` should be linked directly (either as a static or dynamic lib)
+#ifdef ART_TARGET
 using create_disasm_prototype = Disassembler*(InstructionSet, DisassemblerOptions*);
 #endif
 
@@ -125,7 +127,7 @@
                                const uint8_t* base_address,
                                const uint8_t* end_address)
       : instruction_set_(instruction_set), disassembler_(nullptr) {
-#ifndef ART_STATIC_LIBART_COMPILER
+#ifdef ART_TARGET
     constexpr const char* libart_disassembler_so_name =
         kIsDebugBuild ? "libartd-disassembler.so" : "libart-disassembler.so";
     libart_disassembler_handle_ = dlopen(libart_disassembler_so_name, RTLD_NOW);
@@ -159,7 +161,7 @@
   ~HGraphVisualizerDisassembler() {
     // We need to call ~Disassembler() before we close the library.
     disassembler_.reset();
-#ifndef ART_STATIC_LIBART_COMPILER
+#ifdef ART_TARGET
     if (libart_disassembler_handle_ != nullptr) {
       dlclose(libart_disassembler_handle_);
     }
@@ -184,7 +186,7 @@
   InstructionSet instruction_set_;
   std::unique_ptr<Disassembler> disassembler_;
 
-#ifndef ART_STATIC_LIBART_COMPILER
+#ifdef ART_TARGET
   void* libart_disassembler_handle_;
 #endif
 };
@@ -193,7 +195,7 @@
 /**
  * HGraph visitor to generate a file suitable for the c1visualizer tool and IRHydra.
  */
-class HGraphVisualizerPrinter : public HGraphDelegateVisitor {
+class HGraphVisualizerPrinter final : public HGraphDelegateVisitor {
  public:
   HGraphVisualizerPrinter(HGraph* graph,
                           std::ostream& output,
@@ -494,6 +496,11 @@
     StartAttributeStream("bias") << condition->GetBias();
   }
 
+  void VisitIf(HIf* if_instr) override {
+    StartAttributeStream("true_count") << if_instr->GetTrueCount();
+    StartAttributeStream("false_count") << if_instr->GetFalseCount();
+  }
+
   void VisitInvoke(HInvoke* invoke) override {
     StartAttributeStream("dex_file_index") << invoke->GetMethodReference().index;
     ArtMethod* method = invoke->GetResolvedMethod();
@@ -538,13 +545,6 @@
     StartAttributeStream("invoke_type") << "InvokePolymorphic";
   }
 
-  void VisitPredicatedInstanceFieldGet(HPredicatedInstanceFieldGet* iget) override {
-    StartAttributeStream("field_name") <<
-        iget->GetFieldInfo().GetDexFile().PrettyField(iget->GetFieldInfo().GetFieldIndex(),
-                                                      /* with type */ false);
-    StartAttributeStream("field_type") << iget->GetFieldType();
-  }
-
   void VisitInstanceFieldGet(HInstanceFieldGet* iget) override {
     StartAttributeStream("field_name") <<
         iget->GetFieldInfo().GetDexFile().PrettyField(iget->GetFieldInfo().GetFieldIndex(),
@@ -557,8 +557,6 @@
         iset->GetFieldInfo().GetDexFile().PrettyField(iset->GetFieldInfo().GetFieldIndex(),
                                                       /* with type */ false);
     StartAttributeStream("field_type") << iset->GetFieldType();
-    StartAttributeStream("predicated")
-        << std::boolalpha << iset->GetIsPredicatedSet() << std::noboolalpha;
     StartAttributeStream("write_barrier_kind") << iset->GetWriteBarrierKind();
   }
 
@@ -610,6 +608,7 @@
   }
 
   void VisitVecMemoryOperation(HVecMemoryOperation* vec_mem_operation) override {
+    VisitVecOperation(vec_mem_operation);
     StartAttributeStream("alignment") << vec_mem_operation->GetAlignment().ToString();
   }
 
@@ -868,7 +867,8 @@
     std::ostringstream oss;
     oss << pass_name_;
     if (!IsDebugDump()) {
-      oss << " (" << (is_after_pass_ ? "after" : "before")
+      oss << " (" << (GetGraph()->IsCompilingBaseline() ? "baseline " : "")
+          << (is_after_pass_ ? "after" : "before")
           << (graph_in_bad_state_ ? ", bad_state" : "") << ")";
     }
     PrintProperty("name", oss.str().c_str());
diff --git a/compiler/optimizing/gvn.cc b/compiler/optimizing/gvn.cc
index a6ca057..9113860 100644
--- a/compiler/optimizing/gvn.cc
+++ b/compiler/optimizing/gvn.cc
@@ -248,7 +248,7 @@
   // Iterates over buckets with impure instructions (even indices) and deletes
   // the ones on which 'cond' returns true.
   template<typename Functor>
-  void DeleteAllImpureWhich(Functor cond) {
+  void DeleteAllImpureWhich(Functor&& cond) {
     for (size_t i = 0; i < num_buckets_; i += 2) {
       Node* node = buckets_[i];
       Node* previous = nullptr;
diff --git a/compiler/optimizing/induction_var_range.cc b/compiler/optimizing/induction_var_range.cc
index 9b78699..8568062 100644
--- a/compiler/optimizing/induction_var_range.cc
+++ b/compiler/optimizing/induction_var_range.cc
@@ -255,8 +255,8 @@
                                   nullptr,  // nothing generated yet
                                   &stride_value,
                                   needs_finite_test,
-                                  needs_taken_test)
-      && (stride_value == -1 ||
+                                  needs_taken_test) &&
+         (stride_value == -1 ||
           stride_value == 0 ||
           stride_value == 1);  // avoid arithmetic wrap-around anomalies.
 }
@@ -280,7 +280,10 @@
                                 nullptr,
                                 &stride_value,
                                 &b1,
-                                &b2)) {
+                                &b2) ||
+      (stride_value != -1 &&
+       stride_value != 0 &&
+       stride_value != 1)) {
     LOG(FATAL) << "Failed precondition: CanGenerateRange()";
   }
 }
@@ -303,7 +306,10 @@
                                 &taken_test,
                                 &stride_value,
                                 &b1,
-                                &b2)) {
+                                &b2) ||
+      (stride_value != -1 &&
+       stride_value != 0 &&
+       stride_value != 1)) {
     LOG(FATAL) << "Failed precondition: CanGenerateRange()";
   }
   return taken_test;
@@ -336,7 +342,8 @@
   HInstruction* last_value = nullptr;
   bool is_last_value = true;
   int64_t stride_value = 0;
-  bool b1, b2;  // unused
+  bool needs_finite_test = false;
+  bool needs_taken_test = false;
   if (!GenerateRangeOrLastValue(context,
                                 instruction,
                                 is_last_value,
@@ -346,8 +353,10 @@
                                 &last_value,
                                 nullptr,
                                 &stride_value,
-                                &b1,
-                                &b2)) {
+                                &needs_finite_test,
+                                &needs_taken_test) ||
+      needs_finite_test ||
+      needs_taken_test) {
     LOG(FATAL) << "Failed precondition: CanGenerateLastValue()";
   }
   return last_value;
@@ -1066,11 +1075,11 @@
         if (*stride_value > 0) {
           lower = nullptr;
           return GenerateLastValueLinear(
-              context, loop, info, trip, graph, block, /*is_min=*/false, upper);
+              context, loop, info, trip, graph, block, /*is_min=*/false, upper, needs_taken_test);
         } else {
           upper = nullptr;
           return GenerateLastValueLinear(
-              context, loop, info, trip, graph, block, /*is_min=*/true, lower);
+              context, loop, info, trip, graph, block, /*is_min=*/true, lower, needs_taken_test);
         }
       case HInductionVarAnalysis::kPolynomial:
         return GenerateLastValuePolynomial(context, loop, info, trip, graph, block, lower);
@@ -1124,7 +1133,8 @@
                                                 HGraph* graph,
                                                 HBasicBlock* block,
                                                 bool is_min,
-                                                /*out*/ HInstruction** result) const {
+                                                /*out*/ HInstruction** result,
+                                                /*inout*/ bool* needs_taken_test) const {
   DataType::Type type = info->type;
   // Avoid any narrowing linear induction or any type mismatch between the linear induction and the
   // trip count expression.
@@ -1132,18 +1142,27 @@
     return false;
   }
 
-  // Stride value must be a known constant that fits into int32.
+  // Stride value must be a known constant that fits into int32. The stride will be the `i` in `a *
+  // i + b`.
   int64_t stride_value = 0;
   if (!IsConstant(context, loop, info->op_a, kExact, &stride_value) ||
       !CanLongValueFitIntoInt(stride_value)) {
     return false;
   }
 
-  // We require `a` to be a constant value that didn't overflow.
+  // We require the calculation of `a` to not overflow.
   const bool is_min_a = stride_value >= 0 ? is_min : !is_min;
-  Value val_a = GetVal(context, loop, trip, trip, is_min_a);
+  HInstruction* opa;
   HInstruction* opb;
-  if (!IsConstantValue(val_a) ||
+  if (!GenerateCode(context,
+                    loop,
+                    trip,
+                    trip,
+                    graph,
+                    block,
+                    is_min_a,
+                    &opa,
+                    /*allow_potential_overflow=*/false) ||
       !GenerateCode(context, loop, info->op_b, trip, graph, block, is_min, &opb)) {
     return false;
   }
@@ -1151,7 +1170,8 @@
   if (graph != nullptr) {
     ArenaAllocator* allocator = graph->GetAllocator();
     HInstruction* oper;
-    HInstruction* opa = graph->GetConstant(type, val_a.b_constant);
+    // Emit instructions for `a * i + b`. These are fine to overflow as they would have overflown
+    // also if we had kept the loop.
     if (stride_value == 1) {
       oper = new (allocator) HAdd(type, opa, opb);
     } else if (stride_value == -1) {
@@ -1162,6 +1182,15 @@
     }
     *result = Insert(block, oper);
   }
+
+  if (*needs_taken_test) {
+    if (TryGenerateTakenTest(context, loop, trip->op_b, graph, block, result, opb)) {
+      *needs_taken_test = false;  // taken care of
+    } else {
+      return false;
+    }
+  }
+
   return true;
 }
 
@@ -1298,8 +1327,8 @@
                                                   HInductionVarAnalysis::InductionInfo* trip,
                                                   HGraph* graph,
                                                   HBasicBlock* block,
-                                                  /*out*/HInstruction** result,
-                                                  /*out*/bool* needs_taken_test) const {
+                                                  /*out*/ HInstruction** result,
+                                                  /*inout*/ bool* needs_taken_test) const {
   DCHECK(info != nullptr);
   DCHECK_EQ(info->induction_class, HInductionVarAnalysis::kPeriodic);
   // Count period and detect all-invariants.
@@ -1339,6 +1368,15 @@
   HInstruction* x = nullptr;
   HInstruction* y = nullptr;
   HInstruction* t = nullptr;
+
+  // Overflows when the stride is equal to `1` are fine since the periodicity is
+  // `2` and the lowest bit is the same. Similar with `-1`.
+  auto allow_potential_overflow = [&]() {
+    int64_t stride_value = 0;
+    return IsConstant(context, loop, trip->op_a->op_b, kExact, &stride_value) &&
+           (stride_value == 1 || stride_value == -1);
+  };
+
   if (period == 2 &&
       GenerateCode(context,
                    loop,
@@ -1363,7 +1401,8 @@
                    graph,
                    block,
                    /*is_min=*/ false,
-                   graph ? &t : nullptr)) {
+                   graph ? &t : nullptr,
+                   allow_potential_overflow())) {
     // During actual code generation (graph != nullptr), generate is_even ? x : y.
     if (graph != nullptr) {
       DataType::Type type = trip->type;
@@ -1374,21 +1413,9 @@
           Insert(block, new (allocator) HEqual(msk, graph->GetConstant(type, 0), kNoDexPc));
       *result = Insert(block, new (graph->GetAllocator()) HSelect(is_even, x, y, kNoDexPc));
     }
-    // Guard select with taken test if needed.
+
     if (*needs_taken_test) {
-      HInstruction* is_taken = nullptr;
-      if (GenerateCode(context,
-                       loop,
-                       trip->op_b,
-                       /*trip=*/ nullptr,
-                       graph,
-                       block,
-                       /*is_min=*/ false,
-                       graph ? &is_taken : nullptr)) {
-        if (graph != nullptr) {
-          ArenaAllocator* allocator = graph->GetAllocator();
-          *result = Insert(block, new (allocator) HSelect(is_taken, *result, x, kNoDexPc));
-        }
+      if (TryGenerateTakenTest(context, loop, trip->op_b, graph, block, result, x)) {
         *needs_taken_test = false;  // taken care of
       } else {
         return false;
@@ -1406,7 +1433,8 @@
                                      HGraph* graph,  // when set, code is generated
                                      HBasicBlock* block,
                                      bool is_min,
-                                     /*out*/HInstruction** result) const {
+                                     /*out*/ HInstruction** result,
+                                     bool allow_potential_overflow) const {
   if (info != nullptr) {
     // If during codegen, the result is not needed (nullptr), simply return success.
     if (graph != nullptr && result == nullptr) {
@@ -1431,8 +1459,41 @@
           case HInductionVarAnalysis::kLE:
           case HInductionVarAnalysis::kGT:
           case HInductionVarAnalysis::kGE:
-            if (GenerateCode(context, loop, info->op_a, trip, graph, block, is_min, &opa) &&
-                GenerateCode(context, loop, info->op_b, trip, graph, block, is_min, &opb)) {
+            if (GenerateCode(context,
+                             loop,
+                             info->op_a,
+                             trip,
+                             graph,
+                             block,
+                             is_min,
+                             &opa,
+                             allow_potential_overflow) &&
+                GenerateCode(context,
+                             loop,
+                             info->op_b,
+                             trip,
+                             graph,
+                             block,
+                             is_min,
+                             &opb,
+                             allow_potential_overflow)) {
+              // Check for potentially invalid operations.
+              if (!allow_potential_overflow) {
+                switch (info->operation) {
+                  case HInductionVarAnalysis::kAdd:
+                    return TryGenerateAddWithoutOverflow(
+                        context, loop, info, graph, opa, opb, result);
+                  case HInductionVarAnalysis::kSub:
+                    return TryGenerateSubWithoutOverflow(context, loop, info, graph, opa, result);
+                  default:
+                    // The rest of the operations are not relevant in the cases where
+                    // `allow_potential_overflow` is false. Fall through to the allowed overflow
+                    // case.
+                    break;
+                }
+              }
+
+              // Overflows here are accepted.
               if (graph != nullptr) {
                 HInstruction* operation = nullptr;
                 switch (info->operation) {
@@ -1465,7 +1526,15 @@
             }
             break;
           case HInductionVarAnalysis::kNeg:
-            if (GenerateCode(context, loop, info->op_b, trip, graph, block, !is_min, &opb)) {
+            if (GenerateCode(context,
+                             loop,
+                             info->op_b,
+                             trip,
+                             graph,
+                             block,
+                             !is_min,
+                             &opb,
+                             allow_potential_overflow)) {
               if (graph != nullptr) {
                 *result = Insert(block, new (graph->GetAllocator()) HNeg(type, opb));
               }
@@ -1481,8 +1550,15 @@
           case HInductionVarAnalysis::kTripCountInLoopUnsafe:
             if (UseFullTripCount(context, loop, is_min)) {
               // Generate the full trip count (do not subtract 1 as we do in loop body).
-              return GenerateCode(
-                  context, loop, info->op_a, trip, graph, block, /*is_min=*/ false, result);
+              return GenerateCode(context,
+                                  loop,
+                                  info->op_a,
+                                  trip,
+                                  graph,
+                                  block,
+                                  /*is_min=*/false,
+                                  result,
+                                  allow_potential_overflow);
             }
             FALLTHROUGH_INTENDED;
           case HInductionVarAnalysis::kTripCountInBody:
@@ -1492,12 +1568,31 @@
                 *result = graph->GetConstant(type, 0);
               }
               return true;
-            } else if (IsContextInBody(context, loop)) {
-              if (GenerateCode(context, loop, info->op_a, trip, graph, block, is_min, &opb)) {
+            } else if (IsContextInBody(context, loop) ||
+                       (context == loop->GetHeader() && !allow_potential_overflow)) {
+              if (GenerateCode(context,
+                               loop,
+                               info->op_a,
+                               trip,
+                               graph,
+                               block,
+                               is_min,
+                               &opb,
+                               allow_potential_overflow)) {
                 if (graph != nullptr) {
-                  ArenaAllocator* allocator = graph->GetAllocator();
-                  *result =
-                      Insert(block, new (allocator) HSub(type, opb, graph->GetConstant(type, 1)));
+                  if (IsContextInBody(context, loop)) {
+                    ArenaAllocator* allocator = graph->GetAllocator();
+                    *result =
+                        Insert(block, new (allocator) HSub(type, opb, graph->GetConstant(type, 1)));
+                  } else {
+                    // We want to generate the full trip count since we want the last value. This
+                    // will be combined with an `is_taken` test so we don't want to subtract one.
+                    DCHECK(context == loop->GetHeader());
+                    // TODO(solanes): Remove the !allow_potential_overflow restriction and allow
+                    // other parts e.g. BCE to take advantage of this.
+                    DCHECK(!allow_potential_overflow);
+                    *result = opb;
+                  }
                 }
                 return true;
               }
@@ -1519,8 +1614,24 @@
           if (IsConstant(context, loop, info->op_a, kExact, &stride_value) &&
               CanLongValueFitIntoInt(stride_value)) {
             const bool is_min_a = stride_value >= 0 ? is_min : !is_min;
-            if (GenerateCode(context, loop, trip,       trip, graph, block, is_min_a, &opa) &&
-                GenerateCode(context, loop, info->op_b, trip, graph, block, is_min,   &opb)) {
+            if (GenerateCode(context,
+                             loop,
+                             trip,
+                             trip,
+                             graph,
+                             block,
+                             is_min_a,
+                             &opa,
+                             allow_potential_overflow) &&
+                GenerateCode(context,
+                             loop,
+                             info->op_b,
+                             trip,
+                             graph,
+                             block,
+                             is_min,
+                             &opb,
+                             allow_potential_overflow)) {
               if (graph != nullptr) {
                 ArenaAllocator* allocator = graph->GetAllocator();
                 HInstruction* oper;
@@ -1562,6 +1673,119 @@
   return false;
 }
 
+bool InductionVarRange::TryGenerateAddWithoutOverflow(const HBasicBlock* context,
+                                                      const HLoopInformation* loop,
+                                                      HInductionVarAnalysis::InductionInfo* info,
+                                                      HGraph* graph,
+                                                      /*in*/ HInstruction* opa,
+                                                      /*in*/ HInstruction* opb,
+                                                      /*out*/ HInstruction** result) const {
+  // Calculate `a + b` making sure we can't overflow.
+  int64_t val_a;
+  const bool a_is_const = IsConstant(context, loop, info->op_a, kExact, &val_a);
+  int64_t val_b;
+  const bool b_is_const = IsConstant(context, loop, info->op_b, kExact, &val_b);
+  if (a_is_const && b_is_const) {
+    // Calculate `a + b` and use that. Note that even when the values are known,
+    // their addition can still overflow.
+    Value add_val = AddValue(Value(val_a), Value(val_b));
+    if (add_val.is_known) {
+      DCHECK(IsConstantValue(add_val));
+      // Known value not overflowing.
+      if (graph != nullptr) {
+        *result = graph->GetConstant(info->type, add_val.b_constant);
+      }
+      return true;
+    }
+  }
+
+  // When `a` is `0`, we can just use `b`.
+  if (a_is_const && val_a == 0) {
+    if (graph != nullptr) {
+      *result = opb;
+    }
+    return true;
+  }
+
+  if (b_is_const && val_b == 0) {
+    if (graph != nullptr) {
+      *result = opa;
+    }
+    return true;
+  }
+
+  // Couldn't safely calculate the addition.
+  return false;
+}
+
+bool InductionVarRange::TryGenerateSubWithoutOverflow(const HBasicBlock* context,
+                                                      const HLoopInformation* loop,
+                                                      HInductionVarAnalysis::InductionInfo* info,
+                                                      HGraph* graph,
+                                                      /*in*/ HInstruction* opa,
+                                                      /*out*/ HInstruction** result) const {
+  // Calculate `a - b` making sure we can't overflow.
+  int64_t val_b;
+  if (!IsConstant(context, loop, info->op_b, kExact, &val_b)) {
+    // If b is unknown, a - b can potentially overflow for any value of a since b
+    // can be Integer.MIN_VALUE.
+    return false;
+  }
+
+  int64_t val_a;
+  if (IsConstant(context, loop, info->op_a, kExact, &val_a)) {
+    // Calculate `a - b` and use that. Note that even when the values are known,
+    // their subtraction can still overflow.
+    Value sub_val = SubValue(Value(val_a), Value(val_b));
+    if (sub_val.is_known) {
+      DCHECK(IsConstantValue(sub_val));
+      // Known value not overflowing.
+      if (graph != nullptr) {
+        *result = graph->GetConstant(info->type, sub_val.b_constant);
+      }
+      return true;
+    }
+  }
+
+  // When `b` is `0`, we can just use `a`.
+  if (val_b == 0) {
+    if (graph != nullptr) {
+      *result = opa;
+    }
+    return true;
+  }
+
+  // Couldn't safely calculate the subtraction.
+  return false;
+}
+
+bool InductionVarRange::TryGenerateTakenTest(const HBasicBlock* context,
+                                             const HLoopInformation* loop,
+                                             HInductionVarAnalysis::InductionInfo* info,
+                                             HGraph* graph,
+                                             HBasicBlock* block,
+                                             /*inout*/ HInstruction** result,
+                                             /*inout*/ HInstruction* not_taken_result) const {
+  HInstruction* is_taken = nullptr;
+  if (GenerateCode(context,
+                   loop,
+                   info,
+                   /*trip=*/nullptr,
+                   graph,
+                   block,
+                   /*is_min=*/false,
+                   graph != nullptr ? &is_taken : nullptr)) {
+    if (graph != nullptr) {
+      ArenaAllocator* allocator = graph->GetAllocator();
+      *result =
+          Insert(block, new (allocator) HSelect(is_taken, *result, not_taken_result, kNoDexPc));
+    }
+    return true;
+  } else {
+    return false;
+  }
+}
+
 void InductionVarRange::ReplaceInduction(HInductionVarAnalysis::InductionInfo* info,
                                          HInstruction* fetch,
                                          HInstruction* replacement) {
diff --git a/compiler/optimizing/induction_var_range.h b/compiler/optimizing/induction_var_range.h
index 3e1212b..a81227b 100644
--- a/compiler/optimizing/induction_var_range.h
+++ b/compiler/optimizing/induction_var_range.h
@@ -325,7 +325,8 @@
                                HGraph* graph,
                                HBasicBlock* block,
                                bool is_min,
-                               /*out*/ HInstruction** result) const;
+                               /*out*/ HInstruction** result,
+                               /*inout*/ bool* needs_taken_test) const;
 
   bool GenerateLastValuePolynomial(const HBasicBlock* context,
                                    const HLoopInformation* loop,
@@ -357,8 +358,8 @@
                                  HInductionVarAnalysis::InductionInfo* trip,
                                  HGraph* graph,
                                  HBasicBlock* block,
-                                 /*out*/HInstruction** result,
-                                 /*out*/ bool* needs_taken_test) const;
+                                 /*out*/ HInstruction** result,
+                                 /*inout*/ bool* needs_taken_test) const;
 
   bool GenerateCode(const HBasicBlock* context,
                     const HLoopInformation* loop,
@@ -367,7 +368,34 @@
                     HGraph* graph,
                     HBasicBlock* block,
                     bool is_min,
-                    /*out*/ HInstruction** result) const;
+                    /*out*/ HInstruction** result,
+                    // TODO(solanes): Remove default value when all cases have been assessed.
+                    bool allow_potential_overflow = true) const;
+
+  bool TryGenerateAddWithoutOverflow(const HBasicBlock* context,
+                                     const HLoopInformation* loop,
+                                     HInductionVarAnalysis::InductionInfo* info,
+                                     HGraph* graph,
+                                     /*in*/ HInstruction* opa,
+                                     /*in*/ HInstruction* opb,
+                                     /*out*/ HInstruction** result) const;
+
+  bool TryGenerateSubWithoutOverflow(const HBasicBlock* context,
+                                     const HLoopInformation* loop,
+                                     HInductionVarAnalysis::InductionInfo* info,
+                                     HGraph* graph,
+                                     /*in*/ HInstruction* opa,
+                                     /*out*/ HInstruction** result) const;
+
+  // Try to guard the taken test with an HSelect instruction. Returns true if it can generate the
+  // code, or false otherwise. The caller is responsible of updating `needs_taken_test`.
+  bool TryGenerateTakenTest(const HBasicBlock* context,
+                            const HLoopInformation* loop,
+                            HInductionVarAnalysis::InductionInfo* info,
+                            HGraph* graph,
+                            HBasicBlock* block,
+                            /*inout*/ HInstruction** result,
+                            /*inout*/ HInstruction* not_taken_result) const;
 
   void ReplaceInduction(HInductionVarAnalysis::InductionInfo* info,
                         HInstruction* fetch,
diff --git a/compiler/optimizing/induction_var_range_test.cc b/compiler/optimizing/induction_var_range_test.cc
index d879897..40fb0d6 100644
--- a/compiler/optimizing/induction_var_range_test.cc
+++ b/compiler/optimizing/induction_var_range_test.cc
@@ -1061,11 +1061,13 @@
       range_.CanGenerateRange(exit->GetBlock(), exit, &needs_finite_test, &needs_taken_test));
   EXPECT_FALSE(range_.CanGenerateLastValue(exit));
 
-  // Last value (unsimplified).
+  // Last value (unsimplified). We expect Sub(1000, Neg(-1000)) which is equivalent to Sub(1000,
+  // 1000) aka 0.
   HInstruction* last = range_.GenerateLastValue(phi, graph_, loop_preheader_);
   ASSERT_TRUE(last->IsSub());
   ExpectInt(1000, last->InputAt(0));
-  ExpectInt(1000, last->InputAt(1));
+  ASSERT_TRUE(last->InputAt(1)->IsNeg());
+  ExpectInt(-1000, last->InputAt(1)->AsNeg()->InputAt(0));
 
   // Loop logic.
   int64_t tc = 0;
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 7b16ae9..f1e2733 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -37,6 +37,7 @@
 #include "mirror/object_array-alloc-inl.h"
 #include "mirror/object_array-inl.h"
 #include "nodes.h"
+#include "profiling_info_builder.h"
 #include "reference_type_propagation.h"
 #include "register_allocator_linear_scan.h"
 #include "scoped_thread_state_change-inl.h"
@@ -144,11 +145,6 @@
   }
 
   bool did_inline = false;
-  // The inliner is the only phase that sets invokes as `always throwing`, and since we only run the
-  // inliner once per graph this value should always be false at the beginning of the inlining
-  // phase. This is important since we use `HasAlwaysThrowingInvokes` to know whether the inliner
-  // phase performed a relevant change in the graph.
-  DCHECK(!graph_->HasAlwaysThrowingInvokes());
 
   // Initialize the number of instructions for the method being compiled. Recursive calls
   // to HInliner::Run have already updated the instruction count.
@@ -169,7 +165,9 @@
   // depending on the state of classes at runtime.
   const bool honor_noinline_directives = codegen_->GetCompilerOptions().CompileArtTest();
   const bool honor_inline_directives =
-      honor_noinline_directives && Runtime::Current()->IsAotCompiler();
+      honor_noinline_directives &&
+      Runtime::Current()->IsAotCompiler() &&
+      !graph_->IsCompilingBaseline();
 
   // Keep a copy of all blocks when starting the visit.
   ArenaVector<HBasicBlock*> blocks = graph_->GetReversePostOrder();
@@ -180,7 +178,7 @@
   for (HBasicBlock* block : blocks) {
     for (HInstruction* instruction = block->GetFirstInstruction(); instruction != nullptr;) {
       HInstruction* next = instruction->GetNext();
-      HInvoke* call = instruction->AsInvoke();
+      HInvoke* call = instruction->AsInvokeOrNull();
       // As long as the call is not intrinsified, it is worth trying to inline.
       if (call != nullptr && !codegen_->IsImplementedIntrinsic(call)) {
         if (honor_noinline_directives) {
@@ -208,8 +206,25 @@
     }
   }
 
+  if (run_extra_type_propagation_) {
+    ReferenceTypePropagation rtp_fixup(graph_,
+                                       outer_compilation_unit_.GetDexCache(),
+                                       /* is_first_run= */ false);
+    rtp_fixup.Run();
+  }
+
   // We return true if we either inlined at least one method, or we marked one of our methods as
   // always throwing.
+  // To check if we added an always throwing method we can either:
+  //   1) Pass a boolean throughout the pipeline and get an accurate result, or
+  //   2) Just check that the `HasAlwaysThrowingInvokes()` flag is true now. This is not 100%
+  //     accurate but the only other part where we set `HasAlwaysThrowingInvokes` is constant
+  //     folding the DivideUnsigned intrinsics for when the divisor is known to be 0. This case is
+  //     rare enough that changing the pipeline for this is not worth it. In the case of the false
+  //     positive (i.e. A) we didn't inline at all, B) the graph already had an always throwing
+  //     invoke, and C) we didn't set any new always throwing invokes), we will be running constant
+  //     folding, instruction simplifier, and dead code elimination one more time even though it
+  //     shouldn't change things. There's no false negative case.
   return did_inline || graph_->HasAlwaysThrowingInvokes();
 }
 
@@ -223,7 +238,7 @@
  * the actual runtime target of an interface or virtual call.
  * Return nullptr if the runtime target cannot be proven.
  */
-static ArtMethod* FindVirtualOrInterfaceTarget(HInvoke* invoke)
+static ArtMethod* FindVirtualOrInterfaceTarget(HInvoke* invoke, ReferenceTypeInfo info)
     REQUIRES_SHARED(Locks::mutator_lock_) {
   ArtMethod* resolved_method = invoke->GetResolvedMethod();
   if (IsMethodOrDeclaringClassFinal(resolved_method)) {
@@ -231,20 +246,7 @@
     return resolved_method;
   }
 
-  HInstruction* receiver = invoke->InputAt(0);
-  if (receiver->IsNullCheck()) {
-    // Due to multiple levels of inlining within the same pass, it might be that
-    // null check does not have the reference type of the actual receiver.
-    receiver = receiver->InputAt(0);
-  }
-  ReferenceTypeInfo info = receiver->GetReferenceTypeInfo();
-  DCHECK(info.IsValid()) << "Invalid RTI for " << receiver->DebugName();
-  if (!info.IsExact()) {
-    // We currently only support inlining with known receivers.
-    // TODO: Remove this check, we should be able to inline final methods
-    // on unknown receivers.
-    return nullptr;
-  } else if (info.GetTypeHandle()->IsInterface()) {
+  if (info.GetTypeHandle()->IsInterface()) {
     // Statically knowing that the receiver has an interface type cannot
     // help us find what is the target method.
     return nullptr;
@@ -336,8 +338,8 @@
 
 HInliner::InlineCacheType HInliner::GetInlineCacheType(
     const StackHandleScope<InlineCache::kIndividualCacheSize>& classes) {
-  DCHECK_EQ(classes.NumberOfReferences(), InlineCache::kIndividualCacheSize);
-  uint8_t number_of_types = InlineCache::kIndividualCacheSize - classes.RemainingSlots();
+  DCHECK_EQ(classes.Capacity(), InlineCache::kIndividualCacheSize);
+  uint8_t number_of_types = classes.Size();
   if (number_of_types == 0) {
     return kInlineCacheUninitialized;
   } else if (number_of_types == 1) {
@@ -472,15 +474,42 @@
     return false;
   }
 
-  ArtMethod* actual_method = invoke_instruction->IsInvokeStaticOrDirect()
-      ? invoke_instruction->GetResolvedMethod()
-      : FindVirtualOrInterfaceTarget(invoke_instruction);
+  ArtMethod* actual_method = nullptr;
+  ReferenceTypeInfo receiver_info = ReferenceTypeInfo::CreateInvalid();
+  if (invoke_instruction->GetInvokeType() == kStatic) {
+    actual_method = invoke_instruction->GetResolvedMethod();
+  } else {
+    HInstruction* receiver = invoke_instruction->InputAt(0);
+    while (receiver->IsNullCheck()) {
+      // Due to multiple levels of inlining within the same pass, it might be that
+      // null check does not have the reference type of the actual receiver.
+      receiver = receiver->InputAt(0);
+    }
+    receiver_info = receiver->GetReferenceTypeInfo();
+    if (!receiver_info.IsValid()) {
+      // We have to run the extra type propagation now as we are requiring the RTI.
+      DCHECK(run_extra_type_propagation_);
+      run_extra_type_propagation_ = false;
+      ReferenceTypePropagation rtp_fixup(graph_,
+                                         outer_compilation_unit_.GetDexCache(),
+                                         /* is_first_run= */ false);
+      rtp_fixup.Run();
+      receiver_info = receiver->GetReferenceTypeInfo();
+    }
+
+    DCHECK(receiver_info.IsValid()) << "Invalid RTI for " << receiver->DebugName();
+    if (invoke_instruction->IsInvokeStaticOrDirect()) {
+      actual_method = invoke_instruction->GetResolvedMethod();
+    } else {
+      actual_method = FindVirtualOrInterfaceTarget(invoke_instruction, receiver_info);
+    }
+  }
 
   if (actual_method != nullptr) {
     // Single target.
     bool result = TryInlineAndReplace(invoke_instruction,
                                       actual_method,
-                                      ReferenceTypeInfo::CreateInvalid(),
+                                      receiver_info,
                                       /* do_rtp= */ true,
                                       /* is_speculative= */ false);
     if (result) {
@@ -506,6 +535,16 @@
     return result;
   }
 
+  if (graph_->IsCompilingBaseline()) {
+    LOG_FAIL_NO_STAT() << "Call to " << invoke_instruction->GetMethodReference().PrettyMethod()
+                       << " not inlined because we are compiling baseline and we could not"
+                       << " statically resolve the target";
+    // For baseline compilation, we will collect inline caches, so we should not
+    // try to inline using them.
+    outermost_graph_->SetUsefulOptimizing();
+    return false;
+  }
+
   DCHECK(!invoke_instruction->IsInvokeStaticOrDirect());
 
   // No try catch inlining allowed here, or recursively. For try catch inlining we are banking on
@@ -541,9 +580,10 @@
   uint32_t dex_pc = invoke_instruction->GetDexPc();
   HInstruction* cursor = invoke_instruction->GetPrevious();
   HBasicBlock* bb_cursor = invoke_instruction->GetBlock();
+  Handle<mirror::Class> cls = graph_->GetHandleCache()->NewHandle(method->GetDeclaringClass());
   if (!TryInlineAndReplace(invoke_instruction,
                            method,
-                           ReferenceTypeInfo::CreateInvalid(),
+                           ReferenceTypeInfo::Create(cls),
                            /* do_rtp= */ true,
                            /* is_speculative= */ true)) {
     return false;
@@ -655,22 +695,47 @@
   ArtMethod* caller = graph_->GetArtMethod();
   // Under JIT, we should always know the caller.
   DCHECK(caller != nullptr);
-  ProfilingInfo* profiling_info = graph_->GetProfilingInfo();
-  if (profiling_info == nullptr) {
-    return kInlineCacheNoData;
+
+  InlineCache* cache = nullptr;
+  // Start with the outer graph profiling info.
+  ProfilingInfo* profiling_info = outermost_graph_->GetProfilingInfo();
+  if (profiling_info != nullptr) {
+    if (depth_ == 0) {
+      cache = profiling_info->GetInlineCache(invoke_instruction->GetDexPc());
+    } else {
+      uint32_t dex_pc = ProfilingInfoBuilder::EncodeInlinedDexPc(
+          this, codegen_->GetCompilerOptions(), invoke_instruction);
+      if (dex_pc != kNoDexPc) {
+        cache = profiling_info->GetInlineCache(dex_pc);
+      }
+    }
   }
 
-  Runtime::Current()->GetJit()->GetCodeCache()->CopyInlineCacheInto(
-      *profiling_info->GetInlineCache(invoke_instruction->GetDexPc()),
-      classes);
+  if (cache == nullptr) {
+    // Check the current graph profiling info.
+    profiling_info = graph_->GetProfilingInfo();
+    if (profiling_info == nullptr) {
+      return kInlineCacheNoData;
+    }
+
+    cache = profiling_info->GetInlineCache(invoke_instruction->GetDexPc());
+  }
+
+  if (cache == nullptr) {
+    // Either we never hit this invoke and we never compiled the callee,
+    // or the method wasn't resolved when we performed baseline compilation.
+    // Bail for now.
+    return kInlineCacheNoData;
+  }
+  Runtime::Current()->GetJit()->GetCodeCache()->CopyInlineCacheInto(*cache, classes);
   return GetInlineCacheType(*classes);
 }
 
 HInliner::InlineCacheType HInliner::GetInlineCacheAOT(
     HInvoke* invoke_instruction,
     /*out*/StackHandleScope<InlineCache::kIndividualCacheSize>* classes) {
-  DCHECK_EQ(classes->NumberOfReferences(), InlineCache::kIndividualCacheSize);
-  DCHECK_EQ(classes->RemainingSlots(), InlineCache::kIndividualCacheSize);
+  DCHECK_EQ(classes->Capacity(), InlineCache::kIndividualCacheSize);
+  DCHECK_EQ(classes->Size(), 0u);
 
   const ProfileCompilationInfo* pci = codegen_->GetCompilerOptions().GetProfileCompilationInfo();
   if (pci == nullptr) {
@@ -685,6 +750,12 @@
 
   const ProfileCompilationInfo::InlineCacheMap* inline_caches = hotness.GetInlineCacheMap();
   DCHECK(inline_caches != nullptr);
+
+  // Inlined inline caches are not supported in AOT, so we use the dex pc directly, and don't
+  // call `InlineCache::EncodeDexPc`.
+  // To support it, we would need to ensure `inline_max_code_units` remain the
+  // same between dex2oat and runtime, for example by adding it to the boot
+  // image oat header.
   const auto it = inline_caches->find(invoke_instruction->GetDexPc());
   if (it == inline_caches->end()) {
     return kInlineCacheUninitialized;
@@ -716,7 +787,7 @@
           << descriptor;
       return kInlineCacheMissingTypes;
     }
-    DCHECK_NE(classes->RemainingSlots(), 0u);
+    DCHECK_LT(classes->Size(), classes->Capacity());
     classes->NewHandle(clazz);
   }
 
@@ -829,12 +900,9 @@
                invoke_instruction,
                /* with_deoptimization= */ true);
 
-  // Run type propagation to get the guard typed, and eventually propagate the
+  // Lazily run type propagation to get the guard typed, and eventually propagate the
   // type of the receiver.
-  ReferenceTypePropagation rtp_fixup(graph_,
-                                     outer_compilation_unit_.GetDexCache(),
-                                     /* is_first_run= */ false);
-  rtp_fixup.Run();
+  run_extra_type_propagation_ = true;
 
   MaybeRecordStat(stats_, MethodCompilationStat::kInlinedMonomorphicCall);
   return true;
@@ -967,8 +1035,8 @@
 
   bool all_targets_inlined = true;
   bool one_target_inlined = false;
-  DCHECK_EQ(classes.NumberOfReferences(), InlineCache::kIndividualCacheSize);
-  uint8_t number_of_types = InlineCache::kIndividualCacheSize - classes.RemainingSlots();
+  DCHECK_EQ(classes.Capacity(), InlineCache::kIndividualCacheSize);
+  uint8_t number_of_types = classes.Size();
   for (size_t i = 0; i != number_of_types; ++i) {
     DCHECK(classes.GetReference(i) != nullptr);
     Handle<mirror::Class> handle =
@@ -1052,11 +1120,8 @@
 
   MaybeRecordStat(stats_, MethodCompilationStat::kInlinedPolymorphicCall);
 
-  // Run type propagation to get the guards typed.
-  ReferenceTypePropagation rtp_fixup(graph_,
-                                     outer_compilation_unit_.GetDexCache(),
-                                     /* is_first_run= */ false);
-  rtp_fixup.Run();
+  // Lazily run type propagation to get the guards typed.
+  run_extra_type_propagation_ = true;
   return true;
 }
 
@@ -1154,8 +1219,8 @@
 
   // Check whether we are actually calling the same method among
   // the different types seen.
-  DCHECK_EQ(classes.NumberOfReferences(), InlineCache::kIndividualCacheSize);
-  uint8_t number_of_types = InlineCache::kIndividualCacheSize - classes.RemainingSlots();
+  DCHECK_EQ(classes.Capacity(), InlineCache::kIndividualCacheSize);
+  uint8_t number_of_types = classes.Size();
   for (size_t i = 0; i != number_of_types; ++i) {
     DCHECK(classes.GetReference(i) != nullptr);
     ArtMethod* new_method = nullptr;
@@ -1186,9 +1251,11 @@
   HBasicBlock* bb_cursor = invoke_instruction->GetBlock();
 
   HInstruction* return_replacement = nullptr;
+  Handle<mirror::Class> cls =
+      graph_->GetHandleCache()->NewHandle(actual_method->GetDeclaringClass());
   if (!TryBuildAndInline(invoke_instruction,
                          actual_method,
-                         ReferenceTypeInfo::CreateInvalid(),
+                         ReferenceTypeInfo::Create(cls),
                          &return_replacement,
                          /* is_speculative= */ true)) {
     return false;
@@ -1243,12 +1310,8 @@
     deoptimize->SetReferenceTypeInfo(receiver->GetReferenceTypeInfo());
   }
 
-  // Run type propagation to get the guard typed.
-  ReferenceTypePropagation rtp_fixup(graph_,
-                                     outer_compilation_unit_.GetDexCache(),
-                                     /* is_first_run= */ false);
-  rtp_fixup.Run();
-
+  // Lazily run type propagation to get the guard typed.
+  run_extra_type_propagation_ = true;
   MaybeRecordStat(stats_, MethodCompilationStat::kInlinedPolymorphicCall);
 
   LOG_SUCCESS() << "Inlined same polymorphic target " << actual_method->PrettyMethod();
@@ -1501,6 +1564,14 @@
     return false;
   }
 
+  if (graph_->IsCompilingBaseline() &&
+      accessor.InsnsSizeInCodeUnits() > CompilerOptions::kBaselineInlineMaxCodeUnits) {
+    LOG_FAIL_NO_STAT() << "Reached baseline maximum code unit for inlining  "
+                       << method->PrettyMethod();
+    outermost_graph_->SetUsefulOptimizing();
+    return false;
+  }
+
   if (invoke_instruction->GetBlock()->GetLastInstruction()->IsThrow()) {
     LOG_FAIL(stats_, MethodCompilationStat::kNotInlinedEndsWithThrow)
         << "Method " << method->PrettyMethod()
@@ -1518,7 +1589,9 @@
                                  bool is_speculative) {
   // If invoke_instruction is devirtualized to a different method, give intrinsics
   // another chance before we try to inline it.
-  if (invoke_instruction->GetResolvedMethod() != method && method->IsIntrinsic()) {
+  if (invoke_instruction->GetResolvedMethod() != method &&
+      method->IsIntrinsic() &&
+      IsValidIntrinsicAfterBuilder(static_cast<Intrinsics>(method->GetIntrinsic()))) {
     MaybeRecordStat(stats_, MethodCompilationStat::kIntrinsicRecognized);
     // For simplicity, always create a new instruction to replace the existing
     // invoke.
@@ -1546,17 +1619,28 @@
     return true;
   }
 
+  CodeItemDataAccessor accessor(method->DexInstructionData());
+
+  if (!IsInliningAllowed(method, accessor)) {
+    return false;
+  }
+
+  // We have checked above that inlining is "allowed" to make sure that the method has bytecode
+  // (is not native), is compilable and verified and to enforce the @NeverInline annotation.
+  // However, the pattern substitution is always preferable, so we do it before the check if
+  // inlining is "encouraged". It also has an exception to the `MayInline()` restriction.
+  if (TryPatternSubstitution(invoke_instruction, method, accessor, return_replacement)) {
+    LOG_SUCCESS() << "Successfully replaced pattern of invoke "
+                  << method->PrettyMethod();
+    MaybeRecordStat(stats_, MethodCompilationStat::kReplacedInvokeWithSimplePattern);
+    return true;
+  }
+
   // Check whether we're allowed to inline. The outermost compilation unit is the relevant
   // dex file here (though the transitivity of an inline chain would allow checking the caller).
   if (!MayInline(codegen_->GetCompilerOptions(),
                  *method->GetDexFile(),
                  *outer_compilation_unit_.GetDexFile())) {
-    if (TryPatternSubstitution(invoke_instruction, method, return_replacement)) {
-      LOG_SUCCESS() << "Successfully replaced pattern of invoke "
-                    << method->PrettyMethod();
-      MaybeRecordStat(stats_, MethodCompilationStat::kReplacedInvokeWithSimplePattern);
-      return true;
-    }
     LOG_FAIL(stats_, MethodCompilationStat::kNotInlinedWont)
         << "Won't inline " << method->PrettyMethod() << " in "
         << outer_compilation_unit_.GetDexFile()->GetLocation() << " ("
@@ -1565,12 +1649,6 @@
     return false;
   }
 
-  CodeItemDataAccessor accessor(method->DexInstructionData());
-
-  if (!IsInliningAllowed(method, accessor)) {
-    return false;
-  }
-
   if (!IsInliningSupported(invoke_instruction, method, accessor)) {
     return false;
   }
@@ -1610,9 +1688,10 @@
 // Try to recognize known simple patterns and replace invoke call with appropriate instructions.
 bool HInliner::TryPatternSubstitution(HInvoke* invoke_instruction,
                                       ArtMethod* method,
+                                      const CodeItemDataAccessor& accessor,
                                       HInstruction** return_replacement) {
   InlineMethod inline_method;
-  if (!InlineMethodAnalyser::AnalyseMethodCode(method, &inline_method)) {
+  if (!InlineMethodAnalyser::AnalyseMethodCode(method, &accessor, &inline_method)) {
     return false;
   }
 
@@ -2052,6 +2131,21 @@
             << " could not be inlined because it needs a BSS check";
         return false;
       }
+
+      if (outermost_graph_->IsCompilingBaseline() &&
+          (current->IsInvokeVirtual() || current->IsInvokeInterface()) &&
+          ProfilingInfoBuilder::IsInlineCacheUseful(current->AsInvoke(), codegen_)) {
+        uint32_t maximum_inlining_depth_for_baseline =
+            InlineCache::MaxDexPcEncodingDepth(
+                outermost_graph_->GetArtMethod(),
+                codegen_->GetCompilerOptions().GetInlineMaxCodeUnits());
+        if (depth_ + 1 > maximum_inlining_depth_for_baseline) {
+          LOG_FAIL_NO_STAT() << "Reached maximum depth for inlining in baseline compilation: "
+                             << depth_ << " for " << callee_graph->GetArtMethod()->PrettyMethod();
+          outermost_graph_->SetUsefulOptimizing();
+          return false;
+        }
+      }
     }
   }
 
@@ -2064,7 +2158,8 @@
                                        ReferenceTypeInfo receiver_type,
                                        HInstruction** return_replacement,
                                        bool is_speculative) {
-  DCHECK(!(resolved_method->IsStatic() && receiver_type.IsValid()));
+  DCHECK_IMPLIES(resolved_method->IsStatic(), !receiver_type.IsValid());
+  DCHECK_IMPLIES(!resolved_method->IsStatic(), receiver_type.IsValid());
   const dex::CodeItem* code_item = resolved_method->GetCodeItem();
   const DexFile& callee_dex_file = *resolved_method->GetDexFile();
   uint32_t method_index = resolved_method->GetDexMethodIndex();
@@ -2162,6 +2257,7 @@
       // The current invoke is not a try block.
       !invoke_instruction->GetBlock()->IsTryBlock();
   RunOptimizations(callee_graph,
+                   invoke_instruction->GetEnvironment(),
                    code_item,
                    dex_compilation_unit,
                    try_catch_inlining_allowed_for_recursive_inline);
@@ -2201,6 +2297,7 @@
 }
 
 void HInliner::RunOptimizations(HGraph* callee_graph,
+                                HEnvironment* caller_environment,
                                 const dex::CodeItem* code_item,
                                 const DexCompilationUnit& dex_compilation_unit,
                                 bool try_catch_inlining_allowed_for_recursive_inline) {
@@ -2249,6 +2346,7 @@
                    total_number_of_dex_registers_ + accessor.RegistersSize(),
                    total_number_of_instructions_ + number_of_instructions,
                    this,
+                   caller_environment,
                    depth_ + 1,
                    try_catch_inlining_allowed_for_recursive_inline);
   inliner.Run();
diff --git a/compiler/optimizing/inliner.h b/compiler/optimizing/inliner.h
index af067da..57d3364 100644
--- a/compiler/optimizing/inliner.h
+++ b/compiler/optimizing/inliner.h
@@ -43,6 +43,7 @@
            size_t total_number_of_dex_registers,
            size_t total_number_of_instructions,
            HInliner* parent,
+           HEnvironment* caller_environment,
            size_t depth,
            bool try_catch_inlining_allowed,
            const char* name = kInlinerPassName)
@@ -54,15 +55,23 @@
         total_number_of_dex_registers_(total_number_of_dex_registers),
         total_number_of_instructions_(total_number_of_instructions),
         parent_(parent),
+        caller_environment_(caller_environment),
         depth_(depth),
         inlining_budget_(0),
         try_catch_inlining_allowed_(try_catch_inlining_allowed),
+        run_extra_type_propagation_(false),
         inline_stats_(nullptr) {}
 
   bool Run() override;
 
   static constexpr const char* kInlinerPassName = "inliner";
 
+  const HInliner* GetParent() const { return parent_; }
+  const HEnvironment* GetCallerEnvironment() const { return caller_environment_; }
+
+  const HGraph* GetOutermostGraph() const { return outermost_graph_; }
+  const HGraph* GetGraph() const { return graph_; }
+
  private:
   enum InlineCacheType {
     kInlineCacheNoData = 0,
@@ -108,6 +117,7 @@
 
   // Run simple optimizations on `callee_graph`.
   void RunOptimizations(HGraph* callee_graph,
+                        HEnvironment* caller_environment,
                         const dex::CodeItem* code_item,
                         const DexCompilationUnit& dex_compilation_unit,
                         bool try_catch_inlining_allowed_for_recursive_inline)
@@ -116,6 +126,7 @@
   // Try to recognize known simple patterns and replace invoke call with appropriate instructions.
   bool TryPatternSubstitution(HInvoke* invoke_instruction,
                               ArtMethod* method,
+                              const CodeItemDataAccessor& accessor,
                               HInstruction** return_replacement)
     REQUIRES_SHARED(Locks::mutator_lock_);
 
@@ -320,9 +331,10 @@
   const size_t total_number_of_dex_registers_;
   size_t total_number_of_instructions_;
 
-  // The 'parent' inliner, that means the inlinigng optimization that requested
+  // The 'parent' inliner, that means the inlining optimization that requested
   // `graph_` to be inlined.
   const HInliner* const parent_;
+  const HEnvironment* const caller_environment_;
   const size_t depth_;
 
   // The budget left for inlining, in number of instructions.
@@ -331,6 +343,9 @@
   // States if we are allowing try catch inlining to occur at this particular instance of inlining.
   bool try_catch_inlining_allowed_;
 
+  // True if we need to run type propagation to type guards we inserted.
+  bool run_extra_type_propagation_;
+
   // Used to record stats about optimizations on the inlined graph.
   // If the inlining is successful, these stats are merged to the caller graph's stats.
   OptimizingCompilerStats* inline_stats_;
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index fee9091..410d6fd 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -33,8 +33,9 @@
 #include "intrinsics.h"
 #include "intrinsics_utils.h"
 #include "jit/jit.h"
+#include "jit/profiling_info.h"
 #include "mirror/dex_cache.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 #include "optimizing_compiler_stats.h"
 #include "reflective_handle_scope-inl.h"
 #include "scoped_thread_state_change-inl.h"
@@ -665,22 +666,31 @@
   }
 }
 
-template<typename T>
-void HInstructionBuilder::If_22t(const Instruction& instruction, uint32_t dex_pc) {
-  HInstruction* first = LoadLocal(instruction.VRegA(), DataType::Type::kInt32);
-  HInstruction* second = LoadLocal(instruction.VRegB(), DataType::Type::kInt32);
-  T* comparison = new (allocator_) T(first, second, dex_pc);
-  AppendInstruction(comparison);
-  AppendInstruction(new (allocator_) HIf(comparison, dex_pc));
-  current_block_ = nullptr;
-}
-
-template<typename T>
-void HInstructionBuilder::If_21t(const Instruction& instruction, uint32_t dex_pc) {
+template<typename T, bool kCompareWithZero>
+void HInstructionBuilder::If_21_22t(const Instruction& instruction, uint32_t dex_pc) {
   HInstruction* value = LoadLocal(instruction.VRegA(), DataType::Type::kInt32);
-  T* comparison = new (allocator_) T(value, graph_->GetIntConstant(0, dex_pc), dex_pc);
+  T* comparison = nullptr;
+  if (kCompareWithZero) {
+    comparison = new (allocator_) T(value, graph_->GetIntConstant(0, dex_pc), dex_pc);
+  } else {
+    HInstruction* second = LoadLocal(instruction.VRegB(), DataType::Type::kInt32);
+    comparison = new (allocator_) T(value, second, dex_pc);
+  }
   AppendInstruction(comparison);
-  AppendInstruction(new (allocator_) HIf(comparison, dex_pc));
+  HIf* if_instr = new (allocator_) HIf(comparison, dex_pc);
+
+  ProfilingInfo* info = graph_->GetProfilingInfo();
+  if (info != nullptr && !graph_->IsCompilingBaseline()) {
+    BranchCache* cache = info->GetBranchCache(dex_pc);
+    if (cache != nullptr) {
+      if_instr->SetTrueCount(cache->GetTrue());
+      if_instr->SetFalseCount(cache->GetFalse());
+    }
+  }
+
+  // Append after setting true/false count, so that the builder knows if the
+  // instruction needs an environment.
+  AppendInstruction(if_instr);
   current_block_ = nullptr;
 }
 
@@ -1364,8 +1374,7 @@
                                                         method_reference,
                                                         resolved_method,
                                                         resolved_method_reference,
-                                                        proto_idx,
-                                                        !graph_->IsDebuggable());
+                                                        proto_idx);
   if (!HandleInvoke(invoke, operands, shorty, /* is_unresolved= */ false)) {
     return false;
   }
@@ -2001,6 +2010,7 @@
       break;
     default:
       // We do not have intermediate representation for other intrinsics.
+      DCHECK(!IsIntrinsicWithSpecializedHir(intrinsic));
       return false;
   }
   DCHECK(instruction != nullptr);
@@ -2365,9 +2375,9 @@
     second = LoadLocal(second_vreg_or_constant, type);
   }
 
-  if (!second_is_constant
-      || (type == DataType::Type::kInt32 && second->AsIntConstant()->GetValue() == 0)
-      || (type == DataType::Type::kInt64 && second->AsLongConstant()->GetValue() == 0)) {
+  if (!second_is_constant ||
+      (type == DataType::Type::kInt32 && second->AsIntConstant()->GetValue() == 0) ||
+      (type == DataType::Type::kInt64 && second->AsLongConstant()->GetValue() == 0)) {
     second = new (allocator_) HDivZeroCheck(second, dex_pc);
     AppendInstruction(second);
   }
@@ -2691,6 +2701,9 @@
   const DexFile& dex_file = *dex_compilation_unit_->GetDexFile();
   HLoadMethodType* load_method_type =
       new (allocator_) HLoadMethodType(graph_->GetCurrentMethod(), proto_index, dex_file, dex_pc);
+  if (!code_generator_->GetCompilerOptions().IsJitCompiler()) {
+    load_method_type->SetLoadKind(HLoadMethodType::LoadKind::kBssEntry);
+  }
   AppendInstruction(load_method_type);
 }
 
@@ -2880,8 +2893,12 @@
     }
 
 #define IF_XX(comparison, cond) \
-    case Instruction::IF_##cond: If_22t<comparison>(instruction, dex_pc); break; \
-    case Instruction::IF_##cond##Z: If_21t<comparison>(instruction, dex_pc); break
+    case Instruction::IF_##cond: \
+      If_21_22t<comparison, /* kCompareWithZero= */ false>(instruction, dex_pc); \
+      break; \
+    case Instruction::IF_##cond##Z: \
+      If_21_22t<comparison, /* kCompareWithZero= */ true>(instruction, dex_pc); \
+      break;
 
     IF_XX(HEqual, EQ);
     IF_XX(HNotEqual, NE);
diff --git a/compiler/optimizing/instruction_builder.h b/compiler/optimizing/instruction_builder.h
index 3d65d8f..5c165d7 100644
--- a/compiler/optimizing/instruction_builder.h
+++ b/compiler/optimizing/instruction_builder.h
@@ -116,8 +116,8 @@
   template<typename T>
   void Binop_22s(const Instruction& instruction, bool reverse, uint32_t dex_pc);
 
-  template<typename T> void If_21t(const Instruction& instruction, uint32_t dex_pc);
-  template<typename T> void If_22t(const Instruction& instruction, uint32_t dex_pc);
+  template<typename T, bool kCompareWithZero>
+  void If_21_22t(const Instruction& instruction, uint32_t dex_pc);
 
   void Conversion_12x(const Instruction& instruction,
                       DataType::Type input_type,
diff --git a/compiler/optimizing/instruction_simplifier.cc b/compiler/optimizing/instruction_simplifier.cc
index 0c2fd5d..ae778b4 100644
--- a/compiler/optimizing/instruction_simplifier.cc
+++ b/compiler/optimizing/instruction_simplifier.cc
@@ -22,6 +22,7 @@
 #include "data_type-inl.h"
 #include "driver/compiler_options.h"
 #include "escape.h"
+#include "intrinsic_objects.h"
 #include "intrinsics.h"
 #include "intrinsics_utils.h"
 #include "mirror/class-inl.h"
@@ -30,6 +31,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "sharpening.h"
 #include "string_builder_append.h"
+#include "well_known_classes.h"
 
 namespace art HIDDEN {
 
@@ -113,7 +115,7 @@
   void VisitInvoke(HInvoke* invoke) override;
   void VisitDeoptimize(HDeoptimize* deoptimize) override;
   void VisitVecMul(HVecMul* instruction) override;
-  void VisitPredicatedInstanceFieldGet(HPredicatedInstanceFieldGet* instruction) override;
+  void SimplifyBoxUnbox(HInvoke* instruction, ArtField* field, DataType::Type type);
   void SimplifySystemArrayCopy(HInvoke* invoke);
   void SimplifyStringEquals(HInvoke* invoke);
   void SimplifyFP2Int(HInvoke* invoke);
@@ -168,7 +170,7 @@
     // post order visit, we sometimes need to revisit an instruction index.
     do {
       simplification_occurred_ = false;
-      VisitBasicBlock(block);
+      VisitNonPhiInstructions(block);
       if (simplification_occurred_) {
         didSimplify = true;
       }
@@ -361,6 +363,114 @@
   return true;
 }
 
+// Replace code looking like (x << N >>> N or x << N >> N):
+//    SHL tmp, x, N
+//    USHR/SHR dst, tmp, N
+// with the corresponding type conversion:
+//    TypeConversion<Unsigned<T>/Signed<T>> dst, x
+// if
+//    SHL has only one non environment use
+//    TypeOf(tmp) is not 64-bit type (they are not supported yet)
+//    N % kBitsPerByte = 0
+// where
+//    T = SignedIntegralTypeFromSize(source_integral_size)
+//    source_integral_size = ByteSize(tmp) - N / kBitsPerByte
+//
+//    We calculate source_integral_size from shift amount instead of
+//    assuming that it is equal to ByteSize(x) to be able to optimize
+//    cases like this:
+//        int x = ...
+//        int y = x << 24 >>> 24
+//    that is equavalent to
+//        int y = (unsigned byte) x
+//    in this case:
+//        N = 24
+//        tmp = x << 24
+//        source_integral_size is 1 (= 4 - 24 / 8) that corresponds to unsigned byte.
+static bool TryReplaceShiftsByConstantWithTypeConversion(HBinaryOperation *instruction) {
+  if (!instruction->IsUShr() && !instruction->IsShr()) {
+    return false;
+  }
+
+  if (DataType::Is64BitType(instruction->GetResultType())) {
+    return false;
+  }
+
+  HInstruction* shr_amount = instruction->GetRight();
+  if (!shr_amount->IsIntConstant()) {
+    return false;
+  }
+
+  int32_t shr_amount_cst = shr_amount->AsIntConstant()->GetValue();
+
+  // We assume that shift amount simplification was applied first so it doesn't
+  // exceed maximum distance that is kMaxIntShiftDistance as 64-bit shifts aren't
+  // supported.
+  DCHECK_LE(shr_amount_cst, kMaxIntShiftDistance);
+
+  if ((shr_amount_cst % kBitsPerByte) != 0) {
+    return false;
+  }
+
+  // Calculate size of the significant part of the input, e.g. a part that is not
+  // discarded due to left shift.
+  // Shift amount here should be less than size of right shift type.
+  DCHECK_GT(DataType::Size(instruction->GetType()), shr_amount_cst / kBitsPerByte);
+  size_t source_significant_part_size =
+      DataType::Size(instruction->GetType()) - shr_amount_cst / kBitsPerByte;
+
+  // Look for the smallest signed integer type that is suitable to store the
+  // significant part of the input.
+  DataType::Type source_integral_type =
+      DataType::SignedIntegralTypeFromSize(source_significant_part_size);
+
+  // If the size of the significant part of the input isn't equal to the size of the
+  // found type, shifts cannot be replaced by type conversion.
+  if (DataType::Size(source_integral_type) != source_significant_part_size) {
+    return false;
+  }
+
+  HInstruction* shr_value = instruction->GetLeft();
+  if (!shr_value->IsShl()) {
+    return false;
+  }
+
+  HShl *shl = shr_value->AsShl();
+  if (!shl->HasOnlyOneNonEnvironmentUse()) {
+    return false;
+  }
+
+  // Constants are unique so we just compare pointer here.
+  if (shl->GetRight() != shr_amount) {
+    return false;
+  }
+
+  // Type of shift's value is always int so sign/zero extension only
+  // depends on the type of the shift (shr/ushr).
+  bool is_signed = instruction->IsShr();
+  DataType::Type conv_type =
+      is_signed ? source_integral_type : DataType::ToUnsigned(source_integral_type);
+
+  DCHECK(DataType::IsTypeConversionImplicit(conv_type, instruction->GetResultType()));
+
+  HInstruction* shl_value = shl->GetLeft();
+  HBasicBlock *block = instruction->GetBlock();
+
+  // We shouldn't introduce new implicit type conversions during simplification.
+  if (DataType::IsTypeConversionImplicit(shl_value->GetType(), conv_type)) {
+    instruction->ReplaceWith(shl_value);
+    instruction->GetBlock()->RemoveInstruction(instruction);
+  } else {
+    HTypeConversion* new_conversion =
+        new (block->GetGraph()->GetAllocator()) HTypeConversion(conv_type, shl_value);
+    block->ReplaceAndRemoveInstructionWith(instruction, new_conversion);
+  }
+
+  shl->GetBlock()->RemoveInstruction(shl);
+
+  return true;
+}
+
 void InstructionSimplifierVisitor::VisitShift(HBinaryOperation* instruction) {
   DCHECK(instruction->IsShl() || instruction->IsShr() || instruction->IsUShr());
   HInstruction* shift_amount = instruction->GetRight();
@@ -394,6 +504,11 @@
       RecordSimplification();
       return;
     }
+
+    if (TryReplaceShiftsByConstantWithTypeConversion(instruction)) {
+      RecordSimplification();
+      return;
+    }
   }
 
   // Shift operations implicitly mask the shift amount according to the type width. Get rid of
@@ -506,8 +621,7 @@
   size_t rdist = Int64FromConstant(ushr->GetRight()->AsConstant());
   size_t ldist = Int64FromConstant(shl->GetRight()->AsConstant());
   if (((ldist + rdist) & (reg_bits - 1)) == 0) {
-    ReplaceRotateWithRor(op, ushr, shl);
-    return true;
+    return ReplaceRotateWithRor(op, ushr, shl);
   }
   return false;
 }
@@ -528,6 +642,10 @@
 //    OP   dst, dst, tmp
 // with
 //    Ror  dst, x,   d
+//
+// Requires `d` to be non-zero for the HAdd and HXor case. If `d` is 0 the shifts and rotate are
+// no-ops and the `OP` is never executed. This is fine for HOr since the result is the same, but the
+// result is different for HAdd and HXor.
 bool InstructionSimplifierVisitor::TryReplaceWithRotateRegisterNegPattern(HBinaryOperation* op,
                                                                           HUShr* ushr,
                                                                           HShl* shl) {
@@ -535,11 +653,20 @@
   DCHECK(ushr->GetRight()->IsNeg() || shl->GetRight()->IsNeg());
   bool neg_is_left = shl->GetRight()->IsNeg();
   HNeg* neg = neg_is_left ? shl->GetRight()->AsNeg() : ushr->GetRight()->AsNeg();
-  // And the shift distance being negated is the distance being shifted the other way.
-  if (neg->InputAt(0) == (neg_is_left ? ushr->GetRight() : shl->GetRight())) {
-    ReplaceRotateWithRor(op, ushr, shl);
+  HInstruction* value = neg->InputAt(0);
+
+  // The shift distance being negated is the distance being shifted the other way.
+  if (value != (neg_is_left ? ushr->GetRight() : shl->GetRight())) {
+    return false;
   }
-  return false;
+
+  const bool needs_non_zero_value = !op->IsOr();
+  if (needs_non_zero_value) {
+    if (!value->IsConstant() || value->AsConstant()->IsArithmeticZero()) {
+      return false;
+    }
+  }
+  return ReplaceRotateWithRor(op, ushr, shl);
 }
 
 // Try replacing code looking like (x >>> d OP x << (#bits - d)):
@@ -947,67 +1074,6 @@
   return nullptr;
 }
 
-// TODO This should really be done by LSE itself since there is significantly
-// more information available there.
-void InstructionSimplifierVisitor::VisitPredicatedInstanceFieldGet(
-    HPredicatedInstanceFieldGet* pred_get) {
-  HInstruction* target = pred_get->GetTarget();
-  HInstruction* default_val = pred_get->GetDefaultValue();
-  if (target->IsNullConstant()) {
-    pred_get->ReplaceWith(default_val);
-    pred_get->GetBlock()->RemoveInstruction(pred_get);
-    RecordSimplification();
-    return;
-  } else if (!target->CanBeNull()) {
-    HInstruction* replace_with = new (GetGraph()->GetAllocator())
-        HInstanceFieldGet(pred_get->GetTarget(),
-                          pred_get->GetFieldInfo().GetField(),
-                          pred_get->GetFieldType(),
-                          pred_get->GetFieldOffset(),
-                          pred_get->IsVolatile(),
-                          pred_get->GetFieldInfo().GetFieldIndex(),
-                          pred_get->GetFieldInfo().GetDeclaringClassDefIndex(),
-                          pred_get->GetFieldInfo().GetDexFile(),
-                          pred_get->GetDexPc());
-    if (pred_get->GetType() == DataType::Type::kReference) {
-      replace_with->SetReferenceTypeInfoIfValid(pred_get->GetReferenceTypeInfo());
-    }
-    pred_get->GetBlock()->InsertInstructionBefore(replace_with, pred_get);
-    pred_get->ReplaceWith(replace_with);
-    pred_get->GetBlock()->RemoveInstruction(pred_get);
-    RecordSimplification();
-    return;
-  }
-  if (!target->IsPhi() || !default_val->IsPhi() || default_val->GetBlock() != target->GetBlock()) {
-    // The iget has already been reduced. We know the target or the phi
-    // selection will differ between the target and default.
-    return;
-  }
-  DCHECK_EQ(default_val->InputCount(), target->InputCount());
-  // In the same block both phis only one non-null we can remove the phi from default_val.
-  HInstruction* single_value = nullptr;
-  auto inputs = target->GetInputs();
-  for (auto [input, idx] : ZipCount(MakeIterationRange(inputs))) {
-    if (input->CanBeNull()) {
-      if (single_value == nullptr) {
-        single_value = default_val->InputAt(idx);
-      } else if (single_value != default_val->InputAt(idx) &&
-                 !single_value->Equals(default_val->InputAt(idx))) {
-        // Multiple values are associated with potential nulls, can't combine.
-        return;
-      }
-    }
-  }
-  DCHECK(single_value != nullptr) << "All target values are non-null but the phi as a whole still"
-                                  << " can be null? This should not be possible." << std::endl
-                                  << pred_get->DumpWithArgs();
-  if (single_value->StrictlyDominates(pred_get)) {
-    // Combine all the maybe null values into one.
-    pred_get->ReplaceInput(single_value, 0);
-    RecordSimplification();
-  }
-}
-
 void InstructionSimplifierVisitor::VisitSelect(HSelect* select) {
   HInstruction* replace_with = nullptr;
   HInstruction* condition = select->GetCondition();
@@ -1050,51 +1116,60 @@
     HInstruction* b = condition->InputAt(1);
     DataType::Type t_type = true_value->GetType();
     DataType::Type f_type = false_value->GetType();
-    // Here we have a <cmp> b ? true_value : false_value.
-    // Test if both values are compatible integral types (resulting MIN/MAX/ABS
-    // type will be int or long, like the condition). Replacements are general,
-    // but assume conditions prefer constants on the right.
     if (DataType::IsIntegralType(t_type) && DataType::Kind(t_type) == DataType::Kind(f_type)) {
-      // Allow a <  100 ? max(a, -100) : ..
-      //    or a > -100 ? min(a,  100) : ..
-      // to use min/max instead of a to detect nested min/max expressions.
-      HInstruction* new_a = AllowInMinMax(cmp, a, b, true_value);
-      if (new_a != nullptr) {
-        a = new_a;
-      }
-      // Try to replace typical integral MIN/MAX/ABS constructs.
-      if ((cmp == kCondLT || cmp == kCondLE || cmp == kCondGT || cmp == kCondGE) &&
-          ((a == true_value && b == false_value) ||
-           (b == true_value && a == false_value))) {
-        // Found a < b ? a : b (MIN) or a < b ? b : a (MAX)
-        //    or a > b ? a : b (MAX) or a > b ? b : a (MIN).
-        bool is_min = (cmp == kCondLT || cmp == kCondLE) == (a == true_value);
-        replace_with = NewIntegralMinMax(GetGraph()->GetAllocator(), a, b, select, is_min);
-      } else if (((cmp == kCondLT || cmp == kCondLE) && true_value->IsNeg()) ||
-                 ((cmp == kCondGT || cmp == kCondGE) && false_value->IsNeg())) {
-        bool negLeft = (cmp == kCondLT || cmp == kCondLE);
-        HInstruction* the_negated = negLeft ? true_value->InputAt(0) : false_value->InputAt(0);
-        HInstruction* not_negated = negLeft ? false_value : true_value;
-        if (a == the_negated && a == not_negated && IsInt64Value(b, 0)) {
-          // Found a < 0 ? -a :  a
-          //    or a > 0 ?  a : -a
-          // which can be replaced by ABS(a).
-          replace_with = NewIntegralAbs(GetGraph()->GetAllocator(), a, select);
+      if (cmp == kCondEQ || cmp == kCondNE) {
+        // Turns
+        // * Select[a, b, EQ(a,b)] / Select[a, b, EQ(b,a)] into a
+        // * Select[a, b, NE(a,b)] / Select[a, b, NE(b,a)] into b
+        // Note that the order in EQ/NE is irrelevant.
+        if ((a == true_value && b == false_value) || (a == false_value && b == true_value)) {
+          replace_with = cmp == kCondEQ ? false_value : true_value;
         }
-      } else if (true_value->IsSub() && false_value->IsSub()) {
-        HInstruction* true_sub1 = true_value->InputAt(0);
-        HInstruction* true_sub2 = true_value->InputAt(1);
-        HInstruction* false_sub1 = false_value->InputAt(0);
-        HInstruction* false_sub2 = false_value->InputAt(1);
-        if ((((cmp == kCondGT || cmp == kCondGE) &&
-              (a == true_sub1 && b == true_sub2 && a == false_sub2 && b == false_sub1)) ||
-             ((cmp == kCondLT || cmp == kCondLE) &&
-              (a == true_sub2 && b == true_sub1 && a == false_sub1 && b == false_sub2))) &&
-            AreLowerPrecisionArgs(t_type, a, b)) {
-          // Found a > b ? a - b  : b - a
-          //    or a < b ? b - a  : a - b
-          // which can be replaced by ABS(a - b) for lower precision operands a, b.
-          replace_with = NewIntegralAbs(GetGraph()->GetAllocator(), true_value, select);
+      } else {
+        // Test if both values are compatible integral types (resulting MIN/MAX/ABS
+        // type will be int or long, like the condition). Replacements are general,
+        // but assume conditions prefer constants on the right.
+
+        // Allow a <  100 ? max(a, -100) : ..
+        //    or a > -100 ? min(a,  100) : ..
+        // to use min/max instead of a to detect nested min/max expressions.
+        HInstruction* new_a = AllowInMinMax(cmp, a, b, true_value);
+        if (new_a != nullptr) {
+          a = new_a;
+        }
+        // Try to replace typical integral MIN/MAX/ABS constructs.
+        if ((cmp == kCondLT || cmp == kCondLE || cmp == kCondGT || cmp == kCondGE) &&
+            ((a == true_value && b == false_value) || (b == true_value && a == false_value))) {
+          // Found a < b ? a : b (MIN) or a < b ? b : a (MAX)
+          //    or a > b ? a : b (MAX) or a > b ? b : a (MIN).
+          bool is_min = (cmp == kCondLT || cmp == kCondLE) == (a == true_value);
+          replace_with = NewIntegralMinMax(GetGraph()->GetAllocator(), a, b, select, is_min);
+        } else if (((cmp == kCondLT || cmp == kCondLE) && true_value->IsNeg()) ||
+                   ((cmp == kCondGT || cmp == kCondGE) && false_value->IsNeg())) {
+          bool negLeft = (cmp == kCondLT || cmp == kCondLE);
+          HInstruction* the_negated = negLeft ? true_value->InputAt(0) : false_value->InputAt(0);
+          HInstruction* not_negated = negLeft ? false_value : true_value;
+          if (a == the_negated && a == not_negated && IsInt64Value(b, 0)) {
+            // Found a < 0 ? -a :  a
+            //    or a > 0 ?  a : -a
+            // which can be replaced by ABS(a).
+            replace_with = NewIntegralAbs(GetGraph()->GetAllocator(), a, select);
+          }
+        } else if (true_value->IsSub() && false_value->IsSub()) {
+          HInstruction* true_sub1 = true_value->InputAt(0);
+          HInstruction* true_sub2 = true_value->InputAt(1);
+          HInstruction* false_sub1 = false_value->InputAt(0);
+          HInstruction* false_sub2 = false_value->InputAt(1);
+          if ((((cmp == kCondGT || cmp == kCondGE) &&
+                (a == true_sub1 && b == true_sub2 && a == false_sub2 && b == false_sub1)) ||
+               ((cmp == kCondLT || cmp == kCondLE) &&
+                (a == true_sub2 && b == true_sub1 && a == false_sub1 && b == false_sub2))) &&
+              AreLowerPrecisionArgs(t_type, a, b)) {
+            // Found a > b ? a - b  : b - a
+            //    or a < b ? b - a  : a - b
+            // which can be replaced by ABS(a - b) for lower precision operands a, b.
+            replace_with = NewIntegralAbs(GetGraph()->GetAllocator(), true_value, select);
+          }
         }
       }
     }
@@ -1222,9 +1297,6 @@
   if (maybe_get->IsInstanceFieldGet()) {
     maybe_get->AsInstanceFieldGet()->SetType(new_type);
     return true;
-  } else if (maybe_get->IsPredicatedInstanceFieldGet()) {
-    maybe_get->AsPredicatedInstanceFieldGet()->SetType(new_type);
-    return true;
   } else if (maybe_get->IsStaticFieldGet()) {
     maybe_get->AsStaticFieldGet()->SetType(new_type);
     return true;
@@ -1456,24 +1528,26 @@
     }
   }
 
-  HNeg* neg = left_is_neg ? left->AsNeg() : right->AsNeg();
-  if (left_is_neg != right_is_neg && neg->HasOnlyOneNonEnvironmentUse()) {
-    // Replace code looking like
-    //    NEG tmp, b
-    //    ADD dst, a, tmp
-    // with
-    //    SUB dst, a, b
-    // We do not perform the optimization if the input negation has environment
-    // uses or multiple non-environment uses as it could lead to worse code. In
-    // particular, we do not want the live range of `b` to be extended if we are
-    // not sure the initial 'NEG' instruction can be removed.
-    HInstruction* other = left_is_neg ? right : left;
-    HSub* sub =
-        new(GetGraph()->GetAllocator()) HSub(instruction->GetType(), other, neg->GetInput());
-    instruction->GetBlock()->ReplaceAndRemoveInstructionWith(instruction, sub);
-    RecordSimplification();
-    neg->GetBlock()->RemoveInstruction(neg);
-    return;
+  if (left_is_neg != right_is_neg) {
+    HNeg* neg = left_is_neg ? left->AsNeg() : right->AsNeg();
+    if (neg->HasOnlyOneNonEnvironmentUse()) {
+      // Replace code looking like
+      //    NEG tmp, b
+      //    ADD dst, a, tmp
+      // with
+      //    SUB dst, a, b
+      // We do not perform the optimization if the input negation has environment
+      // uses or multiple non-environment uses as it could lead to worse code. In
+      // particular, we do not want the live range of `b` to be extended if we are
+      // not sure the initial 'NEG' instruction can be removed.
+      HInstruction* other = left_is_neg ? right : left;
+      HSub* sub =
+          new(GetGraph()->GetAllocator()) HSub(instruction->GetType(), other, neg->GetInput());
+      instruction->GetBlock()->ReplaceAndRemoveInstructionWith(instruction, sub);
+      RecordSimplification();
+      neg->GetBlock()->RemoveInstruction(neg);
+      return;
+    }
   }
 
   if (TryReplaceWithRotate(instruction)) {
@@ -1676,7 +1750,7 @@
   HInstruction* input_two = condition->InputAt(1);
   HLoadClass* load_class = input_one->IsLoadClass()
       ? input_one->AsLoadClass()
-      : input_two->AsLoadClass();
+      : input_two->AsLoadClassOrNull();
   if (load_class == nullptr) {
     return false;
   }
@@ -1688,8 +1762,8 @@
   }
 
   HInstanceFieldGet* field_get = (load_class == input_one)
-      ? input_two->AsInstanceFieldGet()
-      : input_one->AsInstanceFieldGet();
+      ? input_two->AsInstanceFieldGetOrNull()
+      : input_one->AsInstanceFieldGetOrNull();
   if (field_get == nullptr) {
     return false;
   }
@@ -2240,6 +2314,7 @@
   }
 
   if (left->IsAdd()) {
+    // Cases (x + y) - y = x, and (x + y) - x = y.
     // Replace code patterns looking like
     //    ADD dst1, x, y        ADD dst1, x, y
     //    SUB dst2, dst1, y     SUB dst2, dst1, x
@@ -2248,14 +2323,75 @@
     // SUB instruction is not needed in this case, we may use
     // one of inputs of ADD instead.
     // It is applicable to integral types only.
+    HAdd* add = left->AsAdd();
     DCHECK(DataType::IsIntegralType(type));
-    if (left->InputAt(1) == right) {
-      instruction->ReplaceWith(left->InputAt(0));
+    if (add->GetRight() == right) {
+      instruction->ReplaceWith(add->GetLeft());
       RecordSimplification();
       instruction->GetBlock()->RemoveInstruction(instruction);
       return;
-    } else if (left->InputAt(0) == right) {
-      instruction->ReplaceWith(left->InputAt(1));
+    } else if (add->GetLeft() == right) {
+      instruction->ReplaceWith(add->GetRight());
+      RecordSimplification();
+      instruction->GetBlock()->RemoveInstruction(instruction);
+      return;
+    }
+  } else if (right->IsAdd()) {
+    // Cases y - (x + y) = -x, and  x - (x + y) = -y.
+    // Replace code patterns looking like
+    //    ADD dst1, x, y        ADD dst1, x, y
+    //    SUB dst2, y, dst1     SUB dst2, x, dst1
+    // with
+    //    ADD dst1, x, y        ADD dst1, x, y
+    //    NEG x                 NEG y
+    // SUB instruction is not needed in this case, we may use
+    // one of inputs of ADD instead with a NEG.
+    // It is applicable to integral types only.
+    HAdd* add = right->AsAdd();
+    DCHECK(DataType::IsIntegralType(type));
+    if (add->GetRight() == left) {
+      HNeg* neg = new (GetGraph()->GetAllocator()) HNeg(add->GetType(), add->GetLeft());
+      instruction->GetBlock()->ReplaceAndRemoveInstructionWith(instruction, neg);
+      RecordSimplification();
+      return;
+    } else if (add->GetLeft() == left) {
+      HNeg* neg = new (GetGraph()->GetAllocator()) HNeg(add->GetType(), add->GetRight());
+      instruction->GetBlock()->ReplaceAndRemoveInstructionWith(instruction, neg);
+      RecordSimplification();
+      return;
+    }
+  } else if (left->IsSub()) {
+    // Case (x - y) - x = -y.
+    // Replace code patterns looking like
+    //    SUB dst1, x, y
+    //    SUB dst2, dst1, x
+    // with
+    //    SUB dst1, x, y
+    //    NEG y
+    // The second SUB is not needed in this case, we may use the second input of the first SUB
+    // instead with a NEG.
+    // It is applicable to integral types only.
+    HSub* sub = left->AsSub();
+    DCHECK(DataType::IsIntegralType(type));
+    if (sub->GetLeft() == right) {
+      HNeg* neg = new (GetGraph()->GetAllocator()) HNeg(sub->GetType(), sub->GetRight());
+      instruction->GetBlock()->ReplaceAndRemoveInstructionWith(instruction, neg);
+      RecordSimplification();
+      return;
+    }
+  } else if (right->IsSub()) {
+    // Case x - (x - y) = y.
+    // Replace code patterns looking like
+    //    SUB dst1, x, y
+    //    SUB dst2, x, dst1
+    // with
+    //    SUB dst1, x, y
+    // The second SUB is not needed in this case, we may use the second input of the first SUB.
+    // It is applicable to integral types only.
+    HSub* sub = right->AsSub();
+    DCHECK(DataType::IsIntegralType(type));
+    if (sub->GetLeft() == left) {
+      instruction->ReplaceWith(sub->GetRight());
       RecordSimplification();
       instruction->GetBlock()->RemoveInstruction(instruction);
       return;
@@ -2334,6 +2470,29 @@
   TryHandleAssociativeAndCommutativeOperation(instruction);
 }
 
+void InstructionSimplifierVisitor::SimplifyBoxUnbox(
+    HInvoke* instruction, ArtField* field, DataType::Type type) {
+  DCHECK(instruction->GetIntrinsic() == Intrinsics::kByteValueOf ||
+         instruction->GetIntrinsic() == Intrinsics::kShortValueOf ||
+         instruction->GetIntrinsic() == Intrinsics::kCharacterValueOf ||
+         instruction->GetIntrinsic() == Intrinsics::kIntegerValueOf);
+  const HUseList<HInstruction*>& uses = instruction->GetUses();
+  for (auto it = uses.begin(), end = uses.end(); it != end;) {
+    HInstruction* user = it->GetUser();
+    ++it;  // Increment the iterator before we potentially remove the node from the list.
+    if (user->IsInstanceFieldGet() &&
+        user->AsInstanceFieldGet()->GetFieldInfo().GetField() == field &&
+        // Note: Due to other simplifications, we may have an `HInstanceFieldGet` with
+        // a different type (Int8 vs. Uint8, Int16 vs. Uint16) for the same field.
+        // Do not optimize that case for now. (We would need to insert a `HTypeConversion`.)
+        user->GetType() == type) {
+      user->ReplaceWith(instruction->InputAt(0));
+      RecordSimplification();
+      // Do not remove `user` while we're iterating over the block's instructions. Let DCE do it.
+    }
+  }
+}
+
 void InstructionSimplifierVisitor::SimplifyStringEquals(HInvoke* instruction) {
   HInstruction* argument = instruction->InputAt(1);
   HInstruction* receiver = instruction->InputAt(0);
@@ -2372,7 +2531,9 @@
 
 void InstructionSimplifierVisitor::SimplifySystemArrayCopy(HInvoke* instruction) {
   HInstruction* source = instruction->InputAt(0);
+  HInstruction* source_pos = instruction->InputAt(1);
   HInstruction* destination = instruction->InputAt(2);
+  HInstruction* destination_pos = instruction->InputAt(3);
   HInstruction* count = instruction->InputAt(4);
   SystemArrayCopyOptimizations optimizations(instruction);
   if (CanEnsureNotNullAt(source, instruction)) {
@@ -2385,6 +2546,10 @@
     optimizations.SetDestinationIsSource();
   }
 
+  if (source_pos == destination_pos) {
+    optimizations.SetSourcePositionIsDestinationPosition();
+  }
+
   if (IsArrayLengthOf(count, source)) {
     optimizations.SetCountIsSourceLength();
   }
@@ -2985,6 +3150,12 @@
 
 void InstructionSimplifierVisitor::VisitInvoke(HInvoke* instruction) {
   switch (instruction->GetIntrinsic()) {
+#define SIMPLIFY_BOX_UNBOX(name, low, high, type, start_index) \
+    case Intrinsics::k ## name ## ValueOf: \
+      SimplifyBoxUnbox(instruction, WellKnownClasses::java_lang_##name##_value, type); \
+      break;
+    BOXED_TYPES(SIMPLIFY_BOX_UNBOX)
+#undef SIMPLIFY_BOX_UNBOX
     case Intrinsics::kStringEquals:
       SimplifyStringEquals(instruction);
       break;
@@ -3063,43 +3234,6 @@
     case Intrinsics::kVarHandleWeakCompareAndSetRelease:
       SimplifyVarHandleIntrinsic(instruction);
       break;
-    case Intrinsics::kIntegerRotateRight:
-    case Intrinsics::kLongRotateRight:
-    case Intrinsics::kIntegerRotateLeft:
-    case Intrinsics::kLongRotateLeft:
-    case Intrinsics::kIntegerCompare:
-    case Intrinsics::kLongCompare:
-    case Intrinsics::kIntegerSignum:
-    case Intrinsics::kLongSignum:
-    case Intrinsics::kFloatIsNaN:
-    case Intrinsics::kDoubleIsNaN:
-    case Intrinsics::kStringIsEmpty:
-    case Intrinsics::kUnsafeLoadFence:
-    case Intrinsics::kUnsafeStoreFence:
-    case Intrinsics::kUnsafeFullFence:
-    case Intrinsics::kJdkUnsafeLoadFence:
-    case Intrinsics::kJdkUnsafeStoreFence:
-    case Intrinsics::kJdkUnsafeFullFence:
-    case Intrinsics::kVarHandleFullFence:
-    case Intrinsics::kVarHandleAcquireFence:
-    case Intrinsics::kVarHandleReleaseFence:
-    case Intrinsics::kVarHandleLoadLoadFence:
-    case Intrinsics::kVarHandleStoreStoreFence:
-    case Intrinsics::kMathMinIntInt:
-    case Intrinsics::kMathMinLongLong:
-    case Intrinsics::kMathMinFloatFloat:
-    case Intrinsics::kMathMinDoubleDouble:
-    case Intrinsics::kMathMaxIntInt:
-    case Intrinsics::kMathMaxLongLong:
-    case Intrinsics::kMathMaxFloatFloat:
-    case Intrinsics::kMathMaxDoubleDouble:
-    case Intrinsics::kMathAbsInt:
-    case Intrinsics::kMathAbsLong:
-    case Intrinsics::kMathAbsFloat:
-    case Intrinsics::kMathAbsDouble:
-      // These are replaced by intermediate representation in the instruction builder.
-      LOG(FATAL) << "Unexpected " << static_cast<Intrinsics>(instruction->GetIntrinsic());
-      UNREACHABLE();
     default:
       break;
   }
@@ -3215,7 +3349,7 @@
   HInstruction* left = instruction->GetLeft();
   HInstruction* right = instruction->GetRight();
   // Variable names as described above.
-  HConstant* const2 = right->IsConstant() ? right->AsConstant() : left->AsConstant();
+  HConstant* const2 = right->IsConstant() ? right->AsConstant() : left->AsConstantOrNull();
   if (const2 == nullptr) {
     return false;
   }
@@ -3231,7 +3365,7 @@
   }
 
   left = y->GetLeft();
-  HConstant* const1 = left->IsConstant() ? left->AsConstant() : y->GetRight()->AsConstant();
+  HConstant* const1 = left->IsConstant() ? left->AsConstant() : y->GetRight()->AsConstantOrNull();
   if (const1 == nullptr) {
     return false;
   }
diff --git a/compiler/optimizing/instruction_simplifier_arm.cc b/compiler/optimizing/instruction_simplifier_arm.cc
index 05a518d..be4371f 100644
--- a/compiler/optimizing/instruction_simplifier_arm.cc
+++ b/compiler/optimizing/instruction_simplifier_arm.cc
@@ -33,8 +33,9 @@
 
 class InstructionSimplifierArmVisitor final : public HGraphVisitor {
  public:
-  InstructionSimplifierArmVisitor(HGraph* graph, OptimizingCompilerStats* stats)
-      : HGraphVisitor(graph), stats_(stats) {}
+  InstructionSimplifierArmVisitor(
+      HGraph* graph, CodeGenerator* codegen, OptimizingCompilerStats* stats)
+      : HGraphVisitor(graph), codegen_(codegen), stats_(stats) {}
 
  private:
   void RecordSimplification() {
@@ -78,6 +79,7 @@
   void VisitTypeConversion(HTypeConversion* instruction) override;
   void VisitUShr(HUShr* instruction) override;
 
+  CodeGenerator* codegen_;
   OptimizingCompilerStats* stats_;
 };
 
@@ -217,7 +219,8 @@
     return;
   }
 
-  if (TryExtractArrayAccessAddress(instruction,
+  if (TryExtractArrayAccessAddress(codegen_,
+                                   instruction,
                                    instruction->GetArray(),
                                    instruction->GetIndex(),
                                    data_offset)) {
@@ -238,7 +241,8 @@
     return;
   }
 
-  if (TryExtractArrayAccessAddress(instruction,
+  if (TryExtractArrayAccessAddress(codegen_,
+                                   instruction,
                                    instruction->GetArray(),
                                    instruction->GetIndex(),
                                    data_offset)) {
@@ -300,7 +304,7 @@
 }
 
 bool InstructionSimplifierArm::Run() {
-  InstructionSimplifierArmVisitor visitor(graph_, stats_);
+  InstructionSimplifierArmVisitor visitor(graph_, codegen_, stats_);
   visitor.VisitReversePostOrder();
   return true;
 }
diff --git a/compiler/optimizing/instruction_simplifier_arm.h b/compiler/optimizing/instruction_simplifier_arm.h
index 0517e4f..25cea7c 100644
--- a/compiler/optimizing/instruction_simplifier_arm.h
+++ b/compiler/optimizing/instruction_simplifier_arm.h
@@ -22,16 +22,23 @@
 #include "optimization.h"
 
 namespace art HIDDEN {
+
+class CodeGenerator;
+
 namespace arm {
 
 class InstructionSimplifierArm : public HOptimization {
  public:
-  InstructionSimplifierArm(HGraph* graph, OptimizingCompilerStats* stats)
-      : HOptimization(graph, kInstructionSimplifierArmPassName, stats) {}
+  InstructionSimplifierArm(HGraph* graph, CodeGenerator* codegen, OptimizingCompilerStats* stats)
+      : HOptimization(graph, kInstructionSimplifierArmPassName, stats),
+        codegen_(codegen) {}
 
   static constexpr const char* kInstructionSimplifierArmPassName = "instruction_simplifier_arm";
 
   bool Run() override;
+
+ private:
+  CodeGenerator* codegen_;
 };
 
 }  // namespace arm
diff --git a/compiler/optimizing/instruction_simplifier_arm64.cc b/compiler/optimizing/instruction_simplifier_arm64.cc
index 671900b..2c191dc 100644
--- a/compiler/optimizing/instruction_simplifier_arm64.cc
+++ b/compiler/optimizing/instruction_simplifier_arm64.cc
@@ -33,8 +33,9 @@
 
 class InstructionSimplifierArm64Visitor final : public HGraphVisitor {
  public:
-  InstructionSimplifierArm64Visitor(HGraph* graph, OptimizingCompilerStats* stats)
-      : HGraphVisitor(graph), stats_(stats) {}
+  InstructionSimplifierArm64Visitor(
+      HGraph* graph, CodeGenerator* codegen, OptimizingCompilerStats* stats)
+      : HGraphVisitor(graph), codegen_(codegen), stats_(stats) {}
 
  private:
   void RecordSimplification() {
@@ -84,6 +85,7 @@
   void VisitVecLoad(HVecLoad* instruction) override;
   void VisitVecStore(HVecStore* instruction) override;
 
+  CodeGenerator* codegen_;
   OptimizingCompilerStats* stats_;
 };
 
@@ -198,7 +200,8 @@
 
 void InstructionSimplifierArm64Visitor::VisitArrayGet(HArrayGet* instruction) {
   size_t data_offset = CodeGenerator::GetArrayDataOffset(instruction);
-  if (TryExtractArrayAccessAddress(instruction,
+  if (TryExtractArrayAccessAddress(codegen_,
+                                   instruction,
                                    instruction->GetArray(),
                                    instruction->GetIndex(),
                                    data_offset)) {
@@ -209,7 +212,8 @@
 void InstructionSimplifierArm64Visitor::VisitArraySet(HArraySet* instruction) {
   size_t access_size = DataType::Size(instruction->GetComponentType());
   size_t data_offset = mirror::Array::DataOffset(access_size).Uint32Value();
-  if (TryExtractArrayAccessAddress(instruction,
+  if (TryExtractArrayAccessAddress(codegen_,
+                                   instruction,
                                    instruction->GetArray(),
                                    instruction->GetIndex(),
                                    data_offset)) {
@@ -284,7 +288,7 @@
     size_t size = DataType::Size(instruction->GetPackedType());
     size_t offset = mirror::Array::DataOffset(size).Uint32Value();
     if (TryExtractArrayAccessAddress(
-            instruction, instruction->GetArray(), instruction->GetIndex(), offset)) {
+            codegen_, instruction, instruction->GetArray(), instruction->GetIndex(), offset)) {
       RecordSimplification();
     }
   }
@@ -298,14 +302,14 @@
     size_t size = DataType::Size(instruction->GetPackedType());
     size_t offset = mirror::Array::DataOffset(size).Uint32Value();
     if (TryExtractArrayAccessAddress(
-            instruction, instruction->GetArray(), instruction->GetIndex(), offset)) {
+            codegen_, instruction, instruction->GetArray(), instruction->GetIndex(), offset)) {
       RecordSimplification();
     }
   }
 }
 
 bool InstructionSimplifierArm64::Run() {
-  InstructionSimplifierArm64Visitor visitor(graph_, stats_);
+  InstructionSimplifierArm64Visitor visitor(graph_, codegen_, stats_);
   visitor.VisitReversePostOrder();
   return true;
 }
diff --git a/compiler/optimizing/instruction_simplifier_arm64.h b/compiler/optimizing/instruction_simplifier_arm64.h
index 374638a..5c57484 100644
--- a/compiler/optimizing/instruction_simplifier_arm64.h
+++ b/compiler/optimizing/instruction_simplifier_arm64.h
@@ -22,16 +22,23 @@
 #include "optimization.h"
 
 namespace art HIDDEN {
+
+class CodeGenerator;
+
 namespace arm64 {
 
 class InstructionSimplifierArm64 : public HOptimization {
  public:
-  InstructionSimplifierArm64(HGraph* graph, OptimizingCompilerStats* stats)
-      : HOptimization(graph, kInstructionSimplifierArm64PassName, stats) {}
+  InstructionSimplifierArm64(HGraph* graph, CodeGenerator* codegen, OptimizingCompilerStats* stats)
+      : HOptimization(graph, kInstructionSimplifierArm64PassName, stats),
+        codegen_(codegen) {}
 
   static constexpr const char* kInstructionSimplifierArm64PassName = "instruction_simplifier_arm64";
 
   bool Run() override;
+
+ private:
+  CodeGenerator* codegen_;
 };
 
 }  // namespace arm64
diff --git a/compiler/optimizing/instruction_simplifier_shared.cc b/compiler/optimizing/instruction_simplifier_shared.cc
index 34daae2..50ea2b9 100644
--- a/compiler/optimizing/instruction_simplifier_shared.cc
+++ b/compiler/optimizing/instruction_simplifier_shared.cc
@@ -16,6 +16,7 @@
 
 #include "instruction_simplifier_shared.h"
 
+#include "code_generator.h"
 #include "mirror/array-inl.h"
 
 namespace art HIDDEN {
@@ -229,7 +230,8 @@
 }
 
 
-bool TryExtractArrayAccessAddress(HInstruction* access,
+bool TryExtractArrayAccessAddress(CodeGenerator* codegen,
+                                  HInstruction* access,
                                   HInstruction* array,
                                   HInstruction* index,
                                   size_t data_offset) {
@@ -244,8 +246,7 @@
     // The access may require a runtime call or the original array pointer.
     return false;
   }
-  if (gUseReadBarrier &&
-      !kUseBakerReadBarrier &&
+  if (codegen->EmitNonBakerReadBarrier() &&
       access->IsArrayGet() &&
       access->GetType() == DataType::Type::kReference) {
     // For object arrays, the non-Baker read barrier instrumentation requires
diff --git a/compiler/optimizing/instruction_simplifier_shared.h b/compiler/optimizing/instruction_simplifier_shared.h
index ddc3a86..68148cf 100644
--- a/compiler/optimizing/instruction_simplifier_shared.h
+++ b/compiler/optimizing/instruction_simplifier_shared.h
@@ -22,6 +22,8 @@
 
 namespace art HIDDEN {
 
+class CodeGenerator;
+
 namespace helpers {
 
 inline bool CanFitInShifterOperand(HInstruction* instruction) {
@@ -54,7 +56,7 @@
 //   t3 = Sub(*, t2)
 inline bool IsSubRightSubLeftShl(HSub *sub) {
   HInstruction* right = sub->GetRight();
-  return right->IsSub() && right->AsSub()->GetLeft()->IsShl();;
+  return right->IsSub() && right->AsSub()->GetLeft()->IsShl();
 }
 
 }  // namespace helpers
@@ -64,7 +66,8 @@
 // a negated bitwise instruction.
 bool TryMergeNegatedInput(HBinaryOperation* op);
 
-bool TryExtractArrayAccessAddress(HInstruction* access,
+bool TryExtractArrayAccessAddress(CodeGenerator* codegen,
+                                  HInstruction* access,
                                   HInstruction* array,
                                   HInstruction* index,
                                   size_t data_offset);
diff --git a/compiler/optimizing/instruction_simplifier_test.cc b/compiler/optimizing/instruction_simplifier_test.cc
index 966f5b9..9f47995 100644
--- a/compiler/optimizing/instruction_simplifier_test.cc
+++ b/compiler/optimizing/instruction_simplifier_test.cc
@@ -134,260 +134,6 @@
 };
 
 // // ENTRY
-// switch (param) {
-// case 1:
-//   obj1 = param2; break;
-// case 2:
-//   obj1 = param3; break;
-// default:
-//   obj2 = new Obj();
-// }
-// val_phi = PHI[3,4,10]
-// target_phi = PHI[param2, param3, obj2]
-// return PredFieldGet[val_phi, target_phi] => PredFieldGet[val_phi, target_phi]
-TEST_F(InstructionSimplifierTest, SimplifyPredicatedFieldGetNoMerge) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "case1"},
-                                                  {"entry", "case2"},
-                                                  {"entry", "case3"},
-                                                  {"case1", "breturn"},
-                                                  {"case2", "breturn"},
-                                                  {"case3", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(case1);
-  GET_BLOCK(case2);
-  GET_BLOCK(case3);
-  GET_BLOCK(breturn);
-#undef GET_BLOCK
-
-  HInstruction* bool_value = MakeParam(DataType::Type::kInt32);
-  HInstruction* obj1_param = MakeParam(DataType::Type::kReference);
-  HInstruction* obj2_param = MakeParam(DataType::Type::kReference);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c4 = graph_->GetIntConstant(4);
-  HInstruction* c10 = graph_->GetIntConstant(10);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* switch_inst = new (GetAllocator()) HPackedSwitch(0, 2, bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(switch_inst);
-  ManuallyBuildEnvFor(cls, {});
-
-  HInstruction* goto_c1 = new (GetAllocator()) HGoto();
-  case1->AddInstruction(goto_c1);
-
-  HInstruction* goto_c2 = new (GetAllocator()) HGoto();
-  case2->AddInstruction(goto_c2);
-
-  HInstruction* obj3 = MakeNewInstance(cls);
-  HInstruction* goto_c3 = new (GetAllocator()) HGoto();
-  case3->AddInstruction(obj3);
-  case3->AddInstruction(goto_c3);
-
-  HPhi* val_phi = MakePhi({c3, c4, c10});
-  HPhi* obj_phi = MakePhi({obj1_param, obj2_param, obj3});
-  HPredicatedInstanceFieldGet* read_end =
-      new (GetAllocator()) HPredicatedInstanceFieldGet(obj_phi,
-                                                       nullptr,
-                                                       val_phi,
-                                                       val_phi->GetType(),
-                                                       MemberOffset(10),
-                                                       false,
-                                                       42,
-                                                       0,
-                                                       graph_->GetDexFile(),
-                                                       0);
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_end);
-  breturn->AddPhi(val_phi);
-  breturn->AddPhi(obj_phi);
-  breturn->AddInstruction(read_end);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformSimplification(blks);
-
-  EXPECT_INS_RETAINED(read_end);
-
-  EXPECT_INS_EQ(read_end->GetTarget(), obj_phi);
-  EXPECT_INS_EQ(read_end->GetDefaultValue(), val_phi);
-}
-
-// // ENTRY
-// switch (param) {
-// case 1:
-//   obj1 = param2; break;
-// case 2:
-//   obj1 = param3; break;
-// default:
-//   obj2 = new Obj();
-// }
-// val_phi = PHI[3,3,10]
-// target_phi = PHI[param2, param3, obj2]
-// return PredFieldGet[val_phi, target_phi] => PredFieldGet[3, target_phi]
-TEST_F(InstructionSimplifierTest, SimplifyPredicatedFieldGetMerge) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "case1"},
-                                                  {"entry", "case2"},
-                                                  {"entry", "case3"},
-                                                  {"case1", "breturn"},
-                                                  {"case2", "breturn"},
-                                                  {"case3", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(case1);
-  GET_BLOCK(case2);
-  GET_BLOCK(case3);
-  GET_BLOCK(breturn);
-#undef GET_BLOCK
-
-  HInstruction* bool_value = MakeParam(DataType::Type::kInt32);
-  HInstruction* obj1_param = MakeParam(DataType::Type::kReference);
-  HInstruction* obj2_param = MakeParam(DataType::Type::kReference);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c10 = graph_->GetIntConstant(10);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* switch_inst = new (GetAllocator()) HPackedSwitch(0, 2, bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(switch_inst);
-  ManuallyBuildEnvFor(cls, {});
-
-  HInstruction* goto_c1 = new (GetAllocator()) HGoto();
-  case1->AddInstruction(goto_c1);
-
-  HInstruction* goto_c2 = new (GetAllocator()) HGoto();
-  case2->AddInstruction(goto_c2);
-
-  HInstruction* obj3 = MakeNewInstance(cls);
-  HInstruction* goto_c3 = new (GetAllocator()) HGoto();
-  case3->AddInstruction(obj3);
-  case3->AddInstruction(goto_c3);
-
-  HPhi* val_phi = MakePhi({c3, c3, c10});
-  HPhi* obj_phi = MakePhi({obj1_param, obj2_param, obj3});
-  HPredicatedInstanceFieldGet* read_end =
-      new (GetAllocator()) HPredicatedInstanceFieldGet(obj_phi,
-                                                       nullptr,
-                                                       val_phi,
-                                                       val_phi->GetType(),
-                                                       MemberOffset(10),
-                                                       false,
-                                                       42,
-                                                       0,
-                                                       graph_->GetDexFile(),
-                                                       0);
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_end);
-  breturn->AddPhi(val_phi);
-  breturn->AddPhi(obj_phi);
-  breturn->AddInstruction(read_end);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformSimplification(blks);
-
-  EXPECT_FALSE(obj3->CanBeNull());
-  EXPECT_INS_RETAINED(read_end);
-
-  EXPECT_INS_EQ(read_end->GetTarget(), obj_phi);
-  EXPECT_INS_EQ(read_end->GetDefaultValue(), c3);
-}
-
-// // ENTRY
-// if (param) {
-//   obj1 = new Obj();
-// } else {
-//   obj2 = new Obj();
-// }
-// val_phi = PHI[3,10]
-// target_phi = PHI[obj1, obj2]
-// return PredFieldGet[val_phi, target_phi] => FieldGet[target_phi]
-TEST_F(InstructionSimplifierTest, SimplifyPredicatedFieldGetNoNull) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-  GET_BLOCK(breturn);
-#undef GET_BLOCK
-
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c10 = graph_->GetIntConstant(10);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-
-  HInstruction* obj1 = MakeNewInstance(cls);
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(obj1);
-  left->AddInstruction(goto_left);
-
-  HInstruction* obj2 = MakeNewInstance(cls);
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(obj2);
-  right->AddInstruction(goto_right);
-
-  HPhi* val_phi = MakePhi({c3, c10});
-  HPhi* obj_phi = MakePhi({obj1, obj2});
-  obj_phi->SetCanBeNull(false);
-  HInstruction* read_end = new (GetAllocator()) HPredicatedInstanceFieldGet(obj_phi,
-                                                                            nullptr,
-                                                                            val_phi,
-                                                                            val_phi->GetType(),
-                                                                            MemberOffset(10),
-                                                                            false,
-                                                                            42,
-                                                                            0,
-                                                                            graph_->GetDexFile(),
-                                                                            0);
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_end);
-  breturn->AddPhi(val_phi);
-  breturn->AddPhi(obj_phi);
-  breturn->AddInstruction(read_end);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformSimplification(blks);
-
-  EXPECT_FALSE(obj1->CanBeNull());
-  EXPECT_FALSE(obj2->CanBeNull());
-  EXPECT_INS_REMOVED(read_end);
-
-  HInstanceFieldGet* ifget = FindSingleInstruction<HInstanceFieldGet>(graph_, breturn);
-  ASSERT_NE(ifget, nullptr);
-  EXPECT_INS_EQ(ifget->InputAt(0), obj_phi);
-}
-
-// // ENTRY
 // obj = new Obj();
 // // Make sure this graph isn't broken
 // if (obj instanceof <other>) {
diff --git a/compiler/optimizing/intrinsic_objects.cc b/compiler/optimizing/intrinsic_objects.cc
index 7e54211..c625d43 100644
--- a/compiler/optimizing/intrinsic_objects.cc
+++ b/compiler/optimizing/intrinsic_objects.cc
@@ -19,29 +19,55 @@
 #include "art_field-inl.h"
 #include "base/casts.h"
 #include "base/logging.h"
-#include "image.h"
+#include "intrinsics.h"
+#include "oat/image.h"
 #include "obj_ptr-inl.h"
+#include "well_known_classes.h"
 
 namespace art HIDDEN {
 
 static constexpr size_t kIntrinsicObjectsOffset =
     enum_cast<size_t>(ImageHeader::kIntrinsicObjectsStart);
 
-ObjPtr<mirror::ObjectArray<mirror::Object>> IntrinsicObjects::LookupIntegerCache(
-    Thread* self, ClassLinker* class_linker) {
-  ObjPtr<mirror::Class> integer_cache_class = class_linker->LookupClass(
-      self, "Ljava/lang/Integer$IntegerCache;", /* class_loader= */ nullptr);
-  if (integer_cache_class == nullptr || !integer_cache_class->IsInitialized()) {
-    return nullptr;
-  }
-  ArtField* cache_field =
-      integer_cache_class->FindDeclaredStaticField("cache", "[Ljava/lang/Integer;");
-  CHECK(cache_field != nullptr);
-  ObjPtr<mirror::ObjectArray<mirror::Object>> integer_cache =
+template <typename T>
+static int32_t FillIntrinsicsObjects(
+    ArtField* cache_field,
+    ObjPtr<mirror::ObjectArray<mirror::Object>> live_objects,
+    int32_t expected_low,
+    int32_t expected_high,
+    T&& type_check,
+    int32_t index)
+    REQUIRES_SHARED(Locks::mutator_lock_) {
+  ObjPtr<mirror::ObjectArray<mirror::Object>> cache =
       ObjPtr<mirror::ObjectArray<mirror::Object>>::DownCast(
-          cache_field->GetObject(integer_cache_class));
-  CHECK(integer_cache != nullptr);
-  return integer_cache;
+          cache_field->GetObject(cache_field->GetDeclaringClass()));
+  int32_t length = expected_high - expected_low + 1;
+  DCHECK_EQ(length, cache->GetLength());
+  for (int32_t i = 0; i != length; ++i) {
+    ObjPtr<mirror::Object> value = cache->GetWithoutChecks(i);
+    live_objects->Set(index + i, value);
+    type_check(value, expected_low + i);
+  }
+  return index + length;
+}
+
+void IntrinsicObjects::FillIntrinsicObjects(
+    ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects, size_t start_index) {
+  DCHECK_EQ(start_index, ImageHeader::kIntrinsicObjectsStart);
+  int32_t index = dchecked_integral_cast<int32_t>(start_index);
+#define FILL_OBJECTS(name, low, high, type, offset) \
+  index = FillIntrinsicsObjects( \
+      WellKnownClasses::java_lang_ ##name ##_ ##name ##Cache_cache, \
+      boot_image_live_objects, \
+      low, \
+      high, \
+      [](ObjPtr<mirror::Object> obj, int32_t expected) REQUIRES_SHARED(Locks::mutator_lock_) { \
+        CHECK_EQ(expected, WellKnownClasses::java_lang_ ##name ##_value->Get ##name(obj)); \
+      }, \
+      index);
+  BOXED_TYPES(FILL_OBJECTS)
+#undef FILL_OBJECTS
+  DCHECK_EQ(dchecked_integral_cast<size_t>(index), start_index + GetNumberOfIntrinsicObjects());
 }
 
 static bool HasIntrinsicObjects(
@@ -53,43 +79,26 @@
   return length != kIntrinsicObjectsOffset;
 }
 
-ObjPtr<mirror::ObjectArray<mirror::Object>> IntrinsicObjects::GetIntegerValueOfCache(
-    ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects) {
-  if (!HasIntrinsicObjects(boot_image_live_objects)) {
-    return nullptr;  // No intrinsic objects.
-  }
-  // No need for read barrier for boot image object or for verifying the value that was just stored.
-  ObjPtr<mirror::Object> result =
-      boot_image_live_objects->GetWithoutChecks<kVerifyNone, kWithoutReadBarrier>(
-          kIntrinsicObjectsOffset);
-  DCHECK(result != nullptr);
-  DCHECK(result->IsObjectArray());
-  DCHECK(result->GetClass()->DescriptorEquals("[Ljava/lang/Integer;"));
-  return ObjPtr<mirror::ObjectArray<mirror::Object>>::DownCast(result);
-}
-
-ObjPtr<mirror::Object> IntrinsicObjects::GetIntegerValueOfObject(
+ObjPtr<mirror::Object> IntrinsicObjects::GetValueOfObject(
     ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects,
+    size_t start_index,
     uint32_t index) {
   DCHECK(HasIntrinsicObjects(boot_image_live_objects));
-  DCHECK_LT(index,
-            static_cast<uint32_t>(GetIntegerValueOfCache(boot_image_live_objects)->GetLength()));
-
   // No need for read barrier for boot image object or for verifying the value that was just stored.
   ObjPtr<mirror::Object> result =
       boot_image_live_objects->GetWithoutChecks<kVerifyNone, kWithoutReadBarrier>(
-          kIntrinsicObjectsOffset + /* skip the IntegerCache.cache */ 1u + index);
+          kIntrinsicObjectsOffset + start_index + index);
   DCHECK(result != nullptr);
-  DCHECK(result->GetClass()->DescriptorEquals("Ljava/lang/Integer;"));
   return result;
 }
 
-MemberOffset IntrinsicObjects::GetIntegerValueOfArrayDataOffset(
-    ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects) {
+MemberOffset IntrinsicObjects::GetValueOfArrayDataOffset(
+    ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects,
+    size_t start_index) {
   DCHECK(HasIntrinsicObjects(boot_image_live_objects));
   MemberOffset result =
-      mirror::ObjectArray<mirror::Object>::OffsetOfElement(kIntrinsicObjectsOffset + 1u);
-  DCHECK_EQ(GetIntegerValueOfObject(boot_image_live_objects, 0u),
+      mirror::ObjectArray<mirror::Object>::OffsetOfElement(kIntrinsicObjectsOffset + start_index);
+  DCHECK_EQ(GetValueOfObject(boot_image_live_objects, start_index, 0u),
             (boot_image_live_objects
                  ->GetFieldObject<mirror::Object, kVerifyNone, kWithoutReadBarrier>(result)));
   return result;
diff --git a/compiler/optimizing/intrinsic_objects.h b/compiler/optimizing/intrinsic_objects.h
index d750f29..52a6b81 100644
--- a/compiler/optimizing/intrinsic_objects.h
+++ b/compiler/optimizing/intrinsic_objects.h
@@ -21,11 +21,12 @@
 #include "base/bit_utils.h"
 #include "base/macros.h"
 #include "base/mutex.h"
+#include "obj_ptr.h"
+#include "offsets.h"
 
 namespace art HIDDEN {
 
 class ClassLinker;
-template <class MirrorType> class ObjPtr;
 class MemberOffset;
 class Thread;
 
@@ -34,17 +35,30 @@
 template <class T> class ObjectArray;
 }  // namespace mirror
 
+#define BOXED_TYPES(V) \
+  V(Byte, -128, 127, DataType::Type::kInt8, 0) \
+  V(Short, -128, 127, DataType::Type::kInt16, kByteCacheLastIndex) \
+  V(Character, 0, 127, DataType::Type::kUint16, kShortCacheLastIndex) \
+  V(Integer, -128, 127, DataType::Type::kInt32, kCharacterCacheLastIndex)
+
+#define DEFINE_BOXED_CONSTANTS(name, low, high, unused, start_index) \
+  static constexpr size_t k ##name ##CacheLastIndex = start_index + (high - low + 1); \
+  static constexpr size_t k ##name ##CacheFirstIndex = start_index;
+  BOXED_TYPES(DEFINE_BOXED_CONSTANTS)
+
+  static constexpr size_t kNumberOfBoxedCaches = kIntegerCacheLastIndex;
+#undef DEFINE_BOXED_CONSTANTS
+
 class IntrinsicObjects {
  public:
   enum class PatchType {
-    kIntegerValueOfObject,
-    kIntegerValueOfArray,
+    kValueOfObject,
+    kValueOfArray,
 
-    kLast = kIntegerValueOfArray
+    kLast = kValueOfArray
   };
 
   static uint32_t EncodePatch(PatchType patch_type, uint32_t index = 0u) {
-    DCHECK(patch_type == PatchType::kIntegerValueOfObject || index == 0u);
     return PatchTypeField::Encode(static_cast<uint32_t>(patch_type)) | IndexField::Encode(index);
   }
 
@@ -56,18 +70,37 @@
     return IndexField::Decode(intrinsic_data);
   }
 
-  // Functions for retrieving data for Integer.valueOf().
-  EXPORT static ObjPtr<mirror::ObjectArray<mirror::Object>> LookupIntegerCache(
-      Thread* self, ClassLinker* class_linker) REQUIRES_SHARED(Locks::mutator_lock_);
-  EXPORT static ObjPtr<mirror::ObjectArray<mirror::Object>> GetIntegerValueOfCache(
-      ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects)
+  // Helpers returning addresses of objects, suitable for embedding in generated code.
+#define DEFINE_BOXED_ACCESSES(name, unused1, unused2, unused3, start_index) \
+  static ObjPtr<mirror::Object> Get ##name ##ValueOfObject( \
+      ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects, \
+      uint32_t index) REQUIRES_SHARED(Locks::mutator_lock_) { \
+    return GetValueOfObject(boot_image_live_objects, k ##name ##CacheFirstIndex, index); \
+  } \
+  static MemberOffset Get ##name ##ValueOfArrayDataOffset( \
+      ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects) \
+      REQUIRES_SHARED(Locks::mutator_lock_) { \
+    return GetValueOfArrayDataOffset(boot_image_live_objects, k ##name ##CacheFirstIndex); \
+  }
+  BOXED_TYPES(DEFINE_BOXED_ACCESSES)
+#undef DEFINED_BOXED_ACCESSES
+
+  EXPORT static void FillIntrinsicObjects(
+      ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects, size_t start_index)
       REQUIRES_SHARED(Locks::mutator_lock_);
-  EXPORT static ObjPtr<mirror::Object> GetIntegerValueOfObject(
+
+  static constexpr size_t GetNumberOfIntrinsicObjects() {
+    return kNumberOfBoxedCaches;
+  }
+
+  EXPORT static ObjPtr<mirror::Object> GetValueOfObject(
       ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects,
+      size_t start_index,
       uint32_t index) REQUIRES_SHARED(Locks::mutator_lock_);
-  EXPORT static MemberOffset GetIntegerValueOfArrayDataOffset(
-      ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects)
-      REQUIRES_SHARED(Locks::mutator_lock_);
+
+  EXPORT static MemberOffset GetValueOfArrayDataOffset(
+      ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects,
+      size_t start_index) REQUIRES_SHARED(Locks::mutator_lock_);
 
  private:
   static constexpr size_t kPatchTypeBits =
diff --git a/compiler/optimizing/intrinsics.cc b/compiler/optimizing/intrinsics.cc
index 774deec..06ea1c6 100644
--- a/compiler/optimizing/intrinsics.cc
+++ b/compiler/optimizing/intrinsics.cc
@@ -25,12 +25,14 @@
 #include "dex/invoke_type.h"
 #include "driver/compiler_options.h"
 #include "gc/space/image_space.h"
-#include "image-inl.h"
 #include "intrinsic_objects.h"
+#include "intrinsics_list.h"
 #include "nodes.h"
+#include "oat/image-inl.h"
 #include "obj_ptr-inl.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread-current-inl.h"
+#include "well_known_classes-inl.h"
 
 namespace art HIDDEN {
 
@@ -43,22 +45,12 @@
     case Intrinsics::k ## Name: \
       os << # Name; \
       break;
-#include "intrinsics_list.h"
-      INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
-#undef STATIC_INTRINSICS_LIST
-#undef VIRTUAL_INTRINSICS_LIST
+      ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
 #undef OPTIMIZING_INTRINSICS
   }
   return os;
 }
 
-static const char kIntegerCacheDescriptor[] = "Ljava/lang/Integer$IntegerCache;";
-static const char kIntegerDescriptor[] = "Ljava/lang/Integer;";
-static const char kIntegerArrayDescriptor[] = "[Ljava/lang/Integer;";
-static const char kLowFieldName[] = "low";
-static const char kHighFieldName[] = "high";
-static const char kValueFieldName[] = "value";
-
 static ObjPtr<mirror::ObjectArray<mirror::Object>> GetBootImageLiveObjects()
     REQUIRES_SHARED(Locks::mutator_lock_) {
   gc::Heap* heap = Runtime::Current()->GetHeap();
@@ -73,79 +65,6 @@
   return boot_image_live_objects;
 }
 
-static ObjPtr<mirror::Class> LookupInitializedClass(Thread* self,
-                                                    ClassLinker* class_linker,
-                                                    const char* descriptor)
-        REQUIRES_SHARED(Locks::mutator_lock_) {
-  ObjPtr<mirror::Class> klass =
-      class_linker->LookupClass(self, descriptor, /* class_loader= */ nullptr);
-  DCHECK(klass != nullptr);
-  DCHECK(klass->IsInitialized());
-  return klass;
-}
-
-static ObjPtr<mirror::ObjectArray<mirror::Object>> GetIntegerCacheArray(
-    ObjPtr<mirror::Class> cache_class) REQUIRES_SHARED(Locks::mutator_lock_) {
-  ArtField* cache_field = cache_class->FindDeclaredStaticField("cache", kIntegerArrayDescriptor);
-  DCHECK(cache_field != nullptr);
-  return ObjPtr<mirror::ObjectArray<mirror::Object>>::DownCast(cache_field->GetObject(cache_class));
-}
-
-static int32_t GetIntegerCacheField(ObjPtr<mirror::Class> cache_class, const char* field_name)
-    REQUIRES_SHARED(Locks::mutator_lock_) {
-  ArtField* field = cache_class->FindDeclaredStaticField(field_name, "I");
-  DCHECK(field != nullptr);
-  return field->GetInt(cache_class);
-}
-
-static bool CheckIntegerCache(Thread* self,
-                              ClassLinker* class_linker,
-                              ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects,
-                              ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_cache)
-    REQUIRES_SHARED(Locks::mutator_lock_) {
-  DCHECK(boot_image_cache != nullptr);
-
-  // Since we have a cache in the boot image, both java.lang.Integer and
-  // java.lang.Integer$IntegerCache must be initialized in the boot image.
-  ObjPtr<mirror::Class> cache_class =
-      LookupInitializedClass(self, class_linker, kIntegerCacheDescriptor);
-  ObjPtr<mirror::Class> integer_class =
-      LookupInitializedClass(self, class_linker, kIntegerDescriptor);
-
-  // Check that the current cache is the same as the `boot_image_cache`.
-  ObjPtr<mirror::ObjectArray<mirror::Object>> current_cache = GetIntegerCacheArray(cache_class);
-  if (current_cache != boot_image_cache) {
-    return false;  // Messed up IntegerCache.cache.
-  }
-
-  // Check that the range matches the boot image cache length.
-  int32_t low = GetIntegerCacheField(cache_class, kLowFieldName);
-  int32_t high = GetIntegerCacheField(cache_class, kHighFieldName);
-  if (boot_image_cache->GetLength() != high - low + 1) {
-    return false;  // Messed up IntegerCache.low or IntegerCache.high.
-  }
-
-  // Check that the elements match the boot image intrinsic objects and check their values as well.
-  ArtField* value_field = integer_class->FindDeclaredInstanceField(kValueFieldName, "I");
-  DCHECK(value_field != nullptr);
-  for (int32_t i = 0, len = boot_image_cache->GetLength(); i != len; ++i) {
-    ObjPtr<mirror::Object> boot_image_object =
-        IntrinsicObjects::GetIntegerValueOfObject(boot_image_live_objects, i);
-    DCHECK(Runtime::Current()->GetHeap()->ObjectIsInBootImageSpace(boot_image_object));
-    // No need for read barrier for comparison with a boot image object.
-    ObjPtr<mirror::Object> current_object =
-        boot_image_cache->GetWithoutChecks<kVerifyNone, kWithoutReadBarrier>(i);
-    if (boot_image_object != current_object) {
-      return false;  // Messed up IntegerCache.cache[i]
-    }
-    if (value_field->GetInt(boot_image_object) != low + i) {
-      return false;  // Messed up IntegerCache.cache[i].value.
-    }
-  }
-
-  return true;
-}
-
 static bool CanReferenceBootImageObjects(HInvoke* invoke, const CompilerOptions& compiler_options) {
   // Piggyback on the method load kind to determine whether we can use PC-relative addressing
   // for AOT. This should cover both the testing config (non-PIC boot image) and codegens that
@@ -161,95 +80,24 @@
   return true;
 }
 
-void IntrinsicVisitor::ComputeIntegerValueOfLocations(HInvoke* invoke,
-                                                      CodeGenerator* codegen,
-                                                      Location return_location,
-                                                      Location first_argument_location) {
-  // The intrinsic will call if it needs to allocate a j.l.Integer.
+void IntrinsicVisitor::ComputeValueOfLocations(HInvoke* invoke,
+                                               CodeGenerator* codegen,
+                                               int32_t low,
+                                               int32_t length,
+                                               Location return_location,
+                                               Location first_argument_location) {
+  // The intrinsic will call if it needs to allocate a boxed object.
   LocationSummary::CallKind call_kind = LocationSummary::kCallOnMainOnly;
   const CompilerOptions& compiler_options = codegen->GetCompilerOptions();
   if (!CanReferenceBootImageObjects(invoke, compiler_options)) {
     return;
   }
   HInstruction* const input = invoke->InputAt(0);
-  if (compiler_options.IsBootImage()) {
-    if (!compiler_options.IsImageClass(kIntegerCacheDescriptor) ||
-        !compiler_options.IsImageClass(kIntegerDescriptor)) {
-      return;
-    }
-    ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
-    Thread* self = Thread::Current();
-    ScopedObjectAccess soa(self);
-    ObjPtr<mirror::Class> cache_class = class_linker->LookupClass(
-        self, kIntegerCacheDescriptor, /* class_loader= */ nullptr);
-    DCHECK(cache_class != nullptr);
-    if (UNLIKELY(!cache_class->IsInitialized())) {
-      LOG(WARNING) << "Image class " << cache_class->PrettyDescriptor() << " is uninitialized.";
-      return;
-    }
-    ObjPtr<mirror::Class> integer_class =
-        class_linker->LookupClass(self, kIntegerDescriptor, /* class_loader= */ nullptr);
-    DCHECK(integer_class != nullptr);
-    if (UNLIKELY(!integer_class->IsInitialized())) {
-      LOG(WARNING) << "Image class " << integer_class->PrettyDescriptor() << " is uninitialized.";
-      return;
-    }
-    int32_t low = GetIntegerCacheField(cache_class, kLowFieldName);
-    int32_t high = GetIntegerCacheField(cache_class, kHighFieldName);
-    if (kIsDebugBuild) {
-      ObjPtr<mirror::ObjectArray<mirror::Object>> current_cache = GetIntegerCacheArray(cache_class);
-      CHECK(current_cache != nullptr);
-      CHECK_EQ(current_cache->GetLength(), high - low + 1);
-      ArtField* value_field = integer_class->FindDeclaredInstanceField(kValueFieldName, "I");
-      CHECK(value_field != nullptr);
-      for (int32_t i = 0, len = current_cache->GetLength(); i != len; ++i) {
-        ObjPtr<mirror::Object> current_object = current_cache->GetWithoutChecks(i);
-        CHECK(current_object != nullptr);
-        CHECK_EQ(value_field->GetInt(current_object), low + i);
-      }
-    }
-    if (input->IsIntConstant()) {
-      int32_t value = input->AsIntConstant()->GetValue();
-      if (static_cast<uint32_t>(value) - static_cast<uint32_t>(low) <
-          static_cast<uint32_t>(high - low + 1)) {
-        // No call, we shall use direct pointer to the Integer object.
-        call_kind = LocationSummary::kNoCall;
-      }
-    }
-  } else {
-    Runtime* runtime = Runtime::Current();
-    Thread* self = Thread::Current();
-    ScopedObjectAccess soa(self);
-    ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects = GetBootImageLiveObjects();
-    ObjPtr<mirror::ObjectArray<mirror::Object>> cache =
-        IntrinsicObjects::GetIntegerValueOfCache(boot_image_live_objects);
-    if (cache == nullptr) {
-      return;  // No cache in the boot image.
-    }
-    if (compiler_options.IsJitCompiler()) {
-      if (!CheckIntegerCache(self, runtime->GetClassLinker(), boot_image_live_objects, cache)) {
-        return;  // The cache was somehow messed up, probably by using reflection.
-      }
-    } else {
-      DCHECK(compiler_options.IsAotCompiler());
-      DCHECK(CheckIntegerCache(self, runtime->GetClassLinker(), boot_image_live_objects, cache));
-      if (input->IsIntConstant()) {
-        int32_t value = input->AsIntConstant()->GetValue();
-        // Retrieve the `value` from the lowest cached Integer.
-        ObjPtr<mirror::Object> low_integer =
-            IntrinsicObjects::GetIntegerValueOfObject(boot_image_live_objects, 0u);
-        ObjPtr<mirror::Class> integer_class =
-            low_integer->GetClass<kVerifyNone, kWithoutReadBarrier>();
-        ArtField* value_field = integer_class->FindDeclaredInstanceField(kValueFieldName, "I");
-        DCHECK(value_field != nullptr);
-        int32_t low = value_field->GetInt(low_integer);
-        if (static_cast<uint32_t>(value) - static_cast<uint32_t>(low) <
-            static_cast<uint32_t>(cache->GetLength())) {
-          // No call, we shall use direct pointer to the Integer object. Note that we cannot
-          // do this for JIT as the "low" can change through reflection before emitting the code.
-          call_kind = LocationSummary::kNoCall;
-        }
-      }
+  if (input->IsIntConstant()) {
+    int32_t value = input->AsIntConstant()->GetValue();
+    if (static_cast<uint32_t>(value) - static_cast<uint32_t>(low) < static_cast<uint32_t>(length)) {
+      // No call, we shall use direct pointer to the boxed object.
+      call_kind = LocationSummary::kNoCall;
     }
   }
 
@@ -265,98 +113,58 @@
   }
 }
 
-static int32_t GetIntegerCacheLowFromIntegerCache(Thread* self, ClassLinker* class_linker)
-    REQUIRES_SHARED(Locks::mutator_lock_) {
-  ObjPtr<mirror::Class> cache_class =
-      LookupInitializedClass(self, class_linker, kIntegerCacheDescriptor);
-  return GetIntegerCacheField(cache_class, kLowFieldName);
-}
-
-inline IntrinsicVisitor::IntegerValueOfInfo::IntegerValueOfInfo()
+inline IntrinsicVisitor::ValueOfInfo::ValueOfInfo()
     : value_offset(0),
       low(0),
       length(0u),
       value_boot_image_reference(kInvalidReference) {}
 
-IntrinsicVisitor::IntegerValueOfInfo IntrinsicVisitor::ComputeIntegerValueOfInfo(
-    HInvoke* invoke, const CompilerOptions& compiler_options) {
-  // Note that we could cache all of the data looked up here. but there's no good
-  // location for it. We don't want to add it to WellKnownClasses, to avoid creating global
-  // jni values. Adding it as state to the compiler singleton seems like wrong
-  // separation of concerns.
-  // The need for this data should be pretty rare though.
-
-  // Note that at this point we can no longer abort the code generation. Therefore,
-  // we need to provide data that shall not lead to a crash even if the fields were
-  // modified through reflection since ComputeIntegerValueOfLocations() when JITting.
-
-  ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
-  Thread* self = Thread::Current();
-  ScopedObjectAccess soa(self);
-
-  IntegerValueOfInfo info;
+IntrinsicVisitor::ValueOfInfo IntrinsicVisitor::ComputeValueOfInfo(
+    HInvoke* invoke,
+    const CompilerOptions& compiler_options,
+    ArtField* value_field,
+    int32_t low,
+    int32_t length,
+    size_t base) {
+  ValueOfInfo info;
+  info.low = low;
+  info.length = length;
+  info.value_offset = value_field->GetOffset().Uint32Value();
   if (compiler_options.IsBootImage()) {
-    ObjPtr<mirror::Class> integer_class = invoke->GetResolvedMethod()->GetDeclaringClass();
-    DCHECK(integer_class->DescriptorEquals(kIntegerDescriptor));
-    ArtField* value_field = integer_class->FindDeclaredInstanceField(kValueFieldName, "I");
-    DCHECK(value_field != nullptr);
-    info.value_offset = value_field->GetOffset().Uint32Value();
-    ObjPtr<mirror::Class> cache_class =
-        LookupInitializedClass(self, class_linker, kIntegerCacheDescriptor);
-    info.low = GetIntegerCacheField(cache_class, kLowFieldName);
-    int32_t high = GetIntegerCacheField(cache_class, kHighFieldName);
-    info.length = dchecked_integral_cast<uint32_t>(high - info.low + 1);
-
     if (invoke->InputAt(0)->IsIntConstant()) {
       int32_t input_value = invoke->InputAt(0)->AsIntConstant()->GetValue();
       uint32_t index = static_cast<uint32_t>(input_value) - static_cast<uint32_t>(info.low);
       if (index < static_cast<uint32_t>(info.length)) {
         info.value_boot_image_reference = IntrinsicObjects::EncodePatch(
-            IntrinsicObjects::PatchType::kIntegerValueOfObject, index);
+            IntrinsicObjects::PatchType::kValueOfObject, index + base);
       } else {
         // Not in the cache.
-        info.value_boot_image_reference = IntegerValueOfInfo::kInvalidReference;
+        info.value_boot_image_reference = ValueOfInfo::kInvalidReference;
       }
     } else {
       info.array_data_boot_image_reference =
-          IntrinsicObjects::EncodePatch(IntrinsicObjects::PatchType::kIntegerValueOfArray);
+          IntrinsicObjects::EncodePatch(IntrinsicObjects::PatchType::kValueOfArray, base);
     }
   } else {
+    ScopedObjectAccess soa(Thread::Current());
     ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects = GetBootImageLiveObjects();
-    ObjPtr<mirror::Object> low_integer =
-        IntrinsicObjects::GetIntegerValueOfObject(boot_image_live_objects, 0u);
-    ObjPtr<mirror::Class> integer_class = low_integer->GetClass<kVerifyNone, kWithoutReadBarrier>();
-    ArtField* value_field = integer_class->FindDeclaredInstanceField(kValueFieldName, "I");
-    DCHECK(value_field != nullptr);
-    info.value_offset = value_field->GetOffset().Uint32Value();
-    if (compiler_options.IsJitCompiler()) {
-      // Use the current `IntegerCache.low` for JIT to avoid truly surprising behavior if the
-      // code messes up the `value` field in the lowest cached Integer using reflection.
-      info.low = GetIntegerCacheLowFromIntegerCache(self, class_linker);
-    } else {
-      // For app AOT, the `low_integer->value` should be the same as `IntegerCache.low`.
-      info.low = value_field->GetInt(low_integer);
-      DCHECK_EQ(info.low, GetIntegerCacheLowFromIntegerCache(self, class_linker));
-    }
-    // Do not look at `IntegerCache.high`, use the immutable length of the cache array instead.
-    info.length = dchecked_integral_cast<uint32_t>(
-        IntrinsicObjects::GetIntegerValueOfCache(boot_image_live_objects)->GetLength());
 
     if (invoke->InputAt(0)->IsIntConstant()) {
       int32_t input_value = invoke->InputAt(0)->AsIntConstant()->GetValue();
       uint32_t index = static_cast<uint32_t>(input_value) - static_cast<uint32_t>(info.low);
       if (index < static_cast<uint32_t>(info.length)) {
-        ObjPtr<mirror::Object> integer =
-            IntrinsicObjects::GetIntegerValueOfObject(boot_image_live_objects, index);
-        info.value_boot_image_reference = CodeGenerator::GetBootImageOffset(integer);
+        ObjPtr<mirror::Object> object =
+            IntrinsicObjects::GetValueOfObject(boot_image_live_objects, base, index);
+        info.value_boot_image_reference = CodeGenerator::GetBootImageOffset(object);
       } else {
         // Not in the cache.
-        info.value_boot_image_reference = IntegerValueOfInfo::kInvalidReference;
+        info.value_boot_image_reference = ValueOfInfo::kInvalidReference;
       }
     } else {
       info.array_data_boot_image_reference =
           CodeGenerator::GetBootImageOffset(boot_image_live_objects) +
-          IntrinsicObjects::GetIntegerValueOfArrayDataOffset(boot_image_live_objects).Uint32Value();
+          IntrinsicObjects::GetValueOfArrayDataOffset(
+              boot_image_live_objects, base).Uint32Value();
     }
   }
 
@@ -392,8 +200,8 @@
   locations->SetOut(Location::RequiresRegister());
 }
 
-void IntrinsicVisitor::CreateReferenceRefersToLocations(HInvoke* invoke) {
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+void IntrinsicVisitor::CreateReferenceRefersToLocations(HInvoke* invoke, CodeGenerator* codegen) {
+  if (codegen->EmitNonBakerReadBarrier()) {
     // Unimplemented for non-Baker read barrier.
     return;
   }
@@ -414,4 +222,54 @@
   }
 }
 
+void InsertFpToIntegralIntrinsic(HInvokeStaticOrDirect* invoke, size_t input_index) {
+  DCHECK_EQ(invoke->GetCodePtrLocation(), CodePtrLocation::kCallCriticalNative);
+  DCHECK(!invoke->GetBlock()->GetGraph()->IsDebuggable())
+      << "Unexpected direct @CriticalNative call in a debuggable graph!";
+  DCHECK_LT(input_index, invoke->GetNumberOfArguments());
+  HInstruction* input = invoke->InputAt(input_index);
+  DataType::Type input_type = input->GetType();
+  DCHECK(DataType::IsFloatingPointType(input_type));
+  bool is_double = (input_type == DataType::Type::kFloat64);
+  DataType::Type converted_type = is_double ? DataType::Type::kInt64 : DataType::Type::kInt32;
+  ArtMethod* resolved_method = is_double
+      ? WellKnownClasses::java_lang_Double_doubleToRawLongBits
+      : WellKnownClasses::java_lang_Float_floatToRawIntBits;
+  DCHECK(resolved_method != nullptr);
+  DCHECK(resolved_method->IsIntrinsic());
+  MethodReference target_method(nullptr, 0);
+  {
+    ScopedObjectAccess soa(Thread::Current());
+    target_method =
+        MethodReference(resolved_method->GetDexFile(), resolved_method->GetDexMethodIndex());
+  }
+  // Use arbitrary dispatch info that does not require the method argument.
+  HInvokeStaticOrDirect::DispatchInfo dispatch_info = {
+      MethodLoadKind::kBssEntry,
+      CodePtrLocation::kCallArtMethod,
+      /*method_load_data=*/ 0u
+  };
+  HBasicBlock* block = invoke->GetBlock();
+  ArenaAllocator* allocator = block->GetGraph()->GetAllocator();
+  HInvokeStaticOrDirect* new_input = new (allocator) HInvokeStaticOrDirect(
+      allocator,
+      /*number_of_arguments=*/ 1u,
+      converted_type,
+      invoke->GetDexPc(),
+      /*method_reference=*/ MethodReference(nullptr, dex::kDexNoIndex),
+      resolved_method,
+      dispatch_info,
+      kStatic,
+      target_method,
+      HInvokeStaticOrDirect::ClinitCheckRequirement::kNone,
+      /*enable_intrinsic_opt=*/ true);
+  // The intrinsic has no side effects and does not need the environment.
+  new_input->SetSideEffects(SideEffects::None());
+  IntrinsicOptimizations opt(new_input);
+  opt.SetDoesNotNeedEnvironment();
+  new_input->SetRawInputAt(0u, input);
+  block->InsertInstructionBefore(new_input, invoke);
+  invoke->ReplaceInput(new_input, input_index);
+}
+
 }  // namespace art
diff --git a/compiler/optimizing/intrinsics.h b/compiler/optimizing/intrinsics.h
index 893cd04..0a431b8 100644
--- a/compiler/optimizing/intrinsics.h
+++ b/compiler/optimizing/intrinsics.h
@@ -19,6 +19,7 @@
 
 #include "base/macros.h"
 #include "code_generator.h"
+#include "intrinsics_list.h"
 #include "nodes.h"
 #include "optimization.h"
 #include "parallel_move_resolver.h"
@@ -44,13 +45,23 @@
     switch (invoke->GetIntrinsic()) {
       case Intrinsics::kNone:
         return;
+
+#define OPTIMIZING_INTRINSICS_WITH_SPECIALIZED_HIR(Name, ...) \
+      case Intrinsics::k ## Name:
+        ART_INTRINSICS_WITH_SPECIALIZED_HIR_LIST(OPTIMIZING_INTRINSICS_WITH_SPECIALIZED_HIR)
+#undef OPTIMIZING_INTRINSICS_WITH_SPECIALIZED_HIR
+        // Note: clang++ can optimize this `switch` to a range check and a virtual dispatch
+        // with indexed load from the vtable using an adjusted `invoke->GetIntrinsic()`
+        // as the index. However, a non-empty `case` causes clang++ to produce much worse
+        // code, so we want to limit this check to debug builds only.
+        DCHECK(false) << "Unexpected intrinsic with HIR: " << invoke->GetIntrinsic();
+        return;
+
 #define OPTIMIZING_INTRINSICS(Name, ...) \
       case Intrinsics::k ## Name: \
         Visit ## Name(invoke);    \
         return;
-#include "intrinsics_list.h"
-        INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
-#undef INTRINSICS_LIST
+        ART_INTRINSICS_WITH_HINVOKE_LIST(OPTIMIZING_INTRINSICS)
 #undef OPTIMIZING_INTRINSICS
 
       // Do not put a default case. That way the compiler will complain if we missed a case.
@@ -59,13 +70,10 @@
 
   // Define visitor methods.
 
-#define OPTIMIZING_INTRINSICS(Name, ...) \
-  virtual void Visit ## Name(HInvoke* invoke ATTRIBUTE_UNUSED) { \
-  }
-#include "intrinsics_list.h"
-  INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
-#undef INTRINSICS_LIST
-#undef OPTIMIZING_INTRINSICS
+#define DECLARE_VISIT_INTRINSIC(Name, ...) \
+  virtual void Visit##Name([[maybe_unused]] HInvoke* invoke) = 0;
+  ART_INTRINSICS_WITH_HINVOKE_LIST(DECLARE_VISIT_INTRINSIC)
+#undef DECLARE_VISIT_INTRINSIC
 
   static void MoveArguments(HInvoke* invoke,
                             CodeGenerator* codegen,
@@ -99,19 +107,20 @@
     codegen->GetMoveResolver()->EmitNativeCode(&parallel_move);
   }
 
-  static void ComputeIntegerValueOfLocations(HInvoke* invoke,
-                                             CodeGenerator* codegen,
-                                             Location return_location,
-                                             Location first_argument_location);
+  static void ComputeValueOfLocations(HInvoke* invoke,
+                                      CodeGenerator* codegen,
+                                      int32_t low,
+                                      int32_t length,
+                                      Location return_location,
+                                      Location first_argument_location);
 
-  // Temporary data structure for holding Integer.valueOf data for generating code.
-  // We only use it if the boot image contains the IntegerCache objects.
-  struct IntegerValueOfInfo {
+  // Temporary data structure for holding BoxedType.valueOf data for generating code.
+  struct ValueOfInfo {
     static constexpr uint32_t kInvalidReference = static_cast<uint32_t>(-1);
 
-    IntegerValueOfInfo();
+    ValueOfInfo();
 
-    // Offset of the Integer.value field for initializing a newly allocated instance.
+    // Offset of the value field of the boxed object for initializing a newly allocated instance.
     uint32_t value_offset;
     // The low value in the cache.
     int32_t low;
@@ -134,13 +143,18 @@
     };
   };
 
-  static IntegerValueOfInfo ComputeIntegerValueOfInfo(
-      HInvoke* invoke, const CompilerOptions& compiler_options);
+  static ValueOfInfo ComputeValueOfInfo(
+      HInvoke* invoke,
+      const CompilerOptions& compiler_options,
+      ArtField* value_field,
+      int32_t low,
+      int32_t length,
+      size_t base);
 
   static MemberOffset GetReferenceDisableIntrinsicOffset();
   static MemberOffset GetReferenceSlowPathEnabledOffset();
   static void CreateReferenceGetReferentLocations(HInvoke* invoke, CodeGenerator* codegen);
-  static void CreateReferenceRefersToLocations(HInvoke* invoke);
+  static void CreateReferenceRefersToLocations(HInvoke* invoke, CodeGenerator* codegen);
 
  protected:
   IntrinsicVisitor() {}
@@ -151,6 +165,29 @@
   DISALLOW_COPY_AND_ASSIGN(IntrinsicVisitor);
 };
 
+static inline bool IsIntrinsicWithSpecializedHir(Intrinsics intrinsic) {
+  switch (intrinsic) {
+#define OPTIMIZING_INTRINSICS_WITH_SPECIALIZED_HIR(Name, ...) \
+    case Intrinsics::k ## Name:
+      ART_INTRINSICS_WITH_SPECIALIZED_HIR_LIST(OPTIMIZING_INTRINSICS_WITH_SPECIALIZED_HIR)
+#undef OPTIMIZING_INTRINSICS_WITH_SPECIALIZED_HIR
+      return true;
+    default:
+      return false;
+  }
+}
+
+static inline bool IsValidIntrinsicAfterBuilder(Intrinsics intrinsic) {
+  return !IsIntrinsicWithSpecializedHir(intrinsic) ||
+         // FIXME: The inliner can currently create graphs with any of the intrinsics with HIR.
+         // However, we are able to compensate for `StringCharAt` and `StringLength` in the
+         // `HInstructionSimplifier`, so we're allowing these two intrinsics for now, preserving
+         // the old behavior. Besides fixing the bug, we should also clean up the simplifier
+         // and remove `SimplifyStringCharAt` and `SimplifyStringLength`. Bug: 319045458
+         intrinsic == Intrinsics::kStringCharAt ||
+         intrinsic == Intrinsics::kStringLength;
+}
+
 #define GENERIC_OPTIMIZATION(name, bit)                \
 public:                                                \
 void Set##name() { SetBit(k##name); }                  \
@@ -220,6 +257,7 @@
   INTRINSIC_OPTIMIZATION(DestinationIsPrimitiveArray, 8);
   INTRINSIC_OPTIMIZATION(SourceIsNonPrimitiveArray, 9);
   INTRINSIC_OPTIMIZATION(SourceIsPrimitiveArray, 10);
+  INTRINSIC_OPTIMIZATION(SourcePositionIsDestinationPosition, 11);
 
  private:
   DISALLOW_COPY_AND_ASSIGN(SystemArrayCopyOptimizations);
@@ -254,11 +292,9 @@
 // intrinsic to exploit e.g. no side-effects or exceptions, but otherwise not handled
 // by this architecture-specific intrinsics code generator. Eventually it is implemented
 // as a true method call.
-#define UNIMPLEMENTED_INTRINSIC(Arch, Name)                                               \
-void IntrinsicLocationsBuilder ## Arch::Visit ## Name(HInvoke* invoke ATTRIBUTE_UNUSED) { \
-}                                                                                         \
-void IntrinsicCodeGenerator ## Arch::Visit ## Name(HInvoke* invoke ATTRIBUTE_UNUSED) {    \
-}
+#define UNIMPLEMENTED_INTRINSIC(Arch, Name)                                              \
+  void IntrinsicLocationsBuilder##Arch::Visit##Name([[maybe_unused]] HInvoke* invoke) {} \
+  void IntrinsicCodeGenerator##Arch::Visit##Name([[maybe_unused]] HInvoke* invoke) {}
 
 // Defines a list of unreached intrinsics: that is, method calls that are recognized as
 // an intrinsic, and then always converted into HIR instructions before they reach any
@@ -277,44 +313,8 @@
              << " should have been converted to HIR";                    \
 }
 #define UNREACHABLE_INTRINSICS(Arch)                            \
-UNREACHABLE_INTRINSIC(Arch, MathMinIntInt)                      \
-UNREACHABLE_INTRINSIC(Arch, MathMinLongLong)                    \
-UNREACHABLE_INTRINSIC(Arch, MathMinFloatFloat)                  \
-UNREACHABLE_INTRINSIC(Arch, MathMinDoubleDouble)                \
-UNREACHABLE_INTRINSIC(Arch, MathMaxIntInt)                      \
-UNREACHABLE_INTRINSIC(Arch, MathMaxLongLong)                    \
-UNREACHABLE_INTRINSIC(Arch, MathMaxFloatFloat)                  \
-UNREACHABLE_INTRINSIC(Arch, MathMaxDoubleDouble)                \
-UNREACHABLE_INTRINSIC(Arch, MathAbsInt)                         \
-UNREACHABLE_INTRINSIC(Arch, MathAbsLong)                        \
-UNREACHABLE_INTRINSIC(Arch, MathAbsFloat)                       \
-UNREACHABLE_INTRINSIC(Arch, MathAbsDouble)                      \
 UNREACHABLE_INTRINSIC(Arch, FloatFloatToIntBits)                \
-UNREACHABLE_INTRINSIC(Arch, DoubleDoubleToLongBits)             \
-UNREACHABLE_INTRINSIC(Arch, FloatIsNaN)                         \
-UNREACHABLE_INTRINSIC(Arch, DoubleIsNaN)                        \
-UNREACHABLE_INTRINSIC(Arch, IntegerRotateLeft)                  \
-UNREACHABLE_INTRINSIC(Arch, LongRotateLeft)                     \
-UNREACHABLE_INTRINSIC(Arch, IntegerRotateRight)                 \
-UNREACHABLE_INTRINSIC(Arch, LongRotateRight)                    \
-UNREACHABLE_INTRINSIC(Arch, IntegerCompare)                     \
-UNREACHABLE_INTRINSIC(Arch, LongCompare)                        \
-UNREACHABLE_INTRINSIC(Arch, IntegerSignum)                      \
-UNREACHABLE_INTRINSIC(Arch, LongSignum)                         \
-UNREACHABLE_INTRINSIC(Arch, StringCharAt)                       \
-UNREACHABLE_INTRINSIC(Arch, StringIsEmpty)                      \
-UNREACHABLE_INTRINSIC(Arch, StringLength)                       \
-UNREACHABLE_INTRINSIC(Arch, UnsafeLoadFence)                    \
-UNREACHABLE_INTRINSIC(Arch, UnsafeStoreFence)                   \
-UNREACHABLE_INTRINSIC(Arch, UnsafeFullFence)                    \
-UNREACHABLE_INTRINSIC(Arch, JdkUnsafeLoadFence)                 \
-UNREACHABLE_INTRINSIC(Arch, JdkUnsafeStoreFence)                \
-UNREACHABLE_INTRINSIC(Arch, JdkUnsafeFullFence)                 \
-UNREACHABLE_INTRINSIC(Arch, VarHandleFullFence)                 \
-UNREACHABLE_INTRINSIC(Arch, VarHandleAcquireFence)              \
-UNREACHABLE_INTRINSIC(Arch, VarHandleReleaseFence)              \
-UNREACHABLE_INTRINSIC(Arch, VarHandleLoadLoadFence)             \
-UNREACHABLE_INTRINSIC(Arch, VarHandleStoreStoreFence)
+UNREACHABLE_INTRINSIC(Arch, DoubleDoubleToLongBits)
 
 template <typename IntrinsicLocationsBuilder, typename Codegenerator>
 bool IsCallFreeIntrinsic(HInvoke* invoke, Codegenerator* codegen) {
@@ -334,6 +334,11 @@
   return false;
 }
 
+// Insert a `Float.floatToRawIntBits()` or `Double.doubleToRawLongBits()` intrinsic for a
+// given input. These fake calls are needed on arm and riscv64 to satisfy type consistency
+// checks while passing certain FP args in core registers for direct @CriticalNative calls.
+void InsertFpToIntegralIntrinsic(HInvokeStaticOrDirect* invoke, size_t input_index);
+
 }  // namespace art
 
 #endif  // ART_COMPILER_OPTIMIZING_INTRINSICS_H_
diff --git a/compiler/optimizing/intrinsics_arm64.cc b/compiler/optimizing/intrinsics_arm64.cc
index 6307f92..56a5186 100644
--- a/compiler/optimizing/intrinsics_arm64.cc
+++ b/compiler/optimizing/intrinsics_arm64.cc
@@ -25,6 +25,7 @@
 #include "data_type-inl.h"
 #include "entrypoints/quick/quick_entrypoints.h"
 #include "heap_poisoning.h"
+#include "intrinsic_objects.h"
 #include "intrinsics.h"
 #include "intrinsics_utils.h"
 #include "lock_word.h"
@@ -36,6 +37,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread-current-inl.h"
 #include "utils/arm64/assembler_arm64.h"
+#include "well_known_classes.h"
 
 using namespace vixl::aarch64;  // NOLINT(build/namespaces)
 
@@ -91,11 +93,10 @@
  public:
   ReadBarrierSystemArrayCopySlowPathARM64(HInstruction* instruction, Location tmp)
       : SlowPathCodeARM64(instruction), tmp_(tmp) {
-    DCHECK(gUseReadBarrier);
-    DCHECK(kUseBakerReadBarrier);
   }
 
   void EmitNativeCode(CodeGenerator* codegen_in) override {
+    DCHECK(codegen_in->EmitBakerReadBarrier());
     CodeGeneratorARM64* codegen = down_cast<CodeGeneratorARM64*>(codegen_in);
     LocationSummary* locations = instruction_->GetLocations();
     DCHECK(locations->CanCall());
@@ -113,6 +114,7 @@
     Register tmp_reg = WRegisterFrom(tmp_);
 
     __ Bind(GetEntryLabel());
+    // The source range and destination pointer were initialized before entering the slow-path.
     vixl::aarch64::Label slow_copy_loop;
     __ Bind(&slow_copy_loop);
     __ Ldr(tmp_reg, MemOperand(src_curr_addr, element_size, PostIndex));
@@ -711,7 +713,7 @@
   Location trg_loc = locations->Out();
   Register trg = RegisterFrom(trg_loc, type);
 
-  if (type == DataType::Type::kReference && gUseReadBarrier && kUseBakerReadBarrier) {
+  if (type == DataType::Type::kReference && codegen->EmitBakerReadBarrier()) {
     // UnsafeGetObject/UnsafeGetObjectVolatile with Baker's read barrier case.
     Register temp = WRegisterFrom(locations->GetTemp(0));
     MacroAssembler* masm = codegen->GetVIXLAssembler();
@@ -739,22 +741,10 @@
   }
 }
 
-static bool UnsafeGetIntrinsicOnCallList(Intrinsics intrinsic) {
-  switch (intrinsic) {
-    case Intrinsics::kUnsafeGetObject:
-    case Intrinsics::kUnsafeGetObjectVolatile:
-    case Intrinsics::kJdkUnsafeGetObject:
-    case Intrinsics::kJdkUnsafeGetObjectVolatile:
-    case Intrinsics::kJdkUnsafeGetObjectAcquire:
-      return true;
-    default:
-      break;
-  }
-  return false;
-}
-
-static void CreateIntIntIntToIntLocations(ArenaAllocator* allocator, HInvoke* invoke) {
-  bool can_call = gUseReadBarrier && UnsafeGetIntrinsicOnCallList(invoke->GetIntrinsic());
+static void CreateUnsafeGetLocations(ArenaAllocator* allocator,
+                                     HInvoke* invoke,
+                                     CodeGeneratorARM64* codegen) {
+  bool can_call = codegen->EmitReadBarrier() && IsUnsafeGetReference(invoke);
   LocationSummary* locations =
       new (allocator) LocationSummary(invoke,
                                       can_call
@@ -787,44 +777,44 @@
   VisitJdkUnsafeGetLongVolatile(invoke);
 }
 void IntrinsicLocationsBuilderARM64::VisitUnsafeGetObject(HInvoke* invoke) {
-  VisitJdkUnsafeGetObject(invoke);
+  VisitJdkUnsafeGetReference(invoke);
 }
 void IntrinsicLocationsBuilderARM64::VisitUnsafeGetObjectVolatile(HInvoke* invoke) {
-  VisitJdkUnsafeGetObjectVolatile(invoke);
+  VisitJdkUnsafeGetReferenceVolatile(invoke);
 }
 void IntrinsicLocationsBuilderARM64::VisitUnsafeGetByte(HInvoke* invoke) {
   VisitJdkUnsafeGetByte(invoke);
 }
 
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGet(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetVolatile(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetAcquire(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetLong(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetLongVolatile(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetLongAcquire(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
 }
-void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetObject(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetReference(HInvoke* invoke) {
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
 }
-void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetObjectVolatile(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetReferenceVolatile(HInvoke* invoke) {
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
 }
-void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetObjectAcquire(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetReferenceAcquire(HInvoke* invoke) {
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetByte(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitUnsafeGet(HInvoke* invoke) {
@@ -840,10 +830,10 @@
   VisitJdkUnsafeGetLongVolatile(invoke);
 }
 void IntrinsicCodeGeneratorARM64::VisitUnsafeGetObject(HInvoke* invoke) {
-  VisitJdkUnsafeGetObject(invoke);
+  VisitJdkUnsafeGetReference(invoke);
 }
 void IntrinsicCodeGeneratorARM64::VisitUnsafeGetObjectVolatile(HInvoke* invoke) {
-  VisitJdkUnsafeGetObjectVolatile(invoke);
+  VisitJdkUnsafeGetReferenceVolatile(invoke);
 }
 void IntrinsicCodeGeneratorARM64::VisitUnsafeGetByte(HInvoke* invoke) {
   VisitJdkUnsafeGetByte(invoke);
@@ -867,20 +857,20 @@
 void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeGetLongAcquire(HInvoke* invoke) {
   GenUnsafeGet(invoke, DataType::Type::kInt64, /*is_volatile=*/ true, codegen_);
 }
-void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeGetObject(HInvoke* invoke) {
+void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeGetReference(HInvoke* invoke) {
   GenUnsafeGet(invoke, DataType::Type::kReference, /*is_volatile=*/ false, codegen_);
 }
-void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeGetObjectVolatile(HInvoke* invoke) {
+void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeGetReferenceVolatile(HInvoke* invoke) {
   GenUnsafeGet(invoke, DataType::Type::kReference, /*is_volatile=*/ true, codegen_);
 }
-void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeGetObjectAcquire(HInvoke* invoke) {
+void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeGetReferenceAcquire(HInvoke* invoke) {
   GenUnsafeGet(invoke, DataType::Type::kReference, /*is_volatile=*/ true, codegen_);
 }
 void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeGetByte(HInvoke* invoke) {
   GenUnsafeGet(invoke, DataType::Type::kInt8, /*is_volatile=*/ false, codegen_);
 }
 
-static void CreateIntIntIntIntToVoid(ArenaAllocator* allocator, HInvoke* invoke) {
+static void CreateUnsafePutLocations(ArenaAllocator* allocator, HInvoke* invoke) {
   LocationSummary* locations =
       new (allocator) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
   locations->SetInAt(0, Location::NoLocation());        // Unused receiver.
@@ -899,13 +889,13 @@
   VisitJdkUnsafePutVolatile(invoke);
 }
 void IntrinsicLocationsBuilderARM64::VisitUnsafePutObject(HInvoke* invoke) {
-  VisitJdkUnsafePutObject(invoke);
+  VisitJdkUnsafePutReference(invoke);
 }
 void IntrinsicLocationsBuilderARM64::VisitUnsafePutObjectOrdered(HInvoke* invoke) {
   VisitJdkUnsafePutObjectOrdered(invoke);
 }
 void IntrinsicLocationsBuilderARM64::VisitUnsafePutObjectVolatile(HInvoke* invoke) {
-  VisitJdkUnsafePutObjectVolatile(invoke);
+  VisitJdkUnsafePutReferenceVolatile(invoke);
 }
 void IntrinsicLocationsBuilderARM64::VisitUnsafePutLong(HInvoke* invoke) {
   VisitJdkUnsafePutLong(invoke);
@@ -921,43 +911,43 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafePut(HInvoke* invoke) {
-  CreateIntIntIntIntToVoid(allocator_, invoke);
+  CreateUnsafePutLocations(allocator_, invoke);
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafePutOrdered(HInvoke* invoke) {
-  CreateIntIntIntIntToVoid(allocator_, invoke);
+  CreateUnsafePutLocations(allocator_, invoke);
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafePutVolatile(HInvoke* invoke) {
-  CreateIntIntIntIntToVoid(allocator_, invoke);
+  CreateUnsafePutLocations(allocator_, invoke);
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafePutRelease(HInvoke* invoke) {
-  CreateIntIntIntIntToVoid(allocator_, invoke);
+  CreateUnsafePutLocations(allocator_, invoke);
 }
-void IntrinsicLocationsBuilderARM64::VisitJdkUnsafePutObject(HInvoke* invoke) {
-  CreateIntIntIntIntToVoid(allocator_, invoke);
+void IntrinsicLocationsBuilderARM64::VisitJdkUnsafePutReference(HInvoke* invoke) {
+  CreateUnsafePutLocations(allocator_, invoke);
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafePutObjectOrdered(HInvoke* invoke) {
-  CreateIntIntIntIntToVoid(allocator_, invoke);
+  CreateUnsafePutLocations(allocator_, invoke);
 }
-void IntrinsicLocationsBuilderARM64::VisitJdkUnsafePutObjectVolatile(HInvoke* invoke) {
-  CreateIntIntIntIntToVoid(allocator_, invoke);
+void IntrinsicLocationsBuilderARM64::VisitJdkUnsafePutReferenceVolatile(HInvoke* invoke) {
+  CreateUnsafePutLocations(allocator_, invoke);
 }
-void IntrinsicLocationsBuilderARM64::VisitJdkUnsafePutObjectRelease(HInvoke* invoke) {
-  CreateIntIntIntIntToVoid(allocator_, invoke);
+void IntrinsicLocationsBuilderARM64::VisitJdkUnsafePutReferenceRelease(HInvoke* invoke) {
+  CreateUnsafePutLocations(allocator_, invoke);
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafePutLong(HInvoke* invoke) {
-  CreateIntIntIntIntToVoid(allocator_, invoke);
+  CreateUnsafePutLocations(allocator_, invoke);
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafePutLongOrdered(HInvoke* invoke) {
-  CreateIntIntIntIntToVoid(allocator_, invoke);
+  CreateUnsafePutLocations(allocator_, invoke);
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafePutLongVolatile(HInvoke* invoke) {
-  CreateIntIntIntIntToVoid(allocator_, invoke);
+  CreateUnsafePutLocations(allocator_, invoke);
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafePutLongRelease(HInvoke* invoke) {
-  CreateIntIntIntIntToVoid(allocator_, invoke);
+  CreateUnsafePutLocations(allocator_, invoke);
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafePutByte(HInvoke* invoke) {
-  CreateIntIntIntIntToVoid(allocator_, invoke);
+  CreateUnsafePutLocations(allocator_, invoke);
 }
 
 static void GenUnsafePut(HInvoke* invoke,
@@ -996,7 +986,7 @@
 
   if (type == DataType::Type::kReference) {
     bool value_can_be_null = true;  // TODO: Worth finding out this information?
-    codegen->MarkGCCard(base, value, value_can_be_null);
+    codegen->MaybeMarkGCCard(base, value, value_can_be_null);
   }
 }
 
@@ -1010,13 +1000,13 @@
   VisitJdkUnsafePutVolatile(invoke);
 }
 void IntrinsicCodeGeneratorARM64::VisitUnsafePutObject(HInvoke* invoke) {
-  VisitJdkUnsafePutObject(invoke);
+  VisitJdkUnsafePutReference(invoke);
 }
 void IntrinsicCodeGeneratorARM64::VisitUnsafePutObjectOrdered(HInvoke* invoke) {
   VisitJdkUnsafePutObjectOrdered(invoke);
 }
 void IntrinsicCodeGeneratorARM64::VisitUnsafePutObjectVolatile(HInvoke* invoke) {
-  VisitJdkUnsafePutObjectVolatile(invoke);
+  VisitJdkUnsafePutReferenceVolatile(invoke);
 }
 void IntrinsicCodeGeneratorARM64::VisitUnsafePutLong(HInvoke* invoke) {
   VisitJdkUnsafePutLong(invoke);
@@ -1059,7 +1049,7 @@
                /*is_ordered=*/ false,
                codegen_);
 }
-void IntrinsicCodeGeneratorARM64::VisitJdkUnsafePutObject(HInvoke* invoke) {
+void IntrinsicCodeGeneratorARM64::VisitJdkUnsafePutReference(HInvoke* invoke) {
   GenUnsafePut(invoke,
                DataType::Type::kReference,
                /*is_volatile=*/ false,
@@ -1073,14 +1063,14 @@
                /*is_ordered=*/ true,
                codegen_);
 }
-void IntrinsicCodeGeneratorARM64::VisitJdkUnsafePutObjectVolatile(HInvoke* invoke) {
+void IntrinsicCodeGeneratorARM64::VisitJdkUnsafePutReferenceVolatile(HInvoke* invoke) {
   GenUnsafePut(invoke,
                DataType::Type::kReference,
                /*is_volatile=*/ true,
                /*is_ordered=*/ false,
                codegen_);
 }
-void IntrinsicCodeGeneratorARM64::VisitJdkUnsafePutObjectRelease(HInvoke* invoke) {
+void IntrinsicCodeGeneratorARM64::VisitJdkUnsafePutReferenceRelease(HInvoke* invoke) {
   GenUnsafePut(invoke,
                DataType::Type::kReference,
                /*is_volatile=*/ true,
@@ -1123,8 +1113,10 @@
                codegen_);
 }
 
-static void CreateUnsafeCASLocations(ArenaAllocator* allocator, HInvoke* invoke) {
-  const bool can_call = gUseReadBarrier && IsUnsafeCASObject(invoke);
+static void CreateUnsafeCASLocations(ArenaAllocator* allocator,
+                                     HInvoke* invoke,
+                                     CodeGeneratorARM64* codegen) {
+  const bool can_call = codegen->EmitReadBarrier() && IsUnsafeCASReference(invoke);
   LocationSummary* locations =
       new (allocator) LocationSummary(invoke,
                                       can_call
@@ -1286,7 +1278,7 @@
   // }
   //
   // Flag Z indicates whether `old_value == expected || old_value == expected2`.
-  // (Is `expected2` is not valid, the `old_value == expected2` part is not emitted.)
+  // (If `expected2` is not valid, the `old_value == expected2` part is not emitted.)
 
   vixl::aarch64::Label loop_head;
   if (strong) {
@@ -1369,7 +1361,7 @@
     // Mark the `old_value_` from the main path and compare with `expected_`.
     if (kUseBakerReadBarrier) {
       DCHECK(mark_old_value_slow_path_ == nullptr);
-      arm64_codegen->GenerateIntrinsicCasMoveWithBakerReadBarrier(old_value_temp_, old_value_);
+      arm64_codegen->GenerateIntrinsicMoveWithBakerReadBarrier(old_value_temp_, old_value_);
     } else {
       DCHECK(mark_old_value_slow_path_ != nullptr);
       __ B(mark_old_value_slow_path_->GetEntryLabel());
@@ -1423,7 +1415,7 @@
       __ Bind(&mark_old_value);
       if (kUseBakerReadBarrier) {
         DCHECK(update_old_value_slow_path_ == nullptr);
-        arm64_codegen->GenerateIntrinsicCasMoveWithBakerReadBarrier(old_value_, old_value_temp_);
+        arm64_codegen->GenerateIntrinsicMoveWithBakerReadBarrier(old_value_, old_value_temp_);
       } else {
         // Note: We could redirect the `failure` above directly to the entry label and bind
         // the exit label in the main path, but the main path would need to access the
@@ -1465,7 +1457,7 @@
   if (type == DataType::Type::kReference) {
     // Mark card for object assuming new value is stored.
     bool new_value_can_be_null = true;  // TODO: Worth finding out this information?
-    codegen->MarkGCCard(base, new_value, new_value_can_be_null);
+    codegen->MaybeMarkGCCard(base, new_value, new_value_can_be_null);
   }
 
   UseScratchRegisterScope temps(masm);
@@ -1476,7 +1468,7 @@
   vixl::aarch64::Label* exit_loop = &exit_loop_label;
   vixl::aarch64::Label* cmp_failure = &exit_loop_label;
 
-  if (gUseReadBarrier && type == DataType::Type::kReference) {
+  if (type == DataType::Type::kReference && codegen->EmitReadBarrier()) {
     // We need to store the `old_value` in a non-scratch register to make sure
     // the read barrier in the slow path does not clobber it.
     old_value = WRegisterFrom(locations->GetTemp(0));  // The old value from main path.
@@ -1540,23 +1532,23 @@
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeCASObject(HInvoke* invoke) {
   // `jdk.internal.misc.Unsafe.compareAndSwapObject` has compare-and-set semantics (see javadoc).
-  VisitJdkUnsafeCompareAndSetObject(invoke);
+  VisitJdkUnsafeCompareAndSetReference(invoke);
 }
 
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeCompareAndSetInt(HInvoke* invoke) {
-  CreateUnsafeCASLocations(allocator_, invoke);
+  CreateUnsafeCASLocations(allocator_, invoke, codegen_);
 }
 void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeCompareAndSetLong(HInvoke* invoke) {
-  CreateUnsafeCASLocations(allocator_, invoke);
+  CreateUnsafeCASLocations(allocator_, invoke, codegen_);
 }
-void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeCompareAndSetObject(HInvoke* invoke) {
+void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeCompareAndSetReference(HInvoke* invoke) {
   // The only supported read barrier implementation is the Baker-style read barriers.
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+  if (codegen_->EmitNonBakerReadBarrier()) {
     return;
   }
 
-  CreateUnsafeCASLocations(allocator_, invoke);
-  if (gUseReadBarrier) {
+  CreateUnsafeCASLocations(allocator_, invoke, codegen_);
+  if (codegen_->EmitReadBarrier()) {
     // We need two non-scratch temporary registers for read barrier.
     LocationSummary* locations = invoke->GetLocations();
     if (kUseBakerReadBarrier) {
@@ -1586,7 +1578,7 @@
 }
 
 void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeCASInt(HInvoke* invoke) {
-  // `jdk.internal.misc.Unsafe.compareAndSwapLong` has compare-and-set semantics (see javadoc).
+  // `jdk.internal.misc.Unsafe.compareAndSwapInt` has compare-and-set semantics (see javadoc).
   VisitJdkUnsafeCompareAndSetInt(invoke);
 }
 void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeCASLong(HInvoke* invoke) {
@@ -1595,7 +1587,7 @@
 }
 void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeCASObject(HInvoke* invoke) {
   // `jdk.internal.misc.Unsafe.compareAndSwapObject` has compare-and-set semantics (see javadoc).
-  VisitJdkUnsafeCompareAndSetObject(invoke);
+  VisitJdkUnsafeCompareAndSetReference(invoke);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeCompareAndSetInt(HInvoke* invoke) {
@@ -1604,9 +1596,9 @@
 void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeCompareAndSetLong(HInvoke* invoke) {
   GenUnsafeCas(invoke, DataType::Type::kInt64, codegen_);
 }
-void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeCompareAndSetObject(HInvoke* invoke) {
+void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeCompareAndSetReference(HInvoke* invoke) {
   // The only supported read barrier implementation is the Baker-style read barriers.
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen_->EmitReadBarrier(), kUseBakerReadBarrier);
 
   GenUnsafeCas(invoke, DataType::Type::kReference, codegen_);
 }
@@ -1701,6 +1693,138 @@
   __ Cbnz(store_result, &loop_label);
 }
 
+static void CreateUnsafeGetAndUpdateLocations(ArenaAllocator* allocator,
+                                              HInvoke* invoke,
+                                              CodeGeneratorARM64* codegen) {
+  const bool can_call = codegen->EmitReadBarrier() && IsUnsafeGetAndSetReference(invoke);
+  LocationSummary* locations =
+      new (allocator) LocationSummary(invoke,
+                                      can_call
+                                          ? LocationSummary::kCallOnSlowPath
+                                          : LocationSummary::kNoCall,
+                                      kIntrinsified);
+  if (can_call && kUseBakerReadBarrier) {
+    locations->SetCustomSlowPathCallerSaves(RegisterSet::Empty());  // No caller-save registers.
+  }
+  locations->SetInAt(0, Location::NoLocation());        // Unused receiver.
+  locations->SetInAt(1, Location::RequiresRegister());
+  locations->SetInAt(2, Location::RequiresRegister());
+  locations->SetInAt(3, Location::RequiresRegister());
+  locations->AddTemp(Location::RequiresRegister());
+
+  locations->SetOut(Location::RequiresRegister(), Location::kOutputOverlap);
+}
+
+static void GenUnsafeGetAndUpdate(HInvoke* invoke,
+                                  DataType::Type type,
+                                  CodeGeneratorARM64* codegen,
+                                  GetAndUpdateOp get_and_update_op) {
+  MacroAssembler* masm = codegen->GetVIXLAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+
+  Register out = RegisterFrom(locations->Out(), type);            // Result.
+  Register base = WRegisterFrom(locations->InAt(1));              // Object pointer.
+  Register offset = XRegisterFrom(locations->InAt(2));            // Long offset.
+  Register arg = RegisterFrom(locations->InAt(3), type);          // New value or addend.
+  Register tmp_ptr = XRegisterFrom(locations->GetTemp(0));        // Pointer to actual memory.
+
+  // This needs to be before the temp registers, as MarkGCCard also uses VIXL temps.
+  if (type == DataType::Type::kReference) {
+    DCHECK(get_and_update_op == GetAndUpdateOp::kSet);
+    // Mark card for object as a new value shall be stored.
+    bool new_value_can_be_null = true;  // TODO: Worth finding out this information?
+    codegen->MaybeMarkGCCard(base, /*value=*/arg, new_value_can_be_null);
+  }
+
+  __ Add(tmp_ptr, base.X(), Operand(offset));
+  GenerateGetAndUpdate(codegen,
+                       get_and_update_op,
+                       type,
+                       std::memory_order_seq_cst,
+                       tmp_ptr,
+                       arg,
+                       /*old_value=*/ out);
+
+  if (type == DataType::Type::kReference && codegen->EmitReadBarrier()) {
+    DCHECK(get_and_update_op == GetAndUpdateOp::kSet);
+    if (kUseBakerReadBarrier) {
+      codegen->GenerateIntrinsicMoveWithBakerReadBarrier(out.W(), out.W());
+    } else {
+      codegen->GenerateReadBarrierSlow(
+          invoke,
+          Location::RegisterLocation(out.GetCode()),
+          Location::RegisterLocation(out.GetCode()),
+          Location::RegisterLocation(base.GetCode()),
+          /*offset=*/ 0u,
+          /*index=*/ Location::RegisterLocation(offset.GetCode()));
+    }
+  }
+}
+
+void IntrinsicLocationsBuilderARM64::VisitUnsafeGetAndAddInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddInt(invoke);
+}
+void IntrinsicLocationsBuilderARM64::VisitUnsafeGetAndAddLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddLong(invoke);
+}
+void IntrinsicLocationsBuilderARM64::VisitUnsafeGetAndSetInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetInt(invoke);
+}
+void IntrinsicLocationsBuilderARM64::VisitUnsafeGetAndSetLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetLong(invoke);
+}
+void IntrinsicLocationsBuilderARM64::VisitUnsafeGetAndSetObject(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetReference(invoke);
+}
+
+void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetAndAddInt(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(allocator_, invoke, codegen_);
+}
+void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetAndAddLong(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(allocator_, invoke, codegen_);
+}
+void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetAndSetInt(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(allocator_, invoke, codegen_);
+}
+void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetAndSetLong(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(allocator_, invoke, codegen_);
+}
+void IntrinsicLocationsBuilderARM64::VisitJdkUnsafeGetAndSetReference(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorARM64::VisitUnsafeGetAndAddInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddInt(invoke);
+}
+void IntrinsicCodeGeneratorARM64::VisitUnsafeGetAndAddLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddLong(invoke);
+}
+void IntrinsicCodeGeneratorARM64::VisitUnsafeGetAndSetInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetInt(invoke);
+}
+void IntrinsicCodeGeneratorARM64::VisitUnsafeGetAndSetLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetLong(invoke);
+}
+void IntrinsicCodeGeneratorARM64::VisitUnsafeGetAndSetObject(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetReference(invoke);
+}
+
+void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeGetAndAddInt(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kInt32, codegen_, GetAndUpdateOp::kAdd);
+}
+void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeGetAndAddLong(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kInt64, codegen_, GetAndUpdateOp::kAdd);
+}
+void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeGetAndSetInt(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kInt32, codegen_, GetAndUpdateOp::kSet);
+}
+void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeGetAndSetLong(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kInt64, codegen_, GetAndUpdateOp::kSet);
+}
+void IntrinsicCodeGeneratorARM64::VisitJdkUnsafeGetAndSetReference(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kReference, codegen_, GetAndUpdateOp::kSet);
+}
+
 void IntrinsicLocationsBuilderARM64::VisitStringCompareTo(HInvoke* invoke) {
   LocationSummary* locations =
       new (allocator_) LocationSummary(invoke,
@@ -2301,7 +2425,7 @@
   locations->SetOut(calling_convention.GetReturnLocation(invoke->GetType()));
 }
 
-static void CreateFPFPFPToFPCallLocations(ArenaAllocator* allocator, HInvoke* invoke) {
+static void CreateFPFPFPToFPLocations(ArenaAllocator* allocator, HInvoke* invoke) {
   DCHECK_EQ(invoke->GetNumberOfArguments(), 3U);
   DCHECK(DataType::IsFloatingPointType(invoke->InputAt(0)->GetType()));
   DCHECK(DataType::IsFloatingPointType(invoke->InputAt(1)->GetType()));
@@ -2608,22 +2732,20 @@
 // so if we choose to jump to the slow path we will end up in the native implementation.
 static constexpr int32_t kSystemArrayCopyCharThreshold = 192;
 
-static void SetSystemArrayCopyLocationRequires(LocationSummary* locations,
-                                               uint32_t at,
-                                               HInstruction* input) {
-  HIntConstant* const_input = input->AsIntConstant();
-  if (const_input != nullptr && !vixl::aarch64::Assembler::IsImmAddSub(const_input->GetValue())) {
-    locations->SetInAt(at, Location::RequiresRegister());
+static Location LocationForSystemArrayCopyInput(HInstruction* input) {
+  HIntConstant* const_input = input->AsIntConstantOrNull();
+  if (const_input != nullptr && vixl::aarch64::Assembler::IsImmAddSub(const_input->GetValue())) {
+    return Location::ConstantLocation(const_input);
   } else {
-    locations->SetInAt(at, Location::RegisterOrConstant(input));
+    return Location::RequiresRegister();
   }
 }
 
 void IntrinsicLocationsBuilderARM64::VisitSystemArrayCopyChar(HInvoke* invoke) {
   // Check to see if we have known failures that will cause us to have to bail out
   // to the runtime, and just generate the runtime call directly.
-  HIntConstant* src_pos = invoke->InputAt(1)->AsIntConstant();
-  HIntConstant* dst_pos = invoke->InputAt(3)->AsIntConstant();
+  HIntConstant* src_pos = invoke->InputAt(1)->AsIntConstantOrNull();
+  HIntConstant* dst_pos = invoke->InputAt(3)->AsIntConstantOrNull();
 
   // The positions must be non-negative.
   if ((src_pos != nullptr && src_pos->GetValue() < 0) ||
@@ -2634,7 +2756,7 @@
 
   // The length must be >= 0 and not so long that we would (currently) prefer libcore's
   // native implementation.
-  HIntConstant* length = invoke->InputAt(4)->AsIntConstant();
+  HIntConstant* length = invoke->InputAt(4)->AsIntConstantOrNull();
   if (length != nullptr) {
     int32_t len = length->GetValue();
     if (len < 0 || len > kSystemArrayCopyCharThreshold) {
@@ -2648,10 +2770,10 @@
       new (allocator) LocationSummary(invoke, LocationSummary::kCallOnSlowPath, kIntrinsified);
   // arraycopy(char[] src, int src_pos, char[] dst, int dst_pos, int length).
   locations->SetInAt(0, Location::RequiresRegister());
-  SetSystemArrayCopyLocationRequires(locations, 1, invoke->InputAt(1));
+  locations->SetInAt(1, LocationForSystemArrayCopyInput(invoke->InputAt(1)));
   locations->SetInAt(2, Location::RequiresRegister());
-  SetSystemArrayCopyLocationRequires(locations, 3, invoke->InputAt(3));
-  SetSystemArrayCopyLocationRequires(locations, 4, invoke->InputAt(4));
+  locations->SetInAt(3, LocationForSystemArrayCopyInput(invoke->InputAt(3)));
+  locations->SetInAt(4, LocationForSystemArrayCopyInput(invoke->InputAt(4)));
 
   locations->AddTemp(Location::RequiresRegister());
   locations->AddTemp(Location::RequiresRegister());
@@ -2659,92 +2781,97 @@
 }
 
 static void CheckSystemArrayCopyPosition(MacroAssembler* masm,
-                                         const Location& pos,
-                                         const Register& input,
-                                         const Location& length,
+                                         Register array,
+                                         Location pos,
+                                         Location length,
                                          SlowPathCodeARM64* slow_path,
-                                         const Register& temp,
-                                         bool length_is_input_length = false) {
+                                         Register temp,
+                                         bool length_is_array_length,
+                                         bool position_sign_checked) {
   const int32_t length_offset = mirror::Array::LengthOffset().Int32Value();
   if (pos.IsConstant()) {
     int32_t pos_const = pos.GetConstant()->AsIntConstant()->GetValue();
     if (pos_const == 0) {
-      if (!length_is_input_length) {
-        // Check that length(input) >= length.
-        __ Ldr(temp, MemOperand(input, length_offset));
+      if (!length_is_array_length) {
+        // Check that length(array) >= length.
+        __ Ldr(temp, MemOperand(array, length_offset));
         __ Cmp(temp, OperandFrom(length, DataType::Type::kInt32));
         __ B(slow_path->GetEntryLabel(), lt);
       }
     } else {
-      // Check that length(input) >= pos.
-      __ Ldr(temp, MemOperand(input, length_offset));
-      __ Subs(temp, temp, pos_const);
-      __ B(slow_path->GetEntryLabel(), lt);
+      // Calculate length(array) - pos.
+      // Both operands are known to be non-negative `int32_t`, so the difference cannot underflow
+      // as `int32_t`. If the result is negative, the B.LT below shall go to the slow path.
+      __ Ldr(temp, MemOperand(array, length_offset));
+      __ Sub(temp, temp, pos_const);
 
-      // Check that (length(input) - pos) >= length.
+      // Check that (length(array) - pos) >= length.
       __ Cmp(temp, OperandFrom(length, DataType::Type::kInt32));
       __ B(slow_path->GetEntryLabel(), lt);
     }
-  } else if (length_is_input_length) {
+  } else if (length_is_array_length) {
     // The only way the copy can succeed is if pos is zero.
     __ Cbnz(WRegisterFrom(pos), slow_path->GetEntryLabel());
   } else {
     // Check that pos >= 0.
     Register pos_reg = WRegisterFrom(pos);
-    __ Tbnz(pos_reg, pos_reg.GetSizeInBits() - 1, slow_path->GetEntryLabel());
+    if (!position_sign_checked) {
+      __ Tbnz(pos_reg, pos_reg.GetSizeInBits() - 1, slow_path->GetEntryLabel());
+    }
 
-    // Check that pos <= length(input) && (length(input) - pos) >= length.
-    __ Ldr(temp, MemOperand(input, length_offset));
-    __ Subs(temp, temp, pos_reg);
-    // Ccmp if length(input) >= pos, else definitely bail to slow path (N!=V == lt).
-    __ Ccmp(temp, OperandFrom(length, DataType::Type::kInt32), NFlag, ge);
+    // Calculate length(array) - pos.
+    // Both operands are known to be non-negative `int32_t`, so the difference cannot underflow
+    // as `int32_t`. If the result is negative, the B.LT below shall go to the slow path.
+    __ Ldr(temp, MemOperand(array, length_offset));
+    __ Sub(temp, temp, pos_reg);
+
+    // Check that (length(array) - pos) >= length.
+    __ Cmp(temp, OperandFrom(length, DataType::Type::kInt32));
     __ B(slow_path->GetEntryLabel(), lt);
   }
 }
 
+static void GenArrayAddress(MacroAssembler* masm,
+                            Register dest,
+                            Register base,
+                            Location pos,
+                            DataType::Type type,
+                            int32_t data_offset) {
+  if (pos.IsConstant()) {
+    int32_t constant = pos.GetConstant()->AsIntConstant()->GetValue();
+    __ Add(dest, base, DataType::Size(type) * constant + data_offset);
+  } else {
+    if (data_offset != 0) {
+      __ Add(dest, base, data_offset);
+      base = dest;
+    }
+    __ Add(dest, base, Operand(XRegisterFrom(pos), LSL, DataType::SizeShift(type)));
+  }
+}
+
 // Compute base source address, base destination address, and end
 // source address for System.arraycopy* intrinsics in `src_base`,
 // `dst_base` and `src_end` respectively.
 static void GenSystemArrayCopyAddresses(MacroAssembler* masm,
                                         DataType::Type type,
-                                        const Register& src,
-                                        const Location& src_pos,
-                                        const Register& dst,
-                                        const Location& dst_pos,
-                                        const Location& copy_length,
-                                        const Register& src_base,
-                                        const Register& dst_base,
-                                        const Register& src_end) {
+                                        Register src,
+                                        Location src_pos,
+                                        Register dst,
+                                        Location dst_pos,
+                                        Location copy_length,
+                                        Register src_base,
+                                        Register dst_base,
+                                        Register src_end) {
   // This routine is used by the SystemArrayCopy and the SystemArrayCopyChar intrinsics.
   DCHECK(type == DataType::Type::kReference || type == DataType::Type::kUint16)
       << "Unexpected element type: " << type;
   const int32_t element_size = DataType::Size(type);
-  const int32_t element_size_shift = DataType::SizeShift(type);
   const uint32_t data_offset = mirror::Array::DataOffset(element_size).Uint32Value();
 
-  if (src_pos.IsConstant()) {
-    int32_t constant = src_pos.GetConstant()->AsIntConstant()->GetValue();
-    __ Add(src_base, src, element_size * constant + data_offset);
-  } else {
-    __ Add(src_base, src, data_offset);
-    __ Add(src_base, src_base, Operand(XRegisterFrom(src_pos), LSL, element_size_shift));
-  }
-
-  if (dst_pos.IsConstant()) {
-    int32_t constant = dst_pos.GetConstant()->AsIntConstant()->GetValue();
-    __ Add(dst_base, dst, element_size * constant + data_offset);
-  } else {
-    __ Add(dst_base, dst, data_offset);
-    __ Add(dst_base, dst_base, Operand(XRegisterFrom(dst_pos), LSL, element_size_shift));
-  }
-
+  GenArrayAddress(masm, src_base, src, src_pos, type, data_offset);
+  GenArrayAddress(masm, dst_base, dst, dst_pos, type, data_offset);
   if (src_end.IsValid()) {
-    if (copy_length.IsConstant()) {
-      int32_t constant = copy_length.GetConstant()->AsIntConstant()->GetValue();
-      __ Add(src_end, src_base, element_size * constant);
-    } else {
-      __ Add(src_end, src_base, Operand(XRegisterFrom(copy_length), LSL, element_size_shift));
-    }
+    GenArrayAddress(masm, src_end, src_base, copy_length, type, /*data_offset=*/ 0);
   }
 }
 
@@ -2790,20 +2917,22 @@
   Register src_stop_addr = WRegisterFrom(locations->GetTemp(2));
 
   CheckSystemArrayCopyPosition(masm,
-                               src_pos,
                                src,
+                               src_pos,
                                length,
                                slow_path,
                                src_curr_addr,
-                               false);
+                               /*length_is_array_length=*/ false,
+                               /*position_sign_checked=*/ false);
 
   CheckSystemArrayCopyPosition(masm,
-                               dst_pos,
                                dst,
+                               dst_pos,
                                length,
                                slow_path,
                                src_curr_addr,
-                               false);
+                               /*length_is_array_length=*/ false,
+                               /*position_sign_checked=*/ false);
 
   src_curr_addr = src_curr_addr.X();
   dst_curr_addr = dst_curr_addr.X();
@@ -2917,86 +3046,43 @@
   __ Bind(slow_path->GetExitLabel());
 }
 
-// We can choose to use the native implementation there for longer copy lengths.
+// We choose to use the native implementation for longer copy lengths.
 static constexpr int32_t kSystemArrayCopyThreshold = 128;
 
-// CodeGenerator::CreateSystemArrayCopyLocationSummary use three temporary registers.
-// We want to use two temporary registers in order to reduce the register pressure in arm64.
-// So we don't use the CodeGenerator::CreateSystemArrayCopyLocationSummary.
 void IntrinsicLocationsBuilderARM64::VisitSystemArrayCopy(HInvoke* invoke) {
   // The only read barrier implementation supporting the
   // SystemArrayCopy intrinsic is the Baker-style read barriers.
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+  if (codegen_->EmitNonBakerReadBarrier()) {
     return;
   }
 
-  // Check to see if we have known failures that will cause us to have to bail out
-  // to the runtime, and just generate the runtime call directly.
-  HIntConstant* src_pos = invoke->InputAt(1)->AsIntConstant();
-  HIntConstant* dest_pos = invoke->InputAt(3)->AsIntConstant();
-
-  // The positions must be non-negative.
-  if ((src_pos != nullptr && src_pos->GetValue() < 0) ||
-      (dest_pos != nullptr && dest_pos->GetValue() < 0)) {
-    // We will have to fail anyways.
-    return;
-  }
-
-  // The length must be >= 0.
-  HIntConstant* length = invoke->InputAt(4)->AsIntConstant();
-  if (length != nullptr) {
-    int32_t len = length->GetValue();
-    if (len < 0 || len >= kSystemArrayCopyThreshold) {
-      // Just call as normal.
-      return;
+  constexpr size_t kInitialNumTemps = 2u;  // We need at least two temps.
+  LocationSummary* locations = CodeGenerator::CreateSystemArrayCopyLocationSummary(
+      invoke, kSystemArrayCopyThreshold, kInitialNumTemps);
+  if (locations != nullptr) {
+    locations->SetInAt(1, LocationForSystemArrayCopyInput(invoke->InputAt(1)));
+    locations->SetInAt(3, LocationForSystemArrayCopyInput(invoke->InputAt(3)));
+    locations->SetInAt(4, LocationForSystemArrayCopyInput(invoke->InputAt(4)));
+    if (codegen_->EmitBakerReadBarrier()) {
+      // Temporary register IP0, obtained from the VIXL scratch register
+      // pool, cannot be used in ReadBarrierSystemArrayCopySlowPathARM64
+      // (because that register is clobbered by ReadBarrierMarkRegX
+      // entry points). It cannot be used in calls to
+      // CodeGeneratorARM64::GenerateFieldLoadWithBakerReadBarrier
+      // either. For these reasons, get a third extra temporary register
+      // from the register allocator.
+      locations->AddTemp(Location::RequiresRegister());
+    } else {
+      // Cases other than Baker read barriers: the third temporary will
+      // be acquired from the VIXL scratch register pool.
     }
   }
-
-  SystemArrayCopyOptimizations optimizations(invoke);
-
-  if (optimizations.GetDestinationIsSource()) {
-    if (src_pos != nullptr && dest_pos != nullptr && src_pos->GetValue() < dest_pos->GetValue()) {
-      // We only support backward copying if source and destination are the same.
-      return;
-    }
-  }
-
-  if (optimizations.GetDestinationIsPrimitiveArray() || optimizations.GetSourceIsPrimitiveArray()) {
-    // We currently don't intrinsify primitive copying.
-    return;
-  }
-
-  ArenaAllocator* allocator = invoke->GetBlock()->GetGraph()->GetAllocator();
-  LocationSummary* locations =
-      new (allocator) LocationSummary(invoke, LocationSummary::kCallOnSlowPath, kIntrinsified);
-  // arraycopy(Object src, int src_pos, Object dest, int dest_pos, int length).
-  locations->SetInAt(0, Location::RequiresRegister());
-  SetSystemArrayCopyLocationRequires(locations, 1, invoke->InputAt(1));
-  locations->SetInAt(2, Location::RequiresRegister());
-  SetSystemArrayCopyLocationRequires(locations, 3, invoke->InputAt(3));
-  SetSystemArrayCopyLocationRequires(locations, 4, invoke->InputAt(4));
-
-  locations->AddTemp(Location::RequiresRegister());
-  locations->AddTemp(Location::RequiresRegister());
-  if (gUseReadBarrier && kUseBakerReadBarrier) {
-    // Temporary register IP0, obtained from the VIXL scratch register
-    // pool, cannot be used in ReadBarrierSystemArrayCopySlowPathARM64
-    // (because that register is clobbered by ReadBarrierMarkRegX
-    // entry points). It cannot be used in calls to
-    // CodeGeneratorARM64::GenerateFieldLoadWithBakerReadBarrier
-    // either. For these reasons, get a third extra temporary register
-    // from the register allocator.
-    locations->AddTemp(Location::RequiresRegister());
-  } else {
-    // Cases other than Baker read barriers: the third temporary will
-    // be acquired from the VIXL scratch register pool.
-  }
 }
 
 void IntrinsicCodeGeneratorARM64::VisitSystemArrayCopy(HInvoke* invoke) {
   // The only read barrier implementation supporting the
   // SystemArrayCopy intrinsic is the Baker-style read barriers.
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen_->EmitReadBarrier(), kUseBakerReadBarrier);
 
   MacroAssembler* masm = GetVIXLAssembler();
   LocationSummary* locations = invoke->GetLocations();
@@ -3024,38 +3110,37 @@
   vixl::aarch64::Label conditions_on_positions_validated;
   SystemArrayCopyOptimizations optimizations(invoke);
 
-  // If source and destination are the same, we go to slow path if we need to do
-  // forward copying.
-  if (src_pos.IsConstant()) {
-    int32_t src_pos_constant = src_pos.GetConstant()->AsIntConstant()->GetValue();
-    if (dest_pos.IsConstant()) {
-      int32_t dest_pos_constant = dest_pos.GetConstant()->AsIntConstant()->GetValue();
-      if (optimizations.GetDestinationIsSource()) {
-        // Checked when building locations.
-        DCHECK_GE(src_pos_constant, dest_pos_constant);
-      } else if (src_pos_constant < dest_pos_constant) {
-        __ Cmp(src, dest);
-        __ B(intrinsic_slow_path->GetEntryLabel(), eq);
+  // If source and destination are the same, we go to slow path if we need to do forward copying.
+  // We do not need to do this check if the source and destination positions are the same.
+  if (!optimizations.GetSourcePositionIsDestinationPosition()) {
+    if (src_pos.IsConstant()) {
+      int32_t src_pos_constant = src_pos.GetConstant()->AsIntConstant()->GetValue();
+      if (dest_pos.IsConstant()) {
+        int32_t dest_pos_constant = dest_pos.GetConstant()->AsIntConstant()->GetValue();
+        if (optimizations.GetDestinationIsSource()) {
+          // Checked when building locations.
+          DCHECK_GE(src_pos_constant, dest_pos_constant);
+        } else if (src_pos_constant < dest_pos_constant) {
+          __ Cmp(src, dest);
+          __ B(intrinsic_slow_path->GetEntryLabel(), eq);
+        }
+      } else {
+        if (!optimizations.GetDestinationIsSource()) {
+          __ Cmp(src, dest);
+          __ B(&conditions_on_positions_validated, ne);
+        }
+        __ Cmp(WRegisterFrom(dest_pos), src_pos_constant);
+        __ B(intrinsic_slow_path->GetEntryLabel(), gt);
       }
-      // Checked when building locations.
-      DCHECK(!optimizations.GetDestinationIsSource()
-             || (src_pos_constant >= dest_pos.GetConstant()->AsIntConstant()->GetValue()));
     } else {
       if (!optimizations.GetDestinationIsSource()) {
         __ Cmp(src, dest);
         __ B(&conditions_on_positions_validated, ne);
       }
-      __ Cmp(WRegisterFrom(dest_pos), src_pos_constant);
-      __ B(intrinsic_slow_path->GetEntryLabel(), gt);
+      __ Cmp(RegisterFrom(src_pos, invoke->InputAt(1)->GetType()),
+             OperandFrom(dest_pos, invoke->InputAt(3)->GetType()));
+      __ B(intrinsic_slow_path->GetEntryLabel(), lt);
     }
-  } else {
-    if (!optimizations.GetDestinationIsSource()) {
-      __ Cmp(src, dest);
-      __ B(&conditions_on_positions_validated, ne);
-    }
-    __ Cmp(RegisterFrom(src_pos, invoke->InputAt(1)->GetType()),
-           OperandFrom(dest_pos, invoke->InputAt(3)->GetType()));
-    __ B(intrinsic_slow_path->GetEntryLabel(), lt);
   }
 
   __ Bind(&conditions_on_positions_validated);
@@ -3071,9 +3156,7 @@
   }
 
   // We have already checked in the LocationsBuilder for the constant case.
-  if (!length.IsConstant() &&
-      !optimizations.GetCountIsSourceLength() &&
-      !optimizations.GetCountIsDestinationLength()) {
+  if (!length.IsConstant()) {
     // Merge the following two comparisons into one:
     //   If the length is negative, bail out (delegate to libcore's native implementation).
     //   If the length >= 128 then (currently) prefer native implementation.
@@ -3082,252 +3165,155 @@
   }
   // Validity checks: source.
   CheckSystemArrayCopyPosition(masm,
-                               src_pos,
                                src,
+                               src_pos,
                                length,
                                intrinsic_slow_path,
                                temp1,
-                               optimizations.GetCountIsSourceLength());
+                               optimizations.GetCountIsSourceLength(),
+                               /*position_sign_checked=*/ false);
 
   // Validity checks: dest.
+  bool dest_position_sign_checked = optimizations.GetSourcePositionIsDestinationPosition();
   CheckSystemArrayCopyPosition(masm,
-                               dest_pos,
                                dest,
+                               dest_pos,
                                length,
                                intrinsic_slow_path,
                                temp1,
-                               optimizations.GetCountIsDestinationLength());
-  {
-    // We use a block to end the scratch scope before the write barrier, thus
-    // freeing the temporary registers so they can be used in `MarkGCCard`.
-    UseScratchRegisterScope temps(masm);
-    Location temp3_loc;  // Used only for Baker read barrier.
-    Register temp3;
-    if (gUseReadBarrier && kUseBakerReadBarrier) {
-      temp3_loc = locations->GetTemp(2);
-      temp3 = WRegisterFrom(temp3_loc);
+                               optimizations.GetCountIsDestinationLength(),
+                               dest_position_sign_checked);
+
+  auto check_non_primitive_array_class = [&](Register klass, Register temp) {
+    // No read barrier is needed for reading a chain of constant references for comparing
+    // with null, or for reading a constant primitive value, see `ReadBarrierOption`.
+    // /* HeapReference<Class> */ temp = klass->component_type_
+    __ Ldr(temp, HeapOperand(klass, component_offset));
+    codegen_->GetAssembler()->MaybeUnpoisonHeapReference(temp);
+    // Check that the component type is not null.
+    __ Cbz(temp, intrinsic_slow_path->GetEntryLabel());
+    // Check that the component type is not a primitive.
+    // /* uint16_t */ temp = static_cast<uint16>(klass->primitive_type_);
+    __ Ldrh(temp, HeapOperand(temp, primitive_offset));
+    static_assert(Primitive::kPrimNot == 0, "Expected 0 for kPrimNot");
+    __ Cbnz(temp, intrinsic_slow_path->GetEntryLabel());
+  };
+
+  if (!optimizations.GetDoesNotNeedTypeCheck()) {
+    // Check whether all elements of the source array are assignable to the component
+    // type of the destination array. We do two checks: the classes are the same,
+    // or the destination is Object[]. If none of these checks succeed, we go to the
+    // slow path.
+
+    if (codegen_->EmitBakerReadBarrier()) {
+      Location temp3_loc = locations->GetTemp(2);
+      // /* HeapReference<Class> */ temp1 = dest->klass_
+      codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
+                                                      temp1_loc,
+                                                      dest.W(),
+                                                      class_offset,
+                                                      temp3_loc,
+                                                      /* needs_null_check= */ false,
+                                                      /* use_load_acquire= */ false);
+      // Register `temp1` is not trashed by the read barrier emitted
+      // by GenerateFieldLoadWithBakerReadBarrier below, as that
+      // method produces a call to a ReadBarrierMarkRegX entry point,
+      // which saves all potentially live registers, including
+      // temporaries such a `temp1`.
+      // /* HeapReference<Class> */ temp2 = src->klass_
+      codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
+                                                      temp2_loc,
+                                                      src.W(),
+                                                      class_offset,
+                                                      temp3_loc,
+                                                      /* needs_null_check= */ false,
+                                                      /* use_load_acquire= */ false);
     } else {
-      temp3 = temps.AcquireW();
+      // /* HeapReference<Class> */ temp1 = dest->klass_
+      __ Ldr(temp1, MemOperand(dest, class_offset));
+      codegen_->GetAssembler()->MaybeUnpoisonHeapReference(temp1);
+      // /* HeapReference<Class> */ temp2 = src->klass_
+      __ Ldr(temp2, MemOperand(src, class_offset));
+      codegen_->GetAssembler()->MaybeUnpoisonHeapReference(temp2);
     }
 
-    if (!optimizations.GetDoesNotNeedTypeCheck()) {
-      // Check whether all elements of the source array are assignable to the component
-      // type of the destination array. We do two checks: the classes are the same,
-      // or the destination is Object[]. If none of these checks succeed, we go to the
-      // slow path.
-
-      if (gUseReadBarrier && kUseBakerReadBarrier) {
-        if (!optimizations.GetSourceIsNonPrimitiveArray()) {
-          // /* HeapReference<Class> */ temp1 = src->klass_
-          codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
-                                                          temp1_loc,
-                                                          src.W(),
-                                                          class_offset,
-                                                          temp3_loc,
-                                                          /* needs_null_check= */ false,
-                                                          /* use_load_acquire= */ false);
-          // Bail out if the source is not a non primitive array.
-          // /* HeapReference<Class> */ temp1 = temp1->component_type_
-          codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
-                                                          temp1_loc,
-                                                          temp1,
-                                                          component_offset,
-                                                          temp3_loc,
-                                                          /* needs_null_check= */ false,
-                                                          /* use_load_acquire= */ false);
-          __ Cbz(temp1, intrinsic_slow_path->GetEntryLabel());
-          // If heap poisoning is enabled, `temp1` has been unpoisoned
-          // by the the previous call to GenerateFieldLoadWithBakerReadBarrier.
-          // /* uint16_t */ temp1 = static_cast<uint16>(temp1->primitive_type_);
-          __ Ldrh(temp1, HeapOperand(temp1, primitive_offset));
-          static_assert(Primitive::kPrimNot == 0, "Expected 0 for kPrimNot");
-          __ Cbnz(temp1, intrinsic_slow_path->GetEntryLabel());
-        }
-
-        // /* HeapReference<Class> */ temp1 = dest->klass_
-        codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
-                                                        temp1_loc,
-                                                        dest.W(),
-                                                        class_offset,
-                                                        temp3_loc,
-                                                        /* needs_null_check= */ false,
-                                                        /* use_load_acquire= */ false);
-
-        if (!optimizations.GetDestinationIsNonPrimitiveArray()) {
-          // Bail out if the destination is not a non primitive array.
-          //
-          // Register `temp1` is not trashed by the read barrier emitted
-          // by GenerateFieldLoadWithBakerReadBarrier below, as that
-          // method produces a call to a ReadBarrierMarkRegX entry point,
-          // which saves all potentially live registers, including
-          // temporaries such a `temp1`.
-          // /* HeapReference<Class> */ temp2 = temp1->component_type_
-          codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
-                                                          temp2_loc,
-                                                          temp1,
-                                                          component_offset,
-                                                          temp3_loc,
-                                                          /* needs_null_check= */ false,
-                                                          /* use_load_acquire= */ false);
-          __ Cbz(temp2, intrinsic_slow_path->GetEntryLabel());
-          // If heap poisoning is enabled, `temp2` has been unpoisoned
-          // by the the previous call to GenerateFieldLoadWithBakerReadBarrier.
-          // /* uint16_t */ temp2 = static_cast<uint16>(temp2->primitive_type_);
-          __ Ldrh(temp2, HeapOperand(temp2, primitive_offset));
-          static_assert(Primitive::kPrimNot == 0, "Expected 0 for kPrimNot");
-          __ Cbnz(temp2, intrinsic_slow_path->GetEntryLabel());
-        }
-
-        // For the same reason given earlier, `temp1` is not trashed by the
-        // read barrier emitted by GenerateFieldLoadWithBakerReadBarrier below.
-        // /* HeapReference<Class> */ temp2 = src->klass_
-        codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
-                                                        temp2_loc,
-                                                        src.W(),
-                                                        class_offset,
-                                                        temp3_loc,
-                                                        /* needs_null_check= */ false,
-                                                        /* use_load_acquire= */ false);
-        // Note: if heap poisoning is on, we are comparing two unpoisoned references here.
-        __ Cmp(temp1, temp2);
-
-        if (optimizations.GetDestinationIsTypedObjectArray()) {
-          vixl::aarch64::Label do_copy;
-          __ B(&do_copy, eq);
-          // /* HeapReference<Class> */ temp1 = temp1->component_type_
-          codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
-                                                          temp1_loc,
-                                                          temp1,
-                                                          component_offset,
-                                                          temp3_loc,
-                                                          /* needs_null_check= */ false,
-                                                          /* use_load_acquire= */ false);
-          // /* HeapReference<Class> */ temp1 = temp1->super_class_
-          // We do not need to emit a read barrier for the following
-          // heap reference load, as `temp1` is only used in a
-          // comparison with null below, and this reference is not
-          // kept afterwards.
-          __ Ldr(temp1, HeapOperand(temp1, super_offset));
-          __ Cbnz(temp1, intrinsic_slow_path->GetEntryLabel());
-          __ Bind(&do_copy);
-        } else {
-          __ B(intrinsic_slow_path->GetEntryLabel(), ne);
-        }
-      } else {
-        // Non read barrier code.
-
-        // /* HeapReference<Class> */ temp1 = dest->klass_
-        __ Ldr(temp1, MemOperand(dest, class_offset));
-        // /* HeapReference<Class> */ temp2 = src->klass_
-        __ Ldr(temp2, MemOperand(src, class_offset));
-        bool did_unpoison = false;
-        if (!optimizations.GetDestinationIsNonPrimitiveArray() ||
-            !optimizations.GetSourceIsNonPrimitiveArray()) {
-          // One or two of the references need to be unpoisoned. Unpoison them
-          // both to make the identity check valid.
-          codegen_->GetAssembler()->MaybeUnpoisonHeapReference(temp1);
-          codegen_->GetAssembler()->MaybeUnpoisonHeapReference(temp2);
-          did_unpoison = true;
-        }
-
-        if (!optimizations.GetDestinationIsNonPrimitiveArray()) {
-          // Bail out if the destination is not a non primitive array.
-          // /* HeapReference<Class> */ temp3 = temp1->component_type_
-          __ Ldr(temp3, HeapOperand(temp1, component_offset));
-          __ Cbz(temp3, intrinsic_slow_path->GetEntryLabel());
-          codegen_->GetAssembler()->MaybeUnpoisonHeapReference(temp3);
-          // /* uint16_t */ temp3 = static_cast<uint16>(temp3->primitive_type_);
-          __ Ldrh(temp3, HeapOperand(temp3, primitive_offset));
-          static_assert(Primitive::kPrimNot == 0, "Expected 0 for kPrimNot");
-          __ Cbnz(temp3, intrinsic_slow_path->GetEntryLabel());
-        }
-
-        if (!optimizations.GetSourceIsNonPrimitiveArray()) {
-          // Bail out if the source is not a non primitive array.
-          // /* HeapReference<Class> */ temp3 = temp2->component_type_
-          __ Ldr(temp3, HeapOperand(temp2, component_offset));
-          __ Cbz(temp3, intrinsic_slow_path->GetEntryLabel());
-          codegen_->GetAssembler()->MaybeUnpoisonHeapReference(temp3);
-          // /* uint16_t */ temp3 = static_cast<uint16>(temp3->primitive_type_);
-          __ Ldrh(temp3, HeapOperand(temp3, primitive_offset));
-          static_assert(Primitive::kPrimNot == 0, "Expected 0 for kPrimNot");
-          __ Cbnz(temp3, intrinsic_slow_path->GetEntryLabel());
-        }
-
-        __ Cmp(temp1, temp2);
-
-        if (optimizations.GetDestinationIsTypedObjectArray()) {
-          vixl::aarch64::Label do_copy;
-          __ B(&do_copy, eq);
-          if (!did_unpoison) {
-            codegen_->GetAssembler()->MaybeUnpoisonHeapReference(temp1);
-          }
-          // /* HeapReference<Class> */ temp1 = temp1->component_type_
-          __ Ldr(temp1, HeapOperand(temp1, component_offset));
-          codegen_->GetAssembler()->MaybeUnpoisonHeapReference(temp1);
-          // /* HeapReference<Class> */ temp1 = temp1->super_class_
-          __ Ldr(temp1, HeapOperand(temp1, super_offset));
-          // No need to unpoison the result, we're comparing against null.
-          __ Cbnz(temp1, intrinsic_slow_path->GetEntryLabel());
-          __ Bind(&do_copy);
-        } else {
-          __ B(intrinsic_slow_path->GetEntryLabel(), ne);
-        }
-      }
-    } else if (!optimizations.GetSourceIsNonPrimitiveArray()) {
+    __ Cmp(temp1, temp2);
+    if (optimizations.GetDestinationIsTypedObjectArray()) {
       DCHECK(optimizations.GetDestinationIsNonPrimitiveArray());
+      vixl::aarch64::Label do_copy;
+      // For class match, we can skip the source type check regardless of the optimization flag.
+      __ B(&do_copy, eq);
+      // No read barrier is needed for reading a chain of constant references
+      // for comparing with null, see `ReadBarrierOption`.
+      // /* HeapReference<Class> */ temp1 = temp1->component_type_
+      __ Ldr(temp1, HeapOperand(temp1, component_offset));
+      codegen_->GetAssembler()->MaybeUnpoisonHeapReference(temp1);
+      // /* HeapReference<Class> */ temp1 = temp1->super_class_
+      __ Ldr(temp1, HeapOperand(temp1, super_offset));
+      // No need to unpoison the result, we're comparing against null.
+      __ Cbnz(temp1, intrinsic_slow_path->GetEntryLabel());
       // Bail out if the source is not a non primitive array.
-      if (gUseReadBarrier && kUseBakerReadBarrier) {
-        // /* HeapReference<Class> */ temp1 = src->klass_
-        codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
-                                                        temp1_loc,
-                                                        src.W(),
-                                                        class_offset,
-                                                        temp3_loc,
-                                                        /* needs_null_check= */ false,
-                                                        /* use_load_acquire= */ false);
-        // /* HeapReference<Class> */ temp2 = temp1->component_type_
-        codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
-                                                        temp2_loc,
-                                                        temp1,
-                                                        component_offset,
-                                                        temp3_loc,
-                                                        /* needs_null_check= */ false,
-                                                        /* use_load_acquire= */ false);
-        __ Cbz(temp2, intrinsic_slow_path->GetEntryLabel());
-        // If heap poisoning is enabled, `temp2` has been unpoisoned
-        // by the the previous call to GenerateFieldLoadWithBakerReadBarrier.
-      } else {
-        // /* HeapReference<Class> */ temp1 = src->klass_
-        __ Ldr(temp1, HeapOperand(src.W(), class_offset));
-        codegen_->GetAssembler()->MaybeUnpoisonHeapReference(temp1);
-        // /* HeapReference<Class> */ temp2 = temp1->component_type_
-        __ Ldr(temp2, HeapOperand(temp1, component_offset));
-        __ Cbz(temp2, intrinsic_slow_path->GetEntryLabel());
-        codegen_->GetAssembler()->MaybeUnpoisonHeapReference(temp2);
+      if (!optimizations.GetSourceIsNonPrimitiveArray()) {
+        check_non_primitive_array_class(temp2, temp2);
       }
-      // /* uint16_t */ temp2 = static_cast<uint16>(temp2->primitive_type_);
-      __ Ldrh(temp2, HeapOperand(temp2, primitive_offset));
-      static_assert(Primitive::kPrimNot == 0, "Expected 0 for kPrimNot");
-      __ Cbnz(temp2, intrinsic_slow_path->GetEntryLabel());
+      __ Bind(&do_copy);
+    } else {
+      DCHECK(!optimizations.GetDestinationIsTypedObjectArray());
+      // For class match, we can skip the array type check completely if at least one of source
+      // and destination is known to be a non primitive array, otherwise one check is enough.
+      __ B(intrinsic_slow_path->GetEntryLabel(), ne);
+      if (!optimizations.GetDestinationIsNonPrimitiveArray() &&
+          !optimizations.GetSourceIsNonPrimitiveArray()) {
+        check_non_primitive_array_class(temp2, temp2);
+      }
+    }
+  } else if (!optimizations.GetSourceIsNonPrimitiveArray()) {
+    DCHECK(optimizations.GetDestinationIsNonPrimitiveArray());
+    // Bail out if the source is not a non primitive array.
+    // No read barrier is needed for reading a chain of constant references for comparing
+    // with null, or for reading a constant primitive value, see `ReadBarrierOption`.
+    // /* HeapReference<Class> */ temp2 = src->klass_
+    __ Ldr(temp2, MemOperand(src, class_offset));
+    codegen_->GetAssembler()->MaybeUnpoisonHeapReference(temp2);
+    check_non_primitive_array_class(temp2, temp2);
+  }
+
+  if (length.IsConstant() && length.GetConstant()->AsIntConstant()->GetValue() == 0) {
+    // Null constant length: not need to emit the loop code at all.
+  } else {
+    vixl::aarch64::Label skip_copy_and_write_barrier;
+    if (length.IsRegister()) {
+      // Don't enter the copy loop if the length is null.
+      __ Cbz(WRegisterFrom(length), &skip_copy_and_write_barrier);
     }
 
-    if (length.IsConstant() && length.GetConstant()->AsIntConstant()->GetValue() == 0) {
-      // Null constant length: not need to emit the loop code at all.
-    } else {
+    {
+      // We use a block to end the scratch scope before the write barrier, thus
+      // freeing the temporary registers so they can be used in `MarkGCCard`.
+      UseScratchRegisterScope temps(masm);
+      bool emit_rb = codegen_->EmitBakerReadBarrier();
+      Register temp3;
+      Register tmp;
+      if (emit_rb) {
+        temp3 = WRegisterFrom(locations->GetTemp(2));
+        // Make sure `tmp` is not IP0, as it is clobbered by ReadBarrierMarkRegX entry points
+        // in ReadBarrierSystemArrayCopySlowPathARM64. Explicitly allocate the register IP1.
+        DCHECK(temps.IsAvailable(ip1));
+        temps.Exclude(ip1);
+        tmp = ip1.W();
+      } else {
+        temp3 = temps.AcquireW();
+        tmp = temps.AcquireW();
+      }
+
       Register src_curr_addr = temp1.X();
       Register dst_curr_addr = temp2.X();
       Register src_stop_addr = temp3.X();
-      vixl::aarch64::Label done;
       const DataType::Type type = DataType::Type::kReference;
       const int32_t element_size = DataType::Size(type);
 
-      if (length.IsRegister()) {
-        // Don't enter the copy loop if the length is null.
-        __ Cbz(WRegisterFrom(length), &done);
-      }
-
-      if (gUseReadBarrier && kUseBakerReadBarrier) {
+      SlowPathCodeARM64* read_barrier_slow_path = nullptr;
+      if (emit_rb) {
         // TODO: Also convert this intrinsic to the IsGcMarking strategy?
 
         // SystemArrayCopy implementation for Baker read barriers (see
@@ -3348,21 +3334,6 @@
         //     } while (src_ptr != end_ptr)
         //   }
 
-        // Make sure `tmp` is not IP0, as it is clobbered by
-        // ReadBarrierMarkRegX entry points in
-        // ReadBarrierSystemArrayCopySlowPathARM64.
-        DCHECK(temps.IsAvailable(ip0));
-        temps.Exclude(ip0);
-        Register tmp = temps.AcquireW();
-        DCHECK_NE(LocationFrom(tmp).reg(), IP0);
-        // Put IP0 back in the pool so that VIXL has at least one
-        // scratch register available to emit macro-instructions (note
-        // that IP1 is already used for `tmp`). Indeed some
-        // macro-instructions used in GenSystemArrayCopyAddresses
-        // (invoked hereunder) may require a scratch register (for
-        // instance to emit a load with a large constant offset).
-        temps.Include(ip0);
-
         // /* int32_t */ monitor = src->monitor_
         __ Ldr(tmp, HeapOperand(src.W(), monitor_offset));
         // /* LockWord */ lock_word = LockWord(monitor)
@@ -3376,78 +3347,57 @@
         // on `tmp`.
         __ Add(src.X(), src.X(), Operand(tmp.X(), LSR, 32));
 
-        // Compute base source address, base destination address, and end
-        // source address for System.arraycopy* intrinsics in `src_base`,
-        // `dst_base` and `src_end` respectively.
-        // Note that `src_curr_addr` is computed from from `src` (and
-        // `src_pos`) here, and thus honors the artificial dependency
-        // of `src` on `tmp`.
-        GenSystemArrayCopyAddresses(masm,
-                                    type,
-                                    src,
-                                    src_pos,
-                                    dest,
-                                    dest_pos,
-                                    length,
-                                    src_curr_addr,
-                                    dst_curr_addr,
-                                    src_stop_addr);
-
         // Slow path used to copy array when `src` is gray.
-        SlowPathCodeARM64* read_barrier_slow_path =
+        read_barrier_slow_path =
             new (codegen_->GetScopedAllocator()) ReadBarrierSystemArrayCopySlowPathARM64(
                 invoke, LocationFrom(tmp));
         codegen_->AddSlowPath(read_barrier_slow_path);
+      }
 
+      // Compute base source address, base destination address, and end
+      // source address for System.arraycopy* intrinsics in `src_base`,
+      // `dst_base` and `src_end` respectively.
+      // Note that `src_curr_addr` is computed from from `src` (and
+      // `src_pos`) here, and thus honors the artificial dependency
+      // of `src` on `tmp`.
+      GenSystemArrayCopyAddresses(masm,
+                                  type,
+                                  src,
+                                  src_pos,
+                                  dest,
+                                  dest_pos,
+                                  length,
+                                  src_curr_addr,
+                                  dst_curr_addr,
+                                  src_stop_addr);
+
+      if (emit_rb) {
         // Given the numeric representation, it's enough to check the low bit of the rb_state.
         static_assert(ReadBarrier::NonGrayState() == 0, "Expecting non-gray to have value 0");
         static_assert(ReadBarrier::GrayState() == 1, "Expecting gray to have value 1");
         __ Tbnz(tmp, LockWord::kReadBarrierStateShift, read_barrier_slow_path->GetEntryLabel());
-
-        // Fast-path copy.
-        // Iterate over the arrays and do a raw copy of the objects. We don't need to
-        // poison/unpoison.
-        vixl::aarch64::Label loop;
-        __ Bind(&loop);
-        __ Ldr(tmp, MemOperand(src_curr_addr, element_size, PostIndex));
-        __ Str(tmp, MemOperand(dst_curr_addr, element_size, PostIndex));
-        __ Cmp(src_curr_addr, src_stop_addr);
-        __ B(&loop, ne);
-
-        __ Bind(read_barrier_slow_path->GetExitLabel());
-      } else {
-        // Non read barrier code.
-        // Compute base source address, base destination address, and end
-        // source address for System.arraycopy* intrinsics in `src_base`,
-        // `dst_base` and `src_end` respectively.
-        GenSystemArrayCopyAddresses(masm,
-                                    type,
-                                    src,
-                                    src_pos,
-                                    dest,
-                                    dest_pos,
-                                    length,
-                                    src_curr_addr,
-                                    dst_curr_addr,
-                                    src_stop_addr);
-        // Iterate over the arrays and do a raw copy of the objects. We don't need to
-        // poison/unpoison.
-        vixl::aarch64::Label loop;
-        __ Bind(&loop);
-        {
-          Register tmp = temps.AcquireW();
-          __ Ldr(tmp, MemOperand(src_curr_addr, element_size, PostIndex));
-          __ Str(tmp, MemOperand(dst_curr_addr, element_size, PostIndex));
-        }
-        __ Cmp(src_curr_addr, src_stop_addr);
-        __ B(&loop, ne);
       }
-      __ Bind(&done);
-    }
-  }
 
-  // We only need one card marking on the destination array.
-  codegen_->MarkGCCard(dest.W(), Register(), /* emit_null_check= */ false);
+      // Iterate over the arrays and do a raw copy of the objects. We don't need to
+      // poison/unpoison.
+      vixl::aarch64::Label loop;
+      __ Bind(&loop);
+      __ Ldr(tmp, MemOperand(src_curr_addr, element_size, PostIndex));
+      __ Str(tmp, MemOperand(dst_curr_addr, element_size, PostIndex));
+      __ Cmp(src_curr_addr, src_stop_addr);
+      __ B(&loop, ne);
+
+      if (emit_rb) {
+        DCHECK(read_barrier_slow_path != nullptr);
+        __ Bind(read_barrier_slow_path->GetExitLabel());
+      }
+    }
+
+    // We only need one card marking on the destination array.
+    codegen_->MarkGCCard(dest.W());
+
+    __ Bind(&skip_copy_and_write_barrier);
+  }
 
   __ Bind(intrinsic_slow_path->GetExitLabel());
 }
@@ -3494,18 +3444,34 @@
   GenIsInfinite(invoke->GetLocations(), /* is64bit= */ true, GetVIXLAssembler());
 }
 
-void IntrinsicLocationsBuilderARM64::VisitIntegerValueOf(HInvoke* invoke) {
-  InvokeRuntimeCallingConvention calling_convention;
-  IntrinsicVisitor::ComputeIntegerValueOfLocations(
-      invoke,
-      codegen_,
-      calling_convention.GetReturnLocation(DataType::Type::kReference),
-      Location::RegisterLocation(calling_convention.GetRegisterAt(0).GetCode()));
-}
+#define VISIT_INTRINSIC(name, low, high, type, start_index) \
+  void IntrinsicLocationsBuilderARM64::Visit ##name ##ValueOf(HInvoke* invoke) { \
+    InvokeRuntimeCallingConvention calling_convention; \
+    IntrinsicVisitor::ComputeValueOfLocations( \
+        invoke, \
+        codegen_, \
+        low, \
+        high - low + 1, \
+        calling_convention.GetReturnLocation(DataType::Type::kReference), \
+        Location::RegisterLocation(calling_convention.GetRegisterAt(0).GetCode())); \
+  } \
+  void IntrinsicCodeGeneratorARM64::Visit ##name ##ValueOf(HInvoke* invoke) { \
+    IntrinsicVisitor::ValueOfInfo info = \
+        IntrinsicVisitor::ComputeValueOfInfo( \
+            invoke, \
+            codegen_->GetCompilerOptions(), \
+            WellKnownClasses::java_lang_ ##name ##_value, \
+            low, \
+            high - low + 1, \
+            start_index); \
+    HandleValueOf(invoke, info, type); \
+  }
+  BOXED_TYPES(VISIT_INTRINSIC)
+#undef VISIT_INTRINSIC
 
-void IntrinsicCodeGeneratorARM64::VisitIntegerValueOf(HInvoke* invoke) {
-  IntrinsicVisitor::IntegerValueOfInfo info =
-      IntrinsicVisitor::ComputeIntegerValueOfInfo(invoke, codegen_->GetCompilerOptions());
+void IntrinsicCodeGeneratorARM64::HandleValueOf(HInvoke* invoke,
+                                                const IntrinsicVisitor::ValueOfInfo& info,
+                                                DataType::Type type) {
   LocationSummary* locations = invoke->GetLocations();
   MacroAssembler* masm = GetVIXLAssembler();
 
@@ -3518,20 +3484,20 @@
     codegen_->InvokeRuntime(kQuickAllocObjectInitialized, invoke, invoke->GetDexPc());
     CheckEntrypointTypes<kQuickAllocObjectWithChecks, void*, mirror::Class*>();
   };
-  if (invoke->InputAt(0)->IsConstant()) {
+  if (invoke->InputAt(0)->IsIntConstant()) {
     int32_t value = invoke->InputAt(0)->AsIntConstant()->GetValue();
     if (static_cast<uint32_t>(value - info.low) < info.length) {
-      // Just embed the j.l.Integer in the code.
-      DCHECK_NE(info.value_boot_image_reference, IntegerValueOfInfo::kInvalidReference);
+      // Just embed the object in the code.
+      DCHECK_NE(info.value_boot_image_reference, ValueOfInfo::kInvalidReference);
       codegen_->LoadBootImageAddress(out, info.value_boot_image_reference);
     } else {
       DCHECK(locations->CanCall());
-      // Allocate and initialize a new j.l.Integer.
-      // TODO: If we JIT, we could allocate the j.l.Integer now, and store it in the
+      // Allocate and initialize a new object.
+      // TODO: If we JIT, we could allocate the object now, and store it in the
       // JIT object table.
       allocate_instance();
       __ Mov(temp.W(), value);
-      __ Str(temp.W(), HeapOperand(out.W(), info.value_offset));
+      codegen_->Store(type, temp.W(), HeapOperand(out.W(), info.value_offset));
       // Class pointer and `value` final field stores require a barrier before publication.
       codegen_->GenerateMemoryBarrier(MemBarrierKind::kStoreStore);
     }
@@ -3543,7 +3509,7 @@
     __ Cmp(out.W(), info.length);
     vixl::aarch64::Label allocate, done;
     __ B(&allocate, hs);
-    // If the value is within the bounds, load the j.l.Integer directly from the array.
+    // If the value is within the bounds, load the object directly from the array.
     codegen_->LoadBootImageAddress(temp, info.array_data_boot_image_reference);
     MemOperand source = HeapOperand(
         temp, out.X(), LSL, DataType::SizeShift(DataType::Type::kReference));
@@ -3551,9 +3517,9 @@
     codegen_->GetAssembler()->MaybeUnpoisonHeapReference(out);
     __ B(&done);
     __ Bind(&allocate);
-    // Otherwise allocate and initialize a new j.l.Integer.
+    // Otherwise allocate and initialize a new object.
     allocate_instance();
-    __ Str(in.W(), HeapOperand(out.W(), info.value_offset));
+    codegen_->Store(type, in.W(), HeapOperand(out.W(), info.value_offset));
     // Class pointer and `value` final field stores require a barrier before publication.
     codegen_->GenerateMemoryBarrier(MemBarrierKind::kStoreStore);
     __ Bind(&done);
@@ -3563,7 +3529,7 @@
 void IntrinsicLocationsBuilderARM64::VisitReferenceGetReferent(HInvoke* invoke) {
   IntrinsicVisitor::CreateReferenceGetReferentLocations(invoke, codegen_);
 
-  if (gUseReadBarrier && kUseBakerReadBarrier && invoke->GetLocations() != nullptr) {
+  if (codegen_->EmitBakerReadBarrier() && invoke->GetLocations() != nullptr) {
     invoke->GetLocations()->AddTemp(Location::RequiresRegister());
   }
 }
@@ -3578,7 +3544,7 @@
   SlowPathCodeARM64* slow_path = new (GetAllocator()) IntrinsicSlowPathARM64(invoke);
   codegen_->AddSlowPath(slow_path);
 
-  if (gUseReadBarrier) {
+  if (codegen_->EmitReadBarrier()) {
     // Check self->GetWeakRefAccessEnabled().
     UseScratchRegisterScope temps(masm);
     Register temp = temps.AcquireW();
@@ -3605,7 +3571,7 @@
 
   // Load the value from the field.
   uint32_t referent_offset = mirror::Reference::ReferentOffset().Uint32Value();
-  if (gUseReadBarrier && kUseBakerReadBarrier) {
+  if (codegen_->EmitBakerReadBarrier()) {
     codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
                                                     out,
                                                     WRegisterFrom(obj),
@@ -3623,7 +3589,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitReferenceRefersTo(HInvoke* invoke) {
-  IntrinsicVisitor::CreateReferenceRefersToLocations(invoke);
+  IntrinsicVisitor::CreateReferenceRefersToLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitReferenceRefersTo(HInvoke* invoke) {
@@ -3645,7 +3611,7 @@
 
   __ Cmp(tmp, other);
 
-  if (gUseReadBarrier) {
+  if (codegen_->EmitReadBarrier()) {
     DCHECK(kUseBakerReadBarrier);
 
     vixl::aarch64::Label calculate_result;
@@ -3705,7 +3671,7 @@
   locations->SetInAt(0, Location::Any());
 }
 
-void IntrinsicCodeGeneratorARM64::VisitReachabilityFence(HInvoke* invoke ATTRIBUTE_UNUSED) { }
+void IntrinsicCodeGeneratorARM64::VisitReachabilityFence([[maybe_unused]] HInvoke* invoke) {}
 
 void IntrinsicLocationsBuilderARM64::VisitCRC32Update(HInvoke* invoke) {
   if (!codegen_->GetInstructionSetFeatures().HasCRC()) {
@@ -4003,7 +3969,7 @@
 void GenerateFP16Round(HInvoke* invoke,
                        CodeGeneratorARM64* const codegen_,
                        MacroAssembler* masm,
-                       const OP roundOp) {
+                       OP&& roundOp) {
   DCHECK(codegen_->GetInstructionSetFeatures().HasFP16());
   LocationSummary* locations = invoke->GetLocations();
   UseScratchRegisterScope scratch_scope(masm);
@@ -4334,7 +4300,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitMathFmaDouble(HInvoke* invoke) {
-  CreateFPFPFPToFPCallLocations(allocator_, invoke);
+  CreateFPFPFPToFPLocations(allocator_, invoke);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitMathFmaDouble(HInvoke* invoke) {
@@ -4342,7 +4308,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitMathFmaFloat(HInvoke* invoke) {
-  CreateFPFPFPToFPCallLocations(allocator_, invoke);
+  CreateFPFPFPToFPLocations(allocator_, invoke);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitMathFmaFloat(HInvoke* invoke) {
@@ -4724,24 +4690,24 @@
       __ Mov(target.offset, target_field->GetOffset().Uint32Value());
     } else {
       // For static fields, we need to fill the `target.object` with the declaring class,
-      // so we can use `target.object` as temporary for the `ArtMethod*`. For instance fields,
-      // we do not need the declaring class, so we can forget the `ArtMethod*` when
-      // we load the `target.offset`, so use the `target.offset` to hold the `ArtMethod*`.
-      Register method = (expected_coordinates_count == 0) ? target.object : target.offset;
+      // so we can use `target.object` as temporary for the `ArtField*`. For instance fields,
+      // we do not need the declaring class, so we can forget the `ArtField*` when
+      // we load the `target.offset`, so use the `target.offset` to hold the `ArtField*`.
+      Register field = (expected_coordinates_count == 0) ? target.object : target.offset;
 
       const MemberOffset art_field_offset = mirror::FieldVarHandle::ArtFieldOffset();
       const MemberOffset offset_offset = ArtField::OffsetOffset();
 
-      // Load the ArtField, the offset and, if needed, declaring class.
-      __ Ldr(method.X(), HeapOperand(varhandle, art_field_offset.Int32Value()));
-      __ Ldr(target.offset, MemOperand(method.X(), offset_offset.Int32Value()));
+      // Load the ArtField*, the offset and, if needed, declaring class.
+      __ Ldr(field.X(), HeapOperand(varhandle, art_field_offset.Int32Value()));
+      __ Ldr(target.offset, MemOperand(field.X(), offset_offset.Int32Value()));
       if (expected_coordinates_count == 0u) {
         codegen->GenerateGcRootFieldLoad(invoke,
                                          LocationFrom(target.object),
-                                         method.X(),
+                                         field.X(),
                                          ArtField::DeclaringClassOffset().Int32Value(),
-                                         /*fixup_label=*/ nullptr,
-                                         gCompilerReadBarrierOption);
+                                         /*fixup_label=*/nullptr,
+                                         codegen->GetCompilerReadBarrierOption());
       }
     }
   } else {
@@ -4761,7 +4727,8 @@
   }
 }
 
-static LocationSummary* CreateVarHandleCommonLocations(HInvoke* invoke) {
+static LocationSummary* CreateVarHandleCommonLocations(HInvoke* invoke,
+                                                       CodeGeneratorARM64* codegen) {
   size_t expected_coordinates_count = GetExpectedVarHandleCoordinatesCount(invoke);
   DataType::Type return_type = invoke->GetType();
 
@@ -4795,7 +4762,7 @@
   }
 
   // Add a temporary for offset.
-  if ((gUseReadBarrier && !kUseBakerReadBarrier) &&
+  if (codegen->EmitNonBakerReadBarrier() &&
       GetExpectedVarHandleCoordinatesCount(invoke) == 0u) {  // For static fields.
     // To preserve the offset value across the non-Baker read barrier slow path
     // for loading the declaring class, use a fixed callee-save register.
@@ -4812,13 +4779,13 @@
   return locations;
 }
 
-static void CreateVarHandleGetLocations(HInvoke* invoke) {
+static void CreateVarHandleGetLocations(HInvoke* invoke, CodeGeneratorARM64* codegen) {
   VarHandleOptimizations optimizations(invoke);
   if (optimizations.GetDoNotIntrinsify()) {
     return;
   }
 
-  if ((gUseReadBarrier && !kUseBakerReadBarrier) &&
+  if (codegen->EmitNonBakerReadBarrier() &&
       invoke->GetType() == DataType::Type::kReference &&
       invoke->GetIntrinsic() != Intrinsics::kVarHandleGet &&
       invoke->GetIntrinsic() != Intrinsics::kVarHandleGetOpaque) {
@@ -4828,7 +4795,7 @@
     return;
   }
 
-  CreateVarHandleCommonLocations(invoke);
+  CreateVarHandleCommonLocations(invoke, codegen);
 }
 
 static void GenerateVarHandleGet(HInvoke* invoke,
@@ -4858,7 +4825,7 @@
   DCHECK(use_load_acquire || order == std::memory_order_relaxed);
 
   // Load the value from the target location.
-  if (type == DataType::Type::kReference && gUseReadBarrier && kUseBakerReadBarrier) {
+  if (type == DataType::Type::kReference && codegen->EmitBakerReadBarrier()) {
     // Piggy-back on the field load path using introspection for the Baker read barrier.
     // The `target.offset` is a temporary, use it for field address.
     Register tmp_ptr = target.offset.X();
@@ -4911,7 +4878,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGet(HInvoke* invoke) {
-  CreateVarHandleGetLocations(invoke);
+  CreateVarHandleGetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGet(HInvoke* invoke) {
@@ -4919,7 +4886,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetOpaque(HInvoke* invoke) {
-  CreateVarHandleGetLocations(invoke);
+  CreateVarHandleGetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetOpaque(HInvoke* invoke) {
@@ -4927,7 +4894,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetAcquire(HInvoke* invoke) {
-  CreateVarHandleGetLocations(invoke);
+  CreateVarHandleGetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetAcquire(HInvoke* invoke) {
@@ -4935,20 +4902,20 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetVolatile(HInvoke* invoke) {
-  CreateVarHandleGetLocations(invoke);
+  CreateVarHandleGetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetVolatile(HInvoke* invoke) {
   GenerateVarHandleGet(invoke, codegen_, std::memory_order_seq_cst);
 }
 
-static void CreateVarHandleSetLocations(HInvoke* invoke) {
+static void CreateVarHandleSetLocations(HInvoke* invoke, CodeGeneratorARM64* codegen) {
   VarHandleOptimizations optimizations(invoke);
   if (optimizations.GetDoNotIntrinsify()) {
     return;
   }
 
-  CreateVarHandleCommonLocations(invoke);
+  CreateVarHandleCommonLocations(invoke, codegen);
 }
 
 static void GenerateVarHandleSet(HInvoke* invoke,
@@ -5010,7 +4977,7 @@
   }
 
   if (CodeGenerator::StoreNeedsWriteBarrier(value_type, invoke->InputAt(value_index))) {
-    codegen->MarkGCCard(target.object, Register(value), /* emit_null_check= */ true);
+    codegen->MaybeMarkGCCard(target.object, Register(value), /* emit_null_check= */ true);
   }
 
   if (slow_path != nullptr) {
@@ -5020,7 +4987,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleSet(HInvoke* invoke) {
-  CreateVarHandleSetLocations(invoke);
+  CreateVarHandleSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleSet(HInvoke* invoke) {
@@ -5028,7 +4995,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleSetOpaque(HInvoke* invoke) {
-  CreateVarHandleSetLocations(invoke);
+  CreateVarHandleSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleSetOpaque(HInvoke* invoke) {
@@ -5036,7 +5003,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleSetRelease(HInvoke* invoke) {
-  CreateVarHandleSetLocations(invoke);
+  CreateVarHandleSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleSetRelease(HInvoke* invoke) {
@@ -5044,14 +5011,16 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleSetVolatile(HInvoke* invoke) {
-  CreateVarHandleSetLocations(invoke);
+  CreateVarHandleSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleSetVolatile(HInvoke* invoke) {
   GenerateVarHandleSet(invoke, codegen_, std::memory_order_seq_cst);
 }
 
-static void CreateVarHandleCompareAndSetOrExchangeLocations(HInvoke* invoke, bool return_success) {
+static void CreateVarHandleCompareAndSetOrExchangeLocations(HInvoke* invoke,
+                                                            CodeGeneratorARM64* codegen,
+                                                            bool return_success) {
   VarHandleOptimizations optimizations(invoke);
   if (optimizations.GetDoNotIntrinsify()) {
     return;
@@ -5059,8 +5028,7 @@
 
   uint32_t number_of_arguments = invoke->GetNumberOfArguments();
   DataType::Type value_type = GetDataTypeFromShorty(invoke, number_of_arguments - 1u);
-  if ((gUseReadBarrier && !kUseBakerReadBarrier) &&
-      value_type == DataType::Type::kReference) {
+  if (value_type == DataType::Type::kReference && codegen->EmitNonBakerReadBarrier()) {
     // Unsupported for non-Baker read barrier because the artReadBarrierSlow() ignores
     // the passed reference and reloads it from the field. This breaks the read barriers
     // in slow path in different ways. The marked old value may not actually be a to-space
@@ -5071,9 +5039,9 @@
     return;
   }
 
-  LocationSummary* locations = CreateVarHandleCommonLocations(invoke);
+  LocationSummary* locations = CreateVarHandleCommonLocations(invoke, codegen);
 
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+  if (codegen->EmitNonBakerReadBarrier()) {
     // We need callee-save registers for both the class object and offset instead of
     // the temporaries reserved in CreateVarHandleCommonLocations().
     static_assert(POPCOUNT(kArm64CalleeSaveRefSpills) >= 2u);
@@ -5114,7 +5082,7 @@
       locations->AddTemp(Location::RequiresRegister());
     }
   }
-  if (gUseReadBarrier && value_type == DataType::Type::kReference) {
+  if (value_type == DataType::Type::kReference && codegen->EmitReadBarrier()) {
     // Add a temporary for the `old_value_temp` in slow path.
     locations->AddTemp(Location::RequiresRegister());
   }
@@ -5173,14 +5141,14 @@
   if (CodeGenerator::StoreNeedsWriteBarrier(value_type, invoke->InputAt(new_value_index))) {
     // Mark card for object assuming new value is stored.
     bool new_value_can_be_null = true;  // TODO: Worth finding out this information?
-    codegen->MarkGCCard(target.object, new_value.W(), new_value_can_be_null);
+    codegen->MaybeMarkGCCard(target.object, new_value.W(), new_value_can_be_null);
   }
 
   // Reuse the `offset` temporary for the pointer to the target location,
   // except for references that need the offset for the read barrier.
   UseScratchRegisterScope temps(masm);
   Register tmp_ptr = target.offset.X();
-  if (gUseReadBarrier && value_type == DataType::Type::kReference) {
+  if (value_type == DataType::Type::kReference && codegen->EmitReadBarrier()) {
     tmp_ptr = temps.AcquireX();
   }
   __ Add(tmp_ptr, target.object.X(), target.offset.X());
@@ -5263,7 +5231,7 @@
   vixl::aarch64::Label* exit_loop = &exit_loop_label;
   vixl::aarch64::Label* cmp_failure = &exit_loop_label;
 
-  if (gUseReadBarrier && value_type == DataType::Type::kReference) {
+  if (value_type == DataType::Type::kReference && codegen->EmitReadBarrier()) {
     // The `old_value_temp` is used first for the marked `old_value` and then for the unmarked
     // reloaded old value for subsequent CAS in the slow path. It cannot be a scratch register.
     size_t expected_coordinates_count = GetExpectedVarHandleCoordinatesCount(invoke);
@@ -5330,7 +5298,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleCompareAndExchange(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, /*return_success=*/ false);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ false);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleCompareAndExchange(HInvoke* invoke) {
@@ -5339,7 +5307,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleCompareAndExchangeAcquire(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, /*return_success=*/ false);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ false);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleCompareAndExchangeAcquire(HInvoke* invoke) {
@@ -5348,7 +5316,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleCompareAndExchangeRelease(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, /*return_success=*/ false);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ false);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleCompareAndExchangeRelease(HInvoke* invoke) {
@@ -5357,7 +5325,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleCompareAndSet(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, /*return_success=*/ true);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ true);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleCompareAndSet(HInvoke* invoke) {
@@ -5366,7 +5334,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleWeakCompareAndSet(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, /*return_success=*/ true);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ true);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleWeakCompareAndSet(HInvoke* invoke) {
@@ -5375,7 +5343,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleWeakCompareAndSetAcquire(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, /*return_success=*/ true);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ true);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleWeakCompareAndSetAcquire(HInvoke* invoke) {
@@ -5384,7 +5352,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleWeakCompareAndSetPlain(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, /*return_success=*/ true);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ true);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleWeakCompareAndSetPlain(HInvoke* invoke) {
@@ -5393,7 +5361,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleWeakCompareAndSetRelease(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, /*return_success=*/ true);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ true);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleWeakCompareAndSetRelease(HInvoke* invoke) {
@@ -5402,21 +5370,21 @@
 }
 
 static void CreateVarHandleGetAndUpdateLocations(HInvoke* invoke,
+                                                 CodeGeneratorARM64* codegen,
                                                  GetAndUpdateOp get_and_update_op) {
   VarHandleOptimizations optimizations(invoke);
   if (optimizations.GetDoNotIntrinsify()) {
     return;
   }
 
-  if ((gUseReadBarrier && !kUseBakerReadBarrier) &&
-      invoke->GetType() == DataType::Type::kReference) {
+  if (invoke->GetType() == DataType::Type::kReference && codegen->EmitNonBakerReadBarrier()) {
     // Unsupported for non-Baker read barrier because the artReadBarrierSlow() ignores
     // the passed reference and reloads it from the field, thus seeing the new value
     // that we have just stored. (And it also gets the memory visibility wrong.) b/173104084
     return;
   }
 
-  LocationSummary* locations = CreateVarHandleCommonLocations(invoke);
+  LocationSummary* locations = CreateVarHandleCommonLocations(invoke, codegen);
 
   size_t old_temp_count = locations->GetTempCount();
   DCHECK_EQ(old_temp_count, (GetExpectedVarHandleCoordinatesCount(invoke) == 0) ? 2u : 1u);
@@ -5477,15 +5445,14 @@
     DCHECK(get_and_update_op == GetAndUpdateOp::kSet);
     // Mark card for object, the new value shall be stored.
     bool new_value_can_be_null = true;  // TODO: Worth finding out this information?
-    codegen->MarkGCCard(target.object, arg.W(), new_value_can_be_null);
+    codegen->MaybeMarkGCCard(target.object, arg.W(), new_value_can_be_null);
   }
 
   // Reuse the `target.offset` temporary for the pointer to the target location,
   // except for references that need the offset for the non-Baker read barrier.
   UseScratchRegisterScope temps(masm);
   Register tmp_ptr = target.offset.X();
-  if ((gUseReadBarrier && !kUseBakerReadBarrier) &&
-      value_type == DataType::Type::kReference) {
+  if (value_type == DataType::Type::kReference && codegen->EmitNonBakerReadBarrier()) {
     tmp_ptr = temps.AcquireX();
   }
   __ Add(tmp_ptr, target.object.X(), target.offset.X());
@@ -5514,8 +5481,7 @@
       // the new value unless it is zero bit pattern (+0.0f or +0.0) and need another one
       // in GenerateGetAndUpdate(). We have allocated a normal temporary to handle that.
       old_value = CPURegisterFrom(locations->GetTemp(1u), load_store_type);
-    } else if ((gUseReadBarrier && kUseBakerReadBarrier) &&
-               value_type == DataType::Type::kReference) {
+    } else if (value_type == DataType::Type::kReference && codegen->EmitBakerReadBarrier()) {
       // Load the old value initially to a scratch register.
       // We shall move it to `out` later with a read barrier.
       old_value = temps.AcquireW();
@@ -5562,9 +5528,9 @@
     __ Sxtb(out.W(), old_value.W());
   } else if (value_type == DataType::Type::kInt16) {
     __ Sxth(out.W(), old_value.W());
-  } else if (gUseReadBarrier && value_type == DataType::Type::kReference) {
+  } else if (value_type == DataType::Type::kReference && codegen->EmitReadBarrier()) {
     if (kUseBakerReadBarrier) {
-      codegen->GenerateIntrinsicCasMoveWithBakerReadBarrier(out.W(), old_value.W());
+      codegen->GenerateIntrinsicMoveWithBakerReadBarrier(out.W(), old_value.W());
     } else {
       codegen->GenerateReadBarrierSlow(
           invoke,
@@ -5583,7 +5549,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetAndSet(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kSet);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kSet);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetAndSet(HInvoke* invoke) {
@@ -5591,7 +5557,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetAndSetAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kSet);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kSet);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetAndSetAcquire(HInvoke* invoke) {
@@ -5599,7 +5565,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetAndSetRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kSet);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kSet);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetAndSetRelease(HInvoke* invoke) {
@@ -5607,7 +5573,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetAndAdd(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kAdd);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAdd);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetAndAdd(HInvoke* invoke) {
@@ -5615,7 +5581,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetAndAddAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kAdd);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAdd);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetAndAddAcquire(HInvoke* invoke) {
@@ -5623,7 +5589,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetAndAddRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kAdd);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAdd);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetAndAddRelease(HInvoke* invoke) {
@@ -5631,7 +5597,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetAndBitwiseAnd(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kAnd);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAnd);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetAndBitwiseAnd(HInvoke* invoke) {
@@ -5639,7 +5605,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetAndBitwiseAndAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kAnd);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAnd);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetAndBitwiseAndAcquire(HInvoke* invoke) {
@@ -5647,7 +5613,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetAndBitwiseAndRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kAnd);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAnd);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetAndBitwiseAndRelease(HInvoke* invoke) {
@@ -5655,7 +5621,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetAndBitwiseOr(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kOr);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kOr);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetAndBitwiseOr(HInvoke* invoke) {
@@ -5663,7 +5629,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetAndBitwiseOrAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kOr);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kOr);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetAndBitwiseOrAcquire(HInvoke* invoke) {
@@ -5671,7 +5637,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetAndBitwiseOrRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kOr);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kOr);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetAndBitwiseOrRelease(HInvoke* invoke) {
@@ -5679,7 +5645,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetAndBitwiseXor(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kXor);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kXor);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetAndBitwiseXor(HInvoke* invoke) {
@@ -5687,7 +5653,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetAndBitwiseXorAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kXor);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kXor);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetAndBitwiseXorAcquire(HInvoke* invoke) {
@@ -5695,7 +5661,7 @@
 }
 
 void IntrinsicLocationsBuilderARM64::VisitVarHandleGetAndBitwiseXorRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kXor);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kXor);
 }
 
 void IntrinsicCodeGeneratorARM64::VisitVarHandleGetAndBitwiseXorRelease(HInvoke* invoke) {
diff --git a/compiler/optimizing/intrinsics_arm64.h b/compiler/optimizing/intrinsics_arm64.h
index a0ccf87..d103caf 100644
--- a/compiler/optimizing/intrinsics_arm64.h
+++ b/compiler/optimizing/intrinsics_arm64.h
@@ -19,6 +19,7 @@
 
 #include "base/macros.h"
 #include "intrinsics.h"
+#include "intrinsics_list.h"
 
 namespace vixl {
 namespace aarch64 {
@@ -47,9 +48,7 @@
 
 #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \
   void Visit ## Name(HInvoke* invoke) override;
-#include "intrinsics_list.h"
-  INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
-#undef INTRINSICS_LIST
+  ART_INTRINSICS_WITH_HINVOKE_LIST(OPTIMIZING_INTRINSICS)
 #undef OPTIMIZING_INTRINSICS
 
   // Check whether an invoke is an intrinsic, and if so, create a location summary. Returns whether
@@ -72,9 +71,7 @@
 
 #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \
   void Visit ## Name(HInvoke* invoke) override;
-#include "intrinsics_list.h"
-  INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
-#undef INTRINSICS_LIST
+  ART_INTRINSICS_WITH_HINVOKE_LIST(OPTIMIZING_INTRINSICS)
 #undef OPTIMIZING_INTRINSICS
 
  private:
@@ -82,6 +79,10 @@
 
   ArenaAllocator* GetAllocator();
 
+  void HandleValueOf(HInvoke* invoke,
+                     const IntrinsicVisitor::ValueOfInfo& info,
+                     DataType::Type type);
+
   CodeGeneratorARM64* const codegen_;
 
   DISALLOW_COPY_AND_ASSIGN(IntrinsicCodeGeneratorARM64);
diff --git a/compiler/optimizing/intrinsics_arm_vixl.cc b/compiler/optimizing/intrinsics_arm_vixl.cc
index 22c51c6..c763721 100644
--- a/compiler/optimizing/intrinsics_arm_vixl.cc
+++ b/compiler/optimizing/intrinsics_arm_vixl.cc
@@ -22,6 +22,7 @@
 #include "code_generator_arm_vixl.h"
 #include "common_arm.h"
 #include "heap_poisoning.h"
+#include "intrinsic_objects.h"
 #include "intrinsics.h"
 #include "intrinsics_utils.h"
 #include "lock_word.h"
@@ -31,6 +32,7 @@
 #include "mirror/string-inl.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread-current-inl.h"
+#include "well_known_classes.h"
 
 #include "aarch32/constants-aarch32.h"
 
@@ -49,6 +51,7 @@
 using helpers::LowRegisterFrom;
 using helpers::LowSRegisterFrom;
 using helpers::HighSRegisterFrom;
+using helpers::OperandFrom;
 using helpers::OutputDRegister;
 using helpers::OutputRegister;
 using helpers::RegisterFrom;
@@ -71,60 +74,15 @@
                                                    SlowPathCodeARMVIXL,
                                                    ArmVIXLAssembler>;
 
-// Compute base address for the System.arraycopy intrinsic in `base`.
-static void GenSystemArrayCopyBaseAddress(ArmVIXLAssembler* assembler,
-                                          DataType::Type type,
-                                          const vixl32::Register& array,
-                                          const Location& pos,
-                                          const vixl32::Register& base) {
-  // This routine is only used by the SystemArrayCopy intrinsic at the
-  // moment. We can allow DataType::Type::kReference as `type` to implement
-  // the SystemArrayCopyChar intrinsic.
-  DCHECK_EQ(type, DataType::Type::kReference);
-  const int32_t element_size = DataType::Size(type);
-  const uint32_t element_size_shift = DataType::SizeShift(type);
-  const uint32_t data_offset = mirror::Array::DataOffset(element_size).Uint32Value();
-
-  if (pos.IsConstant()) {
-    int32_t constant = Int32ConstantFrom(pos);
-    __ Add(base, array, element_size * constant + data_offset);
-  } else {
-    __ Add(base, array, Operand(RegisterFrom(pos), vixl32::LSL, element_size_shift));
-    __ Add(base, base, data_offset);
-  }
-}
-
-// Compute end address for the System.arraycopy intrinsic in `end`.
-static void GenSystemArrayCopyEndAddress(ArmVIXLAssembler* assembler,
-                                         DataType::Type type,
-                                         const Location& copy_length,
-                                         const vixl32::Register& base,
-                                         const vixl32::Register& end) {
-  // This routine is only used by the SystemArrayCopy intrinsic at the
-  // moment. We can allow DataType::Type::kReference as `type` to implement
-  // the SystemArrayCopyChar intrinsic.
-  DCHECK_EQ(type, DataType::Type::kReference);
-  const int32_t element_size = DataType::Size(type);
-  const uint32_t element_size_shift = DataType::SizeShift(type);
-
-  if (copy_length.IsConstant()) {
-    int32_t constant = Int32ConstantFrom(copy_length);
-    __ Add(end, base, element_size * constant);
-  } else {
-    __ Add(end, base, Operand(RegisterFrom(copy_length), vixl32::LSL, element_size_shift));
-  }
-}
-
 // Slow path implementing the SystemArrayCopy intrinsic copy loop with read barriers.
 class ReadBarrierSystemArrayCopySlowPathARMVIXL : public SlowPathCodeARMVIXL {
  public:
   explicit ReadBarrierSystemArrayCopySlowPathARMVIXL(HInstruction* instruction)
       : SlowPathCodeARMVIXL(instruction) {
-    DCHECK(gUseReadBarrier);
-    DCHECK(kUseBakerReadBarrier);
   }
 
   void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitBakerReadBarrier());
     CodeGeneratorARMVIXL* arm_codegen = down_cast<CodeGeneratorARMVIXL*>(codegen);
     ArmVIXLAssembler* assembler = arm_codegen->GetAssembler();
     LocationSummary* locations = instruction_->GetLocations();
@@ -138,17 +96,13 @@
     DataType::Type type = DataType::Type::kReference;
     const int32_t element_size = DataType::Size(type);
 
-    vixl32::Register dest = InputRegisterAt(instruction_, 2);
-    Location dest_pos = locations->InAt(3);
     vixl32::Register src_curr_addr = RegisterFrom(locations->GetTemp(0));
     vixl32::Register dst_curr_addr = RegisterFrom(locations->GetTemp(1));
     vixl32::Register src_stop_addr = RegisterFrom(locations->GetTemp(2));
     vixl32::Register tmp = RegisterFrom(locations->GetTemp(3));
 
     __ Bind(GetEntryLabel());
-    // Compute the base destination address in `dst_curr_addr`.
-    GenSystemArrayCopyBaseAddress(assembler, type, dest, dest_pos, dst_curr_addr);
-
+    // The source range and destination pointer were initialized before entering the slow-path.
     vixl32::Label loop;
     __ Bind(&loop);
     __ Ldr(tmp, MemOperand(src_curr_addr, element_size, PostIndex));
@@ -1239,99 +1193,111 @@
   __ Bind(slow_path->GetExitLabel());
 }
 
-void IntrinsicLocationsBuilderARMVIXL::VisitSystemArrayCopy(HInvoke* invoke) {
-  // The only read barrier implementation supporting the
-  // SystemArrayCopy intrinsic is the Baker-style read barriers.
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
-    return;
-  }
-
-  CodeGenerator::CreateSystemArrayCopyLocationSummary(invoke);
-  LocationSummary* locations = invoke->GetLocations();
-  if (locations == nullptr) {
-    return;
-  }
-
-  HIntConstant* src_pos = invoke->InputAt(1)->AsIntConstant();
-  HIntConstant* dest_pos = invoke->InputAt(3)->AsIntConstant();
-  HIntConstant* length = invoke->InputAt(4)->AsIntConstant();
-
-  if (src_pos != nullptr && !assembler_->ShifterOperandCanAlwaysHold(src_pos->GetValue())) {
-    locations->SetInAt(1, Location::RequiresRegister());
-  }
-  if (dest_pos != nullptr && !assembler_->ShifterOperandCanAlwaysHold(dest_pos->GetValue())) {
-    locations->SetInAt(3, Location::RequiresRegister());
-  }
-  if (length != nullptr && !assembler_->ShifterOperandCanAlwaysHold(length->GetValue())) {
-    locations->SetInAt(4, Location::RequiresRegister());
-  }
-  if (gUseReadBarrier && kUseBakerReadBarrier) {
-    // Temporary register IP cannot be used in
-    // ReadBarrierSystemArrayCopySlowPathARM (because that register
-    // is clobbered by ReadBarrierMarkRegX entry points). Get an extra
-    // temporary register from the register allocator.
-    locations->AddTemp(Location::RequiresRegister());
+static void GenArrayAddress(ArmVIXLAssembler* assembler,
+                            vixl32::Register dest,
+                            vixl32::Register base,
+                            Location pos,
+                            DataType::Type type,
+                            int32_t data_offset) {
+  if (pos.IsConstant()) {
+    int32_t constant = pos.GetConstant()->AsIntConstant()->GetValue();
+    __ Add(dest, base, static_cast<int32_t>(DataType::Size(type)) * constant + data_offset);
+  } else {
+    if (data_offset != 0) {
+      __ Add(dest, base, data_offset);
+      base = dest;
+    }
+    __ Add(dest, base, Operand(RegisterFrom(pos), LSL, DataType::SizeShift(type)));
   }
 }
 
-static void CheckPosition(ArmVIXLAssembler* assembler,
-                          Location pos,
-                          vixl32::Register input,
-                          Location length,
-                          SlowPathCodeARMVIXL* slow_path,
-                          vixl32::Register temp,
-                          bool length_is_input_length = false) {
+static Location LocationForSystemArrayCopyInput(ArmVIXLAssembler* assembler, HInstruction* input) {
+  HIntConstant* const_input = input->AsIntConstantOrNull();
+  if (const_input != nullptr && assembler->ShifterOperandCanAlwaysHold(const_input->GetValue())) {
+    return Location::ConstantLocation(const_input);
+  } else {
+    return Location::RequiresRegister();
+  }
+}
+
+// We choose to use the native implementation for longer copy lengths.
+static constexpr int32_t kSystemArrayCopyThreshold = 128;
+
+void IntrinsicLocationsBuilderARMVIXL::VisitSystemArrayCopy(HInvoke* invoke) {
+  // The only read barrier implementation supporting the
+  // SystemArrayCopy intrinsic is the Baker-style read barriers.
+  if (codegen_->EmitNonBakerReadBarrier()) {
+    return;
+  }
+
+  constexpr size_t kInitialNumTemps = 3u;  // We need at least three temps.
+  LocationSummary* locations = CodeGenerator::CreateSystemArrayCopyLocationSummary(
+      invoke, kSystemArrayCopyThreshold, kInitialNumTemps);
+  if (locations != nullptr) {
+    locations->SetInAt(1, LocationForSystemArrayCopyInput(assembler_, invoke->InputAt(1)));
+    locations->SetInAt(3, LocationForSystemArrayCopyInput(assembler_, invoke->InputAt(3)));
+    locations->SetInAt(4, LocationForSystemArrayCopyInput(assembler_, invoke->InputAt(4)));
+    if (codegen_->EmitBakerReadBarrier()) {
+      // Temporary register IP cannot be used in
+      // ReadBarrierSystemArrayCopySlowPathARM (because that register
+      // is clobbered by ReadBarrierMarkRegX entry points). Get an extra
+      // temporary register from the register allocator.
+      locations->AddTemp(Location::RequiresRegister());
+    }
+  }
+}
+
+static void CheckSystemArrayCopyPosition(ArmVIXLAssembler* assembler,
+                                         vixl32::Register array,
+                                         Location pos,
+                                         Location length,
+                                         SlowPathCodeARMVIXL* slow_path,
+                                         vixl32::Register temp,
+                                         bool length_is_array_length,
+                                         bool position_sign_checked) {
   // Where is the length in the Array?
   const uint32_t length_offset = mirror::Array::LengthOffset().Uint32Value();
 
   if (pos.IsConstant()) {
     int32_t pos_const = Int32ConstantFrom(pos);
     if (pos_const == 0) {
-      if (!length_is_input_length) {
-        // Check that length(input) >= length.
-        __ Ldr(temp, MemOperand(input, length_offset));
-        if (length.IsConstant()) {
-          __ Cmp(temp, Int32ConstantFrom(length));
-        } else {
-          __ Cmp(temp, RegisterFrom(length));
-        }
+      if (!length_is_array_length) {
+        // Check that length(array) >= length.
+        __ Ldr(temp, MemOperand(array, length_offset));
+        __ Cmp(temp, OperandFrom(length, DataType::Type::kInt32));
         __ B(lt, slow_path->GetEntryLabel());
       }
     } else {
-      // Check that length(input) >= pos.
-      __ Ldr(temp, MemOperand(input, length_offset));
-      __ Subs(temp, temp, pos_const);
-      __ B(lt, slow_path->GetEntryLabel());
+      // Calculate length(array) - pos.
+      // Both operands are known to be non-negative `int32_t`, so the difference cannot underflow
+      // as `int32_t`. If the result is negative, the BLT below shall go to the slow path.
+      __ Ldr(temp, MemOperand(array, length_offset));
+      __ Sub(temp, temp, pos_const);
 
-      // Check that (length(input) - pos) >= length.
-      if (length.IsConstant()) {
-        __ Cmp(temp, Int32ConstantFrom(length));
-      } else {
-        __ Cmp(temp, RegisterFrom(length));
-      }
+      // Check that (length(array) - pos) >= length.
+      __ Cmp(temp, OperandFrom(length, DataType::Type::kInt32));
       __ B(lt, slow_path->GetEntryLabel());
     }
-  } else if (length_is_input_length) {
+  } else if (length_is_array_length) {
     // The only way the copy can succeed is if pos is zero.
     vixl32::Register pos_reg = RegisterFrom(pos);
     __ CompareAndBranchIfNonZero(pos_reg, slow_path->GetEntryLabel());
   } else {
     // Check that pos >= 0.
     vixl32::Register pos_reg = RegisterFrom(pos);
-    __ Cmp(pos_reg, 0);
-    __ B(lt, slow_path->GetEntryLabel());
-
-    // Check that pos <= length(input).
-    __ Ldr(temp, MemOperand(input, length_offset));
-    __ Subs(temp, temp, pos_reg);
-    __ B(lt, slow_path->GetEntryLabel());
-
-    // Check that (length(input) - pos) >= length.
-    if (length.IsConstant()) {
-      __ Cmp(temp, Int32ConstantFrom(length));
-    } else {
-      __ Cmp(temp, RegisterFrom(length));
+    if (!position_sign_checked) {
+      __ Cmp(pos_reg, 0);
+      __ B(lt, slow_path->GetEntryLabel());
     }
+
+    // Calculate length(array) - pos.
+    // Both operands are known to be non-negative `int32_t`, so the difference cannot underflow
+    // as `int32_t`. If the result is negative, the BLT below shall go to the slow path.
+    __ Ldr(temp, MemOperand(array, length_offset));
+    __ Sub(temp, temp, pos_reg);
+
+    // Check that (length(array) - pos) >= length.
+    __ Cmp(temp, OperandFrom(length, DataType::Type::kInt32));
     __ B(lt, slow_path->GetEntryLabel());
   }
 }
@@ -1339,7 +1305,7 @@
 void IntrinsicCodeGeneratorARMVIXL::VisitSystemArrayCopy(HInvoke* invoke) {
   // The only read barrier implementation supporting the
   // SystemArrayCopy intrinsic is the Baker-style read barriers.
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen_->EmitReadBarrier(), kUseBakerReadBarrier);
 
   ArmVIXLAssembler* assembler = GetAssembler();
   LocationSummary* locations = invoke->GetLocations();
@@ -1369,43 +1335,36 @@
   vixl32::Label conditions_on_positions_validated;
   SystemArrayCopyOptimizations optimizations(invoke);
 
-  // If source and destination are the same, we go to slow path if we need to do
-  // forward copying.
-  if (src_pos.IsConstant()) {
-    int32_t src_pos_constant = Int32ConstantFrom(src_pos);
-    if (dest_pos.IsConstant()) {
-      int32_t dest_pos_constant = Int32ConstantFrom(dest_pos);
-      if (optimizations.GetDestinationIsSource()) {
-        // Checked when building locations.
-        DCHECK_GE(src_pos_constant, dest_pos_constant);
-      } else if (src_pos_constant < dest_pos_constant) {
-        __ Cmp(src, dest);
-        __ B(eq, intrinsic_slow_path->GetEntryLabel());
+  // If source and destination are the same, we go to slow path if we need to do forward copying.
+  // We do not need to do this check if the source and destination positions are the same.
+  if (!optimizations.GetSourcePositionIsDestinationPosition()) {
+    if (src_pos.IsConstant()) {
+      int32_t src_pos_constant = Int32ConstantFrom(src_pos);
+      if (dest_pos.IsConstant()) {
+        int32_t dest_pos_constant = Int32ConstantFrom(dest_pos);
+        if (optimizations.GetDestinationIsSource()) {
+          // Checked when building locations.
+          DCHECK_GE(src_pos_constant, dest_pos_constant);
+        } else if (src_pos_constant < dest_pos_constant) {
+          __ Cmp(src, dest);
+          __ B(eq, intrinsic_slow_path->GetEntryLabel());
+        }
+      } else {
+        if (!optimizations.GetDestinationIsSource()) {
+          __ Cmp(src, dest);
+          __ B(ne, &conditions_on_positions_validated, /* is_far_target= */ false);
+        }
+        __ Cmp(RegisterFrom(dest_pos), src_pos_constant);
+        __ B(gt, intrinsic_slow_path->GetEntryLabel());
       }
-
-      // Checked when building locations.
-      DCHECK(!optimizations.GetDestinationIsSource()
-             || (src_pos_constant >= Int32ConstantFrom(dest_pos)));
     } else {
       if (!optimizations.GetDestinationIsSource()) {
         __ Cmp(src, dest);
         __ B(ne, &conditions_on_positions_validated, /* is_far_target= */ false);
       }
-      __ Cmp(RegisterFrom(dest_pos), src_pos_constant);
-      __ B(gt, intrinsic_slow_path->GetEntryLabel());
+      __ Cmp(RegisterFrom(src_pos), OperandFrom(dest_pos, DataType::Type::kInt32));
+      __ B(lt, intrinsic_slow_path->GetEntryLabel());
     }
-  } else {
-    if (!optimizations.GetDestinationIsSource()) {
-      __ Cmp(src, dest);
-      __ B(ne, &conditions_on_positions_validated, /* is_far_target= */ false);
-    }
-    if (dest_pos.IsConstant()) {
-      int32_t dest_pos_constant = Int32ConstantFrom(dest_pos);
-      __ Cmp(RegisterFrom(src_pos), dest_pos_constant);
-    } else {
-      __ Cmp(RegisterFrom(src_pos), RegisterFrom(dest_pos));
-    }
-    __ B(lt, intrinsic_slow_path->GetEntryLabel());
   }
 
   __ Bind(&conditions_on_positions_validated);
@@ -1420,32 +1379,50 @@
     __ CompareAndBranchIfZero(dest, intrinsic_slow_path->GetEntryLabel());
   }
 
-  // If the length is negative, bail out.
   // We have already checked in the LocationsBuilder for the constant case.
-  if (!length.IsConstant() &&
-      !optimizations.GetCountIsSourceLength() &&
-      !optimizations.GetCountIsDestinationLength()) {
-    __ Cmp(RegisterFrom(length), 0);
-    __ B(lt, intrinsic_slow_path->GetEntryLabel());
+  if (!length.IsConstant()) {
+    // Merge the following two comparisons into one:
+    //   If the length is negative, bail out (delegate to libcore's native implementation).
+    //   If the length >= 128 then (currently) prefer native implementation.
+    __ Cmp(RegisterFrom(length), kSystemArrayCopyThreshold);
+    __ B(hs, intrinsic_slow_path->GetEntryLabel());
   }
 
   // Validity checks: source.
-  CheckPosition(assembler,
-                src_pos,
-                src,
-                length,
-                intrinsic_slow_path,
-                temp1,
-                optimizations.GetCountIsSourceLength());
+  CheckSystemArrayCopyPosition(assembler,
+                               src,
+                               src_pos,
+                               length,
+                               intrinsic_slow_path,
+                               temp1,
+                               optimizations.GetCountIsSourceLength(),
+                               /*position_sign_checked=*/ false);
 
   // Validity checks: dest.
-  CheckPosition(assembler,
-                dest_pos,
-                dest,
-                length,
-                intrinsic_slow_path,
-                temp1,
-                optimizations.GetCountIsDestinationLength());
+  bool dest_position_sign_checked = optimizations.GetSourcePositionIsDestinationPosition();
+  CheckSystemArrayCopyPosition(assembler,
+                               dest,
+                               dest_pos,
+                               length,
+                               intrinsic_slow_path,
+                               temp1,
+                               optimizations.GetCountIsDestinationLength(),
+                               dest_position_sign_checked);
+
+  auto check_non_primitive_array_class = [&](vixl32::Register klass, vixl32::Register temp) {
+    // No read barrier is needed for reading a chain of constant references for comparing
+    // with null, or for reading a constant primitive value, see `ReadBarrierOption`.
+    // /* HeapReference<Class> */ temp = klass->component_type_
+    __ Ldr(temp, MemOperand(klass, component_offset));
+    codegen_->GetAssembler()->MaybeUnpoisonHeapReference(temp);
+    // Check that the component type is not null.
+    __ CompareAndBranchIfZero(temp, intrinsic_slow_path->GetEntryLabel());
+    // Check that the component type is not a primitive.
+    // /* uint16_t */ temp = static_cast<uint16>(klass->primitive_type_);
+    __ Ldrh(temp, MemOperand(temp, primitive_offset));
+    static_assert(Primitive::kPrimNot == 0, "Expected 0 for kPrimNot");
+    __ CompareAndBranchIfNonZero(temp, intrinsic_slow_path->GetEntryLabel());
+  };
 
   if (!optimizations.GetDoesNotNeedTypeCheck()) {
     // Check whether all elements of the source array are assignable to the component
@@ -1453,175 +1430,86 @@
     // or the destination is Object[]. If none of these checks succeed, we go to the
     // slow path.
 
-    if (gUseReadBarrier && kUseBakerReadBarrier) {
-      if (!optimizations.GetSourceIsNonPrimitiveArray()) {
-        // /* HeapReference<Class> */ temp1 = src->klass_
-        codegen_->GenerateFieldLoadWithBakerReadBarrier(
-            invoke, temp1_loc, src, class_offset, temp2_loc, /* needs_null_check= */ false);
-        // Bail out if the source is not a non primitive array.
-        // /* HeapReference<Class> */ temp1 = temp1->component_type_
-        codegen_->GenerateFieldLoadWithBakerReadBarrier(
-            invoke, temp1_loc, temp1, component_offset, temp2_loc, /* needs_null_check= */ false);
-        __ CompareAndBranchIfZero(temp1, intrinsic_slow_path->GetEntryLabel());
-        // If heap poisoning is enabled, `temp1` has been unpoisoned
-        // by the the previous call to GenerateFieldLoadWithBakerReadBarrier.
-        // /* uint16_t */ temp1 = static_cast<uint16>(temp1->primitive_type_);
-        __ Ldrh(temp1, MemOperand(temp1, primitive_offset));
-        static_assert(Primitive::kPrimNot == 0, "Expected 0 for kPrimNot");
-        __ CompareAndBranchIfNonZero(temp1, intrinsic_slow_path->GetEntryLabel());
-      }
-
+    if (codegen_->EmitBakerReadBarrier()) {
       // /* HeapReference<Class> */ temp1 = dest->klass_
       codegen_->GenerateFieldLoadWithBakerReadBarrier(
           invoke, temp1_loc, dest, class_offset, temp2_loc, /* needs_null_check= */ false);
-
-      if (!optimizations.GetDestinationIsNonPrimitiveArray()) {
-        // Bail out if the destination is not a non primitive array.
-        //
-        // Register `temp1` is not trashed by the read barrier emitted
-        // by GenerateFieldLoadWithBakerReadBarrier below, as that
-        // method produces a call to a ReadBarrierMarkRegX entry point,
-        // which saves all potentially live registers, including
-        // temporaries such a `temp1`.
-        // /* HeapReference<Class> */ temp2 = temp1->component_type_
-        codegen_->GenerateFieldLoadWithBakerReadBarrier(
-            invoke, temp2_loc, temp1, component_offset, temp3_loc, /* needs_null_check= */ false);
-        __ CompareAndBranchIfZero(temp2, intrinsic_slow_path->GetEntryLabel());
-        // If heap poisoning is enabled, `temp2` has been unpoisoned
-        // by the the previous call to GenerateFieldLoadWithBakerReadBarrier.
-        // /* uint16_t */ temp2 = static_cast<uint16>(temp2->primitive_type_);
-        __ Ldrh(temp2, MemOperand(temp2, primitive_offset));
-        static_assert(Primitive::kPrimNot == 0, "Expected 0 for kPrimNot");
-        __ CompareAndBranchIfNonZero(temp2, intrinsic_slow_path->GetEntryLabel());
-      }
-
-      // For the same reason given earlier, `temp1` is not trashed by the
-      // read barrier emitted by GenerateFieldLoadWithBakerReadBarrier below.
+      // Register `temp1` is not trashed by the read barrier emitted
+      // by GenerateFieldLoadWithBakerReadBarrier below, as that
+      // method produces a call to a ReadBarrierMarkRegX entry point,
+      // which saves all potentially live registers, including
+      // temporaries such a `temp1`.
       // /* HeapReference<Class> */ temp2 = src->klass_
       codegen_->GenerateFieldLoadWithBakerReadBarrier(
           invoke, temp2_loc, src, class_offset, temp3_loc, /* needs_null_check= */ false);
-      // Note: if heap poisoning is on, we are comparing two unpoisoned references here.
-      __ Cmp(temp1, temp2);
-
-      if (optimizations.GetDestinationIsTypedObjectArray()) {
-        vixl32::Label do_copy;
-        __ B(eq, &do_copy, /* is_far_target= */ false);
-        // /* HeapReference<Class> */ temp1 = temp1->component_type_
-        codegen_->GenerateFieldLoadWithBakerReadBarrier(
-            invoke, temp1_loc, temp1, component_offset, temp2_loc, /* needs_null_check= */ false);
-        // /* HeapReference<Class> */ temp1 = temp1->super_class_
-        // We do not need to emit a read barrier for the following
-        // heap reference load, as `temp1` is only used in a
-        // comparison with null below, and this reference is not
-        // kept afterwards.
-        __ Ldr(temp1, MemOperand(temp1, super_offset));
-        __ CompareAndBranchIfNonZero(temp1, intrinsic_slow_path->GetEntryLabel());
-        __ Bind(&do_copy);
-      } else {
-        __ B(ne, intrinsic_slow_path->GetEntryLabel());
-      }
     } else {
-      // Non read barrier code.
-
       // /* HeapReference<Class> */ temp1 = dest->klass_
       __ Ldr(temp1, MemOperand(dest, class_offset));
+      assembler->MaybeUnpoisonHeapReference(temp1);
       // /* HeapReference<Class> */ temp2 = src->klass_
       __ Ldr(temp2, MemOperand(src, class_offset));
-      bool did_unpoison = false;
-      if (!optimizations.GetDestinationIsNonPrimitiveArray() ||
-          !optimizations.GetSourceIsNonPrimitiveArray()) {
-        // One or two of the references need to be unpoisoned. Unpoison them
-        // both to make the identity check valid.
-        assembler->MaybeUnpoisonHeapReference(temp1);
-        assembler->MaybeUnpoisonHeapReference(temp2);
-        did_unpoison = true;
-      }
+      assembler->MaybeUnpoisonHeapReference(temp2);
+    }
 
-      if (!optimizations.GetDestinationIsNonPrimitiveArray()) {
-        // Bail out if the destination is not a non primitive array.
-        // /* HeapReference<Class> */ temp3 = temp1->component_type_
-        __ Ldr(temp3, MemOperand(temp1, component_offset));
-        __ CompareAndBranchIfZero(temp3, intrinsic_slow_path->GetEntryLabel());
-        assembler->MaybeUnpoisonHeapReference(temp3);
-        // /* uint16_t */ temp3 = static_cast<uint16>(temp3->primitive_type_);
-        __ Ldrh(temp3, MemOperand(temp3, primitive_offset));
-        static_assert(Primitive::kPrimNot == 0, "Expected 0 for kPrimNot");
-        __ CompareAndBranchIfNonZero(temp3, intrinsic_slow_path->GetEntryLabel());
-      }
-
+    __ Cmp(temp1, temp2);
+    if (optimizations.GetDestinationIsTypedObjectArray()) {
+      DCHECK(optimizations.GetDestinationIsNonPrimitiveArray());
+      vixl32::Label do_copy;
+      // For class match, we can skip the source type check regardless of the optimization flag.
+      __ B(eq, &do_copy, /* is_far_target= */ false);
+      // No read barrier is needed for reading a chain of constant references
+      // for comparing with null, see `ReadBarrierOption`.
+      // /* HeapReference<Class> */ temp1 = temp1->component_type_
+      __ Ldr(temp1, MemOperand(temp1, component_offset));
+      assembler->MaybeUnpoisonHeapReference(temp1);
+      // /* HeapReference<Class> */ temp1 = temp1->super_class_
+      __ Ldr(temp1, MemOperand(temp1, super_offset));
+      // No need to unpoison the result, we're comparing against null.
+      __ CompareAndBranchIfNonZero(temp1, intrinsic_slow_path->GetEntryLabel());
+      // Bail out if the source is not a non primitive array.
       if (!optimizations.GetSourceIsNonPrimitiveArray()) {
-        // Bail out if the source is not a non primitive array.
-        // /* HeapReference<Class> */ temp3 = temp2->component_type_
-        __ Ldr(temp3, MemOperand(temp2, component_offset));
-        __ CompareAndBranchIfZero(temp3, intrinsic_slow_path->GetEntryLabel());
-        assembler->MaybeUnpoisonHeapReference(temp3);
-        // /* uint16_t */ temp3 = static_cast<uint16>(temp3->primitive_type_);
-        __ Ldrh(temp3, MemOperand(temp3, primitive_offset));
-        static_assert(Primitive::kPrimNot == 0, "Expected 0 for kPrimNot");
-        __ CompareAndBranchIfNonZero(temp3, intrinsic_slow_path->GetEntryLabel());
+        check_non_primitive_array_class(temp2, temp2);
       }
-
-      __ Cmp(temp1, temp2);
-
-      if (optimizations.GetDestinationIsTypedObjectArray()) {
-        vixl32::Label do_copy;
-        __ B(eq, &do_copy, /* is_far_target= */ false);
-        if (!did_unpoison) {
-          assembler->MaybeUnpoisonHeapReference(temp1);
-        }
-        // /* HeapReference<Class> */ temp1 = temp1->component_type_
-        __ Ldr(temp1, MemOperand(temp1, component_offset));
-        assembler->MaybeUnpoisonHeapReference(temp1);
-        // /* HeapReference<Class> */ temp1 = temp1->super_class_
-        __ Ldr(temp1, MemOperand(temp1, super_offset));
-        // No need to unpoison the result, we're comparing against null.
-        __ CompareAndBranchIfNonZero(temp1, intrinsic_slow_path->GetEntryLabel());
-        __ Bind(&do_copy);
-      } else {
-        __ B(ne, intrinsic_slow_path->GetEntryLabel());
+      __ Bind(&do_copy);
+    } else {
+      DCHECK(!optimizations.GetDestinationIsTypedObjectArray());
+      // For class match, we can skip the array type check completely if at least one of source
+      // and destination is known to be a non primitive array, otherwise one check is enough.
+      __ B(ne, intrinsic_slow_path->GetEntryLabel());
+      if (!optimizations.GetDestinationIsNonPrimitiveArray() &&
+          !optimizations.GetSourceIsNonPrimitiveArray()) {
+        check_non_primitive_array_class(temp2, temp2);
       }
     }
   } else if (!optimizations.GetSourceIsNonPrimitiveArray()) {
     DCHECK(optimizations.GetDestinationIsNonPrimitiveArray());
     // Bail out if the source is not a non primitive array.
-    if (gUseReadBarrier && kUseBakerReadBarrier) {
-      // /* HeapReference<Class> */ temp1 = src->klass_
-      codegen_->GenerateFieldLoadWithBakerReadBarrier(
-          invoke, temp1_loc, src, class_offset, temp2_loc, /* needs_null_check= */ false);
-      // /* HeapReference<Class> */ temp3 = temp1->component_type_
-      codegen_->GenerateFieldLoadWithBakerReadBarrier(
-          invoke, temp3_loc, temp1, component_offset, temp2_loc, /* needs_null_check= */ false);
-      __ CompareAndBranchIfZero(temp3, intrinsic_slow_path->GetEntryLabel());
-      // If heap poisoning is enabled, `temp3` has been unpoisoned
-      // by the the previous call to GenerateFieldLoadWithBakerReadBarrier.
-    } else {
-      // /* HeapReference<Class> */ temp1 = src->klass_
-      __ Ldr(temp1, MemOperand(src, class_offset));
-      assembler->MaybeUnpoisonHeapReference(temp1);
-      // /* HeapReference<Class> */ temp3 = temp1->component_type_
-      __ Ldr(temp3, MemOperand(temp1, component_offset));
-      __ CompareAndBranchIfZero(temp3, intrinsic_slow_path->GetEntryLabel());
-      assembler->MaybeUnpoisonHeapReference(temp3);
-    }
-    // /* uint16_t */ temp3 = static_cast<uint16>(temp3->primitive_type_);
-    __ Ldrh(temp3, MemOperand(temp3, primitive_offset));
-    static_assert(Primitive::kPrimNot == 0, "Expected 0 for kPrimNot");
-    __ CompareAndBranchIfNonZero(temp3, intrinsic_slow_path->GetEntryLabel());
+    // No read barrier is needed for reading a chain of constant references for comparing
+    // with null, or for reading a constant primitive value, see `ReadBarrierOption`.
+     // /* HeapReference<Class> */ temp2 = src->klass_
+    __ Ldr(temp2, MemOperand(src, class_offset));
+    assembler->MaybeUnpoisonHeapReference(temp2);
+    check_non_primitive_array_class(temp2, temp2);
   }
 
   if (length.IsConstant() && Int32ConstantFrom(length) == 0) {
     // Null constant length: not need to emit the loop code at all.
   } else {
-    vixl32::Label done;
-    const DataType::Type type = DataType::Type::kReference;
-    const int32_t element_size = DataType::Size(type);
-
+    vixl32::Label skip_copy_and_write_barrier;
     if (length.IsRegister()) {
       // Don't enter the copy loop if the length is null.
-      __ CompareAndBranchIfZero(RegisterFrom(length), &done, /* is_far_target= */ false);
+      __ CompareAndBranchIfZero(
+          RegisterFrom(length), &skip_copy_and_write_barrier, /* is_far_target= */ false);
     }
 
-    if (gUseReadBarrier && kUseBakerReadBarrier) {
+    const DataType::Type type = DataType::Type::kReference;
+    const int32_t element_size = DataType::Size(type);
+    const int32_t data_offset = mirror::Array::DataOffset(element_size).Uint32Value();
+
+    SlowPathCodeARMVIXL* read_barrier_slow_path = nullptr;
+    vixl32::Register rb_tmp;
+    bool emit_rb = codegen_->EmitBakerReadBarrier();
+    if (emit_rb) {
       // TODO: Also convert this intrinsic to the IsGcMarking strategy?
 
       // SystemArrayCopy implementation for Baker read barriers (see
@@ -1643,7 +1531,8 @@
       //   }
 
       // /* int32_t */ monitor = src->monitor_
-      __ Ldr(temp2, MemOperand(src, monitor_offset));
+      rb_tmp = RegisterFrom(locations->GetTemp(3));
+      __ Ldr(rb_tmp, MemOperand(src, monitor_offset));
       // /* LockWord */ lock_word = LockWord(monitor)
       static_assert(sizeof(LockWord) == sizeof(int32_t),
                     "art::LockWord and int32_t have different sizes.");
@@ -1653,77 +1542,60 @@
       // a memory barrier (which would be more expensive).
       // `src` is unchanged by this operation, but its value now depends
       // on `temp2`.
-      __ Add(src, src, Operand(temp2, vixl32::LSR, 32));
-
-      // Compute the base source address in `temp1`.
-      // Note that `temp1` (the base source address) is computed from
-      // `src` (and `src_pos`) here, and thus honors the artificial
-      // dependency of `src` on `temp2`.
-      GenSystemArrayCopyBaseAddress(GetAssembler(), type, src, src_pos, temp1);
-      // Compute the end source address in `temp3`.
-      GenSystemArrayCopyEndAddress(GetAssembler(), type, length, temp1, temp3);
-      // The base destination address is computed later, as `temp2` is
-      // used for intermediate computations.
+      __ Add(src, src, Operand(rb_tmp, vixl32::LSR, 32));
 
       // Slow path used to copy array when `src` is gray.
       // Note that the base destination address is computed in `temp2`
       // by the slow path code.
-      SlowPathCodeARMVIXL* read_barrier_slow_path =
+      read_barrier_slow_path =
           new (codegen_->GetScopedAllocator()) ReadBarrierSystemArrayCopySlowPathARMVIXL(invoke);
       codegen_->AddSlowPath(read_barrier_slow_path);
+    }
 
+    // Compute the base source address in `temp1`.
+    // Note that for read barrier, `temp1` (the base source address) is computed from `src`
+    // (and `src_pos`) here, and thus honors the artificial dependency of `src` on `rb_tmp`.
+    GenArrayAddress(GetAssembler(), temp1, src, src_pos, type, data_offset);
+    // Compute the base destination address in `temp2`.
+    GenArrayAddress(GetAssembler(), temp2, dest, dest_pos, type, data_offset);
+    // Compute the end source address in `temp3`.
+    GenArrayAddress(GetAssembler(), temp3, temp1, length, type, /*data_offset=*/ 0);
+
+    if (emit_rb) {
       // Given the numeric representation, it's enough to check the low bit of the
       // rb_state. We do that by shifting the bit out of the lock word with LSRS
       // which can be a 16-bit instruction unlike the TST immediate.
       static_assert(ReadBarrier::NonGrayState() == 0, "Expecting non-gray to have value 0");
       static_assert(ReadBarrier::GrayState() == 1, "Expecting gray to have value 1");
-      __ Lsrs(temp2, temp2, LockWord::kReadBarrierStateShift + 1);
+      DCHECK(rb_tmp.IsValid());
+      __ Lsrs(rb_tmp, rb_tmp, LockWord::kReadBarrierStateShift + 1);
       // Carry flag is the last bit shifted out by LSRS.
       __ B(cs, read_barrier_slow_path->GetEntryLabel());
-
-      // Fast-path copy.
-      // Compute the base destination address in `temp2`.
-      GenSystemArrayCopyBaseAddress(GetAssembler(), type, dest, dest_pos, temp2);
-      // Iterate over the arrays and do a raw copy of the objects. We don't need to
-      // poison/unpoison.
-      vixl32::Label loop;
-      __ Bind(&loop);
-      {
-        UseScratchRegisterScope temps(assembler->GetVIXLAssembler());
-        const vixl32::Register temp_reg = temps.Acquire();
-        __ Ldr(temp_reg, MemOperand(temp1, element_size, PostIndex));
-        __ Str(temp_reg, MemOperand(temp2, element_size, PostIndex));
-      }
-      __ Cmp(temp1, temp3);
-      __ B(ne, &loop, /* is_far_target= */ false);
-
-      __ Bind(read_barrier_slow_path->GetExitLabel());
-    } else {
-      // Non read barrier code.
-      // Compute the base source address in `temp1`.
-      GenSystemArrayCopyBaseAddress(GetAssembler(), type, src, src_pos, temp1);
-      // Compute the base destination address in `temp2`.
-      GenSystemArrayCopyBaseAddress(GetAssembler(), type, dest, dest_pos, temp2);
-      // Compute the end source address in `temp3`.
-      GenSystemArrayCopyEndAddress(GetAssembler(), type, length, temp1, temp3);
-      // Iterate over the arrays and do a raw copy of the objects. We don't need to
-      // poison/unpoison.
-      vixl32::Label loop;
-      __ Bind(&loop);
-      {
-        UseScratchRegisterScope temps(assembler->GetVIXLAssembler());
-        const vixl32::Register temp_reg = temps.Acquire();
-        __ Ldr(temp_reg, MemOperand(temp1, element_size, PostIndex));
-        __ Str(temp_reg, MemOperand(temp2, element_size, PostIndex));
-      }
-      __ Cmp(temp1, temp3);
-      __ B(ne, &loop, /* is_far_target= */ false);
     }
-    __ Bind(&done);
-  }
 
-  // We only need one card marking on the destination array.
-  codegen_->MarkGCCard(temp1, temp2, dest, NoReg, /* emit_null_check= */ false);
+    // Iterate over the arrays and do a raw copy of the objects. We don't need to
+    // poison/unpoison.
+    vixl32::Label loop;
+    __ Bind(&loop);
+    {
+      UseScratchRegisterScope temps(assembler->GetVIXLAssembler());
+      const vixl32::Register temp_reg = temps.Acquire();
+      __ Ldr(temp_reg, MemOperand(temp1, element_size, PostIndex));
+      __ Str(temp_reg, MemOperand(temp2, element_size, PostIndex));
+    }
+    __ Cmp(temp1, temp3);
+    __ B(ne, &loop, /* is_far_target= */ false);
+
+    if (emit_rb) {
+      DCHECK(read_barrier_slow_path != nullptr);
+      __ Bind(read_barrier_slow_path->GetExitLabel());
+    }
+
+    // We only need one card marking on the destination array.
+    codegen_->MarkGCCard(temp1, temp2, dest);
+
+    __ Bind(&skip_copy_and_write_barrier);
+  }
 
   __ Bind(intrinsic_slow_path->GetExitLabel());
 }
@@ -2433,18 +2305,35 @@
   __ Vrintm(F64, OutputDRegister(invoke), InputDRegisterAt(invoke, 0));
 }
 
-void IntrinsicLocationsBuilderARMVIXL::VisitIntegerValueOf(HInvoke* invoke) {
-  InvokeRuntimeCallingConventionARMVIXL calling_convention;
-  IntrinsicVisitor::ComputeIntegerValueOfLocations(
-      invoke,
-      codegen_,
-      LocationFrom(r0),
-      LocationFrom(calling_convention.GetRegisterAt(0)));
-}
+#define VISIT_INTRINSIC(name, low, high, type, start_index) \
+  void IntrinsicLocationsBuilderARMVIXL::Visit ##name ##ValueOf(HInvoke* invoke) { \
+    InvokeRuntimeCallingConventionARMVIXL calling_convention; \
+    IntrinsicVisitor::ComputeValueOfLocations( \
+        invoke, \
+        codegen_, \
+        low, \
+        high - low + 1, \
+        LocationFrom(r0), \
+        LocationFrom(calling_convention.GetRegisterAt(0))); \
+  } \
+  void IntrinsicCodeGeneratorARMVIXL::Visit ##name ##ValueOf(HInvoke* invoke) { \
+    IntrinsicVisitor::ValueOfInfo info = \
+        IntrinsicVisitor::ComputeValueOfInfo( \
+            invoke, \
+            codegen_->GetCompilerOptions(), \
+            WellKnownClasses::java_lang_ ##name ##_value, \
+            low, \
+            high - low + 1, \
+            start_index); \
+    HandleValueOf(invoke, info, type); \
+  }
+  BOXED_TYPES(VISIT_INTRINSIC)
+#undef VISIT_INTRINSIC
 
-void IntrinsicCodeGeneratorARMVIXL::VisitIntegerValueOf(HInvoke* invoke) {
-  IntrinsicVisitor::IntegerValueOfInfo info =
-      IntrinsicVisitor::ComputeIntegerValueOfInfo(invoke, codegen_->GetCompilerOptions());
+
+void IntrinsicCodeGeneratorARMVIXL::HandleValueOf(HInvoke* invoke,
+                                                  const IntrinsicVisitor::ValueOfInfo& info,
+                                                  DataType::Type type) {
   LocationSummary* locations = invoke->GetLocations();
   ArmVIXLAssembler* const assembler = GetAssembler();
 
@@ -2457,20 +2346,20 @@
     codegen_->InvokeRuntime(kQuickAllocObjectInitialized, invoke, invoke->GetDexPc());
     CheckEntrypointTypes<kQuickAllocObjectWithChecks, void*, mirror::Class*>();
   };
-  if (invoke->InputAt(0)->IsConstant()) {
+  if (invoke->InputAt(0)->IsIntConstant()) {
     int32_t value = invoke->InputAt(0)->AsIntConstant()->GetValue();
     if (static_cast<uint32_t>(value - info.low) < info.length) {
-      // Just embed the j.l.Integer in the code.
-      DCHECK_NE(info.value_boot_image_reference, IntegerValueOfInfo::kInvalidReference);
+      // Just embed the object in the code.
+      DCHECK_NE(info.value_boot_image_reference, ValueOfInfo::kInvalidReference);
       codegen_->LoadBootImageAddress(out, info.value_boot_image_reference);
     } else {
       DCHECK(locations->CanCall());
-      // Allocate and initialize a new j.l.Integer.
-      // TODO: If we JIT, we could allocate the j.l.Integer now, and store it in the
+      // Allocate and initialize a new object.
+      // TODO: If we JIT, we could allocate the object now, and store it in the
       // JIT object table.
       allocate_instance();
       __ Mov(temp, value);
-      assembler->StoreToOffset(kStoreWord, temp, out, info.value_offset);
+      assembler->StoreToOffset(GetStoreOperandType(type), temp, out, info.value_offset);
       // Class pointer and `value` final field stores require a barrier before publication.
       codegen_->GenerateMemoryBarrier(MemBarrierKind::kStoreStore);
     }
@@ -2482,15 +2371,15 @@
     __ Cmp(out, info.length);
     vixl32::Label allocate, done;
     __ B(hs, &allocate, /* is_far_target= */ false);
-    // If the value is within the bounds, load the j.l.Integer directly from the array.
+    // If the value is within the bounds, load the object directly from the array.
     codegen_->LoadBootImageAddress(temp, info.array_data_boot_image_reference);
     codegen_->LoadFromShiftedRegOffset(DataType::Type::kReference, locations->Out(), temp, out);
     assembler->MaybeUnpoisonHeapReference(out);
     __ B(&done);
     __ Bind(&allocate);
-    // Otherwise allocate and initialize a new j.l.Integer.
+    // Otherwise allocate and initialize a new object.
     allocate_instance();
-    assembler->StoreToOffset(kStoreWord, in, out, info.value_offset);
+    assembler->StoreToOffset(GetStoreOperandType(type), in, out, info.value_offset);
     // Class pointer and `value` final field stores require a barrier before publication.
     codegen_->GenerateMemoryBarrier(MemBarrierKind::kStoreStore);
     __ Bind(&done);
@@ -2511,7 +2400,7 @@
   SlowPathCodeARMVIXL* slow_path = new (GetAllocator()) IntrinsicSlowPathARMVIXL(invoke);
   codegen_->AddSlowPath(slow_path);
 
-  if (gUseReadBarrier) {
+  if (codegen_->EmitReadBarrier()) {
     // Check self->GetWeakRefAccessEnabled().
     UseScratchRegisterScope temps(assembler->GetVIXLAssembler());
     vixl32::Register temp = temps.Acquire();
@@ -2539,7 +2428,7 @@
 
   // Load the value from the field.
   uint32_t referent_offset = mirror::Reference::ReferentOffset().Uint32Value();
-  if (gUseReadBarrier && kUseBakerReadBarrier) {
+  if (codegen_->EmitBakerReadBarrier()) {
     codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
                                                     out,
                                                     RegisterFrom(obj),
@@ -2560,7 +2449,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitReferenceRefersTo(HInvoke* invoke) {
-  IntrinsicVisitor::CreateReferenceRefersToLocations(invoke);
+  IntrinsicVisitor::CreateReferenceRefersToLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitReferenceRefersTo(HInvoke* invoke) {
@@ -2587,7 +2476,7 @@
   assembler->MaybeUnpoisonHeapReference(tmp);
   codegen_->GenerateMemoryBarrier(MemBarrierKind::kLoadAny);  // `referent` is volatile.
 
-  if (gUseReadBarrier) {
+  if (codegen_->EmitReadBarrier()) {
     DCHECK(kUseBakerReadBarrier);
 
     vixl32::Label calculate_result;
@@ -2613,7 +2502,7 @@
 
     __ Bind(&calculate_result);
   } else {
-    DCHECK(!gUseReadBarrier);
+    DCHECK(!codegen_->EmitReadBarrier());
     __ Sub(out, tmp, other);
   }
 
@@ -2653,7 +2542,7 @@
   locations->SetInAt(0, Location::Any());
 }
 
-void IntrinsicCodeGeneratorARMVIXL::VisitReachabilityFence(HInvoke* invoke ATTRIBUTE_UNUSED) { }
+void IntrinsicCodeGeneratorARMVIXL::VisitReachabilityFence([[maybe_unused]] HInvoke* invoke) {}
 
 void IntrinsicLocationsBuilderARMVIXL::VisitIntegerDivideUnsigned(HInvoke* invoke) {
   CreateIntIntToIntSlowPathCallLocations(allocator_, invoke);
@@ -2732,7 +2621,7 @@
       }
       break;
     case DataType::Type::kReference:
-      if (gUseReadBarrier && kUseBakerReadBarrier) {
+      if (codegen->EmitBakerReadBarrier()) {
         // Piggy-back on the field load path using introspection for the Baker read barrier.
         vixl32::Register temp = RegisterFrom(maybe_temp);
         __ Add(temp, base, offset);
@@ -2777,32 +2666,18 @@
     codegen->GenerateMemoryBarrier(
         seq_cst_barrier ? MemBarrierKind::kAnyAny : MemBarrierKind::kLoadAny);
   }
-  if (type == DataType::Type::kReference && !(gUseReadBarrier && kUseBakerReadBarrier)) {
+  if (type == DataType::Type::kReference && !codegen->EmitBakerReadBarrier()) {
     Location base_loc = LocationFrom(base);
     Location index_loc = LocationFrom(offset);
     codegen->MaybeGenerateReadBarrierSlow(invoke, out, out, base_loc, /* offset=*/ 0u, index_loc);
   }
 }
 
-static bool UnsafeGetIntrinsicOnCallList(Intrinsics intrinsic) {
-  switch (intrinsic) {
-    case Intrinsics::kUnsafeGetObject:
-    case Intrinsics::kUnsafeGetObjectVolatile:
-    case Intrinsics::kJdkUnsafeGetObject:
-    case Intrinsics::kJdkUnsafeGetObjectVolatile:
-    case Intrinsics::kJdkUnsafeGetObjectAcquire:
-      return true;
-    default:
-      break;
-  }
-  return false;
-}
-
 static void CreateUnsafeGetLocations(HInvoke* invoke,
                                      CodeGeneratorARMVIXL* codegen,
                                      DataType::Type type,
                                      bool atomic) {
-  bool can_call = gUseReadBarrier && UnsafeGetIntrinsicOnCallList(invoke->GetIntrinsic());
+  bool can_call = codegen->EmitReadBarrier() && IsUnsafeGetReference(invoke);
   ArenaAllocator* allocator = invoke->GetBlock()->GetGraph()->GetAllocator();
   LocationSummary* locations =
       new (allocator) LocationSummary(invoke,
@@ -2818,7 +2693,7 @@
   locations->SetInAt(2, Location::RequiresRegister());
   locations->SetOut(Location::RequiresRegister(),
                     (can_call ? Location::kOutputOverlap : Location::kNoOutputOverlap));
-  if ((gUseReadBarrier && kUseBakerReadBarrier && type == DataType::Type::kReference) ||
+  if ((type == DataType::Type::kReference && codegen->EmitBakerReadBarrier()) ||
       (type == DataType::Type::kInt64 && Use64BitExclusiveLoadStore(atomic, codegen))) {
     // We need a temporary register for the read barrier marking slow
     // path in CodeGeneratorARMVIXL::GenerateReferenceLoadWithBakerReadBarrier,
@@ -2837,7 +2712,7 @@
   vixl32::Register offset = LowRegisterFrom(locations->InAt(2));  // Long offset, lo part only.
   Location out = locations->Out();
   Location maybe_temp = Location::NoLocation();
-  if ((gUseReadBarrier && kUseBakerReadBarrier && type == DataType::Type::kReference) ||
+  if ((type == DataType::Type::kReference && codegen->EmitBakerReadBarrier()) ||
       (type == DataType::Type::kInt64 && Use64BitExclusiveLoadStore(atomic, codegen))) {
     maybe_temp = locations->GetTemp(0);
   }
@@ -2887,19 +2762,19 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitUnsafeGetObject(HInvoke* invoke) {
-  VisitJdkUnsafeGetObject(invoke);
+  VisitJdkUnsafeGetReference(invoke);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitUnsafeGetObject(HInvoke* invoke) {
-  VisitJdkUnsafeGetObject(invoke);
+  VisitJdkUnsafeGetReference(invoke);
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitUnsafeGetObjectVolatile(HInvoke* invoke) {
-  VisitJdkUnsafeGetObjectVolatile(invoke);
+  VisitJdkUnsafeGetReferenceVolatile(invoke);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitUnsafeGetObjectVolatile(HInvoke* invoke) {
-  VisitJdkUnsafeGetObjectVolatile(invoke);
+  VisitJdkUnsafeGetReferenceVolatile(invoke);
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitUnsafeGetByte(HInvoke* invoke) {
@@ -2964,29 +2839,29 @@
       invoke, codegen_, DataType::Type::kInt64, std::memory_order_acquire, /*atomic=*/ true);
 }
 
-void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafeGetObject(HInvoke* invoke) {
+void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafeGetReference(HInvoke* invoke) {
   CreateUnsafeGetLocations(invoke, codegen_, DataType::Type::kReference, /*atomic=*/ false);
 }
 
-void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafeGetObject(HInvoke* invoke) {
+void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafeGetReference(HInvoke* invoke) {
   GenUnsafeGet(
       invoke, codegen_, DataType::Type::kReference, std::memory_order_relaxed, /*atomic=*/ false);
 }
 
-void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafeGetObjectVolatile(HInvoke* invoke) {
+void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafeGetReferenceVolatile(HInvoke* invoke) {
   CreateUnsafeGetLocations(invoke, codegen_, DataType::Type::kReference, /*atomic=*/ true);
 }
 
-void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafeGetObjectVolatile(HInvoke* invoke) {
+void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafeGetReferenceVolatile(HInvoke* invoke) {
   GenUnsafeGet(
       invoke, codegen_, DataType::Type::kReference, std::memory_order_seq_cst, /*atomic=*/ true);
 }
 
-void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafeGetObjectAcquire(HInvoke* invoke) {
+void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafeGetReferenceAcquire(HInvoke* invoke) {
   CreateUnsafeGetLocations(invoke, codegen_, DataType::Type::kReference, /*atomic=*/ true);
 }
 
-void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafeGetObjectAcquire(HInvoke* invoke) {
+void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafeGetReferenceAcquire(HInvoke* invoke) {
   GenUnsafeGet(
       invoke, codegen_, DataType::Type::kReference, std::memory_order_acquire, /*atomic=*/ true);
 }
@@ -3145,7 +3020,7 @@
     UseScratchRegisterScope temps(assembler->GetVIXLAssembler());
     vixl32::Register card = temps.Acquire();
     bool value_can_be_null = true;  // TODO: Worth finding out this information?
-    codegen->MarkGCCard(temp, card, base, RegisterFrom(value), value_can_be_null);
+    codegen->MaybeMarkGCCard(temp, card, base, RegisterFrom(value), value_can_be_null);
   }
 }
 
@@ -3173,11 +3048,11 @@
   VisitJdkUnsafePutVolatile(invoke);
 }
 void IntrinsicLocationsBuilderARMVIXL::VisitUnsafePutObject(HInvoke* invoke) {
-  VisitJdkUnsafePutObject(invoke);
+  VisitJdkUnsafePutReference(invoke);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitUnsafePutObject(HInvoke* invoke) {
-  VisitJdkUnsafePutObject(invoke);
+  VisitJdkUnsafePutReference(invoke);
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitUnsafePutObjectOrdered(HInvoke* invoke) {
@@ -3189,11 +3064,11 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitUnsafePutObjectVolatile(HInvoke* invoke) {
-  VisitJdkUnsafePutObjectVolatile(invoke);
+  VisitJdkUnsafePutReferenceVolatile(invoke);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitUnsafePutObjectVolatile(HInvoke* invoke) {
-  VisitJdkUnsafePutObjectVolatile(invoke);
+  VisitJdkUnsafePutReferenceVolatile(invoke);
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitUnsafePutLong(HInvoke* invoke) {
@@ -3288,11 +3163,11 @@
                codegen_);
 }
 
-void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafePutObject(HInvoke* invoke) {
+void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafePutReference(HInvoke* invoke) {
   CreateUnsafePutLocations(invoke, codegen_, DataType::Type::kReference, /*atomic=*/ false);
 }
 
-void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafePutObject(HInvoke* invoke) {
+void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafePutReference(HInvoke* invoke) {
   GenUnsafePut(invoke,
                DataType::Type::kReference,
                std::memory_order_relaxed,
@@ -3312,11 +3187,11 @@
                codegen_);
 }
 
-void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafePutObjectVolatile(HInvoke* invoke) {
+void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafePutReferenceVolatile(HInvoke* invoke) {
   CreateUnsafePutLocations(invoke, codegen_, DataType::Type::kReference, /*atomic=*/ true);
 }
 
-void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafePutObjectVolatile(HInvoke* invoke) {
+void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafePutReferenceVolatile(HInvoke* invoke) {
   GenUnsafePut(invoke,
                DataType::Type::kReference,
                std::memory_order_seq_cst,
@@ -3324,11 +3199,11 @@
                codegen_);
 }
 
-void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafePutObjectRelease(HInvoke* invoke) {
+void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafePutReferenceRelease(HInvoke* invoke) {
   CreateUnsafePutLocations(invoke, codegen_, DataType::Type::kReference, /*atomic=*/ true);
 }
 
-void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafePutObjectRelease(HInvoke* invoke) {
+void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafePutReferenceRelease(HInvoke* invoke) {
   GenUnsafePut(invoke,
                DataType::Type::kReference,
                std::memory_order_release,
@@ -3507,7 +3382,7 @@
   // branch goes to the read barrier slow path that clobbers `success` anyway.
   bool init_failure_for_cmp =
       success.IsValid() &&
-      !(gUseReadBarrier && type == DataType::Type::kReference && expected.IsRegister());
+      !(type == DataType::Type::kReference && codegen->EmitReadBarrier() && expected.IsRegister());
   // Instruction scheduling: Loading a constant between LDREX* and using the loaded value
   // is essentially free, so prepare the failure value here if we can.
   bool init_failure_for_cmp_early =
@@ -3611,7 +3486,7 @@
     // Mark the `old_value_` from the main path and compare with `expected_`.
     if (kUseBakerReadBarrier) {
       DCHECK(mark_old_value_slow_path_ == nullptr);
-      arm_codegen->GenerateIntrinsicCasMoveWithBakerReadBarrier(old_value_temp_, old_value_);
+      arm_codegen->GenerateIntrinsicMoveWithBakerReadBarrier(old_value_temp_, old_value_);
     } else {
       DCHECK(mark_old_value_slow_path_ != nullptr);
       __ B(mark_old_value_slow_path_->GetEntryLabel());
@@ -3664,7 +3539,7 @@
       __ Bind(&mark_old_value);
       if (kUseBakerReadBarrier) {
         DCHECK(update_old_value_slow_path_ == nullptr);
-        arm_codegen->GenerateIntrinsicCasMoveWithBakerReadBarrier(old_value_, old_value_temp_);
+        arm_codegen->GenerateIntrinsicMoveWithBakerReadBarrier(old_value_, old_value_temp_);
       } else {
         // Note: We could redirect the `failure` above directly to the entry label and bind
         // the exit label in the main path, but the main path would need to access the
@@ -3691,8 +3566,9 @@
   SlowPathCodeARMVIXL* update_old_value_slow_path_;
 };
 
-static void CreateUnsafeCASLocations(ArenaAllocator* allocator, HInvoke* invoke) {
-  const bool can_call = gUseReadBarrier && IsUnsafeCASObject(invoke);
+static void CreateUnsafeCASLocations(HInvoke* invoke, CodeGeneratorARMVIXL* codegen) {
+  const bool can_call = codegen->EmitReadBarrier() && IsUnsafeCASReference(invoke);
+  ArenaAllocator* allocator = invoke->GetBlock()->GetGraph()->GetAllocator();
   LocationSummary* locations =
       new (allocator) LocationSummary(invoke,
                                       can_call
@@ -3736,14 +3612,14 @@
     // Mark card for object assuming new value is stored. Worst case we will mark an unchanged
     // object and scan the receiver at the next GC for nothing.
     bool value_can_be_null = true;  // TODO: Worth finding out this information?
-    codegen->MarkGCCard(tmp_ptr, tmp, base, new_value, value_can_be_null);
+    codegen->MaybeMarkGCCard(tmp_ptr, tmp, base, new_value, value_can_be_null);
   }
 
   vixl32::Label exit_loop_label;
   vixl32::Label* exit_loop = &exit_loop_label;
   vixl32::Label* cmp_failure = &exit_loop_label;
 
-  if (gUseReadBarrier && type == DataType::Type::kReference) {
+  if (type == DataType::Type::kReference && codegen->EmitReadBarrier()) {
     // If marking, check if the stored reference is a from-space reference to the same
     // object as the to-space reference `expected`. If so, perform a custom CAS loop.
     ReadBarrierCasSlowPathARMVIXL* slow_path =
@@ -3799,19 +3675,19 @@
 }
 void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafeCASObject(HInvoke* invoke) {
   // `jdk.internal.misc.Unsafe.compareAndSwapObject` has compare-and-set semantics (see javadoc).
-  VisitJdkUnsafeCompareAndSetObject(invoke);
+  VisitJdkUnsafeCompareAndSetReference(invoke);
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafeCompareAndSetInt(HInvoke* invoke) {
-  CreateUnsafeCASLocations(allocator_, invoke);
+  CreateUnsafeCASLocations(invoke, codegen_);
 }
-void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafeCompareAndSetObject(HInvoke* invoke) {
+void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafeCompareAndSetReference(HInvoke* invoke) {
   // The only supported read barrier implementation is the Baker-style read barriers (b/173104084).
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+  if (codegen_->EmitNonBakerReadBarrier()) {
     return;
   }
 
-  CreateUnsafeCASLocations(allocator_, invoke);
+  CreateUnsafeCASLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitUnsafeCASInt(HInvoke* invoke) {
@@ -3827,15 +3703,15 @@
 }
 void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafeCASObject(HInvoke* invoke) {
   // `jdk.internal.misc.Unsafe.compareAndSwapObject` has compare-and-set semantics (see javadoc).
-  VisitJdkUnsafeCompareAndSetObject(invoke);
+  VisitJdkUnsafeCompareAndSetReference(invoke);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafeCompareAndSetInt(HInvoke* invoke) {
   GenUnsafeCas(invoke, DataType::Type::kInt32, codegen_);
 }
-void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafeCompareAndSetObject(HInvoke* invoke) {
+void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafeCompareAndSetReference(HInvoke* invoke) {
   // The only supported read barrier implementation is the Baker-style read barriers (b/173104084).
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen_->EmitReadBarrier(), kUseBakerReadBarrier);
 
   GenUnsafeCas(invoke, DataType::Type::kReference, codegen_);
 }
@@ -3981,6 +3857,172 @@
   __ B(ne, &loop_label);
 }
 
+static void CreateUnsafeGetAndUpdateLocations(HInvoke* invoke,
+                                              CodeGeneratorARMVIXL* codegen,
+                                              DataType::Type type,
+                                              GetAndUpdateOp get_and_update_op) {
+  const bool can_call = codegen->EmitReadBarrier() && IsUnsafeGetAndSetReference(invoke);
+  ArenaAllocator* allocator = invoke->GetBlock()->GetGraph()->GetAllocator();
+  LocationSummary* locations =
+      new (allocator) LocationSummary(invoke,
+                                      can_call
+                                          ? LocationSummary::kCallOnSlowPath
+                                          : LocationSummary::kNoCall,
+                                      kIntrinsified);
+  if (can_call && kUseBakerReadBarrier) {
+    locations->SetCustomSlowPathCallerSaves(RegisterSet::Empty());  // No caller-save registers.
+  }
+  locations->SetInAt(0, Location::NoLocation());        // Unused receiver.
+  locations->SetInAt(1, Location::RequiresRegister());
+  locations->SetInAt(2, Location::RequiresRegister());
+  locations->SetInAt(3, Location::RequiresRegister());
+
+  locations->SetOut(Location::RequiresRegister(), Location::kOutputOverlap);
+
+  size_t num_temps = 1u;  // We always need `tmp_ptr`.
+  if (get_and_update_op == GetAndUpdateOp::kAdd) {
+    // Add `maybe_temp` used for the new value in `GenerateGetAndUpdate()`.
+    num_temps += (type == DataType::Type::kInt64) ? 2u : 1u;
+    if (type == DataType::Type::kInt64) {
+      // There are enough available registers but the register allocator can fail to allocate
+      // them correctly because it can block register pairs by single-register inputs and temps.
+      // To work around this limitation, use a fixed register pair for both the output as well
+      // as the offset which is not needed anymore after the address calculation.
+      // (Alternatively, we could set up distinct fixed locations for `offset`, `arg` and `out`.)
+      locations->SetInAt(2, LocationFrom(r0, r1));
+      locations->UpdateOut(LocationFrom(r0, r1));
+    }
+  }
+  locations->AddRegisterTemps(num_temps);
+}
+
+static void GenUnsafeGetAndUpdate(HInvoke* invoke,
+                                  CodeGeneratorARMVIXL* codegen,
+                                  DataType::Type type,
+                                  GetAndUpdateOp get_and_update_op) {
+  ArmVIXLAssembler* assembler = codegen->GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+
+  Location out = locations->Out();                                  // Result.
+  vixl32::Register base = InputRegisterAt(invoke, 1);               // Object pointer.
+  vixl32::Register offset = LowRegisterFrom(locations->InAt(2));    // Offset (discard high 4B).
+  Location arg = locations->InAt(3);                                // New value or addend.
+  vixl32::Register tmp_ptr = RegisterFrom(locations->GetTemp(0));   // Pointer to actual memory.
+  Location maybe_temp = Location::NoLocation();
+  if (get_and_update_op == GetAndUpdateOp::kAdd) {
+    maybe_temp = (type == DataType::Type::kInt64)
+        ? LocationFrom(RegisterFrom(locations->GetTemp(1)), RegisterFrom(locations->GetTemp(2)))
+        : locations->GetTemp(1);
+  }
+
+  UseScratchRegisterScope temps(assembler->GetVIXLAssembler());
+  vixl32::Register temp = temps.Acquire();
+
+  if (type == DataType::Type::kReference) {
+    DCHECK(get_and_update_op == GetAndUpdateOp::kSet);
+    // Mark card for object as a new value shall be stored.
+    bool new_value_can_be_null = true;  // TODO: Worth finding out this information?
+    vixl32::Register card = tmp_ptr;  // Use the `tmp_ptr` also as the `card` temporary.
+    codegen->MaybeMarkGCCard(temp, card, base, /*value=*/ RegisterFrom(arg), new_value_can_be_null);
+  }
+
+  // Note: UnsafeGetAndUpdate operations are sequentially consistent, requiring
+  // a barrier before and after the raw load/store-exclusive operation.
+
+  __ Add(tmp_ptr, base, Operand(offset));
+  codegen->GenerateMemoryBarrier(MemBarrierKind::kAnyAny);
+  GenerateGetAndUpdate(codegen,
+                       get_and_update_op,
+                       type,
+                       tmp_ptr,
+                       arg,
+                       /*old_value=*/ out,
+                       /*store_result=*/ temp,
+                       maybe_temp,
+                       /*maybe_vreg_temp=*/ Location::NoLocation());
+  codegen->GenerateMemoryBarrier(MemBarrierKind::kAnyAny);
+
+  if (type == DataType::Type::kReference && codegen->EmitReadBarrier()) {
+    DCHECK(get_and_update_op == GetAndUpdateOp::kSet);
+    if (kUseBakerReadBarrier) {
+      codegen->GenerateIntrinsicMoveWithBakerReadBarrier(RegisterFrom(out), RegisterFrom(out));
+    } else {
+      codegen->GenerateReadBarrierSlow(
+          invoke,
+          out,
+          out,
+          Location::RegisterLocation(base.GetCode()),
+          /*offset=*/ 0u,
+          /*index=*/ Location::RegisterLocation(offset.GetCode()));
+    }
+  }
+}
+
+void IntrinsicLocationsBuilderARMVIXL::VisitUnsafeGetAndAddInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddInt(invoke);
+}
+void IntrinsicLocationsBuilderARMVIXL::VisitUnsafeGetAndAddLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddLong(invoke);
+}
+void IntrinsicLocationsBuilderARMVIXL::VisitUnsafeGetAndSetInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetInt(invoke);
+}
+void IntrinsicLocationsBuilderARMVIXL::VisitUnsafeGetAndSetLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetLong(invoke);
+}
+void IntrinsicLocationsBuilderARMVIXL::VisitUnsafeGetAndSetObject(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetReference(invoke);
+}
+
+void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafeGetAndAddInt(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(invoke, codegen_, DataType::Type::kInt32, GetAndUpdateOp::kAdd);
+}
+void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafeGetAndAddLong(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(invoke, codegen_, DataType::Type::kInt64, GetAndUpdateOp::kAdd);
+}
+void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafeGetAndSetInt(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(invoke, codegen_, DataType::Type::kInt32, GetAndUpdateOp::kSet);
+}
+void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafeGetAndSetLong(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(invoke, codegen_, DataType::Type::kInt64, GetAndUpdateOp::kSet);
+}
+void IntrinsicLocationsBuilderARMVIXL::VisitJdkUnsafeGetAndSetReference(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(
+      invoke, codegen_, DataType::Type::kReference, GetAndUpdateOp::kSet);
+}
+
+void IntrinsicCodeGeneratorARMVIXL::VisitUnsafeGetAndAddInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddInt(invoke);
+}
+void IntrinsicCodeGeneratorARMVIXL::VisitUnsafeGetAndAddLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddLong(invoke);
+}
+void IntrinsicCodeGeneratorARMVIXL::VisitUnsafeGetAndSetInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetInt(invoke);
+}
+void IntrinsicCodeGeneratorARMVIXL::VisitUnsafeGetAndSetLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetLong(invoke);
+}
+void IntrinsicCodeGeneratorARMVIXL::VisitUnsafeGetAndSetObject(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetReference(invoke);
+}
+
+void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafeGetAndAddInt(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, codegen_, DataType::Type::kInt32, GetAndUpdateOp::kAdd);
+}
+void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafeGetAndAddLong(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, codegen_, DataType::Type::kInt64, GetAndUpdateOp::kAdd);
+}
+void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafeGetAndSetInt(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, codegen_, DataType::Type::kInt32, GetAndUpdateOp::kSet);
+}
+void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafeGetAndSetLong(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, codegen_, DataType::Type::kInt64, GetAndUpdateOp::kSet);
+}
+void IntrinsicCodeGeneratorARMVIXL::VisitJdkUnsafeGetAndSetReference(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, codegen_, DataType::Type::kReference, GetAndUpdateOp::kSet);
+}
+
 class VarHandleSlowPathARMVIXL : public IntrinsicSlowPathARMVIXL {
  public:
   VarHandleSlowPathARMVIXL(HInvoke* invoke, std::memory_order order)
@@ -4372,23 +4414,23 @@
       __ Mov(target.offset, target_field->GetOffset().Uint32Value());
     } else {
       // For static fields, we need to fill the `target.object` with the declaring class,
-      // so we can use `target.object` as temporary for the `ArtMethod*`. For instance fields,
-      // we do not need the declaring class, so we can forget the `ArtMethod*` when
-      // we load the `target.offset`, so use the `target.offset` to hold the `ArtMethod*`.
-      vixl32::Register method = (expected_coordinates_count == 0) ? target.object : target.offset;
+      // so we can use `target.object` as temporary for the `ArtField*`. For instance fields,
+      // we do not need the declaring class, so we can forget the `ArtField*` when
+      // we load the `target.offset`, so use the `target.offset` to hold the `ArtField*`.
+      vixl32::Register field = (expected_coordinates_count == 0) ? target.object : target.offset;
 
       const MemberOffset art_field_offset = mirror::FieldVarHandle::ArtFieldOffset();
       const MemberOffset offset_offset = ArtField::OffsetOffset();
 
-      // Load the ArtField, the offset and, if needed, declaring class.
-      __ Ldr(method, MemOperand(varhandle, art_field_offset.Int32Value()));
-      __ Ldr(target.offset, MemOperand(method, offset_offset.Int32Value()));
+      // Load the ArtField*, the offset and, if needed, declaring class.
+      __ Ldr(field, MemOperand(varhandle, art_field_offset.Int32Value()));
+      __ Ldr(target.offset, MemOperand(field, offset_offset.Int32Value()));
       if (expected_coordinates_count == 0u) {
         codegen->GenerateGcRootFieldLoad(invoke,
                                          LocationFrom(target.object),
-                                         method,
+                                         field,
                                          ArtField::DeclaringClassOffset().Int32Value(),
-                                         gCompilerReadBarrierOption);
+                                         codegen->GetCompilerReadBarrierOption());
       }
     }
   } else {
@@ -4408,7 +4450,8 @@
   }
 }
 
-static LocationSummary* CreateVarHandleCommonLocations(HInvoke* invoke) {
+static LocationSummary* CreateVarHandleCommonLocations(HInvoke* invoke,
+                                                       CodeGeneratorARMVIXL* codegen) {
   size_t expected_coordinates_count = GetExpectedVarHandleCoordinatesCount(invoke);
   DataType::Type return_type = invoke->GetType();
 
@@ -4440,7 +4483,7 @@
   }
 
   // Add a temporary for offset.
-  if ((gUseReadBarrier && !kUseBakerReadBarrier) &&
+  if (codegen->EmitNonBakerReadBarrier() &&
       GetExpectedVarHandleCoordinatesCount(invoke) == 0u) {  // For static fields.
     // To preserve the offset value across the non-Baker read barrier slow path
     // for loading the declaring class, use a fixed callee-save register.
@@ -4465,7 +4508,7 @@
     return;
   }
 
-  if ((gUseReadBarrier && !kUseBakerReadBarrier) &&
+  if (codegen->EmitNonBakerReadBarrier() &&
       invoke->GetType() == DataType::Type::kReference &&
       invoke->GetIntrinsic() != Intrinsics::kVarHandleGet &&
       invoke->GetIntrinsic() != Intrinsics::kVarHandleGetOpaque) {
@@ -4475,7 +4518,7 @@
     return;
   }
 
-  LocationSummary* locations = CreateVarHandleCommonLocations(invoke);
+  LocationSummary* locations = CreateVarHandleCommonLocations(invoke, codegen);
 
   DataType::Type type = invoke->GetType();
   if (type == DataType::Type::kFloat64 && Use64BitExclusiveLoadStore(atomic, codegen)) {
@@ -4513,7 +4556,7 @@
   Location maybe_temp = Location::NoLocation();
   Location maybe_temp2 = Location::NoLocation();
   Location maybe_temp3 = Location::NoLocation();
-  if (gUseReadBarrier && kUseBakerReadBarrier && type == DataType::Type::kReference) {
+  if (type == DataType::Type::kReference && codegen->EmitBakerReadBarrier()) {
     // Reuse the offset temporary.
     maybe_temp = LocationFrom(target.offset);
   } else if (DataType::Is64BitType(type) && Use64BitExclusiveLoadStore(atomic, codegen)) {
@@ -4617,7 +4660,7 @@
     return;
   }
 
-  LocationSummary* locations = CreateVarHandleCommonLocations(invoke);
+  LocationSummary* locations = CreateVarHandleCommonLocations(invoke, codegen);
 
   uint32_t number_of_arguments = invoke->GetNumberOfArguments();
   DataType::Type value_type = GetDataTypeFromShorty(invoke, number_of_arguments - 1u);
@@ -4736,7 +4779,7 @@
     vixl32::Register temp = target.offset;
     vixl32::Register card = temps.Acquire();
     vixl32::Register value_reg = RegisterFrom(value);
-    codegen->MarkGCCard(temp, card, target.object, value_reg, /* emit_null_check= */ true);
+    codegen->MaybeMarkGCCard(temp, card, target.object, value_reg, /* emit_null_check= */ true);
   }
 
   if (slow_path != nullptr) {
@@ -4778,7 +4821,9 @@
   GenerateVarHandleSet(invoke, codegen_, std::memory_order_seq_cst, /*atomic=*/ true);
 }
 
-static void CreateVarHandleCompareAndSetOrExchangeLocations(HInvoke* invoke, bool return_success) {
+static void CreateVarHandleCompareAndSetOrExchangeLocations(HInvoke* invoke,
+                                                            CodeGeneratorARMVIXL* codegen,
+                                                            bool return_success) {
   VarHandleOptimizations optimizations(invoke);
   if (optimizations.GetDoNotIntrinsify()) {
     return;
@@ -4786,8 +4831,7 @@
 
   uint32_t number_of_arguments = invoke->GetNumberOfArguments();
   DataType::Type value_type = GetDataTypeFromShorty(invoke, number_of_arguments - 1u);
-  if ((gUseReadBarrier && !kUseBakerReadBarrier) &&
-      value_type == DataType::Type::kReference) {
+  if (value_type == DataType::Type::kReference && codegen->EmitNonBakerReadBarrier()) {
     // Unsupported for non-Baker read barrier because the artReadBarrierSlow() ignores
     // the passed reference and reloads it from the field. This breaks the read barriers
     // in slow path in different ways. The marked old value may not actually be a to-space
@@ -4798,9 +4842,9 @@
     return;
   }
 
-  LocationSummary* locations = CreateVarHandleCommonLocations(invoke);
+  LocationSummary* locations = CreateVarHandleCommonLocations(invoke, codegen);
 
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+  if (codegen->EmitNonBakerReadBarrier()) {
     // We need callee-save registers for both the class object and offset instead of
     // the temporaries reserved in CreateVarHandleCommonLocations().
     static_assert(POPCOUNT(kArmCalleeSaveRefSpills) >= 2u);
@@ -4836,7 +4880,7 @@
       locations->AddRegisterTemps(2u);
     }
   }
-  if (gUseReadBarrier && value_type == DataType::Type::kReference) {
+  if (value_type == DataType::Type::kReference && codegen->EmitReadBarrier()) {
     // Add a temporary for store result, also used for the `old_value_temp` in slow path.
     locations->AddTemp(Location::RequiresRegister());
   }
@@ -4967,7 +5011,7 @@
   vixl32::Label* exit_loop = &exit_loop_label;
   vixl32::Label* cmp_failure = &exit_loop_label;
 
-  if (gUseReadBarrier && value_type == DataType::Type::kReference) {
+  if (value_type == DataType::Type::kReference && codegen->EmitReadBarrier()) {
     // The `old_value_temp` is used first for the marked `old_value` and then for the unmarked
     // reloaded old value for subsequent CAS in the slow path. This must not clobber `old_value`.
     vixl32::Register old_value_temp = return_success ? RegisterFrom(out) : store_result;
@@ -5035,7 +5079,8 @@
     vixl32::Register card = tmp_ptr;
     // Mark card for object assuming new value is stored.
     bool new_value_can_be_null = true;  // TODO: Worth finding out this information?
-    codegen->MarkGCCard(temp, card, target.object, RegisterFrom(new_value), new_value_can_be_null);
+    codegen->MaybeMarkGCCard(
+        temp, card, target.object, RegisterFrom(new_value), new_value_can_be_null);
   }
 
   if (slow_path != nullptr) {
@@ -5045,7 +5090,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleCompareAndExchange(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, /*return_success=*/ false);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ false);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleCompareAndExchange(HInvoke* invoke) {
@@ -5054,7 +5099,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleCompareAndExchangeAcquire(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, /*return_success=*/ false);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ false);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleCompareAndExchangeAcquire(HInvoke* invoke) {
@@ -5063,7 +5108,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleCompareAndExchangeRelease(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, /*return_success=*/ false);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ false);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleCompareAndExchangeRelease(HInvoke* invoke) {
@@ -5072,7 +5117,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleCompareAndSet(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, /*return_success=*/ true);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ true);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleCompareAndSet(HInvoke* invoke) {
@@ -5081,7 +5126,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleWeakCompareAndSet(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, /*return_success=*/ true);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ true);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleWeakCompareAndSet(HInvoke* invoke) {
@@ -5090,7 +5135,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleWeakCompareAndSetAcquire(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, /*return_success=*/ true);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ true);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleWeakCompareAndSetAcquire(HInvoke* invoke) {
@@ -5099,7 +5144,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleWeakCompareAndSetPlain(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, /*return_success=*/ true);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ true);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleWeakCompareAndSetPlain(HInvoke* invoke) {
@@ -5108,7 +5153,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleWeakCompareAndSetRelease(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, /*return_success=*/ true);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ true);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleWeakCompareAndSetRelease(HInvoke* invoke) {
@@ -5117,21 +5162,21 @@
 }
 
 static void CreateVarHandleGetAndUpdateLocations(HInvoke* invoke,
+                                                 CodeGeneratorARMVIXL* codegen,
                                                  GetAndUpdateOp get_and_update_op) {
   VarHandleOptimizations optimizations(invoke);
   if (optimizations.GetDoNotIntrinsify()) {
     return;
   }
 
-  if ((gUseReadBarrier && !kUseBakerReadBarrier) &&
-      invoke->GetType() == DataType::Type::kReference) {
+  if (invoke->GetType() == DataType::Type::kReference && codegen->EmitNonBakerReadBarrier()) {
     // Unsupported for non-Baker read barrier because the artReadBarrierSlow() ignores
     // the passed reference and reloads it from the field, thus seeing the new value
     // that we have just stored. (And it also gets the memory visibility wrong.) b/173104084
     return;
   }
 
-  LocationSummary* locations = CreateVarHandleCommonLocations(invoke);
+  LocationSummary* locations = CreateVarHandleCommonLocations(invoke, codegen);
 
   // We can reuse the declaring class (if present) and offset temporary, except for
   // non-Baker read barriers that need them for the slow path.
@@ -5144,8 +5189,7 @@
       // Add temps needed to do the GenerateGetAndUpdate() with core registers.
       size_t temps_needed = (value_type == DataType::Type::kFloat64) ? 5u : 3u;
       locations->AddRegisterTemps(temps_needed - locations->GetTempCount());
-    } else if ((gUseReadBarrier && !kUseBakerReadBarrier) &&
-               value_type == DataType::Type::kReference) {
+    } else if (value_type == DataType::Type::kReference && codegen->EmitNonBakerReadBarrier()) {
       // We need to preserve the declaring class (if present) and offset for read barrier
       // slow paths, so we must use a separate temporary for the exclusive store result.
       locations->AddTemp(Location::RequiresRegister());
@@ -5250,7 +5294,7 @@
       if (byte_swap) {
         GenerateReverseBytes(assembler, DataType::Type::kInt32, arg, arg);
       }
-    } else if (gUseReadBarrier && value_type == DataType::Type::kReference) {
+    } else if (value_type == DataType::Type::kReference && codegen->EmitReadBarrier()) {
       if (kUseBakerReadBarrier) {
         // Load the old value initially to a temporary register.
         // We shall move it to `out` later with a read barrier.
@@ -5333,10 +5377,10 @@
     } else {
       __ Vmov(SRegisterFrom(out), RegisterFrom(old_value));
     }
-  } else if (gUseReadBarrier && value_type == DataType::Type::kReference) {
+  } else if (value_type == DataType::Type::kReference && codegen->EmitReadBarrier()) {
     if (kUseBakerReadBarrier) {
-      codegen->GenerateIntrinsicCasMoveWithBakerReadBarrier(RegisterFrom(out),
-                                                            RegisterFrom(old_value));
+      codegen->GenerateIntrinsicMoveWithBakerReadBarrier(RegisterFrom(out),
+                                                         RegisterFrom(old_value));
     } else {
       codegen->GenerateReadBarrierSlow(
           invoke,
@@ -5354,7 +5398,7 @@
     vixl32::Register card = tmp_ptr;
     // Mark card for object assuming new value is stored.
     bool new_value_can_be_null = true;  // TODO: Worth finding out this information?
-    codegen->MarkGCCard(temp, card, target.object, RegisterFrom(arg), new_value_can_be_null);
+    codegen->MaybeMarkGCCard(temp, card, target.object, RegisterFrom(arg), new_value_can_be_null);
   }
 
   if (slow_path != nullptr) {
@@ -5364,7 +5408,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleGetAndSet(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kSet);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kSet);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleGetAndSet(HInvoke* invoke) {
@@ -5372,7 +5416,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleGetAndSetAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kSet);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kSet);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleGetAndSetAcquire(HInvoke* invoke) {
@@ -5380,7 +5424,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleGetAndSetRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kSet);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kSet);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleGetAndSetRelease(HInvoke* invoke) {
@@ -5388,7 +5432,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleGetAndAdd(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kAdd);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAdd);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleGetAndAdd(HInvoke* invoke) {
@@ -5396,7 +5440,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleGetAndAddAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kAdd);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAdd);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleGetAndAddAcquire(HInvoke* invoke) {
@@ -5404,7 +5448,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleGetAndAddRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kAdd);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAdd);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleGetAndAddRelease(HInvoke* invoke) {
@@ -5412,7 +5456,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleGetAndBitwiseAnd(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kAnd);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAnd);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleGetAndBitwiseAnd(HInvoke* invoke) {
@@ -5420,7 +5464,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleGetAndBitwiseAndAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kAnd);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAnd);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleGetAndBitwiseAndAcquire(HInvoke* invoke) {
@@ -5428,7 +5472,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleGetAndBitwiseAndRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kAnd);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAnd);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleGetAndBitwiseAndRelease(HInvoke* invoke) {
@@ -5436,7 +5480,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleGetAndBitwiseOr(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kOr);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kOr);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleGetAndBitwiseOr(HInvoke* invoke) {
@@ -5444,7 +5488,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleGetAndBitwiseOrAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kOr);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kOr);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleGetAndBitwiseOrAcquire(HInvoke* invoke) {
@@ -5452,7 +5496,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleGetAndBitwiseOrRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kOr);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kOr);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleGetAndBitwiseOrRelease(HInvoke* invoke) {
@@ -5460,7 +5504,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleGetAndBitwiseXor(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kXor);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kXor);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleGetAndBitwiseXor(HInvoke* invoke) {
@@ -5468,7 +5512,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleGetAndBitwiseXorAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kXor);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kXor);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleGetAndBitwiseXorAcquire(HInvoke* invoke) {
@@ -5476,7 +5520,7 @@
 }
 
 void IntrinsicLocationsBuilderARMVIXL::VisitVarHandleGetAndBitwiseXorRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndUpdateLocations(invoke, GetAndUpdateOp::kXor);
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kXor);
 }
 
 void IntrinsicCodeGeneratorARMVIXL::VisitVarHandleGetAndBitwiseXorRelease(HInvoke* invoke) {
diff --git a/compiler/optimizing/intrinsics_arm_vixl.h b/compiler/optimizing/intrinsics_arm_vixl.h
index 54475bc..7dcb524 100644
--- a/compiler/optimizing/intrinsics_arm_vixl.h
+++ b/compiler/optimizing/intrinsics_arm_vixl.h
@@ -19,6 +19,7 @@
 
 #include "base/macros.h"
 #include "intrinsics.h"
+#include "intrinsics_list.h"
 #include "utils/arm/assembler_arm_vixl.h"
 
 namespace art HIDDEN {
@@ -36,9 +37,7 @@
 
 #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \
   void Visit ## Name(HInvoke* invoke) override;
-#include "intrinsics_list.h"
-  INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
-#undef INTRINSICS_LIST
+  ART_INTRINSICS_WITH_HINVOKE_LIST(OPTIMIZING_INTRINSICS)
 #undef OPTIMIZING_INTRINSICS
 
   // Check whether an invoke is an intrinsic, and if so, create a location summary. Returns whether
@@ -63,15 +62,17 @@
 
 #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \
   void Visit ## Name(HInvoke* invoke) override;
-#include "intrinsics_list.h"
-  INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
-#undef INTRINSICS_LIST
+  ART_INTRINSICS_WITH_HINVOKE_LIST(OPTIMIZING_INTRINSICS)
 #undef OPTIMIZING_INTRINSICS
 
  private:
   ArenaAllocator* GetAllocator();
   ArmVIXLAssembler* GetAssembler();
 
+  void HandleValueOf(HInvoke* invoke,
+                     const IntrinsicVisitor::ValueOfInfo& info,
+                     DataType::Type type);
+
   CodeGeneratorARMVIXL* const codegen_;
 
   DISALLOW_COPY_AND_ASSIGN(IntrinsicCodeGeneratorARMVIXL);
diff --git a/compiler/optimizing/intrinsics_riscv64.cc b/compiler/optimizing/intrinsics_riscv64.cc
new file mode 100644
index 0000000..7fdb015
--- /dev/null
+++ b/compiler/optimizing/intrinsics_riscv64.cc
@@ -0,0 +1,4730 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "intrinsics_riscv64.h"
+
+#include "code_generator_riscv64.h"
+#include "intrinsic_objects.h"
+#include "intrinsics_utils.h"
+#include "well_known_classes.h"
+
+namespace art HIDDEN {
+namespace riscv64 {
+
+using IntrinsicSlowPathRISCV64 = IntrinsicSlowPath<InvokeDexCallingConventionVisitorRISCV64,
+                                                   SlowPathCodeRISCV64,
+                                                   Riscv64Assembler>;
+
+#define __ assembler->
+
+// Slow path implementing the SystemArrayCopy intrinsic copy loop with read barriers.
+class ReadBarrierSystemArrayCopySlowPathRISCV64 : public SlowPathCodeRISCV64 {
+ public:
+  ReadBarrierSystemArrayCopySlowPathRISCV64(HInstruction* instruction, Location tmp)
+      : SlowPathCodeRISCV64(instruction), tmp_(tmp) {}
+
+  void EmitNativeCode(CodeGenerator* codegen_in) override {
+    DCHECK(codegen_in->EmitBakerReadBarrier());
+    CodeGeneratorRISCV64* codegen = down_cast<CodeGeneratorRISCV64*>(codegen_in);
+    Riscv64Assembler* assembler = codegen->GetAssembler();
+    LocationSummary* locations = instruction_->GetLocations();
+    DCHECK(locations->CanCall());
+    DCHECK(instruction_->IsInvokeStaticOrDirect())
+        << "Unexpected instruction in read barrier arraycopy slow path: "
+        << instruction_->DebugName();
+    DCHECK(instruction_->GetLocations()->Intrinsified());
+    DCHECK_EQ(instruction_->AsInvoke()->GetIntrinsic(), Intrinsics::kSystemArrayCopy);
+
+    const int32_t element_size = DataType::Size(DataType::Type::kReference);
+
+    XRegister src_curr_addr = locations->GetTemp(0).AsRegister<XRegister>();
+    XRegister dst_curr_addr = locations->GetTemp(1).AsRegister<XRegister>();
+    XRegister src_stop_addr = locations->GetTemp(2).AsRegister<XRegister>();
+    XRegister tmp_reg = tmp_.AsRegister<XRegister>();
+
+    __ Bind(GetEntryLabel());
+    // The source range and destination pointer were initialized before entering the slow-path.
+    Riscv64Label slow_copy_loop;
+    __ Bind(&slow_copy_loop);
+    __ Loadwu(tmp_reg, src_curr_addr, 0);
+    codegen->MaybeUnpoisonHeapReference(tmp_reg);
+    // TODO: Inline the mark bit check before calling the runtime?
+    // tmp_reg = ReadBarrier::Mark(tmp_reg);
+    // No need to save live registers; it's taken care of by the
+    // entrypoint. Also, there is no need to update the stack mask,
+    // as this runtime call will not trigger a garbage collection.
+    // (See ReadBarrierMarkSlowPathRISCV64::EmitNativeCode for more
+    // explanations.)
+    int32_t entry_point_offset = ReadBarrierMarkEntrypointOffset(tmp_);
+    // This runtime call does not require a stack map.
+    codegen->InvokeRuntimeWithoutRecordingPcInfo(entry_point_offset, instruction_, this);
+    codegen->MaybePoisonHeapReference(tmp_reg);
+    __ Storew(tmp_reg, dst_curr_addr, 0);
+    __ Addi(src_curr_addr, src_curr_addr, element_size);
+    __ Addi(dst_curr_addr, dst_curr_addr, element_size);
+    __ Bne(src_curr_addr, src_stop_addr, &slow_copy_loop);
+    __ J(GetExitLabel());
+  }
+
+  const char* GetDescription() const override {
+    return "ReadBarrierSystemArrayCopySlowPathRISCV64";
+  }
+
+ private:
+  Location tmp_;
+
+  DISALLOW_COPY_AND_ASSIGN(ReadBarrierSystemArrayCopySlowPathRISCV64);
+};
+
+bool IntrinsicLocationsBuilderRISCV64::TryDispatch(HInvoke* invoke) {
+  Dispatch(invoke);
+  LocationSummary* res = invoke->GetLocations();
+  if (res == nullptr) {
+    return false;
+  }
+  return res->Intrinsified();
+}
+
+Riscv64Assembler* IntrinsicCodeGeneratorRISCV64::GetAssembler() {
+  return codegen_->GetAssembler();
+}
+
+static void CreateFPToIntLocations(ArenaAllocator* allocator, HInvoke* invoke) {
+  LocationSummary* locations =
+      new (allocator) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
+  locations->SetInAt(0, Location::RequiresFpuRegister());
+  locations->SetOut(Location::RequiresRegister());
+}
+
+static void CreateIntToFPLocations(ArenaAllocator* allocator, HInvoke* invoke) {
+  LocationSummary* locations =
+      new (allocator) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
+  locations->SetInAt(0, Location::RequiresRegister());
+  locations->SetOut(Location::RequiresFpuRegister());
+}
+
+static void CreateFPToFPCallLocations(ArenaAllocator* allocator, HInvoke* invoke) {
+  DCHECK_EQ(invoke->GetNumberOfArguments(), 1U);
+  DCHECK(DataType::IsFloatingPointType(invoke->InputAt(0)->GetType()));
+  DCHECK(DataType::IsFloatingPointType(invoke->GetType()));
+
+  LocationSummary* const locations =
+      new (allocator) LocationSummary(invoke, LocationSummary::kCallOnMainOnly, kIntrinsified);
+  InvokeRuntimeCallingConvention calling_convention;
+
+  locations->SetInAt(0, Location::FpuRegisterLocation(calling_convention.GetFpuRegisterAt(0)));
+  locations->SetOut(calling_convention.GetReturnLocation(invoke->GetType()));
+}
+
+static void CreateFPFPToFPCallLocations(ArenaAllocator* allocator, HInvoke* invoke) {
+  DCHECK_EQ(invoke->GetNumberOfArguments(), 2U);
+  DCHECK(DataType::IsFloatingPointType(invoke->InputAt(0)->GetType()));
+  DCHECK(DataType::IsFloatingPointType(invoke->InputAt(1)->GetType()));
+  DCHECK(DataType::IsFloatingPointType(invoke->GetType()));
+
+  LocationSummary* const locations =
+      new (allocator) LocationSummary(invoke, LocationSummary::kCallOnMainOnly, kIntrinsified);
+  InvokeRuntimeCallingConvention calling_convention;
+
+  locations->SetInAt(0, Location::FpuRegisterLocation(calling_convention.GetFpuRegisterAt(0)));
+  locations->SetInAt(1, Location::FpuRegisterLocation(calling_convention.GetFpuRegisterAt(1)));
+  locations->SetOut(calling_convention.GetReturnLocation(invoke->GetType()));
+}
+
+static void CreateFpFpFpToFpNoOverlapLocations(ArenaAllocator* allocator, HInvoke* invoke) {
+  DCHECK_EQ(invoke->GetNumberOfArguments(), 3U);
+  DCHECK(DataType::IsFloatingPointType(invoke->InputAt(0)->GetType()));
+  DCHECK(DataType::IsFloatingPointType(invoke->InputAt(1)->GetType()));
+  DCHECK(DataType::IsFloatingPointType(invoke->InputAt(2)->GetType()));
+  DCHECK(DataType::IsFloatingPointType(invoke->GetType()));
+
+  LocationSummary* const locations =
+      new (allocator) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
+
+  locations->SetInAt(0, Location::RequiresFpuRegister());
+  locations->SetInAt(1, Location::RequiresFpuRegister());
+  locations->SetInAt(2, Location::RequiresFpuRegister());
+  locations->SetOut(Location::RequiresFpuRegister(), Location::kNoOutputOverlap);
+}
+
+static void CreateFPToFPLocations(ArenaAllocator* allocator, HInvoke* invoke) {
+  LocationSummary* locations =
+      new (allocator) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
+  locations->SetInAt(0, Location::RequiresFpuRegister());
+  locations->SetOut(Location::RequiresFpuRegister());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitDoubleDoubleToRawLongBits(HInvoke* invoke) {
+  CreateFPToIntLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitDoubleDoubleToRawLongBits(HInvoke* invoke) {
+  LocationSummary* locations = invoke->GetLocations();
+  Riscv64Assembler* assembler = GetAssembler();
+  __ FMvXD(locations->Out().AsRegister<XRegister>(), locations->InAt(0).AsFpuRegister<FRegister>());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitDoubleLongBitsToDouble(HInvoke* invoke) {
+  CreateIntToFPLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitDoubleLongBitsToDouble(HInvoke* invoke) {
+  LocationSummary* locations = invoke->GetLocations();
+  Riscv64Assembler* assembler = GetAssembler();
+  __ FMvDX(locations->Out().AsFpuRegister<FRegister>(), locations->InAt(0).AsRegister<XRegister>());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitFloatFloatToRawIntBits(HInvoke* invoke) {
+  CreateFPToIntLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitFloatFloatToRawIntBits(HInvoke* invoke) {
+  LocationSummary* locations = invoke->GetLocations();
+  Riscv64Assembler* assembler = GetAssembler();
+  __ FMvXW(locations->Out().AsRegister<XRegister>(), locations->InAt(0).AsFpuRegister<FRegister>());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitFloatIntBitsToFloat(HInvoke* invoke) {
+  CreateIntToFPLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitFloatIntBitsToFloat(HInvoke* invoke) {
+  LocationSummary* locations = invoke->GetLocations();
+  Riscv64Assembler* assembler = GetAssembler();
+  __ FMvWX(locations->Out().AsFpuRegister<FRegister>(), locations->InAt(0).AsRegister<XRegister>());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitDoubleIsInfinite(HInvoke* invoke) {
+  CreateFPToIntLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitDoubleIsInfinite(HInvoke* invoke) {
+  LocationSummary* locations = invoke->GetLocations();
+  Riscv64Assembler* assembler = GetAssembler();
+  XRegister out = locations->Out().AsRegister<XRegister>();
+  __ FClassD(out, locations->InAt(0).AsFpuRegister<FRegister>());
+  __ Andi(out, out, kPositiveInfinity | kNegativeInfinity);
+  __ Snez(out, out);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitFloatIsInfinite(HInvoke* invoke) {
+  CreateFPToIntLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitFloatIsInfinite(HInvoke* invoke) {
+  LocationSummary* locations = invoke->GetLocations();
+  Riscv64Assembler* assembler = GetAssembler();
+  XRegister out = locations->Out().AsRegister<XRegister>();
+  __ FClassS(out, locations->InAt(0).AsFpuRegister<FRegister>());
+  __ Andi(out, out, kPositiveInfinity | kNegativeInfinity);
+  __ Snez(out, out);
+}
+
+static void CreateIntToIntNoOverlapLocations(ArenaAllocator* allocator, HInvoke* invoke) {
+  LocationSummary* locations =
+      new (allocator) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
+  locations->SetInAt(0, Location::RequiresRegister());
+  locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+}
+
+template <typename EmitOp>
+void EmitMemoryPeek(HInvoke* invoke, EmitOp&& emit_op) {
+  LocationSummary* locations = invoke->GetLocations();
+  emit_op(locations->Out().AsRegister<XRegister>(), locations->InAt(0).AsRegister<XRegister>());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMemoryPeekByte(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMemoryPeekByte(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitMemoryPeek(invoke, [&](XRegister rd, XRegister rs1) { __ Lb(rd, rs1, 0); });
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMemoryPeekIntNative(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMemoryPeekIntNative(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitMemoryPeek(invoke, [&](XRegister rd, XRegister rs1) { __ Lw(rd, rs1, 0); });
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMemoryPeekLongNative(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMemoryPeekLongNative(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitMemoryPeek(invoke, [&](XRegister rd, XRegister rs1) { __ Ld(rd, rs1, 0); });
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMemoryPeekShortNative(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMemoryPeekShortNative(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitMemoryPeek(invoke, [&](XRegister rd, XRegister rs1) { __ Lh(rd, rs1, 0); });
+}
+
+static void CreateIntIntToVoidLocations(ArenaAllocator* allocator, HInvoke* invoke) {
+  LocationSummary* locations =
+      new (allocator) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
+  locations->SetInAt(0, Location::RequiresRegister());
+  locations->SetInAt(1, Location::RequiresRegister());
+}
+
+static void CreateIntIntToIntSlowPathCallLocations(ArenaAllocator* allocator, HInvoke* invoke) {
+  LocationSummary* locations =
+      new (allocator) LocationSummary(invoke, LocationSummary::kCallOnSlowPath, kIntrinsified);
+  locations->SetInAt(0, Location::RequiresRegister());
+  locations->SetInAt(1, Location::RequiresRegister());
+  // Force kOutputOverlap; see comments in IntrinsicSlowPath::EmitNativeCode.
+  locations->SetOut(Location::RequiresRegister(), Location::kOutputOverlap);
+}
+
+template <typename EmitOp>
+void EmitMemoryPoke(HInvoke* invoke, EmitOp&& emit_op) {
+  LocationSummary* locations = invoke->GetLocations();
+  emit_op(locations->InAt(1).AsRegister<XRegister>(), locations->InAt(0).AsRegister<XRegister>());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMemoryPokeByte(HInvoke* invoke) {
+  CreateIntIntToVoidLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMemoryPokeByte(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitMemoryPoke(invoke, [&](XRegister rs2, XRegister rs1) { __ Sb(rs2, rs1, 0); });
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMemoryPokeIntNative(HInvoke* invoke) {
+  CreateIntIntToVoidLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMemoryPokeIntNative(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitMemoryPoke(invoke, [&](XRegister rs2, XRegister rs1) { __ Sw(rs2, rs1, 0); });
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMemoryPokeLongNative(HInvoke* invoke) {
+  CreateIntIntToVoidLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMemoryPokeLongNative(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitMemoryPoke(invoke, [&](XRegister rs2, XRegister rs1) { __ Sd(rs2, rs1, 0); });
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMemoryPokeShortNative(HInvoke* invoke) {
+  CreateIntIntToVoidLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMemoryPokeShortNative(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitMemoryPoke(invoke, [&](XRegister rs2, XRegister rs1) { __ Sh(rs2, rs1, 0); });
+}
+
+static void GenerateReverseBytes(CodeGeneratorRISCV64* codegen,
+                                 Location rd,
+                                 XRegister rs1,
+                                 DataType::Type type) {
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  switch (type) {
+    case DataType::Type::kUint16:
+      // There is no 16-bit reverse bytes instruction.
+      __ Rev8(rd.AsRegister<XRegister>(), rs1);
+      __ Srli(rd.AsRegister<XRegister>(), rd.AsRegister<XRegister>(), 48);
+      break;
+    case DataType::Type::kInt16:
+      // There is no 16-bit reverse bytes instruction.
+      __ Rev8(rd.AsRegister<XRegister>(), rs1);
+      __ Srai(rd.AsRegister<XRegister>(), rd.AsRegister<XRegister>(), 48);
+      break;
+    case DataType::Type::kInt32:
+      // There is no 32-bit reverse bytes instruction.
+      __ Rev8(rd.AsRegister<XRegister>(), rs1);
+      __ Srai(rd.AsRegister<XRegister>(), rd.AsRegister<XRegister>(), 32);
+      break;
+    case DataType::Type::kInt64:
+      __ Rev8(rd.AsRegister<XRegister>(), rs1);
+      break;
+    case DataType::Type::kFloat32:
+      // There is no 32-bit reverse bytes instruction.
+      __ Rev8(rs1, rs1);  // Note: Clobbers `rs1`.
+      __ Srai(rs1, rs1, 32);
+      __ FMvWX(rd.AsFpuRegister<FRegister>(), rs1);
+      break;
+    case DataType::Type::kFloat64:
+      __ Rev8(rs1, rs1);  // Note: Clobbers `rs1`.
+      __ FMvDX(rd.AsFpuRegister<FRegister>(), rs1);
+      break;
+    default:
+      LOG(FATAL) << "Unexpected type: " << type;
+      UNREACHABLE();
+  }
+}
+
+static void GenerateReverseBytes(CodeGeneratorRISCV64* codegen,
+                                 HInvoke* invoke,
+                                 DataType::Type type) {
+  DCHECK_EQ(type, invoke->GetType());
+  LocationSummary* locations = invoke->GetLocations();
+  GenerateReverseBytes(codegen, locations->Out(), locations->InAt(0).AsRegister<XRegister>(), type);
+}
+
+static void GenerateReverse(CodeGeneratorRISCV64* codegen, HInvoke* invoke, DataType::Type type) {
+  DCHECK_EQ(type, invoke->GetType());
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+  XRegister in = locations->InAt(0).AsRegister<XRegister>();
+  XRegister out = locations->Out().AsRegister<XRegister>();
+  ScratchRegisterScope srs(assembler);
+  XRegister temp1 = srs.AllocateXRegister();
+  XRegister temp2 = srs.AllocateXRegister();
+
+  auto maybe_extend_mask = [type, assembler](XRegister mask, XRegister temp) {
+    if (type == DataType::Type::kInt64) {
+      __ Slli(temp, mask, 32);
+      __ Add(mask, mask, temp);
+    }
+  };
+
+  // Swap bits in bit pairs.
+  __ Li(temp1, 0x55555555);
+  maybe_extend_mask(temp1, temp2);
+  __ Srli(temp2, in, 1);
+  __ And(out, in, temp1);
+  __ And(temp2, temp2, temp1);
+  __ Sh1Add(out, out, temp2);
+
+  // Swap bit pairs in 4-bit groups.
+  __ Li(temp1, 0x33333333);
+  maybe_extend_mask(temp1, temp2);
+  __ Srli(temp2, out, 2);
+  __ And(out, out, temp1);
+  __ And(temp2, temp2, temp1);
+  __ Sh2Add(out, out, temp2);
+
+  // Swap 4-bit groups in 8-bit groups.
+  __ Li(temp1, 0x0f0f0f0f);
+  maybe_extend_mask(temp1, temp2);
+  __ Srli(temp2, out, 4);
+  __ And(out, out, temp1);
+  __ And(temp2, temp2, temp1);
+  __ Slli(out, out, 4);
+  __ Add(out, out, temp2);
+
+  GenerateReverseBytes(codegen, Location::RegisterLocation(out), out, type);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitIntegerReverse(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitIntegerReverse(HInvoke* invoke) {
+  GenerateReverse(codegen_, invoke, DataType::Type::kInt32);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitLongReverse(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitLongReverse(HInvoke* invoke) {
+  GenerateReverse(codegen_, invoke, DataType::Type::kInt64);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitIntegerReverseBytes(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitIntegerReverseBytes(HInvoke* invoke) {
+  GenerateReverseBytes(codegen_, invoke, DataType::Type::kInt32);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitLongReverseBytes(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitLongReverseBytes(HInvoke* invoke) {
+  GenerateReverseBytes(codegen_, invoke, DataType::Type::kInt64);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitShortReverseBytes(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitShortReverseBytes(HInvoke* invoke) {
+  GenerateReverseBytes(codegen_, invoke, DataType::Type::kInt16);
+}
+
+template <typename EmitOp>
+void EmitIntegralUnOp(HInvoke* invoke, EmitOp&& emit_op) {
+  LocationSummary* locations = invoke->GetLocations();
+  emit_op(locations->Out().AsRegister<XRegister>(), locations->InAt(0).AsRegister<XRegister>());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitIntegerBitCount(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitIntegerBitCount(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitIntegralUnOp(invoke, [&](XRegister rd, XRegister rs1) { __ Cpopw(rd, rs1); });
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitLongBitCount(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitLongBitCount(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitIntegralUnOp(invoke, [&](XRegister rd, XRegister rs1) { __ Cpop(rd, rs1); });
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitIntegerHighestOneBit(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitIntegerHighestOneBit(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitIntegralUnOp(invoke, [&](XRegister rd, XRegister rs1) {
+    ScratchRegisterScope srs(assembler);
+    XRegister tmp = srs.AllocateXRegister();
+    XRegister tmp2 = srs.AllocateXRegister();
+    __ Clzw(tmp, rs1);
+    __ Li(tmp2, INT64_C(-0x80000000));
+    __ Srlw(tmp2, tmp2, tmp);
+    __ And(rd, rs1, tmp2);  // Make sure the result is zero if the input is zero.
+  });
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitLongHighestOneBit(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitLongHighestOneBit(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitIntegralUnOp(invoke, [&](XRegister rd, XRegister rs1) {
+    ScratchRegisterScope srs(assembler);
+    XRegister tmp = srs.AllocateXRegister();
+    XRegister tmp2 = srs.AllocateXRegister();
+    __ Clz(tmp, rs1);
+    __ Li(tmp2, INT64_C(-0x8000000000000000));
+    __ Srl(tmp2, tmp2, tmp);
+    __ And(rd, rs1, tmp2);  // Make sure the result is zero if the input is zero.
+  });
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitIntegerLowestOneBit(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitIntegerLowestOneBit(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitIntegralUnOp(invoke, [&](XRegister rd, XRegister rs1) {
+    ScratchRegisterScope srs(assembler);
+    XRegister tmp = srs.AllocateXRegister();
+    __ NegW(tmp, rs1);
+    __ And(rd, rs1, tmp);
+  });
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitLongLowestOneBit(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitLongLowestOneBit(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitIntegralUnOp(invoke, [&](XRegister rd, XRegister rs1) {
+    ScratchRegisterScope srs(assembler);
+    XRegister tmp = srs.AllocateXRegister();
+    __ Neg(tmp, rs1);
+    __ And(rd, rs1, tmp);
+  });
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitIntegerNumberOfLeadingZeros(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitIntegerNumberOfLeadingZeros(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitIntegralUnOp(invoke, [&](XRegister rd, XRegister rs1) { __ Clzw(rd, rs1); });
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitLongNumberOfLeadingZeros(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitLongNumberOfLeadingZeros(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitIntegralUnOp(invoke, [&](XRegister rd, XRegister rs1) { __ Clz(rd, rs1); });
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitIntegerNumberOfTrailingZeros(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitIntegerNumberOfTrailingZeros(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitIntegralUnOp(invoke, [&](XRegister rd, XRegister rs1) { __ Ctzw(rd, rs1); });
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitLongNumberOfTrailingZeros(HInvoke* invoke) {
+  CreateIntToIntNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitLongNumberOfTrailingZeros(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  EmitIntegralUnOp(invoke, [&](XRegister rd, XRegister rs1) { __ Ctz(rd, rs1); });
+}
+
+static void GenerateDivideUnsigned(HInvoke* invoke, CodeGeneratorRISCV64* codegen) {
+  LocationSummary* locations = invoke->GetLocations();
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  DataType::Type type = invoke->GetType();
+  DCHECK(type == DataType::Type::kInt32 || type == DataType::Type::kInt64);
+
+  XRegister dividend = locations->InAt(0).AsRegister<XRegister>();
+  XRegister divisor = locations->InAt(1).AsRegister<XRegister>();
+  XRegister out = locations->Out().AsRegister<XRegister>();
+
+  // Check if divisor is zero, bail to managed implementation to handle.
+  SlowPathCodeRISCV64* slow_path =
+      new (codegen->GetScopedAllocator()) IntrinsicSlowPathRISCV64(invoke);
+  codegen->AddSlowPath(slow_path);
+  __ Beqz(divisor, slow_path->GetEntryLabel());
+
+  if (type == DataType::Type::kInt32) {
+    __ Divuw(out, dividend, divisor);
+  } else {
+    __ Divu(out, dividend, divisor);
+  }
+
+  __ Bind(slow_path->GetExitLabel());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitIntegerDivideUnsigned(HInvoke* invoke) {
+  CreateIntIntToIntSlowPathCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitIntegerDivideUnsigned(HInvoke* invoke) {
+  GenerateDivideUnsigned(invoke, codegen_);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitLongDivideUnsigned(HInvoke* invoke) {
+  CreateIntIntToIntSlowPathCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitLongDivideUnsigned(HInvoke* invoke) {
+  GenerateDivideUnsigned(invoke, codegen_);
+}
+
+#define VISIT_INTRINSIC(name, low, high, type, start_index) \
+  void IntrinsicLocationsBuilderRISCV64::Visit ##name ##ValueOf(HInvoke* invoke) { \
+    InvokeRuntimeCallingConvention calling_convention; \
+    IntrinsicVisitor::ComputeValueOfLocations( \
+        invoke, \
+        codegen_, \
+        low, \
+        high - low + 1, \
+        calling_convention.GetReturnLocation(DataType::Type::kReference), \
+        Location::RegisterLocation(calling_convention.GetRegisterAt(0))); \
+  } \
+  void IntrinsicCodeGeneratorRISCV64::Visit ##name ##ValueOf(HInvoke* invoke) { \
+    IntrinsicVisitor::ValueOfInfo info = \
+        IntrinsicVisitor::ComputeValueOfInfo( \
+            invoke, \
+            codegen_->GetCompilerOptions(), \
+            WellKnownClasses::java_lang_ ##name ##_value, \
+            low, \
+            high - low + 1, \
+            start_index); \
+    HandleValueOf(invoke, info, type); \
+  }
+  BOXED_TYPES(VISIT_INTRINSIC)
+#undef VISIT_INTRINSIC
+
+void IntrinsicCodeGeneratorRISCV64::HandleValueOf(HInvoke* invoke,
+                                                  const IntrinsicVisitor::ValueOfInfo& info,
+                                                  DataType::Type type) {
+  Riscv64Assembler* assembler = codegen_->GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+  XRegister out = locations->Out().AsRegister<XRegister>();
+  ScratchRegisterScope srs(assembler);
+  XRegister temp = srs.AllocateXRegister();
+  auto allocate_instance = [&]() {
+    DCHECK_EQ(out, InvokeRuntimeCallingConvention().GetRegisterAt(0));
+    codegen_->LoadIntrinsicDeclaringClass(out, invoke);
+    codegen_->InvokeRuntime(kQuickAllocObjectInitialized, invoke, invoke->GetDexPc());
+    CheckEntrypointTypes<kQuickAllocObjectWithChecks, void*, mirror::Class*>();
+  };
+  if (invoke->InputAt(0)->IsIntConstant()) {
+    int32_t value = invoke->InputAt(0)->AsIntConstant()->GetValue();
+    if (static_cast<uint32_t>(value - info.low) < info.length) {
+      // Just embed the object in the code.
+      DCHECK_NE(info.value_boot_image_reference, ValueOfInfo::kInvalidReference);
+      codegen_->LoadBootImageAddress(out, info.value_boot_image_reference);
+    } else {
+      DCHECK(locations->CanCall());
+      // Allocate and initialize a new object.
+      // TODO: If we JIT, we could allocate the object now, and store it in the
+      // JIT object table.
+      allocate_instance();
+      __ Li(temp, value);
+      codegen_->GetInstructionVisitor()->Store(
+          Location::RegisterLocation(temp), out, info.value_offset, type);
+      // Class pointer and `value` final field stores require a barrier before publication.
+      codegen_->GenerateMemoryBarrier(MemBarrierKind::kStoreStore);
+    }
+  } else {
+    DCHECK(locations->CanCall());
+    XRegister in = locations->InAt(0).AsRegister<XRegister>();
+    Riscv64Label allocate, done;
+    // Check bounds of our cache.
+    __ AddConst32(out, in, -info.low);
+    __ Li(temp, info.length);
+    __ Bgeu(out, temp, &allocate);
+    // If the value is within the bounds, load the object directly from the array.
+    codegen_->LoadBootImageAddress(temp, info.array_data_boot_image_reference);
+    __ Sh2Add(temp, out, temp);
+    __ Loadwu(out, temp, 0);
+    codegen_->MaybeUnpoisonHeapReference(out);
+    __ J(&done);
+    __ Bind(&allocate);
+    // Otherwise allocate and initialize a new object.
+    allocate_instance();
+    codegen_->GetInstructionVisitor()->Store(
+        Location::RegisterLocation(in), out, info.value_offset, type);
+    // Class pointer and `value` final field stores require a barrier before publication.
+    codegen_->GenerateMemoryBarrier(MemBarrierKind::kStoreStore);
+    __ Bind(&done);
+  }
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitReferenceGetReferent(HInvoke* invoke) {
+  IntrinsicVisitor::CreateReferenceGetReferentLocations(invoke, codegen_);
+
+  if (codegen_->EmitBakerReadBarrier() && invoke->GetLocations() != nullptr) {
+    invoke->GetLocations()->AddTemp(Location::RequiresRegister());
+  }
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitReferenceGetReferent(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+  Location obj = locations->InAt(0);
+  Location out = locations->Out();
+
+  SlowPathCodeRISCV64* slow_path =
+      new (codegen_->GetScopedAllocator()) IntrinsicSlowPathRISCV64(invoke);
+  codegen_->AddSlowPath(slow_path);
+
+  if (codegen_->EmitReadBarrier()) {
+    // Check self->GetWeakRefAccessEnabled().
+    ScratchRegisterScope srs(assembler);
+    XRegister temp = srs.AllocateXRegister();
+    __ Loadwu(temp, TR, Thread::WeakRefAccessEnabledOffset<kRiscv64PointerSize>().Int32Value());
+    static_assert(enum_cast<int32_t>(WeakRefAccessState::kVisiblyEnabled) == 0);
+    __ Bnez(temp, slow_path->GetEntryLabel());
+  }
+
+  {
+    // Load the java.lang.ref.Reference class.
+    ScratchRegisterScope srs(assembler);
+    XRegister temp = srs.AllocateXRegister();
+    codegen_->LoadIntrinsicDeclaringClass(temp, invoke);
+
+    // Check static fields java.lang.ref.Reference.{disableIntrinsic,slowPathEnabled} together.
+    MemberOffset disable_intrinsic_offset = IntrinsicVisitor::GetReferenceDisableIntrinsicOffset();
+    DCHECK_ALIGNED(disable_intrinsic_offset.Uint32Value(), 2u);
+    DCHECK_EQ(disable_intrinsic_offset.Uint32Value() + 1u,
+              IntrinsicVisitor::GetReferenceSlowPathEnabledOffset().Uint32Value());
+    __ Loadhu(temp, temp, disable_intrinsic_offset.Int32Value());
+    __ Bnez(temp, slow_path->GetEntryLabel());
+  }
+
+  // Load the value from the field.
+  uint32_t referent_offset = mirror::Reference::ReferentOffset().Uint32Value();
+  if (codegen_->EmitBakerReadBarrier()) {
+    codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
+                                                    out,
+                                                    obj.AsRegister<XRegister>(),
+                                                    referent_offset,
+                                                    /*maybe_temp=*/ locations->GetTemp(0),
+                                                    /*needs_null_check=*/ false);
+  } else {
+    codegen_->GetInstructionVisitor()->Load(
+        out, obj.AsRegister<XRegister>(), referent_offset, DataType::Type::kReference);
+    codegen_->MaybeGenerateReadBarrierSlow(invoke, out, out, obj, referent_offset);
+  }
+  // Emit memory barrier for load-acquire.
+  codegen_->GenerateMemoryBarrier(MemBarrierKind::kLoadAny);
+  __ Bind(slow_path->GetExitLabel());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitReferenceRefersTo(HInvoke* invoke) {
+  IntrinsicVisitor::CreateReferenceRefersToLocations(invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitReferenceRefersTo(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+  XRegister obj = locations->InAt(0).AsRegister<XRegister>();
+  XRegister other = locations->InAt(1).AsRegister<XRegister>();
+  XRegister out = locations->Out().AsRegister<XRegister>();
+
+  uint32_t referent_offset = mirror::Reference::ReferentOffset().Uint32Value();
+  uint32_t monitor_offset = mirror::Object::MonitorOffset().Int32Value();
+
+  codegen_->GetInstructionVisitor()->Load(
+      Location::RegisterLocation(out), obj, referent_offset, DataType::Type::kReference);
+  codegen_->MaybeRecordImplicitNullCheck(invoke);
+  codegen_->MaybeUnpoisonHeapReference(out);
+
+  // Emit memory barrier for load-acquire.
+  codegen_->GenerateMemoryBarrier(MemBarrierKind::kLoadAny);
+
+  if (codegen_->EmitReadBarrier()) {
+    DCHECK(kUseBakerReadBarrier);
+
+    Riscv64Label calculate_result;
+
+    // If equal to `other`, the loaded reference is final (it cannot be a from-space reference).
+    __ Beq(out, other, &calculate_result);
+
+    // If the GC is not marking, the loaded reference is final.
+    ScratchRegisterScope srs(assembler);
+    XRegister tmp = srs.AllocateXRegister();
+    __ Loadwu(tmp, TR, Thread::IsGcMarkingOffset<kRiscv64PointerSize>().Int32Value());
+    __ Beqz(tmp, &calculate_result);
+
+    // Check if the loaded reference is null.
+    __ Beqz(out, &calculate_result);
+
+    // For correct memory visibility, we need a barrier before loading the lock word to
+    // synchronize with the publishing of `other` by the CC GC. However, as long as the
+    // load-acquire above is implemented as a plain load followed by a barrier (rather
+    // than an atomic load-acquire instruction which synchronizes only with other
+    // instructions on the same memory location), that barrier is sufficient.
+
+    // Load the lockword and check if it is a forwarding address.
+    static_assert(LockWord::kStateShift == 30u);
+    static_assert(LockWord::kStateForwardingAddress == 3u);
+    // Load the lock word sign-extended. Comparing it to the sign-extended forwarding
+    // address bits as unsigned is the same as comparing both zero-extended.
+    __ Loadw(tmp, out, monitor_offset);
+    // Materialize sign-extended forwarding address bits. This is a single LUI instruction.
+    XRegister tmp2 = srs.AllocateXRegister();
+    __ Li(tmp2, INT64_C(-1) & ~static_cast<int64_t>((1 << LockWord::kStateShift) - 1));
+    // If we do not have a forwarding address, the loaded reference cannot be the same as `other`,
+    // so we proceed to calculate the result with `out != other`.
+    __ Bltu(tmp, tmp2, &calculate_result);
+
+    // Extract the forwarding address for comparison with `other`.
+    // Note that the high 32 bits shall not be used for the result calculation.
+    __ Slliw(out, tmp, LockWord::kForwardingAddressShift);
+
+    __ Bind(&calculate_result);
+  }
+
+  // Calculate the result `out == other`.
+  __ Subw(out, out, other);
+  __ Seqz(out, out);
+}
+
+static void GenerateVisitStringIndexOf(HInvoke* invoke,
+                                       Riscv64Assembler* assembler,
+                                       CodeGeneratorRISCV64* codegen,
+                                       bool start_at_zero) {
+  LocationSummary* locations = invoke->GetLocations();
+
+  // Note that the null check must have been done earlier.
+  DCHECK(!invoke->CanDoImplicitNullCheckOn(invoke->InputAt(0)));
+
+  // Check for code points > 0xFFFF. Either a slow-path check when we don't know statically,
+  // or directly dispatch for a large constant, or omit slow-path for a small constant or a char.
+  SlowPathCodeRISCV64* slow_path = nullptr;
+  HInstruction* code_point = invoke->InputAt(1);
+  if (code_point->IsIntConstant()) {
+    if (static_cast<uint32_t>(code_point->AsIntConstant()->GetValue()) > 0xFFFFU) {
+      // Always needs the slow-path. We could directly dispatch to it, but this case should be
+      // rare, so for simplicity just put the full slow-path down and branch unconditionally.
+      slow_path = new (codegen->GetScopedAllocator()) IntrinsicSlowPathRISCV64(invoke);
+      codegen->AddSlowPath(slow_path);
+      __ J(slow_path->GetEntryLabel());
+      __ Bind(slow_path->GetExitLabel());
+      return;
+    }
+  } else if (code_point->GetType() != DataType::Type::kUint16) {
+    slow_path = new (codegen->GetScopedAllocator()) IntrinsicSlowPathRISCV64(invoke);
+    codegen->AddSlowPath(slow_path);
+    ScratchRegisterScope srs(assembler);
+    XRegister tmp = srs.AllocateXRegister();
+    __ Srliw(tmp, locations->InAt(1).AsRegister<XRegister>(), 16);
+    __ Bnez(tmp, slow_path->GetEntryLabel());
+  }
+
+  if (start_at_zero) {
+    // Start-index = 0.
+    XRegister tmp_reg = locations->GetTemp(0).AsRegister<XRegister>();
+    __ Li(tmp_reg, 0);
+  }
+
+  codegen->InvokeRuntime(kQuickIndexOf, invoke, invoke->GetDexPc(), slow_path);
+  CheckEntrypointTypes<kQuickIndexOf, int32_t, void*, uint32_t, uint32_t>();
+
+  if (slow_path != nullptr) {
+    __ Bind(slow_path->GetExitLabel());
+  }
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitStringIndexOf(HInvoke* invoke) {
+  LocationSummary* locations = new (allocator_) LocationSummary(
+      invoke, LocationSummary::kCallOnMainAndSlowPath, kIntrinsified);
+  // We have a hand-crafted assembly stub that follows the runtime calling convention. So it's
+  // best to align the inputs accordingly.
+  InvokeRuntimeCallingConvention calling_convention;
+  locations->SetInAt(0, Location::RegisterLocation(calling_convention.GetRegisterAt(0)));
+  locations->SetInAt(1, Location::RegisterLocation(calling_convention.GetRegisterAt(1)));
+  locations->SetOut(calling_convention.GetReturnLocation(DataType::Type::kInt32));
+
+  // Need to send start_index=0.
+  locations->AddTemp(Location::RegisterLocation(calling_convention.GetRegisterAt(2)));
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitStringIndexOf(HInvoke* invoke) {
+  GenerateVisitStringIndexOf(invoke, GetAssembler(), codegen_, /* start_at_zero= */ true);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitStringIndexOfAfter(HInvoke* invoke) {
+  LocationSummary* locations = new (allocator_) LocationSummary(
+      invoke, LocationSummary::kCallOnMainAndSlowPath, kIntrinsified);
+  // We have a hand-crafted assembly stub that follows the runtime calling convention. So it's
+  // best to align the inputs accordingly.
+  InvokeRuntimeCallingConvention calling_convention;
+  locations->SetInAt(0, Location::RegisterLocation(calling_convention.GetRegisterAt(0)));
+  locations->SetInAt(1, Location::RegisterLocation(calling_convention.GetRegisterAt(1)));
+  locations->SetInAt(2, Location::RegisterLocation(calling_convention.GetRegisterAt(2)));
+  locations->SetOut(calling_convention.GetReturnLocation(DataType::Type::kInt32));
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitStringIndexOfAfter(HInvoke* invoke) {
+  GenerateVisitStringIndexOf(invoke, GetAssembler(), codegen_, /* start_at_zero= */ false);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitStringNewStringFromBytes(HInvoke* invoke) {
+  LocationSummary* locations = new (allocator_) LocationSummary(
+      invoke, LocationSummary::kCallOnMainAndSlowPath, kIntrinsified);
+  InvokeRuntimeCallingConvention calling_convention;
+  locations->SetInAt(0, Location::RegisterLocation(calling_convention.GetRegisterAt(0)));
+  locations->SetInAt(1, Location::RegisterLocation(calling_convention.GetRegisterAt(1)));
+  locations->SetInAt(2, Location::RegisterLocation(calling_convention.GetRegisterAt(2)));
+  locations->SetInAt(3, Location::RegisterLocation(calling_convention.GetRegisterAt(3)));
+  locations->SetOut(calling_convention.GetReturnLocation(DataType::Type::kReference));
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitStringNewStringFromBytes(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+  XRegister byte_array = locations->InAt(0).AsRegister<XRegister>();
+
+  SlowPathCodeRISCV64* slow_path =
+      new (codegen_->GetScopedAllocator()) IntrinsicSlowPathRISCV64(invoke);
+  codegen_->AddSlowPath(slow_path);
+  __ Beqz(byte_array, slow_path->GetEntryLabel());
+
+  codegen_->InvokeRuntime(kQuickAllocStringFromBytes, invoke, invoke->GetDexPc(), slow_path);
+  CheckEntrypointTypes<kQuickAllocStringFromBytes, void*, void*, int32_t, int32_t, int32_t>();
+  __ Bind(slow_path->GetExitLabel());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitStringNewStringFromChars(HInvoke* invoke) {
+  LocationSummary* locations =
+      new (allocator_) LocationSummary(invoke, LocationSummary::kCallOnMainOnly, kIntrinsified);
+  InvokeRuntimeCallingConvention calling_convention;
+  locations->SetInAt(0, Location::RegisterLocation(calling_convention.GetRegisterAt(0)));
+  locations->SetInAt(1, Location::RegisterLocation(calling_convention.GetRegisterAt(1)));
+  locations->SetInAt(2, Location::RegisterLocation(calling_convention.GetRegisterAt(2)));
+  locations->SetOut(calling_convention.GetReturnLocation(DataType::Type::kReference));
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitStringNewStringFromChars(HInvoke* invoke) {
+  // No need to emit code checking whether `locations->InAt(2)` is a null
+  // pointer, as callers of the native method
+  //
+  //   java.lang.StringFactory.newStringFromChars(int offset, int charCount, char[] data)
+  //
+  // all include a null check on `data` before calling that method.
+  codegen_->InvokeRuntime(kQuickAllocStringFromChars, invoke, invoke->GetDexPc());
+  CheckEntrypointTypes<kQuickAllocStringFromChars, void*, int32_t, int32_t, void*>();
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitStringNewStringFromString(HInvoke* invoke) {
+  LocationSummary* locations = new (allocator_) LocationSummary(
+      invoke, LocationSummary::kCallOnMainAndSlowPath, kIntrinsified);
+  InvokeRuntimeCallingConvention calling_convention;
+  locations->SetInAt(0, Location::RegisterLocation(calling_convention.GetRegisterAt(0)));
+  locations->SetOut(calling_convention.GetReturnLocation(DataType::Type::kReference));
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitStringNewStringFromString(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+  XRegister string_to_copy = locations->InAt(0).AsRegister<XRegister>();
+
+  SlowPathCodeRISCV64* slow_path =
+      new (codegen_->GetScopedAllocator()) IntrinsicSlowPathRISCV64(invoke);
+  codegen_->AddSlowPath(slow_path);
+  __ Beqz(string_to_copy, slow_path->GetEntryLabel());
+
+  codegen_->InvokeRuntime(kQuickAllocStringFromString, invoke, invoke->GetDexPc(), slow_path);
+  CheckEntrypointTypes<kQuickAllocStringFromString, void*, void*>();
+  __ Bind(slow_path->GetExitLabel());
+}
+
+static void GenerateSet(CodeGeneratorRISCV64* codegen,
+                        std::memory_order order,
+                        Location value,
+                        XRegister rs1,
+                        int32_t offset,
+                        DataType::Type type) {
+  if (order == std::memory_order_seq_cst) {
+    codegen->GetInstructionVisitor()->StoreSeqCst(value, rs1, offset, type);
+  } else {
+    if (order == std::memory_order_release) {
+      codegen->GenerateMemoryBarrier(MemBarrierKind::kAnyStore);
+    } else {
+      DCHECK(order == std::memory_order_relaxed);
+    }
+    codegen->GetInstructionVisitor()->Store(value, rs1, offset, type);
+  }
+}
+
+std::pair<AqRl, AqRl> GetLrScAqRl(std::memory_order order) {
+  AqRl load_aqrl = AqRl::kNone;
+  AqRl store_aqrl = AqRl::kNone;
+  if (order == std::memory_order_acquire) {
+    load_aqrl = AqRl::kAcquire;
+  } else if (order == std::memory_order_release) {
+    store_aqrl = AqRl::kRelease;
+  } else if (order == std::memory_order_seq_cst) {
+    load_aqrl = AqRl::kAqRl;
+    store_aqrl = AqRl::kRelease;
+  } else {
+    DCHECK(order == std::memory_order_relaxed);
+  }
+  return {load_aqrl, store_aqrl};
+}
+
+AqRl GetAmoAqRl(std::memory_order order) {
+  AqRl amo_aqrl = AqRl::kNone;
+  if (order == std::memory_order_acquire) {
+    amo_aqrl = AqRl::kAcquire;
+  } else if (order == std::memory_order_release) {
+    amo_aqrl = AqRl::kRelease;
+  } else {
+    DCHECK(order == std::memory_order_seq_cst);
+    amo_aqrl = AqRl::kAqRl;
+  }
+  return amo_aqrl;
+}
+
+static void EmitLoadReserved(Riscv64Assembler* assembler,
+                             DataType::Type type,
+                             XRegister ptr,
+                             XRegister old_value,
+                             AqRl aqrl) {
+  switch (type) {
+    case DataType::Type::kInt32:
+      __ LrW(old_value, ptr, aqrl);
+      break;
+    case DataType::Type::kReference:
+      __ LrW(old_value, ptr, aqrl);
+      // TODO(riscv64): The `ZextW()` macro currently emits `SLLI+SRLI` which are from the
+      // base "I" instruction set. When the assembler is updated to use a single-instruction
+      // `ZextW()` macro, either the ADD.UW, or the C.ZEXT.W (16-bit encoding), we need to
+      // rewrite this to avoid these non-"I" instructions. We could, for example, sign-extend
+      // the reference and do the CAS as `Int32`.
+      __ ZextW(old_value, old_value);
+      break;
+    case DataType::Type::kInt64:
+      __ LrD(old_value, ptr, aqrl);
+      break;
+    default:
+      LOG(FATAL) << "Unexpected type: " << type;
+      UNREACHABLE();
+  }
+}
+
+static void EmitStoreConditional(Riscv64Assembler* assembler,
+                                 DataType::Type type,
+                                 XRegister ptr,
+                                 XRegister store_result,
+                                 XRegister to_store,
+                                 AqRl aqrl) {
+  switch (type) {
+    case DataType::Type::kInt32:
+    case DataType::Type::kReference:
+      __ ScW(store_result, to_store, ptr, aqrl);
+      break;
+    case DataType::Type::kInt64:
+      __ ScD(store_result, to_store, ptr, aqrl);
+      break;
+    default:
+      LOG(FATAL) << "Unexpected type: " << type;
+      UNREACHABLE();
+  }
+}
+
+static void GenerateCompareAndSet(Riscv64Assembler* assembler,
+                                  DataType::Type type,
+                                  std::memory_order order,
+                                  bool strong,
+                                  Riscv64Label* cmp_failure,
+                                  XRegister ptr,
+                                  XRegister new_value,
+                                  XRegister old_value,
+                                  XRegister mask,
+                                  XRegister masked,
+                                  XRegister store_result,
+                                  XRegister expected,
+                                  XRegister expected2 = kNoXRegister) {
+  DCHECK(!DataType::IsFloatingPointType(type));
+  DCHECK_GE(DataType::Size(type), 4u);
+
+  // The `expected2` is valid only for reference slow path and represents the unmarked old value
+  // from the main path attempt to emit CAS when the marked old value matched `expected`.
+  DCHECK_IMPLIES(expected2 != kNoXRegister, type == DataType::Type::kReference);
+
+  auto [load_aqrl, store_aqrl] = GetLrScAqRl(order);
+
+  // repeat: {
+  //   old_value = [ptr];  // Load exclusive.
+  //   cmp_value = old_value & mask;  // Extract relevant bits if applicable.
+  //   if (cmp_value != expected && cmp_value != expected2) goto cmp_failure;
+  //   store_result = failed([ptr] <- new_value);  // Store exclusive.
+  // }
+  // if (strong) {
+  //   if (store_result) goto repeat;  // Repeat until compare fails or store exclusive succeeds.
+  // } else {
+  //   store_result = store_result ^ 1;  // Report success as 1, failure as 0.
+  // }
+  //
+  // (If `mask` is not valid, `expected` is compared with `old_value` instead of `cmp_value`.)
+  // (If `expected2` is not valid, the `cmp_value == expected2` part is not emitted.)
+
+  // Note: We're using "bare" local branches to enforce that they shall not be expanded
+  // and the scrach register `TMP` shall not be clobbered if taken. Taking the branch to
+  // `cmp_failure` can theoretically clobber `TMP` (if outside the 1 MiB range).
+  Riscv64Label loop;
+  if (strong) {
+    __ Bind(&loop);
+  }
+  EmitLoadReserved(assembler, type, ptr, old_value, load_aqrl);
+  XRegister to_store = new_value;
+  {
+    ScopedLrScExtensionsRestriction slser(assembler);
+    if (mask != kNoXRegister) {
+      DCHECK_EQ(expected2, kNoXRegister);
+      DCHECK_NE(masked, kNoXRegister);
+      __ And(masked, old_value, mask);
+      __ Bne(masked, expected, cmp_failure);
+      // The `old_value` does not need to be preserved as the caller shall use `masked`
+      // to return the old value if needed.
+      to_store = old_value;
+      // TODO(riscv64): We could XOR the old and new value before the loop and use a single XOR here
+      // instead of the XOR+OR. (The `new_value` is either Zero or a temporary we can clobber.)
+      __ Xor(to_store, old_value, masked);
+      __ Or(to_store, to_store, new_value);
+    } else if (expected2 != kNoXRegister) {
+      Riscv64Label match2;
+      __ Beq(old_value, expected2, &match2, /*is_bare=*/ true);
+      __ Bne(old_value, expected, cmp_failure);
+      __ Bind(&match2);
+    } else {
+      __ Bne(old_value, expected, cmp_failure);
+    }
+  }
+  EmitStoreConditional(assembler, type, ptr, store_result, to_store, store_aqrl);
+  if (strong) {
+    __ Bnez(store_result, &loop, /*is_bare=*/ true);
+  } else {
+    // Flip the `store_result` register to indicate success by 1 and failure by 0.
+    __ Xori(store_result, store_result, 1);
+  }
+}
+
+class ReadBarrierCasSlowPathRISCV64 : public SlowPathCodeRISCV64 {
+ public:
+  ReadBarrierCasSlowPathRISCV64(HInvoke* invoke,
+                                std::memory_order order,
+                                bool strong,
+                                XRegister base,
+                                XRegister offset,
+                                XRegister expected,
+                                XRegister new_value,
+                                XRegister old_value,
+                                XRegister old_value_temp,
+                                XRegister store_result,
+                                bool update_old_value,
+                                CodeGeneratorRISCV64* riscv64_codegen)
+      : SlowPathCodeRISCV64(invoke),
+        order_(order),
+        strong_(strong),
+        base_(base),
+        offset_(offset),
+        expected_(expected),
+        new_value_(new_value),
+        old_value_(old_value),
+        old_value_temp_(old_value_temp),
+        store_result_(store_result),
+        update_old_value_(update_old_value),
+        mark_old_value_slow_path_(nullptr),
+        update_old_value_slow_path_(nullptr) {
+    // We need to add slow paths now, it is too late when emitting slow path code.
+    Location old_value_loc = Location::RegisterLocation(old_value);
+    Location old_value_temp_loc = Location::RegisterLocation(old_value_temp);
+    if (kUseBakerReadBarrier) {
+      mark_old_value_slow_path_ = riscv64_codegen->AddGcRootBakerBarrierBarrierSlowPath(
+          invoke, old_value_temp_loc, kBakerReadBarrierTemp);
+      if (update_old_value_) {
+        update_old_value_slow_path_ = riscv64_codegen->AddGcRootBakerBarrierBarrierSlowPath(
+            invoke, old_value_loc, kBakerReadBarrierTemp);
+      }
+    } else {
+      Location base_loc = Location::RegisterLocation(base);
+      Location index = Location::RegisterLocation(offset);
+      mark_old_value_slow_path_ = riscv64_codegen->AddReadBarrierSlowPath(
+          invoke, old_value_temp_loc, old_value_loc, base_loc, /*offset=*/ 0u, index);
+      if (update_old_value_) {
+        update_old_value_slow_path_ = riscv64_codegen->AddReadBarrierSlowPath(
+            invoke, old_value_loc, old_value_temp_loc, base_loc, /*offset=*/ 0u, index);
+      }
+    }
+  }
+
+  const char* GetDescription() const override { return "ReadBarrierCasSlowPathRISCV64"; }
+
+  // We return to a different label on success for a strong CAS that does not return old value.
+  Riscv64Label* GetSuccessExitLabel() {
+    return &success_exit_label_;
+  }
+
+  void EmitNativeCode(CodeGenerator* codegen) override {
+    CodeGeneratorRISCV64* riscv64_codegen = down_cast<CodeGeneratorRISCV64*>(codegen);
+    Riscv64Assembler* assembler = riscv64_codegen->GetAssembler();
+    __ Bind(GetEntryLabel());
+
+    // Mark the `old_value_` from the main path and compare with `expected_`.
+    DCHECK(mark_old_value_slow_path_ != nullptr);
+    if (kUseBakerReadBarrier) {
+      __ Mv(old_value_temp_, old_value_);
+      riscv64_codegen->EmitBakerReadBarierMarkingCheck(mark_old_value_slow_path_,
+                                                       Location::RegisterLocation(old_value_temp_),
+                                                       kBakerReadBarrierTemp);
+    } else {
+      __ J(mark_old_value_slow_path_->GetEntryLabel());
+      __ Bind(mark_old_value_slow_path_->GetExitLabel());
+    }
+    Riscv64Label move_marked_old_value;
+    __ Bne(old_value_temp_, expected_, update_old_value_ ? &move_marked_old_value : GetExitLabel());
+
+    // The `old_value` we have read did not match `expected` (which is always a to-space
+    // reference) but after the read barrier the marked to-space value matched, so the
+    // `old_value` must be a from-space reference to the same object. Do the same CAS loop
+    // as the main path but check for both `expected` and the unmarked old value
+    // representing the to-space and from-space references for the same object.
+
+    ScratchRegisterScope srs(assembler);
+    XRegister tmp_ptr = srs.AllocateXRegister();
+    XRegister store_result =
+        store_result_ != kNoXRegister ? store_result_ : srs.AllocateXRegister();
+
+    // Recalculate the `tmp_ptr` from main path potentially clobbered by the read barrier above
+    // or by an expanded conditional branch (clobbers `TMP` if beyond 1MiB).
+    __ Add(tmp_ptr, base_, offset_);
+
+    Riscv64Label mark_old_value;
+    GenerateCompareAndSet(riscv64_codegen->GetAssembler(),
+                          DataType::Type::kReference,
+                          order_,
+                          strong_,
+                          /*cmp_failure=*/ update_old_value_ ? &mark_old_value : GetExitLabel(),
+                          tmp_ptr,
+                          new_value_,
+                          /*old_value=*/ old_value_temp_,
+                          /*mask=*/ kNoXRegister,
+                          /*masked=*/ kNoXRegister,
+                          store_result,
+                          expected_,
+                          /*expected2=*/ old_value_);
+    if (update_old_value_) {
+      // To reach this point, the `old_value_temp_` must be either a from-space or a to-space
+      // reference of the `expected_` object. Update the `old_value_` to the to-space reference.
+      __ Mv(old_value_, expected_);
+    }
+    if (!update_old_value_ && strong_) {
+      // Load success value to the result register.
+      // We must jump to the instruction that loads the success value in the main path.
+      // Note that a SC failure in the CAS loop sets the `store_result` to 1, so the main
+      // path must not use the `store_result` as an indication of success.
+      __ J(GetSuccessExitLabel());
+    } else {
+      __ J(GetExitLabel());
+    }
+
+    if (update_old_value_) {
+      // TODO(riscv64): If we initially saw a from-space reference and then saw
+      // a different reference, can the latter be also a from-space reference?
+      // (Shouldn't every reference write store a to-space reference?)
+      DCHECK(update_old_value_slow_path_ != nullptr);
+      __ Bind(&mark_old_value);
+      if (kUseBakerReadBarrier) {
+        DCHECK(update_old_value_slow_path_ == nullptr);
+        __ Mv(old_value_, old_value_temp_);
+        riscv64_codegen->EmitBakerReadBarierMarkingCheck(update_old_value_slow_path_,
+                                                         Location::RegisterLocation(old_value_),
+                                                         kBakerReadBarrierTemp);
+      } else {
+        // Note: We could redirect the `failure` above directly to the entry label and bind
+        // the exit label in the main path, but the main path would need to access the
+        // `update_old_value_slow_path_`. To keep the code simple, keep the extra jumps.
+        __ J(update_old_value_slow_path_->GetEntryLabel());
+        __ Bind(update_old_value_slow_path_->GetExitLabel());
+      }
+      __ J(GetExitLabel());
+
+      __ Bind(&move_marked_old_value);
+      __ Mv(old_value_, old_value_temp_);
+      __ J(GetExitLabel());
+    }
+  }
+
+ private:
+  // Use RA as temp. It is clobbered in the slow path anyway.
+  static constexpr Location kBakerReadBarrierTemp = Location::RegisterLocation(RA);
+
+  std::memory_order order_;
+  bool strong_;
+  XRegister base_;
+  XRegister offset_;
+  XRegister expected_;
+  XRegister new_value_;
+  XRegister old_value_;
+  XRegister old_value_temp_;
+  XRegister store_result_;
+  bool update_old_value_;
+  SlowPathCodeRISCV64* mark_old_value_slow_path_;
+  SlowPathCodeRISCV64* update_old_value_slow_path_;
+  Riscv64Label success_exit_label_;
+};
+
+static void EmitBlt32(Riscv64Assembler* assembler,
+                      XRegister rs1,
+                      Location rs2,
+                      Riscv64Label* label,
+                      XRegister temp) {
+  if (rs2.IsConstant()) {
+    __ Li(temp, rs2.GetConstant()->AsIntConstant()->GetValue());
+    __ Blt(rs1, temp, label);
+  } else {
+    __ Blt(rs1, rs2.AsRegister<XRegister>(), label);
+  }
+}
+
+static void CheckSystemArrayCopyPosition(Riscv64Assembler* assembler,
+                                         XRegister array,
+                                         Location pos,
+                                         Location length,
+                                         SlowPathCodeRISCV64* slow_path,
+                                         XRegister temp1,
+                                         XRegister temp2,
+                                         bool length_is_array_length,
+                                         bool position_sign_checked) {
+  const int32_t length_offset = mirror::Array::LengthOffset().Int32Value();
+  if (pos.IsConstant()) {
+    int32_t pos_const = pos.GetConstant()->AsIntConstant()->GetValue();
+    DCHECK_GE(pos_const, 0);  // Checked in location builder.
+    if (pos_const == 0) {
+      if (!length_is_array_length) {
+        // Check that length(array) >= length.
+        __ Loadw(temp1, array, length_offset);
+        EmitBlt32(assembler, temp1, length, slow_path->GetEntryLabel(), temp2);
+      }
+    } else {
+      // Calculate length(array) - pos.
+      // Both operands are known to be non-negative `int32_t`, so the difference cannot underflow
+      // as `int32_t`. If the result is negative, the BLT below shall go to the slow path.
+      __ Loadw(temp1, array, length_offset);
+      __ AddConst32(temp1, temp1, -pos_const);
+
+      // Check that (length(array) - pos) >= length.
+      EmitBlt32(assembler, temp1, length, slow_path->GetEntryLabel(), temp2);
+    }
+  } else if (length_is_array_length) {
+    // The only way the copy can succeed is if pos is zero.
+    __ Bnez(pos.AsRegister<XRegister>(), slow_path->GetEntryLabel());
+  } else {
+    // Check that pos >= 0.
+    XRegister pos_reg = pos.AsRegister<XRegister>();
+    if (!position_sign_checked) {
+      __ Bltz(pos_reg, slow_path->GetEntryLabel());
+    }
+
+    // Calculate length(array) - pos.
+    // Both operands are known to be non-negative `int32_t`, so the difference cannot underflow
+    // as `int32_t`. If the result is negative, the BLT below shall go to the slow path.
+    __ Loadw(temp1, array, length_offset);
+    __ Sub(temp1, temp1, pos_reg);
+
+    // Check that (length(array) - pos) >= length.
+    EmitBlt32(assembler, temp1, length, slow_path->GetEntryLabel(), temp2);
+  }
+}
+
+static void GenArrayAddress(CodeGeneratorRISCV64* codegen,
+                            XRegister dest,
+                            XRegister base,
+                            Location pos,
+                            DataType::Type type,
+                            int32_t data_offset) {
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  if (pos.IsConstant()) {
+    int32_t constant = pos.GetConstant()->AsIntConstant()->GetValue();
+    __ AddConst64(dest, base, DataType::Size(type) * constant + data_offset);
+  } else {
+    codegen->GetInstructionVisitor()->ShNAdd(dest, pos.AsRegister<XRegister>(), base, type);
+    if (data_offset != 0) {
+      __ AddConst64(dest, dest, data_offset);
+    }
+  }
+}
+
+// Compute base source address, base destination address, and end
+// source address for System.arraycopy* intrinsics in `src_base`,
+// `dst_base` and `src_end` respectively.
+static void GenSystemArrayCopyAddresses(CodeGeneratorRISCV64* codegen,
+                                        DataType::Type type,
+                                        XRegister src,
+                                        Location src_pos,
+                                        XRegister dst,
+                                        Location dst_pos,
+                                        Location copy_length,
+                                        XRegister src_base,
+                                        XRegister dst_base,
+                                        XRegister src_end) {
+  // This routine is used by the SystemArrayCopy and the SystemArrayCopyChar intrinsics.
+  DCHECK(type == DataType::Type::kReference || type == DataType::Type::kUint16)
+      << "Unexpected element type: " << type;
+  const int32_t element_size = DataType::Size(type);
+  const uint32_t data_offset = mirror::Array::DataOffset(element_size).Uint32Value();
+
+  GenArrayAddress(codegen, src_base, src, src_pos, type, data_offset);
+  GenArrayAddress(codegen, dst_base, dst, dst_pos, type, data_offset);
+  GenArrayAddress(codegen, src_end, src_base, copy_length, type, /*data_offset=*/ 0);
+}
+
+static Location LocationForSystemArrayCopyInput(HInstruction* input) {
+  HIntConstant* const_input = input->AsIntConstantOrNull();
+  if (const_input != nullptr && IsInt<12>(const_input->GetValue())) {
+    return Location::ConstantLocation(const_input);
+  } else {
+    return Location::RequiresRegister();
+  }
+}
+
+// We can choose to use the native implementation there for longer copy lengths.
+static constexpr int32_t kSystemArrayCopyThreshold = 128;
+
+void IntrinsicLocationsBuilderRISCV64::VisitSystemArrayCopy(HInvoke* invoke) {
+  // The only read barrier implementation supporting the
+  // SystemArrayCopy intrinsic is the Baker-style read barriers.
+  if (codegen_->EmitNonBakerReadBarrier()) {
+    return;
+  }
+
+  size_t num_temps = codegen_->EmitBakerReadBarrier() ? 4u : 2u;
+  LocationSummary* locations = CodeGenerator::CreateSystemArrayCopyLocationSummary(
+      invoke, kSystemArrayCopyThreshold, num_temps);
+  if (locations != nullptr) {
+    // We request position and length as constants only for small integral values.
+    locations->SetInAt(1, LocationForSystemArrayCopyInput(invoke->InputAt(1)));
+    locations->SetInAt(3, LocationForSystemArrayCopyInput(invoke->InputAt(3)));
+    locations->SetInAt(4, LocationForSystemArrayCopyInput(invoke->InputAt(4)));
+  }
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitSystemArrayCopy(HInvoke* invoke) {
+  // The only read barrier implementation supporting the
+  // SystemArrayCopy intrinsic is the Baker-style read barriers.
+  DCHECK_IMPLIES(codegen_->EmitReadBarrier(), kUseBakerReadBarrier);
+
+  Riscv64Assembler* assembler = GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+
+  uint32_t class_offset = mirror::Object::ClassOffset().Int32Value();
+  uint32_t super_offset = mirror::Class::SuperClassOffset().Int32Value();
+  uint32_t component_offset = mirror::Class::ComponentTypeOffset().Int32Value();
+  uint32_t primitive_offset = mirror::Class::PrimitiveTypeOffset().Int32Value();
+  uint32_t monitor_offset = mirror::Object::MonitorOffset().Int32Value();
+
+  XRegister src = locations->InAt(0).AsRegister<XRegister>();
+  Location src_pos = locations->InAt(1);
+  XRegister dest = locations->InAt(2).AsRegister<XRegister>();
+  Location dest_pos = locations->InAt(3);
+  Location length = locations->InAt(4);
+  XRegister temp1 = locations->GetTemp(0).AsRegister<XRegister>();
+  XRegister temp2 = locations->GetTemp(1).AsRegister<XRegister>();
+
+  SlowPathCodeRISCV64* intrinsic_slow_path =
+      new (codegen_->GetScopedAllocator()) IntrinsicSlowPathRISCV64(invoke);
+  codegen_->AddSlowPath(intrinsic_slow_path);
+
+  Riscv64Label conditions_on_positions_validated;
+  SystemArrayCopyOptimizations optimizations(invoke);
+
+  // If source and destination are the same, we go to slow path if we need to do forward copying.
+  // We do not need to do this check if the source and destination positions are the same.
+  if (!optimizations.GetSourcePositionIsDestinationPosition()) {
+    if (src_pos.IsConstant()) {
+      int32_t src_pos_constant = src_pos.GetConstant()->AsIntConstant()->GetValue();
+      if (dest_pos.IsConstant()) {
+        int32_t dest_pos_constant = dest_pos.GetConstant()->AsIntConstant()->GetValue();
+        if (optimizations.GetDestinationIsSource()) {
+          // Checked when building locations.
+          DCHECK_GE(src_pos_constant, dest_pos_constant);
+        } else if (src_pos_constant < dest_pos_constant) {
+          __ Beq(src, dest, intrinsic_slow_path->GetEntryLabel());
+        }
+      } else {
+        if (!optimizations.GetDestinationIsSource()) {
+          __ Bne(src, dest, &conditions_on_positions_validated);
+        }
+        __ Li(temp1, src_pos_constant);
+        __ Bgt(dest_pos.AsRegister<XRegister>(), temp1, intrinsic_slow_path->GetEntryLabel());
+      }
+    } else {
+      if (!optimizations.GetDestinationIsSource()) {
+        __ Bne(src, dest, &conditions_on_positions_validated);
+      }
+      XRegister src_pos_reg = src_pos.AsRegister<XRegister>();
+      EmitBlt32(assembler, src_pos_reg, dest_pos, intrinsic_slow_path->GetEntryLabel(), temp2);
+    }
+  }
+
+  __ Bind(&conditions_on_positions_validated);
+
+  if (!optimizations.GetSourceIsNotNull()) {
+    // Bail out if the source is null.
+    __ Beqz(src, intrinsic_slow_path->GetEntryLabel());
+  }
+
+  if (!optimizations.GetDestinationIsNotNull() && !optimizations.GetDestinationIsSource()) {
+    // Bail out if the destination is null.
+    __ Beqz(dest, intrinsic_slow_path->GetEntryLabel());
+  }
+
+  // We have already checked in the LocationsBuilder for the constant case.
+  if (!length.IsConstant()) {
+    // Merge the following two comparisons into one:
+    //   If the length is negative, bail out (delegate to libcore's native implementation).
+    //   If the length >= 128 then (currently) prefer native implementation.
+    __ Li(temp1, kSystemArrayCopyThreshold);
+    __ Bgeu(length.AsRegister<XRegister>(), temp1, intrinsic_slow_path->GetEntryLabel());
+  }
+  // Validity checks: source.
+  CheckSystemArrayCopyPosition(assembler,
+                               src,
+                               src_pos,
+                               length,
+                               intrinsic_slow_path,
+                               temp1,
+                               temp2,
+                               optimizations.GetCountIsSourceLength(),
+                               /*position_sign_checked=*/ false);
+
+  // Validity checks: dest.
+  bool dest_position_sign_checked = optimizations.GetSourcePositionIsDestinationPosition();
+  CheckSystemArrayCopyPosition(assembler,
+                               dest,
+                               dest_pos,
+                               length,
+                               intrinsic_slow_path,
+                               temp1,
+                               temp2,
+                               optimizations.GetCountIsDestinationLength(),
+                               dest_position_sign_checked);
+
+  auto check_non_primitive_array_class = [&](XRegister klass, XRegister temp) {
+    // No read barrier is needed for reading a chain of constant references for comparing
+    // with null, or for reading a constant primitive value, see `ReadBarrierOption`.
+    // /* HeapReference<Class> */ temp = klass->component_type_
+    __ Loadwu(temp, klass, component_offset);
+    codegen_->MaybeUnpoisonHeapReference(temp);
+    // Check that the component type is not null.
+    __ Beqz(temp, intrinsic_slow_path->GetEntryLabel());
+    // Check that the component type is not a primitive.
+    // /* uint16_t */ temp = static_cast<uint16>(klass->primitive_type_);
+    __ Loadhu(temp, temp, primitive_offset);
+    static_assert(Primitive::kPrimNot == 0, "Expected 0 for kPrimNot");
+    __ Bnez(temp, intrinsic_slow_path->GetEntryLabel());
+  };
+
+  if (!optimizations.GetDoesNotNeedTypeCheck()) {
+    // Check whether all elements of the source array are assignable to the component
+    // type of the destination array. We do two checks: the classes are the same,
+    // or the destination is Object[]. If none of these checks succeed, we go to the
+    // slow path.
+
+    if (codegen_->EmitBakerReadBarrier()) {
+      XRegister temp3 = locations->GetTemp(2).AsRegister<XRegister>();
+      // /* HeapReference<Class> */ temp1 = dest->klass_
+      codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
+                                                      Location::RegisterLocation(temp1),
+                                                      dest,
+                                                      class_offset,
+                                                      Location::RegisterLocation(temp3),
+                                                      /* needs_null_check= */ false);
+      // /* HeapReference<Class> */ temp2 = src->klass_
+      codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
+                                                      Location::RegisterLocation(temp2),
+                                                      src,
+                                                      class_offset,
+                                                      Location::RegisterLocation(temp3),
+                                                      /* needs_null_check= */ false);
+    } else {
+      // /* HeapReference<Class> */ temp1 = dest->klass_
+      __ Loadwu(temp1, dest, class_offset);
+      codegen_->MaybeUnpoisonHeapReference(temp1);
+      // /* HeapReference<Class> */ temp2 = src->klass_
+      __ Loadwu(temp2, src, class_offset);
+      codegen_->MaybeUnpoisonHeapReference(temp2);
+    }
+
+    if (optimizations.GetDestinationIsTypedObjectArray()) {
+      DCHECK(optimizations.GetDestinationIsNonPrimitiveArray());
+      Riscv64Label do_copy;
+      // For class match, we can skip the source type check regardless of the optimization flag.
+      __ Beq(temp1, temp2, &do_copy);
+      // No read barrier is needed for reading a chain of constant references
+      // for comparing with null, see `ReadBarrierOption`.
+      // /* HeapReference<Class> */ temp1 = temp1->component_type_
+      __ Loadwu(temp1, temp1, component_offset);
+      codegen_->MaybeUnpoisonHeapReference(temp1);
+      // /* HeapReference<Class> */ temp1 = temp1->super_class_
+      __ Loadwu(temp1, temp1, super_offset);
+      // No need to unpoison the result, we're comparing against null.
+      __ Bnez(temp1, intrinsic_slow_path->GetEntryLabel());
+      // Bail out if the source is not a non primitive array.
+      if (!optimizations.GetSourceIsNonPrimitiveArray()) {
+        check_non_primitive_array_class(temp2, temp2);
+      }
+      __ Bind(&do_copy);
+    } else {
+      DCHECK(!optimizations.GetDestinationIsTypedObjectArray());
+      // For class match, we can skip the array type check completely if at least one of source
+      // and destination is known to be a non primitive array, otherwise one check is enough.
+      __ Bne(temp1, temp2, intrinsic_slow_path->GetEntryLabel());
+      if (!optimizations.GetDestinationIsNonPrimitiveArray() &&
+          !optimizations.GetSourceIsNonPrimitiveArray()) {
+        check_non_primitive_array_class(temp2, temp2);
+      }
+    }
+  } else if (!optimizations.GetSourceIsNonPrimitiveArray()) {
+    DCHECK(optimizations.GetDestinationIsNonPrimitiveArray());
+    // Bail out if the source is not a non primitive array.
+    // No read barrier is needed for reading a chain of constant references for comparing
+    // with null, or for reading a constant primitive value, see `ReadBarrierOption`.
+    // /* HeapReference<Class> */ temp2 = src->klass_
+    __ Loadwu(temp2, src, class_offset);
+    codegen_->MaybeUnpoisonHeapReference(temp2);
+    check_non_primitive_array_class(temp2, temp2);
+  }
+
+  if (length.IsConstant() && length.GetConstant()->AsIntConstant()->GetValue() == 0) {
+    // Null constant length: not need to emit the loop code at all.
+  } else {
+    Riscv64Label skip_copy_and_write_barrier;
+    if (length.IsRegister()) {
+      // Don't enter the copy loop if the length is null.
+      __ Beqz(length.AsRegister<XRegister>(), &skip_copy_and_write_barrier);
+    }
+
+    {
+      // We use a block to end the scratch scope before the write barrier, thus
+      // freeing the scratch registers so they can be used in `MarkGCCard`.
+      ScratchRegisterScope srs(assembler);
+      bool emit_rb = codegen_->EmitBakerReadBarrier();
+      XRegister temp3 =
+          emit_rb ? locations->GetTemp(2).AsRegister<XRegister>() : srs.AllocateXRegister();
+
+      XRegister src_curr_addr = temp1;
+      XRegister dst_curr_addr = temp2;
+      XRegister src_stop_addr = temp3;
+      const DataType::Type type = DataType::Type::kReference;
+      const int32_t element_size = DataType::Size(type);
+
+      XRegister tmp = kNoXRegister;
+      SlowPathCodeRISCV64* read_barrier_slow_path = nullptr;
+      if (emit_rb) {
+        // TODO: Also convert this intrinsic to the IsGcMarking strategy?
+
+        // SystemArrayCopy implementation for Baker read barriers (see
+        // also CodeGeneratorRISCV64::GenerateReferenceLoadWithBakerReadBarrier):
+        //
+        //   uint32_t rb_state = Lockword(src->monitor_).ReadBarrierState();
+        //   lfence;  // Load fence or artificial data dependency to prevent load-load reordering
+        //   bool is_gray = (rb_state == ReadBarrier::GrayState());
+        //   if (is_gray) {
+        //     // Slow-path copy.
+        //     do {
+        //       *dest_ptr++ = MaybePoison(ReadBarrier::Mark(MaybeUnpoison(*src_ptr++)));
+        //     } while (src_ptr != end_ptr)
+        //   } else {
+        //     // Fast-path copy.
+        //     do {
+        //       *dest_ptr++ = *src_ptr++;
+        //     } while (src_ptr != end_ptr)
+        //   }
+
+        // /* uint32_t */ monitor = src->monitor_
+        tmp = locations->GetTemp(3).AsRegister<XRegister>();
+        __ Loadwu(tmp, src, monitor_offset);
+        // /* LockWord */ lock_word = LockWord(monitor)
+        static_assert(sizeof(LockWord) == sizeof(int32_t),
+                      "art::LockWord and int32_t have different sizes.");
+
+        // Shift the RB state bit to the sign bit while also clearing the low 32 bits
+        // for the fake dependency below.
+        static_assert(LockWord::kReadBarrierStateShift < 31);
+        __ Slli(tmp, tmp, 63 - LockWord::kReadBarrierStateShift);
+
+        // Introduce a dependency on the lock_word including rb_state, to prevent load-load
+        // reordering, and without using a memory barrier (which would be more expensive).
+        // `src` is unchanged by this operation (since Adduw adds low 32 bits
+        // which are zero after left shift), but its value now depends on `tmp`.
+        __ AddUw(src, tmp, src);
+
+        // Slow path used to copy array when `src` is gray.
+        read_barrier_slow_path = new (codegen_->GetScopedAllocator())
+            ReadBarrierSystemArrayCopySlowPathRISCV64(invoke, Location::RegisterLocation(tmp));
+        codegen_->AddSlowPath(read_barrier_slow_path);
+      }
+
+      // Compute base source address, base destination address, and end source address for
+      // System.arraycopy* intrinsics in `src_base`, `dst_base` and `src_end` respectively.
+      // Note that `src_curr_addr` is computed from from `src` (and `src_pos`) here, and
+      // thus honors the artificial dependency of `src` on `tmp` for read barriers.
+      GenSystemArrayCopyAddresses(codegen_,
+                                  type,
+                                  src,
+                                  src_pos,
+                                  dest,
+                                  dest_pos,
+                                  length,
+                                  src_curr_addr,
+                                  dst_curr_addr,
+                                  src_stop_addr);
+
+      if (emit_rb) {
+        // Given the numeric representation, it's enough to check the low bit of the RB state.
+        static_assert(ReadBarrier::NonGrayState() == 0, "Expecting non-gray to have value 0");
+        static_assert(ReadBarrier::GrayState() == 1, "Expecting gray to have value 1");
+        DCHECK_NE(tmp, kNoXRegister);
+        __ Bltz(tmp, read_barrier_slow_path->GetEntryLabel());
+      } else {
+        // After allocating the last scrach register, we cannot use macro load/store instructions
+        // such as `Loadwu()` and need to use raw instructions. However, all offsets below are 0.
+        DCHECK_EQ(tmp, kNoXRegister);
+        tmp = srs.AllocateXRegister();
+      }
+
+      // Iterate over the arrays and do a raw copy of the objects. We don't need to
+      // poison/unpoison.
+      Riscv64Label loop;
+      __ Bind(&loop);
+      __ Lwu(tmp, src_curr_addr, 0);
+      __ Sw(tmp, dst_curr_addr, 0);
+      __ Addi(src_curr_addr, src_curr_addr, element_size);
+      __ Addi(dst_curr_addr, dst_curr_addr, element_size);
+      // Bare: `TMP` shall not be clobbered.
+      __ Bne(src_curr_addr, src_stop_addr, &loop, /*is_bare=*/ true);
+
+      if (emit_rb) {
+        DCHECK(read_barrier_slow_path != nullptr);
+        __ Bind(read_barrier_slow_path->GetExitLabel());
+      }
+    }
+
+    // We only need one card marking on the destination array.
+    codegen_->MarkGCCard(dest);
+
+    __ Bind(&skip_copy_and_write_barrier);
+  }
+
+  __ Bind(intrinsic_slow_path->GetExitLabel());
+}
+
+enum class GetAndUpdateOp {
+  kSet,
+  kAdd,
+  kAnd,
+  kOr,
+  kXor
+};
+
+// Generate a GetAndUpdate operation.
+//
+// Only 32-bit and 64-bit atomics are currently supported, therefore smaller types need
+// special handling. The caller emits code to prepare aligned `ptr` and adjusted `arg`
+// and extract the needed bits from `old_value`. For bitwise operations, no extra
+// handling is needed here. For `GetAndUpdateOp::kSet` and `GetAndUpdateOp::kAdd` we
+// also use a special LR/SC sequence that uses a `mask` to update only the desired bits.
+// Note: The `mask` must contain the bits to keep for `GetAndUpdateOp::kSet` and
+// the bits to replace for `GetAndUpdateOp::kAdd`.
+static void GenerateGetAndUpdate(CodeGeneratorRISCV64* codegen,
+                                 GetAndUpdateOp get_and_update_op,
+                                 DataType::Type type,
+                                 std::memory_order order,
+                                 XRegister ptr,
+                                 XRegister arg,
+                                 XRegister old_value,
+                                 XRegister mask,
+                                 XRegister temp) {
+  DCHECK_EQ(mask != kNoXRegister, temp != kNoXRegister);
+  DCHECK_IMPLIES(mask != kNoXRegister, type == DataType::Type::kInt32);
+  DCHECK_IMPLIES(
+      mask != kNoXRegister,
+      (get_and_update_op == GetAndUpdateOp::kSet) || (get_and_update_op == GetAndUpdateOp::kAdd));
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  AqRl amo_aqrl = GetAmoAqRl(order);
+  switch (get_and_update_op) {
+    case GetAndUpdateOp::kSet:
+      if (type == DataType::Type::kInt64) {
+        __ AmoSwapD(old_value, arg, ptr, amo_aqrl);
+      } else if (mask == kNoXRegister) {
+        DCHECK_EQ(type, DataType::Type::kInt32);
+        __ AmoSwapW(old_value, arg, ptr, amo_aqrl);
+      } else {
+        DCHECK_EQ(type, DataType::Type::kInt32);
+        DCHECK_NE(temp, kNoXRegister);
+        auto [load_aqrl, store_aqrl] = GetLrScAqRl(order);
+        Riscv64Label retry;
+        __ Bind(&retry);
+        __ LrW(old_value, ptr, load_aqrl);
+        {
+          ScopedLrScExtensionsRestriction slser(assembler);
+          __ And(temp, old_value, mask);
+          __ Or(temp, temp, arg);
+        }
+        __ ScW(temp, temp, ptr, store_aqrl);
+        __ Bnez(temp, &retry, /*is_bare=*/ true);  // Bare: `TMP` shall not be clobbered.
+      }
+      break;
+    case GetAndUpdateOp::kAdd:
+      if (type == DataType::Type::kInt64) {
+        __ AmoAddD(old_value, arg, ptr, amo_aqrl);
+      } else if (mask == kNoXRegister) {
+        DCHECK_EQ(type, DataType::Type::kInt32);
+         __ AmoAddW(old_value, arg, ptr, amo_aqrl);
+      } else {
+        DCHECK_EQ(type, DataType::Type::kInt32);
+        DCHECK_NE(temp, kNoXRegister);
+        auto [load_aqrl, store_aqrl] = GetLrScAqRl(order);
+        Riscv64Label retry;
+        __ Bind(&retry);
+        __ LrW(old_value, ptr, load_aqrl);
+        {
+          ScopedLrScExtensionsRestriction slser(assembler);
+          __ Add(temp, old_value, arg);
+          // We use `(A ^ B) ^ A == B` and with the masking `((A ^ B) & mask) ^ A`, the result
+          // contains bits from `B` for bits specified in `mask` and bits from `A` elsewhere.
+          // Note: These instructions directly depend on each other, so it's not necessarily the
+          // fastest approach but for `(A ^ ~mask) | (B & mask)` we would need an extra register
+          // for `~mask` because ANDN is not in the "I" instruction set as required for a LR/SC
+          // sequence.
+          __ Xor(temp, temp, old_value);
+          __ And(temp, temp, mask);
+          __ Xor(temp, temp, old_value);
+        }
+        __ ScW(temp, temp, ptr, store_aqrl);
+        __ Bnez(temp, &retry, /*is_bare=*/ true);  // Bare: `TMP` shall not be clobbered.
+      }
+      break;
+    case GetAndUpdateOp::kAnd:
+      if (type == DataType::Type::kInt64) {
+        __ AmoAndD(old_value, arg, ptr, amo_aqrl);
+      } else {
+        DCHECK_EQ(type, DataType::Type::kInt32);
+        __ AmoAndW(old_value, arg, ptr, amo_aqrl);
+      }
+      break;
+    case GetAndUpdateOp::kOr:
+      if (type == DataType::Type::kInt64) {
+        __ AmoOrD(old_value, arg, ptr, amo_aqrl);
+      } else {
+        DCHECK_EQ(type, DataType::Type::kInt32);
+        __ AmoOrW(old_value, arg, ptr, amo_aqrl);
+      }
+      break;
+    case GetAndUpdateOp::kXor:
+      if (type == DataType::Type::kInt64) {
+        __ AmoXorD(old_value, arg, ptr, amo_aqrl);
+      } else {
+        DCHECK_EQ(type, DataType::Type::kInt32);
+        __ AmoXorW(old_value, arg, ptr, amo_aqrl);
+      }
+      break;
+  }
+}
+
+static void CreateUnsafeGetLocations(ArenaAllocator* allocator,
+                                     HInvoke* invoke,
+                                     CodeGeneratorRISCV64* codegen) {
+  bool can_call = codegen->EmitReadBarrier() && IsUnsafeGetReference(invoke);
+  LocationSummary* locations = new (allocator) LocationSummary(
+      invoke,
+      can_call ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall,
+      kIntrinsified);
+  if (can_call && kUseBakerReadBarrier) {
+    locations->SetCustomSlowPathCallerSaves(RegisterSet::Empty());  // No caller-save registers.
+  }
+  locations->SetInAt(0, Location::NoLocation());        // Unused receiver.
+  locations->SetInAt(1, Location::RequiresRegister());
+  locations->SetInAt(2, Location::RequiresRegister());
+  locations->SetOut(Location::RequiresRegister(),
+                    (can_call ? Location::kOutputOverlap : Location::kNoOutputOverlap));
+}
+
+static void GenUnsafeGet(HInvoke* invoke,
+                         CodeGeneratorRISCV64* codegen,
+                         std::memory_order order,
+                         DataType::Type type) {
+  DCHECK((type == DataType::Type::kInt8) ||
+         (type == DataType::Type::kInt32) ||
+         (type == DataType::Type::kInt64) ||
+         (type == DataType::Type::kReference));
+  LocationSummary* locations = invoke->GetLocations();
+  Location object_loc = locations->InAt(1);
+  XRegister object = object_loc.AsRegister<XRegister>();  // Object pointer.
+  Location offset_loc = locations->InAt(2);
+  XRegister offset = offset_loc.AsRegister<XRegister>();  // Long offset.
+  Location out_loc = locations->Out();
+  XRegister out = out_loc.AsRegister<XRegister>();
+
+  bool seq_cst_barrier = (order == std::memory_order_seq_cst);
+  bool acquire_barrier = seq_cst_barrier || (order == std::memory_order_acquire);
+  DCHECK(acquire_barrier || order == std::memory_order_relaxed);
+
+  if (seq_cst_barrier) {
+    codegen->GenerateMemoryBarrier(MemBarrierKind::kAnyAny);
+  }
+
+  if (type == DataType::Type::kReference && codegen->EmitBakerReadBarrier()) {
+    // JdkUnsafeGetReference/JdkUnsafeGetReferenceVolatile with Baker's read barrier case.
+    // TODO(riscv64): Revisit when we add checking if the holder is black.
+    Location temp = Location::NoLocation();
+    codegen->GenerateReferenceLoadWithBakerReadBarrier(invoke,
+                                                       out_loc,
+                                                       object,
+                                                       /*offset=*/ 0,
+                                                       /*index=*/ offset_loc,
+                                                       temp,
+                                                       /*needs_null_check=*/ false);
+  } else {
+    // Other cases.
+    Riscv64Assembler* assembler = codegen->GetAssembler();
+    __ Add(out, object, offset);
+    codegen->GetInstructionVisitor()->Load(out_loc, out, /*offset=*/ 0, type);
+
+    if (type == DataType::Type::kReference) {
+      codegen->MaybeGenerateReadBarrierSlow(
+          invoke, out_loc, out_loc, object_loc, /*offset=*/ 0u, /*index=*/ offset_loc);
+    }
+  }
+
+  if (acquire_barrier) {
+    codegen->GenerateMemoryBarrier(MemBarrierKind::kLoadAny);
+  }
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafeGet(HInvoke* invoke) {
+  VisitJdkUnsafeGet(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafeGet(HInvoke* invoke) {
+  VisitJdkUnsafeGet(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafeGetVolatile(HInvoke* invoke) {
+  VisitJdkUnsafeGetVolatile(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafeGetVolatile(HInvoke* invoke) {
+  VisitJdkUnsafeGetVolatile(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafeGetObject(HInvoke* invoke) {
+  VisitJdkUnsafeGetReference(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafeGetObject(HInvoke* invoke) {
+  VisitJdkUnsafeGetReference(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafeGetObjectVolatile(HInvoke* invoke) {
+  VisitJdkUnsafeGetReferenceVolatile(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafeGetObjectVolatile(HInvoke* invoke) {
+  VisitJdkUnsafeGetReferenceVolatile(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafeGetLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetLong(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafeGetLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetLong(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafeGetLongVolatile(HInvoke* invoke) {
+  VisitJdkUnsafeGetLongVolatile(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafeGetLongVolatile(HInvoke* invoke) {
+  VisitJdkUnsafeGetLongVolatile(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafeGetByte(HInvoke* invoke) {
+  VisitJdkUnsafeGetByte(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafeGetByte(HInvoke* invoke) {
+  VisitJdkUnsafeGetByte(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeGet(HInvoke* invoke) {
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeGet(HInvoke* invoke) {
+  GenUnsafeGet(invoke, codegen_, std::memory_order_relaxed, DataType::Type::kInt32);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeGetAcquire(HInvoke* invoke) {
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeGetAcquire(HInvoke* invoke) {
+  GenUnsafeGet(invoke, codegen_, std::memory_order_acquire, DataType::Type::kInt32);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeGetVolatile(HInvoke* invoke) {
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeGetVolatile(HInvoke* invoke) {
+  GenUnsafeGet(invoke, codegen_, std::memory_order_seq_cst, DataType::Type::kInt32);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeGetReference(HInvoke* invoke) {
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeGetReference(HInvoke* invoke) {
+  GenUnsafeGet(invoke, codegen_, std::memory_order_relaxed, DataType::Type::kReference);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeGetReferenceAcquire(HInvoke* invoke) {
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeGetReferenceAcquire(HInvoke* invoke) {
+  GenUnsafeGet(invoke, codegen_, std::memory_order_acquire, DataType::Type::kReference);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeGetReferenceVolatile(HInvoke* invoke) {
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeGetReferenceVolatile(HInvoke* invoke) {
+  GenUnsafeGet(invoke, codegen_, std::memory_order_seq_cst, DataType::Type::kReference);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeGetLong(HInvoke* invoke) {
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeGetLong(HInvoke* invoke) {
+  GenUnsafeGet(invoke, codegen_, std::memory_order_relaxed, DataType::Type::kInt64);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeGetLongAcquire(HInvoke* invoke) {
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeGetLongAcquire(HInvoke* invoke) {
+  GenUnsafeGet(invoke, codegen_, std::memory_order_acquire, DataType::Type::kInt64);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeGetLongVolatile(HInvoke* invoke) {
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeGetLongVolatile(HInvoke* invoke) {
+  GenUnsafeGet(invoke, codegen_, std::memory_order_seq_cst, DataType::Type::kInt64);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeGetByte(HInvoke* invoke) {
+  CreateUnsafeGetLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeGetByte(HInvoke* invoke) {
+  GenUnsafeGet(invoke, codegen_, std::memory_order_relaxed, DataType::Type::kInt8);
+}
+
+static void CreateUnsafePutLocations(ArenaAllocator* allocator, HInvoke* invoke) {
+  LocationSummary* locations =
+      new (allocator) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
+  locations->SetInAt(0, Location::NoLocation());        // Unused receiver.
+  locations->SetInAt(1, Location::RequiresRegister());
+  locations->SetInAt(2, Location::RequiresRegister());
+  locations->SetInAt(3, Location::RequiresRegister());
+  if (kPoisonHeapReferences && invoke->InputAt(3)->GetType() == DataType::Type::kReference) {
+    locations->AddTemp(Location::RequiresRegister());
+  }
+}
+
+static void GenUnsafePut(HInvoke* invoke,
+                         CodeGeneratorRISCV64* codegen,
+                         std::memory_order order,
+                         DataType::Type type) {
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+  XRegister base = locations->InAt(1).AsRegister<XRegister>();    // Object pointer.
+  XRegister offset = locations->InAt(2).AsRegister<XRegister>();  // Long offset.
+  Location value = locations->InAt(3);
+
+  {
+    // We use a block to end the scratch scope before the write barrier, thus
+    // freeing the temporary registers so they can be used in `MarkGCCard()`.
+    ScratchRegisterScope srs(assembler);
+    // Heap poisoning needs two scratch registers in `Store()`.
+    XRegister address = (kPoisonHeapReferences && type == DataType::Type::kReference)
+        ? locations->GetTemp(0).AsRegister<XRegister>()
+        : srs.AllocateXRegister();
+    __ Add(address, base, offset);
+    GenerateSet(codegen, order, value, address, /*offset=*/ 0, type);
+  }
+
+  if (type == DataType::Type::kReference) {
+    bool value_can_be_null = true;  // TODO: Worth finding out this information?
+    codegen->MaybeMarkGCCard(base, value.AsRegister<XRegister>(), value_can_be_null);
+  }
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafePut(HInvoke* invoke) {
+  VisitJdkUnsafePut(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafePut(HInvoke* invoke) {
+  VisitJdkUnsafePut(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafePutOrdered(HInvoke* invoke) {
+  VisitJdkUnsafePutOrdered(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafePutOrdered(HInvoke* invoke) {
+  VisitJdkUnsafePutOrdered(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafePutVolatile(HInvoke* invoke) {
+  VisitJdkUnsafePutVolatile(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafePutVolatile(HInvoke* invoke) {
+  VisitJdkUnsafePutVolatile(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafePutObject(HInvoke* invoke) {
+  VisitJdkUnsafePutReference(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafePutObject(HInvoke* invoke) {
+  VisitJdkUnsafePutReference(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafePutObjectOrdered(HInvoke* invoke) {
+  VisitJdkUnsafePutObjectOrdered(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafePutObjectOrdered(HInvoke* invoke) {
+  VisitJdkUnsafePutObjectOrdered(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafePutObjectVolatile(HInvoke* invoke) {
+  VisitJdkUnsafePutReferenceVolatile(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafePutObjectVolatile(HInvoke* invoke) {
+  VisitJdkUnsafePutReferenceVolatile(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafePutLong(HInvoke* invoke) {
+  VisitJdkUnsafePutLong(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafePutLong(HInvoke* invoke) {
+  VisitJdkUnsafePutLong(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafePutLongOrdered(HInvoke* invoke) {
+  VisitJdkUnsafePutLongOrdered(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafePutLongOrdered(HInvoke* invoke) {
+  VisitJdkUnsafePutLongOrdered(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafePutLongVolatile(HInvoke* invoke) {
+  VisitJdkUnsafePutLongVolatile(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafePutLongVolatile(HInvoke* invoke) {
+  VisitJdkUnsafePutLongVolatile(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafePutByte(HInvoke* invoke) {
+  VisitJdkUnsafePutByte(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafePutByte(HInvoke* invoke) {
+  VisitJdkUnsafePutByte(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafePut(HInvoke* invoke) {
+  CreateUnsafePutLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafePut(HInvoke* invoke) {
+  GenUnsafePut(invoke, codegen_, std::memory_order_relaxed, DataType::Type::kInt32);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafePutOrdered(HInvoke* invoke) {
+  CreateUnsafePutLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafePutOrdered(HInvoke* invoke) {
+  GenUnsafePut(invoke, codegen_, std::memory_order_release, DataType::Type::kInt32);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafePutRelease(HInvoke* invoke) {
+  CreateUnsafePutLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafePutRelease(HInvoke* invoke) {
+  GenUnsafePut(invoke, codegen_, std::memory_order_release, DataType::Type::kInt32);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafePutVolatile(HInvoke* invoke) {
+  CreateUnsafePutLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafePutVolatile(HInvoke* invoke) {
+  GenUnsafePut(invoke, codegen_, std::memory_order_seq_cst, DataType::Type::kInt32);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafePutReference(HInvoke* invoke) {
+  CreateUnsafePutLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafePutReference(HInvoke* invoke) {
+  GenUnsafePut(invoke, codegen_, std::memory_order_relaxed, DataType::Type::kReference);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafePutObjectOrdered(HInvoke* invoke) {
+  CreateUnsafePutLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafePutObjectOrdered(HInvoke* invoke) {
+  GenUnsafePut(invoke, codegen_, std::memory_order_release, DataType::Type::kReference);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafePutReferenceRelease(HInvoke* invoke) {
+  CreateUnsafePutLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafePutReferenceRelease(HInvoke* invoke) {
+  GenUnsafePut(invoke, codegen_, std::memory_order_release, DataType::Type::kReference);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafePutReferenceVolatile(HInvoke* invoke) {
+  CreateUnsafePutLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafePutReferenceVolatile(HInvoke* invoke) {
+  GenUnsafePut(invoke, codegen_, std::memory_order_seq_cst, DataType::Type::kReference);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafePutLong(HInvoke* invoke) {
+  CreateUnsafePutLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafePutLong(HInvoke* invoke) {
+  GenUnsafePut(invoke, codegen_, std::memory_order_relaxed, DataType::Type::kInt64);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafePutLongOrdered(HInvoke* invoke) {
+  CreateUnsafePutLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafePutLongOrdered(HInvoke* invoke) {
+  GenUnsafePut(invoke, codegen_, std::memory_order_release, DataType::Type::kInt64);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafePutLongRelease(HInvoke* invoke) {
+  CreateUnsafePutLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafePutLongRelease(HInvoke* invoke) {
+  GenUnsafePut(invoke, codegen_, std::memory_order_release, DataType::Type::kInt64);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafePutLongVolatile(HInvoke* invoke) {
+  CreateUnsafePutLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafePutLongVolatile(HInvoke* invoke) {
+  GenUnsafePut(invoke, codegen_, std::memory_order_seq_cst, DataType::Type::kInt64);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafePutByte(HInvoke* invoke) {
+  CreateUnsafePutLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafePutByte(HInvoke* invoke) {
+  GenUnsafePut(invoke, codegen_, std::memory_order_relaxed, DataType::Type::kInt8);
+}
+
+static void CreateUnsafeCASLocations(ArenaAllocator* allocator,
+                                     HInvoke* invoke,
+                                     CodeGeneratorRISCV64* codegen) {
+  const bool can_call = codegen->EmitReadBarrier() && IsUnsafeCASReference(invoke);
+  LocationSummary* locations = new (allocator) LocationSummary(
+      invoke,
+      can_call ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall,
+      kIntrinsified);
+  if (can_call && kUseBakerReadBarrier) {
+    locations->SetCustomSlowPathCallerSaves(RegisterSet::Empty());  // No caller-save registers.
+  }
+  locations->SetInAt(0, Location::NoLocation());        // Unused receiver.
+  locations->SetInAt(1, Location::RequiresRegister());
+  locations->SetInAt(2, Location::RequiresRegister());
+  locations->SetInAt(3, Location::RequiresRegister());
+  locations->SetInAt(4, Location::RequiresRegister());
+
+  locations->SetOut(Location::RequiresRegister());
+}
+
+static void GenUnsafeCas(HInvoke* invoke, CodeGeneratorRISCV64* codegen, DataType::Type type) {
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+  XRegister out = locations->Out().AsRegister<XRegister>();            // Boolean result.
+  XRegister object = locations->InAt(1).AsRegister<XRegister>();       // Object pointer.
+  XRegister offset = locations->InAt(2).AsRegister<XRegister>();       // Long offset.
+  XRegister expected = locations->InAt(3).AsRegister<XRegister>();     // Expected.
+  XRegister new_value = locations->InAt(4).AsRegister<XRegister>();    // New value.
+
+  // This needs to be before the temp registers, as MarkGCCard also uses scratch registers.
+  if (type == DataType::Type::kReference) {
+    // Mark card for object assuming new value is stored.
+    bool new_value_can_be_null = true;  // TODO: Worth finding out this information?
+    codegen->MaybeMarkGCCard(object, new_value, new_value_can_be_null);
+  }
+
+  ScratchRegisterScope srs(assembler);
+  XRegister tmp_ptr = srs.AllocateXRegister();                         // Pointer to actual memory.
+  XRegister old_value;                                                 // Value in memory.
+
+  Riscv64Label exit_loop_label;
+  Riscv64Label* exit_loop = &exit_loop_label;
+  Riscv64Label* cmp_failure = &exit_loop_label;
+
+  ReadBarrierCasSlowPathRISCV64* slow_path = nullptr;
+  if (type == DataType::Type::kReference && codegen->EmitReadBarrier()) {
+    // We need to store the `old_value` in a non-scratch register to make sure
+    // the read barrier in the slow path does not clobber it.
+    old_value = locations->GetTemp(0).AsRegister<XRegister>();  // The old value from main path.
+    // The `old_value_temp` is used first for marking the `old_value` and then for the unmarked
+    // reloaded old value for subsequent CAS in the slow path. We make this a scratch register
+    // as we do have marking entrypoints on riscv64 even for scratch registers.
+    XRegister old_value_temp = srs.AllocateXRegister();
+    slow_path = new (codegen->GetScopedAllocator()) ReadBarrierCasSlowPathRISCV64(
+        invoke,
+        std::memory_order_seq_cst,
+        /*strong=*/ true,
+        object,
+        offset,
+        expected,
+        new_value,
+        old_value,
+        old_value_temp,
+        /*store_result=*/ old_value_temp,  // Let the SC result clobber the reloaded old_value.
+        /*update_old_value=*/ false,
+        codegen);
+    codegen->AddSlowPath(slow_path);
+    exit_loop = slow_path->GetExitLabel();
+    cmp_failure = slow_path->GetEntryLabel();
+  } else {
+    old_value = srs.AllocateXRegister();
+  }
+
+  __ Add(tmp_ptr, object, offset);
+
+  // Pre-populate the result register with failure.
+  __ Li(out, 0);
+
+  GenerateCompareAndSet(assembler,
+                        type,
+                        std::memory_order_seq_cst,
+                        /*strong=*/ true,
+                        cmp_failure,
+                        tmp_ptr,
+                        new_value,
+                        old_value,
+                        /*mask=*/ kNoXRegister,
+                        /*masked=*/ kNoXRegister,
+                        /*store_result=*/ old_value,  // Let the SC result clobber the `old_value`.
+                        expected);
+
+  DCHECK_EQ(slow_path != nullptr, type == DataType::Type::kReference && codegen->EmitReadBarrier());
+  if (slow_path != nullptr) {
+    __ Bind(slow_path->GetSuccessExitLabel());
+  }
+
+  // Indicate success if we successfully execute the SC.
+  __ Li(out, 1);
+
+  __ Bind(exit_loop);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafeCASInt(HInvoke* invoke) {
+  VisitJdkUnsafeCASInt(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafeCASInt(HInvoke* invoke) {
+  VisitJdkUnsafeCASInt(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafeCASLong(HInvoke* invoke) {
+  VisitJdkUnsafeCASLong(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafeCASLong(HInvoke* invoke) {
+  VisitJdkUnsafeCASLong(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafeCASObject(HInvoke* invoke) {
+  VisitJdkUnsafeCASObject(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafeCASObject(HInvoke* invoke) {
+  VisitJdkUnsafeCASObject(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeCASInt(HInvoke* invoke) {
+  // `jdk.internal.misc.Unsafe.compareAndSwapInt` has compare-and-set semantics (see javadoc).
+  VisitJdkUnsafeCompareAndSetInt(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeCASInt(HInvoke* invoke) {
+  // `jdk.internal.misc.Unsafe.compareAndSwapInt` has compare-and-set semantics (see javadoc).
+  VisitJdkUnsafeCompareAndSetInt(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeCASLong(HInvoke* invoke) {
+  // `jdk.internal.misc.Unsafe.compareAndSwapLong` has compare-and-set semantics (see javadoc).
+  VisitJdkUnsafeCompareAndSetLong(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeCASLong(HInvoke* invoke) {
+  // `jdk.internal.misc.Unsafe.compareAndSwapLong` has compare-and-set semantics (see javadoc).
+  VisitJdkUnsafeCompareAndSetLong(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeCASObject(HInvoke* invoke) {
+  // `jdk.internal.misc.Unsafe.compareAndSwapObject` has compare-and-set semantics (see javadoc).
+  VisitJdkUnsafeCompareAndSetReference(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeCASObject(HInvoke* invoke) {
+  // `jdk.internal.misc.Unsafe.compareAndSwapObject` has compare-and-set semantics (see javadoc).
+  VisitJdkUnsafeCompareAndSetReference(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeCompareAndSetInt(HInvoke* invoke) {
+  CreateUnsafeCASLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeCompareAndSetInt(HInvoke* invoke) {
+  GenUnsafeCas(invoke, codegen_, DataType::Type::kInt32);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeCompareAndSetLong(HInvoke* invoke) {
+  CreateUnsafeCASLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeCompareAndSetLong(HInvoke* invoke) {
+  GenUnsafeCas(invoke, codegen_, DataType::Type::kInt64);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeCompareAndSetReference(HInvoke* invoke) {
+  // The only supported read barrier implementation is the Baker-style read barriers.
+  if (codegen_->EmitNonBakerReadBarrier()) {
+    return;
+  }
+
+  // TODO(riscv64): Fix this intrinsic for heap poisoning configuration.
+  if (kPoisonHeapReferences) {
+    return;
+  }
+
+  CreateUnsafeCASLocations(allocator_, invoke, codegen_);
+  if (codegen_->EmitReadBarrier()) {
+    DCHECK(kUseBakerReadBarrier);
+    // We need one non-scratch temporary register for read barrier.
+    LocationSummary* locations = invoke->GetLocations();
+    locations->AddTemp(Location::RequiresRegister());
+  }
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeCompareAndSetReference(HInvoke* invoke) {
+  GenUnsafeCas(invoke, codegen_, DataType::Type::kReference);
+}
+
+static void CreateUnsafeGetAndUpdateLocations(ArenaAllocator* allocator,
+                                              HInvoke* invoke,
+                                              CodeGeneratorRISCV64* codegen) {
+  const bool can_call = codegen->EmitReadBarrier() && IsUnsafeGetAndSetReference(invoke);
+  LocationSummary* locations = new (allocator) LocationSummary(
+      invoke,
+      can_call ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall,
+      kIntrinsified);
+  if (can_call && kUseBakerReadBarrier) {
+    locations->SetCustomSlowPathCallerSaves(RegisterSet::Empty());  // No caller-save registers.
+  }
+  locations->SetInAt(0, Location::NoLocation());        // Unused receiver.
+  locations->SetInAt(1, Location::RequiresRegister());
+  locations->SetInAt(2, Location::RequiresRegister());
+  locations->SetInAt(3, Location::RequiresRegister());
+
+  locations->SetOut(Location::RequiresRegister(), Location::kOutputOverlap);
+}
+
+static void GenUnsafeGetAndUpdate(HInvoke* invoke,
+                                  DataType::Type type,
+                                  CodeGeneratorRISCV64* codegen,
+                                  GetAndUpdateOp get_and_update_op) {
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+  Location out_loc = locations->Out();
+  XRegister out = out_loc.AsRegister<XRegister>();                    // Result.
+  XRegister base = locations->InAt(1).AsRegister<XRegister>();        // Object pointer.
+  XRegister offset = locations->InAt(2).AsRegister<XRegister>();      // Long offset.
+  XRegister arg = locations->InAt(3).AsRegister<XRegister>();         // New value or addend.
+
+  // This needs to be before the temp registers, as MarkGCCard also uses scratch registers.
+  if (type == DataType::Type::kReference) {
+    DCHECK(get_and_update_op == GetAndUpdateOp::kSet);
+    // Mark card for object as a new value shall be stored.
+    bool new_value_can_be_null = true;  // TODO: Worth finding out this information?
+    codegen->MaybeMarkGCCard(base, /*value=*/arg, new_value_can_be_null);
+  }
+
+  ScratchRegisterScope srs(assembler);
+  XRegister tmp_ptr = srs.AllocateXRegister();                        // Pointer to actual memory.
+  __ Add(tmp_ptr, base, offset);
+  GenerateGetAndUpdate(codegen,
+                       get_and_update_op,
+                       (type == DataType::Type::kReference) ? DataType::Type::kInt32 : type,
+                       std::memory_order_seq_cst,
+                       tmp_ptr,
+                       arg,
+                       /*old_value=*/ out,
+                       /*mask=*/ kNoXRegister,
+                       /*temp=*/ kNoXRegister);
+
+  if (type == DataType::Type::kReference) {
+    __ ZextW(out, out);
+    if (codegen->EmitReadBarrier()) {
+      DCHECK(get_and_update_op == GetAndUpdateOp::kSet);
+      if (kUseBakerReadBarrier) {
+        // Use RA as temp. It is clobbered in the slow path anyway.
+        static constexpr Location kBakerReadBarrierTemp = Location::RegisterLocation(RA);
+        SlowPathCodeRISCV64* rb_slow_path =
+            codegen->AddGcRootBakerBarrierBarrierSlowPath(invoke, out_loc, kBakerReadBarrierTemp);
+        codegen->EmitBakerReadBarierMarkingCheck(rb_slow_path, out_loc, kBakerReadBarrierTemp);
+      } else {
+        codegen->GenerateReadBarrierSlow(
+            invoke,
+            out_loc,
+            out_loc,
+            Location::RegisterLocation(base),
+            /*offset=*/ 0u,
+            /*index=*/ Location::RegisterLocation(offset));
+      }
+    }
+  }
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafeGetAndAddInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddInt(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafeGetAndAddInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddInt(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafeGetAndAddLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddLong(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafeGetAndAddLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddLong(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafeGetAndSetInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetInt(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafeGetAndSetInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetInt(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafeGetAndSetLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetLong(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafeGetAndSetLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetLong(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitUnsafeGetAndSetObject(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetReference(invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitUnsafeGetAndSetObject(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetReference(invoke);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeGetAndAddInt(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeGetAndAddInt(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kInt32, codegen_, GetAndUpdateOp::kAdd);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeGetAndAddLong(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeGetAndAddLong(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kInt64, codegen_, GetAndUpdateOp::kAdd);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeGetAndSetInt(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeGetAndSetInt(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kInt32, codegen_, GetAndUpdateOp::kSet);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeGetAndSetLong(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeGetAndSetLong(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kInt64, codegen_, GetAndUpdateOp::kSet);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitJdkUnsafeGetAndSetReference(HInvoke* invoke) {
+  // TODO(riscv64): Fix this intrinsic for heap poisoning configuration.
+  if (kPoisonHeapReferences) {
+    return;
+  }
+
+  CreateUnsafeGetAndUpdateLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitJdkUnsafeGetAndSetReference(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kReference, codegen_, GetAndUpdateOp::kSet);
+}
+
+class VarHandleSlowPathRISCV64 : public IntrinsicSlowPathRISCV64 {
+ public:
+  VarHandleSlowPathRISCV64(HInvoke* invoke, std::memory_order order)
+      : IntrinsicSlowPathRISCV64(invoke),
+        order_(order),
+        return_success_(false),
+        strong_(false),
+        get_and_update_op_(GetAndUpdateOp::kAdd) {
+  }
+
+  Riscv64Label* GetByteArrayViewCheckLabel() {
+    return &byte_array_view_check_label_;
+  }
+
+  Riscv64Label* GetNativeByteOrderLabel() {
+    return &native_byte_order_label_;
+  }
+
+  void SetCompareAndSetOrExchangeArgs(bool return_success, bool strong) {
+    if (return_success) {
+      DCHECK(GetAccessModeTemplate() == mirror::VarHandle::AccessModeTemplate::kCompareAndSet);
+    } else {
+      DCHECK(GetAccessModeTemplate() == mirror::VarHandle::AccessModeTemplate::kCompareAndExchange);
+    }
+    return_success_ = return_success;
+    strong_ = strong;
+  }
+
+  void SetGetAndUpdateOp(GetAndUpdateOp get_and_update_op) {
+    DCHECK(GetAccessModeTemplate() == mirror::VarHandle::AccessModeTemplate::kGetAndUpdate);
+    get_and_update_op_ = get_and_update_op;
+  }
+
+  void EmitNativeCode(CodeGenerator* codegen_in) override {
+    if (GetByteArrayViewCheckLabel()->IsLinked()) {
+      EmitByteArrayViewCode(codegen_in);
+    }
+    IntrinsicSlowPathRISCV64::EmitNativeCode(codegen_in);
+  }
+
+ private:
+  HInvoke* GetInvoke() const {
+    return GetInstruction()->AsInvoke();
+  }
+
+  mirror::VarHandle::AccessModeTemplate GetAccessModeTemplate() const {
+    return mirror::VarHandle::GetAccessModeTemplateByIntrinsic(GetInvoke()->GetIntrinsic());
+  }
+
+  void EmitByteArrayViewCode(CodeGenerator* codegen_in);
+
+  Riscv64Label byte_array_view_check_label_;
+  Riscv64Label native_byte_order_label_;
+  // Shared parameter for all VarHandle intrinsics.
+  std::memory_order order_;
+  // Extra arguments for GenerateVarHandleCompareAndSetOrExchange().
+  bool return_success_;
+  bool strong_;
+  // Extra argument for GenerateVarHandleGetAndUpdate().
+  GetAndUpdateOp get_and_update_op_;
+};
+
+// Generate subtype check without read barriers.
+static void GenerateSubTypeObjectCheckNoReadBarrier(CodeGeneratorRISCV64* codegen,
+                                                    SlowPathCodeRISCV64* slow_path,
+                                                    XRegister object,
+                                                    XRegister type,
+                                                    bool object_can_be_null = true) {
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+
+  const MemberOffset class_offset = mirror::Object::ClassOffset();
+  const MemberOffset super_class_offset = mirror::Class::SuperClassOffset();
+
+  Riscv64Label success;
+  if (object_can_be_null) {
+    __ Beqz(object, &success);
+  }
+
+  ScratchRegisterScope srs(assembler);
+  XRegister temp = srs.AllocateXRegister();
+
+  // Note: The `type` can be `TMP`. We're using "bare" local branches to enforce that they shall
+  // not be expanded and the scrach register `TMP` shall not be clobbered if taken. Taking the
+  // branch to the slow path can theoretically clobber `TMP` (if outside the 1 MiB range).
+  __ Loadwu(temp, object, class_offset.Int32Value());
+  codegen->MaybeUnpoisonHeapReference(temp);
+  Riscv64Label loop;
+  __ Bind(&loop);
+  __ Beq(type, temp, &success, /*is_bare=*/ true);
+  // We may not have another scratch register for `Loadwu()`. Use `Lwu()` directly.
+  DCHECK(IsInt<12>(super_class_offset.Int32Value()));
+  __ Lwu(temp, temp, super_class_offset.Int32Value());
+  codegen->MaybeUnpoisonHeapReference(temp);
+  __ Beqz(temp, slow_path->GetEntryLabel());
+  __ J(&loop, /*is_bare=*/ true);
+  __ Bind(&success);
+}
+
+// Check access mode and the primitive type from VarHandle.varType.
+// Check reference arguments against the VarHandle.varType; for references this is a subclass
+// check without read barrier, so it can have false negatives which we handle in the slow path.
+static void GenerateVarHandleAccessModeAndVarTypeChecks(HInvoke* invoke,
+                                                        CodeGeneratorRISCV64* codegen,
+                                                        SlowPathCodeRISCV64* slow_path,
+                                                        DataType::Type type) {
+  mirror::VarHandle::AccessMode access_mode =
+      mirror::VarHandle::GetAccessModeByIntrinsic(invoke->GetIntrinsic());
+  Primitive::Type primitive_type = DataTypeToPrimitive(type);
+
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+  XRegister varhandle = locations->InAt(0).AsRegister<XRegister>();
+
+  const MemberOffset var_type_offset = mirror::VarHandle::VarTypeOffset();
+  const MemberOffset access_mode_bit_mask_offset = mirror::VarHandle::AccessModesBitMaskOffset();
+  const MemberOffset primitive_type_offset = mirror::Class::PrimitiveTypeOffset();
+
+  ScratchRegisterScope srs(assembler);
+  XRegister temp = srs.AllocateXRegister();
+  XRegister temp2 = srs.AllocateXRegister();
+
+  // Check that the operation is permitted.
+  __ Loadw(temp, varhandle, access_mode_bit_mask_offset.Int32Value());
+  DCHECK_LT(enum_cast<uint32_t>(access_mode), 31u);  // We cannot avoid the shift below.
+  __ Slliw(temp, temp, 31 - enum_cast<uint32_t>(access_mode));  // Shift tested bit to sign bit.
+  __ Bgez(temp, slow_path->GetEntryLabel());  // If not permitted, go to slow path.
+
+  // For primitive types, we do not need a read barrier when loading a reference only for loading
+  // constant field through the reference. For reference types, we deliberately avoid the read
+  // barrier, letting the slow path handle the false negatives.
+  __ Loadwu(temp, varhandle, var_type_offset.Int32Value());
+  codegen->MaybeUnpoisonHeapReference(temp);
+
+  // Check the varType.primitiveType field against the type we're trying to use.
+  __ Loadhu(temp2, temp, primitive_type_offset.Int32Value());
+  if (primitive_type == Primitive::kPrimNot) {
+    static_assert(Primitive::kPrimNot == 0);
+    __ Bnez(temp2, slow_path->GetEntryLabel());
+  } else {
+    __ Li(temp, enum_cast<int32_t>(primitive_type));  // `temp` can be clobbered.
+    __ Bne(temp2, temp, slow_path->GetEntryLabel());
+  }
+
+  srs.FreeXRegister(temp2);
+
+  if (type == DataType::Type::kReference) {
+    // Check reference arguments against the varType.
+    // False negatives due to varType being an interface or array type
+    // or due to the missing read barrier are handled by the slow path.
+    size_t expected_coordinates_count = GetExpectedVarHandleCoordinatesCount(invoke);
+    uint32_t arguments_start = /* VarHandle object */ 1u + expected_coordinates_count;
+    uint32_t number_of_arguments = invoke->GetNumberOfArguments();
+    for (size_t arg_index = arguments_start; arg_index != number_of_arguments; ++arg_index) {
+      HInstruction* arg = invoke->InputAt(arg_index);
+      DCHECK_EQ(arg->GetType(), DataType::Type::kReference);
+      if (!arg->IsNullConstant()) {
+        XRegister arg_reg = locations->InAt(arg_index).AsRegister<XRegister>();
+        GenerateSubTypeObjectCheckNoReadBarrier(codegen, slow_path, arg_reg, temp);
+      }
+    }
+  }
+}
+
+static void GenerateVarHandleStaticFieldCheck(HInvoke* invoke,
+                                              CodeGeneratorRISCV64* codegen,
+                                              SlowPathCodeRISCV64* slow_path) {
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  XRegister varhandle = invoke->GetLocations()->InAt(0).AsRegister<XRegister>();
+
+  const MemberOffset coordinate_type0_offset = mirror::VarHandle::CoordinateType0Offset();
+
+  ScratchRegisterScope srs(assembler);
+  XRegister temp = srs.AllocateXRegister();
+
+  // Check that the VarHandle references a static field by checking that coordinateType0 == null.
+  // Do not emit read barrier (or unpoison the reference) for comparing to null.
+  __ Loadwu(temp, varhandle, coordinate_type0_offset.Int32Value());
+  __ Bnez(temp, slow_path->GetEntryLabel());
+}
+
+static void GenerateVarHandleInstanceFieldChecks(HInvoke* invoke,
+                                                 CodeGeneratorRISCV64* codegen,
+                                                 SlowPathCodeRISCV64* slow_path) {
+  VarHandleOptimizations optimizations(invoke);
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+  XRegister varhandle = locations->InAt(0).AsRegister<XRegister>();
+  XRegister object = locations->InAt(1).AsRegister<XRegister>();
+
+  const MemberOffset coordinate_type0_offset = mirror::VarHandle::CoordinateType0Offset();
+  const MemberOffset coordinate_type1_offset = mirror::VarHandle::CoordinateType1Offset();
+
+  // Null-check the object.
+  if (!optimizations.GetSkipObjectNullCheck()) {
+    __ Beqz(object, slow_path->GetEntryLabel());
+  }
+
+  if (!optimizations.GetUseKnownBootImageVarHandle()) {
+    ScratchRegisterScope srs(assembler);
+    XRegister temp = srs.AllocateXRegister();
+
+    // Check that the VarHandle references an instance field by checking that
+    // coordinateType1 == null. coordinateType0 should not be null, but this is handled by the
+    // type compatibility check with the source object's type, which will fail for null.
+    __ Loadwu(temp, varhandle, coordinate_type1_offset.Int32Value());
+    // No need for read barrier or unpoisoning of coordinateType1 for comparison with null.
+    __ Bnez(temp, slow_path->GetEntryLabel());
+
+    // Check that the object has the correct type.
+    // We deliberately avoid the read barrier, letting the slow path handle the false negatives.
+    __ Loadwu(temp, varhandle, coordinate_type0_offset.Int32Value());
+    codegen->MaybeUnpoisonHeapReference(temp);
+    GenerateSubTypeObjectCheckNoReadBarrier(
+        codegen, slow_path, object, temp, /*object_can_be_null=*/ false);
+  }
+}
+
+static void GenerateVarHandleArrayChecks(HInvoke* invoke,
+                                         CodeGeneratorRISCV64* codegen,
+                                         VarHandleSlowPathRISCV64* slow_path) {
+  VarHandleOptimizations optimizations(invoke);
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+  XRegister varhandle = locations->InAt(0).AsRegister<XRegister>();
+  XRegister object = locations->InAt(1).AsRegister<XRegister>();
+  XRegister index = locations->InAt(2).AsRegister<XRegister>();
+  DataType::Type value_type =
+      GetVarHandleExpectedValueType(invoke, /*expected_coordinates_count=*/ 2u);
+  Primitive::Type primitive_type = DataTypeToPrimitive(value_type);
+
+  const MemberOffset coordinate_type0_offset = mirror::VarHandle::CoordinateType0Offset();
+  const MemberOffset coordinate_type1_offset = mirror::VarHandle::CoordinateType1Offset();
+  const MemberOffset component_type_offset = mirror::Class::ComponentTypeOffset();
+  const MemberOffset primitive_type_offset = mirror::Class::PrimitiveTypeOffset();
+  const MemberOffset class_offset = mirror::Object::ClassOffset();
+  const MemberOffset array_length_offset = mirror::Array::LengthOffset();
+
+  // Null-check the object.
+  if (!optimizations.GetSkipObjectNullCheck()) {
+    __ Beqz(object, slow_path->GetEntryLabel());
+  }
+
+  ScratchRegisterScope srs(assembler);
+  XRegister temp = srs.AllocateXRegister();
+  XRegister temp2 = srs.AllocateXRegister();
+
+  // Check that the VarHandle references an array, byte array view or ByteBuffer by checking
+  // that coordinateType1 != null. If that's true, coordinateType1 shall be int.class and
+  // coordinateType0 shall not be null but we do not explicitly verify that.
+  __ Loadwu(temp, varhandle, coordinate_type1_offset.Int32Value());
+  // No need for read barrier or unpoisoning of coordinateType1 for comparison with null.
+  __ Beqz(temp, slow_path->GetEntryLabel());
+
+  // Check object class against componentType0.
+  //
+  // This is an exact check and we defer other cases to the runtime. This includes
+  // conversion to array of superclass references, which is valid but subsequently
+  // requires all update operations to check that the value can indeed be stored.
+  // We do not want to perform such extra checks in the intrinsified code.
+  //
+  // We do this check without read barrier, so there can be false negatives which we
+  // defer to the slow path. There shall be no false negatives for array classes in the
+  // boot image (including Object[] and primitive arrays) because they are non-movable.
+  __ Loadwu(temp, varhandle, coordinate_type0_offset.Int32Value());
+  __ Loadwu(temp2, object, class_offset.Int32Value());
+  __ Bne(temp, temp2, slow_path->GetEntryLabel());
+
+  // Check that the coordinateType0 is an array type. We do not need a read barrier
+  // for loading constant reference fields (or chains of them) for comparison with null,
+  // nor for finally loading a constant primitive field (primitive type) below.
+  codegen->MaybeUnpoisonHeapReference(temp);
+  __ Loadwu(temp2, temp, component_type_offset.Int32Value());
+  codegen->MaybeUnpoisonHeapReference(temp2);
+  __ Beqz(temp2, slow_path->GetEntryLabel());
+
+  // Check that the array component type matches the primitive type.
+  __ Loadhu(temp, temp2, primitive_type_offset.Int32Value());
+  if (primitive_type == Primitive::kPrimNot) {
+    static_assert(Primitive::kPrimNot == 0);
+    __ Bnez(temp, slow_path->GetEntryLabel());
+  } else {
+    // With the exception of `kPrimNot` (handled above), `kPrimByte` and `kPrimBoolean`,
+    // we shall check for a byte array view in the slow path.
+    // The check requires the ByteArrayViewVarHandle.class to be in the boot image,
+    // so we cannot emit that if we're JITting without boot image.
+    bool boot_image_available =
+        codegen->GetCompilerOptions().IsBootImage() ||
+        !Runtime::Current()->GetHeap()->GetBootImageSpaces().empty();
+    bool can_be_view = (DataType::Size(value_type) != 1u) && boot_image_available;
+    Riscv64Label* slow_path_label =
+        can_be_view ? slow_path->GetByteArrayViewCheckLabel() : slow_path->GetEntryLabel();
+    __ Li(temp2, enum_cast<int32_t>(primitive_type));
+    __ Bne(temp, temp2, slow_path_label);
+  }
+
+  // Check for array index out of bounds.
+  __ Loadw(temp, object, array_length_offset.Int32Value());
+  __ Bgeu(index, temp, slow_path->GetEntryLabel());
+}
+
+static void GenerateVarHandleCoordinateChecks(HInvoke* invoke,
+                                              CodeGeneratorRISCV64* codegen,
+                                              VarHandleSlowPathRISCV64* slow_path) {
+  size_t expected_coordinates_count = GetExpectedVarHandleCoordinatesCount(invoke);
+  if (expected_coordinates_count == 0u) {
+    GenerateVarHandleStaticFieldCheck(invoke, codegen, slow_path);
+  } else if (expected_coordinates_count == 1u) {
+    GenerateVarHandleInstanceFieldChecks(invoke, codegen, slow_path);
+  } else {
+    DCHECK_EQ(expected_coordinates_count, 2u);
+    GenerateVarHandleArrayChecks(invoke, codegen, slow_path);
+  }
+}
+
+static VarHandleSlowPathRISCV64* GenerateVarHandleChecks(HInvoke* invoke,
+                                                         CodeGeneratorRISCV64* codegen,
+                                                         std::memory_order order,
+                                                         DataType::Type type) {
+  size_t expected_coordinates_count = GetExpectedVarHandleCoordinatesCount(invoke);
+  VarHandleOptimizations optimizations(invoke);
+  if (optimizations.GetUseKnownBootImageVarHandle()) {
+    DCHECK_NE(expected_coordinates_count, 2u);
+    if (expected_coordinates_count == 0u || optimizations.GetSkipObjectNullCheck()) {
+      return nullptr;
+    }
+  }
+
+  VarHandleSlowPathRISCV64* slow_path =
+      new (codegen->GetScopedAllocator()) VarHandleSlowPathRISCV64(invoke, order);
+  codegen->AddSlowPath(slow_path);
+
+  if (!optimizations.GetUseKnownBootImageVarHandle()) {
+    GenerateVarHandleAccessModeAndVarTypeChecks(invoke, codegen, slow_path, type);
+  }
+  GenerateVarHandleCoordinateChecks(invoke, codegen, slow_path);
+
+  return slow_path;
+}
+
+struct VarHandleTarget {
+  XRegister object;  // The object holding the value to operate on.
+  XRegister offset;  // The offset of the value to operate on.
+};
+
+static VarHandleTarget GetVarHandleTarget(HInvoke* invoke) {
+  size_t expected_coordinates_count = GetExpectedVarHandleCoordinatesCount(invoke);
+  LocationSummary* locations = invoke->GetLocations();
+
+  VarHandleTarget target;
+  // The temporary allocated for loading the offset.
+  target.offset = locations->GetTemp(0u).AsRegister<XRegister>();
+  // The reference to the object that holds the value to operate on.
+  target.object = (expected_coordinates_count == 0u)
+      ? locations->GetTemp(1u).AsRegister<XRegister>()
+      : locations->InAt(1).AsRegister<XRegister>();
+  return target;
+}
+
+static void GenerateVarHandleTarget(HInvoke* invoke,
+                                    const VarHandleTarget& target,
+                                    CodeGeneratorRISCV64* codegen) {
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+  XRegister varhandle = locations->InAt(0).AsRegister<XRegister>();
+  size_t expected_coordinates_count = GetExpectedVarHandleCoordinatesCount(invoke);
+
+  if (expected_coordinates_count <= 1u) {
+    if (VarHandleOptimizations(invoke).GetUseKnownBootImageVarHandle()) {
+      ScopedObjectAccess soa(Thread::Current());
+      ArtField* target_field = GetBootImageVarHandleField(invoke);
+      if (expected_coordinates_count == 0u) {
+        ObjPtr<mirror::Class> declaring_class = target_field->GetDeclaringClass();
+        if (Runtime::Current()->GetHeap()->ObjectIsInBootImageSpace(declaring_class)) {
+          uint32_t boot_image_offset = CodeGenerator::GetBootImageOffset(declaring_class);
+          codegen->LoadBootImageRelRoEntry(target.object, boot_image_offset);
+        } else {
+          codegen->LoadTypeForBootImageIntrinsic(
+              target.object,
+              TypeReference(&declaring_class->GetDexFile(), declaring_class->GetDexTypeIndex()));
+        }
+      }
+      __ Li(target.offset, target_field->GetOffset().Uint32Value());
+    } else {
+      // For static fields, we need to fill the `target.object` with the declaring class,
+      // so we can use `target.object` as temporary for the `ArtField*`. For instance fields,
+      // we do not need the declaring class, so we can forget the `ArtField*` when
+      // we load the `target.offset`, so use the `target.offset` to hold the `ArtField*`.
+      XRegister field = (expected_coordinates_count == 0) ? target.object : target.offset;
+
+      const MemberOffset art_field_offset = mirror::FieldVarHandle::ArtFieldOffset();
+      const MemberOffset offset_offset = ArtField::OffsetOffset();
+
+      // Load the ArtField*, the offset and, if needed, declaring class.
+      __ Loadd(field, varhandle, art_field_offset.Int32Value());
+      __ Loadwu(target.offset, field, offset_offset.Int32Value());
+      if (expected_coordinates_count == 0u) {
+        codegen->GenerateGcRootFieldLoad(
+            invoke,
+            Location::RegisterLocation(target.object),
+            field,
+            ArtField::DeclaringClassOffset().Int32Value(),
+            codegen->GetCompilerReadBarrierOption());
+      }
+    }
+  } else {
+    DCHECK_EQ(expected_coordinates_count, 2u);
+    DataType::Type value_type =
+        GetVarHandleExpectedValueType(invoke, /*expected_coordinates_count=*/ 2u);
+    MemberOffset data_offset = mirror::Array::DataOffset(DataType::Size(value_type));
+
+    XRegister index = locations->InAt(2).AsRegister<XRegister>();
+    __ Li(target.offset, data_offset.Int32Value());
+    codegen->GetInstructionVisitor()->ShNAdd(target.offset, index, target.offset, value_type);
+  }
+}
+
+static LocationSummary* CreateVarHandleCommonLocations(HInvoke* invoke,
+                                                       CodeGeneratorRISCV64* codegen) {
+  size_t expected_coordinates_count = GetExpectedVarHandleCoordinatesCount(invoke);
+  DataType::Type return_type = invoke->GetType();
+
+  ArenaAllocator* allocator = invoke->GetBlock()->GetGraph()->GetAllocator();
+  LocationSummary* locations =
+      new (allocator) LocationSummary(invoke, LocationSummary::kCallOnSlowPath, kIntrinsified);
+  locations->SetInAt(0, Location::RequiresRegister());
+  // Require coordinates in registers. These are the object holding the value
+  // to operate on (except for static fields) and index (for arrays and views).
+  for (size_t i = 0; i != expected_coordinates_count; ++i) {
+    locations->SetInAt(/* VarHandle object */ 1u + i, Location::RequiresRegister());
+  }
+  if (return_type != DataType::Type::kVoid) {
+    if (DataType::IsFloatingPointType(return_type)) {
+      locations->SetOut(Location::RequiresFpuRegister());
+    } else {
+      locations->SetOut(Location::RequiresRegister());
+    }
+  }
+  uint32_t arguments_start = /* VarHandle object */ 1u + expected_coordinates_count;
+  uint32_t number_of_arguments = invoke->GetNumberOfArguments();
+  for (size_t arg_index = arguments_start; arg_index != number_of_arguments; ++arg_index) {
+    HInstruction* arg = invoke->InputAt(arg_index);
+    if (IsZeroBitPattern(arg)) {
+      locations->SetInAt(arg_index, Location::ConstantLocation(arg));
+    } else if (DataType::IsFloatingPointType(arg->GetType())) {
+      locations->SetInAt(arg_index, Location::RequiresFpuRegister());
+    } else {
+      locations->SetInAt(arg_index, Location::RequiresRegister());
+    }
+  }
+
+  // Add a temporary for offset.
+  if (codegen->EmitNonBakerReadBarrier() &&
+      GetExpectedVarHandleCoordinatesCount(invoke) == 0u) {  // For static fields.
+    // To preserve the offset value across the non-Baker read barrier slow path
+    // for loading the declaring class, use a fixed callee-save register.
+    constexpr int first_callee_save = CTZ(kRiscv64CalleeSaveRefSpills);
+    locations->AddTemp(Location::RegisterLocation(first_callee_save));
+  } else {
+    locations->AddTemp(Location::RequiresRegister());
+  }
+  if (expected_coordinates_count == 0u) {
+    // Add a temporary to hold the declaring class.
+    locations->AddTemp(Location::RequiresRegister());
+  }
+
+  return locations;
+}
+
+static void CreateVarHandleGetLocations(HInvoke* invoke, CodeGeneratorRISCV64* codegen) {
+  VarHandleOptimizations optimizations(invoke);
+  if (optimizations.GetDoNotIntrinsify()) {
+    return;
+  }
+
+  if (codegen->EmitNonBakerReadBarrier() &&
+      invoke->GetType() == DataType::Type::kReference &&
+      invoke->GetIntrinsic() != Intrinsics::kVarHandleGet &&
+      invoke->GetIntrinsic() != Intrinsics::kVarHandleGetOpaque) {
+    // Unsupported for non-Baker read barrier because the artReadBarrierSlow() ignores
+    // the passed reference and reloads it from the field. This gets the memory visibility
+    // wrong for Acquire/Volatile operations. b/173104084
+    return;
+  }
+
+  CreateVarHandleCommonLocations(invoke, codegen);
+}
+
+DataType::Type IntTypeForFloatingPointType(DataType::Type fp_type) {
+  DCHECK(DataType::IsFloatingPointType(fp_type));
+  return (fp_type == DataType::Type::kFloat32) ? DataType::Type::kInt32 : DataType::Type::kInt64;
+}
+
+static void GenerateVarHandleGet(HInvoke* invoke,
+                                 CodeGeneratorRISCV64* codegen,
+                                 std::memory_order order,
+                                 bool byte_swap = false) {
+  DataType::Type type = invoke->GetType();
+  DCHECK_NE(type, DataType::Type::kVoid);
+
+  LocationSummary* locations = invoke->GetLocations();
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  Location out = locations->Out();
+
+  VarHandleTarget target = GetVarHandleTarget(invoke);
+  VarHandleSlowPathRISCV64* slow_path = nullptr;
+  if (!byte_swap) {
+    slow_path = GenerateVarHandleChecks(invoke, codegen, order, type);
+    GenerateVarHandleTarget(invoke, target, codegen);
+    if (slow_path != nullptr) {
+      __ Bind(slow_path->GetNativeByteOrderLabel());
+    }
+  }
+
+  bool seq_cst_barrier = (order == std::memory_order_seq_cst);
+  bool acquire_barrier = seq_cst_barrier || (order == std::memory_order_acquire);
+  DCHECK(acquire_barrier || order == std::memory_order_relaxed);
+
+  if (seq_cst_barrier) {
+    codegen->GenerateMemoryBarrier(MemBarrierKind::kAnyAny);
+  }
+
+  // Load the value from the target location.
+  if (type == DataType::Type::kReference && codegen->EmitBakerReadBarrier()) {
+    Location index = Location::RegisterLocation(target.offset);
+    // TODO(riscv64): Revisit when we add checking if the holder is black.
+    Location temp = Location::NoLocation();
+    codegen->GenerateReferenceLoadWithBakerReadBarrier(invoke,
+                                                       out,
+                                                       target.object,
+                                                       /*offset=*/ 0,
+                                                       index,
+                                                       temp,
+                                                       /*needs_null_check=*/ false);
+    DCHECK(!byte_swap);
+  } else {
+    ScratchRegisterScope srs(assembler);
+    XRegister address = srs.AllocateXRegister();
+    __ Add(address, target.object, target.offset);
+    Location load_loc = out;
+    DataType::Type load_type = type;
+    if (byte_swap && DataType::IsFloatingPointType(type)) {
+      load_loc = Location::RegisterLocation(target.offset);  // Load to the offset temporary.
+      load_type = IntTypeForFloatingPointType(type);
+    }
+    codegen->GetInstructionVisitor()->Load(load_loc, address, /*offset=*/ 0, load_type);
+    if (type == DataType::Type::kReference) {
+      DCHECK(!byte_swap);
+      Location object_loc = Location::RegisterLocation(target.object);
+      Location offset_loc = Location::RegisterLocation(target.offset);
+      codegen->MaybeGenerateReadBarrierSlow(
+          invoke, out, out, object_loc, /*offset=*/ 0u, /*index=*/ offset_loc);
+    } else if (byte_swap) {
+      GenerateReverseBytes(codegen, out, load_loc.AsRegister<XRegister>(), type);
+    }
+  }
+
+  if (acquire_barrier) {
+    codegen->GenerateMemoryBarrier(MemBarrierKind::kLoadAny);
+  }
+
+  if (slow_path != nullptr) {
+    DCHECK(!byte_swap);
+    __ Bind(slow_path->GetExitLabel());
+  }
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGet(HInvoke* invoke) {
+  CreateVarHandleGetLocations(invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGet(HInvoke* invoke) {
+  GenerateVarHandleGet(invoke, codegen_, std::memory_order_relaxed);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetOpaque(HInvoke* invoke) {
+  CreateVarHandleGetLocations(invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetOpaque(HInvoke* invoke) {
+  GenerateVarHandleGet(invoke, codegen_, std::memory_order_relaxed);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetAcquire(HInvoke* invoke) {
+  CreateVarHandleGetLocations(invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetAcquire(HInvoke* invoke) {
+  GenerateVarHandleGet(invoke, codegen_, std::memory_order_acquire);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetVolatile(HInvoke* invoke) {
+  CreateVarHandleGetLocations(invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetVolatile(HInvoke* invoke) {
+  GenerateVarHandleGet(invoke, codegen_, std::memory_order_seq_cst);
+}
+
+static void CreateVarHandleSetLocations(HInvoke* invoke, CodeGeneratorRISCV64* codegen) {
+  VarHandleOptimizations optimizations(invoke);
+  if (optimizations.GetDoNotIntrinsify()) {
+    return;
+  }
+
+  CreateVarHandleCommonLocations(invoke, codegen);
+  if (kPoisonHeapReferences && invoke->GetLocations() != nullptr) {
+    LocationSummary* locations = invoke->GetLocations();
+    uint32_t value_index = invoke->GetNumberOfArguments() - 1;
+    DataType::Type value_type = GetDataTypeFromShorty(invoke, value_index);
+    if (value_type == DataType::Type::kReference && !locations->InAt(value_index).IsConstant()) {
+      locations->AddTemp(Location::RequiresRegister());
+    }
+  }
+}
+
+static void GenerateVarHandleSet(HInvoke* invoke,
+                                 CodeGeneratorRISCV64* codegen,
+                                 std::memory_order order,
+                                 bool byte_swap = false) {
+  uint32_t value_index = invoke->GetNumberOfArguments() - 1;
+  DataType::Type value_type = GetDataTypeFromShorty(invoke, value_index);
+
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  Location value = invoke->GetLocations()->InAt(value_index);
+
+  VarHandleTarget target = GetVarHandleTarget(invoke);
+  VarHandleSlowPathRISCV64* slow_path = nullptr;
+  if (!byte_swap) {
+    slow_path = GenerateVarHandleChecks(invoke, codegen, order, value_type);
+    GenerateVarHandleTarget(invoke, target, codegen);
+    if (slow_path != nullptr) {
+      __ Bind(slow_path->GetNativeByteOrderLabel());
+    }
+  }
+
+  {
+    ScratchRegisterScope srs(assembler);
+    // Heap poisoning needs two scratch registers in `Store()`, except for null constants.
+    XRegister address =
+        (kPoisonHeapReferences && value_type == DataType::Type::kReference && !value.IsConstant())
+            ? invoke->GetLocations()->GetTemp(0).AsRegister<XRegister>()
+            : srs.AllocateXRegister();
+    __ Add(address, target.object, target.offset);
+
+    if (byte_swap) {
+      DCHECK(!value.IsConstant());  // Zero uses the main path as it does not need a byte swap.
+      // The offset is no longer needed, so reuse the offset temporary for the byte-swapped value.
+      Location new_value = Location::RegisterLocation(target.offset);
+      if (DataType::IsFloatingPointType(value_type)) {
+        value_type = IntTypeForFloatingPointType(value_type);
+        codegen->MoveLocation(new_value, value, value_type);
+        value = new_value;
+      }
+      GenerateReverseBytes(codegen, new_value, value.AsRegister<XRegister>(), value_type);
+      value = new_value;
+    }
+
+    GenerateSet(codegen, order, value, address, /*offset=*/ 0, value_type);
+  }
+
+  if (CodeGenerator::StoreNeedsWriteBarrier(value_type, invoke->InputAt(value_index))) {
+    codegen->MaybeMarkGCCard(
+        target.object, value.AsRegister<XRegister>(), /* emit_null_check= */ true);
+  }
+
+  if (slow_path != nullptr) {
+    DCHECK(!byte_swap);
+    __ Bind(slow_path->GetExitLabel());
+  }
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleSet(HInvoke* invoke) {
+  CreateVarHandleSetLocations(invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleSet(HInvoke* invoke) {
+  GenerateVarHandleSet(invoke, codegen_, std::memory_order_relaxed);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleSetOpaque(HInvoke* invoke) {
+  CreateVarHandleSetLocations(invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleSetOpaque(HInvoke* invoke) {
+  GenerateVarHandleSet(invoke, codegen_, std::memory_order_relaxed);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleSetRelease(HInvoke* invoke) {
+  CreateVarHandleSetLocations(invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleSetRelease(HInvoke* invoke) {
+  GenerateVarHandleSet(invoke, codegen_, std::memory_order_release);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleSetVolatile(HInvoke* invoke) {
+  CreateVarHandleSetLocations(invoke, codegen_);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleSetVolatile(HInvoke* invoke) {
+  GenerateVarHandleSet(invoke, codegen_, std::memory_order_seq_cst);
+}
+
+static bool ScratchXRegisterNeeded(Location loc, DataType::Type type, bool byte_swap) {
+  if (loc.IsConstant()) {
+    DCHECK(loc.GetConstant()->IsZeroBitPattern());
+    return false;
+  }
+  return DataType::IsFloatingPointType(type) || DataType::Size(type) < 4u || byte_swap;
+}
+
+static void CreateVarHandleCompareAndSetOrExchangeLocations(HInvoke* invoke,
+                                                            CodeGeneratorRISCV64* codegen,
+                                                            bool return_success) {
+  VarHandleOptimizations optimizations(invoke);
+  if (optimizations.GetDoNotIntrinsify()) {
+    return;
+  }
+
+  uint32_t expected_index = invoke->GetNumberOfArguments() - 2;
+  uint32_t new_value_index = invoke->GetNumberOfArguments() - 1;
+  DataType::Type value_type = GetDataTypeFromShorty(invoke, new_value_index);
+  DCHECK_EQ(value_type, GetDataTypeFromShorty(invoke, expected_index));
+
+  bool is_reference = (value_type == DataType::Type::kReference);
+  if (is_reference && codegen->EmitNonBakerReadBarrier()) {
+    // Unsupported for non-Baker read barrier because the artReadBarrierSlow() ignores
+    // the passed reference and reloads it from the field. This breaks the read barriers
+    // in slow path in different ways. The marked old value may not actually be a to-space
+    // reference to the same object as `old_value`, breaking slow path assumptions. And
+    // for CompareAndExchange, marking the old value after comparison failure may actually
+    // return the reference to `expected`, erroneously indicating success even though we
+    // did not set the new value. (And it also gets the memory visibility wrong.) b/173104084
+    return;
+  }
+
+  // TODO(riscv64): Fix this intrinsic for heap poisoning configuration.
+  if (kPoisonHeapReferences && value_type == DataType::Type::kReference) {
+    return;
+  }
+
+  LocationSummary* locations = CreateVarHandleCommonLocations(invoke, codegen);
+  DCHECK_EQ(expected_index, 1u + GetExpectedVarHandleCoordinatesCount(invoke));
+
+  if (codegen->EmitNonBakerReadBarrier()) {
+    // We need callee-save registers for both the class object and offset instead of
+    // the temporaries reserved in CreateVarHandleCommonLocations().
+    static_assert(POPCOUNT(kRiscv64CalleeSaveRefSpills) >= 2u);
+    uint32_t first_callee_save = CTZ(kRiscv64CalleeSaveRefSpills);
+    uint32_t second_callee_save = CTZ(kRiscv64CalleeSaveRefSpills ^ (1u << first_callee_save));
+    if (expected_index == 1u) {  // For static fields.
+      DCHECK_EQ(locations->GetTempCount(), 2u);
+      DCHECK(locations->GetTemp(0u).Equals(Location::RequiresRegister()));
+      DCHECK(locations->GetTemp(1u).Equals(Location::RegisterLocation(first_callee_save)));
+      locations->SetTempAt(0u, Location::RegisterLocation(second_callee_save));
+    } else {
+      DCHECK_EQ(locations->GetTempCount(), 1u);
+      DCHECK(locations->GetTemp(0u).Equals(Location::RequiresRegister()));
+      locations->SetTempAt(0u, Location::RegisterLocation(first_callee_save));
+    }
+  }
+
+  size_t old_temp_count = locations->GetTempCount();
+  DCHECK_EQ(old_temp_count, (expected_index == 1u) ? 2u : 1u);
+  Location expected = locations->InAt(expected_index);
+  Location new_value = locations->InAt(new_value_index);
+  size_t data_size = DataType::Size(value_type);
+  bool is_small = (data_size < 4u);
+  bool can_byte_swap =
+      (expected_index == 3u) && (value_type != DataType::Type::kReference && data_size != 1u);
+  bool is_fp = DataType::IsFloatingPointType(value_type);
+  size_t temps_needed =
+      // The offset temp is used for the `tmp_ptr`, except for the read barrier case. For read
+      // barrier we must preserve the offset and class pointer (if any) for the slow path and
+      // use a separate temp for `tmp_ptr` and we also need another temp for `old_value_temp`.
+      ((is_reference && codegen->EmitReadBarrier()) ? old_temp_count + 2u : 1u) +
+      // For small values, we need a temp for the `mask`, `masked` and maybe also for the `shift`.
+      (is_small ? (return_success ? 2u : 3u) : 0u) +
+      // Some cases need modified copies of `new_value` and `expected`.
+      (ScratchXRegisterNeeded(expected, value_type, can_byte_swap) ? 1u : 0u) +
+      (ScratchXRegisterNeeded(new_value, value_type, can_byte_swap) ? 1u : 0u) +
+      // We need a scratch register either for the old value or for the result of SC.
+      // If we need to return a floating point old value, we need a temp for each.
+      ((!return_success && is_fp) ? 2u : 1u);
+  size_t scratch_registers_available = 2u;
+  DCHECK_EQ(scratch_registers_available,
+            ScratchRegisterScope(codegen->GetAssembler()).AvailableXRegisters());
+  if (temps_needed > old_temp_count + scratch_registers_available) {
+    locations->AddRegisterTemps(temps_needed - (old_temp_count + scratch_registers_available));
+  }
+}
+
+static XRegister PrepareXRegister(CodeGeneratorRISCV64* codegen,
+                                  Location loc,
+                                  DataType::Type type,
+                                  XRegister shift,
+                                  XRegister mask,
+                                  bool byte_swap,
+                                  ScratchRegisterScope* srs) {
+  DCHECK_IMPLIES(mask != kNoXRegister, shift != kNoXRegister);
+  DCHECK_EQ(shift == kNoXRegister, DataType::Size(type) >= 4u);
+  if (loc.IsConstant()) {
+    // The `shift`/`mask` and `byte_swap` are irrelevant for zero input.
+    DCHECK(loc.GetConstant()->IsZeroBitPattern());
+    return Zero;
+  }
+
+  Location result = loc;
+  if (DataType::IsFloatingPointType(type)) {
+    type = IntTypeForFloatingPointType(type);
+    result = Location::RegisterLocation(srs->AllocateXRegister());
+    codegen->MoveLocation(result, loc, type);
+    loc = result;
+  } else if (byte_swap || shift != kNoXRegister) {
+    result = Location::RegisterLocation(srs->AllocateXRegister());
+  }
+  if (byte_swap) {
+    if (type == DataType::Type::kInt16) {
+      type = DataType::Type::kUint16;  // Do the masking as part of the byte swap.
+    }
+    GenerateReverseBytes(codegen, result, loc.AsRegister<XRegister>(), type);
+    loc = result;
+  }
+  if (shift != kNoXRegister) {
+    Riscv64Assembler* assembler = codegen->GetAssembler();
+    __ Sllw(result.AsRegister<XRegister>(), loc.AsRegister<XRegister>(), shift);
+    DCHECK_NE(type, DataType::Type::kUint8);
+    if (mask != kNoXRegister && type != DataType::Type::kUint16 && type != DataType::Type::kBool) {
+      __ And(result.AsRegister<XRegister>(), result.AsRegister<XRegister>(), mask);
+    }
+  }
+  return result.AsRegister<XRegister>();
+}
+
+static void GenerateByteSwapAndExtract(CodeGeneratorRISCV64* codegen,
+                                       Location rd,
+                                       XRegister rs1,
+                                       XRegister shift,
+                                       DataType::Type type) {
+  // Apply shift before `GenerateReverseBytes()` for small types.
+  DCHECK_EQ(shift != kNoXRegister, DataType::Size(type) < 4u);
+  if (shift != kNoXRegister) {
+    Riscv64Assembler* assembler = codegen->GetAssembler();
+    __ Srlw(rd.AsRegister<XRegister>(), rs1, shift);
+    rs1 = rd.AsRegister<XRegister>();
+  }
+  // Also handles moving to FP registers.
+  GenerateReverseBytes(codegen, rd, rs1, type);
+}
+
+static void GenerateVarHandleCompareAndSetOrExchange(HInvoke* invoke,
+                                                     CodeGeneratorRISCV64* codegen,
+                                                     std::memory_order order,
+                                                     bool return_success,
+                                                     bool strong,
+                                                     bool byte_swap = false) {
+  DCHECK(return_success || strong);
+
+  uint32_t expected_index = invoke->GetNumberOfArguments() - 2;
+  uint32_t new_value_index = invoke->GetNumberOfArguments() - 1;
+  DataType::Type value_type = GetDataTypeFromShorty(invoke, new_value_index);
+  DCHECK_EQ(value_type, GetDataTypeFromShorty(invoke, expected_index));
+
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+  Location expected = locations->InAt(expected_index);
+  Location new_value = locations->InAt(new_value_index);
+  Location out = locations->Out();
+
+  VarHandleTarget target = GetVarHandleTarget(invoke);
+  VarHandleSlowPathRISCV64* slow_path = nullptr;
+  if (!byte_swap) {
+    slow_path = GenerateVarHandleChecks(invoke, codegen, order, value_type);
+    GenerateVarHandleTarget(invoke, target, codegen);
+    if (slow_path != nullptr) {
+      slow_path->SetCompareAndSetOrExchangeArgs(return_success, strong);
+      __ Bind(slow_path->GetNativeByteOrderLabel());
+    }
+  }
+
+  // This needs to be before we allocate the scratch registers, as MarkGCCard also uses them.
+  if (CodeGenerator::StoreNeedsWriteBarrier(value_type, invoke->InputAt(new_value_index))) {
+    // Mark card for object assuming new value is stored.
+    bool new_value_can_be_null = true;  // TODO: Worth finding out this information?
+    codegen->MaybeMarkGCCard(
+        target.object, new_value.AsRegister<XRegister>(), new_value_can_be_null);
+  }
+
+  // Scratch registers may be needed for `new_value` and `expected`.
+  ScratchRegisterScope srs(assembler);
+  DCHECK_EQ(srs.AvailableXRegisters(), 2u);
+  size_t available_scratch_registers =
+      (ScratchXRegisterNeeded(expected, value_type, byte_swap) ? 0u : 1u) +
+      (ScratchXRegisterNeeded(new_value, value_type, byte_swap) ? 0u : 1u);
+
+  // Reuse the `offset` temporary for the pointer to the target location,
+  // except for references that need the offset for the read barrier.
+  DCHECK_EQ(target.offset, locations->GetTemp(0u).AsRegister<XRegister>());
+  size_t next_temp = 1u;
+  XRegister tmp_ptr = target.offset;
+  bool is_reference = (value_type == DataType::Type::kReference);
+  if (is_reference && codegen->EmitReadBarrier()) {
+    // Reserve scratch registers for `tmp_ptr` and `old_value_temp`.
+    DCHECK_EQ(available_scratch_registers, 2u);
+    available_scratch_registers = 0u;
+    DCHECK_EQ(expected_index, 1u + GetExpectedVarHandleCoordinatesCount(invoke));
+    next_temp = expected_index == 1u ? 2u : 1u;  // Preserve the class register for static field.
+    tmp_ptr = srs.AllocateXRegister();
+  }
+  __ Add(tmp_ptr, target.object, target.offset);
+
+  auto get_temp = [&]() {
+    if (available_scratch_registers != 0u) {
+      available_scratch_registers -= 1u;
+      return srs.AllocateXRegister();
+    } else {
+      XRegister temp = locations->GetTemp(next_temp).AsRegister<XRegister>();
+      next_temp += 1u;
+      return temp;
+    }
+  };
+
+  XRegister shift = kNoXRegister;
+  XRegister mask = kNoXRegister;
+  XRegister masked = kNoXRegister;
+  size_t data_size = DataType::Size(value_type);
+  bool is_small = (data_size < 4u);
+  if (is_small) {
+    // When returning "success" and not the old value, we shall not need the `shift` after
+    // the raw CAS operation, so use the output register as a temporary here.
+    shift = return_success ? locations->Out().AsRegister<XRegister>() : get_temp();
+    mask = get_temp();
+    masked = get_temp();
+    // Upper bits of the shift are not used, so we do not need to clear them.
+    __ Slli(shift, tmp_ptr, WhichPowerOf2(kBitsPerByte));
+    __ Andi(tmp_ptr, tmp_ptr, -4);
+    __ Li(mask, (1 << (data_size * kBitsPerByte)) - 1);
+    __ Sllw(mask, mask, shift);
+  }
+
+  // Move floating point values to scratch registers and apply shift, mask and byte swap if needed.
+  // Note that float/double CAS uses bitwise comparison, rather than the operator==.
+  XRegister expected_reg =
+      PrepareXRegister(codegen, expected, value_type, shift, mask, byte_swap, &srs);
+  XRegister new_value_reg =
+      PrepareXRegister(codegen, new_value, value_type, shift, mask, byte_swap, &srs);
+  bool is_fp = DataType::IsFloatingPointType(value_type);
+  DataType::Type cas_type = is_fp
+      ? IntTypeForFloatingPointType(value_type)
+      : (is_small ? DataType::Type::kInt32 : value_type);
+
+  // Prepare registers for old value and the result of the store conditional.
+  XRegister old_value;
+  XRegister store_result;
+  if (return_success) {
+    // Use a temp for the old value.
+    old_value = get_temp();
+    // For strong CAS, use the `old_value` temp also for the SC result.
+    // For weak CAS, put the SC result directly to `out`.
+    store_result = strong ? old_value : out.AsRegister<XRegister>();
+  } else if (is_fp) {
+    // We need two temporary registers.
+    old_value = get_temp();
+    store_result = get_temp();
+  } else {
+    // Use the output register for the old value and a temp for the store conditional result.
+    old_value = out.AsRegister<XRegister>();
+    store_result = get_temp();
+  }
+
+  Riscv64Label exit_loop_label;
+  Riscv64Label* exit_loop = &exit_loop_label;
+  Riscv64Label* cmp_failure = &exit_loop_label;
+
+  ReadBarrierCasSlowPathRISCV64* rb_slow_path = nullptr;
+  if (is_reference && codegen->EmitReadBarrier()) {
+    // The `old_value_temp` is used first for marking the `old_value` and then for the unmarked
+    // reloaded old value for subsequent CAS in the slow path. We make this a scratch register
+    // as we do have marking entrypoints on riscv64 even for scratch registers.
+    XRegister old_value_temp = srs.AllocateXRegister();
+    // For strong CAS, use the `old_value_temp` also for the SC result as the reloaded old value
+    // is no longer needed after the comparison. For weak CAS, store the SC result in the same
+    // result register as the main path.
+    // Note that for a strong CAS, a SC failure in the slow path can set the register to 1, so
+    // we cannot use that register to indicate success without resetting it to 0 at the start of
+    // the retry loop. Instead, we return to the success indicating instruction in the main path.
+    XRegister slow_path_store_result = strong ? old_value_temp : store_result;
+    rb_slow_path = new (codegen->GetScopedAllocator()) ReadBarrierCasSlowPathRISCV64(
+        invoke,
+        order,
+        strong,
+        target.object,
+        target.offset,
+        expected_reg,
+        new_value_reg,
+        old_value,
+        old_value_temp,
+        slow_path_store_result,
+        /*update_old_value=*/ !return_success,
+        codegen);
+    codegen->AddSlowPath(rb_slow_path);
+    exit_loop = rb_slow_path->GetExitLabel();
+    cmp_failure = rb_slow_path->GetEntryLabel();
+  }
+
+  if (return_success) {
+    // Pre-populate the output register with failure for the case when the old value
+    // differs and we do not execute the store conditional.
+    __ Li(out.AsRegister<XRegister>(), 0);
+  }
+  GenerateCompareAndSet(codegen->GetAssembler(),
+                        cas_type,
+                        order,
+                        strong,
+                        cmp_failure,
+                        tmp_ptr,
+                        new_value_reg,
+                        old_value,
+                        mask,
+                        masked,
+                        store_result,
+                        expected_reg);
+  if (return_success && strong) {
+    if (rb_slow_path != nullptr) {
+      // Slow path returns here on success.
+      __ Bind(rb_slow_path->GetSuccessExitLabel());
+    }
+    // Load success value to the output register.
+    // `GenerateCompareAndSet()` does not emit code to indicate success for a strong CAS.
+    __ Li(out.AsRegister<XRegister>(), 1);
+  } else if (rb_slow_path != nullptr) {
+    DCHECK(!rb_slow_path->GetSuccessExitLabel()->IsLinked());
+  }
+  __ Bind(exit_loop);
+
+  if (return_success) {
+    // Nothing to do, the result register already contains 1 on success and 0 on failure.
+  } else if (byte_swap) {
+    DCHECK_IMPLIES(is_small, out.AsRegister<XRegister>() == old_value)
+        << " " << value_type << " " << out.AsRegister<XRegister>() << "!=" << old_value;
+    GenerateByteSwapAndExtract(codegen, out, old_value, shift, value_type);
+  } else if (is_fp) {
+    codegen->MoveLocation(out, Location::RegisterLocation(old_value), value_type);
+  } else if (is_small) {
+    __ Srlw(old_value, masked, shift);
+    if (value_type == DataType::Type::kInt8) {
+      __ SextB(old_value, old_value);
+    } else if (value_type == DataType::Type::kInt16) {
+      __ SextH(old_value, old_value);
+    }
+  }
+
+  if (slow_path != nullptr) {
+    DCHECK(!byte_swap);
+    __ Bind(slow_path->GetExitLabel());
+  }
+
+  // Check that we have allocated the right number of temps. We may need more registers
+  // for byte swapped CAS in the slow path, so skip this check for the main path in that case.
+  bool has_byte_swap = (expected_index == 3u) && (!is_reference && data_size != 1u);
+  if ((!has_byte_swap || byte_swap) && next_temp != locations->GetTempCount()) {
+    // We allocate a temporary register for the class object for a static field `VarHandle` but
+    // we do not update the `next_temp` if it's otherwise unused after the address calculation.
+    CHECK_EQ(expected_index, 1u);
+    CHECK_EQ(next_temp, 1u);
+    CHECK_EQ(locations->GetTempCount(), 2u);
+  }
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleCompareAndExchange(HInvoke* invoke) {
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ false);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleCompareAndExchange(HInvoke* invoke) {
+  GenerateVarHandleCompareAndSetOrExchange(
+      invoke, codegen_, std::memory_order_seq_cst, /*return_success=*/ false, /*strong=*/ true);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleCompareAndExchangeAcquire(HInvoke* invoke) {
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ false);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleCompareAndExchangeAcquire(HInvoke* invoke) {
+  GenerateVarHandleCompareAndSetOrExchange(
+      invoke, codegen_, std::memory_order_acquire, /*return_success=*/ false, /*strong=*/ true);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleCompareAndExchangeRelease(HInvoke* invoke) {
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ false);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleCompareAndExchangeRelease(HInvoke* invoke) {
+  GenerateVarHandleCompareAndSetOrExchange(
+      invoke, codegen_, std::memory_order_release, /*return_success=*/ false, /*strong=*/ true);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleCompareAndSet(HInvoke* invoke) {
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ true);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleCompareAndSet(HInvoke* invoke) {
+  GenerateVarHandleCompareAndSetOrExchange(
+      invoke, codegen_, std::memory_order_seq_cst, /*return_success=*/ true, /*strong=*/ true);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleWeakCompareAndSet(HInvoke* invoke) {
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ true);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleWeakCompareAndSet(HInvoke* invoke) {
+  GenerateVarHandleCompareAndSetOrExchange(
+      invoke, codegen_, std::memory_order_seq_cst, /*return_success=*/ true, /*strong=*/ false);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleWeakCompareAndSetAcquire(HInvoke* invoke) {
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ true);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleWeakCompareAndSetAcquire(HInvoke* invoke) {
+  GenerateVarHandleCompareAndSetOrExchange(
+      invoke, codegen_, std::memory_order_acquire, /*return_success=*/ true, /*strong=*/ false);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleWeakCompareAndSetPlain(HInvoke* invoke) {
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ true);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleWeakCompareAndSetPlain(HInvoke* invoke) {
+  GenerateVarHandleCompareAndSetOrExchange(
+      invoke, codegen_, std::memory_order_relaxed, /*return_success=*/ true, /*strong=*/ false);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleWeakCompareAndSetRelease(HInvoke* invoke) {
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_, /*return_success=*/ true);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleWeakCompareAndSetRelease(HInvoke* invoke) {
+  GenerateVarHandleCompareAndSetOrExchange(
+      invoke, codegen_, std::memory_order_release, /*return_success=*/ true, /*strong=*/ false);
+}
+
+static void CreateVarHandleGetAndUpdateLocations(HInvoke* invoke,
+                                                 CodeGeneratorRISCV64* codegen,
+                                                 GetAndUpdateOp get_and_update_op) {
+  VarHandleOptimizations optimizations(invoke);
+  if (optimizations.GetDoNotIntrinsify()) {
+    return;
+  }
+
+  if (invoke->GetType() == DataType::Type::kReference && codegen->EmitNonBakerReadBarrier()) {
+    // Unsupported for non-Baker read barrier because the artReadBarrierSlow() ignores
+    // the passed reference and reloads it from the field, thus seeing the new value
+    // that we have just stored. (And it also gets the memory visibility wrong.) b/173104084
+    return;
+  }
+
+  // TODO(riscv64): Fix this intrinsic for heap poisoning configuration.
+  if (kPoisonHeapReferences && invoke->GetType() == DataType::Type::kReference) {
+    return;
+  }
+
+  LocationSummary* locations = CreateVarHandleCommonLocations(invoke, codegen);
+  uint32_t arg_index = invoke->GetNumberOfArguments() - 1;
+  DCHECK_EQ(arg_index, 1u + GetExpectedVarHandleCoordinatesCount(invoke));
+  DataType::Type value_type = invoke->GetType();
+  DCHECK_EQ(value_type, GetDataTypeFromShorty(invoke, arg_index));
+  Location arg = locations->InAt(arg_index);
+
+  bool is_fp = DataType::IsFloatingPointType(value_type);
+  if (is_fp) {
+    if (get_and_update_op == GetAndUpdateOp::kAdd) {
+      // For ADD, do not use ZR for zero bit pattern (+0.0f or +0.0).
+      locations->SetInAt(invoke->GetNumberOfArguments() - 1u, Location::RequiresFpuRegister());
+    } else {
+      DCHECK(get_and_update_op == GetAndUpdateOp::kSet);
+    }
+  }
+
+  size_t data_size = DataType::Size(value_type);
+  bool can_byte_swap =
+      (arg_index == 3u) && (value_type != DataType::Type::kReference && data_size != 1u);
+  bool can_use_cas = (get_and_update_op == GetAndUpdateOp::kAdd) && (can_byte_swap || is_fp);
+  bool is_small = (data_size < 4u);
+  bool is_small_and = is_small && (get_and_update_op == GetAndUpdateOp::kAnd);
+  bool is_bitwise =
+      (get_and_update_op != GetAndUpdateOp::kSet && get_and_update_op != GetAndUpdateOp::kAdd);
+
+  size_t temps_needed =
+      // The offset temp is used for the `tmp_ptr`.
+      1u +
+      // For small values, we need temps for `shift` and maybe also `mask` and `temp`.
+      (is_small ? (is_bitwise ? 1u : 3u) : 0u) +
+      // Some cases need modified copies of `arg`.
+      (is_small_and || ScratchXRegisterNeeded(arg, value_type, can_byte_swap) ? 1u : 0u) +
+      // For FP types, we need a temp for `old_value` which cannot be loaded directly to `out`.
+      (is_fp ? 1u : 0u);
+  if (can_use_cas) {
+    size_t cas_temps_needed =
+        // The offset temp is used for the `tmp_ptr`.
+        1u +
+        // For small values, we need a temp for `shift`.
+        (is_small ? 1u : 0u) +
+        // And we always need temps for `old_value`, `new_value` and `reloaded_old_value`.
+        3u;
+    DCHECK_GE(cas_temps_needed, temps_needed);
+    temps_needed = cas_temps_needed;
+  }
+
+  size_t scratch_registers_available = 2u;
+  DCHECK_EQ(scratch_registers_available,
+            ScratchRegisterScope(codegen->GetAssembler()).AvailableXRegisters());
+  size_t old_temp_count = locations->GetTempCount();
+  DCHECK_EQ(old_temp_count, (arg_index == 1u) ? 2u : 1u);
+  if (temps_needed > old_temp_count + scratch_registers_available) {
+    locations->AddRegisterTemps(temps_needed - (old_temp_count + scratch_registers_available));
+  }
+}
+
+static void GenerateVarHandleGetAndUpdate(HInvoke* invoke,
+                                          CodeGeneratorRISCV64* codegen,
+                                          GetAndUpdateOp get_and_update_op,
+                                          std::memory_order order,
+                                          bool byte_swap = false) {
+  uint32_t arg_index = invoke->GetNumberOfArguments() - 1;
+  DCHECK_EQ(arg_index, 1u + GetExpectedVarHandleCoordinatesCount(invoke));
+  DataType::Type value_type = invoke->GetType();
+  DCHECK_EQ(value_type, GetDataTypeFromShorty(invoke, arg_index));
+
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+  Location arg = locations->InAt(arg_index);
+  DCHECK_IMPLIES(arg.IsConstant(), arg.GetConstant()->IsZeroBitPattern());
+  Location out = locations->Out();
+
+  VarHandleTarget target = GetVarHandleTarget(invoke);
+  VarHandleSlowPathRISCV64* slow_path = nullptr;
+  if (!byte_swap) {
+    slow_path = GenerateVarHandleChecks(invoke, codegen, order, value_type);
+    GenerateVarHandleTarget(invoke, target, codegen);
+    if (slow_path != nullptr) {
+      slow_path->SetGetAndUpdateOp(get_and_update_op);
+      __ Bind(slow_path->GetNativeByteOrderLabel());
+    }
+  }
+
+  // This needs to be before the temp registers, as MarkGCCard also uses scratch registers.
+  if (CodeGenerator::StoreNeedsWriteBarrier(value_type, invoke->InputAt(arg_index))) {
+    DCHECK(get_and_update_op == GetAndUpdateOp::kSet);
+    // Mark card for object, the new value shall be stored.
+    bool new_value_can_be_null = true;  // TODO: Worth finding out this information?
+    codegen->MaybeMarkGCCard(target.object, arg.AsRegister<XRegister>(), new_value_can_be_null);
+  }
+
+  size_t data_size = DataType::Size(value_type);
+  bool is_fp = DataType::IsFloatingPointType(value_type);
+  bool use_cas = (get_and_update_op == GetAndUpdateOp::kAdd) && (byte_swap || is_fp);
+  bool is_small = (data_size < 4u);
+  bool is_small_and = is_small && (get_and_update_op == GetAndUpdateOp::kAnd);
+  bool is_reference = (value_type == DataType::Type::kReference);
+  DataType::Type op_type = is_fp
+      ? IntTypeForFloatingPointType(value_type)
+      : (is_small || is_reference ? DataType::Type::kInt32 : value_type);
+
+  ScratchRegisterScope srs(assembler);
+  DCHECK_EQ(srs.AvailableXRegisters(), 2u);
+  size_t available_scratch_registers = use_cas
+      // We use scratch registers differently for the CAS path.
+      ? 0u
+      // Reserve one scratch register for `PrepareXRegister()` or similar `arg_reg` allocation.
+      : (is_small_and || ScratchXRegisterNeeded(arg, value_type, byte_swap) ? 1u : 2u);
+
+  // Reuse the `target.offset` temporary for the pointer to the target location,
+  // except for references that need the offset for the non-Baker read barrier.
+  DCHECK_EQ(target.offset, locations->GetTemp(0u).AsRegister<XRegister>());
+  size_t next_temp = 1u;
+  XRegister tmp_ptr = target.offset;
+  if (is_reference && codegen->EmitNonBakerReadBarrier()) {
+    DCHECK_EQ(available_scratch_registers, 2u);
+    available_scratch_registers -= 1u;
+    tmp_ptr = srs.AllocateXRegister();
+  }
+  __ Add(tmp_ptr, target.object, target.offset);
+
+  auto get_temp = [&]() {
+    if (available_scratch_registers != 0u) {
+      available_scratch_registers -= 1u;
+      return srs.AllocateXRegister();
+    } else {
+      XRegister temp = locations->GetTemp(next_temp).AsRegister<XRegister>();
+      next_temp += 1u;
+      return temp;
+    }
+  };
+
+  XRegister shift = kNoXRegister;
+  XRegister mask = kNoXRegister;
+  XRegister prepare_mask = kNoXRegister;
+  XRegister temp = kNoXRegister;
+  XRegister arg_reg = kNoXRegister;
+  if (is_small) {
+    shift = get_temp();
+    // Upper bits of the shift are not used, so we do not need to clear them.
+    __ Slli(shift, tmp_ptr, WhichPowerOf2(kBitsPerByte));
+    __ Andi(tmp_ptr, tmp_ptr, -4);
+    switch (get_and_update_op) {
+      case GetAndUpdateOp::kAdd:
+        if (byte_swap) {
+          // The mask is not needed in the CAS path.
+          DCHECK(use_cas);
+          break;
+        }
+        FALLTHROUGH_INTENDED;
+      case GetAndUpdateOp::kSet:
+        mask = get_temp();
+        temp = get_temp();
+        __ Li(mask, (1 << (data_size * kBitsPerByte)) - 1);
+        __ Sllw(mask, mask, shift);
+        // The argument does not need to be masked for `GetAndUpdateOp::kAdd`,
+        // the mask shall be applied after the ADD instruction.
+        prepare_mask = (get_and_update_op == GetAndUpdateOp::kSet) ? mask : kNoXRegister;
+        break;
+      case GetAndUpdateOp::kAnd:
+        // We need to set all other bits, so we always need a temp.
+        arg_reg = srs.AllocateXRegister();
+        if (data_size == 1u) {
+          __ Ori(arg_reg, InputXRegisterOrZero(arg), ~0xff);
+          DCHECK(!byte_swap);
+        } else {
+          DCHECK_EQ(data_size, 2u);
+          __ Li(arg_reg, ~0xffff);
+          __ Or(arg_reg, InputXRegisterOrZero(arg), arg_reg);
+          if (byte_swap) {
+            __ Rev8(arg_reg, arg_reg);
+            __ Rori(arg_reg, arg_reg, 48);
+          }
+        }
+        __ Rolw(arg_reg, arg_reg, shift);
+        break;
+      case GetAndUpdateOp::kOr:
+      case GetAndUpdateOp::kXor:
+        // Signed values need to be truncated but we're keeping `prepare_mask == kNoXRegister`.
+        if (value_type == DataType::Type::kInt8 && !arg.IsConstant()) {
+          DCHECK(!byte_swap);
+          arg_reg = srs.AllocateXRegister();
+          __ ZextB(arg_reg, arg.AsRegister<XRegister>());
+          __ Sllw(arg_reg, arg_reg, shift);
+        } else if (value_type == DataType::Type::kInt16 && !arg.IsConstant() && !byte_swap) {
+          arg_reg = srs.AllocateXRegister();
+          __ ZextH(arg_reg, arg.AsRegister<XRegister>());
+          __ Sllw(arg_reg, arg_reg, shift);
+        }  // else handled by `PrepareXRegister()` below.
+        break;
+    }
+  }
+  if (arg_reg == kNoXRegister && !use_cas) {
+    arg_reg = PrepareXRegister(codegen, arg, value_type, shift, prepare_mask, byte_swap, &srs);
+  }
+  if (mask != kNoXRegister && get_and_update_op == GetAndUpdateOp::kSet) {
+    __ Not(mask, mask);  // We need to flip the mask for `kSet`, see `GenerateGetAndUpdate()`.
+  }
+
+  if (use_cas) {
+    // Allocate scratch registers for temps that can theoretically be clobbered on retry.
+    // (Even though the `retry` label shall never be far enough for `TMP` to be clobbered.)
+    DCHECK_EQ(available_scratch_registers, 0u);  // Reserved for the two uses below.
+    XRegister old_value = srs.AllocateXRegister();
+    XRegister new_value = srs.AllocateXRegister();
+    // Allocate other needed temporaries.
+    XRegister reloaded_old_value = get_temp();
+    XRegister store_result = reloaded_old_value;  // Clobber reloaded old value by store result.
+    FRegister ftmp = is_fp ? srs.AllocateFRegister() : kNoFRegister;
+
+    Riscv64Label retry;
+    __ Bind(&retry);
+    codegen->GetInstructionVisitor()->Load(
+        Location::RegisterLocation(old_value), tmp_ptr, /*offset=*/ 0, op_type);
+    if (byte_swap) {
+      GenerateByteSwapAndExtract(codegen, out, old_value, shift, value_type);
+    } else {
+      DCHECK(is_fp);
+      codegen->MoveLocation(out, Location::RegisterLocation(old_value), value_type);
+    }
+    if (is_fp) {
+      codegen->GetInstructionVisitor()->FAdd(
+          ftmp, out.AsFpuRegister<FRegister>(), arg.AsFpuRegister<FRegister>(), value_type);
+      codegen->MoveLocation(
+          Location::RegisterLocation(new_value), Location::FpuRegisterLocation(ftmp), op_type);
+    } else if (value_type == DataType::Type::kInt64) {
+      __ Add(new_value, out.AsRegister<XRegister>(), arg.AsRegister<XRegister>());
+    } else {
+      DCHECK_EQ(op_type, DataType::Type::kInt32);
+      __ Addw(new_value, out.AsRegister<XRegister>(), arg.AsRegister<XRegister>());
+    }
+    if (byte_swap) {
+      DataType::Type swap_type = op_type;
+      if (is_small) {
+        DCHECK_EQ(data_size, 2u);
+        // We want to update only 16 bits of the 32-bit location. The 16 bits we want to replace
+        // are present in both `old_value` and `out` but in different bits and byte order.
+        // To update the 16 bits, we can XOR the new value with the `out`, byte swap as Uint16
+        // (extracting only the bits we want to update), shift and XOR with the old value.
+        swap_type = DataType::Type::kUint16;
+        __ Xor(new_value, new_value, out.AsRegister<XRegister>());
+      }
+      GenerateReverseBytes(codegen, Location::RegisterLocation(new_value), new_value, swap_type);
+      if (is_small) {
+        __ Sllw(new_value, new_value, shift);
+        __ Xor(new_value, new_value, old_value);
+      }
+    }
+    GenerateCompareAndSet(assembler,
+                          op_type,
+                          order,
+                          /*strong=*/ true,
+                          /*cmp_failure=*/ &retry,
+                          tmp_ptr,
+                          new_value,
+                          /*old_value=*/ reloaded_old_value,
+                          /*mask=*/ kNoXRegister,
+                          /*masked=*/ kNoXRegister,
+                          store_result,
+                          /*expected=*/ old_value);
+  } else {
+    XRegister old_value = is_fp ? get_temp() : out.AsRegister<XRegister>();
+    GenerateGetAndUpdate(
+        codegen, get_and_update_op, op_type, order, tmp_ptr, arg_reg, old_value, mask, temp);
+    if (byte_swap) {
+      DCHECK_IMPLIES(is_small, out.AsRegister<XRegister>() == old_value)
+          << " " << value_type << " " << out.AsRegister<XRegister>() << "!=" << old_value;
+      GenerateByteSwapAndExtract(codegen, out, old_value, shift, value_type);
+    } else if (is_fp) {
+      codegen->MoveLocation(out, Location::RegisterLocation(old_value), value_type);
+    } else if (is_small) {
+      __ Srlw(old_value, old_value, shift);
+      DCHECK_NE(value_type, DataType::Type::kUint8);
+      if (value_type == DataType::Type::kInt8) {
+        __ SextB(old_value, old_value);
+      } else if (value_type == DataType::Type::kBool) {
+        __ ZextB(old_value, old_value);
+      } else if (value_type == DataType::Type::kInt16) {
+        __ SextH(old_value, old_value);
+      } else {
+        DCHECK_EQ(value_type, DataType::Type::kUint16);
+        __ ZextH(old_value, old_value);
+      }
+    } else if (is_reference) {
+      __ ZextW(old_value, old_value);
+      if (codegen->EmitBakerReadBarrier()) {
+        // Use RA as temp. It is clobbered in the slow path anyway.
+        static constexpr Location kBakerReadBarrierTemp = Location::RegisterLocation(RA);
+        SlowPathCodeRISCV64* rb_slow_path =
+            codegen->AddGcRootBakerBarrierBarrierSlowPath(invoke, out, kBakerReadBarrierTemp);
+        codegen->EmitBakerReadBarierMarkingCheck(rb_slow_path, out, kBakerReadBarrierTemp);
+      } else if (codegen->EmitNonBakerReadBarrier()) {
+        Location base_loc = Location::RegisterLocation(target.object);
+        Location index = Location::RegisterLocation(target.offset);
+        SlowPathCodeRISCV64* rb_slow_path = codegen->AddReadBarrierSlowPath(
+            invoke, out, out, base_loc, /*offset=*/ 0u, index);
+        __ J(rb_slow_path->GetEntryLabel());
+        __ Bind(rb_slow_path->GetExitLabel());
+      }
+    }
+  }
+
+  if (slow_path != nullptr) {
+    DCHECK(!byte_swap);
+    __ Bind(slow_path->GetExitLabel());
+  }
+
+  // Check that we have allocated the right number of temps. We may need more registers
+  // for byte swapped CAS in the slow path, so skip this check for the main path in that case.
+  bool has_byte_swap = (arg_index == 3u) && (!is_reference && data_size != 1u);
+  if ((!has_byte_swap || byte_swap) && next_temp != locations->GetTempCount()) {
+    // We allocate a temporary register for the class object for a static field `VarHandle` but
+    // we do not update the `next_temp` if it's otherwise unused after the address calculation.
+    CHECK_EQ(arg_index, 1u);
+    CHECK_EQ(next_temp, 1u);
+    CHECK_EQ(locations->GetTempCount(), 2u);
+  }
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetAndSet(HInvoke* invoke) {
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kSet);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetAndSet(HInvoke* invoke) {
+  GenerateVarHandleGetAndUpdate(invoke, codegen_, GetAndUpdateOp::kSet, std::memory_order_seq_cst);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetAndSetAcquire(HInvoke* invoke) {
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kSet);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetAndSetAcquire(HInvoke* invoke) {
+  GenerateVarHandleGetAndUpdate(invoke, codegen_, GetAndUpdateOp::kSet, std::memory_order_acquire);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetAndSetRelease(HInvoke* invoke) {
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kSet);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetAndSetRelease(HInvoke* invoke) {
+  GenerateVarHandleGetAndUpdate(invoke, codegen_, GetAndUpdateOp::kSet, std::memory_order_release);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetAndAdd(HInvoke* invoke) {
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAdd);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetAndAdd(HInvoke* invoke) {
+  GenerateVarHandleGetAndUpdate(invoke, codegen_, GetAndUpdateOp::kAdd, std::memory_order_seq_cst);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetAndAddAcquire(HInvoke* invoke) {
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAdd);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetAndAddAcquire(HInvoke* invoke) {
+  GenerateVarHandleGetAndUpdate(invoke, codegen_, GetAndUpdateOp::kAdd, std::memory_order_acquire);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetAndAddRelease(HInvoke* invoke) {
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAdd);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetAndAddRelease(HInvoke* invoke) {
+  GenerateVarHandleGetAndUpdate(invoke, codegen_, GetAndUpdateOp::kAdd, std::memory_order_release);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetAndBitwiseAnd(HInvoke* invoke) {
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAnd);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetAndBitwiseAnd(HInvoke* invoke) {
+  GenerateVarHandleGetAndUpdate(invoke, codegen_, GetAndUpdateOp::kAnd, std::memory_order_seq_cst);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetAndBitwiseAndAcquire(HInvoke* invoke) {
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAnd);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetAndBitwiseAndAcquire(HInvoke* invoke) {
+  GenerateVarHandleGetAndUpdate(invoke, codegen_, GetAndUpdateOp::kAnd, std::memory_order_acquire);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetAndBitwiseAndRelease(HInvoke* invoke) {
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kAnd);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetAndBitwiseAndRelease(HInvoke* invoke) {
+  GenerateVarHandleGetAndUpdate(invoke, codegen_, GetAndUpdateOp::kAnd, std::memory_order_release);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetAndBitwiseOr(HInvoke* invoke) {
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kOr);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetAndBitwiseOr(HInvoke* invoke) {
+  GenerateVarHandleGetAndUpdate(invoke, codegen_, GetAndUpdateOp::kOr, std::memory_order_seq_cst);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetAndBitwiseOrAcquire(HInvoke* invoke) {
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kOr);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetAndBitwiseOrAcquire(HInvoke* invoke) {
+  GenerateVarHandleGetAndUpdate(invoke, codegen_, GetAndUpdateOp::kOr, std::memory_order_acquire);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetAndBitwiseOrRelease(HInvoke* invoke) {
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kOr);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetAndBitwiseOrRelease(HInvoke* invoke) {
+  GenerateVarHandleGetAndUpdate(invoke, codegen_, GetAndUpdateOp::kOr, std::memory_order_release);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetAndBitwiseXor(HInvoke* invoke) {
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kXor);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetAndBitwiseXor(HInvoke* invoke) {
+  GenerateVarHandleGetAndUpdate(invoke, codegen_, GetAndUpdateOp::kXor, std::memory_order_seq_cst);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetAndBitwiseXorAcquire(HInvoke* invoke) {
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kXor);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetAndBitwiseXorAcquire(HInvoke* invoke) {
+  GenerateVarHandleGetAndUpdate(invoke, codegen_, GetAndUpdateOp::kXor, std::memory_order_acquire);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitVarHandleGetAndBitwiseXorRelease(HInvoke* invoke) {
+  CreateVarHandleGetAndUpdateLocations(invoke, codegen_, GetAndUpdateOp::kXor);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitVarHandleGetAndBitwiseXorRelease(HInvoke* invoke) {
+  GenerateVarHandleGetAndUpdate(invoke, codegen_, GetAndUpdateOp::kXor, std::memory_order_release);
+}
+
+void VarHandleSlowPathRISCV64::EmitByteArrayViewCode(CodeGenerator* codegen_in) {
+  DCHECK(GetByteArrayViewCheckLabel()->IsLinked());
+  CodeGeneratorRISCV64* codegen = down_cast<CodeGeneratorRISCV64*>(codegen_in);
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  HInvoke* invoke = GetInvoke();
+  mirror::VarHandle::AccessModeTemplate access_mode_template = GetAccessModeTemplate();
+  DataType::Type value_type =
+      GetVarHandleExpectedValueType(invoke, /*expected_coordinates_count=*/ 2u);
+  DCHECK_NE(value_type, DataType::Type::kReference);
+  size_t size = DataType::Size(value_type);
+  DCHECK_GT(size, 1u);
+  LocationSummary* locations = invoke->GetLocations();
+  XRegister varhandle = locations->InAt(0).AsRegister<XRegister>();
+  XRegister object = locations->InAt(1).AsRegister<XRegister>();
+  XRegister index = locations->InAt(2).AsRegister<XRegister>();
+
+  MemberOffset class_offset = mirror::Object::ClassOffset();
+  MemberOffset array_length_offset = mirror::Array::LengthOffset();
+  MemberOffset data_offset = mirror::Array::DataOffset(Primitive::kPrimByte);
+  MemberOffset native_byte_order_offset = mirror::ByteArrayViewVarHandle::NativeByteOrderOffset();
+
+  __ Bind(GetByteArrayViewCheckLabel());
+
+  VarHandleTarget target = GetVarHandleTarget(invoke);
+  {
+    ScratchRegisterScope srs(assembler);
+    XRegister temp = srs.AllocateXRegister();
+    XRegister temp2 = srs.AllocateXRegister();
+
+    // The main path checked that the coordinateType0 is an array class that matches
+    // the class of the actual coordinate argument but it does not match the value type.
+    // Check if the `varhandle` references a ByteArrayViewVarHandle instance.
+    __ Loadwu(temp, varhandle, class_offset.Int32Value());
+    codegen->MaybeUnpoisonHeapReference(temp);
+    codegen->LoadClassRootForIntrinsic(temp2, ClassRoot::kJavaLangInvokeByteArrayViewVarHandle);
+    __ Bne(temp, temp2, GetEntryLabel());
+
+    // Check for array index out of bounds.
+    __ Loadw(temp, object, array_length_offset.Int32Value());
+    __ Bgeu(index, temp, GetEntryLabel());
+    __ Addi(temp2, index, size - 1u);
+    __ Bgeu(temp2, temp, GetEntryLabel());
+
+    // Construct the target.
+    __ Addi(target.offset, index, data_offset.Int32Value());
+
+    // Alignment check. For unaligned access, go to the runtime.
+    DCHECK(IsPowerOfTwo(size));
+    __ Andi(temp, target.offset, size - 1u);
+    __ Bnez(temp, GetEntryLabel());
+
+    // Byte order check. For native byte order return to the main path.
+    if (access_mode_template == mirror::VarHandle::AccessModeTemplate::kSet &&
+        IsZeroBitPattern(invoke->InputAt(invoke->GetNumberOfArguments() - 1u))) {
+      // There is no reason to differentiate between native byte order and byte-swap
+      // for setting a zero bit pattern. Just return to the main path.
+      __ J(GetNativeByteOrderLabel());
+      return;
+    }
+    __ Loadbu(temp, varhandle, native_byte_order_offset.Int32Value());
+    __ Bnez(temp, GetNativeByteOrderLabel());
+  }
+
+  switch (access_mode_template) {
+    case mirror::VarHandle::AccessModeTemplate::kGet:
+      GenerateVarHandleGet(invoke, codegen, order_, /*byte_swap=*/ true);
+      break;
+    case mirror::VarHandle::AccessModeTemplate::kSet:
+      GenerateVarHandleSet(invoke, codegen, order_, /*byte_swap=*/ true);
+      break;
+    case mirror::VarHandle::AccessModeTemplate::kCompareAndSet:
+    case mirror::VarHandle::AccessModeTemplate::kCompareAndExchange:
+      GenerateVarHandleCompareAndSetOrExchange(
+          invoke, codegen, order_, return_success_, strong_, /*byte_swap=*/ true);
+      break;
+    case mirror::VarHandle::AccessModeTemplate::kGetAndUpdate:
+      GenerateVarHandleGetAndUpdate(
+          invoke, codegen, get_and_update_op_, order_, /*byte_swap=*/ true);
+      break;
+  }
+  __ J(GetExitLabel());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitThreadCurrentThread(HInvoke* invoke) {
+  LocationSummary* locations =
+      new (allocator_) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
+  locations->SetOut(Location::RequiresRegister());
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitThreadCurrentThread(HInvoke* invoke) {
+  Riscv64Assembler* assembler = GetAssembler();
+  XRegister out = invoke->GetLocations()->Out().AsRegister<XRegister>();
+  __ Loadwu(out, TR, Thread::PeerOffset<kRiscv64PointerSize>().Int32Value());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitThreadInterrupted(HInvoke* invoke) {
+  LocationSummary* locations =
+      new (allocator_) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
+  locations->SetOut(Location::RequiresRegister());
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitThreadInterrupted(HInvoke* invoke) {
+  LocationSummary* locations = invoke->GetLocations();
+  Riscv64Assembler* assembler = GetAssembler();
+  XRegister out = locations->Out().AsRegister<XRegister>();
+  Riscv64Label done;
+
+  codegen_->GenerateMemoryBarrier(MemBarrierKind::kAnyAny);
+  __ Loadw(out, TR, Thread::InterruptedOffset<kRiscv64PointerSize>().Int32Value());
+  __ Beqz(out, &done);
+  __ Storew(Zero, TR, Thread::InterruptedOffset<kRiscv64PointerSize>().Int32Value());
+  codegen_->GenerateMemoryBarrier(MemBarrierKind::kAnyAny);
+  __ Bind(&done);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitReachabilityFence(HInvoke* invoke) {
+  LocationSummary* locations =
+      new (allocator_) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
+  locations->SetInAt(0, Location::Any());
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitReachabilityFence([[maybe_unused]] HInvoke* invoke) {}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathFmaDouble(HInvoke* invoke) {
+  CreateFpFpFpToFpNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathFmaDouble(HInvoke* invoke) {
+  LocationSummary* locations = invoke->GetLocations();
+  Riscv64Assembler* assembler = GetAssembler();
+  FRegister n = locations->InAt(0).AsFpuRegister<FRegister>();
+  FRegister m = locations->InAt(1).AsFpuRegister<FRegister>();
+  FRegister a = locations->InAt(2).AsFpuRegister<FRegister>();
+  FRegister out = locations->Out().AsFpuRegister<FRegister>();
+
+  __ FMAddD(out, n, m, a);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathFmaFloat(HInvoke* invoke) {
+  CreateFpFpFpToFpNoOverlapLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathFmaFloat(HInvoke* invoke) {
+  LocationSummary* locations = invoke->GetLocations();
+  Riscv64Assembler* assembler = GetAssembler();
+  FRegister n = locations->InAt(0).AsFpuRegister<FRegister>();
+  FRegister m = locations->InAt(1).AsFpuRegister<FRegister>();
+  FRegister a = locations->InAt(2).AsFpuRegister<FRegister>();
+  FRegister out = locations->Out().AsFpuRegister<FRegister>();
+
+  __ FMAddS(out, n, m, a);
+}
+
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathCos(HInvoke* invoke) {
+  CreateFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathCos(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickCos, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathSin(HInvoke* invoke) {
+  CreateFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathSin(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickSin, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathAcos(HInvoke* invoke) {
+  CreateFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathAcos(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickAcos, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathAsin(HInvoke* invoke) {
+  CreateFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathAsin(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickAsin, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathAtan(HInvoke* invoke) {
+  CreateFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathAtan(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickAtan, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathAtan2(HInvoke* invoke) {
+  CreateFPFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathAtan2(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickAtan2, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathPow(HInvoke* invoke) {
+  CreateFPFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathPow(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickPow, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathCbrt(HInvoke* invoke) {
+  CreateFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathCbrt(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickCbrt, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathCosh(HInvoke* invoke) {
+  CreateFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathCosh(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickCosh, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathExp(HInvoke* invoke) {
+  CreateFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathExp(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickExp, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathExpm1(HInvoke* invoke) {
+  CreateFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathExpm1(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickExpm1, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathHypot(HInvoke* invoke) {
+  CreateFPFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathHypot(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickHypot, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathLog(HInvoke* invoke) {
+  CreateFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathLog(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickLog, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathLog10(HInvoke* invoke) {
+  CreateFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathLog10(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickLog10, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathNextAfter(HInvoke* invoke) {
+  CreateFPFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathNextAfter(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickNextAfter, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathSinh(HInvoke* invoke) {
+  CreateFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathSinh(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickSinh, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathTan(HInvoke* invoke) {
+  CreateFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathTan(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickTan, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathTanh(HInvoke* invoke) {
+  CreateFPToFPCallLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathTanh(HInvoke* invoke) {
+  codegen_->InvokeRuntime(kQuickTanh, invoke, invoke->GetDexPc());
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathSqrt(HInvoke* invoke) {
+  CreateFPToFPLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathSqrt(HInvoke* invoke) {
+  DCHECK_EQ(invoke->InputAt(0)->GetType(), DataType::Type::kFloat64);
+  DCHECK_EQ(invoke->GetType(), DataType::Type::kFloat64);
+
+  LocationSummary* locations = invoke->GetLocations();
+  Riscv64Assembler* assembler = GetAssembler();
+  FRegister in = locations->InAt(0).AsFpuRegister<FRegister>();
+  FRegister out = locations->Out().AsFpuRegister<FRegister>();
+
+  __ FSqrtD(out, in);
+}
+
+static void GenDoubleRound(Riscv64Assembler* assembler, HInvoke* invoke, FPRoundingMode mode) {
+  LocationSummary* locations = invoke->GetLocations();
+  FRegister in = locations->InAt(0).AsFpuRegister<FRegister>();
+  FRegister out = locations->Out().AsFpuRegister<FRegister>();
+  ScratchRegisterScope srs(assembler);
+  XRegister tmp = srs.AllocateXRegister();
+  FRegister ftmp = srs.AllocateFRegister();
+  Riscv64Label done;
+
+  // Load 2^52
+  __ LoadConst64(tmp, 0x4330000000000000L);
+  __ FMvDX(ftmp, tmp);
+  __ FAbsD(out, in);
+  __ FLtD(tmp, out, ftmp);
+
+  // Set output as the input if input greater than the max
+  __ FMvD(out, in);
+  __ Beqz(tmp, &done);
+
+  // Convert with rounding mode
+  __ FCvtLD(tmp, in, mode);
+  __ FCvtDL(ftmp, tmp, mode);
+
+  // Set the signed bit
+  __ FSgnjD(out, ftmp, in);
+  __ Bind(&done);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathFloor(HInvoke* invoke) {
+  CreateFPToFPLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathFloor(HInvoke* invoke) {
+  GenDoubleRound(GetAssembler(), invoke, FPRoundingMode::kRDN);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathCeil(HInvoke* invoke) {
+  CreateFPToFPLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathCeil(HInvoke* invoke) {
+  GenDoubleRound(GetAssembler(), invoke, FPRoundingMode::kRUP);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathRint(HInvoke* invoke) {
+  CreateFPToFPLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathRint(HInvoke* invoke) {
+  GenDoubleRound(GetAssembler(), invoke, FPRoundingMode::kRNE);
+}
+
+void GenMathRound(CodeGeneratorRISCV64* codegen, HInvoke* invoke, DataType::Type type) {
+  Riscv64Assembler* assembler = codegen->GetAssembler();
+  LocationSummary* locations = invoke->GetLocations();
+  FRegister in = locations->InAt(0).AsFpuRegister<FRegister>();
+  XRegister out = locations->Out().AsRegister<XRegister>();
+  ScratchRegisterScope srs(assembler);
+  FRegister ftmp = srs.AllocateFRegister();
+  Riscv64Label done;
+
+  // Check NaN
+  codegen->GetInstructionVisitor()->FClass(out, in, type);
+  __ Slti(out, out, kFClassNaNMinValue);
+  __ Beqz(out, &done);
+
+  if (type == DataType::Type::kFloat64) {
+    // Add 0.5 (0x3fe0000000000000), rounding down (towards negative infinity).
+    __ LoadConst64(out, 0x3fe0000000000000L);
+    __ FMvDX(ftmp, out);
+    __ FAddD(ftmp, ftmp, in, FPRoundingMode::kRDN);
+
+    // Convert to managed `long`, rounding down (towards negative infinity).
+    __ FCvtLD(out, ftmp, FPRoundingMode::kRDN);
+  } else {
+    // Add 0.5 (0x3f000000), rounding down (towards negative infinity).
+    __ LoadConst32(out, 0x3f000000);
+    __ FMvWX(ftmp, out);
+    __ FAddS(ftmp, ftmp, in, FPRoundingMode::kRDN);
+
+    // Convert to managed `int`, rounding down (towards negative infinity).
+    __ FCvtWS(out, ftmp, FPRoundingMode::kRDN);
+  }
+
+  __ Bind(&done);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathRoundDouble(HInvoke* invoke) {
+  CreateFPToIntLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathRoundDouble(HInvoke* invoke) {
+  GenMathRound(codegen_, invoke, DataType::Type::kFloat64);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathRoundFloat(HInvoke* invoke) {
+  CreateFPToIntLocations(allocator_, invoke);
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathRoundFloat(HInvoke* invoke) {
+  GenMathRound(codegen_, invoke, DataType::Type::kFloat32);
+}
+
+void IntrinsicLocationsBuilderRISCV64::VisitMathMultiplyHigh(HInvoke* invoke) {
+  LocationSummary* locations =
+      new (allocator_) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
+  locations->SetInAt(0, Location::RequiresRegister());
+  locations->SetInAt(1, Location::RequiresRegister());
+  locations->SetOut(Location::RequiresRegister());
+}
+
+void IntrinsicCodeGeneratorRISCV64::VisitMathMultiplyHigh(HInvoke* invoke) {
+  LocationSummary* locations = invoke->GetLocations();
+  Riscv64Assembler* assembler = GetAssembler();
+  DCHECK(invoke->GetType() == DataType::Type::kInt64);
+
+  XRegister x = locations->InAt(0).AsRegister<XRegister>();
+  XRegister y = locations->InAt(1).AsRegister<XRegister>();
+  XRegister out = locations->Out().AsRegister<XRegister>();
+
+  // Get high 64 of the multiply
+  __ Mulh(out, x, y);
+}
+
+#define MARK_UNIMPLEMENTED(Name) UNIMPLEMENTED_INTRINSIC(RISCV64, Name)
+UNIMPLEMENTED_INTRINSIC_LIST_RISCV64(MARK_UNIMPLEMENTED);
+#undef MARK_UNIMPLEMENTED
+
+UNREACHABLE_INTRINSICS(RISCV64)
+
+}  // namespace riscv64
+}  // namespace art
diff --git a/compiler/optimizing/intrinsics_riscv64.h b/compiler/optimizing/intrinsics_riscv64.h
new file mode 100644
index 0000000..43068c0
--- /dev/null
+++ b/compiler/optimizing/intrinsics_riscv64.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_COMPILER_OPTIMIZING_INTRINSICS_RISCV64_H_
+#define ART_COMPILER_OPTIMIZING_INTRINSICS_RISCV64_H_
+
+#include "base/macros.h"
+#include "intrinsics.h"
+#include "intrinsics_list.h"
+
+namespace art HIDDEN {
+
+class ArenaAllocator;
+class HInvokeStaticOrDirect;
+class HInvokeVirtual;
+
+namespace riscv64 {
+
+class CodeGeneratorRISCV64;
+class Riscv64Assembler;
+
+class IntrinsicLocationsBuilderRISCV64 final : public IntrinsicVisitor {
+ public:
+  explicit IntrinsicLocationsBuilderRISCV64(ArenaAllocator* allocator,
+                                            CodeGeneratorRISCV64* codegen)
+      : allocator_(allocator), codegen_(codegen) {}
+
+  // Define visitor methods.
+
+#define OPTIMIZING_INTRINSICS(Name, ...) \
+  void Visit##Name(HInvoke* invoke) override;
+  ART_INTRINSICS_WITH_HINVOKE_LIST(OPTIMIZING_INTRINSICS)
+#undef OPTIMIZING_INTRINSICS
+
+  // Check whether an invoke is an intrinsic, and if so, create a location summary. Returns whether
+  // a corresponding LocationSummary with the intrinsified_ flag set was generated and attached to
+  // the invoke.
+  bool TryDispatch(HInvoke* invoke);
+
+ private:
+  ArenaAllocator* const allocator_;
+  CodeGeneratorRISCV64* const codegen_;
+
+  DISALLOW_COPY_AND_ASSIGN(IntrinsicLocationsBuilderRISCV64);
+};
+
+class IntrinsicCodeGeneratorRISCV64 final : public IntrinsicVisitor {
+ public:
+  explicit IntrinsicCodeGeneratorRISCV64(CodeGeneratorRISCV64* codegen) : codegen_(codegen) {}
+
+  // Define visitor methods.
+
+#define OPTIMIZING_INTRINSICS(Name, ...) \
+  void Visit##Name(HInvoke* invoke);
+  ART_INTRINSICS_WITH_HINVOKE_LIST(OPTIMIZING_INTRINSICS)
+#undef OPTIMIZING_INTRINSICS
+
+ private:
+  Riscv64Assembler* GetAssembler();
+  ArenaAllocator* GetAllocator();
+
+  void HandleValueOf(HInvoke* invoke,
+                     const IntrinsicVisitor::ValueOfInfo& info,
+                     DataType::Type type);
+
+  CodeGeneratorRISCV64* const codegen_;
+
+  DISALLOW_COPY_AND_ASSIGN(IntrinsicCodeGeneratorRISCV64);
+};
+
+}  // namespace riscv64
+}  // namespace art
+
+#endif  // ART_COMPILER_OPTIMIZING_INTRINSICS_RISCV64_H_
diff --git a/compiler/optimizing/intrinsics_utils.h b/compiler/optimizing/intrinsics_utils.h
index 13cabda..590bc34 100644
--- a/compiler/optimizing/intrinsics_utils.h
+++ b/compiler/optimizing/intrinsics_utils.h
@@ -153,24 +153,34 @@
   return access_mode == mirror::VarHandle::AccessModeTemplate::kGet;
 }
 
-static inline bool IsUnsafeGetObject(HInvoke* invoke) {
+static inline bool IsUnsafeGetReference(HInvoke* invoke) {
   switch (invoke->GetIntrinsic()) {
     case Intrinsics::kUnsafeGetObject:
     case Intrinsics::kUnsafeGetObjectVolatile:
-    case Intrinsics::kJdkUnsafeGetObject:
-    case Intrinsics::kJdkUnsafeGetObjectVolatile:
-    case Intrinsics::kJdkUnsafeGetObjectAcquire:
+    case Intrinsics::kJdkUnsafeGetReference:
+    case Intrinsics::kJdkUnsafeGetReferenceVolatile:
+    case Intrinsics::kJdkUnsafeGetReferenceAcquire:
       return true;
     default:
       return false;
   }
 }
 
-static inline bool IsUnsafeCASObject(HInvoke* invoke) {
+static inline bool IsUnsafeCASReference(HInvoke* invoke) {
   switch (invoke->GetIntrinsic()) {
     case Intrinsics::kUnsafeCASObject:
     case Intrinsics::kJdkUnsafeCASObject:
-    case Intrinsics::kJdkUnsafeCompareAndSetObject:
+    case Intrinsics::kJdkUnsafeCompareAndSetReference:
+      return true;
+    default:
+      return false;
+  }
+}
+
+static inline bool IsUnsafeGetAndSetReference(HInvoke* invoke) {
+  switch (invoke->GetIntrinsic()) {
+    case Intrinsics::kUnsafeGetAndSetObject:
+    case Intrinsics::kJdkUnsafeGetAndSetReference:
       return true;
     default:
       return false;
diff --git a/compiler/optimizing/intrinsics_x86.cc b/compiler/optimizing/intrinsics_x86.cc
index 345e9c6..b21f36c 100644
--- a/compiler/optimizing/intrinsics_x86.cc
+++ b/compiler/optimizing/intrinsics_x86.cc
@@ -25,6 +25,7 @@
 #include "data_type-inl.h"
 #include "entrypoints/quick/quick_entrypoints.h"
 #include "heap_poisoning.h"
+#include "intrinsic_objects.h"
 #include "intrinsics.h"
 #include "intrinsics_utils.h"
 #include "lock_word.h"
@@ -37,6 +38,7 @@
 #include "thread-current-inl.h"
 #include "utils/x86/assembler_x86.h"
 #include "utils/x86/constants_x86.h"
+#include "well_known_classes.h"
 
 namespace art HIDDEN {
 
@@ -67,20 +69,34 @@
 
 using IntrinsicSlowPathX86 = IntrinsicSlowPath<InvokeDexCallingConventionVisitorX86>;
 
-// NOLINT on __ macro to suppress wrong warning/fix (misc-macro-parentheses) from clang-tidy.
-#define __ down_cast<X86Assembler*>(codegen->GetAssembler())->  // NOLINT
+#define __ assembler->
+
+static void GenArrayAddress(X86Assembler* assembler,
+                            Register dest,
+                            Register base,
+                            Location pos,
+                            DataType::Type type,
+                            uint32_t data_offset) {
+  if (pos.IsConstant()) {
+    int32_t constant = pos.GetConstant()->AsIntConstant()->GetValue();
+    __ leal(dest, Address(base, DataType::Size(type) * constant + data_offset));
+  } else {
+    const ScaleFactor scale_factor = static_cast<ScaleFactor>(DataType::SizeShift(type));
+    __ leal(dest, Address(base, pos.AsRegister<Register>(), scale_factor, data_offset));
+  }
+}
 
 // Slow path implementing the SystemArrayCopy intrinsic copy loop with read barriers.
 class ReadBarrierSystemArrayCopySlowPathX86 : public SlowPathCode {
  public:
   explicit ReadBarrierSystemArrayCopySlowPathX86(HInstruction* instruction)
       : SlowPathCode(instruction) {
-    DCHECK(gUseReadBarrier);
-    DCHECK(kUseBakerReadBarrier);
   }
 
   void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitBakerReadBarrier());
     CodeGeneratorX86* x86_codegen = down_cast<CodeGeneratorX86*>(codegen);
+    X86Assembler* assembler = x86_codegen->GetAssembler();
     LocationSummary* locations = instruction_->GetLocations();
     DCHECK(locations->CanCall());
     DCHECK(instruction_->IsInvokeStaticOrDirect())
@@ -88,45 +104,24 @@
         << instruction_->DebugName();
     DCHECK(instruction_->GetLocations()->Intrinsified());
     DCHECK_EQ(instruction_->AsInvoke()->GetIntrinsic(), Intrinsics::kSystemArrayCopy);
-
-    int32_t element_size = DataType::Size(DataType::Type::kReference);
-    uint32_t offset = mirror::Array::DataOffset(element_size).Uint32Value();
-
-    Register src = locations->InAt(0).AsRegister<Register>();
-    Location src_pos = locations->InAt(1);
-    Register dest = locations->InAt(2).AsRegister<Register>();
-    Location dest_pos = locations->InAt(3);
     Location length = locations->InAt(4);
-    Location temp1_loc = locations->GetTemp(0);
-    Register temp1 = temp1_loc.AsRegister<Register>();
-    Register temp2 = locations->GetTemp(1).AsRegister<Register>();
-    Register temp3 = locations->GetTemp(2).AsRegister<Register>();
+
+    const DataType::Type type = DataType::Type::kReference;
+    const int32_t element_size = DataType::Size(type);
+
+    Register src_curr_addr = locations->GetTemp(0).AsRegister<Register>();
+    Register dst_curr_addr = locations->GetTemp(1).AsRegister<Register>();
+    Register src_stop_addr = locations->GetTemp(2).AsRegister<Register>();
+    Register value = locations->GetTemp(3).AsRegister<Register>();
 
     __ Bind(GetEntryLabel());
-    // In this code path, registers `temp1`, `temp2`, and `temp3`
-    // (resp.) are not used for the base source address, the base
-    // destination address, and the end source address (resp.), as in
-    // other SystemArrayCopy intrinsic code paths.  Instead they are
-    // (resp.) used for:
-    // - the loop index (`i`);
-    // - the source index (`src_index`) and the loaded (source)
-    //   reference (`value`); and
-    // - the destination index (`dest_index`).
+    // The `src_curr_addr` and `dst_curr_addr` were initialized before entering the slow-path.
+    GenArrayAddress(assembler, src_stop_addr, src_curr_addr, length, type, /*data_offset=*/ 0u);
 
-    // i = 0
-    __ xorl(temp1, temp1);
     NearLabel loop;
     __ Bind(&loop);
-    // value = src_array[i + src_pos]
-    if (src_pos.IsConstant()) {
-      int32_t constant = src_pos.GetConstant()->AsIntConstant()->GetValue();
-      int32_t adjusted_offset = offset + constant * element_size;
-      __ movl(temp2, Address(src, temp1, ScaleFactor::TIMES_4, adjusted_offset));
-    } else {
-      __ leal(temp2, Address(src_pos.AsRegister<Register>(), temp1, ScaleFactor::TIMES_1, 0));
-      __ movl(temp2, Address(src, temp2, ScaleFactor::TIMES_4, offset));
-    }
-    __ MaybeUnpoisonHeapReference(temp2);
+    __ movl(value, Address(src_curr_addr, 0));
+    __ MaybeUnpoisonHeapReference(value);
     // TODO: Inline the mark bit check before calling the runtime?
     // value = ReadBarrier::Mark(value)
     // No need to save live registers; it's taken care of by the
@@ -134,25 +129,14 @@
     // as this runtime call will not trigger a garbage collection.
     // (See ReadBarrierMarkSlowPathX86::EmitNativeCode for more
     // explanations.)
-    DCHECK_NE(temp2, ESP);
-    DCHECK(0 <= temp2 && temp2 < kNumberOfCpuRegisters) << temp2;
-    int32_t entry_point_offset = Thread::ReadBarrierMarkEntryPointsOffset<kX86PointerSize>(temp2);
+    int32_t entry_point_offset = Thread::ReadBarrierMarkEntryPointsOffset<kX86PointerSize>(value);
     // This runtime call does not require a stack map.
     x86_codegen->InvokeRuntimeWithoutRecordingPcInfo(entry_point_offset, instruction_, this);
-    __ MaybePoisonHeapReference(temp2);
-    // dest_array[i + dest_pos] = value
-    if (dest_pos.IsConstant()) {
-      int32_t constant = dest_pos.GetConstant()->AsIntConstant()->GetValue();
-      int32_t adjusted_offset = offset + constant * element_size;
-      __ movl(Address(dest, temp1, ScaleFactor::TIMES_4, adjusted_offset), temp2);
-    } else {
-      __ leal(temp3, Address(dest_pos.AsRegister<Register>(), temp1, ScaleFactor::TIMES_1, 0));
-      __ movl(Address(dest, temp3, ScaleFactor::TIMES_4, offset), temp2);
-    }
-    // ++i
-    __ addl(temp1, Immediate(1));
-    // if (i != length) goto loop
-    x86_codegen->GenerateIntCompare(temp1_loc, length);
+    __ MaybePoisonHeapReference(value);
+    __ movl(Address(dst_curr_addr, 0), value);
+    __ addl(src_curr_addr, Immediate(element_size));
+    __ addl(dst_curr_addr, Immediate(element_size));
+    __ cmpl(src_curr_addr, src_stop_addr);
     __ j(kNotEqual, &loop);
     __ jmp(GetExitLabel());
   }
@@ -163,10 +147,6 @@
   DISALLOW_COPY_AND_ASSIGN(ReadBarrierSystemArrayCopySlowPathX86);
 };
 
-#undef __
-
-#define __ assembler->
-
 static void CreateFPToIntLocations(ArenaAllocator* allocator, HInvoke* invoke, bool is64bit) {
   LocationSummary* locations =
       new (allocator) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
@@ -394,7 +374,6 @@
   }
 
   HInvokeStaticOrDirect* static_or_direct = invoke->AsInvokeStaticOrDirect();
-  DCHECK(static_or_direct != nullptr);
   LocationSummary* locations =
       new (allocator_) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
   locations->SetInAt(0, Location::RequiresFpuRegister());
@@ -774,9 +753,9 @@
 static void CreateSystemArrayCopyLocations(HInvoke* invoke) {
   // We need at least two of the positions or length to be an integer constant,
   // or else we won't have enough free registers.
-  HIntConstant* src_pos = invoke->InputAt(1)->AsIntConstant();
-  HIntConstant* dest_pos = invoke->InputAt(3)->AsIntConstant();
-  HIntConstant* length = invoke->InputAt(4)->AsIntConstant();
+  HIntConstant* src_pos = invoke->InputAt(1)->AsIntConstantOrNull();
+  HIntConstant* dest_pos = invoke->InputAt(3)->AsIntConstantOrNull();
+  HIntConstant* length = invoke->InputAt(4)->AsIntConstantOrNull();
 
   int num_constants =
       ((src_pos != nullptr) ? 1 : 0)
@@ -816,50 +795,56 @@
   locations->SetInAt(3, Location::RegisterOrConstant(invoke->InputAt(3)));
   locations->SetInAt(4, Location::RegisterOrConstant(invoke->InputAt(4)));
 
-  // And we need some temporaries.  We will use REP MOVSW, so we need fixed registers.
+  // And we need some temporaries.  We will use REP MOVS{B,W,L}, so we need fixed registers.
   locations->AddTemp(Location::RegisterLocation(ESI));
   locations->AddTemp(Location::RegisterLocation(EDI));
   locations->AddTemp(Location::RegisterLocation(ECX));
 }
 
-static void CheckPosition(X86Assembler* assembler,
-                          Location pos,
-                          Register input,
-                          Location length,
-                          SlowPathCode* slow_path,
-                          Register temp,
-                          bool length_is_input_length = false) {
+template <typename LhsType>
+static void EmitCmplJLess(X86Assembler* assembler,
+                          LhsType lhs,
+                          Location rhs,
+                          Label* label) {
+  static_assert(std::is_same_v<LhsType, Register> || std::is_same_v<LhsType, Address>);
+  if (rhs.IsConstant()) {
+    int32_t rhs_constant = rhs.GetConstant()->AsIntConstant()->GetValue();
+    __ cmpl(lhs, Immediate(rhs_constant));
+  } else {
+    __ cmpl(lhs, rhs.AsRegister<Register>());
+  }
+  __ j(kLess, label);
+}
+
+static void CheckSystemArrayCopyPosition(X86Assembler* assembler,
+                                         Register array,
+                                         Location pos,
+                                         Location length,
+                                         SlowPathCode* slow_path,
+                                         Register temp,
+                                         bool length_is_array_length,
+                                         bool position_sign_checked) {
   // Where is the length in the Array?
   const uint32_t length_offset = mirror::Array::LengthOffset().Uint32Value();
 
   if (pos.IsConstant()) {
     int32_t pos_const = pos.GetConstant()->AsIntConstant()->GetValue();
     if (pos_const == 0) {
-      if (!length_is_input_length) {
-        // Check that length(input) >= length.
-        if (length.IsConstant()) {
-          __ cmpl(Address(input, length_offset),
-                  Immediate(length.GetConstant()->AsIntConstant()->GetValue()));
-        } else {
-          __ cmpl(Address(input, length_offset), length.AsRegister<Register>());
-        }
-        __ j(kLess, slow_path->GetEntryLabel());
+      if (!length_is_array_length) {
+        // Check that length(array) >= length.
+        EmitCmplJLess(assembler, Address(array, length_offset), length, slow_path->GetEntryLabel());
       }
     } else {
-      // Check that length(input) >= pos.
-      __ movl(temp, Address(input, length_offset));
+      // Calculate length(array) - pos.
+      // Both operands are known to be non-negative `int32_t`, so the difference cannot underflow
+      // as `int32_t`. If the result is negative, the JL below shall go to the slow path.
+      __ movl(temp, Address(array, length_offset));
       __ subl(temp, Immediate(pos_const));
-      __ j(kLess, slow_path->GetEntryLabel());
 
-      // Check that (length(input) - pos) >= length.
-      if (length.IsConstant()) {
-        __ cmpl(temp, Immediate(length.GetConstant()->AsIntConstant()->GetValue()));
-      } else {
-        __ cmpl(temp, length.AsRegister<Register>());
-      }
-      __ j(kLess, slow_path->GetEntryLabel());
+      // Check that (length(array) - pos) >= length.
+      EmitCmplJLess(assembler, temp, length, slow_path->GetEntryLabel());
     }
-  } else if (length_is_input_length) {
+  } else if (length_is_array_length) {
     // The only way the copy can succeed is if pos is zero.
     Register pos_reg = pos.AsRegister<Register>();
     __ testl(pos_reg, pos_reg);
@@ -867,22 +852,19 @@
   } else {
     // Check that pos >= 0.
     Register pos_reg = pos.AsRegister<Register>();
-    __ testl(pos_reg, pos_reg);
-    __ j(kLess, slow_path->GetEntryLabel());
-
-    // Check that pos <= length(input).
-    __ cmpl(Address(input, length_offset), pos_reg);
-    __ j(kLess, slow_path->GetEntryLabel());
-
-    // Check that (length(input) - pos) >= length.
-    __ movl(temp, Address(input, length_offset));
-    __ subl(temp, pos_reg);
-    if (length.IsConstant()) {
-      __ cmpl(temp, Immediate(length.GetConstant()->AsIntConstant()->GetValue()));
-    } else {
-      __ cmpl(temp, length.AsRegister<Register>());
+    if (!position_sign_checked) {
+      __ testl(pos_reg, pos_reg);
+      __ j(kLess, slow_path->GetEntryLabel());
     }
-    __ j(kLess, slow_path->GetEntryLabel());
+
+    // Calculate length(array) - pos.
+    // Both operands are known to be non-negative `int32_t`, so the difference cannot underflow
+    // as `int32_t`. If the result is negative, the JL below shall go to the slow path.
+    __ movl(temp, Address(array, length_offset));
+    __ subl(temp, pos_reg);
+
+    // Check that (length(array) - pos) >= length.
+    EmitCmplJLess(assembler, temp, length, slow_path->GetEntryLabel());
   }
 }
 
@@ -935,29 +917,32 @@
   }
 
   // Validity checks: source. Use src_base as a temporary register.
-  CheckPosition(assembler, src_pos, src, Location::RegisterLocation(count), slow_path, src_base);
+  CheckSystemArrayCopyPosition(assembler,
+                               src,
+                               src_pos,
+                               Location::RegisterLocation(count),
+                               slow_path,
+                               src_base,
+                               /*length_is_array_length=*/ false,
+                               /*position_sign_checked=*/ false);
 
   // Validity checks: dest. Use src_base as a temporary register.
-  CheckPosition(assembler, dest_pos, dest, Location::RegisterLocation(count), slow_path, src_base);
+  CheckSystemArrayCopyPosition(assembler,
+                               dest,
+                               dest_pos,
+                               Location::RegisterLocation(count),
+                               slow_path,
+                               src_base,
+                               /*length_is_array_length=*/ false,
+                               /*position_sign_checked=*/ false);
 
   // Okay, everything checks out.  Finally time to do the copy.
   // Check assumption that sizeof(Char) is 2 (used in scaling below).
   const size_t data_size = DataType::Size(type);
-  const ScaleFactor scale_factor = CodeGenerator::ScaleFactorForType(type);
   const uint32_t data_offset = mirror::Array::DataOffset(data_size).Uint32Value();
 
-  if (src_pos.IsConstant()) {
-    int32_t src_pos_const = src_pos.GetConstant()->AsIntConstant()->GetValue();
-    __ leal(src_base, Address(src, data_size * src_pos_const + data_offset));
-  } else {
-    __ leal(src_base, Address(src, src_pos.AsRegister<Register>(), scale_factor, data_offset));
-  }
-  if (dest_pos.IsConstant()) {
-    int32_t dest_pos_const = dest_pos.GetConstant()->AsIntConstant()->GetValue();
-    __ leal(dest_base, Address(dest, data_size * dest_pos_const + data_offset));
-  } else {
-    __ leal(dest_base, Address(dest, dest_pos.AsRegister<Register>(), scale_factor, data_offset));
-  }
+  GenArrayAddress(assembler, src_base, src, src_pos, type, data_offset);
+  GenArrayAddress(assembler, dest_base, dest, dest_pos, type, data_offset);
 
   // Do the move.
   switch (type) {
@@ -1205,7 +1190,7 @@
   HInstruction* code_point = invoke->InputAt(1);
   if (code_point->IsIntConstant()) {
     if (static_cast<uint32_t>(code_point->AsIntConstant()->GetValue()) >
-    std::numeric_limits<uint16_t>::max()) {
+        std::numeric_limits<uint16_t>::max()) {
       // Always needs the slow-path. We could directly dispatch to it, but this case should be
       // rare, so for simplicity just put the full slow-path down and branch unconditionally.
       slow_path = new (codegen->GetScopedAllocator()) IntrinsicSlowPathX86(invoke);
@@ -1445,7 +1430,7 @@
   Register obj = locations->InAt(0).AsRegister<Register>();
   Location srcBegin = locations->InAt(1);
   int srcBegin_value =
-    srcBegin.IsConstant() ? srcBegin.GetConstant()->AsIntConstant()->GetValue() : 0;
+      srcBegin.IsConstant() ? srcBegin.GetConstant()->AsIntConstant()->GetValue() : 0;
   Register srcEnd = locations->InAt(2).AsRegister<Register>();
   Register dst = locations->InAt(3).AsRegister<Register>();
   Register dstBegin = locations->InAt(4).AsRegister<Register>();
@@ -1705,7 +1690,7 @@
 
     case DataType::Type::kReference: {
       Register output = output_loc.AsRegister<Register>();
-      if (gUseReadBarrier) {
+      if (codegen->EmitReadBarrier()) {
         if (kUseBakerReadBarrier) {
           Address src(base, offset, ScaleFactor::TIMES_1, 0);
           codegen->GenerateReferenceLoadWithBakerReadBarrier(
@@ -1745,25 +1730,12 @@
   }
 }
 
-static bool UnsafeGetIntrinsicOnCallList(Intrinsics intrinsic) {
-  switch (intrinsic) {
-    case Intrinsics::kUnsafeGetObject:
-    case Intrinsics::kUnsafeGetObjectVolatile:
-    case Intrinsics::kJdkUnsafeGetObject:
-    case Intrinsics::kJdkUnsafeGetObjectVolatile:
-    case Intrinsics::kJdkUnsafeGetObjectAcquire:
-      return true;
-    default:
-      break;
-  }
-  return false;
-}
-
 static void CreateIntIntIntToIntLocations(ArenaAllocator* allocator,
                                           HInvoke* invoke,
+                                          CodeGeneratorX86* codegen,
                                           DataType::Type type,
                                           bool is_volatile) {
-  bool can_call = gUseReadBarrier && UnsafeGetIntrinsicOnCallList(invoke->GetIntrinsic());
+  bool can_call = codegen->EmitReadBarrier() && IsUnsafeGetReference(invoke);
   LocationSummary* locations =
       new (allocator) LocationSummary(invoke,
                                       can_call
@@ -1803,10 +1775,10 @@
   VisitJdkUnsafeGetLongVolatile(invoke);
 }
 void IntrinsicLocationsBuilderX86::VisitUnsafeGetObject(HInvoke* invoke) {
-  VisitJdkUnsafeGetObject(invoke);
+  VisitJdkUnsafeGetReference(invoke);
 }
 void IntrinsicLocationsBuilderX86::VisitUnsafeGetObjectVolatile(HInvoke* invoke) {
-  VisitJdkUnsafeGetObjectVolatile(invoke);
+  VisitJdkUnsafeGetReferenceVolatile(invoke);
 }
 void IntrinsicLocationsBuilderX86::VisitUnsafeGetByte(HInvoke* invoke) {
   VisitJdkUnsafeGetByte(invoke);
@@ -1825,10 +1797,10 @@
   VisitJdkUnsafeGetLongVolatile(invoke);
 }
 void IntrinsicCodeGeneratorX86::VisitUnsafeGetObject(HInvoke* invoke) {
-  VisitJdkUnsafeGetObject(invoke);
+  VisitJdkUnsafeGetReference(invoke);
 }
 void IntrinsicCodeGeneratorX86::VisitUnsafeGetObjectVolatile(HInvoke* invoke) {
-  VisitJdkUnsafeGetObjectVolatile(invoke);
+  VisitJdkUnsafeGetReferenceVolatile(invoke);
 }
 void IntrinsicCodeGeneratorX86::VisitUnsafeGetByte(HInvoke* invoke) {
   VisitJdkUnsafeGetByte(invoke);
@@ -1836,39 +1808,43 @@
 
 void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGet(HInvoke* invoke) {
   CreateIntIntIntToIntLocations(
-      allocator_, invoke, DataType::Type::kInt32, /*is_volatile=*/ false);
+      allocator_, invoke, codegen_, DataType::Type::kInt32, /*is_volatile=*/ false);
 }
 void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetVolatile(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke, DataType::Type::kInt32, /*is_volatile=*/ true);
+  CreateIntIntIntToIntLocations(
+      allocator_, invoke, codegen_, DataType::Type::kInt32, /*is_volatile=*/ true);
 }
 void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetAcquire(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke, DataType::Type::kInt32, /*is_volatile=*/ true);
+  CreateIntIntIntToIntLocations(
+      allocator_, invoke, codegen_, DataType::Type::kInt32, /*is_volatile=*/ true);
 }
 void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetLong(HInvoke* invoke) {
   CreateIntIntIntToIntLocations(
-      allocator_, invoke, DataType::Type::kInt64, /*is_volatile=*/ false);
+      allocator_, invoke, codegen_, DataType::Type::kInt64, /*is_volatile=*/ false);
 }
 void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetLongVolatile(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke, DataType::Type::kInt64, /*is_volatile=*/ true);
+  CreateIntIntIntToIntLocations(
+      allocator_, invoke, codegen_, DataType::Type::kInt64, /*is_volatile=*/ true);
 }
 void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetLongAcquire(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke, DataType::Type::kInt64, /*is_volatile=*/ true);
-}
-void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetObject(HInvoke* invoke) {
   CreateIntIntIntToIntLocations(
-      allocator_, invoke, DataType::Type::kReference, /*is_volatile=*/ false);
+      allocator_, invoke, codegen_, DataType::Type::kInt64, /*is_volatile=*/ true);
 }
-void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetObjectVolatile(HInvoke* invoke) {
+void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetReference(HInvoke* invoke) {
   CreateIntIntIntToIntLocations(
-      allocator_, invoke, DataType::Type::kReference, /*is_volatile=*/ true);
+      allocator_, invoke, codegen_, DataType::Type::kReference, /*is_volatile=*/ false);
 }
-void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetObjectAcquire(HInvoke* invoke) {
+void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetReferenceVolatile(HInvoke* invoke) {
   CreateIntIntIntToIntLocations(
-      allocator_, invoke, DataType::Type::kReference, /*is_volatile=*/ true);
+      allocator_, invoke, codegen_, DataType::Type::kReference, /*is_volatile=*/ true);
+}
+void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetReferenceAcquire(HInvoke* invoke) {
+  CreateIntIntIntToIntLocations(
+      allocator_, invoke, codegen_, DataType::Type::kReference, /*is_volatile=*/ true);
 }
 void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetByte(HInvoke* invoke) {
   CreateIntIntIntToIntLocations(
-      allocator_, invoke, DataType::Type::kInt8, /*is_volatile=*/ false);
+      allocator_, invoke, codegen_, DataType::Type::kInt8, /*is_volatile=*/ false);
 }
 
 void IntrinsicCodeGeneratorX86::VisitJdkUnsafeGet(HInvoke* invoke) {
@@ -1889,13 +1865,13 @@
 void IntrinsicCodeGeneratorX86::VisitJdkUnsafeGetLongAcquire(HInvoke* invoke) {
   GenUnsafeGet(invoke, DataType::Type::kInt64, /*is_volatile=*/ true, codegen_);
 }
-void IntrinsicCodeGeneratorX86::VisitJdkUnsafeGetObject(HInvoke* invoke) {
+void IntrinsicCodeGeneratorX86::VisitJdkUnsafeGetReference(HInvoke* invoke) {
   GenUnsafeGet(invoke, DataType::Type::kReference, /*is_volatile=*/ false, codegen_);
 }
-void IntrinsicCodeGeneratorX86::VisitJdkUnsafeGetObjectVolatile(HInvoke* invoke) {
+void IntrinsicCodeGeneratorX86::VisitJdkUnsafeGetReferenceVolatile(HInvoke* invoke) {
   GenUnsafeGet(invoke, DataType::Type::kReference, /*is_volatile=*/ true, codegen_);
 }
-void IntrinsicCodeGeneratorX86::VisitJdkUnsafeGetObjectAcquire(HInvoke* invoke) {
+void IntrinsicCodeGeneratorX86::VisitJdkUnsafeGetReferenceAcquire(HInvoke* invoke) {
   GenUnsafeGet(invoke, DataType::Type::kReference, /*is_volatile=*/ true, codegen_);
 }
 void IntrinsicCodeGeneratorX86::VisitJdkUnsafeGetByte(HInvoke* invoke) {
@@ -1933,13 +1909,13 @@
   VisitJdkUnsafePutVolatile(invoke);
 }
 void IntrinsicLocationsBuilderX86::VisitUnsafePutObject(HInvoke* invoke) {
-  VisitJdkUnsafePutObject(invoke);
+  VisitJdkUnsafePutReference(invoke);
 }
 void IntrinsicLocationsBuilderX86::VisitUnsafePutObjectOrdered(HInvoke* invoke) {
   VisitJdkUnsafePutObjectOrdered(invoke);
 }
 void IntrinsicLocationsBuilderX86::VisitUnsafePutObjectVolatile(HInvoke* invoke) {
-  VisitJdkUnsafePutObjectVolatile(invoke);
+  VisitJdkUnsafePutReferenceVolatile(invoke);
 }
 void IntrinsicLocationsBuilderX86::VisitUnsafePutLong(HInvoke* invoke) {
   VisitJdkUnsafePutLong(invoke);
@@ -1970,7 +1946,7 @@
   CreateIntIntIntIntToVoidPlusTempsLocations(
       allocator_, DataType::Type::kInt32, invoke, /*is_volatile=*/ true);
 }
-void IntrinsicLocationsBuilderX86::VisitJdkUnsafePutObject(HInvoke* invoke) {
+void IntrinsicLocationsBuilderX86::VisitJdkUnsafePutReference(HInvoke* invoke) {
   CreateIntIntIntIntToVoidPlusTempsLocations(
       allocator_, DataType::Type::kReference, invoke, /*is_volatile=*/ false);
 }
@@ -1978,11 +1954,11 @@
   CreateIntIntIntIntToVoidPlusTempsLocations(
       allocator_, DataType::Type::kReference, invoke, /*is_volatile=*/ false);
 }
-void IntrinsicLocationsBuilderX86::VisitJdkUnsafePutObjectVolatile(HInvoke* invoke) {
+void IntrinsicLocationsBuilderX86::VisitJdkUnsafePutReferenceVolatile(HInvoke* invoke) {
   CreateIntIntIntIntToVoidPlusTempsLocations(
       allocator_, DataType::Type::kReference, invoke, /*is_volatile=*/ true);
 }
-void IntrinsicLocationsBuilderX86::VisitJdkUnsafePutObjectRelease(HInvoke* invoke) {
+void IntrinsicLocationsBuilderX86::VisitJdkUnsafePutReferenceRelease(HInvoke* invoke) {
   CreateIntIntIntIntToVoidPlusTempsLocations(
       allocator_, DataType::Type::kReference, invoke, /*is_volatile=*/ true);
 }
@@ -2047,11 +2023,11 @@
 
   if (type == DataType::Type::kReference) {
     bool value_can_be_null = true;  // TODO: Worth finding out this information?
-    codegen->MarkGCCard(locations->GetTemp(0).AsRegister<Register>(),
-                        locations->GetTemp(1).AsRegister<Register>(),
-                        base,
-                        value_loc.AsRegister<Register>(),
-                        value_can_be_null);
+    codegen->MaybeMarkGCCard(locations->GetTemp(0).AsRegister<Register>(),
+                             locations->GetTemp(1).AsRegister<Register>(),
+                             base,
+                             value_loc.AsRegister<Register>(),
+                             value_can_be_null);
   }
 }
 
@@ -2065,13 +2041,13 @@
   VisitJdkUnsafePutVolatile(invoke);
 }
 void IntrinsicCodeGeneratorX86::VisitUnsafePutObject(HInvoke* invoke) {
-  VisitJdkUnsafePutObject(invoke);
+  VisitJdkUnsafePutReference(invoke);
 }
 void IntrinsicCodeGeneratorX86::VisitUnsafePutObjectOrdered(HInvoke* invoke) {
   VisitJdkUnsafePutObjectOrdered(invoke);
 }
 void IntrinsicCodeGeneratorX86::VisitUnsafePutObjectVolatile(HInvoke* invoke) {
-  VisitJdkUnsafePutObjectVolatile(invoke);
+  VisitJdkUnsafePutReferenceVolatile(invoke);
 }
 void IntrinsicCodeGeneratorX86::VisitUnsafePutLong(HInvoke* invoke) {
   VisitJdkUnsafePutLong(invoke);
@@ -2098,7 +2074,7 @@
 void IntrinsicCodeGeneratorX86::VisitJdkUnsafePutRelease(HInvoke* invoke) {
   GenUnsafePut(invoke->GetLocations(), DataType::Type::kInt32, /*is_volatile=*/ true, codegen_);
 }
-void IntrinsicCodeGeneratorX86::VisitJdkUnsafePutObject(HInvoke* invoke) {
+void IntrinsicCodeGeneratorX86::VisitJdkUnsafePutReference(HInvoke* invoke) {
   GenUnsafePut(
       invoke->GetLocations(), DataType::Type::kReference, /*is_volatile=*/ false, codegen_);
 }
@@ -2106,11 +2082,11 @@
   GenUnsafePut(
       invoke->GetLocations(), DataType::Type::kReference, /*is_volatile=*/ false, codegen_);
 }
-void IntrinsicCodeGeneratorX86::VisitJdkUnsafePutObjectVolatile(HInvoke* invoke) {
+void IntrinsicCodeGeneratorX86::VisitJdkUnsafePutReferenceVolatile(HInvoke* invoke) {
   GenUnsafePut(
       invoke->GetLocations(), DataType::Type::kReference, /*is_volatile=*/ true, codegen_);
 }
-void IntrinsicCodeGeneratorX86::VisitJdkUnsafePutObjectRelease(HInvoke* invoke) {
+void IntrinsicCodeGeneratorX86::VisitJdkUnsafePutReferenceRelease(HInvoke* invoke) {
   GenUnsafePut(
       invoke->GetLocations(), DataType::Type::kReference, /*is_volatile=*/ true, codegen_);
 }
@@ -2131,11 +2107,10 @@
 }
 
 static void CreateIntIntIntIntIntToInt(ArenaAllocator* allocator,
+                                       CodeGeneratorX86* codegen,
                                        DataType::Type type,
                                        HInvoke* invoke) {
-  const bool can_call = gUseReadBarrier &&
-                        kUseBakerReadBarrier &&
-                        IsUnsafeCASObject(invoke);
+  const bool can_call = codegen->EmitBakerReadBarrier() && IsUnsafeCASReference(invoke);
   LocationSummary* locations =
       new (allocator) LocationSummary(invoke,
                                       can_call
@@ -2192,24 +2167,24 @@
 
 void IntrinsicLocationsBuilderX86::VisitJdkUnsafeCASObject(HInvoke* invoke) {
   // `jdk.internal.misc.Unsafe.compareAndSwapObject` has compare-and-set semantics (see javadoc).
-  VisitJdkUnsafeCompareAndSetObject(invoke);
+  VisitJdkUnsafeCompareAndSetReference(invoke);
 }
 
 void IntrinsicLocationsBuilderX86::VisitJdkUnsafeCompareAndSetInt(HInvoke* invoke) {
-  CreateIntIntIntIntIntToInt(allocator_, DataType::Type::kInt32, invoke);
+  CreateIntIntIntIntIntToInt(allocator_, codegen_, DataType::Type::kInt32, invoke);
 }
 
 void IntrinsicLocationsBuilderX86::VisitJdkUnsafeCompareAndSetLong(HInvoke* invoke) {
-  CreateIntIntIntIntIntToInt(allocator_, DataType::Type::kInt64, invoke);
+  CreateIntIntIntIntIntToInt(allocator_, codegen_, DataType::Type::kInt64, invoke);
 }
 
-void IntrinsicLocationsBuilderX86::VisitJdkUnsafeCompareAndSetObject(HInvoke* invoke) {
+void IntrinsicLocationsBuilderX86::VisitJdkUnsafeCompareAndSetReference(HInvoke* invoke) {
   // The only supported read barrier implementation is the Baker-style read barriers.
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+  if (codegen_->EmitNonBakerReadBarrier()) {
     return;
   }
 
-  CreateIntIntIntIntIntToInt(allocator_, DataType::Type::kReference, invoke);
+  CreateIntIntIntIntIntToInt(allocator_, codegen_, DataType::Type::kReference, invoke);
 }
 
 static void GenPrimitiveLockedCmpxchg(DataType::Type type,
@@ -2334,7 +2309,7 @@
   DCHECK_EQ(expected, EAX);
   DCHECK_NE(temp, temp2);
 
-  if (gUseReadBarrier && kUseBakerReadBarrier) {
+  if (codegen->EmitBakerReadBarrier()) {
     // Need to make sure the reference stored in the field is a to-space
     // one before attempting the CAS or the CAS could fail incorrectly.
     codegen->GenerateReferenceLoadWithBakerReadBarrier(
@@ -2388,7 +2363,7 @@
   bool value_can_be_null = true;  // TODO: Worth finding out this information?
   NearLabel skip_mark_gc_card;
   __ j(kNotZero, &skip_mark_gc_card);
-  codegen->MarkGCCard(temp, temp2, base, value, value_can_be_null);
+  codegen->MaybeMarkGCCard(temp, temp2, base, value, value_can_be_null);
   __ Bind(&skip_mark_gc_card);
 
   // If heap poisoning is enabled, we need to unpoison the values
@@ -2421,7 +2396,7 @@
   if (type == DataType::Type::kReference) {
     // The only read barrier implementation supporting the
     // UnsafeCASObject intrinsic is the Baker-style read barriers.
-    DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+    DCHECK_IMPLIES(codegen->EmitReadBarrier(), kUseBakerReadBarrier);
 
     Register temp = locations->GetTemp(0).AsRegister<Register>();
     Register temp2 = locations->GetTemp(1).AsRegister<Register>();
@@ -2443,7 +2418,7 @@
 void IntrinsicCodeGeneratorX86::VisitUnsafeCASObject(HInvoke* invoke) {
   // The only read barrier implementation supporting the
   // UnsafeCASObject intrinsic is the Baker-style read barriers.
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen_->EmitReadBarrier(), kUseBakerReadBarrier);
 
   GenCAS(DataType::Type::kReference, invoke, codegen_);
 }
@@ -2460,7 +2435,7 @@
 
 void IntrinsicCodeGeneratorX86::VisitJdkUnsafeCASObject(HInvoke* invoke) {
   // `jdk.internal.misc.Unsafe.compareAndSwapObject` has compare-and-set semantics (see javadoc).
-  VisitJdkUnsafeCompareAndSetObject(invoke);
+  VisitJdkUnsafeCompareAndSetReference(invoke);
 }
 
 void IntrinsicCodeGeneratorX86::VisitJdkUnsafeCompareAndSetInt(HInvoke* invoke) {
@@ -2471,13 +2446,245 @@
   GenCAS(DataType::Type::kInt64, invoke, codegen_);
 }
 
-void IntrinsicCodeGeneratorX86::VisitJdkUnsafeCompareAndSetObject(HInvoke* invoke) {
+void IntrinsicCodeGeneratorX86::VisitJdkUnsafeCompareAndSetReference(HInvoke* invoke) {
   // The only supported read barrier implementation is the Baker-style read barriers.
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen_->EmitReadBarrier(), kUseBakerReadBarrier);
 
   GenCAS(DataType::Type::kReference, invoke, codegen_);
 }
 
+// Note: Unlike other architectures that use corresponding enums for the `VarHandle`
+// implementation, x86 is currently using it only for `Unsafe`.
+enum class GetAndUpdateOp {
+  kSet,
+  kAdd,
+};
+
+void CreateUnsafeGetAndUpdateLocations(ArenaAllocator* allocator,
+                                       HInvoke* invoke,
+                                       CodeGeneratorX86* codegen,
+                                       DataType::Type type,
+                                       GetAndUpdateOp get_and_unsafe_op) {
+  const bool can_call = codegen->EmitReadBarrier() && IsUnsafeGetAndSetReference(invoke);
+  LocationSummary* locations =
+      new (allocator) LocationSummary(invoke,
+                                      can_call
+                                          ? LocationSummary::kCallOnSlowPath
+                                          : LocationSummary::kNoCall,
+                                      kIntrinsified);
+  if (can_call && kUseBakerReadBarrier) {
+    locations->SetCustomSlowPathCallerSaves(RegisterSet::Empty());  // No caller-save registers.
+  }
+  locations->SetInAt(0, Location::NoLocation());        // Unused receiver.
+  if (type == DataType::Type::kInt64) {
+    // Explicitly allocate all registers.
+    locations->SetInAt(1, Location::RegisterLocation(EBP));
+    if (get_and_unsafe_op == GetAndUpdateOp::kAdd) {
+      locations->AddTemp(Location::RegisterLocation(EBP));  // We shall clobber EBP.
+      locations->SetInAt(2, Location::Any());  // Offset shall be on the stack.
+      locations->SetInAt(3, Location::RegisterPairLocation(ESI, EDI));
+      locations->AddTemp(Location::RegisterLocation(EBX));
+      locations->AddTemp(Location::RegisterLocation(ECX));
+    } else {
+      locations->SetInAt(2, Location::RegisterPairLocation(ESI, EDI));
+      locations->SetInAt(3, Location::RegisterPairLocation(EBX, ECX));
+    }
+    locations->SetOut(Location::RegisterPairLocation(EAX, EDX), Location::kOutputOverlap);
+  } else {
+    locations->SetInAt(1, Location::RequiresRegister());
+    locations->SetInAt(2, Location::RequiresRegister());
+    // Use the same register for both the output and the new value or addend
+    // to take advantage of XCHG or XADD. Arbitrarily pick EAX.
+    locations->SetInAt(3, Location::RegisterLocation(EAX));
+    locations->SetOut(Location::RegisterLocation(EAX));
+  }
+}
+
+void IntrinsicLocationsBuilderX86::VisitUnsafeGetAndAddInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddInt(invoke);
+}
+
+void IntrinsicLocationsBuilderX86::VisitUnsafeGetAndAddLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddLong(invoke);
+}
+
+void IntrinsicLocationsBuilderX86::VisitUnsafeGetAndSetInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetInt(invoke);
+}
+
+void IntrinsicLocationsBuilderX86::VisitUnsafeGetAndSetLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetLong(invoke);
+}
+
+void IntrinsicLocationsBuilderX86::VisitUnsafeGetAndSetObject(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetReference(invoke);
+}
+
+void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetAndAddInt(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(
+      allocator_, invoke, codegen_, DataType::Type::kInt32, GetAndUpdateOp::kAdd);
+}
+
+void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetAndAddLong(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(
+      allocator_, invoke, codegen_, DataType::Type::kInt64, GetAndUpdateOp::kAdd);
+}
+
+void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetAndSetInt(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(
+      allocator_, invoke, codegen_, DataType::Type::kInt32, GetAndUpdateOp::kSet);
+}
+
+void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetAndSetLong(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(
+      allocator_, invoke, codegen_, DataType::Type::kInt64, GetAndUpdateOp::kSet);
+}
+
+void IntrinsicLocationsBuilderX86::VisitJdkUnsafeGetAndSetReference(HInvoke* invoke) {
+  // The only supported read barrier implementation is the Baker-style read barriers.
+  if (codegen_->EmitNonBakerReadBarrier()) {
+    return;
+  }
+
+  CreateUnsafeGetAndUpdateLocations(
+      allocator_, invoke, codegen_, DataType::Type::kReference, GetAndUpdateOp::kSet);
+  LocationSummary* locations = invoke->GetLocations();
+  locations->AddTemp(Location::RequiresRegister());
+  locations->AddTemp(Location::RegisterLocation(ECX));  // Byte register for `MarkGCCard()`.
+}
+
+static void GenUnsafeGetAndUpdate(HInvoke* invoke,
+                                  DataType::Type type,
+                                  CodeGeneratorX86* codegen,
+                                  GetAndUpdateOp get_and_update_op) {
+  X86Assembler* assembler = down_cast<X86Assembler*>(codegen->GetAssembler());
+  LocationSummary* locations = invoke->GetLocations();
+
+  Location out = locations->Out();                            // Result.
+  Register base = locations->InAt(1).AsRegister<Register>();  // Object pointer.
+  Location offset = locations->InAt(2);                       // Long offset.
+  Location arg = locations->InAt(3);                          // New value or addend.
+
+  if (type == DataType::Type::kInt32) {
+    DCHECK(out.Equals(arg));
+    Register out_reg = out.AsRegister<Register>();
+    Address field_address(base, offset.AsRegisterPairLow<Register>(), TIMES_1, 0);
+    if (get_and_update_op == GetAndUpdateOp::kAdd) {
+      __ LockXaddl(field_address, out_reg);
+    } else {
+      DCHECK(get_and_update_op == GetAndUpdateOp::kSet);
+      __ xchgl(out_reg, field_address);
+    }
+  } else if (type == DataType::Type::kInt64) {
+    // Prepare the field address. Ignore the high 32 bits of the `offset`.
+    Address field_address_low(kNoRegister, 0), field_address_high(kNoRegister, 0);
+    if (get_and_update_op == GetAndUpdateOp::kAdd) {
+      DCHECK(offset.IsDoubleStackSlot());
+      __ addl(base, Address(ESP, offset.GetStackIndex()));  // Clobbers `base`.
+      DCHECK(Location::RegisterLocation(base).Equals(locations->GetTemp(0)));
+      field_address_low = Address(base, 0);
+      field_address_high = Address(base, 4);
+    } else {
+      field_address_low = Address(base, offset.AsRegisterPairLow<Register>(), TIMES_1, 0);
+      field_address_high = Address(base, offset.AsRegisterPairLow<Register>(), TIMES_1, 4);
+    }
+    // Load the old value to EDX:EAX and use LOCK CMPXCHG8B to set the new value.
+    NearLabel loop;
+    __ Bind(&loop);
+    __ movl(EAX, field_address_low);
+    __ movl(EDX, field_address_high);
+    if (get_and_update_op == GetAndUpdateOp::kAdd) {
+      DCHECK(Location::RegisterPairLocation(ESI, EDI).Equals(arg));
+      __ movl(EBX, EAX);
+      __ movl(ECX, EDX);
+      __ addl(EBX, ESI);
+      __ adcl(ECX, EDI);
+    } else {
+      DCHECK(get_and_update_op == GetAndUpdateOp::kSet);
+      DCHECK(Location::RegisterPairLocation(EBX, ECX).Equals(arg));
+    }
+    __ LockCmpxchg8b(field_address_low);
+    __ j(kNotEqual, &loop);  // Repeat on failure.
+  } else {
+    DCHECK_EQ(type, DataType::Type::kReference);
+    DCHECK(get_and_update_op == GetAndUpdateOp::kSet);
+    Register out_reg = out.AsRegister<Register>();
+    Address field_address(base, offset.AsRegisterPairLow<Register>(), TIMES_1, 0);
+    Register temp1 = locations->GetTemp(0).AsRegister<Register>();
+    Register temp2 = locations->GetTemp(1).AsRegister<Register>();
+
+    if (codegen->EmitReadBarrier()) {
+      DCHECK(kUseBakerReadBarrier);
+      // Ensure that the field contains a to-space reference.
+      codegen->GenerateReferenceLoadWithBakerReadBarrier(
+          invoke,
+          Location::RegisterLocation(temp2),
+          base,
+          field_address,
+          /*needs_null_check=*/ false,
+          /*always_update_field=*/ true,
+          &temp1);
+    }
+
+    // Mark card for object as a new value shall be stored.
+    bool new_value_can_be_null = true;  // TODO: Worth finding out this information?
+    DCHECK_EQ(temp2, ECX);  // Byte register for `MarkGCCard()`.
+    codegen->MaybeMarkGCCard(temp1, temp2, base, /*value=*/out_reg, new_value_can_be_null);
+
+    if (kPoisonHeapReferences) {
+      // Use a temp to avoid poisoning base of the field address, which might happen if `out`
+      // is the same as `base` (for code like `unsafe.getAndSet(obj, offset, obj)`).
+      __ movl(temp1, out_reg);
+      __ PoisonHeapReference(temp1);
+      __ xchgl(temp1, field_address);
+      __ UnpoisonHeapReference(temp1);
+      __ movl(out_reg, temp1);
+    } else {
+      __ xchgl(out_reg, field_address);
+    }
+  }
+}
+
+void IntrinsicCodeGeneratorX86::VisitUnsafeGetAndAddInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddInt(invoke);
+}
+
+void IntrinsicCodeGeneratorX86::VisitUnsafeGetAndAddLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddLong(invoke);
+}
+
+void IntrinsicCodeGeneratorX86::VisitUnsafeGetAndSetInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetInt(invoke);
+}
+
+void IntrinsicCodeGeneratorX86::VisitUnsafeGetAndSetLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetLong(invoke);
+}
+
+void IntrinsicCodeGeneratorX86::VisitUnsafeGetAndSetObject(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetReference(invoke);
+}
+
+void IntrinsicCodeGeneratorX86::VisitJdkUnsafeGetAndAddInt(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kInt32, codegen_, GetAndUpdateOp::kAdd);
+}
+
+void IntrinsicCodeGeneratorX86::VisitJdkUnsafeGetAndAddLong(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kInt64, codegen_, GetAndUpdateOp::kAdd);
+}
+
+void IntrinsicCodeGeneratorX86::VisitJdkUnsafeGetAndSetInt(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kInt32, codegen_, GetAndUpdateOp::kSet);
+}
+
+void IntrinsicCodeGeneratorX86::VisitJdkUnsafeGetAndSetLong(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kInt64, codegen_, GetAndUpdateOp::kSet);
+}
+
+void IntrinsicCodeGeneratorX86::VisitJdkUnsafeGetAndSetReference(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kReference, codegen_, GetAndUpdateOp::kSet);
+}
+
 void IntrinsicLocationsBuilderX86::VisitIntegerReverse(HInvoke* invoke) {
   LocationSummary* locations =
       new (allocator_) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
@@ -2827,60 +3034,23 @@
   return instruction->InputAt(input0) == instruction->InputAt(input1);
 }
 
-// Compute base address for the System.arraycopy intrinsic in `base`.
-static void GenSystemArrayCopyBaseAddress(X86Assembler* assembler,
-                                          DataType::Type type,
-                                          const Register& array,
-                                          const Location& pos,
-                                          const Register& base) {
-  // This routine is only used by the SystemArrayCopy intrinsic at the
-  // moment. We can allow DataType::Type::kReference as `type` to implement
-  // the SystemArrayCopyChar intrinsic.
-  DCHECK_EQ(type, DataType::Type::kReference);
-  const int32_t element_size = DataType::Size(type);
-  const ScaleFactor scale_factor = static_cast<ScaleFactor>(DataType::SizeShift(type));
-  const uint32_t data_offset = mirror::Array::DataOffset(element_size).Uint32Value();
-
-  if (pos.IsConstant()) {
-    int32_t constant = pos.GetConstant()->AsIntConstant()->GetValue();
-    __ leal(base, Address(array, element_size * constant + data_offset));
-  } else {
-    __ leal(base, Address(array, pos.AsRegister<Register>(), scale_factor, data_offset));
-  }
-}
-
-// Compute end source address for the System.arraycopy intrinsic in `end`.
-static void GenSystemArrayCopyEndAddress(X86Assembler* assembler,
-                                         DataType::Type type,
-                                         const Location& copy_length,
-                                         const Register& base,
-                                         const Register& end) {
-  // This routine is only used by the SystemArrayCopy intrinsic at the
-  // moment. We can allow DataType::Type::kReference as `type` to implement
-  // the SystemArrayCopyChar intrinsic.
-  DCHECK_EQ(type, DataType::Type::kReference);
-  const int32_t element_size = DataType::Size(type);
-  const ScaleFactor scale_factor = static_cast<ScaleFactor>(DataType::SizeShift(type));
-
-  if (copy_length.IsConstant()) {
-    int32_t constant = copy_length.GetConstant()->AsIntConstant()->GetValue();
-    __ leal(end, Address(base, element_size * constant));
-  } else {
-    __ leal(end, Address(base, copy_length.AsRegister<Register>(), scale_factor, 0));
-  }
-}
-
 void IntrinsicLocationsBuilderX86::VisitSystemArrayCopy(HInvoke* invoke) {
   // The only read barrier implementation supporting the
   // SystemArrayCopy intrinsic is the Baker-style read barriers.
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+  if (codegen_->EmitNonBakerReadBarrier()) {
     return;
   }
 
-  CodeGenerator::CreateSystemArrayCopyLocationSummary(invoke);
-  if (invoke->GetLocations() != nullptr) {
-    // Need a byte register for marking.
-    invoke->GetLocations()->SetTempAt(1, Location::RegisterLocation(ECX));
+  constexpr int32_t kLengthThreshold = -1;  // No cut-off - handle large arrays in intrinsic code.
+  constexpr size_t kInitialNumTemps = 0u;  // We shall allocate temps explicitly.
+  LocationSummary* locations = CodeGenerator::CreateSystemArrayCopyLocationSummary(
+      invoke, kLengthThreshold, kInitialNumTemps);
+  if (locations != nullptr) {
+    // Add temporaries.  We will use REP MOVSL, so we need fixed registers.
+    DCHECK_EQ(locations->GetTempCount(), kInitialNumTemps);
+    locations->AddTemp(Location::RegisterLocation(ESI));
+    locations->AddTemp(Location::RegisterLocation(EDI));
+    locations->AddTemp(Location::RegisterLocation(ECX));  // Byte reg also used for write barrier.
 
     static constexpr size_t kSrc = 0;
     static constexpr size_t kSrcPos = 1;
@@ -2888,15 +3058,25 @@
     static constexpr size_t kDestPos = 3;
     static constexpr size_t kLength = 4;
 
-    if (!invoke->InputAt(kSrcPos)->IsIntConstant() &&
-        !invoke->InputAt(kDestPos)->IsIntConstant() &&
-        !invoke->InputAt(kLength)->IsIntConstant()) {
-      if (!IsSameInput(invoke, kSrcPos, kDestPos) &&
-          !IsSameInput(invoke, kSrcPos, kLength) &&
-          !IsSameInput(invoke, kDestPos, kLength) &&
-          !IsSameInput(invoke, kSrc, kDest)) {
-        // Not enough registers, make the length also take a stack slot.
-        invoke->GetLocations()->SetInAt(kLength, Location::Any());
+    if (!locations->InAt(kLength).IsConstant()) {
+      // We may not have enough registers for all inputs and temps, so put the
+      // non-const length explicitly to the same register as one of the temps.
+      locations->SetInAt(kLength, Location::RegisterLocation(ECX));
+    }
+
+    if (codegen_->EmitBakerReadBarrier()) {
+      // We need an additional temp in the slow path for holding the reference.
+      if (locations->InAt(kSrcPos).IsConstant() ||
+          locations->InAt(kDestPos).IsConstant() ||
+          IsSameInput(invoke, kSrc, kDest) ||
+          IsSameInput(invoke, kSrcPos, kDestPos)) {
+        // We can allocate another temp register.
+        locations->AddTemp(Location::RequiresRegister());
+      } else {
+        // Use the same fixed register for the non-const `src_pos` and the additional temp.
+        // The `src_pos` is no longer needed when we reach the slow path.
+        locations->SetInAt(kSrcPos, Location::RegisterLocation(EDX));
+        locations->AddTemp(Location::RegisterLocation(EDX));
       }
     }
   }
@@ -2905,7 +3085,7 @@
 void IntrinsicCodeGeneratorX86::VisitSystemArrayCopy(HInvoke* invoke) {
   // The only read barrier implementation supporting the
   // SystemArrayCopy intrinsic is the Baker-style read barriers.
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen_->EmitReadBarrier(), kUseBakerReadBarrier);
 
   X86Assembler* assembler = GetAssembler();
   LocationSummary* locations = invoke->GetLocations();
@@ -2920,8 +3100,7 @@
   Location src_pos = locations->InAt(1);
   Register dest = locations->InAt(2).AsRegister<Register>();
   Location dest_pos = locations->InAt(3);
-  Location length_arg = locations->InAt(4);
-  Location length = length_arg;
+  Location length = locations->InAt(4);
   Location temp1_loc = locations->GetTemp(0);
   Register temp1 = temp1_loc.AsRegister<Register>();
   Location temp2_loc = locations->GetTemp(1);
@@ -2934,39 +3113,35 @@
   NearLabel conditions_on_positions_validated;
   SystemArrayCopyOptimizations optimizations(invoke);
 
-  // If source and destination are the same, we go to slow path if we need to do
-  // forward copying.
-  if (src_pos.IsConstant()) {
-    int32_t src_pos_constant = src_pos.GetConstant()->AsIntConstant()->GetValue();
-    if (dest_pos.IsConstant()) {
-      int32_t dest_pos_constant = dest_pos.GetConstant()->AsIntConstant()->GetValue();
-      if (optimizations.GetDestinationIsSource()) {
-        // Checked when building locations.
-        DCHECK_GE(src_pos_constant, dest_pos_constant);
-      } else if (src_pos_constant < dest_pos_constant) {
-        __ cmpl(src, dest);
-        __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
+  // If source and destination are the same, we go to slow path if we need to do forward copying.
+  // We do not need to do this check if the source and destination positions are the same.
+  if (!optimizations.GetSourcePositionIsDestinationPosition()) {
+    if (src_pos.IsConstant()) {
+      int32_t src_pos_constant = src_pos.GetConstant()->AsIntConstant()->GetValue();
+      if (dest_pos.IsConstant()) {
+        int32_t dest_pos_constant = dest_pos.GetConstant()->AsIntConstant()->GetValue();
+        if (optimizations.GetDestinationIsSource()) {
+          // Checked when building locations.
+          DCHECK_GE(src_pos_constant, dest_pos_constant);
+        } else if (src_pos_constant < dest_pos_constant) {
+          __ cmpl(src, dest);
+          __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
+        }
+      } else {
+        if (!optimizations.GetDestinationIsSource()) {
+          __ cmpl(src, dest);
+          __ j(kNotEqual, &conditions_on_positions_validated);
+        }
+        __ cmpl(dest_pos.AsRegister<Register>(), Immediate(src_pos_constant));
+        __ j(kGreater, intrinsic_slow_path->GetEntryLabel());
       }
     } else {
       if (!optimizations.GetDestinationIsSource()) {
         __ cmpl(src, dest);
         __ j(kNotEqual, &conditions_on_positions_validated);
       }
-      __ cmpl(dest_pos.AsRegister<Register>(), Immediate(src_pos_constant));
-      __ j(kGreater, intrinsic_slow_path->GetEntryLabel());
-    }
-  } else {
-    if (!optimizations.GetDestinationIsSource()) {
-      __ cmpl(src, dest);
-      __ j(kNotEqual, &conditions_on_positions_validated);
-    }
-    if (dest_pos.IsConstant()) {
-      int32_t dest_pos_constant = dest_pos.GetConstant()->AsIntConstant()->GetValue();
-      __ cmpl(src_pos.AsRegister<Register>(), Immediate(dest_pos_constant));
-      __ j(kLess, intrinsic_slow_path->GetEntryLabel());
-    } else {
-      __ cmpl(src_pos.AsRegister<Register>(), dest_pos.AsRegister<Register>());
-      __ j(kLess, intrinsic_slow_path->GetEntryLabel());
+      Register src_pos_reg = src_pos.AsRegister<Register>();
+      EmitCmplJLess(assembler, src_pos_reg, dest_pos, intrinsic_slow_path->GetEntryLabel());
     }
   }
 
@@ -2984,13 +3159,6 @@
     __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
   }
 
-  Location temp3_loc = locations->GetTemp(2);
-  Register temp3 = temp3_loc.AsRegister<Register>();
-  if (length.IsStackSlot()) {
-    __ movl(temp3, Address(ESP, length.GetStackIndex()));
-    length = Location::RegisterLocation(temp3);
-  }
-
   // If the length is negative, bail out.
   // We have already checked in the LocationsBuilder for the constant case.
   if (!length.IsConstant() &&
@@ -3001,22 +3169,39 @@
   }
 
   // Validity checks: source.
-  CheckPosition(assembler,
-                src_pos,
-                src,
-                length,
-                intrinsic_slow_path,
-                temp1,
-                optimizations.GetCountIsSourceLength());
+  CheckSystemArrayCopyPosition(assembler,
+                               src,
+                               src_pos,
+                               length,
+                               intrinsic_slow_path,
+                               temp1,
+                               optimizations.GetCountIsSourceLength(),
+                               /*position_sign_checked=*/ false);
 
   // Validity checks: dest.
-  CheckPosition(assembler,
-                dest_pos,
-                dest,
-                length,
-                intrinsic_slow_path,
-                temp1,
-                optimizations.GetCountIsDestinationLength());
+  bool dest_position_sign_checked = optimizations.GetSourcePositionIsDestinationPosition();
+  CheckSystemArrayCopyPosition(assembler,
+                               dest,
+                               dest_pos,
+                               length,
+                               intrinsic_slow_path,
+                               temp1,
+                               optimizations.GetCountIsDestinationLength(),
+                               dest_position_sign_checked);
+
+  auto check_non_primitive_array_class = [&](Register klass, Register temp) {
+    // No read barrier is needed for reading a chain of constant references for comparing
+    // with null, or for reading a constant primitive value, see `ReadBarrierOption`.
+    // /* HeapReference<Class> */ temp = klass->component_type_
+    __ movl(temp, Address(klass, component_offset));
+    __ MaybeUnpoisonHeapReference(temp);
+    // Check that the component type is not null.
+    __ testl(temp, temp);
+    __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
+    // Check that the component type is not a primitive.
+    __ cmpw(Address(temp, primitive_offset), Immediate(Primitive::kPrimNot));
+    __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
+  };
 
   if (!optimizations.GetDoesNotNeedTypeCheck()) {
     // Check whether all elements of the source array are assignable to the component
@@ -3024,273 +3209,159 @@
     // or the destination is Object[]. If none of these checks succeed, we go to the
     // slow path.
 
-    if (!optimizations.GetSourceIsNonPrimitiveArray()) {
-      if (gUseReadBarrier && kUseBakerReadBarrier) {
-        // /* HeapReference<Class> */ temp1 = src->klass_
-        codegen_->GenerateFieldLoadWithBakerReadBarrier(
-            invoke, temp1_loc, src, class_offset, /* needs_null_check= */ false);
-        // Bail out if the source is not a non primitive array.
-        // /* HeapReference<Class> */ temp1 = temp1->component_type_
-        codegen_->GenerateFieldLoadWithBakerReadBarrier(
-            invoke, temp1_loc, temp1, component_offset, /* needs_null_check= */ false);
-        __ testl(temp1, temp1);
-        __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
-        // If heap poisoning is enabled, `temp1` has been unpoisoned
-        // by the the previous call to GenerateFieldLoadWithBakerReadBarrier.
-      } else {
-        // /* HeapReference<Class> */ temp1 = src->klass_
-        __ movl(temp1, Address(src, class_offset));
-        __ MaybeUnpoisonHeapReference(temp1);
-        // Bail out if the source is not a non primitive array.
-        // /* HeapReference<Class> */ temp1 = temp1->component_type_
-        __ movl(temp1, Address(temp1, component_offset));
-        __ testl(temp1, temp1);
-        __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
-        __ MaybeUnpoisonHeapReference(temp1);
-      }
-      __ cmpw(Address(temp1, primitive_offset), Immediate(Primitive::kPrimNot));
-      __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
-    }
-
-    if (gUseReadBarrier && kUseBakerReadBarrier) {
-      if (length.Equals(Location::RegisterLocation(temp3))) {
-        // When Baker read barriers are enabled, register `temp3`,
-        // which in the present case contains the `length` parameter,
-        // will be overwritten below.  Make the `length` location
-        // reference the original stack location; it will be moved
-        // back to `temp3` later if necessary.
-        DCHECK(length_arg.IsStackSlot());
-        length = length_arg;
-      }
-
+    if (codegen_->EmitBakerReadBarrier()) {
       // /* HeapReference<Class> */ temp1 = dest->klass_
       codegen_->GenerateFieldLoadWithBakerReadBarrier(
           invoke, temp1_loc, dest, class_offset, /* needs_null_check= */ false);
-
-      if (!optimizations.GetDestinationIsNonPrimitiveArray()) {
-        // Bail out if the destination is not a non primitive array.
-        //
-        // Register `temp1` is not trashed by the read barrier emitted
-        // by GenerateFieldLoadWithBakerReadBarrier below, as that
-        // method produces a call to a ReadBarrierMarkRegX entry point,
-        // which saves all potentially live registers, including
-        // temporaries such a `temp1`.
-        // /* HeapReference<Class> */ temp2 = temp1->component_type_
-        codegen_->GenerateFieldLoadWithBakerReadBarrier(
-            invoke, temp2_loc, temp1, component_offset, /* needs_null_check= */ false);
-        __ testl(temp2, temp2);
-        __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
-        // If heap poisoning is enabled, `temp2` has been unpoisoned
-        // by the the previous call to GenerateFieldLoadWithBakerReadBarrier.
-        __ cmpw(Address(temp2, primitive_offset), Immediate(Primitive::kPrimNot));
-        __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
-      }
-
-      // For the same reason given earlier, `temp1` is not trashed by the
-      // read barrier emitted by GenerateFieldLoadWithBakerReadBarrier below.
+      // Register `temp1` is not trashed by the read barrier emitted
+      // by GenerateFieldLoadWithBakerReadBarrier below, as that
+      // method produces a call to a ReadBarrierMarkRegX entry point,
+      // which saves all potentially live registers, including
+      // temporaries such a `temp1`.
       // /* HeapReference<Class> */ temp2 = src->klass_
       codegen_->GenerateFieldLoadWithBakerReadBarrier(
           invoke, temp2_loc, src, class_offset, /* needs_null_check= */ false);
-      // Note: if heap poisoning is on, we are comparing two unpoisoned references here.
-      __ cmpl(temp1, temp2);
-
-      if (optimizations.GetDestinationIsTypedObjectArray()) {
-        NearLabel do_copy;
-        __ j(kEqual, &do_copy);
-        // /* HeapReference<Class> */ temp1 = temp1->component_type_
-        codegen_->GenerateFieldLoadWithBakerReadBarrier(
-            invoke, temp1_loc, temp1, component_offset, /* needs_null_check= */ false);
-        // We do not need to emit a read barrier for the following
-        // heap reference load, as `temp1` is only used in a
-        // comparison with null below, and this reference is not
-        // kept afterwards.
-        __ cmpl(Address(temp1, super_offset), Immediate(0));
-        __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
-        __ Bind(&do_copy);
-      } else {
-        __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
-      }
     } else {
-      // Non read barrier code.
-
       // /* HeapReference<Class> */ temp1 = dest->klass_
       __ movl(temp1, Address(dest, class_offset));
-      if (!optimizations.GetDestinationIsNonPrimitiveArray()) {
-        __ MaybeUnpoisonHeapReference(temp1);
-        // Bail out if the destination is not a non primitive array.
-        // /* HeapReference<Class> */ temp2 = temp1->component_type_
-        __ movl(temp2, Address(temp1, component_offset));
-        __ testl(temp2, temp2);
-        __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
-        __ MaybeUnpoisonHeapReference(temp2);
-        __ cmpw(Address(temp2, primitive_offset), Immediate(Primitive::kPrimNot));
-        __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
-        // Re-poison the heap reference to make the compare instruction below
-        // compare two poisoned references.
-        __ PoisonHeapReference(temp1);
+      __ MaybeUnpoisonHeapReference(temp1);
+      // /* HeapReference<Class> */ temp2 = src->klass_
+      __ movl(temp2, Address(src, class_offset));
+      __ MaybeUnpoisonHeapReference(temp2);
+    }
+
+    __ cmpl(temp1, temp2);
+    if (optimizations.GetDestinationIsTypedObjectArray()) {
+      DCHECK(optimizations.GetDestinationIsNonPrimitiveArray());
+      NearLabel do_copy;
+      // For class match, we can skip the source type check regardless of the optimization flag.
+      __ j(kEqual, &do_copy);
+      // No read barrier is needed for reading a chain of constant references
+      // for comparing with null, see `ReadBarrierOption`.
+      // /* HeapReference<Class> */ temp1 = temp1->component_type_
+      __ movl(temp1, Address(temp1, component_offset));
+      __ MaybeUnpoisonHeapReference(temp1);
+      // No need to unpoison the following heap reference load, as
+      // we're comparing against null.
+      __ cmpl(Address(temp1, super_offset), Immediate(0));
+      __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
+      // Bail out if the source is not a non primitive array.
+      if (!optimizations.GetSourceIsNonPrimitiveArray()) {
+        check_non_primitive_array_class(temp2, temp2);
       }
-
-      // Note: if heap poisoning is on, we are comparing two poisoned references here.
-      __ cmpl(temp1, Address(src, class_offset));
-
-      if (optimizations.GetDestinationIsTypedObjectArray()) {
-        NearLabel do_copy;
-        __ j(kEqual, &do_copy);
-        __ MaybeUnpoisonHeapReference(temp1);
-        // /* HeapReference<Class> */ temp1 = temp1->component_type_
-        __ movl(temp1, Address(temp1, component_offset));
-        __ MaybeUnpoisonHeapReference(temp1);
-        __ cmpl(Address(temp1, super_offset), Immediate(0));
-        __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
-        __ Bind(&do_copy);
-      } else {
-        __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
+      __ Bind(&do_copy);
+    } else {
+      DCHECK(!optimizations.GetDestinationIsTypedObjectArray());
+      // For class match, we can skip the array type check completely if at least one of source
+      // and destination is known to be a non primitive array, otherwise one check is enough.
+      __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
+      if (!optimizations.GetDestinationIsNonPrimitiveArray() &&
+          !optimizations.GetSourceIsNonPrimitiveArray()) {
+        check_non_primitive_array_class(temp2, temp2);
       }
     }
   } else if (!optimizations.GetSourceIsNonPrimitiveArray()) {
     DCHECK(optimizations.GetDestinationIsNonPrimitiveArray());
     // Bail out if the source is not a non primitive array.
-    if (gUseReadBarrier && kUseBakerReadBarrier) {
-      // /* HeapReference<Class> */ temp1 = src->klass_
-      codegen_->GenerateFieldLoadWithBakerReadBarrier(
-          invoke, temp1_loc, src, class_offset, /* needs_null_check= */ false);
-      // /* HeapReference<Class> */ temp1 = temp1->component_type_
-      codegen_->GenerateFieldLoadWithBakerReadBarrier(
-          invoke, temp1_loc, temp1, component_offset, /* needs_null_check= */ false);
-      __ testl(temp1, temp1);
-      __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
-      // If heap poisoning is enabled, `temp1` has been unpoisoned
-      // by the the previous call to GenerateFieldLoadWithBakerReadBarrier.
-    } else {
-      // /* HeapReference<Class> */ temp1 = src->klass_
-      __ movl(temp1, Address(src, class_offset));
-      __ MaybeUnpoisonHeapReference(temp1);
-      // /* HeapReference<Class> */ temp1 = temp1->component_type_
-      __ movl(temp1, Address(temp1, component_offset));
-      __ testl(temp1, temp1);
-      __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
-      __ MaybeUnpoisonHeapReference(temp1);
-    }
-    __ cmpw(Address(temp1, primitive_offset), Immediate(Primitive::kPrimNot));
-    __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
+    // No read barrier is needed for reading a chain of constant references for comparing
+    // with null, or for reading a constant primitive value, see `ReadBarrierOption`.
+    // /* HeapReference<Class> */ temp1 = src->klass_
+    __ movl(temp1, Address(src, class_offset));
+    __ MaybeUnpoisonHeapReference(temp1);
+    check_non_primitive_array_class(temp1, temp1);
   }
 
-  const DataType::Type type = DataType::Type::kReference;
-  const int32_t element_size = DataType::Size(type);
-
-  // Compute the base source address in `temp1`.
-  GenSystemArrayCopyBaseAddress(GetAssembler(), type, src, src_pos, temp1);
-
-  if (gUseReadBarrier && kUseBakerReadBarrier) {
-    // If it is needed (in the case of the fast-path loop), the base
-    // destination address is computed later, as `temp2` is used for
-    // intermediate computations.
-
-    // Compute the end source address in `temp3`.
-    if (length.IsStackSlot()) {
-      // Location `length` is again pointing at a stack slot, as
-      // register `temp3` (which was containing the length parameter
-      // earlier) has been overwritten; restore it now
-      DCHECK(length.Equals(length_arg));
-      __ movl(temp3, Address(ESP, length.GetStackIndex()));
-      length = Location::RegisterLocation(temp3);
-    }
-    GenSystemArrayCopyEndAddress(GetAssembler(), type, length, temp1, temp3);
-
-    // SystemArrayCopy implementation for Baker read barriers (see
-    // also CodeGeneratorX86::GenerateReferenceLoadWithBakerReadBarrier):
-    //
-    //   if (src_ptr != end_ptr) {
-    //     uint32_t rb_state = Lockword(src->monitor_).ReadBarrierState();
-    //     lfence;  // Load fence or artificial data dependency to prevent load-load reordering
-    //     bool is_gray = (rb_state == ReadBarrier::GrayState());
-    //     if (is_gray) {
-    //       // Slow-path copy.
-    //       for (size_t i = 0; i != length; ++i) {
-    //         dest_array[dest_pos + i] =
-    //             MaybePoison(ReadBarrier::Mark(MaybeUnpoison(src_array[src_pos + i])));
-    //       }
-    //     } else {
-    //       // Fast-path copy.
-    //       do {
-    //         *dest_ptr++ = *src_ptr++;
-    //       } while (src_ptr != end_ptr)
-    //     }
-    //   }
-
-    NearLabel loop, done;
+  if (length.IsConstant() && length.GetConstant()->AsIntConstant()->GetValue() == 0) {
+    // Null constant length: not need to emit the loop code at all.
+  } else {
+    const DataType::Type type = DataType::Type::kReference;
+    const size_t data_size = DataType::Size(type);
+    const uint32_t data_offset = mirror::Array::DataOffset(data_size).Uint32Value();
 
     // Don't enter copy loop if `length == 0`.
-    __ cmpl(temp1, temp3);
-    __ j(kEqual, &done);
+    NearLabel skip_copy_and_write_barrier;
+    if (!length.IsConstant()) {
+      __ testl(length.AsRegister<Register>(), length.AsRegister<Register>());
+      __ j(kEqual, &skip_copy_and_write_barrier);
+    }
 
-    // Given the numeric representation, it's enough to check the low bit of the rb_state.
-    static_assert(ReadBarrier::NonGrayState() == 0, "Expecting non-gray to have value 0");
-    static_assert(ReadBarrier::GrayState() == 1, "Expecting gray to have value 1");
-    constexpr uint32_t gray_byte_position = LockWord::kReadBarrierStateShift / kBitsPerByte;
-    constexpr uint32_t gray_bit_position = LockWord::kReadBarrierStateShift % kBitsPerByte;
-    constexpr int32_t test_value = static_cast<int8_t>(1 << gray_bit_position);
-
-    // if (rb_state == ReadBarrier::GrayState())
-    //   goto slow_path;
-    // At this point, just do the "if" and make sure that flags are preserved until the branch.
-    __ testb(Address(src, monitor_offset + gray_byte_position), Immediate(test_value));
-
-    // Load fence to prevent load-load reordering.
-    // Note that this is a no-op, thanks to the x86 memory model.
-    codegen_->GenerateMemoryBarrier(MemBarrierKind::kLoadAny);
-
-    // Slow path used to copy array when `src` is gray.
-    SlowPathCode* read_barrier_slow_path =
-        new (codegen_->GetScopedAllocator()) ReadBarrierSystemArrayCopySlowPathX86(invoke);
-    codegen_->AddSlowPath(read_barrier_slow_path);
-
-    // We have done the "if" of the gray bit check above, now branch based on the flags.
-    __ j(kNotZero, read_barrier_slow_path->GetEntryLabel());
-
-    // Fast-path copy.
+    // Compute the base source address in `temp1`.
+    GenArrayAddress(assembler, temp1, src, src_pos, type, data_offset);
     // Compute the base destination address in `temp2`.
-    GenSystemArrayCopyBaseAddress(GetAssembler(), type, dest, dest_pos, temp2);
-    // Iterate over the arrays and do a raw copy of the objects. We don't need to
-    // poison/unpoison.
-    __ Bind(&loop);
-    __ pushl(Address(temp1, 0));
-    __ cfi().AdjustCFAOffset(4);
-    __ popl(Address(temp2, 0));
-    __ cfi().AdjustCFAOffset(-4);
-    __ addl(temp1, Immediate(element_size));
-    __ addl(temp2, Immediate(element_size));
-    __ cmpl(temp1, temp3);
-    __ j(kNotEqual, &loop);
+    GenArrayAddress(assembler, temp2, dest, dest_pos, type, data_offset);
 
-    __ Bind(read_barrier_slow_path->GetExitLabel());
-    __ Bind(&done);
-  } else {
-    // Non read barrier code.
-    // Compute the base destination address in `temp2`.
-    GenSystemArrayCopyBaseAddress(GetAssembler(), type, dest, dest_pos, temp2);
-    // Compute the end source address in `temp3`.
-    GenSystemArrayCopyEndAddress(GetAssembler(), type, length, temp1, temp3);
-    // Iterate over the arrays and do a raw copy of the objects. We don't need to
-    // poison/unpoison.
-    NearLabel loop, done;
-    __ cmpl(temp1, temp3);
-    __ j(kEqual, &done);
-    __ Bind(&loop);
-    __ pushl(Address(temp1, 0));
-    __ cfi().AdjustCFAOffset(4);
-    __ popl(Address(temp2, 0));
-    __ cfi().AdjustCFAOffset(-4);
-    __ addl(temp1, Immediate(element_size));
-    __ addl(temp2, Immediate(element_size));
-    __ cmpl(temp1, temp3);
-    __ j(kNotEqual, &loop);
-    __ Bind(&done);
+    SlowPathCode* read_barrier_slow_path = nullptr;
+    if (codegen_->EmitBakerReadBarrier()) {
+      // SystemArrayCopy implementation for Baker read barriers (see
+      // also CodeGeneratorX86::GenerateReferenceLoadWithBakerReadBarrier):
+      //
+      //   if (src_ptr != end_ptr) {
+      //     uint32_t rb_state = Lockword(src->monitor_).ReadBarrierState();
+      //     lfence;  // Load fence or artificial data dependency to prevent load-load reordering
+      //     bool is_gray = (rb_state == ReadBarrier::GrayState());
+      //     if (is_gray) {
+      //       // Slow-path copy.
+      //       for (size_t i = 0; i != length; ++i) {
+      //         dest_array[dest_pos + i] =
+      //             MaybePoison(ReadBarrier::Mark(MaybeUnpoison(src_array[src_pos + i])));
+      //       }
+      //     } else {
+      //       // Fast-path copy.
+      //       do {
+      //         *dest_ptr++ = *src_ptr++;
+      //       } while (src_ptr != end_ptr)
+      //     }
+      //   }
+
+      // Given the numeric representation, it's enough to check the low bit of the rb_state.
+      static_assert(ReadBarrier::NonGrayState() == 0, "Expecting non-gray to have value 0");
+      static_assert(ReadBarrier::GrayState() == 1, "Expecting gray to have value 1");
+      constexpr uint32_t gray_byte_position = LockWord::kReadBarrierStateShift / kBitsPerByte;
+      constexpr uint32_t gray_bit_position = LockWord::kReadBarrierStateShift % kBitsPerByte;
+      constexpr int32_t test_value = static_cast<int8_t>(1 << gray_bit_position);
+
+      // if (rb_state == ReadBarrier::GrayState())
+      //   goto slow_path;
+      // At this point, just do the "if" and make sure that flags are preserved until the branch.
+      __ testb(Address(src, monitor_offset + gray_byte_position), Immediate(test_value));
+
+      // Load fence to prevent load-load reordering.
+      // Note that this is a no-op, thanks to the x86 memory model.
+      codegen_->GenerateMemoryBarrier(MemBarrierKind::kLoadAny);
+
+      // Slow path used to copy array when `src` is gray.
+      read_barrier_slow_path =
+          new (codegen_->GetScopedAllocator()) ReadBarrierSystemArrayCopySlowPathX86(invoke);
+      codegen_->AddSlowPath(read_barrier_slow_path);
+
+      // We have done the "if" of the gray bit check above, now branch based on the flags.
+      __ j(kNotZero, read_barrier_slow_path->GetEntryLabel());
+    }
+
+    Register temp3 = locations->GetTemp(2).AsRegister<Register>();
+    if (length.IsConstant()) {
+      __ movl(temp3, Immediate(length.GetConstant()->AsIntConstant()->GetValue()));
+    } else {
+      DCHECK_EQ(temp3, length.AsRegister<Register>());
+    }
+
+    // Iterate over the arrays and do a raw copy of the objects. We don't need to poison/unpoison.
+    DCHECK_EQ(temp1, ESI);
+    DCHECK_EQ(temp2, EDI);
+    DCHECK_EQ(temp3, ECX);
+    __ rep_movsl();
+
+    if (read_barrier_slow_path != nullptr) {
+      DCHECK(codegen_->EmitBakerReadBarrier());
+      __ Bind(read_barrier_slow_path->GetExitLabel());
+    }
+
+    // We only need one card marking on the destination array.
+    codegen_->MarkGCCard(temp1, temp3, dest);
+
+    __ Bind(&skip_copy_and_write_barrier);
   }
 
-  // We only need one card marking on the destination array.
-  codegen_->MarkGCCard(temp1, temp2, dest, Register(kNoRegister), /* emit_null_check= */ false);
-
   __ Bind(intrinsic_slow_path->GetExitLabel());
 }
 
@@ -3309,21 +3380,36 @@
   }
 }
 
-void IntrinsicLocationsBuilderX86::VisitIntegerValueOf(HInvoke* invoke) {
-  DCHECK(invoke->IsInvokeStaticOrDirect());
-  InvokeRuntimeCallingConvention calling_convention;
-  IntrinsicVisitor::ComputeIntegerValueOfLocations(
-      invoke,
-      codegen_,
-      Location::RegisterLocation(EAX),
-      Location::RegisterLocation(calling_convention.GetRegisterAt(0)));
-  RequestBaseMethodAddressInRegister(invoke);
-}
+#define VISIT_INTRINSIC(name, low, high, type, start_index) \
+  void IntrinsicLocationsBuilderX86::Visit ##name ##ValueOf(HInvoke* invoke) { \
+    InvokeRuntimeCallingConvention calling_convention; \
+    IntrinsicVisitor::ComputeValueOfLocations( \
+        invoke, \
+        codegen_, \
+        low, \
+        high - low + 1, \
+        Location::RegisterLocation(EAX), \
+        Location::RegisterLocation(calling_convention.GetRegisterAt(0))); \
+    RequestBaseMethodAddressInRegister(invoke); \
+  } \
+  void IntrinsicCodeGeneratorX86::Visit ##name ##ValueOf(HInvoke* invoke) { \
+    IntrinsicVisitor::ValueOfInfo info = \
+        IntrinsicVisitor::ComputeValueOfInfo( \
+            invoke, \
+            codegen_->GetCompilerOptions(), \
+            WellKnownClasses::java_lang_ ##name ##_value, \
+            low, \
+            high - low + 1, \
+            start_index); \
+    HandleValueOf(invoke, info, type); \
+  }
+  BOXED_TYPES(VISIT_INTRINSIC)
+#undef VISIT_INTRINSIC
 
-void IntrinsicCodeGeneratorX86::VisitIntegerValueOf(HInvoke* invoke) {
+void IntrinsicCodeGeneratorX86::HandleValueOf(HInvoke* invoke,
+                                              const IntrinsicVisitor::ValueOfInfo& info,
+                                              DataType::Type type) {
   DCHECK(invoke->IsInvokeStaticOrDirect());
-  IntrinsicVisitor::IntegerValueOfInfo info =
-      IntrinsicVisitor::ComputeIntegerValueOfInfo(invoke, codegen_->GetCompilerOptions());
   LocationSummary* locations = invoke->GetLocations();
   X86Assembler* assembler = GetAssembler();
 
@@ -3334,20 +3420,25 @@
     codegen_->InvokeRuntime(kQuickAllocObjectInitialized, invoke, invoke->GetDexPc());
     CheckEntrypointTypes<kQuickAllocObjectWithChecks, void*, mirror::Class*>();
   };
-  if (invoke->InputAt(0)->IsConstant()) {
+  if (invoke->InputAt(0)->IsIntConstant()) {
     int32_t value = invoke->InputAt(0)->AsIntConstant()->GetValue();
     if (static_cast<uint32_t>(value - info.low) < info.length) {
-      // Just embed the j.l.Integer in the code.
-      DCHECK_NE(info.value_boot_image_reference, IntegerValueOfInfo::kInvalidReference);
+      // Just embed the object in the code.
+      DCHECK_NE(info.value_boot_image_reference, ValueOfInfo::kInvalidReference);
       codegen_->LoadBootImageAddress(
           out, info.value_boot_image_reference, invoke->AsInvokeStaticOrDirect());
     } else {
       DCHECK(locations->CanCall());
       // Allocate and initialize a new j.l.Integer.
-      // TODO: If we JIT, we could allocate the j.l.Integer now, and store it in the
+      // TODO: If we JIT, we could allocate the object now, and store it in the
       // JIT object table.
       allocate_instance();
-      __ movl(Address(out, info.value_offset), Immediate(value));
+      codegen_->MoveToMemory(type,
+                             Location::ConstantLocation(invoke->InputAt(0)->AsIntConstant()),
+                             out,
+                             /* dst_index= */ Register::kNoRegister,
+                             /* dst_scale= */ TIMES_1,
+                             /* dst_disp= */ info.value_offset);
     }
   } else {
     DCHECK(locations->CanCall());
@@ -3357,7 +3448,7 @@
     __ cmpl(out, Immediate(info.length));
     NearLabel allocate, done;
     __ j(kAboveEqual, &allocate);
-    // If the value is within the bounds, load the j.l.Integer directly from the array.
+    // If the value is within the bounds, load the object directly from the array.
     constexpr size_t kElementSize = sizeof(mirror::HeapReference<mirror::Object>);
     static_assert((1u << TIMES_4) == sizeof(mirror::HeapReference<mirror::Object>),
                   "Check heap reference size.");
@@ -3385,9 +3476,14 @@
     __ MaybeUnpoisonHeapReference(out);
     __ jmp(&done);
     __ Bind(&allocate);
-    // Otherwise allocate and initialize a new j.l.Integer.
+    // Otherwise allocate and initialize a new object.
     allocate_instance();
-    __ movl(Address(out, info.value_offset), in);
+    codegen_->MoveToMemory(type,
+                           Location::RegisterLocation(in),
+                           out,
+                           /* dst_index= */ Register::kNoRegister,
+                           /* dst_scale= */ TIMES_1,
+                           /* dst_disp= */ info.value_offset);
     __ Bind(&done);
   }
 }
@@ -3407,7 +3503,7 @@
   SlowPathCode* slow_path = new (GetAllocator()) IntrinsicSlowPathX86(invoke);
   codegen_->AddSlowPath(slow_path);
 
-  if (gUseReadBarrier) {
+  if (codegen_->EmitReadBarrier()) {
     // Check self->GetWeakRefAccessEnabled().
     ThreadOffset32 offset = Thread::WeakRefAccessEnabledOffset<kX86PointerSize>();
     __ fs()->cmpl(Address::Absolute(offset),
@@ -3430,7 +3526,7 @@
 
   // Load the value from the field.
   uint32_t referent_offset = mirror::Reference::ReferentOffset().Uint32Value();
-  if (gUseReadBarrier && kUseBakerReadBarrier) {
+  if (codegen_->EmitBakerReadBarrier()) {
     codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
                                                     out,
                                                     obj.AsRegister<Register>(),
@@ -3449,7 +3545,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitReferenceRefersTo(HInvoke* invoke) {
-  IntrinsicVisitor::CreateReferenceRefersToLocations(invoke);
+  IntrinsicVisitor::CreateReferenceRefersToLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitReferenceRefersTo(HInvoke* invoke) {
@@ -3472,7 +3568,7 @@
   NearLabel end, return_true, return_false;
   __ cmpl(out, other);
 
-  if (gUseReadBarrier) {
+  if (codegen_->EmitReadBarrier()) {
     DCHECK(kUseBakerReadBarrier);
 
     __ j(kEqual, &return_true);
@@ -3534,7 +3630,7 @@
   locations->SetInAt(0, Location::Any());
 }
 
-void IntrinsicCodeGeneratorX86::VisitReachabilityFence(HInvoke* invoke ATTRIBUTE_UNUSED) { }
+void IntrinsicCodeGeneratorX86::VisitReachabilityFence([[maybe_unused]] HInvoke* invoke) {}
 
 void IntrinsicLocationsBuilderX86::VisitIntegerDivideUnsigned(HInvoke* invoke) {
   LocationSummary* locations = new (allocator_) LocationSummary(invoke,
@@ -3799,7 +3895,7 @@
   const uint32_t declaring_class_offset = ArtField::DeclaringClassOffset().Uint32Value();
   Register varhandle_object = locations->InAt(0).AsRegister<Register>();
 
-  // Load the ArtField and the offset
+  // Load the ArtField* and the offset.
   __ movl(temp, Address(varhandle_object, artfield_offset));
   __ movl(offset, Address(temp, offset_offset));
   size_t expected_coordinates_count = GetExpectedVarHandleCoordinatesCount(invoke);
@@ -3811,7 +3907,7 @@
                                            Location::RegisterLocation(temp),
                                            Address(temp, declaring_class_offset),
                                            /* fixup_label= */ nullptr,
-                                           gCompilerReadBarrierOption);
+                                           codegen->GetCompilerReadBarrierOption());
     return temp;
   }
 
@@ -3821,10 +3917,10 @@
   return locations->InAt(1).AsRegister<Register>();
 }
 
-static void CreateVarHandleGetLocations(HInvoke* invoke) {
+static void CreateVarHandleGetLocations(HInvoke* invoke, CodeGeneratorX86* codegen) {
   // The only read barrier implementation supporting the
   // VarHandleGet intrinsic is the Baker-style read barriers.
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+  if (codegen->EmitNonBakerReadBarrier()) {
     return;
   }
 
@@ -3866,7 +3962,7 @@
 static void GenerateVarHandleGet(HInvoke* invoke, CodeGeneratorX86* codegen) {
   // The only read barrier implementation supporting the
   // VarHandleGet intrinsic is the Baker-style read barriers.
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen->EmitReadBarrier(), kUseBakerReadBarrier);
 
   X86Assembler* assembler = codegen->GetAssembler();
   LocationSummary* locations = invoke->GetLocations();
@@ -3890,7 +3986,7 @@
   Address field_addr(ref, offset, TIMES_1, 0);
 
   // Load the value from the field
-  if (type == DataType::Type::kReference && gCompilerReadBarrierOption == kWithReadBarrier) {
+  if (type == DataType::Type::kReference && codegen->EmitReadBarrier()) {
     codegen->GenerateReferenceLoadWithBakerReadBarrier(
         invoke, out, ref, field_addr, /* needs_null_check= */ false);
   } else if (type == DataType::Type::kInt64 &&
@@ -3913,7 +4009,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGet(HInvoke* invoke) {
-  CreateVarHandleGetLocations(invoke);
+  CreateVarHandleGetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGet(HInvoke* invoke) {
@@ -3921,7 +4017,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetVolatile(HInvoke* invoke) {
-  CreateVarHandleGetLocations(invoke);
+  CreateVarHandleGetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetVolatile(HInvoke* invoke) {
@@ -3929,7 +4025,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetAcquire(HInvoke* invoke) {
-  CreateVarHandleGetLocations(invoke);
+  CreateVarHandleGetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetAcquire(HInvoke* invoke) {
@@ -3937,17 +4033,17 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetOpaque(HInvoke* invoke) {
-  CreateVarHandleGetLocations(invoke);
+  CreateVarHandleGetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetOpaque(HInvoke* invoke) {
   GenerateVarHandleGet(invoke, codegen_);
 }
 
-static void CreateVarHandleSetLocations(HInvoke* invoke) {
+static void CreateVarHandleSetLocations(HInvoke* invoke, CodeGeneratorX86* codegen) {
   // The only read barrier implementation supporting the
   // VarHandleGet intrinsic is the Baker-style read barriers.
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+  if (codegen->EmitNonBakerReadBarrier()) {
     return;
   }
 
@@ -4020,7 +4116,7 @@
 static void GenerateVarHandleSet(HInvoke* invoke, CodeGeneratorX86* codegen) {
   // The only read barrier implementation supporting the
   // VarHandleGet intrinsic is the Baker-style read barriers.
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen->EmitReadBarrier(), kUseBakerReadBarrier);
 
   X86Assembler* assembler = codegen->GetAssembler();
   LocationSummary* locations = invoke->GetLocations();
@@ -4080,13 +4176,14 @@
       is_volatile,
       /* value_can_be_null */ true,
       // Value can be null, and this write barrier is not being relied on for other sets.
-      WriteBarrierKind::kEmitWithNullCheck);
+      value_type == DataType::Type::kReference ? WriteBarrierKind::kEmitNotBeingReliedOn :
+                                                 WriteBarrierKind::kDontEmit);
 
   __ Bind(slow_path->GetExitLabel());
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleSet(HInvoke* invoke) {
-  CreateVarHandleSetLocations(invoke);
+  CreateVarHandleSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleSet(HInvoke* invoke) {
@@ -4094,7 +4191,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleSetVolatile(HInvoke* invoke) {
-  CreateVarHandleSetLocations(invoke);
+  CreateVarHandleSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleSetVolatile(HInvoke* invoke) {
@@ -4102,7 +4199,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleSetRelease(HInvoke* invoke) {
-  CreateVarHandleSetLocations(invoke);
+  CreateVarHandleSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleSetRelease(HInvoke* invoke) {
@@ -4110,17 +4207,17 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleSetOpaque(HInvoke* invoke) {
-  CreateVarHandleSetLocations(invoke);
+  CreateVarHandleSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleSetOpaque(HInvoke* invoke) {
   GenerateVarHandleSet(invoke, codegen_);
 }
 
-static void CreateVarHandleGetAndSetLocations(HInvoke* invoke) {
+static void CreateVarHandleGetAndSetLocations(HInvoke* invoke, CodeGeneratorX86* codegen) {
   // The only read barrier implementation supporting the
   // VarHandleGet intrinsic is the Baker-style read barriers.
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+  if (codegen->EmitNonBakerReadBarrier()) {
     return;
   }
 
@@ -4168,7 +4265,7 @@
 static void GenerateVarHandleGetAndSet(HInvoke* invoke, CodeGeneratorX86* codegen) {
   // The only read barrier implementation supporting the
   // VarHandleGet intrinsic is the Baker-style read barriers.
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen->EmitReadBarrier(), kUseBakerReadBarrier);
 
   X86Assembler* assembler = codegen->GetAssembler();
   LocationSummary* locations = invoke->GetLocations();
@@ -4227,7 +4324,7 @@
       __ movd(locations->Out().AsFpuRegister<XmmRegister>(), EAX);
       break;
     case DataType::Type::kReference: {
-      if (gUseReadBarrier && kUseBakerReadBarrier) {
+      if (codegen->EmitBakerReadBarrier()) {
         // Need to make sure the reference stored in the field is a to-space
         // one before attempting the CAS or the CAS could fail incorrectly.
         codegen->GenerateReferenceLoadWithBakerReadBarrier(
@@ -4240,8 +4337,7 @@
             /* always_update_field= */ true,
             &temp2);
       }
-      codegen->MarkGCCard(
-          temp, temp2, reference, value.AsRegister<Register>(), /* emit_null_check= */ false);
+      codegen->MarkGCCard(temp, temp2, reference);
       if (kPoisonHeapReferences) {
         __ movl(temp, value.AsRegister<Register>());
         __ PoisonHeapReference(temp);
@@ -4265,7 +4361,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetAndSet(HInvoke* invoke) {
-  CreateVarHandleGetAndSetLocations(invoke);
+  CreateVarHandleGetAndSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetAndSet(HInvoke* invoke) {
@@ -4273,7 +4369,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetAndSetAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndSetLocations(invoke);
+  CreateVarHandleGetAndSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetAndSetAcquire(HInvoke* invoke) {
@@ -4281,17 +4377,18 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetAndSetRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndSetLocations(invoke);
+  CreateVarHandleGetAndSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetAndSetRelease(HInvoke* invoke) {
   GenerateVarHandleGetAndSet(invoke, codegen_);
 }
 
-static void CreateVarHandleCompareAndSetOrExchangeLocations(HInvoke* invoke) {
+static void CreateVarHandleCompareAndSetOrExchangeLocations(HInvoke* invoke,
+                                                            CodeGeneratorX86* codegen) {
   // The only read barrier implementation supporting the
   // VarHandleGet intrinsic is the Baker-style read barriers.
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+  if (codegen->EmitNonBakerReadBarrier()) {
     return;
   }
 
@@ -4355,7 +4452,7 @@
 static void GenerateVarHandleCompareAndSetOrExchange(HInvoke* invoke, CodeGeneratorX86* codegen) {
   // The only read barrier implementation supporting the
   // VarHandleGet intrinsic is the Baker-style read barriers.
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen->EmitReadBarrier(), kUseBakerReadBarrier);
 
   X86Assembler* assembler = codegen->GetAssembler();
   LocationSummary* locations = invoke->GetLocations();
@@ -4408,7 +4505,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleCompareAndSet(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleCompareAndSet(HInvoke* invoke) {
@@ -4416,7 +4513,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleWeakCompareAndSet(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleWeakCompareAndSet(HInvoke* invoke) {
@@ -4424,7 +4521,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleWeakCompareAndSetPlain(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleWeakCompareAndSetPlain(HInvoke* invoke) {
@@ -4432,7 +4529,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleWeakCompareAndSetAcquire(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleWeakCompareAndSetAcquire(HInvoke* invoke) {
@@ -4440,7 +4537,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleWeakCompareAndSetRelease(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleWeakCompareAndSetRelease(HInvoke* invoke) {
@@ -4448,7 +4545,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleCompareAndExchange(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleCompareAndExchange(HInvoke* invoke) {
@@ -4456,7 +4553,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleCompareAndExchangeAcquire(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleCompareAndExchangeAcquire(HInvoke* invoke) {
@@ -4464,17 +4561,17 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleCompareAndExchangeRelease(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleCompareAndExchangeRelease(HInvoke* invoke) {
   GenerateVarHandleCompareAndSetOrExchange(invoke, codegen_);
 }
 
-static void CreateVarHandleGetAndAddLocations(HInvoke* invoke) {
+static void CreateVarHandleGetAndAddLocations(HInvoke* invoke, CodeGeneratorX86* codegen) {
   // The only read barrier implementation supporting the
   // VarHandleGet intrinsic is the Baker-style read barriers.
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+  if (codegen->EmitNonBakerReadBarrier()) {
     return;
   }
 
@@ -4523,7 +4620,7 @@
 static void GenerateVarHandleGetAndAdd(HInvoke* invoke, CodeGeneratorX86* codegen) {
   // The only read barrier implementation supporting the
   // VarHandleGet intrinsic is the Baker-style read barriers.
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen->EmitReadBarrier(), kUseBakerReadBarrier);
 
   X86Assembler* assembler = codegen->GetAssembler();
   LocationSummary* locations = invoke->GetLocations();
@@ -4598,7 +4695,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetAndAdd(HInvoke* invoke) {
-  CreateVarHandleGetAndAddLocations(invoke);
+  CreateVarHandleGetAndAddLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetAndAdd(HInvoke* invoke) {
@@ -4606,7 +4703,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetAndAddAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndAddLocations(invoke);
+  CreateVarHandleGetAndAddLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetAndAddAcquire(HInvoke* invoke) {
@@ -4614,17 +4711,17 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetAndAddRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndAddLocations(invoke);
+  CreateVarHandleGetAndAddLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetAndAddRelease(HInvoke* invoke) {
   GenerateVarHandleGetAndAdd(invoke, codegen_);
 }
 
-static void CreateVarHandleGetAndBitwiseOpLocations(HInvoke* invoke) {
+static void CreateVarHandleGetAndBitwiseOpLocations(HInvoke* invoke, CodeGeneratorX86* codegen) {
   // The only read barrier implementation supporting the
   // VarHandleGet intrinsic is the Baker-style read barriers.
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+  if (codegen->EmitNonBakerReadBarrier()) {
     return;
   }
 
@@ -4692,7 +4789,7 @@
 static void GenerateVarHandleGetAndBitwiseOp(HInvoke* invoke, CodeGeneratorX86* codegen) {
   // The only read barrier implementation supporting the
   // VarHandleGet intrinsic is the Baker-style read barriers.
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen->EmitReadBarrier(), kUseBakerReadBarrier);
 
   X86Assembler* assembler = codegen->GetAssembler();
   LocationSummary* locations = invoke->GetLocations();
@@ -4753,7 +4850,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetAndBitwiseOr(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetAndBitwiseOr(HInvoke* invoke) {
@@ -4761,7 +4858,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetAndBitwiseOrAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetAndBitwiseOrAcquire(HInvoke* invoke) {
@@ -4769,7 +4866,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetAndBitwiseOrRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetAndBitwiseOrRelease(HInvoke* invoke) {
@@ -4777,7 +4874,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetAndBitwiseXor(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetAndBitwiseXor(HInvoke* invoke) {
@@ -4785,7 +4882,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetAndBitwiseXorAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetAndBitwiseXorAcquire(HInvoke* invoke) {
@@ -4793,7 +4890,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetAndBitwiseXorRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetAndBitwiseXorRelease(HInvoke* invoke) {
@@ -4801,7 +4898,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetAndBitwiseAnd(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetAndBitwiseAnd(HInvoke* invoke) {
@@ -4809,7 +4906,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetAndBitwiseAndAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetAndBitwiseAndAcquire(HInvoke* invoke) {
@@ -4817,7 +4914,7 @@
 }
 
 void IntrinsicLocationsBuilderX86::VisitVarHandleGetAndBitwiseAndRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86::VisitVarHandleGetAndBitwiseAndRelease(HInvoke* invoke) {
diff --git a/compiler/optimizing/intrinsics_x86.h b/compiler/optimizing/intrinsics_x86.h
index 77c236d..565a92a 100644
--- a/compiler/optimizing/intrinsics_x86.h
+++ b/compiler/optimizing/intrinsics_x86.h
@@ -19,6 +19,7 @@
 
 #include "base/macros.h"
 #include "intrinsics.h"
+#include "intrinsics_list.h"
 
 namespace art HIDDEN {
 
@@ -39,9 +40,7 @@
 
 #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \
   void Visit ## Name(HInvoke* invoke) override;
-#include "intrinsics_list.h"
-  INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
-#undef INTRINSICS_LIST
+  ART_INTRINSICS_WITH_HINVOKE_LIST(OPTIMIZING_INTRINSICS)
 #undef OPTIMIZING_INTRINSICS
 
   // Check whether an invoke is an intrinsic, and if so, create a location summary. Returns whether
@@ -64,9 +63,7 @@
 
 #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \
   void Visit ## Name(HInvoke* invoke) override;
-#include "intrinsics_list.h"
-  INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
-#undef INTRINSICS_LIST
+  ART_INTRINSICS_WITH_HINVOKE_LIST(OPTIMIZING_INTRINSICS)
 #undef OPTIMIZING_INTRINSICS
 
  private:
@@ -74,6 +71,10 @@
 
   ArenaAllocator* GetAllocator();
 
+  void HandleValueOf(HInvoke* invoke,
+                     const IntrinsicVisitor::ValueOfInfo& info,
+                     DataType::Type type);
+
   CodeGeneratorX86* const codegen_;
 
   DISALLOW_COPY_AND_ASSIGN(IntrinsicCodeGeneratorX86);
diff --git a/compiler/optimizing/intrinsics_x86_64.cc b/compiler/optimizing/intrinsics_x86_64.cc
index 56bf5ea..1876a70 100644
--- a/compiler/optimizing/intrinsics_x86_64.cc
+++ b/compiler/optimizing/intrinsics_x86_64.cc
@@ -25,6 +25,7 @@
 #include "entrypoints/quick/quick_entrypoints.h"
 #include "heap_poisoning.h"
 #include "intrinsics.h"
+#include "intrinsic_objects.h"
 #include "intrinsics_utils.h"
 #include "lock_word.h"
 #include "mirror/array-inl.h"
@@ -35,6 +36,7 @@
 #include "thread-current-inl.h"
 #include "utils/x86_64/assembler_x86_64.h"
 #include "utils/x86_64/constants_x86_64.h"
+#include "well_known_classes.h"
 
 namespace art HIDDEN {
 
@@ -63,20 +65,35 @@
 
 using IntrinsicSlowPathX86_64 = IntrinsicSlowPath<InvokeDexCallingConventionVisitorX86_64>;
 
-// NOLINT on __ macro to suppress wrong warning/fix (misc-macro-parentheses) from clang-tidy.
-#define __ down_cast<X86_64Assembler*>(codegen->GetAssembler())->  // NOLINT
+#define __ assembler->
+
+static void GenArrayAddress(X86_64Assembler* assembler,
+                            CpuRegister dest,
+                            CpuRegister base,
+                            Location pos,
+                            DataType::Type type,
+                            uint32_t data_offset) {
+  // Note: The heap is in low 4GiB, so we're using LEAL rather than LEAQ to save on code size.
+  if (pos.IsConstant()) {
+    int32_t constant = pos.GetConstant()->AsIntConstant()->GetValue();
+    __ leal(dest, Address(base, DataType::Size(type) * constant + data_offset));
+  } else {
+    const ScaleFactor scale_factor = static_cast<ScaleFactor>(DataType::SizeShift(type));
+    __ leal(dest, Address(base, pos.AsRegister<CpuRegister>(), scale_factor, data_offset));
+  }
+}
 
 // Slow path implementing the SystemArrayCopy intrinsic copy loop with read barriers.
 class ReadBarrierSystemArrayCopySlowPathX86_64 : public SlowPathCode {
  public:
   explicit ReadBarrierSystemArrayCopySlowPathX86_64(HInstruction* instruction)
       : SlowPathCode(instruction) {
-    DCHECK(gUseReadBarrier);
-    DCHECK(kUseBakerReadBarrier);
   }
 
   void EmitNativeCode(CodeGenerator* codegen) override {
+    DCHECK(codegen->EmitBakerReadBarrier());
     CodeGeneratorX86_64* x86_64_codegen = down_cast<CodeGeneratorX86_64*>(codegen);
+    X86_64Assembler* assembler = x86_64_codegen->GetAssembler();
     LocationSummary* locations = instruction_->GetLocations();
     DCHECK(locations->CanCall());
     DCHECK(instruction_->IsInvokeStaticOrDirect())
@@ -84,14 +101,19 @@
         << instruction_->DebugName();
     DCHECK(instruction_->GetLocations()->Intrinsified());
     DCHECK_EQ(instruction_->AsInvoke()->GetIntrinsic(), Intrinsics::kSystemArrayCopy);
+    Location length = locations->InAt(4);
 
-    int32_t element_size = DataType::Size(DataType::Type::kReference);
+    const DataType::Type type = DataType::Type::kReference;
+    const int32_t element_size = DataType::Size(type);
 
     CpuRegister src_curr_addr = locations->GetTemp(0).AsRegister<CpuRegister>();
     CpuRegister dst_curr_addr = locations->GetTemp(1).AsRegister<CpuRegister>();
     CpuRegister src_stop_addr = locations->GetTemp(2).AsRegister<CpuRegister>();
 
     __ Bind(GetEntryLabel());
+    // The `src_curr_addr` and `dst_curr_addr` were initialized before entering the slow-path.
+    GenArrayAddress(assembler, src_stop_addr, src_curr_addr, length, type, /*data_offset=*/ 0u);
+
     NearLabel loop;
     __ Bind(&loop);
     __ movl(CpuRegister(TMP), Address(src_curr_addr, 0));
@@ -119,10 +141,6 @@
   DISALLOW_COPY_AND_ASSIGN(ReadBarrierSystemArrayCopySlowPathX86_64);
 };
 
-#undef __
-
-#define __ assembler->
-
 static void CreateFPToIntLocations(ArenaAllocator* allocator, HInvoke* invoke) {
   LocationSummary* locations =
       new (allocator) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
@@ -222,34 +240,34 @@
     double kPositiveInfinity = std::numeric_limits<double>::infinity();
     double kNegativeInfinity = -1 * kPositiveInfinity;
 
-     __ xorq(output, output);
-     __ comisd(input, codegen->LiteralDoubleAddress(kPositiveInfinity));
-     __ j(kNotEqual, &done1);
-     __ j(kParityEven, &done2);
-     __ movq(output, Immediate(1));
-     __ jmp(&done2);
-     __ Bind(&done1);
-     __ comisd(input, codegen->LiteralDoubleAddress(kNegativeInfinity));
-     __ j(kNotEqual, &done2);
-     __ j(kParityEven, &done2);
-     __ movq(output, Immediate(1));
-     __ Bind(&done2);
+    __ xorq(output, output);
+    __ comisd(input, codegen->LiteralDoubleAddress(kPositiveInfinity));
+    __ j(kNotEqual, &done1);
+    __ j(kParityEven, &done2);
+    __ movq(output, Immediate(1));
+    __ jmp(&done2);
+    __ Bind(&done1);
+    __ comisd(input, codegen->LiteralDoubleAddress(kNegativeInfinity));
+    __ j(kNotEqual, &done2);
+    __ j(kParityEven, &done2);
+    __ movq(output, Immediate(1));
+    __ Bind(&done2);
   } else {
     float kPositiveInfinity = std::numeric_limits<float>::infinity();
     float kNegativeInfinity = -1 * kPositiveInfinity;
 
-     __ xorl(output, output);
-     __ comiss(input, codegen->LiteralFloatAddress(kPositiveInfinity));
-     __ j(kNotEqual, &done1);
-     __ j(kParityEven, &done2);
-     __ movl(output, Immediate(1));
-     __ jmp(&done2);
-     __ Bind(&done1);
-     __ comiss(input, codegen->LiteralFloatAddress(kNegativeInfinity));
-     __ j(kNotEqual, &done2);
-     __ j(kParityEven, &done2);
-     __ movl(output, Immediate(1));
-     __ Bind(&done2);
+    __ xorl(output, output);
+    __ comiss(input, codegen->LiteralFloatAddress(kPositiveInfinity));
+    __ j(kNotEqual, &done1);
+    __ j(kParityEven, &done2);
+    __ movl(output, Immediate(1));
+    __ jmp(&done2);
+    __ Bind(&done1);
+    __ comiss(input, codegen->LiteralFloatAddress(kNegativeInfinity));
+    __ j(kNotEqual, &done2);
+    __ j(kParityEven, &done2);
+    __ movl(output, Immediate(1));
+    __ Bind(&done2);
   }
 }
 
@@ -617,8 +635,8 @@
 static void CreateSystemArrayCopyLocations(HInvoke* invoke) {
   // Check to see if we have known failures that will cause us to have to bail out
   // to the runtime, and just generate the runtime call directly.
-  HIntConstant* src_pos = invoke->InputAt(1)->AsIntConstant();
-  HIntConstant* dest_pos = invoke->InputAt(3)->AsIntConstant();
+  HIntConstant* src_pos = invoke->InputAt(1)->AsIntConstantOrNull();
+  HIntConstant* dest_pos = invoke->InputAt(3)->AsIntConstantOrNull();
 
   // The positions must be non-negative.
   if ((src_pos != nullptr && src_pos->GetValue() < 0) ||
@@ -628,7 +646,7 @@
   }
 
   // The length must be > 0.
-  HIntConstant* length = invoke->InputAt(4)->AsIntConstant();
+  HIntConstant* length = invoke->InputAt(4)->AsIntConstantOrNull();
   if (length != nullptr) {
     int32_t len = length->GetValue();
     if (len < 0) {
@@ -646,50 +664,56 @@
   locations->SetInAt(3, Location::RegisterOrConstant(invoke->InputAt(3)));
   locations->SetInAt(4, Location::RegisterOrConstant(invoke->InputAt(4)));
 
-  // And we need some temporaries.  We will use REP MOVSW, so we need fixed registers.
+  // And we need some temporaries.  We will use REP MOVS{B,W,L}, so we need fixed registers.
   locations->AddTemp(Location::RegisterLocation(RSI));
   locations->AddTemp(Location::RegisterLocation(RDI));
   locations->AddTemp(Location::RegisterLocation(RCX));
 }
 
-static void CheckPosition(X86_64Assembler* assembler,
-                          Location pos,
-                          CpuRegister input,
-                          Location length,
-                          SlowPathCode* slow_path,
-                          CpuRegister temp,
-                          bool length_is_input_length = false) {
+template <typename LhsType>
+static void EmitCmplJLess(X86_64Assembler* assembler,
+                          LhsType lhs,
+                          Location rhs,
+                          Label* label) {
+  static_assert(std::is_same_v<LhsType, CpuRegister> || std::is_same_v<LhsType, Address>);
+  if (rhs.IsConstant()) {
+    int32_t rhs_constant = rhs.GetConstant()->AsIntConstant()->GetValue();
+    __ cmpl(lhs, Immediate(rhs_constant));
+  } else {
+    __ cmpl(lhs, rhs.AsRegister<CpuRegister>());
+  }
+  __ j(kLess, label);
+}
+
+static void CheckSystemArrayCopyPosition(X86_64Assembler* assembler,
+                                         CpuRegister array,
+                                         Location pos,
+                                         Location length,
+                                         SlowPathCode* slow_path,
+                                         CpuRegister temp,
+                                         bool length_is_array_length,
+                                         bool position_sign_checked) {
   // Where is the length in the Array?
   const uint32_t length_offset = mirror::Array::LengthOffset().Uint32Value();
 
   if (pos.IsConstant()) {
     int32_t pos_const = pos.GetConstant()->AsIntConstant()->GetValue();
     if (pos_const == 0) {
-      if (!length_is_input_length) {
-        // Check that length(input) >= length.
-        if (length.IsConstant()) {
-          __ cmpl(Address(input, length_offset),
-                  Immediate(length.GetConstant()->AsIntConstant()->GetValue()));
-        } else {
-          __ cmpl(Address(input, length_offset), length.AsRegister<CpuRegister>());
-        }
-        __ j(kLess, slow_path->GetEntryLabel());
+      if (!length_is_array_length) {
+        // Check that length(array) >= length.
+        EmitCmplJLess(assembler, Address(array, length_offset), length, slow_path->GetEntryLabel());
       }
     } else {
-      // Check that length(input) >= pos.
-      __ movl(temp, Address(input, length_offset));
+      // Calculate length(array) - pos.
+      // Both operands are known to be non-negative `int32_t`, so the difference cannot underflow
+      // as `int32_t`. If the result is negative, the JL below shall go to the slow path.
+      __ movl(temp, Address(array, length_offset));
       __ subl(temp, Immediate(pos_const));
-      __ j(kLess, slow_path->GetEntryLabel());
 
-      // Check that (length(input) - pos) >= length.
-      if (length.IsConstant()) {
-        __ cmpl(temp, Immediate(length.GetConstant()->AsIntConstant()->GetValue()));
-      } else {
-        __ cmpl(temp, length.AsRegister<CpuRegister>());
-      }
-      __ j(kLess, slow_path->GetEntryLabel());
+      // Check that (length(array) - pos) >= length.
+      EmitCmplJLess(assembler, temp, length, slow_path->GetEntryLabel());
     }
-  } else if (length_is_input_length) {
+  } else if (length_is_array_length) {
     // The only way the copy can succeed is if pos is zero.
     CpuRegister pos_reg = pos.AsRegister<CpuRegister>();
     __ testl(pos_reg, pos_reg);
@@ -697,22 +721,19 @@
   } else {
     // Check that pos >= 0.
     CpuRegister pos_reg = pos.AsRegister<CpuRegister>();
-    __ testl(pos_reg, pos_reg);
-    __ j(kLess, slow_path->GetEntryLabel());
-
-    // Check that pos <= length(input).
-    __ cmpl(Address(input, length_offset), pos_reg);
-    __ j(kLess, slow_path->GetEntryLabel());
-
-    // Check that (length(input) - pos) >= length.
-    __ movl(temp, Address(input, length_offset));
-    __ subl(temp, pos_reg);
-    if (length.IsConstant()) {
-      __ cmpl(temp, Immediate(length.GetConstant()->AsIntConstant()->GetValue()));
-    } else {
-      __ cmpl(temp, length.AsRegister<CpuRegister>());
+    if (!position_sign_checked) {
+      __ testl(pos_reg, pos_reg);
+      __ j(kLess, slow_path->GetEntryLabel());
     }
-    __ j(kLess, slow_path->GetEntryLabel());
+
+    // Calculate length(array) - pos.
+    // Both operands are known to be non-negative `int32_t`, so the difference cannot underflow
+    // as `int32_t`. If the result is negative, the JL below shall go to the slow path.
+    __ movl(temp, Address(array, length_offset));
+    __ subl(temp, pos_reg);
+
+    // Check that (length(array) - pos) >= length.
+    EmitCmplJLess(assembler, temp, length, slow_path->GetEntryLabel());
   }
 }
 
@@ -758,10 +779,24 @@
   }
 
   // Validity checks: source. Use src_base as a temporary register.
-  CheckPosition(assembler, src_pos, src, length, slow_path, src_base);
+  CheckSystemArrayCopyPosition(assembler,
+                               src,
+                               src_pos,
+                               length,
+                               slow_path,
+                               src_base,
+                               /*length_is_array_length=*/ false,
+                               /*position_sign_checked=*/ false);
 
   // Validity checks: dest. Use src_base as a temporary register.
-  CheckPosition(assembler, dest_pos, dest, length, slow_path, src_base);
+  CheckSystemArrayCopyPosition(assembler,
+                               dest,
+                               dest_pos,
+                               length,
+                               slow_path,
+                               src_base,
+                               /*length_is_array_length=*/ false,
+                               /*position_sign_checked=*/ false);
 
   // We need the count in RCX.
   if (length.IsConstant()) {
@@ -773,22 +808,10 @@
   // Okay, everything checks out.  Finally time to do the copy.
   // Check assumption that sizeof(Char) is 2 (used in scaling below).
   const size_t data_size = DataType::Size(type);
-  const ScaleFactor scale_factor = CodeGenerator::ScaleFactorForType(type);
   const uint32_t data_offset = mirror::Array::DataOffset(data_size).Uint32Value();
 
-  if (src_pos.IsConstant()) {
-    int32_t src_pos_const = src_pos.GetConstant()->AsIntConstant()->GetValue();
-    __ leal(src_base, Address(src, data_size * src_pos_const + data_offset));
-  } else {
-    __ leal(src_base, Address(src, src_pos.AsRegister<CpuRegister>(), scale_factor, data_offset));
-  }
-  if (dest_pos.IsConstant()) {
-    int32_t dest_pos_const = dest_pos.GetConstant()->AsIntConstant()->GetValue();
-    __ leal(dest_base, Address(dest, data_size * dest_pos_const + data_offset));
-  } else {
-    __ leal(dest_base,
-            Address(dest, dest_pos.AsRegister<CpuRegister>(), scale_factor, data_offset));
-  }
+  GenArrayAddress(assembler, src_base, src, src_pos, type, data_offset);
+  GenArrayAddress(assembler, dest_base, dest, dest_pos, type, data_offset);
 
   // Do the move.
   switch (type) {
@@ -836,58 +859,27 @@
 void IntrinsicLocationsBuilderX86_64::VisitSystemArrayCopy(HInvoke* invoke) {
   // The only read barrier implementation supporting the
   // SystemArrayCopy intrinsic is the Baker-style read barriers.
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+  if (codegen_->EmitNonBakerReadBarrier()) {
     return;
   }
 
-  CodeGenerator::CreateSystemArrayCopyLocationSummary(invoke);
-}
-
-// Compute base source address, base destination address, and end
-// source address for the System.arraycopy intrinsic in `src_base`,
-// `dst_base` and `src_end` respectively.
-static void GenSystemArrayCopyAddresses(X86_64Assembler* assembler,
-                                        DataType::Type type,
-                                        const CpuRegister& src,
-                                        const Location& src_pos,
-                                        const CpuRegister& dst,
-                                        const Location& dst_pos,
-                                        const Location& copy_length,
-                                        const CpuRegister& src_base,
-                                        const CpuRegister& dst_base,
-                                        const CpuRegister& src_end) {
-  // This routine is only used by the SystemArrayCopy intrinsic.
-  DCHECK_EQ(type, DataType::Type::kReference);
-  const int32_t element_size = DataType::Size(type);
-  const ScaleFactor scale_factor = static_cast<ScaleFactor>(DataType::SizeShift(type));
-  const uint32_t data_offset = mirror::Array::DataOffset(element_size).Uint32Value();
-
-  if (src_pos.IsConstant()) {
-    int32_t constant = src_pos.GetConstant()->AsIntConstant()->GetValue();
-    __ leal(src_base, Address(src, element_size * constant + data_offset));
-  } else {
-    __ leal(src_base, Address(src, src_pos.AsRegister<CpuRegister>(), scale_factor, data_offset));
-  }
-
-  if (dst_pos.IsConstant()) {
-    int32_t constant = dst_pos.GetConstant()->AsIntConstant()->GetValue();
-    __ leal(dst_base, Address(dst, element_size * constant + data_offset));
-  } else {
-    __ leal(dst_base, Address(dst, dst_pos.AsRegister<CpuRegister>(), scale_factor, data_offset));
-  }
-
-  if (copy_length.IsConstant()) {
-    int32_t constant = copy_length.GetConstant()->AsIntConstant()->GetValue();
-    __ leal(src_end, Address(src_base, element_size * constant));
-  } else {
-    __ leal(src_end, Address(src_base, copy_length.AsRegister<CpuRegister>(), scale_factor, 0));
+  constexpr int32_t kLengthThreshold = -1;  // No cut-off - handle large arrays in intrinsic code.
+  constexpr size_t kInitialNumTemps = 0u;  // We shall allocate temps explicitly.
+  LocationSummary* locations = CodeGenerator::CreateSystemArrayCopyLocationSummary(
+      invoke, kLengthThreshold, kInitialNumTemps);
+  if (locations != nullptr) {
+    // Add temporaries.  We will use REP MOVSL, so we need fixed registers.
+    DCHECK_EQ(locations->GetTempCount(), kInitialNumTemps);
+    locations->AddTemp(Location::RegisterLocation(RSI));
+    locations->AddTemp(Location::RegisterLocation(RDI));
+    locations->AddTemp(Location::RegisterLocation(RCX));
   }
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitSystemArrayCopy(HInvoke* invoke) {
   // The only read barrier implementation supporting the
   // SystemArrayCopy intrinsic is the Baker-style read barriers.
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen_->EmitReadBarrier(), kUseBakerReadBarrier);
 
   X86_64Assembler* assembler = GetAssembler();
   LocationSummary* locations = invoke->GetLocations();
@@ -909,7 +901,6 @@
   CpuRegister temp2 = temp2_loc.AsRegister<CpuRegister>();
   Location temp3_loc = locations->GetTemp(2);
   CpuRegister temp3 = temp3_loc.AsRegister<CpuRegister>();
-  Location TMP_loc = Location::RegisterLocation(TMP);
 
   SlowPathCode* intrinsic_slow_path =
       new (codegen_->GetScopedAllocator()) IntrinsicSlowPathX86_64(invoke);
@@ -918,39 +909,35 @@
   NearLabel conditions_on_positions_validated;
   SystemArrayCopyOptimizations optimizations(invoke);
 
-  // If source and destination are the same, we go to slow path if we need to do
-  // forward copying.
-  if (src_pos.IsConstant()) {
-    int32_t src_pos_constant = src_pos.GetConstant()->AsIntConstant()->GetValue();
-    if (dest_pos.IsConstant()) {
-      int32_t dest_pos_constant = dest_pos.GetConstant()->AsIntConstant()->GetValue();
-      if (optimizations.GetDestinationIsSource()) {
-        // Checked when building locations.
-        DCHECK_GE(src_pos_constant, dest_pos_constant);
-      } else if (src_pos_constant < dest_pos_constant) {
-        __ cmpl(src, dest);
-        __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
+  // If source and destination are the same, we go to slow path if we need to do forward copying.
+  // We do not need to do this check if the source and destination positions are the same.
+  if (!optimizations.GetSourcePositionIsDestinationPosition()) {
+    if (src_pos.IsConstant()) {
+      int32_t src_pos_constant = src_pos.GetConstant()->AsIntConstant()->GetValue();
+      if (dest_pos.IsConstant()) {
+        int32_t dest_pos_constant = dest_pos.GetConstant()->AsIntConstant()->GetValue();
+        if (optimizations.GetDestinationIsSource()) {
+          // Checked when building locations.
+          DCHECK_GE(src_pos_constant, dest_pos_constant);
+        } else if (src_pos_constant < dest_pos_constant) {
+          __ cmpl(src, dest);
+          __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
+        }
+      } else {
+        if (!optimizations.GetDestinationIsSource()) {
+          __ cmpl(src, dest);
+          __ j(kNotEqual, &conditions_on_positions_validated);
+        }
+        __ cmpl(dest_pos.AsRegister<CpuRegister>(), Immediate(src_pos_constant));
+        __ j(kGreater, intrinsic_slow_path->GetEntryLabel());
       }
     } else {
       if (!optimizations.GetDestinationIsSource()) {
         __ cmpl(src, dest);
         __ j(kNotEqual, &conditions_on_positions_validated);
       }
-      __ cmpl(dest_pos.AsRegister<CpuRegister>(), Immediate(src_pos_constant));
-      __ j(kGreater, intrinsic_slow_path->GetEntryLabel());
-    }
-  } else {
-    if (!optimizations.GetDestinationIsSource()) {
-      __ cmpl(src, dest);
-      __ j(kNotEqual, &conditions_on_positions_validated);
-    }
-    if (dest_pos.IsConstant()) {
-      int32_t dest_pos_constant = dest_pos.GetConstant()->AsIntConstant()->GetValue();
-      __ cmpl(src_pos.AsRegister<CpuRegister>(), Immediate(dest_pos_constant));
-      __ j(kLess, intrinsic_slow_path->GetEntryLabel());
-    } else {
-      __ cmpl(src_pos.AsRegister<CpuRegister>(), dest_pos.AsRegister<CpuRegister>());
-      __ j(kLess, intrinsic_slow_path->GetEntryLabel());
+      CpuRegister src_pos_reg = src_pos.AsRegister<CpuRegister>();
+      EmitCmplJLess(assembler, src_pos_reg, dest_pos, intrinsic_slow_path->GetEntryLabel());
     }
   }
 
@@ -978,22 +965,39 @@
   }
 
   // Validity checks: source.
-  CheckPosition(assembler,
-                src_pos,
-                src,
-                length,
-                intrinsic_slow_path,
-                temp1,
-                optimizations.GetCountIsSourceLength());
+  CheckSystemArrayCopyPosition(assembler,
+                               src,
+                               src_pos,
+                               length,
+                               intrinsic_slow_path,
+                               temp1,
+                               optimizations.GetCountIsSourceLength(),
+                               /*position_sign_checked=*/ false);
 
   // Validity checks: dest.
-  CheckPosition(assembler,
-                dest_pos,
-                dest,
-                length,
-                intrinsic_slow_path,
-                temp1,
-                optimizations.GetCountIsDestinationLength());
+  bool dest_position_sign_checked = optimizations.GetSourcePositionIsDestinationPosition();
+  CheckSystemArrayCopyPosition(assembler,
+                               dest,
+                               dest_pos,
+                               length,
+                               intrinsic_slow_path,
+                               temp1,
+                               optimizations.GetCountIsDestinationLength(),
+                               dest_position_sign_checked);
+
+  auto check_non_primitive_array_class = [&](CpuRegister klass, CpuRegister temp) {
+    // No read barrier is needed for reading a chain of constant references for comparing
+    // with null, or for reading a constant primitive value, see `ReadBarrierOption`.
+    // /* HeapReference<Class> */ temp = klass->component_type_
+    __ movl(temp, Address(klass, component_offset));
+    __ MaybeUnpoisonHeapReference(temp);
+    // Check that the component type is not null.
+    __ testl(temp, temp);
+    __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
+    // Check that the component type is not a primitive.
+    __ cmpw(Address(temp, primitive_offset), Immediate(Primitive::kPrimNot));
+    __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
+  };
 
   if (!optimizations.GetDoesNotNeedTypeCheck()) {
     // Check whether all elements of the source array are assignable to the component
@@ -1001,8 +1005,7 @@
     // or the destination is Object[]. If none of these checks succeed, we go to the
     // slow path.
 
-    bool did_unpoison = false;
-    if (gUseReadBarrier && kUseBakerReadBarrier) {
+    if (codegen_->EmitBakerReadBarrier()) {
       // /* HeapReference<Class> */ temp1 = dest->klass_
       codegen_->GenerateFieldLoadWithBakerReadBarrier(
           invoke, temp1_loc, dest, class_offset, /* needs_null_check= */ false);
@@ -1014,218 +1017,147 @@
       // /* HeapReference<Class> */ temp2 = src->klass_
       codegen_->GenerateFieldLoadWithBakerReadBarrier(
           invoke, temp2_loc, src, class_offset, /* needs_null_check= */ false);
-      // If heap poisoning is enabled, `temp1` and `temp2` have been
-      // unpoisoned by the the previous calls to
-      // GenerateFieldLoadWithBakerReadBarrier.
+      // If heap poisoning is enabled, `temp1` and `temp2` have been unpoisoned
+      // by the previous calls to GenerateFieldLoadWithBakerReadBarrier.
     } else {
       // /* HeapReference<Class> */ temp1 = dest->klass_
       __ movl(temp1, Address(dest, class_offset));
+      __ MaybeUnpoisonHeapReference(temp1);
       // /* HeapReference<Class> */ temp2 = src->klass_
       __ movl(temp2, Address(src, class_offset));
-      if (!optimizations.GetDestinationIsNonPrimitiveArray() ||
-          !optimizations.GetSourceIsNonPrimitiveArray()) {
-        // One or two of the references need to be unpoisoned. Unpoison them
-        // both to make the identity check valid.
-        __ MaybeUnpoisonHeapReference(temp1);
-        __ MaybeUnpoisonHeapReference(temp2);
-        did_unpoison = true;
-      }
-    }
-
-    if (!optimizations.GetDestinationIsNonPrimitiveArray()) {
-      // Bail out if the destination is not a non primitive array.
-      if (gUseReadBarrier && kUseBakerReadBarrier) {
-        // /* HeapReference<Class> */ TMP = temp1->component_type_
-        codegen_->GenerateFieldLoadWithBakerReadBarrier(
-            invoke, TMP_loc, temp1, component_offset, /* needs_null_check= */ false);
-        __ testl(CpuRegister(TMP), CpuRegister(TMP));
-        __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
-        // If heap poisoning is enabled, `TMP` has been unpoisoned by
-        // the the previous call to GenerateFieldLoadWithBakerReadBarrier.
-      } else {
-        // /* HeapReference<Class> */ TMP = temp1->component_type_
-        __ movl(CpuRegister(TMP), Address(temp1, component_offset));
-        __ testl(CpuRegister(TMP), CpuRegister(TMP));
-        __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
-        __ MaybeUnpoisonHeapReference(CpuRegister(TMP));
-      }
-      __ cmpw(Address(CpuRegister(TMP), primitive_offset), Immediate(Primitive::kPrimNot));
-      __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
-    }
-
-    if (!optimizations.GetSourceIsNonPrimitiveArray()) {
-      // Bail out if the source is not a non primitive array.
-      if (gUseReadBarrier && kUseBakerReadBarrier) {
-        // For the same reason given earlier, `temp1` is not trashed by the
-        // read barrier emitted by GenerateFieldLoadWithBakerReadBarrier below.
-        // /* HeapReference<Class> */ TMP = temp2->component_type_
-        codegen_->GenerateFieldLoadWithBakerReadBarrier(
-            invoke, TMP_loc, temp2, component_offset, /* needs_null_check= */ false);
-        __ testl(CpuRegister(TMP), CpuRegister(TMP));
-        __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
-        // If heap poisoning is enabled, `TMP` has been unpoisoned by
-        // the the previous call to GenerateFieldLoadWithBakerReadBarrier.
-      } else {
-        // /* HeapReference<Class> */ TMP = temp2->component_type_
-        __ movl(CpuRegister(TMP), Address(temp2, component_offset));
-        __ testl(CpuRegister(TMP), CpuRegister(TMP));
-        __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
-        __ MaybeUnpoisonHeapReference(CpuRegister(TMP));
-      }
-      __ cmpw(Address(CpuRegister(TMP), primitive_offset), Immediate(Primitive::kPrimNot));
-      __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
+      __ MaybeUnpoisonHeapReference(temp2);
     }
 
     __ cmpl(temp1, temp2);
-
     if (optimizations.GetDestinationIsTypedObjectArray()) {
+      DCHECK(optimizations.GetDestinationIsNonPrimitiveArray());
       NearLabel do_copy;
+      // For class match, we can skip the source type check regardless of the optimization flag.
       __ j(kEqual, &do_copy);
-      if (gUseReadBarrier && kUseBakerReadBarrier) {
-        // /* HeapReference<Class> */ temp1 = temp1->component_type_
-        codegen_->GenerateFieldLoadWithBakerReadBarrier(
-            invoke, temp1_loc, temp1, component_offset, /* needs_null_check= */ false);
-        // We do not need to emit a read barrier for the following
-        // heap reference load, as `temp1` is only used in a
-        // comparison with null below, and this reference is not
-        // kept afterwards.
-        __ cmpl(Address(temp1, super_offset), Immediate(0));
-      } else {
-        if (!did_unpoison) {
-          __ MaybeUnpoisonHeapReference(temp1);
-        }
-        // /* HeapReference<Class> */ temp1 = temp1->component_type_
-        __ movl(temp1, Address(temp1, component_offset));
-        __ MaybeUnpoisonHeapReference(temp1);
-        // No need to unpoison the following heap reference load, as
-        // we're comparing against null.
-        __ cmpl(Address(temp1, super_offset), Immediate(0));
-      }
+      // No read barrier is needed for reading a chain of constant references
+      // for comparing with null, see `ReadBarrierOption`.
+      // /* HeapReference<Class> */ temp1 = temp1->component_type_
+      __ movl(temp1, Address(temp1, component_offset));
+      __ MaybeUnpoisonHeapReference(temp1);
+      // No need to unpoison the following heap reference load, as
+      // we're comparing against null.
+      __ cmpl(Address(temp1, super_offset), Immediate(0));
       __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
+      // Bail out if the source is not a non primitive array.
+      if (!optimizations.GetSourceIsNonPrimitiveArray()) {
+        check_non_primitive_array_class(temp2, CpuRegister(TMP));
+      }
       __ Bind(&do_copy);
     } else {
+      DCHECK(!optimizations.GetDestinationIsTypedObjectArray());
+      // For class match, we can skip the array type check completely if at least one of source
+      // and destination is known to be a non primitive array, otherwise one check is enough.
       __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
+      if (!optimizations.GetDestinationIsNonPrimitiveArray() &&
+          !optimizations.GetSourceIsNonPrimitiveArray()) {
+        check_non_primitive_array_class(temp2, CpuRegister(TMP));
+      }
     }
   } else if (!optimizations.GetSourceIsNonPrimitiveArray()) {
     DCHECK(optimizations.GetDestinationIsNonPrimitiveArray());
     // Bail out if the source is not a non primitive array.
-    if (gUseReadBarrier && kUseBakerReadBarrier) {
-      // /* HeapReference<Class> */ temp1 = src->klass_
-      codegen_->GenerateFieldLoadWithBakerReadBarrier(
-          invoke, temp1_loc, src, class_offset, /* needs_null_check= */ false);
-      // /* HeapReference<Class> */ TMP = temp1->component_type_
-      codegen_->GenerateFieldLoadWithBakerReadBarrier(
-          invoke, TMP_loc, temp1, component_offset, /* needs_null_check= */ false);
-      __ testl(CpuRegister(TMP), CpuRegister(TMP));
-      __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
-    } else {
-      // /* HeapReference<Class> */ temp1 = src->klass_
-      __ movl(temp1, Address(src, class_offset));
-      __ MaybeUnpoisonHeapReference(temp1);
-      // /* HeapReference<Class> */ TMP = temp1->component_type_
-      __ movl(CpuRegister(TMP), Address(temp1, component_offset));
-      // No need to unpoison `TMP` now, as we're comparing against null.
-      __ testl(CpuRegister(TMP), CpuRegister(TMP));
-      __ j(kEqual, intrinsic_slow_path->GetEntryLabel());
-      __ MaybeUnpoisonHeapReference(CpuRegister(TMP));
-    }
-    __ cmpw(Address(CpuRegister(TMP), primitive_offset), Immediate(Primitive::kPrimNot));
-    __ j(kNotEqual, intrinsic_slow_path->GetEntryLabel());
+    // No read barrier is needed for reading a chain of constant references for comparing
+    // with null, or for reading a constant primitive value, see `ReadBarrierOption`.
+    // /* HeapReference<Class> */ temp1 = src->klass_
+    __ movl(temp1, Address(src, class_offset));
+    __ MaybeUnpoisonHeapReference(temp1);
+    check_non_primitive_array_class(temp1, CpuRegister(TMP));
   }
 
-  const DataType::Type type = DataType::Type::kReference;
-  const int32_t element_size = DataType::Size(type);
-
-  // Compute base source address, base destination address, and end
-  // source address in `temp1`, `temp2` and `temp3` respectively.
-  GenSystemArrayCopyAddresses(
-      GetAssembler(), type, src, src_pos, dest, dest_pos, length, temp1, temp2, temp3);
-
-  if (gUseReadBarrier && kUseBakerReadBarrier) {
-    // SystemArrayCopy implementation for Baker read barriers (see
-    // also CodeGeneratorX86_64::GenerateReferenceLoadWithBakerReadBarrier):
-    //
-    //   if (src_ptr != end_ptr) {
-    //     uint32_t rb_state = Lockword(src->monitor_).ReadBarrierState();
-    //     lfence;  // Load fence or artificial data dependency to prevent load-load reordering
-    //     bool is_gray = (rb_state == ReadBarrier::GrayState());
-    //     if (is_gray) {
-    //       // Slow-path copy.
-    //       do {
-    //         *dest_ptr++ = MaybePoison(ReadBarrier::Mark(MaybeUnpoison(*src_ptr++)));
-    //       } while (src_ptr != end_ptr)
-    //     } else {
-    //       // Fast-path copy.
-    //       do {
-    //         *dest_ptr++ = *src_ptr++;
-    //       } while (src_ptr != end_ptr)
-    //     }
-    //   }
-
-    NearLabel loop, done;
+  if (length.IsConstant() && length.GetConstant()->AsIntConstant()->GetValue() == 0) {
+    // Null constant length: not need to emit the loop code at all.
+  } else {
+    const DataType::Type type = DataType::Type::kReference;
+    const int32_t element_size = DataType::Size(type);
+    const uint32_t data_offset = mirror::Array::DataOffset(element_size).Uint32Value();
 
     // Don't enter copy loop if `length == 0`.
-    __ cmpl(temp1, temp3);
-    __ j(kEqual, &done);
+    NearLabel skip_copy_and_write_barrier;
+    if (!length.IsConstant()) {
+      __ testl(length.AsRegister<CpuRegister>(), length.AsRegister<CpuRegister>());
+      __ j(kEqual, &skip_copy_and_write_barrier);
+    }
 
-    // Given the numeric representation, it's enough to check the low bit of the rb_state.
-    static_assert(ReadBarrier::NonGrayState() == 0, "Expecting non-gray to have value 0");
-    static_assert(ReadBarrier::GrayState() == 1, "Expecting gray to have value 1");
-    constexpr uint32_t gray_byte_position = LockWord::kReadBarrierStateShift / kBitsPerByte;
-    constexpr uint32_t gray_bit_position = LockWord::kReadBarrierStateShift % kBitsPerByte;
-    constexpr int32_t test_value = static_cast<int8_t>(1 << gray_bit_position);
+    // Compute base source address, base destination address, and end
+    // source address in `temp1`, `temp2` and `temp3` respectively.
+    GenArrayAddress(assembler, temp1, src, src_pos, type, data_offset);
+    GenArrayAddress(assembler, temp2, dest, dest_pos, type, data_offset);
 
-    // if (rb_state == ReadBarrier::GrayState())
-    //   goto slow_path;
-    // At this point, just do the "if" and make sure that flags are preserved until the branch.
-    __ testb(Address(src, monitor_offset + gray_byte_position), Immediate(test_value));
+    SlowPathCode* read_barrier_slow_path = nullptr;
+    if (codegen_->EmitBakerReadBarrier()) {
+      // SystemArrayCopy implementation for Baker read barriers (see
+      // also CodeGeneratorX86_64::GenerateReferenceLoadWithBakerReadBarrier):
+      //
+      //   if (src_ptr != end_ptr) {
+      //     uint32_t rb_state = Lockword(src->monitor_).ReadBarrierState();
+      //     lfence;  // Load fence or artificial data dependency to prevent load-load reordering
+      //     bool is_gray = (rb_state == ReadBarrier::GrayState());
+      //     if (is_gray) {
+      //       // Slow-path copy.
+      //       do {
+      //         *dest_ptr++ = MaybePoison(ReadBarrier::Mark(MaybeUnpoison(*src_ptr++)));
+      //       } while (src_ptr != end_ptr)
+      //     } else {
+      //       // Fast-path copy.
+      //       do {
+      //         *dest_ptr++ = *src_ptr++;
+      //       } while (src_ptr != end_ptr)
+      //     }
+      //   }
 
-    // Load fence to prevent load-load reordering.
-    // Note that this is a no-op, thanks to the x86-64 memory model.
-    codegen_->GenerateMemoryBarrier(MemBarrierKind::kLoadAny);
+      // Given the numeric representation, it's enough to check the low bit of the rb_state.
+      static_assert(ReadBarrier::NonGrayState() == 0, "Expecting non-gray to have value 0");
+      static_assert(ReadBarrier::GrayState() == 1, "Expecting gray to have value 1");
+      constexpr uint32_t gray_byte_position = LockWord::kReadBarrierStateShift / kBitsPerByte;
+      constexpr uint32_t gray_bit_position = LockWord::kReadBarrierStateShift % kBitsPerByte;
+      constexpr int32_t test_value = static_cast<int8_t>(1 << gray_bit_position);
 
-    // Slow path used to copy array when `src` is gray.
-    SlowPathCode* read_barrier_slow_path =
-        new (codegen_->GetScopedAllocator()) ReadBarrierSystemArrayCopySlowPathX86_64(invoke);
-    codegen_->AddSlowPath(read_barrier_slow_path);
+      // if (rb_state == ReadBarrier::GrayState())
+      //   goto slow_path;
+      // At this point, just do the "if" and make sure that flags are preserved until the branch.
+      __ testb(Address(src, monitor_offset + gray_byte_position), Immediate(test_value));
 
-    // We have done the "if" of the gray bit check above, now branch based on the flags.
-    __ j(kNotZero, read_barrier_slow_path->GetEntryLabel());
+      // Load fence to prevent load-load reordering.
+      // Note that this is a no-op, thanks to the x86-64 memory model.
+      codegen_->GenerateMemoryBarrier(MemBarrierKind::kLoadAny);
 
-    // Fast-path copy.
-    // Iterate over the arrays and do a raw copy of the objects. We don't need to
-    // poison/unpoison.
-    __ Bind(&loop);
-    __ movl(CpuRegister(TMP), Address(temp1, 0));
-    __ movl(Address(temp2, 0), CpuRegister(TMP));
-    __ addl(temp1, Immediate(element_size));
-    __ addl(temp2, Immediate(element_size));
-    __ cmpl(temp1, temp3);
-    __ j(kNotEqual, &loop);
+      // Slow path used to copy array when `src` is gray.
+      read_barrier_slow_path =
+          new (codegen_->GetScopedAllocator()) ReadBarrierSystemArrayCopySlowPathX86_64(invoke);
+      codegen_->AddSlowPath(read_barrier_slow_path);
 
-    __ Bind(read_barrier_slow_path->GetExitLabel());
-    __ Bind(&done);
-  } else {
-    // Non read barrier code.
+      // We have done the "if" of the gray bit check above, now branch based on the flags.
+      __ j(kNotZero, read_barrier_slow_path->GetEntryLabel());
+    }
 
-    // Iterate over the arrays and do a raw copy of the objects. We don't need to
-    // poison/unpoison.
-    NearLabel loop, done;
-    __ cmpl(temp1, temp3);
-    __ j(kEqual, &done);
-    __ Bind(&loop);
-    __ movl(CpuRegister(TMP), Address(temp1, 0));
-    __ movl(Address(temp2, 0), CpuRegister(TMP));
-    __ addl(temp1, Immediate(element_size));
-    __ addl(temp2, Immediate(element_size));
-    __ cmpl(temp1, temp3);
-    __ j(kNotEqual, &loop);
-    __ Bind(&done);
+    if (length.IsConstant()) {
+      __ movl(temp3, Immediate(length.GetConstant()->AsIntConstant()->GetValue()));
+    } else {
+      __ movl(temp3, length.AsRegister<CpuRegister>());
+    }
+
+    // Iterate over the arrays and do a raw copy of the objects. We don't need to poison/unpoison.
+    DCHECK_EQ(temp1.AsRegister(), RSI);
+    DCHECK_EQ(temp2.AsRegister(), RDI);
+    DCHECK_EQ(temp3.AsRegister(), RCX);
+    __ rep_movsl();
+
+    if (read_barrier_slow_path != nullptr) {
+      DCHECK(codegen_->EmitBakerReadBarrier());
+      __ Bind(read_barrier_slow_path->GetExitLabel());
+    }
+
+    // We only need one card marking on the destination array.
+    codegen_->MarkGCCard(temp1, temp2, dest);
+
+    __ Bind(&skip_copy_and_write_barrier);
   }
 
-  // We only need one card marking on the destination array.
-  codegen_->MarkGCCard(temp1, temp2, dest, CpuRegister(kNoRegister), /* emit_null_check= */ false);
-
   __ Bind(intrinsic_slow_path->GetExitLabel());
 }
 
@@ -1424,7 +1356,7 @@
   HInstruction* code_point = invoke->InputAt(1);
   if (code_point->IsIntConstant()) {
     if (static_cast<uint32_t>(code_point->AsIntConstant()->GetValue()) >
-    std::numeric_limits<uint16_t>::max()) {
+        std::numeric_limits<uint16_t>::max()) {
       // Always needs the slow-path. We could directly dispatch to it, but this case should be
       // rare, so for simplicity just put the full slow-path down and branch unconditionally.
       slow_path = new (codegen->GetScopedAllocator()) IntrinsicSlowPathX86_64(invoke);
@@ -1655,7 +1587,7 @@
   CpuRegister obj = locations->InAt(0).AsRegister<CpuRegister>();
   Location srcBegin = locations->InAt(1);
   int srcBegin_value =
-    srcBegin.IsConstant() ? srcBegin.GetConstant()->AsIntConstant()->GetValue() : 0;
+      srcBegin.IsConstant() ? srcBegin.GetConstant()->AsIntConstant()->GetValue() : 0;
   CpuRegister srcEnd = locations->InAt(2).AsRegister<CpuRegister>();
   CpuRegister dst = locations->InAt(3).AsRegister<CpuRegister>();
   CpuRegister dstBegin = locations->InAt(4).AsRegister<CpuRegister>();
@@ -1871,7 +1803,7 @@
 
 static void GenUnsafeGet(HInvoke* invoke,
                          DataType::Type type,
-                         bool is_volatile ATTRIBUTE_UNUSED,
+                         [[maybe_unused]] bool is_volatile,
                          CodeGeneratorX86_64* codegen) {
   X86_64Assembler* assembler = down_cast<X86_64Assembler*>(codegen->GetAssembler());
   LocationSummary* locations = invoke->GetLocations();
@@ -1892,7 +1824,7 @@
       break;
 
     case DataType::Type::kReference: {
-      if (gUseReadBarrier) {
+      if (codegen->EmitReadBarrier()) {
         if (kUseBakerReadBarrier) {
           Address src(base, offset, ScaleFactor::TIMES_1, 0);
           codegen->GenerateReferenceLoadWithBakerReadBarrier(
@@ -1919,22 +1851,10 @@
   }
 }
 
-static bool UnsafeGetIntrinsicOnCallList(Intrinsics intrinsic) {
-  switch (intrinsic) {
-    case Intrinsics::kUnsafeGetObject:
-    case Intrinsics::kUnsafeGetObjectVolatile:
-    case Intrinsics::kJdkUnsafeGetObject:
-    case Intrinsics::kJdkUnsafeGetObjectVolatile:
-    case Intrinsics::kJdkUnsafeGetObjectAcquire:
-      return true;
-    default:
-      break;
-  }
-  return false;
-}
-
-static void CreateIntIntIntToIntLocations(ArenaAllocator* allocator, HInvoke* invoke) {
-  bool can_call = gUseReadBarrier && UnsafeGetIntrinsicOnCallList(invoke->GetIntrinsic());
+static void CreateIntIntIntToIntLocations(ArenaAllocator* allocator,
+                                          HInvoke* invoke,
+                                          CodeGeneratorX86_64* codegen) {
+  bool can_call = codegen->EmitReadBarrier() && IsUnsafeGetReference(invoke);
   LocationSummary* locations =
       new (allocator) LocationSummary(invoke,
                                       can_call
@@ -1964,44 +1884,44 @@
   VisitJdkUnsafeGetLongVolatile(invoke);
 }
 void IntrinsicLocationsBuilderX86_64::VisitUnsafeGetObject(HInvoke* invoke) {
-  VisitJdkUnsafeGetObject(invoke);
+  VisitJdkUnsafeGetReference(invoke);
 }
 void IntrinsicLocationsBuilderX86_64::VisitUnsafeGetObjectVolatile(HInvoke* invoke) {
-  VisitJdkUnsafeGetObjectVolatile(invoke);
+  VisitJdkUnsafeGetReferenceVolatile(invoke);
 }
 void IntrinsicLocationsBuilderX86_64::VisitUnsafeGetByte(HInvoke* invoke) {
   VisitJdkUnsafeGetByte(invoke);
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGet(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+  CreateIntIntIntToIntLocations(allocator_, invoke, codegen_);
 }
 void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetVolatile(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+  CreateIntIntIntToIntLocations(allocator_, invoke, codegen_);
 }
 void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetAcquire(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+  CreateIntIntIntToIntLocations(allocator_, invoke, codegen_);
 }
 void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetLong(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+  CreateIntIntIntToIntLocations(allocator_, invoke, codegen_);
 }
 void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetLongVolatile(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+  CreateIntIntIntToIntLocations(allocator_, invoke, codegen_);
 }
 void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetLongAcquire(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+  CreateIntIntIntToIntLocations(allocator_, invoke, codegen_);
 }
-void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetObject(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetReference(HInvoke* invoke) {
+  CreateIntIntIntToIntLocations(allocator_, invoke, codegen_);
 }
-void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetObjectVolatile(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetReferenceVolatile(HInvoke* invoke) {
+  CreateIntIntIntToIntLocations(allocator_, invoke, codegen_);
 }
-void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetObjectAcquire(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetReferenceAcquire(HInvoke* invoke) {
+  CreateIntIntIntToIntLocations(allocator_, invoke, codegen_);
 }
 void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetByte(HInvoke* invoke) {
-  CreateIntIntIntToIntLocations(allocator_, invoke);
+  CreateIntIntIntToIntLocations(allocator_, invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitUnsafeGet(HInvoke* invoke) {
@@ -2017,10 +1937,10 @@
   VisitJdkUnsafeGetLongVolatile(invoke);
 }
 void IntrinsicCodeGeneratorX86_64::VisitUnsafeGetObject(HInvoke* invoke) {
-  VisitJdkUnsafeGetObject(invoke);
+  VisitJdkUnsafeGetReference(invoke);
 }
 void IntrinsicCodeGeneratorX86_64::VisitUnsafeGetObjectVolatile(HInvoke* invoke) {
-  VisitJdkUnsafeGetObjectVolatile(invoke);
+  VisitJdkUnsafeGetReferenceVolatile(invoke);
 }
 void IntrinsicCodeGeneratorX86_64::VisitUnsafeGetByte(HInvoke* invoke) {
   VisitJdkUnsafeGetByte(invoke);
@@ -2044,13 +1964,13 @@
 void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeGetLongAcquire(HInvoke* invoke) {
   GenUnsafeGet(invoke, DataType::Type::kInt64, /*is_volatile=*/ true, codegen_);
 }
-void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeGetObject(HInvoke* invoke) {
+void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeGetReference(HInvoke* invoke) {
   GenUnsafeGet(invoke, DataType::Type::kReference, /*is_volatile=*/ false, codegen_);
 }
-void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeGetObjectVolatile(HInvoke* invoke) {
+void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeGetReferenceVolatile(HInvoke* invoke) {
   GenUnsafeGet(invoke, DataType::Type::kReference, /*is_volatile=*/ true, codegen_);
 }
-void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeGetObjectAcquire(HInvoke* invoke) {
+void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeGetReferenceAcquire(HInvoke* invoke) {
   GenUnsafeGet(invoke, DataType::Type::kReference, /*is_volatile=*/ true, codegen_);
 }
 void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeGetByte(HInvoke* invoke) {
@@ -2083,13 +2003,13 @@
   VisitJdkUnsafePutVolatile(invoke);
 }
 void IntrinsicLocationsBuilderX86_64::VisitUnsafePutObject(HInvoke* invoke) {
-  VisitJdkUnsafePutObject(invoke);
+  VisitJdkUnsafePutReference(invoke);
 }
 void IntrinsicLocationsBuilderX86_64::VisitUnsafePutObjectOrdered(HInvoke* invoke) {
   VisitJdkUnsafePutObjectOrdered(invoke);
 }
 void IntrinsicLocationsBuilderX86_64::VisitUnsafePutObjectVolatile(HInvoke* invoke) {
-  VisitJdkUnsafePutObjectVolatile(invoke);
+  VisitJdkUnsafePutReferenceVolatile(invoke);
 }
 void IntrinsicLocationsBuilderX86_64::VisitUnsafePutLong(HInvoke* invoke) {
   VisitJdkUnsafePutLong(invoke);
@@ -2116,16 +2036,16 @@
 void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafePutRelease(HInvoke* invoke) {
   CreateIntIntIntIntToVoidPlusTempsLocations(allocator_, DataType::Type::kInt32, invoke);
 }
-void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafePutObject(HInvoke* invoke) {
+void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafePutReference(HInvoke* invoke) {
   CreateIntIntIntIntToVoidPlusTempsLocations(allocator_, DataType::Type::kReference, invoke);
 }
 void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafePutObjectOrdered(HInvoke* invoke) {
   CreateIntIntIntIntToVoidPlusTempsLocations(allocator_, DataType::Type::kReference, invoke);
 }
-void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafePutObjectVolatile(HInvoke* invoke) {
+void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafePutReferenceVolatile(HInvoke* invoke) {
   CreateIntIntIntIntToVoidPlusTempsLocations(allocator_, DataType::Type::kReference, invoke);
 }
-void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafePutObjectRelease(HInvoke* invoke) {
+void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafePutReferenceRelease(HInvoke* invoke) {
   CreateIntIntIntIntToVoidPlusTempsLocations(allocator_, DataType::Type::kReference, invoke);
 }
 void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafePutLong(HInvoke* invoke) {
@@ -2170,11 +2090,11 @@
 
   if (type == DataType::Type::kReference) {
     bool value_can_be_null = true;  // TODO: Worth finding out this information?
-    codegen->MarkGCCard(locations->GetTemp(0).AsRegister<CpuRegister>(),
-                        locations->GetTemp(1).AsRegister<CpuRegister>(),
-                        base,
-                        value,
-                        value_can_be_null);
+    codegen->MaybeMarkGCCard(locations->GetTemp(0).AsRegister<CpuRegister>(),
+                             locations->GetTemp(1).AsRegister<CpuRegister>(),
+                             base,
+                             value,
+                             value_can_be_null);
   }
 }
 
@@ -2188,13 +2108,13 @@
   VisitJdkUnsafePutVolatile(invoke);
 }
 void IntrinsicCodeGeneratorX86_64::VisitUnsafePutObject(HInvoke* invoke) {
-  VisitJdkUnsafePutObject(invoke);
+  VisitJdkUnsafePutReference(invoke);
 }
 void IntrinsicCodeGeneratorX86_64::VisitUnsafePutObjectOrdered(HInvoke* invoke) {
   VisitJdkUnsafePutObjectOrdered(invoke);
 }
 void IntrinsicCodeGeneratorX86_64::VisitUnsafePutObjectVolatile(HInvoke* invoke) {
-  VisitJdkUnsafePutObjectVolatile(invoke);
+  VisitJdkUnsafePutReferenceVolatile(invoke);
 }
 void IntrinsicCodeGeneratorX86_64::VisitUnsafePutLong(HInvoke* invoke) {
   VisitJdkUnsafePutLong(invoke);
@@ -2221,7 +2141,7 @@
 void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafePutRelease(HInvoke* invoke) {
   GenUnsafePut(invoke->GetLocations(), DataType::Type::kInt32, /* is_volatile= */ true, codegen_);
 }
-void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafePutObject(HInvoke* invoke) {
+void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafePutReference(HInvoke* invoke) {
   GenUnsafePut(
       invoke->GetLocations(), DataType::Type::kReference, /*is_volatile=*/ false, codegen_);
 }
@@ -2229,11 +2149,11 @@
   GenUnsafePut(
       invoke->GetLocations(), DataType::Type::kReference, /*is_volatile=*/ false, codegen_);
 }
-void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafePutObjectVolatile(HInvoke* invoke) {
+void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafePutReferenceVolatile(HInvoke* invoke) {
   GenUnsafePut(
       invoke->GetLocations(), DataType::Type::kReference, /*is_volatile=*/ true, codegen_);
 }
-void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafePutObjectRelease(HInvoke* invoke) {
+void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafePutReferenceRelease(HInvoke* invoke) {
   GenUnsafePut(
       invoke->GetLocations(), DataType::Type::kReference, /*is_volatile=*/ true, codegen_);
 }
@@ -2254,11 +2174,10 @@
 }
 
 static void CreateUnsafeCASLocations(ArenaAllocator* allocator,
-                                     DataType::Type type,
-                                     HInvoke* invoke) {
-  const bool can_call = gUseReadBarrier &&
-                        kUseBakerReadBarrier &&
-                        IsUnsafeCASObject(invoke);
+                                     HInvoke* invoke,
+                                     CodeGeneratorX86_64* codegen,
+                                     DataType::Type type) {
+  const bool can_call = codegen->EmitBakerReadBarrier() && IsUnsafeCASReference(invoke);
   LocationSummary* locations =
       new (allocator) LocationSummary(invoke,
                                       can_call
@@ -2279,7 +2198,7 @@
     // Need two temporaries for MarkGCCard.
     locations->AddTemp(Location::RequiresRegister());  // Possibly used for reference poisoning too.
     locations->AddTemp(Location::RequiresRegister());
-    if (gUseReadBarrier) {
+    if (codegen->EmitReadBarrier()) {
       // Need three temporaries for GenerateReferenceLoadWithBakerReadBarrier.
       DCHECK(kUseBakerReadBarrier);
       locations->AddTemp(Location::RequiresRegister());
@@ -2311,24 +2230,24 @@
 
 void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeCASObject(HInvoke* invoke) {
   // `jdk.internal.misc.Unsafe.compareAndSwapObject` has compare-and-set semantics (see javadoc).
-  VisitJdkUnsafeCompareAndSetObject(invoke);
+  VisitJdkUnsafeCompareAndSetReference(invoke);
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeCompareAndSetInt(HInvoke* invoke) {
-  CreateUnsafeCASLocations(allocator_, DataType::Type::kInt32, invoke);
+  CreateUnsafeCASLocations(allocator_, invoke, codegen_, DataType::Type::kInt32);
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeCompareAndSetLong(HInvoke* invoke) {
-  CreateUnsafeCASLocations(allocator_, DataType::Type::kInt64, invoke);
+  CreateUnsafeCASLocations(allocator_, invoke, codegen_, DataType::Type::kInt64);
 }
 
-void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeCompareAndSetObject(HInvoke* invoke) {
+void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeCompareAndSetReference(HInvoke* invoke) {
   // The only supported read barrier implementation is the Baker-style read barriers.
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+  if (codegen_->EmitNonBakerReadBarrier()) {
     return;
   }
 
-  CreateUnsafeCASLocations(allocator_, DataType::Type::kReference, invoke);
+  CreateUnsafeCASLocations(allocator_, invoke, codegen_, DataType::Type::kReference);
 }
 
 // Convert ZF into the Boolean result.
@@ -2464,16 +2383,16 @@
                                           CpuRegister temp3,
                                           bool is_cmpxchg) {
   // The only supported read barrier implementation is the Baker-style read barriers.
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen->EmitReadBarrier(), kUseBakerReadBarrier);
 
   X86_64Assembler* assembler = down_cast<X86_64Assembler*>(codegen->GetAssembler());
 
   // Mark card for object assuming new value is stored.
   bool value_can_be_null = true;  // TODO: Worth finding out this information?
-  codegen->MarkGCCard(temp1, temp2, base, value, value_can_be_null);
+  codegen->MaybeMarkGCCard(temp1, temp2, base, value, value_can_be_null);
 
   Address field_addr(base, offset, TIMES_1, 0);
-  if (gUseReadBarrier && kUseBakerReadBarrier) {
+  if (codegen->EmitBakerReadBarrier()) {
     // Need to make sure the reference stored in the field is a to-space
     // one before attempting the CAS or the CAS could fail incorrectly.
     codegen->GenerateReferenceLoadWithBakerReadBarrier(
@@ -2582,7 +2501,7 @@
       CpuRegister new_value_reg = new_value.AsRegister<CpuRegister>();
       CpuRegister temp1 = locations->GetTemp(temp1_index).AsRegister<CpuRegister>();
       CpuRegister temp2 = locations->GetTemp(temp2_index).AsRegister<CpuRegister>();
-      CpuRegister temp3 = gUseReadBarrier
+      CpuRegister temp3 = codegen->EmitReadBarrier()
           ? locations->GetTemp(temp3_index).AsRegister<CpuRegister>()
           : CpuRegister(kNoRegister);
       DCHECK(RegsAreAllDifferent({base, offset, temp1, temp2, temp3}));
@@ -2637,7 +2556,7 @@
 
 void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeCASObject(HInvoke* invoke) {
   // `jdk.internal.misc.Unsafe.compareAndSwapObject` has compare-and-set semantics (see javadoc).
-  VisitJdkUnsafeCompareAndSetObject(invoke);
+  VisitJdkUnsafeCompareAndSetReference(invoke);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeCompareAndSetInt(HInvoke* invoke) {
@@ -2648,13 +2567,195 @@
   GenCAS(DataType::Type::kInt64, invoke, codegen_);
 }
 
-void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeCompareAndSetObject(HInvoke* invoke) {
+void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeCompareAndSetReference(HInvoke* invoke) {
   // The only supported read barrier implementation is the Baker-style read barriers.
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen_->EmitReadBarrier(), kUseBakerReadBarrier);
 
   GenCAS(DataType::Type::kReference, invoke, codegen_);
 }
 
+static void CreateUnsafeGetAndUpdateLocations(ArenaAllocator* allocator,
+                                              HInvoke* invoke,
+                                              CodeGeneratorX86_64* codegen) {
+  const bool can_call = codegen->EmitReadBarrier() && IsUnsafeGetAndSetReference(invoke);
+  LocationSummary* locations =
+      new (allocator) LocationSummary(invoke,
+                                      can_call
+                                          ? LocationSummary::kCallOnSlowPath
+                                          : LocationSummary::kNoCall,
+                                      kIntrinsified);
+  if (can_call && kUseBakerReadBarrier) {
+    locations->SetCustomSlowPathCallerSaves(RegisterSet::Empty());  // No caller-save registers.
+  }
+  locations->SetInAt(0, Location::NoLocation());        // Unused receiver.
+  locations->SetInAt(1, Location::RequiresRegister());
+  locations->SetInAt(2, Location::RequiresRegister());
+  // Use the same register for both the output and the new value or addend
+  // to take advantage of XCHG or XADD. Arbitrarily pick RAX.
+  locations->SetInAt(3, Location::RegisterLocation(RAX));
+  locations->SetOut(Location::RegisterLocation(RAX));
+}
+
+void IntrinsicLocationsBuilderX86_64::VisitUnsafeGetAndAddInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddInt(invoke);
+}
+
+void IntrinsicLocationsBuilderX86_64::VisitUnsafeGetAndAddLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddLong(invoke);
+}
+
+void IntrinsicLocationsBuilderX86_64::VisitUnsafeGetAndSetInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetInt(invoke);
+}
+
+void IntrinsicLocationsBuilderX86_64::VisitUnsafeGetAndSetLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetLong(invoke);
+}
+
+void IntrinsicLocationsBuilderX86_64::VisitUnsafeGetAndSetObject(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetReference(invoke);
+}
+
+void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetAndAddInt(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetAndAddLong(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetAndSetInt(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetAndSetLong(HInvoke* invoke) {
+  CreateUnsafeGetAndUpdateLocations(allocator_, invoke, codegen_);
+}
+
+void IntrinsicLocationsBuilderX86_64::VisitJdkUnsafeGetAndSetReference(HInvoke* invoke) {
+  // The only supported read barrier implementation is the Baker-style read barriers.
+  if (codegen_->EmitNonBakerReadBarrier()) {
+    return;
+  }
+
+  CreateUnsafeGetAndUpdateLocations(allocator_, invoke, codegen_);
+  invoke->GetLocations()->AddRegisterTemps(3);
+}
+
+enum class GetAndUpdateOp {
+  kSet,
+  kAdd,
+  kBitwiseAnd,
+  kBitwiseOr,
+  kBitwiseXor
+};
+
+static void GenUnsafeGetAndUpdate(HInvoke* invoke,
+                                  DataType::Type type,
+                                  CodeGeneratorX86_64* codegen,
+                                  GetAndUpdateOp get_and_update_op) {
+  X86_64Assembler* assembler = down_cast<X86_64Assembler*>(codegen->GetAssembler());
+  LocationSummary* locations = invoke->GetLocations();
+
+  CpuRegister out = locations->Out().AsRegister<CpuRegister>();       // Result.
+  CpuRegister base = locations->InAt(1).AsRegister<CpuRegister>();    // Object pointer.
+  CpuRegister offset = locations->InAt(2).AsRegister<CpuRegister>();  // Long offset.
+  DCHECK_EQ(out, locations->InAt(3).AsRegister<CpuRegister>());       // New value or addend.
+  Address field_address(base, offset, TIMES_1, 0);
+
+  if (type == DataType::Type::kInt32) {
+    if (get_and_update_op == GetAndUpdateOp::kAdd) {
+      __ LockXaddl(field_address, out);
+    } else {
+      DCHECK(get_and_update_op == GetAndUpdateOp::kSet);
+      __ xchgl(out, field_address);
+    }
+  } else if (type == DataType::Type::kInt64) {
+    if (get_and_update_op == GetAndUpdateOp::kAdd) {
+      __ LockXaddq(field_address, out);
+    } else {
+      DCHECK(get_and_update_op == GetAndUpdateOp::kSet);
+      __ xchgq(out, field_address);
+    }
+  } else {
+    DCHECK_EQ(type, DataType::Type::kReference);
+    DCHECK(get_and_update_op == GetAndUpdateOp::kSet);
+    CpuRegister temp1 = locations->GetTemp(0).AsRegister<CpuRegister>();
+    CpuRegister temp2 = locations->GetTemp(1).AsRegister<CpuRegister>();
+    CpuRegister temp3 = locations->GetTemp(2).AsRegister<CpuRegister>();
+
+    if (codegen->EmitReadBarrier()) {
+      DCHECK(kUseBakerReadBarrier);
+      // Ensure that the field contains a to-space reference.
+      codegen->GenerateReferenceLoadWithBakerReadBarrier(
+          invoke,
+          Location::RegisterLocation(temp3.AsRegister()),
+          base,
+          field_address,
+          /*needs_null_check=*/ false,
+          /*always_update_field=*/ true,
+          &temp1,
+          &temp2);
+    }
+
+    // Mark card for object as a new value shall be stored.
+    bool new_value_can_be_null = true;  // TODO: Worth finding out this information?
+    codegen->MaybeMarkGCCard(temp1, temp2, base, /*value=*/out, new_value_can_be_null);
+
+    if (kPoisonHeapReferences) {
+      // Use a temp to avoid poisoning base of the field address, which might happen if `out`
+      // is the same as `base` (for code like `unsafe.getAndSet(obj, offset, obj)`).
+      __ movl(temp1, out);
+      __ PoisonHeapReference(temp1);
+      __ xchgl(temp1, field_address);
+      __ UnpoisonHeapReference(temp1);
+      __ movl(out, temp1);
+    } else {
+      __ xchgl(out, field_address);
+    }
+  }
+}
+
+void IntrinsicCodeGeneratorX86_64::VisitUnsafeGetAndAddInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddInt(invoke);
+}
+
+void IntrinsicCodeGeneratorX86_64::VisitUnsafeGetAndAddLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndAddLong(invoke);
+}
+
+void IntrinsicCodeGeneratorX86_64::VisitUnsafeGetAndSetInt(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetInt(invoke);
+}
+
+void IntrinsicCodeGeneratorX86_64::VisitUnsafeGetAndSetLong(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetLong(invoke);
+}
+
+void IntrinsicCodeGeneratorX86_64::VisitUnsafeGetAndSetObject(HInvoke* invoke) {
+  VisitJdkUnsafeGetAndSetReference(invoke);
+}
+
+void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeGetAndAddInt(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kInt32, codegen_, GetAndUpdateOp::kAdd);
+}
+
+void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeGetAndAddLong(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kInt64, codegen_, GetAndUpdateOp::kAdd);
+}
+
+void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeGetAndSetInt(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kInt32, codegen_, GetAndUpdateOp::kSet);
+}
+
+void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeGetAndSetLong(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kInt64, codegen_, GetAndUpdateOp::kSet);
+}
+
+void IntrinsicCodeGeneratorX86_64::VisitJdkUnsafeGetAndSetReference(HInvoke* invoke) {
+  GenUnsafeGetAndUpdate(invoke, DataType::Type::kReference, codegen_, GetAndUpdateOp::kSet);
+}
+
 void IntrinsicLocationsBuilderX86_64::VisitIntegerReverse(HInvoke* invoke) {
   LocationSummary* locations =
       new (allocator_) LocationSummary(invoke, LocationSummary::kNoCall, kIntrinsified);
@@ -3079,18 +3180,60 @@
   GenTrailingZeros(GetAssembler(), codegen_, invoke, /* is_long= */ true);
 }
 
-void IntrinsicLocationsBuilderX86_64::VisitIntegerValueOf(HInvoke* invoke) {
-  InvokeRuntimeCallingConvention calling_convention;
-  IntrinsicVisitor::ComputeIntegerValueOfLocations(
-      invoke,
-      codegen_,
-      Location::RegisterLocation(RAX),
-      Location::RegisterLocation(calling_convention.GetRegisterAt(0)));
+#define VISIT_INTRINSIC(name, low, high, type, start_index) \
+  void IntrinsicLocationsBuilderX86_64::Visit ##name ##ValueOf(HInvoke* invoke) { \
+    InvokeRuntimeCallingConvention calling_convention; \
+    IntrinsicVisitor::ComputeValueOfLocations( \
+        invoke, \
+        codegen_, \
+        low, \
+        high - low + 1, \
+        Location::RegisterLocation(RAX), \
+        Location::RegisterLocation(calling_convention.GetRegisterAt(0))); \
+  } \
+  void IntrinsicCodeGeneratorX86_64::Visit ##name ##ValueOf(HInvoke* invoke) { \
+    IntrinsicVisitor::ValueOfInfo info = \
+        IntrinsicVisitor::ComputeValueOfInfo( \
+            invoke, \
+            codegen_->GetCompilerOptions(), \
+            WellKnownClasses::java_lang_ ##name ##_value, \
+            low, \
+            high - low + 1, \
+            start_index); \
+    HandleValueOf(invoke, info, type); \
+  }
+  BOXED_TYPES(VISIT_INTRINSIC)
+#undef VISIT_INTRINSIC
+
+template <typename T>
+static void Store(X86_64Assembler* assembler,
+                  DataType::Type primitive_type,
+                  const Address& address,
+                  const T& operand) {
+  switch (primitive_type) {
+    case DataType::Type::kInt8:
+    case DataType::Type::kUint8: {
+      __ movb(address, operand);
+      break;
+    }
+    case DataType::Type::kInt16:
+    case DataType::Type::kUint16: {
+      __ movw(address, operand);
+      break;
+    }
+    case DataType::Type::kInt32: {
+      __ movl(address, operand);
+      break;
+    }
+    default: {
+      LOG(FATAL) << "Unrecognized ValueOf type " << primitive_type;
+    }
+  }
 }
 
-void IntrinsicCodeGeneratorX86_64::VisitIntegerValueOf(HInvoke* invoke) {
-  IntrinsicVisitor::IntegerValueOfInfo info =
-      IntrinsicVisitor::ComputeIntegerValueOfInfo(invoke, codegen_->GetCompilerOptions());
+void IntrinsicCodeGeneratorX86_64::HandleValueOf(HInvoke* invoke,
+                                                 const IntrinsicVisitor::ValueOfInfo& info,
+                                                 DataType::Type type) {
   LocationSummary* locations = invoke->GetLocations();
   X86_64Assembler* assembler = GetAssembler();
 
@@ -3105,16 +3248,16 @@
   if (invoke->InputAt(0)->IsIntConstant()) {
     int32_t value = invoke->InputAt(0)->AsIntConstant()->GetValue();
     if (static_cast<uint32_t>(value - info.low) < info.length) {
-      // Just embed the j.l.Integer in the code.
-      DCHECK_NE(info.value_boot_image_reference, IntegerValueOfInfo::kInvalidReference);
+      // Just embed the object in the code.
+      DCHECK_NE(info.value_boot_image_reference, ValueOfInfo::kInvalidReference);
       codegen_->LoadBootImageAddress(out, info.value_boot_image_reference);
     } else {
       DCHECK(locations->CanCall());
-      // Allocate and initialize a new j.l.Integer.
-      // TODO: If we JIT, we could allocate the j.l.Integer now, and store it in the
+      // Allocate and initialize a new object.
+      // TODO: If we JIT, we could allocate the boxed value now, and store it in the
       // JIT object table.
       allocate_instance();
-      __ movl(Address(out, info.value_offset), Immediate(value));
+      Store(assembler, type, Address(out, info.value_offset), Immediate(value));
     }
   } else {
     DCHECK(locations->CanCall());
@@ -3124,7 +3267,7 @@
     __ cmpl(out, Immediate(info.length));
     NearLabel allocate, done;
     __ j(kAboveEqual, &allocate);
-    // If the value is within the bounds, load the j.l.Integer directly from the array.
+    // If the value is within the bounds, load the boxed value directly from the array.
     DCHECK_NE(out.AsRegister(), argument.AsRegister());
     codegen_->LoadBootImageAddress(argument, info.array_data_boot_image_reference);
     static_assert((1u << TIMES_4) == sizeof(mirror::HeapReference<mirror::Object>),
@@ -3133,9 +3276,9 @@
     __ MaybeUnpoisonHeapReference(out);
     __ jmp(&done);
     __ Bind(&allocate);
-    // Otherwise allocate and initialize a new j.l.Integer.
+    // Otherwise allocate and initialize a new object.
     allocate_instance();
-    __ movl(Address(out, info.value_offset), in);
+    Store(assembler, type, Address(out, info.value_offset), in);
     __ Bind(&done);
   }
 }
@@ -3154,7 +3297,7 @@
   SlowPathCode* slow_path = new (GetAllocator()) IntrinsicSlowPathX86_64(invoke);
   codegen_->AddSlowPath(slow_path);
 
-  if (gUseReadBarrier) {
+  if (codegen_->EmitReadBarrier()) {
     // Check self->GetWeakRefAccessEnabled().
     ThreadOffset64 offset = Thread::WeakRefAccessEnabledOffset<kX86_64PointerSize>();
     __ gs()->cmpl(Address::Absolute(offset, /* no_rip= */ true),
@@ -3176,7 +3319,7 @@
 
   // Load the value from the field.
   uint32_t referent_offset = mirror::Reference::ReferentOffset().Uint32Value();
-  if (gUseReadBarrier && kUseBakerReadBarrier) {
+  if (codegen_->EmitBakerReadBarrier()) {
     codegen_->GenerateFieldLoadWithBakerReadBarrier(invoke,
                                                     out,
                                                     obj.AsRegister<CpuRegister>(),
@@ -3195,7 +3338,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitReferenceRefersTo(HInvoke* invoke) {
-  IntrinsicVisitor::CreateReferenceRefersToLocations(invoke);
+  IntrinsicVisitor::CreateReferenceRefersToLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitReferenceRefersTo(HInvoke* invoke) {
@@ -3217,7 +3360,7 @@
 
   __ cmpl(out, other);
 
-  if (gUseReadBarrier) {
+  if (codegen_->EmitReadBarrier()) {
     DCHECK(kUseBakerReadBarrier);
 
     NearLabel calculate_result;
@@ -3275,7 +3418,7 @@
   locations->SetInAt(0, Location::Any());
 }
 
-void IntrinsicCodeGeneratorX86_64::VisitReachabilityFence(HInvoke* invoke ATTRIBUTE_UNUSED) { }
+void IntrinsicCodeGeneratorX86_64::VisitReachabilityFence([[maybe_unused]] HInvoke* invoke) {}
 
 static void CreateDivideUnsignedLocations(HInvoke* invoke, ArenaAllocator* allocator) {
   LocationSummary* locations =
@@ -3358,14 +3501,6 @@
   __ imulq(y);
 }
 
-enum class GetAndUpdateOp {
-  kSet,
-  kAdd,
-  kBitwiseAnd,
-  kBitwiseOr,
-  kBitwiseXor
-};
-
 class VarHandleSlowPathX86_64 : public IntrinsicSlowPathX86_64 {
  public:
   explicit VarHandleSlowPathX86_64(HInvoke* invoke)
@@ -3536,7 +3671,7 @@
   __ movl(temp, Address(varhandle, var_type_offset));
   __ MaybeUnpoisonHeapReference(temp);
 
-  // Check check the varType.primitiveType field against the type we're trying to retrieve.
+  // Check the varType.primitiveType field against the type we're trying to use.
   __ cmpw(Address(temp, primitive_type_offset), Immediate(static_cast<uint16_t>(primitive_type)));
   __ j(kNotEqual, slow_path->GetEntryLabel());
 
@@ -3780,24 +3915,24 @@
       __ movl(CpuRegister(target.offset), Immediate(target_field->GetOffset().Uint32Value()));
     } else {
       // For static fields, we need to fill the `target.object` with the declaring class,
-      // so we can use `target.object` as temporary for the `ArtMethod*`. For instance fields,
-      // we do not need the declaring class, so we can forget the `ArtMethod*` when
-      // we load the `target.offset`, so use the `target.offset` to hold the `ArtMethod*`.
-      CpuRegister method((expected_coordinates_count == 0) ? target.object : target.offset);
+      // so we can use `target.object` as temporary for the `ArtField*`. For instance fields,
+      // we do not need the declaring class, so we can forget the `ArtField*` when
+      // we load the `target.offset`, so use the `target.offset` to hold the `ArtField*`.
+      CpuRegister field((expected_coordinates_count == 0) ? target.object : target.offset);
 
       const MemberOffset art_field_offset = mirror::FieldVarHandle::ArtFieldOffset();
       const MemberOffset offset_offset = ArtField::OffsetOffset();
 
-      // Load the ArtField, the offset and, if needed, declaring class.
-      __ movq(method, Address(varhandle, art_field_offset));
-      __ movl(CpuRegister(target.offset), Address(method, offset_offset));
+      // Load the ArtField*, the offset and, if needed, declaring class.
+      __ movq(field, Address(varhandle, art_field_offset));
+      __ movl(CpuRegister(target.offset), Address(field, offset_offset));
       if (expected_coordinates_count == 0u) {
         InstructionCodeGeneratorX86_64* instr_codegen = codegen->GetInstructionCodegen();
         instr_codegen->GenerateGcRootFieldLoad(invoke,
                                                Location::RegisterLocation(target.object),
-                                               Address(method, ArtField::DeclaringClassOffset()),
-                                               /*fixup_label=*/ nullptr,
-                                               gCompilerReadBarrierOption);
+                                               Address(field, ArtField::DeclaringClassOffset()),
+                                               /*fixup_label=*/nullptr,
+                                               codegen->GetCompilerReadBarrierOption());
       }
     }
   } else {
@@ -3814,9 +3949,9 @@
   }
 }
 
-static bool HasVarHandleIntrinsicImplementation(HInvoke* invoke) {
+static bool HasVarHandleIntrinsicImplementation(HInvoke* invoke, CodeGeneratorX86_64* codegen) {
   // The only supported read barrier implementation is the Baker-style read barriers.
-  if (gUseReadBarrier && !kUseBakerReadBarrier) {
+  if (codegen->EmitNonBakerReadBarrier()) {
     return false;
   }
 
@@ -3865,8 +4000,8 @@
   return locations;
 }
 
-static void CreateVarHandleGetLocations(HInvoke* invoke) {
-  if (!HasVarHandleIntrinsicImplementation(invoke)) {
+static void CreateVarHandleGetLocations(HInvoke* invoke, CodeGeneratorX86_64* codegen) {
+  if (!HasVarHandleIntrinsicImplementation(invoke, codegen)) {
     return;
   }
 
@@ -3902,7 +4037,7 @@
   Location out = locations->Out();
 
   if (type == DataType::Type::kReference) {
-    if (gUseReadBarrier) {
+    if (codegen->EmitReadBarrier()) {
       DCHECK(kUseBakerReadBarrier);
       codegen->GenerateReferenceLoadWithBakerReadBarrier(
           invoke, out, CpuRegister(target.object), src, /* needs_null_check= */ false);
@@ -3926,7 +4061,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGet(HInvoke* invoke) {
-  CreateVarHandleGetLocations(invoke);
+  CreateVarHandleGetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGet(HInvoke* invoke) {
@@ -3934,7 +4069,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetAcquire(HInvoke* invoke) {
-  CreateVarHandleGetLocations(invoke);
+  CreateVarHandleGetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetAcquire(HInvoke* invoke) {
@@ -3943,7 +4078,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetOpaque(HInvoke* invoke) {
-  CreateVarHandleGetLocations(invoke);
+  CreateVarHandleGetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetOpaque(HInvoke* invoke) {
@@ -3952,7 +4087,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetVolatile(HInvoke* invoke) {
-  CreateVarHandleGetLocations(invoke);
+  CreateVarHandleGetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetVolatile(HInvoke* invoke) {
@@ -3960,8 +4095,8 @@
   GenerateVarHandleGet(invoke, codegen_);
 }
 
-static void CreateVarHandleSetLocations(HInvoke* invoke) {
-  if (!HasVarHandleIntrinsicImplementation(invoke)) {
+static void CreateVarHandleSetLocations(HInvoke* invoke, CodeGeneratorX86_64* codegen) {
+  if (!HasVarHandleIntrinsicImplementation(invoke, codegen)) {
     return;
   }
 
@@ -4023,7 +4158,8 @@
       /*value_can_be_null=*/true,
       byte_swap,
       // Value can be null, and this write barrier is not being relied on for other sets.
-      WriteBarrierKind::kEmitWithNullCheck);
+      value_type == DataType::Type::kReference ? WriteBarrierKind::kEmitNotBeingReliedOn :
+                                                 WriteBarrierKind::kDontEmit);
 
   // setVolatile needs kAnyAny barrier, but HandleFieldSet takes care of that.
 
@@ -4034,7 +4170,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleSet(HInvoke* invoke) {
-  CreateVarHandleSetLocations(invoke);
+  CreateVarHandleSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleSet(HInvoke* invoke) {
@@ -4042,7 +4178,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleSetOpaque(HInvoke* invoke) {
-  CreateVarHandleSetLocations(invoke);
+  CreateVarHandleSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleSetOpaque(HInvoke* invoke) {
@@ -4050,7 +4186,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleSetRelease(HInvoke* invoke) {
-  CreateVarHandleSetLocations(invoke);
+  CreateVarHandleSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleSetRelease(HInvoke* invoke) {
@@ -4058,15 +4194,16 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleSetVolatile(HInvoke* invoke) {
-  CreateVarHandleSetLocations(invoke);
+  CreateVarHandleSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleSetVolatile(HInvoke* invoke) {
   GenerateVarHandleSet(invoke, codegen_, /*is_volatile=*/ true, /*is_atomic=*/ true);
 }
 
-static void CreateVarHandleCompareAndSetOrExchangeLocations(HInvoke* invoke) {
-  if (!HasVarHandleIntrinsicImplementation(invoke)) {
+static void CreateVarHandleCompareAndSetOrExchangeLocations(HInvoke* invoke,
+                                                            CodeGeneratorX86_64* codegen) {
+  if (!HasVarHandleIntrinsicImplementation(invoke, codegen)) {
     return;
   }
 
@@ -4099,7 +4236,7 @@
       // Need two temporaries for MarkGCCard.
       locations->AddTemp(Location::RequiresRegister());
       locations->AddTemp(Location::RequiresRegister());
-      if (gUseReadBarrier) {
+      if (codegen->EmitReadBarrier()) {
         // Need three temporaries for GenerateReferenceLoadWithBakerReadBarrier.
         DCHECK(kUseBakerReadBarrier);
         locations->AddTemp(Location::RequiresRegister());
@@ -4114,7 +4251,7 @@
                                                      CodeGeneratorX86_64* codegen,
                                                      bool is_cmpxchg,
                                                      bool byte_swap = false) {
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen->EmitReadBarrier(), kUseBakerReadBarrier);
 
   X86_64Assembler* assembler = codegen->GetAssembler();
   LocationSummary* locations = invoke->GetLocations();
@@ -4159,7 +4296,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleCompareAndSet(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleCompareAndSet(HInvoke* invoke) {
@@ -4167,7 +4304,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleWeakCompareAndSet(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleWeakCompareAndSet(HInvoke* invoke) {
@@ -4175,7 +4312,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleWeakCompareAndSetPlain(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleWeakCompareAndSetPlain(HInvoke* invoke) {
@@ -4183,7 +4320,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleWeakCompareAndSetAcquire(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleWeakCompareAndSetAcquire(HInvoke* invoke) {
@@ -4191,7 +4328,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleWeakCompareAndSetRelease(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleWeakCompareAndSetRelease(HInvoke* invoke) {
@@ -4199,7 +4336,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleCompareAndExchange(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleCompareAndExchange(HInvoke* invoke) {
@@ -4207,7 +4344,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleCompareAndExchangeAcquire(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleCompareAndExchangeAcquire(HInvoke* invoke) {
@@ -4215,15 +4352,15 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleCompareAndExchangeRelease(HInvoke* invoke) {
-  CreateVarHandleCompareAndSetOrExchangeLocations(invoke);
+  CreateVarHandleCompareAndSetOrExchangeLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleCompareAndExchangeRelease(HInvoke* invoke) {
   GenerateVarHandleCompareAndSetOrExchange(invoke, codegen_, /*is_cmpxchg=*/ true);
 }
 
-static void CreateVarHandleGetAndSetLocations(HInvoke* invoke) {
-  if (!HasVarHandleIntrinsicImplementation(invoke)) {
+static void CreateVarHandleGetAndSetLocations(HInvoke* invoke, CodeGeneratorX86_64* codegen) {
+  if (!HasVarHandleIntrinsicImplementation(invoke, codegen)) {
     return;
   }
 
@@ -4247,7 +4384,7 @@
       // Need two temporaries for MarkGCCard.
       locations->AddTemp(Location::RequiresRegister());
       locations->AddTemp(Location::RequiresRegister());
-      if (gUseReadBarrier) {
+      if (codegen->EmitReadBarrier()) {
         // Need a third temporary for GenerateReferenceLoadWithBakerReadBarrier.
         DCHECK(kUseBakerReadBarrier);
         locations->AddTemp(Location::RequiresRegister());
@@ -4296,7 +4433,7 @@
     CpuRegister temp2 = locations->GetTemp(temp_count - 2).AsRegister<CpuRegister>();
     CpuRegister valreg = value.AsRegister<CpuRegister>();
 
-    if (gUseReadBarrier && kUseBakerReadBarrier) {
+    if (codegen->EmitBakerReadBarrier()) {
       codegen->GenerateReferenceLoadWithBakerReadBarrier(
           invoke,
           locations->GetTemp(temp_count - 3),
@@ -4307,7 +4444,7 @@
           &temp1,
           &temp2);
     }
-    codegen->MarkGCCard(temp1, temp2, ref, valreg, /* emit_null_check= */ false);
+    codegen->MarkGCCard(temp1, temp2, ref);
 
     DCHECK_EQ(valreg, out.AsRegister<CpuRegister>());
     if (kPoisonHeapReferences) {
@@ -4365,8 +4502,8 @@
   }
 }
 
-static void CreateVarHandleGetAndBitwiseOpLocations(HInvoke* invoke) {
-  if (!HasVarHandleIntrinsicImplementation(invoke)) {
+static void CreateVarHandleGetAndBitwiseOpLocations(HInvoke* invoke, CodeGeneratorX86_64* codegen) {
+  if (!HasVarHandleIntrinsicImplementation(invoke, codegen)) {
     return;
   }
 
@@ -4504,8 +4641,8 @@
   }
 }
 
-static void CreateVarHandleGetAndAddLocations(HInvoke* invoke) {
-  if (!HasVarHandleIntrinsicImplementation(invoke)) {
+static void CreateVarHandleGetAndAddLocations(HInvoke* invoke, CodeGeneratorX86_64* codegen) {
+  if (!HasVarHandleIntrinsicImplementation(invoke, codegen)) {
     return;
   }
 
@@ -4676,7 +4813,7 @@
                                           bool need_any_store_barrier,
                                           bool need_any_any_barrier,
                                           bool byte_swap = false) {
-  DCHECK_IMPLIES(gUseReadBarrier, kUseBakerReadBarrier);
+  DCHECK_IMPLIES(codegen->EmitReadBarrier(), kUseBakerReadBarrier);
 
   X86_64Assembler* assembler = codegen->GetAssembler();
   LocationSummary* locations = invoke->GetLocations();
@@ -4731,7 +4868,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetAndSet(HInvoke* invoke) {
-  CreateVarHandleGetAndSetLocations(invoke);
+  CreateVarHandleGetAndSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetAndSet(HInvoke* invoke) {
@@ -4744,7 +4881,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetAndSetAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndSetLocations(invoke);
+  CreateVarHandleGetAndSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetAndSetAcquire(HInvoke* invoke) {
@@ -4757,7 +4894,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetAndSetRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndSetLocations(invoke);
+  CreateVarHandleGetAndSetLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetAndSetRelease(HInvoke* invoke) {
@@ -4770,7 +4907,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetAndAdd(HInvoke* invoke) {
-  CreateVarHandleGetAndAddLocations(invoke);
+  CreateVarHandleGetAndAddLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetAndAdd(HInvoke* invoke) {
@@ -4783,7 +4920,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetAndAddAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndAddLocations(invoke);
+  CreateVarHandleGetAndAddLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetAndAddAcquire(HInvoke* invoke) {
@@ -4796,7 +4933,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetAndAddRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndAddLocations(invoke);
+  CreateVarHandleGetAndAddLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetAndAddRelease(HInvoke* invoke) {
@@ -4809,7 +4946,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetAndBitwiseAnd(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetAndBitwiseAnd(HInvoke* invoke) {
@@ -4822,7 +4959,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetAndBitwiseAndAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetAndBitwiseAndAcquire(HInvoke* invoke) {
@@ -4835,7 +4972,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetAndBitwiseAndRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetAndBitwiseAndRelease(HInvoke* invoke) {
@@ -4848,7 +4985,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetAndBitwiseOr(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetAndBitwiseOr(HInvoke* invoke) {
@@ -4861,7 +4998,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetAndBitwiseOrAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetAndBitwiseOrAcquire(HInvoke* invoke) {
@@ -4874,7 +5011,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetAndBitwiseOrRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetAndBitwiseOrRelease(HInvoke* invoke) {
@@ -4887,7 +5024,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetAndBitwiseXor(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetAndBitwiseXor(HInvoke* invoke) {
@@ -4900,7 +5037,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetAndBitwiseXorAcquire(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetAndBitwiseXorAcquire(HInvoke* invoke) {
@@ -4913,7 +5050,7 @@
 }
 
 void IntrinsicLocationsBuilderX86_64::VisitVarHandleGetAndBitwiseXorRelease(HInvoke* invoke) {
-  CreateVarHandleGetAndBitwiseOpLocations(invoke);
+  CreateVarHandleGetAndBitwiseOpLocations(invoke, codegen_);
 }
 
 void IntrinsicCodeGeneratorX86_64::VisitVarHandleGetAndBitwiseXorRelease(HInvoke* invoke) {
diff --git a/compiler/optimizing/intrinsics_x86_64.h b/compiler/optimizing/intrinsics_x86_64.h
index 59fe815..704fa9b 100644
--- a/compiler/optimizing/intrinsics_x86_64.h
+++ b/compiler/optimizing/intrinsics_x86_64.h
@@ -19,6 +19,7 @@
 
 #include "base/macros.h"
 #include "intrinsics.h"
+#include "intrinsics_list.h"
 
 namespace art HIDDEN {
 
@@ -39,9 +40,7 @@
 
 #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \
   void Visit ## Name(HInvoke* invoke) override;
-#include "intrinsics_list.h"
-  INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
-#undef INTRINSICS_LIST
+  ART_INTRINSICS_WITH_HINVOKE_LIST(OPTIMIZING_INTRINSICS)
 #undef OPTIMIZING_INTRINSICS
 
   // Check whether an invoke is an intrinsic, and if so, create a location summary. Returns whether
@@ -64,9 +63,7 @@
 
 #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \
   void Visit ## Name(HInvoke* invoke) override;
-#include "intrinsics_list.h"
-  INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
-#undef INTRINSICS_LIST
+  ART_INTRINSICS_WITH_HINVOKE_LIST(OPTIMIZING_INTRINSICS)
 #undef OPTIMIZING_INTRINSICS
 
  private:
@@ -74,6 +71,10 @@
 
   ArenaAllocator* GetAllocator();
 
+  void HandleValueOf(HInvoke* invoke,
+                     const IntrinsicVisitor::ValueOfInfo& info,
+                     DataType::Type type);
+
   CodeGeneratorX86_64* const codegen_;
 
   DISALLOW_COPY_AND_ASSIGN(IntrinsicCodeGeneratorX86_64);
diff --git a/compiler/optimizing/jit_patches_arm64.cc b/compiler/optimizing/jit_patches_arm64.cc
new file mode 100644
index 0000000..76ba182
--- /dev/null
+++ b/compiler/optimizing/jit_patches_arm64.cc
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "code_generation_data.h"
+#include "gc_root.h"
+#include "jit_patches_arm64.h"
+
+namespace art HIDDEN {
+
+namespace arm64 {
+
+vixl::aarch64::Literal<uint32_t>* JitPatchesARM64::DeduplicateUint32Literal(
+    uint32_t value) {
+  return uint32_literals_.GetOrCreate(
+      value,
+      [this, value]() {
+        return GetVIXLAssembler()->CreateLiteralDestroyedWithPool<uint32_t>(value);
+      });
+}
+
+vixl::aarch64::Literal<uint64_t>* JitPatchesARM64::DeduplicateUint64Literal(
+    uint64_t value) {
+  return uint64_literals_.GetOrCreate(
+      value,
+      [this, value]() {
+        return GetVIXLAssembler()->CreateLiteralDestroyedWithPool<uint64_t>(value);
+      });
+}
+
+static void PatchJitRootUse(uint8_t* code,
+                            const uint8_t* roots_data,
+                            vixl::aarch64::Literal<uint32_t>* literal,
+                            uint64_t index_in_table) {
+  uint32_t literal_offset = literal->GetOffset();
+  uintptr_t address =
+      reinterpret_cast<uintptr_t>(roots_data) + index_in_table * sizeof(GcRoot<mirror::Object>);
+  uint8_t* data = code + literal_offset;
+  reinterpret_cast<uint32_t*>(data)[0] = dchecked_integral_cast<uint32_t>(address);
+}
+
+void JitPatchesARM64::EmitJitRootPatches(
+    uint8_t* code,
+    const uint8_t* roots_data,
+    const CodeGenerationData& code_generation_data) const {
+  for (const auto& entry : jit_string_patches_) {
+    const StringReference& string_reference = entry.first;
+    vixl::aarch64::Literal<uint32_t>* table_entry_literal = entry.second;
+    uint64_t index_in_table = code_generation_data.GetJitStringRootIndex(string_reference);
+    PatchJitRootUse(code, roots_data, table_entry_literal, index_in_table);
+  }
+  for (const auto& entry : jit_class_patches_) {
+    const TypeReference& type_reference = entry.first;
+    vixl::aarch64::Literal<uint32_t>* table_entry_literal = entry.second;
+    uint64_t index_in_table = code_generation_data.GetJitClassRootIndex(type_reference);
+    PatchJitRootUse(code, roots_data, table_entry_literal, index_in_table);
+  }
+}
+
+vixl::aarch64::Literal<uint32_t>* JitPatchesARM64::DeduplicateBootImageAddressLiteral(
+    uint64_t address) {
+  return DeduplicateUint32Literal(dchecked_integral_cast<uint32_t>(address));
+}
+
+vixl::aarch64::Literal<uint32_t>* JitPatchesARM64::DeduplicateJitStringLiteral(
+    const DexFile& dex_file,
+    dex::StringIndex string_index,
+    Handle<mirror::String> handle,
+    CodeGenerationData* code_generation_data) {
+  code_generation_data->ReserveJitStringRoot(StringReference(&dex_file, string_index), handle);
+  return jit_string_patches_.GetOrCreate(
+      StringReference(&dex_file, string_index),
+      [this]() {
+        return GetVIXLAssembler()->CreateLiteralDestroyedWithPool<uint32_t>(/* value= */ 0u);
+      });
+}
+
+vixl::aarch64::Literal<uint32_t>* JitPatchesARM64::DeduplicateJitClassLiteral(
+    const DexFile& dex_file,
+    dex::TypeIndex type_index,
+    Handle<mirror::Class> handle,
+    CodeGenerationData* code_generation_data) {
+  code_generation_data->ReserveJitClassRoot(TypeReference(&dex_file, type_index), handle);
+  return jit_class_patches_.GetOrCreate(
+      TypeReference(&dex_file, type_index),
+      [this]() {
+        return GetVIXLAssembler()->CreateLiteralDestroyedWithPool<uint32_t>(/* value= */ 0u);
+      });
+}
+
+}  // namespace arm64
+}  // namespace art
diff --git a/compiler/optimizing/jit_patches_arm64.h b/compiler/optimizing/jit_patches_arm64.h
new file mode 100644
index 0000000..f928723
--- /dev/null
+++ b/compiler/optimizing/jit_patches_arm64.h
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_COMPILER_OPTIMIZING_JIT_PATCHES_ARM64_H_
+#define ART_COMPILER_OPTIMIZING_JIT_PATCHES_ARM64_H_
+
+#include "base/arena_allocator.h"
+#include "base/arena_containers.h"
+#include "dex/dex_file.h"
+#include "dex/string_reference.h"
+#include "dex/type_reference.h"
+#include "handle.h"
+#include "mirror/class.h"
+#include "mirror/string.h"
+#include "utils/arm64/assembler_arm64.h"
+
+// TODO(VIXL): Make VIXL compile with -Wshadow.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow"
+#include "aarch64/disasm-aarch64.h"
+#include "aarch64/macro-assembler-aarch64.h"
+#pragma GCC diagnostic pop
+
+namespace art HIDDEN {
+
+class CodeGenerationData;
+
+namespace arm64 {
+
+/**
+ * Helper for emitting string or class literals into JIT generated code,
+ * which can be shared between different compilers.
+ */
+class JitPatchesARM64 {
+ public:
+  JitPatchesARM64(Arm64Assembler* assembler, ArenaAllocator* allocator) :
+      assembler_(assembler),
+      uint32_literals_(std::less<uint32_t>(),
+                       allocator->Adapter(kArenaAllocCodeGenerator)),
+      uint64_literals_(std::less<uint64_t>(),
+                       allocator->Adapter(kArenaAllocCodeGenerator)),
+      jit_string_patches_(StringReferenceValueComparator(),
+                          allocator->Adapter(kArenaAllocCodeGenerator)),
+      jit_class_patches_(TypeReferenceValueComparator(),
+                         allocator->Adapter(kArenaAllocCodeGenerator)) {
+  }
+
+  using Uint64ToLiteralMap = ArenaSafeMap<uint64_t, vixl::aarch64::Literal<uint64_t>*>;
+  using Uint32ToLiteralMap = ArenaSafeMap<uint32_t, vixl::aarch64::Literal<uint32_t>*>;
+  using StringToLiteralMap = ArenaSafeMap<StringReference,
+                                          vixl::aarch64::Literal<uint32_t>*,
+                                          StringReferenceValueComparator>;
+  using TypeToLiteralMap = ArenaSafeMap<TypeReference,
+                                        vixl::aarch64::Literal<uint32_t>*,
+                                        TypeReferenceValueComparator>;
+
+  vixl::aarch64::Literal<uint32_t>* DeduplicateUint32Literal(uint32_t value);
+  vixl::aarch64::Literal<uint64_t>* DeduplicateUint64Literal(uint64_t value);
+  vixl::aarch64::Literal<uint32_t>* DeduplicateBootImageAddressLiteral(uint64_t address);
+  vixl::aarch64::Literal<uint32_t>* DeduplicateJitStringLiteral(
+      const DexFile& dex_file,
+      dex::StringIndex string_index,
+      Handle<mirror::String> handle,
+      CodeGenerationData* code_generation_data);
+  vixl::aarch64::Literal<uint32_t>* DeduplicateJitClassLiteral(
+      const DexFile& dex_file,
+      dex::TypeIndex type_index,
+      Handle<mirror::Class> handle,
+      CodeGenerationData* code_generation_data);
+
+  void EmitJitRootPatches(uint8_t* code,
+                          const uint8_t* roots_data,
+                          const CodeGenerationData& code_generation_data) const;
+
+  Arm64Assembler* GetAssembler() const { return assembler_; }
+  vixl::aarch64::MacroAssembler* GetVIXLAssembler() { return GetAssembler()->GetVIXLAssembler(); }
+
+ private:
+  Arm64Assembler* assembler_;
+  // Deduplication map for 32-bit literals, used for JIT for boot image addresses.
+  Uint32ToLiteralMap uint32_literals_;
+  // Deduplication map for 64-bit literals, used for JIT for method address or method code.
+  Uint64ToLiteralMap uint64_literals_;
+  // Patches for string literals in JIT compiled code.
+  StringToLiteralMap jit_string_patches_;
+  // Patches for class literals in JIT compiled code.
+  TypeToLiteralMap jit_class_patches_;
+};
+
+}  // namespace arm64
+
+}  // namespace art
+
+#endif  // ART_COMPILER_OPTIMIZING_JIT_PATCHES_ARM64_H_
diff --git a/compiler/optimizing/load_store_analysis.cc b/compiler/optimizing/load_store_analysis.cc
index f1c50ac..474c3bd 100644
--- a/compiler/optimizing/load_store_analysis.cc
+++ b/compiler/optimizing/load_store_analysis.cc
@@ -41,7 +41,7 @@
     // We currently only support Add and Sub operations.
     return true;
   }
-  if (idx1->AsBinaryOperation()->GetLeastConstantLeft() != idx2) {
+  if (idx1->GetLeastConstantLeft() != idx2) {
     // Cannot analyze [i+CONST1] and [j].
     return true;
   }
@@ -51,9 +51,9 @@
 
   // Since 'i' are the same in [i+CONST] and [i],
   // further compare [CONST] and [0].
-  int64_t l1 = idx1->IsAdd() ?
-               idx1->GetConstantRight()->AsIntConstant()->GetValue() :
-               -idx1->GetConstantRight()->AsIntConstant()->GetValue();
+  int64_t l1 = idx1->IsAdd()
+      ? idx1->GetConstantRight()->AsIntConstant()->GetValue()
+      : -idx1->GetConstantRight()->AsIntConstant()->GetValue();
   int64_t l2 = 0;
   int64_t h1 = l1 + (vector_length1 - 1);
   int64_t h2 = l2 + (vector_length2 - 1);
@@ -68,8 +68,7 @@
     // We currently only support Add and Sub operations.
     return true;
   }
-  if (idx1->AsBinaryOperation()->GetLeastConstantLeft() !=
-      idx2->AsBinaryOperation()->GetLeastConstantLeft()) {
+  if (idx1->GetLeastConstantLeft() != idx2->GetLeastConstantLeft()) {
     // Cannot analyze [i+CONST1] and [j+CONST2].
     return true;
   }
@@ -80,54 +79,17 @@
 
   // Since 'i' are the same in [i+CONST1] and [i+CONST2],
   // further compare [CONST1] and [CONST2].
-  int64_t l1 = idx1->IsAdd() ?
-               idx1->GetConstantRight()->AsIntConstant()->GetValue() :
-               -idx1->GetConstantRight()->AsIntConstant()->GetValue();
-  int64_t l2 = idx2->IsAdd() ?
-               idx2->GetConstantRight()->AsIntConstant()->GetValue() :
-               -idx2->GetConstantRight()->AsIntConstant()->GetValue();
+  int64_t l1 = idx1->IsAdd()
+      ? idx1->GetConstantRight()->AsIntConstant()->GetValue()
+      : -idx1->GetConstantRight()->AsIntConstant()->GetValue();
+  int64_t l2 = idx2->IsAdd()
+      ? idx2->GetConstantRight()->AsIntConstant()->GetValue()
+      : -idx2->GetConstantRight()->AsIntConstant()->GetValue();
   int64_t h1 = l1 + (vector_length1 - 1);
   int64_t h2 = l2 + (vector_length2 - 1);
   return CanIntegerRangesOverlap(l1, h1, l2, h2);
 }
 
-// Make sure we mark any writes/potential writes to heap-locations within partially
-// escaped values as escaping.
-void ReferenceInfo::PrunePartialEscapeWrites() {
-  DCHECK(subgraph_ != nullptr);
-  if (!subgraph_->IsValid()) {
-    // All paths escape.
-    return;
-  }
-  HGraph* graph = reference_->GetBlock()->GetGraph();
-  ArenaBitVector additional_exclusions(
-      allocator_, graph->GetBlocks().size(), false, kArenaAllocLSA);
-  for (const HUseListNode<HInstruction*>& use : reference_->GetUses()) {
-    const HInstruction* user = use.GetUser();
-    if (!additional_exclusions.IsBitSet(user->GetBlock()->GetBlockId()) &&
-        subgraph_->ContainsBlock(user->GetBlock()) &&
-        (user->IsUnresolvedInstanceFieldSet() || user->IsUnresolvedStaticFieldSet() ||
-         user->IsInstanceFieldSet() || user->IsStaticFieldSet() || user->IsArraySet()) &&
-        (reference_ == user->InputAt(0)) &&
-        std::any_of(subgraph_->UnreachableBlocks().begin(),
-                    subgraph_->UnreachableBlocks().end(),
-                    [&](const HBasicBlock* excluded) -> bool {
-                      return reference_->GetBlock()->GetGraph()->PathBetween(excluded,
-                                                                             user->GetBlock());
-                    })) {
-      // This object had memory written to it somewhere, if it escaped along
-      // some paths prior to the current block this write also counts as an
-      // escape.
-      additional_exclusions.SetBit(user->GetBlock()->GetBlockId());
-    }
-  }
-  if (UNLIKELY(additional_exclusions.IsAnyBitSet())) {
-    for (uint32_t exc : additional_exclusions.Indexes()) {
-      subgraph_->RemoveBlock(graph->GetBlocks()[exc]);
-    }
-  }
-}
-
 bool HeapLocationCollector::InstructionEligibleForLSERemoval(HInstruction* inst) const {
   if (inst->IsNewInstance()) {
     return !inst->AsNewInstance()->NeedsChecks();
@@ -149,37 +111,6 @@
   }
 }
 
-void ReferenceInfo::CollectPartialEscapes(HGraph* graph) {
-  ScopedArenaAllocator saa(graph->GetArenaStack());
-  ArenaBitVector seen_instructions(&saa, graph->GetCurrentInstructionId(), false, kArenaAllocLSA);
-  // Get regular escapes.
-  ScopedArenaVector<HInstruction*> additional_escape_vectors(saa.Adapter(kArenaAllocLSA));
-  LambdaEscapeVisitor scan_instructions([&](HInstruction* escape) -> bool {
-    HandleEscape(escape);
-    // LSE can't track heap-locations through Phi and Select instructions so we
-    // need to assume all escapes from these are escapes for the base reference.
-    if ((escape->IsPhi() || escape->IsSelect()) && !seen_instructions.IsBitSet(escape->GetId())) {
-      seen_instructions.SetBit(escape->GetId());
-      additional_escape_vectors.push_back(escape);
-    }
-    return true;
-  });
-  additional_escape_vectors.push_back(reference_);
-  while (!additional_escape_vectors.empty()) {
-    HInstruction* ref = additional_escape_vectors.back();
-    additional_escape_vectors.pop_back();
-    DCHECK(ref == reference_ || ref->IsPhi() || ref->IsSelect()) << *ref;
-    VisitEscapes(ref, scan_instructions);
-  }
-
-  // Mark irreducible loop headers as escaping since they cannot be tracked through.
-  for (HBasicBlock* blk : graph->GetActiveBlocks()) {
-    if (blk->IsLoopHeader() && blk->GetLoopInformation()->IsIrreducible()) {
-      HandleEscape(blk);
-    }
-  }
-}
-
 void HeapLocationCollector::DumpReferenceStats(OptimizingCompilerStats* stats) {
   if (stats == nullptr) {
     return;
@@ -197,14 +128,6 @@
         MaybeRecordStat(stats, MethodCompilationStat::kFullLSEPossible);
       }
     }
-    // TODO This is an estimate of the number of allocations we will be able
-    // to (partially) remove. As additional work is done this can be refined.
-    if (ri->IsPartialSingleton() && instruction->IsNewInstance() &&
-        ri->GetNoEscapeSubgraph()->ContainsBlock(instruction->GetBlock()) &&
-        !ri->GetNoEscapeSubgraph()->GetExcludedCohorts().empty() &&
-        InstructionEligibleForLSERemoval(instruction)) {
-      MaybeRecordStat(stats, MethodCompilationStat::kPartialLSEPossible);
-    }
   }
 }
 
@@ -269,6 +192,13 @@
 }
 
 bool LoadStoreAnalysis::Run() {
+  // Currently load_store analysis can't handle predicated load/stores; specifically pairs of
+  // memory operations with different predicates.
+  // TODO: support predicated SIMD.
+  if (graph_->HasPredicatedSIMD()) {
+    return false;
+  }
+
   for (HBasicBlock* block : graph_->GetReversePostOrder()) {
     heap_location_collector_.VisitBasicBlock(block);
   }
diff --git a/compiler/optimizing/load_store_analysis.h b/compiler/optimizing/load_store_analysis.h
index c46a5b9..4a630dd 100644
--- a/compiler/optimizing/load_store_analysis.h
+++ b/compiler/optimizing/load_store_analysis.h
@@ -25,65 +25,26 @@
 #include "base/scoped_arena_containers.h"
 #include "base/stl_util.h"
 #include "escape.h"
-#include "execution_subgraph.h"
 #include "nodes.h"
 #include "optimizing/optimizing_compiler_stats.h"
 
 namespace art HIDDEN {
 
-enum class LoadStoreAnalysisType {
-  kBasic,
-  kNoPredicatedInstructions,
-  kFull,
-};
-
 // A ReferenceInfo contains additional info about a reference such as
 // whether it's a singleton, returned, etc.
 class ReferenceInfo : public DeletableArenaObject<kArenaAllocLSA> {
  public:
-  ReferenceInfo(HInstruction* reference,
-                ScopedArenaAllocator* allocator,
-                size_t pos,
-                LoadStoreAnalysisType elimination_type)
+  ReferenceInfo(HInstruction* reference, size_t pos)
       : reference_(reference),
         position_(pos),
         is_singleton_(true),
         is_singleton_and_not_returned_(true),
-        is_singleton_and_not_deopt_visible_(true),
-        allocator_(allocator),
-        subgraph_(nullptr) {
-    // TODO We can do this in one pass.
-    // TODO NewArray is possible but will need to get a handle on how to deal with the dynamic loads
-    // for now just ignore it.
-    bool can_be_partial = elimination_type != LoadStoreAnalysisType::kBasic &&
-                          (/* reference_->IsNewArray() || */ reference_->IsNewInstance());
-    if (can_be_partial) {
-      subgraph_.reset(
-          new (allocator) ExecutionSubgraph(reference->GetBlock()->GetGraph(), allocator));
-      CollectPartialEscapes(reference_->GetBlock()->GetGraph());
-    }
+        is_singleton_and_not_deopt_visible_(true) {
     CalculateEscape(reference_,
                     nullptr,
                     &is_singleton_,
                     &is_singleton_and_not_returned_,
                     &is_singleton_and_not_deopt_visible_);
-    if (can_be_partial) {
-      if (elimination_type == LoadStoreAnalysisType::kNoPredicatedInstructions) {
-        // This is to mark writes to partially escaped values as also part of the escaped subset.
-        // TODO We can avoid this if we have a 'ConditionalWrite' instruction. Will require testing
-        //      to see if the additional branches are worth it.
-        PrunePartialEscapeWrites();
-      }
-      DCHECK(subgraph_ != nullptr);
-      subgraph_->Finalize();
-    } else {
-      DCHECK(subgraph_ == nullptr);
-    }
-  }
-
-  const ExecutionSubgraph* GetNoEscapeSubgraph() const {
-    DCHECK(IsPartialSingleton());
-    return subgraph_.get();
   }
 
   HInstruction* GetReference() const {
@@ -101,16 +62,6 @@
     return is_singleton_;
   }
 
-  // This is a singleton and there are paths that don't escape the method
-  bool IsPartialSingleton() const {
-    auto ref = GetReference();
-    // TODO NewArray is possible but will need to get a handle on how to deal with the dynamic loads
-    // for now just ignore it.
-    return (/* ref->IsNewArray() || */ ref->IsNewInstance()) &&
-           subgraph_ != nullptr &&
-           subgraph_->IsValid();
-  }
-
   // Returns true if reference_ is a singleton and not returned to the caller or
   // used as an environment local of an HDeoptimize instruction.
   // The allocation and stores into reference_ may be eliminated for such cases.
@@ -126,19 +77,6 @@
   }
 
  private:
-  void CollectPartialEscapes(HGraph* graph);
-  void HandleEscape(HBasicBlock* escape) {
-    DCHECK(subgraph_ != nullptr);
-    subgraph_->RemoveBlock(escape);
-  }
-  void HandleEscape(HInstruction* escape) {
-    HandleEscape(escape->GetBlock());
-  }
-
-  // Make sure we mark any writes/potential writes to heap-locations within partially
-  // escaped values as escaping.
-  void PrunePartialEscapeWrites();
-
   HInstruction* const reference_;
   const size_t position_;  // position in HeapLocationCollector's ref_info_array_.
 
@@ -149,10 +87,6 @@
   // Is singleton and not used as an environment local of HDeoptimize.
   bool is_singleton_and_not_deopt_visible_;
 
-  ScopedArenaAllocator* allocator_;
-
-  std::unique_ptr<ExecutionSubgraph> subgraph_;
-
   DISALLOW_COPY_AND_ASSIGN(ReferenceInfo);
 };
 
@@ -249,16 +183,13 @@
   // aliasing matrix of 8 heap locations.
   static constexpr uint32_t kInitialAliasingMatrixBitVectorSize = 32;
 
-  HeapLocationCollector(HGraph* graph,
-                        ScopedArenaAllocator* allocator,
-                        LoadStoreAnalysisType lse_type)
+  HeapLocationCollector(HGraph* graph, ScopedArenaAllocator* allocator)
       : HGraphVisitor(graph),
         allocator_(allocator),
         ref_info_array_(allocator->Adapter(kArenaAllocLSA)),
         heap_locations_(allocator->Adapter(kArenaAllocLSA)),
         aliasing_matrix_(allocator, kInitialAliasingMatrixBitVectorSize, true, kArenaAllocLSA),
-        has_heap_stores_(false),
-        lse_type_(lse_type) {
+        has_heap_stores_(false) {
     aliasing_matrix_.ClearAllBits();
   }
 
@@ -272,12 +203,6 @@
     ref_info_array_.clear();
   }
 
-  size_t CountPartialSingletons() const {
-    return std::count_if(ref_info_array_.begin(),
-                         ref_info_array_.end(),
-                         [](ReferenceInfo* ri) { return ri->IsPartialSingleton(); });
-  }
-
   size_t GetNumberOfHeapLocations() const {
     return heap_locations_.size();
   }
@@ -507,7 +432,7 @@
     ReferenceInfo* ref_info = FindReferenceInfoOf(instruction);
     if (ref_info == nullptr) {
       size_t pos = ref_info_array_.size();
-      ref_info = new (allocator_) ReferenceInfo(instruction, allocator_, pos, lse_type_);
+      ref_info = new (allocator_) ReferenceInfo(instruction, pos);
       ref_info_array_.push_back(ref_info);
     }
     return ref_info;
@@ -566,10 +491,6 @@
                             is_vec_op);
   }
 
-  void VisitPredicatedInstanceFieldGet(HPredicatedInstanceFieldGet* instruction) override {
-    VisitFieldAccess(instruction->GetTarget(), instruction->GetFieldInfo());
-    CreateReferenceInfoForReferenceType(instruction);
-  }
   void VisitInstanceFieldGet(HInstanceFieldGet* instruction) override {
     VisitFieldAccess(instruction->InputAt(0), instruction->GetFieldInfo());
     CreateReferenceInfoForReferenceType(instruction);
@@ -610,6 +531,7 @@
   }
 
   void VisitVecLoad(HVecLoad* instruction) override {
+    DCHECK(!instruction->IsPredicated());
     HInstruction* array = instruction->InputAt(0);
     HInstruction* index = instruction->InputAt(1);
     DataType::Type type = instruction->GetPackedType();
@@ -618,6 +540,7 @@
   }
 
   void VisitVecStore(HVecStore* instruction) override {
+    DCHECK(!instruction->IsPredicated());
     HInstruction* array = instruction->InputAt(0);
     HInstruction* index = instruction->InputAt(1);
     DataType::Type type = instruction->GetPackedType();
@@ -643,25 +566,16 @@
   ArenaBitVector aliasing_matrix_;    // aliasing info between each pair of locations.
   bool has_heap_stores_;    // If there is no heap stores, LSE acts as GVN with better
                             // alias analysis and won't be as effective.
-  LoadStoreAnalysisType lse_type_;
 
   DISALLOW_COPY_AND_ASSIGN(HeapLocationCollector);
 };
 
 class LoadStoreAnalysis {
  public:
-  // for_elimination controls whether we should keep track of escapes at a per-block level for
-  // partial LSE.
   explicit LoadStoreAnalysis(HGraph* graph,
                              OptimizingCompilerStats* stats,
-                             ScopedArenaAllocator* local_allocator,
-                             LoadStoreAnalysisType lse_type)
-      : graph_(graph),
-        stats_(stats),
-        heap_location_collector_(
-            graph,
-            local_allocator,
-            ExecutionSubgraph::CanAnalyse(graph_) ? lse_type : LoadStoreAnalysisType::kBasic) {}
+                             ScopedArenaAllocator* local_allocator)
+      : graph_(graph), stats_(stats), heap_location_collector_(graph, local_allocator) {}
 
   const HeapLocationCollector& GetHeapLocationCollector() const {
     return heap_location_collector_;
diff --git a/compiler/optimizing/load_store_analysis_test.cc b/compiler/optimizing/load_store_analysis_test.cc
index 865febb..9018557 100644
--- a/compiler/optimizing/load_store_analysis_test.cc
+++ b/compiler/optimizing/load_store_analysis_test.cc
@@ -27,8 +27,6 @@
 #include "dex/dex_file_types.h"
 #include "dex/method_reference.h"
 #include "entrypoints/quick/quick_entrypoints_enum.h"
-#include "execution_subgraph.h"
-#include "execution_subgraph_test.h"
 #include "gtest/gtest.h"
 #include "handle.h"
 #include "handle_scope.h"
@@ -51,16 +49,6 @@
       const std::vector<AdjacencyListGraph::Edge>& adj) {
     return AdjacencyListGraph(graph_, GetAllocator(), entry_name, exit_name, adj);
   }
-
-  bool IsValidSubgraph(const ExecutionSubgraph* esg) {
-    return ExecutionSubgraphTestHelper::CalculateValidity(graph_, esg);
-  }
-
-  bool IsValidSubgraph(const ExecutionSubgraph& esg) {
-    return ExecutionSubgraphTestHelper::CalculateValidity(graph_, &esg);
-  }
-  void CheckReachability(const AdjacencyListGraph& adj,
-                         const std::vector<AdjacencyListGraph::Edge>& reach);
 };
 
 TEST_F(LoadStoreAnalysisTest, ArrayHeapLocations) {
@@ -102,7 +90,7 @@
   // Test HeapLocationCollector initialization.
   // Should be no heap locations, no operations on the heap.
   ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  HeapLocationCollector heap_location_collector(graph_, &allocator, LoadStoreAnalysisType::kFull);
+  HeapLocationCollector heap_location_collector(graph_, &allocator);
   ASSERT_EQ(heap_location_collector.GetNumberOfHeapLocations(), 0U);
   ASSERT_FALSE(heap_location_collector.HasHeapStores());
 
@@ -201,7 +189,7 @@
   // Test HeapLocationCollector initialization.
   // Should be no heap locations, no operations on the heap.
   ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  HeapLocationCollector heap_location_collector(graph_, &allocator, LoadStoreAnalysisType::kFull);
+  HeapLocationCollector heap_location_collector(graph_, &allocator);
   ASSERT_EQ(heap_location_collector.GetNumberOfHeapLocations(), 0U);
   ASSERT_FALSE(heap_location_collector.HasHeapStores());
 
@@ -283,7 +271,7 @@
   body->AddInstruction(new (GetAllocator()) HReturnVoid());
 
   ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  LoadStoreAnalysis lsa(graph_, nullptr, &allocator, LoadStoreAnalysisType::kBasic);
+  LoadStoreAnalysis lsa(graph_, nullptr, &allocator);
   lsa.Run();
   const HeapLocationCollector& heap_location_collector = lsa.GetHeapLocationCollector();
 
@@ -451,7 +439,7 @@
   entry->AddInstruction(vstore_i_add6_vlen2);
 
   ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  LoadStoreAnalysis lsa(graph_, nullptr, &allocator, LoadStoreAnalysisType::kBasic);
+  LoadStoreAnalysis lsa(graph_, nullptr, &allocator);
   lsa.Run();
   const HeapLocationCollector& heap_location_collector = lsa.GetHeapLocationCollector();
 
@@ -611,7 +599,7 @@
   entry->AddInstruction(arr_set_8);
 
   ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  LoadStoreAnalysis lsa(graph_, nullptr, &allocator, LoadStoreAnalysisType::kBasic);
+  LoadStoreAnalysis lsa(graph_, nullptr, &allocator);
   lsa.Run();
   const HeapLocationCollector& heap_location_collector = lsa.GetHeapLocationCollector();
 
@@ -702,7 +690,7 @@
   entry->AddInstruction(array_get4);
 
   ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  HeapLocationCollector heap_location_collector(graph_, &allocator, LoadStoreAnalysisType::kFull);
+  HeapLocationCollector heap_location_collector(graph_, &allocator);
   heap_location_collector.VisitBasicBlock(entry);
 
   // Test that the HeapLocationCollector should be able to tell
@@ -720,853 +708,6 @@
   ASSERT_EQ(loc1, loc4);
 }
 
-void LoadStoreAnalysisTest::CheckReachability(const AdjacencyListGraph& adj,
-                                              const std::vector<AdjacencyListGraph::Edge>& reach) {
-  uint32_t cnt = 0;
-  for (HBasicBlock* blk : graph_->GetBlocks()) {
-    if (adj.HasBlock(blk)) {
-      for (HBasicBlock* other : graph_->GetBlocks()) {
-        if (other == nullptr) {
-          continue;
-        }
-        if (adj.HasBlock(other)) {
-          bool contains_edge =
-              std::find(reach.begin(),
-                        reach.end(),
-                        AdjacencyListGraph::Edge { adj.GetName(blk), adj.GetName(other) }) !=
-              reach.end();
-          if (graph_->PathBetween(blk, other)) {
-            cnt++;
-            EXPECT_TRUE(contains_edge) << "Unexpected edge found between " << adj.GetName(blk)
-                                       << " and " << adj.GetName(other);
-          } else {
-            EXPECT_FALSE(contains_edge) << "Expected edge not found between " << adj.GetName(blk)
-                                        << " and " << adj.GetName(other);
-          }
-        } else if (graph_->PathBetween(blk, other)) {
-          ADD_FAILURE() << "block " << adj.GetName(blk)
-                        << " has path to non-adjacency-graph block id: " << other->GetBlockId();
-        }
-      }
-    } else {
-      for (HBasicBlock* other : graph_->GetBlocks()) {
-        if (other == nullptr) {
-          continue;
-        }
-        EXPECT_FALSE(graph_->PathBetween(blk, other))
-            << "Reachable blocks outside of adjacency-list";
-      }
-    }
-  }
-  EXPECT_EQ(cnt, reach.size());
-}
-
-TEST_F(LoadStoreAnalysisTest, ReachabilityTest1) {
-  CreateGraph();
-  AdjacencyListGraph blks(SetupFromAdjacencyList(
-      "entry",
-      "exit",
-      { { "entry", "left" }, { "entry", "right" }, { "left", "exit" }, { "right", "exit" } }));
-  CheckReachability(blks,
-                    {
-                        { "entry", "left" },
-                        { "entry", "right" },
-                        { "entry", "exit" },
-                        { "right", "exit" },
-                        { "left", "exit" },
-                    });
-}
-
-TEST_F(LoadStoreAnalysisTest, ReachabilityTest2) {
-  CreateGraph();
-  AdjacencyListGraph blks(SetupFromAdjacencyList(
-      "entry",
-      "exit",
-      { { "entry", "loop-header" }, { "loop-header", "loop" }, { "loop", "loop-header" } }));
-  CheckReachability(blks,
-                    {
-                        { "entry", "loop-header" },
-                        { "entry", "loop" },
-                        { "loop-header", "loop-header" },
-                        { "loop-header", "loop" },
-                        { "loop", "loop-header" },
-                        { "loop", "loop" },
-                    });
-}
-
-TEST_F(LoadStoreAnalysisTest, ReachabilityTest3) {
-  CreateGraph();
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 { { "entry", "loop-header" },
-                                                   { "loop-header", "loop" },
-                                                   { "loop", "loop-header" },
-                                                   { "entry", "right" },
-                                                   { "right", "exit" } }));
-  CheckReachability(blks,
-                    {
-                        { "entry", "loop-header" },
-                        { "entry", "loop" },
-                        { "entry", "right" },
-                        { "entry", "exit" },
-                        { "loop-header", "loop-header" },
-                        { "loop-header", "loop" },
-                        { "loop", "loop-header" },
-                        { "loop", "loop" },
-                        { "right", "exit" },
-                    });
-}
-
-static bool AreExclusionsIndependent(HGraph* graph, const ExecutionSubgraph* esg) {
-  auto excluded = esg->GetExcludedCohorts();
-  if (excluded.size() < 2) {
-    return true;
-  }
-  for (auto first = excluded.begin(); first != excluded.end(); ++first) {
-    for (auto second = excluded.begin(); second != excluded.end(); ++second) {
-      if (first == second) {
-        continue;
-      }
-      for (const HBasicBlock* entry : first->EntryBlocks()) {
-        for (const HBasicBlock* exit : second->ExitBlocks()) {
-          if (graph->PathBetween(exit, entry)) {
-            return false;
-          }
-        }
-      }
-    }
-  }
-  return true;
-}
-
-// // ENTRY
-// obj = new Obj();
-// if (parameter_value) {
-//   // LEFT
-//   call_func(obj);
-// } else {
-//   // RIGHT
-//   obj.field = 1;
-// }
-// // EXIT
-// obj.field;
-TEST_F(LoadStoreAnalysisTest, PartialEscape) {
-  CreateGraph();
-  AdjacencyListGraph blks(SetupFromAdjacencyList(
-      "entry",
-      "exit",
-      { { "entry", "left" }, { "entry", "right" }, { "left", "exit" }, { "right", "exit" } }));
-  HBasicBlock* entry = blks.Get("entry");
-  HBasicBlock* left = blks.Get("left");
-  HBasicBlock* right = blks.Get("right");
-  HBasicBlock* exit = blks.Get("exit");
-
-  HInstruction* bool_value = new (GetAllocator())
-      HParameterValue(graph_->GetDexFile(), dex::TypeIndex(1), 1, DataType::Type::kBool);
-  HInstruction* c0 = graph_->GetIntConstant(0);
-  HInstruction* cls = new (GetAllocator()) HLoadClass(graph_->GetCurrentMethod(),
-                                                      dex::TypeIndex(10),
-                                                      graph_->GetDexFile(),
-                                                      ScopedNullHandle<mirror::Class>(),
-                                                      false,
-                                                      0,
-                                                      false);
-  HInstruction* new_inst =
-      new (GetAllocator()) HNewInstance(cls,
-                                        0,
-                                        dex::TypeIndex(10),
-                                        graph_->GetDexFile(),
-                                        false,
-                                        QuickEntrypointEnum::kQuickAllocObjectInitialized);
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(if_inst);
-
-  HInstruction* call_left = new (GetAllocator())
-      HInvokeStaticOrDirect(GetAllocator(),
-                            1,
-                            DataType::Type::kVoid,
-                            0,
-                            { nullptr, 0 },
-                            nullptr,
-                            {},
-                            InvokeType::kStatic,
-                            { nullptr, 0 },
-                            HInvokeStaticOrDirect::ClinitCheckRequirement::kNone,
-                            !graph_->IsDebuggable());
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  call_left->AsInvoke()->SetRawInputAt(0, new_inst);
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-
-  HInstruction* write_right = new (GetAllocator()) HInstanceFieldSet(new_inst,
-                                                                     c0,
-                                                                     nullptr,
-                                                                     DataType::Type::kInt32,
-                                                                     MemberOffset(32),
-                                                                     false,
-                                                                     0,
-                                                                     0,
-                                                                     graph_->GetDexFile(),
-                                                                     0);
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* read_final = new (GetAllocator()) HInstanceFieldGet(new_inst,
-                                                                    nullptr,
-                                                                    DataType::Type::kInt32,
-                                                                    MemberOffset(32),
-                                                                    false,
-                                                                    0,
-                                                                    0,
-                                                                    graph_->GetDexFile(),
-                                                                    0);
-  exit->AddInstruction(read_final);
-
-  ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  LoadStoreAnalysis lsa(graph_, nullptr, &allocator, LoadStoreAnalysisType::kFull);
-  lsa.Run();
-
-  const HeapLocationCollector& heap_location_collector = lsa.GetHeapLocationCollector();
-  ReferenceInfo* info = heap_location_collector.FindReferenceInfoOf(new_inst);
-  ASSERT_TRUE(info->IsPartialSingleton());
-  const ExecutionSubgraph* esg = info->GetNoEscapeSubgraph();
-
-  ASSERT_TRUE(esg->IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  ASSERT_TRUE(AreExclusionsIndependent(graph_, esg));
-  std::unordered_set<const HBasicBlock*> contents(esg->ReachableBlocks().begin(),
-                                                  esg->ReachableBlocks().end());
-
-  ASSERT_EQ(contents.size(), 3u);
-  ASSERT_TRUE(contents.find(blks.Get("left")) == contents.end());
-
-  ASSERT_TRUE(contents.find(blks.Get("right")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("entry")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("exit")) != contents.end());
-}
-
-// // ENTRY
-// obj = new Obj();
-// if (parameter_value) {
-//   // LEFT
-//   call_func(obj);
-// } else {
-//   // RIGHT
-//   obj.field = 1;
-// }
-// // EXIT
-// obj.field2;
-TEST_F(LoadStoreAnalysisTest, PartialEscape2) {
-  CreateGraph();
-  AdjacencyListGraph blks(SetupFromAdjacencyList(
-      "entry",
-      "exit",
-      { { "entry", "left" }, { "entry", "right" }, { "left", "exit" }, { "right", "exit" } }));
-  HBasicBlock* entry = blks.Get("entry");
-  HBasicBlock* left = blks.Get("left");
-  HBasicBlock* right = blks.Get("right");
-  HBasicBlock* exit = blks.Get("exit");
-
-  HInstruction* bool_value = new (GetAllocator())
-      HParameterValue(graph_->GetDexFile(), dex::TypeIndex(1), 1, DataType::Type::kBool);
-  HInstruction* c0 = graph_->GetIntConstant(0);
-  HInstruction* cls = new (GetAllocator()) HLoadClass(graph_->GetCurrentMethod(),
-                                                      dex::TypeIndex(10),
-                                                      graph_->GetDexFile(),
-                                                      ScopedNullHandle<mirror::Class>(),
-                                                      false,
-                                                      0,
-                                                      false);
-  HInstruction* new_inst =
-      new (GetAllocator()) HNewInstance(cls,
-                                        0,
-                                        dex::TypeIndex(10),
-                                        graph_->GetDexFile(),
-                                        false,
-                                        QuickEntrypointEnum::kQuickAllocObjectInitialized);
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(if_inst);
-
-  HInstruction* call_left = new (GetAllocator())
-      HInvokeStaticOrDirect(GetAllocator(),
-                            1,
-                            DataType::Type::kVoid,
-                            0,
-                            { nullptr, 0 },
-                            nullptr,
-                            {},
-                            InvokeType::kStatic,
-                            { nullptr, 0 },
-                            HInvokeStaticOrDirect::ClinitCheckRequirement::kNone,
-                            !graph_->IsDebuggable());
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  call_left->AsInvoke()->SetRawInputAt(0, new_inst);
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-
-  HInstruction* write_right = new (GetAllocator()) HInstanceFieldSet(new_inst,
-                                                                     c0,
-                                                                     nullptr,
-                                                                     DataType::Type::kInt32,
-                                                                     MemberOffset(32),
-                                                                     false,
-                                                                     0,
-                                                                     0,
-                                                                     graph_->GetDexFile(),
-                                                                     0);
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* read_final = new (GetAllocator()) HInstanceFieldGet(new_inst,
-                                                                    nullptr,
-                                                                    DataType::Type::kInt32,
-                                                                    MemberOffset(16),
-                                                                    false,
-                                                                    0,
-                                                                    0,
-                                                                    graph_->GetDexFile(),
-                                                                    0);
-  exit->AddInstruction(read_final);
-
-  ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  LoadStoreAnalysis lsa(graph_, nullptr, &allocator, LoadStoreAnalysisType::kFull);
-  lsa.Run();
-
-  const HeapLocationCollector& heap_location_collector = lsa.GetHeapLocationCollector();
-  ReferenceInfo* info = heap_location_collector.FindReferenceInfoOf(new_inst);
-  ASSERT_TRUE(info->IsPartialSingleton());
-  const ExecutionSubgraph* esg = info->GetNoEscapeSubgraph();
-
-  ASSERT_TRUE(esg->IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  ASSERT_TRUE(AreExclusionsIndependent(graph_, esg));
-  std::unordered_set<const HBasicBlock*> contents(esg->ReachableBlocks().begin(),
-                                                  esg->ReachableBlocks().end());
-
-  ASSERT_EQ(contents.size(), 3u);
-  ASSERT_TRUE(contents.find(blks.Get("left")) == contents.end());
-
-  ASSERT_TRUE(contents.find(blks.Get("right")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("entry")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("exit")) != contents.end());
-}
-
-// // ENTRY
-// obj = new Obj();
-// obj.field = 10;
-// if (parameter_value) {
-//   // LEFT
-//   call_func(obj);
-// } else {
-//   // RIGHT
-//   obj.field = 20;
-// }
-// // EXIT
-// obj.field;
-TEST_F(LoadStoreAnalysisTest, PartialEscape3) {
-  CreateGraph();
-  AdjacencyListGraph blks(SetupFromAdjacencyList(
-      "entry",
-      "exit",
-      { { "entry", "left" }, { "entry", "right" }, { "left", "exit" }, { "right", "exit" } }));
-  HBasicBlock* entry = blks.Get("entry");
-  HBasicBlock* left = blks.Get("left");
-  HBasicBlock* right = blks.Get("right");
-  HBasicBlock* exit = blks.Get("exit");
-
-  HInstruction* bool_value = new (GetAllocator())
-      HParameterValue(graph_->GetDexFile(), dex::TypeIndex(1), 1, DataType::Type::kBool);
-  HInstruction* c10 = graph_->GetIntConstant(10);
-  HInstruction* c20 = graph_->GetIntConstant(20);
-  HInstruction* cls = new (GetAllocator()) HLoadClass(graph_->GetCurrentMethod(),
-                                                      dex::TypeIndex(10),
-                                                      graph_->GetDexFile(),
-                                                      ScopedNullHandle<mirror::Class>(),
-                                                      false,
-                                                      0,
-                                                      false);
-  HInstruction* new_inst =
-      new (GetAllocator()) HNewInstance(cls,
-                                        0,
-                                        dex::TypeIndex(10),
-                                        graph_->GetDexFile(),
-                                        false,
-                                        QuickEntrypointEnum::kQuickAllocObjectInitialized);
-
-  HInstruction* write_entry = new (GetAllocator()) HInstanceFieldSet(new_inst,
-                                                                     c10,
-                                                                     nullptr,
-                                                                     DataType::Type::kInt32,
-                                                                     MemberOffset(32),
-                                                                     false,
-                                                                     0,
-                                                                     0,
-                                                                     graph_->GetDexFile(),
-                                                                     0);
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_entry);
-  entry->AddInstruction(if_inst);
-
-  HInstruction* call_left = new (GetAllocator())
-      HInvokeStaticOrDirect(GetAllocator(),
-                            1,
-                            DataType::Type::kVoid,
-                            0,
-                            { nullptr, 0 },
-                            nullptr,
-                            {},
-                            InvokeType::kStatic,
-                            { nullptr, 0 },
-                            HInvokeStaticOrDirect::ClinitCheckRequirement::kNone,
-                            !graph_->IsDebuggable());
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  call_left->AsInvoke()->SetRawInputAt(0, new_inst);
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-
-  HInstruction* write_right = new (GetAllocator()) HInstanceFieldSet(new_inst,
-                                                                     c20,
-                                                                     nullptr,
-                                                                     DataType::Type::kInt32,
-                                                                     MemberOffset(32),
-                                                                     false,
-                                                                     0,
-                                                                     0,
-                                                                     graph_->GetDexFile(),
-                                                                     0);
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* read_final = new (GetAllocator()) HInstanceFieldGet(new_inst,
-                                                                    nullptr,
-                                                                    DataType::Type::kInt32,
-                                                                    MemberOffset(32),
-                                                                    false,
-                                                                    0,
-                                                                    0,
-                                                                    graph_->GetDexFile(),
-                                                                    0);
-  exit->AddInstruction(read_final);
-
-  ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  LoadStoreAnalysis lsa(graph_, nullptr, &allocator, LoadStoreAnalysisType::kFull);
-  lsa.Run();
-
-  const HeapLocationCollector& heap_location_collector = lsa.GetHeapLocationCollector();
-  ReferenceInfo* info = heap_location_collector.FindReferenceInfoOf(new_inst);
-  ASSERT_TRUE(info->IsPartialSingleton());
-  const ExecutionSubgraph* esg = info->GetNoEscapeSubgraph();
-
-  ASSERT_TRUE(esg->IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  ASSERT_TRUE(AreExclusionsIndependent(graph_, esg));
-  std::unordered_set<const HBasicBlock*> contents(esg->ReachableBlocks().begin(),
-                                                  esg->ReachableBlocks().end());
-
-  ASSERT_EQ(contents.size(), 3u);
-  ASSERT_TRUE(contents.find(blks.Get("left")) == contents.end());
-
-  ASSERT_TRUE(contents.find(blks.Get("right")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("entry")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("exit")) != contents.end());
-}
-
-// For simplicity Partial LSE considers check-casts to escape. It means we don't
-// need to worry about inserting throws.
-// // ENTRY
-// obj = new Obj();
-// obj.field = 10;
-// if (parameter_value) {
-//   // LEFT
-//   (Foo)obj;
-// } else {
-//   // RIGHT
-//   obj.field = 20;
-// }
-// // EXIT
-// obj.field;
-TEST_F(LoadStoreAnalysisTest, PartialEscape4) {
-  CreateGraph();
-  AdjacencyListGraph blks(SetupFromAdjacencyList(
-      "entry",
-      "exit",
-      { { "entry", "left" }, { "entry", "right" }, { "left", "exit" }, { "right", "exit" } }));
-  HBasicBlock* entry = blks.Get("entry");
-  HBasicBlock* left = blks.Get("left");
-  HBasicBlock* right = blks.Get("right");
-  HBasicBlock* exit = blks.Get("exit");
-
-  HInstruction* bool_value = new (GetAllocator())
-      HParameterValue(graph_->GetDexFile(), dex::TypeIndex(1), 1, DataType::Type::kBool);
-  HInstruction* c10 = graph_->GetIntConstant(10);
-  HInstruction* c20 = graph_->GetIntConstant(20);
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-
-  HInstruction* write_entry = MakeIFieldSet(new_inst, c10, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_entry);
-  entry->AddInstruction(if_inst);
-
-  ScopedNullHandle<mirror::Class> null_klass_;
-  HInstruction* cls2 = MakeClassLoad();
-  HInstruction* check_cast = new (GetAllocator()) HCheckCast(
-      new_inst, cls2, TypeCheckKind::kExactCheck, null_klass_, 0, GetAllocator(), nullptr, nullptr);
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(cls2);
-  left->AddInstruction(check_cast);
-  left->AddInstruction(goto_left);
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c20, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* read_final = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  exit->AddInstruction(read_final);
-
-  ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  LoadStoreAnalysis lsa(graph_, nullptr, &allocator, LoadStoreAnalysisType::kFull);
-  lsa.Run();
-
-  const HeapLocationCollector& heap_location_collector = lsa.GetHeapLocationCollector();
-  ReferenceInfo* info = heap_location_collector.FindReferenceInfoOf(new_inst);
-  ASSERT_TRUE(info->IsPartialSingleton());
-  const ExecutionSubgraph* esg = info->GetNoEscapeSubgraph();
-
-  ASSERT_TRUE(esg->IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  ASSERT_TRUE(AreExclusionsIndependent(graph_, esg));
-  std::unordered_set<const HBasicBlock*> contents(esg->ReachableBlocks().begin(),
-                                                  esg->ReachableBlocks().end());
-
-  ASSERT_EQ(contents.size(), 3u);
-  ASSERT_TRUE(contents.find(blks.Get("left")) == contents.end());
-
-  ASSERT_TRUE(contents.find(blks.Get("right")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("entry")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("exit")) != contents.end());
-}
-
-// For simplicity Partial LSE considers instance-ofs with bitvectors to escape.
-// // ENTRY
-// obj = new Obj();
-// obj.field = 10;
-// if (parameter_value) {
-//   // LEFT
-//   obj instanceof /*bitvector*/ Foo;
-// } else {
-//   // RIGHT
-//   obj.field = 20;
-// }
-// // EXIT
-// obj.field;
-TEST_F(LoadStoreAnalysisTest, PartialEscape5) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList(
-      "entry",
-      "exit",
-      { { "entry", "left" }, { "entry", "right" }, { "left", "exit" }, { "right", "exit" } }));
-  HBasicBlock* entry = blks.Get("entry");
-  HBasicBlock* left = blks.Get("left");
-  HBasicBlock* right = blks.Get("right");
-  HBasicBlock* exit = blks.Get("exit");
-
-  HInstruction* bool_value = new (GetAllocator())
-      HParameterValue(graph_->GetDexFile(), dex::TypeIndex(1), 1, DataType::Type::kBool);
-  HInstruction* c10 = graph_->GetIntConstant(10);
-  HInstruction* c20 = graph_->GetIntConstant(20);
-  HIntConstant* bs1 = graph_->GetIntConstant(0xffff);
-  HIntConstant* bs2 = graph_->GetIntConstant(0x00ff);
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* null_const = graph_->GetNullConstant();
-  HInstruction* new_inst = MakeNewInstance(cls);
-
-  HInstruction* write_entry = MakeIFieldSet(new_inst, c10, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_entry);
-  entry->AddInstruction(if_inst);
-
-  ScopedNullHandle<mirror::Class> null_klass_;
-  HInstruction* instanceof = new (GetAllocator()) HInstanceOf(new_inst,
-                                                              null_const,
-                                                              TypeCheckKind::kBitstringCheck,
-                                                              null_klass_,
-                                                              0,
-                                                              GetAllocator(),
-                                                              bs1,
-                                                              bs2);
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(instanceof);
-  left->AddInstruction(goto_left);
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c20, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* read_final = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  exit->AddInstruction(read_final);
-
-  ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  LoadStoreAnalysis lsa(graph_, nullptr, &allocator, LoadStoreAnalysisType::kFull);
-  lsa.Run();
-
-  const HeapLocationCollector& heap_location_collector = lsa.GetHeapLocationCollector();
-  ReferenceInfo* info = heap_location_collector.FindReferenceInfoOf(new_inst);
-  ASSERT_TRUE(info->IsPartialSingleton());
-  const ExecutionSubgraph* esg = info->GetNoEscapeSubgraph();
-
-  ASSERT_TRUE(esg->IsValid());
-  ASSERT_TRUE(IsValidSubgraph(esg));
-  ASSERT_TRUE(AreExclusionsIndependent(graph_, esg));
-  std::unordered_set<const HBasicBlock*> contents(esg->ReachableBlocks().begin(),
-                                                  esg->ReachableBlocks().end());
-
-  ASSERT_EQ(contents.size(), 3u);
-  ASSERT_TRUE(contents.find(blks.Get("left")) == contents.end());
-
-  ASSERT_TRUE(contents.find(blks.Get("right")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("entry")) != contents.end());
-  ASSERT_TRUE(contents.find(blks.Get("exit")) != contents.end());
-}
-
-// before we had predicated-set we needed to be able to remove the store as
-// well. This test makes sure that still works.
-// // ENTRY
-// obj = new Obj();
-// if (parameter_value) {
-//   // LEFT
-//   call_func(obj);
-// } else {
-//   // RIGHT
-//   obj.f1 = 0;
-// }
-// // EXIT
-// // call_func prevents the elimination of this store.
-// obj.f2 = 0;
-TEST_F(LoadStoreAnalysisTest, TotalEscapeAdjacentNoPredicated) {
-  CreateGraph();
-  AdjacencyListGraph blks(SetupFromAdjacencyList(
-      "entry",
-      "exit",
-      {{"entry", "left"}, {"entry", "right"}, {"left", "exit"}, {"right", "exit"}}));
-  HBasicBlock* entry = blks.Get("entry");
-  HBasicBlock* left = blks.Get("left");
-  HBasicBlock* right = blks.Get("right");
-  HBasicBlock* exit = blks.Get("exit");
-
-  HInstruction* bool_value = new (GetAllocator())
-      HParameterValue(graph_->GetDexFile(), dex::TypeIndex(1), 1, DataType::Type::kBool);
-  HInstruction* c0 = graph_->GetIntConstant(0);
-  HInstruction* cls = new (GetAllocator()) HLoadClass(graph_->GetCurrentMethod(),
-                                                      dex::TypeIndex(10),
-                                                      graph_->GetDexFile(),
-                                                      ScopedNullHandle<mirror::Class>(),
-                                                      false,
-                                                      0,
-                                                      false);
-  HInstruction* new_inst =
-      new (GetAllocator()) HNewInstance(cls,
-                                        0,
-                                        dex::TypeIndex(10),
-                                        graph_->GetDexFile(),
-                                        false,
-                                        QuickEntrypointEnum::kQuickAllocObjectInitialized);
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(if_inst);
-
-  HInstruction* call_left = new (GetAllocator())
-      HInvokeStaticOrDirect(GetAllocator(),
-                            1,
-                            DataType::Type::kVoid,
-                            0,
-                            {nullptr, 0},
-                            nullptr,
-                            {},
-                            InvokeType::kStatic,
-                            {nullptr, 0},
-                            HInvokeStaticOrDirect::ClinitCheckRequirement::kNone,
-                            !graph_->IsDebuggable());
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  call_left->AsInvoke()->SetRawInputAt(0, new_inst);
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-
-  HInstruction* write_right = new (GetAllocator()) HInstanceFieldSet(new_inst,
-                                                                     c0,
-                                                                     nullptr,
-                                                                     DataType::Type::kInt32,
-                                                                     MemberOffset(32),
-                                                                     false,
-                                                                     0,
-                                                                     0,
-                                                                     graph_->GetDexFile(),
-                                                                     0);
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* write_final = new (GetAllocator()) HInstanceFieldSet(new_inst,
-                                                                     c0,
-                                                                     nullptr,
-                                                                     DataType::Type::kInt32,
-                                                                     MemberOffset(16),
-                                                                     false,
-                                                                     0,
-                                                                     0,
-                                                                     graph_->GetDexFile(),
-                                                                     0);
-  exit->AddInstruction(write_final);
-
-  ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  graph_->ClearDominanceInformation();
-  graph_->BuildDominatorTree();
-  LoadStoreAnalysis lsa(
-      graph_, nullptr, &allocator, LoadStoreAnalysisType::kNoPredicatedInstructions);
-  lsa.Run();
-
-  const HeapLocationCollector& heap_location_collector = lsa.GetHeapLocationCollector();
-  ReferenceInfo* info = heap_location_collector.FindReferenceInfoOf(new_inst);
-  ASSERT_FALSE(info->IsPartialSingleton());
-}
-
-// With predicated-set we can (partially) remove the store as well.
-// // ENTRY
-// obj = new Obj();
-// if (parameter_value) {
-//   // LEFT
-//   call_func(obj);
-// } else {
-//   // RIGHT
-//   obj.f1 = 0;
-// }
-// // EXIT
-// // call_func prevents the elimination of this store.
-// obj.f2 = 0;
-TEST_F(LoadStoreAnalysisTest, TotalEscapeAdjacent) {
-  CreateGraph();
-  AdjacencyListGraph blks(SetupFromAdjacencyList(
-      "entry",
-      "exit",
-      { { "entry", "left" }, { "entry", "right" }, { "left", "exit" }, { "right", "exit" } }));
-  HBasicBlock* entry = blks.Get("entry");
-  HBasicBlock* left = blks.Get("left");
-  HBasicBlock* right = blks.Get("right");
-  HBasicBlock* exit = blks.Get("exit");
-
-  HInstruction* bool_value = new (GetAllocator())
-      HParameterValue(graph_->GetDexFile(), dex::TypeIndex(1), 1, DataType::Type::kBool);
-  HInstruction* c0 = graph_->GetIntConstant(0);
-  HInstruction* cls = new (GetAllocator()) HLoadClass(graph_->GetCurrentMethod(),
-                                                      dex::TypeIndex(10),
-                                                      graph_->GetDexFile(),
-                                                      ScopedNullHandle<mirror::Class>(),
-                                                      false,
-                                                      0,
-                                                      false);
-  HInstruction* new_inst =
-      new (GetAllocator()) HNewInstance(cls,
-                                        0,
-                                        dex::TypeIndex(10),
-                                        graph_->GetDexFile(),
-                                        false,
-                                        QuickEntrypointEnum::kQuickAllocObjectInitialized);
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(if_inst);
-
-  HInstruction* call_left = new (GetAllocator())
-      HInvokeStaticOrDirect(GetAllocator(),
-                            1,
-                            DataType::Type::kVoid,
-                            0,
-                            { nullptr, 0 },
-                            nullptr,
-                            {},
-                            InvokeType::kStatic,
-                            { nullptr, 0 },
-                            HInvokeStaticOrDirect::ClinitCheckRequirement::kNone,
-                            !graph_->IsDebuggable());
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  call_left->AsInvoke()->SetRawInputAt(0, new_inst);
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-
-  HInstruction* write_right = new (GetAllocator()) HInstanceFieldSet(new_inst,
-                                                                     c0,
-                                                                     nullptr,
-                                                                     DataType::Type::kInt32,
-                                                                     MemberOffset(32),
-                                                                     false,
-                                                                     0,
-                                                                     0,
-                                                                     graph_->GetDexFile(),
-                                                                     0);
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* write_final = new (GetAllocator()) HInstanceFieldSet(new_inst,
-                                                                     c0,
-                                                                     nullptr,
-                                                                     DataType::Type::kInt32,
-                                                                     MemberOffset(16),
-                                                                     false,
-                                                                     0,
-                                                                     0,
-                                                                     graph_->GetDexFile(),
-                                                                     0);
-  exit->AddInstruction(write_final);
-
-  ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  graph_->ClearDominanceInformation();
-  graph_->BuildDominatorTree();
-  LoadStoreAnalysis lsa(graph_, nullptr, &allocator, LoadStoreAnalysisType::kFull);
-  lsa.Run();
-
-  const HeapLocationCollector& heap_location_collector = lsa.GetHeapLocationCollector();
-  ReferenceInfo* info = heap_location_collector.FindReferenceInfoOf(new_inst);
-  ASSERT_TRUE(info->IsPartialSingleton());
-  const ExecutionSubgraph* esg = info->GetNoEscapeSubgraph();
-
-  EXPECT_TRUE(esg->IsValid()) << esg->GetExcludedCohorts();
-  EXPECT_TRUE(IsValidSubgraph(esg));
-  std::unordered_set<const HBasicBlock*> contents(esg->ReachableBlocks().begin(),
-                                                  esg->ReachableBlocks().end());
-
-  EXPECT_EQ(contents.size(), 3u);
-  EXPECT_TRUE(contents.find(blks.Get("left")) == contents.end());
-  EXPECT_FALSE(contents.find(blks.Get("right")) == contents.end());
-  EXPECT_FALSE(contents.find(blks.Get("entry")) == contents.end());
-  EXPECT_FALSE(contents.find(blks.Get("exit")) == contents.end());
-}
-
 // // ENTRY
 // obj = new Obj();
 // if (parameter_value) {
@@ -1626,7 +767,7 @@
                             HInvokeStaticOrDirect::ClinitCheckRequirement::kNone,
                             !graph_->IsDebuggable());
   HInstruction* goto_left = new (GetAllocator()) HGoto();
-  call_left->AsInvoke()->SetRawInputAt(0, new_inst);
+  call_left->SetRawInputAt(0, new_inst);
   left->AddInstruction(call_left);
   left->AddInstruction(goto_left);
 
@@ -1653,7 +794,7 @@
                                                                      graph_->GetDexFile(),
                                                                      0);
   HInstruction* goto_right = new (GetAllocator()) HGoto();
-  call_right->AsInvoke()->SetRawInputAt(0, new_inst);
+  call_right->SetRawInputAt(0, new_inst);
   right->AddInstruction(write_right);
   right->AddInstruction(call_right);
   right->AddInstruction(goto_right);
@@ -1670,12 +811,12 @@
   exit->AddInstruction(read_final);
 
   ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  LoadStoreAnalysis lsa(graph_, nullptr, &allocator, LoadStoreAnalysisType::kFull);
+  LoadStoreAnalysis lsa(graph_, nullptr, &allocator);
   lsa.Run();
 
   const HeapLocationCollector& heap_location_collector = lsa.GetHeapLocationCollector();
   ReferenceInfo* info = heap_location_collector.FindReferenceInfoOf(new_inst);
-  ASSERT_FALSE(info->IsPartialSingleton());
+  ASSERT_FALSE(info->IsSingleton());
 }
 
 // // ENTRY
@@ -1725,12 +866,12 @@
   exit->AddInstruction(return_final);
 
   ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  LoadStoreAnalysis lsa(graph_, nullptr, &allocator, LoadStoreAnalysisType::kFull);
+  LoadStoreAnalysis lsa(graph_, nullptr, &allocator);
   lsa.Run();
 
   const HeapLocationCollector& heap_location_collector = lsa.GetHeapLocationCollector();
   ReferenceInfo* info = heap_location_collector.FindReferenceInfoOf(new_inst);
-  ASSERT_FALSE(info->IsPartialSingleton());
+  ASSERT_TRUE(info->IsSingletonAndNonRemovable());
 }
 
 // // ENTRY
@@ -1813,7 +954,7 @@
                             HInvokeStaticOrDirect::ClinitCheckRequirement::kNone,
                             !graph_->IsDebuggable());
   HInstruction* goto_left = new (GetAllocator()) HGoto();
-  call_left->AsInvoke()->SetRawInputAt(0, new_inst);
+  call_left->SetRawInputAt(0, new_inst);
   high_left->AddInstruction(call_left);
   high_left->AddInstruction(goto_left);
 
@@ -1870,7 +1011,7 @@
                             HInvokeStaticOrDirect::ClinitCheckRequirement::kNone,
                             !graph_->IsDebuggable());
   HInstruction* goto_low_left = new (GetAllocator()) HGoto();
-  call_low_left->AsInvoke()->SetRawInputAt(0, new_inst);
+  call_low_left->SetRawInputAt(0, new_inst);
   low_left->AddInstruction(call_low_left);
   low_left->AddInstruction(goto_low_left);
 
@@ -1900,12 +1041,12 @@
   exit->AddInstruction(read_final);
 
   ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  LoadStoreAnalysis lsa(graph_, nullptr, &allocator, LoadStoreAnalysisType::kFull);
+  LoadStoreAnalysis lsa(graph_, nullptr, &allocator);
   lsa.Run();
 
   const HeapLocationCollector& heap_location_collector = lsa.GetHeapLocationCollector();
   ReferenceInfo* info = heap_location_collector.FindReferenceInfoOf(new_inst);
-  ASSERT_FALSE(info->IsPartialSingleton());
+  ASSERT_FALSE(info->IsSingleton());
 }
 
 // // ENTRY
@@ -2030,7 +1171,7 @@
   HInstruction* goto_left_merge = new (GetAllocator()) HGoto();
   left_phi->SetRawInputAt(0, obj_param);
   left_phi->SetRawInputAt(1, new_inst);
-  call_left->AsInvoke()->SetRawInputAt(0, left_phi);
+  call_left->SetRawInputAt(0, left_phi);
   left_merge->AddPhi(left_phi);
   left_merge->AddInstruction(call_left);
   left_merge->AddInstruction(goto_left_merge);
@@ -2065,11 +1206,11 @@
   graph_->BuildDominatorTree();
 
   ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  LoadStoreAnalysis lsa(graph_, nullptr, &allocator, LoadStoreAnalysisType::kFull);
+  LoadStoreAnalysis lsa(graph_, nullptr, &allocator);
   lsa.Run();
 
   const HeapLocationCollector& heap_location_collector = lsa.GetHeapLocationCollector();
   ReferenceInfo* info = heap_location_collector.FindReferenceInfoOf(new_inst);
-  ASSERT_FALSE(info->IsPartialSingleton());
+  ASSERT_FALSE(info->IsSingleton());
 }
 }  // namespace art
diff --git a/compiler/optimizing/load_store_elimination.cc b/compiler/optimizing/load_store_elimination.cc
index 9cabb12..80cf9e6 100644
--- a/compiler/optimizing/load_store_elimination.cc
+++ b/compiler/optimizing/load_store_elimination.cc
@@ -33,17 +33,15 @@
 #include "base/scoped_arena_containers.h"
 #include "base/transform_iterator.h"
 #include "escape.h"
-#include "execution_subgraph.h"
 #include "handle.h"
 #include "load_store_analysis.h"
 #include "mirror/class_loader.h"
 #include "mirror/dex_cache.h"
 #include "nodes.h"
-#include "optimizing/execution_subgraph.h"
+#include "oat/stack_map.h"
 #include "optimizing_compiler_stats.h"
 #include "reference_type_propagation.h"
 #include "side_effects_analysis.h"
-#include "stack_map.h"
 
 /**
  * The general algorithm of load-store elimination (LSE).
@@ -94,9 +92,7 @@
  *    to maintain the validity of all heap locations during the optimization
  *    phase, we only record substitutes at this phase and the real elimination
  *    is delayed till the end of LSE. Loads that require a loop Phi placeholder
- *    replacement are recorded for processing later. We also keep track of the
- *    heap-value at the start load so that later partial-LSE can predicate the
- *    load.
+ *    replacement are recorded for processing later.
  *  - If the instruction is a store, it updates the heap value for the heap
  *    location with the stored value and records the store itself so that we can
  *    mark it for keeping if the value becomes observable. Heap values are
@@ -240,79 +236,6 @@
  * The time complexity of this phase is
  *    O(instructions + instruction_uses) .
  *
- * 5. Partial LSE
- *
- * Move allocations closer to their escapes and remove/predicate loads and
- * stores as required.
- *
- * Partial singletons are objects which only escape from the function or have
- * multiple names along certain execution paths. In cases where we recognize
- * these partial singletons we can move the allocation and initialization
- * closer to the actual escape(s). We can then perform a simplified version of
- * LSE step 2 to determine the unescaped value of any reads performed after the
- * object may have escaped. These are used to replace these reads with
- * 'predicated-read' instructions where the value is only read if the object
- * has actually escaped. We use the existence of the object itself as the
- * marker of whether escape has occurred.
- *
- * There are several steps in this sub-pass
- *
- * 5.1 Group references
- *
- * Since all heap-locations for a single reference escape at the same time, we
- * need to group the heap-locations by reference and process them at the same
- * time.
- *
- *    O(heap_locations).
- *
- * FIXME: The time complexity above assumes we can bucket the heap-locations in
- * O(1) which is not true since we just perform a linear-scan of the heap-ref
- * list. Since there are generally only a small number of heap-references which
- * are partial-singletons this is fine and lower real overhead than a hash map.
- *
- * 5.2 Generate materializations
- *
- * Once we have the references we add new 'materialization blocks' on the edges
- * where escape becomes inevitable. This information is calculated by the
- * execution-subgraphs created during load-store-analysis. We create new
- * 'materialization's in these blocks and initialize them with the value of
- * each heap-location ignoring side effects (since the object hasn't escaped
- * yet). Worst case this is the same time-complexity as step 3 since we may
- * need to materialize phis.
- *
- *    O(heap_locations^2 * materialization_edges)
- *
- * 5.3 Propagate materializations
- *
- * Since we use the materialization as the marker for escape we need to
- * propagate it throughout the graph. Since the subgraph analysis considers any
- * lifetime that escapes a loop (and hence would require a loop-phi) to be
- * escaping at the loop-header we do not need to create any loop-phis to do
- * this.
- *
- *    O(edges)
- *
- * NB: Currently the subgraph analysis considers all objects to have their
- * lifetimes start at the entry block. This simplifies that analysis enormously
- * but means that we cannot distinguish between an escape in a loop where the
- * lifetime does not escape the loop (in which case this pass could optimize)
- * and one where it does escape the loop (in which case the whole loop is
- * escaping). This is a shortcoming that would be good to fix at some point.
- *
- * 5.4 Propagate partial values
- *
- * We need to replace loads and stores to the partial reference with predicated
- * ones that have default non-escaping values. Again this is the same as step 3.
- *
- *   O(heap_locations^2 * edges)
- *
- * 5.5 Final fixup
- *
- * Now all we need to do is replace and remove uses of the old reference with the
- * appropriate materialization.
- *
- *   O(instructions + uses)
- *
  * FIXME: The time complexities described above assumes that the
  * HeapLocationCollector finds a heap location for an instruction in O(1)
  * time but it is currently O(heap_locations); this can be fixed by adding
@@ -324,7 +247,6 @@
 #define LSE_VLOG \
   if (::art::LoadStoreElimination::kVerboseLoggingMode && VLOG_IS_ON(compiler)) LOG(INFO)
 
-class PartialLoadStoreEliminationHelper;
 class HeapRefHolder;
 
 // Use HGraphDelegateVisitor for which all VisitInvokeXXX() delegate to VisitInvoke().
@@ -332,7 +254,6 @@
  public:
   LSEVisitor(HGraph* graph,
              const HeapLocationCollector& heap_location_collector,
-             bool perform_partial_lse,
              OptimizingCompilerStats* stats);
 
   void Run();
@@ -615,27 +536,7 @@
     return PhiPlaceholderIndex(phi_placeholder.GetPhiPlaceholder());
   }
 
-  bool IsEscapingObject(ReferenceInfo* info, HBasicBlock* block, size_t index) {
-    return !info->IsSingletonAndRemovable() &&
-           !(info->IsPartialSingleton() && IsPartialNoEscape(block, index));
-  }
-
-  bool IsPartialNoEscape(HBasicBlock* blk, size_t idx) {
-    auto* ri = heap_location_collector_.GetHeapLocation(idx)->GetReferenceInfo();
-    if (!ri->IsPartialSingleton()) {
-      return false;
-    }
-    ArrayRef<const ExecutionSubgraph::ExcludedCohort> cohorts =
-        ri->GetNoEscapeSubgraph()->GetExcludedCohorts();
-    return std::none_of(cohorts.cbegin(),
-                        cohorts.cend(),
-                        [&](const ExecutionSubgraph::ExcludedCohort& ex) -> bool {
-                          // Make sure we haven't yet and never will escape.
-                          return ex.PrecedesBlock(blk) ||
-                                 ex.ContainsBlock(blk) ||
-                                 ex.SucceedsBlock(blk);
-                        });
-  }
+  bool IsEscapingObject(ReferenceInfo* info) { return !info->IsSingletonAndRemovable(); }
 
   PhiPlaceholder GetPhiPlaceholderAt(size_t off) const {
     DCHECK_LT(off, num_phi_placeholders_);
@@ -652,9 +553,7 @@
   }
 
   Value Replacement(Value value) const {
-    DCHECK(value.NeedsPhi() ||
-           (current_phase_ == Phase::kPartialElimination && value.IsMergedUnknown()))
-        << value << " phase: " << current_phase_;
+    DCHECK(value.NeedsPhi()) << value << " phase: " << current_phase_;
     Value replacement = phi_placeholder_replacements_[PhiPlaceholderIndex(value)];
     DCHECK(replacement.IsUnknown() || replacement.IsInstruction());
     DCHECK(replacement.IsUnknown() ||
@@ -663,35 +562,6 @@
   }
 
   Value ReplacementOrValue(Value value) const {
-    if (current_phase_ == Phase::kPartialElimination) {
-      // In this phase we are materializing the default values which are used
-      // only if the partial singleton did not escape, so we can replace
-      // a partial unknown with the prior value.
-      if (value.IsPartialUnknown()) {
-        value = value.GetPriorValue().ToValue();
-      }
-      if ((value.IsMergedUnknown() || value.NeedsPhi()) &&
-          phi_placeholder_replacements_[PhiPlaceholderIndex(value)].IsValid()) {
-        value = phi_placeholder_replacements_[PhiPlaceholderIndex(value)];
-        DCHECK(!value.IsMergedUnknown());
-        DCHECK(!value.NeedsPhi());
-      } else if (value.IsMergedUnknown()) {
-        return Value::ForLoopPhiPlaceholder(value.GetPhiPlaceholder());
-      }
-      if (value.IsInstruction() && value.GetInstruction()->IsInstanceFieldGet()) {
-        DCHECK_LT(static_cast<size_t>(value.GetInstruction()->GetId()),
-                  substitute_instructions_for_loads_.size());
-        HInstruction* substitute =
-            substitute_instructions_for_loads_[value.GetInstruction()->GetId()];
-        if (substitute != nullptr) {
-          DCHECK(substitute->IsPredicatedInstanceFieldGet());
-          return Value::ForInstruction(substitute);
-        }
-      }
-      DCHECK_IMPLIES(value.IsInstruction(),
-                     FindSubstitute(value.GetInstruction()) == value.GetInstruction());
-      return value;
-    }
     if (value.NeedsPhi() && phi_placeholder_replacements_[PhiPlaceholderIndex(value)].IsValid()) {
       return Replacement(value);
     } else {
@@ -752,8 +622,8 @@
   HInstruction* FindSubstitute(HInstruction* instruction) const {
     size_t id = static_cast<size_t>(instruction->GetId());
     if (id >= substitute_instructions_for_loads_.size()) {
-      // New Phi (may not be in the graph yet), default value or PredicatedInstanceFieldGet.
-      DCHECK_IMPLIES(IsLoad(instruction), instruction->IsPredicatedInstanceFieldGet());
+      // New Phi (may not be in the graph yet), or default value.
+      DCHECK(!IsLoad(instruction));
       return instruction;
     }
     HInstruction* substitute = substitute_instructions_for_loads_[id];
@@ -789,7 +659,6 @@
   static bool IsLoad(HInstruction* instruction) {
     // Unresolved load is not treated as a load.
     return instruction->IsInstanceFieldGet() ||
-           instruction->IsPredicatedInstanceFieldGet() ||
            instruction->IsStaticFieldGet() ||
            instruction->IsVecLoad() ||
            instruction->IsArrayGet();
@@ -818,12 +687,7 @@
     if (value.IsPureUnknown() || value.IsPartialUnknown()) {
       return;
     }
-    if (value.IsMergedUnknown()) {
-      kept_merged_unknowns_.SetBit(PhiPlaceholderIndex(value));
-      phi_placeholders_to_search_for_kept_stores_.SetBit(PhiPlaceholderIndex(value));
-      return;
-    }
-    if (value.NeedsPhi()) {
+    if (value.IsMergedUnknown() || value.NeedsPhi()) {
       phi_placeholders_to_search_for_kept_stores_.SetBit(PhiPlaceholderIndex(value));
     } else {
       HInstruction* instruction = value.GetInstruction();
@@ -843,9 +707,7 @@
         // We use this function when reading a location with unknown value and
         // therefore we cannot know what exact store wrote that unknown value.
         // But we can have a phi placeholder here marking multiple stores to keep.
-        DCHECK(
-            !heap_values[i].stored_by.IsInstruction() ||
-            heap_location_collector_.GetHeapLocation(i)->GetReferenceInfo()->IsPartialSingleton());
+        DCHECK(!heap_values[i].stored_by.IsInstruction());
         KeepStores(heap_values[i].stored_by);
         heap_values[i].stored_by = Value::PureUnknown();
       } else if (heap_location_collector_.MayAlias(i, loc_index)) {
@@ -925,7 +787,6 @@
   enum class Phase {
     kLoadElimination,
     kStoreElimination,
-    kPartialElimination,
   };
 
   bool MayAliasOnBackEdge(HBasicBlock* loop_header, size_t idx1, size_t idx2) const;
@@ -958,21 +819,6 @@
   void FindOldValueForPhiPlaceholder(PhiPlaceholder phi_placeholder, DataType::Type type);
   void FindStoresWritingOldValues();
   void FinishFullLSE();
-  void PrepareForPartialPhiComputation();
-  // Create materialization block and materialization object for the given predecessor of entry.
-  HInstruction* SetupPartialMaterialization(PartialLoadStoreEliminationHelper& helper,
-                                            HeapRefHolder&& holder,
-                                            size_t pred_idx,
-                                            HBasicBlock* blk);
-  // Returns the value that would be read by the 'read' instruction on
-  // 'orig_new_inst' if 'orig_new_inst' has not escaped.
-  HInstruction* GetPartialValueAt(HNewInstance* orig_new_inst, HInstruction* read);
-  void MovePartialEscapes();
-
-  void VisitPredicatedInstanceFieldGet(HPredicatedInstanceFieldGet* instruction) override {
-    LOG(FATAL) << "Visited instruction " << instruction->DumpWithoutArgs()
-               << " but LSE should be the only source of predicated-ifield-gets!";
-  }
 
   void HandleAcquireLoad(HInstruction* instruction) {
     DCHECK((instruction->IsInstanceFieldGet() && instruction->AsInstanceFieldGet()->IsVolatile()) ||
@@ -1015,23 +861,33 @@
   }
 
   void VisitInstanceFieldGet(HInstanceFieldGet* instruction) override {
+    HInstruction* object = instruction->InputAt(0);
     if (instruction->IsVolatile()) {
-      HandleAcquireLoad(instruction);
-      return;
+      ReferenceInfo* ref_info = heap_location_collector_.FindReferenceInfoOf(
+          heap_location_collector_.HuntForOriginalReference(object));
+      if (!ref_info->IsSingletonAndRemovable()) {
+        HandleAcquireLoad(instruction);
+        return;
+      }
+      // Treat it as a normal load if it is a removable singleton.
     }
 
-    HInstruction* object = instruction->InputAt(0);
     const FieldInfo& field = instruction->GetFieldInfo();
     VisitGetLocation(instruction, heap_location_collector_.GetFieldHeapLocation(object, &field));
   }
 
   void VisitInstanceFieldSet(HInstanceFieldSet* instruction) override {
+    HInstruction* object = instruction->InputAt(0);
     if (instruction->IsVolatile()) {
-      HandleReleaseStore(instruction);
-      return;
+      ReferenceInfo* ref_info = heap_location_collector_.FindReferenceInfoOf(
+          heap_location_collector_.HuntForOriginalReference(object));
+      if (!ref_info->IsSingletonAndRemovable()) {
+        HandleReleaseStore(instruction);
+        return;
+      }
+      // Treat it as a normal store if it is a removable singleton.
     }
 
-    HInstruction* object = instruction->InputAt(0);
     const FieldInfo& field = instruction->GetFieldInfo();
     HInstruction* value = instruction->InputAt(1);
     size_t idx = heap_location_collector_.GetFieldHeapLocation(object, &field);
@@ -1044,8 +900,8 @@
       return;
     }
 
-    HInstruction* cls = instruction->InputAt(0);
     const FieldInfo& field = instruction->GetFieldInfo();
+    HInstruction* cls = instruction->InputAt(0);
     VisitGetLocation(instruction, heap_location_collector_.GetFieldHeapLocation(cls, &field));
   }
 
@@ -1055,14 +911,30 @@
       return;
     }
 
-    HInstruction* cls = instruction->InputAt(0);
     const FieldInfo& field = instruction->GetFieldInfo();
+    HInstruction* cls = instruction->InputAt(0);
     HInstruction* value = instruction->InputAt(1);
     size_t idx = heap_location_collector_.GetFieldHeapLocation(cls, &field);
     VisitSetLocation(instruction, idx, value);
   }
 
   void VisitMonitorOperation(HMonitorOperation* monitor_op) override {
+    HInstruction* object = monitor_op->InputAt(0);
+    ReferenceInfo* ref_info = heap_location_collector_.FindReferenceInfoOf(
+        heap_location_collector_.HuntForOriginalReference(object));
+    if (ref_info->IsSingletonAndRemovable()) {
+      // If the object is a removable singleton, we know that no other threads will have
+      // access to it, and we can remove the MonitorOperation instruction.
+      // MONITOR_ENTER throws when encountering a null object. If `object` is a removable
+      // singleton, it is guaranteed to be non-null so we don't have to worry about the NullCheck.
+      DCHECK(!object->CanBeNull());
+      monitor_op->GetBlock()->RemoveInstruction(monitor_op);
+      MaybeRecordStat(stats_, MethodCompilationStat::kRemovedMonitorOp);
+      return;
+    }
+
+    // We detected a monitor operation that we couldn't remove. See also LSEVisitor::Run().
+    monitor_op->GetBlock()->GetGraph()->SetHasMonitorOperations(true);
     if (monitor_op->IsEnter()) {
       HandleAcquireLoad(monitor_op);
     } else {
@@ -1080,10 +952,12 @@
   }
 
   void VisitVecLoad(HVecLoad* instruction) override {
+    DCHECK(!instruction->IsPredicated());
     VisitGetLocation(instruction, heap_location_collector_.GetArrayHeapLocation(instruction));
   }
 
   void VisitVecStore(HVecStore* instruction) override {
+    DCHECK(!instruction->IsPredicated());
     size_t idx = heap_location_collector_.GetArrayHeapLocation(instruction);
     VisitSetLocation(instruction, idx, instruction->GetValue());
   }
@@ -1107,7 +981,7 @@
         // Finalizable objects always escape.
         const bool finalizable_object =
             reference->IsNewInstance() && reference->AsNewInstance()->IsFinalizable();
-        if (!finalizable_object && !IsEscapingObject(info, block, i)) {
+        if (!finalizable_object && !IsEscapingObject(info)) {
           // Check whether the reference for a store is used by an environment local of
           // the HDeoptimize. If not, the singleton is not observed after deoptimization.
           const HUseList<HEnvironment*>& env_uses = reference->GetEnvUses();
@@ -1131,7 +1005,7 @@
     ScopedArenaVector<ValueRecord>& heap_values = heap_values_for_[block->GetBlockId()];
     for (size_t i = 0u, size = heap_values.size(); i != size; ++i) {
       ReferenceInfo* ref_info = heap_location_collector_.GetHeapLocation(i)->GetReferenceInfo();
-      if (must_keep_stores || IsEscapingObject(ref_info, block, i)) {
+      if (must_keep_stores || IsEscapingObject(ref_info)) {
         KeepStores(heap_values[i].stored_by);
         heap_values[i].stored_by = Value::PureUnknown();
       }
@@ -1214,30 +1088,9 @@
         heap_values_for_[instruction->GetBlock()->GetBlockId()];
     for (size_t i = 0u, size = heap_values.size(); i != size; ++i) {
       ReferenceInfo* ref_info = heap_location_collector_.GetHeapLocation(i)->GetReferenceInfo();
-      HBasicBlock* blk = instruction->GetBlock();
       // We don't need to do anything if the reference has not escaped at this point.
-      // This is true if either we (1) never escape or (2) sometimes escape but
-      // there is no possible execution where we have done so at this time. NB
-      // We count being in the excluded cohort as escaping. Technically, this is
-      // a bit over-conservative (since we can have multiple non-escaping calls
-      // before a single escaping one) but this simplifies everything greatly.
-      auto partial_singleton_did_not_escape = [](ReferenceInfo* ref_info, HBasicBlock* blk) {
-        DCHECK(ref_info->IsPartialSingleton());
-        if (!ref_info->GetNoEscapeSubgraph()->ContainsBlock(blk)) {
-          return false;
-        }
-        ArrayRef<const ExecutionSubgraph::ExcludedCohort> cohorts =
-            ref_info->GetNoEscapeSubgraph()->GetExcludedCohorts();
-        return std::none_of(cohorts.begin(),
-                            cohorts.end(),
-                            [&](const ExecutionSubgraph::ExcludedCohort& cohort) {
-                              return cohort.PrecedesBlock(blk);
-                            });
-      };
-      if (!can_throw_inside_a_try &&
-          (ref_info->IsSingleton() ||
-           // partial and we aren't currently escaping and we haven't escaped yet.
-           (ref_info->IsPartialSingleton() && partial_singleton_did_not_escape(ref_info, blk)))) {
+      // This is true if we never escape.
+      if (!can_throw_inside_a_try && ref_info->IsSingleton()) {
         // Singleton references cannot be seen by the callee.
       } else {
         if (can_throw || side_effects.DoesAnyRead() || side_effects.DoesAnyWrite()) {
@@ -1313,7 +1166,7 @@
           heap_values[i].value = Value::ForInstruction(new_instance->GetLoadClass());
           heap_values[i].stored_by = Value::PureUnknown();
         }
-      } else if (inside_a_try || IsEscapingObject(info, block, i)) {
+      } else if (inside_a_try || IsEscapingObject(info)) {
         // Since NewInstance can throw, we presume all previous stores could be visible.
         KeepStores(heap_values[i].stored_by);
         heap_values[i].stored_by = Value::PureUnknown();
@@ -1348,7 +1201,7 @@
         // Array elements are set to default heap values.
         heap_values[i].value = Value::Default();
         heap_values[i].stored_by = Value::PureUnknown();
-      } else if (inside_a_try || IsEscapingObject(info, block, i)) {
+      } else if (inside_a_try || IsEscapingObject(info)) {
         // Since NewArray can throw, we presume all previous stores could be visible.
         KeepStores(heap_values[i].stored_by);
         heap_values[i].stored_by = Value::PureUnknown();
@@ -1361,12 +1214,6 @@
     DCHECK(!instruction->CanThrow());
   }
 
-  bool ShouldPerformPartialLSE() const {
-    return perform_partial_lse_ && !GetGraph()->IsCompilingOsr();
-  }
-
-  bool perform_partial_lse_;
-
   const HeapLocationCollector& heap_location_collector_;
 
   // Use local allocator for allocating memory.
@@ -1392,12 +1239,6 @@
   // in the end. These are indexed by the load's id.
   ScopedArenaVector<HInstruction*> substitute_instructions_for_loads_;
 
-  // Value at the start of the given instruction for instructions which directly
-  // read from a heap-location (i.e. FieldGet). The mapping to heap-location is
-  // implicit through the fact that each instruction can only directly refer to
-  // a single heap-location.
-  ScopedArenaHashMap<HInstruction*, Value> intermediate_values_;
-
   // Record stores to keep in a bit vector indexed by instruction ID.
   ArenaBitVector kept_stores_;
   // When we need to keep all stores that feed a Phi placeholder, we just record the
@@ -1407,26 +1248,23 @@
   // Loads that would require a loop Phi to replace are recorded for processing
   // later as we do not have enough information from back-edges to determine if
   // a suitable Phi can be found or created when we visit these loads.
-  ScopedArenaHashMap<HInstruction*, ValueRecord> loads_requiring_loop_phi_;
+  // This is a flat "map" indexed by the load instruction id.
+  ScopedArenaVector<ValueRecord*> loads_requiring_loop_phi_;
 
   // For stores, record the old value records that were replaced and the stored values.
   struct StoreRecord {
+    StoreRecord(ValueRecord old_value_record_in, HInstruction* stored_value_in)
+        : old_value_record(old_value_record_in), stored_value(stored_value_in) {}
     ValueRecord old_value_record;
     HInstruction* stored_value;
   };
-  // Small pre-allocated initial buffer avoids initializing a large one until it's really needed.
-  static constexpr size_t kStoreRecordsInitialBufferSize = 16;
-  std::pair<HInstruction*, StoreRecord> store_records_buffer_[kStoreRecordsInitialBufferSize];
-  ScopedArenaHashMap<HInstruction*, StoreRecord> store_records_;
+  // This is a flat "map" indexed by the store instruction id.
+  ScopedArenaVector<StoreRecord*> store_records_;
 
   // Replacements for Phi placeholders.
   // The invalid heap value is used to mark Phi placeholders that cannot be replaced.
   ScopedArenaVector<Value> phi_placeholder_replacements_;
 
-  // Merged-unknowns that must have their predecessor values kept to ensure
-  // partially escaped values are written
-  ArenaBitVector kept_merged_unknowns_;
-
   ScopedArenaVector<HInstruction*> singleton_new_instances_;
 
   // The field infos for each heap location (if relevant).
@@ -1434,7 +1272,6 @@
 
   Phase current_phase_;
 
-  friend class PartialLoadStoreEliminationHelper;
   friend struct ScopedRestoreHeapValues;
 
   friend std::ostream& operator<<(std::ostream& os, const Value& v);
@@ -1455,8 +1292,6 @@
       return oss << "kLoadElimination";
     case LSEVisitor::Phase::kStoreElimination:
       return oss << "kStoreElimination";
-    case LSEVisitor::Phase::kPartialElimination:
-      return oss << "kPartialElimination";
   }
 }
 
@@ -1580,10 +1415,8 @@
 
 LSEVisitor::LSEVisitor(HGraph* graph,
                        const HeapLocationCollector& heap_location_collector,
-                       bool perform_partial_lse,
                        OptimizingCompilerStats* stats)
     : HGraphDelegateVisitor(graph, stats),
-      perform_partial_lse_(perform_partial_lse),
       heap_location_collector_(heap_location_collector),
       allocator_(graph->GetArenaStack()),
       num_phi_placeholders_(GetGraph()->GetBlocks().size() *
@@ -1597,7 +1430,6 @@
       substitute_instructions_for_loads_(graph->GetCurrentInstructionId(),
                                          nullptr,
                                          allocator_.Adapter(kArenaAllocLSE)),
-      intermediate_values_(allocator_.Adapter(kArenaAllocLSE)),
       kept_stores_(&allocator_,
                    /*start_bits=*/graph->GetCurrentInstructionId(),
                    /*expandable=*/false,
@@ -1607,16 +1439,10 @@
                                                   /*expandable=*/false,
                                                   kArenaAllocLSE),
       loads_requiring_loop_phi_(allocator_.Adapter(kArenaAllocLSE)),
-      store_records_(store_records_buffer_,
-                     kStoreRecordsInitialBufferSize,
-                     allocator_.Adapter(kArenaAllocLSE)),
+      store_records_(allocator_.Adapter(kArenaAllocLSE)),
       phi_placeholder_replacements_(num_phi_placeholders_,
                                     Value::Invalid(),
                                     allocator_.Adapter(kArenaAllocLSE)),
-      kept_merged_unknowns_(&allocator_,
-                            /*start_bits=*/num_phi_placeholders_,
-                            /*expandable=*/false,
-                            kArenaAllocLSE),
       singleton_new_instances_(allocator_.Adapter(kArenaAllocLSE)),
       field_infos_(heap_location_collector_.GetNumberOfHeapLocations(),
                    allocator_.Adapter(kArenaAllocLSE)),
@@ -1856,8 +1682,7 @@
       Value pred_value = ReplacementOrValue(heap_values_for_[predecessor->GetBlockId()][idx].value);
       DCHECK(!pred_value.IsPureUnknown()) << pred_value << " block " << current_block->GetBlockId()
                                           << " pred: " << predecessor->GetBlockId();
-      if (pred_value.NeedsNonLoopPhi() ||
-          (current_phase_ == Phase::kPartialElimination && pred_value.IsMergedUnknown())) {
+      if (pred_value.NeedsNonLoopPhi()) {
         // We need to process the Phi placeholder first.
         work_queue.push_back(pred_value.GetPhiPlaceholder());
       } else if (pred_value.IsDefault()) {
@@ -1888,13 +1713,6 @@
     RecordFieldInfo(&instruction->GetFieldInfo(), idx);
   }
   DCHECK(record.value.IsUnknown() || record.value.Equals(ReplacementOrValue(record.value)));
-  // If we are unknown, we either come from somewhere untracked or we can reconstruct the partial
-  // value.
-  DCHECK(!record.value.IsPureUnknown() ||
-         heap_location_collector_.GetHeapLocation(idx)->GetReferenceInfo() == nullptr ||
-         !heap_location_collector_.GetHeapLocation(idx)->GetReferenceInfo()->IsPartialSingleton())
-         << "In " << GetGraph()->PrettyMethod() << ": " << record.value << " for " << *instruction;
-  intermediate_values_.insert({instruction, record.value});
   loads_and_stores_.push_back({ instruction, idx });
   if ((record.value.IsDefault() || record.value.NeedsNonLoopPhi()) &&
       !IsDefaultOrPhiAllowedForLoad(instruction)) {
@@ -1914,7 +1732,12 @@
     KeepStores(old_value);
   } else if (record.value.NeedsLoopPhi()) {
     // We do not know yet if the value is known for all back edges. Record for future processing.
-    loads_requiring_loop_phi_.insert(std::make_pair(instruction, record));
+    if (loads_requiring_loop_phi_.empty()) {
+      loads_requiring_loop_phi_.resize(GetGraph()->GetCurrentInstructionId(), nullptr);
+    }
+    DCHECK_EQ(loads_requiring_loop_phi_[instruction->GetId()], nullptr);
+    loads_requiring_loop_phi_[instruction->GetId()] =
+        new (allocator_.Alloc<ValueRecord>(kArenaAllocLSE)) ValueRecord(record);
   } else {
     // This load can be eliminated but we may need to construct non-loop Phis.
     if (record.value.NeedsNonLoopPhi()) {
@@ -1947,7 +1770,12 @@
     return;
   }
 
-  store_records_.insert(std::make_pair(instruction, StoreRecord{record, value}));
+  if (store_records_.empty()) {
+    store_records_.resize(GetGraph()->GetCurrentInstructionId(), nullptr);
+  }
+  DCHECK_EQ(store_records_[instruction->GetId()], nullptr);
+  store_records_[instruction->GetId()] =
+      new (allocator_.Alloc<StoreRecord>(kArenaAllocLSE)) StoreRecord(record, value);
   loads_and_stores_.push_back({ instruction, idx });
 
   // If the `record.stored_by` specified a store from this block, it shall be removed
@@ -1967,10 +1795,14 @@
   }
 
   // Update the record.
-  auto it = loads_requiring_loop_phi_.find(value);
-  if (it != loads_requiring_loop_phi_.end()) {
+  // Note that the `value` can be a newly created `Phi` with an id that falls outside
+  // the allocated `loads_requiring_loop_phi_` range.
+  DCHECK_IMPLIES(IsLoad(value) && !loads_requiring_loop_phi_.empty(),
+                 static_cast<size_t>(value->GetId()) < loads_requiring_loop_phi_.size());
+  if (static_cast<size_t>(value->GetId()) < loads_requiring_loop_phi_.size() &&
+      loads_requiring_loop_phi_[value->GetId()] != nullptr) {
     // Propapate the Phi placeholder to the record.
-    record.value = it->second.value;
+    record.value = loads_requiring_loop_phi_[value->GetId()]->value;
     DCHECK(record.value.NeedsLoopPhi());
   } else {
     record.value = Value::ForInstruction(value);
@@ -2002,8 +1834,8 @@
   } else {
     MergePredecessorRecords(block);
   }
-  // Visit instructions.
-  HGraphVisitor::VisitBasicBlock(block);
+  // Visit non-Phi instructions.
+  VisitNonPhiInstructions(block);
 }
 
 bool LSEVisitor::MayAliasOnBackEdge(HBasicBlock* loop_header, size_t idx1, size_t idx2) const {
@@ -2302,9 +2134,7 @@
     for (HBasicBlock* predecessor : block->GetPredecessors()) {
       Value value = ReplacementOrValue(heap_values_for_[predecessor->GetBlockId()][idx].value);
       if (value.NeedsNonLoopPhi()) {
-        DCHECK(current_phase_ == Phase::kLoadElimination ||
-               current_phase_ == Phase::kPartialElimination)
-            << current_phase_;
+        DCHECK(current_phase_ == Phase::kLoadElimination) << current_phase_;
         MaterializeNonLoopPhis(value.GetPhiPlaceholder(), type);
         value = Replacement(value);
       }
@@ -2575,6 +2405,7 @@
 // opportunities. If we find no such load, we shall at least propagate an unknown value to some
 // heap location that is needed by another loop Phi placeholder.
 void LSEVisitor::ProcessLoopPhiWithUnknownInput(PhiPlaceholder loop_phi_with_unknown_input) {
+  DCHECK(!loads_requiring_loop_phi_.empty());
   size_t loop_phi_with_unknown_input_index = PhiPlaceholderIndex(loop_phi_with_unknown_input);
   DCHECK(phi_placeholder_replacements_[loop_phi_with_unknown_input_index].IsInvalid());
   phi_placeholder_replacements_[loop_phi_with_unknown_input_index] =
@@ -2640,29 +2471,29 @@
       if (load_or_store->GetBlock() != block) {
         break;  // End of instructions from the current block.
       }
-      bool is_store = load_or_store->GetSideEffects().DoesAnyWrite();
-      DCHECK_EQ(is_store, IsStore(load_or_store));
-      HInstruction* stored_value = nullptr;
-      if (is_store) {
-        auto it = store_records_.find(load_or_store);
-        DCHECK(it != store_records_.end());
-        stored_value = it->second.stored_value;
-      }
-      auto it = loads_requiring_loop_phi_.find(
-          stored_value != nullptr ? stored_value : load_or_store);
-      if (it == loads_requiring_loop_phi_.end()) {
-        continue;  // This load or store never needed a loop Phi.
-      }
-      ValueRecord& record = it->second;
-      if (is_store) {
+      if (IsStore(load_or_store)) {
+        StoreRecord* store_record = store_records_[load_or_store->GetId()];
+        DCHECK(store_record != nullptr);
+        HInstruction* stored_value = store_record->stored_value;
+        DCHECK(stored_value != nullptr);
+        // Note that the `stored_value` can be a newly created `Phi` with an id that falls
+        // outside the allocated `loads_requiring_loop_phi_` range.
+        DCHECK_IMPLIES(
+            IsLoad(stored_value),
+            static_cast<size_t>(stored_value->GetId()) < loads_requiring_loop_phi_.size());
+        if (static_cast<size_t>(stored_value->GetId()) >= loads_requiring_loop_phi_.size() ||
+            loads_requiring_loop_phi_[stored_value->GetId()] == nullptr) {
+          continue;  // This store never needed a loop Phi.
+        }
+        ValueRecord* record = loads_requiring_loop_phi_[stored_value->GetId()];
         // Process the store by updating `local_heap_values[idx]`. The last update shall
         // be propagated to the `heap_values[idx].value` if it previously needed a loop Phi
         // at the end of the block.
-        Value replacement = ReplacementOrValue(record.value);
+        Value replacement = ReplacementOrValue(record->value);
         if (replacement.NeedsLoopPhi()) {
           // No replacement yet, use the Phi placeholder from the load.
-          DCHECK(record.value.NeedsLoopPhi());
-          local_heap_values[idx] = record.value;
+          DCHECK(record->value.NeedsLoopPhi());
+          local_heap_values[idx] = record->value;
         } else {
           // If the load fetched a known value, use it, otherwise use the load.
           local_heap_values[idx] = Value::ForInstruction(
@@ -2670,7 +2501,12 @@
         }
       } else {
         // Process the load unless it has previously been marked unreplaceable.
-        if (record.value.NeedsLoopPhi()) {
+        DCHECK(IsLoad(load_or_store));
+        ValueRecord* record = loads_requiring_loop_phi_[load_or_store->GetId()];
+        if (record == nullptr) {
+          continue;  // This load never needed a loop Phi.
+        }
+        if (record->value.NeedsLoopPhi()) {
           if (local_heap_values[idx].IsInvalid()) {
             local_heap_values[idx] = get_initial_value(block, idx);
           }
@@ -2679,12 +2515,12 @@
             // (no aliasing since then, otherwise the Phi placeholder would not have been
             // propagated as a value to this load) and store the load as the new heap value.
             found_unreplaceable_load = true;
-            KeepStores(record.value);
-            record.value = Value::MergedUnknown(record.value.GetPhiPlaceholder());
+            KeepStores(record->value);
+            record->value = Value::MergedUnknown(record->value.GetPhiPlaceholder());
             local_heap_values[idx] = Value::ForInstruction(load_or_store);
           } else if (local_heap_values[idx].NeedsLoopPhi()) {
             // The load may still be replaced with a Phi later.
-            DCHECK(local_heap_values[idx].Equals(record.value));
+            DCHECK(local_heap_values[idx].Equals(record->value));
           } else {
             // This load can be eliminated but we may need to construct non-loop Phis.
             if (local_heap_values[idx].NeedsNonLoopPhi()) {
@@ -2692,8 +2528,12 @@
                                      load_or_store->GetType());
               local_heap_values[idx] = Replacement(local_heap_values[idx]);
             }
-            record.value = local_heap_values[idx];
-            HInstruction* heap_value = local_heap_values[idx].GetInstruction();
+            record->value = local_heap_values[idx];
+            DCHECK(local_heap_values[idx].IsDefault() || local_heap_values[idx].IsInstruction())
+                << "The replacement heap value can be an HIR instruction or the default value.";
+            HInstruction* heap_value = local_heap_values[idx].IsDefault() ?
+                                           GetDefaultValue(load_or_store->GetType()) :
+                                           local_heap_values[idx].GetInstruction();
             AddRemovedLoad(load_or_store, heap_value);
           }
         }
@@ -2724,19 +2564,21 @@
   // make the result of the processing depend on the order in which we process these loads.
   // To make sure the result is deterministic, iterate over `loads_and_stores_` instead of the
   // `loads_requiring_loop_phi_` indexed by non-deterministic pointers.
+  if (loads_requiring_loop_phi_.empty()) {
+    return;  // No loads to process.
+  }
   for (const LoadStoreRecord& load_store_record : loads_and_stores_) {
-    auto it = loads_requiring_loop_phi_.find(load_store_record.load_or_store);
-    if (it == loads_requiring_loop_phi_.end()) {
+    ValueRecord* record = loads_requiring_loop_phi_[load_store_record.load_or_store->GetId()];
+    if (record == nullptr) {
       continue;
     }
-    HInstruction* load = it->first;
-    ValueRecord& record = it->second;
-    while (record.value.NeedsLoopPhi() &&
-           phi_placeholder_replacements_[PhiPlaceholderIndex(record.value)].IsInvalid()) {
+    HInstruction* load = load_store_record.load_or_store;
+    while (record->value.NeedsLoopPhi() &&
+           phi_placeholder_replacements_[PhiPlaceholderIndex(record->value)].IsInvalid()) {
       std::optional<PhiPlaceholder> loop_phi_with_unknown_input =
-          TryToMaterializeLoopPhis(record.value.GetPhiPlaceholder(), load);
+          TryToMaterializeLoopPhis(record->value.GetPhiPlaceholder(), load);
       DCHECK_EQ(loop_phi_with_unknown_input.has_value(),
-                phi_placeholder_replacements_[PhiPlaceholderIndex(record.value)].IsInvalid());
+                phi_placeholder_replacements_[PhiPlaceholderIndex(record->value)].IsInvalid());
       if (loop_phi_with_unknown_input) {
         DCHECK_GE(GetGraph()
                       ->GetBlocks()[loop_phi_with_unknown_input->GetBlockId()]
@@ -2748,10 +2590,12 @@
     }
     // The load could have been marked as unreplaceable (and stores marked for keeping)
     // or marked for replacement with an instruction in ProcessLoopPhiWithUnknownInput().
-    DCHECK(record.value.IsUnknown() || record.value.IsInstruction() || record.value.NeedsLoopPhi());
-    if (record.value.NeedsLoopPhi()) {
-      record.value = Replacement(record.value);
-      HInstruction* heap_value = record.value.GetInstruction();
+    DCHECK(record->value.IsUnknown() ||
+           record->value.IsInstruction() ||
+           record->value.NeedsLoopPhi());
+    if (record->value.NeedsLoopPhi()) {
+      record->value = Replacement(record->value);
+      HInstruction* heap_value = record->value.GetInstruction();
       AddRemovedLoad(load, heap_value);
     }
   }
@@ -2765,22 +2609,9 @@
     work_queue.push_back(index);
   }
   const ArenaVector<HBasicBlock*>& blocks = GetGraph()->GetBlocks();
-  std::optional<ArenaBitVector> not_kept_stores;
-  if (stats_) {
-    not_kept_stores.emplace(GetGraph()->GetAllocator(),
-                            kept_stores_.GetBitSizeOf(),
-                            false,
-                            ArenaAllocKind::kArenaAllocLSE);
-  }
   while (!work_queue.empty()) {
     uint32_t cur_phi_idx = work_queue.back();
     PhiPlaceholder phi_placeholder = GetPhiPlaceholderAt(cur_phi_idx);
-    // Only writes to partial-escapes need to be specifically kept.
-    bool is_partial_kept_merged_unknown =
-        kept_merged_unknowns_.IsBitSet(cur_phi_idx) &&
-        heap_location_collector_.GetHeapLocation(phi_placeholder.GetHeapLocation())
-            ->GetReferenceInfo()
-            ->IsPartialSingleton();
     work_queue.pop_back();
     size_t idx = phi_placeholder.GetHeapLocation();
     HBasicBlock* block = blocks[phi_placeholder.GetBlockId()];
@@ -2800,11 +2631,6 @@
         if (!stored_by.IsUnknown() && (i == idx || MayAliasOnBackEdge(block, idx, i))) {
           if (stored_by.NeedsPhi()) {
             size_t phi_placeholder_index = PhiPlaceholderIndex(stored_by);
-            if (is_partial_kept_merged_unknown) {
-              // Propagate merged-unknown keep since otherwise this might look
-              // like a partial escape we can remove.
-              kept_merged_unknowns_.SetBit(phi_placeholder_index);
-            }
             if (!phi_placeholders_to_search_for_kept_stores_.IsBitSet(phi_placeholder_index)) {
               phi_placeholders_to_search_for_kept_stores_.SetBit(phi_placeholder_index);
               work_queue.push_back(phi_placeholder_index);
@@ -2815,32 +2641,20 @@
             DCHECK(ri != nullptr) << "No heap value for " << stored_by.GetInstruction()->DebugName()
                                   << " id: " << stored_by.GetInstruction()->GetId() << " block: "
                                   << stored_by.GetInstruction()->GetBlock()->GetBlockId();
-            if (!is_partial_kept_merged_unknown && IsPartialNoEscape(predecessor, idx)) {
-              if (not_kept_stores) {
-                not_kept_stores->SetBit(stored_by.GetInstruction()->GetId());
-              }
-            } else {
-              kept_stores_.SetBit(stored_by.GetInstruction()->GetId());
-            }
+            kept_stores_.SetBit(stored_by.GetInstruction()->GetId());
           }
         }
       }
     }
   }
-  if (not_kept_stores) {
-    // a - b := (a & ~b)
-    not_kept_stores->Subtract(&kept_stores_);
-    auto num_removed = not_kept_stores->NumSetBits();
-    MaybeRecordStat(stats_, MethodCompilationStat::kPartialStoreRemoved, num_removed);
-  }
 }
 
 void LSEVisitor::UpdateValueRecordForStoreElimination(/*inout*/ValueRecord* value_record) {
   while (value_record->stored_by.IsInstruction() &&
          !kept_stores_.IsBitSet(value_record->stored_by.GetInstruction()->GetId())) {
-    auto it = store_records_.find(value_record->stored_by.GetInstruction());
-    DCHECK(it != store_records_.end());
-    *value_record = it->second.old_value_record;
+    StoreRecord* store_record = store_records_[value_record->stored_by.GetInstruction()->GetId()];
+    DCHECK(store_record != nullptr);
+    *value_record = store_record->old_value_record;
   }
   if (value_record->stored_by.NeedsPhi() &&
       !phi_placeholders_to_search_for_kept_stores_.IsBitSet(
@@ -2913,7 +2727,7 @@
   }
 
   template<typename Func>
-  void ForEachRecord(Func func) {
+  void ForEachRecord(Func&& func) {
     for (size_t blk_id : Range(to_restore_.size())) {
       for (size_t heap_loc : Range(to_restore_[blk_id].size())) {
         LSEVisitor::ValueRecord* vr = &to_restore_[blk_id][heap_loc];
@@ -2979,22 +2793,21 @@
                                    kArenaAllocLSE);
   eliminated_stores.ClearAllBits();
 
-  for (auto& entry : store_records_) {
-    HInstruction* store = entry.first;
-    StoreRecord& store_record = entry.second;
-    if (!kept_stores_.IsBitSet(store->GetId())) {
-      continue;  // Ignore stores that are not kept.
+  for (uint32_t store_id : kept_stores_.Indexes()) {
+    DCHECK(kept_stores_.IsBitSet(store_id));
+    StoreRecord* store_record = store_records_[store_id];
+    DCHECK(store_record != nullptr);
+    UpdateValueRecordForStoreElimination(&store_record->old_value_record);
+    if (store_record->old_value_record.value.NeedsPhi()) {
+      DataType::Type type = store_record->stored_value->GetType();
+      FindOldValueForPhiPlaceholder(store_record->old_value_record.value.GetPhiPlaceholder(), type);
+      store_record->old_value_record.value =
+          ReplacementOrValue(store_record->old_value_record.value);
     }
-    UpdateValueRecordForStoreElimination(&store_record.old_value_record);
-    if (store_record.old_value_record.value.NeedsPhi()) {
-      DataType::Type type = store_record.stored_value->GetType();
-      FindOldValueForPhiPlaceholder(store_record.old_value_record.value.GetPhiPlaceholder(), type);
-      store_record.old_value_record.value = ReplacementOrValue(store_record.old_value_record.value);
-    }
-    DCHECK(!store_record.old_value_record.value.NeedsPhi());
-    HInstruction* stored_value = FindSubstitute(store_record.stored_value);
-    if (store_record.old_value_record.value.Equals(stored_value)) {
-      eliminated_stores.SetBit(store->GetId());
+    DCHECK(!store_record->old_value_record.value.NeedsPhi());
+    HInstruction* stored_value = FindSubstitute(store_record->stored_value);
+    if (store_record->old_value_record.value.Equals(stored_value)) {
+      eliminated_stores.SetBit(store_id);
     }
   }
 
@@ -3003,6 +2816,10 @@
 }
 
 void LSEVisitor::Run() {
+  // 0. Set HasMonitorOperations to false. If we encounter some MonitorOperations that we can't
+  // remove, we will set it to true in VisitMonitorOperation.
+  GetGraph()->SetHasMonitorOperations(false);
+
   // 1. Process blocks and instructions in reverse post order.
   for (HBasicBlock* block : GetGraph()->GetReversePostOrder()) {
     VisitBasicBlock(block);
@@ -3022,934 +2839,8 @@
 
   // 4. Replace loads and remove unnecessary stores and singleton allocations.
   FinishFullLSE();
-
-  // 5. Move partial escapes down and fixup with PHIs.
-  current_phase_ = Phase::kPartialElimination;
-  MovePartialEscapes();
 }
 
-// Clear unknown loop-phi results. Here we'll be able to use partial-unknowns so we need to
-// retry all of them with more information about where they come from.
-void LSEVisitor::PrepareForPartialPhiComputation() {
-  std::replace_if(
-      phi_placeholder_replacements_.begin(),
-      phi_placeholder_replacements_.end(),
-      [](const Value& val) { return !val.IsDefault() && !val.IsInstruction(); },
-      Value::Invalid());
-}
-
-class PartialLoadStoreEliminationHelper {
- public:
-  PartialLoadStoreEliminationHelper(LSEVisitor* lse, ScopedArenaAllocator* alloc)
-      : lse_(lse),
-        alloc_(alloc),
-        new_ref_phis_(alloc_->Adapter(kArenaAllocLSE)),
-        heap_refs_(alloc_->Adapter(kArenaAllocLSE)),
-        max_preds_per_block_((*std::max_element(GetGraph()->GetActiveBlocks().begin(),
-                                                GetGraph()->GetActiveBlocks().end(),
-                                                [](HBasicBlock* a, HBasicBlock* b) {
-                                                  return a->GetNumberOfPredecessors() <
-                                                         b->GetNumberOfPredecessors();
-                                                }))
-                                 ->GetNumberOfPredecessors()),
-        materialization_blocks_(GetGraph()->GetBlocks().size() * max_preds_per_block_,
-                                nullptr,
-                                alloc_->Adapter(kArenaAllocLSE)),
-        first_materialization_block_id_(GetGraph()->GetBlocks().size()) {
-    size_t num_partial_singletons = lse_->heap_location_collector_.CountPartialSingletons();
-    heap_refs_.reserve(num_partial_singletons);
-    new_ref_phis_.reserve(num_partial_singletons * GetGraph()->GetBlocks().size());
-    CollectInterestingHeapRefs();
-  }
-
-  ~PartialLoadStoreEliminationHelper() {
-    if (heap_refs_.empty()) {
-      return;
-    }
-    ReferenceTypePropagation rtp_fixup(GetGraph(),
-                                       Handle<mirror::DexCache>(),
-                                       /* is_first_run= */ false);
-    rtp_fixup.Visit(ArrayRef<HInstruction* const>(new_ref_phis_));
-    GetGraph()->ClearLoopInformation();
-    GetGraph()->ClearDominanceInformation();
-    GetGraph()->ClearReachabilityInformation();
-    GetGraph()->BuildDominatorTree();
-    GetGraph()->ComputeReachabilityInformation();
-  }
-
-  class IdxToHeapLoc {
-   public:
-    explicit IdxToHeapLoc(const HeapLocationCollector* hlc) : collector_(hlc) {}
-    HeapLocation* operator()(size_t idx) const {
-      return collector_->GetHeapLocation(idx);
-    }
-
-   private:
-    const HeapLocationCollector* collector_;
-  };
-
-
-  class HeapReferenceData {
-   public:
-    using LocIterator = IterationRange<TransformIterator<BitVector::IndexIterator, IdxToHeapLoc>>;
-    HeapReferenceData(PartialLoadStoreEliminationHelper* helper,
-                      HNewInstance* new_inst,
-                      const ExecutionSubgraph* subgraph,
-                      ScopedArenaAllocator* alloc)
-        : new_instance_(new_inst),
-          helper_(helper),
-          heap_locs_(alloc,
-                     helper->lse_->heap_location_collector_.GetNumberOfHeapLocations(),
-                     /* expandable= */ false,
-                     kArenaAllocLSE),
-          materializations_(
-              // We generally won't need to create too many materialization blocks and we can expand
-              // this as needed so just start off with 2x.
-              2 * helper->lse_->GetGraph()->GetBlocks().size(),
-              nullptr,
-              alloc->Adapter(kArenaAllocLSE)),
-          collector_(helper->lse_->heap_location_collector_),
-          subgraph_(subgraph) {}
-
-    LocIterator IterateLocations() {
-      auto idxs = heap_locs_.Indexes();
-      return MakeTransformRange(idxs, IdxToHeapLoc(&collector_));
-    }
-
-    void AddHeapLocation(size_t idx) {
-      heap_locs_.SetBit(idx);
-    }
-
-    const ExecutionSubgraph* GetNoEscapeSubgraph() const {
-      return subgraph_;
-    }
-
-    bool IsPostEscape(HBasicBlock* blk) {
-      return std::any_of(
-          subgraph_->GetExcludedCohorts().cbegin(),
-          subgraph_->GetExcludedCohorts().cend(),
-          [&](const ExecutionSubgraph::ExcludedCohort& ec) { return ec.PrecedesBlock(blk); });
-    }
-
-    bool InEscapeCohort(HBasicBlock* blk) {
-      return std::any_of(
-          subgraph_->GetExcludedCohorts().cbegin(),
-          subgraph_->GetExcludedCohorts().cend(),
-          [&](const ExecutionSubgraph::ExcludedCohort& ec) { return ec.ContainsBlock(blk); });
-    }
-
-    bool BeforeAllEscapes(HBasicBlock* b) {
-      return std::none_of(subgraph_->GetExcludedCohorts().cbegin(),
-                          subgraph_->GetExcludedCohorts().cend(),
-                          [&](const ExecutionSubgraph::ExcludedCohort& ec) {
-                            return ec.PrecedesBlock(b) || ec.ContainsBlock(b);
-                          });
-    }
-
-    HNewInstance* OriginalNewInstance() const {
-      return new_instance_;
-    }
-
-    // Collect and replace all uses. We need to perform this twice since we will
-    // generate PHIs and additional uses as we create the default-values for
-    // pred-gets. These values might be other references that are also being
-    // partially eliminated. By running just the replacement part again we are
-    // able to avoid having to keep another whole in-progress partial map
-    // around. Since we will have already handled all the other uses in the
-    // first pass the second one will be quite fast.
-    void FixupUses(bool first_pass) {
-      ScopedArenaAllocator saa(GetGraph()->GetArenaStack());
-      // Replace uses with materialized values.
-      ScopedArenaVector<InstructionUse<HInstruction>> to_replace(saa.Adapter(kArenaAllocLSE));
-      ScopedArenaVector<HInstruction*> to_remove(saa.Adapter(kArenaAllocLSE));
-      // Do we need to add a constructor-fence.
-      ScopedArenaVector<InstructionUse<HConstructorFence>> constructor_fences(
-          saa.Adapter(kArenaAllocLSE));
-      ScopedArenaVector<InstructionUse<HInstruction>> to_predicate(saa.Adapter(kArenaAllocLSE));
-
-      CollectReplacements(to_replace, to_remove, constructor_fences, to_predicate);
-
-      if (!first_pass) {
-        // If another partial creates new references they can only be in Phis or pred-get defaults
-        // so they must be in the to_replace group.
-        DCHECK(to_predicate.empty());
-        DCHECK(constructor_fences.empty());
-        DCHECK(to_remove.empty());
-      }
-
-      ReplaceInput(to_replace);
-      RemoveAndReplaceInputs(to_remove);
-      CreateConstructorFences(constructor_fences);
-      PredicateInstructions(to_predicate);
-
-      CHECK(OriginalNewInstance()->GetUses().empty())
-          << OriginalNewInstance()->GetUses() << ", " << OriginalNewInstance()->GetEnvUses();
-    }
-
-    void AddMaterialization(HBasicBlock* blk, HInstruction* ins) {
-      if (blk->GetBlockId() >= materializations_.size()) {
-        // Make sure the materialization array is large enough, try to avoid
-        // re-sizing too many times by giving extra space.
-        materializations_.resize(blk->GetBlockId() * 2, nullptr);
-      }
-      DCHECK(materializations_[blk->GetBlockId()] == nullptr)
-          << "Already have a materialization in block " << blk->GetBlockId() << ": "
-          << *materializations_[blk->GetBlockId()] << " when trying to set materialization to "
-          << *ins;
-      materializations_[blk->GetBlockId()] = ins;
-      LSE_VLOG << "In  block " << blk->GetBlockId() << " materialization is " << *ins;
-      helper_->NotifyNewMaterialization(ins);
-    }
-
-    bool HasMaterialization(HBasicBlock* blk) const {
-      return blk->GetBlockId() < materializations_.size() &&
-             materializations_[blk->GetBlockId()] != nullptr;
-    }
-
-    HInstruction* GetMaterialization(HBasicBlock* blk) const {
-      if (materializations_.size() <= blk->GetBlockId() ||
-          materializations_[blk->GetBlockId()] == nullptr) {
-        // This must be a materialization block added after the partial LSE of
-        // the current reference finished. Since every edge can only have at
-        // most one materialization block added to it we can just check the
-        // blocks predecessor.
-        DCHECK(helper_->IsMaterializationBlock(blk));
-        blk = helper_->FindDominatingNonMaterializationBlock(blk);
-        DCHECK(!helper_->IsMaterializationBlock(blk));
-      }
-      DCHECK_GT(materializations_.size(), blk->GetBlockId());
-      DCHECK(materializations_[blk->GetBlockId()] != nullptr);
-      return materializations_[blk->GetBlockId()];
-    }
-
-    void GenerateMaterializationValueFromPredecessors(HBasicBlock* blk) {
-      DCHECK(std::none_of(GetNoEscapeSubgraph()->GetExcludedCohorts().begin(),
-                          GetNoEscapeSubgraph()->GetExcludedCohorts().end(),
-                          [&](const ExecutionSubgraph::ExcludedCohort& cohort) {
-                            return cohort.IsEntryBlock(blk);
-                          }));
-      DCHECK(!HasMaterialization(blk));
-      if (blk->IsExitBlock()) {
-        return;
-      } else if (blk->IsLoopHeader()) {
-        // See comment in execution_subgraph.h. Currently we act as though every
-        // allocation for partial elimination takes place in the entry block.
-        // This simplifies the analysis by making it so any escape cohort
-        // expands to contain any loops it is a part of. This is something that
-        // we should rectify at some point. In either case however we can still
-        // special case the loop-header since (1) currently the loop can't have
-        // any merges between different cohort entries since the pre-header will
-        // be the earliest place entry can happen and (2) even if the analysis
-        // is improved to consider lifetime of the object WRT loops any values
-        // which would require loop-phis would have to make the whole loop
-        // escape anyway.
-        // This all means we can always use value from the pre-header when the
-        // block is the loop-header and we didn't already create a
-        // materialization block. (NB when we do improve the analysis we will
-        // need to modify the materialization creation code to deal with this
-        // correctly.)
-        HInstruction* pre_header_val =
-            GetMaterialization(blk->GetLoopInformation()->GetPreHeader());
-        AddMaterialization(blk, pre_header_val);
-        return;
-      }
-      ScopedArenaAllocator saa(GetGraph()->GetArenaStack());
-      ScopedArenaVector<HInstruction*> pred_vals(saa.Adapter(kArenaAllocLSE));
-      pred_vals.reserve(blk->GetNumberOfPredecessors());
-      for (HBasicBlock* pred : blk->GetPredecessors()) {
-        DCHECK(HasMaterialization(pred));
-        pred_vals.push_back(GetMaterialization(pred));
-      }
-      GenerateMaterializationValueFromPredecessorsDirect(blk, pred_vals);
-    }
-
-    void GenerateMaterializationValueFromPredecessorsForEntry(
-        HBasicBlock* entry, const ScopedArenaVector<HInstruction*>& pred_vals) {
-      DCHECK(std::any_of(GetNoEscapeSubgraph()->GetExcludedCohorts().begin(),
-                         GetNoEscapeSubgraph()->GetExcludedCohorts().end(),
-                         [&](const ExecutionSubgraph::ExcludedCohort& cohort) {
-                           return cohort.IsEntryBlock(entry);
-                         }));
-      GenerateMaterializationValueFromPredecessorsDirect(entry, pred_vals);
-    }
-
-   private:
-    template <typename InstructionType>
-    struct InstructionUse {
-      InstructionType* instruction_;
-      size_t index_;
-    };
-
-    void ReplaceInput(const ScopedArenaVector<InstructionUse<HInstruction>>& to_replace) {
-      for (auto& [ins, idx] : to_replace) {
-        HInstruction* merged_inst = GetMaterialization(ins->GetBlock());
-        if (ins->IsPhi() && merged_inst->IsPhi() && ins->GetBlock() == merged_inst->GetBlock()) {
-          // Phis we just pass through the appropriate inputs.
-          ins->ReplaceInput(merged_inst->InputAt(idx), idx);
-        } else {
-          ins->ReplaceInput(merged_inst, idx);
-        }
-      }
-    }
-
-    void RemoveAndReplaceInputs(const ScopedArenaVector<HInstruction*>& to_remove) {
-      for (HInstruction* ins : to_remove) {
-        if (ins->GetBlock() == nullptr) {
-          // Already dealt with.
-          continue;
-        }
-        DCHECK(BeforeAllEscapes(ins->GetBlock())) << *ins;
-        if (ins->IsInstanceFieldGet() || ins->IsInstanceFieldSet()) {
-          bool instruction_has_users =
-              ins->IsInstanceFieldGet() && (!ins->GetUses().empty() || !ins->GetEnvUses().empty());
-          if (instruction_has_users) {
-            // Make sure any remaining users of read are replaced.
-            HInstruction* replacement =
-                helper_->lse_->GetPartialValueAt(OriginalNewInstance(), ins);
-            // NB ReplaceInput will remove a use from the list so this is
-            // guaranteed to finish eventually.
-            while (!ins->GetUses().empty()) {
-              const HUseListNode<HInstruction*>& use = ins->GetUses().front();
-              use.GetUser()->ReplaceInput(replacement, use.GetIndex());
-            }
-            while (!ins->GetEnvUses().empty()) {
-              const HUseListNode<HEnvironment*>& use = ins->GetEnvUses().front();
-              use.GetUser()->ReplaceInput(replacement, use.GetIndex());
-            }
-          } else {
-            DCHECK(ins->GetUses().empty())
-                << "Instruction has users!\n"
-                << ins->DumpWithArgs() << "\nUsers are " << ins->GetUses();
-            DCHECK(ins->GetEnvUses().empty())
-                << "Instruction has users!\n"
-                << ins->DumpWithArgs() << "\nUsers are " << ins->GetEnvUses();
-          }
-          ins->GetBlock()->RemoveInstruction(ins);
-        } else {
-          // Can only be obj == other, obj != other, obj == obj (!?) or, obj != obj (!?)
-          // Since PHIs are escapes as far as LSE is concerned and we are before
-          // any escapes these are the only 4 options.
-          DCHECK(ins->IsEqual() || ins->IsNotEqual()) << *ins;
-          HInstruction* replacement;
-          if (UNLIKELY(ins->InputAt(0) == ins->InputAt(1))) {
-            replacement = ins->IsEqual() ? GetGraph()->GetIntConstant(1)
-                                         : GetGraph()->GetIntConstant(0);
-          } else {
-            replacement = ins->IsEqual() ? GetGraph()->GetIntConstant(0)
-                                         : GetGraph()->GetIntConstant(1);
-          }
-          ins->ReplaceWith(replacement);
-          ins->GetBlock()->RemoveInstruction(ins);
-        }
-      }
-    }
-
-    void CreateConstructorFences(
-        const ScopedArenaVector<InstructionUse<HConstructorFence>>& constructor_fences) {
-      if (!constructor_fences.empty()) {
-        uint32_t pc = constructor_fences.front().instruction_->GetDexPc();
-        for (auto& [cf, idx] : constructor_fences) {
-          if (cf->GetInputs().size() == 1) {
-            cf->GetBlock()->RemoveInstruction(cf);
-          } else {
-            cf->RemoveInputAt(idx);
-          }
-        }
-        for (const ExecutionSubgraph::ExcludedCohort& ec :
-            GetNoEscapeSubgraph()->GetExcludedCohorts()) {
-          for (HBasicBlock* blk : ec.EntryBlocks()) {
-            for (HBasicBlock* materializer :
-                Filter(MakeIterationRange(blk->GetPredecessors()),
-                        [&](HBasicBlock* blk) { return helper_->IsMaterializationBlock(blk); })) {
-              HInstruction* new_cf = new (GetGraph()->GetAllocator()) HConstructorFence(
-                  GetMaterialization(materializer), pc, GetGraph()->GetAllocator());
-              materializer->InsertInstructionBefore(new_cf, materializer->GetLastInstruction());
-            }
-          }
-        }
-      }
-    }
-
-    void PredicateInstructions(
-        const ScopedArenaVector<InstructionUse<HInstruction>>& to_predicate) {
-      for (auto& [ins, idx] : to_predicate) {
-        if (UNLIKELY(ins->GetBlock() == nullptr)) {
-          // Already handled due to obj == obj;
-          continue;
-        } else if (ins->IsInstanceFieldGet()) {
-          // IFieldGet[obj] => PredicatedIFieldGet[PartialValue, obj]
-          HInstruction* new_fget = new (GetGraph()->GetAllocator()) HPredicatedInstanceFieldGet(
-              ins->AsInstanceFieldGet(),
-              GetMaterialization(ins->GetBlock()),
-              helper_->lse_->GetPartialValueAt(OriginalNewInstance(), ins));
-          MaybeRecordStat(helper_->lse_->stats_, MethodCompilationStat::kPredicatedLoadAdded);
-          ins->GetBlock()->InsertInstructionBefore(new_fget, ins);
-          if (ins->GetType() == DataType::Type::kReference) {
-            // Reference info is the same
-            new_fget->SetReferenceTypeInfoIfValid(ins->GetReferenceTypeInfo());
-          }
-          // In this phase, substitute instructions are used only for the predicated get
-          // default values which are used only if the partial singleton did not escape,
-          // so the out value of the `new_fget` for the relevant cases is the same as
-          // the default value.
-          // TODO: Use the default value for materializing default values used by
-          // other predicated loads to avoid some unnecessary Phis. (This shall
-          // complicate the search for replacement in `ReplacementOrValue()`.)
-          DCHECK(helper_->lse_->substitute_instructions_for_loads_[ins->GetId()] == nullptr);
-          helper_->lse_->substitute_instructions_for_loads_[ins->GetId()] = new_fget;
-          ins->ReplaceWith(new_fget);
-          ins->ReplaceEnvUsesDominatedBy(ins, new_fget);
-          CHECK(ins->GetEnvUses().empty() && ins->GetUses().empty())
-              << "Instruction: " << *ins << " uses: " << ins->GetUses()
-              << ", env: " << ins->GetEnvUses();
-          ins->GetBlock()->RemoveInstruction(ins);
-        } else if (ins->IsInstanceFieldSet()) {
-          // Any predicated sets shouldn't require movement.
-          ins->AsInstanceFieldSet()->SetIsPredicatedSet();
-          MaybeRecordStat(helper_->lse_->stats_, MethodCompilationStat::kPredicatedStoreAdded);
-          HInstruction* merged_inst = GetMaterialization(ins->GetBlock());
-          ins->ReplaceInput(merged_inst, idx);
-        } else {
-          // comparisons need to be split into 2.
-          DCHECK(ins->IsEqual() || ins->IsNotEqual()) << "bad instruction " << *ins;
-          bool this_is_first = idx == 0;
-          if (ins->InputAt(0) == ins->InputAt(1)) {
-            // This is a obj == obj or obj != obj.
-            // No idea why anyone would do this but whatever.
-            ins->ReplaceWith(GetGraph()->GetIntConstant(ins->IsEqual() ? 1 : 0));
-            ins->GetBlock()->RemoveInstruction(ins);
-            continue;
-          } else {
-            HInstruction* is_escaped = new (GetGraph()->GetAllocator())
-                HNotEqual(GetMaterialization(ins->GetBlock()), GetGraph()->GetNullConstant());
-            HInstruction* combine_inst =
-                ins->IsEqual() ? static_cast<HInstruction*>(new (GetGraph()->GetAllocator()) HAnd(
-                                     DataType::Type::kBool, is_escaped, ins))
-                               : static_cast<HInstruction*>(new (GetGraph()->GetAllocator()) HOr(
-                                     DataType::Type::kBool, is_escaped, ins));
-            ins->ReplaceInput(GetMaterialization(ins->GetBlock()), this_is_first ? 0 : 1);
-            ins->GetBlock()->InsertInstructionBefore(is_escaped, ins);
-            ins->GetBlock()->InsertInstructionAfter(combine_inst, ins);
-            ins->ReplaceWith(combine_inst);
-            combine_inst->ReplaceInput(ins, 1);
-          }
-        }
-      }
-    }
-
-    // Figure out all the instructions we need to
-    // fixup/replace/remove/duplicate. Since this requires an iteration of an
-    // intrusive linked list we want to do it only once and collect all the data
-    // here.
-    void CollectReplacements(
-        ScopedArenaVector<InstructionUse<HInstruction>>& to_replace,
-        ScopedArenaVector<HInstruction*>& to_remove,
-        ScopedArenaVector<InstructionUse<HConstructorFence>>& constructor_fences,
-        ScopedArenaVector<InstructionUse<HInstruction>>& to_predicate) {
-      size_t size = new_instance_->GetUses().SizeSlow();
-      to_replace.reserve(size);
-      to_remove.reserve(size);
-      constructor_fences.reserve(size);
-      to_predicate.reserve(size);
-      for (auto& use : new_instance_->GetUses()) {
-        HBasicBlock* blk =
-            helper_->FindDominatingNonMaterializationBlock(use.GetUser()->GetBlock());
-        if (InEscapeCohort(blk)) {
-          LSE_VLOG << "Replacing " << *new_instance_ << " use in " << *use.GetUser() << " with "
-                   << *GetMaterialization(blk);
-          to_replace.push_back({use.GetUser(), use.GetIndex()});
-        } else if (IsPostEscape(blk)) {
-          LSE_VLOG << "User " << *use.GetUser() << " after escapes!";
-          // The fields + cmp are normal uses. Phi can only be here if it was
-          // generated by full LSE so whatever store+load that created the phi
-          // is the escape.
-          if (use.GetUser()->IsPhi()) {
-            to_replace.push_back({use.GetUser(), use.GetIndex()});
-          } else {
-            DCHECK(use.GetUser()->IsFieldAccess() ||
-                   use.GetUser()->IsEqual() ||
-                   use.GetUser()->IsNotEqual())
-                << *use.GetUser() << "@" << use.GetIndex();
-            to_predicate.push_back({use.GetUser(), use.GetIndex()});
-          }
-        } else if (use.GetUser()->IsConstructorFence()) {
-          LSE_VLOG << "User " << *use.GetUser() << " being moved to materialization!";
-          constructor_fences.push_back({use.GetUser()->AsConstructorFence(), use.GetIndex()});
-        } else {
-          LSE_VLOG << "User " << *use.GetUser() << " not contained in cohort!";
-          to_remove.push_back(use.GetUser());
-        }
-      }
-      DCHECK_EQ(
-          to_replace.size() + to_remove.size() + constructor_fences.size() + to_predicate.size(),
-          size);
-    }
-
-    void GenerateMaterializationValueFromPredecessorsDirect(
-        HBasicBlock* blk, const ScopedArenaVector<HInstruction*>& pred_vals) {
-      DCHECK(!pred_vals.empty());
-      bool all_equal = std::all_of(pred_vals.begin() + 1, pred_vals.end(), [&](HInstruction* val) {
-        return val == pred_vals.front();
-      });
-      if (LIKELY(all_equal)) {
-        AddMaterialization(blk, pred_vals.front());
-      } else {
-        // Make a PHI for the predecessors.
-        HPhi* phi = new (GetGraph()->GetAllocator()) HPhi(
-            GetGraph()->GetAllocator(), kNoRegNumber, pred_vals.size(), DataType::Type::kReference);
-        for (const auto& [ins, off] : ZipCount(MakeIterationRange(pred_vals))) {
-          phi->SetRawInputAt(off, ins);
-        }
-        blk->AddPhi(phi);
-        AddMaterialization(blk, phi);
-      }
-    }
-
-    HGraph* GetGraph() const {
-      return helper_->GetGraph();
-    }
-
-    HNewInstance* new_instance_;
-    PartialLoadStoreEliminationHelper* helper_;
-    ArenaBitVector heap_locs_;
-    ScopedArenaVector<HInstruction*> materializations_;
-    const HeapLocationCollector& collector_;
-    const ExecutionSubgraph* subgraph_;
-  };
-
-  ArrayRef<HeapReferenceData> GetHeapRefs() {
-    return ArrayRef<HeapReferenceData>(heap_refs_);
-  }
-
-  bool IsMaterializationBlock(HBasicBlock* blk) const {
-    return blk->GetBlockId() >= first_materialization_block_id_;
-  }
-
-  HBasicBlock* GetOrCreateMaterializationBlock(HBasicBlock* entry, size_t pred_num) {
-    size_t idx = GetMaterializationBlockIndex(entry, pred_num);
-    HBasicBlock* blk = materialization_blocks_[idx];
-    if (blk == nullptr) {
-      blk = new (GetGraph()->GetAllocator()) HBasicBlock(GetGraph());
-      GetGraph()->AddBlock(blk);
-      LSE_VLOG << "creating materialization block " << blk->GetBlockId() << " on edge "
-               << entry->GetPredecessors()[pred_num]->GetBlockId() << "->" << entry->GetBlockId();
-      blk->AddInstruction(new (GetGraph()->GetAllocator()) HGoto());
-      materialization_blocks_[idx] = blk;
-    }
-    return blk;
-  }
-
-  HBasicBlock* GetMaterializationBlock(HBasicBlock* entry, size_t pred_num) {
-    HBasicBlock* out = materialization_blocks_[GetMaterializationBlockIndex(entry, pred_num)];
-    DCHECK(out != nullptr) << "No materialization block for edge " << entry->GetBlockId() << "->"
-                           << entry->GetPredecessors()[pred_num]->GetBlockId();
-    return out;
-  }
-
-  IterationRange<ArenaVector<HBasicBlock*>::const_iterator> IterateMaterializationBlocks() {
-    return MakeIterationRange(GetGraph()->GetBlocks().begin() + first_materialization_block_id_,
-                              GetGraph()->GetBlocks().end());
-  }
-
-  void FixupPartialObjectUsers() {
-    for (PartialLoadStoreEliminationHelper::HeapReferenceData& ref_data : GetHeapRefs()) {
-      // Use the materialized instances to replace original instance
-      ref_data.FixupUses(/*first_pass=*/true);
-      CHECK(ref_data.OriginalNewInstance()->GetUses().empty())
-          << ref_data.OriginalNewInstance()->GetUses() << ", "
-          << ref_data.OriginalNewInstance()->GetEnvUses();
-    }
-    // This can cause new uses to be created due to the creation of phis/pred-get defaults
-    for (PartialLoadStoreEliminationHelper::HeapReferenceData& ref_data : GetHeapRefs()) {
-      // Only need to handle new phis/pred-get defaults. DCHECK that's all we find.
-      ref_data.FixupUses(/*first_pass=*/false);
-      CHECK(ref_data.OriginalNewInstance()->GetUses().empty())
-          << ref_data.OriginalNewInstance()->GetUses() << ", "
-          << ref_data.OriginalNewInstance()->GetEnvUses();
-    }
-  }
-
-  // Finds the first block which either is or dominates the given block which is
-  // not a materialization block
-  HBasicBlock* FindDominatingNonMaterializationBlock(HBasicBlock* blk) {
-    if (LIKELY(!IsMaterializationBlock(blk))) {
-      // Not a materialization block so itself.
-      return blk;
-    } else if (blk->GetNumberOfPredecessors() != 0) {
-      // We're far enough along that the materialization blocks have been
-      // inserted into the graph so no need to go searching.
-      return blk->GetSinglePredecessor();
-    }
-    // Search through the materialization blocks to find where it will be
-    // inserted.
-    for (auto [mat, idx] : ZipCount(MakeIterationRange(materialization_blocks_))) {
-      if (mat == blk) {
-        size_t cur_pred_idx = idx % max_preds_per_block_;
-        HBasicBlock* entry = GetGraph()->GetBlocks()[idx / max_preds_per_block_];
-        return entry->GetPredecessors()[cur_pred_idx];
-      }
-    }
-    LOG(FATAL) << "Unable to find materialization block position for " << blk->GetBlockId() << "!";
-    return nullptr;
-  }
-
-  void InsertMaterializationBlocks() {
-    for (auto [mat, idx] : ZipCount(MakeIterationRange(materialization_blocks_))) {
-      if (mat == nullptr) {
-        continue;
-      }
-      size_t cur_pred_idx = idx % max_preds_per_block_;
-      HBasicBlock* entry = GetGraph()->GetBlocks()[idx / max_preds_per_block_];
-      HBasicBlock* pred = entry->GetPredecessors()[cur_pred_idx];
-      mat->InsertBetween(pred, entry);
-      LSE_VLOG << "Adding materialization block " << mat->GetBlockId() << " on edge "
-               << pred->GetBlockId() << "->" << entry->GetBlockId();
-    }
-  }
-
-  // Replace any env-uses remaining of the partial singletons with the
-  // appropriate phis and remove the instructions.
-  void RemoveReplacedInstructions() {
-    for (HeapReferenceData& ref_data : GetHeapRefs()) {
-      CHECK(ref_data.OriginalNewInstance()->GetUses().empty())
-          << ref_data.OriginalNewInstance()->GetUses() << ", "
-          << ref_data.OriginalNewInstance()->GetEnvUses()
-          << " inst is: " << ref_data.OriginalNewInstance();
-      const auto& env_uses = ref_data.OriginalNewInstance()->GetEnvUses();
-      while (!env_uses.empty()) {
-        const HUseListNode<HEnvironment*>& use = env_uses.front();
-        HInstruction* merged_inst =
-            ref_data.GetMaterialization(use.GetUser()->GetHolder()->GetBlock());
-        LSE_VLOG << "Replacing env use of " << *use.GetUser()->GetHolder() << "@" << use.GetIndex()
-                 << " with " << *merged_inst;
-        use.GetUser()->ReplaceInput(merged_inst, use.GetIndex());
-      }
-      ref_data.OriginalNewInstance()->GetBlock()->RemoveInstruction(ref_data.OriginalNewInstance());
-    }
-  }
-
-  // We need to make sure any allocations dominate their environment uses.
-  // Technically we could probably remove the env-uses and be fine but this is easy.
-  void ReorderMaterializationsForEnvDominance() {
-    for (HBasicBlock* blk : IterateMaterializationBlocks()) {
-      ScopedArenaAllocator alloc(alloc_->GetArenaStack());
-      ArenaBitVector still_unsorted(
-          &alloc, GetGraph()->GetCurrentInstructionId(), false, kArenaAllocLSE);
-      // This is guaranteed to be very short (since we will abandon LSE if there
-      // are >= kMaxNumberOfHeapLocations (32) heap locations so that is the
-      // absolute maximum size this list can be) so doing a selection sort is
-      // fine. This avoids the need to do a complicated recursive check to
-      // ensure transitivity for std::sort.
-      ScopedArenaVector<HNewInstance*> materializations(alloc.Adapter(kArenaAllocLSE));
-      materializations.reserve(GetHeapRefs().size());
-      for (HInstruction* ins :
-           MakeSTLInstructionIteratorRange(HInstructionIterator(blk->GetInstructions()))) {
-        if (ins->IsNewInstance()) {
-          materializations.push_back(ins->AsNewInstance());
-          still_unsorted.SetBit(ins->GetId());
-        }
-      }
-      using Iter = ScopedArenaVector<HNewInstance*>::iterator;
-      Iter unsorted_start = materializations.begin();
-      Iter unsorted_end = materializations.end();
-      // selection sort. Required since the only check we can easily perform a
-      // is-before-all-unsorted check.
-      while (unsorted_start != unsorted_end) {
-        bool found_instruction = false;
-        for (Iter candidate = unsorted_start; candidate != unsorted_end; ++candidate) {
-          HNewInstance* ni = *candidate;
-          if (std::none_of(ni->GetAllEnvironments().cbegin(),
-                           ni->GetAllEnvironments().cend(),
-                           [&](const HEnvironment* env) {
-                             return std::any_of(
-                                 env->GetEnvInputs().cbegin(),
-                                 env->GetEnvInputs().cend(),
-                                 [&](const HInstruction* env_element) {
-                                   return env_element != nullptr &&
-                                          still_unsorted.IsBitSet(env_element->GetId());
-                                 });
-                           })) {
-            still_unsorted.ClearBit(ni->GetId());
-            std::swap(*unsorted_start, *candidate);
-            ++unsorted_start;
-            found_instruction = true;
-            break;
-          }
-        }
-        CHECK(found_instruction) << "Unable to select next materialization instruction."
-                                 << " Environments have a dependency loop!";
-      }
-      // Reverse so we as we prepend them we end up with the correct order.
-      auto reverse_iter = MakeIterationRange(materializations.rbegin(), materializations.rend());
-      for (HNewInstance* ins : reverse_iter) {
-        if (blk->GetFirstInstruction() != ins) {
-          // Don't do checks since that makes sure the move is safe WRT
-          // ins->CanBeMoved which for NewInstance is false.
-          ins->MoveBefore(blk->GetFirstInstruction(), /*do_checks=*/false);
-        }
-      }
-    }
-  }
-
- private:
-  void CollectInterestingHeapRefs() {
-    // Get all the partials we need to move around.
-    for (size_t i = 0; i < lse_->heap_location_collector_.GetNumberOfHeapLocations(); ++i) {
-      ReferenceInfo* ri = lse_->heap_location_collector_.GetHeapLocation(i)->GetReferenceInfo();
-      if (ri->IsPartialSingleton() &&
-          ri->GetReference()->GetBlock() != nullptr &&
-          ri->GetNoEscapeSubgraph()->ContainsBlock(ri->GetReference()->GetBlock())) {
-        RecordHeapRefField(ri->GetReference()->AsNewInstance(), i);
-      }
-    }
-  }
-
-  void RecordHeapRefField(HNewInstance* ni, size_t loc) {
-    DCHECK(ni != nullptr);
-    // This is likely to be very short so just do a linear search.
-    auto it = std::find_if(heap_refs_.begin(), heap_refs_.end(), [&](HeapReferenceData& data) {
-      return data.OriginalNewInstance() == ni;
-    });
-    HeapReferenceData& cur_ref =
-        (it == heap_refs_.end())
-            ? heap_refs_.emplace_back(this,
-                                      ni,
-                                      lse_->heap_location_collector_.GetHeapLocation(loc)
-                                          ->GetReferenceInfo()
-                                          ->GetNoEscapeSubgraph(),
-                                      alloc_)
-            : *it;
-    cur_ref.AddHeapLocation(loc);
-  }
-
-
-  void NotifyNewMaterialization(HInstruction* ins) {
-    if (ins->IsPhi()) {
-      new_ref_phis_.push_back(ins->AsPhi());
-    }
-  }
-
-  size_t GetMaterializationBlockIndex(HBasicBlock* blk, size_t pred_num) const {
-    DCHECK_LT(blk->GetBlockId(), first_materialization_block_id_)
-        << "block is a materialization block!";
-    DCHECK_LT(pred_num, max_preds_per_block_);
-    return blk->GetBlockId() * max_preds_per_block_ + pred_num;
-  }
-
-  HGraph* GetGraph() const {
-    return lse_->GetGraph();
-  }
-
-  LSEVisitor* lse_;
-  ScopedArenaAllocator* alloc_;
-  ScopedArenaVector<HInstruction*> new_ref_phis_;
-  ScopedArenaVector<HeapReferenceData> heap_refs_;
-  size_t max_preds_per_block_;
-  // An array of (# of non-materialization blocks) * max_preds_per_block
-  // arranged in block-id major order. Since we can only have at most one
-  // materialization block on each edge this is the maximum possible number of
-  // materialization blocks.
-  ScopedArenaVector<HBasicBlock*> materialization_blocks_;
-  size_t first_materialization_block_id_;
-
-  friend void LSEVisitor::MovePartialEscapes();
-};
-
-// Work around c++ type checking annoyances with not being able to forward-declare inner types.
-class HeapRefHolder
-    : public std::reference_wrapper<PartialLoadStoreEliminationHelper::HeapReferenceData> {};
-
-HInstruction* LSEVisitor::SetupPartialMaterialization(PartialLoadStoreEliminationHelper& helper,
-                                                      HeapRefHolder&& holder,
-                                                      size_t pred_idx,
-                                                      HBasicBlock* entry) {
-  PartialLoadStoreEliminationHelper::HeapReferenceData& ref_data = holder.get();
-  HBasicBlock* old_pred = entry->GetPredecessors()[pred_idx];
-  HInstruction* new_inst = ref_data.OriginalNewInstance();
-  if (UNLIKELY(!new_inst->GetBlock()->Dominates(entry))) {
-    LSE_VLOG << "Initial materialization in non-dominating block " << entry->GetBlockId()
-             << " is null!";
-    return GetGraph()->GetNullConstant();
-  }
-  HBasicBlock* bb = helper.GetOrCreateMaterializationBlock(entry, pred_idx);
-  CHECK(bb != nullptr) << "entry " << entry->GetBlockId() << " -> " << old_pred->GetBlockId();
-  HNewInstance* repl_create = new_inst->Clone(GetGraph()->GetAllocator())->AsNewInstance();
-  repl_create->SetPartialMaterialization();
-  bb->InsertInstructionBefore(repl_create, bb->GetLastInstruction());
-  repl_create->CopyEnvironmentFrom(new_inst->GetEnvironment());
-  MaybeRecordStat(stats_, MethodCompilationStat::kPartialAllocationMoved);
-  LSE_VLOG << "In blk " << bb->GetBlockId() << " initial materialization is " << *repl_create;
-  ref_data.AddMaterialization(bb, repl_create);
-  const FieldInfo* info = nullptr;
-  for (const HeapLocation* loc : ref_data.IterateLocations()) {
-    size_t loc_off = heap_location_collector_.GetHeapLocationIndex(loc);
-    info = field_infos_[loc_off];
-    DCHECK(loc->GetIndex() == nullptr);
-    Value value = ReplacementOrValue(heap_values_for_[old_pred->GetBlockId()][loc_off].value);
-    if (value.NeedsLoopPhi() || value.IsMergedUnknown()) {
-      Value repl = phi_placeholder_replacements_[PhiPlaceholderIndex(value.GetPhiPlaceholder())];
-      DCHECK(repl.IsDefault() || repl.IsInvalid() || repl.IsInstruction())
-          << repl << " from " << value << " pred is " << old_pred->GetBlockId();
-      if (!repl.IsInvalid()) {
-        value = repl;
-      } else {
-        FullyMaterializePhi(value.GetPhiPlaceholder(), info->GetFieldType());
-        value = phi_placeholder_replacements_[PhiPlaceholderIndex(value.GetPhiPlaceholder())];
-      }
-    } else if (value.NeedsNonLoopPhi()) {
-      Value repl = phi_placeholder_replacements_[PhiPlaceholderIndex(value.GetPhiPlaceholder())];
-      DCHECK(repl.IsDefault() || repl.IsInvalid() || repl.IsInstruction())
-          << repl << " from " << value << " pred is " << old_pred->GetBlockId();
-      if (!repl.IsInvalid()) {
-        value = repl;
-      } else {
-        MaterializeNonLoopPhis(value.GetPhiPlaceholder(), info->GetFieldType());
-        value = phi_placeholder_replacements_[PhiPlaceholderIndex(value.GetPhiPlaceholder())];
-      }
-    }
-    DCHECK(value.IsDefault() || value.IsInstruction())
-        << GetGraph()->PrettyMethod() << ": " << value;
-
-    if (!value.IsDefault() &&
-        // shadow$_klass_ doesn't need to be manually initialized.
-        MemberOffset(loc->GetOffset()) != mirror::Object::ClassOffset()) {
-      CHECK(info != nullptr);
-      HInstruction* set_value =
-          new (GetGraph()->GetAllocator()) HInstanceFieldSet(repl_create,
-                                                             value.GetInstruction(),
-                                                             field_infos_[loc_off]->GetField(),
-                                                             loc->GetType(),
-                                                             MemberOffset(loc->GetOffset()),
-                                                             false,
-                                                             field_infos_[loc_off]->GetFieldIndex(),
-                                                             loc->GetDeclaringClassDefIndex(),
-                                                             field_infos_[loc_off]->GetDexFile(),
-                                                             0u);
-      bb->InsertInstructionAfter(set_value, repl_create);
-      LSE_VLOG << "Adding " << *set_value << " for materialization setup!";
-    }
-  }
-  return repl_create;
-}
-
-HInstruction* LSEVisitor::GetPartialValueAt(HNewInstance* orig_new_inst, HInstruction* read) {
-  size_t loc = heap_location_collector_.GetFieldHeapLocation(orig_new_inst, &read->GetFieldInfo());
-  Value pred = ReplacementOrValue(intermediate_values_.find(read)->second);
-  LSE_VLOG << "using " << pred << " as default value for " << *read;
-  if (pred.IsInstruction()) {
-    return pred.GetInstruction();
-  } else if (pred.IsMergedUnknown() || pred.NeedsPhi()) {
-    FullyMaterializePhi(pred.GetPhiPlaceholder(),
-                        heap_location_collector_.GetHeapLocation(loc)->GetType());
-    HInstruction* res = Replacement(pred).GetInstruction();
-    LSE_VLOG << pred << " materialized to " << res->DumpWithArgs();
-    return res;
-  } else if (pred.IsDefault()) {
-    HInstruction* res = GetDefaultValue(read->GetType());
-    LSE_VLOG << pred << " materialized to " << res->DumpWithArgs();
-    return res;
-  }
-  LOG(FATAL) << "Unable to find unescaped value at " << read->DumpWithArgs()
-             << "! This should be impossible! Value is " << pred;
-  UNREACHABLE();
-}
-
-void LSEVisitor::MovePartialEscapes() {
-  if (!ShouldPerformPartialLSE()) {
-    return;
-  }
-
-  ScopedArenaAllocator saa(allocator_.GetArenaStack());
-  PartialLoadStoreEliminationHelper helper(this, &saa);
-
-  // Since for PHIs we now will have more information (since we know the object
-  // hasn't escaped) we need to clear the old phi-replacements where we weren't
-  // able to find the value.
-  PrepareForPartialPhiComputation();
-
-  for (PartialLoadStoreEliminationHelper::HeapReferenceData& ref_data : helper.GetHeapRefs()) {
-    LSE_VLOG << "Creating materializations for " << *ref_data.OriginalNewInstance();
-    // Setup entry and exit blocks.
-    for (const auto& excluded_cohort : ref_data.GetNoEscapeSubgraph()->GetExcludedCohorts()) {
-      // Setup materialization blocks.
-      for (HBasicBlock* entry : excluded_cohort.EntryBlocksReversePostOrder()) {
-        // Setup entries.
-        // TODO Assuming we correctly break critical edges every entry block
-        // must have only a single predecessor so we could just put all this
-        // stuff in there. OTOH simplifier can do it for us and this is simpler
-        // to implement - giving clean separation between the original graph and
-        // materialization blocks - so for now we might as well have these new
-        // blocks.
-        ScopedArenaAllocator pred_alloc(saa.GetArenaStack());
-        ScopedArenaVector<HInstruction*> pred_vals(pred_alloc.Adapter(kArenaAllocLSE));
-        pred_vals.reserve(entry->GetNumberOfPredecessors());
-        for (const auto& [pred, pred_idx] :
-             ZipCount(MakeIterationRange(entry->GetPredecessors()))) {
-          DCHECK(!helper.IsMaterializationBlock(pred));
-          if (excluded_cohort.IsEntryBlock(pred)) {
-            pred_vals.push_back(ref_data.GetMaterialization(pred));
-            continue;
-          } else {
-            pred_vals.push_back(SetupPartialMaterialization(helper, {ref_data}, pred_idx, entry));
-          }
-        }
-        ref_data.GenerateMaterializationValueFromPredecessorsForEntry(entry, pred_vals);
-      }
-
-      // Setup exit block heap-values for later phi-generation.
-      for (HBasicBlock* exit : excluded_cohort.ExitBlocks()) {
-        // mark every exit of cohorts as having a value so we can easily
-        // materialize the PHIs.
-        // TODO By setting this we can easily use the normal MaterializeLoopPhis
-        //      (via FullyMaterializePhis) in order to generate the default-values
-        //      for predicated-gets. This has the unfortunate side effect of creating
-        //      somewhat more phis than are really needed (in some cases). We really
-        //      should try to eventually know that we can lower these PHIs to only
-        //      the non-escaping value in cases where it is possible. Currently this
-        //      is done to some extent in instruction_simplifier but we have more
-        //      information here to do the right thing.
-        for (const HeapLocation* loc : ref_data.IterateLocations()) {
-          size_t loc_off = heap_location_collector_.GetHeapLocationIndex(loc);
-          // This Value::Default() is only used to fill in PHIs used as the
-          // default value for PredicatedInstanceFieldGets. The actual value
-          // stored there is meaningless since the Predicated-iget will use the
-          // actual field value instead on these paths.
-          heap_values_for_[exit->GetBlockId()][loc_off].value = Value::Default();
-        }
-      }
-    }
-
-    // string materialization through the graph.
-    // // Visit RPO to PHI the materialized object through the cohort.
-    for (HBasicBlock* blk : GetGraph()->GetReversePostOrder()) {
-      // NB This doesn't include materialization blocks.
-      DCHECK(!helper.IsMaterializationBlock(blk))
-          << "Materialization blocks should not be in RPO yet.";
-      if (ref_data.HasMaterialization(blk)) {
-        continue;
-      } else if (ref_data.BeforeAllEscapes(blk)) {
-        ref_data.AddMaterialization(blk, GetGraph()->GetNullConstant());
-        continue;
-      } else {
-        ref_data.GenerateMaterializationValueFromPredecessors(blk);
-      }
-    }
-  }
-
-  // Once we've generated all the materializations we can update the users.
-  helper.FixupPartialObjectUsers();
-
-  // Actually put materialization blocks into the graph
-  helper.InsertMaterializationBlocks();
-
-  // Get rid of the original instructions.
-  helper.RemoveReplacedInstructions();
-
-  // Ensure everything is ordered correctly in the materialization blocks. This
-  // involves moving every NewInstance to the top and ordering them so that any
-  // required env-uses are correctly ordered.
-  helper.ReorderMaterializationsForEnvDominance();
-}
 
 void LSEVisitor::FinishFullLSE() {
   // Remove recorded load instructions that should be eliminated.
@@ -3970,14 +2861,22 @@
 
     load->ReplaceWith(substitute);
     load->GetBlock()->RemoveInstruction(load);
+    if ((load->IsInstanceFieldGet() && load->AsInstanceFieldGet()->IsVolatile()) ||
+        (load->IsStaticFieldGet() && load->AsStaticFieldGet()->IsVolatile())) {
+      MaybeRecordStat(stats_, MethodCompilationStat::kRemovedVolatileLoad);
+    }
   }
 
   // Remove all the stores we can.
   for (const LoadStoreRecord& record : loads_and_stores_) {
-    bool is_store = record.load_or_store->GetSideEffects().DoesAnyWrite();
-    DCHECK_EQ(is_store, IsStore(record.load_or_store));
-    if (is_store && !kept_stores_.IsBitSet(record.load_or_store->GetId())) {
+    if (IsStore(record.load_or_store) && !kept_stores_.IsBitSet(record.load_or_store->GetId())) {
       record.load_or_store->GetBlock()->RemoveInstruction(record.load_or_store);
+      if ((record.load_or_store->IsInstanceFieldSet() &&
+           record.load_or_store->AsInstanceFieldSet()->IsVolatile()) ||
+          (record.load_or_store->IsStaticFieldSet() &&
+           record.load_or_store->AsStaticFieldSet()->IsVolatile())) {
+        MaybeRecordStat(stats_, MethodCompilationStat::kRemovedVolatileStore);
+      }
     }
   }
 
@@ -4004,9 +2903,8 @@
  public:
   LSEVisitorWrapper(HGraph* graph,
                     const HeapLocationCollector& heap_location_collector,
-                    bool perform_partial_lse,
                     OptimizingCompilerStats* stats)
-      : lse_visitor_(graph, heap_location_collector, perform_partial_lse, stats) {}
+      : lse_visitor_(graph, heap_location_collector, stats) {}
 
   void Run() {
     lse_visitor_.Run();
@@ -4016,24 +2914,14 @@
   LSEVisitor lse_visitor_;
 };
 
-bool LoadStoreElimination::Run(bool enable_partial_lse) {
+bool LoadStoreElimination::Run() {
   if (graph_->IsDebuggable()) {
     // Debugger may set heap values or trigger deoptimization of callers.
     // Skip this optimization.
     return false;
   }
-  // We need to be able to determine reachability. Clear it just to be safe but
-  // this should initially be empty.
-  graph_->ClearReachabilityInformation();
-  // This is O(blocks^3) time complexity. It means we can query reachability in
-  // O(1) though.
-  graph_->ComputeReachabilityInformation();
   ScopedArenaAllocator allocator(graph_->GetArenaStack());
-  LoadStoreAnalysis lsa(graph_,
-                        stats_,
-                        &allocator,
-                        enable_partial_lse ? LoadStoreAnalysisType::kFull
-                                           : LoadStoreAnalysisType::kBasic);
+  LoadStoreAnalysis lsa(graph_, stats_, &allocator);
   lsa.Run();
   const HeapLocationCollector& heap_location_collector = lsa.GetHeapLocationCollector();
   if (heap_location_collector.GetNumberOfHeapLocations() == 0) {
@@ -4041,8 +2929,15 @@
     return false;
   }
 
-  std::unique_ptr<LSEVisitorWrapper> lse_visitor(new (&allocator) LSEVisitorWrapper(
-      graph_, heap_location_collector, enable_partial_lse, stats_));
+  // Currently load_store analysis can't handle predicated load/stores; specifically pairs of
+  // memory operations with different predicates.
+  // TODO: support predicated SIMD.
+  if (graph_->HasPredicatedSIMD()) {
+    return false;
+  }
+
+  std::unique_ptr<LSEVisitorWrapper> lse_visitor(
+      new (&allocator) LSEVisitorWrapper(graph_, heap_location_collector, stats_));
   lse_visitor->Run();
   return true;
 }
diff --git a/compiler/optimizing/load_store_elimination.h b/compiler/optimizing/load_store_elimination.h
index 42de803..e771685 100644
--- a/compiler/optimizing/load_store_elimination.h
+++ b/compiler/optimizing/load_store_elimination.h
@@ -26,10 +26,6 @@
 
 class LoadStoreElimination : public HOptimization {
  public:
-  // Whether or not we should attempt partial Load-store-elimination which
-  // requires additional blocks and predicated instructions.
-  static constexpr bool kEnablePartialLSE = false;
-
   // Controls whether to enable VLOG(compiler) logs explaining the transforms taking place.
   static constexpr bool kVerboseLoggingMode = false;
 
@@ -38,12 +34,7 @@
                        const char* name = kLoadStoreEliminationPassName)
       : HOptimization(graph, name, stats) {}
 
-  bool Run() override {
-    return Run(kEnablePartialLSE);
-  }
-
-  // Exposed for testing.
-  bool Run(bool enable_partial_lse);
+  bool Run();
 
   static constexpr const char* kLoadStoreEliminationPassName = "load_store_elimination";
 
diff --git a/compiler/optimizing/load_store_elimination_test.cc b/compiler/optimizing/load_store_elimination_test.cc
index 1ee1099..0775051 100644
--- a/compiler/optimizing/load_store_elimination_test.cc
+++ b/compiler/optimizing/load_store_elimination_test.cc
@@ -68,47 +68,27 @@
     }
   }
 
-  void PerformLSE(bool with_partial = true) {
+  void PerformLSE() {
     graph_->BuildDominatorTree();
     LoadStoreElimination lse(graph_, /*stats=*/nullptr);
-    lse.Run(with_partial);
+    lse.Run();
     std::ostringstream oss;
     EXPECT_TRUE(CheckGraph(oss)) << oss.str();
   }
 
-  void PerformLSEWithPartial(const AdjacencyListGraph& blks) {
-    // PerformLSE expects this to be empty.
+  void PerformLSE(const AdjacencyListGraph& blks) {
+    // PerformLSE expects this to be empty, and the creation of
+    // an `AdjacencyListGraph` computes it.
     graph_->ClearDominanceInformation();
     if (kDebugLseTests) {
       LOG(INFO) << "Pre LSE " << blks;
     }
-    PerformLSE(/*with_partial=*/ true);
+    PerformLSE();
     if (kDebugLseTests) {
       LOG(INFO) << "Post LSE " << blks;
     }
   }
 
-  void PerformLSENoPartial(const AdjacencyListGraph& blks) {
-    // PerformLSE expects this to be empty.
-    graph_->ClearDominanceInformation();
-    if (kDebugLseTests) {
-      LOG(INFO) << "Pre LSE " << blks;
-    }
-    PerformLSE(/*with_partial=*/ false);
-    if (kDebugLseTests) {
-      LOG(INFO) << "Post LSE " << blks;
-    }
-  }
-
-  void PerformSimplifications(const AdjacencyListGraph& blks) {
-    InstructionSimplifier simp(graph_, /*codegen=*/nullptr);
-    simp.Run();
-
-    if (kDebugLseTests) {
-      LOG(INFO) << "Post simplification " << blks;
-    }
-  }
-
   // Create instructions shared among tests.
   void CreateEntryBlockInstructions() {
     HInstruction* c1 = graph_->GetIntConstant(1);
@@ -327,190 +307,6 @@
   }
 }
 
-class OrderDependentTestGroup
-    : public LoadStoreEliminationTestBase<CommonCompilerTestWithParam<TestOrder>> {};
-
-// Various configs we can use for testing. Currently used in PartialComparison tests.
-struct PartialComparisonKind {
- public:
-  enum class Type : uint8_t { kEquals, kNotEquals };
-  enum class Target : uint8_t { kNull, kValue, kSelf };
-  enum class Position : uint8_t { kLeft, kRight };
-
-  const Type type_;
-  const Target target_;
-  const Position position_;
-
-  bool IsDefinitelyFalse() const {
-    return !IsPossiblyTrue();
-  }
-  bool IsPossiblyFalse() const {
-    return !IsDefinitelyTrue();
-  }
-  bool IsDefinitelyTrue() const {
-    if (target_ == Target::kSelf) {
-      return type_ == Type::kEquals;
-    } else if (target_ == Target::kNull) {
-      return type_ == Type::kNotEquals;
-    } else {
-      return false;
-    }
-  }
-  bool IsPossiblyTrue() const {
-    if (target_ == Target::kSelf) {
-      return type_ == Type::kEquals;
-    } else if (target_ == Target::kNull) {
-      return type_ == Type::kNotEquals;
-    } else {
-      return true;
-    }
-  }
-  std::ostream& Dump(std::ostream& os) const {
-    os << "PartialComparisonKind{" << (type_ == Type::kEquals ? "kEquals" : "kNotEquals") << ", "
-       << (target_ == Target::kNull ? "kNull" : (target_ == Target::kSelf ? "kSelf" : "kValue"))
-       << ", " << (position_ == Position::kLeft ? "kLeft" : "kRight") << "}";
-    return os;
-  }
-};
-
-std::ostream& operator<<(std::ostream& os, const PartialComparisonKind& comp) {
-  return comp.Dump(os);
-}
-
-class PartialComparisonTestGroup
-    : public LoadStoreEliminationTestBase<CommonCompilerTestWithParam<PartialComparisonKind>> {
- public:
-  enum class ComparisonPlacement {
-    kBeforeEscape,
-    kInEscape,
-    kAfterEscape,
-  };
-  void CheckFinalInstruction(HInstruction* ins, ComparisonPlacement placement) {
-    using Target = PartialComparisonKind::Target;
-    using Type = PartialComparisonKind::Type;
-    using Position = PartialComparisonKind::Position;
-    PartialComparisonKind kind = GetParam();
-    if (ins->IsIntConstant()) {
-      if (kind.IsDefinitelyTrue()) {
-        EXPECT_TRUE(ins->AsIntConstant()->IsTrue()) << kind << " " << *ins;
-      } else if (kind.IsDefinitelyFalse()) {
-        EXPECT_TRUE(ins->AsIntConstant()->IsFalse()) << kind << " " << *ins;
-      } else {
-        EXPECT_EQ(placement, ComparisonPlacement::kBeforeEscape);
-        EXPECT_EQ(kind.target_, Target::kValue);
-        // We are before escape so value is not the object
-        if (kind.type_ == Type::kEquals) {
-          EXPECT_TRUE(ins->AsIntConstant()->IsFalse()) << kind << " " << *ins;
-        } else {
-          EXPECT_TRUE(ins->AsIntConstant()->IsTrue()) << kind << " " << *ins;
-        }
-      }
-      return;
-    }
-    EXPECT_NE(placement, ComparisonPlacement::kBeforeEscape)
-        << "For comparisons before escape we should always be able to transform into a constant."
-        << " Instead we got:" << std::endl << ins->DumpWithArgs();
-    if (placement == ComparisonPlacement::kInEscape) {
-      // Should be the same type.
-      ASSERT_TRUE(ins->IsEqual() || ins->IsNotEqual()) << *ins;
-      HInstruction* other = kind.position_ == Position::kLeft ? ins->AsBinaryOperation()->GetRight()
-                                                              : ins->AsBinaryOperation()->GetLeft();
-      if (kind.target_ == Target::kSelf) {
-        EXPECT_INS_EQ(ins->AsBinaryOperation()->GetLeft(), ins->AsBinaryOperation()->GetRight())
-            << " ins is: " << *ins;
-      } else if (kind.target_ == Target::kNull) {
-        EXPECT_INS_EQ(other, graph_->GetNullConstant()) << " ins is: " << *ins;
-      } else {
-        EXPECT_TRUE(other->IsStaticFieldGet()) << " ins is: " << *ins;
-      }
-      if (kind.type_ == Type::kEquals) {
-        EXPECT_TRUE(ins->IsEqual()) << *ins;
-      } else {
-        EXPECT_TRUE(ins->IsNotEqual()) << *ins;
-      }
-    } else {
-      ASSERT_EQ(placement, ComparisonPlacement::kAfterEscape);
-      if (kind.type_ == Type::kEquals) {
-        // obj == <anything> can only be true if (1) it's obj == obj or (2) obj has escaped.
-        ASSERT_TRUE(ins->IsAnd()) << ins->DumpWithArgs();
-        EXPECT_TRUE(ins->InputAt(1)->IsEqual()) << ins->DumpWithArgs();
-      } else {
-        // obj != <anything> is true if (2) obj has escaped.
-        ASSERT_TRUE(ins->IsOr()) << ins->DumpWithArgs();
-        EXPECT_TRUE(ins->InputAt(1)->IsNotEqual()) << ins->DumpWithArgs();
-      }
-      // Check the first part of AND is the obj-has-escaped
-      ASSERT_TRUE(ins->InputAt(0)->IsNotEqual()) << ins->DumpWithArgs();
-      EXPECT_TRUE(ins->InputAt(0)->InputAt(0)->IsPhi()) << ins->DumpWithArgs();
-      EXPECT_TRUE(ins->InputAt(0)->InputAt(1)->IsNullConstant()) << ins->DumpWithArgs();
-      // Check the second part of AND is the eq other
-      EXPECT_INS_EQ(ins->InputAt(1)->InputAt(kind.position_ == Position::kLeft ? 0 : 1),
-                    ins->InputAt(0)->InputAt(0))
-          << ins->DumpWithArgs();
-    }
-  }
-
-  struct ComparisonInstructions {
-    void AddSetup(HBasicBlock* blk) const {
-      for (HInstruction* i : setup_instructions_) {
-        blk->AddInstruction(i);
-      }
-    }
-
-    void AddEnvironment(HEnvironment* env) const {
-      for (HInstruction* i : setup_instructions_) {
-        if (i->NeedsEnvironment()) {
-          i->CopyEnvironmentFrom(env);
-        }
-      }
-    }
-
-    const std::vector<HInstruction*> setup_instructions_;
-    HInstruction* const cmp_;
-  };
-
-  ComparisonInstructions GetComparisonInstructions(HInstruction* partial) {
-    PartialComparisonKind kind = GetParam();
-    std::vector<HInstruction*> setup;
-    HInstruction* target_other;
-    switch (kind.target_) {
-      case PartialComparisonKind::Target::kSelf:
-        target_other = partial;
-        break;
-      case PartialComparisonKind::Target::kNull:
-        target_other = graph_->GetNullConstant();
-        break;
-      case PartialComparisonKind::Target::kValue: {
-        HInstruction* cls = MakeClassLoad();
-        HInstruction* static_read =
-            new (GetAllocator()) HStaticFieldGet(cls,
-                                                 /* field= */ nullptr,
-                                                 DataType::Type::kReference,
-                                                 /* field_offset= */ MemberOffset(40),
-                                                 /* is_volatile= */ false,
-                                                 /* field_idx= */ 0,
-                                                 /* declaring_class_def_index= */ 0,
-                                                 graph_->GetDexFile(),
-                                                 /* dex_pc= */ 0);
-        setup.push_back(cls);
-        setup.push_back(static_read);
-        target_other = static_read;
-        break;
-      }
-    }
-    HInstruction* target_left;
-    HInstruction* target_right;
-    std::tie(target_left, target_right) = kind.position_ == PartialComparisonKind::Position::kLeft
-                                              ? std::pair{partial, target_other}
-                                              : std::pair{target_other, partial};
-    HInstruction* cmp =
-        kind.type_ == PartialComparisonKind::Type::kEquals
-            ? static_cast<HInstruction*>(new (GetAllocator()) HEqual(target_left, target_right))
-            : static_cast<HInstruction*>(new (GetAllocator()) HNotEqual(target_left, target_right));
-    return {setup, cmp};
-  }
-};
-
 TEST_F(LoadStoreEliminationTest, ArrayGetSetElimination) {
   CreateTestControlFlowGraph();
 
@@ -573,7 +369,8 @@
   AddVecStore(entry_block_, array_, j_);
   HInstruction* vstore = AddVecStore(entry_block_, array_, i_);
 
-  graph_->SetHasSIMD(true);
+  // TODO: enable LSE for graphs with predicated SIMD.
+  graph_->SetHasTraditionalSIMD(true);
   PerformLSE();
 
   ASSERT_FALSE(IsRemoved(vstore));
@@ -589,7 +386,8 @@
   AddVecStore(entry_block_, array_, i_add1_);
   HInstruction* vstore = AddVecStore(entry_block_, array_, i_);
 
-  graph_->SetHasSIMD(true);
+  // TODO: enable LSE for graphs with predicated SIMD.
+  graph_->SetHasTraditionalSIMD(true);
   PerformLSE();
 
   ASSERT_FALSE(IsRemoved(vstore));
@@ -634,7 +432,8 @@
   AddArraySet(entry_block_, array_, i_, c1);
   HInstruction* vload5 = AddVecLoad(entry_block_, array_, i_);
 
-  graph_->SetHasSIMD(true);
+  // TODO: enable LSE for graphs with predicated SIMD.
+  graph_->SetHasTraditionalSIMD(true);
   PerformLSE();
 
   ASSERT_TRUE(IsRemoved(load1));
@@ -668,7 +467,8 @@
   // a[j] = 1;
   HInstruction* array_set = AddArraySet(return_block_, array_, j_, c1);
 
-  graph_->SetHasSIMD(true);
+  // TODO: enable LSE for graphs with predicated SIMD.
+  graph_->SetHasTraditionalSIMD(true);
   PerformLSE();
 
   ASSERT_TRUE(IsRemoved(array_set));
@@ -701,12 +501,13 @@
   // b[phi,phi+1,phi+2,phi+3] = a[phi,phi+1,phi+2,phi+3];
   AddVecStore(loop_, array_, phi_);
   HInstruction* vload = AddVecLoad(loop_, array_, phi_);
-  AddVecStore(loop_, array_b, phi_, vload->AsVecLoad());
+  AddVecStore(loop_, array_b, phi_, vload);
 
   // a[j] = 0;
   HInstruction* a_set = AddArraySet(return_block_, array_, j_, c0);
 
-  graph_->SetHasSIMD(true);
+  // TODO: enable LSE for graphs with predicated SIMD.
+  graph_->SetHasTraditionalSIMD(true);
   PerformLSE();
 
   ASSERT_TRUE(IsRemoved(vload));
@@ -740,12 +541,13 @@
   // b[phi,phi+1,phi+2,phi+3] = a[phi,phi+1,phi+2,phi+3];
   AddVecStore(loop_, array_, phi_);
   HInstruction* vload = AddVecLoad(loop_, array_, phi_);
-  AddVecStore(loop_, array_b, phi_, vload->AsVecLoad());
+  AddVecStore(loop_, array_b, phi_, vload);
 
   // x = a[j];
   HInstruction* load = AddArrayGet(return_block_, array_, j_);
 
-  graph_->SetHasSIMD(true);
+  // TODO: enable LSE for graphs with predicated SIMD.
+  graph_->SetHasTraditionalSIMD(true);
   PerformLSE();
 
   ASSERT_TRUE(IsRemoved(vload));
@@ -786,7 +588,8 @@
   // down: a[i,... i + 3] = [1,...1]
   HInstruction* vstore4 = AddVecStore(down, array_, i_, vdata);
 
-  graph_->SetHasSIMD(true);
+  // TODO: enable LSE for graphs with predicated SIMD.
+  graph_->SetHasTraditionalSIMD(true);
   PerformLSE();
 
   ASSERT_TRUE(IsRemoved(vstore2));
@@ -874,10 +677,11 @@
   //    a[i,... i + 3] = [1,...1]
   HInstruction* vstore1 = AddVecStore(loop_, array_a, phi_);
   HInstruction* vload = AddVecLoad(loop_, array_a, phi_);
-  HInstruction* vstore2 = AddVecStore(loop_, array_b, phi_, vload->AsVecLoad());
+  HInstruction* vstore2 = AddVecStore(loop_, array_b, phi_, vload);
   HInstruction* vstore3 = AddVecStore(loop_, array_a, phi_, vstore1->InputAt(2));
 
-  graph_->SetHasSIMD(true);
+  // TODO: enable LSE for graphs with predicated SIMD.
+  graph_->SetHasTraditionalSIMD(true);
   PerformLSE();
 
   ASSERT_FALSE(IsRemoved(vstore1));
@@ -963,9 +767,10 @@
   //    v = a[i,... i + 3]
   // array[0,... 3] = v
   HInstruction* vload = AddVecLoad(loop_, array_a, phi_);
-  HInstruction* vstore = AddVecStore(return_block_, array_, c0, vload->AsVecLoad());
+  HInstruction* vstore = AddVecStore(return_block_, array_, c0, vload);
 
-  graph_->SetHasSIMD(true);
+  // TODO: enable LSE for graphs with predicated SIMD.
+  graph_->SetHasTraditionalSIMD(true);
   PerformLSE();
 
   ASSERT_FALSE(IsRemoved(vload));
@@ -987,9 +792,10 @@
   // v = a[0,... 3]
   // array[0,... 3] = v
   HInstruction* vload = AddVecLoad(pre_header_, array_a, c0);
-  HInstruction* vstore = AddVecStore(return_block_, array_, c0, vload->AsVecLoad());
+  HInstruction* vstore = AddVecStore(return_block_, array_, c0, vload);
 
-  graph_->SetHasSIMD(true);
+  // TODO: enable LSE for graphs with predicated SIMD.
+  graph_->SetHasTraditionalSIMD(true);
   PerformLSE();
 
   ASSERT_FALSE(IsRemoved(vload));
@@ -1063,10 +869,11 @@
   // array[0] = v1
   HInstruction* vload = AddVecLoad(loop_, array_a, phi_);
   HInstruction* load = AddArrayGet(loop_, array_a, phi_);
-  HInstruction* vstore = AddVecStore(return_block_, array_, c0, vload->AsVecLoad());
+  HInstruction* vstore = AddVecStore(return_block_, array_, c0, vload);
   HInstruction* store = AddArraySet(return_block_, array_, c0, load);
 
-  graph_->SetHasSIMD(true);
+  // TODO: enable LSE for graphs with predicated SIMD.
+  graph_->SetHasTraditionalSIMD(true);
   PerformLSE();
 
   ASSERT_FALSE(IsRemoved(vload));
@@ -1094,10 +901,11 @@
   // array[0] = v1
   HInstruction* vload = AddVecLoad(pre_header_, array_a, c0);
   HInstruction* load = AddArrayGet(pre_header_, array_a, c0);
-  HInstruction* vstore = AddVecStore(return_block_, array_, c0, vload->AsVecLoad());
+  HInstruction* vstore = AddVecStore(return_block_, array_, c0, vload);
   HInstruction* store = AddArraySet(return_block_, array_, c0, load);
 
-  graph_->SetHasSIMD(true);
+  // TODO: enable LSE for graphs with predicated SIMD.
+  graph_->SetHasTraditionalSIMD(true);
   PerformLSE();
 
   ASSERT_FALSE(IsRemoved(vload));
@@ -1126,10 +934,11 @@
   // array[128,... 131] = v1
   HInstruction* vload1 = AddVecLoad(loop_, array_a, phi_);
   HInstruction* vload2 = AddVecLoad(loop_, array_a, phi_);
-  HInstruction* vstore1 = AddVecStore(return_block_, array_, c0, vload1->AsVecLoad());
-  HInstruction* vstore2 = AddVecStore(return_block_, array_, c128, vload2->AsVecLoad());
+  HInstruction* vstore1 = AddVecStore(return_block_, array_, c0, vload1);
+  HInstruction* vstore2 = AddVecStore(return_block_, array_, c128, vload2);
 
-  graph_->SetHasSIMD(true);
+  // TODO: enable LSE for graphs with predicated SIMD.
+  graph_->SetHasTraditionalSIMD(true);
   PerformLSE();
 
   ASSERT_FALSE(IsRemoved(vload1));
@@ -1157,10 +966,11 @@
   // array[128,... 131] = v1
   HInstruction* vload1 = AddVecLoad(pre_header_, array_a, c0);
   HInstruction* vload2 = AddVecLoad(pre_header_, array_a, c0);
-  HInstruction* vstore1 = AddVecStore(return_block_, array_, c0, vload1->AsVecLoad());
-  HInstruction* vstore2 = AddVecStore(return_block_, array_, c128, vload2->AsVecLoad());
+  HInstruction* vstore1 = AddVecStore(return_block_, array_, c0, vload1);
+  HInstruction* vstore2 = AddVecStore(return_block_, array_, c128, vload2);
 
-  graph_->SetHasSIMD(true);
+  // TODO: enable LSE for graphs with predicated SIMD.
+  graph_->SetHasTraditionalSIMD(true);
   PerformLSE();
 
   ASSERT_FALSE(IsRemoved(vload1));
@@ -2069,7 +1879,7 @@
 
   SetupExit(exit);
 
-  PerformLSENoPartial(blks);
+  PerformLSE(blks);
 
   EXPECT_INS_RETAINED(read_bottom);
   EXPECT_INS_RETAINED(write_c1);
@@ -2084,84 +1894,6 @@
 //   // LEFT
 //   obj.field = 1;
 //   call_func(obj);
-//   foo_r = obj.field
-// } else {
-//   // TO BE ELIMINATED
-//   obj.field = 2;
-//   // RIGHT
-//   // TO BE ELIMINATED
-//   foo_l = obj.field;
-// }
-// EXIT
-// return PHI(foo_l, foo_r)
-TEST_F(LoadStoreEliminationTest, PartialLoadElimination) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit_REAL",
-                                                 { { "entry", "left" },
-                                                   { "entry", "right" },
-                                                   { "left", "exit" },
-                                                   { "right", "exit" },
-                                                   { "exit", "exit_REAL" } }));
-  HBasicBlock* entry = blks.Get("entry");
-  HBasicBlock* left = blks.Get("left");
-  HBasicBlock* right = blks.Get("right");
-  HBasicBlock* exit = blks.Get("exit");
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c1 = graph_->GetIntConstant(1);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_left = MakeIFieldSet(new_inst, c1, MemberOffset(32));
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* read_left = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(16));
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(write_left);
-  left->AddInstruction(call_left);
-  left->AddInstruction(read_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c2, MemberOffset(16));
-  HInstruction* read_right = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(16));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(read_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* phi_final = MakePhi({read_left, read_right});
-  HInstruction* return_exit = new (GetAllocator()) HReturn(phi_final);
-  exit->AddPhi(phi_final->AsPhi());
-  exit->AddInstruction(return_exit);
-
-  // PerformLSE expects this to be empty.
-  graph_->ClearDominanceInformation();
-  PerformLSE();
-
-  ASSERT_TRUE(IsRemoved(read_right));
-  ASSERT_FALSE(IsRemoved(read_left));
-  ASSERT_FALSE(IsRemoved(phi_final));
-  ASSERT_TRUE(phi_final->GetInputs()[1] == c2);
-  ASSERT_TRUE(phi_final->GetInputs()[0] == read_left);
-  ASSERT_TRUE(IsRemoved(write_right));
-}
-
-// // ENTRY
-// obj = new Obj();
-// if (parameter_value) {
-//   // LEFT
-//   obj.field = 1;
-//   call_func(obj);
 //   // We don't know what obj.field is now we aren't able to eliminate the read below!
 // } else {
 //   // DO NOT ELIMINATE
@@ -2217,7 +1949,7 @@
   exit->AddInstruction(read_bottom);
   exit->AddInstruction(return_exit);
 
-  PerformLSENoPartial(blks);
+  PerformLSE(blks);
 
   EXPECT_INS_RETAINED(read_bottom) << *read_bottom;
   EXPECT_INS_RETAINED(write_right) << *write_right;
@@ -2308,7 +2040,7 @@
   exit->AddInstruction(read_bottom);
   exit->AddInstruction(return_exit);
 
-  PerformLSENoPartial(blks);
+  PerformLSE(blks);
 
   EXPECT_INS_RETAINED(read_bottom);
   EXPECT_INS_RETAINED(write_right_first);
@@ -2320,2090 +2052,6 @@
 // if (parameter_value) {
 //   // LEFT
 //   // DO NOT ELIMINATE
-//   escape(obj);
-//   obj.field = 1;
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   obj.field = 2;
-// }
-// EXIT
-// ELIMINATE
-// return obj.field
-TEST_F(LoadStoreEliminationTest, PartialLoadElimination2) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c1 = graph_->GetIntConstant(1);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* write_left = MakeIFieldSet(new_inst, c1, MemberOffset(32));
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left);
-  left->AddInstruction(write_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  // PerformLSE expects this to be empty.
-  graph_->ClearDominanceInformation();
-  PerformLSE();
-
-  EXPECT_INS_REMOVED(read_bottom);
-  EXPECT_INS_REMOVED(write_right);
-  EXPECT_INS_RETAINED(write_left);
-  EXPECT_INS_RETAINED(call_left);
-}
-
-template<typename Iter, typename Func>
-typename Iter::value_type FindOrNull(Iter begin, Iter end, Func func) {
-  static_assert(std::is_pointer_v<typename Iter::value_type>);
-  auto it = std::find_if(begin, end, func);
-  if (it == end) {
-    return nullptr;
-  } else {
-    return *it;
-  }
-}
-
-// // ENTRY
-// Obj new_inst = new Obj();
-// new_inst.foo = 12;
-// Obj obj;
-// Obj out;
-// int first;
-// if (param0) {
-//   // ESCAPE_ROUTE
-//   if (param1) {
-//     // LEFT_START
-//     if (param2) {
-//       // LEFT_LEFT
-//       obj = new_inst;
-//     } else {
-//       // LEFT_RIGHT
-//       obj = obj_param;
-//     }
-//     // LEFT_MERGE
-//     // technically the phi is enough to cause an escape but might as well be
-//     // thorough.
-//     // obj = phi[new_inst, param]
-//     escape(obj);
-//     out = obj;
-//   } else {
-//     // RIGHT
-//     out = obj_param;
-//   }
-//   // EXIT
-//   // Can't do anything with this since we don't have good tracking for the heap-locations
-//   // out = phi[param, phi[new_inst, param]]
-//   first = out.foo
-// } else {
-//   new_inst.foo = 15;
-//   first = 13;
-// }
-// // first = phi[out.foo, 13]
-// return first + new_inst.foo;
-TEST_F(LoadStoreEliminationTest, PartialPhiPropagation) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "escape_route"},
-                                                  {"entry", "noescape_route"},
-                                                  {"escape_route", "left"},
-                                                  {"escape_route", "right"},
-                                                  {"left", "left_left"},
-                                                  {"left", "left_right"},
-                                                  {"left_left", "left_merge"},
-                                                  {"left_right", "left_merge"},
-                                                  {"left_merge", "escape_end"},
-                                                  {"right", "escape_end"},
-                                                  {"escape_end", "breturn"},
-                                                  {"noescape_route", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-  GET_BLOCK(left_left);
-  GET_BLOCK(left_right);
-  GET_BLOCK(left_merge);
-  GET_BLOCK(escape_end);
-  GET_BLOCK(escape_route);
-  GET_BLOCK(noescape_route);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(escape_end, {left_merge, right});
-  EnsurePredecessorOrder(left_merge, {left_left, left_right});
-  EnsurePredecessorOrder(breturn, {escape_end, noescape_route});
-  HInstruction* param0 = MakeParam(DataType::Type::kBool);
-  HInstruction* param1 = MakeParam(DataType::Type::kBool);
-  HInstruction* param2 = MakeParam(DataType::Type::kBool);
-  HInstruction* obj_param = MakeParam(DataType::Type::kReference);
-  HInstruction* c12 = graph_->GetIntConstant(12);
-  HInstruction* c13 = graph_->GetIntConstant(13);
-  HInstruction* c15 = graph_->GetIntConstant(15);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* store = MakeIFieldSet(new_inst, c12, MemberOffset(32));
-  HInstruction* if_param0 = new (GetAllocator()) HIf(param0);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(store);
-  entry->AddInstruction(if_param0);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* store_noescape = MakeIFieldSet(new_inst, c15, MemberOffset(32));
-  noescape_route->AddInstruction(store_noescape);
-  noescape_route->AddInstruction(new (GetAllocator()) HGoto());
-
-  escape_route->AddInstruction(new (GetAllocator()) HIf(param1));
-
-  HInstruction* if_left = new (GetAllocator()) HIf(param2);
-  left->AddInstruction(if_left);
-
-  HInstruction* goto_left_left = new (GetAllocator()) HGoto();
-  left_left->AddInstruction(goto_left_left);
-
-  HInstruction* goto_left_right = new (GetAllocator()) HGoto();
-  left_right->AddInstruction(goto_left_right);
-
-  HPhi* left_phi = MakePhi({obj_param, new_inst});
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { left_phi });
-  HInstruction* goto_left_merge = new (GetAllocator()) HGoto();
-  left_merge->AddPhi(left_phi);
-  left_merge->AddInstruction(call_left);
-  left_merge->AddInstruction(goto_left_merge);
-  left_phi->SetCanBeNull(true);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(goto_right);
-
-  HPhi* escape_end_phi = MakePhi({left_phi, obj_param});
-  HInstruction* read_escape_end =
-      MakeIFieldGet(escape_end_phi, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* goto_escape_end = new (GetAllocator()) HGoto();
-  escape_end->AddPhi(escape_end_phi);
-  escape_end->AddInstruction(read_escape_end);
-  escape_end->AddInstruction(goto_escape_end);
-
-  HPhi* return_phi = MakePhi({read_escape_end, c13});
-  HInstruction* read_exit = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* add_exit = new (GetAllocator()) HAdd(DataType::Type::kInt32, return_phi, read_exit);
-  HInstruction* return_exit = new (GetAllocator()) HReturn(add_exit);
-  breturn->AddPhi(return_phi);
-  breturn->AddInstruction(read_exit);
-  breturn->AddInstruction(add_exit);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_);
-  std::vector<HPhi*> all_return_phis;
-  std::tie(all_return_phis) = FindAllInstructions<HPhi>(graph_, breturn);
-  EXPECT_EQ(all_return_phis.size(), 3u);
-  EXPECT_INS_RETAINED(return_phi);
-  EXPECT_TRUE(std::find(all_return_phis.begin(), all_return_phis.end(), return_phi) !=
-              all_return_phis.end());
-  HPhi* instance_phi =
-      FindOrNull(all_return_phis.begin(), all_return_phis.end(), [&](HPhi* phi) {
-        return phi != return_phi && phi->GetType() == DataType::Type::kReference;
-      });
-  ASSERT_NE(instance_phi, nullptr);
-  HPhi* value_phi = FindOrNull(all_return_phis.begin(), all_return_phis.end(), [&](HPhi* phi) {
-    return phi != return_phi && phi->GetType() == DataType::Type::kInt32;
-  });
-  ASSERT_NE(value_phi, nullptr);
-  EXPECT_INS_EQ(
-      instance_phi->InputAt(0),
-      FindSingleInstruction<HNewInstance>(graph_, escape_route->GetSinglePredecessor()));
-  // Check materialize block
-  EXPECT_INS_EQ(FindSingleInstruction<HInstanceFieldSet>(
-                    graph_, escape_route->GetSinglePredecessor())
-                    ->InputAt(1),
-                c12);
-
-  EXPECT_INS_EQ(instance_phi->InputAt(1), graph_->GetNullConstant());
-  EXPECT_INS_EQ(value_phi->InputAt(0), graph_->GetIntConstant(0));
-  EXPECT_INS_EQ(value_phi->InputAt(1), c15);
-  EXPECT_INS_REMOVED(store_noescape);
-  EXPECT_INS_EQ(pred_get->GetTarget(), instance_phi);
-  EXPECT_INS_EQ(pred_get->GetDefaultValue(), value_phi);
-}
-
-// // ENTRY
-// // To be moved
-// // NB Order important. By having alloc and store of obj1 before obj2 that
-// // ensure we'll build the materialization for obj1 first (just due to how
-// // we iterate.)
-// obj1 = new Obj();
-// obj2 = new Obj(); // has env[obj1]
-// // Swap the order of these
-// obj1.foo = param_obj1;
-// obj2.foo = param_obj2;
-// if (param1) {
-//   // LEFT
-//   obj2.foo = obj1;
-//   if (param2) {
-//     // LEFT_LEFT
-//     escape(obj2);
-//   } else {}
-// } else {}
-// return select(param3, obj1.foo, obj2.foo);
-// EXIT
-TEST_P(OrderDependentTestGroup, PredicatedUse) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "left_left"},
-                                                  {"left", "left_right"},
-                                                  {"left_left", "left_end"},
-                                                  {"left_right", "left_end"},
-                                                  {"left_end", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(right);
-  GET_BLOCK(left);
-  GET_BLOCK(left_left);
-  GET_BLOCK(left_right);
-  GET_BLOCK(left_end);
-#undef GET_BLOCK
-  TestOrder order = GetParam();
-  EnsurePredecessorOrder(breturn, {left_end, right});
-  EnsurePredecessorOrder(left_end, {left_left, left_right});
-  HInstruction* param1 = MakeParam(DataType::Type::kBool);
-  HInstruction* param2 = MakeParam(DataType::Type::kBool);
-  HInstruction* param3 = MakeParam(DataType::Type::kBool);
-  HInstruction* param_obj1 = MakeParam(DataType::Type::kReference);
-  HInstruction* param_obj2 = MakeParam(DataType::Type::kReference);
-
-  HInstruction* cls1 = MakeClassLoad();
-  HInstruction* cls2 = MakeClassLoad();
-  HInstruction* new_inst1 = MakeNewInstance(cls1);
-  HInstruction* new_inst2 = MakeNewInstance(cls2);
-  HInstruction* store1 = MakeIFieldSet(new_inst1, param_obj1, MemberOffset(32));
-  HInstruction* store2 = MakeIFieldSet(new_inst2, param_obj2, MemberOffset(32));
-  HInstruction* null_const = graph_->GetNullConstant();
-  HInstruction* if_inst = new (GetAllocator()) HIf(param1);
-  entry->AddInstruction(cls1);
-  entry->AddInstruction(cls2);
-  entry->AddInstruction(new_inst1);
-  entry->AddInstruction(new_inst2);
-  if (order == TestOrder::kSameAsAlloc) {
-    entry->AddInstruction(store1);
-    entry->AddInstruction(store2);
-  } else {
-    entry->AddInstruction(store2);
-    entry->AddInstruction(store1);
-  }
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls1, {});
-  cls2->CopyEnvironmentFrom(cls1->GetEnvironment());
-  new_inst1->CopyEnvironmentFrom(cls1->GetEnvironment());
-  new_inst2->CopyEnvironmentFrom(cls1->GetEnvironment());
-
-  // This is the escape of new_inst1
-  HInstruction* store_left = MakeIFieldSet(new_inst2, new_inst1, MemberOffset(32));
-  HInstruction* if_left = new (GetAllocator()) HIf(param2);
-  left->AddInstruction(store_left);
-  left->AddInstruction(if_left);
-
-  HInstruction* call_left_left = MakeInvoke(DataType::Type::kVoid, { new_inst2 });
-  HInstruction* goto_left_left = new (GetAllocator()) HGoto();
-  left_left->AddInstruction(call_left_left);
-  left_left->AddInstruction(goto_left_left);
-  call_left_left->CopyEnvironmentFrom(new_inst2->GetEnvironment());
-
-  left_right->AddInstruction(new (GetAllocator()) HGoto());
-  left_end->AddInstruction(new (GetAllocator()) HGoto());
-
-  right->AddInstruction(new (GetAllocator()) HGoto());
-
-  // Used to distinguish the pred-gets without having to dig through the
-  // multiple phi layers.
-  constexpr uint32_t kRead1DexPc = 10;
-  constexpr uint32_t kRead2DexPc = 20;
-  HInstruction* read1 =
-      MakeIFieldGet(new_inst1, DataType::Type::kReference, MemberOffset(32), kRead1DexPc);
-  read1->SetReferenceTypeInfo(
-      ReferenceTypeInfo::CreateUnchecked(graph_->GetHandleCache()->GetObjectClassHandle(), false));
-  HInstruction* read2 =
-      MakeIFieldGet(new_inst2, DataType::Type::kReference, MemberOffset(32), kRead2DexPc);
-  read2->SetReferenceTypeInfo(
-      ReferenceTypeInfo::CreateUnchecked(graph_->GetHandleCache()->GetObjectClassHandle(), false));
-  HInstruction* sel_return = new (GetAllocator()) HSelect(param3, read1, read2, 0);
-  HInstruction* return_exit = new (GetAllocator()) HReturn(sel_return);
-  breturn->AddInstruction(read1);
-  breturn->AddInstruction(read2);
-  breturn->AddInstruction(sel_return);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_RETAINED(call_left_left);
-  EXPECT_INS_REMOVED(read1);
-  EXPECT_INS_REMOVED(read2);
-  EXPECT_INS_REMOVED(new_inst1);
-  EXPECT_INS_REMOVED(new_inst2);
-  EXPECT_TRUE(new_inst1->GetUses().empty()) << *new_inst1 << " " << new_inst1->GetUses();
-  EXPECT_TRUE(new_inst2->GetUses().empty()) << *new_inst2 << " " << new_inst2->GetUses();
-  EXPECT_INS_RETAINED(sel_return);
-  // Make sure the selector is the same
-  EXPECT_INS_EQ(sel_return->InputAt(2), param3);
-  std::vector<HPredicatedInstanceFieldGet*> pred_gets;
-  std::tie(pred_gets) = FindAllInstructions<HPredicatedInstanceFieldGet>(graph_, breturn);
-  HPredicatedInstanceFieldGet* pred1 = FindOrNull(pred_gets.begin(), pred_gets.end(), [&](auto i) {
-    return i->GetDexPc() == kRead1DexPc;
-  });
-  HPredicatedInstanceFieldGet* pred2 = FindOrNull(pred_gets.begin(), pred_gets.end(), [&](auto i) {
-    return i->GetDexPc() == kRead2DexPc;
-  });
-  ASSERT_NE(pred1, nullptr);
-  ASSERT_NE(pred2, nullptr);
-  EXPECT_INS_EQ(sel_return->InputAt(0), pred2);
-  EXPECT_INS_EQ(sel_return->InputAt(1), pred1);
-  // Check targets
-  EXPECT_TRUE(pred1->GetTarget()->IsPhi()) << pred1->DumpWithArgs();
-  EXPECT_TRUE(pred2->GetTarget()->IsPhi()) << pred2->DumpWithArgs();
-  HInstruction* mat1 = FindSingleInstruction<HNewInstance>(graph_, left->GetSinglePredecessor());
-  HInstruction* mat2 =
-      FindSingleInstruction<HNewInstance>(graph_, left_left->GetSinglePredecessor());
-  EXPECT_INS_EQ(pred1->GetTarget()->InputAt(0), mat1);
-  EXPECT_INS_EQ(pred1->GetTarget()->InputAt(1), null_const);
-  EXPECT_TRUE(pred2->GetTarget()->InputAt(0)->IsPhi()) << pred2->DumpWithArgs();
-  EXPECT_INS_EQ(pred2->GetTarget()->InputAt(0)->InputAt(0), mat2);
-  EXPECT_INS_EQ(pred2->GetTarget()->InputAt(0)->InputAt(1), null_const);
-  EXPECT_INS_EQ(pred2->GetTarget()->InputAt(1), null_const);
-  // Check default values.
-  EXPECT_TRUE(pred1->GetDefaultValue()->IsPhi()) << pred1->DumpWithArgs();
-  EXPECT_TRUE(pred2->GetDefaultValue()->IsPhi()) << pred2->DumpWithArgs();
-  EXPECT_INS_EQ(pred1->GetDefaultValue()->InputAt(0), null_const);
-  EXPECT_INS_EQ(pred1->GetDefaultValue()->InputAt(1), param_obj1);
-  EXPECT_TRUE(pred2->GetDefaultValue()->InputAt(0)->IsPhi()) << pred2->DumpWithArgs();
-  EXPECT_INS_EQ(pred2->GetDefaultValue()->InputAt(0)->InputAt(0), null_const);
-  EXPECT_INS_EQ(pred2->GetDefaultValue()->InputAt(0)->InputAt(1), mat1);
-  EXPECT_INS_EQ(pred2->GetDefaultValue()->InputAt(1), param_obj2);
-}
-
-// // ENTRY
-// // To be moved
-// // NB Order important. By having alloc and store of obj1 before obj2 that
-// // ensure we'll build the materialization for obj1 first (just due to how
-// // we iterate.)
-// obj1 = new Obj();
-// obj.foo = 12;
-// obj2 = new Obj(); // has env[obj1]
-// obj2.foo = 15;
-// if (param1) {
-//   // LEFT
-//   // Need to update env to nullptr
-//   escape(obj1/2);
-//   if (param2) {
-//     // LEFT_LEFT
-//     escape(obj2/1);
-//   } else {}
-// } else {}
-// return obj1.foo + obj2.foo;
-// EXIT
-TEST_P(OrderDependentTestGroup, PredicatedEnvUse) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "left_left"},
-                                                  {"left", "left_right"},
-                                                  {"left_left", "left_end"},
-                                                  {"left_right", "left_end"},
-                                                  {"left_end", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(right);
-  GET_BLOCK(left);
-  GET_BLOCK(left_left);
-  GET_BLOCK(left_right);
-  GET_BLOCK(left_end);
-#undef GET_BLOCK
-  TestOrder order = GetParam();
-  EnsurePredecessorOrder(breturn, {left_end, right});
-  EnsurePredecessorOrder(left_end, {left_left, left_right});
-  HInstruction* param1 = MakeParam(DataType::Type::kBool);
-  HInstruction* param2 = MakeParam(DataType::Type::kBool);
-  HInstruction* c12 = graph_->GetIntConstant(12);
-  HInstruction* c15 = graph_->GetIntConstant(15);
-
-  HInstruction* cls1 = MakeClassLoad();
-  HInstruction* cls2 = MakeClassLoad();
-  HInstruction* new_inst1 = MakeNewInstance(cls1);
-  HInstruction* store1 = MakeIFieldSet(new_inst1, c12, MemberOffset(32));
-  HInstruction* new_inst2 = MakeNewInstance(cls2);
-  HInstruction* store2 = MakeIFieldSet(new_inst2, c15, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(param1);
-  entry->AddInstruction(cls1);
-  entry->AddInstruction(cls2);
-  entry->AddInstruction(new_inst1);
-  entry->AddInstruction(store1);
-  entry->AddInstruction(new_inst2);
-  entry->AddInstruction(store2);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls1, {});
-  cls2->CopyEnvironmentFrom(cls1->GetEnvironment());
-  new_inst1->CopyEnvironmentFrom(cls1->GetEnvironment());
-  ManuallyBuildEnvFor(new_inst2, {new_inst1});
-
-  HInstruction* first_inst = new_inst1;
-  HInstruction* second_inst = new_inst2;
-
-  if (order == TestOrder::kReverseOfAlloc) {
-    std::swap(first_inst, second_inst);
-  }
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { first_inst });
-  HInstruction* if_left = new (GetAllocator()) HIf(param2);
-  left->AddInstruction(call_left);
-  left->AddInstruction(if_left);
-  call_left->CopyEnvironmentFrom(new_inst2->GetEnvironment());
-
-  HInstruction* call_left_left = MakeInvoke(DataType::Type::kVoid, { second_inst });
-  HInstruction* goto_left_left = new (GetAllocator()) HGoto();
-  left_left->AddInstruction(call_left_left);
-  left_left->AddInstruction(goto_left_left);
-  call_left_left->CopyEnvironmentFrom(new_inst2->GetEnvironment());
-
-  left_right->AddInstruction(new (GetAllocator()) HGoto());
-  left_end->AddInstruction(new (GetAllocator()) HGoto());
-
-  right->AddInstruction(new (GetAllocator()) HGoto());
-
-  HInstruction* read1 = MakeIFieldGet(new_inst1, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* read2 = MakeIFieldGet(new_inst2, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* add_return = new (GetAllocator()) HAdd(DataType::Type::kInt32, read1, read2);
-  HInstruction* return_exit = new (GetAllocator()) HReturn(add_return);
-  breturn->AddInstruction(read1);
-  breturn->AddInstruction(read2);
-  breturn->AddInstruction(add_return);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  HNewInstance* moved_new_inst1;
-  HInstanceFieldSet* moved_set1;
-  HNewInstance* moved_new_inst2;
-  HInstanceFieldSet* moved_set2;
-  HBasicBlock* first_mat_block = left->GetSinglePredecessor();
-  HBasicBlock* second_mat_block = left_left->GetSinglePredecessor();
-  if (order == TestOrder::kReverseOfAlloc) {
-    std::swap(first_mat_block, second_mat_block);
-  }
-  std::tie(moved_new_inst1, moved_set1) =
-      FindSingleInstructions<HNewInstance, HInstanceFieldSet>(graph_, first_mat_block);
-  std::tie(moved_new_inst2, moved_set2) =
-      FindSingleInstructions<HNewInstance, HInstanceFieldSet>(graph_, second_mat_block);
-  std::vector<HPredicatedInstanceFieldGet*> pred_gets;
-  std::vector<HPhi*> phis;
-  std::tie(pred_gets, phis) = FindAllInstructions<HPredicatedInstanceFieldGet, HPhi>(graph_);
-  EXPECT_NE(moved_new_inst1, nullptr);
-  EXPECT_NE(moved_new_inst2, nullptr);
-  EXPECT_NE(moved_set1, nullptr);
-  EXPECT_NE(moved_set2, nullptr);
-  EXPECT_INS_EQ(moved_set1->InputAt(1), c12);
-  EXPECT_INS_EQ(moved_set2->InputAt(1), c15);
-  EXPECT_INS_RETAINED(call_left);
-  EXPECT_INS_RETAINED(call_left_left);
-  EXPECT_INS_REMOVED(store1);
-  EXPECT_INS_REMOVED(store2);
-  EXPECT_INS_REMOVED(read1);
-  EXPECT_INS_REMOVED(read2);
-  EXPECT_INS_EQ(moved_new_inst2->GetEnvironment()->GetInstructionAt(0),
-                order == TestOrder::kSameAsAlloc
-                    ? moved_new_inst1
-                    : static_cast<HInstruction*>(graph_->GetNullConstant()));
-}
-
-// // ENTRY
-// obj1 = new Obj1();
-// obj2 = new Obj2();
-// val1 = 3;
-// val2 = 13;
-// // The exact order the stores are written affects what the order we perform
-// // partial LSE on the values
-// obj1/2.field = val1/2;
-// obj2/1.field = val2/1;
-// if (parameter_value) {
-//   // LEFT
-//   escape(obj1);
-//   escape(obj2);
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   obj1.field = 2;
-//   obj2.field = 12;
-// }
-// EXIT
-// predicated-ELIMINATE
-// return obj1.field + obj2.field
-TEST_P(OrderDependentTestGroup, FieldSetOrderEnv) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  TestOrder order = GetParam();
-  EnsurePredecessorOrder(breturn, {left, right});
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c12 = graph_->GetIntConstant(12);
-  HInstruction* c13 = graph_->GetIntConstant(13);
-
-  HInstruction* cls1 = MakeClassLoad();
-  HInstruction* cls2 = MakeClassLoad();
-  HInstruction* new_inst1 = MakeNewInstance(cls1);
-  HInstruction* new_inst2 = MakeNewInstance(cls2);
-  HInstruction* write_entry1 = MakeIFieldSet(new_inst1, c3, MemberOffset(32));
-  HInstruction* write_entry2 = MakeIFieldSet(new_inst2, c13, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls1);
-  entry->AddInstruction(cls2);
-  entry->AddInstruction(new_inst1);
-  entry->AddInstruction(new_inst2);
-  if (order == TestOrder::kSameAsAlloc) {
-    entry->AddInstruction(write_entry1);
-    entry->AddInstruction(write_entry2);
-  } else {
-    entry->AddInstruction(write_entry2);
-    entry->AddInstruction(write_entry1);
-  }
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls1, {});
-  cls2->CopyEnvironmentFrom(cls1->GetEnvironment());
-  new_inst1->CopyEnvironmentFrom(cls1->GetEnvironment());
-  ManuallyBuildEnvFor(new_inst2, {new_inst1});
-
-  HInstruction* call_left1 = MakeInvoke(DataType::Type::kVoid, { new_inst1 });
-  HInstruction* call_left2 = MakeInvoke(DataType::Type::kVoid, { new_inst2 });
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left1);
-  left->AddInstruction(call_left2);
-  left->AddInstruction(goto_left);
-  call_left1->CopyEnvironmentFrom(cls1->GetEnvironment());
-  call_left2->CopyEnvironmentFrom(cls1->GetEnvironment());
-
-  HInstruction* write_right1 = MakeIFieldSet(new_inst1, c2, MemberOffset(32));
-  HInstruction* write_right2 = MakeIFieldSet(new_inst2, c12, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right1);
-  right->AddInstruction(write_right2);
-  right->AddInstruction(goto_right);
-
-  HInstruction* read_bottom1 = MakeIFieldGet(new_inst1, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* read_bottom2 = MakeIFieldGet(new_inst2, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* combine =
-      new (GetAllocator()) HAdd(DataType::Type::kInt32, read_bottom1, read_bottom2);
-  HInstruction* return_exit = new (GetAllocator()) HReturn(combine);
-  breturn->AddInstruction(read_bottom1);
-  breturn->AddInstruction(read_bottom2);
-  breturn->AddInstruction(combine);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_REMOVED(write_entry1);
-  EXPECT_INS_REMOVED(write_entry2);
-  EXPECT_INS_REMOVED(read_bottom1);
-  EXPECT_INS_REMOVED(read_bottom2);
-  EXPECT_INS_REMOVED(write_right1);
-  EXPECT_INS_REMOVED(write_right2);
-  EXPECT_INS_RETAINED(call_left1);
-  EXPECT_INS_RETAINED(call_left2);
-  std::vector<HPhi*> merges;
-  std::vector<HPredicatedInstanceFieldGet*> pred_gets;
-  std::vector<HNewInstance*> materializations;
-  std::tie(merges, pred_gets) =
-      FindAllInstructions<HPhi, HPredicatedInstanceFieldGet>(graph_, breturn);
-  std::tie(materializations) = FindAllInstructions<HNewInstance>(graph_);
-  ASSERT_EQ(merges.size(), 4u);
-  ASSERT_EQ(pred_gets.size(), 2u);
-  ASSERT_EQ(materializations.size(), 2u);
-  HPhi* merge_value_return1 = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kInt32 && p->InputAt(1) == c2;
-  });
-  HPhi* merge_value_return2 = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kInt32 && p->InputAt(1) == c12;
-  });
-  HNewInstance* mat_alloc1 = FindOrNull(materializations.begin(),
-                                        materializations.end(),
-                                        [&](HNewInstance* n) { return n->InputAt(0) == cls1; });
-  HNewInstance* mat_alloc2 = FindOrNull(materializations.begin(),
-                                        materializations.end(),
-                                        [&](HNewInstance* n) { return n->InputAt(0) == cls2; });
-  ASSERT_NE(mat_alloc1, nullptr);
-  ASSERT_NE(mat_alloc2, nullptr);
-  HPhi* merge_alloc1 = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kReference && p->InputAt(0) == mat_alloc1;
-  });
-  HPhi* merge_alloc2 = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kReference && p->InputAt(0) == mat_alloc2;
-  });
-  ASSERT_NE(merge_alloc1, nullptr);
-  HPredicatedInstanceFieldGet* pred_get1 =
-      FindOrNull(pred_gets.begin(), pred_gets.end(), [&](HPredicatedInstanceFieldGet* pg) {
-        return pg->GetTarget() == merge_alloc1;
-      });
-  ASSERT_NE(merge_alloc2, nullptr);
-  HPredicatedInstanceFieldGet* pred_get2 =
-      FindOrNull(pred_gets.begin(), pred_gets.end(), [&](HPredicatedInstanceFieldGet* pg) {
-        return pg->GetTarget() == merge_alloc2;
-      });
-  ASSERT_NE(merge_value_return1, nullptr);
-  ASSERT_NE(merge_value_return2, nullptr);
-  EXPECT_INS_EQ(merge_alloc1->InputAt(1), graph_->GetNullConstant());
-  EXPECT_INS_EQ(merge_alloc2->InputAt(1), graph_->GetNullConstant());
-  ASSERT_NE(pred_get1, nullptr);
-  EXPECT_INS_EQ(pred_get1->GetTarget(), merge_alloc1);
-  EXPECT_INS_EQ(pred_get1->GetDefaultValue(), merge_value_return1)
-      << " pred-get is: " << *pred_get1;
-  EXPECT_INS_EQ(merge_value_return1->InputAt(0), graph_->GetIntConstant(0))
-      << " merge val is: " << *merge_value_return1;
-  EXPECT_INS_EQ(merge_value_return1->InputAt(1), c2) << " merge val is: " << *merge_value_return1;
-  ASSERT_NE(pred_get2, nullptr);
-  EXPECT_INS_EQ(pred_get2->GetTarget(), merge_alloc2);
-  EXPECT_INS_EQ(pred_get2->GetDefaultValue(), merge_value_return2)
-      << " pred-get is: " << *pred_get2;
-  EXPECT_INS_EQ(merge_value_return2->InputAt(0), graph_->GetIntConstant(0))
-      << " merge val is: " << *merge_value_return1;
-  EXPECT_INS_EQ(merge_value_return2->InputAt(1), c12) << " merge val is: " << *merge_value_return1;
-  EXPECT_INS_EQ(mat_alloc2->GetEnvironment()->GetInstructionAt(0), mat_alloc1);
-}
-
-// // TODO We can compile this better if we are better able to understand lifetimes.
-// // ENTRY
-// obj1 = new Obj1();
-// obj2 = new Obj2();
-// // The exact order the stores are written affects what the order we perform
-// // partial LSE on the values
-// obj{1,2}.var = param_obj;
-// obj{2,1}.var = param_obj;
-// if (param_1) {
-//   // EARLY_RETURN
-//   return;
-// }
-// // escape of obj1
-// obj2.var = obj1;
-// if (param_2) {
-//   // escape of obj2 with a materialization that uses obj1
-//   escape(obj2);
-// }
-// // EXIT
-// return;
-TEST_P(OrderDependentTestGroup, MaterializationMovedUse) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "early_return"},
-                                                  {"early_return", "exit"},
-                                                  {"entry", "escape_1"},
-                                                  {"escape_1", "escape_2"},
-                                                  {"escape_1", "escape_1_crit_break"},
-                                                  {"escape_1_crit_break", "exit"},
-                                                  {"escape_2", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(early_return);
-  GET_BLOCK(escape_1);
-  GET_BLOCK(escape_1_crit_break);
-  GET_BLOCK(escape_2);
-#undef GET_BLOCK
-  TestOrder order = GetParam();
-  HInstruction* param_1 = MakeParam(DataType::Type::kBool);
-  HInstruction* param_2 = MakeParam(DataType::Type::kBool);
-  HInstruction* param_obj = MakeParam(DataType::Type::kReference);
-
-  HInstruction* cls1 = MakeClassLoad();
-  HInstruction* cls2 = MakeClassLoad();
-  HInstruction* new_inst1 = MakeNewInstance(cls1);
-  HInstruction* new_inst2 = MakeNewInstance(cls2);
-  HInstruction* write_entry1 = MakeIFieldSet(new_inst1, param_obj, MemberOffset(32));
-  HInstruction* write_entry2 = MakeIFieldSet(new_inst2, param_obj, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(param_1);
-  entry->AddInstruction(cls1);
-  entry->AddInstruction(cls2);
-  entry->AddInstruction(new_inst1);
-  entry->AddInstruction(new_inst2);
-  if (order == TestOrder::kSameAsAlloc) {
-    entry->AddInstruction(write_entry1);
-    entry->AddInstruction(write_entry2);
-  } else {
-    entry->AddInstruction(write_entry2);
-    entry->AddInstruction(write_entry1);
-  }
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls1, {});
-  cls2->CopyEnvironmentFrom(cls1->GetEnvironment());
-  new_inst1->CopyEnvironmentFrom(cls1->GetEnvironment());
-  new_inst2->CopyEnvironmentFrom(cls1->GetEnvironment());
-
-  early_return->AddInstruction(new (GetAllocator()) HReturnVoid());
-
-  HInstruction* escape_1_set = MakeIFieldSet(new_inst2, new_inst1, MemberOffset(32));
-  HInstruction* escape_1_if = new (GetAllocator()) HIf(param_2);
-  escape_1->AddInstruction(escape_1_set);
-  escape_1->AddInstruction(escape_1_if);
-
-  escape_1_crit_break->AddInstruction(new (GetAllocator()) HReturnVoid());
-
-  HInstruction* escape_2_call = MakeInvoke(DataType::Type::kVoid, {new_inst2});
-  HInstruction* escape_2_return = new (GetAllocator()) HReturnVoid();
-  escape_2->AddInstruction(escape_2_call);
-  escape_2->AddInstruction(escape_2_return);
-  escape_2_call->CopyEnvironmentFrom(cls1->GetEnvironment());
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_REMOVED(new_inst1);
-  EXPECT_INS_REMOVED(new_inst2);
-  EXPECT_INS_REMOVED(write_entry1);
-  EXPECT_INS_REMOVED(write_entry2);
-  EXPECT_INS_REMOVED(escape_1_set);
-  EXPECT_INS_RETAINED(escape_2_call);
-
-  HInstruction* obj1_mat =
-      FindSingleInstruction<HNewInstance>(graph_, escape_1->GetSinglePredecessor());
-  HInstruction* obj1_set =
-      FindSingleInstruction<HInstanceFieldSet>(graph_, escape_1->GetSinglePredecessor());
-  HInstruction* obj2_mat =
-      FindSingleInstruction<HNewInstance>(graph_, escape_2->GetSinglePredecessor());
-  HInstruction* obj2_set =
-      FindSingleInstruction<HInstanceFieldSet>(graph_, escape_2->GetSinglePredecessor());
-  ASSERT_TRUE(obj1_mat != nullptr);
-  ASSERT_TRUE(obj2_mat != nullptr);
-  ASSERT_TRUE(obj1_set != nullptr);
-  ASSERT_TRUE(obj2_set != nullptr);
-  EXPECT_INS_EQ(obj1_set->InputAt(0), obj1_mat);
-  EXPECT_INS_EQ(obj1_set->InputAt(1), param_obj);
-  EXPECT_INS_EQ(obj2_set->InputAt(0), obj2_mat);
-  EXPECT_INS_EQ(obj2_set->InputAt(1), obj1_mat);
-}
-
-INSTANTIATE_TEST_SUITE_P(LoadStoreEliminationTest,
-                         OrderDependentTestGroup,
-                         testing::Values(TestOrder::kSameAsAlloc, TestOrder::kReverseOfAlloc));
-
-// // ENTRY
-// // To be moved
-// obj = new Obj();
-// obj.foo = 12;
-// if (parameter_value) {
-//   // LEFT
-//   escape(obj);
-// } else {}
-// EXIT
-TEST_F(LoadStoreEliminationTest, MovePredicatedAlloc) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"right", "breturn"},
-                                                  {"left", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {left, right});
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c12 = graph_->GetIntConstant(12);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* store = MakeIFieldSet(new_inst, c12, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(store);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  right->AddInstruction(new (GetAllocator()) HGoto());
-
-  HInstruction* return_exit = new (GetAllocator()) HReturnVoid();
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  HNewInstance* moved_new_inst = nullptr;
-  HInstanceFieldSet* moved_set = nullptr;
-  std::tie(moved_new_inst, moved_set) =
-      FindSingleInstructions<HNewInstance, HInstanceFieldSet>(graph_);
-  EXPECT_NE(moved_new_inst, nullptr);
-  EXPECT_NE(moved_set, nullptr);
-  EXPECT_INS_RETAINED(call_left);
-  // store removed or moved.
-  EXPECT_NE(store->GetBlock(), entry);
-  // New-inst removed or moved.
-  EXPECT_NE(new_inst->GetBlock(), entry);
-  EXPECT_INS_EQ(moved_set->InputAt(0), moved_new_inst);
-  EXPECT_INS_EQ(moved_set->InputAt(1), c12);
-}
-
-// // ENTRY
-// // To be moved
-// obj = new Obj();
-// obj.foo = 12;
-// if (parameter_value) {
-//   // LEFT
-//   escape(obj);
-// }
-// EXIT
-// int a = obj.foo;
-// obj.foo = 13;
-// noescape();
-// int b = obj.foo;
-// obj.foo = 14;
-// noescape();
-// int c = obj.foo;
-// obj.foo = 15;
-// noescape();
-// return a + b + c
-TEST_F(LoadStoreEliminationTest, MutiPartialLoadStore) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"right", "breturn"},
-                                                  {"left", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {left, right});
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c12 = graph_->GetIntConstant(12);
-  HInstruction* c13 = graph_->GetIntConstant(13);
-  HInstruction* c14 = graph_->GetIntConstant(14);
-  HInstruction* c15 = graph_->GetIntConstant(15);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* store = MakeIFieldSet(new_inst, c12, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(store);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(goto_right);
-
-  HInstruction* a_val = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* a_reset = MakeIFieldSet(new_inst, c13, MemberOffset(32));
-  HInstruction* a_noescape = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* b_val = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* b_reset = MakeIFieldSet(new_inst, c14, MemberOffset(32));
-  HInstruction* b_noescape = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* c_val = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* c_reset = MakeIFieldSet(new_inst, c15, MemberOffset(32));
-  HInstruction* c_noescape = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* add_1_exit = new (GetAllocator()) HAdd(DataType::Type::kInt32, a_val, b_val);
-  HInstruction* add_2_exit = new (GetAllocator()) HAdd(DataType::Type::kInt32, c_val, add_1_exit);
-  HInstruction* return_exit = new (GetAllocator()) HReturn(add_2_exit);
-  breturn->AddInstruction(a_val);
-  breturn->AddInstruction(a_reset);
-  breturn->AddInstruction(a_noescape);
-  breturn->AddInstruction(b_val);
-  breturn->AddInstruction(b_reset);
-  breturn->AddInstruction(b_noescape);
-  breturn->AddInstruction(c_val);
-  breturn->AddInstruction(c_reset);
-  breturn->AddInstruction(c_noescape);
-  breturn->AddInstruction(add_1_exit);
-  breturn->AddInstruction(add_2_exit);
-  breturn->AddInstruction(return_exit);
-  ManuallyBuildEnvFor(a_noescape, {new_inst, a_val});
-  ManuallyBuildEnvFor(b_noescape, {new_inst, a_val, b_val});
-  ManuallyBuildEnvFor(c_noescape, {new_inst, a_val, b_val, c_val});
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  HNewInstance* moved_new_inst = nullptr;
-  HInstanceFieldSet* moved_set = nullptr;
-  std::tie(moved_new_inst, moved_set) =
-      FindSingleInstructions<HNewInstance, HInstanceFieldSet>(graph_, left->GetSinglePredecessor());
-  std::vector<HPredicatedInstanceFieldGet*> pred_gets;
-  std::vector<HInstanceFieldSet*> pred_sets;
-  std::vector<HPhi*> return_phis;
-  std::tie(return_phis, pred_gets, pred_sets) =
-      FindAllInstructions<HPhi, HPredicatedInstanceFieldGet, HInstanceFieldSet>(graph_, breturn);
-  ASSERT_EQ(return_phis.size(), 2u);
-  HPhi* inst_phi = return_phis[0];
-  HPhi* val_phi = return_phis[1];
-  if (inst_phi->GetType() != DataType::Type::kReference) {
-    std::swap(inst_phi, val_phi);
-  }
-  ASSERT_NE(moved_new_inst, nullptr);
-  EXPECT_INS_EQ(inst_phi->InputAt(0), moved_new_inst);
-  EXPECT_INS_EQ(inst_phi->InputAt(1), graph_->GetNullConstant());
-  EXPECT_INS_EQ(val_phi->InputAt(0), graph_->GetIntConstant(0));
-  EXPECT_EQ(val_phi->InputAt(1), c12);
-  ASSERT_EQ(pred_gets.size(), 3u);
-  ASSERT_EQ(pred_gets.size(), pred_sets.size());
-  std::vector<HInstruction*> set_values{c13, c14, c15};
-  std::vector<HInstruction*> get_values{val_phi, c13, c14};
-  ASSERT_NE(moved_set, nullptr);
-  EXPECT_INS_EQ(moved_set->InputAt(0), moved_new_inst);
-  EXPECT_INS_EQ(moved_set->InputAt(1), c12);
-  EXPECT_INS_RETAINED(call_left);
-  // store removed or moved.
-  EXPECT_NE(store->GetBlock(), entry);
-  // New-inst removed or moved.
-  EXPECT_NE(new_inst->GetBlock(), entry);
-  for (auto [get, val] : ZipLeft(MakeIterationRange(pred_gets), MakeIterationRange(get_values))) {
-    EXPECT_INS_EQ(get->GetDefaultValue(), val);
-  }
-  for (auto [set, val] : ZipLeft(MakeIterationRange(pred_sets), MakeIterationRange(set_values))) {
-    EXPECT_INS_EQ(set->InputAt(1), val);
-    EXPECT_TRUE(set->GetIsPredicatedSet()) << *set;
-  }
-  EXPECT_INS_RETAINED(a_noescape);
-  EXPECT_INS_RETAINED(b_noescape);
-  EXPECT_INS_RETAINED(c_noescape);
-  EXPECT_INS_EQ(add_1_exit->InputAt(0), pred_gets[0]);
-  EXPECT_INS_EQ(add_1_exit->InputAt(1), pred_gets[1]);
-  EXPECT_INS_EQ(add_2_exit->InputAt(0), pred_gets[2]);
-
-  EXPECT_EQ(a_noescape->GetEnvironment()->Size(), 2u);
-  EXPECT_INS_EQ(a_noescape->GetEnvironment()->GetInstructionAt(0), inst_phi);
-  EXPECT_INS_EQ(a_noescape->GetEnvironment()->GetInstructionAt(1), pred_gets[0]);
-  EXPECT_EQ(b_noescape->GetEnvironment()->Size(), 3u);
-  EXPECT_INS_EQ(b_noescape->GetEnvironment()->GetInstructionAt(0), inst_phi);
-  EXPECT_INS_EQ(b_noescape->GetEnvironment()->GetInstructionAt(1), pred_gets[0]);
-  EXPECT_INS_EQ(b_noescape->GetEnvironment()->GetInstructionAt(2), pred_gets[1]);
-  EXPECT_EQ(c_noescape->GetEnvironment()->Size(), 4u);
-  EXPECT_INS_EQ(c_noescape->GetEnvironment()->GetInstructionAt(0), inst_phi);
-  EXPECT_INS_EQ(c_noescape->GetEnvironment()->GetInstructionAt(1), pred_gets[0]);
-  EXPECT_INS_EQ(c_noescape->GetEnvironment()->GetInstructionAt(2), pred_gets[1]);
-  EXPECT_INS_EQ(c_noescape->GetEnvironment()->GetInstructionAt(3), pred_gets[2]);
-}
-
-// // ENTRY
-// // To be moved
-// obj = new Obj();
-// obj.foo = 12;
-// int a = obj.foo;
-// obj.foo = 13;
-// noescape();
-// int b = obj.foo;
-// obj.foo = 14;
-// noescape();
-// int c = obj.foo;
-// obj.foo = 15;
-// noescape();
-// if (parameter_value) {
-//   // LEFT
-//   escape(obj);
-// }
-// EXIT
-// return a + b + c + obj.foo
-TEST_F(LoadStoreEliminationTest, MutiPartialLoadStore2) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  // Need to have an actual entry block since we check env-layout and the way we
-  // add constants would screw this up otherwise.
-  AdjacencyListGraph blks(SetupFromAdjacencyList("start",
-                                                 "exit",
-                                                 {{"start", "entry"},
-                                                  {"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"right", "breturn"},
-                                                  {"left", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(start);
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {left, right});
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c12 = graph_->GetIntConstant(12);
-  HInstruction* c13 = graph_->GetIntConstant(13);
-  HInstruction* c14 = graph_->GetIntConstant(14);
-  HInstruction* c15 = graph_->GetIntConstant(15);
-
-  HInstruction* start_suspend = new (GetAllocator()) HSuspendCheck();
-  HInstruction* start_goto = new (GetAllocator()) HGoto();
-
-  start->AddInstruction(start_suspend);
-  start->AddInstruction(start_goto);
-  ManuallyBuildEnvFor(start_suspend, {});
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* store = MakeIFieldSet(new_inst, c12, MemberOffset(32));
-
-  HInstruction* a_val = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* a_reset = MakeIFieldSet(new_inst, c13, MemberOffset(32));
-  HInstruction* a_noescape = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* b_val = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* b_reset = MakeIFieldSet(new_inst, c14, MemberOffset(32));
-  HInstruction* b_noescape = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* c_val = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* c_reset = MakeIFieldSet(new_inst, c15, MemberOffset(32));
-  HInstruction* c_noescape = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(store);
-  entry->AddInstruction(a_val);
-  entry->AddInstruction(a_reset);
-  entry->AddInstruction(a_noescape);
-  entry->AddInstruction(b_val);
-  entry->AddInstruction(b_reset);
-  entry->AddInstruction(b_noescape);
-  entry->AddInstruction(c_val);
-  entry->AddInstruction(c_reset);
-  entry->AddInstruction(c_noescape);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-  ManuallyBuildEnvFor(a_noescape, {new_inst, a_val});
-  ManuallyBuildEnvFor(b_noescape, {new_inst, a_val, b_val});
-  ManuallyBuildEnvFor(c_noescape, {new_inst, a_val, b_val, c_val});
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(c_noescape->GetEnvironment());
-
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(goto_right);
-
-  HInstruction* val_exit = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* add_1_exit = new (GetAllocator()) HAdd(DataType::Type::kInt32, a_val, b_val);
-  HInstruction* add_2_exit = new (GetAllocator()) HAdd(DataType::Type::kInt32, c_val, add_1_exit);
-  HInstruction* add_3_exit =
-      new (GetAllocator()) HAdd(DataType::Type::kInt32, val_exit, add_2_exit);
-  HInstruction* return_exit = new (GetAllocator()) HReturn(add_3_exit);
-  breturn->AddInstruction(val_exit);
-  breturn->AddInstruction(add_1_exit);
-  breturn->AddInstruction(add_2_exit);
-  breturn->AddInstruction(add_3_exit);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  HNewInstance* moved_new_inst = nullptr;
-  HInstanceFieldSet* moved_set = nullptr;
-  std::tie(moved_new_inst, moved_set) =
-      FindSingleInstructions<HNewInstance, HInstanceFieldSet>(graph_, left->GetSinglePredecessor());
-  std::vector<HPredicatedInstanceFieldGet*> pred_gets;
-  std::vector<HInstanceFieldSet*> pred_sets;
-  std::vector<HPhi*> return_phis;
-  std::tie(return_phis, pred_gets, pred_sets) =
-      FindAllInstructions<HPhi, HPredicatedInstanceFieldGet, HInstanceFieldSet>(graph_, breturn);
-  ASSERT_EQ(return_phis.size(), 2u);
-  HPhi* inst_phi = return_phis[0];
-  HPhi* val_phi = return_phis[1];
-  if (inst_phi->GetType() != DataType::Type::kReference) {
-    std::swap(inst_phi, val_phi);
-  }
-  ASSERT_NE(moved_new_inst, nullptr);
-  EXPECT_INS_EQ(inst_phi->InputAt(0), moved_new_inst);
-  EXPECT_INS_EQ(inst_phi->InputAt(1), graph_->GetNullConstant());
-  EXPECT_INS_EQ(val_phi->InputAt(0), graph_->GetIntConstant(0));
-  EXPECT_INS_EQ(val_phi->InputAt(1), c15);
-  ASSERT_EQ(pred_gets.size(), 1u);
-  ASSERT_EQ(pred_sets.size(), 0u);
-  ASSERT_NE(moved_set, nullptr);
-  EXPECT_INS_EQ(moved_set->InputAt(0), moved_new_inst);
-  EXPECT_INS_EQ(moved_set->InputAt(1), c15);
-  EXPECT_INS_RETAINED(call_left);
-  // store removed or moved.
-  EXPECT_NE(store->GetBlock(), entry);
-  // New-inst removed or moved.
-  EXPECT_NE(new_inst->GetBlock(), entry);
-  EXPECT_INS_REMOVED(a_val);
-  EXPECT_INS_REMOVED(b_val);
-  EXPECT_INS_REMOVED(c_val);
-  EXPECT_INS_RETAINED(a_noescape);
-  EXPECT_INS_RETAINED(b_noescape);
-  EXPECT_INS_RETAINED(c_noescape);
-  EXPECT_INS_EQ(add_1_exit->InputAt(0), c12);
-  EXPECT_INS_EQ(add_1_exit->InputAt(1), c13);
-  EXPECT_INS_EQ(add_2_exit->InputAt(0), c14);
-  EXPECT_INS_EQ(add_2_exit->InputAt(1), add_1_exit);
-  EXPECT_INS_EQ(add_3_exit->InputAt(0), pred_gets[0]);
-  EXPECT_INS_EQ(pred_gets[0]->GetDefaultValue(), val_phi);
-  EXPECT_INS_EQ(add_3_exit->InputAt(1), add_2_exit);
-  EXPECT_EQ(a_noescape->GetEnvironment()->Size(), 2u);
-  EXPECT_INS_EQ(a_noescape->GetEnvironment()->GetInstructionAt(0), graph_->GetNullConstant());
-  EXPECT_INS_EQ(a_noescape->GetEnvironment()->GetInstructionAt(1), c12);
-  EXPECT_EQ(b_noescape->GetEnvironment()->Size(), 3u);
-  EXPECT_INS_EQ(b_noescape->GetEnvironment()->GetInstructionAt(0), graph_->GetNullConstant());
-  EXPECT_INS_EQ(b_noescape->GetEnvironment()->GetInstructionAt(1), c12);
-  EXPECT_INS_EQ(b_noescape->GetEnvironment()->GetInstructionAt(2), c13);
-  EXPECT_EQ(c_noescape->GetEnvironment()->Size(), 4u);
-  EXPECT_INS_EQ(c_noescape->GetEnvironment()->GetInstructionAt(0), graph_->GetNullConstant());
-  EXPECT_INS_EQ(c_noescape->GetEnvironment()->GetInstructionAt(1), c12);
-  EXPECT_INS_EQ(c_noescape->GetEnvironment()->GetInstructionAt(2), c13);
-  EXPECT_INS_EQ(c_noescape->GetEnvironment()->GetInstructionAt(3), c14);
-}
-
-// // ENTRY
-// // To be moved
-// obj = new Obj();
-// // Transforms required for creation non-trivial and unimportant
-// if (parameter_value) {
-//   obj.foo = 10
-// } else {
-//   obj.foo = 12;
-// }
-// if (parameter_value_2) {
-//   escape(obj);
-// }
-// EXIT
-TEST_F(LoadStoreEliminationTest, MovePredicatedAlloc2) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left_set"},
-                                                  {"entry", "right_set"},
-                                                  {"left_set", "merge_crit_break"},
-                                                  {"right_set", "merge_crit_break"},
-                                                  {"merge_crit_break", "merge"},
-                                                  {"merge", "escape"},
-                                                  {"escape", "breturn"},
-                                                  {"merge", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left_set);
-  GET_BLOCK(right_set);
-  GET_BLOCK(merge);
-  GET_BLOCK(merge_crit_break);
-  GET_BLOCK(escape);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {merge, escape});
-  EnsurePredecessorOrder(merge_crit_break, {left_set, right_set});
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* bool_value_2 = MakeParam(DataType::Type::kBool);
-  HInstruction* c10 = graph_->GetIntConstant(10);
-  HInstruction* c12 = graph_->GetIntConstant(12);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* store_left = MakeIFieldSet(new_inst, c10, MemberOffset(32));
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left_set->AddInstruction(store_left);
-  left_set->AddInstruction(goto_left);
-
-  HInstruction* store_right = MakeIFieldSet(new_inst, c12, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right_set->AddInstruction(store_right);
-  right_set->AddInstruction(goto_right);
-
-  merge_crit_break->AddInstruction(new (GetAllocator()) HGoto());
-  HInstruction* if_merge = new (GetAllocator()) HIf(bool_value_2);
-  merge->AddInstruction(if_merge);
-
-  HInstruction* escape_instruction = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* escape_goto = new (GetAllocator()) HGoto();
-  escape->AddInstruction(escape_instruction);
-  escape->AddInstruction(escape_goto);
-  escape_instruction->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* return_exit = new (GetAllocator()) HReturnVoid();
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  HNewInstance* moved_new_inst;
-  HInstanceFieldSet* moved_set;
-  std::tie(moved_new_inst, moved_set) =
-      FindSingleInstructions<HNewInstance, HInstanceFieldSet>(graph_);
-  HPhi* merge_phi = FindSingleInstruction<HPhi>(graph_, merge_crit_break);
-  HPhi* alloc_phi = FindSingleInstruction<HPhi>(graph_, breturn);
-  EXPECT_INS_EQ(moved_new_inst, moved_set->InputAt(0));
-  ASSERT_NE(alloc_phi, nullptr);
-  EXPECT_EQ(alloc_phi->InputAt(0), graph_->GetNullConstant())
-      << alloc_phi->GetBlock()->GetPredecessors()[0]->GetBlockId() << " " << *alloc_phi;
-  EXPECT_TRUE(alloc_phi->InputAt(1)->IsNewInstance()) << *alloc_phi;
-  ASSERT_NE(merge_phi, nullptr);
-  EXPECT_EQ(merge_phi->InputCount(), 2u);
-  EXPECT_INS_EQ(merge_phi->InputAt(0), c10);
-  EXPECT_INS_EQ(merge_phi->InputAt(1), c12);
-  EXPECT_TRUE(merge_phi->GetUses().HasExactlyOneElement());
-  EXPECT_INS_EQ(merge_phi->GetUses().front().GetUser(), moved_set);
-  EXPECT_INS_RETAINED(escape_instruction);
-  EXPECT_INS_EQ(escape_instruction->InputAt(0), moved_new_inst);
-  // store removed or moved.
-  EXPECT_NE(store_left->GetBlock(), left_set);
-  EXPECT_NE(store_right->GetBlock(), left_set);
-  // New-inst removed or moved.
-  EXPECT_NE(new_inst->GetBlock(), entry);
-}
-
-// // ENTRY
-// // To be moved
-// obj = new Obj();
-// switch(args) {
-//   default:
-//     return obj.a;
-//   case b:
-//     obj.a = 5; break;
-//   case c:
-//     obj.b = 4; break;
-// }
-// escape(obj);
-// return obj.a;
-// EXIT
-TEST_F(LoadStoreEliminationTest, MovePredicatedAlloc3) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "early_return"},
-                                                  {"entry", "set_one"},
-                                                  {"entry", "set_two"},
-                                                  {"early_return", "exit"},
-                                                  {"set_one", "escape"},
-                                                  {"set_two", "escape"},
-                                                  {"escape", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(escape);
-  GET_BLOCK(early_return);
-  GET_BLOCK(set_one);
-  GET_BLOCK(set_two);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(escape, {set_one, set_two});
-  HInstruction* int_val = MakeParam(DataType::Type::kInt32);
-  HInstruction* c0 = graph_->GetIntConstant(0);
-  HInstruction* c4 = graph_->GetIntConstant(4);
-  HInstruction* c5 = graph_->GetIntConstant(5);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* switch_inst = new (GetAllocator()) HPackedSwitch(0, 2, int_val);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(switch_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* store_one = MakeIFieldSet(new_inst, c4, MemberOffset(32));
-  HInstruction* goto_one = new (GetAllocator()) HGoto();
-  set_one->AddInstruction(store_one);
-  set_one->AddInstruction(goto_one);
-
-  HInstruction* store_two = MakeIFieldSet(new_inst, c5, MemberOffset(32));
-  HInstruction* goto_two = new (GetAllocator()) HGoto();
-  set_two->AddInstruction(store_two);
-  set_two->AddInstruction(goto_two);
-
-  HInstruction* read_early = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_early = new (GetAllocator()) HReturn(read_early);
-  early_return->AddInstruction(read_early);
-  early_return->AddInstruction(return_early);
-
-  HInstruction* escape_instruction = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* read_escape = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_escape = new (GetAllocator()) HReturn(read_escape);
-  escape->AddInstruction(escape_instruction);
-  escape->AddInstruction(read_escape);
-  escape->AddInstruction(return_escape);
-  escape_instruction->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  // Each escaping switch path gets its own materialization block.
-  // Blocks:
-  //   early_return(5) -> [exit(4)]
-  //   entry(3) -> [early_return(5), <Unnamed>(9), <Unnamed>(10)]
-  //   escape(8) -> [exit(4)]
-  //   exit(4) -> []
-  //   set_one(6) -> [escape(8)]
-  //   set_two(7) -> [escape(8)]
-  //   <Unnamed>(10) -> [set_two(7)]
-  //   <Unnamed>(9) -> [set_one(6)]
-  HBasicBlock* materialize_one = set_one->GetSinglePredecessor();
-  HBasicBlock* materialize_two = set_two->GetSinglePredecessor();
-  HNewInstance* materialization_ins_one =
-      FindSingleInstruction<HNewInstance>(graph_, materialize_one);
-  HNewInstance* materialization_ins_two =
-      FindSingleInstruction<HNewInstance>(graph_, materialize_two);
-  HPhi* new_phi = FindSingleInstruction<HPhi>(graph_, escape);
-  EXPECT_NE(materialization_ins_one, nullptr);
-  EXPECT_NE(materialization_ins_two, nullptr);
-  EXPECT_EQ(materialization_ins_one, new_phi->InputAt(0))
-      << *materialization_ins_one << " vs " << *new_phi;
-  EXPECT_EQ(materialization_ins_two, new_phi->InputAt(1))
-      << *materialization_ins_two << " vs " << *new_phi;
-
-  EXPECT_INS_RETAINED(escape_instruction);
-  EXPECT_INS_RETAINED(read_escape);
-  EXPECT_EQ(read_escape->InputAt(0), new_phi) << *new_phi << " vs " << *read_escape->InputAt(0);
-  EXPECT_EQ(store_one->InputAt(0), materialization_ins_one);
-  EXPECT_EQ(store_two->InputAt(0), materialization_ins_two);
-  EXPECT_EQ(escape_instruction->InputAt(0), new_phi);
-  EXPECT_INS_REMOVED(read_early);
-  EXPECT_EQ(return_early->InputAt(0), c0);
-}
-
-// // ENTRY
-// // To be moved
-// obj = new Obj();
-// switch(args) {
-//   case a:
-//     // set_one_and_escape
-//     obj.a = 5;
-//     escape(obj);
-//     // FALLTHROUGH
-//   case c:
-//     // set_two
-//     obj.a = 4; break;
-//   default:
-//     return obj.a;
-// }
-// escape(obj);
-// return obj.a;
-// EXIT
-TEST_F(LoadStoreEliminationTest, MovePredicatedAlloc4) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  // Break the critical edge between entry and set_two with the
-  // set_two_critical_break node. Graph simplification would do this for us if
-  // we didn't do it manually. This way we have a nice-name for debugging and
-  // testing.
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "early_return"},
-                                                  {"entry", "set_one_and_escape"},
-                                                  {"entry", "set_two_critical_break"},
-                                                  {"set_two_critical_break", "set_two"},
-                                                  {"early_return", "exit"},
-                                                  {"set_one_and_escape", "set_two"},
-                                                  {"set_two", "escape"},
-                                                  {"escape", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(escape);
-  GET_BLOCK(early_return);
-  GET_BLOCK(set_one_and_escape);
-  GET_BLOCK(set_two);
-  GET_BLOCK(set_two_critical_break);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(set_two, {set_one_and_escape, set_two_critical_break});
-  HInstruction* int_val = MakeParam(DataType::Type::kInt32);
-  HInstruction* c0 = graph_->GetIntConstant(0);
-  HInstruction* c4 = graph_->GetIntConstant(4);
-  HInstruction* c5 = graph_->GetIntConstant(5);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* switch_inst = new (GetAllocator()) HPackedSwitch(0, 2, int_val);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(switch_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* store_one = MakeIFieldSet(new_inst, c4, MemberOffset(32));
-  HInstruction* escape_one = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_one = new (GetAllocator()) HGoto();
-  set_one_and_escape->AddInstruction(store_one);
-  set_one_and_escape->AddInstruction(escape_one);
-  set_one_and_escape->AddInstruction(goto_one);
-  escape_one->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* goto_crit_break = new (GetAllocator()) HGoto();
-  set_two_critical_break->AddInstruction(goto_crit_break);
-
-  HInstruction* store_two = MakeIFieldSet(new_inst, c5, MemberOffset(32));
-  HInstruction* goto_two = new (GetAllocator()) HGoto();
-  set_two->AddInstruction(store_two);
-  set_two->AddInstruction(goto_two);
-
-  HInstruction* read_early = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_early = new (GetAllocator()) HReturn(read_early);
-  early_return->AddInstruction(read_early);
-  early_return->AddInstruction(return_early);
-
-  HInstruction* escape_instruction = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* read_escape = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_escape = new (GetAllocator()) HReturn(read_escape);
-  escape->AddInstruction(escape_instruction);
-  escape->AddInstruction(read_escape);
-  escape->AddInstruction(return_escape);
-  escape_instruction->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_REMOVED(read_early);
-  EXPECT_EQ(return_early->InputAt(0), c0);
-  // Each escaping switch path gets its own materialization block.
-  // Blocks:
-  //   early_return(5) -> [exit(4)]
-  //   entry(3) -> [early_return(5), <Unnamed>(10), <Unnamed>(11)]
-  //   escape(9) -> [exit(4)]
-  //   exit(4) -> []
-  //   set_one_and_escape(6) -> [set_two(8)]
-  //   set_two(8) -> [escape(9)]
-  //   set_two_critical_break(7) -> [set_two(8)]
-  //   <Unnamed>(11) -> [set_two_critical_break(7)]
-  //   <Unnamed>(10) -> [set_one_and_escape(6)]
-  HBasicBlock* materialize_one = set_one_and_escape->GetSinglePredecessor();
-  HBasicBlock* materialize_two = set_two_critical_break->GetSinglePredecessor();
-  HNewInstance* materialization_ins_one =
-      FindSingleInstruction<HNewInstance>(graph_, materialize_one);
-  HNewInstance* materialization_ins_two =
-      FindSingleInstruction<HNewInstance>(graph_, materialize_two);
-  HPhi* new_phi = FindSingleInstruction<HPhi>(graph_, set_two);
-  ASSERT_NE(new_phi, nullptr);
-  ASSERT_NE(materialization_ins_one, nullptr);
-  ASSERT_NE(materialization_ins_two, nullptr);
-  EXPECT_INS_EQ(materialization_ins_one, new_phi->InputAt(0));
-  EXPECT_INS_EQ(materialization_ins_two, new_phi->InputAt(1));
-
-  EXPECT_INS_EQ(store_one->InputAt(0), materialization_ins_one);
-  EXPECT_INS_EQ(store_two->InputAt(0), new_phi) << *store_two << " vs " << *new_phi;
-  EXPECT_INS_EQ(escape_instruction->InputAt(0), new_phi);
-  EXPECT_INS_RETAINED(escape_one);
-  EXPECT_INS_EQ(escape_one->InputAt(0), materialization_ins_one);
-  EXPECT_INS_RETAINED(escape_instruction);
-  EXPECT_INS_RETAINED(read_escape);
-  EXPECT_EQ(read_escape->InputAt(0), new_phi) << *new_phi << " vs " << *read_escape->InputAt(0);
-}
-
-// // ENTRY
-// // To be moved
-// obj = new Obj();
-// switch(args) {
-//   case a:
-//     // set_one
-//     obj.a = 5;
-//     // nb passthrough
-//   case c:
-//     // set_two_and_escape
-//     obj.a += 4;
-//     escape(obj);
-//     break;
-//   default:
-//     obj.a = 10;
-// }
-// return obj.a;
-// EXIT
-TEST_F(LoadStoreEliminationTest, MovePredicatedAlloc5) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  // Break the critical edge between entry and set_two with the
-  // set_two_critical_break node. Graph simplification would do this for us if
-  // we didn't do it manually. This way we have a nice-name for debugging and
-  // testing.
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "set_noescape"},
-                                                  {"entry", "set_one"},
-                                                  {"entry", "set_two_critical_break"},
-                                                  {"set_two_critical_break", "set_two_and_escape"},
-                                                  {"set_noescape", "breturn"},
-                                                  {"set_one", "set_two_and_escape"},
-                                                  {"set_two_and_escape", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(set_noescape);
-  GET_BLOCK(set_one);
-  GET_BLOCK(set_two_and_escape);
-  GET_BLOCK(set_two_critical_break);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(set_two_and_escape, {set_one, set_two_critical_break});
-  EnsurePredecessorOrder(breturn, {set_two_and_escape, set_noescape});
-  HInstruction* int_val = MakeParam(DataType::Type::kInt32);
-  HInstruction* c0 = graph_->GetIntConstant(0);
-  HInstruction* c4 = graph_->GetIntConstant(4);
-  HInstruction* c5 = graph_->GetIntConstant(5);
-  HInstruction* c10 = graph_->GetIntConstant(10);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* switch_inst = new (GetAllocator()) HPackedSwitch(0, 2, int_val);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(switch_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* store_one = MakeIFieldSet(new_inst, c5, MemberOffset(32));
-  HInstruction* goto_one = new (GetAllocator()) HGoto();
-  set_one->AddInstruction(store_one);
-  set_one->AddInstruction(goto_one);
-
-  HInstruction* goto_crit_break = new (GetAllocator()) HGoto();
-  set_two_critical_break->AddInstruction(goto_crit_break);
-
-  HInstruction* get_two = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* add_two = new (GetAllocator()) HAdd(DataType::Type::kInt32, get_two, c4);
-  HInstruction* store_two = MakeIFieldSet(new_inst, add_two, MemberOffset(32));
-  HInstruction* escape_two = MakeInvoke(DataType::Type::kVoid, {new_inst});
-  HInstruction* goto_two = new (GetAllocator()) HGoto();
-  set_two_and_escape->AddInstruction(get_two);
-  set_two_and_escape->AddInstruction(add_two);
-  set_two_and_escape->AddInstruction(store_two);
-  set_two_and_escape->AddInstruction(escape_two);
-  set_two_and_escape->AddInstruction(goto_two);
-  escape_two->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* store_noescape = MakeIFieldSet(new_inst, c10, MemberOffset(32));
-  HInstruction* goto_noescape = new (GetAllocator()) HGoto();
-  set_noescape->AddInstruction(store_noescape);
-  set_noescape->AddInstruction(goto_noescape);
-
-  HInstruction* read_breturn = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_breturn = new (GetAllocator()) HReturn(read_breturn);
-  breturn->AddInstruction(read_breturn);
-  breturn->AddInstruction(return_breturn);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  // Normal LSE can get rid of these two.
-  EXPECT_INS_REMOVED(store_one);
-  EXPECT_INS_REMOVED(get_two);
-  EXPECT_INS_RETAINED(add_two);
-  EXPECT_TRUE(add_two->InputAt(0)->IsPhi());
-  EXPECT_INS_EQ(add_two->InputAt(0)->InputAt(0), c5);
-  EXPECT_INS_EQ(add_two->InputAt(0)->InputAt(1), c0);
-  EXPECT_INS_EQ(add_two->InputAt(1), c4);
-
-  HBasicBlock* materialize_one = set_one->GetSinglePredecessor();
-  HBasicBlock* materialize_two = set_two_critical_break->GetSinglePredecessor();
-  HNewInstance* materialization_ins_one =
-      FindSingleInstruction<HNewInstance>(graph_, materialize_one);
-  HNewInstance* materialization_ins_two =
-      FindSingleInstruction<HNewInstance>(graph_, materialize_two);
-  std::vector<HPhi*> phis;
-  std::tie(phis) = FindAllInstructions<HPhi>(graph_, set_two_and_escape);
-  HPhi* new_phi = FindOrNull(
-      phis.begin(), phis.end(), [&](auto p) { return p->GetType() == DataType::Type::kReference; });
-  ASSERT_NE(new_phi, nullptr);
-  ASSERT_NE(materialization_ins_one, nullptr);
-  ASSERT_NE(materialization_ins_two, nullptr);
-  EXPECT_INS_EQ(materialization_ins_one, new_phi->InputAt(0));
-  EXPECT_INS_EQ(materialization_ins_two, new_phi->InputAt(1));
-
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  EXPECT_TRUE(pred_get->GetTarget()->IsPhi());
-  EXPECT_INS_EQ(pred_get->GetTarget()->InputAt(0), new_phi);
-  EXPECT_INS_EQ(pred_get->GetTarget()->InputAt(1), graph_->GetNullConstant());
-
-  EXPECT_INS_EQ(pred_get->GetDefaultValue()->InputAt(0), c0);
-  EXPECT_INS_EQ(pred_get->GetDefaultValue()->InputAt(1), c10);
-}
-
-// // ENTRY
-// obj = new Obj();
-// if (parameter_value) {
-//   // LEFT
-//   // DO NOT ELIMINATE
-//   obj.field = 1;
-//   escape(obj);
-//   return obj.field;
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   obj.field = 2;
-//   return obj.field;
-// }
-// EXIT
-TEST_F(LoadStoreEliminationTest, PartialLoadElimination3) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList(
-      "entry",
-      "exit",
-      {{"entry", "left"}, {"entry", "right"}, {"left", "exit"}, {"right", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c1 = graph_->GetIntConstant(1);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_left = MakeIFieldSet(new_inst, c1, MemberOffset(32));
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* read_left = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_left = new (GetAllocator()) HReturn(read_left);
-  left->AddInstruction(write_left);
-  left->AddInstruction(call_left);
-  left->AddInstruction(read_left);
-  left->AddInstruction(return_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* read_right = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_right = new (GetAllocator()) HReturn(read_right);
-  right->AddInstruction(write_right);
-  right->AddInstruction(read_right);
-  right->AddInstruction(return_right);
-
-  SetupExit(exit);
-
-  // PerformLSE expects this to be empty.
-  graph_->ClearDominanceInformation();
-  PerformLSE();
-
-  EXPECT_INS_REMOVED(read_right);
-  EXPECT_INS_REMOVED(write_right);
-  EXPECT_INS_RETAINED(write_left);
-  EXPECT_INS_RETAINED(call_left);
-  EXPECT_INS_RETAINED(read_left);
-}
-
-// // ENTRY
-// obj = new Obj();
-// if (parameter_value) {
-//   // LEFT
-//   // DO NOT ELIMINATE
-//   obj.field = 1;
-//   while (true) {
-//     bool esc = escape(obj);
-//     // DO NOT ELIMINATE
-//     obj.field = 3;
-//     if (esc) break;
-//   }
-//   // ELIMINATE.
-//   return obj.field;
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   obj.field = 2;
-//   return obj.field;
-// }
-// EXIT
-TEST_F(LoadStoreEliminationTest, PartialLoadElimination4) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "entry_post"},
-                                                  {"entry_post", "right"},
-                                                  {"right", "exit"},
-                                                  {"entry_post", "left_pre"},
-                                                  {"left_pre", "left_loop"},
-                                                  {"left_loop", "left_loop"},
-                                                  {"left_loop", "left_finish"},
-                                                  {"left_finish", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(entry_post);
-  GET_BLOCK(exit);
-  GET_BLOCK(left_pre);
-  GET_BLOCK(left_loop);
-  GET_BLOCK(left_finish);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  // Left-loops first successor is the break.
-  if (left_loop->GetSuccessors()[0] != left_finish) {
-    left_loop->SwapSuccessors();
-  }
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c1 = graph_->GetIntConstant(1);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* goto_entry = new (GetAllocator()) HGoto();
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(goto_entry);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry_post->AddInstruction(if_inst);
-
-  HInstruction* write_left_pre = MakeIFieldSet(new_inst, c1, MemberOffset(32));
-  HInstruction* goto_left_pre = new (GetAllocator()) HGoto();
-  left_pre->AddInstruction(write_left_pre);
-  left_pre->AddInstruction(goto_left_pre);
-
-  HInstruction* suspend_left_loop = new (GetAllocator()) HSuspendCheck();
-  HInstruction* call_left_loop = MakeInvoke(DataType::Type::kBool, { new_inst });
-  HInstruction* write_left_loop = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* if_left_loop = new (GetAllocator()) HIf(call_left_loop);
-  left_loop->AddInstruction(suspend_left_loop);
-  left_loop->AddInstruction(call_left_loop);
-  left_loop->AddInstruction(write_left_loop);
-  left_loop->AddInstruction(if_left_loop);
-  suspend_left_loop->CopyEnvironmentFrom(cls->GetEnvironment());
-  call_left_loop->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* read_left_end = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_left_end = new (GetAllocator()) HReturn(read_left_end);
-  left_finish->AddInstruction(read_left_end);
-  left_finish->AddInstruction(return_left_end);
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* read_right = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_right = new (GetAllocator()) HReturn(read_right);
-  right->AddInstruction(write_right);
-  right->AddInstruction(read_right);
-  right->AddInstruction(return_right);
-
-  SetupExit(exit);
-
-  // PerformLSE expects this to be empty.
-  graph_->ClearDominanceInformation();
-  PerformLSE();
-
-  EXPECT_INS_RETAINED(write_left_pre);
-  EXPECT_INS_REMOVED(read_right);
-  EXPECT_INS_REMOVED(write_right);
-  EXPECT_INS_RETAINED(write_left_loop);
-  EXPECT_INS_RETAINED(call_left_loop);
-  EXPECT_INS_REMOVED(read_left_end);
-}
-
-// // ENTRY
-// obj = new Obj();
-// if (parameter_value) {
-//   // LEFT
-//   // DO NOT ELIMINATE
-//   escape(obj);
-//   obj.field = 1;
-// } else {
-//   // RIGHT
-//   // obj hasn't escaped so it's invisible.
-//   // ELIMINATE
-//   obj.field = 2;
-//   noescape();
-// }
-// EXIT
-// ELIMINATE
-// return obj.field
-TEST_F(LoadStoreEliminationTest, PartialLoadElimination5) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c1 = graph_->GetIntConstant(1);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* write_left = MakeIFieldSet(new_inst, c1, MemberOffset(32));
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left);
-  left->AddInstruction(write_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* call_right = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(call_right);
-  right->AddInstruction(goto_right);
-  call_right->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  // PerformLSE expects this to be empty.
-  graph_->ClearDominanceInformation();
-  PerformLSE();
-
-  EXPECT_INS_REMOVED(read_bottom);
-  EXPECT_INS_REMOVED(write_right);
-  EXPECT_INS_RETAINED(write_left);
-  EXPECT_INS_RETAINED(call_left);
-  EXPECT_INS_RETAINED(call_right);
-}
-
-// // ENTRY
-// obj = new Obj();
-// // Eliminate this one. Object hasn't escaped yet so it's safe.
-// obj.field = 3;
-// noescape();
-// if (parameter_value) {
-//   // LEFT
-//   // DO NOT ELIMINATE
-//   obj.field = 5;
-//   escape(obj);
-//   obj.field = 1;
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   obj.field = 2;
-// }
-// EXIT
-// ELIMINATE
-// return obj.fid
-TEST_F(LoadStoreEliminationTest, PartialLoadElimination6) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c1 = graph_->GetIntConstant(1);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c5 = graph_->GetIntConstant(5);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* write_entry = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* call_entry = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_entry);
-  entry->AddInstruction(call_entry);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-  call_entry->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_left_start = MakeIFieldSet(new_inst, c5, MemberOffset(32));
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* write_left = MakeIFieldSet(new_inst, c1, MemberOffset(32));
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(write_left_start);
-  left->AddInstruction(call_left);
-  left->AddInstruction(write_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  // PerformLSE expects this to be empty.
-  graph_->ClearDominanceInformation();
-  PerformLSE();
-
-  EXPECT_INS_REMOVED(read_bottom);
-  EXPECT_INS_REMOVED(write_right);
-  EXPECT_INS_REMOVED(write_entry);
-  EXPECT_INS_RETAINED(write_left_start);
-  EXPECT_INS_RETAINED(write_left);
-  EXPECT_INS_RETAINED(call_left);
-  EXPECT_INS_RETAINED(call_entry);
-}
-
-// // ENTRY
-// obj = new Obj();
-// if (parameter_value) {
-//   // LEFT
-//   // DO NOT ELIMINATE
 //   obj.field = 1;
 //   while (true) {
 //     bool esc = escape(obj);
@@ -4471,7 +2119,7 @@
   left_pre->AddInstruction(goto_left_pre);
 
   HInstruction* suspend_left_loop = new (GetAllocator()) HSuspendCheck();
-  HInstruction* call_left_loop = MakeInvoke(DataType::Type::kBool, { new_inst });
+  HInstruction* call_left_loop = MakeInvoke(DataType::Type::kBool, {new_inst});
   HInstruction* if_left_loop = new (GetAllocator()) HIf(call_left_loop);
   left_loop->AddInstruction(suspend_left_loop);
   left_loop->AddInstruction(call_left_loop);
@@ -4496,7 +2144,7 @@
 
   SetupExit(exit);
 
-  PerformLSENoPartial(blks);
+  PerformLSE(blks);
 
   EXPECT_INS_RETAINED(write_left_pre) << *write_left_pre;
   EXPECT_INS_RETAINED(read_return) << *read_return;
@@ -4588,7 +2236,7 @@
   call_left_loop->CopyEnvironmentFrom(cls->GetEnvironment());
 
   HInstruction* write_right = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* call_right = MakeInvoke(DataType::Type::kBool, { new_inst });
+  HInstruction* call_right = MakeInvoke(DataType::Type::kBool, {new_inst});
   HInstruction* goto_right = new (GetAllocator()) HGoto();
   right->AddInstruction(write_right);
   right->AddInstruction(call_right);
@@ -4602,7 +2250,7 @@
 
   SetupExit(exit);
 
-  PerformLSENoPartial(blks);
+  PerformLSE(blks);
 
   EXPECT_INS_RETAINED(read_return);
   EXPECT_INS_RETAINED(write_right);
@@ -4688,7 +2336,7 @@
 
   SetupExit(exit);
 
-  PerformLSENoPartial(blks);
+  PerformLSE(blks);
 
   EXPECT_INS_RETAINED(read_bottom);
   EXPECT_INS_RETAINED(write_right);
@@ -4771,7 +2419,7 @@
 
   SetupExit(exit);
 
-  PerformLSENoPartial(blks);
+  PerformLSE(blks);
 
   EXPECT_INS_REMOVED(read_bottom);
   EXPECT_INS_REMOVED(write_right);
@@ -4780,3894 +2428,4 @@
   EXPECT_INS_RETAINED(call_left);
   EXPECT_INS_RETAINED(call_entry);
 }
-
-// // ENTRY
-// // MOVED TO MATERIALIZATION BLOCK
-// obj = new Obj();
-// ELIMINATE, moved to materialization block. Kept by escape.
-// obj.field = 3;
-// // Make sure this graph isn't broken
-// if (obj ==/!= (STATIC.VALUE|obj|null)) {
-//   // partial_BLOCK
-//   // REMOVE (either from unreachable or normal PHI creation)
-//   obj.field = 4;
-// }
-// if (parameter_value) {
-//   // LEFT
-//   // DO NOT ELIMINATE
-//   escape(obj);
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   obj.field = 2;
-// }
-// EXIT
-// PREDICATED GET
-// return obj.field
-TEST_P(PartialComparisonTestGroup, PartialComparisonBeforeCohort) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "first_block"},
-                                                  {"first_block", "critical_break"},
-                                                  {"first_block", "partial"},
-                                                  {"partial", "merge"},
-                                                  {"critical_break", "merge"},
-                                                  {"merge", "left"},
-                                                  {"merge", "right"},
-                                                  {"left", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(first_block);
-  GET_BLOCK(merge);
-  GET_BLOCK(partial);
-  GET_BLOCK(critical_break);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c4 = graph_->GetIntConstant(4);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* write_entry = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  ComparisonInstructions cmp_instructions = GetComparisonInstructions(new_inst);
-  HInstruction* if_inst = new (GetAllocator()) HIf(cmp_instructions.cmp_);
-  first_block->AddInstruction(cls);
-  first_block->AddInstruction(new_inst);
-  first_block->AddInstruction(write_entry);
-  cmp_instructions.AddSetup(first_block);
-  first_block->AddInstruction(cmp_instructions.cmp_);
-  first_block->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  cmp_instructions.AddEnvironment(cls->GetEnvironment());
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_partial = MakeIFieldSet(new_inst, c4, MemberOffset(32));
-  HInstruction* goto_partial = new (GetAllocator()) HGoto();
-  partial->AddInstruction(write_partial);
-  partial->AddInstruction(goto_partial);
-
-  HInstruction* goto_crit_break = new (GetAllocator()) HGoto();
-  critical_break->AddInstruction(goto_crit_break);
-
-  HInstruction* if_merge = new (GetAllocator()) HIf(bool_value);
-  merge->AddInstruction(if_merge);
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  std::vector<HPhi*> merges;
-  HPredicatedInstanceFieldGet* pred_get;
-  HInstanceFieldSet* init_set;
-  std::tie(pred_get, init_set) =
-      FindSingleInstructions<HPredicatedInstanceFieldGet, HInstanceFieldSet>(graph_);
-  std::tie(merges) = FindAllInstructions<HPhi>(graph_);
-  ASSERT_EQ(merges.size(), 3u);
-  HPhi* merge_value_return = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kInt32 && p->GetBlock() == breturn;
-  });
-  HPhi* merge_value_top = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kInt32 && p->GetBlock() != breturn;
-  });
-  HPhi* merge_alloc = FindOrNull(merges.begin(), merges.end(), [](HPhi* p) {
-    return p->GetType() == DataType::Type::kReference;
-  });
-  EXPECT_INS_REMOVED(read_bottom);
-  EXPECT_INS_REMOVED(write_entry);
-  EXPECT_INS_REMOVED(write_partial);
-  EXPECT_INS_RETAINED(call_left);
-  CheckFinalInstruction(if_inst->InputAt(0), ComparisonPlacement::kBeforeEscape);
-  EXPECT_INS_EQ(init_set->InputAt(1), merge_value_top);
-  EXPECT_INS_EQ(pred_get->GetTarget(), merge_alloc);
-  EXPECT_INS_EQ(pred_get->GetDefaultValue(), merge_value_return);
-}
-
-// // ENTRY
-// // MOVED TO MATERIALIZATION BLOCK
-// obj = new Obj();
-// ELIMINATE, moved to materialization block. Kept by escape.
-// obj.field = 3;
-// // Make sure this graph isn't broken
-// if (parameter_value) {
-//   if (obj ==/!= (STATIC.VALUE|obj|null)) {
-//     // partial_BLOCK
-//     obj.field = 4;
-//   }
-//   // LEFT
-//   // DO NOT ELIMINATE
-//   escape(obj);
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   obj.field = 2;
-// }
-// EXIT
-// PREDICATED GET
-// return obj.field
-TEST_P(PartialComparisonTestGroup, PartialComparisonInCohortBeforeEscape) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left_begin"},
-                                                  {"left_begin", "partial"},
-                                                  {"left_begin", "left_crit_break"},
-                                                  {"left_crit_break", "left"},
-                                                  {"partial", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(partial);
-  GET_BLOCK(left_begin);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(left_crit_break);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(left, {left_crit_break, partial});
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c4 = graph_->GetIntConstant(4);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* write_entry = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_entry);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  ComparisonInstructions cmp_instructions = GetComparisonInstructions(new_inst);
-  HInstruction* if_left_begin = new (GetAllocator()) HIf(cmp_instructions.cmp_);
-  cmp_instructions.AddSetup(left_begin);
-  left_begin->AddInstruction(cmp_instructions.cmp_);
-  left_begin->AddInstruction(if_left_begin);
-  cmp_instructions.AddEnvironment(cls->GetEnvironment());
-
-  left_crit_break->AddInstruction(new (GetAllocator()) HGoto());
-
-  HInstruction* write_partial = MakeIFieldSet(new_inst, c4, MemberOffset(32));
-  HInstruction* goto_partial = new (GetAllocator()) HGoto();
-  partial->AddInstruction(write_partial);
-  partial->AddInstruction(goto_partial);
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  std::vector<HPhi*> merges;
-  HInstanceFieldSet* init_set =
-      FindSingleInstruction<HInstanceFieldSet>(graph_, left_begin->GetSinglePredecessor());
-  HInstanceFieldSet* partial_set = FindSingleInstruction<HInstanceFieldSet>(graph_, partial);
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_);
-  std::tie(merges) = FindAllInstructions<HPhi>(graph_);
-  ASSERT_EQ(merges.size(), 2u);
-  HPhi* merge_value_return = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kInt32;
-  });
-  HPhi* merge_alloc = FindOrNull(merges.begin(), merges.end(), [](HPhi* p) {
-    return p->GetType() == DataType::Type::kReference;
-  });
-  EXPECT_EQ(merge_value_return->GetBlock(), breturn)
-      << blks.GetName(merge_value_return->GetBlock());
-  EXPECT_INS_REMOVED(read_bottom);
-  EXPECT_INS_REMOVED(write_entry);
-  EXPECT_INS_RETAINED(write_partial);
-  EXPECT_INS_RETAINED(call_left);
-  CheckFinalInstruction(if_left_begin->InputAt(0), ComparisonPlacement::kInEscape);
-  EXPECT_INS_EQ(init_set->InputAt(1), c3);
-  EXPECT_INS_EQ(partial_set->InputAt(0), init_set->InputAt(0));
-  EXPECT_INS_EQ(partial_set->InputAt(1), c4);
-  EXPECT_INS_EQ(pred_get->GetTarget(), merge_alloc);
-  EXPECT_INS_EQ(pred_get->GetDefaultValue(), merge_value_return);
-}
-
-// // ENTRY
-// // MOVED TO MATERIALIZATION BLOCK
-// obj = new Obj();
-// ELIMINATE, moved to materialization block. Kept by escape.
-// obj.field = 3;
-// // Make sure this graph isn't broken
-// if (parameter_value) {
-//   // LEFT
-//   // DO NOT ELIMINATE
-//   escape(obj);
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   obj.field = 2;
-// }
-// if (obj ==/!= (STATIC.VALUE|obj|null)) {
-//   // partial_BLOCK
-//   obj.field = 4;
-// }
-// EXIT
-// PREDICATED GET
-// return obj.field
-TEST_P(PartialComparisonTestGroup, PartialComparisonAfterCohort) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "merge"},
-                                                  {"right", "merge"},
-                                                  {"merge", "critical_break"},
-                                                  {"critical_break", "breturn"},
-                                                  {"merge", "partial"},
-                                                  {"partial", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(partial);
-  GET_BLOCK(critical_break);
-  GET_BLOCK(merge);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {critical_break, partial});
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c4 = graph_->GetIntConstant(4);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* write_entry = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_entry);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  ComparisonInstructions cmp_instructions = GetComparisonInstructions(new_inst);
-  HInstruction* if_merge = new (GetAllocator()) HIf(cmp_instructions.cmp_);
-  cmp_instructions.AddSetup(merge);
-  merge->AddInstruction(cmp_instructions.cmp_);
-  merge->AddInstruction(if_merge);
-  cmp_instructions.AddEnvironment(cls->GetEnvironment());
-
-  HInstanceFieldSet* write_partial = MakeIFieldSet(new_inst, c4, MemberOffset(32));
-  HInstruction* goto_partial = new (GetAllocator()) HGoto();
-  partial->AddInstruction(write_partial);
-  partial->AddInstruction(goto_partial);
-
-  HInstruction* goto_crit_break = new (GetAllocator()) HGoto();
-  critical_break->AddInstruction(goto_crit_break);
-
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  std::vector<HPhi*> merges;
-  HInstanceFieldSet* init_set =
-      FindSingleInstruction<HInstanceFieldSet>(graph_, left->GetSinglePredecessor());
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_);
-  std::tie(merges) = FindAllInstructions<HPhi>(graph_);
-  ASSERT_EQ(merges.size(), 3u);
-  HPhi* merge_value_return = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kInt32 && p->GetBlock() == breturn;
-  });
-  HPhi* merge_alloc = FindOrNull(merges.begin(), merges.end(), [](HPhi* p) {
-    return p->GetType() == DataType::Type::kReference;
-  });
-  EXPECT_INS_REMOVED(read_bottom);
-  EXPECT_INS_REMOVED(write_entry);
-  EXPECT_INS_RETAINED(write_partial);
-  EXPECT_TRUE(write_partial->GetIsPredicatedSet());
-  EXPECT_INS_RETAINED(call_left);
-  CheckFinalInstruction(if_merge->InputAt(0), ComparisonPlacement::kAfterEscape);
-  EXPECT_INS_EQ(init_set->InputAt(1), c3);
-  ASSERT_TRUE(write_partial->InputAt(0)->IsPhi());
-  EXPECT_INS_EQ(write_partial->InputAt(0)->AsPhi()->InputAt(0), init_set->InputAt(0));
-  EXPECT_INS_EQ(write_partial->InputAt(1), c4);
-  EXPECT_INS_EQ(pred_get->GetTarget(), merge_alloc);
-  EXPECT_INS_EQ(pred_get->GetDefaultValue(), merge_value_return);
-}
-
-// // ENTRY
-// // MOVED TO MATERIALIZATION BLOCK
-// obj = new Obj();
-// ELIMINATE, moved to materialization block. Kept by escape.
-// obj.field = 3;
-// // Make sure this graph isn't broken
-// if (parameter_value) {
-//   // LEFT
-//   // DO NOT ELIMINATE
-//   escape(obj);
-//   if (obj ==/!= (STATIC.VALUE|obj|null)) {
-//     // partial_BLOCK
-//     obj.field = 4;
-//   }
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   obj.field = 2;
-// }
-// EXIT
-// PREDICATED GET
-// return obj.field
-TEST_P(PartialComparisonTestGroup, PartialComparisonInCohortAfterEscape) {
-  PartialComparisonKind kind = GetParam();
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"left", "partial"},
-                                                  {"partial", "left_end"},
-                                                  {"left", "left_crit_break"},
-                                                  {"left_crit_break", "left_end"},
-                                                  {"left_end", "breturn"},
-                                                  {"entry", "right"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(partial);
-  GET_BLOCK(left_end);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(left_crit_break);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c4 = graph_->GetIntConstant(4);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* write_entry = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_entry);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  ComparisonInstructions cmp_instructions = GetComparisonInstructions(new_inst);
-  HInstruction* if_left = new (GetAllocator()) HIf(cmp_instructions.cmp_);
-  left->AddInstruction(call_left);
-  cmp_instructions.AddSetup(left);
-  left->AddInstruction(cmp_instructions.cmp_);
-  left->AddInstruction(if_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-  cmp_instructions.AddEnvironment(cls->GetEnvironment());
-  if (if_left->AsIf()->IfTrueSuccessor() != partial) {
-    left->SwapSuccessors();
-  }
-
-  HInstruction* write_partial = MakeIFieldSet(new_inst, c4, MemberOffset(32));
-  HInstruction* goto_partial = new (GetAllocator()) HGoto();
-  partial->AddInstruction(write_partial);
-  partial->AddInstruction(goto_partial);
-
-  HInstruction* goto_left_crit_break = new (GetAllocator()) HGoto();
-  left_crit_break->AddInstruction(goto_left_crit_break);
-
-  HInstruction* goto_left_end = new (GetAllocator()) HGoto();
-  left_end->AddInstruction(goto_left_end);
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  std::vector<HPhi*> merges;
-  std::vector<HInstanceFieldSet*> sets;
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_);
-  std::tie(merges, sets) = FindAllInstructions<HPhi, HInstanceFieldSet>(graph_);
-  ASSERT_EQ(merges.size(), 2u);
-  ASSERT_EQ(sets.size(), 2u);
-  HInstanceFieldSet* init_set = FindOrNull(sets.begin(), sets.end(), [&](HInstanceFieldSet* s) {
-    return s->GetBlock()->GetSingleSuccessor() == left;
-  });
-  EXPECT_INS_EQ(init_set->InputAt(1), c3);
-  HPhi* merge_value_return = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kInt32 && p->GetBlock() == breturn;
-  });
-  HPhi* merge_alloc = FindOrNull(merges.begin(), merges.end(), [](HPhi* p) {
-    return p->GetType() == DataType::Type::kReference;
-  });
-  EXPECT_INS_REMOVED(read_bottom);
-  EXPECT_INS_REMOVED(write_entry);
-  if (kind.IsPossiblyTrue()) {
-    EXPECT_INS_RETAINED(write_partial);
-    EXPECT_TRUE(std::find(sets.begin(), sets.end(), write_partial) != sets.end());
-  }
-  EXPECT_INS_RETAINED(call_left);
-  CheckFinalInstruction(if_left->InputAt(0), ComparisonPlacement::kInEscape);
-  EXPECT_INS_EQ(pred_get->GetTarget(), merge_alloc);
-  EXPECT_INS_EQ(pred_get->GetDefaultValue(), merge_value_return);
-}
-
-INSTANTIATE_TEST_SUITE_P(
-    LoadStoreEliminationTest,
-    PartialComparisonTestGroup,
-    testing::Values(PartialComparisonKind{PartialComparisonKind::Type::kEquals,
-                                          PartialComparisonKind::Target::kNull,
-                                          PartialComparisonKind::Position::kLeft},
-                    PartialComparisonKind{PartialComparisonKind::Type::kEquals,
-                                          PartialComparisonKind::Target::kNull,
-                                          PartialComparisonKind::Position::kRight},
-                    PartialComparisonKind{PartialComparisonKind::Type::kEquals,
-                                          PartialComparisonKind::Target::kValue,
-                                          PartialComparisonKind::Position::kLeft},
-                    PartialComparisonKind{PartialComparisonKind::Type::kEquals,
-                                          PartialComparisonKind::Target::kValue,
-                                          PartialComparisonKind::Position::kRight},
-                    PartialComparisonKind{PartialComparisonKind::Type::kEquals,
-                                          PartialComparisonKind::Target::kSelf,
-                                          PartialComparisonKind::Position::kLeft},
-                    PartialComparisonKind{PartialComparisonKind::Type::kNotEquals,
-                                          PartialComparisonKind::Target::kNull,
-                                          PartialComparisonKind::Position::kLeft},
-                    PartialComparisonKind{PartialComparisonKind::Type::kNotEquals,
-                                          PartialComparisonKind::Target::kNull,
-                                          PartialComparisonKind::Position::kRight},
-                    PartialComparisonKind{PartialComparisonKind::Type::kNotEquals,
-                                          PartialComparisonKind::Target::kSelf,
-                                          PartialComparisonKind::Position::kLeft},
-                    PartialComparisonKind{PartialComparisonKind::Type::kNotEquals,
-                                          PartialComparisonKind::Target::kValue,
-                                          PartialComparisonKind::Position::kLeft},
-                    PartialComparisonKind{PartialComparisonKind::Type::kNotEquals,
-                                          PartialComparisonKind::Target::kValue,
-                                          PartialComparisonKind::Position::kRight}));
-
-// // ENTRY
-// obj = new Obj();
-// if (parameter_value) {
-//   // LEFT
-//   escape(obj);
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   obj.field = 2;
-// }
-// EXIT
-// predicated-ELIMINATE
-// obj.field = 3;
-TEST_F(LoadStoreEliminationTest, PredicatedStore1) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  InitGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {left, right});
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* null_const = graph_->GetNullConstant();
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* write_bottom = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturnVoid();
-  breturn->AddInstruction(write_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_RETAINED(write_bottom);
-  EXPECT_TRUE(write_bottom->AsInstanceFieldSet()->GetIsPredicatedSet());
-  EXPECT_INS_REMOVED(write_right);
-  EXPECT_INS_RETAINED(call_left);
-  HPhi* merge_alloc = FindSingleInstruction<HPhi>(graph_, breturn);
-  ASSERT_NE(merge_alloc, nullptr);
-  EXPECT_TRUE(merge_alloc->InputAt(0)->IsNewInstance()) << *merge_alloc;
-  EXPECT_EQ(merge_alloc->InputAt(0)->InputAt(0), cls) << *merge_alloc << " cls? " << *cls;
-  EXPECT_EQ(merge_alloc->InputAt(1), null_const);
-}
-
-// // ENTRY
-// obj = new Obj();
-// obj.field = 3;
-// if (parameter_value) {
-//   // LEFT
-//   escape(obj);
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   obj.field = 2;
-// }
-// // MERGE
-// if (second_param) {
-//   // NON_ESCAPE
-//   obj.field = 1;
-//   noescape();
-// }
-// EXIT
-// predicated-ELIMINATE
-// obj.field = 4;
-TEST_F(LoadStoreEliminationTest, PredicatedStore2) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "merge"},
-                                                  {"right", "merge"},
-                                                  {"merge", "non_escape"},
-                                                  {"non_escape", "breturn"},
-                                                  {"merge", "merge_crit_break"},
-                                                  {"merge_crit_break", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-  GET_BLOCK(merge);
-  GET_BLOCK(merge_crit_break);
-  GET_BLOCK(non_escape);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(merge, {left, right});
-  EnsurePredecessorOrder(breturn, {merge_crit_break, non_escape});
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* bool_value2 = MakeParam(DataType::Type::kBool);
-  HInstruction* null_const = graph_->GetNullConstant();
-  HInstruction* c1 = graph_->GetIntConstant(3);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c4 = graph_->GetIntConstant(4);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* write_entry = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_entry);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* merge_if = new (GetAllocator()) HIf(bool_value2);
-  merge->AddInstruction(merge_if);
-
-  merge_crit_break->AddInstruction(new (GetAllocator()) HGoto());
-
-  HInstruction* write_non_escape = MakeIFieldSet(new_inst, c1, MemberOffset(32));
-  HInstruction* non_escape_call = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* non_escape_goto = new (GetAllocator()) HGoto();
-  non_escape->AddInstruction(write_non_escape);
-  non_escape->AddInstruction(non_escape_call);
-  non_escape->AddInstruction(non_escape_goto);
-  non_escape_call->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_bottom = MakeIFieldSet(new_inst, c4, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturnVoid();
-  breturn->AddInstruction(write_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_RETAINED(write_bottom);
-  EXPECT_TRUE(write_bottom->AsInstanceFieldSet()->GetIsPredicatedSet()) << *write_bottom;
-  EXPECT_INS_REMOVED(write_right);
-  EXPECT_INS_RETAINED(call_left);
-  HInstanceFieldSet* pred_set = FindSingleInstruction<HInstanceFieldSet>(graph_, breturn);
-  HPhi* merge_alloc = FindSingleInstruction<HPhi>(graph_);
-  ASSERT_NE(merge_alloc, nullptr);
-  EXPECT_TRUE(merge_alloc->InputAt(0)->IsNewInstance()) << *merge_alloc;
-  EXPECT_INS_EQ(merge_alloc->InputAt(0)->InputAt(0), cls) << " phi is: " << *merge_alloc;
-  EXPECT_INS_EQ(merge_alloc->InputAt(1), null_const);
-  ASSERT_NE(pred_set, nullptr);
-  EXPECT_TRUE(pred_set->GetIsPredicatedSet()) << *pred_set;
-  EXPECT_INS_EQ(pred_set->InputAt(0), merge_alloc);
-}
-
-// // ENTRY
-// obj = new Obj();
-// obj.field = 3;
-// if (parameter_value) {
-//   // LEFT
-//   escape(obj);
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   obj.field = 2;
-// }
-// EXIT
-// predicated-ELIMINATE
-// return obj.field
-TEST_F(LoadStoreEliminationTest, PredicatedLoad1) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {left, right});
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* null_const = graph_->GetNullConstant();
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* write_entry = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_entry);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_REMOVED(read_bottom);
-  EXPECT_INS_REMOVED(write_right);
-  EXPECT_INS_RETAINED(call_left);
-  std::vector<HPhi*> merges;
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  std::tie(merges) = FindAllInstructions<HPhi>(graph_, breturn);
-  ASSERT_EQ(merges.size(), 2u);
-  HPhi* merge_value_return = FindOrNull(
-      merges.begin(), merges.end(), [](HPhi* p) { return p->GetType() == DataType::Type::kInt32; });
-  HPhi* merge_alloc = FindOrNull(merges.begin(), merges.end(), [](HPhi* p) {
-    return p->GetType() == DataType::Type::kReference;
-  });
-  ASSERT_NE(merge_alloc, nullptr);
-  EXPECT_TRUE(merge_alloc->InputAt(0)->IsNewInstance()) << *merge_alloc;
-  EXPECT_EQ(merge_alloc->InputAt(0)->InputAt(0), cls) << *merge_alloc << " cls? " << *cls;
-  EXPECT_EQ(merge_alloc->InputAt(1), null_const);
-  ASSERT_NE(pred_get, nullptr);
-  EXPECT_INS_EQ(pred_get->GetTarget(), merge_alloc);
-  EXPECT_INS_EQ(pred_get->GetDefaultValue(), merge_value_return) << " pred-get is: " << *pred_get;
-  EXPECT_INS_EQ(merge_value_return->InputAt(0), graph_->GetIntConstant(0))
-      << " merge val is: " << *merge_value_return;
-  EXPECT_INS_EQ(merge_value_return->InputAt(1), c2) << " merge val is: " << *merge_value_return;
-}
-
-// // ENTRY
-// obj1 = new Obj1();
-// obj2 = new Obj2();
-// obj1.field = 3;
-// obj2.field = 13;
-// if (parameter_value) {
-//   // LEFT
-//   escape(obj1);
-//   escape(obj2);
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   obj1.field = 2;
-//   obj2.field = 12;
-// }
-// EXIT
-// predicated-ELIMINATE
-// return obj1.field + obj2.field
-TEST_F(LoadStoreEliminationTest, MultiPredicatedLoad1) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {left, right});
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c12 = graph_->GetIntConstant(12);
-  HInstruction* c13 = graph_->GetIntConstant(13);
-
-  HInstruction* cls1 = MakeClassLoad();
-  HInstruction* cls2 = MakeClassLoad();
-  HInstruction* new_inst1 = MakeNewInstance(cls1);
-  HInstruction* new_inst2 = MakeNewInstance(cls2);
-  HInstruction* write_entry1 = MakeIFieldSet(new_inst1, c3, MemberOffset(32));
-  HInstruction* write_entry2 = MakeIFieldSet(new_inst2, c13, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls1);
-  entry->AddInstruction(cls2);
-  entry->AddInstruction(new_inst1);
-  entry->AddInstruction(new_inst2);
-  entry->AddInstruction(write_entry1);
-  entry->AddInstruction(write_entry2);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls1, {});
-  cls2->CopyEnvironmentFrom(cls1->GetEnvironment());
-  new_inst1->CopyEnvironmentFrom(cls1->GetEnvironment());
-  new_inst2->CopyEnvironmentFrom(cls1->GetEnvironment());
-
-  HInstruction* call_left1 = MakeInvoke(DataType::Type::kVoid, { new_inst1 });
-  HInstruction* call_left2 = MakeInvoke(DataType::Type::kVoid, { new_inst2 });
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left1);
-  left->AddInstruction(call_left2);
-  left->AddInstruction(goto_left);
-  call_left1->CopyEnvironmentFrom(cls1->GetEnvironment());
-  call_left2->CopyEnvironmentFrom(cls1->GetEnvironment());
-
-  HInstruction* write_right1 = MakeIFieldSet(new_inst1, c2, MemberOffset(32));
-  HInstruction* write_right2 = MakeIFieldSet(new_inst2, c12, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right1);
-  right->AddInstruction(write_right2);
-  right->AddInstruction(goto_right);
-
-  HInstruction* read_bottom1 = MakeIFieldGet(new_inst1, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* read_bottom2 = MakeIFieldGet(new_inst2, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* combine =
-      new (GetAllocator()) HAdd(DataType::Type::kInt32, read_bottom1, read_bottom2);
-  HInstruction* return_exit = new (GetAllocator()) HReturn(combine);
-  breturn->AddInstruction(read_bottom1);
-  breturn->AddInstruction(read_bottom2);
-  breturn->AddInstruction(combine);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_REMOVED(read_bottom1);
-  EXPECT_INS_REMOVED(read_bottom2);
-  EXPECT_INS_REMOVED(write_right1);
-  EXPECT_INS_REMOVED(write_right2);
-  EXPECT_INS_RETAINED(call_left1);
-  EXPECT_INS_RETAINED(call_left2);
-  std::vector<HPhi*> merges;
-  std::vector<HPredicatedInstanceFieldGet*> pred_gets;
-  std::tie(merges, pred_gets) =
-      FindAllInstructions<HPhi, HPredicatedInstanceFieldGet>(graph_, breturn);
-  ASSERT_EQ(merges.size(), 4u);
-  ASSERT_EQ(pred_gets.size(), 2u);
-  HPhi* merge_value_return1 = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kInt32 && p->InputAt(1) == c2;
-  });
-  HPhi* merge_value_return2 = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kInt32 && p->InputAt(1) == c12;
-  });
-  HPhi* merge_alloc1 = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kReference &&
-           p->InputAt(0)->IsNewInstance() &&
-           p->InputAt(0)->InputAt(0) == cls1;
-  });
-  HPhi* merge_alloc2 = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kReference &&
-           p->InputAt(0)->IsNewInstance() &&
-           p->InputAt(0)->InputAt(0) == cls2;
-  });
-  ASSERT_NE(merge_alloc1, nullptr);
-  ASSERT_NE(merge_alloc2, nullptr);
-  EXPECT_EQ(merge_alloc1->InputAt(1), graph_->GetNullConstant());
-  EXPECT_EQ(merge_alloc2->InputAt(1), graph_->GetNullConstant());
-  HPredicatedInstanceFieldGet* pred_get1 =
-      FindOrNull(pred_gets.begin(), pred_gets.end(), [&](HPredicatedInstanceFieldGet* pg) {
-        return pg->GetTarget() == merge_alloc1;
-      });
-  HPredicatedInstanceFieldGet* pred_get2 =
-      FindOrNull(pred_gets.begin(), pred_gets.end(), [&](HPredicatedInstanceFieldGet* pg) {
-        return pg->GetTarget() == merge_alloc2;
-      });
-  ASSERT_NE(pred_get1, nullptr);
-  EXPECT_INS_EQ(pred_get1->GetTarget(), merge_alloc1);
-  EXPECT_INS_EQ(pred_get1->GetDefaultValue(), merge_value_return1)
-      << " pred-get is: " << *pred_get1;
-  EXPECT_INS_EQ(merge_value_return1->InputAt(0), graph_->GetIntConstant(0))
-      << " merge val is: " << *merge_value_return1;
-  EXPECT_INS_EQ(merge_value_return1->InputAt(1), c2) << " merge val is: " << *merge_value_return1;
-  ASSERT_NE(pred_get2, nullptr);
-  EXPECT_INS_EQ(pred_get2->GetTarget(), merge_alloc2);
-  EXPECT_INS_EQ(pred_get2->GetDefaultValue(), merge_value_return2)
-      << " pred-get is: " << *pred_get2;
-  EXPECT_INS_EQ(merge_value_return2->InputAt(0), graph_->GetIntConstant(0))
-      << " merge val is: " << *merge_value_return1;
-  EXPECT_INS_EQ(merge_value_return2->InputAt(1), c12) << " merge val is: " << *merge_value_return1;
-}
-
-// // ENTRY
-// obj1 = new Obj1();
-// obj2 = new Obj2();
-// obj1.field = 3;
-// obj2.field = 13;
-// if (parameter_value) {
-//   // LEFT
-//   escape(obj1);
-//   // ELIMINATE
-//   obj2.field = 12;
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   obj1.field = 2;
-//   escape(obj2);
-// }
-// EXIT
-// predicated-ELIMINATE
-// return obj1.field + obj2.field
-TEST_F(LoadStoreEliminationTest, MultiPredicatedLoad2) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {left, right});
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c12 = graph_->GetIntConstant(12);
-  HInstruction* c13 = graph_->GetIntConstant(13);
-
-  HInstruction* cls1 = MakeClassLoad();
-  HInstruction* cls2 = MakeClassLoad();
-  HInstruction* new_inst1 = MakeNewInstance(cls1);
-  HInstruction* new_inst2 = MakeNewInstance(cls2);
-  HInstruction* write_entry1 = MakeIFieldSet(new_inst1, c3, MemberOffset(32));
-  HInstruction* write_entry2 = MakeIFieldSet(new_inst2, c13, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls1);
-  entry->AddInstruction(cls2);
-  entry->AddInstruction(new_inst1);
-  entry->AddInstruction(new_inst2);
-  entry->AddInstruction(write_entry1);
-  entry->AddInstruction(write_entry2);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls1, {});
-  cls2->CopyEnvironmentFrom(cls1->GetEnvironment());
-  new_inst1->CopyEnvironmentFrom(cls1->GetEnvironment());
-  new_inst2->CopyEnvironmentFrom(cls1->GetEnvironment());
-
-  HInstruction* call_left1 = MakeInvoke(DataType::Type::kVoid, { new_inst1 });
-  HInstruction* write_left2 = MakeIFieldSet(new_inst2, c12, MemberOffset(32));
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left1);
-  left->AddInstruction(write_left2);
-  left->AddInstruction(goto_left);
-  call_left1->CopyEnvironmentFrom(cls1->GetEnvironment());
-
-  HInstruction* write_right1 = MakeIFieldSet(new_inst1, c2, MemberOffset(32));
-  HInstruction* call_right2 = MakeInvoke(DataType::Type::kVoid, { new_inst2 });
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right1);
-  right->AddInstruction(call_right2);
-  right->AddInstruction(goto_right);
-  call_right2->CopyEnvironmentFrom(cls1->GetEnvironment());
-
-  HInstruction* read_bottom1 = MakeIFieldGet(new_inst1, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* read_bottom2 = MakeIFieldGet(new_inst2, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* combine =
-      new (GetAllocator()) HAdd(DataType::Type::kInt32, read_bottom1, read_bottom2);
-  HInstruction* return_exit = new (GetAllocator()) HReturn(combine);
-  breturn->AddInstruction(read_bottom1);
-  breturn->AddInstruction(read_bottom2);
-  breturn->AddInstruction(combine);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_REMOVED(read_bottom1);
-  EXPECT_INS_REMOVED(read_bottom2);
-  EXPECT_INS_REMOVED(write_right1);
-  EXPECT_INS_REMOVED(write_left2);
-  EXPECT_INS_RETAINED(call_left1);
-  EXPECT_INS_RETAINED(call_right2);
-  std::vector<HPhi*> merges;
-  std::vector<HPredicatedInstanceFieldGet*> pred_gets;
-  std::tie(merges, pred_gets) =
-      FindAllInstructions<HPhi, HPredicatedInstanceFieldGet>(graph_, breturn);
-  ASSERT_EQ(merges.size(), 4u);
-  ASSERT_EQ(pred_gets.size(), 2u);
-  HPhi* merge_value_return1 = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kInt32 && p->InputAt(1) == c2;
-  });
-  HPhi* merge_value_return2 = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kInt32 && p->InputAt(0) == c12;
-  });
-  HPhi* merge_alloc1 = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kReference && p->InputAt(1)->IsNullConstant();
-  });
-  HPhi* merge_alloc2 = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kReference && p->InputAt(0)->IsNullConstant();
-  });
-  ASSERT_NE(merge_alloc1, nullptr);
-  ASSERT_NE(merge_alloc2, nullptr);
-  EXPECT_TRUE(merge_alloc1->InputAt(0)->IsNewInstance()) << *merge_alloc1;
-  EXPECT_INS_EQ(merge_alloc1->InputAt(0)->InputAt(0), cls1) << *merge_alloc1;
-  EXPECT_INS_EQ(merge_alloc1->InputAt(1), graph_->GetNullConstant());
-  EXPECT_TRUE(merge_alloc2->InputAt(1)->IsNewInstance()) << *merge_alloc2;
-  EXPECT_INS_EQ(merge_alloc2->InputAt(1)->InputAt(0), cls2) << *merge_alloc2;
-  EXPECT_INS_EQ(merge_alloc2->InputAt(0), graph_->GetNullConstant());
-  HPredicatedInstanceFieldGet* pred_get1 =
-      FindOrNull(pred_gets.begin(), pred_gets.end(), [&](HPredicatedInstanceFieldGet* pg) {
-        return pg->GetTarget() == merge_alloc1;
-      });
-  HPredicatedInstanceFieldGet* pred_get2 =
-      FindOrNull(pred_gets.begin(), pred_gets.end(), [&](HPredicatedInstanceFieldGet* pg) {
-        return pg->GetTarget() == merge_alloc2;
-      });
-  ASSERT_NE(pred_get1, nullptr);
-  EXPECT_INS_EQ(pred_get1->GetTarget(), merge_alloc1);
-  EXPECT_INS_EQ(pred_get1->GetDefaultValue(), merge_value_return1)
-      << " pred-get is: " << *pred_get1;
-  EXPECT_INS_EQ(merge_value_return1->InputAt(0), graph_->GetIntConstant(0))
-      << " merge val is: " << *merge_value_return1;
-  EXPECT_INS_EQ(merge_value_return1->InputAt(1), c2) << " merge val is: " << *merge_value_return1;
-  ASSERT_NE(pred_get2, nullptr);
-  EXPECT_INS_EQ(pred_get2->GetTarget(), merge_alloc2);
-  EXPECT_INS_EQ(pred_get2->GetDefaultValue(), merge_value_return2)
-      << " pred-get is: " << *pred_get2;
-  EXPECT_INS_EQ(merge_value_return2->InputAt(1), graph_->GetIntConstant(0))
-      << " merge val is: " << *merge_value_return1;
-  EXPECT_INS_EQ(merge_value_return2->InputAt(0), c12) << " merge val is: " << *merge_value_return1;
-}
-
-// Based on structure seen in `java.util.List
-// java.util.Collections.checkedList(java.util.List, java.lang.Class)`
-// Incorrect accounting would cause attempts to materialize both obj1 and obj2
-// in each of the materialization blocks.
-// // ENTRY
-// Obj obj;
-// if (param1) {
-//   // needs to be moved after param2 check
-//   obj1 = new Obj1();
-//   obj1.foo = 33;
-//   if (param2) {
-//     return obj1.foo;
-//   }
-//   obj = obj1;
-// } else {
-//   obj2 = new Obj2();
-//   obj2.foo = 44;
-//   if (param2) {
-//     return obj2.foo;
-//   }
-//   obj = obj2;
-// }
-// EXIT
-// // obj = PHI[obj1, obj2]
-// // NB The phi acts as an escape for both obj1 and obj2 meaning as far as the
-// // LSA is concerned the escape frontier is left_crit_break->breturn and
-// // right_crit_break->breturn for both even though only one of the objects is
-// // actually live at each edge.
-// // TODO In the future we really should track liveness through PHIs which would
-// // allow us to entirely remove the allocation in this test.
-// return obj.foo;
-TEST_F(LoadStoreEliminationTest, MultiPredicatedLoad3) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"left", "left_end"},
-                                                  {"left_end", "breturn"},
-                                                  {"left", "left_exit_early"},
-                                                  {"left_exit_early", "exit"},
-                                                  {"entry", "right"},
-                                                  {"right", "right_end"},
-                                                  {"right_end", "breturn"},
-                                                  {"right", "right_exit_early"},
-                                                  {"right_exit_early", "exit"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(left_end);
-  GET_BLOCK(left_exit_early);
-  GET_BLOCK(right);
-  GET_BLOCK(right_end);
-  GET_BLOCK(right_exit_early);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {left_end, right_end});
-  HInstruction* param1 = MakeParam(DataType::Type::kBool);
-  HInstruction* param2 = MakeParam(DataType::Type::kBool);
-  HInstruction* c33 = graph_->GetIntConstant(33);
-  HInstruction* c44 = graph_->GetIntConstant(44);
-
-  HInstruction* if_inst = new (GetAllocator()) HIf(param1);
-  entry->AddInstruction(if_inst);
-
-  HInstruction* cls1 = MakeClassLoad();
-  HInstruction* new_inst1 = MakeNewInstance(cls1);
-  HInstruction* write1 = MakeIFieldSet(new_inst1, c33, MemberOffset(32));
-  HInstruction* if_left = new (GetAllocator()) HIf(param2);
-  left->AddInstruction(cls1);
-  left->AddInstruction(new_inst1);
-  left->AddInstruction(write1);
-  left->AddInstruction(if_left);
-  ManuallyBuildEnvFor(cls1, {});
-  new_inst1->CopyEnvironmentFrom(cls1->GetEnvironment());
-
-  left_end->AddInstruction(new (GetAllocator()) HGoto());
-
-  HInstruction* early_exit_left_read =
-      MakeIFieldGet(new_inst1, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* early_exit_left_return = new (GetAllocator()) HReturn(early_exit_left_read);
-  left_exit_early->AddInstruction(early_exit_left_read);
-  left_exit_early->AddInstruction(early_exit_left_return);
-
-  HInstruction* cls2 = MakeClassLoad();
-  HInstruction* new_inst2 = MakeNewInstance(cls2);
-  HInstruction* write2 = MakeIFieldSet(new_inst2, c44, MemberOffset(32));
-  HInstruction* if_right = new (GetAllocator()) HIf(param2);
-  right->AddInstruction(cls2);
-  right->AddInstruction(new_inst2);
-  right->AddInstruction(write2);
-  right->AddInstruction(if_right);
-  cls2->CopyEnvironmentFrom(cls1->GetEnvironment());
-  new_inst2->CopyEnvironmentFrom(cls2->GetEnvironment());
-
-  right_end->AddInstruction(new (GetAllocator()) HGoto());
-
-  HInstruction* early_exit_right_read =
-      MakeIFieldGet(new_inst2, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* early_exit_right_return = new (GetAllocator()) HReturn(early_exit_right_read);
-  right_exit_early->AddInstruction(early_exit_right_read);
-  right_exit_early->AddInstruction(early_exit_right_return);
-
-  HPhi* bottom_phi = MakePhi({new_inst1, new_inst2});
-  HInstruction* read_bottom = MakeIFieldGet(bottom_phi, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddPhi(bottom_phi);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_REMOVED(early_exit_left_read);
-  EXPECT_INS_REMOVED(early_exit_right_read);
-  EXPECT_INS_RETAINED(bottom_phi);
-  EXPECT_INS_RETAINED(read_bottom);
-  EXPECT_INS_EQ(early_exit_left_return->InputAt(0), c33);
-  EXPECT_INS_EQ(early_exit_right_return->InputAt(0), c44);
-  // These assert there is only 1 HNewInstance in the given blocks.
-  HNewInstance* moved_ni1 =
-      FindSingleInstruction<HNewInstance>(graph_, left_end->GetSinglePredecessor());
-  HNewInstance* moved_ni2 =
-      FindSingleInstruction<HNewInstance>(graph_, right_end->GetSinglePredecessor());
-  ASSERT_NE(moved_ni1, nullptr);
-  ASSERT_NE(moved_ni2, nullptr);
-  EXPECT_INS_EQ(bottom_phi->InputAt(0), moved_ni1);
-  EXPECT_INS_EQ(bottom_phi->InputAt(1), moved_ni2);
-}
-
-// // ENTRY
-// obj = new Obj();
-// if (param1) {
-//   obj.field = 3;
-//   noescape();
-// } else {
-//   obj.field = 2;
-//   noescape();
-// }
-// int abc;
-// if (parameter_value) {
-//   // LEFT
-//   abc = 4;
-//   escape(obj);
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   noescape();
-//   abc = obj.field + 4;
-// }
-// abc = phi
-// EXIT
-// predicated-ELIMINATE
-// return obj.field + abc
-TEST_F(LoadStoreEliminationTest, PredicatedLoad4) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "start_left"},
-                                                  {"entry", "start_right"},
-                                                  {"start_left", "mid"},
-                                                  {"start_right", "mid"},
-                                                  {"mid", "left"},
-                                                  {"mid", "right"},
-                                                  {"left", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-  GET_BLOCK(mid);
-  GET_BLOCK(start_left);
-  GET_BLOCK(start_right);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {left, right});
-  EnsurePredecessorOrder(mid, {start_left, start_right});
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* bool_value2 = MakeParam(DataType::Type::kBool);
-  HInstruction* null_const = graph_->GetNullConstant();
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c4 = graph_->GetIntConstant(4);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_start_left = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* call_start_left = MakeInvoke(DataType::Type::kVoid, { });
-  start_left->AddInstruction(write_start_left);
-  start_left->AddInstruction(call_start_left);
-  start_left->AddInstruction(new (GetAllocator()) HGoto());
-  call_start_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_start_right = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* call_start_right = MakeInvoke(DataType::Type::kVoid, { });
-  start_right->AddInstruction(write_start_right);
-  start_right->AddInstruction(call_start_right);
-  start_right->AddInstruction(new (GetAllocator()) HGoto());
-  call_start_right->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  mid->AddInstruction(new (GetAllocator()) HIf(bool_value2));
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_right = MakeInvoke(DataType::Type::kVoid, { });
-  HInstruction* read_right = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* add_right = new (GetAllocator()) HAdd(DataType::Type::kInt32, read_right, c4);
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(call_right);
-  right->AddInstruction(read_right);
-  right->AddInstruction(add_right);
-  right->AddInstruction(goto_right);
-  call_right->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HPhi* phi_bottom = MakePhi({c4, add_right});
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* add_bottom =
-      new (GetAllocator()) HAdd(DataType::Type::kInt32, read_bottom, phi_bottom);
-  HInstruction* return_exit = new (GetAllocator()) HReturn(add_bottom);
-  breturn->AddPhi(phi_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(add_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_REMOVED(read_bottom);
-  EXPECT_INS_REMOVED(read_right);
-  EXPECT_INS_RETAINED(call_left);
-  EXPECT_INS_RETAINED(call_right);
-  EXPECT_INS_RETAINED(call_start_left);
-  EXPECT_INS_RETAINED(call_start_right);
-  std::vector<HPhi*> merges;
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  std::tie(merges) = FindAllInstructions<HPhi>(graph_, breturn);
-  ASSERT_EQ(merges.size(), 3u);
-  HPhi* merge_value_return = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p != phi_bottom && p->GetType() == DataType::Type::kInt32;
-  });
-  HPhi* merge_alloc = FindOrNull(merges.begin(), merges.end(), [](HPhi* p) {
-    return p->GetType() == DataType::Type::kReference;
-  });
-  ASSERT_NE(merge_alloc, nullptr);
-  EXPECT_TRUE(merge_alloc->InputAt(0)->IsNewInstance()) << *merge_alloc;
-  EXPECT_EQ(merge_alloc->InputAt(0)->InputAt(0), cls) << *merge_alloc << " cls? " << *cls;
-  EXPECT_EQ(merge_alloc->InputAt(1), null_const);
-  ASSERT_NE(pred_get, nullptr);
-  EXPECT_INS_EQ(pred_get->GetTarget(), merge_alloc);
-  EXPECT_INS_EQ(pred_get->GetDefaultValue(), merge_value_return) << " pred-get is: " << *pred_get;
-  EXPECT_INS_EQ(merge_value_return->InputAt(0), graph_->GetIntConstant(0))
-      << " merge val is: " << *merge_value_return;
-  EXPECT_INS_EQ(merge_value_return->InputAt(1), FindSingleInstruction<HPhi>(graph_, mid))
-      << " merge val is: " << *merge_value_return;
-}
-
-// Based on structure seen in `java.util.Set java.util.Collections$UnmodifiableMap.entrySet()`
-// We end up having to update a PHI generated by normal LSE.
-// // ENTRY
-// Obj obj_init = param_obj.BAR;
-// if (param1) {
-//   Obj other = new Obj();
-//   other.foo = 42;
-//   if (param2) {
-//     return other.foo;
-//   } else {
-//     param_obj.BAR = other;
-//   }
-// } else { }
-// EXIT
-// LSE Turns this into PHI[obj_init, other]
-// read_bottom = param_obj.BAR;
-// // won't be changed. The escape happens with .BAR set so this is in escaping cohort.
-// return read_bottom.foo;
-TEST_F(LoadStoreEliminationTest, MultiPredicatedLoad4) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"left", "left_early_return"},
-                                                  {"left_early_return", "exit"},
-                                                  {"left", "left_write_escape"},
-                                                  {"left_write_escape", "breturn"},
-                                                  {"entry", "right"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(left_early_return);
-  GET_BLOCK(left_write_escape);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  MemberOffset foo_offset = MemberOffset(32);
-  MemberOffset bar_offset = MemberOffset(20);
-  EnsurePredecessorOrder(breturn, {left_write_escape, right});
-  HInstruction* c42 = graph_->GetIntConstant(42);
-  HInstruction* param1 = MakeParam(DataType::Type::kBool);
-  HInstruction* param2 = MakeParam(DataType::Type::kBool);
-  HInstruction* param_obj = MakeParam(DataType::Type::kReference);
-
-  HInstruction* get_initial = MakeIFieldGet(param_obj, DataType::Type::kReference, bar_offset);
-  HInstruction* if_inst = new (GetAllocator()) HIf(param1);
-  entry->AddInstruction(get_initial);
-  entry->AddInstruction(if_inst);
-
-  HInstruction* cls1 = MakeClassLoad();
-  HInstruction* new_inst1 = MakeNewInstance(cls1);
-  HInstruction* write1 = MakeIFieldSet(new_inst1, c42, foo_offset);
-  HInstruction* if_left = new (GetAllocator()) HIf(param2);
-  left->AddInstruction(cls1);
-  left->AddInstruction(new_inst1);
-  left->AddInstruction(write1);
-  left->AddInstruction(if_left);
-  ManuallyBuildEnvFor(cls1, {});
-  new_inst1->CopyEnvironmentFrom(cls1->GetEnvironment());
-
-  HInstruction* read_early_return = MakeIFieldGet(new_inst1, DataType::Type::kInt32, foo_offset);
-  HInstruction* return_early = new (GetAllocator()) HReturn(read_early_return);
-  left_early_return->AddInstruction(read_early_return);
-  left_early_return->AddInstruction(return_early);
-
-  HInstruction* write_escape = MakeIFieldSet(param_obj, new_inst1, bar_offset);
-  HInstruction* write_goto = new (GetAllocator()) HGoto();
-  left_write_escape->AddInstruction(write_escape);
-  left_write_escape->AddInstruction(write_goto);
-
-  right->AddInstruction(new (GetAllocator()) HGoto());
-
-  HInstruction* read_bottom = MakeIFieldGet(param_obj, DataType::Type::kReference, bar_offset);
-  HInstruction* final_read = MakeIFieldGet(read_bottom, DataType::Type::kInt32, foo_offset);
-  HInstruction* return_exit = new (GetAllocator()) HReturn(final_read);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(final_read);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_REMOVED(read_bottom);
-  EXPECT_INS_REMOVED(read_early_return);
-  EXPECT_INS_EQ(return_early->InputAt(0), c42);
-  EXPECT_INS_RETAINED(final_read);
-  HNewInstance* moved_ni =
-      FindSingleInstruction<HNewInstance>(graph_, left_write_escape->GetSinglePredecessor());
-  EXPECT_TRUE(final_read->InputAt(0)->IsPhi());
-  EXPECT_INS_EQ(final_read->InputAt(0)->InputAt(0), moved_ni);
-  EXPECT_INS_EQ(final_read->InputAt(0)->InputAt(1), get_initial);
-}
-
-// // ENTRY
-// obj = new Obj();
-// obj.field = 3;
-// if (parameter_value) {
-//   // LEFT
-//   escape(obj);
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   obj.field = 2;
-// }
-// // MERGE
-// if (second_param) {
-//   // NON_ESCAPE
-//   obj.field = 1;
-//   noescape();
-// }
-// EXIT
-// predicated-ELIMINATE
-// return obj.field
-TEST_F(LoadStoreEliminationTest, PredicatedLoad2) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "merge"},
-                                                  {"right", "merge"},
-                                                  {"merge", "non_escape"},
-                                                  {"non_escape", "breturn"},
-                                                  {"merge", "crit_break"},
-                                                  {"crit_break", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-  GET_BLOCK(merge);
-  GET_BLOCK(non_escape);
-  GET_BLOCK(crit_break);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(merge, {left, right});
-  EnsurePredecessorOrder(breturn, {crit_break, non_escape});
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* bool_value2 = MakeParam(DataType::Type::kBool);
-  HInstruction* null_const = graph_->GetNullConstant();
-  HInstruction* c1 = graph_->GetIntConstant(1);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* write_entry = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_entry);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* merge_if = new (GetAllocator()) HIf(bool_value2);
-  merge->AddInstruction(merge_if);
-
-  crit_break->AddInstruction(new (GetAllocator()) HGoto());
-
-  HInstruction* write_non_escape = MakeIFieldSet(new_inst, c1, MemberOffset(32));
-  HInstruction* non_escape_call = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* non_escape_goto = new (GetAllocator()) HGoto();
-  non_escape->AddInstruction(write_non_escape);
-  non_escape->AddInstruction(non_escape_call);
-  non_escape->AddInstruction(non_escape_goto);
-  non_escape_call->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_REMOVED(read_bottom);
-  EXPECT_INS_REMOVED(write_right);
-  EXPECT_INS_RETAINED(call_left);
-  std::vector<HPhi*> merges;
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  std::tie(merges) = FindAllInstructions<HPhi>(graph_);
-  ASSERT_EQ(merges.size(), 3u);
-  HPhi* merge_value_return = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kInt32 && p->GetBlock() == breturn;
-  });
-  HPhi* merge_value_merge = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kInt32 && p->GetBlock() != breturn;
-  });
-  HPhi* merge_alloc = FindOrNull(merges.begin(), merges.end(), [](HPhi* p) {
-    return p->GetType() == DataType::Type::kReference;
-  });
-  ASSERT_NE(merge_alloc, nullptr);
-  EXPECT_TRUE(merge_alloc->InputAt(0)->IsNewInstance()) << *merge_alloc;
-  EXPECT_INS_EQ(merge_alloc->InputAt(0)->InputAt(0), cls)
-      << " phi is: " << merge_alloc->DumpWithArgs();
-  EXPECT_INS_EQ(merge_alloc->InputAt(1), null_const);
-  ASSERT_NE(pred_get, nullptr);
-  EXPECT_INS_EQ(pred_get->GetTarget(), merge_alloc);
-  EXPECT_INS_EQ(pred_get->GetDefaultValue(), merge_value_return)
-      << "get is " << pred_get->DumpWithArgs();
-  EXPECT_INS_EQ(merge_value_return->InputAt(0), merge_value_merge)
-      << " phi is: " << *merge_value_return;
-  EXPECT_INS_EQ(merge_value_return->InputAt(1), c1)
-      << " phi is: " << merge_value_return->DumpWithArgs();
-  EXPECT_INS_EQ(merge_value_merge->InputAt(0), graph_->GetIntConstant(0))
-      << " phi is: " << *merge_value_merge;
-  EXPECT_INS_EQ(merge_value_merge->InputAt(1), c2)
-      << " phi is: " << merge_value_merge->DumpWithArgs();
-}
-
-// // ENTRY
-// obj = new Obj();
-// obj.field = 3;
-// if (parameter_value) {
-//   // LEFT
-//   escape(obj);
-// } else {
-//   // RIGHT
-//   // ELIMINATE
-//   obj.field = 2;
-// }
-// // MERGE
-// if (second_param) {
-//   // NON_ESCAPE
-//   obj.field = 1;
-// }
-// noescape();
-// EXIT
-// predicated-ELIMINATE
-// return obj.field
-TEST_F(LoadStoreEliminationTest, PredicatedLoad3) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "merge"},
-                                                  {"right", "merge"},
-                                                  {"merge", "non_escape"},
-                                                  {"non_escape", "breturn"},
-                                                  {"merge", "crit_break"},
-                                                  {"crit_break", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-  GET_BLOCK(merge);
-  GET_BLOCK(crit_break);
-  GET_BLOCK(non_escape);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(merge, {left, right});
-  EnsurePredecessorOrder(breturn, {crit_break, non_escape});
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* bool_value2 = MakeParam(DataType::Type::kBool);
-  HInstruction* null_const = graph_->GetNullConstant();
-  HInstruction* c1 = graph_->GetIntConstant(1);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* write_entry = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_entry);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* merge_if = new (GetAllocator()) HIf(bool_value2);
-  merge->AddInstruction(merge_if);
-
-  HInstruction* write_non_escape = MakeIFieldSet(new_inst, c1, MemberOffset(32));
-  HInstruction* non_escape_goto = new (GetAllocator()) HGoto();
-  non_escape->AddInstruction(write_non_escape);
-  non_escape->AddInstruction(non_escape_goto);
-
-  crit_break->AddInstruction(new (GetAllocator()) HGoto());
-
-  HInstruction* bottom_call = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(bottom_call);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-  bottom_call->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_REMOVED(read_bottom);
-  EXPECT_INS_REMOVED(write_right);
-  EXPECT_INS_RETAINED(call_left);
-  std::vector<HPhi*> merges;
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  std::tie(merges) = FindAllInstructions<HPhi>(graph_);
-  ASSERT_EQ(merges.size(), 3u);
-  HPhi* merge_value_return = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kInt32 && p->GetBlock() == breturn;
-  });
-  HPhi* merge_value_merge = FindOrNull(merges.begin(), merges.end(), [&](HPhi* p) {
-    return p->GetType() == DataType::Type::kInt32 && p->GetBlock() != breturn;
-  });
-  HPhi* merge_alloc = FindOrNull(merges.begin(), merges.end(), [](HPhi* p) {
-    return p->GetType() == DataType::Type::kReference;
-  });
-  ASSERT_NE(merge_alloc, nullptr);
-  EXPECT_TRUE(merge_alloc->InputAt(0)->IsNewInstance()) << merge_alloc->DumpWithArgs();
-  EXPECT_INS_EQ(merge_alloc->InputAt(0)->InputAt(0), cls)
-      << " phi is: " << merge_alloc->DumpWithArgs();
-  EXPECT_INS_EQ(merge_alloc->InputAt(1), null_const);
-  ASSERT_NE(pred_get, nullptr);
-  EXPECT_INS_EQ(pred_get->GetTarget(), merge_alloc);
-  EXPECT_INS_EQ(pred_get->GetDefaultValue(), merge_value_return)
-      << "get is " << pred_get->DumpWithArgs();
-  EXPECT_INS_EQ(merge_value_return->InputAt(0), merge_value_merge)
-      << " phi is: " << *merge_value_return;
-  EXPECT_INS_EQ(merge_value_return->InputAt(1), c1) << " phi is: " << *merge_value_return;
-  EXPECT_INS_EQ(merge_value_merge->InputAt(0), graph_->GetIntConstant(0))
-      << " phi is: " << *merge_value_merge;
-  EXPECT_INS_EQ(merge_value_merge->InputAt(1), c2) << " phi is: " << *merge_value_merge;
-}
-
-// // ENTRY
-// obj = new Obj();
-// if (parameter_value) {
-//   // LEFT
-//   obj.field = 3;
-//   escape(obj);
-// } else {
-//   // RIGHT - Leave it as default value
-// }
-// EXIT
-// predicated-ELIMINATE
-// return obj.field
-TEST_F(LoadStoreEliminationTest, PredicatedLoadDefaultValue) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {left, right});
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* null_const = graph_->GetNullConstant();
-  HInstruction* c0 = graph_->GetIntConstant(0);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_left = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(write_left);
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(goto_right);
-
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_REMOVED(read_bottom);
-  EXPECT_INS_RETAINED(write_left);
-  EXPECT_INS_RETAINED(call_left);
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  HPhi* merge_alloc = FindSingleInstruction<HPhi>(graph_, breturn);
-  ASSERT_NE(merge_alloc, nullptr);
-  EXPECT_TRUE(merge_alloc->InputAt(0)->IsNewInstance()) << *merge_alloc;
-  EXPECT_EQ(merge_alloc->InputAt(0)->InputAt(0), cls) << *merge_alloc << " cls? " << *cls;
-  EXPECT_EQ(merge_alloc->InputAt(1), null_const);
-  ASSERT_NE(pred_get, nullptr);
-  EXPECT_INS_EQ(pred_get->GetTarget(), merge_alloc);
-  EXPECT_INS_EQ(pred_get->GetDefaultValue(), c0) << " pred-get is: " << *pred_get;
-}
-
-// // ENTRY
-// obj = new Obj();
-// // ALL should be kept
-// switch (parameter_value) {
-//   case 1:
-//     // Case1
-//     obj.field = 1;
-//     call_func(obj);
-//     break;
-//   case 2:
-//     // Case2
-//     obj.field = 2;
-//     call_func(obj);
-//     break;
-//   default:
-//     // Case3
-//     obj.field = 3;
-//     do {
-//       if (test2()) { } else { obj.field = 5; }
-//     } while (test());
-//     break;
-// }
-// EXIT
-// // predicated-ELIMINATE
-// return obj.field
-TEST_F(LoadStoreEliminationTest, PartialLoopPhis1) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "bswitch"},
-                                                  {"bswitch", "case1"},
-                                                  {"bswitch", "case2"},
-                                                  {"bswitch", "case3"},
-                                                  {"case1", "breturn"},
-                                                  {"case2", "breturn"},
-                                                  {"case3", "loop_pre_header"},
-                                                  {"loop_pre_header", "loop_header"},
-                                                  {"loop_header", "loop_body"},
-                                                  {"loop_body", "loop_if_left"},
-                                                  {"loop_body", "loop_if_right"},
-                                                  {"loop_if_left", "loop_merge"},
-                                                  {"loop_if_right", "loop_merge"},
-                                                  {"loop_merge", "loop_end"},
-                                                  {"loop_end", "loop_header"},
-                                                  {"loop_end", "critical_break"},
-                                                  {"critical_break", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(bswitch);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(case1);
-  GET_BLOCK(case2);
-  GET_BLOCK(case3);
-
-  GET_BLOCK(loop_pre_header);
-  GET_BLOCK(loop_header);
-  GET_BLOCK(loop_body);
-  GET_BLOCK(loop_if_left);
-  GET_BLOCK(loop_if_right);
-  GET_BLOCK(loop_merge);
-  GET_BLOCK(loop_end);
-  GET_BLOCK(critical_break);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {case1, case2, critical_break});
-  EnsurePredecessorOrder(loop_header, {loop_pre_header, loop_end});
-  EnsurePredecessorOrder(loop_merge, {loop_if_left, loop_if_right});
-  CHECK_SUBROUTINE_FAILURE();
-  HInstruction* switch_val = MakeParam(DataType::Type::kInt32);
-  HInstruction* c1 = graph_->GetIntConstant(1);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c5 = graph_->GetIntConstant(5);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* entry_goto = new (GetAllocator()) HGoto();
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(entry_goto);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* switch_inst = new (GetAllocator()) HPackedSwitch(0, 2, switch_val);
-  bswitch->AddInstruction(switch_inst);
-
-  HInstruction* write_c1 = MakeIFieldSet(new_inst, c1, MemberOffset(32));
-  HInstruction* call_c1 = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_c1 = new (GetAllocator()) HGoto();
-  case1->AddInstruction(write_c1);
-  case1->AddInstruction(call_c1);
-  case1->AddInstruction(goto_c1);
-  call_c1->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_c2 = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* call_c2 = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_c2 = new (GetAllocator()) HGoto();
-  case2->AddInstruction(write_c2);
-  case2->AddInstruction(call_c2);
-  case2->AddInstruction(goto_c2);
-  call_c2->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_c3 = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* goto_c3 = new (GetAllocator()) HGoto();
-  case3->AddInstruction(write_c3);
-  case3->AddInstruction(goto_c3);
-
-  HInstruction* goto_preheader = new (GetAllocator()) HGoto();
-  loop_pre_header->AddInstruction(goto_preheader);
-
-  HInstruction* suspend_check_header = new (GetAllocator()) HSuspendCheck();
-  HInstruction* goto_header = new (GetAllocator()) HGoto();
-  loop_header->AddInstruction(suspend_check_header);
-  loop_header->AddInstruction(goto_header);
-  suspend_check_header->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_loop_body = MakeInvoke(DataType::Type::kBool, {});
-  HInstruction* if_loop_body = new (GetAllocator()) HIf(call_loop_body);
-  loop_body->AddInstruction(call_loop_body);
-  loop_body->AddInstruction(if_loop_body);
-  call_loop_body->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* goto_loop_left = new (GetAllocator()) HGoto();
-  loop_if_left->AddInstruction(goto_loop_left);
-
-  HInstruction* write_loop_right = MakeIFieldSet(new_inst, c5, MemberOffset(32));
-  HInstruction* goto_loop_right = new (GetAllocator()) HGoto();
-  loop_if_right->AddInstruction(write_loop_right);
-  loop_if_right->AddInstruction(goto_loop_right);
-
-  HInstruction* goto_loop_merge = new (GetAllocator()) HGoto();
-  loop_merge->AddInstruction(goto_loop_merge);
-
-  HInstruction* call_end = MakeInvoke(DataType::Type::kBool, {});
-  HInstruction* if_end = new (GetAllocator()) HIf(call_end);
-  loop_end->AddInstruction(call_end);
-  loop_end->AddInstruction(if_end);
-  call_end->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* goto_critical_break = new (GetAllocator()) HGoto();
-  critical_break->AddInstruction(goto_critical_break);
-
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  EXPECT_INS_REMOVED(read_bottom) << *read_bottom;
-  ASSERT_TRUE(pred_get != nullptr);
-  HPhi* inst_return_phi = pred_get->GetTarget()->AsPhi();
-  ASSERT_TRUE(inst_return_phi != nullptr) << pred_get->GetTarget()->DumpWithArgs();
-  EXPECT_INS_EQ(inst_return_phi->InputAt(0),
-                FindSingleInstruction<HNewInstance>(graph_, case1->GetSinglePredecessor()));
-  EXPECT_INS_EQ(inst_return_phi->InputAt(1),
-                FindSingleInstruction<HNewInstance>(graph_, case2->GetSinglePredecessor()));
-  EXPECT_INS_EQ(inst_return_phi->InputAt(2), graph_->GetNullConstant());
-  HPhi* inst_value_phi = pred_get->GetDefaultValue()->AsPhi();
-  ASSERT_TRUE(inst_value_phi != nullptr) << pred_get->GetDefaultValue()->DumpWithArgs();
-  EXPECT_INS_EQ(inst_value_phi->InputAt(0), graph_->GetIntConstant(0));
-  EXPECT_INS_EQ(inst_value_phi->InputAt(1), graph_->GetIntConstant(0));
-  HPhi* loop_merge_phi = FindSingleInstruction<HPhi>(graph_, loop_merge);
-  ASSERT_TRUE(loop_merge_phi != nullptr);
-  HPhi* loop_header_phi = FindSingleInstruction<HPhi>(graph_, loop_header);
-  ASSERT_TRUE(loop_header_phi != nullptr);
-  EXPECT_INS_EQ(loop_header_phi->InputAt(0), c3);
-  EXPECT_INS_EQ(loop_header_phi->InputAt(1), loop_merge_phi);
-  EXPECT_INS_EQ(loop_merge_phi->InputAt(0), loop_header_phi);
-  EXPECT_INS_EQ(loop_merge_phi->InputAt(1), c5);
-  EXPECT_INS_EQ(inst_value_phi->InputAt(2), loop_merge_phi);
-  EXPECT_INS_RETAINED(write_c1) << *write_c1;
-  EXPECT_INS_RETAINED(write_c2) << *write_c2;
-  EXPECT_INS_REMOVED(write_c3) << *write_c3;
-  EXPECT_INS_REMOVED(write_loop_right) << *write_loop_right;
-}
-
-// // ENTRY
-// obj = new Obj();
-// switch (parameter_value) {
-//   case 1:
-//     // Case1
-//     obj.field = 1;
-//     call_func(obj);
-//     break;
-//   case 2:
-//     // Case2
-//     obj.field = 2;
-//     call_func(obj);
-//     break;
-//   default:
-//     // Case3
-//     obj.field = 3;
-//     while (!test()) {
-//       if (test2()) { } else { obj.field = 5; }
-//     }
-//     break;
-// }
-// EXIT
-// // predicated-ELIMINATE
-// return obj.field
-TEST_F(LoadStoreEliminationTest, PartialLoopPhis2) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "bswitch"},
-                                                  {"bswitch", "case1"},
-                                                  {"bswitch", "case2"},
-                                                  {"bswitch", "case3"},
-                                                  {"case1", "breturn"},
-                                                  {"case2", "breturn"},
-                                                  {"case3", "loop_pre_header"},
-
-                                                  {"loop_pre_header", "loop_header"},
-                                                  {"loop_header", "critical_break"},
-                                                  {"loop_header", "loop_body"},
-                                                  {"loop_body", "loop_if_left"},
-                                                  {"loop_body", "loop_if_right"},
-                                                  {"loop_if_left", "loop_merge"},
-                                                  {"loop_if_right", "loop_merge"},
-                                                  {"loop_merge", "loop_header"},
-
-                                                  {"critical_break", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(bswitch);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(case1);
-  GET_BLOCK(case2);
-  GET_BLOCK(case3);
-
-  GET_BLOCK(loop_pre_header);
-  GET_BLOCK(loop_header);
-  GET_BLOCK(loop_body);
-  GET_BLOCK(loop_if_left);
-  GET_BLOCK(loop_if_right);
-  GET_BLOCK(loop_merge);
-  GET_BLOCK(critical_break);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {case1, case2, critical_break});
-  EnsurePredecessorOrder(loop_header, {loop_pre_header, loop_merge});
-  EnsurePredecessorOrder(loop_merge, {loop_if_left, loop_if_right});
-  CHECK_SUBROUTINE_FAILURE();
-  HInstruction* switch_val = MakeParam(DataType::Type::kInt32);
-  HInstruction* c1 = graph_->GetIntConstant(1);
-  HInstruction* c2 = graph_->GetIntConstant(2);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c5 = graph_->GetIntConstant(5);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* entry_goto = new (GetAllocator()) HGoto();
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(entry_goto);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* switch_inst = new (GetAllocator()) HPackedSwitch(0, 2, switch_val);
-  bswitch->AddInstruction(switch_inst);
-
-  HInstruction* write_c1 = MakeIFieldSet(new_inst, c1, MemberOffset(32));
-  HInstruction* call_c1 = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_c1 = new (GetAllocator()) HGoto();
-  case1->AddInstruction(write_c1);
-  case1->AddInstruction(call_c1);
-  case1->AddInstruction(goto_c1);
-  call_c1->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_c2 = MakeIFieldSet(new_inst, c2, MemberOffset(32));
-  HInstruction* call_c2 = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_c2 = new (GetAllocator()) HGoto();
-  case2->AddInstruction(write_c2);
-  case2->AddInstruction(call_c2);
-  case2->AddInstruction(goto_c2);
-  call_c2->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_c3 = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* goto_c3 = new (GetAllocator()) HGoto();
-  case3->AddInstruction(write_c3);
-  case3->AddInstruction(goto_c3);
-
-  HInstruction* goto_preheader = new (GetAllocator()) HGoto();
-  loop_pre_header->AddInstruction(goto_preheader);
-
-  HInstruction* suspend_check_header = new (GetAllocator()) HSuspendCheck();
-  HInstruction* call_header = MakeInvoke(DataType::Type::kBool, {});
-  HInstruction* if_header = new (GetAllocator()) HIf(call_header);
-  loop_header->AddInstruction(suspend_check_header);
-  loop_header->AddInstruction(call_header);
-  loop_header->AddInstruction(if_header);
-  call_header->CopyEnvironmentFrom(cls->GetEnvironment());
-  suspend_check_header->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_loop_body = MakeInvoke(DataType::Type::kBool, {});
-  HInstruction* if_loop_body = new (GetAllocator()) HIf(call_loop_body);
-  loop_body->AddInstruction(call_loop_body);
-  loop_body->AddInstruction(if_loop_body);
-  call_loop_body->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* goto_loop_left = new (GetAllocator()) HGoto();
-  loop_if_left->AddInstruction(goto_loop_left);
-
-  HInstruction* write_loop_right = MakeIFieldSet(new_inst, c5, MemberOffset(32));
-  HInstruction* goto_loop_right = new (GetAllocator()) HGoto();
-  loop_if_right->AddInstruction(write_loop_right);
-  loop_if_right->AddInstruction(goto_loop_right);
-
-  HInstruction* goto_loop_merge = new (GetAllocator()) HGoto();
-  loop_merge->AddInstruction(goto_loop_merge);
-
-  HInstruction* goto_critical_break = new (GetAllocator()) HGoto();
-  critical_break->AddInstruction(goto_critical_break);
-
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  EXPECT_INS_REMOVED(read_bottom) << *read_bottom;
-  ASSERT_TRUE(pred_get != nullptr);
-  HPhi* inst_return_phi = pred_get->GetTarget()->AsPhi();
-  ASSERT_TRUE(inst_return_phi != nullptr) << pred_get->GetTarget()->DumpWithArgs();
-  EXPECT_INS_EQ(inst_return_phi->InputAt(0),
-                FindSingleInstruction<HNewInstance>(graph_, case1->GetSinglePredecessor()));
-  EXPECT_INS_EQ(inst_return_phi->InputAt(1),
-                FindSingleInstruction<HNewInstance>(graph_, case2->GetSinglePredecessor()));
-  EXPECT_INS_EQ(inst_return_phi->InputAt(2), graph_->GetNullConstant());
-  HPhi* inst_value_phi = pred_get->GetDefaultValue()->AsPhi();
-  ASSERT_TRUE(inst_value_phi != nullptr) << pred_get->GetDefaultValue()->DumpWithArgs();
-  EXPECT_INS_EQ(inst_value_phi->InputAt(0), graph_->GetIntConstant(0));
-  EXPECT_INS_EQ(inst_value_phi->InputAt(1), graph_->GetIntConstant(0));
-  HPhi* loop_merge_phi = FindSingleInstruction<HPhi>(graph_, loop_merge);
-  ASSERT_TRUE(loop_merge_phi != nullptr);
-  HPhi* loop_header_phi = FindSingleInstruction<HPhi>(graph_, loop_header);
-  ASSERT_TRUE(loop_header_phi != nullptr);
-  EXPECT_INS_EQ(loop_header_phi->InputAt(0), c3);
-  EXPECT_INS_EQ(loop_header_phi->InputAt(1), loop_merge_phi);
-  EXPECT_INS_EQ(loop_merge_phi->InputAt(0), loop_header_phi);
-  EXPECT_INS_EQ(loop_merge_phi->InputAt(1), c5);
-  EXPECT_INS_EQ(inst_value_phi->InputAt(2), loop_header_phi);
-  EXPECT_INS_RETAINED(write_c1) << *write_c1;
-  EXPECT_INS_RETAINED(write_c2) << *write_c2;
-  EXPECT_INS_REMOVED(write_c3) << *write_c3;
-  EXPECT_INS_REMOVED(write_loop_right) << *write_loop_right;
-}
-
-// // ENTRY
-// obj = new Obj();
-// obj.field = 3;
-// while (!test()) {
-//   if (test2()) { } else { obj.field = 5; }
-// }
-// if (parameter_value) {
-//   escape(obj);
-// }
-// EXIT
-// return obj.field
-TEST_F(LoadStoreEliminationTest, PartialLoopPhis3) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "loop_pre_header"},
-
-                                                  {"loop_pre_header", "loop_header"},
-                                                  {"loop_header", "escape_check"},
-                                                  {"loop_header", "loop_body"},
-                                                  {"loop_body", "loop_if_left"},
-                                                  {"loop_body", "loop_if_right"},
-                                                  {"loop_if_left", "loop_merge"},
-                                                  {"loop_if_right", "loop_merge"},
-                                                  {"loop_merge", "loop_header"},
-
-                                                  {"escape_check", "escape"},
-                                                  {"escape_check", "no_escape"},
-                                                  {"no_escape", "breturn"},
-                                                  {"escape", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(no_escape);
-  GET_BLOCK(escape);
-  GET_BLOCK(escape_check);
-
-  GET_BLOCK(loop_pre_header);
-  GET_BLOCK(loop_header);
-  GET_BLOCK(loop_body);
-  GET_BLOCK(loop_if_left);
-  GET_BLOCK(loop_if_right);
-  GET_BLOCK(loop_merge);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {no_escape, escape});
-  EnsurePredecessorOrder(loop_header, {loop_pre_header, loop_merge});
-  EnsurePredecessorOrder(loop_merge, {loop_if_left, loop_if_right});
-  CHECK_SUBROUTINE_FAILURE();
-  HInstruction* bool_val = MakeParam(DataType::Type::kBool);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c5 = graph_->GetIntConstant(5);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* entry_goto = new (GetAllocator()) HGoto();
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(entry_goto);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_pre_header = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* goto_preheader = new (GetAllocator()) HGoto();
-  loop_pre_header->AddInstruction(write_pre_header);
-  loop_pre_header->AddInstruction(goto_preheader);
-
-  HInstruction* suspend_check_header = new (GetAllocator()) HSuspendCheck();
-  HInstruction* call_header = MakeInvoke(DataType::Type::kBool, {});
-  HInstruction* if_header = new (GetAllocator()) HIf(call_header);
-  loop_header->AddInstruction(suspend_check_header);
-  loop_header->AddInstruction(call_header);
-  loop_header->AddInstruction(if_header);
-  call_header->CopyEnvironmentFrom(cls->GetEnvironment());
-  suspend_check_header->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_loop_body = MakeInvoke(DataType::Type::kBool, {});
-  HInstruction* if_loop_body = new (GetAllocator()) HIf(call_loop_body);
-  loop_body->AddInstruction(call_loop_body);
-  loop_body->AddInstruction(if_loop_body);
-  call_loop_body->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* goto_loop_left = new (GetAllocator()) HGoto();
-  loop_if_left->AddInstruction(goto_loop_left);
-
-  HInstruction* write_loop_right = MakeIFieldSet(new_inst, c5, MemberOffset(32));
-  HInstruction* goto_loop_right = new (GetAllocator()) HGoto();
-  loop_if_right->AddInstruction(write_loop_right);
-  loop_if_right->AddInstruction(goto_loop_right);
-
-  HInstruction* goto_loop_merge = new (GetAllocator()) HGoto();
-  loop_merge->AddInstruction(goto_loop_merge);
-
-  HInstruction* if_esc_check = new (GetAllocator()) HIf(bool_val);
-  escape_check->AddInstruction(if_esc_check);
-
-  HInstruction* call_escape = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_escape = new (GetAllocator()) HGoto();
-  escape->AddInstruction(call_escape);
-  escape->AddInstruction(goto_escape);
-  call_escape->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* goto_no_escape = new (GetAllocator()) HGoto();
-  no_escape->AddInstruction(goto_no_escape);
-
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  EXPECT_INS_REMOVED(read_bottom) << *read_bottom;
-  ASSERT_TRUE(pred_get != nullptr);
-  HPhi* inst_return_phi = pred_get->GetTarget()->AsPhi();
-  ASSERT_TRUE(inst_return_phi != nullptr) << pred_get->GetTarget()->DumpWithArgs();
-  EXPECT_INS_EQ(inst_return_phi->InputAt(0), graph_->GetNullConstant());
-  EXPECT_INS_EQ(inst_return_phi->InputAt(1),
-                FindSingleInstruction<HNewInstance>(graph_, escape->GetSinglePredecessor()));
-  HPhi* inst_value_phi = pred_get->GetDefaultValue()->AsPhi();
-  ASSERT_TRUE(inst_value_phi != nullptr) << pred_get->GetDefaultValue()->DumpWithArgs();
-  HPhi* loop_header_phi = FindSingleInstruction<HPhi>(graph_, loop_header);
-  HPhi* loop_merge_phi = FindSingleInstruction<HPhi>(graph_, loop_merge);
-  EXPECT_INS_EQ(inst_value_phi->InputAt(0), loop_header_phi);
-  EXPECT_INS_EQ(inst_value_phi->InputAt(1), graph_->GetIntConstant(0));
-  EXPECT_INS_EQ(loop_header_phi->InputAt(0), c3);
-  EXPECT_INS_EQ(loop_header_phi->InputAt(1), loop_merge_phi);
-  EXPECT_INS_EQ(loop_merge_phi->InputAt(0), loop_header_phi);
-  EXPECT_INS_EQ(loop_merge_phi->InputAt(1), c5);
-  HInstanceFieldSet* mat_set =
-      FindSingleInstruction<HInstanceFieldSet>(graph_, escape->GetSinglePredecessor());
-  ASSERT_NE(mat_set, nullptr);
-  EXPECT_INS_EQ(mat_set->InputAt(1), loop_header_phi);
-  EXPECT_INS_REMOVED(write_loop_right) << *write_loop_right;
-  EXPECT_INS_REMOVED(write_pre_header) << *write_pre_header;
-}
-
-// // ENTRY
-// obj = new Obj();
-// if (parameter_value) {
-//   escape(obj);
-// }
-// obj.field = 3;
-// while (!test()) {
-//   if (test2()) { } else { obj.field = 5; }
-// }
-// EXIT
-// return obj.field
-TEST_F(LoadStoreEliminationTest, PartialLoopPhis4) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "escape_check"},
-                                                  {"escape_check", "escape"},
-                                                  {"escape_check", "no_escape"},
-                                                  {"no_escape", "loop_pre_header"},
-                                                  {"escape", "loop_pre_header"},
-
-                                                  {"loop_pre_header", "loop_header"},
-                                                  {"loop_header", "breturn"},
-                                                  {"loop_header", "loop_body"},
-                                                  {"loop_body", "loop_if_left"},
-                                                  {"loop_body", "loop_if_right"},
-                                                  {"loop_if_left", "loop_merge"},
-                                                  {"loop_if_right", "loop_merge"},
-                                                  {"loop_merge", "loop_header"},
-
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(no_escape);
-  GET_BLOCK(escape);
-  GET_BLOCK(escape_check);
-
-  GET_BLOCK(loop_pre_header);
-  GET_BLOCK(loop_header);
-  GET_BLOCK(loop_body);
-  GET_BLOCK(loop_if_left);
-  GET_BLOCK(loop_if_right);
-  GET_BLOCK(loop_merge);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(loop_pre_header, {no_escape, escape});
-  EnsurePredecessorOrder(loop_header, {loop_pre_header, loop_merge});
-  EnsurePredecessorOrder(loop_merge, {loop_if_left, loop_if_right});
-  CHECK_SUBROUTINE_FAILURE();
-  HInstruction* bool_val = MakeParam(DataType::Type::kBool);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c5 = graph_->GetIntConstant(5);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* entry_goto = new (GetAllocator()) HGoto();
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(entry_goto);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* if_esc_check = new (GetAllocator()) HIf(bool_val);
-  escape_check->AddInstruction(if_esc_check);
-
-  HInstruction* call_escape = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_escape = new (GetAllocator()) HGoto();
-  escape->AddInstruction(call_escape);
-  escape->AddInstruction(goto_escape);
-  call_escape->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* goto_no_escape = new (GetAllocator()) HGoto();
-  no_escape->AddInstruction(goto_no_escape);
-
-  HInstruction* write_pre_header = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* goto_preheader = new (GetAllocator()) HGoto();
-  loop_pre_header->AddInstruction(write_pre_header);
-  loop_pre_header->AddInstruction(goto_preheader);
-
-  HInstruction* suspend_check_header = new (GetAllocator()) HSuspendCheck();
-  HInstruction* call_header = MakeInvoke(DataType::Type::kBool, {});
-  HInstruction* if_header = new (GetAllocator()) HIf(call_header);
-  loop_header->AddInstruction(suspend_check_header);
-  loop_header->AddInstruction(call_header);
-  loop_header->AddInstruction(if_header);
-  call_header->CopyEnvironmentFrom(cls->GetEnvironment());
-  suspend_check_header->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_loop_body = MakeInvoke(DataType::Type::kBool, {});
-  HInstruction* if_loop_body = new (GetAllocator()) HIf(call_loop_body);
-  loop_body->AddInstruction(call_loop_body);
-  loop_body->AddInstruction(if_loop_body);
-  call_loop_body->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* goto_loop_left = new (GetAllocator()) HGoto();
-  loop_if_left->AddInstruction(goto_loop_left);
-
-  HInstruction* write_loop_right = MakeIFieldSet(new_inst, c5, MemberOffset(32));
-  HInstruction* goto_loop_right = new (GetAllocator()) HGoto();
-  loop_if_right->AddInstruction(write_loop_right);
-  loop_if_right->AddInstruction(goto_loop_right);
-
-  HInstruction* goto_loop_merge = new (GetAllocator()) HGoto();
-  loop_merge->AddInstruction(goto_loop_merge);
-
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  EXPECT_INS_REMOVED(read_bottom) << *read_bottom;
-  ASSERT_TRUE(pred_get != nullptr);
-  HPhi* inst_return_phi = pred_get->GetTarget()->AsPhi();
-  ASSERT_TRUE(inst_return_phi != nullptr) << pred_get->GetTarget()->DumpWithArgs();
-  EXPECT_INS_EQ(inst_return_phi->InputAt(0), graph_->GetNullConstant());
-  EXPECT_INS_EQ(inst_return_phi->InputAt(1),
-                FindSingleInstruction<HNewInstance>(graph_, escape->GetSinglePredecessor()));
-  HPhi* inst_value_phi = pred_get->GetDefaultValue()->AsPhi();
-  ASSERT_TRUE(inst_value_phi != nullptr) << pred_get->GetDefaultValue()->DumpWithArgs();
-  HPhi* loop_header_phi = FindSingleInstruction<HPhi>(graph_, loop_header);
-  HPhi* loop_merge_phi = FindSingleInstruction<HPhi>(graph_, loop_merge);
-  EXPECT_INS_EQ(inst_value_phi, loop_header_phi);
-  EXPECT_INS_EQ(loop_header_phi->InputAt(0), c3);
-  EXPECT_INS_EQ(loop_header_phi->InputAt(1), loop_merge_phi);
-  EXPECT_INS_EQ(loop_merge_phi->InputAt(0), loop_header_phi);
-  EXPECT_INS_EQ(loop_merge_phi->InputAt(1), c5);
-  EXPECT_INS_RETAINED(write_loop_right) << *write_loop_right;
-  EXPECT_TRUE(write_loop_right->AsInstanceFieldSet()->GetIsPredicatedSet()) << *write_loop_right;
-  EXPECT_INS_RETAINED(write_pre_header) << *write_pre_header;
-  EXPECT_TRUE(write_pre_header->AsInstanceFieldSet()->GetIsPredicatedSet()) << *write_pre_header;
-}
-
-// // ENTRY
-// obj = new Obj();
-// obj.field = 3;
-// while (!test()) {
-//   if (test2()) { } else { obj.field += 5; }
-// }
-// if (parameter_value) {
-//   escape(obj);
-// }
-// EXIT
-// return obj.field
-TEST_F(LoadStoreEliminationTest, PartialLoopPhis5) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "loop_pre_header"},
-                                                  {"loop_pre_header", "loop_header"},
-                                                  {"loop_header", "escape_check"},
-                                                  {"loop_header", "loop_body"},
-                                                  {"loop_body", "loop_if_left"},
-                                                  {"loop_body", "loop_if_right"},
-                                                  {"loop_if_left", "loop_merge"},
-                                                  {"loop_if_right", "loop_merge"},
-                                                  {"loop_merge", "loop_header"},
-                                                  {"escape_check", "escape"},
-                                                  {"escape_check", "no_escape"},
-                                                  {"no_escape", "breturn"},
-                                                  {"escape", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(no_escape);
-  GET_BLOCK(escape);
-  GET_BLOCK(escape_check);
-
-  GET_BLOCK(loop_pre_header);
-  GET_BLOCK(loop_header);
-  GET_BLOCK(loop_body);
-  GET_BLOCK(loop_if_left);
-  GET_BLOCK(loop_if_right);
-  GET_BLOCK(loop_merge);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {no_escape, escape});
-  EnsurePredecessorOrder(loop_header, {loop_pre_header, loop_merge});
-  EnsurePredecessorOrder(loop_merge, {loop_if_left, loop_if_right});
-  CHECK_SUBROUTINE_FAILURE();
-  HInstruction* bool_val = MakeParam(DataType::Type::kBool);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c5 = graph_->GetIntConstant(5);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* entry_goto = new (GetAllocator()) HGoto();
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(entry_goto);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_pre_header = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* goto_preheader = new (GetAllocator()) HGoto();
-  loop_pre_header->AddInstruction(write_pre_header);
-  loop_pre_header->AddInstruction(goto_preheader);
-
-  HInstruction* suspend_check_header = new (GetAllocator()) HSuspendCheck();
-  HInstruction* call_header = MakeInvoke(DataType::Type::kBool, {});
-  HInstruction* if_header = new (GetAllocator()) HIf(call_header);
-  loop_header->AddInstruction(suspend_check_header);
-  loop_header->AddInstruction(call_header);
-  loop_header->AddInstruction(if_header);
-  call_header->CopyEnvironmentFrom(cls->GetEnvironment());
-  suspend_check_header->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_loop_body = MakeInvoke(DataType::Type::kBool, {});
-  HInstruction* if_loop_body = new (GetAllocator()) HIf(call_loop_body);
-  loop_body->AddInstruction(call_loop_body);
-  loop_body->AddInstruction(if_loop_body);
-  call_loop_body->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* goto_loop_left = new (GetAllocator()) HGoto();
-  loop_if_left->AddInstruction(goto_loop_left);
-
-  HInstruction* read_loop_right = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* add_loop_right =
-      new (GetAllocator()) HAdd(DataType::Type::kInt32, read_loop_right, c5);
-  HInstruction* write_loop_right = MakeIFieldSet(new_inst, add_loop_right, MemberOffset(32));
-  HInstruction* goto_loop_right = new (GetAllocator()) HGoto();
-  loop_if_right->AddInstruction(read_loop_right);
-  loop_if_right->AddInstruction(add_loop_right);
-  loop_if_right->AddInstruction(write_loop_right);
-  loop_if_right->AddInstruction(goto_loop_right);
-
-  HInstruction* goto_loop_merge = new (GetAllocator()) HGoto();
-  loop_merge->AddInstruction(goto_loop_merge);
-
-  HInstruction* if_esc_check = new (GetAllocator()) HIf(bool_val);
-  escape_check->AddInstruction(if_esc_check);
-
-  HInstruction* call_escape = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_escape = new (GetAllocator()) HGoto();
-  escape->AddInstruction(call_escape);
-  escape->AddInstruction(goto_escape);
-  call_escape->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* goto_no_escape = new (GetAllocator()) HGoto();
-  no_escape->AddInstruction(goto_no_escape);
-
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  EXPECT_INS_REMOVED(read_bottom) << *read_bottom;
-  ASSERT_TRUE(pred_get != nullptr);
-  HPhi* inst_return_phi = pred_get->GetTarget()->AsPhi();
-  ASSERT_TRUE(inst_return_phi != nullptr) << pred_get->GetTarget()->DumpWithArgs();
-  EXPECT_INS_EQ(inst_return_phi->InputAt(0), graph_->GetNullConstant());
-  EXPECT_INS_EQ(inst_return_phi->InputAt(1),
-                FindSingleInstruction<HNewInstance>(graph_, escape->GetSinglePredecessor()));
-  HPhi* inst_value_phi = pred_get->GetDefaultValue()->AsPhi();
-  ASSERT_TRUE(inst_value_phi != nullptr) << pred_get->GetDefaultValue()->DumpWithArgs();
-  HPhi* loop_header_phi = FindSingleInstruction<HPhi>(graph_, loop_header);
-  HPhi* loop_merge_phi = FindSingleInstruction<HPhi>(graph_, loop_merge);
-  EXPECT_INS_EQ(inst_value_phi->InputAt(0), loop_header_phi);
-  EXPECT_INS_EQ(inst_value_phi->InputAt(1), graph_->GetIntConstant(0));
-  EXPECT_INS_EQ(loop_header_phi->InputAt(0), c3);
-  EXPECT_INS_EQ(loop_header_phi->InputAt(1), loop_merge_phi);
-  EXPECT_INS_EQ(loop_merge_phi->InputAt(0), loop_header_phi);
-  EXPECT_INS_EQ(loop_merge_phi->InputAt(1), add_loop_right);
-  EXPECT_INS_EQ(add_loop_right->InputAt(0), loop_header_phi);
-  EXPECT_INS_EQ(add_loop_right->InputAt(1), c5);
-  HInstanceFieldSet* mat_set =
-      FindSingleInstruction<HInstanceFieldSet>(graph_, escape->GetSinglePredecessor());
-  ASSERT_NE(mat_set, nullptr);
-  EXPECT_INS_EQ(mat_set->InputAt(1), loop_header_phi);
-  EXPECT_INS_REMOVED(write_loop_right) << *write_loop_right;
-  EXPECT_INS_REMOVED(write_pre_header) << *write_pre_header;
-}
-
-// // ENTRY
-// obj = new Obj();
-// obj.field = 3;
-// if (param) {
-//   while (!test()) {
-//     if (test2()) {
-//       noescape();
-//     } else {
-//       abc = obj.field;
-//       obj.field = abc + 5;
-//       noescape();
-//     }
-//   }
-//   escape(obj);
-// } else {
-// }
-// return obj.field
-TEST_F(LoadStoreEliminationTest, PartialLoopPhis6) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(/*handles=*/&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "start"},
-                                                  {"start", "left"},
-                                                  {"start", "right"},
-                                                  {"left", "loop_pre_header"},
-
-                                                  {"loop_pre_header", "loop_header"},
-                                                  {"loop_header", "escape"},
-                                                  {"loop_header", "loop_body"},
-                                                  {"loop_body", "loop_if_left"},
-                                                  {"loop_body", "loop_if_right"},
-                                                  {"loop_if_left", "loop_header"},
-                                                  {"loop_if_right", "loop_header"},
-
-                                                  {"escape", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-  GET_BLOCK(start);
-  GET_BLOCK(escape);
-
-  GET_BLOCK(loop_pre_header);
-  GET_BLOCK(loop_header);
-  GET_BLOCK(loop_body);
-  GET_BLOCK(loop_if_left);
-  GET_BLOCK(loop_if_right);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {escape, right});
-  EnsurePredecessorOrder(loop_header, {loop_pre_header, loop_if_left, loop_if_right});
-  CHECK_SUBROUTINE_FAILURE();
-  HInstruction* bool_val = MakeParam(DataType::Type::kBool);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c5 = graph_->GetIntConstant(5);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* write_entry = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* entry_goto = new (GetAllocator()) HGoto();
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_entry);
-  entry->AddInstruction(entry_goto);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  start->AddInstruction(new (GetAllocator()) HIf(bool_val));
-
-  HInstruction* left_goto = new (GetAllocator()) HGoto();
-  left->AddInstruction(left_goto);
-
-  HInstruction* goto_preheader = new (GetAllocator()) HGoto();
-  loop_pre_header->AddInstruction(goto_preheader);
-
-  HInstruction* suspend_check_header = new (GetAllocator()) HSuspendCheck();
-  HInstruction* call_header = MakeInvoke(DataType::Type::kBool, {});
-  HInstruction* if_header = new (GetAllocator()) HIf(call_header);
-  loop_header->AddInstruction(suspend_check_header);
-  loop_header->AddInstruction(call_header);
-  loop_header->AddInstruction(if_header);
-  call_header->CopyEnvironmentFrom(cls->GetEnvironment());
-  suspend_check_header->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_loop_body = MakeInvoke(DataType::Type::kBool, {});
-  HInstruction* if_loop_body = new (GetAllocator()) HIf(call_loop_body);
-  loop_body->AddInstruction(call_loop_body);
-  loop_body->AddInstruction(if_loop_body);
-  call_loop_body->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_loop_left = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* goto_loop_left = new (GetAllocator()) HGoto();
-  loop_if_left->AddInstruction(call_loop_left);
-  loop_if_left->AddInstruction(goto_loop_left);
-  call_loop_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* read_loop_right = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* add_loop_right =
-      new (GetAllocator()) HAdd(DataType::Type::kInt32, c5, read_loop_right);
-  HInstruction* write_loop_right = MakeIFieldSet(new_inst, add_loop_right, MemberOffset(32));
-  HInstruction* call_loop_right = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* goto_loop_right = new (GetAllocator()) HGoto();
-  loop_if_right->AddInstruction(read_loop_right);
-  loop_if_right->AddInstruction(add_loop_right);
-  loop_if_right->AddInstruction(write_loop_right);
-  loop_if_right->AddInstruction(call_loop_right);
-  loop_if_right->AddInstruction(goto_loop_right);
-  call_loop_right->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_escape = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_escape = new (GetAllocator()) HGoto();
-  escape->AddInstruction(call_escape);
-  escape->AddInstruction(goto_escape);
-  call_escape->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(goto_right);
-
-  HInstruction* read_bottom = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_bottom);
-  breturn->AddInstruction(read_bottom);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  EXPECT_INS_REMOVED(read_bottom) << *read_bottom;
-  ASSERT_TRUE(pred_get != nullptr);
-  HPhi* inst_return_phi = pred_get->GetTarget()->AsPhi();
-  ASSERT_TRUE(inst_return_phi != nullptr) << pred_get->GetTarget()->DumpWithArgs();
-  EXPECT_INS_EQ(inst_return_phi->InputAt(0),
-                FindSingleInstruction<HNewInstance>(graph_, escape->GetSinglePredecessor()));
-  EXPECT_INS_EQ(inst_return_phi->InputAt(1), graph_->GetNullConstant());
-  EXPECT_INS_EQ(pred_get->GetDefaultValue()->InputAt(0), graph_->GetIntConstant(0));
-  EXPECT_INS_EQ(pred_get->GetDefaultValue()->InputAt(1), c3);
-  HPhi* loop_header_phi = FindSingleInstruction<HPhi>(graph_, loop_header);
-  ASSERT_NE(loop_header_phi, nullptr);
-  EXPECT_INS_EQ(loop_header_phi->InputAt(0), c3);
-  EXPECT_INS_EQ(loop_header_phi->InputAt(1), loop_header_phi);
-  EXPECT_INS_EQ(loop_header_phi->InputAt(2), add_loop_right);
-  EXPECT_INS_EQ(add_loop_right->InputAt(0), c5);
-  EXPECT_INS_EQ(add_loop_right->InputAt(1), loop_header_phi);
-  HInstanceFieldSet* mat_set =
-      FindSingleInstruction<HInstanceFieldSet>(graph_, escape->GetSinglePredecessor());
-  ASSERT_NE(mat_set, nullptr);
-  EXPECT_INS_EQ(mat_set->InputAt(1), loop_header_phi);
-  EXPECT_INS_REMOVED(write_loop_right);
-  EXPECT_INS_REMOVED(write_entry);
-  EXPECT_INS_RETAINED(call_header);
-  EXPECT_INS_RETAINED(call_loop_left);
-  EXPECT_INS_RETAINED(call_loop_right);
-}
-
-// TODO This should really be in an Instruction simplifier Gtest but (1) that
-// doesn't exist and (2) we should move this simplification to directly in the
-// LSE pass since there is more information then.
-// // ENTRY
-// obj = new Obj();
-// obj.field = 3;
-// if (param) {
-//   escape(obj);
-// } else {
-//   obj.field = 10;
-// }
-// return obj.field;
-TEST_F(LoadStoreEliminationTest, SimplifyTest) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {left, right});
-
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c10 = graph_->GetIntConstant(10);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* write_start = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_start);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_right = MakeIFieldSet(new_inst, c10, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-
-  HInstruction* read_end = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_end);
-  breturn->AddInstruction(read_end);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  // Run the code-simplifier too
-  PerformSimplifications(blks);
-
-  EXPECT_INS_REMOVED(write_right);
-  EXPECT_INS_REMOVED(write_start);
-  EXPECT_INS_REMOVED(read_end);
-  EXPECT_INS_RETAINED(call_left);
-
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  ASSERT_NE(pred_get, nullptr);
-  EXPECT_INS_EQ(pred_get->GetDefaultValue(), c10);
-}
-
-
-// TODO This should really be in an Instruction simplifier Gtest but (1) that
-// doesn't exist and (2) we should move this simplification to directly in the
-// LSE pass since there is more information then.
-//
-// This checks that we don't replace phis when the replacement isn't valid at
-// that point (i.e. it doesn't dominate)
-// // ENTRY
-// obj = new Obj();
-// obj.field = 3;
-// if (param) {
-//   escape(obj);
-// } else {
-//   obj.field = noescape();
-// }
-// return obj.field;
-TEST_F(LoadStoreEliminationTest, SimplifyTest2) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "breturn"},
-                                                  {"right", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {left, right});
-
-  HInstruction* bool_value = MakeParam(DataType::Type::kBool);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* write_start = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(bool_value);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_start);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_left = MakeInvoke(DataType::Type::kVoid, {new_inst});
-  HInstruction* goto_left = new (GetAllocator()) HGoto();
-  left->AddInstruction(call_left);
-  left->AddInstruction(goto_left);
-  call_left->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_right = MakeInvoke(DataType::Type::kInt32, {});
-  HInstruction* write_right = MakeIFieldSet(new_inst, call_right, MemberOffset(32));
-  HInstruction* goto_right = new (GetAllocator()) HGoto();
-  right->AddInstruction(call_right);
-  right->AddInstruction(write_right);
-  right->AddInstruction(goto_right);
-  call_right->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* read_end = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_end);
-  breturn->AddInstruction(read_end);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  // Run the code-simplifier too
-  PerformSimplifications(blks);
-
-  EXPECT_INS_REMOVED(write_right);
-  EXPECT_INS_REMOVED(write_start);
-  EXPECT_INS_REMOVED(read_end);
-  EXPECT_INS_RETAINED(call_left);
-  EXPECT_INS_RETAINED(call_right);
-  EXPECT_EQ(call_right->GetBlock(), right);
-
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  ASSERT_NE(pred_get, nullptr);
-  EXPECT_TRUE(pred_get->GetDefaultValue()->IsPhi()) << pred_get->DumpWithArgs();
-  EXPECT_INS_EQ(pred_get->GetDefaultValue()->InputAt(0), graph_->GetIntConstant(0))
-      << pred_get->DumpWithArgs();
-  EXPECT_INS_EQ(pred_get->GetDefaultValue()->InputAt(1), call_right) << pred_get->DumpWithArgs();
-}
-
-// TODO This should really be in an Instruction simplifier Gtest but (1) that
-// doesn't exist and (2) we should move this simplification to directly in the
-// LSE pass since there is more information then.
-//
-// This checks that we replace phis even when there are multiple replacements as
-// long as they are equal
-// // ENTRY
-// obj = new Obj();
-// obj.field = 3;
-// switch (param) {
-//   case 1:
-//     escape(obj);
-//     break;
-//   case 2:
-//     obj.field = 10;
-//     break;
-//   case 3:
-//     obj.field = 10;
-//     break;
-// }
-// return obj.field;
-TEST_F(LoadStoreEliminationTest, SimplifyTest3) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "case1"},
-                                                  {"entry", "case2"},
-                                                  {"entry", "case3"},
-                                                  {"case1", "breturn"},
-                                                  {"case2", "breturn"},
-                                                  {"case3", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(case1);
-  GET_BLOCK(case2);
-  GET_BLOCK(case3);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {case1, case2, case3});
-
-  HInstruction* int_val = MakeParam(DataType::Type::kInt32);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c10 = graph_->GetIntConstant(10);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* write_start = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* switch_inst = new (GetAllocator()) HPackedSwitch(0, 2, int_val);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_start);
-  entry->AddInstruction(switch_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_case1 = MakeInvoke(DataType::Type::kVoid, {new_inst});
-  HInstruction* goto_case1 = new (GetAllocator()) HGoto();
-  case1->AddInstruction(call_case1);
-  case1->AddInstruction(goto_case1);
-  call_case1->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_case2 = MakeIFieldSet(new_inst, c10, MemberOffset(32));
-  HInstruction* goto_case2 = new (GetAllocator()) HGoto();
-  case2->AddInstruction(write_case2);
-  case2->AddInstruction(goto_case2);
-
-  HInstruction* write_case3 = MakeIFieldSet(new_inst, c10, MemberOffset(32));
-  HInstruction* goto_case3 = new (GetAllocator()) HGoto();
-  case3->AddInstruction(write_case3);
-  case3->AddInstruction(goto_case3);
-
-  HInstruction* read_end = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_end);
-  breturn->AddInstruction(read_end);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  // Run the code-simplifier too
-  PerformSimplifications(blks);
-
-  EXPECT_INS_REMOVED(write_case2);
-  EXPECT_INS_REMOVED(write_case3);
-  EXPECT_INS_REMOVED(write_start);
-  EXPECT_INS_REMOVED(read_end);
-  EXPECT_INS_RETAINED(call_case1);
-
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  ASSERT_NE(pred_get, nullptr);
-  EXPECT_INS_EQ(pred_get->GetDefaultValue(), c10)
-      << pred_get->DumpWithArgs();
-}
-
-// TODO This should really be in an Instruction simplifier Gtest but (1) that
-// doesn't exist and (2) we should move this simplification to directly in the
-// LSE pass since there is more information then.
-//
-// This checks that we don't replace phis even when there are multiple
-// replacements if they are not equal
-// // ENTRY
-// obj = new Obj();
-// obj.field = 3;
-// switch (param) {
-//   case 1:
-//     escape(obj);
-//     break;
-//   case 2:
-//     obj.field = 10;
-//     break;
-//   case 3:
-//     obj.field = 20;
-//     break;
-// }
-// return obj.field;
-TEST_F(LoadStoreEliminationTest, SimplifyTest4) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "case1"},
-                                                  {"entry", "case2"},
-                                                  {"entry", "case3"},
-                                                  {"case1", "breturn"},
-                                                  {"case2", "breturn"},
-                                                  {"case3", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(case1);
-  GET_BLOCK(case2);
-  GET_BLOCK(case3);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {case1, case2, case3});
-
-  HInstruction* int_val = MakeParam(DataType::Type::kInt32);
-  HInstruction* c3 = graph_->GetIntConstant(3);
-  HInstruction* c10 = graph_->GetIntConstant(10);
-  HInstruction* c20 = graph_->GetIntConstant(20);
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* write_start = MakeIFieldSet(new_inst, c3, MemberOffset(32));
-  HInstruction* switch_inst = new (GetAllocator()) HPackedSwitch(0, 2, int_val);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_start);
-  entry->AddInstruction(switch_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* call_case1 = MakeInvoke(DataType::Type::kVoid, {new_inst});
-  HInstruction* goto_case1 = new (GetAllocator()) HGoto();
-  case1->AddInstruction(call_case1);
-  case1->AddInstruction(goto_case1);
-  call_case1->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* write_case2 = MakeIFieldSet(new_inst, c10, MemberOffset(32));
-  HInstruction* goto_case2 = new (GetAllocator()) HGoto();
-  case2->AddInstruction(write_case2);
-  case2->AddInstruction(goto_case2);
-
-  HInstruction* write_case3 = MakeIFieldSet(new_inst, c20, MemberOffset(32));
-  HInstruction* goto_case3 = new (GetAllocator()) HGoto();
-  case3->AddInstruction(write_case3);
-  case3->AddInstruction(goto_case3);
-
-  HInstruction* read_end = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_end);
-  breturn->AddInstruction(read_end);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  // Run the code-simplifier too
-  PerformSimplifications(blks);
-
-  EXPECT_INS_REMOVED(write_case2);
-  EXPECT_INS_REMOVED(write_case3);
-  EXPECT_INS_REMOVED(write_start);
-  EXPECT_INS_REMOVED(read_end);
-  EXPECT_INS_RETAINED(call_case1);
-
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  ASSERT_NE(pred_get, nullptr);
-  EXPECT_TRUE(pred_get->GetDefaultValue()->IsPhi())
-      << pred_get->DumpWithArgs();
-  EXPECT_INS_EQ(pred_get->GetDefaultValue()->InputAt(0), graph_->GetIntConstant(0));
-  EXPECT_INS_EQ(pred_get->GetDefaultValue()->InputAt(1), c10);
-  EXPECT_INS_EQ(pred_get->GetDefaultValue()->InputAt(2), c20);
-}
-
-// Make sure that irreducible loops don't screw up Partial LSE. We can't pull
-// phis through them so we need to treat them as escapes.
-// TODO We should be able to do better than this? Need to do some research.
-// // ENTRY
-// obj = new Obj();
-// obj.foo = 11;
-// if (param1) {
-// } else {
-//   // irreducible loop here. NB the objdoesn't actually escape
-//   obj.foo = 33;
-//   if (param2) {
-//     goto inner;
-//   } else {
-//     while (test()) {
-//       if (test()) {
-//         obj.foo = 66;
-//       } else {
-//       }
-//       inner:
-//     }
-//   }
-// }
-// return obj.foo;
-TEST_F(LoadStoreEliminationTest, PartialIrreducibleLoop) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("start",
-                                                 "exit",
-                                                 {{"start", "entry"},
-                                                  {"entry", "left"},
-                                                  {"entry", "right"},
-                                                  {"left", "breturn"},
-
-                                                  {"right", "right_crit_break_loop"},
-                                                  {"right_crit_break_loop", "loop_header"},
-                                                  {"right", "right_crit_break_end"},
-                                                  {"right_crit_break_end", "loop_end"},
-
-                                                  {"loop_header", "loop_body"},
-                                                  {"loop_body", "loop_left"},
-                                                  {"loop_body", "loop_right"},
-                                                  {"loop_left", "loop_end"},
-                                                  {"loop_right", "loop_end"},
-                                                  {"loop_end", "loop_header"},
-                                                  {"loop_header", "loop_header_crit_break"},
-                                                  {"loop_header_crit_break", "breturn"},
-
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(start);
-  GET_BLOCK(entry);
-  GET_BLOCK(exit);
-  GET_BLOCK(breturn);
-  GET_BLOCK(left);
-  GET_BLOCK(right);
-  GET_BLOCK(right_crit_break_end);
-  GET_BLOCK(right_crit_break_loop);
-  GET_BLOCK(loop_header);
-  GET_BLOCK(loop_header_crit_break);
-  GET_BLOCK(loop_body);
-  GET_BLOCK(loop_left);
-  GET_BLOCK(loop_right);
-  GET_BLOCK(loop_end);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(breturn, {left, loop_header_crit_break});
-  HInstruction* c11 = graph_->GetIntConstant(11);
-  HInstruction* c33 = graph_->GetIntConstant(33);
-  HInstruction* c66 = graph_->GetIntConstant(66);
-  HInstruction* param1 = MakeParam(DataType::Type::kBool);
-  HInstruction* param2 = MakeParam(DataType::Type::kBool);
-
-  HInstruction* suspend = new (GetAllocator()) HSuspendCheck();
-  HInstruction* start_goto = new (GetAllocator()) HGoto();
-  start->AddInstruction(suspend);
-  start->AddInstruction(start_goto);
-  ManuallyBuildEnvFor(suspend, {});
-
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* write_start = MakeIFieldSet(new_inst, c11, MemberOffset(32));
-  HInstruction* if_inst = new (GetAllocator()) HIf(param1);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(write_start);
-  entry->AddInstruction(if_inst);
-  ManuallyBuildEnvFor(cls, {});
-  new_inst->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  left->AddInstruction(new (GetAllocator()) HGoto());
-
-  right->AddInstruction(MakeIFieldSet(new_inst, c33, MemberOffset(32)));
-  right->AddInstruction(new (GetAllocator()) HIf(param2));
-
-  right_crit_break_end->AddInstruction(new (GetAllocator()) HGoto());
-  right_crit_break_loop->AddInstruction(new (GetAllocator()) HGoto());
-
-  HInstruction* header_suspend = new (GetAllocator()) HSuspendCheck();
-  HInstruction* header_invoke = MakeInvoke(DataType::Type::kBool, {});
-  HInstruction* header_if = new (GetAllocator()) HIf(header_invoke);
-  loop_header->AddInstruction(header_suspend);
-  loop_header->AddInstruction(header_invoke);
-  loop_header->AddInstruction(header_if);
-  header_suspend->CopyEnvironmentFrom(cls->GetEnvironment());
-  header_invoke->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* body_invoke = MakeInvoke(DataType::Type::kBool, {});
-  HInstruction* body_if = new (GetAllocator()) HIf(body_invoke);
-  loop_body->AddInstruction(body_invoke);
-  loop_body->AddInstruction(body_if);
-  body_invoke->CopyEnvironmentFrom(cls->GetEnvironment());
-
-  HInstruction* left_set = MakeIFieldSet(new_inst, c66, MemberOffset(32));
-  HInstruction* left_goto = MakeIFieldSet(new_inst, c66, MemberOffset(32));
-  loop_left->AddInstruction(left_set);
-  loop_left->AddInstruction(left_goto);
-
-  loop_right->AddInstruction(new (GetAllocator()) HGoto());
-
-  loop_end->AddInstruction(new (GetAllocator()) HGoto());
-
-  HInstruction* read_end = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* return_exit = new (GetAllocator()) HReturn(read_end);
-  breturn->AddInstruction(read_end);
-  breturn->AddInstruction(return_exit);
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_TRUE(loop_header->IsLoopHeader());
-  EXPECT_TRUE(loop_header->GetLoopInformation()->IsIrreducible());
-
-  EXPECT_INS_RETAINED(left_set);
-  EXPECT_INS_REMOVED(write_start);
-  EXPECT_INS_REMOVED(read_end);
-
-  HPredicatedInstanceFieldGet* pred_get =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  ASSERT_NE(pred_get, nullptr);
-  ASSERT_TRUE(pred_get->GetDefaultValue()->IsPhi()) << pred_get->DumpWithArgs();
-  EXPECT_INS_EQ(pred_get->GetDefaultValue()->InputAt(0), c11);
-  EXPECT_INS_EQ(pred_get->GetDefaultValue()->InputAt(1), graph_->GetIntConstant(0));
-  ASSERT_TRUE(pred_get->GetTarget()->IsPhi()) << pred_get->DumpWithArgs();
-  EXPECT_INS_EQ(pred_get->GetTarget()->InputAt(0), graph_->GetNullConstant());
-  HNewInstance* mat = FindSingleInstruction<HNewInstance>(graph_, right->GetSinglePredecessor());
-  ASSERT_NE(mat, nullptr);
-  EXPECT_INS_EQ(pred_get->GetTarget()->InputAt(1), mat);
-}
-
-enum class UsesOrder { kDefaultOrder, kReverseOrder };
-std::ostream& operator<<(std::ostream& os, const UsesOrder& ord) {
-  switch (ord) {
-    case UsesOrder::kDefaultOrder:
-      return os << "DefaultOrder";
-    case UsesOrder::kReverseOrder:
-      return os << "ReverseOrder";
-  }
-}
-
-class UsesOrderDependentTestGroup
-    : public LoadStoreEliminationTestBase<CommonCompilerTestWithParam<UsesOrder>> {};
-
-// Make sure that we record replacements by predicated loads and use them
-// instead of constructing Phis with inputs removed from the graph. Bug: 183897743
-// Note that the bug was hit only for a certain ordering of the NewInstance
-// uses, so we test both orderings.
-// // ENTRY
-// obj = new Obj();
-// obj.foo = 11;
-// if (param1) {
-//   // LEFT1
-//   escape(obj);
-// } else {
-//   // RIGHT1
-// }
-// // MIDDLE
-// a = obj.foo;
-// if (param2) {
-//   // LEFT2
-//   obj.foo = 33;
-// } else {
-//   // RIGHT2
-// }
-// // BRETURN
-// no_escape()  // If `obj` escaped, the field value can change. (Avoid non-partial LSE.)
-// b = obj.foo;
-// return a + b;
-TEST_P(UsesOrderDependentTestGroup, RecordPredicatedReplacements1) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left1"},
-                                                  {"entry", "right1"},
-                                                  {"left1", "middle"},
-                                                  {"right1", "middle"},
-                                                  {"middle", "left2"},
-                                                  {"middle", "right2"},
-                                                  {"left2", "breturn"},
-                                                  {"right2", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(left1);
-  GET_BLOCK(right1);
-  GET_BLOCK(middle);
-  GET_BLOCK(left2);
-  GET_BLOCK(right2);
-  GET_BLOCK(breturn);
-  GET_BLOCK(exit);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(middle, {left1, right1});
-  EnsurePredecessorOrder(breturn, {left2, right2});
-  HInstruction* c0 = graph_->GetIntConstant(0);
-  HInstruction* cnull = graph_->GetNullConstant();
-  HInstruction* c11 = graph_->GetIntConstant(11);
-  HInstruction* c33 = graph_->GetIntConstant(33);
-  HInstruction* param1 = MakeParam(DataType::Type::kBool);
-  HInstruction* param2 = MakeParam(DataType::Type::kBool);
-
-  HInstruction* suspend = new (GetAllocator()) HSuspendCheck();
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* entry_write = MakeIFieldSet(new_inst, c11, MemberOffset(32));
-  HInstruction* entry_if = new (GetAllocator()) HIf(param1);
-  entry->AddInstruction(suspend);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(entry_write);
-  entry->AddInstruction(entry_if);
-  ManuallyBuildEnvFor(suspend, {});
-  ManuallyBuildEnvFor(cls, {});
-  ManuallyBuildEnvFor(new_inst, {});
-
-  HInstruction* left1_call = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* left1_goto = new (GetAllocator()) HGoto();
-  left1->AddInstruction(left1_call);
-  left1->AddInstruction(left1_goto);
-  ManuallyBuildEnvFor(left1_call, {});
-
-  HInstruction* right1_goto = new (GetAllocator()) HGoto();
-  right1->AddInstruction(right1_goto);
-
-  HInstruction* middle_read = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* middle_if = new (GetAllocator()) HIf(param2);
-  if (GetParam() == UsesOrder::kDefaultOrder) {
-    middle->AddInstruction(middle_read);
-  }
-  middle->AddInstruction(middle_if);
-
-  HInstanceFieldSet* left2_write = MakeIFieldSet(new_inst, c33, MemberOffset(32));
-  HInstruction* left2_goto = new (GetAllocator()) HGoto();
-  left2->AddInstruction(left2_write);
-  left2->AddInstruction(left2_goto);
-
-  HInstruction* right2_goto = new (GetAllocator()) HGoto();
-  right2->AddInstruction(right2_goto);
-
-  HInstruction* breturn_call = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* breturn_read = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* breturn_add =
-      new (GetAllocator()) HAdd(DataType::Type::kInt32, middle_read, breturn_read);
-  HInstruction* breturn_return = new (GetAllocator()) HReturn(breturn_add);
-  breturn->AddInstruction(breturn_call);
-  breturn->AddInstruction(breturn_read);
-  breturn->AddInstruction(breturn_add);
-  breturn->AddInstruction(breturn_return);
-  ManuallyBuildEnvFor(breturn_call, {});
-
-  if (GetParam() == UsesOrder::kReverseOrder) {
-    // Insert `middle_read` in the same position as for the `kDefaultOrder` case.
-    // The only difference is the order of entries in `new_inst->GetUses()` which
-    // is used by `HeapReferenceData::CollectReplacements()` and defines the order
-    // of instructions to process for `HeapReferenceData::PredicateInstructions()`.
-    middle->InsertInstructionBefore(middle_read, middle_if);
-  }
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_RETAINED(cls);
-  EXPECT_INS_REMOVED(new_inst);
-  HNewInstance* replacement_new_inst = FindSingleInstruction<HNewInstance>(graph_);
-  ASSERT_NE(replacement_new_inst, nullptr);
-  EXPECT_INS_REMOVED(entry_write);
-  std::vector<HInstanceFieldSet*> all_writes;
-  std::tie(all_writes) = FindAllInstructions<HInstanceFieldSet>(graph_);
-  ASSERT_EQ(2u, all_writes.size());
-  ASSERT_NE(all_writes[0] == left2_write, all_writes[1] == left2_write);
-  HInstanceFieldSet* replacement_write = all_writes[(all_writes[0] == left2_write) ? 1u : 0u];
-  ASSERT_FALSE(replacement_write->GetIsPredicatedSet());
-  ASSERT_INS_EQ(replacement_write->InputAt(0), replacement_new_inst);
-  ASSERT_INS_EQ(replacement_write->InputAt(1), c11);
-
-  EXPECT_INS_RETAINED(left1_call);
-
-  EXPECT_INS_REMOVED(middle_read);
-  HPredicatedInstanceFieldGet* replacement_middle_read =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, middle);
-  ASSERT_NE(replacement_middle_read, nullptr);
-  ASSERT_TRUE(replacement_middle_read->GetTarget()->IsPhi());
-  ASSERT_EQ(2u, replacement_middle_read->GetTarget()->AsPhi()->InputCount());
-  ASSERT_INS_EQ(replacement_middle_read->GetTarget()->AsPhi()->InputAt(0), replacement_new_inst);
-  ASSERT_INS_EQ(replacement_middle_read->GetTarget()->AsPhi()->InputAt(1), cnull);
-  ASSERT_TRUE(replacement_middle_read->GetDefaultValue()->IsPhi());
-  ASSERT_EQ(2u, replacement_middle_read->GetDefaultValue()->AsPhi()->InputCount());
-  ASSERT_INS_EQ(replacement_middle_read->GetDefaultValue()->AsPhi()->InputAt(0), c0);
-  ASSERT_INS_EQ(replacement_middle_read->GetDefaultValue()->AsPhi()->InputAt(1), c11);
-
-  EXPECT_INS_RETAINED(left2_write);
-  ASSERT_TRUE(left2_write->GetIsPredicatedSet());
-
-  EXPECT_INS_REMOVED(breturn_read);
-  HPredicatedInstanceFieldGet* replacement_breturn_read =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  ASSERT_NE(replacement_breturn_read, nullptr);
-  ASSERT_INS_EQ(replacement_breturn_read->GetTarget(), replacement_middle_read->GetTarget());
-  ASSERT_TRUE(replacement_breturn_read->GetDefaultValue()->IsPhi());
-  ASSERT_EQ(2u, replacement_breturn_read->GetDefaultValue()->AsPhi()->InputCount());
-  ASSERT_INS_EQ(replacement_breturn_read->GetDefaultValue()->AsPhi()->InputAt(0), c33);
-  HInstruction* other_input = replacement_breturn_read->GetDefaultValue()->AsPhi()->InputAt(1);
-  ASSERT_NE(other_input->GetBlock(), nullptr) << GetParam();
-  ASSERT_INS_EQ(other_input, replacement_middle_read);
-}
-
-// Regression test for a bad DCHECK() found while trying to write a test for b/188188275.
-// // ENTRY
-// obj = new Obj();
-// obj.foo = 11;
-// if (param1) {
-//   // LEFT1
-//   escape(obj);
-// } else {
-//   // RIGHT1
-// }
-// // MIDDLE
-// a = obj.foo;
-// if (param2) {
-//   // LEFT2
-//   no_escape();
-// } else {
-//   // RIGHT2
-// }
-// // BRETURN
-// b = obj.foo;
-// return a + b;
-TEST_P(UsesOrderDependentTestGroup, RecordPredicatedReplacements2) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left1"},
-                                                  {"entry", "right1"},
-                                                  {"left1", "middle"},
-                                                  {"right1", "middle"},
-                                                  {"middle", "left2"},
-                                                  {"middle", "right2"},
-                                                  {"left2", "breturn"},
-                                                  {"right2", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(left1);
-  GET_BLOCK(right1);
-  GET_BLOCK(middle);
-  GET_BLOCK(left2);
-  GET_BLOCK(right2);
-  GET_BLOCK(breturn);
-  GET_BLOCK(exit);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(middle, {left1, right1});
-  EnsurePredecessorOrder(breturn, {left2, right2});
-  HInstruction* c0 = graph_->GetIntConstant(0);
-  HInstruction* cnull = graph_->GetNullConstant();
-  HInstruction* c11 = graph_->GetIntConstant(11);
-  HInstruction* param1 = MakeParam(DataType::Type::kBool);
-  HInstruction* param2 = MakeParam(DataType::Type::kBool);
-
-  HInstruction* suspend = new (GetAllocator()) HSuspendCheck();
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* entry_write = MakeIFieldSet(new_inst, c11, MemberOffset(32));
-  HInstruction* entry_if = new (GetAllocator()) HIf(param1);
-  entry->AddInstruction(suspend);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(entry_write);
-  entry->AddInstruction(entry_if);
-  ManuallyBuildEnvFor(suspend, {});
-  ManuallyBuildEnvFor(cls, {});
-  ManuallyBuildEnvFor(new_inst, {});
-
-  HInstruction* left1_call = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* left1_goto = new (GetAllocator()) HGoto();
-  left1->AddInstruction(left1_call);
-  left1->AddInstruction(left1_goto);
-  ManuallyBuildEnvFor(left1_call, {});
-
-  HInstruction* right1_goto = new (GetAllocator()) HGoto();
-  right1->AddInstruction(right1_goto);
-
-  HInstruction* middle_read = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* middle_if = new (GetAllocator()) HIf(param2);
-  if (GetParam() == UsesOrder::kDefaultOrder) {
-    middle->AddInstruction(middle_read);
-  }
-  middle->AddInstruction(middle_if);
-
-  HInstruction* left2_call = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* left2_goto = new (GetAllocator()) HGoto();
-  left2->AddInstruction(left2_call);
-  left2->AddInstruction(left2_goto);
-  ManuallyBuildEnvFor(left2_call, {});
-
-  HInstruction* right2_goto = new (GetAllocator()) HGoto();
-  right2->AddInstruction(right2_goto);
-
-  HInstruction* breturn_read = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* breturn_add =
-      new (GetAllocator()) HAdd(DataType::Type::kInt32, middle_read, breturn_read);
-  HInstruction* breturn_return = new (GetAllocator()) HReturn(breturn_add);
-  breturn->AddInstruction(breturn_read);
-  breturn->AddInstruction(breturn_add);
-  breturn->AddInstruction(breturn_return);
-
-  if (GetParam() == UsesOrder::kReverseOrder) {
-    // Insert `middle_read` in the same position as for the `kDefaultOrder` case.
-    // The only difference is the order of entries in `new_inst->GetUses()` which
-    // is used by `HeapReferenceData::CollectReplacements()` and defines the order
-    // of instructions to process for `HeapReferenceData::PredicateInstructions()`.
-    middle->InsertInstructionBefore(middle_read, middle_if);
-  }
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_RETAINED(cls);
-  EXPECT_INS_REMOVED(new_inst);
-  HNewInstance* replacement_new_inst = FindSingleInstruction<HNewInstance>(graph_);
-  ASSERT_NE(replacement_new_inst, nullptr);
-  EXPECT_INS_REMOVED(entry_write);
-  HInstanceFieldSet* replacement_write = FindSingleInstruction<HInstanceFieldSet>(graph_);
-  ASSERT_NE(replacement_write, nullptr);
-  ASSERT_FALSE(replacement_write->GetIsPredicatedSet());
-  ASSERT_INS_EQ(replacement_write->InputAt(0), replacement_new_inst);
-  ASSERT_INS_EQ(replacement_write->InputAt(1), c11);
-
-  EXPECT_INS_RETAINED(left1_call);
-
-  EXPECT_INS_REMOVED(middle_read);
-  HPredicatedInstanceFieldGet* replacement_middle_read =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, middle);
-  ASSERT_NE(replacement_middle_read, nullptr);
-  ASSERT_TRUE(replacement_middle_read->GetTarget()->IsPhi());
-  ASSERT_EQ(2u, replacement_middle_read->GetTarget()->AsPhi()->InputCount());
-  ASSERT_INS_EQ(replacement_middle_read->GetTarget()->AsPhi()->InputAt(0), replacement_new_inst);
-  ASSERT_INS_EQ(replacement_middle_read->GetTarget()->AsPhi()->InputAt(1), cnull);
-  ASSERT_TRUE(replacement_middle_read->GetDefaultValue()->IsPhi());
-  ASSERT_EQ(2u, replacement_middle_read->GetDefaultValue()->AsPhi()->InputCount());
-  ASSERT_INS_EQ(replacement_middle_read->GetDefaultValue()->AsPhi()->InputAt(0), c0);
-  ASSERT_INS_EQ(replacement_middle_read->GetDefaultValue()->AsPhi()->InputAt(1), c11);
-
-  EXPECT_INS_RETAINED(left2_call);
-
-  EXPECT_INS_REMOVED(breturn_read);
-  HPredicatedInstanceFieldGet* replacement_breturn_read =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  ASSERT_NE(replacement_breturn_read, nullptr);
-  ASSERT_INS_EQ(replacement_breturn_read->GetTarget(), replacement_middle_read->GetTarget());
-  ASSERT_INS_EQ(replacement_breturn_read->GetDefaultValue(), replacement_middle_read);
-}
-
-INSTANTIATE_TEST_SUITE_P(LoadStoreEliminationTest,
-                         UsesOrderDependentTestGroup,
-                         testing::Values(UsesOrder::kDefaultOrder, UsesOrder::kReverseOrder));
-
-// The parameter is the number of times we call `std::next_permutation` (from 0 to 5)
-// so that we test all 6 permutation of three items.
-class UsesOrderDependentTestGroupForThreeItems
-    : public LoadStoreEliminationTestBase<CommonCompilerTestWithParam<size_t>> {};
-
-// Make sure that after we record replacements by predicated loads, we correctly
-// use that predicated load for Phi placeholders that were previously marked as
-// replaced by the now removed unpredicated load. (The fix for bug 183897743 was
-// not good enough.) Bug: 188188275
-// // ENTRY
-// obj = new Obj();
-// obj.foo = 11;
-// if (param1) {
-//   // LEFT1
-//   escape(obj);
-// } else {
-//   // RIGHT1
-// }
-// // MIDDLE1
-// a = obj.foo;
-// if (param2) {
-//   // LEFT2
-//   no_escape1();
-// } else {
-//   // RIGHT2
-// }
-// // MIDDLE2
-// if (param3) {
-//   // LEFT3
-//   x = obj.foo;
-//   no_escape2();
-// } else {
-//   // RIGHT3
-//   x = 0;
-// }
-// // BRETURN
-// b = obj.foo;
-// return a + b + x;
-TEST_P(UsesOrderDependentTestGroupForThreeItems, RecordPredicatedReplacements3) {
-  ScopedObjectAccess soa(Thread::Current());
-  VariableSizedHandleScope vshs(soa.Self());
-  CreateGraph(&vshs);
-  AdjacencyListGraph blks(SetupFromAdjacencyList("entry",
-                                                 "exit",
-                                                 {{"entry", "left1"},
-                                                  {"entry", "right1"},
-                                                  {"left1", "middle1"},
-                                                  {"right1", "middle1"},
-                                                  {"middle1", "left2"},
-                                                  {"middle1", "right2"},
-                                                  {"left2", "middle2"},
-                                                  {"right2", "middle2"},
-                                                  {"middle2", "left3"},
-                                                  {"middle2", "right3"},
-                                                  {"left3", "breturn"},
-                                                  {"right3", "breturn"},
-                                                  {"breturn", "exit"}}));
-#define GET_BLOCK(name) HBasicBlock* name = blks.Get(#name)
-  GET_BLOCK(entry);
-  GET_BLOCK(left1);
-  GET_BLOCK(right1);
-  GET_BLOCK(middle1);
-  GET_BLOCK(left2);
-  GET_BLOCK(right2);
-  GET_BLOCK(middle2);
-  GET_BLOCK(left3);
-  GET_BLOCK(right3);
-  GET_BLOCK(breturn);
-  GET_BLOCK(exit);
-#undef GET_BLOCK
-  EnsurePredecessorOrder(middle1, {left1, right1});
-  EnsurePredecessorOrder(middle2, {left2, right2});
-  EnsurePredecessorOrder(breturn, {left3, right3});
-  HInstruction* c0 = graph_->GetIntConstant(0);
-  HInstruction* cnull = graph_->GetNullConstant();
-  HInstruction* c11 = graph_->GetIntConstant(11);
-  HInstruction* param1 = MakeParam(DataType::Type::kBool);
-  HInstruction* param2 = MakeParam(DataType::Type::kBool);
-  HInstruction* param3 = MakeParam(DataType::Type::kBool);
-
-  HInstruction* suspend = new (GetAllocator()) HSuspendCheck();
-  HInstruction* cls = MakeClassLoad();
-  HInstruction* new_inst = MakeNewInstance(cls);
-  HInstruction* entry_write = MakeIFieldSet(new_inst, c11, MemberOffset(32));
-  HInstruction* entry_if = new (GetAllocator()) HIf(param1);
-  entry->AddInstruction(suspend);
-  entry->AddInstruction(cls);
-  entry->AddInstruction(new_inst);
-  entry->AddInstruction(entry_write);
-  entry->AddInstruction(entry_if);
-  ManuallyBuildEnvFor(suspend, {});
-  ManuallyBuildEnvFor(cls, {});
-  ManuallyBuildEnvFor(new_inst, {});
-
-  HInstruction* left1_call = MakeInvoke(DataType::Type::kVoid, { new_inst });
-  HInstruction* left1_goto = new (GetAllocator()) HGoto();
-  left1->AddInstruction(left1_call);
-  left1->AddInstruction(left1_goto);
-  ManuallyBuildEnvFor(left1_call, {});
-
-  HInstruction* right1_goto = new (GetAllocator()) HGoto();
-  right1->AddInstruction(right1_goto);
-
-  HInstruction* middle1_read = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* middle1_if = new (GetAllocator()) HIf(param2);
-  // Delay inserting `middle1_read`, do that later with ordering based on `GetParam()`.
-  middle1->AddInstruction(middle1_if);
-
-  HInstruction* left2_call = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* left2_goto = new (GetAllocator()) HGoto();
-  left2->AddInstruction(left2_call);
-  left2->AddInstruction(left2_goto);
-  ManuallyBuildEnvFor(left2_call, {});
-
-  HInstruction* right2_goto = new (GetAllocator()) HGoto();
-  right2->AddInstruction(right2_goto);
-
-  HInstruction* middle2_if = new (GetAllocator()) HIf(param3);
-  middle2->AddInstruction(middle2_if);
-
-  HInstruction* left3_read = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* left3_call = MakeInvoke(DataType::Type::kVoid, {});
-  HInstruction* left3_goto = new (GetAllocator()) HGoto();
-  // Delay inserting `left3_read`, do that later with ordering based on `GetParam()`.
-  left3->AddInstruction(left3_call);
-  left3->AddInstruction(left3_goto);
-  ManuallyBuildEnvFor(left3_call, {});
-
-  HInstruction* right3_goto = new (GetAllocator()) HGoto();
-  right3->AddInstruction(right3_goto);
-
-  HPhi* breturn_phi = MakePhi({left3_read, c0});
-  HInstruction* breturn_read = MakeIFieldGet(new_inst, DataType::Type::kInt32, MemberOffset(32));
-  HInstruction* breturn_add1 =
-      new (GetAllocator()) HAdd(DataType::Type::kInt32, middle1_read, breturn_read);
-  HInstruction* breturn_add2 =
-      new (GetAllocator()) HAdd(DataType::Type::kInt32, breturn_add1, breturn_phi);
-  HInstruction* breturn_return = new (GetAllocator()) HReturn(breturn_add2);
-  breturn->AddPhi(breturn_phi);
-  // Delay inserting `breturn_read`, do that later with ordering based on `GetParam()`.
-  breturn->AddInstruction(breturn_add1);
-  breturn->AddInstruction(breturn_add2);
-  breturn->AddInstruction(breturn_return);
-
-  // Insert reads in the same positions but in different insertion orders.
-  // The only difference is the order of entries in `new_inst->GetUses()` which
-  // is used by `HeapReferenceData::CollectReplacements()` and defines the order
-  // of instructions to process for `HeapReferenceData::PredicateInstructions()`.
-  std::tuple<size_t, HInstruction*, HInstruction*> read_insertions[] = {
-      { 0u, middle1_read, middle1_if },
-      { 1u, left3_read, left3_call },
-      { 2u, breturn_read, breturn_add1 },
-  };
-  for (size_t i = 0, num = GetParam(); i != num; ++i) {
-    std::next_permutation(read_insertions, read_insertions + std::size(read_insertions));
-  }
-  for (auto [order, read, cursor] : read_insertions) {
-    cursor->GetBlock()->InsertInstructionBefore(read, cursor);
-  }
-
-  SetupExit(exit);
-
-  PerformLSEWithPartial(blks);
-
-  EXPECT_INS_RETAINED(cls);
-  EXPECT_INS_REMOVED(new_inst);
-  HNewInstance* replacement_new_inst = FindSingleInstruction<HNewInstance>(graph_);
-  ASSERT_NE(replacement_new_inst, nullptr);
-  EXPECT_INS_REMOVED(entry_write);
-  HInstanceFieldSet* replacement_write = FindSingleInstruction<HInstanceFieldSet>(graph_);
-  ASSERT_NE(replacement_write, nullptr);
-  ASSERT_FALSE(replacement_write->GetIsPredicatedSet());
-  ASSERT_INS_EQ(replacement_write->InputAt(0), replacement_new_inst);
-  ASSERT_INS_EQ(replacement_write->InputAt(1), c11);
-
-  EXPECT_INS_RETAINED(left1_call);
-
-  EXPECT_INS_REMOVED(middle1_read);
-  HPredicatedInstanceFieldGet* replacement_middle1_read =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, middle1);
-  ASSERT_NE(replacement_middle1_read, nullptr);
-  ASSERT_TRUE(replacement_middle1_read->GetTarget()->IsPhi());
-  ASSERT_EQ(2u, replacement_middle1_read->GetTarget()->AsPhi()->InputCount());
-  ASSERT_INS_EQ(replacement_middle1_read->GetTarget()->AsPhi()->InputAt(0), replacement_new_inst);
-  ASSERT_INS_EQ(replacement_middle1_read->GetTarget()->AsPhi()->InputAt(1), cnull);
-  ASSERT_TRUE(replacement_middle1_read->GetDefaultValue()->IsPhi());
-  ASSERT_EQ(2u, replacement_middle1_read->GetDefaultValue()->AsPhi()->InputCount());
-  ASSERT_INS_EQ(replacement_middle1_read->GetDefaultValue()->AsPhi()->InputAt(0), c0);
-  ASSERT_INS_EQ(replacement_middle1_read->GetDefaultValue()->AsPhi()->InputAt(1), c11);
-
-  EXPECT_INS_RETAINED(left2_call);
-
-  EXPECT_INS_REMOVED(left3_read);
-  HPredicatedInstanceFieldGet* replacement_left3_read =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, left3);
-  ASSERT_NE(replacement_left3_read, nullptr);
-  ASSERT_TRUE(replacement_left3_read->GetTarget()->IsPhi());
-  ASSERT_INS_EQ(replacement_left3_read->GetTarget(), replacement_middle1_read->GetTarget());
-  ASSERT_INS_EQ(replacement_left3_read->GetDefaultValue(), replacement_middle1_read);
-  EXPECT_INS_RETAINED(left3_call);
-
-  EXPECT_INS_RETAINED(breturn_phi);
-  EXPECT_INS_REMOVED(breturn_read);
-  HPredicatedInstanceFieldGet* replacement_breturn_read =
-      FindSingleInstruction<HPredicatedInstanceFieldGet>(graph_, breturn);
-  ASSERT_NE(replacement_breturn_read, nullptr);
-  ASSERT_INS_EQ(replacement_breturn_read->GetTarget(), replacement_middle1_read->GetTarget());
-  ASSERT_EQ(2u, replacement_breturn_read->GetDefaultValue()->AsPhi()->InputCount());
-  ASSERT_INS_EQ(replacement_breturn_read->GetDefaultValue()->AsPhi()->InputAt(0),
-                replacement_left3_read);
-  ASSERT_INS_EQ(replacement_breturn_read->GetDefaultValue()->AsPhi()->InputAt(1),
-                replacement_middle1_read);
-  EXPECT_INS_RETAINED(breturn_add1);
-  ASSERT_INS_EQ(breturn_add1->InputAt(0), replacement_middle1_read);
-  ASSERT_INS_EQ(breturn_add1->InputAt(1), replacement_breturn_read);
-  EXPECT_INS_RETAINED(breturn_add2);
-  ASSERT_INS_EQ(breturn_add2->InputAt(0), breturn_add1);
-  ASSERT_INS_EQ(breturn_add2->InputAt(1), breturn_phi);
-  EXPECT_INS_RETAINED(breturn_return);
-}
-
-INSTANTIATE_TEST_SUITE_P(LoadStoreEliminationTest,
-                         UsesOrderDependentTestGroupForThreeItems,
-                         testing::Values(0u, 1u, 2u, 3u, 4u, 5u));
-
 }  // namespace art
diff --git a/compiler/optimizing/locations.cc b/compiler/optimizing/locations.cc
index f40b7f4..4189bc4 100644
--- a/compiler/optimizing/locations.cc
+++ b/compiler/optimizing/locations.cc
@@ -62,7 +62,7 @@
 }
 
 Location Location::RegisterOrInt32Constant(HInstruction* instruction) {
-  HConstant* constant = instruction->AsConstant();
+  HConstant* constant = instruction->AsConstantOrNull();
   if (constant != nullptr) {
     int64_t value = CodeGenerator::GetInt64ValueOf(constant);
     if (IsInt<32>(value)) {
@@ -73,7 +73,7 @@
 }
 
 Location Location::FpuRegisterOrInt32Constant(HInstruction* instruction) {
-  HConstant* constant = instruction->AsConstant();
+  HConstant* constant = instruction->AsConstantOrNull();
   if (constant != nullptr) {
     int64_t value = CodeGenerator::GetInt64ValueOf(constant);
     if (IsInt<32>(value)) {
diff --git a/compiler/optimizing/locations.h b/compiler/optimizing/locations.h
index 7ee076f..20099eb 100644
--- a/compiler/optimizing/locations.h
+++ b/compiler/optimizing/locations.h
@@ -79,7 +79,7 @@
     kUnallocated = 11,
   };
 
-  Location() : ValueObject(), value_(kInvalid) {
+  constexpr Location() : ValueObject(), value_(kInvalid) {
     // Verify that non-constant location kinds do not interfere with kConstant.
     static_assert((kInvalid & kLocationConstantMask) != kConstant, "TagError");
     static_assert((kUnallocated & kLocationConstantMask) != kConstant, "TagError");
@@ -95,7 +95,7 @@
     DCHECK(!IsValid());
   }
 
-  Location(const Location& other) = default;
+  constexpr Location(const Location& other) = default;
 
   Location& operator=(const Location& other) = default;
 
@@ -126,24 +126,24 @@
   }
 
   // Empty location. Used if there the location should be ignored.
-  static Location NoLocation() {
+  static constexpr Location NoLocation() {
     return Location();
   }
 
   // Register locations.
-  static Location RegisterLocation(int reg) {
+  static constexpr Location RegisterLocation(int reg) {
     return Location(kRegister, reg);
   }
 
-  static Location FpuRegisterLocation(int reg) {
+  static constexpr Location FpuRegisterLocation(int reg) {
     return Location(kFpuRegister, reg);
   }
 
-  static Location RegisterPairLocation(int low, int high) {
+  static constexpr Location RegisterPairLocation(int low, int high) {
     return Location(kRegisterPair, low << 16 | high);
   }
 
-  static Location FpuRegisterPairLocation(int low, int high) {
+  static constexpr Location FpuRegisterPairLocation(int low, int high) {
     return Location(kFpuRegisterPair, low << 16 | high);
   }
 
@@ -423,7 +423,7 @@
 
   explicit Location(uintptr_t value) : value_(value) {}
 
-  Location(Kind kind, uintptr_t payload)
+  constexpr Location(Kind kind, uintptr_t payload)
       : value_(KindField::Encode(kind) | PayloadField::Encode(payload)) {}
 
   uintptr_t GetPayload() const {
diff --git a/compiler/optimizing/loop_analysis.cc b/compiler/optimizing/loop_analysis.cc
index 95e8153..b3f9e83 100644
--- a/compiler/optimizing/loop_analysis.cc
+++ b/compiler/optimizing/loop_analysis.cc
@@ -42,7 +42,7 @@
         // not cause loop peeling to happen as they either cannot be inside a loop, or by
         // definition cannot be loop exits (unconditional instructions), or are not beneficial for
         // the optimization.
-        HIf* hif = block->GetLastInstruction()->AsIf();
+        HIf* hif = block->GetLastInstruction()->AsIfOrNull();
         if (hif != nullptr && !loop_info->Contains(*hif->InputAt(0)->GetBlock())) {
           analysis_results->invariant_exits_num_++;
         }
@@ -221,9 +221,6 @@
         return 3;
       case HInstruction::InstructionKind::kIf:
         return 2;
-      case HInstruction::InstructionKind::kPredicatedInstanceFieldGet:
-        // test + cond-jump + IFieldGet
-        return 4;
       case HInstruction::InstructionKind::kInstanceFieldGet:
         return 2;
       case HInstruction::InstructionKind::kInstanceFieldSet:
@@ -259,7 +256,7 @@
       case HInstruction::InstructionKind::kVecReplicateScalar:
         return 2;
       case HInstruction::InstructionKind::kVecExtractScalar:
-       return 1;
+        return 1;
       case HInstruction::InstructionKind::kVecReduce:
         return 4;
       case HInstruction::InstructionKind::kVecNeg:
diff --git a/compiler/optimizing/loop_analysis.h b/compiler/optimizing/loop_analysis.h
index cec00fe..cd8f005 100644
--- a/compiler/optimizing/loop_analysis.h
+++ b/compiler/optimizing/loop_analysis.h
@@ -148,13 +148,15 @@
   //
   // Returns 'true' by default, should be overridden by particular target loop helper.
   virtual bool IsLoopNonBeneficialForScalarOpts(
-      LoopAnalysisInfo* loop_analysis_info ATTRIBUTE_UNUSED) const { return true; }
+      [[maybe_unused]] LoopAnalysisInfo* loop_analysis_info) const {
+    return true;
+  }
 
   // Returns optimal scalar unrolling factor for the loop.
   //
   // Returns kNoUnrollingFactor by default, should be overridden by particular target loop helper.
   virtual uint32_t GetScalarUnrollingFactor(
-      const LoopAnalysisInfo* analysis_info ATTRIBUTE_UNUSED) const {
+      [[maybe_unused]] const LoopAnalysisInfo* analysis_info) const {
     return LoopAnalysisInfo::kNoUnrollingFactor;
   }
 
@@ -166,17 +168,17 @@
   // Returns whether it is beneficial to fully unroll the loop.
   //
   // Returns 'false' by default, should be overridden by particular target loop helper.
-  virtual bool IsFullUnrollingBeneficial(LoopAnalysisInfo* analysis_info ATTRIBUTE_UNUSED) const {
+  virtual bool IsFullUnrollingBeneficial([[maybe_unused]] LoopAnalysisInfo* analysis_info) const {
     return false;
   }
 
   // Returns optimal SIMD unrolling factor for the loop.
   //
   // Returns kNoUnrollingFactor by default, should be overridden by particular target loop helper.
-  virtual uint32_t GetSIMDUnrollingFactor(HBasicBlock* block ATTRIBUTE_UNUSED,
-                                          int64_t trip_count ATTRIBUTE_UNUSED,
-                                          uint32_t max_peel ATTRIBUTE_UNUSED,
-                                          uint32_t vector_length ATTRIBUTE_UNUSED) const {
+  virtual uint32_t GetSIMDUnrollingFactor([[maybe_unused]] HBasicBlock* block,
+                                          [[maybe_unused]] int64_t trip_count,
+                                          [[maybe_unused]] uint32_t max_peel,
+                                          [[maybe_unused]] uint32_t vector_length) const {
     return LoopAnalysisInfo::kNoUnrollingFactor;
   }
 
diff --git a/compiler/optimizing/loop_optimization.cc b/compiler/optimizing/loop_optimization.cc
index 7a52502..f6d69ca 100644
--- a/compiler/optimizing/loop_optimization.cc
+++ b/compiler/optimizing/loop_optimization.cc
@@ -366,8 +366,8 @@
   return (restrictions & tested) != 0;
 }
 
-// Insert an instruction.
-static HInstruction* Insert(HBasicBlock* block, HInstruction* instruction) {
+// Insert an instruction at the end of the block, with safe checks.
+inline HInstruction* Insert(HBasicBlock* block, HInstruction* instruction) {
   DCHECK(block != nullptr);
   DCHECK(instruction != nullptr);
   block->InsertInstructionBefore(instruction, block->GetLastInstruction());
@@ -418,7 +418,7 @@
       ++it;
       if (true_succ->Dominates(user_block)) {
         user->ReplaceInput(graph->GetIntConstant(1), index);
-     } else if (false_succ->Dominates(user_block)) {
+      } else if (false_succ->Dominates(user_block)) {
         user->ReplaceInput(graph->GetIntConstant(0), index);
       }
     }
@@ -453,6 +453,54 @@
   return type;
 }
 
+// Returns whether the loop is of a diamond structure:
+//
+//                header <----------------+
+//                  |                     |
+//             diamond_hif                |
+//                /   \                   |
+//     diamond_true  diamond_false        |
+//                \   /                   |
+//              back_edge                 |
+//                  |                     |
+//                  +---------------------+
+static bool HasLoopDiamondStructure(HLoopInformation* loop_info) {
+  HBasicBlock* header = loop_info->GetHeader();
+  if (loop_info->NumberOfBackEdges() != 1 || header->GetSuccessors().size() != 2) {
+    return false;
+  }
+  HBasicBlock* header_succ_0 = header->GetSuccessors()[0];
+  HBasicBlock* header_succ_1 = header->GetSuccessors()[1];
+  HBasicBlock* diamond_top = loop_info->Contains(*header_succ_0) ?
+                                  header_succ_0 :
+                                  header_succ_1;
+  if (!diamond_top->GetLastInstruction()->IsIf()) {
+    return false;
+  }
+
+  HIf* diamond_hif = diamond_top->GetLastInstruction()->AsIf();
+  HBasicBlock* diamond_true = diamond_hif->IfTrueSuccessor();
+  HBasicBlock* diamond_false = diamond_hif->IfFalseSuccessor();
+
+  if (diamond_true->GetSuccessors().size() != 1 || diamond_false->GetSuccessors().size() != 1) {
+    return false;
+  }
+
+  HBasicBlock* back_edge = diamond_true->GetSingleSuccessor();
+  if (back_edge != diamond_false->GetSingleSuccessor() ||
+      back_edge != loop_info->GetBackEdges()[0]) {
+    return false;
+  }
+
+  DCHECK_EQ(loop_info->GetBlocks().NumSetBits(), 5u);
+  return true;
+}
+
+static bool IsPredicatedLoopControlFlowSupported(HLoopInformation* loop_info) {
+  size_t num_of_blocks = loop_info->GetBlocks().NumSetBits();
+  return num_of_blocks == 2 || HasLoopDiamondStructure(loop_info);
+}
+
 //
 // Public methods.
 //
@@ -482,6 +530,8 @@
       vector_runtime_test_b_(nullptr),
       vector_map_(nullptr),
       vector_permanent_map_(nullptr),
+      vector_external_set_(nullptr),
+      predicate_info_map_(nullptr),
       vector_mode_(kSequential),
       vector_preheader_(nullptr),
       vector_header_(nullptr),
@@ -542,12 +592,17 @@
       std::less<HInstruction*>(), loop_allocator_->Adapter(kArenaAllocLoopOptimization));
   ScopedArenaSafeMap<HInstruction*, HInstruction*> perm(
       std::less<HInstruction*>(), loop_allocator_->Adapter(kArenaAllocLoopOptimization));
+  ScopedArenaSet<HInstruction*> ext_set(loop_allocator_->Adapter(kArenaAllocLoopOptimization));
+  ScopedArenaSafeMap<HBasicBlock*, BlockPredicateInfo*> pred(
+      std::less<HBasicBlock*>(), loop_allocator_->Adapter(kArenaAllocLoopOptimization));
   // Attach.
   iset_ = &iset;
   reductions_ = &reds;
   vector_refs_ = &refs;
   vector_map_ = &map;
   vector_permanent_map_ = &perm;
+  vector_external_set_ = &ext_set;
+  predicate_info_map_ = &pred;
   // Traverse.
   const bool did_loop_opt = TraverseLoopsInnerToOuter(top_loop_);
   // Detach.
@@ -556,6 +611,9 @@
   vector_refs_ = nullptr;
   vector_map_ = nullptr;
   vector_permanent_map_ = nullptr;
+  vector_external_set_ = nullptr;
+  predicate_info_map_ = nullptr;
+
   return did_loop_opt;
 }
 
@@ -787,6 +845,37 @@
   }
 }
 
+// Checks whether the loop has exit structure suitable for InnerLoopFinite optimization:
+//  - has single loop exit.
+//  - the exit block has only single predecessor - a block inside the loop.
+//
+// In that case returns single exit basic block (outside the loop); otherwise nullptr.
+static HBasicBlock* GetInnerLoopFiniteSingleExit(HLoopInformation* loop_info) {
+  HBasicBlock* exit = nullptr;
+  for (HBlocksInLoopIterator block_it(*loop_info);
+       !block_it.Done();
+       block_it.Advance()) {
+    HBasicBlock* block = block_it.Current();
+
+    // Check whether one of the successor is loop exit.
+    for (HBasicBlock* successor : block->GetSuccessors()) {
+      if (!loop_info->Contains(*successor)) {
+        if (exit != nullptr) {
+          // The loop has more than one exit.
+          return nullptr;
+        }
+        exit = successor;
+
+        // Ensure exit can only be reached by exiting loop.
+        if (successor->GetPredecessors().size() != 1) {
+          return nullptr;
+        }
+      }
+    }
+  }
+  return exit;
+}
+
 bool HLoopOptimization::TryOptimizeInnerLoopFinite(LoopNode* node) {
   HBasicBlock* header = node->loop_info->GetHeader();
   HBasicBlock* preheader = node->loop_info->GetPreHeader();
@@ -795,33 +884,22 @@
   if (!induction_range_.IsFinite(node->loop_info, &trip_count)) {
     return false;
   }
-  // Ensure there is only a single loop-body (besides the header).
-  HBasicBlock* body = nullptr;
-  for (HBlocksInLoopIterator it(*node->loop_info); !it.Done(); it.Advance()) {
-    if (it.Current() != header) {
-      if (body != nullptr) {
-        return false;
-      }
-      body = it.Current();
-    }
-  }
-  CHECK(body != nullptr);
-  // Ensure there is only a single exit point.
-  if (header->GetSuccessors().size() != 2) {
+  // Check loop exits.
+  HBasicBlock* exit = GetInnerLoopFiniteSingleExit(node->loop_info);
+  if (exit == nullptr) {
     return false;
   }
-  HBasicBlock* exit = (header->GetSuccessors()[0] == body)
-      ? header->GetSuccessors()[1]
-      : header->GetSuccessors()[0];
-  // Ensure exit can only be reached by exiting loop.
-  if (exit->GetPredecessors().size() != 1) {
-    return false;
-  }
+
+  HBasicBlock* body = (header->GetSuccessors()[0] == exit)
+    ? header->GetSuccessors()[1]
+    : header->GetSuccessors()[0];
   // Detect either an empty loop (no side effects other than plain iteration) or
   // a trivial loop (just iterating once). Replace subsequent index uses, if any,
   // with the last value and remove the loop, possibly after unrolling its body.
   HPhi* main_phi = nullptr;
-  if (TrySetSimpleLoopHeader(header, &main_phi)) {
+  size_t num_of_blocks = header->GetLoopInformation()->GetBlocks().NumSetBits();
+
+  if (num_of_blocks == 2 && TrySetSimpleLoopHeader(header, &main_phi)) {
     bool is_empty = IsEmptyBody(body);
     if (reductions_->empty() &&  // TODO: possible with some effort
         (is_empty || trip_count == 1) &&
@@ -845,21 +923,61 @@
     }
   }
   // Vectorize loop, if possible and valid.
-  if (kEnableVectorization &&
+  if (!kEnableVectorization ||
       // Disable vectorization for debuggable graphs: this is a workaround for the bug
       // in 'GenerateNewLoop' which caused the SuspendCheck environment to be invalid.
       // TODO: b/138601207, investigate other possible cases with wrong environment values and
       // possibly switch back vectorization on for debuggable graphs.
-      !graph_->IsDebuggable() &&
-      TrySetSimpleLoopHeader(header, &main_phi) &&
-      ShouldVectorize(node, body, trip_count) &&
-      TryAssignLastValue(node->loop_info, main_phi, preheader, /*collect_loop_uses*/ true)) {
-    Vectorize(node, body, exit, trip_count);
-    graph_->SetHasSIMD(true);  // flag SIMD usage
-    MaybeRecordStat(stats_, MethodCompilationStat::kLoopVectorized);
-    return true;
+      graph_->IsDebuggable()) {
+    return false;
   }
-  return false;
+
+  if (IsInPredicatedVectorizationMode()) {
+    return TryVectorizePredicated(node, body, exit, main_phi, trip_count);
+  } else {
+    return TryVectorizedTraditional(node, body, exit, main_phi, trip_count);
+  }
+}
+
+bool HLoopOptimization::TryVectorizePredicated(LoopNode* node,
+                                               HBasicBlock* body,
+                                               HBasicBlock* exit,
+                                               HPhi* main_phi,
+                                               int64_t trip_count) {
+  if (!IsPredicatedLoopControlFlowSupported(node->loop_info) ||
+      !ShouldVectorizeCommon(node, main_phi, trip_count)) {
+    return false;
+  }
+
+  // Currently we can only generate cleanup loops for loops with 2 basic block.
+  //
+  // TODO: Support array disambiguation tests for CF loops.
+  if (NeedsArrayRefsDisambiguationTest() &&
+      node->loop_info->GetBlocks().NumSetBits() != 2) {
+    return false;
+  }
+
+  VectorizePredicated(node, body, exit);
+  MaybeRecordStat(stats_, MethodCompilationStat::kLoopVectorized);
+  graph_->SetHasPredicatedSIMD(true);  // flag SIMD usage
+  return true;
+}
+
+bool HLoopOptimization::TryVectorizedTraditional(LoopNode* node,
+                                                HBasicBlock* body,
+                                                HBasicBlock* exit,
+                                                HPhi* main_phi,
+                                                int64_t trip_count) {
+  HBasicBlock* header = node->loop_info->GetHeader();
+  size_t num_of_blocks = header->GetLoopInformation()->GetBlocks().NumSetBits();
+
+  if (num_of_blocks != 2 || !ShouldVectorizeCommon(node, main_phi, trip_count)) {
+    return false;
+  }
+  VectorizeTraditional(node, body, exit, trip_count);
+  MaybeRecordStat(stats_, MethodCompilationStat::kLoopVectorized);
+  graph_->SetHasTraditionalSIMD(true);  // flag SIMD usage
+  return true;
 }
 
 bool HLoopOptimization::OptimizeInnerLoop(LoopNode* node) {
@@ -1006,7 +1124,10 @@
 // Intel Press, June, 2004 (http://www.aartbik.com/).
 //
 
-bool HLoopOptimization::ShouldVectorize(LoopNode* node, HBasicBlock* block, int64_t trip_count) {
+
+bool HLoopOptimization::CanVectorizeDataFlow(LoopNode* node,
+                                             HBasicBlock* header,
+                                             bool collect_alignment_info) {
   // Reset vector bookkeeping.
   vector_length_ = 0;
   vector_refs_->clear();
@@ -1015,16 +1136,30 @@
   vector_runtime_test_a_ =
   vector_runtime_test_b_ = nullptr;
 
-  // Phis in the loop-body prevent vectorization.
-  if (!block->GetPhis().IsEmpty()) {
-    return false;
-  }
+  // Traverse the data flow of the loop, in the original program order.
+  for (HBlocksInLoopReversePostOrderIterator block_it(*header->GetLoopInformation());
+       !block_it.Done();
+       block_it.Advance()) {
+    HBasicBlock* block = block_it.Current();
 
-  // Scan the loop-body, starting a right-hand-side tree traversal at each left-hand-side
-  // occurrence, which allows passing down attributes down the use tree.
-  for (HInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) {
-    if (!VectorizeDef(node, it.Current(), /*generate_code*/ false)) {
-      return false;  // failure to vectorize a left-hand-side
+    if (block == header) {
+      // The header is of a certain structure (TrySetSimpleLoopHeader) and doesn't need to be
+      // processed here.
+      continue;
+    }
+
+    // Phis in the loop-body prevent vectorization.
+    // TODO: Enable vectorization of CF loops with Phis.
+    if (!block->GetPhis().IsEmpty()) {
+      return false;
+    }
+
+    // Scan the loop-body instructions, starting a right-hand-side tree traversal at each
+    // left-hand-side occurrence, which allows passing down attributes down the use tree.
+    for (HInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) {
+      if (!VectorizeDef(node, it.Current(), /*generate_code*/ false)) {
+        return false;  // failure to vectorize a left-hand-side
+      }
     }
   }
 
@@ -1111,24 +1246,123 @@
     }
   }  // for i
 
-  if (!IsInPredicatedVectorizationMode()) {
-    // Find a suitable alignment strategy.
+  if (collect_alignment_info) {
+    // Update the info on alignment strategy.
     SetAlignmentStrategy(peeling_votes, peeling_candidate);
   }
 
-  // Does vectorization seem profitable?
-  if (!IsVectorizationProfitable(trip_count)) {
-    return false;
-  }
-
   // Success!
   return true;
 }
 
-void HLoopOptimization::Vectorize(LoopNode* node,
-                                  HBasicBlock* block,
-                                  HBasicBlock* exit,
-                                  int64_t trip_count) {
+bool HLoopOptimization::ShouldVectorizeCommon(LoopNode* node,
+                                              HPhi* main_phi,
+                                              int64_t trip_count) {
+  HBasicBlock* header = node->loop_info->GetHeader();
+  HBasicBlock* preheader = node->loop_info->GetPreHeader();
+
+  bool enable_alignment_strategies = !IsInPredicatedVectorizationMode();
+  if (!TrySetSimpleLoopHeader(header, &main_phi) ||
+      !CanVectorizeDataFlow(node, header, enable_alignment_strategies) ||
+      !IsVectorizationProfitable(trip_count) ||
+      !TryAssignLastValue(node->loop_info, main_phi, preheader, /*collect_loop_uses*/ true)) {
+    return false;
+  }
+
+  return true;
+}
+
+void HLoopOptimization::VectorizePredicated(LoopNode* node,
+                                            HBasicBlock* block,
+                                            HBasicBlock* exit) {
+  DCHECK(IsInPredicatedVectorizationMode());
+
+  HBasicBlock* header = node->loop_info->GetHeader();
+  HBasicBlock* preheader = node->loop_info->GetPreHeader();
+
+  // Adjust vector bookkeeping.
+  HPhi* main_phi = nullptr;
+  bool is_simple_loop_header = TrySetSimpleLoopHeader(header, &main_phi);  // refills sets
+  DCHECK(is_simple_loop_header);
+  vector_header_ = header;
+  vector_body_ = block;
+
+  // Loop induction type.
+  DataType::Type induc_type = main_phi->GetType();
+  DCHECK(induc_type == DataType::Type::kInt32 || induc_type == DataType::Type::kInt64)
+      << induc_type;
+
+  // Generate loop control:
+  // stc = <trip-count>;
+  // vtc = <vector trip-count>
+  HInstruction* stc = induction_range_.GenerateTripCount(node->loop_info, graph_, preheader);
+  HInstruction* vtc = stc;
+  vector_index_ = graph_->GetConstant(induc_type, 0);
+  bool needs_disambiguation_test = false;
+  // Generate runtime disambiguation test:
+  // vtc = a != b ? vtc : 0;
+  if (NeedsArrayRefsDisambiguationTest()) {
+    HInstruction* rt = Insert(
+        preheader,
+        new (global_allocator_) HNotEqual(vector_runtime_test_a_, vector_runtime_test_b_));
+    vtc = Insert(preheader,
+                 new (global_allocator_)
+                 HSelect(rt, vtc, graph_->GetConstant(induc_type, 0), kNoDexPc));
+    needs_disambiguation_test = true;
+  }
+
+  // Generate vector loop:
+  // for ( ; i < vtc; i += vector_length)
+  //    <vectorized-loop-body>
+  HBasicBlock* preheader_for_vector_loop =
+      graph_->TransformLoopForVectorization(vector_header_, vector_body_, exit);
+  vector_mode_ = kVector;
+  GenerateNewLoopPredicated(node,
+                            preheader_for_vector_loop,
+                            vector_index_,
+                            vtc,
+                            graph_->GetConstant(induc_type, vector_length_));
+
+  // Generate scalar loop, if needed:
+  // for ( ; i < stc; i += 1)
+  //    <loop-body>
+  if (needs_disambiguation_test) {
+    vector_mode_ = kSequential;
+    HBasicBlock* preheader_for_cleanup_loop =
+        graph_->TransformLoopForVectorization(vector_header_, vector_body_, exit);
+    // Use "Traditional" version for the sequential loop.
+    GenerateNewLoopScalarOrTraditional(node,
+                                       preheader_for_cleanup_loop,
+                                       vector_index_,
+                                       stc,
+                                       graph_->GetConstant(induc_type, 1),
+                                       LoopAnalysisInfo::kNoUnrollingFactor);
+  }
+
+  FinalizeVectorization(node);
+
+  // Assign governing predicates for the predicated instructions inserted during vectorization
+  // outside the loop.
+  for (auto it : *vector_external_set_) {
+    DCHECK(it->IsVecOperation());
+    HVecOperation* vec_op = it->AsVecOperation();
+
+    HVecPredSetAll* set_pred = new (global_allocator_) HVecPredSetAll(global_allocator_,
+                                                                      graph_->GetIntConstant(1),
+                                                                      vec_op->GetPackedType(),
+                                                                      vec_op->GetVectorLength(),
+                                                                      0u);
+    vec_op->GetBlock()->InsertInstructionBefore(set_pred, vec_op);
+    vec_op->SetMergingGoverningPredicate(set_pred);
+  }
+}
+
+void HLoopOptimization::VectorizeTraditional(LoopNode* node,
+                                             HBasicBlock* block,
+                                             HBasicBlock* exit,
+                                             int64_t trip_count) {
+  DCHECK(!IsInPredicatedVectorizationMode());
+
   HBasicBlock* header = node->loop_info->GetHeader();
   HBasicBlock* preheader = node->loop_info->GetPreHeader();
 
@@ -1141,7 +1375,7 @@
 
   // A cleanup loop is needed, at least, for any unknown trip count or
   // for a known trip count with remainder iterations after vectorization.
-  bool needs_cleanup = !IsInPredicatedVectorizationMode() &&
+  bool needs_cleanup =
       (trip_count == 0 || ((trip_count - vector_static_peeling_factor_) % chunk) != 0);
 
   // Adjust vector bookkeeping.
@@ -1160,13 +1394,11 @@
   // ptc = <peeling factor>;
   HInstruction* ptc = nullptr;
   if (vector_static_peeling_factor_ != 0) {
-    DCHECK(!IsInPredicatedVectorizationMode());
     // Static loop peeling for SIMD alignment (using the most suitable
     // fixed peeling factor found during prior alignment analysis).
     DCHECK(vector_dynamic_peeling_candidate_ == nullptr);
     ptc = graph_->GetConstant(induc_type, vector_static_peeling_factor_);
   } else if (vector_dynamic_peeling_candidate_ != nullptr) {
-    DCHECK(!IsInPredicatedVectorizationMode());
     // Dynamic loop peeling for SIMD alignment (using the most suitable
     // candidate found during prior alignment analysis):
     // rem = offset % ALIGN;    // adjusted as #elements
@@ -1197,7 +1429,6 @@
   HInstruction* stc = induction_range_.GenerateTripCount(node->loop_info, graph_, preheader);
   HInstruction* vtc = stc;
   if (needs_cleanup) {
-    DCHECK(!IsInPredicatedVectorizationMode());
     DCHECK(IsPowerOfTwo(chunk));
     HInstruction* diff = stc;
     if (ptc != nullptr) {
@@ -1217,7 +1448,7 @@
 
   // Generate runtime disambiguation test:
   // vtc = a != b ? vtc : 0;
-  if (vector_runtime_test_a_ != nullptr) {
+  if (NeedsArrayRefsDisambiguationTest()) {
     HInstruction* rt = Insert(
         preheader,
         new (global_allocator_) HNotEqual(vector_runtime_test_a_, vector_runtime_test_b_));
@@ -1235,45 +1466,52 @@
   //       moved around during suspend checks, since all analysis was based on
   //       nothing more than the Android runtime alignment conventions.
   if (ptc != nullptr) {
-    DCHECK(!IsInPredicatedVectorizationMode());
     vector_mode_ = kSequential;
-    GenerateNewLoop(node,
-                    block,
-                    graph_->TransformLoopForVectorization(vector_header_, vector_body_, exit),
-                    vector_index_,
-                    ptc,
-                    graph_->GetConstant(induc_type, 1),
-                    LoopAnalysisInfo::kNoUnrollingFactor);
+    HBasicBlock* preheader_for_peeling_loop =
+        graph_->TransformLoopForVectorization(vector_header_, vector_body_, exit);
+    GenerateNewLoopScalarOrTraditional(node,
+                                       preheader_for_peeling_loop,
+                                       vector_index_,
+                                       ptc,
+                                       graph_->GetConstant(induc_type, 1),
+                                       LoopAnalysisInfo::kNoUnrollingFactor);
   }
 
   // Generate vector loop, possibly further unrolled:
   // for ( ; i < vtc; i += chunk)
   //    <vectorized-loop-body>
   vector_mode_ = kVector;
-  GenerateNewLoop(node,
-                  block,
-                  graph_->TransformLoopForVectorization(vector_header_, vector_body_, exit),
-                  vector_index_,
-                  vtc,
-                  graph_->GetConstant(induc_type, vector_length_),  // increment per unroll
-                  unroll);
-  HLoopInformation* vloop = vector_header_->GetLoopInformation();
+  HBasicBlock* preheader_for_vector_loop =
+      graph_->TransformLoopForVectorization(vector_header_, vector_body_, exit);
+  GenerateNewLoopScalarOrTraditional(node,
+                                     preheader_for_vector_loop,
+                                     vector_index_,
+                                     vtc,
+                                     graph_->GetConstant(induc_type, vector_length_),  // per unroll
+                                     unroll);
 
   // Generate cleanup loop, if needed:
   // for ( ; i < stc; i += 1)
   //    <loop-body>
   if (needs_cleanup) {
-    DCHECK_IMPLIES(IsInPredicatedVectorizationMode(), vector_runtime_test_a_ != nullptr);
     vector_mode_ = kSequential;
-    GenerateNewLoop(node,
-                    block,
-                    graph_->TransformLoopForVectorization(vector_header_, vector_body_, exit),
-                    vector_index_,
-                    stc,
-                    graph_->GetConstant(induc_type, 1),
-                    LoopAnalysisInfo::kNoUnrollingFactor);
+    HBasicBlock* preheader_for_cleanup_loop =
+        graph_->TransformLoopForVectorization(vector_header_, vector_body_, exit);
+    GenerateNewLoopScalarOrTraditional(node,
+                                       preheader_for_cleanup_loop,
+                                       vector_index_,
+                                       stc,
+                                       graph_->GetConstant(induc_type, 1),
+                                       LoopAnalysisInfo::kNoUnrollingFactor);
   }
 
+  FinalizeVectorization(node);
+}
+
+void HLoopOptimization::FinalizeVectorization(LoopNode* node) {
+  HBasicBlock* header = node->loop_info->GetHeader();
+  HBasicBlock* preheader = node->loop_info->GetPreHeader();
+  HLoopInformation* vloop = vector_header_->GetLoopInformation();
   // Link reductions to their final uses.
   for (auto i = reductions_->begin(); i != reductions_->end(); ++i) {
     if (i->first->IsPhi()) {
@@ -1287,9 +1525,17 @@
     }
   }
 
-  // Remove the original loop by disconnecting the body block
-  // and removing all instructions from the header.
-  block->DisconnectAndDelete();
+  // Remove the original loop.
+  for (HBlocksInLoopPostOrderIterator it_loop(*node->loop_info);
+       !it_loop.Done();
+       it_loop.Advance()) {
+    HBasicBlock* cur_block = it_loop.Current();
+    if (cur_block == node->loop_info->GetHeader()) {
+      continue;
+    }
+    cur_block->DisconnectAndDelete();
+  }
+
   while (!header->GetFirstInstruction()->IsGoto()) {
     header->RemoveInstruction(header->GetFirstInstruction());
   }
@@ -1301,14 +1547,7 @@
   node->loop_info = vloop;
 }
 
-void HLoopOptimization::GenerateNewLoop(LoopNode* node,
-                                        HBasicBlock* block,
-                                        HBasicBlock* new_preheader,
-                                        HInstruction* lo,
-                                        HInstruction* hi,
-                                        HInstruction* step,
-                                        uint32_t unroll) {
-  DCHECK(unroll == 1 || vector_mode_ == kVector);
+HPhi* HLoopOptimization::InitializeForNewLoop(HBasicBlock* new_preheader, HInstruction* lo) {
   DataType::Type induc_type = lo->GetType();
   // Prepare new loop.
   vector_preheader_ = new_preheader,
@@ -1318,68 +1557,160 @@
                                            kNoRegNumber,
                                            0,
                                            HPhi::ToPhiType(induc_type));
-  // Generate header and prepare body.
-  // for (i = lo; i < hi; i += step)
-  //    <loop-body>
-  HInstruction* cond = nullptr;
-  HInstruction* set_pred = nullptr;
-  if (IsInPredicatedVectorizationMode()) {
-    HVecPredWhile* pred_while =
-        new (global_allocator_) HVecPredWhile(global_allocator_,
-                                              phi,
-                                              hi,
-                                              HVecPredWhile::CondKind::kLO,
-                                              DataType::Type::kInt32,
-                                              vector_length_,
-                                              0u);
+  vector_header_->AddPhi(phi);
+  vector_index_ = phi;
+  vector_permanent_map_->clear();
+  vector_external_set_->clear();
+  predicate_info_map_->clear();
 
-    cond = new (global_allocator_) HVecPredCondition(global_allocator_,
-                                                     pred_while,
-                                                     HVecPredCondition::PCondKind::kNFirst,
-                                                     DataType::Type::kInt32,
-                                                     vector_length_,
-                                                     0u);
+  return phi;
+}
 
-    vector_header_->AddPhi(phi);
-    vector_header_->AddInstruction(pred_while);
-    vector_header_->AddInstruction(cond);
-    set_pred = pred_while;
-  } else {
-    cond = new (global_allocator_) HAboveOrEqual(phi, hi);
-    vector_header_->AddPhi(phi);
-    vector_header_->AddInstruction(cond);
+void HLoopOptimization::GenerateNewLoopScalarOrTraditional(LoopNode* node,
+                                                           HBasicBlock* new_preheader,
+                                                           HInstruction* lo,
+                                                           HInstruction* hi,
+                                                           HInstruction* step,
+                                                           uint32_t unroll) {
+  DCHECK(unroll == 1 || vector_mode_ == kVector);
+  DataType::Type induc_type = lo->GetType();
+  HPhi* phi = InitializeForNewLoop(new_preheader, lo);
+
+  // Generate loop exit check.
+  HInstruction* cond = new (global_allocator_) HAboveOrEqual(phi, hi);
+  vector_header_->AddInstruction(cond);
+  vector_header_->AddInstruction(new (global_allocator_) HIf(cond));
+
+  for (uint32_t u = 0; u < unroll; u++) {
+    GenerateNewLoopBodyOnce(node, induc_type, step);
   }
 
+  FinalizePhisForNewLoop(phi, lo);
+}
+
+void HLoopOptimization::GenerateNewLoopPredicated(LoopNode* node,
+                                                  HBasicBlock* new_preheader,
+                                                  HInstruction* lo,
+                                                  HInstruction* hi,
+                                                  HInstruction* step) {
+  DCHECK(IsInPredicatedVectorizationMode());
+  DCHECK_EQ(vector_mode_, kVector);
+  DataType::Type induc_type = lo->GetType();
+  HPhi* phi = InitializeForNewLoop(new_preheader, lo);
+
+  // Generate loop exit check.
+  HVecPredWhile* pred_while =
+      new (global_allocator_) HVecPredWhile(global_allocator_,
+                                            phi,
+                                            hi,
+                                            HVecPredWhile::CondKind::kLO,
+                                            DataType::Type::kInt32,
+                                            vector_length_,
+                                            0u);
+
+  HInstruction* cond =
+      new (global_allocator_) HVecPredToBoolean(global_allocator_,
+                                                pred_while,
+                                                HVecPredToBoolean::PCondKind::kNFirst,
+                                                DataType::Type::kInt32,
+                                                vector_length_,
+                                                0u);
+
+  vector_header_->AddInstruction(pred_while);
+  vector_header_->AddInstruction(cond);
   vector_header_->AddInstruction(new (global_allocator_) HIf(cond));
-  vector_index_ = phi;
-  vector_permanent_map_->clear();  // preserved over unrolling
-  for (uint32_t u = 0; u < unroll; u++) {
-    // Generate instruction map.
-    vector_map_->clear();
-    for (HInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) {
+
+  PreparePredicateInfoMap(node);
+  GenerateNewLoopBodyOnce(node, induc_type, step);
+  InitPredicateInfoMap(node, pred_while);
+
+  // Assign governing predicates for instructions in the loop; the traversal order doesn't matter.
+  for (HBlocksInLoopIterator block_it(*node->loop_info);
+       !block_it.Done();
+       block_it.Advance()) {
+    HBasicBlock* cur_block = block_it.Current();
+
+    for (HInstructionIterator it(cur_block->GetInstructions()); !it.Done(); it.Advance()) {
+      auto i = vector_map_->find(it.Current());
+      if (i != vector_map_->end()) {
+        HInstruction* instr = i->second;
+
+        if (!instr->IsVecOperation()) {
+          continue;
+        }
+        // There are cases when a vector instruction, which corresponds to some instruction in the
+        // original scalar loop, is located not in the newly created vector loop but
+        // in the vector loop preheader (and hence recorded in vector_external_set_).
+        //
+        // Governing predicates will be set for such instructions separately.
+        bool in_vector_loop = vector_header_->GetLoopInformation()->Contains(*instr->GetBlock());
+        DCHECK_IMPLIES(!in_vector_loop,
+                        vector_external_set_->find(instr) != vector_external_set_->end());
+
+        if (in_vector_loop &&
+            !instr->AsVecOperation()->IsPredicated()) {
+          HVecOperation* op = instr->AsVecOperation();
+          HVecPredSetOperation* pred = predicate_info_map_->Get(cur_block)->GetControlPredicate();
+          op->SetMergingGoverningPredicate(pred);
+        }
+      }
+    }
+  }
+
+  FinalizePhisForNewLoop(phi, lo);
+}
+
+void HLoopOptimization::GenerateNewLoopBodyOnce(LoopNode* node,
+                                                DataType::Type induc_type,
+                                                HInstruction* step) {
+  // Generate instruction map.
+  vector_map_->clear();
+  HLoopInformation* loop_info = node->loop_info;
+
+  // Traverse the data flow of the loop, in the original program order.
+  for (HBlocksInLoopReversePostOrderIterator block_it(*loop_info);
+      !block_it.Done();
+      block_it.Advance()) {
+    HBasicBlock* cur_block = block_it.Current();
+
+    if (cur_block == loop_info->GetHeader()) {
+      continue;
+    }
+
+    for (HInstructionIterator it(cur_block->GetInstructions()); !it.Done(); it.Advance()) {
       bool vectorized_def = VectorizeDef(node, it.Current(), /*generate_code*/ true);
       DCHECK(vectorized_def);
     }
-    // Generate body from the instruction map, but in original program order.
-    HEnvironment* env = vector_header_->GetFirstInstruction()->GetEnvironment();
-    for (HInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) {
+  }
+
+  // Generate body from the instruction map, in the original program order.
+  HEnvironment* env = vector_header_->GetFirstInstruction()->GetEnvironment();
+  for (HBlocksInLoopReversePostOrderIterator block_it(*loop_info);
+        !block_it.Done();
+        block_it.Advance()) {
+    HBasicBlock* cur_block = block_it.Current();
+
+    if (cur_block == loop_info->GetHeader()) {
+      continue;
+    }
+
+    for (HInstructionIterator it(cur_block->GetInstructions()); !it.Done(); it.Advance()) {
       auto i = vector_map_->find(it.Current());
       if (i != vector_map_->end() && !i->second->IsInBlock()) {
         Insert(vector_body_, i->second);
-        if (IsInPredicatedVectorizationMode() && i->second->IsVecOperation()) {
-          HVecOperation* op = i->second->AsVecOperation();
-          op->SetMergingGoverningPredicate(set_pred);
-        }
         // Deal with instructions that need an environment, such as the scalar intrinsics.
         if (i->second->NeedsEnvironment()) {
           i->second->CopyEnvironmentFromWithLoopPhiAdjustment(env, vector_header_);
         }
       }
     }
-    // Generate the induction.
-    vector_index_ = new (global_allocator_) HAdd(induc_type, vector_index_, step);
-    Insert(vector_body_, vector_index_);
   }
+  // Generate the induction.
+  vector_index_ = new (global_allocator_) HAdd(induc_type, vector_index_, step);
+  Insert(vector_body_, vector_index_);
+}
+
+void HLoopOptimization::FinalizePhisForNewLoop(HPhi* phi, HInstruction* lo) {
   // Finalize phi inputs for the reductions (if any).
   for (auto i = reductions_->begin(); i != reductions_->end(); ++i) {
     if (!i->first->IsPhi()) {
@@ -1442,10 +1773,13 @@
         VectorizeDotProdIdiom(node, instruction, generate_code, type, restrictions) ||
         (TrySetVectorType(type, &restrictions) &&
          VectorizeUse(node, instruction, generate_code, type, restrictions))) {
+      DCHECK(!instruction->IsPhi());
       if (generate_code) {
-        HInstruction* new_red = vector_map_->Get(instruction);
-        vector_permanent_map_->Put(new_red, vector_map_->Get(redit->second));
-        vector_permanent_map_->Overwrite(redit->second, new_red);
+        HInstruction* new_red_vec_op = vector_map_->Get(instruction);
+        HInstruction* original_phi = redit->second;
+        DCHECK(original_phi->IsPhi());
+        vector_permanent_map_->Put(new_red_vec_op, vector_map_->Get(original_phi));
+        vector_permanent_map_->Overwrite(original_phi, new_red_vec_op);
       }
       return true;
     }
@@ -1455,6 +1789,10 @@
   if (instruction->IsGoto()) {
     return true;
   }
+
+  if (instruction->IsIf()) {
+    return VectorizeIfCondition(node, instruction, generate_code, restrictions);
+  }
   // Otherwise accept only expressions with no effects outside the immediate loop-body.
   // Note that actual uses are inspected during right-hand-side tree traversal.
   return !IsUsedOutsideLoop(node->loop_info, instruction)
@@ -1485,9 +1823,7 @@
     // Deal with vector restrictions.
     bool is_string_char_at = instruction->AsArrayGet()->IsStringCharAt();
 
-    if (is_string_char_at && (HasVectorRestrictions(restrictions, kNoStringCharAt) ||
-                              IsInPredicatedVectorizationMode())) {
-      // TODO: Support CharAt for predicated mode.
+    if (is_string_char_at && (HasVectorRestrictions(restrictions, kNoStringCharAt))) {
       return false;
     }
     // Accept a right-hand-side array base[index] for
@@ -1676,6 +2012,7 @@
     case InstructionSet::kThumb2:
       // Allow vectorization for all ARM devices, because Android assumes that
       // ARM 32-bit always supports advanced SIMD (64-bit SIMD).
+      *restrictions |= kNoIfCond;
       switch (type) {
         case DataType::Type::kBool:
         case DataType::Type::kUint8:
@@ -1701,6 +2038,13 @@
         DCHECK_EQ(simd_register_size_ % DataType::Size(type), 0u);
         switch (type) {
           case DataType::Type::kBool:
+            *restrictions |= kNoDiv |
+                             kNoSignedHAdd |
+                             kNoUnsignedHAdd |
+                             kNoUnroundedHAdd |
+                             kNoSAD |
+                             kNoIfCond;
+            return TrySetVectorLength(type, vector_length);
           case DataType::Type::kUint8:
           case DataType::Type::kInt8:
             *restrictions |= kNoDiv |
@@ -1712,6 +2056,7 @@
           case DataType::Type::kUint16:
           case DataType::Type::kInt16:
             *restrictions |= kNoDiv |
+                             kNoStringCharAt |   // TODO: support in predicated mode.
                              kNoSignedHAdd |
                              kNoUnsignedHAdd |
                              kNoUnroundedHAdd |
@@ -1722,13 +2067,13 @@
             *restrictions |= kNoDiv | kNoSAD;
             return TrySetVectorLength(type, vector_length);
           case DataType::Type::kInt64:
-            *restrictions |= kNoDiv | kNoSAD;
+            *restrictions |= kNoDiv | kNoSAD | kNoIfCond;
             return TrySetVectorLength(type, vector_length);
           case DataType::Type::kFloat32:
-            *restrictions |= kNoReduction;
+            *restrictions |= kNoReduction | kNoIfCond;
             return TrySetVectorLength(type, vector_length);
           case DataType::Type::kFloat64:
-            *restrictions |= kNoReduction;
+            *restrictions |= kNoReduction | kNoIfCond;
             return TrySetVectorLength(type, vector_length);
           default:
             break;
@@ -1737,6 +2082,7 @@
       } else {
         // Allow vectorization for all ARM devices, because Android assumes that
         // ARMv8 AArch64 always supports advanced SIMD (128-bit SIMD).
+        *restrictions |= kNoIfCond;
         switch (type) {
           case DataType::Type::kBool:
           case DataType::Type::kUint8:
@@ -1767,6 +2113,7 @@
     case InstructionSet::kX86:
     case InstructionSet::kX86_64:
       // Allow vectorization for SSE4.1-enabled X86 devices only (128-bit SIMD).
+      *restrictions |= kNoIfCond;
       if (features->AsX86InstructionSetFeatures()->HasSSE4_1()) {
         switch (type) {
           case DataType::Type::kBool:
@@ -1855,15 +2202,7 @@
       vector = new (global_allocator_)
           HVecReplicateScalar(global_allocator_, input, type, vector_length_, kNoDexPc);
       vector_permanent_map_->Put(org, Insert(vector_preheader_, vector));
-      if (IsInPredicatedVectorizationMode()) {
-        HVecPredSetAll* set_pred = new (global_allocator_) HVecPredSetAll(global_allocator_,
-                                                                          graph_->GetIntConstant(1),
-                                                                          type,
-                                                                          vector_length_,
-                                                                          0u);
-        vector_preheader_->InsertInstructionBefore(set_pred, vector);
-        vector->AsVecOperation()->SetMergingGoverningPredicate(set_pred);
-      }
+      vector_external_set_->insert(vector);
     }
     vector_map_->Put(org, vector);
   }
@@ -1936,18 +2275,18 @@
   vector_map_->Put(org, vector);
 }
 
-void HLoopOptimization::GenerateVecReductionPhi(HPhi* phi) {
-  DCHECK(reductions_->find(phi) != reductions_->end());
-  DCHECK(reductions_->Get(phi->InputAt(1)) == phi);
+void HLoopOptimization::GenerateVecReductionPhi(HPhi* orig_phi) {
+  DCHECK(reductions_->find(orig_phi) != reductions_->end());
+  DCHECK(reductions_->Get(orig_phi->InputAt(1)) == orig_phi);
   HInstruction* vector = nullptr;
   if (vector_mode_ == kSequential) {
     HPhi* new_phi = new (global_allocator_) HPhi(
-        global_allocator_, kNoRegNumber, 0, phi->GetType());
+        global_allocator_, kNoRegNumber, 0, orig_phi->GetType());
     vector_header_->AddPhi(new_phi);
     vector = new_phi;
   } else {
     // Link vector reduction back to prior unrolled update, or a first phi.
-    auto it = vector_permanent_map_->find(phi);
+    auto it = vector_permanent_map_->find(orig_phi);
     if (it != vector_permanent_map_->end()) {
       vector = it->second;
     } else {
@@ -1957,7 +2296,7 @@
       vector = new_phi;
     }
   }
-  vector_map_->Put(phi, vector);
+  vector_map_->Put(orig_phi, vector);
 }
 
 void HLoopOptimization::GenerateVecReductionPhiInputs(HPhi* phi, HInstruction* reduction) {
@@ -1992,15 +2331,7 @@
                                                                     vector_length,
                                                                     kNoDexPc));
     }
-    if (IsInPredicatedVectorizationMode()) {
-      HVecPredSetAll* set_pred = new (global_allocator_) HVecPredSetAll(global_allocator_,
-                                                                        graph_->GetIntConstant(1),
-                                                                        type,
-                                                                        vector_length,
-                                                                        0u);
-      vector_preheader_->InsertInstructionBefore(set_pred, new_init);
-      new_init->AsVecOperation()->SetMergingGoverningPredicate(set_pred);
-    }
+    vector_external_set_->insert(new_init);
   } else {
     new_init = ReduceAndExtractIfNeeded(new_init);
   }
@@ -2026,23 +2357,15 @@
       //    x = REDUCE( [x_1, .., x_n] )
       //    y = x_1
       // along the exit of the defining loop.
-      HInstruction* reduce = new (global_allocator_) HVecReduce(
+      HVecReduce* reduce = new (global_allocator_) HVecReduce(
           global_allocator_, instruction, type, vector_length, kind, kNoDexPc);
       exit->InsertInstructionBefore(reduce, exit->GetFirstInstruction());
+      vector_external_set_->insert(reduce);
       instruction = new (global_allocator_) HVecExtractScalar(
           global_allocator_, reduce, type, vector_length, 0, kNoDexPc);
       exit->InsertInstructionAfter(instruction, reduce);
 
-      if (IsInPredicatedVectorizationMode()) {
-        HVecPredSetAll* set_pred = new (global_allocator_) HVecPredSetAll(global_allocator_,
-                                                                          graph_->GetIntConstant(1),
-                                                                          type,
-                                                                          vector_length,
-                                                                          0u);
-        exit->InsertInstructionBefore(set_pred, reduce);
-        reduce->AsVecOperation()->SetMergingGoverningPredicate(set_pred);
-        instruction->AsVecOperation()->SetMergingGoverningPredicate(set_pred);
-      }
+      vector_external_set_->insert(instruction);
     }
   }
   return instruction;
@@ -2057,10 +2380,10 @@
   } \
   break;
 
-void HLoopOptimization::GenerateVecOp(HInstruction* org,
-                                      HInstruction* opa,
-                                      HInstruction* opb,
-                                      DataType::Type type) {
+HInstruction* HLoopOptimization::GenerateVecOp(HInstruction* org,
+                                               HInstruction* opa,
+                                               HInstruction* opb,
+                                               DataType::Type type) {
   uint32_t dex_pc = org->GetDexPc();
   HInstruction* vector = nullptr;
   DataType::Type org_type = org->GetType();
@@ -2130,11 +2453,23 @@
       GENERATE_VEC(
         new (global_allocator_) HVecAbs(global_allocator_, opa, type, vector_length_, dex_pc),
         new (global_allocator_) HAbs(org_type, opa, dex_pc));
+    case HInstruction::kEqual: {
+        // Special case.
+        if (vector_mode_ == kVector) {
+          vector = new (global_allocator_) HVecCondition(
+              global_allocator_, opa, opb, type, vector_length_, dex_pc);
+        } else {
+          DCHECK(vector_mode_ == kSequential);
+          UNREACHABLE();
+        }
+      }
+      break;
     default:
       break;
   }  // switch
   CHECK(vector != nullptr) << "Unsupported SIMD operator";
   vector_map_->Put(org, vector);
+  return vector;
 }
 
 #undef GENERATE_VEC
@@ -2374,6 +2709,89 @@
   return false;
 }
 
+bool HLoopOptimization::VectorizeIfCondition(LoopNode* node,
+                                             HInstruction* hif,
+                                             bool generate_code,
+                                             uint64_t restrictions) {
+  DCHECK(hif->IsIf());
+  HInstruction* if_input = hif->InputAt(0);
+
+  if (!if_input->HasOnlyOneNonEnvironmentUse()) {
+    // Avoid the complications of the condition used as materialized boolean.
+    return false;
+  }
+
+  if (!if_input->IsEqual()) {
+    // TODO: Support other condition types.
+    return false;
+  }
+
+  HCondition* cond = if_input->AsCondition();
+  HInstruction* opa = cond->InputAt(0);
+  HInstruction* opb = cond->InputAt(1);
+  DataType::Type type = GetNarrowerType(opa, opb);
+
+  if (!DataType::IsIntegralType(type)) {
+    return false;
+  }
+
+  bool is_unsigned = false;
+  HInstruction* opa_promoted = opa;
+  HInstruction* opb_promoted = opb;
+  bool is_int_case = DataType::Type::kInt32 == opa->GetType() &&
+                     DataType::Type::kInt32 == opb->GetType();
+
+  // Condition arguments should be either both int32 or consistently extended signed/unsigned
+  // narrower operands.
+  if (!is_int_case &&
+      !IsNarrowerOperands(opa, opb, type, &opa_promoted, &opb_promoted, &is_unsigned)) {
+    return false;
+  }
+  type = HVecOperation::ToProperType(type, is_unsigned);
+
+  // For narrow types, explicit type conversion may have been
+  // optimized way, so set the no hi bits restriction here.
+  if (DataType::Size(type) <= 2) {
+    restrictions |= kNoHiBits;
+  }
+
+  if (!TrySetVectorType(type, &restrictions) ||
+      HasVectorRestrictions(restrictions, kNoIfCond)) {
+    return false;
+  }
+
+  if (generate_code && vector_mode_ != kVector) {  // de-idiom
+    opa_promoted = opa;
+    opb_promoted = opb;
+  }
+
+  if (VectorizeUse(node, opa_promoted, generate_code, type, restrictions) &&
+      VectorizeUse(node, opb_promoted, generate_code, type, restrictions)) {
+    if (generate_code) {
+      HInstruction* vec_cond = GenerateVecOp(cond,
+                                             vector_map_->Get(opa_promoted),
+                                             vector_map_->Get(opb_promoted),
+                                             type);
+
+      if (vector_mode_ == kVector) {
+          HInstruction* vec_pred_not = new (global_allocator_) HVecPredNot(
+              global_allocator_, vec_cond, type, vector_length_, hif->GetDexPc());
+
+          vector_map_->Put(hif, vec_pred_not);
+          BlockPredicateInfo* pred_info = predicate_info_map_->Get(hif->GetBlock());
+          pred_info->SetControlFlowInfo(vec_cond->AsVecPredSetOperation(),
+                                        vec_pred_not->AsVecPredSetOperation());
+        } else {
+          DCHECK(vector_mode_ == kSequential);
+          UNREACHABLE();
+      }
+    }
+    return true;
+  }
+
+  return false;
+}
+
 //
 // Vectorization heuristics.
 //
@@ -2423,6 +2841,8 @@
   // TODO: trip count is really unsigned entity, provided the guarding test
   //       is satisfied; deal with this more carefully later
   uint32_t max_peel = MaxNumberPeeled();
+  // Peeling is not supported in predicated mode.
+  DCHECK_IMPLIES(IsInPredicatedVectorizationMode(), max_peel == 0u);
   if (vector_length_ == 0) {
     return false;  // nothing found
   } else if (trip_count < 0) {
@@ -2686,4 +3106,67 @@
   return true;
 }
 
+void HLoopOptimization::PreparePredicateInfoMap(LoopNode* node) {
+  HLoopInformation* loop_info = node->loop_info;
+
+  DCHECK(IsPredicatedLoopControlFlowSupported(loop_info));
+
+  for (HBlocksInLoopIterator block_it(*loop_info);
+      !block_it.Done();
+      block_it.Advance()) {
+    HBasicBlock* cur_block = block_it.Current();
+    BlockPredicateInfo* pred_info = new (loop_allocator_) BlockPredicateInfo();
+
+    predicate_info_map_->Put(cur_block, pred_info);
+  }
+}
+
+void HLoopOptimization::InitPredicateInfoMap(LoopNode* node,
+                                             HVecPredSetOperation* loop_main_pred) {
+  HLoopInformation* loop_info = node->loop_info;
+  HBasicBlock* header = loop_info->GetHeader();
+  BlockPredicateInfo* header_info = predicate_info_map_->Get(header);
+  // Loop header is a special case; it doesn't have a false predicate because we
+  // would just exit the loop then.
+  header_info->SetControlFlowInfo(loop_main_pred, loop_main_pred);
+
+  size_t blocks_in_loop = header->GetLoopInformation()->GetBlocks().NumSetBits();
+  if (blocks_in_loop == 2) {
+    for (HBasicBlock* successor : header->GetSuccessors()) {
+      if (loop_info->Contains(*successor)) {
+        // This is loop second block - body.
+        BlockPredicateInfo* body_info = predicate_info_map_->Get(successor);
+        body_info->SetControlPredicate(loop_main_pred);
+        return;
+      }
+    }
+    UNREACHABLE();
+  }
+
+  // TODO: support predicated vectorization of CF loop of more complex structure.
+  DCHECK(HasLoopDiamondStructure(loop_info));
+  HBasicBlock* header_succ_0 = header->GetSuccessors()[0];
+  HBasicBlock* header_succ_1 = header->GetSuccessors()[1];
+  HBasicBlock* diamond_top = loop_info->Contains(*header_succ_0) ?
+                             header_succ_0 :
+                             header_succ_1;
+
+  HIf* diamond_hif = diamond_top->GetLastInstruction()->AsIf();
+  HBasicBlock* diamond_true = diamond_hif->IfTrueSuccessor();
+  HBasicBlock* diamond_false = diamond_hif->IfFalseSuccessor();
+  HBasicBlock* back_edge = diamond_true->GetSingleSuccessor();
+
+  BlockPredicateInfo* diamond_top_info = predicate_info_map_->Get(diamond_top);
+  BlockPredicateInfo* diamond_true_info = predicate_info_map_->Get(diamond_true);
+  BlockPredicateInfo* diamond_false_info = predicate_info_map_->Get(diamond_false);
+  BlockPredicateInfo* back_edge_info = predicate_info_map_->Get(back_edge);
+
+  diamond_top_info->SetControlPredicate(header_info->GetTruePredicate());
+
+  diamond_true_info->SetControlPredicate(diamond_top_info->GetTruePredicate());
+  diamond_false_info->SetControlPredicate(diamond_top_info->GetFalsePredicate());
+
+  back_edge_info->SetControlPredicate(header_info->GetTruePredicate());
+}
+
 }  // namespace art
diff --git a/compiler/optimizing/loop_optimization.h b/compiler/optimizing/loop_optimization.h
index 6dd778b..86a9f0f 100644
--- a/compiler/optimizing/loop_optimization.h
+++ b/compiler/optimizing/loop_optimization.h
@@ -101,6 +101,7 @@
     kNoSAD           = 1 << 11,  // no sum of absolute differences (SAD)
     kNoWideSAD       = 1 << 12,  // no sum of absolute differences (SAD) with operand widening
     kNoDotProd       = 1 << 13,  // no dot product
+    kNoIfCond        = 1 << 14,  // no if condition conversion
   };
 
   /*
@@ -136,6 +137,95 @@
     bool is_string_char_at;  // compressed string read
   };
 
+  // This structure describes the control flow (CF) -> data flow (DF) conversion of the loop
+  // with control flow (see below) for the purpose of predicated autovectorization.
+  //
+  // Lets define "loops without control-flow" (or non-CF loops) as loops with two consecutive
+  // blocks and without the branching structure except for the loop exit. And
+  // "loop with control-flow" (or CF-loops) - all other loops.
+  //
+  // In the execution of the original CF-loop on each iteration some basic block Y will be
+  // either executed or not executed, depending on the control flow of the loop. More
+  // specifically, a block will be executed if all the conditional branches of the nodes in
+  // the control dependency graph for that block Y are taken according to the path from the loop
+  // header to that basic block.
+  //
+  // This is the key idea of CF->DF conversion: a boolean value
+  // 'ctrl_pred == cond1 && cond2 && ...' will determine whether the basic block Y will be
+  // executed, where cond_K is whether the branch of the node K in the control dependency
+  // graph upward traversal was taken in the 'right' direction.
+  //
+  // Def.: BB Y is control dependent on BB X iff
+  //   (1) there exists a directed path P from X to Y with any basic block Z in P (excluding X
+  //       and Y) post-dominated by Y and
+  //   (2) X is not post-dominated by Y.
+  //             ...
+  //              X
+  //     false /     \ true
+  //          /       \
+  //                  ...
+  //                   |
+  //                   Y
+  //                  ...
+  //
+  // When doing predicated autovectorization of a CF loop, we use the CF->DF conversion approach:
+  //  1) do the data analysis and vector operation creation as if it was a non-CF loop.
+  //  2) for each HIf block create two vector predicate setting instructions - for True and False
+  //     edges/paths.
+  //  3) assign a governing vector predicate (see comments near HVecPredSetOperation)
+  //     to each vector operation Alpha in the loop (including to those vector predicate setting
+  //     instructions created in #2); do this by:
+  //     - finding the immediate control dependent block of the instruction Alpha's block.
+  //     - choosing the True or False predicate setting instruction (created in #2) depending
+  //       on the path to the instruction.
+  //
+  // For more information check the papers:
+  //
+  //   - Allen, John R and Kennedy, Ken and Porterfield, Carrie and Warren, Joe,
+  //     “Conversion of Control Dependence to Data Dependence,” in Proceedings of the 10th ACM
+  //     SIGACT-SIGPLAN Symposium on Principles of Programming Languages, 1983, pp. 177–189.
+  //   - JEANNE FERRANTE, KARL J. OTTENSTEIN, JOE D. WARREN,
+  //     "The Program Dependence Graph and Its Use in Optimization"
+  //
+  class BlockPredicateInfo : public ArenaObject<kArenaAllocLoopOptimization> {
+   public:
+    BlockPredicateInfo() :
+        control_predicate_(nullptr),
+        true_predicate_(nullptr),
+        false_predicate_(nullptr) {}
+
+    void SetControlFlowInfo(HVecPredSetOperation* true_predicate,
+                            HVecPredSetOperation* false_predicate) {
+      DCHECK(!HasControlFlowOps());
+      true_predicate_ = true_predicate;
+      false_predicate_ = false_predicate;
+    }
+
+    bool HasControlFlowOps() const {
+      // Note: a block must have both T/F predicates set or none of them.
+      DCHECK_EQ(true_predicate_ == nullptr, false_predicate_ == nullptr);
+      return true_predicate_ != nullptr;
+    }
+
+    HVecPredSetOperation* GetControlPredicate() const { return control_predicate_; }
+    void SetControlPredicate(HVecPredSetOperation* control_predicate) {
+      control_predicate_ = control_predicate;
+    }
+
+    HVecPredSetOperation* GetTruePredicate() const { return true_predicate_; }
+    HVecPredSetOperation* GetFalsePredicate() const { return false_predicate_; }
+
+   private:
+    // Vector control predicate operation, associated with the block which will determine
+    // the active lanes for all vector operations, originated from this block.
+    HVecPredSetOperation* control_predicate_;
+
+    // Vector predicate instruction, associated with the true sucessor of the block.
+    HVecPredSetOperation* true_predicate_;
+    // Vector predicate instruction, associated with the false sucessor of the block.
+    HVecPredSetOperation* false_predicate_;
+  };
+
   //
   // Loop setup and traversal.
   //
@@ -203,15 +293,95 @@
   // Vectorization analysis and synthesis.
   //
 
-  bool ShouldVectorize(LoopNode* node, HBasicBlock* block, int64_t trip_count);
-  void Vectorize(LoopNode* node, HBasicBlock* block, HBasicBlock* exit, int64_t trip_count);
-  void GenerateNewLoop(LoopNode* node,
-                       HBasicBlock* block,
-                       HBasicBlock* new_preheader,
-                       HInstruction* lo,
-                       HInstruction* hi,
-                       HInstruction* step,
-                       uint32_t unroll);
+  // Returns whether the data flow requirements are met for vectorization.
+  //
+  //   - checks whether instructions are vectorizable for the target.
+  //   - conducts data dependence analysis for array references.
+  //   - additionally, collects info on peeling and aligment strategy.
+  bool CanVectorizeDataFlow(LoopNode* node, HBasicBlock* header, bool collect_alignment_info);
+
+  // Does the checks (common for predicated and traditional mode) for the loop.
+  bool ShouldVectorizeCommon(LoopNode* node, HPhi* main_phi, int64_t trip_count);
+
+  // Try to vectorize the loop, returns whether it was successful.
+  //
+  // There are two versions/algorithms:
+  //  - Predicated: all the vector operations have governing predicates which control
+  //    which individual vector lanes will be active (see HVecPredSetOperation for more details).
+  //    Example: vectorization using AArch64 SVE.
+  //  - Traditional: a regular mode in which all vector operations lanes are unconditionally
+  //    active.
+  //    Example: vectoriation using AArch64 NEON.
+  bool TryVectorizePredicated(LoopNode* node,
+                              HBasicBlock* body,
+                              HBasicBlock* exit,
+                              HPhi* main_phi,
+                              int64_t trip_count);
+
+  bool TryVectorizedTraditional(LoopNode* node,
+                                HBasicBlock* body,
+                                HBasicBlock* exit,
+                                HPhi* main_phi,
+                                int64_t trip_count);
+
+  // Vectorizes the loop for which all checks have been already done.
+  void VectorizePredicated(LoopNode* node,
+                           HBasicBlock* block,
+                           HBasicBlock* exit);
+  void VectorizeTraditional(LoopNode* node,
+                            HBasicBlock* block,
+                            HBasicBlock* exit,
+                            int64_t trip_count);
+
+  // Performs final steps for whole vectorization process: links reduction, removes the original
+  // scalar loop, updates loop info.
+  void FinalizeVectorization(LoopNode* node);
+
+  // Helpers that do the vector instruction synthesis for the previously created loop; create
+  // and fill the loop body with instructions.
+  //
+  // A version to generate a vector loop in predicated mode.
+  void GenerateNewLoopPredicated(LoopNode* node,
+                                 HBasicBlock* new_preheader,
+                                 HInstruction* lo,
+                                 HInstruction* hi,
+                                 HInstruction* step);
+
+  // A version to generate a vector loop in traditional mode or to generate
+  // a scalar loop for both modes.
+  void GenerateNewLoopScalarOrTraditional(LoopNode* node,
+                                          HBasicBlock* new_preheader,
+                                          HInstruction* lo,
+                                          HInstruction* hi,
+                                          HInstruction* step,
+                                          uint32_t unroll);
+
+  //
+  // Helpers for GenerateNewLoop*.
+  //
+
+  // Updates vectorization bookkeeping date for the new loop, creates and returns
+  // its main induction Phi.
+  HPhi* InitializeForNewLoop(HBasicBlock* new_preheader, HInstruction* lo);
+
+  // Finalizes reduction and induction phis' inputs for the newly created loop.
+  void FinalizePhisForNewLoop(HPhi* phi, HInstruction* lo);
+
+  // Creates empty predicate info object for each basic block and puts it into the map.
+  void PreparePredicateInfoMap(LoopNode* node);
+
+  // Set up block true/false predicates using info, collected through data flow and control
+  // dependency analysis.
+  void InitPredicateInfoMap(LoopNode* node, HVecPredSetOperation* loop_main_pred);
+
+  // Performs instruction synthesis for the loop body.
+  void GenerateNewLoopBodyOnce(LoopNode* node,
+                               DataType::Type induc_type,
+                               HInstruction* step);
+
+  // Returns whether the vector loop needs runtime disambiguation test for array refs.
+  bool NeedsArrayRefsDisambiguationTest() const { return vector_runtime_test_a_ != nullptr; }
+
   bool VectorizeDef(LoopNode* node, HInstruction* instruction, bool generate_code);
   bool VectorizeUse(LoopNode* node,
                     HInstruction* instruction,
@@ -239,10 +409,10 @@
   void GenerateVecReductionPhi(HPhi* phi);
   void GenerateVecReductionPhiInputs(HPhi* phi, HInstruction* reduction);
   HInstruction* ReduceAndExtractIfNeeded(HInstruction* instruction);
-  void GenerateVecOp(HInstruction* org,
-                     HInstruction* opa,
-                     HInstruction* opb,
-                     DataType::Type type);
+  HInstruction* GenerateVecOp(HInstruction* org,
+                              HInstruction* opa,
+                              HInstruction* opb,
+                              DataType::Type type);
 
   // Vectorization idioms.
   bool VectorizeSaturationIdiom(LoopNode* node,
@@ -265,6 +435,10 @@
                              bool generate_code,
                              DataType::Type type,
                              uint64_t restrictions);
+  bool VectorizeIfCondition(LoopNode* node,
+                            HInstruction* instruction,
+                            bool generate_code,
+                            uint64_t restrictions);
 
   // Vectorization heuristics.
   Alignment ComputeAlignment(HInstruction* offset,
@@ -369,6 +543,16 @@
   // Contents reside in phase-local heap memory.
   ScopedArenaSafeMap<HInstruction*, HInstruction*>* vector_permanent_map_;
 
+  // Tracks vector operations that are inserted outside of the loop (preheader, exit)
+  // as part of vectorization (e.g. replicate scalar for loop invariants and reduce ops
+  // for loop reductions).
+  ScopedArenaSet<HInstruction*>* vector_external_set_;
+
+  // A mapping between a basic block of the original loop and its associated PredicateInfo.
+  //
+  // Only used in predicated loop vectorization mode.
+  ScopedArenaSafeMap<HBasicBlock*, BlockPredicateInfo*>* predicate_info_map_;
+
   // Temporary vectorization bookkeeping.
   VectorMode vector_mode_;  // synthesis mode
   HBasicBlock* vector_preheader_;  // preheader of the new loop
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index 3790058..c87c788 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -18,6 +18,7 @@
 #include <algorithm>
 #include <cfloat>
 #include <functional>
+#include <optional>
 
 #include "art_method-inl.h"
 #include "base/arena_allocator.h"
@@ -35,7 +36,9 @@
 #include "class_root-inl.h"
 #include "code_generator.h"
 #include "common_dominator.h"
+#include "intrinsic_objects.h"
 #include "intrinsics.h"
+#include "intrinsics_list.h"
 #include "mirror/class-inl.h"
 #include "scoped_thread_state_change-inl.h"
 #include "ssa_builder.h"
@@ -254,6 +257,14 @@
   return kAnalysisSuccess;
 }
 
+GraphAnalysisResult HGraph::RecomputeDominatorTree() {
+  DCHECK(!HasIrreducibleLoops()) << "Recomputing loop information in graphs with irreducible loops "
+                                 << "is unsupported, as it could lead to loop header changes";
+  ClearLoopInformation();
+  ClearDominanceInformation();
+  return BuildDominatorTree();
+}
+
 void HGraph::ClearDominanceInformation() {
   for (HBasicBlock* block : GetActiveBlocks()) {
     block->ClearDominanceInformation();
@@ -298,171 +309,6 @@
   }
 }
 
-// TODO Consider moving this entirely into LoadStoreAnalysis/Elimination.
-bool HGraph::PathBetween(uint32_t source_idx, uint32_t dest_idx) const {
-  DCHECK_LT(source_idx, blocks_.size()) << "source not present in graph!";
-  DCHECK_LT(dest_idx, blocks_.size()) << "dest not present in graph!";
-  DCHECK(blocks_[source_idx] != nullptr);
-  DCHECK(blocks_[dest_idx] != nullptr);
-  return reachability_graph_.IsBitSet(source_idx, dest_idx);
-}
-
-bool HGraph::PathBetween(const HBasicBlock* source, const HBasicBlock* dest) const {
-  if (source == nullptr || dest == nullptr) {
-    return false;
-  }
-  size_t source_idx = source->GetBlockId();
-  size_t dest_idx = dest->GetBlockId();
-  return PathBetween(source_idx, dest_idx);
-}
-
-// This function/struct calculates the reachability of every node from every
-// other node by iteratively using DFS to find reachability of each individual
-// block.
-//
-// This is in practice faster then the simpler Floyd-Warshall since while that
-// is O(N**3) this is O(N*(E + N)) where N is the number of blocks and E is the
-// number of edges. Since in practice each block only has a few outgoing edges
-// we can confidently say that E ~ B*N where B is a small number (~3). We also
-// memoize the results as we go allowing us to (potentially) avoid walking the
-// entire graph for every node. To make best use of this memoization we
-// calculate the reachability of blocks in PostOrder. This means that
-// (generally) blocks that are dominated by many other blocks and dominate few
-// blocks themselves will be examined first. This makes it more likely we can
-// use our memoized results.
-class ReachabilityAnalysisHelper {
- public:
-  ReachabilityAnalysisHelper(const HGraph* graph,
-                             ArenaBitVectorArray* reachability_graph,
-                             ArenaStack* arena_stack)
-      : graph_(graph),
-        reachability_graph_(reachability_graph),
-        arena_stack_(arena_stack),
-        temporaries_(arena_stack_),
-        block_size_(RoundUp(graph_->GetBlocks().size(), BitVector::kWordBits)),
-        all_visited_nodes_(
-            &temporaries_, graph_->GetBlocks().size(), false, kArenaAllocReachabilityGraph),
-        not_post_order_visited_(
-            &temporaries_, graph_->GetBlocks().size(), false, kArenaAllocReachabilityGraph) {
-    // We can't adjust the size of reachability graph any more without breaking
-    // our allocator invariants so it had better be large enough.
-    CHECK_GE(reachability_graph_->NumRows(), graph_->GetBlocks().size());
-    CHECK_GE(reachability_graph_->NumColumns(), graph_->GetBlocks().size());
-    not_post_order_visited_.SetInitialBits(graph_->GetBlocks().size());
-  }
-
-  void CalculateReachability() {
-    // Calculate what blocks connect using repeated DFS
-    //
-    // Going in PostOrder should generally give memoization a good shot of
-    // hitting.
-    for (const HBasicBlock* blk : graph_->GetPostOrder()) {
-      if (blk == nullptr) {
-        continue;
-      }
-      not_post_order_visited_.ClearBit(blk->GetBlockId());
-      CalculateConnectednessOn(blk);
-      all_visited_nodes_.SetBit(blk->GetBlockId());
-    }
-    // Get all other bits
-    for (auto idx : not_post_order_visited_.Indexes()) {
-      const HBasicBlock* blk = graph_->GetBlocks()[idx];
-      if (blk == nullptr) {
-        continue;
-      }
-      CalculateConnectednessOn(blk);
-      all_visited_nodes_.SetBit(blk->GetBlockId());
-    }
-  }
-
- private:
-  void AddEdge(uint32_t source, const HBasicBlock* dest) {
-    reachability_graph_->SetBit(source, dest->GetBlockId());
-  }
-
-  // Union the reachability of 'idx' into 'update_block_idx'. This is done to
-  // implement memoization. In order to improve performance we do this in 4-byte
-  // blocks. Clang should be able to optimize this to larger blocks if possible.
-  void UnionBlock(size_t update_block_idx, size_t idx) {
-    reachability_graph_->UnionRows(update_block_idx, idx);
-  }
-
-  // Single DFS to get connectedness of a single block
-  void CalculateConnectednessOn(const HBasicBlock* const target_block) {
-    const uint32_t target_idx = target_block->GetBlockId();
-    ScopedArenaAllocator connectedness_temps(arena_stack_);
-    // What nodes we have already discovered and either have processed or are
-    // already on the queue.
-    ArenaBitVector discovered(
-        &connectedness_temps, graph_->GetBlocks().size(), false, kArenaAllocReachabilityGraph);
-    // The work stack. What blocks we still need to process.
-    ScopedArenaVector<const HBasicBlock*> work_stack(
-        connectedness_temps.Adapter(kArenaAllocReachabilityGraph));
-    // Known max size since otherwise we'd have blocks multiple times. Avoids
-    // re-allocation
-    work_stack.reserve(graph_->GetBlocks().size());
-    discovered.SetBit(target_idx);
-    work_stack.push_back(target_block);
-    // Main DFS Loop.
-    while (!work_stack.empty()) {
-      const HBasicBlock* cur = work_stack.back();
-      work_stack.pop_back();
-      // Memoization of previous runs.
-      if (all_visited_nodes_.IsBitSet(cur->GetBlockId())) {
-        DCHECK_NE(target_block, cur);
-        // Already explored from here. Just use that data.
-        UnionBlock(target_idx, cur->GetBlockId());
-        continue;
-      }
-      for (const HBasicBlock* succ : cur->GetSuccessors()) {
-        AddEdge(target_idx, succ);
-        if (!discovered.IsBitSet(succ->GetBlockId())) {
-          work_stack.push_back(succ);
-          discovered.SetBit(succ->GetBlockId());
-        }
-      }
-    }
-  }
-
-  const HGraph* graph_;
-  // The graph's reachability_graph_ on the main allocator.
-  ArenaBitVectorArray* reachability_graph_;
-  ArenaStack* arena_stack_;
-  // An allocator for temporary bit-vectors used by this algorithm. The
-  // 'SetBit,ClearBit' on reachability_graph_ prior to the construction of this
-  // object should be the only allocation on the main allocator so it's safe to
-  // make a sub-allocator here.
-  ScopedArenaAllocator temporaries_;
-  // number of columns
-  const size_t block_size_;
-  // Where we've already completely calculated connectedness.
-  ArenaBitVector all_visited_nodes_;
-  // What we never visited and need to do later
-  ArenaBitVector not_post_order_visited_;
-
-  DISALLOW_COPY_AND_ASSIGN(ReachabilityAnalysisHelper);
-};
-
-void HGraph::ComputeReachabilityInformation() {
-  DCHECK_EQ(reachability_graph_.GetRawData().NumSetBits(), 0u);
-  DCHECK(reachability_graph_.IsExpandable());
-  // Reserve all the bits we'll need. This is the only allocation on the
-  // standard allocator we do here, enabling us to create a new ScopedArena for
-  // use with temporaries.
-  //
-  // reachability_graph_ acts as |N| x |N| graph for PathBetween. Array is
-  // padded so each row starts on an BitVector::kWordBits-bit alignment for
-  // simplicity and performance, allowing us to union blocks together without
-  // going bit-by-bit.
-  reachability_graph_.Resize(blocks_.size(), blocks_.size(), /*clear=*/false);
-  ReachabilityAnalysisHelper helper(this, &reachability_graph_, GetArenaStack());
-  helper.CalculateReachability();
-}
-
-void HGraph::ClearReachabilityInformation() {
-  reachability_graph_.Clear();
-}
-
 void HGraph::ComputeDominanceInformation() {
   DCHECK(reverse_post_order_.empty());
   reverse_post_order_.reserve(blocks_.size());
@@ -1488,12 +1334,12 @@
                                    const HInstruction* instruction2) const {
   DCHECK_EQ(instruction1->GetBlock(), instruction2->GetBlock());
   for (HInstructionIterator it(*this); !it.Done(); it.Advance()) {
-    if (it.Current() == instruction1) {
-      return true;
-    }
     if (it.Current() == instruction2) {
       return false;
     }
+    if (it.Current() == instruction1) {
+      return true;
+    }
   }
   LOG(FATAL) << "Did not find an order between two instructions of the same block.";
   UNREACHABLE();
@@ -1565,14 +1411,54 @@
 void HInstruction::ReplaceUsesDominatedBy(HInstruction* dominator,
                                           HInstruction* replacement,
                                           bool strictly_dominated) {
+  HBasicBlock* dominator_block = dominator->GetBlock();
+  std::optional<ArenaBitVector> visited_blocks;
+
+  // Lazily compute the dominated blocks to faster calculation of domination afterwards.
+  auto maybe_generate_visited_blocks = [&visited_blocks, this, dominator_block]() {
+    if (visited_blocks.has_value()) {
+      return;
+    }
+    HGraph* graph = GetBlock()->GetGraph();
+    visited_blocks.emplace(graph->GetAllocator(),
+                           graph->GetBlocks().size(),
+                           /* expandable= */ false,
+                           kArenaAllocMisc);
+    visited_blocks->ClearAllBits();
+    ScopedArenaAllocator allocator(graph->GetArenaStack());
+    ScopedArenaQueue<const HBasicBlock*> worklist(allocator.Adapter(kArenaAllocMisc));
+    worklist.push(dominator_block);
+
+    while (!worklist.empty()) {
+      const HBasicBlock* current = worklist.front();
+      worklist.pop();
+      visited_blocks->SetBit(current->GetBlockId());
+      for (HBasicBlock* dominated : current->GetDominatedBlocks()) {
+        if (visited_blocks->IsBitSet(dominated->GetBlockId())) {
+          continue;
+        }
+        worklist.push(dominated);
+      }
+    }
+  };
+
   const HUseList<HInstruction*>& uses = GetUses();
   for (auto it = uses.begin(), end = uses.end(); it != end; /* ++it below */) {
     HInstruction* user = it->GetUser();
+    HBasicBlock* block = user->GetBlock();
     size_t index = it->GetIndex();
     // Increment `it` now because `*it` may disappear thanks to user->ReplaceInput().
     ++it;
-    const bool dominated =
-        strictly_dominated ? dominator->StrictlyDominates(user) : dominator->Dominates(user);
+    bool dominated = false;
+    if (dominator_block == block) {
+      // Trickier case, call the other methods.
+      dominated =
+          strictly_dominated ? dominator->StrictlyDominates(user) : dominator->Dominates(user);
+    } else {
+      // Block domination.
+      maybe_generate_visited_blocks();
+      dominated = visited_blocks->IsBitSet(block->GetBlockId());
+    }
 
     if (dominated) {
       user->ReplaceInput(replacement, index);
@@ -1580,9 +1466,9 @@
       // If the input flows from a block dominated by `dominator`, we can replace it.
       // We do not perform this for catch phis as we don't have control flow support
       // for their inputs.
-      const ArenaVector<HBasicBlock*>& predecessors = user->GetBlock()->GetPredecessors();
-      HBasicBlock* predecessor = predecessors[index];
-      if (dominator->GetBlock()->Dominates(predecessor)) {
+      HBasicBlock* predecessor = block->GetPredecessors()[index];
+      maybe_generate_visited_blocks();
+      if (visited_blocks->IsBitSet(predecessor->GetBlockId())) {
         user->ReplaceInput(replacement, index);
       }
     }
@@ -1807,18 +1693,30 @@
 }
 
 void HGraphVisitor::VisitBasicBlock(HBasicBlock* block) {
+  VisitPhis(block);
+  VisitNonPhiInstructions(block);
+}
+
+void HGraphVisitor::VisitPhis(HBasicBlock* block) {
   for (HInstructionIterator it(block->GetPhis()); !it.Done(); it.Advance()) {
-    it.Current()->Accept(this);
+    DCHECK(it.Current()->IsPhi());
+    VisitPhi(it.Current()->AsPhi());
   }
+}
+
+void HGraphVisitor::VisitNonPhiInstructions(HBasicBlock* block) {
   for (HInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) {
+    DCHECK(!it.Current()->IsPhi());
     it.Current()->Accept(this);
   }
 }
 
-HConstant* HTypeConversion::TryStaticEvaluation() const {
-  HGraph* graph = GetBlock()->GetGraph();
-  if (GetInput()->IsIntConstant()) {
-    int32_t value = GetInput()->AsIntConstant()->GetValue();
+HConstant* HTypeConversion::TryStaticEvaluation() const { return TryStaticEvaluation(GetInput()); }
+
+HConstant* HTypeConversion::TryStaticEvaluation(HInstruction* input) const {
+  HGraph* graph = input->GetBlock()->GetGraph();
+  if (input->IsIntConstant()) {
+    int32_t value = input->AsIntConstant()->GetValue();
     switch (GetResultType()) {
       case DataType::Type::kInt8:
         return graph->GetIntConstant(static_cast<int8_t>(value), GetDexPc());
@@ -1837,8 +1735,8 @@
       default:
         return nullptr;
     }
-  } else if (GetInput()->IsLongConstant()) {
-    int64_t value = GetInput()->AsLongConstant()->GetValue();
+  } else if (input->IsLongConstant()) {
+    int64_t value = input->AsLongConstant()->GetValue();
     switch (GetResultType()) {
       case DataType::Type::kInt8:
         return graph->GetIntConstant(static_cast<int8_t>(value), GetDexPc());
@@ -1857,8 +1755,8 @@
       default:
         return nullptr;
     }
-  } else if (GetInput()->IsFloatConstant()) {
-    float value = GetInput()->AsFloatConstant()->GetValue();
+  } else if (input->IsFloatConstant()) {
+    float value = input->AsFloatConstant()->GetValue();
     switch (GetResultType()) {
       case DataType::Type::kInt32:
         if (std::isnan(value))
@@ -1881,8 +1779,8 @@
       default:
         return nullptr;
     }
-  } else if (GetInput()->IsDoubleConstant()) {
-    double value = GetInput()->AsDoubleConstant()->GetValue();
+  } else if (input->IsDoubleConstant()) {
+    double value = input->AsDoubleConstant()->GetValue();
     switch (GetResultType()) {
       case DataType::Type::kInt32:
         if (std::isnan(value))
@@ -1909,41 +1807,47 @@
   return nullptr;
 }
 
-HConstant* HUnaryOperation::TryStaticEvaluation() const {
-  if (GetInput()->IsIntConstant()) {
-    return Evaluate(GetInput()->AsIntConstant());
-  } else if (GetInput()->IsLongConstant()) {
-    return Evaluate(GetInput()->AsLongConstant());
+HConstant* HUnaryOperation::TryStaticEvaluation() const { return TryStaticEvaluation(GetInput()); }
+
+HConstant* HUnaryOperation::TryStaticEvaluation(HInstruction* input) const {
+  if (input->IsIntConstant()) {
+    return Evaluate(input->AsIntConstant());
+  } else if (input->IsLongConstant()) {
+    return Evaluate(input->AsLongConstant());
   } else if (kEnableFloatingPointStaticEvaluation) {
-    if (GetInput()->IsFloatConstant()) {
-      return Evaluate(GetInput()->AsFloatConstant());
-    } else if (GetInput()->IsDoubleConstant()) {
-      return Evaluate(GetInput()->AsDoubleConstant());
+    if (input->IsFloatConstant()) {
+      return Evaluate(input->AsFloatConstant());
+    } else if (input->IsDoubleConstant()) {
+      return Evaluate(input->AsDoubleConstant());
     }
   }
   return nullptr;
 }
 
 HConstant* HBinaryOperation::TryStaticEvaluation() const {
-  if (GetLeft()->IsIntConstant() && GetRight()->IsIntConstant()) {
-    return Evaluate(GetLeft()->AsIntConstant(), GetRight()->AsIntConstant());
-  } else if (GetLeft()->IsLongConstant()) {
-    if (GetRight()->IsIntConstant()) {
+  return TryStaticEvaluation(GetLeft(), GetRight());
+}
+
+HConstant* HBinaryOperation::TryStaticEvaluation(HInstruction* left, HInstruction* right) const {
+  if (left->IsIntConstant() && right->IsIntConstant()) {
+    return Evaluate(left->AsIntConstant(), right->AsIntConstant());
+  } else if (left->IsLongConstant()) {
+    if (right->IsIntConstant()) {
       // The binop(long, int) case is only valid for shifts and rotations.
       DCHECK(IsShl() || IsShr() || IsUShr() || IsRor()) << DebugName();
-      return Evaluate(GetLeft()->AsLongConstant(), GetRight()->AsIntConstant());
-    } else if (GetRight()->IsLongConstant()) {
-      return Evaluate(GetLeft()->AsLongConstant(), GetRight()->AsLongConstant());
+      return Evaluate(left->AsLongConstant(), right->AsIntConstant());
+    } else if (right->IsLongConstant()) {
+      return Evaluate(left->AsLongConstant(), right->AsLongConstant());
     }
-  } else if (GetLeft()->IsNullConstant() && GetRight()->IsNullConstant()) {
+  } else if (left->IsNullConstant() && right->IsNullConstant()) {
     // The binop(null, null) case is only valid for equal and not-equal conditions.
     DCHECK(IsEqual() || IsNotEqual()) << DebugName();
-    return Evaluate(GetLeft()->AsNullConstant(), GetRight()->AsNullConstant());
+    return Evaluate(left->AsNullConstant(), right->AsNullConstant());
   } else if (kEnableFloatingPointStaticEvaluation) {
-    if (GetLeft()->IsFloatConstant() && GetRight()->IsFloatConstant()) {
-      return Evaluate(GetLeft()->AsFloatConstant(), GetRight()->AsFloatConstant());
-    } else if (GetLeft()->IsDoubleConstant() && GetRight()->IsDoubleConstant()) {
-      return Evaluate(GetLeft()->AsDoubleConstant(), GetRight()->AsDoubleConstant());
+    if (left->IsFloatConstant() && right->IsFloatConstant()) {
+      return Evaluate(left->AsFloatConstant(), right->AsFloatConstant());
+    } else if (left->IsDoubleConstant() && right->IsDoubleConstant()) {
+      return Evaluate(left->AsDoubleConstant(), right->AsDoubleConstant());
     }
   }
   return nullptr;
@@ -2797,8 +2701,11 @@
   if (HasMonitorOperations()) {
     outer_graph->SetHasMonitorOperations(true);
   }
-  if (HasSIMD()) {
-    outer_graph->SetHasSIMD(true);
+  if (HasTraditionalSIMD()) {
+    outer_graph->SetHasTraditionalSIMD(true);
+  }
+  if (HasPredicatedSIMD()) {
+    outer_graph->SetHasPredicatedSIMD(true);
   }
   if (HasAlwaysThrowingInvokes()) {
     outer_graph->SetHasAlwaysThrowingInvokes(true);
@@ -2989,12 +2896,7 @@
       }
     }
     if (rerun_loop_analysis) {
-      DCHECK(!outer_graph->HasIrreducibleLoops())
-          << "Recomputing loop information in graphs with irreducible loops "
-          << "is unsupported, as it could lead to loop header changes";
-      outer_graph->ClearLoopInformation();
-      outer_graph->ClearDominanceInformation();
-      outer_graph->BuildDominatorTree();
+      outer_graph->RecomputeDominatorTree();
     } else if (rerun_dominance) {
       outer_graph->ClearDominanceInformation();
       outer_graph->ComputeDominanceInformation();
@@ -3026,9 +2928,9 @@
       replacement = outer_graph->GetDoubleConstant(
           current->AsDoubleConstant()->GetValue(), current->GetDexPc());
     } else if (current->IsParameterValue()) {
-      if (kIsDebugBuild
-          && invoke->IsInvokeStaticOrDirect()
-          && invoke->AsInvokeStaticOrDirect()->IsStaticWithExplicitClinitCheck()) {
+      if (kIsDebugBuild &&
+          invoke->IsInvokeStaticOrDirect() &&
+          invoke->AsInvokeStaticOrDirect()->IsStaticWithExplicitClinitCheck()) {
         // Ensure we do not use the last input of `invoke`, as it
         // contains a clinit check which is not an actual argument.
         size_t last_input_index = invoke->InputCount() - 1;
@@ -3125,6 +3027,8 @@
       new_pre_header, old_pre_header, /* replace_if_back_edge= */ false);
 }
 
+// Creates a new two-basic-block loop and inserts it between original loop header and
+// original loop exit; also adjusts dominators, post order and new LoopInformation.
 HBasicBlock* HGraph::TransformLoopForVectorization(HBasicBlock* header,
                                                    HBasicBlock* body,
                                                    HBasicBlock* exit) {
@@ -3346,6 +3250,21 @@
   }
 }
 
+bool HInvokeStaticOrDirect::CanBeNull() const {
+  if (GetType() != DataType::Type::kReference || IsStringInit()) {
+    return false;
+  }
+  switch (GetIntrinsic()) {
+#define DEFINE_BOXED_CASE(name, unused1, unused2, unused3, unused4) \
+    case Intrinsics::k##name##ValueOf: \
+      return false;
+    BOXED_TYPES(DEFINE_BOXED_CASE)
+#undef DEFINE_BOXED_CASE
+    default:
+      return true;
+  }
+}
+
 bool HInvokeVirtual::CanDoImplicitNullCheckOn(HInstruction* obj) const {
   if (obj != InputAt(0)) {
     return false;
@@ -3518,9 +3437,7 @@
   static_assert( \
     static_cast<uint32_t>(Intrinsics::k ## Name) <= (kAccIntrinsicBits >> CTZ(kAccIntrinsicBits)), \
     "Instrinsics enumeration space overflow.");
-#include "intrinsics_list.h"
-  INTRINSICS_LIST(CHECK_INTRINSICS_ENUM_VALUES)
-#undef INTRINSICS_LIST
+  ART_INTRINSICS_LIST(CHECK_INTRINSICS_ENUM_VALUES)
 #undef CHECK_INTRINSICS_ENUM_VALUES
 
 // Function that returns whether an intrinsic needs an environment or not.
@@ -3531,9 +3448,7 @@
 #define OPTIMIZING_INTRINSICS(Name, InvokeType, NeedsEnv, SideEffects, Exceptions, ...) \
     case Intrinsics::k ## Name: \
       return NeedsEnv;
-#include "intrinsics_list.h"
-      INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
-#undef INTRINSICS_LIST
+      ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
 #undef OPTIMIZING_INTRINSICS
   }
   return kNeedsEnvironment;
@@ -3547,9 +3462,7 @@
 #define OPTIMIZING_INTRINSICS(Name, InvokeType, NeedsEnv, SideEffects, Exceptions, ...) \
     case Intrinsics::k ## Name: \
       return SideEffects;
-#include "intrinsics_list.h"
-      INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
-#undef INTRINSICS_LIST
+      ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
 #undef OPTIMIZING_INTRINSICS
   }
   return kAllSideEffects;
@@ -3563,9 +3476,7 @@
 #define OPTIMIZING_INTRINSICS(Name, InvokeType, NeedsEnv, SideEffects, Exceptions, ...) \
     case Intrinsics::k ## Name: \
       return Exceptions;
-#include "intrinsics_list.h"
-      INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
-#undef INTRINSICS_LIST
+      ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
 #undef OPTIMIZING_INTRINSICS
   }
   return kCanThrow;
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 28112d1..4d6b909 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -253,7 +253,7 @@
 
   bool IsNonPrimitiveArrayClass() const REQUIRES_SHARED(Locks::mutator_lock_) {
     DCHECK(IsValid());
-    return GetTypeHandle()->IsArrayClass() && !GetTypeHandle()->IsPrimitiveArray();
+    return IsArrayClass() && !GetTypeHandle()->IsPrimitiveArray();
   }
 
   bool CanArrayHold(ReferenceTypeInfo rti)  const REQUIRES_SHARED(Locks::mutator_lock_) {
@@ -393,7 +393,6 @@
         blocks_(allocator->Adapter(kArenaAllocBlockList)),
         reverse_post_order_(allocator->Adapter(kArenaAllocReversePostOrder)),
         linear_order_(allocator->Adapter(kArenaAllocLinearOrder)),
-        reachability_graph_(allocator, 0, 0, true, kArenaAllocReachabilityGraph),
         entry_block_(nullptr),
         exit_block_(nullptr),
         maximum_number_of_out_vregs_(0),
@@ -403,7 +402,8 @@
         has_bounds_checks_(false),
         has_try_catch_(false),
         has_monitor_operations_(false),
-        has_simd_(false),
+        has_traditional_simd_(false),
+        has_predicated_simd_(false),
         has_loops_(false),
         has_irreducible_loops_(false),
         has_direct_critical_native_call_(false),
@@ -425,6 +425,7 @@
         cached_current_method_(nullptr),
         art_method_(nullptr),
         compilation_kind_(compilation_kind),
+        useful_optimizing_(false),
         cha_single_implementation_list_(allocator->Adapter(kArenaAllocCHA)) {
     blocks_.reserve(kDefaultNumberOfBlocks);
   }
@@ -461,11 +462,10 @@
 
   void ComputeDominanceInformation();
   void ClearDominanceInformation();
-  void ComputeReachabilityInformation();
-  void ClearReachabilityInformation();
   void ClearLoopInformation();
   void FindBackEdges(ArenaBitVector* visited);
   GraphAnalysisResult BuildDominatorTree();
+  GraphAnalysisResult RecomputeDominatorTree();
   void SimplifyCFG();
   void SimplifyCatchBlocks();
 
@@ -618,10 +618,6 @@
     has_bounds_checks_ = value;
   }
 
-  // Returns true if dest is reachable from source, using either blocks or block-ids.
-  bool PathBetween(const HBasicBlock* source, const HBasicBlock* dest) const;
-  bool PathBetween(uint32_t source_id, uint32_t dest_id) const;
-
   // Is the code known to be robust against eliminating dead references
   // and the effects of early finalization?
   bool IsDeadReferenceSafe() const { return dead_reference_safe_; }
@@ -708,8 +704,13 @@
   bool HasMonitorOperations() const { return has_monitor_operations_; }
   void SetHasMonitorOperations(bool value) { has_monitor_operations_ = value; }
 
-  bool HasSIMD() const { return has_simd_; }
-  void SetHasSIMD(bool value) { has_simd_ = value; }
+  bool HasTraditionalSIMD() { return has_traditional_simd_; }
+  void SetHasTraditionalSIMD(bool value) { has_traditional_simd_ = value; }
+
+  bool HasPredicatedSIMD() { return has_predicated_simd_; }
+  void SetHasPredicatedSIMD(bool value) { has_predicated_simd_ = value; }
+
+  bool HasSIMD() const { return has_traditional_simd_ || has_predicated_simd_; }
 
   bool HasLoops() const { return has_loops_; }
   void SetHasLoops(bool value) { has_loops_ = value; }
@@ -742,6 +743,9 @@
   void SetNumberOfCHAGuards(uint32_t num) { number_of_cha_guards_ = num; }
   void IncrementNumberOfCHAGuards() { number_of_cha_guards_++; }
 
+  void SetUsefulOptimizing() { useful_optimizing_ = true; }
+  bool IsUsefulOptimizing() const { return useful_optimizing_; }
+
  private:
   void RemoveDeadBlocksInstructionsAsUsersAndDisconnect(const ArenaBitVector& visited) const;
   void RemoveDeadBlocks(const ArenaBitVector& visited);
@@ -791,10 +795,6 @@
   // post order, this order is not incrementally kept up-to-date.
   ArenaVector<HBasicBlock*> linear_order_;
 
-  // Reachability graph for checking connectedness between nodes. Acts as a partitioned vector where
-  // each RoundUp(blocks_.size(), BitVector::kWordBits) is the reachability of each node.
-  ArenaBitVectorArray reachability_graph_;
-
   HBasicBlock* entry_block_;
   HBasicBlock* exit_block_;
 
@@ -822,10 +822,11 @@
   // DexRegisterMap to be present to allow deadlock analysis for non-debuggable code.
   bool has_monitor_operations_;
 
-  // Flag whether SIMD instructions appear in the graph. If true, the
-  // code generators may have to be more careful spilling the wider
+  // Flags whether SIMD (traditional or predicated) instructions appear in the graph.
+  // If either is true, the code generators may have to be more careful spilling the wider
   // contents of SIMD registers.
-  bool has_simd_;
+  bool has_traditional_simd_;
+  bool has_predicated_simd_;
 
   // Flag whether there are any loops in the graph. We can skip loop
   // optimization if it's false.
@@ -900,6 +901,10 @@
   // directly jump to.
   const CompilationKind compilation_kind_;
 
+  // Whether after compiling baseline it is still useful re-optimizing this
+  // method.
+  bool useful_optimizing_;
+
   // List of methods that are assumed to have single implementation.
   ArenaSet<ArtMethod*> cha_single_implementation_list_;
 
@@ -1544,7 +1549,6 @@
   M(If, Instruction)                                                    \
   M(InstanceFieldGet, Instruction)                                      \
   M(InstanceFieldSet, Instruction)                                      \
-  M(PredicatedInstanceFieldGet, Instruction)                            \
   M(InstanceOf, Instruction)                                            \
   M(IntConstant, Constant)                                              \
   M(IntermediateAddress, Instruction)                                   \
@@ -1636,7 +1640,9 @@
   M(VecStore, VecMemoryOperation)                                       \
   M(VecPredSetAll, VecPredSetOperation)                                 \
   M(VecPredWhile, VecPredSetOperation)                                  \
-  M(VecPredCondition, VecOperation)                                     \
+  M(VecPredToBoolean, VecOperation)                                     \
+  M(VecCondition, VecPredSetOperation)                                  \
+  M(VecPredNot, VecPredSetOperation)                                    \
 
 #define FOR_EACH_CONCRETE_INSTRUCTION_COMMON(M)                         \
   FOR_EACH_CONCRETE_INSTRUCTION_SCALAR_COMMON(M)                        \
@@ -1659,6 +1665,8 @@
 
 #define FOR_EACH_CONCRETE_INSTRUCTION_ARM64(M)
 
+#define FOR_EACH_CONCRETE_INSTRUCTION_RISCV64(M)
+
 #ifndef ART_ENABLE_CODEGEN_x86
 #define FOR_EACH_CONCRETE_INSTRUCTION_X86(M)
 #else
@@ -1715,7 +1723,7 @@
   const char* DebugName() const override { return #type; }                \
   HInstruction* Clone(ArenaAllocator* arena) const override {             \
     DCHECK(IsClonable());                                                 \
-    return new (arena) H##type(*this->As##type());                        \
+    return new (arena) H##type(*this);                                    \
   }                                                                       \
   void Accept(HGraphVisitor* visitor) override
 
@@ -2062,12 +2070,12 @@
                              ArtMethod* method,
                              uint32_t dex_pc,
                              HInstruction* holder)
-     : vregs_(number_of_vregs, allocator->Adapter(kArenaAllocEnvironmentVRegs)),
-       locations_(allocator->Adapter(kArenaAllocEnvironmentLocations)),
-       parent_(nullptr),
-       method_(method),
-       dex_pc_(dex_pc),
-       holder_(holder) {
+      : vregs_(number_of_vregs, allocator->Adapter(kArenaAllocEnvironmentVRegs)),
+        locations_(allocator->Adapter(kArenaAllocEnvironmentLocations)),
+        parent_(nullptr),
+        method_(method),
+        dex_pc_(dex_pc),
+        holder_(holder) {
   }
 
   ALWAYS_INLINE HEnvironment(ArenaAllocator* allocator,
@@ -2183,9 +2191,14 @@
 std::ostream& operator<<(std::ostream& os, const HInstruction& rhs);
 
 // Iterates over the Environments
-class HEnvironmentIterator : public ValueObject,
-                             public std::iterator<std::forward_iterator_tag, HEnvironment*> {
+class HEnvironmentIterator : public ValueObject {
  public:
+  using iterator_category = std::forward_iterator_tag;
+  using value_type = HEnvironment*;
+  using difference_type = ptrdiff_t;
+  using pointer = void;
+  using reference = void;
+
   explicit HEnvironmentIterator(HEnvironment* cur) : cur_(cur) {}
 
   HEnvironment* operator*() const {
@@ -2355,9 +2368,7 @@
     return true;
   }
 
-  virtual bool CanDoImplicitNullCheckOn(HInstruction* obj ATTRIBUTE_UNUSED) const {
-    return false;
-  }
+  virtual bool CanDoImplicitNullCheckOn([[maybe_unused]] HInstruction* obj) const { return false; }
 
   // If this instruction will do an implicit null check, return the `HNullCheck` associated
   // with it. Otherwise return null.
@@ -2437,18 +2448,26 @@
   bool IsRemovable() const {
     return
         !DoesAnyWrite() &&
-        !CanThrow() &&
+        // TODO(solanes): Merge calls from IsSuspendCheck to IsControlFlow into one that doesn't
+        // do virtual dispatching.
         !IsSuspendCheck() &&
-        !IsControlFlow() &&
         !IsNop() &&
         !IsParameterValue() &&
         // If we added an explicit barrier then we should keep it.
         !IsMemoryBarrier() &&
-        !IsConstructorFence();
+        !IsConstructorFence() &&
+        !IsControlFlow() &&
+        !CanThrow();
   }
 
   bool IsDeadAndRemovable() const {
-    return IsRemovable() && !HasUses();
+    return !HasUses() && IsRemovable();
+  }
+
+  bool IsPhiDeadAndRemovable() const {
+    DCHECK(IsPhi());
+    DCHECK(IsRemovable()) << " phis are always removable";
+    return !HasUses();
   }
 
   // Does this instruction dominate `other_instruction`?
@@ -2553,7 +2572,9 @@
 
 #define INSTRUCTION_TYPE_CAST(type, super)                                     \
   const H##type* As##type() const;                                             \
-  H##type* As##type();
+  H##type* As##type();                                                         \
+  const H##type* As##type##OrNull() const;                                     \
+  H##type* As##type##OrNull();
 
   FOR_EACH_INSTRUCTION(INSTRUCTION_TYPE_CAST)
 #undef INSTRUCTION_TYPE_CAST
@@ -2568,7 +2589,7 @@
   //
   // Note: HEnvironment and some other fields are not copied and are set to default values, see
   // 'explicit HInstruction(const HInstruction& other)' for details.
-  virtual HInstruction* Clone(ArenaAllocator* arena ATTRIBUTE_UNUSED) const {
+  virtual HInstruction* Clone([[maybe_unused]] ArenaAllocator* arena) const {
     LOG(FATAL) << "Cloning is not implemented for the instruction " <<
                   DebugName() << " " << GetId();
     UNREACHABLE();
@@ -2596,7 +2617,7 @@
   // Returns whether any data encoded in the two instructions is equal.
   // This method does not look at the inputs. Both instructions must be
   // of the same type, otherwise the method has undefined behavior.
-  virtual bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const {
+  virtual bool InstructionDataEquals([[maybe_unused]] const HInstruction* other) const {
     return false;
   }
 
@@ -2729,7 +2750,7 @@
 
  private:
   using InstructionKindField =
-     BitField<InstructionKind, kFieldInstructionKind, kFieldInstructionKindSize>;
+      BitField<InstructionKind, kFieldInstructionKind, kFieldInstructionKindSize>;
 
   void FixUpUserRecordsAfterUseInsertion(HUseList<HInstruction*>::iterator fixup_end) {
     auto before_use_node = uses_.before_begin();
@@ -2887,6 +2908,10 @@
     next_ = Done() ? nullptr : instruction_->GetPrevious();
   }
 
+  explicit HBackwardInstructionIterator(HInstruction* instruction) : instruction_(instruction) {
+    next_ = Done() ? nullptr : instruction_->GetPrevious();
+  }
+
   bool Done() const { return instruction_ == nullptr; }
   HInstruction* Current() const { return instruction_; }
   void Advance() {
@@ -2904,9 +2929,14 @@
 };
 
 template <typename InnerIter>
-struct HSTLInstructionIterator : public ValueObject,
-                                 public std::iterator<std::forward_iterator_tag, HInstruction*> {
+struct HSTLInstructionIterator : public ValueObject {
  public:
+  using iterator_category = std::forward_iterator_tag;
+  using value_type = HInstruction*;
+  using difference_type = ptrdiff_t;
+  using pointer = void;
+  using reference = void;
+
   static_assert(std::is_same_v<InnerIter, HBackwardInstructionIterator> ||
                     std::is_same_v<InnerIter, HInstructionIterator> ||
                     std::is_same_v<InnerIter, HInstructionIteratorHandleChanges>,
@@ -3164,7 +3194,7 @@
   bool IsVRegEquivalentOf(const HInstruction* other) const {
     return other != nullptr
         && other->IsPhi()
-        && other->AsPhi()->GetBlock() == GetBlock()
+        && other->GetBlock() == GetBlock()
         && other->AsPhi()->GetRegNumber() == GetRegNumber();
   }
 
@@ -3270,7 +3300,7 @@
 
 class HNullConstant final : public HConstant {
  public:
-  bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const override {
+  bool InstructionDataEquals([[maybe_unused]] const HInstruction* other) const override {
     return true;
   }
 
@@ -3497,7 +3527,9 @@
 class HIf final : public HExpression<1> {
  public:
   explicit HIf(HInstruction* input, uint32_t dex_pc = kNoDexPc)
-      : HExpression(kIf, SideEffects::None(), dex_pc) {
+      : HExpression(kIf, SideEffects::None(), dex_pc),
+        true_count_(std::numeric_limits<uint16_t>::max()),
+        false_count_(std::numeric_limits<uint16_t>::max()) {
     SetRawInputAt(0, input);
   }
 
@@ -3512,10 +3544,20 @@
     return GetBlock()->GetSuccessors()[1];
   }
 
+  void SetTrueCount(uint16_t count) { true_count_ = count; }
+  uint16_t GetTrueCount() const { return true_count_; }
+
+  void SetFalseCount(uint16_t count) { false_count_ = count; }
+  uint16_t GetFalseCount() const { return false_count_; }
+
   DECLARE_INSTRUCTION(If);
 
  protected:
   DEFAULT_COPY_CONSTRUCTOR(If);
+
+ private:
+  uint16_t true_count_;
+  uint16_t false_count_;
 };
 
 
@@ -3639,7 +3681,8 @@
   bool CanBeMoved() const override { return GetPackedFlag<kFieldCanBeMoved>(); }
 
   bool InstructionDataEquals(const HInstruction* other) const override {
-    return (other->CanBeMoved() == CanBeMoved()) && (other->AsDeoptimize()->GetKind() == GetKind());
+    return (other->CanBeMoved() == CanBeMoved()) &&
+           (other->AsDeoptimize()->GetDeoptimizationKind() == GetDeoptimizationKind());
   }
 
   bool NeedsEnvironment() const override { return true; }
@@ -3827,7 +3870,7 @@
   DataType::Type GetResultType() const { return GetType(); }
 
   bool CanBeMoved() const override { return true; }
-  bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const override {
+  bool InstructionDataEquals([[maybe_unused]] const HInstruction* other) const override {
     return true;
   }
 
@@ -3836,6 +3879,9 @@
   // be evaluated as a constant, return null.
   HConstant* TryStaticEvaluation() const;
 
+  // Same but for `input` instead of GetInput().
+  HConstant* TryStaticEvaluation(HInstruction* input) const;
+
   // Apply this operation to `x`.
   virtual HConstant* Evaluate(HIntConstant* x) const = 0;
   virtual HConstant* Evaluate(HLongConstant* x) const = 0;
@@ -3903,7 +3949,7 @@
   }
 
   bool CanBeMoved() const override { return true; }
-  bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const override {
+  bool InstructionDataEquals([[maybe_unused]] const HInstruction* other) const override {
     return true;
   }
 
@@ -3912,16 +3958,19 @@
   // be evaluated as a constant, return null.
   HConstant* TryStaticEvaluation() const;
 
+  // Same but for `left` and `right` instead of GetLeft() and GetRight().
+  HConstant* TryStaticEvaluation(HInstruction* left, HInstruction* right) const;
+
   // Apply this operation to `x` and `y`.
-  virtual HConstant* Evaluate(HNullConstant* x ATTRIBUTE_UNUSED,
-                              HNullConstant* y ATTRIBUTE_UNUSED) const {
+  virtual HConstant* Evaluate([[maybe_unused]] HNullConstant* x,
+                              [[maybe_unused]] HNullConstant* y) const {
     LOG(FATAL) << DebugName() << " is not defined for the (null, null) case.";
     UNREACHABLE();
   }
   virtual HConstant* Evaluate(HIntConstant* x, HIntConstant* y) const = 0;
   virtual HConstant* Evaluate(HLongConstant* x, HLongConstant* y) const = 0;
-  virtual HConstant* Evaluate(HLongConstant* x ATTRIBUTE_UNUSED,
-                              HIntConstant* y ATTRIBUTE_UNUSED) const {
+  virtual HConstant* Evaluate([[maybe_unused]] HLongConstant* x,
+                              [[maybe_unused]] HIntConstant* y) const {
     LOG(FATAL) << DebugName() << " is not defined for the (long, int) case.";
     UNREACHABLE();
   }
@@ -4049,8 +4098,8 @@
 
   bool IsCommutative() const override { return true; }
 
-  HConstant* Evaluate(HNullConstant* x ATTRIBUTE_UNUSED,
-                      HNullConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HNullConstant* x,
+                      [[maybe_unused]] HNullConstant* y) const override {
     return MakeConstantCondition(true, GetDexPc());
   }
   HConstant* Evaluate(HIntConstant* x, HIntConstant* y) const override {
@@ -4096,8 +4145,8 @@
 
   bool IsCommutative() const override { return true; }
 
-  HConstant* Evaluate(HNullConstant* x ATTRIBUTE_UNUSED,
-                      HNullConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HNullConstant* x,
+                      [[maybe_unused]] HNullConstant* y) const override {
     return MakeConstantCondition(false, GetDexPc());
   }
   HConstant* Evaluate(HIntConstant* x, HIntConstant* y) const override {
@@ -4303,13 +4352,13 @@
   HConstant* Evaluate(HLongConstant* x, HLongConstant* y) const override {
     return MakeConstantCondition(Compute(x->GetValue(), y->GetValue()), GetDexPc());
   }
-  HConstant* Evaluate(HFloatConstant* x ATTRIBUTE_UNUSED,
-                      HFloatConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* x,
+                      [[maybe_unused]] HFloatConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for float values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HDoubleConstant* x ATTRIBUTE_UNUSED,
-                      HDoubleConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* x,
+                      [[maybe_unused]] HDoubleConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for double values";
     UNREACHABLE();
   }
@@ -4345,13 +4394,13 @@
   HConstant* Evaluate(HLongConstant* x, HLongConstant* y) const override {
     return MakeConstantCondition(Compute(x->GetValue(), y->GetValue()), GetDexPc());
   }
-  HConstant* Evaluate(HFloatConstant* x ATTRIBUTE_UNUSED,
-                      HFloatConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* x,
+                      [[maybe_unused]] HFloatConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for float values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HDoubleConstant* x ATTRIBUTE_UNUSED,
-                      HDoubleConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* x,
+                      [[maybe_unused]] HDoubleConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for double values";
     UNREACHABLE();
   }
@@ -4387,13 +4436,13 @@
   HConstant* Evaluate(HLongConstant* x, HLongConstant* y) const override {
     return MakeConstantCondition(Compute(x->GetValue(), y->GetValue()), GetDexPc());
   }
-  HConstant* Evaluate(HFloatConstant* x ATTRIBUTE_UNUSED,
-                      HFloatConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* x,
+                      [[maybe_unused]] HFloatConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for float values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HDoubleConstant* x ATTRIBUTE_UNUSED,
-                      HDoubleConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* x,
+                      [[maybe_unused]] HDoubleConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for double values";
     UNREACHABLE();
   }
@@ -4429,13 +4478,13 @@
   HConstant* Evaluate(HLongConstant* x, HLongConstant* y) const override {
     return MakeConstantCondition(Compute(x->GetValue(), y->GetValue()), GetDexPc());
   }
-  HConstant* Evaluate(HFloatConstant* x ATTRIBUTE_UNUSED,
-                      HFloatConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* x,
+                      [[maybe_unused]] HFloatConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for float values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HDoubleConstant* x ATTRIBUTE_UNUSED,
-                      HDoubleConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* x,
+                      [[maybe_unused]] HDoubleConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for double values";
     UNREACHABLE();
   }
@@ -4522,7 +4571,7 @@
     return GetBias() == ComparisonBias::kGtBias;
   }
 
-  static SideEffects SideEffectsForArchRuntimeCalls(DataType::Type type ATTRIBUTE_UNUSED) {
+  static SideEffects SideEffectsForArchRuntimeCalls([[maybe_unused]] DataType::Type type) {
     // Comparisons do not require a runtime call in any back end.
     return SideEffects::None();
   }
@@ -4859,8 +4908,7 @@
                      // to pass intrinsic information to the HInvokePolymorphic node.
                      ArtMethod* resolved_method,
                      MethodReference resolved_method_reference,
-                     dex::ProtoIndex proto_idx,
-                     bool enable_intrinsic_opt)
+                     dex::ProtoIndex proto_idx)
       : HInvoke(kInvokePolymorphic,
                 allocator,
                 number_of_arguments,
@@ -4871,9 +4919,8 @@
                 resolved_method,
                 resolved_method_reference,
                 kPolymorphic,
-                enable_intrinsic_opt),
-        proto_idx_(proto_idx) {
-  }
+                /* enable_intrinsic_opt= */ true),
+        proto_idx_(proto_idx) {}
 
   bool IsClonable() const override { return true; }
 
@@ -5015,15 +5062,13 @@
     return input_records;
   }
 
-  bool CanDoImplicitNullCheckOn(HInstruction* obj ATTRIBUTE_UNUSED) const override {
+  bool CanDoImplicitNullCheckOn([[maybe_unused]] HInstruction* obj) const override {
     // We do not access the method via object reference, so we cannot do an implicit null check.
     // TODO: for intrinsics we can generate implicit null checks.
     return false;
   }
 
-  bool CanBeNull() const override {
-    return GetType() == DataType::Type::kReference && !IsStringInit();
-  }
+  bool CanBeNull() const override;
 
   MethodLoadKind GetMethodLoadKind() const { return dispatch_info_.method_load_kind; }
   CodePtrLocation GetCodePtrLocation() const {
@@ -5599,10 +5644,14 @@
         ComputeIntegral(x->GetValue(), y->GetValue()), GetDexPc());
   }
   // TODO: Evaluation for floating-point values.
-  HConstant* Evaluate(HFloatConstant* x ATTRIBUTE_UNUSED,
-                      HFloatConstant* y ATTRIBUTE_UNUSED) const override { return nullptr; }
-  HConstant* Evaluate(HDoubleConstant* x ATTRIBUTE_UNUSED,
-                      HDoubleConstant* y ATTRIBUTE_UNUSED) const override { return nullptr; }
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* x,
+                      [[maybe_unused]] HFloatConstant* y) const override {
+    return nullptr;
+  }
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* x,
+                      [[maybe_unused]] HDoubleConstant* y) const override {
+    return nullptr;
+  }
 
   DECLARE_INSTRUCTION(Min);
 
@@ -5634,10 +5683,14 @@
         ComputeIntegral(x->GetValue(), y->GetValue()), GetDexPc());
   }
   // TODO: Evaluation for floating-point values.
-  HConstant* Evaluate(HFloatConstant* x ATTRIBUTE_UNUSED,
-                      HFloatConstant* y ATTRIBUTE_UNUSED) const override { return nullptr; }
-  HConstant* Evaluate(HDoubleConstant* x ATTRIBUTE_UNUSED,
-                      HDoubleConstant* y ATTRIBUTE_UNUSED) const override { return nullptr; }
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* x,
+                      [[maybe_unused]] HFloatConstant* y) const override {
+    return nullptr;
+  }
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* x,
+                      [[maybe_unused]] HDoubleConstant* y) const override {
+    return nullptr;
+  }
 
   DECLARE_INSTRUCTION(Max);
 
@@ -5699,7 +5752,7 @@
   bool IsClonable() const override { return true; }
   bool CanBeMoved() const override { return true; }
 
-  bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const override {
+  bool InstructionDataEquals([[maybe_unused]] const HInstruction* other) const override {
     return true;
   }
 
@@ -5736,18 +5789,18 @@
     return GetBlock()->GetGraph()->GetLongConstant(
         Compute(value->GetValue(), distance->GetValue(), kMaxLongShiftDistance), GetDexPc());
   }
-  HConstant* Evaluate(HLongConstant* value ATTRIBUTE_UNUSED,
-                      HLongConstant* distance ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HLongConstant* value,
+                      [[maybe_unused]] HLongConstant* distance) const override {
     LOG(FATAL) << DebugName() << " is not defined for the (long, long) case.";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HFloatConstant* value ATTRIBUTE_UNUSED,
-                      HFloatConstant* distance ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* value,
+                      [[maybe_unused]] HFloatConstant* distance) const override {
     LOG(FATAL) << DebugName() << " is not defined for float values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HDoubleConstant* value ATTRIBUTE_UNUSED,
-                      HDoubleConstant* distance ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* value,
+                      [[maybe_unused]] HDoubleConstant* distance) const override {
     LOG(FATAL) << DebugName() << " is not defined for double values";
     UNREACHABLE();
   }
@@ -5782,18 +5835,18 @@
     return GetBlock()->GetGraph()->GetLongConstant(
         Compute(value->GetValue(), distance->GetValue(), kMaxLongShiftDistance), GetDexPc());
   }
-  HConstant* Evaluate(HLongConstant* value ATTRIBUTE_UNUSED,
-                      HLongConstant* distance ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HLongConstant* value,
+                      [[maybe_unused]] HLongConstant* distance) const override {
     LOG(FATAL) << DebugName() << " is not defined for the (long, long) case.";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HFloatConstant* value ATTRIBUTE_UNUSED,
-                      HFloatConstant* distance ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* value,
+                      [[maybe_unused]] HFloatConstant* distance) const override {
     LOG(FATAL) << DebugName() << " is not defined for float values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HDoubleConstant* value ATTRIBUTE_UNUSED,
-                      HDoubleConstant* distance ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* value,
+                      [[maybe_unused]] HDoubleConstant* distance) const override {
     LOG(FATAL) << DebugName() << " is not defined for double values";
     UNREACHABLE();
   }
@@ -5830,18 +5883,18 @@
     return GetBlock()->GetGraph()->GetLongConstant(
         Compute(value->GetValue(), distance->GetValue(), kMaxLongShiftDistance), GetDexPc());
   }
-  HConstant* Evaluate(HLongConstant* value ATTRIBUTE_UNUSED,
-                      HLongConstant* distance ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HLongConstant* value,
+                      [[maybe_unused]] HLongConstant* distance) const override {
     LOG(FATAL) << DebugName() << " is not defined for the (long, long) case.";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HFloatConstant* value ATTRIBUTE_UNUSED,
-                      HFloatConstant* distance ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* value,
+                      [[maybe_unused]] HFloatConstant* distance) const override {
     LOG(FATAL) << DebugName() << " is not defined for float values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HDoubleConstant* value ATTRIBUTE_UNUSED,
-                      HDoubleConstant* distance ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* value,
+                      [[maybe_unused]] HDoubleConstant* distance) const override {
     LOG(FATAL) << DebugName() << " is not defined for double values";
     UNREACHABLE();
   }
@@ -5873,13 +5926,13 @@
     return GetBlock()->GetGraph()->GetLongConstant(
         Compute(x->GetValue(), y->GetValue()), GetDexPc());
   }
-  HConstant* Evaluate(HFloatConstant* x ATTRIBUTE_UNUSED,
-                      HFloatConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* x,
+                      [[maybe_unused]] HFloatConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for float values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HDoubleConstant* x ATTRIBUTE_UNUSED,
-                      HDoubleConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* x,
+                      [[maybe_unused]] HDoubleConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for double values";
     UNREACHABLE();
   }
@@ -5911,13 +5964,13 @@
     return GetBlock()->GetGraph()->GetLongConstant(
         Compute(x->GetValue(), y->GetValue()), GetDexPc());
   }
-  HConstant* Evaluate(HFloatConstant* x ATTRIBUTE_UNUSED,
-                      HFloatConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* x,
+                      [[maybe_unused]] HFloatConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for float values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HDoubleConstant* x ATTRIBUTE_UNUSED,
-                      HDoubleConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* x,
+                      [[maybe_unused]] HDoubleConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for double values";
     UNREACHABLE();
   }
@@ -5949,13 +6002,13 @@
     return GetBlock()->GetGraph()->GetLongConstant(
         Compute(x->GetValue(), y->GetValue()), GetDexPc());
   }
-  HConstant* Evaluate(HFloatConstant* x ATTRIBUTE_UNUSED,
-                      HFloatConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* x,
+                      [[maybe_unused]] HFloatConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for float values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HDoubleConstant* x ATTRIBUTE_UNUSED,
-                      HDoubleConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* x,
+                      [[maybe_unused]] HDoubleConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for double values";
     UNREACHABLE();
   }
@@ -5993,18 +6046,18 @@
     return GetBlock()->GetGraph()->GetLongConstant(
         Compute(value->GetValue(), distance->GetValue(), kMaxLongShiftDistance), GetDexPc());
   }
-  HConstant* Evaluate(HLongConstant* value ATTRIBUTE_UNUSED,
-                      HLongConstant* distance ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HLongConstant* value,
+                      [[maybe_unused]] HLongConstant* distance) const override {
     LOG(FATAL) << DebugName() << " is not defined for the (long, long) case.";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HFloatConstant* value ATTRIBUTE_UNUSED,
-                      HFloatConstant* distance ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* value,
+                      [[maybe_unused]] HFloatConstant* distance) const override {
     LOG(FATAL) << DebugName() << " is not defined for float values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HDoubleConstant* value ATTRIBUTE_UNUSED,
-                      HDoubleConstant* distance ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* value,
+                      [[maybe_unused]] HDoubleConstant* distance) const override {
     LOG(FATAL) << DebugName() << " is not defined for double values";
     UNREACHABLE();
   }
@@ -6067,7 +6120,7 @@
   }
 
   bool CanBeMoved() const override { return true; }
-  bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const override {
+  bool InstructionDataEquals([[maybe_unused]] const HInstruction* other) const override {
     return true;
   }
 
@@ -6079,11 +6132,11 @@
   HConstant* Evaluate(HLongConstant* x) const override {
     return GetBlock()->GetGraph()->GetLongConstant(Compute(x->GetValue()), GetDexPc());
   }
-  HConstant* Evaluate(HFloatConstant* x ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* x) const override {
     LOG(FATAL) << DebugName() << " is not defined for float values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HDoubleConstant* x ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* x) const override {
     LOG(FATAL) << DebugName() << " is not defined for double values";
     UNREACHABLE();
   }
@@ -6101,7 +6154,7 @@
   }
 
   bool CanBeMoved() const override { return true; }
-  bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const override {
+  bool InstructionDataEquals([[maybe_unused]] const HInstruction* other) const override {
     return true;
   }
 
@@ -6113,15 +6166,15 @@
   HConstant* Evaluate(HIntConstant* x) const override {
     return GetBlock()->GetGraph()->GetIntConstant(Compute(x->GetValue()), GetDexPc());
   }
-  HConstant* Evaluate(HLongConstant* x ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HLongConstant* x) const override {
     LOG(FATAL) << DebugName() << " is not defined for long values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HFloatConstant* x ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* x) const override {
     LOG(FATAL) << DebugName() << " is not defined for float values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HDoubleConstant* x ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* x) const override {
     LOG(FATAL) << DebugName() << " is not defined for double values";
     UNREACHABLE();
   }
@@ -6148,7 +6201,7 @@
 
   bool IsClonable() const override { return true; }
   bool CanBeMoved() const override { return true; }
-  bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const override {
+  bool InstructionDataEquals([[maybe_unused]] const HInstruction* other) const override {
     return true;
   }
   // Return whether the conversion is implicit. This includes conversion to the same type.
@@ -6160,6 +6213,9 @@
   // containing the result.  If the input cannot be converted, return nullptr.
   HConstant* TryStaticEvaluation() const;
 
+  // Same but for `input` instead of GetInput().
+  HConstant* TryStaticEvaluation(HInstruction* input) const;
+
   DECLARE_INSTRUCTION(TypeConversion);
 
  protected:
@@ -6180,7 +6236,7 @@
 
   bool IsClonable() const override { return true; }
   bool CanBeMoved() const override { return true; }
-  bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const override {
+  bool InstructionDataEquals([[maybe_unused]] const HInstruction* other) const override {
     return true;
   }
 
@@ -6321,110 +6377,14 @@
   const FieldInfo field_info_;
 };
 
-class HPredicatedInstanceFieldGet final : public HExpression<2> {
- public:
-  HPredicatedInstanceFieldGet(HInstanceFieldGet* orig,
-                              HInstruction* target,
-                              HInstruction* default_val)
-      : HExpression(kPredicatedInstanceFieldGet,
-                    orig->GetFieldType(),
-                    orig->GetSideEffects(),
-                    orig->GetDexPc()),
-        field_info_(orig->GetFieldInfo()) {
-    // NB Default-val is at 0 so we can avoid doing a move.
-    SetRawInputAt(1, target);
-    SetRawInputAt(0, default_val);
-  }
-
-  HPredicatedInstanceFieldGet(HInstruction* value,
-                              ArtField* field,
-                              HInstruction* default_value,
-                              DataType::Type field_type,
-                              MemberOffset field_offset,
-                              bool is_volatile,
-                              uint32_t field_idx,
-                              uint16_t declaring_class_def_index,
-                              const DexFile& dex_file,
-                              uint32_t dex_pc)
-      : HExpression(kPredicatedInstanceFieldGet,
-                    field_type,
-                    SideEffects::FieldReadOfType(field_type, is_volatile),
-                    dex_pc),
-        field_info_(field,
-                    field_offset,
-                    field_type,
-                    is_volatile,
-                    field_idx,
-                    declaring_class_def_index,
-                    dex_file) {
-    SetRawInputAt(1, value);
-    SetRawInputAt(0, default_value);
-  }
-
-  bool IsClonable() const override {
-    return true;
-  }
-  bool CanBeMoved() const override {
-    return !IsVolatile();
-  }
-
-  HInstruction* GetDefaultValue() const {
-    return InputAt(0);
-  }
-  HInstruction* GetTarget() const {
-    return InputAt(1);
-  }
-
-  bool InstructionDataEquals(const HInstruction* other) const override {
-    const HPredicatedInstanceFieldGet* other_get = other->AsPredicatedInstanceFieldGet();
-    return GetFieldOffset().SizeValue() == other_get->GetFieldOffset().SizeValue() &&
-           GetDefaultValue() == other_get->GetDefaultValue();
-  }
-
-  bool CanDoImplicitNullCheckOn(HInstruction* obj) const override {
-    return (obj == InputAt(0)) && art::CanDoImplicitNullCheckOn(GetFieldOffset().Uint32Value());
-  }
-
-  size_t ComputeHashCode() const override {
-    return (HInstruction::ComputeHashCode() << 7) | GetFieldOffset().SizeValue();
-  }
-
-  bool IsFieldAccess() const override { return true; }
-  const FieldInfo& GetFieldInfo() const override { return field_info_; }
-  MemberOffset GetFieldOffset() const { return field_info_.GetFieldOffset(); }
-  DataType::Type GetFieldType() const { return field_info_.GetFieldType(); }
-  bool IsVolatile() const { return field_info_.IsVolatile(); }
-
-  void SetType(DataType::Type new_type) {
-    DCHECK(DataType::IsIntegralType(GetType()));
-    DCHECK(DataType::IsIntegralType(new_type));
-    DCHECK_EQ(DataType::Size(GetType()), DataType::Size(new_type));
-    SetPackedField<TypeField>(new_type);
-  }
-
-  DECLARE_INSTRUCTION(PredicatedInstanceFieldGet);
-
- protected:
-  DEFAULT_COPY_CONSTRUCTOR(PredicatedInstanceFieldGet);
-
- private:
-  const FieldInfo field_info_;
-};
-
 enum class WriteBarrierKind {
-  // Emit the write barrier, with a runtime optimization which checks if the value that it is being
-  // set is null.
-  kEmitWithNullCheck,
-  // Emit the write barrier, without the runtime null check optimization. This could be set because:
-  //  A) It is a write barrier for an ArraySet (which does the optimization with the type check, so
-  //  it never does the optimization at the write barrier stage)
-  //  B) We know that the input can't be null
-  //  C) This write barrier is actually several write barriers coalesced into one. Potentially we
-  //  could ask if every value is null for a runtime optimization at the cost of compile time / code
-  //  size. At the time of writing it was deemed not worth the effort.
-  kEmitNoNullCheck,
+  // Emit the write barrier. This write barrier is not being relied on so e.g. codegen can decide to
+  // skip it if the value stored is null. This is the default behavior.
+  kEmitNotBeingReliedOn,
+  // Emit the write barrier. This write barrier is being relied on and must be emitted.
+  kEmitBeingReliedOn,
   // Skip emitting the write barrier. This could be set because:
-  //  A) The write barrier is not needed (e.g. it is not a reference, or the value is the null
+  //  A) The write barrier is not needed (i.e. it is not a reference, or the value is the null
   //  constant)
   //  B) This write barrier was coalesced into another one so there's no need to emit it.
   kDontEmit,
@@ -6455,8 +6415,7 @@
                     declaring_class_def_index,
                     dex_file) {
     SetPackedFlag<kFlagValueCanBeNull>(true);
-    SetPackedFlag<kFlagIsPredicatedSet>(false);
-    SetPackedField<WriteBarrierKindField>(WriteBarrierKind::kEmitWithNullCheck);
+    SetPackedField<WriteBarrierKindField>(WriteBarrierKind::kEmitNotBeingReliedOn);
     SetRawInputAt(0, object);
     SetRawInputAt(1, value);
   }
@@ -6475,12 +6434,13 @@
   HInstruction* GetValue() const { return InputAt(1); }
   bool GetValueCanBeNull() const { return GetPackedFlag<kFlagValueCanBeNull>(); }
   void ClearValueCanBeNull() { SetPackedFlag<kFlagValueCanBeNull>(false); }
-  bool GetIsPredicatedSet() const { return GetPackedFlag<kFlagIsPredicatedSet>(); }
-  void SetIsPredicatedSet(bool value = true) { SetPackedFlag<kFlagIsPredicatedSet>(value); }
   WriteBarrierKind GetWriteBarrierKind() { return GetPackedField<WriteBarrierKindField>(); }
   void SetWriteBarrierKind(WriteBarrierKind kind) {
-    DCHECK(kind != WriteBarrierKind::kEmitWithNullCheck)
+    DCHECK(kind != WriteBarrierKind::kEmitNotBeingReliedOn)
         << "We shouldn't go back to the original value.";
+    DCHECK_IMPLIES(kind == WriteBarrierKind::kDontEmit,
+                   GetWriteBarrierKind() != WriteBarrierKind::kEmitBeingReliedOn)
+        << "If a write barrier was relied on by other write barriers, we cannot skip emitting it.";
     SetPackedField<WriteBarrierKindField>(kind);
   }
 
@@ -6491,8 +6451,7 @@
 
  private:
   static constexpr size_t kFlagValueCanBeNull = kNumberOfGenericPackedBits;
-  static constexpr size_t kFlagIsPredicatedSet = kFlagValueCanBeNull + 1;
-  static constexpr size_t kWriteBarrierKind = kFlagIsPredicatedSet + 1;
+  static constexpr size_t kWriteBarrierKind = kFlagValueCanBeNull + 1;
   static constexpr size_t kWriteBarrierKindSize =
       MinimumBitsToStore(static_cast<size_t>(WriteBarrierKind::kLast));
   static constexpr size_t kNumberOfInstanceFieldSetPackedBits =
@@ -6511,12 +6470,12 @@
             HInstruction* index,
             DataType::Type type,
             uint32_t dex_pc)
-     : HArrayGet(array,
-                 index,
-                 type,
-                 SideEffects::ArrayReadOfType(type),
-                 dex_pc,
-                 /* is_string_char_at= */ false) {
+      : HArrayGet(array,
+                  index,
+                  type,
+                  SideEffects::ArrayReadOfType(type),
+                  dex_pc,
+                  /* is_string_char_at= */ false) {
   }
 
   HArrayGet(HInstruction* array,
@@ -6533,10 +6492,10 @@
 
   bool IsClonable() const override { return true; }
   bool CanBeMoved() const override { return true; }
-  bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const override {
+  bool InstructionDataEquals([[maybe_unused]] const HInstruction* other) const override {
     return true;
   }
-  bool CanDoImplicitNullCheckOn(HInstruction* obj ATTRIBUTE_UNUSED) const override {
+  bool CanDoImplicitNullCheckOn([[maybe_unused]] HInstruction* obj) const override {
     // TODO: We can be smarter here.
     // Currently, unless the array is the result of NewArray, the array access is always
     // preceded by some form of null NullCheck necessary for the bounds check, usually
@@ -6623,8 +6582,7 @@
     SetPackedFlag<kFlagNeedsTypeCheck>(value->GetType() == DataType::Type::kReference);
     SetPackedFlag<kFlagValueCanBeNull>(true);
     SetPackedFlag<kFlagStaticTypeOfArrayIsObjectArray>(false);
-    // ArraySets never do the null check optimization at the write barrier stage.
-    SetPackedField<WriteBarrierKindField>(WriteBarrierKind::kEmitNoNullCheck);
+    SetPackedField<WriteBarrierKindField>(WriteBarrierKind::kEmitNotBeingReliedOn);
     SetRawInputAt(0, array);
     SetRawInputAt(1, index);
     SetRawInputAt(2, value);
@@ -6640,7 +6598,7 @@
   // Can throw ArrayStoreException.
   bool CanThrow() const override { return NeedsTypeCheck(); }
 
-  bool CanDoImplicitNullCheckOn(HInstruction* obj ATTRIBUTE_UNUSED) const override {
+  bool CanDoImplicitNullCheckOn([[maybe_unused]] HInstruction* obj) const override {
     // TODO: Same as for ArrayGet.
     return false;
   }
@@ -6700,10 +6658,11 @@
   WriteBarrierKind GetWriteBarrierKind() { return GetPackedField<WriteBarrierKindField>(); }
 
   void SetWriteBarrierKind(WriteBarrierKind kind) {
-    DCHECK(kind != WriteBarrierKind::kEmitNoNullCheck)
+    DCHECK(kind != WriteBarrierKind::kEmitNotBeingReliedOn)
         << "We shouldn't go back to the original value.";
-    DCHECK(kind != WriteBarrierKind::kEmitWithNullCheck)
-        << "We never do the null check optimization for ArraySets.";
+    DCHECK_IMPLIES(kind == WriteBarrierKind::kDontEmit,
+                   GetWriteBarrierKind() != WriteBarrierKind::kEmitBeingReliedOn)
+        << "If a write barrier was relied on by other write barriers, we cannot skip emitting it.";
     SetPackedField<WriteBarrierKindField>(kind);
   }
 
@@ -6746,7 +6705,7 @@
 
   bool IsClonable() const override { return true; }
   bool CanBeMoved() const override { return true; }
-  bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const override {
+  bool InstructionDataEquals([[maybe_unused]] const HInstruction* other) const override {
     return true;
   }
   bool CanDoImplicitNullCheckOn(HInstruction* obj) const override {
@@ -6790,7 +6749,7 @@
 
   bool IsClonable() const override { return true; }
   bool CanBeMoved() const override { return true; }
-  bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const override {
+  bool InstructionDataEquals([[maybe_unused]] const HInstruction* other) const override {
     return true;
   }
 
@@ -7000,17 +6959,15 @@
   bool CanCallRuntime() const {
     return NeedsAccessCheck() ||
            MustGenerateClinitCheck() ||
-           GetLoadKind() == LoadKind::kRuntimeCall ||
-           GetLoadKind() == LoadKind::kBssEntry;
+           NeedsBss() ||
+           GetLoadKind() == LoadKind::kRuntimeCall;
   }
 
   bool CanThrow() const override {
     return NeedsAccessCheck() ||
            MustGenerateClinitCheck() ||
            // If the class is in the boot image, the lookup in the runtime call cannot throw.
-           ((GetLoadKind() == LoadKind::kRuntimeCall ||
-             GetLoadKind() == LoadKind::kBssEntry) &&
-            !IsInBootImage());
+           ((GetLoadKind() == LoadKind::kRuntimeCall || NeedsBss()) && !IsInBootImage());
   }
 
   ReferenceTypeInfo GetLoadedClassRTI() {
@@ -7362,6 +7319,16 @@
 
 class HLoadMethodType final : public HInstruction {
  public:
+  // Determines how to load the MethodType.
+  enum class LoadKind {
+    // Load from an entry in the .bss section using a PC-relative load.
+    kBssEntry,
+    // Load using a single runtime call.
+    kRuntimeCall,
+
+    kLast = kRuntimeCall,
+  };
+
   HLoadMethodType(HCurrentMethod* current_method,
                   dex::ProtoIndex proto_index,
                   const DexFile& dex_file,
@@ -7373,6 +7340,7 @@
         special_input_(HUserRecord<HInstruction*>(current_method)),
         proto_index_(proto_index),
         dex_file_(dex_file) {
+    SetPackedField<LoadKindField>(LoadKind::kRuntimeCall);
   }
 
   using HInstruction::GetInputRecords;  // Keep the const version visible.
@@ -7383,6 +7351,12 @@
 
   bool IsClonable() const override { return true; }
 
+  void SetLoadKind(LoadKind load_kind);
+
+  LoadKind GetLoadKind() const {
+    return GetPackedField<LoadKindField>();
+  }
+
   dex::ProtoIndex GetProtoIndex() const { return proto_index_; }
 
   const DexFile& GetDexFile() const { return dex_file_; }
@@ -7401,6 +7375,14 @@
   DEFAULT_COPY_CONSTRUCTOR(LoadMethodType);
 
  private:
+  static constexpr size_t kFieldLoadKind = kNumberOfGenericPackedBits;
+  static constexpr size_t kFieldLoadKindSize =
+      MinimumBitsToStore(static_cast<size_t>(LoadKind::kLast));
+  static constexpr size_t kNumberOfLoadMethodTypePackedBits = kFieldLoadKind + kFieldLoadKindSize;
+  static_assert(kNumberOfLoadMethodTypePackedBits <= kMaxNumberOfPackedBits,
+      "Too many packed fields.");
+  using LoadKindField = BitField<LoadKind, kFieldLoadKind, kFieldLoadKindSize>;
+
   // The special input is the HCurrentMethod for kRuntimeCall.
   HUserRecord<HInstruction*> special_input_;
 
@@ -7408,6 +7390,17 @@
   const DexFile& dex_file_;
 };
 
+std::ostream& operator<<(std::ostream& os, HLoadMethodType::LoadKind rhs);
+
+// Note: defined outside class to see operator<<(., HLoadMethodType::LoadKind).
+inline void HLoadMethodType::SetLoadKind(LoadKind load_kind) {
+  // The load kind should be determined before inserting the instruction to the graph.
+  DCHECK(GetBlock() == nullptr);
+  DCHECK(GetEnvironment() == nullptr);
+  DCHECK_EQ(GetLoadKind(), LoadKind::kRuntimeCall);
+  SetPackedField<LoadKindField>(load_kind);
+}
+
 /**
  * Performs an initialization check on its Class object input.
  */
@@ -7423,7 +7416,7 @@
   }
   // TODO: Make ClinitCheck clonable.
   bool CanBeMoved() const override { return true; }
-  bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const override {
+  bool InstructionDataEquals([[maybe_unused]] const HInstruction* other) const override {
     return true;
   }
 
@@ -7529,7 +7522,7 @@
                     declaring_class_def_index,
                     dex_file) {
     SetPackedFlag<kFlagValueCanBeNull>(true);
-    SetPackedField<WriteBarrierKindField>(WriteBarrierKind::kEmitWithNullCheck);
+    SetPackedField<WriteBarrierKindField>(WriteBarrierKind::kEmitNotBeingReliedOn);
     SetRawInputAt(0, cls);
     SetRawInputAt(1, value);
   }
@@ -7547,8 +7540,11 @@
 
   WriteBarrierKind GetWriteBarrierKind() { return GetPackedField<WriteBarrierKindField>(); }
   void SetWriteBarrierKind(WriteBarrierKind kind) {
-    DCHECK(kind != WriteBarrierKind::kEmitWithNullCheck)
+    DCHECK(kind != WriteBarrierKind::kEmitNotBeingReliedOn)
         << "We shouldn't go back to the original value.";
+    DCHECK_IMPLIES(kind == WriteBarrierKind::kDontEmit,
+                   GetWriteBarrierKind() != WriteBarrierKind::kEmitBeingReliedOn)
+        << "If a write barrier was relied on by other write barriers, we cannot skip emitting it.";
     SetPackedField<WriteBarrierKindField>(kind);
   }
 
@@ -8343,7 +8339,7 @@
   HInstruction* GetCondition() const { return InputAt(2); }
 
   bool CanBeMoved() const override { return true; }
-  bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const override {
+  bool InstructionDataEquals([[maybe_unused]] const HInstruction* other) const override {
     return true;
   }
 
@@ -8351,6 +8347,12 @@
     return GetTrueValue()->CanBeNull() || GetFalseValue()->CanBeNull();
   }
 
+  void UpdateType() {
+    DCHECK_EQ(HPhi::ToPhiType(GetTrueValue()->GetType()),
+              HPhi::ToPhiType(GetFalseValue()->GetType()));
+    SetPackedField<TypeField>(HPhi::ToPhiType(GetTrueValue()->GetType()));
+  }
+
   DECLARE_INSTRUCTION(Select);
 
  protected:
@@ -8513,7 +8515,7 @@
 
   bool IsClonable() const override { return true; }
   bool CanBeMoved() const override { return true; }
-  bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const override {
+  bool InstructionDataEquals([[maybe_unused]] const HInstruction* other) const override {
     return true;
   }
   bool IsActualObject() const override { return false; }
@@ -8550,7 +8552,7 @@
         graph_(graph) {}
   virtual ~HGraphVisitor() {}
 
-  virtual void VisitInstruction(HInstruction* instruction ATTRIBUTE_UNUSED) {}
+  virtual void VisitInstruction([[maybe_unused]] HInstruction* instruction) {}
   virtual void VisitBasicBlock(HBasicBlock* block);
 
   // Visit the graph following basic block insertion order.
@@ -8570,6 +8572,9 @@
 #undef DECLARE_VISIT_INSTRUCTION
 
  protected:
+  void VisitPhis(HBasicBlock* block);
+  void VisitNonPhiInstructions(HBasicBlock* block);
+
   OptimizingCompilerStats* stats_;
 
  private:
@@ -8623,7 +8628,7 @@
   DISALLOW_COPY_AND_ASSIGN(CloneAndReplaceInstructionVisitor);
 };
 
-// Iterator over the blocks that art part of the loop. Includes blocks part
+// Iterator over the blocks that are part of the loop; includes blocks which are part
 // of an inner loop. The order in which the blocks are iterated is on their
 // block id.
 class HBlocksInLoopIterator : public ValueObject {
@@ -8656,7 +8661,7 @@
   DISALLOW_COPY_AND_ASSIGN(HBlocksInLoopIterator);
 };
 
-// Iterator over the blocks that art part of the loop. Includes blocks part
+// Iterator over the blocks that are part of the loop; includes blocks which are part
 // of an inner loop. The order in which the blocks are iterated is reverse
 // post order.
 class HBlocksInLoopReversePostOrderIterator : public ValueObject {
@@ -8689,6 +8694,39 @@
   DISALLOW_COPY_AND_ASSIGN(HBlocksInLoopReversePostOrderIterator);
 };
 
+// Iterator over the blocks that are part of the loop; includes blocks which are part
+// of an inner loop. The order in which the blocks are iterated is post order.
+class HBlocksInLoopPostOrderIterator : public ValueObject {
+ public:
+  explicit HBlocksInLoopPostOrderIterator(const HLoopInformation& info)
+      : blocks_in_loop_(info.GetBlocks()),
+        blocks_(info.GetHeader()->GetGraph()->GetReversePostOrder()),
+        index_(blocks_.size() - 1) {
+    if (!blocks_in_loop_.IsBitSet(blocks_[index_]->GetBlockId())) {
+      Advance();
+    }
+  }
+
+  bool Done() const { return index_ < 0; }
+  HBasicBlock* Current() const { return blocks_[index_]; }
+  void Advance() {
+    --index_;
+    for (; index_ >= 0; --index_) {
+      if (blocks_in_loop_.IsBitSet(blocks_[index_]->GetBlockId())) {
+        break;
+      }
+    }
+  }
+
+ private:
+  const BitVector& blocks_in_loop_;
+  const ArenaVector<HBasicBlock*>& blocks_;
+
+  int32_t index_;
+
+  DISALLOW_COPY_AND_ASSIGN(HBlocksInLoopPostOrderIterator);
+};
+
 // Returns int64_t value of a properly typed constant.
 inline int64_t Int64FromConstant(HConstant* constant) {
   if (constant->IsIntConstant()) {
@@ -8752,10 +8790,18 @@
 
 #define INSTRUCTION_TYPE_CAST(type, super)                                     \
   inline const H##type* HInstruction::As##type() const {                       \
-    return Is##type() ? down_cast<const H##type*>(this) : nullptr;             \
+    DCHECK(Is##type());                                                        \
+    return down_cast<const H##type*>(this);                                    \
   }                                                                            \
   inline H##type* HInstruction::As##type() {                                   \
-    return Is##type() ? static_cast<H##type*>(this) : nullptr;                 \
+    DCHECK(Is##type());                                                        \
+    return down_cast<H##type*>(this);                                          \
+  }                                                                            \
+  inline const H##type* HInstruction::As##type##OrNull() const {               \
+    return Is##type() ? down_cast<const H##type*>(this) : nullptr;             \
+  }                                                                            \
+  inline H##type* HInstruction::As##type##OrNull() {                           \
+    return Is##type() ? down_cast<H##type*>(this) : nullptr;                   \
   }
 
   FOR_EACH_INSTRUCTION(INSTRUCTION_TYPE_CAST)
diff --git a/compiler/optimizing/nodes_shared.h b/compiler/optimizing/nodes_shared.h
index 27e6103..d627c6d 100644
--- a/compiler/optimizing/nodes_shared.h
+++ b/compiler/optimizing/nodes_shared.h
@@ -97,6 +97,10 @@
     }
   }
 
+  bool InstructionDataEquals(const HInstruction* other) const override {
+    return op_kind_ == other->AsBitwiseNegatedRight()->op_kind_;
+  }
+
   HConstant* Evaluate(HIntConstant* x, HIntConstant* y) const override {
     return GetBlock()->GetGraph()->GetIntConstant(
         Compute(x->GetValue(), y->GetValue()), GetDexPc());
@@ -105,13 +109,13 @@
     return GetBlock()->GetGraph()->GetLongConstant(
         Compute(x->GetValue(), y->GetValue()), GetDexPc());
   }
-  HConstant* Evaluate(HFloatConstant* x ATTRIBUTE_UNUSED,
-                      HFloatConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* x,
+                      [[maybe_unused]] HFloatConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for float values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HDoubleConstant* x ATTRIBUTE_UNUSED,
-                      HDoubleConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* x,
+                      [[maybe_unused]] HDoubleConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for double values";
     UNREACHABLE();
   }
@@ -160,7 +164,7 @@
 
   bool IsClonable() const override { return true; }
   bool CanBeMoved() const override { return true; }
-  bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const override {
+  bool InstructionDataEquals([[maybe_unused]] const HInstruction* other) const override {
     return true;
   }
   bool IsActualObject() const override { return false; }
diff --git a/compiler/optimizing/nodes_vector.h b/compiler/optimizing/nodes_vector.h
index 73f6c40..6a60d6b 100644
--- a/compiler/optimizing/nodes_vector.h
+++ b/compiler/optimizing/nodes_vector.h
@@ -1384,8 +1384,8 @@
   static constexpr size_t kCondKind = HVecOperation::kNumberOfVectorOpPackedBits;
   static constexpr size_t kCondKindSize =
       MinimumBitsToStore(static_cast<size_t>(CondKind::kLast));
-  static constexpr size_t kNumberOfVecPredConditionPackedBits = kCondKind + kCondKindSize;
-  static_assert(kNumberOfVecPredConditionPackedBits <= kMaxNumberOfPackedBits,
+  static constexpr size_t kNumberOfVecPredWhilePackedBits = kCondKind + kCondKindSize;
+  static_assert(kNumberOfVecPredWhilePackedBits <= kMaxNumberOfPackedBits,
                 "Too many packed fields.");
   using CondKindField = BitField<CondKind, kCondKind, kCondKindSize>;
 
@@ -1395,13 +1395,13 @@
 // Evaluates the predicate condition (PCondKind) for a vector predicate; outputs
 // a scalar boolean value result.
 //
-// Note: as VecPredCondition can be also predicated, only active elements (determined by the
+// Note: as VecPredToBoolean can be also predicated, only active elements (determined by the
 // instruction's governing predicate) of the input vector predicate are used for condition
 // evaluation.
 //
 // Note: this instruction is currently used as a workaround for the fact that IR instructions
 // can't have more than one output.
-class HVecPredCondition final : public HVecOperation {
+class HVecPredToBoolean final : public HVecOperation {
  public:
   // To get more info on the condition kinds please see "2.2 Process state, PSTATE" section of
   // "ARM Architecture Reference Manual Supplement. The Scalable Vector Extension (SVE),
@@ -1418,13 +1418,13 @@
     kEnumLast = kPLast
   };
 
-  HVecPredCondition(ArenaAllocator* allocator,
+  HVecPredToBoolean(ArenaAllocator* allocator,
                     HInstruction* input,
                     PCondKind pred_cond,
                     DataType::Type packed_type,
                     size_t vector_length,
                     uint32_t dex_pc)
-      : HVecOperation(kVecPredCondition,
+      : HVecOperation(kVecPredToBoolean,
                       allocator,
                       packed_type,
                       SideEffects::None(),
@@ -1447,19 +1447,86 @@
     return GetPackedField<CondKindField>();
   }
 
-  DECLARE_INSTRUCTION(VecPredCondition);
+  DECLARE_INSTRUCTION(VecPredToBoolean);
 
  protected:
   // Additional packed bits.
   static constexpr size_t kCondKind = HVecOperation::kNumberOfVectorOpPackedBits;
   static constexpr size_t kCondKindSize =
       MinimumBitsToStore(static_cast<size_t>(PCondKind::kEnumLast));
-  static constexpr size_t kNumberOfVecPredConditionPackedBits = kCondKind + kCondKindSize;
-  static_assert(kNumberOfVecPredConditionPackedBits <= kMaxNumberOfPackedBits,
+  static constexpr size_t kNumberOfVecPredToBooleanPackedBits = kCondKind + kCondKindSize;
+  static_assert(kNumberOfVecPredToBooleanPackedBits <= kMaxNumberOfPackedBits,
                 "Too many packed fields.");
   using CondKindField = BitField<PCondKind, kCondKind, kCondKindSize>;
 
-  DEFAULT_COPY_CONSTRUCTOR(VecPredCondition);
+  DEFAULT_COPY_CONSTRUCTOR(VecPredToBoolean);
+};
+
+// Evaluates condition for pairwise elements in two input vectors and sets the result
+// as an output predicate vector.
+//
+// viz. [ p1, .. , pn ]  = [ x1 OP y1 , x2 OP y2, .. , xn OP yn] where OP is CondKind
+// condition.
+//
+// Currently only kEqual is supported by this vector instruction - we don't even define
+// the kCondType here.
+// TODO: support other condition ops.
+class HVecCondition final : public HVecPredSetOperation {
+ public:
+  HVecCondition(ArenaAllocator* allocator,
+                HInstruction* left,
+                HInstruction* right,
+                DataType::Type packed_type,
+                size_t vector_length,
+                uint32_t dex_pc) :
+      HVecPredSetOperation(kVecCondition,
+                           allocator,
+                           packed_type,
+                           SideEffects::None(),
+                           /* number_of_inputs= */ 2,
+                           vector_length,
+                           dex_pc) {
+    DCHECK(left->IsVecOperation());
+    DCHECK(!left->IsVecPredSetOperation());
+    DCHECK(right->IsVecOperation());
+    DCHECK(!right->IsVecPredSetOperation());
+    SetRawInputAt(0, left);
+    SetRawInputAt(1, right);
+  }
+
+  DECLARE_INSTRUCTION(VecCondition);
+
+ protected:
+  DEFAULT_COPY_CONSTRUCTOR(VecCondition);
+};
+
+// Inverts every component in the predicate vector.
+//
+// viz. [ p1, .. , pn ]  = [ !px1 , !px2 , .. , !pxn ].
+class HVecPredNot final : public HVecPredSetOperation {
+ public:
+  HVecPredNot(ArenaAllocator* allocator,
+                HInstruction* input,
+                DataType::Type packed_type,
+                size_t vector_length,
+                uint32_t dex_pc) :
+      HVecPredSetOperation(kVecPredNot,
+                           allocator,
+                           packed_type,
+                           SideEffects::None(),
+                           /* number_of_inputs= */ 1,
+                           vector_length,
+                           dex_pc) {
+    DCHECK(input->IsVecOperation());
+    DCHECK(input->IsVecPredSetOperation());
+
+    SetRawInputAt(0, input);
+  }
+
+  DECLARE_INSTRUCTION(VecPredNot);
+
+ protected:
+  DEFAULT_COPY_CONSTRUCTOR(VecPredNot);
 };
 
 }  // namespace art
diff --git a/compiler/optimizing/nodes_x86.h b/compiler/optimizing/nodes_x86.h
index e246390..14d9823 100644
--- a/compiler/optimizing/nodes_x86.h
+++ b/compiler/optimizing/nodes_x86.h
@@ -149,13 +149,13 @@
     return GetBlock()->GetGraph()->GetLongConstant(
         Compute(x->GetValue(), y->GetValue()), GetDexPc());
   }
-  HConstant* Evaluate(HFloatConstant* x ATTRIBUTE_UNUSED,
-                      HFloatConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* x,
+                      [[maybe_unused]] HFloatConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for float values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HDoubleConstant* x ATTRIBUTE_UNUSED,
-                      HDoubleConstant* y ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* x,
+                      [[maybe_unused]] HDoubleConstant* y) const override {
     LOG(FATAL) << DebugName() << " is not defined for double values";
     UNREACHABLE();
   }
@@ -196,11 +196,11 @@
   HConstant* Evaluate(HLongConstant* x) const override {
     return GetBlock()->GetGraph()->GetLongConstant(Compute(x->GetValue()), GetDexPc());
   }
-  HConstant* Evaluate(HFloatConstant* x ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HFloatConstant* x) const override {
     LOG(FATAL) << DebugName() << "is not defined for float values";
     UNREACHABLE();
   }
-  HConstant* Evaluate(HDoubleConstant* x ATTRIBUTE_UNUSED) const override {
+  HConstant* Evaluate([[maybe_unused]] HDoubleConstant* x) const override {
     LOG(FATAL) << DebugName() << "is not defined for double values";
     UNREACHABLE();
   }
diff --git a/compiler/optimizing/optimization.cc b/compiler/optimizing/optimization.cc
index 12e9a10..dd57100 100644
--- a/compiler/optimizing/optimization.cc
+++ b/compiler/optimizing/optimization.cc
@@ -23,6 +23,9 @@
 #ifdef ART_ENABLE_CODEGEN_arm64
 #include "instruction_simplifier_arm64.h"
 #endif
+#ifdef ART_ENABLE_CODEGEN_riscv64
+#include "critical_native_abi_fixup_riscv64.h"
+#endif
 #ifdef ART_ENABLE_CODEGEN_x86
 #include "pc_relative_fixups_x86.h"
 #include "instruction_simplifier_x86.h"
@@ -77,7 +80,6 @@
       return BoundsCheckElimination::kBoundsCheckEliminationPassName;
     case OptimizationPass::kLoadStoreElimination:
       return LoadStoreElimination::kLoadStoreEliminationPassName;
-    case OptimizationPass::kAggressiveConstantFolding:
     case OptimizationPass::kConstantFolding:
       return HConstantFolding::kConstantFoldingPassName;
     case OptimizationPass::kDeadCodeElimination:
@@ -109,6 +111,10 @@
     case OptimizationPass::kInstructionSimplifierArm64:
       return arm64::InstructionSimplifierArm64::kInstructionSimplifierArm64PassName;
 #endif
+#ifdef ART_ENABLE_CODEGEN_riscv64
+    case OptimizationPass::kCriticalNativeAbiFixupRiscv64:
+      return riscv64::CriticalNativeAbiFixupRiscv64::kCriticalNativeAbiFixupRiscv64PassName;
+#endif
 #ifdef ART_ENABLE_CODEGEN_x86
     case OptimizationPass::kPcRelativeFixupsX86:
       return x86::PcRelativeFixups::kPcRelativeFixupsX86PassName;
@@ -155,6 +161,9 @@
 #ifdef ART_ENABLE_CODEGEN_arm64
   X(OptimizationPass::kInstructionSimplifierArm64);
 #endif
+#ifdef ART_ENABLE_CODEGEN_riscv64
+  X(OptimizationPass::kCriticalNativeAbiFixupRiscv64);
+#endif
 #ifdef ART_ENABLE_CODEGEN_x86
   X(OptimizationPass::kPcRelativeFixupsX86);
   X(OptimizationPass::kX86MemoryOperandGeneration);
@@ -228,10 +237,6 @@
       case OptimizationPass::kConstantFolding:
         opt = new (allocator) HConstantFolding(graph, stats, pass_name);
         break;
-      case OptimizationPass::kAggressiveConstantFolding:
-        opt = new (allocator)
-            HConstantFolding(graph, stats, pass_name, /* use_all_optimizations_ = */ true);
-        break;
       case OptimizationPass::kDeadCodeElimination:
         opt = new (allocator) HDeadCodeElimination(graph, stats, pass_name);
         break;
@@ -247,6 +252,7 @@
                                        accessor.RegistersSize(),
                                        /* total_number_of_instructions= */ 0,
                                        /* parent= */ nullptr,
+                                       /* caller_environment= */ nullptr,
                                        /* depth= */ 0,
                                        /* try_catch_inlining_allowed= */ true,
                                        pass_name);
@@ -290,7 +296,7 @@
 #ifdef ART_ENABLE_CODEGEN_arm
       case OptimizationPass::kInstructionSimplifierArm:
         DCHECK(alt_name == nullptr) << "arch-specific pass does not support alternative name";
-        opt = new (allocator) arm::InstructionSimplifierArm(graph, stats);
+        opt = new (allocator) arm::InstructionSimplifierArm(graph, codegen, stats);
         break;
       case OptimizationPass::kCriticalNativeAbiFixupArm:
         DCHECK(alt_name == nullptr) << "arch-specific pass does not support alternative name";
@@ -300,7 +306,13 @@
 #ifdef ART_ENABLE_CODEGEN_arm64
       case OptimizationPass::kInstructionSimplifierArm64:
         DCHECK(alt_name == nullptr) << "arch-specific pass does not support alternative name";
-        opt = new (allocator) arm64::InstructionSimplifierArm64(graph, stats);
+        opt = new (allocator) arm64::InstructionSimplifierArm64(graph, codegen, stats);
+        break;
+#endif
+#ifdef ART_ENABLE_CODEGEN_riscv64
+      case OptimizationPass::kCriticalNativeAbiFixupRiscv64:
+        DCHECK(alt_name == nullptr) << "arch-specific pass does not support alternative name";
+        opt = new (allocator) riscv64::CriticalNativeAbiFixupRiscv64(graph, stats);
         break;
 #endif
 #ifdef ART_ENABLE_CODEGEN_x86
@@ -313,8 +325,8 @@
         opt = new (allocator) x86::X86MemoryOperandGeneration(graph, codegen, stats);
         break;
       case OptimizationPass::kInstructionSimplifierX86:
-       opt = new (allocator) x86::InstructionSimplifierX86(graph, codegen, stats);
-       break;
+        opt = new (allocator) x86::InstructionSimplifierX86(graph, codegen, stats);
+        break;
 #endif
 #ifdef ART_ENABLE_CODEGEN_x86_64
       case OptimizationPass::kInstructionSimplifierX86_64:
diff --git a/compiler/optimizing/optimization.h b/compiler/optimizing/optimization.h
index 134e3cd..55aa8f9 100644
--- a/compiler/optimizing/optimization.h
+++ b/compiler/optimizing/optimization.h
@@ -67,7 +67,6 @@
 // field is preferred over a string lookup at places where performance matters.
 // TODO: generate this table and lookup methods below automatically?
 enum class OptimizationPass {
-  kAggressiveConstantFolding,
   kAggressiveInstructionSimplifier,
   kBoundsCheckElimination,
   kCHAGuardOptimization,
@@ -93,6 +92,9 @@
 #ifdef ART_ENABLE_CODEGEN_arm64
   kInstructionSimplifierArm64,
 #endif
+#ifdef ART_ENABLE_CODEGEN_riscv64
+  kCriticalNativeAbiFixupRiscv64,
+#endif
 #ifdef ART_ENABLE_CODEGEN_x86
   kPcRelativeFixupsX86,
   kInstructionSimplifierX86,
diff --git a/compiler/optimizing/optimizing_cfi_test.cc b/compiler/optimizing/optimizing_cfi_test.cc
index f12e748..9df4932 100644
--- a/compiler/optimizing/optimizing_cfi_test.cc
+++ b/compiler/optimizing/optimizing_cfi_test.cc
@@ -35,9 +35,6 @@
 
 namespace art HIDDEN {
 
-// Run the tests only on host.
-#ifndef ART_TARGET_ANDROID
-
 class OptimizingCFITest : public CFITest, public OptimizingUnitTestHelper {
  public:
   // Enable this flag to generate the expected outputs.
@@ -89,7 +86,7 @@
 
   void Finish() {
     code_gen_->GenerateFrameExit();
-    code_gen_->Finalize(&code_allocator_);
+    code_gen_->Finalize();
   }
 
   void Check(InstructionSet isa,
@@ -97,7 +94,7 @@
              const std::vector<uint8_t>& expected_asm,
              const std::vector<uint8_t>& expected_cfi) {
     // Get the outputs.
-    ArrayRef<const uint8_t> actual_asm = code_allocator_.GetMemory();
+    ArrayRef<const uint8_t> actual_asm = code_gen_->GetCode();
     Assembler* opt_asm = code_gen_->GetAssembler();
     ArrayRef<const uint8_t> actual_cfi(*(opt_asm->cfi().data()));
 
@@ -123,27 +120,9 @@
   }
 
  private:
-  class InternalCodeAllocator : public CodeAllocator {
-   public:
-    InternalCodeAllocator() {}
-
-    uint8_t* Allocate(size_t size) override {
-      memory_.resize(size);
-      return memory_.data();
-    }
-
-    ArrayRef<const uint8_t> GetMemory() const override { return ArrayRef<const uint8_t>(memory_); }
-
-   private:
-    std::vector<uint8_t> memory_;
-
-    DISALLOW_COPY_AND_ASSIGN(InternalCodeAllocator);
-  };
-
   HGraph* graph_;
   std::unique_ptr<CodeGenerator> code_gen_;
   ArenaVector<HBasicBlock*> blocks_;
-  InternalCodeAllocator code_allocator_;
 };
 
 #define TEST_ISA(isa)                                                 \
@@ -162,26 +141,15 @@
 #endif
 
 #ifdef ART_ENABLE_CODEGEN_arm64
-// Run the tests for ARM64 only with Baker read barriers, as the
+// Run the tests for ARM64 only if the Marking Register is reserved as the
 // expected generated code saves and restore X21 and X22 (instead of
 // X20 and X21), as X20 is used as Marking Register in the Baker read
 // barrier configuration, and as such is removed from the set of
 // callee-save registers in the ARM64 code generator of the Optimizing
 // compiler.
-//
-// We can't use compile-time macros for read-barrier as the introduction
-// of userfaultfd-GC has made it a runtime choice.
-TEST_F(OptimizingCFITest, kArm64) {
-  if (kUseBakerReadBarrier && gUseReadBarrier) {
-    std::vector<uint8_t> expected_asm(
-        expected_asm_kArm64,
-        expected_asm_kArm64 + arraysize(expected_asm_kArm64));
-    std::vector<uint8_t> expected_cfi(
-        expected_cfi_kArm64,
-        expected_cfi_kArm64 + arraysize(expected_cfi_kArm64));
-    TestImpl(InstructionSet::kArm64, "kArm64", expected_asm, expected_cfi);
-  }
-}
+#if defined(RESERVE_MARKING_REGISTER)
+TEST_ISA(kArm64)
+#endif
 #endif
 
 #ifdef ART_ENABLE_CODEGEN_x86
@@ -217,6 +185,4 @@
 }
 #endif
 
-#endif  // ART_TARGET_ANDROID
-
 }  // namespace art
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 00eb6e5..65e8e51 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -50,9 +50,10 @@
 #include "jni/quick/jni_compiler.h"
 #include "linker/linker_patch.h"
 #include "nodes.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "optimizing/write_barrier_elimination.h"
 #include "prepare_for_register_allocation.h"
+#include "profiling_info_builder.h"
 #include "reference_type_propagation.h"
 #include "register_allocator_linear_scan.h"
 #include "select_generator.h"
@@ -69,28 +70,6 @@
 static constexpr const char* kPassNameSeparator = "$";
 
 /**
- * Used by the code generator, to allocate the code in a vector.
- */
-class CodeVectorAllocator final : public CodeAllocator {
- public:
-  explicit CodeVectorAllocator(ArenaAllocator* allocator)
-      : memory_(allocator->Adapter(kArenaAllocCodeBuffer)) {}
-
-  uint8_t* Allocate(size_t size) override {
-    memory_.resize(size);
-    return &memory_[0];
-  }
-
-  ArrayRef<const uint8_t> GetMemory() const override { return ArrayRef<const uint8_t>(memory_); }
-  uint8_t* GetData() { return memory_.data(); }
-
- private:
-  ArenaVector<uint8_t> memory_;
-
-  DISALLOW_COPY_AND_ASSIGN(CodeVectorAllocator);
-};
-
-/**
  * Filter to apply to the visualizer. Methods whose name contain that filter will
  * be dumped.
  */
@@ -361,7 +340,6 @@
 
   // Create a 'CompiledMethod' for an optimized graph.
   CompiledMethod* Emit(ArenaAllocator* allocator,
-                       CodeVectorAllocator* code_allocator,
                        CodeGenerator* codegen,
                        bool is_intrinsic,
                        const dex::CodeItem* item) const;
@@ -372,10 +350,8 @@
   // 1) Builds the graph. Returns null if it failed to build it.
   // 2) Transforms the graph to SSA. Returns null if it failed.
   // 3) Runs optimizations on the graph, including register allocator.
-  // 4) Generates code with the `code_allocator` provided.
   CodeGenerator* TryCompile(ArenaAllocator* allocator,
                             ArenaStack* arena_stack,
-                            CodeVectorAllocator* code_allocator,
                             const DexCompilationUnit& dex_compilation_unit,
                             ArtMethod* method,
                             CompilationKind compilation_kind,
@@ -383,7 +359,6 @@
 
   CodeGenerator* TryCompileIntrinsic(ArenaAllocator* allocator,
                                      ArenaStack* arena_stack,
-                                     CodeVectorAllocator* code_allocator,
                                      const DexCompilationUnit& dex_compilation_unit,
                                      ArtMethod* method,
                                      VariableSizedHandleScope* handles) const;
@@ -393,10 +368,10 @@
                             const DexCompilationUnit& dex_compilation_unit,
                             PassObserver* pass_observer) const;
 
-  bool RunBaselineOptimizations(HGraph* graph,
-                                CodeGenerator* codegen,
-                                const DexCompilationUnit& dex_compilation_unit,
-                                PassObserver* pass_observer) const;
+  bool RunRequiredPasses(HGraph* graph,
+                         CodeGenerator* codegen,
+                         const DexCompilationUnit& dex_compilation_unit,
+                         PassObserver* pass_observer) const;
 
   std::vector<uint8_t> GenerateJitDebugInfo(const debug::MethodDebugInfo& method_debug_info);
 
@@ -440,36 +415,45 @@
   std::string isa_string =
       std::string("isa:") + GetInstructionSetString(features->GetInstructionSet());
   std::string features_string = "isa_features:" + features->GetFeatureString();
+  std::string read_barrier_type = "none";
+  if (compiler_options.EmitReadBarrier()) {
+    if (art::kUseBakerReadBarrier)
+      read_barrier_type = "baker";
+    else if (art::kUseTableLookupReadBarrier)
+      read_barrier_type = "tablelookup";
+  }
+  std::string read_barrier_string = ART_FORMAT("read_barrier_type:{}", read_barrier_type);
   // It is assumed that visualizer_output_ is empty when calling this function, hence the fake
   // compilation block containing the ISA features will be printed at the beginning of the .cfg
   // file.
-  *visualizer_output_
-      << HGraphVisualizer::InsertMetaDataAsCompilationBlock(isa_string + ' ' + features_string);
+  *visualizer_output_ << HGraphVisualizer::InsertMetaDataAsCompilationBlock(
+      isa_string + ' ' + features_string + ' ' + read_barrier_string);
 }
 
-bool OptimizingCompiler::CanCompileMethod(uint32_t method_idx ATTRIBUTE_UNUSED,
-                                          const DexFile& dex_file ATTRIBUTE_UNUSED) const {
+bool OptimizingCompiler::CanCompileMethod([[maybe_unused]] uint32_t method_idx,
+                                          [[maybe_unused]] const DexFile& dex_file) const {
   return true;
 }
 
 static bool IsInstructionSetSupported(InstructionSet instruction_set) {
-  return instruction_set == InstructionSet::kArm
-      || instruction_set == InstructionSet::kArm64
-      || instruction_set == InstructionSet::kThumb2
-      || instruction_set == InstructionSet::kX86
-      || instruction_set == InstructionSet::kX86_64;
+  return instruction_set == InstructionSet::kArm ||
+         instruction_set == InstructionSet::kArm64 ||
+         instruction_set == InstructionSet::kThumb2 ||
+         instruction_set == InstructionSet::kRiscv64 ||
+         instruction_set == InstructionSet::kX86 ||
+         instruction_set == InstructionSet::kX86_64;
 }
 
-bool OptimizingCompiler::RunBaselineOptimizations(HGraph* graph,
-                                                  CodeGenerator* codegen,
-                                                  const DexCompilationUnit& dex_compilation_unit,
-                                                  PassObserver* pass_observer) const {
+bool OptimizingCompiler::RunRequiredPasses(HGraph* graph,
+                                           CodeGenerator* codegen,
+                                           const DexCompilationUnit& dex_compilation_unit,
+                                           PassObserver* pass_observer) const {
   switch (codegen->GetCompilerOptions().GetInstructionSet()) {
 #if defined(ART_ENABLE_CODEGEN_arm)
     case InstructionSet::kThumb2:
     case InstructionSet::kArm: {
       OptimizationDef arm_optimizations[] = {
-        OptDef(OptimizationPass::kCriticalNativeAbiFixupArm),
+          OptDef(OptimizationPass::kCriticalNativeAbiFixupArm),
       };
       return RunOptimizations(graph,
                               codegen,
@@ -478,10 +462,22 @@
                               arm_optimizations);
     }
 #endif
+#if defined(ART_ENABLE_CODEGEN_riscv64)
+    case InstructionSet::kRiscv64: {
+      OptimizationDef riscv64_optimizations[] = {
+          OptDef(OptimizationPass::kCriticalNativeAbiFixupRiscv64),
+      };
+      return RunOptimizations(graph,
+                              codegen,
+                              dex_compilation_unit,
+                              pass_observer,
+                              riscv64_optimizations);
+    }
+#endif
 #ifdef ART_ENABLE_CODEGEN_x86
     case InstructionSet::kX86: {
       OptimizationDef x86_optimizations[] = {
-        OptDef(OptimizationPass::kPcRelativeFixupsX86),
+          OptDef(OptimizationPass::kPcRelativeFixupsX86),
       };
       return RunOptimizations(graph,
                               codegen,
@@ -508,11 +504,11 @@
     case InstructionSet::kThumb2:
     case InstructionSet::kArm: {
       OptimizationDef arm_optimizations[] = {
-        OptDef(OptimizationPass::kInstructionSimplifierArm),
-        OptDef(OptimizationPass::kSideEffectsAnalysis),
-        OptDef(OptimizationPass::kGlobalValueNumbering, "GVN$after_arch"),
-        OptDef(OptimizationPass::kCriticalNativeAbiFixupArm),
-        OptDef(OptimizationPass::kScheduling)
+          OptDef(OptimizationPass::kInstructionSimplifierArm),
+          OptDef(OptimizationPass::kSideEffectsAnalysis),
+          OptDef(OptimizationPass::kGlobalValueNumbering, "GVN$after_arch"),
+          OptDef(OptimizationPass::kCriticalNativeAbiFixupArm),
+          OptDef(OptimizationPass::kScheduling)
       };
       return RunOptimizations(graph,
                               codegen,
@@ -524,10 +520,10 @@
 #ifdef ART_ENABLE_CODEGEN_arm64
     case InstructionSet::kArm64: {
       OptimizationDef arm64_optimizations[] = {
-        OptDef(OptimizationPass::kInstructionSimplifierArm64),
-        OptDef(OptimizationPass::kSideEffectsAnalysis),
-        OptDef(OptimizationPass::kGlobalValueNumbering, "GVN$after_arch"),
-        OptDef(OptimizationPass::kScheduling)
+          OptDef(OptimizationPass::kInstructionSimplifierArm64),
+          OptDef(OptimizationPass::kSideEffectsAnalysis),
+          OptDef(OptimizationPass::kGlobalValueNumbering, "GVN$after_arch"),
+          OptDef(OptimizationPass::kScheduling)
       };
       return RunOptimizations(graph,
                               codegen,
@@ -536,14 +532,28 @@
                               arm64_optimizations);
     }
 #endif
+#if defined(ART_ENABLE_CODEGEN_riscv64)
+    case InstructionSet::kRiscv64: {
+      OptimizationDef riscv64_optimizations[] = {
+          OptDef(OptimizationPass::kSideEffectsAnalysis),
+          OptDef(OptimizationPass::kGlobalValueNumbering, "GVN$after_arch"),
+          OptDef(OptimizationPass::kCriticalNativeAbiFixupRiscv64)
+      };
+      return RunOptimizations(graph,
+                              codegen,
+                              dex_compilation_unit,
+                              pass_observer,
+                              riscv64_optimizations);
+    }
+#endif
 #ifdef ART_ENABLE_CODEGEN_x86
     case InstructionSet::kX86: {
       OptimizationDef x86_optimizations[] = {
-        OptDef(OptimizationPass::kInstructionSimplifierX86),
-        OptDef(OptimizationPass::kSideEffectsAnalysis),
-        OptDef(OptimizationPass::kGlobalValueNumbering, "GVN$after_arch"),
-        OptDef(OptimizationPass::kPcRelativeFixupsX86),
-        OptDef(OptimizationPass::kX86MemoryOperandGeneration)
+          OptDef(OptimizationPass::kInstructionSimplifierX86),
+          OptDef(OptimizationPass::kSideEffectsAnalysis),
+          OptDef(OptimizationPass::kGlobalValueNumbering, "GVN$after_arch"),
+          OptDef(OptimizationPass::kPcRelativeFixupsX86),
+          OptDef(OptimizationPass::kX86MemoryOperandGeneration)
       };
       return RunOptimizations(graph,
                               codegen,
@@ -555,10 +565,10 @@
 #ifdef ART_ENABLE_CODEGEN_x86_64
     case InstructionSet::kX86_64: {
       OptimizationDef x86_64_optimizations[] = {
-        OptDef(OptimizationPass::kInstructionSimplifierX86_64),
-        OptDef(OptimizationPass::kSideEffectsAnalysis),
-        OptDef(OptimizationPass::kGlobalValueNumbering, "GVN$after_arch"),
-        OptDef(OptimizationPass::kX86MemoryOperandGeneration)
+          OptDef(OptimizationPass::kInstructionSimplifierX86_64),
+          OptDef(OptimizationPass::kSideEffectsAnalysis),
+          OptDef(OptimizationPass::kGlobalValueNumbering, "GVN$after_arch"),
+          OptDef(OptimizationPass::kX86MemoryOperandGeneration)
       };
       return RunOptimizations(graph,
                               codegen,
@@ -633,68 +643,68 @@
   }
 
   OptimizationDef optimizations[] = {
-    // Initial optimizations.
-    OptDef(OptimizationPass::kConstantFolding),
-    OptDef(OptimizationPass::kInstructionSimplifier),
-    OptDef(OptimizationPass::kDeadCodeElimination,
-           "dead_code_elimination$initial"),
-    // Inlining.
-    OptDef(OptimizationPass::kInliner),
-    // Simplification (if inlining occurred, or if we analyzed the invoke as "always throwing").
-    OptDef(OptimizationPass::kConstantFolding,
-           "constant_folding$after_inlining",
-           OptimizationPass::kInliner),
-    OptDef(OptimizationPass::kInstructionSimplifier,
-           "instruction_simplifier$after_inlining",
-           OptimizationPass::kInliner),
-    OptDef(OptimizationPass::kDeadCodeElimination,
-           "dead_code_elimination$after_inlining",
-           OptimizationPass::kInliner),
-    // GVN.
-    OptDef(OptimizationPass::kSideEffectsAnalysis,
-           "side_effects$before_gvn"),
-    OptDef(OptimizationPass::kGlobalValueNumbering),
-    // Simplification (TODO: only if GVN occurred).
-    OptDef(OptimizationPass::kSelectGenerator),
-    OptDef(OptimizationPass::kAggressiveConstantFolding,
-           "constant_folding$after_gvn"),
-    OptDef(OptimizationPass::kInstructionSimplifier,
-           "instruction_simplifier$after_gvn"),
-    OptDef(OptimizationPass::kDeadCodeElimination,
-           "dead_code_elimination$after_gvn"),
-    // High-level optimizations.
-    OptDef(OptimizationPass::kSideEffectsAnalysis,
-           "side_effects$before_licm"),
-    OptDef(OptimizationPass::kInvariantCodeMotion),
-    OptDef(OptimizationPass::kInductionVarAnalysis),
-    OptDef(OptimizationPass::kBoundsCheckElimination),
-    OptDef(OptimizationPass::kLoopOptimization),
-    // Simplification.
-    OptDef(OptimizationPass::kConstantFolding,
-           "constant_folding$after_loop_opt"),
-    OptDef(OptimizationPass::kAggressiveInstructionSimplifier,
-           "instruction_simplifier$after_loop_opt"),
-    OptDef(OptimizationPass::kDeadCodeElimination,
-           "dead_code_elimination$after_loop_opt"),
-    // Other high-level optimizations.
-    OptDef(OptimizationPass::kLoadStoreElimination),
-    OptDef(OptimizationPass::kCHAGuardOptimization),
-    OptDef(OptimizationPass::kCodeSinking),
-    // Simplification.
-    OptDef(OptimizationPass::kConstantFolding,
-           "constant_folding$before_codegen"),
-    // The codegen has a few assumptions that only the instruction simplifier
-    // can satisfy. For example, the code generator does not expect to see a
-    // HTypeConversion from a type to the same type.
-    OptDef(OptimizationPass::kAggressiveInstructionSimplifier,
-           "instruction_simplifier$before_codegen"),
-    // Simplification may result in dead code that should be removed prior to
-    // code generation.
-    OptDef(OptimizationPass::kDeadCodeElimination,
-           "dead_code_elimination$before_codegen"),
-    // Eliminate constructor fences after code sinking to avoid
-    // complicated sinking logic to split a fence with many inputs.
-    OptDef(OptimizationPass::kConstructorFenceRedundancyElimination)
+      // Initial optimizations.
+      OptDef(OptimizationPass::kConstantFolding),
+      OptDef(OptimizationPass::kInstructionSimplifier),
+      OptDef(OptimizationPass::kDeadCodeElimination,
+             "dead_code_elimination$initial"),
+      // Inlining.
+      OptDef(OptimizationPass::kInliner),
+      // Simplification (if inlining occurred, or if we analyzed the invoke as "always throwing").
+      OptDef(OptimizationPass::kConstantFolding,
+             "constant_folding$after_inlining",
+             OptimizationPass::kInliner),
+      OptDef(OptimizationPass::kInstructionSimplifier,
+             "instruction_simplifier$after_inlining",
+             OptimizationPass::kInliner),
+      OptDef(OptimizationPass::kDeadCodeElimination,
+             "dead_code_elimination$after_inlining",
+             OptimizationPass::kInliner),
+      // GVN.
+      OptDef(OptimizationPass::kSideEffectsAnalysis,
+             "side_effects$before_gvn"),
+      OptDef(OptimizationPass::kGlobalValueNumbering),
+      // Simplification (TODO: only if GVN occurred).
+      OptDef(OptimizationPass::kSelectGenerator),
+      OptDef(OptimizationPass::kConstantFolding,
+             "constant_folding$after_gvn"),
+      OptDef(OptimizationPass::kInstructionSimplifier,
+             "instruction_simplifier$after_gvn"),
+      OptDef(OptimizationPass::kDeadCodeElimination,
+             "dead_code_elimination$after_gvn"),
+      // High-level optimizations.
+      OptDef(OptimizationPass::kSideEffectsAnalysis,
+             "side_effects$before_licm"),
+      OptDef(OptimizationPass::kInvariantCodeMotion),
+      OptDef(OptimizationPass::kInductionVarAnalysis),
+      OptDef(OptimizationPass::kBoundsCheckElimination),
+      OptDef(OptimizationPass::kLoopOptimization),
+      // Simplification.
+      OptDef(OptimizationPass::kConstantFolding,
+             "constant_folding$after_loop_opt"),
+      OptDef(OptimizationPass::kAggressiveInstructionSimplifier,
+             "instruction_simplifier$after_loop_opt"),
+      OptDef(OptimizationPass::kDeadCodeElimination,
+             "dead_code_elimination$after_loop_opt"),
+      // Other high-level optimizations.
+      OptDef(OptimizationPass::kLoadStoreElimination),
+      OptDef(OptimizationPass::kCHAGuardOptimization),
+      OptDef(OptimizationPass::kCodeSinking),
+      // Simplification.
+      OptDef(OptimizationPass::kConstantFolding,
+             "constant_folding$before_codegen"),
+      // The codegen has a few assumptions that only the instruction simplifier
+      // can satisfy. For example, the code generator does not expect to see a
+      // HTypeConversion from a type to the same type.
+      OptDef(OptimizationPass::kAggressiveInstructionSimplifier,
+             "instruction_simplifier$before_codegen"),
+      // Simplification may result in dead code that should be removed prior to
+      // code generation.
+      OptDef(OptimizationPass::kDeadCodeElimination,
+             "dead_code_elimination$before_codegen"),
+      // Eliminate constructor fences after code sinking to avoid
+      // complicated sinking logic to split a fence with many inputs.
+      OptDef(OptimizationPass::kConstructorFenceRedundancyElimination)
   };
   RunOptimizations(graph,
                    codegen,
@@ -719,7 +729,6 @@
 }
 
 CompiledMethod* OptimizingCompiler::Emit(ArenaAllocator* allocator,
-                                         CodeVectorAllocator* code_allocator,
                                          CodeGenerator* codegen,
                                          bool is_intrinsic,
                                          const dex::CodeItem* code_item_for_osr_check) const {
@@ -729,7 +738,7 @@
   CompiledCodeStorage* storage = GetCompiledCodeStorage();
   CompiledMethod* compiled_method = storage->CreateCompiledMethod(
       codegen->GetInstructionSet(),
-      code_allocator->GetMemory(),
+      codegen->GetCode(),
       ArrayRef<const uint8_t>(stack_map),
       ArrayRef<const uint8_t>(*codegen->GetAssembler()->cfi().data()),
       ArrayRef<const linker::LinkerPatch>(linker_patches),
@@ -749,7 +758,6 @@
 
 CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* allocator,
                                               ArenaStack* arena_stack,
-                                              CodeVectorAllocator* code_allocator,
                                               const DexCompilationUnit& dex_compilation_unit,
                                               ArtMethod* method,
                                               CompilationKind compilation_kind,
@@ -828,8 +836,6 @@
   jit::Jit* jit = Runtime::Current()->GetJit();
   if (jit != nullptr) {
     ProfilingInfo* info = jit->GetCodeCache()->GetProfilingInfo(method, Thread::Current());
-    DCHECK_IMPLIES(compilation_kind == CompilationKind::kBaseline, info != nullptr)
-        << "Compiling a method baseline should always have a ProfilingInfo";
     graph->SetProfilingInfo(info);
   }
 
@@ -898,14 +904,33 @@
     }
   }
 
-  if (compilation_kind == CompilationKind::kBaseline) {
-    RunBaselineOptimizations(graph, codegen.get(), dex_compilation_unit, &pass_observer);
+  if (compilation_kind == CompilationKind::kBaseline && compiler_options.ProfileBranches()) {
+    graph->SetUsefulOptimizing();
+    // Branch profiling currently doesn't support running optimizations.
+    RunRequiredPasses(graph, codegen.get(), dex_compilation_unit, &pass_observer);
   } else {
     RunOptimizations(graph, codegen.get(), dex_compilation_unit, &pass_observer);
     PassScope scope(WriteBarrierElimination::kWBEPassName, &pass_observer);
     WriteBarrierElimination(graph, compilation_stats_.get()).Run();
   }
 
+  // If we are compiling baseline and we haven't created a profiling info for
+  // this method already, do it now.
+  if (jit != nullptr &&
+      compilation_kind == CompilationKind::kBaseline &&
+      graph->IsUsefulOptimizing() &&
+      graph->GetProfilingInfo() == nullptr) {
+    ProfilingInfoBuilder(
+        graph, codegen->GetCompilerOptions(), codegen.get(), compilation_stats_.get()).Run();
+    // We expect a profiling info to be created and attached to the graph.
+    // However, we may have run out of memory trying to create it, so in this
+    // case just abort the compilation.
+    if (graph->GetProfilingInfo() == nullptr) {
+      MaybeRecordStat(compilation_stats_.get(), MethodCompilationStat::kJitOutOfMemoryForCommit);
+      return nullptr;
+    }
+  }
+
   RegisterAllocator::Strategy regalloc_strategy =
     compiler_options.GetRegisterAllocationStrategy();
   AllocateRegisters(graph,
@@ -914,7 +939,15 @@
                     regalloc_strategy,
                     compilation_stats_.get());
 
-  codegen->Compile(code_allocator);
+  if (UNLIKELY(codegen->GetFrameSize() > codegen->GetMaximumFrameSize())) {
+    LOG(WARNING) << "Stack frame size is " << codegen->GetFrameSize()
+                 << " which is larger than the maximum of " << codegen->GetMaximumFrameSize()
+                 << " bytes. Method: " << graph->PrettyMethod();
+    MaybeRecordStat(compilation_stats_.get(), MethodCompilationStat::kNotCompiledFrameTooBig);
+    return nullptr;
+  }
+
+  codegen->Compile();
   pass_observer.DumpDisassembly();
 
   MaybeRecordStat(compilation_stats_.get(), MethodCompilationStat::kCompiledBytecode);
@@ -924,7 +957,6 @@
 CodeGenerator* OptimizingCompiler::TryCompileIntrinsic(
     ArenaAllocator* allocator,
     ArenaStack* arena_stack,
-    CodeVectorAllocator* code_allocator,
     const DexCompilationUnit& dex_compilation_unit,
     ArtMethod* method,
     VariableSizedHandleScope* handles) const {
@@ -986,9 +1018,9 @@
   }
 
   OptimizationDef optimizations[] = {
-    // The codegen has a few assumptions that only the instruction simplifier
-    // can satisfy.
-    OptDef(OptimizationPass::kInstructionSimplifier),
+      // The codegen has a few assumptions that only the instruction simplifier
+      // can satisfy.
+      OptDef(OptimizationPass::kInstructionSimplifier),
   };
   RunOptimizations(graph,
                    codegen.get(),
@@ -1013,7 +1045,8 @@
     return nullptr;
   }
 
-  codegen->Compile(code_allocator);
+  CHECK_LE(codegen->GetFrameSize(), codegen->GetMaximumFrameSize());
+  codegen->Compile();
   pass_observer.DumpDisassembly();
 
   VLOG(compiler) << "Compiled intrinsic: " << method->GetIntrinsic()
@@ -1037,7 +1070,6 @@
   DCHECK(runtime->IsAotCompiler());
   ArenaAllocator allocator(runtime->GetArenaPool());
   ArenaStack arena_stack(runtime->GetArenaPool());
-  CodeVectorAllocator code_allocator(&allocator);
   std::unique_ptr<CodeGenerator> codegen;
   bool compiled_intrinsic = false;
   {
@@ -1071,7 +1103,6 @@
       codegen.reset(
           TryCompileIntrinsic(&allocator,
                               &arena_stack,
-                              &code_allocator,
                               dex_compilation_unit,
                               method,
                               &handles));
@@ -1083,7 +1114,6 @@
       codegen.reset(
           TryCompile(&allocator,
                      &arena_stack,
-                     &code_allocator,
                      dex_compilation_unit,
                      method,
                      compiler_options.IsBaseline()
@@ -1094,7 +1124,6 @@
   }
   if (codegen.get() != nullptr) {
     compiled_method = Emit(&allocator,
-                           &code_allocator,
                            codegen.get(),
                            compiled_intrinsic,
                            compiled_intrinsic ? nullptr : code_item);
@@ -1177,19 +1206,16 @@
           /*verified_method=*/ nullptr,
           dex_cache,
           compiling_class);
-      CodeVectorAllocator code_allocator(&allocator);
       // Go to native so that we don't block GC during compilation.
       ScopedThreadSuspension sts(soa.Self(), ThreadState::kNative);
       std::unique_ptr<CodeGenerator> codegen(
           TryCompileIntrinsic(&allocator,
                               &arena_stack,
-                              &code_allocator,
                               dex_compilation_unit,
                               method,
                               &handles));
       if (codegen != nullptr) {
         return Emit(&allocator,
-                    &code_allocator,
                     codegen.get(),
                     /*is_intrinsic=*/ true,
                     /*item=*/ nullptr);
@@ -1221,7 +1247,7 @@
   return new OptimizingCompiler(compiler_options, storage);
 }
 
-bool EncodeArtMethodInInlineInfo(ArtMethod* method ATTRIBUTE_UNUSED) {
+bool EncodeArtMethodInInlineInfo([[maybe_unused]] ArtMethod* method) {
   // Note: the runtime is null only for unit testing.
   return Runtime::Current() == nullptr || !Runtime::Current()->IsAotCompiler();
 }
@@ -1328,7 +1354,6 @@
                             debug_info,
                             /* is_full_debug_info= */ compiler_options.GetGenerateDebugInfo(),
                             compilation_kind,
-                            /* has_should_deoptimize_flag= */ false,
                             cha_single_implementation_list)) {
       code_cache->Free(self, region, reserved_code.data(), reserved_data.data());
       return false;
@@ -1342,7 +1367,6 @@
   }
 
   ArenaStack arena_stack(runtime->GetJitArenaPool());
-  CodeVectorAllocator code_allocator(&allocator);
   VariableSizedHandleScope handles(self);
 
   std::unique_ptr<CodeGenerator> codegen;
@@ -1365,7 +1389,6 @@
     codegen.reset(
         TryCompile(&allocator,
                    &arena_stack,
-                   &code_allocator,
                    dex_compilation_unit,
                    method,
                    compilation_kind,
@@ -1381,7 +1404,7 @@
   ArrayRef<const uint8_t> reserved_data;
   if (!code_cache->Reserve(self,
                            region,
-                           code_allocator.GetMemory().size(),
+                           codegen->GetAssembler()->CodeSize(),
                            stack_map.size(),
                            /*number_of_roots=*/codegen->GetNumberOfJitRoots(),
                            method,
@@ -1394,7 +1417,9 @@
   const uint8_t* roots_data = reserved_data.data();
 
   std::vector<Handle<mirror::Object>> roots;
-  codegen->EmitJitRoots(code_allocator.GetData(), roots_data, &roots);
+  codegen->EmitJitRoots(const_cast<uint8_t*>(codegen->GetAssembler()->CodeBufferBaseAddress()),
+                        roots_data,
+                        &roots);
   // The root Handle<>s filled by the codegen reference entries in the VariableSizedHandleScope.
   DCHECK(std::all_of(roots.begin(),
                      roots.end(),
@@ -1418,33 +1443,39 @@
     info.is_optimized = true;
     info.is_code_address_text_relative = false;
     info.code_address = reinterpret_cast<uintptr_t>(code);
-    info.code_size = code_allocator.GetMemory().size();
+    info.code_size = codegen->GetAssembler()->CodeSize(),
     info.frame_size_in_bytes = codegen->GetFrameSize();
     info.code_info = stack_map.size() == 0 ? nullptr : stack_map.data();
     info.cfi = ArrayRef<const uint8_t>(*codegen->GetAssembler()->cfi().data());
     debug_info = GenerateJitDebugInfo(info);
   }
 
+  if (compilation_kind == CompilationKind::kBaseline &&
+      !codegen->GetGraph()->IsUsefulOptimizing()) {
+    compilation_kind = CompilationKind::kOptimized;
+  }
+
   if (!code_cache->Commit(self,
                           region,
                           method,
                           reserved_code,
-                          code_allocator.GetMemory(),
+                          codegen->GetCode(),
                           reserved_data,
                           roots,
                           ArrayRef<const uint8_t>(stack_map),
                           debug_info,
                           /* is_full_debug_info= */ compiler_options.GetGenerateDebugInfo(),
                           compilation_kind,
-                          codegen->GetGraph()->HasShouldDeoptimizeFlag(),
                           codegen->GetGraph()->GetCHASingleImplementationList())) {
+    CHECK_EQ(CodeInfo::HasShouldDeoptimizeFlag(stack_map.data()),
+             codegen->GetGraph()->HasShouldDeoptimizeFlag());
     code_cache->Free(self, region, reserved_code.data(), reserved_data.data());
     return false;
   }
 
   Runtime::Current()->GetJit()->AddMemoryUsage(method, allocator.BytesUsed());
   if (jit_logger != nullptr) {
-    jit_logger->WriteLog(code, code_allocator.GetMemory().size(), method);
+    jit_logger->WriteLog(code, codegen->GetAssembler()->CodeSize(), method);
   }
 
   if (kArenaAllocatorCountAllocations) {
diff --git a/compiler/optimizing/optimizing_compiler_stats.h b/compiler/optimizing/optimizing_compiler_stats.h
index a1d0a5a..22c43fc 100644
--- a/compiler/optimizing/optimizing_compiler_stats.h
+++ b/compiler/optimizing/optimizing_compiler_stats.h
@@ -47,8 +47,12 @@
   kUnresolvedFieldNotAFastAccess,
   kRemovedCheckedCast,
   kRemovedDeadInstruction,
+  kRemovedDeadPhi,
   kRemovedTry,
   kRemovedNullCheck,
+  kRemovedVolatileLoad,
+  kRemovedVolatileStore,
+  kRemovedMonitorOp,
   kNotCompiledSkipped,
   kNotCompiledInvalidBytecode,
   kNotCompiledThrowCatchLoop,
@@ -64,6 +68,7 @@
   kNotCompiledInliningIrreducibleLoop,
   kNotCompiledIrreducibleLoopAndStringInit,
   kNotCompiledPhiEquivalentInOsr,
+  kNotCompiledFrameTooBig,
   kInlinedMonomorphicCall,
   kInlinedPolymorphicCall,
   kMonomorphicCall,
@@ -130,8 +135,6 @@
   kPartialLSEPossible,
   kPartialStoreRemoved,
   kPartialAllocationMoved,
-  kPredicatedLoadAdded,
-  kPredicatedStoreAdded,
   kDevirtualized,
   kLastStat
 };
diff --git a/compiler/optimizing/optimizing_unit_test.h b/compiler/optimizing/optimizing_unit_test.h
index 2e05c41..8729763 100644
--- a/compiler/optimizing/optimizing_unit_test.h
+++ b/compiler/optimizing/optimizing_unit_test.h
@@ -164,9 +164,7 @@
       HBasicBlock* dest_blk = name_to_block_.GetOrCreate(dest, create_block);
       src_blk->AddSuccessor(dest_blk);
     }
-    graph_->ClearReachabilityInformation();
     graph_->ComputeDominanceInformation();
-    graph_->ComputeReachabilityInformation();
     for (auto [name, blk] : name_to_block_) {
       block_to_name_.Put(blk, name);
     }
@@ -244,7 +242,6 @@
     auto container =
         std::make_shared<MemoryDexFileContainer>(dex_data, sizeof(StandardDexFile::Header));
     dex_files_.emplace_back(new StandardDexFile(dex_data,
-                                                sizeof(StandardDexFile::Header),
                                                 "no_location",
                                                 /*location_checksum*/ 0,
                                                 /*oat_dex_file*/ nullptr,
diff --git a/compiler/optimizing/parallel_move_test.cc b/compiler/optimizing/parallel_move_test.cc
index a1c05e9..d2b9932 100644
--- a/compiler/optimizing/parallel_move_test.cc
+++ b/compiler/optimizing/parallel_move_test.cc
@@ -81,8 +81,8 @@
     message_ << ")";
   }
 
-  void SpillScratch(int reg ATTRIBUTE_UNUSED) override {}
-  void RestoreScratch(int reg ATTRIBUTE_UNUSED) override {}
+  void SpillScratch([[maybe_unused]] int reg) override {}
+  void RestoreScratch([[maybe_unused]] int reg) override {}
 
   std::string GetMessage() const {
     return  message_.str();
@@ -126,7 +126,7 @@
     return scratch;
   }
 
-  void FreeScratchLocation(Location loc ATTRIBUTE_UNUSED) override {}
+  void FreeScratchLocation([[maybe_unused]] Location loc) override {}
 
   void EmitMove(size_t index) override {
     MoveOperands* move = moves_[index];
diff --git a/compiler/optimizing/pc_relative_fixups_x86.cc b/compiler/optimizing/pc_relative_fixups_x86.cc
index d3da3d3..c2d5ec7 100644
--- a/compiler/optimizing/pc_relative_fixups_x86.cc
+++ b/compiler/optimizing/pc_relative_fixups_x86.cc
@@ -62,7 +62,7 @@
   }
 
   void VisitReturn(HReturn* ret) override {
-    HConstant* value = ret->InputAt(0)->AsConstant();
+    HConstant* value = ret->InputAt(0)->AsConstantOrNull();
     if ((value != nullptr && DataType::IsFloatingPointType(value->GetType()))) {
       ReplaceInput(ret, value, 0, true);
     }
@@ -95,7 +95,7 @@
   }
 
   void BinaryFP(HBinaryOperation* bin) {
-    HConstant* rhs = bin->InputAt(1)->AsConstant();
+    HConstant* rhs = bin->InputAt(1)->AsConstantOrNull();
     if (rhs != nullptr && DataType::IsFloatingPointType(rhs->GetType())) {
       ReplaceInput(bin, rhs, 1, false);
     }
@@ -193,7 +193,7 @@
   }
 
   void HandleInvoke(HInvoke* invoke) {
-    HInvokeStaticOrDirect* invoke_static_or_direct = invoke->AsInvokeStaticOrDirect();
+    HInvokeStaticOrDirect* invoke_static_or_direct = invoke->AsInvokeStaticOrDirectOrNull();
 
     // If this is an invoke-static/-direct with PC-relative addressing (within boot image
     // or using .bss or .data.bimg.rel.ro), we need the PC-relative address base.
@@ -207,7 +207,7 @@
       base_added = true;
     }
 
-    HInvokeInterface* invoke_interface = invoke->AsInvokeInterface();
+    HInvokeInterface* invoke_interface = invoke->AsInvokeInterfaceOrNull();
     if (invoke_interface != nullptr &&
         IsPcRelativeMethodLoadKind(invoke_interface->GetHiddenArgumentLoadKind())) {
       HX86ComputeBaseMethodAddress* method_address = GetPCRelativeBasePointer(invoke);
@@ -219,7 +219,7 @@
     // Ensure that we can load FP arguments from the constant area.
     HInputsRef inputs = invoke->GetInputs();
     for (size_t i = 0; i < inputs.size(); i++) {
-      HConstant* input = inputs[i]->AsConstant();
+      HConstant* input = inputs[i]->AsConstantOrNull();
       if (input != nullptr && DataType::IsFloatingPointType(input->GetType())) {
         ReplaceInput(invoke, input, i, true);
       }
@@ -235,6 +235,9 @@
         LOG(FATAL) << "Unreachable min/max/abs: intrinsics should have been lowered "
                       "to IR nodes by instruction simplifier";
         UNREACHABLE();
+      case Intrinsics::kByteValueOf:
+      case Intrinsics::kShortValueOf:
+      case Intrinsics::kCharacterValueOf:
       case Intrinsics::kIntegerValueOf:
         // This intrinsic can be call free if it loads the address of the boot image object.
         // If we're compiling PIC, we need the address base for loading from .data.bimg.rel.ro.
diff --git a/compiler/optimizing/prepare_for_register_allocation.cc b/compiler/optimizing/prepare_for_register_allocation.cc
index 398b10a..1e99732 100644
--- a/compiler/optimizing/prepare_for_register_allocation.cc
+++ b/compiler/optimizing/prepare_for_register_allocation.cc
@@ -180,6 +180,11 @@
     return false;
   }
 
+  if (GetGraph()->IsCompilingBaseline() && compiler_options_.ProfileBranches()) {
+    // To do branch profiling, we cannot emit conditions at use site.
+    return false;
+  }
+
   if (user->IsIf() || user->IsDeoptimize()) {
     return true;
   }
diff --git a/compiler/optimizing/prepare_for_register_allocation.h b/compiler/optimizing/prepare_for_register_allocation.h
index 0426f84..f53c8a1 100644
--- a/compiler/optimizing/prepare_for_register_allocation.h
+++ b/compiler/optimizing/prepare_for_register_allocation.h
@@ -30,7 +30,7 @@
  * For example it changes uses of null checks and bounds checks to the original
  * objects, to avoid creating a live range for these checks.
  */
-class PrepareForRegisterAllocation : public HGraphDelegateVisitor {
+class PrepareForRegisterAllocation final : public HGraphDelegateVisitor {
  public:
   PrepareForRegisterAllocation(HGraph* graph,
                                const CompilerOptions& compiler_options,
diff --git a/compiler/optimizing/profiling_info_builder.cc b/compiler/optimizing/profiling_info_builder.cc
new file mode 100644
index 0000000..7faf2bf
--- /dev/null
+++ b/compiler/optimizing/profiling_info_builder.cc
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "profiling_info_builder.h"
+
+#include "art_method-inl.h"
+#include "code_generator.h"
+#include "driver/compiler_options.h"
+#include "dex/code_item_accessors-inl.h"
+#include "inliner.h"
+#include "jit/profiling_info.h"
+#include "optimizing_compiler_stats.h"
+#include "scoped_thread_state_change-inl.h"
+
+namespace art HIDDEN {
+
+void ProfilingInfoBuilder::Run() {
+  DCHECK(GetGraph()->IsUsefulOptimizing());
+  DCHECK_EQ(GetGraph()->GetProfilingInfo(), nullptr);
+  // Order does not matter.
+  for (HBasicBlock* block : GetGraph()->GetReversePostOrder()) {
+    // No need to visit the phis.
+    VisitNonPhiInstructions(block);
+  }
+
+  ScopedObjectAccess soa(Thread::Current());
+  GetGraph()->SetProfilingInfo(
+      ProfilingInfo::Create(soa.Self(), GetGraph()->GetArtMethod(), inline_caches_));
+}
+
+
+uint32_t ProfilingInfoBuilder::EncodeInlinedDexPc(const HInliner* inliner,
+                                                  const CompilerOptions& compiler_options,
+                                                  HInvoke* invoke) {
+  DCHECK(inliner->GetCallerEnvironment() != nullptr);
+  DCHECK(inliner->GetParent() != nullptr);
+  std::vector<uint32_t> temp_vector;
+  temp_vector.push_back(invoke->GetDexPc());
+  while (inliner->GetCallerEnvironment() != nullptr) {
+    temp_vector.push_back(inliner->GetCallerEnvironment()->GetDexPc());
+    inliner = inliner->GetParent();
+  }
+
+  DCHECK_EQ(inliner->GetOutermostGraph(), inliner->GetGraph());
+  return InlineCache::EncodeDexPc(
+      inliner->GetOutermostGraph()->GetArtMethod(),
+      temp_vector,
+      compiler_options.GetInlineMaxCodeUnits());
+}
+
+static uint32_t EncodeDexPc(HInvoke* invoke, const CompilerOptions& compiler_options) {
+  std::vector<uint32_t> dex_pcs;
+  ArtMethod* outer_method = nullptr;
+  for (HEnvironment* environment = invoke->GetEnvironment();
+       environment != nullptr;
+       environment = environment->GetParent()) {
+    outer_method = environment->GetMethod();
+    dex_pcs.push_back(environment->GetDexPc());
+  }
+
+  ScopedObjectAccess soa(Thread::Current());
+  return InlineCache::EncodeDexPc(
+      outer_method,
+      dex_pcs,
+      compiler_options.GetInlineMaxCodeUnits());
+}
+
+void ProfilingInfoBuilder::HandleInvoke(HInvoke* invoke) {
+  if (IsInlineCacheUseful(invoke, codegen_)) {
+    uint32_t dex_pc = EncodeDexPc(invoke, compiler_options_);
+    if (dex_pc != kNoDexPc) {
+      inline_caches_.push_back(dex_pc);
+    } else {
+      ScopedObjectAccess soa(Thread::Current());
+      LOG(WARNING) << "Could not encode dex pc for "
+                   << invoke->GetResolvedMethod()->PrettyMethod();
+    }
+  }
+}
+
+void ProfilingInfoBuilder::VisitInvokeInterface(HInvokeInterface* invoke) {
+  HandleInvoke(invoke);
+}
+
+void ProfilingInfoBuilder::VisitInvokeVirtual(HInvokeVirtual* invoke) {
+  HandleInvoke(invoke);
+}
+
+bool ProfilingInfoBuilder::IsInlineCacheUseful(HInvoke* invoke, CodeGenerator* codegen) {
+  DCHECK(invoke->IsInvokeVirtual() || invoke->IsInvokeInterface());
+  if (codegen->IsImplementedIntrinsic(invoke)) {
+    return false;
+  }
+  if (!invoke->GetBlock()->GetGraph()->IsCompilingBaseline()) {
+    return false;
+  }
+  if (Runtime::Current()->IsAotCompiler()) {
+    return false;
+  }
+  if (invoke->InputAt(0)->GetReferenceTypeInfo().IsExact()) {
+    return false;
+  }
+  if (invoke->GetResolvedMethod() != nullptr) {
+    ScopedObjectAccess soa(Thread::Current());
+    if (invoke->GetResolvedMethod()->IsFinal() ||
+        invoke->GetResolvedMethod()->GetDeclaringClass()->IsFinal()) {
+      return false;
+    }
+  }
+
+  if (!codegen->GetGraph()->IsUsefulOptimizing()) {
+    // Earlier pass knew what the calling target was. No need for an inline
+    // cache.
+    return false;
+  }
+  return true;
+}
+
+InlineCache* ProfilingInfoBuilder::GetInlineCache(ProfilingInfo* info,
+                                                  const CompilerOptions& compiler_options,
+                                                  HInvoke* instruction) {
+  ScopedObjectAccess soa(Thread::Current());
+  uint32_t dex_pc = EncodeDexPc(instruction, compiler_options);
+  if (dex_pc == kNoDexPc) {
+    return nullptr;
+  }
+  return info->GetInlineCache(dex_pc);
+}
+
+}  // namespace art
diff --git a/compiler/optimizing/profiling_info_builder.h b/compiler/optimizing/profiling_info_builder.h
new file mode 100644
index 0000000..ca1c8dd
--- /dev/null
+++ b/compiler/optimizing/profiling_info_builder.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_COMPILER_OPTIMIZING_PROFILING_INFO_BUILDER_H_
+#define ART_COMPILER_OPTIMIZING_PROFILING_INFO_BUILDER_H_
+
+#include "base/macros.h"
+#include "nodes.h"
+
+namespace art HIDDEN {
+
+class CodeGenerator;
+class CompilerOptions;
+class HInliner;
+class InlineCache;
+class ProfilingInfo;
+
+class ProfilingInfoBuilder final : public HGraphDelegateVisitor {
+ public:
+  ProfilingInfoBuilder(HGraph* graph,
+                       const CompilerOptions& compiler_options,
+                       CodeGenerator* codegen,
+                       OptimizingCompilerStats* stats = nullptr)
+      : HGraphDelegateVisitor(graph, stats),
+        codegen_(codegen),
+        compiler_options_(compiler_options) {}
+
+  void Run();
+
+  static constexpr const char* kProfilingInfoBuilderPassName =
+      "profiling_info_builder";
+
+  static InlineCache* GetInlineCache(ProfilingInfo* info,
+                                     const CompilerOptions& compiler_options,
+                                     HInvoke* invoke);
+  static bool IsInlineCacheUseful(HInvoke* invoke, CodeGenerator* codegen);
+  static uint32_t EncodeInlinedDexPc(
+      const HInliner* inliner, const CompilerOptions& compiler_options, HInvoke* invoke)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+
+ private:
+  void VisitInvokeVirtual(HInvokeVirtual* invoke) override;
+  void VisitInvokeInterface(HInvokeInterface* invoke) override;
+
+  void HandleInvoke(HInvoke* invoke);
+
+  CodeGenerator* codegen_;
+  const CompilerOptions& compiler_options_;
+  std::vector<uint32_t> inline_caches_;
+
+  DISALLOW_COPY_AND_ASSIGN(ProfilingInfoBuilder);
+};
+
+}  // namespace art
+
+
+#endif  // ART_COMPILER_OPTIMIZING_PROFILING_INFO_BUILDER_H_
diff --git a/compiler/optimizing/reference_type_propagation.cc b/compiler/optimizing/reference_type_propagation.cc
index e288d80..91a6fd5 100644
--- a/compiler/optimizing/reference_type_propagation.cc
+++ b/compiler/optimizing/reference_type_propagation.cc
@@ -63,7 +63,6 @@
   void VisitLoadException(HLoadException* instr) override;
   void VisitNewArray(HNewArray* instr) override;
   void VisitParameterValue(HParameterValue* instr) override;
-  void VisitPredicatedInstanceFieldGet(HPredicatedInstanceFieldGet* instr) override;
   void VisitInstanceFieldGet(HInstanceFieldGet* instr) override;
   void VisitStaticFieldGet(HStaticFieldGet* instr) override;
   void VisitUnresolvedInstanceFieldGet(HUnresolvedInstanceFieldGet* instr) override;
@@ -254,7 +253,7 @@
   HInstruction* input_two = compare->InputAt(1);
   HLoadClass* load_class = input_one->IsLoadClass()
       ? input_one->AsLoadClass()
-      : input_two->AsLoadClass();
+      : input_two->AsLoadClassOrNull();
   if (load_class == nullptr) {
     return;
   }
@@ -266,7 +265,7 @@
   }
 
   HInstruction* field_get = (load_class == input_one) ? input_two : input_one;
-  if (!field_get->IsInstanceFieldGet() && !field_get->IsPredicatedInstanceFieldGet()) {
+  if (!field_get->IsInstanceFieldGet()) {
     return;
   }
   HInstruction* receiver = field_get->InputAt(0);
@@ -317,16 +316,11 @@
 
 void ReferenceTypePropagation::RTPVisitor::VisitBasicBlock(HBasicBlock* block) {
   // Handle Phis first as there might be instructions in the same block who depend on them.
-  for (HInstructionIterator it(block->GetPhis()); !it.Done(); it.Advance()) {
-    VisitPhi(it.Current()->AsPhi());
-  }
+  VisitPhis(block);
 
   // Handle instructions. Since RTP may add HBoundType instructions just after the
   // last visited instruction, use `HInstructionIteratorHandleChanges` iterator.
-  for (HInstructionIteratorHandleChanges it(block->GetInstructions()); !it.Done(); it.Advance()) {
-    HInstruction* instr = it.Current();
-    instr->Accept(this);
-  }
+  VisitNonPhiInstructions(block);
 
   // Add extra nodes to bound types.
   BoundTypeForIfNotNull(block);
@@ -335,7 +329,7 @@
 }
 
 void ReferenceTypePropagation::RTPVisitor::BoundTypeForIfNotNull(HBasicBlock* block) {
-  HIf* ifInstruction = block->GetLastInstruction()->AsIf();
+  HIf* ifInstruction = block->GetLastInstruction()->AsIfOrNull();
   if (ifInstruction == nullptr) {
     return;
   }
@@ -453,7 +447,7 @@
 // If that's the case insert an HBoundType instruction to bound the type of `x`
 // to `ClassX` in the scope of the dominated blocks.
 void ReferenceTypePropagation::RTPVisitor::BoundTypeForIfInstanceOf(HBasicBlock* block) {
-  HIf* ifInstruction = block->GetLastInstruction()->AsIf();
+  HIf* ifInstruction = block->GetLastInstruction()->AsIfOrNull();
   if (ifInstruction == nullptr) {
     return;
   }
@@ -587,11 +581,6 @@
   SetClassAsTypeInfo(instr, klass, /* is_exact= */ false);
 }
 
-void ReferenceTypePropagation::RTPVisitor::VisitPredicatedInstanceFieldGet(
-    HPredicatedInstanceFieldGet* instr) {
-  UpdateFieldAccessTypeInfo(instr, instr->GetFieldInfo());
-}
-
 void ReferenceTypePropagation::RTPVisitor::VisitInstanceFieldGet(HInstanceFieldGet* instr) {
   UpdateFieldAccessTypeInfo(instr, instr->GetFieldInfo());
 }
@@ -709,7 +698,7 @@
 }
 
 void ReferenceTypePropagation::RTPVisitor::VisitCheckCast(HCheckCast* check_cast) {
-  HBoundType* bound_type = check_cast->GetNext()->AsBoundType();
+  HBoundType* bound_type = check_cast->GetNext()->AsBoundTypeOrNull();
   if (bound_type == nullptr || bound_type->GetUpperBound().IsValid()) {
     // The next instruction is not an uninitialized BoundType. This must be
     // an RTP pass after SsaBuilder and we do not need to do anything.
diff --git a/compiler/optimizing/reference_type_propagation_test.cc b/compiler/optimizing/reference_type_propagation_test.cc
index 2b012fc..0e0acd1 100644
--- a/compiler/optimizing/reference_type_propagation_test.cc
+++ b/compiler/optimizing/reference_type_propagation_test.cc
@@ -425,8 +425,6 @@
   }
   auto vals = MakeTransformRange(succ_blocks, [&](HBasicBlock* blk) { return single_value[blk]; });
   std::vector<HInstruction*> ins(vals.begin(), vals.end());
-  graph_->ClearReachabilityInformation();
-  graph_->ComputeReachabilityInformation();
   mutator(ins);
   propagation_->Visit(ArrayRef<HInstruction* const>(ins));
   for (auto [blk, i] : single_value) {
@@ -468,7 +466,7 @@
   LoopOptions lo(GetParam());
   std::default_random_engine g(
       lo.initial_null_state_ != InitialNullState::kTrueRandom ? 42 : std::rand());
-  std::uniform_int_distribution<bool> uid(false, true);
+  std::uniform_int_distribution<int> uid(0, 1);
   RunVisitListTest([&](std::vector<HInstruction*>& lst, HInstruction* null_input) {
     auto pred_null = false;
     auto next_null = [&]() {
@@ -482,7 +480,7 @@
           return pred_null;
         case InitialNullState::kRandomSetSeed:
         case InitialNullState::kTrueRandom:
-          return uid(g);
+          return uid(g) > 0;
       }
     };
     HPhi* nulled_phi = lo.null_insertion_ >= 0 ? lst[lo.null_insertion_]->AsPhi() : nullptr;
diff --git a/compiler/optimizing/register_allocation_resolver.cc b/compiler/optimizing/register_allocation_resolver.cc
index 53e11f2..a4b1698 100644
--- a/compiler/optimizing/register_allocation_resolver.cc
+++ b/compiler/optimizing/register_allocation_resolver.cc
@@ -531,9 +531,9 @@
 
   HInstruction* previous = user->GetPrevious();
   HParallelMove* move = nullptr;
-  if (previous == nullptr
-      || !previous->IsParallelMove()
-      || previous->GetLifetimePosition() < user->GetLifetimePosition()) {
+  if (previous == nullptr ||
+      !previous->IsParallelMove() ||
+      previous->GetLifetimePosition() < user->GetLifetimePosition()) {
     move = new (allocator_) HParallelMove(allocator_);
     move->SetLifetimePosition(user->GetLifetimePosition());
     user->GetBlock()->InsertInstructionBefore(move, user);
@@ -593,7 +593,7 @@
   } else if (IsInstructionEnd(position)) {
     // Move must happen after the instruction.
     DCHECK(!at->IsControlFlow());
-    move = at->GetNext()->AsParallelMove();
+    move = at->GetNext()->AsParallelMoveOrNull();
     // This is a parallel move for connecting siblings in a same block. We need to
     // differentiate it with moves for connecting blocks, and input moves.
     if (move == nullptr || move->GetLifetimePosition() > position) {
@@ -604,15 +604,15 @@
   } else {
     // Move must happen before the instruction.
     HInstruction* previous = at->GetPrevious();
-    if (previous == nullptr
-        || !previous->IsParallelMove()
-        || previous->GetLifetimePosition() != position) {
+    if (previous == nullptr ||
+        !previous->IsParallelMove() ||
+        previous->GetLifetimePosition() != position) {
       // If the previous is a parallel move, then its position must be lower
       // than the given `position`: it was added just after the non-parallel
       // move instruction that precedes `instruction`.
-      DCHECK(previous == nullptr
-             || !previous->IsParallelMove()
-             || previous->GetLifetimePosition() < position);
+      DCHECK(previous == nullptr ||
+             !previous->IsParallelMove() ||
+             previous->GetLifetimePosition() < position);
       move = new (allocator_) HParallelMove(allocator_);
       move->SetLifetimePosition(position);
       at->GetBlock()->InsertInstructionBefore(move, at);
@@ -643,8 +643,9 @@
   // This is a parallel move for connecting blocks. We need to differentiate
   // it with moves for connecting siblings in a same block, and output moves.
   size_t position = last->GetLifetimePosition();
-  if (previous == nullptr || !previous->IsParallelMove()
-      || previous->AsParallelMove()->GetLifetimePosition() != position) {
+  if (previous == nullptr ||
+      !previous->IsParallelMove() ||
+      previous->AsParallelMove()->GetLifetimePosition() != position) {
     move = new (allocator_) HParallelMove(allocator_);
     move->SetLifetimePosition(position);
     block->InsertInstructionBefore(move, last);
@@ -662,7 +663,7 @@
   if (source.Equals(destination)) return;
 
   HInstruction* first = block->GetFirstInstruction();
-  HParallelMove* move = first->AsParallelMove();
+  HParallelMove* move = first->AsParallelMoveOrNull();
   size_t position = block->GetLifetimeStart();
   // This is a parallel move for connecting blocks. We need to differentiate
   // it with moves for connecting siblings in a same block, and input moves.
@@ -686,7 +687,7 @@
   }
 
   size_t position = instruction->GetLifetimePosition() + 1;
-  HParallelMove* move = instruction->GetNext()->AsParallelMove();
+  HParallelMove* move = instruction->GetNext()->AsParallelMoveOrNull();
   // This is a parallel move for moving the output of an instruction. We need
   // to differentiate with input moves, moves for connecting siblings in a
   // and moves for connecting blocks.
diff --git a/compiler/optimizing/register_allocator.cc b/compiler/optimizing/register_allocator.cc
index e4c2d74..54a8055 100644
--- a/compiler/optimizing/register_allocator.cc
+++ b/compiler/optimizing/register_allocator.cc
@@ -21,20 +21,47 @@
 
 #include "base/scoped_arena_allocator.h"
 #include "base/scoped_arena_containers.h"
+#include "base/bit_utils_iterator.h"
 #include "base/bit_vector-inl.h"
 #include "code_generator.h"
-#include "register_allocator_graph_color.h"
 #include "register_allocator_linear_scan.h"
 #include "ssa_liveness_analysis.h"
 
 namespace art HIDDEN {
 
+template <typename IsCalleeSave>
+static uint32_t GetBlockedRegistersForCall(size_t num_registers, IsCalleeSave&& is_callee_save) {
+  DCHECK_LE(num_registers, BitSizeOf<uint32_t>());
+  uint32_t mask = 0u;
+  for (size_t reg = 0; reg != num_registers; ++reg) {
+    if (!is_callee_save(reg)) {
+      mask |= 1u << reg;
+    }
+  }
+  return mask;
+}
+
+static uint32_t GetBlockedCoreRegistersForCall(size_t num_registers, const CodeGenerator* codegen) {
+  return GetBlockedRegistersForCall(
+      num_registers, [&](size_t reg) { return codegen->IsCoreCalleeSaveRegister(reg); });
+}
+
+static uint32_t GetBlockedFpRegistersForCall(size_t num_registers, const CodeGenerator* codegen) {
+  return GetBlockedRegistersForCall(
+      num_registers, [&](size_t reg) { return codegen->IsFloatingPointCalleeSaveRegister(reg); });
+}
+
 RegisterAllocator::RegisterAllocator(ScopedArenaAllocator* allocator,
                                      CodeGenerator* codegen,
                                      const SsaLivenessAnalysis& liveness)
     : allocator_(allocator),
       codegen_(codegen),
-      liveness_(liveness) {}
+      liveness_(liveness),
+      num_core_registers_(codegen_->GetNumberOfCoreRegisters()),
+      num_fp_registers_(codegen_->GetNumberOfFloatingPointRegisters()),
+      core_registers_blocked_for_call_(
+          GetBlockedCoreRegistersForCall(num_core_registers_, codegen)),
+      fp_registers_blocked_for_call_(GetBlockedFpRegistersForCall(num_fp_registers_, codegen)) {}
 
 std::unique_ptr<RegisterAllocator> RegisterAllocator::Create(ScopedArenaAllocator* allocator,
                                                              CodeGenerator* codegen,
@@ -45,8 +72,8 @@
       return std::unique_ptr<RegisterAllocator>(
           new (allocator) RegisterAllocatorLinearScan(allocator, codegen, analysis));
     case kRegisterAllocatorGraphColor:
-      return std::unique_ptr<RegisterAllocator>(
-          new (allocator) RegisterAllocatorGraphColor(allocator, codegen, analysis));
+      LOG(FATAL) << "Graph coloring register allocator has been removed.";
+      UNREACHABLE();
     default:
       LOG(FATAL) << "Invalid register allocation strategy: " << strategy;
       UNREACHABLE();
@@ -95,15 +122,81 @@
   DISALLOW_COPY_AND_ASSIGN(AllRangesIterator);
 };
 
+void RegisterAllocator::DumpRegister(std::ostream& stream,
+                                     int reg,
+                                     RegisterType register_type,
+                                     const CodeGenerator* codegen) {
+  switch (register_type) {
+    case RegisterType::kCoreRegister:
+      codegen->DumpCoreRegister(stream, reg);
+      break;
+    case RegisterType::kFpRegister:
+      codegen->DumpFloatingPointRegister(stream, reg);
+      break;
+  }
+}
+
+uint32_t RegisterAllocator::GetRegisterMask(LiveInterval* interval,
+                                            RegisterType register_type) const {
+  if (interval->HasRegister()) {
+    DCHECK_EQ(register_type == RegisterType::kFpRegister,
+              DataType::IsFloatingPointType(interval->GetType()));
+    DCHECK_LE(static_cast<size_t>(interval->GetRegister()), BitSizeOf<uint32_t>());
+    return 1u << interval->GetRegister();
+  } else if (interval->IsFixed()) {
+    DCHECK_EQ(interval->GetType(), DataType::Type::kVoid);
+    DCHECK(interval->GetFirstRange() != nullptr);
+    size_t start = interval->GetFirstRange()->GetStart();
+    bool blocked_for_call = liveness_.GetInstructionFromPosition(start / 2u) != nullptr;
+    switch (register_type) {
+      case RegisterType::kCoreRegister:
+        return blocked_for_call ? core_registers_blocked_for_call_
+                                : MaxInt<uint32_t>(num_core_registers_);
+      case RegisterType::kFpRegister:
+        return blocked_for_call ? fp_registers_blocked_for_call_
+                                : MaxInt<uint32_t>(num_fp_registers_);
+    }
+  } else {
+    return 0u;
+  }
+}
+
 bool RegisterAllocator::ValidateIntervals(ArrayRef<LiveInterval* const> intervals,
                                           size_t number_of_spill_slots,
                                           size_t number_of_out_slots,
                                           const CodeGenerator& codegen,
-                                          bool processing_core_registers,
+                                          const SsaLivenessAnalysis* liveness,
+                                          RegisterType register_type,
                                           bool log_fatal_on_failure) {
-  size_t number_of_registers = processing_core_registers
+  size_t number_of_registers = (register_type == RegisterType::kCoreRegister)
       ? codegen.GetNumberOfCoreRegisters()
       : codegen.GetNumberOfFloatingPointRegisters();
+  uint32_t registers_blocked_for_call = (register_type == RegisterType::kCoreRegister)
+      ? GetBlockedCoreRegistersForCall(number_of_registers, &codegen)
+      : GetBlockedFpRegistersForCall(number_of_registers, &codegen);
+
+  // A copy of `GetRegisterMask()` using local `number_of_registers` and
+  // `registers_blocked_for_call` instead of the cached per-type members
+  // that we cannot use in this static member function.
+  auto get_register_mask = [&](LiveInterval* interval) {
+    if (interval->HasRegister()) {
+      DCHECK_EQ(register_type == RegisterType::kFpRegister,
+                DataType::IsFloatingPointType(interval->GetType()));
+      DCHECK_LE(static_cast<size_t>(interval->GetRegister()), BitSizeOf<uint32_t>());
+      return 1u << interval->GetRegister();
+    } else if (interval->IsFixed()) {
+      DCHECK_EQ(interval->GetType(), DataType::Type::kVoid);
+      DCHECK(interval->GetFirstRange() != nullptr);
+      size_t start = interval->GetFirstRange()->GetStart();
+      CHECK(liveness != nullptr);
+      bool blocked_for_call = liveness->GetInstructionFromPosition(start / 2u) != nullptr;
+      return blocked_for_call ? registers_blocked_for_call
+                              : MaxInt<uint32_t>(number_of_registers);
+    } else {
+      return 0u;
+    }
+  };
+
   ScopedArenaAllocator allocator(codegen.GetGraph()->GetArenaStack());
   ScopedArenaVector<ArenaBitVector*> liveness_of_values(
       allocator.Adapter(kArenaAllocRegisterAllocatorValidate));
@@ -150,13 +243,13 @@
         }
       }
 
-      if (current->HasRegister()) {
+      for (uint32_t reg : LowToHighBits(get_register_mask(current))) {
         if (kIsDebugBuild && log_fatal_on_failure && !current->IsFixed()) {
           // Only check when an error is fatal. Only tests code ask for non-fatal failures
           // and test code may not properly fill the right information to the code generator.
-          CHECK(codegen.HasAllocatedRegister(processing_core_registers, current->GetRegister()));
+          CHECK(codegen.HasAllocatedRegister(register_type == RegisterType::kCoreRegister, reg));
         }
-        BitVector* liveness_of_register = liveness_of_values[current->GetRegister()];
+        BitVector* liveness_of_register = liveness_of_values[reg];
         for (size_t j = it.CurrentRange()->GetStart(); j < it.CurrentRange()->GetEnd(); ++j) {
           if (liveness_of_register->IsBitSet(j)) {
             if (current->IsUsingInputRegister() && current->CanUseInputRegister()) {
@@ -169,15 +262,9 @@
                 message << "(" << defined_by->DebugName() << ")";
               }
               message << "for ";
-              if (processing_core_registers) {
-                codegen.DumpCoreRegister(message, current->GetRegister());
-              } else {
-                codegen.DumpFloatingPointRegister(message, current->GetRegister());
-              }
+              DumpRegister(message, reg, register_type, &codegen);
               for (LiveInterval* interval : intervals) {
-                if (interval->HasRegister()
-                    && interval->GetRegister() == current->GetRegister()
-                    && interval->CoversSlow(j)) {
+                if ((get_register_mask(interval) & (1u << reg)) != 0u && interval->CoversSlow(j)) {
                   message << std::endl;
                   if (interval->GetDefinedBy() != nullptr) {
                     message << interval->GetDefinedBy()->GetKind() << " ";
diff --git a/compiler/optimizing/register_allocator.h b/compiler/optimizing/register_allocator.h
index 453e339..bc192f2 100644
--- a/compiler/optimizing/register_allocator.h
+++ b/compiler/optimizing/register_allocator.h
@@ -43,6 +43,11 @@
     kRegisterAllocatorGraphColor
   };
 
+  enum class RegisterType {
+    kCoreRegister,
+    kFpRegister
+  };
+
   static constexpr Strategy kRegisterAllocatorDefault = kRegisterAllocatorLinearScan;
 
   static std::unique_ptr<RegisterAllocator> Create(ScopedArenaAllocator* allocator,
@@ -65,7 +70,8 @@
                                 size_t number_of_spill_slots,
                                 size_t number_of_out_slots,
                                 const CodeGenerator& codegen,
-                                bool processing_core_registers,
+                                const SsaLivenessAnalysis* liveness,  // Can be null in tests.
+                                RegisterType register_type,
                                 bool log_fatal_on_failure);
 
   static constexpr const char* kRegisterAllocatorPassName = "register";
@@ -84,9 +90,28 @@
   // to find an optimal split position.
   LiveInterval* SplitBetween(LiveInterval* interval, size_t from, size_t to);
 
+  // Helper for calling the right typed codegen function for dumping a register.
+  void DumpRegister(std::ostream& stream, int reg, RegisterType register_type) const {
+    DumpRegister(stream, reg, register_type, codegen_);
+  }
+  static void DumpRegister(
+      std::ostream& stream, int reg, RegisterType register_type, const CodeGenerator* codegen);
+
+  // Get a mask of all registers for an interval.
+  // Most intervals either have or do not have a register, but we're using special fixed
+  // intervals with type `Void` to mark large sets of blocked registers for calls, catch
+  // blocks and irreducible loop headers to save memory and improve performance.
+  uint32_t GetRegisterMask(LiveInterval* interval, RegisterType register_type) const;
+
   ScopedArenaAllocator* const allocator_;
   CodeGenerator* const codegen_;
   const SsaLivenessAnalysis& liveness_;
+
+  // Cached values calculated from codegen data.
+  const size_t num_core_registers_;
+  const size_t num_fp_registers_;
+  const uint32_t core_registers_blocked_for_call_;
+  const uint32_t fp_registers_blocked_for_call_;
 };
 
 }  // namespace art
diff --git a/compiler/optimizing/register_allocator_graph_color.cc b/compiler/optimizing/register_allocator_graph_color.cc
deleted file mode 100644
index a7c891d..0000000
--- a/compiler/optimizing/register_allocator_graph_color.cc
+++ /dev/null
@@ -1,2086 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "register_allocator_graph_color.h"
-
-#include "code_generator.h"
-#include "linear_order.h"
-#include "register_allocation_resolver.h"
-#include "ssa_liveness_analysis.h"
-#include "thread-current-inl.h"
-
-namespace art HIDDEN {
-
-// Highest number of registers that we support for any platform. This can be used for std::bitset,
-// for example, which needs to know its size at compile time.
-static constexpr size_t kMaxNumRegs = 32;
-
-// The maximum number of graph coloring attempts before triggering a DCHECK.
-// This is meant to catch changes to the graph coloring algorithm that undermine its forward
-// progress guarantees. Forward progress for the algorithm means splitting live intervals on
-// every graph coloring attempt so that eventually the interference graph will be sparse enough
-// to color. The main threat to forward progress is trying to split short intervals which cannot be
-// split further; this could cause infinite looping because the interference graph would never
-// change. This is avoided by prioritizing short intervals before long ones, so that long
-// intervals are split when coloring fails.
-static constexpr size_t kMaxGraphColoringAttemptsDebug = 100;
-
-// We always want to avoid spilling inside loops.
-static constexpr size_t kLoopSpillWeightMultiplier = 10;
-
-// If we avoid moves in single jump blocks, we can avoid jumps to jumps.
-static constexpr size_t kSingleJumpBlockWeightMultiplier = 2;
-
-// We avoid moves in blocks that dominate the exit block, since these blocks will
-// be executed on every path through the method.
-static constexpr size_t kDominatesExitBlockWeightMultiplier = 2;
-
-enum class CoalesceKind {
-  kAdjacentSibling,       // Prevents moves at interval split points.
-  kFixedOutputSibling,    // Prevents moves from a fixed output location.
-  kFixedInput,            // Prevents moves into a fixed input location.
-  kNonlinearControlFlow,  // Prevents moves between blocks.
-  kPhi,                   // Prevents phi resolution moves.
-  kFirstInput,            // Prevents a single input move.
-  kAnyInput,              // May lead to better instruction selection / smaller encodings.
-};
-
-std::ostream& operator<<(std::ostream& os, const CoalesceKind& kind) {
-  return os << static_cast<typename std::underlying_type<CoalesceKind>::type>(kind);
-}
-
-static size_t LoopDepthAt(HBasicBlock* block) {
-  HLoopInformation* loop_info = block->GetLoopInformation();
-  size_t depth = 0;
-  while (loop_info != nullptr) {
-    ++depth;
-    loop_info = loop_info->GetPreHeader()->GetLoopInformation();
-  }
-  return depth;
-}
-
-// Return the runtime cost of inserting a move instruction at the specified location.
-static size_t CostForMoveAt(size_t position, const SsaLivenessAnalysis& liveness) {
-  HBasicBlock* block = liveness.GetBlockFromPosition(position / 2);
-  DCHECK(block != nullptr);
-  size_t cost = 1;
-  if (block->IsSingleJump()) {
-    cost *= kSingleJumpBlockWeightMultiplier;
-  }
-  if (block->Dominates(block->GetGraph()->GetExitBlock())) {
-    cost *= kDominatesExitBlockWeightMultiplier;
-  }
-  for (size_t loop_depth = LoopDepthAt(block); loop_depth > 0; --loop_depth) {
-    cost *= kLoopSpillWeightMultiplier;
-  }
-  return cost;
-}
-
-// In general, we estimate coalesce priority by whether it will definitely avoid a move,
-// and by how likely it is to create an interference graph that's harder to color.
-static size_t ComputeCoalescePriority(CoalesceKind kind,
-                                      size_t position,
-                                      const SsaLivenessAnalysis& liveness) {
-  if (kind == CoalesceKind::kAnyInput) {
-    // This type of coalescing can affect instruction selection, but not moves, so we
-    // give it the lowest priority.
-    return 0;
-  } else {
-    return CostForMoveAt(position, liveness);
-  }
-}
-
-enum class CoalesceStage {
-  kWorklist,  // Currently in the iterative coalescing worklist.
-  kActive,    // Not in a worklist, but could be considered again during iterative coalescing.
-  kInactive,  // No longer considered until last-chance coalescing.
-  kDefunct,   // Either the two nodes interfere, or have already been coalesced.
-};
-
-std::ostream& operator<<(std::ostream& os, const CoalesceStage& stage) {
-  return os << static_cast<typename std::underlying_type<CoalesceStage>::type>(stage);
-}
-
-// Represents a coalesce opportunity between two nodes.
-struct CoalesceOpportunity : public ArenaObject<kArenaAllocRegisterAllocator> {
-  CoalesceOpportunity(InterferenceNode* a,
-                      InterferenceNode* b,
-                      CoalesceKind kind,
-                      size_t position,
-                      const SsaLivenessAnalysis& liveness)
-        : node_a(a),
-          node_b(b),
-          stage(CoalesceStage::kWorklist),
-          priority(ComputeCoalescePriority(kind, position, liveness)) {}
-
-  // Compare two coalesce opportunities based on their priority.
-  // Return true if lhs has a lower priority than that of rhs.
-  static bool CmpPriority(const CoalesceOpportunity* lhs,
-                          const CoalesceOpportunity* rhs) {
-    return lhs->priority < rhs->priority;
-  }
-
-  InterferenceNode* const node_a;
-  InterferenceNode* const node_b;
-
-  // The current stage of this coalesce opportunity, indicating whether it is in a worklist,
-  // and whether it should still be considered.
-  CoalesceStage stage;
-
-  // The priority of this coalesce opportunity, based on heuristics.
-  const size_t priority;
-};
-
-enum class NodeStage {
-  kInitial,           // Uninitialized.
-  kPrecolored,        // Marks fixed nodes.
-  kSafepoint,         // Marks safepoint nodes.
-  kPrunable,          // Marks uncolored nodes in the interference graph.
-  kSimplifyWorklist,  // Marks non-move-related nodes with degree less than the number of registers.
-  kFreezeWorklist,    // Marks move-related nodes with degree less than the number of registers.
-  kSpillWorklist,     // Marks nodes with degree greater or equal to the number of registers.
-  kPruned             // Marks nodes already pruned from the interference graph.
-};
-
-std::ostream& operator<<(std::ostream& os, const NodeStage& stage) {
-  return os << static_cast<typename std::underlying_type<NodeStage>::type>(stage);
-}
-
-// Returns the estimated cost of spilling a particular live interval.
-static float ComputeSpillWeight(LiveInterval* interval, const SsaLivenessAnalysis& liveness) {
-  if (interval->HasRegister()) {
-    // Intervals with a fixed register cannot be spilled.
-    return std::numeric_limits<float>::min();
-  }
-
-  size_t length = interval->GetLength();
-  if (length == 1) {
-    // Tiny intervals should have maximum priority, since they cannot be split any further.
-    return std::numeric_limits<float>::max();
-  }
-
-  size_t use_weight = 0;
-  if (interval->GetDefinedBy() != nullptr && interval->DefinitionRequiresRegister()) {
-    // Cost for spilling at a register definition point.
-    use_weight += CostForMoveAt(interval->GetStart() + 1, liveness);
-  }
-
-  // Process uses in the range (interval->GetStart(), interval->GetEnd()], i.e.
-  // [interval->GetStart() + 1, interval->GetEnd() + 1)
-  auto matching_use_range = FindMatchingUseRange(interval->GetUses().begin(),
-                                                 interval->GetUses().end(),
-                                                 interval->GetStart() + 1u,
-                                                 interval->GetEnd() + 1u);
-  for (const UsePosition& use : matching_use_range) {
-    if (use.GetUser() != nullptr && use.RequiresRegister()) {
-      // Cost for spilling at a register use point.
-      use_weight += CostForMoveAt(use.GetUser()->GetLifetimePosition() - 1, liveness);
-    }
-  }
-
-  // We divide by the length of the interval because we want to prioritize
-  // short intervals; we do not benefit much if we split them further.
-  return static_cast<float>(use_weight) / static_cast<float>(length);
-}
-
-// Interference nodes make up the interference graph, which is the primary data structure in
-// graph coloring register allocation. Each node represents a single live interval, and contains
-// a set of adjacent nodes corresponding to intervals overlapping with its own. To save memory,
-// pre-colored nodes never contain outgoing edges (only incoming ones).
-//
-// As nodes are pruned from the interference graph, incoming edges of the pruned node are removed,
-// but outgoing edges remain in order to later color the node based on the colors of its neighbors.
-//
-// Note that a pair interval is represented by a single node in the interference graph, which
-// essentially requires two colors. One consequence of this is that the degree of a node is not
-// necessarily equal to the number of adjacent nodes--instead, the degree reflects the maximum
-// number of colors with which a node could interfere. We model this by giving edges different
-// weights (1 or 2) to control how much it increases the degree of adjacent nodes.
-// For example, the edge between two single nodes will have weight 1. On the other hand,
-// the edge between a single node and a pair node will have weight 2. This is because the pair
-// node could block up to two colors for the single node, and because the single node could
-// block an entire two-register aligned slot for the pair node.
-// The degree is defined this way because we use it to decide whether a node is guaranteed a color,
-// and thus whether it is safe to prune it from the interference graph early on.
-class InterferenceNode : public ArenaObject<kArenaAllocRegisterAllocator> {
- public:
-  InterferenceNode(LiveInterval* interval,
-                   const SsaLivenessAnalysis& liveness)
-        : stage(NodeStage::kInitial),
-          interval_(interval),
-          adjacent_nodes_(nullptr),
-          coalesce_opportunities_(nullptr),
-          out_degree_(interval->HasRegister() ? std::numeric_limits<size_t>::max() : 0),
-          alias_(this),
-          spill_weight_(ComputeSpillWeight(interval, liveness)),
-          requires_color_(interval->RequiresRegister()),
-          needs_spill_slot_(false) {
-    DCHECK(!interval->IsHighInterval()) << "Pair nodes should be represented by the low interval";
-  }
-
-  void AddInterference(InterferenceNode* other,
-                       bool guaranteed_not_interfering_yet,
-                       ScopedArenaDeque<ScopedArenaVector<InterferenceNode*>>* storage) {
-    DCHECK(!IsPrecolored()) << "To save memory, fixed nodes should not have outgoing interferences";
-    DCHECK_NE(this, other) << "Should not create self loops in the interference graph";
-    DCHECK_EQ(this, alias_) << "Should not add interferences to a node that aliases another";
-    DCHECK_NE(stage, NodeStage::kPruned);
-    DCHECK_NE(other->stage, NodeStage::kPruned);
-    if (adjacent_nodes_ == nullptr) {
-      ScopedArenaVector<InterferenceNode*>::allocator_type adapter(storage->get_allocator());
-      storage->emplace_back(adapter);
-      adjacent_nodes_ = &storage->back();
-    }
-    if (guaranteed_not_interfering_yet) {
-      DCHECK(!ContainsElement(GetAdjacentNodes(), other));
-      adjacent_nodes_->push_back(other);
-      out_degree_ += EdgeWeightWith(other);
-    } else {
-      if (!ContainsElement(GetAdjacentNodes(), other)) {
-        adjacent_nodes_->push_back(other);
-        out_degree_ += EdgeWeightWith(other);
-      }
-    }
-  }
-
-  void RemoveInterference(InterferenceNode* other) {
-    DCHECK_EQ(this, alias_) << "Should not remove interferences from a coalesced node";
-    DCHECK_EQ(other->stage, NodeStage::kPruned) << "Should only remove interferences when pruning";
-    if (adjacent_nodes_ != nullptr) {
-      auto it = std::find(adjacent_nodes_->begin(), adjacent_nodes_->end(), other);
-      if (it != adjacent_nodes_->end()) {
-        adjacent_nodes_->erase(it);
-        out_degree_ -= EdgeWeightWith(other);
-      }
-    }
-  }
-
-  bool ContainsInterference(InterferenceNode* other) const {
-    DCHECK(!IsPrecolored()) << "Should not query fixed nodes for interferences";
-    DCHECK_EQ(this, alias_) << "Should not query a coalesced node for interferences";
-    return ContainsElement(GetAdjacentNodes(), other);
-  }
-
-  LiveInterval* GetInterval() const {
-    return interval_;
-  }
-
-  ArrayRef<InterferenceNode*> GetAdjacentNodes() const {
-    return adjacent_nodes_ != nullptr
-        ? ArrayRef<InterferenceNode*>(*adjacent_nodes_)
-        : ArrayRef<InterferenceNode*>();
-  }
-
-  size_t GetOutDegree() const {
-    // Pre-colored nodes have infinite degree.
-    DCHECK_IMPLIES(IsPrecolored(), out_degree_ == std::numeric_limits<size_t>::max());
-    return out_degree_;
-  }
-
-  void AddCoalesceOpportunity(CoalesceOpportunity* opportunity,
-                              ScopedArenaDeque<ScopedArenaVector<CoalesceOpportunity*>>* storage) {
-    if (coalesce_opportunities_ == nullptr) {
-      ScopedArenaVector<CoalesceOpportunity*>::allocator_type adapter(storage->get_allocator());
-      storage->emplace_back(adapter);
-      coalesce_opportunities_ = &storage->back();
-    }
-    coalesce_opportunities_->push_back(opportunity);
-  }
-
-  void ClearCoalesceOpportunities() {
-    coalesce_opportunities_ = nullptr;
-  }
-
-  bool IsMoveRelated() const {
-    for (CoalesceOpportunity* opportunity : GetCoalesceOpportunities()) {
-      if (opportunity->stage == CoalesceStage::kWorklist ||
-          opportunity->stage == CoalesceStage::kActive) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  // Return whether this node already has a color.
-  // Used to find fixed nodes in the interference graph before coloring.
-  bool IsPrecolored() const {
-    return interval_->HasRegister();
-  }
-
-  bool IsPair() const {
-    return interval_->HasHighInterval();
-  }
-
-  void SetAlias(InterferenceNode* rep) {
-    DCHECK_NE(rep->stage, NodeStage::kPruned);
-    DCHECK_EQ(this, alias_) << "Should only set a node's alias once";
-    alias_ = rep;
-  }
-
-  InterferenceNode* GetAlias() {
-    if (alias_ != this) {
-      // Recurse in order to flatten tree of alias pointers.
-      alias_ = alias_->GetAlias();
-    }
-    return alias_;
-  }
-
-  ArrayRef<CoalesceOpportunity*> GetCoalesceOpportunities() const {
-    return coalesce_opportunities_ != nullptr
-        ? ArrayRef<CoalesceOpportunity*>(*coalesce_opportunities_)
-        : ArrayRef<CoalesceOpportunity*>();
-  }
-
-  float GetSpillWeight() const {
-    return spill_weight_;
-  }
-
-  bool RequiresColor() const {
-    return requires_color_;
-  }
-
-  // We give extra weight to edges adjacent to pair nodes. See the general comment on the
-  // interference graph above.
-  size_t EdgeWeightWith(const InterferenceNode* other) const {
-    return (IsPair() || other->IsPair()) ? 2 : 1;
-  }
-
-  bool NeedsSpillSlot() const {
-    return needs_spill_slot_;
-  }
-
-  void SetNeedsSpillSlot() {
-    needs_spill_slot_ = true;
-  }
-
-  // The current stage of this node, indicating which worklist it belongs to.
-  NodeStage stage;
-
- private:
-  // The live interval that this node represents.
-  LiveInterval* const interval_;
-
-  // All nodes interfering with this one.
-  // We use an unsorted vector as a set, since a tree or hash set is too heavy for the
-  // set sizes that we encounter. Using a vector leads to much better performance.
-  ScopedArenaVector<InterferenceNode*>* adjacent_nodes_;  // Owned by ColoringIteration.
-
-  // Interference nodes that this node should be coalesced with to reduce moves.
-  ScopedArenaVector<CoalesceOpportunity*>* coalesce_opportunities_;  // Owned by ColoringIteration.
-
-  // The maximum number of colors with which this node could interfere. This could be more than
-  // the number of adjacent nodes if this is a pair node, or if some adjacent nodes are pair nodes.
-  // We use "out" degree because incoming edges come from nodes already pruned from the graph,
-  // and do not affect the coloring of this node.
-  // Pre-colored nodes are treated as having infinite degree.
-  size_t out_degree_;
-
-  // The node representing this node in the interference graph.
-  // Initially set to `this`, and only changed if this node is coalesced into another.
-  InterferenceNode* alias_;
-
-  // The cost of splitting and spilling this interval to the stack.
-  // Nodes with a higher spill weight should be prioritized when assigning registers.
-  // This is essentially based on use density and location; short intervals with many uses inside
-  // deeply nested loops have a high spill weight.
-  const float spill_weight_;
-
-  const bool requires_color_;
-
-  bool needs_spill_slot_;
-
-  DISALLOW_COPY_AND_ASSIGN(InterferenceNode);
-};
-
-// The order in which we color nodes is important. To guarantee forward progress,
-// we prioritize intervals that require registers, and after that we prioritize
-// short intervals. That way, if we fail to color a node, it either won't require a
-// register, or it will be a long interval that can be split in order to make the
-// interference graph sparser.
-// To improve code quality, we prioritize intervals used frequently in deeply nested loops.
-// (This metric is secondary to the forward progress requirements above.)
-// TODO: May also want to consider:
-// - Constants (since they can be rematerialized)
-// - Allocated spill slots
-static bool HasGreaterNodePriority(const InterferenceNode* lhs,
-                                   const InterferenceNode* rhs) {
-  // (1) Prioritize the node that requires a color.
-  if (lhs->RequiresColor() != rhs->RequiresColor()) {
-    return lhs->RequiresColor();
-  }
-
-  // (2) Prioritize the interval that has a higher spill weight.
-  return lhs->GetSpillWeight() > rhs->GetSpillWeight();
-}
-
-// A ColoringIteration holds the many data structures needed for a single graph coloring attempt,
-// and provides methods for each phase of the attempt.
-class ColoringIteration {
- public:
-  ColoringIteration(RegisterAllocatorGraphColor* register_allocator,
-                    ScopedArenaAllocator* allocator,
-                    bool processing_core_regs,
-                    size_t num_regs)
-        : register_allocator_(register_allocator),
-          allocator_(allocator),
-          processing_core_regs_(processing_core_regs),
-          num_regs_(num_regs),
-          interval_node_map_(allocator->Adapter(kArenaAllocRegisterAllocator)),
-          prunable_nodes_(allocator->Adapter(kArenaAllocRegisterAllocator)),
-          pruned_nodes_(allocator->Adapter(kArenaAllocRegisterAllocator)),
-          simplify_worklist_(allocator->Adapter(kArenaAllocRegisterAllocator)),
-          freeze_worklist_(allocator->Adapter(kArenaAllocRegisterAllocator)),
-          spill_worklist_(HasGreaterNodePriority, allocator->Adapter(kArenaAllocRegisterAllocator)),
-          coalesce_worklist_(CoalesceOpportunity::CmpPriority,
-                             allocator->Adapter(kArenaAllocRegisterAllocator)),
-          adjacent_nodes_links_(allocator->Adapter(kArenaAllocRegisterAllocator)),
-          coalesce_opportunities_links_(allocator->Adapter(kArenaAllocRegisterAllocator)) {}
-
-  // Use the intervals collected from instructions to construct an
-  // interference graph mapping intervals to adjacency lists.
-  // Also, collect synthesized safepoint nodes, used to keep
-  // track of live intervals across safepoints.
-  // TODO: Should build safepoints elsewhere.
-  void BuildInterferenceGraph(const ScopedArenaVector<LiveInterval*>& intervals,
-                              const ScopedArenaVector<InterferenceNode*>& physical_nodes);
-
-  // Add coalesce opportunities to interference nodes.
-  void FindCoalesceOpportunities();
-
-  // Prune nodes from the interference graph to be colored later. Build
-  // a stack (pruned_nodes) containing these intervals in an order determined
-  // by various heuristics.
-  void PruneInterferenceGraph();
-
-  // Process pruned_intervals_ to color the interference graph, spilling when
-  // necessary. Returns true if successful. Else, some intervals have been
-  // split, and the interference graph should be rebuilt for another attempt.
-  bool ColorInterferenceGraph();
-
-  // Return prunable nodes.
-  // The register allocator will need to access prunable nodes after coloring
-  // in order to tell the code generator which registers have been assigned.
-  ArrayRef<InterferenceNode* const> GetPrunableNodes() const {
-    return ArrayRef<InterferenceNode* const>(prunable_nodes_);
-  }
-
- private:
-  // Create a coalesce opportunity between two nodes.
-  void CreateCoalesceOpportunity(InterferenceNode* a,
-                                 InterferenceNode* b,
-                                 CoalesceKind kind,
-                                 size_t position);
-
-  // Add an edge in the interference graph, if valid.
-  // Note that `guaranteed_not_interfering_yet` is used to optimize adjacency set insertion
-  // when possible.
-  void AddPotentialInterference(InterferenceNode* from,
-                                InterferenceNode* to,
-                                bool guaranteed_not_interfering_yet,
-                                bool both_directions = true);
-
-  // Invalidate all coalesce opportunities this node has, so that it (and possibly its neighbors)
-  // may be pruned from the interference graph.
-  void FreezeMoves(InterferenceNode* node);
-
-  // Prune a node from the interference graph, updating worklists if necessary.
-  void PruneNode(InterferenceNode* node);
-
-  // Add coalesce opportunities associated with this node to the coalesce worklist.
-  void EnableCoalesceOpportunities(InterferenceNode* node);
-
-  // If needed, from `node` from the freeze worklist to the simplify worklist.
-  void CheckTransitionFromFreezeWorklist(InterferenceNode* node);
-
-  // Return true if `into` is colored, and `from` can be coalesced with `into` conservatively.
-  bool PrecoloredHeuristic(InterferenceNode* from, InterferenceNode* into);
-
-  // Return true if `from` and `into` are uncolored, and can be coalesced conservatively.
-  bool UncoloredHeuristic(InterferenceNode* from, InterferenceNode* into);
-
-  void Coalesce(CoalesceOpportunity* opportunity);
-
-  // Merge `from` into `into` in the interference graph.
-  void Combine(InterferenceNode* from, InterferenceNode* into);
-
-  // A reference to the register allocator instance,
-  // needed to split intervals and assign spill slots.
-  RegisterAllocatorGraphColor* register_allocator_;
-
-  // A scoped arena allocator used for a single graph coloring attempt.
-  ScopedArenaAllocator* allocator_;
-
-  const bool processing_core_regs_;
-
-  const size_t num_regs_;
-
-  // A map from live intervals to interference nodes.
-  ScopedArenaHashMap<LiveInterval*, InterferenceNode*> interval_node_map_;
-
-  // Uncolored nodes that should be pruned from the interference graph.
-  ScopedArenaVector<InterferenceNode*> prunable_nodes_;
-
-  // A stack of nodes pruned from the interference graph, waiting to be pruned.
-  ScopedArenaStdStack<InterferenceNode*> pruned_nodes_;
-
-  // A queue containing low degree, non-move-related nodes that can pruned immediately.
-  ScopedArenaDeque<InterferenceNode*> simplify_worklist_;
-
-  // A queue containing low degree, move-related nodes.
-  ScopedArenaDeque<InterferenceNode*> freeze_worklist_;
-
-  // A queue containing high degree nodes.
-  // If we have to prune from the spill worklist, we cannot guarantee
-  // the pruned node a color, so we order the worklist by priority.
-  ScopedArenaPriorityQueue<InterferenceNode*, decltype(&HasGreaterNodePriority)> spill_worklist_;
-
-  // A queue containing coalesce opportunities.
-  // We order the coalesce worklist by priority, since some coalesce opportunities (e.g., those
-  // inside of loops) are more important than others.
-  ScopedArenaPriorityQueue<CoalesceOpportunity*,
-                           decltype(&CoalesceOpportunity::CmpPriority)> coalesce_worklist_;
-
-  // Storage for links to adjacent nodes for interference nodes.
-  // Using std::deque so that elements do not move when adding new ones.
-  ScopedArenaDeque<ScopedArenaVector<InterferenceNode*>> adjacent_nodes_links_;
-
-  // Storage for links to coalesce opportunities for interference nodes.
-  // Using std::deque so that elements do not move when adding new ones.
-  ScopedArenaDeque<ScopedArenaVector<CoalesceOpportunity*>> coalesce_opportunities_links_;
-
-  DISALLOW_COPY_AND_ASSIGN(ColoringIteration);
-};
-
-static bool IsCoreInterval(LiveInterval* interval) {
-  return !DataType::IsFloatingPointType(interval->GetType());
-}
-
-static size_t ComputeReservedArtMethodSlots(const CodeGenerator& codegen) {
-  return static_cast<size_t>(InstructionSetPointerSize(codegen.GetInstructionSet())) / kVRegSize;
-}
-
-RegisterAllocatorGraphColor::RegisterAllocatorGraphColor(ScopedArenaAllocator* allocator,
-                                                         CodeGenerator* codegen,
-                                                         const SsaLivenessAnalysis& liveness,
-                                                         bool iterative_move_coalescing)
-      : RegisterAllocator(allocator, codegen, liveness),
-        iterative_move_coalescing_(iterative_move_coalescing),
-        core_intervals_(allocator->Adapter(kArenaAllocRegisterAllocator)),
-        fp_intervals_(allocator->Adapter(kArenaAllocRegisterAllocator)),
-        temp_intervals_(allocator->Adapter(kArenaAllocRegisterAllocator)),
-        safepoints_(allocator->Adapter(kArenaAllocRegisterAllocator)),
-        physical_core_nodes_(allocator->Adapter(kArenaAllocRegisterAllocator)),
-        physical_fp_nodes_(allocator->Adapter(kArenaAllocRegisterAllocator)),
-        num_int_spill_slots_(0),
-        num_double_spill_slots_(0),
-        num_float_spill_slots_(0),
-        num_long_spill_slots_(0),
-        catch_phi_spill_slot_counter_(0),
-        reserved_art_method_slots_(ComputeReservedArtMethodSlots(*codegen)),
-        reserved_out_slots_(codegen->GetGraph()->GetMaximumNumberOfOutVRegs()) {
-  // Before we ask for blocked registers, set them up in the code generator.
-  codegen->SetupBlockedRegisters();
-
-  // Initialize physical core register live intervals and blocked registers.
-  // This includes globally blocked registers, such as the stack pointer.
-  physical_core_nodes_.resize(codegen_->GetNumberOfCoreRegisters(), nullptr);
-  for (size_t i = 0; i < codegen_->GetNumberOfCoreRegisters(); ++i) {
-    LiveInterval* interval = LiveInterval::MakeFixedInterval(allocator_, i, DataType::Type::kInt32);
-    physical_core_nodes_[i] = new (allocator_) InterferenceNode(interval, liveness);
-    physical_core_nodes_[i]->stage = NodeStage::kPrecolored;
-    core_intervals_.push_back(interval);
-    if (codegen_->IsBlockedCoreRegister(i)) {
-      interval->AddRange(0, liveness.GetMaxLifetimePosition());
-    }
-  }
-  // Initialize physical floating point register live intervals and blocked registers.
-  physical_fp_nodes_.resize(codegen_->GetNumberOfFloatingPointRegisters(), nullptr);
-  for (size_t i = 0; i < codegen_->GetNumberOfFloatingPointRegisters(); ++i) {
-    LiveInterval* interval =
-        LiveInterval::MakeFixedInterval(allocator_, i, DataType::Type::kFloat32);
-    physical_fp_nodes_[i] = new (allocator_) InterferenceNode(interval, liveness);
-    physical_fp_nodes_[i]->stage = NodeStage::kPrecolored;
-    fp_intervals_.push_back(interval);
-    if (codegen_->IsBlockedFloatingPointRegister(i)) {
-      interval->AddRange(0, liveness.GetMaxLifetimePosition());
-    }
-  }
-}
-
-RegisterAllocatorGraphColor::~RegisterAllocatorGraphColor() {}
-
-void RegisterAllocatorGraphColor::AllocateRegisters() {
-  // (1) Collect and prepare live intervals.
-  ProcessInstructions();
-
-  for (bool processing_core_regs : {true, false}) {
-    ScopedArenaVector<LiveInterval*>& intervals = processing_core_regs
-        ? core_intervals_
-        : fp_intervals_;
-    size_t num_registers = processing_core_regs
-        ? codegen_->GetNumberOfCoreRegisters()
-        : codegen_->GetNumberOfFloatingPointRegisters();
-
-    size_t attempt = 0;
-    while (true) {
-      ++attempt;
-      DCHECK(attempt <= kMaxGraphColoringAttemptsDebug)
-          << "Exceeded debug max graph coloring register allocation attempts. "
-          << "This could indicate that the register allocator is not making forward progress, "
-          << "which could be caused by prioritizing the wrong live intervals. (Short intervals "
-          << "should be prioritized over long ones, because they cannot be split further.)";
-
-      // Many data structures are cleared between graph coloring attempts, so we reduce
-      // total memory usage by using a new scoped arena allocator for each attempt.
-      ScopedArenaAllocator coloring_attempt_allocator(allocator_->GetArenaStack());
-      ColoringIteration iteration(this,
-                                  &coloring_attempt_allocator,
-                                  processing_core_regs,
-                                  num_registers);
-
-      // (2) Build the interference graph.
-      ScopedArenaVector<InterferenceNode*>& physical_nodes = processing_core_regs
-          ? physical_core_nodes_
-          : physical_fp_nodes_;
-      iteration.BuildInterferenceGraph(intervals, physical_nodes);
-
-      // (3) Add coalesce opportunities.
-      //     If we have tried coloring the graph a suspiciously high number of times, give
-      //     up on move coalescing, just in case the coalescing heuristics are not conservative.
-      //     (This situation will be caught if DCHECKs are turned on.)
-      if (iterative_move_coalescing_ && attempt <= kMaxGraphColoringAttemptsDebug) {
-        iteration.FindCoalesceOpportunities();
-      }
-
-      // (4) Prune all uncolored nodes from interference graph.
-      iteration.PruneInterferenceGraph();
-
-      // (5) Color pruned nodes based on interferences.
-      bool successful = iteration.ColorInterferenceGraph();
-
-      // We manually clear coalesce opportunities for physical nodes,
-      // since they persist across coloring attempts.
-      for (InterferenceNode* node : physical_core_nodes_) {
-        node->ClearCoalesceOpportunities();
-      }
-      for (InterferenceNode* node : physical_fp_nodes_) {
-        node->ClearCoalesceOpportunities();
-      }
-
-      if (successful) {
-        // Assign spill slots.
-        AllocateSpillSlots(iteration.GetPrunableNodes());
-
-        // Tell the code generator which registers were allocated.
-        // We only look at prunable_nodes because we already told the code generator about
-        // fixed intervals while processing instructions. We also ignore the fixed intervals
-        // placed at the top of catch blocks.
-        for (InterferenceNode* node : iteration.GetPrunableNodes()) {
-          LiveInterval* interval = node->GetInterval();
-          if (interval->HasRegister()) {
-            Location low_reg = processing_core_regs
-                ? Location::RegisterLocation(interval->GetRegister())
-                : Location::FpuRegisterLocation(interval->GetRegister());
-            codegen_->AddAllocatedRegister(low_reg);
-            if (interval->HasHighInterval()) {
-              LiveInterval* high = interval->GetHighInterval();
-              DCHECK(high->HasRegister());
-              Location high_reg = processing_core_regs
-                  ? Location::RegisterLocation(high->GetRegister())
-                  : Location::FpuRegisterLocation(high->GetRegister());
-              codegen_->AddAllocatedRegister(high_reg);
-            }
-          } else {
-            DCHECK_IMPLIES(interval->HasHighInterval(),
-                           !interval->GetHighInterval()->HasRegister());
-          }
-        }
-
-        break;
-      }
-    }  // while unsuccessful
-  }  // for processing_core_instructions
-
-  // (6) Resolve locations and deconstruct SSA form.
-  RegisterAllocationResolver(codegen_, liveness_)
-      .Resolve(ArrayRef<HInstruction* const>(safepoints_),
-               reserved_art_method_slots_ + reserved_out_slots_,
-               num_int_spill_slots_,
-               num_long_spill_slots_,
-               num_float_spill_slots_,
-               num_double_spill_slots_,
-               catch_phi_spill_slot_counter_,
-               ArrayRef<LiveInterval* const>(temp_intervals_));
-
-  if (kIsDebugBuild) {
-    Validate(/*log_fatal_on_failure*/ true);
-  }
-}
-
-bool RegisterAllocatorGraphColor::Validate(bool log_fatal_on_failure) {
-  for (bool processing_core_regs : {true, false}) {
-    ScopedArenaAllocator allocator(allocator_->GetArenaStack());
-    ScopedArenaVector<LiveInterval*> intervals(
-        allocator.Adapter(kArenaAllocRegisterAllocatorValidate));
-    for (size_t i = 0; i < liveness_.GetNumberOfSsaValues(); ++i) {
-      HInstruction* instruction = liveness_.GetInstructionFromSsaIndex(i);
-      LiveInterval* interval = instruction->GetLiveInterval();
-      if (interval != nullptr && IsCoreInterval(interval) == processing_core_regs) {
-        intervals.push_back(instruction->GetLiveInterval());
-      }
-    }
-
-    ScopedArenaVector<InterferenceNode*>& physical_nodes = processing_core_regs
-        ? physical_core_nodes_
-        : physical_fp_nodes_;
-    for (InterferenceNode* fixed : physical_nodes) {
-      LiveInterval* interval = fixed->GetInterval();
-      if (interval->GetFirstRange() != nullptr) {
-        // Ideally we would check fixed ranges as well, but currently there are times when
-        // two fixed intervals for the same register will overlap. For example, a fixed input
-        // and a fixed output may sometimes share the same register, in which there will be two
-        // fixed intervals for the same place.
-      }
-    }
-
-    for (LiveInterval* temp : temp_intervals_) {
-      if (IsCoreInterval(temp) == processing_core_regs) {
-        intervals.push_back(temp);
-      }
-    }
-
-    size_t spill_slots = num_int_spill_slots_
-                       + num_long_spill_slots_
-                       + num_float_spill_slots_
-                       + num_double_spill_slots_
-                       + catch_phi_spill_slot_counter_;
-    bool ok = ValidateIntervals(ArrayRef<LiveInterval* const>(intervals),
-                                spill_slots,
-                                reserved_art_method_slots_ + reserved_out_slots_,
-                                *codegen_,
-                                processing_core_regs,
-                                log_fatal_on_failure);
-    if (!ok) {
-      return false;
-    }
-  }  // for processing_core_regs
-
-  return true;
-}
-
-void RegisterAllocatorGraphColor::ProcessInstructions() {
-  for (HBasicBlock* block : codegen_->GetGraph()->GetLinearPostOrder()) {
-    // Note that we currently depend on this ordering, since some helper
-    // code is designed for linear scan register allocation.
-    for (HBackwardInstructionIterator instr_it(block->GetInstructions());
-          !instr_it.Done();
-          instr_it.Advance()) {
-      ProcessInstruction(instr_it.Current());
-    }
-
-    for (HInstructionIterator phi_it(block->GetPhis()); !phi_it.Done(); phi_it.Advance()) {
-      ProcessInstruction(phi_it.Current());
-    }
-
-    if (block->IsCatchBlock()
-        || (block->IsLoopHeader() && block->GetLoopInformation()->IsIrreducible())) {
-      // By blocking all registers at the top of each catch block or irreducible loop, we force
-      // intervals belonging to the live-in set of the catch/header block to be spilled.
-      // TODO(ngeoffray): Phis in this block could be allocated in register.
-      size_t position = block->GetLifetimeStart();
-      BlockRegisters(position, position + 1);
-    }
-  }
-}
-
-bool RegisterAllocatorGraphColor::TryRemoveSuspendCheckEntry(HInstruction* instruction) {
-  LocationSummary* locations = instruction->GetLocations();
-  if (instruction->IsSuspendCheckEntry() && !codegen_->NeedsSuspendCheckEntry()) {
-    // TODO: We do this here because we do not want the suspend check to artificially
-    // create live registers. We should find another place, but this is currently the
-    // simplest.
-    DCHECK_EQ(locations->GetTempCount(), 0u);
-    instruction->GetBlock()->RemoveInstruction(instruction);
-    return true;
-  }
-  return false;
-}
-
-void RegisterAllocatorGraphColor::ProcessInstruction(HInstruction* instruction) {
-  LocationSummary* locations = instruction->GetLocations();
-  if (locations == nullptr) {
-    return;
-  }
-  if (TryRemoveSuspendCheckEntry(instruction)) {
-    return;
-  }
-
-  CheckForTempLiveIntervals(instruction);
-  CheckForSafepoint(instruction);
-  if (locations->WillCall()) {
-    // If a call will happen, create fixed intervals for caller-save registers.
-    // TODO: Note that it may be beneficial to later split intervals at this point,
-    //       so that we allow last-minute moves from a caller-save register
-    //       to a callee-save register.
-    BlockRegisters(instruction->GetLifetimePosition(),
-                   instruction->GetLifetimePosition() + 1,
-                   /*caller_save_only*/ true);
-  }
-  CheckForFixedInputs(instruction);
-
-  LiveInterval* interval = instruction->GetLiveInterval();
-  if (interval == nullptr) {
-    // Instructions lacking a valid output location do not have a live interval.
-    DCHECK(!locations->Out().IsValid());
-    return;
-  }
-
-  // Low intervals act as representatives for their corresponding high interval.
-  DCHECK(!interval->IsHighInterval());
-  if (codegen_->NeedsTwoRegisters(interval->GetType())) {
-    interval->AddHighInterval();
-  }
-  AddSafepointsFor(instruction);
-  CheckForFixedOutput(instruction);
-  AllocateSpillSlotForCatchPhi(instruction);
-
-  ScopedArenaVector<LiveInterval*>& intervals = IsCoreInterval(interval)
-      ? core_intervals_
-      : fp_intervals_;
-  if (interval->HasSpillSlot() || instruction->IsConstant()) {
-    // Note that if an interval already has a spill slot, then its value currently resides
-    // in the stack (e.g., parameters). Thus we do not have to allocate a register until its first
-    // register use. This is also true for constants, which can be materialized at any point.
-    size_t first_register_use = interval->FirstRegisterUse();
-    if (first_register_use != kNoLifetime) {
-      LiveInterval* split = SplitBetween(interval, interval->GetStart(), first_register_use - 1);
-      intervals.push_back(split);
-    } else {
-      // We won't allocate a register for this value.
-    }
-  } else {
-    intervals.push_back(interval);
-  }
-}
-
-void RegisterAllocatorGraphColor::CheckForFixedInputs(HInstruction* instruction) {
-  // We simply block physical registers where necessary.
-  // TODO: Ideally we would coalesce the physical register with the register
-  //       allocated to the input value, but this can be tricky if, e.g., there
-  //       could be multiple physical register uses of the same value at the
-  //       same instruction. Furthermore, there's currently no distinction between
-  //       fixed inputs to a call (which will be clobbered) and other fixed inputs (which
-  //       may not be clobbered).
-  LocationSummary* locations = instruction->GetLocations();
-  size_t position = instruction->GetLifetimePosition();
-  for (size_t i = 0; i < locations->GetInputCount(); ++i) {
-    Location input = locations->InAt(i);
-    if (input.IsRegister() || input.IsFpuRegister()) {
-      BlockRegister(input, position, position + 1);
-      codegen_->AddAllocatedRegister(input);
-    } else if (input.IsPair()) {
-      BlockRegister(input.ToLow(), position, position + 1);
-      BlockRegister(input.ToHigh(), position, position + 1);
-      codegen_->AddAllocatedRegister(input.ToLow());
-      codegen_->AddAllocatedRegister(input.ToHigh());
-    }
-  }
-}
-
-void RegisterAllocatorGraphColor::CheckForFixedOutput(HInstruction* instruction) {
-  // If an instruction has a fixed output location, we give the live interval a register and then
-  // proactively split it just after the definition point to avoid creating too many interferences
-  // with a fixed node.
-  LiveInterval* interval = instruction->GetLiveInterval();
-  Location out = interval->GetDefinedBy()->GetLocations()->Out();
-  size_t position = instruction->GetLifetimePosition();
-  DCHECK_GE(interval->GetEnd() - position, 2u);
-
-  if (out.IsUnallocated() && out.GetPolicy() == Location::kSameAsFirstInput) {
-    out = instruction->GetLocations()->InAt(0);
-  }
-
-  if (out.IsRegister() || out.IsFpuRegister()) {
-    interval->SetRegister(out.reg());
-    codegen_->AddAllocatedRegister(out);
-    Split(interval, position + 1);
-  } else if (out.IsPair()) {
-    interval->SetRegister(out.low());
-    interval->GetHighInterval()->SetRegister(out.high());
-    codegen_->AddAllocatedRegister(out.ToLow());
-    codegen_->AddAllocatedRegister(out.ToHigh());
-    Split(interval, position + 1);
-  } else if (out.IsStackSlot() || out.IsDoubleStackSlot()) {
-    interval->SetSpillSlot(out.GetStackIndex());
-  } else {
-    DCHECK(out.IsUnallocated() || out.IsConstant());
-  }
-}
-
-void RegisterAllocatorGraphColor::AddSafepointsFor(HInstruction* instruction) {
-  LiveInterval* interval = instruction->GetLiveInterval();
-  for (size_t safepoint_index = safepoints_.size(); safepoint_index > 0; --safepoint_index) {
-    HInstruction* safepoint = safepoints_[safepoint_index - 1u];
-    size_t safepoint_position = safepoint->GetLifetimePosition();
-
-    // Test that safepoints_ are ordered in the optimal way.
-    DCHECK(safepoint_index == safepoints_.size() ||
-           safepoints_[safepoint_index]->GetLifetimePosition() < safepoint_position);
-
-    if (safepoint_position == interval->GetStart()) {
-      // The safepoint is for this instruction, so the location of the instruction
-      // does not need to be saved.
-      DCHECK_EQ(safepoint_index, safepoints_.size());
-      DCHECK_EQ(safepoint, instruction);
-      continue;
-    } else if (interval->IsDeadAt(safepoint_position)) {
-      break;
-    } else if (!interval->Covers(safepoint_position)) {
-      // Hole in the interval.
-      continue;
-    }
-    interval->AddSafepoint(safepoint);
-  }
-}
-
-void RegisterAllocatorGraphColor::CheckForTempLiveIntervals(HInstruction* instruction) {
-  LocationSummary* locations = instruction->GetLocations();
-  size_t position = instruction->GetLifetimePosition();
-  for (size_t i = 0; i < locations->GetTempCount(); ++i) {
-    Location temp = locations->GetTemp(i);
-    if (temp.IsRegister() || temp.IsFpuRegister()) {
-      BlockRegister(temp, position, position + 1);
-      codegen_->AddAllocatedRegister(temp);
-    } else {
-      DCHECK(temp.IsUnallocated());
-      switch (temp.GetPolicy()) {
-        case Location::kRequiresRegister: {
-          LiveInterval* interval =
-              LiveInterval::MakeTempInterval(allocator_, DataType::Type::kInt32);
-          interval->AddTempUse(instruction, i);
-          core_intervals_.push_back(interval);
-          temp_intervals_.push_back(interval);
-          break;
-        }
-
-        case Location::kRequiresFpuRegister: {
-          LiveInterval* interval =
-              LiveInterval::MakeTempInterval(allocator_, DataType::Type::kFloat64);
-          interval->AddTempUse(instruction, i);
-          fp_intervals_.push_back(interval);
-          temp_intervals_.push_back(interval);
-          if (codegen_->NeedsTwoRegisters(DataType::Type::kFloat64)) {
-            interval->AddHighInterval(/*is_temp*/ true);
-            temp_intervals_.push_back(interval->GetHighInterval());
-          }
-          break;
-        }
-
-        default:
-          LOG(FATAL) << "Unexpected policy for temporary location "
-                     << temp.GetPolicy();
-      }
-    }
-  }
-}
-
-void RegisterAllocatorGraphColor::CheckForSafepoint(HInstruction* instruction) {
-  LocationSummary* locations = instruction->GetLocations();
-
-  if (locations->NeedsSafepoint()) {
-    safepoints_.push_back(instruction);
-  }
-}
-
-LiveInterval* RegisterAllocatorGraphColor::TrySplit(LiveInterval* interval, size_t position) {
-  if (interval->GetStart() < position && position < interval->GetEnd()) {
-    return Split(interval, position);
-  } else {
-    return interval;
-  }
-}
-
-void RegisterAllocatorGraphColor::SplitAtRegisterUses(LiveInterval* interval) {
-  DCHECK(!interval->IsHighInterval());
-
-  // Split just after a register definition.
-  if (interval->IsParent() && interval->DefinitionRequiresRegister()) {
-    interval = TrySplit(interval, interval->GetStart() + 1);
-  }
-
-  // Process uses in the range [interval->GetStart(), interval->GetEnd()], i.e.
-  // [interval->GetStart(), interval->GetEnd() + 1)
-  auto matching_use_range = FindMatchingUseRange(interval->GetUses().begin(),
-                                                 interval->GetUses().end(),
-                                                 interval->GetStart(),
-                                                 interval->GetEnd() + 1u);
-  // Split around register uses.
-  for (const UsePosition& use : matching_use_range) {
-    if (use.RequiresRegister()) {
-      size_t position = use.GetPosition();
-      interval = TrySplit(interval, position - 1);
-      if (liveness_.GetInstructionFromPosition(position / 2)->IsControlFlow()) {
-        // If we are at the very end of a basic block, we cannot split right
-        // at the use. Split just after instead.
-        interval = TrySplit(interval, position + 1);
-      } else {
-        interval = TrySplit(interval, position);
-      }
-    }
-  }
-}
-
-void RegisterAllocatorGraphColor::AllocateSpillSlotForCatchPhi(HInstruction* instruction) {
-  if (instruction->IsPhi() && instruction->AsPhi()->IsCatchPhi()) {
-    HPhi* phi = instruction->AsPhi();
-    LiveInterval* interval = phi->GetLiveInterval();
-
-    HInstruction* previous_phi = phi->GetPrevious();
-    DCHECK(previous_phi == nullptr ||
-           previous_phi->AsPhi()->GetRegNumber() <= phi->GetRegNumber())
-        << "Phis expected to be sorted by vreg number, "
-        << "so that equivalent phis are adjacent.";
-
-    if (phi->IsVRegEquivalentOf(previous_phi)) {
-      // Assign the same spill slot.
-      DCHECK(previous_phi->GetLiveInterval()->HasSpillSlot());
-      interval->SetSpillSlot(previous_phi->GetLiveInterval()->GetSpillSlot());
-    } else {
-      interval->SetSpillSlot(catch_phi_spill_slot_counter_);
-      catch_phi_spill_slot_counter_ += interval->NumberOfSpillSlotsNeeded();
-    }
-  }
-}
-
-void RegisterAllocatorGraphColor::BlockRegister(Location location,
-                                                size_t start,
-                                                size_t end) {
-  DCHECK(location.IsRegister() || location.IsFpuRegister());
-  int reg = location.reg();
-  LiveInterval* interval = location.IsRegister()
-      ? physical_core_nodes_[reg]->GetInterval()
-      : physical_fp_nodes_[reg]->GetInterval();
-  DCHECK(interval->GetRegister() == reg);
-  bool blocked_by_codegen = location.IsRegister()
-      ? codegen_->IsBlockedCoreRegister(reg)
-      : codegen_->IsBlockedFloatingPointRegister(reg);
-  if (blocked_by_codegen) {
-    // We've already blocked this register for the entire method. (And adding a
-    // range inside another range violates the preconditions of AddRange).
-  } else {
-    interval->AddRange(start, end);
-  }
-}
-
-void RegisterAllocatorGraphColor::BlockRegisters(size_t start, size_t end, bool caller_save_only) {
-  for (size_t i = 0; i < codegen_->GetNumberOfCoreRegisters(); ++i) {
-    if (!caller_save_only || !codegen_->IsCoreCalleeSaveRegister(i)) {
-      BlockRegister(Location::RegisterLocation(i), start, end);
-    }
-  }
-  for (size_t i = 0; i < codegen_->GetNumberOfFloatingPointRegisters(); ++i) {
-    if (!caller_save_only || !codegen_->IsFloatingPointCalleeSaveRegister(i)) {
-      BlockRegister(Location::FpuRegisterLocation(i), start, end);
-    }
-  }
-}
-
-void ColoringIteration::AddPotentialInterference(InterferenceNode* from,
-                                                 InterferenceNode* to,
-                                                 bool guaranteed_not_interfering_yet,
-                                                 bool both_directions) {
-  if (from->IsPrecolored()) {
-    // We save space by ignoring outgoing edges from fixed nodes.
-  } else if (to->IsPrecolored()) {
-    // It is important that only a single node represents a given fixed register in the
-    // interference graph. We retrieve that node here.
-    const ScopedArenaVector<InterferenceNode*>& physical_nodes =
-        to->GetInterval()->IsFloatingPoint() ? register_allocator_->physical_fp_nodes_
-                                             : register_allocator_->physical_core_nodes_;
-    InterferenceNode* physical_node = physical_nodes[to->GetInterval()->GetRegister()];
-    from->AddInterference(
-        physical_node, /*guaranteed_not_interfering_yet*/ false, &adjacent_nodes_links_);
-    DCHECK_EQ(to->GetInterval()->GetRegister(), physical_node->GetInterval()->GetRegister());
-    DCHECK_EQ(to->GetAlias(), physical_node) << "Fixed nodes should alias the canonical fixed node";
-
-    // If a node interferes with a fixed pair node, the weight of the edge may
-    // be inaccurate after using the alias of the pair node, because the alias of the pair node
-    // is a singular node.
-    // We could make special pair fixed nodes, but that ends up being too conservative because
-    // a node could then interfere with both {r1} and {r1,r2}, leading to a degree of
-    // three rather than two.
-    // Instead, we explicitly add an interference with the high node of the fixed pair node.
-    // TODO: This is too conservative at time for pair nodes, but the fact that fixed pair intervals
-    //       can be unaligned on x86 complicates things.
-    if (to->IsPair()) {
-      InterferenceNode* high_node =
-          physical_nodes[to->GetInterval()->GetHighInterval()->GetRegister()];
-      DCHECK_EQ(to->GetInterval()->GetHighInterval()->GetRegister(),
-                high_node->GetInterval()->GetRegister());
-      from->AddInterference(
-          high_node, /*guaranteed_not_interfering_yet*/ false, &adjacent_nodes_links_);
-    }
-  } else {
-    // Standard interference between two uncolored nodes.
-    from->AddInterference(to, guaranteed_not_interfering_yet, &adjacent_nodes_links_);
-  }
-
-  if (both_directions) {
-    AddPotentialInterference(to, from, guaranteed_not_interfering_yet, /*both_directions*/ false);
-  }
-}
-
-// Returns true if `in_node` represents an input interval of `out_node`, and the output interval
-// is allowed to have the same register as the input interval.
-// TODO: Ideally we should just produce correct intervals in liveness analysis.
-//       We would need to refactor the current live interval layout to do so, which is
-//       no small task.
-static bool CheckInputOutputCanOverlap(InterferenceNode* in_node, InterferenceNode* out_node) {
-  LiveInterval* output_interval = out_node->GetInterval();
-  HInstruction* defined_by = output_interval->GetDefinedBy();
-  if (defined_by == nullptr) {
-    // This must not be a definition point.
-    return false;
-  }
-
-  LocationSummary* locations = defined_by->GetLocations();
-  if (locations->OutputCanOverlapWithInputs()) {
-    // This instruction does not allow the output to reuse a register from an input.
-    return false;
-  }
-
-  LiveInterval* input_interval = in_node->GetInterval();
-  LiveInterval* next_sibling = input_interval->GetNextSibling();
-  size_t def_position = defined_by->GetLifetimePosition();
-  size_t use_position = def_position + 1;
-  if (next_sibling != nullptr && next_sibling->GetStart() == use_position) {
-    // The next sibling starts at the use position, so reusing the input register in the output
-    // would clobber the input before it's moved into the sibling interval location.
-    return false;
-  }
-
-  if (!input_interval->IsDeadAt(use_position) && input_interval->CoversSlow(use_position)) {
-    // The input interval is live after the use position.
-    return false;
-  }
-
-  HInputsRef inputs = defined_by->GetInputs();
-  for (size_t i = 0; i < inputs.size(); ++i) {
-    if (inputs[i]->GetLiveInterval()->GetSiblingAt(def_position) == input_interval) {
-      DCHECK(input_interval->SameRegisterKind(*output_interval));
-      return true;
-    }
-  }
-
-  // The input interval was not an input for this instruction.
-  return false;
-}
-
-void ColoringIteration::BuildInterferenceGraph(
-    const ScopedArenaVector<LiveInterval*>& intervals,
-    const ScopedArenaVector<InterferenceNode*>& physical_nodes) {
-  DCHECK(interval_node_map_.empty() && prunable_nodes_.empty());
-  // Build the interference graph efficiently by ordering range endpoints
-  // by position and doing a linear sweep to find interferences. (That is, we
-  // jump from endpoint to endpoint, maintaining a set of intervals live at each
-  // point. If two nodes are ever in the live set at the same time, then they
-  // interfere with each other.)
-  //
-  // We order by both position and (secondarily) by whether the endpoint
-  // begins or ends a range; we want to process range endings before range
-  // beginnings at the same position because they should not conflict.
-  //
-  // For simplicity, we create a tuple for each endpoint, and then sort the tuples.
-  // Tuple contents: (position, is_range_beginning, node).
-  ScopedArenaVector<std::tuple<size_t, bool, InterferenceNode*>> range_endpoints(
-      allocator_->Adapter(kArenaAllocRegisterAllocator));
-
-  // We reserve plenty of space to avoid excessive copying.
-  range_endpoints.reserve(4 * prunable_nodes_.size());
-
-  for (LiveInterval* parent : intervals) {
-    for (LiveInterval* sibling = parent; sibling != nullptr; sibling = sibling->GetNextSibling()) {
-      LiveRange* range = sibling->GetFirstRange();
-      if (range != nullptr) {
-        InterferenceNode* node =
-            new (allocator_) InterferenceNode(sibling, register_allocator_->liveness_);
-        interval_node_map_.insert(std::make_pair(sibling, node));
-
-        if (sibling->HasRegister()) {
-          // Fixed nodes should alias the canonical node for the corresponding register.
-          node->stage = NodeStage::kPrecolored;
-          InterferenceNode* physical_node = physical_nodes[sibling->GetRegister()];
-          node->SetAlias(physical_node);
-          DCHECK_EQ(node->GetInterval()->GetRegister(),
-                    physical_node->GetInterval()->GetRegister());
-        } else {
-          node->stage = NodeStage::kPrunable;
-          prunable_nodes_.push_back(node);
-        }
-
-        while (range != nullptr) {
-          range_endpoints.push_back(std::make_tuple(range->GetStart(), true, node));
-          range_endpoints.push_back(std::make_tuple(range->GetEnd(), false, node));
-          range = range->GetNext();
-        }
-      }
-    }
-  }
-
-  // Sort the endpoints.
-  // We explicitly ignore the third entry of each tuple (the node pointer) in order
-  // to maintain determinism.
-  std::sort(range_endpoints.begin(), range_endpoints.end(),
-            [] (const std::tuple<size_t, bool, InterferenceNode*>& lhs,
-                const std::tuple<size_t, bool, InterferenceNode*>& rhs) {
-    return std::tie(std::get<0>(lhs), std::get<1>(lhs))
-         < std::tie(std::get<0>(rhs), std::get<1>(rhs));
-  });
-
-  // Nodes live at the current position in the linear sweep.
-  ScopedArenaVector<InterferenceNode*> live(allocator_->Adapter(kArenaAllocRegisterAllocator));
-
-  // Linear sweep. When we encounter the beginning of a range, we add the corresponding node to the
-  // live set. When we encounter the end of a range, we remove the corresponding node
-  // from the live set. Nodes interfere if they are in the live set at the same time.
-  for (auto it = range_endpoints.begin(); it != range_endpoints.end(); ++it) {
-    bool is_range_beginning;
-    InterferenceNode* node;
-    size_t position;
-    // Extract information from the tuple, including the node this tuple represents.
-    std::tie(position, is_range_beginning, node) = *it;
-
-    if (is_range_beginning) {
-      bool guaranteed_not_interfering_yet = position == node->GetInterval()->GetStart();
-      for (InterferenceNode* conflicting : live) {
-        DCHECK_NE(node, conflicting);
-        if (CheckInputOutputCanOverlap(conflicting, node)) {
-          // We do not add an interference, because the instruction represented by `node` allows
-          // its output to share a register with an input, represented here by `conflicting`.
-        } else {
-          AddPotentialInterference(node, conflicting, guaranteed_not_interfering_yet);
-        }
-      }
-      DCHECK(std::find(live.begin(), live.end(), node) == live.end());
-      live.push_back(node);
-    } else {
-      // End of range.
-      auto live_it = std::find(live.begin(), live.end(), node);
-      DCHECK(live_it != live.end());
-      live.erase(live_it);
-    }
-  }
-  DCHECK(live.empty());
-}
-
-void ColoringIteration::CreateCoalesceOpportunity(InterferenceNode* a,
-                                                  InterferenceNode* b,
-                                                  CoalesceKind kind,
-                                                  size_t position) {
-  DCHECK_EQ(a->IsPair(), b->IsPair())
-      << "Nodes of different memory widths should never be coalesced";
-  CoalesceOpportunity* opportunity =
-      new (allocator_) CoalesceOpportunity(a, b, kind, position, register_allocator_->liveness_);
-  a->AddCoalesceOpportunity(opportunity, &coalesce_opportunities_links_);
-  b->AddCoalesceOpportunity(opportunity, &coalesce_opportunities_links_);
-  coalesce_worklist_.push(opportunity);
-}
-
-// When looking for coalesce opportunities, we use the interval_node_map_ to find the node
-// corresponding to an interval. Note that not all intervals are in this map, notably the parents
-// of constants and stack arguments. (However, these interval should not be involved in coalesce
-// opportunities anyway, because they're not going to be in registers.)
-void ColoringIteration::FindCoalesceOpportunities() {
-  DCHECK(coalesce_worklist_.empty());
-
-  for (InterferenceNode* node : prunable_nodes_) {
-    LiveInterval* interval = node->GetInterval();
-
-    // Coalesce siblings.
-    LiveInterval* next_sibling = interval->GetNextSibling();
-    if (next_sibling != nullptr && interval->GetEnd() == next_sibling->GetStart()) {
-      auto it = interval_node_map_.find(next_sibling);
-      if (it != interval_node_map_.end()) {
-        InterferenceNode* sibling_node = it->second;
-        CreateCoalesceOpportunity(node,
-                                  sibling_node,
-                                  CoalesceKind::kAdjacentSibling,
-                                  interval->GetEnd());
-      }
-    }
-
-    // Coalesce fixed outputs with this interval if this interval is an adjacent sibling.
-    LiveInterval* parent = interval->GetParent();
-    if (parent->HasRegister()
-        && parent->GetNextSibling() == interval
-        && parent->GetEnd() == interval->GetStart()) {
-      auto it = interval_node_map_.find(parent);
-      if (it != interval_node_map_.end()) {
-        InterferenceNode* parent_node = it->second;
-        CreateCoalesceOpportunity(node,
-                                  parent_node,
-                                  CoalesceKind::kFixedOutputSibling,
-                                  parent->GetEnd());
-      }
-    }
-
-    // Try to prevent moves across blocks.
-    // Note that this does not lead to many succeeding coalesce attempts, so could be removed
-    // if found to add to compile time.
-    const SsaLivenessAnalysis& liveness = register_allocator_->liveness_;
-    if (interval->IsSplit() && liveness.IsAtBlockBoundary(interval->GetStart() / 2)) {
-      // If the start of this interval is at a block boundary, we look at the
-      // location of the interval in blocks preceding the block this interval
-      // starts at. This can avoid a move between the two blocks.
-      HBasicBlock* block = liveness.GetBlockFromPosition(interval->GetStart() / 2);
-      for (HBasicBlock* predecessor : block->GetPredecessors()) {
-        size_t position = predecessor->GetLifetimeEnd() - 1;
-        LiveInterval* existing = interval->GetParent()->GetSiblingAt(position);
-        if (existing != nullptr) {
-          auto it = interval_node_map_.find(existing);
-          if (it != interval_node_map_.end()) {
-            InterferenceNode* existing_node = it->second;
-            CreateCoalesceOpportunity(node,
-                                      existing_node,
-                                      CoalesceKind::kNonlinearControlFlow,
-                                      position);
-          }
-        }
-      }
-    }
-
-    // Coalesce phi inputs with the corresponding output.
-    HInstruction* defined_by = interval->GetDefinedBy();
-    if (defined_by != nullptr && defined_by->IsPhi()) {
-      ArrayRef<HBasicBlock* const> predecessors(defined_by->GetBlock()->GetPredecessors());
-      HInputsRef inputs = defined_by->GetInputs();
-
-      for (size_t i = 0, e = inputs.size(); i < e; ++i) {
-        // We want the sibling at the end of the appropriate predecessor block.
-        size_t position = predecessors[i]->GetLifetimeEnd() - 1;
-        LiveInterval* input_interval = inputs[i]->GetLiveInterval()->GetSiblingAt(position);
-
-        auto it = interval_node_map_.find(input_interval);
-        if (it != interval_node_map_.end()) {
-          InterferenceNode* input_node = it->second;
-          CreateCoalesceOpportunity(node, input_node, CoalesceKind::kPhi, position);
-        }
-      }
-    }
-
-    // Coalesce output with first input when policy is kSameAsFirstInput.
-    if (defined_by != nullptr) {
-      Location out = defined_by->GetLocations()->Out();
-      if (out.IsUnallocated() && out.GetPolicy() == Location::kSameAsFirstInput) {
-        LiveInterval* input_interval
-            = defined_by->InputAt(0)->GetLiveInterval()->GetSiblingAt(interval->GetStart() - 1);
-        // TODO: Could we consider lifetime holes here?
-        if (input_interval->GetEnd() == interval->GetStart()) {
-          auto it = interval_node_map_.find(input_interval);
-          if (it != interval_node_map_.end()) {
-            InterferenceNode* input_node = it->second;
-            CreateCoalesceOpportunity(node,
-                                      input_node,
-                                      CoalesceKind::kFirstInput,
-                                      interval->GetStart());
-          }
-        }
-      }
-    }
-
-    // An interval that starts an instruction (that is, it is not split), may
-    // re-use the registers used by the inputs of that instruction, based on the
-    // location summary.
-    if (defined_by != nullptr) {
-      DCHECK(!interval->IsSplit());
-      LocationSummary* locations = defined_by->GetLocations();
-      if (!locations->OutputCanOverlapWithInputs()) {
-        HInputsRef inputs = defined_by->GetInputs();
-        for (size_t i = 0; i < inputs.size(); ++i) {
-          size_t def_point = defined_by->GetLifetimePosition();
-          // TODO: Getting the sibling at the def_point might not be quite what we want
-          //       for fixed inputs, since the use will be *at* the def_point rather than after.
-          LiveInterval* input_interval = inputs[i]->GetLiveInterval()->GetSiblingAt(def_point);
-          if (input_interval != nullptr &&
-              input_interval->HasHighInterval() == interval->HasHighInterval()) {
-            auto it = interval_node_map_.find(input_interval);
-            if (it != interval_node_map_.end()) {
-              InterferenceNode* input_node = it->second;
-              CreateCoalesceOpportunity(node,
-                                        input_node,
-                                        CoalesceKind::kAnyInput,
-                                        interval->GetStart());
-            }
-          }
-        }
-      }
-    }
-
-    // Try to prevent moves into fixed input locations.
-    // Process uses in the range (interval->GetStart(), interval->GetEnd()], i.e.
-    // [interval->GetStart() + 1, interval->GetEnd() + 1)
-    auto matching_use_range = FindMatchingUseRange(interval->GetUses().begin(),
-                                                   interval->GetUses().end(),
-                                                   interval->GetStart() + 1u,
-                                                   interval->GetEnd() + 1u);
-    for (const UsePosition& use : matching_use_range) {
-      HInstruction* user = use.GetUser();
-      if (user == nullptr) {
-        // User may be null for certain intervals, such as temp intervals.
-        continue;
-      }
-      LocationSummary* locations = user->GetLocations();
-      Location input = locations->InAt(use.GetInputIndex());
-      if (input.IsRegister() || input.IsFpuRegister()) {
-        // TODO: Could try to handle pair interval too, but coalescing with fixed pair nodes
-        //       is currently not supported.
-        InterferenceNode* fixed_node = input.IsRegister()
-            ? register_allocator_->physical_core_nodes_[input.reg()]
-            : register_allocator_->physical_fp_nodes_[input.reg()];
-        CreateCoalesceOpportunity(node,
-                                  fixed_node,
-                                  CoalesceKind::kFixedInput,
-                                  user->GetLifetimePosition());
-      }
-    }
-  }  // for node in prunable_nodes
-}
-
-static bool IsLowDegreeNode(InterferenceNode* node, size_t num_regs) {
-  return node->GetOutDegree() < num_regs;
-}
-
-static bool IsHighDegreeNode(InterferenceNode* node, size_t num_regs) {
-  return !IsLowDegreeNode(node, num_regs);
-}
-
-void ColoringIteration::PruneInterferenceGraph() {
-  DCHECK(pruned_nodes_.empty()
-      && simplify_worklist_.empty()
-      && freeze_worklist_.empty()
-      && spill_worklist_.empty());
-  // When pruning the graph, we refer to nodes with degree less than num_regs as low degree nodes,
-  // and all others as high degree nodes. The distinction is important: low degree nodes are
-  // guaranteed a color, while high degree nodes are not.
-
-  // Build worklists. Note that the coalesce worklist has already been
-  // filled by FindCoalesceOpportunities().
-  for (InterferenceNode* node : prunable_nodes_) {
-    DCHECK(!node->IsPrecolored()) << "Fixed nodes should never be pruned";
-    if (IsLowDegreeNode(node, num_regs_)) {
-      if (node->GetCoalesceOpportunities().empty()) {
-        // Simplify Worklist.
-        node->stage = NodeStage::kSimplifyWorklist;
-        simplify_worklist_.push_back(node);
-      } else {
-        // Freeze Worklist.
-        node->stage = NodeStage::kFreezeWorklist;
-        freeze_worklist_.push_back(node);
-      }
-    } else {
-      // Spill worklist.
-      node->stage = NodeStage::kSpillWorklist;
-      spill_worklist_.push(node);
-    }
-  }
-
-  // Prune graph.
-  // Note that we do not remove a node from its current worklist if it moves to another, so it may
-  // be in multiple worklists at once; the node's `phase` says which worklist it is really in.
-  while (true) {
-    if (!simplify_worklist_.empty()) {
-      // Prune low-degree nodes.
-      // TODO: pop_back() should work as well, but it didn't; we get a
-      //       failed check while pruning. We should look into this.
-      InterferenceNode* node = simplify_worklist_.front();
-      simplify_worklist_.pop_front();
-      DCHECK_EQ(node->stage, NodeStage::kSimplifyWorklist) << "Cannot move from simplify list";
-      DCHECK_LT(node->GetOutDegree(), num_regs_) << "Nodes in simplify list should be low degree";
-      DCHECK(!node->IsMoveRelated()) << "Nodes in simplify list should not be move related";
-      PruneNode(node);
-    } else if (!coalesce_worklist_.empty()) {
-      // Coalesce.
-      CoalesceOpportunity* opportunity = coalesce_worklist_.top();
-      coalesce_worklist_.pop();
-      if (opportunity->stage == CoalesceStage::kWorklist) {
-        Coalesce(opportunity);
-      }
-    } else if (!freeze_worklist_.empty()) {
-      // Freeze moves and prune a low-degree move-related node.
-      InterferenceNode* node = freeze_worklist_.front();
-      freeze_worklist_.pop_front();
-      if (node->stage == NodeStage::kFreezeWorklist) {
-        DCHECK_LT(node->GetOutDegree(), num_regs_) << "Nodes in freeze list should be low degree";
-        DCHECK(node->IsMoveRelated()) << "Nodes in freeze list should be move related";
-        FreezeMoves(node);
-        PruneNode(node);
-      }
-    } else if (!spill_worklist_.empty()) {
-      // We spill the lowest-priority node, because pruning a node earlier
-      // gives it a higher chance of being spilled.
-      InterferenceNode* node = spill_worklist_.top();
-      spill_worklist_.pop();
-      if (node->stage == NodeStage::kSpillWorklist) {
-        DCHECK_GE(node->GetOutDegree(), num_regs_) << "Nodes in spill list should be high degree";
-        FreezeMoves(node);
-        PruneNode(node);
-      }
-    } else {
-      // Pruning complete.
-      break;
-    }
-  }
-  DCHECK_EQ(prunable_nodes_.size(), pruned_nodes_.size());
-}
-
-void ColoringIteration::EnableCoalesceOpportunities(InterferenceNode* node) {
-  for (CoalesceOpportunity* opportunity : node->GetCoalesceOpportunities()) {
-    if (opportunity->stage == CoalesceStage::kActive) {
-      opportunity->stage = CoalesceStage::kWorklist;
-      coalesce_worklist_.push(opportunity);
-    }
-  }
-}
-
-void ColoringIteration::PruneNode(InterferenceNode* node) {
-  DCHECK_NE(node->stage, NodeStage::kPruned);
-  DCHECK(!node->IsPrecolored());
-  node->stage = NodeStage::kPruned;
-  pruned_nodes_.push(node);
-
-  for (InterferenceNode* adj : node->GetAdjacentNodes()) {
-    DCHECK_NE(adj->stage, NodeStage::kPruned) << "Should be no interferences with pruned nodes";
-
-    if (adj->IsPrecolored()) {
-      // No effect on pre-colored nodes; they're never pruned.
-    } else {
-      // Remove the interference.
-      bool was_high_degree = IsHighDegreeNode(adj, num_regs_);
-      DCHECK(adj->ContainsInterference(node))
-          << "Missing reflexive interference from non-fixed node";
-      adj->RemoveInterference(node);
-
-      // Handle transitions from high degree to low degree.
-      if (was_high_degree && IsLowDegreeNode(adj, num_regs_)) {
-        EnableCoalesceOpportunities(adj);
-        for (InterferenceNode* adj_adj : adj->GetAdjacentNodes()) {
-          EnableCoalesceOpportunities(adj_adj);
-        }
-
-        DCHECK_EQ(adj->stage, NodeStage::kSpillWorklist);
-        if (adj->IsMoveRelated()) {
-          adj->stage = NodeStage::kFreezeWorklist;
-          freeze_worklist_.push_back(adj);
-        } else {
-          adj->stage = NodeStage::kSimplifyWorklist;
-          simplify_worklist_.push_back(adj);
-        }
-      }
-    }
-  }
-}
-
-void ColoringIteration::CheckTransitionFromFreezeWorklist(InterferenceNode* node) {
-  if (IsLowDegreeNode(node, num_regs_) && !node->IsMoveRelated()) {
-    DCHECK_EQ(node->stage, NodeStage::kFreezeWorklist);
-    node->stage = NodeStage::kSimplifyWorklist;
-    simplify_worklist_.push_back(node);
-  }
-}
-
-void ColoringIteration::FreezeMoves(InterferenceNode* node) {
-  for (CoalesceOpportunity* opportunity : node->GetCoalesceOpportunities()) {
-    if (opportunity->stage == CoalesceStage::kDefunct) {
-      // Constrained moves should remain constrained, since they will not be considered
-      // during last-chance coalescing.
-    } else {
-      opportunity->stage = CoalesceStage::kInactive;
-    }
-    InterferenceNode* other = opportunity->node_a->GetAlias() == node
-        ? opportunity->node_b->GetAlias()
-        : opportunity->node_a->GetAlias();
-    if (other != node && other->stage == NodeStage::kFreezeWorklist) {
-      DCHECK(IsLowDegreeNode(node, num_regs_));
-      CheckTransitionFromFreezeWorklist(other);
-    }
-  }
-}
-
-bool ColoringIteration::PrecoloredHeuristic(InterferenceNode* from,
-                                            InterferenceNode* into) {
-  if (!into->IsPrecolored()) {
-    // The uncolored heuristic will cover this case.
-    return false;
-  }
-  if (from->IsPair() || into->IsPair()) {
-    // TODO: Merging from a pair node is currently not supported, since fixed pair nodes
-    //       are currently represented as two single fixed nodes in the graph, and `into` is
-    //       only one of them. (We may lose the implicit connections to the second one in a merge.)
-    return false;
-  }
-
-  // If all adjacent nodes of `from` are "ok", then we can conservatively merge with `into`.
-  // Reasons an adjacent node `adj` can be "ok":
-  // (1) If `adj` is low degree, interference with `into` will not affect its existing
-  //     colorable guarantee. (Notice that coalescing cannot increase its degree.)
-  // (2) If `adj` is pre-colored, it already interferes with `into`. See (3).
-  // (3) If there's already an interference with `into`, coalescing will not add interferences.
-  for (InterferenceNode* adj : from->GetAdjacentNodes()) {
-    if (IsLowDegreeNode(adj, num_regs_) || adj->IsPrecolored() || adj->ContainsInterference(into)) {
-      // Ok.
-    } else {
-      return false;
-    }
-  }
-  return true;
-}
-
-bool ColoringIteration::UncoloredHeuristic(InterferenceNode* from,
-                                           InterferenceNode* into) {
-  if (into->IsPrecolored()) {
-    // The pre-colored heuristic will handle this case.
-    return false;
-  }
-
-  // Arbitrary cap to improve compile time. Tests show that this has negligible affect
-  // on generated code.
-  if (from->GetOutDegree() + into->GetOutDegree() > 2 * num_regs_) {
-    return false;
-  }
-
-  // It's safe to coalesce two nodes if the resulting node has fewer than `num_regs` neighbors
-  // of high degree. (Low degree neighbors can be ignored, because they will eventually be
-  // pruned from the interference graph in the simplify stage.)
-  size_t high_degree_interferences = 0;
-  for (InterferenceNode* adj : from->GetAdjacentNodes()) {
-    if (IsHighDegreeNode(adj, num_regs_)) {
-      high_degree_interferences += from->EdgeWeightWith(adj);
-    }
-  }
-  for (InterferenceNode* adj : into->GetAdjacentNodes()) {
-    if (IsHighDegreeNode(adj, num_regs_)) {
-      if (from->ContainsInterference(adj)) {
-        // We've already counted this adjacent node.
-        // Furthermore, its degree will decrease if coalescing succeeds. Thus, it's possible that
-        // we should not have counted it at all. (This extends the textbook Briggs coalescing test,
-        // but remains conservative.)
-        if (adj->GetOutDegree() - into->EdgeWeightWith(adj) < num_regs_) {
-          high_degree_interferences -= from->EdgeWeightWith(adj);
-        }
-      } else {
-        high_degree_interferences += into->EdgeWeightWith(adj);
-      }
-    }
-  }
-
-  return high_degree_interferences < num_regs_;
-}
-
-void ColoringIteration::Combine(InterferenceNode* from,
-                                InterferenceNode* into) {
-  from->SetAlias(into);
-
-  // Add interferences.
-  for (InterferenceNode* adj : from->GetAdjacentNodes()) {
-    bool was_low_degree = IsLowDegreeNode(adj, num_regs_);
-    AddPotentialInterference(adj, into, /*guaranteed_not_interfering_yet*/ false);
-    if (was_low_degree && IsHighDegreeNode(adj, num_regs_)) {
-      // This is a (temporary) transition to a high degree node. Its degree will decrease again
-      // when we prune `from`, but it's best to be consistent about the current worklist.
-      adj->stage = NodeStage::kSpillWorklist;
-      spill_worklist_.push(adj);
-    }
-  }
-
-  // Add coalesce opportunities.
-  for (CoalesceOpportunity* opportunity : from->GetCoalesceOpportunities()) {
-    if (opportunity->stage != CoalesceStage::kDefunct) {
-      into->AddCoalesceOpportunity(opportunity, &coalesce_opportunities_links_);
-    }
-  }
-  EnableCoalesceOpportunities(from);
-
-  // Prune and update worklists.
-  PruneNode(from);
-  if (IsLowDegreeNode(into, num_regs_)) {
-    // Coalesce(...) takes care of checking for a transition to the simplify worklist.
-    DCHECK_EQ(into->stage, NodeStage::kFreezeWorklist);
-  } else if (into->stage == NodeStage::kFreezeWorklist) {
-    // This is a transition to a high degree node.
-    into->stage = NodeStage::kSpillWorklist;
-    spill_worklist_.push(into);
-  } else {
-    DCHECK(into->stage == NodeStage::kSpillWorklist || into->stage == NodeStage::kPrecolored);
-  }
-}
-
-void ColoringIteration::Coalesce(CoalesceOpportunity* opportunity) {
-  InterferenceNode* from = opportunity->node_a->GetAlias();
-  InterferenceNode* into = opportunity->node_b->GetAlias();
-  DCHECK_NE(from->stage, NodeStage::kPruned);
-  DCHECK_NE(into->stage, NodeStage::kPruned);
-
-  if (from->IsPrecolored()) {
-    // If we have one pre-colored node, make sure it's the `into` node.
-    std::swap(from, into);
-  }
-
-  if (from == into) {
-    // These nodes have already been coalesced.
-    opportunity->stage = CoalesceStage::kDefunct;
-    CheckTransitionFromFreezeWorklist(from);
-  } else if (from->IsPrecolored() || from->ContainsInterference(into)) {
-    // These nodes interfere.
-    opportunity->stage = CoalesceStage::kDefunct;
-    CheckTransitionFromFreezeWorklist(from);
-    CheckTransitionFromFreezeWorklist(into);
-  } else if (PrecoloredHeuristic(from, into)
-          || UncoloredHeuristic(from, into)) {
-    // We can coalesce these nodes.
-    opportunity->stage = CoalesceStage::kDefunct;
-    Combine(from, into);
-    CheckTransitionFromFreezeWorklist(into);
-  } else {
-    // We cannot coalesce, but we may be able to later.
-    opportunity->stage = CoalesceStage::kActive;
-  }
-}
-
-// Build a mask with a bit set for each register assigned to some
-// interval in `intervals`.
-template <typename Container>
-static std::bitset<kMaxNumRegs> BuildConflictMask(const Container& intervals) {
-  std::bitset<kMaxNumRegs> conflict_mask;
-  for (InterferenceNode* adjacent : intervals) {
-    LiveInterval* conflicting = adjacent->GetInterval();
-    if (conflicting->HasRegister()) {
-      conflict_mask.set(conflicting->GetRegister());
-      if (conflicting->HasHighInterval()) {
-        DCHECK(conflicting->GetHighInterval()->HasRegister());
-        conflict_mask.set(conflicting->GetHighInterval()->GetRegister());
-      }
-    } else {
-      DCHECK(!conflicting->HasHighInterval()
-          || !conflicting->GetHighInterval()->HasRegister());
-    }
-  }
-  return conflict_mask;
-}
-
-bool RegisterAllocatorGraphColor::IsCallerSave(size_t reg, bool processing_core_regs) {
-  return processing_core_regs
-      ? !codegen_->IsCoreCalleeSaveRegister(reg)
-      : !codegen_->IsFloatingPointCalleeSaveRegister(reg);
-}
-
-static bool RegisterIsAligned(size_t reg) {
-  return reg % 2 == 0;
-}
-
-static size_t FindFirstZeroInConflictMask(std::bitset<kMaxNumRegs> conflict_mask) {
-  // We use CTZ (count trailing zeros) to quickly find the lowest 0 bit.
-  // Note that CTZ is undefined if all bits are 0, so we special-case it.
-  return conflict_mask.all() ? conflict_mask.size() : CTZ(~conflict_mask.to_ulong());
-}
-
-bool ColoringIteration::ColorInterferenceGraph() {
-  DCHECK_LE(num_regs_, kMaxNumRegs) << "kMaxNumRegs is too small";
-  ScopedArenaVector<LiveInterval*> colored_intervals(
-      allocator_->Adapter(kArenaAllocRegisterAllocator));
-  bool successful = true;
-
-  while (!pruned_nodes_.empty()) {
-    InterferenceNode* node = pruned_nodes_.top();
-    pruned_nodes_.pop();
-    LiveInterval* interval = node->GetInterval();
-    size_t reg = 0;
-
-    InterferenceNode* alias = node->GetAlias();
-    if (alias != node) {
-      // This node was coalesced with another.
-      LiveInterval* alias_interval = alias->GetInterval();
-      if (alias_interval->HasRegister()) {
-        reg = alias_interval->GetRegister();
-        DCHECK(!BuildConflictMask(node->GetAdjacentNodes())[reg])
-            << "This node conflicts with the register it was coalesced with";
-      } else {
-        DCHECK(false) << node->GetOutDegree() << " " << alias->GetOutDegree() << " "
-            << "Move coalescing was not conservative, causing a node to be coalesced "
-            << "with another node that could not be colored";
-        if (interval->RequiresRegister()) {
-          successful = false;
-        }
-      }
-    } else {
-      // Search for free register(s).
-      std::bitset<kMaxNumRegs> conflict_mask = BuildConflictMask(node->GetAdjacentNodes());
-      if (interval->HasHighInterval()) {
-        // Note that the graph coloring allocator assumes that pair intervals are aligned here,
-        // excluding pre-colored pair intervals (which can currently be unaligned on x86). If we
-        // change the alignment requirements here, we will have to update the algorithm (e.g.,
-        // be more conservative about the weight of edges adjacent to pair nodes.)
-        while (reg < num_regs_ - 1 && (conflict_mask[reg] || conflict_mask[reg + 1])) {
-          reg += 2;
-        }
-
-        // Try to use a caller-save register first.
-        for (size_t i = 0; i < num_regs_ - 1; i += 2) {
-          bool low_caller_save  = register_allocator_->IsCallerSave(i, processing_core_regs_);
-          bool high_caller_save = register_allocator_->IsCallerSave(i + 1, processing_core_regs_);
-          if (!conflict_mask[i] && !conflict_mask[i + 1]) {
-            if (low_caller_save && high_caller_save) {
-              reg = i;
-              break;
-            } else if (low_caller_save || high_caller_save) {
-              reg = i;
-              // Keep looking to try to get both parts in caller-save registers.
-            }
-          }
-        }
-      } else {
-        // Not a pair interval.
-        reg = FindFirstZeroInConflictMask(conflict_mask);
-
-        // Try to use caller-save registers first.
-        for (size_t i = 0; i < num_regs_; ++i) {
-          if (!conflict_mask[i] && register_allocator_->IsCallerSave(i, processing_core_regs_)) {
-            reg = i;
-            break;
-          }
-        }
-      }
-
-      // Last-chance coalescing.
-      for (CoalesceOpportunity* opportunity : node->GetCoalesceOpportunities()) {
-        if (opportunity->stage == CoalesceStage::kDefunct) {
-          continue;
-        }
-        LiveInterval* other_interval = opportunity->node_a->GetAlias() == node
-            ? opportunity->node_b->GetAlias()->GetInterval()
-            : opportunity->node_a->GetAlias()->GetInterval();
-        if (other_interval->HasRegister()) {
-          size_t coalesce_register = other_interval->GetRegister();
-          if (interval->HasHighInterval()) {
-            if (!conflict_mask[coalesce_register] &&
-                !conflict_mask[coalesce_register + 1] &&
-                RegisterIsAligned(coalesce_register)) {
-              reg = coalesce_register;
-              break;
-            }
-          } else if (!conflict_mask[coalesce_register]) {
-            reg = coalesce_register;
-            break;
-          }
-        }
-      }
-    }
-
-    if (reg < (interval->HasHighInterval() ? num_regs_ - 1 : num_regs_)) {
-      // Assign register.
-      DCHECK(!interval->HasRegister());
-      interval->SetRegister(reg);
-      colored_intervals.push_back(interval);
-      if (interval->HasHighInterval()) {
-        DCHECK(!interval->GetHighInterval()->HasRegister());
-        interval->GetHighInterval()->SetRegister(reg + 1);
-        colored_intervals.push_back(interval->GetHighInterval());
-      }
-    } else if (interval->RequiresRegister()) {
-      // The interference graph is too dense to color. Make it sparser by
-      // splitting this live interval.
-      successful = false;
-      register_allocator_->SplitAtRegisterUses(interval);
-      // We continue coloring, because there may be additional intervals that cannot
-      // be colored, and that we should split.
-    } else {
-      // Spill.
-      node->SetNeedsSpillSlot();
-    }
-  }
-
-  // If unsuccessful, reset all register assignments.
-  if (!successful) {
-    for (LiveInterval* interval : colored_intervals) {
-      interval->ClearRegister();
-    }
-  }
-
-  return successful;
-}
-
-void RegisterAllocatorGraphColor::AllocateSpillSlots(ArrayRef<InterferenceNode* const> nodes) {
-  // The register allocation resolver will organize the stack based on value type,
-  // so we assign stack slots for each value type separately.
-  ScopedArenaAllocator allocator(allocator_->GetArenaStack());
-  ScopedArenaAllocatorAdapter<void> adapter = allocator.Adapter(kArenaAllocRegisterAllocator);
-  ScopedArenaVector<LiveInterval*> double_intervals(adapter);
-  ScopedArenaVector<LiveInterval*> long_intervals(adapter);
-  ScopedArenaVector<LiveInterval*> float_intervals(adapter);
-  ScopedArenaVector<LiveInterval*> int_intervals(adapter);
-
-  // The set of parent intervals already handled.
-  ScopedArenaSet<LiveInterval*> seen(adapter);
-
-  // Find nodes that need spill slots.
-  for (InterferenceNode* node : nodes) {
-    if (!node->NeedsSpillSlot()) {
-      continue;
-    }
-
-    LiveInterval* parent = node->GetInterval()->GetParent();
-    if (seen.find(parent) != seen.end()) {
-      // We've already handled this interval.
-      // This can happen if multiple siblings of the same interval request a stack slot.
-      continue;
-    }
-    seen.insert(parent);
-
-    HInstruction* defined_by = parent->GetDefinedBy();
-    if (parent->HasSpillSlot()) {
-      // We already have a spill slot for this value that we can reuse.
-    } else if (defined_by->IsParameterValue()) {
-      // Parameters already have a stack slot.
-      parent->SetSpillSlot(codegen_->GetStackSlotOfParameter(defined_by->AsParameterValue()));
-    } else if (defined_by->IsCurrentMethod()) {
-      // The current method is always at stack slot 0.
-      parent->SetSpillSlot(0);
-    } else if (defined_by->IsConstant()) {
-      // Constants don't need a spill slot.
-    } else {
-      // We need to find a spill slot for this interval. Place it in the correct
-      // worklist to be processed later.
-      switch (node->GetInterval()->GetType()) {
-        case DataType::Type::kFloat64:
-          double_intervals.push_back(parent);
-          break;
-        case DataType::Type::kInt64:
-          long_intervals.push_back(parent);
-          break;
-        case DataType::Type::kFloat32:
-          float_intervals.push_back(parent);
-          break;
-        case DataType::Type::kReference:
-        case DataType::Type::kInt32:
-        case DataType::Type::kUint16:
-        case DataType::Type::kUint8:
-        case DataType::Type::kInt8:
-        case DataType::Type::kBool:
-        case DataType::Type::kInt16:
-          int_intervals.push_back(parent);
-          break;
-        case DataType::Type::kUint32:
-        case DataType::Type::kUint64:
-        case DataType::Type::kVoid:
-          LOG(FATAL) << "Unexpected type for interval " << node->GetInterval()->GetType();
-          UNREACHABLE();
-      }
-    }
-  }
-
-  // Color spill slots for each value type.
-  ColorSpillSlots(ArrayRef<LiveInterval* const>(double_intervals), &num_double_spill_slots_);
-  ColorSpillSlots(ArrayRef<LiveInterval* const>(long_intervals), &num_long_spill_slots_);
-  ColorSpillSlots(ArrayRef<LiveInterval* const>(float_intervals), &num_float_spill_slots_);
-  ColorSpillSlots(ArrayRef<LiveInterval* const>(int_intervals), &num_int_spill_slots_);
-}
-
-void RegisterAllocatorGraphColor::ColorSpillSlots(ArrayRef<LiveInterval* const> intervals,
-                                                  /* out */ size_t* num_stack_slots_used) {
-  // We cannot use the original interference graph here because spill slots are assigned to
-  // all of the siblings of an interval, whereas an interference node represents only a single
-  // sibling. So, we assign spill slots linear-scan-style by sorting all the interval endpoints
-  // by position, and assigning the lowest spill slot available when we encounter an interval
-  // beginning. We ignore lifetime holes for simplicity.
-  ScopedArenaAllocator allocator(allocator_->GetArenaStack());
-  ScopedArenaVector<std::tuple<size_t, bool, LiveInterval*>> interval_endpoints(
-      allocator.Adapter(kArenaAllocRegisterAllocator));
-
-  for (LiveInterval* parent_interval : intervals) {
-    DCHECK(parent_interval->IsParent());
-    DCHECK(!parent_interval->HasSpillSlot());
-    size_t start = parent_interval->GetStart();
-    size_t end = parent_interval->GetLastSibling()->GetEnd();
-    DCHECK_LT(start, end);
-    interval_endpoints.push_back(std::make_tuple(start, true, parent_interval));
-    interval_endpoints.push_back(std::make_tuple(end, false, parent_interval));
-  }
-
-  // Sort by position.
-  // We explicitly ignore the third entry of each tuple (the interval pointer) in order
-  // to maintain determinism.
-  std::sort(interval_endpoints.begin(), interval_endpoints.end(),
-            [] (const std::tuple<size_t, bool, LiveInterval*>& lhs,
-                const std::tuple<size_t, bool, LiveInterval*>& rhs) {
-    return std::tie(std::get<0>(lhs), std::get<1>(lhs))
-         < std::tie(std::get<0>(rhs), std::get<1>(rhs));
-  });
-
-  ArenaBitVector taken(&allocator, 0, true, kArenaAllocRegisterAllocator);
-  for (auto it = interval_endpoints.begin(), end = interval_endpoints.end(); it != end; ++it) {
-    // Extract information from the current tuple.
-    LiveInterval* parent_interval;
-    bool is_interval_beginning;
-    size_t position;
-    std::tie(position, is_interval_beginning, parent_interval) = *it;
-    size_t number_of_spill_slots_needed = parent_interval->NumberOfSpillSlotsNeeded();
-
-    if (is_interval_beginning) {
-      DCHECK(!parent_interval->HasSpillSlot());
-      DCHECK_EQ(position, parent_interval->GetStart());
-
-      // Find first available free stack slot(s).
-      size_t slot = 0;
-      for (; ; ++slot) {
-        bool found = true;
-        for (size_t s = slot, u = slot + number_of_spill_slots_needed; s < u; s++) {
-          if (taken.IsBitSet(s)) {
-            found = false;
-            break;  // failure
-          }
-        }
-        if (found) {
-          break;  // success
-        }
-      }
-
-      parent_interval->SetSpillSlot(slot);
-
-      *num_stack_slots_used = std::max(*num_stack_slots_used, slot + number_of_spill_slots_needed);
-      if (number_of_spill_slots_needed > 1 && *num_stack_slots_used % 2 != 0) {
-        // The parallel move resolver requires that there be an even number of spill slots
-        // allocated for pair value types.
-        ++(*num_stack_slots_used);
-      }
-
-      for (size_t s = slot, u = slot + number_of_spill_slots_needed; s < u; s++) {
-        taken.SetBit(s);
-      }
-    } else {
-      DCHECK_EQ(position, parent_interval->GetLastSibling()->GetEnd());
-      DCHECK(parent_interval->HasSpillSlot());
-
-      // Free up the stack slot(s) used by this interval.
-      size_t slot = parent_interval->GetSpillSlot();
-      for (size_t s = slot, u = slot + number_of_spill_slots_needed; s < u; s++) {
-        DCHECK(taken.IsBitSet(s));
-        taken.ClearBit(s);
-      }
-    }
-  }
-  DCHECK_EQ(taken.NumSetBits(), 0u);
-}
-
-}  // namespace art
diff --git a/compiler/optimizing/register_allocator_graph_color.h b/compiler/optimizing/register_allocator_graph_color.h
deleted file mode 100644
index 0e10152..0000000
--- a/compiler/optimizing/register_allocator_graph_color.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ART_COMPILER_OPTIMIZING_REGISTER_ALLOCATOR_GRAPH_COLOR_H_
-#define ART_COMPILER_OPTIMIZING_REGISTER_ALLOCATOR_GRAPH_COLOR_H_
-
-#include "arch/instruction_set.h"
-#include "base/arena_object.h"
-#include "base/array_ref.h"
-#include "base/macros.h"
-#include "base/scoped_arena_containers.h"
-#include "register_allocator.h"
-
-namespace art HIDDEN {
-
-class CodeGenerator;
-class HBasicBlock;
-class HGraph;
-class HInstruction;
-class HParallelMove;
-class Location;
-class SsaLivenessAnalysis;
-class InterferenceNode;
-struct CoalesceOpportunity;
-enum class CoalesceKind;
-
-/**
- * A graph coloring register allocator.
- *
- * The algorithm proceeds as follows:
- * (1) Build an interference graph, where nodes represent live intervals, and edges represent
- *     interferences between two intervals. Coloring this graph with k colors is isomorphic to
- *     finding a valid register assignment with k registers.
- * (2) To color the graph, first prune all nodes with degree less than k, since these nodes are
- *     guaranteed a color. (No matter how we color their adjacent nodes, we can give them a
- *     different color.) As we prune nodes from the graph, more nodes may drop below degree k,
- *     enabling further pruning. The key is to maintain the pruning order in a stack, so that we
- *     can color the nodes in the reverse order.
- *     When there are no more nodes with degree less than k, we start pruning alternate nodes based
- *     on heuristics. Since these nodes are not guaranteed a color, we are careful to
- *     prioritize nodes that require a register. We also prioritize short intervals, because
- *     short intervals cannot be split very much if coloring fails (see below). "Prioritizing"
- *     a node amounts to pruning it later, since it will have fewer interferences if we prune other
- *     nodes first.
- * (3) We color nodes in the reverse order in which we pruned them. If we cannot assign
- *     a node a color, we do one of two things:
- *     - If the node requires a register, we consider the current coloring attempt a failure.
- *       However, we split the node's live interval in order to make the interference graph
- *       sparser, so that future coloring attempts may succeed.
- *     - If the node does not require a register, we simply assign it a location on the stack.
- *
- * If iterative move coalescing is enabled, the algorithm also attempts to conservatively
- * combine nodes in the graph that would prefer to have the same color. (For example, the output
- * of a phi instruction would prefer to have the same register as at least one of its inputs.)
- * There are several additional steps involved with this:
- * - We look for coalesce opportunities by examining each live interval, a step similar to that
- *   used by linear scan when looking for register hints.
- * - When pruning the graph, we maintain a worklist of coalesce opportunities, as well as a worklist
- *   of low degree nodes that have associated coalesce opportunities. Only when we run out of
- *   coalesce opportunities do we start pruning coalesce-associated nodes.
- * - When pruning a node, if any nodes transition from high degree to low degree, we add
- *   associated coalesce opportunities to the worklist, since these opportunities may now succeed.
- * - Whether two nodes can be combined is decided by two different heuristics--one used when
- *   coalescing uncolored nodes, and one used for coalescing an uncolored node with a colored node.
- *   It is vital that we only combine two nodes if the node that remains is guaranteed to receive
- *   a color. This is because additionally spilling is more costly than failing to coalesce.
- * - Even if nodes are not coalesced while pruning, we keep the coalesce opportunities around
- *   to be used as last-chance register hints when coloring. If nothing else, we try to use
- *   caller-save registers before callee-save registers.
- *
- * A good reference for graph coloring register allocation is
- * "Modern Compiler Implementation in Java" (Andrew W. Appel, 2nd Edition).
- */
-class RegisterAllocatorGraphColor : public RegisterAllocator {
- public:
-  RegisterAllocatorGraphColor(ScopedArenaAllocator* allocator,
-                              CodeGenerator* codegen,
-                              const SsaLivenessAnalysis& analysis,
-                              bool iterative_move_coalescing = true);
-  ~RegisterAllocatorGraphColor() override;
-
-  void AllocateRegisters() override;
-
-  bool Validate(bool log_fatal_on_failure) override;
-
- private:
-  // Collect all intervals and prepare for register allocation.
-  void ProcessInstructions();
-  void ProcessInstruction(HInstruction* instruction);
-
-  // If any inputs require specific registers, block those registers
-  // at the position of this instruction.
-  void CheckForFixedInputs(HInstruction* instruction);
-
-  // If the output of an instruction requires a specific register, split
-  // the interval and assign the register to the first part.
-  void CheckForFixedOutput(HInstruction* instruction);
-
-  // Add all applicable safepoints to a live interval.
-  // Currently depends on instruction processing order.
-  void AddSafepointsFor(HInstruction* instruction);
-
-  // Collect all live intervals associated with the temporary locations
-  // needed by an instruction.
-  void CheckForTempLiveIntervals(HInstruction* instruction);
-
-  // If a safe point is needed, add a synthesized interval to later record
-  // the number of live registers at this point.
-  void CheckForSafepoint(HInstruction* instruction);
-
-  // Try to remove the SuspendCheck at function entry. Returns true if it was successful.
-  bool TryRemoveSuspendCheckEntry(HInstruction* instruction);
-
-  // Split an interval, but only if `position` is inside of `interval`.
-  // Return either the new interval, or the original interval if not split.
-  static LiveInterval* TrySplit(LiveInterval* interval, size_t position);
-
-  // To ensure every graph can be colored, split live intervals
-  // at their register defs and uses. This creates short intervals with low
-  // degree in the interference graph, which are prioritized during graph
-  // coloring.
-  void SplitAtRegisterUses(LiveInterval* interval);
-
-  // If the given instruction is a catch phi, give it a spill slot.
-  void AllocateSpillSlotForCatchPhi(HInstruction* instruction);
-
-  // Ensure that the given register cannot be allocated for a given range.
-  void BlockRegister(Location location, size_t start, size_t end);
-  void BlockRegisters(size_t start, size_t end, bool caller_save_only = false);
-
-  bool IsCallerSave(size_t reg, bool processing_core_regs);
-
-  // Assigns stack slots to a list of intervals, ensuring that interfering intervals are not
-  // assigned the same stack slot.
-  void ColorSpillSlots(ArrayRef<LiveInterval* const> nodes, /* out */ size_t* num_stack_slots_used);
-
-  // Provide stack slots to nodes that need them.
-  void AllocateSpillSlots(ArrayRef<InterferenceNode* const> nodes);
-
-  // Whether iterative move coalescing should be performed. Iterative move coalescing
-  // improves code quality, but increases compile time.
-  const bool iterative_move_coalescing_;
-
-  // Live intervals, split by kind (core and floating point).
-  // These should not contain high intervals, as those are represented by
-  // the corresponding low interval throughout register allocation.
-  ScopedArenaVector<LiveInterval*> core_intervals_;
-  ScopedArenaVector<LiveInterval*> fp_intervals_;
-
-  // Intervals for temporaries, saved for special handling in the resolution phase.
-  ScopedArenaVector<LiveInterval*> temp_intervals_;
-
-  // Safepoints, saved for special handling while processing instructions.
-  ScopedArenaVector<HInstruction*> safepoints_;
-
-  // Interference nodes representing specific registers. These are "pre-colored" nodes
-  // in the interference graph.
-  ScopedArenaVector<InterferenceNode*> physical_core_nodes_;
-  ScopedArenaVector<InterferenceNode*> physical_fp_nodes_;
-
-  // Allocated stack slot counters.
-  size_t num_int_spill_slots_;
-  size_t num_double_spill_slots_;
-  size_t num_float_spill_slots_;
-  size_t num_long_spill_slots_;
-  size_t catch_phi_spill_slot_counter_;
-
-  // Number of stack slots needed for the pointer to the current method.
-  // This is 1 for 32-bit architectures, and 2 for 64-bit architectures.
-  const size_t reserved_art_method_slots_;
-
-  // Number of stack slots needed for outgoing arguments.
-  const size_t reserved_out_slots_;
-
-  friend class ColoringIteration;
-
-  DISALLOW_COPY_AND_ASSIGN(RegisterAllocatorGraphColor);
-};
-
-}  // namespace art
-
-#endif  // ART_COMPILER_OPTIMIZING_REGISTER_ALLOCATOR_GRAPH_COLOR_H_
diff --git a/compiler/optimizing/register_allocator_linear_scan.cc b/compiler/optimizing/register_allocator_linear_scan.cc
index fcdaa2d..2b1864b 100644
--- a/compiler/optimizing/register_allocator_linear_scan.cc
+++ b/compiler/optimizing/register_allocator_linear_scan.cc
@@ -19,6 +19,7 @@
 #include <iostream>
 #include <sstream>
 
+#include "base/bit_utils_iterator.h"
 #include "base/bit_vector-inl.h"
 #include "base/enums.h"
 #include "code_generator.h"
@@ -52,6 +53,10 @@
         inactive_(allocator->Adapter(kArenaAllocRegisterAllocator)),
         physical_core_register_intervals_(allocator->Adapter(kArenaAllocRegisterAllocator)),
         physical_fp_register_intervals_(allocator->Adapter(kArenaAllocRegisterAllocator)),
+        block_registers_for_call_interval_(
+            LiveInterval::MakeFixedInterval(allocator, kNoRegister, DataType::Type::kVoid)),
+        block_registers_special_interval_(
+            LiveInterval::MakeFixedInterval(allocator, kNoRegister, DataType::Type::kVoid)),
         temp_intervals_(allocator->Adapter(kArenaAllocRegisterAllocator)),
         int_spill_slots_(allocator->Adapter(kArenaAllocRegisterAllocator)),
         long_spill_slots_(allocator->Adapter(kArenaAllocRegisterAllocator)),
@@ -59,7 +64,7 @@
         double_spill_slots_(allocator->Adapter(kArenaAllocRegisterAllocator)),
         catch_phi_spill_slots_(0),
         safepoints_(allocator->Adapter(kArenaAllocRegisterAllocator)),
-        processing_core_registers_(false),
+        current_register_type_(RegisterType::kCoreRegister),
         number_of_registers_(-1),
         registers_array_(nullptr),
         blocked_core_registers_(codegen->GetBlockedCoreRegisters()),
@@ -83,13 +88,6 @@
 
 RegisterAllocatorLinearScan::~RegisterAllocatorLinearScan() {}
 
-static bool ShouldProcess(bool processing_core_registers, LiveInterval* interval) {
-  if (interval == nullptr) return false;
-  bool is_core_register = (interval->GetType() != DataType::Type::kFloat64)
-      && (interval->GetType() != DataType::Type::kFloat32);
-  return processing_core_registers == is_core_register;
-}
-
 void RegisterAllocatorLinearScan::AllocateRegisters() {
   AllocateRegistersInternal();
   RegisterAllocationResolver(codegen_, liveness_)
@@ -103,9 +101,9 @@
                ArrayRef<LiveInterval* const>(temp_intervals_));
 
   if (kIsDebugBuild) {
-    processing_core_registers_ = true;
+    current_register_type_ = RegisterType::kCoreRegister;
     ValidateInternal(true);
-    processing_core_registers_ = false;
+    current_register_type_ = RegisterType::kFpRegister;
     ValidateInternal(true);
     // Check that the linear order is still correct with regards to lifetime positions.
     // Since only parallel moves have been inserted during the register allocation,
@@ -128,8 +126,19 @@
   }
 }
 
-void RegisterAllocatorLinearScan::BlockRegister(Location location, size_t start, size_t end) {
+void RegisterAllocatorLinearScan::BlockRegister(Location location,
+                                                size_t position,
+                                                bool will_call) {
+  DCHECK(location.IsRegister() || location.IsFpuRegister());
   int reg = location.reg();
+  if (will_call) {
+    uint32_t registers_blocked_for_call =
+        location.IsRegister() ? core_registers_blocked_for_call_ : fp_registers_blocked_for_call_;
+    if ((registers_blocked_for_call & (1u << reg)) != 0u) {
+      // Register is already marked as blocked by the `block_registers_for_call_interval_`.
+      return;
+    }
+  }
   DCHECK(location.IsRegister() || location.IsFpuRegister());
   LiveInterval* interval = location.IsRegister()
       ? physical_core_register_intervals_[reg]
@@ -146,20 +155,7 @@
     }
   }
   DCHECK(interval->GetRegister() == reg);
-  interval->AddRange(start, end);
-}
-
-void RegisterAllocatorLinearScan::BlockRegisters(size_t start, size_t end, bool caller_save_only) {
-  for (size_t i = 0; i < codegen_->GetNumberOfCoreRegisters(); ++i) {
-    if (!caller_save_only || !codegen_->IsCoreCalleeSaveRegister(i)) {
-      BlockRegister(Location::RegisterLocation(i), start, end);
-    }
-  }
-  for (size_t i = 0; i < codegen_->GetNumberOfFloatingPointRegisters(); ++i) {
-    if (!caller_save_only || !codegen_->IsFloatingPointCalleeSaveRegister(i)) {
-      BlockRegister(Location::FpuRegisterLocation(i), start, end);
-    }
-  }
+  interval->AddRange(position, position + 1u);
 }
 
 void RegisterAllocatorLinearScan::AllocateRegistersInternal() {
@@ -180,15 +176,25 @@
       // intervals belonging to the live-in set of the catch/header block to be spilled.
       // TODO(ngeoffray): Phis in this block could be allocated in register.
       size_t position = block->GetLifetimeStart();
-      BlockRegisters(position, position + 1);
+      DCHECK_EQ(liveness_.GetInstructionFromPosition(position / 2u), nullptr);
+      block_registers_special_interval_->AddRange(position, position + 1u);
     }
   }
 
   number_of_registers_ = codegen_->GetNumberOfCoreRegisters();
   registers_array_ = allocator_->AllocArray<size_t>(number_of_registers_,
                                                     kArenaAllocRegisterAllocator);
-  processing_core_registers_ = true;
+  current_register_type_ = RegisterType::kCoreRegister;
   unhandled_ = &unhandled_core_intervals_;
+  // Add intervals representing groups of physical registers blocked for calls,
+  // catch blocks and irreducible loop headers.
+  for (LiveInterval* block_registers_interval : { block_registers_for_call_interval_,
+                                                  block_registers_special_interval_ }) {
+    if (block_registers_interval->GetFirstRange() != nullptr) {
+      block_registers_interval->ResetSearchCache();
+      inactive_.push_back(block_registers_interval);
+    }
+  }
   for (LiveInterval* fixed : physical_core_register_intervals_) {
     if (fixed != nullptr) {
       // Fixed interval is added to inactive_ instead of unhandled_.
@@ -207,8 +213,17 @@
   number_of_registers_ = codegen_->GetNumberOfFloatingPointRegisters();
   registers_array_ = allocator_->AllocArray<size_t>(number_of_registers_,
                                                     kArenaAllocRegisterAllocator);
-  processing_core_registers_ = false;
+  current_register_type_ = RegisterType::kFpRegister;
   unhandled_ = &unhandled_fp_intervals_;
+  // Add intervals representing groups of physical registers blocked for calls,
+  // catch blocks and irreducible loop headers.
+  for (LiveInterval* block_registers_interval : { block_registers_for_call_interval_,
+                                                  block_registers_special_interval_ }) {
+    if (block_registers_interval->GetFirstRange() != nullptr) {
+      block_registers_interval->ResetSearchCache();
+      inactive_.push_back(block_registers_interval);
+    }
+  }
   for (LiveInterval* fixed : physical_fp_register_intervals_) {
     if (fixed != nullptr) {
       // Fixed interval is added to inactive_ instead of unhandled_.
@@ -232,14 +247,17 @@
     return;
   }
 
-  CheckForTempLiveIntervals(instruction);
-  CheckForSafepoint(instruction);
-  if (locations->WillCall()) {
-    // If a call will happen, create fixed intervals for caller-save registers.
+  bool will_call = locations->WillCall();
+  if (will_call) {
+    // If a call will happen, add the range to a fixed interval that represents all the
+    // caller-save registers blocked at call sites.
     const size_t position = instruction->GetLifetimePosition();
-    BlockRegisters(position, position + 1, /* caller_save_only= */ true);
+    DCHECK_NE(liveness_.GetInstructionFromPosition(position / 2u), nullptr);
+    block_registers_for_call_interval_->AddRange(position, position + 1u);
   }
-  CheckForFixedInputs(instruction);
+  CheckForTempLiveIntervals(instruction, will_call);
+  CheckForSafepoint(instruction);
+  CheckForFixedInputs(instruction, will_call);
 
   LiveInterval* current = instruction->GetLiveInterval();
   if (current == nullptr)
@@ -257,7 +275,7 @@
 
   AddSafepointsFor(instruction);
   current->ResetSearchCache();
-  CheckForFixedOutput(instruction);
+  CheckForFixedOutput(instruction, will_call);
 
   if (instruction->IsPhi() && instruction->AsPhi()->IsCatchPhi()) {
     AllocateSpillSlotForCatchPhi(instruction->AsPhi());
@@ -296,7 +314,8 @@
   return false;
 }
 
-void RegisterAllocatorLinearScan::CheckForTempLiveIntervals(HInstruction* instruction) {
+void RegisterAllocatorLinearScan::CheckForTempLiveIntervals(HInstruction* instruction,
+                                                            bool will_call) {
   LocationSummary* locations = instruction->GetLocations();
   size_t position = instruction->GetLifetimePosition();
 
@@ -304,7 +323,7 @@
   for (size_t i = 0; i < locations->GetTempCount(); ++i) {
     Location temp = locations->GetTemp(i);
     if (temp.IsRegister() || temp.IsFpuRegister()) {
-      BlockRegister(temp, position, position + 1);
+      BlockRegister(temp, position, will_call);
       // Ensure that an explicit temporary register is marked as being allocated.
       codegen_->AddAllocatedRegister(temp);
     } else {
@@ -348,16 +367,21 @@
   }
 }
 
-void RegisterAllocatorLinearScan::CheckForFixedInputs(HInstruction* instruction) {
+void RegisterAllocatorLinearScan::CheckForFixedInputs(HInstruction* instruction, bool will_call) {
   LocationSummary* locations = instruction->GetLocations();
   size_t position = instruction->GetLifetimePosition();
   for (size_t i = 0; i < locations->GetInputCount(); ++i) {
     Location input = locations->InAt(i);
     if (input.IsRegister() || input.IsFpuRegister()) {
-      BlockRegister(input, position, position + 1);
+      BlockRegister(input, position, will_call);
+      // Ensure that an explicit input register is marked as being allocated.
+      codegen_->AddAllocatedRegister(input);
     } else if (input.IsPair()) {
-      BlockRegister(input.ToLow(), position, position + 1);
-      BlockRegister(input.ToHigh(), position, position + 1);
+      BlockRegister(input.ToLow(), position, will_call);
+      BlockRegister(input.ToHigh(), position, will_call);
+      // Ensure that an explicit input register pair is marked as being allocated.
+      codegen_->AddAllocatedRegister(input.ToLow());
+      codegen_->AddAllocatedRegister(input.ToHigh());
     }
   }
 }
@@ -388,7 +412,7 @@
   }
 }
 
-void RegisterAllocatorLinearScan::CheckForFixedOutput(HInstruction* instruction) {
+void RegisterAllocatorLinearScan::CheckForFixedOutput(HInstruction* instruction, bool will_call) {
   LocationSummary* locations = instruction->GetLocations();
   size_t position = instruction->GetLifetimePosition();
   LiveInterval* current = instruction->GetLiveInterval();
@@ -403,28 +427,33 @@
   if (output.IsUnallocated() && output.GetPolicy() == Location::kSameAsFirstInput) {
     Location first = locations->InAt(0);
     if (first.IsRegister() || first.IsFpuRegister()) {
-      current->SetFrom(position + 1);
+      current->SetFrom(position + 1u);
       current->SetRegister(first.reg());
     } else if (first.IsPair()) {
-      current->SetFrom(position + 1);
+      current->SetFrom(position + 1u);
       current->SetRegister(first.low());
       LiveInterval* high = current->GetHighInterval();
       high->SetRegister(first.high());
-      high->SetFrom(position + 1);
+      high->SetFrom(position + 1u);
     }
   } else if (output.IsRegister() || output.IsFpuRegister()) {
     // Shift the interval's start by one to account for the blocked register.
-    current->SetFrom(position + 1);
+    current->SetFrom(position + 1u);
     current->SetRegister(output.reg());
-    BlockRegister(output, position, position + 1);
+    BlockRegister(output, position, will_call);
+    // Ensure that an explicit output register is marked as being allocated.
+    codegen_->AddAllocatedRegister(output);
   } else if (output.IsPair()) {
-    current->SetFrom(position + 1);
+    current->SetFrom(position + 1u);
     current->SetRegister(output.low());
     LiveInterval* high = current->GetHighInterval();
     high->SetRegister(output.high());
-    high->SetFrom(position + 1);
-    BlockRegister(output.ToLow(), position, position + 1);
-    BlockRegister(output.ToHigh(), position, position + 1);
+    high->SetFrom(position + 1u);
+    BlockRegister(output.ToLow(), position, will_call);
+    BlockRegister(output.ToHigh(), position, will_call);
+    // Ensure that an explicit output register pair is marked as being allocated.
+    codegen_->AddAllocatedRegister(output.ToLow());
+    codegen_->AddAllocatedRegister(output.ToHigh());
   } else if (output.IsStackSlot() || output.IsDoubleStackSlot()) {
     current->SetSpillSlot(output.GetStackIndex());
   } else {
@@ -460,6 +489,16 @@
 };
 
 bool RegisterAllocatorLinearScan::ValidateInternal(bool log_fatal_on_failure) const {
+  auto should_process = [](RegisterType current_register_type, LiveInterval* interval) {
+    if (interval == nullptr) {
+      return false;
+    }
+    RegisterType register_type = DataType::IsFloatingPointType(interval->GetType())
+        ? RegisterType::kFpRegister
+        : RegisterType::kCoreRegister;
+    return register_type == current_register_type;
+  };
+
   // To simplify unit testing, we eagerly create the array of intervals, and
   // call the helper method.
   ScopedArenaAllocator allocator(allocator_->GetArenaStack());
@@ -467,14 +506,21 @@
       allocator.Adapter(kArenaAllocRegisterAllocatorValidate));
   for (size_t i = 0; i < liveness_.GetNumberOfSsaValues(); ++i) {
     HInstruction* instruction = liveness_.GetInstructionFromSsaIndex(i);
-    if (ShouldProcess(processing_core_registers_, instruction->GetLiveInterval())) {
+    if (should_process(current_register_type_, instruction->GetLiveInterval())) {
       intervals.push_back(instruction->GetLiveInterval());
     }
   }
 
-  const ScopedArenaVector<LiveInterval*>* physical_register_intervals = processing_core_registers_
-      ? &physical_core_register_intervals_
-      : &physical_fp_register_intervals_;
+  for (LiveInterval* block_registers_interval : { block_registers_for_call_interval_,
+                                                  block_registers_special_interval_ }) {
+    if (block_registers_interval->GetFirstRange() != nullptr) {
+      intervals.push_back(block_registers_interval);
+    }
+  }
+  const ScopedArenaVector<LiveInterval*>* physical_register_intervals =
+      (current_register_type_ == RegisterType::kCoreRegister)
+          ? &physical_core_register_intervals_
+          : &physical_fp_register_intervals_;
   for (LiveInterval* fixed : *physical_register_intervals) {
     if (fixed != nullptr) {
       intervals.push_back(fixed);
@@ -482,7 +528,7 @@
   }
 
   for (LiveInterval* temp : temp_intervals_) {
-    if (ShouldProcess(processing_core_registers_, temp)) {
+    if (should_process(current_register_type_, temp)) {
       intervals.push_back(temp);
     }
   }
@@ -491,7 +537,8 @@
                            GetNumberOfSpillSlots(),
                            reserved_out_slots_,
                            *codegen_,
-                           processing_core_registers_,
+                           &liveness_,
+                           current_register_type_,
                            log_fatal_on_failure);
 }
 
@@ -504,6 +551,11 @@
     } else {
       codegen_->DumpCoreRegister(stream, interval->GetRegister());
     }
+  } else if (interval->IsFixed()) {
+    DCHECK_EQ(interval->GetType(), DataType::Type::kVoid);
+    DCHECK(interval == block_registers_for_call_interval_ ||
+           interval == block_registers_special_interval_);
+    stream << (interval == block_registers_for_call_interval_ ? "block-for-call" : "block-special");
   } else {
     stream << "spilled";
   }
@@ -612,7 +664,7 @@
     // (6) If the interval had a register allocated, add it to the list of active
     //     intervals.
     if (success) {
-      codegen_->AddAllocatedRegister(processing_core_registers_
+      codegen_->AddAllocatedRegister((current_register_type_ == RegisterType::kCoreRegister)
           ? Location::RegisterLocation(current->GetRegister())
           : Location::FpuRegisterLocation(current->GetRegister()));
       active_.push_back(current);
@@ -657,10 +709,14 @@
     free_until[i] = kMaxLifetimePosition;
   }
 
-  // For each active interval, set its register to not free.
+  // For each active interval, set its register(s) to not free.
   for (LiveInterval* interval : active_) {
-    DCHECK(interval->HasRegister());
-    free_until[interval->GetRegister()] = 0;
+    DCHECK(interval->HasRegister() || interval->IsFixed());
+    uint32_t register_mask = GetRegisterMask(interval, current_register_type_);
+    DCHECK_NE(register_mask, 0u);
+    for (uint32_t reg : LowToHighBits(register_mask)) {
+      free_until[reg] = 0;
+    }
   }
 
   // An interval that starts an instruction (that is, it is not split), may
@@ -706,15 +762,22 @@
       continue;
     }
 
-    DCHECK(inactive->HasRegister());
-    if (free_until[inactive->GetRegister()] == 0) {
-      // Already used by some active interval. No need to intersect.
-      continue;
+    DCHECK(inactive->HasRegister() || inactive->IsFixed());
+    uint32_t register_mask = GetRegisterMask(inactive, current_register_type_);
+    DCHECK_NE(register_mask, 0u);
+    for (uint32_t reg : LowToHighBits(register_mask)) {
+      if (free_until[reg] == 0) {
+        // Already used by some active interval. Clear the register bit.
+        register_mask &= ~(1u << reg);
+      }
     }
-    size_t next_intersection = inactive->FirstIntersectionWith(current);
-    if (next_intersection != kNoLifetime) {
-      free_until[inactive->GetRegister()] =
-          std::min(free_until[inactive->GetRegister()], next_intersection);
+    if (register_mask != 0u) {
+      size_t next_intersection = inactive->FirstIntersectionWith(current);
+      if (next_intersection != kNoLifetime) {
+        for (uint32_t reg : LowToHighBits(register_mask)) {
+          free_until[reg] = std::min(free_until[reg], next_intersection);
+        }
+      }
     }
   }
 
@@ -773,7 +836,7 @@
 }
 
 bool RegisterAllocatorLinearScan::IsBlocked(int reg) const {
-  return processing_core_registers_
+  return (current_register_type_ == RegisterType::kCoreRegister)
       ? blocked_core_registers_[reg]
       : blocked_fp_registers_[reg];
 }
@@ -804,9 +867,11 @@
 }
 
 bool RegisterAllocatorLinearScan::IsCallerSaveRegister(int reg) const {
-  return processing_core_registers_
-      ? !codegen_->IsCoreCalleeSaveRegister(reg)
-      : !codegen_->IsFloatingPointCalleeSaveRegister(reg);
+  uint32_t registers_blocked_for_call = (current_register_type_ == RegisterType::kCoreRegister)
+      ? core_registers_blocked_for_call_
+      : fp_registers_blocked_for_call_;
+  DCHECK_LT(static_cast<size_t>(reg), BitSizeOf<uint32_t>());
+  return (registers_blocked_for_call & (1u << reg)) != 0u;
 }
 
 int RegisterAllocatorLinearScan::FindAvailableRegister(size_t* next_use, LiveInterval* current) const {
@@ -877,8 +942,9 @@
                                                                            size_t* next_use) {
   for (auto it = active_.begin(), end = active_.end(); it != end; ++it) {
     LiveInterval* active = *it;
-    DCHECK(active->HasRegister());
+    // Special fixed intervals that represent multiple registers do not report having a register.
     if (active->IsFixed()) continue;
+    DCHECK(active->HasRegister());
     if (active->IsHighInterval()) continue;
     if (first_register_use > next_use[active->GetRegister()]) continue;
 
@@ -929,10 +995,14 @@
   // For each active interval, find the next use of its register after the
   // start of current.
   for (LiveInterval* active : active_) {
-    DCHECK(active->HasRegister());
     if (active->IsFixed()) {
-      next_use[active->GetRegister()] = current->GetStart();
+      uint32_t register_mask = GetRegisterMask(active, current_register_type_);
+      DCHECK_NE(register_mask, 0u);
+      for (uint32_t reg : LowToHighBits(register_mask)) {
+        next_use[reg] = current->GetStart();
+      }
     } else {
+      DCHECK(active->HasRegister());
       size_t use = active->FirstRegisterUseAfter(current->GetStart());
       if (use != kNoLifetime) {
         next_use[active->GetRegister()] = use;
@@ -953,12 +1023,15 @@
       DCHECK_EQ(inactive->FirstIntersectionWith(current), kNoLifetime);
       continue;
     }
-    DCHECK(inactive->HasRegister());
+    DCHECK(inactive->HasRegister() || inactive->IsFixed());
     size_t next_intersection = inactive->FirstIntersectionWith(current);
     if (next_intersection != kNoLifetime) {
       if (inactive->IsFixed()) {
-        next_use[inactive->GetRegister()] =
-            std::min(next_intersection, next_use[inactive->GetRegister()]);
+        uint32_t register_mask = GetRegisterMask(inactive, current_register_type_);
+        DCHECK_NE(register_mask, 0u);
+        for (uint32_t reg : LowToHighBits(register_mask)) {
+          next_use[reg] = std::min(next_intersection, next_use[reg]);
+        }
       } else {
         size_t use = inactive->FirstUseAfter(current->GetStart());
         if (use != kNoLifetime) {
@@ -1032,6 +1105,8 @@
 
     for (auto it = active_.begin(), end = active_.end(); it != end; ++it) {
       LiveInterval* active = *it;
+      DCHECK_IMPLIES(active->IsFixed(),
+                     (GetRegisterMask(active, current_register_type_) & (1u << reg)) == 0u);
       if (active->GetRegister() == reg) {
         DCHECK(!active->IsFixed());
         LiveInterval* split = Split(active, current->GetStart());
@@ -1048,7 +1123,7 @@
     for (auto it = inactive_.begin(); it != inactive_.end(); ) {
       LiveInterval* inactive = *it;
       bool erased = false;
-      if (inactive->GetRegister() == reg) {
+      if ((GetRegisterMask(inactive, current_register_type_) & (1u << reg)) != 0u) {
         if (!current->IsSplit() && !inactive->IsFixed()) {
           // Neither current nor inactive are fixed.
           // Thanks to SSA, a non-split interval starting in a hole of an
@@ -1208,8 +1283,7 @@
   LiveInterval* interval = phi->GetLiveInterval();
 
   HInstruction* previous_phi = phi->GetPrevious();
-  DCHECK(previous_phi == nullptr ||
-         previous_phi->AsPhi()->GetRegNumber() <= phi->GetRegNumber())
+  DCHECK(previous_phi == nullptr || previous_phi->AsPhi()->GetRegNumber() <= phi->GetRegNumber())
       << "Phis expected to be sorted by vreg number, so that equivalent phis are adjacent.";
 
   if (phi->IsVRegEquivalentOf(previous_phi)) {
diff --git a/compiler/optimizing/register_allocator_linear_scan.h b/compiler/optimizing/register_allocator_linear_scan.h
index c71a9e9..296c41d 100644
--- a/compiler/optimizing/register_allocator_linear_scan.h
+++ b/compiler/optimizing/register_allocator_linear_scan.h
@@ -47,11 +47,11 @@
   void AllocateRegisters() override;
 
   bool Validate(bool log_fatal_on_failure) override {
-    processing_core_registers_ = true;
+    current_register_type_ = RegisterType::kCoreRegister;
     if (!ValidateInternal(log_fatal_on_failure)) {
       return false;
     }
-    processing_core_registers_ = false;
+    current_register_type_ = RegisterType::kFpRegister;
     return ValidateInternal(log_fatal_on_failure);
   }
 
@@ -76,8 +76,7 @@
   bool IsBlocked(int reg) const;
 
   // Update the interval for the register in `location` to cover [start, end).
-  void BlockRegister(Location location, size_t start, size_t end);
-  void BlockRegisters(size_t start, size_t end, bool caller_save_only = false);
+  void BlockRegister(Location location, size_t position, bool will_call);
 
   // Allocate a spill slot for the given interval. Should be called in linear
   // order of interval starting positions.
@@ -100,11 +99,11 @@
 
   // If any inputs require specific registers, block those registers
   // at the position of this instruction.
-  void CheckForFixedInputs(HInstruction* instruction);
+  void CheckForFixedInputs(HInstruction* instruction, bool will_call);
 
   // If the output of an instruction requires a specific register, split
   // the interval and assign the register to the first part.
-  void CheckForFixedOutput(HInstruction* instruction);
+  void CheckForFixedOutput(HInstruction* instruction, bool will_call);
 
   // Add all applicable safepoints to a live interval.
   // Currently depends on instruction processing order.
@@ -112,7 +111,7 @@
 
   // Collect all live intervals associated with the temporary locations
   // needed by an instruction.
-  void CheckForTempLiveIntervals(HInstruction* instruction);
+  void CheckForTempLiveIntervals(HInstruction* instruction, bool will_call);
 
   // If a safe point is needed, add a synthesized interval to later record
   // the number of live registers at this point.
@@ -154,6 +153,8 @@
   // where an instruction requires a specific register.
   ScopedArenaVector<LiveInterval*> physical_core_register_intervals_;
   ScopedArenaVector<LiveInterval*> physical_fp_register_intervals_;
+  LiveInterval* block_registers_for_call_interval_;
+  LiveInterval* block_registers_special_interval_;  // For catch block or irreducible loop header.
 
   // Intervals for temporaries. Such intervals cover the positions
   // where an instruction requires a temporary.
@@ -176,9 +177,8 @@
   // Instructions that need a safepoint.
   ScopedArenaVector<HInstruction*> safepoints_;
 
-  // True if processing core registers. False if processing floating
-  // point registers.
-  bool processing_core_registers_;
+  // The register type we're currently processing.
+  RegisterType current_register_type_;
 
   // Number of registers for the current register kind (core or floating point).
   size_t number_of_registers_;
diff --git a/compiler/optimizing/register_allocator_test.cc b/compiler/optimizing/register_allocator_test.cc
index d316aa5..ab5e5de 100644
--- a/compiler/optimizing/register_allocator_test.cc
+++ b/compiler/optimizing/register_allocator_test.cc
@@ -72,7 +72,8 @@
                                                 /* number_of_spill_slots= */ 0u,
                                                 /* number_of_out_slots= */ 0u,
                                                 codegen,
-                                                /* processing_core_registers= */ true,
+                                                /*liveness=*/ nullptr,
+                                                RegisterAllocator::RegisterType::kCoreRegister,
                                                 /* log_fatal_on_failure= */ false);
   }
 
@@ -84,7 +85,8 @@
 TEST_F(RegisterAllocatorTest, test_name##_LinearScan) {\
   test_name(Strategy::kRegisterAllocatorLinearScan);\
 }\
-TEST_F(RegisterAllocatorTest, test_name##_GraphColor) {\
+/* Note: Graph coloring register allocator has been removed, so the test is DISABLED. */ \
+TEST_F(RegisterAllocatorTest, DISABLED_##test_name##_GraphColor) {\
   test_name(Strategy::kRegisterAllocatorGraphColor);\
 }
 
@@ -474,7 +476,7 @@
 
   register_allocator.number_of_registers_ = 1;
   register_allocator.registers_array_ = GetAllocator()->AllocArray<size_t>(1);
-  register_allocator.processing_core_registers_ = true;
+  register_allocator.current_register_type_ = RegisterAllocator::RegisterType::kCoreRegister;
   register_allocator.unhandled_ = &register_allocator.unhandled_core_intervals_;
 
   ASSERT_TRUE(register_allocator.TryAllocateFreeReg(unhandled));
@@ -929,7 +931,7 @@
   // Set just one register available to make all intervals compete for the same.
   register_allocator.number_of_registers_ = 1;
   register_allocator.registers_array_ = GetAllocator()->AllocArray<size_t>(1);
-  register_allocator.processing_core_registers_ = true;
+  register_allocator.current_register_type_ = RegisterAllocator::RegisterType::kCoreRegister;
   register_allocator.unhandled_ = &register_allocator.unhandled_core_intervals_;
   register_allocator.LinearScan();
 
diff --git a/compiler/optimizing/scheduler.cc b/compiler/optimizing/scheduler.cc
index 116f526..f4cf7b0 100644
--- a/compiler/optimizing/scheduler.cc
+++ b/compiler/optimizing/scheduler.cc
@@ -106,37 +106,15 @@
 }
 
 static bool IsInstanceFieldAccess(const HInstruction* instruction) {
-  return instruction->IsInstanceFieldGet() ||
-         instruction->IsInstanceFieldSet() ||
-         instruction->IsPredicatedInstanceFieldGet() ||
-         instruction->IsUnresolvedInstanceFieldGet() ||
-         instruction->IsUnresolvedInstanceFieldSet();
+  return instruction->IsInstanceFieldGet() || instruction->IsInstanceFieldSet();
 }
 
 static bool IsStaticFieldAccess(const HInstruction* instruction) {
-  return instruction->IsStaticFieldGet() ||
-         instruction->IsStaticFieldSet() ||
-         instruction->IsUnresolvedStaticFieldGet() ||
-         instruction->IsUnresolvedStaticFieldSet();
-}
-
-static bool IsResolvedFieldAccess(const HInstruction* instruction) {
-  return instruction->IsInstanceFieldGet() ||
-         instruction->IsInstanceFieldSet() ||
-         instruction->IsPredicatedInstanceFieldGet() ||
-         instruction->IsStaticFieldGet() ||
-         instruction->IsStaticFieldSet();
-}
-
-static bool IsUnresolvedFieldAccess(const HInstruction* instruction) {
-  return instruction->IsUnresolvedInstanceFieldGet() ||
-         instruction->IsUnresolvedInstanceFieldSet() ||
-         instruction->IsUnresolvedStaticFieldGet() ||
-         instruction->IsUnresolvedStaticFieldSet();
+  return instruction->IsStaticFieldGet() || instruction->IsStaticFieldSet();
 }
 
 static bool IsFieldAccess(const HInstruction* instruction) {
-  return IsResolvedFieldAccess(instruction) || IsUnresolvedFieldAccess(instruction);
+  return IsInstanceFieldAccess(instruction) || IsStaticFieldAccess(instruction);
 }
 
 static const FieldInfo* GetFieldInfo(const HInstruction* instruction) {
@@ -149,9 +127,7 @@
   DCHECK(GetFieldInfo(instr) != nullptr);
   DCHECK(heap_location_collector_ != nullptr);
 
-  HInstruction* ref = instr->IsPredicatedInstanceFieldGet()
-      ? instr->AsPredicatedInstanceFieldGet()->GetTarget()
-      : instr->InputAt(0);
+  HInstruction* ref = instr->InputAt(0);
   size_t heap_loc = heap_location_collector_->GetFieldHeapLocation(ref, GetFieldInfo(instr));
   // This field access should be analyzed and added to HeapLocationCollector before.
   DCHECK(heap_loc != HeapLocationCollector::kHeapLocationNotFound);
@@ -169,12 +145,6 @@
     return false;
   }
 
-  // If either of the field accesses is unresolved.
-  if (IsUnresolvedFieldAccess(instr1) || IsUnresolvedFieldAccess(instr2)) {
-    // Conservatively treat these two accesses may alias.
-    return true;
-  }
-
   // If both fields accesses are resolved.
   size_t instr1_field_access_heap_loc = FieldAccessHeapLocation(instr1);
   size_t instr2_field_access_heap_loc = FieldAccessHeapLocation(instr2);
@@ -205,6 +175,14 @@
     return true;
   }
 
+  // Note: Unresolved field access instructions are currently marked as not schedulable.
+  // If we change that, we should still keep in mind that these instructions can throw and
+  // read or write volatile fields and, if static, cause class initialization and write to
+  // arbitrary heap locations, and therefore cannot be reordered with any other field or
+  // array access to preserve the observable behavior. The only exception is access to
+  // singleton members that could actually be reodered across these instructions but we
+  // currently do not analyze singletons here anyway.
+
   if (IsArrayAccess(instr1) && IsArrayAccess(instr2)) {
     return ArrayAccessMayAlias(instr1, instr2);
   }
@@ -490,9 +468,9 @@
   DCHECK(instruction != nullptr);
 
   if (instruction->IsIf()) {
-    condition = instruction->AsIf()->InputAt(0)->AsCondition();
+    condition = instruction->AsIf()->InputAt(0)->AsConditionOrNull();
   } else if (instruction->IsSelect()) {
-    condition = instruction->AsSelect()->GetCondition()->AsCondition();
+    condition = instruction->AsSelect()->GetCondition()->AsConditionOrNull();
   }
 
   SchedulingNode* condition_node = (condition != nullptr) ? graph.GetNode(condition) : nullptr;
@@ -554,7 +532,7 @@
   // should run the analysis or not.
   const HeapLocationCollector* heap_location_collector = nullptr;
   ScopedArenaAllocator allocator(graph->GetArenaStack());
-  LoadStoreAnalysis lsa(graph, /*stats=*/nullptr, &allocator, LoadStoreAnalysisType::kBasic);
+  LoadStoreAnalysis lsa(graph, /*stats=*/nullptr, &allocator);
   if (!only_optimize_loop_blocks_ || graph->HasLoops()) {
     lsa.Run();
     heap_location_collector = &lsa.GetHeapLocationCollector();
@@ -570,20 +548,10 @@
 void HScheduler::Schedule(HBasicBlock* block,
                           const HeapLocationCollector* heap_location_collector) {
   ScopedArenaAllocator allocator(block->GetGraph()->GetArenaStack());
-  ScopedArenaVector<SchedulingNode*> scheduling_nodes(allocator.Adapter(kArenaAllocScheduler));
 
   // Build the scheduling graph.
-  SchedulingGraph scheduling_graph(&allocator, heap_location_collector);
-  for (HBackwardInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) {
-    HInstruction* instruction = it.Current();
-    CHECK_EQ(instruction->GetBlock(), block)
-        << instruction->DebugName()
-        << " is in block " << instruction->GetBlock()->GetBlockId()
-        << ", and expected in block " << block->GetBlockId();
-    SchedulingNode* node = scheduling_graph.AddNode(instruction, IsSchedulingBarrier(instruction));
-    CalculateLatency(node);
-    scheduling_nodes.push_back(node);
-  }
+  auto [scheduling_graph, scheduling_nodes] =
+      BuildSchedulingGraph(block, &allocator, heap_location_collector);
 
   if (scheduling_graph.Size() <= 1) {
     return;
@@ -721,7 +689,8 @@
   //    HNop
   //    HThrow
   //    HTryBoundary
-  //    All volatile field access e.g. HInstanceFieldGet
+  //    All unresolved field access instructions
+  //    All volatile field access instructions, e.g. HInstanceFieldGet
   // TODO: Some of the instructions above may be safe to schedule (maybe as
   // scheduling barriers).
   return instruction->IsArrayGet() ||
@@ -734,8 +703,6 @@
          instruction->IsCurrentMethod() ||
          instruction->IsDivZeroCheck() ||
          (instruction->IsInstanceFieldGet() && !instruction->AsInstanceFieldGet()->IsVolatile()) ||
-         (instruction->IsPredicatedInstanceFieldGet() &&
-          !instruction->AsPredicatedInstanceFieldGet()->IsVolatile()) ||
          (instruction->IsInstanceFieldSet() && !instruction->AsInstanceFieldSet()->IsVolatile()) ||
          instruction->IsInstanceOf() ||
          instruction->IsInvokeInterface() ||
@@ -799,10 +766,14 @@
   // Phase-local allocator that allocates scheduler internal data structures like
   // scheduling nodes, internel nodes map, dependencies, etc.
   CriticalPathSchedulingNodeSelector critical_path_selector;
-  RandomSchedulingNodeSelector random_selector;
-  SchedulingNodeSelector* selector = schedule_randomly
-      ? static_cast<SchedulingNodeSelector*>(&random_selector)
-      : static_cast<SchedulingNodeSelector*>(&critical_path_selector);
+  // Do not create the `RandomSchedulingNodeSelector` if not requested.
+  // The construction is expensive, including a call to `srand()`.
+  std::optional<RandomSchedulingNodeSelector> random_selector;
+  SchedulingNodeSelector* selector = &critical_path_selector;
+  if (schedule_randomly) {
+    random_selector.emplace();
+    selector = &random_selector.value();
+  }
 #else
   // Avoid compilation error when compiling for unsupported instruction set.
   UNUSED(only_optimize_loop_blocks);
@@ -822,8 +793,7 @@
 #if defined(ART_ENABLE_CODEGEN_arm)
     case InstructionSet::kThumb2:
     case InstructionSet::kArm: {
-      arm::SchedulingLatencyVisitorARM arm_latency_visitor(codegen_);
-      arm::HSchedulerARM scheduler(selector, &arm_latency_visitor);
+      arm::HSchedulerARM scheduler(selector, codegen_);
       scheduler.SetOnlyOptimizeLoopBlocks(only_optimize_loop_blocks);
       scheduler.Schedule(graph_);
       break;
diff --git a/compiler/optimizing/scheduler.h b/compiler/optimizing/scheduler.h
index 299fbc9..a9672ea 100644
--- a/compiler/optimizing/scheduler.h
+++ b/compiler/optimizing/scheduler.h
@@ -497,9 +497,8 @@
 
 class HScheduler {
  public:
-  HScheduler(SchedulingLatencyVisitor* latency_visitor, SchedulingNodeSelector* selector)
-      : latency_visitor_(latency_visitor),
-        selector_(selector),
+  explicit HScheduler(SchedulingNodeSelector* selector)
+      : selector_(selector),
         only_optimize_loop_blocks_(true),
         cursor_(nullptr) {}
   virtual ~HScheduler() {}
@@ -512,6 +511,35 @@
   virtual bool IsSchedulingBarrier(const HInstruction* instruction) const;
 
  protected:
+  virtual std::pair<SchedulingGraph, ScopedArenaVector<SchedulingNode*>> BuildSchedulingGraph(
+      HBasicBlock* block,
+      ScopedArenaAllocator* allocator,
+      const HeapLocationCollector* heap_location_collector) = 0;
+
+  template <typename LatencyVisitor>
+  std::pair<SchedulingGraph, ScopedArenaVector<SchedulingNode*>> BuildSchedulingGraph(
+      HBasicBlock* block,
+      ScopedArenaAllocator* allocator,
+      const HeapLocationCollector* heap_location_collector,
+      LatencyVisitor* latency_visitor) ALWAYS_INLINE {
+    SchedulingGraph scheduling_graph(allocator, heap_location_collector);
+    ScopedArenaVector<SchedulingNode*> scheduling_nodes(allocator->Adapter(kArenaAllocScheduler));
+    for (HBackwardInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) {
+      HInstruction* instruction = it.Current();
+      CHECK_EQ(instruction->GetBlock(), block)
+          << instruction->DebugName()
+          << " is in block " << instruction->GetBlock()->GetBlockId()
+          << ", and expected in block " << block->GetBlockId();
+      SchedulingNode* node =
+          scheduling_graph.AddNode(instruction, IsSchedulingBarrier(instruction));
+      latency_visitor->CalculateLatency(node);
+      node->SetLatency(latency_visitor->GetLastVisitedLatency());
+      node->SetInternalLatency(latency_visitor->GetLastVisitedInternalLatency());
+      scheduling_nodes.push_back(node);
+    }
+    return {std::move(scheduling_graph), std::move(scheduling_nodes)};
+  }
+
   void Schedule(HBasicBlock* block, const HeapLocationCollector* heap_location_collector);
   void Schedule(SchedulingNode* scheduling_node,
                 /*inout*/ ScopedArenaVector<SchedulingNode*>* candidates);
@@ -529,13 +557,6 @@
   virtual bool IsSchedulable(const HInstruction* instruction) const;
   bool IsSchedulable(const HBasicBlock* block) const;
 
-  void CalculateLatency(SchedulingNode* node) {
-    latency_visitor_->CalculateLatency(node);
-    node->SetLatency(latency_visitor_->GetLastVisitedLatency());
-    node->SetInternalLatency(latency_visitor_->GetLastVisitedInternalLatency());
-  }
-
-  SchedulingLatencyVisitor* const latency_visitor_;
   SchedulingNodeSelector* const selector_;
   bool only_optimize_loop_blocks_;
 
diff --git a/compiler/optimizing/scheduler_arm.cc b/compiler/optimizing/scheduler_arm.cc
index 3f931c4..3ee6f06 100644
--- a/compiler/optimizing/scheduler_arm.cc
+++ b/compiler/optimizing/scheduler_arm.cc
@@ -17,6 +17,7 @@
 #include "scheduler_arm.h"
 
 #include "arch/arm/instruction_set_features_arm.h"
+#include "code_generator_arm_vixl.h"
 #include "code_generator_utils.h"
 #include "common_arm.h"
 #include "heap_poisoning.h"
@@ -29,6 +30,116 @@
 using helpers::Int32ConstantFrom;
 using helpers::Uint64ConstantFrom;
 
+// AArch32 instruction latencies.
+// We currently assume that all ARM CPUs share the same instruction latency list.
+// The following latencies were tuned based on performance experiments and
+// automatic tuning using differential evolution approach on various benchmarks.
+static constexpr uint32_t kArmIntegerOpLatency = 2;
+static constexpr uint32_t kArmFloatingPointOpLatency = 11;
+static constexpr uint32_t kArmDataProcWithShifterOpLatency = 4;
+static constexpr uint32_t kArmMulIntegerLatency = 6;
+static constexpr uint32_t kArmMulFloatingPointLatency = 11;
+static constexpr uint32_t kArmDivIntegerLatency = 10;
+static constexpr uint32_t kArmDivFloatLatency = 20;
+static constexpr uint32_t kArmDivDoubleLatency = 25;
+static constexpr uint32_t kArmTypeConversionFloatingPointIntegerLatency = 11;
+static constexpr uint32_t kArmMemoryLoadLatency = 9;
+static constexpr uint32_t kArmMemoryStoreLatency = 9;
+static constexpr uint32_t kArmMemoryBarrierLatency = 6;
+static constexpr uint32_t kArmBranchLatency = 4;
+static constexpr uint32_t kArmCallLatency = 5;
+static constexpr uint32_t kArmCallInternalLatency = 29;
+static constexpr uint32_t kArmLoadStringInternalLatency = 10;
+static constexpr uint32_t kArmNopLatency = 2;
+static constexpr uint32_t kArmLoadWithBakerReadBarrierLatency = 18;
+static constexpr uint32_t kArmRuntimeTypeCheckLatency = 46;
+
+class SchedulingLatencyVisitorARM final : public SchedulingLatencyVisitor {
+ public:
+  explicit SchedulingLatencyVisitorARM(CodeGenerator* codegen)
+      : codegen_(down_cast<CodeGeneratorARMVIXL*>(codegen)) {}
+
+  // Default visitor for instructions not handled specifically below.
+  void VisitInstruction([[maybe_unused]] HInstruction*) override {
+    last_visited_latency_ = kArmIntegerOpLatency;
+  }
+
+// We add a second unused parameter to be able to use this macro like the others
+// defined in `nodes.h`.
+#define FOR_EACH_SCHEDULED_ARM_INSTRUCTION(M) \
+  M(ArrayGet, unused)                         \
+  M(ArrayLength, unused)                      \
+  M(ArraySet, unused)                         \
+  M(Add, unused)                              \
+  M(Sub, unused)                              \
+  M(And, unused)                              \
+  M(Or, unused)                               \
+  M(Ror, unused)                              \
+  M(Xor, unused)                              \
+  M(Shl, unused)                              \
+  M(Shr, unused)                              \
+  M(UShr, unused)                             \
+  M(Mul, unused)                              \
+  M(Div, unused)                              \
+  M(Condition, unused)                        \
+  M(Compare, unused)                          \
+  M(BoundsCheck, unused)                      \
+  M(InstanceFieldGet, unused)                 \
+  M(InstanceFieldSet, unused)                 \
+  M(InstanceOf, unused)                       \
+  M(Invoke, unused)                           \
+  M(LoadString, unused)                       \
+  M(NewArray, unused)                         \
+  M(NewInstance, unused)                      \
+  M(Rem, unused)                              \
+  M(StaticFieldGet, unused)                   \
+  M(StaticFieldSet, unused)                   \
+  M(SuspendCheck, unused)                     \
+  M(TypeConversion, unused)
+
+#define FOR_EACH_SCHEDULED_SHARED_INSTRUCTION(M) \
+  M(BitwiseNegatedRight, unused)                 \
+  M(MultiplyAccumulate, unused)                  \
+  M(IntermediateAddress, unused)                 \
+  M(IntermediateAddressIndex, unused)            \
+  M(DataProcWithShifterOp, unused)
+
+#define DECLARE_VISIT_INSTRUCTION(type, unused)  \
+  void Visit##type(H##type* instruction) override;
+
+  FOR_EACH_SCHEDULED_ARM_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
+  FOR_EACH_SCHEDULED_SHARED_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
+  FOR_EACH_CONCRETE_INSTRUCTION_ARM(DECLARE_VISIT_INSTRUCTION)
+
+#undef DECLARE_VISIT_INSTRUCTION
+
+ private:
+  bool CanGenerateTest(HCondition* cond);
+  void HandleGenerateConditionWithZero(IfCondition cond);
+  void HandleGenerateLongTestConstant(HCondition* cond);
+  void HandleGenerateLongTest(HCondition* cond);
+  void HandleGenerateLongComparesAndJumps();
+  void HandleGenerateTest(HCondition* cond);
+  void HandleGenerateConditionGeneric(HCondition* cond);
+  void HandleGenerateEqualLong(HCondition* cond);
+  void HandleGenerateConditionLong(HCondition* cond);
+  void HandleGenerateConditionIntegralOrNonPrimitive(HCondition* cond);
+  void HandleCondition(HCondition* instr);
+  void HandleBinaryOperationLantencies(HBinaryOperation* instr);
+  void HandleBitwiseOperationLantencies(HBinaryOperation* instr);
+  void HandleShiftLatencies(HBinaryOperation* instr);
+  void HandleDivRemConstantIntegralLatencies(int32_t imm);
+  void HandleFieldSetLatencies(HInstruction* instruction, const FieldInfo& field_info);
+  void HandleFieldGetLatencies(HInstruction* instruction, const FieldInfo& field_info);
+  void HandleGenerateDataProcInstruction(bool internal_latency = false);
+  void HandleGenerateDataProc(HDataProcWithShifterOp* instruction);
+  void HandleGenerateLongDataProc(HDataProcWithShifterOp* instruction);
+
+  // The latency setting for each HInstruction depends on how CodeGenerator may generate code,
+  // latency visitors may query CodeGenerator for such information for accurate latency settings.
+  CodeGeneratorARMVIXL* codegen_;
+};
+
 void SchedulingLatencyVisitorARM::HandleBinaryOperationLantencies(HBinaryOperation* instr) {
   switch (instr->GetResultType()) {
     case DataType::Type::kInt64:
@@ -610,7 +721,7 @@
   }
 }
 
-void SchedulingLatencyVisitorARM::VisitIntermediateAddress(HIntermediateAddress* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM::VisitIntermediateAddress([[maybe_unused]] HIntermediateAddress*) {
   // Although the code generated is a simple `add` instruction, we found through empirical results
   // that spacing it from its use in memory accesses was beneficial.
   last_visited_internal_latency_ = kArmNopLatency;
@@ -618,11 +729,11 @@
 }
 
 void SchedulingLatencyVisitorARM::VisitIntermediateAddressIndex(
-    HIntermediateAddressIndex* ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HIntermediateAddressIndex*) {
   UNIMPLEMENTED(FATAL) << "IntermediateAddressIndex is not implemented for ARM";
 }
 
-void SchedulingLatencyVisitorARM::VisitMultiplyAccumulate(HMultiplyAccumulate* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM::VisitMultiplyAccumulate([[maybe_unused]] HMultiplyAccumulate*) {
   last_visited_latency_ = kArmMulIntegerLatency;
 }
 
@@ -669,7 +780,7 @@
     }
 
     case DataType::Type::kReference: {
-      if (gUseReadBarrier && kUseBakerReadBarrier) {
+      if (codegen_->EmitBakerReadBarrier()) {
         last_visited_latency_ = kArmLoadWithBakerReadBarrierLatency;
       } else {
         if (index->IsConstant()) {
@@ -806,7 +917,7 @@
   }
 }
 
-void SchedulingLatencyVisitorARM::VisitBoundsCheck(HBoundsCheck* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM::VisitBoundsCheck([[maybe_unused]] HBoundsCheck*) {
   last_visited_internal_latency_ = kArmIntegerOpLatency;
   // Users do not use any data results.
   last_visited_latency_ = 0;
@@ -853,11 +964,6 @@
   }
 }
 
-void SchedulingLatencyVisitorARM::VisitPredicatedInstanceFieldGet(
-    HPredicatedInstanceFieldGet* instruction) {
-  HandleFieldGetLatencies(instruction, instruction->GetFieldInfo());
-}
-
 void SchedulingLatencyVisitorARM::VisitInstanceFieldGet(HInstanceFieldGet* instruction) {
   HandleFieldGetLatencies(instruction, instruction->GetFieldInfo());
 }
@@ -866,22 +972,22 @@
   HandleFieldSetLatencies(instruction, instruction->GetFieldInfo());
 }
 
-void SchedulingLatencyVisitorARM::VisitInstanceOf(HInstanceOf* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM::VisitInstanceOf([[maybe_unused]] HInstanceOf*) {
   last_visited_internal_latency_ = kArmCallInternalLatency;
   last_visited_latency_ = kArmIntegerOpLatency;
 }
 
-void SchedulingLatencyVisitorARM::VisitInvoke(HInvoke* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM::VisitInvoke([[maybe_unused]] HInvoke*) {
   last_visited_internal_latency_ = kArmCallInternalLatency;
   last_visited_latency_ = kArmCallLatency;
 }
 
-void SchedulingLatencyVisitorARM::VisitLoadString(HLoadString* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM::VisitLoadString([[maybe_unused]] HLoadString*) {
   last_visited_internal_latency_ = kArmLoadStringInternalLatency;
   last_visited_latency_ = kArmMemoryLoadLatency;
 }
 
-void SchedulingLatencyVisitorARM::VisitNewArray(HNewArray* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM::VisitNewArray([[maybe_unused]] HNewArray*) {
   last_visited_internal_latency_ = kArmIntegerOpLatency + kArmCallInternalLatency;
   last_visited_latency_ = kArmCallLatency;
 }
@@ -918,9 +1024,7 @@
 
 void SchedulingLatencyVisitorARM::HandleFieldGetLatencies(HInstruction* instruction,
                                                           const FieldInfo& field_info) {
-  DCHECK(instruction->IsInstanceFieldGet() ||
-         instruction->IsStaticFieldGet() ||
-         instruction->IsPredicatedInstanceFieldGet());
+  DCHECK(instruction->IsInstanceFieldGet() || instruction->IsStaticFieldGet());
   DCHECK(codegen_ != nullptr);
   bool is_volatile = field_info.IsVolatile();
   DataType::Type field_type = field_info.GetFieldType();
@@ -937,7 +1041,7 @@
       break;
 
     case DataType::Type::kReference:
-      if (gUseReadBarrier && kUseBakerReadBarrier) {
+      if (codegen_->EmitBakerReadBarrier()) {
         last_visited_internal_latency_ = kArmMemoryLoadLatency + kArmIntegerOpLatency;
         last_visited_latency_ = kArmMemoryLoadLatency;
       } else {
@@ -984,8 +1088,6 @@
   DCHECK(codegen_ != nullptr);
   bool is_volatile = field_info.IsVolatile();
   DataType::Type field_type = field_info.GetFieldType();
-  bool needs_write_barrier =
-      CodeGenerator::StoreNeedsWriteBarrier(field_type, instruction->InputAt(1));
   bool atomic_ldrd_strd = codegen_->GetInstructionSetFeatures().HasAtomicLdrdAndStrd();
 
   switch (field_type) {
@@ -1004,7 +1106,7 @@
 
     case DataType::Type::kInt32:
     case DataType::Type::kReference:
-      if (kPoisonHeapReferences && needs_write_barrier) {
+      if (kPoisonHeapReferences && field_type == DataType::Type::kReference) {
         last_visited_internal_latency_ += kArmIntegerOpLatency * 2;
       }
       last_visited_latency_ = kArmMemoryStoreLatency;
@@ -1162,5 +1264,28 @@
   }
 }
 
+bool HSchedulerARM::IsSchedulable(const HInstruction* instruction) const {
+  switch (instruction->GetKind()) {
+#define SCHEDULABLE_CASE(type, unused)            \
+    case HInstruction::InstructionKind::k##type:  \
+      return true;
+    FOR_EACH_SCHEDULED_SHARED_INSTRUCTION(SCHEDULABLE_CASE)
+    FOR_EACH_CONCRETE_INSTRUCTION_ARM(SCHEDULABLE_CASE)
+#undef SCHEDULABLE_CASE
+
+    default:
+      return HScheduler::IsSchedulable(instruction);
+  }
+}
+
+std::pair<SchedulingGraph, ScopedArenaVector<SchedulingNode*>> HSchedulerARM::BuildSchedulingGraph(
+    HBasicBlock* block,
+    ScopedArenaAllocator* allocator,
+    const HeapLocationCollector* heap_location_collector) {
+  SchedulingLatencyVisitorARM latency_visitor(codegen_);
+  return HScheduler::BuildSchedulingGraph(
+      block, allocator, heap_location_collector, &latency_visitor);
+}
+
 }  // namespace arm
 }  // namespace art
diff --git a/compiler/optimizing/scheduler_arm.h b/compiler/optimizing/scheduler_arm.h
index 0da21c1..25eac1b 100644
--- a/compiler/optimizing/scheduler_arm.h
+++ b/compiler/optimizing/scheduler_arm.h
@@ -18,145 +18,32 @@
 #define ART_COMPILER_OPTIMIZING_SCHEDULER_ARM_H_
 
 #include "base/macros.h"
-#include "code_generator_arm_vixl.h"
 #include "scheduler.h"
 
 namespace art HIDDEN {
+
+class CodeGenerator;
+
 namespace arm {
-// AArch32 instruction latencies.
-// We currently assume that all ARM CPUs share the same instruction latency list.
-// The following latencies were tuned based on performance experiments and
-// automatic tuning using differential evolution approach on various benchmarks.
-static constexpr uint32_t kArmIntegerOpLatency = 2;
-static constexpr uint32_t kArmFloatingPointOpLatency = 11;
-static constexpr uint32_t kArmDataProcWithShifterOpLatency = 4;
-static constexpr uint32_t kArmMulIntegerLatency = 6;
-static constexpr uint32_t kArmMulFloatingPointLatency = 11;
-static constexpr uint32_t kArmDivIntegerLatency = 10;
-static constexpr uint32_t kArmDivFloatLatency = 20;
-static constexpr uint32_t kArmDivDoubleLatency = 25;
-static constexpr uint32_t kArmTypeConversionFloatingPointIntegerLatency = 11;
-static constexpr uint32_t kArmMemoryLoadLatency = 9;
-static constexpr uint32_t kArmMemoryStoreLatency = 9;
-static constexpr uint32_t kArmMemoryBarrierLatency = 6;
-static constexpr uint32_t kArmBranchLatency = 4;
-static constexpr uint32_t kArmCallLatency = 5;
-static constexpr uint32_t kArmCallInternalLatency = 29;
-static constexpr uint32_t kArmLoadStringInternalLatency = 10;
-static constexpr uint32_t kArmNopLatency = 2;
-static constexpr uint32_t kArmLoadWithBakerReadBarrierLatency = 18;
-static constexpr uint32_t kArmRuntimeTypeCheckLatency = 46;
 
-class SchedulingLatencyVisitorARM final : public SchedulingLatencyVisitor {
+class HSchedulerARM final : public HScheduler {
  public:
-  explicit SchedulingLatencyVisitorARM(CodeGenerator* codegen)
-      : codegen_(down_cast<CodeGeneratorARMVIXL*>(codegen)) {}
-
-  // Default visitor for instructions not handled specifically below.
-  void VisitInstruction(HInstruction* ATTRIBUTE_UNUSED) override {
-    last_visited_latency_ = kArmIntegerOpLatency;
-  }
-
-// We add a second unused parameter to be able to use this macro like the others
-// defined in `nodes.h`.
-#define FOR_EACH_SCHEDULED_ARM_INSTRUCTION(M) \
-  M(ArrayGet, unused)                         \
-  M(ArrayLength, unused)                      \
-  M(ArraySet, unused)                         \
-  M(Add, unused)                              \
-  M(Sub, unused)                              \
-  M(And, unused)                              \
-  M(Or, unused)                               \
-  M(Ror, unused)                              \
-  M(Xor, unused)                              \
-  M(Shl, unused)                              \
-  M(Shr, unused)                              \
-  M(UShr, unused)                             \
-  M(Mul, unused)                              \
-  M(Div, unused)                              \
-  M(Condition, unused)                        \
-  M(Compare, unused)                          \
-  M(BoundsCheck, unused)                      \
-  M(PredicatedInstanceFieldGet, unused)       \
-  M(InstanceFieldGet, unused)                 \
-  M(InstanceFieldSet, unused)                 \
-  M(InstanceOf, unused)                       \
-  M(Invoke, unused)                           \
-  M(LoadString, unused)                       \
-  M(NewArray, unused)                         \
-  M(NewInstance, unused)                      \
-  M(Rem, unused)                              \
-  M(StaticFieldGet, unused)                   \
-  M(StaticFieldSet, unused)                   \
-  M(SuspendCheck, unused)                     \
-  M(TypeConversion, unused)
-
-#define FOR_EACH_SCHEDULED_SHARED_INSTRUCTION(M) \
-  M(BitwiseNegatedRight, unused)                 \
-  M(MultiplyAccumulate, unused)                  \
-  M(IntermediateAddress, unused)                 \
-  M(IntermediateAddressIndex, unused)            \
-  M(DataProcWithShifterOp, unused)
-
-#define DECLARE_VISIT_INSTRUCTION(type, unused)  \
-  void Visit##type(H##type* instruction) override;
-
-  FOR_EACH_SCHEDULED_ARM_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
-  FOR_EACH_SCHEDULED_SHARED_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
-  FOR_EACH_CONCRETE_INSTRUCTION_ARM(DECLARE_VISIT_INSTRUCTION)
-
-#undef DECLARE_VISIT_INSTRUCTION
-
- private:
-  bool CanGenerateTest(HCondition* cond);
-  void HandleGenerateConditionWithZero(IfCondition cond);
-  void HandleGenerateLongTestConstant(HCondition* cond);
-  void HandleGenerateLongTest(HCondition* cond);
-  void HandleGenerateLongComparesAndJumps();
-  void HandleGenerateTest(HCondition* cond);
-  void HandleGenerateConditionGeneric(HCondition* cond);
-  void HandleGenerateEqualLong(HCondition* cond);
-  void HandleGenerateConditionLong(HCondition* cond);
-  void HandleGenerateConditionIntegralOrNonPrimitive(HCondition* cond);
-  void HandleCondition(HCondition* instr);
-  void HandleBinaryOperationLantencies(HBinaryOperation* instr);
-  void HandleBitwiseOperationLantencies(HBinaryOperation* instr);
-  void HandleShiftLatencies(HBinaryOperation* instr);
-  void HandleDivRemConstantIntegralLatencies(int32_t imm);
-  void HandleFieldSetLatencies(HInstruction* instruction, const FieldInfo& field_info);
-  void HandleFieldGetLatencies(HInstruction* instruction, const FieldInfo& field_info);
-  void HandleGenerateDataProcInstruction(bool internal_latency = false);
-  void HandleGenerateDataProc(HDataProcWithShifterOp* instruction);
-  void HandleGenerateLongDataProc(HDataProcWithShifterOp* instruction);
-
-  // The latency setting for each HInstruction depends on how CodeGenerator may generate code,
-  // latency visitors may query CodeGenerator for such information for accurate latency settings.
-  CodeGeneratorARMVIXL* codegen_;
-};
-
-class HSchedulerARM : public HScheduler {
- public:
-  HSchedulerARM(SchedulingNodeSelector* selector,
-                SchedulingLatencyVisitorARM* arm_latency_visitor)
-      : HScheduler(arm_latency_visitor, selector) {}
+  HSchedulerARM(SchedulingNodeSelector* selector, CodeGenerator* codegen)
+      : HScheduler(selector), codegen_(codegen) {}
   ~HSchedulerARM() override {}
 
-  bool IsSchedulable(const HInstruction* instruction) const override {
-#define CASE_INSTRUCTION_KIND(type, unused) case \
-  HInstruction::InstructionKind::k##type:
-    switch (instruction->GetKind()) {
-      FOR_EACH_SCHEDULED_SHARED_INSTRUCTION(CASE_INSTRUCTION_KIND)
-        return true;
-      FOR_EACH_CONCRETE_INSTRUCTION_ARM(CASE_INSTRUCTION_KIND)
-        return true;
-      default:
-        return HScheduler::IsSchedulable(instruction);
-    }
-#undef CASE_INSTRUCTION_KIND
-  }
+  bool IsSchedulable(const HInstruction* instruction) const override;
+
+ protected:
+  std::pair<SchedulingGraph, ScopedArenaVector<SchedulingNode*>> BuildSchedulingGraph(
+      HBasicBlock* block,
+      ScopedArenaAllocator* allocator,
+      const HeapLocationCollector* heap_location_collector) override;
 
  private:
   DISALLOW_COPY_AND_ASSIGN(HSchedulerARM);
+
+  CodeGenerator* const codegen_;
 };
 
 }  // namespace arm
diff --git a/compiler/optimizing/scheduler_arm64.cc b/compiler/optimizing/scheduler_arm64.cc
index 3071afd..08b8a3f 100644
--- a/compiler/optimizing/scheduler_arm64.cc
+++ b/compiler/optimizing/scheduler_arm64.cc
@@ -23,6 +23,115 @@
 namespace art HIDDEN {
 namespace arm64 {
 
+static constexpr uint32_t kArm64MemoryLoadLatency = 5;
+static constexpr uint32_t kArm64MemoryStoreLatency = 3;
+
+static constexpr uint32_t kArm64CallInternalLatency = 10;
+static constexpr uint32_t kArm64CallLatency = 5;
+
+// AArch64 instruction latency.
+// We currently assume that all arm64 CPUs share the same instruction latency list.
+static constexpr uint32_t kArm64IntegerOpLatency = 2;
+static constexpr uint32_t kArm64FloatingPointOpLatency = 5;
+
+static constexpr uint32_t kArm64DataProcWithShifterOpLatency = 3;
+static constexpr uint32_t kArm64DivDoubleLatency = 30;
+static constexpr uint32_t kArm64DivFloatLatency = 15;
+static constexpr uint32_t kArm64DivIntegerLatency = 5;
+static constexpr uint32_t kArm64LoadStringInternalLatency = 7;
+static constexpr uint32_t kArm64MulFloatingPointLatency = 6;
+static constexpr uint32_t kArm64MulIntegerLatency = 6;
+static constexpr uint32_t kArm64TypeConversionFloatingPointIntegerLatency = 5;
+static constexpr uint32_t kArm64BranchLatency = kArm64IntegerOpLatency;
+
+static constexpr uint32_t kArm64SIMDFloatingPointOpLatency = 10;
+static constexpr uint32_t kArm64SIMDIntegerOpLatency = 6;
+static constexpr uint32_t kArm64SIMDMemoryLoadLatency = 10;
+static constexpr uint32_t kArm64SIMDMemoryStoreLatency = 6;
+static constexpr uint32_t kArm64SIMDMulFloatingPointLatency = 12;
+static constexpr uint32_t kArm64SIMDMulIntegerLatency = 12;
+static constexpr uint32_t kArm64SIMDReplicateOpLatency = 16;
+static constexpr uint32_t kArm64SIMDDivDoubleLatency = 60;
+static constexpr uint32_t kArm64SIMDDivFloatLatency = 30;
+static constexpr uint32_t kArm64SIMDTypeConversionInt2FPLatency = 10;
+
+class SchedulingLatencyVisitorARM64 final : public SchedulingLatencyVisitor {
+ public:
+  // Default visitor for instructions not handled specifically below.
+  void VisitInstruction([[maybe_unused]] HInstruction*) override {
+    last_visited_latency_ = kArm64IntegerOpLatency;
+  }
+
+// We add a second unused parameter to be able to use this macro like the others
+// defined in `nodes.h`.
+#define FOR_EACH_SCHEDULED_COMMON_INSTRUCTION(M)     \
+  M(ArrayGet             , unused)                   \
+  M(ArrayLength          , unused)                   \
+  M(ArraySet             , unused)                   \
+  M(BoundsCheck          , unused)                   \
+  M(Div                  , unused)                   \
+  M(InstanceFieldGet     , unused)                   \
+  M(InstanceOf           , unused)                   \
+  M(LoadString           , unused)                   \
+  M(Mul                  , unused)                   \
+  M(NewArray             , unused)                   \
+  M(NewInstance          , unused)                   \
+  M(Rem                  , unused)                   \
+  M(StaticFieldGet       , unused)                   \
+  M(SuspendCheck         , unused)                   \
+  M(TypeConversion       , unused)                   \
+  M(VecReplicateScalar   , unused)                   \
+  M(VecExtractScalar     , unused)                   \
+  M(VecReduce            , unused)                   \
+  M(VecCnv               , unused)                   \
+  M(VecNeg               , unused)                   \
+  M(VecAbs               , unused)                   \
+  M(VecNot               , unused)                   \
+  M(VecAdd               , unused)                   \
+  M(VecHalvingAdd        , unused)                   \
+  M(VecSub               , unused)                   \
+  M(VecMul               , unused)                   \
+  M(VecDiv               , unused)                   \
+  M(VecMin               , unused)                   \
+  M(VecMax               , unused)                   \
+  M(VecAnd               , unused)                   \
+  M(VecAndNot            , unused)                   \
+  M(VecOr                , unused)                   \
+  M(VecXor               , unused)                   \
+  M(VecShl               , unused)                   \
+  M(VecShr               , unused)                   \
+  M(VecUShr              , unused)                   \
+  M(VecSetScalars        , unused)                   \
+  M(VecMultiplyAccumulate, unused)                   \
+  M(VecLoad              , unused)                   \
+  M(VecStore             , unused)
+
+#define FOR_EACH_SCHEDULED_ABSTRACT_INSTRUCTION(M)   \
+  M(BinaryOperation      , unused)                   \
+  M(Invoke               , unused)
+
+#define FOR_EACH_SCHEDULED_SHARED_INSTRUCTION(M) \
+  M(BitwiseNegatedRight, unused)                 \
+  M(MultiplyAccumulate, unused)                  \
+  M(IntermediateAddress, unused)                 \
+  M(IntermediateAddressIndex, unused)            \
+  M(DataProcWithShifterOp, unused)
+
+#define DECLARE_VISIT_INSTRUCTION(type, unused)  \
+  void Visit##type(H##type* instruction) override;
+
+  FOR_EACH_SCHEDULED_COMMON_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
+  FOR_EACH_SCHEDULED_ABSTRACT_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
+  FOR_EACH_SCHEDULED_SHARED_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
+  FOR_EACH_CONCRETE_INSTRUCTION_ARM64(DECLARE_VISIT_INSTRUCTION)
+
+#undef DECLARE_VISIT_INSTRUCTION
+
+ private:
+  void HandleSimpleArithmeticSIMD(HVecOperation *instr);
+  void HandleVecAddress(HVecMemoryOperation* instruction, size_t size);
+};
+
 void SchedulingLatencyVisitorARM64::VisitBinaryOperation(HBinaryOperation* instr) {
   last_visited_latency_ = DataType::IsFloatingPointType(instr->GetResultType())
       ? kArm64FloatingPointOpLatency
@@ -30,30 +139,30 @@
 }
 
 void SchedulingLatencyVisitorARM64::VisitBitwiseNegatedRight(
-    HBitwiseNegatedRight* ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HBitwiseNegatedRight*) {
   last_visited_latency_ = kArm64IntegerOpLatency;
 }
 
 void SchedulingLatencyVisitorARM64::VisitDataProcWithShifterOp(
-    HDataProcWithShifterOp* ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HDataProcWithShifterOp*) {
   last_visited_latency_ = kArm64DataProcWithShifterOpLatency;
 }
 
 void SchedulingLatencyVisitorARM64::VisitIntermediateAddress(
-    HIntermediateAddress* ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HIntermediateAddress*) {
   // Although the code generated is a simple `add` instruction, we found through empirical results
   // that spacing it from its use in memory accesses was beneficial.
   last_visited_latency_ = kArm64IntegerOpLatency + 2;
 }
 
 void SchedulingLatencyVisitorARM64::VisitIntermediateAddressIndex(
-    HIntermediateAddressIndex* instr ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HIntermediateAddressIndex* instr) {
   // Although the code generated is a simple `add` instruction, we found through empirical results
   // that spacing it from its use in memory accesses was beneficial.
   last_visited_latency_ = kArm64DataProcWithShifterOpLatency + 2;
 }
 
-void SchedulingLatencyVisitorARM64::VisitMultiplyAccumulate(HMultiplyAccumulate* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM64::VisitMultiplyAccumulate([[maybe_unused]] HMultiplyAccumulate*) {
   last_visited_latency_ = kArm64MulIntegerLatency;
 }
 
@@ -65,15 +174,15 @@
   last_visited_latency_ = kArm64MemoryLoadLatency;
 }
 
-void SchedulingLatencyVisitorARM64::VisitArrayLength(HArrayLength* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM64::VisitArrayLength([[maybe_unused]] HArrayLength*) {
   last_visited_latency_ = kArm64MemoryLoadLatency;
 }
 
-void SchedulingLatencyVisitorARM64::VisitArraySet(HArraySet* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM64::VisitArraySet([[maybe_unused]] HArraySet*) {
   last_visited_latency_ = kArm64MemoryStoreLatency;
 }
 
-void SchedulingLatencyVisitorARM64::VisitBoundsCheck(HBoundsCheck* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM64::VisitBoundsCheck([[maybe_unused]] HBoundsCheck*) {
   last_visited_internal_latency_ = kArm64IntegerOpLatency;
   // Users do not use any data results.
   last_visited_latency_ = 0;
@@ -113,21 +222,21 @@
   }
 }
 
-void SchedulingLatencyVisitorARM64::VisitInstanceFieldGet(HInstanceFieldGet* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM64::VisitInstanceFieldGet([[maybe_unused]] HInstanceFieldGet*) {
   last_visited_latency_ = kArm64MemoryLoadLatency;
 }
 
-void SchedulingLatencyVisitorARM64::VisitInstanceOf(HInstanceOf* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM64::VisitInstanceOf([[maybe_unused]] HInstanceOf*) {
   last_visited_internal_latency_ = kArm64CallInternalLatency;
   last_visited_latency_ = kArm64IntegerOpLatency;
 }
 
-void SchedulingLatencyVisitorARM64::VisitInvoke(HInvoke* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM64::VisitInvoke([[maybe_unused]] HInvoke*) {
   last_visited_internal_latency_ = kArm64CallInternalLatency;
   last_visited_latency_ = kArm64CallLatency;
 }
 
-void SchedulingLatencyVisitorARM64::VisitLoadString(HLoadString* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM64::VisitLoadString([[maybe_unused]] HLoadString*) {
   last_visited_internal_latency_ = kArm64LoadStringInternalLatency;
   last_visited_latency_ = kArm64MemoryLoadLatency;
 }
@@ -138,7 +247,7 @@
       : kArm64MulIntegerLatency;
 }
 
-void SchedulingLatencyVisitorARM64::VisitNewArray(HNewArray* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM64::VisitNewArray([[maybe_unused]] HNewArray*) {
   last_visited_internal_latency_ = kArm64IntegerOpLatency + kArm64CallInternalLatency;
   last_visited_latency_ = kArm64CallLatency;
 }
@@ -181,7 +290,7 @@
   }
 }
 
-void SchedulingLatencyVisitorARM64::VisitStaticFieldGet(HStaticFieldGet* ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM64::VisitStaticFieldGet([[maybe_unused]] HStaticFieldGet*) {
   last_visited_latency_ = kArm64MemoryLoadLatency;
 }
 
@@ -211,7 +320,7 @@
 }
 
 void SchedulingLatencyVisitorARM64::VisitVecReplicateScalar(
-    HVecReplicateScalar* instr ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HVecReplicateScalar* instr) {
   last_visited_latency_ = kArm64SIMDReplicateOpLatency;
 }
 
@@ -223,7 +332,7 @@
   HandleSimpleArithmeticSIMD(instr);
 }
 
-void SchedulingLatencyVisitorARM64::VisitVecCnv(HVecCnv* instr ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM64::VisitVecCnv([[maybe_unused]] HVecCnv* instr) {
   last_visited_latency_ = kArm64SIMDTypeConversionInt2FPLatency;
 }
 
@@ -279,19 +388,19 @@
   HandleSimpleArithmeticSIMD(instr);
 }
 
-void SchedulingLatencyVisitorARM64::VisitVecAnd(HVecAnd* instr ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM64::VisitVecAnd([[maybe_unused]] HVecAnd* instr) {
   last_visited_latency_ = kArm64SIMDIntegerOpLatency;
 }
 
-void SchedulingLatencyVisitorARM64::VisitVecAndNot(HVecAndNot* instr ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM64::VisitVecAndNot([[maybe_unused]] HVecAndNot* instr) {
   last_visited_latency_ = kArm64SIMDIntegerOpLatency;
 }
 
-void SchedulingLatencyVisitorARM64::VisitVecOr(HVecOr* instr ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM64::VisitVecOr([[maybe_unused]] HVecOr* instr) {
   last_visited_latency_ = kArm64SIMDIntegerOpLatency;
 }
 
-void SchedulingLatencyVisitorARM64::VisitVecXor(HVecXor* instr ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM64::VisitVecXor([[maybe_unused]] HVecXor* instr) {
   last_visited_latency_ = kArm64SIMDIntegerOpLatency;
 }
 
@@ -312,13 +421,12 @@
 }
 
 void SchedulingLatencyVisitorARM64::VisitVecMultiplyAccumulate(
-    HVecMultiplyAccumulate* instr ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] HVecMultiplyAccumulate* instr) {
   last_visited_latency_ = kArm64SIMDMulIntegerLatency;
 }
 
-void SchedulingLatencyVisitorARM64::HandleVecAddress(
-    HVecMemoryOperation* instruction,
-    size_t size ATTRIBUTE_UNUSED) {
+void SchedulingLatencyVisitorARM64::HandleVecAddress(HVecMemoryOperation* instruction,
+                                                     [[maybe_unused]] size_t size) {
   HInstruction* index = instruction->InputAt(1);
   if (!index->IsConstant()) {
     last_visited_internal_latency_ += kArm64DataProcWithShifterOpLatency;
@@ -349,5 +457,30 @@
   last_visited_latency_ = kArm64SIMDMemoryStoreLatency;
 }
 
+bool HSchedulerARM64::IsSchedulable(const HInstruction* instruction) const {
+  switch (instruction->GetKind()) {
+#define SCHEDULABLE_CASE(type, unused)       \
+    case HInstruction::InstructionKind::k##type:  \
+      return true;
+    FOR_EACH_SCHEDULED_SHARED_INSTRUCTION(SCHEDULABLE_CASE)
+    FOR_EACH_CONCRETE_INSTRUCTION_ARM64(SCHEDULABLE_CASE)
+    FOR_EACH_SCHEDULED_COMMON_INSTRUCTION(SCHEDULABLE_CASE)
+#undef SCHEDULABLE_CASE
+
+    default:
+      return HScheduler::IsSchedulable(instruction);
+  }
+}
+
+std::pair<SchedulingGraph, ScopedArenaVector<SchedulingNode*>>
+HSchedulerARM64::BuildSchedulingGraph(
+    HBasicBlock* block,
+    ScopedArenaAllocator* allocator,
+    const HeapLocationCollector* heap_location_collector) {
+  SchedulingLatencyVisitorARM64 latency_visitor;
+  return HScheduler::BuildSchedulingGraph(
+      block, allocator, heap_location_collector, &latency_visitor);
+}
+
 }  // namespace arm64
 }  // namespace art
diff --git a/compiler/optimizing/scheduler_arm64.h b/compiler/optimizing/scheduler_arm64.h
index ec41577..044aa48 100644
--- a/compiler/optimizing/scheduler_arm64.h
+++ b/compiler/optimizing/scheduler_arm64.h
@@ -23,137 +23,13 @@
 namespace art HIDDEN {
 namespace arm64 {
 
-static constexpr uint32_t kArm64MemoryLoadLatency = 5;
-static constexpr uint32_t kArm64MemoryStoreLatency = 3;
-
-static constexpr uint32_t kArm64CallInternalLatency = 10;
-static constexpr uint32_t kArm64CallLatency = 5;
-
-// AArch64 instruction latency.
-// We currently assume that all arm64 CPUs share the same instruction latency list.
-static constexpr uint32_t kArm64IntegerOpLatency = 2;
-static constexpr uint32_t kArm64FloatingPointOpLatency = 5;
-
-
-static constexpr uint32_t kArm64DataProcWithShifterOpLatency = 3;
-static constexpr uint32_t kArm64DivDoubleLatency = 30;
-static constexpr uint32_t kArm64DivFloatLatency = 15;
-static constexpr uint32_t kArm64DivIntegerLatency = 5;
-static constexpr uint32_t kArm64LoadStringInternalLatency = 7;
-static constexpr uint32_t kArm64MulFloatingPointLatency = 6;
-static constexpr uint32_t kArm64MulIntegerLatency = 6;
-static constexpr uint32_t kArm64TypeConversionFloatingPointIntegerLatency = 5;
-static constexpr uint32_t kArm64BranchLatency = kArm64IntegerOpLatency;
-
-static constexpr uint32_t kArm64SIMDFloatingPointOpLatency = 10;
-static constexpr uint32_t kArm64SIMDIntegerOpLatency = 6;
-static constexpr uint32_t kArm64SIMDMemoryLoadLatency = 10;
-static constexpr uint32_t kArm64SIMDMemoryStoreLatency = 6;
-static constexpr uint32_t kArm64SIMDMulFloatingPointLatency = 12;
-static constexpr uint32_t kArm64SIMDMulIntegerLatency = 12;
-static constexpr uint32_t kArm64SIMDReplicateOpLatency = 16;
-static constexpr uint32_t kArm64SIMDDivDoubleLatency = 60;
-static constexpr uint32_t kArm64SIMDDivFloatLatency = 30;
-static constexpr uint32_t kArm64SIMDTypeConversionInt2FPLatency = 10;
-
-class SchedulingLatencyVisitorARM64 final : public SchedulingLatencyVisitor {
- public:
-  // Default visitor for instructions not handled specifically below.
-  void VisitInstruction(HInstruction* ATTRIBUTE_UNUSED) override {
-    last_visited_latency_ = kArm64IntegerOpLatency;
-  }
-
-// We add a second unused parameter to be able to use this macro like the others
-// defined in `nodes.h`.
-#define FOR_EACH_SCHEDULED_COMMON_INSTRUCTION(M)     \
-  M(ArrayGet             , unused)                   \
-  M(ArrayLength          , unused)                   \
-  M(ArraySet             , unused)                   \
-  M(BoundsCheck          , unused)                   \
-  M(Div                  , unused)                   \
-  M(InstanceFieldGet     , unused)                   \
-  M(InstanceOf           , unused)                   \
-  M(LoadString           , unused)                   \
-  M(Mul                  , unused)                   \
-  M(NewArray             , unused)                   \
-  M(NewInstance          , unused)                   \
-  M(Rem                  , unused)                   \
-  M(StaticFieldGet       , unused)                   \
-  M(SuspendCheck         , unused)                   \
-  M(TypeConversion       , unused)                   \
-  M(VecReplicateScalar   , unused)                   \
-  M(VecExtractScalar     , unused)                   \
-  M(VecReduce            , unused)                   \
-  M(VecCnv               , unused)                   \
-  M(VecNeg               , unused)                   \
-  M(VecAbs               , unused)                   \
-  M(VecNot               , unused)                   \
-  M(VecAdd               , unused)                   \
-  M(VecHalvingAdd        , unused)                   \
-  M(VecSub               , unused)                   \
-  M(VecMul               , unused)                   \
-  M(VecDiv               , unused)                   \
-  M(VecMin               , unused)                   \
-  M(VecMax               , unused)                   \
-  M(VecAnd               , unused)                   \
-  M(VecAndNot            , unused)                   \
-  M(VecOr                , unused)                   \
-  M(VecXor               , unused)                   \
-  M(VecShl               , unused)                   \
-  M(VecShr               , unused)                   \
-  M(VecUShr              , unused)                   \
-  M(VecSetScalars        , unused)                   \
-  M(VecMultiplyAccumulate, unused)                   \
-  M(VecLoad              , unused)                   \
-  M(VecStore             , unused)
-
-#define FOR_EACH_SCHEDULED_ABSTRACT_INSTRUCTION(M)   \
-  M(BinaryOperation      , unused)                   \
-  M(Invoke               , unused)
-
-#define FOR_EACH_SCHEDULED_SHARED_INSTRUCTION(M) \
-  M(BitwiseNegatedRight, unused)                 \
-  M(MultiplyAccumulate, unused)                  \
-  M(IntermediateAddress, unused)                 \
-  M(IntermediateAddressIndex, unused)            \
-  M(DataProcWithShifterOp, unused)
-
-#define DECLARE_VISIT_INSTRUCTION(type, unused)  \
-  void Visit##type(H##type* instruction) override;
-
-  FOR_EACH_SCHEDULED_COMMON_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
-  FOR_EACH_SCHEDULED_ABSTRACT_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
-  FOR_EACH_SCHEDULED_SHARED_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
-  FOR_EACH_CONCRETE_INSTRUCTION_ARM64(DECLARE_VISIT_INSTRUCTION)
-
-#undef DECLARE_VISIT_INSTRUCTION
-
- private:
-  void HandleSimpleArithmeticSIMD(HVecOperation *instr);
-  void HandleVecAddress(HVecMemoryOperation* instruction, size_t size);
-};
-
 class HSchedulerARM64 : public HScheduler {
  public:
   explicit HSchedulerARM64(SchedulingNodeSelector* selector)
-      : HScheduler(&arm64_latency_visitor_, selector) {}
+      : HScheduler(selector) {}
   ~HSchedulerARM64() override {}
 
-  bool IsSchedulable(const HInstruction* instruction) const override {
-#define CASE_INSTRUCTION_KIND(type, unused) case \
-  HInstruction::InstructionKind::k##type:
-    switch (instruction->GetKind()) {
-      FOR_EACH_SCHEDULED_SHARED_INSTRUCTION(CASE_INSTRUCTION_KIND)
-        return true;
-      FOR_EACH_CONCRETE_INSTRUCTION_ARM64(CASE_INSTRUCTION_KIND)
-        return true;
-      FOR_EACH_SCHEDULED_COMMON_INSTRUCTION(CASE_INSTRUCTION_KIND)
-        return true;
-      default:
-        return HScheduler::IsSchedulable(instruction);
-    }
-#undef CASE_INSTRUCTION_KIND
-  }
+  bool IsSchedulable(const HInstruction* instruction) const override;
 
   // Treat as scheduling barriers those vector instructions whose live ranges exceed the vectorized
   // loop boundaries. This is a workaround for the lack of notion of SIMD register in the compiler;
@@ -169,8 +45,13 @@
            instr->IsVecReplicateScalar();
   }
 
+ protected:
+  std::pair<SchedulingGraph, ScopedArenaVector<SchedulingNode*>> BuildSchedulingGraph(
+      HBasicBlock* block,
+      ScopedArenaAllocator* allocator,
+      const HeapLocationCollector* heap_location_collector) override;
+
  private:
-  SchedulingLatencyVisitorARM64 arm64_latency_visitor_;
   DISALLOW_COPY_AND_ASSIGN(HSchedulerARM64);
 };
 
diff --git a/compiler/optimizing/scheduler_test.cc b/compiler/optimizing/scheduler_test.cc
index 165bfe3..0b020f1 100644
--- a/compiler/optimizing/scheduler_test.cc
+++ b/compiler/optimizing/scheduler_test.cc
@@ -274,8 +274,7 @@
       entry->AddInstruction(instr);
     }
 
-    HeapLocationCollector heap_location_collector(
-        graph_, GetScopedAllocator(), LoadStoreAnalysisType::kBasic);
+    HeapLocationCollector heap_location_collector(graph_, GetScopedAllocator());
     heap_location_collector.VisitBasicBlock(entry);
     heap_location_collector.BuildAliasingMatrix();
     TestSchedulingGraph scheduling_graph(GetScopedAllocator(), &heap_location_collector);
@@ -407,15 +406,13 @@
 #if defined(ART_ENABLE_CODEGEN_arm)
 TEST_F(SchedulerTest, DependencyGraphAndSchedulerARM) {
   CriticalPathSchedulingNodeSelector critical_path_selector;
-  arm::SchedulingLatencyVisitorARM arm_latency_visitor(/*CodeGenerator*/ nullptr);
-  arm::HSchedulerARM scheduler(&critical_path_selector, &arm_latency_visitor);
+  arm::HSchedulerARM scheduler(&critical_path_selector, /*codegen=*/ nullptr);
   TestBuildDependencyGraphAndSchedule(&scheduler);
 }
 
 TEST_F(SchedulerTest, ArrayAccessAliasingARM) {
   CriticalPathSchedulingNodeSelector critical_path_selector;
-  arm::SchedulingLatencyVisitorARM arm_latency_visitor(/*CodeGenerator*/ nullptr);
-  arm::HSchedulerARM scheduler(&critical_path_selector, &arm_latency_visitor);
+  arm::HSchedulerARM scheduler(&critical_path_selector, /*codegen=*/ nullptr);
   TestDependencyGraphOnAliasingArrayAccesses(&scheduler);
 }
 #endif
diff --git a/compiler/optimizing/select_generator.cc b/compiler/optimizing/select_generator.cc
index 6a10440..07065ef 100644
--- a/compiler/optimizing/select_generator.cc
+++ b/compiler/optimizing/select_generator.cc
@@ -46,8 +46,7 @@
     } else if (instruction->CanBeMoved() &&
                !instruction->HasSideEffects() &&
                !instruction->CanThrow()) {
-      if (instruction->IsSelect() &&
-          instruction->AsSelect()->GetCondition()->GetBlock() == block) {
+      if (instruction->IsSelect() && instruction->AsSelect()->GetCondition()->GetBlock() == block) {
         // Count one HCondition and HSelect in the same block as a single instruction.
         // This enables finding nested selects.
         continue;
diff --git a/compiler/optimizing/side_effects_analysis.h b/compiler/optimizing/side_effects_analysis.h
index 47fcdc5..bb2d794 100644
--- a/compiler/optimizing/side_effects_analysis.h
+++ b/compiler/optimizing/side_effects_analysis.h
@@ -29,10 +29,8 @@
   explicit SideEffectsAnalysis(HGraph* graph, const char* pass_name = kSideEffectsAnalysisPassName)
       : HOptimization(graph, pass_name),
         graph_(graph),
-        block_effects_(graph->GetBlocks().size(),
-                       graph->GetAllocator()->Adapter(kArenaAllocSideEffectsAnalysis)),
-        loop_effects_(graph->GetBlocks().size(),
-                      graph->GetAllocator()->Adapter(kArenaAllocSideEffectsAnalysis)) {}
+        block_effects_(graph->GetAllocator()->Adapter(kArenaAllocSideEffectsAnalysis)),
+        loop_effects_(graph->GetAllocator()->Adapter(kArenaAllocSideEffectsAnalysis)) {}
 
   SideEffects GetLoopEffects(HBasicBlock* block) const;
   SideEffects GetBlockEffects(HBasicBlock* block) const;
diff --git a/compiler/optimizing/ssa_builder.cc b/compiler/optimizing/ssa_builder.cc
index a658252..2179bf5 100644
--- a/compiler/optimizing/ssa_builder.cc
+++ b/compiler/optimizing/ssa_builder.cc
@@ -604,7 +604,7 @@
  */
 HFloatConstant* SsaBuilder::GetFloatEquivalent(HIntConstant* constant) {
   // We place the floating point constant next to this constant.
-  HFloatConstant* result = constant->GetNext()->AsFloatConstant();
+  HFloatConstant* result = constant->GetNext()->AsFloatConstantOrNull();
   if (result == nullptr) {
     float value = bit_cast<float, int32_t>(constant->GetValue());
     result = new (graph_->GetAllocator()) HFloatConstant(value);
@@ -626,7 +626,7 @@
  */
 HDoubleConstant* SsaBuilder::GetDoubleEquivalent(HLongConstant* constant) {
   // We place the floating point constant next to this constant.
-  HDoubleConstant* result = constant->GetNext()->AsDoubleConstant();
+  HDoubleConstant* result = constant->GetNext()->AsDoubleConstantOrNull();
   if (result == nullptr) {
     double value = bit_cast<double, int64_t>(constant->GetValue());
     result = new (graph_->GetAllocator()) HDoubleConstant(value);
@@ -652,16 +652,16 @@
 
   // We place the floating point /reference phi next to this phi.
   HInstruction* next = phi->GetNext();
-  if (next != nullptr
-      && next->AsPhi()->GetRegNumber() == phi->GetRegNumber()
-      && next->GetType() != type) {
+  if (next != nullptr &&
+      next->AsPhi()->GetRegNumber() == phi->GetRegNumber() &&
+      next->GetType() != type) {
     // Move to the next phi to see if it is the one we are looking for.
     next = next->GetNext();
   }
 
-  if (next == nullptr
-      || (next->AsPhi()->GetRegNumber() != phi->GetRegNumber())
-      || (next->GetType() != type)) {
+  if (next == nullptr ||
+      (next->AsPhi()->GetRegNumber() != phi->GetRegNumber()) ||
+      (next->GetType() != type)) {
     ArenaAllocator* allocator = graph_->GetAllocator();
     HInputsRef inputs = phi->GetInputs();
     HPhi* new_phi = new (allocator) HPhi(allocator, phi->GetRegNumber(), inputs.size(), type);
diff --git a/compiler/optimizing/ssa_phi_elimination.cc b/compiler/optimizing/ssa_phi_elimination.cc
index ce343df..1d9be39 100644
--- a/compiler/optimizing/ssa_phi_elimination.cc
+++ b/compiler/optimizing/ssa_phi_elimination.cc
@@ -76,7 +76,7 @@
     HPhi* phi = worklist.back();
     worklist.pop_back();
     for (HInstruction* raw_input : phi->GetInputs()) {
-      HPhi* input = raw_input->AsPhi();
+      HPhi* input = raw_input->AsPhiOrNull();
       if (input != nullptr && input->IsDead()) {
         // Input is a dead phi. Revive it and add to the worklist. We make sure
         // that the phi was not dead initially (see definition of `initially_live`).
diff --git a/compiler/optimizing/stack_map_stream.cc b/compiler/optimizing/stack_map_stream.cc
index 1a368ed..83551a9 100644
--- a/compiler/optimizing/stack_map_stream.cc
+++ b/compiler/optimizing/stack_map_stream.cc
@@ -26,12 +26,12 @@
 #include "dex/dex_file.h"
 #include "dex/dex_file_types.h"
 #include "driver/compiler_options.h"
+#include "oat/stack_map.h"
 #include "optimizing/code_generator.h"
 #include "optimizing/nodes.h"
 #include "optimizing/optimizing_compiler.h"
 #include "runtime.h"
 #include "scoped_thread_state_change-inl.h"
-#include "stack_map.h"
 
 namespace art HIDDEN {
 
@@ -51,7 +51,8 @@
                                  size_t fp_spill_mask,
                                  uint32_t num_dex_registers,
                                  bool baseline,
-                                 bool debuggable) {
+                                 bool debuggable,
+                                 bool has_should_deoptimize_flag) {
   DCHECK(!in_method_) << "Mismatched Begin/End calls";
   in_method_ = true;
   DCHECK_EQ(packed_frame_size_, 0u) << "BeginMethod was already called";
@@ -63,6 +64,7 @@
   num_dex_registers_ = num_dex_registers;
   baseline_ = baseline;
   debuggable_ = debuggable;
+  has_should_deoptimize_flag_ = has_should_deoptimize_flag;
 
   if (kVerifyStackMaps) {
     dchecks_.emplace_back([=](const CodeInfo& code_info) {
@@ -152,8 +154,10 @@
     // Create lambda method, which will be executed at the very end to verify data.
     // Parameters and local variables will be captured(stored) by the lambda "[=]".
     dchecks_.emplace_back([=](const CodeInfo& code_info) {
+      // The `native_pc_offset` may have been overridden using `SetStackMapNativePcOffset(.)`.
+      uint32_t final_native_pc_offset = GetStackMapNativePcOffset(stack_map_index);
       if (kind == StackMap::Kind::Default || kind == StackMap::Kind::OSR) {
-        StackMap stack_map = code_info.GetStackMapForNativePcOffset(native_pc_offset,
+        StackMap stack_map = code_info.GetStackMapForNativePcOffset(final_native_pc_offset,
                                                                     instruction_set_);
         CHECK_EQ(stack_map.Row(), stack_map_index);
       } else if (kind == StackMap::Kind::Catch) {
@@ -162,7 +166,7 @@
         CHECK_EQ(stack_map.Row(), stack_map_index);
       }
       StackMap stack_map = code_info.GetStackMapAt(stack_map_index);
-      CHECK_EQ(stack_map.GetNativePcOffset(instruction_set_), native_pc_offset);
+      CHECK_EQ(stack_map.GetNativePcOffset(instruction_set_), final_native_pc_offset);
       CHECK_EQ(stack_map.GetKind(), static_cast<uint32_t>(kind));
       CHECK_EQ(stack_map.GetDexPc(), dex_pc);
       CHECK_EQ(code_info.GetRegisterMaskOf(stack_map), register_mask);
@@ -374,10 +378,12 @@
   DCHECK(in_stack_map_ == false) << "Mismatched Begin/End calls";
   DCHECK(in_inline_info_ == false) << "Mismatched Begin/End calls";
 
-  uint32_t flags = (inline_infos_.size() > 0) ? CodeInfo::kHasInlineInfo : 0;
+  uint32_t flags = 0;
+  flags |= (inline_infos_.size() > 0) ? CodeInfo::kHasInlineInfo : 0;
   flags |= baseline_ ? CodeInfo::kIsBaseline : 0;
   flags |= debuggable_ ? CodeInfo::kIsDebuggable : 0;
-  DCHECK_LE(flags, kVarintMax);  // Ensure flags can be read directly as byte.
+  flags |= has_should_deoptimize_flag_ ? CodeInfo::kHasShouldDeoptimizeFlag : 0;
+
   uint32_t bit_table_flags = 0;
   ForEachBitTable([&bit_table_flags](size_t i, auto bit_table) {
     if (bit_table->size() != 0) {  // Record which bit-tables are stored.
@@ -409,6 +415,8 @@
   CHECK_EQ(code_info.GetNumberOfStackMaps(), stack_maps_.size());
   CHECK_EQ(CodeInfo::HasInlineInfo(buffer.data()), inline_infos_.size() > 0);
   CHECK_EQ(CodeInfo::IsBaseline(buffer.data()), baseline_);
+  CHECK_EQ(CodeInfo::IsDebuggable(buffer.data()), debuggable_);
+  CHECK_EQ(CodeInfo::HasShouldDeoptimizeFlag(buffer.data()), has_should_deoptimize_flag_);
 
   // Verify all written data (usually only in debug builds).
   if (kVerifyStackMaps) {
diff --git a/compiler/optimizing/stack_map_stream.h b/compiler/optimizing/stack_map_stream.h
index 643af2d..a3daa29 100644
--- a/compiler/optimizing/stack_map_stream.h
+++ b/compiler/optimizing/stack_map_stream.h
@@ -27,7 +27,7 @@
 #include "base/value_object.h"
 #include "dex_register_location.h"
 #include "nodes.h"
-#include "stack_map.h"
+#include "oat/stack_map.h"
 
 namespace art HIDDEN {
 
@@ -66,7 +66,8 @@
                    size_t fp_spill_mask,
                    uint32_t num_dex_registers,
                    bool baseline,
-                   bool debuggable);
+                   bool debuggable,
+                   bool has_should_deoptimize_flag = false);
   void EndMethod(size_t code_size);
 
   void BeginStackMapEntry(
@@ -109,7 +110,7 @@
 
   // Invokes the callback with pointer of each BitTableBuilder field.
   template<typename Callback>
-  void ForEachBitTable(Callback callback) {
+  void ForEachBitTable(Callback&& callback) {
     size_t index = 0;
     callback(index++, &stack_maps_);
     callback(index++, &register_masks_);
@@ -129,8 +130,9 @@
   uint32_t core_spill_mask_ = 0;
   uint32_t fp_spill_mask_ = 0;
   uint32_t num_dex_registers_ = 0;
-  bool baseline_;
-  bool debuggable_;
+  bool baseline_ = false;
+  bool debuggable_ = false;
+  bool has_should_deoptimize_flag_ = false;
   BitTableBuilder<StackMap> stack_maps_;
   BitTableBuilder<RegisterMask> register_masks_;
   BitmapTableBuilder stack_masks_;
diff --git a/compiler/optimizing/stack_map_test.cc b/compiler/optimizing/stack_map_test.cc
index a2c30e7..6eb4fd9 100644
--- a/compiler/optimizing/stack_map_test.cc
+++ b/compiler/optimizing/stack_map_test.cc
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "stack_map.h"
+#include "oat/stack_map.h"
 
 #include "art_method.h"
 #include "base/arena_bit_vector.h"
diff --git a/compiler/optimizing/write_barrier_elimination.cc b/compiler/optimizing/write_barrier_elimination.cc
index 6182125..537bc09 100644
--- a/compiler/optimizing/write_barrier_elimination.cc
+++ b/compiler/optimizing/write_barrier_elimination.cc
@@ -21,8 +21,8 @@
 #include "base/scoped_arena_containers.h"
 #include "optimizing/nodes.h"
 
-// TODO(b/310755375, solanes): Disable WBE while we investigate crashes.
-constexpr bool kWBEEnabled = false;
+// TODO(b/310755375, solanes): Enable WBE with the fixes.
+constexpr bool kWBEEnabled = true;
 
 namespace art HIDDEN {
 
@@ -38,14 +38,14 @@
     // We clear the map to perform this optimization only in the same block. Doing it across blocks
     // would entail non-trivial merging of states.
     current_write_barriers_.clear();
-    HGraphVisitor::VisitBasicBlock(block);
+    VisitNonPhiInstructions(block);
   }
 
   void VisitInstanceFieldSet(HInstanceFieldSet* instruction) override {
     DCHECK(!instruction->GetSideEffects().Includes(SideEffects::CanTriggerGC()));
 
     if (instruction->GetFieldType() != DataType::Type::kReference ||
-        instruction->GetValue()->IsNullConstant()) {
+        HuntForOriginalReference(instruction->GetValue())->IsNullConstant()) {
       instruction->SetWriteBarrierKind(WriteBarrierKind::kDontEmit);
       return;
     }
@@ -58,7 +58,7 @@
       DCHECK(it->second->AsInstanceFieldSet()->GetWriteBarrierKind() !=
              WriteBarrierKind::kDontEmit);
       DCHECK_EQ(it->second->GetBlock(), instruction->GetBlock());
-      it->second->AsInstanceFieldSet()->SetWriteBarrierKind(WriteBarrierKind::kEmitNoNullCheck);
+      it->second->AsInstanceFieldSet()->SetWriteBarrierKind(WriteBarrierKind::kEmitBeingReliedOn);
       instruction->SetWriteBarrierKind(WriteBarrierKind::kDontEmit);
       MaybeRecordStat(stats_, MethodCompilationStat::kRemovedWriteBarrier);
     } else {
@@ -72,7 +72,7 @@
     DCHECK(!instruction->GetSideEffects().Includes(SideEffects::CanTriggerGC()));
 
     if (instruction->GetFieldType() != DataType::Type::kReference ||
-        instruction->GetValue()->IsNullConstant()) {
+        HuntForOriginalReference(instruction->GetValue())->IsNullConstant()) {
       instruction->SetWriteBarrierKind(WriteBarrierKind::kDontEmit);
       return;
     }
@@ -84,7 +84,7 @@
       DCHECK(it->second->IsStaticFieldSet());
       DCHECK(it->second->AsStaticFieldSet()->GetWriteBarrierKind() != WriteBarrierKind::kDontEmit);
       DCHECK_EQ(it->second->GetBlock(), instruction->GetBlock());
-      it->second->AsStaticFieldSet()->SetWriteBarrierKind(WriteBarrierKind::kEmitNoNullCheck);
+      it->second->AsStaticFieldSet()->SetWriteBarrierKind(WriteBarrierKind::kEmitBeingReliedOn);
       instruction->SetWriteBarrierKind(WriteBarrierKind::kDontEmit);
       MaybeRecordStat(stats_, MethodCompilationStat::kRemovedWriteBarrier);
     } else {
@@ -100,7 +100,7 @@
     }
 
     if (instruction->GetComponentType() != DataType::Type::kReference ||
-        instruction->GetValue()->IsNullConstant()) {
+        HuntForOriginalReference(instruction->GetValue())->IsNullConstant()) {
       instruction->SetWriteBarrierKind(WriteBarrierKind::kDontEmit);
       return;
     }
@@ -112,8 +112,7 @@
       DCHECK(it->second->IsArraySet());
       DCHECK(it->second->AsArraySet()->GetWriteBarrierKind() != WriteBarrierKind::kDontEmit);
       DCHECK_EQ(it->second->GetBlock(), instruction->GetBlock());
-      // We never skip the null check in ArraySets so that value is already set.
-      DCHECK(it->second->AsArraySet()->GetWriteBarrierKind() == WriteBarrierKind::kEmitNoNullCheck);
+      it->second->AsArraySet()->SetWriteBarrierKind(WriteBarrierKind::kEmitBeingReliedOn);
       instruction->SetWriteBarrierKind(WriteBarrierKind::kDontEmit);
       MaybeRecordStat(stats_, MethodCompilationStat::kRemovedWriteBarrier);
     } else {
diff --git a/compiler/optimizing/write_barrier_elimination.h b/compiler/optimizing/write_barrier_elimination.h
index a3769e7..1e9ab7b 100644
--- a/compiler/optimizing/write_barrier_elimination.h
+++ b/compiler/optimizing/write_barrier_elimination.h
@@ -33,7 +33,7 @@
 // We can keep the write barrier for `inner_obj` and remove the other two.
 //
 // In order to do this, we set the WriteBarrierKind of the instruction. The instruction's kind are
-// set to kEmitNoNullCheck (if this write barrier coalesced other write barriers, we don't want to
+// set to kEmitBeingReliedOn (if this write barrier coalesced other write barriers, we don't want to
 // perform the null check optimization), or to kDontEmit (if the write barrier as a whole is not
 // needed).
 class WriteBarrierElimination : public HOptimization {
diff --git a/compiler/optimizing/x86_memory_gen.cc b/compiler/optimizing/x86_memory_gen.cc
index e266618..d86869c 100644
--- a/compiler/optimizing/x86_memory_gen.cc
+++ b/compiler/optimizing/x86_memory_gen.cc
@@ -33,7 +33,7 @@
  private:
   void VisitBoundsCheck(HBoundsCheck* check) override {
     // Replace the length by the array itself, so that we can do compares to memory.
-    HArrayLength* array_len = check->InputAt(1)->AsArrayLength();
+    HArrayLength* array_len = check->InputAt(1)->AsArrayLengthOrNull();
 
     // We only want to replace an ArrayLength.
     if (array_len == nullptr) {
diff --git a/compiler/trampolines/trampoline_compiler.cc b/compiler/trampolines/trampoline_compiler.cc
index a122d3c..b3fc688 100644
--- a/compiler/trampolines/trampoline_compiler.cc
+++ b/compiler/trampolines/trampoline_compiler.cc
@@ -28,6 +28,10 @@
 #include "utils/arm64/assembler_arm64.h"
 #endif
 
+#ifdef ART_ENABLE_CODEGEN_riscv64
+#include "utils/riscv64/assembler_riscv64.h"
+#endif
+
 #ifdef ART_ENABLE_CODEGEN_x86
 #include "utils/x86/assembler_x86.h"
 #endif
@@ -57,16 +61,13 @@
   ArmVIXLAssembler assembler(allocator);
 
   switch (abi) {
-    case kInterpreterAbi:  // Thread* is first argument (R0) in interpreter ABI.
-      ___ Ldr(pc, MemOperand(r0, offset.Int32Value()));
-      break;
     case kJniAbi: {  // Load via Thread* held in JNIEnv* in first argument (R0).
       vixl::aarch32::UseScratchRegisterScope temps(assembler.GetVIXLAssembler());
       const vixl::aarch32::Register temp_reg = temps.Acquire();
 
       // VIXL will use the destination as a scratch register if
       // the offset is not encodable as an immediate operand.
-      ___ Ldr(temp_reg, MemOperand(r0, JNIEnvExt::SelfOffset(4).Int32Value()));
+      ___ Ldr(temp_reg, MemOperand(r0, JNIEnvExt::SelfOffset(kArmPointerSize).Int32Value()));
       ___ Ldr(pc, MemOperand(temp_reg, offset.Int32Value()));
       break;
     }
@@ -78,7 +79,7 @@
   size_t cs = __ CodeSize();
   std::unique_ptr<std::vector<uint8_t>> entry_stub(new std::vector<uint8_t>(cs));
   MemoryRegion code(entry_stub->data(), entry_stub->size());
-  __ FinalizeInstructions(code);
+  __ CopyInstructions(code);
 
   return std::move(entry_stub);
 }
@@ -95,15 +96,10 @@
   Arm64Assembler assembler(allocator);
 
   switch (abi) {
-    case kInterpreterAbi:  // Thread* is first argument (X0) in interpreter ABI.
-      __ JumpTo(Arm64ManagedRegister::FromXRegister(X0), Offset(offset.Int32Value()),
-          Arm64ManagedRegister::FromXRegister(IP1));
-
-      break;
     case kJniAbi:  // Load via Thread* held in JNIEnv* in first argument (X0).
       __ LoadRawPtr(Arm64ManagedRegister::FromXRegister(IP1),
                       Arm64ManagedRegister::FromXRegister(X0),
-                      Offset(JNIEnvExt::SelfOffset(8).Int32Value()));
+                      Offset(JNIEnvExt::SelfOffset(kArm64PointerSize).Int32Value()));
 
       __ JumpTo(Arm64ManagedRegister::FromXRegister(IP1), Offset(offset.Int32Value()),
                 Arm64ManagedRegister::FromXRegister(IP0));
@@ -120,13 +116,45 @@
   size_t cs = __ CodeSize();
   std::unique_ptr<std::vector<uint8_t>> entry_stub(new std::vector<uint8_t>(cs));
   MemoryRegion code(entry_stub->data(), entry_stub->size());
-  __ FinalizeInstructions(code);
+  __ CopyInstructions(code);
 
   return std::move(entry_stub);
 }
 }  // namespace arm64
 #endif  // ART_ENABLE_CODEGEN_arm64
 
+#ifdef ART_ENABLE_CODEGEN_riscv64
+namespace riscv64 {
+static std::unique_ptr<const std::vector<uint8_t>> CreateTrampoline(ArenaAllocator* allocator,
+                                                                    EntryPointCallingConvention abi,
+                                                                    ThreadOffset64 offset) {
+  Riscv64Assembler assembler(allocator);
+  ScratchRegisterScope srs(&assembler);
+  XRegister tmp = srs.AllocateXRegister();
+
+  switch (abi) {
+    case kJniAbi:  // Load via Thread* held in JNIEnv* in first argument (A0).
+      __ Loadd(tmp, A0, JNIEnvExt::SelfOffset(kRiscv64PointerSize).Int32Value());
+      __ Loadd(tmp, tmp, offset.Int32Value());
+      __ Jr(tmp);
+      break;
+    case kQuickAbi:  // TR holds Thread*.
+      __ Loadd(tmp, TR, offset.Int32Value());
+      __ Jr(tmp);
+      break;
+  }
+
+  __ FinalizeCode();
+  size_t cs = __ CodeSize();
+  std::unique_ptr<std::vector<uint8_t>> entry_stub(new std::vector<uint8_t>(cs));
+  MemoryRegion code(entry_stub->data(), entry_stub->size());
+  __ CopyInstructions(code);
+
+  return std::move(entry_stub);
+}
+}  // namespace riscv64
+#endif  // ART_ENABLE_CODEGEN_riscv64
+
 #ifdef ART_ENABLE_CODEGEN_x86
 namespace x86 {
 static std::unique_ptr<const std::vector<uint8_t>> CreateTrampoline(ArenaAllocator* allocator,
@@ -141,7 +169,7 @@
   size_t cs = __ CodeSize();
   std::unique_ptr<std::vector<uint8_t>> entry_stub(new std::vector<uint8_t>(cs));
   MemoryRegion code(entry_stub->data(), entry_stub->size());
-  __ FinalizeInstructions(code);
+  __ CopyInstructions(code);
 
   return std::move(entry_stub);
 }
@@ -162,7 +190,7 @@
   size_t cs = __ CodeSize();
   std::unique_ptr<std::vector<uint8_t>> entry_stub(new std::vector<uint8_t>(cs));
   MemoryRegion code(entry_stub->data(), entry_stub->size());
-  __ FinalizeInstructions(code);
+  __ CopyInstructions(code);
 
   return std::move(entry_stub);
 }
@@ -179,6 +207,10 @@
     case InstructionSet::kArm64:
       return arm64::CreateTrampoline(&allocator, abi, offset);
 #endif
+#ifdef ART_ENABLE_CODEGEN_riscv64
+    case InstructionSet::kRiscv64:
+      return riscv64::CreateTrampoline(&allocator, abi, offset);
+#endif
 #ifdef ART_ENABLE_CODEGEN_x86_64
     case InstructionSet::kX86_64:
       return x86_64::CreateTrampoline(&allocator, offset);
diff --git a/compiler/trampolines/trampoline_compiler.h b/compiler/trampolines/trampoline_compiler.h
index 32e35ae..25b715f 100644
--- a/compiler/trampolines/trampoline_compiler.h
+++ b/compiler/trampolines/trampoline_compiler.h
@@ -28,8 +28,6 @@
 namespace art HIDDEN {
 
 enum EntryPointCallingConvention {
-  // ABI of invocations to a method's interpreter entry point.
-  kInterpreterAbi,
   // ABI of calls to a method's native code, only used for native methods.
   kJniAbi,
   // ABI of calls to a method's quick code entry point.
diff --git a/compiler/utils/arm/assembler_arm_vixl.cc b/compiler/utils/arm/assembler_arm_vixl.cc
index c7ca003..d64de09 100644
--- a/compiler/utils/arm/assembler_arm_vixl.cc
+++ b/compiler/utils/arm/assembler_arm_vixl.cc
@@ -52,7 +52,7 @@
   return vixl_masm_.GetBuffer().GetStartAddress<const uint8_t*>();
 }
 
-void ArmVIXLAssembler::FinalizeInstructions(const MemoryRegion& region) {
+void ArmVIXLAssembler::CopyInstructions(const MemoryRegion& region) {
   // Copy the instructions from the buffer.
   MemoryRegion from(vixl_masm_.GetBuffer()->GetStartAddress<void*>(), CodeSize());
   region.CopyFrom(0, from);
diff --git a/compiler/utils/arm/assembler_arm_vixl.h b/compiler/utils/arm/assembler_arm_vixl.h
index 741119d..50dc06f 100644
--- a/compiler/utils/arm/assembler_arm_vixl.h
+++ b/compiler/utils/arm/assembler_arm_vixl.h
@@ -173,6 +173,30 @@
     }
   }
   using MacroAssembler::Vmov;
+
+  // TODO(b/281982421): Move the implementation of Mrrc to vixl and remove this implementation.
+  void Mrrc(vixl32::Register r1, vixl32::Register r2, int coproc, int opc1, int crm) {
+    // See ARM A-profile A32/T32 Instruction set architecture
+    // https://developer.arm.com/documentation/ddi0597/2022-09/Base-Instructions/MRRC--Move-to-two-general-purpose-registers-from-System-register-
+    CHECK(coproc == 15 || coproc == 14);
+    if (IsUsingT32()) {
+      uint32_t inst = (0b111011000101 << 20) |
+                      (r2.GetCode() << 16) |
+                      (r1.GetCode() << 12) |
+                      (coproc << 8) |
+                      (opc1 << 4) |
+                      crm;
+      EmitT32_32(inst);
+    } else {
+      uint32_t inst = (0b000011000101 << 20) |
+                      (r2.GetCode() << 16) |
+                      (r1.GetCode() << 12) |
+                      (coproc << 8) |
+                      (opc1 << 4) |
+                      crm;
+      EmitA32(inst);
+    }
+  }
 };
 
 class ArmVIXLAssembler final : public Assembler {
@@ -194,12 +218,12 @@
   const uint8_t* CodeBufferBaseAddress() const override;
 
   // Copy instructions out of assembly buffer into the given region of memory.
-  void FinalizeInstructions(const MemoryRegion& region) override;
+  void CopyInstructions(const MemoryRegion& region) override;
 
-  void Bind(Label* label ATTRIBUTE_UNUSED) override {
+  void Bind([[maybe_unused]] Label* label) override {
     UNIMPLEMENTED(FATAL) << "Do not use Bind(Label*) for ARM";
   }
-  void Jump(Label* label ATTRIBUTE_UNUSED) override {
+  void Jump([[maybe_unused]] Label* label) override {
     UNIMPLEMENTED(FATAL) << "Do not use Jump(Label*) for ARM";
   }
 
diff --git a/compiler/utils/arm/jni_macro_assembler_arm_vixl.cc b/compiler/utils/arm/jni_macro_assembler_arm_vixl.cc
index 5487345..6844b1e 100644
--- a/compiler/utils/arm/jni_macro_assembler_arm_vixl.cc
+++ b/compiler/utils/arm/jni_macro_assembler_arm_vixl.cc
@@ -21,6 +21,8 @@
 
 #include "entrypoints/quick/quick_entrypoints.h"
 #include "indirect_reference_table.h"
+#include "jni/jni_env_ext.h"
+#include "jni/local_reference_table.h"
 #include "lock_word.h"
 #include "thread.h"
 
@@ -155,7 +157,7 @@
 
   // Pop LR to PC unless we need to emit some read barrier code just before returning.
   bool emit_code_before_return =
-      (gUseReadBarrier && kUseBakerReadBarrier) &&
+      kReserveMarkingRegister &&
       (may_suspend || (kIsDebugBuild && emit_run_time_checks_in_debug_mode_));
   if ((core_spill_mask & (1u << lr.GetCode())) != 0u && !emit_code_before_return) {
     DCHECK_EQ(core_spill_mask & (1u << pc.GetCode()), 0u);
@@ -197,18 +199,7 @@
 
   // Pop core callee saves.
   if (core_spill_mask != 0u) {
-    if (IsPowerOfTwo(core_spill_mask) &&
-        core_spill_mask != (1u << pc.GetCode()) &&
-        WhichPowerOf2(core_spill_mask) >= 8) {
-      // FIXME(vixl): vixl fails to transform a pop with single high register
-      // to a post-index STR (also known as POP encoding T3) and emits the LDMIA
-      // (also known as POP encoding T2) which is UNPREDICTABLE for 1 register.
-      // So we have to explicitly do the transformation here. Bug: 178048807
-      vixl32::Register reg(WhichPowerOf2(core_spill_mask));
-      ___ Ldr(reg, MemOperand(sp, kFramePointerSize, PostIndex));
-    } else {
-      ___ Pop(RegisterList(core_spill_mask));
-    }
+    ___ Pop(RegisterList(core_spill_mask));
     if ((core_spill_mask & (1u << pc.GetCode())) == 0u) {
       cfi().AdjustCFAOffset(-kFramePointerSize * POPCOUNT(core_spill_mask));
       cfi().RestoreMany(DWARFReg(r0), core_spill_mask);
@@ -344,13 +335,13 @@
   }
 }
 
-void ArmVIXLJNIMacroAssembler::SignExtend(ManagedRegister mreg ATTRIBUTE_UNUSED,
-                                          size_t size ATTRIBUTE_UNUSED) {
+void ArmVIXLJNIMacroAssembler::SignExtend([[maybe_unused]] ManagedRegister mreg,
+                                          [[maybe_unused]] size_t size) {
   UNIMPLEMENTED(FATAL) << "no sign extension necessary for arm";
 }
 
-void ArmVIXLJNIMacroAssembler::ZeroExtend(ManagedRegister mreg ATTRIBUTE_UNUSED,
-                                          size_t size ATTRIBUTE_UNUSED) {
+void ArmVIXLJNIMacroAssembler::ZeroExtend([[maybe_unused]] ManagedRegister mreg,
+                                          [[maybe_unused]] size_t size) {
   UNIMPLEMENTED(FATAL) << "no zero extension necessary for arm";
 }
 
@@ -720,7 +711,7 @@
 
 void ArmVIXLJNIMacroAssembler::Move(ManagedRegister mdst,
                                     ManagedRegister msrc,
-                                    size_t size  ATTRIBUTE_UNUSED) {
+                                    [[maybe_unused]] size_t size) {
   ArmManagedRegister dst = mdst.AsArm();
   if (kIsDebugBuild) {
     // Check that the destination is not a scratch register.
@@ -861,13 +852,13 @@
   ___ Ldr(reg, MemOperand(reg));
 }
 
-void ArmVIXLJNIMacroAssembler::VerifyObject(ManagedRegister src ATTRIBUTE_UNUSED,
-                                            bool could_be_null ATTRIBUTE_UNUSED) {
+void ArmVIXLJNIMacroAssembler::VerifyObject([[maybe_unused]] ManagedRegister src,
+                                            [[maybe_unused]] bool could_be_null) {
   // TODO: not validating references.
 }
 
-void ArmVIXLJNIMacroAssembler::VerifyObject(FrameOffset src ATTRIBUTE_UNUSED,
-                                            bool could_be_null ATTRIBUTE_UNUSED) {
+void ArmVIXLJNIMacroAssembler::VerifyObject([[maybe_unused]] FrameOffset src,
+                                            [[maybe_unused]] bool could_be_null) {
   // TODO: not validating references.
 }
 
@@ -1012,7 +1003,7 @@
 }
 
 std::unique_ptr<JNIMacroLabel> ArmVIXLJNIMacroAssembler::CreateLabel() {
-  return std::unique_ptr<JNIMacroLabel>(new ArmVIXLJNIMacroLabel());
+  return std::unique_ptr<JNIMacroLabel>(new (asm_.GetAllocator()) ArmVIXLJNIMacroLabel());
 }
 
 void ArmVIXLJNIMacroAssembler::Jump(JNIMacroLabel* label) {
@@ -1026,7 +1017,6 @@
   UseScratchRegisterScope temps(asm_.GetVIXLAssembler());
   vixl32::Register test_reg;
   DCHECK_EQ(Thread::IsGcMarkingSize(), 4u);
-  DCHECK(gUseReadBarrier);
   if (kUseBakerReadBarrier) {
     // TestGcMarking() is used in the JNI stub entry when the marking register is up to date.
     if (kIsDebugBuild && emit_run_time_checks_in_debug_mode_) {
@@ -1120,5 +1110,35 @@
   }
 }
 
+void ArmVIXLJNIMacroAssembler::LoadLocalReferenceTableStates(ManagedRegister jni_env_reg,
+                                                             ManagedRegister previous_state_reg,
+                                                             ManagedRegister current_state_reg) {
+  constexpr size_t kLRTSegmentStateSize = sizeof(jni::LRTSegmentState);
+  DCHECK_EQ(kLRTSegmentStateSize, kRegSizeInBytes);
+  const MemberOffset previous_state_offset = JNIEnvExt::LrtPreviousStateOffset(kArmPointerSize);
+  const MemberOffset current_state_offset = JNIEnvExt::LrtSegmentStateOffset(kArmPointerSize);
+  DCHECK_EQ(previous_state_offset.SizeValue() + kLRTSegmentStateSize,
+            current_state_offset.SizeValue());
+
+  ___ Ldrd(AsVIXLRegister(previous_state_reg.AsArm()),
+           AsVIXLRegister(current_state_reg.AsArm()),
+           MemOperand(AsVIXLRegister(jni_env_reg.AsArm()), previous_state_offset.Int32Value()));
+}
+
+void ArmVIXLJNIMacroAssembler::StoreLocalReferenceTableStates(ManagedRegister jni_env_reg,
+                                                              ManagedRegister previous_state_reg,
+                                                              ManagedRegister current_state_reg) {
+  constexpr size_t kLRTSegmentStateSize = sizeof(jni::LRTSegmentState);
+  DCHECK_EQ(kLRTSegmentStateSize, kRegSizeInBytes);
+  const MemberOffset previous_state_offset = JNIEnvExt::LrtPreviousStateOffset(kArmPointerSize);
+  const MemberOffset current_state_offset = JNIEnvExt::LrtSegmentStateOffset(kArmPointerSize);
+  DCHECK_EQ(previous_state_offset.SizeValue() + kLRTSegmentStateSize,
+            current_state_offset.SizeValue());
+
+  ___ Strd(AsVIXLRegister(previous_state_reg.AsArm()),
+           AsVIXLRegister(current_state_reg.AsArm()),
+           MemOperand(AsVIXLRegister(jni_env_reg.AsArm()), previous_state_offset.Int32Value()));
+}
+
 }  // namespace arm
 }  // namespace art
diff --git a/compiler/utils/arm/jni_macro_assembler_arm_vixl.h b/compiler/utils/arm/jni_macro_assembler_arm_vixl.h
index f6df7f2..3f6512c 100644
--- a/compiler/utils/arm/jni_macro_assembler_arm_vixl.h
+++ b/compiler/utils/arm/jni_macro_assembler_arm_vixl.h
@@ -91,6 +91,14 @@
   void GetCurrentThread(ManagedRegister dest) override;
   void GetCurrentThread(FrameOffset dest_offset) override;
 
+  // Manipulating local reference table states.
+  void LoadLocalReferenceTableStates(ManagedRegister jni_env_reg,
+                                     ManagedRegister previous_state_reg,
+                                     ManagedRegister current_state_reg) override;
+  void StoreLocalReferenceTableStates(ManagedRegister jni_env_reg,
+                                      ManagedRegister previous_state_reg,
+                                      ManagedRegister current_state_reg) override;
+
   // Decode JNI transition or local `jobject`. For (weak) global `jobject`, jump to slow path.
   void DecodeJNITransitionOrLocalJObject(ManagedRegister reg,
                                          JNIMacroLabel* slow_path,
diff --git a/compiler/utils/arm64/assembler_arm64.cc b/compiler/utils/arm64/assembler_arm64.cc
index 26dce7c..13acc7c 100644
--- a/compiler/utils/arm64/assembler_arm64.cc
+++ b/compiler/utils/arm64/assembler_arm64.cc
@@ -79,7 +79,7 @@
   return vixl_masm_.GetBuffer().GetStartAddress<const uint8_t*>();
 }
 
-void Arm64Assembler::FinalizeInstructions(const MemoryRegion& region) {
+void Arm64Assembler::CopyInstructions(const MemoryRegion& region) {
   // Copy the instructions from the buffer.
   MemoryRegion from(vixl_masm_.GetBuffer()->GetStartAddress<void*>(), CodeSize());
   region.CopyFrom(0, from);
diff --git a/compiler/utils/arm64/assembler_arm64.h b/compiler/utils/arm64/assembler_arm64.h
index f816890..ad6a8ed 100644
--- a/compiler/utils/arm64/assembler_arm64.h
+++ b/compiler/utils/arm64/assembler_arm64.h
@@ -91,7 +91,7 @@
   const uint8_t* CodeBufferBaseAddress() const override;
 
   // Copy instructions out of assembly buffer into the given region of memory.
-  void FinalizeInstructions(const MemoryRegion& region) override;
+  void CopyInstructions(const MemoryRegion& region) override;
 
   void LoadRawPtr(ManagedRegister dest, ManagedRegister base, Offset offs);
 
@@ -145,10 +145,10 @@
   // MaybeGenerateMarkingRegisterCheck and is passed to the BRK instruction.
   void GenerateMarkingRegisterCheck(vixl::aarch64::Register temp, int code = 0);
 
-  void Bind(Label* label ATTRIBUTE_UNUSED) override {
+  void Bind([[maybe_unused]] Label* label) override {
     UNIMPLEMENTED(FATAL) << "Do not use Bind(Label*) for ARM64";
   }
-  void Jump(Label* label ATTRIBUTE_UNUSED) override {
+  void Jump([[maybe_unused]] Label* label) override {
     UNIMPLEMENTED(FATAL) << "Do not use Jump(Label*) for ARM64";
   }
 
diff --git a/compiler/utils/arm64/jni_macro_assembler_arm64.cc b/compiler/utils/arm64/jni_macro_assembler_arm64.cc
index 9e9f122..50f6b41 100644
--- a/compiler/utils/arm64/jni_macro_assembler_arm64.cc
+++ b/compiler/utils/arm64/jni_macro_assembler_arm64.cc
@@ -18,6 +18,8 @@
 
 #include "entrypoints/quick/quick_entrypoints.h"
 #include "indirect_reference_table.h"
+#include "jni/jni_env_ext.h"
+#include "jni/local_reference_table.h"
 #include "lock_word.h"
 #include "managed_register_arm64.h"
 #include "offsets.h"
@@ -705,7 +707,7 @@
 }
 
 void Arm64JNIMacroAssembler::TryToTransitionFromRunnableToNative(
-    JNIMacroLabel* label, ArrayRef<const ManagedRegister> scratch_regs ATTRIBUTE_UNUSED) {
+    JNIMacroLabel* label, [[maybe_unused]] ArrayRef<const ManagedRegister> scratch_regs) {
   constexpr uint32_t kNativeStateValue = Thread::StoredThreadStateValue(ThreadState::kNative);
   constexpr uint32_t kRunnableStateValue = Thread::StoredThreadStateValue(ThreadState::kRunnable);
   constexpr ThreadOffset64 thread_flags_offset = Thread::ThreadFlagsOffset<kArm64PointerSize>();
@@ -734,8 +736,8 @@
 
 void Arm64JNIMacroAssembler::TryToTransitionFromNativeToRunnable(
     JNIMacroLabel* label,
-    ArrayRef<const ManagedRegister> scratch_regs ATTRIBUTE_UNUSED,
-    ManagedRegister return_reg ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] ArrayRef<const ManagedRegister> scratch_regs,
+    [[maybe_unused]] ManagedRegister return_reg) {
   constexpr uint32_t kNativeStateValue = Thread::StoredThreadStateValue(ThreadState::kNative);
   constexpr uint32_t kRunnableStateValue = Thread::StoredThreadStateValue(ThreadState::kRunnable);
   constexpr ThreadOffset64 thread_flags_offset = Thread::ThreadFlagsOffset<kArm64PointerSize>();
@@ -797,7 +799,7 @@
 }
 
 std::unique_ptr<JNIMacroLabel> Arm64JNIMacroAssembler::CreateLabel() {
-  return std::unique_ptr<JNIMacroLabel>(new Arm64JNIMacroLabel());
+  return std::unique_ptr<JNIMacroLabel>(new (asm_.GetAllocator()) Arm64JNIMacroLabel());
 }
 
 void Arm64JNIMacroAssembler::Jump(JNIMacroLabel* label) {
@@ -811,7 +813,6 @@
   UseScratchRegisterScope temps(asm_.GetVIXLAssembler());
   Register test_reg;
   DCHECK_EQ(Thread::IsGcMarkingSize(), 4u);
-  DCHECK(gUseReadBarrier);
   if (kUseBakerReadBarrier) {
     // TestGcMarking() is used in the JNI stub entry when the marking register is up to date.
     if (kIsDebugBuild && emit_run_time_checks_in_debug_mode_) {
@@ -980,6 +981,39 @@
   cfi().DefCFAOffset(frame_size);
 }
 
+void Arm64JNIMacroAssembler::LoadLocalReferenceTableStates(ManagedRegister jni_env_reg,
+                                                           ManagedRegister previous_state_reg,
+                                                           ManagedRegister current_state_reg) {
+  constexpr size_t kLRTSegmentStateSize = sizeof(jni::LRTSegmentState);
+  DCHECK_EQ(kLRTSegmentStateSize, kWRegSizeInBytes);
+  const MemberOffset previous_state_offset = JNIEnvExt::LrtPreviousStateOffset(kArm64PointerSize);
+  const MemberOffset current_state_offset = JNIEnvExt::LrtSegmentStateOffset(kArm64PointerSize);
+  DCHECK_EQ(previous_state_offset.SizeValue() + kLRTSegmentStateSize,
+            current_state_offset.SizeValue());
+
+  ___ Ldp(
+      reg_w(previous_state_reg.AsArm64().AsWRegister()),
+      reg_w(current_state_reg.AsArm64().AsWRegister()),
+      MemOperand(reg_x(jni_env_reg.AsArm64().AsXRegister()), previous_state_offset.Int32Value()));
+}
+
+void Arm64JNIMacroAssembler::StoreLocalReferenceTableStates(ManagedRegister jni_env_reg,
+                                                            ManagedRegister previous_state_reg,
+                                                            ManagedRegister current_state_reg) {
+  constexpr size_t kLRTSegmentStateSize = sizeof(jni::LRTSegmentState);
+  DCHECK_EQ(kLRTSegmentStateSize, kWRegSizeInBytes);
+  const MemberOffset previous_state_offset = JNIEnvExt::LrtPreviousStateOffset(kArm64PointerSize);
+  const MemberOffset current_state_offset = JNIEnvExt::LrtSegmentStateOffset(kArm64PointerSize);
+  DCHECK_EQ(previous_state_offset.SizeValue() + kLRTSegmentStateSize,
+            current_state_offset.SizeValue());
+
+  // Set the current segment state together with restoring the cookie.
+  ___ Stp(
+      reg_w(previous_state_reg.AsArm64().AsWRegister()),
+      reg_w(current_state_reg.AsArm64().AsWRegister()),
+      MemOperand(reg_x(jni_env_reg.AsArm64().AsXRegister()), previous_state_offset.Int32Value()));
+}
+
 #undef ___
 
 }  // namespace arm64
diff --git a/compiler/utils/arm64/jni_macro_assembler_arm64.h b/compiler/utils/arm64/jni_macro_assembler_arm64.h
index 2836e09..0750c26 100644
--- a/compiler/utils/arm64/jni_macro_assembler_arm64.h
+++ b/compiler/utils/arm64/jni_macro_assembler_arm64.h
@@ -93,6 +93,14 @@
   void GetCurrentThread(ManagedRegister dest) override;
   void GetCurrentThread(FrameOffset dest_offset) override;
 
+  // Manipulating local reference table states.
+  void LoadLocalReferenceTableStates(ManagedRegister jni_env_reg,
+                                     ManagedRegister previous_state_reg,
+                                     ManagedRegister current_state_reg) override;
+  void StoreLocalReferenceTableStates(ManagedRegister jni_env_reg,
+                                      ManagedRegister previous_state_reg,
+                                      ManagedRegister current_state_reg) override;
+
   // Decode JNI transition or local `jobject`. For (weak) global `jobject`, jump to slow path.
   void DecodeJNITransitionOrLocalJObject(ManagedRegister reg,
                                          JNIMacroLabel* slow_path,
diff --git a/compiler/utils/assembler.cc b/compiler/utils/assembler.cc
index b82f0dc..1c04a3d 100644
--- a/compiler/utils/assembler.cc
+++ b/compiler/utils/assembler.cc
@@ -57,21 +57,24 @@
     fixup->Process(region, fixup->position());
     fixup = fixup->previous();
   }
-}
-
-
-void AssemblerBuffer::FinalizeInstructions(const MemoryRegion& instructions) {
-  // Copy the instructions from the buffer.
-  MemoryRegion from(reinterpret_cast<void*>(contents()), Size());
-  instructions.CopyFrom(0, from);
-  // Process fixups in the instructions.
-  ProcessFixups(instructions);
 #ifndef NDEBUG
   fixups_processed_ = true;
 #endif
 }
 
 
+void AssemblerBuffer::ProcessFixups() {
+  MemoryRegion from(reinterpret_cast<void*>(contents()), Size());
+  ProcessFixups(from);
+}
+
+
+void AssemblerBuffer::CopyInstructions(const MemoryRegion& instructions) {
+  MemoryRegion from(reinterpret_cast<void*>(contents()), Size());
+  instructions.CopyFrom(0, from);
+}
+
+
 void AssemblerBuffer::ExtendCapacity(size_t min_capacity) {
   size_t old_size = Size();
   size_t old_capacity = Capacity();
diff --git a/compiler/utils/assembler.h b/compiler/utils/assembler.h
index 13a5d9f..f3fa711 100644
--- a/compiler/utils/assembler.h
+++ b/compiler/utils/assembler.h
@@ -163,9 +163,8 @@
 
   uint8_t* contents() const { return contents_; }
 
-  // Copy the assembled instructions into the specified memory block
-  // and apply all fixups.
-  void FinalizeInstructions(const MemoryRegion& region);
+  // Copy the assembled instructions into the specified memory block.
+  void CopyInstructions(const MemoryRegion& region);
 
   // To emit an instruction to the assembler buffer, the EnsureCapacity helper
   // must be used to guarantee that the underlying data area is big enough to
@@ -246,6 +245,8 @@
   // The provided `min_capacity` must be higher than current `Capacity()`.
   void ExtendCapacity(size_t min_capacity);
 
+  void ProcessFixups();
+
  private:
   // The limit is set to kMinimumGap bytes before the end of the data area.
   // This leaves enough space for the longest possible instruction and allows
@@ -357,7 +358,10 @@
 class Assembler : public DeletableArenaObject<kArenaAllocAssembler> {
  public:
   // Finalize the code; emit slow paths, fixup branches, add literal pool, etc.
-  virtual void FinalizeCode() { buffer_.EmitSlowPaths(this); }
+  virtual void FinalizeCode() {
+    buffer_.EmitSlowPaths(this);
+    buffer_.ProcessFixups();
+  }
 
   // Size of generated code
   virtual size_t CodeSize() const { return buffer_.Size(); }
@@ -375,12 +379,12 @@
   virtual size_t CodePosition() { return CodeSize(); }
 
   // Copy instructions out of assembly buffer into the given region of memory
-  virtual void FinalizeInstructions(const MemoryRegion& region) {
-    buffer_.FinalizeInstructions(region);
+  virtual void CopyInstructions(const MemoryRegion& region) {
+    buffer_.CopyInstructions(region);
   }
 
   // TODO: Implement with disassembler.
-  virtual void Comment(const char* format ATTRIBUTE_UNUSED, ...) {}
+  virtual void Comment([[maybe_unused]] const char* format, ...) {}
 
   virtual void Bind(Label* label) = 0;
   virtual void Jump(Label* label) = 0;
diff --git a/compiler/utils/assembler_test.h b/compiler/utils/assembler_test.h
index d03e5a7..05c79f3 100644
--- a/compiler/utils/assembler_test.h
+++ b/compiler/utils/assembler_test.h
@@ -26,6 +26,7 @@
 #include <fstream>
 #include <iterator>
 
+#include "base/array_ref.h"
 #include "base/macros.h"
 #include "base/malloc_arena_pool.h"
 #include "assembler_test_base.h"
@@ -200,8 +201,8 @@
   template <typename Reg1, typename Reg2, typename ImmType>
   std::string RepeatTemplatedRegistersImmBits(void (Ass::*f)(Reg1, Reg2, ImmType),
                                               int imm_bits,
-                                              const std::vector<Reg1*> reg1_registers,
-                                              const std::vector<Reg2*> reg2_registers,
+                                              ArrayRef<const Reg1> reg1_registers,
+                                              ArrayRef<const Reg2> reg2_registers,
                                               std::string (AssemblerTest::*GetName1)(const Reg1&),
                                               std::string (AssemblerTest::*GetName2)(const Reg2&),
                                               const std::string& fmt,
@@ -215,48 +216,28 @@
         for (int64_t imm : imms) {
           ImmType new_imm = CreateImmediate(imm);
           if (f != nullptr) {
-            (assembler_.get()->*f)(*reg1, *reg2, new_imm * multiplier + bias);
+            (assembler_.get()->*f)(reg1, reg2, new_imm * multiplier + bias);
           }
           std::string base = fmt;
 
-          std::string reg1_string = (this->*GetName1)(*reg1);
-          size_t reg1_index;
-          while ((reg1_index = base.find(REG1_TOKEN)) != std::string::npos) {
-            base.replace(reg1_index, ConstexprStrLen(REG1_TOKEN), reg1_string);
-          }
+          ReplaceReg(REG1_TOKEN, (this->*GetName1)(reg1), &base);
+          ReplaceReg(REG2_TOKEN, (this->*GetName2)(reg2), &base);
+          ReplaceImm(imm, bias, multiplier, &base);
 
-          std::string reg2_string = (this->*GetName2)(*reg2);
-          size_t reg2_index;
-          while ((reg2_index = base.find(REG2_TOKEN)) != std::string::npos) {
-            base.replace(reg2_index, ConstexprStrLen(REG2_TOKEN), reg2_string);
-          }
-
-          size_t imm_index = base.find(IMM_TOKEN);
-          if (imm_index != std::string::npos) {
-            std::ostringstream sreg;
-            sreg << imm * multiplier + bias;
-            std::string imm_string = sreg.str();
-            base.replace(imm_index, ConstexprStrLen(IMM_TOKEN), imm_string);
-          }
-
-          if (str.size() > 0) {
-            str += "\n";
-          }
           str += base;
+          str += "\n";
         }
       }
     }
-    // Add a newline at the end.
-    str += "\n";
     return str;
   }
 
   template <typename Reg1, typename Reg2, typename Reg3, typename ImmType>
   std::string RepeatTemplatedRegistersImmBits(void (Ass::*f)(Reg1, Reg2, Reg3, ImmType),
                                               int imm_bits,
-                                              const std::vector<Reg1*> reg1_registers,
-                                              const std::vector<Reg2*> reg2_registers,
-                                              const std::vector<Reg3*> reg3_registers,
+                                              ArrayRef<const Reg1> reg1_registers,
+                                              ArrayRef<const Reg2> reg2_registers,
+                                              ArrayRef<const Reg3> reg3_registers,
                                               std::string (AssemblerTest::*GetName1)(const Reg1&),
                                               std::string (AssemblerTest::*GetName2)(const Reg2&),
                                               std::string (AssemblerTest::*GetName3)(const Reg3&),
@@ -271,53 +252,28 @@
           for (int64_t imm : imms) {
             ImmType new_imm = CreateImmediate(imm);
             if (f != nullptr) {
-              (assembler_.get()->*f)(*reg1, *reg2, *reg3, new_imm + bias);
+              (assembler_.get()->*f)(reg1, reg2, reg3, new_imm + bias);
             }
             std::string base = fmt;
 
-            std::string reg1_string = (this->*GetName1)(*reg1);
-            size_t reg1_index;
-            while ((reg1_index = base.find(REG1_TOKEN)) != std::string::npos) {
-              base.replace(reg1_index, ConstexprStrLen(REG1_TOKEN), reg1_string);
-            }
+            ReplaceReg(REG1_TOKEN, (this->*GetName1)(reg1), &base);
+            ReplaceReg(REG2_TOKEN, (this->*GetName2)(reg2), &base);
+            ReplaceReg(REG3_TOKEN, (this->*GetName3)(reg3), &base);
+            ReplaceImm(imm, bias, /*multiplier=*/ 1, &base);
 
-            std::string reg2_string = (this->*GetName2)(*reg2);
-            size_t reg2_index;
-            while ((reg2_index = base.find(REG2_TOKEN)) != std::string::npos) {
-              base.replace(reg2_index, ConstexprStrLen(REG2_TOKEN), reg2_string);
-            }
-
-            std::string reg3_string = (this->*GetName3)(*reg3);
-            size_t reg3_index;
-            while ((reg3_index = base.find(REG3_TOKEN)) != std::string::npos) {
-              base.replace(reg3_index, ConstexprStrLen(REG3_TOKEN), reg3_string);
-            }
-
-            size_t imm_index = base.find(IMM_TOKEN);
-            if (imm_index != std::string::npos) {
-              std::ostringstream sreg;
-              sreg << imm + bias;
-              std::string imm_string = sreg.str();
-              base.replace(imm_index, ConstexprStrLen(IMM_TOKEN), imm_string);
-            }
-
-            if (str.size() > 0) {
-              str += "\n";
-            }
             str += base;
+            str += "\n";
           }
         }
       }
     }
-    // Add a newline at the end.
-    str += "\n";
     return str;
   }
 
   template <typename ImmType, typename Reg1, typename Reg2>
   std::string RepeatTemplatedImmBitsRegisters(void (Ass::*f)(ImmType, Reg1, Reg2),
-                                              const std::vector<Reg1*> reg1_registers,
-                                              const std::vector<Reg2*> reg2_registers,
+                                              ArrayRef<const Reg1> reg1_registers,
+                                              ArrayRef<const Reg2> reg2_registers,
                                               std::string (AssemblerTest::*GetName1)(const Reg1&),
                                               std::string (AssemblerTest::*GetName2)(const Reg2&),
                                               int imm_bits,
@@ -332,46 +288,26 @@
         for (int64_t imm : imms) {
           ImmType new_imm = CreateImmediate(imm);
           if (f != nullptr) {
-            (assembler_.get()->*f)(new_imm, *reg1, *reg2);
+            (assembler_.get()->*f)(new_imm, reg1, reg2);
           }
           std::string base = fmt;
 
-          std::string reg1_string = (this->*GetName1)(*reg1);
-          size_t reg1_index;
-          while ((reg1_index = base.find(REG1_TOKEN)) != std::string::npos) {
-            base.replace(reg1_index, ConstexprStrLen(REG1_TOKEN), reg1_string);
-          }
+          ReplaceReg(REG1_TOKEN, (this->*GetName1)(reg1), &base);
+          ReplaceReg(REG2_TOKEN, (this->*GetName2)(reg2), &base);
+          ReplaceImm(imm, /*bias=*/ 0, /*multiplier=*/ 1, &base);
 
-          std::string reg2_string = (this->*GetName2)(*reg2);
-          size_t reg2_index;
-          while ((reg2_index = base.find(REG2_TOKEN)) != std::string::npos) {
-            base.replace(reg2_index, ConstexprStrLen(REG2_TOKEN), reg2_string);
-          }
-
-          size_t imm_index = base.find(IMM_TOKEN);
-          if (imm_index != std::string::npos) {
-            std::ostringstream sreg;
-            sreg << imm;
-            std::string imm_string = sreg.str();
-            base.replace(imm_index, ConstexprStrLen(IMM_TOKEN), imm_string);
-          }
-
-          if (str.size() > 0) {
-            str += "\n";
-          }
           str += base;
+          str += "\n";
         }
       }
     }
-    // Add a newline at the end.
-    str += "\n";
     return str;
   }
 
   template <typename RegType, typename ImmType>
   std::string RepeatTemplatedRegisterImmBits(void (Ass::*f)(RegType, ImmType),
                                              int imm_bits,
-                                             const std::vector<RegType*> registers,
+                                             ArrayRef<const RegType> registers,
                                              std::string (AssemblerTest::*GetName)(const RegType&),
                                              const std::string& fmt,
                                              int bias) {
@@ -382,35 +318,147 @@
       for (int64_t imm : imms) {
         ImmType new_imm = CreateImmediate(imm);
         if (f != nullptr) {
-          (assembler_.get()->*f)(*reg, new_imm + bias);
+          (assembler_.get()->*f)(reg, new_imm + bias);
         }
         std::string base = fmt;
 
-        std::string reg_string = (this->*GetName)(*reg);
-        size_t reg_index;
-        while ((reg_index = base.find(REG_TOKEN)) != std::string::npos) {
-          base.replace(reg_index, ConstexprStrLen(REG_TOKEN), reg_string);
-        }
+        ReplaceReg(REG_TOKEN, (this->*GetName)(reg), &base);
+        ReplaceImm(imm, bias, /*multiplier=*/ 1, &base);
 
-        size_t imm_index = base.find(IMM_TOKEN);
-        if (imm_index != std::string::npos) {
-          std::ostringstream sreg;
-          sreg << imm + bias;
-          std::string imm_string = sreg.str();
-          base.replace(imm_index, ConstexprStrLen(IMM_TOKEN), imm_string);
-        }
-
-        if (str.size() > 0) {
-          str += "\n";
-        }
         str += base;
+        str += "\n";
       }
     }
-    // Add a newline at the end.
-    str += "\n";
     return str;
   }
 
+  template <typename RegType, typename ImmType>
+  std::string RepeatTemplatedRegisterImmBitsShift(
+      void (Ass::*f)(RegType, ImmType),
+      int imm_bits,
+      int shift,
+      ArrayRef<const RegType> registers,
+      std::string (AssemblerTest::*GetName)(const RegType&),
+      const std::string& fmt,
+      int bias) {
+    std::string str;
+    std::vector<int64_t> imms = CreateImmediateValuesBits(abs(imm_bits), (imm_bits > 0), shift);
+
+    for (auto reg : registers) {
+      for (int64_t imm : imms) {
+        ImmType new_imm = CreateImmediate(imm);
+        if (f != nullptr) {
+          (assembler_.get()->*f)(reg, new_imm + bias);
+        }
+        std::string base = fmt;
+
+        ReplaceReg(REG_TOKEN, (this->*GetName)(reg), &base);
+        ReplaceImm(imm, bias, /*multiplier=*/ 1, &base);
+
+        str += base;
+        str += "\n";
+      }
+    }
+    return str;
+  }
+
+  template <typename ImmType>
+  std::string RepeatTemplatedImmBitsShift(
+      void (Ass::*f)(ImmType), int imm_bits, int shift, const std::string& fmt, int bias = 0) {
+    std::vector<int64_t> imms = CreateImmediateValuesBits(abs(imm_bits), (imm_bits > 0), shift);
+
+    WarnOnCombinations(imms.size());
+
+    std::string str;
+
+    for (int64_t imm : imms) {
+      ImmType new_imm = CreateImmediate(imm);
+      if (f != nullptr) {
+        (assembler_.get()->*f)(new_imm + bias);
+      }
+      std::string base = fmt;
+
+      ReplaceImm(imm, bias, /*multiplier=*/ 1, &base);
+
+      str += base;
+      str += "\n";
+    }
+    return str;
+  }
+
+  template <typename Reg1, typename Reg2, typename ImmType>
+  std::string RepeatTemplatedRegistersImmBitsShift(
+      void (Ass::*f)(Reg1, Reg2, ImmType),
+      int imm_bits,
+      int shift,
+      ArrayRef<const Reg1> reg1_registers,
+      ArrayRef<const Reg2> reg2_registers,
+      std::string (AssemblerTest::*GetName1)(const Reg1&),
+      std::string (AssemblerTest::*GetName2)(const Reg2&),
+      const std::string& fmt,
+      int bias = 0,
+      int multiplier = 1) {
+    std::string str;
+    std::vector<int64_t> imms = CreateImmediateValuesBits(abs(imm_bits), (imm_bits > 0), shift);
+
+    for (auto reg1 : reg1_registers) {
+      for (auto reg2 : reg2_registers) {
+        for (int64_t imm : imms) {
+          ImmType new_imm = CreateImmediate(imm);
+          if (f != nullptr) {
+            (assembler_.get()->*f)(reg1, reg2, new_imm * multiplier + bias);
+          }
+          std::string base = fmt;
+
+          ReplaceReg(REG1_TOKEN, (this->*GetName1)(reg1), &base);
+          ReplaceReg(REG2_TOKEN, (this->*GetName2)(reg2), &base);
+          ReplaceImm(imm, bias, multiplier, &base);
+
+          str += base;
+          str += "\n";
+        }
+      }
+    }
+    return str;
+  }
+
+  template <typename ImmType>
+  std::string RepeatIbS(
+      void (Ass::*f)(ImmType), int imm_bits, int shift, const std::string& fmt, int bias = 0) {
+    return RepeatTemplatedImmBitsShift<ImmType>(f, imm_bits, shift, fmt, bias);
+  }
+
+  template <typename ImmType>
+  std::string RepeatRIbS(
+      void (Ass::*f)(Reg, ImmType), int imm_bits, int shift, const std::string& fmt, int bias = 0) {
+    return RepeatTemplatedRegisterImmBitsShift<Reg, ImmType>(
+        f,
+        imm_bits,
+        shift,
+        GetRegisters(),
+        &AssemblerTest::GetRegName<RegisterView::kUsePrimaryName>,
+        fmt,
+        bias);
+  }
+
+  template <typename ImmType>
+  std::string RepeatRRIbS(void (Ass::*f)(Reg, Reg, ImmType),
+                          int imm_bits,
+                          int shift,
+                          const std::string& fmt,
+                          int bias = 0) {
+    return RepeatTemplatedRegistersImmBitsShift<Reg, Reg, ImmType>(
+        f,
+        imm_bits,
+        shift,
+        GetRegisters(),
+        GetRegisters(),
+        &AssemblerTest::GetRegName<RegisterView::kUsePrimaryName>,
+        &AssemblerTest::GetRegName<RegisterView::kUsePrimaryName>,
+        fmt,
+        bias);
+  }
+
   template <typename ImmType>
   std::string RepeatRRIb(void (Ass::*f)(Reg, Reg, ImmType),
                          int imm_bits,
@@ -488,6 +536,19 @@
                                                          fmt);
   }
 
+  std::string RepeatFFFF(void (Ass::*f)(FPReg, FPReg, FPReg, FPReg), const std::string& fmt) {
+    return RepeatTemplatedRegisters<FPReg, FPReg, FPReg, FPReg>(f,
+                                                                GetFPRegisters(),
+                                                                GetFPRegisters(),
+                                                                GetFPRegisters(),
+                                                                GetFPRegisters(),
+                                                                &AssemblerTest::GetFPRegName,
+                                                                &AssemblerTest::GetFPRegName,
+                                                                &AssemblerTest::GetFPRegName,
+                                                                &AssemblerTest::GetFPRegName,
+                                                                fmt);
+  }
+
   std::string RepeatFFR(void (Ass::*f)(FPReg, FPReg, Reg), const std::string& fmt) {
     return RepeatTemplatedRegisters<FPReg, FPReg, Reg>(
         f,
@@ -538,6 +599,32 @@
                                                                   fmt);
   }
 
+  std::string RepeatRFF(void (Ass::*f)(Reg, FPReg, FPReg), const std::string& fmt) {
+    return RepeatTemplatedRegisters<Reg, FPReg, FPReg>(
+        f,
+        GetRegisters(),
+        GetFPRegisters(),
+        GetFPRegisters(),
+        &AssemblerTest::GetRegName<RegisterView::kUsePrimaryName>,
+        &AssemblerTest::GetFPRegName,
+        &AssemblerTest::GetFPRegName,
+        fmt);
+  }
+
+  template <typename ImmType>
+  std::string RepeatRFIb(void (Ass::*f)(Reg, FPReg, ImmType),
+                         int imm_bits,
+                         const std::string& fmt) {
+    return RepeatTemplatedRegistersImmBits<Reg, FPReg, ImmType>(
+        f,
+        imm_bits,
+        GetRegisters(),
+        GetFPRegisters(),
+        &AssemblerTest::GetRegName<RegisterView::kUsePrimaryName>,
+        &AssemblerTest::GetFPRegName,
+        fmt);
+  }
+
   std::string RepeatFR(void (Ass::*f)(FPReg, Reg), const std::string& fmt) {
     return RepeatTemplatedRegisters<FPReg, Reg>(f,
         GetFPRegisters(),
@@ -590,24 +677,19 @@
       }
       std::string base = fmt;
 
-      size_t imm_index = base.find(IMM_TOKEN);
-      if (imm_index != std::string::npos) {
-        std::ostringstream sreg;
-        sreg << imm;
-        std::string imm_string = sreg.str();
-        base.replace(imm_index, ConstexprStrLen(IMM_TOKEN), imm_string);
-      }
+      ReplaceImm(imm, /*bias=*/ 0, /*multiplier=*/ 1, &base);
 
-      if (str.size() > 0) {
-        str += "\n";
-      }
       str += base;
+      str += "\n";
     }
-    // Add a newline at the end.
-    str += "\n";
     return str;
   }
 
+  std::string RepeatV(void (Ass::*f)(VecReg), const std::string& fmt) {
+    return RepeatTemplatedRegister<VecReg>(
+        f, GetVectorRegisters(), &AssemblerTest::GetVecRegName, fmt);
+  }
+
   std::string RepeatVV(void (Ass::*f)(VecReg, VecReg), const std::string& fmt) {
     return RepeatTemplatedRegisters<VecReg, VecReg>(f,
                                                     GetVectorRegisters(),
@@ -628,6 +710,18 @@
                                                             fmt);
   }
 
+  std::string RepeatVVR(void (Ass::*f)(VecReg, VecReg, Reg), const std::string& fmt) {
+    return RepeatTemplatedRegisters<VecReg, VecReg, Reg>(
+        f,
+        GetVectorRegisters(),
+        GetVectorRegisters(),
+        GetRegisters(),
+        &AssemblerTest::GetVecRegName,
+        &AssemblerTest::GetVecRegName,
+        &AssemblerTest::GetRegName<RegisterView::kUsePrimaryName>,
+        fmt);
+  }
+
   std::string RepeatVR(void (Ass::*f)(VecReg, Reg), const std::string& fmt) {
     return RepeatTemplatedRegisters<VecReg, Reg>(
         f,
@@ -638,6 +732,34 @@
         fmt);
   }
 
+  std::string RepeatVF(void (Ass::*f)(VecReg, FPReg), const std::string& fmt) {
+    return RepeatTemplatedRegisters<VecReg, FPReg>(f,
+                                                   GetVectorRegisters(),
+                                                   GetFPRegisters(),
+                                                   &AssemblerTest::GetVecRegName,
+                                                   &AssemblerTest::GetFPRegName,
+                                                   fmt);
+  }
+
+  std::string RepeatFV(void (Ass::*f)(FPReg, VecReg), const std::string& fmt) {
+    return RepeatTemplatedRegisters<FPReg, VecReg>(f,
+                                                   GetFPRegisters(),
+                                                   GetVectorRegisters(),
+                                                   &AssemblerTest::GetFPRegName,
+                                                   &AssemblerTest::GetVecRegName,
+                                                   fmt);
+  }
+
+  std::string RepeatRV(void (Ass::*f)(Reg, VecReg), const std::string& fmt) {
+    return RepeatTemplatedRegisters<Reg, VecReg>(
+        f,
+        GetRegisters(),
+        GetVectorRegisters(),
+        &AssemblerTest::GetRegName<RegisterView::kUsePrimaryName>,
+        &AssemblerTest::GetVecRegName,
+        fmt);
+  }
+
   template <typename ImmType>
   std::string RepeatVIb(void (Ass::*f)(VecReg, ImmType),
                         int imm_bits,
@@ -710,36 +832,36 @@
 
   // Returns a vector of registers used by any of the repeat methods
   // involving an "R" (e.g. RepeatR).
-  virtual std::vector<Reg*> GetRegisters() = 0;
+  virtual ArrayRef<const Reg> GetRegisters() = 0;
 
   // Returns a vector of fp-registers used by any of the repeat methods
   // involving an "F" (e.g. RepeatFF).
-  virtual std::vector<FPReg*> GetFPRegisters() {
+  virtual ArrayRef<const FPReg> GetFPRegisters() {
     UNIMPLEMENTED(FATAL) << "Architecture does not support floating-point registers";
     UNREACHABLE();
   }
 
   // Returns a vector of dedicated simd-registers used by any of the repeat
   // methods involving an "V" (e.g. RepeatVV).
-  virtual std::vector<VecReg*> GetVectorRegisters() {
+  virtual ArrayRef<const VecReg> GetVectorRegisters() {
     UNIMPLEMENTED(FATAL) << "Architecture does not support vector registers";
     UNREACHABLE();
   }
 
   // Secondary register names are the secondary view on registers, e.g., 32b on 64b systems.
-  virtual std::string GetSecondaryRegisterName(const Reg& reg ATTRIBUTE_UNUSED) {
+  virtual std::string GetSecondaryRegisterName([[maybe_unused]] const Reg& reg) {
     UNIMPLEMENTED(FATAL) << "Architecture does not support secondary registers";
     UNREACHABLE();
   }
 
   // Tertiary register names are the tertiary view on registers, e.g., 16b on 64b systems.
-  virtual std::string GetTertiaryRegisterName(const Reg& reg ATTRIBUTE_UNUSED) {
+  virtual std::string GetTertiaryRegisterName([[maybe_unused]] const Reg& reg) {
     UNIMPLEMENTED(FATAL) << "Architecture does not support tertiary registers";
     UNREACHABLE();
   }
 
   // Quaternary register names are the quaternary view on registers, e.g., 8b on 64b systems.
-  virtual std::string GetQuaternaryRegisterName(const Reg& reg ATTRIBUTE_UNUSED) {
+  virtual std::string GetQuaternaryRegisterName([[maybe_unused]] const Reg& reg) {
     UNIMPLEMENTED(FATAL) << "Architecture does not support quaternary registers";
     UNREACHABLE();
   }
@@ -818,7 +940,9 @@
   const int kMaxBitsExhaustiveTest = 8;
 
   // Create a couple of immediate values up to the number of bits given.
-  virtual std::vector<int64_t> CreateImmediateValuesBits(const int imm_bits, bool as_uint = false) {
+  virtual std::vector<int64_t> CreateImmediateValuesBits(const int imm_bits,
+                                                         bool as_uint = false,
+                                                         int shift = 0) {
     CHECK_GT(imm_bits, 0);
     CHECK_LE(imm_bits, 64);
     std::vector<int64_t> res;
@@ -826,11 +950,11 @@
     if (imm_bits <= kMaxBitsExhaustiveTest) {
       if (as_uint) {
         for (uint64_t i = MinInt<uint64_t>(imm_bits); i <= MaxInt<uint64_t>(imm_bits); i++) {
-          res.push_back(static_cast<int64_t>(i));
+          res.push_back(static_cast<int64_t>(i << shift));
         }
       } else {
         for (int64_t i = MinInt<int64_t>(imm_bits); i <= MaxInt<int64_t>(imm_bits); i++) {
-          res.push_back(i);
+          res.push_back(i << shift);
         }
       }
     } else {
@@ -838,14 +962,14 @@
         for (uint64_t i = MinInt<uint64_t>(kMaxBitsExhaustiveTest);
              i <= MaxInt<uint64_t>(kMaxBitsExhaustiveTest);
              i++) {
-          res.push_back(static_cast<int64_t>(i));
+          res.push_back(static_cast<int64_t>(i << shift));
         }
         for (int i = 0; i <= imm_bits; i++) {
           uint64_t j = (MaxInt<uint64_t>(kMaxBitsExhaustiveTest) + 1) +
                        ((MaxInt<uint64_t>(imm_bits) -
                         (MaxInt<uint64_t>(kMaxBitsExhaustiveTest) + 1))
                         * i / imm_bits);
-          res.push_back(static_cast<int64_t>(j));
+          res.push_back(static_cast<int64_t>(j << shift));
         }
       } else {
         for (int i = 0; i <= imm_bits; i++) {
@@ -853,18 +977,18 @@
                       ((((MinInt<int64_t>(kMaxBitsExhaustiveTest) - 1) -
                          MinInt<int64_t>(imm_bits))
                         * i) / imm_bits);
-          res.push_back(static_cast<int64_t>(j));
+          res.push_back(static_cast<int64_t>(j << shift));
         }
         for (int64_t i = MinInt<int64_t>(kMaxBitsExhaustiveTest);
              i <= MaxInt<int64_t>(kMaxBitsExhaustiveTest);
              i++) {
-          res.push_back(static_cast<int64_t>(i));
+          res.push_back(static_cast<int64_t>(i << shift));
         }
         for (int i = 0; i <= imm_bits; i++) {
           int64_t j = (MaxInt<int64_t>(kMaxBitsExhaustiveTest) + 1) +
                       ((MaxInt<int64_t>(imm_bits) - (MaxInt<int64_t>(kMaxBitsExhaustiveTest) + 1))
                        * i / imm_bits);
-          res.push_back(static_cast<int64_t>(j));
+          res.push_back(static_cast<int64_t>(j << shift));
         }
       }
     }
@@ -1111,19 +1235,11 @@
       }
       std::string base = fmt;
 
-      std::string addr_string = (this->*GetAName)(addr);
-      size_t addr_index;
-      if ((addr_index = base.find(ADDRESS_TOKEN)) != std::string::npos) {
-        base.replace(addr_index, ConstexprStrLen(ADDRESS_TOKEN), addr_string);
-      }
+      ReplaceAddr((this->*GetAName)(addr), &base);
 
-      if (str.size() > 0) {
-        str += "\n";
-      }
       str += base;
+      str += "\n";
     }
-    // Add a newline at the end.
-    str += "\n";
     return str;
   }
 
@@ -1144,34 +1260,19 @@
         }
         std::string base = fmt;
 
-        std::string addr_string = (this->*GetAName)(addr);
-        size_t addr_index;
-        if ((addr_index = base.find(ADDRESS_TOKEN)) != std::string::npos) {
-          base.replace(addr_index, ConstexprStrLen(ADDRESS_TOKEN), addr_string);
-        }
+        ReplaceAddr((this->*GetAName)(addr), &base);
+        ReplaceImm(imm, /*bias=*/ 0, /*multiplier=*/ 1, &base);
 
-        size_t imm_index = base.find(IMM_TOKEN);
-        if (imm_index != std::string::npos) {
-          std::ostringstream sreg;
-          sreg << imm;
-          std::string imm_string = sreg.str();
-          base.replace(imm_index, ConstexprStrLen(IMM_TOKEN), imm_string);
-        }
-
-        if (str.size() > 0) {
-          str += "\n";
-        }
         str += base;
+        str += "\n";
       }
     }
-    // Add a newline at the end.
-    str += "\n";
     return str;
   }
 
   template <typename RegType, typename AddrType>
   std::string RepeatTemplatedRegMem(void (Ass::*f)(RegType, const AddrType&),
-                                    const std::vector<RegType*> registers,
+                                    ArrayRef<const RegType> registers,
                                     const std::vector<AddrType> addresses,
                                     std::string (AssemblerTest::*GetRName)(const RegType&),
                                     std::string (AssemblerTest::*GetAName)(const AddrType&),
@@ -1181,37 +1282,24 @@
     for (auto reg : registers) {
       for (auto addr : addresses) {
         if (f != nullptr) {
-          (assembler_.get()->*f)(*reg, addr);
+          (assembler_.get()->*f)(reg, addr);
         }
         std::string base = fmt;
 
-        std::string reg_string = (this->*GetRName)(*reg);
-        size_t reg_index;
-        if ((reg_index = base.find(REG_TOKEN)) != std::string::npos) {
-          base.replace(reg_index, ConstexprStrLen(REG_TOKEN), reg_string);
-        }
+        ReplaceReg(REG_TOKEN, (this->*GetRName)(reg), &base);
+        ReplaceAddr((this->*GetAName)(addr), &base);
 
-        std::string addr_string = (this->*GetAName)(addr);
-        size_t addr_index;
-        if ((addr_index = base.find(ADDRESS_TOKEN)) != std::string::npos) {
-          base.replace(addr_index, ConstexprStrLen(ADDRESS_TOKEN), addr_string);
-        }
-
-        if (str.size() > 0) {
-          str += "\n";
-        }
         str += base;
+        str += "\n";
       }
     }
-    // Add a newline at the end.
-    str += "\n";
     return str;
   }
 
   template <typename AddrType, typename RegType>
   std::string RepeatTemplatedMemReg(void (Ass::*f)(const AddrType&, RegType),
                                     const std::vector<AddrType> addresses,
-                                    const std::vector<RegType*> registers,
+                                    ArrayRef<const RegType> registers,
                                     std::string (AssemblerTest::*GetAName)(const AddrType&),
                                     std::string (AssemblerTest::*GetRName)(const RegType&),
                                     const std::string& fmt) {
@@ -1220,30 +1308,17 @@
     for (auto addr : addresses) {
       for (auto reg : registers) {
         if (f != nullptr) {
-          (assembler_.get()->*f)(addr, *reg);
+          (assembler_.get()->*f)(addr, reg);
         }
         std::string base = fmt;
 
-        std::string addr_string = (this->*GetAName)(addr);
-        size_t addr_index;
-        if ((addr_index = base.find(ADDRESS_TOKEN)) != std::string::npos) {
-          base.replace(addr_index, ConstexprStrLen(ADDRESS_TOKEN), addr_string);
-        }
+        ReplaceAddr((this->*GetAName)(addr), &base);
+        ReplaceReg(REG_TOKEN, (this->*GetRName)(reg), &base);
 
-        std::string reg_string = (this->*GetRName)(*reg);
-        size_t reg_index;
-        if ((reg_index = base.find(REG_TOKEN)) != std::string::npos) {
-          base.replace(reg_index, ConstexprStrLen(REG_TOKEN), reg_string);
-        }
-
-        if (str.size() > 0) {
-          str += "\n";
-        }
         str += base;
+        str += "\n";
       }
     }
-    // Add a newline at the end.
-    str += "\n";
     return str;
   }
 
@@ -1253,36 +1328,28 @@
 
   template <typename RegType>
   std::string RepeatTemplatedRegister(void (Ass::*f)(RegType),
-                                      const std::vector<RegType*> registers,
+                                      ArrayRef<const RegType> registers,
                                       std::string (AssemblerTest::*GetName)(const RegType&),
                                       const std::string& fmt) {
     std::string str;
     for (auto reg : registers) {
       if (f != nullptr) {
-        (assembler_.get()->*f)(*reg);
+        (assembler_.get()->*f)(reg);
       }
       std::string base = fmt;
 
-      std::string reg_string = (this->*GetName)(*reg);
-      size_t reg_index;
-      if ((reg_index = base.find(REG_TOKEN)) != std::string::npos) {
-        base.replace(reg_index, ConstexprStrLen(REG_TOKEN), reg_string);
-      }
+      ReplaceReg(REG_TOKEN, (this->*GetName)(reg), &base);
 
-      if (str.size() > 0) {
-        str += "\n";
-      }
       str += base;
+      str += "\n";
     }
-    // Add a newline at the end.
-    str += "\n";
     return str;
   }
 
   template <typename Reg1, typename Reg2>
   std::string RepeatTemplatedRegisters(void (Ass::*f)(Reg1, Reg2),
-                                       const std::vector<Reg1*> reg1_registers,
-                                       const std::vector<Reg2*> reg2_registers,
+                                       ArrayRef<const Reg1> reg1_registers,
+                                       ArrayRef<const Reg2> reg2_registers,
                                        std::string (AssemblerTest::*GetName1)(const Reg1&),
                                        std::string (AssemblerTest::*GetName2)(const Reg2&),
                                        const std::string& fmt,
@@ -1294,44 +1361,31 @@
       for (auto reg2 : reg2_registers) {
         // Check if this register pair is on the exception list. If so, skip it.
         if (except != nullptr) {
-          const auto& pair = std::make_pair(*reg1, *reg2);
+          const auto& pair = std::make_pair(reg1, reg2);
           if (std::find(except->begin(), except->end(), pair) != except->end()) {
             continue;
           }
         }
 
         if (f != nullptr) {
-          (assembler_.get()->*f)(*reg1, *reg2);
+          (assembler_.get()->*f)(reg1, reg2);
         }
         std::string base = fmt;
 
-        std::string reg1_string = (this->*GetName1)(*reg1);
-        size_t reg1_index;
-        while ((reg1_index = base.find(REG1_TOKEN)) != std::string::npos) {
-          base.replace(reg1_index, ConstexprStrLen(REG1_TOKEN), reg1_string);
-        }
+        ReplaceReg(REG1_TOKEN, (this->*GetName1)(reg1), &base);
+        ReplaceReg(REG2_TOKEN, (this->*GetName2)(reg2), &base);
 
-        std::string reg2_string = (this->*GetName2)(*reg2);
-        size_t reg2_index;
-        while ((reg2_index = base.find(REG2_TOKEN)) != std::string::npos) {
-          base.replace(reg2_index, ConstexprStrLen(REG2_TOKEN), reg2_string);
-        }
-
-        if (str.size() > 0) {
-          str += "\n";
-        }
         str += base;
+        str += "\n";
       }
     }
-    // Add a newline at the end.
-    str += "\n";
     return str;
   }
 
   template <typename Reg1, typename Reg2>
   std::string RepeatTemplatedRegistersNoDupes(void (Ass::*f)(Reg1, Reg2),
-                                              const std::vector<Reg1*> reg1_registers,
-                                              const std::vector<Reg2*> reg2_registers,
+                                              ArrayRef<const Reg1> reg1_registers,
+                                              ArrayRef<const Reg2> reg2_registers,
                                               std::string (AssemblerTest::*GetName1)(const Reg1&),
                                               std::string (AssemblerTest::*GetName2)(const Reg2&),
                                               const std::string& fmt) {
@@ -1342,38 +1396,25 @@
       for (auto reg2 : reg2_registers) {
         if (reg1 == reg2) continue;
         if (f != nullptr) {
-          (assembler_.get()->*f)(*reg1, *reg2);
+          (assembler_.get()->*f)(reg1, reg2);
         }
         std::string base = fmt;
 
-        std::string reg1_string = (this->*GetName1)(*reg1);
-        size_t reg1_index;
-        while ((reg1_index = base.find(REG1_TOKEN)) != std::string::npos) {
-          base.replace(reg1_index, ConstexprStrLen(REG1_TOKEN), reg1_string);
-        }
+        ReplaceReg(REG1_TOKEN, (this->*GetName1)(reg1), &base);
+        ReplaceReg(REG2_TOKEN, (this->*GetName2)(reg2), &base);
 
-        std::string reg2_string = (this->*GetName2)(*reg2);
-        size_t reg2_index;
-        while ((reg2_index = base.find(REG2_TOKEN)) != std::string::npos) {
-          base.replace(reg2_index, ConstexprStrLen(REG2_TOKEN), reg2_string);
-        }
-
-        if (str.size() > 0) {
-          str += "\n";
-        }
         str += base;
+        str += "\n";
       }
     }
-    // Add a newline at the end.
-    str += "\n";
     return str;
   }
 
   template <typename Reg1, typename Reg2, typename Reg3>
   std::string RepeatTemplatedRegisters(void (Ass::*f)(Reg1, Reg2, Reg3),
-                                       const std::vector<Reg1*> reg1_registers,
-                                       const std::vector<Reg2*> reg2_registers,
-                                       const std::vector<Reg3*> reg3_registers,
+                                       ArrayRef<const Reg1> reg1_registers,
+                                       ArrayRef<const Reg2> reg2_registers,
+                                       ArrayRef<const Reg3> reg3_registers,
                                        std::string (AssemblerTest::*GetName1)(const Reg1&),
                                        std::string (AssemblerTest::*GetName2)(const Reg2&),
                                        std::string (AssemblerTest::*GetName3)(const Reg3&),
@@ -1383,44 +1424,61 @@
       for (auto reg2 : reg2_registers) {
         for (auto reg3 : reg3_registers) {
           if (f != nullptr) {
-            (assembler_.get()->*f)(*reg1, *reg2, *reg3);
+            (assembler_.get()->*f)(reg1, reg2, reg3);
           }
           std::string base = fmt;
 
-          std::string reg1_string = (this->*GetName1)(*reg1);
-          size_t reg1_index;
-          while ((reg1_index = base.find(REG1_TOKEN)) != std::string::npos) {
-            base.replace(reg1_index, ConstexprStrLen(REG1_TOKEN), reg1_string);
-          }
+          ReplaceReg(REG1_TOKEN, (this->*GetName1)(reg1), &base);
+          ReplaceReg(REG2_TOKEN, (this->*GetName2)(reg2), &base);
+          ReplaceReg(REG3_TOKEN, (this->*GetName3)(reg3), &base);
 
-          std::string reg2_string = (this->*GetName2)(*reg2);
-          size_t reg2_index;
-          while ((reg2_index = base.find(REG2_TOKEN)) != std::string::npos) {
-            base.replace(reg2_index, ConstexprStrLen(REG2_TOKEN), reg2_string);
-          }
-
-          std::string reg3_string = (this->*GetName3)(*reg3);
-          size_t reg3_index;
-          while ((reg3_index = base.find(REG3_TOKEN)) != std::string::npos) {
-            base.replace(reg3_index, ConstexprStrLen(REG3_TOKEN), reg3_string);
-          }
-
-          if (str.size() > 0) {
-            str += "\n";
-          }
           str += base;
+          str += "\n";
         }
       }
     }
-    // Add a newline at the end.
-    str += "\n";
+    return str;
+  }
+
+  template <typename Reg1, typename Reg2, typename Reg3, typename Reg4>
+  std::string RepeatTemplatedRegisters(void (Ass::*f)(Reg1, Reg2, Reg3, Reg4),
+                                       ArrayRef<const Reg1> reg1_registers,
+                                       ArrayRef<const Reg2> reg2_registers,
+                                       ArrayRef<const Reg3> reg3_registers,
+                                       ArrayRef<const Reg4> reg4_registers,
+                                       std::string (AssemblerTest::*GetName1)(const Reg1&),
+                                       std::string (AssemblerTest::*GetName2)(const Reg2&),
+                                       std::string (AssemblerTest::*GetName3)(const Reg3&),
+                                       std::string (AssemblerTest::*GetName4)(const Reg4&),
+                                       const std::string& fmt) {
+    std::string str;
+    for (auto reg1 : reg1_registers) {
+      for (auto reg2 : reg2_registers) {
+        for (auto reg3 : reg3_registers) {
+          for (auto reg4 : reg4_registers) {
+            if (f != nullptr) {
+              (assembler_.get()->*f)(reg1, reg2, reg3, reg4);
+            }
+            std::string base = fmt;
+
+            ReplaceReg(REG1_TOKEN, (this->*GetName1)(reg1), &base);
+            ReplaceReg(REG2_TOKEN, (this->*GetName2)(reg2), &base);
+            ReplaceReg(REG3_TOKEN, (this->*GetName3)(reg3), &base);
+            ReplaceReg(REG4_TOKEN, (this->*GetName4)(reg4), &base);
+
+            str += base;
+            str += "\n";
+          }
+        }
+      }
+    }
     return str;
   }
 
   template <typename Reg1, typename Reg2>
   std::string RepeatTemplatedRegistersImm(void (Ass::*f)(Reg1, Reg2, const Imm&),
-                                          const std::vector<Reg1*> reg1_registers,
-                                          const std::vector<Reg2*> reg2_registers,
+                                          ArrayRef<const Reg1> reg1_registers,
+                                          ArrayRef<const Reg2> reg2_registers,
                                           std::string (AssemblerTest::*GetName1)(const Reg1&),
                                           std::string (AssemblerTest::*GetName2)(const Reg2&),
                                           size_t imm_bytes,
@@ -1434,39 +1492,19 @@
         for (int64_t imm : imms) {
           Imm new_imm = CreateImmediate(imm);
           if (f != nullptr) {
-            (assembler_.get()->*f)(*reg1, *reg2, new_imm);
+            (assembler_.get()->*f)(reg1, reg2, new_imm);
           }
           std::string base = fmt;
 
-          std::string reg1_string = (this->*GetName1)(*reg1);
-          size_t reg1_index;
-          while ((reg1_index = base.find(REG1_TOKEN)) != std::string::npos) {
-            base.replace(reg1_index, ConstexprStrLen(REG1_TOKEN), reg1_string);
-          }
+          ReplaceReg(REG1_TOKEN, (this->*GetName1)(reg1), &base);
+          ReplaceReg(REG2_TOKEN, (this->*GetName2)(reg2), &base);
+          ReplaceImm(imm, /*bias=*/ 0, /*multiplier=*/ 1, &base);
 
-          std::string reg2_string = (this->*GetName2)(*reg2);
-          size_t reg2_index;
-          while ((reg2_index = base.find(REG2_TOKEN)) != std::string::npos) {
-            base.replace(reg2_index, ConstexprStrLen(REG2_TOKEN), reg2_string);
-          }
-
-          size_t imm_index = base.find(IMM_TOKEN);
-          if (imm_index != std::string::npos) {
-            std::ostringstream sreg;
-            sreg << imm;
-            std::string imm_string = sreg.str();
-            base.replace(imm_index, ConstexprStrLen(IMM_TOKEN), imm_string);
-          }
-
-          if (str.size() > 0) {
-            str += "\n";
-          }
           str += base;
+          str += "\n";
         }
       }
     }
-    // Add a newline at the end.
-    str += "\n";
     return str;
   }
 
@@ -1517,11 +1555,41 @@
     }
   }
 
+  static void ReplaceReg(const std::string& reg_token,
+                         const std::string& replacement,
+                         /*inout*/ std::string* str) {
+    size_t reg_index;
+    while ((reg_index = str->find(reg_token)) != std::string::npos) {
+      str->replace(reg_index, reg_token.length(), replacement);
+    }
+  }
+
+  static void ReplaceImm(int64_t imm,
+                         int64_t bias,
+                         int64_t multiplier,
+                         /*inout*/ std::string* str) {
+    size_t imm_index = str->find(IMM_TOKEN);
+    if (imm_index != std::string::npos) {
+      std::ostringstream sreg;
+      sreg << imm * multiplier + bias;
+      std::string imm_string = sreg.str();
+      str->replace(imm_index, ConstexprStrLen(IMM_TOKEN), imm_string);
+    }
+  }
+
+  static void ReplaceAddr(const std::string& replacement, /*inout*/ std::string* str) {
+    size_t addr_index;
+    if ((addr_index = str->find(ADDRESS_TOKEN)) != std::string::npos) {
+      str->replace(addr_index, ConstexprStrLen(ADDRESS_TOKEN), replacement);
+    }
+  }
+
   static constexpr const char* ADDRESS_TOKEN = "{mem}";
   static constexpr const char* REG_TOKEN = "{reg}";
   static constexpr const char* REG1_TOKEN = "{reg1}";
   static constexpr const char* REG2_TOKEN = "{reg2}";
   static constexpr const char* REG3_TOKEN = "{reg3}";
+  static constexpr const char* REG4_TOKEN = "{reg4}";
   static constexpr const char* IMM_TOKEN = "{imm}";
 
  private:
@@ -1529,7 +1597,7 @@
   std::string RepeatRegisterImm(void (Ass::*f)(Reg, const Imm&),
                                 size_t imm_bytes,
                                 const std::string& fmt) {
-    const std::vector<Reg*> registers = GetRegisters();
+    ArrayRef<const Reg> registers = GetRegisters();
     std::string str;
     std::vector<int64_t> imms = CreateImmediateValues(imm_bytes);
 
@@ -1539,45 +1607,29 @@
       for (int64_t imm : imms) {
         Imm new_imm = CreateImmediate(imm);
         if (f != nullptr) {
-          (assembler_.get()->*f)(*reg, new_imm);
+          (assembler_.get()->*f)(reg, new_imm);
         }
         std::string base = fmt;
 
-        std::string reg_string = GetRegName<kRegView>(*reg);
-        size_t reg_index;
-        while ((reg_index = base.find(REG_TOKEN)) != std::string::npos) {
-          base.replace(reg_index, ConstexprStrLen(REG_TOKEN), reg_string);
-        }
+        ReplaceReg(REG_TOKEN, GetRegName<kRegView>(reg), &base);
+        ReplaceImm(imm, /*bias=*/ 0, /*multiplier=*/ 1, &base);
 
-        size_t imm_index = base.find(IMM_TOKEN);
-        if (imm_index != std::string::npos) {
-          std::ostringstream sreg;
-          sreg << imm;
-          std::string imm_string = sreg.str();
-          base.replace(imm_index, ConstexprStrLen(IMM_TOKEN), imm_string);
-        }
-
-        if (str.size() > 0) {
-          str += "\n";
-        }
         str += base;
+        str += "\n";
       }
     }
-    // Add a newline at the end.
-    str += "\n";
     return str;
   }
 
   // Override this to pad the code with NOPs to a certain size if needed.
-  virtual void Pad(std::vector<uint8_t>& data ATTRIBUTE_UNUSED) {
-  }
+  virtual void Pad([[maybe_unused]] std::vector<uint8_t>& data) {}
 
   void DriverWrapper(const std::string& assembly_text, const std::string& test_name) {
     assembler_->FinalizeCode();
     size_t cs = assembler_->CodeSize();
     std::unique_ptr<std::vector<uint8_t>> data(new std::vector<uint8_t>(cs));
     MemoryRegion code(&(*data)[0], data->size());
-    assembler_->FinalizeInstructions(code);
+    assembler_->CopyInstructions(code);
     Pad(*data);
     Driver(*data, assembly_text, test_name);
   }
diff --git a/compiler/utils/assembler_test_base.h b/compiler/utils/assembler_test_base.h
index 73f3657..c534513 100644
--- a/compiler/utils/assembler_test_base.h
+++ b/compiler/utils/assembler_test_base.h
@@ -141,6 +141,16 @@
   virtual std::vector<std::string> GetAssemblerCommand() {
     InstructionSet isa = GetIsa();
     switch (isa) {
+      case InstructionSet::kRiscv64:
+        // TODO(riscv64): Support compression (RV32C) in assembler and tests (add `c` to `-march=`).
+        return {FindTool("clang"),
+                "--compile",
+                "-target",
+                "riscv64-linux-gnu",
+                "-march=rv64imafdcv_zba_zbb_zca_zcd_zcb",
+                // Force the assembler to fully emit branch instructions instead of leaving
+                // offsets unresolved with relocation information for the linker.
+                "-mno-relax"};
       case InstructionSet::kX86:
         return {FindTool("clang"), "--compile", "-target", "i386-linux-gnu"};
       case InstructionSet::kX86_64:
@@ -159,6 +169,15 @@
                 "--no-print-imm-hex",
                 "--triple",
                 "thumbv7a-linux-gnueabi"};
+      case InstructionSet::kRiscv64:
+        return {FindTool("llvm-objdump"),
+                "--disassemble",
+                "--no-print-imm-hex",
+                "--no-show-raw-insn",
+                // Disassemble Standard Extensions supported by the assembler.
+                "--mattr=+F,+D,+A,+C,+V,+Zba,+Zbb,+Zca,+Zcd,+Zcb",
+                "-M",
+                "no-aliases"};
       default:
         return {
             FindTool("llvm-objdump"), "--disassemble", "--no-print-imm-hex", "--no-show-raw-insn"};
diff --git a/compiler/utils/assembler_thumb_test.cc b/compiler/utils/assembler_thumb_test.cc
index 672cd3d..53cb3d6 100644
--- a/compiler/utils/assembler_thumb_test.cc
+++ b/compiler/utils/assembler_thumb_test.cc
@@ -79,7 +79,7 @@
     size_t cs = __ CodeSize();
     std::vector<uint8_t> managed_code(cs);
     MemoryRegion code(&managed_code[0], managed_code.size());
-    __ FinalizeInstructions(code);
+    __ CopyInstructions(code);
 
     DumpAndCheck(managed_code, testname, expected);
   }
diff --git a/compiler/utils/assembler_thumb_test_expected.cc.inc b/compiler/utils/assembler_thumb_test_expected.cc.inc
index aea7f14..6e0048e 100644
--- a/compiler/utils/assembler_thumb_test_expected.cc.inc
+++ b/compiler/utils/assembler_thumb_test_expected.cc.inc
@@ -76,7 +76,7 @@
   "      e4: f1bb 0f00     cmp.w r11, #0\n"
   "      e8: bf18          it ne\n"
   "      ea: 46e3          movne r11, r12\n"
-  "      ec: f8d9 c09c     ldr.w r12, [r9, #156]\n"
+  "      ec: f8d9 c094     ldr.w r12, [r9, #148]\n"
   "      f0: f1bc 0f00     cmp.w r12, #0\n"
   "      f4: d16f          bne 0x1d6     @ imm = #222\n"
   "      f6: f8cd c7ff     str.w r12, [sp, #2047]\n"
@@ -151,10 +151,10 @@
   "     206: b001          add sp, #4\n"
   "     208: ecbd 8a10     vpop {s16, s17, s18, s19, s20, s21, s22, s23, s24, s25, s26, s27, s28, s29, s30, s31}\n"
   "     20c: e8bd 4de0     pop.w {r5, r6, r7, r8, r10, r11, lr}\n"
-  "     210: f8d9 8024     ldr.w r8, [r9, #36]\n"
+  "     210: f8d9 8020     ldr.w r8, [r9, #32]\n"
   "     214: 4770          bx lr\n"
-  "     216: f8d9 009c     ldr.w r0, [r9, #156]\n"
-  "     21a: f8d9 e2d0     ldr.w lr, [r9, #720]\n"
+  "     216: f8d9 0094     ldr.w r0, [r9, #148]\n"
+  "     21a: f8d9 e2c4     ldr.w lr, [r9, #708]\n"
   "     21e: 47f0          blx lr\n"
 };
 
diff --git a/compiler/utils/jni_macro_assembler.cc b/compiler/utils/jni_macro_assembler.cc
index 8b47b38..1806180 100644
--- a/compiler/utils/jni_macro_assembler.cc
+++ b/compiler/utils/jni_macro_assembler.cc
@@ -25,6 +25,9 @@
 #ifdef ART_ENABLE_CODEGEN_arm64
 #include "arm64/jni_macro_assembler_arm64.h"
 #endif
+#ifdef ART_ENABLE_CODEGEN_riscv64
+#include "riscv64/jni_macro_assembler_riscv64.h"
+#endif
 #ifdef ART_ENABLE_CODEGEN_x86
 #include "x86/jni_macro_assembler_x86.h"
 #endif
@@ -34,6 +37,10 @@
 #include "base/casts.h"
 #include "base/globals.h"
 #include "base/memory_region.h"
+#include "gc_root.h"
+#include "jni/jni_env_ext.h"
+#include "jni/local_reference_table.h"
+#include "stack_reference.h"
 
 namespace art HIDDEN {
 
@@ -79,6 +86,10 @@
     case InstructionSet::kArm64:
       return MacroAsm64UniquePtr(new (allocator) arm64::Arm64JNIMacroAssembler(allocator));
 #endif
+#ifdef ART_ENABLE_CODEGEN_riscv64
+    case InstructionSet::kRiscv64:
+      return MacroAsm64UniquePtr(new (allocator) riscv64::Riscv64JNIMacroAssembler(allocator));
+#endif
 #ifdef ART_ENABLE_CODEGEN_x86_64
     case InstructionSet::kX86_64:
       return MacroAsm64UniquePtr(new (allocator) x86_64::X86_64JNIMacroAssembler(allocator));
@@ -90,4 +101,82 @@
   }
 }
 
+template <PointerSize kPointerSize>
+void JNIMacroAssembler<kPointerSize>::LoadGcRootWithoutReadBarrier(ManagedRegister dest,
+                                                                   ManagedRegister base,
+                                                                   MemberOffset offs) {
+  static_assert(sizeof(uint32_t) == sizeof(GcRoot<mirror::Object>));
+  Load(dest, base, offs, sizeof(uint32_t));
+}
+
+template
+void JNIMacroAssembler<PointerSize::k32>::LoadGcRootWithoutReadBarrier(ManagedRegister dest,
+                                                                       ManagedRegister base,
+                                                                       MemberOffset offs);
+template
+void JNIMacroAssembler<PointerSize::k64>::LoadGcRootWithoutReadBarrier(ManagedRegister dest,
+                                                                       ManagedRegister base,
+                                                                       MemberOffset offs);
+
+template <PointerSize kPointerSize>
+void JNIMacroAssembler<kPointerSize>::LoadStackReference(ManagedRegister dest, FrameOffset offs) {
+  static_assert(sizeof(uint32_t) == sizeof(StackReference<mirror::Object>));
+  Load(dest, offs, sizeof(uint32_t));
+}
+
+template
+void JNIMacroAssembler<PointerSize::k32>::LoadStackReference(ManagedRegister dest,
+                                                             FrameOffset offs);
+template
+void JNIMacroAssembler<PointerSize::k64>::LoadStackReference(ManagedRegister dest,
+                                                             FrameOffset offs);
+
+template <PointerSize kPointerSize>
+void JNIMacroAssembler<kPointerSize>::LoadLocalReferenceTableStates(
+    ManagedRegister jni_env_reg,
+    ManagedRegister previous_state_reg,
+    ManagedRegister current_state_reg) {
+  constexpr size_t kLRTSegmentStateSize = sizeof(jni::LRTSegmentState);
+  const MemberOffset previous_state_offset = JNIEnvExt::LrtPreviousStateOffset(kPointerSize);
+  const MemberOffset current_state_offset = JNIEnvExt::LrtSegmentStateOffset(kPointerSize);
+
+  Load(previous_state_reg, jni_env_reg, previous_state_offset, kLRTSegmentStateSize);
+  Load(current_state_reg, jni_env_reg, current_state_offset, kLRTSegmentStateSize);
+}
+
+template
+void JNIMacroAssembler<PointerSize::k32>::LoadLocalReferenceTableStates(
+    ManagedRegister jni_env_reg,
+    ManagedRegister previous_state_reg,
+    ManagedRegister current_state_reg);
+template
+void JNIMacroAssembler<PointerSize::k64>::LoadLocalReferenceTableStates(
+    ManagedRegister jni_env_reg,
+    ManagedRegister previous_state_reg,
+    ManagedRegister current_state_reg);
+
+template <PointerSize kPointerSize>
+void JNIMacroAssembler<kPointerSize>::StoreLocalReferenceTableStates(
+    ManagedRegister jni_env_reg,
+    ManagedRegister previous_state_reg,
+    ManagedRegister current_state_reg) {
+  constexpr size_t kLRTSegmentStateSize = sizeof(jni::LRTSegmentState);
+  const MemberOffset previous_state_offset = JNIEnvExt::LrtPreviousStateOffset(kPointerSize);
+  const MemberOffset segment_state_offset = JNIEnvExt::LrtSegmentStateOffset(kPointerSize);
+
+  Store(jni_env_reg, previous_state_offset, previous_state_reg, kLRTSegmentStateSize);
+  Store(jni_env_reg, segment_state_offset, current_state_reg, kLRTSegmentStateSize);
+}
+
+template
+void JNIMacroAssembler<PointerSize::k32>::StoreLocalReferenceTableStates(
+    ManagedRegister jni_env_reg,
+    ManagedRegister previous_state_reg,
+    ManagedRegister current_state_reg);
+template
+void JNIMacroAssembler<PointerSize::k64>::StoreLocalReferenceTableStates(
+    ManagedRegister jni_env_reg,
+    ManagedRegister previous_state_reg,
+    ManagedRegister current_state_reg);
+
 }  // namespace art
diff --git a/compiler/utils/jni_macro_assembler.h b/compiler/utils/jni_macro_assembler.h
index 0c72970..0ffa50a 100644
--- a/compiler/utils/jni_macro_assembler.h
+++ b/compiler/utils/jni_macro_assembler.h
@@ -92,7 +92,7 @@
   virtual size_t CodeSize() const = 0;
 
   // Copy instructions out of assembly buffer into the given region of memory
-  virtual void FinalizeInstructions(const MemoryRegion& region) = 0;
+  virtual void CopyInstructions(const MemoryRegion& region) = 0;
 
   // Emit code that will create an activation on the stack
   virtual void BuildFrame(size_t frame_size,
@@ -129,9 +129,18 @@
   // Load routines
   virtual void Load(ManagedRegister dest, FrameOffset src, size_t size) = 0;
   virtual void Load(ManagedRegister dest, ManagedRegister base, MemberOffset offs, size_t size) = 0;
-
   virtual void LoadRawPtrFromThread(ManagedRegister dest, ThreadOffset<kPointerSize> offs) = 0;
 
+  // Load reference from a `GcRoot<>`. The default is to load as `jint`. Some architectures
+  // (say, RISC-V) override this to provide a different sign- or zero-extension.
+  virtual void LoadGcRootWithoutReadBarrier(ManagedRegister dest,
+                                            ManagedRegister base,
+                                            MemberOffset offs);
+
+  // Load reference from a `StackReference<>`. The default is to load as `jint`. Some architectures
+  // (say, RISC-V) override this to provide a different sign- or zero-extension.
+  virtual void LoadStackReference(ManagedRegister dest, FrameOffset offs);
+
   // Copying routines
 
   // Move arguments from `srcs` locations to `dests` locations.
@@ -158,6 +167,17 @@
   virtual void GetCurrentThread(ManagedRegister dest) = 0;
   virtual void GetCurrentThread(FrameOffset dest_offset) = 0;
 
+  // Manipulating local reference table states.
+  //
+  // These have a default implementation but they can be overridden to use register pair
+  // load/store instructions on architectures that support them (arm, arm64).
+  virtual void LoadLocalReferenceTableStates(ManagedRegister jni_env_reg,
+                                             ManagedRegister previous_state_reg,
+                                             ManagedRegister current_state_reg);
+  virtual void StoreLocalReferenceTableStates(ManagedRegister jni_env_reg,
+                                              ManagedRegister previous_state_reg,
+                                              ManagedRegister current_state_reg);
+
   // Decode JNI transition or local `jobject`. For (weak) global `jobject`, jump to slow path.
   virtual void DecodeJNITransitionOrLocalJObject(ManagedRegister reg,
                                                  JNIMacroLabel* slow_path,
@@ -241,7 +261,7 @@
 //
 // It is only safe to use a label created
 // via JNIMacroAssembler::CreateLabel with that same macro assembler.
-class JNIMacroLabel {
+class JNIMacroLabel : public DeletableArenaObject<kArenaAllocAssembler> {
  public:
   virtual ~JNIMacroLabel() = 0;
 
@@ -266,8 +286,8 @@
     return asm_.CodeSize();
   }
 
-  void FinalizeInstructions(const MemoryRegion& region) override {
-    asm_.FinalizeInstructions(region);
+  void CopyInstructions(const MemoryRegion& region) override {
+    asm_.CopyInstructions(region);
   }
 
   DebugFrameOpCodeWriterForAssembler& cfi() override {
diff --git a/compiler/utils/jni_macro_assembler_test.h b/compiler/utils/jni_macro_assembler_test.h
index ac8e7d3..ff182e6 100644
--- a/compiler/utils/jni_macro_assembler_test.h
+++ b/compiler/utils/jni_macro_assembler_test.h
@@ -77,15 +77,14 @@
 
  private:
   // Override this to pad the code with NOPs to a certain size if needed.
-  virtual void Pad(std::vector<uint8_t>& data ATTRIBUTE_UNUSED) {
-  }
+  virtual void Pad([[maybe_unused]] std::vector<uint8_t>& data) {}
 
   void DriverWrapper(const std::string& assembly_text, const std::string& test_name) {
     assembler_->FinalizeCode();
     size_t cs = assembler_->CodeSize();
     std::unique_ptr<std::vector<uint8_t>> data(new std::vector<uint8_t>(cs));
     MemoryRegion code(&(*data)[0], data->size());
-    assembler_->FinalizeInstructions(code);
+    assembler_->CopyInstructions(code);
     Pad(*data);
     Driver(*data, assembly_text, test_name);
   }
diff --git a/compiler/utils/label.h b/compiler/utils/label.h
index 0368d90..25bf013 100644
--- a/compiler/utils/label.h
+++ b/compiler/utils/label.h
@@ -31,6 +31,10 @@
 namespace arm64 {
 class Arm64Assembler;
 }  // namespace arm64
+namespace riscv64 {
+class Riscv64Assembler;
+class Riscv64Label;
+}  // namespace riscv64
 namespace x86 {
 class X86Assembler;
 class NearLabel;
@@ -109,6 +113,8 @@
   }
 
   friend class arm64::Arm64Assembler;
+  friend class riscv64::Riscv64Assembler;
+  friend class riscv64::Riscv64Label;
   friend class x86::X86Assembler;
   friend class x86::NearLabel;
   friend class x86_64::X86_64Assembler;
diff --git a/compiler/utils/riscv64/assembler_riscv64.cc b/compiler/utils/riscv64/assembler_riscv64.cc
new file mode 100644
index 0000000..09778ad
--- /dev/null
+++ b/compiler/utils/riscv64/assembler_riscv64.cc
@@ -0,0 +1,7311 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "assembler_riscv64.h"
+
+#include "base/bit_utils.h"
+#include "base/casts.h"
+#include "base/logging.h"
+#include "base/memory_region.h"
+
+namespace art HIDDEN {
+namespace riscv64 {
+
+static_assert(static_cast<size_t>(kRiscv64PointerSize) == kRiscv64DoublewordSize,
+              "Unexpected Riscv64 pointer size.");
+static_assert(kRiscv64PointerSize == PointerSize::k64, "Unexpected Riscv64 pointer size.");
+
+// Split 32-bit offset into an `imm20` for LUI/AUIPC and
+// a signed 12-bit short offset for ADDI/JALR/etc.
+ALWAYS_INLINE static inline std::pair<uint32_t, int32_t> SplitOffset(int32_t offset) {
+  // The highest 0x800 values are out of range.
+  DCHECK_LT(offset, 0x7ffff800);
+  // Round `offset` to nearest 4KiB offset because short offset has range [-0x800, 0x800).
+  int32_t near_offset = (offset + 0x800) & ~0xfff;
+  // Calculate the short offset.
+  int32_t short_offset = offset - near_offset;
+  DCHECK(IsInt<12>(short_offset));
+  // Extract the `imm20`.
+  uint32_t imm20 = static_cast<uint32_t>(near_offset) >> 12;
+  // Return the result as a pair.
+  return std::make_pair(imm20, short_offset);
+}
+
+ALWAYS_INLINE static inline int32_t ToInt12(uint32_t uint12) {
+  DCHECK(IsUint<12>(uint12));
+  return static_cast<int32_t>(uint12 - ((uint12 & 0x800) << 1));
+}
+
+void Riscv64Assembler::FinalizeCode() {
+  CHECK(!finalized_);
+  Assembler::FinalizeCode();
+  ReserveJumpTableSpace();
+  EmitLiterals();
+  PromoteBranches();
+  EmitBranches();
+  EmitJumpTables();
+  PatchCFI();
+  finalized_ = true;
+}
+
+/////////////////////////////// RV64 VARIANTS extension ///////////////////////////////
+
+//////////////////////////////// RV64 "I" Instructions ////////////////////////////////
+
+// LUI/AUIPC (RV32I, with sign-extension on RV64I), opcode = 0x17, 0x37
+
+void Riscv64Assembler::Lui(XRegister rd, uint32_t imm20) {
+  EmitU(imm20, rd, 0x37);
+}
+
+void Riscv64Assembler::Auipc(XRegister rd, uint32_t imm20) {
+  EmitU(imm20, rd, 0x17);
+}
+
+// Jump instructions (RV32I), opcode = 0x67, 0x6f
+
+void Riscv64Assembler::Jal(XRegister rd, int32_t offset) {
+  EmitJ(offset, rd, 0x6F);
+}
+
+void Riscv64Assembler::Jalr(XRegister rd, XRegister rs1, int32_t offset) {
+  EmitI(offset, rs1, 0x0, rd, 0x67);
+}
+
+// Branch instructions, opcode = 0x63 (subfunc from 0x0 ~ 0x7), 0x67, 0x6f
+
+void Riscv64Assembler::Beq(XRegister rs1, XRegister rs2, int32_t offset) {
+  EmitB(offset, rs2, rs1, 0x0, 0x63);
+}
+
+void Riscv64Assembler::Bne(XRegister rs1, XRegister rs2, int32_t offset) {
+  EmitB(offset, rs2, rs1, 0x1, 0x63);
+}
+
+void Riscv64Assembler::Blt(XRegister rs1, XRegister rs2, int32_t offset) {
+  EmitB(offset, rs2, rs1, 0x4, 0x63);
+}
+
+void Riscv64Assembler::Bge(XRegister rs1, XRegister rs2, int32_t offset) {
+  EmitB(offset, rs2, rs1, 0x5, 0x63);
+}
+
+void Riscv64Assembler::Bltu(XRegister rs1, XRegister rs2, int32_t offset) {
+  EmitB(offset, rs2, rs1, 0x6, 0x63);
+}
+
+void Riscv64Assembler::Bgeu(XRegister rs1, XRegister rs2, int32_t offset) {
+  EmitB(offset, rs2, rs1, 0x7, 0x63);
+}
+
+// Load instructions (RV32I+RV64I): opcode = 0x03, funct3 from 0x0 ~ 0x6
+
+void Riscv64Assembler::Lb(XRegister rd, XRegister rs1, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore);
+  EmitI(offset, rs1, 0x0, rd, 0x03);
+}
+
+void Riscv64Assembler::Lh(XRegister rd, XRegister rs1, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore);
+  EmitI(offset, rs1, 0x1, rd, 0x03);
+}
+
+void Riscv64Assembler::Lw(XRegister rd, XRegister rs1, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore);
+  EmitI(offset, rs1, 0x2, rd, 0x03);
+}
+
+void Riscv64Assembler::Ld(XRegister rd, XRegister rs1, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore);
+  EmitI(offset, rs1, 0x3, rd, 0x03);
+}
+
+void Riscv64Assembler::Lbu(XRegister rd, XRegister rs1, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore);
+  EmitI(offset, rs1, 0x4, rd, 0x03);
+}
+
+void Riscv64Assembler::Lhu(XRegister rd, XRegister rs1, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore);
+  EmitI(offset, rs1, 0x5, rd, 0x03);
+}
+
+void Riscv64Assembler::Lwu(XRegister rd, XRegister rs1, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore);
+  EmitI(offset, rs1, 0x6, rd, 0x3);
+}
+
+// Store instructions (RV32I+RV64I): opcode = 0x23, funct3 from 0x0 ~ 0x3
+
+void Riscv64Assembler::Sb(XRegister rs2, XRegister rs1, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore);
+  EmitS(offset, rs2, rs1, 0x0, 0x23);
+}
+
+void Riscv64Assembler::Sh(XRegister rs2, XRegister rs1, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore);
+  EmitS(offset, rs2, rs1, 0x1, 0x23);
+}
+
+void Riscv64Assembler::Sw(XRegister rs2, XRegister rs1, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore);
+  EmitS(offset, rs2, rs1, 0x2, 0x23);
+}
+
+void Riscv64Assembler::Sd(XRegister rs2, XRegister rs1, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore);
+  EmitS(offset, rs2, rs1, 0x3, 0x23);
+}
+
+// IMM ALU instructions (RV32I): opcode = 0x13, funct3 from 0x0 ~ 0x7
+
+void Riscv64Assembler::Addi(XRegister rd, XRegister rs1, int32_t imm12) {
+  EmitI(imm12, rs1, 0x0, rd, 0x13);
+}
+
+void Riscv64Assembler::Slti(XRegister rd, XRegister rs1, int32_t imm12) {
+  EmitI(imm12, rs1, 0x2, rd, 0x13);
+}
+
+void Riscv64Assembler::Sltiu(XRegister rd, XRegister rs1, int32_t imm12) {
+  EmitI(imm12, rs1, 0x3, rd, 0x13);
+}
+
+void Riscv64Assembler::Xori(XRegister rd, XRegister rs1, int32_t imm12) {
+  EmitI(imm12, rs1, 0x4, rd, 0x13);
+}
+
+void Riscv64Assembler::Ori(XRegister rd, XRegister rs1, int32_t imm12) {
+  EmitI(imm12, rs1, 0x6, rd, 0x13);
+}
+
+void Riscv64Assembler::Andi(XRegister rd, XRegister rs1, int32_t imm12) {
+  EmitI(imm12, rs1, 0x7, rd, 0x13);
+}
+
+// 0x1 Split: 0x0(6b) + imm12(6b)
+void Riscv64Assembler::Slli(XRegister rd, XRegister rs1, int32_t shamt) {
+  CHECK_LT(static_cast<uint32_t>(shamt), 64u);
+  EmitI6(0x0, shamt, rs1, 0x1, rd, 0x13);
+}
+
+// 0x5 Split: 0x0(6b) + imm12(6b)
+void Riscv64Assembler::Srli(XRegister rd, XRegister rs1, int32_t shamt) {
+  CHECK_LT(static_cast<uint32_t>(shamt), 64u);
+  EmitI6(0x0, shamt, rs1, 0x5, rd, 0x13);
+}
+
+// 0x5 Split: 0x10(6b) + imm12(6b)
+void Riscv64Assembler::Srai(XRegister rd, XRegister rs1, int32_t shamt) {
+  CHECK_LT(static_cast<uint32_t>(shamt), 64u);
+  EmitI6(0x10, shamt, rs1, 0x5, rd, 0x13);
+}
+
+// ALU instructions (RV32I): opcode = 0x33, funct3 from 0x0 ~ 0x7
+
+void Riscv64Assembler::Add(XRegister rd, XRegister rs1, XRegister rs2) {
+  EmitR(0x0, rs2, rs1, 0x0, rd, 0x33);
+}
+
+void Riscv64Assembler::Sub(XRegister rd, XRegister rs1, XRegister rs2) {
+  EmitR(0x20, rs2, rs1, 0x0, rd, 0x33);
+}
+
+void Riscv64Assembler::Slt(XRegister rd, XRegister rs1, XRegister rs2) {
+  EmitR(0x0, rs2, rs1, 0x02, rd, 0x33);
+}
+
+void Riscv64Assembler::Sltu(XRegister rd, XRegister rs1, XRegister rs2) {
+  EmitR(0x0, rs2, rs1, 0x03, rd, 0x33);
+}
+
+void Riscv64Assembler::Xor(XRegister rd, XRegister rs1, XRegister rs2) {
+  EmitR(0x0, rs2, rs1, 0x04, rd, 0x33);
+}
+
+void Riscv64Assembler::Or(XRegister rd, XRegister rs1, XRegister rs2) {
+  EmitR(0x0, rs2, rs1, 0x06, rd, 0x33);
+}
+
+void Riscv64Assembler::And(XRegister rd, XRegister rs1, XRegister rs2) {
+  EmitR(0x0, rs2, rs1, 0x07, rd, 0x33);
+}
+
+void Riscv64Assembler::Sll(XRegister rd, XRegister rs1, XRegister rs2) {
+  EmitR(0x0, rs2, rs1, 0x01, rd, 0x33);
+}
+
+void Riscv64Assembler::Srl(XRegister rd, XRegister rs1, XRegister rs2) {
+  EmitR(0x0, rs2, rs1, 0x05, rd, 0x33);
+}
+
+void Riscv64Assembler::Sra(XRegister rd, XRegister rs1, XRegister rs2) {
+  EmitR(0x20, rs2, rs1, 0x05, rd, 0x33);
+}
+
+// 32bit Imm ALU instructions (RV64I): opcode = 0x1b, funct3 from 0x0, 0x1, 0x5
+
+void Riscv64Assembler::Addiw(XRegister rd, XRegister rs1, int32_t imm12) {
+  EmitI(imm12, rs1, 0x0, rd, 0x1b);
+}
+
+void Riscv64Assembler::Slliw(XRegister rd, XRegister rs1, int32_t shamt) {
+  CHECK_LT(static_cast<uint32_t>(shamt), 32u);
+  EmitR(0x0, shamt, rs1, 0x1, rd, 0x1b);
+}
+
+void Riscv64Assembler::Srliw(XRegister rd, XRegister rs1, int32_t shamt) {
+  CHECK_LT(static_cast<uint32_t>(shamt), 32u);
+  EmitR(0x0, shamt, rs1, 0x5, rd, 0x1b);
+}
+
+void Riscv64Assembler::Sraiw(XRegister rd, XRegister rs1, int32_t shamt) {
+  CHECK_LT(static_cast<uint32_t>(shamt), 32u);
+  EmitR(0x20, shamt, rs1, 0x5, rd, 0x1b);
+}
+
+// 32bit ALU instructions (RV64I): opcode = 0x3b, funct3 from 0x0 ~ 0x7
+
+void Riscv64Assembler::Addw(XRegister rd, XRegister rs1, XRegister rs2) {
+  EmitR(0x0, rs2, rs1, 0x0, rd, 0x3b);
+}
+
+void Riscv64Assembler::Subw(XRegister rd, XRegister rs1, XRegister rs2) {
+  EmitR(0x20, rs2, rs1, 0x0, rd, 0x3b);
+}
+
+void Riscv64Assembler::Sllw(XRegister rd, XRegister rs1, XRegister rs2) {
+  EmitR(0x0, rs2, rs1, 0x1, rd, 0x3b);
+}
+
+void Riscv64Assembler::Srlw(XRegister rd, XRegister rs1, XRegister rs2) {
+  EmitR(0x0, rs2, rs1, 0x5, rd, 0x3b);
+}
+
+void Riscv64Assembler::Sraw(XRegister rd, XRegister rs1, XRegister rs2) {
+  EmitR(0x20, rs2, rs1, 0x5, rd, 0x3b);
+}
+
+// Environment call and breakpoint (RV32I), opcode = 0x73
+
+void Riscv64Assembler::Ecall() { EmitI(0x0, 0x0, 0x0, 0x0, 0x73); }
+
+void Riscv64Assembler::Ebreak() { EmitI(0x1, 0x0, 0x0, 0x0, 0x73); }
+
+// Fence instruction (RV32I): opcode = 0xf, funct3 = 0
+
+void Riscv64Assembler::Fence(uint32_t pred, uint32_t succ) {
+  DCHECK(IsUint<4>(pred));
+  DCHECK(IsUint<4>(succ));
+  EmitI(/* normal fence */ 0x0 << 8 | pred << 4 | succ, 0x0, 0x0, 0x0, 0xf);
+}
+
+void Riscv64Assembler::FenceTso() {
+  static constexpr uint32_t kPred = kFenceWrite | kFenceRead;
+  static constexpr uint32_t kSucc = kFenceWrite | kFenceRead;
+  EmitI(ToInt12(/* TSO fence */ 0x8 << 8 | kPred << 4 | kSucc), 0x0, 0x0, 0x0, 0xf);
+}
+
+//////////////////////////////// RV64 "I" Instructions  END ////////////////////////////////
+
+/////////////////////////// RV64 "Zifencei" Instructions  START ////////////////////////////
+
+// "Zifencei" Standard Extension, opcode = 0xf, funct3 = 1
+void Riscv64Assembler::FenceI() {
+  AssertExtensionsEnabled(Riscv64Extension::kZifencei);
+  EmitI(0x0, 0x0, 0x1, 0x0, 0xf);
+}
+
+//////////////////////////// RV64 "Zifencei" Instructions  END /////////////////////////////
+
+/////////////////////////////// RV64 "M" Instructions  START ///////////////////////////////
+
+// RV32M Standard Extension: opcode = 0x33, funct3 from 0x0 ~ 0x7
+
+void Riscv64Assembler::Mul(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kM);
+  EmitR(0x1, rs2, rs1, 0x0, rd, 0x33);
+}
+
+void Riscv64Assembler::Mulh(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kM);
+  EmitR(0x1, rs2, rs1, 0x1, rd, 0x33);
+}
+
+void Riscv64Assembler::Mulhsu(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kM);
+  EmitR(0x1, rs2, rs1, 0x2, rd, 0x33);
+}
+
+void Riscv64Assembler::Mulhu(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kM);
+  EmitR(0x1, rs2, rs1, 0x3, rd, 0x33);
+}
+
+void Riscv64Assembler::Div(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kM);
+  EmitR(0x1, rs2, rs1, 0x4, rd, 0x33);
+}
+
+void Riscv64Assembler::Divu(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kM);
+  EmitR(0x1, rs2, rs1, 0x5, rd, 0x33);
+}
+
+void Riscv64Assembler::Rem(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kM);
+  EmitR(0x1, rs2, rs1, 0x6, rd, 0x33);
+}
+
+void Riscv64Assembler::Remu(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kM);
+  EmitR(0x1, rs2, rs1, 0x7, rd, 0x33);
+}
+
+// RV64M Standard Extension: opcode = 0x3b, funct3 0x0 and from 0x4 ~ 0x7
+
+void Riscv64Assembler::Mulw(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kM);
+  EmitR(0x1, rs2, rs1, 0x0, rd, 0x3b);
+}
+
+void Riscv64Assembler::Divw(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kM);
+  EmitR(0x1, rs2, rs1, 0x4, rd, 0x3b);
+}
+
+void Riscv64Assembler::Divuw(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kM);
+  EmitR(0x1, rs2, rs1, 0x5, rd, 0x3b);
+}
+
+void Riscv64Assembler::Remw(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kM);
+  EmitR(0x1, rs2, rs1, 0x6, rd, 0x3b);
+}
+
+void Riscv64Assembler::Remuw(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kM);
+  EmitR(0x1, rs2, rs1, 0x7, rd, 0x3b);
+}
+
+//////////////////////////////// RV64 "M" Instructions  END ////////////////////////////////
+
+/////////////////////////////// RV64 "A" Instructions  START ///////////////////////////////
+
+void Riscv64Assembler::LrW(XRegister rd, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  CHECK(aqrl != AqRl::kRelease);
+  EmitR4(0x2, enum_cast<uint32_t>(aqrl), 0x0, rs1, 0x2, rd, 0x2f);
+}
+
+void Riscv64Assembler::LrD(XRegister rd, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  CHECK(aqrl != AqRl::kRelease);
+  EmitR4(0x2, enum_cast<uint32_t>(aqrl), 0x0, rs1, 0x3, rd, 0x2f);
+}
+
+void Riscv64Assembler::ScW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  CHECK(aqrl != AqRl::kAcquire);
+  EmitR4(0x3, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x2, rd, 0x2f);
+}
+
+void Riscv64Assembler::ScD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  CHECK(aqrl != AqRl::kAcquire);
+  EmitR4(0x3, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x3, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoSwapW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0x1, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x2, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoSwapD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0x1, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x3, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoAddW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0x0, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x2, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoAddD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0x0, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x3, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoXorW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0x4, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x2, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoXorD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0x4, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x3, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoAndW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0xc, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x2, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoAndD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0xc, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x3, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoOrW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0x8, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x2, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoOrD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0x8, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x3, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoMinW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0x10, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x2, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoMinD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0x10, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x3, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoMaxW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0x14, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x2, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoMaxD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0x14, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x3, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoMinuW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0x18, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x2, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoMinuD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0x18, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x3, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoMaxuW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0x1c, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x2, rd, 0x2f);
+}
+
+void Riscv64Assembler::AmoMaxuD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl) {
+  AssertExtensionsEnabled(Riscv64Extension::kA);
+  EmitR4(0x1c, enum_cast<uint32_t>(aqrl), rs2, rs1, 0x3, rd, 0x2f);
+}
+
+/////////////////////////////// RV64 "A" Instructions  END ///////////////////////////////
+
+///////////////////////////// RV64 "Zicsr" Instructions  START /////////////////////////////
+
+// "Zicsr" Standard Extension, opcode = 0x73, funct3 from 0x1 ~ 0x3 and 0x5 ~ 0x7
+
+void Riscv64Assembler::Csrrw(XRegister rd, uint32_t csr, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kZicsr);
+  EmitI(ToInt12(csr), rs1, 0x1, rd, 0x73);
+}
+
+void Riscv64Assembler::Csrrs(XRegister rd, uint32_t csr, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kZicsr);
+  EmitI(ToInt12(csr), rs1, 0x2, rd, 0x73);
+}
+
+void Riscv64Assembler::Csrrc(XRegister rd, uint32_t csr, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kZicsr);
+  EmitI(ToInt12(csr), rs1, 0x3, rd, 0x73);
+}
+
+void Riscv64Assembler::Csrrwi(XRegister rd, uint32_t csr, uint32_t uimm5) {
+  AssertExtensionsEnabled(Riscv64Extension::kZicsr);
+  EmitI(ToInt12(csr), uimm5, 0x5, rd, 0x73);
+}
+
+void Riscv64Assembler::Csrrsi(XRegister rd, uint32_t csr, uint32_t uimm5) {
+  AssertExtensionsEnabled(Riscv64Extension::kZicsr);
+  EmitI(ToInt12(csr), uimm5, 0x6, rd, 0x73);
+}
+
+void Riscv64Assembler::Csrrci(XRegister rd, uint32_t csr, uint32_t uimm5) {
+  AssertExtensionsEnabled(Riscv64Extension::kZicsr);
+  EmitI(ToInt12(csr), uimm5, 0x7, rd, 0x73);
+}
+
+////////////////////////////// RV64 "Zicsr" Instructions  END //////////////////////////////
+
+/////////////////////////////// RV64 "FD" Instructions  START ///////////////////////////////
+
+// FP load/store instructions (RV32F+RV32D): opcode = 0x07, 0x27
+
+void Riscv64Assembler::FLw(FRegister rd, XRegister rs1, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kF);
+  EmitI(offset, rs1, 0x2, rd, 0x07);
+}
+
+void Riscv64Assembler::FLd(FRegister rd, XRegister rs1, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kD);
+  EmitI(offset, rs1, 0x3, rd, 0x07);
+}
+
+void Riscv64Assembler::FSw(FRegister rs2, XRegister rs1, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kF);
+  EmitS(offset, rs2, rs1, 0x2, 0x27);
+}
+
+void Riscv64Assembler::FSd(FRegister rs2, XRegister rs1, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kD);
+  EmitS(offset, rs2, rs1, 0x3, 0x27);
+}
+
+// FP FMA instructions (RV32F+RV32D): opcode = 0x43, 0x47, 0x4b, 0x4f
+
+void Riscv64Assembler::FMAddS(
+    FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR4(rs3, 0x0, rs2, rs1, enum_cast<uint32_t>(frm), rd, 0x43);
+}
+
+void Riscv64Assembler::FMAddD(
+    FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR4(rs3, 0x1, rs2, rs1, enum_cast<uint32_t>(frm), rd, 0x43);
+}
+
+void Riscv64Assembler::FMSubS(
+    FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR4(rs3, 0x0, rs2, rs1, enum_cast<uint32_t>(frm), rd, 0x47);
+}
+
+void Riscv64Assembler::FMSubD(
+    FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR4(rs3, 0x1, rs2, rs1, enum_cast<uint32_t>(frm), rd, 0x47);
+}
+
+void Riscv64Assembler::FNMSubS(
+    FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR4(rs3, 0x0, rs2, rs1, enum_cast<uint32_t>(frm), rd, 0x4b);
+}
+
+void Riscv64Assembler::FNMSubD(
+    FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR4(rs3, 0x1, rs2, rs1, enum_cast<uint32_t>(frm), rd, 0x4b);
+}
+
+void Riscv64Assembler::FNMAddS(
+    FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR4(rs3, 0x0, rs2, rs1, enum_cast<uint32_t>(frm), rd, 0x4f);
+}
+
+void Riscv64Assembler::FNMAddD(
+    FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR4(rs3, 0x1, rs2, rs1, enum_cast<uint32_t>(frm), rd, 0x4f);
+}
+
+// Simple FP instructions (RV32F+RV32D): opcode = 0x53, funct7 = 0b0XXXX0D
+
+void Riscv64Assembler::FAddS(FRegister rd, FRegister rs1, FRegister rs2, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x0, rs2, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FAddD(FRegister rd, FRegister rs1, FRegister rs2, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x1, rs2, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FSubS(FRegister rd, FRegister rs1, FRegister rs2, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x4, rs2, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FSubD(FRegister rd, FRegister rs1, FRegister rs2, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x5, rs2, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FMulS(FRegister rd, FRegister rs1, FRegister rs2, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x8, rs2, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FMulD(FRegister rd, FRegister rs1, FRegister rs2, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x9, rs2, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FDivS(FRegister rd, FRegister rs1, FRegister rs2, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0xc, rs2, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FDivD(FRegister rd, FRegister rs1, FRegister rs2, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0xd, rs2, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FSqrtS(FRegister rd, FRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x2c, 0x0, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FSqrtD(FRegister rd, FRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x2d, 0x0, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FSgnjS(FRegister rd, FRegister rs1, FRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x10, rs2, rs1, 0x0, rd, 0x53);
+}
+
+void Riscv64Assembler::FSgnjD(FRegister rd, FRegister rs1, FRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x11, rs2, rs1, 0x0, rd, 0x53);
+}
+
+void Riscv64Assembler::FSgnjnS(FRegister rd, FRegister rs1, FRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x10, rs2, rs1, 0x1, rd, 0x53);
+}
+
+void Riscv64Assembler::FSgnjnD(FRegister rd, FRegister rs1, FRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x11, rs2, rs1, 0x1, rd, 0x53);
+}
+
+void Riscv64Assembler::FSgnjxS(FRegister rd, FRegister rs1, FRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x10, rs2, rs1, 0x2, rd, 0x53);
+}
+
+void Riscv64Assembler::FSgnjxD(FRegister rd, FRegister rs1, FRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x11, rs2, rs1, 0x2, rd, 0x53);
+}
+
+void Riscv64Assembler::FMinS(FRegister rd, FRegister rs1, FRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x14, rs2, rs1, 0x0, rd, 0x53);
+}
+
+void Riscv64Assembler::FMinD(FRegister rd, FRegister rs1, FRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x15, rs2, rs1, 0x0, rd, 0x53);
+}
+
+void Riscv64Assembler::FMaxS(FRegister rd, FRegister rs1, FRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x14, rs2, rs1, 0x1, rd, 0x53);
+}
+
+void Riscv64Assembler::FMaxD(FRegister rd, FRegister rs1, FRegister rs2) {
+  EmitR(0x15, rs2, rs1, 0x1, rd, 0x53);
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+}
+
+void Riscv64Assembler::FCvtSD(FRegister rd, FRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF, Riscv64Extension::kD);
+  EmitR(0x20, 0x1, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FCvtDS(FRegister rd, FRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF, Riscv64Extension::kD);
+  // Note: The `frm` is useless, the result can represent every value of the source exactly.
+  EmitR(0x21, 0x0, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+// FP compare instructions (RV32F+RV32D): opcode = 0x53, funct7 = 0b101000D
+
+void Riscv64Assembler::FEqS(XRegister rd, FRegister rs1, FRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x50, rs2, rs1, 0x2, rd, 0x53);
+}
+
+void Riscv64Assembler::FEqD(XRegister rd, FRegister rs1, FRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x51, rs2, rs1, 0x2, rd, 0x53);
+}
+
+void Riscv64Assembler::FLtS(XRegister rd, FRegister rs1, FRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x50, rs2, rs1, 0x1, rd, 0x53);
+}
+
+void Riscv64Assembler::FLtD(XRegister rd, FRegister rs1, FRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x51, rs2, rs1, 0x1, rd, 0x53);
+}
+
+void Riscv64Assembler::FLeS(XRegister rd, FRegister rs1, FRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x50, rs2, rs1, 0x0, rd, 0x53);
+}
+
+void Riscv64Assembler::FLeD(XRegister rd, FRegister rs1, FRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x51, rs2, rs1, 0x0, rd, 0x53);
+}
+
+// FP conversion instructions (RV32F+RV32D+RV64F+RV64D): opcode = 0x53, funct7 = 0b110X00D
+
+void Riscv64Assembler::FCvtWS(XRegister rd, FRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x60, 0x0, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FCvtWD(XRegister rd, FRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x61, 0x0, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FCvtWuS(XRegister rd, FRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x60, 0x1, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FCvtWuD(XRegister rd, FRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x61, 0x1, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FCvtLS(XRegister rd, FRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x60, 0x2, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FCvtLD(XRegister rd, FRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x61, 0x2, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FCvtLuS(XRegister rd, FRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x60, 0x3, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FCvtLuD(XRegister rd, FRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x61, 0x3, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FCvtSW(FRegister rd, XRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x68, 0x0, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FCvtDW(FRegister rd, XRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  // Note: The `frm` is useless, the result can represent every value of the source exactly.
+  EmitR(0x69, 0x0, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FCvtSWu(FRegister rd, XRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x68, 0x1, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FCvtDWu(FRegister rd, XRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  // Note: The `frm` is useless, the result can represent every value of the source exactly.
+  EmitR(0x69, 0x1, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FCvtSL(FRegister rd, XRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x68, 0x2, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FCvtDL(FRegister rd, XRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x69, 0x2, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FCvtSLu(FRegister rd, XRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x68, 0x3, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+void Riscv64Assembler::FCvtDLu(FRegister rd, XRegister rs1, FPRoundingMode frm) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x69, 0x3, rs1, enum_cast<uint32_t>(frm), rd, 0x53);
+}
+
+// FP move instructions (RV32F+RV32D): opcode = 0x53, funct3 = 0x0, funct7 = 0b111X00D
+
+void Riscv64Assembler::FMvXW(XRegister rd, FRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x70, 0x0, rs1, 0x0, rd, 0x53);
+}
+
+void Riscv64Assembler::FMvXD(XRegister rd, FRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x71, 0x0, rs1, 0x0, rd, 0x53);
+}
+
+void Riscv64Assembler::FMvWX(FRegister rd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x78, 0x0, rs1, 0x0, rd, 0x53);
+}
+
+void Riscv64Assembler::FMvDX(FRegister rd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x79, 0x0, rs1, 0x0, rd, 0x53);
+}
+
+// FP classify instructions (RV32F+RV32D): opcode = 0x53, funct3 = 0x1, funct7 = 0b111X00D
+
+void Riscv64Assembler::FClassS(XRegister rd, FRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kF);
+  EmitR(0x70, 0x0, rs1, 0x1, rd, 0x53);
+}
+
+void Riscv64Assembler::FClassD(XRegister rd, FRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kD);
+  EmitR(0x71, 0x0, rs1, 0x1, rd, 0x53);
+}
+
+/////////////////////////////// RV64 "FD" Instructions  END ///////////////////////////////
+
+/////////////////////////////// RV64 "C" Instructions  START /////////////////////////////
+
+void Riscv64Assembler::CLwsp(XRegister rd, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kZca);
+  DCHECK_NE(rd, Zero);
+  EmitCI(0b010u, rd, ExtractOffset52_76(offset), 0b10u);
+}
+
+void Riscv64Assembler::CLdsp(XRegister rd, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kZca);
+  DCHECK_NE(rd, Zero);
+  EmitCI(0b011u, rd, ExtractOffset53_86(offset), 0b10u);
+}
+
+void Riscv64Assembler::CFLdsp(FRegister rd, int32_t offset) {
+  AssertExtensionsEnabled(
+      Riscv64Extension::kLoadStore, Riscv64Extension::kZcd, Riscv64Extension::kD);
+  EmitCI(0b001u, rd, ExtractOffset53_86(offset), 0b10u);
+}
+
+void Riscv64Assembler::CSwsp(XRegister rs2, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kZca);
+  EmitCSS(0b110u, ExtractOffset52_76(offset), rs2, 0b10u);
+}
+
+void Riscv64Assembler::CSdsp(XRegister rs2, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kZca);
+  EmitCSS(0b111u, ExtractOffset53_86(offset), rs2, 0b10u);
+}
+
+void Riscv64Assembler::CFSdsp(FRegister rs2, int32_t offset) {
+  AssertExtensionsEnabled(
+      Riscv64Extension::kLoadStore, Riscv64Extension::kZcd, Riscv64Extension::kD);
+  EmitCSS(0b101u, ExtractOffset53_86(offset), rs2, 0b10u);
+}
+
+void Riscv64Assembler::CLw(XRegister rd_s, XRegister rs1_s, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kZca);
+  EmitCM(0b010u, ExtractOffset52_6(offset), rs1_s, rd_s, 0b00u);
+}
+
+void Riscv64Assembler::CLd(XRegister rd_s, XRegister rs1_s, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kZca);
+  EmitCM(0b011u, ExtractOffset53_76(offset), rs1_s, rd_s, 0b00u);
+}
+
+void Riscv64Assembler::CFLd(FRegister rd_s, XRegister rs1_s, int32_t offset) {
+  AssertExtensionsEnabled(
+      Riscv64Extension::kLoadStore, Riscv64Extension::kZcd, Riscv64Extension::kD);
+  EmitCM(0b001u, ExtractOffset53_76(offset), rs1_s, rd_s, 0b00u);
+}
+
+void Riscv64Assembler::CSw(XRegister rs2_s, XRegister rs1_s, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kZca);
+  EmitCM(0b110u, ExtractOffset52_6(offset), rs1_s, rs2_s, 0b00u);
+}
+
+void Riscv64Assembler::CSd(XRegister rs2_s, XRegister rs1_s, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kZca);
+  EmitCM(0b111u, ExtractOffset53_76(offset), rs1_s, rs2_s, 0b00u);
+}
+
+void Riscv64Assembler::CFSd(FRegister rs2_s, XRegister rs1_s, int32_t offset) {
+  AssertExtensionsEnabled(
+      Riscv64Extension::kLoadStore, Riscv64Extension::kZcd, Riscv64Extension::kD);
+  EmitCM(0b101u, ExtractOffset53_76(offset), rs1_s, rs2_s, 0b00u);
+}
+
+void Riscv64Assembler::CLi(XRegister rd, int32_t imm) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  DCHECK_NE(rd, Zero);
+  DCHECK(IsInt<6>(imm));
+  EmitCI(0b010u, rd, EncodeInt6(imm), 0b01u);
+}
+
+void Riscv64Assembler::CLui(XRegister rd, uint32_t nzimm6) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  DCHECK_NE(rd, Zero);
+  DCHECK_NE(rd, SP);
+  DCHECK(IsImmCLuiEncodable(nzimm6));
+  EmitCI(0b011u, rd, nzimm6 & MaskLeastSignificant<uint32_t>(6), 0b01u);
+}
+
+void Riscv64Assembler::CAddi(XRegister rd, int32_t nzimm) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  DCHECK_NE(rd, Zero);
+  DCHECK_NE(nzimm, 0);
+  EmitCI(0b000u, rd, EncodeInt6(nzimm), 0b01u);
+}
+
+void Riscv64Assembler::CAddiw(XRegister rd, int32_t imm) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  DCHECK_NE(rd, Zero);
+  EmitCI(0b001u, rd, EncodeInt6(imm), 0b01u);
+}
+
+void Riscv64Assembler::CAddi16Sp(int32_t nzimm) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  DCHECK_NE(nzimm, 0);
+  DCHECK(IsAligned<16>(nzimm));
+
+  uint32_t unzimm = static_cast<uint32_t>(nzimm);
+
+  // nzimm[9]
+  uint32_t imms1 =  BitFieldExtract(unzimm, 9, 1);
+  // nzimm[4|6|8:7|5]
+  uint32_t imms0 = (BitFieldExtract(unzimm, 4, 1) << 4) |
+                   (BitFieldExtract(unzimm, 6, 1) << 3) |
+                   (BitFieldExtract(unzimm, 7, 2) << 1) |
+                    BitFieldExtract(unzimm, 5, 1);
+
+  EmitCI(0b011u, SP, BitFieldInsert(imms0, imms1, 5, 1), 0b01u);
+}
+
+void Riscv64Assembler::CAddi4Spn(XRegister rd_s, uint32_t nzuimm) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  DCHECK_NE(nzuimm, 0u);
+  DCHECK(IsAligned<4>(nzuimm));
+  DCHECK(IsUint<10>(nzuimm));
+
+  // nzuimm[5:4|9:6|2|3]
+  uint32_t uimm = (BitFieldExtract(nzuimm, 4, 2) << 6) |
+                  (BitFieldExtract(nzuimm, 6, 4) << 2) |
+                  (BitFieldExtract(nzuimm, 2, 1) << 1) |
+                   BitFieldExtract(nzuimm, 3, 1);
+
+  EmitCIW(0b000u, uimm, rd_s, 0b00u);
+}
+
+void Riscv64Assembler::CSlli(XRegister rd, int32_t shamt) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  DCHECK_NE(shamt, 0);
+  DCHECK_NE(rd, Zero);
+  EmitCI(0b000u, rd, shamt, 0b10u);
+}
+
+void Riscv64Assembler::CSrli(XRegister rd_s, int32_t shamt) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  DCHECK_NE(shamt, 0);
+  DCHECK(IsUint<6>(shamt));
+  EmitCBArithmetic(0b100u, 0b00u, shamt, rd_s, 0b01u);
+}
+
+void Riscv64Assembler::CSrai(XRegister rd_s, int32_t shamt) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  DCHECK_NE(shamt, 0);
+  DCHECK(IsUint<6>(shamt));
+  EmitCBArithmetic(0b100u, 0b01u, shamt, rd_s, 0b01u);
+}
+
+void Riscv64Assembler::CAndi(XRegister rd_s, int32_t imm) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  DCHECK(IsInt<6>(imm));
+  EmitCBArithmetic(0b100u, 0b10u, imm, rd_s, 0b01u);
+}
+
+void Riscv64Assembler::CMv(XRegister rd, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  DCHECK_NE(rd, Zero);
+  DCHECK_NE(rs2, Zero);
+  EmitCR(0b1000u, rd, rs2, 0b10u);
+}
+
+void Riscv64Assembler::CAdd(XRegister rd, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  DCHECK_NE(rd, Zero);
+  DCHECK_NE(rs2, Zero);
+  EmitCR(0b1001u, rd, rs2, 0b10u);
+}
+
+void Riscv64Assembler::CAnd(XRegister rd_s, XRegister rs2_s) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  EmitCAReg(0b100011u, rd_s, 0b11u, rs2_s, 0b01u);
+}
+
+void Riscv64Assembler::COr(XRegister rd_s, XRegister rs2_s) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  EmitCAReg(0b100011u, rd_s, 0b10u, rs2_s, 0b01u);
+}
+
+void Riscv64Assembler::CXor(XRegister rd_s, XRegister rs2_s) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  EmitCAReg(0b100011u, rd_s, 0b01u, rs2_s, 0b01u);
+}
+
+void Riscv64Assembler::CSub(XRegister rd_s, XRegister rs2_s) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  EmitCAReg(0b100011u, rd_s, 0b00u, rs2_s, 0b01u);
+}
+
+void Riscv64Assembler::CAddw(XRegister rd_s, XRegister rs2_s) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  EmitCAReg(0b100111u, rd_s, 0b01u, rs2_s, 0b01u);
+}
+
+void Riscv64Assembler::CSubw(XRegister rd_s, XRegister rs2_s) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  EmitCAReg(0b100111u, rd_s, 0b00u, rs2_s, 0b01u);
+}
+
+// "Zcb" Standard Extension, part of "C", opcode = 0b00, 0b01, funct3 = 0b100.
+
+void Riscv64Assembler::CLbu(XRegister rd_s, XRegister rs1_s, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kZcb);
+  EmitCAReg(0b100000u, rs1_s, EncodeOffset0_1(offset), rd_s, 0b00u);
+}
+
+void Riscv64Assembler::CLhu(XRegister rd_s, XRegister rs1_s, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kZcb);
+  DCHECK(IsUint<2>(offset));
+  DCHECK_ALIGNED(offset, 2);
+  EmitCAReg(0b100001u, rs1_s, BitFieldExtract<uint32_t>(offset, 1, 1), rd_s, 0b00u);
+}
+
+void Riscv64Assembler::CLh(XRegister rd_s, XRegister rs1_s, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kZcb);
+  DCHECK(IsUint<2>(offset));
+  DCHECK_ALIGNED(offset, 2);
+  EmitCAReg(0b100001u, rs1_s, 0b10 | BitFieldExtract<uint32_t>(offset, 1, 1), rd_s, 0b00u);
+}
+
+void Riscv64Assembler::CSb(XRegister rs2_s, XRegister rs1_s, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kZcb);
+  EmitCAReg(0b100010u, rs1_s, EncodeOffset0_1(offset), rs2_s, 0b00u);
+}
+
+void Riscv64Assembler::CSh(XRegister rs2_s, XRegister rs1_s, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kZcb);
+  DCHECK(IsUint<2>(offset));
+  DCHECK_ALIGNED(offset, 2);
+  EmitCAReg(0b100011u, rs1_s, BitFieldExtract<uint32_t>(offset, 1, 1), rs2_s, 0b00u);
+}
+
+void Riscv64Assembler::CZextB(XRegister rd_rs1_s) {
+  AssertExtensionsEnabled(Riscv64Extension::kZcb);
+  EmitCAImm(0b100111u, rd_rs1_s, 0b11u, 0b000u, 0b01u);
+}
+
+void Riscv64Assembler::CSextB(XRegister rd_rs1_s) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb, Riscv64Extension::kZcb);
+  EmitCAImm(0b100111u, rd_rs1_s, 0b11u, 0b001u, 0b01u);
+}
+
+void Riscv64Assembler::CZextH(XRegister rd_rs1_s) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb, Riscv64Extension::kZcb);
+  EmitCAImm(0b100111u, rd_rs1_s, 0b11u, 0b010u, 0b01u);
+}
+
+void Riscv64Assembler::CSextH(XRegister rd_rs1_s) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb, Riscv64Extension::kZcb);
+  EmitCAImm(0b100111u, rd_rs1_s, 0b11u, 0b011u, 0b01u);
+}
+
+void Riscv64Assembler::CZextW(XRegister rd_rs1_s) {
+  AssertExtensionsEnabled(Riscv64Extension::kZba, Riscv64Extension::kZcb);
+  EmitCAImm(0b100111u, rd_rs1_s, 0b11u, 0b100u, 0b01u);
+}
+
+void Riscv64Assembler::CNot(XRegister rd_rs1_s) {
+  AssertExtensionsEnabled(Riscv64Extension::kZcb);
+  EmitCAImm(0b100111u, rd_rs1_s, 0b11u, 0b101u, 0b01u);
+}
+
+void Riscv64Assembler::CMul(XRegister rd_s, XRegister rs2_s) {
+  AssertExtensionsEnabled(Riscv64Extension::kM, Riscv64Extension::kZcb);
+  EmitCAReg(0b100111u, rd_s, 0b10u, rs2_s, 0b01u);
+}
+
+void Riscv64Assembler::CJ(int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  EmitCJ(0b101u, offset, 0b01u);
+}
+
+void Riscv64Assembler::CJr(XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  DCHECK_NE(rs1, Zero);
+  EmitCR(0b1000u, rs1, Zero, 0b10u);
+}
+
+void Riscv64Assembler::CJalr(XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  DCHECK_NE(rs1, Zero);
+  EmitCR(0b1001u, rs1, Zero, 0b10u);
+}
+
+void Riscv64Assembler::CBeqz(XRegister rs1_s, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  EmitCBBranch(0b110u, offset, rs1_s, 0b01u);
+}
+
+void Riscv64Assembler::CBnez(XRegister rs1_s, int32_t offset) {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  EmitCBBranch(0b111u, offset, rs1_s, 0b01u);
+}
+
+void Riscv64Assembler::CEbreak() {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  EmitCR(0b1001u, Zero, Zero, 0b10u);
+}
+
+void Riscv64Assembler::CNop() {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  EmitCI(0b000u, Zero, 0u, 0b01u);
+}
+
+void Riscv64Assembler::CUnimp() {
+  AssertExtensionsEnabled(Riscv64Extension::kZca);
+  Emit16(0x0u);
+}
+
+/////////////////////////////// RV64 "C" Instructions  END ///////////////////////////////
+
+////////////////////////////// RV64 "Zba" Instructions  START /////////////////////////////
+
+void Riscv64Assembler::AddUw(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZba);
+  EmitR(0x4, rs2, rs1, 0x0, rd, 0x3b);
+}
+
+void Riscv64Assembler::Sh1Add(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZba);
+  EmitR(0x10, rs2, rs1, 0x2, rd, 0x33);
+}
+
+void Riscv64Assembler::Sh1AddUw(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZba);
+  EmitR(0x10, rs2, rs1, 0x2, rd, 0x3b);
+}
+
+void Riscv64Assembler::Sh2Add(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZba);
+  EmitR(0x10, rs2, rs1, 0x4, rd, 0x33);
+}
+
+void Riscv64Assembler::Sh2AddUw(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZba);
+  EmitR(0x10, rs2, rs1, 0x4, rd, 0x3b);
+}
+
+void Riscv64Assembler::Sh3Add(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZba);
+  EmitR(0x10, rs2, rs1, 0x6, rd, 0x33);
+}
+
+void Riscv64Assembler::Sh3AddUw(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZba);
+  EmitR(0x10, rs2, rs1, 0x6, rd, 0x3b);
+}
+
+void Riscv64Assembler::SlliUw(XRegister rd, XRegister rs1, int32_t shamt) {
+  AssertExtensionsEnabled(Riscv64Extension::kZba);
+  EmitI6(0x2, shamt, rs1, 0x1, rd, 0x1b);
+}
+
+/////////////////////////////// RV64 "Zba" Instructions  END //////////////////////////////
+
+////////////////////////////// RV64 "Zbb" Instructions  START /////////////////////////////
+
+void Riscv64Assembler::Andn(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x20, rs2, rs1, 0x7, rd, 0x33);
+}
+
+void Riscv64Assembler::Orn(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x20, rs2, rs1, 0x6, rd, 0x33);
+}
+
+void Riscv64Assembler::Xnor(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x20, rs2, rs1, 0x4, rd, 0x33);
+}
+
+void Riscv64Assembler::Clz(XRegister rd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x30, 0x0, rs1, 0x1, rd, 0x13);
+}
+
+void Riscv64Assembler::Clzw(XRegister rd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x30, 0x0, rs1, 0x1, rd, 0x1b);
+}
+
+void Riscv64Assembler::Ctz(XRegister rd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x30, 0x1, rs1, 0x1, rd, 0x13);
+}
+
+void Riscv64Assembler::Ctzw(XRegister rd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x30, 0x1, rs1, 0x1, rd, 0x1b);
+}
+
+void Riscv64Assembler::Cpop(XRegister rd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x30, 0x2, rs1, 0x1, rd, 0x13);
+}
+
+void Riscv64Assembler::Cpopw(XRegister rd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x30, 0x2, rs1, 0x1, rd, 0x1b);
+}
+
+void Riscv64Assembler::Min(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x5, rs2, rs1, 0x4, rd, 0x33);
+}
+
+void Riscv64Assembler::Minu(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x5, rs2, rs1, 0x5, rd, 0x33);
+}
+
+void Riscv64Assembler::Max(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x5, rs2, rs1, 0x6, rd, 0x33);
+}
+
+void Riscv64Assembler::Maxu(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x5, rs2, rs1, 0x7, rd, 0x33);
+}
+
+void Riscv64Assembler::Rol(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x30, rs2, rs1, 0x1, rd, 0x33);
+}
+
+void Riscv64Assembler::Rolw(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x30, rs2, rs1, 0x1, rd, 0x3b);
+}
+
+void Riscv64Assembler::Ror(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x30, rs2, rs1, 0x5, rd, 0x33);
+}
+
+void Riscv64Assembler::Rorw(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x30, rs2, rs1, 0x5, rd, 0x3b);
+}
+
+void Riscv64Assembler::Rori(XRegister rd, XRegister rs1, int32_t shamt) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  CHECK_LT(static_cast<uint32_t>(shamt), 64u);
+  EmitI6(0x18, shamt, rs1, 0x5, rd, 0x13);
+}
+
+void Riscv64Assembler::Roriw(XRegister rd, XRegister rs1, int32_t shamt) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  CHECK_LT(static_cast<uint32_t>(shamt), 32u);
+  EmitI6(0x18, shamt, rs1, 0x5, rd, 0x1b);
+}
+
+void Riscv64Assembler::OrcB(XRegister rd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x14, 0x7, rs1, 0x5, rd, 0x13);
+}
+
+void Riscv64Assembler::Rev8(XRegister rd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x35, 0x18, rs1, 0x5, rd, 0x13);
+}
+
+void Riscv64Assembler::ZbbSextB(XRegister rd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x30, 0x4, rs1, 0x1, rd, 0x13);
+}
+
+void Riscv64Assembler::ZbbSextH(XRegister rd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x30, 0x5, rs1, 0x1, rd, 0x13);
+}
+
+void Riscv64Assembler::ZbbZextH(XRegister rd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kZbb);
+  EmitR(0x4, 0x0, rs1, 0x4, rd, 0x3b);
+}
+
+/////////////////////////////// RV64 "Zbb" Instructions  END //////////////////////////////
+
+/////////////////////////////// RVV "VSet" Instructions  START ////////////////////////////
+
+void Riscv64Assembler::VSetvli(XRegister rd, XRegister rs1, uint32_t vtypei) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK(IsUint<11>(vtypei));
+  EmitI(vtypei, rs1, enum_cast<uint32_t>(VAIEncoding::kOPCFG), rd, 0x57);
+}
+
+void Riscv64Assembler::VSetivli(XRegister rd, uint32_t uimm, uint32_t vtypei) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK(IsUint<10>(vtypei));
+  DCHECK(IsUint<5>(uimm));
+  EmitI((~0U << 10 | vtypei), uimm, enum_cast<uint32_t>(VAIEncoding::kOPCFG), rd, 0x57);
+}
+
+void Riscv64Assembler::VSetvl(XRegister rd, XRegister rs1, XRegister rs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  EmitR(0x40, rs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPCFG), rd, 0x57);
+}
+
+/////////////////////////////// RVV "VSet" Instructions  END //////////////////////////////
+
+/////////////////////////////// RVV Load/Store Instructions  START ////////////////////////////
+
+void Riscv64Assembler::VLe8(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLe16(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLe32(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLe64(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VSe8(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSe16(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSe32(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSe64(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VLm(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01011, rs1, enum_cast<uint32_t>(VectorWidth::kMask), vd, 0x7);
+}
+
+void Riscv64Assembler::VSm(VRegister vs3, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01011, rs1, enum_cast<uint32_t>(VectorWidth::kMask), vs3, 0x27);
+}
+
+void Riscv64Assembler::VLe8ff(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b10000, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLe16ff(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b10000, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLe32ff(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b10000, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLe64ff(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b10000, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLse8(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLse16(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLse32(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLse64(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VSse8(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSse16(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSse32(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSse64(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VLoxei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VSoxei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VLseg2e8(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg2e16(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg2e32(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg2e64(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg3e8(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg3e16(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg3e32(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg3e64(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg4e8(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg4e16(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg4e32(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg4e64(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg5e8(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg5e16(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg5e32(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg5e64(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg6e8(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg6e16(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg6e32(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg6e64(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg7e8(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg7e16(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg7e32(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg7e64(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg8e8(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg8e16(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg8e32(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg8e64(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VSseg2e8(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg2e16(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg2e32(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg2e64(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg3e8(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg3e16(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg3e32(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg3e64(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg4e8(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg4e16(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg4e32(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg4e64(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg5e8(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg5e16(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg5e32(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg5e64(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg6e8(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg6e16(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg6e32(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg6e64(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg7e8(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg7e16(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg7e32(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg7e64(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg8e8(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg8e16(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg8e32(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSseg8e64(VRegister vs3, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b00000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VLseg2e8ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg2e16ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg2e32ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg2e64ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg3e8ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg3e16ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg3e32ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg3e64ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg4e8ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg4e16ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg4e32ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg4e64ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg5e8ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg5e16ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg5e32ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg5e64ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg6e8ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg6e16ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg6e32ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg6e64ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg7e8ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg7e16ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg7e32ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg7e64ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg8e8ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg8e16ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg8e32ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLseg8e64ff(VRegister vd, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, vm);
+  EmitR(funct7, 0b10000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg2e8(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg2e16(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg2e32(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg2e64(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg3e8(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg3e16(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg3e32(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg3e64(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg4e8(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg4e16(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg4e32(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg4e64(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg5e8(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg5e16(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg5e32(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg5e64(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg6e8(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg6e16(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg6e32(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg6e64(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg7e8(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg7e16(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg7e32(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg7e64(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg8e8(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg8e16(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg8e32(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLsseg8e64(VRegister vd, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VSsseg2e8(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg2e16(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg2e32(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg2e64(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg3e8(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg3e16(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg3e32(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg3e64(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg4e8(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg4e16(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg4e32(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg4e64(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg5e8(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg5e16(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg5e32(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg5e64(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg6e8(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg6e16(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg6e32(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg6e64(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg7e8(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg7e16(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg7e32(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg7e64(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg8e8(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg8e16(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg8e32(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSsseg8e64(VRegister vs3, XRegister rs1, XRegister rs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kStrided, vm);
+  EmitR(funct7, rs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VLuxseg2ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg2ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg2ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg2ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg3ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg3ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg3ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg3ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg4ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg4ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg4ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg4ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg5ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg5ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg5ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg5ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg6ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg6ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg6ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg6ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg7ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg7ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg7ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg7ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg8ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg8ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg8ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLuxseg8ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VSuxseg2ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg2ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg2ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg2ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg3ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg3ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg3ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg3ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg4ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg4ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg4ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg4ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg5ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg5ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg5ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg5ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg6ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg6ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg6ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg6ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg7ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg7ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg7ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg7ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg8ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg8ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg8ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSuxseg8ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kIndexedUnordered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VLoxseg2ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg2ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg2ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg2ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg3ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg3ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg3ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg3ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg4ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg4ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg4ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg4ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg5ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg5ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg5ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg5ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg6ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg6ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg6ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg6ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg7ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg7ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg7ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg7ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg8ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg8ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg8ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VLoxseg8ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VSoxseg2ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg2ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg2ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg2ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg3ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg3ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg3ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg3ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k3, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg4ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg4ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg4ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg4ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg5ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg5ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg5ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg5ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k5, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg6ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg6ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg6ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg6ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k6, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg7ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg7ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg7ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg7ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k7, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg8ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k8), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg8ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k16), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg8ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k32), vs3, 0x27);
+}
+
+void Riscv64Assembler::VSoxseg8ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kIndexedOrdered, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VectorWidth::k64), vs3, 0x27);
+}
+
+void Riscv64Assembler::VL1re8(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VL1re16(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VL1re32(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VL1re64(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VL2re8(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_EQ((enum_cast<uint32_t>(vd) % 2), 0U);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VL2re16(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_EQ((enum_cast<uint32_t>(vd) % 2), 0U);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VL2re32(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_EQ((enum_cast<uint32_t>(vd) % 2), 0U);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VL2re64(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_EQ((enum_cast<uint32_t>(vd) % 2), 0U);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VL4re8(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_EQ((enum_cast<uint32_t>(vd) % 4), 0U);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VL4re16(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_EQ((enum_cast<uint32_t>(vd) % 4), 0U);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VL4re32(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_EQ((enum_cast<uint32_t>(vd) % 4), 0U);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VL4re64(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_EQ((enum_cast<uint32_t>(vd) % 4), 0U);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VL8re8(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_EQ((enum_cast<uint32_t>(vd) % 8), 0U);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::k8), vd, 0x7);
+}
+
+void Riscv64Assembler::VL8re16(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_EQ((enum_cast<uint32_t>(vd) % 8), 0U);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::k16), vd, 0x7);
+}
+
+void Riscv64Assembler::VL8re32(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_EQ((enum_cast<uint32_t>(vd) % 8), 0U);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::k32), vd, 0x7);
+}
+
+void Riscv64Assembler::VL8re64(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  DCHECK_EQ((enum_cast<uint32_t>(vd) % 8), 0U);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::k64), vd, 0x7);
+}
+
+void Riscv64Assembler::VL1r(VRegister vd, XRegister rs1) { VL1re8(vd, rs1); }
+
+void Riscv64Assembler::VL2r(VRegister vd, XRegister rs1) { VL2re8(vd, rs1); }
+
+void Riscv64Assembler::VL4r(VRegister vd, XRegister rs1) { VL4re8(vd, rs1); }
+
+void Riscv64Assembler::VL8r(VRegister vd, XRegister rs1) { VL8re8(vd, rs1); }
+
+void Riscv64Assembler::VS1r(VRegister vs3, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k1, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::kWholeR), vs3, 0x27);
+}
+
+void Riscv64Assembler::VS2r(VRegister vs3, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k2, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::kWholeR), vs3, 0x27);
+}
+
+void Riscv64Assembler::VS4r(VRegister vs3, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k4, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::kWholeR), vs3, 0x27);
+}
+
+void Riscv64Assembler::VS8r(VRegister vs3, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kLoadStore, Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVMemF7(Nf::k8, 0x0, MemAddressMode::kUnitStride, VM::kUnmasked);
+  EmitR(funct7, 0b01000u, rs1, enum_cast<uint32_t>(VectorWidth::kWholeR), vs3, 0x27);
+}
+
+/////////////////////////////// RVV Load/Store Instructions  END //////////////////////////////
+
+/////////////////////////////// RVV Arithmetic Instructions  START ////////////////////////////
+
+void Riscv64Assembler::VAdd_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VAdd_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000000, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VAdd_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000000, vm);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VSub_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000010, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VSub_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000010, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VRsub_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000011, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VRsub_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000011, vm);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VNeg_v(VRegister vd, VRegister vs2) { VRsub_vx(vd, vs2, Zero); }
+
+void Riscv64Assembler::VMinu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000100, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMinu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000100, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMin_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000101, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMin_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000101, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMaxu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000110, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMaxu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000110, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMax_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000111, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMax_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000111, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VAnd_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001001, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VAnd_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001001, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VAnd_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001001, vm);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VOr_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001010, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VOr_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b001010, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VOr_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001010, vm);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VXor_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001011, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VXor_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001011, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VXor_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001011, vm);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VNot_v(VRegister vd, VRegister vs2, VM vm) { VXor_vi(vd, vs2, -1, vm); }
+
+void Riscv64Assembler::VRgather_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b001100, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VRgather_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b001100, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VRgather_vi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b001100, vm);
+  EmitR(funct7, vs2, uimm5, enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VSlideup_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b001110, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VSlideup_vi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b001110, vm);
+  EmitR(funct7, vs2, uimm5, enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VRgatherei16_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b001110, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VSlidedown_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b001111, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VSlidedown_vi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001111, vm);
+  EmitR(funct7, vs2, uimm5, enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VAdc_vvm(VRegister vd, VRegister vs2, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK(vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010000, VM::kV0_t);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VAdc_vxm(VRegister vd, VRegister vs2, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK(vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010000, VM::kV0_t);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VAdc_vim(VRegister vd, VRegister vs2, int32_t imm5) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK(vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010000, VM::kV0_t);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VMadc_vvm(VRegister vd, VRegister vs2, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010001, VM::kV0_t);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMadc_vxm(VRegister vd, VRegister vs2, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010001, VM::kV0_t);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMadc_vim(VRegister vd, VRegister vs2, int32_t imm5) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010001, VM::kV0_t);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VMadc_vv(VRegister vd, VRegister vs2, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010001, VM::kUnmasked);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMadc_vx(VRegister vd, VRegister vs2, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010001, VM::kUnmasked);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMadc_vi(VRegister vd, VRegister vs2, int32_t imm5) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010001, VM::kUnmasked);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VSbc_vvm(VRegister vd, VRegister vs2, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK(vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, VM::kV0_t);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VSbc_vxm(VRegister vd, VRegister vs2, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK(vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, VM::kV0_t);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsbc_vvm(VRegister vd, VRegister vs2, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010011, VM::kV0_t);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsbc_vxm(VRegister vd, VRegister vs2, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010011, VM::kV0_t);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsbc_vv(VRegister vd, VRegister vs2, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010011, VM::kUnmasked);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsbc_vx(VRegister vd, VRegister vs2, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010011, VM::kUnmasked);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMerge_vvm(VRegister vd, VRegister vs2, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK(vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010111, VM::kV0_t);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMerge_vxm(VRegister vd, VRegister vs2, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK(vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010111, VM::kV0_t);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMerge_vim(VRegister vd, VRegister vs2, int32_t imm5) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK(vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010111, VM::kV0_t);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VMv_vv(VRegister vd, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010111, VM::kUnmasked);
+  EmitR(funct7, V0, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMv_vx(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010111, VM::kUnmasked);
+  EmitR(funct7, V0, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMv_vi(VRegister vd, int32_t imm5) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010111, VM::kUnmasked);
+  EmitR(funct7, V0, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VMseq_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMseq_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011000, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMseq_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011000, vm);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsne_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011001, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsne_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011001, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsne_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011001, vm);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsltu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011010, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsltu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011010, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsgtu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  VMsltu_vv(vd, vs1, vs2, vm);
+}
+
+void Riscv64Assembler::VMslt_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011011, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMslt_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011011, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsgt_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  VMslt_vv(vd, vs1, vs2, vm);
+}
+
+void Riscv64Assembler::VMsleu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011100, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsleu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011100, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsleu_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011100, vm);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsgeu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  VMsleu_vv(vd, vs1, vs2, vm);
+}
+
+void Riscv64Assembler::VMsltu_vi(VRegister vd, VRegister vs2, int32_t aimm5, VM vm) {
+  CHECK(IsUint<4>(aimm5 - 1)) << "Should be between [1, 16]" << aimm5;
+  VMsleu_vi(vd, vs2, aimm5 - 1, vm);
+}
+
+void Riscv64Assembler::VMsle_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011101, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsle_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011101, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsle_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011101, vm);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsge_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  VMsle_vv(vd, vs1, vs2, vm);
+}
+
+void Riscv64Assembler::VMslt_vi(VRegister vd, VRegister vs2, int32_t aimm5, VM vm) {
+  VMsle_vi(vd, vs2, aimm5 - 1, vm);
+}
+
+void Riscv64Assembler::VMsgtu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011110, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsgtu_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011110, vm);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsgeu_vi(VRegister vd, VRegister vs2, int32_t aimm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  CHECK(IsUint<4>(aimm5 - 1)) << "Should be between [1, 16]" << aimm5;
+  VMsgtu_vi(vd, vs2, aimm5 - 1, vm);
+}
+
+void Riscv64Assembler::VMsgt_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011111, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsgt_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011111, vm);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsge_vi(VRegister vd, VRegister vs2, int32_t aimm5, VM vm) {
+  VMsgt_vi(vd, vs2, aimm5 - 1, vm);
+}
+
+void Riscv64Assembler::VSaddu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VSaddu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100000, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VSaddu_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100000, vm);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VSadd_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100001, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VSadd_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100001, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VSadd_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100001, vm);
+  EmitR(funct7, vs2, EncodeInt5(imm5), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VSsubu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100010, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VSsubu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100010, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VSsub_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100011, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VSsub_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100011, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VSll_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100101, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VSll_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100101, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VSll_vi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100101, vm);
+  EmitR(funct7, vs2, uimm5, enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VSmul_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100111, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VSmul_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100111, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::Vmv1r_v(VRegister vd, VRegister vs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b100111, VM::kUnmasked);
+  EmitR(
+      funct7, vs2, enum_cast<uint32_t>(Nf::k1), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::Vmv2r_v(VRegister vd, VRegister vs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_EQ(enum_cast<uint32_t>(vd) % 2, 0u);
+  DCHECK_EQ(enum_cast<uint32_t>(vs2) % 2, 0u);
+  const uint32_t funct7 = EncodeRVVF7(0b100111, VM::kUnmasked);
+  EmitR(
+      funct7, vs2, enum_cast<uint32_t>(Nf::k2), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::Vmv4r_v(VRegister vd, VRegister vs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_EQ(enum_cast<uint32_t>(vd) % 4, 0u);
+  DCHECK_EQ(enum_cast<uint32_t>(vs2) % 4, 0u);
+  const uint32_t funct7 = EncodeRVVF7(0b100111, VM::kUnmasked);
+  EmitR(
+      funct7, vs2, enum_cast<uint32_t>(Nf::k4), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::Vmv8r_v(VRegister vd, VRegister vs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_EQ(enum_cast<uint32_t>(vd) % 8, 0u);
+  DCHECK_EQ(enum_cast<uint32_t>(vs2) % 8, 0u);
+  const uint32_t funct7 = EncodeRVVF7(0b100111, VM::kUnmasked);
+  EmitR(
+      funct7, vs2, enum_cast<uint32_t>(Nf::k8), enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VSrl_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VSrl_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101000, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VSrl_vi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101000, vm);
+  EmitR(funct7, vs2, uimm5, enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VSra_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101001, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VSra_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101001, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VSra_vi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101001, vm);
+  EmitR(funct7, vs2, uimm5, enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VSsrl_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101010, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VSsrl_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101010, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VSsrl_vi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101010, vm);
+  EmitR(funct7, vs2, uimm5, enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VSsra_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101011, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VSsra_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101011, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VSsra_vi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101011, vm);
+  EmitR(funct7, vs2, uimm5, enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VNsrl_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101100, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VNsrl_wx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101100, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VNsrl_wi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101100, vm);
+  EmitR(funct7, vs2, uimm5, enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VNcvt_x_x_w(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  VNsrl_wx(vd, vs2, Zero, vm);
+}
+
+void Riscv64Assembler::VNsra_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101101, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VNsra_wx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101101, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VNsra_wi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101101, vm);
+  EmitR(funct7, vs2, uimm5, enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VNclipu_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101110, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VNclipu_wx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101110, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VNclipu_wi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101110, vm);
+  EmitR(funct7, vs2, uimm5, enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VNclip_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101111, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VNclip_wx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101111, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPIVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VNclip_wi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101111, vm);
+  EmitR(funct7, vs2, uimm5, enum_cast<uint32_t>(VAIEncoding::kOPIVI), vd, 0x57);
+}
+
+void Riscv64Assembler::VWredsumu_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b110000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VWredsum_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b110001, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPIVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VRedsum_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b000000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VRedand_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b000001, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VRedor_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b000010, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VRedxor_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b000011, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VRedminu_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b000100, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VRedmin_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b000101, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VRedmaxu_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b000110, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VRedmax_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b000111, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VAaddu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VAaddu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001000, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VAadd_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001001, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VAadd_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001001, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VAsubu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001010, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VAsubu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001010, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VAsub_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001011, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VAsub_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001011, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VSlide1up_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b001110, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VSlide1down_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001111, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VCompress_vm(VRegister vd, VRegister vs2, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b010111, VM::kUnmasked);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMandn_mm(VRegister vd, VRegister vs2, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b011000, VM::kUnmasked);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMand_mm(VRegister vd, VRegister vs2, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b011001, VM::kUnmasked);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMmv_m(VRegister vd, VRegister vs2) { VMand_mm(vd, vs2, vs2); }
+
+void Riscv64Assembler::VMor_mm(VRegister vd, VRegister vs2, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b011010, VM::kUnmasked);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMxor_mm(VRegister vd, VRegister vs2, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b011011, VM::kUnmasked);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMclr_m(VRegister vd) { VMxor_mm(vd, vd, vd); }
+
+void Riscv64Assembler::VMorn_mm(VRegister vd, VRegister vs2, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b011100, VM::kUnmasked);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMnand_mm(VRegister vd, VRegister vs2, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b011101, VM::kUnmasked);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMnot_m(VRegister vd, VRegister vs2) { VMnand_mm(vd, vs2, vs2); }
+
+void Riscv64Assembler::VMnor_mm(VRegister vd, VRegister vs2, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b011110, VM::kUnmasked);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMxnor_mm(VRegister vd, VRegister vs2, VRegister vs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b011111, VM::kUnmasked);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMset_m(VRegister vd) { VMxnor_mm(vd, vd, vd); }
+
+void Riscv64Assembler::VDivu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VDivu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100000, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VDiv_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100001, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VDiv_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100001, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VRemu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100010, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VRemu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100010, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VRem_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100011, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VRem_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100011, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMulhu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100100, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMulhu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100100, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMul_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100101, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMul_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100101, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMulhsu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100110, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMulhsu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100110, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMulh_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100111, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMulh_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100111, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMadd_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101001, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMadd_vx(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101001, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VNmsub_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101011, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VNmsub_vx(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101011, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMacc_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101101, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMacc_vx(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101101, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VNmsac_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b101111, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VNmsac_vx(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101111, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VWaddu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b110000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VWaddu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b110000, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VWcvtu_x_x_v(VRegister vd, VRegister vs, VM vm) {
+  VWaddu_vx(vd, vs, Zero, vm);
+}
+
+void Riscv64Assembler::VWadd_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b110001, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VWadd_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b110001, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VWcvt_x_x_v(VRegister vd, VRegister vs, VM vm) {
+  VWadd_vx(vd, vs, Zero, vm);
+}
+
+void Riscv64Assembler::VWsubu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b110010, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VWsubu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b110010, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VWsub_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b110011, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VWsub_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b110011, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VWaddu_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  const uint32_t funct7 = EncodeRVVF7(0b110100, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VWaddu_wx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b110100, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VWadd_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  const uint32_t funct7 = EncodeRVVF7(0b110101, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VWadd_wx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b110101, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VWsubu_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  const uint32_t funct7 = EncodeRVVF7(0b110110, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VWsubu_wx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b110110, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VWsub_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  const uint32_t funct7 = EncodeRVVF7(0b110111, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VWsub_wx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b110111, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VWmulu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VWmulu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111000, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VWmulsu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111010, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VWmulsu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111010, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VWmul_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111011, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VWmul_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111011, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VWmaccu_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111100, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VWmaccu_vx(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111100, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VWmacc_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111101, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VWmacc_vx(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111101, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VWmaccus_vx(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111110, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VWmaccsu_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111111, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VWmaccsu_vx(VRegister vd, XRegister rs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111111, vm);
+  EmitR(funct7, vs2, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VFadd_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFadd_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000000, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFredusum_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b000001, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFsub_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000010, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFsub_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000010, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFredosum_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b000011, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmin_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000100, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmin_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000100, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFredmin_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b000101, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmax_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000110, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmax_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b000110, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFredmax_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b000111, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFsgnj_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFsgnj_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001000, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFsgnjn_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001001, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFsgnjn_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001001, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFneg_v(VRegister vd, VRegister vs) { VFsgnjn_vv(vd, vs, vs); }
+
+void Riscv64Assembler::VFsgnjx_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001010, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFsgnjx_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001010, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFabs_v(VRegister vd, VRegister vs) { VFsgnjx_vv(vd, vs, vs); }
+
+void Riscv64Assembler::VFslide1up_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b001110, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFslide1down_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b001111, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmerge_vfm(VRegister vd, VRegister vs2, FRegister fs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK(vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010111, VM::kV0_t);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmv_v_f(VRegister vd, FRegister fs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010111, VM::kUnmasked);
+  EmitR(funct7, V0, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VMfeq_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMfeq_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011000, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VMfle_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011001, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMfle_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011001, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VMfge_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  VMfle_vv(vd, vs1, vs2, vm);
+}
+
+void Riscv64Assembler::VMflt_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011011, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMflt_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011011, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VMfgt_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  VMflt_vv(vd, vs1, vs2, vm);
+}
+
+void Riscv64Assembler::VMfne_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011100, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMfne_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011100, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VMfgt_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011101, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VMfge_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b011111, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFdiv_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b100000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFdiv_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100000, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFrdiv_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100001, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmul_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100100, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmul_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100100, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFrsub_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b100111, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmadd_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmadd_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101000, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFnmadd_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101001, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFnmadd_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101001, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmsub_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101010, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmsub_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101010, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFnmsub_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101011, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFnmsub_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101011, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmacc_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101100, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmacc_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101100, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFnmacc_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101101, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFnmacc_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101101, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmsac_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101110, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmsac_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101110, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFnmsac_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101111, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFnmsac_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b101111, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwadd_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b110000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwadd_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b110000, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwredusum_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b110001, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwsub_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b110010, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwsub_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b110010, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwredosum_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b110011, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwadd_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  const uint32_t funct7 = EncodeRVVF7(0b110100, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwadd_wf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b110100, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwsub_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  const uint32_t funct7 = EncodeRVVF7(0b110110, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwsub_wf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b110110, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwmul_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111000, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwmul_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111000, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwmacc_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111100, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwmacc_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111100, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwnmacc_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111101, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwnmacc_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111101, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwmsac_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111110, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwmsac_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111110, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwnmsac_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs1);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111111, vm);
+  EmitR(funct7, vs2, vs1, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwnmsac_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b111111, vm);
+  EmitR(funct7, vs2, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VMv_s_x(VRegister vd, XRegister rs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010000, VM::kUnmasked);
+  EmitR(funct7, 0b00000, rs1, enum_cast<uint32_t>(VAIEncoding::kOPMVX), vd, 0x57);
+}
+
+void Riscv64Assembler::VMv_x_s(XRegister rd, VRegister vs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010000, VM::kUnmasked);
+  EmitR(funct7, vs2, 0b00000, enum_cast<uint32_t>(VAIEncoding::kOPMVV), rd, 0x57);
+}
+
+void Riscv64Assembler::VCpop_m(XRegister rd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010000, vm);
+  EmitR(funct7, vs2, 0b10000, enum_cast<uint32_t>(VAIEncoding::kOPMVV), rd, 0x57);
+}
+
+void Riscv64Assembler::VFirst_m(XRegister rd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010000, vm);
+  EmitR(funct7, vs2, 0b10001, enum_cast<uint32_t>(VAIEncoding::kOPMVV), rd, 0x57);
+}
+
+void Riscv64Assembler::VZext_vf8(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b00010, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VSext_vf8(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b00011, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VZext_vf4(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b00100, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VSext_vf4(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b00101, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VZext_vf2(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b00110, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VSext_vf2(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b00111, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmv_s_f(VRegister vd, FRegister fs1) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010000, VM::kUnmasked);
+  EmitR(funct7, 0b00000, fs1, enum_cast<uint32_t>(VAIEncoding::kOPFVF), vd, 0x57);
+}
+
+void Riscv64Assembler::VFmv_f_s(FRegister fd, VRegister vs2) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  const uint32_t funct7 = EncodeRVVF7(0b010000, VM::kUnmasked);
+  EmitR(funct7, vs2, 0b00000, enum_cast<uint32_t>(VAIEncoding::kOPFVV), fd, 0x57);
+}
+
+void Riscv64Assembler::VFcvt_xu_f_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b00000, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFcvt_x_f_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b00001, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFcvt_f_xu_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b00010, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFcvt_f_x_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b00011, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFcvt_rtz_xu_f_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b00110, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFcvt_rtz_x_f_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b00111, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwcvt_xu_f_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b01000, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwcvt_x_f_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b01001, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwcvt_f_xu_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b01010, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwcvt_f_x_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b01011, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwcvt_f_f_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b01100, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwcvt_rtz_xu_f_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b01110, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFwcvt_rtz_x_f_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b01111, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFncvt_xu_f_w(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b10000, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFncvt_x_f_w(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b10001, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFncvt_f_xu_w(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b10010, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFncvt_f_x_w(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b10011, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFncvt_f_f_w(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b10100, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFncvt_rod_f_f_w(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b10101, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFncvt_rtz_xu_f_w(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b10110, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFncvt_rtz_x_f_w(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010010, vm);
+  EmitR(funct7, vs2, 0b10111, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFsqrt_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010011, vm);
+  EmitR(funct7, vs2, 0b00000, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFrsqrt7_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010011, vm);
+  EmitR(funct7, vs2, 0b00100, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFrec7_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010011, vm);
+  EmitR(funct7, vs2, 0b00101, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VFclass_v(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010011, vm);
+  EmitR(funct7, vs2, 0b10000, enum_cast<uint32_t>(VAIEncoding::kOPFVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsbf_m(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b010100, vm);
+  EmitR(funct7, vs2, 0b00001, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsof_m(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b010100, vm);
+  EmitR(funct7, vs2, 0b00010, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VMsif_m(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b010100, vm);
+  EmitR(funct7, vs2, 0b00011, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VIota_m(VRegister vd, VRegister vs2, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  DCHECK(vd != vs2);
+  const uint32_t funct7 = EncodeRVVF7(0b010100, vm);
+  EmitR(funct7, vs2, 0b10000, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+void Riscv64Assembler::VId_v(VRegister vd, VM vm) {
+  AssertExtensionsEnabled(Riscv64Extension::kV);
+  DCHECK_IMPLIES(vm == VM::kV0_t, vd != V0);
+  const uint32_t funct7 = EncodeRVVF7(0b010100, vm);
+  EmitR(funct7, V0, 0b10001, enum_cast<uint32_t>(VAIEncoding::kOPMVV), vd, 0x57);
+}
+
+/////////////////////////////// RVV Arithmetic Instructions  END   /////////////////////////////
+
+////////////////////////////// RV64 MACRO Instructions  START ///////////////////////////////
+
+// Pseudo instructions
+
+void Riscv64Assembler::Nop() { Addi(Zero, Zero, 0); }
+
+void Riscv64Assembler::Li(XRegister rd, int64_t imm) {
+  LoadImmediate(rd, imm, /*can_use_tmp=*/ false);
+}
+
+void Riscv64Assembler::Mv(XRegister rd, XRegister rs) { Addi(rd, rs, 0); }
+
+void Riscv64Assembler::Not(XRegister rd, XRegister rs) { Xori(rd, rs, -1); }
+
+void Riscv64Assembler::Neg(XRegister rd, XRegister rs) { Sub(rd, Zero, rs); }
+
+void Riscv64Assembler::NegW(XRegister rd, XRegister rs) { Subw(rd, Zero, rs); }
+
+void Riscv64Assembler::SextB(XRegister rd, XRegister rs) {
+  if (IsExtensionEnabled(Riscv64Extension::kZbb)) {
+    if (IsExtensionEnabled(Riscv64Extension::kZcb) && rd == rs && IsShortReg(rd)) {
+      CSextB(rd);
+    } else {
+      ZbbSextB(rd, rs);
+    }
+  } else {
+    Slli(rd, rs, kXlen - 8u);
+    Srai(rd, rd, kXlen - 8u);
+  }
+}
+
+void Riscv64Assembler::SextH(XRegister rd, XRegister rs) {
+  if (IsExtensionEnabled(Riscv64Extension::kZbb)) {
+    if (IsExtensionEnabled(Riscv64Extension::kZcb) && rd == rs && IsShortReg(rd)) {
+      CSextH(rd);
+    } else {
+      ZbbSextH(rd, rs);
+    }
+  } else {
+    Slli(rd, rs, kXlen - 16u);
+    Srai(rd, rd, kXlen - 16u);
+  }
+}
+
+void Riscv64Assembler::SextW(XRegister rd, XRegister rs) {
+  if (IsExtensionEnabled(Riscv64Extension::kZca) && rd != Zero && (rd == rs || rs == Zero)) {
+    if (rd == rs) {
+      CAddiw(rd, 0);
+    } else {
+      CLi(rd, 0);
+    }
+  } else {
+    Addiw(rd, rs, 0);
+  }
+}
+
+void Riscv64Assembler::ZextB(XRegister rd, XRegister rs) {
+  if (IsExtensionEnabled(Riscv64Extension::kZcb) && rd == rs && IsShortReg(rd)) {
+    CZextB(rd);
+  } else {
+    Andi(rd, rs, 0xff);
+  }
+}
+
+void Riscv64Assembler::ZextH(XRegister rd, XRegister rs) {
+  if (IsExtensionEnabled(Riscv64Extension::kZbb)) {
+    if (IsExtensionEnabled(Riscv64Extension::kZcb) && rd == rs && IsShortReg(rd)) {
+      CZextH(rd);
+    } else {
+      ZbbZextH(rd, rs);
+    }
+  } else {
+    Slli(rd, rs, kXlen - 16u);
+    Srli(rd, rd, kXlen - 16u);
+  }
+}
+
+void Riscv64Assembler::ZextW(XRegister rd, XRegister rs) {
+  if (IsExtensionEnabled(Riscv64Extension::kZba)) {
+    if (IsExtensionEnabled(Riscv64Extension::kZcb) && rd == rs && IsShortReg(rd)) {
+      CZextW(rd);
+    } else {
+      AddUw(rd, rs, Zero);
+    }
+  } else {
+    Slli(rd, rs, kXlen - 32u);
+    Srli(rd, rd, kXlen - 32u);
+  }
+}
+
+void Riscv64Assembler::Seqz(XRegister rd, XRegister rs) { Sltiu(rd, rs, 1); }
+
+void Riscv64Assembler::Snez(XRegister rd, XRegister rs) { Sltu(rd, Zero, rs); }
+
+void Riscv64Assembler::Sltz(XRegister rd, XRegister rs) { Slt(rd, rs, Zero); }
+
+void Riscv64Assembler::Sgtz(XRegister rd, XRegister rs) { Slt(rd, Zero, rs); }
+
+void Riscv64Assembler::FMvS(FRegister rd, FRegister rs) { FSgnjS(rd, rs, rs); }
+
+void Riscv64Assembler::FAbsS(FRegister rd, FRegister rs) { FSgnjxS(rd, rs, rs); }
+
+void Riscv64Assembler::FNegS(FRegister rd, FRegister rs) { FSgnjnS(rd, rs, rs); }
+
+void Riscv64Assembler::FMvD(FRegister rd, FRegister rs) { FSgnjD(rd, rs, rs); }
+
+void Riscv64Assembler::FAbsD(FRegister rd, FRegister rs) { FSgnjxD(rd, rs, rs); }
+
+void Riscv64Assembler::FNegD(FRegister rd, FRegister rs) { FSgnjnD(rd, rs, rs); }
+
+void Riscv64Assembler::Beqz(XRegister rs, int32_t offset) {
+  Beq(rs, Zero, offset);
+}
+
+void Riscv64Assembler::Bnez(XRegister rs, int32_t offset) {
+  Bne(rs, Zero, offset);
+}
+
+void Riscv64Assembler::Blez(XRegister rt, int32_t offset) {
+  Bge(Zero, rt, offset);
+}
+
+void Riscv64Assembler::Bgez(XRegister rt, int32_t offset) {
+  Bge(rt, Zero, offset);
+}
+
+void Riscv64Assembler::Bltz(XRegister rt, int32_t offset) {
+  Blt(rt, Zero, offset);
+}
+
+void Riscv64Assembler::Bgtz(XRegister rt, int32_t offset) {
+  Blt(Zero, rt, offset);
+}
+
+void Riscv64Assembler::Bgt(XRegister rs, XRegister rt, int32_t offset) {
+  Blt(rt, rs, offset);
+}
+
+void Riscv64Assembler::Ble(XRegister rs, XRegister rt, int32_t offset) {
+  Bge(rt, rs, offset);
+}
+
+void Riscv64Assembler::Bgtu(XRegister rs, XRegister rt, int32_t offset) {
+  Bltu(rt, rs, offset);
+}
+
+void Riscv64Assembler::Bleu(XRegister rs, XRegister rt, int32_t offset) {
+  Bgeu(rt, rs, offset);
+}
+
+void Riscv64Assembler::J(int32_t offset) { Jal(Zero, offset); }
+
+void Riscv64Assembler::Jal(int32_t offset) { Jal(RA, offset); }
+
+void Riscv64Assembler::Jr(XRegister rs) { Jalr(Zero, rs, 0); }
+
+void Riscv64Assembler::Jalr(XRegister rs) { Jalr(RA, rs, 0); }
+
+void Riscv64Assembler::Jalr(XRegister rd, XRegister rs) { Jalr(rd, rs, 0); }
+
+void Riscv64Assembler::Ret() { Jalr(Zero, RA, 0); }
+
+void Riscv64Assembler::RdCycle(XRegister rd) {
+  Csrrs(rd, 0xc00, Zero);
+}
+
+void Riscv64Assembler::RdTime(XRegister rd) {
+  Csrrs(rd, 0xc01, Zero);
+}
+
+void Riscv64Assembler::RdInstret(XRegister rd) {
+  Csrrs(rd, 0xc02, Zero);
+}
+
+void Riscv64Assembler::Csrr(XRegister rd, uint32_t csr) {
+  Csrrs(rd, csr, Zero);
+}
+
+void Riscv64Assembler::Csrw(uint32_t csr, XRegister rs) {
+  Csrrw(Zero, csr, rs);
+}
+
+void Riscv64Assembler::Csrs(uint32_t csr, XRegister rs) {
+  Csrrs(Zero, csr, rs);
+}
+
+void Riscv64Assembler::Csrc(uint32_t csr, XRegister rs) {
+  Csrrc(Zero, csr, rs);
+}
+
+void Riscv64Assembler::Csrwi(uint32_t csr, uint32_t uimm5) {
+  Csrrwi(Zero, csr, uimm5);
+}
+
+void Riscv64Assembler::Csrsi(uint32_t csr, uint32_t uimm5) {
+  Csrrsi(Zero, csr, uimm5);
+}
+
+void Riscv64Assembler::Csrci(uint32_t csr, uint32_t uimm5) {
+  Csrrci(Zero, csr, uimm5);
+}
+
+void Riscv64Assembler::Loadb(XRegister rd, XRegister rs1, int32_t offset) {
+  LoadFromOffset<&Riscv64Assembler::Lb>(rd, rs1, offset);
+}
+
+void Riscv64Assembler::Loadh(XRegister rd, XRegister rs1, int32_t offset) {
+  LoadFromOffset<&Riscv64Assembler::Lh>(rd, rs1, offset);
+}
+
+void Riscv64Assembler::Loadw(XRegister rd, XRegister rs1, int32_t offset) {
+  LoadFromOffset<&Riscv64Assembler::Lw>(rd, rs1, offset);
+}
+
+void Riscv64Assembler::Loadd(XRegister rd, XRegister rs1, int32_t offset) {
+  LoadFromOffset<&Riscv64Assembler::Ld>(rd, rs1, offset);
+}
+
+void Riscv64Assembler::Loadbu(XRegister rd, XRegister rs1, int32_t offset) {
+  LoadFromOffset<&Riscv64Assembler::Lbu>(rd, rs1, offset);
+}
+
+void Riscv64Assembler::Loadhu(XRegister rd, XRegister rs1, int32_t offset) {
+  LoadFromOffset<&Riscv64Assembler::Lhu>(rd, rs1, offset);
+}
+
+void Riscv64Assembler::Loadwu(XRegister rd, XRegister rs1, int32_t offset) {
+  LoadFromOffset<&Riscv64Assembler::Lwu>(rd, rs1, offset);
+}
+
+void Riscv64Assembler::Storeb(XRegister rs2, XRegister rs1, int32_t offset) {
+  StoreToOffset<&Riscv64Assembler::Sb>(rs2, rs1, offset);
+}
+
+void Riscv64Assembler::Storeh(XRegister rs2, XRegister rs1, int32_t offset) {
+  StoreToOffset<&Riscv64Assembler::Sh>(rs2, rs1, offset);
+}
+
+void Riscv64Assembler::Storew(XRegister rs2, XRegister rs1, int32_t offset) {
+  StoreToOffset<&Riscv64Assembler::Sw>(rs2, rs1, offset);
+}
+
+void Riscv64Assembler::Stored(XRegister rs2, XRegister rs1, int32_t offset) {
+  StoreToOffset<&Riscv64Assembler::Sd>(rs2, rs1, offset);
+}
+
+void Riscv64Assembler::FLoadw(FRegister rd, XRegister rs1, int32_t offset) {
+  FLoadFromOffset<&Riscv64Assembler::FLw>(rd, rs1, offset);
+}
+
+void Riscv64Assembler::FLoadd(FRegister rd, XRegister rs1, int32_t offset) {
+  FLoadFromOffset<&Riscv64Assembler::FLd>(rd, rs1, offset);
+}
+
+void Riscv64Assembler::FStorew(FRegister rs2, XRegister rs1, int32_t offset) {
+  FStoreToOffset<&Riscv64Assembler::FSw>(rs2, rs1, offset);
+}
+
+void Riscv64Assembler::FStored(FRegister rs2, XRegister rs1, int32_t offset) {
+  FStoreToOffset<&Riscv64Assembler::FSd>(rs2, rs1, offset);
+}
+
+void Riscv64Assembler::LoadConst32(XRegister rd, int32_t value) {
+  // No need to use a temporary register for 32-bit values.
+  LoadImmediate(rd, value, /*can_use_tmp=*/ false);
+}
+
+void Riscv64Assembler::LoadConst64(XRegister rd, int64_t value) {
+  LoadImmediate(rd, value, /*can_use_tmp=*/ true);
+}
+
+template <typename ValueType, typename Addi, typename AddLarge>
+void AddConstImpl(Riscv64Assembler* assembler,
+                  XRegister rd,
+                  XRegister rs1,
+                  ValueType value,
+                  Addi&& addi,
+                  AddLarge&& add_large) {
+  ScratchRegisterScope srs(assembler);
+  // A temporary must be available for adjustment even if it's not needed.
+  // However, `rd` can be used as the temporary unless it's the same as `rs1` or SP.
+  DCHECK_IMPLIES(rd == rs1 || rd == SP, srs.AvailableXRegisters() != 0u);
+
+  if (IsInt<12>(value)) {
+    addi(rd, rs1, value);
+    return;
+  }
+
+  constexpr int32_t kPositiveValueSimpleAdjustment = 0x7ff;
+  constexpr int32_t kHighestValueForSimpleAdjustment = 2 * kPositiveValueSimpleAdjustment;
+  constexpr int32_t kNegativeValueSimpleAdjustment = -0x800;
+  constexpr int32_t kLowestValueForSimpleAdjustment = 2 * kNegativeValueSimpleAdjustment;
+
+  if (rd != rs1 && rd != SP) {
+    srs.IncludeXRegister(rd);
+  }
+  XRegister tmp = srs.AllocateXRegister();
+  if (value >= 0 && value <= kHighestValueForSimpleAdjustment) {
+    addi(tmp, rs1, kPositiveValueSimpleAdjustment);
+    addi(rd, tmp, value - kPositiveValueSimpleAdjustment);
+  } else if (value < 0 && value >= kLowestValueForSimpleAdjustment) {
+    addi(tmp, rs1, kNegativeValueSimpleAdjustment);
+    addi(rd, tmp, value - kNegativeValueSimpleAdjustment);
+  } else {
+    add_large(rd, rs1, value, tmp);
+  }
+}
+
+void Riscv64Assembler::AddConst32(XRegister rd, XRegister rs1, int32_t value) {
+  CHECK_EQ((1u << rs1) & available_scratch_core_registers_, 0u);
+  CHECK_EQ((1u << rd) & available_scratch_core_registers_, 0u);
+  auto addiw = [&](XRegister rd, XRegister rs1, int32_t value) { Addiw(rd, rs1, value); };
+  auto add_large = [&](XRegister rd, XRegister rs1, int32_t value, XRegister tmp) {
+    LoadConst32(tmp, value);
+    Addw(rd, rs1, tmp);
+  };
+  AddConstImpl(this, rd, rs1, value, addiw, add_large);
+}
+
+void Riscv64Assembler::AddConst64(XRegister rd, XRegister rs1, int64_t value) {
+  CHECK_EQ((1u << rs1) & available_scratch_core_registers_, 0u);
+  CHECK_EQ((1u << rd) & available_scratch_core_registers_, 0u);
+  auto addi = [&](XRegister rd, XRegister rs1, int32_t value) { Addi(rd, rs1, value); };
+  auto add_large = [&](XRegister rd, XRegister rs1, int64_t value, XRegister tmp) {
+    // We may not have another scratch register for `LoadConst64()`, so use `Li()`.
+    // TODO(riscv64): Refactor `LoadImmediate()` so that we can reuse the code to detect
+    // when the code path using the scratch reg is beneficial, and use that path with a
+    // small modification - instead of adding the two parts togeter, add them individually
+    // to the input `rs1`. (This works as long as `rd` is not the same as `tmp`.)
+    Li(tmp, value);
+    Add(rd, rs1, tmp);
+  };
+  AddConstImpl(this, rd, rs1, value, addi, add_large);
+}
+
+void Riscv64Assembler::Beqz(XRegister rs, Riscv64Label* label, bool is_bare) {
+  Beq(rs, Zero, label, is_bare);
+}
+
+void Riscv64Assembler::Bnez(XRegister rs, Riscv64Label* label, bool is_bare) {
+  Bne(rs, Zero, label, is_bare);
+}
+
+void Riscv64Assembler::Blez(XRegister rs, Riscv64Label* label, bool is_bare) {
+  Ble(rs, Zero, label, is_bare);
+}
+
+void Riscv64Assembler::Bgez(XRegister rs, Riscv64Label* label, bool is_bare) {
+  Bge(rs, Zero, label, is_bare);
+}
+
+void Riscv64Assembler::Bltz(XRegister rs, Riscv64Label* label, bool is_bare) {
+  Blt(rs, Zero, label, is_bare);
+}
+
+void Riscv64Assembler::Bgtz(XRegister rs, Riscv64Label* label, bool is_bare) {
+  Bgt(rs, Zero, label, is_bare);
+}
+
+void Riscv64Assembler::Beq(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare) {
+  Bcond(label, is_bare, kCondEQ, rs, rt);
+}
+
+void Riscv64Assembler::Bne(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare) {
+  Bcond(label, is_bare, kCondNE, rs, rt);
+}
+
+void Riscv64Assembler::Ble(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare) {
+  Bcond(label, is_bare, kCondLE, rs, rt);
+}
+
+void Riscv64Assembler::Bge(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare) {
+  Bcond(label, is_bare, kCondGE, rs, rt);
+}
+
+void Riscv64Assembler::Blt(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare) {
+  Bcond(label, is_bare, kCondLT, rs, rt);
+}
+
+void Riscv64Assembler::Bgt(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare) {
+  Bcond(label, is_bare, kCondGT, rs, rt);
+}
+
+void Riscv64Assembler::Bleu(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare) {
+  Bcond(label, is_bare, kCondLEU, rs, rt);
+}
+
+void Riscv64Assembler::Bgeu(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare) {
+  Bcond(label, is_bare, kCondGEU, rs, rt);
+}
+
+void Riscv64Assembler::Bltu(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare) {
+  Bcond(label, is_bare, kCondLTU, rs, rt);
+}
+
+void Riscv64Assembler::Bgtu(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare) {
+  Bcond(label, is_bare, kCondGTU, rs, rt);
+}
+
+void Riscv64Assembler::Jal(XRegister rd, Riscv64Label* label, bool is_bare) {
+  Buncond(label, rd, is_bare);
+}
+
+void Riscv64Assembler::J(Riscv64Label* label, bool is_bare) {
+  Jal(Zero, label, is_bare);
+}
+
+void Riscv64Assembler::Jal(Riscv64Label* label, bool is_bare) {
+  Jal(RA, label, is_bare);
+}
+
+void Riscv64Assembler::Loadw(XRegister rd, Literal* literal) {
+  DCHECK_EQ(literal->GetSize(), 4u);
+  LoadLiteral(literal, rd, Branch::kLiteral);
+}
+
+void Riscv64Assembler::Loadwu(XRegister rd, Literal* literal) {
+  DCHECK_EQ(literal->GetSize(), 4u);
+  LoadLiteral(literal, rd, Branch::kLiteralUnsigned);
+}
+
+void Riscv64Assembler::Loadd(XRegister rd, Literal* literal) {
+  DCHECK_EQ(literal->GetSize(), 8u);
+  LoadLiteral(literal, rd, Branch::kLiteralLong);
+}
+
+void Riscv64Assembler::FLoadw(FRegister rd, Literal* literal) {
+  DCHECK_EQ(literal->GetSize(), 4u);
+  LoadLiteral(literal, rd, Branch::kLiteralFloat);
+}
+
+void Riscv64Assembler::FLoadd(FRegister rd, Literal* literal) {
+  DCHECK_EQ(literal->GetSize(), 8u);
+  LoadLiteral(literal, rd, Branch::kLiteralDouble);
+}
+
+void Riscv64Assembler::Unimp() {
+  // TODO(riscv64): use 16-bit zero C.UNIMP once we support compression
+  Emit32(0xC0001073);
+}
+
+/////////////////////////////// RV64 MACRO Instructions END ///////////////////////////////
+
+const Riscv64Assembler::Branch::BranchInfo Riscv64Assembler::Branch::branch_info_[] = {
+    // Short branches (can be promoted to longer).
+    {4, 0, Riscv64Assembler::Branch::kOffset13},  // kCondBranch
+    {4, 0, Riscv64Assembler::Branch::kOffset21},  // kUncondBranch
+    {4, 0, Riscv64Assembler::Branch::kOffset21},  // kCall
+    // Short branches (can't be promoted to longer).
+    {4, 0, Riscv64Assembler::Branch::kOffset13},  // kBareCondBranch
+    {4, 0, Riscv64Assembler::Branch::kOffset21},  // kBareUncondBranch
+    {4, 0, Riscv64Assembler::Branch::kOffset21},  // kBareCall
+
+    // Medium branch.
+    {8, 4, Riscv64Assembler::Branch::kOffset21},  // kCondBranch21
+
+    // Long branches.
+    {12, 4, Riscv64Assembler::Branch::kOffset32},  // kLongCondBranch
+    {8, 0, Riscv64Assembler::Branch::kOffset32},  // kLongUncondBranch
+    {8, 0, Riscv64Assembler::Branch::kOffset32},  // kLongCall
+
+    // label.
+    {8, 0, Riscv64Assembler::Branch::kOffset32},  // kLabel
+
+    // literals.
+    {8, 0, Riscv64Assembler::Branch::kOffset32},  // kLiteral
+    {8, 0, Riscv64Assembler::Branch::kOffset32},  // kLiteralUnsigned
+    {8, 0, Riscv64Assembler::Branch::kOffset32},  // kLiteralLong
+    {8, 0, Riscv64Assembler::Branch::kOffset32},  // kLiteralFloat
+    {8, 0, Riscv64Assembler::Branch::kOffset32},  // kLiteralDouble
+};
+
+void Riscv64Assembler::Branch::InitShortOrLong(Riscv64Assembler::Branch::OffsetBits offset_size,
+                                               Riscv64Assembler::Branch::Type short_type,
+                                               Riscv64Assembler::Branch::Type long_type,
+                                               Riscv64Assembler::Branch::Type longest_type) {
+  Riscv64Assembler::Branch::Type type = short_type;
+  if (offset_size > branch_info_[type].offset_size) {
+    type = long_type;
+    if (offset_size > branch_info_[type].offset_size) {
+      type = longest_type;
+    }
+  }
+  type_ = type;
+}
+
+void Riscv64Assembler::Branch::InitializeType(Type initial_type) {
+  OffsetBits offset_size_needed = GetOffsetSizeNeeded(location_, target_);
+
+  switch (initial_type) {
+    case kCondBranch:
+      if (condition_ != kUncond) {
+        InitShortOrLong(offset_size_needed, kCondBranch, kCondBranch21, kLongCondBranch);
+        break;
+      }
+      FALLTHROUGH_INTENDED;
+    case kUncondBranch:
+      InitShortOrLong(offset_size_needed, kUncondBranch, kLongUncondBranch, kLongUncondBranch);
+      break;
+    case kCall:
+      InitShortOrLong(offset_size_needed, kCall, kLongCall, kLongCall);
+      break;
+    case kBareCondBranch:
+      if (condition_ != kUncond) {
+        type_ = kBareCondBranch;
+        CHECK_LE(offset_size_needed, GetOffsetSize());
+        break;
+      }
+      FALLTHROUGH_INTENDED;
+    case kBareUncondBranch:
+      type_ = kBareUncondBranch;
+      CHECK_LE(offset_size_needed, GetOffsetSize());
+      break;
+    case kBareCall:
+      type_ = kBareCall;
+      CHECK_LE(offset_size_needed, GetOffsetSize());
+      break;
+    case kLabel:
+      type_ = initial_type;
+      break;
+    case kLiteral:
+    case kLiteralUnsigned:
+    case kLiteralLong:
+    case kLiteralFloat:
+    case kLiteralDouble:
+      CHECK(!IsResolved());
+      type_ = initial_type;
+      break;
+    default:
+      LOG(FATAL) << "Unexpected branch type " << enum_cast<uint32_t>(initial_type);
+      UNREACHABLE();
+  }
+
+  old_type_ = type_;
+}
+
+bool Riscv64Assembler::Branch::IsNop(BranchCondition condition, XRegister lhs, XRegister rhs) {
+  switch (condition) {
+    case kCondNE:
+    case kCondLT:
+    case kCondGT:
+    case kCondLTU:
+    case kCondGTU:
+      return lhs == rhs;
+    default:
+      return false;
+  }
+}
+
+bool Riscv64Assembler::Branch::IsUncond(BranchCondition condition, XRegister lhs, XRegister rhs) {
+  switch (condition) {
+    case kUncond:
+      return true;
+    case kCondEQ:
+    case kCondGE:
+    case kCondLE:
+    case kCondLEU:
+    case kCondGEU:
+      return lhs == rhs;
+    default:
+      return false;
+  }
+}
+
+Riscv64Assembler::Branch::Branch(uint32_t location, uint32_t target, XRegister rd, bool is_bare)
+    : old_location_(location),
+      location_(location),
+      target_(target),
+      lhs_reg_(rd),
+      rhs_reg_(Zero),
+      freg_(kNoFRegister),
+      condition_(kUncond) {
+  InitializeType(
+      (rd != Zero ? (is_bare ? kBareCall : kCall) : (is_bare ? kBareUncondBranch : kUncondBranch)));
+}
+
+Riscv64Assembler::Branch::Branch(uint32_t location,
+                                 uint32_t target,
+                                 Riscv64Assembler::BranchCondition condition,
+                                 XRegister lhs_reg,
+                                 XRegister rhs_reg,
+                                 bool is_bare)
+    : old_location_(location),
+      location_(location),
+      target_(target),
+      lhs_reg_(lhs_reg),
+      rhs_reg_(rhs_reg),
+      freg_(kNoFRegister),
+      condition_(condition) {
+  DCHECK_NE(condition, kUncond);
+  DCHECK(!IsNop(condition, lhs_reg, rhs_reg));
+  DCHECK(!IsUncond(condition, lhs_reg, rhs_reg));
+  InitializeType(is_bare ? kBareCondBranch : kCondBranch);
+}
+
+Riscv64Assembler::Branch::Branch(uint32_t location,
+                                 uint32_t target,
+                                 XRegister rd,
+                                 Type label_or_literal_type)
+    : old_location_(location),
+      location_(location),
+      target_(target),
+      lhs_reg_(rd),
+      rhs_reg_(Zero),
+      freg_(kNoFRegister),
+      condition_(kUncond) {
+  CHECK_NE(rd , Zero);
+  InitializeType(label_or_literal_type);
+}
+
+Riscv64Assembler::Branch::Branch(uint32_t location,
+                                 uint32_t target,
+                                 FRegister rd,
+                                 Type literal_type)
+    : old_location_(location),
+      location_(location),
+      target_(target),
+      lhs_reg_(Zero),
+      rhs_reg_(Zero),
+      freg_(rd),
+      condition_(kUncond) {
+  InitializeType(literal_type);
+}
+
+Riscv64Assembler::BranchCondition Riscv64Assembler::Branch::OppositeCondition(
+    Riscv64Assembler::BranchCondition cond) {
+  switch (cond) {
+    case kCondEQ:
+      return kCondNE;
+    case kCondNE:
+      return kCondEQ;
+    case kCondLT:
+      return kCondGE;
+    case kCondGE:
+      return kCondLT;
+    case kCondLE:
+      return kCondGT;
+    case kCondGT:
+      return kCondLE;
+    case kCondLTU:
+      return kCondGEU;
+    case kCondGEU:
+      return kCondLTU;
+    case kCondLEU:
+      return kCondGTU;
+    case kCondGTU:
+      return kCondLEU;
+    case kUncond:
+      LOG(FATAL) << "Unexpected branch condition " << enum_cast<uint32_t>(cond);
+      UNREACHABLE();
+  }
+}
+
+Riscv64Assembler::Branch::Type Riscv64Assembler::Branch::GetType() const { return type_; }
+
+Riscv64Assembler::BranchCondition Riscv64Assembler::Branch::GetCondition() const {
+    return condition_;
+}
+
+XRegister Riscv64Assembler::Branch::GetLeftRegister() const { return lhs_reg_; }
+
+XRegister Riscv64Assembler::Branch::GetRightRegister() const { return rhs_reg_; }
+
+FRegister Riscv64Assembler::Branch::GetFRegister() const { return freg_; }
+
+uint32_t Riscv64Assembler::Branch::GetTarget() const { return target_; }
+
+uint32_t Riscv64Assembler::Branch::GetLocation() const { return location_; }
+
+uint32_t Riscv64Assembler::Branch::GetOldLocation() const { return old_location_; }
+
+uint32_t Riscv64Assembler::Branch::GetLength() const { return branch_info_[type_].length; }
+
+uint32_t Riscv64Assembler::Branch::GetOldLength() const { return branch_info_[old_type_].length; }
+
+uint32_t Riscv64Assembler::Branch::GetEndLocation() const { return GetLocation() + GetLength(); }
+
+uint32_t Riscv64Assembler::Branch::GetOldEndLocation() const {
+  return GetOldLocation() + GetOldLength();
+}
+
+bool Riscv64Assembler::Branch::IsBare() const {
+  switch (type_) {
+    case kBareUncondBranch:
+    case kBareCondBranch:
+    case kBareCall:
+      return true;
+    default:
+      return false;
+  }
+}
+
+bool Riscv64Assembler::Branch::IsResolved() const { return target_ != kUnresolved; }
+
+Riscv64Assembler::Branch::OffsetBits Riscv64Assembler::Branch::GetOffsetSize() const {
+  return branch_info_[type_].offset_size;
+}
+
+Riscv64Assembler::Branch::OffsetBits Riscv64Assembler::Branch::GetOffsetSizeNeeded(
+    uint32_t location, uint32_t target) {
+  // For unresolved targets assume the shortest encoding
+  // (later it will be made longer if needed).
+  if (target == kUnresolved) {
+    return kOffset13;
+  }
+  int64_t distance = static_cast<int64_t>(target) - location;
+  if (IsInt<kOffset13>(distance)) {
+    return kOffset13;
+  } else if (IsInt<kOffset21>(distance)) {
+    return kOffset21;
+  } else {
+    return kOffset32;
+  }
+}
+
+void Riscv64Assembler::Branch::Resolve(uint32_t target) { target_ = target; }
+
+void Riscv64Assembler::Branch::Relocate(uint32_t expand_location, uint32_t delta) {
+  // All targets should be resolved before we start promoting branches.
+  DCHECK(IsResolved());
+  if (location_ > expand_location) {
+    location_ += delta;
+  }
+  if (target_ > expand_location) {
+    target_ += delta;
+  }
+}
+
+uint32_t Riscv64Assembler::Branch::PromoteIfNeeded() {
+  // All targets should be resolved before we start promoting branches.
+  DCHECK(IsResolved());
+  Type old_type = type_;
+  switch (type_) {
+    // Short branches (can be promoted to longer).
+    case kCondBranch: {
+      OffsetBits needed_size = GetOffsetSizeNeeded(GetOffsetLocation(), target_);
+      if (needed_size <= GetOffsetSize()) {
+        return 0u;
+      }
+      // The offset remains the same for `kCondBranch21` for forward branches.
+      DCHECK_EQ(branch_info_[kCondBranch21].length - branch_info_[kCondBranch21].pc_offset,
+                branch_info_[kCondBranch].length - branch_info_[kCondBranch].pc_offset);
+      if (target_ <= location_) {
+        // Calculate the needed size for kCondBranch21.
+        needed_size =
+            GetOffsetSizeNeeded(location_ + branch_info_[kCondBranch21].pc_offset, target_);
+      }
+      type_ = (needed_size <= branch_info_[kCondBranch21].offset_size)
+          ? kCondBranch21
+          : kLongCondBranch;
+      break;
+    }
+    case kUncondBranch:
+      if (GetOffsetSizeNeeded(GetOffsetLocation(), target_) <= GetOffsetSize()) {
+        return 0u;
+      }
+      type_ = kLongUncondBranch;
+      break;
+    case kCall:
+      if (GetOffsetSizeNeeded(GetOffsetLocation(), target_) <= GetOffsetSize()) {
+        return 0u;
+      }
+      type_ = kLongCall;
+      break;
+    // Medium branch (can be promoted to long).
+    case kCondBranch21:
+      if (GetOffsetSizeNeeded(GetOffsetLocation(), target_) <= GetOffsetSize()) {
+        return 0u;
+      }
+      type_ = kLongCondBranch;
+      break;
+    default:
+      // Other branch types cannot be promoted.
+      DCHECK_LE(GetOffsetSizeNeeded(GetOffsetLocation(), target_), GetOffsetSize()) << type_;
+      return 0u;
+  }
+  DCHECK(type_ != old_type);
+  DCHECK_GT(branch_info_[type_].length, branch_info_[old_type].length);
+  return branch_info_[type_].length - branch_info_[old_type].length;
+}
+
+uint32_t Riscv64Assembler::Branch::GetOffsetLocation() const {
+  return location_ + branch_info_[type_].pc_offset;
+}
+
+int32_t Riscv64Assembler::Branch::GetOffset() const {
+  CHECK(IsResolved());
+  // Calculate the byte distance between instructions and also account for
+  // different PC-relative origins.
+  uint32_t offset_location = GetOffsetLocation();
+  int32_t offset = static_cast<int32_t>(target_ - offset_location);
+  DCHECK_EQ(offset, static_cast<int64_t>(target_) - static_cast<int64_t>(offset_location));
+  return offset;
+}
+
+void Riscv64Assembler::EmitBcond(BranchCondition cond,
+                                 XRegister rs,
+                                 XRegister rt,
+                                 int32_t offset) {
+  switch (cond) {
+#define DEFINE_CASE(COND, cond) \
+    case kCond##COND:           \
+      B##cond(rs, rt, offset);  \
+      break;
+    DEFINE_CASE(EQ, eq)
+    DEFINE_CASE(NE, ne)
+    DEFINE_CASE(LT, lt)
+    DEFINE_CASE(GE, ge)
+    DEFINE_CASE(LE, le)
+    DEFINE_CASE(GT, gt)
+    DEFINE_CASE(LTU, ltu)
+    DEFINE_CASE(GEU, geu)
+    DEFINE_CASE(LEU, leu)
+    DEFINE_CASE(GTU, gtu)
+#undef DEFINE_CASE
+    case kUncond:
+      LOG(FATAL) << "Unexpected branch condition " << enum_cast<uint32_t>(cond);
+      UNREACHABLE();
+  }
+}
+
+void Riscv64Assembler::EmitBranch(Riscv64Assembler::Branch* branch) {
+  CHECK(overwriting_);
+  overwrite_location_ = branch->GetLocation();
+  const int32_t offset = branch->GetOffset();
+  BranchCondition condition = branch->GetCondition();
+  XRegister lhs = branch->GetLeftRegister();
+  XRegister rhs = branch->GetRightRegister();
+
+  auto emit_auipc_and_next = [&](XRegister reg, auto next) {
+    CHECK_EQ(overwrite_location_, branch->GetOffsetLocation());
+    auto [imm20, short_offset] = SplitOffset(offset);
+    Auipc(reg, imm20);
+    next(short_offset);
+  };
+
+  switch (branch->GetType()) {
+    // Short branches.
+    case Branch::kUncondBranch:
+    case Branch::kBareUncondBranch:
+      CHECK_EQ(overwrite_location_, branch->GetOffsetLocation());
+      J(offset);
+      break;
+    case Branch::kCondBranch:
+    case Branch::kBareCondBranch:
+      CHECK_EQ(overwrite_location_, branch->GetOffsetLocation());
+      EmitBcond(condition, lhs, rhs, offset);
+      break;
+    case Branch::kCall:
+    case Branch::kBareCall:
+      CHECK_EQ(overwrite_location_, branch->GetOffsetLocation());
+      DCHECK(lhs != Zero);
+      Jal(lhs, offset);
+      break;
+
+    // Medium branch.
+    case Branch::kCondBranch21:
+      EmitBcond(Branch::OppositeCondition(condition), lhs, rhs, branch->GetLength());
+      CHECK_EQ(overwrite_location_, branch->GetOffsetLocation());
+      J(offset);
+      break;
+
+    // Long branches.
+    case Branch::kLongCondBranch:
+      EmitBcond(Branch::OppositeCondition(condition), lhs, rhs, branch->GetLength());
+      FALLTHROUGH_INTENDED;
+    case Branch::kLongUncondBranch:
+      emit_auipc_and_next(TMP, [&](int32_t short_offset) { Jalr(Zero, TMP, short_offset); });
+      break;
+    case Branch::kLongCall:
+      DCHECK(lhs != Zero);
+      emit_auipc_and_next(lhs, [&](int32_t short_offset) { Jalr(lhs, lhs, short_offset); });
+      break;
+
+    // label.
+    case Branch::kLabel:
+      emit_auipc_and_next(lhs, [&](int32_t short_offset) { Addi(lhs, lhs, short_offset); });
+      break;
+    // literals.
+    case Branch::kLiteral:
+      emit_auipc_and_next(lhs, [&](int32_t short_offset) { Lw(lhs, lhs, short_offset); });
+      break;
+    case Branch::kLiteralUnsigned:
+      emit_auipc_and_next(lhs, [&](int32_t short_offset) { Lwu(lhs, lhs, short_offset); });
+      break;
+    case Branch::kLiteralLong:
+      emit_auipc_and_next(lhs, [&](int32_t short_offset) { Ld(lhs, lhs, short_offset); });
+      break;
+    case Branch::kLiteralFloat:
+      emit_auipc_and_next(
+          TMP, [&](int32_t short_offset) { FLw(branch->GetFRegister(), TMP, short_offset); });
+      break;
+    case Branch::kLiteralDouble:
+      emit_auipc_and_next(
+          TMP, [&](int32_t short_offset) { FLd(branch->GetFRegister(), TMP, short_offset); });
+      break;
+  }
+  CHECK_EQ(overwrite_location_, branch->GetEndLocation());
+  CHECK_LE(branch->GetLength(), static_cast<uint32_t>(Branch::kMaxBranchLength));
+}
+
+void Riscv64Assembler::EmitBranches() {
+  CHECK(!overwriting_);
+  // Switch from appending instructions at the end of the buffer to overwriting
+  // existing instructions (branch placeholders) in the buffer.
+  overwriting_ = true;
+  for (auto& branch : branches_) {
+    EmitBranch(&branch);
+  }
+  overwriting_ = false;
+}
+
+void Riscv64Assembler::FinalizeLabeledBranch(Riscv64Label* label) {
+  // TODO(riscv64): Support "C" Standard Extension - length may not be a multiple of 4.
+  DCHECK_ALIGNED(branches_.back().GetLength(), sizeof(uint32_t));
+  uint32_t length = branches_.back().GetLength() / sizeof(uint32_t);
+  if (!label->IsBound()) {
+    // Branch forward (to a following label), distance is unknown.
+    // The first branch forward will contain 0, serving as the terminator of
+    // the list of forward-reaching branches.
+    Emit32(label->position_);
+    length--;
+    // Now make the label object point to this branch
+    // (this forms a linked list of branches preceding this label).
+    uint32_t branch_id = branches_.size() - 1;
+    label->LinkTo(branch_id);
+  }
+  // Reserve space for the branch.
+  for (; length != 0u; --length) {
+    Nop();
+  }
+}
+
+void Riscv64Assembler::Bcond(
+    Riscv64Label* label, bool is_bare, BranchCondition condition, XRegister lhs, XRegister rhs) {
+  // TODO(riscv64): Should an assembler perform these optimizations, or should we remove them?
+  // If lhs = rhs, this can be a NOP.
+  if (Branch::IsNop(condition, lhs, rhs)) {
+    return;
+  }
+  if (Branch::IsUncond(condition, lhs, rhs)) {
+    Buncond(label, Zero, is_bare);
+    return;
+  }
+
+  uint32_t target = label->IsBound() ? GetLabelLocation(label) : Branch::kUnresolved;
+  branches_.emplace_back(buffer_.Size(), target, condition, lhs, rhs, is_bare);
+  FinalizeLabeledBranch(label);
+}
+
+void Riscv64Assembler::Buncond(Riscv64Label* label, XRegister rd, bool is_bare) {
+  uint32_t target = label->IsBound() ? GetLabelLocation(label) : Branch::kUnresolved;
+  branches_.emplace_back(buffer_.Size(), target, rd, is_bare);
+  FinalizeLabeledBranch(label);
+}
+
+template <typename XRegisterOrFRegister>
+void Riscv64Assembler::LoadLiteral(Literal* literal,
+                                   XRegisterOrFRegister rd,
+                                   Branch::Type literal_type) {
+  Riscv64Label* label = literal->GetLabel();
+  DCHECK(!label->IsBound());
+  branches_.emplace_back(buffer_.Size(), Branch::kUnresolved, rd, literal_type);
+  FinalizeLabeledBranch(label);
+}
+
+Riscv64Assembler::Branch* Riscv64Assembler::GetBranch(uint32_t branch_id) {
+  CHECK_LT(branch_id, branches_.size());
+  return &branches_[branch_id];
+}
+
+const Riscv64Assembler::Branch* Riscv64Assembler::GetBranch(uint32_t branch_id) const {
+  CHECK_LT(branch_id, branches_.size());
+  return &branches_[branch_id];
+}
+
+void Riscv64Assembler::Bind(Riscv64Label* label) {
+  CHECK(!label->IsBound());
+  uint32_t bound_pc = buffer_.Size();
+
+  // Walk the list of branches referring to and preceding this label.
+  // Store the previously unknown target addresses in them.
+  while (label->IsLinked()) {
+    uint32_t branch_id = label->Position();
+    Branch* branch = GetBranch(branch_id);
+    branch->Resolve(bound_pc);
+
+    uint32_t branch_location = branch->GetLocation();
+    // Extract the location of the previous branch in the list (walking the list backwards;
+    // the previous branch ID was stored in the space reserved for this branch).
+    uint32_t prev = buffer_.Load<uint32_t>(branch_location);
+
+    // On to the previous branch in the list...
+    label->position_ = prev;
+  }
+
+  // Now make the label object contain its own location (relative to the end of the preceding
+  // branch, if any; it will be used by the branches referring to and following this label).
+  uint32_t prev_branch_id = Riscv64Label::kNoPrevBranchId;
+  if (!branches_.empty()) {
+    prev_branch_id = branches_.size() - 1u;
+    const Branch* prev_branch = GetBranch(prev_branch_id);
+    bound_pc -= prev_branch->GetEndLocation();
+  }
+  label->prev_branch_id_ = prev_branch_id;
+  label->BindTo(bound_pc);
+}
+
+void Riscv64Assembler::LoadLabelAddress(XRegister rd, Riscv64Label* label) {
+  DCHECK_NE(rd, Zero);
+  uint32_t target = label->IsBound() ? GetLabelLocation(label) : Branch::kUnresolved;
+  branches_.emplace_back(buffer_.Size(), target, rd, Branch::kLabel);
+  FinalizeLabeledBranch(label);
+}
+
+Literal* Riscv64Assembler::NewLiteral(size_t size, const uint8_t* data) {
+  // We don't support byte and half-word literals.
+  if (size == 4u) {
+    literals_.emplace_back(size, data);
+    return &literals_.back();
+  } else {
+    DCHECK_EQ(size, 8u);
+    long_literals_.emplace_back(size, data);
+    return &long_literals_.back();
+  }
+}
+
+JumpTable* Riscv64Assembler::CreateJumpTable(ArenaVector<Riscv64Label*>&& labels) {
+  jump_tables_.emplace_back(std::move(labels));
+  JumpTable* table = &jump_tables_.back();
+  DCHECK(!table->GetLabel()->IsBound());
+  return table;
+}
+
+uint32_t Riscv64Assembler::GetLabelLocation(const Riscv64Label* label) const {
+  CHECK(label->IsBound());
+  uint32_t target = label->Position();
+  if (label->prev_branch_id_ != Riscv64Label::kNoPrevBranchId) {
+    // Get label location based on the branch preceding it.
+    const Branch* prev_branch = GetBranch(label->prev_branch_id_);
+    target += prev_branch->GetEndLocation();
+  }
+  return target;
+}
+
+uint32_t Riscv64Assembler::GetAdjustedPosition(uint32_t old_position) {
+  // We can reconstruct the adjustment by going through all the branches from the beginning
+  // up to the `old_position`. Since we expect `GetAdjustedPosition()` to be called in a loop
+  // with increasing `old_position`, we can use the data from last `GetAdjustedPosition()` to
+  // continue where we left off and the whole loop should be O(m+n) where m is the number
+  // of positions to adjust and n is the number of branches.
+  if (old_position < last_old_position_) {
+    last_position_adjustment_ = 0;
+    last_old_position_ = 0;
+    last_branch_id_ = 0;
+  }
+  while (last_branch_id_ != branches_.size()) {
+    const Branch* branch = GetBranch(last_branch_id_);
+    if (branch->GetLocation() >= old_position + last_position_adjustment_) {
+      break;
+    }
+    last_position_adjustment_ += branch->GetLength() - branch->GetOldLength();
+    ++last_branch_id_;
+  }
+  last_old_position_ = old_position;
+  return old_position + last_position_adjustment_;
+}
+
+void Riscv64Assembler::ReserveJumpTableSpace() {
+  if (!jump_tables_.empty()) {
+    for (JumpTable& table : jump_tables_) {
+      Riscv64Label* label = table.GetLabel();
+      Bind(label);
+
+      // Bulk ensure capacity, as this may be large.
+      size_t orig_size = buffer_.Size();
+      size_t required_capacity = orig_size + table.GetSize();
+      if (required_capacity > buffer_.Capacity()) {
+        buffer_.ExtendCapacity(required_capacity);
+      }
+#ifndef NDEBUG
+      buffer_.has_ensured_capacity_ = true;
+#endif
+
+      // Fill the space with placeholder data as the data is not final
+      // until the branches have been promoted. And we shouldn't
+      // be moving uninitialized data during branch promotion.
+      for (size_t cnt = table.GetData().size(), i = 0; i < cnt; ++i) {
+        buffer_.Emit<uint32_t>(0x1abe1234u);
+      }
+
+#ifndef NDEBUG
+      buffer_.has_ensured_capacity_ = false;
+#endif
+    }
+  }
+}
+
+void Riscv64Assembler::PromoteBranches() {
+  // Promote short branches to long as necessary.
+  bool changed;
+  do {
+    changed = false;
+    for (auto& branch : branches_) {
+      CHECK(branch.IsResolved());
+      uint32_t delta = branch.PromoteIfNeeded();
+      // If this branch has been promoted and needs to expand in size,
+      // relocate all branches by the expansion size.
+      if (delta != 0u) {
+        changed = true;
+        uint32_t expand_location = branch.GetLocation();
+        for (auto& branch2 : branches_) {
+          branch2.Relocate(expand_location, delta);
+        }
+      }
+    }
+  } while (changed);
+
+  // Account for branch expansion by resizing the code buffer
+  // and moving the code in it to its final location.
+  size_t branch_count = branches_.size();
+  if (branch_count > 0) {
+    // Resize.
+    Branch& last_branch = branches_[branch_count - 1];
+    uint32_t size_delta = last_branch.GetEndLocation() - last_branch.GetOldEndLocation();
+    uint32_t old_size = buffer_.Size();
+    buffer_.Resize(old_size + size_delta);
+    // Move the code residing between branch placeholders.
+    uint32_t end = old_size;
+    for (size_t i = branch_count; i > 0;) {
+      Branch& branch = branches_[--i];
+      uint32_t size = end - branch.GetOldEndLocation();
+      buffer_.Move(branch.GetEndLocation(), branch.GetOldEndLocation(), size);
+      end = branch.GetOldLocation();
+    }
+  }
+
+  // Align 64-bit literals by moving them up by 4 bytes if needed.
+  // This can increase the PC-relative distance but all literals are accessed with AUIPC+Load(imm12)
+  // without branch promotion, so this late adjustment cannot take them out of instruction range.
+  if (!long_literals_.empty()) {
+    uint32_t first_literal_location = GetLabelLocation(long_literals_.front().GetLabel());
+    size_t lit_size = long_literals_.size() * sizeof(uint64_t);
+    size_t buf_size = buffer_.Size();
+    // 64-bit literals must be at the very end of the buffer.
+    CHECK_EQ(first_literal_location + lit_size, buf_size);
+    if (!IsAligned<sizeof(uint64_t)>(first_literal_location)) {
+      // Insert the padding.
+      buffer_.Resize(buf_size + sizeof(uint32_t));
+      buffer_.Move(first_literal_location + sizeof(uint32_t), first_literal_location, lit_size);
+      DCHECK(!overwriting_);
+      overwriting_ = true;
+      overwrite_location_ = first_literal_location;
+      Emit32(0);  // Illegal instruction.
+      overwriting_ = false;
+      // Increase target addresses in literal and address loads by 4 bytes in order for correct
+      // offsets from PC to be generated.
+      for (auto& branch : branches_) {
+        uint32_t target = branch.GetTarget();
+        if (target >= first_literal_location) {
+          branch.Resolve(target + sizeof(uint32_t));
+        }
+      }
+      // If after this we ever call GetLabelLocation() to get the location of a 64-bit literal,
+      // we need to adjust the location of the literal's label as well.
+      for (Literal& literal : long_literals_) {
+        // Bound label's position is negative, hence decrementing it instead of incrementing.
+        literal.GetLabel()->position_ -= sizeof(uint32_t);
+      }
+    }
+  }
+}
+
+void Riscv64Assembler::PatchCFI() {
+  if (cfi().NumberOfDelayedAdvancePCs() == 0u) {
+    return;
+  }
+
+  using DelayedAdvancePC = DebugFrameOpCodeWriterForAssembler::DelayedAdvancePC;
+  const auto data = cfi().ReleaseStreamAndPrepareForDelayedAdvancePC();
+  const std::vector<uint8_t>& old_stream = data.first;
+  const std::vector<DelayedAdvancePC>& advances = data.second;
+
+  // Refill our data buffer with patched opcodes.
+  static constexpr size_t kExtraSpace = 16;  // Not every PC advance can be encoded in one byte.
+  cfi().ReserveCFIStream(old_stream.size() + advances.size() + kExtraSpace);
+  size_t stream_pos = 0;
+  for (const DelayedAdvancePC& advance : advances) {
+    DCHECK_GE(advance.stream_pos, stream_pos);
+    // Copy old data up to the point where advance was issued.
+    cfi().AppendRawData(old_stream, stream_pos, advance.stream_pos);
+    stream_pos = advance.stream_pos;
+    // Insert the advance command with its final offset.
+    size_t final_pc = GetAdjustedPosition(advance.pc);
+    cfi().AdvancePC(final_pc);
+  }
+  // Copy the final segment if any.
+  cfi().AppendRawData(old_stream, stream_pos, old_stream.size());
+}
+
+void Riscv64Assembler::EmitJumpTables() {
+  if (!jump_tables_.empty()) {
+    CHECK(!overwriting_);
+    // Switch from appending instructions at the end of the buffer to overwriting
+    // existing instructions (here, jump tables) in the buffer.
+    overwriting_ = true;
+
+    for (JumpTable& table : jump_tables_) {
+      Riscv64Label* table_label = table.GetLabel();
+      uint32_t start = GetLabelLocation(table_label);
+      overwrite_location_ = start;
+
+      for (Riscv64Label* target : table.GetData()) {
+        CHECK_EQ(buffer_.Load<uint32_t>(overwrite_location_), 0x1abe1234u);
+        // The table will contain target addresses relative to the table start.
+        uint32_t offset = GetLabelLocation(target) - start;
+        Emit32(offset);
+      }
+    }
+
+    overwriting_ = false;
+  }
+}
+
+void Riscv64Assembler::EmitLiterals() {
+  if (!literals_.empty()) {
+    for (Literal& literal : literals_) {
+      Riscv64Label* label = literal.GetLabel();
+      Bind(label);
+      AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+      DCHECK_EQ(literal.GetSize(), 4u);
+      for (size_t i = 0, size = literal.GetSize(); i != size; ++i) {
+        buffer_.Emit<uint8_t>(literal.GetData()[i]);
+      }
+    }
+  }
+  if (!long_literals_.empty()) {
+    // These need to be 8-byte-aligned but we shall add the alignment padding after the branch
+    // promotion, if needed. Since all literals are accessed with AUIPC+Load(imm12) without branch
+    // promotion, this late adjustment cannot take long literals out of instruction range.
+    for (Literal& literal : long_literals_) {
+      Riscv64Label* label = literal.GetLabel();
+      Bind(label);
+      AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+      DCHECK_EQ(literal.GetSize(), 8u);
+      for (size_t i = 0, size = literal.GetSize(); i != size; ++i) {
+        buffer_.Emit<uint8_t>(literal.GetData()[i]);
+      }
+    }
+  }
+}
+
+// This method is used to adjust the base register and offset pair for
+// a load/store when the offset doesn't fit into 12-bit signed integer.
+void Riscv64Assembler::AdjustBaseAndOffset(XRegister& base,
+                                           int32_t& offset,
+                                           ScratchRegisterScope& srs) {
+  // A scratch register must be available for adjustment even if it's not needed.
+  CHECK_NE(srs.AvailableXRegisters(), 0u);
+  if (IsInt<12>(offset)) {
+    return;
+  }
+
+  constexpr int32_t kPositiveOffsetMaxSimpleAdjustment = 0x7ff;
+  constexpr int32_t kHighestOffsetForSimpleAdjustment = 2 * kPositiveOffsetMaxSimpleAdjustment;
+  constexpr int32_t kPositiveOffsetSimpleAdjustmentAligned8 =
+      RoundDown(kPositiveOffsetMaxSimpleAdjustment, 8);
+  constexpr int32_t kPositiveOffsetSimpleAdjustmentAligned4 =
+      RoundDown(kPositiveOffsetMaxSimpleAdjustment, 4);
+  constexpr int32_t kNegativeOffsetSimpleAdjustment = -0x800;
+  constexpr int32_t kLowestOffsetForSimpleAdjustment = 2 * kNegativeOffsetSimpleAdjustment;
+
+  XRegister tmp = srs.AllocateXRegister();
+  if (offset >= 0 && offset <= kHighestOffsetForSimpleAdjustment) {
+    // Make the adjustment 8-byte aligned (0x7f8) except for offsets that cannot be reached
+    // with this adjustment, then try 4-byte alignment, then just half of the offset.
+    int32_t adjustment = IsInt<12>(offset - kPositiveOffsetSimpleAdjustmentAligned8)
+        ? kPositiveOffsetSimpleAdjustmentAligned8
+        : IsInt<12>(offset - kPositiveOffsetSimpleAdjustmentAligned4)
+            ? kPositiveOffsetSimpleAdjustmentAligned4
+            : offset / 2;
+    DCHECK(IsInt<12>(adjustment));
+    Addi(tmp, base, adjustment);
+    offset -= adjustment;
+  } else if (offset < 0 && offset >= kLowestOffsetForSimpleAdjustment) {
+    Addi(tmp, base, kNegativeOffsetSimpleAdjustment);
+    offset -= kNegativeOffsetSimpleAdjustment;
+  } else if (offset >= 0x7ffff800) {
+    // Support even large offsets outside the range supported by `SplitOffset()`.
+    LoadConst32(tmp, offset);
+    Add(tmp, tmp, base);
+    offset = 0;
+  } else {
+    auto [imm20, short_offset] = SplitOffset(offset);
+    Lui(tmp, imm20);
+    Add(tmp, tmp, base);
+    offset = short_offset;
+  }
+  base = tmp;
+}
+
+template <void (Riscv64Assembler::*insn)(XRegister, XRegister, int32_t)>
+void Riscv64Assembler::LoadFromOffset(XRegister rd, XRegister rs1, int32_t offset) {
+  CHECK_EQ((1u << rs1) & available_scratch_core_registers_, 0u);
+  CHECK_EQ((1u << rd) & available_scratch_core_registers_, 0u);
+  ScratchRegisterScope srs(this);
+  // If `rd` differs from `rs1`, allow using it as a temporary if needed.
+  if (rd != rs1) {
+    srs.IncludeXRegister(rd);
+  }
+  AdjustBaseAndOffset(rs1, offset, srs);
+  (this->*insn)(rd, rs1, offset);
+}
+
+template <void (Riscv64Assembler::*insn)(XRegister, XRegister, int32_t)>
+void Riscv64Assembler::StoreToOffset(XRegister rs2, XRegister rs1, int32_t offset) {
+  CHECK_EQ((1u << rs1) & available_scratch_core_registers_, 0u);
+  CHECK_EQ((1u << rs2) & available_scratch_core_registers_, 0u);
+  ScratchRegisterScope srs(this);
+  AdjustBaseAndOffset(rs1, offset, srs);
+  (this->*insn)(rs2, rs1, offset);
+}
+
+template <void (Riscv64Assembler::*insn)(FRegister, XRegister, int32_t)>
+void Riscv64Assembler::FLoadFromOffset(FRegister rd, XRegister rs1, int32_t offset) {
+  CHECK_EQ((1u << rs1) & available_scratch_core_registers_, 0u);
+  ScratchRegisterScope srs(this);
+  AdjustBaseAndOffset(rs1, offset, srs);
+  (this->*insn)(rd, rs1, offset);
+}
+
+template <void (Riscv64Assembler::*insn)(FRegister, XRegister, int32_t)>
+void Riscv64Assembler::FStoreToOffset(FRegister rs2, XRegister rs1, int32_t offset) {
+  CHECK_EQ((1u << rs1) & available_scratch_core_registers_, 0u);
+  ScratchRegisterScope srs(this);
+  AdjustBaseAndOffset(rs1, offset, srs);
+  (this->*insn)(rs2, rs1, offset);
+}
+
+void Riscv64Assembler::LoadImmediate(XRegister rd, int64_t imm, bool can_use_tmp) {
+  CHECK_EQ((1u << rd) & available_scratch_core_registers_, 0u);
+  ScratchRegisterScope srs(this);
+  CHECK_IMPLIES(can_use_tmp, srs.AvailableXRegisters() != 0u);
+
+  // Helper lambdas.
+  auto addi = [&](XRegister rd, XRegister rs, int32_t imm) { Addi(rd, rs, imm); };
+  auto addiw = [&](XRegister rd, XRegister rs, int32_t imm) { Addiw(rd, rs, imm); };
+  auto slli = [&](XRegister rd, XRegister rs, int32_t imm) { Slli(rd, rs, imm); };
+  auto lui = [&](XRegister rd, uint32_t imm20) { Lui(rd, imm20); };
+
+  // Simple LUI+ADDI/W can handle value range [-0x80000800, 0x7fffffff].
+  auto is_simple_li_value = [](int64_t value) {
+    return value >= INT64_C(-0x80000800) && value <= INT64_C(0x7fffffff);
+  };
+  auto emit_simple_li_helper = [&](XRegister rd,
+                                   int64_t value,
+                                   auto&& addi,
+                                   auto&& addiw,
+                                   auto&& slli,
+                                   auto&& lui) {
+    DCHECK(is_simple_li_value(value)) << "0x" << std::hex << value;
+    if (IsInt<12>(value)) {
+      addi(rd, Zero, value);
+    } else if (CTZ(value) < 12 && IsInt(6 + CTZ(value), value)) {
+      // This path yields two 16-bit instructions with the "C" Standard Extension.
+      addi(rd, Zero, value >> CTZ(value));
+      slli(rd, rd, CTZ(value));
+    } else if (value < INT64_C(-0x80000000)) {
+      int32_t small_value = dchecked_integral_cast<int32_t>(value - INT64_C(-0x80000000));
+      DCHECK(IsInt<12>(small_value));
+      DCHECK_LT(small_value, 0);
+      lui(rd, 1u << 19);
+      addi(rd, rd, small_value);
+    } else {
+      DCHECK(IsInt<32>(value));
+      // Note: Similar to `SplitOffset()` but we can target the full 32-bit range with ADDIW.
+      int64_t near_value = (value + 0x800) & ~0xfff;
+      int32_t small_value = value - near_value;
+      DCHECK(IsInt<12>(small_value));
+      uint32_t imm20 = static_cast<uint32_t>(near_value) >> 12;
+      DCHECK_NE(imm20, 0u);  // Small values are handled above.
+      lui(rd, imm20);
+      if (small_value != 0) {
+        addiw(rd, rd, small_value);
+      }
+    }
+  };
+  auto emit_simple_li = [&](XRegister rd, int64_t value) {
+    emit_simple_li_helper(rd, value, addi, addiw, slli, lui);
+  };
+  auto count_simple_li_instructions = [&](int64_t value) {
+    size_t num_instructions = 0u;
+    auto count_rri = [&](XRegister, XRegister, int32_t) { ++num_instructions; };
+    auto count_ru = [&](XRegister, uint32_t) { ++num_instructions; };
+    emit_simple_li_helper(Zero, value, count_rri, count_rri, count_rri, count_ru);
+    return num_instructions;
+  };
+
+  // If LUI+ADDI/W is not enough, we can generate up to 3 SLLI+ADDI afterwards (up to 8 instructions
+  // total). The ADDI from the first SLLI+ADDI pair can be a no-op.
+  auto emit_with_slli_addi_helper = [&](XRegister rd,
+                                        int64_t value,
+                                        auto&& addi,
+                                        auto&& addiw,
+                                        auto&& slli,
+                                        auto&& lui) {
+    static constexpr size_t kMaxNumSllAddi = 3u;
+    int32_t addi_values[kMaxNumSllAddi];
+    size_t sll_shamts[kMaxNumSllAddi];
+    size_t num_sll_addi = 0u;
+    while (!is_simple_li_value(value)) {
+      DCHECK_LT(num_sll_addi, kMaxNumSllAddi);
+      // Prepare sign-extended low 12 bits for ADDI.
+      int64_t addi_value = (value & 0xfff) - ((value & 0x800) << 1);
+      DCHECK(IsInt<12>(addi_value));
+      int64_t remaining = value - addi_value;
+      size_t shamt = CTZ(remaining);
+      DCHECK_GE(shamt, 12u);
+      addi_values[num_sll_addi] = addi_value;
+      sll_shamts[num_sll_addi] = shamt;
+      value = remaining >> shamt;
+      ++num_sll_addi;
+    }
+    if (num_sll_addi != 0u && IsInt<20>(value) && !IsInt<12>(value)) {
+      // If `sll_shamts[num_sll_addi - 1u]` was only 12, we would have stopped
+      // the decomposition a step earlier with smaller `num_sll_addi`.
+      DCHECK_GT(sll_shamts[num_sll_addi - 1u], 12u);
+      // Emit the signed 20-bit value with LUI and reduce the SLLI shamt by 12 to compensate.
+      sll_shamts[num_sll_addi - 1u] -= 12u;
+      lui(rd, dchecked_integral_cast<uint32_t>(value & 0xfffff));
+    } else {
+      emit_simple_li_helper(rd, value, addi, addiw, slli, lui);
+    }
+    for (size_t i = num_sll_addi; i != 0u; ) {
+      --i;
+      slli(rd, rd, sll_shamts[i]);
+      if (addi_values[i] != 0) {
+        addi(rd, rd, addi_values[i]);
+      }
+    }
+  };
+  auto emit_with_slli_addi = [&](XRegister rd, int64_t value) {
+    emit_with_slli_addi_helper(rd, value, addi, addiw, slli, lui);
+  };
+  auto count_instructions_with_slli_addi = [&](int64_t value) {
+    size_t num_instructions = 0u;
+    auto count_rri = [&](XRegister, XRegister, int32_t) { ++num_instructions; };
+    auto count_ru = [&](XRegister, uint32_t) { ++num_instructions; };
+    emit_with_slli_addi_helper(Zero, value, count_rri, count_rri, count_rri, count_ru);
+    return num_instructions;
+  };
+
+  size_t insns_needed = count_instructions_with_slli_addi(imm);
+  size_t trailing_slli_shamt = 0u;
+  if (insns_needed > 2u) {
+    // Sometimes it's better to end with a SLLI even when the above code would end with ADDI.
+    if ((imm & 1) == 0 && (imm & 0xfff) != 0) {
+      int64_t value = imm >> CTZ(imm);
+      size_t new_insns_needed = count_instructions_with_slli_addi(value) + /*SLLI*/ 1u;
+      DCHECK_GT(new_insns_needed, 2u);
+      if (insns_needed > new_insns_needed) {
+        insns_needed = new_insns_needed;
+        trailing_slli_shamt = CTZ(imm);
+      }
+    }
+
+    // Sometimes we can emit a shorter sequence that ends with SRLI.
+    if (imm > 0) {
+      size_t shamt = CLZ(static_cast<uint64_t>(imm));
+      DCHECK_LE(shamt, 32u);  // Otherwise we would not get here as `insns_needed` would be <= 2.
+      if (imm == dchecked_integral_cast<int64_t>(MaxInt<uint64_t>(64 - shamt))) {
+        Addi(rd, Zero, -1);
+        Srli(rd, rd, shamt);
+        return;
+      }
+
+      int64_t value = static_cast<int64_t>(static_cast<uint64_t>(imm) << shamt);
+      DCHECK_LT(value, 0);
+      if (is_simple_li_value(value)){
+        size_t new_insns_needed = count_simple_li_instructions(value) + /*SRLI*/ 1u;
+        // In case of equal number of instructions, clang prefers the sequence without SRLI.
+        if (new_insns_needed < insns_needed) {
+          // If we emit ADDI, we set low bits that shall be shifted out to one in line with clang,
+          // effectively choosing to emit the negative constant closest to zero.
+          int32_t shifted_out = dchecked_integral_cast<int32_t>(MaxInt<uint32_t>(shamt));
+          DCHECK_EQ(value & shifted_out, 0);
+          emit_simple_li(rd, (value & 0xfff) == 0 ? value : value + shifted_out);
+          Srli(rd, rd, shamt);
+          return;
+        }
+      }
+
+      size_t ctz = CTZ(static_cast<uint64_t>(value));
+      if (IsInt(ctz + 20, value)) {
+        size_t new_insns_needed = /*ADDI or LUI*/ 1u + /*SLLI*/ 1u + /*SRLI*/ 1u;
+        if (new_insns_needed < insns_needed) {
+          // Clang prefers ADDI+SLLI+SRLI over LUI+SLLI+SRLI.
+          if (IsInt(ctz + 12, value)) {
+            Addi(rd, Zero, value >> ctz);
+            Slli(rd, rd, ctz);
+          } else {
+            Lui(rd, (static_cast<uint64_t>(value) >> ctz) & 0xfffffu);
+            Slli(rd, rd, ctz - 12);
+          }
+          Srli(rd, rd, shamt);
+          return;
+        }
+      }
+    }
+
+    // If we can use a scratch register, try using it to emit a shorter sequence. Without a
+    // scratch reg, the sequence is up to 8 instructions, with a scratch reg only up to 6.
+    if (can_use_tmp) {
+      int64_t low = (imm & 0xffffffff) - ((imm & 0x80000000) << 1);
+      int64_t remainder = imm - low;
+      size_t slli_shamt = CTZ(remainder);
+      DCHECK_GE(slli_shamt, 32u);
+      int64_t high = remainder >> slli_shamt;
+      size_t new_insns_needed =
+          ((IsInt<20>(high) || (high & 0xfff) == 0u) ? 1u : 2u) +
+          count_simple_li_instructions(low) +
+          /*SLLI+ADD*/ 2u;
+      if (new_insns_needed < insns_needed) {
+        DCHECK_NE(low & 0xfffff000, 0);
+        XRegister tmp = srs.AllocateXRegister();
+        if (IsInt<20>(high) && !IsInt<12>(high)) {
+          // Emit the signed 20-bit value with LUI and reduce the SLLI shamt by 12 to compensate.
+          Lui(rd, static_cast<uint32_t>(high & 0xfffff));
+          slli_shamt -= 12;
+        } else {
+          emit_simple_li(rd, high);
+        }
+        emit_simple_li(tmp, low);
+        Slli(rd, rd, slli_shamt);
+        Add(rd, rd, tmp);
+        return;
+      }
+    }
+  }
+  emit_with_slli_addi(rd, trailing_slli_shamt != 0u ? imm >> trailing_slli_shamt : imm);
+  if (trailing_slli_shamt != 0u) {
+    Slli(rd, rd, trailing_slli_shamt);
+  }
+}
+
+/////////////////////////////// RV64 VARIANTS extension end ////////////
+
+}  // namespace riscv64
+}  // namespace art
diff --git a/compiler/utils/riscv64/assembler_riscv64.h b/compiler/utils/riscv64/assembler_riscv64.h
new file mode 100644
index 0000000..40c6381
--- /dev/null
+++ b/compiler/utils/riscv64/assembler_riscv64.h
@@ -0,0 +1,2844 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_COMPILER_UTILS_RISCV64_ASSEMBLER_RISCV64_H_
+#define ART_COMPILER_UTILS_RISCV64_ASSEMBLER_RISCV64_H_
+
+#include <cstdint>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "arch/riscv64/instruction_set_features_riscv64.h"
+#include "base/arena_containers.h"
+#include "base/enums.h"
+#include "base/globals.h"
+#include "base/macros.h"
+#include "managed_register_riscv64.h"
+#include "utils/assembler.h"
+#include "utils/label.h"
+
+namespace art HIDDEN {
+namespace riscv64 {
+
+class ScratchRegisterScope;
+
+static constexpr size_t kRiscv64HalfwordSize = 2;
+static constexpr size_t kRiscv64WordSize = 4;
+static constexpr size_t kRiscv64DoublewordSize = 8;
+static constexpr size_t kRiscv64FloatRegSizeInBytes = 8;
+
+// The `Riscv64Extension` enumeration is used for restricting the instructions that the assembler
+// can use. Some restrictions are checked only in debug mode (for example load and store
+// instructions check `kLoadStore`), other restrictions are checked at run time and affect the
+// emitted code (for example, the `SextW()` pseudo-instruction selects between an implementation
+// from "Zcb", "Zbb" and a two-instruction sequence from the basic instruction set.
+enum class Riscv64Extension : uint32_t {
+  kLoadStore,  // Pseudo-extension encompassing all loads and stores. Used to check that
+               // we do not have loads and stores in the middle of a LR/SC sequence.
+  kZifencei,
+  kM,
+  kA,
+  kZicsr,
+  kF,
+  kD,
+  kZba,
+  kZbb,
+  kZbs,  // TODO(riscv64): Implement "Zbs" instructions.
+  kV,
+  kZca,  // "C" extension instructions except floating point loads/stores.
+  kZcd,  // "C" extension double loads/stores.
+         // Note: RV64 cannot implement Zcf ("C" extension float loads/stores).
+  kZcb,  // Simple 16-bit operations not present in the original "C" extension.
+
+  kLast = kZcb
+};
+
+using Riscv64ExtensionMask = uint32_t;
+
+constexpr Riscv64ExtensionMask Riscv64ExtensionBit(Riscv64Extension ext) {
+  return 1u << enum_cast<>(ext);
+}
+
+constexpr Riscv64ExtensionMask kRiscv64AllExtensionsMask =
+    MaxInt<Riscv64ExtensionMask>(enum_cast<>(Riscv64Extension::kLast) + 1);
+
+// Extensions allowed in a LR/SC sequence (between the LR and SC).
+constexpr Riscv64ExtensionMask kRiscv64LrScSequenceExtensionsMask =
+    Riscv64ExtensionBit(Riscv64Extension::kZca);
+
+enum class FPRoundingMode : uint32_t {
+  kRNE = 0x0,  // Round to Nearest, ties to Even
+  kRTZ = 0x1,  // Round towards Zero
+  kRDN = 0x2,  // Round Down (towards −Infinity)
+  kRUP = 0x3,  // Round Up (towards +Infinity)
+  kRMM = 0x4,  // Round to Nearest, ties to Max Magnitude
+  kDYN = 0x7,  // Dynamic rounding mode
+  kDefault = kDYN,
+  // Some instructions never need to round even though the spec includes the RM field.
+  // To simplify testing, emit the RM as 0 by default for these instructions because that's what
+  // `clang` does and because the `llvm-objdump` fails to disassemble the other rounding modes.
+  kIgnored = 0
+};
+
+enum class AqRl : uint32_t {
+  kNone    = 0x0,
+  kRelease = 0x1,
+  kAcquire = 0x2,
+  kAqRl    = kRelease | kAcquire
+};
+
+// the type for fence
+enum FenceType {
+  kFenceNone = 0,
+  kFenceWrite = 1,
+  kFenceRead = 2,
+  kFenceOutput = 4,
+  kFenceInput = 8,
+  kFenceDefault = 0xf,
+};
+
+// Used to test the values returned by FClassS/FClassD.
+enum FPClassMaskType {
+  kNegativeInfinity  = 0x001,
+  kNegativeNormal    = 0x002,
+  kNegativeSubnormal = 0x004,
+  kNegativeZero      = 0x008,
+  kPositiveZero      = 0x010,
+  kPositiveSubnormal = 0x020,
+  kPositiveNormal    = 0x040,
+  kPositiveInfinity  = 0x080,
+  kSignalingNaN      = 0x100,
+  kQuietNaN          = 0x200,
+};
+
+enum class CSRAddress : uint32_t {
+  kVstart = 0x008,     // Vector start position, URW
+  kVxsat = 0x009,      // Fixed-Point Saturate Flag, URW
+  kVxrm = 0x00A,       // Fixed-Point Rounding Mode, URW
+  kReserved1 = 0x00B,  // Reserved for future vector CSRs
+  kReserved2 = 0x00C,
+  kReserved3 = 0x00D,
+  kReserved4 = 0x00E,
+  kVcsr = 0x00F,   // Vector control and status register, URW
+  kVl = 0xC20,     // Vector length, URO
+  kVtype = 0xC21,  // Vector data type register, URO
+  kVlenb = 0xC22,  // VLEN/8 (vector register length in bytes), URO
+};
+
+class Riscv64Label : public Label {
+ public:
+  Riscv64Label() : prev_branch_id_(kNoPrevBranchId) {}
+
+  Riscv64Label(Riscv64Label&& src) noexcept
+      // NOLINTNEXTLINE - src.prev_branch_id_ is valid after the move
+      : Label(std::move(src)), prev_branch_id_(src.prev_branch_id_) {}
+
+ private:
+  static constexpr uint32_t kNoPrevBranchId = std::numeric_limits<uint32_t>::max();
+
+  uint32_t prev_branch_id_;  // To get distance from preceding branch, if any.
+
+  friend class Riscv64Assembler;
+  DISALLOW_COPY_AND_ASSIGN(Riscv64Label);
+};
+
+// Assembler literal is a value embedded in code, retrieved using a PC-relative load.
+class Literal {
+ public:
+  static constexpr size_t kMaxSize = 8;
+
+  Literal(uint32_t size, const uint8_t* data) : label_(), size_(size) {
+    DCHECK_LE(size, Literal::kMaxSize);
+    memcpy(data_, data, size);
+  }
+
+  template <typename T>
+  T GetValue() const {
+    DCHECK_EQ(size_, sizeof(T));
+    T value;
+    memcpy(&value, data_, sizeof(T));
+    return value;
+  }
+
+  uint32_t GetSize() const { return size_; }
+
+  const uint8_t* GetData() const { return data_; }
+
+  Riscv64Label* GetLabel() { return &label_; }
+
+  const Riscv64Label* GetLabel() const { return &label_; }
+
+ private:
+  Riscv64Label label_;
+  const uint32_t size_;
+  uint8_t data_[kMaxSize];
+
+  DISALLOW_COPY_AND_ASSIGN(Literal);
+};
+
+// Jump table: table of labels emitted after the code and before the literals. Similar to literals.
+class JumpTable {
+ public:
+  explicit JumpTable(ArenaVector<Riscv64Label*>&& labels) : label_(), labels_(std::move(labels)) {}
+
+  size_t GetSize() const { return labels_.size() * sizeof(int32_t); }
+
+  const ArenaVector<Riscv64Label*>& GetData() const { return labels_; }
+
+  Riscv64Label* GetLabel() { return &label_; }
+
+  const Riscv64Label* GetLabel() const { return &label_; }
+
+ private:
+  Riscv64Label label_;
+  ArenaVector<Riscv64Label*> labels_;
+
+  DISALLOW_COPY_AND_ASSIGN(JumpTable);
+};
+
+class Riscv64Assembler final : public Assembler {
+ public:
+  explicit Riscv64Assembler(ArenaAllocator* allocator,
+                            const Riscv64InstructionSetFeatures* instruction_set_features = nullptr)
+      : Riscv64Assembler(allocator,
+                         instruction_set_features != nullptr
+                             ? ConvertExtensions(instruction_set_features)
+                             : kRiscv64AllExtensionsMask) {}
+
+  Riscv64Assembler(ArenaAllocator* allocator, Riscv64ExtensionMask enabled_extensions)
+      : Assembler(allocator),
+        branches_(allocator->Adapter(kArenaAllocAssembler)),
+        finalized_(false),
+        overwriting_(false),
+        overwrite_location_(0),
+        literals_(allocator->Adapter(kArenaAllocAssembler)),
+        long_literals_(allocator->Adapter(kArenaAllocAssembler)),
+        jump_tables_(allocator->Adapter(kArenaAllocAssembler)),
+        last_position_adjustment_(0),
+        last_old_position_(0),
+        last_branch_id_(0),
+        enabled_extensions_(enabled_extensions),
+        available_scratch_core_registers_((1u << TMP) | (1u << TMP2)),
+        available_scratch_fp_registers_(1u << FTMP) {
+    cfi().DelayEmittingAdvancePCs();
+  }
+
+  virtual ~Riscv64Assembler() {
+    for (auto& branch : branches_) {
+      CHECK(branch.IsResolved());
+    }
+  }
+
+  size_t CodeSize() const override { return Assembler::CodeSize(); }
+  DebugFrameOpCodeWriterForAssembler& cfi() { return Assembler::cfi(); }
+
+  bool IsExtensionEnabled(Riscv64Extension ext) {
+    return (enabled_extensions_ & Riscv64ExtensionBit(ext)) != 0u;
+  }
+
+  // According to "The RISC-V Instruction Set Manual"
+
+  // LUI/AUIPC (RV32I, with sign-extension on RV64I), opcode = 0x17, 0x37
+  // Note: These take a 20-bit unsigned value to align with the clang assembler for testing,
+  // but the value stored in the register shall actually be sign-extended to 64 bits.
+  void Lui(XRegister rd, uint32_t imm20);
+  void Auipc(XRegister rd, uint32_t imm20);
+
+  // Jump instructions (RV32I), opcode = 0x67, 0x6f
+  void Jal(XRegister rd, int32_t offset);
+  void Jalr(XRegister rd, XRegister rs1, int32_t offset);
+
+  // Branch instructions (RV32I), opcode = 0x63, funct3 from 0x0 ~ 0x1 and 0x4 ~ 0x7
+  void Beq(XRegister rs1, XRegister rs2, int32_t offset);
+  void Bne(XRegister rs1, XRegister rs2, int32_t offset);
+  void Blt(XRegister rs1, XRegister rs2, int32_t offset);
+  void Bge(XRegister rs1, XRegister rs2, int32_t offset);
+  void Bltu(XRegister rs1, XRegister rs2, int32_t offset);
+  void Bgeu(XRegister rs1, XRegister rs2, int32_t offset);
+
+  // Load instructions (RV32I+RV64I): opcode = 0x03, funct3 from 0x0 ~ 0x6
+  void Lb(XRegister rd, XRegister rs1, int32_t offset);
+  void Lh(XRegister rd, XRegister rs1, int32_t offset);
+  void Lw(XRegister rd, XRegister rs1, int32_t offset);
+  void Ld(XRegister rd, XRegister rs1, int32_t offset);
+  void Lbu(XRegister rd, XRegister rs1, int32_t offset);
+  void Lhu(XRegister rd, XRegister rs1, int32_t offset);
+  void Lwu(XRegister rd, XRegister rs1, int32_t offset);
+
+  // Store instructions (RV32I+RV64I): opcode = 0x23, funct3 from 0x0 ~ 0x3
+  void Sb(XRegister rs2, XRegister rs1, int32_t offset);
+  void Sh(XRegister rs2, XRegister rs1, int32_t offset);
+  void Sw(XRegister rs2, XRegister rs1, int32_t offset);
+  void Sd(XRegister rs2, XRegister rs1, int32_t offset);
+
+  // IMM ALU instructions (RV32I): opcode = 0x13, funct3 from 0x0 ~ 0x7
+  void Addi(XRegister rd, XRegister rs1, int32_t imm12);
+  void Slti(XRegister rd, XRegister rs1, int32_t imm12);
+  void Sltiu(XRegister rd, XRegister rs1, int32_t imm12);
+  void Xori(XRegister rd, XRegister rs1, int32_t imm12);
+  void Ori(XRegister rd, XRegister rs1, int32_t imm12);
+  void Andi(XRegister rd, XRegister rs1, int32_t imm12);
+  void Slli(XRegister rd, XRegister rs1, int32_t shamt);
+  void Srli(XRegister rd, XRegister rs1, int32_t shamt);
+  void Srai(XRegister rd, XRegister rs1, int32_t shamt);
+
+  // ALU instructions (RV32I): opcode = 0x33, funct3 from 0x0 ~ 0x7
+  void Add(XRegister rd, XRegister rs1, XRegister rs2);
+  void Sub(XRegister rd, XRegister rs1, XRegister rs2);
+  void Slt(XRegister rd, XRegister rs1, XRegister rs2);
+  void Sltu(XRegister rd, XRegister rs1, XRegister rs2);
+  void Xor(XRegister rd, XRegister rs1, XRegister rs2);
+  void Or(XRegister rd, XRegister rs1, XRegister rs2);
+  void And(XRegister rd, XRegister rs1, XRegister rs2);
+  void Sll(XRegister rd, XRegister rs1, XRegister rs2);
+  void Srl(XRegister rd, XRegister rs1, XRegister rs2);
+  void Sra(XRegister rd, XRegister rs1, XRegister rs2);
+
+  // 32bit Imm ALU instructions (RV64I): opcode = 0x1b, funct3 from 0x0, 0x1, 0x5
+  void Addiw(XRegister rd, XRegister rs1, int32_t imm12);
+  void Slliw(XRegister rd, XRegister rs1, int32_t shamt);
+  void Srliw(XRegister rd, XRegister rs1, int32_t shamt);
+  void Sraiw(XRegister rd, XRegister rs1, int32_t shamt);
+
+  // 32bit ALU instructions (RV64I): opcode = 0x3b, funct3 from 0x0 ~ 0x7
+  void Addw(XRegister rd, XRegister rs1, XRegister rs2);
+  void Subw(XRegister rd, XRegister rs1, XRegister rs2);
+  void Sllw(XRegister rd, XRegister rs1, XRegister rs2);
+  void Srlw(XRegister rd, XRegister rs1, XRegister rs2);
+  void Sraw(XRegister rd, XRegister rs1, XRegister rs2);
+
+  // Environment call and breakpoint (RV32I), opcode = 0x73
+  void Ecall();
+  void Ebreak();
+
+  // Fence instruction (RV32I): opcode = 0xf, funct3 = 0
+  void Fence(uint32_t pred = kFenceDefault, uint32_t succ = kFenceDefault);
+  void FenceTso();
+
+  // "Zifencei" Standard Extension, opcode = 0xf, funct3 = 1
+  void FenceI();
+
+  // RV32M Standard Extension: opcode = 0x33, funct3 from 0x0 ~ 0x7
+  void Mul(XRegister rd, XRegister rs1, XRegister rs2);
+  void Mulh(XRegister rd, XRegister rs1, XRegister rs2);
+  void Mulhsu(XRegister rd, XRegister rs1, XRegister rs2);
+  void Mulhu(XRegister rd, XRegister rs1, XRegister rs2);
+  void Div(XRegister rd, XRegister rs1, XRegister rs2);
+  void Divu(XRegister rd, XRegister rs1, XRegister rs2);
+  void Rem(XRegister rd, XRegister rs1, XRegister rs2);
+  void Remu(XRegister rd, XRegister rs1, XRegister rs2);
+
+  // RV64M Standard Extension: opcode = 0x3b, funct3 0x0 and from 0x4 ~ 0x7
+  void Mulw(XRegister rd, XRegister rs1, XRegister rs2);
+  void Divw(XRegister rd, XRegister rs1, XRegister rs2);
+  void Divuw(XRegister rd, XRegister rs1, XRegister rs2);
+  void Remw(XRegister rd, XRegister rs1, XRegister rs2);
+  void Remuw(XRegister rd, XRegister rs1, XRegister rs2);
+
+  // RV32A/RV64A Standard Extension
+  void LrW(XRegister rd, XRegister rs1, AqRl aqrl);
+  void LrD(XRegister rd, XRegister rs1, AqRl aqrl);
+  void ScW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void ScD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoSwapW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoSwapD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoAddW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoAddD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoXorW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoXorD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoAndW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoAndD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoOrW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoOrD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoMinW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoMinD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoMaxW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoMaxD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoMinuW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoMinuD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoMaxuW(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+  void AmoMaxuD(XRegister rd, XRegister rs2, XRegister rs1, AqRl aqrl);
+
+  // "Zicsr" Standard Extension, opcode = 0x73, funct3 from 0x1 ~ 0x3 and 0x5 ~ 0x7
+  void Csrrw(XRegister rd, uint32_t csr, XRegister rs1);
+  void Csrrs(XRegister rd, uint32_t csr, XRegister rs1);
+  void Csrrc(XRegister rd, uint32_t csr, XRegister rs1);
+  void Csrrwi(XRegister rd, uint32_t csr, uint32_t uimm5);
+  void Csrrsi(XRegister rd, uint32_t csr, uint32_t uimm5);
+  void Csrrci(XRegister rd, uint32_t csr, uint32_t uimm5);
+
+  // FP load/store instructions (RV32F+RV32D): opcode = 0x07, 0x27
+  void FLw(FRegister rd, XRegister rs1, int32_t offset);
+  void FLd(FRegister rd, XRegister rs1, int32_t offset);
+  void FSw(FRegister rs2, XRegister rs1, int32_t offset);
+  void FSd(FRegister rs2, XRegister rs1, int32_t offset);
+
+  // FP FMA instructions (RV32F+RV32D): opcode = 0x43, 0x47, 0x4b, 0x4f
+  void FMAddS(FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3, FPRoundingMode frm);
+  void FMAddD(FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3, FPRoundingMode frm);
+  void FMSubS(FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3, FPRoundingMode frm);
+  void FMSubD(FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3, FPRoundingMode frm);
+  void FNMSubS(FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3, FPRoundingMode frm);
+  void FNMSubD(FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3, FPRoundingMode frm);
+  void FNMAddS(FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3, FPRoundingMode frm);
+  void FNMAddD(FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3, FPRoundingMode frm);
+
+  // FP FMA instruction helpers passing the default rounding mode.
+  void FMAddS(FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3) {
+    FMAddS(rd, rs1, rs2, rs3, FPRoundingMode::kDefault);
+  }
+  void FMAddD(FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3) {
+    FMAddD(rd, rs1, rs2, rs3, FPRoundingMode::kDefault);
+  }
+  void FMSubS(FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3) {
+    FMSubS(rd, rs1, rs2, rs3, FPRoundingMode::kDefault);
+  }
+  void FMSubD(FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3) {
+    FMSubD(rd, rs1, rs2, rs3, FPRoundingMode::kDefault);
+  }
+  void FNMSubS(FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3) {
+    FNMSubS(rd, rs1, rs2, rs3, FPRoundingMode::kDefault);
+  }
+  void FNMSubD(FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3) {
+    FNMSubD(rd, rs1, rs2, rs3, FPRoundingMode::kDefault);
+  }
+  void FNMAddS(FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3) {
+    FNMAddS(rd, rs1, rs2, rs3, FPRoundingMode::kDefault);
+  }
+  void FNMAddD(FRegister rd, FRegister rs1, FRegister rs2, FRegister rs3) {
+    FNMAddD(rd, rs1, rs2, rs3, FPRoundingMode::kDefault);
+  }
+
+  // Simple FP instructions (RV32F+RV32D): opcode = 0x53, funct7 = 0b0XXXX0D
+  void FAddS(FRegister rd, FRegister rs1, FRegister rs2, FPRoundingMode frm);
+  void FAddD(FRegister rd, FRegister rs1, FRegister rs2, FPRoundingMode frm);
+  void FSubS(FRegister rd, FRegister rs1, FRegister rs2, FPRoundingMode frm);
+  void FSubD(FRegister rd, FRegister rs1, FRegister rs2, FPRoundingMode frm);
+  void FMulS(FRegister rd, FRegister rs1, FRegister rs2, FPRoundingMode frm);
+  void FMulD(FRegister rd, FRegister rs1, FRegister rs2, FPRoundingMode frm);
+  void FDivS(FRegister rd, FRegister rs1, FRegister rs2, FPRoundingMode frm);
+  void FDivD(FRegister rd, FRegister rs1, FRegister rs2, FPRoundingMode frm);
+  void FSqrtS(FRegister rd, FRegister rs1, FPRoundingMode frm);
+  void FSqrtD(FRegister rd, FRegister rs1, FPRoundingMode frm);
+  void FSgnjS(FRegister rd, FRegister rs1, FRegister rs2);
+  void FSgnjD(FRegister rd, FRegister rs1, FRegister rs2);
+  void FSgnjnS(FRegister rd, FRegister rs1, FRegister rs2);
+  void FSgnjnD(FRegister rd, FRegister rs1, FRegister rs2);
+  void FSgnjxS(FRegister rd, FRegister rs1, FRegister rs2);
+  void FSgnjxD(FRegister rd, FRegister rs1, FRegister rs2);
+  void FMinS(FRegister rd, FRegister rs1, FRegister rs2);
+  void FMinD(FRegister rd, FRegister rs1, FRegister rs2);
+  void FMaxS(FRegister rd, FRegister rs1, FRegister rs2);
+  void FMaxD(FRegister rd, FRegister rs1, FRegister rs2);
+  void FCvtSD(FRegister rd, FRegister rs1, FPRoundingMode frm);
+  void FCvtDS(FRegister rd, FRegister rs1, FPRoundingMode frm);
+
+  // Simple FP instruction helpers passing the default rounding mode.
+  void FAddS(FRegister rd, FRegister rs1, FRegister rs2) {
+    FAddS(rd, rs1, rs2, FPRoundingMode::kDefault);
+  }
+  void FAddD(FRegister rd, FRegister rs1, FRegister rs2) {
+    FAddD(rd, rs1, rs2, FPRoundingMode::kDefault);
+  }
+  void FSubS(FRegister rd, FRegister rs1, FRegister rs2) {
+    FSubS(rd, rs1, rs2, FPRoundingMode::kDefault);
+  }
+  void FSubD(FRegister rd, FRegister rs1, FRegister rs2) {
+    FSubD(rd, rs1, rs2, FPRoundingMode::kDefault);
+  }
+  void FMulS(FRegister rd, FRegister rs1, FRegister rs2) {
+    FMulS(rd, rs1, rs2, FPRoundingMode::kDefault);
+  }
+  void FMulD(FRegister rd, FRegister rs1, FRegister rs2) {
+    FMulD(rd, rs1, rs2, FPRoundingMode::kDefault);
+  }
+  void FDivS(FRegister rd, FRegister rs1, FRegister rs2) {
+    FDivS(rd, rs1, rs2, FPRoundingMode::kDefault);
+  }
+  void FDivD(FRegister rd, FRegister rs1, FRegister rs2) {
+    FDivD(rd, rs1, rs2, FPRoundingMode::kDefault);
+  }
+  void FSqrtS(FRegister rd, FRegister rs1) {
+    FSqrtS(rd, rs1, FPRoundingMode::kDefault);
+  }
+  void FSqrtD(FRegister rd, FRegister rs1) {
+    FSqrtD(rd, rs1, FPRoundingMode::kDefault);
+  }
+  void FCvtSD(FRegister rd, FRegister rs1) {
+    FCvtSD(rd, rs1, FPRoundingMode::kDefault);
+  }
+  void FCvtDS(FRegister rd, FRegister rs1) {
+    FCvtDS(rd, rs1, FPRoundingMode::kIgnored);
+  }
+
+  // FP compare instructions (RV32F+RV32D): opcode = 0x53, funct7 = 0b101000D
+  void FEqS(XRegister rd, FRegister rs1, FRegister rs2);
+  void FEqD(XRegister rd, FRegister rs1, FRegister rs2);
+  void FLtS(XRegister rd, FRegister rs1, FRegister rs2);
+  void FLtD(XRegister rd, FRegister rs1, FRegister rs2);
+  void FLeS(XRegister rd, FRegister rs1, FRegister rs2);
+  void FLeD(XRegister rd, FRegister rs1, FRegister rs2);
+
+  // FP conversion instructions (RV32F+RV32D+RV64F+RV64D): opcode = 0x53, funct7 = 0b110X00D
+  void FCvtWS(XRegister rd, FRegister rs1, FPRoundingMode frm);
+  void FCvtWD(XRegister rd, FRegister rs1, FPRoundingMode frm);
+  void FCvtWuS(XRegister rd, FRegister rs1, FPRoundingMode frm);
+  void FCvtWuD(XRegister rd, FRegister rs1, FPRoundingMode frm);
+  void FCvtLS(XRegister rd, FRegister rs1, FPRoundingMode frm);
+  void FCvtLD(XRegister rd, FRegister rs1, FPRoundingMode frm);
+  void FCvtLuS(XRegister rd, FRegister rs1, FPRoundingMode frm);
+  void FCvtLuD(XRegister rd, FRegister rs1, FPRoundingMode frm);
+  void FCvtSW(FRegister rd, XRegister rs1, FPRoundingMode frm);
+  void FCvtDW(FRegister rd, XRegister rs1, FPRoundingMode frm);
+  void FCvtSWu(FRegister rd, XRegister rs1, FPRoundingMode frm);
+  void FCvtDWu(FRegister rd, XRegister rs1, FPRoundingMode frm);
+  void FCvtSL(FRegister rd, XRegister rs1, FPRoundingMode frm);
+  void FCvtDL(FRegister rd, XRegister rs1, FPRoundingMode frm);
+  void FCvtSLu(FRegister rd, XRegister rs1, FPRoundingMode frm);
+  void FCvtDLu(FRegister rd, XRegister rs1, FPRoundingMode frm);
+
+  // FP conversion instruction helpers passing the default rounding mode.
+  void FCvtWS(XRegister rd, FRegister rs1) { FCvtWS(rd, rs1, FPRoundingMode::kDefault); }
+  void FCvtWD(XRegister rd, FRegister rs1) { FCvtWD(rd, rs1, FPRoundingMode::kDefault); }
+  void FCvtWuS(XRegister rd, FRegister rs1) { FCvtWuS(rd, rs1, FPRoundingMode::kDefault); }
+  void FCvtWuD(XRegister rd, FRegister rs1) { FCvtWuD(rd, rs1, FPRoundingMode::kDefault); }
+  void FCvtLS(XRegister rd, FRegister rs1) { FCvtLS(rd, rs1, FPRoundingMode::kDefault); }
+  void FCvtLD(XRegister rd, FRegister rs1) { FCvtLD(rd, rs1, FPRoundingMode::kDefault); }
+  void FCvtLuS(XRegister rd, FRegister rs1) { FCvtLuS(rd, rs1, FPRoundingMode::kDefault); }
+  void FCvtLuD(XRegister rd, FRegister rs1) { FCvtLuD(rd, rs1, FPRoundingMode::kDefault); }
+  void FCvtSW(FRegister rd, XRegister rs1) { FCvtSW(rd, rs1, FPRoundingMode::kDefault); }
+  void FCvtDW(FRegister rd, XRegister rs1) { FCvtDW(rd, rs1, FPRoundingMode::kIgnored); }
+  void FCvtSWu(FRegister rd, XRegister rs1) { FCvtSWu(rd, rs1, FPRoundingMode::kDefault); }
+  void FCvtDWu(FRegister rd, XRegister rs1) { FCvtDWu(rd, rs1, FPRoundingMode::kIgnored); }
+  void FCvtSL(FRegister rd, XRegister rs1) { FCvtSL(rd, rs1, FPRoundingMode::kDefault); }
+  void FCvtDL(FRegister rd, XRegister rs1) { FCvtDL(rd, rs1, FPRoundingMode::kDefault); }
+  void FCvtSLu(FRegister rd, XRegister rs1) { FCvtSLu(rd, rs1, FPRoundingMode::kDefault); }
+  void FCvtDLu(FRegister rd, XRegister rs1) { FCvtDLu(rd, rs1, FPRoundingMode::kDefault); }
+
+  // FP move instructions (RV32F+RV32D): opcode = 0x53, funct3 = 0x0, funct7 = 0b111X00D
+  void FMvXW(XRegister rd, FRegister rs1);
+  void FMvXD(XRegister rd, FRegister rs1);
+  void FMvWX(FRegister rd, XRegister rs1);
+  void FMvDX(FRegister rd, XRegister rs1);
+
+  // FP classify instructions (RV32F+RV32D): opcode = 0x53, funct3 = 0x1, funct7 = 0b111X00D
+  void FClassS(XRegister rd, FRegister rs1);
+  void FClassD(XRegister rd, FRegister rs1);
+
+  // "C" Standard Extension, Compresseed Instructions
+  void CLwsp(XRegister rd, int32_t offset);
+  void CLdsp(XRegister rd, int32_t offset);
+  void CFLdsp(FRegister rd, int32_t offset);
+  void CSwsp(XRegister rs2, int32_t offset);
+  void CSdsp(XRegister rs2, int32_t offset);
+  void CFSdsp(FRegister rs2, int32_t offset);
+
+  void CLw(XRegister rd_s, XRegister rs1_s, int32_t offset);
+  void CLd(XRegister rd_s, XRegister rs1_s, int32_t offset);
+  void CFLd(FRegister rd_s, XRegister rs1_s, int32_t offset);
+  void CSw(XRegister rs2_s, XRegister rs1_s, int32_t offset);
+  void CSd(XRegister rs2_s, XRegister rs1_s, int32_t offset);
+  void CFSd(FRegister rs2_s, XRegister rs1_s, int32_t offset);
+
+  void CLi(XRegister rd, int32_t imm);
+  void CLui(XRegister rd, uint32_t nzimm6);
+  void CAddi(XRegister rd, int32_t nzimm);
+  void CAddiw(XRegister rd, int32_t imm);
+  void CAddi16Sp(int32_t nzimm);
+  void CAddi4Spn(XRegister rd_s, uint32_t nzuimm);
+  void CSlli(XRegister rd, int32_t shamt);
+  void CSrli(XRegister rd_s, int32_t shamt);
+  void CSrai(XRegister rd_s, int32_t shamt);
+  void CAndi(XRegister rd_s, int32_t imm);
+  void CMv(XRegister rd, XRegister rs2);
+  void CAdd(XRegister rd, XRegister rs2);
+  void CAnd(XRegister rd_s, XRegister rs2_s);
+  void COr(XRegister rd_s, XRegister rs2_s);
+  void CXor(XRegister rd_s, XRegister rs2_s);
+  void CSub(XRegister rd_s, XRegister rs2_s);
+  void CAddw(XRegister rd_s, XRegister rs2_s);
+  void CSubw(XRegister rd_s, XRegister rs2_s);
+
+  // "Zcb" Standard Extension, part of "C", opcode = 0b00, 0b01, funct3 = 0b100.
+  void CLbu(XRegister rd_s, XRegister rs1_s, int32_t offset);
+  void CLhu(XRegister rd_s, XRegister rs1_s, int32_t offset);
+  void CLh(XRegister rd_s, XRegister rs1_s, int32_t offset);
+  void CSb(XRegister rd_s, XRegister rs1_s, int32_t offset);
+  void CSh(XRegister rd_s, XRegister rs1_s, int32_t offset);
+  void CZextB(XRegister rd_rs1_s);
+  void CSextB(XRegister rd_rs1_s);
+  void CZextH(XRegister rd_rs1_s);
+  void CSextH(XRegister rd_rs1_s);
+  void CZextW(XRegister rd_rs1_s);
+  void CNot(XRegister rd_rs1_s);
+  void CMul(XRegister rd_s, XRegister rs2_s);
+  // "Zcb" Standard Extension End; resume "C" Standard Extension.
+  // TODO(riscv64): Reorder "Zcb" after remaining "C" instructions.
+
+  void CJ(int32_t offset);
+  void CJr(XRegister rs1);
+  void CJalr(XRegister rs1);
+  void CBeqz(XRegister rs1_s, int32_t offset);
+  void CBnez(XRegister rs1_s, int32_t offset);
+
+  void CEbreak();
+  void CNop();
+  void CUnimp();
+
+  // "Zba" Standard Extension, opcode = 0x1b, 0x33 or 0x3b, funct3 and funct7 varies.
+  void AddUw(XRegister rd, XRegister rs1, XRegister rs2);
+  void Sh1Add(XRegister rd, XRegister rs1, XRegister rs2);
+  void Sh1AddUw(XRegister rd, XRegister rs1, XRegister rs2);
+  void Sh2Add(XRegister rd, XRegister rs1, XRegister rs2);
+  void Sh2AddUw(XRegister rd, XRegister rs1, XRegister rs2);
+  void Sh3Add(XRegister rd, XRegister rs1, XRegister rs2);
+  void Sh3AddUw(XRegister rd, XRegister rs1, XRegister rs2);
+  void SlliUw(XRegister rd, XRegister rs1, int32_t shamt);
+
+  // "Zbb" Standard Extension, opcode = 0x13, 0x1b, 0x33 or 0x3b, funct3 and funct7 varies.
+  // Note: 32-bit sext.b, sext.h and zext.h from the Zbb extension are explicitly
+  // prefixed with "Zbb" to differentiate them from the utility macros.
+  void Andn(XRegister rd, XRegister rs1, XRegister rs2);
+  void Orn(XRegister rd, XRegister rs1, XRegister rs2);
+  void Xnor(XRegister rd, XRegister rs1, XRegister rs2);
+  void Clz(XRegister rd, XRegister rs1);
+  void Clzw(XRegister rd, XRegister rs1);
+  void Ctz(XRegister rd, XRegister rs1);
+  void Ctzw(XRegister rd, XRegister rs1);
+  void Cpop(XRegister rd, XRegister rs1);
+  void Cpopw(XRegister rd, XRegister rs1);
+  void Min(XRegister rd, XRegister rs1, XRegister rs2);
+  void Minu(XRegister rd, XRegister rs1, XRegister rs2);
+  void Max(XRegister rd, XRegister rs1, XRegister rs2);
+  void Maxu(XRegister rd, XRegister rs1, XRegister rs2);
+  void Rol(XRegister rd, XRegister rs1, XRegister rs2);
+  void Rolw(XRegister rd, XRegister rs1, XRegister rs2);
+  void Ror(XRegister rd, XRegister rs1, XRegister rs2);
+  void Rorw(XRegister rd, XRegister rs1, XRegister rs2);
+  void Rori(XRegister rd, XRegister rs1, int32_t shamt);
+  void Roriw(XRegister rd, XRegister rs1, int32_t shamt);
+  void OrcB(XRegister rd, XRegister rs1);
+  void Rev8(XRegister rd, XRegister rs1);
+  void ZbbSextB(XRegister rd, XRegister rs1);
+  void ZbbSextH(XRegister rd, XRegister rs1);
+  void ZbbZextH(XRegister rd, XRegister rs1);
+
+  ////////////////////////////// RISC-V Vector Instructions  START ///////////////////////////////
+  enum class LengthMultiplier : uint32_t {
+    kM1Over8 = 0b101,
+    kM1Over4 = 0b110,
+    kM1Over2 = 0b111,
+    kM1 = 0b000,
+    kM2 = 0b001,
+    kM4 = 0b010,
+    kM8 = 0b011,
+
+    kReserved1 = 0b100,
+  };
+
+  enum class SelectedElementWidth : uint32_t {
+    kE8 = 0b000,
+    kE16 = 0b001,
+    kE32 = 0b010,
+    kE64 = 0b011,
+
+    kReserved1 = 0b100,
+    kReserved2 = 0b101,
+    kReserved3 = 0b110,
+    kReserved4 = 0b111,
+  };
+
+  enum class VectorMaskAgnostic : uint32_t {
+    kUndisturbed = 0,
+    kAgnostic = 1,
+  };
+
+  enum class VectorTailAgnostic : uint32_t {
+    kUndisturbed = 0,
+    kAgnostic = 1,
+  };
+
+  enum class VM : uint32_t {  // Vector mask
+    kV0_t = 0b0,
+    kUnmasked = 0b1
+  };
+
+  // Vector Conguration-Setting Instructions, opcode = 0x57, funct3 = 0x3
+  void VSetvli(XRegister rd, XRegister rs1, uint32_t vtypei);
+  void VSetivli(XRegister rd, uint32_t uimm, uint32_t vtypei);
+  void VSetvl(XRegister rd, XRegister rs1, XRegister rs2);
+
+  static uint32_t VTypeiValue(VectorMaskAgnostic vma,
+                              VectorTailAgnostic vta,
+                              SelectedElementWidth sew,
+                              LengthMultiplier lmul) {
+    return static_cast<uint32_t>(vma) << 7 | static_cast<uint32_t>(vta) << 6 |
+           static_cast<uint32_t>(sew) << 3 | static_cast<uint32_t>(lmul);
+  }
+
+  // Vector Unit-Stride Load/Store Instructions
+  void VLe8(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLe16(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLe32(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLe64(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLm(VRegister vd, XRegister rs1);
+
+  void VSe8(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSe16(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSe32(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSe64(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSm(VRegister vs3, XRegister rs1);
+
+  // Vector unit-stride fault-only-first Instructions
+  void VLe8ff(VRegister vd, XRegister rs1);
+  void VLe16ff(VRegister vd, XRegister rs1);
+  void VLe32ff(VRegister vd, XRegister rs1);
+  void VLe64ff(VRegister vd, XRegister rs1);
+
+  // Vector Strided Load/Store Instructions
+  void VLse8(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLse16(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLse32(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLse64(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+
+  void VSse8(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSse16(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSse32(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSse64(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+
+  // Vector Indexed Load/Store Instructions
+  void VLoxei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  void VLuxei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  void VSoxei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  void VSuxei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector Segment Load/Store
+
+  // Vector Unit-Stride Segment Loads/Stores
+
+  void VLseg2e8(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg2e16(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg2e32(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg2e64(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg3e8(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg3e16(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg3e32(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg3e64(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg4e8(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg4e16(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg4e32(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg4e64(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg5e8(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg5e16(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg5e32(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg5e64(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg6e8(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg6e16(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg6e32(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg6e64(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg7e8(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg7e16(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg7e32(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg7e64(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg8e8(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg8e16(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg8e32(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg8e64(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+
+  void VSseg2e8(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg2e16(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg2e32(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg2e64(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg3e8(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg3e16(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg3e32(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg3e64(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg4e8(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg4e16(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg4e32(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg4e64(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg5e8(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg5e16(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg5e32(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg5e64(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg6e8(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg6e16(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg6e32(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg6e64(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg7e8(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg7e16(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg7e32(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg7e64(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg8e8(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg8e16(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg8e32(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSseg8e64(VRegister vs3, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector Unit-Stride Fault-only-First Segment Loads
+
+  void VLseg2e8ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg2e16ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg2e32ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg2e64ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg3e8ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg3e16ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg3e32ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg3e64ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg4e8ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg4e16ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg4e32ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg4e64ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg5e8ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg5e16ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg5e32ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg5e64ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg6e8ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg6e16ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg6e32ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg6e64ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg7e8ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg7e16ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg7e32ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg7e64ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg8e8ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg8e16ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg8e32ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+  void VLseg8e64ff(VRegister vd, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector Strided Segment Loads/Stores
+
+  void VLsseg2e8(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg2e16(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg2e32(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg2e64(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg3e8(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg3e16(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg3e32(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg3e64(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg4e8(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg4e16(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg4e32(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg4e64(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg5e8(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg5e16(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg5e32(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg5e64(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg6e8(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg6e16(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg6e32(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg6e64(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg7e8(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg7e16(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg7e32(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg7e64(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg8e8(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg8e16(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg8e32(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VLsseg8e64(VRegister vd, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+
+  void VSsseg2e8(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg2e16(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg2e32(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg2e64(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg3e8(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg3e16(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg3e32(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg3e64(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg4e8(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg4e16(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg4e32(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg4e64(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg5e8(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg5e16(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg5e32(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg5e64(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg6e8(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg6e16(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg6e32(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg6e64(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg7e8(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg7e16(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg7e32(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg7e64(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg8e8(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg8e16(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg8e32(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+  void VSsseg8e64(VRegister vs3, XRegister rs1, XRegister rs2, VM vm = VM::kUnmasked);
+
+  // Vector Indexed-unordered Segment Loads/Stores
+
+  void VLuxseg2ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg2ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg2ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg2ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg3ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg3ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg3ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg3ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg4ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg4ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg4ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg4ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg5ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg5ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg5ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg5ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg6ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg6ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg6ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg6ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg7ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg7ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg7ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg7ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg8ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg8ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg8ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLuxseg8ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  void VSuxseg2ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg2ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg2ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg2ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg3ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg3ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg3ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg3ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg4ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg4ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg4ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg4ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg5ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg5ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg5ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg5ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg6ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg6ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg6ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg6ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg7ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg7ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg7ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg7ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg8ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg8ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg8ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSuxseg8ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector Indexed-ordered Segment Loads/Stores
+
+  void VLoxseg2ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg2ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg2ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg2ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg3ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg3ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg3ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg3ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg4ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg4ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg4ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg4ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg5ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg5ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg5ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg5ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg6ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg6ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg6ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg6ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg7ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg7ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg7ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg7ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg8ei8(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg8ei16(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg8ei32(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VLoxseg8ei64(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  void VSoxseg2ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg2ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg2ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg2ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg3ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg3ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg3ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg3ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg4ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg4ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg4ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg4ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg5ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg5ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg5ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg5ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg6ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg6ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg6ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg6ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg7ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg7ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg7ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg7ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg8ei8(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg8ei16(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg8ei32(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSoxseg8ei64(VRegister vs3, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector Whole Register Load/Store Instructions
+
+  void VL1re8(VRegister vd, XRegister rs1);
+  void VL1re16(VRegister vd, XRegister rs1);
+  void VL1re32(VRegister vd, XRegister rs1);
+  void VL1re64(VRegister vd, XRegister rs1);
+
+  void VL2re8(VRegister vd, XRegister rs1);
+  void VL2re16(VRegister vd, XRegister rs1);
+  void VL2re32(VRegister vd, XRegister rs1);
+  void VL2re64(VRegister vd, XRegister rs1);
+
+  void VL4re8(VRegister vd, XRegister rs1);
+  void VL4re16(VRegister vd, XRegister rs1);
+  void VL4re32(VRegister vd, XRegister rs1);
+  void VL4re64(VRegister vd, XRegister rs1);
+
+  void VL8re8(VRegister vd, XRegister rs1);
+  void VL8re16(VRegister vd, XRegister rs1);
+  void VL8re32(VRegister vd, XRegister rs1);
+  void VL8re64(VRegister vd, XRegister rs1);
+
+  void VL1r(VRegister vd, XRegister rs1);  // Pseudoinstruction equal to VL1re8
+  void VL2r(VRegister vd, XRegister rs1);  // Pseudoinstruction equal to VL2re8
+  void VL4r(VRegister vd, XRegister rs1);  // Pseudoinstruction equal to VL4re8
+  void VL8r(VRegister vd, XRegister rs1);  // Pseudoinstruction equal to VL8re8
+
+  void VS1r(VRegister vs3, XRegister rs1);  // Store {vs3} to address in a1
+  void VS2r(VRegister vs3, XRegister rs1);  // Store {vs3}-{vs3 + 1} to address in a1
+  void VS4r(VRegister vs3, XRegister rs1);  // Store {vs3}-{vs3 + 3} to address in a1
+  void VS8r(VRegister vs3, XRegister rs1);  // Store {vs3}-{vs3 + 7} to address in a1
+
+  // Vector Arithmetic Instruction
+
+  // Vector vadd instructions, funct6 = 0b000000
+  void VAdd_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VAdd_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VAdd_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm = VM::kUnmasked);
+
+  // Vector vsub instructions, funct6 = 0b000010
+  void VSub_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VSub_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vrsub instructions, funct6 = 0b000011
+  void VRsub_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VRsub_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm = VM::kUnmasked);
+
+  // Pseudo-instruction over VRsub_vi
+  void VNeg_v(VRegister vd, VRegister vs2);
+
+  // Vector vminu instructions, funct6 = 0b000100
+  void VMinu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMinu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vmin instructions, funct6 = 0b000101
+  void VMin_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMin_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vmaxu instructions, funct6 = 0b000110
+  void VMaxu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMaxu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vmax instructions, funct6 = 0b000111
+  void VMax_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMax_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vand instructions, funct6 = 0b001001
+  void VAnd_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VAnd_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VAnd_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm = VM::kUnmasked);
+
+  // Vector vor instructions, funct6 = 0b001010
+  void VOr_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VOr_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VOr_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm = VM::kUnmasked);
+
+  // Vector vxor instructions, funct6 = 0b001011
+  void VXor_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VXor_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VXor_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm = VM::kUnmasked);
+
+  // Pseudo-instruction over VXor_vi
+  void VNot_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vrgather instructions, funct6 = 0b001100
+  void VRgather_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VRgather_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VRgather_vi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm = VM::kUnmasked);
+
+  // Vector vslideup instructions, funct6 = 0b001110
+  void VSlideup_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSlideup_vi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm = VM::kUnmasked);
+
+  // Vector vrgatherei16 instructions, funct6 = 0b001110
+  void VRgatherei16_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vslidedown instructions, funct6 = 0b001111
+  void VSlidedown_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSlidedown_vi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm = VM::kUnmasked);
+
+  // Vector vadc instructions, funct6 = 0b010000
+  void VAdc_vvm(VRegister vd, VRegister vs2, VRegister vs1);
+  void VAdc_vxm(VRegister vd, VRegister vs2, XRegister rs1);
+  void VAdc_vim(VRegister vd, VRegister vs2, int32_t imm5);
+
+  // Vector vmadc instructions, funct6 = 0b010001
+  void VMadc_vvm(VRegister vd, VRegister vs2, VRegister vs1);
+  void VMadc_vxm(VRegister vd, VRegister vs2, XRegister rs1);
+  void VMadc_vim(VRegister vd, VRegister vs2, int32_t imm5);
+
+  // Vector vmadc instructions, funct6 = 0b010001
+  void VMadc_vv(VRegister vd, VRegister vs2, VRegister vs1);
+  void VMadc_vx(VRegister vd, VRegister vs2, XRegister rs1);
+  void VMadc_vi(VRegister vd, VRegister vs2, int32_t imm5);
+
+  // Vector vsbc instructions, funct6 = 0b010010
+  void VSbc_vvm(VRegister vd, VRegister vs2, VRegister vs1);
+  void VSbc_vxm(VRegister vd, VRegister vs2, XRegister rs1);
+
+  // Vector vmsbc instructions, funct6 = 0b010011
+  void VMsbc_vvm(VRegister vd, VRegister vs2, VRegister vs1);
+  void VMsbc_vxm(VRegister vd, VRegister vs2, XRegister rs1);
+  void VMsbc_vv(VRegister vd, VRegister vs2, VRegister vs1);
+  void VMsbc_vx(VRegister vd, VRegister vs2, XRegister rs1);
+
+  // Vector vmerge instructions, funct6 = 0b010111, vm = 0
+  void VMerge_vvm(VRegister vd, VRegister vs2, VRegister vs1);
+  void VMerge_vxm(VRegister vd, VRegister vs2, XRegister rs1);
+  void VMerge_vim(VRegister vd, VRegister vs2, int32_t imm5);
+
+  // Vector vmv instructions, funct6 = 0b010111, vm = 1, vs2 = v0
+  void VMv_vv(VRegister vd, VRegister vs1);
+  void VMv_vx(VRegister vd, XRegister rs1);
+  void VMv_vi(VRegister vd, int32_t imm5);
+
+  // Vector vmseq instructions, funct6 = 0b011000
+  void VMseq_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMseq_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VMseq_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm = VM::kUnmasked);
+
+  // Vector vmsne instructions, funct6 = 0b011001
+  void VMsne_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMsne_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VMsne_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm = VM::kUnmasked);
+
+  // Vector vmsltu instructions, funct6 = 0b011010
+  void VMsltu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMsltu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Pseudo-instruction over VMsltu_vv
+  void VMsgtu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vmslt instructions, funct6 = 0b011011
+  void VMslt_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMslt_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Pseudo-instruction over VMslt_vv
+  void VMsgt_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vmsleu instructions, funct6 = 0b011100
+  void VMsleu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMsleu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VMsleu_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm = VM::kUnmasked);
+
+  // Pseudo-instructions over VMsleu_*
+  void VMsgeu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMsltu_vi(VRegister vd, VRegister vs2, int32_t aimm5, VM vm = VM::kUnmasked);
+
+  // Vector vmsle instructions, funct6 = 0b011101
+  void VMsle_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMsle_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VMsle_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm = VM::kUnmasked);
+
+  // Pseudo-instructions over VMsle_*
+  void VMsge_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMslt_vi(VRegister vd, VRegister vs2, int32_t aimm5, VM vm = VM::kUnmasked);
+
+  // Vector vmsgtu instructions, funct6 = 0b011110
+  void VMsgtu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VMsgtu_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm = VM::kUnmasked);
+
+  // Pseudo-instruction over VMsgtu_vi
+  void VMsgeu_vi(VRegister vd, VRegister vs2, int32_t aimm5, VM vm = VM::kUnmasked);
+
+  // Vector vmsgt instructions, funct6 = 0b011111
+  void VMsgt_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VMsgt_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm = VM::kUnmasked);
+
+  // Pseudo-instruction over VMsgt_vi
+  void VMsge_vi(VRegister vd, VRegister vs2, int32_t aimm5, VM vm = VM::kUnmasked);
+
+  // Vector vsaddu instructions, funct6 = 0b100000
+  void VSaddu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VSaddu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSaddu_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm = VM::kUnmasked);
+
+  // Vector vsadd instructions, funct6 = 0b100001
+  void VSadd_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VSadd_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSadd_vi(VRegister vd, VRegister vs2, int32_t imm5, VM vm = VM::kUnmasked);
+
+  // Vector vssubu instructions, funct6 = 0b100010
+  void VSsubu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VSsubu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vssub instructions, funct6 = 0b100011
+  void VSsub_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VSsub_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vsll instructions, funct6 = 0b100101
+  void VSll_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VSll_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSll_vi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm = VM::kUnmasked);
+
+  // Vector vsmul instructions, funct6 = 0b100111
+  void VSmul_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VSmul_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vmv<nr>r.v instructions, funct6 = 0b100111
+  void Vmv1r_v(VRegister vd, VRegister vs2);
+  void Vmv2r_v(VRegister vd, VRegister vs2);
+  void Vmv4r_v(VRegister vd, VRegister vs2);
+  void Vmv8r_v(VRegister vd, VRegister vs2);
+
+  // Vector vsrl instructions, funct6 = 0b101000
+  void VSrl_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VSrl_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSrl_vi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm = VM::kUnmasked);
+
+  // Vector vsra instructions, funct6 = 0b101001
+  void VSra_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VSra_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSra_vi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm = VM::kUnmasked);
+
+  // Vector vssrl instructions, funct6 = 0b101010
+  void VSsrl_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VSsrl_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSsrl_vi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm = VM::kUnmasked);
+
+  // Vector vssra instructions, funct6 = 0b101011
+  void VSsra_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VSsra_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VSsra_vi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm = VM::kUnmasked);
+
+  // Vector vnsrl instructions, funct6 = 0b101100
+  void VNsrl_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VNsrl_wx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VNsrl_wi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm = VM::kUnmasked);
+
+  // Pseudo-instruction over VNsrl_wx
+  void VNcvt_x_x_w(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vnsra instructions, funct6 = 0b101101
+  void VNsra_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VNsra_wx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VNsra_wi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm = VM::kUnmasked);
+
+  // Vector vnclipu instructions, funct6 = 0b101110
+  void VNclipu_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VNclipu_wx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VNclipu_wi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm = VM::kUnmasked);
+
+  // Vector vnclip instructions, funct6 = 0b101111
+  void VNclip_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VNclip_wx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+  void VNclip_wi(VRegister vd, VRegister vs2, uint32_t uimm5, VM vm = VM::kUnmasked);
+
+  // Vector vwredsumu instructions, funct6 = 0b110000
+  void VWredsumu_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vwredsum instructions, funct6 = 0b110001
+  void VWredsum_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vredsum instructions, funct6 = 0b000000
+  void VRedsum_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vredand instructions, funct6 = 0b000001
+  void VRedand_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vredor instructions, funct6 = 0b000010
+  void VRedor_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vredxor instructions, funct6 = 0b000011
+  void VRedxor_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vredminu instructions, funct6 = 0b000100
+  void VRedminu_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vredmin instructions, funct6 = 0b000101
+  void VRedmin_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vredmaxu instructions, funct6 = 0b000110
+  void VRedmaxu_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vredmax instructions, funct6 = 0b000111
+  void VRedmax_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vaaddu instructions, funct6 = 0b001000
+  void VAaddu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VAaddu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vaadd instructions, funct6 = 0b001001
+  void VAadd_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VAadd_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vasubu instructions, funct6 = 0b001010
+  void VAsubu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VAsubu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vasub instructions, funct6 = 0b001011
+  void VAsub_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VAsub_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vslide1up instructions, funct6 = 0b001110
+  void VSlide1up_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vslide1down instructions, funct6 = 0b001111
+  void VSlide1down_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vcompress instructions, funct6 = 0b010111
+  void VCompress_vm(VRegister vd, VRegister vs2, VRegister vs1);
+
+  // Vector vmandn instructions, funct6 = 0b011000
+  void VMandn_mm(VRegister vd, VRegister vs2, VRegister vs1);
+
+  // Vector vmand instructions, funct6 = 0b011001
+  void VMand_mm(VRegister vd, VRegister vs2, VRegister vs1);
+
+  // Pseudo-instruction over VMand_mm
+  void VMmv_m(VRegister vd, VRegister vs2);
+
+  // Vector vmor instructions, funct6 = 0b011010
+  void VMor_mm(VRegister vd, VRegister vs2, VRegister vs1);
+
+  // Vector vmxor instructions, funct6 = 0b011011
+  void VMxor_mm(VRegister vd, VRegister vs2, VRegister vs1);
+
+  // Pseudo-instruction over VMxor_mm
+  void VMclr_m(VRegister vd);
+
+  // Vector vmorn instructions, funct6 = 0b011100
+  void VMorn_mm(VRegister vd, VRegister vs2, VRegister vs1);
+
+  // Vector vmnand instructions, funct6 = 0b011101
+  void VMnand_mm(VRegister vd, VRegister vs2, VRegister vs1);
+
+  // Pseudo-instruction over VMnand_mm
+  void VMnot_m(VRegister vd, VRegister vs2);
+
+  // Vector vmnor instructions, funct6 = 0b011110
+  void VMnor_mm(VRegister vd, VRegister vs2, VRegister vs1);
+
+  // Vector vmxnor instructions, funct6 = 0b011111
+  void VMxnor_mm(VRegister vd, VRegister vs2, VRegister vs1);
+
+  // Pseudo-instruction over VMxnor_mm
+  void VMset_m(VRegister vd);
+
+  // Vector vdivu instructions, funct6 = 0b100000
+  void VDivu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VDivu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vdiv instructions, funct6 = 0b100001
+  void VDiv_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VDiv_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vremu instructions, funct6 = 0b100010
+  void VRemu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VRemu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vrem instructions, funct6 = 0b100011
+  void VRem_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VRem_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vmulhu instructions, funct6 = 0b100100
+  void VMulhu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMulhu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vmul instructions, funct6 = 0b100101
+  void VMul_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMul_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vmulhsu instructions, funct6 = 0b100110
+  void VMulhsu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMulhsu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vmulh instructions, funct6 = 0b100111
+  void VMulh_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMulh_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vmadd instructions, funct6 = 0b101001
+  void VMadd_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VMadd_vx(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vnmsub instructions, funct6 = 0b101011
+  void VNmsub_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VNmsub_vx(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vmacc instructions, funct6 = 0b101101
+  void VMacc_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VMacc_vx(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vnmsac instructions, funct6 = 0b101111
+  void VNmsac_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VNmsac_vx(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vwaddu instructions, funct6 = 0b110000
+  void VWaddu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VWaddu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Pseudo-instruction over VWaddu_vx
+  void VWcvtu_x_x_v(VRegister vd, VRegister vs, VM vm = VM::kUnmasked);
+
+  // Vector vwadd instructions, funct6 = 0b110001
+  void VWadd_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VWadd_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Pseudo-instruction over VWadd_vx
+  void VWcvt_x_x_v(VRegister vd, VRegister vs, VM vm = VM::kUnmasked);
+
+  // Vector vwsubu instructions, funct6 = 0b110010
+  void VWsubu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VWsubu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vwsub instructions, funct6 = 0b110011
+  void VWsub_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VWsub_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vwaddu.w instructions, funct6 = 0b110100
+  void VWaddu_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VWaddu_wx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vwadd.w instructions, funct6 = 0b110101
+  void VWadd_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VWadd_wx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vwsubu.w instructions, funct6 = 0b110110
+  void VWsubu_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VWsubu_wx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vwsub.w instructions, funct6 = 0b110111
+  void VWsub_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VWsub_wx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vwmulu instructions, funct6 = 0b111000
+  void VWmulu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VWmulu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vwmulsu instructions, funct6 = 0b111010
+  void VWmulsu_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VWmulsu_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vwmul instructions, funct6 = 0b111011
+  void VWmul_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VWmul_vx(VRegister vd, VRegister vs2, XRegister rs1, VM vm = VM::kUnmasked);
+
+  // Vector vwmaccu instructions, funct6 = 0b111100
+  void VWmaccu_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VWmaccu_vx(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vwmacc instructions, funct6 = 0b111101
+  void VWmacc_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VWmacc_vx(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vwmaccus instructions, funct6 = 0b111110
+  void VWmaccus_vx(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vwmaccsu instructions, funct6 = 0b111111
+  void VWmaccsu_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VWmaccsu_vx(VRegister vd, XRegister rs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vfadd instructions, funct6 = 0b000000
+  void VFadd_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VFadd_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfredusum instructions, funct6 = 0b000001
+  void VFredusum_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vfsub instructions, funct6 = 0b000010
+  void VFsub_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VFsub_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfredosum instructions, funct6 = 0b000011
+  void VFredosum_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vfmin instructions, funct6 = 0b000100
+  void VFmin_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VFmin_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfredmin instructions, funct6 = 0b000101
+  void VFredmin_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vfmax instructions, funct6 = 0b000110
+  void VFmax_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VFmax_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfredmax instructions, funct6 = 0b000111
+  void VFredmax_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vfsgnj instructions, funct6 = 0b001000
+  void VFsgnj_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VFsgnj_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfsgnjn instructions, funct6 = 0b001001
+  void VFsgnjn_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VFsgnjn_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Pseudo-instruction over VFsgnjn_vv
+  void VFneg_v(VRegister vd, VRegister vs);
+
+  // Vector vfsgnjx instructions, funct6 = 0b001010
+  void VFsgnjx_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VFsgnjx_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Pseudo-instruction over VFsgnjx_vv
+  void VFabs_v(VRegister vd, VRegister vs);
+
+  // Vector vfslide1up instructions, funct6 = 0b001110
+  void VFslide1up_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfslide1down instructions, funct6 = 0b001111
+  void VFslide1down_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfmerge/vfmv instructions, funct6 = 0b010111
+  void VFmerge_vfm(VRegister vd, VRegister vs2, FRegister fs1);
+  void VFmv_v_f(VRegister vd, FRegister fs1);
+
+  // Vector vmfeq instructions, funct6 = 0b011000
+  void VMfeq_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMfeq_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vmfle instructions, funct6 = 0b011001
+  void VMfle_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMfle_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Pseudo-instruction over VMfle_vv
+  void VMfge_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vmflt instructions, funct6 = 0b011011
+  void VMflt_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMflt_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Pseudo-instruction over VMflt_vv
+  void VMfgt_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vmfne instructions, funct6 = 0b011100
+  void VMfne_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VMfne_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vmfgt instructions, funct6 = 0b011101
+  void VMfgt_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vmfge instructions, funct6 = 0b011111
+  void VMfge_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfdiv instructions, funct6 = 0b100000
+  void VFdiv_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VFdiv_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfrdiv instructions, funct6 = 0b100001
+  void VFrdiv_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfmul instructions, funct6 = 0b100100
+  void VFmul_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VFmul_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfrsub instructions, funct6 = 0b100111
+  void VFrsub_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfmadd instructions, funct6 = 0b101000
+  void VFmadd_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFmadd_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vfnmadd instructions, funct6 = 0b101001
+  void VFnmadd_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFnmadd_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vfmsub instructions, funct6 = 0b101010
+  void VFmsub_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFmsub_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vfnmsub instructions, funct6 = 0b101011
+  void VFnmsub_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFnmsub_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vfmacc instructions, funct6 = 0b101100
+  void VFmacc_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFmacc_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vfnmacc instructions, funct6 = 0b101101
+  void VFnmacc_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFnmacc_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vfmsac instructions, funct6 = 0b101110
+  void VFmsac_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFmsac_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vfnmsac instructions, funct6 = 0b101111
+  void VFnmsac_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFnmsac_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vfwadd instructions, funct6 = 0b110000
+  void VFwadd_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VFwadd_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfwredusum instructions, funct6 = 0b110001
+  void VFwredusum_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vfwsub instructions, funct6 = 0b110010
+  void VFwsub_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VFwsub_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfwredosum instructions, funct6 = 0b110011
+  void VFwredosum_vs(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+
+  // Vector vfwadd.w instructions, funct6 = 0b110100
+  void VFwadd_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VFwadd_wf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfwsub.w instructions, funct6 = 0b110110
+  void VFwsub_wv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VFwsub_wf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfwmul instructions, funct6 = 0b111000
+  void VFwmul_vv(VRegister vd, VRegister vs2, VRegister vs1, VM vm = VM::kUnmasked);
+  void VFwmul_vf(VRegister vd, VRegister vs2, FRegister fs1, VM vm = VM::kUnmasked);
+
+  // Vector vfwmacc instructions, funct6 = 0b111100
+  void VFwmacc_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFwmacc_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vfwnmacc instructions, funct6 = 0b111101
+  void VFwnmacc_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFwnmacc_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vfwmsac instructions, funct6 = 0b111110
+  void VFwmsac_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFwmsac_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector vfwnmsac instructions, funct6 = 0b111111
+  void VFwnmsac_vv(VRegister vd, VRegister vs1, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFwnmsac_vf(VRegister vd, FRegister fs1, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector VRXUNARY0 kind instructions, funct6 = 0b010000
+  void VMv_s_x(VRegister vd, XRegister rs1);
+
+  // Vector VWXUNARY0 kind instructions, funct6 = 0b010000
+  void VMv_x_s(XRegister rd, VRegister vs2);
+  void VCpop_m(XRegister rd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFirst_m(XRegister rd, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector VXUNARY0 kind instructions, funct6 = 0b010010
+  void VZext_vf8(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSext_vf8(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VZext_vf4(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSext_vf4(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VZext_vf2(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VSext_vf2(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector VRFUNARY0 kind instructions, funct6 = 0b010000
+  void VFmv_s_f(VRegister vd, FRegister fs1);
+
+  // Vector VWFUNARY0 kind instructions, funct6 = 0b010000
+  void VFmv_f_s(FRegister fd, VRegister vs2);
+
+  // Vector VFUNARY0 kind instructions, funct6 = 0b010010
+  void VFcvt_xu_f_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFcvt_x_f_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFcvt_f_xu_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFcvt_f_x_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFcvt_rtz_xu_f_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFcvt_rtz_x_f_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFwcvt_xu_f_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFwcvt_x_f_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFwcvt_f_xu_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFwcvt_f_x_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFwcvt_f_f_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFwcvt_rtz_xu_f_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFwcvt_rtz_x_f_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFncvt_xu_f_w(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFncvt_x_f_w(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFncvt_f_xu_w(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFncvt_f_x_w(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFncvt_f_f_w(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFncvt_rod_f_f_w(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFncvt_rtz_xu_f_w(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFncvt_rtz_x_f_w(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector VFUNARY1 kind instructions, funct6 = 0b010011
+  void VFsqrt_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFrsqrt7_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFrec7_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VFclass_v(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+
+  // Vector VMUNARY0 kind instructions, funct6 = 0b010100
+  void VMsbf_m(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VMsof_m(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VMsif_m(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VIota_m(VRegister vd, VRegister vs2, VM vm = VM::kUnmasked);
+  void VId_v(VRegister vd, VM vm = VM::kUnmasked);
+
+  ////////////////////////////// RISC-V Vector Instructions  END //////////////////////////////
+
+  ////////////////////////////// RV64 MACRO Instructions  START ///////////////////////////////
+  // These pseudo instructions are from "RISC-V Assembly Programmer's Manual".
+
+  void Nop();
+  void Li(XRegister rd, int64_t imm);
+  void Mv(XRegister rd, XRegister rs);
+  void Not(XRegister rd, XRegister rs);
+  void Neg(XRegister rd, XRegister rs);
+  void NegW(XRegister rd, XRegister rs);
+  void SextB(XRegister rd, XRegister rs);
+  void SextH(XRegister rd, XRegister rs);
+  void SextW(XRegister rd, XRegister rs);
+  void ZextB(XRegister rd, XRegister rs);
+  void ZextH(XRegister rd, XRegister rs);
+  void ZextW(XRegister rd, XRegister rs);
+  void Seqz(XRegister rd, XRegister rs);
+  void Snez(XRegister rd, XRegister rs);
+  void Sltz(XRegister rd, XRegister rs);
+  void Sgtz(XRegister rd, XRegister rs);
+  void FMvS(FRegister rd, FRegister rs);
+  void FAbsS(FRegister rd, FRegister rs);
+  void FNegS(FRegister rd, FRegister rs);
+  void FMvD(FRegister rd, FRegister rs);
+  void FAbsD(FRegister rd, FRegister rs);
+  void FNegD(FRegister rd, FRegister rs);
+
+  // Branch pseudo instructions
+  void Beqz(XRegister rs, int32_t offset);
+  void Bnez(XRegister rs, int32_t offset);
+  void Blez(XRegister rs, int32_t offset);
+  void Bgez(XRegister rs, int32_t offset);
+  void Bltz(XRegister rs, int32_t offset);
+  void Bgtz(XRegister rs, int32_t offset);
+  void Bgt(XRegister rs, XRegister rt, int32_t offset);
+  void Ble(XRegister rs, XRegister rt, int32_t offset);
+  void Bgtu(XRegister rs, XRegister rt, int32_t offset);
+  void Bleu(XRegister rs, XRegister rt, int32_t offset);
+
+  // Jump pseudo instructions
+  void J(int32_t offset);
+  void Jal(int32_t offset);
+  void Jr(XRegister rs);
+  void Jalr(XRegister rs);
+  void Jalr(XRegister rd, XRegister rs);
+  void Ret();
+
+  // Pseudo instructions for accessing control and status registers
+  void RdCycle(XRegister rd);
+  void RdTime(XRegister rd);
+  void RdInstret(XRegister rd);
+  void Csrr(XRegister rd, uint32_t csr);
+  void Csrw(uint32_t csr, XRegister rs);
+  void Csrs(uint32_t csr, XRegister rs);
+  void Csrc(uint32_t csr, XRegister rs);
+  void Csrwi(uint32_t csr, uint32_t uimm5);
+  void Csrsi(uint32_t csr, uint32_t uimm5);
+  void Csrci(uint32_t csr, uint32_t uimm5);
+
+  // Load/store macros for arbitrary 32-bit offsets.
+  void Loadb(XRegister rd, XRegister rs1, int32_t offset);
+  void Loadh(XRegister rd, XRegister rs1, int32_t offset);
+  void Loadw(XRegister rd, XRegister rs1, int32_t offset);
+  void Loadd(XRegister rd, XRegister rs1, int32_t offset);
+  void Loadbu(XRegister rd, XRegister rs1, int32_t offset);
+  void Loadhu(XRegister rd, XRegister rs1, int32_t offset);
+  void Loadwu(XRegister rd, XRegister rs1, int32_t offset);
+  void Storeb(XRegister rs2, XRegister rs1, int32_t offset);
+  void Storeh(XRegister rs2, XRegister rs1, int32_t offset);
+  void Storew(XRegister rs2, XRegister rs1, int32_t offset);
+  void Stored(XRegister rs2, XRegister rs1, int32_t offset);
+  void FLoadw(FRegister rd, XRegister rs1, int32_t offset);
+  void FLoadd(FRegister rd, XRegister rs1, int32_t offset);
+  void FStorew(FRegister rs2, XRegister rs1, int32_t offset);
+  void FStored(FRegister rs2, XRegister rs1, int32_t offset);
+
+  // Macros for loading constants.
+  void LoadConst32(XRegister rd, int32_t value);
+  void LoadConst64(XRegister rd, int64_t value);
+
+  // Macros for adding constants.
+  void AddConst32(XRegister rd, XRegister rs1, int32_t value);
+  void AddConst64(XRegister rd, XRegister rs1, int64_t value);
+
+  // Jumps and branches to a label.
+  void Beqz(XRegister rs, Riscv64Label* label, bool is_bare = false);
+  void Bnez(XRegister rs, Riscv64Label* label, bool is_bare = false);
+  void Blez(XRegister rs, Riscv64Label* label, bool is_bare = false);
+  void Bgez(XRegister rs, Riscv64Label* label, bool is_bare = false);
+  void Bltz(XRegister rs, Riscv64Label* label, bool is_bare = false);
+  void Bgtz(XRegister rs, Riscv64Label* label, bool is_bare = false);
+  void Beq(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare = false);
+  void Bne(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare = false);
+  void Ble(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare = false);
+  void Bge(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare = false);
+  void Blt(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare = false);
+  void Bgt(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare = false);
+  void Bleu(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare = false);
+  void Bgeu(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare = false);
+  void Bltu(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare = false);
+  void Bgtu(XRegister rs, XRegister rt, Riscv64Label* label, bool is_bare = false);
+  void Jal(XRegister rd, Riscv64Label* label, bool is_bare = false);
+  void J(Riscv64Label* label, bool is_bare = false);
+  void Jal(Riscv64Label* label, bool is_bare = false);
+
+  // Literal load.
+  void Loadw(XRegister rd, Literal* literal);
+  void Loadwu(XRegister rd, Literal* literal);
+  void Loadd(XRegister rd, Literal* literal);
+  void FLoadw(FRegister rd, Literal* literal);
+  void FLoadd(FRegister rd, Literal* literal);
+
+  // Illegal instruction that triggers SIGILL.
+  void Unimp();
+
+  /////////////////////////////// RV64 MACRO Instructions END ///////////////////////////////
+
+  void Bind(Label* label) override { Bind(down_cast<Riscv64Label*>(label)); }
+
+  void Jump([[maybe_unused]] Label* label) override {
+    UNIMPLEMENTED(FATAL) << "Do not use Jump for RISCV64";
+  }
+
+  void Jump(Riscv64Label* label) {
+    J(label);
+  }
+
+  void Bind(Riscv64Label* label);
+
+  // Load label address using PC-relative loads.
+  void LoadLabelAddress(XRegister rd, Riscv64Label* label);
+
+  // Create a new literal with a given value.
+  // NOTE:Use `Identity<>` to force the template parameter to be explicitly specified.
+  template <typename T>
+  Literal* NewLiteral(typename Identity<T>::type value) {
+    static_assert(std::is_integral<T>::value, "T must be an integral type.");
+    return NewLiteral(sizeof(value), reinterpret_cast<const uint8_t*>(&value));
+  }
+
+  // Create a new literal with the given data.
+  Literal* NewLiteral(size_t size, const uint8_t* data);
+
+  // Create a jump table for the given labels that will be emitted when finalizing.
+  // When the table is emitted, offsets will be relative to the location of the table.
+  // The table location is determined by the location of its label (the label precedes
+  // the table data) and should be loaded using LoadLabelAddress().
+  JumpTable* CreateJumpTable(ArenaVector<Riscv64Label*>&& labels);
+
+ public:
+  // Emit slow paths queued during assembly, promote short branches to long if needed,
+  // and emit branches.
+  void FinalizeCode() override;
+
+  template <typename Reg>
+  static inline bool IsShortReg(Reg reg) {
+    static_assert(std::is_same_v<Reg, XRegister> || std::is_same_v<Reg, FRegister>);
+    uint32_t uv = enum_cast<uint32_t>(reg) - 8u;
+    return IsUint<3>(uv);
+  }
+
+  // Returns the current location of a label.
+  //
+  // This function must be used instead of `Riscv64Label::GetPosition()`
+  // which returns assembler's internal data instead of an actual location.
+  //
+  // The location can change during branch fixup in `FinalizeCode()`. Before that,
+  // the location is not final and therefore not very useful to external users,
+  // so they should preferably retrieve the location only after `FinalizeCode()`.
+  uint32_t GetLabelLocation(const Riscv64Label* label) const;
+
+  // Get the final position of a label after local fixup based on the old position
+  // recorded before FinalizeCode().
+  uint32_t GetAdjustedPosition(uint32_t old_position);
+
+ private:
+  static uint32_t ConvertExtensions(
+      const Riscv64InstructionSetFeatures* instruction_set_features) {
+    // The `Riscv64InstructionSetFeatures` currently does not support "Zcb",
+    // only the original "C" extension. For riscv64 that means "Zca" and "Zcd".
+    constexpr Riscv64ExtensionMask kCompressedExtensionsMask =
+        Riscv64ExtensionBit(Riscv64Extension::kZca) | Riscv64ExtensionBit(Riscv64Extension::kZcd);
+    return
+        (Riscv64ExtensionBit(Riscv64Extension::kLoadStore)) |
+        (Riscv64ExtensionBit(Riscv64Extension::kZifencei)) |
+        (Riscv64ExtensionBit(Riscv64Extension::kM)) |
+        (Riscv64ExtensionBit(Riscv64Extension::kA)) |
+        (Riscv64ExtensionBit(Riscv64Extension::kZicsr)) |
+        (Riscv64ExtensionBit(Riscv64Extension::kF)) |
+        (Riscv64ExtensionBit(Riscv64Extension::kD)) |
+        (instruction_set_features->HasZba() ? Riscv64ExtensionBit(Riscv64Extension::kZba) : 0u) |
+        (instruction_set_features->HasZbb() ? Riscv64ExtensionBit(Riscv64Extension::kZbb) : 0u) |
+        (instruction_set_features->HasZbs() ? Riscv64ExtensionBit(Riscv64Extension::kZbs) : 0u) |
+        (instruction_set_features->HasVector() ? Riscv64ExtensionBit(Riscv64Extension::kV) : 0u) |
+        (instruction_set_features->HasCompressed() ? kCompressedExtensionsMask : 0u);
+  }
+
+  void AssertExtensionsEnabled(Riscv64Extension ext) {
+    DCHECK(IsExtensionEnabled(ext))
+        << "ext=" << enum_cast<>(ext) << " enabled=0x" << std::hex << enabled_extensions_;
+  }
+
+  template <typename... OtherExt>
+  void AssertExtensionsEnabled(Riscv64Extension ext, OtherExt... other_ext) {
+    AssertExtensionsEnabled(ext);
+    AssertExtensionsEnabled(other_ext...);
+  }
+
+  enum BranchCondition : uint8_t {
+    kCondEQ,
+    kCondNE,
+    kCondLT,
+    kCondGE,
+    kCondLE,
+    kCondGT,
+    kCondLTU,
+    kCondGEU,
+    kCondLEU,
+    kCondGTU,
+    kUncond,
+  };
+
+  // Note that PC-relative literal loads are handled as pseudo branches because they need
+  // to be emitted after branch relocation to use correct offsets.
+  class Branch {
+   public:
+    enum Type : uint8_t {
+      // TODO(riscv64): Support 16-bit instructions ("C" Standard Extension).
+
+      // Short branches (can be promoted to longer).
+      kCondBranch,
+      kUncondBranch,
+      kCall,
+      // Short branches (can't be promoted to longer).
+      kBareCondBranch,
+      kBareUncondBranch,
+      kBareCall,
+
+      // Medium branch (can be promoted to long).
+      kCondBranch21,
+
+      // Long branches.
+      kLongCondBranch,
+      kLongUncondBranch,
+      kLongCall,
+
+      // Label.
+      kLabel,
+
+      // Literals.
+      kLiteral,
+      kLiteralUnsigned,
+      kLiteralLong,
+      kLiteralFloat,
+      kLiteralDouble,
+    };
+
+    // Bit sizes of offsets defined as enums to minimize chance of typos.
+    enum OffsetBits {
+      kOffset13 = 13,
+      kOffset21 = 21,
+      kOffset32 = 32,
+    };
+
+    static constexpr uint32_t kUnresolved = 0xffffffff;  // Unresolved target_
+    static constexpr uint32_t kMaxBranchLength = 12;  // In bytes.
+
+    struct BranchInfo {
+      // Branch length in bytes.
+      uint32_t length;
+      // The offset in bytes of the PC used in the (only) PC-relative instruction from
+      // the start of the branch sequence. RISC-V always uses the address of the PC-relative
+      // instruction as the PC, so this is essentially the offset of that instruction.
+      uint32_t pc_offset;
+      // How large (in bits) a PC-relative offset can be for a given type of branch.
+      OffsetBits offset_size;
+    };
+    static const BranchInfo branch_info_[/* Type */];
+
+    // Unconditional branch or call.
+    Branch(uint32_t location, uint32_t target, XRegister rd, bool is_bare);
+    // Conditional branch.
+    Branch(uint32_t location,
+           uint32_t target,
+           BranchCondition condition,
+           XRegister lhs_reg,
+           XRegister rhs_reg,
+           bool is_bare);
+    // Label address or literal.
+    Branch(uint32_t location, uint32_t target, XRegister rd, Type label_or_literal_type);
+    Branch(uint32_t location, uint32_t target, FRegister rd, Type literal_type);
+
+    // Some conditional branches with lhs = rhs are effectively NOPs, while some
+    // others are effectively unconditional.
+    static bool IsNop(BranchCondition condition, XRegister lhs, XRegister rhs);
+    static bool IsUncond(BranchCondition condition, XRegister lhs, XRegister rhs);
+
+    static BranchCondition OppositeCondition(BranchCondition cond);
+
+    Type GetType() const;
+    BranchCondition GetCondition() const;
+    XRegister GetLeftRegister() const;
+    XRegister GetRightRegister() const;
+    FRegister GetFRegister() const;
+    uint32_t GetTarget() const;
+    uint32_t GetLocation() const;
+    uint32_t GetOldLocation() const;
+    uint32_t GetLength() const;
+    uint32_t GetOldLength() const;
+    uint32_t GetEndLocation() const;
+    uint32_t GetOldEndLocation() const;
+    bool IsBare() const;
+    bool IsResolved() const;
+
+    // Returns the bit size of the signed offset that the branch instruction can handle.
+    OffsetBits GetOffsetSize() const;
+
+    // Calculates the distance between two byte locations in the assembler buffer and
+    // returns the number of bits needed to represent the distance as a signed integer.
+    static OffsetBits GetOffsetSizeNeeded(uint32_t location, uint32_t target);
+
+    // Resolve a branch when the target is known.
+    void Resolve(uint32_t target);
+
+    // Relocate a branch by a given delta if needed due to expansion of this or another
+    // branch at a given location by this delta (just changes location_ and target_).
+    void Relocate(uint32_t expand_location, uint32_t delta);
+
+    // If necessary, updates the type by promoting a short branch to a longer branch
+    // based on the branch location and target. Returns the amount (in bytes) by
+    // which the branch size has increased.
+    uint32_t PromoteIfNeeded();
+
+    // Returns the offset into assembler buffer that shall be used as the base PC for
+    // offset calculation. RISC-V always uses the address of the PC-relative instruction
+    // as the PC, so this is essentially the location of that instruction.
+    uint32_t GetOffsetLocation() const;
+
+    // Calculates and returns the offset ready for encoding in the branch instruction(s).
+    int32_t GetOffset() const;
+
+   private:
+    // Completes branch construction by determining and recording its type.
+    void InitializeType(Type initial_type);
+    // Helper for the above.
+    void InitShortOrLong(OffsetBits ofs_size, Type short_type, Type long_type, Type longest_type);
+
+    uint32_t old_location_;  // Offset into assembler buffer in bytes.
+    uint32_t location_;      // Offset into assembler buffer in bytes.
+    uint32_t target_;        // Offset into assembler buffer in bytes.
+
+    XRegister lhs_reg_;          // Left-hand side register in conditional branches or
+                                 // destination register in calls or literals.
+    XRegister rhs_reg_;          // Right-hand side register in conditional branches.
+    FRegister freg_;             // Destination register in FP literals.
+    BranchCondition condition_;  // Condition for conditional branches.
+
+    Type type_;      // Current type of the branch.
+    Type old_type_;  // Initial type of the branch.
+  };
+
+  // Branch and literal fixup.
+
+  void EmitBcond(BranchCondition cond, XRegister rs, XRegister rt, int32_t offset);
+  void EmitBranch(Branch* branch);
+  void EmitBranches();
+  void EmitJumpTables();
+  void EmitLiterals();
+
+  void FinalizeLabeledBranch(Riscv64Label* label);
+  void Bcond(Riscv64Label* label,
+             bool is_bare,
+             BranchCondition condition,
+             XRegister lhs,
+             XRegister rhs);
+  void Buncond(Riscv64Label* label, XRegister rd, bool is_bare);
+  template <typename XRegisterOrFRegister>
+  void LoadLiteral(Literal* literal, XRegisterOrFRegister rd, Branch::Type literal_type);
+
+  Branch* GetBranch(uint32_t branch_id);
+  const Branch* GetBranch(uint32_t branch_id) const;
+
+  void ReserveJumpTableSpace();
+  void PromoteBranches();
+  void PatchCFI();
+
+  // Emit data (e.g. encoded instruction or immediate) to the instruction stream.
+  template <typename T>
+  void Emit(T value) {
+    static_assert(std::is_same_v<T, uint32_t> || std::is_same_v<T, uint16_t>,
+                  "Only Integer types are allowed");
+    if (overwriting_) {
+      // Branches to labels are emitted into their placeholders here.
+      buffer_.Store<T>(overwrite_location_, value);
+      overwrite_location_ += sizeof(T);
+    } else {
+      // Other instructions are simply appended at the end here.
+      AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+      buffer_.Emit<T>(value);
+    }
+  }
+
+  void Emit16(uint32_t value) { Emit(dchecked_integral_cast<uint16_t>(value)); }
+  void Emit32(uint32_t value) { Emit(value); }
+
+  // Adjust base register and offset if needed for load/store with a large offset.
+  void AdjustBaseAndOffset(XRegister& base, int32_t& offset, ScratchRegisterScope& srs);
+
+  // Helper templates for loads/stores with 32-bit offsets.
+  template <void (Riscv64Assembler::*insn)(XRegister, XRegister, int32_t)>
+  void LoadFromOffset(XRegister rd, XRegister rs1, int32_t offset);
+  template <void (Riscv64Assembler::*insn)(XRegister, XRegister, int32_t)>
+  void StoreToOffset(XRegister rs2, XRegister rs1, int32_t offset);
+  template <void (Riscv64Assembler::*insn)(FRegister, XRegister, int32_t)>
+  void FLoadFromOffset(FRegister rd, XRegister rs1, int32_t offset);
+  template <void (Riscv64Assembler::*insn)(FRegister, XRegister, int32_t)>
+  void FStoreToOffset(FRegister rs2, XRegister rs1, int32_t offset);
+
+  // Implementation helper for `Li()`, `LoadConst32()` and `LoadConst64()`.
+  void LoadImmediate(XRegister rd, int64_t imm, bool can_use_tmp);
+
+  // RVV constants and helpers
+
+  enum class Nf : uint32_t {
+    k1 = 0b000,
+    k2 = 0b001,
+    k3 = 0b010,
+    k4 = 0b011,
+    k5 = 0b100,
+    k6 = 0b101,
+    k7 = 0b110,
+    k8 = 0b111,
+  };
+
+  enum class VAIEncoding : uint32_t {
+                     // ----Operands---- | Type of Scalar                | Instruction type
+    kOPIVV = 0b000,  // vector-vector    | --                            | R-type
+    kOPFVV = 0b001,  // vector-vector    | --                            | R-type
+    kOPMVV = 0b010,  // vector-vector    | --                            | R-type
+    kOPIVI = 0b011,  // vector-immediate | imm[4:0]                      | R-type
+    kOPIVX = 0b100,  // vector-scalar    | GPR x register rs1            | R-type
+    kOPFVF = 0b101,  // vector-scalar    | FP f register rs1             | R-type
+    kOPMVX = 0b110,  // vector-scalar    | GPR x register rs1            | R-type
+    kOPCFG = 0b111,  // scalars-imms     | GPR x register rs1 & rs2/imm  | R/I-type
+  };
+
+  enum class MemAddressMode : uint32_t {
+    kUnitStride = 0b00,
+    kIndexedUnordered = 0b01,
+    kStrided = 0b10,
+    kIndexedOrdered = 0b11,
+  };
+
+  enum class VectorWidth : uint32_t {
+    k8 = 0b000,
+    k16 = 0b101,
+    k32 = 0b110,
+    k64 = 0b111,
+
+    kMask = 0b000,
+    kWholeR = 0b000,
+  };
+
+  static constexpr uint32_t EncodeRVVMemF7(const Nf nf,
+                                           const uint32_t mew,
+                                           const MemAddressMode mop,
+                                           const VM vm) {
+    DCHECK(IsUint<3>(enum_cast<uint32_t>(nf)));
+    DCHECK(IsUint<1>(mew));
+    DCHECK(IsUint<2>(enum_cast<uint32_t>(mop)));
+    DCHECK(IsUint<1>(enum_cast<uint32_t>(vm)));
+
+    return enum_cast<uint32_t>(nf) << 4 | mew << 3 | enum_cast<uint32_t>(mop) << 1 |
+           enum_cast<uint32_t>(vm);
+  }
+
+  static constexpr uint32_t EncodeRVVF7(const uint32_t funct6, const VM vm) {
+    DCHECK(IsUint<6>(funct6));
+    return funct6 << 1 | enum_cast<uint32_t>(vm);
+  }
+
+  template <unsigned kWidth>
+  static constexpr uint32_t EncodeIntWidth(const int32_t imm) {
+    DCHECK(IsInt<kWidth>(imm));
+    return static_cast<uint32_t>(imm) & MaskLeastSignificant<uint32_t>(kWidth);
+  }
+
+  static constexpr uint32_t EncodeInt5(const int32_t imm) { return EncodeIntWidth<5>(imm); }
+  static constexpr uint32_t EncodeInt6(const int32_t imm) { return EncodeIntWidth<6>(imm); }
+
+  template <typename Reg>
+  static constexpr uint32_t EncodeShortReg(const Reg reg) {
+    DCHECK(IsShortReg(reg));
+    return enum_cast<uint32_t>(reg) - 8u;
+  }
+
+  // Rearrange given offset in the way {offset[0] | offset[1]}
+  static constexpr uint32_t EncodeOffset0_1(int32_t offset) {
+    uint32_t u_offset = static_cast<uint32_t>(offset);
+    DCHECK(IsUint<2>(u_offset));
+
+    return u_offset >> 1 | (u_offset & 1u) << 1;
+  }
+
+  // Rearrange given offset, scaled by 4, in the way {offset[5:2] | offset[7:6]}
+  static constexpr uint32_t ExtractOffset52_76(int32_t offset) {
+    DCHECK(IsAligned<4>(offset)) << "Offset should be scalable by 4";
+
+    uint32_t u_offset = static_cast<uint32_t>(offset);
+    DCHECK(IsUint<6 + 2>(u_offset));
+
+    uint32_t imm_52 = BitFieldExtract(u_offset, 2, 4);
+    uint32_t imm_76 = BitFieldExtract(u_offset, 6, 2);
+
+    return BitFieldInsert(imm_76, imm_52, 2, 4);
+  }
+
+  // Rearrange given offset, scaled by 8, in the way {offset[5:3] | offset[8:6]}
+  static constexpr uint32_t ExtractOffset53_86(int32_t offset) {
+    DCHECK(IsAligned<8>(offset)) << "Offset should be scalable by 8";
+
+    uint32_t u_offset = static_cast<uint32_t>(offset);
+    DCHECK(IsUint<6 + 3>(u_offset));
+
+    uint32_t imm_53 = BitFieldExtract(u_offset, 3, 3);
+    uint32_t imm_86 = BitFieldExtract(u_offset, 6, 3);
+
+    return BitFieldInsert(imm_86, imm_53, 3, 3);
+  }
+
+  // Rearrange given offset, scaled by 4, in the way {offset[5:2] | offset[6]}
+  static constexpr uint32_t ExtractOffset52_6(int32_t offset) {
+    DCHECK(IsAligned<4>(offset)) << "Offset should be scalable by 4";
+
+    uint32_t u_offset = static_cast<uint32_t>(offset);
+    DCHECK(IsUint<5 + 2>(u_offset));
+
+    uint32_t imm_52 = BitFieldExtract(u_offset, 2, 4);
+    uint32_t imm_6  = BitFieldExtract(u_offset, 6, 1);
+
+    return BitFieldInsert(imm_6, imm_52, 1, 4);
+  }
+
+  // Rearrange given offset, scaled by 8, in the way {offset[5:3], offset[7:6]}
+  static constexpr uint32_t ExtractOffset53_76(int32_t offset) {
+    DCHECK(IsAligned<8>(offset)) << "Offset should be scalable by 4";
+
+    uint32_t u_offset = static_cast<uint32_t>(offset);
+    DCHECK(IsUint<5 + 3>(u_offset));
+
+    uint32_t imm_53 = BitFieldExtract(u_offset, 3, 3);
+    uint32_t imm_76 = BitFieldExtract(u_offset, 6, 2);
+
+    return BitFieldInsert(imm_76, imm_53, 2, 3);
+  }
+
+  static constexpr bool IsImmCLuiEncodable(uint32_t uimm) {
+    // Instruction c.lui is odd and its immediate value is a bit tricky
+    // Its value is not a full 32 bits value, but its bits [31:12]
+    // (where the bit 17 marks the sign bit) shifted towards the bottom i.e. bits [19:0]
+    // are the meaningful ones. Since that we want a signed non-zero 6-bit immediate to
+    // keep values in the range [0, 0x1f], and the range [0xfffe0, 0xfffff] for negative values
+    // since the sign bit was bit 17 (which is now bit 5 and replicated in the higher bits too)
+    // Also encoding with immediate = 0 is reserved
+    // For more details please see 16.5 chapter is the specification
+
+    return uimm != 0u && (IsUint<5>(uimm) || IsUint<5>(uimm - 0xfffe0u));
+  }
+
+  // Emit helpers.
+
+  // I-type instruction:
+  //
+  //    31                   20 19     15 14 12 11      7 6           0
+  //   -----------------------------------------------------------------
+  //   [ . . . . . . . . . . . | . . . . | . . | . . . . | . . . . . . ]
+  //   [        imm11:0            rs1   funct3     rd        opcode   ]
+  //   -----------------------------------------------------------------
+  template <typename Reg1, typename Reg2>
+  void EmitI(int32_t imm12, Reg1 rs1, uint32_t funct3, Reg2 rd, uint32_t opcode) {
+    DCHECK(IsInt<12>(imm12)) << imm12;
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rs1)));
+    DCHECK(IsUint<3>(funct3));
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rd)));
+    DCHECK(IsUint<7>(opcode));
+    uint32_t encoding = static_cast<uint32_t>(imm12) << 20 | static_cast<uint32_t>(rs1) << 15 |
+                        funct3 << 12 | static_cast<uint32_t>(rd) << 7 | opcode;
+    Emit32(encoding);
+  }
+
+  // R-type instruction:
+  //
+  //    31         25 24     20 19     15 14 12 11      7 6           0
+  //   -----------------------------------------------------------------
+  //   [ . . . . . . | . . . . | . . . . | . . | . . . . | . . . . . . ]
+  //   [   funct7        rs2       rs1   funct3     rd        opcode   ]
+  //   -----------------------------------------------------------------
+  template <typename Reg1, typename Reg2, typename Reg3>
+  void EmitR(uint32_t funct7, Reg1 rs2, Reg2 rs1, uint32_t funct3, Reg3 rd, uint32_t opcode) {
+    DCHECK(IsUint<7>(funct7));
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rs2)));
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rs1)));
+    DCHECK(IsUint<3>(funct3));
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rd)));
+    DCHECK(IsUint<7>(opcode));
+    uint32_t encoding = funct7 << 25 | static_cast<uint32_t>(rs2) << 20 |
+                        static_cast<uint32_t>(rs1) << 15 | funct3 << 12 |
+                        static_cast<uint32_t>(rd) << 7 | opcode;
+    Emit32(encoding);
+  }
+
+  // R-type instruction variant for floating-point fused multiply-add/sub (F[N]MADD/ F[N]MSUB):
+  //
+  //    31     27  25 24     20 19     15 14 12 11      7 6           0
+  //   -----------------------------------------------------------------
+  //   [ . . . . | . | . . . . | . . . . | . . | . . . . | . . . . . . ]
+  //   [  rs3     fmt    rs2       rs1   funct3     rd        opcode   ]
+  //   -----------------------------------------------------------------
+  template <typename Reg1, typename Reg2, typename Reg3, typename Reg4>
+  void EmitR4(
+      Reg1 rs3, uint32_t fmt, Reg2 rs2, Reg3 rs1, uint32_t funct3, Reg4 rd, uint32_t opcode) {
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rs3)));
+    DCHECK(IsUint<2>(fmt));
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rs2)));
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rs1)));
+    DCHECK(IsUint<3>(funct3));
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rd)));
+    DCHECK(IsUint<7>(opcode));
+    uint32_t encoding = static_cast<uint32_t>(rs3) << 27 | static_cast<uint32_t>(fmt) << 25 |
+                        static_cast<uint32_t>(rs2) << 20 | static_cast<uint32_t>(rs1) << 15 |
+                        static_cast<uint32_t>(funct3) << 12 | static_cast<uint32_t>(rd) << 7 |
+                        opcode;
+    Emit32(encoding);
+  }
+
+  // S-type instruction:
+  //
+  //    31         25 24     20 19     15 14 12 11      7 6           0
+  //   -----------------------------------------------------------------
+  //   [ . . . . . . | . . . . | . . . . | . . | . . . . | . . . . . . ]
+  //   [   imm11:5       rs2       rs1   funct3   imm4:0      opcode   ]
+  //   -----------------------------------------------------------------
+  template <typename Reg1, typename Reg2>
+  void EmitS(int32_t imm12, Reg1 rs2, Reg2 rs1, uint32_t funct3, uint32_t opcode) {
+    DCHECK(IsInt<12>(imm12)) << imm12;
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rs2)));
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rs1)));
+    DCHECK(IsUint<3>(funct3));
+    DCHECK(IsUint<7>(opcode));
+    uint32_t encoding = (static_cast<uint32_t>(imm12) & 0xFE0) << 20 |
+                        static_cast<uint32_t>(rs2) << 20 | static_cast<uint32_t>(rs1) << 15 |
+                        static_cast<uint32_t>(funct3) << 12 |
+                        (static_cast<uint32_t>(imm12) & 0x1F) << 7 | opcode;
+    Emit32(encoding);
+  }
+
+  // I-type instruction variant for shifts (SLLI / SRLI / SRAI):
+  //
+  //    31       26 25       20 19     15 14 12 11      7 6           0
+  //   -----------------------------------------------------------------
+  //   [ . . . . . | . . . . . | . . . . | . . | . . . . | . . . . . . ]
+  //   [  imm11:6  imm5:0(shamt)   rs1   funct3     rd        opcode   ]
+  //   -----------------------------------------------------------------
+  void EmitI6(uint32_t funct6,
+              uint32_t imm6,
+              XRegister rs1,
+              uint32_t funct3,
+              XRegister rd,
+              uint32_t opcode) {
+    DCHECK(IsUint<6>(funct6));
+    DCHECK(IsUint<6>(imm6)) << imm6;
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rs1)));
+    DCHECK(IsUint<3>(funct3));
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rd)));
+    DCHECK(IsUint<7>(opcode));
+    uint32_t encoding = funct6 << 26 | static_cast<uint32_t>(imm6) << 20 |
+                        static_cast<uint32_t>(rs1) << 15 | funct3 << 12 |
+                        static_cast<uint32_t>(rd) << 7 | opcode;
+    Emit32(encoding);
+  }
+
+  // B-type instruction:
+  //
+  //   31 30       25 24     20 19     15 14 12 11    8 7 6           0
+  //   -----------------------------------------------------------------
+  //   [ | . . . . . | . . . . | . . . . | . . | . . . | | . . . . . . ]
+  //  imm12 imm11:5      rs2       rs1   funct3 imm4:1 imm11  opcode   ]
+  //   -----------------------------------------------------------------
+  void EmitB(int32_t offset, XRegister rs2, XRegister rs1, uint32_t funct3, uint32_t opcode) {
+    DCHECK_ALIGNED(offset, 2);
+    DCHECK(IsInt<13>(offset)) << offset;
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rs2)));
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rs1)));
+    DCHECK(IsUint<3>(funct3));
+    DCHECK(IsUint<7>(opcode));
+    uint32_t imm12 = (static_cast<uint32_t>(offset) >> 1) & 0xfffu;
+    uint32_t encoding = (imm12 & 0x800u) << (31 - 11) | (imm12 & 0x03f0u) << (25 - 4) |
+                        static_cast<uint32_t>(rs2) << 20 | static_cast<uint32_t>(rs1) << 15 |
+                        static_cast<uint32_t>(funct3) << 12 |
+                        (imm12 & 0xfu) << 8 | (imm12 & 0x400u) >> (10 - 7) | opcode;
+    Emit32(encoding);
+  }
+
+  // U-type instruction:
+  //
+  //    31                                   12 11      7 6           0
+  //   -----------------------------------------------------------------
+  //   [ . . . . . . . . . . . . . . . . . . . | . . . . | . . . . . . ]
+  //   [                imm31:12                    rd        opcode   ]
+  //   -----------------------------------------------------------------
+  void EmitU(uint32_t imm20, XRegister rd, uint32_t opcode) {
+    CHECK(IsUint<20>(imm20)) << imm20;
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rd)));
+    DCHECK(IsUint<7>(opcode));
+    uint32_t encoding = imm20 << 12 | static_cast<uint32_t>(rd) << 7 | opcode;
+    Emit32(encoding);
+  }
+
+  // J-type instruction:
+  //
+  //   31 30               21   19           12 11      7 6           0
+  //   -----------------------------------------------------------------
+  //   [ | . . . . . . . . . | | . . . . . . . | . . . . | . . . . . . ]
+  //  imm20    imm10:1      imm11   imm19:12        rd        opcode   ]
+  //   -----------------------------------------------------------------
+  void EmitJ(int32_t offset, XRegister rd, uint32_t opcode) {
+    DCHECK_ALIGNED(offset, 2);
+    CHECK(IsInt<21>(offset)) << offset;
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rd)));
+    DCHECK(IsUint<7>(opcode));
+    uint32_t imm20 = (static_cast<uint32_t>(offset) >> 1) & 0xfffffu;
+    uint32_t encoding = (imm20 & 0x80000u) << (31 - 19) | (imm20 & 0x03ffu) << 21 |
+                        (imm20 & 0x400u) << (20 - 10) | (imm20 & 0x7f800u) << (12 - 11) |
+                        static_cast<uint32_t>(rd) << 7 | opcode;
+    Emit32(encoding);
+  }
+
+  // Compressed Instruction Encodings
+
+  // CR-type instruction:
+  //
+  //   15    12 11      7 6       2 1 0
+  //   ---------------------------------
+  //   [ . . . | . . . . | . . . . | . ]
+  //   [ func4   rd/rs1      rs2    op ]
+  //   ---------------------------------
+  //
+  void EmitCR(uint32_t funct4, XRegister rd_rs1, XRegister rs2, uint32_t opcode) {
+    DCHECK(IsUint<4>(funct4));
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rd_rs1)));
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rs2)));
+    DCHECK(IsUint<2>(opcode));
+
+    uint32_t encoding = funct4 << 12 | static_cast<uint32_t>(rd_rs1) << 7 |
+                        static_cast<uint32_t>(rs2) << 2 | opcode;
+    Emit16(encoding);
+  }
+
+  // CI-type instruction:
+  //
+  //   15  13   11      7 6       2 1 0
+  //   ---------------------------------
+  //   [ . . | | . . . . | . . . . | . ]
+  //   [func3 imm rd/rs1     imm    op ]
+  //   ---------------------------------
+  //
+  template <typename Reg>
+  void EmitCI(uint32_t funct3, Reg rd_rs1, uint32_t imm6, uint32_t opcode) {
+    DCHECK(IsUint<3>(funct3));
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rd_rs1)));
+    DCHECK(IsUint<6>(imm6));
+    DCHECK(IsUint<2>(opcode));
+
+    uint32_t immH1 = BitFieldExtract(imm6, 5, 1);
+    uint32_t immL5 = BitFieldExtract(imm6, 0, 5);
+
+    uint32_t encoding =
+        funct3 << 13 | immH1 << 12 | static_cast<uint32_t>(rd_rs1) << 7 | immL5 << 2 | opcode;
+    Emit16(encoding);
+  }
+
+  // CSS-type instruction:
+  //
+  //   15  13 12        7 6       2 1 0
+  //   ---------------------------------
+  //   [ . . | . . . . . | . . . . | . ]
+  //   [func3     imm6      rs2     op ]
+  //   ---------------------------------
+  //
+  template <typename Reg>
+  void EmitCSS(uint32_t funct3, uint32_t offset6, Reg rs2, uint32_t opcode) {
+    DCHECK(IsUint<3>(funct3));
+    DCHECK(IsUint<6>(offset6));
+    DCHECK(IsUint<5>(static_cast<uint32_t>(rs2)));
+    DCHECK(IsUint<2>(opcode));
+
+    uint32_t encoding = funct3 << 13 | offset6 << 7 | static_cast<uint32_t>(rs2) << 2 | opcode;
+    Emit16(encoding);
+  }
+
+  // CIW-type instruction:
+  //
+  //   15  13 12            5 4   2 1 0
+  //   ---------------------------------
+  //   [ . . | . . . . . . . | . . | . ]
+  //   [func3     imm8         rd'  op ]
+  //   ---------------------------------
+  //
+  void EmitCIW(uint32_t funct3, uint32_t imm8, XRegister rd_s, uint32_t opcode) {
+    DCHECK(IsUint<3>(funct3));
+    DCHECK(IsUint<8>(imm8));
+    DCHECK(IsShortReg(rd_s)) << rd_s;
+    DCHECK(IsUint<2>(opcode));
+
+    uint32_t encoding = funct3 << 13 | imm8 << 5 | EncodeShortReg(rd_s) << 2 | opcode;
+    Emit16(encoding);
+  }
+
+  // CL/S-type instruction:
+  //
+  //   15  13 12  10 9  7 6 5 4   2 1 0
+  //   ---------------------------------
+  //   [ . . | . . | . . | . | . . | . ]
+  //   [func3  imm   rs1' imm rds2' op ]
+  //   ---------------------------------
+  //
+  template <typename Reg>
+  void EmitCM(uint32_t funct3, uint32_t imm5, XRegister rs1_s, Reg rd_rs2_s, uint32_t opcode) {
+    DCHECK(IsUint<3>(funct3));
+    DCHECK(IsUint<5>(imm5));
+    DCHECK(IsShortReg(rs1_s)) << rs1_s;
+    DCHECK(IsShortReg(rd_rs2_s)) << rd_rs2_s;
+    DCHECK(IsUint<2>(opcode));
+
+    uint32_t immH3 = BitFieldExtract(imm5, 2, 3);
+    uint32_t immL2 = BitFieldExtract(imm5, 0, 2);
+
+    uint32_t encoding = funct3 << 13 | immH3 << 10 | EncodeShortReg(rs1_s) << 7 | immL2 << 5 |
+                        EncodeShortReg(rd_rs2_s) << 2 | opcode;
+    Emit16(encoding);
+  }
+
+  // CA-type instruction:
+  //
+  //   15         10 9  7 6 5 4   2 1 0
+  //   ---------------------------------
+  //   [ . . . . . | . . | . | . . | . ]
+  //   [    funct6 rds1' funct2 rs2' op]
+  //   ---------------------------------
+  //
+  void EmitCA(
+      uint32_t funct6, XRegister rd_rs1_s, uint32_t funct2, uint32_t rs2_v, uint32_t opcode) {
+    DCHECK(IsUint<6>(funct6));
+    DCHECK(IsShortReg(rd_rs1_s)) << rd_rs1_s;
+    DCHECK(IsUint<2>(funct2));
+    DCHECK(IsUint<3>(rs2_v));
+    DCHECK(IsUint<2>(opcode));
+
+    uint32_t encoding =
+        funct6 << 10 | EncodeShortReg(rd_rs1_s) << 7 | funct2 << 5  | rs2_v << 2 | opcode;
+    Emit16(encoding);
+  }
+
+  void EmitCAReg(
+      uint32_t funct6, XRegister rd_rs1_s, uint32_t funct2, XRegister rs2_s, uint32_t opcode) {
+    DCHECK(IsShortReg(rs2_s)) << rs2_s;
+    EmitCA(funct6, rd_rs1_s, funct2, EncodeShortReg(rs2_s), opcode);
+  }
+
+  void EmitCAImm(
+      uint32_t funct6, XRegister rd_rs1_s, uint32_t funct2, uint32_t funct3, uint32_t opcode) {
+    EmitCA(funct6, rd_rs1_s, funct2, funct3, opcode);
+  }
+
+  // CB-type instruction:
+  //
+  //   15  13 12  10 9  7 6       2 1 0
+  //   ---------------------------------
+  //   [ . . | . . | . . | . . . . | . ]
+  //   [func3 offset rs1'   offset  op ]
+  //   ---------------------------------
+  //
+  void EmitCB(uint32_t funct3, int32_t offset8, XRegister rd_rs1_s, uint32_t opcode) {
+    DCHECK(IsUint<3>(funct3));
+    DCHECK(IsUint<8>(offset8));
+    DCHECK(IsShortReg(rd_rs1_s)) << rd_rs1_s;
+    DCHECK(IsUint<2>(opcode));
+
+    uint32_t offsetH3 = BitFieldExtract<uint32_t>(offset8, 5, 3);
+    uint32_t offsetL5 = BitFieldExtract<uint32_t>(offset8, 0, 5);
+
+    uint32_t encoding =
+        funct3 << 13 | offsetH3 << 10 | EncodeShortReg(rd_rs1_s) << 7 | offsetL5 << 2 | opcode;
+    Emit16(encoding);
+  }
+
+  // Wrappers for EmitCB with different imm bit permutation
+  void EmitCBBranch(uint32_t funct3, int32_t offset, XRegister rs1_s, uint32_t opcode) {
+    DCHECK(IsInt<9>(offset));
+    DCHECK_ALIGNED(offset, 2);
+
+    uint32_t u_offset = static_cast<uint32_t>(offset);
+
+    // offset[8|4:3]
+    uint32_t offsetH3 = (BitFieldExtract(u_offset, 8, 1) << 2) |
+                         BitFieldExtract(u_offset, 3, 2);
+    // offset[7:6|2:1|5]
+    uint32_t offsetL5 = (BitFieldExtract(u_offset, 6, 2) << 3) |
+                        (BitFieldExtract(u_offset, 1, 2) << 1) |
+                         BitFieldExtract(u_offset, 5, 1);
+
+    EmitCB(funct3, BitFieldInsert(offsetL5, offsetH3, 5, 3), rs1_s, opcode);
+  }
+
+  void EmitCBArithmetic(
+      uint32_t funct3, uint32_t funct2, uint32_t imm, XRegister rd_s, uint32_t opcode) {
+    uint32_t imm_5 = BitFieldExtract(imm, 5, 1);
+    uint32_t immH3 = BitFieldInsert(funct2, imm_5, 2, 1);
+    uint32_t immL5 = BitFieldExtract(imm, 0, 5);
+
+    EmitCB(funct3, BitFieldInsert(immL5, immH3, 5, 3), rd_s, opcode);
+  }
+
+  // CJ-type instruction:
+  //
+  //   15  13 12                  2 1 0
+  //   ---------------------------------
+  //   [ . . | . . . . . . . . . . | . ]
+  //   [func3    jump target 11     op ]
+  //   ---------------------------------
+  //
+  void EmitCJ(uint32_t funct3, int32_t offset, uint32_t opcode) {
+    DCHECK_ALIGNED(offset, 2);
+    DCHECK(IsInt<12>(offset)) << offset;
+    DCHECK(IsUint<3>(funct3));
+    DCHECK(IsUint<2>(opcode));
+
+    uint32_t uoffset = static_cast<uint32_t>(offset);
+    // offset[11|4|9:8|10|6|7|3:1|5]
+    uint32_t jumpt = (BitFieldExtract(uoffset, 11, 1) << 10) |
+                     (BitFieldExtract(uoffset, 4, 1) << 9)   |
+                     (BitFieldExtract(uoffset, 8, 2) << 7)   |
+                     (BitFieldExtract(uoffset, 10, 1) << 6)  |
+                     (BitFieldExtract(uoffset, 6, 1) << 5)   |
+                     (BitFieldExtract(uoffset, 7, 1) << 4)   |
+                     (BitFieldExtract(uoffset, 1, 3) << 1)   |
+                      BitFieldExtract(uoffset, 5, 1);
+
+    DCHECK(IsUint<11>(jumpt));
+
+    uint32_t encoding = funct3 << 13 | jumpt << 2 | opcode;
+    Emit16(encoding);
+  }
+
+  ArenaVector<Branch> branches_;
+
+  // For checking that we finalize the code only once.
+  bool finalized_;
+
+  // Whether appending instructions at the end of the buffer or overwriting the existing ones.
+  bool overwriting_;
+  // The current overwrite location.
+  uint32_t overwrite_location_;
+
+  // Use `std::deque<>` for literal labels to allow insertions at the end
+  // without invalidating pointers and references to existing elements.
+  ArenaDeque<Literal> literals_;
+  ArenaDeque<Literal> long_literals_;  // 64-bit literals separated for alignment reasons.
+
+  // Jump table list.
+  ArenaDeque<JumpTable> jump_tables_;
+
+  // Data for `GetAdjustedPosition()`, see the description there.
+  uint32_t last_position_adjustment_;
+  uint32_t last_old_position_;
+  uint32_t last_branch_id_;
+
+  Riscv64ExtensionMask enabled_extensions_;
+  uint32_t available_scratch_core_registers_;
+  uint32_t available_scratch_fp_registers_;
+
+  static constexpr uint32_t kXlen = 64;
+
+  friend class ScopedExtensionsOverride;
+  friend class ScratchRegisterScope;
+
+  DISALLOW_COPY_AND_ASSIGN(Riscv64Assembler);
+};
+
+class ScopedExtensionsOverride {
+ public:
+  ScopedExtensionsOverride(Riscv64Assembler* assembler, Riscv64ExtensionMask enabled_extensions)
+      : assembler_(assembler),
+        old_enabled_extensions_(assembler->enabled_extensions_) {
+    assembler->enabled_extensions_ = enabled_extensions;
+  }
+
+  ~ScopedExtensionsOverride() {
+    assembler_->enabled_extensions_ = old_enabled_extensions_;
+  }
+
+ protected:
+  static Riscv64ExtensionMask GetEnabledExtensions(Riscv64Assembler* assembler) {
+    return assembler->enabled_extensions_;
+  }
+
+ private:
+  Riscv64Assembler* const assembler_;
+  const Riscv64ExtensionMask old_enabled_extensions_;
+};
+
+template <Riscv64ExtensionMask kMask>
+class ScopedExtensionsRestriction : public ScopedExtensionsOverride {
+ public:
+  explicit ScopedExtensionsRestriction(Riscv64Assembler* assembler)
+      : ScopedExtensionsOverride(assembler, GetEnabledExtensions(assembler) & kMask) {}
+};
+
+template <Riscv64ExtensionMask kMask>
+using ScopedExtensionsExclusion = ScopedExtensionsRestriction<~kMask>;
+
+using ScopedLrScExtensionsRestriction =
+    ScopedExtensionsRestriction<kRiscv64LrScSequenceExtensionsMask>;
+
+class ScratchRegisterScope {
+ public:
+  explicit ScratchRegisterScope(Riscv64Assembler* assembler)
+      : assembler_(assembler),
+        old_available_scratch_core_registers_(assembler->available_scratch_core_registers_),
+        old_available_scratch_fp_registers_(assembler->available_scratch_fp_registers_) {}
+
+  ~ScratchRegisterScope() {
+    assembler_->available_scratch_core_registers_ = old_available_scratch_core_registers_;
+    assembler_->available_scratch_fp_registers_ = old_available_scratch_fp_registers_;
+  }
+
+  // Alocate a scratch `XRegister`. There must be an available register to allocate.
+  XRegister AllocateXRegister() {
+    CHECK_NE(assembler_->available_scratch_core_registers_, 0u);
+    // Allocate the highest available scratch register (prefer TMP(T6) over TMP2(T5)).
+    uint32_t reg_num = (BitSizeOf(assembler_->available_scratch_core_registers_) - 1u) -
+                       CLZ(assembler_->available_scratch_core_registers_);
+    assembler_->available_scratch_core_registers_ &= ~(1u << reg_num);
+    DCHECK_LT(reg_num, enum_cast<uint32_t>(kNumberOfXRegisters));
+    return enum_cast<XRegister>(reg_num);
+  }
+
+  // Free a previously unavailable core register for use as a scratch register.
+  // This can be an arbitrary register, not necessarly the usual `TMP` or `TMP2`.
+  void FreeXRegister(XRegister reg) {
+    uint32_t reg_num = enum_cast<uint32_t>(reg);
+    DCHECK_LT(reg_num, enum_cast<uint32_t>(kNumberOfXRegisters));
+    CHECK_EQ((1u << reg_num) & assembler_->available_scratch_core_registers_, 0u);
+    assembler_->available_scratch_core_registers_ |= 1u << reg_num;
+  }
+
+  // The number of available scratch core registers.
+  size_t AvailableXRegisters() {
+    return POPCOUNT(assembler_->available_scratch_core_registers_);
+  }
+
+  // Make sure a core register is available for use as a scratch register.
+  void IncludeXRegister(XRegister reg) {
+    uint32_t reg_num = enum_cast<uint32_t>(reg);
+    DCHECK_LT(reg_num, enum_cast<uint32_t>(kNumberOfXRegisters));
+    assembler_->available_scratch_core_registers_ |= 1u << reg_num;
+  }
+
+  // Make sure a core register is not available for use as a scratch register.
+  void ExcludeXRegister(XRegister reg) {
+    uint32_t reg_num = enum_cast<uint32_t>(reg);
+    DCHECK_LT(reg_num, enum_cast<uint32_t>(kNumberOfXRegisters));
+    assembler_->available_scratch_core_registers_ &= ~(1u << reg_num);
+  }
+
+  // Alocate a scratch `FRegister`. There must be an available register to allocate.
+  FRegister AllocateFRegister() {
+    CHECK_NE(assembler_->available_scratch_fp_registers_, 0u);
+    // Allocate the highest available scratch register (same as for core registers).
+    uint32_t reg_num = (BitSizeOf(assembler_->available_scratch_fp_registers_) - 1u) -
+                       CLZ(assembler_->available_scratch_fp_registers_);
+    assembler_->available_scratch_fp_registers_ &= ~(1u << reg_num);
+    DCHECK_LT(reg_num, enum_cast<uint32_t>(kNumberOfFRegisters));
+    return enum_cast<FRegister>(reg_num);
+  }
+
+  // Free a previously unavailable FP register for use as a scratch register.
+  // This can be an arbitrary register, not necessarly the usual `FTMP`.
+  void FreeFRegister(FRegister reg) {
+    uint32_t reg_num = enum_cast<uint32_t>(reg);
+    DCHECK_LT(reg_num, enum_cast<uint32_t>(kNumberOfFRegisters));
+    CHECK_EQ((1u << reg_num) & assembler_->available_scratch_fp_registers_, 0u);
+    assembler_->available_scratch_fp_registers_ |= 1u << reg_num;
+  }
+
+  // The number of available scratch FP registers.
+  size_t AvailableFRegisters() {
+    return POPCOUNT(assembler_->available_scratch_fp_registers_);
+  }
+
+  // Make sure an FP register is available for use as a scratch register.
+  void IncludeFRegister(FRegister reg) {
+    uint32_t reg_num = enum_cast<uint32_t>(reg);
+    DCHECK_LT(reg_num, enum_cast<uint32_t>(kNumberOfFRegisters));
+    assembler_->available_scratch_fp_registers_ |= 1u << reg_num;
+  }
+
+  // Make sure an FP register is not available for use as a scratch register.
+  void ExcludeFRegister(FRegister reg) {
+    uint32_t reg_num = enum_cast<uint32_t>(reg);
+    DCHECK_LT(reg_num, enum_cast<uint32_t>(kNumberOfFRegisters));
+    assembler_->available_scratch_fp_registers_ &= ~(1u << reg_num);
+  }
+
+ private:
+  Riscv64Assembler* const assembler_;
+  const uint32_t old_available_scratch_core_registers_;
+  const uint32_t old_available_scratch_fp_registers_;
+
+  DISALLOW_COPY_AND_ASSIGN(ScratchRegisterScope);
+};
+
+}  // namespace riscv64
+}  // namespace art
+
+#endif  // ART_COMPILER_UTILS_RISCV64_ASSEMBLER_RISCV64_H_
diff --git a/compiler/utils/riscv64/assembler_riscv64_test.cc b/compiler/utils/riscv64/assembler_riscv64_test.cc
new file mode 100644
index 0000000..a327987
--- /dev/null
+++ b/compiler/utils/riscv64/assembler_riscv64_test.cc
@@ -0,0 +1,8738 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "assembler_riscv64.h"
+
+#include <inttypes.h>
+
+#include <map>
+
+#include "base/bit_utils.h"
+#include "utils/assembler_test.h"
+
+#define __ GetAssembler()->
+
+namespace art HIDDEN {
+namespace riscv64 {
+
+constexpr Riscv64ExtensionMask kRiscv64CompressedExtensionsMask =
+    Riscv64ExtensionBit(Riscv64Extension::kZca) |
+    Riscv64ExtensionBit(Riscv64Extension::kZcd) |
+    Riscv64ExtensionBit(Riscv64Extension::kZcb);
+
+struct RISCV64CpuRegisterCompare {
+  bool operator()(const XRegister& a, const XRegister& b) const { return a < b; }
+};
+
+class AssemblerRISCV64Test : public AssemblerTest<Riscv64Assembler,
+                                                  Riscv64Label,
+                                                  XRegister,
+                                                  FRegister,
+                                                  int32_t,
+                                                  VRegister> {
+ public:
+  using Base =
+      AssemblerTest<Riscv64Assembler, Riscv64Label, XRegister, FRegister, int32_t, VRegister>;
+
+  AssemblerRISCV64Test() {}
+
+ protected:
+  Riscv64Assembler* CreateAssembler(ArenaAllocator* allocator) override {
+    return new (allocator) Riscv64Assembler(allocator, kRiscv64AllExtensionsMask);
+  }
+
+  InstructionSet GetIsa() override { return InstructionSet::kRiscv64; }
+
+  class ScopedMarchOverride {
+   public:
+    ScopedMarchOverride(AssemblerRISCV64Test* test, const std::string& march)
+        : test_(test), old_override_(test->march_override_) {
+      test->march_override_ = march;
+    }
+
+    ~ScopedMarchOverride() {
+      test_->march_override_ = old_override_;
+    }
+
+   private:
+    AssemblerRISCV64Test* const test_;
+    std::optional<std::string> const old_override_;
+  };
+
+  class ScopedCSuppression {
+   public:
+    explicit ScopedCSuppression(AssemblerRISCV64Test* test)
+        : smo_(test, "-march=rv64imafdv_zba_zbb"),
+          exclusion_(test->GetAssembler()) {}
+
+   private:
+    ScopedMarchOverride smo_;
+    ScopedExtensionsExclusion<kRiscv64CompressedExtensionsMask> exclusion_;
+  };
+
+  class ScopedZbaAndCSuppression {
+   public:
+    explicit ScopedZbaAndCSuppression(AssemblerRISCV64Test* test)
+        : smo_(test, "-march=rv64imafdv_zbb"),
+          exclusion_(test->GetAssembler()) {}
+
+   private:
+    static constexpr Riscv64ExtensionMask kExcludedExtensions =
+        Riscv64ExtensionBit(Riscv64Extension::kZba) | kRiscv64CompressedExtensionsMask;
+
+    ScopedMarchOverride smo_;
+    ScopedExtensionsExclusion<kExcludedExtensions> exclusion_;
+  };
+
+  class ScopedZbbAndCSuppression {
+   public:
+    explicit ScopedZbbAndCSuppression(AssemblerRISCV64Test* test)
+        : smo_(test, "-march=rv64imafdv_zba"),
+          exclusion_(test->GetAssembler()) {}
+
+   private:
+    static constexpr Riscv64ExtensionMask kExcludedExtensions =
+        Riscv64ExtensionBit(Riscv64Extension::kZbb) | kRiscv64CompressedExtensionsMask;
+
+    ScopedMarchOverride smo_;
+    ScopedExtensionsExclusion<kExcludedExtensions> exclusion_;
+  };
+
+  std::vector<std::string> GetAssemblerCommand() override {
+    std::vector<std::string> result = Base::GetAssemblerCommand();
+    if (march_override_.has_value()) {
+      auto it = std::find_if(result.begin(),
+                             result.end(),
+                             [](const std::string& s) { return StartsWith(s, "-march="); });
+      CHECK(it != result.end());
+      *it = march_override_.value();
+    }
+    return result;
+  }
+
+  void SetUpHelpers() override {
+    if (secondary_register_names_.empty()) {
+      secondary_register_names_.emplace(Zero, "zero");
+      secondary_register_names_.emplace(RA, "ra");
+      secondary_register_names_.emplace(SP, "sp");
+      secondary_register_names_.emplace(GP, "gp");
+      secondary_register_names_.emplace(TP, "tp");
+      secondary_register_names_.emplace(T0, "t0");
+      secondary_register_names_.emplace(T1, "t1");
+      secondary_register_names_.emplace(T2, "t2");
+      secondary_register_names_.emplace(S0, "s0");  // s0/fp
+      secondary_register_names_.emplace(S1, "s1");
+      secondary_register_names_.emplace(A0, "a0");
+      secondary_register_names_.emplace(A1, "a1");
+      secondary_register_names_.emplace(A2, "a2");
+      secondary_register_names_.emplace(A3, "a3");
+      secondary_register_names_.emplace(A4, "a4");
+      secondary_register_names_.emplace(A5, "a5");
+      secondary_register_names_.emplace(A6, "a6");
+      secondary_register_names_.emplace(A7, "a7");
+      secondary_register_names_.emplace(S2, "s2");
+      secondary_register_names_.emplace(S3, "s3");
+      secondary_register_names_.emplace(S4, "s4");
+      secondary_register_names_.emplace(S5, "s5");
+      secondary_register_names_.emplace(S6, "s6");
+      secondary_register_names_.emplace(S7, "s7");
+      secondary_register_names_.emplace(S8, "s8");
+      secondary_register_names_.emplace(S9, "s9");
+      secondary_register_names_.emplace(S10, "s10");
+      secondary_register_names_.emplace(S11, "s11");
+      secondary_register_names_.emplace(T3, "t3");
+      secondary_register_names_.emplace(T4, "t4");
+      secondary_register_names_.emplace(T5, "t5");
+      secondary_register_names_.emplace(T6, "t6");
+    }
+  }
+
+  void TearDown() override {
+    AssemblerTest::TearDown();
+  }
+
+  std::vector<Riscv64Label> GetAddresses() override {
+    UNIMPLEMENTED(FATAL) << "Feature not implemented yet";
+    UNREACHABLE();
+  }
+
+  ArrayRef<const XRegister> GetRegisters() override {
+    static constexpr XRegister kXRegisters[] = {
+        Zero,
+        RA,
+        SP,
+        GP,
+        TP,
+        T0,
+        T1,
+        T2,
+        S0,
+        S1,
+        A0,
+        A1,
+        A2,
+        A3,
+        A4,
+        A5,
+        A6,
+        A7,
+        S2,
+        S3,
+        S4,
+        S5,
+        S6,
+        S7,
+        S8,
+        S9,
+        S10,
+        S11,
+        T3,
+        T4,
+        T5,
+        T6,
+    };
+    return ArrayRef<const XRegister>(kXRegisters);
+  }
+
+  ArrayRef<const XRegister> GetRegistersShort() {
+    static constexpr XRegister kXRegistersShort[] = {
+        S0,
+        S1,
+        A0,
+        A1,
+        A2,
+        A3,
+        A4,
+        A5,
+    };
+    return ArrayRef<const XRegister>(kXRegistersShort);
+  }
+
+  ArrayRef<const FRegister> GetFPRegisters() override {
+    static constexpr FRegister kFRegisters[] = {
+        FT0,
+        FT1,
+        FT2,
+        FT3,
+        FT4,
+        FT5,
+        FT6,
+        FT7,
+        FS0,
+        FS1,
+        FA0,
+        FA1,
+        FA2,
+        FA3,
+        FA4,
+        FA5,
+        FA6,
+        FA7,
+        FS2,
+        FS3,
+        FS4,
+        FS5,
+        FS6,
+        FS7,
+        FS8,
+        FS9,
+        FS10,
+        FS11,
+        FT8,
+        FT9,
+        FT10,
+        FT11,
+    };
+    return ArrayRef<const FRegister>(kFRegisters);
+  }
+
+  ArrayRef<const VRegister> GetVectorRegisters() override {
+    static constexpr VRegister kVRegisters[] = {
+        V0,  V1,  V2,  V3,  V4,  V5,  V6,  V7,  V8,  V9,  V10, V11, V12, V13, V14, V15,
+        V16, V17, V18, V19, V20, V21, V22, V23, V24, V25, V26, V27, V28, V29, V30, V31
+    };
+    return ArrayRef<const VRegister>(kVRegisters);
+  }
+
+  ArrayRef<const FRegister> GetFPRegistersShort() {
+    static constexpr FRegister kFRegistersShort[] = {
+        FS0,
+        FS1,
+        FA0,
+        FA1,
+        FA2,
+        FA3,
+        FA4,
+        FA5,
+    };
+    return ArrayRef<const FRegister>(kFRegistersShort);
+  }
+
+  std::string GetSecondaryRegisterName(const XRegister& reg) override {
+    CHECK(secondary_register_names_.find(reg) != secondary_register_names_.end());
+    return secondary_register_names_[reg];
+  }
+
+  int32_t CreateImmediate(int64_t imm_value) override {
+    return dchecked_integral_cast<int32_t>(imm_value);
+  }
+
+  template <typename Emit>
+  std::string RepeatInsn(size_t count, const std::string& insn, Emit&& emit) {
+    std::string result;
+    for (; count != 0u; --count) {
+      result += insn;
+      emit();
+    }
+    return result;
+  }
+
+  std::string EmitNops(size_t size) {
+    // TODO(riscv64): Support "C" Standard Extension.
+    DCHECK_ALIGNED(size, sizeof(uint32_t));
+    const size_t num_nops = size / sizeof(uint32_t);
+    return RepeatInsn(num_nops, "nop\n", [&]() { __ Nop(); });
+  }
+
+  template <typename EmitLoadConst>
+  void TestLoadConst64(const std::string& test_name,
+                       bool can_use_tmp,
+                       EmitLoadConst&& emit_load_const) {
+    std::string expected;
+    // Test standard immediates. Unlike other instructions, `Li()` accepts an `int64_t` but
+    // this is unsupported by `CreateImmediate()`, so we cannot use `RepeatRIb()` for these.
+    // Note: This `CreateImmediateValuesBits()` call does not produce any values where
+    // `LoadConst64()` would emit different code from `Li()`.
+    for (int64_t value : CreateImmediateValuesBits(64, /*as_uint=*/ false)) {
+      emit_load_const(A0, value);
+      expected += "li a0, " + std::to_string(value) + "\n";
+    }
+    // Test various registers with a few small values.
+    // (Even Zero is an accepted register even if that does not really load the requested value.)
+    for (XRegister reg : GetRegisters()) {
+      ScratchRegisterScope srs(GetAssembler());
+      srs.ExcludeXRegister(reg);
+      std::string rd = GetRegisterName(reg);
+      emit_load_const(reg, -1);
+      expected += "li " + rd + ", -1\n";
+      emit_load_const(reg, 0);
+      expected += "li " + rd + ", 0\n";
+      emit_load_const(reg, 1);
+      expected += "li " + rd + ", 1\n";
+    }
+    // Test some significant values. Some may just repeat the tests above but other values
+    // show some complex patterns, even exposing a value where clang (and therefore also this
+    // assembler) does not generate the shortest sequence.
+    // For the following values, `LoadConst64()` emits the same code as `Li()`.
+    int64_t test_values1[] = {
+        // Small values, either ADDI, ADDI+SLLI, LUI, or LUI+ADDIW.
+        // The ADDI+LUI is presumably used to allow shorter code for RV64C.
+        -4097, -4096, -4095, -2176, -2049, -2048, -2047, -1025, -1024, -1023, -2, -1,
+        0, 1, 2, 1023, 1024, 1025, 2047, 2048, 2049, 2176, 4095, 4096, 4097,
+        // Just below std::numeric_limits<int32_t>::min()
+        INT64_C(-0x80000001),  // LUI+ADDI
+        INT64_C(-0x80000800),  // LUI+ADDI
+        INT64_C(-0x80000801),  // LUI+ADDIW+SLLI+ADDI; LUI+ADDI+ADDI would be shorter.
+        INT64_C(-0x80000800123),  // LUI+ADDIW+SLLI+ADDI
+        INT64_C(0x0123450000000123),  // LUI+SLLI+ADDI
+        INT64_C(-0x7654300000000123),  // LUI+SLLI+ADDI
+        INT64_C(0x0fffffffffff0000),  // LUI+SRLI
+        INT64_C(0x0ffffffffffff000),  // LUI+SRLI
+        INT64_C(0x0ffffffffffff010),  // LUI+ADDIW+SRLI
+        INT64_C(0x0fffffffffffff10),  // ADDI+SLLI+ADDI; LUI+ADDIW+SRLI would be same length.
+        INT64_C(0x0fffffffffffff80),  // ADDI+SRLI
+        INT64_C(0x0ffffffff7ffff80),  // LUI+ADDI+SRLI
+        INT64_C(0x0123450000001235),  // LUI+SLLI+ADDI+SLLI+ADDI
+        INT64_C(0x0123450000001234),  // LUI+SLLI+ADDI+SLLI
+        INT64_C(0x0000000fff808010),  // LUI+SLLI+SRLI
+        INT64_C(0x00000000fff80801),  // LUI+SLLI+SRLI
+        INT64_C(0x00000000ffffffff),  // ADDI+SRLI
+        INT64_C(0x00000001ffffffff),  // ADDI+SRLI
+        INT64_C(0x00000003ffffffff),  // ADDI+SRLI
+        INT64_C(0x00000000ffc00801),  // LUI+ADDIW+SLLI+ADDI
+        INT64_C(0x00000001fffff7fe),  // ADDI+SLLI+SRLI
+    };
+    for (int64_t value : test_values1) {
+      emit_load_const(A0, value);
+      expected += "li a0, " + std::to_string(value) + "\n";
+    }
+    // For the following values, `LoadConst64()` emits different code than `Li()`.
+    std::pair<int64_t, const char*> test_values2[] = {
+        // Li:        LUI+ADDIW+SLLI+ADDI+SLLI+ADDI+SLLI+ADDI
+        // LoadConst: LUI+ADDIW+LUI+ADDIW+SLLI+ADD (using TMP)
+        { INT64_C(0x1234567812345678),
+          "li {reg1}, 0x12345678 / 8\n"  // Trailing zero bits in high word are handled by SLLI.
+          "li {reg2}, 0x12345678\n"
+          "slli {reg1}, {reg1}, 32 + 3\n"
+          "add {reg1}, {reg1}, {reg2}\n" },
+        { INT64_C(0x1234567887654321),
+          "li {reg1}, 0x12345678 + 1\n"  // One higher to compensate for negative TMP.
+          "li {reg2}, 0x87654321 - 0x100000000\n"
+          "slli {reg1}, {reg1}, 32\n"
+          "add {reg1}, {reg1}, {reg2}\n" },
+        { INT64_C(-0x1234567887654321),
+          "li {reg1}, -0x12345678 - 1\n"  // High 32 bits of the constant.
+          "li {reg2}, 0x100000000 - 0x87654321\n"  // Low 32 bits of the constant.
+          "slli {reg1}, {reg1}, 32\n"
+          "add {reg1}, {reg1}, {reg2}\n" },
+
+        // Li:        LUI+SLLI+ADDI+SLLI+ADDI+SLLI
+        // LoadConst: LUI+LUI+SLLI+ADD (using TMP)
+        { INT64_C(0x1234500012345000),
+          "lui {reg1}, 0x12345\n"
+          "lui {reg2}, 0x12345\n"
+          "slli {reg1}, {reg1}, 44 - 12\n"
+          "add {reg1}, {reg1}, {reg2}\n" },
+        { INT64_C(0x0123450012345000),
+          "lui {reg1}, 0x12345\n"
+          "lui {reg2}, 0x12345\n"
+          "slli {reg1}, {reg1}, 40 - 12\n"
+          "add {reg1}, {reg1}, {reg2}\n" },
+
+        // Li:        LUI+ADDIW+SLLI+ADDI+SLLI+ADDI
+        // LoadConst: LUI+LUI+ADDIW+SLLI+ADD (using TMP)
+        { INT64_C(0x0001234512345678),
+          "lui {reg1}, 0x12345\n"
+          "li {reg2}, 0x12345678\n"
+          "slli {reg1}, {reg1}, 32 - 12\n"
+          "add {reg1}, {reg1}, {reg2}\n" },
+        { INT64_C(0x0012345012345678),
+          "lui {reg1}, 0x12345\n"
+          "li {reg2}, 0x12345678\n"
+          "slli {reg1}, {reg1}, 36 - 12\n"
+          "add {reg1}, {reg1}, {reg2}\n" },
+    };
+    for (auto [value, fmt] : test_values2) {
+      emit_load_const(A0, value);
+      if (can_use_tmp) {
+        std::string base = fmt;
+        ReplaceReg(REG1_TOKEN, GetRegisterName(A0), &base);
+        ReplaceReg(REG2_TOKEN, GetRegisterName(TMP), &base);
+        expected += base;
+      } else {
+        expected += "li a0, " + std::to_string(value) + "\n";
+      }
+    }
+
+    DriverStr(expected, test_name);
+  }
+
+  auto GetPrintBcond() {
+    return [](const std::string& cond,
+              [[maybe_unused]] const std::string& opposite_cond,
+              const std::string& args,
+              const std::string& target) {
+      return "b" + cond + args + ", " + target + "\n";
+    };
+  }
+
+  auto GetPrintBcondOppositeAndJ(const std::string& skip_label) {
+    return [=]([[maybe_unused]] const std::string& cond,
+               const std::string& opposite_cond,
+               const std::string& args,
+               const std::string& target) {
+      return "b" + opposite_cond + args + ", " + skip_label + "f\n" +
+             "j " + target + "\n" +
+             skip_label + ":\n";
+    };
+  }
+
+  auto GetPrintBcondOppositeAndTail(const std::string& skip_label, const std::string& base_label) {
+    return [=]([[maybe_unused]] const std::string& cond,
+               const std::string& opposite_cond,
+               const std::string& args,
+               const std::string& target) {
+      return "b" + opposite_cond + args + ", " + skip_label + "f\n" +
+             base_label + ":\n" +
+             "auipc t6, %pcrel_hi(" + target + ")\n" +
+             "jalr x0, %pcrel_lo(" + base_label + "b)(t6)\n" +
+             skip_label + ":\n";
+    };
+  }
+
+  // Helper function for basic tests that all branch conditions map to the correct opcodes,
+  // whether with branch expansion (a conditional branch with opposite condition over an
+  // unconditional branch) or without.
+  template <typename PrintBcond>
+  std::string EmitBcondForAllConditions(Riscv64Label* label,
+                                        const std::string& target,
+                                        PrintBcond&& print_bcond,
+                                        bool is_bare) {
+    XRegister rs = A0;
+    __ Beqz(rs, label, is_bare);
+    __ Bnez(rs, label, is_bare);
+    __ Blez(rs, label, is_bare);
+    __ Bgez(rs, label, is_bare);
+    __ Bltz(rs, label, is_bare);
+    __ Bgtz(rs, label, is_bare);
+    XRegister rt = A1;
+    __ Beq(rs, rt, label, is_bare);
+    __ Bne(rs, rt, label, is_bare);
+    __ Ble(rs, rt, label, is_bare);
+    __ Bge(rs, rt, label, is_bare);
+    __ Blt(rs, rt, label, is_bare);
+    __ Bgt(rs, rt, label, is_bare);
+    __ Bleu(rs, rt, label, is_bare);
+    __ Bgeu(rs, rt, label, is_bare);
+    __ Bltu(rs, rt, label, is_bare);
+    __ Bgtu(rs, rt, label, is_bare);
+
+    return
+        print_bcond("eq", "ne", "z a0", target) +
+        print_bcond("ne", "eq", "z a0", target) +
+        print_bcond("le", "gt", "z a0", target) +
+        print_bcond("ge", "lt", "z a0", target) +
+        print_bcond("lt", "ge", "z a0", target) +
+        print_bcond("gt", "le", "z a0", target) +
+        print_bcond("eq", "ne", " a0, a1", target) +
+        print_bcond("ne", "eq", " a0, a1", target) +
+        print_bcond("le", "gt", " a0, a1", target) +
+        print_bcond("ge", "lt", " a0, a1", target) +
+        print_bcond("lt", "ge", " a0, a1", target) +
+        print_bcond("gt", "le", " a0, a1", target) +
+        print_bcond("leu", "gtu", " a0, a1", target) +
+        print_bcond("geu", "ltu", " a0, a1", target) +
+        print_bcond("ltu", "geu", " a0, a1", target) +
+        print_bcond("gtu", "leu", " a0, a1", target);
+  }
+
+  // Test Bcond for forward branches with all conditions.
+  // The gap must be such that either all branches expand, or none does.
+  template <typename PrintBcond>
+  void TestBcondForward(const std::string& test_name,
+                        size_t gap_size,
+                        const std::string& target_label,
+                        PrintBcond&& print_bcond,
+                        bool is_bare = false) {
+    std::string expected;
+    Riscv64Label label;
+    expected += EmitBcondForAllConditions(&label, target_label + "f", print_bcond, is_bare);
+    expected += EmitNops(gap_size);
+    __ Bind(&label);
+    expected += target_label + ":\n";
+    DriverStr(expected, test_name);
+  }
+
+  // Test Bcond for backward branches with all conditions.
+  // The gap must be such that either all branches expand, or none does.
+  template <typename PrintBcond>
+  void TestBcondBackward(const std::string& test_name,
+                         size_t gap_size,
+                         const std::string& target_label,
+                         PrintBcond&& print_bcond,
+                         bool is_bare = false) {
+    std::string expected;
+    Riscv64Label label;
+    __ Bind(&label);
+    expected += target_label + ":\n";
+    expected += EmitNops(gap_size);
+    expected += EmitBcondForAllConditions(&label, target_label + "b", print_bcond, is_bare);
+    DriverStr(expected, test_name);
+  }
+
+  size_t MaxOffset13BackwardDistance() {
+    return 4 * KB;
+  }
+
+  size_t MaxOffset13ForwardDistance() {
+    // TODO(riscv64): Support "C" Standard Extension, max forward distance 4KiB - 2.
+    return 4 * KB - 4;
+  }
+
+  size_t MaxOffset21BackwardDistance() {
+    return 1 * MB;
+  }
+
+  size_t MaxOffset21ForwardDistance() {
+    // TODO(riscv64): Support "C" Standard Extension, max forward distance 1MiB - 2.
+    return 1 * MB - 4;
+  }
+
+  template <typename PrintBcond>
+  void TestBeqA0A1Forward(const std::string& test_name,
+                          size_t nops_size,
+                          const std::string& target_label,
+                          PrintBcond&& print_bcond,
+                          bool is_bare = false) {
+    std::string expected;
+    Riscv64Label label;
+    __ Beq(A0, A1, &label, is_bare);
+    expected += print_bcond("eq", "ne", " a0, a1", target_label + "f");
+    expected += EmitNops(nops_size);
+    __ Bind(&label);
+    expected += target_label + ":\n";
+    DriverStr(expected, test_name);
+  }
+
+  template <typename PrintBcond>
+  void TestBeqA0A1Backward(const std::string& test_name,
+                           size_t nops_size,
+                           const std::string& target_label,
+                           PrintBcond&& print_bcond,
+                           bool is_bare = false) {
+    std::string expected;
+    Riscv64Label label;
+    __ Bind(&label);
+    expected += target_label + ":\n";
+    expected += EmitNops(nops_size);
+    __ Beq(A0, A1, &label, is_bare);
+    expected += print_bcond("eq", "ne", " a0, a1", target_label + "b");
+    DriverStr(expected, test_name);
+  }
+
+  // Test a branch setup where expanding one branch causes expanding another branch
+  // which causes expanding another branch, etc. The argument `cascade` determines
+  // whether we push the first branch to expand, or not.
+  template <typename PrintBcond>
+  void TestBeqA0A1MaybeCascade(const std::string& test_name,
+                               bool cascade,
+                               PrintBcond&& print_bcond) {
+    const size_t kNumBeqs = MaxOffset13ForwardDistance() / sizeof(uint32_t) / 2u;
+    auto label_name = [](size_t i) { return  ".L" + std::to_string(i); };
+
+    std::string expected;
+    std::vector<Riscv64Label> labels(kNumBeqs);
+    for (size_t i = 0; i != kNumBeqs; ++i) {
+      __ Beq(A0, A1, &labels[i]);
+      expected += print_bcond("eq", "ne", " a0, a1", label_name(i));
+    }
+    if (cascade) {
+      expected += EmitNops(sizeof(uint32_t));
+    }
+    for (size_t i = 0; i != kNumBeqs; ++i) {
+      expected += EmitNops(2 * sizeof(uint32_t));
+      __ Bind(&labels[i]);
+      expected += label_name(i) + ":\n";
+    }
+    DriverStr(expected, test_name);
+  }
+
+  auto GetPrintJalRd() {
+    return [=](XRegister rd, const std::string& target) {
+      std::string rd_name = GetRegisterName(rd);
+      return "jal " + rd_name + ", " + target + "\n";
+    };
+  }
+
+  auto GetPrintCallRd(const std::string& base_label) {
+    return [=](XRegister rd, const std::string& target) {
+      std::string rd_name = GetRegisterName(rd);
+      std::string temp_name = (rd != Zero) ? rd_name : GetRegisterName(TMP);
+      return base_label + ":\n" +
+             "auipc " + temp_name + ", %pcrel_hi(" + target + ")\n" +
+             "jalr " + rd_name + ", %pcrel_lo(" + base_label + "b)(" + temp_name + ")\n";
+    };
+  }
+
+  template <typename PrintJalRd>
+  void TestJalRdForward(const std::string& test_name,
+                        size_t gap_size,
+                        const std::string& label_name,
+                        PrintJalRd&& print_jalrd,
+                        bool is_bare = false) {
+    std::string expected;
+    Riscv64Label label;
+    for (XRegister reg : GetRegisters()) {
+      __ Jal(reg, &label, is_bare);
+      expected += print_jalrd(reg, label_name + "f");
+    }
+    expected += EmitNops(gap_size);
+    __ Bind(&label);
+    expected += label_name + ":\n";
+    DriverStr(expected, test_name);
+  }
+
+  template <typename PrintJalRd>
+  void TestJalRdBackward(const std::string& test_name,
+                         size_t gap_size,
+                         const std::string& label_name,
+                         PrintJalRd&& print_jalrd,
+                         bool is_bare = false) {
+    std::string expected;
+    Riscv64Label label;
+    __ Bind(&label);
+    expected += label_name + ":\n";
+    expected += EmitNops(gap_size);
+    for (XRegister reg : GetRegisters()) {
+      __ Jal(reg, &label, is_bare);
+      expected += print_jalrd(reg, label_name + "b");
+    }
+    DriverStr(expected, test_name);
+  }
+
+  auto GetEmitJ(bool is_bare = false) {
+    return [=](Riscv64Label* label) { __ J(label, is_bare); };
+  }
+
+  auto GetEmitJal() {
+    return [=](Riscv64Label* label) { __ Jal(label); };
+  }
+
+  auto GetPrintJ() {
+    return [=](const std::string& target) {
+      return "j " + target + "\n";
+    };
+  }
+
+  auto GetPrintJal() {
+    return [=](const std::string& target) {
+      return "jal " + target + "\n";
+    };
+  }
+
+  auto GetPrintTail(const std::string& base_label) {
+    return [=](const std::string& target) {
+      return base_label + ":\n" +
+             "auipc t6, %pcrel_hi(" + target + ")\n" +
+             "jalr x0, %pcrel_lo(" + base_label + "b)(t6)\n";
+    };
+  }
+
+  auto GetPrintCall(const std::string& base_label) {
+    return [=](const std::string& target) {
+      return base_label + ":\n" +
+             "auipc ra, %pcrel_hi(" + target + ")\n" +
+             "jalr ra, %pcrel_lo(" + base_label + "b)(ra)\n";
+    };
+  }
+
+  template <typename EmitBuncond, typename PrintBuncond>
+  void TestBuncondForward(const std::string& test_name,
+                          size_t gap_size,
+                          const std::string& label_name,
+                          EmitBuncond&& emit_buncond,
+                          PrintBuncond&& print_buncond) {
+    std::string expected;
+    Riscv64Label label;
+    emit_buncond(&label);
+    expected += print_buncond(label_name + "f");
+    expected += EmitNops(gap_size);
+    __ Bind(&label);
+    expected += label_name + ":\n";
+    DriverStr(expected, test_name);
+  }
+
+  template <typename EmitBuncond, typename PrintBuncond>
+  void TestBuncondBackward(const std::string& test_name,
+                           size_t gap_size,
+                           const std::string& label_name,
+                           EmitBuncond&& emit_buncond,
+                           PrintBuncond&& print_buncond) {
+    std::string expected;
+    Riscv64Label label;
+    __ Bind(&label);
+    expected += label_name + ":\n";
+    expected += EmitNops(gap_size);
+    emit_buncond(&label);
+    expected += print_buncond(label_name + "b");
+    DriverStr(expected, test_name);
+  }
+
+  template <typename EmitOp>
+  void TestAddConst(const std::string& test_name,
+                    size_t bits,
+                    const std::string& suffix,
+                    EmitOp&& emit_op) {
+    int64_t kImm12s[] = {
+        0, 1, 2, 0xff, 0x100, 0x1ff, 0x200, 0x3ff, 0x400, 0x7ff,
+        -1, -2, -0x100, -0x101, -0x200, -0x201, -0x400, -0x401, -0x800,
+    };
+    int64_t kSimplePositiveValues[] = {
+        0x800, 0x801, 0xbff, 0xc00, 0xff0, 0xff7, 0xff8, 0xffb, 0xffc, 0xffd, 0xffe,
+    };
+    int64_t kSimpleNegativeValues[] = {
+        -0x801, -0x802, -0xbff, -0xc00, -0xff0, -0xff8, -0xffc, -0xffe, -0xfff, -0x1000,
+    };
+    std::vector<int64_t> large_values = CreateImmediateValuesBits(bits, /*as_uint=*/ false);
+    auto kept_end = std::remove_if(large_values.begin(),
+                                   large_values.end(),
+                                   [](int64_t value) { return IsInt<13>(value); });
+    large_values.erase(kept_end, large_values.end());
+    large_values.push_back(0xfff);
+
+    std::string expected;
+    for (XRegister rd : GetRegisters()) {
+      std::string rd_name = GetRegisterName(rd);
+      std::string addi_rd = ART_FORMAT("addi{} {}, ", suffix, rd_name);
+      std::string add_rd = ART_FORMAT("add{} {}, ", suffix, rd_name);
+      for (XRegister rs1 : GetRegisters()) {
+        ScratchRegisterScope srs(GetAssembler());
+        srs.ExcludeXRegister(rs1);
+        srs.ExcludeXRegister(rd);
+
+        std::string rs1_name = GetRegisterName(rs1);
+        std::string tmp_name = GetRegisterName((rs1 != TMP) ? TMP : TMP2);
+        std::string addi_tmp = ART_FORMAT("addi{} {}, ", suffix, tmp_name);
+
+        for (int64_t imm : kImm12s) {
+          emit_op(rd, rs1, imm);
+          expected += ART_FORMAT("{}{}, {}\n", addi_rd, rs1_name, std::to_string(imm));
+        }
+
+        auto emit_simple_ops = [&](ArrayRef<const int64_t> imms, int64_t adjustment) {
+          for (int64_t imm : imms) {
+            emit_op(rd, rs1, imm);
+            expected += ART_FORMAT("{}{}, {}\n", addi_tmp, rs1_name, std::to_string(adjustment));
+            expected +=
+                ART_FORMAT("{}{}, {}\n", addi_rd, tmp_name, std::to_string(imm - adjustment));
+          }
+        };
+        emit_simple_ops(ArrayRef<const int64_t>(kSimplePositiveValues), 0x7ff);
+        emit_simple_ops(ArrayRef<const int64_t>(kSimpleNegativeValues), -0x800);
+
+        for (int64_t imm : large_values) {
+          emit_op(rd, rs1, imm);
+          expected += ART_FORMAT("li {}, {}\n", tmp_name, std::to_string(imm));
+          expected += ART_FORMAT("{}{}, {}\n", add_rd, rs1_name, tmp_name);
+        }
+      }
+    }
+    DriverStr(expected, test_name);
+  }
+
+  template <typename GetTemp, typename EmitOp>
+  std::string RepeatLoadStoreArbitraryOffset(const std::string& head,
+                                             GetTemp&& get_temp,
+                                             EmitOp&& emit_op) {
+    int64_t kImm12s[] = {
+        0, 1, 2, 0xff, 0x100, 0x1ff, 0x200, 0x3ff, 0x400, 0x7ff,
+        -1, -2, -0x100, -0x101, -0x200, -0x201, -0x400, -0x401, -0x800,
+    };
+    int64_t kSimplePositiveOffsetsAlign8[] = {
+        0x800, 0x801, 0xbff, 0xc00, 0xff0, 0xff4, 0xff6, 0xff7
+    };
+    int64_t kSimplePositiveOffsetsAlign4[] = {
+        0xff8, 0xff9, 0xffa, 0xffb
+    };
+    int64_t kSimplePositiveOffsetsAlign2[] = {
+        0xffc, 0xffd
+    };
+    int64_t kSimplePositiveOffsetsNoAlign[] = {
+        0xffe
+    };
+    int64_t kSimpleNegativeOffsets[] = {
+        -0x801, -0x802, -0xbff, -0xc00, -0xff0, -0xff8, -0xffc, -0xffe, -0xfff, -0x1000,
+    };
+    int64_t kSplitOffsets[] = {
+        0xfff, 0x1000, 0x1001, 0x17ff, 0x1800, 0x1fff, 0x2000, 0x2001, 0x27ff, 0x2800,
+        0x7fffe7ff, 0x7fffe800, 0x7fffefff, 0x7ffff000, 0x7ffff001, 0x7ffff7ff,
+        -0x1001, -0x1002, -0x17ff, -0x1800, -0x1801, -0x2000, -0x2001, -0x2800, -0x2801,
+        -0x7ffff000, -0x7ffff001, -0x7ffff800, -0x7ffff801, -0x7fffffff, -0x80000000,
+    };
+    int64_t kSpecialOffsets[] = {
+        0x7ffff800, 0x7ffff801, 0x7ffffffe, 0x7fffffff
+    };
+
+    std::string expected;
+    for (XRegister rs1 : GetRegisters()) {
+      XRegister tmp = get_temp(rs1);
+      if (tmp == kNoXRegister) {
+        continue;  // Unsupported register combination.
+      }
+      std::string tmp_name = GetRegisterName(tmp);
+      ScratchRegisterScope srs(GetAssembler());
+      srs.ExcludeXRegister(rs1);
+      std::string rs1_name = GetRegisterName(rs1);
+
+      for (int64_t imm : kImm12s) {
+        emit_op(rs1, imm);
+        expected += ART_FORMAT("{}, {}({})\n", head, std::to_string(imm), rs1_name);
+      }
+
+      auto emit_simple_ops = [&](ArrayRef<const int64_t> imms, int64_t adjustment) {
+        for (int64_t imm : imms) {
+          emit_op(rs1, imm);
+          expected +=
+              ART_FORMAT("addi {}, {}, {}\n", tmp_name, rs1_name, std::to_string(adjustment));
+          expected += ART_FORMAT("{}, {}({})\n", head, std::to_string(imm - adjustment), tmp_name);
+        }
+      };
+      emit_simple_ops(ArrayRef<const int64_t>(kSimplePositiveOffsetsAlign8), 0x7f8);
+      emit_simple_ops(ArrayRef<const int64_t>(kSimplePositiveOffsetsAlign4), 0x7fc);
+      emit_simple_ops(ArrayRef<const int64_t>(kSimplePositiveOffsetsAlign2), 0x7fe);
+      emit_simple_ops(ArrayRef<const int64_t>(kSimplePositiveOffsetsNoAlign), 0x7ff);
+      emit_simple_ops(ArrayRef<const int64_t>(kSimpleNegativeOffsets), -0x800);
+
+      for (int64_t imm : kSplitOffsets) {
+        emit_op(rs1, imm);
+        uint32_t imm20 = ((imm >> 12) + ((imm >> 11) & 1)) & 0xfffff;
+        int32_t small_offset = (imm & 0xfff) - ((imm & 0x800) << 1);
+        expected += ART_FORMAT("lui {}, {}\n", tmp_name, std::to_string(imm20));
+        expected += ART_FORMAT("add {}, {}, {}\n", tmp_name, tmp_name, rs1_name);
+        expected += ART_FORMAT("{},{}({})\n", head, std::to_string(small_offset), tmp_name);
+      }
+
+      for (int64_t imm : kSpecialOffsets) {
+        emit_op(rs1, imm);
+        expected += ART_FORMAT("lui {}, 0x80000\n", tmp_name);
+        expected +=
+            ART_FORMAT("addiw {}, {}, {}\n", tmp_name, tmp_name, std::to_string(imm - 0x80000000));
+        expected += ART_FORMAT("add {}, {}, {}\n", tmp_name, tmp_name, rs1_name);
+        expected += ART_FORMAT("{}, ({})\n", head, tmp_name);
+      }
+    }
+    return expected;
+  }
+
+  void TestLoadStoreArbitraryOffset(const std::string& test_name,
+                                    const std::string& insn,
+                                    void (Riscv64Assembler::*fn)(XRegister, XRegister, int32_t),
+                                    bool is_store) {
+    std::string expected;
+    for (XRegister rd : GetRegisters()) {
+      ScratchRegisterScope srs(GetAssembler());
+      srs.ExcludeXRegister(rd);
+      auto get_temp = [&](XRegister rs1) {
+        if (is_store) {
+          return (rs1 != TMP && rd != TMP)
+              ? TMP
+              : (rs1 != TMP2 && rd != TMP2) ? TMP2 : kNoXRegister;
+        } else {
+          return rs1 != TMP ? TMP : TMP2;
+        }
+      };
+      expected += RepeatLoadStoreArbitraryOffset(
+          insn + " " + GetRegisterName(rd),
+          get_temp,
+          [&](XRegister rs1, int64_t offset) { (GetAssembler()->*fn)(rd, rs1, offset); });
+    }
+    DriverStr(expected, test_name);
+  }
+
+  void TestFPLoadStoreArbitraryOffset(const std::string& test_name,
+                                      const std::string& insn,
+                                      void (Riscv64Assembler::*fn)(FRegister, XRegister, int32_t)) {
+    std::string expected;
+    for (FRegister rd : GetFPRegisters()) {
+      expected += RepeatLoadStoreArbitraryOffset(
+          insn + " " + GetFPRegName(rd),
+          [&](XRegister rs1) { return rs1 != TMP ? TMP : TMP2; },
+          [&](XRegister rs1, int64_t offset) { (GetAssembler()->*fn)(rd, rs1, offset); });
+    }
+    DriverStr(expected, test_name);
+  }
+
+  void TestLoadLiteral(const std::string& test_name, bool with_padding_for_long) {
+    std::string expected;
+    Literal* narrow_literal = __ NewLiteral<uint32_t>(0x12345678);
+    Literal* wide_literal = __ NewLiteral<uint64_t>(0x1234567887654321);
+    auto print_load = [&](const std::string& load, XRegister rd, const std::string& label) {
+      std::string rd_name = GetRegisterName(rd);
+      expected += "1:\n"
+                  "auipc " + rd_name + ", %pcrel_hi(" + label + "f)\n" +
+                  load + " " + rd_name + ", %pcrel_lo(1b)(" + rd_name + ")\n";
+    };
+    for (XRegister reg : GetRegisters()) {
+      if (reg != Zero) {
+        __ Loadw(reg, narrow_literal);
+        print_load("lw", reg, "2");
+        __ Loadwu(reg, narrow_literal);
+        print_load("lwu", reg, "2");
+        __ Loadd(reg, wide_literal);
+        print_load("ld", reg, "3");
+      }
+    }
+    std::string tmp = GetRegisterName(TMP);
+    auto print_fp_load = [&](const std::string& load, FRegister rd, const std::string& label) {
+      std::string rd_name = GetFPRegName(rd);
+      expected += "1:\n"
+                  "auipc " + tmp + ", %pcrel_hi(" + label + "f)\n" +
+                  load + " " + rd_name + ", %pcrel_lo(1b)(" + tmp + ")\n";
+    };
+    for (FRegister freg : GetFPRegisters()) {
+      __ FLoadw(freg, narrow_literal);
+      print_fp_load("flw", freg, "2");
+      __ FLoadd(freg, wide_literal);
+      print_fp_load("fld", freg, "3");
+    }
+    // All literal loads above emit 8 bytes of code. The narrow literal shall emit 4 bytes of code.
+    // If we do not add another instruction, we shall end up with padding before the long literal.
+    expected += EmitNops(with_padding_for_long ? 0u : sizeof(uint32_t));
+    expected += "2:\n"
+                ".4byte 0x12345678\n" +
+                std::string(with_padding_for_long ? ".4byte 0\n" : "") +
+                "3:\n"
+                ".8byte 0x1234567887654321\n";
+    DriverStr(expected, test_name);
+  }
+
+  std::string RepeatFFFFRoundingMode(
+      void (Riscv64Assembler::*f)(FRegister, FRegister, FRegister, FRegister, FPRoundingMode),
+      const std::string& fmt) {
+    CHECK(f != nullptr);
+    std::string str;
+    for (FRegister reg1 : GetFPRegisters()) {
+      for (FRegister reg2 : GetFPRegisters()) {
+        for (FRegister reg3 : GetFPRegisters()) {
+          for (FRegister reg4 : GetFPRegisters()) {
+            for (FPRoundingMode rm : kRoundingModes) {
+              (GetAssembler()->*f)(reg1, reg2, reg3, reg4, rm);
+
+              std::string base = fmt;
+              ReplaceReg(REG1_TOKEN, GetFPRegName(reg1), &base);
+              ReplaceReg(REG2_TOKEN, GetFPRegName(reg2), &base);
+              ReplaceReg(REG3_TOKEN, GetFPRegName(reg3), &base);
+              ReplaceReg(REG4_TOKEN, GetFPRegName(reg4), &base);
+              ReplaceRoundingMode(rm, &base);
+              str += base;
+              str += "\n";
+            }
+          }
+        }
+      }
+    }
+    return str;
+  }
+
+  std::string RepeatFFFRoundingMode(
+      void (Riscv64Assembler::*f)(FRegister, FRegister, FRegister, FPRoundingMode),
+      const std::string& fmt) {
+    CHECK(f != nullptr);
+    std::string str;
+    for (FRegister reg1 : GetFPRegisters()) {
+      for (FRegister reg2 : GetFPRegisters()) {
+        for (FRegister reg3 : GetFPRegisters()) {
+          for (FPRoundingMode rm : kRoundingModes) {
+            (GetAssembler()->*f)(reg1, reg2, reg3, rm);
+
+            std::string base = fmt;
+            ReplaceReg(REG1_TOKEN, GetFPRegName(reg1), &base);
+            ReplaceReg(REG2_TOKEN, GetFPRegName(reg2), &base);
+            ReplaceReg(REG3_TOKEN, GetFPRegName(reg3), &base);
+            ReplaceRoundingMode(rm, &base);
+            str += base;
+            str += "\n";
+          }
+        }
+      }
+    }
+    return str;
+  }
+
+  template <typename Reg, typename Imm>
+  std::string RepeatCTemplateRegImm(void (Riscv64Assembler::*f)(Reg, Imm),
+                                    ArrayRef<const Reg> registers,
+                                    std::string (Base::*GetName)(const Reg&),
+                                    int imm_bits,
+                                    int shift,
+                                    bool no_zero_imm,
+                                    const std::string& fmt) {
+    auto imms = CreateImmediateValuesBits(abs(imm_bits), /*as_uint=*/imm_bits > 0, shift);
+
+    CHECK(f != nullptr);
+    std::string str;
+    for (Reg reg : registers) {
+      for (int64_t imm_raw : imms) {
+        if (no_zero_imm && imm_raw == 0) {
+          continue;
+        }
+
+        Imm imm = CreateImmediate(imm_raw);
+        (GetAssembler()->*f)(reg, imm);
+
+        std::string base = fmt;
+        ReplaceReg(REG_TOKEN, (this->*GetName)(reg), &base);
+        ReplaceImm(imm, /*bias=*/0, /*multiplier=*/1, &base);
+        str += base;
+        str += "\n";
+      }
+    }
+    return str;
+  }
+
+  template <typename Imm>
+  std::string RepeatCRImm(void (Riscv64Assembler::*f)(XRegister, Imm),
+                          bool is_short,
+                          bool no_zero_reg,
+                          bool no_zero_imm,
+                          int imm_bits,
+                          int shift,
+                          const std::string& fmt) {
+    auto regs = is_short ? GetRegistersShort() : GetRegisters();
+    if (no_zero_reg) {
+      CHECK(!is_short);
+      CHECK_EQ(regs[0], Zero);
+      regs = regs.SubArray(1);
+    }
+    return RepeatCTemplateRegImm(
+        f, regs, &AssemblerRISCV64Test::GetRegisterName, imm_bits, shift, no_zero_imm, fmt);
+  }
+
+  template <typename Imm>
+  std::string RepeatCFImm(void (Riscv64Assembler::*f)(FRegister, Imm),
+                          int imm_bits,
+                          int shift,
+                          const std::string& fmt) {
+    auto regs = GetFPRegisters();
+    return RepeatCTemplateRegImm(
+        f, regs, &AssemblerRISCV64Test::GetFPRegName, imm_bits, shift, /*no_zero_imm=*/false, fmt);
+  }
+
+  template <typename Reg1>
+  std::string RepeatTemplatedShortRegistersImm(void (Riscv64Assembler::*f)(Reg1,
+                                                                           XRegister,
+                                                                           int32_t),
+                                               ArrayRef<const Reg1> reg1_registers,
+                                               std::string (Base::*GetName1)(const Reg1&),
+                                               int imm_bits,
+                                               int shift,
+                                               bool no_zero_imm,
+                                               const std::string& fmt) {
+    CHECK(f != nullptr);
+    auto imms = CreateImmediateValuesBits(abs(imm_bits), imm_bits > 0, shift);
+    std::string str;
+    for (Reg1 reg1 : reg1_registers) {
+      for (XRegister reg2 : GetRegistersShort()) {
+        for (int64_t imm_raw : imms) {
+          if (no_zero_imm && imm_raw == 0) {
+            continue;
+          }
+
+          int32_t imm = CreateImmediate(imm_raw);
+          (GetAssembler()->*f)(reg1, reg2, imm);
+
+          std::string base = fmt;
+          ReplaceReg(REG1_TOKEN, (this->*GetName1)(reg1), &base);
+          ReplaceReg(REG2_TOKEN, GetRegisterName(reg2), &base);
+          ReplaceImm(imm, /*bias=*/0, /*multiplier=*/1, &base);
+          str += base;
+          str += "\n";
+        }
+      }
+    }
+    return str;
+  }
+
+  std::string RepeatCRRImm(void (Riscv64Assembler::*f)(XRegister, XRegister, int32_t),
+                           int imm_bits,
+                           int shift,
+                           const std::string& fmt) {
+    return RepeatTemplatedShortRegistersImm(f,
+                                            GetRegistersShort(),
+                                            &AssemblerRISCV64Test::GetRegisterName,
+                                            imm_bits,
+                                            shift,
+                                            /*no_zero_imm=*/false,
+                                            fmt);
+  }
+
+  std::string RepeatCFRImm(void (Riscv64Assembler::*f)(FRegister, XRegister, int32_t),
+                           int imm_bits,
+                           int shift,
+                           const std::string& fmt) {
+    return RepeatTemplatedShortRegistersImm(f,
+                                            GetFPRegistersShort(),
+                                            &AssemblerRISCV64Test::GetFPRegName,
+                                            imm_bits,
+                                            shift,
+                                            /*no_zero_imm=*/false,
+                                            fmt);
+  }
+
+  std::string RepeatCRRShort(void (Riscv64Assembler::*f)(XRegister, XRegister),
+                             const std::string& fmt) {
+    return RepeatTemplatedRegisters(f,
+                                    GetRegistersShort(),
+                                    GetRegistersShort(),
+                                    &AssemblerRISCV64Test::GetRegisterName,
+                                    &AssemblerRISCV64Test::GetRegisterName,
+                                    fmt);
+  }
+
+  std::string RepeatCRRNonZero(void (Riscv64Assembler::*f)(XRegister, XRegister),
+                               const std::string& fmt) {
+    auto regs = GetRegisters();
+    CHECK_EQ(regs[0], Zero);
+    auto regs_no_zero = regs.SubArray(1);
+    return RepeatTemplatedRegisters(f,
+                                    regs_no_zero,
+                                    regs_no_zero,
+                                    &AssemblerRISCV64Test::GetRegisterName,
+                                    &AssemblerRISCV64Test::GetRegisterName,
+                                    fmt);
+  }
+
+  std::string RepeatCRShort(void (Riscv64Assembler::*f)(XRegister), const std::string& fmt) {
+    return RepeatTemplatedRegister(
+        f, GetRegistersShort(), &AssemblerRISCV64Test::GetRegisterName, fmt);
+  }
+
+  template <typename Imm>
+  std::string RepeatImm(void (Riscv64Assembler::*f)(Imm),
+                        bool no_zero_imm,
+                        int imm_bits,
+                        int shift,
+                        const std::string& fmt) {
+    auto imms = CreateImmediateValuesBits(abs(imm_bits), imm_bits > 0, shift);
+    std::string str;
+    for (int64_t imm_raw : imms) {
+      if (no_zero_imm && imm_raw == 0) {
+        continue;
+      }
+
+      Imm imm = CreateImmediate(imm_raw);
+      (GetAssembler()->*f)(imm);
+
+      std::string base = fmt;
+      ReplaceImm(imm, /*bias=*/0, /*multiplier=*/1, &base);
+      str += base;
+      str += "\n";
+    }
+
+    return str;
+  }
+
+  std::string RepeatRNoZero(void (Riscv64Assembler::*f)(XRegister), const std::string& fmt) {
+    auto regs = GetRegisters();
+    CHECK_EQ(regs[0], Zero);
+    return RepeatTemplatedRegister(
+        f, regs.SubArray(1), &AssemblerRISCV64Test::GetRegisterName, fmt);
+  }
+
+  template <typename Reg1, typename Reg2>
+  std::string RepeatTemplatedRegistersRoundingMode(
+      void (Riscv64Assembler::*f)(Reg1, Reg2, FPRoundingMode),
+      ArrayRef<const Reg1> reg1_registers,
+      ArrayRef<const Reg2> reg2_registers,
+      std::string (Base::*GetName1)(const Reg1&),
+      std::string (Base::*GetName2)(const Reg2&),
+      const std::string& fmt) {
+    CHECK(f != nullptr);
+    std::string str;
+    for (Reg1 reg1 : reg1_registers) {
+      for (Reg2 reg2 : reg2_registers) {
+        for (FPRoundingMode rm : kRoundingModes) {
+          (GetAssembler()->*f)(reg1, reg2, rm);
+
+          std::string base = fmt;
+          ReplaceReg(REG1_TOKEN, (this->*GetName1)(reg1), &base);
+          ReplaceReg(REG2_TOKEN, (this->*GetName2)(reg2), &base);
+          ReplaceRoundingMode(rm, &base);
+          str += base;
+          str += "\n";
+        }
+      }
+    }
+    return str;
+  }
+
+  std::string RepeatFFRoundingMode(
+      void (Riscv64Assembler::*f)(FRegister, FRegister, FPRoundingMode),
+      const std::string& fmt) {
+    return RepeatTemplatedRegistersRoundingMode(f,
+                                                GetFPRegisters(),
+                                                GetFPRegisters(),
+                                                &AssemblerRISCV64Test::GetFPRegName,
+                                                &AssemblerRISCV64Test::GetFPRegName,
+                                                fmt);
+  }
+
+  std::string RepeatrFRoundingMode(
+      void (Riscv64Assembler::*f)(XRegister, FRegister, FPRoundingMode),
+      const std::string& fmt) {
+    return RepeatTemplatedRegistersRoundingMode(f,
+                                                GetRegisters(),
+                                                GetFPRegisters(),
+                                                &Base::GetSecondaryRegisterName,
+                                                &AssemblerRISCV64Test::GetFPRegName,
+                                                fmt);
+  }
+
+  std::string RepeatFrRoundingMode(
+      void (Riscv64Assembler::*f)(FRegister, XRegister, FPRoundingMode),
+      const std::string& fmt) {
+    return RepeatTemplatedRegistersRoundingMode(f,
+                                                GetFPRegisters(),
+                                                GetRegisters(),
+                                                &AssemblerRISCV64Test::GetFPRegName,
+                                                &Base::GetSecondaryRegisterName,
+                                                fmt);
+  }
+
+  template <typename InvalidAqRl>
+  std::string RepeatRRAqRl(void (Riscv64Assembler::*f)(XRegister, XRegister, AqRl),
+                           const std::string& fmt,
+                           InvalidAqRl&& invalid_aqrl) {
+    CHECK(f != nullptr);
+    std::string str;
+    for (XRegister reg1 : GetRegisters()) {
+      for (XRegister reg2 : GetRegisters()) {
+        for (AqRl aqrl : kAqRls) {
+          if (invalid_aqrl(aqrl)) {
+            continue;
+          }
+          (GetAssembler()->*f)(reg1, reg2, aqrl);
+
+          std::string base = fmt;
+          ReplaceReg(REG1_TOKEN, GetRegisterName(reg1), &base);
+          ReplaceReg(REG2_TOKEN, GetRegisterName(reg2), &base);
+          ReplaceAqRl(aqrl, &base);
+          str += base;
+          str += "\n";
+        }
+      }
+    }
+    return str;
+  }
+
+  template <typename InvalidAqRl>
+  std::string RepeatRRRAqRl(void (Riscv64Assembler::*f)(XRegister, XRegister, XRegister, AqRl),
+                            const std::string& fmt,
+                            InvalidAqRl&& invalid_aqrl) {
+    CHECK(f != nullptr);
+    std::string str;
+    for (XRegister reg1 : GetRegisters()) {
+      for (XRegister reg2 : GetRegisters()) {
+        for (XRegister reg3 : GetRegisters()) {
+          for (AqRl aqrl : kAqRls) {
+            if (invalid_aqrl(aqrl)) {
+              continue;
+            }
+            (GetAssembler()->*f)(reg1, reg2, reg3, aqrl);
+
+            std::string base = fmt;
+            ReplaceReg(REG1_TOKEN, GetRegisterName(reg1), &base);
+            ReplaceReg(REG2_TOKEN, GetRegisterName(reg2), &base);
+            ReplaceReg(REG3_TOKEN, GetRegisterName(reg3), &base);
+            ReplaceAqRl(aqrl, &base);
+            str += base;
+            str += "\n";
+          }
+        }
+      }
+    }
+    return str;
+  }
+
+  std::string RepeatRRRAqRl(void (Riscv64Assembler::*f)(XRegister, XRegister, XRegister, AqRl),
+                            const std::string& fmt) {
+    return RepeatRRRAqRl(f, fmt, [](AqRl) { return false; });
+  }
+
+  std::string RepeatCsrrX(void (Riscv64Assembler::*f)(XRegister, uint32_t, XRegister),
+                          const std::string& fmt) {
+    CHECK(f != nullptr);
+    std::vector<int64_t> csrs = CreateImmediateValuesBits(12, /*as_uint=*/ true);
+    std::string str;
+    for (XRegister reg1 : GetRegisters()) {
+      for (int64_t csr : csrs) {
+        for (XRegister reg2 : GetRegisters()) {
+          (GetAssembler()->*f)(reg1, dchecked_integral_cast<uint32_t>(csr), reg2);
+
+          std::string base = fmt;
+          ReplaceReg(REG1_TOKEN, GetRegisterName(reg1), &base);
+          ReplaceCsrrImm(CSR_TOKEN, csr, &base);
+          ReplaceReg(REG2_TOKEN, GetRegisterName(reg2), &base);
+          str += base;
+          str += "\n";
+        }
+      }
+    }
+    return str;
+  }
+
+  std::string RepeatCsrrXi(void (Riscv64Assembler::*f)(XRegister, uint32_t, uint32_t),
+                           const std::string& fmt) {
+    CHECK(f != nullptr);
+    std::vector<int64_t> csrs = CreateImmediateValuesBits(12, /*as_uint=*/ true);
+    std::vector<int64_t> uimms = CreateImmediateValuesBits(2, /*as_uint=*/ true);
+    std::string str;
+    for (XRegister reg : GetRegisters()) {
+      for (int64_t csr : csrs) {
+        for (int64_t uimm : uimms) {
+          (GetAssembler()->*f)(
+              reg, dchecked_integral_cast<uint32_t>(csr), dchecked_integral_cast<uint32_t>(uimm));
+
+          std::string base = fmt;
+          ReplaceReg(REG_TOKEN, GetRegisterName(reg), &base);
+          ReplaceCsrrImm(CSR_TOKEN, csr, &base);
+          ReplaceCsrrImm(UIMM_TOKEN, uimm, &base);
+          str += base;
+          str += "\n";
+        }
+      }
+    }
+    return str;
+  }
+
+  std::string RepeatVRAligned(void (Riscv64Assembler::*f)(VRegister, XRegister),
+                              uint32_t alignment,
+                              const std::string& fmt) {
+    WarnOnCombinations(GetVectorRegisters().size() * GetRegisters().size());
+    CHECK(f != nullptr);
+
+    std::string str;
+    for (auto reg1 : GetVectorRegisters()) {
+      for (auto reg2 : GetRegisters()) {
+        if ((static_cast<uint32_t>(reg1) % alignment) != 0) {
+          continue;
+        }
+
+        (GetAssembler()->*f)(reg1, reg2);
+        std::string base = fmt;
+
+        ReplaceReg(REG1_TOKEN, GetVecRegName(reg1), &base);
+        ReplaceReg(REG2_TOKEN, GetRegisterName(reg2), &base);
+
+        str += base;
+        str += "\n";
+      }
+    }
+    return str;
+  }
+
+  std::string RepeatVVAligned(void (Riscv64Assembler::*f)(VRegister, VRegister),
+                              uint32_t alignment,
+                              const std::string& fmt) {
+    WarnOnCombinations(GetVectorRegisters().size() * GetRegisters().size());
+    CHECK(f != nullptr);
+
+    std::string str;
+    for (auto reg1 : GetVectorRegisters()) {
+      if ((static_cast<uint32_t>(reg1) % alignment) != 0) {
+        continue;
+      }
+      for (auto reg2 : GetVectorRegisters()) {
+        if ((static_cast<uint32_t>(reg2) % alignment) != 0) {
+          continue;
+        }
+
+        (GetAssembler()->*f)(reg1, reg2);
+        std::string base = fmt;
+
+        ReplaceReg(REG1_TOKEN, GetVecRegName(reg1), &base);
+        ReplaceReg(REG2_TOKEN, GetVecRegName(reg2), &base);
+
+        str += base;
+        str += "\n";
+      }
+    }
+    return str;
+  }
+
+  template <typename Reg1, typename Reg2, typename Reg3, typename Predicate>
+  std::string RepeatTemplatedRegistersVmFiltered(
+      void (Riscv64Assembler::*f)(Reg1, Reg2, Reg3, Riscv64Assembler::VM),
+      ArrayRef<const Reg1> reg1_registers,
+      ArrayRef<const Reg2> reg2_registers,
+      ArrayRef<const Reg3> reg3_registers,
+      std::string (AssemblerTest::*GetName1)(const Reg1&),
+      std::string (AssemblerTest::*GetName2)(const Reg2&),
+      std::string (AssemblerTest::*GetName3)(const Reg3&),
+      Predicate&& pred,
+      const std::string& fmt) {
+    WarnOnCombinations(reg1_registers.size() * reg2_registers.size() * reg3_registers.size());
+    CHECK(f != nullptr);
+
+    std::string str;
+    for (auto reg1 : reg1_registers) {
+      for (auto reg2 : reg2_registers) {
+        for (auto reg3 : reg3_registers) {
+          for (Riscv64Assembler::VM vm : kVMs) {
+            if (!pred(reg1, reg2, reg3, vm)) {
+              continue;
+            }
+
+            (GetAssembler()->*f)(reg1, reg2, reg3, vm);
+            std::string base = fmt;
+
+            ReplaceReg(REG1_TOKEN, (this->*GetName1)(reg1), &base);
+            ReplaceReg(REG2_TOKEN, (this->*GetName2)(reg2), &base);
+            ReplaceReg(REG3_TOKEN, (this->*GetName3)(reg3), &base);
+            ReplaceVm(vm, &base);
+
+            str += base;
+            str += "\n";
+          }
+        }
+      }
+    }
+    return str;
+  }
+
+  template <typename Predicate>
+  std::string RepeatVRRVmFiltered(
+      void (Riscv64Assembler::*f)(VRegister, XRegister, XRegister, Riscv64Assembler::VM),
+      const std::string& fmt,
+      Predicate&& pred) {
+    return RepeatTemplatedRegistersVmFiltered(f,
+                                              GetVectorRegisters(),
+                                              GetRegisters(),
+                                              GetRegisters(),
+                                              &AssemblerRISCV64Test::GetVecRegName,
+                                              &AssemblerRISCV64Test::GetRegisterName,
+                                              &AssemblerRISCV64Test::GetRegisterName,
+                                              std::forward<Predicate>(pred),
+                                              fmt);
+  }
+
+  std::string RepeatVRRVm(
+      void (Riscv64Assembler::*f)(VRegister, XRegister, XRegister, Riscv64Assembler::VM),
+      const std::string& fmt) {
+    return RepeatVRRVmFiltered(
+        f, fmt, [](VRegister, XRegister, XRegister, Riscv64Assembler::VM) { return true; });
+  }
+
+  template <typename Predicate>
+  std::string RepeatVVRVmFiltered(
+      void (Riscv64Assembler::*f)(VRegister, VRegister, XRegister, Riscv64Assembler::VM),
+      const std::string& fmt,
+      Predicate&& pred) {
+    return RepeatTemplatedRegistersVmFiltered(f,
+                                              GetVectorRegisters(),
+                                              GetVectorRegisters(),
+                                              GetRegisters(),
+                                              &AssemblerRISCV64Test::GetVecRegName,
+                                              &AssemblerRISCV64Test::GetVecRegName,
+                                              &AssemblerRISCV64Test::GetRegisterName,
+                                              std::forward<Predicate>(pred),
+                                              fmt);
+  }
+
+  template <typename Predicate>
+  std::string RepeatVRVVmFiltered(
+      void (Riscv64Assembler::*f)(VRegister, XRegister, VRegister, Riscv64Assembler::VM),
+      const std::string& fmt,
+      Predicate&& pred) {
+    return RepeatTemplatedRegistersVmFiltered(f,
+                                              GetVectorRegisters(),
+                                              GetRegisters(),
+                                              GetVectorRegisters(),
+                                              &AssemblerRISCV64Test::GetVecRegName,
+                                              &AssemblerRISCV64Test::GetRegisterName,
+                                              &AssemblerRISCV64Test::GetVecRegName,
+                                              std::forward<Predicate>(pred),
+                                              fmt);
+  }
+
+  std::string RepeatVRVVm(
+      void (Riscv64Assembler::*f)(VRegister, XRegister, VRegister, Riscv64Assembler::VM),
+      const std::string& fmt) {
+    return RepeatVRVVmFiltered(
+        f, fmt, [](VRegister, XRegister, VRegister, Riscv64Assembler::VM) { return true; });
+  }
+
+  template <typename Predicate>
+  std::string RepeatVVVVmFiltered(
+      void (Riscv64Assembler::*f)(VRegister, VRegister, VRegister, Riscv64Assembler::VM),
+      const std::string& fmt,
+      Predicate&& pred) {
+    return RepeatTemplatedRegistersVmFiltered(f,
+                                              GetVectorRegisters(),
+                                              GetVectorRegisters(),
+                                              GetVectorRegisters(),
+                                              &AssemblerRISCV64Test::GetVecRegName,
+                                              &AssemblerRISCV64Test::GetVecRegName,
+                                              &AssemblerRISCV64Test::GetVecRegName,
+                                              std::forward<Predicate>(pred),
+                                              fmt);
+  }
+
+  std::string RepeatVVVVm(
+      void (Riscv64Assembler::*f)(VRegister, VRegister, VRegister, Riscv64Assembler::VM),
+      const std::string& fmt) {
+    return RepeatVVVVmFiltered(
+        f, fmt, [](VRegister, VRegister, VRegister, Riscv64Assembler::VM) { return true; });
+  }
+
+  template <typename Predicate>
+  std::string RepeatVVFVmFiltered(
+      void (Riscv64Assembler::*f)(VRegister, VRegister, FRegister, Riscv64Assembler::VM),
+      const std::string& fmt,
+      Predicate&& pred) {
+    return RepeatTemplatedRegistersVmFiltered(f,
+                                              GetVectorRegisters(),
+                                              GetVectorRegisters(),
+                                              GetFPRegisters(),
+                                              &AssemblerRISCV64Test::GetVecRegName,
+                                              &AssemblerRISCV64Test::GetVecRegName,
+                                              &AssemblerRISCV64Test::GetFPRegName,
+                                              std::forward<Predicate>(pred),
+                                              fmt);
+  }
+
+  template <typename Predicate>
+  std::string RepeatVFVVmFiltered(
+      void (Riscv64Assembler::*f)(VRegister, FRegister, VRegister, Riscv64Assembler::VM),
+      const std::string& fmt,
+      Predicate&& pred) {
+    return RepeatTemplatedRegistersVmFiltered(f,
+                                              GetVectorRegisters(),
+                                              GetFPRegisters(),
+                                              GetVectorRegisters(),
+                                              &AssemblerRISCV64Test::GetVecRegName,
+                                              &AssemblerRISCV64Test::GetFPRegName,
+                                              &AssemblerRISCV64Test::GetVecRegName,
+                                              std::forward<Predicate>(pred),
+                                              fmt);
+  }
+
+  template <typename Reg1, typename Reg2, typename Reg3, typename Predicate>
+  std::string RepeatTemplatedRegistersFiltered(void (Riscv64Assembler::*f)(Reg1, Reg2, Reg3),
+                                               ArrayRef<const Reg1> reg1_registers,
+                                               ArrayRef<const Reg2> reg2_registers,
+                                               ArrayRef<const Reg3> reg3_registers,
+                                               std::string (AssemblerTest::*GetName1)(const Reg1&),
+                                               std::string (AssemblerTest::*GetName2)(const Reg2&),
+                                               std::string (AssemblerTest::*GetName3)(const Reg3&),
+                                               Predicate&& pred,
+                                               const std::string& fmt) {
+    WarnOnCombinations(reg1_registers.size() * reg2_registers.size() * reg3_registers.size());
+    CHECK(f != nullptr);
+
+    std::string str;
+    for (auto reg1 : reg1_registers) {
+      for (auto reg2 : reg2_registers) {
+        for (auto reg3 : reg3_registers) {
+          if (!pred(reg1, reg2, reg3)) {
+            continue;
+          }
+
+          (GetAssembler()->*f)(reg1, reg2, reg3);
+          std::string base = fmt;
+
+          ReplaceReg(REG1_TOKEN, (this->*GetName1)(reg1), &base);
+          ReplaceReg(REG2_TOKEN, (this->*GetName2)(reg2), &base);
+          ReplaceReg(REG3_TOKEN, (this->*GetName3)(reg3), &base);
+
+          str += base;
+          str += "\n";
+        }
+      }
+    }
+    return str;
+  }
+
+  template <typename Predicate>
+  std::string RepeatVVRFiltered(void (Riscv64Assembler::*f)(VRegister, VRegister, XRegister),
+                                const std::string& fmt,
+                                Predicate&& pred) {
+    return RepeatTemplatedRegistersFiltered(f,
+                                            GetVectorRegisters(),
+                                            GetVectorRegisters(),
+                                            GetRegisters(),
+                                            &AssemblerRISCV64Test::GetVecRegName,
+                                            &AssemblerRISCV64Test::GetVecRegName,
+                                            &AssemblerRISCV64Test::GetRegisterName,
+                                            std::forward<Predicate>(pred),
+                                            fmt);
+  }
+
+  template <typename Predicate>
+  std::string RepeatVVVFiltered(void (Riscv64Assembler::*f)(VRegister, VRegister, VRegister),
+                                const std::string& fmt,
+                                Predicate&& pred) {
+    return RepeatTemplatedRegistersFiltered(f,
+                                            GetVectorRegisters(),
+                                            GetVectorRegisters(),
+                                            GetVectorRegisters(),
+                                            &AssemblerRISCV64Test::GetVecRegName,
+                                            &AssemblerRISCV64Test::GetVecRegName,
+                                            &AssemblerRISCV64Test::GetVecRegName,
+                                            std::forward<Predicate>(pred),
+                                            fmt);
+  }
+
+  template <typename Predicate>
+  std::string RepeatVVFFiltered(void (Riscv64Assembler::*f)(VRegister, VRegister, FRegister),
+                                const std::string& fmt,
+                                Predicate&& pred) {
+    return RepeatTemplatedRegistersFiltered(f,
+                                            GetVectorRegisters(),
+                                            GetVectorRegisters(),
+                                            GetFPRegisters(),
+                                            &AssemblerRISCV64Test::GetVecRegName,
+                                            &AssemblerRISCV64Test::GetVecRegName,
+                                            &AssemblerRISCV64Test::GetFPRegName,
+                                            std::forward<Predicate>(pred),
+                                            fmt);
+  }
+
+  template <typename Predicate, typename ImmType>
+  std::string RepeatVVIFiltered(void (Riscv64Assembler::*f)(VRegister, VRegister, ImmType),
+                                int imm_bits,
+                                const std::string& fmt,
+                                Predicate&& pred) {
+    CHECK(f != nullptr);
+    std::string str;
+    std::vector<int64_t> imms = CreateImmediateValuesBits(abs(imm_bits), (imm_bits > 0));
+
+    WarnOnCombinations(GetVectorRegisters().size() * GetVectorRegisters().size() * imms.size());
+
+    for (VRegister reg1 : GetVectorRegisters()) {
+      for (VRegister reg2 : GetVectorRegisters()) {
+        for (int64_t imm : imms) {
+          ImmType new_imm = CreateImmediate(imm);
+
+          if (!pred(reg1, reg2, new_imm)) {
+            continue;
+          }
+
+          (GetAssembler()->*f)(reg1, reg2, new_imm);
+
+          std::string base = fmt;
+          ReplaceReg(REG1_TOKEN, GetVecRegName(reg1), &base);
+          ReplaceReg(REG2_TOKEN, GetVecRegName(reg2), &base);
+          ReplaceImm(imm, /*bias=*/ 0, /*multiplier=*/ 1, &base);
+          str += base;
+          str += "\n";
+        }
+      }
+    }
+    return str;
+  }
+
+  template <typename Predicate, typename ImmType>
+  std::string RepeatVVIbVmFiltered(
+      void (Riscv64Assembler::*f)(VRegister, VRegister, ImmType, Riscv64Assembler::VM),
+      int imm_bits,
+      const std::string& fmt,
+      Predicate&& pred,
+      ImmType bias = 0) {
+    CHECK(f != nullptr);
+    std::string str;
+    std::vector<int64_t> imms = CreateImmediateValuesBits(abs(imm_bits), (imm_bits > 0));
+
+    WarnOnCombinations(2 * GetVectorRegisters().size() * GetVectorRegisters().size() * imms.size());
+
+    for (VRegister reg1 : GetVectorRegisters()) {
+      for (VRegister reg2 : GetVectorRegisters()) {
+        for (int64_t imm : imms) {
+          for (Riscv64Assembler::VM vm : kVMs) {
+            if (!pred(reg1, reg2, imm, vm)) {
+              continue;
+            }
+
+            ImmType new_imm = CreateImmediate(imm) + bias;
+            (GetAssembler()->*f)(reg1, reg2, new_imm, vm);
+
+            std::string base = fmt;
+            ReplaceReg(REG1_TOKEN, GetVecRegName(reg1), &base);
+            ReplaceImm(imm, bias, /*multiplier=*/ 1, &base);
+            ReplaceReg(REG2_TOKEN, GetVecRegName(reg2), &base);
+            ReplaceVm(vm, &base);
+            str += base;
+            str += "\n";
+          }
+        }
+      }
+    }
+    return str;
+  }
+
+  template <typename Reg1, typename Reg2, typename Predicate>
+  std::string RepeatTemplatedRegistersVmFiltered(
+      void (Riscv64Assembler::*f)(Reg1, Reg2, Riscv64Assembler::VM),
+      ArrayRef<const Reg1> reg1_registers,
+      ArrayRef<const Reg2> reg2_registers,
+      std::string (AssemblerTest::*GetName1)(const Reg1&),
+      std::string (AssemblerTest::*GetName2)(const Reg2&),
+      Predicate&& pred,
+      const std::string& fmt) {
+    CHECK(f != nullptr);
+
+    WarnOnCombinations(2 * reg2_registers.size() * reg1_registers.size());
+
+    std::string str;
+    for (auto reg1 : reg1_registers) {
+      for (auto reg2 : reg2_registers) {
+        for (Riscv64Assembler::VM vm : kVMs) {
+          if (!pred(reg1, reg2, vm)) {
+            continue;
+          }
+
+          (GetAssembler()->*f)(reg1, reg2, vm);
+          std::string base = fmt;
+
+          ReplaceReg(REG1_TOKEN, (this->*GetName1)(reg1), &base);
+          ReplaceReg(REG2_TOKEN, (this->*GetName2)(reg2), &base);
+          ReplaceVm(vm, &base);
+
+          str += base;
+          str += "\n";
+        }
+      }
+    }
+    return str;
+  }
+
+  template <typename Predicate>
+  std::string RepeatRVVmFiltered(void (Riscv64Assembler::*f)(XRegister,
+                                                             VRegister,
+                                                             Riscv64Assembler::VM),
+                                 const std::string& fmt,
+                                 Predicate&& pred) {
+    return RepeatTemplatedRegistersVmFiltered(f,
+                                              GetRegisters(),
+                                              GetVectorRegisters(),
+                                              &AssemblerRISCV64Test::GetRegisterName,
+                                              &AssemblerRISCV64Test::GetVecRegName,
+                                              std::forward<Predicate>(pred),
+                                              fmt);
+  }
+
+  std::string RepeatRVVm(void (Riscv64Assembler::*f)(XRegister, VRegister, Riscv64Assembler::VM vm),
+                         const std::string& fmt) {
+    return RepeatRVVmFiltered(
+        f, fmt, [](XRegister, VRegister, Riscv64Assembler::VM) { return true; });
+  }
+
+  template <typename Predicate>
+  std::string RepeatVRVmFiltered(void (Riscv64Assembler::*f)(VRegister,
+                                                             XRegister,
+                                                             Riscv64Assembler::VM),
+                                 const std::string& fmt,
+                                 Predicate&& pred) {
+    return RepeatTemplatedRegistersVmFiltered(f,
+                                              GetVectorRegisters(),
+                                              GetRegisters(),
+                                              &AssemblerRISCV64Test::GetVecRegName,
+                                              &AssemblerRISCV64Test::GetRegisterName,
+                                              std::forward<Predicate>(pred),
+                                              fmt);
+  }
+
+  std::string RepeatVRVm(void (Riscv64Assembler::*f)(VRegister, XRegister, Riscv64Assembler::VM),
+                         const std::string& fmt) {
+    return RepeatVRVmFiltered(
+        f, fmt, [](VRegister, XRegister, Riscv64Assembler::VM) { return true; });
+  }
+
+  template <typename Predicate>
+  std::string RepeatVVVmFiltered(void (Riscv64Assembler::*f)(VRegister,
+                                                             VRegister,
+                                                             Riscv64Assembler::VM),
+                                 const std::string& fmt,
+                                 Predicate&& pred) {
+    return RepeatTemplatedRegistersVmFiltered(f,
+                                              GetVectorRegisters(),
+                                              GetVectorRegisters(),
+                                              &AssemblerRISCV64Test::GetVecRegName,
+                                              &AssemblerRISCV64Test::GetVecRegName,
+                                              std::forward<Predicate>(pred),
+                                              fmt);
+  }
+
+  template <typename Predicate>
+  std::string RepeatVVmFiltered(void (Riscv64Assembler::*f)(VRegister, Riscv64Assembler::VM),
+                                const std::string& fmt,
+                                Predicate&& pred) {
+    WarnOnCombinations(2 * GetVectorRegisters().size());
+    CHECK(f != nullptr);
+    std::string str;
+    for (VRegister reg1 : GetVectorRegisters()) {
+      for (Riscv64Assembler::VM vm : kVMs) {
+        if (!pred(reg1, vm)) {
+          continue;
+        }
+
+        (GetAssembler()->*f)(reg1, vm);
+
+        std::string base = fmt;
+        ReplaceReg(REG_TOKEN, GetVecRegName(reg1), &base);
+        ReplaceVm(vm, &base);
+        str += base;
+        str += "\n";
+      }
+    }
+    return str;
+  }
+
+  static constexpr bool IsVdAllowed(VRegister vd, Riscv64Assembler::VM vm) {
+    return vm != Riscv64Assembler::VM::kV0_t || vd != V0;
+  }
+
+  template <typename Reg2>
+  auto VXVVmSkipV0VmAndNoR1R3Overlap() {
+    return [](VRegister vd, Reg2, VRegister vs1, Riscv64Assembler::VM vm) {
+      return IsVdAllowed(vd, vm) && vd != vs1;
+    };
+  }
+
+  template <typename Reg3>
+  auto VXVVmSkipV0VmAndNoR1R2Overlap() {
+    return [](VRegister vd, VRegister vs2, Reg3, Riscv64Assembler::VM vm) {
+      return IsVdAllowed(vd, vm) && vd != vs2;
+    };
+  }
+
+  auto VXVVmSkipV0VmAndNoR1R2R3Overlap() {
+    return [](VRegister vd, VRegister vs2, VRegister vs1, Riscv64Assembler::VM vm) {
+      return IsVdAllowed(vd, vm) && vd != vs1 && vd != vs2;
+    };
+  }
+
+  auto VVVmSkipV0VmAndNoR1R2Overlap() {
+    return [](VRegister vd, VRegister vs2, Riscv64Assembler::VM vm) {
+      return IsVdAllowed(vd, vm) && vd != vs2;
+    };
+  }
+
+  template <typename Reg2, typename Reg3>
+  auto SkipV0Vm() {
+    return [](VRegister vd, Reg2, Reg3, Riscv64Assembler::VM vm) { return IsVdAllowed(vd, vm); };
+  }
+
+  template <typename Reg2>
+  auto SkipV0Vm() {
+    return [](VRegister vd, Reg2, Riscv64Assembler::VM vm) { return IsVdAllowed(vd, vm); };
+  }
+
+  auto SkipV0Vm() {
+    return [](VRegister vd, Riscv64Assembler::VM vm) { return IsVdAllowed(vd, vm); };
+  }
+
+  template <typename Reg2, typename Reg3>
+  auto SkipV0() {
+    return [](VRegister vd, Reg2, Reg3) { return vd != V0; };
+  }
+
+  auto VVVNoR1R2R3Overlap() {
+    return [](VRegister vd, VRegister vs2, VRegister vs1) { return vd != vs1 && vd != vs2; };
+  }
+
+  template <typename Arg, typename Args, typename Replacer>
+  std::string TestVSetI(void (Riscv64Assembler::*f)(XRegister, Arg, uint32_t),
+                        Args&& arguments,
+                        Replacer&& replacer,
+                        const std::string& fmt) {
+    CHECK(f != nullptr);
+
+    std::string str;
+    for (auto reg1 : GetRegisters()) {
+      for (auto arg : arguments) {
+        for (Riscv64Assembler::VectorMaskAgnostic vma : kVMAs) {
+          for (Riscv64Assembler::VectorTailAgnostic vta : kVTAs) {
+            for (Riscv64Assembler::SelectedElementWidth sew : kSEWs) {
+              for (Riscv64Assembler::LengthMultiplier lmul : kLMULs) {
+                uint32_t vtype = Riscv64Assembler::VTypeiValue(vma, vta, sew, lmul);
+                (GetAssembler()->*f)(reg1, arg, vtype);
+                std::string base = fmt;
+
+                ReplaceReg(REG1_TOKEN, GetRegisterName(reg1), &base);
+                replacer(arg, &base);
+                ReplaceVMA(vma, &base);
+                ReplaceVTA(vta, &base);
+                ReplaceSEW(sew, &base);
+                ReplaceLMUL(lmul, &base);
+
+                str += base;
+                str += "\n";
+              }
+            }
+          }
+        }
+      }
+    }
+    return str;
+  }
+
+  template <typename EmitCssrX>
+  void TestCsrrXMacro(const std::string& test_name,
+                      const std::string& fmt,
+                      EmitCssrX&& emit_csrrx) {
+    std::vector<int64_t> csrs = CreateImmediateValuesBits(12, /*as_uint=*/ true);
+    std::string expected;
+    for (XRegister reg : GetRegisters()) {
+      for (int64_t csr : csrs) {
+        emit_csrrx(dchecked_integral_cast<uint32_t>(csr), reg);
+
+        std::string base = fmt;
+        ReplaceReg(REG_TOKEN, GetRegisterName(reg), &base);
+        ReplaceCsrrImm(CSR_TOKEN, csr, &base);
+        expected += base;
+        expected += "\n";
+      }
+    }
+    DriverStr(expected, test_name);
+  }
+
+  template <typename EmitCssrXi>
+  void TestCsrrXiMacro(const std::string& test_name,
+                       const std::string& fmt,
+                       EmitCssrXi&& emit_csrrxi) {
+    std::vector<int64_t> csrs = CreateImmediateValuesBits(12, /*as_uint=*/ true);
+    std::vector<int64_t> uimms = CreateImmediateValuesBits(2, /*as_uint=*/ true);
+    std::string expected;
+    for (int64_t csr : csrs) {
+      for (int64_t uimm : uimms) {
+        emit_csrrxi(dchecked_integral_cast<uint32_t>(csr), dchecked_integral_cast<uint32_t>(uimm));
+
+        std::string base = fmt;
+        ReplaceCsrrImm(CSR_TOKEN, csr, &base);
+        ReplaceCsrrImm(UIMM_TOKEN, uimm, &base);
+        expected += base;
+        expected += "\n";
+      }
+    }
+    DriverStr(expected, test_name);
+  }
+
+ private:
+  static constexpr const char* RM_TOKEN = "{rm}";
+  static constexpr const char* AQRL_TOKEN = "{aqrl}";
+  static constexpr const char* CSR_TOKEN = "{csr}";
+  static constexpr const char* UIMM_TOKEN = "{uimm}";
+  static constexpr const char* VM_TOKEN = "{vm}";
+  static constexpr const char* VMA_TOKEN = "{vma}";
+  static constexpr const char* VTA_TOKEN = "{vta}";
+  static constexpr const char* SEW_TOKEN = "{sew}";
+  static constexpr const char* LMUL_TOKEN = "{lmul}";
+
+  static constexpr AqRl kAqRls[] = { AqRl::kNone, AqRl::kRelease, AqRl::kAcquire, AqRl::kAqRl };
+
+  static constexpr Riscv64Assembler::VM kVMs[] = {Riscv64Assembler::VM::kUnmasked,
+                                                  Riscv64Assembler::VM::kV0_t};
+
+  static constexpr Riscv64Assembler::VectorMaskAgnostic kVMAs[] = {
+      Riscv64Assembler::VectorMaskAgnostic::kAgnostic,
+      Riscv64Assembler::VectorMaskAgnostic::kUndisturbed};
+
+  static constexpr Riscv64Assembler::VectorTailAgnostic kVTAs[] = {
+      Riscv64Assembler::VectorTailAgnostic::kAgnostic,
+      Riscv64Assembler::VectorTailAgnostic::kUndisturbed};
+
+  static constexpr Riscv64Assembler::SelectedElementWidth kSEWs[] = {
+      Riscv64Assembler::SelectedElementWidth::kE8,
+      Riscv64Assembler::SelectedElementWidth::kE16,
+      Riscv64Assembler::SelectedElementWidth::kE32,
+      Riscv64Assembler::SelectedElementWidth::kE64};
+
+  static constexpr Riscv64Assembler::LengthMultiplier kLMULs[] = {
+      Riscv64Assembler::LengthMultiplier::kM1Over8,
+      Riscv64Assembler::LengthMultiplier::kM1Over4,
+      Riscv64Assembler::LengthMultiplier::kM1Over2,
+      Riscv64Assembler::LengthMultiplier::kM1,
+      Riscv64Assembler::LengthMultiplier::kM2,
+      Riscv64Assembler::LengthMultiplier::kM4,
+      Riscv64Assembler::LengthMultiplier::kM8};
+
+  static constexpr FPRoundingMode kRoundingModes[] = {
+      FPRoundingMode::kRNE,
+      FPRoundingMode::kRTZ,
+      FPRoundingMode::kRDN,
+      FPRoundingMode::kRUP,
+      FPRoundingMode::kRMM,
+      FPRoundingMode::kDYN
+  };
+
+  void ReplaceRoundingMode(FPRoundingMode rm, /*inout*/ std::string* str) {
+    const char* replacement;
+    switch (rm) {
+      case FPRoundingMode::kRNE:
+        replacement = "rne";
+        break;
+      case FPRoundingMode::kRTZ:
+        replacement = "rtz";
+        break;
+      case FPRoundingMode::kRDN:
+        replacement = "rdn";
+        break;
+      case FPRoundingMode::kRUP:
+        replacement = "rup";
+        break;
+      case FPRoundingMode::kRMM:
+        replacement = "rmm";
+        break;
+      case FPRoundingMode::kDYN:
+        replacement = "dyn";
+        break;
+      default:
+        LOG(FATAL) << "Unexpected value for rm: " << enum_cast<uint32_t>(rm);
+        UNREACHABLE();
+    }
+    size_t rm_index = str->find(RM_TOKEN);
+    EXPECT_NE(rm_index, std::string::npos);
+    if (rm_index != std::string::npos) {
+      str->replace(rm_index, ConstexprStrLen(RM_TOKEN), replacement);
+    }
+  }
+
+  void ReplaceAqRl(AqRl aqrl, /*inout*/ std::string* str) {
+    const char* replacement;
+    switch (aqrl) {
+      case AqRl::kNone:
+        replacement = "";
+        break;
+      case AqRl::kRelease:
+        replacement = ".rl";
+        break;
+      case AqRl::kAcquire:
+        replacement = ".aq";
+        break;
+      case AqRl::kAqRl:
+        replacement = ".aqrl";
+        break;
+      default:
+        LOG(FATAL) << "Unexpected value for `aqrl`: " << enum_cast<uint32_t>(aqrl);
+        UNREACHABLE();
+    }
+    size_t aqrl_index = str->find(AQRL_TOKEN);
+    EXPECT_NE(aqrl_index, std::string::npos);
+    if (aqrl_index != std::string::npos) {
+      str->replace(aqrl_index, ConstexprStrLen(AQRL_TOKEN), replacement);
+    }
+  }
+
+  void ReplaceVm(Riscv64Assembler::VM vm, /*inout*/ std::string* str) {
+    const char* replacement;
+    switch (vm) {
+      case Riscv64Assembler::VM::kUnmasked:
+        replacement = "";
+        break;
+      case Riscv64Assembler::VM::kV0_t:
+        replacement = ", v0.t";
+        break;
+      default:
+        LOG(FATAL) << "Unexpected value for `VM`: " << enum_cast<uint32_t>(vm);
+        UNREACHABLE();
+    }
+    size_t vm_index = str->find(VM_TOKEN);
+    EXPECT_NE(vm_index, std::string::npos);
+    if (vm_index != std::string::npos) {
+      str->replace(vm_index, ConstexprStrLen(VM_TOKEN), replacement);
+    }
+  }
+
+  void ReplaceVMA(Riscv64Assembler::VectorMaskAgnostic vma, /*inout*/ std::string* str) {
+    const char* replacement;
+    switch (vma) {
+      case Riscv64Assembler::VectorMaskAgnostic::kAgnostic:
+        replacement = "ma";
+        break;
+      case Riscv64Assembler::VectorMaskAgnostic::kUndisturbed:
+        replacement = "mu";
+        break;
+      default:
+        LOG(FATAL) << "Unexpected value for `VectorMaskAgnostic`: " << enum_cast<uint32_t>(vma);
+        UNREACHABLE();
+    }
+    size_t vma_index = str->find(VMA_TOKEN);
+    EXPECT_NE(vma_index, std::string::npos);
+    if (vma_index != std::string::npos) {
+      str->replace(vma_index, ConstexprStrLen(VMA_TOKEN), replacement);
+    }
+  }
+
+  void ReplaceVTA(Riscv64Assembler::VectorTailAgnostic vta, /*inout*/ std::string* str) {
+    const char* replacement;
+    switch (vta) {
+      case Riscv64Assembler::VectorTailAgnostic::kAgnostic:
+        replacement = "ta";
+        break;
+      case Riscv64Assembler::VectorTailAgnostic::kUndisturbed:
+        replacement = "tu";
+        break;
+      default:
+        LOG(FATAL) << "Unexpected value for `VectorTailAgnostic`: " << enum_cast<uint32_t>(vta);
+        UNREACHABLE();
+    }
+    size_t vta_index = str->find(VTA_TOKEN);
+    EXPECT_NE(vta_index, std::string::npos);
+    if (vta_index != std::string::npos) {
+      str->replace(vta_index, ConstexprStrLen(VTA_TOKEN), replacement);
+    }
+  }
+
+  void ReplaceSEW(Riscv64Assembler::SelectedElementWidth sew, /*inout*/ std::string* str) {
+    const char* replacement;
+    switch (sew) {
+      case Riscv64Assembler::SelectedElementWidth::kE8:
+        replacement = "e8";
+        break;
+      case Riscv64Assembler::SelectedElementWidth::kE16:
+        replacement = "e16";
+        break;
+      case Riscv64Assembler::SelectedElementWidth::kE32:
+        replacement = "e32";
+        break;
+      case Riscv64Assembler::SelectedElementWidth::kE64:
+        replacement = "e64";
+        break;
+      default:
+        LOG(FATAL) << "Unexpected value for `SelectedElementWidth`: " << enum_cast<uint32_t>(sew);
+        UNREACHABLE();
+    }
+    size_t sew_index = str->find(SEW_TOKEN);
+    EXPECT_NE(sew_index, std::string::npos);
+    if (sew_index != std::string::npos) {
+      str->replace(sew_index, ConstexprStrLen(SEW_TOKEN), replacement);
+    }
+  }
+
+  void ReplaceLMUL(Riscv64Assembler::LengthMultiplier lmul, /*inout*/ std::string* str) {
+    const char* replacement;
+    switch (lmul) {
+      case Riscv64Assembler::LengthMultiplier::kM1Over8:
+        replacement = "mf8";
+        break;
+      case Riscv64Assembler::LengthMultiplier::kM1Over4:
+        replacement = "mf4";
+        break;
+      case Riscv64Assembler::LengthMultiplier::kM1Over2:
+        replacement = "mf2";
+        break;
+      case Riscv64Assembler::LengthMultiplier::kM1:
+        replacement = "m1";
+        break;
+      case Riscv64Assembler::LengthMultiplier::kM2:
+        replacement = "m2";
+        break;
+      case Riscv64Assembler::LengthMultiplier::kM4:
+        replacement = "m4";
+        break;
+      case Riscv64Assembler::LengthMultiplier::kM8:
+        replacement = "m8";
+        break;
+      default:
+        LOG(FATAL) << "Unexpected value for `LengthMultiplier`: " << enum_cast<uint32_t>(lmul);
+        UNREACHABLE();
+    }
+    size_t lmul_index = str->find(LMUL_TOKEN);
+    EXPECT_NE(lmul_index, std::string::npos);
+    if (lmul_index != std::string::npos) {
+      str->replace(lmul_index, ConstexprStrLen(LMUL_TOKEN), replacement);
+    }
+  }
+
+  static void ReplaceCsrrImm(const std::string& imm_token,
+                             int64_t imm,
+                             /*inout*/ std::string* str) {
+    size_t imm_index = str->find(imm_token);
+    EXPECT_NE(imm_index, std::string::npos);
+    if (imm_index != std::string::npos) {
+      str->replace(imm_index, imm_token.length(), std::to_string(imm));
+    }
+  }
+
+  std::map<XRegister, std::string, RISCV64CpuRegisterCompare> secondary_register_names_;
+
+  std::optional<std::string> march_override_;
+};
+
+TEST_F(AssemblerRISCV64Test, Toolchain) { EXPECT_TRUE(CheckTools()); }
+
+TEST_F(AssemblerRISCV64Test, Lui) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRIb(&Riscv64Assembler::Lui, 20, "lui {reg}, {imm}"), "Lui");
+}
+
+TEST_F(AssemblerRISCV64Test, Auipc) {
+  DriverStr(RepeatRIb(&Riscv64Assembler::Auipc, 20, "auipc {reg}, {imm}"), "Auipc");
+}
+
+TEST_F(AssemblerRISCV64Test, Jal) {
+  ScopedCSuppression scs(this);
+  // TODO(riscv64): Change "-19, 2" to "-20, 1" for "C" Standard Extension.
+  DriverStr(RepeatRIbS(&Riscv64Assembler::Jal, -19, 2, "jal {reg}, {imm}\n"), "Jal");
+}
+
+TEST_F(AssemblerRISCV64Test, Jalr) {
+  ScopedCSuppression scs(this);
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Jalr, -12, "jalr {reg1}, {reg2}, {imm}\n"), "Jalr");
+}
+
+TEST_F(AssemblerRISCV64Test, Beq) {
+  ScopedCSuppression scs(this);
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRRIbS(&Riscv64Assembler::Beq, -11, 2, "beq {reg1}, {reg2}, {imm}\n"), "Beq");
+}
+
+TEST_F(AssemblerRISCV64Test, Bne) {
+  ScopedCSuppression scs(this);
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRRIbS(&Riscv64Assembler::Bne, -11, 2, "bne {reg1}, {reg2}, {imm}\n"), "Bne");
+}
+
+TEST_F(AssemblerRISCV64Test, Blt) {
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRRIbS(&Riscv64Assembler::Blt, -11, 2, "blt {reg1}, {reg2}, {imm}\n"), "Blt");
+}
+
+TEST_F(AssemblerRISCV64Test, Bge) {
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRRIbS(&Riscv64Assembler::Bge, -11, 2, "bge {reg1}, {reg2}, {imm}\n"), "Bge");
+}
+
+TEST_F(AssemblerRISCV64Test, Bltu) {
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRRIbS(&Riscv64Assembler::Bltu, -11, 2, "bltu {reg1}, {reg2}, {imm}\n"), "Bltu");
+}
+
+TEST_F(AssemblerRISCV64Test, Bgeu) {
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRRIbS(&Riscv64Assembler::Bgeu, -11, 2, "bgeu {reg1}, {reg2}, {imm}\n"), "Bgeu");
+}
+
+TEST_F(AssemblerRISCV64Test, Lb) {
+  // Note: There is no 16-bit instruction for `Lb()`.
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Lb, -12, "lb {reg1}, {imm}({reg2})"), "Lb");
+}
+
+TEST_F(AssemblerRISCV64Test, Lh) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Lh, -12, "lh {reg1}, {imm}({reg2})"), "Lh");
+}
+
+TEST_F(AssemblerRISCV64Test, Lw) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Lw, -12, "lw {reg1}, {imm}({reg2})"), "Lw");
+}
+
+TEST_F(AssemblerRISCV64Test, Ld) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Ld, -12, "ld {reg1}, {imm}({reg2})"), "Ld");
+}
+
+TEST_F(AssemblerRISCV64Test, Lbu) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Lbu, -12, "lbu {reg1}, {imm}({reg2})"), "Lbu");
+}
+
+TEST_F(AssemblerRISCV64Test, Lhu) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Lhu, -12, "lhu {reg1}, {imm}({reg2})"), "Lhu");
+}
+
+TEST_F(AssemblerRISCV64Test, Lwu) {
+  // Note: There is no 16-bit instruction for `Lwu()`.
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Lwu, -12, "lwu {reg1}, {imm}({reg2})"), "Lwu");
+}
+
+TEST_F(AssemblerRISCV64Test, Sb) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Sb, -12, "sb {reg1}, {imm}({reg2})"), "Sb");
+}
+
+TEST_F(AssemblerRISCV64Test, Sh) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Sh, -12, "sh {reg1}, {imm}({reg2})"), "Sh");
+}
+
+TEST_F(AssemblerRISCV64Test, Sw) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Sw, -12, "sw {reg1}, {imm}({reg2})"), "Sw");
+}
+
+TEST_F(AssemblerRISCV64Test, Sd) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Sd, -12, "sd {reg1}, {imm}({reg2})"), "Sd");
+}
+
+TEST_F(AssemblerRISCV64Test, Addi) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Addi, -12, "addi {reg1}, {reg2}, {imm}"), "Addi");
+}
+
+TEST_F(AssemblerRISCV64Test, Slti) {
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Slti, -12, "slti {reg1}, {reg2}, {imm}"), "Slti");
+}
+
+TEST_F(AssemblerRISCV64Test, Sltiu) {
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Sltiu, -12, "sltiu {reg1}, {reg2}, {imm}"), "Sltiu");
+}
+
+TEST_F(AssemblerRISCV64Test, Xori) {
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Xori, 11, "xori {reg1}, {reg2}, {imm}"), "Xori");
+}
+
+TEST_F(AssemblerRISCV64Test, Ori) {
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Ori, -12, "ori {reg1}, {reg2}, {imm}"), "Ori");
+}
+
+TEST_F(AssemblerRISCV64Test, Andi) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Andi, -12, "andi {reg1}, {reg2}, {imm}"), "Andi");
+}
+
+TEST_F(AssemblerRISCV64Test, Slli) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Slli, 6, "slli {reg1}, {reg2}, {imm}"), "Slli");
+}
+
+TEST_F(AssemblerRISCV64Test, Srli) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Srli, 6, "srli {reg1}, {reg2}, {imm}"), "Srli");
+}
+
+TEST_F(AssemblerRISCV64Test, Srai) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Srai, 6, "srai {reg1}, {reg2}, {imm}"), "Srai");
+}
+
+TEST_F(AssemblerRISCV64Test, Add) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRR(&Riscv64Assembler::Add, "add {reg1}, {reg2}, {reg3}"), "Add");
+}
+
+TEST_F(AssemblerRISCV64Test, Sub) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRR(&Riscv64Assembler::Sub, "sub {reg1}, {reg2}, {reg3}"), "Sub");
+}
+
+TEST_F(AssemblerRISCV64Test, Slt) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Slt, "slt {reg1}, {reg2}, {reg3}"), "Slt");
+}
+
+TEST_F(AssemblerRISCV64Test, Sltu) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Sltu, "sltu {reg1}, {reg2}, {reg3}"), "Sltu");
+}
+
+TEST_F(AssemblerRISCV64Test, Xor) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRR(&Riscv64Assembler::Xor, "xor {reg1}, {reg2}, {reg3}"), "Xor");
+}
+
+TEST_F(AssemblerRISCV64Test, Or) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRR(&Riscv64Assembler::Or, "or {reg1}, {reg2}, {reg3}"), "Or");
+}
+
+TEST_F(AssemblerRISCV64Test, And) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRR(&Riscv64Assembler::And, "and {reg1}, {reg2}, {reg3}"), "And");
+}
+
+TEST_F(AssemblerRISCV64Test, Sll) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Sll, "sll {reg1}, {reg2}, {reg3}"), "Sll");
+}
+
+TEST_F(AssemblerRISCV64Test, Srl) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Srl, "srl {reg1}, {reg2}, {reg3}"), "Srl");
+}
+
+TEST_F(AssemblerRISCV64Test, Sra) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Sra, "sra {reg1}, {reg2}, {reg3}"), "Sra");
+}
+
+TEST_F(AssemblerRISCV64Test, Addiw) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Addiw, -12, "addiw {reg1}, {reg2}, {imm}"), "Addiw");
+}
+
+TEST_F(AssemblerRISCV64Test, Slliw) {
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Slliw, /*imm_bits=*/ 5, "slliw {reg1}, {reg2}, {imm}"),
+            "Slliw");
+}
+
+TEST_F(AssemblerRISCV64Test, Srliw) {
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Srliw, /*imm_bits=*/ 5, "srliw {reg1}, {reg2}, {imm}"),
+            "Srliw");
+}
+
+TEST_F(AssemblerRISCV64Test, Sraiw) {
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Sraiw, /*imm_bits=*/ 5, "sraiw {reg1}, {reg2}, {imm}"),
+            "Sraiw");
+}
+
+TEST_F(AssemblerRISCV64Test, Addw) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRR(&Riscv64Assembler::Addw, "addw {reg1}, {reg2}, {reg3}"), "Addw");
+}
+
+TEST_F(AssemblerRISCV64Test, Subw) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRR(&Riscv64Assembler::Subw, "subw {reg1}, {reg2}, {reg3}"), "Subw");
+}
+
+TEST_F(AssemblerRISCV64Test, Sllw) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Sllw, "sllw {reg1}, {reg2}, {reg3}"), "Sllw");
+}
+
+TEST_F(AssemblerRISCV64Test, Srlw) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Srlw, "srlw {reg1}, {reg2}, {reg3}"), "Srlw");
+}
+
+TEST_F(AssemblerRISCV64Test, Sraw) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Sraw, "sraw {reg1}, {reg2}, {reg3}"), "Sraw");
+}
+
+TEST_F(AssemblerRISCV64Test, Ecall) {
+  __ Ecall();
+  DriverStr("ecall\n", "Ecall");
+}
+
+TEST_F(AssemblerRISCV64Test, Ebreak) {
+  ScopedCSuppression scs(this);
+  __ Ebreak();
+  DriverStr("ebreak\n", "Ebreak");
+}
+
+TEST_F(AssemblerRISCV64Test, Fence) {
+  auto get_fence_type_string = [](uint32_t fence_type) {
+    CHECK_LE(fence_type, 0xfu);
+    std::string result;
+    if ((fence_type & kFenceInput) != 0u) {
+      result += "i";
+    }
+    if ((fence_type & kFenceOutput) != 0u) {
+      result += "o";
+    }
+    if ((fence_type & kFenceRead) != 0u) {
+      result += "r";
+    }
+    if ((fence_type & kFenceWrite) != 0u) {
+      result += "w";
+    }
+    if (result.empty()) {
+      result += "0";
+    }
+    return result;
+  };
+
+  std::string expected;
+  // Note: The `pred` and `succ` are 4 bits each.
+  // Some combinations are not really useful but the assembler can emit them all.
+  for (uint32_t pred = 0u; pred != 0x10; ++pred) {
+    for (uint32_t succ = 0u; succ != 0x10; ++succ) {
+      __ Fence(pred, succ);
+      expected +=
+          "fence " + get_fence_type_string(pred) + ", " + get_fence_type_string(succ) + "\n";
+    }
+  }
+  DriverStr(expected, "Fence");
+}
+
+TEST_F(AssemblerRISCV64Test, FenceTso) {
+  __ FenceTso();
+  DriverStr("fence.tso", "FenceTso");
+}
+
+TEST_F(AssemblerRISCV64Test, FenceI) {
+  __ FenceI();
+  DriverStr("fence.i", "FenceI");
+}
+
+TEST_F(AssemblerRISCV64Test, Mul) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRRR(&Riscv64Assembler::Mul, "mul {reg1}, {reg2}, {reg3}"), "Mul");
+}
+
+TEST_F(AssemblerRISCV64Test, Mulh) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Mulh, "mulh {reg1}, {reg2}, {reg3}"), "Mulh");
+}
+
+TEST_F(AssemblerRISCV64Test, Mulhsu) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Mulhsu, "mulhsu {reg1}, {reg2}, {reg3}"), "Mulhsu");
+}
+
+TEST_F(AssemblerRISCV64Test, Mulhu) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Mulhu, "mulhu {reg1}, {reg2}, {reg3}"), "Mulhu");
+}
+
+TEST_F(AssemblerRISCV64Test, Div) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Div, "div {reg1}, {reg2}, {reg3}"), "Div");
+}
+
+TEST_F(AssemblerRISCV64Test, Divu) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Divu, "divu {reg1}, {reg2}, {reg3}"), "Divu");
+}
+
+TEST_F(AssemblerRISCV64Test, Rem) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Rem, "rem {reg1}, {reg2}, {reg3}"), "Rem");
+}
+
+TEST_F(AssemblerRISCV64Test, Remu) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Remu, "remu {reg1}, {reg2}, {reg3}"), "Remu");
+}
+
+TEST_F(AssemblerRISCV64Test, Mulw) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Mulw, "mulw {reg1}, {reg2}, {reg3}"), "Mulw");
+}
+
+TEST_F(AssemblerRISCV64Test, Divw) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Divw, "divw {reg1}, {reg2}, {reg3}"), "Divw");
+}
+
+TEST_F(AssemblerRISCV64Test, Divuw) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Divuw, "divuw {reg1}, {reg2}, {reg3}"), "Divuw");
+}
+
+TEST_F(AssemblerRISCV64Test, Remw) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Remw, "remw {reg1}, {reg2}, {reg3}"), "Remw");
+}
+
+TEST_F(AssemblerRISCV64Test, Remuw) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Remuw, "remuw {reg1}, {reg2}, {reg3}"), "Remuw");
+}
+
+TEST_F(AssemblerRISCV64Test, LrW) {
+  auto invalid_aqrl = [](AqRl aqrl) { return aqrl == AqRl::kRelease; };
+  DriverStr(RepeatRRAqRl(&Riscv64Assembler::LrW, "lr.w{aqrl} {reg1}, ({reg2})", invalid_aqrl),
+            "LrW");
+}
+
+TEST_F(AssemblerRISCV64Test, LrD) {
+  auto invalid_aqrl = [](AqRl aqrl) { return aqrl == AqRl::kRelease; };
+  DriverStr(RepeatRRAqRl(&Riscv64Assembler::LrD, "lr.d{aqrl} {reg1}, ({reg2})", invalid_aqrl),
+            "LrD");
+}
+
+TEST_F(AssemblerRISCV64Test, ScW) {
+  auto invalid_aqrl = [](AqRl aqrl) { return aqrl == AqRl::kAcquire; };
+  DriverStr(
+      RepeatRRRAqRl(&Riscv64Assembler::ScW, "sc.w{aqrl} {reg1}, {reg2}, ({reg3})", invalid_aqrl),
+      "ScW");
+}
+
+TEST_F(AssemblerRISCV64Test, ScD) {
+  auto invalid_aqrl = [](AqRl aqrl) { return aqrl == AqRl::kAcquire; };
+  DriverStr(
+      RepeatRRRAqRl(&Riscv64Assembler::ScD, "sc.d{aqrl} {reg1}, {reg2}, ({reg3})", invalid_aqrl),
+      "ScD");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoSwapW) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoSwapW, "amoswap.w{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoSwapW");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoSwapD) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoSwapD, "amoswap.d{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoSwapD");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoAddW) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoAddW, "amoadd.w{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoAddW");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoAddD) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoAddD, "amoadd.d{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoAddD");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoXorW) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoXorW, "amoxor.w{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoXorW");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoXorD) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoXorD, "amoxor.d{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoXorD");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoAndW) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoAndW, "amoand.w{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoAndW");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoAndD) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoAndD, "amoand.d{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoAndD");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoOrW) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoOrW, "amoor.w{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoOrW");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoOrD) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoOrD, "amoor.d{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoOrD");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoMinW) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoMinW, "amomin.w{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoMinW");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoMinD) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoMinD, "amomin.d{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoMinD");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoMaxW) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoMaxW, "amomax.w{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoMaxW");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoMaxD) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoMaxD, "amomax.d{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoMaxD");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoMinuW) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoMinuW, "amominu.w{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoMinuW");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoMinuD) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoMinuD, "amominu.d{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoMinuD");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoMaxuW) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoMaxuW, "amomaxu.w{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoMaxuW");
+}
+
+TEST_F(AssemblerRISCV64Test, AmoMaxuD) {
+  DriverStr(RepeatRRRAqRl(&Riscv64Assembler::AmoMaxuD, "amomaxu.d{aqrl} {reg1}, {reg2}, ({reg3})"),
+            "AmoMaxuD");
+}
+
+TEST_F(AssemblerRISCV64Test, Csrrw) {
+  DriverStr(RepeatCsrrX(&Riscv64Assembler::Csrrw, "csrrw {reg1}, {csr}, {reg2}"), "Csrrw");
+}
+
+TEST_F(AssemblerRISCV64Test, Csrrs) {
+  DriverStr(RepeatCsrrX(&Riscv64Assembler::Csrrs, "csrrs {reg1}, {csr}, {reg2}"), "Csrrs");
+}
+
+TEST_F(AssemblerRISCV64Test, Csrrc) {
+  DriverStr(RepeatCsrrX(&Riscv64Assembler::Csrrc, "csrrc {reg1}, {csr}, {reg2}"), "Csrrc");
+}
+
+TEST_F(AssemblerRISCV64Test, Csrrwi) {
+  DriverStr(RepeatCsrrXi(&Riscv64Assembler::Csrrwi, "csrrwi {reg}, {csr}, {uimm}"), "Csrrwi");
+}
+
+TEST_F(AssemblerRISCV64Test, Csrrsi) {
+  DriverStr(RepeatCsrrXi(&Riscv64Assembler::Csrrsi, "csrrsi {reg}, {csr}, {uimm}"), "Csrrsi");
+}
+
+TEST_F(AssemblerRISCV64Test, Csrrci) {
+  DriverStr(RepeatCsrrXi(&Riscv64Assembler::Csrrci, "csrrci {reg}, {csr}, {uimm}"), "Csrrci");
+}
+
+TEST_F(AssemblerRISCV64Test, FLw) {
+  // Note: 16-bit variants of `flw` are not available on riscv64.
+  DriverStr(RepeatFRIb(&Riscv64Assembler::FLw, -12, "flw {reg1}, {imm}({reg2})"), "FLw");
+}
+
+TEST_F(AssemblerRISCV64Test, FLd) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatFRIb(&Riscv64Assembler::FLd, -12, "fld {reg1}, {imm}({reg2})"), "FLw");
+}
+
+TEST_F(AssemblerRISCV64Test, FSw) {
+  // Note: 16-bit variants of `fsw` are not available on riscv64.
+  DriverStr(RepeatFRIb(&Riscv64Assembler::FSw, 2, "fsw {reg1}, {imm}({reg2})"), "FSw");
+}
+
+TEST_F(AssemblerRISCV64Test, FSd) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatFRIb(&Riscv64Assembler::FSd, 2, "fsd {reg1}, {imm}({reg2})"), "FSd");
+}
+
+TEST_F(AssemblerRISCV64Test, FMAddS) {
+  DriverStr(RepeatFFFFRoundingMode(&Riscv64Assembler::FMAddS,
+                                   "fmadd.s {reg1}, {reg2}, {reg3}, {reg4}, {rm}"), "FMAddS");
+}
+
+TEST_F(AssemblerRISCV64Test, FMAddS_Default) {
+  DriverStr(RepeatFFFF(&Riscv64Assembler::FMAddS, "fmadd.s {reg1}, {reg2}, {reg3}, {reg4}"),
+            "FMAddS_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FMAddD) {
+  DriverStr(RepeatFFFFRoundingMode(&Riscv64Assembler::FMAddD,
+                                   "fmadd.d {reg1}, {reg2}, {reg3}, {reg4}, {rm}"), "FMAddD");
+}
+
+TEST_F(AssemblerRISCV64Test, FMAddD_Default) {
+  DriverStr(RepeatFFFF(&Riscv64Assembler::FMAddD, "fmadd.d {reg1}, {reg2}, {reg3}, {reg4}"),
+            "FMAddD_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FMSubS) {
+  DriverStr(RepeatFFFFRoundingMode(&Riscv64Assembler::FMSubS,
+                                   "fmsub.s {reg1}, {reg2}, {reg3}, {reg4}, {rm}"), "FMSubS");
+}
+
+TEST_F(AssemblerRISCV64Test, FMSubS_Default) {
+  DriverStr(RepeatFFFF(&Riscv64Assembler::FMSubS, "fmsub.s {reg1}, {reg2}, {reg3}, {reg4}"),
+            "FMSubS_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FMSubD) {
+  DriverStr(RepeatFFFFRoundingMode(&Riscv64Assembler::FMSubD,
+                                  "fmsub.d {reg1}, {reg2}, {reg3}, {reg4}, {rm}"), "FMSubD");
+}
+
+TEST_F(AssemblerRISCV64Test, FMSubD_Default) {
+  DriverStr(RepeatFFFF(&Riscv64Assembler::FMSubD, "fmsub.d {reg1}, {reg2}, {reg3}, {reg4}"),
+            "FMSubD_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FNMSubS) {
+  DriverStr(RepeatFFFFRoundingMode(&Riscv64Assembler::FNMSubS,
+                                   "fnmsub.s {reg1}, {reg2}, {reg3}, {reg4}, {rm}"), "FNMSubS");
+}
+
+TEST_F(AssemblerRISCV64Test, FNMSubS_Default) {
+  DriverStr(RepeatFFFF(&Riscv64Assembler::FNMSubS, "fnmsub.s {reg1}, {reg2}, {reg3}, {reg4}"),
+            "FNMSubS_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FNMSubD) {
+  DriverStr(RepeatFFFFRoundingMode(&Riscv64Assembler::FNMSubD,
+                                   "fnmsub.d {reg1}, {reg2}, {reg3}, {reg4}, {rm}"), "FNMSubD");
+}
+
+TEST_F(AssemblerRISCV64Test, FNMSubD_Default) {
+  DriverStr(RepeatFFFF(&Riscv64Assembler::FNMSubD, "fnmsub.d {reg1}, {reg2}, {reg3}, {reg4}"),
+            "FNMSubD_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FNMAddS) {
+  DriverStr(RepeatFFFFRoundingMode(&Riscv64Assembler::FNMAddS,
+                                   "fnmadd.s {reg1}, {reg2}, {reg3}, {reg4}, {rm}"), "FNMAddS");
+}
+
+TEST_F(AssemblerRISCV64Test, FNMAddS_Default) {
+  DriverStr(RepeatFFFF(&Riscv64Assembler::FNMAddS, "fnmadd.s {reg1}, {reg2}, {reg3}, {reg4}"),
+            "FNMAddS_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FNMAddD) {
+  DriverStr(RepeatFFFFRoundingMode(&Riscv64Assembler::FNMAddD,
+                                   "fnmadd.d {reg1}, {reg2}, {reg3}, {reg4}, {rm}"), "FNMAddD");
+}
+
+TEST_F(AssemblerRISCV64Test, FNMAddD_Default) {
+  DriverStr(RepeatFFFF(&Riscv64Assembler::FNMAddD, "fnmadd.d {reg1}, {reg2}, {reg3}, {reg4}"),
+            "FNMAddD_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FAddS) {
+  DriverStr(RepeatFFFRoundingMode(&Riscv64Assembler::FAddS, "fadd.s {reg1}, {reg2}, {reg3}, {rm}"),
+            "FAddS");
+}
+
+TEST_F(AssemblerRISCV64Test, FAddS_Default) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FAddS, "fadd.s {reg1}, {reg2}, {reg3}"), "FAddS_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FAddD) {
+  DriverStr(RepeatFFFRoundingMode(&Riscv64Assembler::FAddD, "fadd.d {reg1}, {reg2}, {reg3}, {rm}"),
+            "FAddD");
+}
+
+TEST_F(AssemblerRISCV64Test, FAddD_Default) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FAddD, "fadd.d {reg1}, {reg2}, {reg3}"), "FAddD_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FSubS) {
+  DriverStr(RepeatFFFRoundingMode(&Riscv64Assembler::FSubS, "fsub.s {reg1}, {reg2}, {reg3}, {rm}"),
+            "FSubS");
+}
+
+TEST_F(AssemblerRISCV64Test, FSubS_Default) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FSubS, "fsub.s {reg1}, {reg2}, {reg3}"), "FSubS_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FSubD) {
+  DriverStr(RepeatFFFRoundingMode(&Riscv64Assembler::FSubD, "fsub.d {reg1}, {reg2}, {reg3}, {rm}"),
+            "FSubD");
+}
+
+TEST_F(AssemblerRISCV64Test, FSubD_Default) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FSubD, "fsub.d {reg1}, {reg2}, {reg3}"), "FSubD_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FMulS) {
+  DriverStr(RepeatFFFRoundingMode(&Riscv64Assembler::FMulS, "fmul.s {reg1}, {reg2}, {reg3}, {rm}"),
+            "FMulS");
+}
+
+TEST_F(AssemblerRISCV64Test, FMulS_Default) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FMulS, "fmul.s {reg1}, {reg2}, {reg3}"), "FMulS_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FMulD) {
+  DriverStr(RepeatFFFRoundingMode(&Riscv64Assembler::FMulD, "fmul.d {reg1}, {reg2}, {reg3}, {rm}"),
+            "FMulD");
+}
+
+TEST_F(AssemblerRISCV64Test, FMulD_Default) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FMulD, "fmul.d {reg1}, {reg2}, {reg3}"), "FMulD_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FDivS) {
+  DriverStr(RepeatFFFRoundingMode(&Riscv64Assembler::FDivS, "fdiv.s {reg1}, {reg2}, {reg3}, {rm}"),
+            "FDivS");
+}
+
+TEST_F(AssemblerRISCV64Test, FDivS_Default) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FDivS, "fdiv.s {reg1}, {reg2}, {reg3}"), "FDivS_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FDivD) {
+  DriverStr(RepeatFFFRoundingMode(&Riscv64Assembler::FDivD, "fdiv.d {reg1}, {reg2}, {reg3}, {rm}"),
+            "FDivD");
+}
+
+TEST_F(AssemblerRISCV64Test, FDivD_Default) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FDivD, "fdiv.d {reg1}, {reg2}, {reg3}"), "FDivD_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FSqrtS) {
+  DriverStr(RepeatFFRoundingMode(&Riscv64Assembler::FSqrtS, "fsqrt.s {reg1}, {reg2}, {rm}"),
+            "FSqrtS");
+}
+
+TEST_F(AssemblerRISCV64Test, FSqrtS_Default) {
+  DriverStr(RepeatFF(&Riscv64Assembler::FSqrtS, "fsqrt.s {reg1}, {reg2}"), "FSqrtS_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FSqrtD) {
+  DriverStr(RepeatFFRoundingMode(&Riscv64Assembler::FSqrtD, "fsqrt.d {reg1}, {reg2}, {rm}"),
+            "FSqrtD");
+}
+
+TEST_F(AssemblerRISCV64Test, FSqrtD_Default) {
+  DriverStr(RepeatFF(&Riscv64Assembler::FSqrtD, "fsqrt.d {reg1}, {reg2}"), "FSqrtD_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FSgnjS) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FSgnjS, "fsgnj.s {reg1}, {reg2}, {reg3}"), "FSgnjS");
+}
+
+TEST_F(AssemblerRISCV64Test, FSgnjD) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FSgnjD, "fsgnj.d {reg1}, {reg2}, {reg3}"), "FSgnjD");
+}
+
+TEST_F(AssemblerRISCV64Test, FSgnjnS) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FSgnjnS, "fsgnjn.s {reg1}, {reg2}, {reg3}"), "FSgnjnS");
+}
+
+TEST_F(AssemblerRISCV64Test, FSgnjnD) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FSgnjnD, "fsgnjn.d {reg1}, {reg2}, {reg3}"), "FSgnjnD");
+}
+
+TEST_F(AssemblerRISCV64Test, FSgnjxS) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FSgnjxS, "fsgnjx.s {reg1}, {reg2}, {reg3}"), "FSgnjxS");
+}
+
+TEST_F(AssemblerRISCV64Test, FSgnjxD) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FSgnjxD, "fsgnjx.d {reg1}, {reg2}, {reg3}"), "FSgnjxD");
+}
+
+TEST_F(AssemblerRISCV64Test, FMinS) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FMinS, "fmin.s {reg1}, {reg2}, {reg3}"), "FMinS");
+}
+
+TEST_F(AssemblerRISCV64Test, FMinD) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FMinD, "fmin.d {reg1}, {reg2}, {reg3}"), "FMinD");
+}
+
+TEST_F(AssemblerRISCV64Test, FMaxS) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FMaxS, "fmax.s {reg1}, {reg2}, {reg3}"), "FMaxS");
+}
+
+TEST_F(AssemblerRISCV64Test, FMaxD) {
+  DriverStr(RepeatFFF(&Riscv64Assembler::FMaxD, "fmax.d {reg1}, {reg2}, {reg3}"), "FMaxD");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtSD) {
+  DriverStr(RepeatFFRoundingMode(&Riscv64Assembler::FCvtSD, "fcvt.s.d {reg1}, {reg2}, {rm}"),
+            "FCvtSD");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtSD_Default) {
+  DriverStr(RepeatFF(&Riscv64Assembler::FCvtSD, "fcvt.s.d {reg1}, {reg2}"), "FCvtSD_Default");
+}
+
+// This conversion is lossless, so the rounding mode is meaningless and the assembler we're
+// testing against does not even accept the rounding mode argument, so this test is disabled.
+TEST_F(AssemblerRISCV64Test, DISABLED_FCvtDS) {
+  DriverStr(RepeatFFRoundingMode(&Riscv64Assembler::FCvtDS, "fcvt.d.s {reg1}, {reg2}, {rm}"),
+            "FCvtDS");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtDS_Default) {
+  DriverStr(RepeatFF(&Riscv64Assembler::FCvtDS, "fcvt.d.s {reg1}, {reg2}"), "FCvtDS_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FEqS) {
+  DriverStr(RepeatRFF(&Riscv64Assembler::FEqS, "feq.s {reg1}, {reg2}, {reg3}"), "FEqS");
+}
+
+TEST_F(AssemblerRISCV64Test, FEqD) {
+  DriverStr(RepeatRFF(&Riscv64Assembler::FEqD, "feq.d {reg1}, {reg2}, {reg3}"), "FEqD");
+}
+
+TEST_F(AssemblerRISCV64Test, FLtS) {
+  DriverStr(RepeatRFF(&Riscv64Assembler::FLtS, "flt.s {reg1}, {reg2}, {reg3}"), "FLtS");
+}
+
+TEST_F(AssemblerRISCV64Test, FLtD) {
+  DriverStr(RepeatRFF(&Riscv64Assembler::FLtD, "flt.d {reg1}, {reg2}, {reg3}"), "FLtD");
+}
+
+TEST_F(AssemblerRISCV64Test, FLeS) {
+  DriverStr(RepeatRFF(&Riscv64Assembler::FLeS, "fle.s {reg1}, {reg2}, {reg3}"), "FLeS");
+}
+
+TEST_F(AssemblerRISCV64Test, FLeD) {
+  DriverStr(RepeatRFF(&Riscv64Assembler::FLeD, "fle.d {reg1}, {reg2}, {reg3}"), "FLeD");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtWS) {
+  DriverStr(RepeatrFRoundingMode(&Riscv64Assembler::FCvtWS, "fcvt.w.s {reg1}, {reg2}, {rm}"),
+            "FCvtWS");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtWS_Default) {
+  DriverStr(RepeatrF(&Riscv64Assembler::FCvtWS, "fcvt.w.s {reg1}, {reg2}"), "FCvtWS_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtWD) {
+  DriverStr(RepeatrFRoundingMode(&Riscv64Assembler::FCvtWD, "fcvt.w.d {reg1}, {reg2}, {rm}"),
+            "FCvtWD");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtWD_Default) {
+  DriverStr(RepeatrF(&Riscv64Assembler::FCvtWD, "fcvt.w.d {reg1}, {reg2}"), "FCvtWD_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtWuS) {
+  DriverStr(RepeatrFRoundingMode(&Riscv64Assembler::FCvtWuS, "fcvt.wu.s {reg1}, {reg2}, {rm}"),
+            "FCvtWuS");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtWuS_Default) {
+  DriverStr(RepeatrF(&Riscv64Assembler::FCvtWuS, "fcvt.wu.s {reg1}, {reg2}"), "FCvtWuS_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtWuD) {
+  DriverStr(RepeatrFRoundingMode(&Riscv64Assembler::FCvtWuD, "fcvt.wu.d {reg1}, {reg2}, {rm}"),
+            "FCvtWuD");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtWuD_Default) {
+  DriverStr(RepeatrF(&Riscv64Assembler::FCvtWuD, "fcvt.wu.d {reg1}, {reg2}"), "FCvtWuD_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtLS) {
+  DriverStr(RepeatrFRoundingMode(&Riscv64Assembler::FCvtLS, "fcvt.l.s {reg1}, {reg2}, {rm}"),
+            "FCvtLS");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtLS_Default) {
+  DriverStr(RepeatrF(&Riscv64Assembler::FCvtLS, "fcvt.l.s {reg1}, {reg2}"), "FCvtLS_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtLD) {
+  DriverStr(RepeatrFRoundingMode(&Riscv64Assembler::FCvtLD, "fcvt.l.d {reg1}, {reg2}, {rm}"),
+            "FCvtLD");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtLD_Default) {
+  DriverStr(RepeatrF(&Riscv64Assembler::FCvtLD, "fcvt.l.d {reg1}, {reg2}"), "FCvtLD_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtLuS) {
+  DriverStr(RepeatrFRoundingMode(&Riscv64Assembler::FCvtLuS, "fcvt.lu.s {reg1}, {reg2}, {rm}"),
+            "FCvtLuS");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtLuS_Default) {
+  DriverStr(RepeatrF(&Riscv64Assembler::FCvtLuS, "fcvt.lu.s {reg1}, {reg2}"), "FCvtLuS_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtLuD) {
+  DriverStr(RepeatrFRoundingMode(&Riscv64Assembler::FCvtLuD, "fcvt.lu.d {reg1}, {reg2}, {rm}"),
+            "FCvtLuD");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtLuD_Default) {
+  DriverStr(RepeatrF(&Riscv64Assembler::FCvtLuD, "fcvt.lu.d {reg1}, {reg2}"), "FCvtLuD_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtSW) {
+  DriverStr(RepeatFrRoundingMode(&Riscv64Assembler::FCvtSW, "fcvt.s.w {reg1}, {reg2}, {rm}"),
+            "FCvtSW");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtSW_Default) {
+  DriverStr(RepeatFr(&Riscv64Assembler::FCvtSW, "fcvt.s.w {reg1}, {reg2}"), "FCvtSW_Default");
+}
+
+// This conversion is lossless, so the rounding mode is meaningless and the assembler we're
+// testing against does not even accept the rounding mode argument, so this test is disabled.
+TEST_F(AssemblerRISCV64Test, DISABLED_FCvtDW) {
+  DriverStr(RepeatFrRoundingMode(&Riscv64Assembler::FCvtDW, "fcvt.d.w {reg1}, {reg2}, {rm}"),
+            "FCvtDW");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtDW_Default) {
+  DriverStr(RepeatFr(&Riscv64Assembler::FCvtDW, "fcvt.d.w {reg1}, {reg2}"), "FCvtDW_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtSWu) {
+  DriverStr(RepeatFrRoundingMode(&Riscv64Assembler::FCvtSWu, "fcvt.s.wu {reg1}, {reg2}, {rm}"),
+            "FCvtSWu");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtSWu_Default) {
+  DriverStr(RepeatFr(&Riscv64Assembler::FCvtSWu, "fcvt.s.wu {reg1}, {reg2}"), "FCvtSWu_Default");
+}
+
+// This conversion is lossless, so the rounding mode is meaningless and the assembler we're
+// testing against does not even accept the rounding mode argument, so this test is disabled.
+TEST_F(AssemblerRISCV64Test, DISABLED_FCvtDWu) {
+  DriverStr(RepeatFrRoundingMode(&Riscv64Assembler::FCvtDWu, "fcvt.d.wu {reg1}, {reg2}, {rm}"),
+            "FCvtDWu");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtDWu_Default) {
+  DriverStr(RepeatFr(&Riscv64Assembler::FCvtDWu, "fcvt.d.wu {reg1}, {reg2}"), "FCvtDWu_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtSL) {
+  DriverStr(RepeatFrRoundingMode(&Riscv64Assembler::FCvtSL, "fcvt.s.l {reg1}, {reg2}, {rm}"),
+            "FCvtSL");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtSL_Default) {
+  DriverStr(RepeatFr(&Riscv64Assembler::FCvtSL, "fcvt.s.l {reg1}, {reg2}"), "FCvtSL_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtDL) {
+  DriverStr(RepeatFrRoundingMode(&Riscv64Assembler::FCvtDL, "fcvt.d.l {reg1}, {reg2}, {rm}"),
+            "FCvtDL");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtDL_Default) {
+  DriverStr(RepeatFr(&Riscv64Assembler::FCvtDL, "fcvt.d.l {reg1}, {reg2}"), "FCvtDL_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtSLu) {
+  DriverStr(RepeatFrRoundingMode(&Riscv64Assembler::FCvtSLu, "fcvt.s.lu {reg1}, {reg2}, {rm}"),
+            "FCvtSLu");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtSLu_Default) {
+  DriverStr(RepeatFr(&Riscv64Assembler::FCvtSLu, "fcvt.s.lu {reg1}, {reg2}"), "FCvtSLu_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtDLu) {
+  DriverStr(RepeatFrRoundingMode(&Riscv64Assembler::FCvtDLu, "fcvt.d.lu {reg1}, {reg2}, {rm}"),
+            "FCvtDLu");
+}
+
+TEST_F(AssemblerRISCV64Test, FCvtDLu_Default) {
+  DriverStr(RepeatFr(&Riscv64Assembler::FCvtDLu, "fcvt.d.lu {reg1}, {reg2}"), "FCvtDLu_Default");
+}
+
+TEST_F(AssemblerRISCV64Test, FMvXW) {
+  DriverStr(RepeatRF(&Riscv64Assembler::FMvXW, "fmv.x.w {reg1}, {reg2}"), "FMvXW");
+}
+
+TEST_F(AssemblerRISCV64Test, FMvXD) {
+  DriverStr(RepeatRF(&Riscv64Assembler::FMvXD, "fmv.x.d {reg1}, {reg2}"), "FMvXD");
+}
+
+TEST_F(AssemblerRISCV64Test, FMvWX) {
+  DriverStr(RepeatFR(&Riscv64Assembler::FMvWX, "fmv.w.x {reg1}, {reg2}"), "FMvWX");
+}
+
+TEST_F(AssemblerRISCV64Test, FMvDX) {
+  DriverStr(RepeatFR(&Riscv64Assembler::FMvDX, "fmv.d.x {reg1}, {reg2}"), "FMvDX");
+}
+
+TEST_F(AssemblerRISCV64Test, FClassS) {
+  DriverStr(RepeatRF(&Riscv64Assembler::FClassS, "fclass.s {reg1}, {reg2}"), "FClassS");
+}
+
+TEST_F(AssemblerRISCV64Test, FClassD) {
+  DriverStr(RepeatrF(&Riscv64Assembler::FClassD, "fclass.d {reg1}, {reg2}"), "FClassD");
+}
+
+TEST_F(AssemblerRISCV64Test, CLwsp) {
+  DriverStr(RepeatCRImm(&Riscv64Assembler::CLwsp,
+                        /*is_short=*/false,
+                        /*no_zero_reg=*/true,
+                        /*no_zero_imm=*/false,
+                        /*imm_bits=*/6,
+                        /*shift=*/2,
+                        "c.lwsp {reg}, {imm}(sp)"),
+            "CLwsp");
+}
+
+TEST_F(AssemblerRISCV64Test, CLdsp) {
+  DriverStr(RepeatCRImm(&Riscv64Assembler::CLdsp,
+                        /*is_short=*/false,
+                        /*no_zero_reg=*/true,
+                        /*no_zero_imm=*/false,
+                        /*imm_bits=*/6,
+                        /*shift=*/3,
+                        "c.ldsp {reg}, {imm}(sp)"),
+            "CLdsp");
+}
+
+TEST_F(AssemblerRISCV64Test, CFLdsp) {
+  DriverStr(RepeatCFImm(
+                &Riscv64Assembler::CFLdsp, /*imm_bits=*/6, /*shift=*/3, "c.fldsp {reg}, {imm}(sp)"),
+            "CFLdsp");
+}
+
+TEST_F(AssemblerRISCV64Test, CSwsp) {
+  DriverStr(RepeatCRImm(&Riscv64Assembler::CSwsp,
+                        /*is_short=*/false,
+                        /*no_zero_reg=*/false,
+                        /*no_zero_imm=*/false,
+                        /*imm_bits=*/6,
+                        /*shift=*/2,
+                        "c.swsp {reg}, {imm}(sp)"),
+            "CLwsp");
+}
+
+TEST_F(AssemblerRISCV64Test, CSdsp) {
+  DriverStr(RepeatCRImm(&Riscv64Assembler::CSdsp,
+                        /*is_short=*/false,
+                        /*no_zero_reg=*/false,
+                        /*no_zero_imm=*/false,
+                        /*imm_bits=*/6,
+                        /*shift=*/3,
+                        "c.sdsp {reg}, {imm}(sp)"),
+            "CLdsp");
+}
+
+TEST_F(AssemblerRISCV64Test, CFSdsp) {
+  DriverStr(RepeatCFImm(
+                &Riscv64Assembler::CFSdsp, /*imm_bits=*/6, /*shift=*/3, "c.fsdsp {reg}, {imm}(sp)"),
+            "CFLdsp");
+}
+
+TEST_F(AssemblerRISCV64Test, CLw) {
+  DriverStr(RepeatCRRImm(
+                &Riscv64Assembler::CLw, /*imm_bits=*/5, /*shift=*/2, "c.lw {reg1}, {imm}({reg2})"),
+            "CLw");
+}
+
+TEST_F(AssemblerRISCV64Test, CLd) {
+  DriverStr(RepeatCRRImm(
+                &Riscv64Assembler::CLd, /*imm_bits=*/5, /*shift=*/3, "c.ld {reg1}, {imm}({reg2})"),
+            "CLd");
+}
+
+TEST_F(AssemblerRISCV64Test, CFLd) {
+  DriverStr(RepeatCFRImm(&Riscv64Assembler::CFLd,
+                         /*imm_bits=*/5,
+                         /*shift=*/3,
+                         "c.fld {reg1}, {imm}({reg2})"),
+            "CFLd");
+}
+
+TEST_F(AssemblerRISCV64Test, CSw) {
+  DriverStr(RepeatCRRImm(
+                &Riscv64Assembler::CSw, /*imm_bits=*/5, /*shift=*/2, "c.sw {reg1}, {imm}({reg2})"),
+            "CSw");
+}
+
+TEST_F(AssemblerRISCV64Test, CSd) {
+  DriverStr(RepeatCRRImm(
+                &Riscv64Assembler::CSd, /*imm_bits=*/5, /*shift=*/3, "c.sd {reg1}, {imm}({reg2})"),
+            "CSd");
+}
+
+TEST_F(AssemblerRISCV64Test, CFSd) {
+  DriverStr(RepeatCFRImm(&Riscv64Assembler::CFSd,
+                         /*imm_bits=*/5,
+                         /*shift=*/3,
+                         "c.fsd {reg1}, {imm}({reg2})"),
+            "CFSd");
+}
+
+TEST_F(AssemblerRISCV64Test, CLi) {
+  DriverStr(RepeatCRImm(&Riscv64Assembler::CLi,
+                        /*is_short=*/false,
+                        /*no_zero_reg=*/true,
+                        /*no_zero_imm=*/false,
+                        /*imm_bits=*/-6,
+                        /*shift=*/0,
+                        "c.li {reg}, {imm}"),
+            "CLi");
+}
+
+TEST_F(AssemblerRISCV64Test, CLui) {
+  std::string str;
+  auto imms = CreateImmediateValuesBits(/*imm_bits=*/5, /*as_uint=*/true);
+  for (uint32_t v = 0xfffe0; v <= 0xfffff; ++v) {
+    imms.push_back(v);
+  }
+
+  for (XRegister reg : GetRegisters()) {
+    for (int64_t imm_raw : imms) {
+      if (imm_raw == 0) {
+        continue;
+      }
+
+      if (reg == Zero || reg == SP) {
+        continue;
+      }
+
+      uint32_t imm = CreateImmediate(imm_raw);
+      GetAssembler()->CLui(reg, imm);
+
+      std::string base = "c.lui {reg}, {imm}";
+      ReplaceReg(REG_TOKEN, GetRegisterName(reg), &base);
+      ReplaceImm(imm, /*bias=*/0, /*multiplier=*/1, &base);
+      str += base;
+      str += "\n";
+    }
+  }
+
+  DriverStr(str, "CLui");
+}
+
+TEST_F(AssemblerRISCV64Test, CAddi) {
+  DriverStr(RepeatCRImm(&Riscv64Assembler::CAddi,
+                        /*is_short=*/false,
+                        /*no_zero_reg=*/true,
+                        /*no_zero_imm=*/true,
+                        /*imm_bits=*/-6,
+                        /*shift=*/0,
+                        "c.addi {reg}, {imm}"),
+            "CAddi");
+}
+
+TEST_F(AssemblerRISCV64Test, CAddiw) {
+  DriverStr(RepeatCRImm(&Riscv64Assembler::CAddiw,
+                        /*is_short=*/false,
+                        /*no_zero_reg=*/true,
+                        /*no_zero_imm=*/false,
+                        /*imm_bits=*/-6,
+                        /*shift=*/0,
+                        "c.addiw {reg}, {imm}"),
+            "CAddiw");
+}
+
+TEST_F(AssemblerRISCV64Test, CAddi16Sp) {
+  DriverStr(RepeatImm(&Riscv64Assembler::CAddi16Sp,
+                      /*no_zero_imm=*/true,
+                      /*imm_bits=*/-6,
+                      /*shift=*/4,
+                      "c.addi16sp sp, {imm}"),
+            "CAddi16Sp");
+}
+
+TEST_F(AssemblerRISCV64Test, CAddi4Spn) {
+  DriverStr(RepeatCRImm(&Riscv64Assembler::CAddi4Spn,
+                        /*is_short=*/true,
+                        /*no_zero_reg=*/false,
+                        /*no_zero_imm=*/true,
+                        /*imm_bits=*/8,
+                        /*shift=*/2,
+                        "c.addi4spn {reg}, sp, {imm}"),
+            "CAddi4Spn");
+}
+
+TEST_F(AssemblerRISCV64Test, CSlli) {
+  DriverStr(RepeatCRImm(&Riscv64Assembler::CSlli,
+                        /*is_short=*/false,
+                        /*no_zero_reg=*/true,
+                        /*no_zero_imm=*/true,
+                        /*imm_bits=*/6,
+                        /*shift=*/0,
+                        "c.slli {reg}, {imm}"),
+            "CSlli");
+}
+
+TEST_F(AssemblerRISCV64Test, CSRli) {
+  DriverStr(RepeatCRImm(&Riscv64Assembler::CSrli,
+                        /*is_short=*/true,
+                        /*no_zero_reg=*/false,
+                        /*no_zero_imm=*/true,
+                        /*imm_bits=*/6,
+                        /*shift=*/0,
+                        "c.srli {reg}, {imm}"),
+            "CSRli");
+}
+
+TEST_F(AssemblerRISCV64Test, CSRai) {
+  DriverStr(RepeatCRImm(&Riscv64Assembler::CSrai,
+                        /*is_short=*/true,
+                        /*no_zero_reg=*/false,
+                        /*no_zero_imm=*/true,
+                        /*imm_bits=*/6,
+                        /*shift=*/0,
+                        "c.srai {reg}, {imm}"),
+            "CSRai");
+}
+
+TEST_F(AssemblerRISCV64Test, CAndi) {
+  DriverStr(RepeatCRImm(&Riscv64Assembler::CAndi,
+                        /*is_short=*/true,
+                        /*no_zero_reg=*/false,
+                        /*no_zero_imm=*/false,
+                        /*imm_bits=*/-6,
+                        /*shift=*/0,
+                        "c.andi {reg}, {imm}"),
+            "CAndi");
+}
+
+TEST_F(AssemblerRISCV64Test, CMv) {
+  DriverStr(RepeatCRRNonZero(&Riscv64Assembler::CMv, "c.mv {reg1}, {reg2}"), "CMv");
+}
+
+TEST_F(AssemblerRISCV64Test, CAdd) {
+  DriverStr(RepeatCRRNonZero(&Riscv64Assembler::CAdd, "c.add {reg1}, {reg2}"), "CAdd");
+}
+
+TEST_F(AssemblerRISCV64Test, CAnd) {
+  DriverStr(RepeatCRRShort(&Riscv64Assembler::CAnd, "c.and {reg1}, {reg2}"), "CAnd");
+}
+
+TEST_F(AssemblerRISCV64Test, COr) {
+  DriverStr(RepeatCRRShort(&Riscv64Assembler::COr, "c.or {reg1}, {reg2}"), "COr");
+}
+
+TEST_F(AssemblerRISCV64Test, CXor) {
+  DriverStr(RepeatCRRShort(&Riscv64Assembler::CXor, "c.xor {reg1}, {reg2}"), "CXor");
+}
+
+TEST_F(AssemblerRISCV64Test, CSub) {
+  DriverStr(RepeatCRRShort(&Riscv64Assembler::CSub, "c.sub {reg1}, {reg2}"), "CSub");
+}
+
+TEST_F(AssemblerRISCV64Test, CAddw) {
+  DriverStr(RepeatCRRShort(&Riscv64Assembler::CAddw, "c.addw {reg1}, {reg2}"), "CAddw");
+}
+
+TEST_F(AssemblerRISCV64Test, CSubw) {
+  DriverStr(RepeatCRRShort(&Riscv64Assembler::CSubw, "c.subw {reg1}, {reg2}"), "CSubw");
+}
+
+TEST_F(AssemblerRISCV64Test, CLbu) {
+  DriverStr(RepeatCRRImm(&Riscv64Assembler::CLbu,
+                         /*imm_bits=*/2,
+                         /*shift=*/0,
+                         "c.lbu {reg1}, {imm}({reg2})"),
+            "CLbu");
+}
+
+TEST_F(AssemblerRISCV64Test, CLhu) {
+  DriverStr(RepeatCRRImm(&Riscv64Assembler::CLhu,
+                         /*imm_bits=*/1,
+                         /*shift=*/1,
+                         "c.lhu {reg1}, {imm}({reg2})"),
+            "CLhu");
+}
+
+TEST_F(AssemblerRISCV64Test, CLh) {
+  DriverStr(RepeatCRRImm(&Riscv64Assembler::CLh,
+                         /*imm_bits=*/1,
+                         /*shift=*/1,
+                         "c.lh {reg1}, {imm}({reg2})"),
+            "CLh");
+}
+
+TEST_F(AssemblerRISCV64Test, CSb) {
+  DriverStr(RepeatCRRImm(&Riscv64Assembler::CSb,
+                         /*imm_bits=*/2,
+                         /*shift=*/0,
+                         "c.sb {reg1}, {imm}({reg2})"),
+            "CSb");
+}
+
+TEST_F(AssemblerRISCV64Test, CSh) {
+  DriverStr(RepeatCRRImm(&Riscv64Assembler::CSh,
+                         /*imm_bits=*/1,
+                         /*shift=*/1,
+                         "c.sh {reg1}, {imm}({reg2})"),
+            "CSh");
+}
+
+TEST_F(AssemblerRISCV64Test, CZextB) {
+  DriverStr(RepeatCRShort(&Riscv64Assembler::CZextB, "c.zext.b {reg}"), "CZextB");
+}
+
+TEST_F(AssemblerRISCV64Test, CSextB) {
+  DriverStr(RepeatCRShort(&Riscv64Assembler::CSextB, "c.sext.b {reg}"), "CSextB");
+}
+
+TEST_F(AssemblerRISCV64Test, CZextH) {
+  DriverStr(RepeatCRShort(&Riscv64Assembler::CZextH, "c.zext.h {reg}"), "CZextH");
+}
+
+TEST_F(AssemblerRISCV64Test, CSextH) {
+  DriverStr(RepeatCRShort(&Riscv64Assembler::CSextH, "c.sext.h {reg}"), "CSextH");
+}
+
+TEST_F(AssemblerRISCV64Test, CZextW) {
+  DriverStr(RepeatCRShort(&Riscv64Assembler::CZextW, "c.zext.w {reg}"), "CZextW");
+}
+
+TEST_F(AssemblerRISCV64Test, CNot) {
+  DriverStr(RepeatCRShort(&Riscv64Assembler::CNot, "c.not {reg}"), "CNot");
+}
+
+TEST_F(AssemblerRISCV64Test, CMul) {
+  DriverStr(RepeatCRRShort(&Riscv64Assembler::CMul, "c.mul {reg1}, {reg2}"), "CMul");
+}
+
+TEST_F(AssemblerRISCV64Test, CJ) {
+  DriverStr(
+      RepeatImm(
+          &Riscv64Assembler::CJ, /*no_zero_imm=*/false, /*imm_bits=*/-11, /*shift=*/1, "c.j {imm}"),
+      "CJ");
+}
+
+TEST_F(AssemblerRISCV64Test, CJr) {
+  DriverStr(RepeatRNoZero(&Riscv64Assembler::CJr, "c.jr {reg}"), "CJr");
+}
+
+TEST_F(AssemblerRISCV64Test, CJalr) {
+  DriverStr(RepeatRNoZero(&Riscv64Assembler::CJalr, "c.jalr {reg}"), "CJalr");
+}
+
+TEST_F(AssemblerRISCV64Test, CBeqz) {
+  DriverStr(RepeatCRImm(&Riscv64Assembler::CBeqz,
+                        /*is_short=*/true,
+                        /*no_zero_reg=*/false,
+                        /*no_zero_imm=*/false,
+                        /*imm_bits=*/-8,
+                        /*shift=*/1,
+                        "c.beqz {reg}, {imm}"),
+            "CBeqz");
+}
+
+TEST_F(AssemblerRISCV64Test, CBnez) {
+  DriverStr(RepeatCRImm(&Riscv64Assembler::CBnez,
+                        /*is_short=*/true,
+                        /*no_zero_reg=*/false,
+                        /*no_zero_imm=*/false,
+                        /*imm_bits=*/-8,
+                        /*shift=*/1,
+                        "c.bnez {reg}, {imm}"),
+            "CBnez");
+}
+
+TEST_F(AssemblerRISCV64Test, CEbreak) {
+  __ CEbreak();
+  DriverStr("c.ebreak", "CEbreak");
+}
+
+TEST_F(AssemblerRISCV64Test, CNop) {
+  __ CNop();
+  DriverStr("c.nop", "CNop");
+}
+
+TEST_F(AssemblerRISCV64Test, CUnimp) {
+  __ CUnimp();
+  DriverStr("c.unimp", "CUnimp");
+}
+
+TEST_F(AssemblerRISCV64Test, AddUw) {
+  ScopedCSuppression scs(this);  // Avoid `c.zext.w`.
+  DriverStr(RepeatRRR(&Riscv64Assembler::AddUw, "add.uw {reg1}, {reg2}, {reg3}"), "AddUw");
+}
+
+TEST_F(AssemblerRISCV64Test, Sh1Add) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Sh1Add, "sh1add {reg1}, {reg2}, {reg3}"), "Sh1Add");
+}
+
+TEST_F(AssemblerRISCV64Test, Sh1AddUw) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Sh1AddUw, "sh1add.uw {reg1}, {reg2}, {reg3}"), "Sh1AddUw");
+}
+
+TEST_F(AssemblerRISCV64Test, Sh2Add) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Sh2Add, "sh2add {reg1}, {reg2}, {reg3}"), "Sh2Add");
+}
+
+TEST_F(AssemblerRISCV64Test, Sh2AddUw) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Sh2AddUw, "sh2add.uw {reg1}, {reg2}, {reg3}"), "Sh2AddUw");
+}
+
+TEST_F(AssemblerRISCV64Test, Sh3Add) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Sh3Add, "sh3add {reg1}, {reg2}, {reg3}"), "Sh3Add");
+}
+
+TEST_F(AssemblerRISCV64Test, Sh3AddUw) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Sh3AddUw, "sh3add.uw {reg1}, {reg2}, {reg3}"), "Sh3AddUw");
+}
+
+TEST_F(AssemblerRISCV64Test, SlliUw) {
+  DriverStr(RepeatRRIb(&Riscv64Assembler::SlliUw, 6, "slli.uw {reg1}, {reg2}, {imm}"), "SlliUw");
+}
+
+TEST_F(AssemblerRISCV64Test, Andn) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Andn, "andn {reg1}, {reg2}, {reg3}"), "Andn");
+}
+
+TEST_F(AssemblerRISCV64Test, Orn) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Orn, "orn {reg1}, {reg2}, {reg3}"), "Orn");
+}
+
+TEST_F(AssemblerRISCV64Test, Xnor) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Xnor, "xnor {reg1}, {reg2}, {reg3}"), "Xnor");
+}
+
+TEST_F(AssemblerRISCV64Test, Clz) {
+  DriverStr(RepeatRR(&Riscv64Assembler::Clz, "clz {reg1}, {reg2}"), "Clz");
+}
+
+TEST_F(AssemblerRISCV64Test, Clzw) {
+  DriverStr(RepeatRR(&Riscv64Assembler::Clzw, "clzw {reg1}, {reg2}"), "Clzw");
+}
+
+TEST_F(AssemblerRISCV64Test, Ctz) {
+  DriverStr(RepeatRR(&Riscv64Assembler::Ctz, "ctz {reg1}, {reg2}"), "Ctz");
+}
+
+TEST_F(AssemblerRISCV64Test, Ctzw) {
+  DriverStr(RepeatRR(&Riscv64Assembler::Ctzw, "ctzw {reg1}, {reg2}"), "Ctzw");
+}
+
+TEST_F(AssemblerRISCV64Test, Cpop) {
+  DriverStr(RepeatRR(&Riscv64Assembler::Cpop, "cpop {reg1}, {reg2}"), "Cpop");
+}
+
+TEST_F(AssemblerRISCV64Test, Cpopw) {
+  DriverStr(RepeatRR(&Riscv64Assembler::Cpopw, "cpopw {reg1}, {reg2}"), "Cpopw");
+}
+
+TEST_F(AssemblerRISCV64Test, Min) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Min, "min {reg1}, {reg2}, {reg3}"), "Min");
+}
+
+TEST_F(AssemblerRISCV64Test, Minu) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Minu, "minu {reg1}, {reg2}, {reg3}"), "Minu");
+}
+
+TEST_F(AssemblerRISCV64Test, Max) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Max, "max {reg1}, {reg2}, {reg3}"), "Max");
+}
+
+TEST_F(AssemblerRISCV64Test, Maxu) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Maxu, "maxu {reg1}, {reg2}, {reg3}"), "Maxu");
+}
+
+TEST_F(AssemblerRISCV64Test, Rol) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Rol, "rol {reg1}, {reg2}, {reg3}"), "Rol");
+}
+
+TEST_F(AssemblerRISCV64Test, Rolw) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Rolw, "rolw {reg1}, {reg2}, {reg3}"), "Rolw");
+}
+
+TEST_F(AssemblerRISCV64Test, Ror) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Ror, "ror {reg1}, {reg2}, {reg3}"), "Ror");
+}
+
+TEST_F(AssemblerRISCV64Test, Rorw) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::Rorw, "rorw {reg1}, {reg2}, {reg3}"), "Rorw");
+}
+
+TEST_F(AssemblerRISCV64Test, Rori) {
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Rori, 6, "rori {reg1}, {reg2}, {imm}"), "Rori");
+}
+
+TEST_F(AssemblerRISCV64Test, Roriw) {
+  DriverStr(RepeatRRIb(&Riscv64Assembler::Roriw, /*imm_bits=*/ 5, "roriw {reg1}, {reg2}, {imm}"),
+            "Roriw");
+}
+
+TEST_F(AssemblerRISCV64Test, OrcB) {
+  DriverStr(RepeatRR(&Riscv64Assembler::OrcB, "orc.b {reg1}, {reg2}"), "OrcB");
+}
+
+TEST_F(AssemblerRISCV64Test, Rev8) {
+  DriverStr(RepeatRR(&Riscv64Assembler::Rev8, "rev8 {reg1}, {reg2}"), "Rev8");
+}
+
+TEST_F(AssemblerRISCV64Test, ZbbSextB) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRR(&Riscv64Assembler::ZbbSextB, "sext.b {reg1}, {reg2}"), "ZbbSextB");
+}
+
+TEST_F(AssemblerRISCV64Test, ZbbSextH) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRR(&Riscv64Assembler::ZbbSextH, "sext.h {reg1}, {reg2}"), "ZbbSextH");
+}
+
+TEST_F(AssemblerRISCV64Test, ZbbZextH) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRR(&Riscv64Assembler::ZbbZextH, "zext.h {reg1}, {reg2}"), "ZbbZextH");
+}
+
+// Vector Instructions
+
+TEST_F(AssemblerRISCV64Test, VSetvl) {
+  DriverStr(RepeatRRR(&Riscv64Assembler::VSetvl, "vsetvl {reg1}, {reg2}, {reg3}"), "VSetvl");
+}
+
+TEST_F(AssemblerRISCV64Test, VSetivli) {
+  auto replacer = [=](uint32_t uimm, std::string* s) {
+    ReplaceImm(uimm, /*bias=*/ 0, /*multiplier=*/ 1, s);
+  };
+
+  std::vector<int64_t> imms = CreateImmediateValuesBits(5, true);
+
+  DriverStr(TestVSetI(&Riscv64Assembler::VSetivli,
+                      imms,
+                      replacer,
+                      "vsetivli {reg1}, {imm}, {sew}, {lmul}, {vta}, {vma}"),
+            "VSetivli");
+}
+
+TEST_F(AssemblerRISCV64Test, VSetvli) {
+  auto replacer = [=](XRegister reg, std::string* s) {
+    ReplaceReg(REG2_TOKEN, GetRegisterName(reg), s);
+  };
+
+  DriverStr(TestVSetI(&Riscv64Assembler::VSetvli,
+                      GetRegisters(),
+                      replacer,
+                      "vsetvli {reg1}, {reg2}, {sew}, {lmul}, {vta}, {vma}"),
+            "VSetvli");
+}
+
+TEST_F(AssemblerRISCV64Test, VLe8) {
+  DriverStr(RepeatVRVmFiltered(
+                &Riscv64Assembler::VLe8, "vle8.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+            "VLe8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLe16) {
+  DriverStr(RepeatVRVmFiltered(
+                &Riscv64Assembler::VLe16, "vle16.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+            "VLe16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLe32) {
+  DriverStr(RepeatVRVmFiltered(
+                &Riscv64Assembler::VLe32, "vle32.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+            "VLe32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLe64) {
+  DriverStr(RepeatVRVmFiltered(
+                &Riscv64Assembler::VLe64, "vle64.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+            "VLe64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLm) {
+  DriverStr(RepeatVR(&Riscv64Assembler::VLm, "vlm.v {reg1}, ({reg2})"), "VLm");
+}
+
+TEST_F(AssemblerRISCV64Test, VSe8) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSe8, "vse8.v {reg1}, ({reg2}){vm}"), "VSe8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSe16) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSe16, "vse16.v {reg1}, ({reg2}){vm}"), "VSe16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSe32) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSe32, "vse32.v {reg1}, ({reg2}){vm}"), "VSe32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSe64) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSe64, "vse64.v {reg1}, ({reg2}){vm}"), "VSe64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSm) {
+  DriverStr(RepeatVR(&Riscv64Assembler::VSm, "vsm.v {reg1}, ({reg2})"), "VSm");
+}
+
+TEST_F(AssemblerRISCV64Test, VLe8ff) {
+  DriverStr(RepeatVR(&Riscv64Assembler::VLe8ff, "vle8ff.v {reg1}, ({reg2})"), "VLe8ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLe16ff) {
+  DriverStr(RepeatVR(&Riscv64Assembler::VLe16ff, "vle16ff.v {reg1}, ({reg2})"), "VLe16ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLe32ff) {
+  DriverStr(RepeatVR(&Riscv64Assembler::VLe32ff, "vle32ff.v {reg1}, ({reg2})"), "VLe32ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLe64ff) {
+  DriverStr(RepeatVR(&Riscv64Assembler::VLe64ff, "vle64ff.v {reg1}, ({reg2})"), "VLe64ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLse8) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLse8,
+                                "vlse8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLse8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLse16) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLse16,
+                                "vlse16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLse16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLse32) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLse32,
+                                "vlse32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLse32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLse64) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLse64,
+                                "vlse64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLse64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSse8) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSse8, "vsse8.v {reg1}, ({reg2}), {reg3}{vm}"), "VSse8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSse16) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSse16, "vsse16.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSse16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSse32) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSse32, "vsse32.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSse32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSse64) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSse64, "vsse64.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSse64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxei8) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxei8,
+                                "vloxei8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxei16) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxei16,
+                                "vloxei16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxei32) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxei32,
+                                "vloxei32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxei64) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxei64,
+                                "vloxei64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxei8) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxei8,
+                                "vluxei8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxei16) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxei16,
+                                "vluxei16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxei32) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxei32,
+                                "vluxei32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxei64) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxei64,
+                                "vluxei64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxei8) {
+  DriverStr(RepeatVRVVm(&Riscv64Assembler::VSoxei8, "vsoxei8.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSoxei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxei16) {
+  DriverStr(RepeatVRVVm(&Riscv64Assembler::VSoxei16, "vsoxei16.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSoxei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxei32) {
+  DriverStr(RepeatVRVVm(&Riscv64Assembler::VSoxei32, "vsoxei32.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSoxei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxei64) {
+  DriverStr(RepeatVRVVm(&Riscv64Assembler::VSoxei64, "vsoxei64.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSoxei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxei8) {
+  DriverStr(RepeatVRVVm(&Riscv64Assembler::VSuxei8, "vsuxei8.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSuxei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxei16) {
+  DriverStr(RepeatVRVVm(&Riscv64Assembler::VSuxei16, "vsuxei16.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSuxei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxei32) {
+  DriverStr(RepeatVRVVm(&Riscv64Assembler::VSuxei32, "vsuxei32.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSuxei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxei64) {
+  DriverStr(RepeatVRVVm(&Riscv64Assembler::VSuxei64, "vsuxei64.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSuxei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg2e8) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg2e8, "vlseg2e8.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg2e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg2e16) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg2e16, "vlseg2e16.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg2e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg2e32) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg2e32, "vlseg2e32.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg2e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg2e64) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg2e64, "vlseg2e64.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg2e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg3e8) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg3e8, "vlseg3e8.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg3e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg3e16) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg3e16, "vlseg3e16.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg3e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg3e32) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg3e32, "vlseg3e32.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg3e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg3e64) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg3e64, "vlseg3e64.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg3e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg4e8) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg4e8, "vlseg4e8.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg4e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg4e16) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg4e16, "vlseg4e16.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg4e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg4e32) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg4e32, "vlseg4e32.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg4e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg4e64) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg4e64, "vlseg4e64.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg4e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg5e8) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg5e8, "vlseg5e8.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg5e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg5e16) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg5e16, "vlseg5e16.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg5e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg5e32) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg5e32, "vlseg5e32.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg5e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg5e64) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg5e64, "vlseg5e64.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg5e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg6e8) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg6e8, "vlseg6e8.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg6e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg6e16) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg6e16, "vlseg6e16.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg6e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg6e32) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg6e32, "vlseg6e32.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg6e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg6e64) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg6e64, "vlseg6e64.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg6e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg7e8) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg7e8, "vlseg7e8.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg7e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg7e16) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg7e16, "vlseg7e16.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg7e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg7e32) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg7e32, "vlseg7e32.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg7e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg7e64) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg7e64, "vlseg7e64.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg7e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg8e8) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg8e8, "vlseg8e8.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg8e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg8e16) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg8e16, "vlseg8e16.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg8e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg8e32) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg8e32, "vlseg8e32.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg8e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg8e64) {
+  DriverStr(
+      RepeatVRVmFiltered(
+          &Riscv64Assembler::VLseg8e64, "vlseg8e64.v {reg1}, ({reg2}){vm}", SkipV0Vm<XRegister>()),
+      "VLseg8e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg2e8) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg2e8, "vsseg2e8.v {reg1}, ({reg2}){vm}"), "VSseg2e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg2e16) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg2e16, "vsseg2e16.v {reg1}, ({reg2}){vm}"),
+            "VSseg2e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg2e32) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg2e32, "vsseg2e32.v {reg1}, ({reg2}){vm}"),
+            "VSseg2e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg2e64) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg2e64, "vsseg2e64.v {reg1}, ({reg2}){vm}"),
+            "VSseg2e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg3e8) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg3e8, "vsseg3e8.v {reg1}, ({reg2}){vm}"), "VSseg3e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg3e16) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg3e16, "vsseg3e16.v {reg1}, ({reg2}){vm}"),
+            "VSseg3e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg3e32) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg3e32, "vsseg3e32.v {reg1}, ({reg2}){vm}"),
+            "VSseg3e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg3e64) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg3e64, "vsseg3e64.v {reg1}, ({reg2}){vm}"),
+            "VSseg3e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg4e8) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg4e8, "vsseg4e8.v {reg1}, ({reg2}){vm}"), "VSseg4e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg4e16) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg4e16, "vsseg4e16.v {reg1}, ({reg2}){vm}"),
+            "VSseg4e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg4e32) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg4e32, "vsseg4e32.v {reg1}, ({reg2}){vm}"),
+            "VSseg4e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg4e64) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg4e64, "vsseg4e64.v {reg1}, ({reg2}){vm}"),
+            "VSseg4e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg5e8) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg5e8, "vsseg5e8.v {reg1}, ({reg2}){vm}"), "VSseg5e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg5e16) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg5e16, "vsseg5e16.v {reg1}, ({reg2}){vm}"),
+            "VSseg5e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg5e32) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg5e32, "vsseg5e32.v {reg1}, ({reg2}){vm}"),
+            "VSseg5e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg5e64) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg5e64, "vsseg5e64.v {reg1}, ({reg2}){vm}"),
+            "VSseg5e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg6e8) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg6e8, "vsseg6e8.v {reg1}, ({reg2}){vm}"), "VSseg6e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg6e16) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg6e16, "vsseg6e16.v {reg1}, ({reg2}){vm}"),
+            "VSseg6e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg6e32) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg6e32, "vsseg6e32.v {reg1}, ({reg2}){vm}"),
+            "VSseg6e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg6e64) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg6e64, "vsseg6e64.v {reg1}, ({reg2}){vm}"),
+            "VSseg6e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg7e8) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg7e8, "vsseg7e8.v {reg1}, ({reg2}){vm}"), "VSseg7e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg7e16) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg7e16, "vsseg7e16.v {reg1}, ({reg2}){vm}"),
+            "VSseg7e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg7e32) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg7e32, "vsseg7e32.v {reg1}, ({reg2}){vm}"),
+            "VSseg7e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg7e64) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg7e64, "vsseg7e64.v {reg1}, ({reg2}){vm}"),
+            "VSseg7e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg8e8) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg8e8, "vsseg8e8.v {reg1}, ({reg2}){vm}"), "VSseg8e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg8e16) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg8e16, "vsseg8e16.v {reg1}, ({reg2}){vm}"),
+            "VSseg8e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg8e32) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg8e32, "vsseg8e32.v {reg1}, ({reg2}){vm}"),
+            "VSseg8e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSseg8e64) {
+  DriverStr(RepeatVRVm(&Riscv64Assembler::VSseg8e64, "vsseg8e64.v {reg1}, ({reg2}){vm}"),
+            "VSseg8e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg2e8ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg2e8ff,
+                               "vlseg2e8ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg2e8ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg2e16ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg2e16ff,
+                               "vlseg2e16ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg2e16ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg2e32ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg2e32ff,
+                               "vlseg2e32ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg2e32ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg2e64ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg2e64ff,
+                               "vlseg2e64ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg2e64ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg3e8ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg3e8ff,
+                               "vlseg3e8ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg3e8ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg3e16ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg3e16ff,
+                               "vlseg3e16ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg3e16ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg3e32ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg3e32ff,
+                               "vlseg3e32ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg3e32ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg3e64ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg3e64ff,
+                               "vlseg3e64ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg3e64ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg4e8ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg4e8ff,
+                               "vlseg4e8ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg4e8ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg4e16ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg4e16ff,
+                               "vlseg4e16ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg4e16ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg4e32ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg4e32ff,
+                               "vlseg4e32ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg4e32ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg4e64ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg4e64ff,
+                               "vlseg4e64ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg4e64ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg5e8ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg5e8ff,
+                               "vlseg5e8ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg5e8ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg5e16ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg5e16ff,
+                               "vlseg5e16ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg5e16ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg5e32ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg5e32ff,
+                               "vlseg5e32ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg5e32ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg5e64ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg5e64ff,
+                               "vlseg5e64ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg5e64ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg6e8ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg6e8ff,
+                               "vlseg6e8ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg6e8ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg6e16ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg6e16ff,
+                               "vlseg6e16ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg6e16ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg6e32ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg6e32ff,
+                               "vlseg6e32ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg6e32ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg6e64ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg6e64ff,
+                               "vlseg6e64ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg6e64ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg7e8ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg7e8ff,
+                               "vlseg7e8ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg7e8ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg7e16ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg7e16ff,
+                               "vlseg7e16ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg7e16ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg7e32ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg7e32ff,
+                               "vlseg7e32ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg7e32ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg7e64ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg7e64ff,
+                               "vlseg7e64ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg7e64ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg8e8ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg8e8ff,
+                               "vlseg8e8ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg8e8ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg8e16ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg8e16ff,
+                               "vlseg8e16ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg8e16ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg8e32ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg8e32ff,
+                               "vlseg8e32ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg8e32ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLseg8e64ff) {
+  DriverStr(RepeatVRVmFiltered(&Riscv64Assembler::VLseg8e64ff,
+                               "vlseg8e64ff.v {reg1}, ({reg2}){vm}",
+                               SkipV0Vm<XRegister>()),
+            "VLseg8e64ff");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg2e8) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg2e8,
+                                "vlsseg2e8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg2e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg2e16) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg2e16,
+                                "vlsseg2e16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg2e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg2e32) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg2e32,
+                                "vlsseg2e32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg2e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg2e64) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg2e64,
+                                "vlsseg2e64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg2e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg3e8) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg3e8,
+                                "vlsseg3e8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg3e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg3e16) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg3e16,
+                                "vlsseg3e16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg3e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg3e32) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg3e32,
+                                "vlsseg3e32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg3e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg3e64) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg3e64,
+                                "vlsseg3e64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg3e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg4e8) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg4e8,
+                                "vlsseg4e8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg4e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg4e16) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg4e16,
+                                "vlsseg4e16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg4e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg4e32) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg4e32,
+                                "vlsseg4e32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg4e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg4e64) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg4e64,
+                                "vlsseg4e64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg4e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg5e8) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg5e8,
+                                "vlsseg5e8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg5e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg5e16) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg5e16,
+                                "vlsseg5e16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg5e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg5e32) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg5e32,
+                                "vlsseg5e32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg5e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg5e64) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg5e64,
+                                "vlsseg5e64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg5e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg6e8) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg6e8,
+                                "vlsseg6e8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg6e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg6e16) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg6e16,
+                                "vlsseg6e16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg6e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg6e32) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg6e32,
+                                "vlsseg6e32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg6e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg6e64) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg6e64,
+                                "vlsseg6e64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg6e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg7e8) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg7e8,
+                                "vlsseg7e8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg7e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg7e16) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg7e16,
+                                "vlsseg7e16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg7e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg7e32) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg7e32,
+                                "vlsseg7e32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg7e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg7e64) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg7e64,
+                                "vlsseg7e64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg7e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg8e8) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg8e8,
+                                "vlsseg8e8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg8e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg8e16) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg8e16,
+                                "vlsseg8e16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg8e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg8e32) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg8e32,
+                                "vlsseg8e32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg8e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLsseg8e64) {
+  DriverStr(RepeatVRRVmFiltered(&Riscv64Assembler::VLsseg8e64,
+                                "vlsseg8e64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, XRegister>()),
+            "VLsseg8e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg2e8) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg2e8, "vssseg2e8.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg2e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg2e16) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg2e16, "vssseg2e16.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg2e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg2e32) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg2e32, "vssseg2e32.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg2e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg2e64) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg2e64, "vssseg2e64.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg2e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg3e8) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg3e8, "vssseg3e8.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg3e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg3e16) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg3e16, "vssseg3e16.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg3e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg3e32) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg3e32, "vssseg3e32.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg3e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg3e64) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg3e64, "vssseg3e64.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg3e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg4e8) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg4e8, "vssseg4e8.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg4e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg4e16) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg4e16, "vssseg4e16.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg4e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg4e32) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg4e32, "vssseg4e32.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg4e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg4e64) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg4e64, "vssseg4e64.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg4e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg5e8) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg5e8, "vssseg5e8.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg5e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg5e16) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg5e16, "vssseg5e16.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg5e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg5e32) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg5e32, "vssseg5e32.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg5e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg5e64) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg5e64, "vssseg5e64.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg5e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg6e8) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg6e8, "vssseg6e8.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg6e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg6e16) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg6e16, "vssseg6e16.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg6e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg6e32) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg6e32, "vssseg6e32.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg6e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg6e64) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg6e64, "vssseg6e64.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg6e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg7e8) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg7e8, "vssseg7e8.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg7e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg7e16) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg7e16, "vssseg7e16.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg7e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg7e32) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg7e32, "vssseg7e32.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg7e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg7e64) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg7e64, "vssseg7e64.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg7e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg8e8) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg8e8, "vssseg8e8.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg8e8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg8e16) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg8e16, "vssseg8e16.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg8e16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg8e32) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg8e32, "vssseg8e32.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg8e32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsseg8e64) {
+  DriverStr(RepeatVRRVm(&Riscv64Assembler::VSsseg8e64, "vssseg8e64.v {reg1}, ({reg2}), {reg3}{vm}"),
+            "VSsseg8e64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg2ei8) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg2ei8,
+                                "vluxseg2ei8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg2ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg2ei16) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg2ei16,
+                                "vluxseg2ei16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg2ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg2ei32) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg2ei32,
+                                "vluxseg2ei32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg2ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg2ei64) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg2ei64,
+                                "vluxseg2ei64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg2ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg3ei8) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg3ei8,
+                                "vluxseg3ei8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg3ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg3ei16) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg3ei16,
+                                "vluxseg3ei16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg3ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg3ei32) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg3ei32,
+                                "vluxseg3ei32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg3ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg3ei64) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg3ei64,
+                                "vluxseg3ei64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg3ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg4ei8) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg4ei8,
+                                "vluxseg4ei8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg4ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg4ei16) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg4ei16,
+                                "vluxseg4ei16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg4ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg4ei32) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg4ei32,
+                                "vluxseg4ei32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg4ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg4ei64) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg4ei64,
+                                "vluxseg4ei64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg4ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg5ei8) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg5ei8,
+                                "vluxseg5ei8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg5ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg5ei16) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg5ei16,
+                                "vluxseg5ei16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg5ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg5ei32) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg5ei32,
+                                "vluxseg5ei32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg5ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg5ei64) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg5ei64,
+                                "vluxseg5ei64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg5ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg6ei8) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg6ei8,
+                                "vluxseg6ei8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg6ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg6ei16) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg6ei16,
+                                "vluxseg6ei16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg6ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg6ei32) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg6ei32,
+                                "vluxseg6ei32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg6ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg6ei64) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg6ei64,
+                                "vluxseg6ei64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg6ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg7ei8) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg7ei8,
+                                "vluxseg7ei8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg7ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg7ei16) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg7ei16,
+                                "vluxseg7ei16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg7ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg7ei32) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg7ei32,
+                                "vluxseg7ei32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg7ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg7ei64) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg7ei64,
+                                "vluxseg7ei64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg7ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg8ei8) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg8ei8,
+                                "vluxseg8ei8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg8ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg8ei16) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg8ei16,
+                                "vluxseg8ei16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg8ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg8ei32) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg8ei32,
+                                "vluxseg8ei32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg8ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLuxseg8ei64) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLuxseg8ei64,
+                                "vluxseg8ei64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLuxseg8ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg2ei8) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg2ei8, "vsuxseg2ei8.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg2ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg2ei16) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg2ei16, "vsuxseg2ei16.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg2ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg2ei32) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg2ei32, "vsuxseg2ei32.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg2ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg2ei64) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg2ei64, "vsuxseg2ei64.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg2ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg3ei8) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg3ei8, "vsuxseg3ei8.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg3ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg3ei16) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg3ei16, "vsuxseg3ei16.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg3ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg3ei32) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg3ei32, "vsuxseg3ei32.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg3ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg3ei64) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg3ei64, "vsuxseg3ei64.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg3ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg4ei8) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg4ei8, "vsuxseg4ei8.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg4ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg4ei16) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg4ei16, "vsuxseg4ei16.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg4ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg4ei32) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg4ei32, "vsuxseg4ei32.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg4ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg4ei64) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg4ei64, "vsuxseg4ei64.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg4ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg5ei8) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg5ei8, "vsuxseg5ei8.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg5ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg5ei16) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg5ei16, "vsuxseg5ei16.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg5ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg5ei32) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg5ei32, "vsuxseg5ei32.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg5ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg5ei64) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg5ei64, "vsuxseg5ei64.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg5ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg6ei8) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg6ei8, "vsuxseg6ei8.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg6ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg6ei16) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg6ei16, "vsuxseg6ei16.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg6ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg6ei32) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg6ei32, "vsuxseg6ei32.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg6ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg6ei64) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg6ei64, "vsuxseg6ei64.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg6ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg7ei8) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg7ei8, "vsuxseg7ei8.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg7ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg7ei16) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg7ei16, "vsuxseg7ei16.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg7ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg7ei32) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg7ei32, "vsuxseg7ei32.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg7ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg7ei64) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg7ei64, "vsuxseg7ei64.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg7ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg8ei8) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg8ei8, "vsuxseg8ei8.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg8ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg8ei16) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg8ei16, "vsuxseg8ei16.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg8ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg8ei32) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg8ei32, "vsuxseg8ei32.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg8ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSuxseg8ei64) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSuxseg8ei64, "vsuxseg8ei64.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSuxseg8ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg2ei8) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg2ei8,
+                                "vloxseg2ei8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg2ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg2ei16) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg2ei16,
+                                "vloxseg2ei16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg2ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg2ei32) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg2ei32,
+                                "vloxseg2ei32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg2ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg2ei64) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg2ei64,
+                                "vloxseg2ei64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg2ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg3ei8) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg3ei8,
+                                "vloxseg3ei8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg3ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg3ei16) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg3ei16,
+                                "vloxseg3ei16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg3ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg3ei32) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg3ei32,
+                                "vloxseg3ei32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg3ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg3ei64) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg3ei64,
+                                "vloxseg3ei64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg3ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg4ei8) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg4ei8,
+                                "vloxseg4ei8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg4ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg4ei16) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg4ei16,
+                                "vloxseg4ei16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg4ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg4ei32) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg4ei32,
+                                "vloxseg4ei32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg4ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg4ei64) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg4ei64,
+                                "vloxseg4ei64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg4ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg5ei8) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg5ei8,
+                                "vloxseg5ei8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg5ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg5ei16) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg5ei16,
+                                "vloxseg5ei16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg5ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg5ei32) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg5ei32,
+                                "vloxseg5ei32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg5ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg5ei64) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg5ei64,
+                                "vloxseg5ei64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg5ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg6ei8) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg6ei8,
+                                "vloxseg6ei8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg6ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg6ei16) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg6ei16,
+                                "vloxseg6ei16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg6ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg6ei32) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg6ei32,
+                                "vloxseg6ei32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg6ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg6ei64) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg6ei64,
+                                "vloxseg6ei64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg6ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg7ei8) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg7ei8,
+                                "vloxseg7ei8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg7ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg7ei16) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg7ei16,
+                                "vloxseg7ei16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg7ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg7ei32) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg7ei32,
+                                "vloxseg7ei32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg7ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg7ei64) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg7ei64,
+                                "vloxseg7ei64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg7ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg8ei8) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg8ei8,
+                                "vloxseg8ei8.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg8ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg8ei16) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg8ei16,
+                                "vloxseg8ei16.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg8ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg8ei32) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg8ei32,
+                                "vloxseg8ei32.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg8ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VLoxseg8ei64) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VLoxseg8ei64,
+                                "vloxseg8ei64.v {reg1}, ({reg2}), {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VLoxseg8ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg2ei8) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg2ei8, "vsoxseg2ei8.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg2ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg2ei16) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg2ei16, "vsoxseg2ei16.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg2ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg2ei32) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg2ei32, "vsoxseg2ei32.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg2ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg2ei64) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg2ei64, "vsoxseg2ei64.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg2ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg3ei8) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg3ei8, "vsoxseg3ei8.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg3ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg3ei16) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg3ei16, "vsoxseg3ei16.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg3ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg3ei32) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg3ei32, "vsoxseg3ei32.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg3ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg3ei64) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg3ei64, "vsoxseg3ei64.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg3ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg4ei8) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg4ei8, "vsoxseg4ei8.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg4ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg4ei16) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg4ei16, "vsoxseg4ei16.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg4ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg4ei32) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg4ei32, "vsoxseg4ei32.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg4ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg4ei64) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg4ei64, "vsoxseg4ei64.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg4ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg5ei8) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg5ei8, "vsoxseg5ei8.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg5ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg5ei16) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg5ei16, "vsoxseg5ei16.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg5ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg5ei32) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg5ei32, "vsoxseg5ei32.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg5ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg5ei64) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg5ei64, "vsoxseg5ei64.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg5ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg6ei8) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg6ei8, "vsoxseg6ei8.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg6ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg6ei16) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg6ei16, "vsoxseg6ei16.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg6ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg6ei32) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg6ei32, "vsoxseg6ei32.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg6ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg6ei64) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg6ei64, "vsoxseg6ei64.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg6ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg7ei8) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg7ei8, "vsoxseg7ei8.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg7ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg7ei16) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg7ei16, "vsoxseg7ei16.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg7ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg7ei32) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg7ei32, "vsoxseg7ei32.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg7ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg7ei64) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg7ei64, "vsoxseg7ei64.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg7ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg8ei8) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg8ei8, "vsoxseg8ei8.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg8ei8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg8ei16) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg8ei16, "vsoxseg8ei16.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg8ei16");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg8ei32) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg8ei32, "vsoxseg8ei32.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg8ei32");
+}
+
+TEST_F(AssemblerRISCV64Test, VSoxseg8ei64) {
+  DriverStr(
+      RepeatVRVVm(&Riscv64Assembler::VSoxseg8ei64, "vsoxseg8ei64.v {reg1}, ({reg2}), {reg3}{vm}"),
+      "VSoxseg8ei64");
+}
+
+TEST_F(AssemblerRISCV64Test, VL1re8) {
+  DriverStr(
+      RepeatVRAligned(&Riscv64Assembler::VL1re8, /*alignment=*/ 1, "vl1re8.v {reg1}, ({reg2})"),
+      "VL1re8");
+}
+
+TEST_F(AssemblerRISCV64Test, VL1re16) {
+  DriverStr(
+      RepeatVRAligned(&Riscv64Assembler::VL1re16, /*alignment=*/ 1, "vl1re16.v {reg1}, ({reg2})"),
+      "VL1re16");
+}
+
+TEST_F(AssemblerRISCV64Test, VL1re32) {
+  DriverStr(
+      RepeatVRAligned(&Riscv64Assembler::VL1re32, /*alignment=*/ 1, "vl1re32.v {reg1}, ({reg2})"),
+      "VL1re32");
+}
+
+TEST_F(AssemblerRISCV64Test, VL1re64) {
+  DriverStr(
+      RepeatVRAligned(&Riscv64Assembler::VL1re64, /*alignment=*/ 1, "vl1re64.v {reg1}, ({reg2})"),
+      "VL1re64");
+}
+
+TEST_F(AssemblerRISCV64Test, VL2re8) {
+  DriverStr(
+      RepeatVRAligned(&Riscv64Assembler::VL2re8, /*alignment=*/ 2, "vl2re8.v {reg1}, ({reg2})"),
+      "VL2re8");
+}
+
+TEST_F(AssemblerRISCV64Test, VL2re16) {
+  DriverStr(
+      RepeatVRAligned(&Riscv64Assembler::VL2re16, /*alignment=*/ 2, "vl2re16.v {reg1}, ({reg2})"),
+      "VL2re16");
+}
+
+TEST_F(AssemblerRISCV64Test, VL2re32) {
+  DriverStr(
+      RepeatVRAligned(&Riscv64Assembler::VL2re32, /*alignment=*/ 2, "vl2re32.v {reg1}, ({reg2})"),
+      "VL2re32");
+}
+
+TEST_F(AssemblerRISCV64Test, VL2re64) {
+  DriverStr(
+      RepeatVRAligned(&Riscv64Assembler::VL2re64, /*alignment=*/ 2, "vl2re64.v {reg1}, ({reg2})"),
+      "VL2re64");
+}
+
+TEST_F(AssemblerRISCV64Test, VL4re8) {
+  DriverStr(
+      RepeatVRAligned(&Riscv64Assembler::VL4re8, /*alignment=*/ 4, "vl4re8.v {reg1}, ({reg2})"),
+      "VL4re8");
+}
+
+TEST_F(AssemblerRISCV64Test, VL4re16) {
+  DriverStr(
+      RepeatVRAligned(&Riscv64Assembler::VL4re16, /*alignment=*/ 4, "vl4re16.v {reg1}, ({reg2})"),
+      "VL4re16");
+}
+
+TEST_F(AssemblerRISCV64Test, VL4re32) {
+  DriverStr(
+      RepeatVRAligned(&Riscv64Assembler::VL4re32, /*alignment=*/ 4, "vl4re32.v {reg1}, ({reg2})"),
+      "VL4re32");
+}
+
+TEST_F(AssemblerRISCV64Test, VL4re64) {
+  DriverStr(
+      RepeatVRAligned(&Riscv64Assembler::VL4re64, /*alignment=*/ 4, "vl4re64.v {reg1}, ({reg2})"),
+      "VL4re64");
+}
+
+TEST_F(AssemblerRISCV64Test, VL8re8) {
+  DriverStr(
+      RepeatVRAligned(&Riscv64Assembler::VL8re8, /*alignment=*/ 8, "vl8re8.v {reg1}, ({reg2})"),
+      "VL8re8");
+}
+
+TEST_F(AssemblerRISCV64Test, VL8re16) {
+  DriverStr(
+      RepeatVRAligned(&Riscv64Assembler::VL8re16, /*alignment=*/ 8, "vl8re16.v {reg1}, ({reg2})"),
+      "VL8re16");
+}
+
+TEST_F(AssemblerRISCV64Test, VL8re32) {
+  DriverStr(
+      RepeatVRAligned(&Riscv64Assembler::VL8re32, /*alignment=*/ 8, "vl8re32.v {reg1}, ({reg2})"),
+      "VL8re32");
+}
+
+TEST_F(AssemblerRISCV64Test, VL8re64) {
+  DriverStr(
+      RepeatVRAligned(&Riscv64Assembler::VL8re64, /*alignment=*/ 8, "vl8re64.v {reg1}, ({reg2})"),
+      "VL8re64");
+}
+
+TEST_F(AssemblerRISCV64Test, VL1r) {
+  DriverStr(RepeatVRAligned(&Riscv64Assembler::VL1r, /*alignment=*/ 1, "vl1r.v {reg1}, ({reg2})"),
+            "VL1r");
+}
+
+TEST_F(AssemblerRISCV64Test, VL2r) {
+  DriverStr(RepeatVRAligned(&Riscv64Assembler::VL2r, /*alignment=*/ 2, "vl2r.v {reg1}, ({reg2})"),
+            "VL2r");
+}
+
+TEST_F(AssemblerRISCV64Test, VL4r) {
+  DriverStr(RepeatVRAligned(&Riscv64Assembler::VL4r, /*alignment=*/ 4, "vl4r.v {reg1}, ({reg2})"),
+            "VL4r");
+}
+
+TEST_F(AssemblerRISCV64Test, VL8r) {
+  DriverStr(RepeatVRAligned(&Riscv64Assembler::VL8r, /*alignment=*/ 8, "vl8r.v {reg1}, ({reg2})"),
+            "VL8r");
+}
+
+TEST_F(AssemblerRISCV64Test, VS1r) {
+  DriverStr(RepeatVRAligned(&Riscv64Assembler::VS1r, /*alignment=*/ 1, "vs1r.v {reg1}, ({reg2})"),
+            "VS1r");
+}
+
+TEST_F(AssemblerRISCV64Test, VS2r) {
+  DriverStr(RepeatVRAligned(&Riscv64Assembler::VS2r, /*alignment=*/ 2, "vs2r.v {reg1}, ({reg2})"),
+            "VS2r");
+}
+
+TEST_F(AssemblerRISCV64Test, VS4r) {
+  DriverStr(RepeatVRAligned(&Riscv64Assembler::VS4r, /*alignment=*/ 4, "vs4r.v {reg1}, ({reg2})"),
+            "VS4r");
+}
+
+TEST_F(AssemblerRISCV64Test, VS8r) {
+  DriverStr(RepeatVRAligned(&Riscv64Assembler::VS8r, /*alignment=*/ 8, "vs8r.v {reg1}, ({reg2})"),
+            "VS8r");
+}
+
+TEST_F(AssemblerRISCV64Test, VAdd_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VAdd_vv,
+                                "vadd.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VAdd_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VAdd_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VAdd_vx,
+                                "vadd.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VAdd_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VAdd_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VAdd_vi,
+                                 /*imm_bits=*/ -5,
+                                 "vadd.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, int32_t>()),
+            "VAdd_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VSub_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VSub_vv,
+                                "vsub.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VSub_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VSub_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VSub_vx,
+                                "vsub.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VSub_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VRsub_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VRsub_vx,
+                                "vrsub.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VRsub_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VRsub_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VRsub_vi,
+                                 /*imm_bits=*/ -5,
+                                 "vrsub.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, int32_t>()),
+            "VRsub_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VNeg_v) {
+  DriverStr(RepeatVV(&Riscv64Assembler::VNeg_v, "vneg.v {reg1}, {reg2}"), "VNeg_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VMinu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMinu_vv,
+                                "vminu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMinu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMinu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VMinu_vx,
+                                "vminu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VMinu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMin_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMin_vv,
+                                "vmin.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMin_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMin_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VMin_vx,
+                                "vmin.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VMin_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMaxu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMaxu_vv,
+                                "vmaxu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMaxu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMaxu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VMaxu_vx,
+                                "vmaxu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VMaxu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMax_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMax_vv,
+                                "vmax.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMax_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMax_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VMax_vx,
+                                "vmax.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VMax_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VAnd_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VAnd_vv,
+                                "vand.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VAnd_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VAnd_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VAnd_vx,
+                                "vand.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VAnd_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VAnd_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VAnd_vi,
+                                 /*imm_bits=*/ -5,
+                                 "vand.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, int32_t>()),
+            "VAnd_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VOr_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VOr_vv,
+                                "vor.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VOr_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VOr_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VOr_vx,
+                                "vor.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VOr_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VOr_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VOr_vi,
+                                 /*imm_bits=*/ -5,
+                                 "vor.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, int32_t>()),
+            "VOr_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VXor_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VXor_vv,
+                                "vxor.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VXor_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VXor_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VXor_vx,
+                                "vxor.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VXor_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VXor_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VXor_vi,
+                                 /*imm_bits=*/ -5,
+                                 "vxor.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, int32_t>()),
+            "VXor_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VNot_v) {
+  DriverStr(RepeatVVVmFiltered(
+                &Riscv64Assembler::VNot_v, "vnot.v {reg1}, {reg2}{vm}", SkipV0Vm<VRegister>()),
+            "VNot_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VRgather_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VRgather_vv,
+                                "vrgather.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VRgather_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VRgather_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VRgather_vx,
+                                "vrgather.vx {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2Overlap<XRegister>()),
+            "VRgather_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VRgather_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VRgather_vi,
+                                 /*imm_bits=*/ 5,
+                                 "vrgather.vi {reg1}, {reg2}, {imm}{vm}",
+                                 VXVVmSkipV0VmAndNoR1R2Overlap<uint32_t>()),
+            "VRgather_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VSlideup_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VSlideup_vx,
+                                "vslideup.vx {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2Overlap<XRegister>()),
+            "VSlideup_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VSlideup_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VSlideup_vi,
+                                 /*imm_bits=*/ 5,
+                                 "vslideup.vi {reg1}, {reg2}, {imm}{vm}",
+                                 VXVVmSkipV0VmAndNoR1R2Overlap<uint32_t>()),
+            "VSlideup_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VRgatherei16_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VRgatherei16_vv,
+                                "vrgatherei16.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VRgatherei16_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VSlidedown_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VSlidedown_vx,
+                                "vslidedown.vx {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2Overlap<XRegister>()),
+            "VSlidedown_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VSlidedown_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VSlidedown_vi,
+                                 /*imm_bits=*/ 5,
+                                 "vslidedown.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, uint32_t>()),
+            "VSlidedown_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VAdc_vvm) {
+  DriverStr(RepeatVVVFiltered(&Riscv64Assembler::VAdc_vvm,
+                              "vadc.vvm {reg1}, {reg2}, {reg3}, v0",
+                              SkipV0<VRegister, VRegister>()),
+            "VAdc_vvm");
+}
+
+TEST_F(AssemblerRISCV64Test, VAdc_vxm) {
+  DriverStr(RepeatVVRFiltered(&Riscv64Assembler::VAdc_vxm,
+                              "vadc.vxm {reg1}, {reg2}, {reg3}, v0",
+                              SkipV0<VRegister, XRegister>()),
+            "VAdc_vxm");
+}
+
+TEST_F(AssemblerRISCV64Test, VAdc_vim) {
+  DriverStr(RepeatVVIFiltered(&Riscv64Assembler::VAdc_vim,
+                              /*imm_bits=*/ -5,
+                              "vadc.vim {reg1}, {reg2}, {imm}, v0",
+                              SkipV0<VRegister, int32_t>()),
+            "VAdc_vim");
+}
+
+TEST_F(AssemblerRISCV64Test, VMadc_vvm) {
+  DriverStr(RepeatVVV(&Riscv64Assembler::VMadc_vvm, "vmadc.vvm {reg1}, {reg2}, {reg3}, v0"),
+            "VMadc_vvm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMadc_vxm) {
+  DriverStr(RepeatVVR(&Riscv64Assembler::VMadc_vxm, "vmadc.vxm {reg1}, {reg2}, {reg3}, v0"),
+            "VMadc_vxm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMadc_vim) {
+  DriverStr(RepeatVVIb(&Riscv64Assembler::VMadc_vim,
+                       /*imm_bits=*/ -5,
+                       "vmadc.vim {reg1}, {reg2}, {imm}, v0"),
+            "VMadc_vim");
+}
+
+TEST_F(AssemblerRISCV64Test, VMadc_vv) {
+  DriverStr(RepeatVVV(&Riscv64Assembler::VMadc_vv, "vmadc.vv {reg1}, {reg2}, {reg3}"), "VMadc_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMadc_vx) {
+  DriverStr(RepeatVVR(&Riscv64Assembler::VMadc_vx, "vmadc.vx {reg1}, {reg2}, {reg3}"), "VMadc_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMadc_vi) {
+  DriverStr(RepeatVVIb(&Riscv64Assembler::VMadc_vi,
+                       /*imm_bits=*/ -5,
+                       "vmadc.vi {reg1}, {reg2}, {imm}"),
+            "VMadc_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VSbc_vvm) {
+  DriverStr(RepeatVVVFiltered(&Riscv64Assembler::VSbc_vvm,
+                              "vsbc.vvm {reg1}, {reg2}, {reg3}, v0",
+                              SkipV0<VRegister, VRegister>()),
+            "VSbc_vvm");
+}
+
+TEST_F(AssemblerRISCV64Test, VSbc_vxm) {
+  DriverStr(RepeatVVRFiltered(&Riscv64Assembler::VSbc_vxm,
+                              "vsbc.vxm {reg1}, {reg2}, {reg3}, v0",
+                              SkipV0<VRegister, XRegister>()),
+            "VSbc_vxm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsbc_vvm) {
+  DriverStr(RepeatVVV(&Riscv64Assembler::VMsbc_vvm, "vmsbc.vvm {reg1}, {reg2}, {reg3}, v0"),
+            "VMsbc_vvm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsbc_vxm) {
+  DriverStr(RepeatVVR(&Riscv64Assembler::VMsbc_vxm, "vmsbc.vxm {reg1}, {reg2}, {reg3}, v0"),
+            "VMsbc_vxm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsbc_vv) {
+  DriverStr(RepeatVVV(&Riscv64Assembler::VMsbc_vv, "vmsbc.vv {reg1}, {reg2}, {reg3}"), "VMsbc_vvm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsbc_vx) {
+  DriverStr(RepeatVVR(&Riscv64Assembler::VMsbc_vx, "vmsbc.vx {reg1}, {reg2}, {reg3}"), "VMsbc_vxm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMerge_vvm) {
+  DriverStr(RepeatVVVFiltered(&Riscv64Assembler::VMerge_vvm,
+                              "vmerge.vvm {reg1}, {reg2}, {reg3}, v0",
+                              SkipV0<VRegister, VRegister>()),
+            "VMerge_vvm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMerge_vxm) {
+  DriverStr(RepeatVVRFiltered(&Riscv64Assembler::VMerge_vxm,
+                              "vmerge.vxm {reg1}, {reg2}, {reg3}, v0",
+                              SkipV0<VRegister, XRegister>()),
+            "VMerge_vxm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMerge_vim) {
+  DriverStr(RepeatVVIFiltered(&Riscv64Assembler::VMerge_vim,
+                              /*imm_bits=*/ -5,
+                              "vmerge.vim {reg1}, {reg2}, {imm}, v0",
+                              SkipV0<VRegister, int32_t>()),
+            "VMerge_vim");
+}
+
+TEST_F(AssemblerRISCV64Test, VMv_vv) {
+  DriverStr(RepeatVV(&Riscv64Assembler::VMv_vv, "vmv.v.v {reg1}, {reg2}"), "VMmv_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMv_vx) {
+  DriverStr(RepeatVR(&Riscv64Assembler::VMv_vx, "vmv.v.x {reg1}, {reg2}"), "VMv_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMv_vi) {
+  DriverStr(RepeatVIb(&Riscv64Assembler::VMv_vi, /*imm_bits=*/ -5, "vmv.v.i {reg}, {imm}"),
+            "VMv_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VMseq_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMseq_vv,
+                                "vmseq.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMseq_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMseq_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VMseq_vx,
+                                "vmseq.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VMseq_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMseq_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VMseq_vi,
+                                 /*imm_bits=*/ -5,
+                                 "vmseq.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, int32_t>()),
+            "VMseq_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsne_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMsne_vv,
+                                "vmsne.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMsne_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsne_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VMsne_vx,
+                                "vmsne.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VMsne_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsne_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VMsne_vi,
+                                 /*imm_bits=*/ -5,
+                                 "vmsne.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, int32_t>()),
+            "VMsne_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsltu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMsltu_vv,
+                                "vmsltu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMsltu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsltu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VMsltu_vx,
+                                "vmsltu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VMsltu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsgtu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMsgtu_vv,
+                                "vmsgtu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMsgtu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMslt_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMslt_vv,
+                                "vmslt.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMslt_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMslt_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VMslt_vx,
+                                "vmslt.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VMslt_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsgt_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMsgt_vv,
+                                "vmsgt.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMsgt_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsleu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMsleu_vv,
+                                "vmsleu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMsleu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsleu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VMsleu_vx,
+                                "vmsleu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VMsleu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsleu_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VMsleu_vi,
+                                 /*imm_bits=*/ -5,
+                                 "vmsleu.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, int32_t>()),
+            "VMsleu_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsgeu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMsgeu_vv,
+                                "vmsgeu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMsgeu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsltu_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VMsltu_vi,
+                                 /*imm_bits=*/ 4,
+                                 "vmsltu.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, uint32_t>(),
+                                 /*bias=*/ 1),
+            "VMsltu_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsle_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMsle_vv,
+                                "vmsle.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMsle_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsle_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VMsle_vx,
+                                "vmsle.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VMsle_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsle_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VMsle_vi,
+                                 /*imm_bits=*/ -5,
+                                 "vmsle.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, int32_t>()),
+            "VMsle_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsge_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMsge_vv,
+                                "vmsge.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMsge_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMslt_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VMslt_vi,
+                                 /*imm_bits=*/ -5,
+                                 "vmslt.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, int32_t>(),
+                                 /*bias=*/ 1),
+            "VMslt_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsgtu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VMsgtu_vx,
+                                "vmsgtu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VMsgtu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsgtu_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VMsgtu_vi,
+                                 /*imm_bits=*/ -5,
+                                 "vmsgtu.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, int32_t>()),
+            "VMsgtu_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsgeu_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VMsgeu_vi,
+                                 /*imm_bits=*/ 4,
+                                 "vmsgeu.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, uint32_t>(),
+                                 /*bias=*/ 1),
+            "VMsgeu_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsgt_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VMsgt_vx,
+                                "vmsgt.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VMsgt_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsgt_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VMsgt_vi,
+                                 /*imm_bits=*/ -5,
+                                 "vmsgt.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, int32_t>()),
+            "VMsgt_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsge_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VMsge_vi,
+                                 /*imm_bits=*/ -5,
+                                 "vmsge.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, int32_t>(),
+                                 /*bias=*/ 1),
+            "VMsge_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VSaddu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VSaddu_vv,
+                                "vsaddu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VSaddu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VSaddu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VSaddu_vx,
+                                "vsaddu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VSaddu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VSaddu_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VSaddu_vi,
+                                 /*imm_bits=*/ -5,
+                                 "vsaddu.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, int32_t>()),
+            "VSaddu_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VSadd_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VSadd_vv,
+                                "vsadd.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VSadd_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VSadd_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VSadd_vx,
+                                "vsadd.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VSadd_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VSadd_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VSadd_vi,
+                                 /*imm_bits=*/ -5,
+                                 "vsadd.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, int32_t>()),
+            "VSadd_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsubu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VSsubu_vv,
+                                "vssubu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VSsubu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsubu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VSsubu_vx,
+                                "vssubu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VSsubu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsub_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VSsub_vv,
+                                "vssub.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VSsub_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsub_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VSsub_vx,
+                                "vssub.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VSsub_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VSll_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VSll_vv,
+                                "vsll.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VSll_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VSll_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VSll_vx,
+                                "vsll.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VSll_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VSll_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VSll_vi,
+                                 /*imm_bits=*/ 5,
+                                 "vsll.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, uint32_t>()),
+            "VSll_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VSmul_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VSmul_vv,
+                                "vsmul.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VSmul_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VSmul_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VSmul_vx,
+                                "vsmul.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VSmul_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, Vmv1r_v) {
+  DriverStr(RepeatVVAligned(&Riscv64Assembler::Vmv1r_v, /*alignment=*/ 1, "vmv1r.v {reg1}, {reg2}"),
+            "Vmv1r_v");
+}
+
+TEST_F(AssemblerRISCV64Test, Vmv2r_v) {
+  DriverStr(RepeatVVAligned(&Riscv64Assembler::Vmv2r_v, /*alignment=*/ 2, "vmv2r.v {reg1}, {reg2}"),
+            "Vmv2r_v");
+}
+
+TEST_F(AssemblerRISCV64Test, Vmv4r_v) {
+  DriverStr(RepeatVVAligned(&Riscv64Assembler::Vmv4r_v, /*alignment=*/ 4, "vmv4r.v {reg1}, {reg2}"),
+            "Vmv4r_v");
+}
+
+TEST_F(AssemblerRISCV64Test, Vmv8r_v) {
+  DriverStr(RepeatVVAligned(&Riscv64Assembler::Vmv8r_v, /*alignment=*/ 8, "vmv8r.v {reg1}, {reg2}"),
+            "Vmv8r_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VSrl_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VSrl_vv,
+                                "vsrl.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VSrl_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VSrl_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VSrl_vx,
+                                "vsrl.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VSrl_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VSrl_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VSrl_vi,
+                                 /*imm_bits=*/ 5,
+                                 "vsrl.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, uint32_t>()),
+            "VSrl_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VSra_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VSra_vv,
+                                "vsra.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VSra_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VSra_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VSra_vx,
+                                "vsra.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VSra_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VSra_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VSra_vi,
+                                 /*imm_bits=*/ 5,
+                                 "vsra.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, uint32_t>()),
+            "VSra_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsrl_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VSsrl_vv,
+                                "vssrl.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VSsrl_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsrl_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VSsrl_vx,
+                                "vssrl.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VSsrl_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsrl_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VSsrl_vi,
+                                 /*imm_bits=*/ 5,
+                                 "vssrl.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, uint32_t>()),
+            "VSsrl_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsra_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VSsra_vv,
+                                "vssra.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VSsra_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsra_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VSsra_vx,
+                                "vssra.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VSsra_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VSsra_vi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VSsra_vi,
+                                 /*imm_bits=*/ 5,
+                                 "vssra.vi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, uint32_t>()),
+            "VSsra_vi");
+}
+
+TEST_F(AssemblerRISCV64Test, VNsrl_wv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VNsrl_wv,
+                                "vnsrl.wv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VNsrl_wv");
+}
+
+TEST_F(AssemblerRISCV64Test, VNsrl_wx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VNsrl_wx,
+                                "vnsrl.wx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VNsrl_wx");
+}
+
+TEST_F(AssemblerRISCV64Test, VNsrl_wi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VNsrl_wi,
+                                 /*imm_bits=*/ 5,
+                                 "vnsrl.wi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, uint32_t>()),
+            "VNsrl_wi");
+}
+
+TEST_F(AssemblerRISCV64Test, VNcvt_x_x_w) {
+  DriverStr(
+      RepeatVVVmFiltered(
+          &Riscv64Assembler::VNcvt_x_x_w, "vncvt.x.x.w {reg1}, {reg2}{vm}", SkipV0Vm<VRegister>()),
+      "VNcvt_x_x_w");
+}
+
+TEST_F(AssemblerRISCV64Test, VNsra_wv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VNsra_wv,
+                                "vnsra.wv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VNsra_wv");
+}
+
+TEST_F(AssemblerRISCV64Test, VNsra_wx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VNsra_wx,
+                                "vnsra.wx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VNsra_wx");
+}
+
+TEST_F(AssemblerRISCV64Test, VNsra_wi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VNsra_wi,
+                                 /*imm_bits=*/ 5,
+                                 "vnsra.wi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, uint32_t>()),
+            "VNsra_wi");
+}
+
+TEST_F(AssemblerRISCV64Test, VNclipu_wv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VNclipu_wv,
+                                "vnclipu.wv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VNclipu_wv");
+}
+
+TEST_F(AssemblerRISCV64Test, VNclipu_wx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VNclipu_wx,
+                                "vnclipu.wx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VNclipu_wx");
+}
+
+TEST_F(AssemblerRISCV64Test, VNclipu_wi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VNclipu_wi,
+                                 /*imm_bits=*/ 5,
+                                 "vnclipu.wi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, uint32_t>()),
+            "VNclipu_wi");
+}
+
+TEST_F(AssemblerRISCV64Test, VNclip_wv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VNclip_wv,
+                                "vnclip.wv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VNclip_wv");
+}
+
+TEST_F(AssemblerRISCV64Test, VNclip_wx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VNclip_wx,
+                                "vnclip.wx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VNclip_wx");
+}
+
+TEST_F(AssemblerRISCV64Test, VNclip_wi) {
+  DriverStr(RepeatVVIbVmFiltered(&Riscv64Assembler::VNclip_wi,
+                                 /*imm_bits=*/ 5,
+                                 "vnclip.wi {reg1}, {reg2}, {imm}{vm}",
+                                 SkipV0Vm<VRegister, uint32_t>()),
+            "VNclip_wi");
+}
+
+TEST_F(AssemblerRISCV64Test, VWredsumu_vs) {
+  DriverStr(RepeatVVVVm(&Riscv64Assembler::VWredsumu_vs, "vwredsumu.vs {reg1}, {reg2}, {reg3}{vm}"),
+            "VWredsumu_vs");
+}
+
+TEST_F(AssemblerRISCV64Test, VWredsum_vs) {
+  DriverStr(RepeatVVVVm(&Riscv64Assembler::VWredsum_vs, "vwredsum.vs {reg1}, {reg2}, {reg3}{vm}"),
+            "VWredsum_vs");
+}
+
+TEST_F(AssemblerRISCV64Test, VRedsum_vs) {
+  DriverStr(RepeatVVVVm(&Riscv64Assembler::VRedsum_vs, "vredsum.vs {reg1}, {reg2}, {reg3}{vm}"),
+            "VRedsum_vs");
+}
+
+TEST_F(AssemblerRISCV64Test, VRedand_vs) {
+  DriverStr(RepeatVVVVm(&Riscv64Assembler::VRedand_vs, "vredand.vs {reg1}, {reg2}, {reg3}{vm}"),
+            "VRedand_vs");
+}
+
+TEST_F(AssemblerRISCV64Test, VRedor_vs) {
+  DriverStr(RepeatVVVVm(&Riscv64Assembler::VRedor_vs, "vredor.vs {reg1}, {reg2}, {reg3}{vm}"),
+            "VRedor_vs");
+}
+
+TEST_F(AssemblerRISCV64Test, VRedxor_vs) {
+  DriverStr(RepeatVVVVm(&Riscv64Assembler::VRedxor_vs, "vredxor.vs {reg1}, {reg2}, {reg3}{vm}"),
+            "VRedxor_vs");
+}
+
+TEST_F(AssemblerRISCV64Test, VRedminu_vs) {
+  DriverStr(RepeatVVVVm(&Riscv64Assembler::VRedminu_vs, "vredminu.vs {reg1}, {reg2}, {reg3}{vm}"),
+            "VRedminu_vs");
+}
+
+TEST_F(AssemblerRISCV64Test, VRedmin_vs) {
+  DriverStr(RepeatVVVVm(&Riscv64Assembler::VRedmin_vs, "vredmin.vs {reg1}, {reg2}, {reg3}{vm}"),
+            "VRedmin_vs");
+}
+
+TEST_F(AssemblerRISCV64Test, VRedmaxu_vs) {
+  DriverStr(RepeatVVVVm(&Riscv64Assembler::VRedmaxu_vs, "vredmaxu.vs {reg1}, {reg2}, {reg3}{vm}"),
+            "VRedmaxu_vs");
+}
+
+TEST_F(AssemblerRISCV64Test, VRedmax_vs) {
+  DriverStr(RepeatVVVVm(&Riscv64Assembler::VRedmax_vs, "vredmax.vs {reg1}, {reg2}, {reg3}{vm}"),
+            "VRedmax_vs");
+}
+
+TEST_F(AssemblerRISCV64Test, VAaddu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VAaddu_vv,
+                                "vaaddu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VAaddu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VAaddu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VAaddu_vx,
+                                "vaaddu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VAaddu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VAadd_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VAadd_vv,
+                                "vaadd.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VAadd_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VAadd_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VAadd_vx,
+                                "vaadd.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VAadd_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VAsubu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VAsubu_vv,
+                                "vasubu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VAsubu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VAsubu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VAsubu_vx,
+                                "vasubu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VAsubu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VAsub_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VAsub_vv,
+                                "vasub.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VAsub_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VAsub_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VAsub_vx,
+                                "vasub.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VAsub_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VSlide1up_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VSlide1up_vx,
+                                "vslide1up.vx {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2Overlap<XRegister>()),
+            "VSlide1up_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VSlide1down_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VSlide1down_vx,
+                                "vslide1down.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VSlide1down_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VCompress_vm) {
+  DriverStr(RepeatVVVFiltered(&Riscv64Assembler::VCompress_vm,
+                              "vcompress.vm {reg1}, {reg2}, {reg3}",
+                              VVVNoR1R2R3Overlap()),
+            "VCompress_vm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMandn_mm) {
+  DriverStr(RepeatVVV(&Riscv64Assembler::VMandn_mm, "vmandn.mm {reg1}, {reg2}, {reg3}"),
+            "VMandn_mm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMand_mm) {
+  DriverStr(RepeatVVV(&Riscv64Assembler::VMand_mm, "vmand.mm {reg1}, {reg2}, {reg3}"), "VMand_mm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMmv_m) {
+  DriverStr(RepeatVV(&Riscv64Assembler::VMmv_m, "vmmv.m {reg1}, {reg2}"), "VMmv_m");
+}
+
+TEST_F(AssemblerRISCV64Test, VMor_mm) {
+  DriverStr(RepeatVVV(&Riscv64Assembler::VMor_mm, "vmor.mm {reg1}, {reg2}, {reg3}"), "VMor_mm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMxor_mm) {
+  DriverStr(RepeatVVV(&Riscv64Assembler::VMxor_mm, "vmxor.mm {reg1}, {reg2}, {reg3}"), "VMxor_mm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMclr_m) {
+  DriverStr(RepeatV(&Riscv64Assembler::VMclr_m, "vmclr.m {reg}"), "VMclr_m");
+}
+
+TEST_F(AssemblerRISCV64Test, VMorn_mm) {
+  DriverStr(RepeatVVV(&Riscv64Assembler::VMorn_mm, "vmorn.mm {reg1}, {reg2}, {reg3}"), "VMorn_mm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMnand_mm) {
+  DriverStr(RepeatVVV(&Riscv64Assembler::VMnand_mm, "vmnand.mm {reg1}, {reg2}, {reg3}"),
+            "VMnand_m");
+}
+
+TEST_F(AssemblerRISCV64Test, VMnot_m) {
+  DriverStr(RepeatVV(&Riscv64Assembler::VMnot_m, "vmnot.m {reg1}, {reg2}"), "VMnot_m");
+}
+
+TEST_F(AssemblerRISCV64Test, VMnor_mm) {
+  DriverStr(RepeatVVV(&Riscv64Assembler::VMnor_mm, "vmnor.mm {reg1}, {reg2}, {reg3}"), "VMnor_mm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMxnor_mm) {
+  DriverStr(RepeatVVV(&Riscv64Assembler::VMxnor_mm, "vmxnor.mm {reg1}, {reg2}, {reg3}"),
+            "VMxnor_mm");
+}
+
+TEST_F(AssemblerRISCV64Test, VMset_m) {
+  DriverStr(RepeatV(&Riscv64Assembler::VMset_m, "vmset.m {reg}"), "VMset_m");
+}
+
+TEST_F(AssemblerRISCV64Test, VDivu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VDivu_vv,
+                                "vdivu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VDivu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VDivu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VDivu_vx,
+                                "vdivu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VDivu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VDiv_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VDiv_vv,
+                                "vdiv.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VDiv_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VDiv_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VDiv_vx,
+                                "vdiv.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VDiv_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VRemu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VRemu_vv,
+                                "vremu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VRemu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VRemu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VRemu_vx,
+                                "vremu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VRemu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VRem_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VRem_vv,
+                                "vrem.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VRem_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VRem_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VRem_vx,
+                                "vrem.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VRem_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMulhu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMulhu_vv,
+                                "vmulhu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMulhu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMulhu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VMulhu_vx,
+                                "vmulhu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VMulhu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMul_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMul_vv,
+                                "vmul.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMul_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMul_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VMul_vx,
+                                "vmul.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VMul_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMulhsu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMulhsu_vv,
+                                "vmulhsu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMulhsu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMulhsu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VMulhsu_vx,
+                                "vmulhsu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VMulhsu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMulh_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMulh_vv,
+                                "vmulh.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMulh_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMulh_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VMulh_vx,
+                                "vmulh.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VMulh_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMadd_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMadd_vv,
+                                "vmadd.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMadd_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMadd_vx) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VMadd_vx,
+                                "vmadd.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VMadd_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VNmsub_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VNmsub_vv,
+                                "vnmsub.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VNmsub_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VNmsub_vx) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VNmsub_vx,
+                                "vnmsub.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VNmsub_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VMacc_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMacc_vv,
+                                "vmacc.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMacc_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMacc_vx) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VMacc_vx,
+                                "vmacc.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VMacc_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VNmsac_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VNmsac_vv,
+                                "vnmsac.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VNmsac_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VNmsac_vx) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VNmsac_vx,
+                                "vnmsac.vx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<XRegister, VRegister>()),
+            "VNmsac_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VWaddu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VWaddu_vv,
+                                "vwaddu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VWaddu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VWaddu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VWaddu_vx,
+                                "vwaddu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2Overlap<XRegister>()),
+            "VWaddu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VWcvtu_x_x_v) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VWcvtu_x_x_v,
+                               "vwcvtu.x.x.v {reg1}, {reg2}{vm}",
+                               VVVmSkipV0VmAndNoR1R2Overlap()),
+            "VWcvtu_x_x_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VWadd_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VWadd_vv,
+                                "vwadd.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VWadd_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VWadd_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VWadd_vx,
+                                "vwadd.vx {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2Overlap<XRegister>()),
+            "VWadd_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VWcvt_x_x_v) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VWcvt_x_x_v,
+                               "vwcvt.x.x.v {reg1}, {reg2}{vm}",
+                               VVVmSkipV0VmAndNoR1R2Overlap()),
+            "VWcvt_x_x_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VWsubu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VWsubu_vv,
+                                "vwsubu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VWsubu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VWsubu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VWsubu_vx,
+                                "vwsubu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2Overlap<XRegister>()),
+            "VWsubu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VWsub_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VWsub_vv,
+                                "vwsub.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VWsub_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VWsub_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VWsub_vx,
+                                "vwsub.vx {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2Overlap<XRegister>()),
+            "VWsub_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VWaddu_wv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VWaddu_wv,
+                                "vwaddu.wv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R3Overlap<VRegister>()),
+            "VWaddu_wv");
+}
+
+TEST_F(AssemblerRISCV64Test, VWaddu_wx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VWaddu_wx,
+                                "vwaddu.wx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VWaddu_wx");
+}
+
+TEST_F(AssemblerRISCV64Test, VWadd_wv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VWadd_wv,
+                                "vwadd.wv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R3Overlap<VRegister>()),
+            "VWadd_wv");
+}
+
+TEST_F(AssemblerRISCV64Test, VWadd_wx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VWadd_wx,
+                                "vwadd.wx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VWadd_wx");
+}
+
+TEST_F(AssemblerRISCV64Test, VWsubu_wv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VWsubu_wv,
+                                "vwsubu.wv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R3Overlap<VRegister>()),
+            "VWsubu_wv");
+}
+
+TEST_F(AssemblerRISCV64Test, VWsubu_wx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VWsubu_wx,
+                                "vwsubu.wx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VWsubu_wx");
+}
+
+TEST_F(AssemblerRISCV64Test, VWsub_wv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VWsub_wv,
+                                "vwsub.wv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R3Overlap<VRegister>()),
+            "VWsub_wv");
+}
+
+TEST_F(AssemblerRISCV64Test, VWsub_wx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VWsub_wx,
+                                "vwsub.wx {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, XRegister>()),
+            "VWsub_wx");
+}
+
+TEST_F(AssemblerRISCV64Test, VWmulu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VWmulu_vv,
+                                "vwmulu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VWmulu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VWmulu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VWmulu_vx,
+                                "vwmulu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2Overlap<XRegister>()),
+            "VWmulu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VWmulsu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VWmulsu_vv,
+                                "vwmulsu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VWmulsu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VWmulsu_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VWmulsu_vx,
+                                "vwmulsu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2Overlap<XRegister>()),
+            "VWmulsu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VWmul_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VWmul_vv,
+                                "vwmul.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VWmul_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VWmul_vx) {
+  DriverStr(RepeatVVRVmFiltered(&Riscv64Assembler::VWmul_vx,
+                                "vwmul.vx {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2Overlap<XRegister>()),
+            "VWmul_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VWmaccu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VWmaccu_vv,
+                                "vwmaccu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VWmaccu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VWmaccu_vx) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VWmaccu_vx,
+                                "vwmaccu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R3Overlap<XRegister>()),
+            "VWmaccu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VWmacc_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VWmacc_vv,
+                                "vwmacc.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VWmacc_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VWmacc_vx) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VWmacc_vx,
+                                "vwmacc.vx {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R3Overlap<XRegister>()),
+            "VWmacc_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VWmaccus_vx) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VWmaccus_vx,
+                                "vwmaccus.vx {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R3Overlap<XRegister>()),
+            "VWmaccus_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VWmaccsu_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VWmaccsu_vv,
+                                "vwmaccsu.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VWmaccsu_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VWmaccsu_vx) {
+  DriverStr(RepeatVRVVmFiltered(&Riscv64Assembler::VWmaccsu_vx,
+                                "vwmaccsu.vx {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R3Overlap<XRegister>()),
+            "VWmaccsu_vx");
+}
+
+TEST_F(AssemblerRISCV64Test, VFadd_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFadd_vv,
+                                "vfadd.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFadd_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFadd_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFadd_vf,
+                                "vfadd.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VFadd_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFredusum_vs) {
+  DriverStr(RepeatVVVVm(&Riscv64Assembler::VFredusum_vs, "vfredusum.vs {reg1}, {reg2}, {reg3}{vm}"),
+            "VFredusum_vs");
+}
+
+TEST_F(AssemblerRISCV64Test, VFsub_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFsub_vv,
+                                "vfsub.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFsub_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFsub_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFsub_vf,
+                                "vfsub.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VFsub_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFredosum_vs) {
+  DriverStr(RepeatVVVVm(&Riscv64Assembler::VFredosum_vs, "vfredosum.vs {reg1}, {reg2}, {reg3}{vm}"),
+            "VFredosum_vs");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmin_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFmin_vv,
+                                "vfmin.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFmin_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmin_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFmin_vf,
+                                "vfmin.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VFmin_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFredmin_vs) {
+  DriverStr(RepeatVVVVm(&Riscv64Assembler::VFredmin_vs, "vfredmin.vs {reg1}, {reg2}, {reg3}{vm}"),
+            "VFredmin_vs");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmax_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFmax_vv,
+                                "vfmax.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFmax_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmax_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFmax_vf,
+                                "vfmax.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VFmax_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFredmax_vs) {
+  DriverStr(RepeatVVVVm(&Riscv64Assembler::VFredmax_vs, "vfredmax.vs {reg1}, {reg2}, {reg3}{vm}"),
+            "VFredmax_vs");
+}
+
+TEST_F(AssemblerRISCV64Test, VFsgnj_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFsgnj_vv,
+                                "vfsgnj.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFsgnj_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFsgnj_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFsgnj_vf,
+                                "vfsgnj.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VFsgnj_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFsgnjn_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFsgnjn_vv,
+                                "vfsgnjn.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFsgnjn_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFsgnjn_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFsgnjn_vf,
+                                "vfsgnjn.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VFsgnjn_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFneg_v) {
+  DriverStr(RepeatVV(&Riscv64Assembler::VFneg_v, "vfneg.v {reg1}, {reg2}"), "VFneg_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFsgnjx_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFsgnjx_vv,
+                                "vfsgnjx.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFsgnjx_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFsgnjx_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFsgnjx_vf,
+                                "vfsgnjx.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VFsgnjx_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFabs_v) {
+  DriverStr(RepeatVV(&Riscv64Assembler::VFabs_v, "vfabs.v {reg1}, {reg2}"), "VFabs_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFslide1up_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFslide1up_vf,
+                                "vfslide1up.vf {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2Overlap<FRegister>()),
+            "VFslide1up_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFslide1down_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFslide1down_vf,
+                                "vfslide1down.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VFslide1down_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmerge_vfm) {
+  DriverStr(RepeatVVFFiltered(&Riscv64Assembler::VFmerge_vfm,
+                              "vfmerge.vfm {reg1}, {reg2}, {reg3}, v0",
+                              SkipV0<VRegister, FRegister>()),
+            "VFmerge_vfm");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmv_v_f) {
+  DriverStr(RepeatVF(&Riscv64Assembler::VFmv_v_f, "vfmv.v.f {reg1}, {reg2}"), "VFmv_v_f");
+}
+
+TEST_F(AssemblerRISCV64Test, VMfeq_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMfeq_vv,
+                                "vmfeq.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMfeq_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMfeq_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VMfeq_vf,
+                                "vmfeq.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VMfeq_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VMfle_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMfle_vv,
+                                "vmfle.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMfle_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMfle_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VMfle_vf,
+                                "vmfle.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VMfle_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VMfge_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMfge_vv,
+                                "vmfge.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMfge_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMflt_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMflt_vv,
+                                "vmflt.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMflt_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMflt_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VMflt_vf,
+                                "vmflt.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VMflt_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VMfgt_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMfgt_vv,
+                                "vmfgt.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMfgt_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMfne_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VMfne_vv,
+                                "vmfne.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VMfne_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VMfne_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VMfne_vf,
+                                "vmfne.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VMfne_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VMfgt_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VMfgt_vf,
+                                "vmfgt.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VMfgt_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VMfge_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VMfge_vf,
+                                "vmfge.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VMfge_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFdiv_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFdiv_vv,
+                                "vfdiv.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFdiv_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFdiv_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFdiv_vf,
+                                "vfdiv.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VFdiv_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFrdiv_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFrdiv_vf,
+                                "vfrdiv.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VFrdiv_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmul_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFmul_vv,
+                                "vfmul.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFmul_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmul_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFmul_vf,
+                                "vfmul.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VFmul_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFrsub_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFrsub_vf,
+                                "vfrsub.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VFrsub_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmadd_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFmadd_vv,
+                                "vfmadd.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFmadd_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmadd_vf) {
+  DriverStr(RepeatVFVVmFiltered(&Riscv64Assembler::VFmadd_vf,
+                                "vfmadd.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<FRegister, VRegister>()),
+            "VFmadd_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFnmadd_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFnmadd_vv,
+                                "vfnmadd.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFnmadd_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFnmadd_vf) {
+  DriverStr(RepeatVFVVmFiltered(&Riscv64Assembler::VFnmadd_vf,
+                                "vfnmadd.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<FRegister, VRegister>()),
+            "VFnmadd_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmsub_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFmsub_vv,
+                                "vfmsub.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFmsub_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmsub_vf) {
+  DriverStr(RepeatVFVVmFiltered(&Riscv64Assembler::VFmsub_vf,
+                                "vfmsub.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<FRegister, VRegister>()),
+            "VFmsub_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFnmsub_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFnmsub_vv,
+                                "vfnmsub.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFnmsub_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFnmsub_vf) {
+  DriverStr(RepeatVFVVmFiltered(&Riscv64Assembler::VFnmsub_vf,
+                                "vfnmsub.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<FRegister, VRegister>()),
+            "VFnmsub_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmacc_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFmacc_vv,
+                                "vfmacc.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFmacc_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmacc_vf) {
+  DriverStr(RepeatVFVVmFiltered(&Riscv64Assembler::VFmacc_vf,
+                                "vfmacc.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<FRegister, VRegister>()),
+            "VFmacc_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFnmacc_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFnmacc_vv,
+                                "vfnmacc.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFnmacc_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFnmacc_vf) {
+  DriverStr(RepeatVFVVmFiltered(&Riscv64Assembler::VFnmacc_vf,
+                                "vfnmacc.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<FRegister, VRegister>()),
+            "VFnmacc_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmsac_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFmsac_vv,
+                                "vfmsac.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFmsac_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmsac_vf) {
+  DriverStr(RepeatVFVVmFiltered(&Riscv64Assembler::VFmsac_vf,
+                                "vfmsac.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<FRegister, VRegister>()),
+            "VFmsac_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFnmsac_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFnmsac_vv,
+                                "vfnmsac.vv {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFnmsac_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFnmsac_vf) {
+  DriverStr(RepeatVFVVmFiltered(&Riscv64Assembler::VFnmsac_vf,
+                                "vfnmsac.vf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<FRegister, VRegister>()),
+            "VFnmsac_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwadd_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFwadd_vv,
+                                "vfwadd.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VFwadd_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwadd_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFwadd_vf,
+                                "vfwadd.vf {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2Overlap<FRegister>()),
+            "VFwadd_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwredusum_vs) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFwredusum_vs,
+                                "vfwredusum.vs {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, VRegister>()),
+            "VFwredusum_vs");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwsub_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFwsub_vv,
+                                "vfwsub.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VFwsub_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwsub_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFwsub_vf,
+                                "vfwsub.vf {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2Overlap<FRegister>()),
+            "VFwsub_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwredosum_vs) {
+  DriverStr(
+      RepeatVVVVm(&Riscv64Assembler::VFwredosum_vs, "vfwredosum.vs {reg1}, {reg2}, {reg3}{vm}"),
+      "VFwredosum_vs");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwadd_wv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFwadd_wv,
+                                "vfwadd.wv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R3Overlap<VRegister>()),
+            "VFwadd_wv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwadd_wf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFwadd_wf,
+                                "vfwadd.wf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VFwadd_wf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwsub_wv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFwsub_wv,
+                                "vfwsub.wv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R3Overlap<VRegister>()),
+            "VFwsub_wv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwsub_wf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFwsub_wf,
+                                "vfwsub.wf {reg1}, {reg2}, {reg3}{vm}",
+                                SkipV0Vm<VRegister, FRegister>()),
+            "VFwsub_wf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwmul_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFwmul_vv,
+                                "vfwmul.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VFwmul_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwmul_vf) {
+  DriverStr(RepeatVVFVmFiltered(&Riscv64Assembler::VFwmul_vf,
+                                "vfwmul.vf {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2Overlap<FRegister>()),
+            "VFwmul_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwmacc_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFwmacc_vv,
+                                "vfwmacc.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VFwmacc_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwmacc_vf) {
+  DriverStr(RepeatVFVVmFiltered(&Riscv64Assembler::VFwmacc_vf,
+                                "vfwmacc.vf {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R3Overlap<FRegister>()),
+            "VFwmacc_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwnmacc_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFwnmacc_vv,
+                                "vfwnmacc.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VFwnmacc_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwnmacc_vf) {
+  DriverStr(RepeatVFVVmFiltered(&Riscv64Assembler::VFwnmacc_vf,
+                                "vfwnmacc.vf {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R3Overlap<FRegister>()),
+            "VFwnmacc_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwmsac_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFwmsac_vv,
+                                "vfwmsac.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VFwmsac_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwmsac_vf) {
+  DriverStr(RepeatVFVVmFiltered(&Riscv64Assembler::VFwmsac_vf,
+                                "vfwmsac.vf {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R3Overlap<FRegister>()),
+            "VFwmsac_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwnmsac_vv) {
+  DriverStr(RepeatVVVVmFiltered(&Riscv64Assembler::VFwnmsac_vv,
+                                "vfwnmsac.vv {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R2R3Overlap()),
+            "VFwnmsac_vv");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwnmsac_vf) {
+  DriverStr(RepeatVFVVmFiltered(&Riscv64Assembler::VFwnmsac_vf,
+                                "vfwnmsac.vf {reg1}, {reg2}, {reg3}{vm}",
+                                VXVVmSkipV0VmAndNoR1R3Overlap<FRegister>()),
+            "VFwnmsac_vf");
+}
+
+TEST_F(AssemblerRISCV64Test, VMv_s_x) {
+  DriverStr(RepeatVR(&Riscv64Assembler::VMv_s_x, "vmv.s.x {reg1}, {reg2}"), "VMv_s_x");
+}
+
+TEST_F(AssemblerRISCV64Test, VMv_x_s) {
+  DriverStr(RepeatRV(&Riscv64Assembler::VMv_x_s, "vmv.x.s {reg1}, {reg2}"), "VMv_x_s");
+}
+
+TEST_F(AssemblerRISCV64Test, VCpop_m) {
+  DriverStr(RepeatRVVm(&Riscv64Assembler::VCpop_m, "vcpop.m {reg1}, {reg2}{vm}"), "VCpop_m");
+}
+
+TEST_F(AssemblerRISCV64Test, VFirst_m) {
+  DriverStr(RepeatRVVm(&Riscv64Assembler::VFirst_m, "vfirst.m {reg1}, {reg2}{vm}"), "VFirst_m");
+}
+
+TEST_F(AssemblerRISCV64Test, VZext_vf8) {
+  DriverStr(
+      RepeatVVVmFiltered(
+          &Riscv64Assembler::VZext_vf8, "vzext.vf8 {reg1}, {reg2}{vm}", SkipV0Vm<VRegister>()),
+      "VZext_vf8");
+}
+
+TEST_F(AssemblerRISCV64Test, VSext_vf8) {
+  DriverStr(
+      RepeatVVVmFiltered(
+          &Riscv64Assembler::VSext_vf8, "vsext.vf8 {reg1}, {reg2}{vm}", SkipV0Vm<VRegister>()),
+      "VSext_vf8");
+}
+
+TEST_F(AssemblerRISCV64Test, VZext_vf4) {
+  DriverStr(
+      RepeatVVVmFiltered(
+          &Riscv64Assembler::VZext_vf4, "vzext.vf4 {reg1}, {reg2}{vm}", SkipV0Vm<VRegister>()),
+      "VZext_vf4");
+}
+
+TEST_F(AssemblerRISCV64Test, VSext_vf4) {
+  DriverStr(
+      RepeatVVVmFiltered(
+          &Riscv64Assembler::VSext_vf4, "vsext.vf4 {reg1}, {reg2}{vm}", SkipV0Vm<VRegister>()),
+      "VSext_vf4");
+}
+
+TEST_F(AssemblerRISCV64Test, VZext_vf2) {
+  DriverStr(
+      RepeatVVVmFiltered(
+          &Riscv64Assembler::VZext_vf2, "vzext.vf2 {reg1}, {reg2}{vm}", SkipV0Vm<VRegister>()),
+      "VZext_vf2");
+}
+
+TEST_F(AssemblerRISCV64Test, VSext_vf2) {
+  DriverStr(
+      RepeatVVVmFiltered(
+          &Riscv64Assembler::VSext_vf2, "vsext.vf2 {reg1}, {reg2}{vm}", SkipV0Vm<VRegister>()),
+      "VSext_vf2");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmv_s_f) {
+  DriverStr(RepeatVF(&Riscv64Assembler::VFmv_s_f, "vfmv.s.f {reg1}, {reg2}"), "VFmv_s_f");
+}
+
+TEST_F(AssemblerRISCV64Test, VFmv_f_s) {
+  DriverStr(RepeatFV(&Riscv64Assembler::VFmv_f_s, "vfmv.f.s {reg1}, {reg2}"), "VFmv_f_s");
+}
+
+TEST_F(AssemblerRISCV64Test, VFcvt_xu_f_v) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFcvt_xu_f_v,
+                               "vfcvt.xu.f.v {reg1}, {reg2}{vm}",
+                               SkipV0Vm<VRegister>()),
+            "VFcvt_xu_f_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFcvt_x_f_v) {
+  DriverStr(
+      RepeatVVVmFiltered(
+          &Riscv64Assembler::VFcvt_x_f_v, "vfcvt.x.f.v {reg1}, {reg2}{vm}", SkipV0Vm<VRegister>()),
+      "VFcvt_x_f_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFcvt_f_xu_v) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFcvt_f_xu_v,
+                               "vfcvt.f.xu.v {reg1}, {reg2}{vm}",
+                               SkipV0Vm<VRegister>()),
+            "VFcvt_f_xu_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFcvt_f_x_v) {
+  DriverStr(
+      RepeatVVVmFiltered(
+          &Riscv64Assembler::VFcvt_f_x_v, "vfcvt.f.x.v {reg1}, {reg2}{vm}", SkipV0Vm<VRegister>()),
+      "VFcvt_f_x_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFcvt_rtz_xu_f_v) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFcvt_rtz_xu_f_v,
+                               "vfcvt.rtz.xu.f.v {reg1}, {reg2}{vm}",
+                               SkipV0Vm<VRegister>()),
+            "VFcvt_rtz_xu_f_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFcvt_rtz_x_f_v) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFcvt_rtz_x_f_v,
+                               "vfcvt.rtz.x.f.v {reg1}, {reg2}{vm}",
+                               SkipV0Vm<VRegister>()),
+            "VFcvt_rtz_x_f_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwcvt_xu_f_v) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFwcvt_xu_f_v,
+                               "vfwcvt.xu.f.v {reg1}, {reg2}{vm}",
+                               VVVmSkipV0VmAndNoR1R2Overlap()),
+            "VFwcvt_xu_f_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwcvt_x_f_v) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFwcvt_x_f_v,
+                               "vfwcvt.x.f.v {reg1}, {reg2}{vm}",
+                               VVVmSkipV0VmAndNoR1R2Overlap()),
+            "VFwcvt_x_f_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwcvt_f_xu_v) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFwcvt_f_xu_v,
+                               "vfwcvt.f.xu.v {reg1}, {reg2}{vm}",
+                               VVVmSkipV0VmAndNoR1R2Overlap()),
+            "VFwcvt_f_xu_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwcvt_f_x_v) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFwcvt_f_x_v,
+                               "vfwcvt.f.x.v {reg1}, {reg2}{vm}",
+                               VVVmSkipV0VmAndNoR1R2Overlap()),
+            "VFwcvt_f_x_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwcvt_f_f_v) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFwcvt_f_f_v,
+                               "vfwcvt.f.f.v {reg1}, {reg2}{vm}",
+                               VVVmSkipV0VmAndNoR1R2Overlap()),
+            "VFwcvt_f_f_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwcvt_rtz_xu_f_v) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFwcvt_rtz_xu_f_v,
+                               "vfwcvt.rtz.xu.f.v {reg1}, {reg2}{vm}",
+                               VVVmSkipV0VmAndNoR1R2Overlap()),
+            "VFwcvt_rtz_xu_f_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFwcvt_rtz_x_f_v) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFwcvt_rtz_x_f_v,
+                               "vfwcvt.rtz.x.f.v {reg1}, {reg2}{vm}",
+                               VVVmSkipV0VmAndNoR1R2Overlap()),
+            "VFwcvt_rtz_x_f_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFncvt_xu_f_w) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFncvt_xu_f_w,
+                               "vfncvt.xu.f.w {reg1}, {reg2}{vm}",
+                               SkipV0Vm<VRegister>()),
+            "VFncvt_xu_f_w");
+}
+
+TEST_F(AssemblerRISCV64Test, VFncvt_x_f_w) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFncvt_x_f_w,
+                               "vfncvt.x.f.w {reg1}, {reg2}{vm}",
+                               SkipV0Vm<VRegister>()),
+            "VFncvt_x_f_w");
+}
+
+TEST_F(AssemblerRISCV64Test, VFncvt_f_xu_w) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFncvt_f_xu_w,
+                               "vfncvt.f.xu.w {reg1}, {reg2}{vm}",
+                               SkipV0Vm<VRegister>()),
+            "VFncvt_f_xu_w");
+}
+
+TEST_F(AssemblerRISCV64Test, VFncvt_f_x_w) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFncvt_f_x_w,
+                               "vfncvt.f.x.w {reg1}, {reg2}{vm}",
+                               SkipV0Vm<VRegister>()),
+            "VFncvt_f_x_w");
+}
+
+TEST_F(AssemblerRISCV64Test, VFncvt_f_f_w) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFncvt_f_f_w,
+                               "vfncvt.f.f.w {reg1}, {reg2}{vm}",
+                               SkipV0Vm<VRegister>()),
+            "VFncvt_f_f_w");
+}
+
+TEST_F(AssemblerRISCV64Test, VFncvt_rod_f_f_w) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFncvt_rod_f_f_w,
+                               "vfncvt.rod.f.f.w {reg1}, {reg2}{vm}",
+                               SkipV0Vm<VRegister>()),
+            "VFncvt_rod_f_f_w");
+}
+
+TEST_F(AssemblerRISCV64Test, VFncvt_rtz_xu_f_w) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFncvt_rtz_xu_f_w,
+                               "vfncvt.rtz.xu.f.w {reg1}, {reg2}{vm}",
+                               SkipV0Vm<VRegister>()),
+            "VFncvt_rtz_xu_f_w");
+}
+
+TEST_F(AssemblerRISCV64Test, VFncvt_rtz_x_f_w) {
+  DriverStr(RepeatVVVmFiltered(&Riscv64Assembler::VFncvt_rtz_x_f_w,
+                               "vfncvt.rtz.x.f.w {reg1}, {reg2}{vm}",
+                               SkipV0Vm<VRegister>()),
+            "VFncvt_rtz_x_f_w");
+}
+
+TEST_F(AssemblerRISCV64Test, VFsqrt_v) {
+  DriverStr(RepeatVVVmFiltered(
+                &Riscv64Assembler::VFsqrt_v, "vfsqrt.v {reg1}, {reg2}{vm}", SkipV0Vm<VRegister>()),
+            "VFsqrt_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFrsqrt7_v) {
+  DriverStr(
+      RepeatVVVmFiltered(
+          &Riscv64Assembler::VFrsqrt7_v, "vfrsqrt7.v {reg1}, {reg2}{vm}", SkipV0Vm<VRegister>()),
+      "VFrsqrt7_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFrec7_v) {
+  DriverStr(RepeatVVVmFiltered(
+                &Riscv64Assembler::VFrec7_v, "vfrec7.v {reg1}, {reg2}{vm}", SkipV0Vm<VRegister>()),
+            "VFrec7_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VFclass_v) {
+  DriverStr(
+      RepeatVVVmFiltered(
+          &Riscv64Assembler::VFclass_v, "vfclass.v {reg1}, {reg2}{vm}", SkipV0Vm<VRegister>()),
+      "VFclass_v");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsbf_m) {
+  DriverStr(
+      RepeatVVVmFiltered(
+          &Riscv64Assembler::VMsbf_m, "vmsbf.m {reg1}, {reg2}{vm}", VVVmSkipV0VmAndNoR1R2Overlap()),
+      "VMsbf_m");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsof_m) {
+  DriverStr(
+      RepeatVVVmFiltered(
+          &Riscv64Assembler::VMsof_m, "vmsof.m {reg1}, {reg2}{vm}", VVVmSkipV0VmAndNoR1R2Overlap()),
+      "VMsof_m");
+}
+
+TEST_F(AssemblerRISCV64Test, VMsif_m) {
+  DriverStr(
+      RepeatVVVmFiltered(
+          &Riscv64Assembler::VMsif_m, "vmsif.m {reg1}, {reg2}{vm}", VVVmSkipV0VmAndNoR1R2Overlap()),
+      "VMsif_m");
+}
+
+TEST_F(AssemblerRISCV64Test, VIota_m) {
+  DriverStr(
+      RepeatVVVmFiltered(
+          &Riscv64Assembler::VIota_m, "viota.m {reg1}, {reg2}{vm}", VVVmSkipV0VmAndNoR1R2Overlap()),
+      "VIota_m");
+}
+
+TEST_F(AssemblerRISCV64Test, VId_v) {
+  DriverStr(RepeatVVmFiltered(&Riscv64Assembler::VId_v, "vid.v {reg} {vm}", SkipV0Vm()), "VId_v");
+}
+
+// Pseudo instructions.
+TEST_F(AssemblerRISCV64Test, Nop) {
+  ScopedCSuppression scs(this);
+  __ Nop();
+  DriverStr("addi zero,zero,0", "Nop");
+}
+
+TEST_F(AssemblerRISCV64Test, Li) {
+  ScopedMarchOverride smo(this, "-march=rv64imafd");
+  TestLoadConst64("Li",
+                  /*can_use_tmp=*/ false,
+                  [&](XRegister rd, int64_t value) { __ Li(rd, value); });
+}
+
+TEST_F(AssemblerRISCV64Test, Mv) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRR(&Riscv64Assembler::Mv, "addi {reg1}, {reg2}, 0"), "Mv");
+}
+
+TEST_F(AssemblerRISCV64Test, Not) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRR(&Riscv64Assembler::Not, "xori {reg1}, {reg2}, -1"), "Not");
+}
+
+TEST_F(AssemblerRISCV64Test, Neg) {
+  DriverStr(RepeatRR(&Riscv64Assembler::Neg, "sub {reg1}, x0, {reg2}"), "Neg");
+}
+
+TEST_F(AssemblerRISCV64Test, NegW) {
+  DriverStr(RepeatRR(&Riscv64Assembler::NegW, "subw {reg1}, x0, {reg2}"), "Neg");
+}
+
+TEST_F(AssemblerRISCV64Test, SextB) {
+  DriverStr(RepeatRR(&Riscv64Assembler::SextB, "sext.b {reg1}, {reg2}\n"), "SextB");
+}
+
+TEST_F(AssemblerRISCV64Test, SextB_WithoutC) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRR(&Riscv64Assembler::SextB, "sext.b {reg1}, {reg2}\n"), "SextB_WithoutC");
+}
+
+// TODO: Add test `SextB_WithoutZbb` when `Slli()` and `Srai()` auto-forward to 16-bit functions.
+TEST_F(AssemblerRISCV64Test, SextB_WithoutZbbAndC) {
+  ScopedZbbAndCSuppression scs(this);
+  DriverStr(RepeatRR(&Riscv64Assembler::SextB, "sext.b {reg1}, {reg2}\n"), "SextB_WithoutZbbAndC");
+}
+
+TEST_F(AssemblerRISCV64Test, SextH) {
+  DriverStr(RepeatRR(&Riscv64Assembler::SextH, "sext.h {reg1}, {reg2}\n"), "SextH");
+}
+
+TEST_F(AssemblerRISCV64Test, SextH_WithoutC) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRR(&Riscv64Assembler::SextH, "sext.h {reg1}, {reg2}\n"), "SextH_WithoutC");
+}
+
+// TODO: Add test `SextH_WithoutZbb` when `Slli()` and `Srai()` auto-forward to 16-bit functions.
+TEST_F(AssemblerRISCV64Test, SextH_WithoutZbbAndC) {
+  ScopedZbbAndCSuppression scs(this);
+  DriverStr(RepeatRR(&Riscv64Assembler::SextH, "sext.h {reg1}, {reg2}\n"), "SextH_WithoutZbbAndC");
+}
+
+TEST_F(AssemblerRISCV64Test, SextW) {
+  DriverStr(RepeatRR(&Riscv64Assembler::SextW, "sext.w {reg1}, {reg2}\n"), "SextW");
+}
+
+TEST_F(AssemblerRISCV64Test, SextW_WithoutC) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRR(&Riscv64Assembler::SextW, "sext.w {reg1}, {reg2}\n"), "SextW_WithoutC");
+}
+
+TEST_F(AssemblerRISCV64Test, ZextB) {
+  DriverStr(RepeatRR(&Riscv64Assembler::ZextB, "zext.b {reg1}, {reg2}"), "ZextB");
+}
+
+TEST_F(AssemblerRISCV64Test, ZextB_WithoutC) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRR(&Riscv64Assembler::ZextB, "zext.b {reg1}, {reg2}"), "ZextB_WithoutC");
+}
+
+TEST_F(AssemblerRISCV64Test, ZextH) {
+  DriverStr(RepeatRR(&Riscv64Assembler::ZextH, "zext.h {reg1}, {reg2}\n"), "ZextH");
+}
+
+TEST_F(AssemblerRISCV64Test, ZextH_WithoutC) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRR(&Riscv64Assembler::ZextH, "zext.h {reg1}, {reg2}\n"), "ZextH_WithoutC");
+}
+
+// TODO: Add test `ZextH_WithoutZbb` when `Slli()` and `Srli()` auto-forward to 16-bit functions.
+TEST_F(AssemblerRISCV64Test, ZextH_WithoutZbbAndC) {
+  ScopedZbbAndCSuppression scs(this);
+  DriverStr(RepeatRR(&Riscv64Assembler::ZextH, "zext.h {reg1}, {reg2}\n"), "ZextH_WithoutZbbAndC");
+}
+
+TEST_F(AssemblerRISCV64Test, ZextW) {
+  DriverStr(RepeatRR(&Riscv64Assembler::ZextW, "zext.w {reg1}, {reg2}\n"), "ZextW");
+}
+
+TEST_F(AssemblerRISCV64Test, ZextW_WithoutC) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRR(&Riscv64Assembler::ZextW, "zext.w {reg1}, {reg2}\n"), "ZextW_WithoutC");
+}
+
+// TODO: Add test `ZextW_WithoutZba` when `Slli()` and `Srli()` auto-forward to 16-bit functions.
+TEST_F(AssemblerRISCV64Test, ZextW_WithoutZbaAndC) {
+  ScopedZbaAndCSuppression scs(this);
+  DriverStr(RepeatRR(&Riscv64Assembler::ZextW, "zext.w {reg1}, {reg2}\n"), "ZextW_WithoutZbaAndC");
+}
+
+TEST_F(AssemblerRISCV64Test, Seqz) {
+  DriverStr(RepeatRR(&Riscv64Assembler::Seqz, "sltiu {reg1}, {reg2}, 1\n"), "Seqz");
+}
+
+TEST_F(AssemblerRISCV64Test, Snez) {
+  DriverStr(RepeatRR(&Riscv64Assembler::Snez, "sltu {reg1}, zero, {reg2}\n"), "Snez");
+}
+
+TEST_F(AssemblerRISCV64Test, Sltz) {
+  DriverStr(RepeatRR(&Riscv64Assembler::Sltz, "slt {reg1}, {reg2}, zero\n"), "Sltz");
+}
+
+TEST_F(AssemblerRISCV64Test, Sgtz) {
+  DriverStr(RepeatRR(&Riscv64Assembler::Sgtz, "slt {reg1}, zero, {reg2}\n"), "Sgtz");
+}
+
+TEST_F(AssemblerRISCV64Test, FMvS) {
+  DriverStr(RepeatFF(&Riscv64Assembler::FMvS, "fsgnj.s {reg1}, {reg2}, {reg2}\n"), "FMvS");
+}
+
+TEST_F(AssemblerRISCV64Test, FAbsS) {
+  DriverStr(RepeatFF(&Riscv64Assembler::FAbsS, "fsgnjx.s {reg1}, {reg2}, {reg2}\n"), "FAbsS");
+}
+
+TEST_F(AssemblerRISCV64Test, FNegS) {
+  DriverStr(RepeatFF(&Riscv64Assembler::FNegS, "fsgnjn.s {reg1}, {reg2}, {reg2}\n"), "FNegS");
+}
+
+TEST_F(AssemblerRISCV64Test, FMvD) {
+  DriverStr(RepeatFF(&Riscv64Assembler::FMvD, "fsgnj.d {reg1}, {reg2}, {reg2}\n"), "FMvD");
+}
+
+TEST_F(AssemblerRISCV64Test, FAbsD) {
+  DriverStr(RepeatFF(&Riscv64Assembler::FAbsD, "fsgnjx.d {reg1}, {reg2}, {reg2}\n"), "FAbsD");
+}
+
+TEST_F(AssemblerRISCV64Test, FNegD) {
+  DriverStr(RepeatFF(&Riscv64Assembler::FNegD, "fsgnjn.d {reg1}, {reg2}, {reg2}\n"), "FNegD");
+}
+
+TEST_F(AssemblerRISCV64Test, Beqz) {
+  ScopedCSuppression scs(this);
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRIbS(&Riscv64Assembler::Beqz, -11, 2, "beq {reg}, zero, {imm}\n"), "Beqz");
+}
+
+TEST_F(AssemblerRISCV64Test, Bnez) {
+  ScopedCSuppression scs(this);
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRIbS(&Riscv64Assembler::Bnez, -11, 2, "bne {reg}, zero, {imm}\n"), "Bnez");
+}
+
+TEST_F(AssemblerRISCV64Test, Blez) {
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRIbS(&Riscv64Assembler::Blez, -11, 2, "bge zero, {reg}, {imm}\n"), "Blez");
+}
+
+TEST_F(AssemblerRISCV64Test, Bgez) {
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRIbS(&Riscv64Assembler::Bgez, -11, 2, "bge {reg}, zero, {imm}\n"), "Bgez");
+}
+
+TEST_F(AssemblerRISCV64Test, Bltz) {
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRIbS(&Riscv64Assembler::Bltz, -11, 2, "blt {reg}, zero, {imm}\n"), "Bltz");
+}
+
+TEST_F(AssemblerRISCV64Test, Bgtz) {
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRIbS(&Riscv64Assembler::Bgtz, -11, 2, "blt zero, {reg}, {imm}\n"), "Bgtz");
+}
+
+TEST_F(AssemblerRISCV64Test, Bgt) {
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRRIbS(&Riscv64Assembler::Bgt, -11, 2, "blt {reg2}, {reg1}, {imm}\n"), "Bgt");
+}
+
+TEST_F(AssemblerRISCV64Test, Ble) {
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRRIbS(&Riscv64Assembler::Ble, -11, 2, "bge {reg2}, {reg1}, {imm}\n"), "Bge");
+}
+
+TEST_F(AssemblerRISCV64Test, Bgtu) {
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRRIbS(&Riscv64Assembler::Bgtu, -11, 2, "bltu {reg2}, {reg1}, {imm}\n"), "Bgtu");
+}
+
+TEST_F(AssemblerRISCV64Test, Bleu) {
+  // TODO(riscv64): Change "-11, 2" to "-12, 1" for "C" Standard Extension.
+  DriverStr(RepeatRRIbS(&Riscv64Assembler::Bleu, -11, 2, "bgeu {reg2}, {reg1}, {imm}\n"), "Bgeu");
+}
+
+TEST_F(AssemblerRISCV64Test, J) {
+  ScopedCSuppression scs(this);
+  // TODO(riscv64): Change "-19, 2" to "-20, 1" for "C" Standard Extension.
+  DriverStr(RepeatIbS<int32_t>(&Riscv64Assembler::J, -19, 2, "j {imm}\n"), "J");
+}
+
+TEST_F(AssemblerRISCV64Test, JalRA) {
+  // TODO(riscv64): Change "-19, 2" to "-20, 1" for "C" Standard Extension.
+  DriverStr(RepeatIbS<int32_t>(&Riscv64Assembler::Jal, -19, 2, "jal {imm}\n"), "JalRA");
+}
+
+TEST_F(AssemblerRISCV64Test, Jr) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatR(&Riscv64Assembler::Jr, "jr {reg}\n"), "Jr");
+}
+
+TEST_F(AssemblerRISCV64Test, JalrRA) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatR(&Riscv64Assembler::Jalr, "jalr {reg}\n"), "JalrRA");
+}
+
+TEST_F(AssemblerRISCV64Test, Jalr0) {
+  ScopedCSuppression scs(this);
+  DriverStr(RepeatRR(&Riscv64Assembler::Jalr, "jalr {reg1}, {reg2}\n"), "Jalr0");
+}
+
+TEST_F(AssemblerRISCV64Test, Ret) {
+  ScopedCSuppression scs(this);
+  __ Ret();
+  DriverStr("ret\n", "Ret");
+}
+
+TEST_F(AssemblerRISCV64Test, RdCycle) {
+  DriverStr(RepeatR(&Riscv64Assembler::RdCycle, "rdcycle {reg}\n"), "RdCycle");
+}
+
+TEST_F(AssemblerRISCV64Test, RdTime) {
+  DriverStr(RepeatR(&Riscv64Assembler::RdTime, "rdtime {reg}\n"), "RdTime");
+}
+
+TEST_F(AssemblerRISCV64Test, RdInstret) {
+  DriverStr(RepeatR(&Riscv64Assembler::RdInstret, "rdinstret {reg}\n"), "RdInstret");
+}
+
+TEST_F(AssemblerRISCV64Test, Csrr) {
+  TestCsrrXMacro(
+      "Csrr", "csrr {reg}, {csr}", [&](uint32_t csr, XRegister rd) { __ Csrr(rd, csr); });
+}
+
+TEST_F(AssemblerRISCV64Test, Csrw) {
+  TestCsrrXMacro(
+      "Csrw", "csrw {csr}, {reg}", [&](uint32_t csr, XRegister rs) { __ Csrw(csr, rs); });
+}
+
+TEST_F(AssemblerRISCV64Test, Csrs) {
+  TestCsrrXMacro(
+      "Csrs", "csrs {csr}, {reg}", [&](uint32_t csr, XRegister rs) { __ Csrs(csr, rs); });
+}
+
+TEST_F(AssemblerRISCV64Test, Csrc) {
+  TestCsrrXMacro(
+      "Csrc", "csrc {csr}, {reg}", [&](uint32_t csr, XRegister rs) { __ Csrc(csr, rs); });
+}
+
+TEST_F(AssemblerRISCV64Test, Csrwi) {
+  TestCsrrXiMacro(
+      "Csrwi", "csrwi {csr}, {uimm}", [&](uint32_t csr, uint32_t uimm) { __ Csrwi(csr, uimm); });
+}
+
+TEST_F(AssemblerRISCV64Test, Csrsi) {
+  TestCsrrXiMacro(
+      "Csrsi", "csrsi {csr}, {uimm}", [&](uint32_t csr, uint32_t uimm) { __ Csrsi(csr, uimm); });
+}
+
+TEST_F(AssemblerRISCV64Test, Csrci) {
+  TestCsrrXiMacro(
+      "Csrci", "csrci {csr}, {uimm}", [&](uint32_t csr, uint32_t uimm) { __ Csrci(csr, uimm); });
+}
+
+TEST_F(AssemblerRISCV64Test, LoadConst32) {
+  ScopedCSuppression scs(this);
+  // `LoadConst32()` emits the same code sequences as `Li()` for 32-bit values.
+  ScratchRegisterScope srs(GetAssembler());
+  srs.ExcludeXRegister(TMP);
+  srs.ExcludeXRegister(TMP2);
+  DriverStr(RepeatRIb(&Riscv64Assembler::LoadConst32, -32, "li {reg}, {imm}"), "LoadConst32");
+}
+
+TEST_F(AssemblerRISCV64Test, LoadConst64) {
+  ScopedMarchOverride smo(this, "-march=rv64imafd");
+  TestLoadConst64("LoadConst64",
+                  /*can_use_tmp=*/ true,
+                  [&](XRegister rd, int64_t value) { __ LoadConst64(rd, value); });
+}
+
+TEST_F(AssemblerRISCV64Test, AddConst32) {
+  ScopedCSuppression scs(this);
+  auto emit_op = [&](XRegister rd, XRegister rs1, int64_t value) {
+    __ AddConst32(rd, rs1, dchecked_integral_cast<int32_t>(value));
+  };
+  TestAddConst("AddConst32", 32, /*suffix=*/ "w", emit_op);
+}
+
+TEST_F(AssemblerRISCV64Test, AddConst64) {
+  ScopedMarchOverride smo(this, "-march=rv64imafd");
+  auto emit_op = [&](XRegister rd, XRegister rs1, int64_t value) {
+    __ AddConst64(rd, rs1, value);
+  };
+  TestAddConst("AddConst64", 64, /*suffix=*/ "", emit_op);
+}
+
+TEST_F(AssemblerRISCV64Test, BcondForward3KiB) {
+  ScopedCSuppression scs(this);
+  TestBcondForward("BcondForward3KiB", 3 * KB, "1", GetPrintBcond());
+}
+
+TEST_F(AssemblerRISCV64Test, BcondForward3KiBBare) {
+  ScopedCSuppression scs(this);
+  TestBcondForward("BcondForward3KiB", 3 * KB, "1", GetPrintBcond(), /*is_bare=*/ true);
+}
+
+TEST_F(AssemblerRISCV64Test, BcondBackward3KiB) {
+  ScopedCSuppression scs(this);
+  TestBcondBackward("BcondBackward3KiB", 3 * KB, "1", GetPrintBcond());
+}
+
+TEST_F(AssemblerRISCV64Test, BcondBackward3KiBBare) {
+  ScopedCSuppression scs(this);
+  TestBcondBackward("BcondBackward3KiB", 3 * KB, "1", GetPrintBcond(), /*is_bare=*/ true);
+}
+
+TEST_F(AssemblerRISCV64Test, BcondForward5KiB) {
+  ScopedCSuppression scs(this);
+  TestBcondForward("BcondForward5KiB", 5 * KB, "1", GetPrintBcondOppositeAndJ("2"));
+}
+
+TEST_F(AssemblerRISCV64Test, BcondBackward5KiB) {
+  ScopedCSuppression scs(this);
+  TestBcondBackward("BcondBackward5KiB", 5 * KB, "1", GetPrintBcondOppositeAndJ("2"));
+}
+
+TEST_F(AssemblerRISCV64Test, BcondForward2MiB) {
+  ScopedCSuppression scs(this);
+  TestBcondForward("BcondForward2MiB", 2 * MB, "1", GetPrintBcondOppositeAndTail("2", "3"));
+}
+
+TEST_F(AssemblerRISCV64Test, BcondBackward2MiB) {
+  ScopedCSuppression scs(this);
+  TestBcondBackward("BcondBackward2MiB", 2 * MB, "1", GetPrintBcondOppositeAndTail("2", "3"));
+}
+
+TEST_F(AssemblerRISCV64Test, BeqA0A1MaxOffset13Forward) {
+  ScopedCSuppression scs(this);
+  TestBeqA0A1Forward("BeqA0A1MaxOffset13Forward",
+                     MaxOffset13ForwardDistance() - /*BEQ*/ 4u,
+                     "1",
+                     GetPrintBcond());
+}
+
+TEST_F(AssemblerRISCV64Test, BeqA0A1MaxOffset13ForwardBare) {
+  ScopedCSuppression scs(this);
+  TestBeqA0A1Forward("BeqA0A1MaxOffset13ForwardBare",
+                     MaxOffset13ForwardDistance() - /*BEQ*/ 4u,
+                     "1",
+                     GetPrintBcond(),
+                      /*is_bare=*/ true);
+}
+
+TEST_F(AssemblerRISCV64Test, BeqA0A1MaxOffset13Backward) {
+  ScopedCSuppression scs(this);
+  TestBeqA0A1Backward("BeqA0A1MaxOffset13Forward",
+                      MaxOffset13BackwardDistance(),
+                      "1",
+                      GetPrintBcond());
+}
+
+TEST_F(AssemblerRISCV64Test, BeqA0A1MaxOffset13BackwardBare) {
+  ScopedCSuppression scs(this);
+  TestBeqA0A1Backward("BeqA0A1MaxOffset13ForwardBare",
+                      MaxOffset13BackwardDistance(),
+                      "1",
+                      GetPrintBcond(),
+                      /*is_bare=*/ true);
+}
+
+TEST_F(AssemblerRISCV64Test, BeqA0A1OverMaxOffset13Forward) {
+  ScopedCSuppression scs(this);
+  TestBeqA0A1Forward("BeqA0A1OverMaxOffset13Forward",
+                     MaxOffset13ForwardDistance() - /*BEQ*/ 4u + /*Exceed max*/ 4u,
+                     "1",
+                     GetPrintBcondOppositeAndJ("2"));
+}
+
+TEST_F(AssemblerRISCV64Test, BeqA0A1OverMaxOffset13Backward) {
+  ScopedCSuppression scs(this);
+  TestBeqA0A1Backward("BeqA0A1OverMaxOffset13Forward",
+                      MaxOffset13BackwardDistance() + /*Exceed max*/ 4u,
+                      "1",
+                      GetPrintBcondOppositeAndJ("2"));
+}
+
+TEST_F(AssemblerRISCV64Test, BeqA0A1MaxOffset21Forward) {
+  ScopedCSuppression scs(this);
+  TestBeqA0A1Forward("BeqA0A1MaxOffset21Forward",
+                     MaxOffset21ForwardDistance() - /*J*/ 4u,
+                     "1",
+                     GetPrintBcondOppositeAndJ("2"));
+}
+
+TEST_F(AssemblerRISCV64Test, BeqA0A1MaxOffset21Backward) {
+  ScopedCSuppression scs(this);
+  TestBeqA0A1Backward("BeqA0A1MaxOffset21Backward",
+                      MaxOffset21BackwardDistance() - /*BNE*/ 4u,
+                      "1",
+                      GetPrintBcondOppositeAndJ("2"));
+}
+
+TEST_F(AssemblerRISCV64Test, BeqA0A1OverMaxOffset21Forward) {
+  ScopedCSuppression scs(this);
+  TestBeqA0A1Forward("BeqA0A1OverMaxOffset21Forward",
+                     MaxOffset21ForwardDistance() - /*J*/ 4u + /*Exceed max*/ 4u,
+                     "1",
+                     GetPrintBcondOppositeAndTail("2", "3"));
+}
+
+TEST_F(AssemblerRISCV64Test, BeqA0A1OverMaxOffset21Backward) {
+  ScopedCSuppression scs(this);
+  TestBeqA0A1Backward("BeqA0A1OverMaxOffset21Backward",
+                      MaxOffset21BackwardDistance() - /*BNE*/ 4u + /*Exceed max*/ 4u,
+                      "1",
+                      GetPrintBcondOppositeAndTail("2", "3"));
+}
+
+TEST_F(AssemblerRISCV64Test, BeqA0A1AlmostCascade) {
+  ScopedCSuppression scs(this);
+  TestBeqA0A1MaybeCascade("BeqA0A1AlmostCascade", /*cascade=*/ false, GetPrintBcond());
+}
+
+TEST_F(AssemblerRISCV64Test, BeqA0A1Cascade) {
+  ScopedCSuppression scs(this);
+  TestBeqA0A1MaybeCascade(
+      "BeqA0A1AlmostCascade", /*cascade=*/ true, GetPrintBcondOppositeAndJ("1"));
+}
+
+TEST_F(AssemblerRISCV64Test, BcondElimination) {
+  ScopedCSuppression scs(this);
+  Riscv64Label label;
+  __ Bind(&label);
+  __ Nop();
+  for (XRegister reg : GetRegisters()) {
+    __ Bne(reg, reg, &label);
+    __ Blt(reg, reg, &label);
+    __ Bgt(reg, reg, &label);
+    __ Bltu(reg, reg, &label);
+    __ Bgtu(reg, reg, &label);
+  }
+  DriverStr("nop\n", "BcondElimination");
+}
+
+TEST_F(AssemblerRISCV64Test, BcondUnconditional) {
+  ScopedCSuppression scs(this);
+  Riscv64Label label;
+  __ Bind(&label);
+  __ Nop();
+  for (XRegister reg : GetRegisters()) {
+    __ Beq(reg, reg, &label);
+    __ Bge(reg, reg, &label);
+    __ Ble(reg, reg, &label);
+    __ Bleu(reg, reg, &label);
+    __ Bgeu(reg, reg, &label);
+  }
+  std::string expected =
+      "1:\n"
+      "nop\n" +
+      RepeatInsn(5u * GetRegisters().size(), "j 1b\n", []() {});
+  DriverStr(expected, "BcondUnconditional");
+}
+
+TEST_F(AssemblerRISCV64Test, JalRdForward3KiB) {
+  ScopedCSuppression scs(this);
+  TestJalRdForward("JalRdForward3KiB", 3 * KB, "1", GetPrintJalRd());
+}
+
+TEST_F(AssemblerRISCV64Test, JalRdForward3KiBBare) {
+  ScopedCSuppression scs(this);
+  TestJalRdForward("JalRdForward3KiB", 3 * KB, "1", GetPrintJalRd(), /*is_bare=*/ true);
+}
+
+TEST_F(AssemblerRISCV64Test, JalRdBackward3KiB) {
+  ScopedCSuppression scs(this);
+  TestJalRdBackward("JalRdBackward3KiB", 3 * KB, "1", GetPrintJalRd());
+}
+
+TEST_F(AssemblerRISCV64Test, JalRdBackward3KiBBare) {
+  ScopedCSuppression scs(this);
+  TestJalRdBackward("JalRdBackward3KiB", 3 * KB, "1", GetPrintJalRd(), /*is_bare=*/ true);
+}
+
+TEST_F(AssemblerRISCV64Test, JalRdForward2MiB) {
+  ScopedCSuppression scs(this);
+  TestJalRdForward("JalRdForward2MiB", 2 * MB, "1", GetPrintCallRd("2"));
+}
+
+TEST_F(AssemblerRISCV64Test, JalRdBackward2MiB) {
+  ScopedCSuppression scs(this);
+  TestJalRdBackward("JalRdBackward2MiB", 2 * MB, "1", GetPrintCallRd("2"));
+}
+
+TEST_F(AssemblerRISCV64Test, JForward3KiB) {
+  ScopedCSuppression scs(this);
+  TestBuncondForward("JForward3KiB", 3 * KB, "1", GetEmitJ(), GetPrintJ());
+}
+
+TEST_F(AssemblerRISCV64Test, JForward3KiBBare) {
+  ScopedCSuppression scs(this);
+  TestBuncondForward("JForward3KiB", 3 * KB, "1", GetEmitJ(/*is_bare=*/ true), GetPrintJ());
+}
+
+TEST_F(AssemblerRISCV64Test, JBackward3KiB) {
+  ScopedCSuppression scs(this);
+  TestBuncondBackward("JBackward3KiB", 3 * KB, "1", GetEmitJ(), GetPrintJ());
+}
+
+TEST_F(AssemblerRISCV64Test, JBackward3KiBBare) {
+  ScopedCSuppression scs(this);
+  TestBuncondBackward("JBackward3KiB", 3 * KB, "1", GetEmitJ(/*is_bare=*/ true), GetPrintJ());
+}
+
+TEST_F(AssemblerRISCV64Test, JForward2MiB) {
+  ScopedCSuppression scs(this);
+  TestBuncondForward("JForward2MiB", 2 * MB, "1", GetEmitJ(), GetPrintTail("2"));
+}
+
+TEST_F(AssemblerRISCV64Test, JBackward2MiB) {
+  ScopedCSuppression scs(this);
+  TestBuncondBackward("JBackward2MiB", 2 * MB, "1", GetEmitJ(), GetPrintTail("2"));
+}
+
+TEST_F(AssemblerRISCV64Test, JMaxOffset21Forward) {
+  ScopedCSuppression scs(this);
+  TestBuncondForward("JMaxOffset21Forward",
+                     MaxOffset21ForwardDistance() - /*J*/ 4u,
+                     "1",
+                     GetEmitJ(),
+                     GetPrintJ());
+}
+
+TEST_F(AssemblerRISCV64Test, JMaxOffset21ForwardBare) {
+  ScopedCSuppression scs(this);
+  TestBuncondForward("JMaxOffset21Forward",
+                     MaxOffset21ForwardDistance() - /*J*/ 4u,
+                     "1",
+                     GetEmitJ(/*is_bare=*/ true),
+                     GetPrintJ());
+}
+
+TEST_F(AssemblerRISCV64Test, JMaxOffset21Backward) {
+  ScopedCSuppression scs(this);
+  TestBuncondBackward("JMaxOffset21Backward",
+                      MaxOffset21BackwardDistance(),
+                      "1",
+                      GetEmitJ(),
+                      GetPrintJ());
+}
+
+TEST_F(AssemblerRISCV64Test, JMaxOffset21BackwardBare) {
+  ScopedCSuppression scs(this);
+  TestBuncondBackward("JMaxOffset21Backward",
+                      MaxOffset21BackwardDistance(),
+                      "1",
+                      GetEmitJ(/*is_bare=*/ true),
+                      GetPrintJ());
+}
+
+TEST_F(AssemblerRISCV64Test, JOverMaxOffset21Forward) {
+  ScopedCSuppression scs(this);
+  TestBuncondForward("JOverMaxOffset21Forward",
+                     MaxOffset21ForwardDistance() - /*J*/ 4u + /*Exceed max*/ 4u,
+                     "1",
+                     GetEmitJ(),
+                     GetPrintTail("2"));
+}
+
+TEST_F(AssemblerRISCV64Test, JOverMaxOffset21Backward) {
+  ScopedCSuppression scs(this);
+  TestBuncondBackward("JMaxOffset21Backward",
+                      MaxOffset21BackwardDistance() + /*Exceed max*/ 4u,
+                      "1",
+                      GetEmitJ(),
+                      GetPrintTail("2"));
+}
+
+TEST_F(AssemblerRISCV64Test, CallForward3KiB) {
+  ScopedCSuppression scs(this);
+  TestBuncondForward("CallForward3KiB", 3 * KB, "1", GetEmitJal(), GetPrintJal());
+}
+
+TEST_F(AssemblerRISCV64Test, CallBackward3KiB) {
+  ScopedCSuppression scs(this);
+  TestBuncondBackward("CallBackward3KiB", 3 * KB, "1", GetEmitJal(), GetPrintJal());
+}
+
+TEST_F(AssemblerRISCV64Test, CallForward2MiB) {
+  ScopedCSuppression scs(this);
+  TestBuncondForward("CallForward2MiB", 2 * MB, "1", GetEmitJal(), GetPrintCall("2"));
+}
+
+TEST_F(AssemblerRISCV64Test, CallBackward2MiB) {
+  ScopedCSuppression scs(this);
+  TestBuncondBackward("CallBackward2MiB", 2 * MB, "1", GetEmitJal(), GetPrintCall("2"));
+}
+
+TEST_F(AssemblerRISCV64Test, CallMaxOffset21Forward) {
+  ScopedCSuppression scs(this);
+  TestBuncondForward("CallMaxOffset21Forward",
+                     MaxOffset21ForwardDistance() - /*J*/ 4u,
+                     "1",
+                     GetEmitJal(),
+                     GetPrintJal());
+}
+
+TEST_F(AssemblerRISCV64Test, CallMaxOffset21Backward) {
+  ScopedCSuppression scs(this);
+  TestBuncondBackward("CallMaxOffset21Backward",
+                      MaxOffset21BackwardDistance(),
+                      "1",
+                      GetEmitJal(),
+                      GetPrintJal());
+}
+
+TEST_F(AssemblerRISCV64Test, CallOverMaxOffset21Forward) {
+  ScopedCSuppression scs(this);
+  TestBuncondForward("CallOverMaxOffset21Forward",
+                     MaxOffset21ForwardDistance() - /*J*/ 4u + /*Exceed max*/ 4u,
+                     "1",
+                     GetEmitJal(),
+                     GetPrintCall("2"));
+}
+
+TEST_F(AssemblerRISCV64Test, CallOverMaxOffset21Backward) {
+  ScopedCSuppression scs(this);
+  TestBuncondBackward("CallMaxOffset21Backward",
+                      MaxOffset21BackwardDistance() + /*Exceed max*/ 4u,
+                      "1",
+                      GetEmitJal(),
+                      GetPrintCall("2"));
+}
+
+TEST_F(AssemblerRISCV64Test, Loadb) {
+  ScopedCSuppression scs(this);  // Suppress 16-bit instructions for address formation.
+  TestLoadStoreArbitraryOffset("Loadb", "lb", &Riscv64Assembler::Loadb, /*is_store=*/ false);
+}
+
+TEST_F(AssemblerRISCV64Test, Loadh) {
+  ScopedCSuppression scs(this);
+  TestLoadStoreArbitraryOffset("Loadh", "lh", &Riscv64Assembler::Loadh, /*is_store=*/ false);
+}
+
+TEST_F(AssemblerRISCV64Test, Loadw) {
+  ScopedCSuppression scs(this);
+  TestLoadStoreArbitraryOffset("Loadw", "lw", &Riscv64Assembler::Loadw, /*is_store=*/ false);
+}
+
+TEST_F(AssemblerRISCV64Test, Loadd) {
+  ScopedCSuppression scs(this);
+  TestLoadStoreArbitraryOffset("Loadd", "ld", &Riscv64Assembler::Loadd, /*is_store=*/ false);
+}
+
+TEST_F(AssemblerRISCV64Test, Loadbu) {
+  ScopedCSuppression scs(this);
+  TestLoadStoreArbitraryOffset("Loadbu", "lbu", &Riscv64Assembler::Loadbu, /*is_store=*/ false);
+}
+
+TEST_F(AssemblerRISCV64Test, Loadhu) {
+  ScopedCSuppression scs(this);
+  TestLoadStoreArbitraryOffset("Loadhu", "lhu", &Riscv64Assembler::Loadhu, /*is_store=*/ false);
+}
+
+TEST_F(AssemblerRISCV64Test, Loadwu) {
+  ScopedCSuppression scs(this);  // Suppress 16-bit instructions for address formation.
+  TestLoadStoreArbitraryOffset("Loadwu", "lwu", &Riscv64Assembler::Loadwu, /*is_store=*/ false);
+}
+
+TEST_F(AssemblerRISCV64Test, Storeb) {
+  ScopedCSuppression scs(this);
+  TestLoadStoreArbitraryOffset("Storeb", "sb", &Riscv64Assembler::Storeb, /*is_store=*/ true);
+}
+
+TEST_F(AssemblerRISCV64Test, Storeh) {
+  ScopedCSuppression scs(this);
+  TestLoadStoreArbitraryOffset("Storeh", "sh", &Riscv64Assembler::Storeh, /*is_store=*/ true);
+}
+
+TEST_F(AssemblerRISCV64Test, Storew) {
+  ScopedCSuppression scs(this);
+  TestLoadStoreArbitraryOffset("Storew", "sw", &Riscv64Assembler::Storew, /*is_store=*/ true);
+}
+
+TEST_F(AssemblerRISCV64Test, Stored) {
+  ScopedCSuppression scs(this);
+  TestLoadStoreArbitraryOffset("Stored", "sd", &Riscv64Assembler::Stored, /*is_store=*/ true);
+}
+
+TEST_F(AssemblerRISCV64Test, FLoadw) {
+  ScopedCSuppression scs(this);  // Suppress 16-bit instructions for address formation.
+  TestFPLoadStoreArbitraryOffset("FLoadw", "flw", &Riscv64Assembler::FLoadw);
+}
+
+TEST_F(AssemblerRISCV64Test, FLoadd) {
+  ScopedCSuppression scs(this);
+  TestFPLoadStoreArbitraryOffset("FLoadd", "fld", &Riscv64Assembler::FLoadd);
+}
+
+TEST_F(AssemblerRISCV64Test, FStorew) {
+  ScopedCSuppression scs(this);  // Suppress 16-bit instructions for address formation.
+  TestFPLoadStoreArbitraryOffset("FStorew", "fsw", &Riscv64Assembler::FStorew);
+}
+
+TEST_F(AssemblerRISCV64Test, FStored) {
+  ScopedCSuppression scs(this);
+  TestFPLoadStoreArbitraryOffset("FStored", "fsd", &Riscv64Assembler::FStored);
+}
+
+TEST_F(AssemblerRISCV64Test, Unimp) {
+  ScopedCSuppression scs(this);
+  __ Unimp();
+  DriverStr("unimp\n", "Unimp");
+}
+
+TEST_F(AssemblerRISCV64Test, LoadLabelAddress) {
+  std::string expected;
+  constexpr size_t kNumLoadsForward = 4 * KB;
+  constexpr size_t kNumLoadsBackward = 4 * KB;
+  Riscv64Label label;
+  auto emit_batch = [&](size_t num_loads, const std::string& target_label) {
+    for (size_t i = 0; i != num_loads; ++i) {
+      // Cycle through non-Zero registers.
+      XRegister rd = enum_cast<XRegister>((i % (kNumberOfXRegisters - 1)) + 1);
+      DCHECK_NE(rd, Zero);
+      std::string rd_name = GetRegisterName(rd);
+      __ LoadLabelAddress(rd, &label);
+      expected += "1:\n";
+      expected += ART_FORMAT("auipc {}, %pcrel_hi({})\n", rd_name, target_label);
+      expected += ART_FORMAT("addi {}, {}, %pcrel_lo(1b)\n", rd_name, rd_name);
+    }
+  };
+  emit_batch(kNumLoadsForward, "2f");
+  __ Bind(&label);
+  expected += "2:\n";
+  emit_batch(kNumLoadsBackward, "2b");
+  DriverStr(expected, "LoadLabelAddress");
+}
+
+TEST_F(AssemblerRISCV64Test, LoadLiteralWithPaddingForLong) {
+  ScopedCSuppression scs(this);
+  TestLoadLiteral("LoadLiteralWithPaddingForLong", /*with_padding_for_long=*/ true);
+}
+
+TEST_F(AssemblerRISCV64Test, LoadLiteralWithoutPaddingForLong) {
+  ScopedCSuppression scs(this);
+  TestLoadLiteral("LoadLiteralWithoutPaddingForLong", /*with_padding_for_long=*/ false);
+}
+
+TEST_F(AssemblerRISCV64Test, JumpTable) {
+  ScopedCSuppression scs(this);
+  std::string expected;
+  expected += EmitNops(sizeof(uint32_t));
+  Riscv64Label targets[4];
+  uint32_t target_locations[4];
+  JumpTable* jump_table = __ CreateJumpTable(ArenaVector<Riscv64Label*>(
+      {&targets[0], &targets[1], &targets[2], &targets[3]}, __ GetAllocator()->Adapter()));
+  for (size_t i : {0, 1, 2, 3}) {
+    target_locations[i] = __ CodeSize();
+    __ Bind(&targets[i]);
+    expected += std::to_string(i) + ":\n";
+    expected += EmitNops(sizeof(uint32_t));
+  }
+  __ LoadLabelAddress(A0, jump_table->GetLabel());
+  expected += "4:\n"
+              "auipc a0, %pcrel_hi(5f)\n"
+              "addi a0, a0, %pcrel_lo(4b)\n";
+  expected += EmitNops(sizeof(uint32_t));
+  uint32_t label5_location = __ CodeSize();
+  auto target_offset = [&](size_t i) {
+    // Even with `-mno-relax`, clang assembler does not fully resolve `.4byte 0b - 5b`
+    // and emits a relocation, so we need to calculate target offsets ourselves.
+    return std::to_string(static_cast<int64_t>(target_locations[i] - label5_location));
+  };
+  expected += "5:\n"
+              ".4byte " + target_offset(0) + "\n"
+              ".4byte " + target_offset(1) + "\n"
+              ".4byte " + target_offset(2) + "\n"
+              ".4byte " + target_offset(3) + "\n";
+  DriverStr(expected, "JumpTable");
+}
+
+TEST_F(AssemblerRISCV64Test, ScratchRegisters) {
+  ScratchRegisterScope srs(GetAssembler());
+  ASSERT_EQ(2u, srs.AvailableXRegisters());  // Default: TMP(T6) and TMP2(T5).
+  ASSERT_EQ(1u, srs.AvailableFRegisters());  // Default: FTMP(FT11).
+
+  XRegister tmp = srs.AllocateXRegister();
+  EXPECT_EQ(TMP, tmp);
+  XRegister tmp2 = srs.AllocateXRegister();
+  EXPECT_EQ(TMP2, tmp2);
+  ASSERT_EQ(0u, srs.AvailableXRegisters());
+
+  FRegister ftmp = srs.AllocateFRegister();
+  EXPECT_EQ(FTMP, ftmp);
+  ASSERT_EQ(0u, srs.AvailableFRegisters());
+
+  // Test nesting.
+  srs.FreeXRegister(A0);
+  srs.FreeXRegister(A1);
+  srs.FreeFRegister(FA0);
+  srs.FreeFRegister(FA1);
+  ASSERT_EQ(2u, srs.AvailableXRegisters());
+  ASSERT_EQ(2u, srs.AvailableFRegisters());
+  {
+    ScratchRegisterScope srs2(GetAssembler());
+    ASSERT_EQ(2u, srs2.AvailableXRegisters());
+    ASSERT_EQ(2u, srs2.AvailableFRegisters());
+    XRegister a1 = srs2.AllocateXRegister();
+    EXPECT_EQ(A1, a1);
+    XRegister a0 = srs2.AllocateXRegister();
+    EXPECT_EQ(A0, a0);
+    ASSERT_EQ(0u, srs2.AvailableXRegisters());
+    FRegister fa1 = srs2.AllocateFRegister();
+    EXPECT_EQ(FA1, fa1);
+    FRegister fa0 = srs2.AllocateFRegister();
+    EXPECT_EQ(FA0, fa0);
+    ASSERT_EQ(0u, srs2.AvailableFRegisters());
+  }
+  ASSERT_EQ(2u, srs.AvailableXRegisters());
+  ASSERT_EQ(2u, srs.AvailableFRegisters());
+
+  srs.IncludeXRegister(A0);  // No-op as the register was already available.
+  ASSERT_EQ(2u, srs.AvailableXRegisters());
+  srs.IncludeFRegister(FA0);  // No-op as the register was already available.
+  ASSERT_EQ(2u, srs.AvailableFRegisters());
+  srs.IncludeXRegister(S0);
+  ASSERT_EQ(3u, srs.AvailableXRegisters());
+  srs.IncludeFRegister(FS0);
+  ASSERT_EQ(3u, srs.AvailableFRegisters());
+
+  srs.ExcludeXRegister(S1);  // No-op as the register was not available.
+  ASSERT_EQ(3u, srs.AvailableXRegisters());
+  srs.ExcludeFRegister(FS1);  // No-op as the register was not available.
+  ASSERT_EQ(3u, srs.AvailableFRegisters());
+  srs.ExcludeXRegister(A0);
+  ASSERT_EQ(2u, srs.AvailableXRegisters());
+  srs.ExcludeFRegister(FA0);
+  ASSERT_EQ(2u, srs.AvailableFRegisters());
+}
+
+#undef __
+
+}  // namespace riscv64
+}  // namespace art
diff --git a/compiler/utils/riscv64/jni_macro_assembler_riscv64.cc b/compiler/utils/riscv64/jni_macro_assembler_riscv64.cc
new file mode 100644
index 0000000..e2ef9c4
--- /dev/null
+++ b/compiler/utils/riscv64/jni_macro_assembler_riscv64.cc
@@ -0,0 +1,652 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "jni_macro_assembler_riscv64.h"
+
+#include "base/bit_utils_iterator.h"
+#include "dwarf/register.h"
+#include "entrypoints/quick/quick_entrypoints.h"
+#include "gc_root.h"
+#include "indirect_reference_table.h"
+#include "lock_word.h"
+#include "managed_register_riscv64.h"
+#include "offsets.h"
+#include "stack_reference.h"
+#include "thread.h"
+
+namespace art HIDDEN {
+namespace riscv64 {
+
+static constexpr size_t kSpillSize = 8;  // Both GPRs and FPRs
+
+static std::pair<uint32_t, uint32_t> GetCoreAndFpSpillMasks(
+    ArrayRef<const ManagedRegister> callee_save_regs) {
+  uint32_t core_spill_mask = 0u;
+  uint32_t fp_spill_mask = 0u;
+  for (ManagedRegister r : callee_save_regs) {
+    Riscv64ManagedRegister reg = r.AsRiscv64();
+    if (reg.IsXRegister()) {
+      core_spill_mask |= 1u << reg.AsXRegister();
+    } else {
+      DCHECK(reg.IsFRegister());
+      fp_spill_mask |= 1u << reg.AsFRegister();
+    }
+  }
+  DCHECK_EQ(callee_save_regs.size(),
+            dchecked_integral_cast<size_t>(POPCOUNT(core_spill_mask) + POPCOUNT(fp_spill_mask)));
+  return {core_spill_mask, fp_spill_mask};
+}
+
+#define __ asm_.
+
+Riscv64JNIMacroAssembler::~Riscv64JNIMacroAssembler() {
+}
+
+void Riscv64JNIMacroAssembler::FinalizeCode() {
+  __ FinalizeCode();
+}
+
+void Riscv64JNIMacroAssembler::BuildFrame(size_t frame_size,
+                                          ManagedRegister method_reg,
+                                          ArrayRef<const ManagedRegister> callee_save_regs) {
+  // Increase frame to required size.
+  DCHECK_ALIGNED(frame_size, kStackAlignment);
+  // Must at least have space for Method* if we're going to spill it.
+  DCHECK_GE(frame_size,
+            (callee_save_regs.size() + (method_reg.IsRegister() ? 1u : 0u)) * kSpillSize);
+  IncreaseFrameSize(frame_size);
+
+  // Save callee-saves.
+  auto [core_spill_mask, fp_spill_mask] = GetCoreAndFpSpillMasks(callee_save_regs);
+  size_t offset = frame_size;
+  if ((core_spill_mask & (1u << RA)) != 0u) {
+    offset -= kSpillSize;
+    __ Stored(RA, SP, offset);
+    __ cfi().RelOffset(dwarf::Reg::Riscv64Core(RA), offset);
+  }
+  for (uint32_t reg : HighToLowBits(core_spill_mask & ~(1u << RA))) {
+    offset -= kSpillSize;
+    __ Stored(enum_cast<XRegister>(reg), SP, offset);
+    __ cfi().RelOffset(dwarf::Reg::Riscv64Core(enum_cast<XRegister>(reg)), offset);
+  }
+  for (uint32_t reg : HighToLowBits(fp_spill_mask)) {
+    offset -= kSpillSize;
+    __ FStored(enum_cast<FRegister>(reg), SP, offset);
+    __ cfi().RelOffset(dwarf::Reg::Riscv64Fp(enum_cast<FRegister>(reg)), offset);
+  }
+
+  if (method_reg.IsRegister()) {
+    // Write ArtMethod*.
+    DCHECK_EQ(A0, method_reg.AsRiscv64().AsXRegister());
+    __ Stored(A0, SP, 0);
+  }
+}
+
+void Riscv64JNIMacroAssembler::RemoveFrame(size_t frame_size,
+                                           ArrayRef<const ManagedRegister> callee_save_regs,
+                                           [[maybe_unused]] bool may_suspend) {
+  cfi().RememberState();
+
+  // Restore callee-saves.
+  auto [core_spill_mask, fp_spill_mask] = GetCoreAndFpSpillMasks(callee_save_regs);
+  size_t offset = frame_size - callee_save_regs.size() * kSpillSize;
+  for (uint32_t reg : LowToHighBits(fp_spill_mask)) {
+    __ FLoadd(enum_cast<FRegister>(reg), SP, offset);
+    __ cfi().Restore(dwarf::Reg::Riscv64Fp(enum_cast<FRegister>(reg)));
+    offset += kSpillSize;
+  }
+  for (uint32_t reg : LowToHighBits(core_spill_mask & ~(1u << RA))) {
+    __ Loadd(enum_cast<XRegister>(reg), SP, offset);
+    __ cfi().Restore(dwarf::Reg::Riscv64Core(enum_cast<XRegister>(reg)));
+    offset += kSpillSize;
+  }
+  if ((core_spill_mask & (1u << RA)) != 0u) {
+    __ Loadd(RA, SP, offset);
+    __ cfi().Restore(dwarf::Reg::Riscv64Core(RA));
+    offset += kSpillSize;
+  }
+  DCHECK_EQ(offset, frame_size);
+
+  // Decrease the frame size.
+  DecreaseFrameSize(frame_size);
+
+  // Return to RA.
+  __ Ret();
+
+  // The CFI should be restored for any code that follows the exit block.
+  __ cfi().RestoreState();
+  __ cfi().DefCFAOffset(frame_size);
+}
+
+void Riscv64JNIMacroAssembler::IncreaseFrameSize(size_t adjust) {
+  if (adjust != 0u) {
+    CHECK_ALIGNED(adjust, kStackAlignment);
+    int64_t adjustment = dchecked_integral_cast<int64_t>(adjust);
+    __ AddConst64(SP, SP, -adjustment);
+    __ cfi().AdjustCFAOffset(adjustment);
+  }
+}
+
+void Riscv64JNIMacroAssembler::DecreaseFrameSize(size_t adjust) {
+  if (adjust != 0u) {
+    CHECK_ALIGNED(adjust, kStackAlignment);
+    int64_t adjustment = dchecked_integral_cast<int64_t>(adjust);
+    __ AddConst64(SP, SP, adjustment);
+    __ cfi().AdjustCFAOffset(-adjustment);
+  }
+}
+
+ManagedRegister Riscv64JNIMacroAssembler::CoreRegisterWithSize(ManagedRegister src, size_t size) {
+  DCHECK(src.AsRiscv64().IsXRegister());
+  DCHECK(size == 4u || size == 8u) << size;
+  return src;
+}
+
+void Riscv64JNIMacroAssembler::Store(FrameOffset offs, ManagedRegister m_src, size_t size) {
+  Store(Riscv64ManagedRegister::FromXRegister(SP), MemberOffset(offs.Int32Value()), m_src, size);
+}
+
+void Riscv64JNIMacroAssembler::Store(ManagedRegister m_base,
+                                     MemberOffset offs,
+                                     ManagedRegister m_src,
+                                     size_t size) {
+  Riscv64ManagedRegister base = m_base.AsRiscv64();
+  Riscv64ManagedRegister src = m_src.AsRiscv64();
+  if (src.IsXRegister()) {
+    if (size == 4u) {
+      __ Storew(src.AsXRegister(), base.AsXRegister(), offs.Int32Value());
+    } else {
+      CHECK_EQ(8u, size);
+      __ Stored(src.AsXRegister(), base.AsXRegister(), offs.Int32Value());
+    }
+  } else {
+    CHECK(src.IsFRegister()) << src;
+    if (size == 4u) {
+      __ FStorew(src.AsFRegister(), base.AsXRegister(), offs.Int32Value());
+    } else {
+      CHECK_EQ(8u, size);
+      __ FStored(src.AsFRegister(), base.AsXRegister(), offs.Int32Value());
+    }
+  }
+}
+
+void Riscv64JNIMacroAssembler::StoreRawPtr(FrameOffset offs, ManagedRegister m_src) {
+  Riscv64ManagedRegister sp = Riscv64ManagedRegister::FromXRegister(SP);
+  Store(sp, MemberOffset(offs.Int32Value()), m_src, static_cast<size_t>(kRiscv64PointerSize));
+}
+
+void Riscv64JNIMacroAssembler::StoreStackPointerToThread(ThreadOffset64 offs, bool tag_sp) {
+  XRegister src = SP;
+  ScratchRegisterScope srs(&asm_);
+  if (tag_sp) {
+    XRegister tmp = srs.AllocateXRegister();
+    __ Ori(tmp, SP, 0x2);
+    src = tmp;
+  }
+  __ Stored(src, TR, offs.Int32Value());
+}
+
+void Riscv64JNIMacroAssembler::Load(ManagedRegister m_dest, FrameOffset offs, size_t size) {
+  Riscv64ManagedRegister sp = Riscv64ManagedRegister::FromXRegister(SP);
+  Load(m_dest, sp, MemberOffset(offs.Int32Value()), size);
+}
+
+void Riscv64JNIMacroAssembler::Load(ManagedRegister m_dest,
+                                    ManagedRegister m_base,
+                                    MemberOffset offs,
+                                    size_t size) {
+  Riscv64ManagedRegister base = m_base.AsRiscv64();
+  Riscv64ManagedRegister dest = m_dest.AsRiscv64();
+  if (dest.IsXRegister()) {
+    if (size == 4u) {
+      // The riscv64 native calling convention specifies that integers narrower than XLEN (64)
+      // bits are "widened according to the sign of their type up to 32 bits, then sign-extended
+      // to XLEN bits." The managed ABI already passes integral values this way in registers
+      // and correctly widened to 32 bits on the stack. The `Load()` must sign-extend narrower
+      // types here to pass integral values correctly to the native call.
+      // For `float` args, the upper 32 bits are undefined, so this is fine for them as well.
+      __ Loadw(dest.AsXRegister(), base.AsXRegister(), offs.Int32Value());
+    } else {
+      CHECK_EQ(8u, size);
+      __ Loadd(dest.AsXRegister(), base.AsXRegister(), offs.Int32Value());
+    }
+  } else {
+    CHECK(dest.IsFRegister()) << dest;
+    if (size == 4u) {
+      __ FLoadw(dest.AsFRegister(), base.AsXRegister(), offs.Int32Value());
+    } else {
+      CHECK_EQ(8u, size);
+      __ FLoadd(dest.AsFRegister(), base.AsXRegister(), offs.Int32Value());
+    }
+  }
+}
+
+void Riscv64JNIMacroAssembler::LoadRawPtrFromThread(ManagedRegister m_dest, ThreadOffset64 offs) {
+  Riscv64ManagedRegister tr = Riscv64ManagedRegister::FromXRegister(TR);
+  Load(m_dest, tr, MemberOffset(offs.Int32Value()), static_cast<size_t>(kRiscv64PointerSize));
+}
+
+void Riscv64JNIMacroAssembler::LoadGcRootWithoutReadBarrier(ManagedRegister m_dest,
+                                                            ManagedRegister m_base,
+                                                            MemberOffset offs) {
+  Riscv64ManagedRegister base = m_base.AsRiscv64();
+  Riscv64ManagedRegister dest = m_dest.AsRiscv64();
+  static_assert(sizeof(uint32_t) == sizeof(GcRoot<mirror::Object>));
+  __ Loadwu(dest.AsXRegister(), base.AsXRegister(), offs.Int32Value());
+}
+
+void Riscv64JNIMacroAssembler::LoadStackReference(ManagedRegister m_dest, FrameOffset offs) {
+  // `StackReference<>` and `GcRoot<>` have the same underlying representation, namely
+  // `CompressedReference<>`. And `StackReference<>` does not need a read barrier.
+  static_assert(sizeof(uint32_t) == sizeof(mirror::CompressedReference<mirror::Object>));
+  static_assert(sizeof(uint32_t) == sizeof(StackReference<mirror::Object>));
+  static_assert(sizeof(uint32_t) == sizeof(GcRoot<mirror::Object>));
+  LoadGcRootWithoutReadBarrier(
+      m_dest, Riscv64ManagedRegister::FromXRegister(SP), MemberOffset(offs.Int32Value()));
+}
+
+void Riscv64JNIMacroAssembler::MoveArguments(ArrayRef<ArgumentLocation> dests,
+                                             ArrayRef<ArgumentLocation> srcs,
+                                             ArrayRef<FrameOffset> refs) {
+  size_t arg_count = dests.size();
+  DCHECK_EQ(arg_count, srcs.size());
+  DCHECK_EQ(arg_count, refs.size());
+
+  auto get_mask = [](ManagedRegister reg) -> uint64_t {
+    Riscv64ManagedRegister riscv64_reg = reg.AsRiscv64();
+    if (riscv64_reg.IsXRegister()) {
+      size_t core_reg_number = static_cast<size_t>(riscv64_reg.AsXRegister());
+      DCHECK_LT(core_reg_number, 32u);
+      return UINT64_C(1) << core_reg_number;
+    } else {
+      DCHECK(riscv64_reg.IsFRegister());
+      size_t fp_reg_number = static_cast<size_t>(riscv64_reg.AsFRegister());
+      DCHECK_LT(fp_reg_number, 32u);
+      return (UINT64_C(1) << 32u) << fp_reg_number;
+    }
+  };
+
+  // Collect registers to move while storing/copying args to stack slots.
+  // Convert processed references to `jobject`.
+  uint64_t src_regs = 0u;
+  uint64_t dest_regs = 0u;
+  for (size_t i = 0; i != arg_count; ++i) {
+    const ArgumentLocation& src = srcs[i];
+    const ArgumentLocation& dest = dests[i];
+    const FrameOffset ref = refs[i];
+    if (ref != kInvalidReferenceOffset) {
+      DCHECK_EQ(src.GetSize(), kObjectReferenceSize);
+      DCHECK_EQ(dest.GetSize(), static_cast<size_t>(kRiscv64PointerSize));
+    } else {
+      DCHECK(src.GetSize() == 4u || src.GetSize() == 8u) << src.GetSize();
+      DCHECK(dest.GetSize() == 4u || dest.GetSize() == 8u) << dest.GetSize();
+      DCHECK_LE(src.GetSize(), dest.GetSize());
+    }
+    if (dest.IsRegister()) {
+      if (src.IsRegister() && src.GetRegister().Equals(dest.GetRegister())) {
+        // No move is necessary but we may need to convert a reference to a `jobject`.
+        if (ref != kInvalidReferenceOffset) {
+          CreateJObject(dest.GetRegister(), ref, src.GetRegister(), /*null_allowed=*/ i != 0u);
+        }
+      } else {
+        if (src.IsRegister()) {
+          src_regs |= get_mask(src.GetRegister());
+        }
+        dest_regs |= get_mask(dest.GetRegister());
+      }
+    } else {
+      ScratchRegisterScope srs(&asm_);
+      Riscv64ManagedRegister reg = src.IsRegister()
+          ? src.GetRegister().AsRiscv64()
+          : Riscv64ManagedRegister::FromXRegister(srs.AllocateXRegister());
+      if (!src.IsRegister()) {
+        if (ref != kInvalidReferenceOffset) {
+          // We're loading the reference only for comparison with null, so it does not matter
+          // if we sign- or zero-extend but let's correctly zero-extend the reference anyway.
+          __ Loadwu(reg.AsRiscv64().AsXRegister(), SP, src.GetFrameOffset().SizeValue());
+        } else {
+          Load(reg, src.GetFrameOffset(), src.GetSize());
+        }
+      }
+      if (ref != kInvalidReferenceOffset) {
+        DCHECK_NE(i, 0u);
+        CreateJObject(reg, ref, reg, /*null_allowed=*/ true);
+      }
+      Store(dest.GetFrameOffset(), reg, dest.GetSize());
+    }
+  }
+
+  // Fill destination registers.
+  // There should be no cycles, so this simple algorithm should make progress.
+  while (dest_regs != 0u) {
+    uint64_t old_dest_regs = dest_regs;
+    for (size_t i = 0; i != arg_count; ++i) {
+      const ArgumentLocation& src = srcs[i];
+      const ArgumentLocation& dest = dests[i];
+      const FrameOffset ref = refs[i];
+      if (!dest.IsRegister()) {
+        continue;  // Stored in first loop above.
+      }
+      uint64_t dest_reg_mask = get_mask(dest.GetRegister());
+      if ((dest_reg_mask & dest_regs) == 0u) {
+        continue;  // Equals source, or already filled in one of previous iterations.
+      }
+      if ((dest_reg_mask & src_regs) != 0u) {
+        continue;  // Cannot clobber this register yet.
+      }
+      if (src.IsRegister()) {
+        if (ref != kInvalidReferenceOffset) {
+          DCHECK_NE(i, 0u);  // The `this` arg remains in the same register (handled above).
+          CreateJObject(dest.GetRegister(), ref, src.GetRegister(), /*null_allowed=*/ true);
+        } else {
+          Move(dest.GetRegister(), src.GetRegister(), dest.GetSize());
+        }
+        src_regs &= ~get_mask(src.GetRegister());  // Allow clobbering source register.
+      } else {
+        Load(dest.GetRegister(), src.GetFrameOffset(), src.GetSize());
+        // No `jobject` conversion needed. There are enough arg registers in managed ABI
+        // to hold all references that yield a register arg `jobject` in native ABI.
+        DCHECK_EQ(ref, kInvalidReferenceOffset);
+      }
+      dest_regs &= ~get_mask(dest.GetRegister());  // Destination register was filled.
+    }
+    CHECK_NE(old_dest_regs, dest_regs);
+    DCHECK_EQ(0u, dest_regs & ~old_dest_regs);
+  }
+}
+
+void Riscv64JNIMacroAssembler::Move(ManagedRegister m_dest, ManagedRegister m_src, size_t size) {
+  // Note: This function is used only for moving between GPRs.
+  // FP argument registers hold the same arguments in managed and native ABIs.
+  DCHECK(size == 4u || size == 8u) << size;
+  Riscv64ManagedRegister dest = m_dest.AsRiscv64();
+  Riscv64ManagedRegister src = m_src.AsRiscv64();
+  DCHECK(dest.IsXRegister());
+  DCHECK(src.IsXRegister());
+  if (!dest.Equals(src)) {
+    __ Mv(dest.AsXRegister(), src.AsXRegister());
+  }
+}
+
+void Riscv64JNIMacroAssembler::Move(ManagedRegister m_dest, size_t value) {
+  DCHECK(m_dest.AsRiscv64().IsXRegister());
+  __ LoadConst64(m_dest.AsRiscv64().AsXRegister(), dchecked_integral_cast<int64_t>(value));
+}
+
+void Riscv64JNIMacroAssembler::SignExtend([[maybe_unused]] ManagedRegister mreg,
+                                          [[maybe_unused]] size_t size) {
+  LOG(FATAL) << "The result is already sign-extended in the native ABI.";
+  UNREACHABLE();
+}
+
+void Riscv64JNIMacroAssembler::ZeroExtend([[maybe_unused]] ManagedRegister mreg,
+                                          [[maybe_unused]] size_t size) {
+  LOG(FATAL) << "The result is already zero-extended in the native ABI.";
+  UNREACHABLE();
+}
+
+void Riscv64JNIMacroAssembler::GetCurrentThread(ManagedRegister dest) {
+  DCHECK(dest.AsRiscv64().IsXRegister());
+  __ Mv(dest.AsRiscv64().AsXRegister(), TR);
+}
+
+void Riscv64JNIMacroAssembler::GetCurrentThread(FrameOffset offset) {
+  __ Stored(TR, SP, offset.Int32Value());
+}
+
+void Riscv64JNIMacroAssembler::DecodeJNITransitionOrLocalJObject(ManagedRegister m_reg,
+                                                                 JNIMacroLabel* slow_path,
+                                                                 JNIMacroLabel* resume) {
+  // This implements the fast-path of `Thread::DecodeJObject()`.
+  constexpr int64_t kGlobalOrWeakGlobalMask = IndirectReferenceTable::GetGlobalOrWeakGlobalMask();
+  DCHECK(IsInt<12>(kGlobalOrWeakGlobalMask));
+  constexpr int64_t kIndirectRefKindMask = IndirectReferenceTable::GetIndirectRefKindMask();
+  DCHECK(IsInt<12>(kIndirectRefKindMask));
+  XRegister reg = m_reg.AsRiscv64().AsXRegister();
+  __ Beqz(reg, Riscv64JNIMacroLabel::Cast(resume)->AsRiscv64());  // Skip test and load for null.
+  __ Andi(TMP, reg, kGlobalOrWeakGlobalMask);
+  __ Bnez(TMP, Riscv64JNIMacroLabel::Cast(slow_path)->AsRiscv64());
+  __ Andi(reg, reg, ~kIndirectRefKindMask);
+  __ Loadwu(reg, reg, 0);
+}
+
+void Riscv64JNIMacroAssembler::VerifyObject([[maybe_unused]] ManagedRegister m_src,
+                                            [[maybe_unused]] bool could_be_null) {
+  // TODO: not validating references.
+}
+
+void Riscv64JNIMacroAssembler::VerifyObject([[maybe_unused]] FrameOffset src,
+                                            [[maybe_unused]] bool could_be_null) {
+  // TODO: not validating references.
+}
+
+void Riscv64JNIMacroAssembler::Jump(ManagedRegister m_base, Offset offs) {
+  Riscv64ManagedRegister base = m_base.AsRiscv64();
+  CHECK(base.IsXRegister()) << base;
+  ScratchRegisterScope srs(&asm_);
+  XRegister tmp = srs.AllocateXRegister();
+  __ Loadd(tmp, base.AsXRegister(), offs.Int32Value());
+  __ Jr(tmp);
+}
+
+void Riscv64JNIMacroAssembler::Call(ManagedRegister m_base, Offset offs) {
+  Riscv64ManagedRegister base = m_base.AsRiscv64();
+  CHECK(base.IsXRegister()) << base;
+  __ Loadd(RA, base.AsXRegister(), offs.Int32Value());
+  __ Jalr(RA);
+}
+
+
+void Riscv64JNIMacroAssembler::CallFromThread(ThreadOffset64 offset) {
+  Call(Riscv64ManagedRegister::FromXRegister(TR), offset);
+}
+
+void Riscv64JNIMacroAssembler::TryToTransitionFromRunnableToNative(
+    JNIMacroLabel* label,
+    ArrayRef<const ManagedRegister> scratch_regs) {
+  constexpr uint32_t kNativeStateValue = Thread::StoredThreadStateValue(ThreadState::kNative);
+  constexpr uint32_t kRunnableStateValue = Thread::StoredThreadStateValue(ThreadState::kRunnable);
+  constexpr ThreadOffset64 thread_flags_offset = Thread::ThreadFlagsOffset<kRiscv64PointerSize>();
+  constexpr ThreadOffset64 thread_held_mutex_mutator_lock_offset =
+      Thread::HeldMutexOffset<kRiscv64PointerSize>(kMutatorLock);
+
+  DCHECK_GE(scratch_regs.size(), 2u);
+  XRegister scratch = scratch_regs[0].AsRiscv64().AsXRegister();
+  XRegister scratch2 = scratch_regs[1].AsRiscv64().AsXRegister();
+
+  // CAS release, old_value = kRunnableStateValue, new_value = kNativeStateValue, no flags.
+  Riscv64Label retry;
+  __ Bind(&retry);
+  static_assert(thread_flags_offset.Int32Value() == 0);  // LR/SC require exact address.
+  __ LrW(scratch, TR, AqRl::kNone);
+  {
+    ScopedLrScExtensionsRestriction slser(&asm_);
+    __ Li(scratch2, kNativeStateValue);
+    // If any flags are set, go to the slow path.
+    static_assert(kRunnableStateValue == 0u);
+    __ Bnez(scratch, Riscv64JNIMacroLabel::Cast(label)->AsRiscv64());
+  }
+  __ ScW(scratch, scratch2, TR, AqRl::kRelease);
+  __ Bnez(scratch, &retry);
+
+  // Clear `self->tlsPtr_.held_mutexes[kMutatorLock]`.
+  __ Stored(Zero, TR, thread_held_mutex_mutator_lock_offset.Int32Value());
+}
+
+void Riscv64JNIMacroAssembler::TryToTransitionFromNativeToRunnable(
+    JNIMacroLabel* label,
+    ArrayRef<const ManagedRegister> scratch_regs,
+    ManagedRegister return_reg) {
+  constexpr uint32_t kNativeStateValue = Thread::StoredThreadStateValue(ThreadState::kNative);
+  constexpr uint32_t kRunnableStateValue = Thread::StoredThreadStateValue(ThreadState::kRunnable);
+  constexpr ThreadOffset64 thread_flags_offset = Thread::ThreadFlagsOffset<kRiscv64PointerSize>();
+  constexpr ThreadOffset64 thread_held_mutex_mutator_lock_offset =
+      Thread::HeldMutexOffset<kRiscv64PointerSize>(kMutatorLock);
+  constexpr ThreadOffset64 thread_mutator_lock_offset =
+      Thread::MutatorLockOffset<kRiscv64PointerSize>();
+
+  DCHECK_GE(scratch_regs.size(), 2u);
+  DCHECK(!scratch_regs[0].AsRiscv64().Overlaps(return_reg.AsRiscv64()));
+  XRegister scratch = scratch_regs[0].AsRiscv64().AsXRegister();
+  DCHECK(!scratch_regs[1].AsRiscv64().Overlaps(return_reg.AsRiscv64()));
+  XRegister scratch2 = scratch_regs[1].AsRiscv64().AsXRegister();
+
+  // CAS acquire, old_value = kNativeStateValue, new_value = kRunnableStateValue, no flags.
+  Riscv64Label retry;
+  __ Bind(&retry);
+  static_assert(thread_flags_offset.Int32Value() == 0);  // LR/SC require exact address.
+  __ LrW(scratch, TR, AqRl::kAcquire);
+  {
+    ScopedLrScExtensionsRestriction slser(&asm_);
+    __ Li(scratch2, kNativeStateValue);
+    // If any flags are set, or the state is not Native, go to the slow path.
+    // (While the thread can theoretically transition between different Suspended states,
+    // it would be very unexpected to see a state other than Native at this point.)
+    __ Bne(scratch, scratch2, Riscv64JNIMacroLabel::Cast(label)->AsRiscv64());
+  }
+  static_assert(kRunnableStateValue == 0u);
+  __ ScW(scratch, Zero, TR, AqRl::kNone);
+  __ Bnez(scratch, &retry);
+
+  // Set `self->tlsPtr_.held_mutexes[kMutatorLock]` to the mutator lock.
+  __ Loadd(scratch, TR, thread_mutator_lock_offset.Int32Value());
+  __ Stored(scratch, TR, thread_held_mutex_mutator_lock_offset.Int32Value());
+}
+
+void Riscv64JNIMacroAssembler::SuspendCheck(JNIMacroLabel* label) {
+  ScratchRegisterScope srs(&asm_);
+  XRegister tmp = srs.AllocateXRegister();
+  __ Loadw(tmp, TR, Thread::ThreadFlagsOffset<kRiscv64PointerSize>().Int32Value());
+  DCHECK(IsInt<12>(dchecked_integral_cast<int32_t>(Thread::SuspendOrCheckpointRequestFlags())));
+  __ Andi(tmp, tmp, dchecked_integral_cast<int32_t>(Thread::SuspendOrCheckpointRequestFlags()));
+  __ Bnez(tmp, Riscv64JNIMacroLabel::Cast(label)->AsRiscv64());
+}
+
+void Riscv64JNIMacroAssembler::ExceptionPoll(JNIMacroLabel* label) {
+  ScratchRegisterScope srs(&asm_);
+  XRegister tmp = srs.AllocateXRegister();
+  __ Loadd(tmp, TR, Thread::ExceptionOffset<kRiscv64PointerSize>().Int32Value());
+  __ Bnez(tmp, Riscv64JNIMacroLabel::Cast(label)->AsRiscv64());
+}
+
+void Riscv64JNIMacroAssembler::DeliverPendingException() {
+  // Pass exception object as argument.
+  // Don't care about preserving A0 as this won't return.
+  // Note: The scratch register from `ExceptionPoll()` may have been clobbered.
+  __ Loadd(A0, TR, Thread::ExceptionOffset<kRiscv64PointerSize>().Int32Value());
+  __ Loadd(RA, TR, QUICK_ENTRYPOINT_OFFSET(kRiscv64PointerSize, pDeliverException).Int32Value());
+  __ Jalr(RA);
+  // Call should never return.
+  __ Unimp();
+}
+
+std::unique_ptr<JNIMacroLabel> Riscv64JNIMacroAssembler::CreateLabel() {
+  return std::unique_ptr<JNIMacroLabel>(new (asm_.GetAllocator()) Riscv64JNIMacroLabel());
+}
+
+void Riscv64JNIMacroAssembler::Jump(JNIMacroLabel* label) {
+  CHECK(label != nullptr);
+  __ J(down_cast<Riscv64Label*>(Riscv64JNIMacroLabel::Cast(label)->AsRiscv64()));
+}
+
+void Riscv64JNIMacroAssembler::TestGcMarking(JNIMacroLabel* label, JNIMacroUnaryCondition cond) {
+  CHECK(label != nullptr);
+
+  DCHECK_EQ(Thread::IsGcMarkingSize(), 4u);
+
+  ScratchRegisterScope srs(&asm_);
+  XRegister test_reg = srs.AllocateXRegister();
+  int32_t is_gc_marking_offset = Thread::IsGcMarkingOffset<kRiscv64PointerSize>().Int32Value();
+  __ Loadw(test_reg, TR, is_gc_marking_offset);
+  switch (cond) {
+    case JNIMacroUnaryCondition::kZero:
+      __ Beqz(test_reg, down_cast<Riscv64Label*>(Riscv64JNIMacroLabel::Cast(label)->AsRiscv64()));
+      break;
+    case JNIMacroUnaryCondition::kNotZero:
+      __ Bnez(test_reg, down_cast<Riscv64Label*>(Riscv64JNIMacroLabel::Cast(label)->AsRiscv64()));
+      break;
+    default:
+      LOG(FATAL) << "Not implemented unary condition: " << static_cast<int>(cond);
+      UNREACHABLE();
+  }
+}
+
+void Riscv64JNIMacroAssembler::TestMarkBit(ManagedRegister m_ref,
+                                           JNIMacroLabel* label,
+                                           JNIMacroUnaryCondition cond) {
+  XRegister ref = m_ref.AsRiscv64().AsXRegister();
+  ScratchRegisterScope srs(&asm_);
+  XRegister tmp = srs.AllocateXRegister();
+  __ Loadw(tmp, ref, mirror::Object::MonitorOffset().Int32Value());
+  // Move the bit we want to check to the sign bit, so that we can use BGEZ/BLTZ
+  // to check it. Extracting the bit for BEQZ/BNEZ would require one more instruction.
+  static_assert(LockWord::kMarkBitStateSize == 1u);
+  __ Slliw(tmp, tmp, 31 - LockWord::kMarkBitStateShift);
+  switch (cond) {
+    case JNIMacroUnaryCondition::kZero:
+      __ Bgez(tmp, Riscv64JNIMacroLabel::Cast(label)->AsRiscv64());
+      break;
+    case JNIMacroUnaryCondition::kNotZero:
+      __ Bltz(tmp, Riscv64JNIMacroLabel::Cast(label)->AsRiscv64());
+      break;
+    default:
+      LOG(FATAL) << "Not implemented unary condition: " << static_cast<int>(cond);
+      UNREACHABLE();
+  }
+}
+
+void Riscv64JNIMacroAssembler::TestByteAndJumpIfNotZero(uintptr_t address, JNIMacroLabel* label) {
+  int32_t small_offset = dchecked_integral_cast<int32_t>(address & 0xfff) -
+                         dchecked_integral_cast<int32_t>((address & 0x800) << 1);
+  int64_t remainder = static_cast<int64_t>(address) - small_offset;
+  ScratchRegisterScope srs(&asm_);
+  XRegister tmp = srs.AllocateXRegister();
+  __ LoadConst64(tmp, remainder);
+  __ Lb(tmp, tmp, small_offset);
+  __ Bnez(tmp, down_cast<Riscv64Label*>(Riscv64JNIMacroLabel::Cast(label)->AsRiscv64()));
+}
+
+void Riscv64JNIMacroAssembler::Bind(JNIMacroLabel* label) {
+  CHECK(label != nullptr);
+  __ Bind(Riscv64JNIMacroLabel::Cast(label)->AsRiscv64());
+}
+
+void Riscv64JNIMacroAssembler::CreateJObject(ManagedRegister m_dest,
+                                             FrameOffset spilled_reference_offset,
+                                             ManagedRegister m_ref,
+                                             bool null_allowed) {
+  Riscv64ManagedRegister dest = m_dest.AsRiscv64();
+  Riscv64ManagedRegister ref = m_ref.AsRiscv64();
+  DCHECK(dest.IsXRegister());
+  DCHECK(ref.IsXRegister());
+
+  Riscv64Label null_label;
+  if (null_allowed) {
+    if (!dest.Equals(ref)) {
+      __ Li(dest.AsXRegister(), 0);
+    }
+    __ Beqz(ref.AsXRegister(), &null_label);
+  }
+  __ AddConst64(dest.AsXRegister(), SP, spilled_reference_offset.Int32Value());
+  if (null_allowed) {
+    __ Bind(&null_label);
+  }
+}
+
+#undef __
+
+}  // namespace riscv64
+}  // namespace art
diff --git a/compiler/utils/riscv64/jni_macro_assembler_riscv64.h b/compiler/utils/riscv64/jni_macro_assembler_riscv64.h
new file mode 100644
index 0000000..3cbed0d
--- /dev/null
+++ b/compiler/utils/riscv64/jni_macro_assembler_riscv64.h
@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_COMPILER_UTILS_RISCV64_JNI_MACRO_ASSEMBLER_RISCV64_H_
+#define ART_COMPILER_UTILS_RISCV64_JNI_MACRO_ASSEMBLER_RISCV64_H_
+
+#include <stdint.h>
+#include <memory>
+#include <vector>
+
+#include <android-base/logging.h>
+
+#include "assembler_riscv64.h"
+#include "base/arena_containers.h"
+#include "base/enums.h"
+#include "base/macros.h"
+#include "offsets.h"
+#include "utils/assembler.h"
+#include "utils/jni_macro_assembler.h"
+
+namespace art HIDDEN {
+namespace riscv64 {
+
+class Riscv64JNIMacroAssembler  : public JNIMacroAssemblerFwd<Riscv64Assembler, PointerSize::k64> {
+ public:
+  explicit Riscv64JNIMacroAssembler(ArenaAllocator* allocator)
+      : JNIMacroAssemblerFwd<Riscv64Assembler, PointerSize::k64>(allocator) {}
+  ~Riscv64JNIMacroAssembler();
+
+  // Finalize the code.
+  void FinalizeCode() override;
+
+  // Emit code that will create an activation on the stack.
+  void BuildFrame(size_t frame_size,
+                  ManagedRegister method_reg,
+                  ArrayRef<const ManagedRegister> callee_save_regs) override;
+
+  // Emit code that will remove an activation from the stack.
+  void RemoveFrame(size_t frame_size,
+                   ArrayRef<const ManagedRegister> callee_save_regs,
+                   bool may_suspend) override;
+
+  void IncreaseFrameSize(size_t adjust) override;
+  void DecreaseFrameSize(size_t adjust) override;
+
+  ManagedRegister CoreRegisterWithSize(ManagedRegister src, size_t size) override;
+
+  // Store routines.
+  void Store(FrameOffset offs, ManagedRegister src, size_t size) override;
+  void Store(ManagedRegister base, MemberOffset offs, ManagedRegister src, size_t size) override;
+  void StoreRawPtr(FrameOffset offs, ManagedRegister src) override;
+  void StoreStackPointerToThread(ThreadOffset64 offs, bool tag_sp) override;
+
+  // Load routines.
+  void Load(ManagedRegister dest, FrameOffset offs, size_t size) override;
+  void Load(ManagedRegister dest, ManagedRegister base, MemberOffset offs, size_t size) override;
+  void LoadRawPtrFromThread(ManagedRegister dest, ThreadOffset64 offs) override;
+  void LoadGcRootWithoutReadBarrier(ManagedRegister dest,
+                                    ManagedRegister base,
+                                    MemberOffset offs) override;
+  void LoadStackReference(ManagedRegister dest, FrameOffset offs) override;
+
+  // Copying routines.
+  void MoveArguments(ArrayRef<ArgumentLocation> dests,
+                     ArrayRef<ArgumentLocation> srcs,
+                     ArrayRef<FrameOffset> refs) override;
+  void Move(ManagedRegister dest, ManagedRegister src, size_t size) override;
+  void Move(ManagedRegister dest, size_t value) override;
+
+  // Sign extension.
+  void SignExtend(ManagedRegister mreg, size_t size) override;
+
+  // Zero extension.
+  void ZeroExtend(ManagedRegister mreg, size_t size) override;
+
+  // Exploit fast access in managed code to Thread::Current().
+  void GetCurrentThread(ManagedRegister dest) override;
+  void GetCurrentThread(FrameOffset offset) override;
+
+  // Decode JNI transition or local `jobject`. For (weak) global `jobject`, jump to slow path.
+  void DecodeJNITransitionOrLocalJObject(ManagedRegister reg,
+                                         JNIMacroLabel* slow_path,
+                                         JNIMacroLabel* resume) override;
+
+  // Heap::VerifyObject on src. In some cases (such as a reference to this) we
+  // know that src may not be null.
+  void VerifyObject(ManagedRegister src, bool could_be_null) override;
+  void VerifyObject(FrameOffset src, bool could_be_null) override;
+
+  // Jump to address held at [base+offset] (used for tail calls).
+  void Jump(ManagedRegister base, Offset offset) override;
+
+  // Call to address held at [base+offset].
+  void Call(ManagedRegister base, Offset offset) override;
+  void CallFromThread(ThreadOffset64 offset) override;
+
+  // Generate fast-path for transition to Native. Go to `label` if any thread flag is set.
+  // The implementation can use `scratch_regs` which should be callee save core registers
+  // (already saved before this call) and must preserve all argument registers.
+  void TryToTransitionFromRunnableToNative(JNIMacroLabel* label,
+                                           ArrayRef<const ManagedRegister> scratch_regs) override;
+
+  // Generate fast-path for transition to Runnable. Go to `label` if any thread flag is set.
+  // The implementation can use `scratch_regs` which should be core argument registers
+  // not used as return registers and it must preserve the `return_reg` if any.
+  void TryToTransitionFromNativeToRunnable(JNIMacroLabel* label,
+                                           ArrayRef<const ManagedRegister> scratch_regs,
+                                           ManagedRegister return_reg) override;
+
+  // Generate suspend check and branch to `label` if there is a pending suspend request.
+  void SuspendCheck(JNIMacroLabel* label) override;
+
+  // Generate code to check if Thread::Current()->exception_ is non-null
+  // and branch to the `label` if it is.
+  void ExceptionPoll(JNIMacroLabel* label) override;
+  // Deliver pending exception.
+  void DeliverPendingException() override;
+
+  // Create a new label that can be used with Jump/Bind calls.
+  std::unique_ptr<JNIMacroLabel> CreateLabel() override;
+  // Emit an unconditional jump to the label.
+  void Jump(JNIMacroLabel* label) override;
+  // Emit a conditional jump to the label by applying a unary condition test to the GC marking flag.
+  void TestGcMarking(JNIMacroLabel* label, JNIMacroUnaryCondition cond) override;
+  // Emit a conditional jump to the label by applying a unary condition test to object's mark bit.
+  void TestMarkBit(ManagedRegister ref, JNIMacroLabel* label, JNIMacroUnaryCondition cond) override;
+  // Emit a conditional jump to label if the loaded value from specified locations is not zero.
+  void TestByteAndJumpIfNotZero(uintptr_t address, JNIMacroLabel* label) override;
+  // Code at this offset will serve as the target for the Jump call.
+  void Bind(JNIMacroLabel* label) override;
+
+ private:
+  void CreateJObject(ManagedRegister m_dest,
+                     FrameOffset spilled_reference_offset,
+                     ManagedRegister m_ref,
+                     bool null_allowed);
+
+  ART_FRIEND_TEST(JniMacroAssemblerRiscv64Test, CreateJObject);
+};
+
+class Riscv64JNIMacroLabel final
+    : public JNIMacroLabelCommon<Riscv64JNIMacroLabel,
+                                 Riscv64Label,
+                                 InstructionSet::kRiscv64> {
+ public:
+  Riscv64Label* AsRiscv64() {
+    return AsPlatformLabel();
+  }
+};
+
+}  // namespace riscv64
+}  // namespace art
+
+#endif  // ART_COMPILER_UTILS_RISCV64_JNI_MACRO_ASSEMBLER_RISCV64_H_
diff --git a/compiler/utils/riscv64/jni_macro_assembler_riscv64_test.cc b/compiler/utils/riscv64/jni_macro_assembler_riscv64_test.cc
new file mode 100644
index 0000000..9717930
--- /dev/null
+++ b/compiler/utils/riscv64/jni_macro_assembler_riscv64_test.cc
@@ -0,0 +1,980 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dirent.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/types.h>
+
+#include <fstream>
+#include <map>
+#include <regex>
+
+#include "gtest/gtest.h"
+
+#include "indirect_reference_table.h"
+#include "lock_word.h"
+#include "jni/quick/calling_convention.h"
+#include "utils/riscv64/jni_macro_assembler_riscv64.h"
+#include "utils/assembler_test_base.h"
+
+#include "base/macros.h"
+#include "base/malloc_arena_pool.h"
+
+namespace art HIDDEN {
+namespace riscv64 {
+
+#define __ assembler_.
+
+class JniMacroAssemblerRiscv64Test : public AssemblerTestBase {
+ public:
+  JniMacroAssemblerRiscv64Test() : pool_(), allocator_(&pool_), assembler_(&allocator_) { }
+
+ protected:
+  InstructionSet GetIsa() override { return InstructionSet::kRiscv64; }
+
+  std::vector<std::string> GetAssemblerCommand() override {
+    std::vector<std::string> result = AssemblerTestBase::GetAssemblerCommand();
+    if (march_override_.has_value()) {
+      auto it = std::find_if(result.begin(),
+                             result.end(),
+                             [](const std::string& s) { return StartsWith(s, "-march="); });
+      CHECK(it != result.end());
+      *it = march_override_.value();
+    }
+    return result;
+  }
+
+  void DriverStr(const std::string& assembly_text, const std::string& test_name) {
+    assembler_.FinalizeCode();
+    size_t cs = assembler_.CodeSize();
+    std::vector<uint8_t> data(cs);
+    MemoryRegion code(&data[0], data.size());
+    assembler_.CopyInstructions(code);
+    Driver(data, assembly_text, test_name);
+  }
+
+  static Riscv64ManagedRegister AsManaged(XRegister reg) {
+    return Riscv64ManagedRegister::FromXRegister(reg);
+  }
+
+  static Riscv64ManagedRegister AsManaged(FRegister reg) {
+    return Riscv64ManagedRegister::FromFRegister(reg);
+  }
+
+  std::string EmitRet() {
+    __ RemoveFrame(/*frame_size=*/ 0u,
+                   /*callee_save_regs=*/ ArrayRef<const ManagedRegister>(),
+                   /*may_suspend=*/ false);
+    return "ret\n";
+  }
+
+  static const size_t kWordSize = 4u;
+  static const size_t kDoubleWordSize = 8u;
+
+  MallocArenaPool pool_;
+  ArenaAllocator allocator_;
+  Riscv64JNIMacroAssembler assembler_;
+
+  // TODO: Implement auto-compression and remove this override.
+  std::optional<std::string> march_override_ = "-march=rv64imafdv_zba_zbb";
+};
+
+TEST_F(JniMacroAssemblerRiscv64Test, StackFrame) {
+  std::string expected;
+
+  std::unique_ptr<JniCallingConvention> jni_conv = JniCallingConvention::Create(
+      &allocator_,
+      /*is_static=*/ false,
+      /*is_synchronized=*/ false,
+      /*is_fast_native=*/ false,
+      /*is_critical_native=*/ false,
+      /*shorty=*/ "V",
+      InstructionSet::kRiscv64);
+  size_t frame_size = jni_conv->FrameSize();
+  ManagedRegister method_reg = AsManaged(A0);
+  ArrayRef<const ManagedRegister> callee_save_regs = jni_conv->CalleeSaveRegisters();
+
+  __ BuildFrame(frame_size, method_reg, callee_save_regs);
+  expected += "addi sp, sp, -208\n"
+              "sd ra, 200(sp)\n"
+              "sd s11, 192(sp)\n"
+              "sd s10, 184(sp)\n"
+              "sd s9, 176(sp)\n"
+              "sd s8, 168(sp)\n"
+              "sd s7, 160(sp)\n"
+              "sd s6, 152(sp)\n"
+              "sd s5, 144(sp)\n"
+              "sd s4, 136(sp)\n"
+              "sd s3, 128(sp)\n"
+              "sd s2, 120(sp)\n"
+              "sd s0, 112(sp)\n"
+              "fsd fs11, 104(sp)\n"
+              "fsd fs10, 96(sp)\n"
+              "fsd fs9, 88(sp)\n"
+              "fsd fs8, 80(sp)\n"
+              "fsd fs7, 72(sp)\n"
+              "fsd fs6, 64(sp)\n"
+              "fsd fs5, 56(sp)\n"
+              "fsd fs4, 48(sp)\n"
+              "fsd fs3, 40(sp)\n"
+              "fsd fs2, 32(sp)\n"
+              "fsd fs1, 24(sp)\n"
+              "fsd fs0, 16(sp)\n"
+              "sd a0, 0(sp)\n";
+
+  __ RemoveFrame(frame_size, callee_save_regs, /*may_suspend=*/ false);
+  expected += "fld fs0, 16(sp)\n"
+              "fld fs1, 24(sp)\n"
+              "fld fs2, 32(sp)\n"
+              "fld fs3, 40(sp)\n"
+              "fld fs4, 48(sp)\n"
+              "fld fs5, 56(sp)\n"
+              "fld fs6, 64(sp)\n"
+              "fld fs7, 72(sp)\n"
+              "fld fs8, 80(sp)\n"
+              "fld fs9, 88(sp)\n"
+              "fld fs10, 96(sp)\n"
+              "fld fs11, 104(sp)\n"
+              "ld s0, 112(sp)\n"
+              "ld s2, 120(sp)\n"
+              "ld s3, 128(sp)\n"
+              "ld s4, 136(sp)\n"
+              "ld s5, 144(sp)\n"
+              "ld s6, 152(sp)\n"
+              "ld s7, 160(sp)\n"
+              "ld s8, 168(sp)\n"
+              "ld s9, 176(sp)\n"
+              "ld s10, 184(sp)\n"
+              "ld s11, 192(sp)\n"
+              "ld ra, 200(sp)\n"
+              "addi sp, sp, 208\n"
+              "ret\n";
+
+  DriverStr(expected, "StackFrame");
+}
+
+TEST_F(JniMacroAssemblerRiscv64Test, ChangeFrameSize) {
+  std::string expected;
+
+  __ IncreaseFrameSize(128);
+  expected += "addi sp, sp, -128\n";
+  __ DecreaseFrameSize(128);
+  expected += "addi sp, sp, 128\n";
+
+  __ IncreaseFrameSize(0);  // No-op
+  __ DecreaseFrameSize(0);  // No-op
+
+  __ IncreaseFrameSize(2048);
+  expected += "addi sp, sp, -2048\n";
+  __ DecreaseFrameSize(2048);
+  expected += "addi t6, sp, 2047\n"
+              "addi sp, t6, 1\n";
+
+  __ IncreaseFrameSize(4096);
+  expected += "addi t6, sp, -2048\n"
+              "addi sp, t6, -2048\n";
+  __ DecreaseFrameSize(4096);
+  expected += "lui t6, 1\n"
+              "add sp, sp, t6\n";
+
+  __ IncreaseFrameSize(6 * KB);
+  expected += "addi t6, zero, -3\n"
+              "slli t6, t6, 11\n"
+              "add sp, sp, t6\n";
+  __ DecreaseFrameSize(6 * KB);
+  expected += "addi t6, zero, 3\n"
+              "slli t6, t6, 11\n"
+              "add sp, sp, t6\n";
+
+  __ IncreaseFrameSize(6 * KB + 16);
+  expected += "lui t6, 0xffffe\n"
+              "addiw t6, t6, 2048-16\n"
+              "add sp, sp, t6\n";
+  __ DecreaseFrameSize(6 * KB + 16);
+  expected += "lui t6, 2\n"
+              "addiw t6, t6, 16-2048\n"
+              "add sp, sp, t6\n";
+
+  DriverStr(expected, "ChangeFrameSize");
+}
+
+TEST_F(JniMacroAssemblerRiscv64Test, Store) {
+  std::string expected;
+
+  __ Store(FrameOffset(0), AsManaged(A0), kWordSize);
+  expected += "sw a0, 0(sp)\n";
+  __ Store(FrameOffset(2048), AsManaged(S0), kDoubleWordSize);
+  expected += "addi t6, sp, 0x7f8\n"
+              "sd s0, 8(t6)\n";
+
+  __ Store(AsManaged(A1), MemberOffset(256), AsManaged(S2), kDoubleWordSize);
+  expected += "sd s2, 256(a1)\n";
+  __ Store(AsManaged(S3), MemberOffset(4 * KB), AsManaged(T1), kWordSize);
+  expected += "lui t6, 1\n"
+              "add t6, t6, s3\n"
+              "sw t1, 0(t6)\n";
+
+  __ Store(AsManaged(A3), MemberOffset(384), AsManaged(FA5), kDoubleWordSize);
+  expected += "fsd fa5, 384(a3)\n";
+  __ Store(AsManaged(S4), MemberOffset(4 * KB + 16), AsManaged(FT10), kWordSize);
+  expected += "lui t6, 1\n"
+              "add t6, t6, s4\n"
+              "fsw ft10, 16(t6)\n";
+
+  __ StoreRawPtr(FrameOffset(128), AsManaged(A7));
+  expected += "sd a7, 128(sp)\n";
+  __ StoreRawPtr(FrameOffset(6 * KB), AsManaged(S11));
+  expected += "lui t6, 2\n"
+              "add t6, t6, sp\n"
+              "sd s11, -2048(t6)\n";
+
+  __ StoreStackPointerToThread(ThreadOffset64(512), /*tag_sp=*/ false);
+  expected += "sd sp, 512(s1)\n";
+  __ StoreStackPointerToThread(ThreadOffset64(3 * KB), /*tag_sp=*/ true);
+  expected += "ori t6, sp, 0x2\n"
+              "addi t5, s1, 0x7f8\n"
+              "sd t6, 0x408(t5)\n";
+
+  DriverStr(expected, "Store");
+}
+
+TEST_F(JniMacroAssemblerRiscv64Test, Load) {
+  std::string expected;
+
+  __ Load(AsManaged(A0), FrameOffset(0), kWordSize);
+  expected += "lw a0, 0(sp)\n";
+  __ Load(AsManaged(S0), FrameOffset(2048), kDoubleWordSize);
+  expected += "addi t6, sp, 0x7f8\n"
+              "ld s0, 8(t6)\n";
+
+  __ Load(AsManaged(S2), AsManaged(A1), MemberOffset(256), kDoubleWordSize);
+  expected += "ld s2, 256(a1)\n";
+  __ Load(AsManaged(T1), AsManaged(S3), MemberOffset(4 * KB), kWordSize);
+  expected += "lui t6, 1\n"
+              "add t6, t6, s3\n"
+              "lw t1, 0(t6)\n";
+
+  __ Load(AsManaged(FA5), AsManaged(A3), MemberOffset(384), kDoubleWordSize);
+  expected += "fld fa5, 384(a3)\n";
+  __ Load(AsManaged(FT10), AsManaged(S4), MemberOffset(4 * KB + 16), kWordSize);
+  expected += "lui t6, 1\n"
+              "add t6, t6, s4\n"
+              "flw ft10, 16(t6)\n";
+
+  __ LoadRawPtrFromThread(AsManaged(A7), ThreadOffset64(512));
+  expected += "ld a7, 512(s1)\n";
+  __ LoadRawPtrFromThread(AsManaged(S11), ThreadOffset64(3 * KB));
+  expected += "addi t6, s1, 0x7f8\n"
+              "ld s11, 0x408(t6)\n";
+
+  __ LoadGcRootWithoutReadBarrier(AsManaged(T0), AsManaged(A0), MemberOffset(0));
+  expected += "lwu t0, 0(a0)\n";
+  __ LoadGcRootWithoutReadBarrier(AsManaged(T1), AsManaged(S2), MemberOffset(0x800));
+  expected += "addi t6, s2, 0x7f8\n"
+              "lwu t1, 8(t6)\n";
+
+  __ LoadStackReference(AsManaged(T0), FrameOffset(0));
+  expected += "lwu t0, 0(sp)\n";
+  __ LoadStackReference(AsManaged(T1), FrameOffset(0x800));
+  expected += "addi t6, sp, 0x7f8\n"
+              "lwu t1, 8(t6)\n";
+
+  DriverStr(expected, "Load");
+}
+
+TEST_F(JniMacroAssemblerRiscv64Test, CreateJObject) {
+  std::string expected;
+
+  __ CreateJObject(AsManaged(A0), FrameOffset(8), AsManaged(A0), /*null_allowed=*/ true);
+  expected += "beqz a0, 1f\n"
+              "addi a0, sp, 8\n"
+              "1:\n";
+  __ CreateJObject(AsManaged(A1), FrameOffset(12), AsManaged(A1), /*null_allowed=*/ false);
+  expected += "addi a1, sp, 12\n";
+  __ CreateJObject(AsManaged(A2), FrameOffset(16), AsManaged(A3), /*null_allowed=*/ true);
+  expected += "li a2, 0\n"
+              "beqz a3, 2f\n"
+              "addi a2, sp, 16\n"
+              "2:\n";
+  __ CreateJObject(AsManaged(A4), FrameOffset(2048), AsManaged(A5), /*null_allowed=*/ false);
+  expected += "addi t6, sp, 2047\n"
+              "addi a4, t6, 1\n";
+
+  DriverStr(expected, "CreateJObject");
+}
+
+TEST_F(JniMacroAssemblerRiscv64Test, MoveArguments) {
+  std::string expected;
+
+  static constexpr FrameOffset kInvalidReferenceOffset =
+      JNIMacroAssembler<kArmPointerSize>::kInvalidReferenceOffset;
+  static constexpr size_t kNativePointerSize = static_cast<size_t>(kRiscv64PointerSize);
+  static constexpr size_t kFloatSize = 4u;
+  static constexpr size_t kXlenInBytes = 8u;  // Used for integral args and `double`.
+
+  // Normal or @FastNative static with parameters "LIJIJILJI".
+  // Note: This shall not spill references to the stack. The JNI compiler spills
+  // references in an separate initial pass before moving arguments and creating `jobject`s.
+  ArgumentLocation move_dests1[] = {
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A1), kNativePointerSize),  // `jclass`
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A2), kNativePointerSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A3), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A4), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A5), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A6), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A7), kXlenInBytes),
+      ArgumentLocation(FrameOffset(0), kNativePointerSize),
+      ArgumentLocation(FrameOffset(8), kXlenInBytes),
+      ArgumentLocation(FrameOffset(16), kXlenInBytes),
+  };
+  ArgumentLocation move_srcs1[] = {
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A0), kNativePointerSize),  // `jclass`
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A1), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A2), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A3), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A4), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A5), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A6), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A7), kVRegSize),
+      ArgumentLocation(FrameOffset(76), 2 * kVRegSize),
+      ArgumentLocation(FrameOffset(84), kVRegSize),
+  };
+  FrameOffset move_refs1[] {
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(40),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(72),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+  };
+  __ MoveArguments(ArrayRef<ArgumentLocation>(move_dests1),
+                   ArrayRef<ArgumentLocation>(move_srcs1),
+                   ArrayRef<FrameOffset>(move_refs1));
+  expected += "beqz a7, 1f\n"
+              "addi a7, sp, 72\n"
+              "1:\n"
+              "sd a7, 0(sp)\n"
+              "ld t6, 76(sp)\n"
+              "sd t6, 8(sp)\n"
+              "lw t6, 84(sp)\n"
+              "sd t6, 16(sp)\n"
+              "mv a7, a6\n"
+              "mv a6, a5\n"
+              "mv a5, a4\n"
+              "mv a4, a3\n"
+              "mv a3, a2\n"
+              "li a2, 0\n"
+              "beqz a1, 2f\n"
+              "add a2, sp, 40\n"
+              "2:\n"
+              "mv a1, a0\n";
+
+  // Normal or @FastNative static with parameters "LIJIJILJI" - spill references.
+  ArgumentLocation move_dests1_spill_refs[] = {
+      ArgumentLocation(FrameOffset(40), kVRegSize),
+      ArgumentLocation(FrameOffset(72), kVRegSize),
+  };
+  ArgumentLocation move_srcs1_spill_refs[] = {
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A1), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A7), kVRegSize),
+  };
+  FrameOffset move_refs1_spill_refs[] {
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+  };
+  __ MoveArguments(ArrayRef<ArgumentLocation>(move_dests1_spill_refs),
+                   ArrayRef<ArgumentLocation>(move_srcs1_spill_refs),
+                   ArrayRef<FrameOffset>(move_refs1_spill_refs));
+  expected += "sw a1, 40(sp)\n"
+              "sw a7, 72(sp)\n";
+
+  // Normal or @FastNative with parameters "LLIJIJIJLI" (first is `this`).
+  // Note: This shall not spill references to the stack. The JNI compiler spills
+  // references in an separate initial pass before moving arguments and creating `jobject`s.
+  ArgumentLocation move_dests2[] = {
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A1), kNativePointerSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A2), kNativePointerSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A3), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A4), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A5), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A6), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A7), kXlenInBytes),
+      ArgumentLocation(FrameOffset(0), kXlenInBytes),
+      ArgumentLocation(FrameOffset(8), kNativePointerSize),
+      ArgumentLocation(FrameOffset(16), kXlenInBytes),
+  };
+  ArgumentLocation move_srcs2[] = {
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A1), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A2), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A3), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A4), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A5), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A6), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A7), kVRegSize),
+      ArgumentLocation(FrameOffset(76), 2 * kVRegSize),
+      ArgumentLocation(FrameOffset(84), kVRegSize),
+      ArgumentLocation(FrameOffset(88), kVRegSize),
+  };
+  FrameOffset move_refs2[] {
+      FrameOffset(40),
+      FrameOffset(44),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(84),
+      FrameOffset(kInvalidReferenceOffset),
+  };
+  __ MoveArguments(ArrayRef<ArgumentLocation>(move_dests2),
+                   ArrayRef<ArgumentLocation>(move_srcs2),
+                   ArrayRef<FrameOffset>(move_refs2));
+  // Args in A1-A7 do not move but references are converted to `jobject`.
+  expected += "addi a1, sp, 40\n"
+              "beqz a2, 1f\n"
+              "addi a2, sp, 44\n"
+              "1:\n"
+              "ld t6, 76(sp)\n"
+              "sd t6, 0(sp)\n"
+              "lwu t6, 84(sp)\n"
+              "beqz t6, 2f\n"
+              "addi t6, sp, 84\n"
+              "2:\n"
+              "sd t6, 8(sp)\n"
+              "lw t6, 88(sp)\n"
+              "sd t6, 16(sp)\n";
+
+  // Normal or @FastNative static with parameters "FDFDFDFDFDIJIJIJL".
+  ArgumentLocation move_dests3[] = {
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A1), kNativePointerSize),  // `jclass`
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA0), kFloatSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA1), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA2), kFloatSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA3), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA4), kFloatSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA5), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA6), kFloatSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA7), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A2), kFloatSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A3), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A4), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A5), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A6), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A7), kXlenInBytes),
+      ArgumentLocation(FrameOffset(0), kXlenInBytes),
+      ArgumentLocation(FrameOffset(8), kXlenInBytes),
+      ArgumentLocation(FrameOffset(16), kNativePointerSize),
+  };
+  ArgumentLocation move_srcs3[] = {
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A0), kNativePointerSize),  // `jclass`
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA0), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA1), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA2), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA3), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA4), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA5), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA6), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA7), 2 * kVRegSize),
+      ArgumentLocation(FrameOffset(88), kVRegSize),
+      ArgumentLocation(FrameOffset(92), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A1), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A2), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A3), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A4), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A5), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A6), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A7), kVRegSize),
+  };
+  FrameOffset move_refs3[] {
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(88),
+  };
+  __ MoveArguments(ArrayRef<ArgumentLocation>(move_dests3),
+                   ArrayRef<ArgumentLocation>(move_srcs3),
+                   ArrayRef<FrameOffset>(move_refs3));
+  // FP args in FA0-FA7 do not move.
+  expected += "sd a5, 0(sp)\n"
+              "sd a6, 8(sp)\n"
+              "beqz a7, 1f\n"
+              "addi a7, sp, 88\n"
+              "1:\n"
+              "sd a7, 16(sp)\n"
+              "mv a5, a2\n"
+              "mv a6, a3\n"
+              "mv a7, a4\n"
+              "lw a2, 88(sp)\n"
+              "ld a3, 92(sp)\n"
+              "mv a4, a1\n"
+              "mv a1, a0\n";
+
+  // @CriticalNative with parameters "DFDFDFDFIDJIJFDIIJ".
+  ArgumentLocation move_dests4[] = {
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA0), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA1), kFloatSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA2), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA3), kFloatSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA4), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA5), kFloatSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA6), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA7), kFloatSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A0), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A1), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A2), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A3), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A4), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A5), kFloatSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A6), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A7), kXlenInBytes),
+      ArgumentLocation(FrameOffset(0), kXlenInBytes),
+      ArgumentLocation(FrameOffset(8), kXlenInBytes),
+  };
+  ArgumentLocation move_srcs4[] = {
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA0), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA1), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA2), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA3), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA4), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA5), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA6), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromFRegister(FA7), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A1), kVRegSize),
+      ArgumentLocation(FrameOffset(92), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A2), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A3), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A4), 2 * kVRegSize),
+      ArgumentLocation(FrameOffset(112), kVRegSize),
+      ArgumentLocation(FrameOffset(116), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A5), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A6), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A7), 2 * kVRegSize),
+  };
+  FrameOffset move_refs4[] {
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+  };
+  __ MoveArguments(ArrayRef<ArgumentLocation>(move_dests4),
+                   ArrayRef<ArgumentLocation>(move_srcs4),
+                   ArrayRef<FrameOffset>(move_refs4));
+  // FP args in FA0-FA7 and integral args in A2-A4 do not move.
+  expected += "sd a6, 0(sp)\n"
+              "sd a7, 8(sp)\n"
+              "mv a0, a1\n"
+              "ld a1, 92(sp)\n"
+              "ld a6, 116(sp)\n"
+              "mv a7, a5\n"
+              "lw a5, 112(sp)\n";
+
+  // @CriticalNative with parameters "JIJIJIJIJI".
+  ArgumentLocation move_dests5[] = {
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A0), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A1), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A2), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A3), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A4), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A5), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A6), kXlenInBytes),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A7), kXlenInBytes),
+      ArgumentLocation(FrameOffset(0), kXlenInBytes),
+      ArgumentLocation(FrameOffset(8), kXlenInBytes),
+  };
+  ArgumentLocation move_srcs5[] = {
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A1), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A2), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A3), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A4), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A5), 2 * kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A6), kVRegSize),
+      ArgumentLocation(Riscv64ManagedRegister::FromXRegister(A7), 2 * kVRegSize),
+      ArgumentLocation(FrameOffset(84), kVRegSize),
+      ArgumentLocation(FrameOffset(88), 2 * kVRegSize),
+      ArgumentLocation(FrameOffset(96), kVRegSize),
+  };
+  FrameOffset move_refs5[] {
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+      FrameOffset(kInvalidReferenceOffset),
+  };
+  __ MoveArguments(ArrayRef<ArgumentLocation>(move_dests5),
+                   ArrayRef<ArgumentLocation>(move_srcs5),
+                   ArrayRef<FrameOffset>(move_refs5));
+  expected += "ld t6, 88(sp)\n"
+              "sd t6, 0(sp)\n"
+              "lw t6, 96(sp)\n"
+              "sd t6, 8(sp)\n"
+              "mv a0, a1\n"
+              "mv a1, a2\n"
+              "mv a2, a3\n"
+              "mv a3, a4\n"
+              "mv a4, a5\n"
+              "mv a5, a6\n"
+              "mv a6, a7\n"
+              "lw a7, 84(sp)\n";
+
+  DriverStr(expected, "MoveArguments");
+}
+
+TEST_F(JniMacroAssemblerRiscv64Test, Move) {
+  std::string expected;
+
+  __ Move(AsManaged(A0), AsManaged(A1), kWordSize);
+  expected += "mv a0, a1\n";
+  __ Move(AsManaged(A2), AsManaged(A3), kDoubleWordSize);
+  expected += "mv a2, a3\n";
+
+  __ Move(AsManaged(A4), AsManaged(A4), kWordSize);  // No-op.
+  __ Move(AsManaged(A5), AsManaged(A5), kDoubleWordSize);  // No-op.
+
+  DriverStr(expected, "Move");
+}
+
+TEST_F(JniMacroAssemblerRiscv64Test, GetCurrentThread) {
+  std::string expected;
+
+  __ GetCurrentThread(AsManaged(A0));
+  expected += "mv a0, s1\n";
+
+  __ GetCurrentThread(FrameOffset(256));
+  expected += "sd s1, 256(sp)\n";
+  __ GetCurrentThread(FrameOffset(3 * KB));
+  expected += "addi t6, sp, 0x7f8\n"
+              "sd s1, 0x408(t6)\n";
+
+  DriverStr(expected, "GetCurrentThread");
+}
+
+TEST_F(JniMacroAssemblerRiscv64Test, DecodeJNITransitionOrLocalJObject) {
+  std::string expected;
+
+  constexpr int64_t kGlobalOrWeakGlobalMask = IndirectReferenceTable::GetGlobalOrWeakGlobalMask();
+  constexpr int64_t kIndirectRefKindMask = IndirectReferenceTable::GetIndirectRefKindMask();
+
+  std::unique_ptr<JNIMacroLabel> slow_path = __ CreateLabel();
+  std::unique_ptr<JNIMacroLabel> resume = __ CreateLabel();
+
+  __ DecodeJNITransitionOrLocalJObject(AsManaged(A0), slow_path.get(), resume.get());
+  expected += "beqz a0, 1f\n"
+              "andi t6, a0, " + std::to_string(kGlobalOrWeakGlobalMask) + "\n"
+              "bnez t6, 2f\n"
+              "andi a0, a0, ~" + std::to_string(kIndirectRefKindMask) + "\n"
+              "lwu a0, (a0)\n";
+
+  __ Bind(resume.get());
+  expected += "1:\n";
+
+  expected += EmitRet();
+
+  __ Bind(slow_path.get());
+  expected += "2:\n";
+
+  __ Jump(resume.get());
+  expected += "j 1b\n";
+
+  DriverStr(expected, "DecodeJNITransitionOrLocalJObject");
+}
+
+TEST_F(JniMacroAssemblerRiscv64Test, JumpCodePointer) {
+  std::string expected;
+
+  __ Jump(AsManaged(A0), Offset(24));
+  expected += "ld t6, 24(a0)\n"
+              "jr t6\n";
+
+  __ Jump(AsManaged(S2), Offset(2048));
+  expected += "addi t6, s2, 0x7f8\n"
+              "ld t6, 8(t6)\n"
+              "jr t6\n";
+
+  DriverStr(expected, "JumpCodePointer");
+}
+
+TEST_F(JniMacroAssemblerRiscv64Test, Call) {
+  std::string expected;
+
+  __ Call(AsManaged(A0), Offset(32));
+  expected += "ld ra, 32(a0)\n"
+              "jalr ra\n";
+
+  __ Call(AsManaged(S2), Offset(2048));
+  expected += "addi t6, s2, 0x7f8\n"
+              "ld ra, 8(t6)\n"
+              "jalr ra\n";
+
+  __ CallFromThread(ThreadOffset64(256));
+  expected += "ld ra, 256(s1)\n"
+              "jalr ra\n";
+
+  __ CallFromThread(ThreadOffset64(3 * KB));
+  expected += "addi t6, s1, 0x7f8\n"
+              "ld ra, 0x408(t6)\n"
+              "jalr ra\n";
+
+  DriverStr(expected, "Call");
+}
+
+TEST_F(JniMacroAssemblerRiscv64Test, Transitions) {
+  std::string expected;
+
+  constexpr uint32_t kNativeStateValue = Thread::StoredThreadStateValue(ThreadState::kNative);
+  constexpr uint32_t kRunnableStateValue = Thread::StoredThreadStateValue(ThreadState::kRunnable);
+  static_assert(kRunnableStateValue == 0u);
+  constexpr ThreadOffset64 thread_flags_offset = Thread::ThreadFlagsOffset<kRiscv64PointerSize>();
+  static_assert(thread_flags_offset.SizeValue() == 0u);
+  constexpr size_t thread_held_mutex_mutator_lock_offset =
+      Thread::HeldMutexOffset<kRiscv64PointerSize>(kMutatorLock).SizeValue();
+  constexpr size_t thread_mutator_lock_offset =
+      Thread::MutatorLockOffset<kRiscv64PointerSize>().SizeValue();
+
+  std::unique_ptr<JNIMacroLabel> slow_path = __ CreateLabel();
+  std::unique_ptr<JNIMacroLabel> resume = __ CreateLabel();
+
+  const ManagedRegister raw_scratch_regs[] = { AsManaged(T0), AsManaged(T1) };
+  const ArrayRef<const ManagedRegister> scratch_regs(raw_scratch_regs);
+
+  __ TryToTransitionFromRunnableToNative(slow_path.get(), scratch_regs);
+  expected += "1:\n"
+              "lr.w t0, (s1)\n"
+              "li t1, " + std::to_string(kNativeStateValue) + "\n"
+              "bnez t0, 4f\n"
+              "sc.w.rl t0, t1, (s1)\n"
+              "bnez t0, 1b\n"
+              "addi t6, s1, 0x7f8\n"
+              "sd x0, " + std::to_string(thread_held_mutex_mutator_lock_offset - 0x7f8u) + "(t6)\n";
+
+  __ TryToTransitionFromNativeToRunnable(slow_path.get(), scratch_regs, AsManaged(A0));
+  expected += "2:\n"
+              "lr.w.aq t0, (s1)\n"
+              "li t1, " + std::to_string(kNativeStateValue) + "\n"
+              "bne t0, t1, 4f\n"
+              "sc.w t0, x0, (s1)\n"
+              "bnez t0, 2b\n"
+              "ld t0, " + std::to_string(thread_mutator_lock_offset) + "(s1)\n"
+              "addi t6, s1, 0x7f8\n"
+              "sd t0, " + std::to_string(thread_held_mutex_mutator_lock_offset - 0x7f8u) + "(t6)\n";
+
+  __ Bind(resume.get());
+  expected += "3:\n";
+
+  expected += EmitRet();
+
+  __ Bind(slow_path.get());
+  expected += "4:\n";
+
+  __ Jump(resume.get());
+  expected += "j 3b";
+
+  DriverStr(expected, "SuspendCheck");
+}
+
+TEST_F(JniMacroAssemblerRiscv64Test, SuspendCheck) {
+  std::string expected;
+
+  ThreadOffset64 thread_flags_offet = Thread::ThreadFlagsOffset<kRiscv64PointerSize>();
+
+  std::unique_ptr<JNIMacroLabel> slow_path = __ CreateLabel();
+  std::unique_ptr<JNIMacroLabel> resume = __ CreateLabel();
+
+  __ SuspendCheck(slow_path.get());
+  expected += "lw t6, " + std::to_string(thread_flags_offet.Int32Value()) + "(s1)\n"
+              "andi t6, t6, " + std::to_string(Thread::SuspendOrCheckpointRequestFlags()) + "\n"
+              "bnez t6, 2f\n";
+
+  __ Bind(resume.get());
+  expected += "1:\n";
+
+  expected += EmitRet();
+
+  __ Bind(slow_path.get());
+  expected += "2:\n";
+
+  __ Jump(resume.get());
+  expected += "j 1b";
+
+  DriverStr(expected, "SuspendCheck");
+}
+
+TEST_F(JniMacroAssemblerRiscv64Test, Exception) {
+  std::string expected;
+
+  ThreadOffset64 exception_offset = Thread::ExceptionOffset<kArm64PointerSize>();
+  ThreadOffset64 deliver_offset = QUICK_ENTRYPOINT_OFFSET(kArm64PointerSize, pDeliverException);
+
+  std::unique_ptr<JNIMacroLabel> slow_path = __ CreateLabel();
+
+  __ ExceptionPoll(slow_path.get());
+  expected += "ld t6, " + std::to_string(exception_offset.Int32Value()) + "(s1)\n"
+              "bnez t6, 1f\n";
+
+  expected += EmitRet();
+
+  __ Bind(slow_path.get());
+  expected += "1:\n";
+
+  __ DeliverPendingException();
+  expected += "ld a0, " + std::to_string(exception_offset.Int32Value()) + "(s1)\n"
+              "ld ra, " + std::to_string(deliver_offset.Int32Value()) + "(s1)\n"
+              "jalr ra\n"
+              "unimp\n";
+
+  DriverStr(expected, "Exception");
+}
+
+TEST_F(JniMacroAssemblerRiscv64Test, JumpLabel) {
+  std::string expected;
+
+  std::unique_ptr<JNIMacroLabel> target = __ CreateLabel();
+  std::unique_ptr<JNIMacroLabel> back = __ CreateLabel();
+
+  __ Jump(target.get());
+  expected += "j 2f\n";
+
+  __ Bind(back.get());
+  expected += "1:\n";
+
+  __ Move(AsManaged(A0), AsManaged(A1), static_cast<size_t>(kRiscv64PointerSize));
+  expected += "mv a0, a1\n";
+
+  __ Bind(target.get());
+  expected += "2:\n";
+
+  __ Jump(back.get());
+  expected += "j 1b\n";
+
+  DriverStr(expected, "JumpLabel");
+}
+
+TEST_F(JniMacroAssemblerRiscv64Test, ReadBarrier) {
+  std::string expected;
+
+  ThreadOffset64 is_gc_marking_offset = Thread::IsGcMarkingOffset<kRiscv64PointerSize>();
+  MemberOffset monitor_offset = mirror::Object::MonitorOffset();
+
+  std::unique_ptr<JNIMacroLabel> slow_path = __ CreateLabel();
+  std::unique_ptr<JNIMacroLabel> resume = __ CreateLabel();
+
+  __ TestGcMarking(slow_path.get(), JNIMacroUnaryCondition::kNotZero);
+  expected += "lw t6, " + std::to_string(is_gc_marking_offset.Int32Value()) + "(s1)\n"
+              "bnez t6, 2f\n";
+
+  __ TestGcMarking(slow_path.get(), JNIMacroUnaryCondition::kZero);
+  expected += "lw t6, " + std::to_string(is_gc_marking_offset.Int32Value()) + "(s1)\n"
+              "beqz t6, 2f\n";
+
+  __ Bind(resume.get());
+  expected += "1:\n";
+
+  expected += EmitRet();
+
+  __ Bind(slow_path.get());
+  expected += "2:\n";
+
+  __ TestMarkBit(AsManaged(A0), resume.get(), JNIMacroUnaryCondition::kNotZero);
+  expected += "lw t6, " + std::to_string(monitor_offset.Int32Value()) + "(a0)\n"
+              "slliw t6, t6, " + std::to_string(31 - LockWord::kMarkBitStateShift) + "\n"
+              "bltz t6, 1b\n";
+
+  __ TestMarkBit(AsManaged(T0), resume.get(), JNIMacroUnaryCondition::kZero);
+  expected += "lw t6, " + std::to_string(monitor_offset.Int32Value()) + "(t0)\n"
+              "slliw t6, t6, " + std::to_string(31 - LockWord::kMarkBitStateShift) + "\n"
+              "bgez t6, 1b\n";
+
+  DriverStr(expected, "ReadBarrier");
+}
+
+TEST_F(JniMacroAssemblerRiscv64Test, TestByteAndJumpIfNotZero) {
+  // Note: The `TestByteAndJumpIfNotZero()` takes the address as a `uintptr_t`.
+  // Use 32-bit addresses, so that we can include this test in 32-bit host tests.
+
+  std::string expected;
+
+  std::unique_ptr<JNIMacroLabel> slow_path = __ CreateLabel();
+  std::unique_ptr<JNIMacroLabel> resume = __ CreateLabel();
+
+  __ TestByteAndJumpIfNotZero(0x12345678u, slow_path.get());
+  expected += "lui t6, 0x12345\n"
+              "lb t6, 0x678(t6)\n"
+              "bnez t6, 2f\n";
+
+  __ TestByteAndJumpIfNotZero(0x87654321u, slow_path.get());
+  expected += "lui t6, 0x87654/4\n"
+              "slli t6, t6, 2\n"
+              "lb t6, 0x321(t6)\n"
+              "bnez t6, 2f\n";
+
+  __ Bind(resume.get());
+  expected += "1:\n";
+
+  expected += EmitRet();
+
+  __ Bind(slow_path.get());
+  expected += "2:\n";
+
+  __ TestByteAndJumpIfNotZero(0x456789abu, resume.get());
+  expected += "lui t6, 0x45678+1\n"
+              "lb t6, 0x9ab-0x1000(t6)\n"
+              "bnez t6, 1b\n";
+
+  DriverStr(expected, "TestByteAndJumpIfNotZero");
+}
+
+#undef __
+
+}  // namespace riscv64
+}  // namespace art
diff --git a/compiler/utils/riscv64/managed_register_riscv64.cc b/compiler/utils/riscv64/managed_register_riscv64.cc
index 560019a..99bd4be 100644
--- a/compiler/utils/riscv64/managed_register_riscv64.cc
+++ b/compiler/utils/riscv64/managed_register_riscv64.cc
@@ -18,7 +18,7 @@
 
 #include "base/globals.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace riscv64 {
 
 bool Riscv64ManagedRegister::Overlaps(const Riscv64ManagedRegister& other) const {
diff --git a/compiler/utils/riscv64/managed_register_riscv64.h b/compiler/utils/riscv64/managed_register_riscv64.h
index 8e02a9d..622d766 100644
--- a/compiler/utils/riscv64/managed_register_riscv64.h
+++ b/compiler/utils/riscv64/managed_register_riscv64.h
@@ -24,7 +24,7 @@
 #include "base/macros.h"
 #include "utils/managed_register.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace riscv64 {
 
 const int kNumberOfXRegIds = kNumberOfXRegisters;
diff --git a/compiler/utils/riscv64/managed_register_riscv64_test.cc b/compiler/utils/riscv64/managed_register_riscv64_test.cc
index c6ad2dc..d7012a7 100644
--- a/compiler/utils/riscv64/managed_register_riscv64_test.cc
+++ b/compiler/utils/riscv64/managed_register_riscv64_test.cc
@@ -19,7 +19,7 @@
 #include "base/globals.h"
 #include "gtest/gtest.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace riscv64 {
 
 TEST(Riscv64ManagedRegister, NoRegister) {
diff --git a/compiler/utils/stack_checks.h b/compiler/utils/stack_checks.h
index d0fff73..1be4532 100644
--- a/compiler/utils/stack_checks.h
+++ b/compiler/utils/stack_checks.h
@@ -35,7 +35,7 @@
 // stack overflow check on method entry.
 //
 // A frame is considered large when it's above kLargeFrameSize.
-static inline bool FrameNeedsStackCheck(size_t size, InstructionSet isa ATTRIBUTE_UNUSED) {
+static inline bool FrameNeedsStackCheck(size_t size, [[maybe_unused]] InstructionSet isa) {
   return size >= kLargeFrameSize;
 }
 
diff --git a/compiler/utils/x86/assembler_x86.cc b/compiler/utils/x86/assembler_x86.cc
index a6b9011..955574e 100644
--- a/compiler/utils/x86/assembler_x86.cc
+++ b/compiler/utils/x86/assembler_x86.cc
@@ -3213,6 +3213,14 @@
 }
 
 
+void X86Assembler::addw(Register reg, const Immediate& imm) {
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+  CHECK(imm.is_uint16() || imm.is_int16()) << imm.value();
+  EmitUint8(0x66);
+  EmitComplex(0, Operand(reg), imm, /* is_16_op= */ true);
+}
+
+
 void X86Assembler::adcl(Register reg, const Immediate& imm) {
   AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   EmitComplex(2, Operand(reg), imm);
diff --git a/compiler/utils/x86/assembler_x86.h b/compiler/utils/x86/assembler_x86.h
index 0f7854d..737e985 100644
--- a/compiler/utils/x86/assembler_x86.h
+++ b/compiler/utils/x86/assembler_x86.h
@@ -789,6 +789,7 @@
   void addl(const Address& address, Register reg);
   void addl(const Address& address, const Immediate& imm);
   void addw(const Address& address, const Immediate& imm);
+  void addw(Register reg, const Immediate& imm);
 
   void adcl(Register dst, Register src);
   void adcl(Register reg, const Immediate& imm);
@@ -955,6 +956,12 @@
     lock()->xaddl(address, reg);
   }
 
+  void rdtsc() {
+    AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+    EmitUint8(0x0F);
+    EmitUint8(0x31);
+  }
+
   //
   // Misc. functionality
   //
diff --git a/compiler/utils/x86/assembler_x86_test.cc b/compiler/utils/x86/assembler_x86_test.cc
index 5da6f04..e7f8d59 100644
--- a/compiler/utils/x86/assembler_x86_test.cc
+++ b/compiler/utils/x86/assembler_x86_test.cc
@@ -89,19 +89,7 @@
       addresses_.push_back(x86::Address(x86::ESP, 987654321));
     }
 
-    if (registers_.size() == 0) {
-      registers_.insert(end(registers_),
-                        {
-                          new x86::Register(x86::EAX),
-                          new x86::Register(x86::EBX),
-                          new x86::Register(x86::ECX),
-                          new x86::Register(x86::EDX),
-                          new x86::Register(x86::EBP),
-                          new x86::Register(x86::ESP),
-                          new x86::Register(x86::ESI),
-                          new x86::Register(x86::EDI)
-                        });
-
+    if (secondary_register_names_.empty()) {
       secondary_register_names_.emplace(x86::Register(x86::EAX), "ax");
       secondary_register_names_.emplace(x86::Register(x86::EBX), "bx");
       secondary_register_names_.emplace(x86::Register(x86::ECX), "cx");
@@ -121,38 +109,28 @@
       tertiary_register_names_.emplace(x86::Register(x86::ESI), "dh");
       tertiary_register_names_.emplace(x86::Register(x86::EDI), "bh");
     }
-
-    if (fp_registers_.size() == 0) {
-      fp_registers_.insert(end(fp_registers_),
-                           {
-                             new x86::XmmRegister(x86::XMM0),
-                             new x86::XmmRegister(x86::XMM1),
-                             new x86::XmmRegister(x86::XMM2),
-                             new x86::XmmRegister(x86::XMM3),
-                             new x86::XmmRegister(x86::XMM4),
-                             new x86::XmmRegister(x86::XMM5),
-                             new x86::XmmRegister(x86::XMM6),
-                             new x86::XmmRegister(x86::XMM7)
-                           });
-    }
   }
 
   void TearDown() override {
     AssemblerTest::TearDown();
-    STLDeleteElements(&registers_);
-    STLDeleteElements(&fp_registers_);
   }
 
   std::vector<x86::Address> GetAddresses() override {
     return addresses_;
   }
 
-  std::vector<x86::Register*> GetRegisters() override {
-    return registers_;
+  ArrayRef<const x86::Register> GetRegisters() override {
+    static constexpr x86::Register kRegisters[] = {
+        x86::EAX, x86::EBX, x86::ECX, x86::EDX, x86::EBP, x86::ESP, x86::ESI, x86::EDI
+    };
+    return ArrayRef<const x86::Register>(kRegisters);
   }
 
-  std::vector<x86::XmmRegister*> GetFPRegisters() override {
-    return fp_registers_;
+  ArrayRef<const x86::XmmRegister> GetFPRegisters() override {
+    static constexpr x86::XmmRegister kFPRegisters[] = {
+        x86::XMM0, x86::XMM1, x86::XMM2, x86::XMM3, x86::XMM4, x86::XMM5, x86::XMM6, x86::XMM7
+    };
+    return ArrayRef<const x86::XmmRegister>(kFPRegisters);
   }
 
   x86::Immediate CreateImmediate(int64_t imm_value) override {
@@ -173,10 +151,8 @@
 
  private:
   std::vector<x86::Address> addresses_;
-  std::vector<x86::Register*> registers_;
   std::map<x86::Register, std::string, X86RegisterCompare> secondary_register_names_;
   std::map<x86::Register, std::string, X86RegisterCompare> tertiary_register_names_;
-  std::vector<x86::XmmRegister*> fp_registers_;
 };
 
 class AssemblerX86AVXTest : public AssemblerX86Test {
@@ -267,28 +243,28 @@
 TEST_F(AssemblerX86Test, PoplAllAddresses) {
   // Make sure all addressing modes combinations are tested at least once.
   std::vector<x86::Address> all_addresses;
-  for (x86::Register* base : GetRegisters()) {
+  for (x86::Register base : GetRegisters()) {
     // Base only.
-    all_addresses.push_back(x86::Address(*base, -1));
-    all_addresses.push_back(x86::Address(*base, 0));
-    all_addresses.push_back(x86::Address(*base, 1));
-    all_addresses.push_back(x86::Address(*base, 123456789));
-    for (x86::Register* index : GetRegisters()) {
-      if (*index == x86::ESP) {
+    all_addresses.push_back(x86::Address(base, -1));
+    all_addresses.push_back(x86::Address(base, 0));
+    all_addresses.push_back(x86::Address(base, 1));
+    all_addresses.push_back(x86::Address(base, 123456789));
+    for (x86::Register index : GetRegisters()) {
+      if (index == x86::ESP) {
         // Index cannot be ESP.
         continue;
-      } else if (*base == *index) {
+      } else if (base == index) {
        // Index only.
-       all_addresses.push_back(x86::Address(*index, TIMES_1, -1));
-       all_addresses.push_back(x86::Address(*index, TIMES_2, 0));
-       all_addresses.push_back(x86::Address(*index, TIMES_4, 1));
-       all_addresses.push_back(x86::Address(*index, TIMES_8, 123456789));
+       all_addresses.push_back(x86::Address(index, TIMES_1, -1));
+       all_addresses.push_back(x86::Address(index, TIMES_2, 0));
+       all_addresses.push_back(x86::Address(index, TIMES_4, 1));
+       all_addresses.push_back(x86::Address(index, TIMES_8, 123456789));
       }
       // Base and index.
-      all_addresses.push_back(x86::Address(*base, *index, TIMES_1, -1));
-      all_addresses.push_back(x86::Address(*base, *index, TIMES_2, 0));
-      all_addresses.push_back(x86::Address(*base, *index, TIMES_4, 1));
-      all_addresses.push_back(x86::Address(*base, *index, TIMES_8, 123456789));
+      all_addresses.push_back(x86::Address(base, index, TIMES_1, -1));
+      all_addresses.push_back(x86::Address(base, index, TIMES_2, 0));
+      all_addresses.push_back(x86::Address(base, index, TIMES_4, 1));
+      all_addresses.push_back(x86::Address(base, index, TIMES_8, 123456789));
     }
   }
   DriverStr(RepeatA(&x86::X86Assembler::popl, all_addresses, "popl {mem}"), "popq");
@@ -302,10 +278,14 @@
   DriverStr(RepeatRA(&x86::X86Assembler::movl, "movl {mem}, %{reg}"), "movl-load");
 }
 
-TEST_F(AssemblerX86Test, Addw) {
+TEST_F(AssemblerX86Test, AddwMem) {
   DriverStr(RepeatAI(&x86::X86Assembler::addw, /*imm_bytes*/ 2U, "addw ${imm}, {mem}"), "addw");
 }
 
+TEST_F(AssemblerX86Test, AddwImm) {
+  DriverStr(RepeatrI(&x86::X86Assembler::addw, /*imm_bytes*/ 2U, "addw ${imm}, %{reg}"), "addw");
+}
+
 TEST_F(AssemblerX86Test, Andw) {
   DriverStr(RepeatAI(&x86::X86Assembler::andw, /*imm_bytes*/ 2U, "andw ${imm}, {mem}"), "andw");
 }
@@ -510,11 +490,11 @@
 // Rorl only allows CL as the shift count.
 std::string rorl_fn(AssemblerX86Test::Base* assembler_test, x86::X86Assembler* assembler) {
   std::ostringstream str;
-  std::vector<x86::Register*> registers = assembler_test->GetRegisters();
+  ArrayRef<const x86::Register> registers = assembler_test->GetRegisters();
   x86::Register shifter(x86::ECX);
-  for (auto reg : registers) {
-    assembler->rorl(*reg, shifter);
-    str << "rorl %cl, %" << assembler_test->GetRegisterName(*reg) << "\n";
+  for (auto&& reg : registers) {
+    assembler->rorl(reg, shifter);
+    str << "rorl %cl, %" << assembler_test->GetRegisterName(reg) << "\n";
   }
   return str.str();
 }
@@ -530,11 +510,11 @@
 // Roll only allows CL as the shift count.
 std::string roll_fn(AssemblerX86Test::Base* assembler_test, x86::X86Assembler* assembler) {
   std::ostringstream str;
-  std::vector<x86::Register*> registers = assembler_test->GetRegisters();
+  ArrayRef<const x86::Register> registers = assembler_test->GetRegisters();
   x86::Register shifter(x86::ECX);
-  for (auto reg : registers) {
-    assembler->roll(*reg, shifter);
-    str << "roll %cl, %" << assembler_test->GetRegisterName(*reg) << "\n";
+  for (auto&& reg : registers) {
+    assembler->roll(reg, shifter);
+    str << "roll %cl, %" << assembler_test->GetRegisterName(reg) << "\n";
   }
   return str.str();
 }
@@ -1379,27 +1359,27 @@
 
   for (int32_t disp0 : displacements) {  // initial displacement
     for (int32_t disp : displacements) {  // extra displacement
-      for (const x86::Register *reg : GetRegisters()) {
+      for (x86::Register reg : GetRegisters()) {
         // Test non-SIB addressing.
-        EXPECT_EQ(x86::Address::displace(x86::Address(*reg, disp0), disp),
-                  x86::Address(*reg, disp0 + disp));
+        EXPECT_EQ(x86::Address::displace(x86::Address(reg, disp0), disp),
+                  x86::Address(reg, disp0 + disp));
 
         // Test SIB addressing with EBP base.
-        if (*reg != x86::ESP) {
+        if (reg != x86::ESP) {
           for (ScaleFactor scale : scales) {
-            EXPECT_EQ(x86::Address::displace(x86::Address(*reg, scale, disp0), disp),
-                      x86::Address(*reg, scale, disp0 + disp));
+            EXPECT_EQ(x86::Address::displace(x86::Address(reg, scale, disp0), disp),
+                      x86::Address(reg, scale, disp0 + disp));
           }
         }
 
         // Test SIB addressing with different base.
-        for (const x86::Register *index : GetRegisters()) {
-          if (*index == x86::ESP) {
+        for (x86::Register index : GetRegisters()) {
+          if (index == x86::ESP) {
             continue;  // Skip ESP as it cannot be used with this address constructor.
           }
           for (ScaleFactor scale : scales) {
-            EXPECT_EQ(x86::Address::displace(x86::Address(*reg, *index, scale, disp0), disp),
-                      x86::Address(*reg, *index, scale, disp0 + disp));
+            EXPECT_EQ(x86::Address::displace(x86::Address(reg, index, scale, disp0), disp),
+                      x86::Address(reg, index, scale, disp0 + disp));
           }
         }
 
diff --git a/compiler/utils/x86/jni_macro_assembler_x86.cc b/compiler/utils/x86/jni_macro_assembler_x86.cc
index 154e50b..3ee0530 100644
--- a/compiler/utils/x86/jni_macro_assembler_x86.cc
+++ b/compiler/utils/x86/jni_macro_assembler_x86.cc
@@ -83,7 +83,7 @@
 
 void X86JNIMacroAssembler::RemoveFrame(size_t frame_size,
                                        ArrayRef<const ManagedRegister> spill_regs,
-                                       bool may_suspend ATTRIBUTE_UNUSED) {
+                                       [[maybe_unused]] bool may_suspend) {
   CHECK_ALIGNED(frame_size, kNativeStackAlignment);
   cfi().RememberState();
   // -kFramePointerSize for ArtMethod*.
@@ -542,7 +542,7 @@
 }
 
 std::unique_ptr<JNIMacroLabel> X86JNIMacroAssembler::CreateLabel() {
-  return std::unique_ptr<JNIMacroLabel>(new X86JNIMacroLabel());
+  return std::unique_ptr<JNIMacroLabel>(new (asm_.GetAllocator()) X86JNIMacroLabel());
 }
 
 void X86JNIMacroAssembler::Jump(JNIMacroLabel* label) {
diff --git a/compiler/utils/x86_64/assembler_x86_64.cc b/compiler/utils/x86_64/assembler_x86_64.cc
index 3fdf05b..89a1d09 100644
--- a/compiler/utils/x86_64/assembler_x86_64.cc
+++ b/compiler/utils/x86_64/assembler_x86_64.cc
@@ -857,12 +857,14 @@
 
 void X86_64Assembler::vaddps(XmmRegister dst, XmmRegister add_left, XmmRegister add_right) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!add_right.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!add_left.NeedsRex()) {
+    return vaddps(dst, add_right, add_left);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(add_left.AsFloatRegister());
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
@@ -920,12 +922,14 @@
 
 void X86_64Assembler::vmulps(XmmRegister dst, XmmRegister src1, XmmRegister src2) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!src2.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!src1.NeedsRex()) {
+    return vmulps(dst, src2, src1);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(src1.AsFloatRegister());
@@ -1439,12 +1443,14 @@
 
 
 void X86_64Assembler::vaddpd(XmmRegister dst, XmmRegister add_left, XmmRegister add_right) {
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!add_right.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!add_left.NeedsRex()) {
+    return vaddpd(dst, add_right, add_left);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(add_left.AsFloatRegister());
@@ -1517,12 +1523,14 @@
 
 void X86_64Assembler::vmulpd(XmmRegister dst, XmmRegister src1, XmmRegister src2) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!src2.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!src1.NeedsRex()) {
+    return vmulpd(dst, src2, src1);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(src1.AsFloatRegister());
@@ -1873,12 +1881,14 @@
 
 void X86_64Assembler::vpaddb(XmmRegister dst, XmmRegister add_left, XmmRegister add_right) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   uint8_t ByteOne = 0x00, ByteZero = 0x00, ByteTwo = 0x00;
-  bool is_twobyte_form = true;
-  if (add_right.NeedsRex()) {
-    is_twobyte_form = false;
+  bool is_twobyte_form = false;
+  if (!add_right.NeedsRex()) {
+    is_twobyte_form = true;
+  } else if (!add_left.NeedsRex()) {
+    return vpaddb(dst, add_right, add_left);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(add_left.AsFloatRegister());
@@ -1952,12 +1962,14 @@
 
 void X86_64Assembler::vpaddw(XmmRegister dst, XmmRegister add_left, XmmRegister add_right) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!add_right.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!add_left.NeedsRex()) {
+    return vpaddw(dst, add_right, add_left);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(add_left.AsFloatRegister());
@@ -2030,12 +2042,14 @@
 
 void X86_64Assembler::vpmullw(XmmRegister dst, XmmRegister src1, XmmRegister src2) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!src2.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!src1.NeedsRex()) {
+    return vpmullw(dst, src2, src1);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(src1.AsFloatRegister());
@@ -2068,12 +2082,14 @@
 
 void X86_64Assembler::vpaddd(XmmRegister dst, XmmRegister add_left, XmmRegister add_right) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!add_right.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!add_left.NeedsRex()) {
+    return vpaddd(dst, add_right, add_left);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(add_left.AsFloatRegister());
@@ -2146,12 +2162,14 @@
 
 void X86_64Assembler::vpaddq(XmmRegister dst, XmmRegister add_left, XmmRegister add_right) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!add_right.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!add_left.NeedsRex()) {
+    return vpaddq(dst, add_right, add_left);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(add_left.AsFloatRegister());
@@ -2681,12 +2699,14 @@
 /* VEX.128.66.0F.WIG EF /r VPXOR xmm1, xmm2, xmm3/m128 */
 void X86_64Assembler::vpxor(XmmRegister dst, XmmRegister src1, XmmRegister src2) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!src2.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!src1.NeedsRex()) {
+    return vpxor(dst, src2, src1);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(src1.AsFloatRegister());
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
@@ -2711,12 +2731,14 @@
 /* VEX.128.0F.WIG 57 /r VXORPS xmm1,xmm2, xmm3/m128 */
 void X86_64Assembler::vxorps(XmmRegister dst, XmmRegister src1, XmmRegister src2) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!src2.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!src1.NeedsRex()) {
+    return vxorps(dst, src2, src1);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(src1.AsFloatRegister());
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
@@ -2741,12 +2763,14 @@
 /* VEX.128.66.0F.WIG 57 /r VXORPD xmm1,xmm2, xmm3/m128 */
 void X86_64Assembler::vxorpd(XmmRegister dst, XmmRegister src1, XmmRegister src2) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!src2.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!src1.NeedsRex()) {
+    return vxorpd(dst, src2, src1);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(src1.AsFloatRegister());
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
@@ -2806,12 +2830,14 @@
 /* VEX.128.66.0F.WIG DB /r VPAND xmm1, xmm2, xmm3/m128 */
 void X86_64Assembler::vpand(XmmRegister dst, XmmRegister src1, XmmRegister src2) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!src2.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!src1.NeedsRex()) {
+    return vpand(dst, src2, src1);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(src1.AsFloatRegister());
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
@@ -2836,12 +2862,14 @@
 /* VEX.128.0F 54 /r VANDPS xmm1,xmm2, xmm3/m128 */
 void X86_64Assembler::vandps(XmmRegister dst, XmmRegister src1, XmmRegister src2) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!src2.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!src1.NeedsRex()) {
+    return vandps(dst, src2, src1);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(src1.AsFloatRegister());
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
@@ -2866,12 +2894,14 @@
 /* VEX.128.66.0F 54 /r VANDPD xmm1, xmm2, xmm3/m128 */
 void X86_64Assembler::vandpd(XmmRegister dst, XmmRegister src1, XmmRegister src2) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!src2.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!src1.NeedsRex()) {
+    return vandpd(dst, src2, src1);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(src1.AsFloatRegister());
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
@@ -3057,12 +3087,14 @@
 /* VEX.128.66.0F.WIG EB /r VPOR xmm1, xmm2, xmm3/m128 */
 void X86_64Assembler::vpor(XmmRegister dst, XmmRegister src1, XmmRegister src2) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!src2.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!src1.NeedsRex()) {
+    return vpor(dst, src2, src1);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(src1.AsFloatRegister());
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
@@ -3087,12 +3119,14 @@
 /* VEX.128.0F 56 /r VORPS xmm1,xmm2, xmm3/m128 */
 void X86_64Assembler::vorps(XmmRegister dst, XmmRegister src1, XmmRegister src2) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!src2.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!src1.NeedsRex()) {
+    return vorps(dst, src2, src1);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(src1.AsFloatRegister());
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
@@ -3117,12 +3151,14 @@
 /* VEX.128.66.0F 56 /r VORPD xmm1,xmm2, xmm3/m128 */
 void X86_64Assembler::vorpd(XmmRegister dst, XmmRegister src1, XmmRegister src2) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!src2.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!src1.NeedsRex()) {
+    return vorpd(dst, src2, src1);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(src1.AsFloatRegister());
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
@@ -3182,12 +3218,14 @@
 
 void X86_64Assembler::vpmaddwd(XmmRegister dst, XmmRegister src1, XmmRegister src2) {
   DCHECK(CpuHasAVXorAVX2FeatureFlag());
-  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   bool is_twobyte_form = false;
   uint8_t ByteZero = 0x00, ByteOne = 0x00, ByteTwo = 0x00;
   if (!src2.NeedsRex()) {
     is_twobyte_form = true;
+  } else if (!src1.NeedsRex()) {
+    return vpmaddwd(dst, src2, src1);
   }
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   ByteZero = EmitVexPrefixByteZero(is_twobyte_form);
   X86_64ManagedRegister vvvv_reg =
       X86_64ManagedRegister::FromXmmRegister(src1.AsFloatRegister());
@@ -4418,6 +4456,15 @@
 }
 
 
+void X86_64Assembler::addw(CpuRegister reg, const Immediate& imm) {
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+  CHECK(imm.is_uint16() || imm.is_int16()) << imm.value();
+  EmitUint8(0x66);
+  EmitOptionalRex32(reg);
+  EmitComplex(0, Operand(reg), imm, /* is_16_op= */ true);
+}
+
+
 void X86_64Assembler::addq(CpuRegister reg, const Immediate& imm) {
   AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   CHECK(imm.is_int32());  // addq only supports 32b immediate.
@@ -4467,6 +4514,15 @@
 }
 
 
+void X86_64Assembler::addw(const Address& address, CpuRegister reg) {
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+  EmitOperandSizeOverride();
+  EmitOptionalRex32(reg, address);
+  EmitUint8(0x01);
+  EmitOperand(reg.LowBits(), address);
+}
+
+
 void X86_64Assembler::subl(CpuRegister dst, CpuRegister src) {
   AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   EmitOptionalRex32(dst, src);
@@ -5244,6 +5300,12 @@
   EmitOperand(dst.LowBits(), src);
 }
 
+void X86_64Assembler::rdtsc() {
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+  EmitUint8(0x0F);
+  EmitUint8(0x31);
+}
+
 void X86_64Assembler::repne_scasb() {
   AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   EmitUint8(0xF2);
diff --git a/compiler/utils/x86_64/assembler_x86_64.h b/compiler/utils/x86_64/assembler_x86_64.h
index 235ea03..7f80dbc 100644
--- a/compiler/utils/x86_64/assembler_x86_64.h
+++ b/compiler/utils/x86_64/assembler_x86_64.h
@@ -852,7 +852,9 @@
   void addl(CpuRegister reg, const Address& address);
   void addl(const Address& address, CpuRegister reg);
   void addl(const Address& address, const Immediate& imm);
+  void addw(CpuRegister reg, const Immediate& imm);
   void addw(const Address& address, const Immediate& imm);
+  void addw(const Address& address, CpuRegister reg);
 
   void addq(CpuRegister reg, const Immediate& imm);
   void addq(CpuRegister dst, CpuRegister src);
@@ -964,6 +966,8 @@
   void popcntq(CpuRegister dst, CpuRegister src);
   void popcntq(CpuRegister dst, const Address& src);
 
+  void rdtsc();
+
   void rorl(CpuRegister reg, const Immediate& imm);
   void rorl(CpuRegister operand, CpuRegister shifter);
   void roll(CpuRegister reg, const Immediate& imm);
diff --git a/compiler/utils/x86_64/assembler_x86_64_test.cc b/compiler/utils/x86_64/assembler_x86_64_test.cc
index a7c206a..9e9c2a5 100644
--- a/compiler/utils/x86_64/assembler_x86_64_test.cc
+++ b/compiler/utils/x86_64/assembler_x86_64_test.cc
@@ -199,24 +199,7 @@
       addresses_.push_back(x86_64::Address(x86_64::CpuRegister(x86_64::R15), 123456789));
     }
 
-    if (registers_.size() == 0) {
-      registers_.push_back(new x86_64::CpuRegister(x86_64::RAX));
-      registers_.push_back(new x86_64::CpuRegister(x86_64::RBX));
-      registers_.push_back(new x86_64::CpuRegister(x86_64::RCX));
-      registers_.push_back(new x86_64::CpuRegister(x86_64::RDX));
-      registers_.push_back(new x86_64::CpuRegister(x86_64::RBP));
-      registers_.push_back(new x86_64::CpuRegister(x86_64::RSP));
-      registers_.push_back(new x86_64::CpuRegister(x86_64::RSI));
-      registers_.push_back(new x86_64::CpuRegister(x86_64::RDI));
-      registers_.push_back(new x86_64::CpuRegister(x86_64::R8));
-      registers_.push_back(new x86_64::CpuRegister(x86_64::R9));
-      registers_.push_back(new x86_64::CpuRegister(x86_64::R10));
-      registers_.push_back(new x86_64::CpuRegister(x86_64::R11));
-      registers_.push_back(new x86_64::CpuRegister(x86_64::R12));
-      registers_.push_back(new x86_64::CpuRegister(x86_64::R13));
-      registers_.push_back(new x86_64::CpuRegister(x86_64::R14));
-      registers_.push_back(new x86_64::CpuRegister(x86_64::R15));
-
+    if (secondary_register_names_.empty()) {
       secondary_register_names_.emplace(x86_64::CpuRegister(x86_64::RAX), "eax");
       secondary_register_names_.emplace(x86_64::CpuRegister(x86_64::RBX), "ebx");
       secondary_register_names_.emplace(x86_64::CpuRegister(x86_64::RCX), "ecx");
@@ -267,42 +250,59 @@
       quaternary_register_names_.emplace(x86_64::CpuRegister(x86_64::R13), "r13b");
       quaternary_register_names_.emplace(x86_64::CpuRegister(x86_64::R14), "r14b");
       quaternary_register_names_.emplace(x86_64::CpuRegister(x86_64::R15), "r15b");
-
-      fp_registers_.push_back(new x86_64::XmmRegister(x86_64::XMM0));
-      fp_registers_.push_back(new x86_64::XmmRegister(x86_64::XMM1));
-      fp_registers_.push_back(new x86_64::XmmRegister(x86_64::XMM2));
-      fp_registers_.push_back(new x86_64::XmmRegister(x86_64::XMM3));
-      fp_registers_.push_back(new x86_64::XmmRegister(x86_64::XMM4));
-      fp_registers_.push_back(new x86_64::XmmRegister(x86_64::XMM5));
-      fp_registers_.push_back(new x86_64::XmmRegister(x86_64::XMM6));
-      fp_registers_.push_back(new x86_64::XmmRegister(x86_64::XMM7));
-      fp_registers_.push_back(new x86_64::XmmRegister(x86_64::XMM8));
-      fp_registers_.push_back(new x86_64::XmmRegister(x86_64::XMM9));
-      fp_registers_.push_back(new x86_64::XmmRegister(x86_64::XMM10));
-      fp_registers_.push_back(new x86_64::XmmRegister(x86_64::XMM11));
-      fp_registers_.push_back(new x86_64::XmmRegister(x86_64::XMM12));
-      fp_registers_.push_back(new x86_64::XmmRegister(x86_64::XMM13));
-      fp_registers_.push_back(new x86_64::XmmRegister(x86_64::XMM14));
-      fp_registers_.push_back(new x86_64::XmmRegister(x86_64::XMM15));
     }
   }
 
   void TearDown() override {
     AssemblerTest::TearDown();
-    STLDeleteElements(&registers_);
-    STLDeleteElements(&fp_registers_);
   }
 
   std::vector<x86_64::Address> GetAddresses() override {
     return addresses_;
   }
 
-  std::vector<x86_64::CpuRegister*> GetRegisters() override {
-    return registers_;
+  ArrayRef<const x86_64::CpuRegister> GetRegisters() override {
+    static constexpr x86_64::CpuRegister kRegisters[] = {
+        x86_64::CpuRegister(x86_64::RAX),
+        x86_64::CpuRegister(x86_64::RBX),
+        x86_64::CpuRegister(x86_64::RCX),
+        x86_64::CpuRegister(x86_64::RDX),
+        x86_64::CpuRegister(x86_64::RBP),
+        x86_64::CpuRegister(x86_64::RSP),
+        x86_64::CpuRegister(x86_64::RSI),
+        x86_64::CpuRegister(x86_64::RDI),
+        x86_64::CpuRegister(x86_64::R8),
+        x86_64::CpuRegister(x86_64::R9),
+        x86_64::CpuRegister(x86_64::R10),
+        x86_64::CpuRegister(x86_64::R11),
+        x86_64::CpuRegister(x86_64::R12),
+        x86_64::CpuRegister(x86_64::R13),
+        x86_64::CpuRegister(x86_64::R14),
+        x86_64::CpuRegister(x86_64::R15),
+    };
+    return ArrayRef<const x86_64::CpuRegister>(kRegisters);
   }
 
-  std::vector<x86_64::XmmRegister*> GetFPRegisters() override {
-    return fp_registers_;
+  ArrayRef<const x86_64::XmmRegister> GetFPRegisters() override {
+    static constexpr x86_64::XmmRegister kFPRegisters[] = {
+        x86_64::XmmRegister(x86_64::XMM0),
+        x86_64::XmmRegister(x86_64::XMM1),
+        x86_64::XmmRegister(x86_64::XMM2),
+        x86_64::XmmRegister(x86_64::XMM3),
+        x86_64::XmmRegister(x86_64::XMM4),
+        x86_64::XmmRegister(x86_64::XMM5),
+        x86_64::XmmRegister(x86_64::XMM6),
+        x86_64::XmmRegister(x86_64::XMM7),
+        x86_64::XmmRegister(x86_64::XMM8),
+        x86_64::XmmRegister(x86_64::XMM9),
+        x86_64::XmmRegister(x86_64::XMM10),
+        x86_64::XmmRegister(x86_64::XMM11),
+        x86_64::XmmRegister(x86_64::XMM12),
+        x86_64::XmmRegister(x86_64::XMM13),
+        x86_64::XmmRegister(x86_64::XMM14),
+        x86_64::XmmRegister(x86_64::XMM15),
+    };
+    return ArrayRef<const x86_64::XmmRegister>(kFPRegisters);
   }
 
   x86_64::Immediate CreateImmediate(int64_t imm_value) override {
@@ -328,11 +328,9 @@
 
  private:
   std::vector<x86_64::Address> addresses_;
-  std::vector<x86_64::CpuRegister*> registers_;
   std::map<x86_64::CpuRegister, std::string, X86_64CpuRegisterCompare> secondary_register_names_;
   std::map<x86_64::CpuRegister, std::string, X86_64CpuRegisterCompare> tertiary_register_names_;
   std::map<x86_64::CpuRegister, std::string, X86_64CpuRegisterCompare> quaternary_register_names_;
-  std::vector<x86_64::XmmRegister*> fp_registers_;
 };
 
 class AssemblerX86_64AVXTest : public AssemblerX86_64Test {
@@ -515,28 +513,28 @@
 TEST_F(AssemblerX86_64Test, PopqAllAddresses) {
   // Make sure all addressing modes combinations are tested at least once.
   std::vector<x86_64::Address> all_addresses;
-  for (x86_64::CpuRegister* base : GetRegisters()) {
+  for (const x86_64::CpuRegister& base : GetRegisters()) {
     // Base only.
-    all_addresses.push_back(x86_64::Address(*base, -1));
-    all_addresses.push_back(x86_64::Address(*base, 0));
-    all_addresses.push_back(x86_64::Address(*base, 1));
-    all_addresses.push_back(x86_64::Address(*base, 123456789));
-    for (x86_64::CpuRegister* index : GetRegisters()) {
-      if (index->AsRegister() == x86_64::RSP) {
+    all_addresses.push_back(x86_64::Address(base, -1));
+    all_addresses.push_back(x86_64::Address(base, 0));
+    all_addresses.push_back(x86_64::Address(base, 1));
+    all_addresses.push_back(x86_64::Address(base, 123456789));
+    for (const x86_64::CpuRegister& index : GetRegisters()) {
+      if (index.AsRegister() == x86_64::RSP) {
         // Index cannot be RSP.
         continue;
-      } else if (base->AsRegister() == index->AsRegister()) {
+      } else if (base.AsRegister() == index.AsRegister()) {
        // Index only.
-       all_addresses.push_back(x86_64::Address(*index, TIMES_1, -1));
-       all_addresses.push_back(x86_64::Address(*index, TIMES_2, 0));
-       all_addresses.push_back(x86_64::Address(*index, TIMES_4, 1));
-       all_addresses.push_back(x86_64::Address(*index, TIMES_8, 123456789));
+       all_addresses.push_back(x86_64::Address(index, TIMES_1, -1));
+       all_addresses.push_back(x86_64::Address(index, TIMES_2, 0));
+       all_addresses.push_back(x86_64::Address(index, TIMES_4, 1));
+       all_addresses.push_back(x86_64::Address(index, TIMES_8, 123456789));
       }
       // Base and index.
-      all_addresses.push_back(x86_64::Address(*base, *index, TIMES_1, -1));
-      all_addresses.push_back(x86_64::Address(*base, *index, TIMES_2, 0));
-      all_addresses.push_back(x86_64::Address(*base, *index, TIMES_4, 1));
-      all_addresses.push_back(x86_64::Address(*base, *index, TIMES_8, 123456789));
+      all_addresses.push_back(x86_64::Address(base, index, TIMES_1, -1));
+      all_addresses.push_back(x86_64::Address(base, index, TIMES_2, 0));
+      all_addresses.push_back(x86_64::Address(base, index, TIMES_4, 1));
+      all_addresses.push_back(x86_64::Address(base, index, TIMES_8, 123456789));
     }
   }
   DriverStr(RepeatA(&x86_64::X86_64Assembler::popq, all_addresses, "popq {mem}"), "popq");
@@ -587,11 +585,21 @@
                      "add ${imm}, %{reg}"), "addli");
 }
 
-TEST_F(AssemblerX86_64Test, Addw) {
+TEST_F(AssemblerX86_64Test, AddwMem) {
   DriverStr(
       RepeatAI(&x86_64::X86_64Assembler::addw, /*imm_bytes*/2U, "addw ${imm}, {mem}"), "addw");
 }
 
+TEST_F(AssemblerX86_64Test, AddwImm) {
+  DriverStr(
+      RepeatwI(&x86_64::X86_64Assembler::addw, /*imm_bytes*/2U, "addw ${imm}, %{reg}"), "addw");
+}
+
+TEST_F(AssemblerX86_64Test, AddwMemReg) {
+  DriverStr(
+      RepeatAw(&x86_64::X86_64Assembler::addw, "addw %{reg}, {mem}"), "addw");
+}
+
 TEST_F(AssemblerX86_64Test, ImulqReg1) {
   DriverStr(RepeatR(&x86_64::X86_64Assembler::imulq, "imulq %{reg}"), "imulq");
 }
@@ -641,11 +649,11 @@
 // Shll only allows CL as the shift count.
 std::string shll_fn(AssemblerX86_64Test::Base* assembler_test, x86_64::X86_64Assembler* assembler) {
   std::ostringstream str;
-  std::vector<x86_64::CpuRegister*> registers = assembler_test->GetRegisters();
+  ArrayRef<const x86_64::CpuRegister> registers = assembler_test->GetRegisters();
   x86_64::CpuRegister shifter(x86_64::RCX);
-  for (auto reg : registers) {
-    assembler->shll(*reg, shifter);
-    str << "shll %cl, %" << assembler_test->GetSecondaryRegisterName(*reg) << "\n";
+  for (auto&& reg : registers) {
+    assembler->shll(reg, shifter);
+    str << "shll %cl, %" << assembler_test->GetSecondaryRegisterName(reg) << "\n";
   }
   return str.str();
 }
@@ -662,11 +670,11 @@
 // Shlq only allows CL as the shift count.
 std::string shlq_fn(AssemblerX86_64Test::Base* assembler_test, x86_64::X86_64Assembler* assembler) {
   std::ostringstream str;
-  std::vector<x86_64::CpuRegister*> registers = assembler_test->GetRegisters();
+  ArrayRef<const x86_64::CpuRegister> registers = assembler_test->GetRegisters();
   x86_64::CpuRegister shifter(x86_64::RCX);
-  for (auto reg : registers) {
-    assembler->shlq(*reg, shifter);
-    str << "shlq %cl, %" << assembler_test->GetRegisterName(*reg) << "\n";
+  for (auto&& reg : registers) {
+    assembler->shlq(reg, shifter);
+    str << "shlq %cl, %" << assembler_test->GetRegisterName(reg) << "\n";
   }
   return str.str();
 }
@@ -683,11 +691,11 @@
 // Shrl only allows CL as the shift count.
 std::string shrl_fn(AssemblerX86_64Test::Base* assembler_test, x86_64::X86_64Assembler* assembler) {
   std::ostringstream str;
-  std::vector<x86_64::CpuRegister*> registers = assembler_test->GetRegisters();
+  ArrayRef<const x86_64::CpuRegister> registers = assembler_test->GetRegisters();
   x86_64::CpuRegister shifter(x86_64::RCX);
-  for (auto reg : registers) {
-    assembler->shrl(*reg, shifter);
-    str << "shrl %cl, %" << assembler_test->GetSecondaryRegisterName(*reg) << "\n";
+  for (auto&& reg : registers) {
+    assembler->shrl(reg, shifter);
+    str << "shrl %cl, %" << assembler_test->GetSecondaryRegisterName(reg) << "\n";
   }
   return str.str();
 }
@@ -703,11 +711,11 @@
 // Shrq only allows CL as the shift count.
 std::string shrq_fn(AssemblerX86_64Test::Base* assembler_test, x86_64::X86_64Assembler* assembler) {
   std::ostringstream str;
-  std::vector<x86_64::CpuRegister*> registers = assembler_test->GetRegisters();
+  ArrayRef<const x86_64::CpuRegister> registers = assembler_test->GetRegisters();
   x86_64::CpuRegister shifter(x86_64::RCX);
-  for (auto reg : registers) {
-    assembler->shrq(*reg, shifter);
-    str << "shrq %cl, %" << assembler_test->GetRegisterName(*reg) << "\n";
+  for (auto&& reg : registers) {
+    assembler->shrq(reg, shifter);
+    str << "shrq %cl, %" << assembler_test->GetRegisterName(reg) << "\n";
   }
   return str.str();
 }
@@ -723,11 +731,11 @@
 // Sarl only allows CL as the shift count.
 std::string sarl_fn(AssemblerX86_64Test::Base* assembler_test, x86_64::X86_64Assembler* assembler) {
   std::ostringstream str;
-  std::vector<x86_64::CpuRegister*> registers = assembler_test->GetRegisters();
+  ArrayRef<const x86_64::CpuRegister> registers = assembler_test->GetRegisters();
   x86_64::CpuRegister shifter(x86_64::RCX);
-  for (auto reg : registers) {
-    assembler->sarl(*reg, shifter);
-    str << "sarl %cl, %" << assembler_test->GetSecondaryRegisterName(*reg) << "\n";
+  for (auto&& reg : registers) {
+    assembler->sarl(reg, shifter);
+    str << "sarl %cl, %" << assembler_test->GetSecondaryRegisterName(reg) << "\n";
   }
   return str.str();
 }
@@ -743,11 +751,11 @@
 // Sarq only allows CL as the shift count.
 std::string sarq_fn(AssemblerX86_64Test::Base* assembler_test, x86_64::X86_64Assembler* assembler) {
   std::ostringstream str;
-  std::vector<x86_64::CpuRegister*> registers = assembler_test->GetRegisters();
+  ArrayRef<const x86_64::CpuRegister> registers = assembler_test->GetRegisters();
   x86_64::CpuRegister shifter(x86_64::RCX);
-  for (auto reg : registers) {
-    assembler->sarq(*reg, shifter);
-    str << "sarq %cl, %" << assembler_test->GetRegisterName(*reg) << "\n";
+  for (auto&& reg : registers) {
+    assembler->sarq(reg, shifter);
+    str << "sarq %cl, %" << assembler_test->GetRegisterName(reg) << "\n";
   }
   return str.str();
 }
@@ -763,11 +771,11 @@
 // Rorl only allows CL as the shift count.
 std::string rorl_fn(AssemblerX86_64Test::Base* assembler_test, x86_64::X86_64Assembler* assembler) {
   std::ostringstream str;
-  std::vector<x86_64::CpuRegister*> registers = assembler_test->GetRegisters();
+  ArrayRef<const x86_64::CpuRegister> registers = assembler_test->GetRegisters();
   x86_64::CpuRegister shifter(x86_64::RCX);
-  for (auto reg : registers) {
-    assembler->rorl(*reg, shifter);
-    str << "rorl %cl, %" << assembler_test->GetSecondaryRegisterName(*reg) << "\n";
+  for (auto&& reg : registers) {
+    assembler->rorl(reg, shifter);
+    str << "rorl %cl, %" << assembler_test->GetSecondaryRegisterName(reg) << "\n";
   }
   return str.str();
 }
@@ -783,11 +791,11 @@
 // Roll only allows CL as the shift count.
 std::string roll_fn(AssemblerX86_64Test::Base* assembler_test, x86_64::X86_64Assembler* assembler) {
   std::ostringstream str;
-  std::vector<x86_64::CpuRegister*> registers = assembler_test->GetRegisters();
+  ArrayRef<const x86_64::CpuRegister> registers = assembler_test->GetRegisters();
   x86_64::CpuRegister shifter(x86_64::RCX);
-  for (auto reg : registers) {
-    assembler->roll(*reg, shifter);
-    str << "roll %cl, %" << assembler_test->GetSecondaryRegisterName(*reg) << "\n";
+  for (auto&& reg : registers) {
+    assembler->roll(reg, shifter);
+    str << "roll %cl, %" << assembler_test->GetSecondaryRegisterName(reg) << "\n";
   }
   return str.str();
 }
@@ -803,11 +811,11 @@
 // Rorq only allows CL as the shift count.
 std::string rorq_fn(AssemblerX86_64Test::Base* assembler_test, x86_64::X86_64Assembler* assembler) {
   std::ostringstream str;
-  std::vector<x86_64::CpuRegister*> registers = assembler_test->GetRegisters();
+  ArrayRef<const x86_64::CpuRegister> registers = assembler_test->GetRegisters();
   x86_64::CpuRegister shifter(x86_64::RCX);
-  for (auto reg : registers) {
-    assembler->rorq(*reg, shifter);
-    str << "rorq %cl, %" << assembler_test->GetRegisterName(*reg) << "\n";
+  for (auto&& reg : registers) {
+    assembler->rorq(reg, shifter);
+    str << "rorq %cl, %" << assembler_test->GetRegisterName(reg) << "\n";
   }
   return str.str();
 }
@@ -823,11 +831,11 @@
 // Rolq only allows CL as the shift count.
 std::string rolq_fn(AssemblerX86_64Test::Base* assembler_test, x86_64::X86_64Assembler* assembler) {
   std::ostringstream str;
-  std::vector<x86_64::CpuRegister*> registers = assembler_test->GetRegisters();
+  ArrayRef<const x86_64::CpuRegister> registers = assembler_test->GetRegisters();
   x86_64::CpuRegister shifter(x86_64::RCX);
-  for (auto reg : registers) {
-    assembler->rolq(*reg, shifter);
-    str << "rolq %cl, %" << assembler_test->GetRegisterName(*reg) << "\n";
+  for (auto&& reg : registers) {
+    assembler->rolq(reg, shifter);
+    str << "rolq %cl, %" << assembler_test->GetRegisterName(reg) << "\n";
   }
   return str.str();
 }
@@ -2135,7 +2143,7 @@
             "psrldq $2, %xmm15\n", "psrldqi");
 }
 
-std::string x87_fn(AssemblerX86_64Test::Base* assembler_test ATTRIBUTE_UNUSED,
+std::string x87_fn([[maybe_unused]] AssemblerX86_64Test::Base* assembler_test,
                    x86_64::X86_64Assembler* assembler) {
   std::ostringstream str;
 
@@ -2202,7 +2210,7 @@
                     "ret ${imm}", /*non-negative*/ true), "ret");
 }
 
-std::string ret_and_leave_fn(AssemblerX86_64Test::Base* assembler_test ATTRIBUTE_UNUSED,
+std::string ret_and_leave_fn([[maybe_unused]] AssemblerX86_64Test::Base* assembler_test,
                              x86_64::X86_64Assembler* assembler) {
   std::ostringstream str;
 
@@ -2375,13 +2383,13 @@
   std::string suffixes[15] = { "o", "no", "b", "ae", "e", "ne", "be", "a", "s", "ns", "pe", "po",
                                "l", "ge", "le" };
 
-  std::vector<x86_64::CpuRegister*> registers = assembler_test->GetRegisters();
+  ArrayRef<const x86_64::CpuRegister> registers = assembler_test->GetRegisters();
   std::ostringstream str;
 
-  for (auto reg : registers) {
+  for (auto&& reg : registers) {
     for (size_t i = 0; i < 15; ++i) {
-      assembler->setcc(static_cast<x86_64::Condition>(i), *reg);
-      str << "set" << suffixes[i] << " %" << assembler_test->GetQuaternaryRegisterName(*reg) << "\n";
+      assembler->setcc(static_cast<x86_64::Condition>(i), reg);
+      str << "set" << suffixes[i] << " %" << assembler_test->GetQuaternaryRegisterName(reg) << "\n";
     }
   }
 
@@ -2459,27 +2467,27 @@
 
   for (int32_t disp0 : displacements) {  // initial displacement
     for (int32_t disp : displacements) {  // extra displacement
-      for (const x86_64::CpuRegister* reg : GetRegisters()) {
+      for (const x86_64::CpuRegister reg : GetRegisters()) {
         // Test non-SIB addressing.
-        EXPECT_EQ(x86_64::Address::displace(x86_64::Address(*reg, disp0), disp),
-                  x86_64::Address(*reg, disp0 + disp));
+        EXPECT_EQ(x86_64::Address::displace(x86_64::Address(reg, disp0), disp),
+                  x86_64::Address(reg, disp0 + disp));
 
         // Test SIB addressing with RBP base.
-        if (reg->AsRegister() != x86_64::RSP) {
+        if (reg.AsRegister() != x86_64::RSP) {
           for (ScaleFactor scale : scales) {
-            EXPECT_EQ(x86_64::Address::displace(x86_64::Address(*reg, scale, disp0), disp),
-                      x86_64::Address(*reg, scale, disp0 + disp));
+            EXPECT_EQ(x86_64::Address::displace(x86_64::Address(reg, scale, disp0), disp),
+                      x86_64::Address(reg, scale, disp0 + disp));
           }
         }
 
         // Test SIB addressing with different base.
-        for (const x86_64::CpuRegister* index : GetRegisters()) {
-          if (index->AsRegister() == x86_64::RSP) {
+        for (const x86_64::CpuRegister& index : GetRegisters()) {
+          if (index.AsRegister() == x86_64::RSP) {
             continue;  // Skip RSP as it cannot be used with this address constructor.
           }
           for (ScaleFactor scale : scales) {
-            EXPECT_EQ(x86_64::Address::displace(x86_64::Address(*reg, *index, scale, disp0), disp),
-                      x86_64::Address(*reg, *index, scale, disp0 + disp));
+            EXPECT_EQ(x86_64::Address::displace(x86_64::Address(reg, index, scale, disp0), disp),
+                      x86_64::Address(reg, index, scale, disp0 + disp));
           }
         }
 
@@ -2513,7 +2521,7 @@
   return x86_64::X86_64ManagedRegister::FromXmmRegister(r);
 }
 
-std::string buildframe_test_fn(JNIMacroAssemblerX86_64Test::Base* assembler_test ATTRIBUTE_UNUSED,
+std::string buildframe_test_fn([[maybe_unused]] JNIMacroAssemblerX86_64Test::Base* assembler_test,
                                x86_64::X86_64JNIMacroAssembler* assembler) {
   // TODO: more interesting spill registers / entry spills.
 
@@ -2556,7 +2564,7 @@
   DriverFn(&buildframe_test_fn, "BuildFrame");
 }
 
-std::string removeframe_test_fn(JNIMacroAssemblerX86_64Test::Base* assembler_test ATTRIBUTE_UNUSED,
+std::string removeframe_test_fn([[maybe_unused]] JNIMacroAssemblerX86_64Test::Base* assembler_test,
                                 x86_64::X86_64JNIMacroAssembler* assembler) {
   // TODO: more interesting spill registers / entry spills.
 
@@ -2588,7 +2596,7 @@
 }
 
 std::string increaseframe_test_fn(
-    JNIMacroAssemblerX86_64Test::Base* assembler_test ATTRIBUTE_UNUSED,
+    [[maybe_unused]] JNIMacroAssemblerX86_64Test::Base* assembler_test,
     x86_64::X86_64JNIMacroAssembler* assembler) {
   assembler->IncreaseFrameSize(0U);
   assembler->IncreaseFrameSize(kStackAlignment);
@@ -2608,7 +2616,7 @@
 }
 
 std::string decreaseframe_test_fn(
-    JNIMacroAssemblerX86_64Test::Base* assembler_test ATTRIBUTE_UNUSED,
+    [[maybe_unused]] JNIMacroAssemblerX86_64Test::Base* assembler_test,
     x86_64::X86_64JNIMacroAssembler* assembler) {
   assembler->DecreaseFrameSize(0U);
   assembler->DecreaseFrameSize(kStackAlignment);
diff --git a/compiler/utils/x86_64/jni_macro_assembler_x86_64.cc b/compiler/utils/x86_64/jni_macro_assembler_x86_64.cc
index 3888457..1b9cfa6 100644
--- a/compiler/utils/x86_64/jni_macro_assembler_x86_64.cc
+++ b/compiler/utils/x86_64/jni_macro_assembler_x86_64.cc
@@ -95,7 +95,7 @@
 
 void X86_64JNIMacroAssembler::RemoveFrame(size_t frame_size,
                                           ArrayRef<const ManagedRegister> spill_regs,
-                                          bool may_suspend ATTRIBUTE_UNUSED) {
+                                          [[maybe_unused]] bool may_suspend) {
   CHECK_ALIGNED(frame_size, kNativeStackAlignment);
   cfi().RememberState();
   int gpr_count = 0;
@@ -515,7 +515,7 @@
 }
 
 void X86_64JNIMacroAssembler::TryToTransitionFromRunnableToNative(
-    JNIMacroLabel* label, ArrayRef<const ManagedRegister> scratch_regs ATTRIBUTE_UNUSED) {
+    JNIMacroLabel* label, [[maybe_unused]] ArrayRef<const ManagedRegister> scratch_regs) {
   constexpr uint32_t kNativeStateValue = Thread::StoredThreadStateValue(ThreadState::kNative);
   constexpr uint32_t kRunnableStateValue = Thread::StoredThreadStateValue(ThreadState::kRunnable);
   constexpr ThreadOffset64 thread_flags_offset = Thread::ThreadFlagsOffset<kX86_64PointerSize>();
@@ -610,7 +610,7 @@
 }
 
 std::unique_ptr<JNIMacroLabel> X86_64JNIMacroAssembler::CreateLabel() {
-  return std::unique_ptr<JNIMacroLabel>(new X86_64JNIMacroLabel());
+  return std::unique_ptr<JNIMacroLabel>(new (asm_.GetAllocator()) X86_64JNIMacroLabel());
 }
 
 void X86_64JNIMacroAssembler::Jump(JNIMacroLabel* label) {
diff --git a/dex2oat/Android.bp b/dex2oat/Android.bp
index e37d18d..7da21ea 100644
--- a/dex2oat/Android.bp
+++ b/dex2oat/Android.bp
@@ -55,6 +55,11 @@
                 "linker/arm64/relative_patcher_arm64.cc",
             ],
         },
+        riscv64: {
+            srcs: [
+                "linker/riscv64/relative_patcher_riscv64.cc",
+            ],
+        },
         x86: {
             srcs: [
                 "linker/x86/relative_patcher_x86.cc",
@@ -104,7 +109,6 @@
     name: "libart-dex2oat",
     defaults: ["libart-dex2oat-defaults"],
     shared_libs: [
-        "libart-compiler",
         "libart-dexlayout",
         "libart",
         "libartpalette",
@@ -127,7 +131,6 @@
         "libprofile_static_defaults",
     ],
     whole_static_libs: [
-        "libart-compiler",
         "libart-dexlayout",
         "libart-dex2oat",
     ],
@@ -141,7 +144,6 @@
     host_supported: true,
     defaults: [
         "art_defaults",
-        "libart-compiler_static_defaults",
         "libart-dex2oat_static_defaults",
         "libart-dexlayout_static_defaults",
         "libart_static_defaults",
@@ -158,7 +160,6 @@
         "libart-dex2oat-defaults",
     ],
     shared_libs: [
-        "libartd-compiler",
         "libartd-dexlayout",
         "libartd",
         "libartpalette",
@@ -180,7 +181,6 @@
         "libprofiled_static_defaults",
     ],
     whole_static_libs: [
-        "libartd-compiler",
         "libartd-dexlayout",
         "libartd-dex2oat",
     ],
@@ -193,7 +193,6 @@
     defaults: [
         "art_debug_defaults",
         "libartbased_static_defaults",
-        "libartd-compiler_static_defaults",
         "libartd-dex2oat_static_defaults",
         "libartd-dexlayout_static_defaults",
         "libartd_static_defaults",
@@ -231,51 +230,10 @@
     },
 }
 
-cc_defaults {
-    name: "dex2oat-pgo-defaults",
-    defaults_visibility: [
-        "//art:__subpackages__",
-        "//external/vixl",
-    ],
-    pgo: {
-        instrumentation: true,
-        benchmarks: ["dex2oat"],
-    },
-    target: {
-        android_arm64: {
-            pgo: {
-                profile_file: "art/dex2oat_arm_arm64.profdata",
-            },
-        },
-        android_arm: {
-            pgo: {
-                profile_file: "art/dex2oat_arm_arm64.profdata",
-            },
-        },
-        android_riscv64: {
-            pgo: {
-                enable_profile_use: false,
-                profile_file: "",
-            },
-        },
-        android_x86_64: {
-            pgo: {
-                profile_file: "art/dex2oat_x86_x86_64.profdata",
-            },
-        },
-        android_x86: {
-            pgo: {
-                profile_file: "art/dex2oat_x86_x86_64.profdata",
-            },
-        },
-    },
-}
-
 art_cc_binary {
     name: "dex2oat",
     defaults: [
         "dex2oat-defaults",
-        "dex2oat-pgo-defaults",
     ],
     // Modules that do dexpreopting, e.g. android_app, depend implicitly on
     // either dex2oat or dex2oatd in ART source builds.
@@ -291,20 +249,10 @@
     },
     symlink_preferred_arch: true,
 
-    pgo: {
-        // Additional cflags just for dex2oat during PGO instrumentation
-        cflags: [
-            // Ignore frame-size increase resulting from instrumentation.
-            "-Wno-frame-larger-than=",
-            "-DART_PGO_INSTRUMENTATION",
-        ],
-    },
-
     target: {
         android: {
             shared_libs: [
                 "libart",
-                "libart-compiler",
                 "libart-dexlayout",
                 "libartbase",
                 "libdexfile",
@@ -366,7 +314,6 @@
             shared_libs: [
                 "libartbased",
                 "libartd",
-                "libartd-compiler",
                 "libartd-dexlayout",
                 "libdexfiled",
                 "libprofiled",
@@ -440,37 +387,24 @@
     srcs: [
         "common_compiler_driver_test.cc",
     ],
-    shared_libs: [
-        "libart-compiler-gtest",
-        "libart-runtime-gtest",
-        "libart-compiler",
-        "libart-disassembler",
-        "libbase",
-        "liblz4", // libart-dex2oat dependency; must be repeated here since it's a static lib.
-        "liblog",
-    ],
     static_libs: [
         "libart-dex2oat",
+        "libart-gtest",
     ],
 }
 
 art_cc_library_static {
     name: "libartd-dex2oat-gtest",
-    defaults: ["libartd-gtest-defaults"],
+    defaults: [
+        "art_debug_defaults",
+        "libart-gtest-defaults",
+    ],
     srcs: [
         "common_compiler_driver_test.cc",
     ],
-    shared_libs: [
-        "libartd-compiler-gtest",
-        "libartd-runtime-gtest",
-        "libartd-compiler",
-        "libartd-disassembler",
-        "libbase",
-        "liblz4", // libartd-dex2oat dependency; must be repeated here since it's a static lib.
-        "liblog",
-    ],
     static_libs: [
         "libartd-dex2oat",
+        "libartd-gtest",
     ],
 }
 
@@ -544,6 +478,11 @@
                 "linker/arm64/relative_patcher_arm64_test.cc",
             ],
         },
+        riscv64: {
+            srcs: [
+                "linker/riscv64/relative_patcher_riscv64_test.cc",
+            ],
+        },
         x86: {
             srcs: [
                 "linker/x86/relative_patcher_x86_test.cc",
@@ -556,17 +495,10 @@
         },
     },
 
-    static_libs: [
-        "libziparchive",
-    ],
     shared_libs: [
-        "libartpalette",
-        "libbase",
         "libcrypto",
         "liblz4", // libart(d)-dex2oat dependency; must be repeated here since it's a static lib.
         "liblog",
-        "libsigchain",
-        "libz", // libziparchive dependency; must be repeated here since it's a static lib.
     ],
 }
 
@@ -578,18 +510,11 @@
         "art_gtest_defaults",
         "art_dex2oat_tests_defaults",
     ],
-    shared_libs: [
-        "libartbased",
-        "libartd-dexlayout",
-        "liblzma",
-        "libprofiled",
-    ],
     static_libs: [
-        "libartd-compiler",
         "libartd-dex2oat",
         "libartd-dex2oat-gtest",
-        "libelffiled",
         "libvixld",
+        "libartd-dexlayout",
     ],
 }
 
@@ -601,18 +526,11 @@
         "art_dex2oat_tests_defaults",
     ],
     data: [":generate-boot-image"],
-    shared_libs: [
-        "libart-dexlayout",
-        "libartbase",
-        "liblzma",
-        "libprofile",
-    ],
     static_libs: [
-        "libart-compiler",
         "libart-dex2oat",
         "libart-dex2oat-gtest",
-        "libelffile",
         "libvixl",
+        "libart-dexlayout",
     ],
     test_config: "art_standalone_dex2oat_tests.xml",
 }
@@ -620,7 +538,7 @@
 // Counterpart to art_standalone_dex2oat_tests for tests that go into CTS.
 art_cc_test {
     name: "art_standalone_dex2oat_cts_tests",
-    defaults: ["art_cts_gtest_defaults"],
+    defaults: ["art_standalone_gtest_defaults"],
     srcs: ["dex2oat_cts_test.cc"],
     data: [
         ":art-gtest-jars-Main",
@@ -631,12 +549,6 @@
         ":art-gtest-jars-Nested",
         ":generate-boot-image",
     ],
-    shared_libs: [
-        "libz", // libziparchive dependency; must be repeated here since it's a static lib.
-    ],
-    static_libs: [
-        "libziparchive",
-    ],
     test_config: "art_standalone_dex2oat_cts_tests.xml",
     test_suites: [
         "cts",
diff --git a/dex2oat/art_standalone_dex2oat_cts_tests.xml b/dex2oat/art_standalone_dex2oat_cts_tests.xml
index 0a38fef..b6f4a3d 100644
--- a/dex2oat/art_standalone_dex2oat_cts_tests.xml
+++ b/dex2oat/art_standalone_dex2oat_cts_tests.xml
@@ -19,6 +19,8 @@
     <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="multi_abi" />
     <option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
 
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
         <option name="cleanup" value="true" />
diff --git a/dex2oat/art_standalone_dex2oat_tests.xml b/dex2oat/art_standalone_dex2oat_tests.xml
index 3a8c7b9..d0c3f40 100644
--- a/dex2oat/art_standalone_dex2oat_tests.xml
+++ b/dex2oat/art_standalone_dex2oat_tests.xml
@@ -15,6 +15,7 @@
 -->
 <configuration description="Runs art_standalone_dex2oat_tests.">
     <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
 
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
         <option name="cleanup" value="true" />
@@ -72,8 +73,6 @@
         <option name="test-case-timeout" value="5m" />
         <option name="native-test-device-path" value="/data/local/tmp/art_standalone_dex2oat_tests" />
         <option name="module-name" value="art_standalone_dex2oat_tests" />
-        <option name="ld-library-path-32" value="/apex/com.android.art/lib" />
-        <option name="ld-library-path-64" value="/apex/com.android.art/lib64" />
     </test>
 
     <!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
diff --git a/dex2oat/common_compiler_driver_test.cc b/dex2oat/common_compiler_driver_test.cc
index 7a1d11c..91fa859 100644
--- a/dex2oat/common_compiler_driver_test.cc
+++ b/dex2oat/common_compiler_driver_test.cc
@@ -111,13 +111,14 @@
 
   // Note: We cannot use MemMap because some tests tear down the Runtime and destroy
   // the gMaps, so when destroying the MemMap, the test would crash.
-  inaccessible_page_ = mmap(nullptr, kPageSize, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+  const size_t page_size = MemMap::GetPageSize();
+  inaccessible_page_ = mmap(nullptr, page_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
   CHECK(inaccessible_page_ != MAP_FAILED) << strerror(errno);
 }
 
 void CommonCompilerDriverTest::TearDown() {
   if (inaccessible_page_ != nullptr) {
-    munmap(inaccessible_page_, kPageSize);
+    munmap(inaccessible_page_, MemMap::GetPageSize());
     inaccessible_page_ = nullptr;
   }
   image_reservation_.Reset();
diff --git a/dex2oat/dex/quick_compiler_callbacks.cc b/dex2oat/dex/quick_compiler_callbacks.cc
index 7611374..c3b1c9b 100644
--- a/dex2oat/dex/quick_compiler_callbacks.cc
+++ b/dex2oat/dex/quick_compiler_callbacks.cc
@@ -47,8 +47,6 @@
     return ClassStatus::kNotReady;
   }
   DCHECK(compiler_driver_ != nullptr);
-  // In the case of the quicken filter: avoiding verification of quickened instructions, which the
-  // verifier doesn't currently support.
   // In the case of the verify filter, avoiding verifiying twice.
   return compiler_driver_->GetClassStatus(ref);
 }
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 98acff6..c76929c 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -45,7 +45,6 @@
 #include "android-base/stringprintf.h"
 #include "android-base/strings.h"
 #include "android-base/unique_fd.h"
-#include "aot_class_linker.h"
 #include "arch/instruction_set_features.h"
 #include "art_method-inl.h"
 #include "base/callee_save_type.h"
@@ -83,7 +82,6 @@
 #include "driver/compiler_driver.h"
 #include "driver/compiler_options.h"
 #include "driver/compiler_options_map-inl.h"
-#include "elf_file.h"
 #include "gc/space/image_space.h"
 #include "gc/space/space-inl.h"
 #include "gc/verification.h"
@@ -98,9 +96,11 @@
 #include "mirror/class_loader.h"
 #include "mirror/object-inl.h"
 #include "mirror/object_array-inl.h"
-#include "oat.h"
-#include "oat_file.h"
-#include "oat_file_assistant.h"
+#include "oat/aot_class_linker.h"
+#include "oat/elf_file.h"
+#include "oat/oat.h"
+#include "oat/oat_file.h"
+#include "oat/oat_file_assistant.h"
 #include "palette/palette.h"
 #include "profile/profile_compilation_info.h"
 #include "runtime.h"
@@ -642,6 +642,9 @@
     compiler_options_->compiler_type_ = CompilerOptions::CompilerType::kAotCompiler;
     compiler_options_->compile_pic_ = true;  // All AOT compilation is PIC.
 
+    // TODO: This should be a command line option for cross-compilation. b/289805127
+    compiler_options_->emit_read_barrier_ = gUseReadBarrier;
+
     if (android_root_.empty()) {
       const char* android_root_env_var = getenv("ANDROID_ROOT");
       if (android_root_env_var == nullptr) {
@@ -860,6 +863,7 @@
         FALLTHROUGH_INTENDED;
       case InstructionSet::kArm:
       case InstructionSet::kThumb2:
+      case InstructionSet::kRiscv64:
       case InstructionSet::kX86:
       case InstructionSet::kX86_64:
         compiler_options_->implicit_null_checks_ = true;
@@ -972,7 +976,7 @@
                           compiler_options_->GetNativeDebuggable());
     key_value_store_->Put(OatHeader::kCompilerFilter,
                           CompilerFilter::NameOfFilter(compiler_options_->GetCompilerFilter()));
-    key_value_store_->Put(OatHeader::kConcurrentCopying, gUseReadBarrier);
+    key_value_store_->Put(OatHeader::kConcurrentCopying, compiler_options_->EmitReadBarrier());
     if (invocation_file_.get() != -1) {
       std::ostringstream oss;
       for (int i = 0; i < argc; ++i) {
@@ -1044,13 +1048,7 @@
     original_argv = argv;
 
     Locks::Init();
-
-    // Microdroid doesn't support logd logging, so don't override there.
-    if (android::base::GetProperty("ro.hardware", "") == "microdroid") {
-      android::base::SetAborter(Runtime::Abort);
-    } else {
-      InitLogging(argv, Runtime::Abort);
-    }
+    InitLogging(argv, Runtime::Abort);
 
     compiler_options_.reset(new CompilerOptions());
 
@@ -1583,10 +1581,10 @@
           LOG(ERROR) << "Missing dex file for boot class component " << bcp_location;
           return dex2oat::ReturnCode::kOther;
         }
-        CHECK(!DexFileLoader::IsMultiDexLocation(bcp_dex_files[bcp_df_pos]->GetLocation().c_str()));
+        CHECK(!DexFileLoader::IsMultiDexLocation(bcp_dex_files[bcp_df_pos]->GetLocation()));
         ++bcp_df_pos;
         while (bcp_df_pos != bcp_df_end &&
-            DexFileLoader::IsMultiDexLocation(bcp_dex_files[bcp_df_pos]->GetLocation().c_str())) {
+            DexFileLoader::IsMultiDexLocation(bcp_dex_files[bcp_df_pos]->GetLocation())) {
           ++bcp_df_pos;
         }
       }
@@ -2544,9 +2542,8 @@
 
   bool PrepareDirtyObjects() {
     if (dirty_image_objects_fd_ != -1) {
-      dirty_image_objects_ = ReadCommentedInputFromFd<HashSet<std::string>>(
-          dirty_image_objects_fd_,
-          nullptr);
+      dirty_image_objects_ =
+          ReadCommentedInputFromFd<std::vector<std::string>>(dirty_image_objects_fd_, nullptr);
       // Close since we won't need it again.
       close(dirty_image_objects_fd_);
       dirty_image_objects_fd_ = -1;
@@ -2555,9 +2552,8 @@
         return false;
       }
     } else if (dirty_image_objects_filename_ != nullptr) {
-      dirty_image_objects_ = ReadCommentedInputFromFile<HashSet<std::string>>(
-          dirty_image_objects_filename_,
-          nullptr);
+      dirty_image_objects_ = ReadCommentedInputFromFile<std::vector<std::string>>(
+          dirty_image_objects_filename_, nullptr);
       if (dirty_image_objects_ == nullptr) {
         LOG(ERROR) << "Failed to create list of dirty objects from '"
             << dirty_image_objects_filename_ << "'";
@@ -2967,7 +2963,7 @@
   const char* passes_to_run_filename_;
   const char* dirty_image_objects_filename_;
   int dirty_image_objects_fd_;
-  std::unique_ptr<HashSet<std::string>> dirty_image_objects_;
+  std::unique_ptr<std::vector<std::string>> dirty_image_objects_;
   std::unique_ptr<std::vector<std::string>> passes_to_run_;
   bool is_host_;
   std::string android_root_;
diff --git a/dex2oat/dex2oat_cts_test.cc b/dex2oat/dex2oat_cts_test.cc
index 25cd94b..0b5ee5b 100644
--- a/dex2oat/dex2oat_cts_test.cc
+++ b/dex2oat/dex2oat_cts_test.cc
@@ -14,252 +14,24 @@
  * limitations under the License.
  */
 
-#include <dirent.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#include <fstream>
-#include <functional>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "android-base/file.h"
-#include "android-base/unique_fd.h"
 #include "base/file_utils.h"
-#include "base/os.h"
-#include "base/stl_util.h"
-#include "base/unix_file/fd_file.h"
-#include "gtest/gtest.h"
+#include "dex2oat_environment_test.h"
 
 namespace art {
-namespace {
 
-void ClearDirectory(const char* dirpath, bool recursive = true) {
-  ASSERT_TRUE(dirpath != nullptr);
-  DIR* dir = opendir(dirpath);
-  ASSERT_TRUE(dir != nullptr);
-  dirent* e;
-  struct stat s;
-  while ((e = readdir(dir)) != nullptr) {
-    if ((strcmp(e->d_name, ".") == 0) || (strcmp(e->d_name, "..") == 0)) {
-      continue;
-    }
-    std::string filename(dirpath);
-    filename.push_back('/');
-    filename.append(e->d_name);
-    int stat_result = lstat(filename.c_str(), &s);
-    ASSERT_EQ(0, stat_result) << "unable to stat " << filename;
-    if (S_ISDIR(s.st_mode)) {
-      if (recursive) {
-        ClearDirectory(filename.c_str());
-        int rmdir_result = rmdir(filename.c_str());
-        ASSERT_EQ(0, rmdir_result) << filename;
-      }
-    } else {
-      int unlink_result = unlink(filename.c_str());
-      ASSERT_EQ(0, unlink_result) << filename;
-    }
-  }
-  closedir(dir);
-}
-
-class Dex2oatScratchDirs {
+class Dex2oatCtsTest : public CommonArtTest, public Dex2oatScratchDirs {
  public:
-  void SetUp(const std::string& android_data) {
-    // Create a scratch directory to work from.
-
-    // Get the realpath of the android data. The oat dir should always point to real location
-    // when generating oat files in dalvik-cache. This avoids complicating the unit tests
-    // when matching the expected paths.
-    UniqueCPtr<const char[]> android_data_real(realpath(android_data.c_str(), nullptr));
-    ASSERT_TRUE(android_data_real != nullptr)
-        << "Could not get the realpath of the android data" << android_data << strerror(errno);
-
-    scratch_dir_.assign(android_data_real.get());
-    scratch_dir_ += "/Dex2oatEnvironmentTest";
-    ASSERT_EQ(0, mkdir(scratch_dir_.c_str(), 0700));
-
-    // Create a subdirectory in scratch for odex files.
-    odex_oat_dir_ = scratch_dir_ + "/oat";
-    ASSERT_EQ(0, mkdir(odex_oat_dir_.c_str(), 0700));
-
-    odex_dir_ = odex_oat_dir_ + "/" + std::string(GetInstructionSetString(kRuntimeISA));
-    ASSERT_EQ(0, mkdir(odex_dir_.c_str(), 0700));
-  }
-
-  void TearDown() {
-    ClearDirectory(odex_dir_.c_str());
-    ASSERT_EQ(0, rmdir(odex_dir_.c_str()));
-
-    ClearDirectory(odex_oat_dir_.c_str());
-    ASSERT_EQ(0, rmdir(odex_oat_dir_.c_str()));
-
-    ClearDirectory(scratch_dir_.c_str());
-    ASSERT_EQ(0, rmdir(scratch_dir_.c_str()));
-  }
-
-  // Scratch directory, for dex and odex files (oat files will go in the
-  // dalvik cache).
-  const std::string& GetScratchDir() const { return scratch_dir_; }
-
-  // Odex directory is the subdirectory in the scratch directory where odex
-  // files should be located.
-  const std::string& GetOdexDir() const { return odex_dir_; }
-
- private:
-  std::string scratch_dir_;
-  std::string odex_oat_dir_;
-  std::string odex_dir_;
-};
-
-class Dex2oatCtsTest : public Dex2oatScratchDirs, public testing::Test {
- public:
-  void SetUpAndroidDataDir(std::string& android_data) {
-    android_data = "/data/local/tmp";
-    android_data += "/art-data-XXXXXX";
-    if (mkdtemp(&android_data[0]) == nullptr) {
-      PLOG(FATAL) << "mkdtemp(\"" << &android_data[0] << "\") failed";
-    }
-    setenv("ANDROID_DATA", android_data.c_str(), 1);
-  }
-
-  void TearDownAndroidDataDir(const std::string& android_data,
-                              bool fail_on_error) {
-    if (fail_on_error) {
-      ASSERT_EQ(rmdir(android_data.c_str()), 0);
-    } else {
-      rmdir(android_data.c_str());
-    }
-  }
-
-  std::string GetTestDexFileName(const char* name) const {
-    CHECK(name != nullptr);
-    // The needed jar files for gtest are located next to the gtest binary itself.
-    std::string executable_dir = android::base::GetExecutableDirectory();
-    for (auto ext : {".jar", ".dex"}) {
-      std::string path = executable_dir + "/art-gtest-jars-" + name + ext;
-      if (OS::FileExists(path.c_str())) {
-        return path;
-      }
-    }
-    LOG(FATAL) << "Test file " << name << " not found";
-    UNREACHABLE();
-  }
-
   void SetUp() override {
-    SetUpAndroidDataDir(android_data_);
+    CommonArtTest::SetUp();
     Dex2oatScratchDirs::SetUp(android_data_);
   }
 
   void TearDown() override {
     Dex2oatScratchDirs::TearDown();
-    TearDownAndroidDataDir(android_data_, true);
-  }
-
-  struct ForkAndExecResult {
-    enum Stage {
-      kLink,
-      kFork,
-      kWaitpid,
-      kFinished,
-    };
-    Stage stage;
-    int status_code;
-
-    bool StandardSuccess() {
-      return stage == kFinished && WIFEXITED(status_code) && WEXITSTATUS(status_code) == 0;
-    }
-  };
-  using OutputHandlerFn = std::function<void(char*, size_t)>;
-  using PostForkFn = std::function<bool()>;
-
-  ForkAndExecResult ForkAndExec(
-      const std::vector<std::string>& argv,
-      const PostForkFn& post_fork,
-      const OutputHandlerFn& handler) {
-    ForkAndExecResult result;
-    result.status_code = 0;
-    result.stage = ForkAndExecResult::kLink;
-
-    std::vector<const char*> c_args;
-    c_args.reserve(argv.size() + 1);
-    for (const std::string& str : argv) {
-      c_args.push_back(str.c_str());
-    }
-    c_args.push_back(nullptr);
-
-    android::base::unique_fd link[2];
-    {
-      int link_fd[2];
-
-      if (pipe(link_fd) == -1) {
-        return result;
-      }
-      link[0].reset(link_fd[0]);
-      link[1].reset(link_fd[1]);
-    }
-
-    result.stage = ForkAndExecResult::kFork;
-
-    pid_t pid = fork();
-    if (pid == -1) {
-      return result;
-    }
-
-    if (pid == 0) {
-      if (!post_fork()) {
-        LOG(ERROR) << "Failed post-fork function";
-        exit(1);
-        UNREACHABLE();
-      }
-
-      // Redirect stdout and stderr.
-      dup2(link[1].get(), STDOUT_FILENO);
-      dup2(link[1].get(), STDERR_FILENO);
-
-      link[0].reset();
-      link[1].reset();
-
-      execv(c_args[0], const_cast<char* const*>(c_args.data()));
-      exit(1);
-      UNREACHABLE();
-    }
-
-    result.stage = ForkAndExecResult::kWaitpid;
-    link[1].reset();
-
-    char buffer[128] = { 0 };
-    ssize_t bytes_read = 0;
-    while (TEMP_FAILURE_RETRY(bytes_read = read(link[0].get(), buffer, 128)) > 0) {
-      handler(buffer, bytes_read);
-    }
-    handler(buffer, 0u);  // End with a virtual write of zero length to simplify clients.
-
-    link[0].reset();
-
-    if (waitpid(pid, &result.status_code, 0) == -1) {
-      return result;
-    }
-
-    result.stage = ForkAndExecResult::kFinished;
-    return result;
-  }
-
-  ForkAndExecResult ForkAndExec(
-      const std::vector<std::string>& argv, const PostForkFn& post_fork, std::string* output) {
-    auto string_collect_fn = [output](char* buf, size_t len) {
-      *output += std::string(buf, len);
-    };
-    return ForkAndExec(argv, post_fork, string_collect_fn);
+    CommonArtTest::TearDown();
   }
 
  protected:
-  std::string android_data_;
-
   // Stripped down counterpart to Dex2oatEnvironmentTest::Dex2Oat that only adds
   // enough arguments for our purposes.
   int Dex2Oat(const std::vector<std::string>& dex2oat_args,
@@ -291,9 +63,7 @@
   }
 };
 
-}  // namespace
-
-// Run dex2oat with --enable-palette-compilation-hooks to force calls to
+// Run dex2oat with --force-palette-compilation-hooks to force calls to
 // PaletteNotify{Start,End}Dex2oatCompilation.
 TEST_F(Dex2oatCtsTest, CompilationHooks) {
   const std::string dex_location = GetTestDexFileName("Main");
diff --git a/dex2oat/dex2oat_image_test.cc b/dex2oat/dex2oat_image_test.cc
index 4518905..e276638 100644
--- a/dex2oat/dex2oat_image_test.cc
+++ b/dex2oat/dex2oat_image_test.cc
@@ -114,8 +114,8 @@
     // Extend to both directions for maximum relocation difference.
     static_assert(ART_BASE_ADDRESS_MIN_DELTA < 0);
     static_assert(ART_BASE_ADDRESS_MAX_DELTA > 0);
-    static_assert(IsAligned<kPageSize>(ART_BASE_ADDRESS_MIN_DELTA));
-    static_assert(IsAligned<kPageSize>(ART_BASE_ADDRESS_MAX_DELTA));
+    static_assert(IsAligned<kElfSegmentAlignment>(ART_BASE_ADDRESS_MIN_DELTA));
+    static_assert(IsAligned<kElfSegmentAlignment>(ART_BASE_ADDRESS_MAX_DELTA));
     constexpr size_t kExtra = ART_BASE_ADDRESS_MAX_DELTA - ART_BASE_ADDRESS_MIN_DELTA;
     uint32_t min_relocated_address = kBaseAddress + ART_BASE_ADDRESS_MIN_DELTA;
     return MemMap::MapAnonymous("Reservation",
@@ -420,20 +420,22 @@
     boot_image_spaces.clear();
     extra_reservation = MemMap::Invalid();
     ScopedObjectAccess soa(Thread::Current());
-    return gc::space::ImageSpace::LoadBootImage(/*boot_class_path=*/ boot_class_path,
-                                                /*boot_class_path_locations=*/ libcore_dex_files,
-                                                /*boot_class_path_fds=*/ std::vector<int>(),
-                                                /*boot_class_path_image_fds=*/ std::vector<int>(),
-                                                /*boot_class_path_vdex_fds=*/ std::vector<int>(),
-                                                /*boot_class_path_oat_fds=*/ std::vector<int>(),
-                                                android::base::Split(image_location, ":"),
-                                                kRuntimeISA,
-                                                relocate,
-                                                /*executable=*/ true,
-                                                /*extra_reservation_size=*/ 0u,
-                                                /*allow_in_memory_compilation=*/ true,
-                                                &boot_image_spaces,
-                                                &extra_reservation);
+    return gc::space::ImageSpace::LoadBootImage(
+        /*boot_class_path=*/boot_class_path,
+        /*boot_class_path_locations=*/libcore_dex_files,
+        /*boot_class_path_files=*/{},
+        /*boot_class_path_image_files=*/{},
+        /*boot_class_path_vdex_files=*/{},
+        /*boot_class_path_oat_files=*/{},
+        android::base::Split(image_location, ":"),
+        kRuntimeISA,
+        relocate,
+        /*executable=*/true,
+        /*extra_reservation_size=*/0u,
+        /*allow_in_memory_compilation=*/true,
+        Runtime::GetApexVersions(ArrayRef<const std::string>(libcore_dex_files)),
+        &boot_image_spaces,
+        &extra_reservation);
   };
   auto silent_load = [&](const std::string& image_location) {
     ScopedLogSeverity quiet(LogSeverity::FATAL);
@@ -460,33 +462,33 @@
     ASSERT_FALSE(load_ok);
 
     // Load the primary and first extension with full path.
-    load_ok = load(base_location + ':' + mid_location);
+    load_ok = load(ART_FORMAT("{}:{}", base_location, mid_location));
     ASSERT_TRUE(load_ok) << error_msg;
     ASSERT_EQ(mid_bcp.size(), boot_image_spaces.size());
 
     // Load the primary with full path and fail to load first extension without full path.
-    load_ok = load(base_location + ':' + mid_name);
+    load_ok = load(ART_FORMAT("{}:{}", base_location, mid_name));
     ASSERT_TRUE(load_ok) << error_msg;  // Primary image loaded successfully.
     ASSERT_EQ(head_dex_files.size(), boot_image_spaces.size());  // But only the primary image.
 
     // Load all the libcore images with full paths.
-    load_ok = load(base_location + ':' + mid_location + ':' + tail_location);
+    load_ok = load(ART_FORMAT("{}:{}:{}", base_location, mid_location, tail_location));
     ASSERT_TRUE(load_ok) << error_msg;
     ASSERT_EQ(full_bcp.size(), boot_image_spaces.size());
 
     // Load the primary and first extension with full paths, fail to load second extension by name.
-    load_ok = load(base_location + ':' + mid_location + ':' + tail_name);
+    load_ok = load(ART_FORMAT("{}:{}:{}", base_location, mid_location, tail_name));
     ASSERT_TRUE(load_ok) << error_msg;
     ASSERT_EQ(mid_bcp.size(), boot_image_spaces.size());
 
     // Load the primary with full path and fail to load first extension without full path,
     // fail to load second extension because it depends on the first.
-    load_ok = load(base_location + ':' + mid_name + ':' + tail_location);
+    load_ok = load(ART_FORMAT("{}:{}:{}", base_location, mid_name, tail_location));
     ASSERT_TRUE(load_ok) << error_msg;  // Primary image loaded successfully.
     ASSERT_EQ(head_dex_files.size(), boot_image_spaces.size());  // But only the primary image.
 
     // Load the primary with full path and extensions with a specified search path.
-    load_ok = load(base_location + ':' + scratch_dir + '*');
+    load_ok = load(ART_FORMAT("{}:{}*", base_location, scratch_dir));
     ASSERT_TRUE(load_ok) << error_msg;
     ASSERT_EQ(full_bcp.size(), boot_image_spaces.size());
 
@@ -515,33 +517,33 @@
     ASSERT_FALSE(load_ok);
 
     // Load the primary and first extension without paths.
-    load_ok = load(base_name + ':' + mid_name);
+    load_ok = load(ART_FORMAT("{}:{}", base_name, mid_name));
     ASSERT_TRUE(load_ok) << error_msg;
     ASSERT_EQ(mid_bcp.size(), boot_image_spaces.size());
 
     // Load the primary without path and first extension with path.
-    load_ok = load(base_name + ':' + mid_location);
+    load_ok = load(ART_FORMAT("{}:{}", base_name, mid_location));
     ASSERT_TRUE(load_ok) << error_msg;
     ASSERT_EQ(mid_bcp.size(), boot_image_spaces.size());
 
     // Load the primary with full path and the first extension without full path.
-    load_ok = load(base_location + ':' + mid_name);
+    load_ok = load(ART_FORMAT("{}:{}", base_location, mid_name));
     ASSERT_TRUE(load_ok) << error_msg;  // Loaded successfully.
     ASSERT_EQ(mid_bcp.size(), boot_image_spaces.size());  // Including the extension.
 
     // Load all the libcore images without paths.
-    load_ok = load(base_name + ':' + mid_name + ':' + tail_name);
+    load_ok = load(ART_FORMAT("{}:{}:{}", base_name, mid_name, tail_name));
     ASSERT_TRUE(load_ok) << error_msg;
     ASSERT_EQ(full_bcp.size(), boot_image_spaces.size());
 
     // Load the primary and first extension with full paths and second extension by name.
-    load_ok = load(base_location + ':' + mid_location + ':' + tail_name);
+    load_ok = load(ART_FORMAT("{}:{}:{}", base_location, mid_location, tail_name));
     ASSERT_TRUE(load_ok) << error_msg;
     ASSERT_EQ(full_bcp.size(), boot_image_spaces.size());
 
     // Load the primary with full path, first extension without path,
     // and second extension with full path.
-    load_ok = load(base_location + ':' + mid_name + ':' + tail_location);
+    load_ok = load(ART_FORMAT("{}:{}:{}", base_location, mid_name, tail_location));
     ASSERT_TRUE(load_ok) << error_msg;  // Loaded successfully.
     ASSERT_EQ(full_bcp.size(), boot_image_spaces.size());  // Including both extensions.
 
@@ -551,18 +553,18 @@
     ASSERT_EQ(full_bcp.size(), boot_image_spaces.size());
 
     // Fail to load any images with invalid image locations (named component after search paths).
-    load_ok = silent_load(base_location + ":*:" + tail_location);
+    load_ok = silent_load(ART_FORMAT("{}:*:{}", base_location, tail_location));
     ASSERT_FALSE(load_ok);
-    load_ok = silent_load(base_location + ':' + scratch_dir + "*:" + tail_location);
+    load_ok = silent_load(ART_FORMAT("{}:{}*:{}", base_location, scratch_dir, tail_location));
     ASSERT_FALSE(load_ok);
 
     // Load the primary and single-image extension with full path.
-    load_ok = load(base_location + ':' + single_location);
+    load_ok = load(ART_FORMAT("{}:{}", base_location, single_location));
     ASSERT_TRUE(load_ok) << error_msg;
     ASSERT_EQ(head_dex_files.size() + 1u, boot_image_spaces.size());
 
     // Load the primary with full path and single-image extension with a specified search path.
-    load_ok = load(base_location + ':' + single_dir + '*');
+    load_ok = load(ART_FORMAT("{}:{}*", base_location, single_dir));
     ASSERT_TRUE(load_ok) << error_msg;
     ASSERT_EQ(head_dex_files.size() + 1u, boot_image_spaces.size());
   }
@@ -594,29 +596,31 @@
     relocate = r;
 
     // Load primary boot image with a profile name.
-    bool load_ok = silent_load(base_location + "!" + single_profile_filename);
+    bool load_ok = silent_load(ART_FORMAT("{}!{}", base_location, single_profile_filename));
     ASSERT_TRUE(load_ok);
 
     // Try and fail to load with invalid spec, two profile name separators.
-    load_ok = silent_load(base_location + ":" + single_location + "!!arbitrary-profile-name");
+    load_ok =
+        silent_load(ART_FORMAT("{}:{}!!arbitrary-profile-name", base_location, single_location));
     ASSERT_FALSE(load_ok);
 
     // Try and fail to load with invalid spec, missing profile name.
-    load_ok = silent_load(base_location + ":" + single_location + "!");
+    load_ok = silent_load(ART_FORMAT("{}:{}!", base_location, single_location));
     ASSERT_FALSE(load_ok);
 
     // Try and fail to load with invalid spec, missing component name.
-    load_ok = silent_load(base_location + ":!" + single_profile_filename);
+    load_ok = silent_load(ART_FORMAT("{}:!{}", base_location, single_profile_filename));
     ASSERT_FALSE(load_ok);
 
     // Load primary boot image, specifying invalid extension component and profile name.
-    load_ok = load(base_location + ":/non-existent/" + single_name + "!non-existent-profile-name");
+    load_ok = load(
+        ART_FORMAT("{}:/non-existent/{}!non-existent-profile-name", base_location, single_name));
     ASSERT_TRUE(load_ok) << error_msg;
     ASSERT_EQ(head_dex_files.size(), boot_image_spaces.size());
 
     // Load primary boot image and the single extension, specifying invalid profile name.
     // (Load extension from file.)
-    load_ok = load(base_location + ":" + single_location + "!non-existent-profile-name");
+    load_ok = load(ART_FORMAT("{}:{}!non-existent-profile-name", base_location, single_location));
     ASSERT_TRUE(load_ok) << error_msg;
     ASSERT_EQ(head_dex_files.size() + 1u, boot_image_spaces.size());
     ASSERT_EQ(single_dex_files.size(),
@@ -626,7 +630,8 @@
     // invalid extension component name but a valid profile file.
     // (Running dex2oat to compile extension is disabled.)
     ASSERT_FALSE(Runtime::Current()->IsImageDex2OatEnabled());
-    load_ok = load(base_location + ":/non-existent/" + single_name + "!" + single_profile_filename);
+    load_ok = load(
+        ART_FORMAT("{}:/non-existent/{}!{}", base_location, single_name, single_profile_filename));
     ASSERT_TRUE(load_ok) << error_msg;
     ASSERT_EQ(head_dex_files.size(), boot_image_spaces.size());
 
@@ -634,7 +639,8 @@
 
     // Load primary boot image and the single extension, specifying invalid extension
     // component name but a valid profile file. (Compile extension by running dex2oat.)
-    load_ok = load(base_location + ":/non-existent/" + single_name + "!" + single_profile_filename);
+    load_ok = load(
+        ART_FORMAT("{}:/non-existent/{}!{}", base_location, single_name, single_profile_filename));
     ASSERT_TRUE(load_ok) << error_msg;
     ASSERT_EQ(head_dex_files.size() + 1u, boot_image_spaces.size());
     ASSERT_EQ(single_dex_files.size(),
@@ -642,8 +648,12 @@
 
     // Load primary boot image and two extensions, specifying invalid extension component
     // names but valid profile files. (Compile extensions by running dex2oat.)
-    load_ok = load(base_location + ":/non-existent/" + mid_name + "!" + mid_profile_filename
-                                 + ":/non-existent/" + tail_name + "!" + tail_profile_filename);
+    load_ok = load(ART_FORMAT("{}:/non-existent/{}!{}:/non-existent/{}!{}",
+                              base_location,
+                              mid_name,
+                              mid_profile_filename,
+                              tail_name,
+                              tail_profile_filename));
     ASSERT_TRUE(load_ok) << error_msg;
     ASSERT_EQ(head_dex_files.size() + 2u, boot_image_spaces.size());
     ASSERT_EQ(mid_dex_files.size(),
@@ -654,8 +664,11 @@
     // Load primary boot image and fail to load extensions, specifying invalid component
     // names but valid profile file only for the second one. As we fail to load the first
     // extension, the second extension has a missing dependency and cannot be compiled.
-    load_ok = load(base_location + ":/non-existent/" + mid_name
-                                 + ":/non-existent/" + tail_name + "!" + tail_profile_filename);
+    load_ok = load(ART_FORMAT("{}:/non-existent/{}:/non-existent/{}!{}",
+                              base_location,
+                              mid_name,
+                              tail_name,
+                              tail_profile_filename));
     ASSERT_TRUE(load_ok) << error_msg;
     ASSERT_EQ(head_dex_files.size(), boot_image_spaces.size());
 
diff --git a/dex2oat/dex2oat_options.cc b/dex2oat/dex2oat_options.cc
index 1c46d13..7386fe1 100644
--- a/dex2oat/dex2oat_options.cc
+++ b/dex2oat/dex2oat_options.cc
@@ -34,7 +34,7 @@
   }
 
   static const char* Name() { return "InstructionSet"; }
-  static const char* DescribeType() { return "arm|arm64|x86|x86_64|none"; }
+  static const char* DescribeType() { return "arm|arm64|riscv64|x86|x86_64|none"; }
 };
 
 #define COMPILER_OPTIONS_MAP_TYPE Dex2oatArgumentMap
diff --git a/dex2oat/dex2oat_options.h b/dex2oat/dex2oat_options.h
index 1da1ff9..ef07512 100644
--- a/dex2oat/dex2oat_options.h
+++ b/dex2oat/dex2oat_options.h
@@ -27,8 +27,8 @@
 #include "compiler.h"
 #include "dex/compact_dex_level.h"
 #include "driver/compiler_options_map.h"
-#include "image.h"
 #include "linker/oat_writer.h"
+#include "oat/image.h"
 
 namespace art {
 
diff --git a/dex2oat/dex2oat_test.cc b/dex2oat/dex2oat_test.cc
index 511fdfa..4a8a4f3 100644
--- a/dex2oat/dex2oat_test.cc
+++ b/dex2oat/dex2oat_test.cc
@@ -19,6 +19,7 @@
 
 #include <algorithm>
 #include <iterator>
+#include <optional>
 #include <regex>
 #include <sstream>
 #include <string>
@@ -42,12 +43,12 @@
 #include "dex/dex_file-inl.h"
 #include "dex/dex_file_loader.h"
 #include "dex2oat_environment_test.h"
-#include "elf_file.h"
-#include "elf_file_impl.h"
 #include "gc_root-inl.h"
 #include "intern_table-inl.h"
-#include "oat.h"
-#include "oat_file.h"
+#include "oat/elf_file.h"
+#include "oat/elf_file_impl.h"
+#include "oat/oat.h"
+#include "oat/oat_file.h"
 #include "profile/profile_compilation_info.h"
 #include "vdex_file.h"
 #include "ziparchive/zip_writer.h"
@@ -207,7 +208,7 @@
 // to what's already huge test methods).
 class Dex2oatWithExpectedFilterTest : public Dex2oatTest {
  protected:
-  void CheckFilter(CompilerFilter::Filter expected ATTRIBUTE_UNUSED,
+  void CheckFilter([[maybe_unused]] CompilerFilter::Filter expected,
                    CompilerFilter::Filter actual) override {
     EXPECT_EQ(expected_filter_, actual);
   }
@@ -251,7 +252,7 @@
     }
   }
 
-  virtual void CheckTargetResult(bool expect_use ATTRIBUTE_UNUSED) {
+  virtual void CheckTargetResult([[maybe_unused]] bool expect_use) {
     // TODO: Ignore for now, as we won't capture any output (it goes to the logcat). We may do
     //       something for variants with file descriptor where we can control the lifetime of
     //       the swap file and thus take a look at it.
@@ -441,8 +442,8 @@
 
 class Dex2oatVeryLargeTest : public Dex2oatTest {
  protected:
-  void CheckFilter(CompilerFilter::Filter input ATTRIBUTE_UNUSED,
-                   CompilerFilter::Filter result ATTRIBUTE_UNUSED) override {
+  void CheckFilter([[maybe_unused]] CompilerFilter::Filter input,
+                   [[maybe_unused]] CompilerFilter::Filter result) override {
     // Ignore, we'll do our own checks.
   }
 
@@ -537,7 +538,7 @@
     }
   }
 
-  void CheckTargetResult(bool expect_downgrade ATTRIBUTE_UNUSED) {
+  void CheckTargetResult([[maybe_unused]] bool expect_downgrade) {
     // TODO: Ignore for now. May do something for fd things.
   }
 
@@ -591,8 +592,8 @@
 
 class Dex2oatLayoutTest : public Dex2oatTest {
  protected:
-  void CheckFilter(CompilerFilter::Filter input ATTRIBUTE_UNUSED,
-                   CompilerFilter::Filter result ATTRIBUTE_UNUSED) override {
+  void CheckFilter([[maybe_unused]] CompilerFilter::Filter input,
+                   [[maybe_unused]] CompilerFilter::Filter result) override {
     // Ignore, we'll do our own checks.
   }
 
@@ -1089,9 +1090,11 @@
 TEST_F(Dex2oatClassLoaderContextTest, ContextWithOtherDexFiles) {
   std::vector<std::unique_ptr<const DexFile>> dex_files = OpenTestDexFiles("Nested");
 
+  uint32_t expected_checksum = DexFileLoader::GetMultiDexChecksum(dex_files);
+
   std::string context = "PCL[" + dex_files[0]->GetLocation() + "]";
-  std::string expected_classpath_key = "PCL[" + dex_files[0]->GetLocation() + "*" +
-                                       std::to_string(dex_files[0]->GetLocationChecksum()) + "]";
+  std::string expected_classpath_key =
+      "PCL[" + dex_files[0]->GetLocation() + "*" + std::to_string(expected_checksum) + "]";
   RunTest(context.c_str(), expected_classpath_key.c_str(), true);
 }
 
@@ -1317,6 +1320,10 @@
   ASSERT_EQ(oat_dex_files.size(), 1u);
   // Check that the code sections match what we expect.
   for (const OatDexFile* oat_dex : oat_dex_files) {
+    if (oat_dex->GetDexVersion() >= DexFile::kDexContainerVersion) {
+      continue;  // Compact dex isn't supported together with dex container.
+    }
+
     const DexLayoutSections* const sections = oat_dex->GetDexLayoutSections();
     // Testing of logging the sections.
     ASSERT_TRUE(sections != nullptr);
@@ -1430,6 +1437,10 @@
   std::vector<std::unique_ptr<const CompactDexFile>> compact_dex_files;
   for (const OatDexFile* oat_dex : oat_dex_files) {
     std::unique_ptr<const DexFile> dex_file(oat_dex->OpenDexFile(&error_msg));
+    if (dex_file->HasDexContainer()) {
+      ASSERT_FALSE(dex_file->IsCompactDexFile());
+      continue;  // Compact dex isn't supported together with dex container.
+    }
     ASSERT_TRUE(dex_file != nullptr) << error_msg;
     ASSERT_TRUE(dex_file->IsCompactDexFile());
     compact_dex_files.push_back(
@@ -1860,8 +1871,8 @@
     ZipWriter writer(file);
     writer.StartEntry("classes.dex", ZipWriter::kAlign32);
     DexFile::Header header = {};
-    StandardDexFile::WriteMagic(header.magic_);
-    StandardDexFile::WriteCurrentVersion(header.magic_);
+    StandardDexFile::WriteMagic(header.magic_.data());
+    StandardDexFile::WriteCurrentVersion(header.magic_.data());
     header.file_size_ = 4 * KB;
     header.data_size_ = 4 * KB;
     header.data_off_ = 10 * MB;
@@ -1884,10 +1895,9 @@
 // Test that dex2oat with a CompactDex file in the APK fails.
 TEST_F(Dex2oatTest, CompactDexInZip) {
   CompactDexFile::Header header = {};
-  CompactDexFile::WriteMagic(header.magic_);
-  CompactDexFile::WriteCurrentVersion(header.magic_);
+  CompactDexFile::WriteMagic(header.magic_.data());
+  CompactDexFile::WriteCurrentVersion(header.magic_.data());
   header.file_size_ = sizeof(CompactDexFile::Header);
-  header.data_off_ = 10 * MB;
   header.map_off_ = 10 * MB;
   header.class_defs_off_ = 10 * MB;
   header.class_defs_size_ = 10000;
@@ -2007,7 +2017,7 @@
       ASSERT_GT(header->file_size_,
                 sizeof(*header) + sizeof(dex::MapList) + sizeof(dex::MapItem) * 2);
       // Move map list to be right after the header.
-      header->map_off_ = sizeof(DexFile::Header);
+      header->map_off_ = header->header_size_;
       dex::MapList* map_list = const_cast<dex::MapList*>(dex->GetMapList());
       map_list->list_[0].type_ = DexFile::kDexTypeHeaderItem;
       map_list->list_[0].size_ = 1u;
@@ -2018,6 +2028,7 @@
       map_list->size_ = 2;
       header->data_off_ = header->map_off_;
       header->data_size_ = map_list->Size();
+      header->SetDexContainer(0, header->file_size_);
     });
   }
   std::unique_ptr<const DexFile> dex_file(OpenDexFile(temp_dex.GetFilename().c_str()));
@@ -2218,21 +2229,9 @@
   const std::string odex_location = out_dir + "/base.odex";
   const std::string valid_context = "PCL[" + dex_files[0]->GetLocation() + "]";
   const std::string stored_context = "PCL[/system/not_real_lib.jar]";
-  std::string expected_stored_context = "PCL[";
-  size_t index = 1;
-  for (const std::unique_ptr<const DexFile>& dex_file : dex_files) {
-    const bool is_first = index == 1u;
-    if (!is_first) {
-      expected_stored_context += ":";
-    }
-    expected_stored_context += "/system/not_real_lib.jar";
-    if (!is_first) {
-      expected_stored_context += "!classes" + std::to_string(index) + ".dex";
-    }
-    expected_stored_context += "*" + std::to_string(dex_file->GetLocationChecksum());
-    ++index;
-  }
-  expected_stored_context += "]";
+  uint32_t checksum = DexFileLoader::GetMultiDexChecksum(dex_files);
+  std::string expected_stored_context =
+      "PCL[/system/not_real_lib.jar*" + std::to_string(checksum) + "]";
   // The class path should not be valid and should fail being stored.
   EXPECT_TRUE(GenerateOdexForTest(GetTestDexFileName("ManyMethods"),
                                   odex_location,
diff --git a/dex2oat/driver/compiler_driver.cc b/dex2oat/driver/compiler_driver.cc
index 969b8c0..824319b 100644
--- a/dex2oat/driver/compiler_driver.cc
+++ b/dex2oat/driver/compiler_driver.cc
@@ -28,7 +28,6 @@
 #include "android-base/logging.h"
 #include "android-base/strings.h"
 
-#include "aot_class_linker.h"
 #include "art_field-inl.h"
 #include "art_method-inl.h"
 #include "base/arena_allocator.h"
@@ -71,6 +70,7 @@
 #include "mirror/object-refvisitor-inl.h"
 #include "mirror/object_array-inl.h"
 #include "mirror/throwable.h"
+#include "oat/aot_class_linker.h"
 #include "object_lock.h"
 #include "profile/profile_compilation_info.h"
 #include "runtime.h"
@@ -274,12 +274,12 @@
 }
 
 CompilerDriver::~CompilerDriver() {
-  compiled_methods_.Visit([this](const DexFileReference& ref ATTRIBUTE_UNUSED,
-                                 CompiledMethod* method) {
-    if (method != nullptr) {
-      CompiledMethod::ReleaseSwapAllocatedCompiledMethod(GetCompiledMethodStorage(), method);
-    }
-  });
+  compiled_methods_.Visit(
+      [this]([[maybe_unused]] const DexFileReference& ref, CompiledMethod* method) {
+        if (method != nullptr) {
+          CompiledMethod::ReleaseSwapAllocatedCompiledMethod(GetCompiledMethodStorage(), method);
+        }
+      });
 }
 
 
@@ -459,17 +459,16 @@
     const DexFile& dex_file,
     Handle<mirror::DexCache> dex_cache,
     ProfileCompilationInfo::ProfileIndexType profile_index) {
-  auto quick_fn = [profile_index](
-      Thread* self ATTRIBUTE_UNUSED,
-      CompilerDriver* driver,
-      const dex::CodeItem* code_item,
-      uint32_t access_flags,
-      InvokeType invoke_type,
-      uint16_t class_def_idx,
-      uint32_t method_idx,
-      Handle<mirror::ClassLoader> class_loader,
-      const DexFile& dex_file,
-      Handle<mirror::DexCache> dex_cache) {
+  auto quick_fn = [profile_index]([[maybe_unused]] Thread* self,
+                                  CompilerDriver* driver,
+                                  const dex::CodeItem* code_item,
+                                  uint32_t access_flags,
+                                  InvokeType invoke_type,
+                                  uint16_t class_def_idx,
+                                  uint32_t method_idx,
+                                  Handle<mirror::ClassLoader> class_loader,
+                                  const DexFile& dex_file,
+                                  Handle<mirror::DexCache> dex_cache) {
     DCHECK(driver != nullptr);
     const VerificationResults* results = driver->GetVerificationResults();
     DCHECK(results != nullptr);
@@ -761,7 +760,7 @@
   }
 }
 
-void CompilerDriver::PrepareDexFilesForOatFile(TimingLogger* timings ATTRIBUTE_UNUSED) {
+void CompilerDriver::PrepareDexFilesForOatFile([[maybe_unused]] TimingLogger* timings) {
   compiled_classes_.AddDexFiles(GetCompilerOptions().GetDexFilesForOatFile());
 }
 
@@ -1017,7 +1016,7 @@
 #define CHECK_INTRINSIC_OWNER_CLASS(_, __, ___, ____, _____, ClassName, ______, _______) \
   CHECK(image_classes->find(std::string_view(ClassName)) != image_classes->end());
 
-  INTRINSICS_LIST(CHECK_INTRINSIC_OWNER_CLASS)
+  ART_INTRINSICS_LIST(CHECK_INTRINSIC_OWNER_CLASS)
 #undef CHECK_INTRINSIC_OWNER_CLASS
 }
 
@@ -1231,8 +1230,7 @@
   // Visitor for VisitReferences.
   void operator()(ObjPtr<mirror::Object> object,
                   MemberOffset field_offset,
-                  bool is_static ATTRIBUTE_UNUSED) const
-      REQUIRES_SHARED(Locks::mutator_lock_) {
+                  [[maybe_unused]] bool is_static) const REQUIRES_SHARED(Locks::mutator_lock_) {
     mirror::Object* ref = object->GetFieldObject<mirror::Object>(field_offset);
     if (ref != nullptr) {
       VisitClinitClassesObject(ref);
@@ -1240,13 +1238,13 @@
   }
 
   // java.lang.ref.Reference visitor for VisitReferences.
-  void operator()(ObjPtr<mirror::Class> klass ATTRIBUTE_UNUSED,
-                  ObjPtr<mirror::Reference> ref ATTRIBUTE_UNUSED) const {}
+  void operator()([[maybe_unused]] ObjPtr<mirror::Class> klass,
+                  [[maybe_unused]] ObjPtr<mirror::Reference> ref) const {}
 
   // Ignore class native roots.
-  void VisitRootIfNonNull(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED)
-      const {}
-  void VisitRoot(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED) const {}
+  void VisitRootIfNonNull(
+      [[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {}
+  void VisitRoot([[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {}
 
   void Walk() REQUIRES_SHARED(Locks::mutator_lock_) {
     // Find all the already-marked classes.
@@ -2806,8 +2804,8 @@
 void CompilerDriver::InitializeThreadPools() {
   size_t parallel_count = parallel_thread_count_ > 0 ? parallel_thread_count_ - 1 : 0;
   parallel_thread_pool_.reset(
-      new ThreadPool("Compiler driver thread pool", parallel_count));
-  single_thread_pool_.reset(new ThreadPool("Single-threaded Compiler driver thread pool", 0));
+      ThreadPool::Create("Compiler driver thread pool", parallel_count));
+  single_thread_pool_.reset(ThreadPool::Create("Single-threaded Compiler driver thread pool", 0));
 }
 
 void CompilerDriver::FreeThreadPools() {
diff --git a/dex2oat/linker/arm/relative_patcher_arm_base.cc b/dex2oat/linker/arm/relative_patcher_arm_base.cc
index 1cb72f6..9a604be 100644
--- a/dex2oat/linker/arm/relative_patcher_arm_base.cc
+++ b/dex2oat/linker/arm/relative_patcher_arm_base.cc
@@ -21,8 +21,8 @@
 #include "dex/dex_file_types.h"
 #include "driver/compiled_method-inl.h"
 #include "linker/linker_patch.h"
-#include "oat.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat.h"
+#include "oat/oat_quick_method_header.h"
 #include "stream/output_stream.h"
 
 namespace art {
diff --git a/dex2oat/linker/arm/relative_patcher_thumb2.h b/dex2oat/linker/arm/relative_patcher_thumb2.h
index d360482..b3a3eb5 100644
--- a/dex2oat/linker/arm/relative_patcher_thumb2.h
+++ b/dex2oat/linker/arm/relative_patcher_thumb2.h
@@ -23,10 +23,6 @@
 
 namespace art {
 
-namespace arm {
-class ArmVIXLAssembler;
-}  // namespace arm
-
 namespace linker {
 
 class Thumb2RelativePatcher final : public ArmBaseRelativePatcher {
diff --git a/dex2oat/linker/arm/relative_patcher_thumb2_test.cc b/dex2oat/linker/arm/relative_patcher_thumb2_test.cc
index f7abd6b..461a331 100644
--- a/dex2oat/linker/arm/relative_patcher_thumb2_test.cc
+++ b/dex2oat/linker/arm/relative_patcher_thumb2_test.cc
@@ -23,7 +23,7 @@
 #include "lock_word.h"
 #include "mirror/array-inl.h"
 #include "mirror/object.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "optimizing/code_generator_arm_vixl.h"
 #include "optimizing/optimizing_unit_test.h"
 
@@ -211,6 +211,19 @@
     OptimizingUnitTestHelper helper;
     HGraph* graph = helper.CreateGraph();
     CompilerOptions compiler_options;
+
+    // Set isa to Thumb2.
+    compiler_options.instruction_set_ = instruction_set_;
+    compiler_options.instruction_set_features_ =
+        InstructionSetFeatures::FromBitmap(instruction_set_, instruction_set_features_->AsBitmap());
+    CHECK(compiler_options.instruction_set_features_->Equals(instruction_set_features_.get()));
+
+    // If a test requests that implicit null checks are enabled or disabled,
+    // apply that option, otherwise use the default from `CompilerOptions`.
+    if (implicit_null_checks_.has_value()) {
+      compiler_options.implicit_null_checks_ = implicit_null_checks_.value();
+    }
+
     arm::CodeGeneratorARMVIXL codegen(graph, compiler_options);
     ArenaVector<uint8_t> code(helper.GetAllocator()->Adapter());
     codegen.EmitThunkCode(patch, &code, debug_name);
@@ -326,8 +339,16 @@
            (static_cast<uint32_t>(output_[offset + 1]) << 8);
   }
 
-  void TestBakerFieldWide(uint32_t offset, uint32_t ref_reg);
-  void TestBakerFieldNarrow(uint32_t offset, uint32_t ref_reg);
+  void TestBakerFieldWide(uint32_t offset, uint32_t ref_reg, bool implicit_null_checks);
+  void TestBakerFieldNarrow(uint32_t offset, uint32_t ref_reg, bool implicit_null_checks);
+
+  void Reset() final {
+    RelativePatcherTest::Reset();
+    implicit_null_checks_ = std::nullopt;
+  }
+
+ private:
+  std::optional<bool> implicit_null_checks_ = std::nullopt;
 };
 
 const uint8_t Thumb2RelativePatcherTest::kCallRawCode[] = {
@@ -702,7 +723,10 @@
     0,  1,  2,  3,  4,  5,  6,  7,
 };
 
-void Thumb2RelativePatcherTest::TestBakerFieldWide(uint32_t offset, uint32_t ref_reg) {
+void Thumb2RelativePatcherTest::TestBakerFieldWide(uint32_t offset,
+                                                   uint32_t ref_reg,
+                                                   bool implicit_null_checks) {
+  implicit_null_checks_ = implicit_null_checks;
   DCHECK_ALIGNED(offset, 4u);
   DCHECK_LT(offset, 4 * KB);
   constexpr size_t kMethodCodeSize = 8u;
@@ -750,7 +774,7 @@
       }
 
       size_t gray_check_offset = thunk_offset;
-      if (holder_reg == base_reg) {
+      if (implicit_null_checks && holder_reg == base_reg) {
         // Verify that the null-check uses the correct register, i.e. holder_reg.
         if (holder_reg < 8) {
           ASSERT_GE(output_.size() - gray_check_offset, 2u);
@@ -797,7 +821,10 @@
   }
 }
 
-void Thumb2RelativePatcherTest::TestBakerFieldNarrow(uint32_t offset, uint32_t ref_reg) {
+void Thumb2RelativePatcherTest::TestBakerFieldNarrow(uint32_t offset,
+                                                     uint32_t ref_reg,
+                                                     bool implicit_null_checks) {
+  implicit_null_checks_ = implicit_null_checks;
   DCHECK_ALIGNED(offset, 4u);
   DCHECK_LT(offset, 32u);
   constexpr size_t kMethodCodeSize = 6u;
@@ -851,7 +878,7 @@
       }
 
       size_t gray_check_offset = thunk_offset;
-      if (holder_reg == base_reg) {
+      if (implicit_null_checks && holder_reg == base_reg) {
         // Verify that the null-check uses the correct register, i.e. holder_reg.
         if (holder_reg < 8) {
           ASSERT_GE(output_.size() - gray_check_offset, 2u);
@@ -911,7 +938,9 @@
   };
   for (const TestCase& test_case : test_cases) {
     Reset();
-    TestBakerFieldWide(test_case.offset, test_case.ref_reg);
+    TestBakerFieldWide(test_case.offset, test_case.ref_reg, /*implicit_null_checks=*/ true);
+    Reset();
+    TestBakerFieldWide(test_case.offset, test_case.ref_reg, /*implicit_null_checks=*/ false);
   }
 }
 
@@ -927,7 +956,9 @@
   };
   for (const TestCase& test_case : test_cases) {
     Reset();
-    TestBakerFieldNarrow(test_case.offset, test_case.ref_reg);
+    TestBakerFieldNarrow(test_case.offset, test_case.ref_reg, /*implicit_null_checks=*/ true);
+    Reset();
+    TestBakerFieldNarrow(test_case.offset, test_case.ref_reg, /*implicit_null_checks=*/ false);
   }
 }
 
diff --git a/dex2oat/linker/arm64/relative_patcher_arm64.cc b/dex2oat/linker/arm64/relative_patcher_arm64.cc
index 6b84472..e7431e4 100644
--- a/dex2oat/linker/arm64/relative_patcher_arm64.cc
+++ b/dex2oat/linker/arm64/relative_patcher_arm64.cc
@@ -29,8 +29,8 @@
 #include "lock_word.h"
 #include "mirror/array-inl.h"
 #include "mirror/object.h"
-#include "oat.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat.h"
+#include "oat/oat_quick_method_header.h"
 #include "read_barrier.h"
 #include "stream/output_stream.h"
 
@@ -71,6 +71,7 @@
     case LinkerPatch::Type::kPackageTypeBssEntry:
     case LinkerPatch::Type::kStringRelative:
     case LinkerPatch::Type::kStringBssEntry:
+    case LinkerPatch::Type::kMethodTypeBssEntry:
       return patch.LiteralOffset() == patch.PcInsnOffset();
   }
 }
@@ -251,13 +252,13 @@
   } else {
     if ((insn & 0xfffffc00) == 0x91000000) {
       // ADD immediate, 64-bit with imm12 == 0 (unset).
-      if (!gUseReadBarrier) {
+      if (kUseBakerReadBarrier) {
         DCHECK(patch.GetType() == LinkerPatch::Type::kIntrinsicReference ||
                patch.GetType() == LinkerPatch::Type::kMethodRelative ||
                patch.GetType() == LinkerPatch::Type::kTypeRelative ||
                patch.GetType() == LinkerPatch::Type::kStringRelative) << patch.GetType();
       } else {
-        // With the read barrier (non-Baker) enabled, it could be kStringBssEntry or kTypeBssEntry.
+        // With the read barrier (non-Baker) enabled, it could be kStringBssEntry or k*TypeBssEntry.
         DCHECK(patch.GetType() == LinkerPatch::Type::kIntrinsicReference ||
                patch.GetType() == LinkerPatch::Type::kMethodRelative ||
                patch.GetType() == LinkerPatch::Type::kTypeRelative ||
diff --git a/dex2oat/linker/arm64/relative_patcher_arm64.h b/dex2oat/linker/arm64/relative_patcher_arm64.h
index 9ad2c96..ce90b80 100644
--- a/dex2oat/linker/arm64/relative_patcher_arm64.h
+++ b/dex2oat/linker/arm64/relative_patcher_arm64.h
@@ -22,10 +22,6 @@
 
 namespace art {
 
-namespace arm64 {
-class Arm64Assembler;
-}  // namespace arm64
-
 namespace linker {
 
 class Arm64RelativePatcher final : public ArmBaseRelativePatcher {
diff --git a/dex2oat/linker/arm64/relative_patcher_arm64_test.cc b/dex2oat/linker/arm64/relative_patcher_arm64_test.cc
index ce61f43..31160b9 100644
--- a/dex2oat/linker/arm64/relative_patcher_arm64_test.cc
+++ b/dex2oat/linker/arm64/relative_patcher_arm64_test.cc
@@ -23,7 +23,7 @@
 #include "lock_word.h"
 #include "mirror/array-inl.h"
 #include "mirror/object.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "optimizing/code_generator_arm64.h"
 #include "optimizing/optimizing_unit_test.h"
 
@@ -82,7 +82,7 @@
   // CBNZ x17, +0. Bits 5-23 are a placeholder for target offset from PC in units of 4-bytes.
   static constexpr uint32_t kCbnzIP1Plus0Insn = 0xb5000011u;
 
-  void InsertInsn(std::vector<uint8_t>* code, size_t pos, uint32_t insn) {
+  static void InsertInsn(std::vector<uint8_t>* code, size_t pos, uint32_t insn) {
     CHECK_LE(pos, code->size());
     const uint8_t insn_code[] = {
         static_cast<uint8_t>(insn),
@@ -94,11 +94,11 @@
     code->insert(code->begin() + pos, insn_code, insn_code + sizeof(insn_code));
   }
 
-  void PushBackInsn(std::vector<uint8_t>* code, uint32_t insn) {
+  static void PushBackInsn(std::vector<uint8_t>* code, uint32_t insn) {
     InsertInsn(code, code->size(), insn);
   }
 
-  std::vector<uint8_t> RawCode(std::initializer_list<uint32_t> insns) {
+  static std::vector<uint8_t> RawCode(std::initializer_list<uint32_t> insns) {
     std::vector<uint8_t> raw_code;
     raw_code.reserve(insns.size() * 4u);
     for (uint32_t insn : insns) {
@@ -184,6 +184,12 @@
         InstructionSetFeatures::FromBitmap(instruction_set_, instruction_set_features_->AsBitmap());
     CHECK(compiler_options.instruction_set_features_->Equals(instruction_set_features_.get()));
 
+    // If a test requests that implicit null checks are enabled or disabled,
+    // apply that option, otherwise use the default from `CompilerOptions`.
+    if (implicit_null_checks_.has_value()) {
+      compiler_options.implicit_null_checks_ = implicit_null_checks_.value();
+    }
+
     arm64::CodeGeneratorARM64 codegen(graph, compiler_options);
     ArenaVector<uint8_t> code(helper.GetAllocator()->Adapter());
     codegen.EmitThunkCode(patch, &code, debug_name);
@@ -235,7 +241,7 @@
     return false;
   }
 
-  std::vector<uint8_t> GenNops(size_t num_nops) {
+  static std::vector<uint8_t> GenNops(size_t num_nops) {
     std::vector<uint8_t> result;
     result.reserve(num_nops * 4u);
     for (size_t i = 0; i != num_nops; ++i) {
@@ -244,7 +250,7 @@
     return result;
   }
 
-  std::vector<uint8_t> GenNopsAndBl(size_t num_nops, uint32_t bl) {
+  static std::vector<uint8_t> GenNopsAndBl(size_t num_nops, uint32_t bl) {
     std::vector<uint8_t> result;
     result.reserve(num_nops * 4u + 4u);
     for (size_t i = 0; i != num_nops; ++i) {
@@ -556,7 +562,15 @@
            (static_cast<uint32_t>(output_[offset + 3]) << 24);
   }
 
-  void TestBakerField(uint32_t offset, uint32_t ref_reg);
+  void TestBakerField(uint32_t offset, uint32_t ref_reg, bool implicit_null_checks);
+
+  void Reset() final {
+    RelativePatcherTest::Reset();
+    implicit_null_checks_ = std::nullopt;
+  }
+
+ private:
+  std::optional<bool> implicit_null_checks_ = std::nullopt;
 };
 
 const uint8_t Arm64RelativePatcherTest::kCallRawCode[] = {
@@ -933,7 +947,7 @@
       [&](uint32_t adrp_offset, uint32_t string_offset) {
         Reset();
         /* ADD that uses the result register of "ADRP x0, addr" as both source and destination. */
-        uint32_t add = kSubXInsn | (100 << 10) | (0u << 5) | 0u;  /* ADD x0, x0, #100 */
+        uint32_t add = kAddXInsn | (100 << 10) | (0u << 5) | 0u;  /* ADD x0, x0, #100 */
         TestAdrpInsn2Add(add, adrp_offset, /*has_thunk=*/ false, string_offset);
       },
       { 0x12345678u, 0xffffc840 });
@@ -1038,7 +1052,10 @@
   EXPECT_EQ(br_ip0, GetOutputInsn(thunk_offset + 4u));
 }
 
-void Arm64RelativePatcherTest::TestBakerField(uint32_t offset, uint32_t ref_reg) {
+void Arm64RelativePatcherTest::TestBakerField(uint32_t offset,
+                                              uint32_t ref_reg,
+                                              bool implicit_null_checks) {
+  implicit_null_checks_ = implicit_null_checks;
   uint32_t valid_regs[] = {
       0,  1,  2,  3,  4,  5,  6,  7,  8,  9,
       10, 11, 12, 13, 14, 15,         18, 19,  // IP0 and IP1 are reserved.
@@ -1092,7 +1109,7 @@
       }
 
       size_t gray_check_offset = thunk_offset;
-      if (holder_reg == base_reg) {
+      if (implicit_null_checks && holder_reg == base_reg) {
         // Verify that the null-check CBZ uses the correct register, i.e. holder_reg.
         ASSERT_GE(output_.size() - gray_check_offset, 4u);
         ASSERT_EQ(0x34000000u | holder_reg, GetOutputInsn(thunk_offset) & 0xff00001fu);
@@ -1138,7 +1155,9 @@
   };
   for (const TestCase& test_case : test_cases) {
     Reset();
-    TestBakerField(test_case.offset, test_case.ref_reg);
+    TestBakerField(test_case.offset, test_case.ref_reg, /*implicit_null_checks=*/ true);
+    Reset();
+    TestBakerField(test_case.offset, test_case.ref_reg, /*implicit_null_checks=*/ false);
   }
 }
 
diff --git a/dex2oat/linker/code_info_table_deduper.cc b/dex2oat/linker/code_info_table_deduper.cc
index eff0292..a1c2e7f 100644
--- a/dex2oat/linker/code_info_table_deduper.cc
+++ b/dex2oat/linker/code_info_table_deduper.cc
@@ -16,7 +16,7 @@
 
 #include "code_info_table_deduper.h"
 
-#include "stack_map.h"
+#include "oat/stack_map.h"
 
 namespace art {
 namespace linker {
@@ -79,7 +79,7 @@
   // Insert entries for large tables to the `dedupe_set_` and check for duplicates.
   std::array<DedupeSetEntry*, kNumBitTables> dedupe_entries;
   std::fill(dedupe_entries.begin(), dedupe_entries.end(), nullptr);
-  CodeInfo::ForEachBitTableField([&](size_t i, auto member_pointer ATTRIBUTE_UNUSED) {
+  CodeInfo::ForEachBitTableField([&](size_t i, [[maybe_unused]] auto member_pointer) {
     if (LIKELY(code_info.HasBitTable(i))) {
       uint32_t table_bit_size = bit_table_bit_starts[i + 1u] - bit_table_bit_starts[i];
       if (table_bit_size >= kMinDedupSize) {
@@ -109,7 +109,7 @@
     });
     writer_.WriteInterleavedVarints(header);
     // Write bit tables and update offsets in `dedupe_set_` after encoding the `header`.
-    CodeInfo::ForEachBitTableField([&](size_t i, auto member_pointer ATTRIBUTE_UNUSED) {
+    CodeInfo::ForEachBitTableField([&](size_t i, [[maybe_unused]] auto member_pointer) {
       if (code_info.HasBitTable(i)) {
         size_t current_bit_offset = writer_.NumberOfWrittenBits();
         if (code_info.IsBitTableDeduped(i)) {
diff --git a/dex2oat/linker/elf_writer.cc b/dex2oat/linker/elf_writer.cc
index aa5097a..c050695 100644
--- a/dex2oat/linker/elf_writer.cc
+++ b/dex2oat/linker/elf_writer.cc
@@ -17,7 +17,7 @@
 #include "elf_writer.h"
 
 #include "base/unix_file/fd_file.h"
-#include "elf_file.h"
+#include "oat/elf_file.h"
 
 namespace art {
 namespace linker {
diff --git a/dex2oat/linker/elf_writer_quick.cc b/dex2oat/linker/elf_writer_quick.cc
index 61e5783..10dc23e 100644
--- a/dex2oat/linker/elf_writer_quick.cc
+++ b/dex2oat/linker/elf_writer_quick.cc
@@ -254,7 +254,7 @@
         builder_->GetDex()->Exists() ? builder_->GetDex()->GetAddress() : 0,
         dex_section_size_,
         debug_info);
-    debug_info_thread_pool_ = std::make_unique<ThreadPool>("Mini-debug-info writer", 1);
+    debug_info_thread_pool_.reset(ThreadPool::Create("Mini-debug-info writer", 1));
     debug_info_thread_pool_->AddTask(self, debug_info_task_.get());
     debug_info_thread_pool_->StartWorkers(self);
   }
diff --git a/dex2oat/linker/elf_writer_test.cc b/dex2oat/linker/elf_writer_test.cc
index 6fa5f66..e1ef575 100644
--- a/dex2oat/linker/elf_writer_test.cc
+++ b/dex2oat/linker/elf_writer_test.cc
@@ -22,10 +22,10 @@
 #include "base/utils.h"
 #include "common_compiler_driver_test.h"
 #include "elf/elf_builder.h"
-#include "elf_file.h"
-#include "elf_file_impl.h"
 #include "elf_writer_quick.h"
-#include "oat.h"
+#include "oat/elf_file.h"
+#include "oat/elf_file_impl.h"
+#include "oat/oat.h"
 
 namespace art {
 namespace linker {
@@ -99,7 +99,7 @@
     bool success = ef->GetLoadedSize(&size, &error_msg);
     CHECK(success) << error_msg;
     MemMap reservation = MemMap::MapAnonymous("ElfWriterTest#dlsym reservation",
-                                              RoundUp(size, kPageSize),
+                                              RoundUp(size, MemMap::GetPageSize()),
                                               PROT_NONE,
                                               /*low_4gb=*/ true,
                                               &error_msg);
diff --git a/dex2oat/linker/image_test.cc b/dex2oat/linker/image_test.cc
index 82c87f5..f64462e 100644
--- a/dex2oat/linker/image_test.cc
+++ b/dex2oat/linker/image_test.cc
@@ -19,7 +19,7 @@
 
 #include "image_test.h"
 
-#include "image.h"
+#include "oat/image.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread.h"
 
@@ -64,41 +64,44 @@
 }
 
 TEST_F(ImageTest, ImageHeaderIsValid) {
-    uint32_t image_begin = ART_BASE_ADDRESS;
-    uint32_t image_size_ = 16 * KB;
-    uint32_t image_roots = ART_BASE_ADDRESS + (1 * KB);
-    uint32_t oat_checksum = 0;
-    uint32_t oat_file_begin = ART_BASE_ADDRESS + (4 * KB);  // page aligned
-    uint32_t oat_data_begin = ART_BASE_ADDRESS + (8 * KB);  // page aligned
-    uint32_t oat_data_end = ART_BASE_ADDRESS + (9 * KB);
-    uint32_t oat_file_end = ART_BASE_ADDRESS + (10 * KB);
-    ImageSection sections[ImageHeader::kSectionCount];
-    uint32_t image_reservation_size = RoundUp(oat_file_end - image_begin, kPageSize);
-    ImageHeader image_header(image_reservation_size,
-                             /*component_count=*/ 1u,
-                             image_begin,
-                             image_size_,
-                             sections,
-                             image_roots,
-                             oat_checksum,
-                             oat_file_begin,
-                             oat_data_begin,
-                             oat_data_end,
-                             oat_file_end,
-                             /*boot_image_begin=*/ 0u,
-                             /*boot_image_size=*/ 0u,
-                             /*boot_image_component_count=*/ 0u,
-                             /*boot_image_checksum=*/ 0u,
-                             sizeof(void*));
+  uint32_t image_begin = ART_BASE_ADDRESS;
+  uint32_t image_size_ = kElfSegmentAlignment;
+  uint32_t image_roots = ART_BASE_ADDRESS + (1 * KB);
+  uint32_t oat_checksum = 0;
+  uint32_t oat_file_begin = ART_BASE_ADDRESS + (kElfSegmentAlignment);
+  uint32_t oat_data_begin = ART_BASE_ADDRESS + (2 * kElfSegmentAlignment);
+  uint32_t oat_data_end = ART_BASE_ADDRESS + (2 * kElfSegmentAlignment + 1 * KB);
+  uint32_t oat_file_end = ART_BASE_ADDRESS + (2 * kElfSegmentAlignment + 2 * KB);
+  ImageSection sections[ImageHeader::kSectionCount];
+  uint32_t image_reservation_size = RoundUp(oat_file_end - image_begin, kElfSegmentAlignment);
+  ImageHeader image_header(image_reservation_size,
+                           /*component_count=*/ 1u,
+                           image_begin,
+                           image_size_,
+                           sections,
+                           image_roots,
+                           oat_checksum,
+                           oat_file_begin,
+                           oat_data_begin,
+                           oat_data_end,
+                           oat_file_end,
+                           /*boot_image_begin=*/ 0u,
+                           /*boot_image_size=*/ 0u,
+                           /*boot_image_component_count=*/ 0u,
+                           /*boot_image_checksum=*/ 0u,
+                           sizeof(void*));
 
-    ASSERT_TRUE(image_header.IsValid());
-    ASSERT_TRUE(!image_header.IsAppImage());
+  ASSERT_TRUE(image_header.IsValid());
 
-    char* magic = const_cast<char*>(image_header.GetMagic());
-    strcpy(magic, "");  // bad magic
-    ASSERT_FALSE(image_header.IsValid());
-    strcpy(magic, "art\n000");  // bad version
-    ASSERT_FALSE(image_header.IsValid());
+  // Please note that for the following condition to be true, the above values should be chosen in
+  // a way that image_reservation_size != RoundUp(image_size_, kElfSegmentAlignment).
+  ASSERT_TRUE(!image_header.IsAppImage());
+
+  char* magic = const_cast<char*>(image_header.GetMagic());
+  strcpy(magic, "");  // bad magic
+  ASSERT_FALSE(image_header.IsValid());
+  strcpy(magic, "art\n000");  // bad version
+  ASSERT_FALSE(image_header.IsValid());
 }
 
 // Test that pointer to quick code is the same in
@@ -107,6 +110,11 @@
 // only if the copied method and the origin method are located in the
 // same oat file.
 TEST_F(ImageTest, TestDefaultMethods) {
+  // Use this test to compile managed code to catch crashes when compiling the boot class path.
+  // This test already needs to compile some managed methods and by compiling with "speed" we
+  // avoid the need to create a specialized profile for the "speed-profile" compilation.
+  // (Using "speed" shall compile most methods. We could compile more with "everything".)
+  SetCompilerFilter(CompilerFilter::kSpeed);
   CompilationHelper helper;
   Compile(ImageHeader::kStorageModeUncompressed,
           /*max_image_block_size=*/std::numeric_limits<uint32_t>::max(),
@@ -119,7 +127,7 @@
   ScopedObjectAccess soa(self);
 
   // Test the pointer to quick code is the same in origin method
-  // and in the copied method form the same oat file.
+  // and in the copied method from the same oat file.
   ObjPtr<mirror::Class> iface_klass =
       class_linker_->LookupClass(self, "LIface;", /*class_loader=*/ nullptr);
   ASSERT_NE(nullptr, iface_klass);
@@ -208,5 +216,67 @@
           /*image_classes_failing_aot_clinit=*/ {"LSubClass;", "LImplementsClass;"});
 }
 
+// Regression test for b/297453985, where we used to generate a bogus image
+// checksum.
+TEST_F(ImageTest, ImageChecksum) {
+  uint32_t image_begin = ART_BASE_ADDRESS;
+  uint32_t image_roots = ART_BASE_ADDRESS + (1 * KB);
+  ImageSection sections[ImageHeader::kSectionCount];
+  // We require bitmap section to be at least kElfSegmentAlignment.
+  sections[ImageHeader::kSectionImageBitmap] = ImageSection(0, kElfSegmentAlignment);
+  ImageHeader image_header(/*image_reservation_size=*/ kElfSegmentAlignment,
+                           /*component_count=*/ 1u,
+                           image_begin,
+                           /*image_size=*/ sizeof(ImageHeader),
+                           sections,
+                           image_roots,
+                           /*oat_checksum=*/ 0u,
+                           /*oat_file_begin=*/ 0u,
+                           /*oat_data_begin=*/ 0u,
+                           /*oat_data_end=*/ 0u,
+                           /*oat_file_end=*/ 0u,
+                           /*boot_image_begin=*/ 0u,
+                           /*boot_image_size=*/ 0u,
+                           /*boot_image_component_count=*/ 0u,
+                           /*boot_image_checksum=*/ 0u,
+                           sizeof(void*));
+    ASSERT_TRUE(image_header.IsValid());
+
+    std::string error_msg;
+    ImageFileGuard image_file;
+    ScratchFile location;
+    image_file.reset(OS::CreateEmptyFile(location.GetFilename().c_str()));
+    const uint8_t* data = reinterpret_cast<const uint8_t*>(&image_header);
+    std::unique_ptr<uint8_t> bitmap(new uint8_t[kElfSegmentAlignment]);
+    memset(bitmap.get(), 0, kElfSegmentAlignment);
+    ASSERT_EQ(image_header.GetImageChecksum(), 0u);
+    ASSERT_TRUE(image_header.WriteData(
+        image_file,
+        data,
+        bitmap.get(),
+        ImageHeader::kStorageModeUncompressed,
+        /*max_image_block_size=*/std::numeric_limits<uint32_t>::max(),
+        /*update_checksum=*/ true,
+        &error_msg)) << error_msg;
+
+    uint32_t first_checksum = image_header.GetImageChecksum();
+    // Reset the image checksum, `WriteData` updated it.
+    image_header.SetImageChecksum(0u);
+
+    // Change the header to ensure the checksum will be different.
+    image_header.SetOatChecksum(0xFFFF);
+
+    ASSERT_TRUE(image_header.WriteData(
+        image_file,
+        data,
+        bitmap.get(),
+        ImageHeader::kStorageModeUncompressed,
+        /*max_image_block_size=*/std::numeric_limits<uint32_t>::max(),
+        /*update_checksum=*/ true,
+        &error_msg)) << error_msg;
+
+    ASSERT_NE(first_checksum, image_header.GetImageChecksum());
+}
+
 }  // namespace linker
 }  // namespace art
diff --git a/dex2oat/linker/image_test.h b/dex2oat/linker/image_test.h
index 8dea9a6..b82f54b 100644
--- a/dex2oat/linker/image_test.h
+++ b/dex2oat/linker/image_test.h
@@ -17,7 +17,7 @@
 #ifndef ART_DEX2OAT_LINKER_IMAGE_TEST_H_
 #define ART_DEX2OAT_LINKER_IMAGE_TEST_H_
 
-#include "image.h"
+#include "oat/image.h"
 
 #include <memory>
 #include <string>
@@ -48,7 +48,7 @@
 #include "linker/multi_oat_relative_patcher.h"
 #include "lock_word.h"
 #include "mirror/object-inl.h"
-#include "oat.h"
+#include "oat/oat.h"
 #include "oat_writer.h"
 #include "read_barrier_config.h"
 #include "scoped_thread_state_change-inl.h"
@@ -83,6 +83,14 @@
     CommonCompilerDriverTest::SetUp();
   }
 
+  CompilerFilter::Filter GetCompilerFilter() const override {
+    return compiler_filter_;
+  }
+
+  void SetCompilerFilter(CompilerFilter::Filter compiler_filter) {
+    compiler_filter_ = compiler_filter;
+  }
+
   void Compile(ImageHeader::StorageMode storage_mode,
                uint32_t max_image_block_size,
                /*out*/ CompilationHelper& out_helper,
@@ -120,6 +128,9 @@
   void DoCompile(ImageHeader::StorageMode storage_mode, /*out*/ CompilationHelper& out_helper);
 
   HashSet<std::string> image_classes_;
+
+  // By default we compile with "speed-profile" and an empty profile. This compiles only JNI stubs.
+  CompilerFilter::Filter compiler_filter_ = CompilerFilter::kSpeedProfile;
 };
 
 inline CompilationHelper::~CompilationHelper() {
@@ -224,8 +235,9 @@
       key_value_store.Put(OatHeader::kBootClassPathKey,
                           android::base::Join(out_helper.dex_file_locations, ':'));
       key_value_store.Put(OatHeader::kApexVersionsKey, Runtime::Current()->GetApexVersions());
-      key_value_store.Put(OatHeader::kConcurrentCopying,
-                          gUseReadBarrier ? OatHeader::kTrueValue : OatHeader::kFalseValue);
+      key_value_store.Put(
+          OatHeader::kConcurrentCopying,
+          compiler_options_->EmitReadBarrier() ? OatHeader::kTrueValue : OatHeader::kFalseValue);
 
       std::vector<std::unique_ptr<ElfWriter>> elf_writers;
       std::vector<std::unique_ptr<OatWriter>> oat_writers;
@@ -246,10 +258,8 @@
       for (size_t i = 0, size = oat_writers.size(); i != size; ++i) {
         const DexFile* dex_file = class_path[i];
         rodata.push_back(elf_writers[i]->StartRoData());
-        ArrayRef<const uint8_t> raw_dex_file(
-            reinterpret_cast<const uint8_t*>(&dex_file->GetHeader()),
-            dex_file->GetHeader().file_size_);
-        oat_writers[i]->AddRawDexFileSource(raw_dex_file,
+        oat_writers[i]->AddRawDexFileSource(dex_file->GetContainer(),
+                                            dex_file->Begin(),
                                             dex_file->GetLocation().c_str(),
                                             dex_file->GetLocationChecksum());
 
@@ -371,7 +381,7 @@
   }
   DoCompile(storage_mode, helper);
   if (image_classes.begin() != image_classes.end()) {
-    // Make sure the class got initialized.
+    // Make sure all explicitly specified classes got initialized.
     ScopedObjectAccess soa(Thread::Current());
     ClassLinker* const class_linker = Runtime::Current()->GetClassLinker();
     for (const std::string& image_class : image_classes) {
diff --git a/dex2oat/linker/image_write_read_test.cc b/dex2oat/linker/image_write_read_test.cc
index 3e3dac1..aadcbea 100644
--- a/dex2oat/linker/image_write_read_test.cc
+++ b/dex2oat/linker/image_write_read_test.cc
@@ -102,13 +102,13 @@
     if (storage_mode == ImageHeader::kStorageModeUncompressed) {
       // Uncompressed, image should be smaller than file.
       ASSERT_LE(image_space->GetImageHeader().GetImageSize(), image_file_size);
-    } else if (image_file_size > 16 * KB) {
+    } else if (image_file_size > 4 * kElfSegmentAlignment) {
       // Compressed, file should be smaller than image. Not really valid for small images.
       ASSERT_LE(image_file_size, image_space->GetImageHeader().GetImageSize());
       // TODO: Actually validate the blocks, this is hard since the blocks are not copied over for
-      // compressed images. Add kPageSize since image_size is rounded up to this.
+      // compressed images. Add kElfSegmentAlignment since image_size is rounded up to this.
       ASSERT_GT(image_space->GetImageHeader().GetBlockCount() * max_image_block_size,
-                image_space->GetImageHeader().GetImageSize() - kPageSize);
+                image_space->GetImageHeader().GetImageSize() - kElfSegmentAlignment);
     }
 
     image_space->VerifyImageAllocations();
diff --git a/dex2oat/linker/image_writer.cc b/dex2oat/linker/image_writer.cc
index ad10acc..b663d32 100644
--- a/dex2oat/linker/image_writer.cc
+++ b/dex2oat/linker/image_writer.cc
@@ -41,7 +41,6 @@
 #include "dex/dex_file_types.h"
 #include "driver/compiler_options.h"
 #include "elf/elf_utils.h"
-#include "elf_file.h"
 #include "entrypoints/entrypoint_utils-inl.h"
 #include "gc/accounting/card_table-inl.h"
 #include "gc/accounting/heap_bitmap.h"
@@ -54,7 +53,6 @@
 #include "gc/space/space-inl.h"
 #include "gc/verification.h"
 #include "handle_scope-inl.h"
-#include "image-inl.h"
 #include "imt_conflict_table.h"
 #include "indirect_reference_table-inl.h"
 #include "intern_table-inl.h"
@@ -76,10 +74,13 @@
 #include "mirror/object_array-inl.h"
 #include "mirror/string-inl.h"
 #include "mirror/var_handle.h"
+#include "nterp_helpers-inl.h"
 #include "nterp_helpers.h"
-#include "oat.h"
-#include "oat_file.h"
-#include "oat_file_manager.h"
+#include "oat/elf_file.h"
+#include "oat/image-inl.h"
+#include "oat/oat.h"
+#include "oat/oat_file.h"
+#include "oat/oat_file_manager.h"
 #include "optimizing/intrinsic_objects.h"
 #include "runtime.h"
 #include "scoped_thread_state_change-inl.h"
@@ -116,18 +117,261 @@
 // Separate objects into multiple bins to optimize dirty memory use.
 static constexpr bool kBinObjects = true;
 
+namespace {
+
+// Dirty object data from dirty-image-objects.
+struct DirtyEntry {
+  // Reference field name and type.
+  struct RefInfo {
+    std::string_view name;
+    std::string_view type;
+  };
+
+  std::string_view class_descriptor;
+  // A "path" from class object to the dirty object. If empty -- the class itself is dirty.
+  std::vector<RefInfo> reference_path;
+  uint32_t sort_key = std::numeric_limits<uint32_t>::max();
+};
+
+// Parse dirty-image-object line of the format:
+// <class_descriptor>[.<reference_field_name>:<reference_field_type>]* [<sort_key>]
+std::optional<DirtyEntry> ParseDirtyEntry(std::string_view entry_str) {
+  DirtyEntry entry;
+  std::vector<std::string_view> tokens;
+  Split(entry_str, ' ', &tokens);
+  if (tokens.empty()) {
+    // entry_str is empty.
+    return std::nullopt;
+  }
+
+  std::string_view path_to_root = tokens[0];
+  // Parse sort_key if present, otherwise it will be uint32::max by default.
+  if (tokens.size() > 1) {
+    std::from_chars_result res =
+        std::from_chars(tokens[1].data(), tokens[1].data() + tokens[1].size(), entry.sort_key);
+    if (res.ec != std::errc()) {
+      LOG(WARNING) << "Failed to parse dirty object sort key: \"" << entry_str << "\"";
+      return std::nullopt;
+    }
+  }
+
+  std::vector<std::string_view> path_components;
+  Split(path_to_root, '.', &path_components);
+  if (path_components.empty()) {
+    return std::nullopt;
+  }
+  entry.class_descriptor = path_components[0];
+  for (size_t i = 1; i < path_components.size(); ++i) {
+    std::string_view name_and_type = path_components[i];
+    std::vector<std::string_view> ref_data;
+    Split(name_and_type, ':', &ref_data);
+    if (ref_data.size() != 2) {
+      LOG(WARNING) << "Failed to parse dirty object reference field: \"" << entry_str << "\"";
+      return std::nullopt;
+    }
+
+    std::string_view field_name = ref_data[0];
+    std::string_view field_type = ref_data[1];
+    entry.reference_path.push_back({field_name, field_type});
+  }
+
+  return entry;
+}
+
+// Calls VisitFunc for each non-null (reference)Object/ArtField pair.
+// Doesn't work with ObjectArray instances, because array elements don't have ArtField.
+class ReferenceFieldVisitor {
+ public:
+  using VisitFunc = std::function<void(mirror::Object&, ArtField&)>;
+
+  explicit ReferenceFieldVisitor(VisitFunc visit_func) : visit_func_(std::move(visit_func)) {}
+
+  void operator()(ObjPtr<mirror::Object> obj, MemberOffset offset, bool is_static) const
+      REQUIRES_SHARED(Locks::mutator_lock_) {
+    CHECK(!obj->IsObjectArray());
+    mirror::Object* field_obj =
+        obj->GetFieldObject<mirror::Object, kVerifyNone, kWithoutReadBarrier>(offset);
+    // Skip fields that contain null.
+    if (field_obj == nullptr) {
+      return;
+    }
+    // Skip self references.
+    if (field_obj == obj.Ptr()) {
+      return;
+    }
+
+    ArtField* field = nullptr;
+    // Don't use Object::FindFieldByOffset, because it can't find instance fields in classes.
+    // field = obj->FindFieldByOffset(offset);
+    if (is_static) {
+      CHECK(obj->IsClass());
+      field = ArtField::FindStaticFieldWithOffset(obj->AsClass(), offset.Uint32Value());
+    } else {
+      field = ArtField::
+          FindInstanceFieldWithOffset</*kExactOffset*/ true, kVerifyNone, kWithoutReadBarrier>(
+              obj->GetClass<kVerifyNone, kWithoutReadBarrier>(), offset.Uint32Value());
+    }
+    DCHECK(field != nullptr);
+    visit_func_(*field_obj, *field);
+  }
+
+  void operator()([[maybe_unused]] ObjPtr<mirror::Class> klass, ObjPtr<mirror::Reference> ref) const
+      REQUIRES_SHARED(Locks::mutator_lock_) {
+    operator()(ref, mirror::Reference::ReferentOffset(), /* is_static */ false);
+  }
+
+  void VisitRootIfNonNull([[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const
+      REQUIRES_SHARED(Locks::mutator_lock_) {
+    DCHECK(false) << "ReferenceFieldVisitor shouldn't visit roots";
+  }
+
+  void VisitRoot([[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const
+      REQUIRES_SHARED(Locks::mutator_lock_) {
+    DCHECK(false) << "ReferenceFieldVisitor shouldn't visit roots";
+  }
+
+ private:
+  VisitFunc visit_func_;
+};
+
+// Finds Class objects for descriptors of dirty entries.
+// Map keys are string_views, that point to strings from `dirty_image_objects`.
+// If there is no Class for a descriptor, the result map will have an entry with nullptr value.
+static HashMap<std::string_view, mirror::Object*> FindClassesByDescriptor(
+    const std::vector<std::string>& dirty_image_objects) REQUIRES_SHARED(Locks::mutator_lock_) {
+  HashMap<std::string_view, mirror::Object*> descriptor_to_class;
+  // Collect class descriptors that are used in dirty-image-objects.
+  for (const std::string& entry : dirty_image_objects) {
+    auto it = std::find_if(entry.begin(), entry.end(), [](char c) { return c == '.' || c == ' '; });
+    size_t descriptor_len = std::distance(entry.begin(), it);
+
+    std::string_view descriptor = std::string_view(entry).substr(0, descriptor_len);
+    descriptor_to_class.insert(std::make_pair(descriptor, nullptr));
+  }
+
+  // Find Class objects for collected descriptors.
+  auto visitor = [&](Object* obj) REQUIRES_SHARED(Locks::mutator_lock_) {
+    DCHECK(obj != nullptr);
+    if (obj->IsClass()) {
+      std::string temp;
+      const char* descriptor = obj->AsClass()->GetDescriptor(&temp);
+      auto it = descriptor_to_class.find(descriptor);
+      if (it != descriptor_to_class.end()) {
+        it->second = obj;
+      }
+    }
+  };
+  Runtime::Current()->GetHeap()->VisitObjects(visitor);
+
+  return descriptor_to_class;
+}
+
+// Get all objects that match dirty_entries by path from class.
+// Map values are sort_keys from DirtyEntry.
+HashMap<mirror::Object*, uint32_t> MatchDirtyObjectPaths(
+    const std::vector<std::string>& dirty_image_objects) REQUIRES_SHARED(Locks::mutator_lock_) {
+  auto get_array_element = [](mirror::Object* cur_obj, const DirtyEntry::RefInfo& ref_info)
+                               REQUIRES_SHARED(Locks::mutator_lock_) -> mirror::Object* {
+    if (!cur_obj->IsObjectArray()) {
+      return nullptr;
+    }
+    int32_t idx = 0;
+    std::from_chars_result idx_parse_res =
+        std::from_chars(ref_info.name.data(), ref_info.name.data() + ref_info.name.size(), idx);
+    if (idx_parse_res.ec != std::errc()) {
+      return nullptr;
+    }
+
+    ObjPtr<ObjectArray<mirror::Object>> array = cur_obj->AsObjectArray<mirror::Object>();
+    if (idx < 0 || idx >= array->GetLength()) {
+      return nullptr;
+    }
+
+    ObjPtr<mirror::Object> next_obj =
+        array->GetWithoutChecks<kVerifyNone, kWithoutReadBarrier>(idx);
+    if (next_obj == nullptr) {
+      return nullptr;
+    }
+
+    std::string temp;
+    if (next_obj->GetClass<kVerifyNone, kWithoutReadBarrier>()->GetDescriptor(&temp) !=
+        ref_info.type) {
+      return nullptr;
+    }
+    return next_obj.Ptr();
+  };
+  auto get_object_field =
+      [](mirror::Object* cur_obj, const DirtyEntry::RefInfo& ref_info)
+          REQUIRES_SHARED(Locks::mutator_lock_) {
+            mirror::Object* next_obj = nullptr;
+            ReferenceFieldVisitor::VisitFunc visit_func =
+                [&](mirror::Object& ref_obj, ArtField& ref_field)
+                    REQUIRES_SHARED(Locks::mutator_lock_) {
+                      if (ref_field.GetName() == ref_info.name &&
+                          ref_field.GetTypeDescriptor() == ref_info.type) {
+                        next_obj = &ref_obj;
+                      }
+                    };
+            ReferenceFieldVisitor visitor(visit_func);
+            cur_obj->VisitReferences</*kVisitNativeRoots=*/false, kVerifyNone, kWithoutReadBarrier>(
+                visitor, visitor);
+
+            return next_obj;
+          };
+
+  HashMap<mirror::Object*, uint32_t> dirty_objects;
+  const HashMap<std::string_view, mirror::Object*> descriptor_to_class =
+      FindClassesByDescriptor(dirty_image_objects);
+  for (const std::string& entry_str : dirty_image_objects) {
+    const std::optional<DirtyEntry> entry = ParseDirtyEntry(entry_str);
+    if (entry == std::nullopt) {
+      continue;
+    }
+
+    auto root_it = descriptor_to_class.find(entry->class_descriptor);
+    if (root_it == descriptor_to_class.end() || root_it->second == nullptr) {
+      LOG(WARNING) << "Class not found: \"" << entry->class_descriptor << "\"";
+      continue;
+    }
+
+    mirror::Object* cur_obj = root_it->second;
+    for (const DirtyEntry::RefInfo& ref_info : entry->reference_path) {
+      if (std::all_of(
+              ref_info.name.begin(), ref_info.name.end(), [](char c) { return std::isdigit(c); })) {
+        cur_obj = get_array_element(cur_obj, ref_info);
+      } else {
+        cur_obj = get_object_field(cur_obj, ref_info);
+      }
+      if (cur_obj == nullptr) {
+        LOG(WARNING) << ART_FORMAT("Failed to find field \"{}:{}\", entry: \"{}\"",
+                                   ref_info.name,
+                                   ref_info.type,
+                                   entry_str);
+        break;
+      }
+    }
+    if (cur_obj == nullptr) {
+      continue;
+    }
+
+    dirty_objects.insert(std::make_pair(cur_obj, entry->sort_key));
+  }
+
+  return dirty_objects;
+}
+
+}  // namespace
+
 static ObjPtr<mirror::ObjectArray<mirror::Object>> AllocateBootImageLiveObjects(
     Thread* self, Runtime* runtime) REQUIRES_SHARED(Locks::mutator_lock_) {
   ClassLinker* class_linker = runtime->GetClassLinker();
-  // The objects used for the Integer.valueOf() intrinsic must remain live even if references
+  // The objects used for intrinsics must remain live even if references
   // to them are removed using reflection. Image roots are not accessible through reflection,
   // so the array we construct here shall keep them alive.
   StackHandleScope<1> hs(self);
-  Handle<mirror::ObjectArray<mirror::Object>> integer_cache =
-      hs.NewHandle(IntrinsicObjects::LookupIntegerCache(self, class_linker));
   size_t live_objects_size =
       enum_cast<size_t>(ImageHeader::kIntrinsicObjectsStart) +
-      ((integer_cache != nullptr) ? (/* cache */ 1u + integer_cache->GetLength()) : 0u);
+      IntrinsicObjects::GetNumberOfIntrinsicObjects();
   ObjPtr<mirror::ObjectArray<mirror::Object>> live_objects =
       mirror::ObjectArray<mirror::Object>::Alloc(
           self, GetClassRoot<mirror::ObjectArray<mirror::Object>>(class_linker), live_objects_size);
@@ -151,21 +395,7 @@
   set_entry(ImageHeader::kClearedJniWeakSentinel, runtime->GetSentinel().Read());
 
   DCHECK_EQ(index, enum_cast<int32_t>(ImageHeader::kIntrinsicObjectsStart));
-  if (integer_cache != nullptr) {
-    live_objects->Set(index++, integer_cache.Get());
-    for (int32_t i = 0, length = integer_cache->GetLength(); i != length; ++i) {
-      live_objects->Set(index++, integer_cache->Get(i));
-    }
-  }
-  CHECK_EQ(index, live_objects->GetLength());
-
-  if (kIsDebugBuild && integer_cache != nullptr) {
-    CHECK_EQ(integer_cache.Get(), IntrinsicObjects::GetIntegerValueOfCache(live_objects));
-    for (int32_t i = 0, len = integer_cache->GetLength(); i != len; ++i) {
-      CHECK_EQ(integer_cache->GetWithoutChecks(i),
-               IntrinsicObjects::GetIntegerValueOfObject(live_objects, i));
-    }
-  }
+  IntrinsicObjects::FillIntrinsicObjects(live_objects, index);
   return live_objects;
 }
 
@@ -274,13 +504,6 @@
     TimingLogger::ScopedTiming t("CalculateNewObjectOffsets", timings);
     ScopedObjectAccess soa(self);
     CalculateNewObjectOffsets();
-
-    // If dirty_image_objects_ is present - try optimizing object layout.
-    // It can only be done after the first CalculateNewObjectOffsets,
-    // because calculated offsets are used to match dirty objects between imgdiag and dex2oat.
-    if (compiler_options_.IsBootImage() && dirty_image_objects_ != nullptr) {
-      TryRecalculateOffsetsWithDirtyObjects();
-    }
   }
 
   // This needs to happen after CalculateNewObjectOffsets since it relies on intern_table_bytes_ and
@@ -482,7 +705,7 @@
   DCHECK(IsImageBinSlotAssigned(object));
 }
 
-ImageWriter::Bin ImageWriter::AssignImageBinSlot(mirror::Object* object, size_t oat_index) {
+ImageWriter::Bin ImageWriter::GetImageBin(mirror::Object* object) {
   DCHECK(object != nullptr);
 
   // The magic happens here. We segregate objects into different bins based
@@ -531,17 +754,7 @@
     } else if (klass->IsClassClass()) {
       bin = Bin::kClassVerified;
       ObjPtr<mirror::Class> as_klass = object->AsClass<kVerifyNone>();
-
-      // Move known dirty objects into their own sections. This includes:
-      //   - classes with dirty static fields.
-      auto is_dirty = [&](ObjPtr<mirror::Class> k) REQUIRES_SHARED(Locks::mutator_lock_) {
-        std::string temp;
-        std::string_view descriptor = k->GetDescriptor(&temp);
-        return dirty_image_objects_->find(descriptor) != dirty_image_objects_->end();
-      };
-      if (dirty_image_objects_ != nullptr && is_dirty(as_klass)) {
-        bin = Bin::kKnownDirty;
-      } else if (as_klass->IsVisiblyInitialized<kVerifyNone>()) {
+      if (as_klass->IsVisiblyInitialized<kVerifyNone>()) {
         bin = Bin::kClassInitialized;
 
         // If the class's static fields are all final, put it into a separate bin
@@ -579,7 +792,6 @@
     // else bin = kBinRegular
   }
 
-  AssignImageBinSlot(object, oat_index, bin);
   return bin;
 }
 
@@ -669,7 +881,7 @@
 
 bool ImageWriter::AllocMemory() {
   for (ImageInfo& image_info : image_infos_) {
-    const size_t length = RoundUp(image_info.CreateImageSections().first, kPageSize);
+    const size_t length = RoundUp(image_info.CreateImageSections().first, kElfSegmentAlignment);
 
     std::string error_msg;
     image_info.image_ = MemMap::MapAnonymous("image writer image",
@@ -683,9 +895,12 @@
     }
 
     // Create the image bitmap, only needs to cover mirror object section which is up to image_end_.
+    // The covered size is rounded up to kCardSize to match the bitmap size expected by Loader::Init
+    // at art::gc::space::ImageSpace.
     CHECK_LE(image_info.image_end_, length);
-    image_info.image_bitmap_ = gc::accounting::ContinuousSpaceBitmap::Create(
-        "image bitmap", image_info.image_.Begin(), RoundUp(image_info.image_end_, kPageSize));
+    image_info.image_bitmap_ = gc::accounting::ContinuousSpaceBitmap::Create("image bitmap",
+        image_info.image_.Begin(),
+        RoundUp(image_info.image_end_, gc::accounting::CardTable::kCardSize));
     if (!image_info.image_bitmap_.IsValid()) {
       LOG(ERROR) << "Failed to allocate memory for image bitmap";
       return false;
@@ -705,16 +920,15 @@
       : image_writer_(image_writer), early_exit_(early_exit), visited_(visited), result_(result) {}
 
   ALWAYS_INLINE void VisitRootIfNonNull(
-      mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED) const
-      REQUIRES_SHARED(Locks::mutator_lock_) { }
+      [[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const
+      REQUIRES_SHARED(Locks::mutator_lock_) {}
 
-  ALWAYS_INLINE void VisitRoot(
-      mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED) const
-      REQUIRES_SHARED(Locks::mutator_lock_) { }
+  ALWAYS_INLINE void VisitRoot([[maybe_unused]] mirror::CompressedReference<mirror::Object>* root)
+      const REQUIRES_SHARED(Locks::mutator_lock_) {}
 
-  ALWAYS_INLINE void operator() (ObjPtr<mirror::Object> obj,
-                                 MemberOffset offset,
-                                 bool is_static ATTRIBUTE_UNUSED) const
+  ALWAYS_INLINE void operator()(ObjPtr<mirror::Object> obj,
+                                MemberOffset offset,
+                                [[maybe_unused]] bool is_static) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     mirror::Object* ref =
         obj->GetFieldObject<mirror::Object, kVerifyNone, kWithoutReadBarrier>(offset);
@@ -747,8 +961,8 @@
     }
   }
 
-  ALWAYS_INLINE void operator() (ObjPtr<mirror::Class> klass ATTRIBUTE_UNUSED,
-                                 ObjPtr<mirror::Reference> ref) const
+  ALWAYS_INLINE void operator()([[maybe_unused]] ObjPtr<mirror::Class> klass,
+                                ObjPtr<mirror::Reference> ref) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     operator()(ref, mirror::Reference::ReferentOffset(), /* is_static */ false);
   }
@@ -1376,6 +1590,8 @@
       REQUIRES_SHARED(Locks::mutator_lock_);
   bool TryAssignBinSlot(ObjPtr<mirror::Object> obj, size_t oat_index)
       REQUIRES_SHARED(Locks::mutator_lock_);
+  ImageWriter::Bin AssignImageBinSlot(ObjPtr<mirror::Object> object, size_t oat_index)
+      REQUIRES_SHARED(Locks::mutator_lock_);
   void AssignImageBinSlot(ObjPtr<mirror::Object> object, size_t oat_index, Bin bin)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
@@ -1581,10 +1797,9 @@
   }
 
   // Collects info for managed fields that reference managed Strings.
-  void operator() (ObjPtr<mirror::Object> obj,
-                   MemberOffset member_offset,
-                   bool is_static ATTRIBUTE_UNUSED) const
-      REQUIRES_SHARED(Locks::mutator_lock_) {
+  void operator()(ObjPtr<mirror::Object> obj,
+                  MemberOffset member_offset,
+                  [[maybe_unused]] bool is_static) const REQUIRES_SHARED(Locks::mutator_lock_) {
     ObjPtr<mirror::Object> referred_obj =
         obj->GetFieldObject<mirror::Object, kVerifyNone, kWithoutReadBarrier>(member_offset);
 
@@ -1595,8 +1810,7 @@
   }
 
   ALWAYS_INLINE
-  void operator() (ObjPtr<mirror::Class> klass ATTRIBUTE_UNUSED,
-                   ObjPtr<mirror::Reference> ref) const
+  void operator()([[maybe_unused]] ObjPtr<mirror::Class> klass, ObjPtr<mirror::Reference> ref) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     operator()(ref, mirror::Reference::ReferentOffset(), /* is_static */ false);
   }
@@ -1614,25 +1828,25 @@
       : helper_(helper), oat_index_(oat_index) {}
 
   // We do not visit native roots. These are handled with other logic.
-  void VisitRootIfNonNull(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED)
-      const {
+  void VisitRootIfNonNull(
+      [[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {
     LOG(FATAL) << "UNREACHABLE";
   }
-  void VisitRoot(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED) const {
+  void VisitRoot([[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {
     LOG(FATAL) << "UNREACHABLE";
   }
 
   ALWAYS_INLINE void operator()(ObjPtr<mirror::Object> obj,
                                 MemberOffset offset,
-                                bool is_static ATTRIBUTE_UNUSED) const
+                                [[maybe_unused]] bool is_static) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     mirror::Object* ref =
         obj->GetFieldObject<mirror::Object, kVerifyNone, kWithoutReadBarrier>(offset);
     VisitReference(ref);
   }
 
-  ALWAYS_INLINE void operator() (ObjPtr<mirror::Class> klass ATTRIBUTE_UNUSED,
-                                 ObjPtr<mirror::Reference> ref) const
+  ALWAYS_INLINE void operator()([[maybe_unused]] ObjPtr<mirror::Class> klass,
+                                ObjPtr<mirror::Reference> ref) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     operator()(ref, mirror::Reference::ReferentOffset(), /* is_static */ false);
   }
@@ -1733,17 +1947,13 @@
     DCHECK(entry.first != nullptr);
     ObjPtr<mirror::Class> klass = entry.first->AsClass();
     size_t oat_index = entry.second;
-    DCHECK(!image_writer_->IsInBootImage(klass.Ptr()));
-    DCHECK(!image_writer_->IsImageBinSlotAssigned(klass.Ptr()));
     image_writer_->RecordNativeRelocations(klass, oat_index);
-    Bin klass_bin = image_writer_->AssignImageBinSlot(klass.Ptr(), oat_index);
-    bin_objects_[oat_index][enum_cast<size_t>(klass_bin)].push_back(klass.Ptr());
+    AssignImageBinSlot(klass.Ptr(), oat_index);
 
     auto method_pointer_array_visitor =
         [&](ObjPtr<mirror::PointerArray> pointer_array) REQUIRES_SHARED(Locks::mutator_lock_) {
           constexpr Bin bin = kBinObjects ? Bin::kInternalClean : Bin::kRegular;
-          image_writer_->AssignImageBinSlot(pointer_array.Ptr(), oat_index, bin);
-          bin_objects_[oat_index][enum_cast<size_t>(bin)].push_back(pointer_array.Ptr());
+          AssignImageBinSlot(pointer_array.Ptr(), oat_index, bin);
           // No need to add to the work queue. The class reference, if not in the boot image
           // (that is, when compiling the primary boot image), is already in the work queue.
         };
@@ -1840,7 +2050,6 @@
     DCHECK(it != image_writer->dex_file_oat_index_map_.end()) << dex_file->GetLocation();
     const size_t oat_index = it->second;
     // Assign bin slots for strings defined in this dex file in StringId (lexicographical) order.
-    auto& string_bin_objects = bin_objects_[oat_index][enum_cast<size_t>(Bin::kString)];
     for (size_t i = 0, count = dex_file->NumStringIds(); i != count; ++i) {
       uint32_t utf16_length;
       const char* utf8_data = dex_file->StringDataAndUtf16LengthByIdx(dex::StringIndex(i),
@@ -1853,9 +2062,8 @@
         DCHECK(string != nullptr);
         DCHECK(!image_writer->IsInBootImage(string));
         if (!image_writer->IsImageBinSlotAssigned(string)) {
-          Bin bin = image_writer->AssignImageBinSlot(string, oat_index);
+          Bin bin = AssignImageBinSlot(string, oat_index);
           DCHECK_EQ(bin, kBinObjects ? Bin::kString : Bin::kRegular);
-          string_bin_objects.push_back(string);
         } else {
           // We have already seen this string in a previous dex file.
           DCHECK(dex_file != image_writer->compiler_options_.GetDexFilesForOatFile().front());
@@ -2260,13 +2468,20 @@
   }
   bool assigned = false;
   if (!image_writer_->IsImageBinSlotAssigned(obj.Ptr())) {
-    Bin bin = image_writer_->AssignImageBinSlot(obj.Ptr(), oat_index);
-    bin_objects_[oat_index][enum_cast<size_t>(bin)].push_back(obj.Ptr());
+    AssignImageBinSlot(obj.Ptr(), oat_index);
     assigned = true;
   }
   return assigned;
 }
 
+ImageWriter::Bin ImageWriter::LayoutHelper::AssignImageBinSlot(ObjPtr<mirror::Object> object,
+                                                               size_t oat_index) {
+  DCHECK(object != nullptr);
+  Bin bin = image_writer_->GetImageBin(object.Ptr());
+  AssignImageBinSlot(object.Ptr(), oat_index, bin);
+  return bin;
+}
+
 void ImageWriter::LayoutHelper::AssignImageBinSlot(
     ObjPtr<mirror::Object> object, size_t oat_index, Bin bin) {
   DCHECK(object != nullptr);
@@ -2334,6 +2549,16 @@
             ImageHeader::kBootImageLiveObjects)).Ptr();
   }
 
+  // If dirty_image_objects_ is present - try optimizing object layout.
+  // Parse dirty-image-objects entries and put them in dirty_objects_ map, which is then used in
+  // `AssignImageBinSlot` method to put the objects in dirty bin.
+  if (compiler_options_.IsBootImage() && dirty_image_objects_ != nullptr) {
+    dirty_objects_ = MatchDirtyObjectPaths(*dirty_image_objects_);
+    LOG(INFO) << ART_FORMAT("Matched {} out of {} dirty-image-objects",
+                            dirty_objects_.size(),
+                            dirty_image_objects_->size());
+  }
+
   LayoutHelper layout_helper(this);
   layout_helper.ProcessDexFileObjects(self);
   layout_helper.ProcessRoots(self);
@@ -2362,7 +2587,7 @@
   for (ImageInfo& image_info : image_infos_) {
     image_info.image_begin_ = global_image_begin_ + image_offset;
     image_info.image_offset_ = image_offset;
-    image_info.image_size_ = RoundUp(image_info.CreateImageSections().first, kPageSize);
+    image_info.image_size_ = RoundUp(image_info.CreateImageSections().first, kElfSegmentAlignment);
     // There should be no gaps until the next image.
     image_offset += image_info.image_size_;
   }
@@ -2384,149 +2609,6 @@
   }
 }
 
-std::optional<HashMap<mirror::Object*, uint32_t>> ImageWriter::MatchDirtyObjectOffsets(
-    const HashMap<uint32_t, DirtyEntry>& dirty_entries) REQUIRES_SHARED(Locks::mutator_lock_) {
-  HashMap<mirror::Object*, uint32_t> dirty_objects;
-  bool mismatch_found = false;
-
-  auto visitor = [&](Object* obj) REQUIRES_SHARED(Locks::mutator_lock_) {
-    DCHECK(obj != nullptr);
-    if (mismatch_found) {
-      return;
-    }
-    if (!IsImageBinSlotAssigned(obj)) {
-      return;
-    }
-
-    uint8_t* image_address = reinterpret_cast<uint8_t*>(GetImageAddress(obj));
-    uint32_t offset = static_cast<uint32_t>(image_address - global_image_begin_);
-
-    auto entry_it = dirty_entries.find(offset);
-    if (entry_it == dirty_entries.end()) {
-      return;
-    }
-
-    const DirtyEntry& entry = entry_it->second;
-
-    const bool is_class = obj->IsClass();
-    const uint32_t descriptor_hash =
-        is_class ? obj->AsClass()->DescriptorHash() : obj->GetClass()->DescriptorHash();
-
-    if (is_class != entry.is_class || descriptor_hash != entry.descriptor_hash) {
-      LOG(WARNING) << "Dirty image objects offset mismatch (outdated file?)";
-      mismatch_found = true;
-      return;
-    }
-
-    dirty_objects.insert(std::make_pair(obj, entry.sort_key));
-  };
-  Runtime::Current()->GetHeap()->VisitObjects(visitor);
-
-  // A single mismatch indicates that dirty-image-objects layout differs from
-  // current ImageWriter layout. In this case any "valid" matches are likely to be accidental,
-  // so there's no point in optimizing the layout with such data.
-  if (mismatch_found) {
-    return {};
-  }
-  if (dirty_objects.size() != dirty_entries.size()) {
-    LOG(WARNING) << "Dirty image objects missing offsets (outdated file?)";
-    return {};
-  }
-  return dirty_objects;
-}
-
-void ImageWriter::ResetObjectOffsets() {
-  const size_t image_infos_size = image_infos_.size();
-  image_infos_.clear();
-  image_infos_.resize(image_infos_size);
-
-  native_object_relocations_.clear();
-
-  // CalculateNewObjectOffsets stores image offsets of the objects in lock words,
-  // while original lock words are preserved in saved_hashcode_map.
-  // Restore original lock words.
-  auto visitor = [&](Object* obj) REQUIRES_SHARED(Locks::mutator_lock_) {
-    DCHECK(obj != nullptr);
-    const auto it = saved_hashcode_map_.find(obj);
-    obj->SetLockWord(it != saved_hashcode_map_.end() ? LockWord::FromHashCode(it->second, 0u) :
-                                                       LockWord::Default(),
-                     false);
-  };
-  Runtime::Current()->GetHeap()->VisitObjects(visitor);
-
-  saved_hashcode_map_.clear();
-}
-
-void ImageWriter::TryRecalculateOffsetsWithDirtyObjects() {
-  const std::optional<HashMap<uint32_t, ImageWriter::DirtyEntry>> dirty_entries =
-      ParseDirtyObjectOffsets(*dirty_image_objects_);
-  if (!dirty_entries || dirty_entries->empty()) {
-    return;
-  }
-
-  std::optional<HashMap<mirror::Object*, uint32_t>> dirty_objects =
-      MatchDirtyObjectOffsets(*dirty_entries);
-  if (!dirty_objects || dirty_objects->empty()) {
-    return;
-  }
-  // Calculate offsets again, now with dirty object offsets.
-  LOG(INFO) << "Recalculating object offsets using dirty-image-objects";
-  dirty_objects_ = std::move(*dirty_objects);
-  ResetObjectOffsets();
-  CalculateNewObjectOffsets();
-}
-
-std::optional<HashMap<uint32_t, ImageWriter::DirtyEntry>> ImageWriter::ParseDirtyObjectOffsets(
-    const HashSet<std::string>& dirty_image_objects) REQUIRES_SHARED(Locks::mutator_lock_) {
-  HashMap<uint32_t, DirtyEntry> dirty_entries;
-
-  // Go through each dirty-image-object line, parse only lines of the format:
-  // "dirty_obj: <offset> <type> <descriptor_hash> <sort_key>"
-  // <offset> -- decimal uint32.
-  // <type> -- "class" or "instance" (defines if descriptor is referring to a class or an instance).
-  // <descriptor_hash> -- decimal uint32 (from DescriptorHash() method).
-  // <sort_key> -- decimal uint32 (defines order of the object inside the dirty bin).
-  const std::string prefix = "dirty_obj:";
-  for (const std::string& entry_str : dirty_image_objects) {
-    // Skip the lines of old dirty-image-object format.
-    if (std::strncmp(entry_str.data(), prefix.data(), prefix.size()) != 0) {
-      continue;
-    }
-
-    const std::vector<std::string> tokens = android::base::Split(entry_str, " ");
-    if (tokens.size() != 5) {
-      LOG(WARNING) << "Invalid dirty image objects format: \"" << entry_str << "\"";
-      return {};
-    }
-
-    uint32_t offset = 0;
-    std::from_chars_result res =
-        std::from_chars(tokens[1].data(), tokens[1].data() + tokens[1].size(), offset);
-    if (res.ec != std::errc()) {
-      LOG(WARNING) << "Couldn't parse dirty object offset: \"" << entry_str << "\"";
-      return {};
-    }
-
-    DirtyEntry entry;
-    entry.is_class = (tokens[2] == "class");
-    res = std::from_chars(
-        tokens[3].data(), tokens[3].data() + tokens[3].size(), entry.descriptor_hash);
-    if (res.ec != std::errc()) {
-      LOG(WARNING) << "Couldn't parse dirty object descriptor hash: \"" << entry_str << "\"";
-      return {};
-    }
-    res = std::from_chars(tokens[4].data(), tokens[4].data() + tokens[4].size(), entry.sort_key);
-    if (res.ec != std::errc()) {
-      LOG(WARNING) << "Couldn't parse dirty object marker: \"" << entry_str << "\"";
-      return {};
-    }
-
-    dirty_entries.insert(std::make_pair(offset, entry));
-  }
-
-  return dirty_entries;
-}
-
 std::pair<size_t, dchecked_vector<ImageSection>>
 ImageWriter::ImageInfo::CreateImageSections() const {
   dchecked_vector<ImageSection> sections(ImageHeader::kSectionCount);
@@ -2641,7 +2723,7 @@
   const uint8_t* oat_data_end = image_info.oat_data_begin_ + image_info.oat_size_;
 
   uint32_t image_reservation_size = image_info.image_size_;
-  DCHECK_ALIGNED(image_reservation_size, kPageSize);
+  DCHECK_ALIGNED(image_reservation_size, kElfSegmentAlignment);
   uint32_t current_component_count = 1u;
   if (compiler_options_.IsAppImage()) {
     DCHECK_EQ(oat_index, 0u);
@@ -2652,9 +2734,9 @@
     if (oat_index == 0u) {
       const ImageInfo& last_info = image_infos_.back();
       const uint8_t* end = last_info.oat_file_begin_ + last_info.oat_loaded_size_;
-      DCHECK_ALIGNED(image_info.image_begin_, kPageSize);
-      image_reservation_size =
-          dchecked_integral_cast<uint32_t>(RoundUp(end - image_info.image_begin_, kPageSize));
+      DCHECK_ALIGNED(image_info.image_begin_, kElfSegmentAlignment);
+      image_reservation_size = dchecked_integral_cast<uint32_t>(
+          RoundUp(end - image_info.image_begin_, kElfSegmentAlignment));
       current_component_count = component_count;
     } else {
       image_reservation_size = 0u;
@@ -2686,7 +2768,11 @@
   // Finally bitmap section.
   const size_t bitmap_bytes = image_info.image_bitmap_.Size();
   auto* bitmap_section = &sections[ImageHeader::kSectionImageBitmap];
-  *bitmap_section = ImageSection(RoundUp(image_end, kPageSize), RoundUp(bitmap_bytes, kPageSize));
+  // The offset of the bitmap section should be aligned to kElfSegmentAlignment to enable mapping
+  // the section from file to memory. However the section size doesn't have to be rounded up as it
+  // is located at the end of the file. When mapping file contents to memory, if the last page of
+  // the mapping is only partially filled with data, the rest will be zero-filled.
+  *bitmap_section = ImageSection(RoundUp(image_end, kElfSegmentAlignment), bitmap_bytes);
   if (VLOG_IS_ON(compiler)) {
     LOG(INFO) << "Creating header for " << oat_filenames_[oat_index];
     size_t idx = 0;
@@ -2735,17 +2821,19 @@
 const void* ImageWriter::GetIntrinsicReferenceAddress(uint32_t intrinsic_data) {
   DCHECK(compiler_options_.IsBootImage());
   switch (IntrinsicObjects::DecodePatchType(intrinsic_data)) {
-    case IntrinsicObjects::PatchType::kIntegerValueOfArray: {
+    case IntrinsicObjects::PatchType::kValueOfArray: {
+      uint32_t index = IntrinsicObjects::DecodePatchIndex(intrinsic_data);
       const uint8_t* base_address =
           reinterpret_cast<const uint8_t*>(GetImageAddress(boot_image_live_objects_));
       MemberOffset data_offset =
-          IntrinsicObjects::GetIntegerValueOfArrayDataOffset(boot_image_live_objects_);
+          IntrinsicObjects::GetValueOfArrayDataOffset(boot_image_live_objects_, index);
       return base_address + data_offset.Uint32Value();
     }
-    case IntrinsicObjects::PatchType::kIntegerValueOfObject: {
+    case IntrinsicObjects::PatchType::kValueOfObject: {
       uint32_t index = IntrinsicObjects::DecodePatchIndex(intrinsic_data);
-      ObjPtr<mirror::Object> value =
-          IntrinsicObjects::GetIntegerValueOfObject(boot_image_live_objects_, index);
+      ObjPtr<mirror::Object> value = IntrinsicObjects::GetValueOfObject(boot_image_live_objects_,
+                                                                        /* start_index= */ 0u,
+                                                                        index);
       return GetImageAddress(value.Ptr());
     }
   }
@@ -2759,17 +2847,17 @@
   explicit FixupRootVisitor(ImageWriter* image_writer) : image_writer_(image_writer) {
   }
 
-  void VisitRoots(mirror::Object*** roots ATTRIBUTE_UNUSED,
-                  size_t count ATTRIBUTE_UNUSED,
-                  const RootInfo& info ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_) {
+  void VisitRoots([[maybe_unused]] mirror::Object*** roots,
+                  [[maybe_unused]] size_t count,
+                  [[maybe_unused]] const RootInfo& info) override
+      REQUIRES_SHARED(Locks::mutator_lock_) {
     LOG(FATAL) << "Unsupported";
   }
 
   void VisitRoots(mirror::CompressedReference<mirror::Object>** roots,
                   size_t count,
-                  const RootInfo& info ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_) {
+                  [[maybe_unused]] const RootInfo& info) override
+      REQUIRES_SHARED(Locks::mutator_lock_) {
     for (size_t i = 0; i < count; ++i) {
       // Copy the reference. Since we do not have the address for recording the relocation,
       // it needs to be recorded explicitly by the user of FixupRootVisitor.
@@ -3034,15 +3122,15 @@
   }
 
   // We do not visit native roots. These are handled with other logic.
-  void VisitRootIfNonNull(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED)
-      const {
+  void VisitRootIfNonNull(
+      [[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {
     LOG(FATAL) << "UNREACHABLE";
   }
-  void VisitRoot(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED) const {
+  void VisitRoot([[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {
     LOG(FATAL) << "UNREACHABLE";
   }
 
-  void operator()(ObjPtr<Object> obj, MemberOffset offset, bool is_static ATTRIBUTE_UNUSED) const
+  void operator()(ObjPtr<Object> obj, MemberOffset offset, [[maybe_unused]] bool is_static) const
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::heap_bitmap_lock_) {
     ObjPtr<Object> ref = obj->GetFieldObject<Object, kVerifyNone, kWithoutReadBarrier>(offset);
     // Copy the reference and record the fixup if necessary.
@@ -3051,8 +3139,7 @@
   }
 
   // java.lang.ref.Reference visitor.
-  void operator()(ObjPtr<mirror::Class> klass ATTRIBUTE_UNUSED,
-                  ObjPtr<mirror::Reference> ref) const
+  void operator()([[maybe_unused]] ObjPtr<mirror::Class> klass, ObjPtr<mirror::Reference> ref) const
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::heap_bitmap_lock_) {
     operator()(ref, mirror::Reference::ReferentOffset(), /* is_static */ false);
   }
@@ -3122,14 +3209,14 @@
   FixupClassVisitor(ImageWriter* image_writer, Object* copy)
       : FixupVisitor(image_writer, copy) {}
 
-  void operator()(ObjPtr<Object> obj, MemberOffset offset, bool is_static ATTRIBUTE_UNUSED) const
+  void operator()(ObjPtr<Object> obj, MemberOffset offset, [[maybe_unused]] bool is_static) const
       REQUIRES(Locks::mutator_lock_, Locks::heap_bitmap_lock_) {
     DCHECK(obj->IsClass());
     FixupVisitor::operator()(obj, offset, /*is_static*/false);
   }
 
-  void operator()(ObjPtr<mirror::Class> klass ATTRIBUTE_UNUSED,
-                  ObjPtr<mirror::Reference> ref ATTRIBUTE_UNUSED) const
+  void operator()([[maybe_unused]] ObjPtr<mirror::Class> klass,
+                  [[maybe_unused]] ObjPtr<mirror::Reference> ref) const
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::heap_bitmap_lock_) {
     LOG(FATAL) << "Reference not expected here.";
   }
@@ -3382,6 +3469,7 @@
 
   CopyAndFixupReference(copy->GetDeclaringClassAddressWithoutBarrier(),
                         orig->GetDeclaringClassUnchecked<kWithoutReadBarrier>());
+  ResetNterpFastPathFlags(copy, orig);
 
   // OatWriter replaces the code_ with an offset value. Here we re-adjust to a pointer relative to
   // oat_begin_
@@ -3411,7 +3499,7 @@
       }
       CHECK(found_one) << "Expected to find callee save method but got " << orig->PrettyMethod();
       CHECK(copy->IsRuntimeMethod());
-      CHECK(copy->GetEntryPointFromQuickCompiledCode() == nullptr);
+      CHECK(copy->GetEntryPointFromQuickCompiledCodePtrSize(target_ptr_size_) == nullptr);
       quick_code = nullptr;
     }
   } else {
@@ -3582,14 +3670,13 @@
   }
 }
 
-ImageWriter::ImageWriter(
-    const CompilerOptions& compiler_options,
-    uintptr_t image_begin,
-    ImageHeader::StorageMode image_storage_mode,
-    const std::vector<std::string>& oat_filenames,
-    const HashMap<const DexFile*, size_t>& dex_file_oat_index_map,
-    jobject class_loader,
-    const HashSet<std::string>* dirty_image_objects)
+ImageWriter::ImageWriter(const CompilerOptions& compiler_options,
+                         uintptr_t image_begin,
+                         ImageHeader::StorageMode image_storage_mode,
+                         const std::vector<std::string>& oat_filenames,
+                         const HashMap<const DexFile*, size_t>& dex_file_oat_index_map,
+                         jobject class_loader,
+                         const std::vector<std::string>* dirty_image_objects)
     : compiler_options_(compiler_options),
       boot_image_begin_(Runtime::Current()->GetHeap()->GetBootImagesStartAddress()),
       boot_image_size_(Runtime::Current()->GetHeap()->GetBootImagesSize()),
@@ -3676,5 +3763,32 @@
   return CopyAndFixupPointer(object, offset, src_value, target_ptr_size_);
 }
 
+void ImageWriter::ResetNterpFastPathFlags(ArtMethod* copy, ArtMethod* orig) {
+  DCHECK(copy != nullptr);
+  DCHECK(orig != nullptr);
+  if (orig->IsRuntimeMethod() || orig->IsProxyMethod()) {
+    return;  // !IsRuntimeMethod() and !IsProxyMethod() for GetShortyView()
+  }
+
+  // Clear old nterp fast path flags.
+  if (copy->HasNterpEntryPointFastPathFlag()) {
+    copy->ClearNterpEntryPointFastPathFlag();  // Flag has other uses, clear it conditionally.
+  }
+  copy->ClearNterpInvokeFastPathFlag();
+
+  // Check if nterp fast paths available on target ISA.
+  std::string_view shorty = orig->GetShortyView();  // Use orig, copy's class not yet ready.
+  uint32_t new_nterp_flags =
+      GetNterpFastPathFlags(shorty, copy->GetAccessFlags(), compiler_options_.GetInstructionSet());
+
+  // Set new nterp fast path flags, if approporiate.
+  if ((new_nterp_flags & kAccNterpEntryPointFastPathFlag) != 0) {
+    copy->SetNterpEntryPointFastPathFlag();
+  }
+  if ((new_nterp_flags & kAccNterpInvokeFastPathFlag) != 0) {
+    copy->SetNterpInvokeFastPathFlag();
+  }
+}
+
 }  // namespace linker
 }  // namespace art
diff --git a/dex2oat/linker/image_writer.h b/dex2oat/linker/image_writer.h
index 3f6aa28..9dd6c78 100644
--- a/dex2oat/linker/image_writer.h
+++ b/dex2oat/linker/image_writer.h
@@ -41,12 +41,12 @@
 #include "base/utils.h"
 #include "class_table.h"
 #include "gc/accounting/space_bitmap.h"
-#include "image.h"
 #include "intern_table.h"
 #include "lock_word.h"
 #include "mirror/dex_cache.h"
-#include "oat.h"
-#include "oat_file.h"
+#include "oat/image.h"
+#include "oat/oat.h"
+#include "oat/oat_file.h"
 #include "obj_ptr.h"
 
 namespace art {
@@ -83,7 +83,7 @@
               const std::vector<std::string>& oat_filenames,
               const HashMap<const DexFile*, size_t>& dex_file_oat_index_map,
               jobject class_loader,
-              const HashSet<std::string>* dirty_image_objects);
+              const std::vector<std::string>* dirty_image_objects);
   ~ImageWriter();
 
   /*
@@ -396,8 +396,7 @@
   size_t GetImageOffset(mirror::Object* object, size_t oat_index) const
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  Bin AssignImageBinSlot(mirror::Object* object, size_t oat_index)
-      REQUIRES_SHARED(Locks::mutator_lock_);
+  Bin GetImageBin(mirror::Object* object) REQUIRES_SHARED(Locks::mutator_lock_);
   void AssignImageBinSlot(mirror::Object* object, size_t oat_index, Bin bin)
       REQUIRES_SHARED(Locks::mutator_lock_);
   void RecordNativeRelocations(ObjPtr<mirror::Class> klass, size_t oat_index)
@@ -447,29 +446,7 @@
       REQUIRES_SHARED(Locks::mutator_lock_);
   void CreateHeader(size_t oat_index, size_t component_count)
       REQUIRES_SHARED(Locks::mutator_lock_);
-  bool CreateImageRoots()
-      REQUIRES_SHARED(Locks::mutator_lock_);
-  void CalculateObjectBinSlots(mirror::Object* obj)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-  // Undo the changes of CalculateNewObjectOffsets.
-  void ResetObjectOffsets() REQUIRES_SHARED(Locks::mutator_lock_);
-  // Reset and calculate new offsets with dirty objects optimization.
-  // Does nothing if dirty object offsets don't match with current offsets.
-  void TryRecalculateOffsetsWithDirtyObjects() REQUIRES_SHARED(Locks::mutator_lock_);
-
-  // Dirty object data from dirty-image-objects.
-  struct DirtyEntry {
-    uint32_t descriptor_hash = 0;
-    bool is_class = false;
-    uint32_t sort_key = 0;
-  };
-  // Parse dirty-image-objects into (offset->entry) map. Returns nullopt on parse error.
-  static std::optional<HashMap<uint32_t, DirtyEntry>> ParseDirtyObjectOffsets(
-      const HashSet<std::string>& dirty_image_objects) REQUIRES_SHARED(Locks::mutator_lock_);
-  // Get all objects that match dirty_entries by offset. Returns nullopt if there is a mismatch.
-  // Map values are sort_keys from DirtyEntry.
-  std::optional<HashMap<mirror::Object*, uint32_t>> MatchDirtyObjectOffsets(
-      const HashMap<uint32_t, DirtyEntry>& dirty_entries) REQUIRES_SHARED(Locks::mutator_lock_);
+  bool CreateImageRoots() REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Creates the contiguous image in memory and adjusts pointers.
   void CopyAndFixupNativeData(size_t oat_index) REQUIRES_SHARED(Locks::mutator_lock_);
@@ -619,6 +596,9 @@
   void CopyAndFixupPointer(void* object, MemberOffset offset, ValueType src_value)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
+  void ResetNterpFastPathFlags(ArtMethod* copy, ArtMethod* orig)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+
   ALWAYS_INLINE
   static bool IsStronglyInternedString(ObjPtr<mirror::String> str)
       REQUIRES_SHARED(Locks::mutator_lock_);
@@ -694,9 +674,9 @@
   const HashMap<const DexFile*, size_t>& dex_file_oat_index_map_;
 
   // Set of classes/objects known to be dirty in the image. Can be nullptr if there are none.
-  // For old dirty-image-objects format this set contains descriptors of dirty classes.
-  // For new format -- a set of dirty object offsets and descriptor hashes.
-  const HashSet<std::string>* dirty_image_objects_;
+  // Each entry contains a class descriptor with zero or more reference fields, which denote a path
+  // to the dirty object.
+  const std::vector<std::string>* dirty_image_objects_;
 
   // Dirty object instances and their sort keys parsed from dirty_image_object_
   HashMap<mirror::Object*, uint32_t> dirty_objects_;
diff --git a/dex2oat/linker/index_bss_mapping_encoder.h b/dex2oat/linker/index_bss_mapping_encoder.h
index c6326ed..acc9706 100644
--- a/dex2oat/linker/index_bss_mapping_encoder.h
+++ b/dex2oat/linker/index_bss_mapping_encoder.h
@@ -21,7 +21,7 @@
 
 #include "base/bit_utils.h"
 #include "base/bit_vector-inl.h"
-#include "index_bss_mapping.h"
+#include "oat/index_bss_mapping.h"
 
 namespace art {
 namespace linker {
diff --git a/dex2oat/linker/multi_oat_relative_patcher.cc b/dex2oat/linker/multi_oat_relative_patcher.cc
index a6797ff..15f495e 100644
--- a/dex2oat/linker/multi_oat_relative_patcher.cc
+++ b/dex2oat/linker/multi_oat_relative_patcher.cc
@@ -50,7 +50,7 @@
 }
 
 void MultiOatRelativePatcher::StartOatFile(uint32_t adjustment) {
-  DCHECK_ALIGNED(adjustment, kPageSize);
+  DCHECK_ALIGNED(adjustment, kElfSegmentAlignment);
   adjustment_ = adjustment;
 
   start_size_code_alignment_ = relative_patcher_->CodeAlignmentSize();
diff --git a/dex2oat/linker/multi_oat_relative_patcher_test.cc b/dex2oat/linker/multi_oat_relative_patcher_test.cc
index a393eb8..b2aa619 100644
--- a/dex2oat/linker/multi_oat_relative_patcher_test.cc
+++ b/dex2oat/linker/multi_oat_relative_patcher_test.cc
@@ -34,7 +34,7 @@
     MockPatcher() { }
 
     uint32_t ReserveSpace(uint32_t offset,
-                          const CompiledMethod* compiled_method ATTRIBUTE_UNUSED,
+                          [[maybe_unused]] const CompiledMethod* compiled_method,
                           MethodReference method_ref) override {
       last_reserve_offset_ = offset;
       last_reserve_method_ = method_ref;
@@ -76,7 +76,7 @@
       return offset;
     }
 
-    void PatchCall(std::vector<uint8_t>* code ATTRIBUTE_UNUSED,
+    void PatchCall([[maybe_unused]] std::vector<uint8_t>* code,
                    uint32_t literal_offset,
                    uint32_t patch_offset,
                    uint32_t target_offset) override {
@@ -85,7 +85,7 @@
       last_target_offset_ = target_offset;
     }
 
-    void PatchPcRelativeReference(std::vector<uint8_t>* code ATTRIBUTE_UNUSED,
+    void PatchPcRelativeReference([[maybe_unused]] std::vector<uint8_t>* code,
                                   const LinkerPatch& patch,
                                   uint32_t patch_offset,
                                   uint32_t target_offset) override {
@@ -94,20 +94,20 @@
       last_target_offset_ = target_offset;
     }
 
-    void PatchEntrypointCall(std::vector<uint8_t>* code ATTRIBUTE_UNUSED,
-                             const LinkerPatch& patch ATTRIBUTE_UNUSED,
-                             uint32_t patch_offset ATTRIBUTE_UNUSED) override {
+    void PatchEntrypointCall([[maybe_unused]] std::vector<uint8_t>* code,
+                             [[maybe_unused]] const LinkerPatch& patch,
+                             [[maybe_unused]] uint32_t patch_offset) override {
       LOG(FATAL) << "UNIMPLEMENTED";
     }
 
-    void PatchBakerReadBarrierBranch(std::vector<uint8_t>* code ATTRIBUTE_UNUSED,
-                                     const LinkerPatch& patch ATTRIBUTE_UNUSED,
-                                     uint32_t patch_offset ATTRIBUTE_UNUSED) override {
+    void PatchBakerReadBarrierBranch([[maybe_unused]] std::vector<uint8_t>* code,
+                                     [[maybe_unused]] const LinkerPatch& patch,
+                                     [[maybe_unused]] uint32_t patch_offset) override {
       LOG(FATAL) << "UNIMPLEMENTED";
     }
 
     std::vector<debug::MethodDebugInfo> GenerateThunkDebugInfo(
-        uint32_t executable_offset ATTRIBUTE_UNUSED) override {
+        [[maybe_unused]] uint32_t executable_offset) override {
       LOG(FATAL) << "UNIMPLEMENTED";
       UNREACHABLE();
     }
@@ -146,7 +146,7 @@
   EXPECT_EQ(0u, patcher_.GetOffset(ref1));
   EXPECT_EQ(0u, patcher_.GetOffset(ref2));
 
-  uint32_t adjustment1 = 0x1000;
+  uint32_t adjustment1 = kElfSegmentAlignment;
   patcher_.StartOatFile(adjustment1);
   EXPECT_EQ(0u, patcher_.GetOffset(ref1));
   EXPECT_EQ(0u, patcher_.GetOffset(ref2));
@@ -156,7 +156,7 @@
   EXPECT_EQ(off1, patcher_.GetOffset(ref1));
   EXPECT_EQ(0u, patcher_.GetOffset(ref2));
 
-  uint32_t adjustment2 = 0x30000;
+  uint32_t adjustment2 = 0x30 * kElfSegmentAlignment;
   patcher_.StartOatFile(adjustment2);
   EXPECT_EQ(off1 + adjustment1 - adjustment2, patcher_.GetOffset(ref1));
   EXPECT_EQ(0u, patcher_.GetOffset(ref2));
@@ -166,7 +166,7 @@
   EXPECT_EQ(off1 + adjustment1 - adjustment2, patcher_.GetOffset(ref1));
   EXPECT_EQ(off2, patcher_.GetOffset(ref2));
 
-  uint32_t adjustment3 = 0x78000;
+  uint32_t adjustment3 = 0x78 * kElfSegmentAlignment;
   patcher_.StartOatFile(adjustment3);
   EXPECT_EQ(off1 + adjustment1 - adjustment3, patcher_.GetOffset(ref1));
   EXPECT_EQ(off2 + adjustment2 - adjustment3, patcher_.GetOffset(ref2));
@@ -179,7 +179,7 @@
   MethodReference ref3(dex_file, 3u);
   const CompiledMethod* method = reinterpret_cast<const CompiledMethod*>(-1);
 
-  uint32_t adjustment1 = 0x1000;
+  uint32_t adjustment1 = kElfSegmentAlignment;
   patcher_.StartOatFile(adjustment1);
 
   uint32_t method1_offset = 0x100;
@@ -202,7 +202,7 @@
   ASSERT_TRUE(kNullMethodRef == mock_->last_reserve_method_);
   ASSERT_EQ(end1_offset, end1_offset_check);
 
-  uint32_t adjustment2 = 0xd000;
+  uint32_t adjustment2 = 0xd * kElfSegmentAlignment;
   patcher_.StartOatFile(adjustment2);
 
   uint32_t method3_offset = 0xf00;
@@ -224,7 +224,7 @@
   std::vector<uint8_t> output;
   VectorOutputStream vos("output", &output);
 
-  uint32_t adjustment1 = 0x1000;
+  uint32_t adjustment1 = kElfSegmentAlignment;
   patcher_.StartOatFile(adjustment1);
 
   uint32_t method1_offset = 0x100;
@@ -247,7 +247,7 @@
   EXPECT_EQ(method2_alignment_size, patcher_.CodeAlignmentSize());
   EXPECT_EQ(method2_call_thunk_size, patcher_.RelativeCallThunksSize());
 
-  uint32_t adjustment2 = 0xd000;
+  uint32_t adjustment2 = 0xd * kElfSegmentAlignment;
   patcher_.StartOatFile(adjustment2);
 
   uint32_t method3_offset = 0xf00;
@@ -278,7 +278,7 @@
 TEST_F(MultiOatRelativePatcherTest, Patch) {
   std::vector<uint8_t> code(16);
 
-  uint32_t adjustment1 = 0x1000;
+  uint32_t adjustment1 = kElfSegmentAlignment;
   patcher_.StartOatFile(adjustment1);
 
   uint32_t method1_literal_offset = 4u;
@@ -300,7 +300,7 @@
   DCHECK_EQ(method2_patch_offset + adjustment1, mock_->last_patch_offset_);
   DCHECK_EQ(method2_target_offset + adjustment1, mock_->last_target_offset_);
 
-  uint32_t adjustment2 = 0xd000;
+  uint32_t adjustment2 = 0xd * kElfSegmentAlignment;
   patcher_.StartOatFile(adjustment2);
 
   uint32_t method3_literal_offset = 8u;
diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc
index 63d2a42..b7858d6 100644
--- a/dex2oat/linker/oat_writer.cc
+++ b/dex2oat/linker/oat_writer.cc
@@ -47,6 +47,7 @@
 #include "dex/dex_file_loader.h"
 #include "dex/dex_file_types.h"
 #include "dex/dex_file_verifier.h"
+#include "dex/proto_reference.h"
 #include "dex/standard_dex_file.h"
 #include "dex/type_lookup_table.h"
 #include "dex/verification_results.h"
@@ -66,12 +67,11 @@
 #include "mirror/class_loader.h"
 #include "mirror/dex_cache-inl.h"
 #include "mirror/object-inl.h"
-#include "oat.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat.h"
+#include "oat/oat_quick_method_header.h"
+#include "oat/stack_map.h"
 #include "profile/profile_compilation_info.h"
-#include "quicken_info.h"
 #include "scoped_thread_state_change-inl.h"
-#include "stack_map.h"
 #include "stream/buffered_output_stream.h"
 #include "stream/file_output_stream.h"
 #include "stream/output_stream.h"
@@ -277,8 +277,11 @@
   const uint32_t dex_file_location_size_;
   const char* const dex_file_location_data_;
 
+  DexFile::Magic dex_file_magic_;
+
   // The checksum of the dex file.
   const uint32_t dex_file_location_checksum_;
+  const DexFile::Sha1 dex_file_sha1_;
 
   // Offset of the dex file in the vdex file. Set when writing dex files in
   // SeekToDexFile.
@@ -294,6 +297,7 @@
   uint32_t public_type_bss_mapping_offset_;
   uint32_t package_type_bss_mapping_offset_;
   uint32_t string_bss_mapping_offset_;
+  uint32_t method_type_bss_mapping_offset_;
 
   // Offset of dex sections that will have different runtime madvise states.
   // Set in WriteDexLayoutSections.
@@ -338,7 +342,6 @@
       vdex_dex_files_offset_(0u),
       vdex_dex_shared_data_offset_(0u),
       vdex_verifier_deps_offset_(0u),
-      vdex_quickening_info_offset_(0u),
       vdex_lookup_tables_offset_(0u),
       oat_checksum_(adler32(0L, Z_NULL, 0)),
       code_size_(0u),
@@ -356,73 +359,9 @@
       bss_public_type_entries_(),
       bss_package_type_entries_(),
       bss_string_entries_(),
+      bss_method_type_entries_(),
       oat_data_offset_(0u),
       oat_header_(nullptr),
-      size_vdex_header_(0),
-      size_vdex_checksums_(0),
-      size_dex_file_alignment_(0),
-      size_quickening_table_offset_(0),
-      size_executable_offset_alignment_(0),
-      size_oat_header_(0),
-      size_oat_header_key_value_store_(0),
-      size_dex_file_(0),
-      size_verifier_deps_(0),
-      size_verifier_deps_alignment_(0),
-      size_quickening_info_(0),
-      size_quickening_info_alignment_(0),
-      size_vdex_lookup_table_alignment_(0),
-      size_vdex_lookup_table_(0),
-      size_interpreter_to_interpreter_bridge_(0),
-      size_interpreter_to_compiled_code_bridge_(0),
-      size_jni_dlsym_lookup_trampoline_(0),
-      size_jni_dlsym_lookup_critical_trampoline_(0),
-      size_quick_generic_jni_trampoline_(0),
-      size_quick_imt_conflict_trampoline_(0),
-      size_quick_resolution_trampoline_(0),
-      size_quick_to_interpreter_bridge_(0),
-      size_nterp_trampoline_(0),
-      size_trampoline_alignment_(0),
-      size_method_header_(0),
-      size_code_(0),
-      size_code_alignment_(0),
-      size_data_bimg_rel_ro_(0),
-      size_data_bimg_rel_ro_alignment_(0),
-      size_relative_call_thunks_(0),
-      size_misc_thunks_(0),
-      size_vmap_table_(0),
-      size_method_info_(0),
-      size_oat_dex_file_location_size_(0),
-      size_oat_dex_file_location_data_(0),
-      size_oat_dex_file_location_checksum_(0),
-      size_oat_dex_file_offset_(0),
-      size_oat_dex_file_class_offsets_offset_(0),
-      size_oat_dex_file_lookup_table_offset_(0),
-      size_oat_dex_file_dex_layout_sections_offset_(0),
-      size_oat_dex_file_dex_layout_sections_(0),
-      size_oat_dex_file_dex_layout_sections_alignment_(0),
-      size_oat_dex_file_method_bss_mapping_offset_(0),
-      size_oat_dex_file_type_bss_mapping_offset_(0),
-      size_oat_dex_file_public_type_bss_mapping_offset_(0),
-      size_oat_dex_file_package_type_bss_mapping_offset_(0),
-      size_oat_dex_file_string_bss_mapping_offset_(0),
-      size_bcp_bss_info_size_(0),
-      size_bcp_bss_info_method_bss_mapping_offset_(0),
-      size_bcp_bss_info_type_bss_mapping_offset_(0),
-      size_bcp_bss_info_public_type_bss_mapping_offset_(0),
-      size_bcp_bss_info_package_type_bss_mapping_offset_(0),
-      size_bcp_bss_info_string_bss_mapping_offset_(0),
-      size_oat_class_offsets_alignment_(0),
-      size_oat_class_offsets_(0),
-      size_oat_class_type_(0),
-      size_oat_class_status_(0),
-      size_oat_class_num_methods_(0),
-      size_oat_class_method_bitmaps_(0),
-      size_oat_class_method_offsets_(0),
-      size_method_bss_mappings_(0u),
-      size_type_bss_mappings_(0u),
-      size_public_type_bss_mappings_(0u),
-      size_package_type_bss_mappings_(0u),
-      size_string_bss_mappings_(0u),
       relative_patcher_(nullptr),
       profile_compilation_info_(info),
       compact_dex_level_(compact_dex_level) {}
@@ -462,7 +401,7 @@
 bool OatWriter::AddDexFileSource(File&& dex_file_fd, const char* location) {
   DCHECK(write_state_ == WriteState::kAddingDexFileSources);
   std::string error_msg;
-  ArtDexFileLoader loader(dex_file_fd.Release(), location);
+  ArtDexFileLoader loader(&dex_file_fd, location);
   std::vector<std::unique_ptr<const DexFile>> dex_files;
   if (!loader.Open(/*verify=*/false,
                    /*verify_checksum=*/false,
@@ -485,6 +424,7 @@
 bool OatWriter::AddVdexDexFilesSource(const VdexFile& vdex_file, const char* location) {
   DCHECK(write_state_ == WriteState::kAddingDexFileSources);
   DCHECK(vdex_file.HasDexSection());
+  auto container = std::make_shared<MemoryDexFileContainer>(vdex_file.Begin(), vdex_file.End());
   const uint8_t* current_dex_data = nullptr;
   size_t i = 0;
   for (; i < vdex_file.GetNumberOfDexFiles(); ++i) {
@@ -500,8 +440,8 @@
     }
     // We used `zipped_dex_file_locations_` to keep the strings in memory.
     std::string multidex_location = DexFileLoader::GetMultiDexLocation(i, location);
-    const UnalignedDexFileHeader* header = AsUnalignedDexFileHeader(current_dex_data);
-    if (!AddRawDexFileSource({current_dex_data, header->file_size_},
+    if (!AddRawDexFileSource(container,
+                             current_dex_data,
                              multidex_location.c_str(),
                              vdex_file.GetLocationChecksum(i))) {
       return false;
@@ -521,17 +461,21 @@
 }
 
 // Add dex file source from raw memory.
-bool OatWriter::AddRawDexFileSource(const ArrayRef<const uint8_t>& data,
+bool OatWriter::AddRawDexFileSource(std::shared_ptr<DexFileContainer> container,
+                                    const uint8_t* dex_file_begin,
                                     const char* location,
                                     uint32_t location_checksum) {
   DCHECK(write_state_ == WriteState::kAddingDexFileSources);
   std::string error_msg;
-  ArtDexFileLoader loader(data.data(), data.size(), location);
-  auto dex_file = loader.Open(location_checksum,
-                              nullptr,
-                              /*verify=*/false,
-                              /*verify_checksum=*/false,
-                              &error_msg);
+  ArtDexFileLoader loader(container->Begin(), container->Size(), location);
+  CHECK_GE(dex_file_begin, container->Begin());
+  CHECK_LE(dex_file_begin, container->End());
+  auto dex_file = loader.OpenOne(dex_file_begin - container->Begin(),
+                                 location_checksum,
+                                 nullptr,
+                                 /*verify=*/false,
+                                 /*verify_checksum=*/false,
+                                 &error_msg);
   if (dex_file == nullptr) {
     LOG(ERROR) << "Failed to open dex file '" << location << "': " << error_msg;
     return false;
@@ -680,7 +624,7 @@
     offset = InitDataBimgRelRoLayout(offset);
   }
   oat_size_ = offset;  // .bss does not count towards oat_size_.
-  bss_start_ = (bss_size_ != 0u) ? RoundUp(oat_size_, kPageSize) : 0u;
+  bss_start_ = (bss_size_ != 0u) ? RoundUp(oat_size_, kElfSegmentAlignment) : 0u;
 
   CHECK_EQ(dex_files_->size(), oat_dex_files_.size());
 
@@ -769,7 +713,7 @@
   explicit InitBssLayoutMethodVisitor(OatWriter* writer)
       : DexMethodVisitor(writer, /* offset */ 0u) {}
 
-  bool VisitMethod(size_t class_def_method_index ATTRIBUTE_UNUSED,
+  bool VisitMethod([[maybe_unused]] size_t class_def_method_index,
                    const ClassAccessor::Method& method) override {
     // Look for patches with .bss references and prepare maps with placeholders for their offsets.
     CompiledMethod* compiled_method = writer_->compiler_driver_->GetCompiledMethod(
@@ -809,6 +753,12 @@
                           target_string.dex_file->NumStringIds(),
                           &writer_->bss_string_entry_references_);
           writer_->bss_string_entries_.Overwrite(target_string, /* placeholder */ 0u);
+        } else if (patch.GetType() == LinkerPatch::Type::kMethodTypeBssEntry) {
+          ProtoReference target_proto(patch.TargetProtoDexFile(), patch.TargetProtoIndex());
+          AddBssReference(target_proto,
+                          target_proto.dex_file->NumProtoIds(),
+                          &writer_->bss_method_type_entry_references_);
+          writer_->bss_method_type_entries_.Overwrite(target_proto, /* placeholder */ 0u);
         }
       }
     } else {
@@ -863,7 +813,7 @@
     return true;
   }
 
-  bool VisitMethod(size_t class_def_method_index ATTRIBUTE_UNUSED,
+  bool VisitMethod([[maybe_unused]] size_t class_def_method_index,
                    const ClassAccessor::Method& method) override {
     // Fill in the compiled_methods_ array for methods that have a
     // CompiledMethod. We track the number of non-null entries in
@@ -928,6 +878,7 @@
   uint32_t public_type_bss_mapping_offset = 0u;
   uint32_t package_type_bss_mapping_offset = 0u;
   uint32_t string_bss_mapping_offset = 0u;
+  uint32_t method_type_bss_mapping_offset = 0u;
 
   // Offset of the BSSInfo start from beginning of OatHeader. It is used to validate file position
   // when writing.
@@ -938,7 +889,8 @@
            sizeof(type_bss_mapping_offset) +
            sizeof(public_type_bss_mapping_offset) +
            sizeof(package_type_bss_mapping_offset) +
-           sizeof(string_bss_mapping_offset);
+           sizeof(string_bss_mapping_offset) +
+           sizeof(method_type_bss_mapping_offset);
   }
   bool Write(OatWriter* oat_writer, OutputStream* out) const;
 };
@@ -1276,7 +1228,7 @@
       offset_ += code_size;
     }
 
-    // Exclude quickened dex methods (code_size == 0) since they have no native code.
+    // Exclude dex methods without native code.
     if (generate_debug_info_ && code_size != 0) {
       DCHECK(has_debug_info);
       const uint8_t* code_info = compiled_method->GetVmapTable().data();
@@ -1400,8 +1352,8 @@
   }
 
   bool VisitMethod(size_t class_def_method_index,
-                   const ClassAccessor::Method& method ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_) {
+                   [[maybe_unused]] const ClassAccessor::Method& method) override
+      REQUIRES_SHARED(Locks::mutator_lock_) {
     OatClass* oat_class = &writer_->oat_classes_[oat_class_index_];
     CompiledMethod* compiled_method = oat_class->GetCompiledMethod(class_def_method_index);
 
@@ -1743,6 +1695,16 @@
                                                                    target_offset);
               break;
             }
+            case LinkerPatch::Type::kMethodTypeBssEntry: {
+              ProtoReference ref(patch.TargetProtoDexFile(), patch.TargetProtoIndex());
+              uint32_t target_offset =
+                  writer_->bss_start_ + writer_->bss_method_type_entries_.Get(ref);
+              writer_->relative_patcher_->PatchPcRelativeReference(&patched_code_,
+                                                                   patch,
+                                                                   offset_ + literal_offset,
+                                                                   target_offset);
+              break;
+            }
             case LinkerPatch::Type::kTypeRelative: {
               uint32_t target_offset = GetTargetObjectOffset(GetTargetType(patch));
               writer_->relative_patcher_->PatchPcRelativeReference(&patched_code_,
@@ -2097,7 +2059,8 @@
       bss_type_entry_references_.empty() &&
       bss_public_type_entry_references_.empty() &&
       bss_package_type_entry_references_.empty() &&
-      bss_string_entry_references_.empty()) {
+      bss_string_entry_references_.empty() &&
+      bss_method_type_entry_references_.empty()) {
     return offset;
   }
   // If there are any classes, the class offsets allocation aligns the offset
@@ -2110,6 +2073,7 @@
   size_t number_of_public_type_dex_files = 0u;
   size_t number_of_package_type_dex_files = 0u;
   size_t number_of_string_dex_files = 0u;
+  size_t number_of_method_type_dex_files = 0u;
   for (size_t i = 0, size = dex_files_->size(); i != size; ++i) {
     const DexFile* dex_file = (*dex_files_)[i];
     offset = InitIndexBssMappingsHelper(offset,
@@ -2119,11 +2083,13 @@
                                         number_of_public_type_dex_files,
                                         number_of_package_type_dex_files,
                                         number_of_string_dex_files,
+                                        number_of_method_type_dex_files,
                                         oat_dex_files_[i].method_bss_mapping_offset_,
                                         oat_dex_files_[i].type_bss_mapping_offset_,
                                         oat_dex_files_[i].public_type_bss_mapping_offset_,
                                         oat_dex_files_[i].package_type_bss_mapping_offset_,
-                                        oat_dex_files_[i].string_bss_mapping_offset_);
+                                        oat_dex_files_[i].string_bss_mapping_offset_,
+                                        oat_dex_files_[i].method_type_bss_mapping_offset_);
   }
 
   if (!(compiler_options_.IsBootImage() || compiler_options_.IsBootImageExtension())) {
@@ -2145,11 +2111,13 @@
                                           number_of_public_type_dex_files,
                                           number_of_package_type_dex_files,
                                           number_of_string_dex_files,
+                                          number_of_method_type_dex_files,
                                           bcp_bss_info_[i].method_bss_mapping_offset,
                                           bcp_bss_info_[i].type_bss_mapping_offset,
                                           bcp_bss_info_[i].public_type_bss_mapping_offset,
                                           bcp_bss_info_[i].package_type_bss_mapping_offset,
-                                          bcp_bss_info_[i].string_bss_mapping_offset);
+                                          bcp_bss_info_[i].string_bss_mapping_offset,
+                                          bcp_bss_info_[i].method_type_bss_mapping_offset);
     }
   }
 
@@ -2160,6 +2128,7 @@
   CHECK_EQ(number_of_public_type_dex_files, bss_public_type_entry_references_.size());
   CHECK_EQ(number_of_package_type_dex_files, bss_package_type_entry_references_.size());
   CHECK_EQ(number_of_string_dex_files, bss_string_entry_references_.size());
+  CHECK_EQ(number_of_method_type_dex_files, bss_method_type_entry_references_.size());
 
   return offset;
 }
@@ -2171,11 +2140,13 @@
                                              /*inout*/ size_t& number_of_public_type_dex_files,
                                              /*inout*/ size_t& number_of_package_type_dex_files,
                                              /*inout*/ size_t& number_of_string_dex_files,
+                                             /*inout*/ size_t& number_of_method_type_dex_files,
                                              /*inout*/ uint32_t& method_bss_mapping_offset,
                                              /*inout*/ uint32_t& type_bss_mapping_offset,
                                              /*inout*/ uint32_t& public_type_bss_mapping_offset,
                                              /*inout*/ uint32_t& package_type_bss_mapping_offset,
-                                             /*inout*/ uint32_t& string_bss_mapping_offset) {
+                                             /*inout*/ uint32_t& string_bss_mapping_offset,
+                                             /*inout*/ uint32_t& method_type_bss_mapping_offset) {
   const PointerSize pointer_size = GetInstructionSetPointerSize(oat_header_->GetInstructionSet());
   auto method_it = bss_method_entry_references_.find(dex_file);
   if (method_it != bss_method_entry_references_.end()) {
@@ -2227,6 +2198,21 @@
           return bss_string_entries_.Get({dex_file, dex::StringIndex(index)});
         });
   }
+
+  auto method_type_it = bss_method_type_entry_references_.find(dex_file);
+  if (method_type_it != bss_method_type_entry_references_.end()) {
+    const BitVector& proto_indexes = method_type_it->second;
+    ++number_of_method_type_dex_files;
+    method_type_bss_mapping_offset = offset;
+    offset += CalculateIndexBssMappingSize(
+        dex_file->NumProtoIds(),
+        sizeof(GcRoot<mirror::MethodType>),
+        proto_indexes,
+        [=](uint32_t index) {
+          return bss_method_type_entries_.Get({dex_file, dex::ProtoIndex(index)});
+        });
+  }
+
   return offset;
 }
 
@@ -2260,13 +2246,11 @@
   // calculate the offsets within OatHeader to executable code
   size_t old_offset = offset;
   // required to be on a new page boundary
-  offset = RoundUp(offset, kPageSize);
+  offset = RoundUp(offset, kElfSegmentAlignment);
   oat_header_->SetExecutableOffset(offset);
   size_executable_offset_alignment_ = offset - old_offset;
   InstructionSet instruction_set = compiler_options_.GetInstructionSet();
-  if (GetCompilerOptions().IsBootImage() && primary_oat_file_ &&
-      // TODO(riscv64): remove this when we have compiler support for RISC-V.
-      instruction_set != InstructionSet::kRiscv64) {
+  if (GetCompilerOptions().IsBootImage() && primary_oat_file_) {
     const bool generate_debug_info = GetCompilerOptions().GenerateAnyDebugInfo();
     size_t adjusted_offset = offset;
 
@@ -2376,7 +2360,7 @@
     return offset;
   }
 
-  data_bimg_rel_ro_start_ = RoundUp(offset, kPageSize);
+  data_bimg_rel_ro_start_ = RoundUp(offset, kElfSegmentAlignment);
 
   for (auto& entry : data_bimg_rel_ro_entries_) {
     size_t& entry_offset = entry.second;
@@ -2400,7 +2384,8 @@
       bss_type_entries_.empty() &&
       bss_public_type_entries_.empty() &&
       bss_package_type_entries_.empty() &&
-      bss_string_entries_.empty()) {
+      bss_string_entries_.empty() &&
+      bss_method_type_entries_.empty()) {
     // Nothing to put to the .bss section.
     return;
   }
@@ -2441,6 +2426,12 @@
     entry.second = bss_size_;
     bss_size_ += sizeof(GcRoot<mirror::String>);
   }
+  // Prepare offsets for .bss MethodType entries.
+  for (auto& entry : bss_method_type_entries_) {
+    DCHECK_EQ(entry.second, 0u);
+    entry.second = bss_size_;
+    bss_size_ += sizeof(GcRoot<mirror::MethodType>);
+  }
 }
 
 bool OatWriter::WriteRodata(OutputStream* out) {
@@ -2510,12 +2501,6 @@
   return true;
 }
 
-void OatWriter::WriteQuickeningInfo(/*out*/std::vector<uint8_t>* ATTRIBUTE_UNUSED) {
-  // Nothing to write. Leave `vdex_size_` untouched and unaligned.
-  vdex_quickening_info_offset_ = vdex_size_;
-  size_quickening_info_alignment_ = 0;
-}
-
 void OatWriter::WriteVerifierDeps(verifier::VerifierDeps* verifier_deps,
                                   /*out*/std::vector<uint8_t>* buffer) {
   if (verifier_deps == nullptr) {
@@ -2589,7 +2574,7 @@
   // Record the padding before the .data.bimg.rel.ro section.
   // Do not write anything, this zero-filled part was skipped (Seek()) when starting the section.
   size_t code_end = GetOatHeader().GetExecutableOffset() + code_size_;
-  DCHECK_EQ(RoundUp(code_end, kPageSize), relative_offset);
+  DCHECK_EQ(RoundUp(code_end, kElfSegmentAlignment), relative_offset);
   size_t padding_size = relative_offset - code_end;
   DCHECK_EQ(size_data_bimg_rel_ro_alignment_, 0u);
   size_data_bimg_rel_ro_alignment_ = padding_size;
@@ -2623,7 +2608,6 @@
     DO_STAT(size_vdex_header_);
     DO_STAT(size_vdex_checksums_);
     DO_STAT(size_dex_file_alignment_);
-    DO_STAT(size_quickening_table_offset_);
     DO_STAT(size_executable_offset_alignment_);
     DO_STAT(size_oat_header_);
     DO_STAT(size_oat_header_key_value_store_);
@@ -2632,8 +2616,6 @@
     DO_STAT(size_verifier_deps_alignment_);
     DO_STAT(size_vdex_lookup_table_);
     DO_STAT(size_vdex_lookup_table_alignment_);
-    DO_STAT(size_quickening_info_);
-    DO_STAT(size_quickening_info_alignment_);
     DO_STAT(size_interpreter_to_interpreter_bridge_);
     DO_STAT(size_interpreter_to_compiled_code_bridge_);
     DO_STAT(size_jni_dlsym_lookup_trampoline_);
@@ -2655,7 +2637,9 @@
     DO_STAT(size_method_info_);
     DO_STAT(size_oat_dex_file_location_size_);
     DO_STAT(size_oat_dex_file_location_data_);
+    DO_STAT(size_oat_dex_file_magic_);
     DO_STAT(size_oat_dex_file_location_checksum_);
+    DO_STAT(size_oat_dex_file_sha1_);
     DO_STAT(size_oat_dex_file_offset_);
     DO_STAT(size_oat_dex_file_class_offsets_offset_);
     DO_STAT(size_oat_dex_file_lookup_table_offset_);
@@ -2667,12 +2651,14 @@
     DO_STAT(size_oat_dex_file_public_type_bss_mapping_offset_);
     DO_STAT(size_oat_dex_file_package_type_bss_mapping_offset_);
     DO_STAT(size_oat_dex_file_string_bss_mapping_offset_);
+    DO_STAT(size_oat_dex_file_method_type_bss_mapping_offset_);
     DO_STAT(size_bcp_bss_info_size_);
     DO_STAT(size_bcp_bss_info_method_bss_mapping_offset_);
     DO_STAT(size_bcp_bss_info_type_bss_mapping_offset_);
     DO_STAT(size_bcp_bss_info_public_type_bss_mapping_offset_);
     DO_STAT(size_bcp_bss_info_package_type_bss_mapping_offset_);
     DO_STAT(size_bcp_bss_info_string_bss_mapping_offset_);
+    DO_STAT(size_bcp_bss_info_method_type_bss_mapping_offset_);
     DO_STAT(size_oat_class_offsets_alignment_);
     DO_STAT(size_oat_class_offsets_);
     DO_STAT(size_oat_class_type_);
@@ -2685,6 +2671,7 @@
     DO_STAT(size_public_type_bss_mappings_);
     DO_STAT(size_package_type_bss_mappings_);
     DO_STAT(size_string_bss_mappings_);
+    DO_STAT(size_method_type_bss_mappings_);
     #undef DO_STAT
 
     VLOG(compiler) << "size_total=" << PrettySize(size_total) << " (" << size_total << "B)";
@@ -2870,7 +2857,8 @@
                                               uint32_t type_bss_mapping_offset,
                                               uint32_t public_type_bss_mapping_offset,
                                               uint32_t package_type_bss_mapping_offset,
-                                              uint32_t string_bss_mapping_offset) {
+                                              uint32_t string_bss_mapping_offset,
+                                              uint32_t method_type_bss_mapping_offset) {
   const PointerSize pointer_size = GetInstructionSetPointerSize(oat_header_->GetInstructionSet());
   auto method_it = bss_method_entry_references_.find(dex_file);
   if (method_it != bss_method_entry_references_.end()) {
@@ -2964,6 +2952,29 @@
     DCHECK_EQ(0u, string_bss_mapping_offset);
   }
 
+  auto method_type_it = bss_method_type_entry_references_.find(dex_file);
+  if (method_type_it != bss_method_type_entry_references_.end()) {
+    const BitVector& method_type_indexes = method_type_it->second;
+    DCHECK_EQ(relative_offset, method_type_bss_mapping_offset);
+    DCHECK_OFFSET();
+    size_t method_type_mappings_size =
+        WriteIndexBssMapping(out,
+                             dex_file->NumProtoIds(),
+                             sizeof(GcRoot<mirror::MethodType>),
+                             method_type_indexes,
+                             [=](uint32_t index) {
+                               return bss_method_type_entries_
+                                   .Get({dex_file, dex::ProtoIndex(index)});
+                             });
+    if (method_type_mappings_size == 0u) {
+      return 0u;
+    }
+    size_method_type_bss_mappings_ += method_type_mappings_size;
+    relative_offset += method_type_mappings_size;
+  } else {
+    DCHECK_EQ(0u, method_type_bss_mapping_offset);
+  }
+
   return relative_offset;
 }
 
@@ -2975,7 +2986,8 @@
       bss_type_entry_references_.empty() &&
       bss_public_type_entry_references_.empty() &&
       bss_package_type_entry_references_.empty() &&
-      bss_string_entry_references_.empty()) {
+      bss_string_entry_references_.empty() &&
+      bss_method_type_entry_references_.empty()) {
     return relative_offset;
   }
   // If there are any classes, the class offsets allocation aligns the offset
@@ -2994,7 +3006,8 @@
                                                   oat_dex_file->type_bss_mapping_offset_,
                                                   oat_dex_file->public_type_bss_mapping_offset_,
                                                   oat_dex_file->package_type_bss_mapping_offset_,
-                                                  oat_dex_file->string_bss_mapping_offset_);
+                                                  oat_dex_file->string_bss_mapping_offset_,
+                                                  oat_dex_file->method_type_bss_mapping_offset_);
     if (relative_offset == 0u) {
       return 0u;
     }
@@ -3015,7 +3028,8 @@
                                       bcp_bss_info_[i].type_bss_mapping_offset,
                                       bcp_bss_info_[i].public_type_bss_mapping_offset,
                                       bcp_bss_info_[i].package_type_bss_mapping_offset,
-                                      bcp_bss_info_[i].string_bss_mapping_offset);
+                                      bcp_bss_info_[i].string_bss_mapping_offset,
+                                      bcp_bss_info_[i].method_type_bss_mapping_offset);
       if (relative_offset == 0u) {
         return 0u;
       }
@@ -3072,9 +3086,7 @@
 
 size_t OatWriter::WriteCode(OutputStream* out, size_t file_offset, size_t relative_offset) {
   InstructionSet instruction_set = compiler_options_.GetInstructionSet();
-  if (GetCompilerOptions().IsBootImage() && primary_oat_file_ &&
-      // TODO(riscv64): remove this when we have compiler support for RISC-V.
-      instruction_set != InstructionSet::kRiscv64) {
+  if (GetCompilerOptions().IsBootImage() && primary_oat_file_) {
     #define DO_TRAMPOLINE(field) \
       do { \
         /* Pad with at least four 0xFFs so we can do DCHECKs in OatQuickMethodHeader */ \
@@ -3189,7 +3201,7 @@
   if (copy_dex_files == CopyOption::kOnlyIfCompressed) {
     extract_dex_files_into_vdex_ = false;
     for (OatDexFile& oat_dex_file : oat_dex_files_) {
-      const DexFileContainer* container = oat_dex_file.GetDexFile()->GetContainer();
+      const DexFileContainer* container = oat_dex_file.GetDexFile()->GetContainer().get();
       if (!(container->IsZip() && container->IsFileMap())) {
         extract_dex_files_into_vdex_ = true;
         break;
@@ -3220,6 +3232,15 @@
     }
   }
 
+  // Compact dex reader/writer does not understand dex containers,
+  // which is ok since dex containers replace compat-dex.
+  for (OatDexFile& oat_dex_file : oat_dex_files_) {
+    const DexFile* dex_file = oat_dex_file.GetDexFile();
+    if (dex_file->HasDexContainer()) {
+      compact_dex_level_ = CompactDexLevel::kCompactDexLevelNone;
+    }
+  }
+
   if (extract_dex_files_into_vdex_) {
     vdex_dex_files_offset_ = vdex_size_;
 
@@ -3289,7 +3310,11 @@
 
     // Extend the file and include the full page at the end as we need to write
     // additional data there and do not want to mmap that page twice.
-    size_t page_aligned_size = RoundUp(vdex_size_with_dex_files, kPageSize);
+    //
+    // The page size value here is used to figure out the size of the mapping below,
+    // however it doesn't affect the file contents or its size, so should not be
+    // replaced with kElfSegmentAlignment.
+    size_t page_aligned_size = RoundUp(vdex_size_with_dex_files, MemMap::GetPageSize());
     if (!use_existing_vdex) {
       if (file->SetLength(page_aligned_size) != 0) {
         PLOG(ERROR) << "Failed to resize vdex file " << file->GetPath();
@@ -3439,6 +3464,7 @@
     }
   }
   CHECK_EQ(oat_dex_file->dex_file_location_checksum_, dex_file->GetLocationChecksum());
+  CHECK(oat_dex_file->dex_file_sha1_ == dex_file->GetSha1());
   return true;
 }
 
@@ -3472,6 +3498,7 @@
   DCHECK_EQ(opened_dex_files_map->size(), 1u);
   DCHECK(vdex_begin_ == opened_dex_files_map->front().Begin());
   std::vector<std::unique_ptr<const DexFile>> dex_files;
+  auto dex_container = std::make_shared<MemoryDexFileContainer>(vdex_begin_, vdex_size_);
   for (OatDexFile& oat_dex_file : oat_dex_files_) {
     const uint8_t* raw_dex_file = vdex_begin_ + oat_dex_file.dex_file_offset_;
 
@@ -3492,14 +3519,14 @@
 
     // Now, open the dex file.
     std::string error_msg;
-    ArtDexFileLoader dex_file_loader(
-        raw_dex_file, oat_dex_file.dex_file_size_, oat_dex_file.GetLocation());
+    ArtDexFileLoader dex_file_loader(dex_container, oat_dex_file.GetLocation());
     // All dex files have been already verified in WriteDexFiles before we copied them.
-    dex_files.emplace_back(dex_file_loader.Open(oat_dex_file.dex_file_location_checksum_,
-                                                /*oat_dex_file=*/nullptr,
-                                                /*verify=*/false,
-                                                /*verify_checksum=*/false,
-                                                &error_msg));
+    dex_files.emplace_back(dex_file_loader.OpenOne(oat_dex_file.dex_file_offset_,
+                                                   oat_dex_file.dex_file_location_checksum_,
+                                                   /*oat_dex_file=*/nullptr,
+                                                   /*verify=*/false,
+                                                   /*verify_checksum=*/false,
+                                                   &error_msg));
     if (dex_files.back() == nullptr) {
       LOG(ERROR) << "Failed to open dex file from oat file. File: " << oat_dex_file.GetLocation()
                  << " Error: " << error_msg;
@@ -3666,7 +3693,8 @@
   if (extract_dex_files_into_vdex_) {
     DCHECK(vdex_begin != nullptr);
     // Write data to the last already mmapped page of the vdex file.
-    size_t mmapped_vdex_size = RoundUp(old_vdex_size, kPageSize);
+    // The size should match the page_aligned_size in the OatWriter::WriteDexFiles.
+    size_t mmapped_vdex_size = RoundUp(old_vdex_size, MemMap::GetPageSize());
     size_t first_chunk_size = std::min(buffer.size(), mmapped_vdex_size - old_vdex_size);
     memcpy(vdex_begin + old_vdex_size, buffer.data(), first_chunk_size);
 
@@ -3755,7 +3783,11 @@
     if (extract_dex_files_into_vdex_) {
       // Note: We passed the ownership of the vdex dex file MemMap to the caller,
       // so we need to use msync() for the range explicitly.
-      if (msync(vdex_begin, RoundUp(old_vdex_size, kPageSize), MS_SYNC) != 0) {
+      //
+      // The page size here is not replaced with kElfSegmentAlignment as the
+      // rounded up size should match the page_aligned_size in OatWriter::WriteDexFiles
+      // which is the size the original (non-extra) mapping created there.
+      if (msync(vdex_begin, RoundUp(old_vdex_size, MemMap::GetPageSize()), MS_SYNC) != 0) {
         PLOG(ERROR) << "Failed to sync vdex file contents" << vdex_file->GetPath();
         return false;
       }
@@ -3773,7 +3805,12 @@
 
   // Note: If `extract_dex_files_into_vdex_`, we passed the ownership of the vdex dex file
   // MemMap to the caller, so we need to use msync() for the range explicitly.
-  if (msync(vdex_begin, kPageSize, MS_SYNC) != 0) {
+  //
+  // The page size here should not be replaced with kElfSegmentAlignment as the size
+  // here should match the header size rounded up to the page size. Any higher value
+  // might happen to be larger than the size of the mapping which can in some circumstances
+  // cause msync to fail.
+  if (msync(vdex_begin, MemMap::GetPageSize(), MS_SYNC) != 0) {
     PLOG(ERROR) << "Failed to sync vdex file header " << vdex_file->GetPath();
     return false;
   }
@@ -3816,7 +3853,9 @@
       offset_(0),
       dex_file_location_size_(strlen(dex_file_location_->c_str())),
       dex_file_location_data_(dex_file_location_->c_str()),
+      dex_file_magic_(dex_file_->GetHeader().magic_),
       dex_file_location_checksum_(dex_file_->GetLocationChecksum()),
+      dex_file_sha1_(dex_file_->GetSha1()),
       dex_file_offset_(0u),
       lookup_table_offset_(0u),
       class_offsets_offset_(0u),
@@ -3825,22 +3864,18 @@
       public_type_bss_mapping_offset_(0u),
       package_type_bss_mapping_offset_(0u),
       string_bss_mapping_offset_(0u),
+      method_type_bss_mapping_offset_(0u),
       dex_sections_layout_offset_(0u),
       class_offsets_() {}
 
 size_t OatWriter::OatDexFile::SizeOf() const {
-  return sizeof(dex_file_location_size_)
-          + dex_file_location_size_
-          + sizeof(dex_file_location_checksum_)
-          + sizeof(dex_file_offset_)
-          + sizeof(class_offsets_offset_)
-          + sizeof(lookup_table_offset_)
-          + sizeof(method_bss_mapping_offset_)
-          + sizeof(type_bss_mapping_offset_)
-          + sizeof(public_type_bss_mapping_offset_)
-          + sizeof(package_type_bss_mapping_offset_)
-          + sizeof(string_bss_mapping_offset_)
-          + sizeof(dex_sections_layout_offset_);
+  return sizeof(dex_file_location_size_) + dex_file_location_size_ + sizeof(dex_file_magic_) +
+         sizeof(dex_file_location_checksum_) + sizeof(dex_file_sha1_) + sizeof(dex_file_offset_) +
+         sizeof(class_offsets_offset_) + sizeof(lookup_table_offset_) +
+         sizeof(method_bss_mapping_offset_) + sizeof(type_bss_mapping_offset_) +
+         sizeof(public_type_bss_mapping_offset_) + sizeof(package_type_bss_mapping_offset_) +
+         sizeof(string_bss_mapping_offset_) + sizeof(method_type_bss_mapping_offset_) +
+         sizeof(dex_sections_layout_offset_);
 }
 
 bool OatWriter::OatDexFile::Write(OatWriter* oat_writer, OutputStream* out) const {
@@ -3859,12 +3894,24 @@
   }
   oat_writer->size_oat_dex_file_location_data_ += dex_file_location_size_;
 
+  if (!out->WriteFully(&dex_file_magic_, sizeof(dex_file_magic_))) {
+    PLOG(ERROR) << "Failed to write dex file magic to " << out->GetLocation();
+    return false;
+  }
+  oat_writer->size_oat_dex_file_magic_ += sizeof(dex_file_magic_);
+
   if (!out->WriteFully(&dex_file_location_checksum_, sizeof(dex_file_location_checksum_))) {
     PLOG(ERROR) << "Failed to write dex file location checksum to " << out->GetLocation();
     return false;
   }
   oat_writer->size_oat_dex_file_location_checksum_ += sizeof(dex_file_location_checksum_);
 
+  if (!out->WriteFully(&dex_file_sha1_, sizeof(dex_file_sha1_))) {
+    PLOG(ERROR) << "Failed to write dex file sha1 to " << out->GetLocation();
+    return false;
+  }
+  oat_writer->size_oat_dex_file_sha1_ += sizeof(dex_file_sha1_);
+
   if (!out->WriteFully(&dex_file_offset_, sizeof(dex_file_offset_))) {
     PLOG(ERROR) << "Failed to write dex file offset to " << out->GetLocation();
     return false;
@@ -3922,6 +3969,13 @@
   }
   oat_writer->size_oat_dex_file_string_bss_mapping_offset_ += sizeof(string_bss_mapping_offset_);
 
+  if (!out->WriteFully(&method_type_bss_mapping_offset_, sizeof(method_type_bss_mapping_offset_))) {
+    PLOG(ERROR) << "Failed to write MethodType bss mapping offset to " << out->GetLocation();
+    return false;
+  }
+  oat_writer->size_oat_dex_file_method_type_bss_mapping_offset_ +=
+      sizeof(method_type_bss_mapping_offset_);
+
   return true;
 }
 
@@ -3961,6 +4015,13 @@
   }
   oat_writer->size_bcp_bss_info_string_bss_mapping_offset_ += sizeof(string_bss_mapping_offset);
 
+  if (!out->WriteFully(&method_type_bss_mapping_offset, sizeof(method_type_bss_mapping_offset))) {
+    PLOG(ERROR) << "Failed to write method type bss mapping offset to " << out->GetLocation();
+    return false;
+  }
+  oat_writer->size_bcp_bss_info_method_type_bss_mapping_offset_ +=
+      sizeof(method_type_bss_mapping_offset);
+
   return true;
 }
 
diff --git a/dex2oat/linker/oat_writer.h b/dex2oat/linker/oat_writer.h
index 79ec47e..9d83bcb 100644
--- a/dex2oat/linker/oat_writer.h
+++ b/dex2oat/linker/oat_writer.h
@@ -32,6 +32,7 @@
 #include "dex/compact_dex_level.h"
 #include "dex/method_reference.h"
 #include "dex/string_reference.h"
+#include "dex/proto_reference.h"
 #include "dex/type_reference.h"
 #include "linker/relative_patcher.h"  // For RelativePatcherTargetProvider.
 #include "mirror/class.h"
@@ -93,7 +94,7 @@
 // ...
 // MethodBssMapping
 //
-// VmapTable         one variable sized VmapTable blob (CodeInfo or QuickeningInfo).
+// VmapTable         one variable sized VmapTable blob (CodeInfo).
 // VmapTable         VmapTables are deduplicated.
 // ...
 // VmapTable
@@ -147,7 +148,8 @@
       const char* location);
   // Add dex file source from raw memory.
   bool AddRawDexFileSource(
-      const ArrayRef<const uint8_t>& data,
+      std::shared_ptr<DexFileContainer> container,
+      const uint8_t* dex_file_begin,
       const char* location,
       uint32_t location_checksum);
   // Add dex file source(s) from a vdex file.
@@ -286,7 +288,6 @@
   bool OpenDexFiles(File* file,
                     /*inout*/ std::vector<MemMap>* opened_dex_files_map,
                     /*out*/ std::vector<std::unique_ptr<const DexFile>>* opened_dex_files);
-  void WriteQuickeningInfo(/*out*/std::vector<uint8_t>* buffer);
   void WriteTypeLookupTables(/*out*/std::vector<uint8_t>* buffer);
   void WriteVerifierDeps(verifier::VerifierDeps* verifier_deps,
                          /*out*/std::vector<uint8_t>* buffer);
@@ -321,7 +322,8 @@
                                      uint32_t type_bss_mapping_offset,
                                      uint32_t public_type_bss_mapping_offset,
                                      uint32_t package_type_bss_mapping_offset,
-                                     uint32_t string_bss_mapping_offset);
+                                     uint32_t string_bss_mapping_offset,
+                                     uint32_t method_type_bss_mapping_offset);
   size_t InitIndexBssMappingsHelper(size_t offset,
                                     const DexFile* dex_file,
                                     /*inout*/ size_t& number_of_method_dex_files,
@@ -329,11 +331,13 @@
                                     /*inout*/ size_t& number_of_public_type_dex_files,
                                     /*inout*/ size_t& number_of_package_type_dex_files,
                                     /*inout*/ size_t& number_of_string_dex_files,
+                                    /*inout*/ size_t& number_of_method_type_dex_files,
                                     /*inout*/ uint32_t& method_bss_mapping_offset,
                                     /*inout*/ uint32_t& type_bss_mapping_offset,
                                     /*inout*/ uint32_t& public_type_bss_mapping_offset,
                                     /*inout*/ uint32_t& package_type_bss_mapping_offset,
-                                    /*inout*/ uint32_t& string_bss_mapping_offset);
+                                    /*inout*/ uint32_t& string_bss_mapping_offset,
+                                    /*inout*/ uint32_t& method_type_bss_mapping_offset);
 
   bool RecordOatDataOffset(OutputStream* out);
   void InitializeTypeLookupTables(
@@ -397,9 +401,6 @@
   // Offset of section holding VerifierDeps inside Vdex.
   size_t vdex_verifier_deps_offset_;
 
-  // Offset of section holding quickening info inside Vdex.
-  size_t vdex_quickening_info_offset_;
-
   // Offset of type lookup tables inside Vdex.
   size_t vdex_lookup_tables_offset_;
 
@@ -452,6 +453,9 @@
   // Map for recording references to GcRoot<mirror::String> entries in .bss.
   SafeMap<const DexFile*, BitVector> bss_string_entry_references_;
 
+  // Map for recording references to GcRoot<mirror::MethodType> entries in .bss.
+  SafeMap<const DexFile*, BitVector> bss_method_type_entry_references_;
+
   // Map for allocating ArtMethod entries in .bss. Indexed by MethodReference for the target
   // method in the dex file with the "method reference value comparator" for deduplication.
   // The value is the target offset for patching, starting at `bss_start_ + bss_methods_offset_`.
@@ -477,6 +481,11 @@
   // is the target offset for patching, starting at `bss_start_ + bss_roots_offset_`.
   SafeMap<StringReference, size_t, StringReferenceValueComparator> bss_string_entries_;
 
+  // Map for allocating MethodType entries in .bss. Indexed by ProtoReference for the source
+  // proto in the dex file with the "proto value comparator" for deduplication. The value
+  // is the target offset for patching, starting at `bss_start_ + bss_roots_offset_`.
+  SafeMap<ProtoReference, size_t, ProtoReferenceValueComparator> bss_method_type_entries_;
+
   // Offset of the oat data from the start of the mmapped region of the elf file.
   size_t oat_data_offset_;
 
@@ -497,71 +506,73 @@
   std::unique_ptr<const std::vector<uint8_t>> nterp_trampoline_;
 
   // output stats
-  uint32_t size_vdex_header_;
-  uint32_t size_vdex_checksums_;
-  uint32_t size_dex_file_alignment_;
-  uint32_t size_quickening_table_offset_;
-  uint32_t size_executable_offset_alignment_;
-  uint32_t size_oat_header_;
-  uint32_t size_oat_header_key_value_store_;
-  uint32_t size_dex_file_;
-  uint32_t size_verifier_deps_;
-  uint32_t size_verifier_deps_alignment_;
-  uint32_t size_quickening_info_;
-  uint32_t size_quickening_info_alignment_;
-  uint32_t size_vdex_lookup_table_alignment_;
-  uint32_t size_vdex_lookup_table_;
-  uint32_t size_interpreter_to_interpreter_bridge_;
-  uint32_t size_interpreter_to_compiled_code_bridge_;
-  uint32_t size_jni_dlsym_lookup_trampoline_;
-  uint32_t size_jni_dlsym_lookup_critical_trampoline_;
-  uint32_t size_quick_generic_jni_trampoline_;
-  uint32_t size_quick_imt_conflict_trampoline_;
-  uint32_t size_quick_resolution_trampoline_;
-  uint32_t size_quick_to_interpreter_bridge_;
-  uint32_t size_nterp_trampoline_;
-  uint32_t size_trampoline_alignment_;
-  uint32_t size_method_header_;
-  uint32_t size_code_;
-  uint32_t size_code_alignment_;
-  uint32_t size_data_bimg_rel_ro_;
-  uint32_t size_data_bimg_rel_ro_alignment_;
-  uint32_t size_relative_call_thunks_;
-  uint32_t size_misc_thunks_;
-  uint32_t size_vmap_table_;
-  uint32_t size_method_info_;
-  uint32_t size_oat_dex_file_location_size_;
-  uint32_t size_oat_dex_file_location_data_;
-  uint32_t size_oat_dex_file_location_checksum_;
-  uint32_t size_oat_dex_file_offset_;
-  uint32_t size_oat_dex_file_class_offsets_offset_;
-  uint32_t size_oat_dex_file_lookup_table_offset_;
-  uint32_t size_oat_dex_file_dex_layout_sections_offset_;
-  uint32_t size_oat_dex_file_dex_layout_sections_;
-  uint32_t size_oat_dex_file_dex_layout_sections_alignment_;
-  uint32_t size_oat_dex_file_method_bss_mapping_offset_;
-  uint32_t size_oat_dex_file_type_bss_mapping_offset_;
-  uint32_t size_oat_dex_file_public_type_bss_mapping_offset_;
-  uint32_t size_oat_dex_file_package_type_bss_mapping_offset_;
-  uint32_t size_oat_dex_file_string_bss_mapping_offset_;
-  uint32_t size_bcp_bss_info_size_;
-  uint32_t size_bcp_bss_info_method_bss_mapping_offset_;
-  uint32_t size_bcp_bss_info_type_bss_mapping_offset_;
-  uint32_t size_bcp_bss_info_public_type_bss_mapping_offset_;
-  uint32_t size_bcp_bss_info_package_type_bss_mapping_offset_;
-  uint32_t size_bcp_bss_info_string_bss_mapping_offset_;
-  uint32_t size_oat_class_offsets_alignment_;
-  uint32_t size_oat_class_offsets_;
-  uint32_t size_oat_class_type_;
-  uint32_t size_oat_class_status_;
-  uint32_t size_oat_class_num_methods_;
-  uint32_t size_oat_class_method_bitmaps_;
-  uint32_t size_oat_class_method_offsets_;
-  uint32_t size_method_bss_mappings_;
-  uint32_t size_type_bss_mappings_;
-  uint32_t size_public_type_bss_mappings_;
-  uint32_t size_package_type_bss_mappings_;
-  uint32_t size_string_bss_mappings_;
+  uint32_t size_vdex_header_ = 0;
+  uint32_t size_vdex_checksums_ = 0;
+  uint32_t size_dex_file_alignment_ = 0;
+  uint32_t size_executable_offset_alignment_ = 0;
+  uint32_t size_oat_header_ = 0;
+  uint32_t size_oat_header_key_value_store_ = 0;
+  uint32_t size_dex_file_ = 0;
+  uint32_t size_verifier_deps_ = 0;
+  uint32_t size_verifier_deps_alignment_ = 0;
+  uint32_t size_vdex_lookup_table_alignment_ = 0;
+  uint32_t size_vdex_lookup_table_ = 0;
+  uint32_t size_interpreter_to_interpreter_bridge_ = 0;
+  uint32_t size_interpreter_to_compiled_code_bridge_ = 0;
+  uint32_t size_jni_dlsym_lookup_trampoline_ = 0;
+  uint32_t size_jni_dlsym_lookup_critical_trampoline_ = 0;
+  uint32_t size_quick_generic_jni_trampoline_ = 0;
+  uint32_t size_quick_imt_conflict_trampoline_ = 0;
+  uint32_t size_quick_resolution_trampoline_ = 0;
+  uint32_t size_quick_to_interpreter_bridge_ = 0;
+  uint32_t size_nterp_trampoline_ = 0;
+  uint32_t size_trampoline_alignment_ = 0;
+  uint32_t size_method_header_ = 0;
+  uint32_t size_code_ = 0;
+  uint32_t size_code_alignment_ = 0;
+  uint32_t size_data_bimg_rel_ro_ = 0;
+  uint32_t size_data_bimg_rel_ro_alignment_ = 0;
+  uint32_t size_relative_call_thunks_ = 0;
+  uint32_t size_misc_thunks_ = 0;
+  uint32_t size_vmap_table_ = 0;
+  uint32_t size_method_info_ = 0;
+  uint32_t size_oat_dex_file_location_size_ = 0;
+  uint32_t size_oat_dex_file_location_data_ = 0;
+  uint32_t size_oat_dex_file_magic_ = 0;
+  uint32_t size_oat_dex_file_location_checksum_ = 0;
+  uint32_t size_oat_dex_file_sha1_ = 0;
+  uint32_t size_oat_dex_file_offset_ = 0;
+  uint32_t size_oat_dex_file_class_offsets_offset_ = 0;
+  uint32_t size_oat_dex_file_lookup_table_offset_ = 0;
+  uint32_t size_oat_dex_file_dex_layout_sections_offset_ = 0;
+  uint32_t size_oat_dex_file_dex_layout_sections_ = 0;
+  uint32_t size_oat_dex_file_dex_layout_sections_alignment_ = 0;
+  uint32_t size_oat_dex_file_method_bss_mapping_offset_ = 0;
+  uint32_t size_oat_dex_file_type_bss_mapping_offset_ = 0;
+  uint32_t size_oat_dex_file_public_type_bss_mapping_offset_ = 0;
+  uint32_t size_oat_dex_file_package_type_bss_mapping_offset_ = 0;
+  uint32_t size_oat_dex_file_string_bss_mapping_offset_ = 0;
+  uint32_t size_oat_dex_file_method_type_bss_mapping_offset_ = 0;
+  uint32_t size_bcp_bss_info_size_ = 0;
+  uint32_t size_bcp_bss_info_method_bss_mapping_offset_ = 0;
+  uint32_t size_bcp_bss_info_type_bss_mapping_offset_ = 0;
+  uint32_t size_bcp_bss_info_public_type_bss_mapping_offset_ = 0;
+  uint32_t size_bcp_bss_info_package_type_bss_mapping_offset_ = 0;
+  uint32_t size_bcp_bss_info_string_bss_mapping_offset_ = 0;
+  uint32_t size_bcp_bss_info_method_type_bss_mapping_offset_ = 0;
+  uint32_t size_oat_class_offsets_alignment_ = 0;
+  uint32_t size_oat_class_offsets_ = 0;
+  uint32_t size_oat_class_type_ = 0;
+  uint32_t size_oat_class_status_ = 0;
+  uint32_t size_oat_class_num_methods_ = 0;
+  uint32_t size_oat_class_method_bitmaps_ = 0;
+  uint32_t size_oat_class_method_offsets_ = 0;
+  uint32_t size_method_bss_mappings_ = 0;
+  uint32_t size_type_bss_mappings_ = 0;
+  uint32_t size_public_type_bss_mappings_ = 0;
+  uint32_t size_package_type_bss_mappings_ = 0;
+  uint32_t size_string_bss_mappings_ = 0;
+  uint32_t size_method_type_bss_mappings_ = 0;
 
   // The helper for processing relative patches is external so that we can patch across oat files.
   MultiOatRelativePatcher* relative_patcher_;
diff --git a/dex2oat/linker/oat_writer_test.cc b/dex2oat/linker/oat_writer_test.cc
index 6742cf7..d3a480f 100644
--- a/dex2oat/linker/oat_writer_test.cc
+++ b/dex2oat/linker/oat_writer_test.cc
@@ -41,8 +41,8 @@
 #include "mirror/class-inl.h"
 #include "mirror/object-inl.h"
 #include "mirror/object_array-inl.h"
-#include "oat.h"
-#include "oat_file-inl.h"
+#include "oat/oat.h"
+#include "oat/oat_file-inl.h"
 #include "oat_writer.h"
 #include "profile/profile_compilation_info.h"
 #include "scoped_thread_state_change-inl.h"
@@ -112,10 +112,8 @@
                          /*profile_compilation_info*/nullptr,
                          CompactDexLevel::kCompactDexLevelNone);
     for (const DexFile* dex_file : dex_files) {
-      ArrayRef<const uint8_t> raw_dex_file(
-          reinterpret_cast<const uint8_t*>(&dex_file->GetHeader()),
-          dex_file->GetHeader().file_size_);
-      if (!oat_writer.AddRawDexFileSource(raw_dex_file,
+      if (!oat_writer.AddRawDexFileSource(dex_file->GetContainer(),
+                                          dex_file->Begin(),
                                           dex_file->GetLocation().c_str(),
                                           dex_file->GetLocationChecksum())) {
         return false;
@@ -463,9 +461,7 @@
 
   ASSERT_TRUE(java_lang_dex_file_ != nullptr);
   const DexFile& dex_file = *java_lang_dex_file_;
-  uint32_t dex_file_checksum = dex_file.GetLocationChecksum();
-  const OatDexFile* oat_dex_file = oat_file->GetOatDexFile(dex_file.GetLocation().c_str(),
-                                                           &dex_file_checksum);
+  const OatDexFile* oat_dex_file = oat_file->GetOatDexFile(dex_file.GetLocation().c_str());
   ASSERT_TRUE(oat_dex_file != nullptr);
   CHECK_EQ(dex_file.GetLocationChecksum(), oat_dex_file->GetDexFileLocationChecksum());
   ScopedObjectAccess soa(Thread::Current());
diff --git a/dex2oat/linker/relative_patcher.cc b/dex2oat/linker/relative_patcher.cc
index 40acb0b..231c4a5 100644
--- a/dex2oat/linker/relative_patcher.cc
+++ b/dex2oat/linker/relative_patcher.cc
@@ -23,6 +23,9 @@
 #ifdef ART_ENABLE_CODEGEN_arm64
 #include "linker/arm64/relative_patcher_arm64.h"
 #endif
+#ifdef ART_ENABLE_CODEGEN_riscv64
+#include "linker/riscv64/relative_patcher_riscv64.h"
+#endif
 #ifdef ART_ENABLE_CODEGEN_x86
 #include "linker/x86/relative_patcher_x86.h"
 #endif
@@ -44,8 +47,8 @@
     RelativePatcherNone() { }
 
     uint32_t ReserveSpace(uint32_t offset,
-                          const CompiledMethod* compiled_method ATTRIBUTE_UNUSED,
-                          MethodReference method_ref ATTRIBUTE_UNUSED) override {
+                          [[maybe_unused]] const CompiledMethod* compiled_method,
+                          [[maybe_unused]] MethodReference method_ref) override {
       return offset;  // No space reserved; no patches expected.
     }
 
@@ -53,38 +56,38 @@
       return offset;  // No space reserved; no patches expected.
     }
 
-    uint32_t WriteThunks(OutputStream* out ATTRIBUTE_UNUSED, uint32_t offset) override {
+    uint32_t WriteThunks([[maybe_unused]] OutputStream* out, uint32_t offset) override {
       return offset;  // No thunks added; no patches expected.
     }
 
-    void PatchCall(std::vector<uint8_t>* code ATTRIBUTE_UNUSED,
-                   uint32_t literal_offset ATTRIBUTE_UNUSED,
-                   uint32_t patch_offset ATTRIBUTE_UNUSED,
-                   uint32_t target_offset ATTRIBUTE_UNUSED) override {
+    void PatchCall([[maybe_unused]] std::vector<uint8_t>* code,
+                   [[maybe_unused]] uint32_t literal_offset,
+                   [[maybe_unused]] uint32_t patch_offset,
+                   [[maybe_unused]] uint32_t target_offset) override {
       LOG(FATAL) << "Unexpected relative call patch.";
     }
 
-    void PatchPcRelativeReference(std::vector<uint8_t>* code ATTRIBUTE_UNUSED,
-                                  const LinkerPatch& patch ATTRIBUTE_UNUSED,
-                                  uint32_t patch_offset ATTRIBUTE_UNUSED,
-                                  uint32_t target_offset ATTRIBUTE_UNUSED) override {
+    void PatchPcRelativeReference([[maybe_unused]] std::vector<uint8_t>* code,
+                                  [[maybe_unused]] const LinkerPatch& patch,
+                                  [[maybe_unused]] uint32_t patch_offset,
+                                  [[maybe_unused]] uint32_t target_offset) override {
       LOG(FATAL) << "Unexpected relative dex cache array patch.";
     }
 
-    void PatchEntrypointCall(std::vector<uint8_t>* code ATTRIBUTE_UNUSED,
-                             const LinkerPatch& patch ATTRIBUTE_UNUSED,
-                             uint32_t patch_offset ATTRIBUTE_UNUSED) override {
+    void PatchEntrypointCall([[maybe_unused]] std::vector<uint8_t>* code,
+                             [[maybe_unused]] const LinkerPatch& patch,
+                             [[maybe_unused]] uint32_t patch_offset) override {
       LOG(FATAL) << "Unexpected entrypoint call patch.";
     }
 
-    void PatchBakerReadBarrierBranch(std::vector<uint8_t>* code ATTRIBUTE_UNUSED,
-                                     const LinkerPatch& patch ATTRIBUTE_UNUSED,
-                                     uint32_t patch_offset ATTRIBUTE_UNUSED) override {
+    void PatchBakerReadBarrierBranch([[maybe_unused]] std::vector<uint8_t>* code,
+                                     [[maybe_unused]] const LinkerPatch& patch,
+                                     [[maybe_unused]] uint32_t patch_offset) override {
       LOG(FATAL) << "Unexpected baker read barrier branch patch.";
     }
 
     std::vector<debug::MethodDebugInfo> GenerateThunkDebugInfo(
-        uint32_t executable_offset ATTRIBUTE_UNUSED) override {
+        [[maybe_unused]] uint32_t executable_offset) override {
       return std::vector<debug::MethodDebugInfo>();  // No thunks added.
     }
 
@@ -118,6 +121,13 @@
                                    target_provider,
                                    features->AsArm64InstructionSetFeatures()));
 #endif
+#ifdef ART_ENABLE_CODEGEN_riscv64
+    case InstructionSet::kRiscv64:
+      return std::unique_ptr<RelativePatcher>(
+          new Riscv64RelativePatcher(thunk_provider,
+                                     target_provider,
+                                     features->AsRiscv64InstructionSetFeatures()));
+#endif
     default:
       return std::unique_ptr<RelativePatcher>(new RelativePatcherNone);
   }
diff --git a/dex2oat/linker/relative_patcher_test.h b/dex2oat/linker/relative_patcher_test.h
index 2900523..65ca4f8 100644
--- a/dex2oat/linker/relative_patcher_test.h
+++ b/dex2oat/linker/relative_patcher_test.h
@@ -29,7 +29,7 @@
 #include "driver/compiled_method-inl.h"
 #include "driver/compiled_method_storage.h"
 #include "linker/relative_patcher.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "stream/vector_output_stream.h"
 
 namespace art {
@@ -68,6 +68,7 @@
     patcher_.reset();
     bss_begin_ = 0u;
     string_index_to_offset_map_.clear();
+    method_index_to_offset_map_.clear();
     compiled_method_refs_.clear();
     compiled_methods_.clear();
     patched_code_.clear();
@@ -77,7 +78,7 @@
 
   // Reset the helper to start another test. Creating and tearing down the Runtime is expensive,
   // so we merge related tests together.
-  void Reset() {
+  virtual void Reset() {
     thunk_provider_.Reset();
     method_offset_map_.map.clear();
     patcher_ = RelativePatcher::Create(instruction_set_,
@@ -86,6 +87,7 @@
                                        &method_offset_map_);
     bss_begin_ = 0u;
     string_index_to_offset_map_.clear();
+    method_index_to_offset_map_.clear();
     compiled_method_refs_.clear();
     compiled_methods_.clear();
     patched_code_.clear();
@@ -185,6 +187,13 @@
                                                patch,
                                                offset + patch.LiteralOffset(),
                                                target_offset);
+          } else if (patch.GetType() == LinkerPatch::Type::kMethodBssEntry) {
+            uint32_t target_offset =
+                bss_begin_ + method_index_to_offset_map_.Get(patch.TargetMethod().index);
+            patcher_->PatchPcRelativeReference(&patched_code_,
+                                               patch,
+                                               offset + patch.LiteralOffset(),
+                                               target_offset);
           } else if (patch.GetType() == LinkerPatch::Type::kStringRelative) {
             uint32_t target_offset =
                 string_index_to_offset_map_.Get(patch.TargetStringIndex().index_);
@@ -391,6 +400,7 @@
   std::unique_ptr<RelativePatcher> patcher_;
   uint32_t bss_begin_;
   SafeMap<uint32_t, uint32_t> string_index_to_offset_map_;
+  SafeMap<uint32_t, uint32_t> method_index_to_offset_map_;
   std::vector<MethodReference> compiled_method_refs_;
   std::vector<std::unique_ptr<CompiledMethod>> compiled_methods_;
   std::vector<uint8_t> patched_code_;
diff --git a/dex2oat/linker/riscv64/relative_patcher_riscv64.cc b/dex2oat/linker/riscv64/relative_patcher_riscv64.cc
new file mode 100644
index 0000000..09b7ac8
--- /dev/null
+++ b/dex2oat/linker/riscv64/relative_patcher_riscv64.cc
@@ -0,0 +1,154 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "relative_patcher_riscv64.h"
+
+#include "base/bit_utils.h"
+#include "debug/method_debug_info.h"
+#include "linker/linker_patch.h"
+
+namespace art {
+namespace linker {
+
+Riscv64RelativePatcher::Riscv64RelativePatcher(
+    [[maybe_unused]] RelativePatcherThunkProvider* thunk_provider,
+    [[maybe_unused]] RelativePatcherTargetProvider* target_provider,
+    [[maybe_unused]] const Riscv64InstructionSetFeatures* features)
+    : RelativePatcher() {
+}
+
+uint32_t Riscv64RelativePatcher::ReserveSpace(
+    uint32_t offset,
+    [[maybe_unused]] const CompiledMethod* compiled_method,
+    [[maybe_unused]] MethodReference method_ref) {
+  // TODO(riscv64): Reduce code size for AOT by using shared trampolines for slow path
+  // runtime calls across the entire oat file. These need space reserved here.
+  return offset;
+}
+
+uint32_t Riscv64RelativePatcher::ReserveSpaceEnd(uint32_t offset) {
+  // TODO(riscv64): Reduce code size for AOT by using shared trampolines for slow path
+  // runtime calls across the entire oat file. These need space reserved here.
+  return offset;
+}
+
+uint32_t Riscv64RelativePatcher::WriteThunks([[maybe_unused]] OutputStream* out, uint32_t offset) {
+  // TODO(riscv64): Reduce code size for AOT by using shared trampolines for slow path
+  // runtime calls across the entire oat file. These need to be written here.
+  return offset;
+}
+
+void Riscv64RelativePatcher::PatchCall([[maybe_unused]] std::vector<uint8_t>* code,
+                                       [[maybe_unused]] uint32_t literal_offset,
+                                       [[maybe_unused]] uint32_t patch_offset,
+                                       [[maybe_unused]] uint32_t target_offset) {
+  // Direct calls are currently not used on any architecture.
+  UNIMPLEMENTED(FATAL) << "Unsupported direct call.";
+}
+
+void Riscv64RelativePatcher::PatchPcRelativeReference(std::vector<uint8_t>* code,
+                                                      const LinkerPatch& patch,
+                                                      uint32_t patch_offset,
+                                                      uint32_t target_offset) {
+  DCHECK_ALIGNED(patch_offset, 2u);
+  DCHECK_ALIGNED(target_offset, 2u);
+  uint32_t literal_offset = patch.LiteralOffset();
+  uint32_t insn = GetInsn(code, literal_offset);
+  uint32_t pc_insn_offset = patch.PcInsnOffset();
+  uint32_t disp = target_offset - (patch_offset - literal_offset + pc_insn_offset);
+  if (literal_offset == pc_insn_offset) {
+    // Check it's an AUIPC with imm == 0x12345 (unset).
+    DCHECK_EQ((insn & 0xfffff07fu), 0x12345017u)
+        << literal_offset << ", " << pc_insn_offset << ", 0x" << std::hex << insn;
+    insn = PatchAuipc(insn, disp);
+  } else {
+    DCHECK_EQ((insn & 0xfff00000u), 0x67800000u);
+    CHECK((insn & 0x0000707fu) == 0x00000013u ||  // ADD
+          (insn & 0x0000707fu) == 0x00006003u ||  // LWU
+          (insn & 0x0000707fu) == 0x00003003u)    // LD
+        << "insn: 0x" << std::hex << insn << ", type: " << patch.GetType();
+    // Check that pc_insn_offset points to AUIPC with matching register.
+    DCHECK_EQ(GetInsn(code, pc_insn_offset) & 0x00000fffu,
+              0x00000017 | (((insn >> 15) & 0x1fu) << 7));
+    uint32_t imm12 = disp & 0xfffu;  // The instruction shall sign-extend this immediate.
+    insn = (insn & ~(0xfffu << 20)) | (imm12 << 20);
+  }
+  SetInsn(code, literal_offset, insn);
+}
+
+void Riscv64RelativePatcher::PatchEntrypointCall([[maybe_unused]] std::vector<uint8_t>* code,
+                                                 [[maybe_unused]] const LinkerPatch& patch,
+                                                 [[maybe_unused]] uint32_t patch_offset) {
+  // TODO(riscv64): Reduce code size for AOT by using shared trampolines for slow path
+  // runtime calls across the entire oat file. Calls to these trapolines need to be patched here.
+  UNIMPLEMENTED(FATAL) << "Shared entrypoint trampolines are not implemented.";
+}
+
+void Riscv64RelativePatcher::PatchBakerReadBarrierBranch(
+    [[maybe_unused]] std::vector<uint8_t>* code,
+    [[maybe_unused]] const LinkerPatch& patch,
+    [[maybe_unused]] uint32_t patch_offset) {
+  // Baker read barrier with introspection is not implemented.
+  // Such implementation is impractical given the short reach of conditional branches.
+  UNIMPLEMENTED(FATAL) << "Baker read barrier branches are not used on riscv64.";
+}
+
+std::vector<debug::MethodDebugInfo> Riscv64RelativePatcher::GenerateThunkDebugInfo(
+      [[maybe_unused]] uint32_t executable_offset) {
+  // TODO(riscv64): Reduce code size for AOT by using shared trampolines for slow path
+  // runtime calls across the entire oat file. These need debug info generated here.
+  return {};
+}
+
+uint32_t Riscv64RelativePatcher::PatchAuipc(uint32_t auipc, int32_t offset) {
+  // The highest 0x800 values are out of range.
+  DCHECK_LT(offset, 0x7ffff800);
+  // Round `offset` to nearest 4KiB offset because short offset has range [-0x800, 0x800).
+  int32_t near_offset = (offset + 0x800) & ~0xfff;
+  // Extract the `imm20`.
+  uint32_t imm20 = static_cast<uint32_t>(near_offset) >> 12;
+  return (auipc & 0x00000fffu) |  // Clear offset bits, keep AUIPC with destination reg.
+         (imm20 << 12);           // Encode the immediate.
+}
+
+void Riscv64RelativePatcher::SetInsn(std::vector<uint8_t>* code, uint32_t offset, uint32_t value) {
+  DCHECK_LE(offset + 4u, code->size());
+  DCHECK_ALIGNED(offset, 2u);
+  uint8_t* addr = &(*code)[offset];
+  addr[0] = (value >> 0) & 0xff;
+  addr[1] = (value >> 8) & 0xff;
+  addr[2] = (value >> 16) & 0xff;
+  addr[3] = (value >> 24) & 0xff;
+}
+
+uint32_t Riscv64RelativePatcher::GetInsn(ArrayRef<const uint8_t> code, uint32_t offset) {
+  DCHECK_LE(offset + 4u, code.size());
+  DCHECK_ALIGNED(offset, 2u);
+  const uint8_t* addr = &code[offset];
+  return
+      (static_cast<uint32_t>(addr[0]) << 0) +
+      (static_cast<uint32_t>(addr[1]) << 8) +
+      (static_cast<uint32_t>(addr[2]) << 16)+
+      (static_cast<uint32_t>(addr[3]) << 24);
+}
+
+template <typename Alloc>
+uint32_t Riscv64RelativePatcher::GetInsn(std::vector<uint8_t, Alloc>* code, uint32_t offset) {
+  return GetInsn(ArrayRef<const uint8_t>(*code), offset);
+}
+
+}  // namespace linker
+}  // namespace art
diff --git a/dex2oat/linker/riscv64/relative_patcher_riscv64.h b/dex2oat/linker/riscv64/relative_patcher_riscv64.h
new file mode 100644
index 0000000..0f70aa8
--- /dev/null
+++ b/dex2oat/linker/riscv64/relative_patcher_riscv64.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_DEX2OAT_LINKER_RISCV64_RELATIVE_PATCHER_RISCV64_H_
+#define ART_DEX2OAT_LINKER_RISCV64_RELATIVE_PATCHER_RISCV64_H_
+
+#include "base/array_ref.h"
+#include "linker/relative_patcher.h"
+
+namespace art {
+
+namespace linker {
+
+class Riscv64RelativePatcher final : public RelativePatcher {
+ public:
+  Riscv64RelativePatcher(RelativePatcherThunkProvider* thunk_provider,
+                         RelativePatcherTargetProvider* target_provider,
+                         const Riscv64InstructionSetFeatures* features);
+
+  uint32_t ReserveSpace(uint32_t offset,
+                        const CompiledMethod* compiled_method,
+                        MethodReference method_ref) override;
+  uint32_t ReserveSpaceEnd(uint32_t offset) override;
+  uint32_t WriteThunks(OutputStream* out, uint32_t offset) override;
+  void PatchCall(std::vector<uint8_t>* code,
+                 uint32_t literal_offset,
+                 uint32_t patch_offset,
+                 uint32_t target_offset) override;
+  void PatchPcRelativeReference(std::vector<uint8_t>* code,
+                                const LinkerPatch& patch,
+                                uint32_t patch_offset,
+                                uint32_t target_offset) override;
+  void PatchEntrypointCall(std::vector<uint8_t>* code,
+                           const LinkerPatch& patch,
+                           uint32_t patch_offset) override;
+  void PatchBakerReadBarrierBranch(std::vector<uint8_t>* code,
+                                   const LinkerPatch& patch,
+                                   uint32_t patch_offset) override;
+  std::vector<debug::MethodDebugInfo> GenerateThunkDebugInfo(
+      uint32_t executable_offset) override;
+
+ private:
+  static uint32_t PatchAuipc(uint32_t auipc, int32_t offset);
+
+  static void SetInsn(std::vector<uint8_t>* code, uint32_t offset, uint32_t value);
+  static uint32_t GetInsn(ArrayRef<const uint8_t> code, uint32_t offset);
+  template <typename Alloc>
+  uint32_t GetInsn(std::vector<uint8_t, Alloc>* code, uint32_t offset);
+
+  DISALLOW_COPY_AND_ASSIGN(Riscv64RelativePatcher);
+};
+
+}  // namespace linker
+}  // namespace art
+
+#endif  // ART_DEX2OAT_LINKER_RISCV64_RELATIVE_PATCHER_RISCV64_H_
diff --git a/dex2oat/linker/riscv64/relative_patcher_riscv64_test.cc b/dex2oat/linker/riscv64/relative_patcher_riscv64_test.cc
new file mode 100644
index 0000000..e4af20b
--- /dev/null
+++ b/dex2oat/linker/riscv64/relative_patcher_riscv64_test.cc
@@ -0,0 +1,228 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "relative_patcher_riscv64.h"
+
+#include "linker/linker_patch.h"
+#include "linker/relative_patcher_test.h"
+#include "oat/oat_quick_method_header.h"
+
+namespace art {
+namespace linker {
+
+class Riscv64RelativePatcherTest : public RelativePatcherTest {
+ public:
+  Riscv64RelativePatcherTest()
+      : RelativePatcherTest(InstructionSet::kRiscv64, "default") { }
+
+ protected:
+  // C.NOP instruction.
+  static constexpr uint32_t kCNopInsn = 0x0001u;
+  static constexpr size_t kCNopSize = 2u;
+
+  // Placeholder instructions with unset (zero) registers and immediates.
+  static constexpr uint32_t kAuipcInsn = 0x00000017u;
+  static constexpr uint32_t kAddiInsn = 0x00000013u;
+  static constexpr uint32_t kLwuInsn = 0x00006003u;
+  static constexpr uint32_t kLdInsn = 0x00003003u;
+
+  // Placeholder offset encoded in AUIPC and used before patching.
+  static constexpr uint32_t kUnpatchedOffset = 0x12345678u;
+
+  static void PushBackInsn16(std::vector<uint8_t>* code, uint32_t insn16) {
+    const uint8_t insn_code[] = {
+        static_cast<uint8_t>(insn16),
+        static_cast<uint8_t>(insn16 >> 8),
+    };
+    code->insert(code->end(), insn_code, insn_code + sizeof(insn_code));
+  }
+
+  static void PushBackInsn32(std::vector<uint8_t>* code, uint32_t insn32) {
+    const uint8_t insn_code[] = {
+        static_cast<uint8_t>(insn32),
+        static_cast<uint8_t>(insn32 >> 8),
+        static_cast<uint8_t>(insn32 >> 16),
+        static_cast<uint8_t>(insn32 >> 24),
+    };
+    code->insert(code->end(), insn_code, insn_code + sizeof(insn_code));
+  }
+
+  uint32_t GetMethodOffset(uint32_t method_idx) {
+    auto result = method_offset_map_.FindMethodOffset(MethodRef(method_idx));
+    CHECK(result.first);
+    CHECK_ALIGNED(result.second, 4u);
+    return result.second;
+  }
+
+  static constexpr uint32_t ExtractRs1ToRd(uint32_t insn) {
+    // The `rs1` is in bits 15..19 and we need to move it to bits 7..11.
+    return (insn >> (15 - 7)) & (0x1fu << 7);
+  }
+
+  std::vector<uint8_t> GenNopsAndAuipcAndUse(size_t start_cnops,
+                                             size_t mid_cnops,
+                                             uint32_t method_offset,
+                                             uint32_t target_offset,
+                                             uint32_t use_insn) {
+    CHECK_ALIGNED(method_offset, 4u);
+    uint32_t auipc_offset = method_offset + start_cnops * kCNopSize;
+    uint32_t offset = target_offset - auipc_offset;
+    if (offset != /* unpatched */ 0x12345678u) {
+      CHECK_ALIGNED(target_offset, 4u);
+    }
+    CHECK_EQ(use_insn & 0xfff00000u, 0u);
+    // Prepare `imm12` for `use_insn` and `imm20` for AUIPC, adjusted for sign-extension of `imm12`.
+    uint32_t imm12 = offset & 0xfffu;
+    uint32_t imm20 = (offset >> 12) + ((offset >> 11) & 1u);
+    // Prepare the AUIPC and use instruction.
+    DCHECK_EQ(use_insn & 0xfff00000u, 0u);    // Check that `imm12` in `use_insn` is empty.
+    use_insn |= imm12 << 20;                  // Update `imm12` in `use_insn`.
+    uint32_t auipc = kAuipcInsn |             // AUIPC rd, imm20
+        ExtractRs1ToRd(use_insn) |            // where `rd` is `rs1` from `use_insn`.
+        (imm20 << 12);
+    // Create the code.
+    std::vector<uint8_t> result;
+    result.reserve((start_cnops + mid_cnops) * kCNopSize + 8u);
+    for (size_t i = 0; i != start_cnops; ++i) {
+      PushBackInsn16(&result, kCNopInsn);
+    }
+    PushBackInsn32(&result, auipc);
+    for (size_t i = 0; i != mid_cnops; ++i) {
+      PushBackInsn16(&result, kCNopInsn);
+    }
+    PushBackInsn32(&result, use_insn);
+    return result;
+  }
+
+  std::vector<uint8_t> GenNopsAndAuipcAndUseUnpatched(size_t start_cnops,
+                                                      size_t mid_cnops,
+                                                      uint32_t use_insn) {
+    uint32_t target_offset = start_cnops * kCNopSize + kUnpatchedOffset;
+    return GenNopsAndAuipcAndUse(start_cnops, mid_cnops, 0u, target_offset, use_insn);
+  }
+
+  void TestNopsAuipcAddi(size_t start_cnops, size_t mid_cnops, uint32_t string_offset) {
+    constexpr uint32_t kStringIndex = 1u;
+    string_index_to_offset_map_.Put(kStringIndex, string_offset);
+    constexpr uint32_t kAddi = kAddiInsn | (10 << 15) | (11 << 7);  // ADDI A1, A0, <unfilled>
+    auto code = GenNopsAndAuipcAndUseUnpatched(start_cnops, mid_cnops, kAddi);
+    size_t auipc_offset = start_cnops * kCNopSize;
+    size_t addi_offset = auipc_offset + 4u + mid_cnops * kCNopSize;
+    const LinkerPatch patches[] = {
+        LinkerPatch::RelativeStringPatch(auipc_offset, nullptr, auipc_offset, kStringIndex),
+        LinkerPatch::RelativeStringPatch(addi_offset, nullptr, auipc_offset, kStringIndex),
+    };
+    AddCompiledMethod(MethodRef(1u),
+                      ArrayRef<const uint8_t>(code),
+                      ArrayRef<const LinkerPatch>(patches));
+    Link();
+
+    uint32_t method1_offset = GetMethodOffset(1u);
+    auto expected_code =
+        GenNopsAndAuipcAndUse(start_cnops, mid_cnops, method1_offset, string_offset, kAddi);
+    EXPECT_TRUE(CheckLinkedMethod(MethodRef(1u), ArrayRef<const uint8_t>(expected_code)));
+  }
+
+  void TestNopsAuipcLwu(
+      size_t start_cnops, size_t mid_cnops, uint32_t bss_begin, uint32_t string_entry_offset) {
+    constexpr uint32_t kStringIndex = 1u;
+    string_index_to_offset_map_.Put(kStringIndex, string_entry_offset);
+    bss_begin_ = bss_begin;
+    constexpr uint32_t kLwu = kLwuInsn | (10 << 15) | (10 << 7);  // LWU A0, A0, <unfilled>
+    auto code = GenNopsAndAuipcAndUseUnpatched(start_cnops, mid_cnops, kLwu);
+    size_t auipc_offset = start_cnops * kCNopSize;
+    size_t lwu_offset = auipc_offset + 4u + mid_cnops * kCNopSize;
+    const LinkerPatch patches[] = {
+        LinkerPatch::StringBssEntryPatch(auipc_offset, nullptr, auipc_offset, kStringIndex),
+        LinkerPatch::StringBssEntryPatch(lwu_offset, nullptr, auipc_offset, kStringIndex),
+    };
+    AddCompiledMethod(MethodRef(1u),
+                      ArrayRef<const uint8_t>(code),
+                      ArrayRef<const LinkerPatch>(patches));
+    Link();
+
+    uint32_t method1_offset = GetMethodOffset(1u);
+    uint32_t target_offset = bss_begin_ + string_entry_offset;
+    auto expected_code =
+        GenNopsAndAuipcAndUse(start_cnops, mid_cnops, method1_offset, target_offset, kLwu);
+    EXPECT_TRUE(CheckLinkedMethod(MethodRef(1u), ArrayRef<const uint8_t>(expected_code)));
+  }
+
+  void TestNopsAuipcLd(
+      size_t start_cnops, size_t mid_cnops, uint32_t bss_begin, uint32_t method_entry_offset) {
+    constexpr uint32_t kMethodIndex = 100u;
+    method_index_to_offset_map_.Put(kMethodIndex, method_entry_offset);
+    bss_begin_ = bss_begin;
+    constexpr uint32_t kLd = kLdInsn | (11 << 15) | (10 << 7);  // LD A0, A1, <unfilled>
+    auto code = GenNopsAndAuipcAndUseUnpatched(start_cnops, mid_cnops, kLd);
+    size_t auipc_offset = start_cnops * kCNopSize;
+    size_t ld_offset = auipc_offset + 4u + mid_cnops * kCNopSize;
+    const LinkerPatch patches[] = {
+        LinkerPatch::MethodBssEntryPatch(auipc_offset, nullptr, auipc_offset, kMethodIndex),
+        LinkerPatch::MethodBssEntryPatch(ld_offset, nullptr, auipc_offset, kMethodIndex),
+    };
+    AddCompiledMethod(MethodRef(1u),
+                      ArrayRef<const uint8_t>(code),
+                      ArrayRef<const LinkerPatch>(patches));
+    Link();
+
+    uint32_t method1_offset = GetMethodOffset(1u);
+    uint32_t target_offset = bss_begin_ + method_entry_offset;
+    auto expected_code =
+        GenNopsAndAuipcAndUse(start_cnops, mid_cnops, method1_offset, target_offset, kLd);
+    EXPECT_TRUE(CheckLinkedMethod(MethodRef(1u), ArrayRef<const uint8_t>(expected_code)));
+  }
+};
+
+TEST_F(Riscv64RelativePatcherTest, StringReference) {
+  for (size_t start_cnops : {0, 1, 2, 3, 4, 5, 6, 7}) {
+    for (size_t mid_cnops : {0, 1, 2, 3, 4, 5, 6, 7}) {
+      for (uint32_t string_offset : { 0x12345678u, -0x12345678u, 0x123457fcu, 0x12345800u}) {
+        Reset();
+        TestNopsAuipcAddi(start_cnops, mid_cnops, string_offset);
+      }
+    }
+  }
+}
+
+TEST_F(Riscv64RelativePatcherTest, StringBssEntry) {
+  for (size_t start_cnops : {0, 1, 2, 3, 4, 5, 6, 7}) {
+    for (size_t mid_cnops : {0, 1, 2, 3, 4, 5, 6, 7}) {
+      for (uint32_t bss_begin : { 0x12345678u, -0x12345678u, 0x10000000u, 0x12345000u }) {
+        for (uint32_t string_entry_offset : { 0x1234u, 0x4444u, 0x37fcu, 0x3800u }) {
+          Reset();
+          TestNopsAuipcLwu(start_cnops, mid_cnops, bss_begin, string_entry_offset);
+        }
+      }
+    }
+  }
+}
+
+TEST_F(Riscv64RelativePatcherTest, MethodBssEntry) {
+  for (size_t start_cnops : {0, 1, 2, 3, 4, 5, 6, 7}) {
+    for (size_t mid_cnops : {0, 1, 2, 3, 4, 5, 6, 7}) {
+      for (uint32_t bss_begin : { 0x12345678u, -0x12345678u, 0x10000000u, 0x12345000u }) {
+        for (uint32_t method_entry_offset : { 0x1234u, 0x4444u, 0x37f8u, 0x3800u }) {
+          Reset();
+          TestNopsAuipcLd(start_cnops, mid_cnops, bss_begin, method_entry_offset);
+        }
+      }
+    }
+  }
+}
+
+}  // namespace linker
+}  // namespace art
diff --git a/dex2oat/linker/x86/relative_patcher_x86.cc b/dex2oat/linker/x86/relative_patcher_x86.cc
index a444446..5b8cf47 100644
--- a/dex2oat/linker/x86/relative_patcher_x86.cc
+++ b/dex2oat/linker/x86/relative_patcher_x86.cc
@@ -56,15 +56,15 @@
   (*code)[literal_offset + 3u] = static_cast<uint8_t>(diff >> 24);
 }
 
-void X86RelativePatcher::PatchEntrypointCall(std::vector<uint8_t>* code ATTRIBUTE_UNUSED,
-                                             const LinkerPatch& patch ATTRIBUTE_UNUSED,
-                                             uint32_t patch_offset ATTRIBUTE_UNUSED) {
+void X86RelativePatcher::PatchEntrypointCall([[maybe_unused]] std::vector<uint8_t>* code,
+                                             [[maybe_unused]] const LinkerPatch& patch,
+                                             [[maybe_unused]] uint32_t patch_offset) {
   LOG(FATAL) << "UNIMPLEMENTED";
 }
 
-void X86RelativePatcher::PatchBakerReadBarrierBranch(std::vector<uint8_t>* code ATTRIBUTE_UNUSED,
-                                                     const LinkerPatch& patch ATTRIBUTE_UNUSED,
-                                                     uint32_t patch_offset ATTRIBUTE_UNUSED) {
+void X86RelativePatcher::PatchBakerReadBarrierBranch([[maybe_unused]] std::vector<uint8_t>* code,
+                                                     [[maybe_unused]] const LinkerPatch& patch,
+                                                     [[maybe_unused]] uint32_t patch_offset) {
   LOG(FATAL) << "UNIMPLEMENTED";
 }
 
diff --git a/dex2oat/linker/x86/relative_patcher_x86_base.cc b/dex2oat/linker/x86/relative_patcher_x86_base.cc
index 07cd724..1104b8a 100644
--- a/dex2oat/linker/x86/relative_patcher_x86_base.cc
+++ b/dex2oat/linker/x86/relative_patcher_x86_base.cc
@@ -23,8 +23,8 @@
 
 uint32_t X86BaseRelativePatcher::ReserveSpace(
     uint32_t offset,
-    const CompiledMethod* compiled_method ATTRIBUTE_UNUSED,
-    MethodReference method_ref ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] const CompiledMethod* compiled_method,
+    [[maybe_unused]] MethodReference method_ref) {
   return offset;  // No space reserved; no limit on relative call distance.
 }
 
@@ -32,12 +32,12 @@
   return offset;  // No space reserved; no limit on relative call distance.
 }
 
-uint32_t X86BaseRelativePatcher::WriteThunks(OutputStream* out ATTRIBUTE_UNUSED, uint32_t offset) {
+uint32_t X86BaseRelativePatcher::WriteThunks([[maybe_unused]] OutputStream* out, uint32_t offset) {
   return offset;  // No thunks added; no limit on relative call distance.
 }
 
 std::vector<debug::MethodDebugInfo> X86BaseRelativePatcher::GenerateThunkDebugInfo(
-    uint32_t executable_offset ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] uint32_t executable_offset) {
   return std::vector<debug::MethodDebugInfo>();  // No thunks added.
 }
 
diff --git a/dex2oat/linker/x86_64/relative_patcher_x86_64.cc b/dex2oat/linker/x86_64/relative_patcher_x86_64.cc
index 629affc..1177417 100644
--- a/dex2oat/linker/x86_64/relative_patcher_x86_64.cc
+++ b/dex2oat/linker/x86_64/relative_patcher_x86_64.cc
@@ -34,15 +34,15 @@
   reinterpret_cast<unaligned_int32_t*>(&(*code)[patch.LiteralOffset()])[0] = displacement;
 }
 
-void X86_64RelativePatcher::PatchEntrypointCall(std::vector<uint8_t>* code ATTRIBUTE_UNUSED,
-                                                const LinkerPatch& patch ATTRIBUTE_UNUSED,
-                                                uint32_t patch_offset ATTRIBUTE_UNUSED) {
+void X86_64RelativePatcher::PatchEntrypointCall([[maybe_unused]] std::vector<uint8_t>* code,
+                                                [[maybe_unused]] const LinkerPatch& patch,
+                                                [[maybe_unused]] uint32_t patch_offset) {
   LOG(FATAL) << "UNIMPLEMENTED";
 }
 
-void X86_64RelativePatcher::PatchBakerReadBarrierBranch(std::vector<uint8_t>* code ATTRIBUTE_UNUSED,
-                                                        const LinkerPatch& patch ATTRIBUTE_UNUSED,
-                                                        uint32_t patch_offset ATTRIBUTE_UNUSED) {
+void X86_64RelativePatcher::PatchBakerReadBarrierBranch([[maybe_unused]] std::vector<uint8_t>* code,
+                                                        [[maybe_unused]] const LinkerPatch& patch,
+                                                        [[maybe_unused]] uint32_t patch_offset) {
   LOG(FATAL) << "UNIMPLEMENTED";
 }
 
diff --git a/dex2oat/utils/swap_space.cc b/dex2oat/utils/swap_space.cc
index 6e0773b..b0686a4 100644
--- a/dex2oat/utils/swap_space.cc
+++ b/dex2oat/utils/swap_space.cc
@@ -22,6 +22,7 @@
 #include <numeric>
 
 #include "base/bit_utils.h"
+#include "base/mem_map.h"
 #include "base/macros.h"
 #include "base/mutex.h"
 #include "thread-current-inl.h"
@@ -29,7 +30,7 @@
 namespace art {
 
 // The chunk size by which the swap file is increased and mapped.
-static constexpr size_t kMininumMapSize = 16 * MB;
+static constexpr size_t kMinimumMapSize = 16 * MB;
 
 static constexpr bool kCheckFreeMaps = false;
 
@@ -146,7 +147,8 @@
 
 SwapSpace::SpaceChunk SwapSpace::NewFileChunk(size_t min_size) {
 #if !defined(__APPLE__)
-  size_t next_part = std::max(RoundUp(min_size, kPageSize), RoundUp(kMininumMapSize, kPageSize));
+  const size_t page_size = MemMap::GetPageSize();
+  size_t next_part = std::max(RoundUp(min_size, page_size), RoundUp(kMinimumMapSize, page_size));
   int result = TEMP_FAILURE_RETRY(ftruncate64(fd_, size_ + next_part));
   if (result != 0) {
     PLOG(FATAL) << "Unable to increase swap file.";
@@ -165,7 +167,7 @@
   SpaceChunk new_chunk = {ptr, next_part};
   return new_chunk;
 #else
-  UNUSED(min_size, kMininumMapSize);
+  UNUSED(min_size, kMinimumMapSize);
   LOG(FATAL) << "No swap file support on the Mac.";
   UNREACHABLE();
 #endif
diff --git a/dex2oat/utils/swap_space.h b/dex2oat/utils/swap_space.h
index aba6485..e4895ac 100644
--- a/dex2oat/utils/swap_space.h
+++ b/dex2oat/utils/swap_space.h
@@ -176,7 +176,7 @@
   pointer address(reference x) const { return &x; }
   const_pointer address(const_reference x) const { return &x; }
 
-  pointer allocate(size_type n, SwapAllocator<void>::pointer hint ATTRIBUTE_UNUSED = nullptr) {
+  pointer allocate(size_type n, [[maybe_unused]] SwapAllocator<void>::pointer hint = nullptr) {
     DCHECK_LE(n, max_size());
     if (swap_space_ == nullptr) {
       T* result = reinterpret_cast<T*>(malloc(n * sizeof(T)));
diff --git a/dex2oat/verifier_deps_test.cc b/dex2oat/verifier_deps_test.cc
index 00593f5..a1e93b7 100644
--- a/dex2oat/verifier_deps_test.cc
+++ b/dex2oat/verifier_deps_test.cc
@@ -46,9 +46,9 @@
       : CompilerCallbacks(CompilerCallbacks::CallbackMode::kCompileApp),
         deps_(nullptr) {}
 
-  void AddUncompilableMethod(MethodReference ref ATTRIBUTE_UNUSED) override {}
-  void AddUncompilableClass(ClassReference ref ATTRIBUTE_UNUSED) override {}
-  void ClassRejected(ClassReference ref ATTRIBUTE_UNUSED) override {}
+  void AddUncompilableMethod([[maybe_unused]] MethodReference ref) override {}
+  void AddUncompilableClass([[maybe_unused]] ClassReference ref) override {}
+  void ClassRejected([[maybe_unused]] ClassReference ref) override {}
 
   verifier::VerifierDeps* GetVerifierDeps() const override { return deps_; }
   void SetVerifierDeps(verifier::VerifierDeps* deps) override { deps_ = deps; }
diff --git a/dexdump/Android.bp b/dexdump/Android.bp
index da43fbe..bf345a3 100644
--- a/dexdump/Android.bp
+++ b/dexdump/Android.bp
@@ -34,7 +34,10 @@
 art_cc_binary {
     name: "dexdump",
     defaults: ["dexdump_defaults"],
-    visibility: ["//development/build"],
+    visibility: [
+        "//development/build",
+        "//vendor:__subpackages__",
+    ],
     host_supported: true,
     target: {
         android: {
diff --git a/dexdump/dexdump.cc b/dexdump/dexdump.cc
index 7e4c1a6..b237c0e 100644
--- a/dexdump/dexdump.cc
+++ b/dexdump/dexdump.cc
@@ -654,7 +654,7 @@
   const DexFile::Header& pHeader = pDexFile->GetHeader();
   char sanitized[sizeof(pHeader.magic_) * 2 + 1];
   fprintf(gOutFile, "DEX file header:\n");
-  asciify(sanitized, pHeader.magic_, sizeof(pHeader.magic_));
+  asciify(sanitized, pHeader.magic_.data(), pHeader.magic_.size());
   fprintf(gOutFile, "magic               : '%s'\n", sanitized);
   fprintf(gOutFile, "checksum            : %08x\n", pHeader.checksum_);
   fprintf(gOutFile, "signature           : %02x%02x...%02x%02x\n",
@@ -1890,6 +1890,8 @@
         type = "boolean";
         value = it.GetJavaValue().z ? "true" : "false";
         break;
+      case EncodedArrayValueIterator::ValueType::kEndOfInput:
+        UNREACHABLE();
     }
 
     if (gOptions.outputFormat == OUTPUT_PLAIN) {
@@ -1902,6 +1904,37 @@
 }
 
 /*
+ * Used to decide if we want to print or skip a string from string_ids
+ */
+static int isPrintable(const char* s) {
+  for (size_t i = 0; i < strlen(s); i++) {
+    if (!isprint((s[i]))) {
+      return false;
+    }
+  }
+  return true;
+}
+
+/*
+ * Show all printable string in the string_ids section
+ */
+static void dumpStrings(const DexFile* pDexFile) {
+  const DexFile::Header& pHeader = pDexFile->GetHeader();
+  fprintf(gOutFile, "\nDisplaying %u strings from string_ids:\n", pHeader.string_ids_size_);
+
+  for (uint32_t i = 0; i < pHeader.string_ids_size_; i++) {
+    dex::StringIndex idx = static_cast<dex::StringIndex>(i);
+    const char* string = pDexFile->StringDataByIdx(idx);
+    if (!isPrintable(string)) {
+      string = "skipped (not printable)";
+    }
+    fprintf(gOutFile, "  string[%06u] - '%s'\n", i, string);
+  }
+
+  fprintf(gOutFile, "\n");
+}
+
+/*
  * Dumps the requested sections of the file.
  */
 static void processDexFile(const char* fileName,
@@ -1912,7 +1945,7 @@
     if (n > 1) {
       fprintf(gOutFile, ":%s", DexFileLoader::GetMultiDexClassesDexName(i).c_str());
     }
-    fprintf(gOutFile, "', DEX version '%.3s'\n", pDexFile->GetHeader().magic_ + 4);
+    fprintf(gOutFile, "', DEX version '%.3s'\n", pDexFile->GetHeader().magic_.data() + 4);
   }
 
   // Headers.
@@ -1920,6 +1953,11 @@
     dumpFileHeader(pDexFile);
   }
 
+  // Strings.
+  if (gOptions.showAllStrings) {
+    dumpStrings(pDexFile);
+  }
+
   // Iterate over all classes.
   char* package = nullptr;
   const u4 classDefsSize = pDexFile->GetHeader().class_defs_size_;
diff --git a/dexdump/dexdump.h b/dexdump/dexdump.h
index 7226ca0..ec101d5 100644
--- a/dexdump/dexdump.h
+++ b/dexdump/dexdump.h
@@ -51,6 +51,7 @@
   bool verbose;
   OutputFormat outputFormat;
   const char* outputFileName;
+  bool showAllStrings;
 };
 
 /* Prototypes. */
diff --git a/dexdump/dexdump_main.cc b/dexdump/dexdump_main.cc
index fed2ba7..16c36ae 100644
--- a/dexdump/dexdump_main.cc
+++ b/dexdump/dexdump_main.cc
@@ -39,20 +39,22 @@
  */
 static void usage() {
   LOG(ERROR) << "Copyright (C) 2007 The Android Open Source Project\n";
-  LOG(ERROR) << gProgName << ": [-a] [-c] [-d] [-e] [-f] [-h] [-i] [-j] [-l layout] [-n]"
-                  "  [-o outfile] dexfile...\n";
+  LOG(ERROR) << gProgName
+             << ": [-a] [-c] [-d] [-e] [-f] [-h] [-i] [-j] [-l layout] [-n]"
+                "  [-s] [-o outfile] dexfile...\n";
   LOG(ERROR) << " -a : display annotations";
   LOG(ERROR) << " -c : verify checksum and exit";
   LOG(ERROR) << " -d : disassemble code sections";
   LOG(ERROR) << " -e : display exported items only";
-  LOG(ERROR) << " -f : display summary information from file header";
+  LOG(ERROR) << " -f : display dex file header";
   LOG(ERROR) << " -g : display CFG for dex";
-  LOG(ERROR) << " -h : display file header details";
+  LOG(ERROR) << " -h : display all sections header";
   LOG(ERROR) << " -i : ignore checksum failures";
   LOG(ERROR) << " -j : disable dex file verification";
   LOG(ERROR) << " -l : output layout, either 'plain' or 'xml'";
   LOG(ERROR) << " -n : don't display debug information";
   LOG(ERROR) << " -o : output file name (defaults to stdout)";
+  LOG(ERROR) << " -s : display all strings from string_ids header section";
 }
 
 /*
@@ -67,7 +69,7 @@
 
   // Parse all arguments.
   while (true) {
-    const int ic = getopt(argc, argv, "acdefghijl:no:");
+    const int ic = getopt(argc, argv, "acdefghijl:no:s");
     if (ic < 0) {
       break;  // done
     }
@@ -84,7 +86,7 @@
       case 'e':  // exported items only
         gOptions.exportsOnly = true;
         break;
-      case 'f':  // display outer file header
+      case 'f':  // display dex file header
         gOptions.showFileHeaders = true;
         break;
       case 'g':  // display cfg
@@ -115,6 +117,9 @@
       case 'o':  // output file
         gOptions.outputFileName = optarg;
         break;
+      case 's':  // display all strings
+        gOptions.showAllStrings = true;
+        break;
       default:
         wantUsage = true;
         break;
diff --git a/dexdump/dexdump_test.cc b/dexdump/dexdump_test.cc
index 91ab187..0ab5182a 100644
--- a/dexdump/dexdump_test.cc
+++ b/dexdump/dexdump_test.cc
@@ -67,8 +67,9 @@
 
 TEST_F(DexDumpTest, FullPlainOutput) {
   std::string error_msg;
-  ASSERT_TRUE(Exec({"-d", "-f", "-h", "-l", "plain", "-o", "/dev/null",
-    dex_file_}, &error_msg)) << error_msg;
+  ASSERT_TRUE(
+      Exec({"-d", "-f", "-h", "-s", "-l", "plain", "-o", "/dev/null", dex_file_}, &error_msg))
+      << error_msg;
 }
 
 TEST_F(DexDumpTest, XMLOutput) {
diff --git a/dexlayout/Android.bp b/dexlayout/Android.bp
index ec7fdf6..7c69c22 100644
--- a/dexlayout/Android.bp
+++ b/dexlayout/Android.bp
@@ -71,7 +71,6 @@
     name: "libart-dexlayout",
     defaults: [
         "libart-dexlayout-defaults",
-        "dex2oat-pgo-defaults",
     ],
     target: {
         android: {
diff --git a/dexlayout/compact_dex_writer.cc b/dexlayout/compact_dex_writer.cc
index b8c6ebe..b07a956 100644
--- a/dexlayout/compact_dex_writer.cc
+++ b/dexlayout/compact_dex_writer.cc
@@ -270,7 +270,7 @@
   CompactDexFile::WriteMagic(&header.magic_[0]);
   CompactDexFile::WriteCurrentVersion(&header.magic_[0]);
   header.checksum_ = header_->Checksum();
-  std::copy_n(header_->Signature(), DexFile::kSha1DigestSize, header.signature_);
+  header.signature_ = header_->Signature();
   header.file_size_ = header_->FileSize();
   // Since we are not necessarily outputting the same format as the input, avoid using the stored
   // header size.
diff --git a/dexlayout/dex_ir.cc b/dexlayout/dex_ir.cc
index 3917847..82c0389 100644
--- a/dexlayout/dex_ir.cc
+++ b/dexlayout/dex_ir.cc
@@ -30,11 +30,9 @@
 namespace art {
 namespace dex_ir {
 
-static uint32_t HeaderOffset(const dex_ir::Header* header ATTRIBUTE_UNUSED) {
-  return 0;
-}
+static uint32_t HeaderOffset([[maybe_unused]] const dex_ir::Header* header) { return 0; }
 
-static uint32_t HeaderSize(const dex_ir::Header* header ATTRIBUTE_UNUSED) {
+static uint32_t HeaderSize([[maybe_unused]] const dex_ir::Header* header) {
   // Size is in elements, so there is only one header.
   return 1;
 }
diff --git a/dexlayout/dex_ir.h b/dexlayout/dex_ir.h
index c819c67..229e948 100644
--- a/dexlayout/dex_ir.h
+++ b/dexlayout/dex_ir.h
@@ -110,13 +110,14 @@
   DISALLOW_COPY_AND_ASSIGN(AbstractDispatcher);
 };
 
-template<class T> class Iterator : public std::iterator<std::random_access_iterator_tag, T> {
+template <class T>
+class Iterator {
  public:
-  using value_type = typename std::iterator<std::random_access_iterator_tag, T>::value_type;
-  using difference_type =
-      typename std::iterator<std::random_access_iterator_tag, value_type>::difference_type;
-  using pointer = typename std::iterator<std::random_access_iterator_tag, value_type>::pointer;
-  using reference = typename std::iterator<std::random_access_iterator_tag, value_type>::reference;
+  using iterator_category = std::random_access_iterator_tag;
+  using value_type = T;
+  using difference_type = ptrdiff_t;
+  using pointer = value_type*;
+  using reference = value_type&;
 
   Iterator(const Iterator&) = default;
   Iterator(Iterator&&) noexcept = default;
@@ -357,9 +358,9 @@
 
 class Header : public Item {
  public:
-  Header(const uint8_t* magic,
+  Header(DexFile::Magic magic,
          uint32_t checksum,
-         const uint8_t* signature,
+         DexFile::Sha1 signature,
          uint32_t endian_tag,
          uint32_t file_size,
          uint32_t header_size,
@@ -381,9 +382,9 @@
                       data_offset);
   }
 
-  Header(const uint8_t* magic,
+  Header(DexFile::Magic magic,
          uint32_t checksum,
-         const uint8_t* signature,
+         DexFile::Sha1 signature,
          uint32_t endian_tag,
          uint32_t file_size,
          uint32_t header_size,
@@ -421,9 +422,9 @@
 
   static size_t ItemSize() { return kHeaderItemSize; }
 
-  const uint8_t* Magic() const { return magic_; }
+  DexFile::Magic Magic() const { return magic_; }
   uint32_t Checksum() const { return checksum_; }
-  const uint8_t* Signature() const { return signature_; }
+  DexFile::Sha1 Signature() const { return signature_; }
   uint32_t EndianTag() const { return endian_tag_; }
   uint32_t FileSize() const { return file_size_; }
   uint32_t HeaderSize() const { return header_size_; }
@@ -433,9 +434,7 @@
   uint32_t DataOffset() const { return data_offset_; }
 
   void SetChecksum(uint32_t new_checksum) { checksum_ = new_checksum; }
-  void SetSignature(const uint8_t* new_signature) {
-    memcpy(signature_, new_signature, sizeof(signature_));
-  }
+  void SetSignature(DexFile::Sha1 new_signature) { signature_ = new_signature; }
   void SetFileSize(uint32_t new_file_size) { file_size_ = new_file_size; }
   void SetHeaderSize(uint32_t new_header_size) { header_size_ = new_header_size; }
   void SetLinkSize(uint32_t new_link_size) { link_size_ = new_link_size; }
@@ -520,9 +519,9 @@
   }
 
  private:
-  uint8_t magic_[8];
+  DexFile::Magic magic_;
   uint32_t checksum_;
-  uint8_t signature_[DexFile::kSha1DigestSize];
+  DexFile::Sha1 signature_;
   uint32_t endian_tag_;
   uint32_t file_size_;
   uint32_t header_size_;
@@ -532,9 +531,9 @@
   uint32_t data_offset_;
   const bool support_default_methods_;
 
-  void ConstructorHelper(const uint8_t* magic,
+  void ConstructorHelper(DexFile::Magic magic,
                          uint32_t checksum,
-                         const uint8_t* signature,
+                         DexFile::Sha1 signature,
                          uint32_t endian_tag,
                          uint32_t file_size,
                          uint32_t header_size,
@@ -550,8 +549,8 @@
     link_offset_ = link_offset;
     data_size_ = data_size;
     data_offset_ = data_offset;
-    memcpy(magic_, magic, sizeof(magic_));
-    memcpy(signature_, signature, sizeof(signature_));
+    magic_ = magic;
+    signature_ = signature;
   }
 
   // Collection vectors own the IR data.
diff --git a/dexlayout/dex_visualize.cc b/dexlayout/dex_visualize.cc
index 382e294..9b11ec7 100644
--- a/dexlayout/dex_visualize.cc
+++ b/dexlayout/dex_visualize.cc
@@ -31,6 +31,7 @@
 
 #include <android-base/logging.h>
 
+#include "base/mem_map.h"
 #include "dex_ir.h"
 #include "dexlayout.h"
 #include "profile/profile_compilation_info.h"
@@ -49,7 +50,8 @@
   explicit Dumper(dex_ir::Header* header)
       : out_file_(nullptr),
         sorted_sections_(
-            dex_ir::GetSortedDexFileSections(header, dex_ir::SortDirection::kSortDescending)) { }
+            dex_ir::GetSortedDexFileSections(header, dex_ir::SortDirection::kSortDescending)),
+        page_size_(MemMap::GetPageSize()) {}
 
   bool OpenAndPrintHeader(size_t dex_index) {
     // Open the file and emit the gnuplot prologue.
@@ -70,7 +72,7 @@
         if (printed_one) {
           fprintf(out_file_, ", ");
         }
-        fprintf(out_file_, "\"%s\" %" PRIuPTR, s.name.c_str(), s.offset / kPageSize);
+        fprintf(out_file_, "\"%s\" %" PRIuPTR, s.name.c_str(), s.offset / page_size_);
         printed_one = true;
       }
     }
@@ -98,8 +100,8 @@
   }
 
   void DumpAddressRange(uint32_t from, uint32_t size, int class_index) {
-    const uint32_t low_page = from / kPageSize;
-    const uint32_t high_page = (size > 0) ? (from + size - 1) / kPageSize : low_page;
+    const uint32_t low_page = from / page_size_;
+    const uint32_t high_page = (size > 0) ? (from + size - 1) / page_size_ : low_page;
     const uint32_t size_delta = high_page - low_page;
     fprintf(out_file_, "%d %d %d 0 %d\n", low_page, class_index, size_delta, GetColor(from));
   }
@@ -234,6 +236,7 @@
 
   FILE* out_file_;
   std::vector<dex_ir::DexFileSection> sorted_sections_;
+  const size_t page_size_;
 
   DISALLOW_COPY_AND_ASSIGN(Dumper);
 };
@@ -316,7 +319,7 @@
 /*
  * Dumps the offset and size of sections within the file.
  */
-void ShowDexSectionStatistics(dex_ir::Header* header, size_t dex_file_index) {
+void ShowDexSectionStatistics(dex_ir::Header* header, size_t dex_file_index, size_t page_size) {
   // Compute the (multidex) class file name).
   fprintf(stdout, "%s (%d bytes)\n",
           MultidexName("classes", dex_file_index, ".dex").c_str(),
@@ -336,7 +339,7 @@
             file_section.offset,
             file_section.size,
             bytes,
-            RoundUp(bytes, kPageSize) / kPageSize,
+            RoundUp(bytes, page_size) / page_size,
             100 * bytes / header->FileSize());
   }
   fprintf(stdout, "\n");
diff --git a/dexlayout/dex_visualize.h b/dexlayout/dex_visualize.h
index a1aa2cd..8406412 100644
--- a/dexlayout/dex_visualize.h
+++ b/dexlayout/dex_visualize.h
@@ -38,7 +38,7 @@
                         size_t dex_file_index,
                         ProfileCompilationInfo* profile_info);
 
-void ShowDexSectionStatistics(dex_ir::Header* header, size_t dex_file_index);
+void ShowDexSectionStatistics(dex_ir::Header* header, size_t dex_file_index, size_t page_size);
 
 }  // namespace art
 
diff --git a/dexlayout/dex_writer.cc b/dexlayout/dex_writer.cc
index e7473c0..c1cf6cd 100644
--- a/dexlayout/dex_writer.cc
+++ b/dexlayout/dex_writer.cc
@@ -789,22 +789,20 @@
 }
 
 void DexWriter::WriteHeader(Stream* stream) {
-  StandardDexFile::Header header;
+  StandardDexFile::HeaderV41 header{};
   if (CompactDexFile::IsMagicValid(header_->Magic())) {
-    StandardDexFile::WriteMagic(header.magic_);
+    StandardDexFile::WriteMagic(header.magic_.data());
     if (header_->SupportDefaultMethods()) {
-      StandardDexFile::WriteCurrentVersion(header.magic_);
+      StandardDexFile::WriteCurrentVersion(header.magic_.data());
     } else {
-      StandardDexFile::WriteVersionBeforeDefaultMethods(header.magic_);
+      StandardDexFile::WriteVersionBeforeDefaultMethods(header.magic_.data());
     }
   } else {
     // Standard dex -> standard dex, just reuse the same header.
-    static constexpr size_t kMagicAndVersionLen =
-        StandardDexFile::kDexMagicSize + StandardDexFile::kDexVersionLen;
-    std::copy_n(header_->Magic(), kMagicAndVersionLen, header.magic_);
+    header.magic_ = header_->Magic();
   }
   header.checksum_ = header_->Checksum();
-  std::copy_n(header_->Signature(), DexFile::kSha1DigestSize, header.signature_);
+  header.signature_ = header_->Signature();
   header.file_size_ = header_->FileSize();
   header.header_size_ = GetHeaderSize();
   header.endian_tag_ = header_->EndianTag();
@@ -825,15 +823,17 @@
   header.class_defs_off_ = header_->ClassDefs().GetOffset();
   header.data_size_ = header_->DataSize();
   header.data_off_ = header_->DataOffset();
+  header.SetDexContainer(0, header_->FileSize());
 
-  CHECK_EQ(sizeof(header), GetHeaderSize());
-  static_assert(sizeof(header) == 0x70, "Size doesn't match dex spec");
+  static_assert(sizeof(header) == 0x78, "Size doesn't match dex spec");
   stream->Seek(0);
-  stream->Overwrite(reinterpret_cast<uint8_t*>(&header), sizeof(header));
+  stream->Overwrite(reinterpret_cast<uint8_t*>(&header), GetHeaderSize());
 }
 
 size_t DexWriter::GetHeaderSize() const {
-  return sizeof(StandardDexFile::Header);
+  return header_->Magic() == DexFile::Magic{'d', 'e', 'x', '\n', '0', '4', '1', '\0'} ?
+             sizeof(StandardDexFile::HeaderV41) :
+             sizeof(StandardDexFile::Header);
 }
 
 bool DexWriter::Write(DexContainer* output, std::string* error_msg) {
diff --git a/dexlayout/dexdiag.cc b/dexlayout/dexdiag.cc
index 9aa0353..2821374 100644
--- a/dexlayout/dexdiag.cc
+++ b/dexlayout/dexdiag.cc
@@ -186,7 +186,7 @@
 static uint16_t FindSectionTypeForPage(size_t page,
                                        const std::vector<dex_ir::DexFileSection>& sections) {
   for (const auto& section : sections) {
-    size_t first_page_of_section = section.offset / kPageSize;
+    size_t first_page_of_section = section.offset / MemMap::GetPageSize();
     // Only consider non-empty sections.
     if (section.size == 0) {
       continue;
@@ -287,14 +287,15 @@
               << std::endl;
     return;
   }
-  uint64_t start_page = (dex_file_start - vdex_start) / kPageSize;
-  uint64_t start_address = start_page * kPageSize;
-  uint64_t end_page = RoundUp(start_address + dex_file_size, kPageSize) / kPageSize;
+  uint64_t start_page = (dex_file_start - vdex_start) / MemMap::GetPageSize();
+  uint64_t start_address = start_page * MemMap::GetPageSize();
+  uint64_t end_page = RoundUp(start_address + dex_file_size,
+                              MemMap::GetPageSize()) / MemMap::GetPageSize();
   std::cout << "DEX "
             << dex_file->GetLocation().c_str()
             << StringPrintf(": %" PRIx64 "-%" PRIx64,
-                            map_start + start_page * kPageSize,
-                            map_start + end_page * kPageSize)
+                            map_start + start_page * MemMap::GetPageSize(),
+                            map_start + end_page * MemMap::GetPageSize())
             << std::endl;
   // Build a list of the dex file section types, sorted from highest offset to lowest.
   std::vector<dex_ir::DexFileSection> sections;
diff --git a/dexlayout/dexdiag_test.cc b/dexlayout/dexdiag_test.cc
index 3cd80b4..cdea3bc 100644
--- a/dexlayout/dexdiag_test.cc
+++ b/dexlayout/dexdiag_test.cc
@@ -21,7 +21,7 @@
 #include "base/file_utils.h"
 #include "base/os.h"
 #include "exec_utils.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 
 namespace art {
 
diff --git a/dexlayout/dexlayout.cc b/dexlayout/dexlayout.cc
index 9152c18..d674fd2 100644
--- a/dexlayout/dexlayout.cc
+++ b/dexlayout/dexlayout.cc
@@ -654,7 +654,7 @@
 void DexLayout::DumpFileHeader() {
   char sanitized[8 * 2 + 1];
   fprintf(out_file_, "DEX file header:\n");
-  Asciify(sanitized, header_->Magic(), 8);
+  Asciify(sanitized, header_->Magic().data(), header_->Magic().size());
   fprintf(out_file_, "magic               : '%s'\n", sanitized);
   fprintf(out_file_, "checksum            : %08x\n", header_->Checksum());
   fprintf(out_file_, "signature           : %02x%02x...%02x%02x\n",
@@ -2197,9 +2197,19 @@
                                                                GetOptions()));
   SetHeader(header.get());
 
+  // Dexlayout does not support containers, but allow it if it has just single dex file.
+  const DexFile::Header& hdr = dex_file->GetHeader();
+  if (hdr.HeaderOffset() != 0u || hdr.ContainerSize() != hdr.file_size_) {
+    *error_msg = "DEX containers are not supported in dexlayout";
+    DCHECK(false) << *error_msg;
+    return false;
+  }
+
   if (options_.verbose_) {
-    fprintf(out_file_, "Opened '%s', DEX version '%.3s'\n",
-            file_name, dex_file->GetHeader().magic_ + 4);
+    fprintf(out_file_,
+            "Opened '%s', DEX version '%.3s'\n",
+            file_name,
+            dex_file->GetHeader().magic_.data() + 4);
   }
 
   if (options_.visualize_pattern_) {
@@ -2208,7 +2218,7 @@
   }
 
   if (options_.show_section_statistics_) {
-    ShowDexSectionStatistics(header_, dex_file_index);
+    ShowDexSectionStatistics(header_, dex_file_index, page_size_);
     return true;
   }
 
diff --git a/dexlayout/dexlayout.h b/dexlayout/dexlayout.h
index c6f76e5..4238307 100644
--- a/dexlayout/dexlayout.h
+++ b/dexlayout/dexlayout.h
@@ -29,6 +29,7 @@
 #include <set>
 #include <unordered_map>
 
+#include "base/mem_map.h"
 #include "dex/compact_dex_level.h"
 #include "dex_container.h"
 #include "dex/dex_file_layout.h"
@@ -111,7 +112,8 @@
       : options_(options),
         info_(info),
         out_file_(out_file),
-        header_(header) { }
+        header_(header),
+        page_size_(MemMap::GetPageSize()) { }
 
   int ProcessFile(const char* file_name);
   bool ProcessDexFile(const char* file_name,
@@ -194,6 +196,7 @@
   ProfileCompilationInfo* info_;
   FILE* out_file_;
   dex_ir::Header* header_;
+  const size_t page_size_;
   DexLayoutSections dex_sections_;
   // Layout hotness information is only calculated when dexlayout is enabled.
   DexLayoutHotnessInfo layout_hotness_info_;
diff --git a/dexlayout/dexlayout_test.cc b/dexlayout/dexlayout_test.cc
index 4e4811f..97c19ee 100644
--- a/dexlayout/dexlayout_test.cc
+++ b/dexlayout/dexlayout_test.cc
@@ -746,6 +746,7 @@
     header.link_off_ = header.file_size_;
     header.link_size_ = 16 * KB;
     header.file_size_ += header.link_size_;
+    header.SetDexContainer(0, header.file_size_);
     file_size = header.file_size_;
   });
   TEMP_FAILURE_RETRY(temp_dex.GetFile()->SetLength(file_size));
diff --git a/dexlist/dexlist.cc b/dexlist/dexlist.cc
index 3603675..553e364 100644
--- a/dexlist/dexlist.cc
+++ b/dexlist/dexlist.cc
@@ -84,8 +84,11 @@
  * Dumps a method.
  */
 static void dumpMethod(const DexFile* pDexFile,
-                       const char* fileName, u4 idx, u4 flags ATTRIBUTE_UNUSED,
-                       const dex::CodeItem* pCode, u4 codeOffset) {
+                       const char* fileName,
+                       u4 idx,
+                       [[maybe_unused]] u4 flags,
+                       const dex::CodeItem* pCode,
+                       u4 codeOffset) {
   // Abstract and native methods don't get listed.
   if (pCode == nullptr || codeOffset == 0) {
     return;
diff --git a/dexopt_chroot_setup/Android.bp b/dexopt_chroot_setup/Android.bp
new file mode 100644
index 0000000..93e012a
--- /dev/null
+++ b/dexopt_chroot_setup/Android.bp
@@ -0,0 +1,111 @@
+//
+// Copyright (C) 2024 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+cc_defaults {
+    name: "dexopt_chroot_setup_defaults",
+    defaults: ["art_defaults"],
+    srcs: [
+        "dexopt_chroot_setup.cc",
+    ],
+    shared_libs: [
+        "libbase",
+        "libbinder_ndk",
+    ],
+    static_libs: [
+        "dexopt_chroot_setup-aidl-ndk",
+    ],
+}
+
+art_cc_binary {
+    name: "dexopt_chroot_setup",
+    defaults: ["dexopt_chroot_setup_defaults"],
+    srcs: [
+        "dexopt_chroot_setup_main.cc",
+    ],
+    shared_libs: [
+        "libart",
+        "libartbase",
+    ],
+    apex_available: [
+        "com.android.art",
+        "com.android.art.debug",
+    ],
+}
+
+art_cc_defaults {
+    name: "art_dexopt_chroot_setup_tests_defaults",
+    defaults: ["dexopt_chroot_setup_defaults"],
+    static_libs: [
+        "libgmock",
+    ],
+    srcs: [
+        "dexopt_chroot_setup_test.cc",
+    ],
+}
+
+// Version of ART gtest `art_dexopt_chroot_setup_tests` bundled with the ART
+// APEX on target.
+//
+// This test requires the full libbinder_ndk implementation on host, which is
+// not available as a prebuilt on the thin master-art branch. Hence it won't
+// work there, and there's a conditional in Android.gtest.mk to exclude it from
+// test-art-host-gtest.
+art_cc_test {
+    name: "art_dexopt_chroot_setup_tests",
+    defaults: [
+        "art_gtest_defaults",
+        "art_dexopt_chroot_setup_tests_defaults",
+    ],
+}
+
+// Standalone version of ART gtest `art_dexopt_chroot_setup_tests`, not bundled
+// with the ART APEX on target.
+art_cc_test {
+    name: "art_standalone_dexopt_chroot_setup_tests",
+    defaults: [
+        "art_standalone_gtest_defaults",
+        "art_dexopt_chroot_setup_tests_defaults",
+    ],
+}
+
+cc_fuzz {
+    name: "dexopt_chroot_setup_fuzzer",
+    defaults: [
+        "service_fuzzer_defaults",
+        "art_module_source_build_defaults",
+        "dexopt_chroot_setup_defaults",
+    ],
+    host_supported: true,
+    srcs: ["dexopt_chroot_setup_fuzzer.cc"],
+    shared_libs: [
+        "libart",
+        "libartbase",
+        "liblog",
+    ],
+    fuzz_config: {
+        cc: [
+            "art-module-team@google.com",
+        ],
+    },
+}
diff --git a/dexopt_chroot_setup/README.md b/dexopt_chroot_setup/README.md
new file mode 100644
index 0000000..7140124
--- /dev/null
+++ b/dexopt_chroot_setup/README.md
@@ -0,0 +1,10 @@
+## dexopt_chroot_setup
+
+dexopt_chroot_setup is a component of ART Service. It sets up the chroot
+environment for Pre-reboot Dexopt, to dexopt apps on a best-effort basis before
+the reboot after a Mainline update or an OTA update is downloaded, to support
+seamless updates.
+
+It requires elevated permissions that are not available to system_server, such
+as mounting filesystems. It publishes a binder interface that is internal to ART
+Service's Java code.
diff --git a/dexopt_chroot_setup/binder/Android.bp b/dexopt_chroot_setup/binder/Android.bp
new file mode 100644
index 0000000..629a783
--- /dev/null
+++ b/dexopt_chroot_setup/binder/Android.bp
@@ -0,0 +1,56 @@
+//
+// Copyright (C) 2024 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+aidl_interface {
+    name: "dexopt_chroot_setup-aidl",
+    srcs: [
+        "com/android/server/art/*.aidl",
+    ],
+    host_supported: true,
+    backend: {
+        java: {
+            enabled: true,
+            apex_available: [
+                "com.android.art",
+                "com.android.art.debug",
+            ],
+        },
+        cpp: {
+            enabled: false,
+        },
+        ndk: {
+            enabled: true,
+            apex_available: [
+                "com.android.art",
+                "com.android.art.debug",
+            ],
+        },
+    },
+    unstable: true,
+    visibility: [
+        "//system/tools/aidl/build",
+        "//art:__subpackages__",
+    ],
+    min_sdk_version: "31",
+}
diff --git a/dexopt_chroot_setup/binder/com/android/server/art/IDexoptChrootSetup.aidl b/dexopt_chroot_setup/binder/com/android/server/art/IDexoptChrootSetup.aidl
new file mode 100644
index 0000000..f38fcea
--- /dev/null
+++ b/dexopt_chroot_setup/binder/com/android/server/art/IDexoptChrootSetup.aidl
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.art;
+
+/** @hide */
+interface IDexoptChrootSetup {
+}
diff --git a/dexopt_chroot_setup/dexopt_chroot_setup.cc b/dexopt_chroot_setup/dexopt_chroot_setup.cc
new file mode 100644
index 0000000..c9a1c73
--- /dev/null
+++ b/dexopt_chroot_setup/dexopt_chroot_setup.cc
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "dexopt_chroot_setup.h"
+
+#include "aidl/com/android/server/art/BnDexoptChrootSetup.h"
+#include "android-base/errors.h"
+#include "android-base/result.h"
+#include "android/binder_auto_utils.h"
+#include "android/binder_manager.h"
+#include "android/binder_process.h"
+
+namespace art {
+namespace dexopt_chroot_setup {
+
+namespace {
+
+using ::android::base::Error;
+using ::android::base::Result;
+using ::ndk::ScopedAStatus;
+
+constexpr const char* kServiceName = "dexopt_chroot_setup";
+
+}  // namespace
+
+Result<void> DexoptChrootSetup::Start() {
+  ScopedAStatus status = ScopedAStatus::fromStatus(
+      AServiceManager_registerLazyService(this->asBinder().get(), kServiceName));
+  if (!status.isOk()) {
+    return Error() << status.getDescription();
+  }
+
+  ABinderProcess_startThreadPool();
+
+  return {};
+}
+
+}  // namespace dexopt_chroot_setup
+}  // namespace art
diff --git a/dexopt_chroot_setup/dexopt_chroot_setup.h b/dexopt_chroot_setup/dexopt_chroot_setup.h
new file mode 100644
index 0000000..858c717
--- /dev/null
+++ b/dexopt_chroot_setup/dexopt_chroot_setup.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_DEXOPT_CHROOT_SETUP_DEXOPT_CHROOT_SETUP_H_
+#define ART_DEXOPT_CHROOT_SETUP_DEXOPT_CHROOT_SETUP_H_
+
+#include "aidl/com/android/server/art/BnDexoptChrootSetup.h"
+#include "android-base/result.h"
+
+namespace art {
+namespace dexopt_chroot_setup {
+
+// A service that sets up the chroot environment for Pre-reboot Dexopt.
+class DexoptChrootSetup : public aidl::com::android::server::art::BnDexoptChrootSetup {
+ public:
+  android::base::Result<void> Start();
+};
+
+}  // namespace dexopt_chroot_setup
+}  // namespace art
+
+#endif  // ART_DEXOPT_CHROOT_SETUP_DEXOPT_CHROOT_SETUP_H_
diff --git a/dexopt_chroot_setup/dexopt_chroot_setup_fuzzer.cc b/dexopt_chroot_setup/dexopt_chroot_setup_fuzzer.cc
new file mode 100644
index 0000000..fe3663e
--- /dev/null
+++ b/dexopt_chroot_setup/dexopt_chroot_setup_fuzzer.cc
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "dexopt_chroot_setup.h"
+#include "fuzzbinder/libbinder_ndk_driver.h"
+#include "fuzzer/FuzzedDataProvider.h"
+
+using ::android::fuzzService;
+using ::art::dexopt_chroot_setup::DexoptChrootSetup;
+using ::ndk::SharedRefBase;
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  auto dexopt_chroot_setup = SharedRefBase::make<DexoptChrootSetup>();
+
+  fuzzService(dexopt_chroot_setup->asBinder().get(), FuzzedDataProvider(data, size));
+
+  return 0;
+}
diff --git a/dexopt_chroot_setup/dexopt_chroot_setup_main.cc b/dexopt_chroot_setup/dexopt_chroot_setup_main.cc
new file mode 100644
index 0000000..5e74783
--- /dev/null
+++ b/dexopt_chroot_setup/dexopt_chroot_setup_main.cc
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdlib.h>
+
+#include "android-base/logging.h"
+#include "android-base/macros.h"
+#include "android/binder_interface_utils.h"
+#include "android/binder_process.h"
+#include "dexopt_chroot_setup.h"
+
+int main([[maybe_unused]] int argc, char* argv[]) {
+  android::base::InitLogging(argv);
+
+  auto dexopt_chroot_setup =
+      ndk::SharedRefBase::make<art::dexopt_chroot_setup::DexoptChrootSetup>();
+
+  LOG(INFO) << "Starting dexopt_chroot_setup";
+
+  if (android::base::Result<void> ret = dexopt_chroot_setup->Start(); !ret.ok()) {
+    LOG(ERROR) << "Unable to start dexopt_chroot_setup: " << ret.error();
+    exit(1);
+  }
+
+  ABinderProcess_joinThreadPool();
+
+  LOG(INFO) << "dexopt_chroot_setup shutting down";
+
+  return 0;
+}
diff --git a/dexopt_chroot_setup/dexopt_chroot_setup_test.cc b/dexopt_chroot_setup/dexopt_chroot_setup_test.cc
new file mode 100644
index 0000000..ba42fc5
--- /dev/null
+++ b/dexopt_chroot_setup/dexopt_chroot_setup_test.cc
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "dexopt_chroot_setup.h"
+
+#include "base/common_art_test.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+namespace art {
+namespace dexopt_chroot_setup {
+namespace {
+
+class DexoptChrootSetupTest : public CommonArtTest {
+ protected:
+  void SetUp() override {
+    CommonArtTest::SetUp();
+    dexopt_chroot_setup_ = ndk::SharedRefBase::make<DexoptChrootSetup>();
+  }
+
+  std::shared_ptr<DexoptChrootSetup> dexopt_chroot_setup_;
+};
+
+TEST_F(DexoptChrootSetupTest, HelloWorld) { EXPECT_NE(dexopt_chroot_setup_, nullptr); }
+
+}  // namespace
+}  // namespace dexopt_chroot_setup
+}  // namespace art
diff --git a/dexoptanalyzer/Android.bp b/dexoptanalyzer/Android.bp
index 82f0c1a..43953da 100644
--- a/dexoptanalyzer/Android.bp
+++ b/dexoptanalyzer/Android.bp
@@ -83,12 +83,8 @@
 
 art_cc_defaults {
     name: "art_dexoptanalyzer_tests_defaults",
-    static_libs: [
-        "libziparchive",
-    ],
     shared_libs: [
         "libunwindstack",
-        "libz", // libziparchive dependency; must be repeated here since it's a static lib.
     ],
     data: [
         ":art-gtest-jars-LinkageTest",
diff --git a/dexoptanalyzer/art_standalone_dexoptanalyzer_tests.xml b/dexoptanalyzer/art_standalone_dexoptanalyzer_tests.xml
index ca10751..07e5ed6 100644
--- a/dexoptanalyzer/art_standalone_dexoptanalyzer_tests.xml
+++ b/dexoptanalyzer/art_standalone_dexoptanalyzer_tests.xml
@@ -14,6 +14,9 @@
      limitations under the License.
 -->
 <configuration description="Runs art_standalone_dexoptanalyzer_tests (as root).">
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
+
     <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
 
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
@@ -51,8 +54,6 @@
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp/art_standalone_dexoptanalyzer_tests" />
         <option name="module-name" value="art_standalone_dexoptanalyzer_tests" />
-        <option name="ld-library-path-32" value="/apex/com.android.art/lib" />
-        <option name="ld-library-path-64" value="/apex/com.android.art/lib64" />
     </test>
 
     <!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
diff --git a/dexoptanalyzer/dexoptanalyzer.cc b/dexoptanalyzer/dexoptanalyzer.cc
index b182f68..2887dc9 100644
--- a/dexoptanalyzer/dexoptanalyzer.cc
+++ b/dexoptanalyzer/dexoptanalyzer.cc
@@ -35,8 +35,8 @@
 #include "gc/heap.h"
 #include "gc/space/image_space.h"
 #include "noop_compiler_callbacks.h"
-#include "oat.h"
-#include "oat_file_assistant.h"
+#include "oat/oat.h"
+#include "oat/oat_file_assistant.h"
 #include "runtime.h"
 #include "thread-inl.h"
 #include "vdex_file.h"
diff --git a/disassembler/Android.bp b/disassembler/Android.bp
index b7f758f..511292d 100644
--- a/disassembler/Android.bp
+++ b/disassembler/Android.bp
@@ -37,6 +37,9 @@
         arm64: {
             srcs: ["disassembler_arm64.cc"],
         },
+        riscv64: {
+            srcs: ["disassembler_riscv64.cc"],
+        },
         x86: {
             srcs: ["disassembler_x86.cc"],
         },
diff --git a/disassembler/disassembler.cc b/disassembler/disassembler.cc
index a05183a..062892e 100644
--- a/disassembler/disassembler.cc
+++ b/disassembler/disassembler.cc
@@ -29,6 +29,10 @@
 # include "disassembler_arm64.h"
 #endif
 
+#ifdef ART_ENABLE_CODEGEN_riscv64
+# include "disassembler_riscv64.h"
+#endif
+
 #if defined(ART_ENABLE_CODEGEN_x86) || defined(ART_ENABLE_CODEGEN_x86_64)
 # include "disassembler_x86.h"
 #endif
@@ -53,6 +57,10 @@
     case InstructionSet::kArm64:
       return new arm64::DisassemblerArm64(options);
 #endif
+#ifdef ART_ENABLE_CODEGEN_riscv64
+    case InstructionSet::kRiscv64:
+      return new riscv64::DisassemblerRiscv64(options);
+#endif
 #ifdef ART_ENABLE_CODEGEN_x86
     case InstructionSet::kX86:
       return new x86::DisassemblerX86(options, /* supports_rex= */ false);
diff --git a/disassembler/disassembler_riscv64.cc b/disassembler/disassembler_riscv64.cc
new file mode 100644
index 0000000..09e9faf
--- /dev/null
+++ b/disassembler/disassembler_riscv64.cc
@@ -0,0 +1,2025 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "disassembler_riscv64.h"
+
+#include "android-base/logging.h"
+#include "android-base/stringprintf.h"
+
+#include "base/bit_utils.h"
+#include "base/casts.h"
+
+using android::base::StringPrintf;
+
+namespace art {
+namespace riscv64 {
+
+class DisassemblerRiscv64::Printer {
+ public:
+  Printer(DisassemblerRiscv64* disassembler, std::ostream& os)
+      : disassembler_(disassembler), os_(os) {}
+
+  void Dump32(const uint8_t* insn);
+  void Dump16(const uint8_t* insn);
+  void Dump2Byte(const uint8_t* data);
+  void DumpByte(const uint8_t* data);
+
+ private:
+  // This enumeration should mirror the declarations in runtime/arch/riscv64/registers_riscv64.h.
+  // We do not include that file to avoid a dependency on libart.
+  enum {
+    Zero = 0,
+    RA = 1,
+    FP  = 8,
+    TR  = 9,
+  };
+
+  enum class MemAddressMode : uint32_t {
+    kUnitStride = 0b00,
+    kIndexedUnordered = 0b01,
+    kStrided = 0b10,
+    kIndexedOrdered = 0b11,
+  };
+
+  enum class Nf : uint32_t {
+    k1 = 0b000,
+    k2 = 0b001,
+    k3 = 0b010,
+    k4 = 0b011,
+    k5 = 0b100,
+    k6 = 0b101,
+    k7 = 0b110,
+    k8 = 0b111,
+  };
+
+  enum class VAIEncodings : uint32_t {
+    kOpIVV = 0b000,
+    kOpFVV = 0b001,
+    kOpMVV = 0b010,
+    kOpIVI = 0b011,
+    kOpIVX = 0b100,
+    kOpFVF = 0b101,
+    kOpMVX = 0b110,
+    kOpCFG = 0b111,
+  };
+
+  class ScopedNewLinePrinter {
+    std::ostream& os_;
+
+   public:
+    explicit ScopedNewLinePrinter(std::ostream& os) : os_(os) {}
+    ~ScopedNewLinePrinter() { os_ << '\n'; }
+  };
+
+  static const char* XRegName(uint32_t regno);
+  static const char* FRegName(uint32_t regno);
+  static const char* VRegName(uint32_t regno);
+  static const char* RoundingModeName(uint32_t rm);
+
+  // Regular instruction immediate utils
+
+  static int32_t Decode32Imm12(uint32_t insn32) {
+    uint32_t sign = (insn32 >> 31);
+    uint32_t imm12 = (insn32 >> 20);
+    return static_cast<int32_t>(imm12) - static_cast<int32_t>(sign << 12);  // Sign-extend.
+  }
+
+  static uint32_t Decode32UImm7(uint32_t insn32) { return (insn32 >> 25) & 0x7Fu; }
+
+  static uint32_t Decode32UImm12(uint32_t insn32) { return (insn32 >> 20) & 0xFFFu; }
+
+  static int32_t Decode32StoreOffset(uint32_t insn32) {
+    uint32_t bit11 = insn32 >> 31;
+    uint32_t bits5_11 = insn32 >> 25;
+    uint32_t bits0_4 = (insn32 >> 7) & 0x1fu;
+    uint32_t imm = (bits5_11 << 5) + bits0_4;
+    return static_cast<int32_t>(imm) - static_cast<int32_t>(bit11 << 12);  // Sign-extend.
+  }
+
+  // Compressed instruction immediate utils
+
+  // Extracts the offset from a compressed instruction
+  // where `offset[5:3]` is in bits `[12:10]` and `offset[2|6]` is in bits `[6:5]`
+  static uint32_t Decode16CMOffsetW(uint32_t insn16) {
+    DCHECK(IsUint<16>(insn16));
+    return BitFieldExtract(insn16, 5, 1) << 6 | BitFieldExtract(insn16, 10, 3) << 3 |
+           BitFieldExtract(insn16, 6, 1) << 2;
+  }
+
+  // Extracts the offset from a compressed instruction
+  // where `offset[5:3]` is in bits `[12:10]` and `offset[7:6]` is in bits `[6:5]`
+  static uint32_t Decode16CMOffsetD(uint32_t insn16) {
+    DCHECK(IsUint<16>(insn16));
+    return BitFieldExtract(insn16, 5, 2) << 6 | BitFieldExtract(insn16, 10, 3) << 3;
+  }
+
+  // Re-orders raw immediatate into real value
+  // where `imm[5:3]` is in bits `[5:3]` and `imm[8:6]` is in bits `[2:0]`
+  static uint32_t Uimm6ToOffsetD16(uint32_t uimm6) {
+    DCHECK(IsUint<6>(uimm6));
+    return (BitFieldExtract(uimm6, 3, 3) << 3) | (BitFieldExtract(uimm6, 0, 3) << 6);
+  }
+
+  // Re-orders raw immediatate to form real value
+  // where `imm[5:2]` is in bits `[5:2]` and `imm[7:6]` is in bits `[1:0]`
+  static uint32_t Uimm6ToOffsetW16(uint32_t uimm6) {
+    DCHECK(IsUint<6>(uimm6));
+    return (BitFieldExtract(uimm6, 2, 4) << 2) | (BitFieldExtract(uimm6, 0, 2) << 6);
+  }
+
+  // Re-orders raw immediatate to form real value
+  // where `imm[1]` is in bit `[0]` and `imm[0]` is in bit `[1]`
+  static uint32_t Uimm2ToOffset10(uint32_t uimm2) {
+    DCHECK(IsUint<2>(uimm2));
+    return (uimm2 >> 1) | (uimm2 & 0x1u) << 1;
+  }
+
+  // Re-orders raw immediatate to form real value
+  // where `imm[1]` is in bit `[0]` and `imm[0]` is `0`
+  static uint32_t Uimm2ToOffset1(uint32_t uimm2) {
+    DCHECK(IsUint<2>(uimm2));
+    return (uimm2 & 0x1u) << 1;
+  }
+
+  template <size_t kWidth>
+  static constexpr int32_t SignExtendBits(uint32_t bits) {
+    static_assert(kWidth < BitSizeOf<uint32_t>());
+    const uint32_t sign_bit = (bits >> kWidth) & 1u;
+    return static_cast<int32_t>(bits) - static_cast<int32_t>(sign_bit << kWidth);
+  }
+
+  // Extracts the immediate from a compressed instruction
+  // where `imm[5]` is in bit `[12]` and `imm[4:0]` is in bits `[6:2]`
+  // and performs sign-extension if required
+  template <typename T>
+  static T Decode16Imm6(uint32_t insn16) {
+    DCHECK(IsUint<16>(insn16));
+    static_assert(std::is_integral_v<T>, "T must be integral");
+    const T bits =
+        BitFieldInsert(BitFieldExtract(insn16, 2, 5), BitFieldExtract(insn16, 12, 1), 5, 1);
+    const T checked_bits = dchecked_integral_cast<T>(bits);
+    if (std::is_unsigned_v<T>) {
+      return checked_bits;
+    }
+    return SignExtendBits<6>(checked_bits);
+  }
+
+  // Regular instruction register utils
+
+  static uint32_t GetRd(uint32_t insn32) { return (insn32 >> 7) & 0x1fu; }
+  static uint32_t GetRs1(uint32_t insn32) { return (insn32 >> 15) & 0x1fu; }
+  static uint32_t GetRs2(uint32_t insn32) { return (insn32 >> 20) & 0x1fu; }
+  static uint32_t GetRs3(uint32_t insn32) { return insn32 >> 27; }
+  static uint32_t GetRoundingMode(uint32_t insn32) { return (insn32 >> 12) & 7u; }
+
+  // Compressed instruction register utils
+
+  static uint32_t GetRs1Short16(uint32_t insn16) { return BitFieldExtract(insn16, 7, 3) + 8u; }
+  static uint32_t GetRs2Short16(uint32_t insn16) { return BitFieldExtract(insn16, 2, 3) + 8u; }
+  static uint32_t GetRs1_16(uint32_t insn16) { return BitFieldExtract(insn16, 7, 5); }
+  static uint32_t GetRs2_16(uint32_t insn16) { return BitFieldExtract(insn16, 2, 5); }
+
+  void PrintBranchOffset(int32_t offset);
+  void PrintLoadStoreAddress(uint32_t rs1, int32_t offset);
+
+  void Print32Lui(uint32_t insn32);
+  void Print32Auipc(const uint8_t* insn, uint32_t insn32);
+  void Print32Jal(const uint8_t* insn, uint32_t insn32);
+  void Print32Jalr(const uint8_t* insn, uint32_t insn32);
+  void Print32BCond(const uint8_t* insn, uint32_t insn32);
+  void Print32Load(uint32_t insn32);
+  void Print32Store(uint32_t insn32);
+  void Print32FLoad(uint32_t insn32);
+  void Print32FStore(uint32_t insn32);
+  void Print32BinOpImm(uint32_t insn32);
+  void Print32BinOp(uint32_t insn32);
+  void Print32Atomic(uint32_t insn32);
+  void Print32FpOp(uint32_t insn32);
+  void Print32RVVOp(uint32_t insn32);
+  void Print32FpFma(uint32_t insn32);
+  void Print32Zicsr(uint32_t insn32);
+  void Print32Fence(uint32_t insn32);
+
+  void AppendVType(uint32_t zimm);
+  static const char* DecodeRVVMemMnemonic(const uint32_t insn32,
+                                          bool is_load,
+                                          /*out*/ const char** rs2);
+
+  DisassemblerRiscv64* const disassembler_;
+  std::ostream& os_;
+};
+
+const char* DisassemblerRiscv64::Printer::XRegName(uint32_t regno) {
+  static const char* const kXRegisterNames[] = {
+      "zero",
+      "ra",
+      "sp",
+      "gp",
+      "tp",
+      "t0",
+      "t1",
+      "t2",
+      "fp",  // s0/fp
+      "tr",  // s1/tr - ART thread register
+      "a0",
+      "a1",
+      "a2",
+      "a3",
+      "a4",
+      "a5",
+      "a6",
+      "a7",
+      "s2",
+      "s3",
+      "s4",
+      "s5",
+      "s6",
+      "s7",
+      "s8",
+      "s9",
+      "s10",
+      "s11",
+      "t3",
+      "t4",
+      "t5",
+      "t6",
+  };
+  static_assert(std::size(kXRegisterNames) == 32);
+  DCHECK_LT(regno, 32u);
+  return kXRegisterNames[regno];
+}
+
+const char* DisassemblerRiscv64::Printer::FRegName(uint32_t regno) {
+  static const char* const kFRegisterNames[] = {
+      "ft0",
+      "ft1",
+      "ft2",
+      "ft3",
+      "ft4",
+      "ft5",
+      "ft6",
+      "ft7",
+      "fs0",
+      "fs1",
+      "fa0",
+      "fa1",
+      "fa2",
+      "fa3",
+      "fa4",
+      "fa5",
+      "fa6",
+      "fa7",
+      "fs2",
+      "fs3",
+      "fs4",
+      "fs5",
+      "fs6",
+      "fs7",
+      "fs8",
+      "fs9",
+      "fs10",
+      "fs11",
+      "ft8",
+      "ft9",
+      "ft10",
+      "ft11",
+  };
+  static_assert(std::size(kFRegisterNames) == 32);
+  DCHECK_LT(regno, 32u);
+  return kFRegisterNames[regno];
+}
+
+const char* DisassemblerRiscv64::Printer::VRegName(uint32_t regno) {
+  static const char* const kVRegisterNames[] = {
+      "V0",
+      "V1",
+      "V2",
+      "V3",
+      "V4",
+      "V5",
+      "V6",
+      "V7",
+      "V8",
+      "V9",
+      "V10",
+      "V11",
+      "V12",
+      "V13",
+      "V14",
+      "V15",
+      "V16",
+      "V17",
+      "V18",
+      "V19",
+      "V20",
+      "V21",
+      "V22",
+      "V23",
+      "V24",
+      "V25",
+      "V26",
+      "V27",
+      "V28",
+      "V29",
+      "V30",
+      "V31",
+  };
+  static_assert(std::size(kVRegisterNames) == 32);
+  DCHECK_LT(regno, 32u);
+  return kVRegisterNames[regno];
+}
+
+const char* DisassemblerRiscv64::Printer::RoundingModeName(uint32_t rm) {
+  // Note: We do not print the rounding mode for DYN.
+  static const char* const kRoundingModeNames[] = {
+      ".rne", ".rtz", ".rdn", ".rup", ".rmm", ".<reserved-rm>", ".<reserved-rm>", /*DYN*/ ""
+  };
+  static_assert(std::size(kRoundingModeNames) == 8);
+  DCHECK_LT(rm, 8u);
+  return kRoundingModeNames[rm];
+}
+
+void DisassemblerRiscv64::Printer::PrintBranchOffset(int32_t offset) {
+  os_ << (offset >= 0 ? "+" : "") << offset;
+}
+
+void DisassemblerRiscv64::Printer::PrintLoadStoreAddress(uint32_t rs1, int32_t offset) {
+  if (offset != 0) {
+    os_ << StringPrintf("%d", offset);
+  }
+  os_ << "(" << XRegName(rs1) << ")";
+
+  if (rs1 == TR && offset >= 0) {
+    // Add entrypoint name.
+    os_ << " ; ";
+    disassembler_->GetDisassemblerOptions()->thread_offset_name_function_(
+        os_, dchecked_integral_cast<uint32_t>(offset));
+  }
+}
+
+void DisassemblerRiscv64::Printer::Print32Lui(uint32_t insn32) {
+  DCHECK_EQ(insn32 & 0x7fu, 0x37u);
+  // TODO(riscv64): Should we also print the actual sign-extend value?
+  os_ << StringPrintf("lui %s, %u", XRegName(GetRd(insn32)), insn32 >> 12);
+}
+
+void DisassemblerRiscv64::Printer::Print32Auipc([[maybe_unused]] const uint8_t* insn,
+                                                uint32_t insn32) {
+  DCHECK_EQ(insn32 & 0x7fu, 0x17u);
+  // TODO(riscv64): Should we also print the calculated address?
+  os_ << StringPrintf("auipc %s, %u", XRegName(GetRd(insn32)), insn32 >> 12);
+}
+
+void DisassemblerRiscv64::Printer::Print32Jal(const uint8_t* insn, uint32_t insn32) {
+  DCHECK_EQ(insn32 & 0x7fu, 0x6fu);
+  // Print an alias if available.
+  uint32_t rd = GetRd(insn32);
+  os_ << (rd == Zero ? "j " : "jal ");
+  if (rd != Zero && rd != RA) {
+    os_ << XRegName(rd) << ", ";
+  }
+  uint32_t bit20 = (insn32 >> 31);
+  uint32_t bits1_10 = (insn32 >> 21) & 0x3ffu;
+  uint32_t bit11 = (insn32 >> 20) & 1u;
+  uint32_t bits12_19 = (insn32 >> 12) & 0xffu;
+  uint32_t imm = (bits1_10 << 1) + (bit11 << 11) + (bits12_19 << 12) + (bit20 << 20);
+  int32_t offset = static_cast<int32_t>(imm) - static_cast<int32_t>(bit20 << 21);  // Sign-extend.
+  PrintBranchOffset(offset);
+  os_ << " ; " << disassembler_->FormatInstructionPointer(insn + offset);
+
+  // TODO(riscv64): When we implement shared thunks to reduce AOT slow-path code size,
+  // check if this JAL lands at an entrypoint load from TR and, if so, print its name.
+}
+
+void DisassemblerRiscv64::Printer::Print32Jalr([[maybe_unused]] const uint8_t* insn,
+                                               uint32_t insn32) {
+  DCHECK_EQ(insn32 & 0x7fu, 0x67u);
+  DCHECK_EQ((insn32 >> 12) & 7u, 0u);
+  uint32_t rd = GetRd(insn32);
+  uint32_t rs1 = GetRs1(insn32);
+  int32_t imm12 = Decode32Imm12(insn32);
+  // Print shorter macro instruction notation if available.
+  if (rd == Zero && rs1 == RA && imm12 == 0) {
+    os_ << "ret";
+  } else if (rd == Zero && imm12 == 0) {
+    os_ << "jr " << XRegName(rs1);
+  } else if (rd == RA && imm12 == 0) {
+    os_ << "jalr " << XRegName(rs1);
+  } else {
+    // TODO(riscv64): Should we also print the calculated address if the preceding
+    // instruction is AUIPC? (We would need to record the previous instruction.)
+    os_ << "jalr " << XRegName(rd) << ", ";
+    // Use the same format as llvm-objdump: "rs1" if `imm12` is zero, otherwise "imm12(rs1)".
+    if (imm12 == 0) {
+      os_ << XRegName(rs1);
+    } else {
+      os_ << imm12 << "(" << XRegName(rs1) << ")";
+    }
+  }
+}
+
+void DisassemblerRiscv64::Printer::Print32BCond(const uint8_t* insn, uint32_t insn32) {
+  DCHECK_EQ(insn32 & 0x7fu, 0x63u);
+  static const char* const kOpcodes[] = {
+      "beq", "bne", nullptr, nullptr, "blt", "bge", "bltu", "bgeu"
+  };
+  uint32_t funct3 = (insn32 >> 12) & 7u;
+  const char* opcode = kOpcodes[funct3];
+  if (opcode == nullptr) {
+    os_ << "<unknown32>";
+    return;
+  }
+
+  // Print shorter macro instruction notation if available.
+  uint32_t rs1 = GetRs1(insn32);
+  uint32_t rs2 = GetRs2(insn32);
+  if (rs2 == Zero) {
+    os_ << opcode << "z " << XRegName(rs1);
+  } else if (rs1 == Zero && (funct3 == 4u || funct3 == 5u)) {
+    // blt zero, rs2, offset ... bgtz rs2, offset
+    // bge zero, rs2, offset ... blez rs2, offset
+    os_ << (funct3 == 4u ? "bgtz " : "blez ") << XRegName(rs2);
+  } else {
+    os_ << opcode << " " << XRegName(rs1) << ", " << XRegName(rs2);
+  }
+  os_ << ", ";
+
+  uint32_t bit12 = insn32 >> 31;
+  uint32_t bits5_10 = (insn32 >> 25) & 0x3fu;
+  uint32_t bits1_4 = (insn32 >> 8) & 0xfu;
+  uint32_t bit11 = (insn32 >> 7) & 1u;
+  uint32_t imm = (bit12 << 12) + (bit11 << 11) + (bits5_10 << 5) + (bits1_4 << 1);
+  int32_t offset = static_cast<int32_t>(imm) - static_cast<int32_t>(bit12 << 13);  // Sign-extend.
+  PrintBranchOffset(offset);
+  os_ << " ; " << disassembler_->FormatInstructionPointer(insn + offset);
+}
+
+void DisassemblerRiscv64::Printer::Print32Load(uint32_t insn32) {
+  DCHECK_EQ(insn32 & 0x7fu, 0x03u);
+  static const char* const kOpcodes[] = {
+      "lb", "lh", "lw", "ld", "lbu", "lhu", "lwu", nullptr
+  };
+  uint32_t funct3 = (insn32 >> 12) & 7u;
+  const char* opcode = kOpcodes[funct3];
+  if (opcode == nullptr) {
+    os_ << "<unknown32>";
+    return;
+  }
+
+  os_ << opcode << " " << XRegName(GetRd(insn32)) << ", ";
+  PrintLoadStoreAddress(GetRs1(insn32), Decode32Imm12(insn32));
+
+  // TODO(riscv64): If previous instruction is AUIPC for current `rs1` and we load
+  // from the range specified by assembler options, print the loaded literal.
+}
+
+void DisassemblerRiscv64::Printer::Print32Store(uint32_t insn32) {
+  DCHECK_EQ(insn32 & 0x7fu, 0x23u);
+  static const char* const kOpcodes[] = {
+      "sb", "sh", "sw", "sd", nullptr, nullptr, nullptr, nullptr
+  };
+  uint32_t funct3 = (insn32 >> 12) & 7u;
+  const char* opcode = kOpcodes[funct3];
+  if (opcode == nullptr) {
+    os_ << "<unknown32>";
+    return;
+  }
+
+  os_ << opcode << " " << XRegName(GetRs2(insn32)) << ", ";
+  PrintLoadStoreAddress(GetRs1(insn32), Decode32StoreOffset(insn32));
+}
+
+const char* DisassemblerRiscv64::Printer::DecodeRVVMemMnemonic(const uint32_t insn32,
+                                                               bool is_load,
+                                                               /*out*/ const char** rs2) {
+  const uint32_t width_index = (insn32 >> 12) & 3u;
+  DCHECK_EQ(width_index != 0u, (insn32 & 0x4000u) != 0u);
+  const uint32_t imm7 = Decode32UImm7(insn32);
+  const enum Nf nf = static_cast<enum Nf>((imm7 >> 4) & 0x7u);
+  const enum MemAddressMode mop = static_cast<enum MemAddressMode>((imm7 >> 1) & 0x3u);
+  const uint32_t mew = (insn32 >> 28) & 1u;
+
+  if (mew == 1u) {
+    // 7.3. Vector Load/Store Width Encoding
+    // The mew bit (inst[28]) when set is expected to be used to encode
+    // expanded memory sizes of 128 bits and above,
+    // but these encodings are currently reserved.
+    return nullptr;
+  }
+
+  switch (mop) {
+    case MemAddressMode::kUnitStride: {
+      const uint32_t umop = GetRs2(insn32);
+      switch (umop) {
+        case 0b00000:  // Vector Unit-Stride Load/Store
+          static constexpr const char* kVUSMnemonics[8][4] = {
+              {"e8.v", "e16.v", "e32.v", "e64.v"},
+              {"seg2e8.v", "seg2e16.v", "seg2e32.v", "seg2e64.v"},
+              {"seg3e8.v", "seg3e16.v", "seg3e32.v", "seg3e64.v"},
+              {"seg4e8.v", "seg4e16.v", "seg4e32.v", "seg4e64.v"},
+              {"seg5e8.v", "seg5e16.v", "seg5e32.v", "seg5e64.v"},
+              {"seg6e8.v", "seg6e16.v", "seg6e32.v", "seg6e64.v"},
+              {"seg7e8.v", "seg7e16.v", "seg7e32.v", "seg7e64.v"},
+              {"seg8e8.v", "seg8e16.v", "seg8e32.v", "seg8e64.v"},
+          };
+          return kVUSMnemonics[enum_cast<uint32_t>(nf)][width_index];
+        case 0b01000: {  // Vector Whole Register Load/Store
+          if (is_load) {
+            static constexpr const char* kVWRLMnemonics[8][4] = {
+                {"1re8.v", "1re16.v", "1re32.v", "1re64.v"},
+                {"2re8.v", "2re16.v", "2re32.v", "2re64.v"},
+                {nullptr, nullptr, nullptr, nullptr},
+                {"4re8.v", "4re16.v", "4re32.v", "4re64.v"},
+                {nullptr, nullptr, nullptr, nullptr},
+                {nullptr, nullptr, nullptr, nullptr},
+                {nullptr, nullptr, nullptr, nullptr},
+                {"8re8.v", "8re16.v", "8re32.v", "8re64.v"},
+            };
+            return kVWRLMnemonics[enum_cast<uint32_t>(nf)][width_index];
+          } else {
+            if (width_index != 0) {
+              return nullptr;
+            }
+            static constexpr const char* kVWRSMnemonics[8] = {
+                "1r", "2r", nullptr, "4r", nullptr, nullptr, nullptr, "8r"
+            };
+            return kVWRSMnemonics[enum_cast<uint32_t>(nf)];
+          }
+        }
+        case 0b01011:  // Vector Unit-Stride Mask Load/Store
+          if (nf == Nf::k1 && width_index == 0 && (imm7 & 1u) == 1u) {
+            return "m.v";
+          } else {
+            return nullptr;
+          }
+        case 0b10000:  // Vector Unit-Stride Fault-Only-First Load
+          static constexpr const char* kVUSFFLMnemonics[8][4] = {
+              {"e8ff.v", "e16ff.v", "e32ff.v", "e64ff.v"},
+              {"seg2e8ff.v", "seg2e16ff.v", "seg2e32ff.v", "seg2e64ff.v"},
+              {"seg3e8ff.v", "seg3e16ff.v", "seg3e32ff.v", "seg3e64ff.v"},
+              {"seg4e8ff.v", "seg4e16ff.v", "seg4e32ff.v", "seg4e64ff.v"},
+              {"seg5e8ff.v", "seg5e16ff.v", "seg5e32ff.v", "seg5e64ff.v"},
+              {"seg6e8ff.v", "seg6e16ff.v", "seg6e32ff.v", "seg6e64ff.v"},
+              {"seg7e8ff.v", "seg7e16ff.v", "seg7e32ff.v", "seg7e64ff.v"},
+              {"seg8e8ff.v", "seg8e16ff.v", "seg8e32ff.v", "seg8e64ff.v"},
+          };
+          return is_load ? kVUSFFLMnemonics[enum_cast<uint32_t>(nf)][width_index] : nullptr;
+        default:  // Unknown
+          return nullptr;
+      }
+    }
+    case MemAddressMode::kIndexedUnordered: {
+      static constexpr const char* kVIUMnemonics[8][4] = {
+          {"uxei8.v", "uxei16.v", "uxei32.v", "uxei64.v"},
+          {"uxseg2ei8.v", "uxseg2ei16.v", "uxseg2ei32.v", "uxseg2ei64.v"},
+          {"uxseg3ei8.v", "uxseg3ei16.v", "uxseg3ei32.v", "uxseg3ei64.v"},
+          {"uxseg4ei8.v", "uxseg4ei16.v", "uxseg4ei32.v", "uxseg4ei64.v"},
+          {"uxseg5ei8.v", "uxseg5ei16.v", "uxseg5ei32.v", "uxseg5ei64.v"},
+          {"uxseg6ei8.v", "uxseg6ei16.v", "uxseg6ei32.v", "uxseg6ei64.v"},
+          {"uxseg7ei8.v", "uxseg7ei16.v", "uxseg7ei32.v", "uxseg7ei64.v"},
+          {"uxseg8ei8.v", "uxseg8ei16.v", "uxseg8ei32.v", "uxseg8ei64.v"},
+      };
+      *rs2 = VRegName(GetRs2(insn32));
+      return kVIUMnemonics[enum_cast<uint32_t>(nf)][width_index];
+    }
+    case MemAddressMode::kStrided: {
+      static constexpr const char* kVSMnemonics[8][4] = {
+          {"se8.v", "se16.v", "se32.v", "se64.v"},
+          {"sseg2e8.v", "sseg2e16.v", "sseg2e32.v", "sseg2e64.v"},
+          {"sseg3e8.v", "sseg3e16.v", "sseg3e32.v", "sseg3e64.v"},
+          {"sseg4e8.v", "sseg4e16.v", "sseg4e32.v", "sseg4e64.v"},
+          {"sseg5e8.v", "sseg5e16.v", "sseg5e32.v", "sseg5e64.v"},
+          {"sseg6e8.v", "sseg6e16.v", "sseg6e32.v", "sseg6e64.v"},
+          {"sseg7e8.v", "sseg7e16.v", "sseg7e32.v", "sseg7e64.v"},
+          {"sseg8e8.v", "sseg8e16.v", "sseg8e32.v", "sseg8e64.v"},
+      };
+      *rs2 = XRegName(GetRs2(insn32));
+      return kVSMnemonics[enum_cast<uint32_t>(nf)][width_index];
+    }
+    case MemAddressMode::kIndexedOrdered: {
+      static constexpr const char* kVIOMnemonics[8][4] = {
+          {"oxei8.v", "oxei16.v", "oxei32.v", "oxei64.v"},
+          {"oxseg2ei8.v", "oxseg2ei16.v", "oxseg2ei32.v", "oxseg2ei64.v"},
+          {"oxseg3ei8.v", "oxseg3ei16.v", "oxseg3ei32.v", "oxseg3ei64.v"},
+          {"oxseg4ei8.v", "oxseg4ei16.v", "oxseg4ei32.v", "oxseg4ei64.v"},
+          {"oxseg5ei8.v", "oxseg5ei16.v", "oxseg5ei32.v", "oxseg5ei64.v"},
+          {"oxseg6ei8.v", "oxseg6ei16.v", "oxseg6ei32.v", "oxseg6ei64.v"},
+          {"oxseg7ei8.v", "oxseg7ei16.v", "oxseg7ei32.v", "oxseg7ei64.v"},
+          {"oxseg8ei8.v", "oxseg8ei16.v", "oxseg8ei32.v", "oxseg8ei64.v"},
+      };
+      *rs2 = VRegName(GetRs2(insn32));
+      return kVIOMnemonics[enum_cast<uint32_t>(nf)][width_index];
+    }
+  }
+}
+
+static constexpr const char* kFpMemMnemonics[] = {
+    nullptr, "h", "w", "d", "q", nullptr, nullptr, nullptr
+};
+
+void DisassemblerRiscv64::Printer::Print32FLoad(uint32_t insn32) {
+  DCHECK_EQ(insn32 & 0x7fu, 0x07u);
+  int32_t offset = 0;
+  const char* rd = nullptr;
+  const char* rs2 = nullptr;
+  const char* vm = "";
+  const uint32_t funct3 = (insn32 >> 12) & 7u;
+  const char* mnemonic = kFpMemMnemonics[funct3];
+  const char* prefix = "f";
+  if (mnemonic == nullptr) {
+    // Vector Loads
+    prefix = "v";
+    mnemonic = DecodeRVVMemMnemonic(insn32, /*is_load=*/true, &rs2);
+    rd = VRegName(GetRd(insn32));
+
+    if ((Decode32UImm7(insn32) & 0x1U) == 0) {
+      vm = ", v0.t";
+    }
+  } else {
+    rd = FRegName(GetRd(insn32));
+    offset = Decode32Imm12(insn32);
+  }
+
+  if (mnemonic == nullptr) {
+    os_ << "<unknown32>";
+    return;
+  }
+
+  os_ << prefix << "l" << mnemonic << " " << rd << ", ";
+  PrintLoadStoreAddress(GetRs1(insn32), offset);
+
+  if (rs2) {
+    os_ << ", " << rs2;
+  }
+
+  os_ << vm;
+
+  // TODO(riscv64): If previous instruction is AUIPC for current `rs1` and we load
+  // from the range specified by assembler options, print the loaded literal.
+}
+
+void DisassemblerRiscv64::Printer::Print32FStore(uint32_t insn32) {
+  DCHECK_EQ(insn32 & 0x7fu, 0x27u);
+  uint32_t funct3 = (insn32 >> 12) & 3u;
+  const char* prefix = "f";
+  const char* mnemonic = kFpMemMnemonics[funct3];
+
+  if (mnemonic == nullptr) {
+    // Vector Stores
+    const char* rs2 = nullptr;
+    prefix = "v";
+    mnemonic = DecodeRVVMemMnemonic(insn32, /*is_load=*/false, &rs2);
+
+    if (mnemonic == nullptr) {
+      os_ << "<unknown32>";
+      return;
+    }
+
+    os_ << prefix << "s" << mnemonic << " " << VRegName(GetRd(insn32)) << ", ";
+    PrintLoadStoreAddress(GetRs1(insn32), 0);
+
+    if (rs2) {
+      os_ << ", " << rs2;
+    }
+
+    if ((Decode32UImm7(insn32) & 0x1U) == 0) {
+      os_ << ", v0.t";
+    }
+  } else {
+    os_ << prefix << "s" << mnemonic << " " << FRegName(GetRs2(insn32)) << ", ";
+    PrintLoadStoreAddress(GetRs1(insn32), Decode32StoreOffset(insn32));
+  }
+}
+
+void DisassemblerRiscv64::Printer::Print32BinOpImm(uint32_t insn32) {
+  DCHECK_EQ(insn32 & 0x77u, 0x13u);  // Note: Bit 0x8 selects narrow binop.
+  bool narrow = (insn32 & 0x8u) != 0u;
+  uint32_t funct3 = (insn32 >> 12) & 7u;
+  uint32_t rd = GetRd(insn32);
+  uint32_t rs1 = GetRs1(insn32);
+  int32_t imm = Decode32Imm12(insn32);
+
+  // Print shorter macro instruction notation if available.
+  if (funct3 == /*ADDI*/ 0u && imm == 0u) {
+    if (narrow) {
+      os_ << "sextw " << XRegName(rd) << ", " << XRegName(rs1);
+    } else if (rd == Zero && rs1 == Zero) {
+      os_ << "nop";  // Only canonical nop. Non-Zero `rd == rs1` nops are printed as "mv".
+    } else {
+      os_ << "mv " << XRegName(rd) << ", " << XRegName(rs1);
+    }
+  } else if (!narrow && funct3 == /*XORI*/ 4u && imm == -1) {
+    os_ << "not " << XRegName(rd) << ", " << XRegName(rs1);
+  } else if (!narrow && funct3 == /*ANDI*/ 7u && imm == 0xff) {
+    os_ << "zextb " << XRegName(rd) << ", " << XRegName(rs1);
+  } else if (!narrow && funct3 == /*SLTIU*/ 3u && imm == 1) {
+    os_ << "seqz " << XRegName(rd) << ", " << XRegName(rs1);
+  } else if ((insn32 & 0xfc00707fu) == 0x0800101bu) {
+    os_ << "slli.uw " << XRegName(rd) << ", " << XRegName(rs1) << ", " << (imm & 0x3fu);
+  } else if ((imm ^ 0x600u) < 3u && funct3 == 1u) {
+    static const char* const kBitOpcodes[] = { "clz", "ctz", "cpop" };
+    os_ << kBitOpcodes[imm ^ 0x600u] << (narrow ? "w " : " ")
+        << XRegName(rd) << ", " << XRegName(rs1);
+  } else if ((imm ^ 0x600u) < (narrow ? 32 : 64) && funct3 == 5u) {
+    os_ << "rori" << (narrow ? "w " : " ")
+        << XRegName(rd) << ", " << XRegName(rs1) << ", " << (imm ^ 0x600u);
+  } else if (imm == 0x287u && !narrow && funct3 == 5u) {
+    os_ << "orc.b " << XRegName(rd) << ", " << XRegName(rs1);
+  } else if (imm == 0x6b8u && !narrow && funct3 == 5u) {
+    os_ << "rev8 " << XRegName(rd) << ", " << XRegName(rs1);
+  } else {
+    bool bad_high_bits = false;
+    if (funct3 == /*SLLI*/ 1u || funct3 == /*SRLI/SRAI*/ 5u) {
+      imm &= (narrow ? 0x1fu : 0x3fu);
+      uint32_t high_bits = insn32 & (narrow ? 0xfe000000u : 0xfc000000u);
+      if (high_bits == 0x40000000u && funct3 == /*SRAI*/ 5u) {
+        os_ << "srai";
+      } else {
+        os_ << ((funct3 == /*SRLI*/ 5u) ? "srli" : "slli");
+        bad_high_bits = (high_bits != 0u);
+      }
+    } else if (!narrow || funct3 == /*ADDI*/ 0u) {
+      static const char* const kOpcodes[] = {
+          "addi", nullptr, "slti", "sltiu", "xori", nullptr, "ori", "andi"
+      };
+      DCHECK(kOpcodes[funct3] != nullptr);
+      os_ << kOpcodes[funct3];
+    } else {
+      os_ << "<unknown32>";  // There is no SLTIW/SLTIUW/XORIW/ORIW/ANDIW.
+      return;
+    }
+    os_ << (narrow ? "w " : " ") << XRegName(rd) << ", " << XRegName(rs1) << ", " << imm;
+    if (bad_high_bits) {
+      os_ << " (invalid high bits)";
+    }
+  }
+}
+
+void DisassemblerRiscv64::Printer::Print32BinOp(uint32_t insn32) {
+  DCHECK_EQ(insn32 & 0x77u, 0x33u);  // Note: Bit 0x8 selects narrow binop.
+  bool narrow = (insn32 & 0x8u) != 0u;
+  uint32_t funct3 = (insn32 >> 12) & 7u;
+  uint32_t rd = GetRd(insn32);
+  uint32_t rs1 = GetRs1(insn32);
+  uint32_t rs2 = GetRs2(insn32);
+  uint32_t high_bits = insn32 & 0xfe000000u;
+
+  // Print shorter macro instruction notation if available.
+  if (high_bits == 0x40000000u && funct3 == /*SUB*/ 0u && rs1 == Zero) {
+    os_ << (narrow ? "negw " : "neg ") << XRegName(rd) << ", " << XRegName(rs2);
+  } else if (!narrow && funct3 == /*SLT*/ 2u && rs2 == Zero) {
+    os_ << "sltz " << XRegName(rd) << ", " << XRegName(rs1);
+  } else if (!narrow && funct3 == /*SLT*/ 2u && rs1 == Zero) {
+    os_ << "sgtz " << XRegName(rd) << ", " << XRegName(rs2);
+  } else if (!narrow && funct3 == /*SLTU*/ 3u && rs1 == Zero) {
+    os_ << "snez " << XRegName(rd) << ", " << XRegName(rs2);
+  } else if (narrow && high_bits == 0x08000000u && funct3 == /*ADD.UW*/ 0u && rs2 == Zero) {
+    os_ << "zext.w " << XRegName(rd) << ", " << XRegName(rs1);
+  } else {
+    bool bad_high_bits = false;
+    if (high_bits == 0x40000000u && (funct3 == /*SUB*/ 0u || funct3 == /*SRA*/ 5u)) {
+      os_ << ((funct3 == /*SUB*/ 0u) ? "sub" : "sra");
+    } else if (high_bits == 0x02000000u &&
+               (!narrow || (funct3 == /*MUL*/ 0u || funct3 >= /*DIV/DIVU/REM/REMU*/ 4u))) {
+      static const char* const kOpcodes[] = {
+          "mul", "mulh", "mulhsu", "mulhu", "div", "divu", "rem", "remu"
+      };
+      os_ << kOpcodes[funct3];
+    } else if (high_bits == 0x08000000u && narrow && funct3 == /*ADD.UW*/ 0u) {
+      os_ << "add.u";  // "w" is added below.
+    } else if (high_bits == 0x20000000u && (funct3 & 1u) == 0u && funct3 != 0u) {
+      static const char* const kZbaOpcodes[] = { nullptr, "sh1add", "sh2add", "sh3add" };
+      DCHECK(kZbaOpcodes[funct3 >> 1] != nullptr);
+      os_ << kZbaOpcodes[funct3 >> 1] << (narrow ? ".u" /* "w" is added below. */ : "");
+    } else if (high_bits == 0x40000000u && !narrow && funct3 >= 4u && funct3 != 5u) {
+      static const char* const kZbbNegOpcodes[] = { "xnor", nullptr, "orn", "andn" };
+      DCHECK(kZbbNegOpcodes[funct3 - 4u] != nullptr);
+      os_ << kZbbNegOpcodes[funct3 - 4u];
+    } else if (high_bits == 0x0a000000u && !narrow && funct3 >= 4u) {
+      static const char* const kZbbMinMaxOpcodes[] = { "min", "minu", "max", "maxu" };
+      DCHECK(kZbbMinMaxOpcodes[funct3 - 4u] != nullptr);
+      os_ << kZbbMinMaxOpcodes[funct3 - 4u];
+    } else if (high_bits == 0x60000000u && (funct3 == /*ROL*/ 1u || funct3 == /*ROL*/ 5u)) {
+      os_ << (funct3 == /*ROL*/ 1u ? "rol" : "ror");
+    } else if (!narrow || (funct3 == /*ADD*/ 0u || funct3 == /*SLL*/ 1u || funct3 == /*SRL*/ 5u)) {
+      static const char* const kOpcodes[] = {
+          "add", "sll", "slt", "sltu", "xor", "srl", "or", "and"
+      };
+      os_ << kOpcodes[funct3];
+      bad_high_bits = (high_bits != 0u);
+    } else {
+      DCHECK(narrow);
+      os_ << "<unknown32>";  // Some of the above instructions do not have a narrow version.
+      return;
+    }
+    os_ << (narrow ? "w " : " ") << XRegName(rd) << ", " << XRegName(rs1) << ", " << XRegName(rs2);
+    if (bad_high_bits) {
+      os_ << " (invalid high bits)";
+    }
+  }
+}
+
+void DisassemblerRiscv64::Printer::Print32Atomic(uint32_t insn32) {
+  DCHECK_EQ(insn32 & 0x7fu, 0x2fu);
+  uint32_t funct3 = (insn32 >> 12) & 7u;
+  uint32_t funct5 = (insn32 >> 27);
+  if ((funct3 != 2u && funct3 != 3u) ||  // There are only 32-bit and 64-bit LR/SC/AMO*.
+      (((funct5 & 3u) != 0u) && funct5 >= 4u)) {  // Only multiples of 4, or 1-3.
+    os_ << "<unknown32>";
+    return;
+  }
+  static const char* const kMul4Opcodes[] = {
+      "amoadd", "amoxor", "amoor", "amoand", "amomin", "amomax", "amominu", "amomaxu"
+  };
+  static const char* const kOtherOpcodes[] = {
+      nullptr, "amoswap", "lr", "sc"
+  };
+  const char* opcode = ((funct5 & 3u) == 0u) ? kMul4Opcodes[funct5 >> 2] : kOtherOpcodes[funct5];
+  DCHECK(opcode != nullptr);
+  uint32_t rd = GetRd(insn32);
+  uint32_t rs1 = GetRs1(insn32);
+  uint32_t rs2 = GetRs2(insn32);
+  const char* type = (funct3 == 2u) ? ".w" : ".d";
+  const char* aq = (((insn32 >> 26) & 1u) != 0u) ? ".aq" : "";
+  const char* rl = (((insn32 >> 25) & 1u) != 0u) ? ".rl" : "";
+  os_ << opcode << type << aq << rl << " " << XRegName(rd) << ", " << XRegName(rs1);
+  if (funct5 == /*LR*/ 2u) {
+    if (rs2 != 0u) {
+      os_ << " (bad rs2)";
+    }
+  } else {
+    os_ << ", " << XRegName(rs2);
+  }
+}
+
+void DisassemblerRiscv64::Printer::Print32FpOp(uint32_t insn32) {
+  DCHECK_EQ(insn32 & 0x7fu, 0x53u);
+  uint32_t rd = GetRd(insn32);
+  uint32_t rs1 = GetRs1(insn32);
+  uint32_t rs2 = GetRs2(insn32);  // Sometimes used to to differentiate opcodes.
+  uint32_t rm = GetRoundingMode(insn32);  // Sometimes used to to differentiate opcodes.
+  uint32_t funct7 = insn32 >> 25;
+  const char* type = ((funct7 & 1u) != 0u) ? ".d" : ".s";
+  if ((funct7 & 2u) != 0u) {
+    os_ << "<unknown32>";  // Note: This includes the "H" and "Q" extensions.
+    return;
+  }
+  switch (funct7 >> 2) {
+    case 0u:
+    case 1u:
+    case 2u:
+    case 3u: {
+      static const char* const kOpcodes[] = { "fadd", "fsub", "fmul", "fdiv" };
+      os_ << kOpcodes[funct7 >> 2] << type << RoundingModeName(rm) << " "
+          << FRegName(rd) << ", " << FRegName(rs1) << ", " << FRegName(rs2);
+      return;
+    }
+    case 4u: {  // FSGN*
+      // Print shorter macro instruction notation if available.
+      static const char* const kOpcodes[] = { "fsgnj", "fsgnjn", "fsgnjx" };
+      if (rm < std::size(kOpcodes)) {
+        if (rs1 == rs2) {
+          static const char* const kAltOpcodes[] = { "fmv", "fneg", "fabs" };
+          static_assert(std::size(kOpcodes) == std::size(kAltOpcodes));
+          os_ << kAltOpcodes[rm] << type << " " << FRegName(rd) << ", " << FRegName(rs1);
+        } else {
+          os_ << kOpcodes[rm] << type << " "
+              << FRegName(rd) << ", " << FRegName(rs1) << ", " << FRegName(rs2);
+        }
+        return;
+      }
+      break;
+    }
+    case 5u: {  // FMIN/FMAX
+      static const char* const kOpcodes[] = { "fmin", "fmax" };
+      if (rm < std::size(kOpcodes)) {
+        os_ << kOpcodes[rm] << type << " "
+            << FRegName(rd) << ", " << FRegName(rs1) << ", " << FRegName(rs2);
+        return;
+      }
+      break;
+    }
+    case 0x8u:  // FCVT between FP numbers.
+      if ((rs2 ^ 1u) == (funct7 & 1u)) {
+        os_ << ((rs2 != 0u) ? "fcvt.s.d" : "fcvt.d.s") << RoundingModeName(rm) << " "
+            << FRegName(rd) << ", " << FRegName(rs1);
+      }
+      break;
+    case 0xbu:
+      if (rs2 == 0u) {
+        os_ << "fsqrt" << type << RoundingModeName(rm) << " "
+            << FRegName(rd) << ", " << FRegName(rs1);
+        return;
+      }
+      break;
+    case 0x14u: {  // FLE/FLT/FEQ
+      static const char* const kOpcodes[] = { "fle", "flt", "feq" };
+      if (rm < std::size(kOpcodes)) {
+        os_ << kOpcodes[rm] << type << " "
+            << XRegName(rd) << ", " << FRegName(rs1) << ", " << FRegName(rs2);
+        return;
+      }
+      break;
+    }
+    case 0x18u: {  // FCVT from floating point numbers to integers
+      static const char* const kIntTypes[] = { "w", "wu", "l", "lu" };
+      if (rs2 < std::size(kIntTypes)) {
+        os_ << "fcvt." << kIntTypes[rs2] << type << RoundingModeName(rm) << " "
+            << XRegName(rd) << ", " << FRegName(rs1);
+        return;
+      }
+      break;
+    }
+    case 0x1au: {  // FCVT from integers to floating point numbers
+      static const char* const kIntTypes[] = { "w", "wu", "l", "lu" };
+      if (rs2 < std::size(kIntTypes)) {
+        os_ << "fcvt" << type << "." << kIntTypes[rs2] << RoundingModeName(rm) << " "
+            << FRegName(rd) << ", " << XRegName(rs1);
+        return;
+      }
+      break;
+    }
+    case 0x1cu:  // FMV from FPR to GPR, or FCLASS
+      if (rs2 == 0u && rm == 0u) {
+        os_ << (((funct7 & 1u) != 0u) ? "fmv.x.d " : "fmv.x.w ")
+            << XRegName(rd) << ", " << FRegName(rs1);
+        return;
+      } else if (rs2 == 0u && rm == 1u) {
+        os_ << "fclass" << type << " " << XRegName(rd) << ", " << FRegName(rs1);
+        return;
+      }
+      break;
+    case 0x1eu:  // FMV from GPR to FPR
+      if (rs2 == 0u && rm == 0u) {
+        os_ << (((funct7 & 1u) != 0u) ? "fmv.d.x " : "fmv.w.x ")
+            << FRegName(rd) << ", " << XRegName(rs1);
+        return;
+      }
+      break;
+    default:
+      break;
+  }
+  os_ << "<unknown32>";
+}
+
+void DisassemblerRiscv64::Printer::AppendVType(uint32_t vtype) {
+  const uint32_t lmul_v = vtype & 0x7U;
+  const uint32_t vsew_v = (vtype >> 3) & 0x7U;
+  const uint32_t vta_v = (vtype >> 6) & 0x1U;
+  const uint32_t vma_v = (vtype >> 7) & 0x1U;
+
+  if ((vsew_v & 0x4U) == 0u) {
+    if (lmul_v != 0b100) {
+      static const char* const vsews[] = {"e8", "e16", "e32", "e64"};
+      static const char* const lmuls[] = {
+          "m1", "m2", "m4", "m8", nullptr, "mf8", "mf4", "mf2"
+      };
+
+      const char* vma = vma_v ? "ma" : "mu";
+      const char* vta = vta_v ? "ta" : "tu";
+      const char* vsew = vsews[vsew_v & 0x3u];
+      const char* lmul = lmuls[lmul_v];
+
+      os_ << vsew << ", " << lmul << ", " << vta << ", " << vma;
+      return;
+    }
+  }
+
+  os_ << StringPrintf("0x%08x", vtype) << "\t# incorrect VType literal";
+}
+
+static constexpr uint32_t VWXUNARY0 = 0b010000;
+static constexpr uint32_t VRXUNARY0 = 0b010000;
+static constexpr uint32_t VXUNARY0 = 0b010010;
+static constexpr uint32_t VMUNARY0 = 0b010100;
+
+static constexpr uint32_t VWFUNARY0 = 0b010000;
+static constexpr uint32_t VRFUNARY0 = 0b010000;
+static constexpr uint32_t VFUNARY0 = 0b010010;
+static constexpr uint32_t VFUNARY1 = 0b010011;
+
+static void MaybeSwapOperands(uint32_t funct6,
+                              /*inout*/ const char*& rs1,
+                              /*inout*/ const char*& rs2) {
+  if ((0x28u <= funct6 && funct6 < 0x30u) || funct6 >= 0x3Cu) {
+    std::swap(rs1, rs2);
+  }
+}
+
+void DisassemblerRiscv64::Printer::Print32RVVOp(uint32_t insn32) {
+  // TODO(riscv64): Print pseudo-instruction aliases when applicable.
+  DCHECK_EQ(insn32 & 0x7fu, 0x57u);
+  const enum VAIEncodings vai = static_cast<enum VAIEncodings>((insn32 >> 12) & 7u);
+  const uint32_t funct7 = Decode32UImm7(insn32);
+  const uint32_t funct6 = funct7 >> 1;
+  const bool masked = (funct7 & 1) == 0;
+  const char* vm = masked ? ", v0.t" : "";
+  const char* opcode = nullptr;
+  const char* rd = nullptr;
+  const char* rs1 = nullptr;
+  const char* rs2 = nullptr;
+
+  switch (vai) {
+    case VAIEncodings::kOpIVV: {
+      static constexpr const char* kOPIVVOpcodes[64] = {
+          "vadd.vv",      nullptr,       "vsub.vv",         nullptr,
+          "vminu.vv",     "vmin.vv",     "vmaxu.vv",        "vmax.vv",
+          nullptr,        "vand.vv",     "vor.vv",          "vxor.vv",
+          "vrgather.vv",  nullptr,       "vrgatherei16.vv", nullptr,
+          "vadc.vvm",     "vmadc.vvm",   "vsbc.vvm",        "vmsbc.vvm",
+          nullptr,        nullptr,       nullptr,           "<vmerge/vmv>",
+          "vmseq.vv",     "vmsne.vv",    "vmsltu.vv",       "vmslt.vv",
+          "vmsleu.vv",    "vmsle.vv",    nullptr,           nullptr,
+          "vsaddu.vv",    "vsadd.vv",    "vssubu.vv",       "vssub.vv",
+          nullptr,        "vsll.vv",     nullptr,           "vsmul.vv",
+          "vsrl.vv",      "vsra.vv",     "vssrl.vv",        "vssra.vv",
+          "vnsrl.wv",     "vnsra.wv",    "vnclipu.wv",      "vnclip.wv",
+          "vwredsumu.vs", "vwredsum.vs", nullptr,           nullptr,
+          nullptr,        nullptr,       nullptr,           nullptr,
+          nullptr,        nullptr,       nullptr,           nullptr,
+          nullptr,        nullptr,       nullptr,           nullptr,
+      };
+
+      rs2 = VRegName(GetRs2(insn32));
+      if (funct6 == 0b010111) {
+        // vmerge/vmv
+        if (masked) {
+          opcode = "vmerge.vvm";
+          vm = ", v0";
+        } else if (GetRs2(insn32) == 0) {
+          opcode = "vmv.v.v";
+          rs2 = nullptr;
+        } else {
+          opcode = nullptr;
+        }
+      } else {
+        opcode = kOPIVVOpcodes[funct6];
+      }
+
+      rd = VRegName(GetRd(insn32));
+      rs1 = VRegName(GetRs1(insn32));
+      break;
+    }
+    case VAIEncodings::kOpIVX: {
+      static constexpr const char* kOPIVXOpcodes[64] = {
+          "vadd.vx",     nullptr,     "vsub.vx",     "vrsub.vx",
+          "vminu.vx",    "vmin.vx",   "vmaxu.vx",    "vmax.vx",
+          nullptr,       "vand.vx",   "vor.vx",      "vxor.vx",
+          "vrgather.vx", nullptr,     "vslideup.vx", "vslidedown.vx",
+          "vadc.vxm",    "vmadc.vxm", "vsbc.vxm",    "vmsbc.vxm",
+          nullptr,       nullptr,     nullptr,       "<vmerge/vmv>",
+          "vmseq.vx",    "vmsne.vx",  "vmsltu.vx",   "vmslt.vx",
+          "vmsleu.vx",   "vmsle.vx",  "vmsgtu.vx",   "vmsgt.vx",
+          "vsaddu.vx",   "vsadd.vx",  "vssubu.vx",   "vssub.vx",
+          nullptr,       "vsll.vx",   nullptr,       "vsmul.vx",
+          "vsrl.vx",     "vsra.vx",   "vssrl.vx",    "vssra.vx",
+          "vnsrl.wx",    "vnsra.wx",  "vnclipu.wx",  "vnclip.wx",
+          nullptr,       nullptr,     nullptr,       nullptr,
+          nullptr,       nullptr,     nullptr,       nullptr,
+          nullptr,       nullptr,     nullptr,       nullptr,
+          nullptr,       nullptr,     nullptr,       nullptr,
+      };
+
+      rs2 = VRegName(GetRs2(insn32));
+      if (funct6 == 0b010111) {
+        // vmerge/vmv
+        if (masked) {
+          opcode = "vmerge.vxm";
+          vm = ", v0";
+        } else if (GetRs2(insn32) == 0) {
+          opcode = "vmv.v.x";
+          rs2 = nullptr;
+        } else {
+          opcode = nullptr;
+        }
+      } else {
+        opcode = kOPIVXOpcodes[funct6];
+      }
+
+      rd = VRegName(GetRd(insn32));
+      rs1 = XRegName(GetRs1(insn32));
+      break;
+    }
+    case VAIEncodings::kOpIVI: {
+      static constexpr const char* kOPIVIOpcodes[64] = {
+          "vadd.vi",     nullptr,     nullptr,       "vrsub.vi",
+          nullptr,       nullptr,     nullptr,       nullptr,
+          nullptr,       "vand.vi",   "vor.vi",      "vxor.vi",
+          "vrgather.vi", nullptr,     "vslideup.vi", "vslidedown.vi",
+          "vadc.vim",    "vmadc.vim", nullptr,       nullptr,
+          nullptr,       nullptr,     nullptr,       "<vmerge/vmv>",
+          "vmseq.vi",    "vmsne.vi",  nullptr,       nullptr,
+          "vmsleu.vi",   "vmsle.vi",  "vmsgtu.vi",   "vmsgt.vi",
+          "vsaddu.vi",   "vsadd.vi",  nullptr,       nullptr,
+          nullptr,       "vsll.vi",   nullptr,       "<vmvNr.v>",
+          "vsrl.vi",     "vsra.vi",   "vssrl.vi",    "vssra.vi",
+          "vnsrl.wi",    "vnsra.wi",  "vnclipu.wi",  "vnclip.wi",
+          nullptr,       nullptr,     nullptr,       nullptr,
+          nullptr,       nullptr,     nullptr,       nullptr,
+          nullptr,       nullptr,     nullptr,       nullptr,
+          nullptr,       nullptr,     nullptr,       nullptr,
+      };
+
+      rs2 = VRegName(GetRs2(insn32));
+
+      if (funct6 == 0b010111) {
+        // vmerge/vmv
+        if (masked) {
+          opcode = "vmerge.vim";
+          vm = ", v0";
+        } else if (GetRs2(insn32) == 0) {
+          opcode = "vmv.v.i";
+          rs2 = nullptr;
+        } else {
+          opcode = nullptr;
+        }
+      } else if (funct6 == 0b100111) {
+        uint32_t rs1V = GetRs1(insn32);
+        static constexpr const char* kVmvnrOpcodes[8] = {
+            "vmv1r.v", "vmv2r.v", nullptr, "vmv4r.v",
+            nullptr,   nullptr,   nullptr, "vmv8r.v",
+        };
+        if (IsUint<3>(rs1V)) {
+          opcode = kVmvnrOpcodes[rs1V];
+        }
+      } else {
+        opcode = kOPIVIOpcodes[funct6];
+      }
+
+      rd = VRegName(GetRd(insn32));
+      break;
+    }
+    case VAIEncodings::kOpMVV: {
+      switch (funct6) {
+        case VWXUNARY0: {
+          static constexpr const char* kVWXUNARY0Opcodes[32] = {
+              "vmv.x.s", nullptr,    nullptr, nullptr,
+              nullptr,   nullptr,    nullptr, nullptr,
+              nullptr,   nullptr,    nullptr, nullptr,
+              nullptr,   nullptr,    nullptr, nullptr,
+              "vcpop.m", "vfirst.m", nullptr, nullptr,
+              nullptr,   nullptr,    nullptr, nullptr,
+              nullptr,   nullptr,    nullptr, nullptr,
+              nullptr,   nullptr,    nullptr, nullptr,
+          };
+          opcode = kVWXUNARY0Opcodes[GetRs1(insn32)];
+          rd = XRegName(GetRd(insn32));
+          rs2 = VRegName(GetRs2(insn32));
+          break;
+        }
+        case VXUNARY0: {
+          static constexpr const char* kVXUNARY0Opcodes[32] = {
+              nullptr,     nullptr,     "vzext.vf8", "vsext.vf8",
+              "vzext.vf4", "vsext.vf4", "vzext.vf2", "vsext.vf2",
+              nullptr,     nullptr,     nullptr,     nullptr,
+              nullptr,     nullptr,     nullptr,     nullptr,
+              nullptr,     nullptr,     nullptr,     nullptr,
+              nullptr,     nullptr,     nullptr,     nullptr,
+              nullptr,     nullptr,     nullptr,     nullptr,
+              nullptr,     nullptr,     nullptr,     nullptr,
+          };
+          opcode = kVXUNARY0Opcodes[GetRs1(insn32)];
+          rd = VRegName(GetRd(insn32));
+          rs2 = VRegName(GetRs2(insn32));
+          break;
+        }
+        case VMUNARY0: {
+          static constexpr const char* kVMUNARY0Opcodes[32] = {
+              nullptr,   "vmsbf.m", "vmsof.m", "vmsif.m",
+              nullptr,   nullptr,   nullptr,   nullptr,
+              nullptr,   nullptr,   nullptr,   nullptr,
+              nullptr,   nullptr,   nullptr,   nullptr,
+              "viota.m", "vid.v",   nullptr,   nullptr,
+              nullptr,   nullptr,   nullptr,   nullptr,
+              nullptr,   nullptr,   nullptr,   nullptr,
+              nullptr,   nullptr,   nullptr,   nullptr,
+          };
+          opcode = kVMUNARY0Opcodes[GetRs1(insn32)];
+          rd = VRegName(GetRd(insn32));
+          rs2 = VRegName(GetRs2(insn32));
+          break;
+        }
+        default: {
+          static constexpr const char* kOPMVVOpcodes[64] = {
+              "vredsum.vs",  "vredand.vs", "vredor.vs",   "vredxor.vs",
+              "vredminu.vs", "vredmin.vs", "vredmaxu.vs", "vredmax.vs",
+              "vaaddu.vv",   "vaadd.vv",   "vasubu.vv",   "vasub.vv",
+              nullptr,       nullptr,      nullptr,       nullptr,
+              "<VWXUNARY0>", nullptr,      "<VXUNARY0>",  nullptr,
+              "<VMUNARY0>",  nullptr,      nullptr,       "vcompress.vm",
+              "vmandn.mm",   "vmand.mm",   "vmor.mm",     "vmxor.mm",
+              "vmorn.mm",    "vmnand.mm",  "vmnor.mm",    "vmxnor.mm",
+              "vdivu.vv",    "vdiv.vv",    "vremu.vv",    "vrem.vv",
+              "vmulhu.vv",   "vmul.vv",    "vmulhsu.vv",  "vmulh.vv",
+              nullptr,       "vmadd.vv",   nullptr,       "vnmsub.vv",
+              nullptr,       "vmacc.vv",   nullptr,       "vnmsac.vv",
+              "vwaddu.vv",   "vwadd.vv",   "vwsubu.vv",   "vwsub.vv",
+              "vwaddu.wv",   "vwadd.wv",   "vwsubu.wv",   "vwsub.wv",
+              "vwmulu.vv",   nullptr,      "vwmulsu.vv",  "vwmul.vv",
+              "vwmaccu.vv", "vwmacc.vv",   nullptr,       "vwmaccsu.vv",
+          };
+
+          opcode = kOPMVVOpcodes[funct6];
+          rd = VRegName(GetRd(insn32));
+          rs1 = VRegName(GetRs1(insn32));
+          rs2 = VRegName(GetRs2(insn32));
+
+          if (0x17u <= funct6 && funct6 <= 0x1Fu) {
+            if (masked) {
+              // for vcompress.vm and *.mm encodings with vm=0 are reserved
+              opcode = nullptr;
+            }
+          }
+
+          MaybeSwapOperands(funct6, rs1, rs2);
+
+          break;
+        }
+      }
+      break;
+    }
+    case VAIEncodings::kOpMVX: {
+      switch (funct6) {
+        case VRXUNARY0: {
+          opcode = GetRs2(insn32) == 0u ? "vmv.s.x" : nullptr;
+          rd = VRegName(GetRd(insn32));
+          rs1 = XRegName(GetRs1(insn32));
+          break;
+        }
+        default: {
+          static constexpr const char* kOPMVXOpcodes[64] = {
+              nullptr,      nullptr,      nullptr,        nullptr,
+              nullptr,      nullptr,      nullptr,        nullptr,
+              "vaaddu.vx",  "vaadd.vx",   "vasubu.vx",    "vasub.vx",
+              nullptr,       nullptr,     "vslide1up.vx", "vslide1down.vx",
+              "<VRXUNARY0>", nullptr,     nullptr,        nullptr,
+              nullptr,       nullptr,     nullptr,        nullptr,
+              nullptr,       nullptr,     nullptr,        nullptr,
+              nullptr,       nullptr,     nullptr,        nullptr,
+              "vdivu.vx",    "vdiv.vx",   "vremu.vx",     "vrem.vx",
+              "vmulhu.vx",   "vmul.vx",   "vmulhsu.vx",   "vmulh.vx",
+              nullptr,       "vmadd.vx",  nullptr,        "vnmsub.vx",
+              nullptr,       "vmacc.vx",  nullptr,        "vnmsac.vx",
+              "vwaddu.vx",   "vwadd.vx",  "vwsubu.vx",    "vwsub.vx",
+              "vwaddu.wv",   "vwadd.wv",  "vwsubu.wv",    "vwsub.wv",
+              "vwmulu.vx",   nullptr,     "vwmulsu.vx",   "vwmul.vx",
+              "vwmaccu.vx",  "vwmacc.vx", "vwmaccus.vx",  "vwmaccsu.vx",
+          };
+          opcode = kOPMVXOpcodes[funct6];
+          rd = VRegName(GetRd(insn32));
+          rs1 = XRegName(GetRs1(insn32));
+          rs2 = VRegName(GetRs2(insn32));
+
+          MaybeSwapOperands(funct6, rs1, rs2);
+
+          break;
+        }
+      }
+      break;
+    }
+    case VAIEncodings::kOpFVV: {
+      switch (funct6) {
+        case VWFUNARY0: {
+          opcode = GetRs1(insn32) == 0u ? "vfmv.f.s" : nullptr;
+          rd = XRegName(GetRd(insn32));
+          rs2 = VRegName(GetRs2(insn32));
+          break;
+        }
+        case VFUNARY0: {
+          static constexpr const char* kVFUNARY0Opcodes[32] = {
+              "vfcvt.xu.f.v",  "vfcvt.x.f.v",      "vfcvt.f.xu.v",      "vfcvt.f.x.v",
+              nullptr,         nullptr,            "vfcvt.rtz.xu.f.v",  "vfcvt.rtz.x.f.v",
+              "vfwcvt.xu.f.v", "vfwcvt.x.f.v",     "vfwcvt.f.xu.v",     "vfwcvt.f.x.v",
+              "vfwcvt.f.f.v",  nullptr,            "vfwcvt.rtz.xu.f.v", "vfwcvt.rtz.x.f.v",
+              "vfncvt.xu.f.w", "vfncvt.x.f.w",     "vfncvt.f.xu.w",     "vfncvt.f.x.w",
+              "vfncvt.f.f.w",  "vfncvt.rod.f.f.w", "vfncvt.rtz.xu.f.w", "vfncvt.rtz.x.f.w",
+              nullptr,         nullptr,            nullptr,             nullptr,
+              nullptr,         nullptr,            nullptr,             nullptr,
+          };
+          opcode = kVFUNARY0Opcodes[GetRs1(insn32)];
+          rd = VRegName(GetRd(insn32));
+          rs2 = VRegName(GetRs2(insn32));
+          break;
+        }
+        case VFUNARY1: {
+          static constexpr const char* kVFUNARY1Opcodes[32] = {
+              "vfsqrt.v",   nullptr,    nullptr, nullptr,
+              "vfrsqrt7.v", "vfrec7.v", nullptr, nullptr,
+              nullptr,      nullptr,    nullptr, nullptr,
+              nullptr,      nullptr,    nullptr, nullptr,
+              "vfclass.v",  nullptr,    nullptr, nullptr,
+              nullptr,      nullptr,    nullptr, nullptr,
+              nullptr,      nullptr,    nullptr, nullptr,
+              nullptr,      nullptr,    nullptr, nullptr,
+          };
+          opcode = kVFUNARY1Opcodes[GetRs1(insn32)];
+          rd = VRegName(GetRd(insn32));
+          rs2 = VRegName(GetRs2(insn32));
+          break;
+        }
+        default: {
+          static constexpr const char* kOPFVVOpcodes[64] = {
+              "vfadd.vv",    "vfredusum.vs",  "vfsub.vv",   "vfredosum.vs",
+              "vfmin.vv",    "vfredmin.vs",   "vfmax.vv",   "vfredmax.vs",
+              "vfsgnj.vv",   "vfsgnjn.vv",    "vfsgnjx.vv", nullptr,
+              nullptr,       nullptr,         nullptr,      nullptr,
+              "<VWFUNARY0>", nullptr,         "<VFUNARY0>", "<VFUNARY1>",
+              nullptr,       nullptr,         nullptr,      nullptr,
+              "vmfeq.vv",    "vmfle.vv",      nullptr,      "vmflt.vv",
+              "vmfne.vv",    nullptr,         nullptr,      nullptr,
+              "vfdiv.vv",    nullptr,         nullptr,      nullptr,
+              "vfmul.vv",    nullptr,         nullptr,      nullptr,
+              "vfmadd.vv",   "vfnmadd.vv",    "vfmsub.vv",  "vfnmsub.vv",
+              "vfmacc.vv",   "vfnmacc.vv",    "vfmsac.vv",  "vfnmsac.vv",
+              "vfwadd.vv",   "vfwredusum.vs", "vfwsub.vv",  "vfwredosum.vs",
+              "vfwadd.wv",   nullptr,         "vfwsub.wv",  nullptr,
+              "vfwmul.vv",   nullptr,         nullptr,      nullptr,
+              "vfwmacc.vv",  "vfwnmacc.vv",   "vfwmsac.vv", "vfwnmsac.vv",
+          };
+          opcode = kOPFVVOpcodes[funct6];
+          rd = VRegName(GetRd(insn32));
+          rs1 = VRegName(GetRs1(insn32));
+          rs2 = VRegName(GetRs2(insn32));
+
+          MaybeSwapOperands(funct6, rs1, rs2);
+
+          break;
+        }
+      }
+      break;
+    }
+    case VAIEncodings::kOpFVF: {
+      switch (funct6) {
+        case VRFUNARY0: {
+          opcode = GetRs2(insn32) == 0u ? "vfmv.s.f" : nullptr;
+          rd = VRegName(GetRd(insn32));
+          rs1 = FRegName(GetRs1(insn32));
+          break;
+        }
+        default: {
+          static constexpr const char* kOPFVFOpcodes[64] = {
+              "vfadd.vf",    nullptr,       "vfsub.vf",      nullptr,
+              "vfmin.vf",    nullptr,       "vfmax.vf",      nullptr,
+              "vfsgnj.vf",   "vfsgnjn.vf",  "vfsgnjx.vf",    nullptr,
+              nullptr,       nullptr,       "vfslide1up.vf", "vfslide1down.vf",
+              "<VRFUNARY0>", nullptr,       nullptr,         nullptr,
+              nullptr,       nullptr,       nullptr,         "<vfmerge.vfm/vfmv>",
+              "vmfeq.vf",    "vmfle.vf",    nullptr,         "vmflt.vf",
+              "vmfne.vf",    "vmfgt.vf",    nullptr,         "vmfge.vf",
+              "vfdiv.vf",    "vfrdiv.vf",   nullptr,         nullptr,
+              "vfmul.vf",    nullptr,       nullptr,         "vfrsub.vf",
+              "vfmadd.vf",   "vfnmadd.vf",  "vfmsub.vf",     "vfnmsub.vf",
+              "vfmacc.vf",   "vfnmacc.vf",  "vfmsac.vf",     "vfnmsac.vf",
+              "vfwadd.vf",   nullptr,       "vfwsub.vf",     nullptr,
+              "vfwadd.wf",   nullptr,       "vfwsub.wf",     nullptr,
+              "vfwmul.vf",   nullptr,       nullptr,         nullptr,
+              "vfwmacc.vf",  "vfwnmacc.vf", "vfwmsac.vf",    "vfwnmsac.vf",
+          };
+
+          rs2 = VRegName(GetRs2(insn32));
+          if (funct6 == 0b010111) {
+            // vfmerge/vfmv
+            if (masked) {
+              opcode = "vfmerge.vfm";
+              vm = ", v0";
+            } else if (GetRs2(insn32) == 0) {
+              opcode = "vfmv.v.f";
+              rs2 = nullptr;
+            } else {
+              opcode = nullptr;
+            }
+          } else {
+            opcode = kOPFVFOpcodes[funct6];
+          }
+
+          rd = VRegName(GetRd(insn32));
+          rs1 = FRegName(GetRs1(insn32));
+
+          MaybeSwapOperands(funct6, rs1, rs2);
+
+          break;
+        }
+      }
+      break;
+    }
+    case VAIEncodings::kOpCFG: {  // vector ALU control instructions
+      if ((insn32 >> 31) != 0u) {
+        if (((insn32 >> 30) & 0x1U) != 0u) {  // vsetivli
+          const uint32_t zimm = Decode32UImm12(insn32) & ~0xC00U;
+          const uint32_t imm5 = GetRs1(insn32);
+          os_ << "vsetivli " << XRegName(GetRd(insn32)) << ", " << StringPrintf("0x%08x", imm5)
+              << ", ";
+          AppendVType(zimm);
+        } else {  // vsetvl
+          os_ << "vsetvl " << XRegName(GetRd(insn32)) << ", " << XRegName(GetRs1(insn32)) << ", "
+              << XRegName(GetRs2(insn32));
+          if ((Decode32UImm7(insn32) & 0x40u) != 0u) {
+            os_ << "\t# incorrect funct7 literal : "
+                << StringPrintf("0x%08x", Decode32UImm7(insn32));
+          }
+        }
+      } else {  // vsetvli
+        const uint32_t zimm = Decode32UImm12(insn32) & ~0x800U;
+        os_ << "vsetvli " << XRegName(GetRd(insn32)) << ", " << XRegName(GetRs1(insn32)) << ", ";
+        AppendVType(zimm);
+      }
+      return;
+    }
+  }
+
+  if (opcode == nullptr) {
+    os_ << "<unknown32>";
+    return;
+  }
+
+  os_ << opcode << " " << rd;
+
+  if (rs2 != nullptr) {
+    os_ << ", " << rs2;
+  }
+
+  if (rs1 != nullptr) {
+    os_ << ", " << rs1;
+  } else if (vai == VAIEncodings::kOpIVI) {
+    os_ << StringPrintf(", 0x%08x", GetRs1(insn32));
+  }
+
+  os_ << vm;
+}
+
+void DisassemblerRiscv64::Printer::Print32FpFma(uint32_t insn32) {
+  DCHECK_EQ(insn32 & 0x73u, 0x43u);  // Note: Bits 0xc select the FMA opcode.
+  uint32_t funct2 = (insn32 >> 25) & 3u;
+  if (funct2 >= 2u) {
+    os_ << "<unknown32>";  // Note: This includes the "H" and "Q" extensions.
+    return;
+  }
+  static const char* const kOpcodes[] = { "fmadd", "fmsub", "fnmsub", "fnmadd" };
+  os_ << kOpcodes[(insn32 >> 2) & 3u] << ((funct2 != 0u) ? ".d" : ".s")
+      << RoundingModeName(GetRoundingMode(insn32)) << " "
+      << FRegName(GetRd(insn32)) << ", " << FRegName(GetRs1(insn32)) << ", "
+      << FRegName(GetRs2(insn32)) << ", " << FRegName(GetRs3(insn32));
+}
+
+void DisassemblerRiscv64::Printer::Print32Zicsr(uint32_t insn32) {
+  DCHECK_EQ(insn32 & 0x7fu, 0x73u);
+  uint32_t funct3 = (insn32 >> 12) & 7u;
+  static const char* const kOpcodes[] = {
+      nullptr, "csrrw", "csrrs", "csrrc", nullptr, "csrrwi", "csrrsi", "csrrci"
+  };
+  const char* opcode = kOpcodes[funct3];
+  if (opcode == nullptr) {
+    os_ << "<unknown32>";
+    return;
+  }
+  uint32_t rd = GetRd(insn32);
+  uint32_t rs1_or_uimm = GetRs1(insn32);
+  uint32_t csr = insn32 >> 20;
+  // Print shorter macro instruction notation if available.
+  if (funct3 == /*CSRRW*/ 1u && rd == 0u && rs1_or_uimm == 0u && csr == 0xc00u) {
+    os_ << "unimp";
+    return;
+  } else if (funct3 == /*CSRRS*/ 2u && rs1_or_uimm == 0u) {
+    if (csr == 0xc00u) {
+      os_ << "rdcycle " << XRegName(rd);
+    } else if (csr == 0xc01u) {
+      os_ << "rdtime " << XRegName(rd);
+    } else if (csr == 0xc02u) {
+      os_ << "rdinstret " << XRegName(rd);
+    } else {
+      os_ << "csrr " << XRegName(rd) << ", " << csr;
+    }
+    return;
+  }
+
+  if (rd == 0u) {
+    static const char* const kAltOpcodes[] = {
+        nullptr, "csrw", "csrs", "csrc", nullptr, "csrwi", "csrsi", "csrci"
+    };
+    DCHECK(kAltOpcodes[funct3] != nullptr);
+    os_ << kAltOpcodes[funct3] << " " << csr << ", ";
+  } else {
+    os_ << opcode << " " << XRegName(rd) << ", " << csr << ", ";
+  }
+  if (funct3 >= /*CSRRWI/CSRRSI/CSRRCI*/ 4u) {
+    os_ << rs1_or_uimm;
+  } else {
+    os_ << XRegName(rs1_or_uimm);
+  }
+}
+
+void DisassemblerRiscv64::Printer::Print32Fence(uint32_t insn32) {
+  DCHECK_EQ(insn32 & 0x7fu, 0x0fu);
+  if ((insn32 & 0xf00fffffu) == 0x0000000fu) {
+    auto print_flags = [&](uint32_t flags) {
+      if (flags == 0u) {
+        os_ << "0";
+      } else {
+        DCHECK_LT(flags, 0x10u);
+        static const char kFlagNames[] = "wroi";
+        for (size_t bit : { 3u, 2u, 1u, 0u }) {  // Print in the "iorw" order.
+          if ((flags & (1u << bit)) != 0u) {
+            os_ << kFlagNames[bit];
+          }
+        }
+      }
+    };
+    os_ << "fence.";
+    print_flags((insn32 >> 24) & 0xfu);
+    os_ << ".";
+    print_flags((insn32 >> 20) & 0xfu);
+  } else if (insn32 == 0x8330000fu) {
+    os_ << "fence.tso";
+  } else if (insn32 == 0x0000100fu) {
+    os_ << "fence.i";
+  } else {
+    os_ << "<unknown32>";
+  }
+}
+
+void DisassemblerRiscv64::Printer::Dump32(const uint8_t* insn) {
+  uint32_t insn32 = static_cast<uint32_t>(insn[0]) +
+                    (static_cast<uint32_t>(insn[1]) << 8) +
+                    (static_cast<uint32_t>(insn[2]) << 16) +
+                    (static_cast<uint32_t>(insn[3]) << 24);
+  CHECK_EQ(insn32 & 3u, 3u);
+  os_ << disassembler_->FormatInstructionPointer(insn) << StringPrintf(": %08x\t", insn32);
+  switch (insn32 & 0x7fu) {
+    case 0x37u:
+      Print32Lui(insn32);
+      break;
+    case 0x17u:
+      Print32Auipc(insn, insn32);
+      break;
+    case 0x6fu:
+      Print32Jal(insn, insn32);
+      break;
+    case 0x67u:
+      switch ((insn32 >> 12) & 7u) {  // funct3
+        case 0:
+          Print32Jalr(insn, insn32);
+          break;
+        default:
+          os_ << "<unknown32>";
+          break;
+      }
+      break;
+    case 0x63u:
+      Print32BCond(insn, insn32);
+      break;
+    case 0x03u:
+      Print32Load(insn32);
+      break;
+    case 0x23u:
+      Print32Store(insn32);
+      break;
+    case 0x07u:
+      Print32FLoad(insn32);
+      break;
+    case 0x27u:
+      Print32FStore(insn32);
+      break;
+    case 0x13u:
+    case 0x1bu:
+      Print32BinOpImm(insn32);
+      break;
+    case 0x33u:
+    case 0x3bu:
+      Print32BinOp(insn32);
+      break;
+    case 0x2fu:
+      Print32Atomic(insn32);
+      break;
+    case 0x53u:
+      Print32FpOp(insn32);
+      break;
+    case 0x57u:
+      Print32RVVOp(insn32);
+      break;
+    case 0x43u:
+    case 0x47u:
+    case 0x4bu:
+    case 0x4fu:
+      Print32FpFma(insn32);
+      break;
+    case 0x73u:
+      if ((insn32 & 0xffefffffu) == 0x00000073u) {
+        os_ << ((insn32 == 0x00000073u) ? "ecall" : "ebreak");
+      } else {
+        Print32Zicsr(insn32);
+      }
+      break;
+    case 0x0fu:
+      Print32Fence(insn32);
+      break;
+    default:
+      // TODO(riscv64): Disassemble more instructions.
+      os_ << "<unknown32>";
+      break;
+  }
+  os_ << "\n";
+}
+
+void DisassemblerRiscv64::Printer::Dump16(const uint8_t* insn) {
+  uint32_t insn16 = static_cast<uint32_t>(insn[0]) + (static_cast<uint32_t>(insn[1]) << 8);
+  ScopedNewLinePrinter nl(os_);
+  CHECK_NE(insn16 & 3u, 3u);
+  os_ << disassembler_->FormatInstructionPointer(insn) << StringPrintf(": %04x    \t", insn16);
+
+  uint32_t funct3 = BitFieldExtract(insn16, 13, 3);
+  int32_t offset = -1;
+
+  switch (insn16 & 3u) {
+    case 0b00u:  // Quadrant 0
+      switch (funct3) {
+        case 0b000u:
+          if (insn16 == 0u) {
+            os_ << "c.unimp";
+          } else {
+            uint32_t nzuimm = BitFieldExtract(insn16, 5, 8);
+            if (nzuimm != 0u) {
+              uint32_t decoded =
+                  BitFieldExtract(nzuimm, 0, 1) << 3 | BitFieldExtract(nzuimm, 1, 1) << 2 |
+                  BitFieldExtract(nzuimm, 2, 4) << 6 | BitFieldExtract(nzuimm, 6, 2) << 4;
+              os_ << "c.addi4spn " << XRegName(GetRs2Short16(insn16)) << ", sp, " << decoded;
+            } else {
+              os_ << "<unknown16>";
+            }
+          }
+          return;
+        case 0b001u:
+          offset = Decode16CMOffsetD(insn16);
+          os_ << "c.fld " << FRegName(GetRs2Short16(insn16));
+          break;
+        case 0b010u:
+          offset = Decode16CMOffsetW(insn16);
+          os_ << "c.lw " << XRegName(GetRs2Short16(insn16));
+          break;
+        case 0b011u:
+          offset = Decode16CMOffsetD(insn16);
+          os_ << "c.ld " << XRegName(GetRs2Short16(insn16));
+          break;
+        case 0b100u: {
+          uint32_t opcode2 = BitFieldExtract(insn16, 10, 3);
+          uint32_t imm = BitFieldExtract(insn16, 5, 2);
+          switch (opcode2) {
+            case 0b000:
+              offset = Uimm2ToOffset10(imm);
+              os_ << "c.lbu " << XRegName(GetRs2Short16(insn16));
+              break;
+            case 0b001:
+              offset = Uimm2ToOffset1(imm);
+              os_ << (BitFieldExtract(imm, 1, 1) == 0u ? "c.lhu " : "c.lh ");
+              os_ << XRegName(GetRs2Short16(insn16));
+              break;
+            case 0b010:
+              offset = Uimm2ToOffset10(imm);
+              os_ << "c.sb " << XRegName(GetRs2Short16(insn16));
+              break;
+            case 0b011:
+              if (BitFieldExtract(imm, 1, 1) == 0u) {
+                offset = Uimm2ToOffset1(imm);
+                os_ << "c.sh " << XRegName(GetRs2Short16(insn16));
+                break;
+              }
+              FALLTHROUGH_INTENDED;
+            default:
+              os_ << "<unknown16>";
+              return;
+          }
+          break;
+        }
+        case 0b101u:
+          offset = Decode16CMOffsetD(insn16);
+          os_ << "c.fsd " << FRegName(GetRs2Short16(insn16));
+          break;
+        case 0b110u:
+          offset = Decode16CMOffsetW(insn16);
+          os_ << "c.sw " << XRegName(GetRs2Short16(insn16));
+          break;
+        case 0b111u:
+          offset = Decode16CMOffsetD(insn16);
+          os_ << "c.sd " << XRegName(GetRs2Short16(insn16));
+          break;
+        default:
+          UNREACHABLE();
+      }
+      os_ << ", ";
+      PrintLoadStoreAddress(GetRs1Short16(insn16), offset);
+      return;
+    case 0b01u:  // Quadrant 1
+      switch (funct3) {
+        case 0b000u: {
+          uint32_t rd = GetRs1_16(insn16);
+          if (rd == 0) {
+            if (Decode16Imm6<uint32_t>(insn16) != 0u) {
+              os_ << "<hint16>";
+            } else {
+              os_ << "c.nop";
+            }
+          } else {
+            int32_t imm = Decode16Imm6<int32_t>(insn16);
+            if (imm != 0) {
+              os_ << "c.addi " << XRegName(rd) << ", " << imm;
+            } else {
+              os_ << "<hint16>";
+            }
+          }
+          break;
+        }
+        case 0b001u: {
+          uint32_t rd = GetRs1_16(insn16);
+          if (rd != 0) {
+            os_ << "c.addiw " << XRegName(rd) << ", " << Decode16Imm6<int32_t>(insn16);
+          } else {
+            os_ << "<unknown16>";
+          }
+          break;
+        }
+        case 0b010u: {
+          uint32_t rd = GetRs1_16(insn16);
+          if (rd != 0) {
+            os_ << "c.li " << XRegName(rd) << ", " << Decode16Imm6<int32_t>(insn16);
+          } else {
+            os_ << "<hint16>";
+          }
+          break;
+        }
+        case 0b011u: {
+          uint32_t rd = GetRs1_16(insn16);
+          uint32_t imm6_bits = Decode16Imm6<uint32_t>(insn16);
+          if (imm6_bits != 0u) {
+            if (rd == 2) {
+              int32_t nzimm =
+                  BitFieldExtract(insn16, 6, 1) << 4 | BitFieldExtract(insn16, 2, 1) << 5 |
+                  BitFieldExtract(insn16, 5, 1) << 6 | BitFieldExtract(insn16, 3, 2) << 7 |
+                  BitFieldExtract(insn16, 12, 1) << 9;
+              os_ << "c.addi16sp sp, " << SignExtendBits<10>(nzimm);
+            } else if (rd != 0) {
+              // sign-extend bits and mask with 0xfffff as llvm-objdump does
+              uint32_t mask = MaskLeastSignificant<uint32_t>(20);
+              os_ << "c.lui " << XRegName(rd) << ", " << (SignExtendBits<6>(imm6_bits) & mask);
+            } else {
+              os_ << "<hint16>";
+            }
+          } else {
+            os_ << "<unknown16>";
+          }
+          break;
+        }
+        case 0b100u: {
+          uint32_t funct2 = BitFieldExtract(insn16, 10, 2);
+          switch (funct2) {
+            case 0b00: {
+              int32_t nzuimm = Decode16Imm6<uint32_t>(insn16);
+              if (nzuimm != 0) {
+                os_ << "c.srli " << XRegName(GetRs1Short16(insn16)) << ", " << nzuimm;
+              } else {
+                os_ << "<hint16>";
+              }
+              break;
+            }
+            case 0b01: {
+              int32_t nzuimm = Decode16Imm6<uint32_t>(insn16);
+              if (nzuimm != 0) {
+                os_ << "c.srai " << XRegName(GetRs1Short16(insn16)) << ", " << nzuimm;
+              } else {
+                os_ << "<hint16>";
+              }
+              break;
+            }
+            case 0b10:
+              os_ << "c.andi " << XRegName(GetRs1Short16(insn16)) << ", "
+                  << Decode16Imm6<int32_t>(insn16);
+              break;
+            case 0b11: {
+              constexpr static const char* mnemonics[] = {
+                  "c.sub", "c.xor", "c.or", "c.and", "c.subw", "c.addw", "c.mul", nullptr
+              };
+              uint32_t opc = BitFieldInsert(
+                  BitFieldExtract(insn16, 5, 2), BitFieldExtract(insn16, 12, 1), 2, 1);
+              DCHECK(IsUint<3>(opc));
+              const char* mnem = mnemonics[opc];
+              if (mnem != nullptr) {
+                os_ << mnem << " " << XRegName(GetRs1Short16(insn16)) << ", "
+                    << XRegName(GetRs2Short16(insn16));
+              } else {
+                constexpr static const char* zbc_mnemonics[] = {
+                    "c.zext.b", "c.sext.b", "c.zext.h", "c.sext.h",
+                    "c.zext.w", "c.not",    nullptr,    nullptr,
+                };
+                mnem = zbc_mnemonics[BitFieldExtract(insn16, 2, 3)];
+                if (mnem != nullptr) {
+                  os_ << mnem << " " << XRegName(GetRs1Short16(insn16));
+                } else {
+                  os_ << "<unknown16>";
+                }
+              }
+              break;
+            }
+            default:
+              UNREACHABLE();
+          }
+          break;
+        }
+        case 0b101u: {
+          int32_t disp = BitFieldExtract(insn16, 3, 3) << 1  | BitFieldExtract(insn16, 11, 1) << 4 |
+                         BitFieldExtract(insn16, 2, 1) << 5  | BitFieldExtract(insn16, 7,  1) << 6 |
+                         BitFieldExtract(insn16, 6, 1) << 7  | BitFieldExtract(insn16, 9,  2) << 8 |
+                         BitFieldExtract(insn16, 8, 1) << 10 | BitFieldExtract(insn16, 12, 1) << 11;
+          os_ << "c.j ";
+          PrintBranchOffset(SignExtendBits<12>(disp));
+          break;
+        }
+        case 0b110u:
+        case 0b111u: {
+          int32_t disp = BitFieldExtract(insn16, 3, 2) << 1 | BitFieldExtract(insn16, 10, 2) << 3 |
+                         BitFieldExtract(insn16, 2, 1) << 5 | BitFieldExtract(insn16, 5,  2) << 6 |
+                         BitFieldExtract(insn16, 12, 1) << 8;
+
+          os_ << (funct3 == 0b110u ? "c.beqz " : "c.bnez ");
+          os_ << XRegName(GetRs1Short16(insn16)) << ", ";
+          PrintBranchOffset(SignExtendBits<9>(disp));
+          break;
+        }
+        default:
+          UNREACHABLE();
+      }
+      break;
+    case 0b10u:  // Quadrant 2
+      switch (funct3) {
+        case 0b000u: {
+          uint32_t nzuimm = Decode16Imm6<uint32_t>(insn16);
+          uint32_t rd = GetRs1_16(insn16);
+          if (rd == 0 || nzuimm == 0) {
+            os_ << "<hint16>";
+          } else {
+            os_ << "c.slli " << XRegName(rd) << ", " << nzuimm;
+          }
+          return;
+        }
+        case 0b001u: {
+          offset = Uimm6ToOffsetD16(Decode16Imm6<uint32_t>(insn16));
+          os_ << "c.fldsp " << FRegName(GetRs1_16(insn16));
+          break;
+        }
+        case 0b010u: {
+          uint32_t rd = GetRs1_16(insn16);
+          if (rd != 0) {
+            offset = Uimm6ToOffsetW16(Decode16Imm6<uint32_t>(insn16));
+            os_ << "c.lwsp " << XRegName(GetRs1_16(insn16));
+          } else {
+            os_ << "<unknown16>";
+            return;
+          }
+          break;
+        }
+        case 0b011u: {
+          uint32_t rd = GetRs1_16(insn16);
+          if (rd != 0) {
+            offset = Uimm6ToOffsetD16(Decode16Imm6<uint32_t>(insn16));
+            os_ << "c.ldsp " << XRegName(GetRs1_16(insn16));
+          } else {
+            os_ << "<unknown16>";
+            return;
+          }
+          break;
+        }
+        case 0b100u: {
+          uint32_t rd_rs1 = GetRs1_16(insn16);
+          uint32_t rs2 = GetRs2_16(insn16);
+          uint32_t b12 = BitFieldExtract(insn16, 12, 1);
+          if (b12 == 0) {
+            if (rd_rs1 != 0 && rs2 != 0) {
+              os_ << "c.mv " << XRegName(rd_rs1) << ", " << XRegName(rs2);
+            } else if (rd_rs1 != 0) {
+              os_ << "c.jr " << XRegName(rd_rs1);
+            } else if (rs2 != 0) {
+              os_ << "<hint16>";
+            } else {
+              os_ << "<unknown16>";
+            }
+          } else {
+            if (rd_rs1 != 0 && rs2 != 0) {
+              os_ << "c.add " << XRegName(rd_rs1) << ", " << XRegName(rs2);
+            } else if (rd_rs1 != 0) {
+              os_ << "c.jalr " << XRegName(rd_rs1);
+            } else if (rs2 != 0) {
+              os_ << "<hint16>";
+            } else {
+              os_ << "c.ebreak";
+            }
+          }
+          return;
+        }
+        case 0b101u:
+          offset = BitFieldExtract(insn16, 7, 3) << 6 | BitFieldExtract(insn16, 10, 3) << 3;
+          os_ << "c.fsdsp " << FRegName(GetRs2_16(insn16));
+          break;
+        case 0b110u:
+          offset = BitFieldExtract(insn16, 7, 2) << 6 | BitFieldExtract(insn16, 9, 4) << 2;
+          os_ << "c.swsp " << XRegName(GetRs2_16(insn16));
+          break;
+        case 0b111u:
+          offset = BitFieldExtract(insn16, 7, 3) << 6 | BitFieldExtract(insn16, 10, 3) << 3;
+          os_ << "c.sdsp " << XRegName(GetRs2_16(insn16));
+          break;
+        default:
+          UNREACHABLE();
+      }
+
+      os_ << ", ";
+      PrintLoadStoreAddress(/* sp */ 2, offset);
+
+      break;
+    default:
+      UNREACHABLE();
+  }
+}
+
+void DisassemblerRiscv64::Printer::Dump2Byte(const uint8_t* data) {
+  uint32_t value = data[0] + (data[1] << 8);
+  os_ << disassembler_->FormatInstructionPointer(data)
+      << StringPrintf(": %04x    \t.2byte %u\n", value, value);
+}
+
+void DisassemblerRiscv64::Printer::DumpByte(const uint8_t* data) {
+  uint32_t value = *data;
+  os_ << disassembler_->FormatInstructionPointer(data)
+      << StringPrintf(": %02x      \t.byte %u\n", value, value);
+}
+
+size_t DisassemblerRiscv64::Dump(std::ostream& os, const uint8_t* begin) {
+  if (begin < GetDisassemblerOptions()->base_address_ ||
+      begin >= GetDisassemblerOptions()->end_address_) {
+    return 0u;  // Outside the range.
+  }
+  Printer printer(this, os);
+  if (!IsAligned<2u>(begin) || GetDisassemblerOptions()->end_address_ - begin == 1) {
+    printer.DumpByte(begin);
+    return 1u;
+  }
+  if ((*begin & 3u) == 3u) {
+    if (GetDisassemblerOptions()->end_address_ - begin >= 4) {
+      printer.Dump32(begin);
+      return 4u;
+    } else {
+      printer.Dump2Byte(begin);
+      return 2u;
+    }
+  } else {
+    printer.Dump16(begin);
+    return 2u;
+  }
+}
+
+void DisassemblerRiscv64::Dump(std::ostream& os, const uint8_t* begin, const uint8_t* end) {
+  Printer printer(this, os);
+  const uint8_t* cur = begin;
+  if (cur < end && !IsAligned<2u>(cur)) {
+    // Unaligned, dump as a `.byte` to get to an aligned address.
+    printer.DumpByte(cur);
+    cur += 1;
+  }
+  if (cur >= end) {
+    return;
+  }
+  while (end - cur >= 4) {
+    if ((*cur & 3u) == 3u) {
+      printer.Dump32(cur);
+      cur += 4;
+    } else {
+      printer.Dump16(cur);
+      cur += 2;
+    }
+  }
+  if (end - cur >= 2) {
+    if ((*cur & 3u) == 3u) {
+      // Not enough data for a 32-bit instruction. Dump as `.2byte`.
+      printer.Dump2Byte(cur);
+    } else {
+      printer.Dump16(cur);
+    }
+    cur += 2;
+  }
+  if (end != cur) {
+    CHECK_EQ(end - cur, 1);
+    printer.DumpByte(cur);
+  }
+}
+
+}  // namespace riscv64
+}  // namespace art
diff --git a/disassembler/disassembler_riscv64.h b/disassembler/disassembler_riscv64.h
new file mode 100644
index 0000000..739d58d
--- /dev/null
+++ b/disassembler/disassembler_riscv64.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_DISASSEMBLER_DISASSEMBLER_RISCV64_H_
+#define ART_DISASSEMBLER_DISASSEMBLER_RISCV64_H_
+
+#include "disassembler.h"
+
+namespace art {
+namespace riscv64 {
+
+class DisassemblerRiscv64 final : public Disassembler {
+ public:
+  explicit DisassemblerRiscv64(DisassemblerOptions* options)
+      : Disassembler(options) {}
+
+  size_t Dump(std::ostream& os, const uint8_t* begin) override;
+  void Dump(std::ostream& os, const uint8_t* begin, const uint8_t* end) override;
+
+ private:
+  class Printer;
+
+  DISALLOW_COPY_AND_ASSIGN(DisassemblerRiscv64);
+};
+
+}  // namespace riscv64
+}  // namespace art
+
+#endif  // ART_DISASSEMBLER_DISASSEMBLER_RISCV64_H_
diff --git a/dt_fd_forward/dt_fd_forward.cc b/dt_fd_forward/dt_fd_forward.cc
index 0ff8770..b46810f 100644
--- a/dt_fd_forward/dt_fd_forward.cc
+++ b/dt_fd_forward/dt_fd_forward.cc
@@ -691,7 +691,7 @@
 
 class JdwpTransportFunctions {
  public:
-  static jdwpTransportError GetCapabilities(jdwpTransportEnv* env ATTRIBUTE_UNUSED,
+  static jdwpTransportError GetCapabilities([[maybe_unused]] jdwpTransportEnv* env,
                                             /*out*/ JDWPTransportCapabilities* capabilities_ptr) {
     // We don't support any of the optional capabilities (can_timeout_attach, can_timeout_accept,
     // can_timeout_handshake) so just return a zeroed capabilities ptr.
@@ -703,8 +703,8 @@
   // Address is <sock_fd>
   static jdwpTransportError Attach(jdwpTransportEnv* env,
                                    const char* address,
-                                   jlong attach_timeout ATTRIBUTE_UNUSED,
-                                   jlong handshake_timeout ATTRIBUTE_UNUSED) {
+                                   [[maybe_unused]] jlong attach_timeout,
+                                   [[maybe_unused]] jlong handshake_timeout) {
     if (address == nullptr || *address == '\0') {
       return ERR(ILLEGAL_ARGUMENT);
     }
@@ -743,8 +743,8 @@
   }
 
   static jdwpTransportError Accept(jdwpTransportEnv* env,
-                                   jlong accept_timeout ATTRIBUTE_UNUSED,
-                                   jlong handshake_timeout ATTRIBUTE_UNUSED) {
+                                   [[maybe_unused]] jlong accept_timeout,
+                                   [[maybe_unused]] jlong handshake_timeout) {
     return AsFdForward(env)->Accept();
   }
 
@@ -784,11 +784,10 @@
   JdwpTransportFunctions::GetLastError,
 };
 
-extern "C"
-JNIEXPORT jint JNICALL jdwpTransport_OnLoad(JavaVM* vm ATTRIBUTE_UNUSED,
-                                            jdwpTransportCallback* cb,
-                                            jint version,
-                                            jdwpTransportEnv** /*out*/env) {
+extern "C" JNIEXPORT jint JNICALL jdwpTransport_OnLoad([[maybe_unused]] JavaVM* vm,
+                                                       jdwpTransportCallback* cb,
+                                                       jint version,
+                                                       jdwpTransportEnv** /*out*/ env) {
   if (version != JDWPTRANSPORT_VERSION_1_0) {
     LOG(ERROR) << "unknown version " << version;
     return JNI_EVERSION;
diff --git a/imgdiag/Android.bp b/imgdiag/Android.bp
index a0354ab..7d1869f 100644
--- a/imgdiag/Android.bp
+++ b/imgdiag/Android.bp
@@ -28,7 +28,10 @@
 cc_defaults {
     name: "imgdiag-defaults",
     host_supported: true,
-    srcs: ["imgdiag.cc"],
+    srcs: [
+        "imgdiag.cc",
+        "page_util.cc",
+    ],
     defaults: ["art_defaults"],
 
     // Note that this tool needs to be built for both 32-bit and 64-bit since it requires
@@ -66,7 +69,6 @@
     shared_libs: [
         "libart",
         "libartbase",
-        "libart-compiler",
     ],
     apex_available: [
         "com.android.art",
@@ -83,7 +85,6 @@
     shared_libs: [
         "libartd",
         "libartbased",
-        "libartd-compiler",
         "libdexfiled",
     ],
     apex_available: [
@@ -103,3 +104,47 @@
         },
     },
 }
+
+cc_defaults {
+    name: "pageinfo-defaults",
+    host_supported: true,
+    srcs: [
+        "page_info.cc",
+        "page_util.cc",
+    ],
+    defaults: ["art_defaults"],
+
+    compile_multilib: "both",
+
+    shared_libs: [
+        "libbase",
+    ],
+    static_libs: [
+        "libprocinfo",
+    ],
+    header_libs: [
+        "art_cmdlineparser_headers",
+    ],
+    multilib: {
+        lib32: {
+            suffix: "32",
+        },
+        lib64: {
+            suffix: "64",
+        },
+    },
+    symlink_preferred_arch: true,
+}
+
+art_cc_binary {
+    name: "pageinfo",
+    defaults: ["pageinfo-defaults"],
+    shared_libs: [
+        "libart",
+        "libartbase",
+    ],
+    apex_available: [
+        "com.android.art",
+        "com.android.art.debug",
+    ],
+}
diff --git a/imgdiag/create_dirty_image_objects.py b/imgdiag/create_dirty_image_objects.py
new file mode 100755
index 0000000..da0ed2c
--- /dev/null
+++ b/imgdiag/create_dirty_image_objects.py
@@ -0,0 +1,188 @@
+#! /usr/bin/env python3
+#
+# Copyright 2023, The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import argparse
+from collections import defaultdict
+from enum import Enum
+import os
+import re
+
+
+class SortType(Enum):
+  NONE = 'none'
+  SIMPLE = 'simple'
+  OPT_NEIGHBOURS = 'opt_neighbours'
+
+
+def merge_same_procnames(entries):
+  path_regex = r'(.+)_(\d+).txt'
+  prog = re.compile(path_regex)
+
+  merged_entries = defaultdict(set)
+  for path, objs in entries:
+    basename = os.path.basename(path)
+    m = prog.match(basename)
+    if m:
+      merged_entries[m.group(1)].update(objs)
+
+  return sorted(merged_entries.items(), key=lambda x: len(x[1]))
+
+
+def opt_neighbours(sort_keys):
+  sort_keys = dict(sort_keys)
+  res = list()
+
+  # Start with a bin with the lowest process and objects count.
+  cur_key = min(
+      sort_keys.items(), key=lambda item: (item[0].bit_count(), len(item[1]))
+  )[0]
+  res.append((cur_key, sort_keys[cur_key]))
+  del sort_keys[cur_key]
+
+  # Find next most similar sort key and update the result.
+  while sort_keys:
+
+    def jaccard_index(x):
+      return (x & cur_key).bit_count() / (x | cur_key).bit_count()
+
+    next_key = max(sort_keys.keys(), key=jaccard_index)
+    res.append((next_key, sort_keys[next_key]))
+    del sort_keys[next_key]
+    cur_key = next_key
+  return res
+
+
+def process_dirty_entries(entries, sort_type):
+  dirty_image_objects = []
+
+  union = set()
+  for k, v in entries:
+    union = union.union(v)
+
+  if sort_type == SortType.NONE:
+    dirty_obj_lines = [obj + '\n' for obj in sorted(union)]
+    return (dirty_obj_lines, dict())
+
+  # sort_key -> [objs]
+  sort_keys = defaultdict(list)
+  for obj in union:
+    sort_key = 0
+    # Nth bit of sort_key is set if this object is dirty in Nth process.
+    for idx, (k, v) in enumerate(entries):
+      if obj in v:
+        sort_key = (sort_key << 1) | 1
+      else:
+        sort_key = sort_key << 1
+
+    sort_keys[sort_key].append(obj)
+
+  sort_keys = sorted(sort_keys.items())
+
+  if sort_type == SortType.OPT_NEIGHBOURS:
+    sort_keys = opt_neighbours(sort_keys)
+
+  dirty_obj_lines = list()
+  for idx, (_, objs) in enumerate(sort_keys):
+    for obj in objs:
+      dirty_obj_lines.append(obj + ' ' + str(idx) + '\n')
+
+  return (dirty_obj_lines, sort_keys)
+
+
+def main():
+  parser = argparse.ArgumentParser(
+      description=(
+          'Create dirty-image-objects file from specified imgdiag output files.'
+      ),
+      formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+  )
+  parser.add_argument(
+      'imgdiag_files',
+      nargs='+',
+      help='imgdiag files to use.',
+  )
+  parser.add_argument(
+      '--sort-type',
+      choices=[e.value for e in SortType],
+      default=SortType.OPT_NEIGHBOURS.value,
+      help=(
+          'Object sorting type. "simple" puts objects with the same usage'
+          ' pattern in the same bins. "opt_neighbours" also tries to put bins'
+          ' with similar usage patterns close to each other.'
+      ),
+  )
+  parser.add_argument(
+      '--merge-same-procnames',
+      action=argparse.BooleanOptionalAction,
+      default=False,
+      help=(
+          'Merge dirty objects from files with the same process name (different'
+          ' pid). Files are expected to end with "_{pid}.txt"'
+      ),
+  )
+  parser.add_argument(
+      '--output-filename',
+      default='dirty-image-objects.txt',
+      help='Output file for dirty image objects.',
+  )
+  parser.add_argument(
+      '--print-stats',
+      action=argparse.BooleanOptionalAction,
+      default=False,
+      help='Print dirty object stats.',
+  )
+
+  args = parser.parse_args()
+
+  entries = list()
+  for path in args.imgdiag_files:
+    with open(path) as f:
+      lines = f.readlines()
+    prefix = 'dirty_obj: '
+    lines = [l.strip().removeprefix(prefix) for l in lines if prefix in l]
+    entries.append((path, set(lines)))
+
+  entries = sorted(entries, key=lambda x: len(x[1]))
+
+  if args.merge_same_procnames:
+    entries = merge_same_procnames(entries)
+
+  print('Using processes:')
+  for k, v in entries:
+    print(f'{k}: {len(v)}')
+  print()
+
+  dirty_image_objects, sort_keys = process_dirty_entries(
+      entries=entries, sort_type=SortType(args.sort_type)
+  )
+
+  with open(args.output_filename, 'w') as f:
+    f.writelines(dirty_image_objects)
+
+  if args.print_stats:
+    print(','.join(k for k, v in entries), ',obj_count')
+    total_count = 0
+    for sort_key, objs in sort_keys:
+      bits_csv = ','.join(
+          '{sort_key:0{width}b}'.format(sort_key=sort_key, width=len(entries))
+      )
+      print(bits_csv, ',', len(objs))
+      total_count += len(objs)
+    print('total: ', total_count)
+
+
+if __name__ == '__main__':
+  main()
diff --git a/imgdiag/dirty_image_objects.md b/imgdiag/dirty_image_objects.md
new file mode 100644
index 0000000..1b5ab62
--- /dev/null
+++ b/imgdiag/dirty_image_objects.md
@@ -0,0 +1,80 @@
+# How to update dirty-image-objects
+
+1. Add `imgdiag` to ART APEX.
+
+The easiest way is to modify `art/build/apex/Android.bp` like this:
+```
+ art_runtime_binaries_both = [
+     "dalvikvm",
+     "dex2oat",
++    "imgdiag",
+ ]
+```
+
+2. Install ART APEX and reboot, e.g.:
+
+```
+m apps_only dist
+adb install out/dist/com.android.art.apex
+adb reboot
+```
+
+3. Collect imgdiag output.
+
+```
+# To see all options check: art/imgdiag/run_imgdiag.py -h
+
+art/imgdiag/run_imgdiag.py
+```
+
+4. Create new dirty-image-objects.
+
+```
+# To see all options check: art/imgdiag/create_dirty_image_objects.py -h
+
+# Using all imgdiag files:
+art/imgdiag/create_dirty_image_objects.py ./imgdiag_*
+
+# Or using only specified files:
+art/imgdiag/create_dirty_image_objects.py \
+  ./imgdiag_system_server.txt \
+  ./imgdiag_com.android.systemui.txt \
+  ./imgdiag_com.google.android.gms.txt \
+  ./imgdiag_com.google.android.gms.persistent.txt \
+  ./imgdiag_com.google.android.gms.ui.txt \
+  ./imgdiag_com.google.android.gms.unstable.txt
+```
+
+The resulting file will contain a list of dirty objects with optional
+(enabled by default) sort keys in the following format:
+```
+<class_descriptor>[.<reference_field_name>:<reference_field_type>]* [<sort_key>]
+```
+Classes are specified using a descriptor and objects are specified by
+a reference chain starting from a class. Example:
+```
+# Mark FileUtils class as dirty:
+Landroid/os/FileUtils; 4
+# Mark instance of Property class as dirty:
+Landroid/view/View;.SCALE_X:Landroid/util/Property; 4
+```
+If present, sort keys are used to specify the ordering between dirty entries.
+All dirty objects will be placed in the dirty bin of the boot image and sorted
+by the sort\_key values. I.e., dirty entries with sort\_key==N will have lower
+address than entries with sort\_key==N+1.
+
+5. Push new dirty-image-objects to the device.
+
+```
+adb push dirty-image-objects.txt /etc/dirty-image-objects
+```
+
+6. Reinstall ART APEX to update the boot image.
+
+```
+adb install out/dist/com.android.art.apex
+adb reboot
+```
+
+At this point the device should have new `boot.art` with optimized dirty object layout.
+This can be checked by collecting imgdiag output again and comparing dirty page counts to the previous run.
diff --git a/imgdiag/imgdiag.cc b/imgdiag/imgdiag.cc
index e3310e9..adadfcf 100644
--- a/imgdiag/imgdiag.cc
+++ b/imgdiag/imgdiag.cc
@@ -14,8 +14,12 @@
  * limitations under the License.
  */
 
+#include <android-base/parseint.h>
+#include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 
 #include <functional>
 #include <map>
@@ -26,9 +30,7 @@
 #include <unordered_set>
 #include <vector>
 
-#include <android-base/parseint.h>
 #include "android-base/stringprintf.h"
-
 #include "art_field-inl.h"
 #include "art_method-inl.h"
 #include "base/array_ref.h"
@@ -36,22 +38,19 @@
 #include "base/string_view_cpp20.h"
 #include "base/unix_file/fd_file.h"
 #include "class_linker.h"
+#include "cmdline.h"
 #include "gc/heap.h"
 #include "gc/space/image_space.h"
-#include "image-inl.h"
 #include "mirror/class-inl.h"
 #include "mirror/object-inl.h"
-#include "oat.h"
-#include "oat_file.h"
-#include "oat_file_manager.h"
-#include "scoped_thread_state_change-inl.h"
-
+#include "mirror/object-refvisitor-inl.h"
+#include "oat/image-inl.h"
+#include "oat/oat.h"
+#include "oat/oat_file.h"
+#include "oat/oat_file_manager.h"
+#include "page_util.h"
 #include "procinfo/process_map.h"
-#include "cmdline.h"
-
-#include <signal.h>
-#include <sys/stat.h>
-#include <sys/types.h>
+#include "scoped_thread_state_change-inl.h"
 
 namespace art {
 
@@ -230,9 +229,9 @@
 // Print all pages the entry belongs to
 void PrintEntryPages(uintptr_t entry_address, size_t entry_size, std::ostream& os) {
     const char* tabs = "    ";
-    const uintptr_t first_page_idx = entry_address / kPageSize;
+    const uintptr_t first_page_idx = entry_address / MemMap::GetPageSize();
     const uintptr_t last_page_idx = RoundUp(entry_address + entry_size,
-                                            kObjectAlignment) / kPageSize;
+                                            kObjectAlignment) / MemMap::GetPageSize();
     for (uintptr_t page_idx = first_page_idx; page_idx <= last_page_idx; ++page_idx) {
       os << tabs << "page_idx=" << page_idx << "\n";
     }
@@ -299,13 +298,14 @@
     uintptr_t entry_address = reinterpret_cast<uintptr_t>(entry);
     // Iterate every page this entry belongs to
     do {
-      current_page_idx = entry_address / kPageSize + page_off;
+      current_page_idx = entry_address / MemMap::GetPageSize() + page_off;
       if (dirty_pages.find(current_page_idx) != dirty_pages.end()) {
         // This entry is on a dirty page
         return true;
       }
       page_off++;
-    } while ((current_page_idx * kPageSize) < RoundUp(entry_address + size, kObjectAlignment));
+    } while ((current_page_idx * MemMap::GetPageSize()) < RoundUp(entry_address + size,
+                                                                  kObjectAlignment));
     return false;
   }
 
@@ -353,18 +353,65 @@
 class RegionSpecializedBase : public RegionCommon<T> {
 };
 
+// Calls VisitFunc for each non-null (reference)Object/ArtField pair.
+// Doesn't work with ObjectArray instances, because array elements don't have ArtField.
+class ReferenceFieldVisitor {
+ public:
+  using VisitFunc = std::function<void(mirror::Object&, ArtField&)>;
+
+  explicit ReferenceFieldVisitor(VisitFunc visit_func) : visit_func_(std::move(visit_func)) {}
+
+  void operator()(ObjPtr<mirror::Object> obj, MemberOffset offset, bool is_static) const
+      REQUIRES_SHARED(Locks::mutator_lock_) {
+    CHECK(!obj->IsObjectArray());
+    mirror::Object* field_obj = obj->GetFieldObject<mirror::Object>(offset);
+    // Skip fields that contain null.
+    if (field_obj == nullptr) {
+      return;
+    }
+    // Skip self references.
+    if (field_obj == obj.Ptr()) {
+      return;
+    }
+
+    ArtField* field = nullptr;
+    // Don't use Object::FindFieldByOffset, because it can't find instance fields in classes.
+    // field = obj->FindFieldByOffset(offset);
+    if (is_static) {
+      CHECK(obj->IsClass());
+      field = ArtField::FindStaticFieldWithOffset(obj->AsClass(), offset.Uint32Value());
+    } else {
+      field = ArtField::FindInstanceFieldWithOffset(obj->GetClass(), offset.Uint32Value());
+    }
+    CHECK(field != nullptr);
+    visit_func_(*field_obj, *field);
+  }
+
+  void operator()([[maybe_unused]] ObjPtr<mirror::Class> klass, ObjPtr<mirror::Reference> ref) const
+      REQUIRES_SHARED(Locks::mutator_lock_) {
+    operator()(ref, mirror::Reference::ReferentOffset(), /* is_static */ false);
+  }
+
+  [[noreturn]] void VisitRootIfNonNull(
+      [[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const
+      REQUIRES_SHARED(Locks::mutator_lock_) {
+    UNREACHABLE();
+  }
+
+  [[noreturn]] void VisitRoot([[maybe_unused]] mirror::CompressedReference<mirror::Object>* root)
+      const REQUIRES_SHARED(Locks::mutator_lock_) {
+    UNREACHABLE();
+  }
+
+ private:
+  VisitFunc visit_func_;
+};
+
 // Region analysis for mirror::Objects
 class ImgObjectVisitor : public ObjectVisitor {
  public:
-  using ComputeDirtyFunc = std::function<void(mirror::Object* object,
-                                              const uint8_t* begin_image_ptr,
-                                              const std::set<size_t>& dirty_pages)>;
-  ImgObjectVisitor(ComputeDirtyFunc dirty_func,
-                   const uint8_t* begin_image_ptr,
-                   const std::set<size_t>& dirty_pages) :
-    dirty_func_(std::move(dirty_func)),
-    begin_image_ptr_(begin_image_ptr),
-    dirty_pages_(dirty_pages) { }
+  using ComputeDirtyFunc = std::function<void(mirror::Object* object)>;
+  explicit ImgObjectVisitor(ComputeDirtyFunc dirty_func) : dirty_func_(std::move(dirty_func)) {}
 
   ~ImgObjectVisitor() override { }
 
@@ -376,15 +423,138 @@
     if (kUseBakerReadBarrier) {
       object->AssertReadBarrierState();
     }
-    dirty_func_(object, begin_image_ptr_, dirty_pages_);
+    dirty_func_(object);
   }
 
  private:
   const ComputeDirtyFunc dirty_func_;
-  const uint8_t* begin_image_ptr_;
-  const std::set<size_t>& dirty_pages_;
 };
 
+struct ParentInfo {
+  mirror::Object* parent = nullptr;
+  // Field name and type of the parent object in the format: <field_name>:<field_type_descriptor>
+  // Note: <field_name> can be an integer if parent is an Array object.
+  std::string path;
+};
+
+using ParentMap = std::unordered_map<mirror::Object*, ParentInfo>;
+
+// Returns the "path" from root class to an object in the format:
+// <class_descriptor>(.<field_name>:<field_type_descriptor>)*
+std::string GetPathFromClass(mirror::Object* obj, const ParentMap& parent_map)
+    REQUIRES_SHARED(Locks::mutator_lock_) {
+  auto parent_info_it = parent_map.find(obj);
+  std::string path;
+  while (parent_info_it != parent_map.end() && parent_info_it->second.parent != nullptr) {
+    const ParentInfo& parent_info = parent_info_it->second;
+    path = ART_FORMAT(".{}{}", parent_info.path, path);
+    parent_info_it = parent_map.find(parent_info.parent);
+  }
+
+  if (parent_info_it == parent_map.end()) {
+    return "<no path from class>";
+  }
+
+  mirror::Object* class_obj = parent_info_it->first;
+  CHECK(class_obj->IsClass());
+
+  std::string temp;
+  path = class_obj->AsClass()->GetDescriptor(&temp) + path;
+  return path;
+}
+
+// Calculate a map of: object -> parent and parent field that refers to the object.
+// Class objects are considered roots, they have entries in the parent_map, but their parent==null.
+ParentMap CalculateParentMap(const std::vector<const ImageHeader*>& image_headers)
+    REQUIRES_SHARED(Locks::mutator_lock_) {
+  ParentMap parent_map;
+  std::vector<mirror::Object*> next;
+
+  // Collect all Class objects.
+  ImgObjectVisitor collect_classes_visitor(
+      [&](mirror::Object* entry) REQUIRES_SHARED(Locks::mutator_lock_) {
+        if (entry->IsClass() && parent_map.count(entry) == 0) {
+          parent_map[entry] = ParentInfo{};
+          next.push_back(entry);
+        }
+      });
+  for (const ImageHeader* image_header : image_headers) {
+    uint8_t* image_begin = image_header->GetImageBegin();
+    PointerSize pointer_size = image_header->GetPointerSize();
+    image_header->VisitObjects(&collect_classes_visitor, image_begin, pointer_size);
+  }
+
+  auto process_object_fields = [&parent_map, &next](mirror::Object* parent_obj)
+      REQUIRES_SHARED(Locks::mutator_lock_) {
+    CHECK(!parent_obj->IsObjectArray());
+    ReferenceFieldVisitor::VisitFunc visit_func =
+        [&](mirror::Object& ref_obj, ArtField& ref_field) REQUIRES_SHARED(Locks::mutator_lock_) {
+          if (parent_map.count(&ref_obj) == 0) {
+            std::string path =
+                ART_FORMAT("{}:{}", ref_field.GetName(), ref_field.GetTypeDescriptor());
+            parent_map[&ref_obj] = ParentInfo{parent_obj, path};
+            next.push_back(&ref_obj);
+          }
+        };
+    ReferenceFieldVisitor visitor(visit_func);
+    parent_obj->VisitReferences</*kVisitNativeRoots=*/false, kVerifyNone, kWithoutReadBarrier>(
+        visitor, visitor);
+  };
+  auto process_array_elements = [&parent_map, &next](mirror::Object* parent_obj)
+      REQUIRES_SHARED(Locks::mutator_lock_) {
+    CHECK(parent_obj->IsObjectArray());
+    ObjPtr<mirror::ObjectArray<mirror::Object>> array = parent_obj->AsObjectArray<mirror::Object>();
+
+    const int32_t length = array->GetLength();
+    for (int32_t i = 0; i < length; ++i) {
+      ObjPtr<mirror::Object> elem = array->Get(i);
+      if (elem != nullptr && parent_map.count(elem.Ptr()) == 0) {
+        std::string temp;
+        std::string path = ART_FORMAT("{}:{}", i, elem->GetClass()->GetDescriptor(&temp));
+        parent_map[elem.Ptr()] = ParentInfo{parent_obj, path};
+        next.push_back(elem.Ptr());
+      }
+    }
+  };
+
+  // Use DFS to traverse all objects that are reachable from classes.
+  while (!next.empty()) {
+    mirror::Object* parent_obj = next.back();
+    next.pop_back();
+
+    // Array elements don't have ArtField, handle them separately.
+    if (parent_obj->IsObjectArray()) {
+      process_array_elements(parent_obj);
+    } else {
+      process_object_fields(parent_obj);
+    }
+  }
+
+  return parent_map;
+}
+
+// Count non-string objects that are not reachable from classes.
+// Strings are skipped because they are considered clean in dex2oat and not used for dirty
+// object layout optimization.
+size_t CountUnreachableObjects(const std::unordered_map<mirror::Object*, ParentInfo>& parent_map,
+                               const std::vector<const ImageHeader*>& image_headers)
+    REQUIRES_SHARED(Locks::mutator_lock_) {
+  size_t non_reachable = 0;
+  ImgObjectVisitor count_non_reachable_visitor(
+      [&](mirror::Object* entry) REQUIRES_SHARED(Locks::mutator_lock_) {
+        if (parent_map.count(entry) == 0 && !entry->IsString()) {
+          non_reachable += 1;
+        }
+      });
+  for (const ImageHeader* image_header : image_headers) {
+    uint8_t* image_begin = image_header->GetImageBegin();
+    PointerSize pointer_size = image_header->GetPointerSize();
+    image_header->VisitObjects(&count_non_reachable_visitor, image_begin, pointer_size);
+  }
+
+  return non_reachable;
+}
+
 template<>
 class RegionSpecializedBase<mirror::Object> : public RegionCommon<mirror::Object> {
  public:
@@ -393,10 +563,12 @@
                         ArrayRef<uint8_t> zygote_contents,
                         const android::procinfo::MapInfo& boot_map,
                         const ImageHeader& image_header,
+                        const ParentMap& parent_map,
                         bool dump_dirty_objects)
       : RegionCommon<mirror::Object>(os, remote_contents, zygote_contents, boot_map, image_header),
         os_(*os),
-        dump_dirty_objects_(dump_dirty_objects) { }
+        dump_dirty_objects_(dump_dirty_objects),
+        parent_map_(parent_map) {}
 
   // Define a common public type name for use by RegionData.
   using VisitorClass = ImgObjectVisitor;
@@ -405,7 +577,7 @@
                     uint8_t* base,
                     PointerSize pointer_size)
       REQUIRES_SHARED(Locks::mutator_lock_) {
-    RegionCommon<mirror::Object>::image_header_.VisitObjects(visitor, base, pointer_size);
+    image_header_.VisitObjects(visitor, base, pointer_size);
   }
 
   void VisitEntry(mirror::Object* entry)
@@ -450,23 +622,19 @@
   void DiffEntryContents(mirror::Object* entry,
                          uint8_t* remote_bytes,
                          const uint8_t* base_ptr,
-                         bool log_dirty_objects,
-                         size_t entry_offset) REQUIRES_SHARED(Locks::mutator_lock_) {
+                         bool log_dirty_objects) REQUIRES_SHARED(Locks::mutator_lock_) {
     const char* tabs = "    ";
     // Attempt to find fields for all dirty bytes.
     mirror::Class* klass = entry->GetClass();
     std::string temp;
     if (entry->IsClass()) {
-      os_ << tabs
-          << "Class " << mirror::Class::PrettyClass(entry->AsClass()) << " " << entry << "\n";
-      os_ << tabs << "dirty_obj: " << entry_offset << " class "
-          << entry->AsClass()->DescriptorHash() << "\n";
-    } else {
-      os_ << tabs
-          << "Instance of " << mirror::Class::PrettyClass(klass) << " " << entry << "\n";
-      os_ << tabs << "dirty_obj: " << entry_offset << " instance " << klass->DescriptorHash()
+      os_ << tabs << "Class " << mirror::Class::PrettyClass(entry->AsClass()) << " " << entry
           << "\n";
+    } else {
+      os_ << tabs << "Instance of " << mirror::Class::PrettyClass(klass) << " " << entry << "\n";
     }
+    std::string path_from_root = GetPathFromClass(entry, parent_map_);
+    os_ << "dirty_obj: " << path_from_root << "\n";
     PrintEntryPages(reinterpret_cast<uintptr_t>(entry), EntrySize(entry), os_);
 
     std::unordered_set<ArtField*> dirty_instance_fields;
@@ -670,6 +838,7 @@
   bool dump_dirty_objects_;
   std::unordered_set<mirror::Object*> dirty_objects_;
   std::map<mirror::Class*, ClassData> class_data_;
+  const ParentMap& parent_map_;
 
   DISALLOW_COPY_AND_ASSIGN(RegionSpecializedBase);
 };
@@ -677,23 +846,12 @@
 // Region analysis for ArtMethods.
 class ImgArtMethodVisitor {
  public:
-  using ComputeDirtyFunc = std::function<void(ArtMethod*,
-                                              const uint8_t*,
-                                              const std::set<size_t>&)>;
-  ImgArtMethodVisitor(ComputeDirtyFunc dirty_func,
-                      const uint8_t* begin_image_ptr,
-                      const std::set<size_t>& dirty_pages) :
-    dirty_func_(std::move(dirty_func)),
-    begin_image_ptr_(begin_image_ptr),
-    dirty_pages_(dirty_pages) { }
-  void operator()(ArtMethod& method) const {
-    dirty_func_(&method, begin_image_ptr_, dirty_pages_);
-  }
+  using ComputeDirtyFunc = std::function<void(ArtMethod*)>;
+  explicit ImgArtMethodVisitor(ComputeDirtyFunc dirty_func) : dirty_func_(std::move(dirty_func)) {}
+  void operator()(ArtMethod& method) const { dirty_func_(&method); }
 
  private:
   const ComputeDirtyFunc dirty_func_;
-  const uint8_t* begin_image_ptr_;
-  const std::set<size_t>& dirty_pages_;
 };
 
 // Struct and functor for computing offsets of members of ArtMethods.
@@ -728,7 +886,8 @@
                         ArrayRef<uint8_t> zygote_contents,
                         const android::procinfo::MapInfo& boot_map,
                         const ImageHeader& image_header,
-                        bool dump_dirty_objects ATTRIBUTE_UNUSED)
+                        [[maybe_unused]] const ParentMap& parent_map,
+                        [[maybe_unused]] bool dump_dirty_objects)
       : RegionCommon<ArtMethod>(os, remote_contents, zygote_contents, boot_map, image_header),
         os_(*os) {
     // Prepare the table for offset to member lookups.
@@ -749,12 +908,9 @@
     RegionCommon<ArtMethod>::image_header_.VisitPackedArtMethods(*visitor, base, pointer_size);
   }
 
-  void VisitEntry(ArtMethod* method ATTRIBUTE_UNUSED)
-      REQUIRES_SHARED(Locks::mutator_lock_) {
-  }
+  void VisitEntry([[maybe_unused]] ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_) {}
 
-  void AddCleanEntry(ArtMethod* method ATTRIBUTE_UNUSED) {
-  }
+  void AddCleanEntry([[maybe_unused]] ArtMethod* method) {}
 
   void AddFalseDirtyEntry(ArtMethod* method)
       REQUIRES_SHARED(Locks::mutator_lock_) {
@@ -781,8 +937,7 @@
   void DiffEntryContents(ArtMethod* method,
                          uint8_t* remote_bytes,
                          const uint8_t* base_ptr,
-                         bool log_dirty_objects ATTRIBUTE_UNUSED,
-                         size_t entry_offset ATTRIBUTE_UNUSED)
+                         [[maybe_unused]] bool log_dirty_objects)
       REQUIRES_SHARED(Locks::mutator_lock_) {
     const char* tabs = "    ";
     os_ << tabs << "ArtMethod " << ArtMethod::PrettyMethod(method) << "\n";
@@ -970,12 +1125,14 @@
              ArrayRef<uint8_t> zygote_contents,
              const android::procinfo::MapInfo& boot_map,
              const ImageHeader& image_header,
+             const ParentMap& parent_map,
              bool dump_dirty_objects)
       : RegionSpecializedBase<T>(os,
                                  remote_contents,
                                  zygote_contents,
                                  boot_map,
                                  image_header,
+                                 parent_map,
                                  dump_dirty_objects),
         os_(*os) {
     CHECK(!remote_contents.empty());
@@ -988,13 +1145,9 @@
                      const uint8_t* begin_image_ptr)
       REQUIRES_SHARED(Locks::mutator_lock_) {
     typename RegionSpecializedBase<T>::VisitorClass visitor(
-        [this](T* entry,
-               const uint8_t* begin_image_ptr,
-               const std::set<size_t>& dirty_page_set) REQUIRES_SHARED(Locks::mutator_lock_) {
-          this->ComputeEntryDirty(entry, begin_image_ptr, dirty_page_set);
-        },
-        begin_image_ptr,
-        mapping_data.dirty_page_set);
+        [this, begin_image_ptr, &mapping_data](T* entry) REQUIRES_SHARED(Locks::mutator_lock_) {
+          this->ComputeEntryDirty(entry, begin_image_ptr, mapping_data.dirty_page_set);
+        });
     PointerSize pointer_size = InstructionSetPointerSize(Runtime::Current()->GetInstructionSet());
     RegionSpecializedBase<T>::VisitEntries(&visitor,
                                            const_cast<uint8_t*>(begin_image_ptr),
@@ -1003,7 +1156,8 @@
     // Looking at only dirty pages, figure out how many of those bytes belong to dirty entries.
     // TODO: fix this now that there are multiple regions in a mapping.
     float true_dirtied_percent =
-        RegionCommon<T>::GetDirtyEntryBytes() * 1.0f / (mapping_data.dirty_pages * kPageSize);
+        (RegionCommon<T>::GetDirtyEntryBytes() * 1.0f) /
+        (mapping_data.dirty_pages * MemMap::GetPageSize());
 
     // Entry specific statistics.
     os_ << RegionCommon<T>::GetDifferentEntryCount() << " different entries, \n  "
@@ -1054,7 +1208,7 @@
       ptrdiff_t offset = entry_bytes - begin_image_ptr;
       uint8_t* remote_bytes = &contents[offset];
       RegionSpecializedBase<T>::DiffEntryContents(
-          entry, remote_bytes, &base_ptr[offset], log_dirty_objects, static_cast<size_t>(offset));
+          entry, remote_bytes, &base_ptr[offset], log_dirty_objects);
     }
   }
 
@@ -1223,8 +1377,9 @@
     return true;
   }
 
-  bool Dump(const ImageHeader& image_header, const std::string& image_location)
-      REQUIRES_SHARED(Locks::mutator_lock_) {
+  bool Dump(const ImageHeader& image_header,
+            const std::string& image_location,
+            const ParentMap& parent_map) REQUIRES_SHARED(Locks::mutator_lock_) {
     std::ostream& os = *os_;
     os << "IMAGE LOCATION: " << image_location << "\n\n";
 
@@ -1237,7 +1392,7 @@
     PrintPidLine("ZYGOTE", zygote_diff_pid_);
     bool ret = true;
     if (image_diff_pid_ >= 0 || zygote_diff_pid_ >= 0) {
-      ret = DumpImageDiff(image_header, image_location);
+      ret = DumpImageDiff(image_header, image_location, parent_map);
       os << "\n\n";
     }
 
@@ -1247,9 +1402,10 @@
   }
 
  private:
-  bool DumpImageDiff(const ImageHeader& image_header, const std::string& image_location)
-      REQUIRES_SHARED(Locks::mutator_lock_) {
-    return DumpImageDiffMap(image_header, image_location);
+  bool DumpImageDiff(const ImageHeader& image_header,
+                     const std::string& image_location,
+                     const ParentMap& parent_map) REQUIRES_SHARED(Locks::mutator_lock_) {
+    return DumpImageDiffMap(image_header, image_location, parent_map);
   }
 
   bool ComputeDirtyBytes(const ImageHeader& image_header,
@@ -1259,7 +1415,7 @@
                          MappingData* mapping_data /*out*/,
                          std::string* error_msg /*out*/) {
     // Iterate through one page at a time. Boot map begin/end already implicitly aligned.
-    for (uintptr_t begin = boot_map.start; begin != boot_map.end; begin += kPageSize) {
+    for (uintptr_t begin = boot_map.start; begin != boot_map.end; begin += MemMap::GetPageSize()) {
       const ptrdiff_t offset = begin - boot_map.start;
 
       // We treat the image header as part of the memory map for now
@@ -1268,11 +1424,11 @@
       const uint8_t* zygote_ptr = &zygote_contents[offset];
       const uint8_t* remote_ptr = &remote_contents[offset];
 
-      if (memcmp(zygote_ptr, remote_ptr, kPageSize) != 0) {
+      if (memcmp(zygote_ptr, remote_ptr, MemMap::GetPageSize()) != 0) {
         mapping_data->different_pages++;
 
         // Count the number of 32-bit integers that are different.
-        for (size_t i = 0; i < kPageSize / sizeof(uint32_t); ++i) {
+        for (size_t i = 0; i < MemMap::GetPageSize() / sizeof(uint32_t); ++i) {
           const uint32_t* remote_ptr_int32 = reinterpret_cast<const uint32_t*>(remote_ptr);
           const uint32_t* zygote_ptr_int32 = reinterpret_cast<const uint32_t*>(zygote_ptr);
 
@@ -1281,7 +1437,7 @@
           }
         }
         // Count the number of bytes that are different.
-        for (size_t i = 0; i < kPageSize; ++i) {
+        for (size_t i = 0; i < MemMap::GetPageSize(); ++i) {
           if (remote_ptr[i] != zygote_ptr[i]) {
             mapping_data->different_bytes++;
           }
@@ -1289,22 +1445,22 @@
       }
     }
 
-    for (uintptr_t begin = boot_map.start; begin != boot_map.end; begin += kPageSize) {
+    for (uintptr_t begin = boot_map.start; begin != boot_map.end; begin += MemMap::GetPageSize()) {
       ptrdiff_t offset = begin - boot_map.start;
 
       // Virtual page number (for an absolute memory address)
-      size_t virtual_page_idx = begin / kPageSize;
+      size_t virtual_page_idx = begin / MemMap::GetPageSize();
 
       uint64_t page_count = 0xC0FFEE;
       // TODO: virtual_page_idx needs to be from the same process
-      int dirtiness = (IsPageDirty(&image_pagemap_file_,     // Image-diff-pid procmap
-                                   &zygote_pagemap_file_,    // Zygote procmap
-                                   &kpageflags_file_,
-                                   &kpagecount_file_,
+      int dirtiness = (IsPageDirty(image_pagemap_file_,   // Image-diff-pid procmap
+                                   zygote_pagemap_file_,  // Zygote procmap
+                                   kpageflags_file_,
+                                   kpagecount_file_,
                                    virtual_page_idx,  // compare same page in image
                                    virtual_page_idx,  // and zygote
-                                   &page_count,
-                                   error_msg));
+                                   /*out*/ page_count,
+                                   /*out*/ *error_msg));
       if (dirtiness < 0) {
         return false;
       } else if (dirtiness > 0) {
@@ -1360,8 +1516,9 @@
   }
 
   // Look at /proc/$pid/mem and only diff the things from there
-  bool DumpImageDiffMap(const ImageHeader& image_header, const std::string& image_location)
-      REQUIRES_SHARED(Locks::mutator_lock_) {
+  bool DumpImageDiffMap(const ImageHeader& image_header,
+                        const std::string& image_location,
+                        const ParentMap& parent_map) REQUIRES_SHARED(Locks::mutator_lock_) {
     std::ostream& os = *os_;
     std::string error_msg;
 
@@ -1400,7 +1557,7 @@
 
     // Adjust the `end` of the mapping. Some other mappings may have been
     // inserted within the image.
-    boot_map.end = RoundUp(boot_map.start + image_header.GetImageSize(), kPageSize);
+    boot_map.end = RoundUp(boot_map.start + image_header.GetImageSize(), MemMap::GetPageSize());
     // The size of the boot image mapping.
     size_t boot_map_size = boot_map.end - boot_map.start;
 
@@ -1414,7 +1571,8 @@
       android::procinfo::MapInfo& zygote_boot_map = *maybe_zygote_boot_map;
       // Adjust the `end` of the mapping. Some other mappings may have been
       // inserted within the image.
-      zygote_boot_map.end = RoundUp(zygote_boot_map.start + image_header.GetImageSize(), kPageSize);
+      zygote_boot_map.end = RoundUp(zygote_boot_map.start + image_header.GetImageSize(),
+                                    MemMap::GetPageSize());
       if (zygote_boot_map.start != boot_map.start) {
         os << "Zygote boot map does not match image boot map: "
            << "zygote begin " << reinterpret_cast<const void*>(zygote_boot_map.start)
@@ -1434,8 +1592,8 @@
     const uint8_t* image_end_unaligned = image_begin_unaligned + image_header.GetImageSize();
 
     // Adjust range to nearest page
-    const uint8_t* image_begin = AlignDown(image_begin_unaligned, kPageSize);
-    const uint8_t* image_end = AlignUp(image_end_unaligned, kPageSize);
+    const uint8_t* image_begin = AlignDown(image_begin_unaligned, MemMap::GetPageSize());
+    const uint8_t* image_end = AlignUp(image_end_unaligned, MemMap::GetPageSize());
 
     size_t image_size = image_end - image_begin;
     if (image_size != boot_map_size) {
@@ -1448,8 +1606,8 @@
     auto read_contents = [&](File* mem_file,
                              /*out*/ MemMap* map,
                              /*out*/ ArrayRef<uint8_t>* contents) {
-      DCHECK_ALIGNED(boot_map.start, kPageSize);
-      DCHECK_ALIGNED(boot_map_size, kPageSize);
+      DCHECK_ALIGNED_PARAM(boot_map.start, MemMap::GetPageSize());
+      DCHECK_ALIGNED_PARAM(boot_map_size, MemMap::GetPageSize());
       std::string name = "Contents of " + mem_file->GetPath();
       std::string local_error_msg;
       // We need to use low 4 GiB memory so that we can walk the objects using standard
@@ -1530,6 +1688,7 @@
                                                   zygote_contents,
                                                   boot_map,
                                                   image_header,
+                                                  parent_map,
                                                   dump_dirty_objects_);
     object_region_data.ProcessRegion(mapping_data,
                                      remotes,
@@ -1541,6 +1700,7 @@
                                                 zygote_contents,
                                                 boot_map,
                                                 image_header,
+                                                parent_map,
                                                 dump_dirty_objects_);
     artmethod_region_data.ProcessRegion(mapping_data,
                                         remotes,
@@ -1548,126 +1708,42 @@
     return true;
   }
 
-  // Note: On failure, `*page_frame_number` shall be clobbered.
-  static bool GetPageFrameNumber(File* page_map_file,
-                                 size_t virtual_page_index,
-                                 /*out*/ uint64_t* page_frame_number,
-                                 /*out*/ std::string* error_msg) {
-    CHECK(page_frame_number != nullptr);
-    return GetPageFrameNumbers(page_map_file,
-                               virtual_page_index,
-                               ArrayRef<uint64_t>(page_frame_number, 1u),
-                               error_msg);
-  }
-
-  // Note: On failure, `page_frame_numbers[.]` shall be clobbered.
-  static bool GetPageFrameNumbers(File* page_map_file,
-                                  size_t virtual_page_index,
-                                  /*out*/ ArrayRef<uint64_t> page_frame_numbers,
-                                  /*out*/ std::string* error_msg) {
-    CHECK(page_map_file != nullptr);
-    CHECK_NE(page_frame_numbers.size(), 0u);
-    CHECK(page_frame_numbers.data() != nullptr);
-    CHECK(error_msg != nullptr);
-
-    // Read 64-bit entries from /proc/$pid/pagemap to get the physical page frame numbers.
-    if (!page_map_file->PreadFully(page_frame_numbers.data(),
-                                   page_frame_numbers.size() * kPageMapEntrySize,
-                                   virtual_page_index * kPageMapEntrySize)) {
-      *error_msg = StringPrintf("Failed to read the virtual page index entries from %s, error: %s",
-                                page_map_file->GetPath().c_str(),
-                                strerror(errno));
-      return false;
-    }
-
-    // Extract page frame numbers from pagemap entries.
-    for (uint64_t& page_frame_number : page_frame_numbers) {
-      page_frame_number &= kPageFrameNumberMask;
-    }
-
-    return true;
-  }
-
-  // Note: On failure, `page_flags_or_counts[.]` shall be clobbered.
-  static bool GetPageFlagsOrCounts(File* kpage_file,
-                                   ArrayRef<const uint64_t> page_frame_numbers,
-                                   /*out*/ ArrayRef<uint64_t> page_flags_or_counts,
-                                   /*out*/ std::string* error_msg) {
-    static_assert(kPageFlagsEntrySize == kPageCountEntrySize, "entry size check");
-    CHECK_NE(page_frame_numbers.size(), 0u);
-    CHECK_EQ(page_flags_or_counts.size(), page_frame_numbers.size());
-    CHECK(kpage_file != nullptr);
-    CHECK(page_frame_numbers.data() != nullptr);
-    CHECK(page_flags_or_counts.data() != nullptr);
-    CHECK(error_msg != nullptr);
-
-    size_t size = page_frame_numbers.size();
-    size_t i = 0;
-    while (i != size) {
-      size_t start = i;
-      ++i;
-      while (i != size && page_frame_numbers[i] - page_frame_numbers[start] == i - start) {
-        ++i;
-      }
-      // Read 64-bit entries from /proc/kpageflags or /proc/kpagecount.
-      if (!kpage_file->PreadFully(page_flags_or_counts.data() + start,
-                                  (i - start) * kPageMapEntrySize,
-                                  page_frame_numbers[start] * kPageFlagsEntrySize)) {
-        *error_msg = StringPrintf("Failed to read the page flags or counts from %s, error: %s",
-                                  kpage_file->GetPath().c_str(),
-                                  strerror(errno));
-        return false;
-      }
-    }
-
-    return true;
-  }
-
-  static int IsPageDirty(File* page_map_file,
-                         File* clean_pagemap_file,
-                         File* kpageflags_file,
-                         File* kpagecount_file,
+  static int IsPageDirty(File& page_map_file,
+                         File& clean_pagemap_file,
+                         File& kpageflags_file,
+                         File& kpagecount_file,
                          size_t virtual_page_idx,
                          size_t clean_virtual_page_idx,
                          // Out parameters:
-                         uint64_t* page_count, std::string* error_msg) {
-    CHECK(page_map_file != nullptr);
-    CHECK(clean_pagemap_file != nullptr);
-    CHECK_NE(page_map_file, clean_pagemap_file);
-    CHECK(kpageflags_file != nullptr);
-    CHECK(kpagecount_file != nullptr);
-    CHECK(page_count != nullptr);
-    CHECK(error_msg != nullptr);
+                         uint64_t& page_count,
+                         std::string& error_msg) {
+    // Check that files are not the same. Note that actual file paths can be equal, such as in
+    // ImgDiagTest.ImageDiffPidSelf, where imgdiag compares memory pages against itself.
+    // CHECK_NE(page_map_file.GetPath(), clean_pagemap_file.GetPath());
+    CHECK_NE(&page_map_file, &clean_pagemap_file);
 
     // Constants are from https://www.kernel.org/doc/Documentation/vm/pagemap.txt
 
     uint64_t page_frame_number = 0;
-    if (!GetPageFrameNumber(page_map_file, virtual_page_idx, &page_frame_number, error_msg)) {
+    if (!GetPageFrameNumber(page_map_file, virtual_page_idx, page_frame_number, error_msg)) {
       return -1;
     }
 
     uint64_t page_frame_number_clean = 0;
-    if (!GetPageFrameNumber(clean_pagemap_file, clean_virtual_page_idx, &page_frame_number_clean,
-                            error_msg)) {
+    if (!GetPageFrameNumber(
+            clean_pagemap_file, clean_virtual_page_idx, page_frame_number_clean, error_msg)) {
       return -1;
     }
 
     // Read 64-bit entry from /proc/kpageflags to get the dirty bit for a page
     uint64_t kpage_flags_entry = 0;
-    if (!kpageflags_file->PreadFully(&kpage_flags_entry,
-                                     kPageFlagsEntrySize,
-                                     page_frame_number * kPageFlagsEntrySize)) {
-      *error_msg = StringPrintf("Failed to read the page flags from %s",
-                                kpageflags_file->GetPath().c_str());
+    if (!GetPageFlagsOrCount(
+            kpageflags_file, page_frame_number, /*out*/ kpage_flags_entry, error_msg)) {
       return -1;
     }
 
     // Read 64-bit entyry from /proc/kpagecount to get mapping counts for a page
-    if (!kpagecount_file->PreadFully(page_count /*out*/,
-                                     kPageCountEntrySize,
-                                     page_frame_number * kPageCountEntrySize)) {
-      *error_msg = StringPrintf("Failed to read the page count from %s",
-                                kpagecount_file->GetPath().c_str());
+    if (!GetPageFlagsOrCount(kpagecount_file, page_frame_number, /*out*/ page_count, error_msg)) {
       return -1;
     }
 
@@ -1676,21 +1752,6 @@
     // The page frame must be memory mapped
     CHECK_NE(kpage_flags_entry & kPageFlagsMmapMask, 0u);
 
-    // Page is dirty, i.e. has diverged from file, if the 4th bit is set to 1
-    bool flags_dirty = (kpage_flags_entry & kPageFlagsDirtyMask) != 0;
-
-    // page_frame_number_clean must come from the *same* process
-    // but a *different* mmap than page_frame_number
-    if (flags_dirty) {
-      // FIXME: This check sometimes fails and the reason is not understood. b/123852774
-      if (page_frame_number != page_frame_number_clean) {
-        LOG(ERROR) << "Check failed: page_frame_number != page_frame_number_clean "
-            << "(page_frame_number=" << page_frame_number
-            << ", page_frame_number_clean=" << page_frame_number_clean << ")"
-            << " count: " << *page_count << " flags: 0x" << std::hex << kpage_flags_entry;
-      }
-    }
-
     return (page_frame_number != page_frame_number_clean) ? 1 : 0;
   }
 
@@ -1717,17 +1778,6 @@
     return BaseName(std::string(image_location));
   }
 
-  static constexpr size_t kPageMapEntrySize = sizeof(uint64_t);
-  // bits 0-54 [in /proc/$pid/pagemap]
-  static constexpr uint64_t kPageFrameNumberMask = (1ULL << 55) - 1;
-
-  static constexpr size_t kPageFlagsEntrySize = sizeof(uint64_t);
-  static constexpr size_t kPageCountEntrySize = sizeof(uint64_t);
-  static constexpr uint64_t kPageFlagsDirtyMask = (1ULL << 4);  // in /proc/kpageflags
-  static constexpr uint64_t kPageFlagsNoPageMask = (1ULL << 20);  // in /proc/kpageflags
-  static constexpr uint64_t kPageFlagsMmapMask = (1ULL << 11);  // in /proc/kpageflags
-
-
   std::ostream* os_;
   pid_t image_diff_pid_;  // Dump image diff against boot.art if pid is non-negative
   pid_t zygote_diff_pid_;  // Dump image diff against zygote boot.art if pid is non-negative
@@ -1772,6 +1822,19 @@
   if (!img_diag_dumper.Init()) {
     return EXIT_FAILURE;
   }
+
+  std::vector<const ImageHeader*> image_headers;
+  for (gc::space::ImageSpace* image_space : image_spaces) {
+    const ImageHeader& image_header = image_space->GetImageHeader();
+    if (!image_header.IsValid()) {
+      continue;
+    }
+    image_headers.push_back(&image_header);
+  }
+  ParentMap parent_map = CalculateParentMap(image_headers);
+  size_t unreachable_objects = CountUnreachableObjects(parent_map, image_headers);
+  *os << "Number of non-string objects not reached from classes: " << unreachable_objects << "\n";
+
   for (gc::space::ImageSpace* image_space : image_spaces) {
     const ImageHeader& image_header = image_space->GetImageHeader();
     if (!image_header.IsValid()) {
@@ -1779,7 +1842,7 @@
       return EXIT_FAILURE;
     }
 
-    if (!img_diag_dumper.Dump(image_header, image_space->GetImageLocation())) {
+    if (!img_diag_dumper.Dump(image_header, image_space->GetImageLocation(), parent_map)) {
       return EXIT_FAILURE;
     }
   }
diff --git a/imgdiag/page_info.cc b/imgdiag/page_info.cc
new file mode 100644
index 0000000..e5b14d4
--- /dev/null
+++ b/imgdiag/page_info.cc
@@ -0,0 +1,435 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include <functional>
+#include <optional>
+#include <ostream>
+#include <string>
+#include <vector>
+
+#include "android-base/parseint.h"
+#include "android-base/stringprintf.h"
+#include "base/os.h"
+#include "base/unix_file/fd_file.h"
+#include "cmdline.h"
+#include "page_util.h"
+#include "procinfo/process_map.h"
+#include "scoped_thread_state_change-inl.h"
+
+namespace art {
+
+using android::base::StringPrintf;
+
+namespace {
+
+struct ProcFiles {
+  // A File for reading /proc/<pid>/mem.
+  File mem;
+  // A File for reading /proc/<pid>/pagemap.
+  File pagemap;
+  // A File for reading /proc/kpageflags.
+  File kpageflags;
+  // A File for reading /proc/kpagecount.
+  File kpagecount;
+};
+
+bool OpenFile(const char* file_name, /*out*/ File& file, /*out*/ std::string& error_msg) {
+  std::unique_ptr<File> file_ptr = std::unique_ptr<File>{OS::OpenFileForReading(file_name)};
+  if (file_ptr == nullptr) {
+    error_msg = StringPrintf("Failed to open file: %s", file_name);
+    return false;
+  }
+  file = std::move(*file_ptr);
+  return true;
+}
+
+bool OpenProcFiles(pid_t pid, /*out*/ ProcFiles& files, /*out*/ std::string& error_msg) {
+  if (!OpenFile("/proc/kpageflags", files.kpageflags, error_msg)) {
+    return false;
+  }
+  if (!OpenFile("/proc/kpagecount", files.kpagecount, error_msg)) {
+    return false;
+  }
+  std::string mem_file_name =
+      StringPrintf("/proc/%ld/mem", static_cast<long>(pid));  // NOLINT [runtime/int]
+  if (!OpenFile(mem_file_name.c_str(), files.mem, error_msg)) {
+    return false;
+  }
+  std::string pagemap_file_name =
+      StringPrintf("/proc/%ld/pagemap", static_cast<long>(pid));  // NOLINT [runtime/int]
+  if (!OpenFile(pagemap_file_name.c_str(), files.pagemap, error_msg)) {
+    return false;
+  }
+  return true;
+}
+
+void DumpPageInfo(uint64_t virtual_page_index, ProcFiles& proc_files, std::ostream& os,
+                  size_t page_size) {
+  const uint64_t virtual_page_addr = virtual_page_index * page_size;
+  os << "Virtual page index: " << virtual_page_index << "\n";
+  os << "Virtual page addr: " << virtual_page_addr << "\n";
+
+  std::string error_msg;
+  uint64_t page_frame_number = -1;
+  if (!GetPageFrameNumber(
+          proc_files.pagemap, virtual_page_index, /*out*/ page_frame_number, /*out*/ error_msg)) {
+    os << "Failed to get page frame number: " << error_msg << "\n";
+    return;
+  }
+  os << "Page frame number: " << page_frame_number << "\n";
+
+  uint64_t page_count = -1;
+  if (!GetPageFlagsOrCount(proc_files.kpagecount,
+                           page_frame_number,
+                           /*out*/ page_count,
+                           /*out*/ error_msg)) {
+    os << "Failed to get page count: " << error_msg << "\n";
+    return;
+  }
+  os << "kpagecount: " << page_count << "\n";
+
+  uint64_t page_flags = 0;
+  if (!GetPageFlagsOrCount(proc_files.kpageflags,
+                           page_frame_number,
+                           /*out*/ page_flags,
+                           /*out*/ error_msg)) {
+    os << "Failed to get page flags: " << error_msg << "\n";
+    return;
+  }
+  os << "kpageflags: " << page_flags << "\n";
+
+  if (page_count != 0) {
+    std::vector<uint8_t> page_contents(page_size);
+    if (!proc_files.mem.PreadFully(page_contents.data(), page_contents.size(), virtual_page_addr)) {
+      os << "Failed to read page contents\n";
+      return;
+    }
+    os << "Zero bytes: " << std::count(std::begin(page_contents), std::end(page_contents), 0)
+       << "\n";
+  }
+}
+
+struct MapPageCounts {
+  // Present pages count.
+  uint64_t pages = 0;
+  // Non-present pages count.
+  uint64_t non_present_pages = 0;
+  // Private (kpagecount == 1) zero page count.
+  uint64_t private_zero_pages = 0;
+  // Shared (kpagecount > 1) zero page count.
+  uint64_t shared_zero_pages = 0;
+  // Physical frame numbers of zero pages.
+  std::unordered_set<uint64_t> zero_page_pfns;
+
+  // Memory map name.
+  std::string name;
+  // Memory map start address.
+  uint64_t start = 0;
+  // Memory map end address.
+  uint64_t end = 0;
+};
+
+bool GetMapPageCounts(ProcFiles& proc_files,
+                      const android::procinfo::MapInfo& map_info,
+                      MapPageCounts& map_page_counts,
+                      std::string& error_msg,
+                      size_t page_size) {
+  map_page_counts.name = map_info.name;
+  map_page_counts.start = map_info.start;
+  map_page_counts.end = map_info.end;
+  std::vector<uint8_t> page_contents(page_size);
+  for (uint64_t begin = map_info.start; begin < map_info.end; begin += page_size) {
+    const size_t virtual_page_index = begin / page_size;
+    uint64_t page_frame_number = -1;
+    if (!GetPageFrameNumber(proc_files.pagemap, virtual_page_index, page_frame_number, error_msg)) {
+      return false;
+    }
+    uint64_t page_count = -1;
+    if (!GetPageFlagsOrCounts(proc_files.kpagecount,
+                              ArrayRef<const uint64_t>(&page_frame_number, 1),
+                              /*out*/ ArrayRef<uint64_t>(&page_count, 1),
+                              /*out*/ error_msg)) {
+      return false;
+    }
+
+    const auto is_zero_page = [](const std::vector<uint8_t>& page) {
+      const auto non_zero_it =
+          std::find_if(std::begin(page), std::end(page), [](uint8_t b) { return b != 0; });
+      return non_zero_it == std::end(page);
+    };
+
+    if (page_count == 0) {
+      map_page_counts.non_present_pages += 1;
+      continue;
+    }
+
+    // Handle present page.
+    if (!proc_files.mem.PreadFully(page_contents.data(), page_contents.size(), begin)) {
+      error_msg = StringPrintf(
+          "Failed to read present page %" PRIx64 " for mapping %s\n", begin, map_info.name.c_str());
+      return false;
+    }
+    const bool is_zero = is_zero_page(page_contents);
+    const bool is_private = (page_count == 1);
+    map_page_counts.pages += 1;
+    if (is_zero) {
+      map_page_counts.zero_page_pfns.insert(page_frame_number);
+      if (is_private) {
+        map_page_counts.private_zero_pages += 1;
+      } else {
+        map_page_counts.shared_zero_pages += 1;
+      }
+    }
+  }
+  return true;
+}
+
+void CountZeroPages(pid_t pid, ProcFiles& proc_files, std::ostream& os, size_t page_size) {
+  std::vector<android::procinfo::MapInfo> proc_maps;
+  if (!android::procinfo::ReadProcessMaps(pid, &proc_maps)) {
+    os << "Could not read process maps for " << pid;
+    return;
+  }
+
+  MapPageCounts total;
+  std::vector<MapPageCounts> stats;
+  for (const android::procinfo::MapInfo& map_info : proc_maps) {
+    MapPageCounts map_page_counts;
+    std::string error_msg;
+    if (!GetMapPageCounts(proc_files, map_info, map_page_counts, error_msg, page_size)) {
+      os << "Error getting map page counts for: " << map_info.name << "\n" << error_msg << "\n\n";
+      continue;
+    }
+    total.pages += map_page_counts.pages;
+    total.private_zero_pages += map_page_counts.private_zero_pages;
+    total.shared_zero_pages += map_page_counts.shared_zero_pages;
+    total.non_present_pages += map_page_counts.non_present_pages;
+    total.zero_page_pfns.insert(std::begin(map_page_counts.zero_page_pfns),
+                                std::end(map_page_counts.zero_page_pfns));
+    stats.push_back(std::move(map_page_counts));
+  }
+
+  // Sort by different page counts, descending.
+  const auto sort_by_private_zero_pages = [](const auto& stats1, const auto& stats2) {
+    return stats1.private_zero_pages > stats2.private_zero_pages;
+  };
+  const auto sort_by_shared_zero_pages = [](const auto& stats1, const auto& stats2) {
+    return stats1.shared_zero_pages > stats2.shared_zero_pages;
+  };
+  const auto sort_by_unique_zero_pages = [](const auto& stats1, const auto& stats2) {
+    return stats1.zero_page_pfns.size() > stats2.zero_page_pfns.size();
+  };
+
+  // Print up to `max_lines` entries.
+  const auto print_stats = [&stats, &os](size_t max_lines) {
+    for (const MapPageCounts& map_page_counts : stats) {
+      if (max_lines == 0) {
+        return;
+      }
+      // Skip entries with no present pages.
+      if (map_page_counts.pages == 0) {
+        continue;
+      }
+      max_lines -= 1;
+      os << StringPrintf("%" PRIx64 "-%" PRIx64 " %s: pages=%" PRIu64
+                         ", private_zero_pages=%" PRIu64 ", shared_zero_pages=%" PRIu64
+                         ", unique_zero_pages=%" PRIu64 ", non_present_pages=%" PRIu64 "\n",
+                         map_page_counts.start,
+                         map_page_counts.end,
+                         map_page_counts.name.c_str(),
+                         map_page_counts.pages,
+                         map_page_counts.private_zero_pages,
+                         map_page_counts.shared_zero_pages,
+                         uint64_t{map_page_counts.zero_page_pfns.size()},
+                         map_page_counts.non_present_pages);
+    }
+  };
+
+  os << StringPrintf("total_pages=%" PRIu64 ", total_private_zero_pages=%" PRIu64
+                     ", total_shared_zero_pages=%" PRIu64 ", total_unique_zero_pages=%" PRIu64
+                     ", total_non_present_pages=%" PRIu64 "\n",
+                     total.pages,
+                     total.private_zero_pages,
+                     total.shared_zero_pages,
+                     uint64_t{total.zero_page_pfns.size()},
+                     total.non_present_pages);
+  os << "\n\n";
+
+  const size_t top_lines = std::min(size_t{20}, stats.size());
+  std::partial_sort(
+      std::begin(stats), std::begin(stats) + top_lines, std::end(stats), sort_by_unique_zero_pages);
+  os << "Top " << top_lines << " maps by unique zero pages (unique PFN count)\n";
+  print_stats(top_lines);
+  os << "\n\n";
+
+  std::partial_sort(std::begin(stats),
+                    std::begin(stats) + top_lines,
+                    std::end(stats),
+                    sort_by_private_zero_pages);
+  os << "Top " << top_lines << " maps by private zero pages (kpagecount == 1)\n";
+  print_stats(top_lines);
+  os << "\n\n";
+
+  std::partial_sort(
+      std::begin(stats), std::begin(stats) + top_lines, std::end(stats), sort_by_shared_zero_pages);
+  os << "Top " << top_lines << " maps by shared zero pages (kpagecount > 1)\n";
+  print_stats(top_lines);
+  os << "\n\n";
+
+  std::sort(std::begin(stats), std::end(stats), sort_by_unique_zero_pages);
+  os << "All maps by unique zero pages (unique PFN count)\n";
+  print_stats(stats.size());
+  os << "\n\n";
+}
+
+}  // namespace
+
+int PageInfo(std::ostream& os,
+             pid_t pid,
+             bool count_zero_pages,
+             std::optional<uint64_t> virtual_page_index,
+             size_t page_size) {
+  ProcFiles proc_files;
+  std::string error_msg;
+  if (!OpenProcFiles(pid, proc_files, error_msg)) {
+    os << error_msg;
+    return EXIT_FAILURE;
+  }
+  if (virtual_page_index != std::nullopt) {
+    DumpPageInfo(virtual_page_index.value(), proc_files, os, page_size);
+  }
+  if (count_zero_pages) {
+    CountZeroPages(pid, proc_files, os, page_size);
+  }
+  return EXIT_SUCCESS;
+}
+
+struct PageInfoArgs : public CmdlineArgs {
+ protected:
+  using Base = CmdlineArgs;
+
+  ParseStatus ParseCustom(const char* raw_option,
+                          size_t raw_option_length,
+                          std::string* error_msg) override {
+    DCHECK_EQ(strlen(raw_option), raw_option_length);
+    {
+      ParseStatus base_parse = Base::ParseCustom(raw_option, raw_option_length, error_msg);
+      if (base_parse != kParseUnknownArgument) {
+        return base_parse;
+      }
+    }
+
+    std::string_view option(raw_option, raw_option_length);
+    if (StartsWith(option, "--pid=")) {
+      // static_assert(std::is_signed_t
+      const char* value = raw_option + strlen("--pid=");
+      if (!android::base::ParseInt(value, &pid_)) {
+        *error_msg = "Failed to parse pid";
+        return kParseError;
+      }
+    } else if (option == "--count-zero-pages") {
+      count_zero_pages_ = true;
+    } else if (StartsWith(option, "--dump-page-info=")) {
+      const char* value = raw_option + strlen("--dump-page-info=");
+      virtual_page_index_ = 0;
+      if (!android::base::ParseUint(value, &virtual_page_index_.value())) {
+        *error_msg = "Failed to parse virtual page index";
+        return kParseError;
+      }
+    } else {
+      return kParseUnknownArgument;
+    }
+
+    return kParseOk;
+  }
+
+  ParseStatus ParseChecks(std::string* error_msg) override {
+    // Perform the parent checks.
+    ParseStatus parent_checks = Base::ParseChecks(error_msg);
+    if (parent_checks != kParseOk) {
+      return parent_checks;
+    }
+    if (pid_ == -1) {
+      *error_msg = "Missing --pid=";
+      return kParseError;
+    }
+
+    // Perform our own checks.
+    if (kill(pid_, /*sig*/ 0) != 0) {  // No signal is sent, perform error-checking only.
+      // Check if the pid exists before proceeding.
+      if (errno == ESRCH) {
+        *error_msg = "Process specified does not exist, pid: " + std::to_string(pid_);
+      } else {
+        *error_msg = StringPrintf("Failed to check process status: %s", strerror(errno));
+      }
+      return kParseError;
+    }
+    return kParseOk;
+  }
+
+  std::string GetUsage() const override {
+    std::string usage;
+
+    usage +=
+        "Usage: pageinfo [options] ...\n"
+        "    Example: pageinfo --pid=$(pidof system_server) --count-zero-pages\n"
+        "    Example: adb shell pageinfo --pid=$(pid system_server) --dump-page-info=0x70000000\n"
+        "\n";
+
+    usage += Base::GetUsage();
+
+    usage +=
+        "  --pid=<pid>: PID of the process to analyze.\n"
+        "  --count-zero-pages: output zero filled page stats for memory mappings of "
+        "<image-diff-pid> process.\n"
+        "  --dump-page-info=<virtual_page_index>: output PFN, kpagecount and kpageflags of a "
+        "virtual page in <image-diff-pid> process memory space.\n";
+
+    return usage;
+  }
+
+ public:
+  pid_t pid_ = -1;
+  bool count_zero_pages_ = false;
+  std::optional<uint64_t> virtual_page_index_;
+};
+
+struct PageInfoMain : public CmdlineMain<PageInfoArgs> {
+  bool ExecuteWithoutRuntime() override {
+    CHECK(args_ != nullptr);
+    CHECK(args_->os_ != nullptr);
+
+    return PageInfo(
+               *args_->os_, args_->pid_, args_->count_zero_pages_, args_->virtual_page_index_,
+               MemMap::GetPageSize()) ==
+           EXIT_SUCCESS;
+  }
+
+  bool NeedsRuntime() override { return false; }
+};
+
+}  // namespace art
+
+int main(int argc, char** argv) {
+  art::PageInfoMain main;
+  return main.Main(argc, argv);
+}
diff --git a/imgdiag/page_util.cc b/imgdiag/page_util.cc
new file mode 100644
index 0000000..0b765f4
--- /dev/null
+++ b/imgdiag/page_util.cc
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "page_util.h"
+
+#include "android-base/stringprintf.h"
+
+namespace art {
+
+using android::base::StringPrintf;
+
+bool GetPageFlagsOrCount(art::File& kpage_file,
+                         uint64_t page_frame_number,
+                         /*out*/ uint64_t& page_flags_or_count,
+                         /*out*/ std::string& error_msg) {
+  return GetPageFlagsOrCounts(kpage_file,
+                              ArrayRef<const uint64_t>(&page_frame_number, 1u),
+                              ArrayRef<uint64_t>(&page_flags_or_count, 1u),
+                              error_msg);
+}
+
+bool GetPageFlagsOrCounts(File& kpage_file,
+                          ArrayRef<const uint64_t> page_frame_numbers,
+                          /*out*/ ArrayRef<uint64_t> page_flags_or_counts,
+                          /*out*/ std::string& error_msg) {
+  static_assert(kPageFlagsEntrySize == kPageCountEntrySize, "entry size check");
+  CHECK_NE(page_frame_numbers.size(), 0u);
+  CHECK_EQ(page_flags_or_counts.size(), page_frame_numbers.size());
+  CHECK(page_frame_numbers.data() != nullptr);
+  CHECK(page_flags_or_counts.data() != nullptr);
+
+  size_t size = page_frame_numbers.size();
+  size_t i = 0;
+  while (i != size) {
+    size_t start = i;
+    ++i;
+    while (i != size && page_frame_numbers[i] - page_frame_numbers[start] == i - start) {
+      ++i;
+    }
+    // Read 64-bit entries from /proc/kpageflags or /proc/kpagecount.
+    if (!kpage_file.PreadFully(page_flags_or_counts.data() + start,
+                               (i - start) * kPageMapEntrySize,
+                               page_frame_numbers[start] * kPageFlagsEntrySize)) {
+      error_msg = StringPrintf("Failed to read the page flags or counts from %s, error: %s",
+                               kpage_file.GetPath().c_str(),
+                               strerror(errno));
+      return false;
+    }
+  }
+
+  return true;
+}
+
+bool GetPageFrameNumber(File& page_map_file,
+                        size_t virtual_page_index,
+                        /*out*/ uint64_t& page_frame_number,
+                        /*out*/ std::string& error_msg) {
+  return GetPageFrameNumbers(
+      page_map_file, virtual_page_index, ArrayRef<uint64_t>(&page_frame_number, 1u), error_msg);
+}
+
+bool GetPageFrameNumbers(File& page_map_file,
+                         size_t virtual_page_index,
+                         /*out*/ ArrayRef<uint64_t> page_frame_numbers,
+                         /*out*/ std::string& error_msg) {
+  CHECK_NE(page_frame_numbers.size(), 0u);
+  CHECK(page_frame_numbers.data() != nullptr);
+
+  // Read 64-bit entries from /proc/$pid/pagemap to get the physical page frame numbers.
+  if (!page_map_file.PreadFully(page_frame_numbers.data(),
+                                page_frame_numbers.size() * kPageMapEntrySize,
+                                virtual_page_index * kPageMapEntrySize)) {
+    error_msg = StringPrintf("Failed to read virtual page index entries from %s, error: %s",
+                             page_map_file.GetPath().c_str(),
+                             strerror(errno));
+    return false;
+  }
+
+  // Extract page frame numbers from pagemap entries.
+  for (uint64_t& page_frame_number : page_frame_numbers) {
+    page_frame_number &= kPageFrameNumberMask;
+  }
+
+  return true;
+}
+
+}  // namespace art
diff --git a/imgdiag/page_util.h b/imgdiag/page_util.h
new file mode 100644
index 0000000..dc3ba25
--- /dev/null
+++ b/imgdiag/page_util.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_IMGDIAG_PAGE_UTIL_H_
+#define ART_IMGDIAG_PAGE_UTIL_H_
+
+#include <cstdint>
+
+#include "base/array_ref.h"
+#include "base/os.h"
+#include "base/unix_file/fd_file.h"
+
+namespace art {
+static constexpr size_t kPageMapEntrySize = sizeof(uint64_t);
+// bits 0-54 [in /proc/$pid/pagemap]
+static constexpr uint64_t kPageFrameNumberMask = (1ULL << 55) - 1;
+
+static constexpr size_t kPageFlagsEntrySize = sizeof(uint64_t);
+static constexpr size_t kPageCountEntrySize = sizeof(uint64_t);
+static constexpr uint64_t kPageFlagsDirtyMask = (1ULL << 4);    // in /proc/kpageflags
+static constexpr uint64_t kPageFlagsNoPageMask = (1ULL << 20);  // in /proc/kpageflags
+static constexpr uint64_t kPageFlagsMmapMask = (1ULL << 11);    // in /proc/kpageflags
+
+// Note: On failure, `page_flags_or_counts[.]` shall be clobbered.
+bool GetPageFlagsOrCount(art::File& kpage_file,
+                         uint64_t page_frame_number,
+                         /*out*/ uint64_t& page_flags_or_count,
+                         /*out*/ std::string& error_msg);
+
+bool GetPageFlagsOrCounts(art::File& kpage_file,
+                          ArrayRef<const uint64_t> page_frame_numbers,
+                          /*out*/ ArrayRef<uint64_t> page_flags_or_counts,
+                          /*out*/ std::string& error_msg);
+
+// Note: On failure, `*page_frame_number` shall be clobbered.
+bool GetPageFrameNumber(art::File& page_map_file,
+                        size_t virtual_page_index,
+                        /*out*/ uint64_t& page_frame_number,
+                        /*out*/ std::string& error_msg);
+
+bool GetPageFrameNumbers(art::File& page_map_file,
+                         size_t virtual_page_index,
+                         /*out*/ ArrayRef<uint64_t> page_frame_numbers,
+                         /*out*/ std::string& error_msg);
+
+}  // namespace art
+
+#endif  // ART_IMGDIAG_PAGE_UTIL_H_
diff --git a/imgdiag/run_imgdiag.py b/imgdiag/run_imgdiag.py
new file mode 100755
index 0000000..a51e5ee
--- /dev/null
+++ b/imgdiag/run_imgdiag.py
@@ -0,0 +1,141 @@
+#! /usr/bin/env python3
+#
+# Copyright 2023, The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import argparse
+from collections import namedtuple
+import subprocess
+
+try:
+  from tqdm import tqdm
+except:
+
+  def tqdm(x):
+    return x
+
+
+ProcEntry = namedtuple('ProcEntry', 'pid, ppid, cmd, name, etc_args')
+
+
+def get_mem_stats(
+    zygote_pid,
+    target_pid,
+    target_name,
+    imgdiag_path,
+    boot_image,
+    device_out_dir,
+    host_out_dir,
+):
+  imgdiag_output_path = (
+      f'{device_out_dir}/imgdiag_{target_name}_{target_pid}.txt'
+  )
+  cmd_collect = (
+      'adb shell '
+      f'"{imgdiag_path} --zygote-diff-pid={zygote_pid} --image-diff-pid={target_pid} '
+      f'--output={imgdiag_output_path} --boot-image={boot_image} --dump-dirty-objects"'
+  )
+
+  try:
+    subprocess.run(cmd_collect, shell=True, check=True)
+  except:
+    print('imgdiag call failed on:', target_pid, target_name)
+    return
+
+  cmd_pull = f'adb pull {imgdiag_output_path} {host_out_dir}'
+  subprocess.run(cmd_pull, shell=True, check=True, capture_output=True)
+
+
+def main():
+  parser = argparse.ArgumentParser(
+      description=(
+          'Run imgdiag on selected processes and pull results from the device.'
+      ),
+      formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+  )
+  parser.add_argument(
+      'process_names',
+      nargs='*',
+      help='Process names to use. If none - dump all zygote children.',
+  )
+  parser.add_argument(
+      '--boot-image',
+      dest='boot_image',
+      default='/data/misc/apexdata/com.android.art/dalvik-cache/boot.art',
+      help='Path to boot.art',
+  )
+  parser.add_argument(
+      '--zygote',
+      default='zygote64',
+      help='Zygote process name',
+  )
+  parser.add_argument(
+      '--imgdiag',
+      default='/apex/com.android.art/bin/imgdiag64',
+      help='Path to imgdiag binary.',
+  )
+  parser.add_argument(
+      '--device-out-dir',
+      default='/data/local/tmp/imgdiag_out',
+      help='Directory for imgdiag output files on the device.',
+  )
+  parser.add_argument(
+      '--host-out-dir',
+      default='./',
+      help='Directory for imgdiag output files on the host.',
+  )
+
+  args = parser.parse_args()
+
+  res = subprocess.run(
+      args='adb shell ps -o pid:1,ppid:1,cmd:1,args:1',
+      capture_output=True,
+      shell=True,
+      check=True,
+      text=True,
+  )
+
+  proc_entries = []
+  for line in res.stdout.splitlines()[1:]:  # skip header
+    pid, ppid, cmd, name, *etc_args = line.split(' ')
+    entry = ProcEntry(int(pid), int(ppid), cmd, name, etc_args)
+    proc_entries.append(entry)
+
+  zygote_entry = next(e for e in proc_entries if e.name == args.zygote)
+  zygote_children = [e for e in proc_entries if e.ppid == zygote_entry.pid]
+
+  if args.process_names:
+    zygote_children = [e for e in proc_entries if e.name in args.process_names]
+
+  print('\n'.join(str(e.pid) + ' ' + e.name for e in zygote_children))
+
+  subprocess.run(
+      args=f'adb shell "mkdir -p {args.device_out_dir}"', check=True, shell=True
+  )
+  subprocess.run(args=f'mkdir -p {args.host_out_dir}', check=True, shell=True)
+
+  for entry in tqdm(zygote_children):
+    get_mem_stats(
+        zygote_pid=entry.ppid,
+        target_pid=entry.pid,
+        target_name=entry.name,
+        imgdiag_path=args.imgdiag,
+        boot_image=args.boot_image,
+        device_out_dir=args.device_out_dir,
+        host_out_dir=args.host_out_dir,
+    )
+
+
+if __name__ == '__main__':
+  main()
diff --git a/libartbase/Android.bp b/libartbase/Android.bp
index 951599d..c1bfc56 100644
--- a/libartbase/Android.bp
+++ b/libartbase/Android.bp
@@ -49,7 +49,6 @@
         "base/metrics/metrics_common.cc",
         "base/os_linux.cc",
         "base/runtime_debug.cc",
-        "base/safe_copy.cc",
         "base/scoped_arena_allocator.cc",
         "base/scoped_flock.cc",
         "base/socket_peer_is_trusted.cc",
@@ -254,12 +253,10 @@
     srcs: [
         "base/common_art_test.cc",
     ],
-    shared_libs: [
-        "libbase",
-        "libunwindstack",
-    ],
     header_libs: [
         "libnativehelper_header_only",
+        // Required for "base/mutex.h" in common_art_test.cc
+        "libart_headers",
     ],
     static: {
         whole_static_libs: [
@@ -275,34 +272,29 @@
     },
 }
 
-art_cc_library {
+art_cc_library_static {
     name: "libartbase-art-gtest",
     defaults: [
         "libart-gtest-defaults",
         "libartbase-art-gtest-defaults",
-    ],
-    shared_libs: [
-        "libartbase",
-        "libartbase-testing",
-        "libdexfile",
+        "libartbase_static_defaults",
+        "libdexfile_static_defaults",
     ],
 }
 
-art_cc_library {
+art_cc_library_static {
     name: "libartbased-art-gtest",
     defaults: [
-        "libartd-gtest-defaults",
+        "art_debug_defaults",
+        "libart-gtest-defaults",
         "libartbase-art-gtest-defaults",
-    ],
-    shared_libs: [
-        "libartbased",
-        "libartbased-testing",
-        "libdexfiled",
+        "libartbased_static_defaults",
+        "libdexfiled_static_defaults",
     ],
 }
 
-art_cc_defaults {
-    name: "libartbase-testing-defaults",
+art_cc_library_static {
+    name: "libartbase-testing",
     defaults: [
         "art_defaults",
     ],
@@ -310,35 +302,9 @@
     srcs: [
         "base/testing.cc",
     ],
-    shared_libs: [
-        "libbase",
-    ],
-    apex_available: [
-        "com.android.art.debug",
-        // TODO(b/183882457): This lib doesn't go into com.android.art, but
-        // apex_available lists need to be the same for internal libs to avoid
-        // stubs, and this depends on libdexfiled and others.
-        "com.android.art",
-    ],
-}
-
-art_cc_library {
-    name: "libartbase-testing",
-    defaults: [
-        "libartbase-testing-defaults",
-    ],
-    shared_libs: [
-        "libartbase",
-    ],
-}
-
-art_cc_library {
-    name: "libartbased-testing",
-    defaults: [
-        "libartbase-testing-defaults",
-    ],
-    shared_libs: [
-        "libartbased",
+    header_libs: [
+        "libbase_headers",
+        "art_libartbase_headers",
     ],
 }
 
@@ -374,7 +340,6 @@
         "base/memory_region_test.cc",
         "base/mem_map_test.cc",
         "base/metrics/metrics_test.cc",
-        "base/safe_copy_test.cc",
         "base/scoped_flock_test.cc",
         "base/time_utils_test.cc",
         "base/transform_array_ref_test.cc",
@@ -384,9 +349,6 @@
         "base/variant_map_test.cc",
         "base/zip_archive_test.cc",
     ],
-    shared_libs: [
-        "libbase",
-    ],
     static_libs: [
         "libgmock",
     ],
diff --git a/libartbase/arch/instruction_set.cc b/libartbase/arch/instruction_set.cc
index e0de4e8..e28b6ca 100644
--- a/libartbase/arch/instruction_set.cc
+++ b/libartbase/arch/instruction_set.cc
@@ -121,19 +121,11 @@
 
 namespace instruction_set_details {
 
-static_assert(IsAligned<kPageSize>(kArmStackOverflowReservedBytes), "ARM gap not page aligned");
-static_assert(IsAligned<kPageSize>(kArm64StackOverflowReservedBytes), "ARM64 gap not page aligned");
-static_assert(IsAligned<kPageSize>(kRiscv64StackOverflowReservedBytes),
-              "RISCV64 gap not page aligned");
-static_assert(IsAligned<kPageSize>(kX86StackOverflowReservedBytes), "X86 gap not page aligned");
-static_assert(IsAligned<kPageSize>(kX86_64StackOverflowReservedBytes),
-              "X86_64 gap not page aligned");
-
 #if !defined(ART_FRAME_SIZE_LIMIT)
 #error "ART frame size limit missing"
 #endif
 
-// TODO: Should we require an extra page (RoundUp(SIZE) + kPageSize)?
+// TODO: Should we require an extra page (RoundUp(SIZE) + gPageSize)?
 static_assert(ART_FRAME_SIZE_LIMIT < kArmStackOverflowReservedBytes, "Frame size limit too large");
 static_assert(ART_FRAME_SIZE_LIMIT < kArm64StackOverflowReservedBytes,
               "Frame size limit too large");
diff --git a/libartbase/base/allocator.cc b/libartbase/base/allocator.cc
index 6393672..71a4f6c 100644
--- a/libartbase/base/allocator.cc
+++ b/libartbase/base/allocator.cc
@@ -49,12 +49,12 @@
   NoopAllocator() {}
   ~NoopAllocator() {}
 
-  void* Alloc(size_t size ATTRIBUTE_UNUSED) override {
+  void* Alloc([[maybe_unused]] size_t size) override {
     LOG(FATAL) << "NoopAllocator::Alloc should not be called";
     UNREACHABLE();
   }
 
-  void Free(void* p ATTRIBUTE_UNUSED) override {
+  void Free([[maybe_unused]] void* p) override {
     // Noop.
   }
 
diff --git a/libartbase/base/allocator.h b/libartbase/base/allocator.h
index 81f3a60..24374a2 100644
--- a/libartbase/base/allocator.h
+++ b/libartbase/base/allocator.h
@@ -115,8 +115,8 @@
 
   // Used internally by STL data structures.
   template <class U>
-  TrackingAllocatorImpl(
-      const TrackingAllocatorImpl<U, kTag>& alloc ATTRIBUTE_UNUSED) noexcept {}
+  explicit TrackingAllocatorImpl(
+      [[maybe_unused]] const TrackingAllocatorImpl<U, kTag>& alloc) noexcept {}
 
   // Used internally by STL data structures.
   TrackingAllocatorImpl() noexcept {
@@ -130,7 +130,7 @@
     using other = TrackingAllocatorImpl<U, kTag>;
   };
 
-  pointer allocate(size_type n, const_pointer hint ATTRIBUTE_UNUSED = 0) {
+  pointer allocate(size_type n, [[maybe_unused]] const_pointer hint = 0) {
     const size_t size = n * sizeof(T);
     TrackedAllocators::RegisterAllocation(GetTag(), size);
     return reinterpret_cast<pointer>(malloc(size));
diff --git a/libartbase/base/arena_allocator.h b/libartbase/base/arena_allocator.h
index c4f713a..10f7f31 100644
--- a/libartbase/base/arena_allocator.h
+++ b/libartbase/base/arena_allocator.h
@@ -120,13 +120,13 @@
   ArenaAllocatorStatsImpl(const ArenaAllocatorStatsImpl& other) = default;
   ArenaAllocatorStatsImpl& operator = (const ArenaAllocatorStatsImpl& other) = delete;
 
-  void Copy(const ArenaAllocatorStatsImpl& other ATTRIBUTE_UNUSED) {}
-  void RecordAlloc(size_t bytes ATTRIBUTE_UNUSED, ArenaAllocKind kind ATTRIBUTE_UNUSED) {}
+  void Copy([[maybe_unused]] const ArenaAllocatorStatsImpl& other) {}
+  void RecordAlloc([[maybe_unused]] size_t bytes, [[maybe_unused]] ArenaAllocKind kind) {}
   size_t NumAllocations() const { return 0u; }
   size_t BytesAllocated() const { return 0u; }
-  void Dump(std::ostream& os ATTRIBUTE_UNUSED,
-            const Arena* first ATTRIBUTE_UNUSED,
-            ssize_t lost_bytes_adjustment ATTRIBUTE_UNUSED) const {}
+  void Dump([[maybe_unused]] std::ostream& os,
+            [[maybe_unused]] const Arena* first,
+            [[maybe_unused]] ssize_t lost_bytes_adjustment) const {}
 };
 
 template <bool kCount>
diff --git a/libartbase/base/arena_bit_vector.cc b/libartbase/base/arena_bit_vector.cc
index 138a5df..e7acb60 100644
--- a/libartbase/base/arena_bit_vector.cc
+++ b/libartbase/base/arena_bit_vector.cc
@@ -28,7 +28,7 @@
 class ArenaBitVectorAllocatorKindImpl<false> {
  public:
   // Not tracking allocations, ignore the supplied kind and arbitrarily provide kArenaAllocSTL.
-  explicit ArenaBitVectorAllocatorKindImpl(ArenaAllocKind kind ATTRIBUTE_UNUSED) {}
+  explicit ArenaBitVectorAllocatorKindImpl([[maybe_unused]] ArenaAllocKind kind) {}
   ArenaBitVectorAllocatorKindImpl(const ArenaBitVectorAllocatorKindImpl&) = default;
   ArenaBitVectorAllocatorKindImpl& operator=(const ArenaBitVectorAllocatorKindImpl&) = default;
   ArenaAllocKind Kind() { return kArenaAllocGrowableBitMap; }
diff --git a/libartbase/base/arena_containers.h b/libartbase/base/arena_containers.h
index f205bc4..80a3791 100644
--- a/libartbase/base/arena_containers.h
+++ b/libartbase/base/arena_containers.h
@@ -93,7 +93,7 @@
 template <typename Key,
           typename Value,
           typename Hash = std::hash<Key>,
-          typename Pred = std::equal_to<Value>>
+          typename Pred = std::equal_to<Key>>
 using ArenaUnorderedMap = std::unordered_map<Key,
                                              Value,
                                              Hash,
@@ -109,7 +109,7 @@
 class ArenaAllocatorAdapterKindImpl<false> {
  public:
   // Not tracking allocations, ignore the supplied kind and arbitrarily provide kArenaAllocSTL.
-  explicit ArenaAllocatorAdapterKindImpl(ArenaAllocKind kind ATTRIBUTE_UNUSED) {}
+  explicit ArenaAllocatorAdapterKindImpl([[maybe_unused]] ArenaAllocKind kind) {}
   ArenaAllocatorAdapterKindImpl(const ArenaAllocatorAdapterKindImpl&) = default;
   ArenaAllocatorAdapterKindImpl& operator=(const ArenaAllocatorAdapterKindImpl&) = default;
   ArenaAllocKind Kind() { return kArenaAllocSTL; }
@@ -199,7 +199,7 @@
   const_pointer address(const_reference x) const { return &x; }
 
   pointer allocate(size_type n,
-                   ArenaAllocatorAdapter<void>::pointer hint ATTRIBUTE_UNUSED = nullptr) {
+                   [[maybe_unused]] ArenaAllocatorAdapter<void>::pointer hint = nullptr) {
     DCHECK_LE(n, max_size());
     return allocator_->AllocArray<T>(n, ArenaAllocatorAdapterKind::Kind());
   }
diff --git a/libartbase/base/atomic.h b/libartbase/base/atomic.h
index 226a088..91f1982 100644
--- a/libartbase/base/atomic.h
+++ b/libartbase/base/atomic.h
@@ -125,6 +125,14 @@
   }
 };
 
+// Increment a debug- or statistics-only counter when there is a single writer, especially if
+// concurrent reads are uncommon. Usually appreciably faster in this case.
+// NOT suitable as an approximate counter with multiple writers.
+template <typename T>
+void IncrementStatsCounter(std::atomic<T>* a) {
+  a->store(a->load(std::memory_order_relaxed) + 1, std::memory_order_relaxed);
+}
+
 using AtomicInteger = Atomic<int32_t>;
 
 static_assert(sizeof(AtomicInteger) == sizeof(int32_t), "Weird AtomicInteger size");
diff --git a/libartbase/base/bit_memory_region.h b/libartbase/base/bit_memory_region.h
index baac2f5..c60b31f 100644
--- a/libartbase/base/bit_memory_region.h
+++ b/libartbase/base/bit_memory_region.h
@@ -23,6 +23,7 @@
 #include "memory_tool.h"
 
 #include <array>
+#include <cstdint>
 
 namespace art {
 
@@ -30,10 +31,16 @@
 // abstracting away the bit start offset to avoid needing passing as an argument everywhere.
 class BitMemoryRegion final : public ValueObject {
  public:
+  // Ensure all loads are naturally-aligned by aligning down the region's data pointer according to
+  // the largest data type that will be loaded via LoadBits (as StackMap BitTable uses over 8
+  // varints in the header, this is uint64_t).
+  using MaxSingleLoadType = uint64_t;
+  static constexpr size_t kMaxSingleLoadBytes = sizeof(MaxSingleLoadType);
+
   BitMemoryRegion() = default;
   ALWAYS_INLINE BitMemoryRegion(uint8_t* data, ssize_t bit_start, size_t bit_size) {
     // Normalize the data pointer. Note that bit_start may be negative.
-    data_ = AlignDown(data + (bit_start >> kBitsPerByteLog2), kPageSize);
+    data_ = AlignDown(data + (bit_start >> kBitsPerByteLog2), kMaxSingleLoadBytes);
     bit_start_ = bit_start + kBitsPerByte * (data - data_);
     bit_size_ = bit_size;
   }
@@ -103,6 +110,7 @@
   ALWAYS_INLINE Result LoadBits(size_t bit_offset, size_t bit_length) const {
     static_assert(std::is_integral_v<Result>, "Result must be integral");
     static_assert(std::is_unsigned_v<Result>, "Result must be unsigned");
+    static_assert(sizeof(Result) <= kMaxSingleLoadBytes);
     DCHECK(IsAligned<sizeof(Result)>(data_));
     DCHECK_LE(bit_offset, bit_size_);
     DCHECK_LE(bit_length, bit_size_ - bit_offset);
@@ -157,11 +165,11 @@
   ALWAYS_INLINE void CopyBits(const BitMemoryRegion& src) {
     DCHECK_EQ(size_in_bits(), src.size_in_bits());
     // Hopefully, the loads of the unused `value` shall be optimized away.
-    VisitChunks(
-        [this, &src](size_t offset, size_t num_bits, size_t value ATTRIBUTE_UNUSED) ALWAYS_INLINE {
-          StoreChunk(offset, src.LoadBits(offset, num_bits), num_bits);
-          return true;
-        });
+    VisitChunks([this, &src](size_t offset, size_t num_bits, [[maybe_unused]] size_t value)
+                    ALWAYS_INLINE {
+                      StoreChunk(offset, src.LoadBits(offset, num_bits), num_bits);
+                      return true;
+                    });
   }
 
   // And bits from other bit region.
@@ -194,9 +202,8 @@
   // Count the number of set bits within this region.
   ALWAYS_INLINE size_t PopCount() const {
     size_t result = 0u;
-    VisitChunks([&](size_t offset ATTRIBUTE_UNUSED,
-                    size_t num_bits ATTRIBUTE_UNUSED,
-                    size_t value) ALWAYS_INLINE {
+    VisitChunks([&]([[maybe_unused]] size_t offset, [[maybe_unused]] size_t num_bits, size_t value)
+                    ALWAYS_INLINE {
                       result += POPCOUNT(value);
                       return true;
                     });
@@ -210,11 +217,9 @@
 
   // Check if this region has all bits clear.
   ALWAYS_INLINE bool HasAllBitsClear() const {
-    return VisitChunks([](size_t offset ATTRIBUTE_UNUSED,
-                          size_t num_bits ATTRIBUTE_UNUSED,
-                          size_t value) ALWAYS_INLINE {
-                            return value == 0u;
-                          });
+    return VisitChunks(
+        []([[maybe_unused]] size_t offset, [[maybe_unused]] size_t num_bits, size_t value)
+            ALWAYS_INLINE { return value == 0u; });
   }
 
   // Check if this region has any bit set.
@@ -319,7 +324,7 @@
     }
   }
 
-  uint8_t* data_ = nullptr;  // The pointer is page aligned.
+  uint8_t* data_ = nullptr;  // The pointer is aligned down to kMaxSingleLoadBytes.
   size_t bit_start_ = 0;
   size_t bit_size_ = 0;
 };
@@ -401,7 +406,8 @@
   // This requires fewer bit-reads compared to indidually storing the varints.
   template<size_t N>
   ALWAYS_INLINE std::array<uint32_t, N> ReadInterleavedVarints() {
-    static_assert(N * kVarintBits <= sizeof(uint64_t) * kBitsPerByte, "N too big");
+    static_assert(N * kVarintBits <= BitMemoryRegion::kMaxSingleLoadBytes * kBitsPerByte,
+                  "N too big");
     std::array<uint32_t, N> values;
     // StackMap BitTable uses over 8 varints in the header, so we need uint64_t.
     uint64_t data = ReadBits<uint64_t>(N * kVarintBits);
diff --git a/libartbase/base/bit_table.h b/libartbase/base/bit_table.h
index 227f5eb..d6d03f3 100644
--- a/libartbase/base/bit_table.h
+++ b/libartbase/base/bit_table.h
@@ -153,13 +153,13 @@
 template<typename Accessor>
 class BitTable : public BitTableBase<Accessor::kNumColumns> {
  public:
-  class const_iterator : public std::iterator<std::random_access_iterator_tag,
-                                              /* value_type */ Accessor,
-                                              /* difference_type */ int32_t,
-                                              /* pointer */ void,
-                                              /* reference */ void> {
+  class const_iterator {
    public:
+    using iterator_category = std::random_access_iterator_tag;
+    using value_type = Accessor;
     using difference_type = int32_t;
+    using pointer = void;
+    using reference = void;
     const_iterator() {}
     const_iterator(const BitTable* table, uint32_t row) : table_(table), row_(row) {}
     const_iterator operator+(difference_type n) { return const_iterator(table_, row_ + n); }
@@ -189,6 +189,7 @@
       DCHECK_LT(row_ + index, table_->NumRows());
       return Accessor(table_, row_ + index);
     }
+
    private:
     const BitTable* table_ = nullptr;
     uint32_t row_ = 0;
@@ -261,10 +262,11 @@
   class Entry {
    public:
     Entry() {
-      // The definition of kNoValue here is for host and target debug builds which complain about
-      // missing a symbol definition for BitTableBase<N>::kNovValue when optimization is off.
-      static constexpr uint32_t kNoValue = BitTableBase<kNumColumns>::kNoValue;
-      std::fill_n(data_, kNumColumns, kNoValue);
+      // The definition of kLocalNoValue here is for host and target debug builds which
+      // complain about missing a symbol definition for BitTableBase<N>::kNovValue when
+      // optimization is off.
+      static constexpr uint32_t kLocalNoValue = BitTableBase<kNumColumns>::kNoValue;
+      std::fill_n(data_, kNumColumns, kLocalNoValue);
     }
 
     Entry(std::initializer_list<uint32_t> values) {
diff --git a/libartbase/base/bit_utils.h b/libartbase/base/bit_utils.h
index ffaffc3..a698685 100644
--- a/libartbase/base/bit_utils.h
+++ b/libartbase/base/bit_utils.h
@@ -175,6 +175,15 @@
   return RoundDown(x + n - 1, n);
 }
 
+template<bool kRoundUp, typename T>
+constexpr T CondRoundUp(T x, std::remove_reference_t<T> n) {
+  if (kRoundUp) {
+    return RoundUp(x, n);
+  } else {
+    return x;
+  }
+}
+
 // For aligning pointers.
 template<typename T>
 inline T* AlignDown(T* x, uintptr_t n) WARN_UNUSED;
diff --git a/libartbase/base/bit_utils_iterator.h b/libartbase/base/bit_utils_iterator.h
index bfcff86..296280e 100644
--- a/libartbase/base/bit_utils_iterator.h
+++ b/libartbase/base/bit_utils_iterator.h
@@ -32,14 +32,19 @@
 // Using the Curiously Recurring Template Pattern to implement everything shared
 // by LowToHighBitIterator and HighToLowBitIterator, i.e. everything but operator*().
 template <typename T, typename Iter>
-class BitIteratorBase
-    : public std::iterator<std::forward_iterator_tag, uint32_t, ptrdiff_t, void, void> {
+class BitIteratorBase {
   static_assert(std::is_integral_v<T>, "T must be integral");
   static_assert(std::is_unsigned_v<T>, "T must be unsigned");
 
   static_assert(sizeof(T) == sizeof(uint32_t) || sizeof(T) == sizeof(uint64_t), "Unsupported size");
 
  public:
+  using iterator_category = std::forward_iterator_tag;
+  using value_type = uint32_t;
+  using difference_type = ptrdiff_t;
+  using pointer = void;
+  using reference = void;
+
   BitIteratorBase() : bits_(0u) { }
   explicit BitIteratorBase(T bits) : bits_(bits) { }
 
diff --git a/libartbase/base/bit_vector.h b/libartbase/base/bit_vector.h
index 071577b..ea26b5a 100644
--- a/libartbase/base/bit_vector.h
+++ b/libartbase/base/bit_vector.h
@@ -51,9 +51,14 @@
    *     // Use idx.
    *   }
    */
-  class IndexIterator :
-      public std::iterator<std::forward_iterator_tag, uint32_t, ptrdiff_t, void, uint32_t> {
+  class IndexIterator {
    public:
+    using iterator_category = std::forward_iterator_tag;
+    using value_type = uint32_t;
+    using difference_type = ptrdiff_t;
+    using pointer = void;
+    using reference = void;
+
     bool operator==(const IndexIterator& other) const;
 
     bool operator!=(const IndexIterator& other) const {
diff --git a/libartbase/base/bit_vector_test.cc b/libartbase/base/bit_vector_test.cc
index 5f1b167..929c323 100644
--- a/libartbase/base/bit_vector_test.cc
+++ b/libartbase/base/bit_vector_test.cc
@@ -353,6 +353,7 @@
     EXPECT_TRUE(bv.IsBitSet(13));
     {
       BitVector bv2(std::move(bv));
+      // NOLINTNEXTLINE - checking underlying storage has been freed
       ASSERT_TRUE(bv.GetRawStorage() == nullptr);
       EXPECT_TRUE(bv2.IsBitSet(13));
       EXPECT_EQ(alloc.FreeCount(), 0u);
diff --git a/libartbase/base/common_art_test.cc b/libartbase/base/common_art_test.cc
index db0e1c1..0692bf8 100644
--- a/libartbase/base/common_art_test.cc
+++ b/libartbase/base/common_art_test.cc
@@ -448,28 +448,25 @@
 
 std::vector<std::string> CommonArtTestImpl::GetLibCoreDexFileNames(
     const std::vector<std::string>& modules) const {
-  return art::testing::GetLibCoreDexFileNames(modules);
+  return art::testing::GetLibCoreDexFileNames(kIsTargetBuild ? "" : GetAndroidRoot(), modules);
 }
 
 std::vector<std::string> CommonArtTestImpl::GetLibCoreDexFileNames() const {
   std::vector<std::string> modules = GetLibCoreModuleNames();
-  return art::testing::GetLibCoreDexFileNames(modules);
+  return art::testing::GetLibCoreDexFileNames(kIsTargetBuild ? "" : GetAndroidRoot(), modules);
 }
 
 std::vector<std::string> CommonArtTestImpl::GetLibCoreDexLocations(
     const std::vector<std::string>& modules) const {
-  std::vector<std::string> result = GetLibCoreDexFileNames(modules);
+  std::string prefix = "";
   if (IsHost()) {
-    // Strip the ANDROID_BUILD_TOP directory including the directory separator '/'.
-    std::string prefix = GetAndroidBuildTop();
-    for (std::string& location : result) {
-      CHECK_GT(location.size(), prefix.size());
-      CHECK_EQ(location.compare(0u, prefix.size(), prefix), 0)
-          << " prefix=" << prefix << " location=" << location;
-      location.erase(0u, prefix.size());
-    }
+    std::string android_root = GetAndroidRoot();
+    std::string build_top = GetAndroidBuildTop();
+    CHECK(android::base::StartsWith(android_root, build_top))
+        << " android_root=" << android_root << " build_top=" << build_top;
+    prefix = android_root.substr(build_top.size());
   }
-  return result;
+  return art::testing::GetLibCoreDexFileNames(prefix, modules);
 }
 
 std::vector<std::string> CommonArtTestImpl::GetLibCoreDexLocations() const {
@@ -582,13 +579,8 @@
 std::string CommonArtTestImpl::CreateClassPathWithChecksums(
     const std::vector<std::unique_ptr<const DexFile>>& dex_files) {
   CHECK(!dex_files.empty());
-  std::string classpath = dex_files[0]->GetLocation() + "*" +
-      std::to_string(dex_files[0]->GetLocationChecksum());
-  for (size_t i = 1; i < dex_files.size(); i++) {
-    classpath += ":" + dex_files[i]->GetLocation() + "*" +
-        std::to_string(dex_files[i]->GetLocationChecksum());
-  }
-  return classpath;
+  uint32_t checksum = DexFileLoader::GetMultiDexChecksum(dex_files);
+  return dex_files[0]->GetLocation() + "*" + std::to_string(checksum);
 }
 
 CommonArtTestImpl::ForkAndExecResult CommonArtTestImpl::ForkAndExec(
diff --git a/libartbase/base/common_art_test.h b/libartbase/base/common_art_test.h
index d7711f2..c490e08 100644
--- a/libartbase/base/common_art_test.h
+++ b/libartbase/base/common_art_test.h
@@ -157,10 +157,10 @@
   // Gets the paths of the libcore dex files.
   std::vector<std::string> GetLibCoreDexFileNames() const;
 
-  // Gets the locations of the libcore dex files for given modules.
+  // Gets the on-host or on-device locations of the libcore dex files for given modules.
   std::vector<std::string> GetLibCoreDexLocations(const std::vector<std::string>& modules) const;
 
-  // Gets the locations of the libcore dex files.
+  // Gets the on-host or on-device locations of the libcore dex files.
   std::vector<std::string> GetLibCoreDexLocations() const;
 
   static std::string GetClassPathOption(const char* option,
@@ -183,9 +183,15 @@
     const std::unique_ptr<const DexFile>& dex = dex_files[0];
     CHECK(dex->EnableWrite()) << "Failed to enable write";
     DexFile* dex_file = const_cast<DexFile*>(dex.get());
+    size_t original_size = dex_file->Size();
     mutator(dex_file);
-    const_cast<DexFile::Header&>(dex_file->GetHeader()).checksum_ = dex_file->CalculateChecksum();
-    if (!output_dex->WriteFully(dex->Begin(), dex->Size())) {
+    // NB: mutation might have changed the DEX size in the header.
+    std::vector<uint8_t> copy(dex_file->Begin(), dex_file->Begin() + original_size);
+    copy.resize(dex_file->Size());  // Shrink/expand to new size.
+    uint32_t checksum = DexFile::CalculateChecksum(copy.data(), copy.size());
+    CHECK_GE(copy.size(), sizeof(DexFile::Header));
+    reinterpret_cast<DexFile::Header*>(copy.data())->checksum_ = checksum;
+    if (!output_dex->WriteFully(copy.data(), copy.size())) {
       return false;
     }
     if (output_dex->Flush() != 0) {
@@ -297,41 +303,40 @@
 // matches the given name.
 std::vector<pid_t> GetPidByName(const std::string& process_name);
 
-#define TEST_DISABLED_FOR_TARGET() \
-  if (kIsTargetBuild) { \
-    printf("WARNING: TEST DISABLED FOR TARGET\n"); \
-    return; \
+#define TEST_DISABLED_FOR_TARGET()                       \
+  if (kIsTargetBuild) {                                  \
+    GTEST_SKIP() << "WARNING: TEST DISABLED FOR TARGET"; \
   }
 
-#define TEST_DISABLED_FOR_HOST() \
-  if (!kIsTargetBuild) { \
-    printf("WARNING: TEST DISABLED FOR HOST\n"); \
-    return; \
+#define TEST_DISABLED_FOR_HOST()                       \
+  if (!kIsTargetBuild) {                               \
+    GTEST_SKIP() << "WARNING: TEST DISABLED FOR HOST"; \
   }
 
-#define TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS() \
-  if (!kHostStaticBuildEnabled) { \
-    printf("WARNING: TEST DISABLED FOR NON-STATIC HOST BUILDS\n"); \
-    return; \
+#define TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS()                       \
+  if (!kHostStaticBuildEnabled) {                                        \
+    GTEST_SKIP() << "WARNING: TEST DISABLED FOR NON-STATIC HOST BUILDS"; \
   }
 
-#define TEST_DISABLED_FOR_MEMORY_TOOL() \
-  if (kRunningOnMemoryTool) { \
-    printf("WARNING: TEST DISABLED FOR MEMORY TOOL\n"); \
-    return; \
+#define TEST_DISABLED_FOR_DEBUG_BUILD()                       \
+  if (kIsDebugBuild) {                                        \
+    GTEST_SKIP() << "WARNING: TEST DISABLED FOR DEBUG BUILD"; \
   }
 
-#define TEST_DISABLED_FOR_HEAP_POISONING() \
-  if (kPoisonHeapReferences) { \
-    printf("WARNING: TEST DISABLED FOR HEAP POISONING\n"); \
-    return; \
+#define TEST_DISABLED_FOR_MEMORY_TOOL()                       \
+  if (kRunningOnMemoryTool) {                                 \
+    GTEST_SKIP() << "WARNING: TEST DISABLED FOR MEMORY TOOL"; \
+  }
+
+#define TEST_DISABLED_FOR_HEAP_POISONING()                       \
+  if (kPoisonHeapReferences) {                                   \
+    GTEST_SKIP() << "WARNING: TEST DISABLED FOR HEAP POISONING"; \
   }
 }  // namespace art
 
-#define TEST_DISABLED_FOR_MEMORY_TOOL_WITH_HEAP_POISONING() \
-  if (kRunningOnMemoryTool && kPoisonHeapReferences) { \
-    printf("WARNING: TEST DISABLED FOR MEMORY TOOL WITH HEAP POISONING\n"); \
-    return; \
+#define TEST_DISABLED_FOR_MEMORY_TOOL_WITH_HEAP_POISONING()                       \
+  if (kRunningOnMemoryTool && kPoisonHeapReferences) {                            \
+    GTEST_SKIP() << "WARNING: TEST DISABLED FOR MEMORY TOOL WITH HEAP POISONING"; \
   }
 
 #endif  // ART_LIBARTBASE_BASE_COMMON_ART_TEST_H_
diff --git a/libartbase/base/compiler_filter.cc b/libartbase/base/compiler_filter.cc
index b4f924d..5f86256 100644
--- a/libartbase/base/compiler_filter.cc
+++ b/libartbase/base/compiler_filter.cc
@@ -163,7 +163,7 @@
     *filter = kAssumeVerified;
   } else if (strcmp(option, "interpret-only") == 0) {
     LOG(WARNING) << "'interpret-only' is an obsolete compiler filter name that will be "
-                 << "removed in future releases, please use 'quicken' instead.";
+                 << "removed in future releases, please use 'verify' instead.";
     *filter = kVerify;
   } else if (strcmp(option, "verify-profile") == 0) {
     LOG(WARNING) << "'verify-profile' is an obsolete compiler filter name that will be "
diff --git a/libartbase/base/debug_stack.h b/libartbase/base/debug_stack.h
index 4bbaee8..f3ee310 100644
--- a/libartbase/base/debug_stack.h
+++ b/libartbase/base/debug_stack.h
@@ -55,7 +55,7 @@
 template <>
 class DebugStackReferenceImpl<false> {
  public:
-  explicit DebugStackReferenceImpl(DebugStackRefCounterImpl<false>* counter ATTRIBUTE_UNUSED) {}
+  explicit DebugStackReferenceImpl([[maybe_unused]] DebugStackRefCounterImpl<false>* counter) {}
   DebugStackReferenceImpl(const DebugStackReferenceImpl& other) = default;
   DebugStackReferenceImpl& operator=(const DebugStackReferenceImpl& other) = default;
   void CheckTop() { }
@@ -64,7 +64,7 @@
 template <>
 class DebugStackIndirectTopRefImpl<false> {
  public:
-  explicit DebugStackIndirectTopRefImpl(DebugStackReferenceImpl<false>* ref ATTRIBUTE_UNUSED) {}
+  explicit DebugStackIndirectTopRefImpl([[maybe_unused]] DebugStackReferenceImpl<false>* ref) {}
   DebugStackIndirectTopRefImpl(const DebugStackIndirectTopRefImpl& other) = default;
   DebugStackIndirectTopRefImpl& operator=(const DebugStackIndirectTopRefImpl& other) = default;
   void CheckTop() { }
diff --git a/libartbase/base/file_utils.cc b/libartbase/base/file_utils.cc
index faf5d9d..0573e90 100644
--- a/libartbase/base/file_utils.cc
+++ b/libartbase/base/file_utils.cc
@@ -19,6 +19,7 @@
 #include <inttypes.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+
 #ifndef _WIN32
 #include <sys/wait.h>
 #endif
@@ -44,6 +45,7 @@
 
 #include "android-base/file.h"
 #include "android-base/logging.h"
+#include "android-base/properties.h"
 #include "android-base/stringprintf.h"
 #include "android-base/strings.h"
 #include "base/bit_utils.h"
@@ -70,6 +72,8 @@
 
 namespace art {
 
+using android::base::GetBoolProperty;
+using android::base::GetProperty;
 using android::base::StringPrintf;
 
 static constexpr const char* kClassesDex = "classes.dex";
@@ -378,6 +382,9 @@
   // `<primary-boot-image-stem>-<first-library-name>.art`.
   std::string library_name = GetFirstMainlineFrameworkLibraryName(error_msg);
   if (library_name.empty()) {
+    if (kRuntimeISA == InstructionSet::kRiscv64) {
+      return true;
+    }
     return false;
   }
 
@@ -529,6 +536,34 @@
   return "/nonx/boot.art!/apex/com.android.art/etc/boot-image.prof!/system/etc/boot-image.prof";
 }
 
+std::string GetBootImageLocationForDefaultBcp(bool no_boot_image,
+                                              std::string user_defined_boot_image,
+                                              bool deny_art_apex_data_files,
+                                              std::string* error_msg) {
+  if (no_boot_image) {
+    return GetJitZygoteBootImageLocation();
+  }
+  if (!user_defined_boot_image.empty()) {
+    return user_defined_boot_image;
+  }
+  std::string android_root = GetAndroidRootSafe(error_msg);
+  if (!error_msg->empty()) {
+    return "";
+  }
+  return GetDefaultBootImageLocationSafe(android_root, deny_art_apex_data_files, error_msg);
+}
+
+std::string GetBootImageLocationForDefaultBcpRespectingSysProps(std::string* error_msg) {
+  bool no_boot_image =
+      GetBoolProperty("persist.device_config.runtime_native_boot.profilebootclasspath",
+                      GetBoolProperty("dalvik.vm.profilebootclasspath", /*default_value=*/false));
+  std::string user_defined_boot_image = GetProperty("dalvik.vm.boot-image", /*default_value=*/"");
+  bool deny_art_apex_data_files =
+      !GetBoolProperty("odsign.verification.success", /*default_value=*/false);
+  return GetBootImageLocationForDefaultBcp(
+      no_boot_image, user_defined_boot_image, deny_art_apex_data_files, error_msg);
+}
+
 static /*constinit*/ std::string_view dalvik_cache_sub_dir = "dalvik-cache";
 
 void OverrideDalvikCacheSubDirectory(std::string sub_dir) {
diff --git a/libartbase/base/file_utils.h b/libartbase/base/file_utils.h
index cff6a92..8222a8a1 100644
--- a/libartbase/base/file_utils.h
+++ b/libartbase/base/file_utils.h
@@ -101,6 +101,19 @@
 // Returns the boot image location that forces the runtime to run in JIT Zygote mode.
 std::string GetJitZygoteBootImageLocation();
 
+// A helper function to pick the most appropriate boot image based on the given options.
+// The boot image location can only be used with the default bootclasspath (the value of the
+// BOOTCLASSPATH environment variable).
+std::string GetBootImageLocationForDefaultBcp(bool no_boot_image,
+                                              std::string user_defined_boot_image,
+                                              bool deny_art_apex_data_files,
+                                              std::string* error_msg);
+
+// A helper function to pick the most appropriate boot image based on system properties.
+// The boot image location can only be used with the default bootclasspath (the value of the
+// BOOTCLASSPATH environment variable).
+std::string GetBootImageLocationForDefaultBcpRespectingSysProps(std::string* error_msg);
+
 // Allows the name to be used for the dalvik cache directory (normally "dalvik-cache") to be
 // overridden with a new value.
 void OverrideDalvikCacheSubDirectory(std::string sub_dir);
diff --git a/libartbase/base/globals.h b/libartbase/base/globals.h
index 14e056d..027681a 100644
--- a/libartbase/base/globals.h
+++ b/libartbase/base/globals.h
@@ -20,6 +20,8 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include "base/macros.h"
+
 namespace art {
 
 static constexpr size_t KB = 1024;
@@ -34,21 +36,25 @@
 // Required stack alignment
 static constexpr size_t kStackAlignment = 16;
 
-// System page size. We check this against sysconf(_SC_PAGE_SIZE) at runtime, but use a simple
-// compile-time constant so the compiler can generate better code.
-static constexpr size_t kPageSize = 4096;
+// Minimum supported page size.
+static constexpr size_t kMinPageSize = 4096;
 
-// TODO: Kernels for arm and x86 in both, 32-bit and 64-bit modes use 512 entries per page-table
-// page. Find a way to confirm that in userspace.
-// Address range covered by 1 Page Middle Directory (PMD) entry in the page table
-static constexpr size_t kPMDSize = (kPageSize / sizeof(uint64_t)) * kPageSize;
-// Address range covered by 1 Page Upper Directory (PUD) entry in the page table
-static constexpr size_t kPUDSize = (kPageSize / sizeof(uint64_t)) * kPMDSize;
-// Returns the ideal alignment corresponding to page-table levels for the
-// given size.
-static constexpr size_t BestPageTableAlignment(size_t size) {
-  return size < kPUDSize ? kPMDSize : kPUDSize;
-}
+#if defined(ART_PAGE_SIZE_AGNOSTIC)
+static constexpr bool kPageSizeAgnostic = true;
+// Maximum supported page size.
+static constexpr size_t kMaxPageSize = 16384;
+#else
+static constexpr bool kPageSizeAgnostic = false;
+// Maximum supported page size.
+static constexpr size_t kMaxPageSize = kMinPageSize;
+#endif
+
+// Targets can have different page size (eg. 4kB or 16kB). Because Art can crosscompile, it needs
+// to be able to generate OAT (ELF) and other image files with alignment other than the host page
+// size. kElfSegmentAlignment needs to be equal to the largest page size supported. Effectively,
+// this is the value to be used in images files for aligning contents to page size.
+static constexpr size_t kElfSegmentAlignment = kMaxPageSize;
+
 // Clion, clang analyzer, etc can falsely believe that "if (kIsDebugBuild)" always
 // returns the same value. By wrapping into a call to another constexpr function, we force it
 // to realize that is not actually always evaluating to the same value.
@@ -118,6 +124,25 @@
 static constexpr bool kHostStaticBuildEnabled = false;
 #endif
 
+// Within libart, gPageSize should be used to get the page size value once Runtime is initialized.
+// For most other cases MemMap::GetPageSize() should be used instead. However, where MemMap is
+// unavailable e.g. during static initialization or another stage when MemMap isn't yet initialized,
+// or in a component which might operate without MemMap being initialized, the GetPageSizeSlow()
+// would be generally suitable. For performance-sensitive code, GetPageSizeSlow() shouldn't be used
+// without caching the value to remove repeated calls of the function.
+#ifdef ART_PAGE_SIZE_AGNOSTIC
+inline ALWAYS_INLINE size_t GetPageSizeSlow() {
+  static_assert(kPageSizeAgnostic, "The dynamic version is only for page size agnostic build");
+  static const size_t page_size = sysconf(_SC_PAGE_SIZE);
+  return page_size;
+}
+#else
+constexpr size_t GetPageSizeSlow() {
+  static_assert(!kPageSizeAgnostic, "The constexpr version is only for page size agnostic build");
+  return kMinPageSize;
+}
+#endif
+
 }  // namespace art
 
 #endif  // ART_LIBARTBASE_BASE_GLOBALS_H_
diff --git a/libartbase/base/hash_set.h b/libartbase/base/hash_set.h
index 3f3c8f2..fec9440 100644
--- a/libartbase/base/hash_set.h
+++ b/libartbase/base/hash_set.h
@@ -502,10 +502,10 @@
   // Insert an element with hint.
   // Note: The hint is not very useful for a HashSet<> unless there are many hash conflicts
   // and in that case the use of HashSet<> itself should be reconsidered.
-  std::pair<iterator, bool> insert(const_iterator hint ATTRIBUTE_UNUSED, const T& element) {
+  std::pair<iterator, bool> insert([[maybe_unused]] const_iterator hint, const T& element) {
     return insert(element);
   }
-  std::pair<iterator, bool> insert(const_iterator hint ATTRIBUTE_UNUSED, T&& element) {
+  std::pair<iterator, bool> insert([[maybe_unused]] const_iterator hint, T&& element) {
     return insert(std::move(element));
   }
 
@@ -710,7 +710,7 @@
     if (UNLIKELY(NumBuckets() == 0)) {
       return 0;
     }
-    auto fail_fn = [&](size_t index ATTRIBUTE_UNUSED) ALWAYS_INLINE { return NumBuckets(); };
+    auto fail_fn = [&]([[maybe_unused]] size_t index) ALWAYS_INLINE { return NumBuckets(); };
     return FindIndexImpl(element, hash, fail_fn);
   }
 
diff --git a/libartbase/base/intrusive_forward_list.h b/libartbase/base/intrusive_forward_list.h
index 2e66f3e..f7f7395 100644
--- a/libartbase/base/intrusive_forward_list.h
+++ b/libartbase/base/intrusive_forward_list.h
@@ -35,9 +35,9 @@
   explicit IntrusiveForwardListHook(const IntrusiveForwardListHook* hook) : next_hook(hook) { }
 
   // Allow copyable values but do not copy the hook, it is not part of the value.
-  IntrusiveForwardListHook(const IntrusiveForwardListHook& other ATTRIBUTE_UNUSED)
-      : next_hook(nullptr) { }
-  IntrusiveForwardListHook& operator=(const IntrusiveForwardListHook& src ATTRIBUTE_UNUSED) {
+  explicit IntrusiveForwardListHook([[maybe_unused]] const IntrusiveForwardListHook& other)
+      : next_hook(nullptr) {}
+  IntrusiveForwardListHook& operator=([[maybe_unused]] const IntrusiveForwardListHook& src) {
     return *this;
   }
 
@@ -59,8 +59,14 @@
 class IntrusiveForwardList;
 
 template <typename T, typename HookTraits>
-class IntrusiveForwardListIterator : public std::iterator<std::forward_iterator_tag, T> {
+class IntrusiveForwardListIterator {
  public:
+  using iterator_category = std::forward_iterator_tag;
+  using value_type = T;
+  using difference_type = ptrdiff_t;
+  using pointer = value_type*;
+  using reference = value_type&;
+
   // Construct/copy/destroy (except the private constructor used by IntrusiveForwardList<>).
   IntrusiveForwardListIterator() : hook_(nullptr) { }
   IntrusiveForwardListIterator(const IntrusiveForwardListIterator& src) = default;
diff --git a/libartbase/base/intrusive_forward_list_test.cc b/libartbase/base/intrusive_forward_list_test.cc
index 595210b..180c3d6 100644
--- a/libartbase/base/intrusive_forward_list_test.cc
+++ b/libartbase/base/intrusive_forward_list_test.cc
@@ -578,7 +578,7 @@
   ref.remove_if(odd);
   ifl.remove_if(odd);
   ASSERT_LISTS_EQUAL(ref, ifl);
-  auto all = [](ValueType value ATTRIBUTE_UNUSED) { return true; };
+  auto all = []([[maybe_unused]] ValueType value) { return true; };
   ref.remove_if(all);
   ifl.remove_if(all);
   ASSERT_LISTS_EQUAL(ref, ifl);
diff --git a/libartbase/base/macros.h b/libartbase/base/macros.h
index 5f2100f..3b8b8ff 100644
--- a/libartbase/base/macros.h
+++ b/libartbase/base/macros.h
@@ -110,7 +110,33 @@
 #define LOCKABLE CAPABILITY("mutex")
 #define SHARED_LOCKABLE SHARED_CAPABILITY("mutex")
 
+// Some of the libs (e.g. libarttest(d)) require more public symbols when built
+// in debug configuration.
+// Using symbol visibility only for release builds allows to reduce the list of
+// exported symbols and eliminates the need to check debug build configurations
+// when changing the exported symbols.
+#ifdef NDEBUG
 #define HIDDEN __attribute__((visibility("hidden")))
+#define PROTECTED __attribute__((visibility("protected")))
 #define EXPORT __attribute__((visibility("default")))
+#else
+#define HIDDEN
+#define PROTECTED
+#define EXPORT
+#endif
+
+// Protected symbols must be declared with "protected" visibility attribute when
+// building the library and "default" visibility when referred to from external
+// libraries/binaries. Otherwise, the external code will expect the symbol to be
+// defined locally and fail to link.
+#ifdef BUILDING_LIBART
+#define LIBART_PROTECTED PROTECTED
+#else
+#define LIBART_PROTECTED EXPORT
+#endif
+
+// Some global variables shouldn't be visible outside libraries declaring them.
+// The attribute allows hiding them, so preventing direct access.
+#define ALWAYS_HIDDEN __attribute__((visibility("hidden")))
 
 #endif  // ART_LIBARTBASE_BASE_MACROS_H_
diff --git a/libartbase/base/mem_map.cc b/libartbase/base/mem_map.cc
index 04c11ed..0ab47f2 100644
--- a/libartbase/base/mem_map.cc
+++ b/libartbase/base/mem_map.cc
@@ -89,6 +89,9 @@
 }
 
 std::mutex* MemMap::mem_maps_lock_ = nullptr;
+#ifdef ART_PAGE_SIZE_AGNOSTIC
+size_t MemMap::page_size_ = 0;
+#endif
 
 #if USE_ART_LOW_4G_ALLOCATOR
 // Handling mem_map in 32b address range for 64b architectures that do not support MAP_32BIT.
@@ -103,7 +106,7 @@
 // ART_BASE_ADDR      = 0001XXXXXXXXXXXXXXX
 // ----------------------------------------
 //                    = 0000111111111111111
-// & ~(kPageSize - 1) =~0000000000000001111
+// & ~(page_size - 1) =~0000000000000001111
 // ----------------------------------------
 // mask               = 0000111111111110000
 // & random data      = YYYYYYYYYYYYYYYYYYY
@@ -118,7 +121,7 @@
 
 // Function is standalone so it can be tested somewhat in mem_map_test.cc.
 #ifdef __BIONIC__
-uintptr_t CreateStartPos(uint64_t input) {
+uintptr_t CreateStartPos(uint64_t input, size_t page_size) {
   CHECK_NE(0, ART_BASE_ADDRESS);
 
   // Start with all bits below highest bit in ART_BASE_ADDRESS.
@@ -126,26 +129,26 @@
   constexpr uintptr_t mask_ones = (1 << (31 - leading_zeros)) - 1;
 
   // Lowest (usually 12) bits are not used, as aligned by page size.
-  constexpr uintptr_t mask = mask_ones & ~(kPageSize - 1);
+  const uintptr_t mask = mask_ones & ~(page_size - 1);
 
   // Mask input data.
   return (input & mask) + LOW_MEM_START;
 }
 #endif
 
-static uintptr_t GenerateNextMemPos() {
+static uintptr_t GenerateNextMemPos(size_t page_size) {
 #ifdef __BIONIC__
   uint64_t random_data;
   arc4random_buf(&random_data, sizeof(random_data));
-  return CreateStartPos(random_data);
+  return CreateStartPos(random_data, page_size);
 #else
+  UNUSED(page_size);
   // No arc4random on host, see above.
   return LOW_MEM_START;
 #endif
 }
 
-// Initialize linear scan to random position.
-uintptr_t MemMap::next_mem_pos_ = GenerateNextMemPos();
+uintptr_t MemMap::next_mem_pos_;
 #endif
 
 // Return true if the address range is contained in a single memory map by either reading
@@ -236,7 +239,7 @@
     *error_msg = StringPrintf("Invalid reservation for %s", name);
     return false;
   }
-  DCHECK_ALIGNED(reservation.Begin(), kPageSize);
+  DCHECK_ALIGNED_PARAM(reservation.Begin(), GetPageSize());
   if (reservation.Begin() != expected_ptr) {
     *error_msg = StringPrintf("Bad image reservation start for %s: %p instead of %p",
                               name,
@@ -317,7 +320,7 @@
     *error_msg = "Empty MemMap requested.";
     return Invalid();
   }
-  size_t page_aligned_byte_count = RoundUp(byte_count, kPageSize);
+  size_t page_aligned_byte_count = RoundUp(byte_count, GetPageSize());
 
   int flags = MAP_PRIVATE | MAP_ANONYMOUS;
   if (reuse) {
@@ -393,11 +396,15 @@
                                    size_t alignment,
                                    /*out=*/std::string* error_msg) {
   DCHECK(IsPowerOfTwo(alignment));
-  DCHECK_GT(alignment, kPageSize);
-  // Allocate extra 'alignment - kPageSize' bytes so that the mapping can be aligned.
+  DCHECK_GT(alignment, GetPageSize());
+
+  // Allocate extra 'alignment - GetPageSize()' bytes so that the mapping can be aligned.
   MemMap ret = MapAnonymous(name,
                             /*addr=*/nullptr,
-                            byte_count + alignment - kPageSize,
+                            // AlignBy requires the size to be page-aligned, so
+                            // rounding it here. It is corrected afterwards with
+                            // SetSize after AlignBy.
+                            RoundUp(byte_count, GetPageSize()) + alignment - GetPageSize(),
                             prot,
                             low_4gb,
                             /*reuse=*/false,
@@ -416,7 +423,7 @@
   if (byte_count == 0) {
     return Invalid();
   }
-  const size_t page_aligned_byte_count = RoundUp(byte_count, kPageSize);
+  const size_t page_aligned_byte_count = RoundUp(byte_count, GetPageSize());
   return MemMap(name, addr, byte_count, addr, page_aligned_byte_count, 0, /* reuse= */ true);
 }
 
@@ -543,10 +550,10 @@
     return Invalid();
   }
   // Adjust 'offset' to be page-aligned as required by mmap.
-  int page_offset = start % kPageSize;
+  int page_offset = start % GetPageSize();
   off_t page_aligned_offset = start - page_offset;
   // Adjust 'byte_count' to be page-aligned as we will map this anyway.
-  size_t page_aligned_byte_count = RoundUp(byte_count + page_offset, kPageSize);
+  size_t page_aligned_byte_count = RoundUp(byte_count + page_offset, GetPageSize());
   // The 'expected_ptr' is modified (if specified, ie non-null) to be page aligned to the file but
   // not necessarily to virtual memory. mmap will page align 'expected' for us.
   uint8_t* page_aligned_expected =
@@ -554,7 +561,7 @@
 
   size_t redzone_size = 0;
   if (kRunningOnMemoryTool && kMemoryToolAddsRedzones && expected_ptr == nullptr) {
-    redzone_size = kPageSize;
+    redzone_size = GetPageSize();
     page_aligned_byte_count += redzone_size;
   }
 
@@ -655,9 +662,12 @@
   DCHECK(IsValid());
 
   // Remove it from gMaps.
-  std::lock_guard<std::mutex> mu(*mem_maps_lock_);
-  auto it = GetGMapsEntry(*this);
-  gMaps->erase(it);
+  // TODO(b/307704260) Move MemMap::Init MemMap::Shutdown out of Runtime init/shutdown.
+  if (mem_maps_lock_ != nullptr) {  // Runtime was shutdown.
+    std::lock_guard<std::mutex> mu(*mem_maps_lock_);
+    auto it = GetGMapsEntry(*this);
+    gMaps->erase(it);
+  }
 
   // Mark it as invalid.
   base_size_ = 0u;
@@ -746,10 +756,10 @@
   DCHECK_GE(new_end, Begin());
   DCHECK_LE(new_end, End());
   DCHECK_LE(begin_ + size_, reinterpret_cast<uint8_t*>(base_begin_) + base_size_);
-  DCHECK_ALIGNED(begin_, kPageSize);
-  DCHECK_ALIGNED(base_begin_, kPageSize);
-  DCHECK_ALIGNED(reinterpret_cast<uint8_t*>(base_begin_) + base_size_, kPageSize);
-  DCHECK_ALIGNED(new_end, kPageSize);
+  DCHECK_ALIGNED_PARAM(begin_, GetPageSize());
+  DCHECK_ALIGNED_PARAM(base_begin_, GetPageSize());
+  DCHECK_ALIGNED_PARAM(reinterpret_cast<uint8_t*>(base_begin_) + base_size_, GetPageSize());
+  DCHECK_ALIGNED_PARAM(new_end, GetPageSize());
   uint8_t* old_end = begin_ + size_;
   uint8_t* old_base_end = reinterpret_cast<uint8_t*>(base_begin_) + base_size_;
   uint8_t* new_base_end = new_end;
@@ -764,7 +774,7 @@
   uint8_t* tail_base_begin = new_base_end;
   size_t tail_base_size = old_base_end - new_base_end;
   DCHECK_EQ(tail_base_begin + tail_base_size, old_base_end);
-  DCHECK_ALIGNED(tail_base_size, kPageSize);
+  DCHECK_ALIGNED_PARAM(tail_base_size, GetPageSize());
 
   MEMORY_TOOL_MAKE_UNDEFINED(tail_base_begin, tail_base_size);
   // Note: Do not explicitly unmap the tail region, mmap() with MAP_FIXED automatically
@@ -803,7 +813,7 @@
 MemMap MemMap::TakeReservedMemory(size_t byte_count, bool reuse) {
   uint8_t* begin = Begin();
   ReleaseReservedMemory(byte_count);  // Performs necessary DCHECK()s on this reservation.
-  size_t base_size = RoundUp(byte_count, kPageSize);
+  size_t base_size = RoundUp(byte_count, GetPageSize());
   return MemMap(name_, begin, byte_count, begin, base_size, prot_, reuse);
 }
 
@@ -815,13 +825,13 @@
   DCHECK_EQ(redzone_size_, 0u);
   DCHECK_EQ(begin_, base_begin_);
   DCHECK_EQ(size_, base_size_);
-  DCHECK_ALIGNED(begin_, kPageSize);
-  DCHECK_ALIGNED(size_, kPageSize);
+  DCHECK_ALIGNED_PARAM(begin_, GetPageSize());
+  DCHECK_ALIGNED_PARAM(size_, GetPageSize());
 
   // Check and round up the `byte_count`.
   DCHECK_NE(byte_count, 0u);
   DCHECK_LE(byte_count, size_);
-  byte_count = RoundUp(byte_count, kPageSize);
+  byte_count = RoundUp(byte_count, GetPageSize());
 
   if (byte_count == size_) {
     Invalidate();
@@ -839,20 +849,9 @@
   }
 }
 
-void MemMap::MadviseDontNeedAndZero() {
-  if (base_begin_ != nullptr || base_size_ != 0) {
-    if (!kMadviseZeroes) {
-      memset(base_begin_, 0, base_size_);
-    }
-#ifdef _WIN32
-    // It is benign not to madvise away the pages here.
-    PLOG(WARNING) << "MemMap::MadviseDontNeedAndZero does not madvise on Windows.";
-#else
-    int result = madvise(base_begin_, base_size_, MADV_DONTNEED);
-    if (result == -1) {
-      PLOG(WARNING) << "madvise failed";
-    }
-#endif
+void MemMap::FillWithZero(bool release_eagerly) {
+  if (base_begin_ != nullptr && base_size_ != 0) {
+    ZeroMemory(base_begin_, base_size_, release_eagerly);
   }
 }
 
@@ -947,7 +946,7 @@
     size_t num_gaps = 0;
     size_t num = 1u;
     size_t size = map->BaseSize();
-    CHECK_ALIGNED(size, kPageSize);
+    CHECK_ALIGNED_PARAM(size, GetPageSize());
     void* end = map->BaseEnd();
     while (it != maps_end &&
         it->second->GetProtect() == map->GetProtect() &&
@@ -955,24 +954,24 @@
         (it->second->BaseBegin() == end || num_gaps < kMaxGaps)) {
       if (it->second->BaseBegin() != end) {
         ++num_gaps;
-        os << "+0x" << std::hex << (size / kPageSize) << "P";
+        os << "+0x" << std::hex << (size / GetPageSize()) << "P";
         if (num != 1u) {
           os << "(" << std::dec << num << ")";
         }
         size_t gap =
             reinterpret_cast<uintptr_t>(it->second->BaseBegin()) - reinterpret_cast<uintptr_t>(end);
-        CHECK_ALIGNED(gap, kPageSize);
-        os << "~0x" << std::hex << (gap / kPageSize) << "P";
+        CHECK_ALIGNED_PARAM(gap, GetPageSize());
+        os << "~0x" << std::hex << (gap / GetPageSize()) << "P";
         num = 0u;
         size = 0u;
       }
-      CHECK_ALIGNED(it->second->BaseSize(), kPageSize);
+      CHECK_ALIGNED_PARAM(it->second->BaseSize(), GetPageSize());
       ++num;
       size += it->second->BaseSize();
       end = it->second->BaseEnd();
       ++it;
     }
-    os << "+0x" << std::hex << (size / kPageSize) << "P";
+    os << "+0x" << std::hex << (size / GetPageSize()) << "P";
     if (num != 1u) {
       os << "(" << std::dec << num << ")";
     }
@@ -1012,9 +1011,20 @@
     // dex2oat calls MemMap::Init twice since its needed before the runtime is created.
     return;
   }
+
   mem_maps_lock_ = new std::mutex();
   // Not for thread safety, but for the annotation that gMaps is GUARDED_BY(mem_maps_lock_).
   std::lock_guard<std::mutex> mu(*mem_maps_lock_);
+#ifdef ART_PAGE_SIZE_AGNOSTIC
+  page_size_ = GetPageSizeSlow();
+#endif
+  CHECK_GE(GetPageSize(), kMinPageSize);
+  CHECK_LE(GetPageSize(), kMaxPageSize);
+#if USE_ART_LOW_4G_ALLOCATOR
+  // Initialize linear scan to random position.
+  CHECK_EQ(next_mem_pos_, 0u);
+  next_mem_pos_ = GenerateNextMemPos(GetPageSize());
+#endif
   DCHECK(gMaps == nullptr);
   gMaps = new Maps;
 
@@ -1035,6 +1045,9 @@
     delete gMaps;
     gMaps = nullptr;
   }
+#if USE_ART_LOW_4G_ALLOCATOR
+  next_mem_pos_ = 0u;
+#endif
   delete mem_maps_lock_;
   mem_maps_lock_ = nullptr;
 }
@@ -1042,7 +1055,7 @@
 void MemMap::SetSize(size_t new_size) {
   CHECK_LE(new_size, size_);
   size_t new_base_size = RoundUp(new_size + static_cast<size_t>(PointerDiff(Begin(), BaseBegin())),
-                                 kPageSize);
+                                 GetPageSize());
   if (new_base_size == base_size_) {
     size_ = new_size;
     return;
@@ -1071,7 +1084,7 @@
   bool first_run = true;
 
   std::lock_guard<std::mutex> mu(*mem_maps_lock_);
-  for (uintptr_t ptr = next_mem_pos_; ptr < 4 * GB; ptr += kPageSize) {
+  for (uintptr_t ptr = next_mem_pos_; ptr < 4 * GB; ptr += GetPageSize()) {
     // Use gMaps as an optimization to skip over large maps.
     // Find the first map which is address > ptr.
     auto it = gMaps->upper_bound(reinterpret_cast<void*>(ptr));
@@ -1080,7 +1093,7 @@
       --before_it;
       // Start at the end of the map before the upper bound.
       ptr = std::max(ptr, reinterpret_cast<uintptr_t>(before_it->second->BaseEnd()));
-      CHECK_ALIGNED(ptr, kPageSize);
+      CHECK_ALIGNED_PARAM(ptr, GetPageSize());
     }
     while (it != gMaps->end()) {
       // How much space do we have until the next map?
@@ -1091,7 +1104,7 @@
       }
       // Otherwise, skip to the end of the map.
       ptr = reinterpret_cast<uintptr_t>(it->second->BaseEnd());
-      CHECK_ALIGNED(ptr, kPageSize);
+      CHECK_ALIGNED_PARAM(ptr, GetPageSize());
       ++it;
     }
 
@@ -1106,7 +1119,7 @@
       // Not enough memory until 4GB.
       if (first_run) {
         // Try another time from the bottom;
-        ptr = LOW_MEM_START - kPageSize;
+        ptr = LOW_MEM_START - GetPageSize();
         first_run = false;
         continue;
       } else {
@@ -1119,8 +1132,8 @@
 
     // Check pages are free.
     bool safe = true;
-    for (tail_ptr = ptr; tail_ptr < ptr + length; tail_ptr += kPageSize) {
-      if (msync(reinterpret_cast<void*>(tail_ptr), kPageSize, 0) == 0) {
+    for (tail_ptr = ptr; tail_ptr < ptr + length; tail_ptr += GetPageSize()) {
+      if (msync(reinterpret_cast<void*>(tail_ptr), GetPageSize(), 0) == 0) {
         safe = false;
         break;
       } else {
@@ -1176,7 +1189,7 @@
 #else
   UNUSED(low_4gb);
 #endif
-  DCHECK_ALIGNED(length, kPageSize);
+  DCHECK_ALIGNED_PARAM(length, GetPageSize());
   // TODO:
   // A page allocator would be a useful abstraction here, as
   // 1) It is doubtful that MAP_32BIT on x86_64 is doing the right job for us
@@ -1235,48 +1248,107 @@
   CHECK_NE(prot_ & PROT_READ, 0);
   volatile uint8_t* begin = reinterpret_cast<volatile uint8_t*>(base_begin_);
   volatile uint8_t* end = begin + base_size_;
-  DCHECK(IsAligned<kPageSize>(begin));
-  DCHECK(IsAligned<kPageSize>(end));
+  DCHECK(IsAlignedParam(begin, GetPageSize()));
+  DCHECK(IsAlignedParam(end, GetPageSize()));
   // Read the first byte of each page. Use volatile to prevent the compiler from optimizing away the
   // reads.
-  for (volatile uint8_t* ptr = begin; ptr < end; ptr += kPageSize) {
+  for (volatile uint8_t* ptr = begin; ptr < end; ptr += GetPageSize()) {
     // This read could fault if protection wasn't set correctly.
     uint8_t value = *ptr;
     UNUSED(value);
   }
 }
 
-void ZeroAndReleasePages(void* address, size_t length) {
+static void inline RawClearMemory(uint8_t* begin, uint8_t* end) {
+  std::fill(begin, end, 0);
+}
+
+#if defined(__linux__)
+static inline void ClearMemory(uint8_t* page_begin, size_t size, bool resident, size_t page_size) {
+  DCHECK(IsAlignedParam(page_begin, page_size));
+  DCHECK(IsAlignedParam(page_begin + size, page_size));
+  if (resident) {
+    RawClearMemory(page_begin, page_begin + size);
+    // Note we check madvise return value against -1, as it seems old kernels
+    // can return 1.
+#ifdef MADV_FREE
+    bool res = madvise(page_begin, size, MADV_FREE);
+    CHECK_NE(res, -1) << "madvise failed";
+#endif  // MADV_FREE
+  } else {
+    bool res = madvise(page_begin, size, MADV_DONTNEED);
+    CHECK_NE(res, -1) << "madvise failed";
+  }
+}
+#endif  // __linux__
+
+void ZeroMemory(void* address, size_t length, bool release_eagerly) {
   if (length == 0) {
     return;
   }
   uint8_t* const mem_begin = reinterpret_cast<uint8_t*>(address);
   uint8_t* const mem_end = mem_begin + length;
-  uint8_t* const page_begin = AlignUp(mem_begin, kPageSize);
-  uint8_t* const page_end = AlignDown(mem_end, kPageSize);
+  uint8_t* const page_begin = AlignUp(mem_begin, MemMap::GetPageSize());
+  uint8_t* const page_end = AlignDown(mem_end, MemMap::GetPageSize());
   if (!kMadviseZeroes || page_begin >= page_end) {
     // No possible area to madvise.
-    std::fill(mem_begin, mem_end, 0);
-  } else {
-    // Spans one or more pages.
-    DCHECK_LE(mem_begin, page_begin);
-    DCHECK_LE(page_begin, page_end);
-    DCHECK_LE(page_end, mem_end);
-    std::fill(mem_begin, page_begin, 0);
-#ifdef _WIN32
-    LOG(WARNING) << "ZeroAndReleasePages does not madvise on Windows.";
-#else
-    CHECK_NE(madvise(page_begin, page_end - page_begin, MADV_DONTNEED), -1) << "madvise failed";
-#endif
-    std::fill(page_end, mem_end, 0);
+    RawClearMemory(mem_begin, mem_end);
+    return;
   }
+  // Spans one or more pages.
+  DCHECK_LE(mem_begin, page_begin);
+  DCHECK_LE(page_begin, page_end);
+  DCHECK_LE(page_end, mem_end);
+#ifdef _WIN32
+  UNUSED(release_eagerly);
+  LOG(WARNING) << "ZeroMemory does not madvise on Windows.";
+  RawClearMemory(mem_begin, mem_end);
+#else
+  RawClearMemory(mem_begin, page_begin);
+  RawClearMemory(page_end, mem_end);
+// mincore() is linux-specific syscall.
+#if defined(__linux__)
+  if (!release_eagerly) {
+    size_t vec_len = (page_end - page_begin) / MemMap::GetPageSize();
+    std::unique_ptr<unsigned char[]> vec(new unsigned char[vec_len]);
+    if (mincore(page_begin, page_end - page_begin, vec.get()) == 0) {
+      uint8_t* current_page = page_begin;
+      size_t current_size = MemMap::GetPageSize();
+      uint32_t old_state = vec[0] & 0x1;
+      for (size_t i = 1; i < vec_len; ++i) {
+        uint32_t new_state = vec[i] & 0x1;
+        if (old_state == new_state) {
+          current_size += MemMap::GetPageSize();
+        } else {
+          ClearMemory(current_page, current_size, old_state, MemMap::GetPageSize());
+          current_page = current_page + current_size;
+          current_size = MemMap::GetPageSize();
+          old_state = new_state;
+        }
+      }
+      ClearMemory(current_page, current_size, old_state, MemMap::GetPageSize());
+      return;
+    }
+    static bool logged_about_mincore = false;
+    if (!logged_about_mincore) {
+      PLOG(WARNING) << "mincore failed, falling back to madvise MADV_DONTNEED";
+      logged_about_mincore = true;
+    }
+    // mincore failed, fall through to MADV_DONTNEED.
+  }
+#else
+  UNUSED(release_eagerly);
+#endif  // __linux__
+  bool res = madvise(page_begin, page_end - page_begin, MADV_DONTNEED);
+  CHECK_NE(res, -1) << "madvise failed";
+#endif  // _WIN32
 }
 
 void MemMap::AlignBy(size_t alignment, bool align_both_ends) {
   CHECK_EQ(begin_, base_begin_) << "Unsupported";
   CHECK_EQ(size_, base_size_) << "Unsupported";
-  CHECK_GT(alignment, static_cast<size_t>(kPageSize));
-  CHECK_ALIGNED(alignment, kPageSize);
+  CHECK_GT(alignment, static_cast<size_t>(GetPageSize()));
+  CHECK_ALIGNED_PARAM(alignment, GetPageSize());
   CHECK(!reuse_);
   if (IsAlignedParam(reinterpret_cast<uintptr_t>(base_begin_), alignment) &&
       (!align_both_ends || IsAlignedParam(base_size_, alignment))) {
diff --git a/libartbase/base/mem_map.h b/libartbase/base/mem_map.h
index 98fb69d..90e2031 100644
--- a/libartbase/base/mem_map.h
+++ b/libartbase/base/mem_map.h
@@ -25,6 +25,8 @@
 #include <string>
 
 #include "android-base/thread_annotations.h"
+#include "bit_utils.h"
+#include "globals.h"
 #include "macros.h"
 
 namespace art {
@@ -139,9 +141,11 @@
                              /*out*/std::string* error_msg,
                              bool use_debug_name = true);
 
-  // Request an aligned anonymous region. We can't directly ask for a MAP_SHARED (anonymous or
-  // otherwise) mapping to be aligned as in that case file offset is involved and could make
-  // the starting offset to be out of sync with another mapping of the same file.
+  // Request an aligned anonymous region, where the alignment must be higher
+  // than the runtime gPageSize. We can't directly ask for a MAP_SHARED
+  // (anonymous or otherwise) mapping to be aligned as in that case file offset
+  // is involved and could make the starting offset to be out of sync with
+  // another mapping of the same file.
   static MemMap MapAnonymousAligned(const char* name,
                                     size_t byte_count,
                                     int prot,
@@ -242,7 +246,10 @@
 
   bool Protect(int prot);
 
-  void MadviseDontNeedAndZero();
+  void FillWithZero(bool release_eagerly);
+  void MadviseDontNeedAndZero() {
+    FillWithZero(/* release_eagerly= */ true);
+  }
   int MadviseDontFork();
 
   int GetProtect() const {
@@ -339,6 +346,17 @@
   // 'redzone_size_ == 0' indicates that we are not using memory-tool on this mapping.
   size_t GetRedzoneSize() const { return redzone_size_; }
 
+#ifdef ART_PAGE_SIZE_AGNOSTIC
+  static inline size_t GetPageSize() {
+    DCHECK_NE(page_size_, 0u);
+    return page_size_;
+  }
+#else
+  static constexpr size_t GetPageSize() {
+    return GetPageSizeSlow();
+  }
+#endif
+
  private:
   MemMap(const std::string& name,
          uint8_t* begin,
@@ -428,6 +446,10 @@
 
   static std::mutex* mem_maps_lock_;
 
+#ifdef ART_PAGE_SIZE_AGNOSTIC
+  static size_t page_size_;
+#endif
+
   friend class MemMapTest;  // To allow access to base_begin_ and base_size_.
 };
 
@@ -437,8 +459,11 @@
 
 std::ostream& operator<<(std::ostream& os, const MemMap& mem_map);
 
-// Zero and release pages if possible, no requirements on alignments.
-void ZeroAndReleasePages(void* address, size_t length);
+// Zero and maybe release memory if possible, no requirements on alignments.
+void ZeroMemory(void* address, size_t length, bool release_eagerly);
+inline void ZeroAndReleaseMemory(void* address, size_t length) {
+  ZeroMemory(address, length, /* release_eagerly= */ true);
+}
 
 }  // namespace art
 
diff --git a/libartbase/base/mem_map_test.cc b/libartbase/base/mem_map_test.cc
index 64fd6c0..37f5b5a 100644
--- a/libartbase/base/mem_map_test.cc
+++ b/libartbase/base/mem_map_test.cc
@@ -64,7 +64,7 @@
   static void RemapAtEndTest(bool low_4gb) {
     std::string error_msg;
     // Cast the page size to size_t.
-    const size_t page_size = static_cast<size_t>(kPageSize);
+    const size_t page_size = MemMap::GetPageSize();
     // Map a two-page memory region.
     MemMap m0 = MemMap::MapAnonymous("MemMapTest_RemapAtEndTest_map0",
                                      2 * page_size,
@@ -134,25 +134,31 @@
 #if defined(__LP64__) && !defined(__x86_64__)
 
 #ifdef __BIONIC__
-extern uintptr_t CreateStartPos(uint64_t input);
+extern uintptr_t CreateStartPos(uint64_t input, uint64_t page_size);
 #endif
 
+TEST_F(MemMapTest, PageSize) {
+  const size_t page_size = MemMap::GetPageSize();
+  EXPECT_EQ(page_size, GetPageSizeSlow());
+}
+
 TEST_F(MemMapTest, Start) {
   CommonInit();
   uintptr_t start = GetLinearScanPos();
   EXPECT_LE(64 * KB, start);
   EXPECT_LT(start, static_cast<uintptr_t>(ART_BASE_ADDRESS));
 #ifdef __BIONIC__
+  const size_t page_size = MemMap::GetPageSize();
   // Test a couple of values. Make sure they are different.
   uintptr_t last = 0;
   for (size_t i = 0; i < 100; ++i) {
-    uintptr_t random_start = CreateStartPos(i * kPageSize);
+    uintptr_t random_start = CreateStartPos(i * page_size, page_size);
     EXPECT_NE(last, random_start);
     last = random_start;
   }
 
   // Even on max, should be below ART_BASE_ADDRESS.
-  EXPECT_LT(CreateStartPos(~0), static_cast<uintptr_t>(ART_BASE_ADDRESS));
+  EXPECT_LT(CreateStartPos(~0, page_size), static_cast<uintptr_t>(ART_BASE_ADDRESS));
 #endif
   // End of test.
 }
@@ -161,15 +167,16 @@
 // We need mremap to be able to test ReplaceMapping at all
 #if HAVE_MREMAP_SYSCALL
 TEST_F(MemMapTest, ReplaceMapping_SameSize) {
+  const size_t page_size = MemMap::GetPageSize();
   std::string error_msg;
   MemMap dest = MemMap::MapAnonymous("MapAnonymousEmpty-atomic-replace-dest",
-                                     kPageSize,
+                                     page_size,
                                      PROT_READ,
                                      /*low_4gb=*/ false,
                                      &error_msg);
   ASSERT_TRUE(dest.IsValid());
   MemMap source = MemMap::MapAnonymous("MapAnonymous-atomic-replace-source",
-                                       kPageSize,
+                                       page_size,
                                        PROT_WRITE | PROT_READ,
                                        /*low_4gb=*/ false,
                                        &error_msg);
@@ -179,7 +186,7 @@
   ASSERT_TRUE(IsAddressMapped(source_addr));
   ASSERT_TRUE(IsAddressMapped(dest_addr));
 
-  std::vector<uint8_t> data = RandomData(kPageSize);
+  std::vector<uint8_t> data = RandomData(page_size);
   memcpy(source.Begin(), data.data(), data.size());
 
   ASSERT_TRUE(dest.ReplaceWith(&source, &error_msg)) << error_msg;
@@ -188,15 +195,16 @@
   ASSERT_TRUE(IsAddressMapped(dest_addr));
   ASSERT_FALSE(source.IsValid());
 
-  ASSERT_EQ(dest.Size(), static_cast<size_t>(kPageSize));
+  ASSERT_EQ(dest.Size(), static_cast<size_t>(page_size));
 
   ASSERT_EQ(memcmp(dest.Begin(), data.data(), dest.Size()), 0);
 }
 
 TEST_F(MemMapTest, ReplaceMapping_MakeLarger) {
+  const size_t page_size = MemMap::GetPageSize();
   std::string error_msg;
   MemMap dest = MemMap::MapAnonymous("MapAnonymousEmpty-atomic-replace-dest",
-                                     5 * kPageSize,  // Need to make it larger
+                                     5 * page_size,  // Need to make it larger
                                                      // initially so we know
                                                      // there won't be mappings
                                                      // in the way when we move
@@ -206,7 +214,7 @@
                                      &error_msg);
   ASSERT_TRUE(dest.IsValid());
   MemMap source = MemMap::MapAnonymous("MapAnonymous-atomic-replace-source",
-                                       3 * kPageSize,
+                                       3 * page_size,
                                        PROT_WRITE | PROT_READ,
                                        /*low_4gb=*/ false,
                                        &error_msg);
@@ -216,37 +224,38 @@
   ASSERT_TRUE(IsAddressMapped(source_addr));
 
   // Fill the source with random data.
-  std::vector<uint8_t> data = RandomData(3 * kPageSize);
+  std::vector<uint8_t> data = RandomData(3 * page_size);
   memcpy(source.Begin(), data.data(), data.size());
 
   // Make the dest smaller so that we know we'll have space.
-  dest.SetSize(kPageSize);
+  dest.SetSize(page_size);
 
   ASSERT_TRUE(IsAddressMapped(dest_addr));
-  ASSERT_FALSE(IsAddressMapped(dest_addr + 2 * kPageSize));
-  ASSERT_EQ(dest.Size(), static_cast<size_t>(kPageSize));
+  ASSERT_FALSE(IsAddressMapped(dest_addr + 2 * page_size));
+  ASSERT_EQ(dest.Size(), static_cast<size_t>(page_size));
 
   ASSERT_TRUE(dest.ReplaceWith(&source, &error_msg)) << error_msg;
 
   ASSERT_FALSE(IsAddressMapped(source_addr));
-  ASSERT_EQ(dest.Size(), static_cast<size_t>(3 * kPageSize));
+  ASSERT_EQ(dest.Size(), static_cast<size_t>(3 * page_size));
   ASSERT_TRUE(IsAddressMapped(dest_addr));
-  ASSERT_TRUE(IsAddressMapped(dest_addr + 2 * kPageSize));
+  ASSERT_TRUE(IsAddressMapped(dest_addr + 2 * page_size));
   ASSERT_FALSE(source.IsValid());
 
   ASSERT_EQ(memcmp(dest.Begin(), data.data(), dest.Size()), 0);
 }
 
 TEST_F(MemMapTest, ReplaceMapping_MakeSmaller) {
+  const size_t page_size = MemMap::GetPageSize();
   std::string error_msg;
   MemMap dest = MemMap::MapAnonymous("MapAnonymousEmpty-atomic-replace-dest",
-                                     3 * kPageSize,
+                                     3 * page_size,
                                      PROT_READ,
                                      /*low_4gb=*/ false,
                                      &error_msg);
   ASSERT_TRUE(dest.IsValid());
   MemMap source = MemMap::MapAnonymous("MapAnonymous-atomic-replace-source",
-                                       kPageSize,
+                                       page_size,
                                        PROT_WRITE | PROT_READ,
                                        /*low_4gb=*/ false,
                                        &error_msg);
@@ -255,59 +264,60 @@
   uint8_t* dest_addr = dest.Begin();
   ASSERT_TRUE(IsAddressMapped(source_addr));
   ASSERT_TRUE(IsAddressMapped(dest_addr));
-  ASSERT_TRUE(IsAddressMapped(dest_addr + 2 * kPageSize));
-  ASSERT_EQ(dest.Size(), static_cast<size_t>(3 * kPageSize));
+  ASSERT_TRUE(IsAddressMapped(dest_addr + 2 * page_size));
+  ASSERT_EQ(dest.Size(), static_cast<size_t>(3 * page_size));
 
-  std::vector<uint8_t> data = RandomData(kPageSize);
-  memcpy(source.Begin(), data.data(), kPageSize);
+  std::vector<uint8_t> data = RandomData(page_size);
+  memcpy(source.Begin(), data.data(), page_size);
 
   ASSERT_TRUE(dest.ReplaceWith(&source, &error_msg)) << error_msg;
 
   ASSERT_FALSE(IsAddressMapped(source_addr));
-  ASSERT_EQ(dest.Size(), static_cast<size_t>(kPageSize));
+  ASSERT_EQ(dest.Size(), static_cast<size_t>(page_size));
   ASSERT_TRUE(IsAddressMapped(dest_addr));
-  ASSERT_FALSE(IsAddressMapped(dest_addr + 2 * kPageSize));
+  ASSERT_FALSE(IsAddressMapped(dest_addr + 2 * page_size));
   ASSERT_FALSE(source.IsValid());
 
   ASSERT_EQ(memcmp(dest.Begin(), data.data(), dest.Size()), 0);
 }
 
 TEST_F(MemMapTest, ReplaceMapping_FailureOverlap) {
+  const size_t page_size = MemMap::GetPageSize();
   std::string error_msg;
   MemMap dest =
       MemMap::MapAnonymous(
           "MapAnonymousEmpty-atomic-replace-dest",
-          3 * kPageSize,  // Need to make it larger initially so we know there won't be mappings in
+          3 * page_size,  // Need to make it larger initially so we know there won't be mappings in
                           // the way when we move source.
           PROT_READ | PROT_WRITE,
           /*low_4gb=*/ false,
           &error_msg);
   ASSERT_TRUE(dest.IsValid());
   // Resize down to 1 page so we can remap the rest.
-  dest.SetSize(kPageSize);
+  dest.SetSize(page_size);
   // Create source from the last 2 pages
   MemMap source = MemMap::MapAnonymous("MapAnonymous-atomic-replace-source",
-                                       dest.Begin() + kPageSize,
-                                       2 * kPageSize,
+                                       dest.Begin() + page_size,
+                                       2 * page_size,
                                        PROT_WRITE | PROT_READ,
                                        /*low_4gb=*/ false,
                                        /*reuse=*/ false,
                                        /*reservation=*/ nullptr,
                                        &error_msg);
   ASSERT_TRUE(source.IsValid());
-  ASSERT_EQ(dest.Begin() + kPageSize, source.Begin());
+  ASSERT_EQ(dest.Begin() + page_size, source.Begin());
   uint8_t* source_addr = source.Begin();
   uint8_t* dest_addr = dest.Begin();
   ASSERT_TRUE(IsAddressMapped(source_addr));
 
   // Fill the source and dest with random data.
-  std::vector<uint8_t> data = RandomData(2 * kPageSize);
+  std::vector<uint8_t> data = RandomData(2 * page_size);
   memcpy(source.Begin(), data.data(), data.size());
-  std::vector<uint8_t> dest_data = RandomData(kPageSize);
+  std::vector<uint8_t> dest_data = RandomData(page_size);
   memcpy(dest.Begin(), dest_data.data(), dest_data.size());
 
   ASSERT_TRUE(IsAddressMapped(dest_addr));
-  ASSERT_EQ(dest.Size(), static_cast<size_t>(kPageSize));
+  ASSERT_EQ(dest.Size(), static_cast<size_t>(page_size));
 
   ASSERT_FALSE(dest.ReplaceWith(&source, &error_msg)) << error_msg;
 
@@ -323,6 +333,7 @@
 
 TEST_F(MemMapTest, MapAnonymousEmpty) {
   CommonInit();
+  const size_t page_size = MemMap::GetPageSize();
   std::string error_msg;
   MemMap map = MemMap::MapAnonymous("MapAnonymousEmpty",
                                     /*byte_count=*/ 0,
@@ -334,7 +345,7 @@
 
   error_msg.clear();
   map = MemMap::MapAnonymous("MapAnonymousNonEmpty",
-                             kPageSize,
+                             page_size,
                              PROT_READ | PROT_WRITE,
                              /*low_4gb=*/ false,
                              &error_msg);
@@ -344,9 +355,10 @@
 
 TEST_F(MemMapTest, MapAnonymousFailNullError) {
   CommonInit();
+  const size_t page_size = MemMap::GetPageSize();
   // Test that we don't crash with a null error_str when mapping at an invalid location.
   MemMap map = MemMap::MapAnonymous("MapAnonymousInvalid",
-                                    reinterpret_cast<uint8_t*>(kPageSize),
+                                    reinterpret_cast<uint8_t*>(static_cast<size_t>(page_size)),
                                     0x20000,
                                     PROT_READ | PROT_WRITE,
                                     /*low_4gb=*/ false,
@@ -359,6 +371,7 @@
 #ifdef __LP64__
 TEST_F(MemMapTest, MapAnonymousEmpty32bit) {
   CommonInit();
+  const size_t page_size = MemMap::GetPageSize();
   std::string error_msg;
   MemMap map = MemMap::MapAnonymous("MapAnonymousEmpty",
                                     /*byte_count=*/ 0,
@@ -370,7 +383,7 @@
 
   error_msg.clear();
   map = MemMap::MapAnonymous("MapAnonymousNonEmpty",
-                             kPageSize,
+                             page_size,
                              PROT_READ | PROT_WRITE,
                              /*low_4gb=*/ true,
                              &error_msg);
@@ -382,10 +395,10 @@
   CommonInit();
   std::string error_msg;
   ScratchFile scratch_file;
-  constexpr size_t kMapSize = kPageSize;
-  std::unique_ptr<uint8_t[]> data(new uint8_t[kMapSize]());
-  ASSERT_TRUE(scratch_file.GetFile()->WriteFully(&data[0], kMapSize));
-  MemMap map = MemMap::MapFile(/*byte_count=*/kMapSize,
+  const size_t map_size = MemMap::GetPageSize();
+  std::unique_ptr<uint8_t[]> data(new uint8_t[map_size]());
+  ASSERT_TRUE(scratch_file.GetFile()->WriteFully(&data[0], map_size));
+  MemMap map = MemMap::MapFile(/*byte_count=*/map_size,
                                PROT_READ,
                                MAP_PRIVATE,
                                scratch_file.GetFd(),
@@ -395,7 +408,7 @@
                                &error_msg);
   ASSERT_TRUE(map.IsValid()) << error_msg;
   ASSERT_TRUE(error_msg.empty());
-  ASSERT_EQ(map.Size(), kMapSize);
+  ASSERT_EQ(map.Size(), map_size);
   ASSERT_LT(reinterpret_cast<uintptr_t>(map.BaseBegin()), 1ULL << 32);
 }
 #endif
@@ -408,13 +421,14 @@
   TEST_DISABLED_FOR_MEMORY_TOOL();
 
   CommonInit();
+  const size_t page_size = MemMap::GetPageSize();
   std::string error_msg;
   // Find a valid address.
-  uint8_t* valid_address = GetValidMapAddress(kPageSize, /*low_4gb=*/false);
+  uint8_t* valid_address = GetValidMapAddress(page_size, /*low_4gb=*/false);
   // Map at an address that should work, which should succeed.
   MemMap map0 = MemMap::MapAnonymous("MapAnonymous0",
                                      valid_address,
-                                     kPageSize,
+                                     page_size,
                                      PROT_READ | PROT_WRITE,
                                      /*low_4gb=*/ false,
                                      /*reuse=*/ false,
@@ -425,7 +439,7 @@
   ASSERT_TRUE(map0.BaseBegin() == valid_address);
   // Map at an unspecified address, which should succeed.
   MemMap map1 = MemMap::MapAnonymous("MapAnonymous1",
-                                     kPageSize,
+                                     page_size,
                                      PROT_READ | PROT_WRITE,
                                      /*low_4gb=*/ false,
                                      &error_msg);
@@ -435,7 +449,7 @@
   // Attempt to map at the same address, which should fail.
   MemMap map2 = MemMap::MapAnonymous("MapAnonymous2",
                                      reinterpret_cast<uint8_t*>(map1.BaseBegin()),
-                                     kPageSize,
+                                     page_size,
                                      PROT_READ | PROT_WRITE,
                                      /*low_4gb=*/ false,
                                      /*reuse=*/ false,
@@ -457,19 +471,20 @@
 
 TEST_F(MemMapTest, RemapFileViewAtEnd) {
   CommonInit();
+  const size_t page_size = MemMap::GetPageSize();
   std::string error_msg;
   ScratchFile scratch_file;
 
   // Create a scratch file 3 pages large.
-  constexpr size_t kMapSize = 3 * kPageSize;
-  std::unique_ptr<uint8_t[]> data(new uint8_t[kMapSize]());
-  memset(data.get(), 1, kPageSize);
-  memset(&data[0], 0x55, kPageSize);
-  memset(&data[kPageSize], 0x5a, kPageSize);
-  memset(&data[2 * kPageSize], 0xaa, kPageSize);
-  ASSERT_TRUE(scratch_file.GetFile()->WriteFully(&data[0], kMapSize));
+  const size_t map_size = 3 * page_size;
+  std::unique_ptr<uint8_t[]> data(new uint8_t[map_size]());
+  memset(data.get(), 1, page_size);
+  memset(&data[0], 0x55, page_size);
+  memset(&data[page_size], 0x5a, page_size);
+  memset(&data[2 * page_size], 0xaa, page_size);
+  ASSERT_TRUE(scratch_file.GetFile()->WriteFully(&data[0], map_size));
 
-  MemMap map = MemMap::MapFile(/*byte_count=*/kMapSize,
+  MemMap map = MemMap::MapFile(/*byte_count=*/map_size,
                                PROT_READ,
                                MAP_PRIVATE,
                                scratch_file.GetFd(),
@@ -479,13 +494,13 @@
                                &error_msg);
   ASSERT_TRUE(map.IsValid()) << error_msg;
   ASSERT_TRUE(error_msg.empty());
-  ASSERT_EQ(map.Size(), kMapSize);
+  ASSERT_EQ(map.Size(), map_size);
   ASSERT_LT(reinterpret_cast<uintptr_t>(map.BaseBegin()), 1ULL << 32);
   ASSERT_EQ(data[0], *map.Begin());
-  ASSERT_EQ(data[kPageSize], *(map.Begin() + kPageSize));
-  ASSERT_EQ(data[2 * kPageSize], *(map.Begin() + 2 * kPageSize));
+  ASSERT_EQ(data[page_size], *(map.Begin() + page_size));
+  ASSERT_EQ(data[2 * page_size], *(map.Begin() + 2 * page_size));
 
-  for (size_t offset = 2 * kPageSize; offset > 0; offset -= kPageSize) {
+  for (size_t offset = 2 * page_size; offset > 0; offset -= page_size) {
     MemMap tail = map.RemapAtEnd(map.Begin() + offset,
                                  "bad_offset_map",
                                  PROT_READ,
@@ -496,7 +511,7 @@
     ASSERT_TRUE(tail.IsValid()) << error_msg;
     ASSERT_TRUE(error_msg.empty());
     ASSERT_EQ(offset, map.Size());
-    ASSERT_EQ(static_cast<size_t>(kPageSize), tail.Size());
+    ASSERT_EQ(static_cast<size_t>(page_size), tail.Size());
     ASSERT_EQ(tail.Begin(), map.Begin() + map.Size());
     ASSERT_EQ(data[offset], *tail.Begin());
   }
@@ -534,12 +549,13 @@
 
 TEST_F(MemMapTest, MapAnonymousOverflow) {
   CommonInit();
+  const size_t page_size = MemMap::GetPageSize();
   std::string error_msg;
   uintptr_t ptr = 0;
-  ptr -= kPageSize;  // Now it's close to the top.
+  ptr -= page_size;  // Now it's close to the top.
   MemMap map = MemMap::MapAnonymous("MapAnonymousOverflow",
                                     reinterpret_cast<uint8_t*>(ptr),
-                                    2 * kPageSize,  // brings it over the top.
+                                    2 * page_size,  // brings it over the top.
                                     PROT_READ | PROT_WRITE,
                                     /*low_4gb=*/ false,
                                     /*reuse=*/ false,
@@ -552,11 +568,12 @@
 #ifdef __LP64__
 TEST_F(MemMapTest, MapAnonymousLow4GBExpectedTooHigh) {
   CommonInit();
+  const size_t page_size = MemMap::GetPageSize();
   std::string error_msg;
   MemMap map =
       MemMap::MapAnonymous("MapAnonymousLow4GBExpectedTooHigh",
                            reinterpret_cast<uint8_t*>(UINT64_C(0x100000000)),
-                           kPageSize,
+                           page_size,
                            PROT_READ | PROT_WRITE,
                            /*low_4gb=*/ true,
                            /*reuse=*/ false,
@@ -606,11 +623,12 @@
 
 TEST_F(MemMapTest, CheckNoGaps) {
   CommonInit();
+  const size_t page_size = MemMap::GetPageSize();
   std::string error_msg;
   constexpr size_t kNumPages = 3;
   // Map a 3-page mem map.
   MemMap reservation = MemMap::MapAnonymous("MapAnonymous0",
-                                            kPageSize * kNumPages,
+                                            page_size * kNumPages,
                                             PROT_READ | PROT_WRITE,
                                             /*low_4gb=*/ false,
                                             &error_msg);
@@ -621,7 +639,7 @@
 
   // Map at the same address, taking from the `map` reservation.
   MemMap map0 = MemMap::MapAnonymous("MapAnonymous0",
-                                     kPageSize,
+                                     page_size,
                                      PROT_READ | PROT_WRITE,
                                      /*low_4gb=*/ false,
                                      &reservation,
@@ -630,23 +648,23 @@
   ASSERT_TRUE(error_msg.empty());
   ASSERT_EQ(map_base, map0.Begin());
   MemMap map1 = MemMap::MapAnonymous("MapAnonymous1",
-                                     kPageSize,
+                                     page_size,
                                      PROT_READ | PROT_WRITE,
                                      /*low_4gb=*/ false,
                                      &reservation,
                                      &error_msg);
   ASSERT_TRUE(map1.IsValid()) << error_msg;
   ASSERT_TRUE(error_msg.empty());
-  ASSERT_EQ(map_base + kPageSize, map1.Begin());
+  ASSERT_EQ(map_base + page_size, map1.Begin());
   MemMap map2 = MemMap::MapAnonymous("MapAnonymous2",
-                                     kPageSize,
+                                     page_size,
                                      PROT_READ | PROT_WRITE,
                                      /*low_4gb=*/ false,
                                      &reservation,
                                      &error_msg);
   ASSERT_TRUE(map2.IsValid()) << error_msg;
   ASSERT_TRUE(error_msg.empty());
-  ASSERT_EQ(map_base + 2 * kPageSize, map2.Begin());
+  ASSERT_EQ(map_base + 2 * page_size, map2.Begin());
   ASSERT_FALSE(reservation.IsValid());  // The entire reservation was used.
 
   // One-map cases.
@@ -668,9 +686,8 @@
 
 TEST_F(MemMapTest, AlignBy) {
   CommonInit();
+  const size_t page_size = MemMap::GetPageSize();
   std::string error_msg;
-  // Cast the page size to size_t.
-  const size_t page_size = static_cast<size_t>(kPageSize);
   // Map a region.
   MemMap m0 = MemMap::MapAnonymous("MemMapTest_AlignByTest_map0",
                                    14 * page_size,
@@ -771,14 +788,15 @@
 
 TEST_F(MemMapTest, Reservation) {
   CommonInit();
+  const size_t page_size = MemMap::GetPageSize();
   std::string error_msg;
   ScratchFile scratch_file;
-  constexpr size_t kMapSize = 5 * kPageSize;
-  std::unique_ptr<uint8_t[]> data(new uint8_t[kMapSize]());
-  ASSERT_TRUE(scratch_file.GetFile()->WriteFully(&data[0], kMapSize));
+  const size_t map_size = 5 * page_size;
+  std::unique_ptr<uint8_t[]> data(new uint8_t[map_size]());
+  ASSERT_TRUE(scratch_file.GetFile()->WriteFully(&data[0], map_size));
 
   MemMap reservation = MemMap::MapAnonymous("Test reservation",
-                                            kMapSize,
+                                            map_size,
                                             PROT_NONE,
                                             /*low_4gb=*/ false,
                                             &error_msg);
@@ -786,11 +804,11 @@
   ASSERT_TRUE(error_msg.empty());
 
   // Map first part of the reservation.
-  constexpr size_t kChunk1Size = kPageSize - 1u;
-  static_assert(kChunk1Size < kMapSize, "We want to split the reservation.");
+  const size_t chunk1_size = page_size - 1u;
+  ASSERT_LT(chunk1_size, map_size) << "We want to split the reservation.";
   uint8_t* addr1 = reservation.Begin();
   MemMap map1 = MemMap::MapFileAtAddress(addr1,
-                                         /*byte_count=*/ kChunk1Size,
+                                         /*byte_count=*/ chunk1_size,
                                          PROT_READ,
                                          MAP_PRIVATE,
                                          scratch_file.GetFd(),
@@ -802,7 +820,7 @@
                                          &error_msg);
   ASSERT_TRUE(map1.IsValid()) << error_msg;
   ASSERT_TRUE(error_msg.empty());
-  ASSERT_EQ(map1.Size(), kChunk1Size);
+  ASSERT_EQ(map1.Size(), chunk1_size);
   ASSERT_EQ(addr1, map1.Begin());
   ASSERT_TRUE(reservation.IsValid());
   // Entire pages are taken from the `reservation`.
@@ -810,12 +828,12 @@
   ASSERT_EQ(map1.BaseEnd(), reservation.Begin());
 
   // Map second part as an anonymous mapping.
-  constexpr size_t kChunk2Size = 2 * kPageSize;
-  DCHECK_LT(kChunk2Size, reservation.Size());  // We want to split the reservation.
+  const size_t chunk2_size = 2 * page_size;
+  DCHECK_LT(chunk2_size, reservation.Size());  // We want to split the reservation.
   uint8_t* addr2 = reservation.Begin();
   MemMap map2 = MemMap::MapAnonymous("MiddleReservation",
                                      addr2,
-                                     /*byte_count=*/ kChunk2Size,
+                                     /*byte_count=*/ chunk2_size,
                                      PROT_READ,
                                      /*low_4gb=*/ false,
                                      /*reuse=*/ false,
@@ -823,16 +841,16 @@
                                      &error_msg);
   ASSERT_TRUE(map2.IsValid()) << error_msg;
   ASSERT_TRUE(error_msg.empty());
-  ASSERT_EQ(map2.Size(), kChunk2Size);
+  ASSERT_EQ(map2.Size(), chunk2_size);
   ASSERT_EQ(addr2, map2.Begin());
-  ASSERT_EQ(map2.End(), map2.BaseEnd());  // kChunk2Size is page aligned.
+  ASSERT_EQ(map2.End(), map2.BaseEnd());  // chunk2_size is page aligned.
   ASSERT_EQ(map2.BaseEnd(), reservation.Begin());
 
   // Map the rest of the reservation except the last byte.
-  const size_t kChunk3Size = reservation.Size() - 1u;
+  const size_t chunk3_size = reservation.Size() - 1u;
   uint8_t* addr3 = reservation.Begin();
   MemMap map3 = MemMap::MapFileAtAddress(addr3,
-                                         /*byte_count=*/ kChunk3Size,
+                                         /*byte_count=*/ chunk3_size,
                                          PROT_READ,
                                          MAP_PRIVATE,
                                          scratch_file.GetFd(),
@@ -844,30 +862,30 @@
                                          &error_msg);
   ASSERT_TRUE(map3.IsValid()) << error_msg;
   ASSERT_TRUE(error_msg.empty());
-  ASSERT_EQ(map3.Size(), kChunk3Size);
+  ASSERT_EQ(map3.Size(), chunk3_size);
   ASSERT_EQ(addr3, map3.Begin());
   // Entire pages are taken from the `reservation`, so it's now exhausted.
   ASSERT_FALSE(reservation.IsValid());
 
   // Now split the MiddleReservation.
-  constexpr size_t kChunk2ASize = kPageSize - 1u;
-  DCHECK_LT(kChunk2ASize, map2.Size());  // We want to split the reservation.
-  MemMap map2a = map2.TakeReservedMemory(kChunk2ASize);
+  const size_t chunk2a_size = page_size - 1u;
+  DCHECK_LT(chunk2a_size, map2.Size());  // We want to split the reservation.
+  MemMap map2a = map2.TakeReservedMemory(chunk2a_size);
   ASSERT_TRUE(map2a.IsValid()) << error_msg;
   ASSERT_TRUE(error_msg.empty());
-  ASSERT_EQ(map2a.Size(), kChunk2ASize);
+  ASSERT_EQ(map2a.Size(), chunk2a_size);
   ASSERT_EQ(addr2, map2a.Begin());
   ASSERT_TRUE(map2.IsValid());
   ASSERT_LT(map2a.End(), map2a.BaseEnd());
   ASSERT_EQ(map2a.BaseEnd(), map2.Begin());
 
   // And take the rest of the middle reservation.
-  const size_t kChunk2BSize = map2.Size() - 1u;
+  const size_t chunk2b_size = map2.Size() - 1u;
   uint8_t* addr2b = map2.Begin();
-  MemMap map2b = map2.TakeReservedMemory(kChunk2BSize);
+  MemMap map2b = map2.TakeReservedMemory(chunk2b_size);
   ASSERT_TRUE(map2b.IsValid()) << error_msg;
   ASSERT_TRUE(error_msg.empty());
-  ASSERT_EQ(map2b.Size(), kChunk2ASize);
+  ASSERT_EQ(map2b.Size(), chunk2a_size);
   ASSERT_EQ(addr2b, map2b.Begin());
   ASSERT_FALSE(map2.IsValid());
 }
diff --git a/libartbase/base/mem_map_windows.cc b/libartbase/base/mem_map_windows.cc
index dfa75a1..3edf48a 100644
--- a/libartbase/base/mem_map_windows.cc
+++ b/libartbase/base/mem_map_windows.cc
@@ -17,6 +17,12 @@
 #include "mem_map.h"
 
 #include <windows.h>
+// This include needs to be here due to the coding conventions.  Unfortunately
+// it drags in the definition of the ERROR macro. Similarly to base/utils.cc,
+// undefine the macro here. See also, the comment at android-base/logging.h.
+#ifdef ERROR
+#undef ERROR
+#endif
 
 #include "android-base/logging.h"
 #include "android-base/stringprintf.h"
diff --git a/libartbase/base/membarrier.cc b/libartbase/base/membarrier.cc
index 3a630c7..dc17c77 100644
--- a/libartbase/base/membarrier.cc
+++ b/libartbase/base/membarrier.cc
@@ -86,7 +86,7 @@
 
 #else  // __NR_membarrier
 
-int membarrier(MembarrierCommand command ATTRIBUTE_UNUSED) {
+int membarrier([[maybe_unused]] MembarrierCommand command) {
   // In principle this could be supported on linux, but Android's prebuilt glibc does not include
   // the system call number definitions (b/111199492).
   errno = ENOSYS;
diff --git a/libartbase/base/membarrier.h b/libartbase/base/membarrier.h
index f829fc1..6fd9a3d 100644
--- a/libartbase/base/membarrier.h
+++ b/libartbase/base/membarrier.h
@@ -36,7 +36,7 @@
     kPrivateExpedited = (1 << 3),
     // MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED
     kRegisterPrivateExpedited = (1 << 4),
-    // MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE
+    // MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE
     kPrivateExpeditedSyncCore = (1 << 5),
     // MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE
     kRegisterPrivateExpeditedSyncCore = (1 << 6)
diff --git a/libartbase/base/memfd.cc b/libartbase/base/memfd.cc
index 8512a3a..e96391a 100644
--- a/libartbase/base/memfd.cc
+++ b/libartbase/base/memfd.cc
@@ -68,7 +68,7 @@
 
 #else  // __NR_memfd_create
 
-int memfd_create(const char* name ATTRIBUTE_UNUSED, unsigned int flags ATTRIBUTE_UNUSED) {
+int memfd_create([[maybe_unused]] const char* name, [[maybe_unused]] unsigned int flags) {
   errno = ENOSYS;
   return -1;
 }
diff --git a/libartbase/base/memory_tool.h b/libartbase/base/memory_tool.h
index eba1d73..675ceb2 100644
--- a/libartbase/base/memory_tool.h
+++ b/libartbase/base/memory_tool.h
@@ -75,17 +75,6 @@
 # define ATTRIBUTE_NO_SANITIZE_HWADDRESS
 #endif
 
-// Removes the hwasan tag from the pointer (the top eight bits).
-// Those bits are used for verification by hwasan and they are ignored by normal ARM memory ops.
-template<typename PtrType>
-static inline PtrType* HWASanUntag(PtrType* p) {
-#if __has_feature(hwaddress_sanitizer) && defined(__aarch64__)
-  return reinterpret_cast<PtrType*>(reinterpret_cast<uintptr_t>(p) & ((1ULL << 56) - 1));
-#else
-  return p;
-#endif
-}
-
 }  // namespace art
 
 #endif  // ART_LIBARTBASE_BASE_MEMORY_TOOL_H_
diff --git a/libartbase/base/metrics/metrics.h b/libartbase/base/metrics/metrics.h
index 40db63d..e3c85b4 100644
--- a/libartbase/base/metrics/metrics.h
+++ b/libartbase/base/metrics/metrics.h
@@ -87,7 +87,8 @@
   METRIC(TotalBytesAllocatedDelta, MetricsDeltaCounter)        \
   METRIC(TotalGcCollectionTimeDelta, MetricsDeltaCounter)      \
   METRIC(YoungGcCountDelta, MetricsDeltaCounter)               \
-  METRIC(FullGcCountDelta, MetricsDeltaCounter)
+  METRIC(FullGcCountDelta, MetricsDeltaCounter)                \
+  METRIC(TimeElapsedDelta, MetricsDeltaCounter)
 
 #define ART_METRICS(METRIC) \
   ART_EVENT_METRICS(METRIC) \
@@ -759,6 +760,7 @@
 
  private:
   uint64_t beginning_timestamp_;
+  uint64_t last_report_timestamp_;
 
 #define METRIC(name, Kind, ...) Kind<DatumId::k##name, ##__VA_ARGS__> name##_;
   ART_METRICS(METRIC)
diff --git a/libartbase/base/metrics/metrics_common.cc b/libartbase/base/metrics/metrics_common.cc
index 6c4aa95..7b8c2c4 100644
--- a/libartbase/base/metrics/metrics_common.cc
+++ b/libartbase/base/metrics/metrics_common.cc
@@ -50,31 +50,37 @@
 #endif
 
   return SessionData{
-    .compilation_reason = CompilationReason::kUnknown,
-    .compiler_filter = CompilerFilterReporting::kUnknown,
-    .session_id = kInvalidSessionId,
-    .uid = uid,
+      .session_id = kInvalidSessionId,
+      .uid = uid,
+      .compilation_reason = CompilationReason::kUnknown,
+      .compiler_filter = CompilerFilterReporting::kUnknown,
   };
 }
 
-ArtMetrics::ArtMetrics() : beginning_timestamp_ {MilliTime()}
+ArtMetrics::ArtMetrics()
+    : beginning_timestamp_{MilliTime()},
+      last_report_timestamp_{beginning_timestamp_}
 #define ART_METRIC(name, Kind, ...) \
   , name##_ {}
-ART_METRICS(ART_METRIC)
+      ART_METRICS(ART_METRIC)
 #undef ART_METRIC
 {
 }
 
 void ArtMetrics::ReportAllMetricsAndResetValueMetrics(
     const std::vector<MetricsBackend*>& backends) {
+  uint64_t current_timestamp_ = MilliTime();
   for (auto& backend : backends) {
-    backend->BeginReport(MilliTime() - beginning_timestamp_);
+    backend->BeginReport(current_timestamp_ - beginning_timestamp_);
   }
 
 #define REPORT_METRIC(name, Kind, ...) name()->Report(backends);
   ART_EVENT_METRICS(REPORT_METRIC)
 #undef REPORT_METRIC
 
+  // Update ART_DATUM_DELTA_TIME_ELAPSED_MS before ART Value Metrics are reported.
+  TimeElapsedDelta()->Add(current_timestamp_ - last_report_timestamp_);
+
 #define REPORT_METRIC(name, Kind, ...) name()->ReportAndReset(backends);
   ART_VALUE_METRICS(REPORT_METRIC)
 #undef REPORT_METRIC
@@ -82,6 +88,9 @@
   for (auto& backend : backends) {
     backend->EndReport();
   }
+
+  // Save the current timestamp to be able to calculate the elapsed time for the next report cycle.
+  last_report_timestamp_ = current_timestamp_;
 }
 
 void ArtMetrics::DumpForSigQuit(std::ostream& os) {
diff --git a/libartbase/base/metrics/metrics_test.cc b/libartbase/base/metrics/metrics_test.cc
index 2d69c95..bcc4da4 100644
--- a/libartbase/base/metrics/metrics_test.cc
+++ b/libartbase/base/metrics/metrics_test.cc
@@ -100,9 +100,7 @@
   constexpr uint64_t kMaxValue = 100;
 
   for (uint64_t i = 0; i <= kMaxValue; i++) {
-    threads.emplace_back(std::thread{[&accumulator, i]() {
-      accumulator.Add(i);
-    }});
+    threads.emplace_back(std::thread{[&accumulator, i]() { accumulator.Add(i); }});
   }
 
   for (auto& thread : threads) {
@@ -120,9 +118,7 @@
   constexpr uint64_t kMaxValue = 100;
 
   for (uint64_t i = 0; i <= kMaxValue; i++) {
-    threads.emplace_back(std::thread{[&avg, i]() {
-      avg.Add(i);
-    }});
+    threads.emplace_back(std::thread{[&avg, i]() { avg.Add(i); }});
   }
 
   for (auto& thread : threads) {
@@ -203,11 +199,18 @@
     }
 
     void ReportCounter(DatumId counter_type, uint64_t value) override {
-      if (counter_type == DatumId::kClassVerificationTotalTime) {
-        EXPECT_EQ(value, verification_time);
-        found_counter_ = true;
-      } else {
-        EXPECT_EQ(value, 0u);
+      switch (counter_type) {
+        case DatumId::kClassVerificationTotalTime:
+          EXPECT_EQ(value, verification_time)
+              << "Unexpected value for counter " << DatumName(counter_type);
+          found_counter_ = true;
+          break;
+        case DatumId::kTimeElapsedDelta:
+          // TimeElapsedData can be greater than 0 if the test takes more than 1ms to run
+          EXPECT_GE(value, 0u) << "Unexpected value for counter " << DatumName(counter_type);
+          break;
+        default:
+          EXPECT_EQ(value, 0u) << "Unexpected value for counter " << DatumName(counter_type);
       }
     }
 
@@ -216,14 +219,17 @@
                          int64_t,
                          const std::vector<uint32_t>& buckets) override {
       if (histogram_type == DatumId::kYoungGcCollectionTime) {
-        EXPECT_EQ(buckets[0], 1u);
+        EXPECT_EQ(buckets[0], 1u) << "Unexpected value for bucket 0 for histogram "
+                                  << DatumName(histogram_type);
         for (size_t i = 1; i < buckets.size(); ++i) {
-          EXPECT_EQ(buckets[i], 0u);
+          EXPECT_EQ(buckets[i], 0u) << "Unexpected value for bucket " << i << " for histogram "
+                                    << DatumName(histogram_type);
         }
         found_histogram_ = true;
       } else {
         for (size_t i = 0; i < buckets.size(); ++i) {
-          EXPECT_EQ(buckets[i], 0u);
+          EXPECT_EQ(buckets[i], 0u) << "Unexpected value for bucket " << i << " for histogram "
+                                    << DatumName(histogram_type);
         }
       }
     }
@@ -272,19 +278,19 @@
 
   class NonZeroBackend : public TestBackendBase {
    public:
-    void ReportCounter(DatumId counter_type [[maybe_unused]], uint64_t value) override {
-      EXPECT_NE(value, 0u);
+    void ReportCounter(DatumId counter_type, uint64_t value) override {
+      EXPECT_NE(value, 0u) << "Unexpected value for counter " << DatumName(counter_type);
     }
 
-    void ReportHistogram(DatumId histogram_type [[maybe_unused]],
-                         int64_t minimum_value [[maybe_unused]],
-                         int64_t maximum_value [[maybe_unused]],
+    void ReportHistogram(DatumId histogram_type,
+                         [[maybe_unused]] int64_t minimum_value,
+                         [[maybe_unused]] int64_t maximum_value,
                          const std::vector<uint32_t>& buckets) override {
       bool nonzero = false;
       for (const auto value : buckets) {
         nonzero |= (value != 0u);
       }
-      EXPECT_TRUE(nonzero);
+      EXPECT_TRUE(nonzero) << "Unexpected value for histogram " << DatumName(histogram_type);
     }
   } non_zero_backend;
 
@@ -296,16 +302,21 @@
 
   class ZeroBackend : public TestBackendBase {
    public:
-    void ReportCounter(DatumId counter_type [[maybe_unused]], uint64_t value) override {
-      EXPECT_EQ(value, 0u);
+    void ReportCounter(DatumId counter_type, uint64_t value) override {
+      if (counter_type == DatumId::kTimeElapsedDelta) {
+        // TimeElapsedData can be greater than 0 if the test takes more than 1ms to run
+        EXPECT_GE(value, 0u) << "Unexpected value for counter " << DatumName(counter_type);
+      } else {
+        EXPECT_EQ(value, 0u) << "Unexpected value for counter " << DatumName(counter_type);
+      }
     }
 
-    void ReportHistogram(DatumId histogram_type [[maybe_unused]],
-                         int64_t minimum_value [[maybe_unused]],
-                         int64_t maximum_value [[maybe_unused]],
+    void ReportHistogram([[maybe_unused]] DatumId histogram_type,
+                         [[maybe_unused]] int64_t minimum_value,
+                         [[maybe_unused]] int64_t maximum_value,
                          const std::vector<uint32_t>& buckets) override {
       for (const auto value : buckets) {
-        EXPECT_EQ(value, 0u);
+        EXPECT_EQ(value, 0u) << "Unexpected value for histogram " << DatumName(histogram_type);
       }
     }
   } zero_backend;
@@ -323,17 +334,19 @@
 
   class FirstBackend : public TestBackendBase {
    public:
-    void ReportCounter(DatumId counter_type [[maybe_unused]], uint64_t value) override {
-      EXPECT_NE(value, 0u);
+    void ReportCounter(DatumId counter_type, uint64_t value) override {
+      EXPECT_NE(value, 0u) << "Unexpected value for counter " << DatumName(counter_type);
     }
 
-    void ReportHistogram(DatumId histogram_type [[maybe_unused]],
-                         int64_t minimum_value [[maybe_unused]],
-                         int64_t maximum_value [[maybe_unused]],
+    void ReportHistogram(DatumId histogram_type,
+                         [[maybe_unused]] int64_t minimum_value,
+                         [[maybe_unused]] int64_t maximum_value,
                          const std::vector<uint32_t>& buckets) override {
-      EXPECT_NE(buckets[0], 0u) << "Bucket 0 should have a non-zero value";
+      EXPECT_NE(buckets[0], 0u) << "Unexpected value for bucket 0 for histogram "
+                                << DatumName(histogram_type);
       for (size_t i = 1; i < buckets.size(); i++) {
-        EXPECT_EQ(buckets[i], 0u) << "Bucket " << i << " should have a zero value";
+        EXPECT_EQ(buckets[i], 0u) << "Unexpected value for bucket " << i << " for histogram "
+                                  << DatumName(histogram_type);
       }
     }
   } first_backend;
@@ -350,14 +363,19 @@
 #define CHECK_METRIC(name, ...) case DatumId::k##name:
         ART_VALUE_METRICS(CHECK_METRIC)
 #undef CHECK_METRIC
-        EXPECT_EQ(value, 0u);
+        if (datum_id == DatumId::kTimeElapsedDelta) {
+          // TimeElapsedData can be greater than 0 if the test takes more than 1ms to run
+          EXPECT_GE(value, 0u) << "Unexpected value for counter " << DatumName(datum_id);
+        } else {
+          EXPECT_EQ(value, 0u) << "Unexpected value for counter " << DatumName(datum_id);
+        }
         return;
 
         // Event metrics - expected to have retained their previous value
 #define CHECK_METRIC(name, ...) case DatumId::k##name:
         ART_EVENT_METRICS(CHECK_METRIC)
 #undef CHECK_METRIC
-        EXPECT_NE(value, 0u);
+        EXPECT_NE(value, 0u) << "Unexpected value for metric " << DatumName(datum_id);
         return;
 
         default:
@@ -368,13 +386,15 @@
     }
 
     // All histograms are event metrics.
-    void ReportHistogram(DatumId histogram_type [[maybe_unused]],
-                         int64_t minimum_value [[maybe_unused]],
-                         int64_t maximum_value [[maybe_unused]],
+    void ReportHistogram([[maybe_unused]] DatumId histogram_type,
+                         [[maybe_unused]] int64_t minimum_value,
+                         [[maybe_unused]] int64_t maximum_value,
                          const std::vector<uint32_t>& buckets) override {
-      EXPECT_NE(buckets[0], 0u) << "Bucket 0 should have a non-zero value";
+      EXPECT_NE(buckets[0], 0u) << "Unexpected value for bucket 0 for histogram "
+                                << DatumName(histogram_type);
       for (size_t i = 1; i < buckets.size(); i++) {
-        EXPECT_EQ(buckets[i], 0u) << "Bucket " << i << " should have a zero value";
+        EXPECT_EQ(buckets[i], 0u) << "Unexpected value for bucket " << i << " for histogram "
+                                  << DatumName(histogram_type);
       }
     }
   } second_backend;
@@ -384,7 +404,7 @@
 
 TEST(TextFormatterTest, ReportMetrics_WithBuckets) {
   TextFormatter text_formatter;
-  SessionData session_data {
+  SessionData session_data{
       .session_id = 1000,
       .uid = 50,
       .compilation_reason = CompilationReason::kInstall,
@@ -393,10 +413,7 @@
 
   text_formatter.FormatBeginReport(200, session_data);
   text_formatter.FormatReportCounter(DatumId::kFullGcCount, 1u);
-  text_formatter.FormatReportHistogram(DatumId::kFullGcCollectionTime,
-                                       50,
-                                       200,
-                                       {2, 4, 7, 1});
+  text_formatter.FormatReportHistogram(DatumId::kFullGcCollectionTime, 50, 200, {2, 4, 7, 1});
   text_formatter.FormatEndReport();
 
   const std::string result = text_formatter.GetAndResetBuffer();
@@ -416,7 +433,7 @@
 
 TEST(TextFormatterTest, ReportMetrics_NoBuckets) {
   TextFormatter text_formatter;
-  SessionData session_data {
+  SessionData session_data{
       .session_id = 500,
       .uid = 15,
       .compilation_reason = CompilationReason::kCmdLine,
@@ -490,7 +507,7 @@
 
 TEST(XmlFormatterTest, ReportMetrics_WithBuckets) {
   XmlFormatter xml_formatter;
-  SessionData session_data {
+  SessionData session_data{
       .session_id = 123,
       .uid = 456,
       .compilation_reason = CompilationReason::kFirstBoot,
@@ -499,45 +516,42 @@
 
   xml_formatter.FormatBeginReport(250, session_data);
   xml_formatter.FormatReportCounter(DatumId::kYoungGcCount, 3u);
-  xml_formatter.FormatReportHistogram(DatumId::kYoungGcCollectionTime,
-                                      300,
-                                      600,
-                                      {1, 5, 3});
+  xml_formatter.FormatReportHistogram(DatumId::kYoungGcCollectionTime, 300, 600, {1, 5, 3});
   xml_formatter.FormatEndReport();
 
   const std::string result = xml_formatter.GetAndResetBuffer();
   ASSERT_EQ(result,
             "<art_runtime_metrics>"
-              "<version>1.0</version>"
-              "<metadata>"
-                "<timestamp_since_start_ms>250</timestamp_since_start_ms>"
-                "<session_id>123</session_id>"
-                "<uid>456</uid>"
-                "<compilation_reason>first-boot</compilation_reason>"
-                "<compiler_filter>space</compiler_filter>"
-              "</metadata>"
-              "<metrics>"
-                "<YoungGcCount>"
-                  "<counter_type>count</counter_type>"
-                  "<value>3</value>"
-                "</YoungGcCount>"
-                "<YoungGcCollectionTime>"
-                  "<counter_type>histogram</counter_type>"
-                  "<minimum_value>300</minimum_value>"
-                  "<maximum_value>600</maximum_value>"
-                  "<buckets>"
-                    "<bucket>1</bucket>"
-                    "<bucket>5</bucket>"
-                    "<bucket>3</bucket>"
-                  "</buckets>"
-                "</YoungGcCollectionTime>"
-              "</metrics>"
+            "<version>1.0</version>"
+            "<metadata>"
+            "<timestamp_since_start_ms>250</timestamp_since_start_ms>"
+            "<session_id>123</session_id>"
+            "<uid>456</uid>"
+            "<compilation_reason>first-boot</compilation_reason>"
+            "<compiler_filter>space</compiler_filter>"
+            "</metadata>"
+            "<metrics>"
+            "<YoungGcCount>"
+            "<counter_type>count</counter_type>"
+            "<value>3</value>"
+            "</YoungGcCount>"
+            "<YoungGcCollectionTime>"
+            "<counter_type>histogram</counter_type>"
+            "<minimum_value>300</minimum_value>"
+            "<maximum_value>600</maximum_value>"
+            "<buckets>"
+            "<bucket>1</bucket>"
+            "<bucket>5</bucket>"
+            "<bucket>3</bucket>"
+            "</buckets>"
+            "</YoungGcCollectionTime>"
+            "</metrics>"
             "</art_runtime_metrics>");
 }
 
 TEST(XmlFormatterTest, ReportMetrics_NoBuckets) {
   XmlFormatter xml_formatter;
-  SessionData session_data {
+  SessionData session_data{
       .session_id = 234,
       .uid = 345,
       .compilation_reason = CompilationReason::kFirstBoot,
@@ -552,26 +566,26 @@
   const std::string result = xml_formatter.GetAndResetBuffer();
   ASSERT_EQ(result,
             "<art_runtime_metrics>"
-              "<version>1.0</version>"
-              "<metadata>"
-                "<timestamp_since_start_ms>160</timestamp_since_start_ms>"
-                "<session_id>234</session_id>"
-                "<uid>345</uid>"
-                "<compilation_reason>first-boot</compilation_reason>"
-                "<compiler_filter>space</compiler_filter>"
-              "</metadata>"
-              "<metrics>"
-                "<YoungGcCount>"
-                  "<counter_type>count</counter_type>"
-                  "<value>4</value>"
-                "</YoungGcCount>"
-                "<YoungGcCollectionTime>"
-                  "<counter_type>histogram</counter_type>"
-                  "<minimum_value>20</minimum_value>"
-                  "<maximum_value>40</maximum_value>"
-                  "<buckets/>"
-                "</YoungGcCollectionTime>"
-              "</metrics>"
+            "<version>1.0</version>"
+            "<metadata>"
+            "<timestamp_since_start_ms>160</timestamp_since_start_ms>"
+            "<session_id>234</session_id>"
+            "<uid>345</uid>"
+            "<compilation_reason>first-boot</compilation_reason>"
+            "<compiler_filter>space</compiler_filter>"
+            "</metadata>"
+            "<metrics>"
+            "<YoungGcCount>"
+            "<counter_type>count</counter_type>"
+            "<value>4</value>"
+            "</YoungGcCount>"
+            "<YoungGcCollectionTime>"
+            "<counter_type>histogram</counter_type>"
+            "<minimum_value>20</minimum_value>"
+            "<maximum_value>40</maximum_value>"
+            "<buckets/>"
+            "</YoungGcCollectionTime>"
+            "</metrics>"
             "</art_runtime_metrics>");
 }
 
@@ -586,16 +600,16 @@
   std::string result = xml_formatter.GetAndResetBuffer();
   ASSERT_EQ(result,
             "<art_runtime_metrics>"
-              "<version>1.0</version>"
-              "<metadata>"
-                "<timestamp_since_start_ms>100</timestamp_since_start_ms>"
-              "</metadata>"
-              "<metrics>"
-                "<YoungGcCount>"
-                  "<counter_type>count</counter_type>"
-                  "<value>3</value>"
-                "</YoungGcCount>"
-              "</metrics>"
+            "<version>1.0</version>"
+            "<metadata>"
+            "<timestamp_since_start_ms>100</timestamp_since_start_ms>"
+            "</metadata>"
+            "<metrics>"
+            "<YoungGcCount>"
+            "<counter_type>count</counter_type>"
+            "<value>3</value>"
+            "</YoungGcCount>"
+            "</metrics>"
             "</art_runtime_metrics>");
 }
 
@@ -610,16 +624,16 @@
   std::string result = xml_formatter.GetAndResetBuffer();
   ASSERT_EQ(result,
             "<art_runtime_metrics>"
-              "<version>1.0</version>"
-              "<metadata>"
-                "<timestamp_since_start_ms>200</timestamp_since_start_ms>"
-              "</metadata>"
-              "<metrics>"
-                "<FullGcCount>"
-                  "<counter_type>count</counter_type>"
-                  "<value>1</value>"
-                "</FullGcCount>"
-              "</metrics>"
+            "<version>1.0</version>"
+            "<metadata>"
+            "<timestamp_since_start_ms>200</timestamp_since_start_ms>"
+            "</metadata>"
+            "<metrics>"
+            "<FullGcCount>"
+            "<counter_type>count</counter_type>"
+            "<value>1</value>"
+            "</FullGcCount>"
+            "</metrics>"
             "</art_runtime_metrics>");
 
   xml_formatter.FormatBeginReport(300, empty_session_data);
@@ -629,159 +643,111 @@
   result = xml_formatter.GetAndResetBuffer();
   ASSERT_EQ(result,
             "<art_runtime_metrics>"
-              "<version>1.0</version>"
-              "<metadata>"
-                "<timestamp_since_start_ms>300</timestamp_since_start_ms>"
-              "</metadata>"
-              "<metrics>"
-                "<FullGcCount>"
-                  "<counter_type>count</counter_type>"
-                  "<value>5</value>"
-                "</FullGcCount>"
-              "</metrics>"
+            "<version>1.0</version>"
+            "<metadata>"
+            "<timestamp_since_start_ms>300</timestamp_since_start_ms>"
+            "</metadata>"
+            "<metrics>"
+            "<FullGcCount>"
+            "<counter_type>count</counter_type>"
+            "<value>5</value>"
+            "</FullGcCount>"
+            "</metrics>"
             "</art_runtime_metrics>");
 }
 
 TEST(CompilerFilterReportingTest, FromName) {
-  ASSERT_EQ(CompilerFilterReportingFromName("error"),
-            CompilerFilterReporting::kError);
-  ASSERT_EQ(CompilerFilterReportingFromName("unknown"),
-            CompilerFilterReporting::kUnknown);
+  ASSERT_EQ(CompilerFilterReportingFromName("error"), CompilerFilterReporting::kError);
+  ASSERT_EQ(CompilerFilterReportingFromName("unknown"), CompilerFilterReporting::kUnknown);
   ASSERT_EQ(CompilerFilterReportingFromName("assume-verified"),
             CompilerFilterReporting::kAssumeVerified);
-  ASSERT_EQ(CompilerFilterReportingFromName("extract"),
-            CompilerFilterReporting::kExtract);
-  ASSERT_EQ(CompilerFilterReportingFromName("verify"),
-            CompilerFilterReporting::kVerify);
+  ASSERT_EQ(CompilerFilterReportingFromName("extract"), CompilerFilterReporting::kExtract);
+  ASSERT_EQ(CompilerFilterReportingFromName("verify"), CompilerFilterReporting::kVerify);
   ASSERT_EQ(CompilerFilterReportingFromName("space-profile"),
             CompilerFilterReporting::kSpaceProfile);
-  ASSERT_EQ(CompilerFilterReportingFromName("space"),
-            CompilerFilterReporting::kSpace);
+  ASSERT_EQ(CompilerFilterReportingFromName("space"), CompilerFilterReporting::kSpace);
   ASSERT_EQ(CompilerFilterReportingFromName("speed-profile"),
             CompilerFilterReporting::kSpeedProfile);
-  ASSERT_EQ(CompilerFilterReportingFromName("speed"),
-            CompilerFilterReporting::kSpeed);
+  ASSERT_EQ(CompilerFilterReportingFromName("speed"), CompilerFilterReporting::kSpeed);
   ASSERT_EQ(CompilerFilterReportingFromName("everything-profile"),
             CompilerFilterReporting::kEverythingProfile);
-  ASSERT_EQ(CompilerFilterReportingFromName("everything"),
-            CompilerFilterReporting::kEverything);
-  ASSERT_EQ(CompilerFilterReportingFromName("run-from-apk"),
-            CompilerFilterReporting::kRunFromApk);
+  ASSERT_EQ(CompilerFilterReportingFromName("everything"), CompilerFilterReporting::kEverything);
+  ASSERT_EQ(CompilerFilterReportingFromName("run-from-apk"), CompilerFilterReporting::kRunFromApk);
   ASSERT_EQ(CompilerFilterReportingFromName("run-from-apk-fallback"),
             CompilerFilterReporting::kRunFromApkFallback);
 }
 
 TEST(CompilerFilterReportingTest, Name) {
-  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kError),
-            "error");
-  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kUnknown),
-            "unknown");
+  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kError), "error");
+  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kUnknown), "unknown");
   ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kAssumeVerified),
             "assume-verified");
-  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kExtract),
-            "extract");
-  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kVerify),
-            "verify");
-  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kSpaceProfile),
-            "space-profile");
-  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kSpace),
-            "space");
-  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kSpeedProfile),
-            "speed-profile");
-  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kSpeed),
-            "speed");
+  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kExtract), "extract");
+  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kVerify), "verify");
+  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kSpaceProfile), "space-profile");
+  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kSpace), "space");
+  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kSpeedProfile), "speed-profile");
+  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kSpeed), "speed");
   ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kEverythingProfile),
             "everything-profile");
-  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kEverything),
-            "everything");
-  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kRunFromApk),
-            "run-from-apk");
+  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kEverything), "everything");
+  ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kRunFromApk), "run-from-apk");
   ASSERT_EQ(CompilerFilterReportingName(CompilerFilterReporting::kRunFromApkFallback),
             "run-from-apk-fallback");
 }
 
 TEST(CompilerReason, FromName) {
-  ASSERT_EQ(CompilationReasonFromName("unknown"),
-            CompilationReason::kUnknown);
-  ASSERT_EQ(CompilationReasonFromName("first-boot"),
-            CompilationReason::kFirstBoot);
-  ASSERT_EQ(CompilationReasonFromName("boot-after-ota"),
-            CompilationReason::kBootAfterOTA);
-  ASSERT_EQ(CompilationReasonFromName("post-boot"),
-            CompilationReason::kPostBoot);
-  ASSERT_EQ(CompilationReasonFromName("install"),
-            CompilationReason::kInstall);
-  ASSERT_EQ(CompilationReasonFromName("install-fast"),
-            CompilationReason::kInstallFast);
-  ASSERT_EQ(CompilationReasonFromName("install-bulk"),
-            CompilationReason::kInstallBulk);
+  ASSERT_EQ(CompilationReasonFromName("unknown"), CompilationReason::kUnknown);
+  ASSERT_EQ(CompilationReasonFromName("first-boot"), CompilationReason::kFirstBoot);
+  ASSERT_EQ(CompilationReasonFromName("boot-after-ota"), CompilationReason::kBootAfterOTA);
+  ASSERT_EQ(CompilationReasonFromName("post-boot"), CompilationReason::kPostBoot);
+  ASSERT_EQ(CompilationReasonFromName("install"), CompilationReason::kInstall);
+  ASSERT_EQ(CompilationReasonFromName("install-fast"), CompilationReason::kInstallFast);
+  ASSERT_EQ(CompilationReasonFromName("install-bulk"), CompilationReason::kInstallBulk);
   ASSERT_EQ(CompilationReasonFromName("install-bulk-secondary"),
             CompilationReason::kInstallBulkSecondary);
   ASSERT_EQ(CompilationReasonFromName("install-bulk-downgraded"),
             CompilationReason::kInstallBulkDowngraded);
   ASSERT_EQ(CompilationReasonFromName("install-bulk-secondary-downgraded"),
             CompilationReason::kInstallBulkSecondaryDowngraded);
-  ASSERT_EQ(CompilationReasonFromName("bg-dexopt"),
-            CompilationReason::kBgDexopt);
-  ASSERT_EQ(CompilationReasonFromName("ab-ota"),
-            CompilationReason::kABOTA);
-  ASSERT_EQ(CompilationReasonFromName("inactive"),
-            CompilationReason::kInactive);
-  ASSERT_EQ(CompilationReasonFromName("shared"),
-            CompilationReason::kShared);
+  ASSERT_EQ(CompilationReasonFromName("bg-dexopt"), CompilationReason::kBgDexopt);
+  ASSERT_EQ(CompilationReasonFromName("ab-ota"), CompilationReason::kABOTA);
+  ASSERT_EQ(CompilationReasonFromName("inactive"), CompilationReason::kInactive);
+  ASSERT_EQ(CompilationReasonFromName("shared"), CompilationReason::kShared);
   ASSERT_EQ(CompilationReasonFromName("install-with-dex-metadata"),
             CompilationReason::kInstallWithDexMetadata);
-  ASSERT_EQ(CompilationReasonFromName("prebuilt"),
-            CompilationReason::kPrebuilt);
-  ASSERT_EQ(CompilationReasonFromName("cmdline"),
-            CompilationReason::kCmdLine);
-  ASSERT_EQ(CompilationReasonFromName("error"),
-            CompilationReason::kError);
-  ASSERT_EQ(CompilationReasonFromName("vdex"),
-            CompilationReason::kVdex);
+  ASSERT_EQ(CompilationReasonFromName("prebuilt"), CompilationReason::kPrebuilt);
+  ASSERT_EQ(CompilationReasonFromName("cmdline"), CompilationReason::kCmdLine);
+  ASSERT_EQ(CompilationReasonFromName("error"), CompilationReason::kError);
+  ASSERT_EQ(CompilationReasonFromName("vdex"), CompilationReason::kVdex);
   ASSERT_EQ(CompilationReasonFromName("boot-after-mainline-update"),
             CompilationReason::kBootAfterMainlineUpdate);
 }
 
 TEST(CompilerReason, Name) {
-  ASSERT_EQ(CompilationReasonName(CompilationReason::kUnknown),
-            "unknown");
-  ASSERT_EQ(CompilationReasonName(CompilationReason::kFirstBoot),
-            "first-boot");
-  ASSERT_EQ(CompilationReasonName(CompilationReason::kBootAfterOTA),
-            "boot-after-ota");
-  ASSERT_EQ(CompilationReasonName(CompilationReason::kPostBoot),
-            "post-boot");
-  ASSERT_EQ(CompilationReasonName(CompilationReason::kInstall),
-            "install");
-  ASSERT_EQ(CompilationReasonName(CompilationReason::kInstallFast),
-            "install-fast");
-  ASSERT_EQ(CompilationReasonName(CompilationReason::kInstallBulk),
-            "install-bulk");
+  ASSERT_EQ(CompilationReasonName(CompilationReason::kUnknown), "unknown");
+  ASSERT_EQ(CompilationReasonName(CompilationReason::kFirstBoot), "first-boot");
+  ASSERT_EQ(CompilationReasonName(CompilationReason::kBootAfterOTA), "boot-after-ota");
+  ASSERT_EQ(CompilationReasonName(CompilationReason::kPostBoot), "post-boot");
+  ASSERT_EQ(CompilationReasonName(CompilationReason::kInstall), "install");
+  ASSERT_EQ(CompilationReasonName(CompilationReason::kInstallFast), "install-fast");
+  ASSERT_EQ(CompilationReasonName(CompilationReason::kInstallBulk), "install-bulk");
   ASSERT_EQ(CompilationReasonName(CompilationReason::kInstallBulkSecondary),
             "install-bulk-secondary");
   ASSERT_EQ(CompilationReasonName(CompilationReason::kInstallBulkDowngraded),
             "install-bulk-downgraded");
   ASSERT_EQ(CompilationReasonName(CompilationReason::kInstallBulkSecondaryDowngraded),
             "install-bulk-secondary-downgraded");
-  ASSERT_EQ(CompilationReasonName(CompilationReason::kBgDexopt),
-            "bg-dexopt");
-  ASSERT_EQ(CompilationReasonName(CompilationReason::kABOTA),
-            "ab-ota");
-  ASSERT_EQ(CompilationReasonName(CompilationReason::kInactive),
-            "inactive");
-  ASSERT_EQ(CompilationReasonName(CompilationReason::kShared),
-            "shared");
+  ASSERT_EQ(CompilationReasonName(CompilationReason::kBgDexopt), "bg-dexopt");
+  ASSERT_EQ(CompilationReasonName(CompilationReason::kABOTA), "ab-ota");
+  ASSERT_EQ(CompilationReasonName(CompilationReason::kInactive), "inactive");
+  ASSERT_EQ(CompilationReasonName(CompilationReason::kShared), "shared");
   ASSERT_EQ(CompilationReasonName(CompilationReason::kInstallWithDexMetadata),
             "install-with-dex-metadata");
-  ASSERT_EQ(CompilationReasonName(CompilationReason::kPrebuilt),
-            "prebuilt");
-  ASSERT_EQ(CompilationReasonName(CompilationReason::kCmdLine),
-            "cmdline");
-  ASSERT_EQ(CompilationReasonName(CompilationReason::kError),
-            "error");
-  ASSERT_EQ(CompilationReasonName(CompilationReason::kVdex),
-            "vdex");
+  ASSERT_EQ(CompilationReasonName(CompilationReason::kPrebuilt), "prebuilt");
+  ASSERT_EQ(CompilationReasonName(CompilationReason::kCmdLine), "cmdline");
+  ASSERT_EQ(CompilationReasonName(CompilationReason::kError), "error");
+  ASSERT_EQ(CompilationReasonName(CompilationReason::kVdex), "vdex");
   ASSERT_EQ(CompilationReasonName(CompilationReason::kBootAfterMainlineUpdate),
             "boot-after-mainline-update");
 }
diff --git a/libartbase/base/safe_copy.cc b/libartbase/base/safe_copy.cc
deleted file mode 100644
index 7b0b895..0000000
--- a/libartbase/base/safe_copy.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "safe_copy.h"
-
-#ifdef __linux__
-#include <sys/uio.h>
-#include <sys/user.h>
-#endif
-#include <unistd.h>
-
-#include <algorithm>
-
-#include <android-base/macros.h>
-
-#include "bit_utils.h"
-
-namespace art {
-
-ssize_t SafeCopy(void *dst, const void *src, size_t len) {
-#if defined(__linux__)
-  struct iovec dst_iov = {
-    .iov_base = dst,
-    .iov_len = len,
-  };
-
-  // Split up the remote read across page boundaries.
-  // From the manpage:
-  //   A partial read/write may result if one of the remote_iov elements points to an invalid
-  //   memory region in the remote process.
-  //
-  //   Partial transfers apply at the granularity of iovec elements.  These system calls won't
-  //   perform a partial transfer that splits a single iovec element.
-  constexpr size_t kMaxIovecs = 64;
-  struct iovec src_iovs[kMaxIovecs];
-  size_t iovecs_used = 0;
-
-  const char* cur = static_cast<const char*>(src);
-  while (len > 0) {
-    if (iovecs_used == kMaxIovecs) {
-      errno = EINVAL;
-      return -1;
-    }
-
-    src_iovs[iovecs_used].iov_base = const_cast<char*>(cur);
-    if (!IsAlignedParam(cur, kPageSize)) {
-      src_iovs[iovecs_used].iov_len = AlignUp(cur, kPageSize) - cur;
-    } else {
-      src_iovs[iovecs_used].iov_len = kPageSize;
-    }
-
-    src_iovs[iovecs_used].iov_len = std::min(src_iovs[iovecs_used].iov_len, len);
-
-    len -= src_iovs[iovecs_used].iov_len;
-    cur += src_iovs[iovecs_used].iov_len;
-    ++iovecs_used;
-  }
-
-  ssize_t rc = process_vm_readv(getpid(), &dst_iov, 1, src_iovs, iovecs_used, 0);
-  if (rc == -1) {
-    return 0;
-  }
-  return rc;
-#else
-  UNUSED(dst, src, len);
-  return -1;
-#endif
-}
-
-}  // namespace art
diff --git a/libartbase/base/safe_copy.h b/libartbase/base/safe_copy.h
deleted file mode 100644
index 56cdfec..0000000
--- a/libartbase/base/safe_copy.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ART_LIBARTBASE_BASE_SAFE_COPY_H_
-#define ART_LIBARTBASE_BASE_SAFE_COPY_H_
-
-#include <sys/types.h>
-
-namespace art {
-
-// Safely dereference a pointer.
-// Returns -1 if safe copy isn't implemented on the platform, or if the transfer is too large.
-// Returns 0 if src is unreadable.
-ssize_t SafeCopy(void *dst, const void *src, size_t len);
-
-}  // namespace art
-
-#endif  // ART_LIBARTBASE_BASE_SAFE_COPY_H_
diff --git a/libartbase/base/safe_copy_test.cc b/libartbase/base/safe_copy_test.cc
deleted file mode 100644
index 01ed7cd..0000000
--- a/libartbase/base/safe_copy_test.cc
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "safe_copy.h"
-
-#include <errno.h>
-#include <string.h>
-#include <sys/user.h>
-
-#include "android-base/logging.h"
-#include "globals.h"
-#include "gtest/gtest.h"
-#include "mman.h"
-
-
-namespace art {
-
-#if defined(__linux__)
-
-TEST(SafeCopyTest, smoke) {
-  DCHECK_EQ(kPageSize, static_cast<size_t>(sysconf(_SC_PAGE_SIZE)));
-
-  // Map four pages, mark the second one as PROT_NONE, unmap the last one.
-  void* map = mmap(nullptr, kPageSize * 4, PROT_READ | PROT_WRITE,
-                   MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-  ASSERT_NE(MAP_FAILED, map);
-  char* page1 = static_cast<char*>(map);
-  char* page2 = page1 + kPageSize;
-  char* page3 = page2 + kPageSize;
-  char* page4 = page3 + kPageSize;
-  ASSERT_EQ(0, mprotect(page1 + kPageSize, kPageSize, PROT_NONE));
-  ASSERT_EQ(0, munmap(page4, kPageSize));
-
-  page1[0] = 'a';
-  page1[kPageSize - 1] = 'z';
-
-  page3[0] = 'b';
-  page3[kPageSize - 1] = 'y';
-
-  char buf[kPageSize];
-
-  // Completely valid read.
-  memset(buf, 0xCC, sizeof(buf));
-  EXPECT_EQ(static_cast<ssize_t>(kPageSize), SafeCopy(buf, page1, kPageSize)) << strerror(errno);
-  EXPECT_EQ(0, memcmp(buf, page1, kPageSize));
-
-  // Reading into a guard page.
-  memset(buf, 0xCC, sizeof(buf));
-  EXPECT_EQ(static_cast<ssize_t>(kPageSize - 1), SafeCopy(buf, page1 + 1, kPageSize));
-  EXPECT_EQ(0, memcmp(buf, page1 + 1, kPageSize - 1));
-
-  // Reading from a guard page into a real page.
-  memset(buf, 0xCC, sizeof(buf));
-  EXPECT_EQ(0, SafeCopy(buf, page2 + kPageSize - 1, kPageSize));
-
-  // Reading off of the end of a mapping.
-  memset(buf, 0xCC, sizeof(buf));
-  EXPECT_EQ(static_cast<ssize_t>(kPageSize), SafeCopy(buf, page3, kPageSize * 2));
-  EXPECT_EQ(0, memcmp(buf, page3, kPageSize));
-
-  // Completely invalid.
-  EXPECT_EQ(0, SafeCopy(buf, page1 + kPageSize, kPageSize));
-
-  // Clean up.
-  ASSERT_EQ(0, munmap(map, kPageSize * 3));
-}
-
-TEST(SafeCopyTest, alignment) {
-  DCHECK_EQ(kPageSize, static_cast<size_t>(sysconf(_SC_PAGE_SIZE)));
-
-  // Copy the middle of a mapping to the end of another one.
-  void* src_map = mmap(nullptr, kPageSize * 3, PROT_READ | PROT_WRITE,
-                       MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-  ASSERT_NE(MAP_FAILED, src_map);
-
-  // Add a guard page to make sure we don't write past the end of the mapping.
-  void* dst_map = mmap(nullptr, kPageSize * 4, PROT_READ | PROT_WRITE,
-                       MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-  ASSERT_NE(MAP_FAILED, dst_map);
-
-  char* src = static_cast<char*>(src_map);
-  char* dst = static_cast<char*>(dst_map);
-  ASSERT_EQ(0, mprotect(dst + 3 * kPageSize, kPageSize, PROT_NONE));
-
-  src[512] = 'a';
-  src[kPageSize * 3 - 512 - 1] = 'z';
-
-  EXPECT_EQ(static_cast<ssize_t>(kPageSize * 3 - 1024),
-            SafeCopy(dst + 1024, src + 512, kPageSize * 3 - 1024));
-  EXPECT_EQ(0, memcmp(dst + 1024, src + 512, kPageSize * 3 - 1024));
-
-  ASSERT_EQ(0, munmap(src_map, kPageSize * 3));
-  ASSERT_EQ(0, munmap(dst_map, kPageSize * 4));
-}
-
-#endif  // defined(__linux__)
-
-}  // namespace art
diff --git a/libartbase/base/safe_map.h b/libartbase/base/safe_map.h
index fa13fe0..c489bfd 100644
--- a/libartbase/base/safe_map.h
+++ b/libartbase/base/safe_map.h
@@ -149,7 +149,7 @@
   }
 
   template <typename CreateFn>
-  V& GetOrCreate(const K& k, CreateFn create) {
+  V& GetOrCreate(const K& k, CreateFn&& create) {
     static_assert(std::is_same_v<V, std::invoke_result_t<CreateFn>>,
                   "Argument `create` should return a value of type V.");
     auto lb = lower_bound(k);
diff --git a/libartbase/base/scoped_arena_allocator.cc b/libartbase/base/scoped_arena_allocator.cc
index a87064f..f4c1aa7 100644
--- a/libartbase/base/scoped_arena_allocator.cc
+++ b/libartbase/base/scoped_arena_allocator.cc
@@ -118,6 +118,7 @@
 ScopedArenaAllocator::ScopedArenaAllocator(ScopedArenaAllocator&& other) noexcept
     : DebugStackReference(std::move(other)),
       DebugStackRefCounter(),
+      // NOLINTBEGIN(bugprone-use-after-move) - the accessed fields are still valid after the move
       ArenaAllocatorStats(other),
       arena_stack_(other.arena_stack_),
       mark_arena_(other.mark_arena_),
@@ -125,6 +126,7 @@
       mark_end_(other.mark_end_) {
   other.DebugStackRefCounter::CheckNoRefs();
   other.arena_stack_ = nullptr;
+  // NOLINTEND(bugprone-use-after-move)
 }
 
 ScopedArenaAllocator::ScopedArenaAllocator(ArenaStack* arena_stack)
diff --git a/libartbase/base/scoped_arena_allocator.h b/libartbase/base/scoped_arena_allocator.h
index 6de0192..165fb8c 100644
--- a/libartbase/base/scoped_arena_allocator.h
+++ b/libartbase/base/scoped_arena_allocator.h
@@ -171,7 +171,7 @@
   size_t ApproximatePeakBytes();
 
   // Allow a delete-expression to destroy but not deallocate allocators created by Create().
-  static void operator delete(void* ptr ATTRIBUTE_UNUSED) {}
+  static void operator delete([[maybe_unused]] void* ptr) {}
 
  private:
   ArenaStack* arena_stack_;
diff --git a/libartbase/base/scoped_arena_containers.h b/libartbase/base/scoped_arena_containers.h
index 5f0cfe6..d0ff7f5 100644
--- a/libartbase/base/scoped_arena_containers.h
+++ b/libartbase/base/scoped_arena_containers.h
@@ -185,7 +185,7 @@
   const_pointer address(const_reference x) const { return &x; }
 
   pointer allocate(size_type n,
-                   ScopedArenaAllocatorAdapter<void>::pointer hint ATTRIBUTE_UNUSED = nullptr) {
+                   [[maybe_unused]] ScopedArenaAllocatorAdapter<void>::pointer hint = nullptr) {
     DCHECK_LE(n, max_size());
     DebugStackIndirectTopRef::CheckTop();
     return reinterpret_cast<T*>(arena_stack_->Alloc(n * sizeof(T),
@@ -273,7 +273,7 @@
 template <typename T>
 class ArenaDelete<T[]> {
  public:
-  void operator()(T* ptr ATTRIBUTE_UNUSED) const {
+  void operator()([[maybe_unused]] T* ptr) const {
     static_assert(std::is_trivially_destructible_v<T>,
                   "ArenaUniquePtr does not support non-trivially-destructible arrays.");
     // TODO: Implement debug checks, and MEMORY_TOOL support.
diff --git a/libartbase/base/sdk_version.h b/libartbase/base/sdk_version.h
index d39aa95..b955ab0 100644
--- a/libartbase/base/sdk_version.h
+++ b/libartbase/base/sdk_version.h
@@ -38,6 +38,7 @@
   kS     = 31u,
   kS_V2  = 32u,
   kT     = 33u,
+  kU     = 34u,
   kMax   = std::numeric_limits<uint32_t>::max(),
 };
 
diff --git a/libartbase/base/stl_util.h b/libartbase/base/stl_util.h
index 2c9547f..a6ab16c 100644
--- a/libartbase/base/stl_util.h
+++ b/libartbase/base/stl_util.h
@@ -156,10 +156,14 @@
 }
 
 template <typename IterLeft, typename IterRight>
-class ZipLeftIter : public std::iterator<
-                        std::forward_iterator_tag,
-                        std::pair<typename IterLeft::value_type, typename IterRight::value_type>> {
+class ZipLeftIter {
  public:
+  using iterator_category = std::forward_iterator_tag;
+  using value_type = std::pair<typename IterLeft::value_type, typename IterRight::value_type>;
+  using difference_type = ptrdiff_t;
+  using pointer = void;
+  using reference = void;
+
   ZipLeftIter(IterLeft left, IterRight right) : left_iter_(left), right_iter_(right) {}
   ZipLeftIter<IterLeft, IterRight>& operator++() {
     ++left_iter_;
@@ -186,8 +190,14 @@
   IterRight right_iter_;
 };
 
-class CountIter : public std::iterator<std::forward_iterator_tag, size_t, size_t, size_t, size_t> {
+class CountIter {
  public:
+  using iterator_category = std::forward_iterator_tag;
+  using value_type = size_t;
+  using difference_type = size_t;
+  using pointer = void;
+  using reference = void;
+
   CountIter() : count_(0) {}
   explicit CountIter(size_t count) : count_(count) {}
   CountIter& operator++() {
@@ -238,9 +248,14 @@
 }
 
 template <typename RealIter, typename Filter>
-struct FilterIterator
-    : public std::iterator<std::forward_iterator_tag, typename RealIter::value_type> {
+struct FilterIterator {
  public:
+  using iterator_category = std::forward_iterator_tag;
+  using value_type = typename std::iterator_traits<RealIter>::value_type;
+  using difference_type = ptrdiff_t;
+  using pointer = typename std::iterator_traits<RealIter>::pointer;
+  using reference = typename std::iterator_traits<RealIter>::reference;
+
   FilterIterator(RealIter rl,
                  Filter cond,
                  std::optional<RealIter> end = std::nullopt)
@@ -278,8 +293,8 @@
   std::optional<RealIter> end_;
 };
 
-template <typename BaseRange, typename Filter>
-static inline auto Filter(BaseRange&& range, Filter cond) {
+template <typename BaseRange, typename FilterT>
+static inline auto Filter(BaseRange&& range, FilterT cond) {
   auto end = range.end();
   auto start = std::find_if(range.begin(), end, cond);
   return MakeIterationRange(FilterIterator(start, cond, std::make_optional(end)),
@@ -323,8 +338,14 @@
 }
 
 // Helper struct for iterating a split-string without allocation.
-struct SplitStringIter : public std::iterator<std::forward_iterator_tag, std::string_view> {
+struct SplitStringIter {
  public:
+  using iterator_category = std::forward_iterator_tag;
+  using value_type = std::string_view;
+  using difference_type = ptrdiff_t;
+  using pointer = void;
+  using reference = void;
+
   // Direct iterator constructor. The iteration state is only the current index.
   // We use that with the split char and the full string to get the current and
   // next segment.
diff --git a/libartbase/base/stride_iterator.h b/libartbase/base/stride_iterator.h
index 6a7e4be..7d1b9fc 100644
--- a/libartbase/base/stride_iterator.h
+++ b/libartbase/base/stride_iterator.h
@@ -23,11 +23,14 @@
 
 namespace art {
 
-template<typename T>
-class StrideIterator : public std::iterator<std::random_access_iterator_tag, T> {
+template <typename T>
+class StrideIterator {
  public:
-  using difference_type =
-      typename std::iterator<std::random_access_iterator_tag, T>::difference_type;
+  using iterator_category = std::random_access_iterator_tag;
+  using value_type = T;
+  using difference_type = ptrdiff_t;
+  using pointer = value_type*;
+  using reference = value_type&;
 
   StrideIterator(const StrideIterator&) = default;
   StrideIterator(StrideIterator&&) noexcept = default;
diff --git a/libartbase/base/testing.cc b/libartbase/base/testing.cc
index c260be7..3cd2836 100644
--- a/libartbase/base/testing.cc
+++ b/libartbase/base/testing.cc
@@ -26,8 +26,7 @@
 
 namespace {
 
-std::string GetDexFileName(const std::string& jar_prefix, bool host) {
-  std::string prefix(host ? GetAndroidRoot() : "");
+std::string GetDexFileName(const std::string& jar_prefix, const std::string& prefix) {
   const char* apexPath =
       (jar_prefix == "conscrypt") ?
           kAndroidConscryptApexDefaultPath :
@@ -60,18 +59,28 @@
   return modules;
 }
 
-std::vector<std::string> GetLibCoreDexFileNames(const std::vector<std::string>& modules) {
+std::vector<std::string> GetLibCoreDexFileNames(const std::string& prefix,
+                                                const std::vector<std::string>& modules) {
   std::vector<std::string> result;
   result.reserve(modules.size());
   for (const std::string& module : modules) {
-    result.push_back(GetDexFileName(module, !kIsTargetBuild));
+    result.push_back(GetDexFileName(module, prefix));
   }
   return result;
 }
 
-std::vector<std::string> GetLibCoreDexFileNames(bool core_only) {
+std::vector<std::string> GetLibCoreDexFileNames(const std::string& prefix, bool core_only) {
   std::vector<std::string> modules = GetLibCoreModuleNames(core_only);
-  return GetLibCoreDexFileNames(modules);
+  return GetLibCoreDexFileNames(prefix, modules);
+}
+
+std::vector<std::string> GetLibCoreDexLocations(const std::vector<std::string>& modules) {
+  return GetLibCoreDexFileNames(/*prefix=*/"", modules);
+}
+
+std::vector<std::string> GetLibCoreDexLocations(bool core_only) {
+  std::vector<std::string> modules = GetLibCoreModuleNames(core_only);
+  return GetLibCoreDexLocations(modules);
 }
 
 }  // namespace testing
diff --git a/libartbase/base/testing.h b/libartbase/base/testing.h
index 65bd3f6..88d0aee 100644
--- a/libartbase/base/testing.h
+++ b/libartbase/base/testing.h
@@ -25,16 +25,26 @@
 namespace art {
 namespace testing {
 
+// Note: "libcore" here means art + conscrypt + icu.
+
 // Gets the names of the libcore modules.
 // If `core_only` is true, only returns the names of CORE_IMG_JARS in Android.common_path.mk.
 std::vector<std::string> GetLibCoreModuleNames(bool core_only = false);
 
 // Gets the paths of the libcore dex files for given modules.
-std::vector<std::string> GetLibCoreDexFileNames(const std::vector<std::string>& modules);
+std::vector<std::string> GetLibCoreDexFileNames(const std::string& prefix,
+                                                const std::vector<std::string>& modules);
 
 // Gets the paths of the libcore dex files.
 // If `core_only` is true, only returns the filenames of CORE_IMG_JARS in Android.common_path.mk.
-std::vector<std::string> GetLibCoreDexFileNames(bool core_only = false);
+std::vector<std::string> GetLibCoreDexFileNames(const std::string& prefix, bool core_only = false);
+
+// Gets the on-device locations of the libcore dex files for given modules.
+std::vector<std::string> GetLibCoreDexLocations(const std::vector<std::string>& modules);
+
+// Gets the on-device locations of the libcore dex files.
+// If `core_only` is true, only returns the filenames of CORE_IMG_JARS in Android.common_path.mk.
+std::vector<std::string> GetLibCoreDexLocations(bool core_only = false);
 
 }  // namespace testing
 }  // namespace art
diff --git a/libartbase/base/time_utils.cc b/libartbase/base/time_utils.cc
index aeb7fa2..b26e0ef 100644
--- a/libartbase/base/time_utils.cc
+++ b/libartbase/base/time_utils.cc
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#define _POSIX_THREAD_SAFE_FUNCTIONS  // For mingw localtime_r().
+
 #include "time_utils.h"
 
 #include <inttypes.h>
@@ -133,11 +135,6 @@
 std::string GetIsoDate() {
   tm tmbuf;
   int ns;
-#ifdef _WIN32
-  time_t now = time(nullptr);
-  localtime_s(&tmbuf, &now);
-  ns = 0;
-#else
   if (__builtin_available(macOS 10.12, *)) {
     timespec now;
     clock_gettime(CLOCK_REALTIME, &now);
@@ -148,7 +145,6 @@
     localtime_r(&now, &tmbuf);
     ns = 0;
   }
-#endif
   char zone[16] = {};
   strftime(zone, sizeof(zone), "%z", &tmbuf);
   return StringPrintf("%04d-%02d-%02d %02d:%02d:%02d.%09d%s",
diff --git a/libartbase/base/transform_array_ref_test.cc b/libartbase/base/transform_array_ref_test.cc
index 4ac6978..e1d8d52 100644
--- a/libartbase/base/transform_array_ref_test.cc
+++ b/libartbase/base/transform_array_ref_test.cc
@@ -30,7 +30,7 @@
   int value;
 };
 
-ATTRIBUTE_UNUSED bool operator==(const ValueHolder& lhs, const ValueHolder& rhs) {
+[[maybe_unused]] bool operator==(const ValueHolder& lhs, const ValueHolder& rhs) {
   return lhs.value == rhs.value;
 }
 
diff --git a/libartbase/base/transform_iterator.h b/libartbase/base/transform_iterator.h
index 552f31f..3f7c952 100644
--- a/libartbase/base/transform_iterator.h
+++ b/libartbase/base/transform_iterator.h
@@ -43,7 +43,10 @@
                                   typename std::iterator_traits<BaseIterator>::iterator_category>,
                 "Transform iterator base must be an input iterator.");
 
-  using InputType = typename std::iterator_traits<BaseIterator>::reference;
+  using BaseReference = typename std::iterator_traits<BaseIterator>::reference;
+  using InputType = std::conditional_t<std::is_same_v<BaseReference, void>,
+                                       typename std::iterator_traits<BaseIterator>::value_type,
+                                       BaseReference>;
   using ResultType = std::result_of_t<Function(InputType)>;
 
  public:
diff --git a/libartbase/base/unix_file/fd_file.cc b/libartbase/base/unix_file/fd_file.cc
index a955b7d..c5307e2 100644
--- a/libartbase/base/unix_file/fd_file.cc
+++ b/libartbase/base/unix_file/fd_file.cc
@@ -498,7 +498,7 @@
   if (lseek(input_file->Fd(), off, SEEK_SET) != off) {
     return false;
   }
-  constexpr size_t kMaxBufferSize = 4 * ::art::kPageSize;
+  constexpr size_t kMaxBufferSize = 16 * ::art::KB;
   const size_t buffer_size = std::min<uint64_t>(size, kMaxBufferSize);
   art::UniqueCPtr<void> buffer(malloc(buffer_size));
   if (buffer == nullptr) {
diff --git a/libartbase/base/unix_file/fd_file_test.cc b/libartbase/base/unix_file/fd_file_test.cc
index f593337..92f8308 100644
--- a/libartbase/base/unix_file/fd_file_test.cc
+++ b/libartbase/base/unix_file/fd_file_test.cc
@@ -196,7 +196,7 @@
   int old_fd = file.Fd();
 
   FdFile file2(std::move(file));
-  EXPECT_FALSE(file.IsOpened());
+  EXPECT_FALSE(file.IsOpened());  // NOLINT - checking file is no longer opened after move
   EXPECT_TRUE(file2.IsOpened());
   EXPECT_EQ(old_fd, file2.Fd());
 
diff --git a/libartbase/base/unix_file/random_access_file_test.h b/libartbase/base/unix_file/random_access_file_test.h
index 178f89d..0592256 100644
--- a/libartbase/base/unix_file/random_access_file_test.h
+++ b/libartbase/base/unix_file/random_access_file_test.h
@@ -171,8 +171,7 @@
     CleanUp(file.get());
   }
 
-  virtual void CleanUp(RandomAccessFile* file ATTRIBUTE_UNUSED) {
-  }
+  virtual void CleanUp([[maybe_unused]] RandomAccessFile* file) {}
 
  protected:
   std::string android_data_;
diff --git a/libartbase/base/utils.cc b/libartbase/base/utils.cc
index e114e4d..bc359db 100644
--- a/libartbase/base/utils.cc
+++ b/libartbase/base/utils.cc
@@ -31,6 +31,7 @@
 #include "android-base/stringprintf.h"
 #include "android-base/strings.h"
 
+#include "base/mem_map.h"
 #include "base/stl_util.h"
 #include "bit_utils.h"
 #include "os.h"
@@ -89,9 +90,10 @@
   return r;
 }
 
-bool TouchAndFlushCacheLinesWithinPage(uintptr_t start, uintptr_t limit, size_t attempts) {
+bool TouchAndFlushCacheLinesWithinPage(uintptr_t start, uintptr_t limit, size_t attempts,
+                                       size_t page_size) {
   CHECK_LT(start, limit);
-  CHECK_EQ(RoundDown(start, kPageSize), RoundDown(limit - 1, kPageSize)) << "range spans pages";
+  CHECK_EQ(RoundDown(start, page_size), RoundDown(limit - 1, page_size)) << "range spans pages";
   // Declare a volatile variable so the compiler does not elide reads from the page being touched.
   [[maybe_unused]] volatile uint8_t v = 0;
   for (size_t i = 0; i < attempts; ++i) {
@@ -130,6 +132,8 @@
   // (2) fault handling that allows flushing/invalidation to continue after
   //     a missing page has been faulted in.
 
+  const size_t page_size = MemMap::GetPageSize();
+
   uintptr_t start = reinterpret_cast<uintptr_t>(begin);
   const uintptr_t limit = reinterpret_cast<uintptr_t>(end);
   if (LIKELY(CacheFlush(start, limit) == 0)) {
@@ -139,14 +143,14 @@
   // A rare failure has occurred implying that part of the range (begin, end] has been swapped
   // out. Retry flushing but this time grouping cache-line flushes on individual pages and
   // touching each page before flushing.
-  uintptr_t next_page = RoundUp(start + 1, kPageSize);
+  uintptr_t next_page = RoundUp(start + 1, page_size);
   while (start < limit) {
     uintptr_t boundary = std::min(next_page, limit);
-    if (!TouchAndFlushCacheLinesWithinPage(start, boundary, kMaxFlushAttempts)) {
+    if (!TouchAndFlushCacheLinesWithinPage(start, boundary, kMaxFlushAttempts, page_size)) {
       return false;
     }
     start = boundary;
-    next_page += kPageSize;
+    next_page += page_size;
   }
   return true;
 }
@@ -366,8 +370,9 @@
   // We use the Linux pagemap interface for knowing if an address is backed
   // by a file or is shared. See:
   // https://www.kernel.org/doc/Documentation/vm/pagemap.txt
-  uintptr_t vmstart = reinterpret_cast<uintptr_t>(AlignDown(addr, kPageSize));
-  off_t index = (vmstart / kPageSize) * sizeof(uint64_t);
+  const size_t page_size = MemMap::GetPageSize();
+  uintptr_t vmstart = reinterpret_cast<uintptr_t>(AlignDown(addr, page_size));
+  off_t index = (vmstart / page_size) * sizeof(uint64_t);
   android::base::unique_fd pagemap(open("/proc/self/pagemap", O_RDONLY | O_CLOEXEC));
   if (pagemap == -1) {
     return false;
diff --git a/libartbase/base/utils.h b/libartbase/base/utils.h
index f311f09..5e04cb0 100644
--- a/libartbase/base/utils.h
+++ b/libartbase/base/utils.h
@@ -75,16 +75,13 @@
 class VoidFunctor {
  public:
   template <typename A>
-  inline void operator() (A a ATTRIBUTE_UNUSED) const {
-  }
+  inline void operator()([[maybe_unused]] A a) const {}
 
   template <typename A, typename B>
-  inline void operator() (A a ATTRIBUTE_UNUSED, B b ATTRIBUTE_UNUSED) const {
-  }
+  inline void operator()([[maybe_unused]] A a, [[maybe_unused]] B b) const {}
 
   template <typename A, typename B, typename C>
-  inline void operator() (A a ATTRIBUTE_UNUSED, B b ATTRIBUTE_UNUSED, C c ATTRIBUTE_UNUSED) const {
-  }
+  inline void operator()([[maybe_unused]] A a, [[maybe_unused]] B b, [[maybe_unused]] C c) const {}
 };
 
 inline bool TestBitmap(size_t idx, const uint8_t* bitmap) {
diff --git a/libartbase/base/variant_map_test.cc b/libartbase/base/variant_map_test.cc
index f2da338..f7beece 100644
--- a/libartbase/base/variant_map_test.cc
+++ b/libartbase/base/variant_map_test.cc
@@ -126,6 +126,7 @@
 
   // Test move constructor
   FruitMap fmMoved(std::move(fmFilledCopy));
+  // NOLINTNEXTLINE - checking underlying storage has been freed
   EXPECT_EQ(size_t(0), fmFilledCopy.Size());
   EXPECT_EQ(size_t(2), fmMoved.Size());
   EXPECT_EQ(*fmFilled.Get(FruitMap::Apple), *fmMoved.Get(FruitMap::Apple));
@@ -136,6 +137,7 @@
   fmMoved2.Set(FruitMap::Apple, 12345);  // This value will be clobbered after the move
 
   fmMoved2 = std::move(fmFilledCopy2);
+  // NOLINTNEXTLINE - checking underlying storage has been freed
   EXPECT_EQ(size_t(0), fmFilledCopy2.Size());
   EXPECT_EQ(size_t(2), fmMoved2.Size());
   EXPECT_EQ(*fmFilled.Get(FruitMap::Apple), *fmMoved2.Get(FruitMap::Apple));
diff --git a/libartpalette/Android.bp b/libartpalette/Android.bp
index 6060709..c687a88 100644
--- a/libartpalette/Android.bp
+++ b/libartpalette/Android.bp
@@ -129,10 +129,6 @@
         "art_gtest_defaults",
         "art_libartpalette_tests_defaults",
     ],
-    shared_libs: [
-        "libartpalette",
-        "libnativehelper",
-    ],
     host_supported: true,
 }
 
@@ -141,16 +137,9 @@
 art_cc_test {
     name: "art_standalone_libartpalette_tests",
     defaults: [
-        "art_cts_gtest_defaults",
+        "art_standalone_gtest_defaults",
         "art_libartpalette_tests_defaults",
     ],
-    static_libs: [
-        "libartpalette",
-        "libc++fs",
-        // libnativehelper_lazy has the glue we need to dlsym the platform-only
-        // APIs we need, like JniInvocationInit.
-        "libnativehelper_lazy",
-    ],
     test_config_template: ":art-gtests-target-standalone-cts-template",
     test_suites: [
         "cts",
diff --git a/libartpalette/apex/palette.cc b/libartpalette/apex/palette.cc
index dadb470..346cd18 100644
--- a/libartpalette/apex/palette.cc
+++ b/libartpalette/apex/palette.cc
@@ -110,7 +110,8 @@
 
 extern "C" {
 
-// Methods in version 1 API, corresponding to SDK level 31.
+// Unless explicitly mentioned otherwise, the following methods have been
+// introduced in version 1 API, corresponding to SDK level 31.
 
 palette_status_t PaletteSchedSetPriority(int32_t tid, int32_t java_priority) {
   PaletteSchedSetPriorityMethod m = PaletteLoader::Instance().GetPaletteSchedSetPriorityMethod();
@@ -220,8 +221,7 @@
   return m(env);
 }
 
-// Methods in version 2 API, corresponding to SDK level 33.
-
+// Introduced in version 2 API, corresponding to SDK level 33.
 palette_status_t PaletteReportLockContention(JNIEnv* env,
                                              int32_t wait_ms,
                                              const char* filename,
@@ -246,8 +246,7 @@
            thread_name);
 }
 
-// Methods in version 3 API, corresponding to SDK level 34.
-
+// Introduced in version 3 API, corresponding to SDK level 34.
 palette_status_t PaletteSetTaskProfiles(int32_t tid,
                                         const char* const profiles[],
                                         size_t profiles_len) {
diff --git a/libartpalette/apex/palette_test.cc b/libartpalette/apex/palette_test.cc
index f2b4858..63072c4 100644
--- a/libartpalette/apex/palette_test.cc
+++ b/libartpalette/apex/palette_test.cc
@@ -28,8 +28,8 @@
 #include "android/api-level.h"
 #endif
 
+#include "base/common_art_test.h"
 #include "gtest/gtest.h"
-#include "nativehelper/JniInvocation.h"                                 \
 
 namespace {
 
@@ -88,28 +88,27 @@
 #endif
 }
 
-TEST_F(PaletteClientTest, JniInvocation) {
-#ifndef ART_TARGET_ANDROID
-  // On host we need to set up a boot classpath and pass it in here. Let's not
-  // bother since this test is only for native API coverage on target.
-  GTEST_SKIP() << "Will only spin up a VM on Android";
-#else
+class PaletteClientJniTest : public art::CommonArtTest {};
+
+TEST_F(PaletteClientJniTest, JniInvocation) {
   bool enabled;
   EXPECT_EQ(PALETTE_STATUS_OK, PaletteShouldReportJniInvocations(&enabled));
 
-  // This calls JniInvocationInit, which is necessary to load the VM. It's not
-  // public but still stable.
-  JniInvocation jni_invocation;
-  ASSERT_TRUE(jni_invocation.Init(nullptr));
+  std::string boot_class_path_string =
+      GetClassPathOption("-Xbootclasspath:", GetLibCoreDexFileNames());
+  std::string boot_class_path_locations_string =
+      GetClassPathOption("-Xbootclasspath-locations:", GetLibCoreDexLocations());
 
-  JavaVMInitArgs vm_args;
   JavaVMOption options[] = {
-      {.optionString = "-verbose:jni", .extraInfo = nullptr},
+      {.optionString = boot_class_path_string.c_str(), .extraInfo = nullptr},
+      {.optionString = boot_class_path_locations_string.c_str(), .extraInfo = nullptr},
   };
-  vm_args.version = JNI_VERSION_1_6;
-  vm_args.nOptions = std::size(options);
-  vm_args.options = options;
-  vm_args.ignoreUnrecognized = JNI_TRUE;
+  JavaVMInitArgs vm_args = {
+      .version = JNI_VERSION_1_6,
+      .nOptions = std::size(options),
+      .options = options,
+      .ignoreUnrecognized = JNI_TRUE,
+  };
 
   JavaVM* jvm = nullptr;
   JNIEnv* env = nullptr;
@@ -120,7 +119,6 @@
   PaletteNotifyEndJniInvocation(env);
 
   EXPECT_EQ(JNI_OK, jvm->DestroyJavaVM());
-#endif
 }
 
 TEST_F(PaletteClientTest, SetTaskProfiles) {
diff --git a/libartpalette/include/palette/palette_method_list.h b/libartpalette/include/palette/palette_method_list.h
index e22e828..e5437cb 100644
--- a/libartpalette/include/palette/palette_method_list.h
+++ b/libartpalette/include/palette/palette_method_list.h
@@ -23,8 +23,9 @@
 
 #include "jni.h"
 
+// Unless explicitly mentioned otherwise, the following methods have been
+// introduced in version 1 API, corresponding to SDK level 31.
 #define PALETTE_METHOD_LIST(M)                                                                \
-  /* Methods in version 1 API, corresponding to SDK level 31. */                              \
   M(PaletteSchedSetPriority, int32_t tid, int32_t java_priority)                              \
   M(PaletteSchedGetPriority, int32_t tid, /*out*/ int32_t* java_priority)                     \
   M(PaletteWriteCrashThreadStacks, const char* stacks, size_t stacks_len)                     \
@@ -48,7 +49,7 @@
   M(PaletteNotifyBeginJniInvocation, JNIEnv* env)                                             \
   M(PaletteNotifyEndJniInvocation, JNIEnv* env)                                               \
                                                                                               \
-  /* Methods in version 2 API, corresponding to SDK level 33. */                              \
+  /* Introduced in version 2 API, corresponding to SDK level 33. */                           \
   M(PaletteReportLockContention,                                                              \
     JNIEnv* env,                                                                              \
     int32_t wait_ms,                                                                          \
@@ -61,8 +62,7 @@
     const char* proc_name,                                                                    \
     const char* thread_name)                                                                  \
                                                                                               \
-  /* Methods in version 3 API, corresponding to SDK level 34. */                              \
-                                                                                              \
+  /* Introduced in version 3 API, corresponding to SDK level 34. */                           \
   /* Calls through to SetTaskProfiles in libprocessgroup to set the */                        \
   /* [task profile](https:/-/source.android.com/docs/core/perf/cgroups#task-profiles-file) */ \
   /* for the given thread id. */                                                              \
diff --git a/libartpalette/libartpalette.map b/libartpalette/libartpalette.map
index 11824cb..6172a21 100644
--- a/libartpalette/libartpalette.map
+++ b/libartpalette/libartpalette.map
@@ -46,7 +46,7 @@
     PaletteReportLockContention; # apex
 } LIBARTPALETTE_1;
 
-LIBARTPALETTE_3 { # introduced=UpsideDownCake
+LIBARTPALETTE_3 { # introduced=34
   global:
     # --- VERSION 03 API ---
     PaletteSetTaskProfiles; # apex
diff --git a/libartpalette/system/palette_fake.cc b/libartpalette/system/palette_fake.cc
index 743a4db..e698267 100644
--- a/libartpalette/system/palette_fake.cc
+++ b/libartpalette/system/palette_fake.cc
@@ -14,23 +14,22 @@
  * limitations under the License.
  */
 
-#include "palette/palette.h"
+#include <android-base/logging.h>
+#include <stdbool.h>
 
 #include <map>
 #include <mutex>
-#include <stdbool.h>
 
-#include <android-base/logging.h>
-#include <android-base/macros.h>  // For ATTRIBUTE_UNUSED
-
+#include "palette/palette.h"
 #include "palette_system.h"
 
-// Methods in version 1 API, corresponding to SDK level 31.
-
 // Cached thread priority for testing. No thread priorities are ever affected.
 static std::mutex g_tid_priority_map_mutex;
 static std::map<int32_t, int32_t> g_tid_priority_map;
 
+// Unless explicitly mentioned otherwise, the following methods have been
+// introduced in version 1 API, corresponding to SDK level 31.
+
 palette_status_t PaletteSchedSetPriority(int32_t tid, int32_t priority) {
   if (priority < art::palette::kMinManagedThreadPriority ||
       priority > art::palette::kMaxManagedThreadPriority) {
@@ -61,28 +60,25 @@
   return PALETTE_STATUS_OK;
 }
 
-palette_status_t PaletteTraceBegin(const char* name ATTRIBUTE_UNUSED) {
-  return PALETTE_STATUS_OK;
-}
+palette_status_t PaletteTraceBegin([[maybe_unused]] const char* name) { return PALETTE_STATUS_OK; }
 
 palette_status_t PaletteTraceEnd() {
   return PALETTE_STATUS_OK;
 }
 
-palette_status_t PaletteTraceIntegerValue(const char* name ATTRIBUTE_UNUSED,
-                                          int32_t value ATTRIBUTE_UNUSED) {
+palette_status_t PaletteTraceIntegerValue([[maybe_unused]] const char* name,
+                                          [[maybe_unused]] int32_t value) {
   return PALETTE_STATUS_OK;
 }
 
-palette_status_t PaletteAshmemCreateRegion(const char* name ATTRIBUTE_UNUSED,
-                                           size_t size ATTRIBUTE_UNUSED,
+palette_status_t PaletteAshmemCreateRegion([[maybe_unused]] const char* name,
+                                           [[maybe_unused]] size_t size,
                                            int* fd) {
   *fd = -1;
   return PALETTE_STATUS_NOT_SUPPORTED;
 }
 
-palette_status_t PaletteAshmemSetProtRegion(int fd ATTRIBUTE_UNUSED,
-                                            int prot ATTRIBUTE_UNUSED) {
+palette_status_t PaletteAshmemSetProtRegion([[maybe_unused]] int fd, [[maybe_unused]] int prot) {
   return PALETTE_STATUS_NOT_SUPPORTED;
 }
 
@@ -96,25 +92,25 @@
   return PALETTE_STATUS_OK;
 }
 
-palette_status_t PaletteNotifyStartDex2oatCompilation(int source_fd ATTRIBUTE_UNUSED,
-                                                      int art_fd ATTRIBUTE_UNUSED,
-                                                      int oat_fd ATTRIBUTE_UNUSED,
-                                                      int vdex_fd ATTRIBUTE_UNUSED) {
+palette_status_t PaletteNotifyStartDex2oatCompilation([[maybe_unused]] int source_fd,
+                                                      [[maybe_unused]] int art_fd,
+                                                      [[maybe_unused]] int oat_fd,
+                                                      [[maybe_unused]] int vdex_fd) {
   return PALETTE_STATUS_OK;
 }
 
-palette_status_t PaletteNotifyEndDex2oatCompilation(int source_fd ATTRIBUTE_UNUSED,
-                                                    int art_fd ATTRIBUTE_UNUSED,
-                                                    int oat_fd ATTRIBUTE_UNUSED,
-                                                    int vdex_fd ATTRIBUTE_UNUSED) {
+palette_status_t PaletteNotifyEndDex2oatCompilation([[maybe_unused]] int source_fd,
+                                                    [[maybe_unused]] int art_fd,
+                                                    [[maybe_unused]] int oat_fd,
+                                                    [[maybe_unused]] int vdex_fd) {
   return PALETTE_STATUS_OK;
 }
 
-palette_status_t PaletteNotifyDexFileLoaded(const char* path ATTRIBUTE_UNUSED) {
+palette_status_t PaletteNotifyDexFileLoaded([[maybe_unused]] const char* path) {
   return PALETTE_STATUS_OK;
 }
 
-palette_status_t PaletteNotifyOatFileLoaded(const char* path ATTRIBUTE_UNUSED) {
+palette_status_t PaletteNotifyOatFileLoaded([[maybe_unused]] const char* path) {
   return PALETTE_STATUS_OK;
 }
 
@@ -123,33 +119,31 @@
   return PALETTE_STATUS_OK;
 }
 
-palette_status_t PaletteNotifyBeginJniInvocation(JNIEnv* env ATTRIBUTE_UNUSED) {
+palette_status_t PaletteNotifyBeginJniInvocation([[maybe_unused]] JNIEnv* env) {
   return PALETTE_STATUS_OK;
 }
 
-palette_status_t PaletteNotifyEndJniInvocation(JNIEnv* env ATTRIBUTE_UNUSED) {
+palette_status_t PaletteNotifyEndJniInvocation([[maybe_unused]] JNIEnv* env) {
   return PALETTE_STATUS_OK;
 }
 
-// Methods in version 2 API, corresponding to SDK level 33.
-
-palette_status_t PaletteReportLockContention(JNIEnv* env ATTRIBUTE_UNUSED,
-                                             int32_t wait_ms ATTRIBUTE_UNUSED,
-                                             const char* filename ATTRIBUTE_UNUSED,
-                                             int32_t line_number ATTRIBUTE_UNUSED,
-                                             const char* method_name ATTRIBUTE_UNUSED,
-                                             const char* owner_filename ATTRIBUTE_UNUSED,
-                                             int32_t owner_line_number ATTRIBUTE_UNUSED,
-                                             const char* owner_method_name ATTRIBUTE_UNUSED,
-                                             const char* proc_name ATTRIBUTE_UNUSED,
-                                             const char* thread_name ATTRIBUTE_UNUSED) {
+// Introduced in version 2 API, corresponding to SDK level 33.
+palette_status_t PaletteReportLockContention([[maybe_unused]] JNIEnv* env,
+                                             [[maybe_unused]] int32_t wait_ms,
+                                             [[maybe_unused]] const char* filename,
+                                             [[maybe_unused]] int32_t line_number,
+                                             [[maybe_unused]] const char* method_name,
+                                             [[maybe_unused]] const char* owner_filename,
+                                             [[maybe_unused]] int32_t owner_line_number,
+                                             [[maybe_unused]] const char* owner_method_name,
+                                             [[maybe_unused]] const char* proc_name,
+                                             [[maybe_unused]] const char* thread_name) {
   return PALETTE_STATUS_OK;
 }
 
-// Methods in version 3 API, corresponding to SDK level 34.
-
-palette_status_t PaletteSetTaskProfiles(int32_t tid ATTRIBUTE_UNUSED,
-                                        const char* const profiles[] ATTRIBUTE_UNUSED,
-                                        size_t profiles_len ATTRIBUTE_UNUSED) {
+// Introduced in version 3 API, corresponding to SDK level 34.
+palette_status_t PaletteSetTaskProfiles([[maybe_unused]] int32_t tid,
+                                        [[maybe_unused]] const char* const profiles[],
+                                        [[maybe_unused]] size_t profiles_len) {
   return PALETTE_STATUS_OK;
 }
diff --git a/libartservice/service/Android.bp b/libartservice/service/Android.bp
index e013d68..652d49d 100644
--- a/libartservice/service/Android.bp
+++ b/libartservice/service/Android.bp
@@ -32,7 +32,6 @@
     ],
     export_include_dirs: ["native"],
     shared_libs: [
-        "libarttools", // Contains "libc++fs".
         "libbase",
         "libnativehelper",
     ],
@@ -48,6 +47,7 @@
     shared_libs: [
         "libart",
         "libartbase",
+        "libarttools", // Contains "libc++fs".
     ],
 }
 
@@ -64,6 +64,7 @@
     shared_libs: [
         "libartd",
         "libartbased",
+        "libarttools", // Contains "libc++fs".
     ],
 }
 
@@ -198,6 +199,9 @@
         "art_gtest_defaults",
         "art_libartservice_tests_defaults",
     ],
+    shared_libs: [
+        "libarttools",
+    ],
 }
 
 // Standalone version of ART gtest `art_libartservice_tests`, not bundled with the ART APEX on
@@ -208,6 +212,9 @@
         "art_standalone_gtest_defaults",
         "art_libartservice_tests_defaults",
     ],
+    static_libs: [
+        "libarttools",
+    ],
 }
 
 android_test {
@@ -218,6 +225,11 @@
         "javatests/**/*.java",
     ],
 
+    // disable the target when prebuilt modules are used
+    defaults: [
+        "art_module_source_build_java_defaults",
+    ],
+
     static_libs: [
         "androidx.test.ext.junit",
         "androidx.test.ext.truth",
@@ -251,3 +263,13 @@
     test_suites: ["general-tests"],
     test_config: "ArtServiceTests.xml",
 }
+
+filegroup {
+    name: "libartservice_protos",
+    srcs: [
+        "proto/**/*.proto",
+    ],
+    visibility: [
+        "//cts/hostsidetests/compilation",
+    ],
+}
diff --git a/libartservice/service/README.md b/libartservice/service/README.md
index 028f5f5..04cd83d 100644
--- a/libartservice/service/README.md
+++ b/libartservice/service/README.md
@@ -1,4 +1,4 @@
-## ART Service
+# ART Service
 
 Warning: The contents in this doc can become stale while the code evolves.
 
@@ -6,12 +6,12 @@
 apps, query their dexopt status (the compiler filter, the compilation reason,
 whether the dexopt artifacts are up-to-date, etc.), and delete dexopt artifacts.
 
-Note: ART Service is introduced since Android U. Prior to ART Service, dexopt
-artifacts were managed by Package Manager with a legacy implementation. ART
-Service is the default on Android U, while partners are allowed to opt-out and
-use the legacy implementation instead. The legacy implementation will be removed
-since Android V. This doc only describes ART Service, not the legacy
-implementation.
+Note: ART Service is introduced in Android U. Prior to ART Service, dexopt
+artifacts were managed by Package Manager with a legacy implementation. The
+legacy implementation will be removed in Android V. This doc only describes
+ART Service, not the legacy implementation.
+
+## Concepts
 
 ### Primary dex vs. secondary dex
 
@@ -33,43 +33,122 @@
 See
 [Compilation options](https://source.android.com/docs/core/runtime/configure#compilation_options).
 
-### Dexopt scenarios
+### Priority classes
 
-At a high level, ART Service dexopts apps in the following senarios:
+A priority class indicates the priority of an operation. The value affects the
+resource usage and the process priority. A higher value may result in faster
+execution but may consume more resources and compete for resources with other
+processes.
 
--   the device is on the very first boot
--   the device is on the first boot after an OTA update
--   the device is on the first boot after a mainline update
--   an app is being installed
--   the device is idle and charging
+Options are (from the highest to the lowest):
 
-Tip: The compilation reason, stored in the header of the OAT file, shows the
-senario, in which the app is dexopted.
+-   `PRIORITY_BOOT`: Indicates that the operation blocks boot.
+-   `PRIORITY_INTERACTIVE_FAST`: Indicates that a human is waiting on the result
+    and the operation is more latency sensitive than usual. It's typically used
+    when the user is entirely blocked, such as for restoring from cloud backup.
+-   `PRIORITY_INTERACTIVE`: Indicates that a human is waiting on the result.
+    (E.g., for app install)
+-   `PRIORITY_BACKGROUND`: Indicates that the operation runs in background.
 
-The sections below describe the default behavior in each senario. Note that the
-list of apps to dexopt and the compiler filter, as well as other options, can be
-customized by partners through a callback.
+### Compilation reasons
 
-#### On the very first boot / the first boot after an OTA update
+A compilation reason is a string that determines the default
+[compiler filter](#compiler-filters) and the default
+[priority class](#priority-classes) of an operation.
+
+It's also passed to `dex2oat` and stored in the header of the OAT file, for
+debugging purposes. To retrieve the compilation reason from an OAT file, run
+
+```
+pm art dump <package-name>
+```
+
+or
+
+```
+oatdump --header-only --oat-file=<odex-filename> | grep 'compilation-reason ='
+```
+
+It can be either a predefined value in
+`art/libartservice/service/java/com/android/server/art/ReasonMapping.java`
+or a custom string. If the value is a custom string, the priority class and the
+compiler filter must be explicitly set.
+
+Each predefined value corresponds to one of the
+[dexopt scenarios](#dexopt-scenarios).
+
+#### The `-dm` suffix
+
+Sometimes, you may see the `-dm` suffix in an OAT file, such as `install-dm`.
+However, the `-dm` suffix is **not** a part of the compilation reason. It's
+appended to the compilation reason to indicate that a DM (`.dm`) file is passed
+to `dex2oat` during dexopt for **app install**.
+
+Note: ART Service also passes the DM file to `dex2oat` in other scenarios, such
+as background dexopt, but for compatibility reasons, the `-dm` suffix is not
+appended in those scenarios.
+
+Note: The `-dm` suffix does **not** imply anything in the DM file being used by
+`dex2oat`. The augmented compilation reason can still be `install-dm` even if
+the DM file is empty or if `dex2oat` leaves all contents of the DM file unused.
+That would only happen if there's a bug, like the wrong DM file being passed.
+
+## Dexopt scenarios
+
+At a high level, ART Service dexopts apps in the following scenarios:
+
+-   the device is on the very first boot (Compilation reason: `first-boot`)
+-   the device is on the first boot after an OTA update (Compilation reason:
+    `boot-after-ota`)
+-   the device is on the first boot after a mainline update (Compilation reason:
+    `boot-after-mainline-update`)
+-   an app is being installed (Compilation reason: `install` / `install-fast`
+    / etc.)
+-   the device is idle and charging (Compilation reason: `bg-dexopt` /
+    `inactive`)
+-   requested through commandline (Compilation reason: `cmdline`)
+
+Warning: The sections below describe the default behavior in each scenario. Note
+that the list of apps to dexopt and the compiler filter, as well as other
+options, can be customized by partners through system properties, APIs, etc.
+
+### On the very first boot / the first boot after an OTA update
 
 On the very first boot / the first boot after an OTA update, ART Service only
 dexopts primary dex files of all apps with the "verify" compiler filter.
 
+If `pm.dexopt.downgrade_after_inactive_days` is set, during the first boot after
+an OTA update, ART Service only dexopts apps used within the last given number of
+days.
+
 Note: It doesn't dexopt secondary dex files or use the "speed-profile" filter
 because doing so may block the boot for too long.
 
-Note: In practice, ART Service does nothing for most of the apps because the
-apps on the system partitions have dexopt artifacts generated by dexpreopt, and
-the apps on the data partition still have VDEX files usable even though their
-dependencies (bootclasspath and class loader context) have probably changed. In
-this senario, ART Service mostly dexopt apps in APEXes because they are not
-supported by dexpreopt.
+In practice, ART Service does nothing for most of the apps. Because the default
+compiler filter is "verify", which tolerates dependency mismatches, apps with
+usable VDEX files generally don't need to be re-dexopted. This includes:
 
-#### On the first boot after a mainline update
+-   apps on the **system partitions** that have artifacts generated by
+    dexpreopt, even if the dependencies (class loader contexts) are not properly
+    configured.
+-   apps on the **data partition** that have been dexopted in other scenarios
+    (install, background dexopt, etc.), even though their dependencies
+    (bootclasspath, boot images, and class loader contexts) have probably
+    changed.
+
+In other words, in this scenario, ART Service mostly only dexopts:
+
+- apps in APEXes, because they are not supported by dexpreopt
+- apps on the system partitions with dexpreopt disabled
+- apps forced to have "speed-profile" or "speed" compiler filters (the system UI
+  and the launcher) but dexpreopted with wrong dependencies
+
+### On the first boot after a mainline update
 
 On the first boot after a mainline update, ART Service dexopts the primary dex
-files of the system UI and the launcher. It uses the "speed" compiler filter for
-the system UI, and uses the "speed-profile" compiler filter for the launcher.
+files of the system UI and the launcher. It uses the compiler filter specified
+by `dalvik.vm.systemuicompilerfilter` for the system UI, and uses the
+"speed-profile" compiler filter for the launcher.
 
 Note: It only dexopts those two apps because they are important to user
 experience.
@@ -77,9 +156,10 @@
 Note: ART Service cannot use the "speed-profile" compiler filter for the system
 UI because the system UI is dexpreopted using the "speed" compiler filter and
 therefore it's never JITed and as a result there is no profile collected on the
-device to use. This may change in the future.
+device to use, though this may change in the future. For now, we strongly
+recommend to set `dalvik.vm.systemuicompilerfilter` to "speed".
 
-#### During app installation
+### During app installation
 
 During app installation, ART Service dexopts the primary dex files of the app.
 If the app is installed along with a DM file that contains a profile (known as a
@@ -93,12 +173,22 @@
 
 Note: There is no secondary dex file present during installation.
 
-#### When the device is idle and charging
+### When the device is idle and charging
 
 ART Service has a job called *background dexopt job* managed by Job Scheduler.
 It is triggered when the device is idle and charging. During the job execution,
 it dexopts primary dex files and secondary dex files of all apps with the
 "speed-profile" compiler filter.
 
+If `pm.dexopt.downgrade_after_inactive_days` is set, ART Service only dexopts
+apps used within the last given number of days, and it downgrades other apps
+(with the compilation reason `inactive`).
+
 The job is cancellable. When the device is no longer idle or charging, Job
 Scheduler cancels the job.
+
+### When requested through commandline
+
+ART Service can be invoked by commands (`pm compile`, `pm bg-dexopt-job`, and
+`pm art dexopt-packages`). Run `pm help` to see the usages and the differences
+between them.
diff --git a/libartservice/service/api/system-server-current.txt b/libartservice/service/api/system-server-current.txt
index a9cd65a..05163eb 100644
--- a/libartservice/service/api/system-server-current.txt
+++ b/libartservice/service/api/system-server-current.txt
@@ -6,6 +6,7 @@
     ctor public ArtManagerLocal(@NonNull android.content.Context);
     method public void addDexoptDoneCallback(boolean, @NonNull java.util.concurrent.Executor, @NonNull com.android.server.art.ArtManagerLocal.DexoptDoneCallback);
     method public void cancelBackgroundDexoptJob();
+    method public void clearAdjustCompilerFilterCallback();
     method @NonNull public void clearAppProfiles(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String);
     method public void clearBatchDexoptStartCallback();
     method public void clearScheduleBackgroundDexoptJobCallback();
@@ -14,13 +15,16 @@
     method @NonNull public com.android.server.art.model.DexoptResult dexoptPackage(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String, @NonNull com.android.server.art.model.DexoptParams, @NonNull android.os.CancellationSignal);
     method public void dump(@NonNull java.io.PrintWriter, @NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot);
     method public void dumpPackage(@NonNull java.io.PrintWriter, @NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String);
+    method @NonNull public com.android.server.art.model.ArtManagedFileStats getArtManagedFileStats(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String);
     method @NonNull public com.android.server.art.model.DexoptStatus getDexoptStatus(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String);
     method @NonNull public com.android.server.art.model.DexoptStatus getDexoptStatus(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String, int);
     method public int handleShellCommand(@NonNull android.os.Binder, @NonNull android.os.ParcelFileDescriptor, @NonNull android.os.ParcelFileDescriptor, @NonNull android.os.ParcelFileDescriptor, @NonNull String[]);
+    method public void onApexStaged(@NonNull String[]);
     method public void onBoot(@NonNull String, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<com.android.server.art.model.OperationProgress>);
     method public void printShellCommandHelp(@NonNull java.io.PrintWriter);
     method public void removeDexoptDoneCallback(@NonNull com.android.server.art.ArtManagerLocal.DexoptDoneCallback);
     method public int scheduleBackgroundDexoptJob();
+    method public void setAdjustCompilerFilterCallback(@NonNull java.util.concurrent.Executor, @NonNull com.android.server.art.ArtManagerLocal.AdjustCompilerFilterCallback);
     method public void setBatchDexoptStartCallback(@NonNull java.util.concurrent.Executor, @NonNull com.android.server.art.ArtManagerLocal.BatchDexoptStartCallback);
     method public void setScheduleBackgroundDexoptJobCallback(@NonNull java.util.concurrent.Executor, @NonNull com.android.server.art.ArtManagerLocal.ScheduleBackgroundDexoptJobCallback);
     method @NonNull public android.os.ParcelFileDescriptor snapshotAppProfile(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String, @Nullable String) throws com.android.server.art.ArtManagerLocal.SnapshotProfileException;
@@ -29,6 +33,10 @@
     method public void unscheduleBackgroundDexoptJob();
   }
 
+  public static interface ArtManagerLocal.AdjustCompilerFilterCallback {
+    method @NonNull public String onAdjustCompilerFilter(@NonNull String, @NonNull String, @NonNull String);
+  }
+
   public static interface ArtManagerLocal.BatchDexoptStartCallback {
     method public void onBatchDexoptStart(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String, @NonNull java.util.List<java.lang.String>, @NonNull com.android.server.art.model.BatchDexoptParams.Builder, @NonNull android.os.CancellationSignal);
   }
@@ -80,6 +88,7 @@
     field public static final int FLAG_FOR_PRIMARY_DEX = 1; // 0x1
     field public static final int FLAG_FOR_SECONDARY_DEX = 2; // 0x2
     field public static final int FLAG_FOR_SINGLE_SPLIT = 32; // 0x20
+    field public static final int FLAG_IGNORE_PROFILE = 128; // 0x80
     field public static final int FLAG_SHOULD_DOWNGRADE = 8; // 0x8
     field public static final int FLAG_SHOULD_INCLUDE_DEPENDENCIES = 4; // 0x4
     field public static final int FLAG_SKIP_IF_STORAGE_LOW = 64; // 0x40
@@ -92,6 +101,13 @@
     field public static final int SCHEDULE_SUCCESS = 0; // 0x0
   }
 
+  public class ArtManagedFileStats {
+    method public long getTotalSizeBytesByType(int);
+    field public static final int TYPE_CUR_PROFILE = 2; // 0x2
+    field public static final int TYPE_DEXOPT_ARTIFACT = 0; // 0x0
+    field public static final int TYPE_REF_PROFILE = 1; // 0x1
+  }
+
   public abstract class BatchDexoptParams {
     method @NonNull public abstract com.android.server.art.model.DexoptParams getDexoptParams();
     method @NonNull public abstract java.util.List<java.lang.String> getPackages();
@@ -142,6 +158,9 @@
     field public static final int DEXOPT_FAILED = 30; // 0x1e
     field public static final int DEXOPT_PERFORMED = 20; // 0x14
     field public static final int DEXOPT_SKIPPED = 10; // 0xa
+    field public static final int EXTENDED_BAD_EXTERNAL_PROFILE = 4; // 0x4
+    field public static final int EXTENDED_SKIPPED_NO_DEX_CODE = 2; // 0x2
+    field public static final int EXTENDED_SKIPPED_STORAGE_LOW = 1; // 0x1
   }
 
   public abstract static class DexoptResult.DexContainerFileDexoptResult {
@@ -150,6 +169,8 @@
     method public abstract long getDex2oatCpuTimeMillis();
     method public abstract long getDex2oatWallTimeMillis();
     method @NonNull public abstract String getDexContainerFile();
+    method public abstract int getExtendedStatusFlags();
+    method @NonNull public abstract java.util.List<java.lang.String> getExternalProfileErrors();
     method public abstract long getSizeBeforeBytes();
     method public abstract long getSizeBytes();
     method public abstract int getStatus();
diff --git a/libartservice/service/api/system-server-lint-baseline.txt b/libartservice/service/api/system-server-lint-baseline.txt
new file mode 100644
index 0000000..17628b2
--- /dev/null
+++ b/libartservice/service/api/system-server-lint-baseline.txt
@@ -0,0 +1,15 @@
+// Baseline format: 1.0
+DeprecationMismatch: com.android.server.art.ArtManagerLocal#ArtManagerLocal():
+    Constructor com.android.server.art.ArtManagerLocal.ArtManagerLocal(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
+
+
+UnflaggedApi: com.android.server.art.model.DexoptResult#EXTENDED_BAD_EXTERNAL_PROFILE:
+    New API must be flagged with @FlaggedApi: field com.android.server.art.model.DexoptResult.EXTENDED_BAD_EXTERNAL_PROFILE
+UnflaggedApi: com.android.server.art.model.DexoptResult#EXTENDED_SKIPPED_NO_DEX_CODE:
+    New API must be flagged with @FlaggedApi: field com.android.server.art.model.DexoptResult.EXTENDED_SKIPPED_NO_DEX_CODE
+UnflaggedApi: com.android.server.art.model.DexoptResult#EXTENDED_SKIPPED_STORAGE_LOW:
+    New API must be flagged with @FlaggedApi: field com.android.server.art.model.DexoptResult.EXTENDED_SKIPPED_STORAGE_LOW
+UnflaggedApi: com.android.server.art.model.DexoptResult.DexContainerFileDexoptResult#getExtendedStatusFlags():
+    New API must be flagged with @FlaggedApi: method com.android.server.art.model.DexoptResult.DexContainerFileDexoptResult.getExtendedStatusFlags()
+UnflaggedApi: com.android.server.art.model.DexoptResult.DexContainerFileDexoptResult#getExternalProfileErrors():
+    New API must be flagged with @FlaggedApi: method com.android.server.art.model.DexoptResult.DexContainerFileDexoptResult.getExternalProfileErrors()
diff --git a/libartservice/service/java/com/android/server/art/AidlUtils.java b/libartservice/service/java/com/android/server/art/AidlUtils.java
index 4445ecd..4a1b75e 100644
--- a/libartservice/service/java/com/android/server/art/AidlUtils.java
+++ b/libartservice/service/java/com/android/server/art/AidlUtils.java
@@ -179,6 +179,16 @@
     }
 
     @NonNull
+    public static RuntimeArtifactsPath buildRuntimeArtifactsPath(
+            @NonNull String packageName, @NonNull String dexPath, @NonNull String isa) {
+        var runtimeArtifactsPath = new RuntimeArtifactsPath();
+        runtimeArtifactsPath.packageName = packageName;
+        runtimeArtifactsPath.dexPath = dexPath;
+        runtimeArtifactsPath.isa = isa;
+        return runtimeArtifactsPath;
+    }
+
+    @NonNull
     public static String toString(@NonNull PrimaryRefProfilePath profile) {
         return String.format("PrimaryRefProfilePath[packageName = %s, profileName = %s]",
                 profile.packageName, profile.profileName);
diff --git a/libartservice/service/java/com/android/server/art/ArtFileManager.java b/libartservice/service/java/com/android/server/art/ArtFileManager.java
new file mode 100644
index 0000000..924c568
--- /dev/null
+++ b/libartservice/service/java/com/android/server/art/ArtFileManager.java
@@ -0,0 +1,340 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.art;
+
+import static com.android.server.art.DexUseManagerLocal.SecondaryDexInfo;
+import static com.android.server.art.PrimaryDexUtils.DetailedPrimaryDexInfo;
+import static com.android.server.art.PrimaryDexUtils.PrimaryDexInfo;
+import static com.android.server.art.Utils.Abi;
+
+import android.annotation.NonNull;
+import android.content.Context;
+import android.os.Binder;
+import android.os.Build;
+import android.os.RemoteException;
+import android.os.ServiceSpecificException;
+import android.os.UserHandle;
+import android.os.UserManager;
+import android.util.Log;
+import android.util.Pair;
+
+import androidx.annotation.RequiresApi;
+
+import com.android.internal.annotations.Immutable;
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.LocalManagerRegistry;
+import com.android.server.art.model.DetailedDexInfo;
+import com.android.server.pm.pkg.AndroidPackage;
+import com.android.server.pm.pkg.PackageState;
+
+import dalvik.system.DexFile;
+
+import com.google.auto.value.AutoValue;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * A helper class to list files that ART Service consumes or produces.
+ *
+ * @hide
+ */
+@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+public class ArtFileManager {
+    private static final String TAG = ArtManagerLocal.TAG;
+
+    @NonNull private final Injector mInjector;
+
+    public ArtFileManager(@NonNull Context context) {
+        this(new Injector(context));
+    }
+
+    @VisibleForTesting
+    public ArtFileManager(@NonNull Injector injector) {
+        mInjector = injector;
+    }
+
+    /**
+     * @param excludeObsoleteDexesAndLoaders If true, excludes secondary dex files and loaders based
+     *         on file visibility. See details in {@link
+     *         DexUseManagerLocal#getCheckedSecondaryDexInfo}.
+     */
+    @NonNull
+    public List<Pair<DetailedDexInfo, Abi>> getDexAndAbis(@NonNull PackageState pkgState,
+            @NonNull AndroidPackage pkg, boolean forPrimaryDex, boolean forSecondaryDex,
+            boolean excludeObsoleteDexesAndLoaders) {
+        List<Pair<DetailedDexInfo, Abi>> dexAndAbis = new ArrayList<>();
+        if (forPrimaryDex) {
+            for (DetailedPrimaryDexInfo dexInfo :
+                    PrimaryDexUtils.getDetailedDexInfo(pkgState, pkg)) {
+                for (Abi abi : Utils.getAllAbis(pkgState)) {
+                    dexAndAbis.add(Pair.create(dexInfo, abi));
+                }
+            }
+        }
+        if (forSecondaryDex) {
+            List<? extends SecondaryDexInfo> dexInfos = excludeObsoleteDexesAndLoaders
+                    ? mInjector.getDexUseManager().getCheckedSecondaryDexInfo(
+                            pkgState.getPackageName(), true /* excludeObsoleteDexesAndLoaders */)
+                    : mInjector.getDexUseManager().getSecondaryDexInfo(pkgState.getPackageName());
+            for (SecondaryDexInfo dexInfo : dexInfos) {
+                if (!mInjector.isSystemOrRootOrShell()
+                        && !mInjector.getCallingUserHandle().equals(dexInfo.userHandle())) {
+                    continue;
+                }
+                for (Abi abi : Utils.getAllAbisForNames(dexInfo.abiNames(), pkgState)) {
+                    dexAndAbis.add(Pair.create(dexInfo, abi));
+                }
+            }
+        }
+        return dexAndAbis;
+    }
+
+    /**
+     * Returns the writable paths of artifacts, regardless of whether the artifacts exist or
+     * whether they are usable.
+     */
+    @NonNull
+    public WritableArtifactLists getWritableArtifacts(
+            @NonNull PackageState pkgState, @NonNull AndroidPackage pkg) throws RemoteException {
+        List<ArtifactsPath> artifacts = new ArrayList<>();
+        List<RuntimeArtifactsPath> runtimeArtifacts = new ArrayList<>();
+
+        boolean isInDalvikCache = Utils.isInDalvikCache(pkgState, mInjector.getArtd());
+        for (PrimaryDexInfo dexInfo : PrimaryDexUtils.getDexInfo(pkg)) {
+            for (Abi abi : Utils.getAllAbis(pkgState)) {
+                artifacts.add(AidlUtils.buildArtifactsPath(
+                        dexInfo.dexPath(), abi.isa(), isInDalvikCache));
+                // Runtime images are only generated for primary dex files.
+                runtimeArtifacts.add(AidlUtils.buildRuntimeArtifactsPath(
+                        pkgState.getPackageName(), dexInfo.dexPath(), abi.isa()));
+            }
+        }
+
+        for (SecondaryDexInfo dexInfo :
+                mInjector.getDexUseManager().getSecondaryDexInfo(pkgState.getPackageName())) {
+            for (Abi abi : Utils.getAllAbisForNames(dexInfo.abiNames(), pkgState)) {
+                artifacts.add(AidlUtils.buildArtifactsPath(
+                        dexInfo.dexPath(), abi.isa(), false /* isInDalvikCache */));
+            }
+        }
+
+        return WritableArtifactLists.create(artifacts, runtimeArtifacts);
+    }
+
+    /** Returns artifacts that are usable, regardless of whether they are writable. */
+    @NonNull
+    public UsableArtifactLists getUsableArtifacts(
+            @NonNull PackageState pkgState, @NonNull AndroidPackage pkg) throws RemoteException {
+        List<ArtifactsPath> artifacts = new ArrayList<>();
+        List<VdexPath> vdexFiles = new ArrayList<>();
+        List<RuntimeArtifactsPath> runtimeArtifacts = new ArrayList<>();
+
+        for (Pair<DetailedDexInfo, Abi> pair :
+                getDexAndAbis(pkgState, pkg, true /* forPrimaryDex */, true /* forSecondaryDex */,
+                        true /* excludeObsoleteDexesAndLoaders */)) {
+            DetailedDexInfo dexInfo = pair.first;
+            Abi abi = pair.second;
+            try {
+                GetDexoptStatusResult result = mInjector.getArtd().getDexoptStatus(
+                        dexInfo.dexPath(), abi.isa(), dexInfo.classLoaderContext());
+                if (result.artifactsLocation == ArtifactsLocation.DALVIK_CACHE
+                        || result.artifactsLocation == ArtifactsLocation.NEXT_TO_DEX) {
+                    ArtifactsPath thisArtifacts = AidlUtils.buildArtifactsPath(dexInfo.dexPath(),
+                            abi.isa(), result.artifactsLocation == ArtifactsLocation.DALVIK_CACHE);
+                    if (result.compilationReason.equals(ArtConstants.REASON_VDEX)) {
+                        // Only the VDEX file is usable.
+                        vdexFiles.add(VdexPath.artifactsPath(thisArtifacts));
+                    } else {
+                        artifacts.add(thisArtifacts);
+                    }
+                    // Runtime images are only generated for primary dex files.
+                    if (dexInfo instanceof DetailedPrimaryDexInfo
+                            && !DexFile.isOptimizedCompilerFilter(result.compilerFilter)) {
+                        runtimeArtifacts.add(AidlUtils.buildRuntimeArtifactsPath(
+                                pkgState.getPackageName(), dexInfo.dexPath(), abi.isa()));
+                    }
+                }
+            } catch (ServiceSpecificException e) {
+                Log.e(TAG,
+                        String.format(
+                                "Failed to get dexopt status [packageName = %s, dexPath = %s, "
+                                        + "isa = %s, classLoaderContext = %s]",
+                                pkgState.getPackageName(), dexInfo.dexPath(), abi.isa(),
+                                dexInfo.classLoaderContext()),
+                        e);
+            }
+        }
+
+        return UsableArtifactLists.create(artifacts, vdexFiles, runtimeArtifacts);
+    }
+
+    /**
+     * @param excludeForObsoleteDexesAndLoaders If true, excludes profiles for secondary dex files
+     *         and loaders based on file visibility. See details in {@link
+     *         DexUseManagerLocal#getCheckedSecondaryDexInfo}.
+     */
+    @NonNull
+    public ProfileLists getProfiles(@NonNull PackageState pkgState, @NonNull AndroidPackage pkg,
+            boolean alsoForSecondaryDex, boolean excludeForObsoleteDexesAndLoaders) {
+        List<ProfilePath> refProfiles = new ArrayList<>();
+        List<ProfilePath> curProfiles = new ArrayList<>();
+
+        for (PrimaryDexInfo dexInfo : PrimaryDexUtils.getDexInfo(pkg)) {
+            refProfiles.add(PrimaryDexUtils.buildRefProfilePath(pkgState, dexInfo));
+            curProfiles.addAll(mInjector.isSystemOrRootOrShell()
+                            ? PrimaryDexUtils.getCurProfiles(
+                                    mInjector.getUserManager(), pkgState, dexInfo)
+                            : PrimaryDexUtils.getCurProfiles(
+                                    List.of(mInjector.getCallingUserHandle()), pkgState, dexInfo));
+        }
+        if (alsoForSecondaryDex) {
+            List<? extends SecondaryDexInfo> dexInfos = excludeForObsoleteDexesAndLoaders
+                    ? mInjector.getDexUseManager().getCheckedSecondaryDexInfo(
+                            pkgState.getPackageName(), true /* excludeForObsoleteDexesAndLoaders */)
+                    : mInjector.getDexUseManager().getSecondaryDexInfo(pkgState.getPackageName());
+            for (SecondaryDexInfo dexInfo : dexInfos) {
+                if (!mInjector.isSystemOrRootOrShell()
+                        && !mInjector.getCallingUserHandle().equals(dexInfo.userHandle())) {
+                    continue;
+                }
+                refProfiles.add(AidlUtils.buildProfilePathForSecondaryRef(dexInfo.dexPath()));
+                curProfiles.add(AidlUtils.buildProfilePathForSecondaryCur(dexInfo.dexPath()));
+            }
+        }
+
+        return ProfileLists.create(refProfiles, curProfiles);
+    }
+
+    @Immutable
+    @AutoValue
+    @SuppressWarnings("AutoValueImmutableFields") // Can't use ImmutableList because it's in Guava.
+    public abstract static class WritableArtifactLists {
+        protected WritableArtifactLists() {}
+
+        public static @NonNull WritableArtifactLists create(@NonNull List<ArtifactsPath> artifacts,
+                @NonNull List<RuntimeArtifactsPath> runtimeArtifacts) {
+            return new AutoValue_ArtFileManager_WritableArtifactLists(
+                    Collections.unmodifiableList(artifacts),
+                    Collections.unmodifiableList(runtimeArtifacts));
+        }
+
+        public abstract @NonNull List<ArtifactsPath> artifacts();
+        public abstract @NonNull List<RuntimeArtifactsPath> runtimeArtifacts();
+    }
+
+    @Immutable
+    @AutoValue
+    @SuppressWarnings("AutoValueImmutableFields") // Can't use ImmutableList because it's in Guava.
+    public abstract static class UsableArtifactLists {
+        protected UsableArtifactLists() {}
+
+        public static @NonNull UsableArtifactLists create(@NonNull List<ArtifactsPath> artifacts,
+                @NonNull List<VdexPath> vdexFiles,
+                @NonNull List<RuntimeArtifactsPath> runtimeArtifacts) {
+            return new AutoValue_ArtFileManager_UsableArtifactLists(
+                    Collections.unmodifiableList(artifacts),
+                    Collections.unmodifiableList(vdexFiles),
+                    Collections.unmodifiableList(runtimeArtifacts));
+        }
+
+        public abstract @NonNull List<ArtifactsPath> artifacts();
+        public abstract @NonNull List<VdexPath> vdexFiles();
+
+        // Those not added to the list are definitely unusable, but those added to the list are not
+        // necessarily usable. For example, runtime artifacts can be outdated when the corresponding
+        // dex file is updated, but they may still show up in this list.
+        //
+        // However, this is not a severe problem. For `ArtManagerLocal.cleanup`, the worst result is
+        // only that we are keeping more runtime artifacts than needed. For
+        // `ArtManagerLocal.getArtManagedFileStats`, this is an edge case because the API call is
+        // transitively initiated by the app itself, and the runtime refreshes unusable runtime
+        // artifacts as soon as the app starts.
+        //
+        // TODO(jiakaiz): Improve this.
+        public abstract @NonNull List<RuntimeArtifactsPath> runtimeArtifacts();
+    }
+
+    @Immutable
+    @AutoValue
+    @SuppressWarnings("AutoValueImmutableFields") // Can't use ImmutableList because it's in Guava.
+    public abstract static class ProfileLists {
+        protected ProfileLists() {}
+
+        public static @NonNull ProfileLists create(
+                @NonNull List<ProfilePath> refProfiles, @NonNull List<ProfilePath> curProfiles) {
+            return new AutoValue_ArtFileManager_ProfileLists(
+                    Collections.unmodifiableList(refProfiles),
+                    Collections.unmodifiableList(curProfiles));
+        }
+
+        public abstract @NonNull List<ProfilePath> refProfiles();
+        public abstract @NonNull List<ProfilePath> curProfiles();
+
+        public @NonNull List<ProfilePath> allProfiles() {
+            List<ProfilePath> profiles = new ArrayList<>();
+            profiles.addAll(refProfiles());
+            profiles.addAll(curProfiles());
+            return profiles;
+        }
+    }
+
+    /**Injector pattern for testing purpose. */
+    @VisibleForTesting
+    public static class Injector {
+        @NonNull private final Context mContext;
+
+        Injector(@NonNull Context context) {
+            mContext = context;
+
+            // Call the getters for the dependencies that aren't optional, to ensure correct
+            // initialization order.
+            ArtModuleServiceInitializer.getArtModuleServiceManager();
+            getUserManager();
+            getDexUseManager();
+        }
+
+        @NonNull
+        public IArtd getArtd() {
+            return ArtdRefCache.getInstance().getArtd();
+        }
+
+        @NonNull
+        public UserManager getUserManager() {
+            return Objects.requireNonNull(mContext.getSystemService(UserManager.class));
+        }
+
+        @NonNull
+        public DexUseManagerLocal getDexUseManager() {
+            return Objects.requireNonNull(
+                    LocalManagerRegistry.getManager(DexUseManagerLocal.class));
+        }
+
+        public boolean isSystemOrRootOrShell() {
+            // At the time of writing, this is only typically true unless called by an app through
+            // {@link ArtManagerLocal#getArtManagedFileStats}.
+            return Utils.isSystemOrRootOrShell();
+        }
+
+        @NonNull
+        public UserHandle getCallingUserHandle() {
+            return Binder.getCallingUserHandle();
+        }
+    }
+}
diff --git a/libartservice/service/java/com/android/server/art/ArtManagerLocal.java b/libartservice/service/java/com/android/server/art/ArtManagerLocal.java
index f8d6b56..db82bfd 100644
--- a/libartservice/service/java/com/android/server/art/ArtManagerLocal.java
+++ b/libartservice/service/java/com/android/server/art/ArtManagerLocal.java
@@ -16,8 +16,9 @@
 
 package com.android.server.art;
 
-import static com.android.server.art.DexUseManagerLocal.DetailedSecondaryDexInfo;
-import static com.android.server.art.DexUseManagerLocal.SecondaryDexInfo;
+import static com.android.server.art.ArtFileManager.ProfileLists;
+import static com.android.server.art.ArtFileManager.UsableArtifactLists;
+import static com.android.server.art.ArtFileManager.WritableArtifactLists;
 import static com.android.server.art.PrimaryDexUtils.DetailedPrimaryDexInfo;
 import static com.android.server.art.PrimaryDexUtils.PrimaryDexInfo;
 import static com.android.server.art.ReasonMapping.BatchDexoptReason;
@@ -58,6 +59,7 @@
 import com.android.internal.annotations.VisibleForTesting;
 import com.android.server.LocalManagerRegistry;
 import com.android.server.art.model.ArtFlags;
+import com.android.server.art.model.ArtManagedFileStats;
 import com.android.server.art.model.BatchDexoptParams;
 import com.android.server.art.model.Config;
 import com.android.server.art.model.DeleteResult;
@@ -125,7 +127,7 @@
 
     @Deprecated
     public ArtManagerLocal() {
-        mInjector = new Injector(this, null /* context */);
+        mInjector = new Injector();
     }
 
     /**
@@ -181,6 +183,8 @@
      * Deletes dexopt artifacts of a package, including the artifacts for primary dex files and the
      * ones for secondary dex files. This includes VDEX, ODEX, and ART files.
      *
+     * Also deletes runtime artifacts of the package, though they are not dexopt artifacts.
+     *
      * @throws IllegalArgumentException if the package is not found or the flags are illegal
      * @throws IllegalStateException if the operation encounters an error that should never happen
      *         (e.g., an internal logic error).
@@ -192,28 +196,16 @@
         PackageState pkgState = Utils.getPackageStateOrThrow(snapshot, packageName);
         AndroidPackage pkg = Utils.getPackageOrThrow(pkgState);
 
-        try {
+        try (var pin = mInjector.createArtdPin()) {
             long freedBytes = 0;
-
-            boolean isInDalvikCache = Utils.isInDalvikCache(pkgState, mInjector.getArtd());
-            for (PrimaryDexInfo dexInfo : PrimaryDexUtils.getDexInfo(pkg)) {
-                if (!dexInfo.hasCode()) {
-                    continue;
-                }
-                for (Abi abi : Utils.getAllAbis(pkgState)) {
-                    freedBytes += mInjector.getArtd().deleteArtifacts(AidlUtils.buildArtifactsPath(
-                            dexInfo.dexPath(), abi.isa(), isInDalvikCache));
-                }
+            WritableArtifactLists list =
+                    mInjector.getArtFileManager().getWritableArtifacts(pkgState, pkg);
+            for (ArtifactsPath artifacts : list.artifacts()) {
+                freedBytes += mInjector.getArtd().deleteArtifacts(artifacts);
             }
-
-            for (SecondaryDexInfo dexInfo :
-                    mInjector.getDexUseManager().getSecondaryDexInfo(packageName)) {
-                for (Abi abi : Utils.getAllAbisForNames(dexInfo.abiNames(), pkgState)) {
-                    freedBytes += mInjector.getArtd().deleteArtifacts(AidlUtils.buildArtifactsPath(
-                            dexInfo.dexPath(), abi.isa(), false /* isInDalvikCache */));
-                }
+            for (RuntimeArtifactsPath runtimeArtifacts : list.runtimeArtifacts()) {
+                freedBytes += mInjector.getArtd().deleteRuntimeArtifacts(runtimeArtifacts);
             }
-
             return DeleteResult.create(freedBytes);
         } catch (RemoteException e) {
             Utils.logArtdException(e);
@@ -222,7 +214,8 @@
     }
 
     /**
-     * Returns the dexopt status of a package.
+     * Returns the dexopt status of all known dex container files of a package, even if some of them
+     * aren't readable.
      *
      * Uses the default flags ({@link ArtFlags#defaultGetStatusFlags()}).
      *
@@ -253,31 +246,12 @@
 
         PackageState pkgState = Utils.getPackageStateOrThrow(snapshot, packageName);
         AndroidPackage pkg = Utils.getPackageOrThrow(pkgState);
+        List<Pair<DetailedDexInfo, Abi>> dexAndAbis = mInjector.getArtFileManager().getDexAndAbis(
+                pkgState, pkg, (flags & ArtFlags.FLAG_FOR_PRIMARY_DEX) != 0,
+                (flags & ArtFlags.FLAG_FOR_SECONDARY_DEX) != 0,
+                false /* excludeObsoleteDexesAndLoaders */);
 
-        List<Pair<DetailedDexInfo, Abi>> dexAndAbis = new ArrayList<>();
-
-        if ((flags & ArtFlags.FLAG_FOR_PRIMARY_DEX) != 0) {
-            for (DetailedPrimaryDexInfo dexInfo :
-                    PrimaryDexUtils.getDetailedDexInfo(pkgState, pkg)) {
-                if (!dexInfo.hasCode()) {
-                    continue;
-                }
-                for (Abi abi : Utils.getAllAbis(pkgState)) {
-                    dexAndAbis.add(Pair.create(dexInfo, abi));
-                }
-            }
-        }
-
-        if ((flags & ArtFlags.FLAG_FOR_SECONDARY_DEX) != 0) {
-            for (SecondaryDexInfo dexInfo :
-                    mInjector.getDexUseManager().getSecondaryDexInfo(packageName)) {
-                for (Abi abi : Utils.getAllAbisForNames(dexInfo.abiNames(), pkgState)) {
-                    dexAndAbis.add(Pair.create(dexInfo, abi));
-                }
-            }
-        }
-
-        try {
+        try (var pin = mInjector.createArtdPin()) {
             List<DexContainerFileDexoptStatus> statuses = new ArrayList<>();
 
             for (Pair<DetailedDexInfo, Abi> pair : dexAndAbis) {
@@ -328,27 +302,14 @@
         PackageState pkgState = Utils.getPackageStateOrThrow(snapshot, packageName);
         AndroidPackage pkg = Utils.getPackageOrThrow(pkgState);
 
-        try {
-            for (PrimaryDexInfo dexInfo : PrimaryDexUtils.getDexInfo(pkg)) {
-                if (!dexInfo.hasCode()) {
-                    continue;
-                }
-                mInjector.getArtd().deleteProfile(
-                        PrimaryDexUtils.buildRefProfilePath(pkgState, dexInfo));
-                for (ProfilePath profile : PrimaryDexUtils.getCurProfiles(
-                             mInjector.getUserManager(), pkgState, dexInfo)) {
-                    mInjector.getArtd().deleteProfile(profile);
-                }
-            }
-
-            // This only deletes the profiles of known secondary dex files. If there are unknown
-            // secondary dex files, their profiles will be deleted by `cleanup`.
-            for (SecondaryDexInfo dexInfo :
-                    mInjector.getDexUseManager().getSecondaryDexInfo(packageName)) {
-                mInjector.getArtd().deleteProfile(
-                        AidlUtils.buildProfilePathForSecondaryRef(dexInfo.dexPath()));
-                mInjector.getArtd().deleteProfile(
-                        AidlUtils.buildProfilePathForSecondaryCur(dexInfo.dexPath()));
+        try (var pin = mInjector.createArtdPin()) {
+            // We want to delete as many profiles as possible, so this deletes profiles of all known
+            // secondary dex files. If there are unknown secondary dex files, their profiles will be
+            // deleted by `cleanup`.
+            ProfileLists list = mInjector.getArtFileManager().getProfiles(pkgState, pkg,
+                    true /* alsoForSecondaryDex */, false /* excludeForObsoleteDexesAndLoaders */);
+            for (ProfilePath profile : list.allProfiles()) {
+                mInjector.getArtd().deleteProfile(profile);
             }
         } catch (RemoteException e) {
             Utils.logArtdException(e);
@@ -359,6 +320,10 @@
      * Dexopts a package. The time this operation takes ranges from a few milliseconds to several
      * minutes, depending on the params and the code size of the package.
      *
+     * When dexopt is successfully performed for a dex container file, this operation also deletes
+     * the corresponding runtime artifacts (the ART files in the package's data directory, which are
+     * generated by the runtime, not by dexopt).
+     *
      * When this operation ends (either completed or cancelled), callbacks added by {@link
      * #addDexoptDoneCallback(Executor, DexoptDoneCallback)} are called.
      *
@@ -384,16 +349,18 @@
     public DexoptResult dexoptPackage(@NonNull PackageManagerLocal.FilteredSnapshot snapshot,
             @NonNull String packageName, @NonNull DexoptParams params,
             @NonNull CancellationSignal cancellationSignal) {
-        return mInjector.getDexoptHelper().dexopt(
-                snapshot, List.of(packageName), params, cancellationSignal, Runnable::run);
+        try (var pin = mInjector.createArtdPin()) {
+            return mInjector.getDexoptHelper().dexopt(
+                    snapshot, List.of(packageName), params, cancellationSignal, Runnable::run);
+        }
     }
 
     /**
      * Resets the dexopt state of the package as if the package is newly installed.
      *
-     * More specifically, it clears reference profiles, current profiles, and any code compiled from
-     * those local profiles. If there is an external profile (e.g., a cloud profile), the code
-     * compiled from that profile will be kept.
+     * More specifically, it clears reference profiles, current profiles, any code compiled from
+     * those local profiles, and runtime artifacts. If there is an external profile (e.g., a cloud
+     * profile), the code compiled from that profile will be kept.
      *
      * For secondary dex files, it also clears all dexopt artifacts.
      *
@@ -494,7 +461,7 @@
         ExecutorService dexoptExecutor =
                 Executors.newFixedThreadPool(ReasonMapping.getConcurrencyForReason(reason));
         Map<Integer, DexoptResult> dexoptResults = new HashMap<>();
-        try {
+        try (var pin = mInjector.createArtdPin()) {
             if (reason.equals(ReasonMapping.REASON_BG_DEXOPT)) {
                 DexoptResult downgradeResult = maybeDowngradePackages(snapshot,
                         new HashSet<>(params.getPackages()) /* excludedPackages */,
@@ -575,9 +542,8 @@
      *
      * When the job is running, it may be cancelled by the job scheduler immediately whenever one of
      * the constraints above is no longer met or cancelled by the {@link
-     * #cancelBackgroundDexoptJob()} API. The job scheduler retries it in the next <i>maintenance
-     * window</i>. For information about <i>maintenance window</i>, see
-     * https://developer.android.com/training/monitoring-device-state/doze-standby.
+     * #cancelBackgroundDexoptJob()} API. The job scheduler retries it with the default retry policy
+     * (30 seconds, exponential, capped at 5hrs).
      *
      * See {@link #dexoptPackages} for how to customize the behavior of the job.
      *
@@ -758,7 +724,7 @@
             @NonNull PackageManagerLocal.FilteredSnapshot snapshot, @NonNull String packageName,
             @Nullable String splitName, @NonNull MergeProfileOptions options)
             throws SnapshotProfileException {
-        try {
+        try (var pin = mInjector.createArtdPin()) {
             PackageState pkgState = Utils.getPackageStateOrThrow(snapshot, packageName);
             AndroidPackage pkg = Utils.getPackageOrThrow(pkgState);
             PrimaryDexInfo dexInfo = PrimaryDexUtils.getDexInfoBySplitName(pkg, splitName);
@@ -840,14 +806,10 @@
             // check.
             if (Utils.canDexoptPackage(appPkgState, null /* appHibernationManager */)) {
                 AndroidPackage appPkg = Utils.getPackageOrThrow(appPkgState);
-                for (PrimaryDexInfo appDexInfo : PrimaryDexUtils.getDexInfo(appPkg)) {
-                    if (!appDexInfo.hasCode()) {
-                        continue;
-                    }
-                    profiles.add(PrimaryDexUtils.buildRefProfilePath(appPkgState, appDexInfo));
-                    profiles.addAll(PrimaryDexUtils.getCurProfiles(
-                            mInjector.getUserManager(), appPkgState, appDexInfo));
-                }
+                ProfileLists list = mInjector.getArtFileManager().getProfiles(appPkgState, appPkg,
+                        false /* alsoForSecondaryDex */,
+                        true /* excludeForObsoleteDexesAndLoaders */);
+                profiles.addAll(list.allProfiles());
             }
         });
 
@@ -864,7 +826,10 @@
         var options = new MergeProfileOptions();
         options.forceMerge = true;
         options.forBootImage = true;
-        return mergeProfilesAndGetFd(profiles, output, dexPaths, options);
+
+        try (var pin = mInjector.createArtdPin()) {
+            return mergeProfilesAndGetFd(profiles, output, dexPaths, options);
+        }
     }
 
     /**
@@ -888,6 +853,25 @@
     }
 
     /**
+     * Notifies ART Service that there are apexes staged for installation on next reboot (see
+     * <a href="https://source.android.com/docs/core/ota/apex#apex-manager">the update sequence of
+     * an APEX</a>). ART Service may use this to schedule a pre-reboot dexopt job. This might change
+     * in the future.
+     *
+     * This immediately returns after scheduling the job and doesn't wait for the job to run.
+     *
+     * @param stagedApexModuleNames The <b>module names</b> of the staged apexes, corresponding to
+     *         the directory beneath /apex, e.g., {@code com.android.art} (not the <b>package
+     *         names</b>, e.g., {@code com.google.android.art}).
+     */
+    @SuppressLint("UnflaggedApi") // Flag support for mainline is not available.
+    @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+    public void onApexStaged(@NonNull String[] stagedApexModuleNames) {
+        // TODO(b/311377497): Check system requirements.
+        mInjector.getPreRebootDexoptJob().schedule();
+    }
+
+    /**
      * Dumps the dexopt state of all packages in text format for debugging purposes.
      *
      * There are no stability guarantees for the output format.
@@ -898,7 +882,9 @@
     @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
     public void dump(
             @NonNull PrintWriter pw, @NonNull PackageManagerLocal.FilteredSnapshot snapshot) {
-        new DumpHelper(this).dump(pw, snapshot);
+        try (var pin = mInjector.createArtdPin()) {
+            new DumpHelper(this).dump(pw, snapshot);
+        }
     }
 
     /**
@@ -913,8 +899,82 @@
     @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
     public void dumpPackage(@NonNull PrintWriter pw,
             @NonNull PackageManagerLocal.FilteredSnapshot snapshot, @NonNull String packageName) {
-        new DumpHelper(this).dumpPackage(
-                pw, snapshot, Utils.getPackageStateOrThrow(snapshot, packageName));
+        try (var pin = mInjector.createArtdPin()) {
+            new DumpHelper(this).dumpPackage(
+                    pw, snapshot, Utils.getPackageStateOrThrow(snapshot, packageName));
+        }
+    }
+
+    /**
+     * Returns the statistics of the files managed by ART of a package.
+     *
+     * @throws IllegalArgumentException if the package is not found
+     * @throws IllegalStateException if the operation encounters an error that should never happen
+     *         (e.g., an internal logic error).
+     */
+    @SuppressLint("UnflaggedApi") // Flag support for mainline is not available.
+    @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+    @NonNull
+    public ArtManagedFileStats getArtManagedFileStats(
+            @NonNull PackageManagerLocal.FilteredSnapshot snapshot, @NonNull String packageName) {
+        PackageState pkgState = Utils.getPackageStateOrThrow(snapshot, packageName);
+        AndroidPackage pkg = Utils.getPackageOrThrow(pkgState);
+
+        try (var pin = mInjector.createArtdPin()) {
+            long artifactsSize = 0;
+            long refProfilesSize = 0;
+            long curProfilesSize = 0;
+            IArtd artd = mInjector.getArtd();
+
+            UsableArtifactLists artifactLists =
+                    mInjector.getArtFileManager().getUsableArtifacts(pkgState, pkg);
+            for (ArtifactsPath artifacts : artifactLists.artifacts()) {
+                artifactsSize += artd.getArtifactsSize(artifacts);
+            }
+            for (VdexPath vdexFile : artifactLists.vdexFiles()) {
+                artifactsSize += artd.getVdexFileSize(vdexFile);
+            }
+            for (RuntimeArtifactsPath runtimeArtifacts : artifactLists.runtimeArtifacts()) {
+                artifactsSize += artd.getRuntimeArtifactsSize(runtimeArtifacts);
+            }
+
+            ProfileLists profileLists = mInjector.getArtFileManager().getProfiles(pkgState, pkg,
+                    true /* alsoForSecondaryDex */, true /* excludeForObsoleteDexesAndLoaders */);
+            for (ProfilePath profile : profileLists.refProfiles()) {
+                refProfilesSize += artd.getProfileSize(profile);
+            }
+            for (ProfilePath profile : profileLists.curProfiles()) {
+                curProfilesSize += artd.getProfileSize(profile);
+            }
+
+            return new ArtManagedFileStats(artifactsSize, refProfilesSize, curProfilesSize);
+        } catch (RemoteException e) {
+            Utils.logArtdException(e);
+            return new ArtManagedFileStats(
+                    0 /* artifactsSize */, 0 /* refProfilesSize */, 0 /* curProfilesSize */);
+        }
+    }
+
+    /**
+     * Overrides the compiler filter of a package. The callback is called whenever a package is
+     * going to be dexopted. This method is thread-safe.
+     */
+    @SuppressLint("UnflaggedApi") // Flag support for mainline is not available.
+    @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+    public void setAdjustCompilerFilterCallback(@NonNull @CallbackExecutor Executor executor,
+            @NonNull AdjustCompilerFilterCallback callback) {
+        mInjector.getConfig().setAdjustCompilerFilterCallback(executor, callback);
+    }
+
+    /**
+     * Clears the callback set by {@link
+     * #setAdjustCompilerFilterCallback(Executor, AdjustCompilerFilterCallback)}. This
+     * method is thread-safe.
+     */
+    @SuppressLint("UnflaggedApi") // Flag support for mainline is not available.
+    @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+    public void clearAdjustCompilerFilterCallback() {
+        mInjector.getConfig().clearAdjustCompilerFilterCallback();
     }
 
     /**
@@ -927,9 +987,9 @@
      */
     @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
     public long cleanup(@NonNull PackageManagerLocal.FilteredSnapshot snapshot) {
-        mInjector.getDexUseManager().cleanup();
+        try (var pin = mInjector.createArtdPin()) {
+            mInjector.getDexUseManager().cleanup();
 
-        try {
             // For every primary dex container file or secondary dex container file of every app, if
             // it has code, we keep the following types of files:
             // - The reference profile and the current profiles, regardless of the hibernation state
@@ -937,49 +997,35 @@
             // - The dexopt artifacts, if they are up-to-date and the app is not hibernating.
             // - Only the VDEX part of the dexopt artifacts, if the dexopt artifacts are outdated
             //   but the VDEX part is still usable and the app is not hibernating.
+            // - The runtime artifacts, if dexopt artifacts are fully or partially usable and the
+            //   usable parts don't contain AOT-compiled code. (This logic must be aligned with the
+            //   one that determines when runtime images can be loaded in
+            //   `OatFileManager::OpenDexFilesFromOat` in `art/runtime/oat_file_manager.cc`.)
             List<ProfilePath> profilesToKeep = new ArrayList<>();
             List<ArtifactsPath> artifactsToKeep = new ArrayList<>();
             List<VdexPath> vdexFilesToKeep = new ArrayList<>();
+            List<RuntimeArtifactsPath> runtimeArtifactsToKeep = new ArrayList<>();
 
             for (PackageState pkgState : snapshot.getPackageStates().values()) {
                 if (!Utils.canDexoptPackage(pkgState, null /* appHibernationManager */)) {
                     continue;
                 }
                 AndroidPackage pkg = Utils.getPackageOrThrow(pkgState);
-                boolean isInDalvikCache = Utils.isInDalvikCache(pkgState, mInjector.getArtd());
-                boolean keepArtifacts = !Utils.shouldSkipDexoptDueToHibernation(
-                        pkgState, mInjector.getAppHibernationManager());
-                for (DetailedPrimaryDexInfo dexInfo :
-                        PrimaryDexUtils.getDetailedDexInfo(pkgState, pkg)) {
-                    if (!dexInfo.hasCode()) {
-                        continue;
-                    }
-                    profilesToKeep.add(PrimaryDexUtils.buildRefProfilePath(pkgState, dexInfo));
-                    profilesToKeep.addAll(PrimaryDexUtils.getCurProfiles(
-                            mInjector.getUserManager(), pkgState, dexInfo));
-                    if (keepArtifacts) {
-                        for (Abi abi : Utils.getAllAbis(pkgState)) {
-                            maybeKeepArtifacts(artifactsToKeep, vdexFilesToKeep, pkgState, dexInfo,
-                                    abi, isInDalvikCache);
-                        }
-                    }
-                }
-                for (DetailedSecondaryDexInfo dexInfo :
-                        mInjector.getDexUseManager().getFilteredDetailedSecondaryDexInfo(
-                                pkgState.getPackageName())) {
-                    profilesToKeep.add(
-                            AidlUtils.buildProfilePathForSecondaryRef(dexInfo.dexPath()));
-                    profilesToKeep.add(
-                            AidlUtils.buildProfilePathForSecondaryCur(dexInfo.dexPath()));
-                    if (keepArtifacts) {
-                        for (Abi abi : Utils.getAllAbisForNames(dexInfo.abiNames(), pkgState)) {
-                            maybeKeepArtifacts(artifactsToKeep, vdexFilesToKeep, pkgState, dexInfo,
-                                    abi, false /* isInDalvikCache */);
-                        }
-                    }
+                ProfileLists profileLists = mInjector.getArtFileManager().getProfiles(pkgState, pkg,
+                        true /* alsoForSecondaryDex */,
+                        true /* excludeForObsoleteDexesAndLoaders */);
+                profilesToKeep.addAll(profileLists.allProfiles());
+                if (!Utils.shouldSkipDexoptDueToHibernation(
+                            pkgState, mInjector.getAppHibernationManager())) {
+                    UsableArtifactLists artifactLists =
+                            mInjector.getArtFileManager().getUsableArtifacts(pkgState, pkg);
+                    artifactsToKeep.addAll(artifactLists.artifacts());
+                    vdexFilesToKeep.addAll(artifactLists.vdexFiles());
+                    runtimeArtifactsToKeep.addAll(artifactLists.runtimeArtifacts());
                 }
             }
-            return mInjector.getArtd().cleanup(profilesToKeep, artifactsToKeep, vdexFilesToKeep);
+            return mInjector.getArtd().cleanup(
+                    profilesToKeep, artifactsToKeep, vdexFilesToKeep, runtimeArtifactsToKeep);
         } catch (RemoteException e) {
             Utils.logArtdException(e);
             return 0;
@@ -987,43 +1033,6 @@
     }
 
     /**
-     * Checks if the artifacts are up-to-date, and maybe adds them to {@code artifactsToKeep} or
-     * {@code vdexFilesToKeep} based on the result.
-     */
-    @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-    private void maybeKeepArtifacts(@NonNull List<ArtifactsPath> artifactsToKeep,
-            @NonNull List<VdexPath> vdexFilesToKeep, @NonNull PackageState pkgState,
-            @NonNull DetailedDexInfo dexInfo, @NonNull Abi abi, boolean isInDalvikCache)
-            throws RemoteException {
-        try {
-            GetDexoptStatusResult result = mInjector.getArtd().getDexoptStatus(
-                    dexInfo.dexPath(), abi.isa(), dexInfo.classLoaderContext());
-            if (DexFile.isValidCompilerFilter(result.compilerFilter)) {
-                // TODO(b/263579377): This is a bit inaccurate. We may be keeping the artifacts in
-                // dalvik-cache while OatFileAssistant actually picks the ones not in dalvik-cache.
-                // However, this isn't a big problem because it is an edge case and it only causes
-                // us to delete less rather than deleting more.
-                ArtifactsPath artifacts =
-                        AidlUtils.buildArtifactsPath(dexInfo.dexPath(), abi.isa(), isInDalvikCache);
-                if (result.compilationReason.equals(ArtConstants.REASON_VDEX)) {
-                    // Only the VDEX file is usable.
-                    vdexFilesToKeep.add(VdexPath.artifactsPath(artifacts));
-                } else {
-                    artifactsToKeep.add(artifacts);
-                }
-            }
-        } catch (ServiceSpecificException e) {
-            // Don't add the artifacts to the lists. They should be cleaned up.
-            Log.e(TAG,
-                    String.format("Failed to get dexopt status [packageName = %s, dexPath = %s, "
-                                    + "isa = %s, classLoaderContext = %s]",
-                            pkgState.getPackageName(), dexInfo.dexPath(), abi.isa(),
-                            dexInfo.classLoaderContext()),
-                    e);
-        }
-    }
-
-    /**
      * Should be used by {@link BackgroundDexoptJobService} ONLY.
      *
      * @hide
@@ -1034,6 +1043,17 @@
         return mInjector.getBackgroundDexoptJob();
     }
 
+    /**
+     * Should be used by {@link BackgroundDexoptJobService} ONLY.
+     *
+     * @hide
+     */
+    @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+    @NonNull
+    PreRebootDexoptJob getPreRebootDexoptJob() {
+        return mInjector.getPreRebootDexoptJob();
+    }
+
     @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
     @Nullable
     private DexoptResult maybeDowngradePackages(
@@ -1237,9 +1257,8 @@
          *
          * Additionally, {@code cancellationSignal.cancel()} can be called to cancel this operation.
          * If this operation is initiated by the job scheduler and the {@code reason} is {@link
-         * ReasonMapping#REASON_BG_DEXOPT}, the job will be retried in the next <i>maintenance
-         * window</i>. For information about <i>maintenance window</i>, see
-         * https://developer.android.com/training/monitoring-device-state/doze-standby.
+         * ReasonMapping#REASON_BG_DEXOPT}, the job will be retried with the default retry policy
+         * (30 seconds, exponential, capped at 5hrs).
          *
          * Changing the reason is not allowed. Doing so will result in {@link IllegalStateException}
          * when {@link #dexoptPackages} is called.
@@ -1261,6 +1280,12 @@
          * ArtManagerLocal#scheduleBackgroundDexoptJob()} is passed to the callback as the {@code
          * builder} argument.
          *
+         * Setting {@link JobInfo.Builder#setBackoffCriteria} is not allowed. Doing so will result
+         * in {@link IllegalArgumentException} when {@link #scheduleBackgroundDexoptJob()} is
+         * called. The job is retried with the default retry policy (30 seconds, exponential, capped
+         * at 5hrs). Unfortunately, due to the limitation of the job scheduler API, this retry
+         * policy cannot be changed.
+         *
          * Setting {@link JobInfo.Builder#setRequiresStorageNotLow(boolean)} is not allowed. Doing
          * so will result in {@link IllegalStateException} when {@link
          * #scheduleBackgroundDexoptJob()} is called. ART Service has its own storage check, which
@@ -1279,6 +1304,55 @@
         void onDexoptDone(@NonNull DexoptResult result);
     }
 
+    /** @hide */
+    @SuppressLint("UnflaggedApi") // Flag support for mainline is not available.
+    @SystemApi(client = SystemApi.Client.SYSTEM_SERVER)
+    @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+    public interface AdjustCompilerFilterCallback {
+        /**
+         * Returns the adjusted compiler filter for the given package. If a package doesn't need
+         * adjustment, this callback must return {@code originalCompilerFilter}. The callback must
+         * be able to handle unknown {@code originalCompilerFilter} and unknown {@code reason}
+         * because more compiler filters and reasons may be added in the future.
+         *
+         * The returned compiler filter overrides any compiler filter set by {@link
+         * DexoptParams.Builder#setCompilerFilter}, no matter the dexopt is initiated by a
+         * {@link #dexoptPackage} API call or any automatic batch dexopt (e.g., dexopt on boot and
+         * background dexopt).
+         *
+         * This callback is useful for:
+         * - Consistently overriding the compiler filter regardless of the dexopt initiator, for
+         *   some performance-sensitive packages.
+         * - Providing a compiler filter for specific packages during batch dexopt.
+         *
+         * The actual compiler filter to be used for dexopt will be determined in the following
+         * order:
+         *
+         * 1. The default compiler filter for the given reason.
+         * 2. The compiler filter set explicitly by {@link DexoptParams.Builder#setCompilerFilter}.
+         * 3. ART Service's internal adjustments to upgrade the compiler filter, based on whether
+         *    the package is System UI, etc.
+         * 4. The adjustments made by this callback.
+         * 5. ART Service's internal adjustments to downgrade the compiler filter, based on whether
+         *    the profile is available, etc.
+         *
+         * @param packageName the name of the package to be dexopted
+         * @param originalCompilerFilter the compiler filter before adjustment. This is the result
+         *         of step 3 described above. It would be the input to step 5 described above if
+         *         it wasn't for this callback.
+         * @param reason the compilation reason of this dexopt operation. It is a string defined in
+         *         {@link ReasonMapping} or a custom string passed to {@link
+         *         DexoptParams.Builder#Builder(String)}
+         *
+         * @return the compiler filter after adjustment. This will be the input to step 5 described
+         *         above
+         */
+        @SuppressLint("UnflaggedApi") // Flag support for mainline is not available.
+        @NonNull
+        String onAdjustCompilerFilter(@NonNull String packageName,
+                @NonNull String originalCompilerFilter, @NonNull String reason);
+    }
+
     /**
      * Represents an error that happens when snapshotting profiles.
      *
@@ -1310,30 +1384,33 @@
         @Nullable private final PackageManagerLocal mPackageManagerLocal;
         @Nullable private final Config mConfig;
         @Nullable private BackgroundDexoptJob mBgDexoptJob = null;
+        @Nullable private PreRebootDexoptJob mPrDexoptJob = null;
 
-        // TODO(jiakaiz): Remove @SuppressLint and check `Build.VERSION.SDK_INT >=
-        // Build.VERSION_CODES.UPSIDE_DOWN_CAKE` once the SDK is finalized.
-        @SuppressLint("NewApi")
+        /** For compatibility with S and T. New code should not use this. */
+        @Deprecated
+        Injector() {
+            mArtManagerLocal = null;
+            mContext = null;
+            mPackageManagerLocal = null;
+            mConfig = null;
+        }
+
+        @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
         Injector(@NonNull ArtManagerLocal artManagerLocal, @Nullable Context context) {
+            // We only need them on Android U and above, where a context is passed.
             mArtManagerLocal = artManagerLocal;
             mContext = context;
-            if (context != null) {
-                // We only need them on Android U and above, where a context is passed.
-                mPackageManagerLocal = Objects.requireNonNull(
-                        LocalManagerRegistry.getManager(PackageManagerLocal.class));
-                mConfig = new Config();
+            mPackageManagerLocal = Objects.requireNonNull(
+                    LocalManagerRegistry.getManager(PackageManagerLocal.class));
+            mConfig = new Config();
 
-                // Call the getters for the dependencies that aren't optional, to ensure correct
-                // initialization order.
-                getDexoptHelper();
-                getUserManager();
-                getDexUseManager();
-                getStorageManager();
-                ArtModuleServiceInitializer.getArtModuleServiceManager();
-            } else {
-                mPackageManagerLocal = null;
-                mConfig = null;
-            }
+            // Call the getters for the dependencies that aren't optional, to ensure correct
+            // initialization order.
+            getDexoptHelper();
+            getUserManager();
+            getDexUseManager();
+            getStorageManager();
+            ArtModuleServiceInitializer.getArtModuleServiceManager();
         }
 
         @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
@@ -1351,7 +1428,13 @@
         @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
         @NonNull
         public IArtd getArtd() {
-            return Utils.getArtd();
+            return ArtdRefCache.getInstance().getArtd();
+        }
+
+        @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+        @NonNull
+        public ArtdRefCache.Pin createArtdPin() {
+            return ArtdRefCache.getInstance().new Pin();
         }
 
         /** Returns a new {@link DexoptHelper} instance. */
@@ -1391,6 +1474,15 @@
 
         @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
         @NonNull
+        public synchronized PreRebootDexoptJob getPreRebootDexoptJob() {
+            if (mPrDexoptJob == null) {
+                mPrDexoptJob = new PreRebootDexoptJob(mContext);
+            }
+            return mPrDexoptJob;
+        }
+
+        @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+        @NonNull
         public UserManager getUserManager() {
             return Objects.requireNonNull(mContext.getSystemService(UserManager.class));
         }
@@ -1429,5 +1521,11 @@
             // This is a path that system_server is known to have full access to.
             return "/data/system";
         }
+
+        @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+        @NonNull
+        public ArtFileManager getArtFileManager() {
+            return new ArtFileManager(getContext());
+        }
     }
 }
diff --git a/libartservice/service/java/com/android/server/art/ArtShellCommand.java b/libartservice/service/java/com/android/server/art/ArtShellCommand.java
index f9e610c..592f9cd 100644
--- a/libartservice/service/java/com/android/server/art/ArtShellCommand.java
+++ b/libartservice/service/java/com/android/server/art/ArtShellCommand.java
@@ -557,9 +557,6 @@
         AndroidPackage pkg = Utils.getPackageOrThrow(pkgState);
         try (var tracing = new Utils.Tracing("dump profiles")) {
             for (PrimaryDexInfo dexInfo : PrimaryDexUtils.getDexInfo(pkg)) {
-                if (!dexInfo.hasCode()) {
-                    continue;
-                }
                 String profileName = PrimaryDexUtils.getProfileName(dexInfo.splitName());
                 // The path is intentionally inconsistent with the one for "snapshot-profile". This
                 // is to match the behavior of the legacy PM shell command.
@@ -818,20 +815,17 @@
 
         PackageState pkgState = Utils.getPackageStateOrThrow(snapshot, packageName);
         AndroidPackage pkg = Utils.getPackageOrThrow(pkgState);
-        List<PrimaryDexInfo> dexInfoList = PrimaryDexUtils.getDexInfo(pkg);
-
-        for (PrimaryDexInfo dexInfo : dexInfoList) {
-            if (splitArg.equals(dexInfo.splitName())) {
-                return splitArg;
-            }
+        PrimaryDexInfo dexInfo =
+                PrimaryDexUtils.findDexInfo(pkg, info -> splitArg.equals(info.splitName()));
+        if (dexInfo != null) {
+            return splitArg;
         }
-
-        for (PrimaryDexInfo dexInfo : dexInfoList) {
-            if (splitArg.equals(new File(dexInfo.dexPath()).getName())) {
-                pw.println("Warning: Specifying a split using a filename is deprecated. Please "
-                        + "use a split name (or an empty string for the base APK) instead");
-                return dexInfo.splitName();
-            }
+        dexInfo = PrimaryDexUtils.findDexInfo(
+                pkg, info -> splitArg.equals(new File(info.dexPath()).getName()));
+        if (dexInfo != null) {
+            pw.println("Warning: Specifying a split using a filename is deprecated. Please "
+                    + "use a split name (or an empty string for the base APK) instead");
+            return dexInfo.splitName();
         }
 
         throw new IllegalArgumentException(String.format("Split '%s' not found", splitArg));
@@ -842,14 +836,11 @@
             @NonNull String packageName, @NonNull String fullPath) {
         PackageState pkgState = Utils.getPackageStateOrThrow(snapshot, packageName);
         AndroidPackage pkg = Utils.getPackageOrThrow(pkgState);
-        List<PrimaryDexInfo> dexInfoList = PrimaryDexUtils.getDexInfo(pkg);
-
-        for (PrimaryDexInfo dexInfo : dexInfoList) {
-            if (fullPath.equals(dexInfo.dexPath())) {
-                return dexInfo.splitName();
-            }
+        PrimaryDexInfo dexInfo =
+                PrimaryDexUtils.findDexInfo(pkg, info -> fullPath.equals(info.dexPath()));
+        if (dexInfo != null) {
+            return dexInfo.splitName();
         }
-
         throw new IllegalArgumentException(String.format("Code path '%s' not found", fullPath));
     }
 
diff --git a/libartservice/service/java/com/android/server/art/ArtdRefCache.java b/libartservice/service/java/com/android/server/art/ArtdRefCache.java
new file mode 100644
index 0000000..27c5c72
--- /dev/null
+++ b/libartservice/service/java/com/android/server/art/ArtdRefCache.java
@@ -0,0 +1,217 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.art;
+
+import static android.os.IBinder.DeathRecipient;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.os.Build;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.util.CloseGuard;
+
+import androidx.annotation.RequiresApi;
+
+import com.android.internal.annotations.GuardedBy;
+import com.android.internal.annotations.VisibleForTesting;
+
+import java.lang.ref.Reference;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+
+/**
+ * A helper class that caches a reference to artd, to avoid repetitive calls to `waitForService`,
+ * as the latter is considered expensive.
+ *
+ * @hide
+ */
+@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+public class ArtdRefCache {
+    private static final String TAG = ArtManagerLocal.TAG;
+    // The 15s timeout is arbitrarily picked.
+    // TODO(jiakaiz): Revisit this based on real CUJs.
+    @VisibleForTesting public static final long CACHE_TIMEOUT_MS = 15_000;
+
+    @Nullable private static ArtdRefCache sInstance = null;
+
+    @NonNull private final Injector mInjector;
+    @NonNull private final Debouncer mDebouncer;
+
+    /**
+     * A lock that guards the <b>reference</b> to artd.
+     *
+     * Warning: This lock does not guard artd itself. Do not hold this lock when calling artd as it
+     * will prevent parallelism.
+     */
+    @NonNull private final Object mLock = new Object();
+
+    @GuardedBy("mLock") private int mPinCount = 0;
+    @GuardedBy("mLock") @Nullable private IArtd mArtd = null;
+
+    public ArtdRefCache() {
+        this(new Injector());
+    }
+
+    @VisibleForTesting
+    public ArtdRefCache(@NonNull Injector injector) {
+        mInjector = injector;
+        mDebouncer = new Debouncer(CACHE_TIMEOUT_MS, mInjector::createScheduledExecutor);
+    }
+
+    @NonNull
+    public static synchronized ArtdRefCache getInstance() {
+        if (sInstance == null) {
+            sInstance = new ArtdRefCache();
+        }
+        return sInstance;
+    }
+
+    /**
+     * Returns a reference to artd, from the cache or created on demand.
+     *
+     * If this method is called when there is no pin, it behaves as if a pin is created and
+     * immediately destroyed.
+     */
+    @NonNull
+    public IArtd getArtd() {
+        synchronized (mLock) {
+            if (mArtd == null) {
+                IArtd artd = mInjector.getArtd();
+                try {
+                    // Force clear the cache when the artd instance is dead.
+                    artd.asBinder().linkToDeath(new CacheDeathRecipient(), 0 /* flags */);
+                    // Cache the instance.
+                    mArtd = artd;
+                } catch (RemoteException e) {
+                    Utils.logArtdException(e);
+                    // Not expected. Let the caller decide what to do with it.
+                    return artd;
+                }
+            }
+            delayedDropIfNoPinLocked();
+            return mArtd;
+        }
+    }
+
+    @GuardedBy("mLock")
+    private void delayedDropIfNoPinLocked() {
+        if (mPinCount == 0) {
+            // During the timeout:
+            // - If there is no more pinning and unpinning, the cache will be dropped.
+            // - If there are pinnings and unpinnings, and `mPinCount` never reaches 0 again,
+            //   `dropIfNoPin` will be run, but it will not drop the cache.
+            // - If there are pinnings and unpinnings, and `mPinCount` reaches 0 again,
+            //   `dropIfNoPin` will be debounced.
+            mDebouncer.maybeRunAsync(this::dropIfNoPin);
+        }
+    }
+
+    private void dropIfNoPin() {
+        synchronized (mLock) {
+            if (mPinCount == 0) {
+                mArtd = null;
+            }
+        }
+    }
+
+    /**
+     * A scope that pins any reference to artd, either an existing one or one created within the
+     * scope. The reference is dropped when there is no more pin within {@link #CACHE_TIMEOUT_MS}.
+     */
+    public class Pin implements AutoCloseable {
+        private final CloseGuard mGuard = new CloseGuard();
+        private boolean mClosed = false;
+
+        public Pin() {
+            synchronized (mLock) {
+                mPinCount++;
+            }
+            mGuard.open("close");
+        }
+
+        @Override
+        public void close() {
+            try {
+                mGuard.close();
+                if (!mClosed) {
+                    mClosed = true;
+                    synchronized (mLock) {
+                        mPinCount--;
+                        Utils.check(mPinCount >= 0);
+                        delayedDropIfNoPinLocked();
+                    }
+                }
+            } finally {
+                // This prevents the GC from running the finalizer during the execution of `close`.
+                Reference.reachabilityFence(this);
+            }
+        }
+
+        @SuppressWarnings("Finalize") // Follows the recommended pattern for CloseGuard.
+        protected void finalize() throws Throwable {
+            try {
+                mGuard.warnIfOpen();
+                close();
+            } finally {
+                super.finalize();
+            }
+        }
+    }
+
+    private class CacheDeathRecipient implements DeathRecipient {
+        @Override
+        public void binderDied() {
+            // Legacy.
+        }
+
+        @Override
+        public void binderDied(@NonNull IBinder who) {
+            synchronized (mLock) {
+                if (mArtd != null && mArtd.asBinder() == who) {
+                    mArtd = null;
+                }
+            }
+        }
+    }
+
+    /** Injector pattern for testing purpose. */
+    @VisibleForTesting
+    public static class Injector {
+        Injector() {
+            // Call the getters for various dependencies, to ensure correct initialization order.
+            ArtModuleServiceInitializer.getArtModuleServiceManager();
+        }
+
+        @NonNull
+        public IArtd getArtd() {
+            IArtd artd =
+                    IArtd.Stub.asInterface(ArtModuleServiceInitializer.getArtModuleServiceManager()
+                                                   .getArtdServiceRegisterer()
+                                                   .waitForService());
+            if (artd == null) {
+                throw new IllegalStateException("Unable to connect to artd");
+            }
+            return artd;
+        }
+
+        @NonNull
+        public ScheduledExecutorService createScheduledExecutor() {
+            return Executors.newScheduledThreadPool(1 /* corePoolSize */);
+        }
+    }
+}
diff --git a/libartservice/service/java/com/android/server/art/BackgroundDexoptJob.java b/libartservice/service/java/com/android/server/art/BackgroundDexoptJob.java
index 46e3a9f7..289c7cd 100644
--- a/libartservice/service/java/com/android/server/art/BackgroundDexoptJob.java
+++ b/libartservice/service/java/com/android/server/art/BackgroundDexoptJob.java
@@ -41,6 +41,7 @@
 import com.android.internal.annotations.VisibleForTesting;
 import com.android.server.LocalManagerRegistry;
 import com.android.server.art.model.ArtFlags;
+import com.android.server.art.model.ArtServiceJobInterface;
 import com.android.server.art.model.Config;
 import com.android.server.art.model.DexoptResult;
 import com.android.server.art.model.OperationProgress;
@@ -59,7 +60,7 @@
 
 /** @hide */
 @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-public class BackgroundDexoptJob {
+public class BackgroundDexoptJob implements ArtServiceJobInterface {
     private static final String TAG = ArtManagerLocal.TAG;
 
     /**
@@ -68,7 +69,7 @@
      */
     private static final String JOB_PKG_NAME = Utils.PLATFORM_PACKAGE_NAME;
     /** An arbitrary number. Must be unique among all jobs owned by the system uid. */
-    private static final int JOB_ID = 27873780;
+    public static final int JOB_ID = 27873780;
 
     @VisibleForTesting public static final long JOB_INTERVAL_MS = TimeUnit.DAYS.toMillis(1);
 
@@ -89,6 +90,7 @@
     }
 
     /** Handles {@link BackgroundDexoptJobService#onStartJob(JobParameters)}. */
+    @Override
     public boolean onStartJob(
             @NonNull BackgroundDexoptJobService jobService, @NonNull JobParameters params) {
         start().thenAcceptAsync(result -> {
@@ -100,9 +102,9 @@
             }
 
             // This is a periodic job, where the interval is specified in the `JobInfo`. "true"
-            // means to execute again during a future idle maintenance window in the same
-            // interval, while "false" means not to execute again during a future idle maintenance
-            // window in the same interval but to execute again in the next interval.
+            // means to execute again in the same interval with the default retry policy, while
+            // "false" means not to execute again in the same interval but to execute again in the
+            // next interval.
             // This call will be ignored if `onStopJob` is called.
             boolean wantsReschedule =
                     result instanceof CompletedResult && ((CompletedResult) result).isCancelled();
@@ -113,19 +115,19 @@
     }
 
     /** Handles {@link BackgroundDexoptJobService#onStopJob(JobParameters)}. */
+    @Override
     public boolean onStopJob(@NonNull JobParameters params) {
         synchronized (this) {
             mLastStopReason = Optional.of(params.getStopReason());
         }
         cancel();
-        // "true" means to execute again during a future idle maintenance window in the same
-        // interval.
+        // "true" means to execute again in the same interval with the default retry policy.
         return true;
     }
 
     /** Handles {@link ArtManagerLocal#scheduleBackgroundDexoptJob()}. */
     public @ScheduleStatus int schedule() {
-        if (this != BackgroundDexoptJobService.getJob()) {
+        if (this != BackgroundDexoptJobService.getJob(JOB_ID)) {
             throw new IllegalStateException("This job cannot be scheduled");
         }
 
@@ -165,7 +167,7 @@
 
     /** Handles {@link ArtManagerLocal#unscheduleBackgroundDexoptJob()}. */
     public void unschedule() {
-        if (this != BackgroundDexoptJobService.getJob()) {
+        if (this != BackgroundDexoptJobService.getJob(JOB_ID)) {
             throw new IllegalStateException("This job cannot be unscheduled");
         }
 
diff --git a/libartservice/service/java/com/android/server/art/BackgroundDexoptJobService.java b/libartservice/service/java/com/android/server/art/BackgroundDexoptJobService.java
index 41425ee..8bcc4b9 100644
--- a/libartservice/service/java/com/android/server/art/BackgroundDexoptJobService.java
+++ b/libartservice/service/java/com/android/server/art/BackgroundDexoptJobService.java
@@ -24,6 +24,7 @@
 import androidx.annotation.RequiresApi;
 
 import com.android.server.LocalManagerRegistry;
+import com.android.server.art.model.ArtServiceJobInterface;
 
 /**
  * Entry point for the callback from the job scheduler. This class is instantiated by the system
@@ -35,16 +36,21 @@
 public class BackgroundDexoptJobService extends JobService {
     @Override
     public boolean onStartJob(@NonNull JobParameters params) {
-        return getJob().onStartJob(this, params);
+        return getJob(params.getJobId()).onStartJob(this, params);
     }
 
     @Override
     public boolean onStopJob(@NonNull JobParameters params) {
-        return getJob().onStopJob(params);
+        return getJob(params.getJobId()).onStopJob(params);
     }
 
     @NonNull
-    static BackgroundDexoptJob getJob() {
-        return LocalManagerRegistry.getManager(ArtManagerLocal.class).getBackgroundDexoptJob();
+    static ArtServiceJobInterface getJob(int jobId) {
+        if (jobId == BackgroundDexoptJob.JOB_ID) {
+            return LocalManagerRegistry.getManager(ArtManagerLocal.class).getBackgroundDexoptJob();
+        } else if (jobId == PreRebootDexoptJob.JOB_ID) {
+            return LocalManagerRegistry.getManager(ArtManagerLocal.class).getPreRebootDexoptJob();
+        }
+        throw new IllegalArgumentException("Unknown job ID " + jobId);
     }
 }
diff --git a/libartservice/service/java/com/android/server/art/Debouncer.java b/libartservice/service/java/com/android/server/art/Debouncer.java
index 61aea81..2aa7d0a 100644
--- a/libartservice/service/java/com/android/server/art/Debouncer.java
+++ b/libartservice/service/java/com/android/server/art/Debouncer.java
@@ -19,6 +19,8 @@
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 
+import com.android.internal.annotations.GuardedBy;
+
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.TimeUnit;
@@ -32,7 +34,8 @@
 public class Debouncer {
     @NonNull private Supplier<ScheduledExecutorService> mScheduledExecutorFactory;
     private final long mIntervalMs;
-    @Nullable private ScheduledFuture<?> mCurrentTask = null;
+    @GuardedBy("this") @Nullable private ScheduledFuture<?> mCurrentTask = null;
+    @GuardedBy("this") @Nullable private ScheduledExecutorService mExecutor = null;
 
     public Debouncer(
             long intervalMs, @NonNull Supplier<ScheduledExecutorService> scheduledExecutorFactory) {
@@ -40,6 +43,23 @@
         mIntervalMs = intervalMs;
     }
 
+    private void runTask(@NonNull Runnable command, @NonNull ScheduledExecutorService executor) {
+        synchronized (this) {
+            // In rare cases, at this point, another task may have been scheduled on the same
+            // executor, and `mExecutor` will be null or a new executor when that task is run, but
+            // that's okay. Either that task won't pass the check below or it will be cancelled.
+            // For simplicity, every task only shuts down its own executor.
+            // We only need to guarantee the following:
+            // - No new task is scheduled on an executor after the executor is shut down.
+            // - Every executor is eventually shut down.
+            if (mExecutor == executor) {
+                mExecutor.shutdown();
+                mExecutor = null;
+            }
+        }
+        command.run();
+    }
+
     /**
      * Runs the given command after the interval has passed. If another command comes in during
      * this interval, the previous one will never run.
@@ -48,8 +68,11 @@
         if (mCurrentTask != null) {
             mCurrentTask.cancel(false /* mayInterruptIfRunning */);
         }
-        ScheduledExecutorService executor = mScheduledExecutorFactory.get();
-        mCurrentTask = executor.schedule(command, mIntervalMs, TimeUnit.MILLISECONDS);
-        executor.shutdown();
+        if (mExecutor == null) {
+            mExecutor = mScheduledExecutorFactory.get();
+        }
+        ScheduledExecutorService executor = mExecutor;
+        mCurrentTask = mExecutor.schedule(
+                () -> runTask(command, executor), mIntervalMs, TimeUnit.MILLISECONDS);
     }
 }
diff --git a/libartservice/service/java/com/android/server/art/DexUseManagerLocal.java b/libartservice/service/java/com/android/server/art/DexUseManagerLocal.java
index c73f71b..d1209d9 100644
--- a/libartservice/service/java/com/android/server/art/DexUseManagerLocal.java
+++ b/libartservice/service/java/com/android/server/art/DexUseManagerLocal.java
@@ -230,23 +230,30 @@
      * method doesn't take dex file visibility into account, so it can only be used for debugging
      * purpose, such as dumpsys.
      *
-     * @see #getFilteredDetailedSecondaryDexInfo(String)
+     * @see #getCheckedSecondaryDexInfo(String)
      * @hide
      */
     public @NonNull List<? extends SecondaryDexInfo> getSecondaryDexInfo(
             @NonNull String packageName) {
-        return getSecondaryDexInfoImpl(packageName, false /* checkDexFile */);
+        return getSecondaryDexInfoImpl(
+                packageName, false /* checkDexFile */, false /* excludeObsoleteDexesAndLoaders */);
     }
 
     /**
      * Same as above, but requires disk IO, and returns the detailed information, including dex file
-     * visibility, filtered by dex file existence and visibility.
+     * visibility.
+     *
+     * @param excludeObsoleteDexesAndLoaders If true, excludes secondary dex files and loaders based
+     *         on file visibility. More specifically, excludes loaders that can no longer load a
+     *         secondary dex file due to a file visibility change, and excludes secondary dex files
+     *         that are not found or only have obsolete loaders
      *
      * @hide
      */
-    public @NonNull List<DetailedSecondaryDexInfo> getFilteredDetailedSecondaryDexInfo(
-            @NonNull String packageName) {
-        return getSecondaryDexInfoImpl(packageName, true /* checkDexFile */);
+    public @NonNull List<CheckedSecondaryDexInfo> getCheckedSecondaryDexInfo(
+            @NonNull String packageName, boolean excludeObsoleteDexesAndLoaders) {
+        return getSecondaryDexInfoImpl(
+                packageName, true /* checkDexFile */, excludeObsoleteDexesAndLoaders);
     }
 
     /**
@@ -282,20 +289,22 @@
     }
 
     /**
-     * @param checkDexFile if true, check the existence and visibility of the dex files, and filter
-     *         the results accordingly. Note that the value of the {@link
-     *         DetailedSecondaryDexInfo#isDexFilePublic()} field is undefined if this argument is
-     *         false.
+     * @param checkDexFile if true, check the existence and visibility of the dex files. Note that
+     *         the value of the {@link CheckedSecondaryDexInfo#fileVisibility()} field is undefined
+     *         if this argument is false
+     * @param excludeObsoleteDexesAndLoaders see {@link #getCheckedSecondaryDexInfo}. Only takes
+     *         effect if {@code checkDexFile} is true
      */
-    private @NonNull List<DetailedSecondaryDexInfo> getSecondaryDexInfoImpl(
-            @NonNull String packageName, boolean checkDexFile) {
+    private @NonNull List<CheckedSecondaryDexInfo> getSecondaryDexInfoImpl(
+            @NonNull String packageName, boolean checkDexFile,
+            boolean excludeObsoleteDexesAndLoaders) {
         synchronized (mLock) {
             PackageDexUse packageDexUse =
                     mDexUse.mPackageDexUseByOwningPackageName.get(packageName);
             if (packageDexUse == null) {
                 return List.of();
             }
-            var results = new ArrayList<DetailedSecondaryDexInfo>();
+            var results = new ArrayList<CheckedSecondaryDexInfo>();
             for (var entry : packageDexUse.mSecondaryDexUseByDexFile.entrySet()) {
                 String dexPath = entry.getKey();
                 SecondaryDexUse secondaryDexUse = entry.getValue();
@@ -303,12 +312,13 @@
                 @FileVisibility
                 int visibility = checkDexFile ? getDexFileVisibility(dexPath)
                                               : FileVisibility.OTHER_READABLE;
-                if (visibility == FileVisibility.NOT_FOUND) {
+                if (visibility == FileVisibility.NOT_FOUND && excludeObsoleteDexesAndLoaders) {
                     continue;
                 }
 
                 Map<DexLoader, SecondaryDexUseRecord> filteredRecordByLoader;
-                if (visibility == FileVisibility.OTHER_READABLE) {
+                if (visibility == FileVisibility.OTHER_READABLE
+                        || !excludeObsoleteDexesAndLoaders) {
                     filteredRecordByLoader = secondaryDexUse.mRecordByLoader;
                 } else {
                     // Only keep the entry that belongs to the same app.
@@ -347,10 +357,9 @@
                                 .map(record -> Utils.assertNonEmpty(record.mAbiName))
                                 .collect(Collectors.toSet());
                 Set<DexLoader> loaders = Set.copyOf(filteredRecordByLoader.keySet());
-                results.add(DetailedSecondaryDexInfo.create(dexPath,
+                results.add(CheckedSecondaryDexInfo.create(dexPath,
                         Objects.requireNonNull(secondaryDexUse.mUserHandle), clc, distinctAbiNames,
-                        loaders, isUsedByOtherApps(loaders, packageName),
-                        visibility == FileVisibility.OTHER_READABLE));
+                        loaders, isUsedByOtherApps(loaders, packageName), visibility));
             }
             return Collections.unmodifiableList(results);
         }
@@ -857,22 +866,19 @@
      */
     @Immutable
     @AutoValue
-    public abstract static class DetailedSecondaryDexInfo
+    public abstract static class CheckedSecondaryDexInfo
             extends SecondaryDexInfo implements DetailedDexInfo {
-        static DetailedSecondaryDexInfo create(@NonNull String dexPath,
+        static CheckedSecondaryDexInfo create(@NonNull String dexPath,
                 @NonNull UserHandle userHandle, @NonNull String displayClassLoaderContext,
                 @NonNull Set<String> abiNames, @NonNull Set<DexLoader> loaders,
-                boolean isUsedByOtherApps, boolean isDexFilePublic) {
-            return new AutoValue_DexUseManagerLocal_DetailedSecondaryDexInfo(dexPath, userHandle,
+                boolean isUsedByOtherApps, @FileVisibility int fileVisibility) {
+            return new AutoValue_DexUseManagerLocal_CheckedSecondaryDexInfo(dexPath, userHandle,
                     displayClassLoaderContext, Collections.unmodifiableSet(abiNames),
-                    Collections.unmodifiableSet(loaders), isUsedByOtherApps, isDexFilePublic);
+                    Collections.unmodifiableSet(loaders), isUsedByOtherApps, fileVisibility);
         }
 
-        /**
-         * Returns true if the filesystem permission of the dex file has the "read" bit for "others"
-         * (S_IROTH).
-         */
-        public abstract boolean isDexFilePublic();
+        /** Indicates the visibility of the dex file. */
+        public abstract @FileVisibility int fileVisibility();
     }
 
     private static class DexUse {
@@ -1159,7 +1165,7 @@
 
         @NonNull
         public IArtd getArtd() {
-            return Utils.getArtd();
+            return ArtdRefCache.getInstance().getArtd();
         }
 
         public long getCurrentTimeMillis() {
@@ -1173,7 +1179,7 @@
 
         @NonNull
         public ScheduledExecutorService createScheduledExecutor() {
-            return Executors.newSingleThreadScheduledExecutor();
+            return Executors.newScheduledThreadPool(1 /* corePoolSize */);
         }
 
         @NonNull
diff --git a/libartservice/service/java/com/android/server/art/DexoptHelper.java b/libartservice/service/java/com/android/server/art/DexoptHelper.java
index c04a981..8f40291 100644
--- a/libartservice/service/java/com/android/server/art/DexoptHelper.java
+++ b/libartservice/service/java/com/android/server/art/DexoptHelper.java
@@ -28,7 +28,6 @@
 import android.os.Binder;
 import android.os.Build;
 import android.os.CancellationSignal;
-import android.os.PowerManager;
 import android.os.RemoteException;
 import android.os.WorkSource;
 
@@ -72,12 +71,6 @@
 public class DexoptHelper {
     private static final String TAG = ArtManagerLocal.TAG;
 
-    /**
-     * Timeout of the wake lock. This is required by AndroidLint, but we set it to a very large
-     * value so that it should normally never triggered.
-     */
-    private static final long WAKE_LOCK_TIMEOUT_MS = TimeUnit.DAYS.toMillis(1);
-
     @NonNull private final Injector mInjector;
 
     public DexoptHelper(@NonNull Context context, @NonNull Config config) {
@@ -127,17 +120,10 @@
             @NonNull DexoptParams params, @NonNull CancellationSignal cancellationSignal,
             @NonNull Executor dexoptExecutor, @Nullable Executor progressCallbackExecutor,
             @Nullable Consumer<OperationProgress> progressCallback) {
-        int callingUid = Binder.getCallingUid();
+        // TODO(jiakaiz): Find out whether this is still needed.
         long identityToken = Binder.clearCallingIdentity();
-        PowerManager.WakeLock wakeLock = null;
 
         try {
-            // Acquire a wake lock.
-            PowerManager powerManager = mInjector.getPowerManager();
-            wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
-            wakeLock.setWorkSource(new WorkSource(callingUid));
-            wakeLock.acquire(WAKE_LOCK_TIMEOUT_MS);
-
             List<CompletableFuture<PackageDexoptResult>> futures = new ArrayList<>();
 
             // Child threads will set their own listeners on the cancellation signal, so we must
@@ -205,9 +191,6 @@
 
             return result;
         } finally {
-            if (wakeLock != null) {
-                wakeLock.release();
-            }
             Binder.restoreCallingIdentity(identityToken);
             // Make sure nothing leaks even if the caller holds `cancellationSignal` forever.
             cancellationSignal.setOnCancelListener(null);
@@ -340,21 +323,22 @@
             // Call the getters for the dependencies that aren't optional, to ensure correct
             // initialization order.
             getAppHibernationManager();
-            getPowerManager();
         }
 
         @NonNull
         PrimaryDexopter getPrimaryDexopter(@NonNull PackageState pkgState,
                 @NonNull AndroidPackage pkg, @NonNull DexoptParams params,
                 @NonNull CancellationSignal cancellationSignal) {
-            return new PrimaryDexopter(mContext, pkgState, pkg, params, cancellationSignal);
+            return new PrimaryDexopter(
+                    mContext, mConfig, pkgState, pkg, params, cancellationSignal);
         }
 
         @NonNull
         SecondaryDexopter getSecondaryDexopter(@NonNull PackageState pkgState,
                 @NonNull AndroidPackage pkg, @NonNull DexoptParams params,
                 @NonNull CancellationSignal cancellationSignal) {
-            return new SecondaryDexopter(mContext, pkgState, pkg, params, cancellationSignal);
+            return new SecondaryDexopter(
+                    mContext, mConfig, pkgState, pkg, params, cancellationSignal);
         }
 
         @NonNull
@@ -363,11 +347,6 @@
         }
 
         @NonNull
-        public PowerManager getPowerManager() {
-            return Objects.requireNonNull(mContext.getSystemService(PowerManager.class));
-        }
-
-        @NonNull
         public Config getConfig() {
             return mConfig;
         }
diff --git a/libartservice/service/java/com/android/server/art/Dexopter.java b/libartservice/service/java/com/android/server/art/Dexopter.java
index 2f15166..fc3528e 100644
--- a/libartservice/service/java/com/android/server/art/Dexopter.java
+++ b/libartservice/service/java/com/android/server/art/Dexopter.java
@@ -16,12 +16,13 @@
 
 package com.android.server.art;
 
-import static com.android.server.art.GetDexoptNeededResult.ArtifactsLocation;
+import static com.android.server.art.ArtManagerLocal.AdjustCompilerFilterCallback;
 import static com.android.server.art.OutputArtifacts.PermissionSettings;
 import static com.android.server.art.ProfilePath.TmpProfilePath;
 import static com.android.server.art.Utils.Abi;
 import static com.android.server.art.Utils.InitProfileResult;
 import static com.android.server.art.model.ArtFlags.DexoptFlags;
+import static com.android.server.art.model.Config.Callback;
 import static com.android.server.art.model.DexoptResult.DexContainerFileDexoptResult;
 
 import android.R;
@@ -46,6 +47,7 @@
 import com.android.internal.annotations.VisibleForTesting;
 import com.android.server.LocalManagerRegistry;
 import com.android.server.art.model.ArtFlags;
+import com.android.server.art.model.Config;
 import com.android.server.art.model.DetailedDexInfo;
 import com.android.server.art.model.DexoptParams;
 import com.android.server.art.model.DexoptResult;
@@ -98,6 +100,11 @@
      */
     @NonNull
     public final List<DexContainerFileDexoptResult> dexopt() throws RemoteException {
+        if (SystemProperties.getBoolean("dalvik.vm.disable-art-service-dexopt", false /* def */)) {
+            Log.i(TAG, "Dexopt skipped because it's disabled by system property");
+            return List.of();
+        }
+
         List<DexContainerFileDexoptResult> results = new ArrayList<>();
 
         boolean isInDalvikCache = isInDalvikCache();
@@ -296,6 +303,8 @@
         return results;
     }
 
+    // The javadoc on `AdjustCompilerFilterCallback.onAdjustCompilerFilter` may need updating when
+    // this method is changed.
     @NonNull
     private String adjustCompilerFilter(
             @NonNull String targetCompilerFilter, @NonNull DexInfoType dexInfo) {
@@ -308,6 +317,17 @@
             targetCompilerFilter = "speed-profile";
         }
 
+        Callback<AdjustCompilerFilterCallback, Void> callback =
+                mInjector.getConfig().getAdjustCompilerFilterCallback();
+        if (callback != null) {
+            // Local variables passed to the lambda must be final or effectively final.
+            final String originalCompilerFilter = targetCompilerFilter;
+            targetCompilerFilter = Utils.executeAndWait(callback.executor(), () -> {
+                return callback.get().onAdjustCompilerFilter(
+                        mPkgState.getPackageName(), originalCompilerFilter, mParams.getReason());
+            });
+        }
+
         // Code below should only downgrade the compiler filter. Don't upgrade the compiler filter
         // beyond this point!
 
@@ -380,12 +400,12 @@
         dexoptOptions.debuggable = mPkg.isDebuggable() || isAlwaysDebuggable();
         // Generating a meaningful app image needs a profile to determine what to include in the
         // image. Otherwise, the app image will be nearly empty.
-        dexoptOptions.generateAppImage =
-                isProfileGuidedFilter && isAppImageAllowed(dexInfo) && isAppImageEnabled();
+        dexoptOptions.generateAppImage = isProfileGuidedFilter && isAppImageEnabled();
         dexoptOptions.hiddenApiPolicyEnabled = isHiddenApiPolicyEnabled();
-        dexoptOptions.comments = String.format(
-                "app-version-name:%s,app-version-code:%d,art-version:%d", mPkg.getVersionName(),
-                mPkg.getLongVersionCode(), mInjector.getArtVersion());
+        dexoptOptions.comments =
+                String.format("app-name:%s,app-version-name:%s,app-version-code:%d,art-version:%d",
+                        mPkgState.getPackageName(), mPkg.getVersionName(),
+                        mPkg.getLongVersionCode(), mInjector.getArtVersion());
         return dexoptOptions;
     }
 
@@ -481,9 +501,25 @@
             dexoptOptions.compilationReason = dexoptOptions.compilationReason + "-dm";
         }
 
-        return mInjector.getArtd().dexopt(outputArtifacts, target.dexInfo().dexPath(), target.isa(),
-                target.dexInfo().classLoaderContext(), target.compilerFilter(), profile, inputVdex,
-                dmFile, priorityClass, dexoptOptions, artdCancellationSignal);
+        ArtdDexoptResult result = mInjector.getArtd().dexopt(outputArtifacts,
+                target.dexInfo().dexPath(), target.isa(), target.dexInfo().classLoaderContext(),
+                target.compilerFilter(), profile, inputVdex, dmFile, priorityClass, dexoptOptions,
+                artdCancellationSignal);
+
+        // Delete the existing runtime images after the dexopt is performed, even if they are still
+        // usable (e.g., the compiler filter is "verify"). This is to make sure the dexopt puts the
+        // dex file into a certain dexopt state, to make it easier for debugging and testing. It's
+        // also an optimization to release disk space as soon as possible. However, not doing the
+        // deletion here does not affect correctness or waste disk space: if the existing runtime
+        // images are still usable, technically, they can still be used to improve runtime
+        // performance; if they are no longer usable, they will be deleted by the file GC during the
+        // daily background dexopt job anyway.
+        if (!result.cancelled) {
+            mInjector.getArtd().deleteRuntimeArtifacts(AidlUtils.buildRuntimeArtifactsPath(
+                    mPkgState.getPackageName(), target.dexInfo().dexPath(), target.isa()));
+        }
+
+        return result;
     }
 
     @Nullable
@@ -604,9 +640,6 @@
     /** Returns the path to the reference profile of the given dex file. */
     @NonNull protected abstract ProfilePath buildRefProfilePath(@NonNull DexInfoType dexInfo);
 
-    /** Returns true if app image (--app-image-fd) is allowed. */
-    protected abstract boolean isAppImageAllowed(@NonNull DexInfoType dexInfo);
-
     /**
      * Returns the data structure that represents the temporary profile to use during processing.
      */
@@ -671,9 +704,11 @@
     @VisibleForTesting(visibility = VisibleForTesting.Visibility.PROTECTED)
     public static class Injector {
         @NonNull private final Context mContext;
+        @NonNull private final Config mConfig;
 
-        public Injector(@NonNull Context context) {
+        public Injector(@NonNull Context context, @NonNull Config config) {
             mContext = context;
+            mConfig = config;
 
             // Call the getters for various dependencies, to ensure correct initialization order.
             getUserManager();
@@ -703,7 +738,7 @@
 
         @NonNull
         public IArtd getArtd() {
-            return Utils.getArtd();
+            return ArtdRefCache.getInstance().getArtd();
         }
 
         @NonNull
@@ -730,5 +765,10 @@
             }
             return -1;
         }
+
+        @NonNull
+        public Config getConfig() {
+            return mConfig;
+        }
     }
 }
diff --git a/libartservice/service/java/com/android/server/art/DumpHelper.java b/libartservice/service/java/com/android/server/art/DumpHelper.java
index 70d7f8c..4d79c30 100644
--- a/libartservice/service/java/com/android/server/art/DumpHelper.java
+++ b/libartservice/service/java/com/android/server/art/DumpHelper.java
@@ -16,8 +16,8 @@
 
 package com.android.server.art;
 
+import static com.android.server.art.DexUseManagerLocal.CheckedSecondaryDexInfo;
 import static com.android.server.art.DexUseManagerLocal.DexLoader;
-import static com.android.server.art.DexUseManagerLocal.SecondaryDexInfo;
 import static com.android.server.art.model.DexoptStatus.DexContainerFileDexoptStatus;
 
 import android.annotation.NonNull;
@@ -100,11 +100,13 @@
                 mInjector.getArtManagerLocal()
                         .getDexoptStatus(snapshot, packageName)
                         .getDexContainerFileDexoptStatuses();
-        Map<String, SecondaryDexInfo> secondaryDexInfoByDexPath =
+        Map<String, CheckedSecondaryDexInfo> secondaryDexInfoByDexPath =
                 mInjector.getDexUseManager()
-                        .getSecondaryDexInfo(packageName)
+                        .getCheckedSecondaryDexInfo(
+                                packageName, false /* excludeObsoleteDexesAndLoaders */)
                         .stream()
-                        .collect(Collectors.toMap(SecondaryDexInfo::dexPath, Function.identity()));
+                        .collect(Collectors.toMap(
+                                CheckedSecondaryDexInfo::dexPath, Function.identity()));
 
         // Use LinkedHashMap to keep the order. They are ordered by their split indexes.
         var primaryStatusesByDexPath =
@@ -158,9 +160,9 @@
     private void dumpSecondaryDex(@NonNull IndentingPrintWriter ipw,
             @NonNull PackageManagerLocal.FilteredSnapshot snapshot,
             List<DexContainerFileDexoptStatus> fileStatuses, @NonNull String packageName,
-            @NonNull SecondaryDexInfo info) {
+            @NonNull CheckedSecondaryDexInfo info) {
         String dexPath = fileStatuses.get(0).getDexContainerFile();
-        @FileVisibility int visibility = getDexFileVisibility(dexPath);
+        @FileVisibility int visibility = info.fileVisibility();
         ipw.println(dexPath
                 + (visibility == FileVisibility.NOT_FOUND
                                 ? " (removed)"
@@ -237,15 +239,6 @@
         return result.toString();
     }
 
-    private @FileVisibility int getDexFileVisibility(@NonNull String dexPath) {
-        try {
-            return mInjector.getArtd().getDexFileVisibility(dexPath);
-        } catch (ServiceSpecificException | RemoteException e) {
-            Log.e(TAG, "Failed to get visibility of " + dexPath, e);
-            return FileVisibility.NOT_FOUND;
-        }
-    }
-
     /** Injector pattern for testing purpose. */
     @VisibleForTesting
     public static class Injector {
@@ -265,10 +258,5 @@
             return Objects.requireNonNull(
                     LocalManagerRegistry.getManager(DexUseManagerLocal.class));
         }
-
-        @NonNull
-        public IArtd getArtd() {
-            return Utils.getArtd();
-        }
     }
 }
diff --git a/libartservice/service/java/com/android/server/art/PreRebootDexoptJob.java b/libartservice/service/java/com/android/server/art/PreRebootDexoptJob.java
new file mode 100644
index 0000000..74bf913
--- /dev/null
+++ b/libartservice/service/java/com/android/server/art/PreRebootDexoptJob.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.art;
+
+import static com.android.server.art.model.ArtFlags.ScheduleStatus;
+
+import android.annotation.NonNull;
+import android.app.job.JobParameters;
+import android.content.Context;
+import android.os.Build;
+
+import androidx.annotation.RequiresApi;
+
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.art.model.ArtFlags;
+import com.android.server.art.model.ArtServiceJobInterface;
+
+/** @hide */
+@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+public class PreRebootDexoptJob implements ArtServiceJobInterface {
+    private static final String TAG = ArtManagerLocal.TAG;
+
+    /**
+     * "android" is the package name for a <service> declared in
+     * frameworks/base/core/res/AndroidManifest.xml
+     */
+    private static final String JOB_PKG_NAME = Utils.PLATFORM_PACKAGE_NAME;
+    /** An arbitrary number. Must be unique among all jobs owned by the system uid. */
+    public static final int JOB_ID = 27873781;
+
+    @NonNull private final Injector mInjector;
+
+    public PreRebootDexoptJob(@NonNull Context context) {
+        this(new Injector(context));
+    }
+
+    @VisibleForTesting
+    public PreRebootDexoptJob(@NonNull Injector injector) {
+        mInjector = injector;
+    }
+
+    @Override
+    public boolean onStartJob(
+            @NonNull BackgroundDexoptJobService jobService, @NonNull JobParameters params) {
+        // "true" means the job will continue running until `jobFinished` is called.
+        return false;
+    }
+
+    @Override
+    public boolean onStopJob(@NonNull JobParameters params) {
+        // "true" means to execute again in the same interval with the default retry policy.
+        return true;
+    }
+
+    public @ScheduleStatus int schedule() {
+        // TODO(b/311377497): Schedule the job.
+        return ArtFlags.SCHEDULE_SUCCESS;
+    }
+
+    /**
+     * Injector pattern for testing purpose.
+     *
+     * @hide
+     */
+    @VisibleForTesting
+    public static class Injector {
+        @NonNull private final Context mContext;
+
+        Injector(@NonNull Context context) {
+            mContext = context;
+        }
+    }
+}
diff --git a/libartservice/service/java/com/android/server/art/PrimaryDexUtils.java b/libartservice/service/java/com/android/server/art/PrimaryDexUtils.java
index 64f9bc5..4615886 100644
--- a/libartservice/service/java/com/android/server/art/PrimaryDexUtils.java
+++ b/libartservice/service/java/com/android/server/art/PrimaryDexUtils.java
@@ -41,6 +41,7 @@
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
+import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
 /** @hide */
@@ -50,15 +51,15 @@
     private static final String SHARED_LIBRARY_LOADER_TYPE = PathClassLoader.class.getName();
 
     /**
-     * Returns the basic information about all primary dex files belonging to the package. The
-     * return value is a list where the entry at index 0 is the information about the base APK, and
-     * the entry at index i is the information about the (i-1)-th split APK.
+     * Returns the basic information about all primary dex files belonging to the package, excluding
+     * files that have no code.
      */
     @NonNull
     public static List<PrimaryDexInfo> getDexInfo(@NonNull AndroidPackage pkg) {
         return getDexInfoImpl(pkg)
                 .stream()
                 .map(builder -> builder.build())
+                .filter(info -> info.hasCode())
                 .collect(Collectors.toList());
     }
 
@@ -72,6 +73,7 @@
         return getDetailedDexInfoImpl(pkgState, pkg)
                 .stream()
                 .map(builder -> builder.buildDetailed())
+                .filter(info -> info.hasCode())
                 .collect(Collectors.toList());
     }
 
@@ -79,18 +81,27 @@
     @NonNull
     public static PrimaryDexInfo getDexInfoBySplitName(
             @NonNull AndroidPackage pkg, @Nullable String splitName) {
-        if (splitName == null) {
-            return getDexInfo(pkg).get(0);
-        } else {
-            return getDexInfo(pkg)
-                    .stream()
-                    .filter(info -> splitName.equals(info.splitName()))
-                    .findFirst()
-                    .orElseThrow(() -> {
-                        return new IllegalArgumentException(
-                                String.format("Split '%s' not found", splitName));
-                    });
+        PrimaryDexInfo dexInfo =
+                findDexInfo(pkg, info -> Objects.equals(info.splitName(), splitName));
+        if (dexInfo == null) {
+            throw new IllegalArgumentException(String.format("Split '%s' not found", splitName));
         }
+        return dexInfo;
+    }
+
+    /**
+     * Returns the basic information about the first dex file matching {@code predicate}, or null if
+     * not found.
+     */
+    @Nullable
+    public static PrimaryDexInfo findDexInfo(
+            @NonNull AndroidPackage pkg, Predicate<PrimaryDexInfo> predicate) {
+        return getDexInfoImpl(pkg)
+                .stream()
+                .map(builder -> builder.build())
+                .filter(predicate)
+                .findFirst()
+                .orElse(null);
     }
 
     @NonNull
@@ -318,8 +329,15 @@
     @NonNull
     public static List<ProfilePath> getCurProfiles(@NonNull UserManager userManager,
             @NonNull PackageState pkgState, @NonNull PrimaryDexInfo dexInfo) {
+        return getCurProfiles(
+                userManager.getUserHandles(true /* excludeDying */), pkgState, dexInfo);
+    }
+
+    @NonNull
+    public static List<ProfilePath> getCurProfiles(@NonNull List<UserHandle> userHandles,
+            @NonNull PackageState pkgState, @NonNull PrimaryDexInfo dexInfo) {
         List<ProfilePath> profiles = new ArrayList<>();
-        for (UserHandle handle : userManager.getUserHandles(true /* excludeDying */)) {
+        for (UserHandle handle : userHandles) {
             int userId = handle.getIdentifier();
             PackageUserState userState = pkgState.getStateForUser(handle);
             if (userState.isInstalled()) {
diff --git a/libartservice/service/java/com/android/server/art/PrimaryDexopter.java b/libartservice/service/java/com/android/server/art/PrimaryDexopter.java
index a5481d9..38fca5f 100644
--- a/libartservice/service/java/com/android/server/art/PrimaryDexopter.java
+++ b/libartservice/service/java/com/android/server/art/PrimaryDexopter.java
@@ -38,6 +38,7 @@
 import com.android.internal.annotations.VisibleForTesting;
 import com.android.modules.utils.pm.PackageStateModulesUtils;
 import com.android.server.art.model.ArtFlags;
+import com.android.server.art.model.Config;
 import com.android.server.art.model.DexoptParams;
 import com.android.server.art.model.DexoptResult;
 import com.android.server.pm.PackageManagerLocal;
@@ -59,10 +60,10 @@
 
     private final int mSharedGid;
 
-    public PrimaryDexopter(@NonNull Context context, @NonNull PackageState pkgState,
-            @NonNull AndroidPackage pkg, @NonNull DexoptParams params,
-            @NonNull CancellationSignal cancellationSignal) {
-        this(new Injector(context), pkgState, pkg, params, cancellationSignal);
+    public PrimaryDexopter(@NonNull Context context, @NonNull Config config,
+            @NonNull PackageState pkgState, @NonNull AndroidPackage pkg,
+            @NonNull DexoptParams params, @NonNull CancellationSignal cancellationSignal) {
+        this(new Injector(context, config), pkgState, pkg, params, cancellationSignal);
     }
 
     @VisibleForTesting
@@ -152,16 +153,6 @@
     }
 
     @Override
-    protected boolean isAppImageAllowed(@NonNull DetailedPrimaryDexInfo dexInfo) {
-        // Only allow app image for the base APK because having multiple app images is not
-        // supported.
-        // Additionally, disable app images if the app requests for the splits to be loaded in
-        // isolation because app images are unsupported for multiple class loaders (b/72696798).
-        // TODO(jiakaiz): Investigate whether this is still the best choice today.
-        return dexInfo.splitName() == null && !PrimaryDexUtils.isIsolatedSplitLoading(mPkg);
-    }
-
-    @Override
     @NonNull
     protected OutputProfile buildOutputProfile(
             @NonNull DetailedPrimaryDexInfo dexInfo, boolean isPublic) {
diff --git a/libartservice/service/java/com/android/server/art/SecondaryDexopter.java b/libartservice/service/java/com/android/server/art/SecondaryDexopter.java
index c8c63db..2841ee2 100644
--- a/libartservice/service/java/com/android/server/art/SecondaryDexopter.java
+++ b/libartservice/service/java/com/android/server/art/SecondaryDexopter.java
@@ -16,7 +16,7 @@
 
 package com.android.server.art;
 
-import static com.android.server.art.DexUseManagerLocal.DetailedSecondaryDexInfo;
+import static com.android.server.art.DexUseManagerLocal.CheckedSecondaryDexInfo;
 import static com.android.server.art.OutputArtifacts.PermissionSettings;
 import static com.android.server.art.OutputArtifacts.PermissionSettings.SeContext;
 import static com.android.server.art.Utils.Abi;
@@ -30,6 +30,7 @@
 import androidx.annotation.RequiresApi;
 
 import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.art.model.Config;
 import com.android.server.art.model.DexoptParams;
 import com.android.server.pm.pkg.AndroidPackage;
 import com.android.server.pm.pkg.PackageState;
@@ -38,13 +39,13 @@
 
 /** @hide */
 @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
-public class SecondaryDexopter extends Dexopter<DetailedSecondaryDexInfo> {
+public class SecondaryDexopter extends Dexopter<CheckedSecondaryDexInfo> {
     private static final String TAG = ArtManagerLocal.TAG;
 
-    public SecondaryDexopter(@NonNull Context context, @NonNull PackageState pkgState,
-            @NonNull AndroidPackage pkg, @NonNull DexoptParams params,
-            @NonNull CancellationSignal cancellationSignal) {
-        this(new Injector(context), pkgState, pkg, params, cancellationSignal);
+    public SecondaryDexopter(@NonNull Context context, @NonNull Config config,
+            @NonNull PackageState pkgState, @NonNull AndroidPackage pkg,
+            @NonNull DexoptParams params, @NonNull CancellationSignal cancellationSignal) {
+        this(new Injector(context, config), pkgState, pkg, params, cancellationSignal);
     }
 
     @VisibleForTesting
@@ -63,29 +64,29 @@
 
     @Override
     @NonNull
-    protected List<DetailedSecondaryDexInfo> getDexInfoList() {
-        return mInjector.getDexUseManager().getFilteredDetailedSecondaryDexInfo(
-                mPkgState.getPackageName());
+    protected List<CheckedSecondaryDexInfo> getDexInfoList() {
+        return mInjector.getDexUseManager().getCheckedSecondaryDexInfo(
+                mPkgState.getPackageName(), true /* excludeObsoleteDexesAndLoaders */);
     }
 
     @Override
-    protected boolean isDexoptable(@NonNull DetailedSecondaryDexInfo dexInfo) {
+    protected boolean isDexoptable(@NonNull CheckedSecondaryDexInfo dexInfo) {
         return true;
     }
 
     @Override
-    protected boolean needsToBeShared(@NonNull DetailedSecondaryDexInfo dexInfo) {
+    protected boolean needsToBeShared(@NonNull CheckedSecondaryDexInfo dexInfo) {
         return dexInfo.isUsedByOtherApps();
     }
 
     @Override
-    protected boolean isDexFilePublic(@NonNull DetailedSecondaryDexInfo dexInfo) {
-        return dexInfo.isDexFilePublic();
+    protected boolean isDexFilePublic(@NonNull CheckedSecondaryDexInfo dexInfo) {
+        return dexInfo.fileVisibility() == FileVisibility.OTHER_READABLE;
     }
 
     @Override
     @NonNull
-    protected List<ProfilePath> getExternalProfiles(@NonNull DetailedSecondaryDexInfo dexInfo) {
+    protected List<ProfilePath> getExternalProfiles(@NonNull CheckedSecondaryDexInfo dexInfo) {
         // A secondary dex file doesn't have any external profile to use.
         return List.of();
     }
@@ -93,7 +94,7 @@
     @Override
     @NonNull
     protected PermissionSettings getPermissionSettings(
-            @NonNull DetailedSecondaryDexInfo dexInfo, boolean canBePublic) {
+            @NonNull CheckedSecondaryDexInfo dexInfo, boolean canBePublic) {
         int uid = getUid(dexInfo);
         // We need the "execute" bit for "others" even though `canBePublic` is false because the
         // directory can contain other artifacts that needs to be public.
@@ -109,44 +110,38 @@
 
     @Override
     @NonNull
-    protected List<Abi> getAllAbis(@NonNull DetailedSecondaryDexInfo dexInfo) {
+    protected List<Abi> getAllAbis(@NonNull CheckedSecondaryDexInfo dexInfo) {
         return Utils.getAllAbisForNames(dexInfo.abiNames(), mPkgState);
     }
 
     @Override
     @NonNull
-    protected ProfilePath buildRefProfilePath(@NonNull DetailedSecondaryDexInfo dexInfo) {
+    protected ProfilePath buildRefProfilePath(@NonNull CheckedSecondaryDexInfo dexInfo) {
         return AidlUtils.buildProfilePathForSecondaryRef(dexInfo.dexPath());
     }
 
     @Override
-    protected boolean isAppImageAllowed(@NonNull DetailedSecondaryDexInfo dexInfo) {
-        // The runtime can only load the app image of the base APK.
-        return false;
-    }
-
-    @Override
     @NonNull
     protected OutputProfile buildOutputProfile(
-            @NonNull DetailedSecondaryDexInfo dexInfo, boolean isPublic) {
+            @NonNull CheckedSecondaryDexInfo dexInfo, boolean isPublic) {
         int uid = getUid(dexInfo);
         return AidlUtils.buildOutputProfileForSecondary(dexInfo.dexPath(), uid, uid, isPublic);
     }
 
     @Override
     @NonNull
-    protected List<ProfilePath> getCurProfiles(@NonNull DetailedSecondaryDexInfo dexInfo) {
+    protected List<ProfilePath> getCurProfiles(@NonNull CheckedSecondaryDexInfo dexInfo) {
         // A secondary dex file can only be loaded by one user, so there is only one profile.
         return List.of(AidlUtils.buildProfilePathForSecondaryCur(dexInfo.dexPath()));
     }
 
     @Override
     @Nullable
-    protected DexMetadataPath buildDmPath(@NonNull DetailedSecondaryDexInfo dexInfo) {
+    protected DexMetadataPath buildDmPath(@NonNull CheckedSecondaryDexInfo dexInfo) {
         return null;
     }
 
-    private int getUid(@NonNull DetailedSecondaryDexInfo dexInfo) {
+    private int getUid(@NonNull CheckedSecondaryDexInfo dexInfo) {
         return dexInfo.userHandle().getUid(mPkgState.getAppId());
     }
 }
diff --git a/libartservice/service/java/com/android/server/art/Utils.java b/libartservice/service/java/com/android/server/art/Utils.java
index 252074a..1b9a201 100644
--- a/libartservice/service/java/com/android/server/art/Utils.java
+++ b/libartservice/service/java/com/android/server/art/Utils.java
@@ -24,8 +24,10 @@
 import android.app.role.RoleManager;
 import android.apphibernation.AppHibernationManager;
 import android.content.Context;
+import android.os.Binder;
 import android.os.Build;
 import android.os.DeadObjectException;
+import android.os.Process;
 import android.os.RemoteException;
 import android.os.ServiceSpecificException;
 import android.os.SystemClock;
@@ -65,6 +67,7 @@
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Executor;
 import java.util.concurrent.Future;
+import java.util.function.Supplier;
 import java.util.stream.Collectors;
 
 /** @hide */
@@ -220,17 +223,6 @@
         return DexFile.isValidCompilerFilter(compilerFilter);
     }
 
-    @NonNull
-    public static IArtd getArtd() {
-        IArtd artd = IArtd.Stub.asInterface(ArtModuleServiceInitializer.getArtModuleServiceManager()
-                                                    .getArtdServiceRegisterer()
-                                                    .waitForService());
-        if (artd == null) {
-            throw new IllegalStateException("Unable to connect to artd");
-        }
-        return artd;
-    }
-
     public static boolean implies(boolean cond1, boolean cond2) {
         return cond1 ? cond2 : true;
     }
@@ -274,6 +266,10 @@
         getFuture(CompletableFuture.runAsync(runnable, executor));
     }
 
+    public static <T> T executeAndWait(@NonNull Executor executor, @NonNull Supplier<T> supplier) {
+        return getFuture(CompletableFuture.supplyAsync(supplier, executor));
+    }
+
     public static <T> T getFuture(Future<T> future) {
         try {
             return future.get();
@@ -362,6 +358,10 @@
      * final location by calling {@link IArtd#commitTmpProfile} or clean it up by calling {@link
      * IArtd#deleteProfile}.
      *
+     * Note: "External profile" means profiles that are external to the device, as opposed to local
+     * profiles, which are collected on the device. An embedded profile (a profile embedded in the
+     * dex file) is also an external profile.
+     *
      * @param dexPath the path to the dex file that the profile is checked against
      * @param refProfile the path where an existing reference profile would be found, if present
      * @param externalProfiles a list of external profiles to initialize the reference profile from,
@@ -401,16 +401,25 @@
     public static InitProfileResult initReferenceProfile(@NonNull IArtd artd,
             @NonNull String dexPath, @NonNull List<ProfilePath> externalProfiles,
             @NonNull OutputProfile output) throws RemoteException {
-        List<String> externalProfileErrors = new ArrayList<>();
+        // Each element is a pair of a profile name (for logging) and the corresponding initializer.
+        // The order matters. Non-embedded profiles should take precedence.
+        List<Pair<String, ProfileInitializer>> profileInitializers = new ArrayList<>();
         for (ProfilePath profile : externalProfiles) {
+            // If the profile path is a PrebuiltProfilePath, and the APK is really a prebuilt
+            // one, rewriting the profile is unnecessary because the dex location is known at
+            // build time and is correctly set in the profile header. However, the APK can also
+            // be an installed one, in which case partners may place a profile file next to the
+            // APK at install time. Rewriting the profile in the latter case is necessary.
+            profileInitializers.add(Pair.create(AidlUtils.toString(profile),
+                    () -> artd.copyAndRewriteProfile(profile, output, dexPath)));
+        }
+        profileInitializers.add(Pair.create(
+                "embedded profile", () -> artd.copyAndRewriteEmbeddedProfile(output, dexPath)));
+
+        List<String> externalProfileErrors = new ArrayList<>();
+        for (var pair : profileInitializers) {
             try {
-                // If the profile path is a PrebuiltProfilePath, and the APK is really a prebuilt
-                // one, rewriting the profile is unnecessary because the dex location is known at
-                // build time and is correctly set in the profile header. However, the APK can also
-                // be an installed one, in which case partners may place a profile file next to the
-                // APK at install time. Rewriting the profile in the latter case is necessary.
-                CopyAndRewriteProfileResult result =
-                        artd.copyAndRewriteProfile(profile, output, dexPath);
+                CopyAndRewriteProfileResult result = pair.second.get();
                 if (result.status == CopyAndRewriteProfileResult.Status.SUCCESS) {
                     return InitProfileResult.create(ProfilePath.tmpProfilePath(output.profilePath),
                             true /* isOtherReadable */, externalProfileErrors);
@@ -419,7 +428,7 @@
                     externalProfileErrors.add(result.errorMsg);
                 }
             } catch (ServiceSpecificException e) {
-                Log.e(TAG, "Failed to initialize profile from " + AidlUtils.toString(profile), e);
+                Log.e(TAG, "Failed to initialize profile from " + pair.first, e);
             }
         }
 
@@ -443,6 +452,11 @@
         }
     }
 
+    public static boolean isSystemOrRootOrShell() {
+        int uid = Binder.getCallingUid();
+        return uid == Process.SYSTEM_UID || uid == Process.ROOT_UID || uid == Process.SHELL_UID;
+    }
+
     @AutoValue
     public abstract static class Abi {
         static @NonNull Abi create(
@@ -518,4 +532,9 @@
         /** Errors encountered when initializing from external profiles. */
         abstract @NonNull List<String> externalProfileErrors();
     }
+
+    @FunctionalInterface
+    private interface ProfileInitializer {
+        CopyAndRewriteProfileResult get() throws RemoteException;
+    }
 }
diff --git a/libartservice/service/java/com/android/server/art/model/ArtFlags.java b/libartservice/service/java/com/android/server/art/model/ArtFlags.java
index 6de14f0..d0b8b11 100644
--- a/libartservice/service/java/com/android/server/art/model/ArtFlags.java
+++ b/libartservice/service/java/com/android/server/art/model/ArtFlags.java
@@ -85,8 +85,6 @@
      * one, such as "speed-profile", it will be adjusted to "verify". This option is especially
      * useful when the compiler filter is not explicitly specified (i.e., is inferred from the
      * compilation reason).
-     *
-     * @hide
      */
     @SuppressLint("UnflaggedApi") // Flag support for mainline is not available.
     public static final int FLAG_IGNORE_PROFILE = 1 << 7;
diff --git a/libartservice/service/java/com/android/server/art/model/ArtManagedFileStats.java b/libartservice/service/java/com/android/server/art/model/ArtManagedFileStats.java
new file mode 100644
index 0000000..794ff79
--- /dev/null
+++ b/libartservice/service/java/com/android/server/art/model/ArtManagedFileStats.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.art.model;
+
+import android.annotation.IntDef;
+import android.annotation.NonNull;
+import android.annotation.SuppressLint;
+import android.annotation.SystemApi;
+
+import com.android.internal.annotations.Immutable;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ * Statistics of the files managed by ART of a package.
+ *
+ * @hide
+ */
+@SuppressLint("UnflaggedApi") // Flag support for mainline is not available.
+@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)
+@Immutable
+public class ArtManagedFileStats {
+    /**
+     * Dexopt artifacts and runtime artifacts, excluding stale ones.
+     *
+     * Dexopt artifacts become stale when one of their dependencies (such as bootclasspath jars and
+     * share libraries) has changed. Those stale files are excluded from the statistics. They may be
+     * cleaned up or replaced by ART Service at any time.
+     *
+     * For a preload app, this type includes dexopt artifacts on readonly partitions if they are
+     * up-to-date.
+     */
+    @SuppressLint("UnflaggedApi") // Flag support for mainline is not available.
+    public static final int TYPE_DEXOPT_ARTIFACT = 0;
+    /**
+     * Reference profiles.
+     *
+     * They are the ones used during the last profile-guided dexopt.
+     */
+    @SuppressLint("UnflaggedApi") // Flag support for mainline is not available.
+    public static final int TYPE_REF_PROFILE = 1;
+    /**
+     * Current profiles.
+     *
+     * They may be used during the next profile-guided dexopt.
+     */
+    @SuppressLint("UnflaggedApi") // Flag support for mainline is not available.
+    public static final int TYPE_CUR_PROFILE = 2;
+
+    /** @hide */
+    // clang-format off
+    @IntDef(prefix = {"TYPE_"}, value = {
+        TYPE_DEXOPT_ARTIFACT,
+        TYPE_REF_PROFILE,
+        TYPE_CUR_PROFILE,
+    })
+    // clang-format on
+    @Retention(RetentionPolicy.SOURCE)
+    public @interface FileTypes {}
+
+    private @NonNull Map<Integer, Long> mTotalSizesBytes;
+
+    /** @hide */
+    public ArtManagedFileStats(long artifactsSize, long refProfilesSize, long curProfilesSize) {
+        mTotalSizesBytes = Map.of(TYPE_DEXOPT_ARTIFACT, artifactsSize, TYPE_REF_PROFILE,
+                refProfilesSize, TYPE_CUR_PROFILE, curProfilesSize);
+    }
+    /**
+     * Returns the total size, in bytes, of the files of the given type.
+     *
+     * @throws IllegalArgumentException if {@code fileType} is not one of those defined in {@link
+     *         FileTypes}.
+     */
+    @SuppressLint("UnflaggedApi") // Flag support for mainline is not available.
+    public long getTotalSizeBytesByType(@FileTypes int fileType) {
+        Long value = mTotalSizesBytes.get(fileType);
+        if (value == null) {
+            throw new IllegalArgumentException("Unknown file type " + fileType);
+        }
+        return value;
+    }
+}
diff --git a/libartservice/service/java/com/android/server/art/model/ArtServiceJobInterface.java b/libartservice/service/java/com/android/server/art/model/ArtServiceJobInterface.java
new file mode 100644
index 0000000..569996c
--- /dev/null
+++ b/libartservice/service/java/com/android/server/art/model/ArtServiceJobInterface.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.art.model;
+
+import android.annotation.NonNull;
+import android.app.job.JobParameters;
+
+import com.android.server.art.BackgroundDexoptJobService;
+
+/** @hide */
+public interface ArtServiceJobInterface {
+    boolean onStartJob(
+            @NonNull BackgroundDexoptJobService jobService, @NonNull JobParameters params);
+
+    boolean onStopJob(@NonNull JobParameters params);
+}
diff --git a/libartservice/service/java/com/android/server/art/model/Config.java b/libartservice/service/java/com/android/server/art/model/Config.java
index 49bc930..2ea8230 100644
--- a/libartservice/service/java/com/android/server/art/model/Config.java
+++ b/libartservice/service/java/com/android/server/art/model/Config.java
@@ -16,6 +16,7 @@
 
 package com.android.server.art.model;
 
+import static com.android.server.art.ArtManagerLocal.AdjustCompilerFilterCallback;
 import static com.android.server.art.ArtManagerLocal.BatchDexoptStartCallback;
 import static com.android.server.art.ArtManagerLocal.DexoptDoneCallback;
 import static com.android.server.art.ArtManagerLocal.ScheduleBackgroundDexoptJobCallback;
@@ -62,6 +63,14 @@
     private LinkedHashMap<DexoptDoneCallback, Callback<DexoptDoneCallback, Boolean>>
             mDexoptDoneCallbacks = new LinkedHashMap<>();
 
+    /**
+     * @see ArtManagerLocal#setAdjustCompilerFilterCallback(Executor,
+     *         AdjustCompilerFilterCallback)
+     */
+    @GuardedBy("this")
+    @Nullable
+    private Callback<AdjustCompilerFilterCallback, Void> mAdjustCompilerFilterCallback = null;
+
     public synchronized void setBatchDexoptStartCallback(
             @NonNull Executor executor, @NonNull BatchDexoptStartCallback callback) {
         mBatchDexoptStartCallback = Callback.create(callback, executor);
@@ -109,6 +118,21 @@
         return new ArrayList<>(mDexoptDoneCallbacks.values());
     }
 
+    public synchronized void setAdjustCompilerFilterCallback(
+            @NonNull Executor executor, @NonNull AdjustCompilerFilterCallback callback) {
+        mAdjustCompilerFilterCallback = Callback.create(callback, executor);
+    }
+
+    public synchronized void clearAdjustCompilerFilterCallback() {
+        mAdjustCompilerFilterCallback = null;
+    }
+
+    @Nullable
+    public synchronized Callback<AdjustCompilerFilterCallback, Void>
+    getAdjustCompilerFilterCallback() {
+        return mAdjustCompilerFilterCallback;
+    }
+
     @AutoValue
     public static abstract class Callback<CallbackType, ExtraType> {
         public abstract @NonNull CallbackType get();
diff --git a/libartservice/service/java/com/android/server/art/model/DexoptResult.java b/libartservice/service/java/com/android/server/art/model/DexoptResult.java
index 64cdb1c..8dd75a1 100644
--- a/libartservice/service/java/com/android/server/art/model/DexoptResult.java
+++ b/libartservice/service/java/com/android/server/art/model/DexoptResult.java
@@ -63,11 +63,7 @@
     public @interface DexoptResultStatus {}
 
     // Possible values of {@link #DexoptResultExtendedStatusFlags}.
-    /**
-     * Dexopt is skipped because the remaining storage space is low.
-     *
-     * @hide
-     */
+    /** Dexopt is skipped because the remaining storage space is low. */
     public static final int EXTENDED_SKIPPED_STORAGE_LOW = 1 << 0;
     /**
      * Dexopt is skipped because the dex container file has no dex code while the manifest declares
@@ -76,8 +72,6 @@
      * Note that this flag doesn't apply to dex container files that are not declared to have code.
      * Instead, those files are not listed in {@link
      * PackageDexoptResult#getDexContainerFileDexoptResults} in the first place.
-     *
-     * @hide
      */
     public static final int EXTENDED_SKIPPED_NO_DEX_CODE = 1 << 1;
     /**
@@ -88,8 +82,6 @@
      *
      * This is not a critical error. Dexopt may still have succeeded after ignoring the bad external
      * profiles.
-     *
-     * @hide
      */
     public static final int EXTENDED_BAD_EXTERNAL_PROFILE = 1 << 2;
 
@@ -339,8 +331,6 @@
          * skipped. Note that they don't cover all possible reasons. At most one `EXTENDED_SKIPPED_`
          * flag will be set, even if the situation meets multiple `EXTENDED_SKIPPED_` flags. The
          * order of precedence of those flags is undefined.
-         *
-         * @hide
          */
         public abstract @DexoptResultExtendedStatusFlags int getExtendedStatusFlags();
 
@@ -356,8 +346,6 @@
          * that caused the errors.
          *
          * @see #EXTENDED_BAD_EXTERNAL_PROFILE.
-         *
-         * @hide
          */
         public abstract @NonNull List<String> getExternalProfileErrors();
 
diff --git a/libartservice/service/javatests/com/android/server/art/ArtManagerLocalTest.java b/libartservice/service/javatests/com/android/server/art/ArtManagerLocalTest.java
index 5e3e7b9..fc3c465 100644
--- a/libartservice/service/javatests/com/android/server/art/ArtManagerLocalTest.java
+++ b/libartservice/service/javatests/com/android/server/art/ArtManagerLocalTest.java
@@ -18,7 +18,7 @@
 
 import static android.os.ParcelFileDescriptor.AutoCloseInputStream;
 
-import static com.android.server.art.DexUseManagerLocal.DetailedSecondaryDexInfo;
+import static com.android.server.art.DexUseManagerLocal.CheckedSecondaryDexInfo;
 import static com.android.server.art.model.DexoptResult.DexContainerFileDexoptResult;
 import static com.android.server.art.model.DexoptResult.PackageDexoptResult;
 import static com.android.server.art.model.DexoptStatus.DexContainerFileDexoptStatus;
@@ -61,6 +61,7 @@
 
 import com.android.modules.utils.pm.PackageStateModulesUtils;
 import com.android.server.art.model.ArtFlags;
+import com.android.server.art.model.ArtManagedFileStats;
 import com.android.server.art.model.Config;
 import com.android.server.art.model.DeleteResult;
 import com.android.server.art.model.DexoptParams;
@@ -117,6 +118,7 @@
             SystemProperties.class, Constants.class, PackageStateModulesUtils.class);
 
     @Mock private ArtManagerLocal.Injector mInjector;
+    @Mock private ArtFileManager.Injector mArtFileManagerInjector;
     @Mock private PackageManagerLocal mPackageManagerLocal;
     @Mock private PackageManagerLocal.FilteredSnapshot mSnapshot;
     @Mock private IArtd mArtd;
@@ -125,9 +127,11 @@
     @Mock private UserManager mUserManager;
     @Mock private DexUseManagerLocal mDexUseManager;
     @Mock private StorageManager mStorageManager;
+    @Mock private ArtdRefCache.Pin mArtdPin;
     private PackageState mPkgState1;
     private AndroidPackage mPkg1;
-    private List<DetailedSecondaryDexInfo> mSecondaryDexInfo1;
+    private CheckedSecondaryDexInfo mPkg1SecondaryDexInfo1;
+    private CheckedSecondaryDexInfo mPkg1SecondaryDexInfoNotFound;
     private Config mConfig;
 
     // True if the artifacts should be in dalvik-cache.
@@ -149,6 +153,7 @@
         // that each test case examines.
         lenient().when(mInjector.getPackageManagerLocal()).thenReturn(mPackageManagerLocal);
         lenient().when(mInjector.getArtd()).thenReturn(mArtd);
+        lenient().when(mInjector.createArtdPin()).thenReturn(mArtdPin);
         lenient().when(mInjector.getDexoptHelper()).thenReturn(mDexoptHelper);
         lenient().when(mInjector.getConfig()).thenReturn(mConfig);
         lenient().when(mInjector.getAppHibernationManager()).thenReturn(mAppHibernationManager);
@@ -158,6 +163,14 @@
         lenient().when(mInjector.getDexUseManager()).thenReturn(mDexUseManager);
         lenient().when(mInjector.getCurrentTimeMillis()).thenReturn(CURRENT_TIME_MS);
         lenient().when(mInjector.getStorageManager()).thenReturn(mStorageManager);
+        lenient()
+                .when(mInjector.getArtFileManager())
+                .thenReturn(new ArtFileManager(mArtFileManagerInjector));
+
+        lenient().when(mArtFileManagerInjector.getArtd()).thenReturn(mArtd);
+        lenient().when(mArtFileManagerInjector.getUserManager()).thenReturn(mUserManager);
+        lenient().when(mArtFileManagerInjector.getDexUseManager()).thenReturn(mDexUseManager);
+        lenient().when(mArtFileManagerInjector.isSystemOrRootOrShell()).thenReturn(true);
 
         Path tempDir = Files.createTempDirectory("temp");
         tempDir.toFile().deleteOnExit();
@@ -201,15 +214,23 @@
 
         // All packages are by default recently used.
         lenient().when(mDexUseManager.getPackageLastUsedAtMs(any())).thenReturn(RECENT_TIME_MS);
-        mSecondaryDexInfo1 = createSecondaryDexInfo();
+        mPkg1SecondaryDexInfo1 = createSecondaryDexInfo("/data/user/0/foo/1.apk", UserHandle.of(0));
+        mPkg1SecondaryDexInfoNotFound =
+                createSecondaryDexInfo("/data/user/0/foo/not_found.apk", UserHandle.of(0));
         lenient()
-                .doReturn(mSecondaryDexInfo1)
+                .doReturn(List.of(mPkg1SecondaryDexInfo1, mPkg1SecondaryDexInfoNotFound))
                 .when(mDexUseManager)
                 .getSecondaryDexInfo(eq(PKG_NAME_1));
         lenient()
-                .doReturn(mSecondaryDexInfo1)
+                .doReturn(List.of(mPkg1SecondaryDexInfo1, mPkg1SecondaryDexInfoNotFound))
                 .when(mDexUseManager)
-                .getFilteredDetailedSecondaryDexInfo(eq(PKG_NAME_1));
+                .getCheckedSecondaryDexInfo(
+                        eq(PKG_NAME_1), eq(false) /* excludeObsoleteDexesAndLoaders */);
+        lenient()
+                .doReturn(List.of(mPkg1SecondaryDexInfo1))
+                .when(mDexUseManager)
+                .getCheckedSecondaryDexInfo(
+                        eq(PKG_NAME_1), eq(true) /* excludeObsoleteDexesAndLoaders */);
 
         simulateStorageNotLow();
 
@@ -233,60 +254,99 @@
         lenient()
                 .when(mArtd.copyAndRewriteProfile(any(), any(), any()))
                 .thenReturn(TestingUtils.createCopyAndRewriteProfileNoProfile());
+        lenient()
+                .when(mArtd.copyAndRewriteEmbeddedProfile(any(), any()))
+                .thenReturn(TestingUtils.createCopyAndRewriteProfileNoProfile());
 
         mArtManagerLocal = new ArtManagerLocal(mInjector);
     }
 
     @Test
-    public void testdeleteDexoptArtifacts() throws Exception {
-        when(mArtd.deleteArtifacts(any())).thenReturn(1l);
+    public void testDeleteDexoptArtifacts() throws Exception {
+        final long DEXOPT_ARTIFACTS_FREED = 1l;
+        final long RUNTIME_ARTIFACTS_FREED = 100l;
+
+        when(mArtd.deleteArtifacts(any())).thenReturn(DEXOPT_ARTIFACTS_FREED);
+        when(mArtd.deleteRuntimeArtifacts(any())).thenReturn(RUNTIME_ARTIFACTS_FREED);
 
         DeleteResult result = mArtManagerLocal.deleteDexoptArtifacts(mSnapshot, PKG_NAME_1);
-        assertThat(result.getFreedBytes()).isEqualTo(5);
+        assertThat(result.getFreedBytes())
+                .isEqualTo(6 * DEXOPT_ARTIFACTS_FREED + 4 * RUNTIME_ARTIFACTS_FREED);
 
-        verify(mArtd).deleteArtifacts(deepEq(
-                AidlUtils.buildArtifactsPath("/data/app/foo/base.apk", "arm64", mIsInDalvikCache)));
-        verify(mArtd).deleteArtifacts(deepEq(
-                AidlUtils.buildArtifactsPath("/data/app/foo/base.apk", "arm", mIsInDalvikCache)));
         verify(mArtd).deleteArtifacts(deepEq(AidlUtils.buildArtifactsPath(
-                "/data/app/foo/split_0.apk", "arm64", mIsInDalvikCache)));
+                "/somewhere/app/foo/base.apk", "arm64", mIsInDalvikCache)));
         verify(mArtd).deleteArtifacts(deepEq(AidlUtils.buildArtifactsPath(
-                "/data/app/foo/split_0.apk", "arm", mIsInDalvikCache)));
+                "/somewhere/app/foo/base.apk", "arm", mIsInDalvikCache)));
+        verify(mArtd).deleteArtifacts(deepEq(AidlUtils.buildArtifactsPath(
+                "/somewhere/app/foo/split_0.apk", "arm64", mIsInDalvikCache)));
+        verify(mArtd).deleteArtifacts(deepEq(AidlUtils.buildArtifactsPath(
+                "/somewhere/app/foo/split_0.apk", "arm", mIsInDalvikCache)));
         verify(mArtd).deleteArtifacts(deepEq(AidlUtils.buildArtifactsPath(
                 "/data/user/0/foo/1.apk", "arm64", false /* isInDalvikCache */)));
+        verify(mArtd).deleteArtifacts(deepEq(AidlUtils.buildArtifactsPath(
+                "/data/user/0/foo/not_found.apk", "arm64", false /* isInDalvikCache */)));
+
+        verify(mArtd).deleteRuntimeArtifacts(deepEq(AidlUtils.buildRuntimeArtifactsPath(
+                PKG_NAME_1, "/somewhere/app/foo/base.apk", "arm64")));
+        verify(mArtd).deleteRuntimeArtifacts(deepEq(AidlUtils.buildRuntimeArtifactsPath(
+                PKG_NAME_1, "/somewhere/app/foo/base.apk", "arm")));
+        verify(mArtd).deleteRuntimeArtifacts(deepEq(AidlUtils.buildRuntimeArtifactsPath(
+                PKG_NAME_1, "/somewhere/app/foo/split_0.apk", "arm64")));
+        verify(mArtd).deleteRuntimeArtifacts(deepEq(AidlUtils.buildRuntimeArtifactsPath(
+                PKG_NAME_1, "/somewhere/app/foo/split_0.apk", "arm")));
 
         // Verify that there are no more calls than the ones above.
-        verify(mArtd, times(5)).deleteArtifacts(any());
+        verify(mArtd, times(6)).deleteArtifacts(any());
+        verify(mArtd, times(4)).deleteRuntimeArtifacts(any());
     }
 
     @Test
-    public void testdeleteDexoptArtifactsTranslatedIsas() throws Exception {
+    public void testDeleteDexoptArtifactsTranslatedIsas() throws Exception {
+        final long DEXOPT_ARTIFACTS_FREED = 1l;
+        final long RUNTIME_ARTIFACTS_FREED = 100l;
+
         lenient().when(SystemProperties.get("ro.dalvik.vm.isa.arm64")).thenReturn("x86_64");
         lenient().when(SystemProperties.get("ro.dalvik.vm.isa.arm")).thenReturn("x86");
         lenient().when(Constants.getPreferredAbi()).thenReturn("x86_64");
         lenient().when(Constants.getNative64BitAbi()).thenReturn("x86_64");
         lenient().when(Constants.getNative32BitAbi()).thenReturn("x86");
-        when(mSecondaryDexInfo1.get(0).abiNames()).thenReturn(Set.of("x86_64"));
+        when(mPkg1SecondaryDexInfo1.abiNames()).thenReturn(Set.of("x86_64"));
+        when(mPkg1SecondaryDexInfoNotFound.abiNames()).thenReturn(Set.of("x86_64"));
 
-        when(mArtd.deleteArtifacts(any())).thenReturn(1l);
+        when(mArtd.deleteArtifacts(any())).thenReturn(DEXOPT_ARTIFACTS_FREED);
+        when(mArtd.deleteRuntimeArtifacts(any())).thenReturn(RUNTIME_ARTIFACTS_FREED);
 
         DeleteResult result = mArtManagerLocal.deleteDexoptArtifacts(mSnapshot, PKG_NAME_1);
-        assertThat(result.getFreedBytes()).isEqualTo(5);
+        assertThat(result.getFreedBytes())
+                .isEqualTo(6 * DEXOPT_ARTIFACTS_FREED + 4 * RUNTIME_ARTIFACTS_FREED);
 
         verify(mArtd).deleteArtifacts(deepEq(AidlUtils.buildArtifactsPath(
-                "/data/app/foo/base.apk", "x86_64", mIsInDalvikCache)));
-        verify(mArtd).deleteArtifacts(deepEq(
-                AidlUtils.buildArtifactsPath("/data/app/foo/base.apk", "x86", mIsInDalvikCache)));
+                "/somewhere/app/foo/base.apk", "x86_64", mIsInDalvikCache)));
         verify(mArtd).deleteArtifacts(deepEq(AidlUtils.buildArtifactsPath(
-                "/data/app/foo/split_0.apk", "x86_64", mIsInDalvikCache)));
+                "/somewhere/app/foo/base.apk", "x86", mIsInDalvikCache)));
         verify(mArtd).deleteArtifacts(deepEq(AidlUtils.buildArtifactsPath(
-                "/data/app/foo/split_0.apk", "x86", mIsInDalvikCache)));
+                "/somewhere/app/foo/split_0.apk", "x86_64", mIsInDalvikCache)));
+        verify(mArtd).deleteArtifacts(deepEq(AidlUtils.buildArtifactsPath(
+                "/somewhere/app/foo/split_0.apk", "x86", mIsInDalvikCache)));
+
+        verify(mArtd).deleteRuntimeArtifacts(deepEq(AidlUtils.buildRuntimeArtifactsPath(
+                PKG_NAME_1, "/somewhere/app/foo/base.apk", "x86_64")));
+        verify(mArtd).deleteRuntimeArtifacts(deepEq(AidlUtils.buildRuntimeArtifactsPath(
+                PKG_NAME_1, "/somewhere/app/foo/base.apk", "x86")));
+        verify(mArtd).deleteRuntimeArtifacts(deepEq(AidlUtils.buildRuntimeArtifactsPath(
+                PKG_NAME_1, "/somewhere/app/foo/split_0.apk", "x86_64")));
+        verify(mArtd).deleteRuntimeArtifacts(deepEq(AidlUtils.buildRuntimeArtifactsPath(
+                PKG_NAME_1, "/somewhere/app/foo/split_0.apk", "x86")));
+
         // We assume that the ISA got from `DexUseManagerLocal` is already the translated one.
         verify(mArtd).deleteArtifacts(deepEq(AidlUtils.buildArtifactsPath(
                 "/data/user/0/foo/1.apk", "x86_64", false /* isInDalvikCache */)));
+        verify(mArtd).deleteArtifacts(deepEq(AidlUtils.buildArtifactsPath(
+                "/data/user/0/foo/not_found.apk", "x86_64", false /* isInDalvikCache */)));
 
         // Verify that there are no more calls than the ones above.
-        verify(mArtd, times(5)).deleteArtifacts(any());
+        verify(mArtd, times(6)).deleteArtifacts(any());
+        verify(mArtd, times(4)).deleteRuntimeArtifacts(any());
     }
 
     @Test(expected = IllegalArgumentException.class)
@@ -305,46 +365,54 @@
 
     @Test
     public void testGetDexoptStatus() throws Exception {
-        doReturn(createGetDexoptStatusResult(
-                         "speed", "compilation-reason-0", "location-debug-string-0"))
+        doReturn(createGetDexoptStatusResult("speed", "compilation-reason-0",
+                         "location-debug-string-0", ArtifactsLocation.NEXT_TO_DEX))
                 .when(mArtd)
-                .getDexoptStatus("/data/app/foo/base.apk", "arm64", "PCL[]");
-        doReturn(createGetDexoptStatusResult(
-                         "speed-profile", "compilation-reason-1", "location-debug-string-1"))
+                .getDexoptStatus("/somewhere/app/foo/base.apk", "arm64", "PCL[]");
+        doReturn(createGetDexoptStatusResult("speed-profile", "compilation-reason-1",
+                         "location-debug-string-1", ArtifactsLocation.NEXT_TO_DEX))
                 .when(mArtd)
-                .getDexoptStatus("/data/app/foo/base.apk", "arm", "PCL[]");
-        doReturn(createGetDexoptStatusResult(
-                         "verify", "compilation-reason-2", "location-debug-string-2"))
+                .getDexoptStatus("/somewhere/app/foo/base.apk", "arm", "PCL[]");
+        doReturn(createGetDexoptStatusResult("verify", "compilation-reason-2",
+                         "location-debug-string-2", ArtifactsLocation.NEXT_TO_DEX))
                 .when(mArtd)
-                .getDexoptStatus("/data/app/foo/split_0.apk", "arm64", "PCL[base.apk]");
-        doReturn(createGetDexoptStatusResult(
-                         "extract", "compilation-reason-3", "location-debug-string-3"))
+                .getDexoptStatus("/somewhere/app/foo/split_0.apk", "arm64", "PCL[base.apk]");
+        doReturn(createGetDexoptStatusResult("extract", "compilation-reason-3",
+                         "location-debug-string-3", ArtifactsLocation.NEXT_TO_DEX))
                 .when(mArtd)
-                .getDexoptStatus("/data/app/foo/split_0.apk", "arm", "PCL[base.apk]");
-        doReturn(createGetDexoptStatusResult("run-from-apk", "unknown", "unknown"))
+                .getDexoptStatus("/somewhere/app/foo/split_0.apk", "arm", "PCL[base.apk]");
+        doReturn(createGetDexoptStatusResult(
+                         "run-from-apk", "unknown", "unknown", ArtifactsLocation.NEXT_TO_DEX))
                 .when(mArtd)
                 .getDexoptStatus("/data/user/0/foo/1.apk", "arm64", "CLC");
+        doReturn(createGetDexoptStatusResult(
+                         "unknown", "unknown", "error", ArtifactsLocation.NONE_OR_ERROR))
+                .when(mArtd)
+                .getDexoptStatus("/data/user/0/foo/not_found.apk", "arm64", "CLC");
 
         DexoptStatus result = mArtManagerLocal.getDexoptStatus(mSnapshot, PKG_NAME_1);
 
         assertThat(result.getDexContainerFileDexoptStatuses())
                 .comparingElementsUsing(TestingUtils.<DexContainerFileDexoptStatus>deepEquality())
                 .containsExactly(
-                        DexContainerFileDexoptStatus.create("/data/app/foo/base.apk",
+                        DexContainerFileDexoptStatus.create("/somewhere/app/foo/base.apk",
                                 true /* isPrimaryDex */, true /* isPrimaryAbi */, "arm64-v8a",
                                 "speed", "compilation-reason-0", "location-debug-string-0"),
-                        DexContainerFileDexoptStatus.create("/data/app/foo/base.apk",
+                        DexContainerFileDexoptStatus.create("/somewhere/app/foo/base.apk",
                                 true /* isPrimaryDex */, false /* isPrimaryAbi */, "armeabi-v7a",
                                 "speed-profile", "compilation-reason-1", "location-debug-string-1"),
-                        DexContainerFileDexoptStatus.create("/data/app/foo/split_0.apk",
+                        DexContainerFileDexoptStatus.create("/somewhere/app/foo/split_0.apk",
                                 true /* isPrimaryDex */, true /* isPrimaryAbi */, "arm64-v8a",
                                 "verify", "compilation-reason-2", "location-debug-string-2"),
-                        DexContainerFileDexoptStatus.create("/data/app/foo/split_0.apk",
+                        DexContainerFileDexoptStatus.create("/somewhere/app/foo/split_0.apk",
                                 true /* isPrimaryDex */, false /* isPrimaryAbi */, "armeabi-v7a",
                                 "extract", "compilation-reason-3", "location-debug-string-3"),
                         DexContainerFileDexoptStatus.create("/data/user/0/foo/1.apk",
                                 false /* isPrimaryDex */, true /* isPrimaryAbi */, "arm64-v8a",
-                                "run-from-apk", "unknown", "unknown"));
+                                "run-from-apk", "unknown", "unknown"),
+                        DexContainerFileDexoptStatus.create("/data/user/0/foo/not_found.apk",
+                                false /* isPrimaryDex */, true /* isPrimaryAbi */, "arm64-v8a",
+                                "unknown", "unknown", "error"));
     }
 
     @Test(expected = IllegalArgumentException.class)
@@ -369,7 +437,7 @@
         DexoptStatus result = mArtManagerLocal.getDexoptStatus(mSnapshot, PKG_NAME_1);
 
         List<DexContainerFileDexoptStatus> statuses = result.getDexContainerFileDexoptStatuses();
-        assertThat(statuses.size()).isEqualTo(5);
+        assertThat(statuses.size()).isEqualTo(6);
 
         for (DexContainerFileDexoptStatus status : statuses) {
             assertThat(status.getCompilerFilter()).isEqualTo("error");
@@ -393,6 +461,11 @@
                 deepEq(AidlUtils.buildProfilePathForSecondaryRef("/data/user/0/foo/1.apk")));
         verify(mArtd).deleteProfile(
                 deepEq(AidlUtils.buildProfilePathForSecondaryCur("/data/user/0/foo/1.apk")));
+
+        verify(mArtd).deleteProfile(deepEq(
+                AidlUtils.buildProfilePathForSecondaryRef("/data/user/0/foo/not_found.apk")));
+        verify(mArtd).deleteProfile(deepEq(
+                AidlUtils.buildProfilePathForSecondaryCur("/data/user/0/foo/not_found.apk")));
     }
 
     @Test(expected = IllegalArgumentException.class)
@@ -443,14 +516,23 @@
         verify(mArtd).deleteProfile(deepEq(
                 AidlUtils.buildProfilePathForPrimaryCur(1 /* userId */, PKG_NAME_1, "primary")));
 
-        verify(mArtd).deleteArtifacts(deepEq(
-                AidlUtils.buildArtifactsPath("/data/app/foo/base.apk", "arm64", mIsInDalvikCache)));
-        verify(mArtd).deleteArtifacts(deepEq(
-                AidlUtils.buildArtifactsPath("/data/app/foo/base.apk", "arm", mIsInDalvikCache)));
         verify(mArtd).deleteArtifacts(deepEq(AidlUtils.buildArtifactsPath(
-                "/data/app/foo/split_0.apk", "arm64", mIsInDalvikCache)));
+                "/somewhere/app/foo/base.apk", "arm64", mIsInDalvikCache)));
         verify(mArtd).deleteArtifacts(deepEq(AidlUtils.buildArtifactsPath(
-                "/data/app/foo/split_0.apk", "arm", mIsInDalvikCache)));
+                "/somewhere/app/foo/base.apk", "arm", mIsInDalvikCache)));
+        verify(mArtd).deleteArtifacts(deepEq(AidlUtils.buildArtifactsPath(
+                "/somewhere/app/foo/split_0.apk", "arm64", mIsInDalvikCache)));
+        verify(mArtd).deleteArtifacts(deepEq(AidlUtils.buildArtifactsPath(
+                "/somewhere/app/foo/split_0.apk", "arm", mIsInDalvikCache)));
+
+        verify(mArtd).deleteRuntimeArtifacts(deepEq(AidlUtils.buildRuntimeArtifactsPath(
+                PKG_NAME_1, "/somewhere/app/foo/base.apk", "arm64")));
+        verify(mArtd).deleteRuntimeArtifacts(deepEq(AidlUtils.buildRuntimeArtifactsPath(
+                PKG_NAME_1, "/somewhere/app/foo/base.apk", "arm")));
+        verify(mArtd).deleteRuntimeArtifacts(deepEq(AidlUtils.buildRuntimeArtifactsPath(
+                PKG_NAME_1, "/somewhere/app/foo/split_0.apk", "arm64")));
+        verify(mArtd).deleteRuntimeArtifacts(deepEq(AidlUtils.buildRuntimeArtifactsPath(
+                PKG_NAME_1, "/somewhere/app/foo/split_0.apk", "arm")));
 
         verify(mArtd).deleteProfile(
                 deepEq(AidlUtils.buildProfilePathForSecondaryRef("/data/user/0/foo/1.apk")));
@@ -744,7 +826,7 @@
         tempFile.deleteOnExit();
 
         ProfilePath refProfile = AidlUtils.buildProfilePathForPrimaryRef(PKG_NAME_1, "primary");
-        String dexPath = "/data/app/foo/base.apk";
+        String dexPath = "/somewhere/app/foo/base.apk";
 
         when(mArtd.isProfileUsable(deepEq(refProfile), eq(dexPath))).thenReturn(true);
 
@@ -788,7 +870,7 @@
         tempFileForSnapshot.deleteOnExit();
 
         ProfilePath refProfile = AidlUtils.buildProfilePathForPrimaryRef(PKG_NAME_1, "primary");
-        String dexPath = "/data/app/foo/base.apk";
+        String dexPath = "/somewhere/app/foo/base.apk";
 
         // Simulate that the reference profile doesn't exist.
         when(mArtd.isProfileUsable(deepEq(refProfile), eq(dexPath))).thenReturn(false);
@@ -829,7 +911,7 @@
     public void testSnapshotAppProfileSplit() throws Exception {
         ProfilePath refProfile =
                 AidlUtils.buildProfilePathForPrimaryRef(PKG_NAME_1, "split_0.split");
-        String dexPath = "/data/app/foo/split_0.apk";
+        String dexPath = "/somewhere/app/foo/split_0.apk";
 
         when(mArtd.isProfileUsable(deepEq(refProfile), eq(dexPath))).thenReturn(true);
 
@@ -981,26 +1063,33 @@
 
     @Test
     public void testCleanup() throws Exception {
-        // It should keep all artifacts.
-        doReturn(createGetDexoptStatusResult("speed-profile", "bg-dexopt", "location"))
+        // It should keep all artifacts, but not runtime images.
+        doReturn(createGetDexoptStatusResult(
+                         "speed-profile", "bg-dexopt", "location", ArtifactsLocation.NEXT_TO_DEX))
                 .when(mArtd)
-                .getDexoptStatus(eq("/data/app/foo/base.apk"), eq("arm64"), any());
-        doReturn(createGetDexoptStatusResult("verify", "cmdline", "location"))
+                .getDexoptStatus(eq("/somewhere/app/foo/base.apk"), eq("arm64"), any());
+        doReturn(createGetDexoptStatusResult(
+                         "verify", "cmdline", "location", ArtifactsLocation.NEXT_TO_DEX))
                 .when(mArtd)
                 .getDexoptStatus(eq("/data/user/0/foo/1.apk"), eq("arm64"), any());
 
-        // It should only keep VDEX files.
-        doReturn(createGetDexoptStatusResult("verify", "vdex", "location"))
+        // It should keep all artifacts and runtime images.
+        doReturn(createGetDexoptStatusResult(
+                         "verify", "bg-dexopt", "location", ArtifactsLocation.DALVIK_CACHE))
                 .when(mArtd)
-                .getDexoptStatus(eq("/data/app/foo/split_0.apk"), eq("arm64"), any());
-        doReturn(createGetDexoptStatusResult("verify", "vdex", "location"))
-                .when(mArtd)
-                .getDexoptStatus(eq("/data/app/foo/split_0.apk"), eq("arm"), any());
+                .getDexoptStatus(eq("/somewhere/app/foo/split_0.apk"), eq("arm64"), any());
 
-        // It should not keep any artifacts.
-        doReturn(createGetDexoptStatusResult("run-from-apk", "unknown", "unknown"))
+        // It should only keep VDEX files and runtime images.
+        doReturn(createGetDexoptStatusResult(
+                         "verify", "vdex", "location", ArtifactsLocation.NEXT_TO_DEX))
                 .when(mArtd)
-                .getDexoptStatus(eq("/data/app/foo/base.apk"), eq("arm"), any());
+                .getDexoptStatus(eq("/somewhere/app/foo/split_0.apk"), eq("arm"), any());
+
+        // It should not keep any artifacts or runtime images.
+        doReturn(createGetDexoptStatusResult(
+                         "run-from-apk", "unknown", "unknown", ArtifactsLocation.NONE_OR_ERROR))
+                .when(mArtd)
+                .getDexoptStatus(eq("/somewhere/app/foo/base.apk"), eq("arm"), any());
 
         when(mSnapshot.getPackageStates()).thenReturn(Map.of(PKG_NAME_1, mPkgState1));
         mArtManagerLocal.cleanup(mSnapshot);
@@ -1018,33 +1107,185 @@
                                 1 /* userId */, PKG_NAME_1, "split_0.split"),
                         AidlUtils.buildProfilePathForSecondaryRef("/data/user/0/foo/1.apk"),
                         AidlUtils.buildProfilePathForSecondaryCur("/data/user/0/foo/1.apk")),
-                inAnyOrderDeepEquals(AidlUtils.buildArtifactsPath(
-                                             "/data/app/foo/base.apk", "arm64", mIsInDalvikCache),
+                inAnyOrderDeepEquals(AidlUtils.buildArtifactsPath("/somewhere/app/foo/base.apk",
+                                             "arm64", false /* isInDalvikCache */),
                         AidlUtils.buildArtifactsPath(
-                                "/data/user/0/foo/1.apk", "arm64", false /* isInDalvikCache */)),
-                inAnyOrderDeepEquals(
-                        VdexPath.artifactsPath(AidlUtils.buildArtifactsPath(
-                                "/data/app/foo/split_0.apk", "arm64", mIsInDalvikCache)),
-                        VdexPath.artifactsPath(AidlUtils.buildArtifactsPath(
-                                "/data/app/foo/split_0.apk", "arm", mIsInDalvikCache))));
+                                "/data/user/0/foo/1.apk", "arm64", false /* isInDalvikCache */),
+                        AidlUtils.buildArtifactsPath("/somewhere/app/foo/split_0.apk", "arm64",
+                                true /* isInDalvikCache */)),
+                inAnyOrderDeepEquals(VdexPath.artifactsPath(AidlUtils.buildArtifactsPath(
+                        "/somewhere/app/foo/split_0.apk", "arm", false /* isInDalvikCache */))),
+                inAnyOrderDeepEquals(AidlUtils.buildRuntimeArtifactsPath(
+                                             PKG_NAME_1, "/somewhere/app/foo/split_0.apk", "arm64"),
+                        AidlUtils.buildRuntimeArtifactsPath(
+                                PKG_NAME_1, "/somewhere/app/foo/split_0.apk", "arm")));
+    }
+
+    @Test
+    public void testGetArtManagedFileStatsSystem() throws Exception {
+        testGetArtManagedFileStats(true /* isSystemOrRootOrShell */);
+    }
+
+    @Test
+    public void testGetArtManagedFileStatsNonSystem() throws Exception {
+        testGetArtManagedFileStats(false /* isSystemOrRootOrShell */);
+    }
+
+    private void testGetArtManagedFileStats(boolean isSystemOrRootOrShell) throws Exception {
+        if (!isSystemOrRootOrShell) {
+            lenient().when(mArtFileManagerInjector.isSystemOrRootOrShell()).thenReturn(false);
+            lenient()
+                    .when(mArtFileManagerInjector.getCallingUserHandle())
+                    .thenReturn(UserHandle.of(0));
+        }
+
+        // The same setup as `testCleanup`, but add a secondary dex file for a different user. Its
+        // artifacts and profiles should only be counted if the caller is system or root or shell.
+        CheckedSecondaryDexInfo pkg1SecondaryDexInfo2 =
+                createSecondaryDexInfo("/data/user/1/foo/1.apk", UserHandle.of(1));
+        lenient()
+                .doReturn(List.of(mPkg1SecondaryDexInfo1, pkg1SecondaryDexInfo2))
+                .when(mDexUseManager)
+                .getCheckedSecondaryDexInfo(
+                        eq(PKG_NAME_1), eq(true) /* excludeObsoleteDexesAndLoaders */);
+
+        // It should count all artifacts, but not runtime images.
+        doReturn(createGetDexoptStatusResult(
+                         "speed-profile", "bg-dexopt", "location", ArtifactsLocation.NEXT_TO_DEX))
+                .when(mArtd)
+                .getDexoptStatus(eq("/somewhere/app/foo/base.apk"), eq("arm64"), any());
+        doReturn(createGetDexoptStatusResult(
+                         "verify", "cmdline", "location", ArtifactsLocation.NEXT_TO_DEX))
+                .when(mArtd)
+                .getDexoptStatus(eq("/data/user/0/foo/1.apk"), eq("arm64"), any());
+
+        // It should count all artifacts and runtime images.
+        doReturn(createGetDexoptStatusResult(
+                         "verify", "bg-dexopt", "location", ArtifactsLocation.DALVIK_CACHE))
+                .when(mArtd)
+                .getDexoptStatus(eq("/somewhere/app/foo/split_0.apk"), eq("arm64"), any());
+
+        // It should only count VDEX files and runtime images.
+        doReturn(createGetDexoptStatusResult(
+                         "verify", "vdex", "location", ArtifactsLocation.NEXT_TO_DEX))
+                .when(mArtd)
+                .getDexoptStatus(eq("/somewhere/app/foo/split_0.apk"), eq("arm"), any());
+
+        // It should not count any artifacts or runtime images.
+        doReturn(createGetDexoptStatusResult(
+                         "run-from-apk", "unknown", "unknown", ArtifactsLocation.NONE_OR_ERROR))
+                .when(mArtd)
+                .getDexoptStatus(eq("/somewhere/app/foo/base.apk"), eq("arm"), any());
+
+        // These are counted as TYPE_DEXOPT_ARTIFACT.
+        doReturn(1l << 0).when(mArtd).getArtifactsSize(deepEq(AidlUtils.buildArtifactsPath(
+                "/somewhere/app/foo/base.apk", "arm64", false /* isInDalvikCache */)));
+        doReturn(1l << 1).when(mArtd).getArtifactsSize(deepEq(AidlUtils.buildArtifactsPath(
+                "/data/user/0/foo/1.apk", "arm64", false /* isInDalvikCache */)));
+        doReturn(1l << 2).when(mArtd).getArtifactsSize(deepEq(AidlUtils.buildArtifactsPath(
+                "/somewhere/app/foo/split_0.apk", "arm64", true /* isInDalvikCache */)));
+        doReturn(1l << 3).when(mArtd).getVdexFileSize(
+                deepEq(VdexPath.artifactsPath(AidlUtils.buildArtifactsPath(
+                        "/somewhere/app/foo/split_0.apk", "arm", false /* isInDalvikCache */))));
+        doReturn(1l << 4).when(mArtd).getRuntimeArtifactsSize(
+                deepEq(AidlUtils.buildRuntimeArtifactsPath(
+                        PKG_NAME_1, "/somewhere/app/foo/split_0.apk", "arm64")));
+        doReturn(1l << 5).when(mArtd).getRuntimeArtifactsSize(
+                deepEq(AidlUtils.buildRuntimeArtifactsPath(
+                        PKG_NAME_1, "/somewhere/app/foo/split_0.apk", "arm")));
+        long expectedDexoptArtifactSize =
+                (1l << 0) + (1l << 1) + (1l << 2) + (1l << 3) + (1l << 4) + (1l << 5);
+        int expectedGetArtifactsSizeCalls = 3;
+        int expectedGetVdexFileSizeCalls = 1;
+        int expectedGetRuntimeArtifactsSizeCalls = 2;
+
+        // These are counted as TYPE_REF_PROFILE.
+        doReturn(1l << 6).when(mArtd).getProfileSize(
+                deepEq(AidlUtils.buildProfilePathForPrimaryRef(PKG_NAME_1, "primary")));
+        doReturn(1l << 7).when(mArtd).getProfileSize(
+                deepEq(AidlUtils.buildProfilePathForPrimaryRef(PKG_NAME_1, "split_0.split")));
+        doReturn(1l << 8).when(mArtd).getProfileSize(
+                deepEq(AidlUtils.buildProfilePathForSecondaryRef("/data/user/0/foo/1.apk")));
+        long expectedRefProfileSize = (1l << 6) + (1l << 7) + (1l << 8);
+        int expectedGetProfileSizeCalls = 3;
+
+        // These are counted as TYPE_CUR_PROFILE.
+        doReturn(1l << 9).when(mArtd).getProfileSize(deepEq(
+                AidlUtils.buildProfilePathForPrimaryCur(0 /* userId */, PKG_NAME_1, "primary")));
+        doReturn(1l << 10).when(mArtd).getProfileSize(
+                deepEq(AidlUtils.buildProfilePathForPrimaryCur(
+                        0 /* userId */, PKG_NAME_1, "split_0.split")));
+        doReturn(1l << 11).when(mArtd).getProfileSize(
+                deepEq(AidlUtils.buildProfilePathForSecondaryCur("/data/user/0/foo/1.apk")));
+        long expectedCurProfileSize = (1l << 9) + (1l << 10) + (1l << 11);
+        expectedGetProfileSizeCalls += 3;
+
+        // These belong to a different user.
+        if (isSystemOrRootOrShell) {
+            doReturn(createGetDexoptStatusResult(
+                             "verify", "cmdline", "location", ArtifactsLocation.NEXT_TO_DEX))
+                    .when(mArtd)
+                    .getDexoptStatus(eq("/data/user/1/foo/1.apk"), eq("arm64"), any());
+
+            // These are counted as TYPE_DEXOPT_ARTIFACT.
+            // Dexopt artifacts of secondary dex files.
+            doReturn(1l << 12).when(mArtd).getArtifactsSize(deepEq(AidlUtils.buildArtifactsPath(
+                    "/data/user/1/foo/1.apk", "arm64", false /* isInDalvikCache */)));
+            expectedDexoptArtifactSize += (1l << 12);
+            expectedGetArtifactsSizeCalls += 1;
+
+            // These are counted as TYPE_REF_PROFILE.
+            // Reference profiles of secondary dex files.
+            doReturn(1l << 13).when(mArtd).getProfileSize(
+                    deepEq(AidlUtils.buildProfilePathForSecondaryRef("/data/user/1/foo/1.apk")));
+            expectedRefProfileSize += (1l << 13);
+            expectedGetProfileSizeCalls += 1;
+
+            // These are counted as TYPE_CUR_PROFILE.
+            // Current profiles of primary dex files.
+            doReturn(1l << 14).when(mArtd).getProfileSize(
+                    deepEq(AidlUtils.buildProfilePathForPrimaryCur(
+                            1 /* userId */, PKG_NAME_1, "primary")));
+            doReturn(1l << 15).when(mArtd).getProfileSize(
+                    deepEq(AidlUtils.buildProfilePathForPrimaryCur(
+                            1 /* userId */, PKG_NAME_1, "split_0.split")));
+            // Current profiles of secondary dex files.
+            doReturn(1l << 16).when(mArtd).getProfileSize(
+                    deepEq(AidlUtils.buildProfilePathForSecondaryCur("/data/user/1/foo/1.apk")));
+            expectedCurProfileSize += (1l << 14) + (1l << 15) + (1l << 16);
+            expectedGetProfileSizeCalls += 3;
+        }
+
+        ArtManagedFileStats stats = mArtManagerLocal.getArtManagedFileStats(mSnapshot, PKG_NAME_1);
+        assertThat(stats.getTotalSizeBytesByType(ArtManagedFileStats.TYPE_DEXOPT_ARTIFACT))
+                .isEqualTo(expectedDexoptArtifactSize);
+        assertThat(stats.getTotalSizeBytesByType(ArtManagedFileStats.TYPE_REF_PROFILE))
+                .isEqualTo(expectedRefProfileSize);
+        assertThat(stats.getTotalSizeBytesByType(ArtManagedFileStats.TYPE_CUR_PROFILE))
+                .isEqualTo(expectedCurProfileSize);
+
+        verify(mArtd, times(expectedGetArtifactsSizeCalls)).getArtifactsSize(any());
+        verify(mArtd, times(expectedGetVdexFileSizeCalls)).getVdexFileSize(any());
+        verify(mArtd, times(expectedGetRuntimeArtifactsSizeCalls)).getRuntimeArtifactsSize(any());
+        verify(mArtd, times(expectedGetProfileSizeCalls)).getProfileSize(any());
     }
 
     private AndroidPackage createPackage(boolean multiSplit) {
         AndroidPackage pkg = mock(AndroidPackage.class);
 
         var baseSplit = mock(AndroidPackageSplit.class);
-        lenient().when(baseSplit.getPath()).thenReturn("/data/app/foo/base.apk");
+        lenient().when(baseSplit.getPath()).thenReturn("/somewhere/app/foo/base.apk");
         lenient().when(baseSplit.isHasCode()).thenReturn(true);
 
         if (multiSplit) {
             // split_0 has code while split_1 doesn't.
             var split0 = mock(AndroidPackageSplit.class);
             lenient().when(split0.getName()).thenReturn("split_0");
-            lenient().when(split0.getPath()).thenReturn("/data/app/foo/split_0.apk");
+            lenient().when(split0.getPath()).thenReturn("/somewhere/app/foo/split_0.apk");
             lenient().when(split0.isHasCode()).thenReturn(true);
             var split1 = mock(AndroidPackageSplit.class);
             lenient().when(split1.getName()).thenReturn("split_1");
-            lenient().when(split1.getPath()).thenReturn("/data/app/foo/split_1.apk");
+            lenient().when(split1.getPath()).thenReturn("/somewhere/app/foo/split_1.apk");
             lenient().when(split1.isHasCode()).thenReturn(false);
 
             lenient().when(pkg.getSplits()).thenReturn(List.of(baseSplit, split0, split1));
@@ -1106,21 +1347,24 @@
         return List.of(pkgState1, pkgState2, pkgHibernatingState, nonDexoptablePkgState);
     }
 
-    private GetDexoptStatusResult createGetDexoptStatusResult(
-            String compilerFilter, String compilationReason, String locationDebugString) {
+    private GetDexoptStatusResult createGetDexoptStatusResult(String compilerFilter,
+            String compilationReason, String locationDebugString, @ArtifactsLocation int location) {
         var getDexoptStatusResult = new GetDexoptStatusResult();
         getDexoptStatusResult.compilerFilter = compilerFilter;
         getDexoptStatusResult.compilationReason = compilationReason;
         getDexoptStatusResult.locationDebugString = locationDebugString;
+        getDexoptStatusResult.artifactsLocation = location;
         return getDexoptStatusResult;
     }
 
-    private List<DetailedSecondaryDexInfo> createSecondaryDexInfo() throws Exception {
-        var dexInfo = mock(DetailedSecondaryDexInfo.class);
-        lenient().when(dexInfo.dexPath()).thenReturn("/data/user/0/foo/1.apk");
+    private CheckedSecondaryDexInfo createSecondaryDexInfo(String dexPath, UserHandle userHandle)
+            throws Exception {
+        var dexInfo = mock(CheckedSecondaryDexInfo.class);
+        lenient().when(dexInfo.dexPath()).thenReturn(dexPath);
         lenient().when(dexInfo.abiNames()).thenReturn(Set.of("arm64-v8a"));
         lenient().when(dexInfo.classLoaderContext()).thenReturn("CLC");
-        return List.of(dexInfo);
+        lenient().when(dexInfo.userHandle()).thenReturn(userHandle);
+        return dexInfo;
     }
 
     private void simulateStorageLow() throws Exception {
diff --git a/libartservice/service/javatests/com/android/server/art/ArtdRefCacheTest.java b/libartservice/service/javatests/com/android/server/art/ArtdRefCacheTest.java
new file mode 100644
index 0000000..9cfa66b
--- /dev/null
+++ b/libartservice/service/javatests/com/android/server/art/ArtdRefCacheTest.java
@@ -0,0 +1,215 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.art;
+
+import static android.os.IBinder.DeathRecipient;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.eq;
+import static org.mockito.Mockito.lenient;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
+import android.os.IBinder;
+
+import androidx.test.filters.SmallTest;
+
+import com.android.server.art.testing.MockClock;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+
+@SmallTest
+@RunWith(MockitoJUnitRunner.StrictStubs.class)
+public class ArtdRefCacheTest {
+    @Mock private ArtdRefCache.Injector mInjector;
+    @Mock private IArtd mArtd;
+    @Mock private IBinder mBinder;
+    private MockClock mMockClock;
+    private ArtdRefCache mArtdRefCache;
+
+    @Before
+    public void setUp() throws Exception {
+        mMockClock = new MockClock();
+
+        lenient()
+                .when(mInjector.createScheduledExecutor())
+                .thenAnswer(invocation -> mMockClock.createScheduledExecutor());
+        lenient().when(mInjector.getArtd()).thenReturn(mArtd);
+
+        lenient().when(mArtd.asBinder()).thenReturn(mBinder);
+
+        mArtdRefCache = new ArtdRefCache(mInjector);
+    }
+
+    @Test
+    public void testNoGetArtd() throws Exception {
+        try (var pin = mArtdRefCache.new Pin()) {
+        }
+
+        verify(mInjector, never()).getArtd();
+    }
+
+    @Test
+    public void testNoPin() throws Exception {
+        // Cache miss.
+        mArtdRefCache.getArtd();
+        mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS - 1);
+        mArtdRefCache.getArtd();
+        mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS - 1);
+        mArtdRefCache.getArtd();
+        mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS);
+        // Cache miss.
+        mArtdRefCache.getArtd();
+
+        verify(mInjector, times(2)).getArtd();
+    }
+
+    @Test
+    public void testSingleScope() throws Exception {
+        try (var pin = mArtdRefCache.new Pin()) {
+            mArtdRefCache.getArtd();
+            mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS);
+            mArtdRefCache.getArtd();
+            mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS);
+            mArtdRefCache.getArtd();
+        }
+
+        verify(mInjector, times(1)).getArtd();
+    }
+
+    @Test
+    public void testMultipleScopesCacheTimeout() throws Exception {
+        try (var pin = mArtdRefCache.new Pin()) {
+            mArtdRefCache.getArtd();
+        }
+        mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS);
+        try (var pin = mArtdRefCache.new Pin()) {
+            mArtdRefCache.getArtd();
+        }
+        mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS);
+        try (var pin = mArtdRefCache.new Pin()) {
+            mArtdRefCache.getArtd();
+        }
+
+        verify(mInjector, times(3)).getArtd();
+    }
+
+    @Test
+    public void testMultipleScopesCacheHit() throws Exception {
+        try (var pin = mArtdRefCache.new Pin()) {
+            mArtdRefCache.getArtd();
+        }
+        mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS - 1);
+        try (var pin = mArtdRefCache.new Pin()) {
+            mArtdRefCache.getArtd();
+        }
+        mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS - 1);
+        try (var pin = mArtdRefCache.new Pin()) {
+            mArtdRefCache.getArtd();
+        }
+
+        verify(mInjector, times(1)).getArtd();
+    }
+
+    @Test
+    public void testMultipleScopesNoUnpinAfterTimeout() throws Exception {
+        try (var pin = mArtdRefCache.new Pin()) {
+            mArtdRefCache.getArtd();
+        }
+        try (var pin = mArtdRefCache.new Pin()) {
+            mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS);
+            mArtdRefCache.getArtd();
+        }
+        try (var pin = mArtdRefCache.new Pin()) {
+            mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS);
+            mArtdRefCache.getArtd();
+        }
+
+        verify(mInjector, times(1)).getArtd();
+    }
+
+    @Test
+    public void testBinderDied() throws Exception {
+        var deathRecipient = ArgumentCaptor.forClass(DeathRecipient.class);
+        doAnswer(invocation -> null)
+                .when(mBinder)
+                .linkToDeath(deathRecipient.capture(), eq(0) /* flags */);
+
+        try (var pin = mArtdRefCache.new Pin()) {
+            mArtdRefCache.getArtd();
+            deathRecipient.getValue().binderDied(mBinder);
+            mArtdRefCache.getArtd();
+            deathRecipient.getValue().binderDied(mBinder);
+            mArtdRefCache.getArtd();
+
+            // It should not clear the cache when called with a different binder instance.
+            var differentBinder = mock(IBinder.class);
+            deathRecipient.getValue().binderDied(differentBinder);
+            mArtdRefCache.getArtd();
+        }
+
+        verify(mInjector, times(3)).getArtd();
+    }
+
+    @Test
+    public void testComplex() throws Exception {
+        var deathRecipient = ArgumentCaptor.forClass(DeathRecipient.class);
+        doAnswer(invocation -> null)
+                .when(mBinder)
+                .linkToDeath(deathRecipient.capture(), eq(0) /* flags */);
+
+        try (var pin = mArtdRefCache.new Pin()) {
+            // Cache miss.
+            mArtdRefCache.getArtd();
+            mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS);
+            try (var pin2 = mArtdRefCache.new Pin()) {
+                mArtdRefCache.getArtd();
+                try (var pin3 = mArtdRefCache.new Pin()) {
+                    mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS);
+                    mArtdRefCache.getArtd();
+                }
+                mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS);
+            }
+            mArtdRefCache.getArtd();
+            deathRecipient.getValue().binderDied(mBinder);
+            // Cache miss.
+            mArtdRefCache.getArtd();
+            mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS - 1);
+        }
+        mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS - 1);
+        try (var pin = mArtdRefCache.new Pin()) {
+            mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS - 1);
+            mArtdRefCache.getArtd();
+        }
+        mMockClock.advanceTime(ArtdRefCache.CACHE_TIMEOUT_MS);
+        try (var pin = mArtdRefCache.new Pin()) {
+            // Cache miss.
+            mArtdRefCache.getArtd();
+        }
+
+        verify(mInjector, times(3)).getArtd();
+    }
+}
diff --git a/libartservice/service/javatests/com/android/server/art/BackgroundDexoptJobTest.java b/libartservice/service/javatests/com/android/server/art/BackgroundDexoptJobTest.java
index c61461d..85ae079 100644
--- a/libartservice/service/javatests/com/android/server/art/BackgroundDexoptJobTest.java
+++ b/libartservice/service/javatests/com/android/server/art/BackgroundDexoptJobTest.java
@@ -16,6 +16,7 @@
 
 package com.android.server.art;
 
+import static com.android.server.art.BackgroundDexoptJob.JOB_ID;
 import static com.android.server.art.model.Config.Callback;
 import static com.android.server.art.model.DexoptResult.DexoptResultStatus;
 import static com.android.server.art.model.DexoptResult.PackageDexoptResult;
@@ -103,7 +104,7 @@
         lenient().when(mInjector.getJobScheduler()).thenReturn(mJobScheduler);
 
         mBackgroundDexoptJob = new BackgroundDexoptJob(mInjector);
-        lenient().when(BackgroundDexoptJobService.getJob()).thenReturn(mBackgroundDexoptJob);
+        lenient().when(BackgroundDexoptJobService.getJob(JOB_ID)).thenReturn(mBackgroundDexoptJob);
 
         lenient()
                 .doAnswer(invocation -> {
diff --git a/libartservice/service/javatests/com/android/server/art/DebouncerTest.java b/libartservice/service/javatests/com/android/server/art/DebouncerTest.java
index bf0bc70..cf6eee4 100644
--- a/libartservice/service/javatests/com/android/server/art/DebouncerTest.java
+++ b/libartservice/service/javatests/com/android/server/art/DebouncerTest.java
@@ -61,5 +61,13 @@
         mMockClock.advanceTime(1000);
 
         assertThat(list).containsExactly(2, 5).inOrder();
+
+        // Verify that we don't create too many executors, and all the executors we create are
+        // eventually shut down.
+        List<MockClock.ScheduledExecutor> executors = mMockClock.getCreatedExecutors();
+        assertThat(executors).hasSize(2);
+        for (MockClock.ScheduledExecutor executor : executors) {
+            assertThat(executor.isShutdown()).isTrue();
+        }
     }
 }
diff --git a/libartservice/service/javatests/com/android/server/art/DexUseManagerTest.java b/libartservice/service/javatests/com/android/server/art/DexUseManagerTest.java
index 83cb81c..5662090 100644
--- a/libartservice/service/javatests/com/android/server/art/DexUseManagerTest.java
+++ b/libartservice/service/javatests/com/android/server/art/DexUseManagerTest.java
@@ -16,7 +16,7 @@
 
 package com.android.server.art;
 
-import static com.android.server.art.DexUseManagerLocal.DetailedSecondaryDexInfo;
+import static com.android.server.art.DexUseManagerLocal.CheckedSecondaryDexInfo;
 import static com.android.server.art.DexUseManagerLocal.DexLoader;
 import static com.android.server.art.DexUseManagerLocal.SecondaryDexInfo;
 
@@ -77,8 +77,8 @@
 public class DexUseManagerTest {
     private static final String LOADING_PKG_NAME = "com.example.loadingpackage";
     private static final String OWNING_PKG_NAME = "com.example.owningpackage";
-    private static final String BASE_APK = "/data/app/" + OWNING_PKG_NAME + "/base.apk";
-    private static final String SPLIT_APK = "/data/app/" + OWNING_PKG_NAME + "/split_0.apk";
+    private static final String BASE_APK = "/somewhere/app/" + OWNING_PKG_NAME + "/base.apk";
+    private static final String SPLIT_APK = "/somewhere/app/" + OWNING_PKG_NAME + "/split_0.apk";
 
     @Rule
     public StaticMockitoRule mockitoRule = new StaticMockitoRule(
@@ -87,11 +87,11 @@
     private final UserHandle mUserHandle = Binder.getCallingUserHandle();
 
     /**
-     * The default value of `isDexFilePublic` returned by `getSecondaryDexInfo`. The value doesn't
+     * The default value of `fileVisibility` returned by `getSecondaryDexInfo`. The value doesn't
      * matter because it's undefined, but it's needed for deep equality check, to make the test
      * simpler.
      */
-    private final boolean mDefaultIsDexFilePublic = true;
+    private final @FileVisibility int mDefaultFileVisibility = FileVisibility.OTHER_READABLE;
 
     @Mock private PackageManagerLocal.FilteredSnapshot mSnapshot;
     @Mock private DexUseManagerLocal.Injector mInjector;
@@ -271,7 +271,7 @@
         mDexUseManager.notifyDexContainersLoaded(
                 mSnapshot, Utils.PLATFORM_PACKAGE_NAME, Map.of(BASE_APK, "CLC"));
         mDexUseManager.notifyDexContainersLoaded(mSnapshot, OWNING_PKG_NAME,
-                Map.of("/data/app/" + OWNING_PKG_NAME + "/non-existing.apk", "CLC"));
+                Map.of("/somewhere/app/" + OWNING_PKG_NAME + "/non-existing.apk", "CLC"));
 
         // Some of these should be deduped.
         mDexUseManager.notifyDexContainersLoaded(
@@ -325,10 +325,10 @@
         List<? extends SecondaryDexInfo> dexInfoList =
                 mDexUseManager.getSecondaryDexInfo(OWNING_PKG_NAME);
         assertThat(dexInfoList)
-                .containsExactly(DetailedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
+                .containsExactly(CheckedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
                         "CLC", Set.of("arm64-v8a"),
                         Set.of(DexLoader.create(OWNING_PKG_NAME, false /* isolatedProcess */)),
-                        false /* isUsedByOtherApps */, mDefaultIsDexFilePublic));
+                        false /* isUsedByOtherApps */, FileVisibility.OTHER_READABLE));
         assertThat(dexInfoList.get(0).classLoaderContext()).isEqualTo("CLC");
     }
 
@@ -341,10 +341,10 @@
         List<? extends SecondaryDexInfo> dexInfoList =
                 mDexUseManager.getSecondaryDexInfo(OWNING_PKG_NAME);
         assertThat(dexInfoList)
-                .containsExactly(DetailedSecondaryDexInfo.create(mDeDir + "/foo.apk", mUserHandle,
+                .containsExactly(CheckedSecondaryDexInfo.create(mDeDir + "/foo.apk", mUserHandle,
                         "CLC", Set.of("arm64-v8a"),
                         Set.of(DexLoader.create(OWNING_PKG_NAME, true /* isolatedProcess */)),
-                        true /* isUsedByOtherApps */, mDefaultIsDexFilePublic));
+                        true /* isUsedByOtherApps */, FileVisibility.OTHER_READABLE));
         assertThat(dexInfoList.get(0).classLoaderContext()).isEqualTo("CLC");
     }
 
@@ -356,10 +356,10 @@
         List<? extends SecondaryDexInfo> dexInfoList =
                 mDexUseManager.getSecondaryDexInfo(OWNING_PKG_NAME);
         assertThat(dexInfoList)
-                .containsExactly(DetailedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
+                .containsExactly(CheckedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
                         "CLC", Set.of("armeabi-v7a"),
                         Set.of(DexLoader.create(LOADING_PKG_NAME, false /* isolatedProcess */)),
-                        true /* isUsedByOtherApps */, mDefaultIsDexFilePublic));
+                        true /* isUsedByOtherApps */, FileVisibility.OTHER_READABLE));
         assertThat(dexInfoList.get(0).classLoaderContext()).isEqualTo("CLC");
     }
 
@@ -371,10 +371,10 @@
         List<? extends SecondaryDexInfo> dexInfoList =
                 mDexUseManager.getSecondaryDexInfo(OWNING_PKG_NAME);
         assertThat(dexInfoList)
-                .containsExactly(DetailedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
+                .containsExactly(CheckedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
                         SecondaryDexInfo.UNSUPPORTED_CLASS_LOADER_CONTEXT, Set.of("armeabi-v7a"),
                         Set.of(DexLoader.create(LOADING_PKG_NAME, false /* isolatedProcess */)),
-                        true /* isUsedByOtherApps */, mDefaultIsDexFilePublic));
+                        true /* isUsedByOtherApps */, FileVisibility.OTHER_READABLE));
         assertThat(dexInfoList.get(0).classLoaderContext()).isNull();
     }
 
@@ -388,12 +388,12 @@
         List<? extends SecondaryDexInfo> dexInfoList =
                 mDexUseManager.getSecondaryDexInfo(OWNING_PKG_NAME);
         assertThat(dexInfoList)
-                .containsExactly(DetailedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
+                .containsExactly(CheckedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
                         SecondaryDexInfo.VARYING_CLASS_LOADER_CONTEXTS,
                         Set.of("arm64-v8a", "armeabi-v7a"),
                         Set.of(DexLoader.create(OWNING_PKG_NAME, false /* isolatedProcess */),
                                 DexLoader.create(LOADING_PKG_NAME, false /* isolatedProcess */)),
-                        true /* isUsedByOtherApps */, mDefaultIsDexFilePublic));
+                        true /* isUsedByOtherApps */, FileVisibility.OTHER_READABLE));
         assertThat(dexInfoList.get(0).classLoaderContext()).isNull();
     }
 
@@ -489,7 +489,7 @@
         List<? extends SecondaryDexInfo> dexInfoList =
                 mDexUseManager.getSecondaryDexInfo(OWNING_PKG_NAME);
         assertThat(dexInfoList)
-                .containsExactly(DetailedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
+                .containsExactly(CheckedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
                                          "UpdatedCLC", Set.of("arm64-v8a", "armeabi-v7a"),
                                          Set.of(DexLoader.create(OWNING_PKG_NAME,
                                                         false /* isolatedProcess */),
@@ -497,21 +497,21 @@
                                                          true /* isolatedProcess */),
                                                  DexLoader.create(LOADING_PKG_NAME,
                                                          false /* isolatedProcess */)),
-                                         true /* isUsedByOtherApps */, mDefaultIsDexFilePublic),
-                        DetailedSecondaryDexInfo.create(mCeDir + "/bar.apk", mUserHandle,
+                                         true /* isUsedByOtherApps */, mDefaultFileVisibility),
+                        CheckedSecondaryDexInfo.create(mCeDir + "/bar.apk", mUserHandle,
                                 SecondaryDexInfo.VARYING_CLASS_LOADER_CONTEXTS,
                                 Set.of("arm64-v8a", "armeabi-v7a"),
                                 Set.of(DexLoader.create(
                                                OWNING_PKG_NAME, false /* isolatedProcess */),
                                         DexLoader.create(
                                                 LOADING_PKG_NAME, false /* isolatedProcess */)),
-                                true /* isUsedByOtherApps */, mDefaultIsDexFilePublic),
-                        DetailedSecondaryDexInfo.create(mCeDir + "/baz.apk", mUserHandle,
+                                true /* isUsedByOtherApps */, mDefaultFileVisibility),
+                        CheckedSecondaryDexInfo.create(mCeDir + "/baz.apk", mUserHandle,
                                 SecondaryDexInfo.UNSUPPORTED_CLASS_LOADER_CONTEXT,
                                 Set.of("arm64-v8a"),
                                 Set.of(DexLoader.create(
                                         OWNING_PKG_NAME, false /* isolatedProcess */)),
-                                false /* isUsedByOtherApps */, mDefaultIsDexFilePublic));
+                                false /* isUsedByOtherApps */, mDefaultFileVisibility));
 
         assertThat(mDexUseManager.getSecondaryDexContainerFileUseInfo(OWNING_PKG_NAME))
                 .containsExactly(DexContainerFileUseInfo.create(mCeDir + "/foo.apk", mUserHandle,
@@ -525,7 +525,7 @@
     }
 
     @Test
-    public void testFilteredDetailedSecondaryDexPublic() throws Exception {
+    public void testCheckedSecondaryDexPublic() throws Exception {
         when(mArtd.getDexFileVisibility(mCeDir + "/foo.apk"))
                 .thenReturn(FileVisibility.OTHER_READABLE);
 
@@ -534,16 +534,17 @@
         mDexUseManager.notifyDexContainersLoaded(
                 mSnapshot, LOADING_PKG_NAME, Map.of(mCeDir + "/foo.apk", "CLC"));
 
-        assertThat(mDexUseManager.getFilteredDetailedSecondaryDexInfo(OWNING_PKG_NAME))
-                .containsExactly(DetailedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
+        assertThat(mDexUseManager.getCheckedSecondaryDexInfo(
+                           OWNING_PKG_NAME, true /* excludeObsoleteDexesAndLoaders */))
+                .containsExactly(CheckedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
                         "CLC", Set.of("arm64-v8a", "armeabi-v7a"),
                         Set.of(DexLoader.create(OWNING_PKG_NAME, false /* isolatedProcess */),
                                 DexLoader.create(LOADING_PKG_NAME, false /* isolatedProcess */)),
-                        true /* isUsedByOtherApps */, true /* isDexFilePublic */));
+                        true /* isUsedByOtherApps */, FileVisibility.OTHER_READABLE));
     }
 
     @Test
-    public void testFilteredDetailedSecondaryDexPrivate() throws Exception {
+    public void testCheckedSecondaryDexPrivate() throws Exception {
         when(mArtd.getDexFileVisibility(mCeDir + "/foo.apk"))
                 .thenReturn(FileVisibility.NOT_OTHER_READABLE);
 
@@ -556,36 +557,57 @@
         mDexUseManager.notifyDexContainersLoaded(
                 mSnapshot, OWNING_PKG_NAME, Map.of(mCeDir + "/foo.apk", "CLC"));
 
-        assertThat(mDexUseManager.getFilteredDetailedSecondaryDexInfo(OWNING_PKG_NAME))
-                .containsExactly(DetailedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
+        assertThat(mDexUseManager.getCheckedSecondaryDexInfo(
+                           OWNING_PKG_NAME, true /* excludeObsoleteDexesAndLoaders */))
+                .containsExactly(CheckedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
                         "CLC", Set.of("arm64-v8a"),
                         Set.of(DexLoader.create(OWNING_PKG_NAME, false /* isolatedProcess */)),
-                        false /* isUsedByOtherApps */, false /* isDexFilePublic */));
+                        false /* isUsedByOtherApps */, FileVisibility.NOT_OTHER_READABLE));
+
+        assertThat(mDexUseManager.getCheckedSecondaryDexInfo(
+                           OWNING_PKG_NAME, false /* excludeObsoleteDexesAndLoaders */))
+                .containsExactly(CheckedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
+                        "CLC", Set.of("arm64-v8a", "armeabi-v7a"),
+                        Set.of(DexLoader.create(OWNING_PKG_NAME, false /* isolatedProcess */),
+                                DexLoader.create(LOADING_PKG_NAME, false /* isolatedProcess */),
+                                DexLoader.create(OWNING_PKG_NAME, true /* isolatedProcess */)),
+                        true /* isUsedByOtherApps */, FileVisibility.NOT_OTHER_READABLE));
     }
 
     @Test
-    public void testFilteredDetailedSecondaryDexFilteredDueToVisibility() throws Exception {
-        when(mArtd.getDexFileVisibility(mCeDir + "/foo.apk"))
-                .thenReturn(FileVisibility.NOT_OTHER_READABLE);
-
-        mDexUseManager.notifyDexContainersLoaded(
-                mSnapshot, LOADING_PKG_NAME, Map.of(mCeDir + "/foo.apk", "CLC"));
-
-        when(Process.isIsolatedUid(anyInt())).thenReturn(true);
-        mDexUseManager.notifyDexContainersLoaded(
-                mSnapshot, OWNING_PKG_NAME, Map.of(mCeDir + "/foo.apk", "CLC"));
-
-        assertThat(mDexUseManager.getFilteredDetailedSecondaryDexInfo(OWNING_PKG_NAME)).isEmpty();
-    }
-
-    @Test
-    public void testFilteredDetailedSecondaryDexFilteredDueToNotFound() throws Exception {
+    public void testCheckedSecondaryDexNotFound() throws Exception {
         when(mArtd.getDexFileVisibility(mCeDir + "/foo.apk")).thenReturn(FileVisibility.NOT_FOUND);
 
         mDexUseManager.notifyDexContainersLoaded(
                 mSnapshot, OWNING_PKG_NAME, Map.of(mCeDir + "/foo.apk", "CLC"));
 
-        assertThat(mDexUseManager.getFilteredDetailedSecondaryDexInfo(OWNING_PKG_NAME)).isEmpty();
+        assertThat(mDexUseManager.getCheckedSecondaryDexInfo(
+                           OWNING_PKG_NAME, true /* excludeObsoleteDexesAndLoaders */))
+                .isEmpty();
+
+        assertThat(mDexUseManager.getCheckedSecondaryDexInfo(
+                           OWNING_PKG_NAME, false /* excludeObsoleteDexesAndLoaders */))
+                .containsExactly(CheckedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
+                        "CLC", Set.of("arm64-v8a"),
+                        Set.of(DexLoader.create(OWNING_PKG_NAME, false /* isolatedProcess */)),
+                        false /* isUsedByOtherApps */, FileVisibility.NOT_FOUND));
+    }
+
+    @Test
+    public void testCheckedSecondaryDexFilteredDueToVisibility() throws Exception {
+        when(mArtd.getDexFileVisibility(mCeDir + "/foo.apk"))
+                .thenReturn(FileVisibility.NOT_OTHER_READABLE);
+
+        mDexUseManager.notifyDexContainersLoaded(
+                mSnapshot, LOADING_PKG_NAME, Map.of(mCeDir + "/foo.apk", "CLC"));
+
+        when(Process.isIsolatedUid(anyInt())).thenReturn(true);
+        mDexUseManager.notifyDexContainersLoaded(
+                mSnapshot, OWNING_PKG_NAME, Map.of(mCeDir + "/foo.apk", "CLC"));
+
+        assertThat(mDexUseManager.getCheckedSecondaryDexInfo(
+                           OWNING_PKG_NAME, true /* excludeObsoleteDexesAndLoaders */))
+                .isEmpty();
     }
 
     @Test
@@ -594,17 +616,19 @@
                 "com.example.deletedpackage", "arm64-v8a", true /* hasPackage */);
         addPackage("com.example.deletedpackage", pkgState);
         lenient()
-                .when(mArtd.getDexFileVisibility("/data/app/com.example.deletedpackage/base.apk"))
+                .when(mArtd.getDexFileVisibility(
+                        "/somewhere/app/com.example.deletedpackage/base.apk"))
                 .thenReturn(FileVisibility.OTHER_READABLE);
         lenient()
                 .when(mArtd.getDexFileVisibility(BASE_APK))
                 .thenReturn(FileVisibility.OTHER_READABLE);
         // Simulate that a package loads its own dex file and another package's dex file.
         mDexUseManager.notifyDexContainersLoaded(mSnapshot, "com.example.deletedpackage",
-                Map.of("/data/app/com.example.deletedpackage/base.apk", "CLC", BASE_APK, "CLC"));
+                Map.of("/somewhere/app/com.example.deletedpackage/base.apk", "CLC", BASE_APK,
+                        "CLC"));
         // Simulate that another package loads this package's dex file.
         mDexUseManager.notifyDexContainersLoaded(mSnapshot, LOADING_PKG_NAME,
-                Map.of("/data/app/com.example.deletedpackage/base.apk", "CLC"));
+                Map.of("/somewhere/app/com.example.deletedpackage/base.apk", "CLC"));
         // Simulate that the package is then deleted.
         removePackage("com.example.deletedpackage");
 
@@ -650,12 +674,14 @@
         // Simulate that all the files of a package are deleted. The whole container entry of the
         // package should be cleaned up, though the package still exists.
         lenient()
-                .when(mArtd.getDexFileVisibility("/data/app/" + LOADING_PKG_NAME + "/base.apk"))
+                .when(mArtd.getDexFileVisibility(
+                        "/somewhere/app/" + LOADING_PKG_NAME + "/base.apk"))
                 .thenReturn(FileVisibility.OTHER_READABLE);
         mDexUseManager.notifyDexContainersLoaded(mSnapshot, LOADING_PKG_NAME,
-                Map.of("/data/app/" + LOADING_PKG_NAME + "/base.apk", "CLC"));
+                Map.of("/somewhere/app/" + LOADING_PKG_NAME + "/base.apk", "CLC"));
         lenient()
-                .when(mArtd.getDexFileVisibility("/data/app/" + LOADING_PKG_NAME + "/base.apk"))
+                .when(mArtd.getDexFileVisibility(
+                        "/somewhere/app/" + LOADING_PKG_NAME + "/base.apk"))
                 .thenReturn(FileVisibility.NOT_FOUND);
 
         // Run cleanup.
@@ -742,10 +768,10 @@
                 mSnapshot, LOADING_PKG_NAME, Map.of(mCeDir + "/foo.apk", "CLC"));
 
         assertThat(mDexUseManager.getSecondaryDexInfo(OWNING_PKG_NAME))
-                .containsExactly(DetailedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
+                .containsExactly(CheckedSecondaryDexInfo.create(mCeDir + "/foo.apk", mUserHandle,
                         "CLC", Set.of("armeabi-v7a"),
                         Set.of(DexLoader.create(LOADING_PKG_NAME, false /* isolatedProcess */)),
-                        true /* isUsedByOtherApps */, mDefaultIsDexFilePublic));
+                        true /* isUsedByOtherApps */, mDefaultFileVisibility));
     }
 
     private AndroidPackage createPackage(String packageName) {
@@ -753,13 +779,17 @@
         lenient().when(pkg.getStorageUuid()).thenReturn(StorageManager.UUID_DEFAULT);
 
         var baseSplit = mock(AndroidPackageSplit.class);
-        lenient().when(baseSplit.getPath()).thenReturn("/data/app/" + packageName + "/base.apk");
+        lenient()
+                .when(baseSplit.getPath())
+                .thenReturn("/somewhere/app/" + packageName + "/base.apk");
         lenient().when(baseSplit.isHasCode()).thenReturn(true);
         lenient().when(baseSplit.getClassLoaderName()).thenReturn(PathClassLoader.class.getName());
 
         var split0 = mock(AndroidPackageSplit.class);
         lenient().when(split0.getName()).thenReturn("split_0");
-        lenient().when(split0.getPath()).thenReturn("/data/app/" + packageName + "/split_0.apk");
+        lenient()
+                .when(split0.getPath())
+                .thenReturn("/somewhere/app/" + packageName + "/split_0.apk");
         lenient().when(split0.isHasCode()).thenReturn(true);
 
         lenient().when(pkg.getSplits()).thenReturn(List.of(baseSplit, split0));
diff --git a/libartservice/service/javatests/com/android/server/art/DexoptHelperTest.java b/libartservice/service/javatests/com/android/server/art/DexoptHelperTest.java
index 97bdb4f..527203b 100644
--- a/libartservice/service/javatests/com/android/server/art/DexoptHelperTest.java
+++ b/libartservice/service/javatests/com/android/server/art/DexoptHelperTest.java
@@ -39,7 +39,6 @@
 
 import android.apphibernation.AppHibernationManager;
 import android.os.CancellationSignal;
-import android.os.PowerManager;
 
 import androidx.test.filters.SmallTest;
 import androidx.test.runner.AndroidJUnit4;
@@ -96,8 +95,6 @@
     @Mock private PrimaryDexopter mPrimaryDexopter;
     @Mock private SecondaryDexopter mSecondaryDexopter;
     @Mock private AppHibernationManager mAhm;
-    @Mock private PowerManager mPowerManager;
-    @Mock private PowerManager.WakeLock mWakeLock;
     @Mock private PackageManagerLocal.FilteredSnapshot mSnapshot;
     private PackageState mPkgStateFoo;
     private PackageState mPkgStateBar;
@@ -122,10 +119,6 @@
 
     @Before
     public void setUp() throws Exception {
-        lenient()
-                .when(mPowerManager.newWakeLock(eq(PowerManager.PARTIAL_WAKE_LOCK), any()))
-                .thenReturn(mWakeLock);
-
         lenient().when(mAhm.isHibernatingGlobally(any())).thenReturn(false);
         lenient().when(mAhm.isOatArtifactDeletionEnabled()).thenReturn(true);
 
@@ -135,9 +128,9 @@
 
         preparePackagesAndLibraries();
 
-        mPrimaryResults =
-                createResults("/data/app/foo/base.apk", DexoptResult.DEXOPT_PERFORMED /* status1 */,
-                        DexoptResult.DEXOPT_PERFORMED /* status2 */);
+        mPrimaryResults = createResults("/somewhere/app/foo/base.apk",
+                DexoptResult.DEXOPT_PERFORMED /* status1 */,
+                DexoptResult.DEXOPT_PERFORMED /* status2 */);
         mSecondaryResults = createResults("/data/user_de/0/foo/foo.apk",
                 DexoptResult.DEXOPT_PERFORMED /* status1 */,
                 DexoptResult.DEXOPT_PERFORMED /* status2 */);
@@ -161,7 +154,6 @@
                           .build();
 
         lenient().when(mInjector.getAppHibernationManager()).thenReturn(mAhm);
-        lenient().when(mInjector.getPowerManager()).thenReturn(mPowerManager);
         lenient().when(mInjector.getConfig()).thenReturn(mConfig);
 
         mDexoptHelper = new DexoptHelper(mInjector);
@@ -176,9 +168,9 @@
     public void testDexopt() throws Exception {
         // Only package libbaz fails.
         var failingPrimaryDexopter = mock(PrimaryDexopter.class);
-        List<DexContainerFileDexoptResult> partialFailureResults =
-                createResults("/data/app/foo/base.apk", DexoptResult.DEXOPT_PERFORMED /* status1 */,
-                        DexoptResult.DEXOPT_FAILED /* status2 */);
+        List<DexContainerFileDexoptResult> partialFailureResults = createResults(
+                "/somewhere/app/foo/base.apk", DexoptResult.DEXOPT_PERFORMED /* status1 */,
+                DexoptResult.DEXOPT_FAILED /* status2 */);
         lenient().when(failingPrimaryDexopter.dexopt()).thenReturn(partialFailureResults);
         when(mInjector.getPrimaryDexopter(same(mPkgStateLibbaz), any(), any(), any()))
                 .thenReturn(failingPrimaryDexopter);
@@ -205,13 +197,10 @@
         checkPackageResult(result, 5 /* index */, PKG_NAME_LIB4, DexoptResult.DEXOPT_PERFORMED,
                 List.of(mPrimaryResults, mSecondaryResults));
 
-        // The order matters. It should acquire the wake lock only once, at the beginning, and
-        // release the wake lock at the end. When running in a single thread, it should dexopt
-        // primary dex files and the secondary dex files together for each package, and it should
-        // dexopt requested packages, in the given order, and then dexopt dependencies.
-        InOrder inOrder = inOrder(mInjector, mWakeLock);
-        inOrder.verify(mWakeLock).setWorkSource(any());
-        inOrder.verify(mWakeLock).acquire(anyLong());
+        // The order matters. When running in a single thread, it should dexopt primary dex files
+        // and the secondary dex files together for each package, and it should dexopt requested
+        // packages, in the given order, and then dexopt dependencies.
+        InOrder inOrder = inOrder(mInjector);
         inOrder.verify(mInjector).getPrimaryDexopter(
                 same(mPkgStateFoo), same(mPkgFoo), same(mParams), any());
         inOrder.verify(mInjector).getSecondaryDexopter(
@@ -236,11 +225,8 @@
                 same(mPkgStateLib4), same(mPkgLib4), same(mParams), any());
         inOrder.verify(mInjector).getSecondaryDexopter(
                 same(mPkgStateLib4), same(mPkgLib4), same(mParams), any());
-        inOrder.verify(mWakeLock).release();
 
         verifyNoMoreDexopt(6 /* expectedPrimaryTimes */, 6 /* expectedSecondaryTimes */);
-
-        verifyNoMoreInteractions(mWakeLock);
     }
 
     @Test
@@ -519,19 +505,6 @@
                 List.of(mPrimaryResults, mSecondaryResults));
     }
 
-    @Test
-    public void testDexoptAlwaysReleasesWakeLock() throws Exception {
-        when(mPrimaryDexopter.dexopt()).thenThrow(IllegalStateException.class);
-
-        try {
-            mDexoptHelper.dexopt(
-                    mSnapshot, mRequestedPackages, mParams, mCancellationSignal, mExecutor);
-        } catch (Exception ignored) {
-        }
-
-        verify(mWakeLock).release();
-    }
-
     @Test(expected = IllegalArgumentException.class)
     public void testDexoptPackageNotFound() throws Exception {
         when(mSnapshot.getPackageState(any())).thenReturn(null);
@@ -645,18 +618,18 @@
                 result -> listOnlyIncludeUpdates.add(result));
 
         // Dexopt partially fails on package "foo".
-        List<DexContainerFileDexoptResult> partialFailureResults =
-                createResults("/data/app/foo/base.apk", DexoptResult.DEXOPT_PERFORMED /* status1 */,
-                        DexoptResult.DEXOPT_FAILED /* status2 */);
+        List<DexContainerFileDexoptResult> partialFailureResults = createResults(
+                "/somewhere/app/foo/base.apk", DexoptResult.DEXOPT_PERFORMED /* status1 */,
+                DexoptResult.DEXOPT_FAILED /* status2 */);
         var fooPrimaryDexopter = mock(PrimaryDexopter.class);
         when(mInjector.getPrimaryDexopter(same(mPkgStateFoo), any(), any(), any()))
                 .thenReturn(fooPrimaryDexopter);
         when(fooPrimaryDexopter.dexopt()).thenReturn(partialFailureResults);
 
         // Dexopt totally fails on package "bar".
-        List<DexContainerFileDexoptResult> totalFailureResults =
-                createResults("/data/app/bar/base.apk", DexoptResult.DEXOPT_FAILED /* status1 */,
-                        DexoptResult.DEXOPT_FAILED /* status2 */);
+        List<DexContainerFileDexoptResult> totalFailureResults = createResults(
+                "/somewhere/app/bar/base.apk", DexoptResult.DEXOPT_FAILED /* status1 */,
+                DexoptResult.DEXOPT_FAILED /* status2 */);
         var barPrimaryDexopter = mock(PrimaryDexopter.class);
         when(mInjector.getPrimaryDexopter(same(mPkgStateBar), any(), any(), any()))
                 .thenReturn(barPrimaryDexopter);
diff --git a/libartservice/service/javatests/com/android/server/art/DumpHelperTest.java b/libartservice/service/javatests/com/android/server/art/DumpHelperTest.java
index 5dbe213..520cda0 100644
--- a/libartservice/service/javatests/com/android/server/art/DumpHelperTest.java
+++ b/libartservice/service/javatests/com/android/server/art/DumpHelperTest.java
@@ -16,6 +16,7 @@
 
 package com.android.server.art;
 
+import static com.android.server.art.DexUseManagerLocal.CheckedSecondaryDexInfo;
 import static com.android.server.art.DexUseManagerLocal.DexLoader;
 import static com.android.server.art.DexUseManagerLocal.SecondaryDexInfo;
 import static com.android.server.art.model.DexoptStatus.DexContainerFileDexoptStatus;
@@ -68,7 +69,6 @@
     @Mock private ArtManagerLocal mArtManagerLocal;
     @Mock private DexUseManagerLocal mDexUseManagerLocal;
     @Mock private PackageManagerLocal.FilteredSnapshot mSnapshot;
-    @Mock private IArtd mArtd;
 
     private DumpHelper mDumpHelper;
 
@@ -87,7 +87,6 @@
 
         lenient().when(mInjector.getArtManagerLocal()).thenReturn(mArtManagerLocal);
         lenient().when(mInjector.getDexUseManager()).thenReturn(mDexUseManagerLocal);
-        lenient().when(mInjector.getArtd()).thenReturn(mArtd);
 
         Map<String, PackageState> pkgStates = createPackageStates();
         lenient().when(mSnapshot.getPackageStates()).thenReturn(pkgStates);
@@ -104,16 +103,16 @@
     @Test
     public void testDump() throws Exception {
         String expected = "[com.example1.foo]\n"
-                + "  path: /data/app/foo/base.apk\n"
+                + "  path: /somewhere/app/foo/base.apk\n"
                 + "    arm64: [status=speed-profile] [reason=bg-dexopt] [primary-abi]\n"
-                + "      [location is /data/app/foo/oat/arm64/base.odex]\n"
+                + "      [location is /somewhere/app/foo/oat/arm64/base.odex]\n"
                 + "    arm: [status=verify] [reason=install]\n"
-                + "      [location is /data/app/foo/oat/arm/base.odex]\n"
-                + "  path: /data/app/foo/split_0.apk\n"
+                + "      [location is /somewhere/app/foo/oat/arm/base.odex]\n"
+                + "  path: /somewhere/app/foo/split_0.apk\n"
                 + "    arm64: [status=verify] [reason=vdex] [primary-abi]\n"
-                + "      [location is primary.vdex in /data/app/foo/split_0.dm]\n"
+                + "      [location is primary.vdex in /somewhere/app/foo/split_0.dm]\n"
                 + "    arm: [status=verify] [reason=vdex]\n"
-                + "      [location is primary.vdex in /data/app/foo/split_0.dm]\n"
+                + "      [location is primary.vdex in /somewhere/app/foo/split_0.dm]\n"
                 + "    used by other apps: [com.example2.bar (isa=arm)]\n"
                 + "  known secondary dex files:\n"
                 + "    /data/user_de/0/foo/1.apk (removed)\n"
@@ -130,11 +129,11 @@
                 + "        [location is /data/user_de/0/foo/oat/arm/2.vdex]\n"
                 + "      class loader context: PCL[]\n"
                 + "[com.example2.bar]\n"
-                + "  path: /data/app/bar/base.apk\n"
+                + "  path: /somewhere/app/bar/base.apk\n"
                 + "    arm: [status=verify] [reason=install] [primary-abi]\n"
-                + "      [location is /data/app/bar/oat/arm/base.odex]\n"
+                + "      [location is /somewhere/app/bar/oat/arm/base.odex]\n"
                 + "    arm64: [status=verify] [reason=install]\n"
-                + "      [location is /data/app/bar/oat/arm64/base.odex]\n"
+                + "      [location is /somewhere/app/bar/oat/arm64/base.odex]\n"
                 + "\n"
                 + "Current GC: CollectorTypeCMC\n";
 
@@ -179,18 +178,18 @@
         // The order of the primary dex files and the ABIs should be kept in the output. Secondary
         // dex files should be reordered in lexicographical order.
         var status = DexoptStatus.create(List.of(
-                DexContainerFileDexoptStatus.create("/data/app/foo/base.apk",
+                DexContainerFileDexoptStatus.create("/somewhere/app/foo/base.apk",
                         true /* isPrimaryDex */, true /* isPrimaryAbi */, "arm64-v8a",
-                        "speed-profile", "bg-dexopt", "/data/app/foo/oat/arm64/base.odex"),
-                DexContainerFileDexoptStatus.create("/data/app/foo/base.apk",
+                        "speed-profile", "bg-dexopt", "/somewhere/app/foo/oat/arm64/base.odex"),
+                DexContainerFileDexoptStatus.create("/somewhere/app/foo/base.apk",
                         true /* isPrimaryDex */, false /* isPrimaryAbi */, "armeabi-v7a", "verify",
-                        "install", "/data/app/foo/oat/arm/base.odex"),
-                DexContainerFileDexoptStatus.create("/data/app/foo/split_0.apk",
+                        "install", "/somewhere/app/foo/oat/arm/base.odex"),
+                DexContainerFileDexoptStatus.create("/somewhere/app/foo/split_0.apk",
                         true /* isPrimaryDex */, true /* isPrimaryAbi */, "arm64-v8a", "verify",
-                        "vdex", "primary.vdex in /data/app/foo/split_0.dm"),
-                DexContainerFileDexoptStatus.create("/data/app/foo/split_0.apk",
+                        "vdex", "primary.vdex in /somewhere/app/foo/split_0.dm"),
+                DexContainerFileDexoptStatus.create("/somewhere/app/foo/split_0.apk",
                         true /* isPrimaryDex */, false /* isPrimaryAbi */, "armeabi-v7a", "verify",
-                        "vdex", "primary.vdex in /data/app/foo/split_0.dm"),
+                        "vdex", "primary.vdex in /somewhere/app/foo/split_0.dm"),
                 DexContainerFileDexoptStatus.create("/data/user_de/0/foo/2.apk",
                         false /* isPrimaryDex */, true /* isPrimaryAbi */, "arm64-v8a",
                         "speed-profile", "bg-dexopt", "/data/user_de/0/foo/oat/arm64/2.odex"),
@@ -208,17 +207,17 @@
         // The output should not show "used by other apps:".
         lenient()
                 .when(mDexUseManagerLocal.getPrimaryDexLoaders(
-                        PKG_NAME_FOO, "/data/app/foo/base.apk"))
+                        PKG_NAME_FOO, "/somewhere/app/foo/base.apk"))
                 .thenReturn(Set.of());
 
         // The output should not show "foo" in "used by other apps:".
         lenient()
                 .when(mDexUseManagerLocal.getPrimaryDexLoaders(
-                        PKG_NAME_FOO, "/data/app/foo/split_0.apk"))
+                        PKG_NAME_FOO, "/somewhere/app/foo/split_0.apk"))
                 .thenReturn(Set.of(DexLoader.create(PKG_NAME_FOO, false /* isolatedProcess */),
                         DexLoader.create(PKG_NAME_BAR, false /* isolatedProcess */)));
 
-        var info1 = mock(SecondaryDexInfo.class);
+        var info1 = mock(CheckedSecondaryDexInfo.class);
         lenient().when(info1.dexPath()).thenReturn("/data/user_de/0/foo/1.apk");
         lenient()
                 .when(info1.displayClassLoaderContext())
@@ -243,11 +242,9 @@
         lenient().when(info1.loaders()).thenReturn(loaders);
 
         // The output should show the dex path with "(removed)".
-        lenient()
-                .when(mArtd.getDexFileVisibility("/data/user_de/0/foo/1.apk"))
-                .thenReturn(FileVisibility.NOT_FOUND);
+        lenient().when(info1.fileVisibility()).thenReturn(FileVisibility.NOT_FOUND);
 
-        var info2 = mock(SecondaryDexInfo.class);
+        var info2 = mock(CheckedSecondaryDexInfo.class);
         lenient().when(info2.dexPath()).thenReturn("/data/user_de/0/foo/2.apk");
         lenient().when(info2.displayClassLoaderContext()).thenReturn("PCL[]");
         lenient()
@@ -259,14 +256,13 @@
         lenient()
                 .when(info2.loaders())
                 .thenReturn(Set.of(DexLoader.create(PKG_NAME_FOO, false /* isolatedProcess */)));
-        lenient()
-                .when(mArtd.getDexFileVisibility("/data/user_de/0/foo/2.apk"))
-                .thenReturn(FileVisibility.OTHER_READABLE);
+        lenient().when(info2.fileVisibility()).thenReturn(FileVisibility.OTHER_READABLE);
 
         lenient()
                 .doReturn(List.of(info1, info2))
                 .when(mDexUseManagerLocal)
-                .getSecondaryDexInfo(PKG_NAME_FOO);
+                .getCheckedSecondaryDexInfo(
+                        PKG_NAME_FOO, false /* excludeObsoleteDexesAndLoaders */);
     }
 
     private void setUpForBar() {
@@ -274,12 +270,12 @@
         // order for package "foo".
         // The output should not show "known secondary dex files:".
         var status = DexoptStatus.create(
-                List.of(DexContainerFileDexoptStatus.create("/data/app/bar/base.apk",
+                List.of(DexContainerFileDexoptStatus.create("/somewhere/app/bar/base.apk",
                                 true /* isPrimaryDex */, true /* isPrimaryAbi */, "armeabi-v7a",
-                                "verify", "install", "/data/app/bar/oat/arm/base.odex"),
-                        DexContainerFileDexoptStatus.create("/data/app/bar/base.apk",
+                                "verify", "install", "/somewhere/app/bar/oat/arm/base.odex"),
+                        DexContainerFileDexoptStatus.create("/somewhere/app/bar/base.apk",
                                 true /* isPrimaryDex */, false /* isPrimaryAbi */, "arm64-v8a",
-                                "verify", "install", "/data/app/bar/oat/arm64/base.odex")));
+                                "verify", "install", "/somewhere/app/bar/oat/arm64/base.odex")));
 
         lenient()
                 .when(mArtManagerLocal.getDexoptStatus(any(), eq(PKG_NAME_BAR)))
@@ -287,7 +283,7 @@
 
         lenient()
                 .when(mDexUseManagerLocal.getPrimaryDexLoaders(
-                        PKG_NAME_BAR, "/data/app/bar/base.apk"))
+                        PKG_NAME_BAR, "/somewhere/app/bar/base.apk"))
                 .thenReturn(Set.of());
     }
 }
diff --git a/libartservice/service/javatests/com/android/server/art/PrimaryDexUtilsTest.java b/libartservice/service/javatests/com/android/server/art/PrimaryDexUtilsTest.java
index a54b371..d9b5e5a 100644
--- a/libartservice/service/javatests/com/android/server/art/PrimaryDexUtilsTest.java
+++ b/libartservice/service/javatests/com/android/server/art/PrimaryDexUtilsTest.java
@@ -24,6 +24,8 @@
 import static org.mockito.Mockito.lenient;
 import static org.mockito.Mockito.mock;
 
+import android.util.Pair;
+
 import androidx.test.filters.SmallTest;
 
 import com.android.server.pm.pkg.AndroidPackage;
@@ -35,6 +37,8 @@
 import dalvik.system.DexClassLoader;
 import dalvik.system.PathClassLoader;
 
+import com.google.common.truth.Correspondence;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -68,15 +72,21 @@
                 + "PCL[library_4.jar]{PCL[library_1_dex_1.jar:library_1_dex_2.jar]}"
                 + "}";
 
-        assertThat(infos.get(0).classLoaderContext()).isEqualTo("PCL[]" + sharedLibrariesContext);
-        assertThat(infos.get(1).classLoaderContext())
-                .isEqualTo("PCL[base.apk]" + sharedLibrariesContext);
-        assertThat(infos.get(2).classLoaderContext()).isEqualTo(null);
-        assertThat(infos.get(3).classLoaderContext())
-                .isEqualTo("PCL[base.apk:split_0.apk:split_1.apk]" + sharedLibrariesContext);
-        assertThat(infos.get(4).classLoaderContext())
-                .isEqualTo("PCL[base.apk:split_0.apk:split_1.apk:split_2.apk]"
-                        + sharedLibrariesContext);
+        assertThat(infos)
+                .comparingElementsUsing(Correspondence.transforming(
+                        (DetailedPrimaryDexInfo info)
+                                -> Pair.create(info.splitName(), info.classLoaderContext()),
+                        "has split name and CLC of"))
+                .containsExactly(Pair.create(null, "PCL[]" + sharedLibrariesContext),
+                        Pair.create("split_0", "PCL[base.apk]" + sharedLibrariesContext),
+                        Pair.create("split_2",
+                                "PCL[base.apk:split_0.apk:split_1.apk]" + sharedLibrariesContext),
+                        Pair.create("split_3",
+                                "PCL[base.apk:split_0.apk:split_1.apk:split_2.apk]"
+                                        + sharedLibrariesContext),
+                        Pair.create("split_4",
+                                "PCL[base.apk:split_0.apk:split_1.apk:split_2.apk:split_3.apk]"
+                                        + sharedLibrariesContext));
     }
 
     @Test
@@ -91,73 +101,74 @@
                 + "PCL[library_4.jar]{PCL[library_1_dex_1.jar:library_1_dex_2.jar]}"
                 + "}";
 
-        assertThat(infos.get(0).classLoaderContext()).isEqualTo("PCL[]" + sharedLibrariesContext);
-        assertThat(infos.get(1).classLoaderContext())
-                .isEqualTo("PCL[];DLC[split_2.apk];PCL[base.apk]" + sharedLibrariesContext);
-        assertThat(infos.get(2).classLoaderContext()).isEqualTo(null);
-        assertThat(infos.get(3).classLoaderContext())
-                .isEqualTo("DLC[];PCL[base.apk]" + sharedLibrariesContext);
-        assertThat(infos.get(4).classLoaderContext()).isEqualTo("PCL[]");
-        assertThat(infos.get(5).classLoaderContext()).isEqualTo("PCL[];PCL[split_3.apk]");
+        assertThat(infos)
+                .comparingElementsUsing(Correspondence.transforming(
+                        (DetailedPrimaryDexInfo info)
+                                -> Pair.create(info.splitName(), info.classLoaderContext()),
+                        "has split name and CLC of"))
+                .containsExactly(Pair.create(null, "PCL[]" + sharedLibrariesContext),
+                        Pair.create("split_0",
+                                "PCL[];DLC[split_2.apk];PCL[base.apk]" + sharedLibrariesContext),
+                        Pair.create("split_2", "DLC[];PCL[base.apk]" + sharedLibrariesContext),
+                        Pair.create("split_3", "PCL[]"),
+                        Pair.create("split_4", "PCL[];PCL[split_3.apk]"));
     }
 
     private <T extends PrimaryDexInfo> void checkBasicInfo(List<T> infos) {
-        assertThat(infos.get(0).dexPath()).isEqualTo("/data/app/foo/base.apk");
+        assertThat(infos.get(0).dexPath()).isEqualTo("/somewhere/app/foo/base.apk");
         assertThat(infos.get(0).hasCode()).isTrue();
         assertThat(infos.get(0).splitName()).isNull();
 
-        assertThat(infos.get(1).dexPath()).isEqualTo("/data/app/foo/split_0.apk");
+        assertThat(infos.get(1).dexPath()).isEqualTo("/somewhere/app/foo/split_0.apk");
         assertThat(infos.get(1).hasCode()).isTrue();
         assertThat(infos.get(1).splitName()).isEqualTo("split_0");
 
-        assertThat(infos.get(2).dexPath()).isEqualTo("/data/app/foo/split_1.apk");
-        assertThat(infos.get(2).hasCode()).isFalse();
-        assertThat(infos.get(2).splitName()).isEqualTo("split_1");
+        // split_1 is skipped because it has no code.
 
-        assertThat(infos.get(3).dexPath()).isEqualTo("/data/app/foo/split_2.apk");
+        assertThat(infos.get(2).dexPath()).isEqualTo("/somewhere/app/foo/split_2.apk");
+        assertThat(infos.get(2).hasCode()).isTrue();
+        assertThat(infos.get(2).splitName()).isEqualTo("split_2");
+
+        assertThat(infos.get(3).dexPath()).isEqualTo("/somewhere/app/foo/split_3.apk");
         assertThat(infos.get(3).hasCode()).isTrue();
-        assertThat(infos.get(3).splitName()).isEqualTo("split_2");
+        assertThat(infos.get(3).splitName()).isEqualTo("split_3");
 
-        assertThat(infos.get(4).dexPath()).isEqualTo("/data/app/foo/split_3.apk");
+        assertThat(infos.get(4).dexPath()).isEqualTo("/somewhere/app/foo/split_4.apk");
         assertThat(infos.get(4).hasCode()).isTrue();
-        assertThat(infos.get(4).splitName()).isEqualTo("split_3");
-
-        assertThat(infos.get(5).dexPath()).isEqualTo("/data/app/foo/split_4.apk");
-        assertThat(infos.get(5).hasCode()).isTrue();
-        assertThat(infos.get(5).splitName()).isEqualTo("split_4");
+        assertThat(infos.get(4).splitName()).isEqualTo("split_4");
     }
 
     private AndroidPackage createPackage(boolean isIsolatedSplitLoading) {
         AndroidPackage pkg = mock(AndroidPackage.class);
 
         var baseSplit = mock(AndroidPackageSplit.class);
-        lenient().when(baseSplit.getPath()).thenReturn("/data/app/foo/base.apk");
+        lenient().when(baseSplit.getPath()).thenReturn("/somewhere/app/foo/base.apk");
         lenient().when(baseSplit.isHasCode()).thenReturn(true);
         lenient().when(baseSplit.getClassLoaderName()).thenReturn(PathClassLoader.class.getName());
 
         var split0 = mock(AndroidPackageSplit.class);
         lenient().when(split0.getName()).thenReturn("split_0");
-        lenient().when(split0.getPath()).thenReturn("/data/app/foo/split_0.apk");
+        lenient().when(split0.getPath()).thenReturn("/somewhere/app/foo/split_0.apk");
         lenient().when(split0.isHasCode()).thenReturn(true);
 
         var split1 = mock(AndroidPackageSplit.class);
         lenient().when(split1.getName()).thenReturn("split_1");
-        lenient().when(split1.getPath()).thenReturn("/data/app/foo/split_1.apk");
+        lenient().when(split1.getPath()).thenReturn("/somewhere/app/foo/split_1.apk");
         lenient().when(split1.isHasCode()).thenReturn(false);
 
         var split2 = mock(AndroidPackageSplit.class);
         lenient().when(split2.getName()).thenReturn("split_2");
-        lenient().when(split2.getPath()).thenReturn("/data/app/foo/split_2.apk");
+        lenient().when(split2.getPath()).thenReturn("/somewhere/app/foo/split_2.apk");
         lenient().when(split2.isHasCode()).thenReturn(true);
 
         var split3 = mock(AndroidPackageSplit.class);
         lenient().when(split3.getName()).thenReturn("split_3");
-        lenient().when(split3.getPath()).thenReturn("/data/app/foo/split_3.apk");
+        lenient().when(split3.getPath()).thenReturn("/somewhere/app/foo/split_3.apk");
         lenient().when(split3.isHasCode()).thenReturn(true);
 
         var split4 = mock(AndroidPackageSplit.class);
         lenient().when(split4.getName()).thenReturn("split_4");
-        lenient().when(split4.getPath()).thenReturn("/data/app/foo/split_4.apk");
+        lenient().when(split4.getPath()).thenReturn("/somewhere/app/foo/split_4.apk");
         lenient().when(split4.isHasCode()).thenReturn(true);
 
         var splits = List.of(baseSplit, split0, split1, split2, split3, split4);
diff --git a/libartservice/service/javatests/com/android/server/art/PrimaryDexopterParameterizedTest.java b/libartservice/service/javatests/com/android/server/art/PrimaryDexopterParameterizedTest.java
index 36b6a58..b9b8bd3 100644
--- a/libartservice/service/javatests/com/android/server/art/PrimaryDexopterParameterizedTest.java
+++ b/libartservice/service/javatests/com/android/server/art/PrimaryDexopterParameterizedTest.java
@@ -168,6 +168,32 @@
         params.mExpectedCompilerFilter = "speed";
         list.add(params);
 
+        // It respects the adjustment made by the callback.
+        params = new Params();
+        params.mRequestedCompilerFilter = "speed-profile";
+        params.mExpectedCallbackInputCompilerFilter = "speed-profile";
+        params.mCallbackReturnedCompilerFilter = "speed";
+        params.mExpectedCompilerFilter = "speed";
+        list.add(params);
+
+        // It upgrades the compiler filter before calling the callback.
+        params = new Params();
+        params.mRequestedCompilerFilter = "speed-profile";
+        params.mIsSystemUi = true;
+        params.mExpectedCallbackInputCompilerFilter = "speed";
+        params.mCallbackReturnedCompilerFilter = "speed";
+        params.mExpectedCompilerFilter = "speed";
+        list.add(params);
+
+        // It downgrades the compiler filter after calling the callback.
+        params = new Params();
+        params.mRequestedCompilerFilter = "speed-profile";
+        params.mExpectedCallbackInputCompilerFilter = "speed-profile";
+        params.mCallbackReturnedCompilerFilter = "speed-profile";
+        params.mIsUseEmbeddedDex = true;
+        params.mExpectedCompilerFilter = "verify";
+        list.add(params);
+
         return list;
     }
 
@@ -198,6 +224,17 @@
 
         lenient().when(mArtd.isInDalvikCache(any())).thenReturn(mParams.mIsInDalvikCache);
 
+        if (mParams.mCallbackReturnedCompilerFilter != null) {
+            mConfig.setAdjustCompilerFilterCallback(
+                    Runnable::run, (packageName, originalCompilerFilter, reason) -> {
+                        assertThat(packageName).isEqualTo(PKG_NAME);
+                        assertThat(originalCompilerFilter)
+                                .isEqualTo(mParams.mExpectedCallbackInputCompilerFilter);
+                        assertThat(reason).isEqualTo("install");
+                        return mParams.mCallbackReturnedCompilerFilter;
+                    });
+        }
+
         mDexoptParams =
                 new DexoptParams.Builder("install")
                         .setCompilerFilter(mParams.mRequestedCompilerFilter)
@@ -229,9 +266,9 @@
                 -> options.compilationReason.equals("install") && options.targetSdkVersion == 123
                 && options.debuggable == mParams.mExpectedIsDebuggable
                 && options.hiddenApiPolicyEnabled == mParams.mExpectedIsHiddenApiPolicyEnabled
-                && options.comments.equals(
-                        String.format("app-version-name:%s,app-version-code:%d,art-version:%d",
-                                APP_VERSION_NAME, APP_VERSION_CODE, ART_VERSION));
+                && options.comments.equals(String.format(
+                        "app-name:%s,app-version-name:%s,app-version-code:%d,art-version:%d",
+                        PKG_NAME, APP_VERSION_NAME, APP_VERSION_CODE, ART_VERSION));
 
         when(mArtd.createCancellationSignal()).thenReturn(mock(IArtdCancellationSignal.class));
         when(mArtd.getDmFileVisibility(any())).thenReturn(FileVisibility.NOT_FOUND);
@@ -239,14 +276,14 @@
         // The first one is normal.
         doReturn(dexoptIsNeeded())
                 .when(mArtd)
-                .getDexoptNeeded("/data/app/foo/base.apk", "arm64", "PCL[]",
+                .getDexoptNeeded("/somewhere/app/foo/base.apk", "arm64", "PCL[]",
                         mParams.mExpectedCompilerFilter, mParams.mExpectedDexoptTrigger);
         doReturn(createArtdDexoptResult(false /* cancelled */, 100 /* wallTimeMs */,
                          400 /* cpuTimeMs */, 30000 /* sizeBytes */, 32000 /* sizeBeforeBytes */))
                 .when(mArtd)
-                .dexopt(deepEq(buildOutputArtifacts("/data/app/foo/base.apk", "arm64",
+                .dexopt(deepEq(buildOutputArtifacts("/somewhere/app/foo/base.apk", "arm64",
                                 mParams.mIsInDalvikCache, permissionSettings)),
-                        eq("/data/app/foo/base.apk"), eq("arm64"), eq("PCL[]"),
+                        eq("/somewhere/app/foo/base.apk"), eq("arm64"), eq("PCL[]"),
                         eq(mParams.mExpectedCompilerFilter), any() /* profile */,
                         isNull() /* inputVdex */, isNull() /* dmFile */,
                         eq(PriorityClass.INTERACTIVE), argThat(dexoptOptionsMatcher), any());
@@ -254,13 +291,13 @@
         // The second one fails on `dexopt`.
         doReturn(dexoptIsNeeded())
                 .when(mArtd)
-                .getDexoptNeeded("/data/app/foo/base.apk", "arm", "PCL[]",
+                .getDexoptNeeded("/somewhere/app/foo/base.apk", "arm", "PCL[]",
                         mParams.mExpectedCompilerFilter, mParams.mExpectedDexoptTrigger);
         doThrow(ServiceSpecificException.class)
                 .when(mArtd)
-                .dexopt(deepEq(buildOutputArtifacts("/data/app/foo/base.apk", "arm",
+                .dexopt(deepEq(buildOutputArtifacts("/somewhere/app/foo/base.apk", "arm",
                                 mParams.mIsInDalvikCache, permissionSettings)),
-                        eq("/data/app/foo/base.apk"), eq("arm"), eq("PCL[]"),
+                        eq("/somewhere/app/foo/base.apk"), eq("arm"), eq("PCL[]"),
                         eq(mParams.mExpectedCompilerFilter), any() /* profile */,
                         isNull() /* inputVdex */, isNull() /* dmFile */,
                         eq(PriorityClass.INTERACTIVE), argThat(dexoptOptionsMatcher), any());
@@ -268,40 +305,47 @@
         // The third one doesn't need dexopt.
         doReturn(dexoptIsNotNeeded())
                 .when(mArtd)
-                .getDexoptNeeded("/data/app/foo/split_0.apk", "arm64", "PCL[base.apk]",
+                .getDexoptNeeded("/somewhere/app/foo/split_0.apk", "arm64", "PCL[base.apk]",
                         mParams.mExpectedCompilerFilter, mParams.mExpectedDexoptTrigger);
 
         // The fourth one is normal.
         doReturn(dexoptIsNeeded())
                 .when(mArtd)
-                .getDexoptNeeded("/data/app/foo/split_0.apk", "arm", "PCL[base.apk]",
+                .getDexoptNeeded("/somewhere/app/foo/split_0.apk", "arm", "PCL[base.apk]",
                         mParams.mExpectedCompilerFilter, mParams.mExpectedDexoptTrigger);
         doReturn(createArtdDexoptResult(false /* cancelled */, 200 /* wallTimeMs */,
                          200 /* cpuTimeMs */, 10000 /* sizeBytes */, 0 /* sizeBeforeBytes */))
                 .when(mArtd)
-                .dexopt(deepEq(buildOutputArtifacts("/data/app/foo/split_0.apk", "arm",
+                .dexopt(deepEq(buildOutputArtifacts("/somewhere/app/foo/split_0.apk", "arm",
                                 mParams.mIsInDalvikCache, permissionSettings)),
-                        eq("/data/app/foo/split_0.apk"), eq("arm"), eq("PCL[base.apk]"),
+                        eq("/somewhere/app/foo/split_0.apk"), eq("arm"), eq("PCL[base.apk]"),
                         eq(mParams.mExpectedCompilerFilter), any() /* profile */,
                         isNull() /* inputVdex */, isNull() /* dmFile */,
                         eq(PriorityClass.INTERACTIVE), argThat(dexoptOptionsMatcher), any());
 
+        // Only delete runtime artifacts for successful dexopt operations, namely the first one and
+        // the fourth one.
+        doReturn(1l).when(mArtd).deleteRuntimeArtifacts(deepEq(AidlUtils.buildRuntimeArtifactsPath(
+                PKG_NAME, "/somewhere/app/foo/base.apk", "arm64")));
+        doReturn(1l).when(mArtd).deleteRuntimeArtifacts(deepEq(AidlUtils.buildRuntimeArtifactsPath(
+                PKG_NAME, "/somewhere/app/foo/split_0.apk", "arm")));
+
         assertThat(mPrimaryDexopter.dexopt())
                 .comparingElementsUsing(TestingUtils.<DexContainerFileDexoptResult>deepEquality())
                 .containsExactly(
-                        DexContainerFileDexoptResult.create("/data/app/foo/base.apk",
+                        DexContainerFileDexoptResult.create("/somewhere/app/foo/base.apk",
                                 true /* isPrimaryAbi */, "arm64-v8a",
                                 mParams.mExpectedCompilerFilter, DexoptResult.DEXOPT_PERFORMED,
                                 100 /* dex2oatWallTimeMillis */, 400 /* dex2oatCpuTimeMillis */,
                                 30000 /* sizeBytes */, 32000 /* sizeBeforeBytes */,
                                 0 /* extendedStatusFlags */, List.of() /* externalProfileErrors */),
-                        DexContainerFileDexoptResult.create("/data/app/foo/base.apk",
+                        DexContainerFileDexoptResult.create("/somewhere/app/foo/base.apk",
                                 false /* isPrimaryAbi */, "armeabi-v7a",
                                 mParams.mExpectedCompilerFilter, DexoptResult.DEXOPT_FAILED),
-                        DexContainerFileDexoptResult.create("/data/app/foo/split_0.apk",
+                        DexContainerFileDexoptResult.create("/somewhere/app/foo/split_0.apk",
                                 true /* isPrimaryAbi */, "arm64-v8a",
                                 mParams.mExpectedCompilerFilter, DexoptResult.DEXOPT_SKIPPED),
-                        DexContainerFileDexoptResult.create("/data/app/foo/split_0.apk",
+                        DexContainerFileDexoptResult.create("/somewhere/app/foo/split_0.apk",
                                 false /* isPrimaryAbi */, "armeabi-v7a",
                                 mParams.mExpectedCompilerFilter, DexoptResult.DEXOPT_PERFORMED,
                                 200 /* dex2oatWallTimeMillis */, 200 /* dex2oatCpuTimeMillis */,
@@ -327,6 +371,7 @@
 
         // Options.
         public String mRequestedCompilerFilter = "verify";
+        public String mCallbackReturnedCompilerFilter = null;
         public boolean mForce = false;
         public boolean mShouldDowngrade = false;
         public boolean mSkipIfStorageLow = false;
@@ -336,6 +381,7 @@
         public boolean mAlwaysDebuggable = false;
 
         // Expectations.
+        public String mExpectedCallbackInputCompilerFilter = "verify";
         public String mExpectedCompilerFilter = "verify";
         public int mExpectedDexoptTrigger = DexoptTrigger.COMPILER_FILTER_IS_BETTER
                 | DexoptTrigger.PRIMARY_BOOT_IMAGE_BECOMES_USABLE | DexoptTrigger.NEED_EXTRACTION;
@@ -351,19 +397,22 @@
                             + "isLauncher=%b,"
                             + "isUseEmbeddedDex=%b,"
                             + "requestedCompilerFilter=%s,"
+                            + "callbackReturnedCompilerFilter=%s,"
                             + "force=%b,"
                             + "shouldDowngrade=%b,"
                             + "skipIfStorageLow=%b,"
                             + "ignoreProfile=%b,"
                             + "alwaysDebuggable=%b"
                             + " => "
-                            + "targetCompilerFilter=%s,"
+                            + "expectedCallbackInputCompilerFilter=%s,"
+                            + "expectedCompilerFilter=%s,"
                             + "expectedDexoptTrigger=%d,"
                             + "expectedIsDebuggable=%b,"
                             + "expectedIsHiddenApiPolicyEnabled=%b",
                     mIsInDalvikCache, mHiddenApiEnforcementPolicy, mIsVmSafeMode, mIsDebuggable,
-                    mIsSystemUi, mIsLauncher, mIsUseEmbeddedDex, mRequestedCompilerFilter, mForce,
-                    mShouldDowngrade, mSkipIfStorageLow, mIgnoreProfile, mAlwaysDebuggable,
+                    mIsSystemUi, mIsLauncher, mIsUseEmbeddedDex, mRequestedCompilerFilter,
+                    mCallbackReturnedCompilerFilter, mForce, mShouldDowngrade, mSkipIfStorageLow,
+                    mIgnoreProfile, mAlwaysDebuggable, mExpectedCallbackInputCompilerFilter,
                     mExpectedCompilerFilter, mExpectedDexoptTrigger, mExpectedIsDebuggable,
                     mExpectedIsHiddenApiPolicyEnabled);
         }
diff --git a/libartservice/service/javatests/com/android/server/art/PrimaryDexopterTest.java b/libartservice/service/javatests/com/android/server/art/PrimaryDexopterTest.java
index cdabcf3..edb90a1 100644
--- a/libartservice/service/javatests/com/android/server/art/PrimaryDexopterTest.java
+++ b/libartservice/service/javatests/com/android/server/art/PrimaryDexopterTest.java
@@ -16,7 +16,6 @@
 
 package com.android.server.art;
 
-import static com.android.server.art.GetDexoptNeededResult.ArtifactsLocation;
 import static com.android.server.art.model.DexoptResult.DexContainerFileDexoptResult;
 import static com.android.server.art.testing.TestingUtils.deepEq;
 
@@ -66,7 +65,7 @@
 @SmallTest
 @RunWith(AndroidJUnit4.class)
 public class PrimaryDexopterTest extends PrimaryDexopterTestBase {
-    private final String mDexPath = "/data/app/foo/base.apk";
+    private final String mDexPath = "/somewhere/app/foo/base.apk";
     private final ProfilePath mRefProfile =
             AidlUtils.buildProfilePathForPrimaryRef(PKG_NAME, "primary");
     private final ProfilePath mPrebuiltProfile = AidlUtils.buildProfilePathForPrebuilt(mDexPath);
@@ -77,7 +76,7 @@
     private final OutputProfile mPrivateOutputProfile = AidlUtils.buildOutputProfileForPrimary(
             PKG_NAME, "primary", Process.SYSTEM_UID, SHARED_GID, false /* isOtherReadable */);
 
-    private final String mSplit0DexPath = "/data/app/foo/split_0.apk";
+    private final String mSplit0DexPath = "/somewhere/app/foo/split_0.apk";
     private final ProfilePath mSplit0RefProfile =
             AidlUtils.buildProfilePathForPrimaryRef(PKG_NAME, "split_0.split");
 
@@ -102,6 +101,7 @@
     private PrimaryDexopter mPrimaryDexopter;
 
     private List<ProfilePath> mUsedProfiles;
+    private List<String> mUsedEmbeddedProfiles;
 
     @Before
     public void setUp() throws Exception {
@@ -112,6 +112,9 @@
         lenient()
                 .when(mArtd.copyAndRewriteProfile(any(), any(), any()))
                 .thenReturn(TestingUtils.createCopyAndRewriteProfileNoProfile());
+        lenient()
+                .when(mArtd.copyAndRewriteEmbeddedProfile(any(), any()))
+                .thenReturn(TestingUtils.createCopyAndRewriteProfileNoProfile());
 
         // By default, no DM file exists.
         lenient().when(mArtd.getDmFileVisibility(any())).thenReturn(FileVisibility.NOT_FOUND);
@@ -133,6 +136,7 @@
                 new PrimaryDexopter(mInjector, mPkgState, mPkg, mDexoptParams, mCancellationSignal);
 
         mUsedProfiles = new ArrayList<>();
+        mUsedEmbeddedProfiles = new ArrayList<>();
     }
 
     @Test
@@ -212,19 +216,20 @@
         // Other profiles are also usable, but they shouldn't be used.
         makeProfileUsable(mPrebuiltProfile);
         makeProfileUsable(mDmProfile);
+        makeEmbeddedProfileUsable(mDexPath);
 
         List<DexContainerFileDexoptResult> results = mPrimaryDexopter.dexopt();
         verifyStatusAllOk(results);
 
         verify(mArtd).getDexoptNeeded(
                 eq(mDexPath), eq("arm64"), any(), eq("speed-profile"), eq(mDefaultDexoptTrigger));
-        checkDexoptWithProfile(verify(mArtd), mDexPath, "arm64", mRefProfile,
-                false /* isOtherReadable */, true /* generateAppImage */);
+        checkDexoptWithProfile(
+                verify(mArtd), mDexPath, "arm64", mRefProfile, false /* isOtherReadable */);
 
         verify(mArtd).getDexoptNeeded(
                 eq(mDexPath), eq("arm"), any(), eq("speed-profile"), eq(mDefaultDexoptTrigger));
-        checkDexoptWithProfile(verify(mArtd), mDexPath, "arm", mRefProfile,
-                false /* isOtherReadable */, true /* generateAppImage */);
+        checkDexoptWithProfile(
+                verify(mArtd), mDexPath, "arm", mRefProfile, false /* isOtherReadable */);
 
         // There is no profile for split 0, so it should fall back to "verify".
         verify(mArtd).getDexoptNeeded(
@@ -237,6 +242,7 @@
 
         verifyProfileNotUsed(mPrebuiltProfile);
         verifyProfileNotUsed(mDmProfile);
+        verifyEmbeddedProfileNotUsed(mDexPath);
     }
 
     @Test
@@ -249,24 +255,26 @@
         // Other profiles are also usable, but they shouldn't be used.
         makeProfileUsable(mPrebuiltProfile);
         makeProfileUsable(mDmProfile);
+        makeEmbeddedProfileUsable(mDexPath);
 
         List<DexContainerFileDexoptResult> results = mPrimaryDexopter.dexopt();
         verifyStatusAllOk(results);
 
-        checkDexoptWithProfile(verify(mArtd), mDexPath, "arm64", mRefProfile,
-                true /* isOtherReadable */, true /* generateAppImage */);
-        checkDexoptWithProfile(verify(mArtd), mDexPath, "arm", mRefProfile,
-                true /* isOtherReadable */, true /* generateAppImage */);
+        checkDexoptWithProfile(
+                verify(mArtd), mDexPath, "arm64", mRefProfile, true /* isOtherReadable */);
+        checkDexoptWithProfile(
+                verify(mArtd), mDexPath, "arm", mRefProfile, true /* isOtherReadable */);
 
         verifyProfileNotUsed(mPrebuiltProfile);
         verifyProfileNotUsed(mDmProfile);
+        verifyEmbeddedProfileNotUsed(mDexPath);
     }
 
     @Test
     public void testDexoptUsesPrebuiltProfile() throws Exception {
-        makeProfileNotUsable(mRefProfile);
         makeProfileUsable(mPrebuiltProfile);
         makeProfileUsable(mDmProfile);
+        makeEmbeddedProfileUsable(mDexPath);
 
         List<DexContainerFileDexoptResult> results = mPrimaryDexopter.dexopt();
         verifyStatusAllOk(results);
@@ -278,15 +286,16 @@
 
         checkDexoptWithProfile(inOrder.verify(mArtd), mDexPath, "arm64",
                 ProfilePath.tmpProfilePath(mPublicOutputProfile.profilePath),
-                true /* isOtherReadable */, true /* generateAppImage */);
+                true /* isOtherReadable */);
         checkDexoptWithProfile(inOrder.verify(mArtd), mDexPath, "arm",
                 ProfilePath.tmpProfilePath(mPublicOutputProfile.profilePath),
-                true /* isOtherReadable */, true /* generateAppImage */);
+                true /* isOtherReadable */);
 
         inOrder.verify(mArtd).commitTmpProfile(deepEq(mPublicOutputProfile.profilePath));
 
         verifyProfileNotUsed(mRefProfile);
         verifyProfileNotUsed(mDmProfile);
+        verifyEmbeddedProfileNotUsed(mDexPath);
     }
 
     @Test
@@ -317,13 +326,13 @@
                 eq(mBetterOrSameDexoptTrigger));
         checkDexoptWithProfile(inOrder.verify(mArtd), mDexPath, "arm64",
                 ProfilePath.tmpProfilePath(mPrivateOutputProfile.profilePath),
-                false /* isOtherReadable */, true /* generateAppImage */);
+                false /* isOtherReadable */);
 
         inOrder.verify(mArtd).getDexoptNeeded(eq(mDexPath), eq("arm"), any(), eq("speed-profile"),
                 eq(mBetterOrSameDexoptTrigger));
         checkDexoptWithProfile(inOrder.verify(mArtd), mDexPath, "arm",
                 ProfilePath.tmpProfilePath(mPrivateOutputProfile.profilePath),
-                false /* isOtherReadable */, true /* generateAppImage */);
+                false /* isOtherReadable */);
 
         inOrder.verify(mArtd).commitTmpProfile(deepEq(mPrivateOutputProfile.profilePath));
 
@@ -349,13 +358,13 @@
         // It should still use "speed-profile", but with the existing reference profile only.
         verify(mArtd).getDexoptNeeded(
                 eq(mDexPath), eq("arm64"), any(), eq("speed-profile"), eq(mDefaultDexoptTrigger));
-        checkDexoptWithProfile(verify(mArtd), mDexPath, "arm64", mRefProfile,
-                true /* isOtherReadable */, true /* generateAppImage */);
+        checkDexoptWithProfile(
+                verify(mArtd), mDexPath, "arm64", mRefProfile, true /* isOtherReadable */);
 
         verify(mArtd).getDexoptNeeded(
                 eq(mDexPath), eq("arm"), any(), eq("speed-profile"), eq(mDefaultDexoptTrigger));
-        checkDexoptWithProfile(verify(mArtd), mDexPath, "arm", mRefProfile,
-                true /* isOtherReadable */, true /* generateAppImage */);
+        checkDexoptWithProfile(
+                verify(mArtd), mDexPath, "arm", mRefProfile, true /* isOtherReadable */);
 
         verify(mArtd, never()).deleteProfile(any());
         verify(mArtd, never()).commitTmpProfile(any());
@@ -385,9 +394,8 @@
 
     @Test
     public void testDexoptUsesDmProfile() throws Exception {
-        makeProfileNotUsable(mRefProfile);
-        makeProfileNotUsable(mPrebuiltProfile);
         makeProfileUsable(mDmProfile);
+        makeEmbeddedProfileUsable(mDexPath);
 
         List<DexContainerFileDexoptResult> results = mPrimaryDexopter.dexopt();
         verifyStatusAllOk(results);
@@ -397,22 +405,41 @@
 
         checkDexoptWithProfile(verify(mArtd), mDexPath, "arm64",
                 ProfilePath.tmpProfilePath(mPublicOutputProfile.profilePath),
-                true /* isOtherReadable */, true /* generateAppImage */);
+                true /* isOtherReadable */);
         checkDexoptWithProfile(verify(mArtd), mDexPath, "arm",
                 ProfilePath.tmpProfilePath(mPublicOutputProfile.profilePath),
-                true /* isOtherReadable */, true /* generateAppImage */);
+                true /* isOtherReadable */);
 
         verifyProfileNotUsed(mRefProfile);
         verifyProfileNotUsed(mPrebuiltProfile);
+        verifyEmbeddedProfileNotUsed(mDexPath);
+    }
+
+    @Test
+    public void testDexoptUsesEmbeddedProfile() throws Exception {
+        makeEmbeddedProfileUsable(mDexPath);
+
+        List<DexContainerFileDexoptResult> results = mPrimaryDexopter.dexopt();
+        verifyStatusAllOk(results);
+
+        verify(mArtd).copyAndRewriteProfile(
+                deepEq(mDmProfile), deepEq(mPublicOutputProfile), eq(mDexPath));
+
+        checkDexoptWithProfile(verify(mArtd), mDexPath, "arm64",
+                ProfilePath.tmpProfilePath(mPublicOutputProfile.profilePath),
+                true /* isOtherReadable */);
+        checkDexoptWithProfile(verify(mArtd), mDexPath, "arm",
+                ProfilePath.tmpProfilePath(mPublicOutputProfile.profilePath),
+                true /* isOtherReadable */);
+
+        verifyProfileNotUsed(mRefProfile);
+        verifyProfileNotUsed(mPrebuiltProfile);
+        verifyProfileNotUsed(mDmProfile);
     }
 
     @Test
     public void testDexoptExternalProfileErrors() throws Exception {
-        makeProfileNotUsable(mRefProfile);
-
         // Having no profile should not be reported.
-        makeProfileNotUsable(mPrebuiltProfile);
-
         // Having a bad profile should be reported.
         lenient()
                 .when(mArtd.copyAndRewriteProfile(deepEq(mDmProfile), any(), any()))
@@ -434,8 +461,6 @@
 
     @Test
     public void testDexoptDeletesProfileOnFailure() throws Exception {
-        makeProfileNotUsable(mRefProfile);
-        makeProfileNotUsable(mPrebuiltProfile);
         makeProfileUsable(mDmProfile);
 
         when(mArtd.dexopt(any(), eq(mDexPath), any(), any(), any(), any(), any(), any(), anyInt(),
@@ -459,7 +484,6 @@
         // The ref profile is usable but shouldn't be used.
         makeProfileUsable(mRefProfile);
 
-        makeProfileNotUsable(mPrebuiltProfile);
         makeProfileUsable(mDmProfile);
 
         // The existing artifacts are private.
@@ -478,13 +502,13 @@
                 eq(mDexPath), eq("arm64"), any(), eq("speed-profile"), eq(mForceDexoptTrigger));
         checkDexoptWithProfile(verify(mArtd), mDexPath, "arm64",
                 ProfilePath.tmpProfilePath(mPublicOutputProfile.profilePath),
-                true /* isOtherReadable */, true /* generateAppImage */);
+                true /* isOtherReadable */);
 
         verify(mArtd).getDexoptNeeded(
                 eq(mDexPath), eq("arm"), any(), eq("speed-profile"), eq(mForceDexoptTrigger));
         checkDexoptWithProfile(verify(mArtd), mDexPath, "arm",
                 ProfilePath.tmpProfilePath(mPublicOutputProfile.profilePath),
-                true /* isOtherReadable */, true /* generateAppImage */);
+                true /* isOtherReadable */);
 
         checkDexoptWithNoProfile(verify(mArtd), mSplit0DexPath, "arm64", "speed");
         checkDexoptWithNoProfile(verify(mArtd), mSplit0DexPath, "arm", "speed");
@@ -502,7 +526,6 @@
                 .thenReturn(true);
 
         makeProfileUsable(mRefProfile);
-        makeProfileNotUsable(mPrebuiltProfile);
         makeProfileUsable(mDmProfile);
         when(mArtd.getArtifactsVisibility(
                      argThat(artifactsPath -> artifactsPath.dexPath == mDexPath)))
@@ -530,12 +553,12 @@
         verify(mArtd).getDexoptNeeded(eq(mSplit0DexPath), eq("arm64"), any(), eq("speed-profile"),
                 eq(mDefaultDexoptTrigger));
         checkDexoptWithProfile(verify(mArtd), mSplit0DexPath, "arm64", mSplit0RefProfile,
-                false /* isOtherReadable */, false /* generateAppImage */);
+                false /* isOtherReadable */);
 
         verify(mArtd).getDexoptNeeded(eq(mSplit0DexPath), eq("arm"), any(), eq("speed-profile"),
                 eq(mDefaultDexoptTrigger));
         checkDexoptWithProfile(verify(mArtd), mSplit0DexPath, "arm", mSplit0RefProfile,
-                false /* isOtherReadable */, false /* generateAppImage */);
+                false /* isOtherReadable */);
     }
 
     @Test
@@ -726,14 +749,12 @@
     }
 
     private void checkDexoptWithProfile(IArtd artd, String dexPath, String isa, ProfilePath profile,
-            boolean isOtherReadable, boolean generateAppImage) throws Exception {
+            boolean isOtherReadable) throws Exception {
         artd.dexopt(argThat(artifacts
                             -> artifacts.permissionSettings.fileFsPermission.isOtherReadable
                                     == isOtherReadable),
                 eq(dexPath), eq(isa), any(), eq("speed-profile"), deepEq(profile), any(), any(),
-                anyInt(),
-                argThat(dexoptOptions -> dexoptOptions.generateAppImage == generateAppImage),
-                any());
+                anyInt(), argThat(dexoptOptions -> dexoptOptions.generateAppImage == true), any());
     }
 
     private void checkDexoptWithNoProfile(
@@ -751,6 +772,10 @@
                 .doesNotContain(profile);
     }
 
+    private void verifyEmbeddedProfileNotUsed(String dexPath) throws Exception {
+        assertThat(mUsedEmbeddedProfiles).doesNotContain(dexPath);
+    }
+
     private void makeProfileUsable(ProfilePath profile) throws Exception {
         lenient().when(mArtd.isProfileUsable(deepEq(profile), any())).thenAnswer(invocation -> {
             mUsedProfiles.add(invocation.<ProfilePath>getArgument(0));
@@ -764,11 +789,13 @@
                 });
     }
 
-    private void makeProfileNotUsable(ProfilePath profile) throws Exception {
-        lenient().when(mArtd.isProfileUsable(deepEq(profile), any())).thenReturn(false);
+    private void makeEmbeddedProfileUsable(String dexPath) throws Exception {
         lenient()
-                .when(mArtd.copyAndRewriteProfile(deepEq(profile), any(), any()))
-                .thenReturn(TestingUtils.createCopyAndRewriteProfileNoProfile());
+                .when(mArtd.copyAndRewriteEmbeddedProfile(any(), eq(dexPath)))
+                .thenAnswer(invocation -> {
+                    mUsedEmbeddedProfiles.add(invocation.<String>getArgument(1));
+                    return TestingUtils.createCopyAndRewriteProfileSuccess();
+                });
     }
 
     private void verifyStatusAllOk(List<DexContainerFileDexoptResult> results) {
diff --git a/libartservice/service/javatests/com/android/server/art/PrimaryDexopterTestBase.java b/libartservice/service/javatests/com/android/server/art/PrimaryDexopterTestBase.java
index df1527e..7a8287f 100644
--- a/libartservice/service/javatests/com/android/server/art/PrimaryDexopterTestBase.java
+++ b/libartservice/service/javatests/com/android/server/art/PrimaryDexopterTestBase.java
@@ -16,8 +16,6 @@
 
 package com.android.server.art;
 
-import static com.android.server.art.GetDexoptNeededResult.ArtifactsLocation;
-
 import static org.mockito.Mockito.any;
 import static org.mockito.Mockito.anyBoolean;
 import static org.mockito.Mockito.argThat;
@@ -33,6 +31,7 @@
 import android.os.storage.StorageManager;
 
 import com.android.modules.utils.pm.PackageStateModulesUtils;
+import com.android.server.art.model.Config;
 import com.android.server.art.testing.StaticMockitoRule;
 import com.android.server.pm.pkg.AndroidPackage;
 import com.android.server.pm.pkg.AndroidPackageSplit;
@@ -70,9 +69,17 @@
     protected PackageUserState mPkgUserStateNotInstalled;
     protected PackageUserState mPkgUserStateInstalled;
     protected CancellationSignal mCancellationSignal;
+    protected Config mConfig;
 
     @Before
     public void setUp() throws Exception {
+        mPkgUserStateNotInstalled = createPackageUserState(false /* installed */);
+        mPkgUserStateInstalled = createPackageUserState(true /* installed */);
+        mPkgState = createPackageState();
+        mPkg = mPkgState.getAndroidPackage();
+        mCancellationSignal = new CancellationSignal();
+        mConfig = new Config();
+
         lenient().when(mInjector.getArtd()).thenReturn(mArtd);
         lenient().when(mInjector.isSystemUiPackage(any())).thenReturn(false);
         lenient().when(mInjector.isLauncherPackage(any())).thenReturn(false);
@@ -80,6 +87,7 @@
         lenient().when(mInjector.getDexUseManager()).thenReturn(mDexUseManager);
         lenient().when(mInjector.getStorageManager()).thenReturn(mStorageManager);
         lenient().when(mInjector.getArtVersion()).thenReturn(ART_VERSION);
+        lenient().when(mInjector.getConfig()).thenReturn(mConfig);
 
         lenient()
                 .when(SystemProperties.get("dalvik.vm.systemuicompilerfilter"))
@@ -106,30 +114,24 @@
         lenient().when(mDexUseManager.isPrimaryDexUsedByOtherApps(any(), any())).thenReturn(false);
 
         lenient().when(mStorageManager.getAllocatableBytes(any())).thenReturn(1l);
-
-        mPkgUserStateNotInstalled = createPackageUserState(false /* installed */);
-        mPkgUserStateInstalled = createPackageUserState(true /* installed */);
-        mPkgState = createPackageState();
-        mPkg = mPkgState.getAndroidPackage();
-        mCancellationSignal = new CancellationSignal();
     }
 
     private AndroidPackage createPackage() {
         // This package has the base APK and one split APK that has code.
         AndroidPackage pkg = mock(AndroidPackage.class);
         var baseSplit = mock(AndroidPackageSplit.class);
-        lenient().when(baseSplit.getPath()).thenReturn("/data/app/foo/base.apk");
+        lenient().when(baseSplit.getPath()).thenReturn("/somewhere/app/foo/base.apk");
         lenient().when(baseSplit.isHasCode()).thenReturn(true);
         lenient().when(baseSplit.getClassLoaderName()).thenReturn(PathClassLoader.class.getName());
 
         var split0 = mock(AndroidPackageSplit.class);
         lenient().when(split0.getName()).thenReturn("split_0");
-        lenient().when(split0.getPath()).thenReturn("/data/app/foo/split_0.apk");
+        lenient().when(split0.getPath()).thenReturn("/somewhere/app/foo/split_0.apk");
         lenient().when(split0.isHasCode()).thenReturn(true);
 
         var split1 = mock(AndroidPackageSplit.class);
         lenient().when(split1.getName()).thenReturn("split_1");
-        lenient().when(split1.getPath()).thenReturn("/data/app/foo/split_1.apk");
+        lenient().when(split1.getPath()).thenReturn("/somewhere/app/foo/split_1.apk");
         lenient().when(split1.isHasCode()).thenReturn(false);
 
         var splits = List.of(baseSplit, split0, split1);
diff --git a/libartservice/service/javatests/com/android/server/art/SecondaryDexopterTest.java b/libartservice/service/javatests/com/android/server/art/SecondaryDexopterTest.java
index 85d2983..f80503d 100644
--- a/libartservice/service/javatests/com/android/server/art/SecondaryDexopterTest.java
+++ b/libartservice/service/javatests/com/android/server/art/SecondaryDexopterTest.java
@@ -16,8 +16,7 @@
 
 package com.android.server.art;
 
-import static com.android.server.art.DexUseManagerLocal.DetailedSecondaryDexInfo;
-import static com.android.server.art.GetDexoptNeededResult.ArtifactsLocation;
+import static com.android.server.art.DexUseManagerLocal.CheckedSecondaryDexInfo;
 import static com.android.server.art.OutputArtifacts.PermissionSettings;
 import static com.android.server.art.model.DexoptResult.DexContainerFileDexoptResult;
 import static com.android.server.art.testing.TestingUtils.deepEq;
@@ -44,6 +43,7 @@
 import androidx.test.runner.AndroidJUnit4;
 
 import com.android.server.art.model.ArtFlags;
+import com.android.server.art.model.Config;
 import com.android.server.art.model.DexoptParams;
 import com.android.server.art.model.DexoptResult;
 import com.android.server.art.testing.StaticMockitoRule;
@@ -106,11 +106,17 @@
     private PackageState mPkgState;
     private AndroidPackage mPkg;
     private CancellationSignal mCancellationSignal;
+    protected Config mConfig;
 
     private SecondaryDexopter mSecondaryDexopter;
 
     @Before
     public void setUp() throws Exception {
+        mPkgState = createPackageState();
+        mPkg = mPkgState.getAndroidPackage();
+        mCancellationSignal = new CancellationSignal();
+        mConfig = new Config();
+
         lenient()
                 .when(SystemProperties.getBoolean(eq("dalvik.vm.always_debuggable"), anyBoolean()))
                 .thenReturn(false);
@@ -130,16 +136,14 @@
         lenient().when(mInjector.isSystemUiPackage(any())).thenReturn(false);
         lenient().when(mInjector.isLauncherPackage(any())).thenReturn(false);
         lenient().when(mInjector.getDexUseManager()).thenReturn(mDexUseManager);
+        lenient().when(mInjector.getConfig()).thenReturn(mConfig);
 
-        List<DetailedSecondaryDexInfo> secondaryDexInfo = createSecondaryDexInfo();
+        List<CheckedSecondaryDexInfo> secondaryDexInfo = createSecondaryDexInfo();
         lenient()
-                .when(mDexUseManager.getFilteredDetailedSecondaryDexInfo(eq(PKG_NAME)))
+                .when(mDexUseManager.getCheckedSecondaryDexInfo(
+                        eq(PKG_NAME), eq(true) /* excludeObsoleteDexesAndLoaders */))
                 .thenReturn(secondaryDexInfo);
 
-        mPkgState = createPackageState();
-        mPkg = mPkgState.getAndroidPackage();
-        mCancellationSignal = new CancellationSignal();
-
         prepareProfiles();
 
         // Dexopt is always needed and successful.
@@ -236,33 +240,33 @@
         return pkgState;
     }
 
-    private List<DetailedSecondaryDexInfo> createSecondaryDexInfo() throws Exception {
+    private List<CheckedSecondaryDexInfo> createSecondaryDexInfo() throws Exception {
         // This should be compiled with profile.
-        var dex1Info = mock(DetailedSecondaryDexInfo.class);
+        var dex1Info = mock(CheckedSecondaryDexInfo.class);
         lenient().when(dex1Info.dexPath()).thenReturn(DEX_1);
         lenient().when(dex1Info.userHandle()).thenReturn(USER_HANDLE);
         lenient().when(dex1Info.classLoaderContext()).thenReturn("CLC_FOR_DEX_1");
         lenient().when(dex1Info.abiNames()).thenReturn(Set.of("arm64-v8a"));
         lenient().when(dex1Info.isUsedByOtherApps()).thenReturn(false);
-        lenient().when(dex1Info.isDexFilePublic()).thenReturn(true);
+        lenient().when(dex1Info.fileVisibility()).thenReturn(FileVisibility.OTHER_READABLE);
 
         // This should be compiled without profile because it's used by other apps.
-        var dex2Info = mock(DetailedSecondaryDexInfo.class);
+        var dex2Info = mock(CheckedSecondaryDexInfo.class);
         lenient().when(dex2Info.dexPath()).thenReturn(DEX_2);
         lenient().when(dex2Info.userHandle()).thenReturn(USER_HANDLE);
         lenient().when(dex2Info.classLoaderContext()).thenReturn("CLC_FOR_DEX_2");
         lenient().when(dex2Info.abiNames()).thenReturn(Set.of("arm64-v8a", "armeabi-v7a"));
         lenient().when(dex2Info.isUsedByOtherApps()).thenReturn(true);
-        lenient().when(dex2Info.isDexFilePublic()).thenReturn(true);
+        lenient().when(dex2Info.fileVisibility()).thenReturn(FileVisibility.OTHER_READABLE);
 
         // This should be compiled with verify because the class loader context is invalid.
-        var dex3Info = mock(DetailedSecondaryDexInfo.class);
+        var dex3Info = mock(CheckedSecondaryDexInfo.class);
         lenient().when(dex3Info.dexPath()).thenReturn(DEX_3);
         lenient().when(dex3Info.userHandle()).thenReturn(USER_HANDLE);
         lenient().when(dex3Info.classLoaderContext()).thenReturn(null);
         lenient().when(dex3Info.abiNames()).thenReturn(Set.of("arm64-v8a"));
         lenient().when(dex3Info.isUsedByOtherApps()).thenReturn(false);
-        lenient().when(dex3Info.isDexFilePublic()).thenReturn(false);
+        lenient().when(dex3Info.fileVisibility()).thenReturn(FileVisibility.NOT_OTHER_READABLE);
 
         return List.of(dex1Info, dex2Info, dex3Info);
     }
@@ -285,6 +289,11 @@
                 .thenReturn(FileVisibility.NOT_OTHER_READABLE);
 
         lenient().when(mArtd.mergeProfiles(any(), any(), any(), any(), any())).thenReturn(true);
+
+        // By default, none of the embedded profiles are usable.
+        lenient()
+                .when(mArtd.copyAndRewriteEmbeddedProfile(any(), any()))
+                .thenReturn(TestingUtils.createCopyAndRewriteProfileNoProfile());
     }
 
     private GetDexoptNeededResult dexoptIsNeeded() {
@@ -313,7 +322,7 @@
                 dexPath, isa, false /* isInDalvikCache */, permissionSettings);
         artd.dexopt(deepEq(outputArtifacts), eq(dexPath), eq(isa), eq(classLoaderContext),
                 eq("speed-profile"), deepEq(profile), any(), isNull() /* dmFile */, anyInt(),
-                argThat(dexoptOptions -> dexoptOptions.generateAppImage == false), any());
+                argThat(dexoptOptions -> dexoptOptions.generateAppImage == true), any());
     }
 
     private void checkDexoptWithNoProfile(IArtd artd, String dexPath, String isa,
diff --git a/libartservice/service/javatests/com/android/server/art/testing/MockClock.java b/libartservice/service/javatests/com/android/server/art/testing/MockClock.java
index 7b4b23b..fb77f09 100644
--- a/libartservice/service/javatests/com/android/server/art/testing/MockClock.java
+++ b/libartservice/service/javatests/com/android/server/art/testing/MockClock.java
@@ -50,6 +50,11 @@
         }
     }
 
+    @NonNull
+    public List<ScheduledExecutor> getCreatedExecutors() {
+        return mExecutors;
+    }
+
     public class ScheduledExecutor extends ScheduledThreadPoolExecutor {
         // The second element of the pair is the scheduled time.
         @NonNull
diff --git a/libarttools/Android.bp b/libarttools/Android.bp
index 5c0f1f2..2c036fb 100644
--- a/libarttools/Android.bp
+++ b/libarttools/Android.bp
@@ -23,27 +23,23 @@
     default_applicable_licenses: ["art_license"],
 }
 
-cc_defaults {
-    // This library contains low-level interfaces used to call dex2oat and related tools. This will
-    // allow other libraries or programs besides the ART Service to make use of this functionality.
-
-    name: "libarttools_defaults",
+// This library contains low-level interfaces used to call dex2oat and related tools. This will
+// allow other libraries or programs besides the ART Service to make use of this functionality.
+cc_library {
+    name: "libarttools",
     defaults: ["art_defaults"],
     host_supported: true,
     srcs: [
-        "tools/tools.cc",
+        "tools.cc",
     ],
-    export_include_dirs: ["."],
+    export_include_dirs: ["include"],
     header_libs: ["art_libartbase_headers"],
     shared_libs: [
         "libbase",
     ],
-    export_shared_lib_headers: ["libbase"],
-}
-
-cc_library {
-    name: "libarttools",
-    defaults: ["libarttools_defaults"],
+    export_shared_lib_headers: [
+        "libbase",
+    ],
     whole_static_libs: [
         // TODO(b/270049598): Investigate the cost of libc++fs compared to its utility.
         "libc++fs",
@@ -56,12 +52,11 @@
 
 art_cc_defaults {
     name: "art_libarttools_tests_defaults",
-    defaults: ["libarttools_defaults"],
     srcs: [
-        "tools/art_exec_test.cc",
-        "tools/cmdline_builder_test.cc",
-        "tools/system_properties_test.cc",
-        "tools/tools_test.cc",
+        "art_exec_test.cc",
+        "cmdline_builder_test.cc",
+        "system_properties_test.cc",
+        "tools_test.cc",
     ],
     shared_libs: [
         "libbase",
@@ -84,6 +79,9 @@
         "art_gtest_defaults",
         "art_libarttools_tests_defaults",
     ],
+    shared_libs: [
+        "libarttools",
+    ],
 }
 
 // Standalone version of ART gtest `art_libarttools_tests`, not bundled with the ART APEX on
@@ -94,6 +92,9 @@
         "art_standalone_gtest_defaults",
         "art_libarttools_tests_defaults",
     ],
+    static_libs: [
+        "libarttools",
+    ],
 }
 
 cc_binary {
@@ -102,7 +103,7 @@
         "art_defaults",
     ],
     srcs: [
-        "tools/art_exec.cc",
+        "art_exec.cc",
     ],
     shared_libs: [
         "libartbase",
diff --git a/libarttools/tools/art_exec.cc b/libarttools/art_exec.cc
similarity index 95%
rename from libarttools/tools/art_exec.cc
rename to libarttools/art_exec.cc
index 8f33658..a382342 100644
--- a/libarttools/tools/art_exec.cc
+++ b/libarttools/art_exec.cc
@@ -79,6 +79,7 @@
   bool drop_capabilities = false;
   std::unordered_set<int> keep_fds{fileno(stdin), fileno(stdout), fileno(stderr)};
   std::unordered_map<std::string, std::string> envs;
+  std::string chroot;
 };
 
 [[noreturn]] void Usage(const std::string& error_msg) {
@@ -122,6 +123,8 @@
       }
       options.envs[std::string(arg.substr(/*pos=*/0, /*n=*/pos))] =
           std::string(arg.substr(pos + 1));
+    } else if (ConsumePrefix(&arg, "--chroot=")) {
+      options.chroot = arg;
     } else if (arg == "--") {
       if (i + 1 >= argc) {
         Usage("Missing command after '--'");
@@ -214,6 +217,13 @@
     setenv(key.c_str(), value.c_str(), /*overwrite=*/1);
   }
 
+  if (!options.chroot.empty()) {
+    if (chroot(options.chroot.c_str()) != 0) {
+      PLOG(ERROR) << ART_FORMAT("Failed to chroot to '{}'", options.chroot);
+      return kErrorOther;
+    }
+  }
+
   execv(argv[options.command_pos], argv + options.command_pos);
 
   std::vector<const char*> command_args(argv + options.command_pos, argv + argc);
diff --git a/libarttools/tools/art_exec_test.cc b/libarttools/art_exec_test.cc
similarity index 100%
rename from libarttools/tools/art_exec_test.cc
rename to libarttools/art_exec_test.cc
diff --git a/libarttools/tools/cmdline_builder_test.cc b/libarttools/cmdline_builder_test.cc
similarity index 97%
rename from libarttools/tools/cmdline_builder_test.cc
rename to libarttools/cmdline_builder_test.cc
index 5551860..1acf2e3 100644
--- a/libarttools/tools/cmdline_builder_test.cc
+++ b/libarttools/cmdline_builder_test.cc
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "cmdline_builder.h"
+#include "tools/cmdline_builder.h"
 
 #include <utility>
 
@@ -127,6 +127,7 @@
 
   args_.Concat(std::move(other));
   EXPECT_THAT(args_.Get(), ElementsAre("--flag1", "--flag2", "--flag3", "--flag4"));
+  // NOLINTNEXTLINE - checking all args have been moved from other to args_
   EXPECT_THAT(other.Get(), IsEmpty());
 }
 
diff --git a/libarttools/tools/cmdline_builder.h b/libarttools/include/tools/cmdline_builder.h
similarity index 96%
rename from libarttools/tools/cmdline_builder.h
rename to libarttools/include/tools/cmdline_builder.h
index fd11ee8..4f3727b 100644
--- a/libarttools/tools/cmdline_builder.h
+++ b/libarttools/include/tools/cmdline_builder.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_LIBARTTOOLS_TOOLS_CMDLINE_BUILDER_H_
-#define ART_LIBARTTOOLS_TOOLS_CMDLINE_BUILDER_H_
+#ifndef ART_LIBARTTOOLS_INCLUDE_TOOLS_CMDLINE_BUILDER_H_
+#define ART_LIBARTTOOLS_INCLUDE_TOOLS_CMDLINE_BUILDER_H_
 
 #include <algorithm>
 #include <iterator>
@@ -153,4 +153,4 @@
 }  // namespace tools
 }  // namespace art
 
-#endif  // ART_LIBARTTOOLS_TOOLS_CMDLINE_BUILDER_H_
+#endif  // ART_LIBARTTOOLS_INCLUDE_TOOLS_CMDLINE_BUILDER_H_
diff --git a/libarttools/tools/system_properties.h b/libarttools/include/tools/system_properties.h
similarity index 95%
rename from libarttools/tools/system_properties.h
rename to libarttools/include/tools/system_properties.h
index 06b7bcb..af5aea4 100644
--- a/libarttools/tools/system_properties.h
+++ b/libarttools/include/tools/system_properties.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_LIBARTTOOLS_TOOLS_SYSTEM_PROPERTIES_H_
-#define ART_LIBARTTOOLS_TOOLS_SYSTEM_PROPERTIES_H_
+#ifndef ART_LIBARTTOOLS_INCLUDE_TOOLS_SYSTEM_PROPERTIES_H_
+#define ART_LIBARTTOOLS_INCLUDE_TOOLS_SYSTEM_PROPERTIES_H_
 
 #include <string>
 
@@ -101,4 +101,4 @@
 }  // namespace tools
 }  // namespace art
 
-#endif  // ART_LIBARTTOOLS_TOOLS_SYSTEM_PROPERTIES_H_
+#endif  // ART_LIBARTTOOLS_INCLUDE_TOOLS_SYSTEM_PROPERTIES_H_
diff --git a/libarttools/tools/tools.h b/libarttools/include/tools/tools.h
similarity index 83%
rename from libarttools/tools/tools.h
rename to libarttools/include/tools/tools.h
index c2bcee7..1bf47e4 100644
--- a/libarttools/tools/tools.h
+++ b/libarttools/include/tools/tools.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_LIBARTTOOLS_TOOLS_TOOLS_H_
-#define ART_LIBARTTOOLS_TOOLS_TOOLS_H_
+#ifndef ART_LIBARTTOOLS_INCLUDE_TOOLS_TOOLS_H_
+#define ART_LIBARTTOOLS_INCLUDE_TOOLS_TOOLS_H_
 
 #include <string>
 #include <string_view>
@@ -37,7 +37,10 @@
 std::vector<std::string> Glob(const std::vector<std::string>& patterns,
                               std::string_view root_dir = "/");
 
+// Escapes a string so that it's not recognized as a wildcard pattern for `Glob`.
+std::string EscapeGlob(const std::string& str);
+
 }  // namespace tools
 }  // namespace art
 
-#endif  // ART_LIBARTTOOLS_TOOLS_TOOLS_H_
+#endif  // ART_LIBARTTOOLS_INCLUDE_TOOLS_TOOLS_H_
diff --git a/libarttools/tools/system_properties_test.cc b/libarttools/system_properties_test.cc
similarity index 98%
rename from libarttools/tools/system_properties_test.cc
rename to libarttools/system_properties_test.cc
index 80300f0..acffd97 100644
--- a/libarttools/tools/system_properties_test.cc
+++ b/libarttools/system_properties_test.cc
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "system_properties.h"
+#include "tools/system_properties.h"
 
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
diff --git a/libarttools/tools/tools.cc b/libarttools/tools.cc
similarity index 96%
rename from libarttools/tools/tools.cc
rename to libarttools/tools.cc
index 4ec9d9a..a72217e 100644
--- a/libarttools/tools/tools.cc
+++ b/libarttools/tools.cc
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "tools.h"
+#include "tools/tools.h"
 
 #include <errno.h>
 #include <fnmatch.h>
@@ -22,6 +22,7 @@
 #include <algorithm>
 #include <filesystem>
 #include <functional>
+#include <regex>
 #include <string>
 #include <string_view>
 #include <system_error>
@@ -138,5 +139,9 @@
   return results;
 }
 
+std::string EscapeGlob(const std::string& str) {
+  return std::regex_replace(str, std::regex(R"re(\*|\?|\[)re"), "[$&]");
+}
+
 }  // namespace tools
 }  // namespace art
diff --git a/libarttools/tools/tools_test.cc b/libarttools/tools_test.cc
similarity index 78%
rename from libarttools/tools/tools_test.cc
rename to libarttools/tools_test.cc
index 2f61181..ca39c94 100644
--- a/libarttools/tools/tools_test.cc
+++ b/libarttools/tools_test.cc
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "tools.h"
+#include "tools/tools.h"
 
 #include <algorithm>
 #include <filesystem>
@@ -110,6 +110,37 @@
                                    scratch_path_ + "/abc/aaa/bbb/pqr/ccc/ddd/123.txt"));
 }
 
+TEST_F(ArtToolsTest, EscapeGlob) {
+  CreateFile(scratch_path_ + "/**");
+  CreateFile(scratch_path_ + "/*.txt");
+  CreateFile(scratch_path_ + "/?.txt");
+  CreateFile(scratch_path_ + "/[a-z].txt");
+  CreateFile(scratch_path_ + "/**.txt");
+  CreateFile(scratch_path_ + "/??.txt");
+  CreateFile(scratch_path_ + "/[a-z[a-z]][a-z].txt");
+
+  // Paths that shouldn't be matched if the paths above are escaped.
+  CreateFile(scratch_path_ + "/abc/b.txt");
+  CreateFile(scratch_path_ + "/b.txt");
+  CreateFile(scratch_path_ + "/*b.txt");
+  CreateFile(scratch_path_ + "/?b.txt");
+  CreateFile(scratch_path_ + "/[a-zb]b.txt");
+
+  // Verifies that the escaped path only matches the given path.
+  auto verify_escape = [this](const std::string& file) {
+    EXPECT_THAT(Glob({EscapeGlob(file)}, scratch_path_), UnorderedElementsAre(file));
+  };
+
+  verify_escape(scratch_path_ + "/**");
+  verify_escape(scratch_path_ + "/*.txt");
+  verify_escape(scratch_path_ + "/?.txt");
+  verify_escape(scratch_path_ + "/[a-z].txt");
+  verify_escape(scratch_path_ + "/**.txt");
+  verify_escape(scratch_path_ + "/**");
+  verify_escape(scratch_path_ + "/??.txt");
+  verify_escape(scratch_path_ + "/[a-z[a-z]][a-z].txt");
+}
+
 }  // namespace
 }  // namespace tools
 }  // namespace art
diff --git a/libdexfile/Android.bp b/libdexfile/Android.bp
index 73f93a6..b51456c 100644
--- a/libdexfile/Android.bp
+++ b/libdexfile/Android.bp
@@ -173,6 +173,7 @@
         // dependency - see comment for libdexfile_support. It shouldn't be used
         // for any other purpose.
         "//external/perfetto",
+        "//frameworks/base/services/core/jni",
         "//system/core/debuggerd",
         "//system/extras/simpleperf",
         "//system/unwinding/libunwindstack",
@@ -287,18 +288,21 @@
         "dex/compact_dex_file_test.cc",
         "dex/compact_offset_table_test.cc",
         "dex/descriptors_names_test.cc",
-        "dex/test_dex_file_builder_test.cc",
         "dex/dex_file_loader_test.cc",
         "dex/dex_file_verifier_test.cc",
         "dex/dex_instruction_test.cc",
+        "dex/fuzzer_corpus_test.cc",
         "dex/primitive_test.cc",
+        "dex/proto_reference_test.cc",
         "dex/string_reference_test.cc",
+        "dex/test_dex_file_builder_test.cc",
         "dex/type_lookup_table_test.cc",
         "dex/utf_test.cc",
     ],
     data: [
         ":art-gtest-jars-GetMethodSignature",
         ":art-gtest-jars-Lookup",
+        ":art-gtest-jars-DexFuzzerFolder",
         ":art-gtest-jars-Main",
         ":art-gtest-jars-MainEmptyUncompressed",
         ":art-gtest-jars-MultiDex",
@@ -306,12 +310,8 @@
         ":art-gtest-jars-VerifierDeps",
     ],
     header_libs: ["jni_headers"],
-    static_libs: [
-        "libziparchive",
-    ],
     shared_libs: [
         "libunwindstack",
-        "libz", // libziparchive dependency; must be repeated here since it's a static lib.
     ],
 }
 
@@ -401,9 +401,6 @@
         "art_test_defaults",
         "art_libdexfile_external_tests_defaults",
     ],
-    shared_libs: [
-        "libartbase",
-    ],
 }
 
 // Standalone version of ART gtest `art_libdexfile_external_tests`, not bundled with the ART APEX on
@@ -414,9 +411,6 @@
         "art_standalone_test_defaults",
         "art_libdexfile_external_tests_defaults",
     ],
-    static_libs: [
-        "libartbase",
-    ],
 
     test_config_template: ":art-gtests-target-standalone-cts-template",
     test_suites: ["cts"], // For backed-by API coverage.
@@ -458,8 +452,6 @@
         "//apex_available:platform",
         "com.android.art",
         "com.android.art.debug",
-        "com.android.media",
-        "com.android.media.swcodec",
         "com.android.runtime",
     ],
 }
@@ -474,7 +466,6 @@
         "external/dex_file_supp_test.cc",
     ],
     shared_libs: [
-        "libartbase",
         "libbase",
         "libdexfile",
         "liblog",
diff --git a/libdexfile/art_standalone_libdexfile_tests.xml b/libdexfile/art_standalone_libdexfile_tests.xml
index 0a19f6d..4f18d8a 100644
--- a/libdexfile/art_standalone_libdexfile_tests.xml
+++ b/libdexfile/art_standalone_libdexfile_tests.xml
@@ -15,6 +15,7 @@
 -->
 <configuration description="Runs art_standalone_libdexfile_tests.">
     <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
         <option name="cleanup" value="true" />
         <option name="push" value="art_standalone_libdexfile_tests->/data/local/tmp/art_standalone_libdexfile_tests/art_standalone_libdexfile_tests" />
@@ -30,13 +31,12 @@
         <option name="push" value="art-gtest-jars-MultiDex.jar->/data/local/tmp/art_standalone_libdexfile_tests/art-gtest-jars-MultiDex.jar" />
         <option name="push" value="art-gtest-jars-Nested.jar->/data/local/tmp/art_standalone_libdexfile_tests/art-gtest-jars-Nested.jar" />
         <option name="push" value="art-gtest-jars-VerifierDeps.dex->/data/local/tmp/art_standalone_libdexfile_tests/art-gtest-jars-VerifierDeps.dex" />
+        <option name="push" value="fuzzer_corpus.zip->/data/local/tmp/art_standalone_libdexfile_tests/fuzzer_corpus.zip" />
     </target_preparer>
 
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp/art_standalone_libdexfile_tests" />
         <option name="module-name" value="art_standalone_libdexfile_tests" />
-        <option name="ld-library-path-32" value="/apex/com.android.art/lib" />
-        <option name="ld-library-path-64" value="/apex/com.android.art/lib64" />
     </test>
 
     <!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
diff --git a/libdexfile/dex/art_dex_file_loader.cc b/libdexfile/dex/art_dex_file_loader.cc
index ac52ca0..056d2fb 100644
--- a/libdexfile/dex/art_dex_file_loader.cc
+++ b/libdexfile/dex/art_dex_file_loader.cc
@@ -37,88 +37,6 @@
 
 namespace art {
 
-using android::base::StringPrintf;
-
-bool ArtDexFileLoader::GetMultiDexChecksums(const char* filename,
-                                            std::vector<uint32_t>* checksums,
-                                            std::vector<std::string>* dex_locations,
-                                            std::string* error_msg,
-                                            int zip_fd,
-                                            bool* zip_file_only_contains_uncompressed_dex) {
-  CHECK(checksums != nullptr);
-  uint32_t magic;
-
-  File fd;
-  if (zip_fd != -1) {
-     if (ReadMagicAndReset(zip_fd, &magic, error_msg)) {
-       fd = File(DupCloexec(zip_fd), /* check_usage= */ false);
-     }
-  } else {
-    fd = OpenAndReadMagic(filename, &magic, error_msg);
-  }
-  if (fd.Fd() == -1) {
-    DCHECK(!error_msg->empty());
-    return false;
-  }
-  if (IsZipMagic(magic)) {
-    std::unique_ptr<ZipArchive> zip_archive(
-        ZipArchive::OpenFromFd(fd.Release(), filename, error_msg));
-    if (zip_archive.get() == nullptr) {
-      *error_msg = StringPrintf("Failed to open zip archive '%s' (error msg: %s)", filename,
-                                error_msg->c_str());
-      return false;
-    }
-
-    if (zip_file_only_contains_uncompressed_dex != nullptr) {
-      // Start by assuming everything is uncompressed.
-      *zip_file_only_contains_uncompressed_dex = true;
-    }
-
-    uint32_t idx = 0;
-    std::string zip_entry_name = GetMultiDexClassesDexName(idx);
-    std::unique_ptr<ZipEntry> zip_entry(zip_archive->Find(zip_entry_name.c_str(), error_msg));
-    if (zip_entry.get() == nullptr) {
-      // A zip file with no dex code should be accepted. It's likely a config split APK, which we
-      // are currently passing from higher levels.
-      VLOG(dex) << StringPrintf("Zip archive '%s' doesn't contain %s (error msg: %s)",
-                                filename,
-                                zip_entry_name.c_str(),
-                                error_msg->c_str());
-      return true;
-    }
-
-    do {
-      if (zip_file_only_contains_uncompressed_dex != nullptr) {
-        if (!(zip_entry->IsUncompressed() && zip_entry->IsAlignedTo(alignof(DexFile::Header)))) {
-          *zip_file_only_contains_uncompressed_dex = false;
-        }
-      }
-      checksums->push_back(zip_entry->GetCrc32());
-      dex_locations->push_back(GetMultiDexLocation(idx, filename));
-      zip_entry_name = GetMultiDexClassesDexName(++idx);
-      zip_entry.reset(zip_archive->Find(zip_entry_name.c_str(), error_msg));
-    } while (zip_entry.get() != nullptr);
-    return true;
-  }
-  if (IsMagicValid(magic)) {
-    ArtDexFileLoader loader(fd.Release(), filename);
-    std::vector<std::unique_ptr<const DexFile>> dex_files;
-    if (!loader.Open(/* verify= */ false,
-                     /* verify_checksum= */ false,
-                     error_msg,
-                     &dex_files)) {
-      return false;
-    }
-    for (auto& dex_file : dex_files) {
-      checksums->push_back(dex_file->GetHeader().checksum_);
-      dex_locations->push_back(dex_file->GetLocation());
-    }
-    return true;
-  }
-  *error_msg = StringPrintf("Expected valid zip or dex file: '%s'", filename);
-  return false;
-}
-
 std::unique_ptr<const DexFile> ArtDexFileLoader::Open(
     const uint8_t* base,
     size_t size,
diff --git a/libdexfile/dex/art_dex_file_loader.h b/libdexfile/dex/art_dex_file_loader.h
index 9f2ae82..2fbc2cb 100644
--- a/libdexfile/dex/art_dex_file_loader.h
+++ b/libdexfile/dex/art_dex_file_loader.h
@@ -36,31 +36,8 @@
 // Class that is used to open dex files and deal with corresponding multidex and location logic.
 class ArtDexFileLoader : public DexFileLoader {
  public:
-  using DexFileLoader::DexFileLoader;
-  virtual ~ArtDexFileLoader() { }
-
-  // Returns the checksums of a file for comparison with GetLocationChecksum().
-  // For .dex files, this is the single header checksum.
-  // For zip files, this is the zip entry CRC32 checksum for classes.dex and
-  // each additional multidex entry classes2.dex, classes3.dex, etc.
-  // If a valid zip_fd is provided the file content will be read directly from
-  // the descriptor and `filename` will be used as alias for error logging. If
-  // zip_fd is -1, the method will try to open the `filename` and read the
-  // content from it.
-  //
-  // The dex_locations vector will be populated with the corresponding multidex
-  // locations.
-  //
-  // Return true if the checksums could be found, false otherwise.
-  static bool GetMultiDexChecksums(const char* filename,
-                                   std::vector<uint32_t>* checksums,
-                                   std::vector<std::string>* dex_locations,
-                                   std::string* error_msg,
-                                   int zip_fd = -1,
-                                   bool* only_contains_uncompressed_dex = nullptr);
-
-  // Don't shadow overloads from base class.
-  using DexFileLoader::Open;
+  using DexFileLoader::DexFileLoader;  // Use constructors from base class.
+  using DexFileLoader::Open;           // Don't shadow overloads from base class.
 
   // Old signature preserved for app-compat.
   std::unique_ptr<const DexFile> Open(const uint8_t* base,
diff --git a/libdexfile/dex/art_dex_file_loader_test.cc b/libdexfile/dex/art_dex_file_loader_test.cc
index d8911ec..23ffad6 100644
--- a/libdexfile/dex/art_dex_file_loader_test.cc
+++ b/libdexfile/dex/art_dex_file_loader_test.cc
@@ -19,6 +19,8 @@
 #include <sys/mman.h>
 
 #include <memory>
+#include <optional>
+#include <vector>
 
 #include "base/common_art_test.h"
 #include "base/mem_map.h"
@@ -29,8 +31,8 @@
 #include "dex/class_accessor-inl.h"
 #include "dex/code_item_accessors-inl.h"
 #include "dex/descriptors_names.h"
-#include "dex/dex_file.h"
 #include "dex/dex_file-inl.h"
+#include "dex/dex_file.h"
 #include "dex/dex_file_loader.h"
 
 namespace art {
@@ -63,7 +65,7 @@
   ASSERT_GE(file.Fd(), 0);
   std::vector<std::unique_ptr<const DexFile>> dex_files;
   std::string error_msg;
-  ArtDexFileLoader dex_file_loader(file.Release(), zip_file);
+  ArtDexFileLoader dex_file_loader(&file, zip_file);
   ASSERT_TRUE(dex_file_loader.Open(/*verify=*/false,
                                    /*verify_checksum=*/true,
                                    /*allow_no_dex_files=*/true,
@@ -79,7 +81,7 @@
   ASSERT_GE(file.Fd(), 0);
   std::vector<std::unique_ptr<const DexFile>> dex_files;
   std::string error_msg;
-  ArtDexFileLoader dex_file_loader(file.Release(), zip_file);
+  ArtDexFileLoader dex_file_loader(&file, zip_file);
   ASSERT_TRUE(dex_file_loader.Open(/*verify=*/false,
                                    /*verify_checksum=*/true,
                                    /*allow_no_dex_files=*/true,
@@ -95,65 +97,50 @@
 }
 
 TEST_F(ArtDexFileLoaderTest, GetChecksum) {
-  std::vector<uint32_t> checksums;
-  std::vector<std::string> dex_locations;
+  std::optional<uint32_t> checksum;
   std::string error_msg;
-  EXPECT_TRUE(ArtDexFileLoader::GetMultiDexChecksums(
-      GetLibCoreDexFileNames()[0].c_str(), &checksums, &dex_locations, &error_msg))
-      << error_msg;
-  ASSERT_EQ(1U, checksums.size());
-  ASSERT_EQ(1U, dex_locations.size());
-  EXPECT_EQ(java_lang_dex_file_->GetLocationChecksum(), checksums[0]);
-  EXPECT_EQ(java_lang_dex_file_->GetLocation(), dex_locations[0]);
+  ArtDexFileLoader dex_loader(GetLibCoreDexFileNames()[0]);
+  ASSERT_TRUE(dex_loader.GetMultiDexChecksum(&checksum, &error_msg)) << error_msg;
+  ASSERT_TRUE(checksum.has_value());
+
+  std::vector<const DexFile*> dex_files{java_lang_dex_file_};
+  uint32_t expected_checksum = DexFileLoader::GetMultiDexChecksum(dex_files);
+  EXPECT_EQ(expected_checksum, checksum.value());
 }
 
-TEST_F(ArtDexFileLoaderTest, GetMultiDexChecksums) {
+TEST_F(ArtDexFileLoaderTest, GetMultiDexChecksum) {
   std::string error_msg;
-  std::vector<uint32_t> checksums;
-  std::vector<std::string> dex_locations;
+  std::optional<uint32_t> checksum;
   std::string multidex_file = GetTestDexFileName("MultiDex");
-  EXPECT_TRUE(ArtDexFileLoader::GetMultiDexChecksums(
-      multidex_file.c_str(), &checksums, &dex_locations, &error_msg))
-      << error_msg;
+  ArtDexFileLoader dex_loader(multidex_file);
+  EXPECT_TRUE(dex_loader.GetMultiDexChecksum(&checksum, &error_msg)) << error_msg;
 
   std::vector<std::unique_ptr<const DexFile>> dexes = OpenTestDexFiles("MultiDex");
   ASSERT_EQ(2U, dexes.size());
-  ASSERT_EQ(2U, checksums.size());
-  ASSERT_EQ(2U, dex_locations.size());
+  ASSERT_TRUE(checksum.has_value());
 
+  uint32_t expected_checksum = DexFileLoader::GetMultiDexChecksum(dexes);
   EXPECT_EQ(dexes[0]->GetLocation(), DexFileLoader::GetMultiDexLocation(0, multidex_file.c_str()));
-  EXPECT_EQ(dexes[0]->GetLocation(), dex_locations[0]);
-  EXPECT_EQ(dexes[0]->GetLocationChecksum(), checksums[0]);
-
   EXPECT_EQ(dexes[1]->GetLocation(), DexFileLoader::GetMultiDexLocation(1, multidex_file.c_str()));
-  EXPECT_EQ(dexes[1]->GetLocation(), dex_locations[1]);
-  EXPECT_EQ(dexes[1]->GetLocationChecksum(), checksums[1]);
+  EXPECT_EQ(expected_checksum, checksum.value());
 }
 
 TEST_F(ArtDexFileLoaderTest, GetMultiDexChecksumsEmptyZip) {
   std::string error_msg;
-  std::vector<uint32_t> checksums;
-  std::vector<std::string> dex_locations;
+  std::optional<uint32_t> checksum;
   std::string multidex_file = GetTestDexFileName("MainEmptyUncompressed");
-  EXPECT_TRUE(ArtDexFileLoader::GetMultiDexChecksums(
-      multidex_file.c_str(), &checksums, &dex_locations, &error_msg))
-      << error_msg;
-
-  EXPECT_EQ(dex_locations.size(), 0);
-  EXPECT_EQ(checksums.size(), 0);
+  ArtDexFileLoader dex_loader(multidex_file);
+  EXPECT_TRUE(dex_loader.GetMultiDexChecksum(&checksum, &error_msg)) << error_msg;
+  EXPECT_FALSE(checksum.has_value());
 }
 
 TEST_F(ArtDexFileLoaderTest, GetMultiDexChecksumsDexFile) {
   std::string error_msg;
-  std::vector<uint32_t> checksums;
-  std::vector<std::string> dex_locations;
+  std::optional<uint32_t> checksum;
   std::string multidex_file = GetTestDexFileName("VerifierDeps");  // This is a .dex file.
-  EXPECT_TRUE(ArtDexFileLoader::GetMultiDexChecksums(
-      multidex_file.c_str(), &checksums, &dex_locations, &error_msg))
-      << error_msg;
-
-  EXPECT_EQ(dex_locations.size(), 1);
-  EXPECT_EQ(checksums.size(), 1);
+  DexFileLoader loader(multidex_file);
+  EXPECT_TRUE(loader.GetMultiDexChecksum(&checksum, &error_msg)) << error_msg;
+  EXPECT_TRUE(checksum.has_value());
 }
 
 TEST_F(ArtDexFileLoaderTest, ClassDefs) {
diff --git a/libdexfile/dex/class_accessor.h b/libdexfile/dex/class_accessor.h
index a3ee2bd..401195c 100644
--- a/libdexfile/dex/class_accessor.h
+++ b/libdexfile/dex/class_accessor.h
@@ -18,6 +18,7 @@
 #define ART_LIBDEXFILE_DEX_CLASS_ACCESSOR_H_
 
 #include "code_item_accessors.h"
+#include "dex/dex_file.h"
 #include "dex_file_types.h"
 #include "invoke_type.h"
 #include "modifiers.h"
@@ -177,11 +178,13 @@
   };
 
   template <typename DataType>
-  class DataIterator : public std::iterator<std::forward_iterator_tag, DataType> {
+  class DataIterator {
    public:
-    using value_type = typename std::iterator<std::forward_iterator_tag, DataType>::value_type;
-    using difference_type =
-        typename std::iterator<std::forward_iterator_tag, value_type>::difference_type;
+    using iterator_category = std::forward_iterator_tag;
+    using value_type = DataType;
+    using difference_type = ptrdiff_t;
+    using pointer = value_type*;
+    using reference = value_type&;
 
     DataIterator(const DexFile& dex_file,
                  uint32_t position,
@@ -279,7 +282,7 @@
 
   ClassAccessor(const DexFile& dex_file,
                 const uint8_t* class_data,
-                uint32_t class_def_index = dex::kDexNoIndex,
+                uint32_t class_def_index = DexFile::kDexNoIndex32,
                 bool parse_hiddenapi_class_data = false);
 
   // Return the code item for a method.
diff --git a/libdexfile/dex/class_iterator.h b/libdexfile/dex/class_iterator.h
index 8ed585b..c7817f7 100644
--- a/libdexfile/dex/class_iterator.h
+++ b/libdexfile/dex/class_iterator.h
@@ -41,10 +41,13 @@
 };
 
 // Iterator for visiting classes in a Dex file.
-class ClassIterator : public std::iterator<std::forward_iterator_tag, ClassIteratorData> {
+class ClassIterator {
  public:
-  using value_type = std::iterator<std::forward_iterator_tag, ClassIteratorData>::value_type;
-  using difference_type = std::iterator<std::forward_iterator_tag, value_type>::difference_type;
+  using iterator_category = std::forward_iterator_tag;
+  using value_type = ClassIteratorData;
+  using difference_type = ptrdiff_t;
+  using pointer = void;
+  using reference = void;
 
   ClassIterator(const DexFile& dex_file, uint32_t class_def_idx)
       : data_(dex_file, class_def_idx) {}
diff --git a/libdexfile/dex/code_item_accessors-inl.h b/libdexfile/dex/code_item_accessors-inl.h
index 1e33002..4586a0f 100644
--- a/libdexfile/dex/code_item_accessors-inl.h
+++ b/libdexfile/dex/code_item_accessors-inl.h
@@ -178,8 +178,7 @@
 
 template <>
 inline void CodeItemDebugInfoAccessor::Init<StandardDexFile::CodeItem>(
-    const StandardDexFile::CodeItem& code_item,
-    uint32_t dex_method_index ATTRIBUTE_UNUSED) {
+    const StandardDexFile::CodeItem& code_item, [[maybe_unused]] uint32_t dex_method_index) {
   debug_info_offset_ = code_item.debug_info_off_;
   CodeItemDataAccessor::Init(code_item);
 }
@@ -203,20 +202,22 @@
 inline bool CodeItemDebugInfoAccessor::DecodeDebugLocalInfo(
     bool is_static,
     uint32_t method_idx,
-    const NewLocalVisitor& new_local) const {
+    NewLocalVisitor&& new_local) const {
   return dex_file_->DecodeDebugLocalInfo(RegistersSize(),
                                          InsSize(),
                                          InsnsSizeInCodeUnits(),
                                          DebugInfoOffset(),
                                          is_static,
                                          method_idx,
-                                         new_local);
+                                         std::forward<NewLocalVisitor>(new_local));
 }
 
 template <typename Visitor>
-inline uint32_t CodeItemDebugInfoAccessor::VisitParameterNames(const Visitor& visitor) const {
+inline uint32_t CodeItemDebugInfoAccessor::VisitParameterNames(Visitor&& visitor) const {
   const uint8_t* stream = dex_file_->GetDebugInfoStream(DebugInfoOffset());
-  return (stream != nullptr) ? DexFile::DecodeDebugInfoParameterNames(&stream, visitor) : 0u;
+  return (stream != nullptr) ?
+             DexFile::DecodeDebugInfoParameterNames(&stream, std::forward<Visitor>(visitor)) :
+             0u;
 }
 
 inline bool CodeItemDebugInfoAccessor::GetLineNumForPc(const uint32_t address,
@@ -234,13 +235,13 @@
 }
 
 template <typename Visitor>
-inline bool CodeItemDebugInfoAccessor::DecodeDebugPositionInfo(const Visitor& visitor) const {
+inline bool CodeItemDebugInfoAccessor::DecodeDebugPositionInfo(Visitor&& visitor) const {
   return dex_file_->DecodeDebugPositionInfo(
       dex_file_->GetDebugInfoStream(DebugInfoOffset()),
       [this](uint32_t idx) {
         return dex_file_->StringDataByIdx(dex::StringIndex(idx));
       },
-      visitor);
+      std::forward<Visitor>(visitor));
 }
 
 }  // namespace art
diff --git a/libdexfile/dex/code_item_accessors.h b/libdexfile/dex/code_item_accessors.h
index 24296c8..5952b2d 100644
--- a/libdexfile/dex/code_item_accessors.h
+++ b/libdexfile/dex/code_item_accessors.h
@@ -164,15 +164,15 @@
   template<typename NewLocalVisitor>
   bool DecodeDebugLocalInfo(bool is_static,
                             uint32_t method_idx,
-                            const NewLocalVisitor& new_local) const;
+                            NewLocalVisitor&& new_local) const;
 
   // Visit each parameter in the debug information. Returns the line number.
   // The argument of the Visitor is dex::StringIndex.
   template <typename Visitor>
-  uint32_t VisitParameterNames(const Visitor& visitor) const;
+  uint32_t VisitParameterNames(Visitor&& visitor) const;
 
   template <typename Visitor>
-  bool DecodeDebugPositionInfo(const Visitor& visitor) const;
+  bool DecodeDebugPositionInfo(Visitor&& visitor) const;
 
   bool GetLineNumForPc(const uint32_t pc, uint32_t* line_num) const;
 
diff --git a/libdexfile/dex/code_item_accessors_test.cc b/libdexfile/dex/code_item_accessors_test.cc
index 7cb2fe0..a815d06 100644
--- a/libdexfile/dex/code_item_accessors_test.cc
+++ b/libdexfile/dex/code_item_accessors_test.cc
@@ -20,6 +20,7 @@
 #include <memory>
 #include <vector>
 
+#include "base/mem_map.h"
 #include "dex_file_loader.h"
 #include "gtest/gtest.h"
 
@@ -28,12 +29,12 @@
 class CodeItemAccessorsTest : public testing::Test {};
 
 std::unique_ptr<const DexFile> CreateFakeDex(bool compact_dex, std::vector<uint8_t>* data) {
-  data->resize(kPageSize);
+  data->resize(MemMap::GetPageSize());
   if (compact_dex) {
     CompactDexFile::Header* header =
         const_cast<CompactDexFile::Header*>(CompactDexFile::Header::At(data->data()));
-    CompactDexFile::WriteMagic(header->magic_);
-    CompactDexFile::WriteCurrentVersion(header->magic_);
+    CompactDexFile::WriteMagic(header->magic_.data());
+    CompactDexFile::WriteCurrentVersion(header->magic_.data());
     header->data_off_ = 0;
     header->data_size_ = data->size();
     header->file_size_ = data->size();
@@ -41,6 +42,7 @@
     auto* header = reinterpret_cast<DexFile::Header*>(data->data());
     StandardDexFile::WriteMagic(data->data());
     StandardDexFile::WriteCurrentVersion(data->data());
+    header->header_size_ = sizeof(*header);
     header->file_size_ = data->size();
   }
   DexFileLoader dex_file_loader(data->data(), data->size(), "location");
diff --git a/libdexfile/dex/compact_dex_file.cc b/libdexfile/dex/compact_dex_file.cc
index 9c7000f..9bc38f3 100644
--- a/libdexfile/dex/compact_dex_file.cc
+++ b/libdexfile/dex/compact_dex_file.cc
@@ -45,9 +45,7 @@
   return IsMagicValid(header_->magic_);
 }
 
-bool CompactDexFile::IsVersionValid() const {
-  return IsVersionValid(header_->magic_);
-}
+bool CompactDexFile::IsVersionValid() const { return IsVersionValid(header_->magic_.data()); }
 
 bool CompactDexFile::SupportsDefaultMethods() const {
   return (GetHeader().GetFeatureFlags() &
@@ -84,13 +82,11 @@
 }
 
 CompactDexFile::CompactDexFile(const uint8_t* base,
-                               size_t size,
                                const std::string& location,
                                uint32_t location_checksum,
                                const OatDexFile* oat_dex_file,
                                std::shared_ptr<DexFileContainer> container)
     : DexFile(base,
-              size,
               location,
               location_checksum,
               oat_dex_file,
diff --git a/libdexfile/dex/compact_dex_file.h b/libdexfile/dex/compact_dex_file.h
index 22f6c20..468ff49 100644
--- a/libdexfile/dex/compact_dex_file.h
+++ b/libdexfile/dex/compact_dex_file.h
@@ -273,6 +273,7 @@
 
   // Returns true if the byte string points to the magic value.
   static bool IsMagicValid(const uint8_t* magic);
+  static bool IsMagicValid(DexFile::Magic magic) { return IsMagicValid(magic.data()); }
   bool IsMagicValid() const override;
 
   // Returns true if the byte string after the magic is the correct value.
@@ -305,7 +306,6 @@
 
  private:
   CompactDexFile(const uint8_t* base,
-                 size_t size,
                  const std::string& location,
                  uint32_t location_checksum,
                  const OatDexFile* oat_dex_file,
diff --git a/libdexfile/dex/dex_file-inl.h b/libdexfile/dex/dex_file-inl.h
index cc2f641..b01b004 100644
--- a/libdexfile/dex/dex_file-inl.h
+++ b/libdexfile/dex/dex_file-inl.h
@@ -180,6 +180,10 @@
   return StringDataAndUtf16LengthByIdx(GetProtoId(method_id.proto_idx_).shorty_idx_, length);
 }
 
+inline std::string_view DexFile::GetMethodShortyView(const dex::MethodId& method_id) const {
+  return GetShortyView(method_id.proto_idx_);
+}
+
 inline const char* DexFile::GetClassDescriptor(const dex::ClassDef& class_def) const {
   return StringByTypeIdx(class_def.class_idx_);
 }
@@ -194,12 +198,16 @@
 }
 
 ALWAYS_INLINE
+inline std::string_view DexFile::GetShortyView(dex::ProtoIndex proto_idx) const {
+  return GetShortyView(GetProtoId(proto_idx));
+}
+
+ALWAYS_INLINE
 inline std::string_view DexFile::GetShortyView(const dex::ProtoId& proto_id) const {
-  uint32_t lhs_shorty_len;
-  const char* lhs_shorty_data =
-      StringDataAndUtf16LengthByIdx(proto_id.shorty_idx_, &lhs_shorty_len);
-  DCHECK_EQ(lhs_shorty_data[lhs_shorty_len], '\0');  // For a shorty utf16 length == mutf8 length.
-  return std::string_view(lhs_shorty_data, lhs_shorty_len);
+  uint32_t shorty_len;
+  const char* shorty_data = StringDataAndUtf16LengthByIdx(proto_id.shorty_idx_, &shorty_len);
+  DCHECK_EQ(shorty_data[shorty_len], '\0');  // For a shorty utf16 length == mutf8 length.
+  return std::string_view(shorty_data, shorty_len);
 }
 
 inline const dex::TryItem* DexFile::GetTryItems(const DexInstructionIterator& code_item_end,
@@ -419,8 +427,8 @@
 
 template<typename DexDebugNewPosition, typename IndexToStringData>
 bool DexFile::DecodeDebugPositionInfo(const uint8_t* stream,
-                                      const IndexToStringData& index_to_string_data,
-                                      const DexDebugNewPosition& position_functor) {
+                                      IndexToStringData&& index_to_string_data,
+                                      DexDebugNewPosition&& position_functor) {
   if (stream == nullptr) {
     return false;
   }
@@ -506,7 +514,7 @@
 // Returns the line number
 template <typename Visitor>
 inline uint32_t DexFile::DecodeDebugInfoParameterNames(const uint8_t** debug_info,
-                                                       const Visitor& visitor) {
+                                                       Visitor&& visitor) {
   uint32_t line = DecodeUnsignedLeb128(debug_info);
   const uint32_t parameters_size = DecodeUnsignedLeb128(debug_info);
   for (uint32_t i = 0; i < parameters_size; ++i) {
diff --git a/libdexfile/dex/dex_file.cc b/libdexfile/dex/dex_file.cc
index 882bbfe..464d050 100644
--- a/libdexfile/dex/dex_file.cc
+++ b/libdexfile/dex/dex_file.cc
@@ -23,17 +23,18 @@
 #include <zlib.h>
 
 #include <memory>
+#include <optional>
 #include <ostream>
 #include <sstream>
 #include <type_traits>
 
 #include "android-base/stringprintf.h"
-
 #include "base/enums.h"
 #include "base/hiddenapi_domain.h"
 #include "base/leb128.h"
 #include "base/stl_util.h"
 #include "class_accessor-inl.h"
+#include "compact_dex_file.h"
 #include "descriptors_names.h"
 #include "dex_file-inl.h"
 #include "standard_dex_file.h"
@@ -61,6 +62,13 @@
 static_assert(sizeof(dex::TypeIndex) == sizeof(uint16_t), "TypeIndex size is wrong");
 static_assert(std::is_trivially_copyable<dex::TypeIndex>::value, "TypeIndex not trivial");
 
+// Print the SHA1 as 20-byte hexadecimal string.
+std::string DexFile::Sha1::ToString() const {
+  auto data = this->data();
+  auto part = [d = data](int i) { return d[i] << 24 | d[i + 1] << 16 | d[i + 2] << 8 | d[i + 3]; };
+  return StringPrintf("%08x%08x%08x%08x%08x", part(0), part(4), part(8), part(12), part(16));
+}
+
 uint32_t DexFile::CalculateChecksum() const {
   return CalculateChecksum(Begin(), Size());
 }
@@ -89,25 +97,75 @@
   return container_->DisableWrite();
 }
 
+uint32_t DexFile::Header::GetExpectedHeaderSize() const {
+  uint32_t version = GetVersion();
+  return version == 0 ? 0 : version < 41 ? sizeof(Header) : sizeof(HeaderV41);
+}
+
+bool DexFile::Header::HasDexContainer() const {
+  if (CompactDexFile::IsMagicValid(magic_.data())) {
+    return false;
+  }
+  DCHECK_EQ(header_size_, GetExpectedHeaderSize());
+  return header_size_ >= sizeof(HeaderV41);
+}
+
+uint32_t DexFile::Header::HeaderOffset() const {
+  return HasDexContainer() ? reinterpret_cast<const HeaderV41*>(this)->header_offset_ : 0;
+}
+
+uint32_t DexFile::Header::ContainerSize() const {
+  return HasDexContainer() ? reinterpret_cast<const HeaderV41*>(this)->container_size_ : file_size_;
+}
+
+void DexFile::Header::SetDexContainer(size_t header_offset, size_t container_size) {
+  if (HasDexContainer()) {
+    DCHECK_LE(header_offset, container_size);
+    DCHECK_LE(file_size_, container_size - header_offset);
+    data_off_ = 0;
+    data_size_ = 0;
+    auto* headerV41 = reinterpret_cast<HeaderV41*>(this);
+    DCHECK_GE(header_size_, sizeof(*headerV41));
+    headerV41->header_offset_ = header_offset;
+    headerV41->container_size_ = container_size;
+  } else {
+    DCHECK_EQ(header_offset, 0u);
+    DCHECK_EQ(container_size, file_size_);
+  }
+}
+
+template <typename T>
+ALWAYS_INLINE const T* DexFile::GetSection(const uint32_t* offset, DexFileContainer* container) {
+  size_t size = container->End() - begin_;
+  if (size < sizeof(Header)) {
+    return nullptr;  // Invalid dex file.
+  }
+  // Compact dex is inconsistent: section offsets are relative to the
+  // header as opposed to the data section like all other its offsets.
+  if (CompactDexFile::IsMagicValid(begin_)) {
+    const uint8_t* data = reinterpret_cast<const uint8_t*>(header_);
+    return reinterpret_cast<const T*>(data + *offset);
+  }
+  return reinterpret_cast<const T*>(data_.data() + *offset);
+}
+
 DexFile::DexFile(const uint8_t* base,
-                 size_t size,
                  const std::string& location,
                  uint32_t location_checksum,
                  const OatDexFile* oat_dex_file,
                  std::shared_ptr<DexFileContainer> container,
                  bool is_compact_dex)
     : begin_(base),
-      size_(size),
-      data_(GetDataRange(base, size, container.get())),
+      data_(GetDataRange(base, container.get())),
       location_(location),
       location_checksum_(location_checksum),
       header_(reinterpret_cast<const Header*>(base)),
-      string_ids_(reinterpret_cast<const StringId*>(base + header_->string_ids_off_)),
-      type_ids_(reinterpret_cast<const TypeId*>(base + header_->type_ids_off_)),
-      field_ids_(reinterpret_cast<const FieldId*>(base + header_->field_ids_off_)),
-      method_ids_(reinterpret_cast<const MethodId*>(base + header_->method_ids_off_)),
-      proto_ids_(reinterpret_cast<const ProtoId*>(base + header_->proto_ids_off_)),
-      class_defs_(reinterpret_cast<const ClassDef*>(base + header_->class_defs_off_)),
+      string_ids_(GetSection<StringId>(&header_->string_ids_off_, container.get())),
+      type_ids_(GetSection<TypeId>(&header_->type_ids_off_, container.get())),
+      field_ids_(GetSection<FieldId>(&header_->field_ids_off_, container.get())),
+      method_ids_(GetSection<MethodId>(&header_->method_ids_off_, container.get())),
+      proto_ids_(GetSection<ProtoId>(&header_->proto_ids_off_, container.get())),
+      class_defs_(GetSection<ClassDef>(&header_->class_defs_off_, container.get())),
       method_handles_(nullptr),
       num_method_handles_(0),
       call_site_ids_(nullptr),
@@ -118,7 +176,6 @@
       is_compact_dex_(is_compact_dex),
       hiddenapi_domain_(hiddenapi::Domain::kApplication) {
   CHECK(begin_ != nullptr) << GetLocation();
-  CHECK_GT(size_, 0U) << GetLocation();
   // Check base (=header) alignment.
   // Must be 4-byte aligned to avoid undefined behavior when accessing
   // any of the sections via a pointer.
@@ -150,6 +207,16 @@
   if (!CheckMagicAndVersion(error_msg)) {
     return false;
   }
+  if (!IsCompactDexFile()) {
+    uint32_t expected_header_size = header_->GetExpectedHeaderSize();
+    if (header_->header_size_ != expected_header_size) {
+      *error_msg = StringPrintf("Unable to open '%s' : Header size is %u but %u was expected",
+                                location_.c_str(),
+                                header_->header_size_,
+                                expected_header_size);
+      return false;
+    }
+  }
   if (container_size < header_->file_size_) {
     *error_msg = StringPrintf("Unable to open '%s' : File size is %zu but the header expects %u",
                               location_.c_str(),
@@ -184,11 +251,23 @@
   return true;
 }
 
-ArrayRef<const uint8_t> DexFile::GetDataRange(const uint8_t* data,
-                                              size_t size,
-                                              DexFileContainer* container) {
+ArrayRef<const uint8_t> DexFile::GetDataRange(const uint8_t* data, DexFileContainer* container) {
+  // NB: This function must survive random data to pass fuzzing and testing.
   CHECK(container != nullptr);
-  if (size >= sizeof(CompactDexFile::Header) && CompactDexFile::IsMagicValid(data)) {
+  CHECK_GE(data, container->Begin());
+  CHECK_LE(data, container->End());
+  size_t size = container->End() - data;
+  if (size >= sizeof(StandardDexFile::Header) && StandardDexFile::IsMagicValid(data)) {
+    auto header = reinterpret_cast<const DexFile::Header*>(data);
+    CHECK_EQ(container->Data().size(), 0u) << "Unsupported for standard dex";
+    if (size >= sizeof(HeaderV41) && header->header_size_ >= sizeof(HeaderV41)) {
+      auto headerV41 = reinterpret_cast<const DexFile::HeaderV41*>(data);
+      data -= headerV41->header_offset_;  // Allow underflow and later overflow.
+      size = headerV41->container_size_;
+    } else {
+      size = header->file_size_;
+    }
+  } else if (size >= sizeof(CompactDexFile::Header) && CompactDexFile::IsMagicValid(data)) {
     auto header = reinterpret_cast<const CompactDexFile::Header*>(data);
     // TODO: Remove. This is a hack. See comment of the Data method.
     ArrayRef<const uint8_t> separate_data = container->Data();
@@ -196,39 +275,49 @@
       return separate_data;
     }
     // Shared compact dex data is located at the end after all dex files.
-    data += header->data_off_;
+    data += std::min<size_t>(header->data_off_, size);
     size = header->data_size_;
   }
-  return {data, size};
+  // The returned range is guaranteed to be in bounds of the container memory.
+  return {data, std::min<size_t>(size, container->End() - data)};
 }
 
 void DexFile::InitializeSectionsFromMapList() {
+  // NB: This function must survive random data to pass fuzzing and testing.
   static_assert(sizeof(MapList) <= sizeof(Header));
   DCHECK_GE(DataSize(), sizeof(MapList));
   if (header_->map_off_ == 0 || header_->map_off_ > DataSize() - sizeof(MapList)) {
     // Bad offset. The dex file verifier runs after this method and will reject the file.
     return;
   }
-  const MapList* map_list = reinterpret_cast<const MapList*>(DataBegin() + header_->map_off_);
+  const uint8_t* map_list_raw = DataBegin() + header_->map_off_;
+  if (map_list_raw < Begin()) {
+    return;
+  }
+  const MapList* map_list = reinterpret_cast<const MapList*>(map_list_raw);
   const size_t count = map_list->size_;
 
-  size_t map_limit = header_->map_off_ + count * sizeof(MapItem);
-  if (header_->map_off_ >= map_limit || map_limit > DataSize()) {
-    // Overflow or out out of bounds. The dex file verifier runs after
+  size_t map_limit =
+      (DataSize() - OFFSETOF_MEMBER(MapList, list_) - header_->map_off_) / sizeof(MapItem);
+  if (count > map_limit) {
+    // Too many items. The dex file verifier runs after
     // this method and will reject the file as it is malformed.
     return;
   }
 
+  // Construct pointers to certain arrays without any checks. If they are outside the
+  // data, the dex file verification should fail and these pointers should not be used.
   for (size_t i = 0; i < count; ++i) {
     const MapItem& map_item = map_list->list_[i];
     if (map_item.type_ == kDexTypeMethodHandleItem) {
-      method_handles_ = reinterpret_cast<const MethodHandleItem*>(Begin() + map_item.offset_);
+      method_handles_ = GetSection<MethodHandleItem>(&map_item.offset_, container_.get());
       num_method_handles_ = map_item.size_;
     } else if (map_item.type_ == kDexTypeCallSiteIdItem) {
-      call_site_ids_ = reinterpret_cast<const CallSiteIdItem*>(Begin() + map_item.offset_);
+      call_site_ids_ = GetSection<CallSiteIdItem>(&map_item.offset_, container_.get());
       num_call_site_ids_ = map_item.size_;
     } else if (map_item.type_ == kDexTypeHiddenapiClassData) {
-      hiddenapi_class_data_ = GetHiddenapiClassDataAtOffset(map_item.offset_);
+      hiddenapi_class_data_ =
+          reinterpret_cast<const dex::HiddenapiClassData*>(DataBegin() + map_item.offset_);
     } else {
       // Pointers to other sections are not necessary to retain in the DexFile struct.
       // Other items have pointers directly into their data.
@@ -650,14 +739,15 @@
       type_(kByte) {
   array_size_ = (ptr_ != nullptr) ? DecodeUnsignedLeb128(&ptr_) : 0;
   if (array_size_ > 0) {
-    Next();
+    bool ok [[maybe_unused]] = MaybeNext();
   }
 }
 
-void EncodedArrayValueIterator::Next() {
+bool EncodedArrayValueIterator::MaybeNext() {
   pos_++;
   if (pos_ >= array_size_) {
-    return;
+    type_ = kEndOfInput;
+    return true;
   }
   uint8_t value_type = *ptr_++;
   uint8_t value_arg = value_type >> kEncodedValueArgShift;
@@ -703,17 +793,16 @@
   case kEnum:
   case kArray:
   case kAnnotation:
-    UNIMPLEMENTED(FATAL) << ": type " << type_;
-    UNREACHABLE();
+    return false;
   case kNull:
     jval_.l = nullptr;
     width = 0;
     break;
   default:
-    LOG(FATAL) << "Unreached";
-    UNREACHABLE();
+    return false;
   }
   ptr_ += width;
+  return true;
 }
 
 namespace dex {
diff --git a/libdexfile/dex/dex_file.h b/libdexfile/dex/dex_file.h
index 1d1b016..6bc6e4f 100644
--- a/libdexfile/dex/dex_file.h
+++ b/libdexfile/dex/dex_file.h
@@ -19,6 +19,7 @@
 
 #include <android-base/logging.h>
 
+#include <array>
 #include <memory>
 #include <optional>
 #include <string>
@@ -56,8 +57,9 @@
 // Owns the physical storage that backs one or more DexFiles (that is, it can be shared).
 // It frees the storage (e.g. closes file) when all DexFiles that use it are all closed.
 //
-// The Begin()-End() range represents exactly one DexFile (with the size from the header).
-// In particular, the End() does NOT include any shared cdex data from other DexFiles.
+// The memory range must include all data used by the DexFiles including any shared data.
+//
+// It might also include surrounding non-dex data (e.g. it might represent vdex file).
 class DexFileContainer {
  public:
   DexFileContainer() { }
@@ -114,6 +116,8 @@
   static constexpr size_t kDexMagicSize = 4;
   static constexpr size_t kDexVersionLen = 4;
 
+  static constexpr uint32_t kDexContainerVersion = 41;
+
   // First Dex format version enforcing class definition ordering rules.
   static constexpr uint32_t kClassDefinitionOrderEnforcedVersion = 37;
 
@@ -124,11 +128,19 @@
   static constexpr uint16_t kDexNoIndex16 = 0xFFFF;
   static constexpr uint32_t kDexNoIndex32 = 0xFFFFFFFF;
 
+  using Magic = std::array<uint8_t, 8>;
+
+  struct Sha1 : public std::array<uint8_t, kSha1DigestSize> {
+    std::string ToString() const;
+  };
+
+  static_assert(std::is_standard_layout_v<Sha1>);
+
   // Raw header_item.
   struct Header {
-    uint8_t magic_[8] = {};
+    Magic magic_ = {};
     uint32_t checksum_ = 0;  // See also location_checksum_
-    uint8_t signature_[kSha1DigestSize] = {};
+    Sha1 signature_ = {};
     uint32_t file_size_ = 0;  // size of entire file
     uint32_t header_size_ = 0;  // offset to start of next section
     uint32_t endian_tag_ = 0;
@@ -152,6 +164,29 @@
 
     // Decode the dex magic version
     uint32_t GetVersion() const;
+
+    // Get the header_size that is expected for this version.
+    uint32_t GetExpectedHeaderSize() const;
+
+    // Returns true for standard DEX version 41 or newer.
+    bool HasDexContainer() const;
+
+    // Returns offset of this header within the container.
+    // Returns 0 for older dex versions without container.
+    uint32_t HeaderOffset() const;
+
+    // Returns size of the whole container.
+    // Returns file_size_ for older dex versions without container.
+    uint32_t ContainerSize() const;
+
+    // Set the DEX container fields to the given values.
+    // Must be [0, file_size_) for older dex versions.
+    void SetDexContainer(size_t header_offset, size_t container_size);
+  };
+
+  struct HeaderV41 : public Header {
+    uint32_t container_size_ = 0;  // total size of all dex files in the container.
+    uint32_t header_offset_ = 0;   // offset of this dex's header in the container.
   };
 
   // Map item type codes.
@@ -245,6 +280,8 @@
     return location_checksum_;
   }
 
+  Sha1 GetSha1() const { return header_->signature_; }
+
   const Header& GetHeader() const {
     DCHECK(header_ != nullptr) << GetLocation();
     return *header_;
@@ -255,6 +292,20 @@
     return GetHeader().GetVersion();
   }
 
+  // Returns true if this is DEX V41 or later (i.e. supports container).
+  // Returns true even if the container contains just a single DEX file.
+  bool HasDexContainer() const { return GetHeader().HasDexContainer(); }
+
+  // Returns the whole memory range of the DEX V41 container.
+  // Returns just the range of the DEX file for V40 or older.
+  ArrayRef<const uint8_t> GetDexContainerRange() const {
+    return {Begin() - header_->HeaderOffset(), header_->ContainerSize()};
+  }
+
+  bool IsDexContainerFirstEntry() const { return Begin() == GetDexContainerRange().begin(); }
+
+  bool IsDexContainerLastEntry() const { return End() == GetDexContainerRange().end(); }
+
   // Returns true if the byte string points to the magic value.
   virtual bool IsMagicValid() const = 0;
 
@@ -453,6 +504,7 @@
   // Returns the shorty of a method id.
   const char* GetMethodShorty(const dex::MethodId& method_id) const;
   const char* GetMethodShorty(const dex::MethodId& method_id, uint32_t* length) const;
+  std::string_view GetMethodShortyView(const dex::MethodId& method_id) const;
 
   // Returns the number of class definitions in the .dex file.
   uint32_t NumClassDefs() const {
@@ -547,6 +599,7 @@
 
   // Returns the short form method descriptor for the given prototype.
   const char* GetShorty(dex::ProtoIndex proto_idx) const;
+  std::string_view GetShortyView(dex::ProtoIndex proto_idx) const;
   std::string_view GetShortyView(const dex::ProtoId& proto_id) const;
 
   const dex::TypeList* GetProtoParameters(const dex::ProtoId& proto_id) const {
@@ -734,8 +787,8 @@
   // Returns false if there is no debugging information or if it cannot be decoded.
   template<typename DexDebugNewPosition, typename IndexToStringData>
   static bool DecodeDebugPositionInfo(const uint8_t* stream,
-                                      const IndexToStringData& index_to_string_data,
-                                      const DexDebugNewPosition& position_functor);
+                                      IndexToStringData&& index_to_string_data,
+                                      DexDebugNewPosition&& position_functor);
 
   const char* GetSourceFile(const dex::ClassDef& class_def) const {
     if (!class_def.source_file_idx_.IsValid()) {
@@ -751,17 +804,15 @@
 
   bool DisableWrite() const;
 
-  const uint8_t* Begin() const {
-    return begin_;
-  }
+  const uint8_t* Begin() const { return begin_; }
 
-  size_t Size() const {
-    return size_;
-  }
+  const uint8_t* End() const { return Begin() + Size(); }
 
-  static ArrayRef<const uint8_t> GetDataRange(const uint8_t* data,
-                                              size_t size,
-                                              DexFileContainer* container);
+  size_t Size() const { return header_->file_size_; }
+
+  size_t SizeIncludingSharedData() const { return GetDexContainerRange().end() - Begin(); }
+
+  static ArrayRef<const uint8_t> GetDataRange(const uint8_t* data, DexFileContainer* container);
 
   const uint8_t* DataBegin() const { return data_.data(); }
 
@@ -836,15 +887,13 @@
     return DataBegin() <= addr && addr < DataBegin() + DataSize();
   }
 
-  DexFileContainer* GetContainer() const {
-    return container_.get();
-  }
+  const std::shared_ptr<DexFileContainer>& GetContainer() const { return container_; }
 
   IterationRange<ClassIterator> GetClasses() const;
 
   template <typename Visitor>
   static uint32_t DecodeDebugInfoParameterNames(const uint8_t** debug_info,
-                                                const Visitor& visitor);
+                                                Visitor&& visitor);
 
   static inline bool StringEquals(const DexFile* df1, dex::StringIndex sidx1,
                                   const DexFile* df2, dex::StringIndex sidx2);
@@ -854,7 +903,6 @@
   static constexpr uint32_t kDefaultMethodsVersion = 37;
 
   DexFile(const uint8_t* base,
-          size_t size,
           const std::string& location,
           uint32_t location_checksum,
           const OatDexFile* oat_dex_file,
@@ -862,6 +910,9 @@
           std::shared_ptr<DexFileContainer> container,
           bool is_compact_dex);
 
+  template <typename T>
+  const T* GetSection(const uint32_t* offset, DexFileContainer* container);
+
   // Top-level initializer that calls other Init methods.
   bool Init(std::string* error_msg);
 
@@ -874,17 +925,27 @@
   // The base address of the memory mapping.
   const uint8_t* const begin_;
 
-  // The size of the underlying memory allocation in bytes.
-  const size_t size_;
+  size_t unused_size_ = 0;  // Preserve layout for DRM (b/305203031).
 
   // Data memory range: Most dex offsets are relative to this memory range.
   // Standard dex: same as (begin_, size_).
+  // Dex container: all dex files (starting from the first header).
   // Compact: shared data which is located after all non-shared data.
   //
   // This is different to the "data section" in the standard dex header.
   ArrayRef<const uint8_t> const data_;
 
-  // Typically the dex file name when available, alternatively some identifying string.
+  // The full absolute path to the dex file, if it was loaded from disk.
+  //
+  // Can also be a path to a multidex container (typically apk), followed by
+  // DexFileLoader.kMultiDexSeparator (i.e. '!') and the file inside the
+  // container.
+  //
+  // On host this may not be an absolute path.
+  //
+  // On device libnativeloader uses this to determine the location of the java
+  // package or shared library, which decides where to load native libraries
+  // from.
   //
   // The ClassLinker will use this to match DexFiles the boot class
   // path to DexCache::GetLocation when loading from an image.
@@ -985,7 +1046,12 @@
 
   bool HasNext() const { return pos_ < array_size_; }
 
-  void Next();
+  WARN_UNUSED bool MaybeNext();
+
+  ALWAYS_INLINE void Next() {
+    bool ok = MaybeNext();
+    DCHECK(ok) << "Unknown type: " << GetValueType();
+  }
 
   enum ValueType {
     kByte         = 0x00,
@@ -1006,6 +1072,7 @@
     kAnnotation   = 0x1d,
     kNull         = 0x1e,
     kBoolean      = 0x1f,
+    kEndOfInput   = 0xff,
   };
 
   ValueType GetValueType() const { return type_; }
diff --git a/libdexfile/dex/dex_file_loader.cc b/libdexfile/dex/dex_file_loader.cc
index d375aac..daefa2f 100644
--- a/libdexfile/dex/dex_file_loader.cc
+++ b/libdexfile/dex/dex_file_loader.cc
@@ -89,7 +89,11 @@
   bool IsReadOnly() const override { return GetPermissions() == PROT_READ; }
 
   bool EnableWrite() override {
-    CHECK(IsReadOnly());
+    if (!IsReadOnly()) {
+      // We can already write to the container.
+      // This method may be called multiple times by tests if DexFiles share container.
+      return true;
+    }
     if (!mem_map_.IsValid()) {
       return false;
     } else {
@@ -120,6 +124,8 @@
 
 }  // namespace
 
+const File DexFileLoader::kInvalidFile;
+
 bool DexFileLoader::IsMagicValid(uint32_t magic) {
   return IsMagicValid(reinterpret_cast<uint8_t*>(&magic));
 }
@@ -139,8 +145,8 @@
   return false;
 }
 
-bool DexFileLoader::IsMultiDexLocation(const char* location) {
-  return strrchr(location, kMultiDexSeparator) != nullptr;
+bool DexFileLoader::IsMultiDexLocation(std::string_view location) {
+  return location.find(kMultiDexSeparator) != std::string_view::npos;
 }
 
 std::string DexFileLoader::GetMultiDexClassesDexName(size_t index) {
@@ -148,9 +154,72 @@
 }
 
 std::string DexFileLoader::GetMultiDexLocation(size_t index, const char* dex_location) {
-  return (index == 0)
-      ? dex_location
-      : StringPrintf("%s%cclasses%zu.dex", dex_location, kMultiDexSeparator, index + 1);
+  DCHECK(!IsMultiDexLocation(dex_location));
+  if (index == 0) {
+    return dex_location;
+  }
+  return StringPrintf("%s%cclasses%zu.dex", dex_location, kMultiDexSeparator, index + 1);
+}
+
+bool DexFileLoader::GetMultiDexChecksum(std::optional<uint32_t>* checksum,
+                                        std::string* error_msg,
+                                        bool* only_contains_uncompressed_dex) {
+  CHECK(checksum != nullptr);
+  checksum->reset();  // Return nullopt for an empty zip archive.
+
+  uint32_t magic;
+  if (!InitAndReadMagic(/*header_offset=*/0, &magic, error_msg)) {
+    return false;
+  }
+
+  if (IsZipMagic(magic)) {
+    std::unique_ptr<ZipArchive> zip_archive(
+        file_->IsValid() ?
+            ZipArchive::OpenFromOwnedFd(file_->Fd(), location_.c_str(), error_msg) :
+            ZipArchive::OpenFromMemory(
+                root_container_->Begin(), root_container_->Size(), location_.c_str(), error_msg));
+    if (zip_archive.get() == nullptr) {
+      DCHECK(!error_msg->empty());
+      return false;
+    }
+    if (only_contains_uncompressed_dex != nullptr) {
+      *only_contains_uncompressed_dex = true;
+    }
+    for (size_t i = 0;; ++i) {
+      std::string name = GetMultiDexClassesDexName(i);
+      std::unique_ptr<ZipEntry> zip_entry(zip_archive->Find(name.c_str(), error_msg));
+      if (zip_entry == nullptr) {
+        break;
+      }
+      if (only_contains_uncompressed_dex != nullptr) {
+        if (!(zip_entry->IsUncompressed() && zip_entry->IsAlignedTo(alignof(DexFile::Header)))) {
+          *only_contains_uncompressed_dex = false;
+        }
+      }
+      *checksum = checksum->value_or(kEmptyMultiDexChecksum) ^ zip_entry->GetCrc32();
+    }
+    return true;
+  }
+  if (!MapRootContainer(error_msg)) {
+    return false;
+  }
+  const uint8_t* begin = root_container_->Begin();
+  const uint8_t* end = root_container_->End();
+  for (const uint8_t* ptr = begin; ptr < end;) {
+    const auto* header = reinterpret_cast<const DexFile::Header*>(ptr);
+    size_t size = dchecked_integral_cast<size_t>(end - ptr);
+    if (size < sizeof(*header) || !IsMagicValid(ptr)) {
+      *error_msg = StringPrintf("Invalid dex header: '%s'", filename_.c_str());
+      return false;
+    }
+    if (size < header->file_size_) {
+      *error_msg = StringPrintf("Truncated dex file: '%s'", filename_.c_str());
+      return false;
+    }
+    *checksum = checksum->value_or(kEmptyMultiDexChecksum) ^ header->checksum_;
+    ptr += header->file_size_;
+  }
+  return true;
 }
 
 std::string DexFileLoader::GetDexCanonicalLocation(const char* dex_location) {
@@ -187,22 +256,24 @@
 DexFileLoader::DexFileLoader(MemMap&& mem_map, const std::string& location)
     : DexFileLoader(std::make_shared<MemMapContainer>(std::move(mem_map)), location) {}
 
-std::unique_ptr<const DexFile> DexFileLoader::Open(uint32_t location_checksum,
-                                                   const OatDexFile* oat_dex_file,
-                                                   bool verify,
-                                                   bool verify_checksum,
-                                                   std::string* error_msg) {
+std::unique_ptr<const DexFile> DexFileLoader::OpenOne(size_t header_offset,
+                                                      uint32_t location_checksum,
+                                                      const OatDexFile* oat_dex_file,
+                                                      bool verify,
+                                                      bool verify_checksum,
+                                                      std::string* error_msg) {
   DEXFILE_SCOPED_TRACE(std::string("Open dex file ") + location_);
 
   uint32_t magic;
-  if (!InitAndReadMagic(&magic, error_msg) || !MapRootContainer(error_msg)) {
+  if (!InitAndReadMagic(header_offset, &magic, error_msg) || !MapRootContainer(error_msg)) {
     DCHECK(!error_msg->empty());
     return {};
   }
   DCHECK(root_container_ != nullptr);
+  DCHECK_LE(header_offset, root_container_->Size());
   std::unique_ptr<const DexFile> dex_file = OpenCommon(root_container_,
-                                                       root_container_->Begin(),
-                                                       root_container_->Size(),
+                                                       root_container_->Begin() + header_offset,
+                                                       root_container_->Size() - header_offset,
                                                        location_,
                                                        location_checksum,
                                                        oat_dex_file,
@@ -213,23 +284,28 @@
   return dex_file;
 }
 
-bool DexFileLoader::InitAndReadMagic(uint32_t* magic, std::string* error_msg) {
+bool DexFileLoader::InitAndReadMagic(size_t header_offset,
+                                     uint32_t* magic,
+                                     std::string* error_msg) {
   if (root_container_ != nullptr) {
-    if (root_container_->Size() < sizeof(uint32_t)) {
+    if (root_container_->Size() < header_offset ||
+        root_container_->Size() - header_offset < sizeof(uint32_t)) {
       *error_msg = StringPrintf("Unable to open '%s' : Size is too small", location_.c_str());
       return false;
     }
-    *magic = *reinterpret_cast<const uint32_t*>(root_container_->Begin());
+    *magic = *reinterpret_cast<const uint32_t*>(root_container_->Begin() + header_offset);
   } else {
     // Open the file if we have not been given the file-descriptor directly before.
-    if (!file_.has_value()) {
+    if (!file_->IsValid()) {
       CHECK(!filename_.empty());
-      file_.emplace(filename_, O_RDONLY, /* check_usage= */ false);
-      if (file_->Fd() == -1) {
+      owned_file_ = File(filename_, O_RDONLY, /* check_usage= */ false);
+      if (!owned_file_->IsValid()) {
         *error_msg = StringPrintf("Unable to open '%s' : %s", filename_.c_str(), strerror(errno));
         return false;
       }
+      file_ = &owned_file_.value();
     }
+    CHECK_EQ(header_offset, 0u);  // We always expect to read from the start of physical file.
     if (!ReadMagicAndReset(file_->Fd(), magic, error_msg)) {
       return false;
     }
@@ -243,7 +319,7 @@
   }
 
   CHECK(MemMap::IsInitialized());
-  CHECK(file_.has_value());
+  CHECK(file_->IsValid());
   struct stat sbuf;
   memset(&sbuf, 0, sizeof(sbuf));
   if (fstat(file_->Fd(), &sbuf) == -1) {
@@ -281,13 +357,13 @@
   DCHECK(dex_files != nullptr) << "DexFile::Open: out-param is nullptr";
 
   uint32_t magic;
-  if (!InitAndReadMagic(&magic, error_msg)) {
+  if (!InitAndReadMagic(/*header_offset=*/0, &magic, error_msg)) {
     return false;
   }
 
   if (IsZipMagic(magic)) {
     std::unique_ptr<ZipArchive> zip_archive(
-        file_.has_value() ?
+        file_->IsValid() ?
             ZipArchive::OpenFromOwnedFd(file_->Fd(), location_.c_str(), error_msg) :
             ZipArchive::OpenFromMemory(
                 root_container_->Begin(), root_container_->Size(), location_.c_str(), error_msg));
@@ -295,14 +371,15 @@
       DCHECK(!error_msg->empty());
       return false;
     }
+    size_t multidex_count = 0;
     for (size_t i = 0;; ++i) {
       std::string name = GetMultiDexClassesDexName(i);
-      std::string multidex_location = GetMultiDexLocation(i, location_.c_str());
       bool ok = OpenFromZipEntry(*zip_archive,
                                  name.c_str(),
-                                 multidex_location,
+                                 location_,
                                  verify,
                                  verify_checksum,
+                                 &multidex_count,
                                  error_code,
                                  error_msg,
                                  dex_files);
@@ -326,23 +403,32 @@
       return false;
     }
     DCHECK(root_container_ != nullptr);
-    std::unique_ptr<const DexFile> dex_file =
-        OpenCommon(root_container_,
-                   root_container_->Begin(),
-                   root_container_->Size(),
-                   location_,
-                   /*location_checksum*/ {},  // Use default checksum from dex header.
-                   /*oat_dex_file=*/nullptr,
-                   verify,
-                   verify_checksum,
-                   error_msg,
-                   nullptr);
-    if (dex_file.get() != nullptr) {
+    size_t header_offset = 0;
+    for (size_t i = 0;; i++) {
+      std::string multidex_location = GetMultiDexLocation(i, location_.c_str());
+      std::unique_ptr<const DexFile> dex_file =
+          OpenCommon(root_container_,
+                     root_container_->Begin() + header_offset,
+                     root_container_->Size() - header_offset,
+                     multidex_location,
+                     /*location_checksum*/ {},  // Use default checksum from dex header.
+                     /*oat_dex_file=*/nullptr,
+                     verify,
+                     verify_checksum,
+                     error_msg,
+                     error_code);
+      if (dex_file == nullptr) {
+        return false;
+      }
       dex_files->push_back(std::move(dex_file));
-      return true;
-    } else {
-      return false;
+      size_t file_size = dex_files->back()->GetHeader().file_size_;
+      CHECK_LE(file_size, root_container_->Size() - header_offset);
+      header_offset += file_size;
+      if (dex_files->back()->IsDexContainerLastEntry()) {
+        break;
+      }
     }
+    return true;
   }
   *error_msg = StringPrintf("Expected valid zip or dex file");
   return false;
@@ -350,7 +436,7 @@
 
 std::unique_ptr<DexFile> DexFileLoader::OpenCommon(std::shared_ptr<DexFileContainer> container,
                                                    const uint8_t* base,
-                                                   size_t size,
+                                                   size_t app_compat_size,
                                                    const std::string& location,
                                                    std::optional<uint32_t> location_checksum,
                                                    const OatDexFile* oat_dex_file,
@@ -360,8 +446,11 @@
                                                    DexFileLoaderErrorCode* error_code) {
   if (container == nullptr) {
     // We should never pass null here, but use reasonable default for app compat anyway.
-    container = std::make_shared<MemoryDexFileContainer>(base, size);
+    container = std::make_shared<MemoryDexFileContainer>(base, app_compat_size);
   }
+  CHECK_GE(base, container->Begin());
+  CHECK_LE(base, container->End());
+  const size_t size = container->End() - base;
   if (error_code != nullptr) {
     *error_code = DexFileLoaderErrorCode::kDexFileError;
   }
@@ -369,10 +458,10 @@
   auto header = reinterpret_cast<const DexFile::Header*>(base);
   if (size >= sizeof(StandardDexFile::Header) && StandardDexFile::IsMagicValid(base)) {
     uint32_t checksum = location_checksum.value_or(header->checksum_);
-    dex_file.reset(new StandardDexFile(base, size, location, checksum, oat_dex_file, container));
+    dex_file.reset(new StandardDexFile(base, location, checksum, oat_dex_file, container));
   } else if (size >= sizeof(CompactDexFile::Header) && CompactDexFile::IsMagicValid(base)) {
     uint32_t checksum = location_checksum.value_or(header->checksum_);
-    dex_file.reset(new CompactDexFile(base, size, location, checksum, oat_dex_file, container));
+    dex_file.reset(new CompactDexFile(base, location, checksum, oat_dex_file, container));
   } else {
     *error_msg = StringPrintf("Invalid or truncated dex file '%s'", location.c_str());
   }
@@ -406,6 +495,7 @@
                                      const std::string& location,
                                      bool verify,
                                      bool verify_checksum,
+                                     size_t* multidex_count,
                                      DexFileLoaderErrorCode* error_code,
                                      std::string* error_msg,
                                      std::vector<std::unique_ptr<const DexFile>>* dex_files) const {
@@ -424,7 +514,7 @@
   CHECK(MemMap::IsInitialized());
   MemMap map;
   bool is_file_map = false;
-  if (file_.has_value() && zip_entry->IsUncompressed()) {
+  if (file_->IsValid() && zip_entry->IsUncompressed()) {
     if (!zip_entry->IsAlignedTo(alignof(DexFile::Header))) {
       // Do not mmap unaligned ZIP entries because
       // doing so would fail dex verification which requires 4 byte alignment.
@@ -463,21 +553,37 @@
     return false;
   }
 
-  std::unique_ptr<const DexFile> dex_file = OpenCommon(container,
-                                                       container->Begin(),
-                                                       container->Size(),
-                                                       location,
-                                                       zip_entry->GetCrc32(),
-                                                       /*oat_dex_file=*/nullptr,
-                                                       verify,
-                                                       verify_checksum,
-                                                       error_msg,
-                                                       error_code);
-  if (dex_file == nullptr) {
-    return false;
+  size_t header_offset = 0;
+  for (size_t i = 0;; i++) {
+    std::string multidex_location = GetMultiDexLocation(*multidex_count, location.c_str());
+    ++(*multidex_count);
+    uint32_t multidex_checksum = zip_entry->GetCrc32() + i;
+    std::unique_ptr<const DexFile> dex_file = OpenCommon(container,
+                                                         container->Begin() + header_offset,
+                                                         container->Size() - header_offset,
+                                                         multidex_location,
+                                                         multidex_checksum,
+                                                         /*oat_dex_file=*/nullptr,
+                                                         verify,
+                                                         verify_checksum,
+                                                         error_msg,
+                                                         error_code);
+    if (dex_file == nullptr) {
+      return false;
+    }
+    if (dex_file->IsCompactDexFile()) {
+      *error_msg = StringPrintf("Can not open compact dex file from zip '%s'", location.c_str());
+      return false;
+    }
+    CHECK(dex_file->IsReadOnly()) << multidex_location;
+    dex_files->push_back(std::move(dex_file));
+    size_t file_size = dex_files->back()->GetHeader().file_size_;
+    CHECK_LE(file_size, container->Size() - header_offset);
+    header_offset += file_size;
+    if (dex_files->back()->IsDexContainerLastEntry()) {
+      break;
+    }
   }
-  CHECK(dex_file->IsReadOnly()) << location;
-  dex_files->push_back(std::move(dex_file));
   return true;
 }
 
diff --git a/libdexfile/dex/dex_file_loader.h b/libdexfile/dex/dex_file_loader.h
index 532445a..ec7f8ba 100644
--- a/libdexfile/dex/dex_file_loader.h
+++ b/libdexfile/dex/dex_file_loader.h
@@ -22,6 +22,7 @@
 #include <memory>
 #include <optional>
 #include <string>
+#include <string_view>
 #include <vector>
 
 #include "base/os.h"
@@ -32,7 +33,6 @@
 
 class MemMap;
 class OatDexFile;
-class ScopedTrace;
 class ZipArchive;
 
 enum class DexFileLoaderErrorCode {
@@ -62,7 +62,7 @@
 
   // Check whether a location denotes a multidex dex file. This is a very simple check: returns
   // whether the string contains the separator character.
-  static bool IsMultiDexLocation(const char* location);
+  static bool IsMultiDexLocation(std::string_view location);
 
   // Return the name of the index-th classes.dex in a multidex zip file. This is classes.dex for
   // index == 0, and classes{index + 1}.dex else.
@@ -72,6 +72,59 @@
   // index == 0, and dex_location + multi-dex-separator + GetMultiDexClassesDexName(index) else.
   static std::string GetMultiDexLocation(size_t index, const char* dex_location);
 
+  // Returns combined checksum of one or more dex files (one checksum for the whole multidex set).
+  //
+  // This uses the source path provided to DexFileLoader constructor.
+  //
+  // Returns false on error.  Sets *checksum to nullopt for an empty set.
+  bool GetMultiDexChecksum(/*out*/ std::optional<uint32_t>* checksum,
+                           /*out*/ std::string* error_msg,
+                           /*out*/ bool* only_contains_uncompressed_dex = nullptr);
+
+  // Returns combined checksum of one or more dex files (one checksum for the whole multidex set).
+  //
+  // This uses already open dex files.
+  //
+  // It starts iteration at index 'i', which must be a primary dex file,
+  // and it sets 'i' to the next primary dex file or to end of the array.
+  template <typename DexFilePtrVector>  // array|vector<unique_ptr|DexFile|OatDexFile*>.
+  static uint32_t GetMultiDexChecksum(const DexFilePtrVector& dex_files,
+                                      /*inout*/ size_t* i) {
+    CHECK_LT(*i, dex_files.size()) << "No dex files";
+    std::optional<uint32_t> checksum;
+    for (; *i < dex_files.size(); ++(*i)) {
+      const auto* dex_file = &*dex_files[*i];
+      bool is_primary_dex = !IsMultiDexLocation(dex_file->GetLocation().c_str());
+      if (!checksum.has_value()) {                         // First dex file.
+        CHECK(is_primary_dex) << dex_file->GetLocation();  // Expect primary dex.
+      } else if (is_primary_dex) {                         // Later dex file.
+        break;  // Found another primary dex file, terminate iteration.
+      }
+      if (!is_primary_dex && dex_file->GetDexVersion() >= DexFile::kDexContainerVersion) {
+        if (dex_file->GetLocationChecksum() == dex_files[*i - 1]->GetLocationChecksum() + 1) {
+          continue;
+        }
+      }
+      checksum = checksum.value_or(kEmptyMultiDexChecksum) ^ dex_file->GetLocationChecksum();
+    }
+    CHECK(checksum.has_value());
+    return checksum.value();
+  }
+
+  // Calculate checksum of dex files in a vector, starting at index 0.
+  // It will CHECK that the whole vector is consumed (i.e. there is just one primary dex file).
+  template <typename DexFilePtrVector>
+  static uint32_t GetMultiDexChecksum(const DexFilePtrVector& dex_files) {
+    size_t i = 0;
+    uint32_t checksum = GetMultiDexChecksum(dex_files, &i);
+    CHECK_EQ(i, dex_files.size());
+    return checksum;
+  }
+
+  // Non-zero initial value for multi-dex to catch bugs if multi-dex checksum is compared
+  // directly to DexFile::GetLocationChecksum without going through GetMultiDexChecksum.
+  static constexpr uint32_t kEmptyMultiDexChecksum = 1;
+
   // Returns the canonical form of the given dex location.
   //
   // There are different flavors of "dex locations" as follows:
@@ -107,14 +160,14 @@
     return (pos == std::string::npos) ? std::string() : location.substr(pos);
   }
 
-  DexFileLoader(const char* filename, int fd, const std::string& location)
-      : filename_(filename),
-        file_(fd == -1 ? std::optional<File>() : File(fd, /*check_usage=*/false)),
-        location_(location) {}
+  DexFileLoader(const char* filename, const File* file, const std::string& location)
+      : filename_(filename), file_(file), location_(location) {
+    CHECK(file != nullptr);  // Must be non-null, but may be invalid.
+  }
 
   DexFileLoader(std::shared_ptr<DexFileContainer> container, const std::string& location)
       : root_container_(std::move(container)), location_(location) {
-    DCHECK(root_container_ != nullptr);
+    CHECK(root_container_ != nullptr);
   }
 
   DexFileLoader(const uint8_t* base, size_t size, const std::string& location);
@@ -123,22 +176,39 @@
 
   DexFileLoader(MemMap&& mem_map, const std::string& location);
 
-  DexFileLoader(int fd, const std::string& location)
-      : DexFileLoader(/*filename=*/location.c_str(), fd, location) {}
+  DexFileLoader(File* file, const std::string& location)
+      : DexFileLoader(/*filename=*/location.c_str(), file, location) {}
 
   DexFileLoader(const char* filename, const std::string& location)
-      : DexFileLoader(filename, /*fd=*/-1, location) {}
+      : DexFileLoader(filename, /*file=*/&kInvalidFile, location) {}
 
   explicit DexFileLoader(const std::string& location)
-      : DexFileLoader(location.c_str(), /*fd=*/-1, location) {}
+      : DexFileLoader(location.c_str(), /*file=*/&kInvalidFile, location) {}
 
   virtual ~DexFileLoader() {}
 
+  // Open singe dex file at the given offset within the container (usually 0).
+  // This intentionally ignores all other dex files in the container
+  std::unique_ptr<const DexFile> OpenOne(size_t header_offset,
+                                         uint32_t location_checksum,
+                                         const OatDexFile* oat_dex_file,
+                                         bool verify,
+                                         bool verify_checksum,
+                                         std::string* error_msg);
+
+  // Open single dex file (starting at offset 0 of the container).
+  // It expects only single dex file to be present and will fail otherwise.
   std::unique_ptr<const DexFile> Open(uint32_t location_checksum,
                                       const OatDexFile* oat_dex_file,
                                       bool verify,
                                       bool verify_checksum,
-                                      std::string* error_msg);
+                                      std::string* error_msg) {
+    std::unique_ptr<const DexFile> dex_file = OpenOne(
+        /*header_offset=*/0, location_checksum, oat_dex_file, verify, verify_checksum, error_msg);
+    // This API returns only singe DEX file, so check there is just single dex in the container.
+    CHECK(dex_file == nullptr || dex_file->IsDexContainerLastEntry()) << location_;
+    return dex_file;
+  }
 
   std::unique_ptr<const DexFile> Open(uint32_t location_checksum,
                                       bool verify,
@@ -195,7 +265,9 @@
   }
 
  protected:
-  bool InitAndReadMagic(uint32_t* magic, std::string* error_msg);
+  static const File kInvalidFile;  // Used for "no file descriptor" (-1).
+
+  bool InitAndReadMagic(size_t header_offset, uint32_t* magic, std::string* error_msg);
 
   // Ensure we have root container.  If we are backed by a file, memory-map it.
   // We can only do this for dex files since zip files might be too big to map.
@@ -244,15 +316,28 @@
                         const std::string& location,
                         bool verify,
                         bool verify_checksum,
-                        DexFileLoaderErrorCode* error_code,
-                        std::string* error_msg,
-                        std::vector<std::unique_ptr<const DexFile>>* dex_files) const;
+                        /*inout*/ size_t* multidex_count,
+                        /*out*/ DexFileLoaderErrorCode* error_code,
+                        /*out*/ std::string* error_msg,
+                        /*out*/ std::vector<std::unique_ptr<const DexFile>>* dex_files) const;
 
   // The DexFileLoader can be backed either by file or by memory (i.e. DexFileContainer).
   // We can not just mmap the file since APKs might be unreasonably large for 32-bit system.
   std::string filename_;
-  std::optional<File> file_;
+  const File* file_ = &kInvalidFile;
+  std::optional<File> owned_file_;  // May be used as backing storage for 'file_'.
   std::shared_ptr<DexFileContainer> root_container_;
+
+  // The full absolute path to the dex file, if it was loaded from disk.
+  //
+  // Can also be a path to a multidex container (typically apk), followed by
+  // kMultiDexSeparator and the file inside the container.
+  //
+  // On host this may not be an absolute path.
+  //
+  // On device libnativeloader uses this to determine the location of the java
+  // package or shared library, which decides where to load native libraries
+  // from.
   const std::string location_;
 };
 
diff --git a/libdexfile/dex/dex_file_loader_test.cc b/libdexfile/dex/dex_file_loader_test.cc
index 381dfdc..48e3178 100644
--- a/libdexfile/dex/dex_file_loader_test.cc
+++ b/libdexfile/dex/dex_file_loader_test.cc
@@ -111,17 +111,66 @@
   "uAAAAAYAAAABAAAA0AAAAAEgAAACAAAA8AAAAAEQAAABAAAAHAEAAAIgAAAIAAAAIgEAAAMgAAAC"
   "AAAAcwEAAAAgAAABAAAAfgEAAAAQAAABAAAAjAEAAA==";
 
+// Taken from 001-Main.
 static const char kRawDex41[] =
-  "ZGV4CjA0MQC4OovJlJ1089ikzK6asMf/f8qp3Kve5VsgAgAAcAAAAHhWNBIAAAAAAAAAAIwBAAAI"
-  "AAAAcAAAAAQAAACQAAAAAgAAAKAAAAAAAAAAAAAAAAMAAAC4AAAAAQAAANAAAAAwAQAA8AAAACIB"
-  "AAAqAQAAMgEAAEYBAABRAQAAVAEAAFgBAABtAQAAAQAAAAIAAAAEAAAABgAAAAQAAAACAAAAAAAA"
-  "AAUAAAACAAAAHAEAAAAAAAAAAAAAAAABAAcAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAADAAAA"
-  "AAAAAH4BAAAAAAAAAQABAAEAAABzAQAABAAAAHAQAgAAAA4AAQABAAAAAAB4AQAAAQAAAA4AAAAB"
-  "AAAAAwAGPGluaXQ+AAZMTWFpbjsAEkxqYXZhL2xhbmcvT2JqZWN0OwAJTWFpbi5qYXZhAAFWAAJW"
-  "TAATW0xqYXZhL2xhbmcvU3RyaW5nOwAEbWFpbgABAAcOAAMBAAcOAAAAAgAAgYAE8AEBCYgCDAAA"
-  "AAAAAAABAAAAAAAAAAEAAAAIAAAAcAAAAAIAAAAEAAAAkAAAAAMAAAACAAAAoAAAAAUAAAADAAAA"
-  "uAAAAAYAAAABAAAA0AAAAAEgAAACAAAA8AAAAAEQAAABAAAAHAEAAAIgAAAIAAAAIgEAAAMgAAAC"
-  "AAAAcwEAAAAgAAABAAAAfgEAAAAQAAABAAAAjAEAAA==";
+  "ZGV4CjA0MQBBaEGw/8clTiOn3IafJ++m20gViy5Peh7UAgAAeAAAAHhWNBIAAAAAAAAAAEACAAAK"
+  "AAAAeAAAAAQAAACgAAAAAgAAALAAAAAAAAAAAAAAAAMAAADIAAAAAQAAAOAAAAAAAAAAAAAAANQC"
+  "AAAAAAAAOgEAAEIBAABKAQAAXgEAAGkBAABsAQAAcAEAAIUBAACLAQAAkQEAAAEAAAACAAAABAAA"
+  "AAYAAAAEAAAAAgAAAAAAAAAFAAAAAgAAADQBAAAAAAAAAAAAAAAAAQAIAAAAAQAAAAAAAAAAAAAA"
+  "AQAAAAEAAAAAAAAAAwAAAAAAAAAxAgAAAAAAAAEAAQABAAAAKgEAAAQAAABwEAIAAAAOAAEAAQAA"
+  "AAAALgEAAAEAAAAOABEADgATAQgOAAABAAAAAwAGPGluaXQ+AAZMTWFpbjsAEkxqYXZhL2xhbmcv"
+  "T2JqZWN0OwAJTWFpbi5qYXZhAAFWAAJWTAATW0xqYXZhL2xhbmcvU3RyaW5nOwAEYXJncwAEbWFp"
+  "bgCdAX5+RDh7ImJhY2tlbmQiOiJkZXgiLCJjb21waWxhdGlvbi1tb2RlIjoiZGVidWciLCJoYXMt"
+  "Y2hlY2tzdW1zIjpmYWxzZSwibWluLWFwaSI6MjYsInNoYS0xIjoiNTRjYmIzMTZlNGI3OWFhMDM1"
+  "ZDUwMTM4ZTI3NjY4OGJiOTM5ZGIwNCIsInZlcnNpb24iOiI4LjMuMTQtZGV2In0AAAACAACBgASA"
+  "AgEJmAIADAAAAAAAAAABAAAAAAAAAAEAAAAKAAAAeAAAAAIAAAAEAAAAoAAAAAMAAAACAAAAsAAA"
+  "AAUAAAADAAAAyAAAAAYAAAABAAAA4AAAAAEgAAACAAAAAAEAAAMgAAACAAAAKgEAAAEQAAABAAAA"
+  "NAEAAAIgAAAKAAAAOgEAAAAgAAABAAAAMQIAAAAQAAABAAAAQAIAAA==";
+
+// Taken from 001-Main and modified.
+static const char kRawDex42[] =
+  "ZGV4CjA0MgBBaEGw/8clTiOn3IafJ++m20gViy5Peh7UAgAAeAAAAHhWNBIAAAAAAAAAAEACAAAK"
+  "AAAAeAAAAAQAAACgAAAAAgAAALAAAAAAAAAAAAAAAAMAAADIAAAAAQAAAOAAAAAAAAAAAAAAANQC"
+  "AAAAAAAAOgEAAEIBAABKAQAAXgEAAGkBAABsAQAAcAEAAIUBAACLAQAAkQEAAAEAAAACAAAABAAA"
+  "AAYAAAAEAAAAAgAAAAAAAAAFAAAAAgAAADQBAAAAAAAAAAAAAAAAAQAIAAAAAQAAAAAAAAAAAAAA"
+  "AQAAAAEAAAAAAAAAAwAAAAAAAAAxAgAAAAAAAAEAAQABAAAAKgEAAAQAAABwEAIAAAAOAAEAAQAA"
+  "AAAALgEAAAEAAAAOABEADgATAQgOAAABAAAAAwAGPGluaXQ+AAZMTWFpbjsAEkxqYXZhL2xhbmcv"
+  "T2JqZWN0OwAJTWFpbi5qYXZhAAFWAAJWTAATW0xqYXZhL2xhbmcvU3RyaW5nOwAEYXJncwAEbWFp"
+  "bgCdAX5+RDh7ImJhY2tlbmQiOiJkZXgiLCJjb21waWxhdGlvbi1tb2RlIjoiZGVidWciLCJoYXMt"
+  "Y2hlY2tzdW1zIjpmYWxzZSwibWluLWFwaSI6MjYsInNoYS0xIjoiNTRjYmIzMTZlNGI3OWFhMDM1"
+  "ZDUwMTM4ZTI3NjY4OGJiOTM5ZGIwNCIsInZlcnNpb24iOiI4LjMuMTQtZGV2In0AAAACAACBgASA"
+  "AgEJmAIADAAAAAAAAAABAAAAAAAAAAEAAAAKAAAAeAAAAAIAAAAEAAAAoAAAAAMAAAACAAAAsAAA"
+  "AAUAAAADAAAAyAAAAAYAAAABAAAA4AAAAAEgAAACAAAAAAEAAAMgAAACAAAAKgEAAAEQAAABAAAA"
+  "NAEAAAIgAAAKAAAAOgEAAAAgAAABAAAAMQIAAAAQAAABAAAAQAIAAA==";
+
+// Taken from art-gtest-jars-MultiDex.jar
+static const char kRawContainerDex[] =
+  "ZGV4CjA0MQAAIUzJT/jrhaH3BHocZOpqBIO1QRkfBPE0AgAAeAAAAHhWNBIAAAAAAAAAAJQBAAAV"
+  "AAAArAIAAAgAAAB4AAAABAAAAJgAAAABAAAAyAAAAAYAAADQAAAAAQAAAAABAAAAAAAAAAAAALwF"
+  "AAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAHAAAACwAAAA0AAAABAAAABAAAAAAAAAALAAAABgAA"
+  "AAAAAAAMAAAABgAAAHgBAAAMAAAABgAAAIABAAAFAAIAEQAAAAAAAQAAAAAAAAADABAAAAABAAEA"
+  "AAAAAAEAAAAPAAAAAgACABIAAAADAAEAAAAAAAAAAAAAAAAAAwAAAAAAAAAIAAAAAAAAAIYBAAAA"
+  "AAAAAQABAAEAAABmAQAABAAAAHAQBQAAAA4ABAABAAIAAABqAQAADwAAACIAAQBwEAIAAABiAQAA"
+  "bhADAAAADAJuIAQAIQAOABEADgATAQ8OWgMAFAKWAAAAAAEAAAAEAAAAAQAAAAcAAAACAACAgASg"
+  "AgEJuAINAAAAAAAAAAEAAAAAAAAAAgAAAAgAAAB4AAAAAwAAAAQAAACYAAAABAAAAAEAAADIAAAA"
+  "BQAAAAYAAADQAAAABgAAAAEAAAAAAQAAASAAAAIAAAAgAQAAAyAAAAIAAABmAQAAARAAAAIAAAB4"
+  "AQAAACAAAAEAAACGAQAAABAAAAEAAACUAQAAAQAAABUAAACsAgAAAiAAABUAAACYAwAAZGV4CjA0"
+  "MQAxmn5fJHSijXMoNjKkUwU/LqsrYEld5QiIAwAAeAAAAHhWNBIAAAAAAAAAADQFAAAVAAAArAIA"
+  "AAQAAAAAAwAAAgAAABADAAAAAAAAAAAAAAMAAAAoAwAAAQAAAEADAAAAAAAAAAAAALwFAAA0AgAA"
+  "mAMAAKADAACjAwAAqwMAALUDAADMAwAA4AMAAPQDAAAIBAAAEwQAAB0EAAAqBAAALQQAADEEAABG"
+  "BAAATAQAAFcEAABdBAAAYgQAAGsEAABzBAAAAwAAAAUAAAAGAAAACwAAAAEAAAACAAAAAAAAAAsA"
+  "AAADAAAAAAAAAAAAAQAAAAAAAAAAAA8AAAABAAEAAAAAAAAAAAAAAAAAAQAAAAAAAAAKAAAAAAAA"
+  "ACMFAAAAAAAAAgABAAAAAACQAwAAAwAAABoACQARAAAAAQABAAEAAACUAwAABAAAAHAQAgAAAA4A"
+  "EwAOABEADgAGPGluaXQ+AAFMAAZMTWFpbjsACExTZWNvbmQ7ABVMamF2YS9pby9QcmludFN0cmVh"
+  "bTsAEkxqYXZhL2xhbmcvT2JqZWN0OwASTGphdmEvbGFuZy9TdHJpbmc7ABJMamF2YS9sYW5nL1N5"
+  "c3RlbTsACU1haW4uamF2YQAIT3JpZ2luYWwAC1NlY29uZC5qYXZhAAFWAAJWTAATW0xqYXZhL2xh"
+  "bmcvU3RyaW5nOwAEYXJncwAJZ2V0U2Vjb25kAARtYWluAANvdXQAB3ByaW50bG4ABnNlY29uZACt"
+  "AX5+RDh7ImJhY2tlbmQiOiJkZXgiLCJjb21waWxhdGlvbi1tb2RlIjoiZGVidWciLCJoYXMtY2hl"
+  "Y2tzdW1zIjpmYWxzZSwibWluLWFwaSI6MTksInBsYXRmb3JtIjp0cnVlLCJzaGEtMSI6IjA0ZmZl"
+  "ODMwMGM0MjlmMWFkMTZmM2E1Y2I0ZWQ2OTkyMTNlNGYyY2QiLCJ2ZXJzaW9uIjoiOC4yLjIxLWRl"
+  "diJ9AAAAAQEAgIAE+AYBAeAGAAAACwAAAAAAAAABAAAANAIAAAEAAAAVAAAArAIAAAIAAAAEAAAA"
+  "AAMAAAMAAAACAAAAEAMAAAUAAAADAAAAKAMAAAYAAAABAAAAQAMAAAEgAAACAAAAYAMAAAMgAAAC"
+  "AAAAkAMAAAIgAAAVAAAAmAMAAAAgAAABAAAAIwUAAAAQAAABAAAANAUAAA==";
 
 static const char kRawDexZeroLength[] =
   "UEsDBAoAAAAAAOhxAkkAAAAAAAAAAAAAAAALABwAY2xhc3Nlcy5kZXhVVAkAA2QNoVdnDaFXdXgL"
@@ -199,6 +248,105 @@
     "AAIAAAAEAAAAkAAAAAMAAAACAAAAoAAAAAUAAAADAAAAuAAAAAYAAAABAAAA0AAAAAEgAAACAAAA"
     "8AAAAAIgAAAIAAAAHAEAAAMgAAACAAAAVAEAAAAgAAABAAAAYwEAAAAQAAABAAAAdAEAAA==";
 
+// Created from kRawDex38 by changing version to 35 and appending three entries
+// to the map list, namely `kDexTypeMethodHandleItem`, `kDexTypeCallSiteIdItem`
+// and `kDexTypeHiddenapiClassData`, each with size one and invalid offset 0xffff.
+static const char kRawDexBadMapOffsets[] =
+    "ZGV4CjAzNQC4OovJlJ1089ikzK6asMf/f8qp3Kve5VsgAgAAcAAAAHhWNBIAAAAAAAAAAIwBAAAI"
+    "AAAAcAAAAAQAAACQAAAAAgAAAKAAAAAAAAAAAAAAAAMAAAC4AAAAAQAAANAAAAAwAQAA8AAAACIB"
+    "AAAqAQAAMgEAAEYBAABRAQAAVAEAAFgBAABtAQAAAQAAAAIAAAAEAAAABgAAAAQAAAACAAAAAAAA"
+    "AAUAAAACAAAAHAEAAAAAAAAAAAAAAAABAAcAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAADAAAA"
+    "AAAAAH4BAAAAAAAAAQABAAEAAABzAQAABAAAAHAQAgAAAA4AAQABAAAAAAB4AQAAAQAAAA4AAAAB"
+    "AAAAAwAGPGluaXQ+AAZMTWFpbjsAEkxqYXZhL2xhbmcvT2JqZWN0OwAJTWFpbi5qYXZhAAFWAAJW"
+    "TAATW0xqYXZhL2xhbmcvU3RyaW5nOwAEbWFpbgABAAcOAAMBAAcOAAAAAgAAgYAE8AEBCYgCDwAA"
+    "AAAAAAABAAAAAAAAAAEAAAAIAAAAcAAAAAIAAAAEAAAAkAAAAAMAAAACAAAAoAAAAAUAAAADAAAA"
+    "uAAAAAYAAAABAAAA0AAAAAEgAAACAAAA8AAAAAEQAAABAAAAHAEAAAIgAAAIAAAAIgEAAAMgAAAC"
+    "AAAAcwEAAAAgAAABAAAAfgEAAAAQAAABAAAAjAEAAAgAAAABAAAA//8AAAcAAAABAAAA//8AAADw"
+    "AAABAAAA//8AAA==";
+
+static const char kRawDexStringDataOOB[] =
+    "ZGV4CjAzNQCeYAY06q0ySzKz8hklA3wUmxR8x10yt8X0AgAAcAAAAHhWNBIAAAAAAAAAAFQCAAAQAAAAcAAAAAcAAACw"
+    "AAAAAwAAAMwAAAABAAAA8AAAAAQAAAD4AAAAAQAAABgBAAC8AQAAOAEAAH4BAACGAQABAAEAlQAAnQC0AQAAyAEAANwB"
+    "AADwAQAA+"
+    "wEAAP4BAAACAgAAFwIAAB0CAAAjAgAAKAIAADECAAACAAAAAwAAAAQAAAAFAAAABgAAAAgAAAAKAAAACAAAAAUAAAAAA"
+    "AAACQAAAAUAAABwAQAACQAAAAUAAAB4AQAABAABAA0AAAAAAAAAAAAAAAAAAgAMAAAAAQABAA4AAAACAAAAAAAAAAAAA"
+    "AABAAAAAgAAAAAAAAAHAAAAAAAAAEMCAAAAAAAAAQABAAEAAAA3AgAABAAAAHAQAwAAAA4AAwABAAIAAAA8AgAACAAAA"
+    "GIAAAAaAQEAbiACABAADgABAAAAAwAAAAEAAAAGAAY8aW5pdD4ADUhlbGxvLCB3b3JsZCEABkxNYWluOwAVTGphdmEva"
+    "W8vUHJpbnRTdHJlYW07ABJMamF2YS9sYW5nL09iamVjdDsAEkxqYXZhL2xhbmcvU3RyaW5nOwASTGphdmEvbGFuZy9Te"
+    "XN0ZW07AAlNYWluLmphdmEAAVYAAlZMABNbTGphK2EvbGFuZy9TdHJpbmc7AARhcmdzAARtYWluAANvdXQAB3ByaW50b"
+    "G4ABHRoaXMAEQAHDgATAQwHDngAAAACAACBgAS4AgEJ0AIAAAANAAAAAAAAAAEAAAAAAAAAAQAAABAAAABwAAAAAgAAA"
+    "AcAAACwAAAAAwAAAAMAAADMAAAABAAAAAEAAADwAAAABQAAAAQAAAD4AAAABgAAAAEAAAAYAQAAASAAAAIAAAA4AQAAA"
+    "RAAAAIAAABwAQAAAiAAABAAAAB+AQAAAyAAAAIAAAA3AgAAACAAAAEAAABDAgAAABAAAAEAAABUAgAA";
+
+static const char kRawDexCodeItemOOB[] =
+    "ZGV4CjAzNQBNRhvKLnmGPLR973zkwLwGomvp/qfZL080AgAAcAAAAHhWNBIAAAAA"
+    "AAAAAKABAAAKAAAAcAAAAAQAAACYAAAAAgAAAKgAAAAAAAAAAAAAAAMAAADAAAAA"
+    "AQAAANgAAAA8AQAACAAAACoBAAAxAQAA2gEAAE4BAABZAQAAXAEAAGABAAB1AQAA"
+    "ewEAAIEBAAABAAAAAgAAAAQAAAAGAAAABAAAAAIAAAAAAAAABQAAAAIAAAAkAQAA"
+    "AAAAAAAAAAAAAAEACAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAMAAAAAAAAA"
+    "kgEAAAAAAAABAAEAAQAAAIcBAAKSAAAAcBACAAAADgABAAEAAAAAAIwBAAABAAAA"
+    "DgAAAAEAAAADAAY8aW5pdD4ABkxNYWluOwASTGphdmEvbGFuZy9PYmplY3Q7AAlN"
+    "YWluLmphdmEAAVYAAlZMABNbTGphdmEvbGFuZy9TdHJpbmc7AARhcmdzAARtYWlu"
+    "AAR0aGlzABEABw4A6QH4+PH////9+gAlgAT4AQEJkAIMAAAAAAAAAAEAAAAAAAAA"
+    "AQAAAAoAAABwAAAAAgAAAAQAAACYAAAAAwAAAAIAAACoAAAABQAAAAMAAADAAAAA"
+    "BgAAAAEAAADYAAAAASAAAAIAAAD4AAAAARAAAAEAAAAkAQAAAiAAAAoAAAAqAQAA"
+    "AyAAAAIAAACHAQAAACAAAAEAAACSAQAAABAAAAEAAACgAQAA";
+
+static const char kHiddenAPIClassDataBadOffset[] =
+    "ZGV4CjAzNQA+Lt8iLnmGPLR973zkwLwGomvp/qfZL080AgAAcAAAAHhWNBIAAAAA"
+    "AAAAAKABAAAKAAAAcAAAAAQAAACYAAAAAgAAAKgAAAAAAAAAAAAAAAMAAADAAAAA"
+    "AQAAANgAAAA8AfoA+AAAACoBAAAyAQAAOgEAAE4BAABZAQAAXAEAAGABAAB1AQAA"
+    "ewEAAIEBAAABAAAAAgAAAAQAAAAGAAAABAAAAAIAAAAAAAAABQAAAAIAAABHAQBP"
+    "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/"
+    "//////8DRwAAAAAAAAAAAAAAAAAIAAAAAAAAAPIAAAAIAAAAAAAAAAAAAAAAAAAA"
+    "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+    "ACAAAAACAAAABAAAAJgAAAADAAAAAgAAAKgAAAAFAAAAAwAAAMAAAAAGAAAAAQAA"
+    "AAR0aGlzABEAAA4AEwEIBw4AAAACAAAlgPsH/gEJkAIMAAAAAAAAAAEAAAAAAAAA"
+    "AQAAAAoAAABwAAAAAgAAAAQAAACYAAAAAwAAAAIAAACoAAAABQAAAAMAAADAAAAA"
+    "BgAAAAEAAADYAAAABwAAAAIAAAD4AAAAAPAAAAAAAQAEAQAAAiAAAAoAAAAqAQAA"
+    "AyAAAC0AAACHAQAAACAAAAEAAACSAQAAABAAAAEAAACgAQAA";
+
+static const char kRawBadDebugInfoItem[] =
+    "ZGV4CjAzOAAaShJb6q0xSzOzJXwUA/IZmxR8x10yt8X0AgAAcAAAAHhWNBIwQB8z"
+    "AAAAAFQCAAAQAAAIcAAAAAcAAACwAAAAAwAAAMwAAAABAAAA8AAAAPz/9wD4AAAA"
+    "AQAAOhgBAAC8AQA5AQAAAH4BAACAgAAAAAAAAAAAAAAEAAABAAn///kACAAAAAAA"
+    "BgAAAAgACgIAABcCAAClAAIAIwIAACgCAAAxAgDeAgAAAEAAAAAEAAAABQBQAAYA"
+    "AAAIAAAAAAAAAAAAAAcAAAEACf8Y+QAIAAAAAAAGAAAACAAAAAwAAICAgIAAAAIA"
+    "IwL5ACgCAAAwAgACAQAAAAMAAAAEAAAABQBQAAYAAAAIAAAAAAAAAAADAAEACf//"
+    "+QAIAAAAAAAGAAAACAAKAgAAFwMAAKUAAAMAAAAEAAAABQAAAAYAAAAEAAAAAgAA"
+    "AAAAgIAACQAFEAAAAIAABACAgIAAAAAsCH4AAAAAAAYAAAAIAAAADAAAAAUAAAAC"
+    "AAAAAICABICAgAAAAICAAAUAAAAGAAAACAAAAwAAAAAABAAAAAIAAAAM+f8ABQAA"
+    "AAIAAACAgIAAAAQAgACAAIAALAB+AACAAAAGAAAACAAAAAwAAAAFAACAAgAAAACA"
+    "gIAAAAAAAIAAAAAAAAAAAAAAAAQAAAACAAAAAACAAATmgICAAAAAABMAAAAAAACA"
+    "AAAAAAgAAAAMAAAABQAAAAIAAAAAgIAEgICAAAAAgIAABQAAAAYAAAAIAAADAAAA"
+    "AAAEAAAAAgAAAAwAAAAFAAAAAgANAAAAAAAjAAEAAAAAAAAABwAAABAAAABwAAAA"
+    "AgAAAAcAAACwAAAAAyAAAEEAAADMAAAABAAAAAEnAADwAAAABQAAAAQAA/j4AAAA"
+    "BgAAAFv///8bAQAAAQAAAAAAAG81AQAAARAAAAIAAABwAQAAAiAAABAAAAB+AQAA"
+    "AwAAKQIAAAA3AgAAACAAAAEAAABDAgAAABAAAAEAAABUAgAA";
+
+static const char kIncorrectSectionSizeInHeader[] =
+    "ZGV4CjAzOACmfCim6q0xSzKzJXwUA/IZmxR8x10yt8X0AgAAcAAAAHhWNBIwQB8z"
+    "AAAAAFQCAAABAT//cAAAAAcAAACwAAAAAwAAAMwAAAABAACA8AAAAPz/9wD4AAAA"
+    "AQAAOhgBAAC8AzI0AQAAAH4BgAAAAQAAANgAAAApAQAAYQAAACoJWwAxAQAAOgAA"
+    "zAAAAP////8QCQAABAAAADEBAAA6AADMAAAA/////xAJAAAEAAAAAAAAAIAAAAAA"
+    "gAAAAAAAAAEAAADmAAAABAAAAAoAAACAAAAAAIAAAAAAgAAAAICAgAAAAAAAAAAA"
+    "gIAAAAAAgAAAAICAgAAAAAAAAAAAgIAAAAAAAAAAAACAAAAAAHoAAACGgu//Nzk3"
+    "QPUhAEEAAP//dgACAAAADQAAAOYAAAAAAAAAAAAATWFpbm7qYXZhEAD8//cA+AAA"
+    "AAEAADoYAQAAvAMyNAEAAAB+AQAAgIAAAAAAAAAAAICAAAAAAIAAAACAgIAAAAAA"
+    "AAAAAICAAAAAAAAAAAAAgAAAAAB6AAAAhoLv/zc5N0D1IQBBAAD//3YAAgAAAA0A"
+    "AADmAAAAAAAAAAAAAE1haW5u6mF2YRAA/P/3APgAAADYAAAAKQEAAGEAAAAqCVsA"
+    "MQEAADoAAMwAAAD/////EAkAAAQAAAAxAQAAOgAAzAAAAP////8QCQAATWFpbm7q"
+    "YQB2YQFWAAJWGAATizUBAQmQBgwAAAAAAAAAAACHAQAAACAAAAEA+P9t+gAAABAA"
+    "AAEABAAAAICAgACAAAAAAIAABQANAAAAAAAjAAEAAAAAAAAABwAABxAAAABwAAAA"
+    "AgAAAAcAAACwAAAAACAABEEAAADMAAAABAAAAAEnAADwAAAABQAAAwAAAPj4AAAA"
+    "BgAwqDYA//8YAQAAAQAAAAAAAG8zAQAAARAAAAIAAABwAQAAAiAAABAAAAB+AQAA"
+    "AwAAKQIAAAAzAgAABiAAAAEAAABDAgAAABAAAAEAAABUAgAA";
+
+static const char kFileSizeTooSmallInHeader[] =
+    "ZGV4CjAzOADm+mgA5vpofOqtMUsBCAAAJAEAAAJ3AAABAAAAcQAA/////////0ES"
+    "+//4mrr////u/wAAAAAAADv//0X/ZAEAAFwBAABgY2Q6JAEAAHsBAACBAQAAAQAA"
+    "AAIAAAAFAAAEAAAAAAAAAA==";
+
 static void DecodeDexFile(const char* base64, std::vector<uint8_t>* dex_bytes) {
   // decode base64
   CHECK(base64 != nullptr);
@@ -225,7 +373,8 @@
 
 static std::unique_ptr<const DexFile> OpenDexFileBase64(const char* base64,
                                                         const char* location,
-                                                        std::vector<uint8_t>* dex_bytes) {
+                                                        std::vector<uint8_t>* dex_bytes,
+                                                        size_t expected_dex_files = 1) {
   // read dex files.
   DexFileLoaderErrorCode error_code;
   std::string error_msg;
@@ -233,7 +382,7 @@
   bool success = OpenDexFilesBase64(base64, location, dex_bytes, &dex_files, &error_code,
                                     &error_msg);
   CHECK(success) << error_msg;
-  EXPECT_EQ(1U, dex_files.size());
+  EXPECT_EQ(expected_dex_files, dex_files.size());
   return std::move(dex_files[0]);
 }
 
@@ -260,20 +409,18 @@
 }
 
 static void ValidateDexFileHeader(std::unique_ptr<const DexFile> dex_file) {
-  static const uint8_t kExpectedDexFileMagic[8] = {
-    /* d */ 0x64, /* e */ 0x64, /* x */ 0x78, /* \n */ 0x0d,
-    /* 0 */ 0x30, /* 3 */ 0x33, /* 5 */ 0x35, /* \0 */ 0x00
+  static const DexFile::Magic kExpectedDexFileMagic = {
+      0x64, 0x65, 0x78, 0x0a, 0x30, 0x33, 0x35, 0x00,  // "dex\n035\0".
   };
-  static const uint8_t kExpectedSha1[DexFile::kSha1DigestSize] = {
-    0x7b, 0xb8, 0x0c, 0xd4, 0x1f, 0xd6, 0x1e, 0xc5,
-    0x89, 0xe8, 0xbe, 0xe5, 0x18, 0x02, 0x12, 0x18,
-    0x2e, 0xf2, 0x8c, 0x3d,
+  static const DexFile::Sha1 kExpectedSha1 = {
+      0x7b, 0xb8, 0x0c, 0xd4, 0x1f, 0xd6, 0x1e, 0xc5, 0x89, 0xe8,
+      0xbe, 0xe5, 0x18, 0x02, 0x12, 0x18, 0x2e, 0xf2, 0x8c, 0x3d,
   };
 
   const DexFile::Header& header = dex_file->GetHeader();
-  EXPECT_EQ(*kExpectedDexFileMagic, *header.magic_);
+  EXPECT_EQ(kExpectedDexFileMagic, header.magic_);
   EXPECT_EQ(0x00d87910U, header.checksum_);
-  EXPECT_EQ(*kExpectedSha1, *header.signature_);
+  EXPECT_EQ(kExpectedSha1, header.signature_);
   EXPECT_EQ(904U, header.file_size_);
   EXPECT_EQ(112U, header.header_size_);
   EXPECT_EQ(0U, header.link_size_);
@@ -336,9 +483,18 @@
   EXPECT_EQ(40u, header.GetVersion());
 }
 
-TEST_F(DexFileLoaderTest, Version41Rejected) {
+TEST_F(DexFileLoaderTest, Version41Accepted) {
   std::vector<uint8_t> dex_bytes;
-  DecodeDexFile(kRawDex41, &dex_bytes);
+  std::unique_ptr<const DexFile> raw(OpenDexFileBase64(kRawDex41, kLocationString, &dex_bytes, 1));
+  ASSERT_TRUE(raw.get() != nullptr);
+
+  const DexFile::Header& header = raw->GetHeader();
+  EXPECT_EQ(41u, header.GetVersion());
+}
+
+TEST_F(DexFileLoaderTest, Version42Rejected) {
+  std::vector<uint8_t> dex_bytes;
+  DecodeDexFile(kRawDex42, &dex_bytes);
 
   static constexpr bool kVerifyChecksum = true;
   DexFileLoaderErrorCode error_code;
@@ -349,6 +505,16 @@
       /* verify= */ true, kVerifyChecksum, &error_code, &error_msg, &dex_files));
 }
 
+TEST_F(DexFileLoaderTest, ContainerDex) {
+  std::vector<uint8_t> dex_bytes;
+  std::unique_ptr<const DexFile> raw(
+      OpenDexFileBase64(kRawContainerDex, kLocationString, &dex_bytes, 2));
+  ASSERT_TRUE(raw.get() != nullptr);
+
+  const DexFile::Header& header = raw->GetHeader();
+  EXPECT_EQ(41u, header.GetVersion());
+}
+
 TEST_F(DexFileLoaderTest, ZeroLengthDexRejected) {
   std::vector<uint8_t> dex_bytes;
   DecodeDexFile(kRawDexZeroLength, &dex_bytes);
@@ -463,4 +629,48 @@
   ASSERT_TRUE(accessor.DecodeDebugLocalInfo(true, 1, VoidFunctor()));
 }
 
+// Helper for tests that open and verify raw dex files to avoid boilerplate.
+void OpenAndVerify(const char* dex_file_base64, bool expected_success) {
+  std::vector<uint8_t> dex_bytes;
+  std::vector<std::unique_ptr<const DexFile>> dex_files;
+  DexFileLoaderErrorCode error_code;
+  std::string error_msg;
+  bool success = OpenDexFilesBase64(
+      dex_file_base64, kLocationString, &dex_bytes, &dex_files, &error_code, &error_msg);
+  ASSERT_EQ(success, expected_success);
+}
+
+// Bad offset for `kDexTypeHiddenapiClassData` previously triggered a `DCHECK()`
+// before verifying the dex file. We want to reject dex files with bad offsets
+// without crashing, even in debug builds. b/281960267
+TEST_F(DexFileLoaderTest, BadMapOffsets) {
+  OpenAndVerify(kRawDexBadMapOffsets, /*expected_success=*/false);
+}
+
+// Generated dex file with a string data offset out of bounds. It should fail verification without
+// crashing. b/280066537
+TEST_F(DexFileLoaderTest, StringDataOffsetOutOfBounds) {
+  OpenAndVerify(kRawDexStringDataOOB, /*expected_success=*/false);
+}
+
+TEST_F(DexFileLoaderTest, CodeItemOutOfBounds) {
+  OpenAndVerify(kRawDexCodeItemOOB, /*expected_success=*/false);
+}
+
+TEST_F(DexFileLoaderTest, HiddenAPIClassDataBadOffset) {
+  OpenAndVerify(kHiddenAPIClassDataBadOffset, /*expected_success=*/false);
+}
+
+TEST_F(DexFileLoaderTest, BadDebugInfoItem) {
+  OpenAndVerify(kRawBadDebugInfoItem, /*expected_success=*/false);
+}
+
+TEST_F(DexFileLoaderTest, IncorrectSectionSizeInHeader) {
+  OpenAndVerify(kIncorrectSectionSizeInHeader, /*expected_success=*/false);
+}
+
+TEST_F(DexFileLoaderTest, FileSizeTooSmallInHeader) {
+  OpenAndVerify(kFileSizeTooSmallInHeader, /*expected_success=*/false);
+}
+
 }  // namespace art
diff --git a/libdexfile/dex/dex_file_verifier.cc b/libdexfile/dex/dex_file_verifier.cc
index 45f7f8f..ba34720 100644
--- a/libdexfile/dex/dex_file_verifier.cc
+++ b/libdexfile/dex/dex_file_verifier.cc
@@ -20,11 +20,11 @@
 #include <bitset>
 #include <limits>
 #include <memory>
+#include <stack>
 
 #include "android-base/logging.h"
 #include "android-base/macros.h"
 #include "android-base/stringprintf.h"
-
 #include "base/hash_map.h"
 #include "base/leb128.h"
 #include "base/safe_map.h"
@@ -50,9 +50,7 @@
   return (high == 0) || ((high == 0xffffU) && (low == 0xffffU));
 }
 
-constexpr bool IsValidTypeId(uint16_t low ATTRIBUTE_UNUSED, uint16_t high) {
-  return (high == 0);
-}
+constexpr bool IsValidTypeId([[maybe_unused]] uint16_t low, uint16_t high) { return (high == 0); }
 
 constexpr uint32_t MapTypeToBitMask(DexFile::MapItemType map_item_type) {
   switch (map_item_type) {
@@ -121,70 +119,6 @@
   return IsPowerOfTwo(flags & (kAccPublic | kAccProtected | kAccPrivate));
 }
 
-// Helper functions to retrieve names from the dex file. We do not want to rely on DexFile
-// functionality, as we're still verifying the dex file. begin and header correspond to the
-// underscored variants in the DexFileVerifier.
-
-std::string GetString(const uint8_t* const begin,
-                      const DexFile::Header* const header,
-                      dex::StringIndex string_idx) {
-  // All sources of the `string_idx` have already been checked in CheckIntraSection().
-  DCHECK_LT(string_idx.index_, header->string_ids_size_);
-  const dex::StringId* string_id =
-      reinterpret_cast<const dex::StringId*>(begin + header->string_ids_off_) + string_idx.index_;
-
-  // The string offset has been checked at the start of `CheckInterSection()`
-  // to point to a string data item checked by `CheckIntraSection()`.
-  const uint8_t* ptr = begin + string_id->string_data_off_;
-  DecodeUnsignedLeb128(&ptr);  // Ignore the result.
-  return reinterpret_cast<const char*>(ptr);
-}
-
-std::string GetClass(const uint8_t* const begin,
-                     const DexFile::Header* const header,
-                     dex::TypeIndex class_idx) {
-  // All sources of `class_idx` have already been checked in CheckIntraSection().
-  CHECK_LT(class_idx.index_, header->type_ids_size_);
-
-  const dex::TypeId* type_id =
-      reinterpret_cast<const dex::TypeId*>(begin + header->type_ids_off_) + class_idx.index_;
-
-  // The `type_id->descriptor_idx_` has already been checked in CheckIntraTypeIdItem().
-  // However, it may not have been checked to be a valid descriptor, so return the raw
-  // string without converting with `PrettyDescriptor()`.
-  return GetString(begin, header, type_id->descriptor_idx_);
-}
-
-std::string GetFieldDescription(const uint8_t* const begin,
-                                const DexFile::Header* const header,
-                                uint32_t idx) {
-  // The `idx` has already been checked in `DexFileVerifier::CheckIntraClassDataItemFields()`.
-  CHECK_LT(idx, header->field_ids_size_);
-
-  const dex::FieldId* field_id =
-      reinterpret_cast<const dex::FieldId*>(begin + header->field_ids_off_) + idx;
-
-  // Indexes in `*field_id` have already been checked in CheckIntraFieldIdItem().
-  std::string class_name = GetClass(begin, header, field_id->class_idx_);
-  std::string field_name = GetString(begin, header, field_id->name_idx_);
-  return class_name + "." + field_name;
-}
-
-std::string GetMethodDescription(const uint8_t* const begin,
-                                 const DexFile::Header* const header,
-                                 uint32_t idx) {
-  // The `idx` has already been checked in `DexFileVerifier::CheckIntraClassDataItemMethods()`.
-  CHECK_LT(idx, header->method_ids_size_);
-
-  const dex::MethodId* method_id =
-      reinterpret_cast<const dex::MethodId*>(begin + header->method_ids_off_) + idx;
-
-  // Indexes in `*method_id` have already been checked in CheckIntraMethodIdItem().
-  std::string class_name = GetClass(begin, header, method_id->class_idx_);
-  std::string method_name = GetString(begin, header, method_id->name_idx_);
-  return class_name + "." + method_name;
-}
-
 }  // namespace
 
 // Note: the anonymous namespace would be nice, but we need friend access into accessors.
@@ -193,8 +127,8 @@
  public:
   DexFileVerifier(const DexFile* dex_file, const char* location, bool verify_checksum)
       : dex_file_(dex_file),
-        begin_(dex_file->Begin()),
-        size_(dex_file->Size()),
+        offset_base_address_(dex_file->DataBegin()),
+        size_(dex_file->DataSize()),
         location_(location),
         verify_checksum_(verify_checksum),
         header_(&dex_file->GetHeader()),
@@ -203,7 +137,9 @@
         init_indices_{std::numeric_limits<size_t>::max(),
                       std::numeric_limits<size_t>::max(),
                       std::numeric_limits<size_t>::max(),
-                      std::numeric_limits<size_t>::max()} {}
+                      std::numeric_limits<size_t>::max()} {
+    CHECK(!dex_file->IsCompactDexFile()) << "Not supported";
+  }
 
   bool Verify();
 
@@ -212,13 +148,93 @@
   }
 
  private:
+  template <class T = uint8_t>
+  ALWAYS_INLINE const T* OffsetToPtr(size_t offset) {
+    DCHECK_GE(offset, static_cast<size_t>(dex_file_->Begin() - offset_base_address_));
+    DCHECK_LE(offset, size_);
+    return reinterpret_cast<const T*>(offset_base_address_ + offset);
+  }
+
+  ALWAYS_INLINE size_t PtrToOffset(const void* ptr) {
+    DCHECK_GE(ptr, dex_file_->Begin());
+    DCHECK_LE(ptr, EndOfFile());
+    return reinterpret_cast<const uint8_t*>(ptr) - offset_base_address_;
+  }
+
+  // Converts the pointer `ptr` into `offset`.
+  // Returns `true` if the offset is within the bounds of the container.
+  // TODO: Try to remove this overload. Avoid creating invalid pointers.
+  ALWAYS_INLINE WARN_UNUSED bool PtrToOffset(const void* ptr, /*out*/ size_t* offset) {
+    *offset = reinterpret_cast<const uint8_t*>(ptr) - offset_base_address_;
+    return *offset <= size_;
+  }
+
+  ALWAYS_INLINE const uint8_t* EndOfFile() {
+    return OffsetToPtr(size_);
+  }
+
+  // Helper functions to retrieve names from the dex file. We do not want to rely on DexFile
+  // functionality, as we're still verifying the dex file.
+
+  std::string GetString(dex::StringIndex string_idx) {
+    // All sources of the `string_idx` have already been checked in CheckIntraSection().
+    DCHECK_LT(string_idx.index_, header_->string_ids_size_);
+    const dex::StringId& string_id =
+        OffsetToPtr<dex::StringId>(header_->string_ids_off_)[string_idx.index_];
+
+    // The string offset has been checked at the start of `CheckInterSection()`
+    // to point to a string data item checked by `CheckIntraSection()`.
+    const uint8_t* ptr = OffsetToPtr(string_id.string_data_off_);
+    DecodeUnsignedLeb128(&ptr);  // Ignore the result.
+    return reinterpret_cast<const char*>(ptr);
+  }
+
+  std::string GetClass(dex::TypeIndex class_idx) {
+    // All sources of `class_idx` have already been checked in CheckIntraSection().
+    CHECK_LT(class_idx.index_, header_->type_ids_size_);
+
+    const dex::TypeId& type_id = OffsetToPtr<dex::TypeId>(header_->type_ids_off_)[class_idx.index_];
+
+    // The `type_id->descriptor_idx_` has already been checked in CheckIntraTypeIdItem().
+    // However, it may not have been checked to be a valid descriptor, so return the raw
+    // string without converting with `PrettyDescriptor()`.
+    return GetString(type_id.descriptor_idx_);
+  }
+
+  std::string GetFieldDescription(uint32_t idx) {
+    // The `idx` has already been checked in `DexFileVerifier::CheckIntraClassDataItemFields()`.
+    CHECK_LT(idx, header_->field_ids_size_);
+
+    const dex::FieldId& field_id = OffsetToPtr<dex::FieldId>(header_->field_ids_off_)[idx];
+
+    // Indexes in `*field_id` have already been checked in CheckIntraFieldIdItem().
+    std::string class_name = GetClass(field_id.class_idx_);
+    std::string field_name = GetString(field_id.name_idx_);
+    return class_name + "." + field_name;
+  }
+
+  std::string GetMethodDescription(uint32_t idx) {
+    // The `idx` has already been checked in `DexFileVerifier::CheckIntraClassDataItemMethods()`.
+    CHECK_LT(idx, header_->method_ids_size_);
+
+    const dex::MethodId& method_id = OffsetToPtr<dex::MethodId>(header_->method_ids_off_)[idx];
+
+    // Indexes in `method_id` have already been checked in CheckIntraMethodIdItem().
+    std::string class_name = GetClass(method_id.class_idx_);
+    std::string method_name = GetString(method_id.name_idx_);
+    return class_name + "." + method_name;
+  }
+
   bool CheckShortyDescriptorMatch(char shorty_char, const char* descriptor, bool is_return_type);
   bool CheckListSize(const void* start, size_t count, size_t element_size, const char* label);
   // Check a list. The head is assumed to be at *ptr, and elements to be of size element_size. If
   // successful, the ptr will be moved forward the amount covered by the list.
   bool CheckList(size_t element_size, const char* label, const uint8_t* *ptr);
-  // Checks whether the offset is zero (when size is zero) or that the offset falls within the area
-  // claimed by the file.
+  // Checks:
+  //   * the offset is zero (when size is zero),
+  //   * the offset falls within the area claimed by the file,
+  //   * the offset + size also falls within the area claimed by the file, and
+  //   * the alignment of the section
   bool CheckValidOffsetAndSize(uint32_t offset, uint32_t size, size_t alignment, const char* label);
   // Checks whether the size is less than the limit.
   ALWAYS_INLINE bool CheckSizeLimit(uint32_t size, uint32_t limit, const char* label) {
@@ -239,14 +255,15 @@
   bool CheckHeader();
   bool CheckMap();
 
-  uint32_t ReadUnsignedLittleEndian(uint32_t size) {
-    uint32_t result = 0;
-    if (LIKELY(CheckListSize(ptr_, size, sizeof(uint8_t), "encoded_value"))) {
-      for (uint32_t i = 0; i < size; i++) {
-        result |= ((uint32_t) *(ptr_++)) << (i * 8);
-      }
+  ALWAYS_INLINE bool ReadUnsignedLittleEndian(uint32_t size, /*out*/ uint32_t* result) {
+    if (!CheckListSize(ptr_, size, sizeof(uint8_t), "encoded_value")) {
+      return false;
     }
-    return result;
+    *result = 0;
+    for (uint32_t i = 0; i < size; i++) {
+      *result |= ((uint32_t) * (ptr_++)) << (i * 8);
+    }
+    return true;
   }
   bool CheckAndGetHandlerOffsets(const dex::CodeItem* code_item,
                                  uint32_t* handler_offsets, uint32_t handlers_size);
@@ -273,10 +290,22 @@
   }
   bool CheckStaticFieldTypes(const dex::ClassDef& class_def);
 
-  bool CheckPadding(size_t offset, uint32_t aligned_offset, DexFile::MapItemType type);
+  bool CheckPadding(uint32_t aligned_offset, DexFile::MapItemType type);
+
+  // The encoded values, arrays and annotations are allowed to be very deeply nested,
+  // so use heap todo-list instead of stack recursion (the work is done in LIFO order).
+  struct ToDoItem {
+    uint32_t array_size = 0;          // CheckArrayElement.
+    uint32_t annotation_size = 0;     // CheckAnnotationElement.
+    uint32_t last_idx = kDexNoIndex;  // CheckAnnotationElement.
+  };
+  using ToDoList = std::stack<ToDoItem>;
   bool CheckEncodedValue();
   bool CheckEncodedArray();
+  bool CheckArrayElement();
   bool CheckEncodedAnnotation();
+  bool CheckAnnotationElement(/*inout*/ uint32_t* last_idx);
+  bool FlushToDoList();
 
   bool CheckIntraTypeIdItem();
   bool CheckIntraProtoIdItem();
@@ -303,7 +332,7 @@
   bool CheckIntraHiddenapiClassData();
 
   template <DexFile::MapItemType kType>
-  bool CheckIntraSectionIterate(size_t offset, uint32_t count);
+  bool CheckIntraSectionIterate(uint32_t count);
   template <DexFile::MapItemType kType>
   bool CheckIntraIdSection(size_t offset, uint32_t count);
   template <DexFile::MapItemType kType>
@@ -316,6 +345,7 @@
   uint32_t FindFirstClassDataDefiner(const ClassAccessor& accessor);
   uint32_t FindFirstAnnotationsDirectoryDefiner(const uint8_t* ptr);
 
+  bool CheckInterHiddenapiClassData();
   bool CheckInterStringIdItem();
   bool CheckInterTypeIdItem();
   bool CheckInterProtoIdItem();
@@ -368,11 +398,13 @@
   bool VerifyTypeDescriptor(dex::TypeIndex idx, const char* error_msg, ExtraCheckFn extra_check);
 
   const DexFile* const dex_file_;
-  const uint8_t* const begin_;
+  const uint8_t* const offset_base_address_;
   const size_t size_;
+  ArrayRef<const uint8_t> data_;  // The "data" section of the dex file.
   const char* const location_;
   const bool verify_checksum_;
   const DexFile::Header* const header_;
+  uint32_t dex_version_ = 0;
 
   struct OffsetTypeMapEmptyFn {
     // Make a hash map slot empty by making the offset 0. Offset 0 is a valid dex file offset that
@@ -434,6 +466,9 @@
 
   // Class definition indexes, valid only if corresponding `defined_classes_[.]` is true.
   std::vector<uint16_t> defined_class_indexes_;
+
+  // Used by CheckEncodedValue to avoid recursion. Field so we can reuse allocated memory.
+  ToDoList todo_;
 };
 
 template <typename ExtraCheckFn>
@@ -508,8 +543,8 @@
   // Check that element size is not 0.
   DCHECK_NE(elem_size, 0U);
 
-  size_t offset = reinterpret_cast<const uint8_t*>(start) - begin_;
-  if (UNLIKELY(offset > size_)) {
+  size_t offset;
+  if (!PtrToOffset(start, &offset)) {
     ErrorStringPrintf("Offset beyond end of file for %s: %zx to %zx", label, offset, size_);
     return false;
   }
@@ -552,11 +587,24 @@
       ErrorStringPrintf("Offset(%d) should be zero when size is zero for %s.", offset, label);
       return false;
     }
+    return true;
+  }
+  size_t hdr_offset = PtrToOffset(header_);
+  if (offset < hdr_offset) {
+    ErrorStringPrintf("Offset(%d) should be after header(%zu) for %s.", offset, hdr_offset, label);
+    return false;
   }
   if (size_ <= offset) {
     ErrorStringPrintf("Offset(%d) should be within file size(%zu) for %s.", offset, size_, label);
     return false;
   }
+  // Check that offset + size is within the file size. Note that we use `<` to allow the section to
+  // end at the same point as the file. Check written as a subtraction to be safe from overfow.
+  if (size_ - offset < size) {
+    ErrorStringPrintf(
+        "Section end(%d) should be within file size(%zu) for %s.", offset + size, size_, label);
+    return false;
+  }
   if (alignment != 0 && !IsAlignedParam(offset, alignment)) {
     ErrorStringPrintf("Offset(%d) should be aligned by %zu for %s.", offset, alignment, label);
     return false;
@@ -565,15 +613,49 @@
 }
 
 bool DexFileVerifier::CheckHeader() {
+  // Check magic.
+  size_t size = dex_file_->GetContainer()->End() - dex_file_->Begin();
+  if (size < sizeof(DexFile::Header)) {
+    ErrorStringPrintf("Empty or truncated file.");
+    return false;
+  }
+  if (!StandardDexFile::IsMagicValid(header_->magic_.data())) {
+    ErrorStringPrintf("Bad file magic");
+    return false;
+  }
+  if (!StandardDexFile::IsVersionValid(header_->magic_.data())) {
+    ErrorStringPrintf("Unknown dex version");
+    return false;
+  }
+  dex_version_ = header_->GetVersion();
+
   // Check file size from the header.
-  uint32_t expected_size = header_->file_size_;
-  if (size_ != expected_size) {
-    ErrorStringPrintf("Bad file size (%zd, expected %u)", size_, expected_size);
+  size_t file_size = header_->file_size_;
+  size_t header_size = (dex_version_ >= 41) ? sizeof(DexFile::HeaderV41) : sizeof(DexFile::Header);
+  if (file_size < header_size) {
+    ErrorStringPrintf("Bad file size (%zu, expected at least %zu)", file_size, header_size);
+    return false;
+  }
+  if (file_size > size) {
+    ErrorStringPrintf("Bad file size (%zu, expected at most %zu)", file_size, size);
+    return false;
+  }
+  CHECK_GE(size, header_size);  // Implied by the two checks above.
+
+  // Check header size.
+  if (header_->header_size_ != header_size) {
+    ErrorStringPrintf("Bad header size: %ud expected %zud", header_->header_size_, header_size);
     return false;
   }
 
-  uint32_t adler_checksum = dex_file_->CalculateChecksum();
+  // Check the endian.
+  if (header_->endian_tag_ != DexFile::kDexEndianConstant) {
+    ErrorStringPrintf("Unexpected endian_tag: %x", header_->endian_tag_);
+    return false;
+  }
+
   // Compute and verify the checksum in the header.
+  uint32_t adler_checksum = dex_file_->CalculateChecksum();
   if (adler_checksum != header_->checksum_) {
     if (verify_checksum_) {
       ErrorStringPrintf("Bad checksum (%08x, expected %08x)", adler_checksum, header_->checksum_);
@@ -584,31 +666,30 @@
     }
   }
 
-  // Check the contents of the header.
-  if (header_->endian_tag_ != DexFile::kDexEndianConstant) {
-    ErrorStringPrintf("Unexpected endian_tag: %x", header_->endian_tag_);
-    return false;
-  }
-
-  const uint32_t expected_header_size = dex_file_->IsCompactDexFile()
-      ? sizeof(CompactDexFile::Header)
-      : sizeof(StandardDexFile::Header);
-
-  if (header_->header_size_ != expected_header_size) {
-    ErrorStringPrintf("Bad header size: %ud expected %ud",
-                      header_->header_size_,
-                      expected_header_size);
-    return false;
+  if (dex_version_ >= 41) {
+    auto headerV41 = reinterpret_cast<const DexFile::HeaderV41*>(header_);
+    if (headerV41->container_size_ <= headerV41->header_offset_) {
+      ErrorStringPrintf("Dex container is too small: size=%ud header_offset=%ud",
+                        headerV41->container_size_,
+                        headerV41->header_offset_);
+      return false;
+    }
+    uint32_t remainder = headerV41->container_size_ - headerV41->header_offset_;
+    if (headerV41->file_size_ > remainder) {
+      ErrorStringPrintf(
+          "Header file_size(%ud) is past multi-dex size(%ud)", headerV41->file_size_, remainder);
+      return false;
+    }
   }
 
   // Check that all offsets are inside the file.
-  bool result =
+  bool ok =
       CheckValidOffsetAndSize(header_->link_off_,
                               header_->link_size_,
                               /* alignment= */ 0,
                               "link") &&
       CheckValidOffsetAndSize(header_->map_off_,
-                              header_->map_off_,
+                              sizeof(dex::MapList),
                               /* alignment= */ 4,
                               "map") &&
       CheckValidOffsetAndSize(header_->string_ids_off_,
@@ -643,11 +724,17 @@
                               // is supposed to be a multiple of 4.
                               /* alignment= */ 0,
                               "data");
-  return result;
+
+  if (ok) {
+    data_ = (dex_version_ >= 41)
+        ? ArrayRef<const uint8_t>(dex_file_->Begin(), EndOfFile() - dex_file_->Begin())
+        : ArrayRef<const uint8_t>(OffsetToPtr(header_->data_off_), header_->data_size_);
+  }
+  return ok;
 }
 
 bool DexFileVerifier::CheckMap() {
-  const dex::MapList* map = reinterpret_cast<const dex::MapList*>(begin_ + header_->map_off_);
+  const dex::MapList* map = OffsetToPtr<dex::MapList>(header_->map_off_);
   // Check that map list content is available.
   if (!CheckListSize(map, 1, sizeof(dex::MapList), "maplist content")) {
     return false;
@@ -659,7 +746,7 @@
   uint32_t last_offset = 0;
   uint32_t last_type = 0;
   uint32_t data_item_count = 0;
-  uint32_t data_items_left = header_->data_size_;
+  uint32_t data_items_left = data_.size();
   uint32_t used_bits = 0;
 
   // Check the validity of the size of the map list.
@@ -677,9 +764,8 @@
                         last_type);
       return false;
     }
-    if (UNLIKELY(item->offset_ >= header_->file_size_)) {
-      ErrorStringPrintf("Map item after end of file: %x, size %x",
-                        item->offset_, header_->file_size_);
+    if (UNLIKELY(item->offset_ >= size_)) {
+      ErrorStringPrintf("Map item after end of file: %x, size %zx", item->offset_, size_);
       return false;
     }
 
@@ -756,22 +842,16 @@
   return true;
 }
 
-#define DECODE_UNSIGNED_CHECKED_FROM_WITH_ERROR_VALUE(ptr, var, error_value)  \
-  uint32_t var;                                                               \
-  if (!DecodeUnsignedLeb128Checked(&(ptr), begin_ + size_, &(var))) {         \
-    return error_value;                                                       \
-  }
-
 #define DECODE_UNSIGNED_CHECKED_FROM(ptr, var)                        \
   uint32_t var;                                                       \
-  if (!DecodeUnsignedLeb128Checked(&(ptr), begin_ + size_, &(var))) { \
+  if (!DecodeUnsignedLeb128Checked(&(ptr), EndOfFile(), &(var))) {    \
     ErrorStringPrintf("Read out of bounds");                          \
     return false;                                                     \
   }
 
 #define DECODE_SIGNED_CHECKED_FROM(ptr, var)                        \
   int32_t var;                                                      \
-  if (!DecodeSignedLeb128Checked(&(ptr), begin_ + size_, &(var))) { \
+  if (!DecodeSignedLeb128Checked(&(ptr), EndOfFile(), &(var))) {    \
     ErrorStringPrintf("Read out of bounds");                        \
     return false;                                                   \
   }
@@ -835,7 +915,7 @@
 
   // Check that it's the right class.
   dex::TypeIndex my_class_index =
-      (reinterpret_cast<const dex::FieldId*>(begin_ + header_->field_ids_off_) + idx)->class_idx_;
+      OffsetToPtr<dex::FieldId>(header_->field_ids_off_)[idx].class_idx_;
   if (class_type_index != my_class_index) {
     ErrorStringPrintf("Field's class index unexpected, %" PRIu16 "vs %" PRIu16,
                       my_class_index.index_,
@@ -862,8 +942,7 @@
   // The `idx` has already been checked in `CheckIntraClassDataItemMethods()`.
   DCHECK_LT(idx, header_->method_ids_size_);
 
-  const dex::MethodId& method_id =
-      *(reinterpret_cast<const dex::MethodId*>(begin_ + header_->method_ids_off_) + idx);
+  const dex::MethodId& method_id = OffsetToPtr<dex::MethodId>(header_->method_ids_off_)[idx];
 
   // Check that it's the right class.
   dex::TypeIndex my_class_index = method_id.class_idx_;
@@ -916,13 +995,17 @@
   return true;
 }
 
-bool DexFileVerifier::CheckPadding(size_t offset,
-                                   uint32_t aligned_offset,
+bool DexFileVerifier::CheckPadding(uint32_t aligned_offset,
                                    DexFile::MapItemType type) {
+  size_t offset = PtrToOffset(ptr_);
   if (offset < aligned_offset) {
-    if (!CheckListSize(begin_ + offset, aligned_offset - offset, sizeof(uint8_t), "section")) {
+    if (!CheckListSize(OffsetToPtr(offset), aligned_offset - offset, sizeof(uint8_t), "section")) {
       return false;
     }
+    if (dex_version_ >= 41) {
+      ptr_ += aligned_offset - offset;
+      return true;
+    }
     while (offset < aligned_offset) {
       if (UNLIKELY(*ptr_ != '\0')) {
         ErrorStringPrintf("Non-zero padding %x before section of type %zu at offset 0x%zx",
@@ -948,39 +1031,58 @@
   uint32_t value_arg = header_byte >> DexFile::kDexAnnotationValueArgShift;
 
   switch (value_type) {
-    case DexFile::kDexAnnotationByte:
+    case DexFile::kDexAnnotationByte: {
       if (UNLIKELY(value_arg != 0)) {
         ErrorStringPrintf("Bad encoded_value byte size %x", value_arg);
         return false;
       }
-      ptr_++;
+      uint32_t value;
+      if (!ReadUnsignedLittleEndian(value_arg + 1, &value)) {
+        return false;
+      }
       break;
+    }
     case DexFile::kDexAnnotationShort:
-    case DexFile::kDexAnnotationChar:
+    case DexFile::kDexAnnotationChar: {
       if (UNLIKELY(value_arg > 1)) {
         ErrorStringPrintf("Bad encoded_value char/short size %x", value_arg);
         return false;
       }
-      ptr_ += value_arg + 1;
+      uint32_t value;
+      if (!ReadUnsignedLittleEndian(value_arg + 1, &value)) {
+        return false;
+      }
       break;
+    }
     case DexFile::kDexAnnotationInt:
-    case DexFile::kDexAnnotationFloat:
+    case DexFile::kDexAnnotationFloat: {
       if (UNLIKELY(value_arg > 3)) {
         ErrorStringPrintf("Bad encoded_value int/float size %x", value_arg);
         return false;
       }
-      ptr_ += value_arg + 1;
+      uint32_t value;
+      if (!ReadUnsignedLittleEndian(value_arg + 1, &value)) {
+        return false;
+      }
       break;
+    }
     case DexFile::kDexAnnotationLong:
-    case DexFile::kDexAnnotationDouble:
-      ptr_ += value_arg + 1;
+    case DexFile::kDexAnnotationDouble: {
+      uint32_t value;
+      if (!ReadUnsignedLittleEndian(value_arg + 1, &value)) {
+        return false;
+      }
       break;
+    }
     case DexFile::kDexAnnotationString: {
       if (UNLIKELY(value_arg > 3)) {
         ErrorStringPrintf("Bad encoded_value string size %x", value_arg);
         return false;
       }
-      uint32_t idx = ReadUnsignedLittleEndian(value_arg + 1);
+      uint32_t idx;
+      if (!ReadUnsignedLittleEndian(value_arg + 1, &idx)) {
+        return false;
+      }
       if (!CheckIndex(idx, header_->string_ids_size_, "encoded_value string")) {
         return false;
       }
@@ -991,7 +1093,10 @@
         ErrorStringPrintf("Bad encoded_value type size %x", value_arg);
         return false;
       }
-      uint32_t idx = ReadUnsignedLittleEndian(value_arg + 1);
+      uint32_t idx;
+      if (!ReadUnsignedLittleEndian(value_arg + 1, &idx)) {
+        return false;
+      }
       if (!CheckIndex(idx, header_->type_ids_size_, "encoded_value type")) {
         return false;
       }
@@ -1003,7 +1108,10 @@
         ErrorStringPrintf("Bad encoded_value field/enum size %x", value_arg);
         return false;
       }
-      uint32_t idx = ReadUnsignedLittleEndian(value_arg + 1);
+      uint32_t idx;
+      if (!ReadUnsignedLittleEndian(value_arg + 1, &idx)) {
+        return false;
+      }
       if (!CheckIndex(idx, header_->field_ids_size_, "encoded_value field")) {
         return false;
       }
@@ -1014,7 +1122,10 @@
         ErrorStringPrintf("Bad encoded_value method size %x", value_arg);
         return false;
       }
-      uint32_t idx = ReadUnsignedLittleEndian(value_arg + 1);
+      uint32_t idx;
+      if (!ReadUnsignedLittleEndian(value_arg + 1, &idx)) {
+        return false;
+      }
       if (!CheckIndex(idx, header_->method_ids_size_, "encoded_value method")) {
         return false;
       }
@@ -1055,7 +1166,10 @@
         ErrorStringPrintf("Bad encoded_value method type size %x", value_arg);
         return false;
       }
-      uint32_t idx = ReadUnsignedLittleEndian(value_arg + 1);
+      uint32_t idx;
+      if (!ReadUnsignedLittleEndian(value_arg + 1, &idx)) {
+        return false;
+      }
       if (!CheckIndex(idx, header_->proto_ids_size_, "method_type value")) {
         return false;
       }
@@ -1066,7 +1180,10 @@
         ErrorStringPrintf("Bad encoded_value method handle size %x", value_arg);
         return false;
       }
-      uint32_t idx = ReadUnsignedLittleEndian(value_arg + 1);
+      uint32_t idx;
+      if (!ReadUnsignedLittleEndian(value_arg + 1, &idx)) {
+        return false;
+      }
       if (!CheckIndex(idx, dex_file_->NumMethodHandles(), "method_handle value")) {
         return false;
       }
@@ -1082,12 +1199,15 @@
 
 bool DexFileVerifier::CheckEncodedArray() {
   DECODE_UNSIGNED_CHECKED_FROM(ptr_, size);
+  todo_.emplace(ToDoItem{.array_size = size});
+  return true;
+}
 
-  for (; size != 0u; --size) {
-    if (!CheckEncodedValue()) {
-      failure_reason_ = StringPrintf("Bad encoded_array value: %s", failure_reason_.c_str());
-      return false;
-    }
+// Always called directly from FlushToDoList, which avoids recursion.
+bool DexFileVerifier::CheckArrayElement() {
+  if (!CheckEncodedValue()) {
+    failure_reason_ = StringPrintf("Bad encoded_array value: %s", failure_reason_.c_str());
+    return false;
   }
   return true;
 }
@@ -1099,25 +1219,44 @@
   }
 
   DECODE_UNSIGNED_CHECKED_FROM(ptr_, size);
-  uint32_t last_idx = 0;
+  todo_.emplace(ToDoItem{.annotation_size = size, .last_idx = kDexNoIndex});
+  return true;
+}
 
-  for (uint32_t i = 0; i < size; i++) {
-    DECODE_UNSIGNED_CHECKED_FROM(ptr_, idx);
-    if (!CheckIndex(idx, header_->string_ids_size_, "annotation_element name_idx")) {
-      return false;
+// Always called directly from FlushToDoList, which avoids recursion.
+bool DexFileVerifier::CheckAnnotationElement(/*inout*/ uint32_t* last_idx) {
+  DECODE_UNSIGNED_CHECKED_FROM(ptr_, idx);
+  if (!CheckIndex(idx, header_->string_ids_size_, "annotation_element name_idx")) {
+    return false;
+  }
+
+  if (UNLIKELY(*last_idx >= idx && *last_idx != kDexNoIndex)) {
+    ErrorStringPrintf("Out-of-order annotation_element name_idx: %x then %x", *last_idx, idx);
+    return false;
+  }
+  *last_idx = idx;
+
+  return CheckEncodedValue();
+}
+
+// Keep processing the rest of the to-do list until we are finished or encounter an error.
+bool DexFileVerifier::FlushToDoList() {
+  while (!todo_.empty()) {
+    ToDoItem& item = todo_.top();
+    DCHECK(item.array_size == 0u || item.annotation_size == 0u);
+    if (item.array_size > 0) {
+      item.array_size--;
+      if (!CheckArrayElement()) {
+        return false;
+      }
+    } else if (item.annotation_size > 0) {
+      item.annotation_size--;
+      if (!CheckAnnotationElement(&item.last_idx)) {
+        return false;
+      }
+    } else {
+      todo_.pop();
     }
-
-    if (UNLIKELY(last_idx >= idx && i != 0)) {
-      ErrorStringPrintf("Out-of-order annotation_element name_idx: %x then %x",
-                        last_idx, idx);
-      return false;
-    }
-
-    if (!CheckEncodedValue()) {
-      return false;
-    }
-
-    last_idx = idx;
   }
   return true;
 }
@@ -1209,7 +1348,10 @@
         ErrorStringPrintf("unexpected static field initial value type: %x", array_type);
         return false;
     }
-    array_it.Next();
+    if (!array_it.MaybeNext()) {
+      ErrorStringPrintf("unexpected encoded value type: '%c'", array_it.GetValueType());
+      return false;
+    }
   }
 
   if (array_it.HasNext()) {
@@ -1385,13 +1527,12 @@
 
   // We cannot use ClassAccessor::Field yet as it could read beyond the end of the data section.
   const uint8_t* ptr = ptr_;
-  const uint8_t* data_end = begin_ + header_->data_off_ + header_->data_size_;
 
   uint32_t prev_index = 0;
   for (size_t i = 0; i != count; ++i) {
     uint32_t field_idx_diff, access_flags;
-    if (UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_end, &field_idx_diff)) ||
-        UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_end, &access_flags))) {
+    if (UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_.end(), &field_idx_diff)) ||
+        UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_.end(), &access_flags))) {
       ErrorStringPrintf("encoded_field read out of bounds");
       return false;
     }
@@ -1425,7 +1566,6 @@
 
   // We cannot use ClassAccessor::Method yet as it could read beyond the end of the data section.
   const uint8_t* ptr = ptr_;
-  const uint8_t* data_end = begin_ + header_->data_off_ + header_->data_size_;
 
   // Load the first direct method for the check below.
   size_t remaining_direct_methods = num_direct_methods;
@@ -1437,9 +1577,9 @@
   uint32_t prev_index = 0;
   for (size_t i = 0; i != num_methods; ++i) {
     uint32_t method_idx_diff, access_flags, code_off;
-    if (UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_end, &method_idx_diff)) ||
-        UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_end, &access_flags)) ||
-        UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_end, &code_off))) {
+    if (UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_.end(), &method_idx_diff)) ||
+        UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_.end(), &access_flags)) ||
+        UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_.end(), &code_off))) {
       ErrorStringPrintf("encoded_method read out of bounds");
       return false;
     }
@@ -1485,13 +1625,11 @@
 bool DexFileVerifier::CheckIntraClassDataItem() {
   // We cannot use ClassAccessor yet as it could read beyond the end of the data section.
   const uint8_t* ptr = ptr_;
-  const uint8_t* data_end = begin_ + header_->data_off_ + header_->data_size_;
-
   uint32_t static_fields_size, instance_fields_size, direct_methods_size, virtual_methods_size;
-  if (UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_end, &static_fields_size)) ||
-      UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_end, &instance_fields_size)) ||
-      UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_end, &direct_methods_size)) ||
-      UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_end, &virtual_methods_size))) {
+  if (UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_.end(), &static_fields_size)) ||
+      UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_.end(), &instance_fields_size)) ||
+      UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_.end(), &direct_methods_size)) ||
+      UNLIKELY(!DecodeUnsignedLeb128Checked(&ptr, data_.end(), &virtual_methods_size))) {
     ErrorStringPrintf("class_data_item read out of bounds");
     return false;
   }
@@ -1523,7 +1661,9 @@
 
 bool DexFileVerifier::CheckIntraCodeItem() {
   const dex::CodeItem* code_item = reinterpret_cast<const dex::CodeItem*>(ptr_);
-  if (!CheckListSize(code_item, 1, sizeof(dex::CodeItem), "code")) {
+
+  DCHECK(dex_file_->IsStandardDexFile());
+  if (!CheckListSize(code_item, 1, sizeof(StandardDexFile::CodeItem), "code")) {
     return false;
   }
 
@@ -1559,14 +1699,14 @@
     return true;
   }
 
-  // try_items are 4-byte aligned. Verify the spacer is 0.
-  if (((reinterpret_cast<uintptr_t>(&insns[insns_size]) & 3) != 0) && (insns[insns_size] != 0)) {
-    ErrorStringPrintf("Non-zero padding: %x", insns[insns_size]);
+  const dex::TryItem* try_items = accessor.TryItems().begin();
+  if (!CheckListSize(try_items, try_items_size, sizeof(dex::TryItem), "try_items size")) {
     return false;
   }
 
-  const dex::TryItem* try_items = accessor.TryItems().begin();
-  if (!CheckListSize(try_items, try_items_size, sizeof(dex::TryItem), "try_items size")) {
+  // try_items are 4-byte aligned. Verify the spacer is 0.
+  if (((reinterpret_cast<uintptr_t>(&insns[insns_size]) & 3) != 0) && (insns[insns_size] != 0)) {
+    ErrorStringPrintf("Non-zero padding: %x", insns[insns_size]);
     return false;
   }
 
@@ -1634,15 +1774,18 @@
 
 bool DexFileVerifier::CheckIntraStringDataItem() {
   DECODE_UNSIGNED_CHECKED_FROM(ptr_, size);
-  const uint8_t* file_end = begin_ + size_;
+  const uint8_t* file_end = EndOfFile();
+
+  size_t available_bytes = static_cast<size_t>(file_end - ptr_);
+  if (available_bytes < size) {
+    ErrorStringPrintf("String data would go beyond end-of-file");
+    return false;
+  }
+  // Eagerly subtract one byte per character.
+  available_bytes -= size;
 
   for (uint32_t i = 0; i < size; i++) {
     CHECK_LT(i, size);  // b/15014252 Prevents hitting the impossible case below
-    if (UNLIKELY(ptr_ >= file_end)) {
-      ErrorStringPrintf("String data would go beyond end-of-file");
-      return false;
-    }
-
     uint8_t byte = *(ptr_++);
 
     // Switch on the high 4 bits.
@@ -1676,6 +1819,12 @@
       case 0x0c:
       case 0x0d: {
         // Bit pattern 110x has an additional byte.
+        if (available_bytes < 1u) {
+          ErrorStringPrintf("String data would go beyond end-of-file");
+          return false;
+        }
+        available_bytes -= 1u;
+
         uint8_t byte2 = *(ptr_++);
         if (UNLIKELY((byte2 & 0xc0) != 0x80)) {
           ErrorStringPrintf("Illegal continuation byte %x in string data", byte2);
@@ -1690,6 +1839,12 @@
       }
       case 0x0e: {
         // Bit pattern 1110 has 2 additional bytes.
+        if (available_bytes < 2u) {
+          ErrorStringPrintf("String data would go beyond end-of-file");
+          return false;
+        }
+        available_bytes -= 2u;
+
         uint8_t byte2 = *(ptr_++);
         if (UNLIKELY((byte2 & 0xc0) != 0x80)) {
           ErrorStringPrintf("Illegal continuation byte %x in string data", byte2);
@@ -1710,11 +1865,18 @@
     }
   }
 
+  if (available_bytes < 1u) {
+    ErrorStringPrintf("String data would go beyond end-of-file");
+    return false;
+  }
+  available_bytes -= 1u;
+
   if (UNLIKELY(*(ptr_++) != '\0')) {
     ErrorStringPrintf("String longer than indicated size %x", size);
     return false;
   }
 
+  DCHECK_EQ(available_bytes, static_cast<size_t>(file_end - ptr_));
   return true;
 }
 
@@ -1737,6 +1899,10 @@
   }
 
   while (true) {
+    if (UNLIKELY(ptr_ >= EndOfFile())) {
+      // Went past the end.
+      return false;
+    }
     uint8_t opcode = *(ptr_++);
     switch (opcode) {
       case DexFile::DBG_END_SEQUENCE: {
@@ -1830,17 +1996,19 @@
   }
 
   // Check visibility
-  switch (*(ptr_++)) {
+  uint8_t visibility = *(ptr_++);
+  switch (visibility) {
     case DexFile::kDexVisibilityBuild:
     case DexFile::kDexVisibilityRuntime:
     case DexFile::kDexVisibilitySystem:
       break;
     default:
-      ErrorStringPrintf("Bad annotation visibility: %x", *ptr_);
+      ErrorStringPrintf("Bad annotation visibility: %x", visibility);
       return false;
   }
 
-  if (!CheckEncodedAnnotation()) {
+  CHECK(todo_.empty());
+  if (!CheckEncodedAnnotation() || !FlushToDoList()) {
     return false;
   }
 
@@ -1870,80 +2038,10 @@
     return false;
   }
 
+  // The rest of the section depends on the class_data_item being verified first. We will finalize
+  // verifying the hiddenapi_class_data_item in CheckInterHiddenapiClassData.
   const uint8_t* data_end = ptr_ + item->size_;
-  ptr_ += header_size;
-
-  // Check offsets for each class def.
-  for (uint32_t i = 0; i < dex_file_->NumClassDefs(); ++i) {
-    const dex::ClassDef& class_def = dex_file_->GetClassDef(i);
-    const uint8_t* class_data = dex_file_->GetClassData(class_def);
-    uint32_t offset = item->flags_offset_[i];
-
-    if (offset == 0) {
-      continue;
-    }
-
-    // Check that class defs with no class data do not have any hiddenapi class data.
-    if (class_data == nullptr) {
-      ErrorStringPrintf(
-          "Hiddenapi class data offset not zero for class def %u with no class data", i);
-      return false;
-    }
-
-    // Check that the offset is within the section.
-    if (offset > item->size_) {
-      ErrorStringPrintf(
-          "Hiddenapi class data offset out of section bounds (%u > %u) for class def %u",
-          offset, item->size_, i);
-      return false;
-    }
-
-    // Check that the offset matches current pointer position. We do not allow
-    // offsets into already parsed data, or gaps between class def data.
-    uint32_t ptr_offset = ptr_ - reinterpret_cast<const uint8_t*>(item);
-    if (offset != ptr_offset) {
-      ErrorStringPrintf(
-          "Hiddenapi class data unexpected offset (%u != %u) for class def %u",
-          offset, ptr_offset, i);
-      return false;
-    }
-
-    // Parse a uleb128 value for each field and method of this class.
-    bool failure = false;
-    auto fn_member = [&](const ClassAccessor::BaseItem& member, const char* member_type) {
-      if (failure) {
-        return;
-      }
-      uint32_t decoded_flags;
-      if (!DecodeUnsignedLeb128Checked(&ptr_, data_end, &decoded_flags)) {
-        ErrorStringPrintf("Hiddenapi class data value out of bounds (%p > %p) for %s %i",
-                          ptr_, data_end, member_type, member.GetIndex());
-        failure = true;
-        return;
-      }
-      if (!hiddenapi::ApiList(decoded_flags).IsValid()) {
-        ErrorStringPrintf("Hiddenapi class data flags invalid (%u) for %s %i",
-                          decoded_flags, member_type, member.GetIndex());
-        failure = true;
-        return;
-      }
-    };
-    auto fn_field = [&](const ClassAccessor::Field& field) { fn_member(field, "field"); };
-    auto fn_method = [&](const ClassAccessor::Method& method) { fn_member(method, "method"); };
-    ClassAccessor accessor(*dex_file_, class_data);
-    accessor.VisitFieldsAndMethods(fn_field, fn_field, fn_method, fn_method);
-    if (failure) {
-      return false;
-    }
-  }
-
-  if (ptr_ != data_end) {
-    ErrorStringPrintf("Hiddenapi class data wrong reported size (%u != %u)",
-                       static_cast<uint32_t>(ptr_ - reinterpret_cast<const uint8_t*>(item)),
-                       item->size_);
-    return false;
-  }
-
+  ptr_ = data_end;
   return true;
 }
 
@@ -2035,7 +2133,7 @@
 }
 
 template <DexFile::MapItemType kType>
-bool DexFileVerifier::CheckIntraSectionIterate(size_t offset, uint32_t section_count) {
+bool DexFileVerifier::CheckIntraSectionIterate(uint32_t section_count) {
   // Get the right alignment mask for the type of section.
   size_t alignment_mask;
   switch (kType) {
@@ -2053,10 +2151,10 @@
 
   // Iterate through the items in the section.
   for (uint32_t i = 0; i < section_count; i++) {
-    size_t aligned_offset = (offset + alignment_mask) & ~alignment_mask;
+    size_t aligned_offset = (PtrToOffset(ptr_) + alignment_mask) & ~alignment_mask;
 
     // Check the padding between items.
-    if (!CheckPadding(offset, aligned_offset, kType)) {
+    if (!CheckPadding(aligned_offset, kType)) {
       return false;
     }
 
@@ -2162,7 +2260,8 @@
         break;
       }
       case DexFile::kDexTypeEncodedArrayItem: {
-        if (!CheckEncodedArray()) {
+        CHECK(todo_.empty());
+        if (!CheckEncodedArray() || !FlushToDoList()) {
           return false;
         }
         break;
@@ -2198,13 +2297,10 @@
       offset_to_type_map_.insert(std::pair<uint32_t, uint16_t>(aligned_offset, kType));
     }
 
-    aligned_offset = ptr_ - begin_;
-    if (UNLIKELY(aligned_offset > size_)) {
+    if (!PtrToOffset(ptr_, &aligned_offset)) {
       ErrorStringPrintf("Item %d at ends out of bounds", i);
       return false;
     }
-
-    offset = aligned_offset;
   }
 
   return true;
@@ -2256,13 +2352,13 @@
     return false;
   }
 
-  return CheckIntraSectionIterate<kType>(offset, count);
+  return CheckIntraSectionIterate<kType>(count);
 }
 
 template <DexFile::MapItemType kType>
 bool DexFileVerifier::CheckIntraDataSection(size_t offset, uint32_t count) {
-  size_t data_start = header_->data_off_;
-  size_t data_end = data_start + header_->data_size_;
+  size_t data_start = PtrToOffset(data_.begin());
+  size_t data_end = PtrToOffset(data_.end());
 
   // Check the validity of the offset of the section.
   if (UNLIKELY((offset < data_start) || (offset > data_end))) {
@@ -2270,14 +2366,14 @@
     return false;
   }
 
-  if (!CheckIntraSectionIterate<kType>(offset, count)) {
+  if (!CheckIntraSectionIterate<kType>(count)) {
     return false;
   }
 
   // FIXME: Doing this check late means we may have already read memory outside the
   // data section and potentially outside the file, thus risking a segmentation fault.
-  size_t next_offset = ptr_ - begin_;
-  if (next_offset > data_end) {
+  size_t next_offset;
+  if (!PtrToOffset(ptr_, &next_offset) || next_offset > data_end) {
     ErrorStringPrintf("Out-of-bounds end of data subsection: %zu data_off=%u data_size=%u",
                       next_offset,
                       header_->data_off_,
@@ -2289,11 +2385,10 @@
 }
 
 bool DexFileVerifier::CheckIntraSection() {
-  const dex::MapList* map = reinterpret_cast<const dex::MapList*>(begin_ + header_->map_off_);
+  const dex::MapList* map = OffsetToPtr<dex::MapList>(header_->map_off_);
   const dex::MapItem* item = map->list_;
-  size_t offset = 0;
   uint32_t count = map->size_;
-  ptr_ = begin_;
+  ptr_ = dex_file_->Begin();
 
   // Preallocate offset map to avoid some allocations. We can only guess from the list items,
   // not derived things.
@@ -2304,44 +2399,42 @@
 
   // Check the items listed in the map.
   for (; count != 0u; --count) {
-    const size_t current_offset = offset;
+    const uint8_t* initial_ptr = ptr_;
     uint32_t section_offset = item->offset_;
     uint32_t section_count = item->size_;
     DexFile::MapItemType type = static_cast<DexFile::MapItemType>(item->type_);
 
     // Check for padding and overlap between items.
-    if (!CheckPadding(offset, section_offset, type)) {
-      return false;
-    } else if (UNLIKELY(offset > section_offset)) {
+    size_t offset = PtrToOffset(ptr_);
+    if (UNLIKELY(offset > section_offset)) {
       ErrorStringPrintf("Section overlap or out-of-order map: %zx, %x", offset, section_offset);
       return false;
     }
-
-    if (type == DexFile::kDexTypeClassDataItem) {
-      FindStringRangesForMethodNames();
+    if (!CheckPadding(section_offset, type)) {
+      return false;
     }
 
     // Check each item based on its type.
     switch (type) {
-      case DexFile::kDexTypeHeaderItem:
+      case DexFile::kDexTypeHeaderItem: {
         if (UNLIKELY(section_count != 1)) {
           ErrorStringPrintf("Multiple header items");
           return false;
         }
-        if (UNLIKELY(section_offset != 0)) {
-          ErrorStringPrintf("Header at %x, not at start of file", section_offset);
+        uint32_t expected = dex_version_ >= 41 ? PtrToOffset(dex_file_->Begin()) : 0;
+        if (UNLIKELY(section_offset != expected)) {
+          ErrorStringPrintf("Header at %x, expected %x", section_offset, expected);
           return false;
         }
-        ptr_ = begin_ + header_->header_size_;
-        offset = header_->header_size_;
+        ptr_ += header_->header_size_;
         break;
+      }
 
 #define CHECK_INTRA_ID_SECTION_CASE(type)                                   \
       case type:                                                            \
         if (!CheckIntraIdSection<type>(section_offset, section_count)) {    \
           return false;                                                     \
         }                                                                   \
-        offset = ptr_ - begin_;                                             \
         break;
       CHECK_INTRA_ID_SECTION_CASE(DexFile::kDexTypeStringIdItem)
       CHECK_INTRA_ID_SECTION_CASE(DexFile::kDexTypeTypeIdItem)
@@ -2362,15 +2455,13 @@
           return false;
         }
         ptr_ += sizeof(uint32_t) + (map->size_ * sizeof(dex::MapItem));
-        offset = section_offset + sizeof(uint32_t) + (map->size_ * sizeof(dex::MapItem));
         break;
 
 #define CHECK_INTRA_SECTION_ITERATE_CASE(type)                                 \
       case type:                                                               \
-        if (!CheckIntraSectionIterate<type>(section_offset, section_count)) {  \
+        if (!CheckIntraSectionIterate<type>(section_count)) {  \
           return false;                                                        \
         }                                                                      \
-        offset = ptr_ - begin_;                                                \
         break;
       CHECK_INTRA_SECTION_ITERATE_CASE(DexFile::kDexTypeMethodHandleItem)
       CHECK_INTRA_SECTION_ITERATE_CASE(DexFile::kDexTypeCallSiteIdItem)
@@ -2381,7 +2472,6 @@
         if (!CheckIntraDataSection<type>(section_offset, section_count)) {  \
           return false;                                                     \
         }                                                                   \
-        offset = ptr_ - begin_;                                             \
         break;
       CHECK_INTRA_DATA_SECTION_CASE(DexFile::kDexTypeTypeList)
       CHECK_INTRA_DATA_SECTION_CASE(DexFile::kDexTypeAnnotationSetRefList)
@@ -2397,9 +2487,9 @@
 #undef CHECK_INTRA_DATA_SECTION_CASE
     }
 
-    if (offset == current_offset) {
-        ErrorStringPrintf("Unknown map item type %x", type);
-        return false;
+    if (ptr_ == initial_ptr) {
+      ErrorStringPrintf("Unknown map item type %x", type);
+      return false;
     }
 
     item++;
@@ -2409,7 +2499,7 @@
 }
 
 bool DexFileVerifier::CheckOffsetToTypeMap(size_t offset, uint16_t type) {
-  DCHECK_NE(offset, 0u);
+  DCHECK(offset_to_type_map_.find(0) == offset_to_type_map_.end());
   auto it = offset_to_type_map_.find(offset);
   if (UNLIKELY(it == offset_to_type_map_.end())) {
     ErrorStringPrintf("No data map entry found @ %zx; expected %x", offset, type);
@@ -2470,6 +2560,90 @@
   return kDexNoIndex;
 }
 
+bool DexFileVerifier::CheckInterHiddenapiClassData() {
+  const dex::HiddenapiClassData* item = reinterpret_cast<const dex::HiddenapiClassData*>(ptr_);
+
+  // Move pointer after the header. This data has been verified in CheckIntraHiddenapiClassData.
+  uint32_t num_header_elems = dex_file_->NumClassDefs() + 1;
+  uint32_t elem_size = sizeof(uint32_t);
+  uint32_t header_size = num_header_elems * elem_size;
+  const uint8_t* data_end = ptr_ + item->size_;
+  ptr_ += header_size;
+
+  // Check offsets for each class def.
+  for (uint32_t i = 0; i < dex_file_->NumClassDefs(); ++i) {
+    const dex::ClassDef& class_def = dex_file_->GetClassDef(i);
+    const uint8_t* class_data = dex_file_->GetClassData(class_def);
+    uint32_t offset = item->flags_offset_[i];
+
+    if (offset == 0) {
+      continue;
+    }
+
+    // Check that class defs with no class data do not have any hiddenapi class data.
+    if (class_data == nullptr) {
+      ErrorStringPrintf(
+          "Hiddenapi class data offset not zero for class def %u with no class data", i);
+      return false;
+    }
+
+    // Check that the offset is within the section.
+    if (offset > item->size_) {
+      ErrorStringPrintf(
+          "Hiddenapi class data offset out of section bounds (%u > %u) for class def %u",
+          offset, item->size_, i);
+      return false;
+    }
+
+    // Check that the offset matches current pointer position. We do not allow
+    // offsets into already parsed data, or gaps between class def data.
+    uint32_t ptr_offset = ptr_ - reinterpret_cast<const uint8_t*>(item);
+    if (offset != ptr_offset) {
+      ErrorStringPrintf(
+          "Hiddenapi class data unexpected offset (%u != %u) for class def %u",
+          offset, ptr_offset, i);
+      return false;
+    }
+
+    // Parse a uleb128 value for each field and method of this class.
+    bool failure = false;
+    auto fn_member = [&](const ClassAccessor::BaseItem& member, const char* member_type) {
+      if (failure) {
+        return;
+      }
+      uint32_t decoded_flags;
+      if (!DecodeUnsignedLeb128Checked(&ptr_, data_end, &decoded_flags)) {
+        ErrorStringPrintf("Hiddenapi class data value out of bounds (%p > %p) for %s %i",
+                          ptr_, data_end, member_type, member.GetIndex());
+        failure = true;
+        return;
+      }
+      if (!hiddenapi::ApiList(decoded_flags).IsValid()) {
+        ErrorStringPrintf("Hiddenapi class data flags invalid (%u) for %s %i",
+                          decoded_flags, member_type, member.GetIndex());
+        failure = true;
+        return;
+      }
+    };
+    auto fn_field = [&](const ClassAccessor::Field& field) { fn_member(field, "field"); };
+    auto fn_method = [&](const ClassAccessor::Method& method) { fn_member(method, "method"); };
+    ClassAccessor accessor(*dex_file_, class_data);
+    accessor.VisitFieldsAndMethods(fn_field, fn_field, fn_method, fn_method);
+    if (failure) {
+      return false;
+    }
+  }
+
+  if (ptr_ != data_end) {
+    ErrorStringPrintf("Hiddenapi class data wrong reported size (%u != %u)",
+                       static_cast<uint32_t>(ptr_ - reinterpret_cast<const uint8_t*>(item)),
+                       item->size_);
+    return false;
+  }
+
+  return true;
+}
+
 bool DexFileVerifier::CheckInterStringIdItem() {
   const dex::StringId* item = reinterpret_cast<const dex::StringId*>(ptr_);
 
@@ -2496,7 +2670,7 @@
   {
     // Translate to index to potentially use cache.
     // The check in `CheckIntraIdSection()` guarantees that this index is valid.
-    size_t index = item - reinterpret_cast<const dex::TypeId*>(begin_ + header_->type_ids_off_);
+    size_t index = item - OffsetToPtr<dex::TypeId>(header_->type_ids_off_);
     DCHECK_LE(index, header_->type_ids_size_);
     if (UNLIKELY(!VerifyTypeDescriptor(
         dex::TypeIndex(static_cast<decltype(dex::TypeIndex::index_)>(index)),
@@ -2832,7 +3006,7 @@
 
   // Check that references in class_data_item are to the right class.
   if (item->class_data_off_ != 0) {
-    ClassAccessor accessor(*dex_file_, begin_ + item->class_data_off_);
+    ClassAccessor accessor(*dex_file_, OffsetToPtr(item->class_data_off_));
     uint32_t data_definer = FindFirstClassDataDefiner(accessor);
     DCHECK(IsUint<16>(data_definer) || data_definer == kDexNoIndex) << data_definer;
     if (UNLIKELY((data_definer != item->class_idx_.index_) && (data_definer != kDexNoIndex))) {
@@ -2848,7 +3022,7 @@
       ErrorStringPrintf("Invalid annotations_off_, not aligned by 4");
       return false;
     }
-    const uint8_t* data = begin_ + item->annotations_off_;
+    const uint8_t* data = OffsetToPtr(item->annotations_off_);
     uint32_t defining_class = FindFirstAnnotationsDirectoryDefiner(data);
     DCHECK(IsUint<16>(defining_class) || defining_class == kDexNoIndex) << defining_class;
     if (UNLIKELY((defining_class != item->class_idx_.index_) && (defining_class != kDexNoIndex))) {
@@ -2866,7 +3040,7 @@
 
   // Check call site referenced by item is in encoded array section.
   if (!CheckOffsetToTypeMap(item->data_off_, DexFile::kDexTypeEncodedArrayItem)) {
-    ErrorStringPrintf("Invalid offset in CallSideIdItem");
+    DCHECK(!failure_reason_.empty());  // Error already set.
     return false;
   }
 
@@ -2885,7 +3059,10 @@
   }
 
   // Check target method name.
-  it.Next();
+  if (!it.MaybeNext()) {
+    ErrorStringPrintf("unexpected encoded value type: '%c'", it.GetValueType());
+    return false;
+  }
   if (!it.HasNext() ||
       it.GetValueType() != EncodedArrayValueIterator::ValueType::kString) {
     ErrorStringPrintf("CallSiteArray missing target method name");
@@ -2899,7 +3076,10 @@
   }
 
   // Check method type.
-  it.Next();
+  if (!it.MaybeNext()) {
+    ErrorStringPrintf("unexpected encoded value type: '%c'", it.GetValueType());
+    return false;
+  }
   if (!it.HasNext() ||
       it.GetValueType() != EncodedArrayValueIterator::ValueType::kMethodType) {
     ErrorStringPrintf("CallSiteArray missing method type");
@@ -2945,8 +3125,7 @@
     }
 
     // Get the annotation from the offset and the type index for the annotation.
-    const dex::AnnotationItem* annotation =
-        reinterpret_cast<const dex::AnnotationItem*>(begin_ + *offsets);
+    const dex::AnnotationItem* annotation = OffsetToPtr<dex::AnnotationItem>(*offsets);
     const uint8_t* data = annotation->annotation_;
     DECODE_UNSIGNED_CHECKED_FROM(data, idx);
 
@@ -3117,7 +3296,7 @@
   previous_item_ = nullptr;
   for (uint32_t i = 0; i < count; i++) {
     uint32_t new_offset = (offset + alignment_mask) & ~alignment_mask;
-    ptr_ = begin_ + new_offset;
+    ptr_ = OffsetToPtr(new_offset);
     const uint8_t* prev_ptr = ptr_;
 
     if (MapTypeToBitMask(type) == 0) {
@@ -3136,8 +3315,13 @@
       case DexFile::kDexTypeDebugInfoItem:
       case DexFile::kDexTypeAnnotationItem:
       case DexFile::kDexTypeEncodedArrayItem:
-      case DexFile::kDexTypeHiddenapiClassData:
         break;
+      case DexFile::kDexTypeHiddenapiClassData: {
+        if (!CheckIntraHiddenapiClassData()) {
+          return false;
+        }
+        break;
+      }
       case DexFile::kDexTypeStringIdItem: {
         if (!CheckInterStringIdItem()) {
           return false;
@@ -3219,7 +3403,7 @@
     }
 
     previous_item_ = prev_ptr;
-    offset = ptr_ - begin_;
+    offset = PtrToOffset(ptr_);
   }
 
   return true;
@@ -3230,15 +3414,14 @@
   // we can retrieve the string data for verifying other items (types, shorties, etc.).
   // After this we can safely use `DexFile` helpers such as `GetFieldId()` or `GetMethodId()`
   // but not `PrettyMethod()` or `PrettyField()` as descriptors have not been verified yet.
-  const dex::StringId* string_ids =
-      reinterpret_cast<const dex::StringId*>(begin_ + header_->string_ids_off_);
+  const dex::StringId* string_ids = OffsetToPtr<dex::StringId>(header_->string_ids_off_);
   for (size_t i = 0, num_strings = header_->string_ids_size_; i != num_strings; ++i) {
     if (!CheckOffsetToTypeMap(string_ids[i].string_data_off_, DexFile::kDexTypeStringDataItem)) {
       return false;
     }
   }
 
-  const dex::MapList* map = reinterpret_cast<const dex::MapList*>(begin_ + header_->map_off_);
+  const dex::MapList* map = OffsetToPtr<dex::MapList>(header_->map_off_);
   const dex::MapItem* item = map->list_;
   uint32_t count = map->size_;
 
@@ -3249,6 +3432,10 @@
     DexFile::MapItemType type = static_cast<DexFile::MapItemType>(item->type_);
     bool found = false;
 
+    if (type == DexFile::kDexTypeClassDataItem) {
+      FindStringRangesForMethodNames();
+    }
+
     switch (type) {
       case DexFile::kDexTypeHeaderItem:
       case DexFile::kDexTypeMapList:
@@ -3317,6 +3504,7 @@
     return false;
   }
 
+  CHECK(todo_.empty());  // No unprocessed work left over.
   return true;
 }
 
@@ -3327,7 +3515,7 @@
   // Generally sort out >16-bit flags.
   if ((field_access_flags & ~kAccJavaFlagsMask) != 0) {
     *error_msg = StringPrintf("Bad field access_flags for %s: %x(%s)",
-                              GetFieldDescription(begin_, header_, idx).c_str(),
+                              GetFieldDescription(idx).c_str(),
                               field_access_flags,
                               PrettyJavaAccessFlags(field_access_flags).c_str());
     return false;
@@ -3347,7 +3535,7 @@
   // Fields may have only one of public/protected/final.
   if (!CheckAtMostOneOfPublicProtectedPrivate(field_access_flags)) {
     *error_msg = StringPrintf("Field may have only one of public/protected/private, %s: %x(%s)",
-                              GetFieldDescription(begin_, header_, idx).c_str(),
+                              GetFieldDescription(idx).c_str(),
                               field_access_flags,
                               PrettyJavaAccessFlags(field_access_flags).c_str());
     return false;
@@ -3359,7 +3547,7 @@
     constexpr uint32_t kPublicFinalStatic = kAccPublic | kAccFinal | kAccStatic;
     if ((field_access_flags & kPublicFinalStatic) != kPublicFinalStatic) {
       *error_msg = StringPrintf("Interface field is not public final static, %s: %x(%s)",
-                                GetFieldDescription(begin_, header_, idx).c_str(),
+                                GetFieldDescription(idx).c_str(),
                                 field_access_flags,
                                 PrettyJavaAccessFlags(field_access_flags).c_str());
       if (dex_file_->SupportsDefaultMethods()) {
@@ -3374,7 +3562,7 @@
     constexpr uint32_t kDisallowed = ~(kPublicFinalStatic | kAccSynthetic);
     if ((field_access_flags & kFieldAccessFlags & kDisallowed) != 0) {
       *error_msg = StringPrintf("Interface field has disallowed flag, %s: %x(%s)",
-                                GetFieldDescription(begin_, header_, idx).c_str(),
+                                GetFieldDescription(idx).c_str(),
                                 field_access_flags,
                                 PrettyJavaAccessFlags(field_access_flags).c_str());
       if (dex_file_->SupportsDefaultMethods()) {
@@ -3392,7 +3580,7 @@
   constexpr uint32_t kVolatileFinal = kAccVolatile | kAccFinal;
   if ((field_access_flags & kVolatileFinal) == kVolatileFinal) {
     *error_msg = StringPrintf("Fields may not be volatile and final: %s",
-                              GetFieldDescription(begin_, header_, idx).c_str());
+                              GetFieldDescription(idx).c_str());
     return false;
   }
 
@@ -3401,12 +3589,11 @@
 
 void DexFileVerifier::FindStringRangesForMethodNames() {
   // Use DexFile::StringId* as RandomAccessIterator.
-  const dex::StringId* first = reinterpret_cast<const dex::StringId*>(
-      begin_ + header_->string_ids_off_);
+  const dex::StringId* first = OffsetToPtr<dex::StringId>(header_->string_ids_off_);
   const dex::StringId* last = first + header_->string_ids_size_;
 
-  auto get_string = [begin = begin_](const dex::StringId& id) {
-    const uint8_t* str_data_ptr = begin + id.string_data_off_;
+  auto get_string = [this](const dex::StringId& id) {
+    const uint8_t* str_data_ptr = OffsetToPtr(id.string_data_off_);
     DecodeUnsignedLeb128(&str_data_ptr);
     return reinterpret_cast<const char*>(str_data_ptr);
   };
@@ -3460,7 +3647,7 @@
       kAccJavaFlagsMask | kAccConstructor | kAccDeclaredSynchronized;
   if ((method_access_flags & ~kAllMethodFlags) != 0) {
     *error_msg = StringPrintf("Bad method access_flags for %s: %x",
-                              GetMethodDescription(begin_, header_, method_index).c_str(),
+                              GetMethodDescription(method_index).c_str(),
                               method_access_flags);
     return false;
   }
@@ -3482,7 +3669,7 @@
   // Methods may have only one of public/protected/final.
   if (!CheckAtMostOneOfPublicProtectedPrivate(method_access_flags)) {
     *error_msg = StringPrintf("Method may have only one of public/protected/private, %s: %x",
-                              GetMethodDescription(begin_, header_, method_index).c_str(),
+                              GetMethodDescription(method_index).c_str(),
                               method_access_flags);
     return false;
   }
@@ -3496,8 +3683,8 @@
   if (((method_access_flags & kAccConstructor) != 0) && !is_constructor_by_name) {
     *error_msg =
         StringPrintf("Method %" PRIu32 "(%s) is marked constructor, but doesn't match name",
-                      method_index,
-                      GetMethodDescription(begin_, header_, method_index).c_str());
+                     method_index,
+                     GetMethodDescription(method_index).c_str());
     return false;
   }
 
@@ -3508,7 +3695,7 @@
     if (is_static ^ is_clinit_by_name) {
       *error_msg = StringPrintf("Constructor %" PRIu32 "(%s) is not flagged correctly wrt/ static.",
                                 method_index,
-                                GetMethodDescription(begin_, header_, method_index).c_str());
+                                GetMethodDescription(method_index).c_str());
       if (dex_file_->SupportsDefaultMethods()) {
         return false;
       } else {
@@ -3526,7 +3713,7 @@
   if (is_direct != expect_direct) {
     *error_msg = StringPrintf("Direct/virtual method %" PRIu32 "(%s) not in expected list %d",
                               method_index,
-                              GetMethodDescription(begin_, header_, method_index).c_str(),
+                              GetMethodDescription(method_index).c_str(),
                               expect_direct);
     return false;
   }
@@ -3544,7 +3731,7 @@
     if ((method_access_flags & desired_flags) == 0) {
       *error_msg = StringPrintf("Interface virtual method %" PRIu32 "(%s) is not public",
                                 method_index,
-                                GetMethodDescription(begin_, header_, method_index).c_str());
+                                GetMethodDescription(method_index).c_str());
       if (dex_file_->SupportsDefaultMethods()) {
         return false;
       } else {
@@ -3562,14 +3749,14 @@
       *error_msg = StringPrintf("Method %" PRIu32 "(%s) has no code, but is not marked native or "
                                 "abstract",
                                 method_index,
-                                GetMethodDescription(begin_, header_, method_index).c_str());
+                                GetMethodDescription(method_index).c_str());
       return false;
     }
     // Constructors must always have code.
     if (is_constructor_by_name) {
       *error_msg = StringPrintf("Constructor %u(%s) must not be abstract or native",
                                 method_index,
-                                GetMethodDescription(begin_, header_, method_index).c_str());
+                                GetMethodDescription(method_index).c_str());
       if (dex_file_->SupportsDefaultMethods()) {
         return false;
       } else {
@@ -3585,13 +3772,13 @@
       if ((method_access_flags & kForbidden) != 0) {
         *error_msg = StringPrintf("Abstract method %" PRIu32 "(%s) has disallowed access flags %x",
                                   method_index,
-                                  GetMethodDescription(begin_, header_, method_index).c_str(),
+                                  GetMethodDescription(method_index).c_str(),
                                   method_access_flags);
         return false;
       }
       // Abstract methods should be in an abstract class or interface.
       if ((class_access_flags & (kAccInterface | kAccAbstract)) == 0) {
-        LOG(WARNING) << "Method " << GetMethodDescription(begin_, header_, method_index)
+        LOG(WARNING) << "Method " << GetMethodDescription(method_index)
                      << " is abstract, but the declaring class is neither abstract nor an "
                      << "interface in dex file "
                      << dex_file_->GetLocation();
@@ -3603,7 +3790,7 @@
       if ((method_access_flags & (kAccPublic | kAccAbstract)) != (kAccPublic | kAccAbstract)) {
         *error_msg = StringPrintf("Interface method %" PRIu32 "(%s) is not public and abstract",
                                   method_index,
-                                  GetMethodDescription(begin_, header_, method_index).c_str());
+                                  GetMethodDescription(method_index).c_str());
         if (dex_file_->SupportsDefaultMethods()) {
           return false;
         } else {
@@ -3623,7 +3810,7 @@
   if ((method_access_flags & (kAccNative | kAccAbstract)) != 0) {
     *error_msg = StringPrintf("Method %" PRIu32 "(%s) has code, but is marked native or abstract",
                               method_index,
-                              GetMethodDescription(begin_, header_, method_index).c_str());
+                              GetMethodDescription(method_index).c_str());
     return false;
   }
 
@@ -3634,7 +3821,7 @@
     if ((method_access_flags & ~kInitAllowed) != 0) {
       *error_msg = StringPrintf("Constructor %" PRIu32 "(%s) flagged inappropriately %x",
                                 method_index,
-                                GetMethodDescription(begin_, header_, method_index).c_str(),
+                                GetMethodDescription(method_index).c_str(),
                                 method_access_flags);
       return false;
     }
@@ -3666,7 +3853,7 @@
   } else if (!signature.IsVoid()) {
     ErrorStringPrintf("Constructor %u(%s) must be void",
                       method_index,
-                      GetMethodDescription(begin_, header_, method_index).c_str());
+                      GetMethodDescription(method_index).c_str());
     return false;
   }
 
diff --git a/libdexfile/dex/dex_file_verifier_test.cc b/libdexfile/dex/dex_file_verifier_test.cc
index d31635e..d67d9a9 100644
--- a/libdexfile/dex/dex_file_verifier_test.cc
+++ b/libdexfile/dex/dex_file_verifier_test.cc
@@ -60,7 +60,7 @@
  protected:
   DexFile* GetDexFile(const uint8_t* dex_bytes, size_t length) {
     auto container = std::make_shared<MemoryDexFileContainer>(dex_bytes, length);
-    return new StandardDexFile(dex_bytes, length, "tmp", 0, nullptr, std::move(container));
+    return new StandardDexFile(dex_bytes, "tmp", 0, nullptr, std::move(container));
   }
 
   void VerifyModification(const char* dex_file_base64_content,
@@ -1454,7 +1454,7 @@
   VerifyModification(
       kClassExtendsItselfTestDex,
       "class_extends_itself",
-      [](DexFile* dex_file ATTRIBUTE_UNUSED) { /* empty */ },
+      []([[maybe_unused]] DexFile* dex_file) { /* empty */ },
       "Class with same type idx as its superclass: '0'");
 }
 
@@ -1479,7 +1479,7 @@
   VerifyModification(
       kClassesExtendOneAnotherTestDex,
       "classes_extend_one_another",
-      [](DexFile* dex_file ATTRIBUTE_UNUSED) { /* empty */ },
+      []([[maybe_unused]] DexFile* dex_file) { /* empty */ },
       "Invalid class definition ordering: class with type idx: '1' defined before"
       " superclass with type idx: '0'");
 }
@@ -1511,7 +1511,7 @@
   VerifyModification(
       kCircularClassInheritanceTestDex,
       "circular_class_inheritance",
-      [](DexFile* dex_file ATTRIBUTE_UNUSED) { /* empty */ },
+      []([[maybe_unused]] DexFile* dex_file) { /* empty */ },
       "Invalid class definition ordering: class with type idx: '1' defined before"
       " superclass with type idx: '0'");
 }
@@ -1534,7 +1534,7 @@
   VerifyModification(
       kInterfaceImplementsItselfTestDex,
       "interface_implements_itself",
-      [](DexFile* dex_file ATTRIBUTE_UNUSED) { /* empty */ },
+      []([[maybe_unused]] DexFile* dex_file) { /* empty */ },
       "Class with same type idx as implemented interface: '0'");
 }
 
@@ -1562,7 +1562,7 @@
   VerifyModification(
       kInterfacesImplementOneAnotherTestDex,
       "interfaces_implement_one_another",
-      [](DexFile* dex_file ATTRIBUTE_UNUSED) { /* empty */ },
+      []([[maybe_unused]] DexFile* dex_file) { /* empty */ },
       "Invalid class definition ordering: class with type idx: '1' defined before"
       " implemented interface with type idx: '0'");
 }
@@ -1598,7 +1598,7 @@
   VerifyModification(
       kCircularInterfaceImplementationTestDex,
       "circular_interface_implementation",
-      [](DexFile* dex_file ATTRIBUTE_UNUSED) { /* empty */ },
+      []([[maybe_unused]] DexFile* dex_file) { /* empty */ },
       "Invalid class definition ordering: class with type idx: '2' defined before"
       " implemented interface with type idx: '0'");
 }
diff --git a/libdexfile/dex/dex_instruction_iterator.h b/libdexfile/dex/dex_instruction_iterator.h
index 6c7f42a..da494e1 100644
--- a/libdexfile/dex/dex_instruction_iterator.h
+++ b/libdexfile/dex/dex_instruction_iterator.h
@@ -57,11 +57,13 @@
 };
 
 // Base helper class to prevent duplicated comparators.
-class DexInstructionIteratorBase : public
-        std::iterator<std::forward_iterator_tag, DexInstructionPcPair> {
+class DexInstructionIteratorBase {
  public:
-  using value_type = std::iterator<std::forward_iterator_tag, DexInstructionPcPair>::value_type;
-  using difference_type = std::iterator<std::forward_iterator_tag, value_type>::difference_type;
+  using iterator_category = std::forward_iterator_tag;
+  using value_type = DexInstructionPcPair;
+  using difference_type = ptrdiff_t;
+  using pointer = void;
+  using reference = void;
 
   explicit DexInstructionIteratorBase(const Instruction* inst, uint32_t dex_pc)
       : data_(reinterpret_cast<const uint16_t*>(inst), dex_pc) {}
diff --git a/libdexfile/dex/fuzzer_corpus_test.cc b/libdexfile/dex/fuzzer_corpus_test.cc
new file mode 100644
index 0000000..6b1bb13
--- /dev/null
+++ b/libdexfile/dex/fuzzer_corpus_test.cc
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <cstdint>
+#include <filesystem>
+#include <unordered_set>
+
+#include "android-base/file.h"
+#include "dex/dex_file_verifier.h"
+#include "dex/standard_dex_file.h"
+#include "gtest/gtest.h"
+#include "ziparchive/zip_archive.h"
+
+namespace art {
+
+class FuzzerCorpusTest : public testing::Test {
+ public:
+  static void VerifyDexFile(const uint8_t* data,
+                            size_t size,
+                            const std::string& name,
+                            bool expected_success) {
+    // Do not verify the checksum as we only care about the DEX file contents,
+    // and know that the checksum would probably be erroneous (i.e. random).
+    constexpr bool kVerify = false;
+
+    // Special case for empty dex file. Set a fake data since the size is 0 anyway.
+    if (data == nullptr) {
+      ASSERT_EQ(size, 0);
+      data = reinterpret_cast<const uint8_t*>(&name);
+    }
+
+    auto container = std::make_shared<art::MemoryDexFileContainer>(data, size);
+    art::StandardDexFile dex_file(data,
+                                  /*location=*/name,
+                                  /*location_checksum=*/0,
+                                  /*oat_dex_file=*/nullptr,
+                                  container);
+
+    std::string error_msg;
+    bool success = art::dex::Verify(&dex_file, dex_file.GetLocation().c_str(), kVerify, &error_msg);
+    ASSERT_EQ(success, expected_success) << " Failed for " << name;
+  }
+};
+
+// Class that manages the ZipArchiveHandle liveness.
+class ZipArchiveHandleScope {
+ public:
+  explicit ZipArchiveHandleScope(ZipArchiveHandle* handle) : handle_(handle) {}
+  ~ZipArchiveHandleScope() { CloseArchive(*(handle_.release())); }
+
+ private:
+  std::unique_ptr<ZipArchiveHandle> handle_;
+};
+
+// Returns true if `str` ends with `suffix`.
+inline bool EndsWith(std::string const& str, std::string const& suffix) {
+  if (suffix.size() > str.size()) {
+    return false;
+  }
+  return std::equal(suffix.rbegin(), suffix.rend(), str.rbegin());
+}
+
+// Tests that we can verify dex files without crashing.
+TEST_F(FuzzerCorpusTest, VerifyCorpusDexFiles) {
+  // These dex files are expected to pass verification. The others are regressions tests.
+  const std::unordered_set<std::string> valid_dex_files = {"Main.dex", "hello_world.dex"};
+
+  // Consistency checks.
+  const std::string folder = android::base::GetExecutableDirectory();
+  ASSERT_TRUE(std::filesystem::is_directory(folder)) << folder << " is not a folder";
+  ASSERT_FALSE(std::filesystem::is_empty(folder)) << " No files found for directory " << folder;
+
+  const std::string filename = folder + "/fuzzer_corpus.zip";
+
+  // Iterate using ZipArchiveHandle. We have to be careful about managing the pointers with
+  // CloseArchive, StartIteration, and EndIteration.
+  std::string error_msg;
+  ZipArchiveHandle handle;
+  ZipArchiveHandleScope scope(&handle);
+  int32_t error = OpenArchive(filename.c_str(), &handle);
+  ASSERT_TRUE(error == 0) << "Error: " << error;
+
+  void* cookie;
+  error = StartIteration(handle, &cookie);
+  ASSERT_TRUE(error == 0) << "couldn't iterate " << filename << " : " << ErrorCodeString(error);
+
+  ZipEntry64 entry;
+  std::string name;
+  std::vector<char> data;
+  while ((error = Next(cookie, &entry, &name)) >= 0) {
+    if (!EndsWith(name, ".dex")) {
+      // Skip non-DEX files.
+      LOG(WARNING) << "Found a non-dex file: " << name;
+      continue;
+    }
+    data.resize(entry.uncompressed_length);
+    error = ExtractToMemory(handle, &entry, reinterpret_cast<uint8_t*>(data.data()), data.size());
+    ASSERT_TRUE(error == 0) << "failed to extract entry: " << name << " from " << filename << ""
+                            << ErrorCodeString(error);
+
+    const bool expected_success = valid_dex_files.find(name) != valid_dex_files.end();
+    VerifyDexFile(
+        reinterpret_cast<const uint8_t*>(data.data()), data.size(), name.c_str(), expected_success);
+  }
+
+  ASSERT_TRUE(error >= -1) << "failed iterating " << filename << " : " << ErrorCodeString(error);
+  EndIteration(cookie);
+}
+
+}  // namespace art
diff --git a/libdexfile/dex/method_reference.h b/libdexfile/dex/method_reference.h
index f66ac30..9d4eabe 100644
--- a/libdexfile/dex/method_reference.h
+++ b/libdexfile/dex/method_reference.h
@@ -21,6 +21,7 @@
 #include <string>
 #include "dex/dex_file.h"
 #include "dex/dex_file_reference.h"
+#include "dex/proto_reference.h"
 
 namespace art {
 
@@ -34,6 +35,9 @@
   const dex::MethodId& GetMethodId() const {
     return dex_file->GetMethodId(index);
   }
+  const art::ProtoReference GetProtoReference() const {
+    return ProtoReference(dex_file, GetMethodId().proto_idx_);
+  }
 };
 
 // Compare the actual referenced method signatures. Used for method reference deduplication.
@@ -62,27 +66,8 @@
     if (name_diff != 0) {
       return name_diff < 0;
     }
-    // And then compare proto ids, starting with return type comparison.
-    const dex::ProtoId& prid1 = mr1.dex_file->GetProtoId(mid1.proto_idx_);
-    const dex::ProtoId& prid2 = mr2.dex_file->GetProtoId(mid2.proto_idx_);
-    int return_type_diff = strcmp(mr1.dex_file->StringByTypeIdx(prid1.return_type_idx_),
-                                  mr2.dex_file->StringByTypeIdx(prid2.return_type_idx_));
-    if (return_type_diff != 0) {
-      return return_type_diff < 0;
-    }
-    // And finishing with lexicographical parameter comparison.
-    const dex::TypeList* params1 = mr1.dex_file->GetProtoParameters(prid1);
-    size_t param1_size = (params1 != nullptr) ? params1->Size() : 0u;
-    const dex::TypeList* params2 = mr2.dex_file->GetProtoParameters(prid2);
-    size_t param2_size = (params2 != nullptr) ? params2->Size() : 0u;
-    for (size_t i = 0, num = std::min(param1_size, param2_size); i != num; ++i) {
-      int param_diff = strcmp(mr1.dex_file->StringByTypeIdx(params1->GetTypeItem(i).type_idx_),
-                              mr2.dex_file->StringByTypeIdx(params2->GetTypeItem(i).type_idx_));
-      if (param_diff != 0) {
-        return param_diff < 0;
-      }
-    }
-    return param1_size < param2_size;
+    // Then compare protos.
+    return ProtoReferenceValueComparator()(mr1.GetProtoReference(), mr2.GetProtoReference());
   }
 };
 
diff --git a/libdexfile/dex/modifiers.h b/libdexfile/dex/modifiers.h
index a17545c..1307e0e 100644
--- a/libdexfile/dex/modifiers.h
+++ b/libdexfile/dex/modifiers.h
@@ -101,7 +101,7 @@
 // Whether nterp can take a fast path when entering this method (runtime; non-native)
 static constexpr uint32_t kAccNterpEntryPointFastPathFlag = 0x00100000;
 // Set by the class linker to mark that a method does not have floating points
-// or longs in its shorty.
+// or longs in its shorty. On RISC-V 64, a method that has only reference args.
 static constexpr uint32_t kAccNterpInvokeFastPathFlag     = 0x00200000;  // method (runtime)
 
 static constexpr uint32_t kAccPublicApi =             0x10000000;  // field, method
diff --git a/libdexfile/dex/proto_reference.h b/libdexfile/dex/proto_reference.h
new file mode 100644
index 0000000..dc9a447
--- /dev/null
+++ b/libdexfile/dex/proto_reference.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_LIBDEXFILE_DEX_PROTO_REFERENCE_H_
+#define ART_LIBDEXFILE_DEX_PROTO_REFERENCE_H_
+
+#include <stdint.h>
+
+#include <android-base/logging.h>
+#include <string_view>
+
+#include "dex/dex_file-inl.h"
+#include "dex/dex_file_reference.h"
+#include "dex/dex_file_types.h"
+
+namespace art {
+
+// A proto is located by its DexFile and the proto_ids_ table index into that DexFile.
+class ProtoReference : public DexFileReference {
+ public:
+  ProtoReference(const DexFile* file, dex::ProtoIndex index)
+     : DexFileReference(file, index.index_) {}
+
+  dex::ProtoIndex ProtoIndex() const {
+    return dex::ProtoIndex(index);
+  }
+
+  const dex::ProtoId& ProtoId() const {
+    return dex_file->GetProtoId(ProtoIndex());
+  }
+
+  std::string_view ReturnType() const {
+    return dex_file->GetTypeDescriptorView(dex_file->GetTypeId(ProtoId().return_type_idx_));
+  }
+};
+
+struct ProtoReferenceValueComparator {
+  bool operator()(const ProtoReference& lhs, const ProtoReference& rhs) const {
+    if (lhs.dex_file == rhs.dex_file) {
+      DCHECK_EQ(lhs.index < rhs.index, SlowCompare(lhs, rhs));
+
+      return lhs.index < rhs.index;
+    } else {
+      return SlowCompare(lhs, rhs);
+    }
+  }
+
+  bool SlowCompare(const ProtoReference& lhs, const ProtoReference& rhs) const {
+    // Compare return type first.
+    const dex::ProtoId& prid1 = lhs.ProtoId();
+    const dex::ProtoId& prid2 = rhs.ProtoId();
+    int return_type_diff = lhs.ReturnType().compare(rhs.ReturnType());
+    if (return_type_diff != 0) {
+      return return_type_diff < 0;
+    }
+    // And then compare parameters lexicographically.
+    const dex::TypeList* params1 = lhs.dex_file->GetProtoParameters(prid1);
+    size_t param1_size = (params1 != nullptr) ? params1->Size() : 0u;
+    const dex::TypeList* params2 = rhs.dex_file->GetProtoParameters(prid2);
+    size_t param2_size = (params2 != nullptr) ? params2->Size() : 0u;
+    for (size_t i = 0, num = std::min(param1_size, param2_size); i != num; ++i) {
+      std::string_view l_param = lhs.dex_file->GetTypeDescriptorView(
+          lhs.dex_file->GetTypeId(params1->GetTypeItem(i).type_idx_));
+      std::string_view r_param = rhs.dex_file->GetTypeDescriptorView(
+          rhs.dex_file->GetTypeId(params2->GetTypeItem(i).type_idx_));
+
+      int param_diff = l_param.compare(r_param);
+      if (param_diff != 0) {
+        return param_diff < 0;
+      }
+    }
+    return param1_size < param2_size;
+  }
+};
+
+}  // namespace art
+
+#endif  // ART_LIBDEXFILE_DEX_PROTO_REFERENCE_H_
diff --git a/libdexfile/dex/proto_reference_test.cc b/libdexfile/dex/proto_reference_test.cc
new file mode 100644
index 0000000..f24106d
--- /dev/null
+++ b/libdexfile/dex/proto_reference_test.cc
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "dex/proto_reference.h"
+#include <vector>
+
+#include "dex/dex_file_types.h"
+#include "dex/test_dex_file_builder.h"
+#include "gtest/gtest.h"
+
+namespace art {
+
+TEST(ProtoReference, WithinOneDexFile) {
+    TestDexFileBuilder builder;
+    builder.AddMethod("LClass", "()I", "sideEffect2");
+    builder.AddMethod("LClass", "(I)Ljava/lang/String;", "toString");
+    builder.AddMethod("LClass", "(II)Ljava/lang/String;", "toString");
+    builder.AddMethod("LClass", "(IJ)Ljava/lang/String;", "toString");
+    builder.AddMethod("LClass", "(JJ)Ljava/lang/String;", "toString");
+    builder.AddMethod("LClass", "()V", "sideEffect1");
+
+    std::unique_ptr<const DexFile> dex_file = builder.Build("fake location");
+    const size_t num_protos = 6u;
+    EXPECT_EQ(num_protos, dex_file->NumProtoIds());
+
+    std::vector<ProtoReference> protos;
+
+    for (size_t i = 0; i < num_protos; ++i) {
+        protos.emplace_back(ProtoReference(dex_file.get(), dex::ProtoIndex(i)));
+    }
+
+    ProtoReferenceValueComparator cmp;
+    for (size_t i = 0; i < num_protos; ++i) {
+        for (size_t j = 0; j < num_protos; ++j) {
+            EXPECT_EQ(cmp(protos[i], protos[j]), i < j)
+                << "Inconsistent at i=" << i << " and j=" << j;
+        }
+    }
+}
+
+TEST(ProtoReference, AcrossDifferentDexFiles) {
+    TestDexFileBuilder builder1;
+    builder1.AddMethod("LClass", "()I", "sideEffect2");
+    builder1.AddMethod("LClass", "(I)Ljava/lang/String;", "toString");
+    builder1.AddMethod("LClass", "(II)Ljava/lang/String;", "toString");
+    builder1.AddMethod("LClass", "(IJ)Ljava/lang/String;", "toString");
+    builder1.AddMethod("LClass", "(IJZ)Ljava/lang/String;", "toString");
+    builder1.AddMethod("LClass", "()V", "sideEffect1");
+
+    std::unique_ptr<const DexFile> dex_file1 = builder1.Build("fake location");
+    EXPECT_EQ(6u, dex_file1->NumProtoIds());
+
+    TestDexFileBuilder builder2;
+    builder2.AddMethod("LClass2", "(IJ)Ljava/lang/String;", "toString");
+    builder2.AddMethod("LClass2", "()V", "sideEffect1");
+    builder2.AddMethod("LClass2", "(I)V", "sideEffect2");
+
+    std::unique_ptr<const DexFile> dex_file2 = builder2.Build("fake location 2");
+    EXPECT_EQ(3u, dex_file2->NumProtoIds());
+
+    ProtoReference V_dex1 = ProtoReference(dex_file1.get(), dex::ProtoIndex(5));
+    ProtoReference V_dex2 = ProtoReference(dex_file2.get(), dex::ProtoIndex(1));
+
+    ProtoReferenceValueComparator cmp;
+
+    EXPECT_FALSE(cmp(V_dex1, V_dex2));
+    EXPECT_FALSE(cmp(V_dex2, V_dex1));
+
+    ProtoReference IString_dex1 = ProtoReference(dex_file1.get(), dex::ProtoIndex(1));
+    ProtoReference IIString_dex1 = ProtoReference(dex_file1.get(), dex::ProtoIndex(2));
+    ProtoReference IJString_dex1 = ProtoReference(dex_file1.get(), dex::ProtoIndex(3));
+    ProtoReference IJZString_dex1 = ProtoReference(dex_file1.get(), dex::ProtoIndex(4));
+
+    ProtoReference IJString_dex2 = ProtoReference(dex_file2.get(), dex::ProtoIndex(0));
+
+    EXPECT_TRUE(cmp(IString_dex1, V_dex2));
+
+    EXPECT_TRUE(cmp(IString_dex1, IJString_dex2));
+    EXPECT_TRUE(cmp(IIString_dex1, IJString_dex2));
+    EXPECT_FALSE(cmp(IJString_dex1, IJString_dex2));
+    EXPECT_FALSE(cmp(IJString_dex2, IJString_dex1));
+    EXPECT_FALSE(cmp(IJZString_dex1, IJString_dex2));
+
+    EXPECT_TRUE(cmp(IJString_dex2, IJZString_dex1));
+}
+
+}  // namespace art
diff --git a/libdexfile/dex/standard_dex_file.cc b/libdexfile/dex/standard_dex_file.cc
index 1f1bc19..4dc96d4 100644
--- a/libdexfile/dex/standard_dex_file.cc
+++ b/libdexfile/dex/standard_dex_file.cc
@@ -24,18 +24,20 @@
 namespace art {
 
 const uint8_t StandardDexFile::kDexMagic[] = { 'd', 'e', 'x', '\n' };
-const uint8_t StandardDexFile::kDexMagicVersions[StandardDexFile::kNumDexVersions]
-                                                [StandardDexFile::kDexVersionLen] = {
-  {'0', '3', '5', '\0'},
-  // Dex version 036 skipped because of an old dalvik bug on some versions of android where dex
-  // files with that version number would erroneously be accepted and run.
-  {'0', '3', '7', '\0'},
-  // Dex version 038: Android "O" and beyond.
-  {'0', '3', '8', '\0'},
-  // Dex version 039: Android "P" and beyond.
-  {'0', '3', '9', '\0'},
-  // Dex version 040: beyond Android "10" (previously known as Android "Q").
-  {'0', '4', '0', '\0'},
+const uint8_t StandardDexFile::kDexMagicVersions
+    [StandardDexFile::kNumDexVersions][StandardDexFile::kDexVersionLen] = {
+        {'0', '3', '5', '\0'},
+        // Dex version 036 skipped because of an old dalvik bug on some versions of android where
+        // dex files with that version number would erroneously be accepted and run.
+        {'0', '3', '7', '\0'},
+        // Dex version 038: Android "O" and beyond.
+        {'0', '3', '8', '\0'},
+        // Dex version 039: Android "P" and beyond.
+        {'0', '3', '9', '\0'},
+        // Dex version 040: Android "Q" and beyond (aka Android 10).
+        {'0', '4', '0', '\0'},
+        // Dex version 041: Android "V" and beyond (aka Android 15).
+        {'0', '4', '1', '\0'},
 };
 
 void StandardDexFile::WriteMagic(uint8_t* magic) {
@@ -71,9 +73,7 @@
   return IsMagicValid(header_->magic_);
 }
 
-bool StandardDexFile::IsVersionValid() const {
-  return IsVersionValid(header_->magic_);
-}
+bool StandardDexFile::IsVersionValid() const { return IsVersionValid(header_->magic_.data()); }
 
 bool StandardDexFile::SupportsDefaultMethods() const {
   return GetDexVersion() >= DexFile::kDefaultMethodsVersion;
diff --git a/libdexfile/dex/standard_dex_file.h b/libdexfile/dex/standard_dex_file.h
index 4ab27ef..0b12c18 100644
--- a/libdexfile/dex/standard_dex_file.h
+++ b/libdexfile/dex/standard_dex_file.h
@@ -22,6 +22,8 @@
 
 #include "dex_file.h"
 
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);
+
 namespace art {
 
 class OatDexFile;
@@ -89,11 +91,12 @@
   static void WriteVersionBeforeDefaultMethods(uint8_t* magic);
 
   static const uint8_t kDexMagic[kDexMagicSize];
-  static constexpr size_t kNumDexVersions = 5;
+  static constexpr size_t kNumDexVersions = 6;
   static const uint8_t kDexMagicVersions[kNumDexVersions][kDexVersionLen];
 
   // Returns true if the byte string points to the magic value.
   static bool IsMagicValid(const uint8_t* magic);
+  static bool IsMagicValid(DexFile::Magic magic) { return IsMagicValid(magic.data()); }
   bool IsMagicValid() const override;
 
   // Returns true if the byte string after the magic is the correct value.
@@ -113,14 +116,12 @@
 
  private:
   StandardDexFile(const uint8_t* base,
-                  size_t size,
                   const std::string& location,
                   uint32_t location_checksum,
                   const OatDexFile* oat_dex_file,
                   // Shared since several dex files may be stored in the same logical container.
                   std::shared_ptr<DexFileContainer> container)
       : DexFile(base,
-                size,
                 location,
                 location_checksum,
                 oat_dex_file,
@@ -129,9 +130,11 @@
 
   friend class DexFileLoader;
   friend class DexFileVerifierTest;
+  friend class FuzzerCorpusTest;  // for constructor
 
   ART_FRIEND_TEST(ClassLinkerTest, RegisterDexFileName);  // for constructor
   friend class OptimizingUnitTestHelper;  // for constructor
+  friend int ::LLVMFuzzerTestOneInput(const uint8_t*, size_t);  // for constructor
 
   DISALLOW_COPY_AND_ASSIGN(StandardDexFile);
 };
diff --git a/libdexfile/dex/test_dex_file_builder.h b/libdexfile/dex/test_dex_file_builder.h
index 964f196..fb0e4c5 100644
--- a/libdexfile/dex/test_dex_file_builder.h
+++ b/libdexfile/dex/test_dex_file_builder.h
@@ -88,8 +88,8 @@
     } header_data;
     std::memset(header_data.data, 0, sizeof(header_data.data));
     DexFile::Header* header = reinterpret_cast<DexFile::Header*>(&header_data.data);
-    std::copy_n(StandardDexFile::kDexMagic, 4u, header->magic_);
-    std::copy_n(StandardDexFile::kDexMagicVersions[0], 4u, header->magic_ + 4u);
+    std::copy_n(StandardDexFile::kDexMagic, 4u, header->magic_.data());
+    std::copy_n(StandardDexFile::kDexMagicVersions[0], 4u, header->magic_.data() + 4u);
     header->header_size_ = sizeof(DexFile::Header);
     header->endian_tag_ = DexFile::kDexEndianConstant;
     header->link_size_ = 0u;  // Unused.
diff --git a/libdexfile/dex/utf.cc b/libdexfile/dex/utf.cc
index 9692a26..bcda8ca 100644
--- a/libdexfile/dex/utf.cc
+++ b/libdexfile/dex/utf.cc
@@ -209,7 +209,7 @@
 size_t CountModifiedUtf8BytesInUtf16(const uint16_t* chars, size_t char_count) {
   // FIXME: We should not emit 4-byte sequences. Bug: 192935764
   size_t result = 0;
-  auto append = [&](char c ATTRIBUTE_UNUSED) { ++result; };
+  auto append = [&]([[maybe_unused]] char c) { ++result; };
   ConvertUtf16ToUtf8</*kUseShortZero=*/ false,
                      /*kUse4ByteSequence=*/ true,
                      /*kReplaceBadSurrogates=*/ false>(chars, char_count, append);
diff --git a/libdexfile/external/dex_file_ext.cc b/libdexfile/external/dex_file_ext.cc
index e71233c..3a511ea 100644
--- a/libdexfile/external/dex_file_ext.cc
+++ b/libdexfile/external/dex_file_ext.cc
@@ -155,6 +155,13 @@
   }
 
   const art::DexFile::Header* header = reinterpret_cast<const art::DexFile::Header*>(address);
+  if (size < header->header_size_) {
+    if (new_size != nullptr) {
+      *new_size = header->header_size_;
+    }
+    return ADEXFILE_ERROR_NOT_ENOUGH_DATA;
+  }
+
   uint32_t dex_size = header->file_size_;  // Size of "one dex file" excluding any shared data.
   uint32_t full_size = dex_size;           // Includes referenced shared data past the end of dex.
   if (art::CompactDexFile::IsMagicValid(header->magic_)) {
@@ -169,7 +176,9 @@
     if (computed_file_size > full_size) {
       full_size = computed_file_size;
     }
-  } else if (!art::StandardDexFile::IsMagicValid(header->magic_)) {
+  } else if (art::StandardDexFile::IsMagicValid(header->magic_)) {
+    full_size = header->ContainerSize() - header->HeaderOffset();
+  } else {
     return ADEXFILE_ERROR_INVALID_HEADER;
   }
 
@@ -182,12 +191,13 @@
 
   std::string loc_str(location);
   std::string error_msg;
-  art::DexFileLoader loader(static_cast<const uint8_t*>(address), dex_size, loc_str);
-  std::unique_ptr<const art::DexFile> dex_file = loader.Open(header->checksum_,
-                                                             /*oat_dex_file=*/nullptr,
-                                                             /*verify=*/false,
-                                                             /*verify_checksum=*/false,
-                                                             &error_msg);
+  art::DexFileLoader loader(static_cast<const uint8_t*>(address), full_size, loc_str);
+  std::unique_ptr<const art::DexFile> dex_file = loader.OpenOne(/*header_offset=*/0,
+                                                                header->checksum_,
+                                                                /*oat_dex_file=*/nullptr,
+                                                                /*verify=*/false,
+                                                                /*verify_checksum=*/false,
+                                                                &error_msg);
   if (dex_file == nullptr) {
     LOG(ERROR) << "Can not open dex file " << loc_str << ": " << error_msg;
     return ADEXFILE_ERROR_INVALID_DEX;
diff --git a/libelffile/elf/elf_builder.h b/libelffile/elf/elf_builder.h
index 6720569..309417e 100644
--- a/libelffile/elf/elf_builder.h
+++ b/libelffile/elf/elf_builder.h
@@ -202,7 +202,7 @@
         std::vector<Section*>& sections = owner_->sections_;
         Elf_Word last = sections.empty() ? PF_R : sections.back()->phdr_flags_;
         if (phdr_flags_ != last) {
-          header_.sh_addralign = kPageSize;  // Page-align if R/W/X flags changed.
+          header_.sh_addralign = kElfSegmentAlignment;  // Page-align if R/W/X flags changed.
         }
         sections.push_back(this);
         section_index_ = sections.size();  // First ELF section has index 1.
@@ -460,16 +460,18 @@
   ElfBuilder(InstructionSet isa, OutputStream* output)
       : isa_(isa),
         stream_(output),
-        rodata_(this, ".rodata", SHT_PROGBITS, SHF_ALLOC, nullptr, 0, kPageSize, 0),
-        text_(this, ".text", SHT_PROGBITS, SHF_ALLOC | SHF_EXECINSTR, nullptr, 0, kPageSize, 0),
-        data_bimg_rel_ro_(
-            this, ".data.bimg.rel.ro", SHT_PROGBITS, SHF_ALLOC, nullptr, 0, kPageSize, 0),
-        bss_(this, ".bss", SHT_NOBITS, SHF_ALLOC, nullptr, 0, kPageSize, 0),
-        dex_(this, ".dex", SHT_NOBITS, SHF_ALLOC, nullptr, 0, kPageSize, 0),
-        dynstr_(this, ".dynstr", SHF_ALLOC, kPageSize),
+        rodata_(this, ".rodata", SHT_PROGBITS, SHF_ALLOC, nullptr, 0, kElfSegmentAlignment, 0),
+        text_(this, ".text", SHT_PROGBITS, SHF_ALLOC | SHF_EXECINSTR, nullptr, 0,
+            kElfSegmentAlignment, 0),
+        data_bimg_rel_ro_(this, ".data.bimg.rel.ro", SHT_PROGBITS, SHF_ALLOC, nullptr, 0,
+            kElfSegmentAlignment, 0),
+        bss_(this, ".bss", SHT_NOBITS, SHF_ALLOC, nullptr, 0, kElfSegmentAlignment, 0),
+        dex_(this, ".dex", SHT_NOBITS, SHF_ALLOC, nullptr, 0, kElfSegmentAlignment, 0),
+        dynstr_(this, ".dynstr", SHF_ALLOC, kElfSegmentAlignment),
         dynsym_(this, ".dynsym", SHT_DYNSYM, SHF_ALLOC, &dynstr_),
         hash_(this, ".hash", SHT_HASH, SHF_ALLOC, &dynsym_, 0, sizeof(Elf_Word), sizeof(Elf_Word)),
-        dynamic_(this, ".dynamic", SHT_DYNAMIC, SHF_ALLOC, &dynstr_, 0, kPageSize, sizeof(Elf_Dyn)),
+        dynamic_(this, ".dynamic", SHT_DYNAMIC, SHF_ALLOC, &dynstr_, 0, kElfSegmentAlignment,
+            sizeof(Elf_Dyn)),
         strtab_(this, ".strtab", 0, 1),
         symtab_(this, ".symtab", SHT_SYMTAB, 0, &strtab_),
         debug_frame_(this, ".debug_frame", SHT_PROGBITS, 0, nullptr, 0, sizeof(Elf_Addr), 0),
@@ -540,7 +542,7 @@
 
     // Note: loaded_size_ == 0 for tests that don't write .rodata, .text, .bss,
     // .dynstr, dynsym, .hash and .dynamic. These tests should not read loaded_size_.
-    CHECK(loaded_size_ == 0 || loaded_size_ == RoundUp(virtual_address_, kPageSize))
+    CHECK(loaded_size_ == 0 || loaded_size_ == RoundUp(virtual_address_, kElfSegmentAlignment))
         << loaded_size_ << " " << virtual_address_;
 
     // Write section names and finish the section headers.
@@ -615,7 +617,8 @@
         section->section_index_ = 0;
       } else {
         if (section->header_.sh_type != SHT_NOBITS) {
-          DCHECK_LE(section->header_.sh_offset, end + kPageSize) << "Large gap between sections";
+          DCHECK_LE(section->header_.sh_offset, end + kElfSegmentAlignment)
+              << "Large gap between sections";
           end = std::max<off_t>(end, section->header_.sh_offset + section->header_.sh_size);
         }
         non_debug_sections.push_back(section);
@@ -767,7 +770,7 @@
     dynamic_.Add(&dyns, sizeof(dyns));
     dynamic_.AllocateVirtualMemory(dynamic_.GetCacheSize());
 
-    loaded_size_ = RoundUp(virtual_address_, kPageSize);
+    loaded_size_ = RoundUp(virtual_address_, kElfSegmentAlignment);
   }
 
   void WriteDynamicSection() {
@@ -906,7 +909,7 @@
       load.p_flags   = PF_R;
       load.p_offset  = load.p_vaddr = load.p_paddr = 0;
       load.p_filesz  = load.p_memsz = sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * kMaxProgramHeaders;
-      load.p_align   = kPageSize;
+      load.p_align   = kElfSegmentAlignment;
       phdrs.push_back(load);
     }
     // Create program headers for sections.
@@ -936,7 +939,7 @@
           prev.p_memsz  = size;
         } else {
           // If we are adding new load, it must be aligned.
-          CHECK_EQ(shdr.sh_addralign, (Elf_Word)kPageSize);
+          CHECK_EQ(shdr.sh_addralign, (Elf_Word)kElfSegmentAlignment);
           phdrs.push_back(load);
         }
       }
diff --git a/libelffile/elf/elf_debug_reader.h b/libelffile/elf/elf_debug_reader.h
index 6e01989..05aa339 100644
--- a/libelffile/elf/elf_debug_reader.h
+++ b/libelffile/elf/elf_debug_reader.h
@@ -119,7 +119,7 @@
   }
 
   template <typename VisitSym>
-  void VisitFunctionSymbols(VisitSym visit_sym) {
+  void VisitFunctionSymbols(VisitSym&& visit_sym) {
     const Elf_Shdr* symtab = GetSection(".symtab");
     const Elf_Shdr* strtab = GetSection(".strtab");
     const Elf_Shdr* text = GetSection(".text");
@@ -127,18 +127,20 @@
       CHECK_EQ(symtab->sh_entsize, sizeof(Elf_Sym));
       size_t count = symtab->sh_size / sizeof(Elf_Sym);
       for (const Elf_Sym& symbol : Read<Elf_Sym>(symtab->sh_offset, count)) {
-        if (ELF_ST_TYPE(symbol.st_info) == STT_FUNC && &sections_[symbol.st_shndx] == text) {
+        if (ELF_ST_TYPE(symbol.st_info) == STT_FUNC &&
+            symbol.st_shndx < sections_.size() &&  // Ignore ABS section.
+            &sections_[symbol.st_shndx] == text) {
           visit_sym(symbol, Read<char>(strtab->sh_offset + symbol.st_name));
         }
       }
     }
     if (gnu_debugdata_reader_ != nullptr) {
-      gnu_debugdata_reader_->VisitFunctionSymbols(visit_sym);
+      gnu_debugdata_reader_->VisitFunctionSymbols(std::forward<VisitSym>(visit_sym));
     }
   }
 
   template <typename VisitSym>
-  void VisitDynamicSymbols(VisitSym visit_sym) {
+  void VisitDynamicSymbols(VisitSym&& visit_sym) {
     const Elf_Shdr* dynsym = GetSection(".dynsym");
     const Elf_Shdr* dynstr = GetSection(".dynstr");
     if (dynsym != nullptr && dynstr != nullptr) {
@@ -151,7 +153,7 @@
   }
 
   template <typename VisitCIE, typename VisitFDE>
-  void VisitDebugFrame(VisitCIE visit_cie, VisitFDE visit_fde) {
+  void VisitDebugFrame(VisitCIE&& visit_cie, VisitFDE&& visit_fde) {
     const Elf_Shdr* debug_frame = GetSection(".debug_frame");
     if (debug_frame != nullptr) {
       for (size_t offset = 0; offset < debug_frame->sh_size;) {
@@ -167,7 +169,8 @@
       }
     }
     if (gnu_debugdata_reader_ != nullptr) {
-      gnu_debugdata_reader_->VisitDebugFrame(visit_cie, visit_fde);
+      gnu_debugdata_reader_->VisitDebugFrame(std::forward<VisitCIE>(visit_cie),
+                                             std::forward<VisitFDE>(visit_fde));
     }
   }
 
diff --git a/libelffile/elf/elf_utils.h b/libelffile/elf/elf_utils.h
index 46b25b0..e101920 100644
--- a/libelffile/elf/elf_utils.h
+++ b/libelffile/elf/elf_utils.h
@@ -96,7 +96,7 @@
 }
 
 static inline bool IsDynamicSectionPointer(Elf32_Word d_tag,
-                                           Elf32_Word e_machine ATTRIBUTE_UNUSED) {
+                                           [[maybe_unused]] Elf32_Word e_machine) {
   // TODO: Remove the `e_machine` parameter from API (not needed after Mips target was removed).
   switch (d_tag) {
     // case 1: well known d_tag values that imply Elf32_Dyn.d_un contains an address in d_ptr
diff --git a/libelffile/elf/xz_utils.cc b/libelffile/elf/xz_utils.cc
index f064cb0..4ec184a 100644
--- a/libelffile/elf/xz_utils.cc
+++ b/libelffile/elf/xz_utils.cc
@@ -22,6 +22,7 @@
 #include "base/array_ref.h"
 #include "base/bit_utils.h"
 #include "base/leb128.h"
+#include "base/mem_map.h"
 #include "dwarf/writer.h"
 
 // liblzma.
@@ -98,6 +99,8 @@
 }
 
 void XzDecompress(ArrayRef<const uint8_t> src, std::vector<uint8_t>* dst) {
+  const size_t page_size = MemMap::GetPageSize();
+
   XzInitCrc();
   std::unique_ptr<CXzUnpacker> state(new CXzUnpacker());
   ISzAlloc alloc;
@@ -109,7 +112,7 @@
   size_t dst_offset = 0;
   ECoderStatus status;
   do {
-    dst->resize(RoundUp(dst_offset + kPageSize / 4, kPageSize));
+    dst->resize(RoundUp(dst_offset + page_size / 4, page_size));
     size_t src_remaining = src.size() - src_offset;
     size_t dst_remaining = dst->size() - dst_offset;
     int return_val = XzUnpacker_Code(state.get(),
diff --git a/libnativebridge/OWNERS b/libnativebridge/OWNERS
index 71f76a6..ec0bea7 100644
--- a/libnativebridge/OWNERS
+++ b/libnativebridge/OWNERS
@@ -1,6 +1,6 @@
 # Bug component: 86431
 mast@google.com
 dimitry@google.com
+levarum@google.com
 eaeltsin@google.com
 ngeoffray@google.com
-oth@google.com
diff --git a/libnativebridge/include/nativebridge/native_bridge.h b/libnativebridge/include/nativebridge/native_bridge.h
index 5904c0f..a87b04f 100644
--- a/libnativebridge/include/nativebridge/native_bridge.h
+++ b/libnativebridge/include/nativebridge/native_bridge.h
@@ -29,6 +29,11 @@
 extern "C" {
 #endif  // __cplusplus
 
+enum JNICallType {
+  kJNICallTypeRegular = 1,
+  kJNICallTypeCriticalNative = 2,
+};
+
 // Loads a shared library from the system linker namespace, suitable for
 // platform libraries in /system/lib(64). If linker namespaces don't exist (i.e.
 // on host), this simply calls dlopen().
@@ -81,8 +86,15 @@
 void* NativeBridgeLoadLibrary(const char* libpath, int flag);
 
 // Get a native bridge trampoline for specified native method.
+// This version is deprecated - please use NativeBridgeGetTrampoline2
 void* NativeBridgeGetTrampoline(void* handle, const char* name, const char* shorty, uint32_t len);
 
+void* NativeBridgeGetTrampoline2(void* handle,
+                                 const char* name,
+                                 const char* shorty,
+                                 uint32_t len,
+                                 enum JNICallType jni_call_type);
+
 // True if native library paths are valid and is for an ABI that is supported by native bridge.
 // The *libpath* must point to a library.
 //
@@ -206,7 +218,7 @@
   void* (*loadLibrary)(const char* libpath, int flag);
 
   // Get a native bridge trampoline for specified native method. The trampoline has same
-  // sigature as the native method.
+  // signature as the native method.
   //
   // Parameters:
   //   handle [IN] the handle returned from loadLibrary
@@ -214,6 +226,9 @@
   //   len [IN] length of shorty
   // Returns:
   //   address of trampoline if successful, otherwise NULL
+  // Deprecated in v7
+  //   Starting with version 7 native bridge uses getTrampolineWithJNICallType
+  //   instead
   void* (*getTrampoline)(void* handle, const char* name, const char* shorty, uint32_t len);
 
   // Check whether native library is valid and is for an ABI that is supported by native bridge.
@@ -387,6 +402,25 @@
   // If native bridge is used in app-zygote (in doPreload()) this callback is
   // required to clean-up the environment before the fork (see b/146904103).
   void (*preZygoteFork)();
+
+  // This replaces previous getTrampoline call starting with version 7 of the
+  // interface.
+  //
+  // Get a native bridge trampoline for specified native method. The trampoline
+  // has same signature as the native method.
+  //
+  // Parameters:
+  //   handle [IN] the handle returned from loadLibrary
+  //   shorty [IN] short descriptor of native method
+  //   len [IN] length of shorty
+  //   jni_call_type [IN] the type of JNI call
+  // Returns:
+  //   address of trampoline if successful, otherwise NULL
+  void* (*getTrampolineWithJNICallType)(void* handle,
+                                        const char* name,
+                                        const char* shorty,
+                                        uint32_t len,
+                                        enum JNICallType jni_call_type);
 };
 
 // Runtime interfaces to native bridge.
diff --git a/libnativebridge/native_bridge.cc b/libnativebridge/native_bridge.cc
index fb13d62..aabdae6 100644
--- a/libnativebridge/native_bridge.cc
+++ b/libnativebridge/native_bridge.cc
@@ -131,6 +131,8 @@
   RUNTIME_NAMESPACE_VERSION = 5,
   // The version with pre-zygote-fork hook to support app-zygotes.
   PRE_ZYGOTE_FORK_VERSION = 6,
+  // The version with critical_native support
+  CRITICAL_NATIVE_SUPPORT_VERSION = 7,
 };
 
 // Whether we had an error at some point.
@@ -569,10 +571,26 @@
 
 void* NativeBridgeGetTrampoline(void* handle, const char* name, const char* shorty,
                                 uint32_t len) {
-  if (NativeBridgeInitialized()) {
+  return NativeBridgeGetTrampoline2(handle, name, shorty, len, kJNICallTypeRegular);
+}
+
+void* NativeBridgeGetTrampoline2(
+    void* handle, const char* name, const char* shorty, uint32_t len, JNICallType jni_call_type) {
+  if (!NativeBridgeInitialized()) {
+    return nullptr;
+  }
+
+  // For version 1 isCompatibleWith is always true, even though the extensions
+  // are not supported, so we need to handle it separately.
+  if (callbacks != nullptr && callbacks->version == DEFAULT_VERSION) {
     return callbacks->getTrampoline(handle, name, shorty, len);
   }
-  return nullptr;
+
+  if (isCompatibleWith(CRITICAL_NATIVE_SUPPORT_VERSION)) {
+    return callbacks->getTrampolineWithJNICallType(handle, name, shorty, len, jni_call_type);
+  }
+
+  return callbacks->getTrampoline(handle, name, shorty, len);
 }
 
 bool NativeBridgeIsSupported(const char* libpath) {
diff --git a/libnativebridge/native_bridge_lazy.cc b/libnativebridge/native_bridge_lazy.cc
index dd8a806..12dfb0d 100644
--- a/libnativebridge/native_bridge_lazy.cc
+++ b/libnativebridge/native_bridge_lazy.cc
@@ -69,6 +69,12 @@
   return f(handle, name, shorty, len);
 }
 
+void* NativeBridgeGetTrampoline2(
+    void* handle, const char* name, const char* shorty, uint32_t len, JNICallType jni_call_type) {
+  static auto f = GET_FUNC_PTR(NativeBridgeGetTrampoline2);
+  return f(handle, name, shorty, len, jni_call_type);
+}
+
 const char* NativeBridgeGetError() {
   static auto f = GET_FUNC_PTR(NativeBridgeGetError);
   return f();
diff --git a/libnativebridge/tests/Android.bp b/libnativebridge/tests/Android.bp
index b2d29f1..24b8f3a 100644
--- a/libnativebridge/tests/Android.bp
+++ b/libnativebridge/tests/Android.bp
@@ -75,6 +75,15 @@
     ],
 }
 
+cc_test_library {
+    name: "libnativebridge7-test-case",
+    srcs: ["NativeBridgeTestCase7.cpp"],
+    defaults: ["libnativebridge-test-case-defaults"],
+    shared_libs: [
+        "libnativebridge7criticalnative",
+    ],
+}
+
 // A helper library to produce test-case side effect of PreZygoteForkNativeBridge.
 cc_test_library {
     name: "libnativebridge6prezygotefork",
@@ -82,6 +91,12 @@
     defaults: ["libnativebridge-test-case-defaults"],
 }
 
+cc_test_library {
+    name: "libnativebridge7criticalnative",
+    srcs: ["NativeBridge7CriticalNative_lib.cpp"],
+    defaults: ["libnativebridge-test-case-defaults"],
+}
+
 cc_defaults {
     name: "libnativebridge-tests-defaults",
     defaults: [
@@ -140,6 +155,7 @@
         "NativeBridge3CreateNamespace_test.cpp",
         "NativeBridge3LoadLibraryExt_test.cpp",
         "NativeBridge6PreZygoteFork_test.cpp",
+        "NativeBridge7CriticalNative_test.cpp",
     ],
 
     shared_libs: [
@@ -149,7 +165,9 @@
         "libnativebridge2-test-case",
         "libnativebridge3-test-case",
         "libnativebridge6-test-case",
+        "libnativebridge7-test-case",
         "libnativebridge6prezygotefork",
+        "libnativebridge7criticalnative",
     ],
     header_libs: ["libbase_headers"],
 }
@@ -168,9 +186,6 @@
     // loaded, to avoid the problems with test_per_src and pushing the extra
     // libnativebridge*-test-case.so files to device through tradefed.
     srcs: [
-        // ValidNameNativeBridge_test.cpp needs to be first due to global state
-        // had_error that isn't reset between tests.
-        "ValidNameNativeBridge_test.cpp",
         "NeedsNativeBridge_test.cpp",
         "UnavailableNativeBridge_test.cpp",
     ],
@@ -192,6 +207,35 @@
     ],
 }
 
+// ValidNameNativeBridge_test.cpp needs to be in it own executable due
+// to global state had_error that isn't reset between tests.
+cc_test {
+    name: "art_libnativebridge_valid_name_cts_tests",
+    defaults: [
+        "art_standalone_test_defaults",
+        "libnativebridge-tests-defaults",
+    ],
+
+    srcs: [
+        "ValidNameNativeBridge_test.cpp",
+    ],
+    static_libs: [
+        "libdl_android",
+        "libnativebridge",
+    ],
+    shared_libs: [
+        "liblog",
+    ],
+    header_libs: ["libbase_headers"],
+
+    test_config_template: ":art-gtests-target-standalone-cts-template",
+    test_suites: [
+        "cts",
+        "general-tests",
+        "mts-art",
+    ],
+}
+
 cc_test {
     name: "libnativebridge-lazy-tests",
     defaults: ["libnativebridge-tests-defaults"],
diff --git a/libnativebridge/tests/NativeBridge7CriticalNative_lib.cpp b/libnativebridge/tests/NativeBridge7CriticalNative_lib.cpp
new file mode 100644
index 0000000..6446182
--- /dev/null
+++ b/libnativebridge/tests/NativeBridge7CriticalNative_lib.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "NativeBridge7CriticalNative_lib.h"
+
+namespace android {
+
+static bool g_legacy_get_trampoline_called = false;
+static bool g_get_trampoline2_called = false;
+static JNICallType g_jni_call_type = kJNICallTypeRegular;
+
+void ResetTrampolineCalledState() {
+  g_legacy_get_trampoline_called = false;
+  g_get_trampoline2_called = false;
+  g_jni_call_type = kJNICallTypeRegular;
+}
+
+void SetLegacyGetTrampolineCalled() { g_legacy_get_trampoline_called = true; }
+
+bool IsLegacyGetTrampolineCalled() { return g_legacy_get_trampoline_called; }
+
+void SetGetTrampoline2Called(JNICallType jni_call_type) {
+  g_get_trampoline2_called = true;
+  g_jni_call_type = jni_call_type;
+}
+
+bool IsGetTrampoline2Called() { return g_get_trampoline2_called; }
+
+JNICallType GetTrampoline2JNICallType() { return g_jni_call_type; }
+
+}  // namespace android
diff --git a/libnativebridge/tests/NativeBridge7CriticalNative_lib.h b/libnativebridge/tests/NativeBridge7CriticalNative_lib.h
new file mode 100644
index 0000000..5a7594b
--- /dev/null
+++ b/libnativebridge/tests/NativeBridge7CriticalNative_lib.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_LIBNATIVEBRIDGE_TESTS_NATIVEBRIDGE7CRITICALNATIVE_LIB_H_
+#define ART_LIBNATIVEBRIDGE_TESTS_NATIVEBRIDGE7CRITICALNATIVE_LIB_H_
+
+#include "nativebridge/native_bridge.h"
+
+namespace android {
+
+void ResetTrampolineCalledState();
+
+void SetLegacyGetTrampolineCalled();
+bool IsLegacyGetTrampolineCalled();
+
+void SetGetTrampoline2Called(JNICallType jni_call_type);
+bool IsGetTrampoline2Called();
+JNICallType GetTrampoline2JNICallType();
+
+}  // namespace android
+
+#endif  // ART_LIBNATIVEBRIDGE_TESTS_NATIVEBRIDGE7CRITICALNATIVE_LIB_H_
diff --git a/libnativebridge/tests/NativeBridge7CriticalNative_test.cpp b/libnativebridge/tests/NativeBridge7CriticalNative_test.cpp
new file mode 100644
index 0000000..0d9f8bd
--- /dev/null
+++ b/libnativebridge/tests/NativeBridge7CriticalNative_test.cpp
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "NativeBridge7CriticalNative_lib.h"
+#include "NativeBridgeTest.h"
+
+namespace android {
+
+TEST_F(NativeBridgeTest, V7_CriticalNative) {
+  // Init
+  ASSERT_TRUE(LoadNativeBridge(kNativeBridgeLibrary7, nullptr));
+  ASSERT_TRUE(NativeBridgeAvailable());
+  ASSERT_TRUE(PreInitializeNativeBridge(".", "isa"));
+  ASSERT_TRUE(NativeBridgeAvailable());
+  ASSERT_TRUE(InitializeNativeBridge(nullptr, nullptr));
+  ASSERT_TRUE(NativeBridgeAvailable());
+
+  ASSERT_EQ(NativeBridgeGetVersion(), 7U);
+
+  ASSERT_FALSE(IsGetTrampoline2Called());
+  ASSERT_FALSE(IsLegacyGetTrampolineCalled());
+
+  EXPECT_EQ(NativeBridgeGetTrampoline(nullptr, "symbol", "shorty", 6), nullptr);
+  ASSERT_FALSE(IsLegacyGetTrampolineCalled());
+  ASSERT_TRUE(IsGetTrampoline2Called());
+  EXPECT_EQ(GetTrampoline2JNICallType(), kJNICallTypeRegular);
+
+  ResetTrampolineCalledState();
+
+  ASSERT_FALSE(IsGetTrampoline2Called());
+  ASSERT_FALSE(IsLegacyGetTrampolineCalled());
+
+  EXPECT_EQ(NativeBridgeGetTrampoline2(nullptr, "symbol", "shorty", 6, kJNICallTypeCriticalNative),
+            nullptr);
+  ASSERT_FALSE(IsLegacyGetTrampolineCalled());
+  ASSERT_TRUE(IsGetTrampoline2Called());
+  EXPECT_EQ(GetTrampoline2JNICallType(), kJNICallTypeCriticalNative);
+}
+
+}  // namespace android
diff --git a/libnativebridge/tests/NativeBridgeTest.h b/libnativebridge/tests/NativeBridgeTest.h
index 62509b8..6413233 100644
--- a/libnativebridge/tests/NativeBridgeTest.h
+++ b/libnativebridge/tests/NativeBridgeTest.h
@@ -28,6 +28,7 @@
 constexpr const char* kNativeBridgeLibrary2 = "libnativebridge2-test-case.so";
 constexpr const char* kNativeBridgeLibrary3 = "libnativebridge3-test-case.so";
 constexpr const char* kNativeBridgeLibrary6 = "libnativebridge6-test-case.so";
+constexpr const char* kNativeBridgeLibrary7 = "libnativebridge7-test-case.so";
 
 namespace android {
 
diff --git a/libnativebridge/tests/NativeBridgeTestCase7.cpp b/libnativebridge/tests/NativeBridgeTestCase7.cpp
new file mode 100644
index 0000000..03016bd
--- /dev/null
+++ b/libnativebridge/tests/NativeBridgeTestCase7.cpp
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// An implementation of the native-bridge interface for testing.
+
+#include "NativeBridge7CriticalNative_lib.h"
+#include "nativebridge/native_bridge.h"
+
+// NativeBridgeCallbacks implementations
+extern "C" bool native_bridge7_initialize(
+    const android::NativeBridgeRuntimeCallbacks* /* art_cbs */,
+    const char* /* app_code_cache_dir */,
+    const char* /* isa */) {
+  return true;
+}
+
+extern "C" void* native_bridge7_loadLibrary(const char* /* libpath */, int /* flag */) {
+  return nullptr;
+}
+
+extern "C" void* native_bridge7_getTrampoline(void* /* handle */,
+                                              const char* /* name */,
+                                              const char* /* shorty */,
+                                              uint32_t /* len */) {
+  android::SetLegacyGetTrampolineCalled();
+  return nullptr;
+}
+
+extern "C" void* native_bridge7_getTrampoline2(void* /* handle */,
+                                               const char* /* name */,
+                                               const char* /* shorty */,
+                                               uint32_t /* len */,
+                                               android::JNICallType jni_call_type) {
+  android::SetGetTrampoline2Called(jni_call_type);
+  return nullptr;
+}
+
+extern "C" bool native_bridge7_isSupported(const char* /* libpath */) { return false; }
+
+extern "C" const struct android::NativeBridgeRuntimeValues* native_bridge7_getAppEnv(
+    const char* /* abi */) {
+  return nullptr;
+}
+
+extern "C" bool native_bridge7_isCompatibleWith(uint32_t version) {
+  // For testing, allow 1-7, but disallow 8+.
+  return version <= 7;
+}
+
+extern "C" android::NativeBridgeSignalHandlerFn native_bridge7_getSignalHandler(int /* signal */) {
+  return nullptr;
+}
+
+extern "C" int native_bridge7_unloadLibrary(void* /* handle */) { return 0; }
+
+extern "C" const char* native_bridge7_getError() { return nullptr; }
+
+extern "C" bool native_bridge7_isPathSupported(const char* /* path */) { return true; }
+
+extern "C" bool native_bridge7_initAnonymousNamespace(const char* /* public_ns_sonames */,
+                                                      const char* /* anon_ns_library_path */) {
+  return true;
+}
+
+extern "C" android::native_bridge_namespace_t* native_bridge7_createNamespace(
+    const char* /* name */,
+    const char* /* ld_library_path */,
+    const char* /* default_library_path */,
+    uint64_t /* type */,
+    const char* /* permitted_when_isolated_path */,
+    android::native_bridge_namespace_t* /* parent_ns */) {
+  return nullptr;
+}
+
+extern "C" bool native_bridge7_linkNamespaces(android::native_bridge_namespace_t* /* from */,
+                                              android::native_bridge_namespace_t* /* to */,
+                                              const char* /* shared_libs_soname */) {
+  return true;
+}
+
+extern "C" void* native_bridge7_loadLibraryExt(const char* /* libpath */,
+                                               int /* flag */,
+                                               android::native_bridge_namespace_t* /* ns */) {
+  return nullptr;
+}
+
+extern "C" android::native_bridge_namespace_t* native_bridge7_getVendorNamespace() {
+  return nullptr;
+}
+
+extern "C" android::native_bridge_namespace_t* native_bridge7_getExportedNamespace(
+    const char* /* name */) {
+  return nullptr;
+}
+
+extern "C" void native_bridge7_preZygoteFork() {}
+
+android::NativeBridgeCallbacks NativeBridgeItf{
+    // v1
+    .version = 7,
+    .initialize = &native_bridge7_initialize,
+    .loadLibrary = &native_bridge7_loadLibrary,
+    .getTrampoline = &native_bridge7_getTrampoline,
+    .isSupported = &native_bridge7_isSupported,
+    .getAppEnv = &native_bridge7_getAppEnv,
+    // v2
+    .isCompatibleWith = &native_bridge7_isCompatibleWith,
+    .getSignalHandler = &native_bridge7_getSignalHandler,
+    // v3
+    .unloadLibrary = &native_bridge7_unloadLibrary,
+    .getError = &native_bridge7_getError,
+    .isPathSupported = &native_bridge7_isPathSupported,
+    .initAnonymousNamespace = &native_bridge7_initAnonymousNamespace,
+    .createNamespace = &native_bridge7_createNamespace,
+    .linkNamespaces = &native_bridge7_linkNamespaces,
+    .loadLibraryExt = &native_bridge7_loadLibraryExt,
+    // v4
+    &native_bridge7_getVendorNamespace,
+    // v5
+    &native_bridge7_getExportedNamespace,
+    // v6
+    &native_bridge7_preZygoteFork,
+    // v7
+    &native_bridge7_getTrampoline2};
diff --git a/libnativeloader/Android.bp b/libnativeloader/Android.bp
index 16449ac..e9c26c5 100644
--- a/libnativeloader/Android.bp
+++ b/libnativeloader/Android.bp
@@ -158,6 +158,7 @@
         "native_loader_test.cpp",
     ],
     srcs: [
+        "library_namespaces_test.cpp",
         "native_loader_api_test.c",
         "native_loader_test.cpp",
         "open_system_library.cpp",
diff --git a/libnativeloader/OWNERS b/libnativeloader/OWNERS
index 87f9142..efe7e88 100644
--- a/libnativeloader/OWNERS
+++ b/libnativeloader/OWNERS
@@ -2,5 +2,4 @@
 mast@google.com
 jiyong@google.com
 ngeoffray@google.com
-oth@google.com
 rpl@google.com
diff --git a/libnativeloader/library_namespaces.cpp b/libnativeloader/library_namespaces.cpp
index 1e29f4e..e2b2729 100644
--- a/libnativeloader/library_namespaces.cpp
+++ b/libnativeloader/library_namespaces.cpp
@@ -16,23 +16,28 @@
 
 #if defined(ART_TARGET_ANDROID)
 
+#define LOG_TAG "nativeloader"
+
 #include "library_namespaces.h"
 
 #include <dirent.h>
 #include <dlfcn.h>
+#include <stdio.h>
 
+#include <algorithm>
+#include <optional>
 #include <regex>
 #include <string>
+#include <string_view>
 #include <vector>
 
-#include <android-base/file.h>
-#include <android-base/logging.h>
-#include <android-base/macros.h>
-#include <android-base/result.h>
-#include <android-base/strings.h>
-#include <android-base/stringprintf.h>
-#include <nativehelper/scoped_utf_chars.h>
-
+#include "android-base/file.h"
+#include "android-base/logging.h"
+#include "android-base/macros.h"
+#include "android-base/result.h"
+#include "android-base/stringprintf.h"
+#include "android-base/strings.h"
+#include "nativehelper/scoped_utf_chars.h"
 #include "nativeloader/dlext_namespaces.h"
 #include "public_libraries.h"
 #include "utils.h"
@@ -41,21 +46,10 @@
 
 namespace {
 
+using ::android::base::Error;
+
 constexpr const char* kApexPath = "/apex/";
 
-// The device may be configured to have the vendor libraries loaded to a separate namespace.
-// For historical reasons this namespace was named sphal but effectively it is intended
-// to use to load vendor libraries to separate namespace with controlled interface between
-// vendor and system namespaces.
-constexpr const char* kVendorNamespaceName = "sphal";
-// Similar to sphal namespace, product namespace provides some product libraries.
-constexpr const char* kProductNamespaceName = "product";
-
-// vndk namespace for unbundled vendor apps
-constexpr const char* kVndkNamespaceName = "vndk";
-// vndk_product namespace for unbundled product apps
-constexpr const char* kVndkProductNamespaceName = "vndk_product";
-
 // clns-XX is a linker namespace that is created for normal apps installed in
 // the data partition. To be specific, it is created for the app classloader.
 // When System.load() is called from a Java class that is loaded from the
@@ -89,15 +83,8 @@
 // a symlink to the other.
 constexpr const char* kProductLibPath = "/product/" LIB ":/system/product/" LIB;
 
-const std::regex kVendorDexPathRegex("(^|:)(/system)?/vendor/");
-const std::regex kProductDexPathRegex("(^|:)(/system)?/product/");
-
-// Define origin partition of APK
-using ApkOrigin = enum {
-  APK_ORIGIN_DEFAULT = 0,
-  APK_ORIGIN_VENDOR = 1,   // Includes both /vendor and /system/vendor
-  APK_ORIGIN_PRODUCT = 2,  // Includes both /product and /system/product
-};
+const std::regex kVendorPathRegex("(/system)?/vendor/.*");
+const std::regex kProductPathRegex("(/system)?/product/.*");
 
 jobject GetParentClassLoader(JNIEnv* env, jobject class_loader) {
   jclass class_loader_class = env->FindClass("java/lang/ClassLoader");
@@ -107,22 +94,44 @@
   return env->CallObjectMethod(class_loader, get_parent);
 }
 
-ApkOrigin GetApkOriginFromDexPath(const std::string& dex_path) {
-  ApkOrigin apk_origin = APK_ORIGIN_DEFAULT;
-  if (std::regex_search(dex_path, kVendorDexPathRegex)) {
-    apk_origin = APK_ORIGIN_VENDOR;
-  }
-  if (std::regex_search(dex_path, kProductDexPathRegex)) {
-    LOG_ALWAYS_FATAL_IF(apk_origin == APK_ORIGIN_VENDOR,
-                        "Dex path contains both vendor and product partition : %s",
-                        dex_path.c_str());
+}  // namespace
 
-    apk_origin = APK_ORIGIN_PRODUCT;
+ApiDomain GetApiDomainFromPath(const std::string_view path) {
+  if (std::regex_match(path.begin(), path.end(), kVendorPathRegex)) {
+    return API_DOMAIN_VENDOR;
   }
-  return apk_origin;
+  if (is_product_treblelized() && std::regex_match(path.begin(), path.end(), kProductPathRegex)) {
+    return API_DOMAIN_PRODUCT;
+  }
+  return API_DOMAIN_DEFAULT;
 }
 
-}  // namespace
+// Returns the API domain for a ':'-separated list of paths, or an error if they
+// match more than one.
+Result<ApiDomain> GetApiDomainFromPathList(const std::string& path_list) {
+  ApiDomain result = API_DOMAIN_DEFAULT;
+  size_t start_pos = 0;
+  while (true) {
+    size_t end_pos = path_list.find(':', start_pos);
+    ApiDomain api_domain =
+        GetApiDomainFromPath(std::string_view(path_list).substr(start_pos, end_pos));
+    // Allow mixing API_DOMAIN_DEFAULT with any other domain. That's a bit lax,
+    // since the default e.g. includes /data, which strictly speaking is a
+    // separate domain. However, we keep it this way to not risk compat issues
+    // until we actually need all domains.
+    if (api_domain != API_DOMAIN_DEFAULT) {
+      if (result != API_DOMAIN_DEFAULT && result != api_domain) {
+        return Error() << "Path list crosses partition boundaries: " << path_list;
+      }
+      result = api_domain;
+    }
+    if (end_pos == std::string::npos) {
+      break;
+    }
+    start_pos = end_pos + 1;
+  }
+  return result;
+}
 
 void LibraryNamespaces::Initialize() {
   // Once public namespace is initialized there is no
@@ -170,7 +179,7 @@
   }
   std::vector<std::string> filtered;
   std::vector<std::string> orig = android::base::Split(public_libraries, ":");
-  for (const auto& lib : uses_libraries) {
+  for (const std::string& lib : uses_libraries) {
     if (std::find(orig.begin(), orig.end(), lib) != orig.end()) {
       filtered.emplace_back(lib);
     }
@@ -178,32 +187,29 @@
   return android::base::Join(filtered, ":");
 }
 
-Result<NativeLoaderNamespace*> LibraryNamespaces::Create(JNIEnv* env, uint32_t target_sdk_version,
-                                                         jobject class_loader, bool is_shared,
-                                                         jstring dex_path_j,
-                                                         jstring java_library_path,
-                                                         jstring java_permitted_path,
-                                                         jstring uses_library_list) {
+Result<NativeLoaderNamespace*> LibraryNamespaces::Create(JNIEnv* env,
+                                                         uint32_t target_sdk_version,
+                                                         jobject class_loader,
+                                                         ApiDomain api_domain,
+                                                         bool is_shared,
+                                                         const std::string& dex_path,
+                                                         jstring library_path_j,
+                                                         jstring permitted_path_j,
+                                                         jstring uses_library_list_j) {
   std::string library_path;  // empty string by default.
-  std::string dex_path;
 
-  if (java_library_path != nullptr) {
-    ScopedUtfChars library_path_utf_chars(env, java_library_path);
+  if (library_path_j != nullptr) {
+    ScopedUtfChars library_path_utf_chars(env, library_path_j);
     library_path = library_path_utf_chars.c_str();
   }
 
-  if (dex_path_j != nullptr) {
-    ScopedUtfChars dex_path_chars(env, dex_path_j);
-    dex_path = dex_path_chars.c_str();
-  }
-
   std::vector<std::string> uses_libraries;
-  if (uses_library_list != nullptr) {
-    ScopedUtfChars names(env, uses_library_list);
+  if (uses_library_list_j != nullptr) {
+    ScopedUtfChars names(env, uses_library_list_j);
     uses_libraries = android::base::Split(names.c_str(), ":");
   } else {
-    // uses_library_list could be nullptr when System.loadLibrary is called from a
-    // custom classloader. In that case, we don't know the list of public
+    // uses_library_list_j could be nullptr when System.loadLibrary is called
+    // from a custom classloader. In that case, we don't know the list of public
     // libraries because we don't know which apk the classloader is for. Only
     // choices we can have are 1) allowing all public libs (as before), or 2)
     // not allowing all but NDK libs. Here we take #1 because #2 would surprise
@@ -214,8 +220,6 @@
     uses_libraries.emplace_back(LIBRARY_ALL);
   }
 
-  ApkOrigin apk_origin = GetApkOriginFromDexPath(dex_path);
-
   // (http://b/27588281) This is a workaround for apps using custom
   // classloaders and calling System.load() with an absolute path which
   // is outside of the classloader library search path.
@@ -224,8 +228,8 @@
   // under /data and /mnt/expand
   std::string permitted_path = kAlwaysPermittedDirectories;
 
-  if (java_permitted_path != nullptr) {
-    ScopedUtfChars path(env, java_permitted_path);
+  if (permitted_path_j != nullptr) {
+    ScopedUtfChars path(env, permitted_path_j);
     if (path.c_str() != nullptr && path.size() > 0) {
       permitted_path = permitted_path + ":" + path.c_str();
     }
@@ -236,13 +240,13 @@
 
   std::string system_exposed_libraries = default_public_libraries();
   std::string namespace_name = kClassloaderNamespaceName;
-  ApkOrigin unbundled_app_origin = APK_ORIGIN_DEFAULT;
-  const char* apk_origin_msg = "other apk";  // Only for debug logging.
+  ApiDomain unbundled_app_domain = API_DOMAIN_DEFAULT;
+  const char* api_domain_msg = "other apk";  // Only for debug logging.
 
   if (!is_shared) {
-    if (apk_origin == APK_ORIGIN_VENDOR) {
-      unbundled_app_origin = APK_ORIGIN_VENDOR;
-      apk_origin_msg = "unbundled vendor apk";
+    if (api_domain == API_DOMAIN_VENDOR) {
+      unbundled_app_domain = API_DOMAIN_VENDOR;
+      api_domain_msg = "unbundled vendor apk";
 
       // For vendor apks, give access to the vendor libs even though they are
       // treated as unbundled; the libs and apks are still bundled together in the
@@ -255,9 +259,9 @@
 
       // Different name is useful for debugging
       namespace_name = kVendorClassloaderNamespaceName;
-    } else if (apk_origin == APK_ORIGIN_PRODUCT && is_product_treblelized()) {
-      unbundled_app_origin = APK_ORIGIN_PRODUCT;
-      apk_origin_msg = "unbundled product apk";
+    } else if (api_domain == API_DOMAIN_PRODUCT) {
+      unbundled_app_domain = API_DOMAIN_PRODUCT;
+      api_domain_msg = "unbundled product apk";
 
       // Like for vendor apks, give access to the product libs since they are
       // bundled together in the same partition.
@@ -287,20 +291,20 @@
       "Configuring %s for %s %s. target_sdk_version=%u, uses_libraries=%s, library_path=%s, "
       "permitted_path=%s",
       namespace_name.c_str(),
-      apk_origin_msg,
+      api_domain_msg,
       dex_path.c_str(),
       static_cast<unsigned>(target_sdk_version),
       android::base::Join(uses_libraries, ':').c_str(),
       library_path.c_str(),
       permitted_path.c_str());
 
-  if (unbundled_app_origin != APK_ORIGIN_VENDOR) {
+  if (unbundled_app_domain != API_DOMAIN_VENDOR) {
     // Extended public libraries are NOT available to unbundled vendor apks, but
     // they are to other apps, including those in system, system_ext, and
     // product partitions. The reason is that when GSI is used, the system
     // partition may get replaced, and then vendor apps may fail. It's fine for
     // product apps, because that partition isn't mounted in GSI tests.
-    auto libs =
+    const std::string libs =
         filter_public_libraries(target_sdk_version, uses_libraries, extended_public_libraries());
     if (!libs.empty()) {
       ALOGD("Extending system_exposed_libraries: %s", libs.c_str());
@@ -320,27 +324,33 @@
   bool also_used_as_anonymous = is_main_classloader;
   // Note: this function is executed with g_namespaces_mutex held, thus no
   // racing here.
-  auto app_ns = NativeLoaderNamespace::Create(
-      namespace_name, library_path, permitted_path, parent_ns, is_shared,
-      target_sdk_version < 24 /* is_exempt_list_enabled */, also_used_as_anonymous);
+  Result<NativeLoaderNamespace> app_ns =
+      NativeLoaderNamespace::Create(namespace_name,
+                                    library_path,
+                                    permitted_path,
+                                    parent_ns,
+                                    is_shared,
+                                    target_sdk_version < 24 /* is_exempt_list_enabled */,
+                                    also_used_as_anonymous);
   if (!app_ns.ok()) {
     return app_ns.error();
   }
   // ... and link to other namespaces to allow access to some public libraries
   bool is_bridged = app_ns->IsBridged();
 
-  auto system_ns = NativeLoaderNamespace::GetSystemNamespace(is_bridged);
+  Result<NativeLoaderNamespace> system_ns = NativeLoaderNamespace::GetSystemNamespace(is_bridged);
   if (!system_ns.ok()) {
     return system_ns.error();
   }
 
-  auto linked = app_ns->Link(&system_ns.value(), system_exposed_libraries);
+  Result<void> linked = app_ns->Link(&system_ns.value(), system_exposed_libraries);
   if (!linked.ok()) {
     return linked.error();
   }
 
   for (const auto&[apex_ns_name, public_libs] : apex_public_libraries()) {
-    auto ns = NativeLoaderNamespace::GetExportedNamespace(apex_ns_name, is_bridged);
+    Result<NativeLoaderNamespace> ns =
+        NativeLoaderNamespace::GetExportedNamespace(apex_ns_name, is_bridged);
     // Even if APEX namespace is visible, it may not be available to bridged.
     if (ns.ok()) {
       linked = app_ns->Link(&ns.value(), public_libs);
@@ -351,8 +361,9 @@
   }
 
   // Give access to VNDK-SP libraries from the 'vndk' namespace for unbundled vendor apps.
-  if (unbundled_app_origin == APK_ORIGIN_VENDOR && !vndksp_libraries_vendor().empty()) {
-    auto vndk_ns = NativeLoaderNamespace::GetExportedNamespace(kVndkNamespaceName, is_bridged);
+  if (unbundled_app_domain == API_DOMAIN_VENDOR && !vndksp_libraries_vendor().empty()) {
+    Result<NativeLoaderNamespace> vndk_ns =
+        NativeLoaderNamespace::GetExportedNamespace(kVndkNamespaceName, is_bridged);
     if (vndk_ns.ok()) {
       linked = app_ns->Link(&vndk_ns.value(), vndksp_libraries_vendor());
       if (!linked.ok()) {
@@ -362,8 +373,9 @@
   }
 
   // Give access to VNDK-SP libraries from the 'vndk_product' namespace for unbundled product apps.
-  if (unbundled_app_origin == APK_ORIGIN_PRODUCT && !vndksp_libraries_product().empty()) {
-    auto vndk_ns = NativeLoaderNamespace::GetExportedNamespace(kVndkProductNamespaceName, is_bridged);
+  if (unbundled_app_domain == API_DOMAIN_PRODUCT && !vndksp_libraries_product().empty()) {
+    Result<NativeLoaderNamespace> vndk_ns =
+        NativeLoaderNamespace::GetExportedNamespace(kVndkProductNamespaceName, is_bridged);
     if (vndk_ns.ok()) {
       linked = app_ns->Link(&vndk_ns.value(), vndksp_libraries_product());
       if (!linked.ok()) {
@@ -373,11 +385,12 @@
   }
 
   for (const std::string& each_jar_path : android::base::Split(dex_path, ":")) {
-    auto apex_ns_name = FindApexNamespaceName(each_jar_path);
-    if (apex_ns_name.ok()) {
-      const auto& jni_libs = apex_jni_libraries(*apex_ns_name);
+    std::optional<std::string> apex_ns_name = FindApexNamespaceName(each_jar_path);
+    if (apex_ns_name.has_value()) {
+      const std::string& jni_libs = apex_jni_libraries(apex_ns_name.value());
       if (jni_libs != "") {
-        auto apex_ns = NativeLoaderNamespace::GetExportedNamespace(*apex_ns_name, is_bridged);
+        Result<NativeLoaderNamespace> apex_ns =
+            NativeLoaderNamespace::GetExportedNamespace(apex_ns_name.value(), is_bridged);
         if (apex_ns.ok()) {
           linked = app_ns->Link(&apex_ns.value(), jni_libs);
           if (!linked.ok()) {
@@ -388,12 +401,13 @@
     }
   }
 
-  auto vendor_libs = filter_public_libraries(target_sdk_version, uses_libraries,
-                                             vendor_public_libraries());
+  const std::string vendor_libs =
+      filter_public_libraries(target_sdk_version, uses_libraries, vendor_public_libraries());
   if (!vendor_libs.empty()) {
-    auto vendor_ns = NativeLoaderNamespace::GetExportedNamespace(kVendorNamespaceName, is_bridged);
+    Result<NativeLoaderNamespace> vendor_ns =
+        NativeLoaderNamespace::GetExportedNamespace(kVendorNamespaceName, is_bridged);
     // when vendor_ns is not configured, link to the system namespace
-    auto target_ns = vendor_ns.ok() ? vendor_ns : system_ns;
+    Result<NativeLoaderNamespace> target_ns = vendor_ns.ok() ? vendor_ns : system_ns;
     if (target_ns.ok()) {
       linked = app_ns->Link(&target_ns.value(), vendor_libs);
       if (!linked.ok()) {
@@ -402,10 +416,10 @@
     }
   }
 
-  auto product_libs = filter_public_libraries(target_sdk_version, uses_libraries,
-                                              product_public_libraries());
+  const std::string product_libs =
+      filter_public_libraries(target_sdk_version, uses_libraries, product_public_libraries());
   if (!product_libs.empty()) {
-    auto target_ns = system_ns;
+    Result<NativeLoaderNamespace> target_ns = system_ns;
     if (is_product_treblelized()) {
       target_ns = NativeLoaderNamespace::GetExportedNamespace(kProductNamespaceName, is_bridged);
     }
@@ -422,8 +436,8 @@
     }
   }
 
-  auto& emplaced = namespaces_.emplace_back(
-      std::make_pair(env->NewWeakGlobalRef(class_loader), *app_ns));
+  std::pair<jweak, NativeLoaderNamespace>& emplaced =
+      namespaces_.emplace_back(std::make_pair(env->NewWeakGlobalRef(class_loader), *app_ns));
   if (is_main_classloader) {
     app_main_namespace_ = &emplaced.second;
   }
@@ -459,7 +473,7 @@
   return nullptr;
 }
 
-base::Result<std::string> FindApexNamespaceName(const std::string& location) {
+std::optional<std::string> FindApexNamespaceName(const std::string& location) {
   // Lots of implicit assumptions here: we expect `location` to be of the form:
   // /apex/modulename/...
   //
@@ -473,7 +487,7 @@
     std::replace(name.begin(), name.end(), '.', '_');
     return name;
   }
-  return base::Error();
+  return std::nullopt;
 }
 
 }  // namespace android::nativeloader
diff --git a/libnativeloader/library_namespaces.h b/libnativeloader/library_namespaces.h
index 4871528..ae1cd88 100644
--- a/libnativeloader/library_namespaces.h
+++ b/libnativeloader/library_namespaces.h
@@ -21,20 +21,43 @@
 #error "Not available for host or linux target"
 #endif
 
-#define LOG_TAG "nativeloader"
-
-#include "native_loader_namespace.h"
-
 #include <list>
+#include <optional>
 #include <string>
+#include <string_view>
 
-#include <android-base/result.h>
-#include <jni.h>
+#include "android-base/result.h"
+#include "jni.h"
+#include "native_loader_namespace.h"
 
 namespace android::nativeloader {
 
 using android::base::Result;
 
+// The device may be configured to have the vendor libraries loaded to a separate namespace.
+// For historical reasons this namespace was named sphal but effectively it is intended
+// to use to load vendor libraries to separate namespace with controlled interface between
+// vendor and system namespaces.
+constexpr const char* kVendorNamespaceName = "sphal";
+// Similar to sphal namespace, product namespace provides some product libraries.
+constexpr const char* kProductNamespaceName = "product";
+
+// vndk namespace for unbundled vendor apps
+constexpr const char* kVndkNamespaceName = "vndk";
+// vndk_product namespace for unbundled product apps
+constexpr const char* kVndkProductNamespaceName = "vndk_product";
+
+// API domains, roughly corresponding to partitions. Interdependencies between
+// these must follow API restrictions, while intradependencies do not.
+using ApiDomain = enum {
+  API_DOMAIN_DEFAULT = 0,  // Locations other than those below, in particular for ordinary apps
+  API_DOMAIN_VENDOR = 1,   // Vendor partition
+  API_DOMAIN_PRODUCT = 2,  // Product partition
+};
+
+ApiDomain GetApiDomainFromPath(const std::string_view path);
+Result<ApiDomain> GetApiDomainFromPathList(const std::string& path_list);
+
 // LibraryNamespaces is a singleton object that manages NativeLoaderNamespace
 // objects for an app process. Its main job is to create (and configure) a new
 // NativeLoaderNamespace object for a Java ClassLoader, and to find an existing
@@ -53,10 +76,15 @@
     initialized_ = false;
     app_main_namespace_ = nullptr;
   }
-  Result<NativeLoaderNamespace*> Create(JNIEnv* env, uint32_t target_sdk_version,
-                                        jobject class_loader, bool is_shared, jstring dex_path,
-                                        jstring java_library_path, jstring java_permitted_path,
-                                        jstring uses_library_list);
+  Result<NativeLoaderNamespace*> Create(JNIEnv* env,
+                                        uint32_t target_sdk_version,
+                                        jobject class_loader,
+                                        ApiDomain api_domain,
+                                        bool is_shared,
+                                        const std::string& dex_path,
+                                        jstring library_path_j,
+                                        jstring permitted_path_j,
+                                        jstring uses_library_list_j);
   NativeLoaderNamespace* FindNamespaceByClassLoader(JNIEnv* env, jobject class_loader);
 
  private:
@@ -68,7 +96,7 @@
   std::list<std::pair<jweak, NativeLoaderNamespace>> namespaces_;
 };
 
-Result<std::string> FindApexNamespaceName(const std::string& location);
+std::optional<std::string> FindApexNamespaceName(const std::string& location);
 
 }  // namespace android::nativeloader
 
diff --git a/libnativeloader/library_namespaces_test.cpp b/libnativeloader/library_namespaces_test.cpp
new file mode 100644
index 0000000..7780418
--- /dev/null
+++ b/libnativeloader/library_namespaces_test.cpp
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#if defined(ART_TARGET_ANDROID)
+
+#include "library_namespaces.h"
+
+#include "android-base/result-gmock.h"
+#include "gtest/gtest.h"
+#include "public_libraries.h"
+
+namespace android {
+namespace nativeloader {
+namespace {
+
+using ::android::base::testing::HasError;
+using ::android::base::testing::HasValue;
+using ::android::base::testing::WithMessage;
+using ::testing::StartsWith;
+
+TEST(LibraryNamespacesTest, TestGetApiDomainFromPath) {
+  // GetApiDomainFromPath returns API_DOMAIN_PRODUCT only if the device is
+  // trebleized and has an unbundled product partition.
+  ApiDomain api_domain_product = is_product_treblelized() ? API_DOMAIN_PRODUCT : API_DOMAIN_DEFAULT;
+
+  EXPECT_EQ(GetApiDomainFromPath("/data/somewhere"), API_DOMAIN_DEFAULT);
+  EXPECT_EQ(GetApiDomainFromPath("/system/somewhere"), API_DOMAIN_DEFAULT);
+  EXPECT_EQ(GetApiDomainFromPath("/product/somewhere"), api_domain_product);
+  EXPECT_EQ(GetApiDomainFromPath("/vendor/somewhere"), API_DOMAIN_VENDOR);
+  EXPECT_EQ(GetApiDomainFromPath("/system/product/somewhere"), api_domain_product);
+  EXPECT_EQ(GetApiDomainFromPath("/system/vendor/somewhere"), API_DOMAIN_VENDOR);
+
+  EXPECT_EQ(GetApiDomainFromPath(""), API_DOMAIN_DEFAULT);
+  EXPECT_EQ(GetApiDomainFromPath("/"), API_DOMAIN_DEFAULT);
+  EXPECT_EQ(GetApiDomainFromPath("product/somewhere"), API_DOMAIN_DEFAULT);
+  EXPECT_EQ(GetApiDomainFromPath("/product"), API_DOMAIN_DEFAULT);
+  EXPECT_EQ(GetApiDomainFromPath("/product/"), api_domain_product);
+  EXPECT_EQ(GetApiDomainFromPath(":/product/"), API_DOMAIN_DEFAULT);
+
+  EXPECT_EQ(GetApiDomainFromPath("/data/somewhere:/product/somewhere"), API_DOMAIN_DEFAULT);
+  EXPECT_EQ(GetApiDomainFromPath("/vendor/somewhere:/product/somewhere"), API_DOMAIN_VENDOR);
+  EXPECT_EQ(GetApiDomainFromPath("/product/somewhere:/vendor/somewhere"), api_domain_product);
+}
+
+TEST(LibraryNamespacesTest, TestGetApiDomainFromPathList) {
+  // GetApiDomainFromPath returns API_DOMAIN_PRODUCT only if the device is
+  // trebleized and has an unbundled product partition.
+  ApiDomain api_domain_product = is_product_treblelized() ? API_DOMAIN_PRODUCT : API_DOMAIN_DEFAULT;
+
+  EXPECT_THAT(GetApiDomainFromPathList("/data/somewhere"), HasValue(API_DOMAIN_DEFAULT));
+  EXPECT_THAT(GetApiDomainFromPathList("/system/somewhere"), HasValue(API_DOMAIN_DEFAULT));
+  EXPECT_THAT(GetApiDomainFromPathList("/product/somewhere"), HasValue(api_domain_product));
+  EXPECT_THAT(GetApiDomainFromPathList("/vendor/somewhere"), HasValue(API_DOMAIN_VENDOR));
+  EXPECT_THAT(GetApiDomainFromPathList("/system/product/somewhere"), HasValue(api_domain_product));
+  EXPECT_THAT(GetApiDomainFromPathList("/system/vendor/somewhere"), HasValue(API_DOMAIN_VENDOR));
+
+  EXPECT_THAT(GetApiDomainFromPathList(""), HasValue(API_DOMAIN_DEFAULT));
+  EXPECT_THAT(GetApiDomainFromPathList(":"), HasValue(API_DOMAIN_DEFAULT));
+  EXPECT_THAT(GetApiDomainFromPathList(":/vendor/somewhere"), HasValue(API_DOMAIN_VENDOR));
+  EXPECT_THAT(GetApiDomainFromPathList("/vendor/somewhere:"), HasValue(API_DOMAIN_VENDOR));
+
+  EXPECT_THAT(GetApiDomainFromPathList("/data/somewhere:/product/somewhere"),
+              HasValue(api_domain_product));
+  if (api_domain_product == API_DOMAIN_PRODUCT) {
+    EXPECT_THAT(GetApiDomainFromPathList("/vendor/somewhere:/product/somewhere"),
+                HasError(WithMessage(StartsWith("Path list crosses partition boundaries"))));
+    EXPECT_THAT(GetApiDomainFromPathList("/product/somewhere:/vendor/somewhere"),
+                HasError(WithMessage(StartsWith("Path list crosses partition boundaries"))));
+  }
+}
+
+}  // namespace
+}  // namespace nativeloader
+}  // namespace android
+
+#endif  // ART_TARGET_ANDROID
diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp
index 2deb5ef..6192543 100644
--- a/libnativeloader/native_loader.cpp
+++ b/libnativeloader/native_loader.cpp
@@ -24,19 +24,21 @@
 #include <algorithm>
 #include <memory>
 #include <mutex>
+#include <optional>
 #include <string>
 #include <vector>
 
-#include <android-base/file.h>
-#include <android-base/macros.h>
-#include <android-base/strings.h>
-#include <android-base/thread_annotations.h>
-#include <nativebridge/native_bridge.h>
-#include <nativehelper/scoped_utf_chars.h>
+#include "android-base/file.h"
+#include "android-base/macros.h"
+#include "android-base/strings.h"
+#include "android-base/thread_annotations.h"
+#include "nativebridge/native_bridge.h"
+#include "nativehelper/scoped_utf_chars.h"
+#include "public_libraries.h"
 
 #ifdef ART_TARGET_ANDROID
-#include <log/log.h>
 #include "library_namespaces.h"
+#include "log/log.h"
 #include "nativeloader/dlext_namespaces.h"
 #endif
 
@@ -46,6 +48,9 @@
 
 #if defined(ART_TARGET_ANDROID)
 
+using ::android::base::Result;
+using ::android::nativeloader::LibraryNamespaces;
+
 // NATIVELOADER_DEFAULT_NAMESPACE_LIBS is an environment variable that can be
 // used to list extra libraries (separated by ":") that libnativeloader will
 // load from the default namespace. The libraries must be listed without paths,
@@ -62,21 +67,24 @@
 // test libraries that depend on ART internal libraries.
 constexpr const char* kNativeloaderExtraLibs = "nativeloader-extra-libs";
 
-using android::nativeloader::LibraryNamespaces;
-
 std::mutex g_namespaces_mutex;
-LibraryNamespaces* g_namespaces = new LibraryNamespaces;
-NativeLoaderNamespace* g_nativeloader_extra_libs_namespace = nullptr;
+LibraryNamespaces* g_namespaces GUARDED_BY(g_namespaces_mutex) = new LibraryNamespaces;
+NativeLoaderNamespace* g_nativeloader_extra_libs_namespace GUARDED_BY(g_namespaces_mutex) = nullptr;
 
-android_namespace_t* FindExportedNamespace(const char* caller_location) {
-  auto name = nativeloader::FindApexNamespaceName(caller_location);
-  if (name.ok()) {
-    android_namespace_t* boot_namespace = android_get_exported_namespace(name->c_str());
-    LOG_ALWAYS_FATAL_IF((boot_namespace == nullptr),
-                        "Error finding namespace of apex: no namespace called %s", name->c_str());
-    return boot_namespace;
+std::optional<NativeLoaderNamespace> FindApexNamespace(const char* caller_location) {
+  std::optional<std::string> name = nativeloader::FindApexNamespaceName(caller_location);
+  if (name.has_value()) {
+    // Native Bridge is never used for APEXes.
+    Result<NativeLoaderNamespace> ns =
+        NativeLoaderNamespace::GetExportedNamespace(name.value(), /*is_bridged=*/false);
+    LOG_ALWAYS_FATAL_IF(!ns.ok(),
+                        "Error finding ns %s for APEX location %s: %s",
+                        name.value().c_str(),
+                        caller_location,
+                        ns.error().message().c_str());
+    return ns.value();
   }
-  return nullptr;
+  return std::nullopt;
 }
 
 Result<void> CreateNativeloaderDefaultNamespaceLibsLink(NativeLoaderNamespace& ns)
@@ -133,26 +141,34 @@
   if (!ns.ok()) {
     return ns.error();
   }
-  return ns.value()->Load(path);
+
+  Result<void*> res = ns.value()->Load(path);
+  ALOGD("Load %s using ns %s from NATIVELOADER_DEFAULT_NAMESPACE_LIBS match: %s",
+        path,
+        ns.value()->name().c_str(),
+        res.ok() ? "ok" : res.error().message().c_str());
+  return res;
 }
 
 Result<NativeLoaderNamespace*> CreateClassLoaderNamespaceLocked(JNIEnv* env,
                                                                 int32_t target_sdk_version,
                                                                 jobject class_loader,
+                                                                nativeloader::ApiDomain api_domain,
                                                                 bool is_shared,
-                                                                jstring dex_path,
-                                                                jstring library_path,
-                                                                jstring permitted_path,
-                                                                jstring uses_library_list)
+                                                                const std::string& dex_path,
+                                                                jstring library_path_j,
+                                                                jstring permitted_path_j,
+                                                                jstring uses_library_list_j)
     REQUIRES(g_namespaces_mutex) {
   Result<NativeLoaderNamespace*> ns = g_namespaces->Create(env,
                                                            target_sdk_version,
                                                            class_loader,
+                                                           api_domain,
                                                            is_shared,
                                                            dex_path,
-                                                           library_path,
-                                                           permitted_path,
-                                                           uses_library_list);
+                                                           library_path_j,
+                                                           permitted_path_j,
+                                                           uses_library_list_j);
   if (!ns.ok()) {
     return ns;
   }
@@ -163,7 +179,7 @@
   return ns;
 }
 
-#endif  // #if defined(ART_TARGET_ANDROID)
+#endif  // ART_TARGET_ANDROID
 
 }  // namespace
 
@@ -183,47 +199,86 @@
 #endif
 }
 
-jstring CreateClassLoaderNamespace(JNIEnv* env, int32_t target_sdk_version, jobject class_loader,
-                                   bool is_shared, jstring dex_path, jstring library_path,
-                                   jstring permitted_path, jstring uses_library_list) {
+// dex_path_j may be a ':'-separated list of paths, e.g. when creating a shared
+// library loader - cf. mCodePaths in android.content.pm.SharedLibraryInfo.
+jstring CreateClassLoaderNamespace(JNIEnv* env,
+                                   int32_t target_sdk_version,
+                                   jobject class_loader,
+                                   bool is_shared,
+                                   jstring dex_path_j,
+                                   jstring library_path_j,
+                                   jstring permitted_path_j,
+                                   jstring uses_library_list_j) {
 #if defined(ART_TARGET_ANDROID)
+  std::string dex_path;
+  if (dex_path_j != nullptr) {
+    ScopedUtfChars dex_path_chars(env, dex_path_j);
+    dex_path = dex_path_chars.c_str();
+  }
+
+  Result<nativeloader::ApiDomain> api_domain = nativeloader::GetApiDomainFromPathList(dex_path);
+  if (!api_domain.ok()) {
+    return env->NewStringUTF(api_domain.error().message().c_str());
+  }
+
   std::lock_guard<std::mutex> guard(g_namespaces_mutex);
   Result<NativeLoaderNamespace*> ns = CreateClassLoaderNamespaceLocked(env,
                                                                        target_sdk_version,
                                                                        class_loader,
+                                                                       api_domain.value(),
                                                                        is_shared,
                                                                        dex_path,
-                                                                       library_path,
-                                                                       permitted_path,
-                                                                       uses_library_list);
+                                                                       library_path_j,
+                                                                       permitted_path_j,
+                                                                       uses_library_list_j);
   if (!ns.ok()) {
     return env->NewStringUTF(ns.error().message().c_str());
   }
+
 #else
-  UNUSED(env, target_sdk_version, class_loader, is_shared, dex_path, library_path, permitted_path,
-         uses_library_list);
+  UNUSED(env,
+         target_sdk_version,
+         class_loader,
+         is_shared,
+         dex_path_j,
+         library_path_j,
+         permitted_path_j,
+         uses_library_list_j);
 #endif
+
   return nullptr;
 }
 
-void* OpenNativeLibrary(JNIEnv* env, int32_t target_sdk_version, const char* path,
-                        jobject class_loader, const char* caller_location, jstring library_path,
-                        bool* needs_native_bridge, char** error_msg) {
+void* OpenNativeLibrary(JNIEnv* env,
+                        int32_t target_sdk_version,
+                        const char* path,
+                        jobject class_loader,
+                        const char* caller_location,
+                        jstring library_path_j,
+                        bool* needs_native_bridge,
+                        char** error_msg) {
 #if defined(ART_TARGET_ANDROID)
-  UNUSED(target_sdk_version);
-
   if (class_loader == nullptr) {
+    // class_loader is null only for the boot class loader (see
+    // IsBootClassLoader call in JavaVMExt::LoadNativeLibrary), i.e. the caller
+    // is in the boot classpath.
     *needs_native_bridge = false;
     if (caller_location != nullptr) {
-      android_namespace_t* boot_namespace = FindExportedNamespace(caller_location);
-      if (boot_namespace != nullptr) {
+      std::optional<NativeLoaderNamespace> ns = FindApexNamespace(caller_location);
+      if (ns.has_value()) {
         const android_dlextinfo dlextinfo = {
             .flags = ANDROID_DLEXT_USE_NAMESPACE,
-            .library_namespace = boot_namespace,
+            .library_namespace = ns.value().ToRawAndroidNamespace(),
         };
         void* handle = android_dlopen_ext(path, RTLD_NOW, &dlextinfo);
-        if (handle == nullptr) {
-          *error_msg = strdup(dlerror());
+        char* dlerror_msg = handle == nullptr ? strdup(dlerror()) : nullptr;
+        ALOGD("Load %s using APEX ns %s for caller %s: %s",
+              path,
+              ns.value().name().c_str(),
+              caller_location,
+              dlerror_msg == nullptr ? "ok" : dlerror_msg);
+        if (dlerror_msg != nullptr) {
+          *error_msg = dlerror_msg;
         }
         return handle;
       }
@@ -244,53 +299,86 @@
 
     // Fall back to the system namespace. This happens for preloaded JNI
     // libraries in the zygote.
-    // TODO(b/185833744): Investigate if this should fall back to the app main
-    // namespace (aka anonymous namespace) instead.
     void* handle = OpenSystemLibrary(path, RTLD_NOW);
-    if (handle == nullptr) {
-      *error_msg = strdup(dlerror());
+    char* dlerror_msg = handle == nullptr ? strdup(dlerror()) : nullptr;
+    ALOGD("Load %s using system ns (caller=%s): %s",
+          path,
+          caller_location == nullptr ? "<unknown>" : caller_location,
+          dlerror_msg == nullptr ? "ok" : dlerror_msg);
+    if (dlerror_msg != nullptr) {
+      *error_msg = dlerror_msg;
     }
     return handle;
   }
 
   std::lock_guard<std::mutex> guard(g_namespaces_mutex);
-  NativeLoaderNamespace* ns;
 
-  if ((ns = g_namespaces->FindNamespaceByClassLoader(env, class_loader)) == nullptr) {
-    // This is the case where the classloader was not created by ApplicationLoaders
-    // In this case we create an isolated not-shared namespace for it.
-    Result<NativeLoaderNamespace*> isolated_ns =
-        CreateClassLoaderNamespaceLocked(env,
-                                         target_sdk_version,
-                                         class_loader,
-                                         /*is_shared=*/false,
-                                         /*dex_path=*/nullptr,
-                                         library_path,
-                                         /*permitted_path=*/nullptr,
-                                         /*uses_library_list=*/nullptr);
-    if (!isolated_ns.ok()) {
-      *error_msg = strdup(isolated_ns.error().message().c_str());
-      return nullptr;
-    } else {
-      ns = *isolated_ns;
+  {
+    NativeLoaderNamespace* ns = g_namespaces->FindNamespaceByClassLoader(env, class_loader);
+    if (ns != nullptr) {
+      *needs_native_bridge = ns->IsBridged();
+      Result<void*> handle = ns->Load(path);
+      ALOGD("Load %s using ns %s from class loader (caller=%s): %s",
+            path,
+            ns->name().c_str(),
+            caller_location == nullptr ? "<unknown>" : caller_location,
+            handle.ok() ? "ok" : handle.error().message().c_str());
+      if (!handle.ok()) {
+        *error_msg = strdup(handle.error().message().c_str());
+        return nullptr;
+      }
+      return handle.value();
     }
   }
 
-  return OpenNativeLibraryInNamespace(ns, path, needs_native_bridge, error_msg);
-#else
+  // This is the case where the classloader was not created by ApplicationLoaders
+  // In this case we create an isolated not-shared namespace for it.
+  const std::string empty_dex_path;
+  Result<NativeLoaderNamespace*> isolated_ns =
+      CreateClassLoaderNamespaceLocked(env,
+                                       target_sdk_version,
+                                       class_loader,
+                                       nativeloader::API_DOMAIN_DEFAULT,
+                                       /*is_shared=*/false,
+                                       empty_dex_path,
+                                       library_path_j,
+                                       /*permitted_path=*/nullptr,
+                                       /*uses_library_list=*/nullptr);
+  if (!isolated_ns.ok()) {
+    ALOGD("Failed to create isolated ns for %s (caller=%s)",
+          path,
+          caller_location == nullptr ? "<unknown>" : caller_location);
+    *error_msg = strdup(isolated_ns.error().message().c_str());
+    return nullptr;
+  }
+
+  *needs_native_bridge = isolated_ns.value()->IsBridged();
+  Result<void*> handle = isolated_ns.value()->Load(path);
+  ALOGD("Load %s using isolated ns %s (caller=%s): %s",
+        path,
+        isolated_ns.value()->name().c_str(),
+        caller_location == nullptr ? "<unknown>" : caller_location,
+        handle.ok() ? "ok" : handle.error().message().c_str());
+  if (!handle.ok()) {
+    *error_msg = strdup(handle.error().message().c_str());
+    return nullptr;
+  }
+  return handle.value();
+
+#else   // !ART_TARGET_ANDROID
   UNUSED(env, target_sdk_version, class_loader, caller_location);
 
   // Do some best effort to emulate library-path support. It will not
   // work for dependencies.
   //
   // Note: null has a special meaning and must be preserved.
-  std::string c_library_path;  // Empty string by default.
-  if (library_path != nullptr && path != nullptr && path[0] != '/') {
-    ScopedUtfChars library_path_utf_chars(env, library_path);
-    c_library_path = library_path_utf_chars.c_str();
+  std::string library_path;  // Empty string by default.
+  if (library_path_j != nullptr && path != nullptr && path[0] != '/') {
+    ScopedUtfChars library_path_utf_chars(env, library_path_j);
+    library_path = library_path_utf_chars.c_str();
   }
 
-  std::vector<std::string> library_paths = base::Split(c_library_path, ":");
+  std::vector<std::string> library_paths = base::Split(library_path, ":");
 
   for (const std::string& lib_path : library_paths) {
     *needs_native_bridge = false;
@@ -323,7 +411,7 @@
     }
   }
   return nullptr;
-#endif
+#endif  // !ART_TARGET_ANDROID
 }
 
 bool CloseNativeLibrary(void* handle, const bool needs_native_bridge, char** error_msg) {
@@ -351,7 +439,7 @@
 #if defined(ART_TARGET_ANDROID)
 void* OpenNativeLibraryInNamespace(NativeLoaderNamespace* ns, const char* path,
                                    bool* needs_native_bridge, char** error_msg) {
-  auto handle = ns->Load(path);
+  Result<void*> handle = ns->Load(path);
   if (!handle.ok() && error_msg != nullptr) {
     *error_msg = strdup(handle.error().message().c_str());
   }
@@ -397,4 +485,4 @@
 
 #endif  // ART_TARGET_ANDROID
 
-};  // namespace android
+}  // namespace android
diff --git a/libnativeloader/native_loader_lazy.cpp b/libnativeloader/native_loader_lazy.cpp
index 5b82d00..1c82dc4 100644
--- a/libnativeloader/native_loader_lazy.cpp
+++ b/libnativeloader/native_loader_lazy.cpp
@@ -35,7 +35,7 @@
 
 template <typename FuncPtr>
 FuncPtr GetFuncPtr(const char* function_name) {
-  auto f = reinterpret_cast<FuncPtr>(dlsym(GetLibHandle(), function_name));
+  FuncPtr f = reinterpret_cast<FuncPtr>(dlsym(GetLibHandle(), function_name));
   LOG_FATAL_IF(f == nullptr, "Failed to get address of %s: %s", function_name, dlerror());
   return f;
 }
diff --git a/libnativeloader/native_loader_namespace.cpp b/libnativeloader/native_loader_namespace.cpp
index 669fa74..cfb84b7 100644
--- a/libnativeloader/native_loader_namespace.cpp
+++ b/libnativeloader/native_loader_namespace.cpp
@@ -52,12 +52,12 @@
 Result<NativeLoaderNamespace> NativeLoaderNamespace::GetExportedNamespace(const std::string& name,
                                                                           bool is_bridged) {
   if (!is_bridged) {
-    auto raw = android_get_exported_namespace(name.c_str());
+    android_namespace_t* raw = android_get_exported_namespace(name.c_str());
     if (raw != nullptr) {
       return NativeLoaderNamespace(name, raw);
     }
   } else {
-    auto raw = NativeBridgeGetExportedNamespace(name.c_str());
+    native_bridge_namespace_t* raw = NativeBridgeGetExportedNamespace(name.c_str());
     if (raw != nullptr) {
       return NativeLoaderNamespace(name, raw);
     }
@@ -69,7 +69,7 @@
 // "system" for those in the Runtime APEX. Try "system" first since
 // "default" always exists.
 Result<NativeLoaderNamespace> NativeLoaderNamespace::GetSystemNamespace(bool is_bridged) {
-  auto ns = GetExportedNamespace(kSystemNamespaceName, is_bridged);
+  Result<NativeLoaderNamespace> ns = GetExportedNamespace(kSystemNamespaceName, is_bridged);
   if (ns.ok()) return ns;
   ns = GetExportedNamespace(kDefaultNamespaceName, is_bridged);
   if (ns.ok()) return ns;
@@ -96,7 +96,7 @@
   }
 
   // Fall back to the system namespace if no parent is set.
-  auto system_ns = GetSystemNamespace(is_bridged);
+  Result<NativeLoaderNamespace> system_ns = GetSystemNamespace(is_bridged);
   if (!system_ns.ok()) {
     return system_ns.error();
   }
diff --git a/libnativeloader/native_loader_test.cpp b/libnativeloader/native_loader_test.cpp
index 72348ed..3b05aae 100644
--- a/libnativeloader/native_loader_test.cpp
+++ b/libnativeloader/native_loader_test.cpp
@@ -564,7 +564,8 @@
   public com_android_bar libpublic.so
 )";
 
-  auto jni_libs = ParseApexLibrariesConfig(file_content, "jni");
+  Result<std::map<std::string, std::string>> jni_libs =
+      ParseApexLibrariesConfig(file_content, "jni");
   ASSERT_RESULT_OK(jni_libs);
   std::map<std::string, std::string> expected_jni_libs {
     {"com_android_foo", "libfoo.so"},
@@ -572,7 +573,8 @@
   };
   ASSERT_EQ(expected_jni_libs, *jni_libs);
 
-  auto public_libs = ParseApexLibrariesConfig(file_content, "public");
+  Result<std::map<std::string, std::string>> public_libs =
+      ParseApexLibrariesConfig(file_content, "public");
   ASSERT_RESULT_OK(public_libs);
   std::map<std::string, std::string> expected_public_libs {
     {"com_android_bar", "libpublic.so"},
@@ -586,7 +588,7 @@
 # missing <library list>
 jni com_android_bar
 )";
-  auto result = ParseApexLibrariesConfig(file_content, "jni");
+  Result<std::map<std::string, std::string>> result = ParseApexLibrariesConfig(file_content, "jni");
   ASSERT_FALSE(result.ok());
   ASSERT_EQ("Malformed line \"jni com_android_bar\"", result.error().message());
 }
@@ -598,7 +600,7 @@
 # unknown tag
 unknown com_android_foo libfoo
 )";
-  auto result = ParseApexLibrariesConfig(file_content, "jni");
+  Result<std::map<std::string, std::string>> result = ParseApexLibrariesConfig(file_content, "jni");
   ASSERT_FALSE(result.ok());
   ASSERT_EQ("Invalid tag \"unknown com_android_foo libfoo\"", result.error().message());
 }
@@ -608,7 +610,7 @@
 # apex linker namespace should be mangled ('.' -> '_')
 jni com.android.foo lib
 )";
-  auto result = ParseApexLibrariesConfig(file_content, "jni");
+  Result<std::map<std::string, std::string>> result = ParseApexLibrariesConfig(file_content, "jni");
   ASSERT_FALSE(result.ok());
   ASSERT_EQ("Invalid apex_namespace \"jni com.android.foo lib\"", result.error().message());
 }
@@ -618,7 +620,7 @@
 # library list is ":" separated list of filenames
 jni com_android_foo lib64/libfoo.so
 )";
-  auto result = ParseApexLibrariesConfig(file_content, "jni");
+  Result<std::map<std::string, std::string>> result = ParseApexLibrariesConfig(file_content, "jni");
   ASSERT_FALSE(result.ok());
   ASSERT_EQ("Invalid library_list \"jni com_android_foo lib64/libfoo.so\"", result.error().message());
 }
diff --git a/libnativeloader/public_libraries.cpp b/libnativeloader/public_libraries.cpp
index 87210c8..390c298 100644
--- a/libnativeloader/public_libraries.cpp
+++ b/libnativeloader/public_libraries.cpp
@@ -78,7 +78,7 @@
 // insert vndk version in every {} placeholder
 void InsertVndkVersionStr(std::string* file_name, bool use_product_vndk) {
   CHECK(file_name != nullptr);
-  auto version = vndk_version_str(use_product_vndk);
+  const std::string version = vndk_version_str(use_product_vndk);
   size_t pos = file_name->find("{}");
   while (pos != std::string::npos) {
     file_name->replace(pos, 2, version);
@@ -94,7 +94,7 @@
     const std::function<Result<bool>(const ConfigEntry& /* entry */)>& filter_fn) {
   std::string file_content;
   if (!base::ReadFileToString(configFile, &file_content)) {
-    return ErrnoError();
+    return ErrnoError() << "Failed to read " << configFile;
   }
   Result<std::vector<std::string>> result = ParseConfig(file_content, filter_fn);
   if (!result.ok()) {
@@ -123,7 +123,7 @@
             "Error extracting company name from public native library list file path \"%s\"",
             config_file_path.c_str());
 
-        auto ret = ReadConfig(
+        Result<std::vector<std::string>> ret = ReadConfig(
             config_file_path, [&company_name](const struct ConfigEntry& entry) -> Result<bool> {
               if (android::base::StartsWith(entry.soname, "lib") &&
                   android::base::EndsWith(entry.soname, "." + company_name + ".so")) {
@@ -139,8 +139,8 @@
         if (ret.ok()) {
           sonames->insert(sonames->end(), ret->begin(), ret->end());
         } else {
-          LOG_ALWAYS_FATAL("Error reading public native library list from \"%s\": %s",
-                           config_file_path.c_str(), ret.error().message().c_str());
+          LOG_ALWAYS_FATAL("Error reading extension library list: %s",
+                           ret.error().message().c_str());
         }
       }
     }
@@ -149,7 +149,7 @@
 
 static std::string InitDefaultPublicLibraries(bool for_preload) {
   std::string config_file = root_dir() + kDefaultPublicLibrariesFile;
-  auto sonames =
+  Result<std::vector<std::string>> sonames =
       ReadConfig(config_file, [&for_preload](const struct ConfigEntry& entry) -> Result<bool> {
         if (for_preload) {
           return !entry.nopreload;
@@ -158,8 +158,7 @@
         }
       });
   if (!sonames.ok()) {
-    LOG_ALWAYS_FATAL("Error reading public native library list from \"%s\": %s",
-                     config_file.c_str(), sonames.error().message().c_str());
+    LOG_ALWAYS_FATAL("%s", sonames.error().message().c_str());
     return "";
   }
 
@@ -167,8 +166,8 @@
   if (!for_preload) {
     // Remove the public libs provided by apexes because these libs are available
     // from apex namespaces.
-    for (const auto& p : apex_public_libraries()) {
-      auto public_libs = base::Split(p.second, ":");
+    for (const std::pair<std::string, std::string>& p : apex_public_libraries()) {
+      std::vector<std::string> public_libs = base::Split(p.second, ":");
       sonames->erase(std::remove_if(sonames->begin(),
                                     sonames->end(),
                                     [&public_libs](const std::string& v) {
@@ -186,7 +185,7 @@
 
 static std::string InitVendorPublicLibraries() {
   // This file is optional, quietly ignore if the file does not exist.
-  auto sonames = ReadConfig(kVendorPublicLibrariesFile, always_true);
+  Result<std::vector<std::string>> sonames = ReadConfig(kVendorPublicLibrariesFile, always_true);
   if (!sonames.ok()) {
     ALOGI("InitVendorPublicLibraries skipped: %s", sonames.error().message().c_str());
     return "";
@@ -250,9 +249,9 @@
   } else {
     config_file = kLlndkLibrariesNoVndkFile;
   }
-  auto sonames = ReadConfig(config_file, always_true);
+  Result<std::vector<std::string>> sonames = ReadConfig(config_file, always_true);
   if (!sonames.ok()) {
-    LOG_ALWAYS_FATAL("%s: %s", config_file.c_str(), sonames.error().message().c_str());
+    LOG_ALWAYS_FATAL("%s", sonames.error().message().c_str());
     return "";
   }
   std::string libs = android::base::Join(*sonames, ':');
@@ -272,9 +271,9 @@
   } else {
     config_file = kLlndkLibrariesNoVndkFile;
   }
-  auto sonames = ReadConfig(config_file, always_true);
+  Result<std::vector<std::string>> sonames = ReadConfig(config_file, always_true);
   if (!sonames.ok()) {
-    LOG_ALWAYS_FATAL("%s: %s", config_file.c_str(), sonames.error().message().c_str());
+    LOG_ALWAYS_FATAL("%s", sonames.error().message().c_str());
     return "";
   }
   std::string libs = android::base::Join(*sonames, ':');
@@ -290,7 +289,7 @@
 
   std::string config_file = kVndkLibrariesFile;
   InsertVndkVersionStr(&config_file, false);
-  auto sonames = ReadConfig(config_file, always_true);
+  Result<std::vector<std::string>> sonames = ReadConfig(config_file, always_true);
   if (!sonames.ok()) {
     LOG_ALWAYS_FATAL("%s", sonames.error().message().c_str());
     return "";
@@ -307,7 +306,7 @@
   }
   std::string config_file = kVndkLibrariesFile;
   InsertVndkVersionStr(&config_file, true);
-  auto sonames = ReadConfig(config_file, always_true);
+  Result<std::vector<std::string>> sonames = ReadConfig(config_file, always_true);
   if (!sonames.ok()) {
     LOG_ALWAYS_FATAL("%s", sonames.error().message().c_str());
     return "";
@@ -460,8 +459,8 @@
   std::vector<std::string> lines = base::Split(file_content, "\n");
 
   std::vector<std::string> sonames;
-  for (auto& line : lines) {
-    auto trimmed_line = base::Trim(line);
+  for (std::string& line : lines) {
+    std::string trimmed_line = base::Trim(line);
     if (trimmed_line[0] == '#' || trimmed_line.empty()) {
       continue;
     }
@@ -528,12 +527,12 @@
 Result<std::map<std::string, std::string>> ParseApexLibrariesConfig(const std::string& file_content, const std::string& tag) {
   std::map<std::string, std::string> entries;
   std::vector<std::string> lines = base::Split(file_content, "\n");
-  for (auto& line : lines) {
-    auto trimmed_line = base::Trim(line);
+  for (std::string& line : lines) {
+    std::string trimmed_line = base::Trim(line);
     if (trimmed_line[0] == '#' || trimmed_line.empty()) {
       continue;
     }
-    auto config_line = ParseApexLibrariesConfigLine(trimmed_line);
+    Result<ApexLibrariesConfigLine> config_line = ParseApexLibrariesConfigLine(trimmed_line);
     if (!config_line.ok()) {
       return config_line.error();
     }
diff --git a/libnativeloader/test/Android.bp b/libnativeloader/test/Android.bp
index 473dd43..6166725 100644
--- a/libnativeloader/test/Android.bp
+++ b/libnativeloader/test/Android.bp
@@ -66,16 +66,6 @@
     ],
 }
 
-java_library {
-    name: "loadlibrarytest_test_utils",
-    sdk_version: "31",
-    static_libs: [
-        "androidx.test.ext.junit",
-        "androidx.test.ext.truth",
-    ],
-    srcs: ["src/android/test/lib/TestUtils.java"],
-}
-
 // Test fixture that represents a shared library in /system/framework.
 java_library {
     name: "libnativeloader_system_shared_lib",
@@ -110,6 +100,24 @@
     srcs: ["src/android/test/vendorsharedlib/VendorSharedLib.java"],
 }
 
+java_library {
+    name: "loadlibrarytest_testlib",
+    sdk_version: "system_31",
+    static_libs: [
+        "androidx.test.ext.junit",
+        "androidx.test.ext.truth",
+        "androidx.test.rules",
+        "modules-utils-build_system",
+    ],
+    libs: [
+        "libnativeloader_system_shared_lib",
+        "libnativeloader_system_ext_shared_lib",
+        "libnativeloader_product_shared_lib",
+        "libnativeloader_vendor_shared_lib",
+    ],
+    srcs: ["src/android/test/lib/*.java"],
+}
+
 java_defaults {
     name: "loadlibrarytest_app_defaults",
     defaults: ["art_module_source_build_java_defaults"],
@@ -120,9 +128,7 @@
     // measures getting enabled in these tests, so set some high number.
     target_sdk_version: "9999",
     static_libs: [
-        "androidx.test.ext.junit",
-        "androidx.test.rules",
-        "loadlibrarytest_test_utils",
+        "loadlibrarytest_testlib",
     ],
     libs: [
         "libnativeloader_system_shared_lib",
@@ -202,5 +208,8 @@
         ":loadlibrarytest_data_app",
     ],
     test_config: "libnativeloader_e2e_tests.xml",
-    test_suites: ["general-tests"],
+    test_suites: [
+        "general-tests",
+        "mts-art",
+    ],
 }
diff --git a/libnativeloader/test/libnativeloader_e2e_tests.xml b/libnativeloader/test/libnativeloader_e2e_tests.xml
index d4f6348..276fc2b 100644
--- a/libnativeloader/test/libnativeloader_e2e_tests.xml
+++ b/libnativeloader/test/libnativeloader_e2e_tests.xml
@@ -17,6 +17,7 @@
     <option name="test-suite-tag" value="libnativeloader_e2e_tests" />
     <option name="test-suite-tag" value="apct" />
     <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
 
     <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
 
@@ -42,6 +43,15 @@
         <option name="jar" value="libnativeloader_e2e_tests.jar" />
     </test>
 
+    <!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
+         one of the Mainline modules below is present on the device used for testing. -->
+    <object type="module_controller" class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController">
+        <!-- ART Mainline Module (internal version). -->
+        <option name="mainline-module-package-name" value="com.google.android.art" />
+        <!-- ART Mainline Module (external (AOSP) version). -->
+        <option name="mainline-module-package-name" value="com.android.art" />
+    </object>
+
     <!-- Only run tests if the device under test is SDK version 31 (Android 12) or above. -->
     <object type="module_controller" class="com.android.tradefed.testtype.suite.module.Sdk31ModuleController" />
 </configuration>
diff --git a/libnativeloader/test/src/android/test/app/DataAppTest.java b/libnativeloader/test/src/android/test/app/DataAppTest.java
index 4ba8afc..905b5bb 100644
--- a/libnativeloader/test/src/android/test/app/DataAppTest.java
+++ b/libnativeloader/test/src/android/test/app/DataAppTest.java
@@ -16,25 +16,30 @@
 
 package android.test.app;
 
+import android.test.lib.AppTestCommon;
 import android.test.lib.TestUtils;
 import android.test.productsharedlib.ProductSharedLib;
 import android.test.systemextsharedlib.SystemExtSharedLib;
 import android.test.systemsharedlib.SystemSharedLib;
 import android.test.vendorsharedlib.VendorSharedLib;
+
 import androidx.test.filters.MediumTest;
-import androidx.test.runner.AndroidJUnit4;
+
 import org.junit.Test;
-import org.junit.runner.RunWith;
 
 @MediumTest
-@RunWith(AndroidJUnit4.class)
-public class DataAppTest {
+public class DataAppTest extends AppTestCommon {
+    @Override
+    public AppLocation getAppLocation() {
+        return AppLocation.DATA;
+    }
+
     @Test
     public void testLoadExtendedPublicLibraries() {
         System.loadLibrary("system_extpub.oem1");
         System.loadLibrary("system_extpub.oem2");
         System.loadLibrary("system_extpub1.oem1");
-        TestUtils.assertLinkerNamespaceError( // Missing <uses-native-library>.
+        TestUtils.assertLibraryInaccessible( // Missing <uses-native-library>.
                 () -> System.loadLibrary("system_extpub_nouses.oem2"));
         if (!TestUtils.skipPublicProductLibTests()) {
             System.loadLibrary("product_extpub.product1");
@@ -44,12 +49,12 @@
 
     @Test
     public void testLoadPrivateLibraries() {
-        TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("system_private1"));
-        TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("systemext_private1"));
+        TestUtils.assertLibraryInaccessible(() -> System.loadLibrary("system_private1"));
+        TestUtils.assertLibraryInaccessible(() -> System.loadLibrary("systemext_private1"));
         if (!TestUtils.skipPublicProductLibTests()) {
-            TestUtils.assertLibraryNotFound(() -> System.loadLibrary("product_private1"));
+            TestUtils.assertLibraryInaccessible(() -> System.loadLibrary("product_private1"));
         }
-        TestUtils.assertLibraryNotFound(() -> System.loadLibrary("vendor_private1"));
+        TestUtils.assertLibraryInaccessible(() -> System.loadLibrary("vendor_private1"));
     }
 
     @Test
@@ -64,46 +69,60 @@
     public void testLoadPrivateLibrariesViaSystemSharedLib() {
         // TODO(b/237577392): Loading a private native system library via a shared system library
         // ought to work.
-        // SystemSharedLib.loadLibrary("system_private2");
-        // SystemSharedLib.loadLibrary("systemext_private2");
+        TestUtils.assertLibraryInaccessible(() -> SystemSharedLib.loadLibrary("system_private2"));
+        TestUtils.assertLibraryInaccessible(
+                () -> SystemSharedLib.loadLibrary("systemext_private2"));
+
         if (!TestUtils.skipPublicProductLibTests()) {
-            TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("product_private2"));
+            TestUtils.assertLibraryInaccessible(
+                    () -> SystemSharedLib.loadLibrary("product_private2"));
         }
-        TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("vendor_private2"));
+
+        TestUtils.assertLibraryInaccessible(() -> SystemSharedLib.loadLibrary("vendor_private2"));
     }
 
     @Test
     public void testLoadPrivateLibrariesViaSystemExtSharedLib() {
         // TODO(b/237577392): Loading a private native system library via a shared system library
         // ought to work.
-        // SystemExtSharedLib.loadLibrary("system_private3");
-        // SystemExtSharedLib.loadLibrary("systemext_private3");
+        TestUtils.assertLibraryInaccessible(
+                () -> SystemExtSharedLib.loadLibrary("system_private3"));
+        TestUtils.assertLibraryInaccessible(
+                () -> SystemExtSharedLib.loadLibrary("systemext_private3"));
+
         if (!TestUtils.skipPublicProductLibTests()) {
-            TestUtils.assertLibraryNotFound(
+            TestUtils.assertLibraryInaccessible(
                     () -> SystemExtSharedLib.loadLibrary("product_private3"));
         }
-        TestUtils.assertLibraryNotFound(() -> SystemExtSharedLib.loadLibrary("vendor_private3"));
+
+        TestUtils.assertLibraryInaccessible(
+                () -> SystemExtSharedLib.loadLibrary("vendor_private3"));
     }
 
     @Test
     public void testLoadPrivateLibrariesViaProductSharedLib() {
-        TestUtils.assertLinkerNamespaceError(() -> ProductSharedLib.loadLibrary("system_private4"));
-        TestUtils.assertLinkerNamespaceError(
+        TestUtils.assertLibraryInaccessible(() -> ProductSharedLib.loadLibrary("system_private4"));
+        TestUtils.assertLibraryInaccessible(
                 () -> ProductSharedLib.loadLibrary("systemext_private4"));
+
         if (!TestUtils.skipPublicProductLibTests()) {
             ProductSharedLib.loadLibrary("product_private4");
         }
-        TestUtils.assertLibraryNotFound(() -> ProductSharedLib.loadLibrary("vendor_private4"));
+
+        TestUtils.assertLibraryInaccessible(() -> ProductSharedLib.loadLibrary("vendor_private4"));
     }
 
     @Test
     public void testLoadPrivateLibrariesViaVendorSharedLib() {
-        TestUtils.assertLinkerNamespaceError(() -> VendorSharedLib.loadLibrary("system_private5"));
-        TestUtils.assertLinkerNamespaceError(
+        TestUtils.assertLibraryInaccessible(() -> VendorSharedLib.loadLibrary("system_private5"));
+        TestUtils.assertLibraryInaccessible(
                 () -> VendorSharedLib.loadLibrary("systemext_private5"));
+
         if (!TestUtils.skipPublicProductLibTests()) {
-            TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5"));
+            TestUtils.assertLibraryInaccessible(
+                    () -> VendorSharedLib.loadLibrary("product_private5"));
         }
+
         VendorSharedLib.loadLibrary("vendor_private5");
     }
 
@@ -117,15 +136,15 @@
 
     @Test
     public void testLoadPrivateLibrariesWithAbsolutePaths() {
-        TestUtils.assertLinkerNamespaceError(
+        TestUtils.assertLibraryInaccessible(
                 () -> System.load(TestUtils.libPath("/system", "system_private6")));
-        TestUtils.assertLinkerNamespaceError(
+        TestUtils.assertLibraryInaccessible(
                 () -> System.load(TestUtils.libPath("/system_ext", "systemext_private6")));
         if (!TestUtils.skipPublicProductLibTests()) {
-            TestUtils.assertLinkerNamespaceError(
+            TestUtils.assertLibraryInaccessible(
                     () -> System.load(TestUtils.libPath("/product", "product_private6")));
         }
-        TestUtils.assertLinkerNamespaceError(
+        TestUtils.assertLibraryInaccessible(
                 () -> System.load(TestUtils.libPath("/vendor", "vendor_private6")));
     }
 }
diff --git a/libnativeloader/test/src/android/test/app/ProductAppTest.java b/libnativeloader/test/src/android/test/app/ProductAppTest.java
index 82d8b6e..4cf379c 100644
--- a/libnativeloader/test/src/android/test/app/ProductAppTest.java
+++ b/libnativeloader/test/src/android/test/app/ProductAppTest.java
@@ -16,8 +16,7 @@
 
 package android.test.app;
 
-import android.os.Build;
-import android.os.SystemProperties;
+import android.test.lib.AppTestCommon;
 import android.test.lib.TestUtils;
 import android.test.productsharedlib.ProductSharedLib;
 import android.test.systemextsharedlib.SystemExtSharedLib;
@@ -25,19 +24,19 @@
 import android.test.vendorsharedlib.VendorSharedLib;
 
 import androidx.test.filters.MediumTest;
-import androidx.test.runner.AndroidJUnit4;
 
 import org.junit.Test;
-import org.junit.runner.RunWith;
 
 @MediumTest
-@RunWith(AndroidJUnit4.class)
-public class ProductAppTest {
-    // True if apps in product partitions get shared library namespaces, so we
-    // cannot test that libs in system and system_ext get blocked.
-    private static boolean productAppsAreShared() {
-        return Build.VERSION.SDK_INT <= 34 && // UPSIDE_DOWN_CAKE
-                SystemProperties.get("ro.product.vndk.version").isEmpty();
+public class ProductAppTest extends AppTestCommon {
+    @Override
+    public AppLocation getAppLocation() {
+        return AppLocation.PRODUCT;
+    }
+
+    @Test
+    public void testPrivateLibsExist() {
+        TestUtils.testPrivateLibsExist("/product", "product_private");
     }
 
     @Test
@@ -45,8 +44,8 @@
         System.loadLibrary("system_extpub.oem1");
         System.loadLibrary("system_extpub.oem2");
         System.loadLibrary("system_extpub1.oem1");
-        if (!productAppsAreShared()) {
-            TestUtils.assertLinkerNamespaceError( // Missing <uses-native-library>.
+        if (!TestUtils.productAppsAreShared()) {
+            TestUtils.assertLibraryInaccessible( // Missing <uses-native-library>.
                     () -> System.loadLibrary("system_extpub_nouses.oem2"));
         }
         System.loadLibrary("product_extpub.product1");
@@ -55,12 +54,12 @@
 
     @Test
     public void testLoadPrivateLibraries() {
-        if (!productAppsAreShared()) {
-            TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("system_private1"));
-            TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("systemext_private1"));
+        if (!TestUtils.productAppsAreShared()) {
+            TestUtils.assertLibraryInaccessible(() -> System.loadLibrary("system_private1"));
+            TestUtils.assertLibraryInaccessible(() -> System.loadLibrary("systemext_private1"));
         }
         System.loadLibrary("product_private1");
-        TestUtils.assertLibraryNotFound(() -> System.loadLibrary("vendor_private1"));
+        TestUtils.assertLibraryInaccessible(() -> System.loadLibrary("vendor_private1"));
     }
 
     @Test
@@ -73,49 +72,65 @@
 
     @Test
     public void testLoadPrivateLibrariesViaSystemSharedLib() {
-        // TODO(b/237577392): Loading a private native system library via a shared system library
-        // ought to work.
-        // SystemSharedLib.loadLibrary("system_private2");
-        // SystemSharedLib.loadLibrary("systemext_private2");
-        if (!productAppsAreShared()) {
-            TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("product_private2"));
+        if (!TestUtils.productAppsAreShared()) {
+            // TODO(b/237577392): Loading a private native system library via a shared system
+            // library ought to work.
+            TestUtils.assertLibraryInaccessible(
+                    () -> SystemSharedLib.loadLibrary("system_private2"));
+            TestUtils.assertLibraryInaccessible(
+                    () -> SystemSharedLib.loadLibrary("systemext_private2"));
+
+            TestUtils.assertLibraryInaccessible(
+                    () -> SystemSharedLib.loadLibrary("product_private2"));
         }
-        TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("vendor_private2"));
+
+        TestUtils.assertLibraryInaccessible(() -> SystemSharedLib.loadLibrary("vendor_private2"));
     }
 
     @Test
     public void testLoadPrivateLibrariesViaSystemExtSharedLib() {
-        // TODO(b/237577392): Loading a private native system library via a shared system library
-        // ought to work.
-        // SystemExtSharedLib.loadLibrary("system_private3");
-        // SystemExtSharedLib.loadLibrary("systemext_private3");
-        if (!productAppsAreShared()) {
-            TestUtils.assertLibraryNotFound(
+        if (!TestUtils.productAppsAreShared()) {
+            // TODO(b/237577392): Loading a private native system library via a shared system
+            // library ought to work.
+            TestUtils.assertLibraryInaccessible(
+                    () -> SystemExtSharedLib.loadLibrary("system_private3"));
+            TestUtils.assertLibraryInaccessible(
+                    () -> SystemExtSharedLib.loadLibrary("systemext_private3"));
+
+            TestUtils.assertLibraryInaccessible(
                     () -> SystemExtSharedLib.loadLibrary("product_private3"));
         }
-        TestUtils.assertLibraryNotFound(() -> SystemExtSharedLib.loadLibrary("vendor_private3"));
+
+        TestUtils.assertLibraryInaccessible(
+                () -> SystemExtSharedLib.loadLibrary("vendor_private3"));
     }
 
     @Test
     public void testLoadPrivateLibrariesViaProductSharedLib() {
-        if (!productAppsAreShared()) {
-            TestUtils.assertLinkerNamespaceError(
+        if (!TestUtils.productAppsAreShared()) {
+            TestUtils.assertLibraryInaccessible(
                     () -> ProductSharedLib.loadLibrary("system_private4"));
-            TestUtils.assertLinkerNamespaceError(
+            TestUtils.assertLibraryInaccessible(
                     () -> ProductSharedLib.loadLibrary("systemext_private4"));
         }
+
+        // Can load product_private4 by name only through the app classloader namespace.
         ProductSharedLib.loadLibrary("product_private4");
-        TestUtils.assertLibraryNotFound(() -> ProductSharedLib.loadLibrary("vendor_private4"));
+
+        TestUtils.assertLibraryInaccessible(() -> ProductSharedLib.loadLibrary("vendor_private4"));
     }
 
     @Test
     public void testLoadPrivateLibrariesViaVendorSharedLib() {
-        if (!productAppsAreShared()) {
-            TestUtils.assertLinkerNamespaceError(
+        if (!TestUtils.productAppsAreShared()) {
+            TestUtils.assertLibraryInaccessible(
                     () -> VendorSharedLib.loadLibrary("system_private5"));
-            TestUtils.assertLinkerNamespaceError(
+            TestUtils.assertLibraryInaccessible(
                     () -> VendorSharedLib.loadLibrary("systemext_private5"));
-            TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5"));
+
+            TestUtils.assertLibraryInaccessible(
+                    () -> VendorSharedLib.loadLibrary("product_private5"));
+
             // When the app has a shared namespace, its libraries get loaded
             // with shared namespaces as well, inheriting the same paths. So
             // since the app wouldn't have access to /vendor/${LIB},
@@ -132,14 +147,14 @@
 
     @Test
     public void testLoadPrivateLibrariesWithAbsolutePaths() {
-        if (!productAppsAreShared()) {
-            TestUtils.assertLinkerNamespaceError(
+        if (!TestUtils.productAppsAreShared()) {
+            TestUtils.assertLibraryInaccessible(
                     () -> System.load(TestUtils.libPath("/system", "system_private6")));
-            TestUtils.assertLinkerNamespaceError(
+            TestUtils.assertLibraryInaccessible(
                     () -> System.load(TestUtils.libPath("/system_ext", "systemext_private6")));
         }
         System.load(TestUtils.libPath("/product", "product_private6"));
-        TestUtils.assertLinkerNamespaceError(
+        TestUtils.assertLibraryInaccessible(
                 () -> System.load(TestUtils.libPath("/vendor", "vendor_private6")));
     }
 }
diff --git a/libnativeloader/test/src/android/test/app/SystemAppTest.java b/libnativeloader/test/src/android/test/app/SystemAppTest.java
index a909a4c..8d14753 100644
--- a/libnativeloader/test/src/android/test/app/SystemAppTest.java
+++ b/libnativeloader/test/src/android/test/app/SystemAppTest.java
@@ -16,20 +16,31 @@
 
 package android.test.app;
 
+import android.test.lib.AppTestCommon;
 import android.test.lib.TestUtils;
 import android.test.productsharedlib.ProductSharedLib;
 import android.test.systemextsharedlib.SystemExtSharedLib;
 import android.test.systemsharedlib.SystemSharedLib;
 import android.test.vendorsharedlib.VendorSharedLib;
+
 import androidx.test.filters.MediumTest;
-import androidx.test.runner.AndroidJUnit4;
+
 import org.junit.Test;
-import org.junit.runner.RunWith;
 
 // These tests are run from /system/app, /system/priv-app, and /system_ext/app.
 @MediumTest
-@RunWith(AndroidJUnit4.class)
-public class SystemAppTest {
+public class SystemAppTest extends AppTestCommon {
+    @Override
+    public AppLocation getAppLocation() {
+        return AppLocation.SYSTEM;
+    }
+
+    @Test
+    public void testPrivateLibsExist() {
+        TestUtils.testPrivateLibsExist("/system", "system_private");
+        TestUtils.testPrivateLibsExist("/system_ext", "systemext_private");
+    }
+
     @Test
     public void testLoadExtendedPublicLibraries() {
         System.loadLibrary("system_extpub.oem1");
@@ -49,9 +60,9 @@
         System.loadLibrary("system_private1");
         System.loadLibrary("systemext_private1");
         if (!TestUtils.skipPublicProductLibTests()) {
-            TestUtils.assertLibraryNotFound(() -> System.loadLibrary("product_private1"));
+            TestUtils.assertLibraryInaccessible(() -> System.loadLibrary("product_private1"));
         }
-        TestUtils.assertLibraryNotFound(() -> System.loadLibrary("vendor_private1"));
+        TestUtils.assertLibraryInaccessible(() -> System.loadLibrary("vendor_private1"));
     }
 
     @Test
@@ -66,41 +77,57 @@
     public void testLoadPrivateLibrariesViaSystemSharedLib() {
         SystemSharedLib.loadLibrary("system_private2");
         SystemSharedLib.loadLibrary("systemext_private2");
+
         if (!TestUtils.skipPublicProductLibTests()) {
-            TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("product_private2"));
+            TestUtils.assertLibraryInaccessible(
+                    () -> SystemSharedLib.loadLibrary("product_private2"));
         }
-        TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("vendor_private2"));
+
+        TestUtils.assertLibraryInaccessible(() -> SystemSharedLib.loadLibrary("vendor_private2"));
     }
 
     @Test
     public void testLoadPrivateLibrariesViaSystemExtSharedLib() {
         SystemExtSharedLib.loadLibrary("system_private3");
         SystemExtSharedLib.loadLibrary("systemext_private3");
+
         if (!TestUtils.skipPublicProductLibTests()) {
-            TestUtils.assertLibraryNotFound(
+            TestUtils.assertLibraryInaccessible(
                     () -> SystemExtSharedLib.loadLibrary("product_private3"));
         }
-        TestUtils.assertLibraryNotFound(() -> SystemExtSharedLib.loadLibrary("vendor_private3"));
+
+        TestUtils.assertLibraryInaccessible(
+                () -> SystemExtSharedLib.loadLibrary("vendor_private3"));
     }
 
     @Test
     public void testLoadPrivateLibrariesViaProductSharedLib() {
+        // See AppTestCommon.isSharedSystemApp() for an explanation of these
+        // behaviours.
         ProductSharedLib.loadLibrary("system_private4");
         ProductSharedLib.loadLibrary("systemext_private4");
+
         if (!TestUtils.skipPublicProductLibTests()) {
-            TestUtils.assertLibraryNotFound(() -> ProductSharedLib.loadLibrary("product_private4"));
+            TestUtils.assertLibraryInaccessible(
+                    () -> ProductSharedLib.loadLibrary("product_private4"));
         }
-        TestUtils.assertLibraryNotFound(() -> ProductSharedLib.loadLibrary("vendor_private4"));
+
+        TestUtils.assertLibraryInaccessible(() -> ProductSharedLib.loadLibrary("vendor_private4"));
     }
 
     @Test
     public void testLoadPrivateLibrariesViaVendorSharedLib() {
+        // See AppTestCommon.isSharedSystemApp() for an explanation of these
+        // behaviours.
         VendorSharedLib.loadLibrary("system_private5");
         VendorSharedLib.loadLibrary("systemext_private5");
+
         if (!TestUtils.skipPublicProductLibTests()) {
-            TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5"));
+            TestUtils.assertLibraryInaccessible(
+                    () -> VendorSharedLib.loadLibrary("product_private5"));
         }
-        TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("vendor_private5"));
+
+        TestUtils.assertLibraryInaccessible(() -> VendorSharedLib.loadLibrary("vendor_private5"));
     }
 
     @Test
@@ -116,10 +143,10 @@
         System.load(TestUtils.libPath("/system", "system_private6"));
         System.load(TestUtils.libPath("/system_ext", "systemext_private6"));
         if (!TestUtils.skipPublicProductLibTests()) {
-            TestUtils.assertLinkerNamespaceError(
+            TestUtils.assertLibraryInaccessible(
                     () -> System.load(TestUtils.libPath("/product", "product_private6")));
         }
-        TestUtils.assertLinkerNamespaceError(
+        TestUtils.assertLibraryInaccessible(
                 () -> System.load(TestUtils.libPath("/vendor", "vendor_private6")));
     }
 }
diff --git a/libnativeloader/test/src/android/test/app/VendorAppTest.java b/libnativeloader/test/src/android/test/app/VendorAppTest.java
index 52688bb..377f670 100644
--- a/libnativeloader/test/src/android/test/app/VendorAppTest.java
+++ b/libnativeloader/test/src/android/test/app/VendorAppTest.java
@@ -16,25 +16,35 @@
 
 package android.test.app;
 
+import android.test.lib.AppTestCommon;
 import android.test.lib.TestUtils;
 import android.test.productsharedlib.ProductSharedLib;
 import android.test.systemextsharedlib.SystemExtSharedLib;
 import android.test.systemsharedlib.SystemSharedLib;
 import android.test.vendorsharedlib.VendorSharedLib;
+
 import androidx.test.filters.MediumTest;
-import androidx.test.runner.AndroidJUnit4;
+
 import org.junit.Test;
-import org.junit.runner.RunWith;
 
 @MediumTest
-@RunWith(AndroidJUnit4.class)
-public class VendorAppTest {
+public class VendorAppTest extends AppTestCommon {
+    @Override
+    public AppLocation getAppLocation() {
+        return AppLocation.VENDOR;
+    }
+
+    @Test
+    public void testPrivateLibsExist() {
+        TestUtils.testPrivateLibsExist("/vendor", "vendor_private");
+    }
+
     @Test
     public void testLoadExtendedPublicLibraries() {
-        TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("system_extpub.oem1"));
-        TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("system_extpub.oem2"));
-        TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("system_extpub1.oem1"));
-        TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("system_extpub_nouses.oem2"));
+        TestUtils.assertLibraryInaccessible(() -> System.loadLibrary("system_extpub.oem1"));
+        TestUtils.assertLibraryInaccessible(() -> System.loadLibrary("system_extpub.oem2"));
+        TestUtils.assertLibraryInaccessible(() -> System.loadLibrary("system_extpub1.oem1"));
+        TestUtils.assertLibraryInaccessible(() -> System.loadLibrary("system_extpub_nouses.oem2"));
         if (!TestUtils.skipPublicProductLibTests()) {
             System.loadLibrary("product_extpub.product1");
             System.loadLibrary("product_extpub1.product1");
@@ -43,10 +53,10 @@
 
     @Test
     public void testLoadPrivateLibraries() {
-        TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("system_private1"));
-        TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("systemext_private1"));
+        TestUtils.assertLibraryInaccessible(() -> System.loadLibrary("system_private1"));
+        TestUtils.assertLibraryInaccessible(() -> System.loadLibrary("systemext_private1"));
         if (!TestUtils.skipPublicProductLibTests()) {
-            TestUtils.assertLibraryNotFound(() -> System.loadLibrary("product_private1"));
+            TestUtils.assertLibraryInaccessible(() -> System.loadLibrary("product_private1"));
         }
         System.loadLibrary("vendor_private1");
     }
@@ -63,52 +73,67 @@
     public void testLoadPrivateLibrariesViaSystemSharedLib() {
         // TODO(b/237577392): Loading a private native system library via a shared system library
         // ought to work.
-        // SystemSharedLib.loadLibrary("system_private2");
-        // SystemSharedLib.loadLibrary("systemext_private2");
+        TestUtils.assertLibraryInaccessible(() -> SystemSharedLib.loadLibrary("system_private2"));
+        TestUtils.assertLibraryInaccessible(
+                () -> SystemSharedLib.loadLibrary("systemext_private2"));
+
         if (!TestUtils.skipPublicProductLibTests()) {
-            TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("product_private2"));
+            TestUtils.assertLibraryInaccessible(
+                    () -> SystemSharedLib.loadLibrary("product_private2"));
         }
-        TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("vendor_private2"));
+
+        TestUtils.assertLibraryInaccessible(() -> SystemSharedLib.loadLibrary("vendor_private2"));
     }
 
     @Test
     public void testLoadPrivateLibrariesViaSystemExtSharedLib() {
         // TODO(b/237577392): Loading a private native system library via a shared system library
         // ought to work.
-        // SystemExtSharedLib.loadLibrary("system_private3");
-        // SystemExtSharedLib.loadLibrary("systemext_private3");
+        TestUtils.assertLibraryInaccessible(
+                () -> SystemExtSharedLib.loadLibrary("system_private3"));
+        TestUtils.assertLibraryInaccessible(
+                () -> SystemExtSharedLib.loadLibrary("systemext_private3"));
+
         if (!TestUtils.skipPublicProductLibTests()) {
-            TestUtils.assertLibraryNotFound(
+            TestUtils.assertLibraryInaccessible(
                     () -> SystemExtSharedLib.loadLibrary("product_private3"));
         }
-        TestUtils.assertLibraryNotFound(() -> SystemExtSharedLib.loadLibrary("vendor_private3"));
+
+        TestUtils.assertLibraryInaccessible(
+                () -> SystemExtSharedLib.loadLibrary("vendor_private3"));
     }
 
     @Test
     public void testLoadPrivateLibrariesViaProductSharedLib() {
-        TestUtils.assertLinkerNamespaceError(() -> ProductSharedLib.loadLibrary("system_private4"));
-        TestUtils.assertLinkerNamespaceError(
+        TestUtils.assertLibraryInaccessible(() -> ProductSharedLib.loadLibrary("system_private4"));
+        TestUtils.assertLibraryInaccessible(
                 () -> ProductSharedLib.loadLibrary("systemext_private4"));
+
         if (!TestUtils.skipPublicProductLibTests()) {
             ProductSharedLib.loadLibrary("product_private4");
         }
-        TestUtils.assertLibraryNotFound(() -> ProductSharedLib.loadLibrary("vendor_private4"));
+
+        TestUtils.assertLibraryInaccessible(() -> ProductSharedLib.loadLibrary("vendor_private4"));
     }
 
     @Test
     public void testLoadPrivateLibrariesViaVendorSharedLib() {
-        TestUtils.assertLinkerNamespaceError(() -> VendorSharedLib.loadLibrary("system_private5"));
-        TestUtils.assertLinkerNamespaceError(
+        TestUtils.assertLibraryInaccessible(() -> VendorSharedLib.loadLibrary("system_private5"));
+        TestUtils.assertLibraryInaccessible(
                 () -> VendorSharedLib.loadLibrary("systemext_private5"));
+
         if (!TestUtils.skipPublicProductLibTests()) {
-            TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5"));
+            TestUtils.assertLibraryInaccessible(
+                    () -> VendorSharedLib.loadLibrary("product_private5"));
         }
+
+        // Can load vendor_private5 by name only through the app classloader namespace.
         VendorSharedLib.loadLibrary("vendor_private5");
     }
 
     @Test
     public void testLoadExtendedPublicLibrariesWithAbsolutePaths() {
-        TestUtils.assertLinkerNamespaceError(
+        TestUtils.assertLibraryInaccessible(
                 () -> System.load(TestUtils.libPath("/system", "system_extpub3.oem1")));
         if (!TestUtils.skipPublicProductLibTests()) {
             System.load(TestUtils.libPath("/product", "product_extpub3.product1"));
@@ -117,12 +142,12 @@
 
     @Test
     public void testLoadPrivateLibrariesWithAbsolutePaths() {
-        TestUtils.assertLinkerNamespaceError(
+        TestUtils.assertLibraryInaccessible(
                 () -> System.load(TestUtils.libPath("/system", "system_private6")));
-        TestUtils.assertLinkerNamespaceError(
+        TestUtils.assertLibraryInaccessible(
                 () -> System.load(TestUtils.libPath("/system_ext", "systemext_private6")));
         if (!TestUtils.skipPublicProductLibTests()) {
-            TestUtils.assertLinkerNamespaceError(
+            TestUtils.assertLibraryInaccessible(
                     () -> System.load(TestUtils.libPath("/product", "product_private6")));
         }
         System.load(TestUtils.libPath("/vendor", "vendor_private6"));
diff --git a/libnativeloader/test/src/android/test/hostside/LibnativeloaderTest.java b/libnativeloader/test/src/android/test/hostside/LibnativeloaderTest.java
index 55a6dd2..bcb4528 100644
--- a/libnativeloader/test/src/android/test/hostside/LibnativeloaderTest.java
+++ b/libnativeloader/test/src/android/test/hostside/LibnativeloaderTest.java
@@ -278,7 +278,10 @@
         void pushPrivateLibs(ZipFile libApk) throws Exception {
             // Push the libraries once for each test. Since we cannot unload them, we need a fresh
             // never-before-loaded library in each loadLibrary call.
-            for (int i = 1; i <= 6; ++i) {
+            //
+            // Remember to update testPrivateLibsExist in TestUtils.java when
+            // the number of libraries changes.
+            for (int i = 1; i <= 10; ++i) {
                 pushNativeTestLib(libApk, "libsystem_testlib.so",
                         "/system/${LIB}/libsystem_private" + i + ".so");
                 pushNativeTestLib(libApk, "libsystem_testlib.so",
diff --git a/libnativeloader/test/src/android/test/lib/AppTestCommon.java b/libnativeloader/test/src/android/test/lib/AppTestCommon.java
new file mode 100644
index 0000000..51f4655
--- /dev/null
+++ b/libnativeloader/test/src/android/test/lib/AppTestCommon.java
@@ -0,0 +1,192 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.test.lib;
+
+import android.test.productsharedlib.ProductSharedLib;
+import android.test.systemextsharedlib.SystemExtSharedLib;
+import android.test.systemsharedlib.SystemSharedLib;
+import android.test.vendorsharedlib.VendorSharedLib;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+public abstract class AppTestCommon {
+    public enum AppLocation { DATA, SYSTEM, PRODUCT, VENDOR }
+
+    public abstract AppLocation getAppLocation();
+
+    // Loading private libs using absolute paths through shared libs should
+    // normally only depend on the location of the shared lib, so these tests
+    // are shared for all apps, regardless of location.
+
+    // Returns true when system private native libs are accessible directly from
+    // the app classloader namespace.
+    private boolean systemPrivateLibsAccessibleFromAppNamespace() {
+        // Currently it only works from system apps. It also works from product
+        // apps on old versions where they were treated like system apps.
+        // TODO(b/237577392): Fix this to work from system shared libs.
+        return getAppLocation() == AppLocation.SYSTEM
+                || (getAppLocation() == AppLocation.PRODUCT && TestUtils.productAppsAreShared());
+    }
+
+    // Detect exception when product private libs are accessible directly from
+    // the app classloader namespace even when they shouldn't be.
+    private boolean productPrivateLibsAccessibleFromAppNamespace() {
+        // In old versions where product apps were treated like system apps, the
+        // product private libs were included in the system namespace, so
+        // they're accessible both from system and product apps.
+        // TODO(b/237577392): Fix this to work from product shared libs.
+        return (getAppLocation() == AppLocation.SYSTEM || getAppLocation() == AppLocation.PRODUCT)
+                && TestUtils.productAppsAreShared();
+    }
+
+    // Detect exception where we don't switch from a shared system namespace to
+    // a product or vendor "unbundled" namespace when calling into
+    // ProductSharedLib and VendorSharedLib. That means they still can load
+    // private system libs but not private libs in their own partition.
+    // TODO(mast): Stop propagating the shared property (isBundledApp in
+    // LoadedApk.java) down to public and vendor shared java libs?
+    private boolean noSwitchToVendorOrProductNamespace() {
+        // System apps get shared namespaces, and also product apps on old
+        // versions where they were treated like system apps.
+        return getAppLocation() == AppLocation.SYSTEM
+                || (getAppLocation() == AppLocation.PRODUCT && TestUtils.productAppsAreShared());
+    }
+
+    @Test
+    public void testLoadPrivateLibrariesViaSystemSharedLibWithAbsolutePaths() {
+        if (systemPrivateLibsAccessibleFromAppNamespace()) {
+            SystemSharedLib.load(TestUtils.libPath("/system", "system_private7"));
+            SystemSharedLib.load(TestUtils.libPath("/system_ext", "systemext_private7"));
+        } else {
+            TestUtils.assertLibraryInaccessible(() -> {
+                SystemSharedLib.load(TestUtils.libPath("/system", "system_private7"));
+            });
+            TestUtils.assertLibraryInaccessible(() -> {
+                SystemSharedLib.load(TestUtils.libPath("/system_ext", "systemext_private7"));
+            });
+        }
+
+        if (productPrivateLibsAccessibleFromAppNamespace()) {
+            SystemSharedLib.load(TestUtils.libPath("/product", "product_private7"));
+        } else {
+            TestUtils.assertLibraryInaccessible(() -> {
+                SystemSharedLib.load(TestUtils.libPath("/product", "product_private7"));
+            });
+        }
+
+        TestUtils.assertLibraryInaccessible(
+                () -> { SystemSharedLib.load(TestUtils.libPath("/vendor", "vendor_private7")); });
+    }
+
+    @Test
+    public void testLoadPrivateLibrariesViaSystemExtSharedLibWithAbsolutePaths() {
+        if (systemPrivateLibsAccessibleFromAppNamespace()) {
+            SystemExtSharedLib.load(TestUtils.libPath("/system", "system_private8"));
+            SystemExtSharedLib.load(TestUtils.libPath("/system_ext", "systemext_private8"));
+        } else {
+            TestUtils.assertLibraryInaccessible(() -> {
+                SystemExtSharedLib.load(TestUtils.libPath("/system", "system_private8"));
+            });
+            TestUtils.assertLibraryInaccessible(() -> {
+                SystemExtSharedLib.load(TestUtils.libPath("/system_ext", "systemext_private8"));
+            });
+        }
+
+        if (productPrivateLibsAccessibleFromAppNamespace()) {
+            SystemExtSharedLib.load(TestUtils.libPath("/product", "product_private8"));
+        } else {
+            TestUtils.assertLibraryInaccessible(() -> {
+                SystemExtSharedLib.load(TestUtils.libPath("/product", "product_private8"));
+            });
+        }
+
+        TestUtils.assertLibraryInaccessible(() -> {
+            SystemExtSharedLib.load(TestUtils.libPath("/vendor", "vendor_private8"));
+        });
+    }
+
+    @Test
+    public void testLoadPrivateLibrariesViaProductSharedLibWithAbsolutePaths() {
+        if (systemPrivateLibsAccessibleFromAppNamespace() || noSwitchToVendorOrProductNamespace()) {
+            ProductSharedLib.load(TestUtils.libPath("/system", "system_private9"));
+            ProductSharedLib.load(TestUtils.libPath("/system_ext", "systemext_private9"));
+        } else {
+            TestUtils.assertLibraryInaccessible(() -> {
+                ProductSharedLib.load(TestUtils.libPath("/system", "system_private9"));
+            });
+            TestUtils.assertLibraryInaccessible(() -> {
+                ProductSharedLib.load(TestUtils.libPath("/system_ext", "systemext_private9"));
+            });
+        }
+
+        boolean loadPrivateProductLib;
+        if (TestUtils.productAppsAreShared()) {
+            // The library is accessible if the app is in either system or
+            // product, because both are loaded as system apps and private product
+            // libs are available for both.
+            loadPrivateProductLib = getAppLocation() == AppLocation.SYSTEM
+                    || getAppLocation() == AppLocation.PRODUCT;
+        } else {
+            loadPrivateProductLib = !noSwitchToVendorOrProductNamespace();
+        }
+        if (loadPrivateProductLib) {
+            ProductSharedLib.load(TestUtils.libPath("/product", "product_private9"));
+        } else {
+            TestUtils.assertLibraryInaccessible(() -> {
+                ProductSharedLib.load(TestUtils.libPath("/product", "product_private9"));
+            });
+        }
+
+        TestUtils.assertLibraryInaccessible(
+                () -> { ProductSharedLib.load(TestUtils.libPath("/vendor", "vendor_private9")); });
+    }
+
+    @Test
+    public void testLoadPrivateLibrariesViaVendorSharedLibWithAbsolutePaths() {
+        if (systemPrivateLibsAccessibleFromAppNamespace() || noSwitchToVendorOrProductNamespace()) {
+            VendorSharedLib.load(TestUtils.libPath("/system", "system_private10"));
+            VendorSharedLib.load(TestUtils.libPath("/system_ext", "systemext_private10"));
+        } else {
+            TestUtils.assertLibraryInaccessible(() -> {
+                VendorSharedLib.load(TestUtils.libPath("/system", "system_private10"));
+            });
+            TestUtils.assertLibraryInaccessible(() -> {
+                VendorSharedLib.load(TestUtils.libPath("/system_ext", "systemext_private10"));
+            });
+        }
+
+        if (productPrivateLibsAccessibleFromAppNamespace()) {
+            VendorSharedLib.load(TestUtils.libPath("/product", "product_private10"));
+        } else {
+            TestUtils.assertLibraryInaccessible(() -> {
+                VendorSharedLib.load(TestUtils.libPath("/product", "product_private10"));
+            });
+        }
+
+        if (!noSwitchToVendorOrProductNamespace()) {
+            VendorSharedLib.load(TestUtils.libPath("/vendor", "vendor_private10"));
+        } else {
+            TestUtils.assertLibraryInaccessible(() -> {
+                VendorSharedLib.load(TestUtils.libPath("/vendor", "vendor_private10"));
+            });
+        }
+    }
+}
diff --git a/libnativeloader/test/src/android/test/lib/TestUtils.java b/libnativeloader/test/src/android/test/lib/TestUtils.java
index ca64bad..5f5cd91 100644
--- a/libnativeloader/test/src/android/test/lib/TestUtils.java
+++ b/libnativeloader/test/src/android/test/lib/TestUtils.java
@@ -17,25 +17,25 @@
 package android.test.lib;
 
 import static com.google.common.truth.Truth.assertThat;
+import static com.google.common.truth.Truth.assertWithMessage;
 
 import static org.junit.Assert.assertThrows;
 
-import android.os.Build;
+import android.os.SystemProperties;
 
 import androidx.test.platform.app.InstrumentationRegistry;
 
+import com.android.modules.utils.build.SdkLevel;
+
 import org.junit.function.ThrowingRunnable;
 
-public final class TestUtils {
-    public static void assertLibraryNotFound(ThrowingRunnable loadLibrary) {
-        Throwable t = assertThrows(UnsatisfiedLinkError.class, loadLibrary);
-        assertThat(t.getMessage()).containsMatch("dlopen failed: library .* not found");
-    }
+import java.io.File;
 
-    public static void assertLinkerNamespaceError(ThrowingRunnable loadLibrary) {
+public final class TestUtils {
+    public static void assertLibraryInaccessible(ThrowingRunnable loadLibrary) {
         Throwable t = assertThrows(UnsatisfiedLinkError.class, loadLibrary);
         assertThat(t.getMessage())
-                .containsMatch("dlopen failed: .* is not accessible for the namespace");
+                .containsMatch("dlopen failed: .* (not found|not accessible for the namespace)");
     }
 
     public static String libPath(String dir, String libName) {
@@ -46,6 +46,25 @@
     // True if we have to skip testing public libraries in the product
     // partition, which got supported in T.
     public static boolean skipPublicProductLibTests() {
-        return Build.VERSION.SDK_INT < 33; // TIRAMISU
+        return !SdkLevel.isAtLeastT();
+    }
+
+    // True if apps in product partitions get shared library namespaces, so we
+    // cannot test that libs in system and system_ext get blocked.
+    public static boolean productAppsAreShared() {
+        return !SdkLevel.isAtLeastU() && SystemProperties.get("ro.product.vndk.version").isEmpty();
+    }
+
+    // Test that private libs are present, as a safeguard so that the dlopen
+    // failures we expect in other tests aren't due to them not being there.
+    public static void testPrivateLibsExist(String libDir, String libStem) {
+        // Remember to update pushPrivateLibs in LibnativeloaderTest.java when
+        // the number of libraries changes.
+        for (int i = 1; i <= 10; ++i) {
+            String libPath = libPath(libDir, libStem + i);
+            assertWithMessage(libPath + " does not exist")
+                    .that(new File(libPath).exists())
+                    .isTrue();
+        }
     }
 }
diff --git a/libnativeloader/test/src/android/test/productsharedlib/ProductSharedLib.java b/libnativeloader/test/src/android/test/productsharedlib/ProductSharedLib.java
index a500d2a..a8966d9 100644
--- a/libnativeloader/test/src/android/test/productsharedlib/ProductSharedLib.java
+++ b/libnativeloader/test/src/android/test/productsharedlib/ProductSharedLib.java
@@ -17,5 +17,11 @@
 package android.test.productsharedlib;
 
 public final class ProductSharedLib {
-    public static void loadLibrary(String name) { System.loadLibrary(name); }
+    public static void loadLibrary(String name) {
+        System.loadLibrary(name);
+    }
+
+    public static void load(String path) {
+        System.load(path);
+    }
 }
diff --git a/libnativeloader/test/src/android/test/systemextsharedlib/SystemExtSharedLib.java b/libnativeloader/test/src/android/test/systemextsharedlib/SystemExtSharedLib.java
index 1240e12..ae9a6da 100644
--- a/libnativeloader/test/src/android/test/systemextsharedlib/SystemExtSharedLib.java
+++ b/libnativeloader/test/src/android/test/systemextsharedlib/SystemExtSharedLib.java
@@ -17,5 +17,11 @@
 package android.test.systemextsharedlib;
 
 public final class SystemExtSharedLib {
-    public static void loadLibrary(String name) { System.loadLibrary(name); }
+    public static void loadLibrary(String name) {
+        System.loadLibrary(name);
+    }
+
+    public static void load(String path) {
+        System.load(path);
+    }
 }
diff --git a/libnativeloader/test/src/android/test/systemsharedlib/SystemSharedLib.java b/libnativeloader/test/src/android/test/systemsharedlib/SystemSharedLib.java
index 8e2af9f..ba8c9e2 100644
--- a/libnativeloader/test/src/android/test/systemsharedlib/SystemSharedLib.java
+++ b/libnativeloader/test/src/android/test/systemsharedlib/SystemSharedLib.java
@@ -17,5 +17,11 @@
 package android.test.systemsharedlib;
 
 public final class SystemSharedLib {
-    public static void loadLibrary(String name) { System.loadLibrary(name); }
+    public static void loadLibrary(String name) {
+        System.loadLibrary(name);
+    }
+
+    public static void load(String path) {
+        System.load(path);
+    }
 }
diff --git a/libnativeloader/test/src/android/test/vendorsharedlib/VendorSharedLib.java b/libnativeloader/test/src/android/test/vendorsharedlib/VendorSharedLib.java
index 8859b63..14223d8 100644
--- a/libnativeloader/test/src/android/test/vendorsharedlib/VendorSharedLib.java
+++ b/libnativeloader/test/src/android/test/vendorsharedlib/VendorSharedLib.java
@@ -17,5 +17,11 @@
 package android.test.vendorsharedlib;
 
 public final class VendorSharedLib {
-    public static void loadLibrary(String name) { System.loadLibrary(name); }
+    public static void loadLibrary(String name) {
+        System.loadLibrary(name);
+    }
+
+    public static void load(String path) {
+        System.load(path);
+    }
 }
diff --git a/libprofile/Android.bp b/libprofile/Android.bp
index beae8a9..c7e3cb8 100644
--- a/libprofile/Android.bp
+++ b/libprofile/Android.bp
@@ -188,12 +188,6 @@
         "profile/profile_boot_info_test.cc",
         "profile/profile_compilation_info_test.cc",
     ],
-    static_libs: [
-        "libziparchive",
-    ],
-    shared_libs: [
-        "libz", // libziparchive dependency; must be repeated here since it's a static lib.
-    ],
 }
 
 // Version of ART gtest `art_libprofile_tests` bundled with the ART APEX on target.
@@ -204,10 +198,6 @@
         "art_gtest_defaults",
         "art_libprofile_tests_defaults",
     ],
-    shared_libs: [
-        "libartbased",
-        "libdexfiled",
-    ],
 }
 
 // Standalone version of ART gtest `art_libprofile_tests`, not bundled with the ART APEX on target.
@@ -217,9 +207,5 @@
         "art_standalone_gtest_defaults",
         "art_libprofile_tests_defaults",
     ],
-    shared_libs: [
-        "libartbase",
-        "libdexfile",
-    ],
     test_config: "art_standalone_libprofile_tests.xml",
 }
diff --git a/libprofile/art_standalone_libprofile_tests.xml b/libprofile/art_standalone_libprofile_tests.xml
index 65264f4..8a4cf8d 100644
--- a/libprofile/art_standalone_libprofile_tests.xml
+++ b/libprofile/art_standalone_libprofile_tests.xml
@@ -15,6 +15,7 @@
 -->
 <configuration description="Runs art_standalone_libprofile_tests.">
     <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
 
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
         <option name="cleanup" value="true" />
@@ -32,8 +33,6 @@
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp/art_standalone_libprofile_tests" />
         <option name="module-name" value="art_standalone_libprofile_tests" />
-        <option name="ld-library-path-32" value="/apex/com.android.art/lib" />
-        <option name="ld-library-path-64" value="/apex/com.android.art/lib64" />
     </test>
 
     <!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
diff --git a/libprofile/profile/profile_compilation_info.cc b/libprofile/profile/profile_compilation_info.cc
index 1dc63a0..0c0f6d9 100644
--- a/libprofile/profile/profile_compilation_info.cc
+++ b/libprofile/profile/profile_compilation_info.cc
@@ -2547,8 +2547,7 @@
 }
 
 bool ProfileCompilationInfo::ProfileFilterFnAcceptAll(
-    const std::string& dex_location ATTRIBUTE_UNUSED,
-    uint32_t checksum ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] const std::string& dex_location, [[maybe_unused]] uint32_t checksum) {
   return true;
 }
 
diff --git a/libprofile/profile/profile_test_helper.h b/libprofile/profile/profile_test_helper.h
index 9410620..1140ee7 100644
--- a/libprofile/profile/profile_test_helper.h
+++ b/libprofile/profile/profile_test_helper.h
@@ -174,7 +174,7 @@
       size_t method_name_index = (method_index / num_shared_ids) / num_shared_ids;
       std::string return_type = "LSharedType" + std::to_string(return_type_index) + ";";
       std::string arg_type = "LSharedType" + std::to_string(arg_type_index) + ";";
-      std::string signature = "(" + arg_type + ")" + return_type;
+      std::string signature = ART_FORMAT("({}){}", arg_type, return_type);
       builder.AddMethod(class_descriptor, signature, "m" + std::to_string(method_name_index));
     }
     storage.push_back(builder.Build(location, location_checksum));
diff --git a/oatdump/Android.bp b/oatdump/Android.bp
index dacd647..9c749a6 100644
--- a/oatdump/Android.bp
+++ b/oatdump/Android.bp
@@ -40,7 +40,6 @@
     device_supported: false,
     host_supported: true,
     defaults: [
-        "libart-compiler_static_defaults",
         "libart-dexlayout_static_defaults",
         "libart-disassembler_static_defaults",
         "libart_static_defaults",
@@ -62,7 +61,6 @@
         android: {
             shared_libs: [
                 "libart",
-                "libart-compiler",
                 "libart-dexlayout",
                 "libart-disassembler",
                 "libartbase",
@@ -95,7 +93,6 @@
     device_supported: false,
     host_supported: true,
     defaults: [
-        "libartd-compiler_static_defaults",
         "libartd-dexlayout_static_defaults",
         "libartd-disassembler_static_defaults",
         "libartd_static_defaults",
@@ -121,7 +118,6 @@
             shared_libs: [
                 "libartbased",
                 "libartd",
-                "libartd-compiler",
                 "libartd-dexlayout",
                 "libartd-disassembler",
                 "libbase",
@@ -174,7 +170,6 @@
         "libartbase_static_defaults",
         "libdexfile_static_defaults",
         "libprofile_static_defaults",
-        "libart-compiler_static_defaults",
         "libart-dexlayout_static_defaults",
         "oatdumps-defaults",
     ],
@@ -192,7 +187,6 @@
         "libartbased_static_defaults",
         "libdexfiled_static_defaults",
         "libprofiled_static_defaults",
-        "libartd-compiler_static_defaults",
         "libartd-dexlayout_static_defaults",
         "oatdumps-defaults",
     ],
diff --git a/oatdump/art_standalone_oatdump_tests.xml b/oatdump/art_standalone_oatdump_tests.xml
index ab11b11..15dba47 100644
--- a/oatdump/art_standalone_oatdump_tests.xml
+++ b/oatdump/art_standalone_oatdump_tests.xml
@@ -15,6 +15,7 @@
 -->
 <configuration description="Runs art_standalone_oatdump_tests.">
     <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
 
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
         <option name="cleanup" value="true" />
@@ -44,8 +45,6 @@
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp/art_standalone_oatdump_tests" />
         <option name="module-name" value="art_standalone_oatdump_tests" />
-        <option name="ld-library-path-32" value="/apex/com.android.art/lib" />
-        <option name="ld-library-path-64" value="/apex/com.android.art/lib64" />
     </test>
 
     <!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc
index 9dd704a..a93ad37 100644
--- a/oatdump/oatdump.cc
+++ b/oatdump/oatdump.cc
@@ -16,35 +16,44 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <sys/stat.h>
 
+#include <algorithm>
+#include <cstdlib>
 #include <fstream>
 #include <iomanip>
 #include <iostream>
 #include <map>
+#include <optional>
 #include <set>
 #include <string>
 #include <unordered_map>
 #include <unordered_set>
+#include <utility>
 #include <vector>
 
 #include "android-base/logging.h"
 #include "android-base/parseint.h"
 #include "android-base/stringprintf.h"
 #include "android-base/strings.h"
-
+#include "arch/instruction_set.h"
 #include "arch/instruction_set_features.h"
 #include "art_field-inl.h"
 #include "art_method-inl.h"
+#include "base/array_ref.h"
 #include "base/bit_utils_iterator.h"
+#include "base/file_utils.h"
 #include "base/indenter.h"
 #include "base/os.h"
 #include "base/safe_map.h"
 #include "base/stats-inl.h"
 #include "base/stl_util.h"
+#include "base/string_view_cpp20.h"
 #include "base/unix_file/fd_file.h"
 #include "class_linker-inl.h"
 #include "class_linker.h"
 #include "class_root-inl.h"
+#include "cmdline.h"
 #include "debug/debug_info.h"
 #include "debug/elf_debug_writer.h"
 #include "debug/method_debug_info.h"
@@ -63,21 +72,23 @@
 #include "gc/space/image_space.h"
 #include "gc/space/large_object_space.h"
 #include "gc/space/space-inl.h"
-#include "image-inl.h"
 #include "imtable-inl.h"
-#include "index_bss_mapping.h"
 #include "interpreter/unstarted_runtime.h"
 #include "mirror/array-inl.h"
 #include "mirror/class-inl.h"
 #include "mirror/dex_cache-inl.h"
 #include "mirror/object-inl.h"
 #include "mirror/object_array-inl.h"
-#include "oat.h"
-#include "oat_file-inl.h"
-#include "oat_file_manager.h"
+#include "oat/image-inl.h"
+#include "oat/index_bss_mapping.h"
+#include "oat/oat.h"
+#include "oat/oat_file-inl.h"
+#include "oat/oat_file_assistant.h"
+#include "oat/oat_file_assistant_context.h"
+#include "oat/oat_file_manager.h"
+#include "oat/stack_map.h"
 #include "scoped_thread_state_change-inl.h"
 #include "stack.h"
-#include "stack_map.h"
 #include "stream/buffered_output_stream.h"
 #include "stream/file_output_stream.h"
 #include "subtype_check.h"
@@ -87,9 +98,6 @@
 #include "verifier/verifier_deps.h"
 #include "well_known_classes.h"
 
-#include <sys/stat.h>
-#include "cmdline.h"
-
 namespace art {
 
 using android::base::StringPrintf;
@@ -344,22 +352,24 @@
                    bool dump_header_only,
                    const char* export_dex_location,
                    const char* app_image,
-                   const char* app_oat,
+                   const char* oat_filename,
+                   const char* dex_filename,
                    uint32_t addr2instr)
-    : dump_vmap_(dump_vmap),
-      dump_code_info_stack_maps_(dump_code_info_stack_maps),
-      disassemble_code_(disassemble_code),
-      absolute_addresses_(absolute_addresses),
-      class_filter_(class_filter),
-      method_filter_(method_filter),
-      list_classes_(list_classes),
-      list_methods_(list_methods),
-      dump_header_only_(dump_header_only),
-      export_dex_location_(export_dex_location),
-      app_image_(app_image),
-      app_oat_(app_oat),
-      addr2instr_(addr2instr),
-      class_loader_(nullptr) {}
+      : dump_vmap_(dump_vmap),
+        dump_code_info_stack_maps_(dump_code_info_stack_maps),
+        disassemble_code_(disassemble_code),
+        absolute_addresses_(absolute_addresses),
+        class_filter_(class_filter),
+        method_filter_(method_filter),
+        list_classes_(list_classes),
+        list_methods_(list_methods),
+        dump_header_only_(dump_header_only),
+        export_dex_location_(export_dex_location),
+        app_image_(app_image),
+        oat_filename_(oat_filename != nullptr ? std::make_optional(oat_filename) : std::nullopt),
+        dex_filename_(dex_filename != nullptr ? std::make_optional(dex_filename) : std::nullopt),
+        addr2instr_(addr2instr),
+        class_loader_(nullptr) {}
 
   const bool dump_vmap_;
   const bool dump_code_info_stack_maps_;
@@ -372,7 +382,8 @@
   const bool dump_header_only_;
   const char* const export_dex_location_;
   const char* const app_image_;
-  const char* const app_oat_;
+  const std::optional<std::string> oat_filename_;
+  const std::optional<std::string> dex_filename_;
   uint32_t addr2instr_;
   Handle<mirror::ClassLoader>* class_loader_;
 };
@@ -550,7 +561,7 @@
         CHECK_LE(oat_file_.bcp_bss_info_.size(), bcp_dex_files.size());
         for (size_t i = 0; i < oat_file_.bcp_bss_info_.size(); i++) {
           const DexFile* const dex_file = bcp_dex_files[i];
-          os << "Dumping entries for BCP DexFile: " << dex_file->GetLocation() << "\n";
+          os << "Entries for BCP DexFile: " << dex_file->GetLocation() << "\n";
           DumpBssMappings(os,
                           dex_file,
                           oat_file_.bcp_bss_info_[i].method_bss_mapping,
@@ -562,7 +573,7 @@
       } else {
         // We don't have a runtime, just dump the offsets
         for (size_t i = 0; i < oat_file_.bcp_bss_info_.size(); i++) {
-          os << "We don't have a runtime, just dump the offsets for BCP Dexfile " << i << "\n";
+          os << "Offsets for BCP DexFile at index " << i << "\n";
           DumpBssOffsets(os, "ArtMethod", oat_file_.bcp_bss_info_[i].method_bss_mapping);
           DumpBssOffsets(os, "Class", oat_file_.bcp_bss_info_[i].type_bss_mapping);
           DumpBssOffsets(os, "Public Class", oat_file_.bcp_bss_info_[i].public_type_bss_mapping);
@@ -636,6 +647,11 @@
         CHECK(oat_dex_file != nullptr);
         CHECK(vdex_dex_file != nullptr);
 
+        if (!vdex_dex_file->IsDexContainerFirstEntry()) {
+          // All the data was already exported together with the primary dex file.
+          continue;
+        }
+
         // If a CompactDex file is detected within a Vdex container, DexLayout is used to convert
         // back to a StandardDex file. Since the converted DexFile will most likely not reproduce
         // the original input Dex file, the `update_checksum_` option is used to recompute the
@@ -982,6 +998,9 @@
           return false;
         }
       }
+      // Extend the data range to export all the dex files in the container.
+      CHECK(dex_file->IsDexContainerFirstEntry()) << dex_file_location;
+      fsize = dex_file->GetHeader().ContainerSize();
     }
 
     // Verify output directory exists
@@ -1931,7 +1950,7 @@
     CHECK_ALIGNED(image_header_.GetFieldsSection().Offset(), 4);
     CHECK_ALIGNED_PARAM(image_header_.GetMethodsSection().Offset(), pointer_size);
     CHECK_ALIGNED(image_header_.GetInternedStringsSection().Offset(), 8);
-    CHECK_ALIGNED(image_header_.GetImageBitmapSection().Offset(), kPageSize);
+    CHECK_ALIGNED(image_header_.GetImageBitmapSection().Offset(), kElfSegmentAlignment);
 
     for (size_t i = 0; i < ImageHeader::ImageSections::kSectionCount; i++) {
       ImageHeader::ImageSections index = ImageHeader::ImageSections(i);
@@ -2090,7 +2109,7 @@
     if (obj_class->IsArrayClass()) {
       os << StringPrintf("%p: %s length:%d\n", obj, obj_class->PrettyDescriptor().c_str(),
                          obj->AsArray()->GetLength());
-    } else if (obj->IsClass()) {
+    } else if (obj_class->IsClassClass()) {
       ObjPtr<mirror::Class> klass = obj->AsClass();
       os << StringPrintf("%p: java.lang.Class \"%s\" (",
                          obj,
@@ -2127,7 +2146,7 @@
             (value == nullptr) ? obj_class->GetComponentType() : value->GetClass();
         PrettyObjectValue(os, value_class, value);
       }
-    } else if (obj->IsClass()) {
+    } else if (obj_class->IsClassClass()) {
       ObjPtr<mirror::Class> klass = obj->AsClass();
 
       if (kBitstringSubtypeCheckEnabled) {
@@ -2136,6 +2155,16 @@
         os << "\n";
       }
 
+      if (klass->ShouldHaveEmbeddedVTable()) {
+        os << "EMBEDDED VTABLE:\n";
+        ScopedIndentation indent2(&vios_);
+        const PointerSize pointer_size = image_header_.GetPointerSize();
+        for (size_t i = 0, length = klass->GetEmbeddedVTableLength(); i != length; ++i) {
+          os << i << ": "
+             << ArtMethod::PrettyMethod(klass->GetEmbeddedVTableEntry(i, pointer_size)) << '\n';
+        }
+      }
+
       if (klass->NumStaticFields() != 0) {
         os << "STATICS:\n";
         ScopedIndentation indent2(&vios_);
@@ -2447,6 +2476,27 @@
   DISALLOW_COPY_AND_ASSIGN(ImageDumper);
 };
 
+static std::unique_ptr<OatFile> OpenOat(const std::string& oat_filename,
+                                        const std::optional<std::string>& dex_filename,
+                                        std::string* error_msg) {
+  if (!dex_filename.has_value()) {
+    LOG(WARNING) << "No dex filename provided, "
+                 << "oatdump might fail if the oat file does not contain the dex code.";
+  }
+  ArrayRef<const std::string> dex_filenames =
+      dex_filename.has_value() ? ArrayRef<const std::string>(&dex_filename.value(), /*size=*/1) :
+                                 ArrayRef<const std::string>();
+  return std::unique_ptr<OatFile>(OatFile::Open(/*zip_fd=*/-1,
+                                                oat_filename,
+                                                oat_filename,
+                                                /*executable=*/false,
+                                                /*low_4gb=*/false,
+                                                dex_filenames,
+                                                /*dex_files=*/{},
+                                                /*reservation=*/nullptr,
+                                                error_msg));
+}
+
 static int DumpImage(gc::space::ImageSpace* image_space,
                      OatDumperOptions* options,
                      std::ostream* os) REQUIRES_SHARED(Locks::mutator_lock_) {
@@ -2469,7 +2519,7 @@
 
   ScopedObjectAccess soa(Thread::Current());
   if (options->app_image_ != nullptr) {
-    if (options->app_oat_ == nullptr) {
+    if (!options->oat_filename_.has_value()) {
       LOG(ERROR) << "Can not dump app image without app oat file";
       return EXIT_FAILURE;
     }
@@ -2477,14 +2527,11 @@
     // We need to map the oat file in the low 4gb or else the fixup wont be able to fit oat file
     // pointers into 32 bit pointer sized ArtMethods.
     std::string error_msg;
-    std::unique_ptr<OatFile> oat_file(OatFile::Open(/*zip_fd=*/ -1,
-                                                    options->app_oat_,
-                                                    options->app_oat_,
-                                                    /*executable=*/ false,
-                                                    /*low_4gb=*/ true,
-                                                    &error_msg));
+    std::unique_ptr<OatFile> oat_file =
+        OpenOat(*options->oat_filename_, options->dex_filename_, &error_msg);
     if (oat_file == nullptr) {
-      LOG(ERROR) << "Failed to open oat file " << options->app_oat_ << " with error " << error_msg;
+      LOG(ERROR) << "Failed to open oat file " << *options->oat_filename_ << " with error "
+                 << error_msg;
       return EXIT_FAILURE;
     }
     std::unique_ptr<gc::space::ImageSpace> space(
@@ -2502,11 +2549,7 @@
       return EXIT_FAILURE;
     }
     // Dump the actual image.
-    int result = DumpImage(space.get(), options, os);
-    if (result != EXIT_SUCCESS) {
-      return result;
-    }
-    // Fall through to dump the boot images.
+    return DumpImage(space.get(), options, os);
   }
 
   gc::Heap* heap = runtime->GetHeap();
@@ -2593,30 +2636,12 @@
   return (success) ? EXIT_SUCCESS : EXIT_FAILURE;
 }
 
-static int DumpOat(Runtime* runtime,
-                   const char* oat_filename,
-                   const char* dex_filename,
-                   OatDumperOptions* options,
-                   std::ostream* os) {
-  if (dex_filename == nullptr) {
-    LOG(WARNING) << "No dex filename provided, "
-                 << "oatdump might fail if the oat file does not contain the dex code.";
-  }
-  std::string dex_filename_str((dex_filename != nullptr) ? dex_filename : "");
-  ArrayRef<const std::string> dex_filenames(&dex_filename_str,
-                                            /*size=*/ (dex_filename != nullptr) ? 1u : 0u);
+static int DumpOat(Runtime* runtime, OatDumperOptions* options, std::ostream* os) {
   std::string error_msg;
-  std::unique_ptr<OatFile> oat_file(OatFile::Open(/*zip_fd=*/ -1,
-                                                  oat_filename,
-                                                  oat_filename,
-                                                  /*executable=*/ false,
-                                                  /*low_4gb=*/ false,
-                                                  dex_filenames,
-                                                  /*dex_fds=*/ ArrayRef<const int>(),
-                                                  /*reservation=*/ nullptr,
-                                                  &error_msg));
+  std::unique_ptr<OatFile> oat_file =
+      OpenOat(*options->oat_filename_, options->dex_filename_, &error_msg);
   if (oat_file == nullptr) {
-    LOG(ERROR) << "Failed to open oat file from '" << oat_filename << "': " << error_msg;
+    LOG(ERROR) << "Failed to open oat file from '" << *options->oat_filename_ << "': " << error_msg;
     return EXIT_FAILURE;
   }
 
@@ -2631,19 +2656,11 @@
                         const char* dex_filename,
                         std::string& output_name,
                         bool no_bits) {
-  std::string dex_filename_str((dex_filename != nullptr) ? dex_filename : "");
-  ArrayRef<const std::string> dex_filenames(&dex_filename_str,
-                                            /*size=*/ (dex_filename != nullptr) ? 1u : 0u);
   std::string error_msg;
-  std::unique_ptr<OatFile> oat_file(OatFile::Open(/*zip_fd=*/ -1,
-                                                  oat_filename,
-                                                  oat_filename,
-                                                  /*executable=*/ false,
-                                                  /*low_4gb=*/ false,
-                                                  dex_filenames,
-                                                  /*dex_fds=*/ ArrayRef<const int>(),
-                                                  /*reservation=*/ nullptr,
-                                                  &error_msg));
+  std::unique_ptr<OatFile> oat_file =
+      OpenOat(oat_filename,
+              dex_filename != nullptr ? std::make_optional(dex_filename) : std::nullopt,
+              &error_msg);
   if (oat_file == nullptr) {
     LOG(ERROR) << "Failed to open oat file from '" << oat_filename << "': " << error_msg;
     return EXIT_FAILURE;
@@ -2682,19 +2699,11 @@
     std::vector<const DexFile*> class_path;
 
     if (oat_filename != nullptr) {
-    std::string dex_filename_str((dex_filename != nullptr) ? dex_filename : "");
-    ArrayRef<const std::string> dex_filenames(&dex_filename_str,
-                                              /*size=*/ (dex_filename != nullptr) ? 1u : 0u);
       std::string error_msg;
-      std::unique_ptr<OatFile> oat_file(OatFile::Open(/*zip_fd=*/ -1,
-                                                      oat_filename,
-                                                      oat_filename,
-                                                      /*executable=*/ false,
-                                                      /*low_4gb=*/false,
-                                                      dex_filenames,
-                                                      /*dex_fds=*/ArrayRef<const int>(),
-                                                      /*reservation=*/ nullptr,
-                                                      &error_msg));
+      std::unique_ptr<OatFile> oat_file =
+          OpenOat(oat_filename,
+                  dex_filename != nullptr ? std::make_optional(dex_filename) : std::nullopt,
+                  &error_msg);
       if (oat_file == nullptr) {
         LOG(ERROR) << "Failed to open oat file from '" << oat_filename << "': " << error_msg;
         return false;
@@ -3114,6 +3123,13 @@
   }
 };
 
+enum class OatDumpMode {
+  kSymbolize,
+  kDumpImt,
+  kDumpImage,
+  kDumpOat,
+};
+
 struct OatdumpArgs : public CmdlineArgs {
  protected:
   using Base = CmdlineArgs;
@@ -3180,9 +3196,15 @@
   }
 
   ParseStatus ParseChecks(std::string* error_msg) override {
-    // Infer boot image location from the image location if possible.
-    if (boot_image_location_ == nullptr) {
-      boot_image_location_ = image_location_;
+    if (image_location_ != nullptr) {
+      if (!boot_image_locations_.empty()) {
+        std::cerr << "Warning: Invalid combination of --boot-image and --image\n";
+        std::cerr << "Use --image alone to dump boot image(s)\n";
+        std::cerr << "Ignoring --boot-image\n";
+        std::cerr << "\n";
+        boot_image_locations_.clear();
+      }
+      Split(image_location_, ':', &boot_image_locations_);
     }
 
     // Perform the parent checks.
@@ -3192,11 +3214,41 @@
     }
 
     // Perform our own checks.
-    if (image_location_ == nullptr && oat_filename_ == nullptr) {
-      *error_msg = "Either --image or --oat-file must be specified";
+    if (image_location_ == nullptr && app_image_ == nullptr && oat_filename_ == nullptr) {
+      *error_msg = "Either --image, --app-image, --oat-file, or --symbolize must be specified";
       return kParseError;
-    } else if (image_location_ != nullptr && oat_filename_ != nullptr) {
-      *error_msg = "Either --image or --oat-file must be specified but not both";
+    }
+
+    if (app_image_ != nullptr && image_location_ != nullptr) {
+      std::cerr << "Warning: Combining --app-image with --image is no longer supported\n";
+      std::cerr << "Use --app-image alone to dump an app image, and optionally pass --boot-image "
+                   "to specify the boot image that the app image is based on\n";
+      std::cerr << "Use --image alone to dump boot image(s)\n";
+      std::cerr << "Ignoring --image\n";
+      std::cerr << "\n";
+      image_location_ = nullptr;
+    }
+
+    if (image_location_ != nullptr && oat_filename_ != nullptr) {
+      *error_msg =
+          "--image and --oat-file must not be specified together\n"
+          "Use --image alone to dump both boot image(s) and their oat file(s)\n"
+          "Use --oat-file alone to dump an oat file";
+      return kParseError;
+    }
+
+    if (app_oat_ != nullptr) {
+      std::cerr << "Warning: --app-oat is deprecated. Use --oat-file instead\n";
+      std::cerr << "\n";
+      oat_filename_ = app_oat_;
+    }
+
+    if (boot_image_locations_.empty() && app_image_ != nullptr) {
+      // At this point, boot image inference is impossible or has failed, and the user has been
+      // warned about the failure.
+      // When dumping an app image, we need at least one valid boot image, so we have to stop.
+      // When dumping other things, we can continue to start the runtime in imageless mode.
+      *error_msg = "--boot-image must be specified";
       return kParseError;
     }
 
@@ -3206,25 +3258,43 @@
   std::string GetUsage() const override {
     std::string usage;
 
-    usage +=
-        "Usage: oatdump [options] ...\n"
-        "    Example: oatdump --image=$ANDROID_PRODUCT_OUT/system/framework/boot.art\n"
-        "    Example: adb shell oatdump --image=/system/framework/boot.art\n"
-        "\n"
-        // Either oat-file or image is required.
-        "  --oat-file=<file.oat>: specifies an input oat filename.\n"
-        "      Example: --oat-file=/system/framework/arm64/boot.oat\n"
-        "\n"
-        "  --image=<file.art>: specifies an input image location.\n"
-        "      Example: --image=/system/framework/boot.art\n"
-        "\n"
-        "  --app-image=<file.art>: specifies an input app image. Must also have a specified\n"
-        " boot image (with --image) and app oat file (with --app-oat).\n"
-        "      Example: --app-image=app.art\n"
-        "\n"
-        "  --app-oat=<file.odex>: specifies an input app oat.\n"
-        "      Example: --app-oat=app.odex\n"
-        "\n";
+    usage += R"(
+Usage: oatdump [options] ...
+
+Examples:
+- Dump a primary boot image with its oat file.
+    oatdump --image=/system/framework/boot.art
+
+- Dump a primary boot image and extension(s) with their oat files.
+    oatdump --image=/system/framework/boot.art:/system/framework/boot-framework-adservices.art
+
+- Dump an app image with its oat file.
+    oatdump --app-image=app.art --oat-file=app.odex [--dex-file=app.apk] [--boot-image=boot.art]
+
+- Dump an app oat file.
+    oatdump --oat-file=app.odex [--dex-file=app.apk] [--boot-image=boot.art]
+
+- Dump IMT collisions. (See --dump-imt for details.)
+    oatdump --oat-file=app.odex --dump-imt=imt.txt [--dex-file=app.apk] [--boot-image=boot.art]
+        [--dump-imt-stats]
+
+- Symbolize an oat file. (See --symbolize for details.)
+    oatdump --symbolize=app.odex [--dex-file=app.apk] [--only-keep-debug]
+
+Options:
+  --oat-file=<file.oat>: dumps an oat file with the given filename.
+      Example: --oat-file=/system/framework/arm64/boot.oat
+
+  --image=<file.art>: dumps boot image(s) specified at the given location.
+      Example: --image=/system/framework/boot.art
+
+  --app-image=<file.art>: dumps an app image with the given filename.
+      Must also have a specified app oat file (with --oat-file).
+      Example: --app-image=app.art
+
+  --app-oat=<file.odex>: deprecated. Use --oat-file instead.
+
+)";
 
     usage += Base::GetUsage();
 
@@ -3252,7 +3322,7 @@
         "  --symbolize=<file.oat>: output a copy of file.oat with elf symbols included.\n"
         "      Example: --symbolize=/system/framework/boot.oat\n"
         "\n"
-        "  --only-keep-debug<file.oat>: Modifies the behaviour of --symbolize so that\n"
+        "  --only-keep-debug: modifies the behaviour of --symbolize so that\n"
         "      .rodata and .text sections are omitted in the output file to save space.\n"
         "      Example: --symbolize=/system/framework/boot.oat --only-keep-debug\n"
         "\n"
@@ -3276,7 +3346,8 @@
         "                         of a complete method name (separated by a whitespace).\n"
         "      Example: --dump-imt=imt.txt\n"
         "\n"
-        "  --dump-imt-stats: output IMT statistics for the given boot image\n"
+        "  --dump-imt-stats: modifies the behavior of --dump-imt to also output IMT statistics\n"
+        "      for the boot image.\n"
         "      Example: --dump-imt-stats"
         "\n";
 
@@ -3284,6 +3355,21 @@
   }
 
  public:
+  OatDumpMode GetMode() {
+    // Keep the order of precedence for backward compatibility.
+    if (symbolize_) {
+      return OatDumpMode::kSymbolize;
+    }
+    if (!imt_dump_.empty()) {
+      return OatDumpMode::kDumpImt;
+    }
+    if (image_location_ != nullptr || app_image_ != nullptr) {
+      return OatDumpMode::kDumpImage;
+    }
+    CHECK_NE(oat_filename_, nullptr);
+    return OatDumpMode::kDumpOat;
+  }
+
   const char* oat_filename_ = nullptr;
   const char* dex_filename_ = nullptr;
   const char* class_filter_ = "";
@@ -3310,57 +3396,74 @@
   bool NeedsRuntime() override {
     CHECK(args_ != nullptr);
 
-    // If we are only doing the oat file, disable absolute_addresses. Keep them for image dumping.
-    bool absolute_addresses = (args_->oat_filename_ == nullptr);
+    OatDumpMode mode = args_->GetMode();
 
-    oat_dumper_options_.reset(new OatDumperOptions(
-        args_->dump_vmap_,
-        args_->dump_code_info_stack_maps_,
-        args_->disassemble_code_,
-        absolute_addresses,
-        args_->class_filter_,
-        args_->method_filter_,
-        args_->list_classes_,
-        args_->list_methods_,
-        args_->dump_header_only_,
-        args_->export_dex_location_,
-        args_->app_image_,
-        args_->app_oat_,
-        args_->addr2instr_));
+    // Only enable absolute_addresses for image dumping.
+    bool absolute_addresses = mode == OatDumpMode::kDumpImage;
 
-    return (args_->boot_image_location_ != nullptr ||
-            args_->image_location_ != nullptr ||
-            !args_->imt_dump_.empty()) &&
-          !args_->symbolize_;
+    oat_dumper_options_.reset(new OatDumperOptions(args_->dump_vmap_,
+                                                   args_->dump_code_info_stack_maps_,
+                                                   args_->disassemble_code_,
+                                                   absolute_addresses,
+                                                   args_->class_filter_,
+                                                   args_->method_filter_,
+                                                   args_->list_classes_,
+                                                   args_->list_methods_,
+                                                   args_->dump_header_only_,
+                                                   args_->export_dex_location_,
+                                                   args_->app_image_,
+                                                   args_->oat_filename_,
+                                                   args_->dex_filename_,
+                                                   args_->addr2instr_));
+
+    switch (mode) {
+      case OatDumpMode::kDumpImt:
+      case OatDumpMode::kDumpImage:
+        return true;
+      case OatDumpMode::kSymbolize:
+        return false;
+      case OatDumpMode::kDumpOat:
+        std::string error_msg;
+        if (CanDumpWithRuntime(&error_msg)) {
+          LOG(INFO) << "Dumping oat file with runtime";
+          return true;
+        } else {
+          LOG(INFO) << ART_FORMAT("Cannot dump oat file with runtime: {}. Dumping without runtime",
+                                  error_msg);
+          return false;
+        }
+    }
   }
 
   bool ExecuteWithoutRuntime() override {
     CHECK(args_ != nullptr);
-    CHECK(args_->oat_filename_ != nullptr);
+
+    OatDumpMode mode = args_->GetMode();
+    CHECK(mode == OatDumpMode::kSymbolize || mode == OatDumpMode::kDumpOat);
 
     MemMap::Init();
 
-    if (args_->symbolize_) {
+    if (mode == OatDumpMode::kSymbolize) {
       // ELF has special kind of section called SHT_NOBITS which allows us to create
       // sections which exist but their data is omitted from the ELF file to save space.
       // This is what "strip --only-keep-debug" does when it creates separate ELF file
       // with only debug data. We use it in similar way to exclude .rodata and .text.
       bool no_bits = args_->only_keep_debug_;
-      return SymbolizeOat(args_->oat_filename_, args_->dex_filename_, args_->output_name_, no_bits)
-          == EXIT_SUCCESS;
-    } else {
-      return DumpOat(nullptr,
-                     args_->oat_filename_,
-                     args_->dex_filename_,
-                     oat_dumper_options_.get(),
-                     args_->os_) == EXIT_SUCCESS;
+      return SymbolizeOat(
+                 args_->oat_filename_, args_->dex_filename_, args_->output_name_, no_bits) ==
+             EXIT_SUCCESS;
     }
+
+    return DumpOat(nullptr, oat_dumper_options_.get(), args_->os_) == EXIT_SUCCESS;
   }
 
   bool ExecuteWithRuntime(Runtime* runtime) override {
     CHECK(args_ != nullptr);
+    OatDumpMode mode = args_->GetMode();
+    CHECK(mode == OatDumpMode::kDumpImt || mode == OatDumpMode::kDumpImage ||
+          mode == OatDumpMode::kDumpOat);
 
-    if (!args_->imt_dump_.empty() || args_->imt_stat_dump_) {
+    if (mode == OatDumpMode::kDumpImt) {
       return IMTDumper::Dump(runtime,
                              args_->imt_dump_,
                              args_->imt_stat_dump_,
@@ -3368,17 +3471,50 @@
                              args_->dex_filename_);
     }
 
-    if (args_->oat_filename_ != nullptr) {
-      return DumpOat(runtime,
-                     args_->oat_filename_,
-                     args_->dex_filename_,
-                     oat_dumper_options_.get(),
-                     args_->os_) == EXIT_SUCCESS;
+    if (mode == OatDumpMode::kDumpOat) {
+      return DumpOat(runtime, oat_dumper_options_.get(), args_->os_) == EXIT_SUCCESS;
     }
 
     return DumpImages(runtime, oat_dumper_options_.get(), args_->os_) == EXIT_SUCCESS;
   }
 
+  bool CanDumpWithRuntime(std::string* error_msg) {
+    std::unique_ptr<OatFileAssistantContext> ofa_context =
+        args_->GetOatFileAssistantContext(error_msg);
+    if (ofa_context == nullptr) {
+      return false;
+    }
+
+    std::unique_ptr<OatFile> oat_file =
+        OpenOat(*oat_dumper_options_->oat_filename_, oat_dumper_options_->dex_filename_, error_msg);
+    if (oat_file == nullptr) {
+      *error_msg = ART_FORMAT(
+          "Failed to open oat file from '{}': {}", *oat_dumper_options_->oat_filename_, *error_msg);
+      return false;
+    }
+
+    const std::vector<const OatDexFile*>& dex_files = oat_file->GetOatDexFiles();
+    if (dex_files.empty()) {
+      // Dump header only. Don't need a runtime.
+      *error_msg = "No dex code";
+      return false;
+    }
+
+    OatFileAssistant oat_file_assistant(dex_files[0]->GetLocation().c_str(),
+                                        args_->instruction_set_,
+                                        /*context=*/nullptr,
+                                        /*load_executable=*/false,
+                                        /*only_load_trusted_executable=*/false,
+                                        ofa_context.get());
+
+    if (!oat_file_assistant.ValidateBootClassPathChecksums(*oat_file)) {
+      *error_msg = "BCP checksum check failed";
+      return false;
+    }
+
+    return true;
+  }
+
   std::unique_ptr<OatDumperOptions> oat_dumper_options_;
 };
 
diff --git a/oatdump/oatdump_app_test.cc b/oatdump/oatdump_app_test.cc
index 9c37707..d4dee4f 100644
--- a/oatdump/oatdump_app_test.cc
+++ b/oatdump/oatdump_app_test.cc
@@ -18,37 +18,151 @@
 
 namespace art {
 
-TEST_F(OatDumpTest, TestAppWithBootImage) {
-  ASSERT_TRUE(GenerateAppOdexFile(Flavor::kDynamic, {"--runtime-arg", "-Xmx64M"}));
-  ASSERT_TRUE(Exec(Flavor::kDynamic, kModeOatWithBootImage, {}, kListAndCode));
-}
-TEST_F(OatDumpTest, TestAppWithBootImageStatic) {
-  TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS();
-  ASSERT_TRUE(GenerateAppOdexFile(Flavor::kStatic, {"--runtime-arg", "-Xmx64M"}));
-  ASSERT_TRUE(Exec(Flavor::kStatic, kModeOatWithBootImage, {}, kListAndCode));
+// Oat file compiled with a boot image. oatdump invoked with a boot image.
+TEST_P(OatDumpTest, TestDumpOatWithRuntimeWithBootImage) {
+  ASSERT_TRUE(GenerateAppOdexFile(GetParam()));
+  ASSERT_TRUE(Exec(GetParam(),
+                   kArgOatApp | kArgBootImage | kArgBcp | kArgIsa,
+                   {},
+                   kExpectOat | kExpectCode | kExpectBssMappingsForBcp));
 }
 
-TEST_F(OatDumpTest, TestAppImageWithBootImage) {
-  TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS();  // GC bug, b/126305867
-  const std::string app_image_arg = "--app-image-file=" + GetAppImageName();
-  ASSERT_TRUE(GenerateAppOdexFile(Flavor::kDynamic, {"--runtime-arg", "-Xmx64M", app_image_arg}));
-  ASSERT_TRUE(Exec(Flavor::kDynamic, kModeAppImage, {}, kListAndCode));
-}
-TEST_F(OatDumpTest, TestAppImageWithBootImageStatic) {
-  TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS();  // GC bug, b/126305867
-  TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS();
-  const std::string app_image_arg = "--app-image-file=" + GetAppImageName();
-  ASSERT_TRUE(GenerateAppOdexFile(Flavor::kStatic, {"--runtime-arg", "-Xmx64M", app_image_arg}));
-  ASSERT_TRUE(Exec(Flavor::kStatic, kModeAppImage, {}, kListAndCode));
+// Oat file compiled without a boot image. oatdump invoked without a boot image.
+TEST_P(OatDumpTest, TestDumpOatWithRuntimeWithNoBootImage) {
+  TEST_DISABLED_FOR_DEBUG_BUILD();  // DCHECK failed.
+  ASSERT_TRUE(GenerateAppOdexFile(GetParam(), {"--boot-image=/nonx/boot.art"}));
+  ASSERT_TRUE(Exec(GetParam(),
+                   kArgOatApp | kArgBcp | kArgIsa,
+                   {"--boot-image=/nonx/boot.art"},
+                   kExpectOat | kExpectCode | kExpectBssMappingsForBcp));
 }
 
-TEST_F(OatDumpTest, TestAppImageInvalidPath) {
+// Dex code cannot be found in the vdex file, and no --dex-file is specified. Dump header only.
+TEST_P(OatDumpTest, TestDumpOatTryWithRuntimeDexNotFound) {
+  ASSERT_TRUE(
+      GenerateAppOdexFile(GetParam(), {"--dex-location=/nonx/app.jar", "--copy-dex-files=false"}));
+  ASSERT_TRUE(Exec(GetParam(), kArgOatApp | kArgBootImage | kArgBcp | kArgIsa, {}, kExpectOat));
+}
+
+// Dex code cannot be found in the vdex file, but can be found in the specified dex file.
+TEST_P(OatDumpTest, TestDumpOatWithRuntimeDexSpecified) {
+  ASSERT_TRUE(
+      GenerateAppOdexFile(GetParam(), {"--dex-location=/nonx/app.jar", "--copy-dex-files=false"}));
+  ASSERT_TRUE(Exec(GetParam(),
+                   kArgOatApp | kArgDexApp | kArgBootImage | kArgBcp | kArgIsa,
+                   {},
+                   kExpectOat | kExpectCode | kExpectBssMappingsForBcp));
+}
+
+// Oat file compiled with a boot image. oatdump invoked without a boot image.
+TEST_P(OatDumpTest, TestDumpOatWithoutRuntimeBcpMismatch) {
+  ASSERT_TRUE(GenerateAppOdexFile(GetParam()));
+  ASSERT_TRUE(Exec(GetParam(),
+                   kArgOatApp | kArgBcp | kArgIsa,
+                   {"--boot-image=/nonx/boot.art"},
+                   kExpectOat | kExpectCode | kExpectBssOffsetsForBcp));
+}
+
+// Bootclasspath not specified.
+TEST_P(OatDumpTest, TestDumpOatWithoutRuntimeNoBcp) {
+  ASSERT_TRUE(GenerateAppOdexFile(GetParam()));
+  ASSERT_TRUE(Exec(GetParam(), kArgOatApp, {}, kExpectOat | kExpectCode | kExpectBssOffsetsForBcp));
+}
+
+// Dex code cannot be found in the vdex file, and no --dex-file is specified. Dump header only.
+TEST_P(OatDumpTest, TestDumpOatWithoutRuntimeDexNotFound) {
+  ASSERT_TRUE(
+      GenerateAppOdexFile(GetParam(), {"--dex-location=/nonx/app.jar", "--copy-dex-files=false"}));
+  ASSERT_TRUE(Exec(GetParam(), kArgOatApp, {}, kExpectOat));
+}
+
+// Dex code cannot be found in the vdex file, but can be found in the specified dex file.
+TEST_P(OatDumpTest, TestDumpOatWithoutRuntimeDexSpecified) {
+  ASSERT_TRUE(
+      GenerateAppOdexFile(GetParam(), {"--dex-location=/nonx/app.jar", "--copy-dex-files=false"}));
+  ASSERT_TRUE(Exec(
+      GetParam(), kArgOatApp | kArgDexApp, {}, kExpectOat | kExpectCode | kExpectBssOffsetsForBcp));
+}
+
+TEST_P(OatDumpTest, TestDumpAppImageWithBootImage) {
   TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS();  // GC bug, b/126305867
-  TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS();
   const std::string app_image_arg = "--app-image-file=" + GetAppImageName();
-  ASSERT_TRUE(GenerateAppOdexFile(Flavor::kStatic, {"--runtime-arg", "-Xmx64M", app_image_arg}));
-  SetAppImageName("missing_app_image.art");
-  ASSERT_TRUE(Exec(Flavor::kStatic, kModeAppImage, {}, kListAndCode, /*expect_failure=*/true));
+  ASSERT_TRUE(GenerateAppOdexFile(GetParam(), {app_image_arg}));
+  ASSERT_TRUE(Exec(GetParam(),
+                   kArgAppImage | kArgOatApp | kArgBootImage | kArgBcp | kArgIsa,
+                   {},
+                   kExpectImage | kExpectOat | kExpectCode | kExpectBssMappingsForBcp));
+}
+
+// Deprecated usage, but checked for compatibility.
+TEST_P(OatDumpTest, TestDumpAppImageWithBootImageLegacy) {
+  TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS();  // GC bug, b/126305867
+  const std::string app_image_arg = "--app-image-file=" + GetAppImageName();
+  ASSERT_TRUE(GenerateAppOdexFile(GetParam(), {app_image_arg}));
+  ASSERT_TRUE(Exec(GetParam(),
+                   kArgAppImage | kArgImage | kArgBcp | kArgIsa,
+                   {"--app-oat=" + GetAppOdexName()},
+                   kExpectImage | kExpectOat | kExpectCode | kExpectBssMappingsForBcp));
+}
+
+TEST_P(OatDumpTest, TestDumpAppImageInvalidPath) {
+  TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS();  // GC bug, b/126305867
+  const std::string app_image_arg = "--app-image-file=" + GetAppImageName();
+  ASSERT_TRUE(GenerateAppOdexFile(GetParam(), {app_image_arg}));
+  ASSERT_TRUE(Exec(GetParam(),
+                   kArgOatApp | kArgBootImage | kArgBcp | kArgIsa,
+                   {"--app-image=missing_app_image.art"},
+                   /*expects=*/0,
+                   /*expect_failure=*/true));
+}
+
+// The runtime can start, but the boot image check should fail.
+TEST_P(OatDumpTest, TestDumpAppImageWithWrongBootImage) {
+  TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS();  // GC bug, b/126305867
+  const std::string app_image_arg = "--app-image-file=" + GetAppImageName();
+  ASSERT_TRUE(GenerateAppOdexFile(GetParam(), {app_image_arg}));
+  ASSERT_TRUE(Exec(GetParam(),
+                   kArgAppImage | kArgOatApp | kArgBcp | kArgIsa,
+                   {"--boot-image=/nonx/boot.art"},
+                   /*expects=*/0,
+                   /*expect_failure=*/true));
+}
+
+// Not possible.
+TEST_P(OatDumpTest, TestDumpAppImageWithoutRuntime) {
+  TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS();  // GC bug, b/126305867
+  const std::string app_image_arg = "--app-image-file=" + GetAppImageName();
+  ASSERT_TRUE(GenerateAppOdexFile(GetParam(), {app_image_arg}));
+  ASSERT_TRUE(Exec(GetParam(),
+                   kArgAppImage | kArgOatApp,
+                   {},
+                   /*expects=*/0,
+                   /*expect_failure=*/true));
+}
+
+// Dex code cannot be found in the vdex file, and no --dex-file is specified. Cannot dump app image.
+TEST_P(OatDumpTest, TestDumpAppImageDexNotFound) {
+  TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS();  // GC bug, b/126305867
+  const std::string app_image_arg = "--app-image-file=" + GetAppImageName();
+  ASSERT_TRUE(GenerateAppOdexFile(
+      GetParam(), {app_image_arg, "--dex-location=/nonx/app.jar", "--copy-dex-files=false"}));
+  ASSERT_TRUE(Exec(GetParam(),
+                   kArgAppImage | kArgOatApp | kArgBootImage | kArgBcp | kArgIsa,
+                   {},
+                   /*expects=*/0,
+                   /*expect_failure=*/true));
+}
+
+// Dex code cannot be found in the vdex file, but can be found in the specified dex file.
+TEST_P(OatDumpTest, TestDumpAppImageDexSpecified) {
+  TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS();  // GC bug, b/126305867
+  const std::string app_image_arg = "--app-image-file=" + GetAppImageName();
+  ASSERT_TRUE(GenerateAppOdexFile(
+      GetParam(), {app_image_arg, "--dex-location=/nonx/app.jar", "--copy-dex-files=false"}));
+  ASSERT_TRUE(Exec(GetParam(),
+                   kArgAppImage | kArgOatApp | kArgDexApp | kArgBootImage | kArgBcp | kArgIsa,
+                   {},
+                   kExpectImage | kExpectOat | kExpectCode | kExpectBssMappingsForBcp));
 }
 
 }  // namespace art
diff --git a/oatdump/oatdump_image_test.cc b/oatdump/oatdump_image_test.cc
index 7308f82..ea0bd3e 100644
--- a/oatdump/oatdump_image_test.cc
+++ b/oatdump/oatdump_image_test.cc
@@ -20,31 +20,22 @@
 
 // Disable tests on arm and arm64 as they are taking too long to run. b/27824283.
 #define TEST_DISABLED_FOR_ARM_AND_ARM64() \
-    TEST_DISABLED_FOR_ARM(); \
-    TEST_DISABLED_FOR_ARM64(); \
+  TEST_DISABLED_FOR_ARM();                \
+  TEST_DISABLED_FOR_ARM64();
 
-TEST_F(OatDumpTest, TestImage) {
+TEST_P(OatDumpTest, TestDumpImage) {
+  TEST_DISABLED_FOR_RISCV64();
   TEST_DISABLED_FOR_ARM_AND_ARM64();
   std::string error_msg;
-  ASSERT_TRUE(Exec(Flavor::kDynamic, kModeArt, {}, kListAndCode));
-}
-TEST_F(OatDumpTest, TestImageStatic) {
-  TEST_DISABLED_FOR_ARM_AND_ARM64();
-  TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS();
-  std::string error_msg;
-  ASSERT_TRUE(Exec(Flavor::kStatic, kModeArt, {}, kListAndCode));
+  ASSERT_TRUE(
+      Exec(GetParam(), kArgImage | kArgBcp | kArgIsa, {}, kExpectImage | kExpectOat | kExpectCode));
 }
 
-TEST_F(OatDumpTest, TestOatImage) {
+TEST_P(OatDumpTest, TestDumpOatBcp) {
+  TEST_DISABLED_FOR_RISCV64();
   TEST_DISABLED_FOR_ARM_AND_ARM64();
   std::string error_msg;
-  ASSERT_TRUE(Exec(Flavor::kDynamic, kModeCoreOat, {}, kListAndCode));
-}
-TEST_F(OatDumpTest, TestOatImageStatic) {
-  TEST_DISABLED_FOR_ARM_AND_ARM64();
-  TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS();
-  std::string error_msg;
-  ASSERT_TRUE(Exec(Flavor::kStatic, kModeCoreOat, {}, kListAndCode));
+  ASSERT_TRUE(Exec(GetParam(), kArgOatBcp | kArgDexBcp, {}, kExpectOat | kExpectCode));
 }
 
 }  // namespace art
diff --git a/oatdump/oatdump_test.cc b/oatdump/oatdump_test.cc
index 49bee48..6cd3a97 100644
--- a/oatdump/oatdump_test.cc
+++ b/oatdump/oatdump_test.cc
@@ -20,93 +20,83 @@
 
 namespace art {
 
+INSTANTIATE_TEST_SUITE_P(DynamicOrStatic,
+                         OatDumpTest,
+                         testing::Values(Flavor::kDynamic, Flavor::kStatic));
+
 // Disable tests on arm and arm64 as they are taking too long to run. b/27824283.
 #define TEST_DISABLED_FOR_ARM_AND_ARM64() \
-    TEST_DISABLED_FOR_ARM(); \
-    TEST_DISABLED_FOR_ARM64(); \
+  TEST_DISABLED_FOR_ARM();                \
+  TEST_DISABLED_FOR_ARM64();
 
-TEST_F(OatDumpTest, TestNoDumpVmap) {
+TEST_P(OatDumpTest, TestNoDumpVmap) {
+  TEST_DISABLED_FOR_RISCV64();
   TEST_DISABLED_FOR_ARM_AND_ARM64();
   std::string error_msg;
-  ASSERT_TRUE(Exec(Flavor::kDynamic, kModeArt, {"--no-dump:vmap"}, kListAndCode));
-}
-TEST_F(OatDumpTest, TestNoDumpVmapStatic) {
-  TEST_DISABLED_FOR_ARM_AND_ARM64();
-  TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS();
-  std::string error_msg;
-  ASSERT_TRUE(Exec(Flavor::kStatic, kModeArt, {"--no-dump:vmap"}, kListAndCode));
+  ASSERT_TRUE(Exec(GetParam(),
+                   kArgImage | kArgBcp | kArgIsa,
+                   {"--no-dump:vmap"},
+                   kExpectImage | kExpectOat | kExpectCode));
 }
 
-TEST_F(OatDumpTest, TestNoDisassemble) {
+TEST_P(OatDumpTest, TestNoDisassemble) {
+  TEST_DISABLED_FOR_RISCV64();
   TEST_DISABLED_FOR_ARM_AND_ARM64();
   std::string error_msg;
-  ASSERT_TRUE(Exec(Flavor::kDynamic, kModeArt, {"--no-disassemble"}, kListAndCode));
-}
-TEST_F(OatDumpTest, TestNoDisassembleStatic) {
-  TEST_DISABLED_FOR_ARM_AND_ARM64();
-  TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS();
-  std::string error_msg;
-  ASSERT_TRUE(Exec(Flavor::kStatic, kModeArt, {"--no-disassemble"}, kListAndCode));
+  ASSERT_TRUE(Exec(GetParam(),
+                   kArgImage | kArgBcp | kArgIsa,
+                   {"--no-disassemble"},
+                   kExpectImage | kExpectOat | kExpectCode));
 }
 
-TEST_F(OatDumpTest, TestListClasses) {
+TEST_P(OatDumpTest, TestListClasses) {
+  TEST_DISABLED_FOR_RISCV64();
   TEST_DISABLED_FOR_ARM_AND_ARM64();
   std::string error_msg;
-  ASSERT_TRUE(Exec(Flavor::kDynamic, kModeArt, {"--list-classes"}, kListOnly));
-}
-TEST_F(OatDumpTest, TestListClassesStatic) {
-  TEST_DISABLED_FOR_ARM_AND_ARM64();
-  TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS();
-  std::string error_msg;
-  ASSERT_TRUE(Exec(Flavor::kStatic, kModeArt, {"--list-classes"}, kListOnly));
+  ASSERT_TRUE(Exec(
+      GetParam(), kArgImage | kArgBcp | kArgIsa, {"--list-classes"}, kExpectImage | kExpectOat));
 }
 
-TEST_F(OatDumpTest, TestListMethods) {
+TEST_P(OatDumpTest, TestListMethods) {
+  TEST_DISABLED_FOR_RISCV64();
   TEST_DISABLED_FOR_ARM_AND_ARM64();
   std::string error_msg;
-  ASSERT_TRUE(Exec(Flavor::kDynamic, kModeArt, {"--list-methods"}, kListOnly));
-}
-TEST_F(OatDumpTest, TestListMethodsStatic) {
-  TEST_DISABLED_FOR_ARM_AND_ARM64();
-  TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS();
-  std::string error_msg;
-  ASSERT_TRUE(Exec(Flavor::kStatic, kModeArt, {"--list-methods"}, kListOnly));
+  ASSERT_TRUE(Exec(
+      GetParam(), kArgImage | kArgBcp | kArgIsa, {"--list-methods"}, kExpectImage | kExpectOat));
 }
 
-TEST_F(OatDumpTest, TestSymbolize) {
-  TEST_DISABLED_FOR_TARGET();  // Can not write files inside the apex directory.
+TEST_P(OatDumpTest, TestSymbolize) {
+  if (GetParam() == Flavor::kDynamic) {
+    TEST_DISABLED_FOR_TARGET();  // Can not write files inside the apex directory.
+  } else {
+    TEST_DISABLED_FOR_RISCV64();
+    TEST_DISABLED_FOR_ARM_AND_ARM64();
+  }
   std::string error_msg;
-  ASSERT_TRUE(Exec(Flavor::kDynamic, kModeSymbolize, {}, kListOnly));
-}
-TEST_F(OatDumpTest, TestSymbolizeStatic) {
-  TEST_DISABLED_FOR_ARM_AND_ARM64();
-  TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS();
-  std::string error_msg;
-  ASSERT_TRUE(Exec(Flavor::kStatic, kModeSymbolize, {}, kListOnly));
+  ASSERT_TRUE(Exec(GetParam(), kArgSymbolize, {}, /*expects=*/0));
 }
 
-TEST_F(OatDumpTest, TestExportDex) {
+TEST_P(OatDumpTest, TestExportDex) {
+  if (GetParam() == Flavor::kStatic) {
+    TEST_DISABLED_FOR_RISCV64();
+    TEST_DISABLED_FOR_ARM_AND_ARM64();
+  }
   std::string error_msg;
-  ASSERT_TRUE(GenerateAppOdexFile(Flavor::kDynamic, {"--runtime-arg", "-Xmx64M"}));
-  ASSERT_TRUE(Exec(Flavor::kDynamic, kModeOat, {"--export-dex-to=" + tmp_dir_}, kListOnly));
-  const std::string dex_location =
-      tmp_dir_+ "/" + android::base::Basename(GetTestDexFileName(GetAppBaseName().c_str())) +
-      "_export.dex";
-  const std::string dexdump = GetExecutableFilePath("dexdump",
-                                                    /*is_debug=*/false,
-                                                    /*is_static=*/false,
-                                                    /*bitness=*/false);
-  std::string output;
-  auto post_fork_fn = []() { return true; };
-  ForkAndExecResult res = ForkAndExec({dexdump, "-d", dex_location}, post_fork_fn, &output);
-  ASSERT_TRUE(res.StandardSuccess());
-}
-TEST_F(OatDumpTest, TestExportDexStatic) {
-  TEST_DISABLED_FOR_ARM_AND_ARM64();
-  TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS();
-  std::string error_msg;
-  ASSERT_TRUE(GenerateAppOdexFile(Flavor::kStatic, {"--runtime-arg", "-Xmx64M"}));
-  ASSERT_TRUE(Exec(Flavor::kStatic, kModeOat, {"--export-dex-to=" + tmp_dir_}, kListOnly));
+  ASSERT_TRUE(GenerateAppOdexFile(GetParam()));
+  ASSERT_TRUE(Exec(GetParam(), kArgOatApp, {"--export-dex-to=" + tmp_dir_}, kExpectOat));
+  if (GetParam() == Flavor::kDynamic) {
+    const std::string dex_location =
+        tmp_dir_ + "/" + android::base::Basename(GetTestDexFileName(GetAppBaseName().c_str())) +
+        "_export.dex";
+    const std::string dexdump = GetExecutableFilePath("dexdump",
+                                                      /*is_debug=*/false,
+                                                      /*is_static=*/false,
+                                                      /*bitness=*/false);
+    std::string output;
+    auto post_fork_fn = []() { return true; };
+    ForkAndExecResult res = ForkAndExec({dexdump, "-d", dex_location}, post_fork_fn, &output);
+    ASSERT_TRUE(res.StandardSuccess());
+  }
 }
 
 }  // namespace art
diff --git a/oatdump/oatdump_test.h b/oatdump/oatdump_test.h
index 708befe..2b37bef 100644
--- a/oatdump/oatdump_test.h
+++ b/oatdump/oatdump_test.h
@@ -17,43 +17,53 @@
 #ifndef ART_OATDUMP_OATDUMP_TEST_H_
 #define ART_OATDUMP_OATDUMP_TEST_H_
 
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "android-base/strings.h"
-
-#include "arch/instruction_set.h"
-#include "base/file_utils.h"
-#include "base/os.h"
-#include "base/unix_file/fd_file.h"
-#include "base/utils.h"
-#include "common_runtime_test.h"
-#include "exec_utils.h"
-#include "gc/heap.h"
-#include "gc/space/image_space.h"
-
 #include <sys/types.h>
 #include <unistd.h>
 
+#include <memory>
+#include <sstream>
+#include <string>
+#include <type_traits>
+#include <vector>
+
+#include "arch/instruction_set.h"
+#include "base/common_art_test.h"
+#include "base/file_utils.h"
+#include "base/os.h"
+#include "common_runtime_test.h"
+#include "gtest/gtest.h"
+
 namespace art {
 
-class OatDumpTest : public CommonRuntimeTest {
+// Linking flavor.
+enum class Flavor {
+  kDynamic,  // oatdump(d), dex2oat(d)
+  kStatic,   // oatdump(d)s, dex2oat(d)s
+};
+
+class OatDumpTest : public CommonRuntimeTest, public testing::WithParamInterface<Flavor> {
  protected:
   virtual void SetUp() {
     CommonRuntimeTest::SetUp();
     core_art_location_ = GetCoreArtLocation();
     core_oat_location_ = GetSystemImageFilename(GetCoreOatLocation().c_str(), kRuntimeISA);
     tmp_dir_ = GetScratchDir();
+    if (GetParam() == Flavor::kStatic) {
+      TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS();
+    }
+
+    // Prevent boot image inference to ensure consistent test behavior.
+    unset_bootclasspath_ = std::make_unique<ScopedUnsetEnvironmentVariable>("BOOTCLASSPATH");
   }
 
   virtual void TearDown() {
+    unset_bootclasspath_.reset();
     ClearDirectory(tmp_dir_.c_str(), /*recursive*/ false);
     ASSERT_EQ(rmdir(tmp_dir_.c_str()), 0);
     CommonRuntimeTest::TearDown();
   }
 
-  std::string GetScratchDir() {
+  std::string GetScratchDir() const {
     // ANDROID_DATA needs to be set
     CHECK_NE(static_cast<char*>(nullptr), getenv("ANDROID_DATA"));
     std::string dir = getenv("ANDROID_DATA");
@@ -64,14 +74,11 @@
     return dir;
   }
 
-  // Linking flavor.
-  enum class Flavor {
-    kDynamic,  // oatdump(d), dex2oat(d)
-    kStatic,   // oatdump(d)s, dex2oat(d)s
-  };
-
   // Returns path to the oatdump/dex2oat/dexdump binary.
-  std::string GetExecutableFilePath(const char* name, bool is_debug, bool is_static, bool bitness) {
+  static std::string GetExecutableFilePath(const char* name,
+                                           bool is_debug,
+                                           bool is_static,
+                                           bool bitness) {
     std::string path = GetArtBinDir() + '/' + name;
     if (is_debug) {
       path += 'd';
@@ -85,48 +92,45 @@
     return path;
   }
 
-  std::string GetExecutableFilePath(Flavor flavor, const char* name, bool bitness) {
+  static std::string GetExecutableFilePath(Flavor flavor, const char* name, bool bitness) {
     return GetExecutableFilePath(name, kIsDebugBuild, flavor == Flavor::kStatic, bitness);
   }
 
-  enum Mode {
-    kModeOat,
-    kModeCoreOat,
-    kModeOatWithBootImage,
-    kModeAppImage,
-    kModeArt,
-    kModeSymbolize,
+  enum Args {
+    kArgImage = 1 << 0,      // --image=<boot-image>
+    kArgAppImage = 1 << 1,   // --app-image=<app-image>
+    kArgOatBcp = 1 << 2,     // --oat-file=<bcp-oat-file>
+    kArgDexBcp = 1 << 3,     // --dex-file=<bcp-dex-file>
+    kArgOatApp = 1 << 4,     // --oat-file=<app-oat-file>
+    kArgSymbolize = 1 << 5,  // --symbolize=<bcp-oat-file>
+    kArgDexApp = 1 << 6,     // --dex-file=<app-dex-file>
+
+    // Runtime args.
+    kArgBcp = 1 << 16,        // --runtime-arg -Xbootclasspath:<bcp>
+    kArgBootImage = 1 << 17,  // --boot-image=<boot-image>
+    kArgIsa = 1 << 18,        // --instruction-set=<isa>
   };
 
-  // Display style.
-  enum Display {
-    kListOnly,
-    kListAndCode
+  enum Expects {
+    kExpectImage = 1 << 0,
+    kExpectOat = 1 << 1,
+    kExpectCode = 1 << 2,
+    kExpectBssMappingsForBcp = 1 << 3,
+    kExpectBssOffsetsForBcp = 1 << 4,
   };
 
-  std::string GetAppBaseName() {
+  static std::string GetAppBaseName() {
     // Use ProfileTestMultiDex as it contains references to boot image strings
     // that shall use different code for PIC and non-PIC.
     return "ProfileTestMultiDex";
   }
 
-  void SetAppImageName(const std::string& name) {
-    app_image_name_ = name;
-  }
+  std::string GetAppImageName() const { return tmp_dir_ + "/" + GetAppBaseName() + ".art"; }
 
-  std::string GetAppImageName() {
-    if (app_image_name_.empty()) {
-      app_image_name_ =  tmp_dir_ + "/" + GetAppBaseName() + ".art";
-    }
-    return app_image_name_;
-  }
-
-  std::string GetAppOdexName() {
-    return tmp_dir_ + "/" + GetAppBaseName() + ".odex";
-  }
+  std::string GetAppOdexName() const { return tmp_dir_ + "/" + GetAppBaseName() + ".odex"; }
 
   ::testing::AssertionResult GenerateAppOdexFile(Flavor flavor,
-                                                 const std::vector<std::string>& args) {
+                                                 const std::vector<std::string>& args = {}) const {
     std::string dex2oat_path =
         GetExecutableFilePath(flavor, "dex2oat", /* bitness= */ kIsTargetBuild);
     std::vector<std::string> exec_argv = {
@@ -134,7 +138,7 @@
         "--runtime-arg",
         "-Xms64m",
         "--runtime-arg",
-        "-Xmx512m",
+        "-Xmx64m",
         "--runtime-arg",
         "-Xnorelocate",
         "--runtime-arg",
@@ -145,7 +149,7 @@
         "--instruction-set=" + std::string(GetInstructionSetString(kRuntimeISA)),
         "--dex-file=" + GetTestDexFileName(GetAppBaseName().c_str()),
         "--oat-file=" + GetAppOdexName(),
-        "--compiler-filter=speed"
+        "--compiler-filter=speed",
     };
     exec_argv.insert(exec_argv.end(), args.begin(), args.end());
 
@@ -167,74 +171,77 @@
 
   // Run the test with custom arguments.
   ::testing::AssertionResult Exec(Flavor flavor,
-                                  Mode mode,
-                                  const std::vector<std::string>& args,
-                                  Display display,
-                                  bool expect_failure = false) {
+                                  std::underlying_type_t<Args> args,
+                                  const std::vector<std::string>& extra_args,
+                                  std::underlying_type_t<Expects> expects,
+                                  bool expect_failure = false) const {
     std::string file_path = GetExecutableFilePath(flavor, "oatdump", /* bitness= */ false);
 
     if (!OS::FileExists(file_path.c_str())) {
       return ::testing::AssertionFailure() << file_path << " should be a valid file path";
     }
 
-    // ScratchFile scratch;
-    std::vector<std::string> exec_argv = { file_path };
     std::vector<std::string> expected_prefixes;
-    if (mode == kModeSymbolize) {
-      exec_argv.push_back("--symbolize=" + core_oat_location_);
-      exec_argv.push_back("--output=" + core_oat_location_ + ".symbolize");
-    } else {
+    if ((expects & kExpectImage) != 0) {
+      expected_prefixes.push_back("IMAGE LOCATION:");
+      expected_prefixes.push_back("IMAGE BEGIN:");
+      expected_prefixes.push_back("kDexCaches:");
+    }
+    if ((expects & kExpectOat) != 0) {
       expected_prefixes.push_back("LOCATION:");
       expected_prefixes.push_back("MAGIC:");
       expected_prefixes.push_back("DEX FILE COUNT:");
-      if (display == kListAndCode) {
-        // Code and dex code do not show up if list only.
-        expected_prefixes.push_back("DEX CODE:");
-        expected_prefixes.push_back("CODE:");
-        expected_prefixes.push_back("StackMap");
-      }
-      if (mode == kModeArt) {
-        exec_argv.push_back("--runtime-arg");
-        exec_argv.push_back(GetClassPathOption("-Xbootclasspath:", GetLibCoreDexFileNames()));
-        exec_argv.push_back("--runtime-arg");
-        exec_argv.push_back(
-            GetClassPathOption("-Xbootclasspath-locations:", GetLibCoreDexLocations()));
-        exec_argv.push_back("--image=" + core_art_location_);
-        exec_argv.push_back("--instruction-set=" + std::string(
-            GetInstructionSetString(kRuntimeISA)));
-        expected_prefixes.push_back("IMAGE LOCATION:");
-        expected_prefixes.push_back("IMAGE BEGIN:");
-        expected_prefixes.push_back("kDexCaches:");
-      } else if (mode == kModeOatWithBootImage) {
-        exec_argv.push_back("--runtime-arg");
-        exec_argv.push_back(GetClassPathOption("-Xbootclasspath:", GetLibCoreDexFileNames()));
-        exec_argv.push_back("--runtime-arg");
-        exec_argv.push_back(
-            GetClassPathOption("-Xbootclasspath-locations:", GetLibCoreDexLocations()));
-        exec_argv.push_back("--boot-image=" + GetCoreArtLocation());
-        exec_argv.push_back("--instruction-set=" + std::string(
-            GetInstructionSetString(kRuntimeISA)));
-        exec_argv.push_back("--oat-file=" + GetAppOdexName());
-      } else if (mode == kModeAppImage) {
-        exec_argv.push_back("--runtime-arg");
-        exec_argv.push_back(GetClassPathOption("-Xbootclasspath:", GetLibCoreDexFileNames()));
-        exec_argv.push_back("--runtime-arg");
-        exec_argv.push_back(
-            GetClassPathOption("-Xbootclasspath-locations:", GetLibCoreDexLocations()));
-        exec_argv.push_back("--image=" + GetCoreArtLocation());
-        exec_argv.push_back("--instruction-set=" + std::string(
-            GetInstructionSetString(kRuntimeISA)));
-        exec_argv.push_back("--app-oat=" + GetAppOdexName());
-        exec_argv.push_back("--app-image=" + GetAppImageName());
-      } else if (mode == kModeCoreOat) {
-        exec_argv.push_back("--oat-file=" + core_oat_location_);
-        exec_argv.push_back("--dex-file=" + GetLibCoreDexFileNames()[0]);
-      } else {
-        CHECK_EQ(static_cast<size_t>(mode), static_cast<size_t>(kModeOat));
-        exec_argv.push_back("--oat-file=" + GetAppOdexName());
-      }
     }
-    exec_argv.insert(exec_argv.end(), args.begin(), args.end());
+    if ((expects & kExpectCode) != 0) {
+      // Code and dex code do not show up if list only.
+      expected_prefixes.push_back("DEX CODE:");
+      expected_prefixes.push_back("CODE:");
+      expected_prefixes.push_back("StackMap");
+    }
+    if ((expects & kExpectBssMappingsForBcp) != 0) {
+      expected_prefixes.push_back("Entries for BCP DexFile");
+    }
+    if ((expects & kExpectBssOffsetsForBcp) != 0) {
+      expected_prefixes.push_back("Offsets for BCP DexFile");
+    }
+
+    std::vector<std::string> exec_argv = {file_path};
+    if ((args & kArgSymbolize) != 0) {
+      exec_argv.push_back("--symbolize=" + core_oat_location_);
+      exec_argv.push_back("--output=" + core_oat_location_ + ".symbolize");
+    }
+    if ((args & kArgBcp) != 0) {
+      exec_argv.push_back("--runtime-arg");
+      exec_argv.push_back(GetClassPathOption("-Xbootclasspath:", GetLibCoreDexFileNames()));
+      exec_argv.push_back("--runtime-arg");
+      exec_argv.push_back(
+          GetClassPathOption("-Xbootclasspath-locations:", GetLibCoreDexLocations()));
+    }
+    if ((args & kArgIsa) != 0) {
+      exec_argv.push_back("--instruction-set=" + std::string(GetInstructionSetString(kRuntimeISA)));
+    }
+    if ((args & kArgBootImage) != 0) {
+      exec_argv.push_back("--boot-image=" + GetCoreArtLocation());
+    }
+    if ((args & kArgImage) != 0) {
+      exec_argv.push_back("--image=" + GetCoreArtLocation());
+    }
+    if ((args & kArgAppImage) != 0) {
+      exec_argv.push_back("--app-image=" + GetAppImageName());
+    }
+    if ((args & kArgOatBcp) != 0) {
+      exec_argv.push_back("--oat-file=" + core_oat_location_);
+    }
+    if ((args & kArgDexBcp) != 0) {
+      exec_argv.push_back("--dex-file=" + GetLibCoreDexFileNames()[0]);
+    }
+    if ((args & kArgOatApp) != 0) {
+      exec_argv.push_back("--oat-file=" + GetAppOdexName());
+    }
+    if ((args & kArgDexApp) != 0) {
+      exec_argv.push_back("--dex-file=" + GetTestDexFileName(GetAppBaseName().c_str()));
+    }
+    exec_argv.insert(exec_argv.end(), extra_args.begin(), extra_args.end());
 
     std::vector<bool> found(expected_prefixes.size(), false);
     auto line_handle_fn = [&found, &expected_prefixes](const char* line, size_t line_len) {
@@ -353,7 +360,7 @@
       return ::testing::AssertionFailure() << "Expected failure";
     }
 
-    if (mode == kModeSymbolize) {
+    if ((args & kArgSymbolize) != 0) {
       EXPECT_EQ(total, 0u);
     } else {
       EXPECT_GT(total, 0u);
@@ -376,11 +383,11 @@
   }
 
   std::string tmp_dir_;
-  std::string app_image_name_;
 
  private:
   std::string core_art_location_;
   std::string core_oat_location_;
+  std::unique_ptr<ScopedUnsetEnvironmentVariable> unset_bootclasspath_;
 };
 
 }  // namespace art
diff --git a/odrefresh/Android.bp b/odrefresh/Android.bp
index 809e18d..8b6ea8d 100644
--- a/odrefresh/Android.bp
+++ b/odrefresh/Android.bp
@@ -41,10 +41,9 @@
         "art-odrefresh-operator-srcs",
     ],
     shared_libs: [
-        "libartpalette",
-        "libarttools", // Contains "libc++fs".
         "libbase",
         "liblog",
+        "libselinux",
     ],
     static_libs: [
         "libmodules-utils-build",
@@ -65,6 +64,7 @@
     ],
     srcs: ["odrefresh_main.cc"],
     shared_libs: [
+        "libarttools", // Contains "libc++fs".
         "libdexfile",
     ],
     target: {
@@ -168,7 +168,10 @@
                 "odr_metrics_record.cc",
                 "odr_statslog_android.cc",
             ],
-            shared_libs: ["libstatssocket"],
+            shared_libs: [
+                "libstatspull",
+                "libstatssocket",
+            ],
         },
         host: {
             srcs: ["odr_statslog_host.cc"],
@@ -208,7 +211,7 @@
     ],
     host_supported: false,
     shared_libs: [
-        "libdexfiled",
+        "libarttools",
     ],
     // The test config template is needed even though it's not used by the test
     // runner. Otherwise, Soong will generate a test config, which is adding
@@ -225,8 +228,8 @@
         "art_standalone_gtest_defaults",
         "art_odrefresh_tests_defaults",
     ],
-    shared_libs: [
-        "libdexfile",
+    static_libs: [
+        "libarttools",
     ],
 }
 
diff --git a/odrefresh/odr_common.cc b/odrefresh/odr_common.cc
index 16a6af5..e1094c2 100644
--- a/odrefresh/odr_common.cc
+++ b/odrefresh/odr_common.cc
@@ -88,8 +88,10 @@
       &action);
 }
 
-bool CheckBuildUserfaultFdGc(bool build_enable_uffd_gc, bool kernel_supports_uffd) {
-  bool runtime_uses_uffd_gc = kernel_supports_uffd;
+bool CheckBuildUserfaultFdGc(bool build_enable_uffd_gc,
+                             bool is_at_most_u,
+                             bool kernel_supports_uffd) {
+  bool runtime_uses_uffd_gc = (build_enable_uffd_gc || is_at_most_u) && kernel_supports_uffd;
   return build_enable_uffd_gc == runtime_uses_uffd_gc;
 }
 
diff --git a/odrefresh/odr_common.h b/odrefresh/odr_common.h
index 2421e41..621f983 100644
--- a/odrefresh/odr_common.h
+++ b/odrefresh/odr_common.h
@@ -45,7 +45,9 @@
 void SystemPropertyForeach(std::function<void(const char* name, const char* value)> action);
 
 // Returns true if the build-time UFFD GC matches the runtime's choice.
-bool CheckBuildUserfaultFdGc(bool build_enable_uffd_gc, bool kernel_supports_uffd);
+bool CheckBuildUserfaultFdGc(bool build_enable_uffd_gc,
+                             bool is_at_most_u,
+                             bool kernel_supports_uffd);
 
 }  // namespace odrefresh
 }  // namespace art
diff --git a/odrefresh/odr_common_test.cc b/odrefresh/odr_common_test.cc
index 77becad..0cf34bd 100644
--- a/odrefresh/odr_common_test.cc
+++ b/odrefresh/odr_common_test.cc
@@ -57,13 +57,21 @@
 
 TEST(OdrCommonTest, CheckBuildUserfaultFdGc) {
   EXPECT_TRUE(CheckBuildUserfaultFdGc(
-      /*build_enable_uffd_gc=*/false, /*kernel_supports_uffd=*/false));
+      /*build_enable_uffd_gc=*/false, /*is_at_most_u=*/false, /*kernel_supports_uffd=*/false));
   EXPECT_FALSE(CheckBuildUserfaultFdGc(
-      /*build_enable_uffd_gc=*/true, /*kernel_supports_uffd=*/false));
-  EXPECT_FALSE(CheckBuildUserfaultFdGc(
-      /*build_enable_uffd_gc=*/false, /*kernel_supports_uffd=*/true));
+      /*build_enable_uffd_gc=*/true, /*is_at_most_u=*/false, /*kernel_supports_uffd=*/false));
   EXPECT_TRUE(CheckBuildUserfaultFdGc(
-      /*build_enable_uffd_gc=*/true, /*kernel_supports_uffd=*/true));
+      /*build_enable_uffd_gc=*/false, /*is_at_most_u=*/true, /*kernel_supports_uffd=*/false));
+  EXPECT_FALSE(CheckBuildUserfaultFdGc(
+      /*build_enable_uffd_gc=*/true, /*is_at_most_u=*/true, /*kernel_supports_uffd=*/false));
+  EXPECT_TRUE(CheckBuildUserfaultFdGc(
+      /*build_enable_uffd_gc=*/false, /*is_at_most_u=*/false, /*kernel_supports_uffd=*/true));
+  EXPECT_TRUE(CheckBuildUserfaultFdGc(
+      /*build_enable_uffd_gc=*/true, /*is_at_most_u=*/false, /*kernel_supports_uffd=*/true));
+  EXPECT_FALSE(CheckBuildUserfaultFdGc(
+      /*build_enable_uffd_gc=*/false, /*is_at_most_u=*/true, /*kernel_supports_uffd=*/true));
+  EXPECT_TRUE(CheckBuildUserfaultFdGc(
+      /*build_enable_uffd_gc=*/true, /*is_at_most_u=*/true, /*kernel_supports_uffd=*/true));
 }
 
 }  // namespace odrefresh
diff --git a/odrefresh/odr_config.h b/odrefresh/odr_config.h
index 5aee588..0e937d4 100644
--- a/odrefresh/odr_config.h
+++ b/odrefresh/odr_config.h
@@ -72,7 +72,9 @@
 // default value should not trigger re-compilation. This is to comply with the phenotype flag
 // requirement (go/platform-experiments-flags#pre-requisites).
 const android::base::NoDestructor<std::vector<SystemPropertyConfig>> kSystemProperties{
-    {SystemPropertyConfig{.name = "persist.device_config.runtime_native_boot.force_disable_uffd_gc",
+    {SystemPropertyConfig{.name = "persist.device_config.runtime_native_boot.enable_uffd_gc_2",
+                          .default_value = "false"},
+     SystemPropertyConfig{.name = "persist.device_config.runtime_native_boot.force_disable_uffd_gc",
                           .default_value = "false"},
      SystemPropertyConfig{.name = kSystemPropertySystemServerCompilerFilterOverride,
                           .default_value = ""},
diff --git a/odrefresh/odr_fs_utils.cc b/odrefresh/odr_fs_utils.cc
index 3ed8021..2a77e52 100644
--- a/odrefresh/odr_fs_utils.cc
+++ b/odrefresh/odr_fs_utils.cc
@@ -43,7 +43,7 @@
 // Callback for use with nftw(3) to assist with clearing files and sub-directories.
 // This method removes files and directories below the top-level directory passed to nftw().
 static int NftwCleanUpCallback(const char* fpath,
-                               const struct stat* sb ATTRIBUTE_UNUSED,
+                               [[maybe_unused]] const struct stat* sb,
                                int typeflag,
                                struct FTW* ftwbuf) {
   switch (typeflag) {
diff --git a/odrefresh/odrefresh.cc b/odrefresh/odrefresh.cc
index 85fc9d1..f515aef 100644
--- a/odrefresh/odrefresh.cc
+++ b/odrefresh/odrefresh.cc
@@ -57,6 +57,7 @@
 
 #include "android-base/chrono_utils.h"
 #include "android-base/file.h"
+#include "android-base/function_ref.h"
 #include "android-base/logging.h"
 #include "android-base/macros.h"
 #include "android-base/parseint.h"
@@ -84,8 +85,7 @@
 #include "odr_fs_utils.h"
 #include "odr_metrics.h"
 #include "odrefresh/odrefresh.h"
-#include "palette/palette.h"
-#include "palette/palette_types.h"
+#include "selinux/selinux.h"
 #include "tools/cmdline_builder.h"
 
 namespace art {
@@ -107,6 +107,7 @@
 using ::android::base::StringPrintf;
 using ::android::base::Timer;
 using ::android::modules::sdklevel::IsAtLeastU;
+using ::android::modules::sdklevel::IsAtLeastV;
 using ::art::tools::CmdlineBuilder;
 
 // Name of cache info file in the ART Apex artifact cache.
@@ -192,6 +193,28 @@
   return true;
 }
 
+Result<std::string> CreateStagingDirectory() {
+  std::string staging_dir = GetArtApexData() + "/staging";
+
+  std::error_code ec;
+  if (std::filesystem::exists(staging_dir, ec)) {
+    if (!std::filesystem::remove_all(staging_dir, ec)) {
+      return Errorf(
+          "Could not remove existing staging directory '{}': {}", staging_dir, ec.message());
+    }
+  }
+
+  if (mkdir(staging_dir.c_str(), S_IRWXU) != 0) {
+    return ErrnoErrorf("Could not create staging directory '{}'", staging_dir);
+  }
+
+  if (setfilecon(staging_dir.c_str(), "u:object_r:apex_art_staging_data_file:s0") != 0) {
+    return ErrnoErrorf("Could not set label on staging directory '{}'", staging_dir);
+  }
+
+  return staging_dir;
+}
+
 // Gets the `ApexInfo` associated with the currently active ART APEX.
 std::optional<apex::ApexInfo> GetArtApexInfo(const std::vector<apex::ApexInfo>& info_list) {
   auto it = std::find_if(info_list.begin(), info_list.end(), [](const apex::ApexInfo& info) {
@@ -308,25 +331,18 @@
       return {};
     }
 
-    std::vector<uint32_t> checksums;
-    std::vector<std::string> dex_locations;
+    std::optional<uint32_t> checksum;
     std::string error_msg;
-    if (!ArtDexFileLoader::GetMultiDexChecksums(
-            actual_path.c_str(), &checksums, &dex_locations, &error_msg)) {
-      LOG(ERROR) << "Failed to get multi-dex checksums: " << error_msg;
+    ArtDexFileLoader dex_loader(actual_path);
+    if (!dex_loader.GetMultiDexChecksum(&checksum, &error_msg)) {
+      LOG(ERROR) << "Failed to get multi-dex checksum: " << error_msg;
       return {};
     }
 
-    std::ostringstream oss;
-    for (size_t i = 0; i < checksums.size(); ++i) {
-      if (i != 0) {
-        oss << ';';
-      }
-      oss << StringPrintf("%08x", checksums[i]);
-    }
-    const std::string checksum = oss.str();
+    const std::string checksum_str =
+        checksum.has_value() ? StringPrintf("%08x", checksum.value()) : std::string();
 
-    Result<T> component = custom_generator(path, static_cast<uint64_t>(sb.st_size), checksum);
+    Result<T> component = custom_generator(path, static_cast<uint64_t>(sb.st_size), checksum_str);
     if (!component.ok()) {
       LOG(ERROR) << "Failed to generate component: " << component.error();
       return {};
@@ -434,9 +450,15 @@
   args.Add("--strip");
 }
 
-void AddDex2OatInstructionSet(/*inout*/ CmdlineBuilder& args, InstructionSet isa) {
+void AddDex2OatInstructionSet(/*inout*/ CmdlineBuilder& args,
+                              InstructionSet isa,
+                              const OdrSystemProperties& system_properties) {
   const char* isa_str = GetInstructionSetString(isa);
   args.Add("--instruction-set=%s", isa_str);
+  std::string features_prop = ART_FORMAT("dalvik.vm.isa.{}.features", isa_str);
+  args.AddIfNonEmpty("--instruction-set-features=%s", system_properties.GetOrEmpty(features_prop));
+  std::string variant_prop = ART_FORMAT("dalvik.vm.isa.{}.variant", isa_str);
+  args.AddIfNonEmpty("--instruction-set-variant=%s", system_properties.GetOrEmpty(variant_prop));
 }
 
 // Returns true if any profile has been added, or false if no profile exists, or error if any error
@@ -488,7 +510,7 @@
                             const std::string& cache_info_filename) {
   std::unique_ptr<File> cache_info_file(OS::OpenFileForReading(cache_info_filename.c_str()));
   if (cache_info_file == nullptr) {
-    return ErrnoErrorf("Failed to open a cache info file '{}'", cache_info_file);
+    return ErrnoErrorf("Failed to open a cache info file '{}'", cache_info_filename);
   }
 
   args.Add("--cache-info-fd=%d", cache_info_file->Fd());
@@ -528,7 +550,7 @@
       }
     }
     CHECK(!artifact_dir.empty());
-    std::string image_path = artifact_dir + "/" + basename;
+    std::string image_path = ART_FORMAT("{}/{}", artifact_dir, basename);
     image_path = GetSystemImageFilename(image_path.c_str(), isa);
     std::unique_ptr<File> image_file(OS::OpenFileForReading(image_path.c_str()));
     if (image_file != nullptr) {
@@ -660,15 +682,18 @@
 OnDeviceRefresh::OnDeviceRefresh(const OdrConfig& config)
     : OnDeviceRefresh(config,
                       config.GetArtifactDirectory() + "/" + kCacheInfoFile,
-                      std::make_unique<ExecUtils>()) {}
+                      std::make_unique<ExecUtils>(),
+                      CheckCompilationSpace) {}
 
 OnDeviceRefresh::OnDeviceRefresh(const OdrConfig& config,
                                  const std::string& cache_info_filename,
-                                 std::unique_ptr<ExecUtils> exec_utils)
-    : config_{config},
-      cache_info_filename_{cache_info_filename},
-      start_time_{time(nullptr)},
-      exec_utils_{std::move(exec_utils)} {
+                                 std::unique_ptr<ExecUtils> exec_utils,
+                                 android::base::function_ref<bool()> check_compilation_space)
+    : config_(config),
+      cache_info_filename_(cache_info_filename),
+      start_time_(time(nullptr)),
+      exec_utils_(std::move(exec_utils)),
+      check_compilation_space_(check_compilation_space) {
   // Updatable APEXes should not have DEX files in the DEX2OATBOOTCLASSPATH. At the time of
   // writing i18n is a non-updatable APEX and so does appear in the DEX2OATBOOTCLASSPATH.
   dex2oat_boot_classpath_jars_ = Split(config_.GetDex2oatBootClasspath(), ":");
@@ -756,7 +781,9 @@
 
   std::vector<art_apex::KeyValuePair> system_properties;
   for (const auto& [key, value] : config_.GetSystemProperties()) {
-    system_properties.emplace_back(key, value);
+    if (!art::ContainsElement(kIgnoredSystemProperties, key)) {
+      system_properties.emplace_back(key, value);
+    }
   }
 
   std::optional<std::vector<apex::ApexInfo>> apex_info_list = GetApexInfoList();
@@ -1072,7 +1099,9 @@
   const OdrSystemProperties& system_properties = config_.GetSystemProperties();
 
   for (const auto& [key, value] : system_properties) {
-    checked_properties.insert(key);
+    if (!art::ContainsElement(kIgnoredSystemProperties, key)) {
+      checked_properties.insert(key);
+    }
   }
 
   for (const std::string& name : checked_properties) {
@@ -1092,15 +1121,17 @@
 WARN_UNUSED bool OnDeviceRefresh::CheckBuildUserfaultFdGc() const {
   bool build_enable_uffd_gc =
       config_.GetSystemProperties().GetBool("ro.dalvik.vm.enable_uffd_gc", /*default_value=*/false);
+  bool is_at_most_u = !IsAtLeastV();
   bool kernel_supports_uffd = KernelSupportsUffd();
-  if (!art::odrefresh::CheckBuildUserfaultFdGc(build_enable_uffd_gc, kernel_supports_uffd)) {
-    // Assuming the system property reflects how the dexpreopted boot image was
-    // compiled, and it doesn't agree with runtime support, we need to recompile
-    // it. This happens if we're running on S, T or U, or if the system image
-    // was built with a wrong PRODUCT_ENABLE_UFFD_GC flag.
-    LOG(INFO) << ART_FORMAT(
-        "Userfaultfd GC check failed (build_enable_uffd_gc: {}, kernel_supports_uffd: {}).",
+  if (!art::odrefresh::CheckBuildUserfaultFdGc(
+          build_enable_uffd_gc, is_at_most_u, kernel_supports_uffd)) {
+    // Normally, this should not happen. If this happens, the system image was probably built with a
+    // wrong PRODUCT_ENABLE_UFFD_GC flag.
+    LOG(WARNING) << ART_FORMAT(
+        "Userfaultfd GC check failed (build_enable_uffd_gc: {}, is_at_most_u: {}, "
+        "kernel_supports_uffd: {}).",
         build_enable_uffd_gc,
+        is_at_most_u,
         kernel_supports_uffd);
     return false;
   }
@@ -1622,12 +1653,6 @@
     metrics.SetTrigger(data_result.GetTrigger());
   }
 
-  // If partial compilation is disabled, we should compile everything regardless of what's in
-  // `compilation_options`.
-  if (compilation_required && !config_.GetPartialCompilation()) {
-    return cleanup_and_compile_all();
-  }
-
   // Always keep the cache info.
   checked_artifacts.push_back(cache_info_filename_);
 
@@ -1655,7 +1680,7 @@
 
   AddDex2OatCommonOptions(args);
   AddDex2OatDebugInfo(args);
-  AddDex2OatInstructionSet(args, isa);
+  AddDex2OatInstructionSet(args, isa, config_.GetSystemProperties());
   Result<void> result = AddDex2OatConcurrencyArguments(
       args, config_.GetCompilationOsMode(), config_.GetSystemProperties());
   if (!result.ok()) {
@@ -1824,6 +1849,10 @@
     args.Add("--compiler-filter=%s", kMainlineCompilerFilter);
   }
 
+  const OdrSystemProperties& system_properties = config_.GetSystemProperties();
+  args.AddRuntimeIfNonEmpty("-Xms%s", system_properties.GetOrEmpty("dalvik.vm.image-dex2oat-Xms"))
+      .AddRuntimeIfNonEmpty("-Xmx%s", system_properties.GetOrEmpty("dalvik.vm.image-dex2oat-Xmx"));
+
   return RunDex2oat(
       staging_dir,
       ART_FORMAT("Compiling boot classpath ({}, {})", GetInstructionSetString(isa), debug_name),
@@ -1851,7 +1880,7 @@
         CompilationResult::Error(OdrMetrics::Status::kUnknown, "Minimal boot image requested"));
   }
 
-  if (!CheckCompilationSpace()) {
+  if (!check_compilation_space_()) {
     result.Merge(CompilationResult::Error(OdrMetrics::Status::kNoSpace, "Insufficient space"));
   }
 
@@ -1985,6 +2014,10 @@
     args.Add("--class-loader-context-fds=%s", Join(fds, ':'));
   }
 
+  const OdrSystemProperties& system_properties = config_.GetSystemProperties();
+  args.AddRuntimeIfNonEmpty("-Xms%s", system_properties.GetOrEmpty("dalvik.vm.dex2oat-Xms"))
+      .AddRuntimeIfNonEmpty("-Xmx%s", system_properties.GetOrEmpty("dalvik.vm.dex2oat-Xmx"));
+
   return RunDex2oat(staging_dir,
                     ART_FORMAT("Compiling {}", Basename(dex_file)),
                     isa,
@@ -2005,7 +2038,7 @@
   CompilationResult result = CompilationResult::Ok();
   std::vector<std::string> classloader_context;
 
-  if (!CheckCompilationSpace()) {
+  if (!check_compilation_space_()) {
     LOG(ERROR) << "Compilation of system_server failed: Insufficient space";
     return CompilationResult::Error(OdrMetrics::Status::kNoSpace, "Insufficient space");
   }
@@ -2032,10 +2065,20 @@
 }
 
 WARN_UNUSED ExitCode OnDeviceRefresh::Compile(OdrMetrics& metrics,
-                                              const CompilationOptions& compilation_options) const {
-  const char* staging_dir = nullptr;
+                                              CompilationOptions compilation_options) const {
+  std::string staging_dir;
   metrics.SetStage(OdrMetrics::Stage::kPreparation);
 
+  // If partial compilation is disabled, we should compile everything regardless of what's in
+  // `compilation_options`.
+  if (!config_.GetPartialCompilation()) {
+    compilation_options = CompilationOptions::CompileAll(*this);
+    if (!RemoveArtifactsDirectory()) {
+      metrics.SetStatus(OdrMetrics::Status::kIoError);
+      return ExitCode::kCleanupFailed;
+    }
+  }
+
   if (!EnsureDirectoryExists(config_.GetArtifactDirectory())) {
     LOG(ERROR) << "Failed to prepare artifact directory";
     metrics.SetStatus(errno == EPERM ? OdrMetrics::Status::kDalvikCachePermissionDenied :
@@ -2061,13 +2104,16 @@
   }
 
   if (!config_.GetStagingDir().empty()) {
-    staging_dir = config_.GetStagingDir().c_str();
+    staging_dir = config_.GetStagingDir();
   } else {
     // Create staging area and assign label for generating compilation artifacts.
-    if (PaletteCreateOdrefreshStagingDirectory(&staging_dir) != PALETTE_STATUS_OK) {
+    Result<std::string> res = CreateStagingDirectory();
+    if (!res.ok()) {
+      LOG(ERROR) << res.error().message();
       metrics.SetStatus(OdrMetrics::Status::kStagingFailed);
       return ExitCode::kCleanupFailed;
     }
+    staging_dir = res.value();
   }
 
   std::string error_msg;
@@ -2115,6 +2161,8 @@
   }
 
   if (first_failure.has_value()) {
+    LOG(ERROR) << "Compilation failed, stage: " << first_failure->first
+               << " status: " << first_failure->second;
     metrics.SetStage(first_failure->first);
     metrics.SetStatus(first_failure->second);
 
diff --git a/odrefresh/odrefresh.h b/odrefresh/odrefresh.h
index 9496afe..2bc4076 100644
--- a/odrefresh/odrefresh.h
+++ b/odrefresh/odrefresh.h
@@ -26,6 +26,7 @@
 #include <unordered_set>
 #include <vector>
 
+#include "android-base/function_ref.h"
 #include "android-base/result.h"
 #include "base/os.h"
 #include "com_android_apex.h"
@@ -165,15 +166,15 @@
   // Constructor with injections. For testing and internal use only.
   OnDeviceRefresh(const OdrConfig& config,
                   const std::string& cache_info_filename,
-                  std::unique_ptr<ExecUtils> exec_utils);
+                  std::unique_ptr<ExecUtils> exec_utils,
+                  android::base::function_ref<bool()> check_compilation_space);
 
   // Returns the exit code and specifies what should be compiled in `compilation_options`.
   WARN_UNUSED ExitCode
   CheckArtifactsAreUpToDate(OdrMetrics& metrics,
                             /*out*/ CompilationOptions* compilation_options) const;
 
-  WARN_UNUSED ExitCode Compile(OdrMetrics& metrics,
-                               const CompilationOptions& compilation_options) const;
+  WARN_UNUSED ExitCode Compile(OdrMetrics& metrics, CompilationOptions compilation_options) const;
 
   WARN_UNUSED bool RemoveArtifactsDirectory() const;
 
@@ -385,6 +386,8 @@
 
   std::unique_ptr<ExecUtils> exec_utils_;
 
+  android::base::function_ref<bool()> check_compilation_space_;
+
   DISALLOW_COPY_AND_ASSIGN(OnDeviceRefresh);
 };
 
diff --git a/odrefresh/odrefresh_broken.cc b/odrefresh/odrefresh_broken.cc
index 7b7d095..6657a10 100644
--- a/odrefresh/odrefresh_broken.cc
+++ b/odrefresh/odrefresh_broken.cc
@@ -17,8 +17,7 @@
 #include <android-base/macros.h>
 #include <odrefresh/odrefresh.h>
 
-
-int main(int argc ATTRIBUTE_UNUSED, char** argv ATTRIBUTE_UNUSED) {
+int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) {
   // Return a value that will make odsign just cleanup all potential existing /data
   // artifacts.
   return art::odrefresh::ExitCode::kCleanupFailed;
diff --git a/odrefresh/odrefresh_main.cc b/odrefresh/odrefresh_main.cc
index 2871a99..e482095 100644
--- a/odrefresh/odrefresh_main.cc
+++ b/odrefresh/odrefresh_main.cc
@@ -20,12 +20,14 @@
 #include <string_view>
 #include <unordered_map>
 
+#include "android-base/parsebool.h"
 #include "android-base/properties.h"
 #include "android-base/stringprintf.h"
 #include "android-base/strings.h"
 #include "arch/instruction_set.h"
 #include "base/file_utils.h"
 #include "base/globals.h"
+#include "base/mem_map.h"
 #include "base/stl_util.h"
 #include "odr_common.h"
 #include "odr_compilation_log.h"
@@ -37,11 +39,12 @@
 namespace {
 
 using ::android::base::GetProperty;
+using ::android::base::ParseBool;
+using ::android::base::ParseBoolResult;
 using ::android::base::StartsWith;
 using ::art::odrefresh::CompilationOptions;
 using ::art::odrefresh::ExitCode;
 using ::art::odrefresh::kCheckedSystemPropertyPrefixes;
-using ::art::odrefresh::kIgnoredSystemProperties;
 using ::art::odrefresh::kSystemProperties;
 using ::art::odrefresh::kSystemPropertySystemServerCompilerFilterOverride;
 using ::art::odrefresh::OdrCompilationLog;
@@ -155,8 +158,8 @@
       config->SetStagingDir(value);
     } else if (ArgumentEquals(arg, "--dry-run")) {
       config->SetDryRun();
-    } else if (ArgumentEquals(arg, "--partial-compilation")) {
-      config->SetPartialCompilation(true);
+    } else if (ArgumentMatches(arg, "--partial-compilation=", &value)) {
+      config->SetPartialCompilation(ParseBool(value) == ParseBoolResult::kTrue);
     } else if (ArgumentEquals(arg, "--no-refresh")) {
       config->SetRefresh(false);
     } else if (ArgumentEquals(arg, "--minimal")) {
@@ -201,7 +204,7 @@
       return;
     }
     for (const char* prefix : kCheckedSystemPropertyPrefixes) {
-      if (StartsWith(name, prefix) && !art::ContainsElement(kIgnoredSystemProperties, name)) {
+      if (StartsWith(name, prefix)) {
         (*system_properties)[name] = value;
       }
     }
@@ -257,14 +260,13 @@
   // by others and prevents system_server from loading generated artifacts.
   umask(S_IWGRP | S_IWOTH);
 
+  // Explicitly initialize logging (b/201042799).
+  android::base::InitLogging(argv, android::base::LogdLogger(android::base::SYSTEM));
+
   OdrConfig config(argv[0]);
   int n = InitializeConfig(argc, argv, &config);
 
-  // Explicitly initialize logging (b/201042799).
-  // But not in CompOS mode - logd doesn't exist in Microdroid (b/265153235).
-  if (!config.GetCompilationOsMode()) {
-    android::base::InitLogging(argv, android::base::LogdLogger(android::base::SYSTEM));
-  }
+  art::MemMap::Init();  // Needed by DexFileLoader.
 
   argv += n;
   argc -= n;
@@ -294,6 +296,11 @@
       metrics.SetEnabled(exit_code != ExitCode::kOkay);
       return exit_code;
     }
+    if (config.GetSystemProperties().GetBool("dalvik.vm.disable-odrefresh",
+                                             /*default_value=*/false)) {
+      LOG(INFO) << "Compilation skipped because it's disabled by system property";
+      return ExitCode::kOkay;
+    }
     OdrCompilationLog compilation_log;
     if (!compilation_log.ShouldAttemptCompile(metrics.GetTrigger())) {
       LOG(INFO) << "Compilation skipped because it was attempted recently";
diff --git a/odrefresh/odrefresh_test.cc b/odrefresh/odrefresh_test.cc
index 5ee92a7..ae2cb3f 100644
--- a/odrefresh/odrefresh_test.cc
+++ b/odrefresh/odrefresh_test.cc
@@ -235,8 +235,10 @@
 
     metrics_ = std::make_unique<OdrMetrics>(dalvik_cache_dir_);
     cache_info_xml_ = dalvik_cache_dir_ + "/cache-info.xml";
-    odrefresh_ = std::make_unique<OnDeviceRefresh>(
-        config_, cache_info_xml_, std::move(mock_exec_utils));
+    odrefresh_ = std::make_unique<OnDeviceRefresh>(config_,
+                                                   cache_info_xml_,
+                                                   std::move(mock_exec_utils),
+                                                   /*check_compilation_space=*/[] { return true; });
   }
 
   void TearDown() override {
@@ -644,22 +646,70 @@
 }
 
 TEST_F(OdRefreshTest, OutputFilesAndIsa) {
+  config_.MutableSystemProperties()->emplace("dalvik.vm.isa.x86_64.features", "foo");
+  config_.MutableSystemProperties()->emplace("dalvik.vm.isa.x86_64.variant", "bar");
+
   EXPECT_CALL(*mock_exec_utils_,
               DoExecAndReturnCode(AllOf(Contains("--instruction-set=x86_64"),
+                                        Contains(Flag("--instruction-set-features=", "foo")),
+                                        Contains(Flag("--instruction-set-variant=", "bar")),
                                         Contains(Flag("--image-fd=", FdOf(_))),
                                         Contains(Flag("--output-vdex-fd=", FdOf(_))),
                                         Contains(Flag("--oat-fd=", FdOf(_))))))
       .Times(2)
-      .WillOnce(Return(0));
+      .WillRepeatedly(Return(0));
 
   EXPECT_CALL(*mock_exec_utils_,
               DoExecAndReturnCode(AllOf(Contains("--instruction-set=x86_64"),
+                                        Contains(Flag("--instruction-set-features=", "foo")),
+                                        Contains(Flag("--instruction-set-variant=", "bar")),
                                         Contains(Flag("--app-image-fd=", FdOf(_))),
                                         Contains(Flag("--output-vdex-fd=", FdOf(_))),
                                         Contains(Flag("--oat-fd=", FdOf(_))))))
       .Times(odrefresh_->AllSystemServerJars().size())
       .WillRepeatedly(Return(0));
 
+  // No instruction set features or variant set for x86.
+  EXPECT_CALL(*mock_exec_utils_,
+              DoExecAndReturnCode(AllOf(Contains("--instruction-set=x86"),
+                                        Not(Contains(Flag("--instruction-set-features=", _))),
+                                        Not(Contains(Flag("--instruction-set-variant=", _))))))
+      .Times(2)
+      .WillRepeatedly(Return(0));
+
+  EXPECT_EQ(odrefresh_->Compile(
+                *metrics_,
+                CompilationOptions{
+                    .boot_images_to_generate_for_isas{
+                        {InstructionSet::kX86_64,
+                         {.primary_boot_image = true, .boot_image_mainline_extension = true}},
+                        {InstructionSet::kX86,
+                         {.primary_boot_image = true, .boot_image_mainline_extension = true}}},
+                    .system_server_jars_to_compile = odrefresh_->AllSystemServerJars(),
+                }),
+            ExitCode::kCompilationSuccess);
+}
+
+TEST_F(OdRefreshTest, RuntimeOptions) {
+  config_.MutableSystemProperties()->emplace("dalvik.vm.image-dex2oat-Xms", "10");
+  config_.MutableSystemProperties()->emplace("dalvik.vm.image-dex2oat-Xmx", "20");
+  config_.MutableSystemProperties()->emplace("dalvik.vm.dex2oat-Xms", "30");
+  config_.MutableSystemProperties()->emplace("dalvik.vm.dex2oat-Xmx", "40");
+
+  EXPECT_CALL(*mock_exec_utils_,
+              DoExecAndReturnCode(AllOf(Contains(Flag("--image-fd=", FdOf(_))),
+                                        Contains(Flag("-Xms", "10")),
+                                        Contains(Flag("-Xmx", "20")))))
+      .Times(2)
+      .WillRepeatedly(Return(0));
+
+  EXPECT_CALL(*mock_exec_utils_,
+              DoExecAndReturnCode(AllOf(Contains(Flag("--app-image-fd=", FdOf(_))),
+                                        Contains(Flag("-Xms", "30")),
+                                        Contains(Flag("-Xmx", "40")))))
+      .Times(odrefresh_->AllSystemServerJars().size())
+      .WillRepeatedly(Return(0));
+
   EXPECT_EQ(odrefresh_->Compile(
                 *metrics_,
                 CompilationOptions{
diff --git a/openjdkjvm/OpenjdkJvm.cc b/openjdkjvm/OpenjdkJvm.cc
index da6fc85..c0f874f 100644
--- a/openjdkjvm/OpenjdkJvm.cc
+++ b/openjdkjvm/OpenjdkJvm.cc
@@ -204,8 +204,7 @@
     return dlsym(handle, name);
 }
 
-JNIEXPORT jlong JVM_CurrentTimeMillis(JNIEnv* env ATTRIBUTE_UNUSED,
-                                      jclass clazz ATTRIBUTE_UNUSED) {
+JNIEXPORT jlong JVM_CurrentTimeMillis([[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass clazz) {
     struct timeval tv;
     gettimeofday(&tv, (struct timezone *) nullptr);
     jlong when = tv.tv_sec * 1000LL + tv.tv_usec / 1000;
@@ -216,9 +215,9 @@
  * See the spec of this function in jdk.internal.misc.VM.
  * @return -1 if the system time isn't within  +/- 2^32 seconds from offset_secs
  */
-JNIEXPORT jlong JVM_GetNanoTimeAdjustment(JNIEnv *ATTRIBUTE_UNUSED,
-                                         jclass ATTRIBUTE_UNUSED,
-                                         jlong offset_secs) {
+JNIEXPORT jlong JVM_GetNanoTimeAdjustment([[maybe_unused]] JNIEnv*,
+                                          [[maybe_unused]] jclass,
+                                          jlong offset_secs) {
     struct timeval tv;
     // Note that we don't want the elapsed time here, but the system clock.
     // gettimeofday() doesn't provide nanosecond-level precision.
@@ -388,19 +387,21 @@
   }
 }
 
-JNIEXPORT void JVM_Yield(JNIEnv* env ATTRIBUTE_UNUSED, jclass threadClass ATTRIBUTE_UNUSED) {
+JNIEXPORT void JVM_Yield([[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass threadClass) {
   sched_yield();
 }
 
-JNIEXPORT void JVM_Sleep(JNIEnv* env, jclass threadClass ATTRIBUTE_UNUSED,
-                         jobject java_lock, jlong millis) {
+JNIEXPORT void JVM_Sleep(JNIEnv* env,
+                         [[maybe_unused]] jclass threadClass,
+                         jobject java_lock,
+                         jlong millis) {
   art::ScopedFastNativeObjectAccess soa(env);
   art::ObjPtr<art::mirror::Object> lock = soa.Decode<art::mirror::Object>(java_lock);
   art::Monitor::Wait(
       art::Thread::Current(), lock.Ptr(), millis, 0, true, art::ThreadState::kSleeping);
 }
 
-JNIEXPORT jobject JVM_CurrentThread(JNIEnv* env, jclass unused ATTRIBUTE_UNUSED) {
+JNIEXPORT jobject JVM_CurrentThread(JNIEnv* env, [[maybe_unused]] jclass unused) {
   art::ScopedFastNativeObjectAccess soa(env);
   return soa.AddLocalReference<jobject>(soa.Self()->GetPeer());
 }
@@ -425,7 +426,7 @@
   }
 }
 
-JNIEXPORT jboolean JVM_HoldsLock(JNIEnv* env, jclass unused ATTRIBUTE_UNUSED, jobject jobj) {
+JNIEXPORT jboolean JVM_HoldsLock(JNIEnv* env, [[maybe_unused]] jclass unused, jobject jobj) {
   art::ScopedObjectAccess soa(env);
   art::ObjPtr<art::mirror::Object> object = soa.Decode<art::mirror::Object>(jobj);
   if (object == nullptr) {
@@ -436,20 +437,21 @@
 }
 
 JNIEXPORT __attribute__((noreturn)) void JVM_SetNativeThreadName(
-    JNIEnv* env ATTRIBUTE_UNUSED,
-    jobject jthread ATTRIBUTE_UNUSED,
-    jstring java_name ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] JNIEnv* env,
+    [[maybe_unused]] jobject jthread,
+    [[maybe_unused]] jstring java_name) {
   UNIMPLEMENTED(FATAL) << "JVM_SetNativeThreadName is not implemented";
   UNREACHABLE();
 }
 
-JNIEXPORT __attribute__((noreturn)) jint JVM_IHashCode(JNIEnv* env ATTRIBUTE_UNUSED,
-                             jobject javaObject ATTRIBUTE_UNUSED) {
+JNIEXPORT __attribute__((noreturn)) jint JVM_IHashCode([[maybe_unused]] JNIEnv* env,
+                                                       [[maybe_unused]] jobject javaObject) {
   UNIMPLEMENTED(FATAL) << "JVM_IHashCode is not implemented";
   UNREACHABLE();
 }
 
-JNIEXPORT __attribute__((noreturn)) jlong JVM_NanoTime(JNIEnv* env ATTRIBUTE_UNUSED, jclass unused ATTRIBUTE_UNUSED) {
+JNIEXPORT __attribute__((noreturn)) jlong JVM_NanoTime([[maybe_unused]] JNIEnv* env,
+                                                       [[maybe_unused]] jclass unused) {
   UNIMPLEMENTED(FATAL) << "JVM_NanoTime is not implemented";
   UNREACHABLE();
 }
@@ -461,17 +463,18 @@
   UNREACHABLE();
 }
 
-JNIEXPORT __attribute__((noreturn)) jint JVM_FindSignal(const char* name ATTRIBUTE_UNUSED) {
+JNIEXPORT __attribute__((noreturn)) jint JVM_FindSignal([[maybe_unused]] const char* name) {
   LOG(FATAL) << "JVM_FindSignal is not implemented";
   UNREACHABLE();
 }
 
-JNIEXPORT __attribute__((noreturn)) void* JVM_RegisterSignal(jint signum ATTRIBUTE_UNUSED, void* handler ATTRIBUTE_UNUSED) {
+JNIEXPORT __attribute__((noreturn)) void* JVM_RegisterSignal([[maybe_unused]] jint signum,
+                                                             [[maybe_unused]] void* handler) {
   LOG(FATAL) << "JVM_RegisterSignal is not implemented";
   UNREACHABLE();
 }
 
-JNIEXPORT __attribute__((noreturn)) jboolean JVM_RaiseSignal(jint signum ATTRIBUTE_UNUSED) {
+JNIEXPORT __attribute__((noreturn)) jboolean JVM_RaiseSignal([[maybe_unused]] jint signum) {
   LOG(FATAL) << "JVM_RaiseSignal is not implemented";
   UNREACHABLE();
 }
diff --git a/openjdkjvmti/Android.bp b/openjdkjvmti/Android.bp
index 98cb466..cdf2989 100644
--- a/openjdkjvmti/Android.bp
+++ b/openjdkjvmti/Android.bp
@@ -110,7 +110,6 @@
     defaults: ["libopenjdkjvmti_defaults"],
     shared_libs: [
         "libart",
-        "libart-compiler",
         "libdexfile",
         "libartbase",
     ],
@@ -129,7 +128,6 @@
     ],
     shared_libs: [
         "libartd",
-        "libartd-compiler",
         "libdexfiled",
         "libartbased",
     ],
diff --git a/openjdkjvmti/OpenjdkJvmTi.cc b/openjdkjvmti/OpenjdkJvmTi.cc
index 276b3a8..1e76368 100644
--- a/openjdkjvmti/OpenjdkJvmTi.cc
+++ b/openjdkjvmti/OpenjdkJvmTi.cc
@@ -472,9 +472,9 @@
 
   static jvmtiError IterateOverObjectsReachableFromObject(
       jvmtiEnv* env,
-      jobject object ATTRIBUTE_UNUSED,
-      jvmtiObjectReferenceCallback object_reference_callback ATTRIBUTE_UNUSED,
-      const void* user_data ATTRIBUTE_UNUSED) {
+      [[maybe_unused]] jobject object,
+      [[maybe_unused]] jvmtiObjectReferenceCallback object_reference_callback,
+      [[maybe_unused]] const void* user_data) {
     ENSURE_VALID_ENV(env);
     ENSURE_HAS_CAP(env, can_tag_objects);
     return ERR(NOT_IMPLEMENTED);
@@ -482,19 +482,19 @@
 
   static jvmtiError IterateOverReachableObjects(
       jvmtiEnv* env,
-      jvmtiHeapRootCallback heap_root_callback ATTRIBUTE_UNUSED,
-      jvmtiStackReferenceCallback stack_ref_callback ATTRIBUTE_UNUSED,
-      jvmtiObjectReferenceCallback object_ref_callback ATTRIBUTE_UNUSED,
-      const void* user_data ATTRIBUTE_UNUSED) {
+      [[maybe_unused]] jvmtiHeapRootCallback heap_root_callback,
+      [[maybe_unused]] jvmtiStackReferenceCallback stack_ref_callback,
+      [[maybe_unused]] jvmtiObjectReferenceCallback object_ref_callback,
+      [[maybe_unused]] const void* user_data) {
     ENSURE_VALID_ENV(env);
     ENSURE_HAS_CAP(env, can_tag_objects);
     return ERR(NOT_IMPLEMENTED);
   }
 
   static jvmtiError IterateOverHeap(jvmtiEnv* env,
-                                    jvmtiHeapObjectFilter object_filter ATTRIBUTE_UNUSED,
-                                    jvmtiHeapObjectCallback heap_object_callback ATTRIBUTE_UNUSED,
-                                    const void* user_data ATTRIBUTE_UNUSED) {
+                                    [[maybe_unused]] jvmtiHeapObjectFilter object_filter,
+                                    [[maybe_unused]] jvmtiHeapObjectCallback heap_object_callback,
+                                    [[maybe_unused]] const void* user_data) {
     ENSURE_VALID_ENV(env);
     ENSURE_HAS_CAP(env, can_tag_objects);
     return ERR(NOT_IMPLEMENTED);
@@ -730,10 +730,10 @@
   }
 
   static jvmtiError GetConstantPool(jvmtiEnv* env,
-                                    jclass klass ATTRIBUTE_UNUSED,
-                                    jint* constant_pool_count_ptr ATTRIBUTE_UNUSED,
-                                    jint* constant_pool_byte_count_ptr ATTRIBUTE_UNUSED,
-                                    unsigned char** constant_pool_bytes_ptr ATTRIBUTE_UNUSED) {
+                                    [[maybe_unused]] jclass klass,
+                                    [[maybe_unused]] jint* constant_pool_count_ptr,
+                                    [[maybe_unused]] jint* constant_pool_byte_count_ptr,
+                                    [[maybe_unused]] unsigned char** constant_pool_bytes_ptr) {
     ENSURE_VALID_ENV(env);
     ENSURE_HAS_CAP(env, can_get_constant_pool);
     return ERR(NOT_IMPLEMENTED);
@@ -926,15 +926,15 @@
     return MethodUtil::IsMethodObsolete(env, method, is_obsolete_ptr);
   }
 
-  static jvmtiError SetNativeMethodPrefix(jvmtiEnv* env, const char* prefix ATTRIBUTE_UNUSED) {
+  static jvmtiError SetNativeMethodPrefix(jvmtiEnv* env, [[maybe_unused]] const char* prefix) {
     ENSURE_VALID_ENV(env);
     ENSURE_HAS_CAP(env, can_set_native_method_prefix);
     return ERR(NOT_IMPLEMENTED);
   }
 
   static jvmtiError SetNativeMethodPrefixes(jvmtiEnv* env,
-                                            jint prefix_count ATTRIBUTE_UNUSED,
-                                            char** prefixes ATTRIBUTE_UNUSED) {
+                                            [[maybe_unused]] jint prefix_count,
+                                            [[maybe_unused]] char** prefixes) {
     ENSURE_VALID_ENV(env);
     ENSURE_HAS_CAP(env, can_set_native_method_prefix);
     return ERR(NOT_IMPLEMENTED);
@@ -1032,8 +1032,7 @@
                                    mode);
   }
 
-  static jvmtiError GenerateEvents(jvmtiEnv* env,
-                                   jvmtiEvent event_type ATTRIBUTE_UNUSED) {
+  static jvmtiError GenerateEvents(jvmtiEnv* env, [[maybe_unused]] jvmtiEvent event_type) {
     ENSURE_VALID_ENV(env);
     return OK;
   }
@@ -1195,28 +1194,28 @@
   }
 
   static jvmtiError GetCurrentThreadCpuTimerInfo(jvmtiEnv* env,
-                                                 jvmtiTimerInfo* info_ptr ATTRIBUTE_UNUSED) {
+                                                 [[maybe_unused]] jvmtiTimerInfo* info_ptr) {
     ENSURE_VALID_ENV(env);
     ENSURE_HAS_CAP(env, can_get_current_thread_cpu_time);
     return ERR(NOT_IMPLEMENTED);
   }
 
-  static jvmtiError GetCurrentThreadCpuTime(jvmtiEnv* env, jlong* nanos_ptr ATTRIBUTE_UNUSED) {
+  static jvmtiError GetCurrentThreadCpuTime(jvmtiEnv* env, [[maybe_unused]] jlong* nanos_ptr) {
     ENSURE_VALID_ENV(env);
     ENSURE_HAS_CAP(env, can_get_current_thread_cpu_time);
     return ERR(NOT_IMPLEMENTED);
   }
 
   static jvmtiError GetThreadCpuTimerInfo(jvmtiEnv* env,
-                                          jvmtiTimerInfo* info_ptr ATTRIBUTE_UNUSED) {
+                                          [[maybe_unused]] jvmtiTimerInfo* info_ptr) {
     ENSURE_VALID_ENV(env);
     ENSURE_HAS_CAP(env, can_get_thread_cpu_time);
     return ERR(NOT_IMPLEMENTED);
   }
 
   static jvmtiError GetThreadCpuTime(jvmtiEnv* env,
-                                     jthread thread ATTRIBUTE_UNUSED,
-                                     jlong* nanos_ptr ATTRIBUTE_UNUSED) {
+                                     [[maybe_unused]] jthread thread,
+                                     [[maybe_unused]] jlong* nanos_ptr) {
     ENSURE_VALID_ENV(env);
     ENSURE_HAS_CAP(env, can_get_thread_cpu_time);
     return ERR(NOT_IMPLEMENTED);
diff --git a/openjdkjvmti/alloc_manager.cc b/openjdkjvmti/alloc_manager.cc
index 5910073..b20e098 100644
--- a/openjdkjvmti/alloc_manager.cc
+++ b/openjdkjvmti/alloc_manager.cc
@@ -198,9 +198,8 @@
   // Force every thread to either be suspended or pass through a barrier.
   art::ScopedThreadSuspension sts(self, art::ThreadState::kSuspended);
   art::Barrier barrier(0);
-  art::FunctionClosure fc([&](art::Thread* thr ATTRIBUTE_UNUSED) {
-    barrier.Pass(art::Thread::Current());
-  });
+  art::FunctionClosure fc(
+      [&]([[maybe_unused]] art::Thread* thr) { barrier.Pass(art::Thread::Current()); });
   size_t requested = art::Runtime::Current()->GetThreadList()->RunCheckpoint(&fc);
   barrier.Increment(self, requested);
 }
diff --git a/openjdkjvmti/deopt_manager.cc b/openjdkjvmti/deopt_manager.cc
index c01713e..6583e82 100644
--- a/openjdkjvmti/deopt_manager.cc
+++ b/openjdkjvmti/deopt_manager.cc
@@ -52,7 +52,7 @@
 #include "mirror/class-inl.h"
 #include "mirror/object_array-inl.h"
 #include "nativehelper/scoped_local_ref.h"
-#include "oat_file_manager.h"
+#include "oat/oat_file_manager.h"
 #include "read_barrier_config.h"
 #include "runtime_callbacks.h"
 #include "scoped_thread_state_change-inl.h"
@@ -516,9 +516,8 @@
   // Prepare the stack so methods can be deoptimized as and when required.
   // This by itself doesn't cause any methods to deoptimize but enables
   // deoptimization on demand.
-  art::Runtime::Current()->GetInstrumentation()->InstrumentThreadStack(
-      target,
-      /* deopt_all_frames= */ false);
+  art::Runtime::Current()->GetInstrumentation()->InstrumentThreadStack(target,
+                                                                       /* force_deopt= */ false);
 }
 
 extern DeoptManager* gDeoptManager;
diff --git a/openjdkjvmti/events-inl.h b/openjdkjvmti/events-inl.h
index 92cfbc9..1e309b4 100644
--- a/openjdkjvmti/events-inl.h
+++ b/openjdkjvmti/events-inl.h
@@ -360,8 +360,9 @@
 inline bool EventHandler::ShouldDispatch<ArtJvmtiEvent::kBreakpoint>(
     ArtJvmTiEnv* env,
     art::Thread* thread,
-    JNIEnv* jnienv ATTRIBUTE_UNUSED,
-    jthread jni_thread ATTRIBUTE_UNUSED,
+
+    [[maybe_unused]] JNIEnv* jnienv,
+    [[maybe_unused]] jthread jni_thread,
     jmethodID jmethod,
     jlocation location) const {
   art::ReaderMutexLock lk(art::Thread::Current(), env->event_info_mutex_);
@@ -374,10 +375,10 @@
 inline bool EventHandler::ShouldDispatch<ArtJvmtiEvent::kFramePop>(
     ArtJvmTiEnv* env,
     art::Thread* thread,
-    JNIEnv* jnienv ATTRIBUTE_UNUSED,
-    jthread jni_thread ATTRIBUTE_UNUSED,
-    jmethodID jmethod ATTRIBUTE_UNUSED,
-    jboolean is_exception ATTRIBUTE_UNUSED,
+    [[maybe_unused]] JNIEnv* jnienv,
+    [[maybe_unused]] jthread jni_thread,
+    [[maybe_unused]] jmethodID jmethod,
+    [[maybe_unused]] jboolean is_exception,
     const art::ShadowFrame* frame) const {
   // Search for the frame. Do this before checking if we need to send the event so that we don't
   // have to deal with use-after-free or the frames being reallocated later.
@@ -395,15 +396,15 @@
 inline bool EventHandler::ShouldDispatch<ArtJvmtiEvent::kFieldModification>(
     ArtJvmTiEnv* env,
     art::Thread* thread,
-    JNIEnv* jnienv ATTRIBUTE_UNUSED,
-    jthread jni_thread ATTRIBUTE_UNUSED,
-    jmethodID method ATTRIBUTE_UNUSED,
-    jlocation location ATTRIBUTE_UNUSED,
-    jclass field_klass ATTRIBUTE_UNUSED,
-    jobject object ATTRIBUTE_UNUSED,
+    [[maybe_unused]] JNIEnv* jnienv,
+    [[maybe_unused]] jthread jni_thread,
+    [[maybe_unused]] jmethodID method,
+    [[maybe_unused]] jlocation location,
+    [[maybe_unused]] jclass field_klass,
+    [[maybe_unused]] jobject object,
     jfieldID field,
-    char type_char ATTRIBUTE_UNUSED,
-    jvalue val ATTRIBUTE_UNUSED) const {
+    [[maybe_unused]] char type_char,
+    [[maybe_unused]] jvalue val) const {
   art::ReaderMutexLock lk(art::Thread::Current(), env->event_info_mutex_);
   return ShouldDispatchOnThread<ArtJvmtiEvent::kFieldModification>(env, thread) &&
       env->modify_watched_fields.find(
@@ -414,12 +415,12 @@
 inline bool EventHandler::ShouldDispatch<ArtJvmtiEvent::kFieldAccess>(
     ArtJvmTiEnv* env,
     art::Thread* thread,
-    JNIEnv* jnienv ATTRIBUTE_UNUSED,
-    jthread jni_thread ATTRIBUTE_UNUSED,
-    jmethodID method ATTRIBUTE_UNUSED,
-    jlocation location ATTRIBUTE_UNUSED,
-    jclass field_klass ATTRIBUTE_UNUSED,
-    jobject object ATTRIBUTE_UNUSED,
+    [[maybe_unused]] JNIEnv* jnienv,
+    [[maybe_unused]] jthread jni_thread,
+    [[maybe_unused]] jmethodID method,
+    [[maybe_unused]] jlocation location,
+    [[maybe_unused]] jclass field_klass,
+    [[maybe_unused]] jobject object,
     jfieldID field) const {
   art::ReaderMutexLock lk(art::Thread::Current(), env->event_info_mutex_);
   return ShouldDispatchOnThread<ArtJvmtiEvent::kFieldAccess>(env, thread) &&
@@ -439,7 +440,7 @@
     jthread jni_thread,
     jmethodID jmethod,
     jboolean is_exception,
-    const art::ShadowFrame* frame ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] const art::ShadowFrame* frame) {
   ExecuteCallback<ArtJvmtiEvent::kFramePop>(event, jnienv, jni_thread, jmethod, is_exception);
 }
 
@@ -628,10 +629,10 @@
   return dispatch;
 }
 
-template <ArtJvmtiEvent kEvent, typename ...Args>
+template <ArtJvmtiEvent kEvent, typename... Args>
 inline bool EventHandler::ShouldDispatch(ArtJvmTiEnv* env,
                                          art::Thread* thread,
-                                         Args... args ATTRIBUTE_UNUSED) const {
+                                         [[maybe_unused]] Args... args) const {
   static_assert(std::is_same<typename impl::EventFnType<kEvent>::type,
                              void(*)(jvmtiEnv*, Args...)>::value,
                 "Unexpected different type of shouldDispatch");
diff --git a/openjdkjvmti/events.cc b/openjdkjvmti/events.cc
index 64da6ed..31107d0 100644
--- a/openjdkjvmti/events.cc
+++ b/openjdkjvmti/events.cc
@@ -737,9 +737,7 @@
 
   // Call-back for when a method is popped due to an exception throw. A method will either cause a
   // MethodExited call-back or a MethodUnwind call-back when its activation is removed.
-  void MethodUnwind(art::Thread* self,
-                    art::ArtMethod* method,
-                    uint32_t dex_pc ATTRIBUTE_UNUSED)
+  void MethodUnwind(art::Thread* self, art::ArtMethod* method, [[maybe_unused]] uint32_t dex_pc)
       REQUIRES_SHARED(art::Locks::mutator_lock_) override {
     if (!method->IsRuntimeMethod() &&
         event_handler_->IsEventEnabledAnywhere(ArtJvmtiEvent::kMethodExit)) {
@@ -767,10 +765,9 @@
 
   // Call-back for when the dex pc moves in a method.
   void DexPcMoved(art::Thread* self,
-                  art::Handle<art::mirror::Object> this_object ATTRIBUTE_UNUSED,
+                  [[maybe_unused]] art::Handle<art::mirror::Object> this_object,
                   art::ArtMethod* method,
-                  uint32_t new_dex_pc)
-      REQUIRES_SHARED(art::Locks::mutator_lock_) override {
+                  uint32_t new_dex_pc) REQUIRES_SHARED(art::Locks::mutator_lock_) override {
     DCHECK(!method->IsRuntimeMethod());
     // Default methods might be copied to multiple classes. We need to get the canonical version of
     // this method so that we can check for breakpoints correctly.
@@ -1034,10 +1031,10 @@
   }
 
   // Call-back for when we execute a branch.
-  void Branch(art::Thread* self ATTRIBUTE_UNUSED,
-              art::ArtMethod* method ATTRIBUTE_UNUSED,
-              uint32_t dex_pc ATTRIBUTE_UNUSED,
-              int32_t dex_pc_offset ATTRIBUTE_UNUSED)
+  void Branch([[maybe_unused]] art::Thread* self,
+              [[maybe_unused]] art::ArtMethod* method,
+              [[maybe_unused]] uint32_t dex_pc,
+              [[maybe_unused]] int32_t dex_pc_offset)
       REQUIRES_SHARED(art::Locks::mutator_lock_) override {
     return;
   }
diff --git a/openjdkjvmti/jvmti_allocator.h b/openjdkjvmti/jvmti_allocator.h
index 4adf769..618a661 100644
--- a/openjdkjvmti/jvmti_allocator.h
+++ b/openjdkjvmti/jvmti_allocator.h
@@ -110,7 +110,7 @@
   pointer address(reference x) const { return &x; }
   const_pointer address(const_reference x) const { return &x; }
 
-  pointer allocate(size_type n, JvmtiAllocator<void>::pointer hint ATTRIBUTE_UNUSED = nullptr) {
+  pointer allocate(size_type n, [[maybe_unused]] JvmtiAllocator<void>::pointer hint = nullptr) {
     DCHECK_LE(n, max_size());
     if (env_ == nullptr) {
       T* result = reinterpret_cast<T*>(AllocUtil::AllocateImpl(n * sizeof(T)));
@@ -123,7 +123,7 @@
       return reinterpret_cast<T*>(result);
     }
   }
-  void deallocate(pointer p, size_type n ATTRIBUTE_UNUSED) {
+  void deallocate(pointer p, [[maybe_unused]] size_type n) {
     if (env_ == nullptr) {
       AllocUtil::DeallocateImpl(reinterpret_cast<unsigned char*>(p));
     } else {
diff --git a/openjdkjvmti/jvmti_weak_table-inl.h b/openjdkjvmti/jvmti_weak_table-inl.h
index c5663e5..7502ad2 100644
--- a/openjdkjvmti/jvmti_weak_table-inl.h
+++ b/openjdkjvmti/jvmti_weak_table-inl.h
@@ -68,10 +68,10 @@
   update_since_last_sweep_ = true;
 
   auto WithReadBarrierUpdater = [&](const art::GcRoot<art::mirror::Object>& original_root,
-                                    art::mirror::Object* original_obj ATTRIBUTE_UNUSED)
-     REQUIRES_SHARED(art::Locks::mutator_lock_) {
-    return original_root.Read<art::kWithReadBarrier>();
-  };
+                                    [[maybe_unused]] art::mirror::Object* original_obj)
+                                    REQUIRES_SHARED(art::Locks::mutator_lock_) {
+                                      return original_root.Read<art::kWithReadBarrier>();
+                                    };
 
   UpdateTableWith<decltype(WithReadBarrierUpdater), kIgnoreNull>(WithReadBarrierUpdater);
 }
@@ -198,7 +198,7 @@
   art::Thread* self = art::Thread::Current();
   art::MutexLock mu(self, allow_disallow_lock_);
 
-  auto IsMarkedUpdater = [&](const art::GcRoot<art::mirror::Object>& original_root ATTRIBUTE_UNUSED,
+  auto IsMarkedUpdater = [&]([[maybe_unused]] const art::GcRoot<art::mirror::Object>& original_root,
                              art::mirror::Object* original_obj) {
     return visitor->IsMarked(original_obj);
   };
diff --git a/openjdkjvmti/jvmti_weak_table.h b/openjdkjvmti/jvmti_weak_table.h
index 674b2a3..8f8d89b 100644
--- a/openjdkjvmti/jvmti_weak_table.h
+++ b/openjdkjvmti/jvmti_weak_table.h
@@ -128,7 +128,7 @@
     return false;
   }
   // If DoesHandleNullOnSweep returns true, this function will be called.
-  virtual void HandleNullSweep(T tag ATTRIBUTE_UNUSED) {}
+  virtual void HandleNullSweep([[maybe_unused]] T tag) {}
 
  private:
   ALWAYS_INLINE
diff --git a/openjdkjvmti/ti_allocator.cc b/openjdkjvmti/ti_allocator.cc
index 575558d..1e6d462 100644
--- a/openjdkjvmti/ti_allocator.cc
+++ b/openjdkjvmti/ti_allocator.cc
@@ -47,7 +47,7 @@
 
 std::atomic<jlong> AllocUtil::allocated;
 
-jvmtiError AllocUtil::GetGlobalJvmtiAllocationState(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError AllocUtil::GetGlobalJvmtiAllocationState([[maybe_unused]] jvmtiEnv* env,
                                                     jlong* allocated_ptr) {
   if (allocated_ptr == nullptr) {
     return ERR(NULL_POINTER);
@@ -56,7 +56,7 @@
   return OK;
 }
 
-jvmtiError AllocUtil::Allocate(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError AllocUtil::Allocate([[maybe_unused]] jvmtiEnv* env,
                                jlong size,
                                unsigned char** mem_ptr) {
   if (size < 0) {
@@ -80,7 +80,7 @@
   return ret;
 }
 
-jvmtiError AllocUtil::Deallocate(jvmtiEnv* env ATTRIBUTE_UNUSED, unsigned char* mem) {
+jvmtiError AllocUtil::Deallocate([[maybe_unused]] jvmtiEnv* env, unsigned char* mem) {
   DeallocateImpl(mem);
   return OK;
 }
diff --git a/openjdkjvmti/ti_class.cc b/openjdkjvmti/ti_class.cc
index 3d44516..5581bc2 100644
--- a/openjdkjvmti/ti_class.cc
+++ b/openjdkjvmti/ti_class.cc
@@ -162,10 +162,10 @@
                       art::Handle<art::mirror::Class> klass,
                       art::Handle<art::mirror::ClassLoader> class_loader,
                       const art::DexFile& initial_dex_file,
-                      const art::dex::ClassDef& initial_class_def ATTRIBUTE_UNUSED,
-                      /*out*/art::DexFile const** final_dex_file,
-                      /*out*/art::dex::ClassDef const** final_class_def)
-      override REQUIRES_SHARED(art::Locks::mutator_lock_) {
+                      [[maybe_unused]] const art::dex::ClassDef& initial_class_def,
+                      /*out*/ art::DexFile const** final_dex_file,
+                      /*out*/ art::dex::ClassDef const** final_class_def) override
+      REQUIRES_SHARED(art::Locks::mutator_lock_) {
     bool is_enabled =
         event_handler->IsEventEnabledAnywhere(ArtJvmtiEvent::kClassFileLoadHookRetransformable) ||
         event_handler->IsEventEnabledAnywhere(ArtJvmtiEvent::kClassFileLoadHookNonRetransformable);
@@ -192,8 +192,8 @@
     def.InitFirstLoad(descriptor, class_loader, initial_dex_file);
 
     // Call all non-retransformable agents.
-    Transformer::TransformSingleClassDirect<ArtJvmtiEvent::kClassFileLoadHookNonRetransformable>(
-        event_handler, self, &def);
+    Transformer::CallClassFileLoadHooksSingleClass<
+        ArtJvmtiEvent::kClassFileLoadHookNonRetransformable>(event_handler, self, &def);
 
     std::vector<unsigned char> post_non_retransform;
     if (def.IsModified()) {
@@ -203,11 +203,11 @@
     }
 
     // Call all structural transformation agents.
-    Transformer::TransformSingleClassDirect<ArtJvmtiEvent::kStructuralDexFileLoadHook>(
+    Transformer::CallClassFileLoadHooksSingleClass<ArtJvmtiEvent::kStructuralDexFileLoadHook>(
         event_handler, self, &def);
     // Call all retransformable agents.
-    Transformer::TransformSingleClassDirect<ArtJvmtiEvent::kClassFileLoadHookRetransformable>(
-        event_handler, self, &def);
+    Transformer::CallClassFileLoadHooksSingleClass<
+        ArtJvmtiEvent::kClassFileLoadHookRetransformable>(event_handler, self, &def);
 
     if (def.IsModified()) {
       VLOG(class_linker) << "Changing class " << descriptor;
@@ -387,8 +387,7 @@
 
     void VisitRoots(art::mirror::Object*** roots,
                     size_t count,
-                    const art::RootInfo& info ATTRIBUTE_UNUSED)
-        override {
+                    [[maybe_unused]] const art::RootInfo& info) override {
       for (size_t i = 0; i != count; ++i) {
         if (*roots[i] == input_) {
           *roots[i] = output_;
@@ -398,8 +397,8 @@
 
     void VisitRoots(art::mirror::CompressedReference<art::mirror::Object>** roots,
                     size_t count,
-                    const art::RootInfo& info ATTRIBUTE_UNUSED)
-        override REQUIRES_SHARED(art::Locks::mutator_lock_) {
+                    [[maybe_unused]] const art::RootInfo& info) override
+        REQUIRES_SHARED(art::Locks::mutator_lock_) {
       for (size_t i = 0; i != count; ++i) {
         if (roots[i]->AsMirrorPtr() == input_) {
           roots[i]->Assign(output_);
@@ -476,7 +475,7 @@
 
       void operator()(art::mirror::Object* src,
                       art::MemberOffset field_offset,
-                      bool is_static ATTRIBUTE_UNUSED) const
+                      [[maybe_unused]] bool is_static) const
           REQUIRES_SHARED(art::Locks::mutator_lock_) {
         art::mirror::HeapReference<art::mirror::Object>* trg =
           src->GetFieldObjectReferenceAddr(field_offset);
@@ -487,7 +486,7 @@
         }
       }
 
-      void operator()(art::ObjPtr<art::mirror::Class> klass ATTRIBUTE_UNUSED,
+      void operator()([[maybe_unused]] art::ObjPtr<art::mirror::Class> klass,
                       art::ObjPtr<art::mirror::Reference> reference) const
           REQUIRES_SHARED(art::Locks::mutator_lock_) {
         art::mirror::Object* val = reference->GetReferent();
@@ -496,13 +495,13 @@
         }
       }
 
-      void VisitRoot(art::mirror::CompressedReference<art::mirror::Object>* root ATTRIBUTE_UNUSED)
-          const {
+      void VisitRoot(
+          [[maybe_unused]] art::mirror::CompressedReference<art::mirror::Object>* root) const {
         LOG(FATAL) << "Unreachable";
       }
 
       void VisitRootIfNonNull(
-          art::mirror::CompressedReference<art::mirror::Object>* root ATTRIBUTE_UNUSED) const {
+          [[maybe_unused]] art::mirror::CompressedReference<art::mirror::Object>* root) const {
         LOG(FATAL) << "Unreachable";
       }
 
@@ -623,7 +622,7 @@
 
   if (art::kIsDebugBuild) {
     size_t count = 0;
-    for (auto& m ATTRIBUTE_UNUSED : klass->GetDeclaredMethods(art::kRuntimePointerSize)) {
+    for ([[maybe_unused]] auto& m : klass->GetDeclaredMethods(art::kRuntimePointerSize)) {
       count++;
     }
     CHECK_EQ(count, klass->NumDirectMethods() + klass->NumDeclaredVirtualMethods());
@@ -747,7 +746,7 @@
   return ERR(NONE);
 }
 
-jvmtiError ClassUtil::GetClassStatus(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError ClassUtil::GetClassStatus([[maybe_unused]] jvmtiEnv* env,
                                      jclass jklass,
                                      jint* status_ptr) {
   art::ScopedObjectAccess soa(art::Thread::Current());
@@ -798,7 +797,7 @@
   return ERR(NONE);
 }
 
-jvmtiError ClassUtil::IsInterface(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError ClassUtil::IsInterface([[maybe_unused]] jvmtiEnv* env,
                                   jclass jklass,
                                   jboolean* is_interface_ptr) {
   auto test = [](art::ObjPtr<art::mirror::Class> klass) REQUIRES_SHARED(art::Locks::mutator_lock_) {
@@ -807,7 +806,7 @@
   return ClassIsT(jklass, test, is_interface_ptr);
 }
 
-jvmtiError ClassUtil::IsArrayClass(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError ClassUtil::IsArrayClass([[maybe_unused]] jvmtiEnv* env,
                                    jclass jklass,
                                    jboolean* is_array_class_ptr) {
   auto test = [](art::ObjPtr<art::mirror::Class> klass) REQUIRES_SHARED(art::Locks::mutator_lock_) {
@@ -834,7 +833,7 @@
   return art::mirror::Class::GetInnerClassFlags(h_klass, modifiers);
 }
 
-jvmtiError ClassUtil::GetClassModifiers(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError ClassUtil::GetClassModifiers([[maybe_unused]] jvmtiEnv* env,
                                         jclass jklass,
                                         jint* modifiers_ptr) {
   art::ScopedObjectAccess soa(art::Thread::Current());
@@ -852,7 +851,7 @@
   return ERR(NONE);
 }
 
-jvmtiError ClassUtil::GetClassLoader(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError ClassUtil::GetClassLoader([[maybe_unused]] jvmtiEnv* env,
                                      jclass jklass,
                                      jobject* classloader_ptr) {
   art::ScopedObjectAccess soa(art::Thread::Current());
@@ -1047,7 +1046,7 @@
   return ERR(NONE);
 }
 
-jvmtiError ClassUtil::GetClassVersionNumbers(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError ClassUtil::GetClassVersionNumbers([[maybe_unused]] jvmtiEnv* env,
                                              jclass jklass,
                                              jint* minor_version_ptr,
                                              jint* major_version_ptr) {
diff --git a/openjdkjvmti/ti_class_definition.cc b/openjdkjvmti/ti_class_definition.cc
index a9e7b31..72fe7c7 100644
--- a/openjdkjvmti/ti_class_definition.cc
+++ b/openjdkjvmti/ti_class_definition.cc
@@ -106,7 +106,8 @@
         dex_data_ = art::ArrayRef<const unsigned char>(dex_data_memory_);
 
         const art::DexFile& cur_dex = m_klass->GetDexFile();
-        current_dex_file_ = art::ArrayRef<const unsigned char>(cur_dex.Begin(), cur_dex.Size());
+        current_dex_file_ =
+            art::ArrayRef<const unsigned char>(cur_dex.Begin(), cur_dex.SizeIncludingSharedData());
         return OK;
       }
 
@@ -132,7 +133,8 @@
         }
       }
       const art::DexFile& cur_dex = m_klass->GetDexFile();
-      current_dex_file_ = art::ArrayRef<const unsigned char>(cur_dex.Begin(), cur_dex.Size());
+      current_dex_file_ =
+          art::ArrayRef<const unsigned char>(cur_dex.Begin(), cur_dex.SizeIncludingSharedData());
       return OK;
     }
   }
@@ -189,8 +191,8 @@
       }
     }
     // Keep the dex_data alive.
-    dex_data_memory_.resize(original_dex_file->Size());
-    memcpy(dex_data_memory_.data(), original_dex_file->Begin(), original_dex_file->Size());
+    dex_data_memory_.resize(original_dex_file->SizeIncludingSharedData());
+    memcpy(dex_data_memory_.data(), original_dex_file->Begin(), dex_data_memory_.size());
     dex_data_ = art::ArrayRef<const unsigned char>(dex_data_memory_);
 
     // In case dex_data gets re-used for redefinition, keep the dex file live
@@ -200,7 +202,8 @@
     current_dex_file_ = art::ArrayRef<const unsigned char>(current_dex_memory_);
   } else {
     // Dex file will always stay live, use it directly.
-    dex_data_ = art::ArrayRef<const unsigned char>(dex_file.Begin(), dex_file.Size());
+    dex_data_ =
+        art::ArrayRef<const unsigned char>(dex_file.Begin(), dex_file.SizeIncludingSharedData());
     current_dex_file_ = dex_data_;
   }
   return OK;
diff --git a/openjdkjvmti/ti_extension.cc b/openjdkjvmti/ti_extension.cc
index 02dc9f1..2e57b5f 100644
--- a/openjdkjvmti/ti_extension.cc
+++ b/openjdkjvmti/ti_extension.cc
@@ -451,38 +451,6 @@
       return error;
     }
 
-    // StructurallyRedefineClassDirect
-    error = add_extension(
-        reinterpret_cast<jvmtiExtensionFunction>(Redefiner::StructurallyRedefineClassDirect),
-        "com.android.art.UNSAFE.class.structurally_redefine_class_direct",
-        "Temporary prototype entrypoint for redefining a single class structurally. Currently this"
-        " only supports adding new static fields to a class without any instances."
-        " ClassFileLoadHook events will NOT be triggered. This does not currently support creating"
-        " obsolete methods. This function only has rudimentary error checking. This should not be"
-        " used except for testing.",
-        {
-          { "klass", JVMTI_KIND_IN, JVMTI_TYPE_JCLASS, false },
-          { "new_def", JVMTI_KIND_IN_BUF, JVMTI_TYPE_CCHAR, false },
-          { "new_def_len", JVMTI_KIND_IN, JVMTI_TYPE_JINT, false },
-        },
-        {
-          ERR(CLASS_LOADER_UNSUPPORTED),
-          ERR(FAILS_VERIFICATION),
-          ERR(ILLEGAL_ARGUMENT),
-          ERR(INVALID_CLASS),
-          ERR(MUST_POSSESS_CAPABILITY),
-          ERR(MUST_POSSESS_CAPABILITY),
-          ERR(NULL_POINTER),
-          ERR(OUT_OF_MEMORY),
-          ERR(UNMODIFIABLE_CLASS),
-          ERR(UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED),
-          ERR(UNSUPPORTED_REDEFINITION_METHOD_ADDED),
-          ERR(UNSUPPORTED_REDEFINITION_METHOD_DELETED),
-          ERR(UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED),
-        });
-    if (error != ERR(NONE)) {
-      return error;
-    }
   } else {
     LOG(INFO) << "debuggable & jni-type indices are required to implement structural "
               << "class redefinition extensions.";
diff --git a/openjdkjvmti/ti_field.cc b/openjdkjvmti/ti_field.cc
index d4c0ec8..4e39e22 100644
--- a/openjdkjvmti/ti_field.cc
+++ b/openjdkjvmti/ti_field.cc
@@ -200,7 +200,7 @@
   return ERR(NONE);
 }
 
-jvmtiError FieldUtil::GetFieldDeclaringClass(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError FieldUtil::GetFieldDeclaringClass([[maybe_unused]] jvmtiEnv* env,
                                              jclass klass,
                                              jfieldID field,
                                              jclass* declaring_class_ptr) {
@@ -223,7 +223,7 @@
   return ERR(NONE);
 }
 
-jvmtiError FieldUtil::GetFieldModifiers(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError FieldUtil::GetFieldModifiers([[maybe_unused]] jvmtiEnv* env,
                                         jclass klass,
                                         jfieldID field,
                                         jint* modifiers_ptr) {
@@ -246,7 +246,7 @@
   return ERR(NONE);
 }
 
-jvmtiError FieldUtil::IsFieldSynthetic(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError FieldUtil::IsFieldSynthetic([[maybe_unused]] jvmtiEnv* env,
                                        jclass klass,
                                        jfieldID field,
                                        jboolean* is_synthetic_ptr) {
diff --git a/openjdkjvmti/ti_heap.cc b/openjdkjvmti/ti_heap.cc
index 01864cd..80bfa0f 100644
--- a/openjdkjvmti/ti_heap.cc
+++ b/openjdkjvmti/ti_heap.cc
@@ -211,11 +211,11 @@
 }
 
 template <typename UserData>
-bool VisitorFalse(art::ObjPtr<art::mirror::Object> obj ATTRIBUTE_UNUSED,
-                  art::ObjPtr<art::mirror::Class> klass ATTRIBUTE_UNUSED,
-                  art::ArtField& field ATTRIBUTE_UNUSED,
-                  size_t field_index ATTRIBUTE_UNUSED,
-                  UserData* user_data ATTRIBUTE_UNUSED) {
+bool VisitorFalse([[maybe_unused]] art::ObjPtr<art::mirror::Object> obj,
+                  [[maybe_unused]] art::ObjPtr<art::mirror::Class> klass,
+                  [[maybe_unused]] art::ArtField& field,
+                  [[maybe_unused]] size_t field_index,
+                  [[maybe_unused]] UserData* user_data) {
   return false;
 }
 
@@ -476,11 +476,11 @@
 // Debug helper. Prints the structure of an object.
 template <bool kStatic, bool kRef>
 struct DumpVisitor {
-  static bool Callback(art::ObjPtr<art::mirror::Object> obj ATTRIBUTE_UNUSED,
-                       art::ObjPtr<art::mirror::Class> klass ATTRIBUTE_UNUSED,
+  static bool Callback([[maybe_unused]] art::ObjPtr<art::mirror::Object> obj,
+                       [[maybe_unused]] art::ObjPtr<art::mirror::Class> klass,
                        art::ArtField& field,
                        size_t field_index,
-                       void* user_data ATTRIBUTE_UNUSED)
+                       [[maybe_unused]] void* user_data)
       REQUIRES_SHARED(art::Locks::mutator_lock_) {
     LOG(ERROR) << (kStatic ? "static " : "instance ")
                << (kRef ? "ref " : "primitive ")
@@ -490,8 +490,7 @@
     return false;
   }
 };
-ATTRIBUTE_UNUSED
-void DumpObjectFields(art::ObjPtr<art::mirror::Object> obj)
+[[maybe_unused]] void DumpObjectFields(art::ObjPtr<art::mirror::Object> obj)
     REQUIRES_SHARED(art::Locks::mutator_lock_) {
   if (obj->IsClass()) {
     FieldVisitor<void, false>:: ReportFields(obj,
@@ -825,14 +824,13 @@
                                         jclass klass,
                                         const jvmtiHeapCallbacks* callbacks,
                                         const void* user_data) {
-  auto JvmtiIterateHeap = [](art::mirror::Object* obj ATTRIBUTE_UNUSED,
+  auto JvmtiIterateHeap = []([[maybe_unused]] art::mirror::Object* obj,
                              const jvmtiHeapCallbacks* cb_callbacks,
                              jlong class_tag,
                              jlong size,
                              jlong* tag,
                              jint length,
-                             void* cb_user_data)
-      REQUIRES_SHARED(art::Locks::mutator_lock_) {
+                             void* cb_user_data) REQUIRES_SHARED(art::Locks::mutator_lock_) {
     return cb_callbacks->heap_iteration_callback(class_tag,
                                                  size,
                                                  tag,
@@ -977,6 +975,13 @@
     jvmtiHeapReferenceKind GetReferenceKind(const art::RootInfo& info,
                                             jvmtiHeapReferenceInfo* ref_info)
         REQUIRES_SHARED(art::Locks::mutator_lock_) {
+      // We do not necessarily hold thread_list_lock_ here, but we may if we are called from
+      // VisitThreadRoots, which can happen from JVMTI FollowReferences. If it was acquired in
+      // ThreadList::VisitRoots, it's unsafe to temporarily release it. Thus we act as if we did
+      // not hold the thread_list_lock_ here, and relax CHECKs appropriately. If it does happen,
+      // we are in a SuspendAll situation with concurrent GC disabled, and should not need to run
+      // flip functions. TODO: Find a way to clean this up.
+
       // TODO: Fill in ref_info.
       memset(ref_info, 0, sizeof(jvmtiHeapReferenceInfo));
 
@@ -1108,31 +1113,33 @@
     }
 
     // All instance fields.
-    auto report_instance_field = [&](art::ObjPtr<art::mirror::Object> src,
-                                     art::ObjPtr<art::mirror::Class> obj_klass ATTRIBUTE_UNUSED,
-                                     art::ArtField& field,
-                                     size_t field_index,
-                                     void* user_data ATTRIBUTE_UNUSED)
-        REQUIRES_SHARED(art::Locks::mutator_lock_)
-        REQUIRES(!*tag_table_->GetAllowDisallowLock()) {
-      art::ObjPtr<art::mirror::Object> field_value = field.GetObject(src);
-      if (field_value != nullptr) {
-        jvmtiHeapReferenceInfo reference_info;
-        memset(&reference_info, 0, sizeof(reference_info));
+    auto report_instance_field =
+        [&](art::ObjPtr<art::mirror::Object> src,
+            [[maybe_unused]] art::ObjPtr<art::mirror::Class> obj_klass,
+            art::ArtField& field,
+            size_t field_index,
+            [[maybe_unused]] void* user_data) REQUIRES_SHARED(art::Locks::mutator_lock_)
+            REQUIRES(!*tag_table_->GetAllowDisallowLock()) {
+              art::ObjPtr<art::mirror::Object> field_value = field.GetObject(src);
+              if (field_value != nullptr) {
+                jvmtiHeapReferenceInfo reference_info;
+                memset(&reference_info, 0, sizeof(reference_info));
 
-        reference_info.field.index = field_index;
+                reference_info.field.index = field_index;
 
-        jvmtiHeapReferenceKind kind =
-            field.GetOffset().Int32Value() == art::mirror::Object::ClassOffset().Int32Value()
-                ? JVMTI_HEAP_REFERENCE_CLASS
-                : JVMTI_HEAP_REFERENCE_FIELD;
-        const jvmtiHeapReferenceInfo* reference_info_ptr =
-            kind == JVMTI_HEAP_REFERENCE_CLASS ? nullptr : &reference_info;
+                jvmtiHeapReferenceKind kind =
+                    field.GetOffset().Int32Value() ==
+                            art::mirror::Object::ClassOffset().Int32Value() ?
+                        JVMTI_HEAP_REFERENCE_CLASS :
+                        JVMTI_HEAP_REFERENCE_FIELD;
+                const jvmtiHeapReferenceInfo* reference_info_ptr =
+                    kind == JVMTI_HEAP_REFERENCE_CLASS ? nullptr : &reference_info;
 
-        return !ReportReferenceMaybeEnqueue(kind, reference_info_ptr, src.Ptr(), field_value.Ptr());
-      }
-      return false;
-    };
+                return !ReportReferenceMaybeEnqueue(
+                    kind, reference_info_ptr, src.Ptr(), field_value.Ptr());
+              }
+              return false;
+            };
     stop_reports_ = FieldVisitor<void, true>::ReportFields(obj,
                                                            nullptr,
                                                            VisitorFalse<void>,
@@ -1241,27 +1248,27 @@
     DCHECK_EQ(h_klass.Get(), klass);
 
     // Declared static fields.
-    auto report_static_field = [&](art::ObjPtr<art::mirror::Object> obj ATTRIBUTE_UNUSED,
-                                   art::ObjPtr<art::mirror::Class> obj_klass,
-                                   art::ArtField& field,
-                                   size_t field_index,
-                                   void* user_data ATTRIBUTE_UNUSED)
-        REQUIRES_SHARED(art::Locks::mutator_lock_)
-        REQUIRES(!*tag_table_->GetAllowDisallowLock()) {
-      art::ObjPtr<art::mirror::Object> field_value = field.GetObject(obj_klass);
-      if (field_value != nullptr) {
-        jvmtiHeapReferenceInfo reference_info;
-        memset(&reference_info, 0, sizeof(reference_info));
+    auto report_static_field =
+        [&]([[maybe_unused]] art::ObjPtr<art::mirror::Object> obj,
+            art::ObjPtr<art::mirror::Class> obj_klass,
+            art::ArtField& field,
+            size_t field_index,
+            [[maybe_unused]] void* user_data) REQUIRES_SHARED(art::Locks::mutator_lock_)
+            REQUIRES(!*tag_table_->GetAllowDisallowLock()) {
+              art::ObjPtr<art::mirror::Object> field_value = field.GetObject(obj_klass);
+              if (field_value != nullptr) {
+                jvmtiHeapReferenceInfo reference_info;
+                memset(&reference_info, 0, sizeof(reference_info));
 
-        reference_info.field.index = static_cast<jint>(field_index);
+                reference_info.field.index = static_cast<jint>(field_index);
 
-        return !ReportReferenceMaybeEnqueue(JVMTI_HEAP_REFERENCE_STATIC_FIELD,
-                                            &reference_info,
-                                            obj_klass.Ptr(),
-                                            field_value.Ptr());
-      }
-      return false;
-    };
+                return !ReportReferenceMaybeEnqueue(JVMTI_HEAP_REFERENCE_STATIC_FIELD,
+                                                    &reference_info,
+                                                    obj_klass.Ptr(),
+                                                    field_value.Ptr());
+              }
+              return false;
+            };
     stop_reports_ = FieldVisitor<void, false>::ReportFields(klass,
                                                             nullptr,
                                                             VisitorFalse<void>,
@@ -1473,7 +1480,7 @@
   return ERR(NONE);
 }
 
-jvmtiError HeapUtil::ForceGarbageCollection(jvmtiEnv* env ATTRIBUTE_UNUSED) {
+jvmtiError HeapUtil::ForceGarbageCollection([[maybe_unused]] jvmtiEnv* env) {
   art::Runtime::Current()->GetHeap()->CollectGarbage(/* clear_soft_references= */ false);
 
   return ERR(NONE);
@@ -1666,7 +1673,7 @@
           }
 
           // java.lang.ref.Reference visitor.
-          void operator()(art::ObjPtr<art::mirror::Class> klass ATTRIBUTE_UNUSED,
+          void operator()([[maybe_unused]] art::ObjPtr<art::mirror::Class> klass,
                           art::ObjPtr<art::mirror::Reference> ref) const
               REQUIRES_SHARED(art::Locks::mutator_lock_) {
             operator()(ref, art::mirror::Reference::ReferentOffset(), /* is_static */ false);
@@ -1780,7 +1787,7 @@
       // already have.
       // TODO We technically only need to do this if the frames are not already being interpreted.
       // The cost for doing an extra stack walk is unlikely to be worth it though.
-      instr->InstrumentThreadStack(t, /* deopt_all_frames= */ true);
+      instr->InstrumentThreadStack(t, /* force_deopt= */ true);
     }
   }
 }
diff --git a/openjdkjvmti/ti_jni.cc b/openjdkjvmti/ti_jni.cc
index b655d6a..98d4ec7 100644
--- a/openjdkjvmti/ti_jni.cc
+++ b/openjdkjvmti/ti_jni.cc
@@ -42,7 +42,7 @@
 
 namespace openjdkjvmti {
 
-jvmtiError JNIUtil::SetJNIFunctionTable(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError JNIUtil::SetJNIFunctionTable([[maybe_unused]] jvmtiEnv* env,
                                         const jniNativeInterface* function_table) {
   // While we supporting setting null (which will reset the table), the spec says no.
   if (function_table == nullptr) {
diff --git a/openjdkjvmti/ti_logging.cc b/openjdkjvmti/ti_logging.cc
index 8740ec6..82057b1 100644
--- a/openjdkjvmti/ti_logging.cc
+++ b/openjdkjvmti/ti_logging.cc
@@ -100,7 +100,7 @@
   return OK;
 }
 
-jvmtiError LogUtil::SetVerboseFlag(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError LogUtil::SetVerboseFlag([[maybe_unused]] jvmtiEnv* env,
                                    jvmtiVerboseFlag flag,
                                    jboolean value) {
   if (flag == jvmtiVerboseFlag::JVMTI_VERBOSE_OTHER) {
diff --git a/openjdkjvmti/ti_method.cc b/openjdkjvmti/ti_method.cc
index 99a5d9c..a1f25c4 100644
--- a/openjdkjvmti/ti_method.cc
+++ b/openjdkjvmti/ti_method.cc
@@ -63,7 +63,7 @@
 #include "mirror/object-inl.h"
 #include "mirror/object_array-inl.h"
 #include "nativehelper/scoped_local_ref.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 #include "obj_ptr.h"
 #include "runtime.h"
 #include "runtime_callbacks.h"
@@ -162,7 +162,7 @@
   return OK;
 }
 
-jvmtiError MethodUtil::GetArgumentsSize(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError MethodUtil::GetArgumentsSize([[maybe_unused]] jvmtiEnv* env,
                                         jmethodID method,
                                         jint* size_ptr) {
   if (method == nullptr) {
@@ -182,7 +182,7 @@
   if (art_method->IsProxyMethod() || art_method->IsAbstract()) {
     // Use the shorty.
     art::ArtMethod* base_method = art_method->GetInterfaceMethodIfProxy(art::kRuntimePointerSize);
-    size_t arg_count = art::ArtMethod::NumArgRegisters(base_method->GetShorty());
+    size_t arg_count = art::ArtMethod::NumArgRegisters(base_method->GetShortyView());
     if (!base_method->IsStatic()) {
       arg_count++;
     }
@@ -249,6 +249,7 @@
     return OK;
   };
 
+  // To avoid defining visitor in the same line as the `if`. We define the lambda and use std::move.
   auto visitor = [&](const art::DexFile::LocalInfo& entry) {
     if (err != OK) {
       return;
@@ -275,16 +276,15 @@
     });
   };
 
-  if (!accessor.DecodeDebugLocalInfo(art_method->IsStatic(),
-                                     art_method->GetDexMethodIndex(),
-                                     visitor)) {
+  if (!accessor.DecodeDebugLocalInfo(
+          art_method->IsStatic(), art_method->GetDexMethodIndex(), std::move(visitor))) {
     // Something went wrong with decoding the debug information. It might as well not be there.
     return ERR(ABSENT_INFORMATION);
   }
   return release(entry_count_ptr, table_ptr);
 }
 
-jvmtiError MethodUtil::GetMaxLocals(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError MethodUtil::GetMaxLocals([[maybe_unused]] jvmtiEnv* env,
                                     jmethodID method,
                                     jint* max_ptr) {
   if (method == nullptr) {
@@ -380,7 +380,7 @@
   return ERR(NONE);
 }
 
-jvmtiError MethodUtil::GetMethodDeclaringClass(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError MethodUtil::GetMethodDeclaringClass([[maybe_unused]] jvmtiEnv* env,
                                                jmethodID method,
                                                jclass* declaring_class_ptr) {
   if (declaring_class_ptr == nullptr) {
@@ -397,7 +397,7 @@
   return ERR(NONE);
 }
 
-jvmtiError MethodUtil::GetMethodLocation(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError MethodUtil::GetMethodLocation([[maybe_unused]] jvmtiEnv* env,
                                          jmethodID method,
                                          jlocation* start_location_ptr,
                                          jlocation* end_location_ptr) {
@@ -430,7 +430,7 @@
   return ERR(NONE);
 }
 
-jvmtiError MethodUtil::GetMethodModifiers(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError MethodUtil::GetMethodModifiers([[maybe_unused]] jvmtiEnv* env,
                                           jmethodID method,
                                           jint* modifiers_ptr) {
   if (modifiers_ptr == nullptr) {
@@ -507,7 +507,7 @@
 }
 
 template <typename T>
-static jvmtiError IsMethodT(jvmtiEnv* env ATTRIBUTE_UNUSED,
+static jvmtiError IsMethodT([[maybe_unused]] jvmtiEnv* env,
                             jmethodID method,
                             T test,
                             jboolean* is_t_ptr) {
@@ -634,10 +634,15 @@
                                        /*out*/ std::string* descriptor,
                                        /*out*/ SlotType* type)
       REQUIRES_SHARED(art::Locks::mutator_lock_) {
+    art::StackHandleScope<2> hs(art::Thread::Current());
+    art::Handle<art::mirror::DexCache> dex_cache(hs.NewHandle(method->GetDexCache()));
+    art::Handle<art::mirror::ClassLoader> class_loader(hs.NewHandle(method->GetClassLoader()));
     std::unique_ptr<art::verifier::MethodVerifier> verifier(
         art::verifier::MethodVerifier::CalculateVerificationInfo(
             art::Thread::Current(),
             method,
+            dex_cache,
+            class_loader,
             dex_pc));
     if (verifier == nullptr) {
       JVMTI_LOG(WARNING, jvmti_) << "Unable to extract verification information from "
@@ -749,6 +754,7 @@
   bool found = false;
   *type = art::Primitive::kPrimVoid;
   descriptor->clear();
+  // To avoid defining visitor in the same line as the `if`. We define the lambda and use std::move.
   auto visitor = [&](const art::DexFile::LocalInfo& entry) {
     if (!found && entry.start_address_ <= dex_pc && entry.end_address_ > dex_pc &&
         entry.reg_ == slot_) {
@@ -757,7 +763,8 @@
       *descriptor = entry.descriptor_;
     }
   };
-  if (!accessor.DecodeDebugLocalInfo(method->IsStatic(), method->GetDexMethodIndex(), visitor) ||
+  if (!accessor.DecodeDebugLocalInfo(
+          method->IsStatic(), method->GetDexMethodIndex(), std::move(visitor)) ||
       !found) {
     // Something went wrong with decoding the debug information. It might as well not be there.
     // Try to find the type with the verifier.
@@ -833,9 +840,9 @@
     return res;
   }
 
-  jvmtiError GetTypeErrorInner(art::ArtMethod* method ATTRIBUTE_UNUSED,
+  jvmtiError GetTypeErrorInner([[maybe_unused]] art::ArtMethod* method,
                                SlotType slot_type,
-                               const std::string& descriptor ATTRIBUTE_UNUSED)
+                               [[maybe_unused]] const std::string& descriptor)
       REQUIRES_SHARED(art::Locks::mutator_lock_) {
     switch (type_) {
       case art::Primitive::kPrimFloat:
@@ -1177,7 +1184,7 @@
   art::GcRoot<art::mirror::Object> val_;
 };
 
-jvmtiError MethodUtil::GetLocalInstance(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError MethodUtil::GetLocalInstance([[maybe_unused]] jvmtiEnv* env,
                                         jthread thread,
                                         jint depth,
                                         jobject* data) {
diff --git a/openjdkjvmti/ti_monitor.cc b/openjdkjvmti/ti_monitor.cc
index f244cc1..469693d 100644
--- a/openjdkjvmti/ti_monitor.cc
+++ b/openjdkjvmti/ti_monitor.cc
@@ -225,7 +225,7 @@
   return reinterpret_cast<JvmtiMonitor*>(id);
 }
 
-jvmtiError MonitorUtil::CreateRawMonitor(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError MonitorUtil::CreateRawMonitor([[maybe_unused]] jvmtiEnv* env,
                                          const char* name,
                                          jrawMonitorID* monitor_ptr) {
   if (name == nullptr || monitor_ptr == nullptr) {
@@ -238,7 +238,7 @@
   return ERR(NONE);
 }
 
-jvmtiError MonitorUtil::DestroyRawMonitor(jvmtiEnv* env ATTRIBUTE_UNUSED, jrawMonitorID id) {
+jvmtiError MonitorUtil::DestroyRawMonitor([[maybe_unused]] jvmtiEnv* env, jrawMonitorID id) {
   if (id == nullptr) {
     return ERR(INVALID_MONITOR);
   }
@@ -253,7 +253,7 @@
   return ERR(NONE);
 }
 
-jvmtiError MonitorUtil::RawMonitorEnterNoSuspend(jvmtiEnv* env ATTRIBUTE_UNUSED, jrawMonitorID id) {
+jvmtiError MonitorUtil::RawMonitorEnterNoSuspend([[maybe_unused]] jvmtiEnv* env, jrawMonitorID id) {
   if (id == nullptr) {
     return ERR(INVALID_MONITOR);
   }
@@ -266,7 +266,7 @@
   return ERR(NONE);
 }
 
-jvmtiError MonitorUtil::RawMonitorEnter(jvmtiEnv* env ATTRIBUTE_UNUSED, jrawMonitorID id) {
+jvmtiError MonitorUtil::RawMonitorEnter([[maybe_unused]] jvmtiEnv* env, jrawMonitorID id) {
   if (id == nullptr) {
     return ERR(INVALID_MONITOR);
   }
@@ -279,7 +279,7 @@
   return ERR(NONE);
 }
 
-jvmtiError MonitorUtil::RawMonitorExit(jvmtiEnv* env ATTRIBUTE_UNUSED, jrawMonitorID id) {
+jvmtiError MonitorUtil::RawMonitorExit([[maybe_unused]] jvmtiEnv* env, jrawMonitorID id) {
   if (id == nullptr) {
     return ERR(INVALID_MONITOR);
   }
@@ -294,7 +294,7 @@
   return ERR(NONE);
 }
 
-jvmtiError MonitorUtil::RawMonitorWait(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError MonitorUtil::RawMonitorWait([[maybe_unused]] jvmtiEnv* env,
                                        jrawMonitorID id,
                                        jlong millis) {
   if (id == nullptr) {
@@ -322,7 +322,7 @@
   return ERR(NONE);
 }
 
-jvmtiError MonitorUtil::RawMonitorNotify(jvmtiEnv* env ATTRIBUTE_UNUSED, jrawMonitorID id) {
+jvmtiError MonitorUtil::RawMonitorNotify([[maybe_unused]] jvmtiEnv* env, jrawMonitorID id) {
   if (id == nullptr) {
     return ERR(INVALID_MONITOR);
   }
@@ -337,7 +337,7 @@
   return ERR(NONE);
 }
 
-jvmtiError MonitorUtil::RawMonitorNotifyAll(jvmtiEnv* env ATTRIBUTE_UNUSED, jrawMonitorID id) {
+jvmtiError MonitorUtil::RawMonitorNotifyAll([[maybe_unused]] jvmtiEnv* env, jrawMonitorID id) {
   if (id == nullptr) {
     return ERR(INVALID_MONITOR);
   }
@@ -352,7 +352,7 @@
   return ERR(NONE);
 }
 
-jvmtiError MonitorUtil::GetCurrentContendedMonitor(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError MonitorUtil::GetCurrentContendedMonitor([[maybe_unused]] jvmtiEnv* env,
                                                    jthread thread,
                                                    jobject* monitor) {
   if (monitor == nullptr) {
diff --git a/openjdkjvmti/ti_object.cc b/openjdkjvmti/ti_object.cc
index eb1140d..3333a8a 100644
--- a/openjdkjvmti/ti_object.cc
+++ b/openjdkjvmti/ti_object.cc
@@ -40,7 +40,7 @@
 
 namespace openjdkjvmti {
 
-jvmtiError ObjectUtil::GetObjectSize(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError ObjectUtil::GetObjectSize([[maybe_unused]] jvmtiEnv* env,
                                      jobject jobject,
                                      jlong* size_ptr) {
   if (jobject == nullptr) {
@@ -57,7 +57,7 @@
   return ERR(NONE);
 }
 
-jvmtiError ObjectUtil::GetObjectHashCode(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError ObjectUtil::GetObjectHashCode([[maybe_unused]] jvmtiEnv* env,
                                          jobject jobject,
                                          jint* hash_code_ptr) {
   if (jobject == nullptr) {
@@ -105,13 +105,17 @@
       notify_wait.push_back(jni->AddLocalReference<jthread>(thd->GetPeerFromOtherThread()));
       wait.push_back(jni->AddLocalReference<jthread>(thd->GetPeerFromOtherThread()));
     }
+    // Scan all threads to see which are waiting on this particular monitor.
+    std::list<art::Thread*> thread_list;
     {
-      // Scan all threads to see which are waiting on this particular monitor.
+      // Since we're in a SuspendAll, exiting threads are not a concern.
       art::MutexLock tll(self, *art::Locks::thread_list_lock_);
-      for (art::Thread* thd : art::Runtime::Current()->GetThreadList()->GetList()) {
-        if (thd != info.owner_ && target.Ptr() == thd->GetMonitorEnterObject()) {
-          wait.push_back(jni->AddLocalReference<jthread>(thd->GetPeerFromOtherThread()));
-        }
+      thread_list = art::Runtime::Current()->GetThreadList()->GetList();
+    }
+    for (art::Thread* thd : thread_list) {
+      if (thd != info.owner_ && target.Ptr() == thd->GetMonitorEnterObject()) {
+        art::mirror::Object* peer = thd->GetPeerFromOtherThread();
+        wait.push_back(jni->AddLocalReference<jthread>(peer));
       }
     }
   }
diff --git a/openjdkjvmti/ti_phase.cc b/openjdkjvmti/ti_phase.cc
index 4fa97f1..89bf1aa 100644
--- a/openjdkjvmti/ti_phase.cc
+++ b/openjdkjvmti/ti_phase.cc
@@ -97,7 +97,7 @@
 
 PhaseUtil::PhaseCallback gPhaseCallback;
 
-jvmtiError PhaseUtil::GetPhase(jvmtiEnv* env ATTRIBUTE_UNUSED, jvmtiPhase* phase_ptr) {
+jvmtiError PhaseUtil::GetPhase([[maybe_unused]] jvmtiEnv* env, jvmtiPhase* phase_ptr) {
   if (phase_ptr == nullptr) {
     return ERR(NULL_POINTER);
   }
diff --git a/openjdkjvmti/ti_properties.cc b/openjdkjvmti/ti_properties.cc
index 4fb3070..c6490c3 100644
--- a/openjdkjvmti/ti_properties.cc
+++ b/openjdkjvmti/ti_properties.cc
@@ -226,9 +226,9 @@
   return ERR(NOT_AVAILABLE);
 }
 
-jvmtiError PropertiesUtil::SetSystemProperty(jvmtiEnv* env ATTRIBUTE_UNUSED,
-                                             const char* property ATTRIBUTE_UNUSED,
-                                             const char* value ATTRIBUTE_UNUSED) {
+jvmtiError PropertiesUtil::SetSystemProperty([[maybe_unused]] jvmtiEnv* env,
+                                             [[maybe_unused]] const char* property,
+                                             [[maybe_unused]] const char* value) {
   // We do not allow manipulation of any property here.
   return ERR(NOT_AVAILABLE);
 }
diff --git a/openjdkjvmti/ti_redefine.cc b/openjdkjvmti/ti_redefine.cc
index aafca47..14a981b 100644
--- a/openjdkjvmti/ti_redefine.cc
+++ b/openjdkjvmti/ti_redefine.cc
@@ -339,6 +339,29 @@
   ObsoleteMap* obsolete_maps_;
 };
 
+namespace {
+// We need to make sure we only have one redefinition in progress. Redefining involves
+// re-verification and potentially new allocations among other things. So we only allow one
+// redefinition at a time.
+static art::Mutex redefinition_lock("JVMTI Redefinition lock", art::LockLevel::kGenericBottomLock);
+static bool redefinition_in_progress GUARDED_BY(redefinition_lock) = false;
+
+bool canHandleRedefinition(art::Thread* self) {
+  art::MutexLock mu(self, redefinition_lock);
+  if (redefinition_in_progress) {
+    return false;
+  }
+  redefinition_in_progress = true;
+  return true;
+}
+
+void finishRedefinition(art::Thread* self) {
+  art::MutexLock mu(self, redefinition_lock);
+  DCHECK_EQ(redefinition_in_progress, true);
+  redefinition_in_progress = false;
+}
+}  // namespace
+
 template <RedefinitionType kType>
 jvmtiError
 Redefiner::IsModifiableClassGeneric(jvmtiEnv* env, jclass klass, jboolean* is_redefinable) {
@@ -355,7 +378,7 @@
   art::Handle<art::mirror::Class> h_klass(hs.NewHandle(obj->AsClass()));
   std::string err_unused;
   *is_redefinable =
-      Redefiner::GetClassRedefinitionError<kType>(h_klass, &err_unused) != ERR(UNMODIFIABLE_CLASS)
+      Redefiner::CanRedefineClass<kType>(h_klass, &err_unused) != ERR(UNMODIFIABLE_CLASS)
           ? JNI_TRUE
           : JNI_FALSE;
   return OK;
@@ -372,7 +395,7 @@
 }
 
 template <RedefinitionType kType>
-jvmtiError Redefiner::GetClassRedefinitionError(jclass klass, /*out*/ std::string* error_msg) {
+jvmtiError Redefiner::CanRedefineClass(jclass klass, /*out*/ std::string* error_msg) {
   art::Thread* self = art::Thread::Current();
   art::ScopedObjectAccess soa(self);
   art::StackHandleScope<1> hs(self);
@@ -381,12 +404,12 @@
     return ERR(INVALID_CLASS);
   }
   art::Handle<art::mirror::Class> h_klass(hs.NewHandle(obj->AsClass()));
-  return Redefiner::GetClassRedefinitionError<kType>(h_klass, error_msg);
+  return Redefiner::CanRedefineClass<kType>(h_klass, error_msg);
 }
 
 template <RedefinitionType kType>
-jvmtiError Redefiner::GetClassRedefinitionError(art::Handle<art::mirror::Class> klass,
-                                                /*out*/ std::string* error_msg) {
+jvmtiError Redefiner::CanRedefineClass(art::Handle<art::mirror::Class> klass,
+                                       /*out*/ std::string* error_msg) {
   art::Thread* self = art::Thread::Current();
   if (!klass->IsResolved()) {
     // It's only a problem to try to retransform/redefine a unprepared class if it's happening on
@@ -503,9 +526,9 @@
   return OK;
 }
 
-template jvmtiError Redefiner::GetClassRedefinitionError<RedefinitionType::kNormal>(
+template jvmtiError Redefiner::CanRedefineClass<RedefinitionType::kNormal>(
     art::Handle<art::mirror::Class> klass, /*out*/ std::string* error_msg);
-template jvmtiError Redefiner::GetClassRedefinitionError<RedefinitionType::kStructural>(
+template jvmtiError Redefiner::CanRedefineClass<RedefinitionType::kStructural>(
     art::Handle<art::mirror::Class> klass, /*out*/ std::string* error_msg);
 
 // Moves dex data to an anonymous, read-only mmap'd region.
@@ -545,13 +568,9 @@
       dex_file_(redefined_dex_file),
       class_sig_(class_sig),
       original_dex_file_(orig_dex_file) {
-  lock_acquired_ = GetMirrorClass()->MonitorTryEnter(driver_->self_) != nullptr;
 }
 
 Redefiner::ClassRedefinition::~ClassRedefinition() {
-  if (driver_ != nullptr && lock_acquired_) {
-    GetMirrorClass()->MonitorExit(driver_->self_);
-  }
   if (art::kIsDebugBuild) {
     if (dex_file_ != nullptr) {
       art::Thread* self = art::Thread::Current();
@@ -585,8 +604,8 @@
   std::vector<ArtClassDefinition> def_vector;
   def_vector.reserve(class_count);
   for (jint i = 0; i < class_count; i++) {
-    jvmtiError res = Redefiner::GetClassRedefinitionError<RedefinitionType::kNormal>(
-        definitions[i].klass, &error_msg);
+    jvmtiError res =
+        Redefiner::CanRedefineClass<RedefinitionType::kNormal>(definitions[i].klass, &error_msg);
     if (res != OK) {
       JVMTI_LOG(WARNING, env) << "FAILURE TO REDEFINE " << error_msg;
       return res;
@@ -599,11 +618,12 @@
     }
     def_vector.push_back(std::move(def));
   }
-  // Call all the transformation events.
-  Transformer::RetransformClassesDirect<kType>(self, &def_vector);
-  if (kType == RedefinitionType::kStructural) {
-    Transformer::RetransformClassesDirect<RedefinitionType::kNormal>(self, &def_vector);
-  }
+
+  // Call necessary hooks. According to the spec we should send class file load hooks here. We
+  // handle it slightly differently to support structural redefinition. Look at the comments
+  // in Transformer::CallClassFileLoadHooks for more details.
+  Transformer::CallClassFileLoadHooks<kType>(self, &def_vector);
+
   jvmtiError res = RedefineClassesDirect(env, runtime, self, def_vector, kType, &error_msg);
   if (res != OK) {
     JVMTI_LOG(WARNING, env) << "FAILURE TO REDEFINE " << error_msg;
@@ -629,38 +649,6 @@
   return RedefineClassesGeneric<RedefinitionType::kNormal>(jenv, class_count, definitions);
 }
 
-jvmtiError Redefiner::StructurallyRedefineClassDirect(jvmtiEnv* env,
-                                                      jclass klass,
-                                                      const unsigned char* data,
-                                                      jint data_size) {
-  if (env == nullptr) {
-    return ERR(INVALID_ENVIRONMENT);
-  } else if (ArtJvmTiEnv::AsArtJvmTiEnv(env)->capabilities.can_redefine_classes != 1) {
-    JVMTI_LOG(INFO, env) << "Does not have can_redefine_classes cap!";
-    return ERR(MUST_POSSESS_CAPABILITY);
-  }
-  std::vector<ArtClassDefinition> acds;
-  ArtClassDefinition acd;
-  jvmtiError err = acd.Init(
-      art::Thread::Current(),
-      jvmtiClassDefinition{ .klass = klass, .class_byte_count = data_size, .class_bytes = data });
-  if (err != OK) {
-    return err;
-  }
-  acds.push_back(std::move(acd));
-  std::string err_msg;
-  err = RedefineClassesDirect(ArtJvmTiEnv::AsArtJvmTiEnv(env),
-                              art::Runtime::Current(),
-                              art::Thread::Current(),
-                              acds,
-                              RedefinitionType::kStructural,
-                              &err_msg);
-  if (err != OK) {
-    JVMTI_LOG(WARNING, env) << "Failed structural redefinition: " << err_msg;
-  }
-  return err;
-}
-
 jvmtiError Redefiner::RedefineClassesDirect(ArtJvmTiEnv* env,
                                             art::Runtime* runtime,
                                             art::Thread* self,
@@ -676,6 +664,11 @@
   // no concurrent redefinitions of the same class at the same time. For simplicity and because
   // this is not expected to be a common occurrence we will just wrap the whole thing in a TOP-level
   // lock.
+  Redefiner r(env, runtime, self, type, error_msg);
+  if (!canHandleRedefinition(self)) {
+    r.RecordFailure(ERR(INTERNAL), "Another redefinition is in progress");
+    return r.result_;
+  }
 
   // Stop JIT for the duration of this redefine since the JIT might concurrently compile a method we
   // are going to redefine.
@@ -683,17 +676,19 @@
   art::jit::ScopedJitSuspend suspend_jit;
   // Get shared mutator lock so we can lock all the classes.
   art::ScopedObjectAccess soa(self);
-  Redefiner r(env, runtime, self, type, error_msg);
   for (const ArtClassDefinition& def : definitions) {
     // Only try to transform classes that have been modified.
     if (def.IsModified()) {
       jvmtiError res = r.AddRedefinition(env, def);
       if (res != OK) {
+        finishRedefinition(self);
         return res;
       }
     }
   }
-  return r.Run();
+  jvmtiError res = r.Run();
+  finishRedefinition(self);
+  return res;
 }
 
 jvmtiError Redefiner::AddRedefinition(ArtJvmTiEnv* env, const ArtClassDefinition& def) {
@@ -805,11 +800,6 @@
 
   // return the current dex_cache which has the dex file in it.
   art::ObjPtr<art::mirror::DexCache> current_dex_cache(GetMirrorClass()->GetDexCache());
-  // TODO Handle this or make it so it cannot happen.
-  if (current_dex_cache->GetDexFile()->NumClassDefs() != 1) {
-    LOG(WARNING) << "Current dex file has more than one class in it. Calling RetransformClasses "
-                 << "on this class might fail if no transformations are applied to it!";
-  }
   return current_dex_cache.Ptr();
 }
 
@@ -1091,15 +1081,6 @@
   // Get the class as it is now.
   art::Handle<art::mirror::Class> current_class(hs.NewHandle(GetMirrorClass()));
 
-  // Check whether the class object has been successfully acquired.
-  if (!lock_acquired_) {
-      std::string storage;
-      RecordFailure(ERR(INTERNAL),
-                    StringPrintf("Failed to lock class object '%s'",
-                                 current_class->GetDescriptor(&storage)));
-      return false;
-  }
-
   // Check the access flags didn't change.
   if (def.GetJavaAccessFlags() != (current_class->GetAccessFlags() & art::kAccValidClassFlags)) {
     RecordFailure(ERR(UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED),
@@ -1170,9 +1151,9 @@
   art::Handle<art::mirror::Class> h_klass(hs.NewHandle(GetMirrorClass()));
   jvmtiError res;
   if (driver_->type_ == RedefinitionType::kStructural && this->IsStructuralRedefinition()) {
-    res = Redefiner::GetClassRedefinitionError<RedefinitionType::kStructural>(h_klass, &err);
+    res = Redefiner::CanRedefineClass<RedefinitionType::kStructural>(h_klass, &err);
   } else {
-    res = Redefiner::GetClassRedefinitionError<RedefinitionType::kNormal>(h_klass, &err);
+    res = Redefiner::CanRedefineClass<RedefinitionType::kNormal>(h_klass, &err);
   }
   if (res != OK) {
     RecordFailure(res, err);
@@ -2372,9 +2353,9 @@
     }
   }
 
-  void ClassLoad(art::Handle<art::mirror::Class> klass ATTRIBUTE_UNUSED) override {}
-  void ClassPrepare(art::Handle<art::mirror::Class> klass1 ATTRIBUTE_UNUSED,
-                    art::Handle<art::mirror::Class> klass2 ATTRIBUTE_UNUSED) override {}
+  void ClassLoad([[maybe_unused]] art::Handle<art::mirror::Class> klass) override {}
+  void ClassPrepare([[maybe_unused]] art::Handle<art::mirror::Class> klass1,
+                    [[maybe_unused]] art::Handle<art::mirror::Class> klass2) override {}
 
   void SetRunning() {
     is_running_ = true;
diff --git a/openjdkjvmti/ti_redefine.h b/openjdkjvmti/ti_redefine.h
index cdd6627..46b50fa 100644
--- a/openjdkjvmti/ti_redefine.h
+++ b/openjdkjvmti/ti_redefine.h
@@ -103,8 +103,8 @@
                                       std::string* error_msg);
 
   // Helper for checking if redefinition/retransformation is allowed.
-  template<RedefinitionType kType = RedefinitionType::kNormal>
-  static jvmtiError GetClassRedefinitionError(jclass klass, /*out*/std::string* error_msg)
+  template <RedefinitionType kType = RedefinitionType::kNormal>
+  static jvmtiError CanRedefineClass(jclass klass, /*out*/ std::string* error_msg)
       REQUIRES(!art::Locks::mutator_lock_);
 
   static jvmtiError StructurallyRedefineClassDirect(jvmtiEnv* env,
@@ -132,7 +132,6 @@
       dex_file_ = std::move(other.dex_file_);
       class_sig_ = std::move(other.class_sig_);
       original_dex_file_ = other.original_dex_file_;
-      lock_acquired_ = other.lock_acquired_;
       other.driver_ = nullptr;
       return *this;
     }
@@ -143,8 +142,7 @@
           klass_(other.klass_),
           dex_file_(std::move(other.dex_file_)),
           class_sig_(std::move(other.class_sig_)),
-          original_dex_file_(other.original_dex_file_),
-          lock_acquired_(other.lock_acquired_) {
+          original_dex_file_(other.original_dex_file_) {
       other.driver_ = nullptr;
     }
 
@@ -288,7 +286,6 @@
     bool added_fields_ = false;
     bool added_methods_ = false;
     bool has_virtuals_ = false;
-    bool lock_acquired_ = false;
   };
 
   ArtJvmTiEnv* env_;
@@ -325,9 +322,9 @@
   template<RedefinitionType kType = RedefinitionType::kNormal>
   static jvmtiError IsModifiableClassGeneric(jvmtiEnv* env, jclass klass, jboolean* is_redefinable);
 
-  template<RedefinitionType kType = RedefinitionType::kNormal>
-  static jvmtiError GetClassRedefinitionError(art::Handle<art::mirror::Class> klass,
-                                              /*out*/std::string* error_msg)
+  template <RedefinitionType kType = RedefinitionType::kNormal>
+  static jvmtiError CanRedefineClass(art::Handle<art::mirror::Class> klass,
+                                     /*out*/ std::string* error_msg)
       REQUIRES_SHARED(art::Locks::mutator_lock_);
 
   jvmtiError Run() REQUIRES_SHARED(art::Locks::mutator_lock_);
diff --git a/openjdkjvmti/ti_stack.cc b/openjdkjvmti/ti_stack.cc
index 8ee4adb..a560814 100644
--- a/openjdkjvmti/ti_stack.cc
+++ b/openjdkjvmti/ti_stack.cc
@@ -363,7 +363,13 @@
     REQUIRES_SHARED(art::Locks::mutator_lock_) {
   // Note: requires the mutator lock as the checkpoint requires the mutator lock.
   GetAllStackTracesVectorClosure<Data> closure(max_frame_count, data);
-  size_t barrier_count = art::Runtime::Current()->GetThreadList()->RunCheckpoint(&closure, nullptr);
+  // TODO(b/253671779): Replace this use of RunCheckpointUnchecked() with RunCheckpoint(). This is
+  // currently not possible, since the following undesirable call chain (abbreviated here) is then
+  // possible and exercised by current tests: (jvmti) GetAllStackTraces -> <this function> ->
+  // RunCheckpoint -> GetStackTraceVisitor -> EncodeMethodId -> Class::EnsureMethodIds ->
+  // Class::Alloc -> AllocObjectWithAllocator -> potentially suspends, or runs GC, etc. -> CHECK
+  // failure.
+  size_t barrier_count = art::Runtime::Current()->GetThreadList()->RunCheckpointUnchecked(&closure);
   if (barrier_count == 0) {
     return;
   }
@@ -544,7 +550,6 @@
           // Found the thread.
           art::MutexLock mu(self, mutex);
 
-          threads.push_back(thread);
           thread_list_indices.push_back(index);
 
           frames.emplace_back(new std::vector<jvmtiFrameInfo>());
@@ -562,7 +567,6 @@
 
     // Storage. Only access directly after completion.
 
-    std::vector<art::Thread*> threads;
     std::vector<size_t> thread_list_indices;
 
     std::vector<std::unique_ptr<std::vector<jvmtiFrameInfo>>> frames;
@@ -600,12 +604,10 @@
     jvmtiStackInfo& stack_info = stack_info_array.get()[index];
     memset(&stack_info, 0, sizeof(jvmtiStackInfo));
 
-    art::Thread* self = data.threads[index];
     const std::vector<jvmtiFrameInfo>& thread_frames = *data.frames[index].get();
 
     // For the time being, set the thread to null. We don't have good ScopedLocalRef
     // infrastructure.
-    DCHECK(self->GetPeerFromOtherThread() != nullptr);
     stack_info.thread = nullptr;
     stack_info.state = JVMTI_THREAD_STATE_SUSPENDED;
 
@@ -716,7 +718,7 @@
   size_t count;
 };
 
-jvmtiError StackUtil::GetFrameCount(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError StackUtil::GetFrameCount([[maybe_unused]] jvmtiEnv* env,
                                     jthread java_thread,
                                     jint* count_ptr) {
   // It is not great that we have to hold these locks for so long, but it is necessary to ensure
@@ -784,7 +786,7 @@
   uint32_t dex_pc;
 };
 
-jvmtiError StackUtil::GetFrameLocation(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError StackUtil::GetFrameLocation([[maybe_unused]] jvmtiEnv* env,
                                        jthread java_thread,
                                        jint depth,
                                        jmethodID* method_ptr,
@@ -877,8 +879,8 @@
     visitor->stack_depths.push_back(visitor->current_stack_depth);
   }
 
-  void VisitRoot(art::mirror::Object* obj, const art::RootInfo& info ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(art::Locks::mutator_lock_) {
+  void VisitRoot(art::mirror::Object* obj, [[maybe_unused]] const art::RootInfo& info) override
+      REQUIRES_SHARED(art::Locks::mutator_lock_) {
     for (const art::Handle<art::mirror::Object>& m : monitors) {
       if (m.Get() == obj) {
         return;
@@ -1219,7 +1221,7 @@
 
 template <>
 bool NonStandardExitFrames<NonStandardExitType::kForceReturn>::CheckFunctions(
-    jvmtiEnv* env, art::ArtMethod* calling ATTRIBUTE_UNUSED, art::ArtMethod* called) {
+    jvmtiEnv* env, [[maybe_unused]] art::ArtMethod* calling, art::ArtMethod* called) {
   if (UNLIKELY(called->IsNative())) {
     result_ = ERR(OPAQUE_FRAME);
     JVMTI_LOG(INFO, env) << "Cannot force early return from " << called->PrettyMethod()
@@ -1297,7 +1299,7 @@
 template <>
 void AddDelayedMethodExitEvent<std::nullptr_t>(EventHandler* handler,
                                                art::ShadowFrame* frame,
-                                               std::nullptr_t null_val ATTRIBUTE_UNUSED) {
+                                               [[maybe_unused]] std::nullptr_t null_val) {
   jvalue jval;
   memset(&jval, 0, sizeof(jval));
   handler->AddDelayedNonStandardExitEvent(frame, false, jval);
@@ -1316,13 +1318,13 @@
     REQUIRES_SHARED(art::Locks::mutator_lock_)
         REQUIRES(art::Locks::user_code_suspension_lock_, art::Locks::thread_list_lock_);
 
-#define SIMPLE_VALID_RETURN_TYPE(type, ...)                                                        \
-  template <>                                                                                      \
-  bool ValidReturnType<type>(art::Thread * self ATTRIBUTE_UNUSED,                                  \
-                             art::ObjPtr<art::mirror::Class> return_type,                          \
-                             type value ATTRIBUTE_UNUSED) {                                        \
-    static constexpr std::initializer_list<art::Primitive::Type> types{ __VA_ARGS__ };             \
-    return std::find(types.begin(), types.end(), return_type->GetPrimitiveType()) != types.end();  \
+#define SIMPLE_VALID_RETURN_TYPE(type, ...)                                                       \
+  template <>                                                                                     \
+  bool ValidReturnType<type>([[maybe_unused]] art::Thread * self,                                 \
+                             art::ObjPtr<art::mirror::Class> return_type,                         \
+                             [[maybe_unused]] type value) {                                       \
+    static constexpr std::initializer_list<art::Primitive::Type> types{__VA_ARGS__};              \
+    return std::find(types.begin(), types.end(), return_type->GetPrimitiveType()) != types.end(); \
   }
 
 SIMPLE_VALID_RETURN_TYPE(jlong, art::Primitive::kPrimLong);
diff --git a/openjdkjvmti/ti_thread.cc b/openjdkjvmti/ti_thread.cc
index b5bc35e..191b63c 100644
--- a/openjdkjvmti/ti_thread.cc
+++ b/openjdkjvmti/ti_thread.cc
@@ -205,7 +205,7 @@
   runtime->GetRuntimeCallbacks()->RemoveThreadLifecycleCallback(&gThreadCallback);
 }
 
-jvmtiError ThreadUtil::GetCurrentThread(jvmtiEnv* env ATTRIBUTE_UNUSED, jthread* thread_ptr) {
+jvmtiError ThreadUtil::GetCurrentThread([[maybe_unused]] jvmtiEnv* env, jthread* thread_ptr) {
   art::Thread* self = art::Thread::Current();
 
   art::ScopedObjectAccess soa(self);
@@ -289,7 +289,9 @@
 
     info_ptr->is_daemon = target->IsDaemon();
 
-    art::ObjPtr<art::mirror::Object> peer = target->GetPeerFromOtherThread();
+    art::ObjPtr<art::mirror::Object> peer = target->LockedGetPeerFromOtherThread();
+    // *target may be invalid here since we may have temporarily released thread_list_lock_.
+    target = nullptr;  // Value should not be used.
 
     // ThreadGroup.
     if (peer != nullptr) {
@@ -547,6 +549,7 @@
 
 // Suspends the current thread if it has any suspend requests on it.
 void ThreadUtil::SuspendCheck(art::Thread* self) {
+  DCHECK(!self->ReadFlag(art::ThreadFlag::kSuspensionImmune));
   art::ScopedObjectAccess soa(self);
   // Really this is only needed if we are in FastJNI and actually have the mutator_lock_ already.
   self->FullSuspendCheck();
@@ -564,7 +567,7 @@
   return WouldSuspendForUserCodeLocked(self);
 }
 
-jvmtiError ThreadUtil::GetThreadState(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError ThreadUtil::GetThreadState([[maybe_unused]] jvmtiEnv* env,
                                       jthread thread,
                                       jint* thread_state_ptr) {
   if (thread_state_ptr == nullptr) {
@@ -640,20 +643,30 @@
 
   art::MutexLock mu(current, *art::Locks::thread_list_lock_);
   std::list<art::Thread*> thread_list = art::Runtime::Current()->GetThreadList()->GetList();
+  // We have to be careful with threads exiting while we build this list.
+  std::vector<art::ThreadExitFlag> tefs(thread_list.size());
+  auto i = tefs.begin();
+  for (art::Thread* thd : thread_list) {
+    thd->NotifyOnThreadExit(&*i++);
+  }
+  DCHECK(i == tefs.end());
 
   std::vector<art::ObjPtr<art::mirror::Object>> peers;
 
+  i = tefs.begin();
   for (art::Thread* thread : thread_list) {
-    // Skip threads that are still starting.
-    if (thread->IsStillStarting()) {
-      continue;
+    art::ThreadExitFlag* tef = &*i++;
+    // Skip threads that have since exited or are still starting.
+    if (!tef->HasExited() && !thread->IsStillStarting()) {
+      // LockedGetPeerFromOtherThreads() may release lock!
+      art::ObjPtr<art::mirror::Object> peer = thread->LockedGetPeerFromOtherThread(tef);
+      if (peer != nullptr) {
+        peers.push_back(peer);
+      }
     }
-
-    art::ObjPtr<art::mirror::Object> peer = thread->GetPeerFromOtherThread();
-    if (peer != nullptr) {
-      peers.push_back(peer);
-    }
+    thread->UnregisterThreadExitFlag(tef);
   }
+  DCHECK(i == tefs.end());
 
   if (peers.empty()) {
     *threads_count_ptr = 0;
@@ -665,8 +678,8 @@
       return data_result;
     }
     jthread* threads = reinterpret_cast<jthread*>(data);
-    for (size_t i = 0; i != peers.size(); ++i) {
-      threads[i] = soa.AddLocalReference<jthread>(peers[i]);
+    for (size_t j = 0; j != peers.size(); ++j) {
+      threads[j] = soa.AddLocalReference<jthread>(peers[j]);
     }
 
     *threads_count_ptr = static_cast<jint>(peers.size());
@@ -900,17 +913,13 @@
         }
       }
     }
-    bool timeout = true;
     art::Thread* ret_target = art::Runtime::Current()->GetThreadList()->SuspendThreadByPeer(
-        target_jthread,
-        art::SuspendReason::kForUserCode,
-        &timeout);
-    if (ret_target == nullptr && !timeout) {
+        target_jthread, art::SuspendReason::kForUserCode);
+    if (ret_target == nullptr) {
       // TODO It would be good to get more information about why exactly the thread failed to
       // suspend.
       return ERR(INTERNAL);
-    } else if (!timeout) {
-      // we didn't time out and got a result.
+    } else {
       return OK;
     }
     // We timed out. Just go around and try again.
@@ -927,10 +936,11 @@
       // This can only happen if we race with another thread to suspend 'self' and we lose.
       return ERR(THREAD_SUSPENDED);
     }
-    // We shouldn't be able to fail this.
-    if (!self->ModifySuspendCount(self, +1, nullptr, art::SuspendReason::kForUserCode)) {
-      // TODO More specific error would be nice.
-      return ERR(INTERNAL);
+    {
+      // IncrementSuspendCount normally needs thread_list_lock_ to ensure the thread stays
+      // around. In this case we are the target thread, so we fake it.
+      art::FakeMutexLock fmu(*art::Locks::thread_list_lock_);
+      self->IncrementSuspendCount(self, nullptr, nullptr, art::SuspendReason::kForUserCode);
     }
   }
   // Once we have requested the suspend we actually go to sleep. We need to do this after releasing
@@ -940,7 +950,7 @@
   return OK;
 }
 
-jvmtiError ThreadUtil::SuspendThread(jvmtiEnv* env ATTRIBUTE_UNUSED, jthread thread) {
+jvmtiError ThreadUtil::SuspendThread([[maybe_unused]] jvmtiEnv* env, jthread thread) {
   art::Thread* self = art::Thread::Current();
   bool target_is_self = false;
   {
@@ -961,8 +971,7 @@
   }
 }
 
-jvmtiError ThreadUtil::ResumeThread(jvmtiEnv* env ATTRIBUTE_UNUSED,
-                                    jthread thread) {
+jvmtiError ThreadUtil::ResumeThread([[maybe_unused]] jvmtiEnv* env, jthread thread) {
   if (thread == nullptr) {
     return ERR(NULL_POINTER);
   }
@@ -1079,7 +1088,7 @@
   return OK;
 }
 
-jvmtiError ThreadUtil::StopThread(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError ThreadUtil::StopThread([[maybe_unused]] jvmtiEnv* env,
                                   jthread thread,
                                   jobject exception) {
   art::Thread* self = art::Thread::Current();
@@ -1128,7 +1137,7 @@
   }
 }
 
-jvmtiError ThreadUtil::InterruptThread(jvmtiEnv* env ATTRIBUTE_UNUSED, jthread thread) {
+jvmtiError ThreadUtil::InterruptThread([[maybe_unused]] jvmtiEnv* env, jthread thread) {
   art::Thread* self = art::Thread::Current();
   art::ScopedObjectAccess soa(self);
   art::MutexLock tll_mu(self, *art::Locks::thread_list_lock_);
diff --git a/openjdkjvmti/ti_threadgroup.cc b/openjdkjvmti/ti_threadgroup.cc
index 120024e..bfe6b51 100644
--- a/openjdkjvmti/ti_threadgroup.cc
+++ b/openjdkjvmti/ti_threadgroup.cc
@@ -171,18 +171,26 @@
   CHECK(thread_group != nullptr);
 
   art::MutexLock mu(art::Thread::Current(), *art::Locks::thread_list_lock_);
-  for (art::Thread* t : art::Runtime::Current()->GetThreadList()->GetList()) {
-    if (t->IsStillStarting()) {
-      continue;
-    }
-    art::ObjPtr<art::mirror::Object> peer = t->GetPeerFromOtherThread();
-    if (peer == nullptr) {
-      continue;
-    }
-    if (IsInDesiredThreadGroup(thread_group, peer)) {
+  std::list<art::Thread*> thread_list = art::Runtime::Current()->GetThreadList()->GetList();
+  // We have to be careful with threads exiting while we build this list.
+  std::vector<art::ThreadExitFlag> tefs(thread_list.size());
+  auto i = tefs.begin();
+  for (art::Thread* thd : thread_list) {
+    thd->NotifyOnThreadExit(&*i++);
+  }
+  DCHECK(i == tefs.end());
+
+  i = tefs.begin();
+  for (art::Thread* t : thread_list) {
+    art::ThreadExitFlag* tef = &*i++;
+    art::ObjPtr<art::mirror::Object> peer = t->LockedGetPeerFromOtherThread(tef);
+    if (peer != nullptr && !tef->HasExited() && !t->IsStillStarting() &&
+        IsInDesiredThreadGroup(thread_group, peer)) {
       thread_peers->push_back(peer);
     }
+    t->UnregisterThreadExitFlag(tef);
   }
+  DCHECK(i == tefs.end());
 }
 
 static void GetChildThreadGroups(art::Handle<art::mirror::Object> thread_group,
diff --git a/openjdkjvmti/ti_timers.cc b/openjdkjvmti/ti_timers.cc
index 11b58c4..f02501f 100644
--- a/openjdkjvmti/ti_timers.cc
+++ b/openjdkjvmti/ti_timers.cc
@@ -45,7 +45,7 @@
 
 namespace openjdkjvmti {
 
-jvmtiError TimerUtil::GetAvailableProcessors(jvmtiEnv* env ATTRIBUTE_UNUSED,
+jvmtiError TimerUtil::GetAvailableProcessors([[maybe_unused]] jvmtiEnv* env,
                                              jint* processor_count_ptr) {
   if (processor_count_ptr == nullptr) {
     return ERR(NULL_POINTER);
@@ -56,7 +56,7 @@
   return ERR(NONE);
 }
 
-jvmtiError TimerUtil::GetTimerInfo(jvmtiEnv* env ATTRIBUTE_UNUSED, jvmtiTimerInfo* info_ptr) {
+jvmtiError TimerUtil::GetTimerInfo([[maybe_unused]] jvmtiEnv* env, jvmtiTimerInfo* info_ptr) {
   if (info_ptr == nullptr) {
     return ERR(NULL_POINTER);
   }
@@ -69,7 +69,7 @@
   return ERR(NONE);
 }
 
-jvmtiError TimerUtil::GetTime(jvmtiEnv* env ATTRIBUTE_UNUSED, jlong* nanos_ptr) {
+jvmtiError TimerUtil::GetTime([[maybe_unused]] jvmtiEnv* env, jlong* nanos_ptr) {
   if (nanos_ptr == nullptr) {
     return ERR(NULL_POINTER);
   }
diff --git a/openjdkjvmti/transform.cc b/openjdkjvmti/transform.cc
index bccdcb1..1e5378d 100644
--- a/openjdkjvmti/transform.cc
+++ b/openjdkjvmti/transform.cc
@@ -60,7 +60,7 @@
 #include "mirror/class_ext.h"
 #include "mirror/class_loader-inl.h"
 #include "mirror/string-inl.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 #include "scoped_thread_state_change-inl.h"
 #include "stack.h"
 #include "thread_list.h"
@@ -76,20 +76,23 @@
 }
 
 // Initialize templates.
-template
-void Transformer::TransformSingleClassDirect<ArtJvmtiEvent::kClassFileLoadHookNonRetransformable>(
-    EventHandler* event_handler, art::Thread* self, /*in-out*/ArtClassDefinition* def);
-template
-void Transformer::TransformSingleClassDirect<ArtJvmtiEvent::kClassFileLoadHookRetransformable>(
-    EventHandler* event_handler, art::Thread* self, /*in-out*/ArtClassDefinition* def);
-template
-void Transformer::TransformSingleClassDirect<ArtJvmtiEvent::kStructuralDexFileLoadHook>(
-    EventHandler* event_handler, art::Thread* self, /*in-out*/ArtClassDefinition* def);
+template void Transformer::CallClassFileLoadHooksSingleClass<
+    ArtJvmtiEvent::kClassFileLoadHookNonRetransformable>(EventHandler* event_handler,
+                                                         art::Thread* self,
+                                                         /*in-out*/ ArtClassDefinition* def);
+template void Transformer::CallClassFileLoadHooksSingleClass<
+    ArtJvmtiEvent::kClassFileLoadHookRetransformable>(EventHandler* event_handler,
+                                                      art::Thread* self,
+                                                      /*in-out*/ ArtClassDefinition* def);
+template void Transformer::CallClassFileLoadHooksSingleClass<
+    ArtJvmtiEvent::kStructuralDexFileLoadHook>(EventHandler* event_handler,
+                                               art::Thread* self,
+                                               /*in-out*/ ArtClassDefinition* def);
 
-template<ArtJvmtiEvent kEvent>
-void Transformer::TransformSingleClassDirect(EventHandler* event_handler,
-                                             art::Thread* self,
-                                             /*in-out*/ArtClassDefinition* def) {
+template <ArtJvmtiEvent kEvent>
+void Transformer::CallClassFileLoadHooksSingleClass(EventHandler* event_handler,
+                                                    art::Thread* self,
+                                                    /*in-out*/ ArtClassDefinition* def) {
   static_assert(kEvent == ArtJvmtiEvent::kClassFileLoadHookNonRetransformable ||
                 kEvent == ArtJvmtiEvent::kClassFileLoadHookRetransformable ||
                 kEvent == ArtJvmtiEvent::kStructuralDexFileLoadHook,
@@ -115,21 +118,41 @@
 }
 
 template <RedefinitionType kType>
-void Transformer::RetransformClassesDirect(
-    art::Thread* self,
-    /*in-out*/ std::vector<ArtClassDefinition>* definitions) {
-  constexpr ArtJvmtiEvent kEvent = kType == RedefinitionType::kNormal
-                                       ? ArtJvmtiEvent::kClassFileLoadHookRetransformable
-                                       : ArtJvmtiEvent::kStructuralDexFileLoadHook;
-  for (ArtClassDefinition& def : *definitions) {
-    TransformSingleClassDirect<kEvent>(gEventHandler, self, &def);
+void Transformer::CallClassFileLoadHooks(art::Thread* self,
+                                         /*in-out*/ std::vector<ArtClassDefinition>* definitions) {
+  if (kType == RedefinitionType::kNormal) {
+    // For normal redefinition we have to call ClassFileLoadHook according to the spec. We use an
+    // internal event "ClassFileLoadHookRetransformable" for agents that can redefine and a
+    // "ClassFileLoadHookNonRetransformable" for agents that cannot redefine. When an agent is
+    // attached to a non-debuggable environment, we cannot redefine any classes. Splitting the
+    // ClassFileLoadHooks allows us to differentiate between these two cases. This method is only
+    // called when redefinition is allowed so just run ClassFileLoadHookRetransformable hooks.
+    for (ArtClassDefinition& def : *definitions) {
+      CallClassFileLoadHooksSingleClass<ArtJvmtiEvent::kClassFileLoadHookRetransformable>(
+          gEventHandler, self, &def);
+    }
+  } else {
+    // For structural redefinition we call StructualDexFileLoadHook in addition to the
+    // ClassFileLoadHooks. This let's us specify if structural modifications are allowed.
+    // TODO(mythria): The spec only specifies we need to call ClassFileLoadHooks, the
+    // StructuralDexFileLoadHooks is internal to ART. It is not clear if we need to run all
+    // StructuralDexFileHooks before ClassFileLoadHooks. Doing it this way to keep the existing
+    // behaviour.
+    for (ArtClassDefinition& def : *definitions) {
+      CallClassFileLoadHooksSingleClass<ArtJvmtiEvent::kStructuralDexFileLoadHook>(
+          gEventHandler, self, &def);
+    }
+    for (ArtClassDefinition& def : *definitions) {
+      CallClassFileLoadHooksSingleClass<ArtJvmtiEvent::kClassFileLoadHookRetransformable>(
+          gEventHandler, self, &def);
+    }
   }
 }
 
-template void Transformer::RetransformClassesDirect<RedefinitionType::kNormal>(
-      art::Thread* self, /*in-out*/std::vector<ArtClassDefinition>* definitions);
-template void Transformer::RetransformClassesDirect<RedefinitionType::kStructural>(
-      art::Thread* self, /*in-out*/std::vector<ArtClassDefinition>* definitions);
+template void Transformer::CallClassFileLoadHooks<RedefinitionType::kNormal>(
+    art::Thread* self, /*in-out*/ std::vector<ArtClassDefinition>* definitions);
+template void Transformer::CallClassFileLoadHooks<RedefinitionType::kStructural>(
+    art::Thread* self, /*in-out*/ std::vector<ArtClassDefinition>* definitions);
 
 jvmtiError Transformer::RetransformClasses(jvmtiEnv* env,
                                            jint class_count,
@@ -151,7 +174,7 @@
   std::vector<ArtClassDefinition> definitions;
   jvmtiError res = OK;
   for (jint i = 0; i < class_count; i++) {
-    res = Redefiner::GetClassRedefinitionError<RedefinitionType::kNormal>(classes[i], &error_msg);
+    res = Redefiner::CanRedefineClass<RedefinitionType::kNormal>(classes[i], &error_msg);
     if (res != OK) {
       JVMTI_LOG(WARNING, env) << "FAILURE TO RETRANSFORM " << error_msg;
       return res;
@@ -164,8 +187,8 @@
     }
     definitions.push_back(std::move(def));
   }
-  RetransformClassesDirect<RedefinitionType::kStructural>(self, &definitions);
-  RetransformClassesDirect<RedefinitionType::kNormal>(self, &definitions);
+
+  CallClassFileLoadHooks<RedefinitionType::kStructural>(self, &definitions);
   RedefinitionType redef_type =
       std::any_of(definitions.cbegin(),
                   definitions.cend(),
diff --git a/openjdkjvmti/transform.h b/openjdkjvmti/transform.h
index a58b50e..3b7f855 100644
--- a/openjdkjvmti/transform.h
+++ b/openjdkjvmti/transform.h
@@ -51,16 +51,14 @@
  public:
   static void Register(EventHandler* eh);
 
-  template<ArtJvmtiEvent kEvent>
-  static void TransformSingleClassDirect(
-      EventHandler* event_handler,
-      art::Thread* self,
-      /*in-out*/ArtClassDefinition* def);
+  template <ArtJvmtiEvent kEvent>
+  static void CallClassFileLoadHooksSingleClass(EventHandler* event_handler,
+                                                art::Thread* self,
+                                                /*in-out*/ ArtClassDefinition* def);
 
-  template<RedefinitionType kType>
-  static void RetransformClassesDirect(
-      art::Thread* self,
-      /*in-out*/std::vector<ArtClassDefinition>* definitions);
+  template <RedefinitionType kType>
+  static void CallClassFileLoadHooks(art::Thread* self,
+                                     /*in-out*/ std::vector<ArtClassDefinition>* definitions);
 
   static jvmtiError RetransformClasses(jvmtiEnv* env,
                                        jint class_count,
diff --git a/perfetto_hprof/perfetto_hprof.cc b/perfetto_hprof/perfetto_hprof.cc
index e805cf3..166dca8 100644
--- a/perfetto_hprof/perfetto_hprof.cc
+++ b/perfetto_hprof/perfetto_hprof.cc
@@ -438,10 +438,10 @@
     referred_objects_->emplace_back(std::move(field_name), ref);
   }
 
-  void VisitRootIfNonNull(art::mirror::CompressedReference<art::mirror::Object>* root
-                              ATTRIBUTE_UNUSED) const {}
-  void VisitRoot(art::mirror::CompressedReference<art::mirror::Object>* root
-                     ATTRIBUTE_UNUSED) const {}
+  void VisitRootIfNonNull(
+      [[maybe_unused]] art::mirror::CompressedReference<art::mirror::Object>* root) const {}
+  void VisitRoot(
+      [[maybe_unused]] art::mirror::CompressedReference<art::mirror::Object>* root) const {}
 
  private:
   // We can use a raw Object* pointer here, because there are no concurrent GC threads after the
@@ -594,8 +594,12 @@
   std::vector<std::pair<std::string, art::mirror::Object*>> referred_objects;
   ReferredObjectsFinder objf(&referred_objects, emit_field_ids);
 
-  if (klass->GetClassFlags() != art::mirror::kClassFlagNormal &&
-      klass->GetClassFlags() != art::mirror::kClassFlagPhantomReference) {
+  uint32_t klass_flags = klass->GetClassFlags();
+  if (klass_flags != art::mirror::kClassFlagNormal &&
+      klass_flags != art::mirror::kClassFlagSoftReference &&
+      klass_flags != art::mirror::kClassFlagWeakReference &&
+      klass_flags != art::mirror::kClassFlagFinalizerReference &&
+      klass_flags != art::mirror::kClassFlagPhantomReference) {
     obj->VisitReferences(objf, art::VoidFunctor());
   } else {
     for (art::mirror::Class* cls = klass; cls != nullptr; cls = cls->GetSuperClass().Ptr()) {
@@ -803,9 +807,13 @@
                       art::mirror::Class* klass,
                       perfetto::protos::pbzero::HeapGraphObject* object_proto)
       REQUIRES_SHARED(art::Locks::mutator_lock_) {
-    const bool emit_field_ids = klass->GetClassFlags() != art::mirror::kClassFlagObjectArray &&
-                                klass->GetClassFlags() != art::mirror::kClassFlagNormal &&
-                                klass->GetClassFlags() != art::mirror::kClassFlagPhantomReference;
+    const uint32_t klass_flags = klass->GetClassFlags();
+    const bool emit_field_ids = klass_flags != art::mirror::kClassFlagObjectArray &&
+                                klass_flags != art::mirror::kClassFlagNormal &&
+                                klass_flags != art::mirror::kClassFlagSoftReference &&
+                                klass_flags != art::mirror::kClassFlagWeakReference &&
+                                klass_flags != art::mirror::kClassFlagFinalizerReference &&
+                                klass_flags != art::mirror::kClassFlagPhantomReference;
     std::vector<std::pair<std::string, art::mirror::Object*>> referred_objects =
         GetReferences(obj, klass, emit_field_ids);
 
diff --git a/profman/Android.bp b/profman/Android.bp
index ac80641..7eff771 100644
--- a/profman/Android.bp
+++ b/profman/Android.bp
@@ -199,9 +199,6 @@
         "art_gtest_defaults",
         "art_profman_tests_defaults",
     ],
-    shared_libs: [
-        "libprofiled",
-    ],
     target: {
         host: {
             required: ["profmand"],
@@ -217,9 +214,6 @@
         "art_profman_tests_defaults",
     ],
     data: [":generate-boot-image"],
-    shared_libs: [
-        "libprofile",
-    ],
     target: {
         host: {
             required: ["profman"],
diff --git a/profman/art_standalone_profman_tests.xml b/profman/art_standalone_profman_tests.xml
index a8d34b2..875f263 100644
--- a/profman/art_standalone_profman_tests.xml
+++ b/profman/art_standalone_profman_tests.xml
@@ -14,6 +14,9 @@
      limitations under the License.
 -->
 <configuration description="Runs art_standalone_profman_tests (as root).">
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
+
     <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
 
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
@@ -43,8 +46,6 @@
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp/art_standalone_profman_tests" />
         <option name="module-name" value="art_standalone_profman_tests" />
-        <option name="ld-library-path-32" value="/apex/com.android.art/lib" />
-        <option name="ld-library-path-64" value="/apex/com.android.art/lib64" />
 
         <!-- The following tests from `art_standalone_profman_tests` are currently failing when
              run as 32-bit on a 64-bit device, because they try to execute other system (64-bit)
diff --git a/profman/profile_assistant_test.cc b/profman/profile_assistant_test.cc
index 93766e5..d31df20 100644
--- a/profman/profile_assistant_test.cc
+++ b/profman/profile_assistant_test.cc
@@ -2030,9 +2030,6 @@
                profile1,
                &info1);
 
-  std::string input_content;
-  ASSERT_TRUE(android::base::ReadFileToString(profile1.GetFilename(), &input_content));
-
   // Run profman and pass the real dex file with --apk-fd. It won't match any entry in the profile.
   android::base::unique_fd apk_fd(
       // NOLINTNEXTLINE - Profman needs file to be opened after fork() and exec()
@@ -2052,9 +2049,9 @@
   ASSERT_EQ(ExecAndReturnCode(argv_str, &error), ProfmanResult::kCopyAndUpdateNoMatch) << error;
 
   // Verify that the content is the same.
-  std::string output_content;
-  ASSERT_TRUE(android::base::ReadFileToString(reference_profile.GetFilename(), &output_content));
-  EXPECT_EQ(input_content, output_content);
+  ProfileCompilationInfo result;
+  ASSERT_TRUE(result.Load(reference_profile.GetFd()));
+  EXPECT_TRUE(result.Equals(info1));
 }
 
 TEST_F(ProfileAssistantTest, BootImageMerge) {
diff --git a/profman/profman.cc b/profman/profman.cc
index 0958f4b..adcf7ac 100644
--- a/profman/profman.cc
+++ b/profman/profman.cc
@@ -617,7 +617,8 @@
       std::vector<std::unique_ptr<const DexFile>> dex_files_for_location;
       // We do not need to verify the apk for processing profiles.
       if (use_apk_fd_list) {
-          ArtDexFileLoader dex_file_loader(apks_fd_[i], dex_locations_[i]);
+          File file(apks_fd_[i], /*check_usage=*/false);
+          ArtDexFileLoader dex_file_loader(&file, dex_locations_[i]);
           if (dex_file_loader.Open(/*verify=*/false,
                                    kVerifyChecksum,
                                    /*allow_no_dex_files=*/true,
@@ -633,7 +634,7 @@
           PLOG(ERROR) << "Unable to open '" << apk_files_[i] << "'";
           return false;
         }
-        ArtDexFileLoader dex_file_loader(file.Release(), dex_locations_[i]);
+        ArtDexFileLoader dex_file_loader(&file, dex_locations_[i]);
         if (dex_file_loader.Open(/*verify=*/false,
                                  kVerifyChecksum,
                                  /*allow_no_dex_files=*/true,
@@ -800,10 +801,10 @@
     return dump_only_;
   }
 
-  // Creates the inline-cache portion of a text-profile line. If there is no
-  // inline-caches this will be and empty string. Otherwise it will be '@'
-  // followed by an IC description matching the format described by ProcessLine
-  // below. Note that this will collapse all ICs with the same receiver type.
+  // Creates the inline-cache portion of a text-profile line. If the class def can't be found, or if
+  // there is no inline-caches this will be and empty string. Otherwise it will be '@' followed by
+  // an IC description matching the format described by ProcessLine below. Note that this will
+  // collapse all ICs with the same receiver type.
   std::string GetInlineCacheLine(const ProfileCompilationInfo& profile_info,
                                  const dex::MethodId& id,
                                  const DexFile* dex_file,
@@ -821,10 +822,14 @@
       std::set<dex::TypeIndex> classes_;
     };
     std::unordered_map<dex::TypeIndex, IcLineInfo> ics;
+    const dex::ClassDef* class_def = dex_file->FindClassDef(id.class_idx_);
+    if (class_def == nullptr) {
+      // No class def found.
+      return "";
+    }
+
     CodeItemInstructionAccessor accessor(
-        *dex_file,
-        dex_file->GetCodeItem(dex_file->FindCodeItemOffset(*dex_file->FindClassDef(id.class_idx_),
-                                                            dex_method_idx)));
+        *dex_file, dex_file->GetCodeItem(dex_file->FindCodeItemOffset(*class_def, dex_method_idx)));
     for (const auto& [pc, ic_data] : *inline_caches) {
       const Instruction& inst = accessor.InstructionAt(pc);
       const dex::MethodId& target = dex_file->GetMethodId(inst.VRegB());
@@ -908,8 +913,13 @@
           }
           std::string inline_cache_string =
               GetInlineCacheLine(profile_info, id, dex_file.get(), dex_method_idx);
-          out_lines->insert(flags_string + type_string + kMethodSep + method_name +
-                            signature_string + inline_cache_string);
+          out_lines->insert(ART_FORMAT("{}{}{}{}{}{}",
+                                       flags_string,
+                                       type_string,
+                                       kMethodSep,
+                                       method_name,
+                                       signature_string,
+                                       inline_cache_string));
         }
       }
     }
diff --git a/runtime/Android.bp b/runtime/Android.bp
index 1c4b871..17f09cf 100644
--- a/runtime/Android.bp
+++ b/runtime/Android.bp
@@ -34,7 +34,7 @@
 
 // These are defaults for native shared libaries that are expected to be
 // in stack traces often.
-libart_cc_defaults {
+cc_defaults {
     name: "libart_nativeunwind_defaults",
     target: {
         host: {
@@ -43,37 +43,6 @@
                 "-Wno-unused-command-line-argument",
             ],
         },
-        android_arm: {
-            // Arm 32 bit does not produce complete exidx unwind information
-            // so keep the .debug_frame which is relatively small and does
-            // include needed unwind information.
-            // See b/132992102 and b/145790995 for details.
-            strip: {
-                keep_symbols_and_debug_frame: true,
-            },
-        },
-        // For all other architectures, leave the symbols in the shared library
-        // so that stack unwinders can produce meaningful name resolution.
-        android_arm64: {
-            strip: {
-                keep_symbols: true,
-            },
-        },
-        android_riscv64: {
-            strip: {
-                keep_symbols: true,
-            },
-        },
-        android_x86: {
-            strip: {
-                keep_symbols: true,
-            },
-        },
-        android_x86_64: {
-            strip: {
-                keep_symbols: true,
-            },
-        },
     },
 }
 
@@ -87,8 +56,14 @@
     // ART's macros.h depends on libbase's macros.h.
     // Note: runtime_options.h depends on cmdline. But we don't really want to export this
     //       generically. dex2oat takes care of it itself.
-    header_libs: ["art_libartbase_headers"],
-    export_header_lib_headers: ["art_libartbase_headers"],
+    header_libs: [
+        "art_libartbase_headers",
+        "dlmalloc",
+    ],
+    export_header_lib_headers: [
+        "art_libartbase_headers",
+        "dlmalloc",
+    ],
 
     // We optimize Thread::Current() with a direct TLS access. This requires
     // access to a platform specific Bionic header.
@@ -109,15 +84,156 @@
     ],
 }
 
-libart_cc_defaults {
-    name: "libart_defaults",
+// Generated headers target required by libart.
+cc_library_headers {
+    name: "libart_generated_headers",
     defaults: ["art_defaults"],
     host_supported: true,
+
+    // asm_support_gen.h (used by asm_support.h) is generated with cpp-define-generator
+    generated_headers: ["cpp-define-generator-asm-support"],
+    // export our headers so the libart(d)-gtest targets can use it as well.
+    export_generated_headers: ["cpp-define-generator-asm-support"],
+
+    apex_available: [
+        "com.android.art",
+        "com.android.art.debug",
+    ],
+}
+
+// Common dependencies for `libart-runtime_deps` and `libartd-runtime_deps`.
+cc_defaults {
+    name: "libart-runtime_common_deps",
+    defaults: ["art_defaults"],
+    host_supported: true,
+    target: {
+        android: {
+            header_libs: [
+                "libnativeloader-headers", // For dlext_namespaces.h
+            ],
+            shared_libs: [
+                "libdl_android",
+                "libstatspull", // for pulled atoms
+                "libstatssocket", // for pulled atoms
+                "libz", // For adler32.
+                "heapprofd_client_api",
+            ],
+            static_libs: [
+                "libmodules-utils-build",
+                "libstatslog_art",
+            ],
+        },
+        host: {
+            shared_libs: [
+                "libz", // For adler32.
+            ],
+        },
+    },
+    header_libs: [
+        "art_cmdlineparser_headers",
+        "cpp-define-generator-definitions",
+        "jni_platform_headers",
+        "libart_headers",
+        "libnativehelper_header_only",
+        "libart_generated_headers",
+        // `libart-runtime` doesn't depend on all `libart-compiler` headers, it only requires
+        // `jit_create` to initialize the JIT compiler.
+        "libart-compiler_jit_headers",
+    ],
+    export_header_lib_headers: [
+        "libart_headers",
+        "libart_generated_headers",
+    ],
+    shared_libs: [
+        "libartpalette",
+        "libbase", // For common macros.
+        "liblog",
+        "liblz4",
+        "liblzma", // libelffile(d) dependency; must be repeated here since it's a static lib.
+        "libnativebridge",
+        "libnativeloader",
+        "libsigchain",
+        "libunwindstack",
+    ],
+    static_libs: ["libodrstatslog"],
+}
+
+cc_defaults {
+    name: "libart-runtime_deps",
+    defaults: ["libart-runtime_common_deps"],
+    static_libs: [
+        "libelffile",
+    ],
+    shared_libs: [
+        "libartbase",
+        "libdexfile",
+        "libprofile",
+    ],
+    export_shared_lib_headers: [
+        "libdexfile",
+    ],
+}
+
+cc_defaults {
+    name: "libartd-runtime_deps",
+    defaults: ["libart-runtime_common_deps"],
+    static_libs: [
+        "libelffiled",
+    ],
+    shared_libs: [
+        "libartbased",
+        "libdexfiled",
+        "libprofiled",
+    ],
+    export_shared_lib_headers: [
+        "libdexfiled",
+    ],
+}
+
+// Common defaults for `libart_defaults`, `libartd_defaults` and `libart-runtime_common_defaults`.
+cc_defaults {
+    name: "libart_common_defaults",
+    defaults: [
+        "art_defaults",
+        "libart_nativeunwind_defaults",
+        "art_hugepage_defaults",
+    ],
+    host_supported: true,
+    target: {
+        android_arm: {
+            ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS,
+        },
+        android_arm64: {
+            ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS,
+        },
+        android_x86: {
+            ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS,
+        },
+        android_x86_64: {
+            ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS,
+        },
+    },
+    runtime_libs: [
+        // Libraries loaded at runtime. Exceptions:
+        // - libart(d)-compiler.so and libopenjdk(d).so cannot be listed here
+        //   due to cyclic dependency.
+        // - libicu_jni.so is only loaded to handle dependency order in VM
+        //   startup (see Runtime::InitNativeMethods), but its API is internal
+        //   to com.android.i18n and not used by ART/libcore. Therefore it's not
+        //   listed here to avoid visibility issues. Instead it's linked from
+        //   the ART module namespace through an entry in requireNativeLibs in
+        //   manifest-art.json.
+        "libjavacore",
+    ],
+}
+
+// Common defaults for `libart-runtime_defaults` and `libartd-runtime_defaults`.
+cc_defaults {
+    name: "libart-runtime_common_defaults",
+    defaults: ["libart_common_defaults"],
     srcs: [
         "app_info.cc",
-        "aot_class_linker.cc",
         "art_field.cc",
-        "sdk_checker.cc",
         "art_method.cc",
         "backtrace_helper.cc",
         "barrier.cc",
@@ -138,18 +254,17 @@
         "debugger.cc",
         "dex/dex_file_annotations.cc",
         "dex_register_location.cc",
-        "elf_file.cc",
         "exec_utils.cc",
         "fault_handler.cc",
-        "gc/allocation_record.cc",
-        "gc/allocator/art-dlmalloc.cc",
-        "gc/allocator/rosalloc.cc",
         "gc/accounting/bitmap.cc",
         "gc/accounting/card_table.cc",
         "gc/accounting/heap_bitmap.cc",
         "gc/accounting/mod_union_table.cc",
         "gc/accounting/remembered_set.cc",
         "gc/accounting/space_bitmap.cc",
+        "gc/allocation_record.cc",
+        "gc/allocator/art-dlmalloc.cc",
+        "gc/allocator/rosalloc.cc",
         "gc/collector/concurrent_copying.cc",
         "gc/collector/garbage_collector.cc",
         "gc/collector/immune_region.cc",
@@ -178,8 +293,6 @@
         "handle.cc",
         "hidden_api.cc",
         "hprof/hprof.cc",
-        "image.cc",
-        "index_bss_mapping.cc",
         "indirect_reference_table.cc",
         "instrumentation.cc",
         "intern_table.cc",
@@ -197,8 +310,10 @@
         "jit/jit.cc",
         "jit/jit_code_cache.cc",
         "jit/jit_memory_region.cc",
-        "jit/profiling_info.cc",
+        "jit/jit_options.cc",
         "jit/profile_saver.cc",
+        "jit/profiling_info.cc",
+        "jit/small_pattern_matcher.cc",
         "jni/check_jni.cc",
         "jni/java_vm_ext.cc",
         "jni/jni_env_ext.cc",
@@ -226,10 +341,8 @@
         "mirror/var_handle.cc",
         "monitor.cc",
         "monitor_objects_stack_visitor.cc",
-        "native_bridge_art_interface.cc",
-        "native_stack_dump.cc",
-        "native/dalvik_system_DexFile.cc",
         "native/dalvik_system_BaseDexClassLoader.cc",
+        "native/dalvik_system_DexFile.cc",
         "native/dalvik_system_VMDebug.cc",
         "native/dalvik_system_VMRuntime.cc",
         "native/dalvik_system_VMStack.cc",
@@ -255,20 +368,27 @@
         "native/java_lang_reflect_Parameter.cc",
         "native/java_lang_reflect_Proxy.cc",
         "native/java_util_concurrent_atomic_AtomicLong.cc",
+        "native/jdk_internal_misc_Unsafe.cc",
         "native/libcore_io_Memory.cc",
         "native/libcore_util_CharsetUtils.cc",
         "native/org_apache_harmony_dalvik_ddmc_DdmServer.cc",
         "native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc",
         "native/sun_misc_Unsafe.cc",
-        "native/jdk_internal_misc_Unsafe.cc",
+        "native_bridge_art_interface.cc",
+        "native_stack_dump.cc",
         "non_debuggable_classes.cc",
         "nterp_helpers.cc",
-        "oat.cc",
-        "oat_file.cc",
-        "oat_file_assistant.cc",
-        "oat_file_assistant_context.cc",
-        "oat_file_manager.cc",
-        "oat_quick_method_header.cc",
+        "oat/aot_class_linker.cc",
+        "oat/elf_file.cc",
+        "oat/image.cc",
+        "oat/index_bss_mapping.cc",
+        "oat/oat.cc",
+        "oat/oat_file.cc",
+        "oat/oat_file_assistant.cc",
+        "oat/oat_file_assistant_context.cc",
+        "oat/oat_file_manager.cc",
+        "oat/oat_quick_method_header.cc",
+        "oat/stack_map.cc",
         "object_lock.cc",
         "offsets.cc",
         "parsed_options.cc",
@@ -286,9 +406,9 @@
         "runtime_intrinsics.cc",
         "runtime_options.cc",
         "scoped_thread_state_change.cc",
+        "sdk_checker.cc",
         "signal_catcher.cc",
         "stack.cc",
-        "stack_map.cc",
         "startup_completed_task.cc",
         "string_builder_append.cc",
         "thread.cc",
@@ -344,7 +464,6 @@
         arm: {
             srcs: [
                 "interpreter/mterp/nterp.cc",
-                "interpreter/mterp/nterp_impl.cc",
                 ":libart_mterp.armng",
                 "arch/arm/context_arm.cc",
                 "arch/arm/entrypoints_init_arm.cc",
@@ -360,7 +479,6 @@
         arm64: {
             srcs: [
                 "interpreter/mterp/nterp.cc",
-                "interpreter/mterp/nterp_impl.cc",
                 ":libart_mterp.arm64ng",
                 "arch/arm64/context_arm64.cc",
                 "arch/arm64/entrypoints_init_arm64.cc",
@@ -382,14 +500,12 @@
                 "arch/riscv64/quick_entrypoints_riscv64.S",
                 "arch/riscv64/thread_riscv64.cc",
                 "interpreter/mterp/nterp.cc",
-                "interpreter/mterp/nterp_impl.cc",
                 "monitor_pool.cc",
             ],
         },
         x86: {
             srcs: [
                 "interpreter/mterp/nterp.cc",
-                "interpreter/mterp/nterp_impl.cc",
                 ":libart_mterp.x86ng",
                 "arch/x86/context_x86.cc",
                 "arch/x86/entrypoints_init_x86.cc",
@@ -411,7 +527,6 @@
                 // Note that the fault_handler_x86.cc is not a mistake.  This file is
                 // shared between the x86 and x86_64 architectures.
                 "interpreter/mterp/nterp.cc",
-                "interpreter/mterp/nterp_impl.cc",
                 ":libart_mterp.x86_64ng",
                 "arch/x86_64/context_x86_64.cc",
                 "arch/x86_64/entrypoints_init_x86_64.cc",
@@ -439,36 +554,12 @@
                 "thread_android.cc",
                 "metrics/statsd.cc",
             ],
-            header_libs: [
-                "libnativeloader-headers", // For dlext_namespaces.h
-            ],
-            shared_libs: [
-                "libdl_android",
-                "libstatssocket",
-                "libz", // For adler32.
-                "heapprofd_client_api",
-            ],
-            static_libs: [
-                "libstatslog_art",
-            ],
             generated_sources: [
                 "apex-info-list-tinyxml",
                 "art-apex-cache-info",
             ],
             tidy_disabled_srcs: [":art-apex-cache-info"],
         },
-        android_arm: {
-            ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS,
-        },
-        android_arm64: {
-            ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS,
-        },
-        android_x86: {
-            ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS,
-        },
-        android_x86_64: {
-            ldflags: JIT_DEBUG_REGISTER_CODE_LDFLAGS,
-        },
         host: {
             srcs: [
                 "monitor_linux.cc",
@@ -479,63 +570,56 @@
                 "-fsanitize-address-use-after-return=never",
                 "-Wno-unused-command-line-argument",
             ],
-            shared_libs: [
-                "libz", // For adler32.
-            ],
         },
     },
-
     generated_sources: [
         "art_operator_srcs",
     ],
-    // asm_support_gen.h (used by asm_support.h) is generated with cpp-define-generator
-    generated_headers: ["cpp-define-generator-asm-support"],
-    // export our headers so the libart(d)-gtest targets can use it as well.
-    export_generated_headers: ["cpp-define-generator-asm-support"],
-
-    header_libs: [
-        "art_cmdlineparser_headers",
-        "cpp-define-generator-definitions",
-        "dlmalloc",
-        "jni_platform_headers",
-        "libart_headers",
-        "libnativehelper_header_only",
-    ],
-    export_header_lib_headers: [
-        "dlmalloc",
-        "libart_headers",
-    ],
     whole_static_libs: [
         "libcpu_features",
     ],
-    shared_libs: [
-        "libartpalette",
-        "libbase", // For common macros.
-        "liblog",
-        "liblz4",
-        "liblzma", // libelffile(d) dependency; must be repeated here since it's a static lib.
-        "libnativebridge",
-        "libnativeloader",
-        "libsigchain",
-        "libunwindstack",
-    ],
-    static_libs: ["libodrstatslog"],
-
-    runtime_libs: [
-        // Libraries loaded at runtime. Exceptions:
-        // - libart(d)-compiler.so and libopenjdk(d).so cannot be listed here
-        //   due to cyclic dependency.
-        // - libicu_jni.so is only loaded to handle dependency order in VM
-        //   startup (see Runtime::InitNativeMethods), but its API is internal
-        //   to com.android.i18n and not used by ART/libcore. Therefore it's not
-        //   listed here to avoid visibility issues. Instead it's linked from
-        //   the ART module namespace through an entry in requireNativeLibs in
-        //   manifest-art.json.
-        "libjavacore",
+    cflags: [
+        "-DBUILDING_LIBART",
     ],
 }
 
-libart_static_cc_defaults {
+cc_defaults {
+    name: "libart-runtime_defaults",
+    defaults: [
+        "libart-runtime_common_defaults",
+        "libart-runtime_deps",
+    ],
+}
+
+cc_defaults {
+    name: "libartd-runtime_defaults",
+    defaults: [
+        "art_debug_defaults",
+        "libart-runtime_common_defaults",
+        "libartd-runtime_deps",
+    ],
+}
+
+cc_defaults {
+    name: "libart_defaults",
+    defaults: [
+        "libart_common_defaults",
+        "libart-runtime_deps",
+        "libart-compiler_deps",
+    ],
+}
+
+cc_defaults {
+    name: "libartd_defaults",
+    defaults: [
+        "art_debug_defaults",
+        "libart_common_defaults",
+        "libartd-runtime_deps",
+        "libartd-compiler_deps",
+    ],
+}
+
+cc_defaults {
     name: "libart_static_base_defaults",
     whole_static_libs: [
         "libartpalette",
@@ -544,10 +628,11 @@
         "liblz4",
         "liblzma", // libelffile dependency; must be repeated here since it's a static lib.
         "libnativebridge",
-        "libnativeloader",
         "libodrstatslog",
-        "libsigchain_fake",
         "libunwindstack",
+    ],
+    exclude_static_libs: [
+        // This library comes from the static version of libunwindstack.
         "libz",
     ],
     target: {
@@ -573,10 +658,13 @@
         "libdexfile_static_defaults",
         "libdexfile_support_static_defaults",
         "libprofile_static_defaults",
+        "libart-compiler_static_defaults",
     ],
     whole_static_libs: [
-        "libart",
+        "libart-runtime",
         "libelffile",
+        "libsigchain_fake",
+        "libnativeloader",
     ],
 }
 
@@ -588,9 +676,51 @@
         "libdexfiled_static_defaults",
         "libdexfiled_support_static_defaults",
         "libprofiled_static_defaults",
+        "libartd-compiler_static_defaults",
     ],
     whole_static_libs: [
-        "libartd",
+        "libartd-runtime",
+        "libelffiled",
+        "libsigchain_fake",
+        "libnativeloader",
+    ],
+}
+
+// libart_static_defaults for standalone gtests.
+// Doesn't link libsigchain_fake.
+// Uses libart-(runtime/compiler)-for-test instead of libart-runtime/compiler.
+cc_defaults {
+    name: "libart-for-test_static_defaults",
+    defaults: [
+        "libart_static_base_defaults",
+        "libartbase_static_defaults",
+        "libdexfile_static_defaults",
+        "libdexfile_support_static_defaults",
+        "libprofile_static_defaults",
+        "libart-compiler-for-test_static_defaults",
+    ],
+    whole_static_libs: [
+        "libart-runtime-for-test",
+        "libelffile",
+    ],
+}
+
+// libartd_static_defaults for gtests.
+// Doesn't link libsigchain_fake.
+// Note that `libartd-runtime-for-test` is not required here, because `libartd-runtime`
+// doesn't use LTO.
+cc_defaults {
+    name: "libartd-for-test_static_defaults",
+    defaults: [
+        "libart_static_base_defaults",
+        "libartbased_static_defaults",
+        "libdexfiled_static_defaults",
+        "libdexfiled_support_static_defaults",
+        "libprofiled_static_defaults",
+        "libartd-compiler-for-test_static_defaults",
+    ],
+    whole_static_libs: [
+        "libartd-runtime",
         "libelffiled",
     ],
 }
@@ -604,24 +734,24 @@
         "base/locks.h",
         "class_status.h",
         "compilation_kind.h",
-        "gc_root.h",
-        "gc/allocator_type.h",
         "gc/allocator/rosalloc.h",
-        "gc/collector_type.h",
+        "gc/allocator_type.h",
         "gc/collector/gc_type.h",
         "gc/collector/mark_compact.h",
+        "gc/collector_type.h",
         "gc/space/region_space.h",
         "gc/space/space.h",
         "gc/weak_root_state.h",
-        "image.h",
-        "instrumentation.h",
+        "gc_root.h",
         "indirect_reference_table.h",
+        "instrumentation.h",
         "jdwp_provider.h",
         "jni_id_type.h",
         "linear_alloc.h",
         "lock_word.h",
-        "oat.h",
-        "oat_file.h",
+        "oat/image.h",
+        "oat/oat.h",
+        "oat/oat_file.h",
         "process_state.h",
         "reflective_value_visitor.h",
         "stack.h",
@@ -637,26 +767,19 @@
 // We always build dex2oat and dependencies, even if the host build is otherwise disabled, since
 // they are used to cross compile for the target.
 
-// Properties common to `libart` and `libart-broken`.
-art_cc_defaults {
-    name: "libart_common_defaults",
-    defaults: [
-        "libart_defaults",
-        "libart_nativeunwind_defaults",
-        "art_hugepage_defaults",
-    ],
-    whole_static_libs: [
-    ],
-    static_libs: [
-        "libelffile",
-    ],
-    shared_libs: [
-        "libartbase",
-        "libdexfile",
-        "libprofile",
-    ],
-    export_shared_lib_headers: [
-        "libdexfile",
+// Release version of the ART runtime library.
+art_cc_library_static {
+    name: "libart-runtime",
+    defaults: ["libart-runtime_defaults"],
+    apex_available: [
+        "com.android.art",
+        "com.android.art.debug",
+        // This lib doesn't go into test_broken_com.android.art, but the libart-broken
+        // needs to have the same apex_available list as its dependencies in order
+        // to compile against their sources. Then that change comes back up to affect
+        // libart as well, because it also needs to have the same apex_available as its
+        // dependencies.
+        "test_broken_com.android.art",
     ],
     target: {
         android: {
@@ -667,14 +790,39 @@
     },
 }
 
-// Release version of the ART runtime library.
+// For static linking with gtests. Same as `libart-runtime`, but without LTO.
+// When gtests static link a library with LTO enabled, they are also built with LTO.
+// This makes the build process use a lot of memory. b/277207452
+art_cc_library_static {
+    name: "libart-runtime-for-test",
+    defaults: ["libart-runtime_defaults"],
+}
+
+// Debug version of the ART runtime library.
+art_cc_library_static {
+    name: "libartd-runtime",
+    defaults: ["libartd-runtime_defaults"],
+    apex_available: [
+        "com.android.art.debug",
+        // TODO(b/183882457): This lib doesn't go into com.android.art, but
+        // apex_available lists need to be the same for internal libs to avoid
+        // stubs, and this depends on libsigchain.
+        "com.android.art",
+    ],
+}
+
+// Release version of the ART runtime library, bundled with `libart-compiler` for JIT support.
 art_cc_library {
     name: "libart",
-    defaults: ["libart_common_defaults"],
+    defaults: ["libart_defaults"],
+    whole_static_libs: [
+        "libart-compiler",
+        "libart-runtime",
+    ],
     apex_available: [
-        "com.android.art",
         "com.android.art.debug",
-        // libart doesn't go into test_broken_com.android.art, but the libart-broken
+        "com.android.art",
+        // This lib doesn't go into test_broken_com.android.art, but the libart-broken
         // needs to have the same apex_available list as its dependencies in order
         // to compile against their sources. Then that change comes back up to affect
         // libart as well, because it also needs to have the same apex_available as its
@@ -682,15 +830,50 @@
         "test_broken_com.android.art",
     ],
     afdo: true,
+    target: {
+        android: {
+            lto: {
+                thin: true,
+            },
+        },
+    },
 }
 
-// "Broken" version of the ART runtime library, used only for testing.
+art_cc_library {
+    name: "libart-unstripped",
+    defaults: ["libart_defaults"],
+    whole_static_libs: [
+        "libart-compiler",
+        "libart-runtime",
+    ],
+    apex_available: [
+        "com.android.art",
+        "com.android.art.debug",
+        // This lib doesn't go into test_broken_com.android.art, but the libart-broken
+        // needs to have the same apex_available list as its dependencies in order
+        // to compile against their sources. Then that change comes back up to affect
+        // libart as well, because it also needs to have the same apex_available as its
+        // dependencies.
+        "test_broken_com.android.art",
+    ],
+    strip: {
+        none: true,
+    },
+}
+
+// "Broken" version of the libart, used only for testing.
 art_cc_test_library {
     name: "libart-broken",
-    defaults: ["libart_common_defaults"],
+    defaults: [
+        "libart-runtime_defaults",
+        "libart_defaults",
+    ],
+    cflags: ["-DART_CRASH_RUNTIME_DELIBERATELY"],
     stem: "libart",
     gtest: false,
-    cflags: ["-DART_CRASH_RUNTIME_DELIBERATELY"],
+    whole_static_libs: [
+        "libart-compiler",
+    ],
     apex_available: [
         // libart-broken only goes into test_broken_com.android.art, but the libart-broken
         // needs to have the same apex_available list as its dependencies in order
@@ -701,25 +884,13 @@
     ],
 }
 
-// Debug version of the ART runtime library.
+// Debug version of the ART runtime library, bundled with `libartd-compiler` for JIT support.
 art_cc_library {
     name: "libartd",
-    defaults: [
-        "art_debug_defaults",
-        "libart_defaults",
-    ],
+    defaults: ["libartd_defaults"],
     whole_static_libs: [
-    ],
-    static_libs: [
-        "libelffiled",
-    ],
-    shared_libs: [
-        "libartbased",
-        "libdexfiled",
-        "libprofiled",
-    ],
-    export_shared_lib_headers: [
-        "libdexfiled",
+        "libartd-compiler",
+        "libartd-runtime",
     ],
     apex_available: [
         "com.android.art.debug",
@@ -748,40 +919,30 @@
         "common_runtime_test.cc",
         "dexopt_test.cc",
     ],
-    shared_libs: [
-        "libbase",
-        "libz", // libziparchive dependency; must be repeated here since it's a static lib.
-    ],
     static_libs: [
         "libprocinfo",
-        "libziparchive",
     ],
     header_libs: [
         "libnativehelper_header_only",
     ],
 }
 
-art_cc_library {
+art_cc_library_static {
     name: "libart-runtime-gtest",
     defaults: [
         "libart-runtime-gtest-defaults",
         "libart-gtest-defaults",
-    ],
-    shared_libs: [
-        "libart",
-        "libartbase-art-gtest",
+        "libart-for-test_static_defaults",
     ],
 }
 
-art_cc_library {
+art_cc_library_static {
     name: "libartd-runtime-gtest",
     defaults: [
+        "art_debug_defaults",
         "libart-runtime-gtest-defaults",
-        "libartd-gtest-defaults",
-    ],
-    shared_libs: [
-        "libartd",
-        "libartbased-art-gtest",
+        "libart-gtest-defaults",
+        "libartd-for-test_static_defaults",
     ],
 }
 
@@ -846,7 +1007,7 @@
         "method_handles_test.cc",
         "mirror/object_test.cc",
         "mirror/var_handle_test.cc",
-        "oat_file_assistant_test.cc",
+        "oat/oat_file_assistant_test.cc",
         "runtime_callbacks_test.cc",
         "subtype_check_test.cc",
         "transaction_test.cc",
@@ -901,7 +1062,6 @@
         "intern_table_test.cc",
         "interpreter/safe_math_test.cc",
         "interpreter/unstarted_runtime_test.cc",
-        "jit/jit_load_test.cc",
         "jit/jit_memory_region_test.cc",
         "jit/profile_saver_test.cc",
         "jit/profiling_info_test.cc",
@@ -917,8 +1077,8 @@
         "monitor_pool_test.cc",
         "monitor_test.cc",
         "native_stack_dump_test.cc",
-        "oat_file_assistant_test.cc",
-        "oat_file_test.cc",
+        "oat/oat_file_assistant_test.cc",
+        "oat/oat_file_test.cc",
         "parsed_options_test.cc",
         "prebuilt_tools_test.cc",
         "proxy_test.cc",
@@ -929,6 +1089,7 @@
         "subtype_check_info_test.cc",
         "subtype_check_test.cc",
         "thread_pool_test.cc",
+        "thread_test.cc",
         "transaction_test.cc",
         "two_runtimes_test.cc",
         "vdex_file_test.cc",
@@ -937,11 +1098,9 @@
     ],
     shared_libs: [
         "libunwindstack",
-        "libz", // libziparchive dependency; must be repeated here since it's a static lib.
     ],
     static_libs: [
         "libgmock",
-        "libziparchive",
     ],
     header_libs: [
         "art_cmdlineparser_headers", // For parsed_options_test.
@@ -1061,6 +1220,7 @@
     export_generated_headers: ["statslog_art.h"],
     shared_libs: [
         "liblog",
+        "libstatspull",
         "libstatssocket",
         "libutils",
     ],
diff --git a/runtime/app_info.cc b/runtime/app_info.cc
index 3fef565..5ec57c7 100644
--- a/runtime/app_info.cc
+++ b/runtime/app_info.cc
@@ -21,7 +21,7 @@
 #include "base/safe_map.h"
 #include "thread-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static constexpr const char* kUnknownValue = "unknown";
 
diff --git a/runtime/app_info.h b/runtime/app_info.h
index 0b8132a..20cec94 100644
--- a/runtime/app_info.h
+++ b/runtime/app_info.h
@@ -19,10 +19,11 @@
 
 #include <vector>
 
+#include "base/macros.h"
 #include "base/mutex.h"
 #include <base/safe_map.h>
 
-namespace art {
+namespace art HIDDEN {
 
 // Constants used by VMRuntime.java to interface with the runtime.
 // We could get them from the well known class but it's simpler to
diff --git a/runtime/app_info_test.cc b/runtime/app_info_test.cc
index 51dd42f..39d07aa 100644
--- a/runtime/app_info_test.cc
+++ b/runtime/app_info_test.cc
@@ -20,7 +20,7 @@
 
 #include "gtest/gtest.h"
 
-namespace art {
+namespace art HIDDEN {
 
 TEST(AppInfoTest, RegisterAppInfo) {
   AppInfo app_info;
diff --git a/runtime/arch/arch_test.cc b/runtime/arch/arch_test.cc
index 83fd986..57df3c8 100644
--- a/runtime/arch/arch_test.cc
+++ b/runtime/arch/arch_test.cc
@@ -22,7 +22,7 @@
 #include "entrypoints/quick/callee_save_frame.h"
 #include "quick/quick_method_frame_info.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArchTest : public CommonArtTest {};
 
diff --git a/runtime/arch/arm/asm_support_arm.S b/runtime/arch/arm/asm_support_arm.S
index dbc6a5d..2ab9918 100644
--- a/runtime/arch/arm/asm_support_arm.S
+++ b/runtime/arch/arm/asm_support_arm.S
@@ -86,12 +86,7 @@
     .type \name, #function
     .hidden \name  // Hide this as a global symbol, so we do not incur plt calls.
     .global \name
-    // ART-compiled functions have OatQuickMethodHeader but assembly funtions do not.
-    // Prefix the assembly code with 0xFFs, which means there is no method header.
-    .byte 0xFF, 0xFF, 0xFF, 0xFF
-    // Cache alignment for function entry.
-    // Use 0xFF as the last 4 bytes of alignment stand for OatQuickMethodHeader.
-    .balign \alignment, 0xFF
+    .balign \alignment
 \name:
     .cfi_startproc
     .fnstart
diff --git a/runtime/arch/arm/callee_save_frame_arm.h b/runtime/arch/arm/callee_save_frame_arm.h
index 72ba3b7..a569942 100644
--- a/runtime/arch/arm/callee_save_frame_arm.h
+++ b/runtime/arch/arm/callee_save_frame_arm.h
@@ -21,11 +21,12 @@
 #include "base/bit_utils.h"
 #include "base/callee_save_type.h"
 #include "base/enums.h"
+#include "base/macros.h"
 #include "quick/quick_method_frame_info.h"
 #include "registers_arm.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace arm {
 
 static constexpr uint32_t kArmCalleeSaveAlwaysSpills =
diff --git a/runtime/arch/arm/context_arm.cc b/runtime/arch/arm/context_arm.cc
index e118daa..4e880e4 100644
--- a/runtime/arch/arm/context_arm.cc
+++ b/runtime/arch/arm/context_arm.cc
@@ -21,7 +21,7 @@
 #include "quick/quick_method_frame_info.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace arm {
 
 static constexpr uint32_t gZero = 0;
diff --git a/runtime/arch/arm/context_arm.h b/runtime/arch/arm/context_arm.h
index 006939c..592d01b 100644
--- a/runtime/arch/arm/context_arm.h
+++ b/runtime/arch/arm/context_arm.h
@@ -23,7 +23,7 @@
 #include "base/macros.h"
 #include "registers_arm.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace arm {
 
 class ArmContext final : public Context {
diff --git a/runtime/arch/arm/entrypoints_init_arm.cc b/runtime/arch/arm/entrypoints_init_arm.cc
index 555babe..156a107 100644
--- a/runtime/arch/arm/entrypoints_init_arm.cc
+++ b/runtime/arch/arm/entrypoints_init_arm.cc
@@ -29,7 +29,7 @@
 #include "entrypoints/runtime_asm_entrypoints.h"
 #include "interpreter/interpreter.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Cast entrypoints.
 extern "C" size_t artInstanceOfFromCode(mirror::Object* obj, mirror::Class* ref_class);
diff --git a/runtime/arch/arm/fault_handler_arm.cc b/runtime/arch/arm/fault_handler_arm.cc
index f02ec65..de5c28b 100644
--- a/runtime/arch/arm/fault_handler_arm.cc
+++ b/runtime/arch/arm/fault_handler_arm.cc
@@ -31,7 +31,7 @@
 // ARM specific fault handler functions.
 //
 
-namespace art {
+namespace art HIDDEN {
 
 extern "C" void art_quick_throw_null_pointer_exception_from_signal();
 extern "C" void art_quick_throw_stack_overflow();
@@ -45,7 +45,7 @@
   return instr_size;
 }
 
-uintptr_t FaultManager::GetFaultPc(siginfo_t* siginfo ATTRIBUTE_UNUSED, void* context) {
+uintptr_t FaultManager::GetFaultPc([[maybe_unused]] siginfo_t* siginfo, void* context) {
   ucontext_t* uc = reinterpret_cast<ucontext_t*>(context);
   mcontext_t* mc = reinterpret_cast<mcontext_t*>(&uc->uc_mcontext);
   if (mc->arm_sp == 0) {
@@ -61,7 +61,7 @@
   return mc->arm_sp;
 }
 
-bool NullPointerHandler::Action(int sig ATTRIBUTE_UNUSED, siginfo_t* info, void* context) {
+bool NullPointerHandler::Action([[maybe_unused]] int sig, siginfo_t* info, void* context) {
   uintptr_t fault_address = reinterpret_cast<uintptr_t>(info->si_addr);
   if (!IsValidFaultAddress(fault_address)) {
     return false;
@@ -115,7 +115,8 @@
 // The offset from r9 is Thread::ThreadSuspendTriggerOffset().
 // To check for a suspend check, we examine the instructions that caused
 // the fault (at PC-4 and PC).
-bool SuspensionHandler::Action(int sig ATTRIBUTE_UNUSED, siginfo_t* info ATTRIBUTE_UNUSED,
+bool SuspensionHandler::Action([[maybe_unused]] int sig,
+                               [[maybe_unused]] siginfo_t* info,
                                void* context) {
   // These are the instructions to check for.  The first one is the ldr r0,[r9,#xxx]
   // where xxx is the offset of the suspend trigger.
@@ -186,7 +187,8 @@
 // If we determine this is a stack overflow we need to move the stack pointer
 // to the overflow region below the protected region.
 
-bool StackOverflowHandler::Action(int sig ATTRIBUTE_UNUSED, siginfo_t* info ATTRIBUTE_UNUSED,
+bool StackOverflowHandler::Action([[maybe_unused]] int sig,
+                                  [[maybe_unused]] siginfo_t* info,
                                   void* context) {
   ucontext_t* uc = reinterpret_cast<ucontext_t*>(context);
   mcontext_t* mc = reinterpret_cast<mcontext_t*>(&uc->uc_mcontext);
diff --git a/runtime/arch/arm/instruction_set_features_arm.cc b/runtime/arch/arm/instruction_set_features_arm.cc
index 749476b..738409b 100644
--- a/runtime/arch/arm/instruction_set_features_arm.cc
+++ b/runtime/arch/arm/instruction_set_features_arm.cc
@@ -45,7 +45,7 @@
 extern "C" bool artCheckForArmv8AInstructions();
 #endif
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -243,9 +243,9 @@
 // A signal handler called by a fault for an illegal instruction.  We record the fact in r0
 // and then increment the PC in the signal context to return to the next instruction.  We know the
 // instruction is 4 bytes long.
-static void bad_instr_handle(int signo ATTRIBUTE_UNUSED,
-                            siginfo_t* si ATTRIBUTE_UNUSED,
-                            void* data) {
+static void bad_instr_handle([[maybe_unused]] int signo,
+                             [[maybe_unused]] siginfo_t* si,
+                             void* data) {
 #if defined(__arm__)
   ucontext_t* uc = reinterpret_cast<ucontext_t*>(data);
   mcontext_t* mc = &uc->uc_mcontext;
diff --git a/runtime/arch/arm/instruction_set_features_arm.h b/runtime/arch/arm/instruction_set_features_arm.h
index 613ed14..5b8d308 100644
--- a/runtime/arch/arm/instruction_set_features_arm.h
+++ b/runtime/arch/arm/instruction_set_features_arm.h
@@ -18,8 +18,9 @@
 #define ART_RUNTIME_ARCH_ARM_INSTRUCTION_SET_FEATURES_ARM_H_
 
 #include "arch/instruction_set_features.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArmInstructionSetFeatures;
 using ArmFeaturesUniquePtr = std::unique_ptr<const ArmInstructionSetFeatures>;
diff --git a/runtime/arch/arm/instruction_set_features_arm_test.cc b/runtime/arch/arm/instruction_set_features_arm_test.cc
index 36e31bd..9d37e4f 100644
--- a/runtime/arch/arm/instruction_set_features_arm_test.cc
+++ b/runtime/arch/arm/instruction_set_features_arm_test.cc
@@ -18,7 +18,7 @@
 
 #include "gtest/gtest.h"
 
-namespace art {
+namespace art HIDDEN {
 
 TEST(ArmInstructionSetFeaturesTest, ArmFeaturesFromVariant) {
   // Build features for a 32-bit ARM krait processor.
diff --git a/runtime/arch/arm/jni_entrypoints_arm.S b/runtime/arch/arm/jni_entrypoints_arm.S
index d91882c..95b5eb5 100644
--- a/runtime/arch/arm/jni_entrypoints_arm.S
+++ b/runtime/arch/arm/jni_entrypoints_arm.S
@@ -113,8 +113,8 @@
 
     add    sp, #12                        @ restore stack pointer
     .cfi_adjust_cfa_offset -12
+    CFI_REMEMBER_STATE
     cbz    r0, 1f                         @ is method code null?
-    .cfi_remember_state
     pop    {r0, r1, r2, r3, lr}           @ restore regs
     .cfi_adjust_cfa_offset -20
     .cfi_restore lr
@@ -246,10 +246,9 @@
 
     // Check for exception before moving args back to keep the return PC for managed stack walk.
     cmp    ip, #0
+    CFI_REMEMBER_STATE
     beq    .Lcritical_deliver_exception
 
-    .cfi_remember_state
-
     // Restore our return PC.
     ldr    lr, [r4, #__SIZEOF_POINTER__]
     .cfi_restore lr
@@ -275,9 +274,9 @@
 
     // Do the tail call.
     bx     ip
-    CFI_RESTORE_STATE_AND_DEF_CFA sp, FRAME_SIZE_SAVE_REFS_AND_ARGS
 
 .Lcritical_deliver_exception:
+    CFI_RESTORE_STATE_AND_DEF_CFA sp, FRAME_SIZE_SAVE_REFS_AND_ARGS
     // The exception delivery checks that rSELF was saved but the SaveRefsAndArgs
     // frame does not save it, so we cannot use the existing SaveRefsAndArgs frame.
     // That's why we checked for exception after restoring registers from it.
diff --git a/runtime/arch/arm/jni_frame_arm.h b/runtime/arch/arm/jni_frame_arm.h
index 8c56af1..5410950 100644
--- a/runtime/arch/arm/jni_frame_arm.h
+++ b/runtime/arch/arm/jni_frame_arm.h
@@ -23,8 +23,9 @@
 #include "base/bit_utils.h"
 #include "base/globals.h"
 #include "base/logging.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace arm {
 
 constexpr size_t kFramePointerSize = static_cast<size_t>(PointerSize::k32);
@@ -85,4 +86,3 @@
 }  // namespace art
 
 #endif  // ART_RUNTIME_ARCH_ARM_JNI_FRAME_ARM_H_
-
diff --git a/runtime/arch/arm/quick_entrypoints_arm.S b/runtime/arch/arm/quick_entrypoints_arm.S
index 23a324e..eca5c4b 100644
--- a/runtime/arch/arm/quick_entrypoints_arm.S
+++ b/runtime/arch/arm/quick_entrypoints_arm.S
@@ -18,6 +18,7 @@
 #include "interpreter/cfi_asm_support.h"
 
 #include "arch/quick_alloc_entrypoints.S"
+#include "arch/quick_field_entrypoints.S"
 
     /* Deliver the given exception */
     .extern artDeliverExceptionFromCode
@@ -134,14 +135,19 @@
     .cfi_adjust_cfa_offset -52
 .endm
 
-.macro RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-    ldr r1, [rSELF, # THREAD_EXCEPTION_OFFSET]  // Get exception field.
-    cbnz r1, 1f
-    DEOPT_OR_RETURN r1                          // Check if deopt is required
+.macro RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION is_ref = 0
+    // Use R2 to allow returning 64-bit values in R0-R1.
+    ldr r2, [rSELF, # THREAD_EXCEPTION_OFFSET]  // Get exception field.
+    cbnz r2, 1f
+    DEOPT_OR_RETURN r2, \is_ref                 // Check if deopt is required
 1:
     DELIVER_PENDING_EXCEPTION
 .endm
 
+.macro RETURN_REF_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+    RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION /* is_ref= */ 1
+.endm
+
 .macro DEOPT_OR_RETURN temp, is_ref = 0
   ldr \temp, [rSELF, #THREAD_DEOPT_CHECK_REQUIRED_OFFSET]
   cbnz \temp, 2f
@@ -152,11 +158,9 @@
   mov r1, r0                           // pass the result
   mov r0, rSELF                        // Thread::Current
   bl artDeoptimizeIfNeeded
-  CFI_REMEMBER_STATE
   RESTORE_SAVE_EVERYTHING_FRAME
   REFRESH_MARKING_REGISTER
   bx     lr
-  CFI_RESTORE_STATE_AND_DEF_CFA sp, FRAME_SIZE_SAVE_EVERYTHING
 .endm
 
 .macro DEOPT_OR_RESTORE_SAVE_EVERYTHING_FRAME_AND_RETURN_R0 temp, is_ref
@@ -216,52 +220,56 @@
 END \c_name
 .endm
 
-.macro RETURN_IF_RESULT_IS_ZERO_OR_DELIVER
+.macro RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
     cbnz   r0, 1f              @ result non-zero branch over
     DEOPT_OR_RETURN r1
 1:
     DELIVER_PENDING_EXCEPTION
 .endm
 
-.macro RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+.macro RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
     cbz    r0, 1f              @ result zero branch over
-    DEOPT_OR_RETURN r1, /*is_ref=*/1
+    DEOPT_OR_RETURN r1, /* is_ref= */ 1
 1:
     DELIVER_PENDING_EXCEPTION
 .endm
 
 // Macros taking opportunity of code similarities for downcalls.
-.macro  ONE_ARG_REF_DOWNCALL name, entrypoint, return
+// Used for field and allocation entrypoints.
+.macro N_ARG_DOWNCALL n, name, entrypoint, return
     .extern \entrypoint
 ENTRY \name
-    SETUP_SAVE_REFS_ONLY_FRAME r1        @ save callee saves in case of GC
-    mov    r1, rSELF                     @ pass Thread::Current
-    bl     \entrypoint                   @ (uint32_t field_idx, Thread*)
+    SETUP_SAVE_REFS_ONLY_FRAME r\n        @ save callee saves in case of GC
+    mov    r\n, rSELF                     @ pass Thread::Current
+    bl     \entrypoint                    @ (<args>, Thread*)
     RESTORE_SAVE_REFS_ONLY_FRAME
     REFRESH_MARKING_REGISTER
     \return
 END \name
 .endm
 
-.macro  TWO_ARG_REF_DOWNCALL name, entrypoint, return
-    .extern \entrypoint
-ENTRY \name
-    SETUP_SAVE_REFS_ONLY_FRAME r2        @ save callee saves in case of GC
-    mov    r2, rSELF                     @ pass Thread::Current
-    bl     \entrypoint                   @ (field_idx, Object*, Thread*)
-    RESTORE_SAVE_REFS_ONLY_FRAME
-    REFRESH_MARKING_REGISTER
-    \return
-END \name
+.macro ONE_ARG_DOWNCALL name, entrypoint, return
+    N_ARG_DOWNCALL 1, \name, \entrypoint, \return
 .endm
 
-.macro THREE_ARG_REF_DOWNCALL name, entrypoint, return
+.macro TWO_ARG_DOWNCALL name, entrypoint, return
+    N_ARG_DOWNCALL 2, \name, \entrypoint, \return
+.endm
+
+.macro THREE_ARG_DOWNCALL name, entrypoint, return
+    N_ARG_DOWNCALL 3, \name, \entrypoint, \return
+.endm
+
+// Macro to facilitate adding new allocation entrypoints.
+.macro FOUR_ARG_DOWNCALL name, entrypoint, return
     .extern \entrypoint
 ENTRY \name
-    SETUP_SAVE_REFS_ONLY_FRAME r3        @ save callee saves in case of GC
-    mov    r3, rSELF                     @ pass Thread::Current
-    bl     \entrypoint                   @ (field_idx, Object*, new_val, Thread*)
-    RESTORE_SAVE_REFS_ONLY_FRAME         @ TODO: we can clearly save an add here
+    SETUP_SAVE_REFS_ONLY_FRAME r12        @ save callee saves in case of GC
+    str    rSELF, [sp, #-16]!             @ expand the frame and pass Thread::Current
+    .cfi_adjust_cfa_offset 16
+    bl     \entrypoint                    @ (<args>, Thread*)
+    DECREASE_FRAME 16                     @ strip the extra frame
+    RESTORE_SAVE_REFS_ONLY_FRAME
     REFRESH_MARKING_REGISTER
     \return
 END \name
@@ -528,7 +536,9 @@
      * Entry from managed code that calls artHandleFillArrayDataFromCode and delivers exception on
      * failure.
      */
-TWO_ARG_REF_DOWNCALL art_quick_handle_fill_data, artHandleFillArrayDataFromCode, RETURN_IF_RESULT_IS_ZERO_OR_DELIVER
+TWO_ARG_DOWNCALL art_quick_handle_fill_data, \
+                 artHandleFillArrayDataFromCode, \
+                 RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
 
     /*
      * Entry from managed code that tries to lock the object in a fast path and
@@ -555,7 +565,7 @@
     bl     artLockObjectFromCode      @ (Object* obj, Thread*)
     RESTORE_SAVE_REFS_ONLY_FRAME
     REFRESH_MARKING_REGISTER
-    RETURN_IF_RESULT_IS_ZERO_OR_DELIVER
+    RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
 END art_quick_lock_object_no_inline
 
     /*
@@ -585,7 +595,7 @@
     bl     artUnlockObjectFromCode    @ (Object* obj, Thread*)
     RESTORE_SAVE_REFS_ONLY_FRAME
     REFRESH_MARKING_REGISTER
-    RETURN_IF_RESULT_IS_ZERO_OR_DELIVER
+    RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
 END art_quick_unlock_object_no_inline
 
     /*
@@ -746,8 +756,8 @@
     mov r1, r4
     mov r0, r3
     bl artIsAssignableFromCode
-    cbz r0, .Lthrow_array_store_exception
     CFI_REMEMBER_STATE
+    cbz r0, .Lthrow_array_store_exception
     pop {r0-r2, lr}
     .cfi_restore lr
     .cfi_adjust_cfa_offset -16
@@ -806,62 +816,6 @@
 #endif  // defined(USE_READ_BARRIER) && defined(USE_BAKER_READ_BARRIER)
 END art_quick_aput_obj
 
-// Macro to facilitate adding new allocation entrypoints.
-.macro ONE_ARG_DOWNCALL name, entrypoint, return
-    .extern \entrypoint
-ENTRY \name
-    SETUP_SAVE_REFS_ONLY_FRAME r1     @ save callee saves in case of GC
-    mov    r1, rSELF                  @ pass Thread::Current
-    bl     \entrypoint     @ (uint32_t type_idx, Method* method, Thread*)
-    RESTORE_SAVE_REFS_ONLY_FRAME
-    REFRESH_MARKING_REGISTER
-    \return
-END \name
-.endm
-
-// Macro to facilitate adding new allocation entrypoints.
-.macro TWO_ARG_DOWNCALL name, entrypoint, return
-    .extern \entrypoint
-ENTRY \name
-    SETUP_SAVE_REFS_ONLY_FRAME r2     @ save callee saves in case of GC
-    mov    r2, rSELF                  @ pass Thread::Current
-    bl     \entrypoint     @ (uint32_t type_idx, Method* method, Thread*)
-    RESTORE_SAVE_REFS_ONLY_FRAME
-    REFRESH_MARKING_REGISTER
-    \return
-END \name
-.endm
-
-// Macro to facilitate adding new array allocation entrypoints.
-.macro THREE_ARG_DOWNCALL name, entrypoint, return
-    .extern \entrypoint
-ENTRY \name
-    SETUP_SAVE_REFS_ONLY_FRAME r3     @ save callee saves in case of GC
-    mov    r3, rSELF                  @ pass Thread::Current
-    @ (uint32_t type_idx, Method* method, int32_t component_count, Thread*)
-    bl     \entrypoint
-    RESTORE_SAVE_REFS_ONLY_FRAME
-    REFRESH_MARKING_REGISTER
-    \return
-END \name
-.endm
-
-// Macro to facilitate adding new allocation entrypoints.
-.macro FOUR_ARG_DOWNCALL name, entrypoint, return
-    .extern \entrypoint
-ENTRY \name
-    SETUP_SAVE_REFS_ONLY_FRAME r12    @ save callee saves in case of GC
-    str    rSELF, [sp, #-16]!         @ expand the frame and pass Thread::Current
-    .cfi_adjust_cfa_offset 16
-    bl     \entrypoint
-    add    sp, #16                    @ strip the extra frame
-    .cfi_adjust_cfa_offset -16
-    RESTORE_SAVE_REFS_ONLY_FRAME
-    REFRESH_MARKING_REGISTER
-    \return
-END \name
-.endm
-
     /*
      * Macro for resolution and initialization of indexed DEX file
      * constants such as classes and strings.
@@ -894,73 +848,13 @@
 // Note: Functions `art{Get,Set}<Kind>{Static,Instance}FromCompiledCode` are
 // defined with a macro in runtime/entrypoints/quick/quick_field_entrypoints.cc.
 
-    /*
-     * Called by managed code to resolve a static field and load a non-wide value.
-     */
-ONE_ARG_REF_DOWNCALL art_quick_get_byte_static, artGetByteStaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get_boolean_static, artGetBooleanStaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get_short_static, artGetShortStaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get_char_static, artGetCharStaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get32_static, artGet32StaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get_obj_static, artGetObjStaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-    /*
-     * Called by managed code to resolve a static field and load a 64-bit primitive value.
-     */
-    .extern artGet64StaticFromCompiledCode
-ENTRY art_quick_get64_static
-    SETUP_SAVE_REFS_ONLY_FRAME r2        @ save callee saves in case of GC
-    mov    r1, rSELF                     @ pass Thread::Current
-    bl     artGet64StaticFromCompiledCode  @ (uint32_t field_idx, Thread*)
-    ldr    r2, [rSELF, #THREAD_EXCEPTION_OFFSET]  @ load Thread::Current()->exception_
-    RESTORE_SAVE_REFS_ONLY_FRAME
-    REFRESH_MARKING_REGISTER
-    cbnz   r2, 1f                        @ success if no exception pending
-    DEOPT_OR_RETURN r2                   @ check if deopt is required or return
-1:
-    DELIVER_PENDING_EXCEPTION
-END art_quick_get64_static
+GENERATE_STATIC_FIELD_GETTERS
 
-    /*
-     * Called by managed code to resolve an instance field and load a non-wide value.
-     */
-TWO_ARG_REF_DOWNCALL art_quick_get_byte_instance, artGetByteInstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get_boolean_instance, artGetBooleanInstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get_short_instance, artGetShortInstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get_char_instance, artGetCharInstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get32_instance, artGet32InstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get_obj_instance, artGetObjInstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-    /*
-     * Called by managed code to resolve an instance field and load a 64-bit primitive value.
-     */
-    .extern artGet64InstanceFromCompiledCode
-ENTRY art_quick_get64_instance
-    SETUP_SAVE_REFS_ONLY_FRAME r2        @ save callee saves in case of GC
-    mov    r2, rSELF                     @ pass Thread::Current
-    bl     artGet64InstanceFromCompiledCode  @ (field_idx, Object*, Thread*)
-    ldr    r2, [rSELF, #THREAD_EXCEPTION_OFFSET]  @ load Thread::Current()->exception_
-    RESTORE_SAVE_REFS_ONLY_FRAME
-    REFRESH_MARKING_REGISTER
-    cbnz   r2, 1f                        @ success if no exception pending
-    DEOPT_OR_RETURN r2                   @ check if deopt is required or return
-1:
-    DELIVER_PENDING_EXCEPTION
-END art_quick_get64_instance
+GENERATE_INSTANCE_FIELD_GETTERS
 
-    /*
-     * Called by managed code to resolve a static field and store a value.
-     */
-TWO_ARG_REF_DOWNCALL art_quick_set8_static, artSet8StaticFromCompiledCode, RETURN_IF_RESULT_IS_ZERO_OR_DELIVER
-TWO_ARG_REF_DOWNCALL art_quick_set16_static, artSet16StaticFromCompiledCode, RETURN_IF_RESULT_IS_ZERO_OR_DELIVER
-TWO_ARG_REF_DOWNCALL art_quick_set32_static, artSet32StaticFromCompiledCode, RETURN_IF_RESULT_IS_ZERO_OR_DELIVER
-TWO_ARG_REF_DOWNCALL art_quick_set_obj_static, artSetObjStaticFromCompiledCode, RETURN_IF_RESULT_IS_ZERO_OR_DELIVER
+GENERATE_STATIC_FIELD_SETTERS /* emit64= */ 0
 
-    /*
-     * Called by managed code to resolve an instance field and store a non-wide value.
-     */
-THREE_ARG_REF_DOWNCALL art_quick_set8_instance, artSet8InstanceFromCompiledCode, RETURN_IF_RESULT_IS_ZERO_OR_DELIVER
-THREE_ARG_REF_DOWNCALL art_quick_set16_instance, artSet16InstanceFromCompiledCode, RETURN_IF_RESULT_IS_ZERO_OR_DELIVER
-THREE_ARG_REF_DOWNCALL art_quick_set32_instance, artSet32InstanceFromCompiledCode, RETURN_IF_RESULT_IS_ZERO_OR_DELIVER
-THREE_ARG_REF_DOWNCALL art_quick_set_obj_instance, artSetObjInstanceFromCompiledCode, RETURN_IF_RESULT_IS_ZERO_OR_DELIVER
+GENERATE_INSTANCE_FIELD_SETTERS /* emit64= */ 0
 
     /*
      * Called by managed code to resolve an instance field and store a wide value.
@@ -976,7 +870,7 @@
     .cfi_adjust_cfa_offset -16
     RESTORE_SAVE_REFS_ONLY_FRAME         @ TODO: we can clearly save an add here
     REFRESH_MARKING_REGISTER
-    RETURN_IF_RESULT_IS_ZERO_OR_DELIVER
+    RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
 END art_quick_set64_instance
 
     .extern artSet64StaticFromCompiledCode
@@ -990,7 +884,7 @@
     .cfi_adjust_cfa_offset -16
     RESTORE_SAVE_REFS_ONLY_FRAME          @ TODO: we can clearly save an add here
     REFRESH_MARKING_REGISTER
-    RETURN_IF_RESULT_IS_ZERO_OR_DELIVER
+    RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
 END art_quick_set64_static
 
 // Generate the allocation entrypoints for each allocator.
@@ -1051,7 +945,7 @@
                                                               // already aligned we can combine the
                                                               // two shifts together.
     add    r12, rSELF, r3, lsr #(ROSALLOC_BRACKET_QUANTUM_SIZE_SHIFT - POINTER_SIZE_SHIFT)
-                                                              // Subtract pointer size since ther
+                                                              // Subtract pointer size since there
                                                               // are no runs for 0 byte allocations
                                                               // and the size is already aligned.
                                                               // Load the rosalloc run (r12)
@@ -1123,7 +1017,7 @@
     bl     \cxx_name                  @ (mirror::Class* cls, Thread*)
     RESTORE_SAVE_REFS_ONLY_FRAME
     REFRESH_MARKING_REGISTER
-    RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 END \c_name
 .endm
 
@@ -1177,9 +1071,6 @@
     //
     // (Note: The actual check is done by checking that the object's class pointer is non-null.
     // Also, unlike rosalloc, the object can never be observed as null).
-    ldr    r1, [rSELF, #THREAD_LOCAL_OBJECTS_OFFSET]          // Increment thread_local_objects.
-    add    r1, r1, #1
-    str    r1, [rSELF, #THREAD_LOCAL_OBJECTS_OFFSET]
     POISON_HEAP_REF r0
     str    r0, [r2, #MIRROR_OBJECT_CLASS_OFFSET]              // Store the class pointer.
     mov    r0, r2
@@ -1204,7 +1095,7 @@
     bl     \entrypoint                                        // (mirror::Class* klass, Thread*)
     RESTORE_SAVE_REFS_ONLY_FRAME
     REFRESH_MARKING_REGISTER
-    RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 END \name
 .endm
 
@@ -1238,9 +1129,6 @@
     // "Point of no slow path". Won't go to the slow path from here on. OK to clobber r0 and r1.
     add    r2, r2, r3
     str    r2, [rSELF, #THREAD_LOCAL_POS_OFFSET]              // Store new thread_local_pos.
-    ldr    r2, [rSELF, #THREAD_LOCAL_OBJECTS_OFFSET]          // Increment thread_local_objects.
-    add    r2, r2, #1
-    str    r2, [rSELF, #THREAD_LOCAL_OBJECTS_OFFSET]
     POISON_HEAP_REF r0
     str    r0, [r3, #MIRROR_OBJECT_CLASS_OFFSET]              // Store the class pointer.
     str    r1, [r3, #MIRROR_ARRAY_LENGTH_OFFSET]              // Store the array length.
@@ -1273,7 +1161,7 @@
     bl     \entrypoint
     RESTORE_SAVE_REFS_ONLY_FRAME
     REFRESH_MARKING_REGISTER
-    RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 END \name
 .endm
 
@@ -1439,8 +1327,8 @@
     mov     r2, rSELF              @ pass Thread::Current
     mov     r3, sp                 @ pass SP
     blx     artQuickResolutionTrampoline  @ (Method* called, receiver, Thread*, SP)
-    cbz     r0, 1f                 @ is code pointer null? goto exception
     CFI_REMEMBER_STATE
+    cbz     r0, 1f                 @ is code pointer null? goto exception
     mov     r12, r0
     ldr     r0, [sp, #0]           @ load resolved method in r0
     RESTORE_SAVE_REFS_AND_ARGS_FRAME
@@ -1529,11 +1417,11 @@
 
     LOAD_RUNTIME_INSTANCE r2
     ldr r2, [r2,  #RUN_EXIT_HOOKS_OFFSET_FROM_RUNTIME_INSTANCE]
+    CFI_REMEMBER_STATE
     cbnz r2, .Lcall_method_exit_hook
 .Lcall_method_exit_hook_done:
 
     // Tear down the callee-save frame. Skip arg registers.
-    CFI_REMEMBER_STATE
     .cfi_def_cfa_register sp
     add sp, #(FRAME_SIZE_SAVE_REFS_AND_ARGS - 7 * 4)
     .cfi_adjust_cfa_offset -(FRAME_SIZE_SAVE_REFS_AND_ARGS - 7 * 4)
@@ -1549,10 +1437,8 @@
     REFRESH_MARKING_REGISTER
     bx lr      // ret
 
-    // Undo the unwinding information from above since it doesn't apply below.
-    CFI_RESTORE_STATE_AND_DEF_CFA r10, FRAME_SIZE_SAVE_REFS_AND_ARGS
-
 .Lcall_method_exit_hook:
+    CFI_RESTORE_STATE_AND_DEF_CFA r10, FRAME_SIZE_SAVE_REFS_AND_ARGS
     mov r2, #FRAME_SIZE_SAVE_REFS_AND_ARGS
     bl art_quick_method_exit_hook
     b .Lcall_method_exit_hook_done
@@ -1907,7 +1793,7 @@
     bl     artStringBuilderAppend       @ (uint32_t, const unit32_t*, Thread*)
     RESTORE_SAVE_REFS_ONLY_FRAME
     REFRESH_MARKING_REGISTER
-    RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 END art_quick_string_builder_append
 
     /*
@@ -2511,8 +2397,9 @@
 ENTRY art_quick_method_exit_hook
     SETUP_SAVE_EVERYTHING_FRAME r5
 
-    sub sp, #4                                @ align stack
+    INCREASE_FRAME 4                          @ align stack
     push {r2}                                 @ pass frame_size stack
+    .cfi_adjust_cfa_offset 4
     add r3, sp, #(8 + 8)                      @ store fpr_res pointer, in kSaveEverything frame
     add r2, sp, #(136 + 8)                    @ store gpr_res pointer, in kSaveEverything frame
     add r1, sp, #(FRAME_SIZE_SAVE_EVERYTHING + 8)   @ pass ArtMethod**
@@ -2520,7 +2407,7 @@
     blx artMethodExitHook                     @ (Thread*, ArtMethod**, gpr_res*, fpr_res*,
                                               @ frame_size)
 
-    add sp, #8                                @ pop arguments on stack
+    DECREASE_FRAME 8                          @ pop arguments on stack
     RESTORE_SAVE_EVERYTHING_FRAME
     REFRESH_MARKING_REGISTER
     blx lr
diff --git a/runtime/arch/arm/quick_entrypoints_cc_arm.cc b/runtime/arch/arm/quick_entrypoints_cc_arm.cc
index d7fef6f..944ac15 100644
--- a/runtime/arch/arm/quick_entrypoints_cc_arm.cc
+++ b/runtime/arch/arm/quick_entrypoints_cc_arm.cc
@@ -17,7 +17,7 @@
 #include "art_method.h"
 #include "base/utils.h"  // For RoundUp().
 
-namespace art {
+namespace art HIDDEN {
 
 // Assembly stub that does the final part of the up-call into Java.
 extern "C" void art_quick_invoke_stub_internal(ArtMethod*, uint32_t*, uint32_t,
diff --git a/runtime/arch/arm/registers_arm.cc b/runtime/arch/arm/registers_arm.cc
index 4f04647..ee7ef47 100644
--- a/runtime/arch/arm/registers_arm.cc
+++ b/runtime/arch/arm/registers_arm.cc
@@ -18,7 +18,7 @@
 
 #include <ostream>
 
-namespace art {
+namespace art HIDDEN {
 namespace arm {
 
 static const char* kRegisterNames[] = {
diff --git a/runtime/arch/arm/registers_arm.h b/runtime/arch/arm/registers_arm.h
index d39a2a2..7cc95d4 100644
--- a/runtime/arch/arm/registers_arm.h
+++ b/runtime/arch/arm/registers_arm.h
@@ -19,7 +19,9 @@
 
 #include <iosfwd>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 namespace arm {
 
 // Values for registers.
diff --git a/runtime/arch/arm/thread_arm.cc b/runtime/arch/arm/thread_arm.cc
index 18585c7..82d287c 100644
--- a/runtime/arch/arm/thread_arm.cc
+++ b/runtime/arch/arm/thread_arm.cc
@@ -21,7 +21,7 @@
 #include "asm_support_arm.h"
 #include "base/enums.h"
 
-namespace art {
+namespace art HIDDEN {
 
 void Thread::InitCpu() {
   CHECK_EQ(THREAD_FLAGS_OFFSET, ThreadFlagsOffset<PointerSize::k32>().Int32Value());
diff --git a/runtime/arch/arm64/asm_support_arm64.S b/runtime/arch/arm64/asm_support_arm64.S
index 4ef6ce0..25f84e7 100644
--- a/runtime/arch/arm64/asm_support_arm64.S
+++ b/runtime/arch/arm64/asm_support_arm64.S
@@ -84,12 +84,7 @@
     .type \name, #function
     .hidden \name  // Hide this as a global symbol, so we do not incur plt calls.
     .global \name
-    // ART-compiled functions have OatQuickMethodHeader but assembly funtions do not.
-    // Prefix the assembly code with 0xFFs, which means there is no method header.
-    .byte 0xFF, 0xFF, 0xFF, 0xFF
-    // Cache alignment for function entry.
-    // Use 0xFF as the last 4 bytes of alignment stand for OatQuickMethodHeader.
-    .balign \alignment, 0xFF
+    .balign \alignment
 \name:
     .cfi_startproc
 .endm
@@ -419,7 +414,7 @@
     stxr   w10, w11, [x8]
     cbnz   w10, 1b                    // If the store failed, retry.
     ret
-2:  // w10: original lock word, w9: thread id, w11: w10 ^ w11
+2:  // w10: original lock word, w9: thread id, w11: w10 ^ w9
                                       // Check lock word state and thread id together,
     tst    w11, #(LOCK_WORD_STATE_MASK_SHIFTED | LOCK_WORD_THIN_LOCK_OWNER_MASK_SHIFTED)
     b.ne   \slow_lock
diff --git a/runtime/arch/arm64/callee_save_frame_arm64.h b/runtime/arch/arm64/callee_save_frame_arm64.h
index d3609f1..e01df3b 100644
--- a/runtime/arch/arm64/callee_save_frame_arm64.h
+++ b/runtime/arch/arm64/callee_save_frame_arm64.h
@@ -21,11 +21,12 @@
 #include "base/bit_utils.h"
 #include "base/callee_save_type.h"
 #include "base/enums.h"
+#include "base/macros.h"
 #include "quick/quick_method_frame_info.h"
 #include "registers_arm64.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace arm64 {
 
 // Registers need to be restored but not preserved by aapcs64.
diff --git a/runtime/arch/arm64/context_arm64.cc b/runtime/arch/arm64/context_arm64.cc
index eca9ed7..96cd101 100644
--- a/runtime/arch/arm64/context_arm64.cc
+++ b/runtime/arch/arm64/context_arm64.cc
@@ -30,7 +30,7 @@
 
 extern "C" __attribute__((weak)) void __hwasan_handle_longjmp(const void* sp_dst);
 
-namespace art {
+namespace art HIDDEN {
 namespace arm64 {
 
 static constexpr uint64_t gZero = 0;
diff --git a/runtime/arch/arm64/context_arm64.h b/runtime/arch/arm64/context_arm64.h
index 5ab63c0..0a284c9 100644
--- a/runtime/arch/arm64/context_arm64.h
+++ b/runtime/arch/arm64/context_arm64.h
@@ -23,7 +23,7 @@
 #include "base/macros.h"
 #include "registers_arm64.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace arm64 {
 
 class Arm64Context final : public Context {
diff --git a/runtime/arch/arm64/entrypoints_init_arm64.cc b/runtime/arch/arm64/entrypoints_init_arm64.cc
index 7db2528..41876ec 100644
--- a/runtime/arch/arm64/entrypoints_init_arm64.cc
+++ b/runtime/arch/arm64/entrypoints_init_arm64.cc
@@ -29,7 +29,7 @@
 #include "entrypoints/runtime_asm_entrypoints.h"
 #include "interpreter/interpreter.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Cast entrypoints.
 extern "C" size_t artInstanceOfFromCode(mirror::Object* obj, mirror::Class* ref_class);
diff --git a/runtime/arch/arm64/fault_handler_arm64.cc b/runtime/arch/arm64/fault_handler_arm64.cc
index 3878b57..932d674 100644
--- a/runtime/arch/arm64/fault_handler_arm64.cc
+++ b/runtime/arch/arm64/fault_handler_arm64.cc
@@ -36,7 +36,7 @@
 // ARM64 specific fault handler functions.
 //
 
-namespace art {
+namespace art HIDDEN {
 
 uintptr_t FaultManager::GetFaultPc(siginfo_t* siginfo, void* context) {
   // SEGV_MTEAERR (Async MTE fault) is delivered at an arbitrary point after the actual fault.
@@ -62,7 +62,7 @@
   return mc->sp;
 }
 
-bool NullPointerHandler::Action(int sig ATTRIBUTE_UNUSED, siginfo_t* info, void* context) {
+bool NullPointerHandler::Action([[maybe_unused]] int sig, siginfo_t* info, void* context) {
   uintptr_t fault_address = reinterpret_cast<uintptr_t>(info->si_addr);
   if (!IsValidFaultAddress(fault_address)) {
     return false;
@@ -96,7 +96,8 @@
 // A suspend check is done using the following instruction:
 //      0x...: f94002b5  ldr x21, [x21, #0]
 // To check for a suspend check, we examine the instruction that caused the fault (at PC).
-bool SuspensionHandler::Action(int sig ATTRIBUTE_UNUSED, siginfo_t* info ATTRIBUTE_UNUSED,
+bool SuspensionHandler::Action([[maybe_unused]] int sig,
+                               [[maybe_unused]] siginfo_t* info,
                                void* context) {
   constexpr uint32_t kSuspendCheckRegister = 21;
   constexpr uint32_t checkinst =
@@ -128,7 +129,8 @@
   return true;
 }
 
-bool StackOverflowHandler::Action(int sig ATTRIBUTE_UNUSED, siginfo_t* info ATTRIBUTE_UNUSED,
+bool StackOverflowHandler::Action([[maybe_unused]] int sig,
+                                  [[maybe_unused]] siginfo_t* info,
                                   void* context) {
   ucontext_t* uc = reinterpret_cast<ucontext_t*>(context);
   mcontext_t* mc = reinterpret_cast<mcontext_t*>(&uc->uc_mcontext);
diff --git a/runtime/arch/arm64/instruction_set_features_arm64.cc b/runtime/arch/arm64/instruction_set_features_arm64.cc
index 93400d9..463b01e 100644
--- a/runtime/arch/arm64/instruction_set_features_arm64.cc
+++ b/runtime/arch/arm64/instruction_set_features_arm64.cc
@@ -39,7 +39,7 @@
 #include <cpuinfo_aarch64.h>
 #endif
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
diff --git a/runtime/arch/arm64/instruction_set_features_arm64.h b/runtime/arch/arm64/instruction_set_features_arm64.h
index 8f0013a..cd393be 100644
--- a/runtime/arch/arm64/instruction_set_features_arm64.h
+++ b/runtime/arch/arm64/instruction_set_features_arm64.h
@@ -18,8 +18,9 @@
 #define ART_RUNTIME_ARCH_ARM64_INSTRUCTION_SET_FEATURES_ARM64_H_
 
 #include "arch/instruction_set_features.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // SVE is currently not enabled.
 static constexpr bool kArm64AllowSVE = false;
diff --git a/runtime/arch/arm64/instruction_set_features_arm64_test.cc b/runtime/arch/arm64/instruction_set_features_arm64_test.cc
index 0212325..4d9b7f5 100644
--- a/runtime/arch/arm64/instruction_set_features_arm64_test.cc
+++ b/runtime/arch/arm64/instruction_set_features_arm64_test.cc
@@ -18,7 +18,7 @@
 
 #include <gtest/gtest.h>
 
-namespace art {
+namespace art HIDDEN {
 
 TEST(Arm64InstructionSetFeaturesTest, Arm64Features) {
   // Build features for an ARM64 processor.
diff --git a/runtime/arch/arm64/jni_entrypoints_arm64.S b/runtime/arch/arm64/jni_entrypoints_arm64.S
index 9612a7b..c39dd0a 100644
--- a/runtime/arch/arm64/jni_entrypoints_arm64.S
+++ b/runtime/arch/arm64/jni_entrypoints_arm64.S
@@ -277,10 +277,9 @@
     REFRESH_MARKING_REGISTER
 
     // Check for exception before moving args back to keep the return PC for managed stack walk.
+    CFI_REMEMBER_STATE
     cbz   x13, .Lcritical_deliver_exception
 
-    .cfi_remember_state
-
     // Move stack args to their original place.
     cbz   x14, .Lcritical_skip_copy_args_back
     sub   x12, sp, x14
@@ -296,9 +295,9 @@
 
     // Do the tail call.
     br    x13
-    CFI_RESTORE_STATE_AND_DEF_CFA sp, FRAME_SIZE_SAVE_REFS_AND_ARGS
 
 .Lcritical_deliver_exception:
+    CFI_RESTORE_STATE_AND_DEF_CFA sp, FRAME_SIZE_SAVE_REFS_AND_ARGS
     // The exception delivery checks that xSELF was saved but the SaveRefsAndArgs
     // frame does not save it, so we cannot use the existing SaveRefsAndArgs frame.
     // That's why we checked for exception after restoring registers from it.
diff --git a/runtime/arch/arm64/jni_frame_arm64.h b/runtime/arch/arm64/jni_frame_arm64.h
index 9f691d0..245f848 100644
--- a/runtime/arch/arm64/jni_frame_arm64.h
+++ b/runtime/arch/arm64/jni_frame_arm64.h
@@ -23,8 +23,9 @@
 #include "base/bit_utils.h"
 #include "base/globals.h"
 #include "base/logging.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace arm64 {
 
 constexpr size_t kFramePointerSize = static_cast<size_t>(PointerSize::k64);
@@ -92,4 +93,3 @@
 }  // namespace art
 
 #endif  // ART_RUNTIME_ARCH_ARM64_JNI_FRAME_ARM64_H_
-
diff --git a/runtime/arch/arm64/quick_entrypoints_arm64.S b/runtime/arch/arm64/quick_entrypoints_arm64.S
index 18ec810..3c2445c 100644
--- a/runtime/arch/arm64/quick_entrypoints_arm64.S
+++ b/runtime/arch/arm64/quick_entrypoints_arm64.S
@@ -18,6 +18,7 @@
 #include "interpreter/cfi_asm_support.h"
 
 #include "arch/quick_alloc_entrypoints.S"
+#include "arch/quick_field_entrypoints.S"
 
 .macro SAVE_REG_INCREASE_FRAME reg, frame_adjustment
     str \reg, [sp, #-(\frame_adjustment)]!
@@ -195,14 +196,18 @@
     RESTORE_SAVE_EVERYTHING_FRAME_KEEP_X0
 .endm
 
-.macro RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+.macro RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION is_ref = 0
     ldr x1, [xSELF, # THREAD_EXCEPTION_OFFSET]  // Get exception field.
     cbnz x1, 1f
-    DEOPT_OR_RETURN x1                         // Check if deopt is required
+    DEOPT_OR_RETURN x1, \is_ref                // Check if deopt is required
 1:                                             // deliver exception on current thread
     DELIVER_PENDING_EXCEPTION
 .endm
 
+.macro RETURN_REF_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+    RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION /* is_ref= */ 1
+.endm
+
 .macro DEOPT_OR_RETURN temp, is_ref = 0
   ldr \temp, [xSELF, #THREAD_DEOPT_CHECK_REQUIRED_OFFSET]
   cbnz \temp, 2f
@@ -213,22 +218,20 @@
   mov x1, x0                        // pass the result
   mov x0, xSELF                     // Thread::Current
   bl artDeoptimizeIfNeeded
-  CFI_REMEMBER_STATE
   RESTORE_SAVE_EVERYTHING_FRAME
   REFRESH_MARKING_REGISTER
   ret
-  CFI_RESTORE_STATE_AND_DEF_CFA sp, FRAME_SIZE_SAVE_EVERYTHING
 .endm
 
 .macro DEOPT_OR_RESTORE_SAVE_EVERYTHING_FRAME_AND_RETURN_X0 temp, is_ref
   ldr \temp, [xSELF, #THREAD_DEOPT_CHECK_REQUIRED_OFFSET]
-  cbnz \temp, 2f
   CFI_REMEMBER_STATE
+  cbnz \temp, 2f
   RESTORE_SAVE_EVERYTHING_FRAME_KEEP_X0
   REFRESH_MARKING_REGISTER
   ret
-  CFI_RESTORE_STATE_AND_DEF_CFA sp, FRAME_SIZE_SAVE_EVERYTHING
 2:
+  CFI_RESTORE_STATE_AND_DEF_CFA sp, FRAME_SIZE_SAVE_EVERYTHING
   str x0, [sp, #SAVE_EVERYTHING_FRAME_X0_OFFSET] // update result in the frame
   mov x2, \is_ref                                // pass if result is a reference
   mov x1, x0                                     // pass the result
@@ -242,7 +245,7 @@
 .endm
 
 
-.macro RETURN_IF_W0_IS_ZERO_OR_DELIVER
+.macro RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
     cbnz w0, 1f                // result non-zero branch over
     DEOPT_OR_RETURN x1
 1:
@@ -718,8 +721,8 @@
     INCREASE_FRAME 16
     str xzr, [sp]                         // Store null for ArtMethod* slot
     // Branch to stub.
-    bl .Losr_entry
     CFI_REMEMBER_STATE
+    bl .Losr_entry
     DECREASE_FRAME 16
 
     // Restore saved registers including value address and shorty address.
@@ -851,7 +854,7 @@
     bl     artLockObjectFromCode      // (Object* obj, Thread*)
     RESTORE_SAVE_REFS_ONLY_FRAME
     REFRESH_MARKING_REGISTER
-    RETURN_IF_W0_IS_ZERO_OR_DELIVER
+    RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
 END art_quick_lock_object_no_inline
 
     /*
@@ -876,7 +879,7 @@
     bl     artUnlockObjectFromCode    // (Object* obj, Thread*)
     RESTORE_SAVE_REFS_ONLY_FRAME
     REFRESH_MARKING_REGISTER
-    RETURN_IF_W0_IS_ZERO_OR_DELIVER
+    RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
 END art_quick_unlock_object_no_inline
 
     /*
@@ -901,15 +904,17 @@
     RESTORE_REG xLR, 24
 
     // Check for exception
+    CFI_REMEMBER_STATE
     cbz x0, .Lthrow_class_cast_exception
 
     // Restore and return
-    CFI_REMEMBER_STATE
+    // TODO: We do not need to restore X0 and X1 on success. We also do not need
+    // to record CFI for them as the information is not very useful.
     RESTORE_TWO_REGS_DECREASE_FRAME x0, x1, 32
     ret
-    CFI_RESTORE_STATE_AND_DEF_CFA sp, 32
 
 .Lthrow_class_cast_exception:
+    CFI_RESTORE_STATE_AND_DEF_CFA sp, 32
     // Restore
     RESTORE_TWO_REGS_DECREASE_FRAME x0, x1, 32
 
@@ -1040,10 +1045,10 @@
     bl artIsAssignableFromCode
 
     // Check for exception
+    CFI_REMEMBER_STATE
     cbz x0, .Laput_obj_throw_array_store_exception
 
     // Restore
-    CFI_REMEMBER_STATE
     RESTORE_TWO_REGS x2, xLR, 16
     RESTORE_TWO_REGS_DECREASE_FRAME x0, x1, 32
 
@@ -1054,9 +1059,9 @@
     lsr x0, x0, #CARD_TABLE_CARD_SHIFT
     strb w3, [x3, x0]
     ret
-    CFI_RESTORE_STATE_AND_DEF_CFA sp, 32
 
 .Laput_obj_throw_array_store_exception:
+    CFI_RESTORE_STATE_AND_DEF_CFA sp, 32
     RESTORE_TWO_REGS x2, xLR, 16
     RESTORE_TWO_REGS_DECREASE_FRAME x0, x1, 32
 
@@ -1152,43 +1157,6 @@
 END \name
 .endm
 
-// Macros taking opportunity of code similarities for downcalls.
-.macro ONE_ARG_REF_DOWNCALL name, entrypoint, return
-    .extern \entrypoint
-ENTRY \name
-    SETUP_SAVE_REFS_ONLY_FRAME        // save callee saves in case of GC
-    mov    x1, xSELF                  // pass Thread::Current
-    bl     \entrypoint                // (uint32_t type_idx, Thread*)
-    RESTORE_SAVE_REFS_ONLY_FRAME
-    REFRESH_MARKING_REGISTER
-    \return
-END \name
-.endm
-
-.macro TWO_ARG_REF_DOWNCALL name, entrypoint, return
-    .extern \entrypoint
-ENTRY \name
-    SETUP_SAVE_REFS_ONLY_FRAME        // save callee saves in case of GC
-    mov    x2, xSELF                  // pass Thread::Current
-    bl     \entrypoint
-    RESTORE_SAVE_REFS_ONLY_FRAME
-    REFRESH_MARKING_REGISTER
-    \return
-END \name
-.endm
-
-.macro THREE_ARG_REF_DOWNCALL name, entrypoint, return
-    .extern \entrypoint
-ENTRY \name
-    SETUP_SAVE_REFS_ONLY_FRAME        // save callee saves in case of GC
-    mov    x3, xSELF                  // pass Thread::Current
-    bl     \entrypoint
-    RESTORE_SAVE_REFS_ONLY_FRAME
-    REFRESH_MARKING_REGISTER
-    \return
-END \name
-.endm
-
     /*
      * Macro for resolution and initialization of indexed DEX file
      * constants such as classes and strings.
@@ -1212,7 +1180,7 @@
             \name, \entrypoint, RUNTIME_SAVE_EVERYTHING_FOR_CLINIT_METHOD_OFFSET
 .endm
 
-.macro RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+.macro RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
     cbz w0, 1f                       // result zero branch over
     DEOPT_OR_RETURN x1, /*is_ref=*/1 // check for deopt or return
 1:
@@ -1224,8 +1192,9 @@
      * Entry from managed code that calls artHandleFillArrayDataFromCode and delivers exception on
      * failure.
      */
-TWO_ARG_REF_DOWNCALL \
-        art_quick_handle_fill_data, artHandleFillArrayDataFromCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER
+TWO_ARG_DOWNCALL art_quick_handle_fill_data, \
+                 artHandleFillArrayDataFromCode, \
+                 RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
 
     /*
      * Entry from managed code when uninitialized static storage, this stub will run the class
@@ -1241,74 +1210,7 @@
 ONE_ARG_SAVE_EVERYTHING_DOWNCALL art_quick_resolve_method_type, artResolveMethodTypeFromCode
 ONE_ARG_SAVE_EVERYTHING_DOWNCALL art_quick_resolve_string, artResolveStringFromCode
 
-// Note: Functions `art{Get,Set}<Kind>{Static,Instance}FromCompiledCode` are
-// defined with a macro in runtime/entrypoints/quick/quick_field_entrypoints.cc.
-
-ONE_ARG_REF_DOWNCALL art_quick_get_boolean_static, \
-                     artGetBooleanStaticFromCompiledCode, \
-                     RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get_byte_static, \
-                     artGetByteStaticFromCompiledCode, \
-                     RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get_char_static, \
-                     artGetCharStaticFromCompiledCode, \
-                     RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get_short_static, \
-                     artGetShortStaticFromCompiledCode, \
-                     RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get32_static, \
-                     artGet32StaticFromCompiledCode, \
-                     RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get64_static, \
-                     artGet64StaticFromCompiledCode, \
-                     RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get_obj_static, \
-                     artGetObjStaticFromCompiledCode, \
-                     RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-
-TWO_ARG_REF_DOWNCALL art_quick_get_boolean_instance, \
-                     artGetBooleanInstanceFromCompiledCode, \
-                     RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get_byte_instance, \
-                     artGetByteInstanceFromCompiledCode, \
-                     RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get_char_instance, \
-                     artGetCharInstanceFromCompiledCode, \
-                     RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get_short_instance, \
-                     artGetShortInstanceFromCompiledCode, \
-                     RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get32_instance, \
-                     artGet32InstanceFromCompiledCode, \
-                     RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get64_instance, \
-                     artGet64InstanceFromCompiledCode, \
-                     RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get_obj_instance, \
-                     artGetObjInstanceFromCompiledCode, \
-                     RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-
-TWO_ARG_REF_DOWNCALL \
-    art_quick_set8_static, artSet8StaticFromCompiledCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER
-TWO_ARG_REF_DOWNCALL \
-    art_quick_set16_static, artSet16StaticFromCompiledCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER
-TWO_ARG_REF_DOWNCALL \
-    art_quick_set32_static, artSet32StaticFromCompiledCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER
-TWO_ARG_REF_DOWNCALL \
-    art_quick_set64_static, artSet64StaticFromCompiledCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER
-TWO_ARG_REF_DOWNCALL \
-    art_quick_set_obj_static, artSetObjStaticFromCompiledCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER
-
-THREE_ARG_REF_DOWNCALL \
-    art_quick_set8_instance, artSet8InstanceFromCompiledCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER
-THREE_ARG_REF_DOWNCALL \
-    art_quick_set16_instance, artSet16InstanceFromCompiledCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER
-THREE_ARG_REF_DOWNCALL \
-    art_quick_set32_instance, artSet32InstanceFromCompiledCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER
-THREE_ARG_REF_DOWNCALL \
-    art_quick_set64_instance, artSet64InstanceFromCompiledCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER
-THREE_ARG_REF_DOWNCALL \
-    art_quick_set_obj_instance, artSetObjInstanceFromCompiledCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER
+GENERATE_FIELD_ENTRYPOINTS
 
 // Generate the allocation entrypoints for each allocator.
 GENERATE_ALLOC_ENTRYPOINTS_FOR_NON_TLAB_ALLOCATORS
@@ -1365,7 +1267,7 @@
                                                               // already aligned we can combine the
                                                               // two shifts together.
     add    x4, xSELF, x3, lsr #(ROSALLOC_BRACKET_QUANTUM_SIZE_SHIFT - POINTER_SIZE_SHIFT)
-                                                              // Subtract pointer size since ther
+                                                              // Subtract pointer size since there
                                                               // are no runs for 0 byte allocations
                                                               // and the size is already aligned.
     ldr    x4, [x4, #(THREAD_ROSALLOC_RUNS_OFFSET - __SIZEOF_POINTER__)]
@@ -1436,7 +1338,7 @@
     bl     \cxx_name
     RESTORE_SAVE_REFS_ONLY_FRAME
     REFRESH_MARKING_REGISTER
-    RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 END \c_name
 .endm
 
@@ -1462,9 +1364,6 @@
     // See Class::SetStatus() in class.cc for more details.
     bhi    \slowPathLabel
     str    x6, [xSELF, #THREAD_LOCAL_POS_OFFSET]              // Store new thread_local_pos.
-    ldr    x5, [xSELF, #THREAD_LOCAL_OBJECTS_OFFSET]          // Increment thread_local_objects.
-    add    x5, x5, #1
-    str    x5, [xSELF, #THREAD_LOCAL_OBJECTS_OFFSET]
     POISON_HEAP_REF w0
     str    w0, [x4, #MIRROR_OBJECT_CLASS_OFFSET]              // Store the class pointer.
     mov    x0, x4
@@ -1489,7 +1388,7 @@
     bl     \entrypoint                         // (mirror::Class*, Thread*)
     RESTORE_SAVE_REFS_ONLY_FRAME
     REFRESH_MARKING_REGISTER
-    RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 END \name
 .endm
 
@@ -1537,9 +1436,6 @@
     mov    x0, \xTemp0
     add    \xTemp0, \xTemp0, \xTemp1
     str    \xTemp0, [xSELF, #THREAD_LOCAL_POS_OFFSET]         // Store new thread_local_pos.
-    ldr    \xTemp0, [xSELF, #THREAD_LOCAL_OBJECTS_OFFSET]     // Increment thread_local_objects.
-    add    \xTemp0, \xTemp0, #1
-    str    \xTemp0, [xSELF, #THREAD_LOCAL_OBJECTS_OFFSET]
     POISON_HEAP_REF \wClass
     str    \wClass, [x0, #MIRROR_OBJECT_CLASS_OFFSET]         // Store the class pointer.
     str    \wCount, [x0, #MIRROR_ARRAY_LENGTH_OFFSET]         // Store the array length.
@@ -1572,7 +1468,7 @@
     bl     \entrypoint
     RESTORE_SAVE_REFS_ONLY_FRAME
     REFRESH_MARKING_REGISTER
-    RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 END \name
 .endm
 
@@ -1702,8 +1598,8 @@
     mov     x3, sp                      // pass SP
     bl      artQuickProxyInvokeHandler  // (Method* proxy method, receiver, Thread*, SP)
     ldr     x2, [xSELF, THREAD_EXCEPTION_OFFSET]
-    cbnz    x2, .Lexception_in_proxy    // success if no exception is pending
     CFI_REMEMBER_STATE
+    cbnz    x2, .Lexception_in_proxy    // success if no exception is pending
     RESTORE_SAVE_REFS_AND_ARGS_FRAME    // Restore frame
     REFRESH_MARKING_REGISTER
     fmov    d0, x0                      // Store result in d0 in case it was float or double
@@ -1751,8 +1647,8 @@
     mov x2, xSELF
     mov x3, sp
     bl artQuickResolutionTrampoline  // (called, receiver, Thread*, SP)
-    cbz x0, 1f
     CFI_REMEMBER_STATE
+    cbz x0, 1f
     mov xIP0, x0            // Remember returned code pointer in xIP0.
     ldr x0, [sp, #0]        // artQuickResolutionTrampoline puts called method in *SP.
     RESTORE_SAVE_REFS_AND_ARGS_FRAME
@@ -1890,11 +1786,11 @@
 
     LOAD_RUNTIME_INSTANCE x1
     ldrb w1, [x1, #RUN_EXIT_HOOKS_OFFSET_FROM_RUNTIME_INSTANCE]
+    CFI_REMEMBER_STATE
     cbnz w1, .Lcall_method_exit_hook
 .Lcall_method_exit_hook_done:
 
     // Tear down the callee-save frame.
-    CFI_REMEMBER_STATE
     .cfi_def_cfa_register sp
     // Restore callee-saves and LR as in `RESTORE_SAVE_REFS_AND_ARGS_FRAME`
     // but do not restore argument registers.
@@ -1919,10 +1815,8 @@
     fmov d0, x0
     ret
 
-    // Undo the unwinding information from above since it doesn't apply below.
-    CFI_RESTORE_STATE_AND_DEF_CFA x28, FRAME_SIZE_SAVE_REFS_AND_ARGS
-
 .Lcall_method_exit_hook:
+    CFI_RESTORE_STATE_AND_DEF_CFA x28, FRAME_SIZE_SAVE_REFS_AND_ARGS
     fmov d0, x0
     mov x4, FRAME_SIZE_SAVE_REFS_AND_ARGS
     bl art_quick_method_exit_hook
@@ -2112,7 +2006,7 @@
     bl     artStringBuilderAppend       // (uint32_t, const unit32_t*, Thread*)
     RESTORE_SAVE_REFS_ONLY_FRAME
     REFRESH_MARKING_REGISTER
-    RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 END art_quick_string_builder_append
 
     /*
diff --git a/runtime/arch/arm64/registers_arm64.cc b/runtime/arch/arm64/registers_arm64.cc
index ea4383a..bc4c203 100644
--- a/runtime/arch/arm64/registers_arm64.cc
+++ b/runtime/arch/arm64/registers_arm64.cc
@@ -18,7 +18,7 @@
 
 #include <ostream>
 
-namespace art {
+namespace art HIDDEN {
 namespace arm64 {
 
 static const char* kRegisterNames[] = {
diff --git a/runtime/arch/arm64/registers_arm64.h b/runtime/arch/arm64/registers_arm64.h
index d4c9192..5d81a42 100644
--- a/runtime/arch/arm64/registers_arm64.h
+++ b/runtime/arch/arm64/registers_arm64.h
@@ -19,7 +19,9 @@
 
 #include <iosfwd>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 namespace arm64 {
 
 // Values for GP XRegisters - 64bit registers.
diff --git a/runtime/arch/arm64/thread_arm64.cc b/runtime/arch/arm64/thread_arm64.cc
index 19c4a6a..ab9ef16 100644
--- a/runtime/arch/arm64/thread_arm64.cc
+++ b/runtime/arch/arm64/thread_arm64.cc
@@ -21,7 +21,7 @@
 #include "asm_support_arm64.h"
 #include "base/enums.h"
 
-namespace art {
+namespace art HIDDEN {
 
 void Thread::InitCpu() {
   CHECK_EQ(THREAD_FLAGS_OFFSET, ThreadFlagsOffset<PointerSize::k64>().Int32Value());
diff --git a/runtime/arch/context-inl.h b/runtime/arch/context-inl.h
index 453432b..fd81ae2 100644
--- a/runtime/arch/context-inl.h
+++ b/runtime/arch/context-inl.h
@@ -41,7 +41,7 @@
 #error unimplemented
 #endif
 
-namespace art {
+namespace art HIDDEN {
 
 using RuntimeContextType = RUNTIME_CONTEXT_TYPE;
 
diff --git a/runtime/arch/context.cc b/runtime/arch/context.cc
index 82d8b6c..b9931c4 100644
--- a/runtime/arch/context.cc
+++ b/runtime/arch/context.cc
@@ -16,7 +16,7 @@
 
 #include "context-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 Context* Context::Create() {
   return new RuntimeContextType;
diff --git a/runtime/arch/context.h b/runtime/arch/context.h
index be7adc7..bfe322e 100644
--- a/runtime/arch/context.h
+++ b/runtime/arch/context.h
@@ -22,7 +22,7 @@
 
 #include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class QuickMethodFrameInfo;
 
@@ -31,7 +31,7 @@
 class Context {
  public:
   // Creates a context for the running architecture
-  static Context* Create();
+  EXPORT static Context* Create();
 
   virtual ~Context() {}
 
@@ -90,9 +90,7 @@
 
   // Set `new_value` to the physical register containing the dex PC pointer in
   // an nterp frame.
-  virtual void SetNterpDexPC(uintptr_t new_value ATTRIBUTE_UNUSED) {
-    abort();
-  }
+  virtual void SetNterpDexPC([[maybe_unused]] uintptr_t new_value) { abort(); }
 
   // Switches execution of the executing context to this context
   NO_RETURN virtual void DoLongJump() = 0;
diff --git a/runtime/arch/instruction_set_features.cc b/runtime/arch/instruction_set_features.cc
index d88c544..3ab9856 100644
--- a/runtime/arch/instruction_set_features.cc
+++ b/runtime/arch/instruction_set_features.cc
@@ -28,7 +28,7 @@
 #include "x86/instruction_set_features_x86.h"
 #include "x86_64/instruction_set_features_x86_64.h"
 
-namespace art {
+namespace art HIDDEN {
 
 std::unique_ptr<const InstructionSetFeatures> InstructionSetFeatures::FromVariant(
     InstructionSet isa, const std::string& variant, std::string* error_msg) {
@@ -313,7 +313,7 @@
 }
 
 std::unique_ptr<const InstructionSetFeatures> InstructionSetFeatures::AddRuntimeDetectedFeatures(
-    const InstructionSetFeatures *features ATTRIBUTE_UNUSED) const {
+    [[maybe_unused]] const InstructionSetFeatures* features) const {
   UNIMPLEMENTED(FATAL) << kRuntimeISA;
   UNREACHABLE();
 }
diff --git a/runtime/arch/instruction_set_features.h b/runtime/arch/instruction_set_features.h
index 1f41b39..b31f30d 100644
--- a/runtime/arch/instruction_set_features.h
+++ b/runtime/arch/instruction_set_features.h
@@ -24,7 +24,7 @@
 #include "arch/instruction_set.h"
 #include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArmInstructionSetFeatures;
 class Arm64InstructionSetFeatures;
@@ -36,22 +36,21 @@
 class InstructionSetFeatures {
  public:
   // Process a CPU variant string for the given ISA and create an InstructionSetFeatures.
-  static std::unique_ptr<const InstructionSetFeatures> FromVariant(InstructionSet isa,
-                                                                   const std::string& variant,
-                                                                   std::string* error_msg);
+  EXPORT static std::unique_ptr<const InstructionSetFeatures> FromVariant(
+      InstructionSet isa, const std::string& variant, std::string* error_msg);
 
   // Process a CPU variant string for the given ISA and make sure the features advertised
   // are supported by the hardware. This is needed for Pixel3a which wrongly
   // reports itself as cortex-a75.
-  static std::unique_ptr<const InstructionSetFeatures> FromVariantAndHwcap(
+  EXPORT static std::unique_ptr<const InstructionSetFeatures> FromVariantAndHwcap(
       InstructionSet isa, const std::string& variant, std::string* error_msg);
 
   // Parse a bitmap for the given isa and create an InstructionSetFeatures.
-  static std::unique_ptr<const InstructionSetFeatures> FromBitmap(InstructionSet isa,
-                                                                  uint32_t bitmap);
+  EXPORT static std::unique_ptr<const InstructionSetFeatures> FromBitmap(InstructionSet isa,
+                                                                         uint32_t bitmap);
 
   // Turn C pre-processor #defines into the equivalent instruction set features for kRuntimeISA.
-  static std::unique_ptr<const InstructionSetFeatures> FromCppDefines();
+  EXPORT static std::unique_ptr<const InstructionSetFeatures> FromCppDefines();
 
   // Check if run-time detection of instruction set features is supported.
   //
@@ -83,7 +82,7 @@
 
   // Parse a string of the form "div,-atomic_ldrd_strd" adding and removing these features to
   // create a new InstructionSetFeatures.
-  std::unique_ptr<const InstructionSetFeatures> AddFeaturesFromString(
+  EXPORT std::unique_ptr<const InstructionSetFeatures> AddFeaturesFromString(
       const std::string& feature_list, std::string* error_msg) const WARN_UNUSED;
 
   // Are these features the same as the other given features?
@@ -120,10 +119,10 @@
   const ArmInstructionSetFeatures* AsArmInstructionSetFeatures() const;
 
   // Down cast this Arm64InstructionFeatures.
-  const Arm64InstructionSetFeatures* AsArm64InstructionSetFeatures() const;
+  EXPORT const Arm64InstructionSetFeatures* AsArm64InstructionSetFeatures() const;
 
   // Down cast this Riscv64InstructionFeatures.
-  const Riscv64InstructionSetFeatures* AsRiscv64InstructionSetFeatures() const;
+  EXPORT const Riscv64InstructionSetFeatures* AsRiscv64InstructionSetFeatures() const;
 
   // Down cast this X86InstructionFeatures.
   const X86InstructionSetFeatures* AsX86InstructionSetFeatures() const;
@@ -146,13 +145,13 @@
                                  std::string* error_msg) const = 0;
 
   // Add run-time detected architecture specific features in sub-classes.
-  virtual std::unique_ptr<const InstructionSetFeatures>
-      AddRuntimeDetectedFeatures(const InstructionSetFeatures *features ATTRIBUTE_UNUSED) const;
+  virtual std::unique_ptr<const InstructionSetFeatures> AddRuntimeDetectedFeatures(
+      [[maybe_unused]] const InstructionSetFeatures* features) const;
 
  private:
   DISALLOW_COPY_AND_ASSIGN(InstructionSetFeatures);
 };
-std::ostream& operator<<(std::ostream& os, const InstructionSetFeatures& rhs);
+EXPORT std::ostream& operator<<(std::ostream& os, const InstructionSetFeatures& rhs);
 
 }  // namespace art
 
diff --git a/runtime/arch/instruction_set_features_test.cc b/runtime/arch/instruction_set_features_test.cc
index 82b8242..fbd2137 100644
--- a/runtime/arch/instruction_set_features_test.cc
+++ b/runtime/arch/instruction_set_features_test.cc
@@ -28,7 +28,7 @@
 #include <android-base/logging.h>
 #include <android-base/stringprintf.h>
 
-namespace art {
+namespace art HIDDEN {
 
 #ifdef ART_TARGET_ANDROID
 
diff --git a/runtime/arch/memcmp16.cc b/runtime/arch/memcmp16.cc
index e714cfc..614a878 100644
--- a/runtime/arch/memcmp16.cc
+++ b/runtime/arch/memcmp16.cc
@@ -29,7 +29,7 @@
   return 0;
 }
 
-namespace art {
+namespace art HIDDEN {
 
 namespace testing {
 
diff --git a/runtime/arch/memcmp16.h b/runtime/arch/memcmp16.h
index 0226c4e..1e857db 100644
--- a/runtime/arch/memcmp16.h
+++ b/runtime/arch/memcmp16.h
@@ -20,6 +20,8 @@
 #include <cstddef>
 #include <cstdint>
 
+#include "base/macros.h"
+
 // memcmp16 support.
 //
 // This can either be optimized assembly code, in which case we expect a function __memcmp16,
@@ -47,10 +49,11 @@
   return 0;
 }
 
+// TODO(260881207): decide whether to hide this symbol.
 extern "C" int32_t memcmp16_generic_static(const uint16_t* s0, const uint16_t* s1, size_t count);
 #endif
 
-namespace art {
+namespace art HIDDEN {
 
 namespace testing {
 
diff --git a/runtime/arch/quick_alloc_entrypoints.S b/runtime/arch/quick_alloc_entrypoints.S
index 5d4b24b..c79366a 100644
--- a/runtime/arch/quick_alloc_entrypoints.S
+++ b/runtime/arch/quick_alloc_entrypoints.S
@@ -16,27 +16,27 @@
 
 .macro GENERATE_ALLOC_ENTRYPOINTS c_suffix, cxx_suffix
 // Called by managed code to allocate an object of a resolved class.
-ONE_ARG_DOWNCALL art_quick_alloc_object_resolved\c_suffix, artAllocObjectFromCodeResolved\cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+ONE_ARG_DOWNCALL art_quick_alloc_object_resolved\c_suffix, artAllocObjectFromCodeResolved\cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 // Called by managed code to allocate an object of an initialized class.
-ONE_ARG_DOWNCALL art_quick_alloc_object_initialized\c_suffix, artAllocObjectFromCodeInitialized\cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+ONE_ARG_DOWNCALL art_quick_alloc_object_initialized\c_suffix, artAllocObjectFromCodeInitialized\cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 // Called by managed code to allocate an object when the caller doesn't know whether it has access
 // to the created type.
-ONE_ARG_DOWNCALL art_quick_alloc_object_with_checks\c_suffix, artAllocObjectFromCodeWithChecks\cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+ONE_ARG_DOWNCALL art_quick_alloc_object_with_checks\c_suffix, artAllocObjectFromCodeWithChecks\cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 // Called by managed code to allocate a string if it could not be removed by any optimizations
-ONE_ARG_DOWNCALL art_quick_alloc_string_object\c_suffix, artAllocStringObject\cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+ONE_ARG_DOWNCALL art_quick_alloc_string_object\c_suffix, artAllocStringObject\cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 // Called by managed code to allocate an array of a resolve class.
-TWO_ARG_DOWNCALL art_quick_alloc_array_resolved\c_suffix, artAllocArrayFromCodeResolved\cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+TWO_ARG_DOWNCALL art_quick_alloc_array_resolved\c_suffix, artAllocArrayFromCodeResolved\cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 // Called by managed code to allocate a string from bytes
-FOUR_ARG_DOWNCALL art_quick_alloc_string_from_bytes\c_suffix, artAllocStringFromBytesFromCode\cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+FOUR_ARG_DOWNCALL art_quick_alloc_string_from_bytes\c_suffix, artAllocStringFromBytesFromCode\cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 // Called by managed code to allocate a string from chars
-THREE_ARG_DOWNCALL art_quick_alloc_string_from_chars\c_suffix, artAllocStringFromCharsFromCode\cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+THREE_ARG_DOWNCALL art_quick_alloc_string_from_chars\c_suffix, artAllocStringFromCharsFromCode\cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 // Called by managed code to allocate a string from string
-ONE_ARG_DOWNCALL art_quick_alloc_string_from_string\c_suffix, artAllocStringFromStringFromCode\cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+ONE_ARG_DOWNCALL art_quick_alloc_string_from_string\c_suffix, artAllocStringFromStringFromCode\cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 
-TWO_ARG_DOWNCALL art_quick_alloc_array_resolved8\c_suffix, artAllocArrayFromCodeResolved\cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
-TWO_ARG_DOWNCALL art_quick_alloc_array_resolved16\c_suffix, artAllocArrayFromCodeResolved\cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
-TWO_ARG_DOWNCALL art_quick_alloc_array_resolved32\c_suffix, artAllocArrayFromCodeResolved\cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
-TWO_ARG_DOWNCALL art_quick_alloc_array_resolved64\c_suffix, artAllocArrayFromCodeResolved\cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+TWO_ARG_DOWNCALL art_quick_alloc_array_resolved8\c_suffix, artAllocArrayFromCodeResolved\cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
+TWO_ARG_DOWNCALL art_quick_alloc_array_resolved16\c_suffix, artAllocArrayFromCodeResolved\cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
+TWO_ARG_DOWNCALL art_quick_alloc_array_resolved32\c_suffix, artAllocArrayFromCodeResolved\cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
+TWO_ARG_DOWNCALL art_quick_alloc_array_resolved64\c_suffix, artAllocArrayFromCodeResolved\cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 .endm
 
 .macro GENERATE_ALL_ALLOC_ENTRYPOINTS
@@ -58,29 +58,29 @@
 // GENERATE_ALL_ALLOC_ENTRYPOINTS for selectively implementing allocation fast paths in
 // hand-written assembly.
 #define GENERATE_ALLOC_ENTRYPOINTS_ALLOC_OBJECT_RESOLVED(c_suffix, cxx_suffix) \
-  ONE_ARG_DOWNCALL art_quick_alloc_object_resolved ## c_suffix, artAllocObjectFromCodeResolved ## cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+  ONE_ARG_DOWNCALL art_quick_alloc_object_resolved ## c_suffix, artAllocObjectFromCodeResolved ## cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 #define GENERATE_ALLOC_ENTRYPOINTS_ALLOC_OBJECT_INITIALIZED(c_suffix, cxx_suffix) \
-  ONE_ARG_DOWNCALL art_quick_alloc_object_initialized ## c_suffix, artAllocObjectFromCodeInitialized ## cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+  ONE_ARG_DOWNCALL art_quick_alloc_object_initialized ## c_suffix, artAllocObjectFromCodeInitialized ## cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 #define GENERATE_ALLOC_ENTRYPOINTS_ALLOC_OBJECT_WITH_ACCESS_CHECK(c_suffix, cxx_suffix) \
-  ONE_ARG_DOWNCALL art_quick_alloc_object_with_checks ## c_suffix, artAllocObjectFromCodeWithChecks ## cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+  ONE_ARG_DOWNCALL art_quick_alloc_object_with_checks ## c_suffix, artAllocObjectFromCodeWithChecks ## cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 #define GENERATE_ALLOC_ENTRYPOINTS_ALLOC_STRING_OBJECT(c_suffix, cxx_suffix) \
-  ONE_ARG_DOWNCALL art_quick_alloc_string_object ## c_suffix, artAllocStringObject ## cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+  ONE_ARG_DOWNCALL art_quick_alloc_string_object ## c_suffix, artAllocStringObject ## cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 #define GENERATE_ALLOC_ENTRYPOINTS_ALLOC_STRING_FROM_BYTES(c_suffix, cxx_suffix) \
-  FOUR_ARG_DOWNCALL art_quick_alloc_string_from_bytes ## c_suffix, artAllocStringFromBytesFromCode ## cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+  FOUR_ARG_DOWNCALL art_quick_alloc_string_from_bytes ## c_suffix, artAllocStringFromBytesFromCode ## cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 #define GENERATE_ALLOC_ENTRYPOINTS_ALLOC_STRING_FROM_CHARS(c_suffix, cxx_suffix) \
-  THREE_ARG_DOWNCALL art_quick_alloc_string_from_chars ## c_suffix, artAllocStringFromCharsFromCode ## cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+  THREE_ARG_DOWNCALL art_quick_alloc_string_from_chars ## c_suffix, artAllocStringFromCharsFromCode ## cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 #define GENERATE_ALLOC_ENTRYPOINTS_ALLOC_STRING_FROM_STRING(c_suffix, cxx_suffix) \
-  ONE_ARG_DOWNCALL art_quick_alloc_string_from_string ## c_suffix, artAllocStringFromStringFromCode ## cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+  ONE_ARG_DOWNCALL art_quick_alloc_string_from_string ## c_suffix, artAllocStringFromStringFromCode ## cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 #define GENERATE_ALLOC_ENTRYPOINTS_ALLOC_ARRAY_RESOLVED(c_suffix, cxx_suffix) \
-  TWO_ARG_DOWNCALL art_quick_alloc_array_resolved ## c_suffix, artAllocArrayFromCodeResolved ## cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+  TWO_ARG_DOWNCALL art_quick_alloc_array_resolved ## c_suffix, artAllocArrayFromCodeResolved ## cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 #define GENERATE_ALLOC_ENTRYPOINTS_ALLOC_ARRAY_RESOLVED8(c_suffix, cxx_suffix) \
-  TWO_ARG_DOWNCALL art_quick_alloc_array_resolved8 ## c_suffix, artAllocArrayFromCodeResolved ## cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+  TWO_ARG_DOWNCALL art_quick_alloc_array_resolved8 ## c_suffix, artAllocArrayFromCodeResolved ## cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 #define GENERATE_ALLOC_ENTRYPOINTS_ALLOC_ARRAY_RESOLVED16(c_suffix, cxx_suffix) \
-  TWO_ARG_DOWNCALL art_quick_alloc_array_resolved16 ## c_suffix, artAllocArrayFromCodeResolved ## cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+  TWO_ARG_DOWNCALL art_quick_alloc_array_resolved16 ## c_suffix, artAllocArrayFromCodeResolved ## cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 #define GENERATE_ALLOC_ENTRYPOINTS_ALLOC_ARRAY_RESOLVED32(c_suffix, cxx_suffix) \
-  TWO_ARG_DOWNCALL art_quick_alloc_array_resolved32 ## c_suffix, artAllocArrayFromCodeResolved ## cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+  TWO_ARG_DOWNCALL art_quick_alloc_array_resolved32 ## c_suffix, artAllocArrayFromCodeResolved ## cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 #define GENERATE_ALLOC_ENTRYPOINTS_ALLOC_ARRAY_RESOLVED64(c_suffix, cxx_suffix) \
-  TWO_ARG_DOWNCALL art_quick_alloc_array_resolved64 ## c_suffix, artAllocArrayFromCodeResolved ## cxx_suffix, RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER
+  TWO_ARG_DOWNCALL art_quick_alloc_array_resolved64 ## c_suffix, artAllocArrayFromCodeResolved ## cxx_suffix, RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
 
 .macro GENERATE_ALLOC_ENTRYPOINTS_FOR_REGION_TLAB_ALLOCATOR
 // This is to be separately defined for each architecture to allow a hand-written assembly fast path.
diff --git a/runtime/arch/quick_field_entrypoints.S b/runtime/arch/quick_field_entrypoints.S
new file mode 100644
index 0000000..0bea803
--- /dev/null
+++ b/runtime/arch/quick_field_entrypoints.S
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Note: Functions `art{Get,Set}<Kind>{Static,Instance}FromCompiledCode` are
+// defined with a macro in runtime/entrypoints/quick/quick_field_entrypoints.cc.
+
+.macro GENERATE_STATIC_FIELD_GETTERS
+ONE_ARG_DOWNCALL art_quick_get_boolean_static, \
+                 artGetBooleanStaticFromCompiledCode, \
+                 RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+ONE_ARG_DOWNCALL art_quick_get_byte_static, \
+                 artGetByteStaticFromCompiledCode, \
+                 RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+ONE_ARG_DOWNCALL art_quick_get_char_static, \
+                 artGetCharStaticFromCompiledCode, \
+                 RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+ONE_ARG_DOWNCALL art_quick_get_short_static, \
+                 artGetShortStaticFromCompiledCode, \
+                 RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+ONE_ARG_DOWNCALL art_quick_get32_static, \
+                 artGet32StaticFromCompiledCode, \
+                 RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+ONE_ARG_DOWNCALL art_quick_get_obj_static, \
+                 artGetObjStaticFromCompiledCode, \
+                 RETURN_REF_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+ONE_ARG_DOWNCALL art_quick_get64_static, \
+                 artGet64StaticFromCompiledCode, \
+                 RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+.endm
+
+.macro GENERATE_INSTANCE_FIELD_GETTERS
+TWO_ARG_DOWNCALL art_quick_get_boolean_instance, \
+                 artGetBooleanInstanceFromCompiledCode, \
+                 RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+TWO_ARG_DOWNCALL art_quick_get_byte_instance, \
+                 artGetByteInstanceFromCompiledCode, \
+                 RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+TWO_ARG_DOWNCALL art_quick_get_char_instance, \
+                 artGetCharInstanceFromCompiledCode, \
+                 RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+TWO_ARG_DOWNCALL art_quick_get_short_instance, \
+                 artGetShortInstanceFromCompiledCode, \
+                 RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+TWO_ARG_DOWNCALL art_quick_get32_instance, \
+                 artGet32InstanceFromCompiledCode, \
+                 RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+TWO_ARG_DOWNCALL art_quick_get_obj_instance, \
+                 artGetObjInstanceFromCompiledCode, \
+                 RETURN_REF_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+TWO_ARG_DOWNCALL art_quick_get64_instance, \
+                 artGet64InstanceFromCompiledCode, \
+                 RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+.endm
+
+.macro GENERATE_STATIC_FIELD_SETTERS emit64 = 1
+TWO_ARG_DOWNCALL art_quick_set8_static, \
+                 artSet8StaticFromCompiledCode, \
+                 RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
+TWO_ARG_DOWNCALL art_quick_set16_static, \
+                 artSet16StaticFromCompiledCode, \
+                 RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
+TWO_ARG_DOWNCALL art_quick_set32_static, \
+                 artSet32StaticFromCompiledCode, \
+                 RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
+TWO_ARG_DOWNCALL art_quick_set_obj_static, \
+                 artSetObjStaticFromCompiledCode, \
+                 RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
+.if \emit64
+TWO_ARG_DOWNCALL art_quick_set64_static, \
+                 artSet64StaticFromCompiledCode, \
+                 RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
+.endif
+.endm
+
+.macro GENERATE_INSTANCE_FIELD_SETTERS emit64 = 1
+THREE_ARG_DOWNCALL art_quick_set8_instance, \
+                   artSet8InstanceFromCompiledCode, \
+                   RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
+THREE_ARG_DOWNCALL art_quick_set16_instance, \
+                   artSet16InstanceFromCompiledCode, \
+                   RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
+THREE_ARG_DOWNCALL art_quick_set32_instance, \
+                   artSet32InstanceFromCompiledCode, \
+                   RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
+THREE_ARG_DOWNCALL art_quick_set_obj_instance, \
+                   artSetObjInstanceFromCompiledCode, \
+                   RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
+.if \emit64
+THREE_ARG_DOWNCALL art_quick_set64_instance, \
+                   artSet64InstanceFromCompiledCode, \
+                   RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
+.endif
+.endm
+
+.macro GENERATE_FIELD_ENTRYPOINTS
+    GENERATE_STATIC_FIELD_GETTERS
+    GENERATE_INSTANCE_FIELD_GETTERS
+    GENERATE_STATIC_FIELD_SETTERS
+    GENERATE_INSTANCE_FIELD_SETTERS
+.endm
diff --git a/runtime/arch/riscv64/asm_support_riscv64.S b/runtime/arch/riscv64/asm_support_riscv64.S
index 71c9928..22acbfb 100644
--- a/runtime/arch/riscv64/asm_support_riscv64.S
+++ b/runtime/arch/riscv64/asm_support_riscv64.S
@@ -29,12 +29,7 @@
 .macro ENTRY name
     .hidden \name  // Hide this as a global symbol, so we do not incur plt calls.
     .global \name
-    // ART-compiled functions have OatQuickMethodHeader but assembly functions do not.
-    // Prefix the assembly code with 0xFFs, which means there is no method header.
-    .byte 0xFF, 0xFF, 0xFF, 0xFF
-    // Cache alignment for function entry.
-    // Use 0xFF as the last 4 bytes of alignment stand for OatQuickMethodHeader.
-    .balign 16, 0xFF
+    .balign 16
 \name:
     .cfi_startproc
 .endm
@@ -42,6 +37,7 @@
 
 .macro END name
     .cfi_endproc
+    .size \name, .-\name
 .endm
 
 
@@ -52,14 +48,66 @@
 .endm
 
 
+.macro CFI_REMEMBER_STATE
+    .cfi_remember_state
+.endm
+
+
 // The spec is not clear whether the CFA is part of the saved state and tools differ in the
 // behaviour, so explicitly set the CFA to avoid any ambiguity.
+// The restored CFA state should match the CFA state during CFI_REMEMBER_STATE.
 .macro CFI_RESTORE_STATE_AND_DEF_CFA reg, offset
     .cfi_restore_state
     .cfi_def_cfa \reg, \offset
 .endm
 
 
+.macro CFI_EXPRESSION_BREG n, b, offset
+    .if (-0x40 <= (\offset)) && ((\offset) < 0x40)
+        CFI_EXPRESSION_BREG_1(\n, \b, \offset)
+    .elseif (-0x2000 <= (\offset)) && ((\offset) < 0x2000)
+        CFI_EXPRESSION_BREG_2(\n, \b, \offset)
+    .else
+        .error "Unsupported offset"
+    .endif
+.endm
+
+
+.macro CFI_DEF_CFA_BREG_PLUS_UCONST reg, offset, size
+    .if (((\offset) < -0x40) || ((\offset) >= 0x40))
+        .error "Unsupported offset"
+    .endif
+
+    .if ((\size) < 0)
+        .error "Unsupported size, negative"
+    .elseif ((\size) < 0x80)
+        CFI_DEF_CFA_BREG_PLUS_UCONST_1_1(\reg, \offset, \size)
+    .elseif ((\size) < 0x4000)
+        CFI_DEF_CFA_BREG_PLUS_UCONST_1_2(\reg, \offset, \size)
+    .else
+        .error "Unsupported size, too large"
+    .endif
+.endm
+
+
+// Macro to poison (negate) the reference for heap poisoning.
+.macro POISON_HEAP_REF ref
+#ifdef USE_HEAP_POISONING
+    neg \ref, \ref
+    zext.w \ref, \ref
+#endif  // USE_HEAP_POISONING
+.endm
+
+
+// Macro to unpoison (negate) the reference for heap poisoning.
+.macro UNPOISON_HEAP_REF ref
+#ifdef USE_HEAP_POISONING
+    neg \ref, \ref
+    zext.w \ref, \ref
+#endif  // USE_HEAP_POISONING
+.endm
+
+
 .macro INCREASE_FRAME frame_adjustment
     addi sp, sp, -(\frame_adjustment)
     .cfi_adjust_cfa_offset (\frame_adjustment)
@@ -72,18 +120,35 @@
 .endm
 
 
-.macro SAVE_GPR reg, offset
-    sd \reg, (\offset)(sp)
+.macro SAVE_GPR_BASE base, reg, offset
+    sd \reg, (\offset)(\base)
     .cfi_rel_offset \reg, (\offset)
 .endm
 
 
-.macro RESTORE_GPR reg, offset
-    ld \reg, (\offset)(sp)
+.macro SAVE_GPR reg, offset
+    SAVE_GPR_BASE sp, \reg, \offset
+.endm
+
+
+.macro RESTORE_GPR_BASE base, reg, offset
+    ld \reg, (\offset)(\base)
     .cfi_restore \reg
 .endm
 
 
+.macro RESTORE_GPR reg, offset
+    RESTORE_GPR_BASE sp, \reg, \offset
+.endm
+
+
+.macro RESTORE_GPR_NE skip, reg, offset
+    .ifnc \skip, \reg
+    RESTORE_GPR_BASE sp, \reg, \offset
+    .endif
+.endm
+
+
 .macro SAVE_FPR reg, offset
     fsd \reg, (\offset)(sp)
     .cfi_rel_offset \reg, (\offset)
@@ -126,8 +191,9 @@
     SAVE_FPR fa7, (8*8)
 
     SAVE_GPR fp,  (9*8)  // x8, frame pointer
+    // s1 (x9) is the ART thread register
 
-    // a0 is the method pointer
+    // a0 (x10) is the method pointer
     SAVE_GPR a1,  (10*8)  // x11
     SAVE_GPR a2,  (11*8)  // x12
     SAVE_GPR a3,  (12*8)  // x13
@@ -136,7 +202,6 @@
     SAVE_GPR a6,  (15*8)  // x16
     SAVE_GPR a7,  (16*8)  // x17
 
-    // s1 is the ART thread register
     SAVE_GPR s2,  (17*8)  // x18
     SAVE_GPR s3,  (18*8)  // x19
     SAVE_GPR s4,  (19*8)  // x20
@@ -152,7 +217,7 @@
 .endm
 
 
-.macro RESTORE_SAVE_REFS_AND_ARGS_FRAME_INTERNAL base
+.macro RESTORE_SAVE_REFS_AND_ARGS_FRAME_INTERNAL
     // stack slot (0*8)(sp) is for ArtMethod*
 
     RESTORE_FPR fa0, (1*8)
@@ -200,12 +265,12 @@
 .endm
 
 
-.macro SETUP_CALLEE_SAVE_FRAME_COMMON tmpreg, offset
+.macro SETUP_CALLEE_SAVE_FRAME_COMMON tmpreg, runtime_method_offset
     // art::Runtime* tmpreg = art::Runtime::instance_;
     LOAD_RUNTIME_INSTANCE \tmpreg
 
     // ArtMethod* tmpreg = Runtime::instance_->callee_save_methods_[<callee-save-frame-type>];
-    ld  \tmpreg, \offset(\tmpreg)
+    ld  \tmpreg, \runtime_method_offset(\tmpreg)
 
     SETUP_CALLEE_SAVE_FRAME_COMMON_INTERNAL \tmpreg
 .endm
@@ -254,7 +319,7 @@
 
     // GP callee-saves
     SAVE_GPR s0,  (8*14)  // x8/fp, frame pointer
-    // s1 is the ART thread register
+    // s1 (x9) is the ART thread register
     SAVE_GPR s2,  (8*15)  // x18
     SAVE_GPR s3,  (8*16)  // x19
     SAVE_GPR s4,  (8*17)  // x20
@@ -270,6 +335,45 @@
 .endm
 
 
+.macro RESTORE_ALL_CALLEE_SAVES
+#if (FRAME_SIZE_SAVE_ALL_CALLEE_SAVES != 8*(12 + 11 + 1 + 1 + 1))
+#error "FRAME_SIZE_SAVE_ALL_CALLEE_SAVES(RISCV64) size not as expected."
+#endif
+    // stack slot (8*0)(sp) is for ArtMethod*
+    // stack slot (8*1)(sp) is for padding
+
+    // FP callee-saves.
+    RESTORE_FPR fs0,  (8*2)   // f8
+    RESTORE_FPR fs1,  (8*3)   // f9
+    RESTORE_FPR fs2,  (8*4)   // f18
+    RESTORE_FPR fs3,  (8*5)   // f19
+    RESTORE_FPR fs4,  (8*6)   // f20
+    RESTORE_FPR fs5,  (8*7)   // f21
+    RESTORE_FPR fs6,  (8*8)   // f22
+    RESTORE_FPR fs7,  (8*9)   // f23
+    RESTORE_FPR fs8,  (8*10)  // f24
+    RESTORE_FPR fs9,  (8*11)  // f25
+    RESTORE_FPR fs10, (8*12)  // f26
+    RESTORE_FPR fs11, (8*13)  // f27
+
+    // GP callee-saves
+    RESTORE_GPR s0,  (8*14)  // x8/fp, frame pointer
+    // s1 is the ART thread register
+    RESTORE_GPR s2,  (8*15)  // x18
+    RESTORE_GPR s3,  (8*16)  // x19
+    RESTORE_GPR s4,  (8*17)  // x20
+    RESTORE_GPR s5,  (8*18)  // x21
+    RESTORE_GPR s6,  (8*19)  // x22
+    RESTORE_GPR s7,  (8*20)  // x23
+    RESTORE_GPR s8,  (8*21)  // x24
+    RESTORE_GPR s9,  (8*22)  // x25
+    RESTORE_GPR s10, (8*23)  // x26
+    RESTORE_GPR s11, (8*24)  // x27
+
+    RESTORE_GPR ra,  (8*25)  // x1, return address
+.endm
+
+
 .macro SETUP_SAVE_ALL_CALLEE_SAVES_FRAME
     INCREASE_FRAME FRAME_SIZE_SAVE_ALL_CALLEE_SAVES
     SAVE_ALL_CALLEE_SAVES
@@ -277,12 +381,11 @@
 .endm
 
 
-.macro SETUP_SAVE_EVERYTHING_FRAME
+.macro SETUP_SAVE_EVERYTHING_FRAME_DECREMENTED_SP_SKIP_RA \
+        runtime_method_offset = RUNTIME_SAVE_EVERYTHING_METHOD_OFFSET
 #if (FRAME_SIZE_SAVE_EVERYTHING != 8*(1 + 32 + 27))
-#error "FRAME_SIZE_SAVE_EVERYTHING(ARM64) size not as expected."
+#error "FRAME_SIZE_SAVE_EVERYTHING(RISCV64) size not as expected."
 #endif
-    INCREASE_FRAME FRAME_SIZE_SAVE_EVERYTHING
-
     // stack slot (8*0)(sp) is for ArtMethod*
 
     // 32 slots for FPRs
@@ -297,7 +400,7 @@
     SAVE_FPR fs0,  8*9   // f8
     SAVE_FPR fs1,  8*10  // f9
 #define SAVE_EVERYTHING_FRAME_OFFSET_FA0 (8*11)
-    SAVE_FPR fa0,  8*11  // f10, offset must equal SAVE_EVERYTHING_FRAME_OFFSET_FA0
+    SAVE_FPR fa0,  8*11  // f10, its offset must equal SAVE_EVERYTHING_FRAME_OFFSET_FA0
     SAVE_FPR fa1,  8*12  // f11
     SAVE_FPR fa2,  8*13  // f12
     SAVE_FPR fa3,  8*14  // f13
@@ -326,7 +429,7 @@
     SAVE_GPR t2,  8*35  // x7
     SAVE_GPR s0,  8*36  // x8
 #define SAVE_EVERYTHING_FRAME_OFFSET_A0 (8*37)
-    SAVE_GPR a0,  8*37  // x10, offset must equal SAVE_EVERYTHING_FRAME_OFFSET_A0
+    SAVE_GPR a0,  8*37  // x10, its offset must equal SAVE_EVERYTHING_FRAME_OFFSET_A0
     SAVE_GPR a1,  8*38  // x11
     SAVE_GPR a2,  8*39  // x12
     SAVE_GPR a3,  8*40  // x13
@@ -349,13 +452,23 @@
     SAVE_GPR t5,  8*57  // x30
     SAVE_GPR t6,  8*58  // x31
 
-    SAVE_GPR ra,  8*59  // x1, return address
+    // RA already saved by the user of this macro.
 
-    SETUP_CALLEE_SAVE_FRAME_COMMON t0, RUNTIME_SAVE_EVERYTHING_METHOD_OFFSET
+    SETUP_CALLEE_SAVE_FRAME_COMMON t0, \runtime_method_offset
 .endm
 
 
-.macro RESTORE_SAVE_EVERYTHING_FRAME
+.macro SETUP_SAVE_EVERYTHING_FRAME runtime_method_offset = RUNTIME_SAVE_EVERYTHING_METHOD_OFFSET
+#if (FRAME_SIZE_SAVE_EVERYTHING != 8*(1 + 32 + 27))
+#error "FRAME_SIZE_SAVE_EVERYTHING(RISCV64) size not as expected."
+#endif
+    INCREASE_FRAME FRAME_SIZE_SAVE_EVERYTHING
+    SAVE_GPR ra,  8*59  // x1, return address
+    SETUP_SAVE_EVERYTHING_FRAME_DECREMENTED_SP_SKIP_RA \runtime_method_offset
+.endm
+
+
+.macro RESTORE_SAVE_EVERYTHING_FRAME load_a0 = 1
     // stack slot (8*0)(sp) is for ArtMethod*
 
     // 32 slots for FPRs
@@ -403,7 +516,9 @@
 #if SAVE_EVERYTHING_FRAME_OFFSET_A0 != (8*37)
 #error "unexpected SAVE_EVERYTHING_FRAME_OFFSET_A0"
 #endif
+    .if \load_a0
     RESTORE_GPR a0,  (8*37)  // x10, offset must equal SAVE_EVERYTHING_FRAME_OFFSET_A0
+    .endif
     RESTORE_GPR a1,  (8*38)  // x11
     RESTORE_GPR a2,  (8*39)  // x12
     RESTORE_GPR a3,  (8*40)  // x13
@@ -432,6 +547,169 @@
 .endm
 
 
+// For compatibility with Runtime::CreateCalleeSaveMethod(kSaveRefsOnly).
+.macro SETUP_SAVE_REFS_ONLY_FRAME
+    INCREASE_FRAME FRAME_SIZE_SAVE_REFS_ONLY
+
+    // stack slot (8*0)(sp) is for ArtMethod*
+    // stack slot (8*1)(sp) is for padding
+    SAVE_GPR s0,  (8*2)   // x8
+    SAVE_GPR s2,  (8*3)   // x18
+    SAVE_GPR s3,  (8*4)   // x19
+    SAVE_GPR s4,  (8*5)   // x20
+    SAVE_GPR s5,  (8*6)   // x21
+    SAVE_GPR s6,  (8*7)   // x22
+    SAVE_GPR s7,  (8*8)   // x23
+    SAVE_GPR s8,  (8*9)   // x24
+    SAVE_GPR s9,  (8*10)  // x25
+    SAVE_GPR s10, (8*11)  // x26
+    SAVE_GPR s11, (8*12)  // x27
+    SAVE_GPR ra,  (8*13)  // x1
+
+    SETUP_CALLEE_SAVE_FRAME_COMMON t0, RUNTIME_SAVE_REFS_ONLY_METHOD_OFFSET
+.endm
+
+
+.macro RESTORE_SAVE_REFS_ONLY_FRAME
+    // stack slot (8*0)(sp) is for ArtMethod*
+    // stack slot (8*1)(sp) is for padding
+    RESTORE_GPR s0,  (8*2)   // x8
+    RESTORE_GPR s2,  (8*3)   // x18
+    RESTORE_GPR s3,  (8*4)   // x19
+    RESTORE_GPR s4,  (8*5)   // x20
+    RESTORE_GPR s5,  (8*6)   // x21
+    RESTORE_GPR s6,  (8*7)   // x22
+    RESTORE_GPR s7,  (8*8)   // x23
+    RESTORE_GPR s8,  (8*9)   // x24
+    RESTORE_GPR s9,  (8*10)  // x25
+    RESTORE_GPR s10, (8*11)  // x26
+    RESTORE_GPR s11, (8*12)  // x27
+    RESTORE_GPR ra,  (8*13)  // x1
+
+    DECREASE_FRAME FRAME_SIZE_SAVE_REFS_ONLY
+.endm
+
+
+// CFI note. This macro is used where the CFA rule is a dwarf expression, so adjustment of SP does
+// not affect CFA computation. We also elide CFI descriptors for the argument registers, because
+// they can be recovered from the stack in a debugging scenario.
+.macro SPILL_ALL_ARGUMENTS
+#if (FRAME_SIZE_SAVE_ARGS_ONLY != 128)
+#error "FRAME_SIZE_SAVE_ARGS_ONLY(riscv64) not as expected."
+#endif
+    addi sp, sp, -FRAME_SIZE_SAVE_ARGS_ONLY
+    sd a0,   (8*0)(sp)
+    sd a1,   (8*1)(sp)
+    sd a2,   (8*2)(sp)
+    sd a3,   (8*3)(sp)
+    sd a4,   (8*4)(sp)
+    sd a5,   (8*5)(sp)
+    sd a6,   (8*6)(sp)
+    sd a7,   (8*7)(sp)
+    fsd fa0, (8*8)(sp)
+    fsd fa1, (8*9)(sp)
+    fsd fa2, (8*10)(sp)
+    fsd fa3, (8*11)(sp)
+    fsd fa4, (8*12)(sp)
+    fsd fa5, (8*13)(sp)
+    fsd fa6, (8*14)(sp)
+    fsd fa7, (8*15)(sp)
+.endm
+
+
+.macro RESTORE_ALL_ARGUMENTS
+    ld a0,   (8*0)(sp)
+    ld a1,   (8*1)(sp)
+    ld a2,   (8*2)(sp)
+    ld a3,   (8*3)(sp)
+    ld a4,   (8*4)(sp)
+    ld a5,   (8*5)(sp)
+    ld a6,   (8*6)(sp)
+    ld a7,   (8*7)(sp)
+    fld fa0, (8*8)(sp)
+    fld fa1, (8*9)(sp)
+    fld fa2, (8*10)(sp)
+    fld fa3, (8*11)(sp)
+    fld fa4, (8*12)(sp)
+    fld fa5, (8*13)(sp)
+    fld fa6, (8*14)(sp)
+    fld fa7, (8*15)(sp)
+    addi sp, sp, FRAME_SIZE_SAVE_ARGS_ONLY
+.endm
+
+
+.macro SETUP_NTERP_SAVE_CALLEE_SAVES
+#if (NTERP_SIZE_SAVE_CALLEE_SAVES != 8*(12 + 1 + 10 + 1))
+#error "NTERP_SIZE_SAVE_CALLEE_SAVES(RISCV64) size not as expected."
+#endif
+    // FP callee-saves.
+    SAVE_FPR fs0,  (8*0)   // f8
+    SAVE_FPR fs1,  (8*1)   // f9
+    SAVE_FPR fs2,  (8*2)   // f18
+    SAVE_FPR fs3,  (8*3)   // f19
+    SAVE_FPR fs4,  (8*4)   // f20
+    SAVE_FPR fs5,  (8*5)   // f21
+    SAVE_FPR fs6,  (8*6)   // f22
+    SAVE_FPR fs7,  (8*7)   // f23
+    SAVE_FPR fs8,  (8*8)   // f24
+    SAVE_FPR fs9,  (8*9)   // f25
+    SAVE_FPR fs10, (8*10)  // f26
+    SAVE_FPR fs11, (8*11)  // f27
+
+    // GP callee-saves
+    SAVE_GPR s0,  (8*12)  // x8/fp, frame pointer
+    // s1 (x9) is the ART thread register
+    SAVE_GPR s2,  (8*13)  // x18
+    SAVE_GPR s3,  (8*14)  // x19
+    SAVE_GPR s4,  (8*15)  // x20
+    SAVE_GPR s5,  (8*16)  // x21
+    SAVE_GPR s6,  (8*17)  // x22
+    SAVE_GPR s7,  (8*18)  // x23
+    SAVE_GPR s8,  (8*19)  // x24
+    SAVE_GPR s9,  (8*20)  // x25
+    SAVE_GPR s10, (8*21)  // x26
+    SAVE_GPR s11, (8*22)  // x27
+
+    SAVE_GPR ra,  (8*23)  // x1, return address
+.endm
+
+
+.macro RESTORE_NTERP_SAVE_CALLEE_SAVES
+#if (NTERP_SIZE_SAVE_CALLEE_SAVES != 8*(12 + 1 + 10 + 1))
+#error "NTERP_SIZE_SAVE_CALLEE_SAVES(RISCV64) size not as expected."
+#endif
+    // FP callee-saves.
+    RESTORE_FPR fs0,  (8*0)   // f8
+    RESTORE_FPR fs1,  (8*1)   // f9
+    RESTORE_FPR fs2,  (8*2)   // f18
+    RESTORE_FPR fs3,  (8*3)   // f19
+    RESTORE_FPR fs4,  (8*4)   // f20
+    RESTORE_FPR fs5,  (8*5)   // f21
+    RESTORE_FPR fs6,  (8*6)   // f22
+    RESTORE_FPR fs7,  (8*7)   // f23
+    RESTORE_FPR fs8,  (8*8)   // f24
+    RESTORE_FPR fs9,  (8*9)   // f25
+    RESTORE_FPR fs10, (8*10)  // f26
+    RESTORE_FPR fs11, (8*11)  // f27
+
+    // GP callee-saves
+    RESTORE_GPR s0,  (8*12)  // x8/fp, frame pointer
+    // s1 is the ART thread register
+    RESTORE_GPR s2,  (8*13)  // x18
+    RESTORE_GPR s3,  (8*14)  // x19
+    RESTORE_GPR s4,  (8*15)  // x20
+    RESTORE_GPR s5,  (8*16)  // x21
+    RESTORE_GPR s6,  (8*17)  // x22
+    RESTORE_GPR s7,  (8*18)  // x23
+    RESTORE_GPR s8,  (8*19)  // x24
+    RESTORE_GPR s9,  (8*20)  // x25
+    RESTORE_GPR s10, (8*21)  // x26
+    RESTORE_GPR s11, (8*22)  // x27
+
+    RESTORE_GPR ra,  (8*23)  // x1, return address
+.endm
+
+
 // Macro that calls through to artDeliverPendingExceptionFromCode, where the pending exception is
 // Thread::Current()->exception_ when the runtime method frame is ready.
 .macro DELIVER_PENDING_EXCEPTION_FRAME_READY
@@ -457,4 +735,104 @@
     DELIVER_PENDING_EXCEPTION
 .endm
 
+// Macro to emit a single LUI to load the given value while checking that the low 12 bits are zero.
+.macro LUI_VALUE reg, value
+    .if (\value & 0xfff) != 0
+    .error "Cannot use LUI to materialize a value with some of the low 12 bits set."
+    .endif
+    lui \reg, (\value) >> 12
+.endm
+
+
+// Locking is needed for both managed code and JNI stubs.
+.macro LOCK_OBJECT_FAST_PATH obj, slow_lock, can_be_null
+    // Use scratch registers T1-T6 as temporaries.
+    // Note: T0 is used as the argument register for `art_jni_lock_object` and passed as `obj`.
+    lw      t2, THREAD_ID_OFFSET(xSELF)
+    .if \can_be_null
+        beqz    \obj, \slow_lock
+    .endif
+    addi    t1, \obj, MIRROR_OBJECT_LOCK_WORD_OFFSET  // Exclusive load/store has no offset.
+1:
+    // Note: The LR/SC sequence must be at most 16 instructions, so we cannot have the
+    // recursive locking in a slow-path as on other architectures.
+    lr.w.aq t3, (t1)                  // Acquire needed only in most common case.
+    LUI_VALUE t5, LOCK_WORD_GC_STATE_MASK_SHIFTED  // Prepare mask for testing non-gc bits.
+    xor     t4, t3, t2                // Prepare the value to store if unlocked
+                                      //   (thread id, count of 0 and preserved read barrier bits),
+                                      // or prepare to compare thread id for recursive lock check
+                                      //   (lock_word.ThreadId() ^ self->ThreadId()).
+    or      t6, t5, t3                // Test the non-gc bits.
+    beq     t6, t5, 2f                // Check if unlocked.
+                                      // Check lock word state and thread id together,
+    LUI_VALUE \
+        t5, 0xffffffff ^ (LOCK_WORD_STATE_MASK_SHIFTED | LOCK_WORD_THIN_LOCK_OWNER_MASK_SHIFTED)
+    or      t6, t5, t4
+    bne     t6, t5, \slow_lock
+    LUI_VALUE t4, LOCK_WORD_THIN_LOCK_COUNT_ONE  // Increment the recursive lock count.
+    addw    t4, t3, t4
+    LUI_VALUE t5, LOCK_WORD_THIN_LOCK_COUNT_MASK_SHIFTED  // Test the new thin lock count.
+    and     t5, t4, t5
+    beqz    t5, \slow_lock            // Zero as the new count indicates overflow, go slow path.
+2:
+    // Store the prepared value:
+    //   - if unlocked, original lock word plus thread id,
+    //   - if already locked, original lock word plus incremented lock count.
+    sc.w    t3, t4, (t1)
+    bnez    t3, 1b                    // If the store failed, retry.
+    ret
+.endm
+
+// Unlocking is needed for both managed code and JNI stubs.
+.macro UNLOCK_OBJECT_FAST_PATH obj, slow_unlock, can_be_null
+    // Use scratch registers T1-T6 as temporaries.
+    // Note: T0 is used as the argument register for `art_jni_unlock_object` and passed as `obj`.
+    lw      t2, THREAD_ID_OFFSET(xSELF)
+    .if \can_be_null
+        beqz    \obj, \slow_unlock
+    .endif
+    addi    t1, \obj, MIRROR_OBJECT_LOCK_WORD_OFFSET  // Exclusive load/store has no offset.
+1:
+    // Note: Without read barriers, we could do plain LW here but there is no store-release
+    // other than SC on riscv64, so we do this with LR/SC for all cofigurations.
+    // Note: The LR/SC sequence must be at most 16 instructions, so we cannot have the
+    // recursive unlocking in a slow-path as on other architectures.
+    lr.w    t3, (t1)
+    LUI_VALUE t5, LOCK_WORD_GC_STATE_MASK_SHIFTED  // Prepare mask for testing non-gc bits.
+    xor     t4, t3, t2                // Prepare the value to store if simply locked
+                                      //   (mostly 0s, and preserved read barrier bits),
+                                      // or prepare to compare thread id for recursive lock check
+                                      //   (lock_word.ThreadId() ^ self->ThreadId()).
+    or      t6, t5, t4                // Test the non-gc bits.
+    beq     t6, t5, 2f                // Simply locked by this thread?
+                                      // Check lock word state and thread id together.
+    LUI_VALUE \
+        t5, 0xffffffff ^ (LOCK_WORD_STATE_MASK_SHIFTED | LOCK_WORD_THIN_LOCK_OWNER_MASK_SHIFTED)
+    or      t6, t5, t4
+    bne     t6, t5, \slow_unlock
+    LUI_VALUE t4, LOCK_WORD_THIN_LOCK_COUNT_ONE  // Decrement the recursive lock count.
+    subw    t4, t3, t4
+2:
+    // Store the prepared value:
+    //   - if simply locked, original lock word with removed thread id,
+    //   - if recursively locked, original lock word plus decremented lock count.
+    sc.w.rl t3, t4, (t1)              // Need to use atomic instructions for read barrier.
+    bnez    t3, 1b                    // If the store failed, retry.
+    ret
+.endm
+
+
+// Macros to branch based on the value of a specific bit.
+.macro BRANCH_IF_BIT_CLEAR tmp, reg, bit, dest
+    slli    \tmp, \reg, (63 - \bit) // tested bit => sign bit
+    bgez    \tmp, \dest
+.endm
+
+
+.macro BRANCH_IF_BIT_SET tmp, reg, bit, dest
+    slli    \tmp, \reg, (63 - \bit) // tested bit => sign bit
+    bltz    \tmp, \dest
+.endm
+
+
 #endif  // ART_RUNTIME_ARCH_RISCV64_ASM_SUPPORT_RISCV64_S_
diff --git a/runtime/arch/riscv64/asm_support_riscv64.h b/runtime/arch/riscv64/asm_support_riscv64.h
index d4c90f6..6d6ae62 100644
--- a/runtime/arch/riscv64/asm_support_riscv64.h
+++ b/runtime/arch/riscv64/asm_support_riscv64.h
@@ -20,13 +20,33 @@
 #include "asm_support.h"
 #include "entrypoints/entrypoint_asm_constants.h"
 
-// FS0 - FS11, S0, S2 - S11, RA, ArtMethod* and padding, total 8*(12 + 11 + 1 + 1 + 1) = 208
+// Each frame size constant must be a whole multiple of 16 to ensure 16-byte alignment on the stack.
+
+// clang-format off
+// S0, S2 - S11, RA, ArtMethod*, and padding,
+//            total 8*(11 + 1 + 1 + 1) = 112
+#define FRAME_SIZE_SAVE_REFS_ONLY        112
+
+// A0 - A7, FA0 - FA7, total 8*(8 + 8) = 128
+#define FRAME_SIZE_SAVE_ARGS_ONLY        128
+
+// FS0 - FS11, S0, S2 - S11, RA, ArtMethod* and padding,
+//       total 8*(12 + 11 + 1 + 1 + 1) = 208
 #define FRAME_SIZE_SAVE_ALL_CALLEE_SAVES 208
-// FA0 - FA7, A1 - A7, S0, S2 - S11, RA and ArtMethod*, total 8*(8 + 7 + 11 + 1 + 1) = 224
+
+// FA0 - FA7, A1 - A7, S0, S2 - S11, RA and ArtMethod*,
+//        total 8*(8 + 7 + 11 + 1 + 1) = 224
 // Excluded GPRs are: A0 (ArtMethod*), S1/TR (ART thread register).
 #define FRAME_SIZE_SAVE_REFS_AND_ARGS    224
-// All 32 FPRs, 27 GPRs and ArtMethod*, total 8*(32 + 27 + 1) = 480
+
+// All 32 FPRs, 27 GPRs and ArtMethod*,
+//               total 8*(32 + 27 + 1) = 480
 // Excluded GPRs are: SP, Zero, TP, GP, S1/TR (ART thread register).
 #define FRAME_SIZE_SAVE_EVERYTHING       480
 
+// FS0 - FS11, S0, S2 - S11, RA,
+//           total 8*(12 + 1 + 10 + 1) = 192
+#define NTERP_SIZE_SAVE_CALLEE_SAVES     192
+// clang-format on
+
 #endif  // ART_RUNTIME_ARCH_RISCV64_ASM_SUPPORT_RISCV64_H_
diff --git a/runtime/arch/riscv64/callee_save_frame_riscv64.h b/runtime/arch/riscv64/callee_save_frame_riscv64.h
index a1c081c..6a2a167 100644
--- a/runtime/arch/riscv64/callee_save_frame_riscv64.h
+++ b/runtime/arch/riscv64/callee_save_frame_riscv64.h
@@ -21,11 +21,12 @@
 #include "base/bit_utils.h"
 #include "base/callee_save_type.h"
 #include "base/enums.h"
+#include "base/macros.h"
 #include "quick/quick_method_frame_info.h"
 #include "registers_riscv64.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace riscv64 {
 
 static constexpr uint32_t kRiscv64CalleeSaveAlwaysSpills =
diff --git a/runtime/arch/riscv64/context_riscv64.cc b/runtime/arch/riscv64/context_riscv64.cc
index 84bd963..c9bfa16 100644
--- a/runtime/arch/riscv64/context_riscv64.cc
+++ b/runtime/arch/riscv64/context_riscv64.cc
@@ -23,13 +23,9 @@
 #include "quick/quick_method_frame_info.h"
 #include "thread-current-inl.h"
 
-#if __has_feature(hwaddress_sanitizer)
-#include <sanitizer/hwasan_interface.h>
-#else
-#define __hwasan_handle_longjmp(sp)
-#endif
+extern "C" __attribute__((weak)) void __hwasan_handle_longjmp(const void* sp_dst);
 
-namespace art {
+namespace art HIDDEN {
 namespace riscv64 {
 
 static constexpr uint64_t gZero = 0;
@@ -48,7 +44,7 @@
 
 void Riscv64Context::FillCalleeSaves(uint8_t* frame, const QuickMethodFrameInfo& frame_info) {
   // RA is at top of the frame
-  DCHECK_NE(frame_info.CoreSpillMask() & ~(1u << RA), 0u);
+  DCHECK_NE(frame_info.CoreSpillMask() & (1u << RA), 0u);
   gprs_[RA] = CalleeSaveAddress(frame, 0, frame_info.FrameSizeInBytes());
 
   // Core registers come first, from the highest down to the lowest, with the exception of RA/X1.
@@ -144,7 +140,9 @@
   gprs[TR] = reinterpret_cast<uintptr_t>(Thread::Current());
 
   // Tell HWASan about the new stack top.
-  __hwasan_handle_longjmp(reinterpret_cast<void*>(gprs[SP]));
+  if (__hwasan_handle_longjmp != nullptr) {
+    __hwasan_handle_longjmp(reinterpret_cast<void*>(gprs[SP]));
+  }
   art_quick_do_long_jump(gprs, fprs);
 }
 
diff --git a/runtime/arch/riscv64/context_riscv64.h b/runtime/arch/riscv64/context_riscv64.h
index 437d6d9..839317d 100644
--- a/runtime/arch/riscv64/context_riscv64.h
+++ b/runtime/arch/riscv64/context_riscv64.h
@@ -25,7 +25,7 @@
 #include "base/macros.h"
 #include "registers_riscv64.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace riscv64 {
 
 class Riscv64Context final : public Context {
@@ -42,9 +42,7 @@
 
   void SetPC(uintptr_t new_pc) override { SetGPR(kPC, new_pc); }
 
-  void SetNterpDexPC(uintptr_t /*dex_pc_ptr*/) override {
-    UNREACHABLE();  // Nterp is not supported on RISC-V  yet
-  }
+  void SetNterpDexPC(uintptr_t dex_pc_ptr) override { SetGPR(S3, dex_pc_ptr); }
 
   void SetArg0(uintptr_t new_arg0_value) override { SetGPR(A0, new_arg0_value); }
 
diff --git a/runtime/arch/riscv64/entrypoints_init_riscv64.cc b/runtime/arch/riscv64/entrypoints_init_riscv64.cc
index 811624c..d75a873 100644
--- a/runtime/arch/riscv64/entrypoints_init_riscv64.cc
+++ b/runtime/arch/riscv64/entrypoints_init_riscv64.cc
@@ -14,20 +14,142 @@
  * limitations under the License.
  */
 
+#include  <math.h>
+
 #include "entrypoints/quick/quick_default_init_entrypoints.h"
 #include "entrypoints/quick/quick_entrypoints.h"
 
-namespace art {
+namespace art HIDDEN {
 
-void UpdateReadBarrierEntrypoints(QuickEntryPoints* /*qpoints*/, bool /*is_active*/) {
-  // TODO(riscv64): add read barrier entrypoints
+// Cast entrypoints.
+extern "C" size_t artInstanceOfFromCode(mirror::Object* obj, mirror::Class* ref_class);
+
+// Read barrier entrypoints.
+// art_quick_read_barrier_mark_regX uses an non-standard calling convention: it
+// expects its input in register X and returns its result in that same register,
+// and saves and restores all other registers.
+// No read barrier for X0 (Zero), X1 (RA), X2 (SP), X3 (GP) and X4 (TP).
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg05(mirror::Object*);  // t0/x5
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg06(mirror::Object*);  // t1/x6
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg07(mirror::Object*);  // t2/x7
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg08(mirror::Object*);  // t3/x8
+// No read barrier for X9 (S1/xSELF).
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg10(mirror::Object*);  // a0/x10
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg11(mirror::Object*);  // a1/x11
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg12(mirror::Object*);  // a2/x12
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg13(mirror::Object*);  // a3/x13
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg14(mirror::Object*);  // a4/x14
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg15(mirror::Object*);  // a5/x15
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg16(mirror::Object*);  // a6/x16
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg17(mirror::Object*);  // a7/x17
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg18(mirror::Object*);  // s2/x18
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg19(mirror::Object*);  // s3/x19
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg20(mirror::Object*);  // s4/x20
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg21(mirror::Object*);  // s5/x21
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg22(mirror::Object*);  // s6/x22
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg23(mirror::Object*);  // s7/x23
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg24(mirror::Object*);  // s8/x24
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg25(mirror::Object*);  // s9/x25
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg26(mirror::Object*);  // s10/x26
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg27(mirror::Object*);  // s11/x27
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg28(mirror::Object*);  // t3/x28
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg29(mirror::Object*);  // t4/x29
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg30(mirror::Object*);  // t5/x30
+extern "C" mirror::Object* art_quick_read_barrier_mark_reg31(mirror::Object*);  // t6/x31
+
+void UpdateReadBarrierEntrypoints(QuickEntryPoints* qpoints, bool is_active) {
+  // No read barrier for X0 (Zero), X1 (RA), X2 (SP), X3 (GP) and X4 (TP).
+  qpoints->SetReadBarrierMarkReg05(is_active ? art_quick_read_barrier_mark_reg05 : nullptr);
+  qpoints->SetReadBarrierMarkReg06(is_active ? art_quick_read_barrier_mark_reg06 : nullptr);
+  qpoints->SetReadBarrierMarkReg07(is_active ? art_quick_read_barrier_mark_reg07 : nullptr);
+  qpoints->SetReadBarrierMarkReg08(is_active ? art_quick_read_barrier_mark_reg08 : nullptr);
+  // No read barrier for X9 (S1/xSELF).
+  qpoints->SetReadBarrierMarkReg10(is_active ? art_quick_read_barrier_mark_reg10 : nullptr);
+  qpoints->SetReadBarrierMarkReg11(is_active ? art_quick_read_barrier_mark_reg11 : nullptr);
+  qpoints->SetReadBarrierMarkReg12(is_active ? art_quick_read_barrier_mark_reg12 : nullptr);
+  qpoints->SetReadBarrierMarkReg13(is_active ? art_quick_read_barrier_mark_reg13 : nullptr);
+  qpoints->SetReadBarrierMarkReg14(is_active ? art_quick_read_barrier_mark_reg14 : nullptr);
+  qpoints->SetReadBarrierMarkReg15(is_active ? art_quick_read_barrier_mark_reg15 : nullptr);
+  qpoints->SetReadBarrierMarkReg16(is_active ? art_quick_read_barrier_mark_reg16 : nullptr);
+  qpoints->SetReadBarrierMarkReg17(is_active ? art_quick_read_barrier_mark_reg17 : nullptr);
+  qpoints->SetReadBarrierMarkReg18(is_active ? art_quick_read_barrier_mark_reg18 : nullptr);
+  qpoints->SetReadBarrierMarkReg19(is_active ? art_quick_read_barrier_mark_reg19 : nullptr);
+  qpoints->SetReadBarrierMarkReg20(is_active ? art_quick_read_barrier_mark_reg20 : nullptr);
+  qpoints->SetReadBarrierMarkReg21(is_active ? art_quick_read_barrier_mark_reg21 : nullptr);
+  qpoints->SetReadBarrierMarkReg22(is_active ? art_quick_read_barrier_mark_reg22 : nullptr);
+  qpoints->SetReadBarrierMarkReg23(is_active ? art_quick_read_barrier_mark_reg23 : nullptr);
+  qpoints->SetReadBarrierMarkReg24(is_active ? art_quick_read_barrier_mark_reg24 : nullptr);
+  qpoints->SetReadBarrierMarkReg25(is_active ? art_quick_read_barrier_mark_reg25 : nullptr);
+  qpoints->SetReadBarrierMarkReg26(is_active ? art_quick_read_barrier_mark_reg26 : nullptr);
+  qpoints->SetReadBarrierMarkReg27(is_active ? art_quick_read_barrier_mark_reg27 : nullptr);
+  qpoints->SetReadBarrierMarkReg28(is_active ? art_quick_read_barrier_mark_reg28 : nullptr);
+  qpoints->SetReadBarrierMarkReg29(is_active ? art_quick_read_barrier_mark_reg29 : nullptr);
+  // Note: Entrypoints for registers X30 (T5) and T31 (T6) are stored in entries
+  // for X0 (Zero) and X1 (RA) because these are not valid registers for marking
+  // and we currently have slots only up to register 29.
+  qpoints->SetReadBarrierMarkReg00(is_active ? art_quick_read_barrier_mark_reg30 : nullptr);
+  qpoints->SetReadBarrierMarkReg01(is_active ? art_quick_read_barrier_mark_reg31 : nullptr);
 }
 
 void InitEntryPoints(JniEntryPoints* jpoints,
                      QuickEntryPoints* qpoints,
                      bool monitor_jni_entry_exit) {
   DefaultInitEntryPoints(jpoints, qpoints, monitor_jni_entry_exit);
-  // TODO(riscv64): add other entrypoints
+
+  // Cast
+  qpoints->SetInstanceofNonTrivial(artInstanceOfFromCode);
+  qpoints->SetCheckInstanceOf(art_quick_check_instance_of);
+
+  // Math
+  // TODO(riscv64): null entrypoints not needed for riscv64 - using generated code.
+  qpoints->SetCmpgDouble(nullptr);
+  qpoints->SetCmpgFloat(nullptr);
+  qpoints->SetCmplDouble(nullptr);
+  qpoints->SetCmplFloat(nullptr);
+  qpoints->SetFmod(fmod);
+  qpoints->SetL2d(nullptr);
+  qpoints->SetFmodf(fmodf);
+  qpoints->SetL2f(nullptr);
+  qpoints->SetD2iz(nullptr);
+  qpoints->SetF2iz(nullptr);
+  qpoints->SetIdivmod(nullptr);
+  qpoints->SetD2l(nullptr);
+  qpoints->SetF2l(nullptr);
+  qpoints->SetLdiv(nullptr);
+  qpoints->SetLmod(nullptr);
+  qpoints->SetLmul(nullptr);
+  qpoints->SetShlLong(nullptr);
+  qpoints->SetShrLong(nullptr);
+  qpoints->SetUshrLong(nullptr);
+
+  // More math.
+  qpoints->SetCos(cos);
+  qpoints->SetSin(sin);
+  qpoints->SetAcos(acos);
+  qpoints->SetAsin(asin);
+  qpoints->SetAtan(atan);
+  qpoints->SetAtan2(atan2);
+  qpoints->SetPow(pow);
+  qpoints->SetCbrt(cbrt);
+  qpoints->SetCosh(cosh);
+  qpoints->SetExp(exp);
+  qpoints->SetExpm1(expm1);
+  qpoints->SetHypot(hypot);
+  qpoints->SetLog(log);
+  qpoints->SetLog10(log10);
+  qpoints->SetNextAfter(nextafter);
+  qpoints->SetSinh(sinh);
+  qpoints->SetTan(tan);
+  qpoints->SetTanh(tanh);
+
+  // Intrinsics
+  qpoints->SetIndexOf(art_quick_indexof);
+  // TODO(riscv64): More intrinsics.
+
+  // Read barrier.
+  UpdateReadBarrierEntrypoints(qpoints, /*is_active=*/ false);
+  qpoints->SetReadBarrierSlow(artReadBarrierSlow);
+  qpoints->SetReadBarrierForRootSlow(artReadBarrierForRootSlow);
 }
 
 }  // namespace art
diff --git a/runtime/arch/riscv64/fault_handler_riscv64.cc b/runtime/arch/riscv64/fault_handler_riscv64.cc
index 581f8b7..01f09e8 100644
--- a/runtime/arch/riscv64/fault_handler_riscv64.cc
+++ b/runtime/arch/riscv64/fault_handler_riscv64.cc
@@ -18,6 +18,7 @@
 
 #include <sys/ucontext.h>
 
+#include "arch/instruction_set.h"
 #include "base/logging.h"  // For VLOG.
 
 extern "C" void art_quick_throw_stack_overflow();
@@ -26,7 +27,7 @@
 
 // RISCV64 specific fault handler functions (or stubs if unimplemented yet).
 
-namespace art {
+namespace art HIDDEN {
 
 uintptr_t FaultManager::GetFaultPc(siginfo_t*, void* context) {
   ucontext_t* uc = reinterpret_cast<ucontext_t*>(context);
@@ -44,9 +45,43 @@
   return mc->__gregs[REG_SP];
 }
 
-bool NullPointerHandler::Action(int, siginfo_t*, void*) {
-  LOG(FATAL) << "NullPointerHandler::Action is not implemented for RISC-V";
-  return false;
+bool NullPointerHandler::Action([[maybe_unused]] int sig, siginfo_t* info, void* context) {
+  uintptr_t fault_address = reinterpret_cast<uintptr_t>(info->si_addr);
+  if (!IsValidFaultAddress(fault_address)) {
+    return false;
+  }
+
+  ucontext_t* uc = reinterpret_cast<ucontext_t*>(context);
+  mcontext_t* mc = reinterpret_cast<mcontext_t*>(&uc->uc_mcontext);
+  ArtMethod** sp = reinterpret_cast<ArtMethod**>(mc->__gregs[REG_SP]);
+  if (!IsValidMethod(*sp)) {
+    return false;
+  }
+
+  // For null checks in compiled code we insert a stack map that is immediately
+  // after the load/store instruction that might cause the fault and we need to
+  // pass the return PC to the handler. For null checks in Nterp, we similarly
+  // need the return PC to recognize that this was a null check in Nterp, so
+  // that the handler can get the needed data from the Nterp frame.
+
+  // Need to work out the size of the instruction that caused the exception.
+  uintptr_t old_pc = mc->__gregs[REG_PC];
+  uintptr_t instr_size = (reinterpret_cast<uint16_t*>(old_pc)[0] & 3u) == 3u ? 4u : 2u;
+  uintptr_t return_pc = old_pc + instr_size;
+  if (!IsValidReturnPc(sp, return_pc)) {
+    return false;
+  }
+
+  // Push the return PC to the stack and pass the fault address in RA.
+  mc->__gregs[REG_SP] -= sizeof(uintptr_t);
+  *reinterpret_cast<uintptr_t*>(mc->__gregs[REG_SP]) = return_pc;
+  mc->__gregs[REG_RA] = fault_address;
+
+  // Arrange for the signal handler to return to the NPE entrypoint.
+  mc->__gregs[REG_PC] =
+      reinterpret_cast<uintptr_t>(art_quick_throw_null_pointer_exception_from_signal);
+  VLOG(signals) << "Generating null pointer exception";
+  return true;
 }
 
 bool SuspensionHandler::Action(int, siginfo_t*, void*) {
@@ -54,9 +89,40 @@
   return false;
 }
 
-bool StackOverflowHandler::Action(int, siginfo_t*, void*) {
-  LOG(FATAL) << "StackOverflowHandler::Action is not implemented for RISC-V";
-  return false;
+bool StackOverflowHandler::Action([[maybe_unused]] int sig,
+                                  siginfo_t* info,
+                                  void* context) {
+  ucontext_t* uc = reinterpret_cast<ucontext_t*>(context);
+  mcontext_t* mc = reinterpret_cast<mcontext_t*>(&uc->uc_mcontext);
+  VLOG(signals) << "stack overflow handler with sp at " << std::hex << &uc;
+  VLOG(signals) << "sigcontext: " << std::hex << mc;
+
+  uintptr_t sp = mc->__gregs[REG_SP];
+  VLOG(signals) << "sp: " << std::hex << sp;
+
+  uintptr_t fault_addr = reinterpret_cast<uintptr_t>(info->si_addr);
+  VLOG(signals) << "fault_addr: " << std::hex << fault_addr;
+  VLOG(signals) << "checking for stack overflow, sp: " << std::hex << sp <<
+      ", fault_addr: " << fault_addr;
+
+  uintptr_t overflow_addr = sp - GetStackOverflowReservedBytes(InstructionSet::kRiscv64);
+
+  // Check that the fault address is the value expected for a stack overflow.
+  if (fault_addr != overflow_addr) {
+    VLOG(signals) << "Not a stack overflow";
+    return false;
+  }
+
+  VLOG(signals) << "Stack overflow found";
+
+  // Now arrange for the signal handler to return to art_quick_throw_stack_overflow.
+  // The value of RA must be the same as it was when we entered the code that
+  // caused this fault.  This will be inserted into a callee save frame by
+  // the function to which this handler returns (art_quick_throw_stack_overflow).
+  mc->__gregs[REG_PC] = reinterpret_cast<uintptr_t>(art_quick_throw_stack_overflow);
+
+  // The kernel will now return to the address in `mc->__gregs[REG_PC]`.
+  return true;
 }
 
 }  // namespace art
diff --git a/runtime/arch/riscv64/instruction_set_features_riscv64.cc b/runtime/arch/riscv64/instruction_set_features_riscv64.cc
index 2ef4f84..e7e9cee 100644
--- a/runtime/arch/riscv64/instruction_set_features_riscv64.cc
+++ b/runtime/arch/riscv64/instruction_set_features_riscv64.cc
@@ -19,18 +19,26 @@
 #include <fstream>
 #include <sstream>
 
+#include "android-base/stringprintf.h"
 #include "android-base/strings.h"
 #include "base/logging.h"
 
-namespace art {
+namespace art HIDDEN {
 
-// Basic feature set is rv64gc, aka rv64imafdc.
+using android::base::StringPrintf;
+
+// Basic feature set is rv64gcv_zba_zbb_zbs, aka rv64imafdcv_zba_zbb_zbs.
 constexpr uint32_t BasicFeatures() {
-  return Riscv64InstructionSetFeatures::kExtGeneric | Riscv64InstructionSetFeatures::kExtCompressed;
+  return Riscv64InstructionSetFeatures::kExtGeneric |
+         Riscv64InstructionSetFeatures::kExtCompressed |
+         Riscv64InstructionSetFeatures::kExtVector |
+         Riscv64InstructionSetFeatures::kExtZba |
+         Riscv64InstructionSetFeatures::kExtZbb |
+         Riscv64InstructionSetFeatures::kExtZbs;
 }
 
 Riscv64FeaturesUniquePtr Riscv64InstructionSetFeatures::FromVariant(
-    const std::string& variant, std::string* error_msg ATTRIBUTE_UNUSED) {
+    const std::string& variant, [[maybe_unused]] std::string* error_msg) {
   if (variant != "generic") {
     LOG(WARNING) << "Unexpected CPU variant for Riscv64 using defaults: " << variant;
   }
@@ -42,7 +50,24 @@
 }
 
 Riscv64FeaturesUniquePtr Riscv64InstructionSetFeatures::FromCppDefines() {
-  return Riscv64FeaturesUniquePtr(new Riscv64InstructionSetFeatures(BasicFeatures()));
+  // Assume kExtGeneric is always present.
+  uint32_t bits = kExtGeneric;
+#ifdef __riscv_c
+  bits |= kExtCompressed;
+#endif
+#ifdef __riscv_v
+  bits |= kExtVector;
+#endif
+#ifdef __riscv_zba
+  bits |= kExtZba;
+#endif
+#ifdef __riscv_zbb
+  bits |= kExtZbb;
+#endif
+#ifdef __riscv_zbs
+  bits |= kExtZbs;
+#endif
+  return FromBitmap(bits);
 }
 
 Riscv64FeaturesUniquePtr Riscv64InstructionSetFeatures::FromCpuInfo() {
@@ -74,26 +99,47 @@
 
 uint32_t Riscv64InstructionSetFeatures::AsBitmap() const { return bits_; }
 
+static const std::pair<uint32_t, std::string> kExtensionList[] = {
+    {Riscv64InstructionSetFeatures::kExtGeneric, "rv64g"},
+    {Riscv64InstructionSetFeatures::kExtCompressed, "c"},
+    {Riscv64InstructionSetFeatures::kExtVector, "v"},
+    {Riscv64InstructionSetFeatures::kExtZba, "_zba"},
+    {Riscv64InstructionSetFeatures::kExtZbb, "_zbb"},
+    {Riscv64InstructionSetFeatures::kExtZbs, "_zbs"},
+};
+
 std::string Riscv64InstructionSetFeatures::GetFeatureString() const {
-  std::string result = "rv64";
-  if (bits_ & kExtGeneric) {
-    result += "g";
-  }
-  if (bits_ & kExtCompressed) {
-    result += "c";
-  }
-  if (bits_ & kExtVector) {
-    result += "v";
+  std::string result = "";
+  for (auto&& [ext_bit, ext_string] : kExtensionList) {
+    if (bits_ & ext_bit) {
+      result += ext_string;
+    }
   }
   return result;
 }
 
 std::unique_ptr<const InstructionSetFeatures>
-Riscv64InstructionSetFeatures::AddFeaturesFromSplitString(
-    const std::vector<std::string>& features ATTRIBUTE_UNUSED,
-    std::string* error_msg ATTRIBUTE_UNUSED) const {
-  UNIMPLEMENTED(WARNING);
-  return std::unique_ptr<const InstructionSetFeatures>(new Riscv64InstructionSetFeatures(bits_));
+Riscv64InstructionSetFeatures::AddFeaturesFromSplitString(const std::vector<std::string>& features,
+                                                          std::string* error_msg) const {
+  uint32_t bits = bits_;
+  if (!features.empty()) {
+    // There should be only one feature, the ISA string.
+    DCHECK_EQ(features.size(), 1U);
+    std::string_view isa_string = features.front();
+    bits = 0;
+    for (auto&& [ext_bit, ext_string] : kExtensionList) {
+      if (isa_string.substr(0, ext_string.length()) == ext_string) {
+        isa_string.remove_prefix(ext_string.length());
+        bits |= ext_bit;
+      }
+    }
+    if (!isa_string.empty()) {
+      *error_msg = StringPrintf("Unknown extension in ISA string: '%s'", features.front().c_str());
+      return nullptr;
+    }
+    DCHECK(bits & kExtGeneric);
+  }
+  return FromBitmap(bits);
 }
 
 }  // namespace art
diff --git a/runtime/arch/riscv64/instruction_set_features_riscv64.h b/runtime/arch/riscv64/instruction_set_features_riscv64.h
index 1ad2ffd..ea679e6 100644
--- a/runtime/arch/riscv64/instruction_set_features_riscv64.h
+++ b/runtime/arch/riscv64/instruction_set_features_riscv64.h
@@ -18,8 +18,9 @@
 #define ART_RUNTIME_ARCH_RISCV64_INSTRUCTION_SET_FEATURES_RISCV64_H_
 
 #include "arch/instruction_set_features.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class Riscv64InstructionSetFeatures;
 using Riscv64FeaturesUniquePtr = std::unique_ptr<const Riscv64InstructionSetFeatures>;
@@ -31,7 +32,10 @@
   enum {
     kExtGeneric = (1 << 0),     // G extension covers the basic set IMAFD
     kExtCompressed = (1 << 1),  // C extension adds compressed instructions
-    kExtVector = (1 << 2)       // V extension adds vector instructions
+    kExtVector = (1 << 2),      // V extension adds vector instructions
+    kExtZba = (1 << 3),         // Zba adds address generation bit-manipulation instructions
+    kExtZbb = (1 << 4),         // Zbb adds basic bit-manipulation instructions
+    kExtZbs = (1 << 5),         // Zbs adds single-bit bit-manipulation instructions
   };
 
   static Riscv64FeaturesUniquePtr FromVariant(const std::string& variant, std::string* error_msg);
@@ -64,9 +68,26 @@
 
   std::string GetFeatureString() const override;
 
+  bool HasCompressed() const { return (bits_ & kExtCompressed) != 0; }
+
+  bool HasVector() const { return (bits_ & kExtVector) != 0; }
+
+  bool HasZba() const { return (bits_ & kExtZba) != 0; }
+
+  bool HasZbb() const { return (bits_ & kExtZbb) != 0; }
+
+  bool HasZbs() const { return (bits_ & kExtZbs) != 0; }
+
   virtual ~Riscv64InstructionSetFeatures() {}
 
  protected:
+  // If `features` is empty, this method doesn't add/remove anything from the
+  // existing set of features.
+  // If `features` is not empty, this method expects it to have exactly one value
+  // which is assumed to be a complete and valid features string. In this case, the
+  // new features will override the old ones. For example, if the existing set of
+  // features were `rv64gcv_zba_zbb_zbs` but `features` is `{"rv64gcv"}`, then the
+  // new features will not have the bits set for Zba, Zbb, or Zbs.
   std::unique_ptr<const InstructionSetFeatures> AddFeaturesFromSplitString(
       const std::vector<std::string>& features, std::string* error_msg) const override;
 
diff --git a/runtime/arch/riscv64/instruction_set_features_riscv64_test.cc b/runtime/arch/riscv64/instruction_set_features_riscv64_test.cc
index aef3d67..d1594cb 100644
--- a/runtime/arch/riscv64/instruction_set_features_riscv64_test.cc
+++ b/runtime/arch/riscv64/instruction_set_features_riscv64_test.cc
@@ -18,7 +18,7 @@
 
 #include <gtest/gtest.h>
 
-namespace art {
+namespace art HIDDEN {
 
 TEST(Riscv64InstructionSetFeaturesTest, Riscv64FeaturesFromDefaultVariant) {
   std::string error_msg;
@@ -30,9 +30,45 @@
 
   EXPECT_TRUE(riscv64_features->Equals(riscv64_features.get()));
 
+  // rv64gcv_zba_zbb_zbs, aka rv64imafdcv_zba_zbb_zbs
   uint32_t expected_extensions =
-      Riscv64InstructionSetFeatures::kExtGeneric | Riscv64InstructionSetFeatures::kExtCompressed;
-  EXPECT_EQ(riscv64_features->AsBitmap(), expected_extensions);  // rv64gc, aka rv64imafdc
+      Riscv64InstructionSetFeatures::kExtGeneric |
+      Riscv64InstructionSetFeatures::kExtCompressed |
+      Riscv64InstructionSetFeatures::kExtVector |
+      Riscv64InstructionSetFeatures::kExtZba |
+      Riscv64InstructionSetFeatures::kExtZbb |
+      Riscv64InstructionSetFeatures::kExtZbs;
+  EXPECT_EQ(riscv64_features->AsBitmap(), expected_extensions);
+}
+
+TEST(Riscv64InstructionSetFeaturesTest, Riscv64FeaturesFromString) {
+  std::string error_msg;
+  std::unique_ptr<const InstructionSetFeatures> generic_features(
+      InstructionSetFeatures::FromVariant(InstructionSet::kRiscv64, "generic", &error_msg));
+  ASSERT_TRUE(generic_features.get() != nullptr) << error_msg;
+
+  std::unique_ptr<const InstructionSetFeatures> rv64gv_features(
+      generic_features->AddFeaturesFromString("rv64gv", &error_msg));
+  ASSERT_TRUE(rv64gv_features.get() != nullptr) << error_msg;
+
+  EXPECT_FALSE(generic_features->Equals(rv64gv_features.get()));
+
+  uint32_t expected_extensions = Riscv64InstructionSetFeatures::kExtGeneric |
+                                 Riscv64InstructionSetFeatures::kExtVector;
+  EXPECT_EQ(rv64gv_features->AsBitmap(), expected_extensions);
+
+  std::unique_ptr<const InstructionSetFeatures> rv64gc_zba_zbb_features(
+      generic_features->AddFeaturesFromString("rv64gc_zba_zbb", &error_msg));
+  ASSERT_TRUE(rv64gc_zba_zbb_features.get() != nullptr) << error_msg;
+
+  EXPECT_FALSE(generic_features->Equals(rv64gc_zba_zbb_features.get()));
+
+  expected_extensions =
+      Riscv64InstructionSetFeatures::kExtGeneric |
+      Riscv64InstructionSetFeatures::kExtCompressed |
+      Riscv64InstructionSetFeatures::kExtZba |
+      Riscv64InstructionSetFeatures::kExtZbb;
+  EXPECT_EQ(rv64gc_zba_zbb_features->AsBitmap(), expected_extensions);
 }
 
 }  // namespace art
diff --git a/runtime/arch/riscv64/jni_entrypoints_riscv64.S b/runtime/arch/riscv64/jni_entrypoints_riscv64.S
index 63412b0..c9d034b 100644
--- a/runtime/arch/riscv64/jni_entrypoints_riscv64.S
+++ b/runtime/arch/riscv64/jni_entrypoints_riscv64.S
@@ -16,15 +16,6 @@
 
 #include "asm_support_riscv64.S"
 
-UNDEFINED art_jni_method_start
-UNDEFINED art_jni_method_end
-UNDEFINED art_jni_read_barrier
-UNDEFINED art_jni_method_entry_hook
-UNDEFINED art_jni_lock_object_no_inline
-UNDEFINED art_jni_lock_object
-UNDEFINED art_jni_unlock_object_no_inline
-UNDEFINED art_jni_unlock_object
-
 
 // 8 argument GPRS: a0 - a7 and 8 argument FPRs: fa0 - fa7
 #define ALL_ARGS_SIZE (8 * (8 + 8))
@@ -35,52 +26,95 @@
     INCREASE_FRAME (ALL_ARGS_SIZE + \extra_space)
 
     // Argument GPRs a0 - a7.
-    SAVE_GPR a0, (8*0)
-    SAVE_GPR a1, (8*1)
-    SAVE_GPR a2, (8*2)
-    SAVE_GPR a3, (8*3)
-    SAVE_GPR a4, (8*4)
-    SAVE_GPR a5, (8*5)
-    SAVE_GPR a6, (8*6)
-    SAVE_GPR a7, (8*7)
+    sd    a0, (8*0)(sp)
+    sd    a1, (8*1)(sp)
+    sd    a2, (8*2)(sp)
+    sd    a3, (8*3)(sp)
+    sd    a4, (8*4)(sp)
+    sd    a5, (8*5)(sp)
+    sd    a6, (8*6)(sp)
+    sd    a7, (8*7)(sp)
 
     // Argument FPRs fa0 - fa7.
-    SAVE_FPR fa0, (8*8)
-    SAVE_FPR fa1, (8*9)
-    SAVE_FPR fa2, (8*10)
-    SAVE_FPR fa3, (8*11)
-    SAVE_FPR fa4, (8*12)
-    SAVE_FPR fa5, (8*13)
-    SAVE_FPR fa6, (8*14)
-    SAVE_FPR fa7, (8*15)
+    fsd   fa0, (8*8)(sp)
+    fsd   fa1, (8*9)(sp)
+    fsd   fa2, (8*10)(sp)
+    fsd   fa3, (8*11)(sp)
+    fsd   fa4, (8*12)(sp)
+    fsd   fa5, (8*13)(sp)
+    fsd   fa6, (8*14)(sp)
+    fsd   fa7, (8*15)(sp)
 .endm
 
 
 .macro RESTORE_ALL_ARGS_DECREASE_FRAME extra_space
     // Argument GPRs a0 - a7.
-    RESTORE_GPR a0, (8*0)
-    RESTORE_GPR a1, (8*1)
-    RESTORE_GPR a2, (8*2)
-    RESTORE_GPR a3, (8*3)
-    RESTORE_GPR a4, (8*4)
-    RESTORE_GPR a5, (8*5)
-    RESTORE_GPR a6, (8*6)
-    RESTORE_GPR a7, (8*7)
+    ld    a0, (8*0)(sp)
+    ld    a1, (8*1)(sp)
+    ld    a2, (8*2)(sp)
+    ld    a3, (8*3)(sp)
+    ld    a4, (8*4)(sp)
+    ld    a5, (8*5)(sp)
+    ld    a6, (8*6)(sp)
+    ld    a7, (8*7)(sp)
 
     // Argument FPRs fa0 - fa7.
-    RESTORE_FPR fa0, (8*8)
-    RESTORE_FPR fa1, (8*9)
-    RESTORE_FPR fa2, (8*10)
-    RESTORE_FPR fa3, (8*11)
-    RESTORE_FPR fa4, (8*12)
-    RESTORE_FPR fa5, (8*13)
-    RESTORE_FPR fa6, (8*14)
-    RESTORE_FPR fa7, (8*15)
+    fld   fa0, (8*8)(sp)
+    fld   fa1, (8*9)(sp)
+    fld   fa2, (8*10)(sp)
+    fld   fa3, (8*11)(sp)
+    fld   fa4, (8*12)(sp)
+    fld   fa5, (8*13)(sp)
+    fld   fa6, (8*14)(sp)
+    fld   fa7, (8*15)(sp)
 
     DECREASE_FRAME (ALL_ARGS_SIZE + \extra_space)
 .endm
 
 
+.macro JNI_SAVE_MANAGED_ARGS_TRAMPOLINE name, cxx_name, arg1 = "none"
+    .extern \cxx_name
+ENTRY \name
+    // Save args and RA.
+    SAVE_ALL_ARGS_INCREASE_FRAME /*padding*/ 8 + /*RA*/ 8
+    SAVE_GPR ra, (ALL_ARGS_SIZE + /*padding*/ 8)
+    // Call `cxx_name()`.
+    .ifnc \arg1, none
+        mv    a0, \arg1
+    .endif
+    call   \cxx_name
+    // Restore RA and args and return.
+    RESTORE_GPR ra, (ALL_ARGS_SIZE + /*padding*/ 8)
+    RESTORE_ALL_ARGS_DECREASE_FRAME /*padding*/ 8 + /*RA*/ 8
+    ret
+END \name
+.endm
+
+
+.macro JNI_SAVE_RETURN_VALUE_TRAMPOLINE name, cxx_name, arg1, arg2 = "none"
+    .extern \cxx_name
+ENTRY \name
+    // Save return registers and return address.
+    INCREASE_FRAME 32
+    sd    a0, 0(sp)
+    fsd   fa0, 8(sp)
+    SAVE_GPR ra, 24
+    // Call `cxx_name()`.
+    mv    a0, \arg1
+    .ifnc \arg2, none
+        mv    a1, \arg2
+    .endif
+    call  \cxx_name
+    // Restore result registers and return.
+    ld    a0, 0(sp)
+    fld   fa0, 8(sp)
+    RESTORE_GPR ra, 24
+    DECREASE_FRAME 32
+    ret
+END \name
+.endm
+
+
 // JNI dlsym lookup stub.
 .extern artFindNativeMethod
 .extern artFindNativeMethodRunnable
@@ -122,13 +156,398 @@
 
 // JNI dlsym lookup stub for @CriticalNative.
 ENTRY art_jni_dlsym_lookup_critical_stub
-    // The hidden arg holding the tagged method is t6 (loaded by art_quick_generic_jni_trampoline).
-    // Bit 0 set means generic JNI.
+    // The hidden arg holding the tagged method is t0 (loaded by compiled JNI stub, compiled
+    // managed code, or `art_quick_generic_jni_trampoline`). Bit 0 set means generic JNI.
     // For generic JNI we already have a managed frame, so we reuse the art_jni_dlsym_lookup_stub.
-    andi  t6, t6, 1
-    beqz  t6, 1f
-    j     art_jni_dlsym_lookup_stub
-1:
-    // TODO(riscv64): implement for code paths other than generic JNI trampoline.
-    unimp
+    andi  t6, t0, 1
+    bnez  t6, art_jni_dlsym_lookup_stub
+
+    // Save args, the hidden arg and caller PC. No CFI needed for args and the hidden arg.
+    SAVE_ALL_ARGS_INCREASE_FRAME 2*8
+    SAVE_GPR t0, (ALL_ARGS_SIZE + 0)
+    SAVE_GPR ra, (ALL_ARGS_SIZE + 8)
+
+    // Call artCriticalNativeFrameSize(method, caller_pc)
+    mv    a0, t0  // a0 := method (from hidden arg)
+    mv    a1, ra  // a1 := caller_pc
+    call  artCriticalNativeFrameSize
+
+    // Move frame size to T2.
+    mv    t2, a0
+
+    // Restore args, the hidden arg and caller PC.
+    RESTORE_GPR t0, (ALL_ARGS_SIZE + 0)
+    RESTORE_GPR ra, (ALL_ARGS_SIZE + 8)
+    RESTORE_ALL_ARGS_DECREASE_FRAME 2*8
+
+    // Reserve space for a SaveRefsAndArgs managed frame, either for the actual runtime
+    // method or for a GenericJNI frame which is similar but has a native method and a tag.
+    // Add space for RA and padding to keep the stack 16-byte aligned.
+    INCREASE_FRAME (FRAME_SIZE_SAVE_REFS_AND_ARGS + 16)
+
+    // Prepare the return address for managed stack walk of the SaveRefsAndArgs frame.
+    // If we're coming from JNI stub with tail call, it is RA. If we're coming from
+    // JNI stub that saved the return address, it will be the last value we copy below.
+    // If we're coming directly from compiled code, it is RA, set further down.
+    mv    t4, ra
+
+    // Move the stack args if any. Calculate the base address of the managed frame in the process.
+    addi  t1, sp, 16
+    beqz  t2, .Lcritical_skip_copy_args
+.Lcritical_copy_args_loop:
+    ld    t3, FRAME_SIZE_SAVE_REFS_AND_ARGS+0(t1)
+    ld    t4, FRAME_SIZE_SAVE_REFS_AND_ARGS+8(t1)
+    addi  t2, t2, -16
+    sd    t3, 0-16(t1)
+    sd    t4, 8-16(t1)
+    addi  t1, t1, 16
+    bnez  t2, .Lcritical_copy_args_loop
+.Lcritical_skip_copy_args:
+
+    // Spill registers for the SaveRefsAndArgs frame above the stack args.
+    // Note that the runtime shall not examine the args here, otherwise we would have to
+    // move them in registers and stack to account for the difference between managed and
+    // native ABIs. Do not update CFI while we hold the frame address in T1 and the values
+    // in registers are unchanged.
+    // stack slot (0*8)(t1) is for ArtMethod*
+    fsd   fa0, (1*8)(t1)
+    fsd   fa1, (2*8)(t1)
+    fsd   fa2, (3*8)(t1)
+    fsd   fa3, (4*8)(t1)
+    fsd   fa4, (5*8)(t1)
+    fsd   fa5, (6*8)(t1)
+    fsd   fa6, (7*8)(t1)
+    fsd   fa7, (8*8)(t1)
+    sd    fp,  (9*8)(t1)   // x8, frame pointer
+    // s1 (x9) is the ART thread register
+    // a0 (x10) is the method pointer
+    sd    a1,  (10*8)(t1)  // x11
+    sd    a2,  (11*8)(t1)  // x12
+    sd    a3,  (12*8)(t1)  // x13
+    sd    a4,  (13*8)(t1)  // x14
+    sd    a5,  (14*8)(t1)  // x15
+    sd    a6,  (15*8)(t1)  // x16
+    sd    a7,  (16*8)(t1)  // x17
+    sd    s2,  (17*8)(t1)  // x18
+    sd    s3,  (18*8)(t1)  // x19
+    sd    s4,  (19*8)(t1)  // x20
+    sd    s5,  (20*8)(t1)  // x21
+    sd    s6,  (21*8)(t1)  // x22
+    sd    s7,  (22*8)(t1)  // x23
+    sd    s8,  (23*8)(t1)  // x24
+    sd    s9,  (24*8)(t1)  // x25
+    sd    s10, (25*8)(t1)  // x26
+    sd    s11, (26*8)(t1)  // x27
+    sd    t4,  (27*8)(t1)  // t4: Save return address for tail call from JNI stub.
+    // (If there were any stack args, we're storing the value that's already there.
+    // For direct calls from compiled managed code, we shall overwrite this below.)
+
+    // Move the managed frame address to native callee-save register fp (x8) and update CFI.
+    mv    fp, t1
+    // Skip args FA0-FA7, A1-A7
+    CFI_EXPRESSION_BREG  8, 8, (9*8)
+    CFI_EXPRESSION_BREG 18, 8, (17*8)
+    CFI_EXPRESSION_BREG 19, 8, (18*8)
+    CFI_EXPRESSION_BREG 20, 8, (19*8)
+    CFI_EXPRESSION_BREG 21, 8, (20*8)
+    CFI_EXPRESSION_BREG 22, 8, (21*8)
+    CFI_EXPRESSION_BREG 23, 8, (22*8)
+    CFI_EXPRESSION_BREG 24, 8, (23*8)
+    CFI_EXPRESSION_BREG 25, 8, (24*8)
+    CFI_EXPRESSION_BREG 26, 8, (25*8)
+    CFI_EXPRESSION_BREG 27, 8, (26*8)
+    // The saved return PC for managed stack walk is not necessarily our RA.
+
+    // Save our return PC below the managed frame.
+    sd    ra, -__SIZEOF_POINTER__(fp)
+    CFI_EXPRESSION_BREG 1, 8, -__SIZEOF_POINTER__
+
+    lw    t2, ART_METHOD_ACCESS_FLAGS_OFFSET(t0)  // Load access flags.
+    addi  t1, fp, 1        // Prepare managed SP tagged for a GenericJNI frame.
+    slliw t2, t2, 31 - ACCESS_FLAGS_METHOD_IS_NATIVE_BIT
+    bltz  t2, .Lcritical_skip_prepare_runtime_method
+
+    // When coming from a compiled method, the return PC for managed stack walk is RA.
+    // (When coming from a compiled stub, the correct return PC is already stored above.)
+    sd    ra, (FRAME_SIZE_SAVE_REFS_AND_ARGS - __SIZEOF_POINTER__)(fp)
+
+    // Replace the target method with the SaveRefsAndArgs runtime method.
+    LOAD_RUNTIME_INSTANCE t0
+    ld    t0, RUNTIME_SAVE_REFS_AND_ARGS_METHOD_OFFSET(t0)
+
+    mv    t1, fp           // Prepare untagged managed SP for the runtime method.
+
+.Lcritical_skip_prepare_runtime_method:
+    // Store the method on the bottom of the managed frame.
+    sd    t0, (fp)
+
+    // Place (maybe tagged) managed SP in Thread::Current()->top_quick_frame.
+    sd    t1, THREAD_TOP_QUICK_FRAME_OFFSET(xSELF)
+
+    // Preserve the native arg register A0 in callee-save register S2 (x18) which was saved above.
+    mv    s2, a0
+
+    // Call artFindNativeMethodRunnable()
+    mv    a0, xSELF   // pass Thread::Current()
+    call  artFindNativeMethodRunnable
+
+    // Store result in scratch reg.
+    mv    t0, a0
+
+    // Restore the native arg register A0.
+    mv    a0, s2
+
+    // Restore our return PC.
+    RESTORE_GPR_BASE fp, ra, -__SIZEOF_POINTER__
+
+    // Remember the end of out args before restoring FP.
+    addi  t1, fp, -16
+
+    // Restore arg registers.
+    fld   fa0, (1*8)(fp)
+    fld   fa1, (2*8)(fp)
+    fld   fa2, (3*8)(fp)
+    fld   fa3, (4*8)(fp)
+    fld   fa4, (5*8)(fp)
+    fld   fa5, (6*8)(fp)
+    fld   fa6, (7*8)(fp)
+    fld   fa7, (8*8)(fp)
+    // fp (x8) is restored last to keep CFI data valid until then.
+    // s1 (x9) is the ART thread register
+    // a0 (x10) is the method pointer
+    ld    a1,  (10*8)(fp)  // x11
+    ld    a2,  (11*8)(fp)  // x12
+    ld    a3,  (12*8)(fp)  // x13
+    ld    a4,  (13*8)(fp)  // x14
+    ld    a5,  (14*8)(fp)  // x15
+    ld    a6,  (15*8)(fp)  // x16
+    ld    a7,  (16*8)(fp)  // x17
+    RESTORE_GPR_BASE fp, s2,  (17*8)  // x18
+    RESTORE_GPR_BASE fp, s3,  (18*8)  // x19
+    RESTORE_GPR_BASE fp, s4,  (19*8)  // x20
+    RESTORE_GPR_BASE fp, s5,  (20*8)  // x21
+    RESTORE_GPR_BASE fp, s6,  (21*8)  // x22
+    RESTORE_GPR_BASE fp, s7,  (22*8)  // x23
+    RESTORE_GPR_BASE fp, s8,  (23*8)  // x24
+    RESTORE_GPR_BASE fp, s9,  (24*8)  // x25
+    RESTORE_GPR_BASE fp, s10, (25*8)  // x26
+    RESTORE_GPR_BASE fp, s11, (26*8)  // x27
+    RESTORE_GPR_BASE fp, fp,  (9*8)   // fp (x8) is restored last
+
+    // Check for exception before moving args back to keep the return PC for managed stack walk.
+    CFI_REMEMBER_STATE
+    beqz  t0, .Lcritical_deliver_exception
+
+    // Move stack args to their original place.
+    beq   t1, sp, .Lcritical_skip_copy_args_back
+    sub   t2, t1, sp
+.Lcritical_copy_args_back_loop:
+    ld    t3, 0-16(t1)
+    ld    t4, 8-16(t1)
+    addi  t2, t2, -16
+    sd    t3, FRAME_SIZE_SAVE_REFS_AND_ARGS+0(t1)
+    sd    t4, FRAME_SIZE_SAVE_REFS_AND_ARGS+8(t1)
+    addi  t1, t1, -16
+    bnez  t2, .Lcritical_copy_args_back_loop
+.Lcritical_skip_copy_args_back:
+
+    // Remove the frame reservation.
+    DECREASE_FRAME (FRAME_SIZE_SAVE_REFS_AND_ARGS + 16)
+
+    // Do the tail call.
+    jr    t0
+
+.Lcritical_deliver_exception:
+    CFI_RESTORE_STATE_AND_DEF_CFA sp, FRAME_SIZE_SAVE_REFS_AND_ARGS + 16
+    // If this is called from a method that catches the exception, all callee-save registers need
+    // to be saved, so that the exception handling code can read them in case they contain live
+    // values later used by that method. This includes callee-save FP registers which are not
+    // saved in a SaveRefsAndArgs frame, so we cannot reuse the managed frame we have built above.
+    // That's why we checked for exception after restoring registers from that frame.
+    // We need to build a SaveAllCalleeSaves frame instead. Args are irrelevant at this
+    // point but keep the area allocated for stack args to keep CFA definition simple.
+#if FRAME_SIZE_SAVE_ALL_CALLEE_SAVES > FRAME_SIZE_SAVE_REFS_AND_ARGS
+#error "Expanding stack frame from kSaveRefsAndArgs to kSaveAllCalleeSaves is not implemented."
+#endif
+    DECREASE_FRAME FRAME_SIZE_SAVE_REFS_AND_ARGS - FRAME_SIZE_SAVE_ALL_CALLEE_SAVES
+
+    // Calculate the base address of the managed frame.
+    addi  t1, t1, 16 + FRAME_SIZE_SAVE_REFS_AND_ARGS - FRAME_SIZE_SAVE_ALL_CALLEE_SAVES
+
+    // Spill registers for the SaveAllCalleeSaves frame above the stack args area. Do not update
+    // CFI while we hold the frame address in T1 and the values in registers are unchanged.
+    // stack slot (0*8)(t1) is for ArtMethod*
+    // stack slot (1*8)(t1) is for padding
+    // FP callee-saves.
+    fsd   fs0,  (8*2)(t1)   // f8
+    fsd   fs1,  (8*3)(t1)   // f9
+    fsd   fs2,  (8*4)(t1)   // f18
+    fsd   fs3,  (8*5)(t1)   // f19
+    fsd   fs4,  (8*6)(t1)   // f20
+    fsd   fs5,  (8*7)(t1)   // f21
+    fsd   fs6,  (8*8)(t1)   // f22
+    fsd   fs7,  (8*9)(t1)   // f23
+    fsd   fs8,  (8*10)(t1)  // f24
+    fsd   fs9,  (8*11)(t1)  // f25
+    fsd   fs10, (8*12)(t1)  // f26
+    fsd   fs11, (8*13)(t1)  // f27
+    // GP callee-saves
+    sd    s0,  (8*14)(t1)  // x8/fp, frame pointer
+    // s1 (x9) is the ART thread register
+    sd    s2,  (8*15)(t1)  // x18
+    sd    s3,  (8*16)(t1)  // x19
+    sd    s4,  (8*17)(t1)  // x20
+    sd    s5,  (8*18)(t1)  // x21
+    sd    s6,  (8*19)(t1)  // x22
+    sd    s7,  (8*20)(t1)  // x23
+    sd    s8,  (8*21)(t1)  // x24
+    sd    s9,  (8*22)(t1)  // x25
+    sd    s10, (8*23)(t1)  // x26
+    sd    s11, (8*24)(t1)  // x27
+    // Keep the caller PC for managed stack walk.
+
+    // Move the managed frame address to native callee-save register fp (x8) and update CFI.
+    mv    fp, t1
+    CFI_EXPRESSION_BREG  8, 8, (14*8)  // fp/x8: The base register for these CFI expressions.
+    CFI_EXPRESSION_BREG  /*FP reg*/ 32 + 8, 8, (8*2)    // fs0/f8
+    CFI_EXPRESSION_BREG  /*FP reg*/ 32 + 9, 8, (8*3)    // fs1/f9
+    CFI_EXPRESSION_BREG  /*FP reg*/ 32 + 18, 8, (8*4)   // fs2/f18
+    CFI_EXPRESSION_BREG  /*FP reg*/ 32 + 19, 8, (8*5)   // fs3/f19
+    CFI_EXPRESSION_BREG  /*FP reg*/ 32 + 20, 8, (8*6)   // fs4/f20
+    CFI_EXPRESSION_BREG  /*FP reg*/ 32 + 21, 8, (8*7)   // fs5/f21
+    CFI_EXPRESSION_BREG  /*FP reg*/ 32 + 22, 8, (8*8)   // fs6/f22
+    CFI_EXPRESSION_BREG  /*FP reg*/ 32 + 23, 8, (8*9)   // fs7/f23
+    CFI_EXPRESSION_BREG  /*FP reg*/ 32 + 24, 8, (8*10)  // fs8/f24
+    CFI_EXPRESSION_BREG  /*FP reg*/ 32 + 25, 8, (8*11)  // fs9/f25
+    CFI_EXPRESSION_BREG  /*FP reg*/ 32 + 26, 8, (8*12)  // fs10/f26
+    // CFI expression for fp (x8) already emitted above.
+    CFI_EXPRESSION_BREG 18, 8, (15*8)  // s2/x18
+    CFI_EXPRESSION_BREG 19, 8, (16*8)  // s3/x19
+    CFI_EXPRESSION_BREG 20, 8, (17*8)  // s4/x20
+    CFI_EXPRESSION_BREG 21, 8, (18*8)  // s5/x21
+    CFI_EXPRESSION_BREG 22, 8, (19*8)  // s6/x22
+    CFI_EXPRESSION_BREG 23, 8, (20*8)  // s7/x23
+    CFI_EXPRESSION_BREG 24, 8, (21*8)  // s8/x24
+    CFI_EXPRESSION_BREG 25, 8, (22*8)  // s9/x25
+    CFI_EXPRESSION_BREG 26, 8, (23*8)  // s10/x26
+    CFI_EXPRESSION_BREG 27, 8, (24*8)  // s11/x27
+    // The saved return PC for managed stack walk is not necessarily our RA.
+
+    // Save our return PC below the managed frame.
+    sd    ra, -__SIZEOF_POINTER__(fp)
+    CFI_EXPRESSION_BREG 1, 8, -__SIZEOF_POINTER__
+
+    // Store ArtMethod* Runtime::callee_save_methods_[kSaveAllCalleeSaves] to the managed frame.
+    LOAD_RUNTIME_INSTANCE t0
+    ld    t0, RUNTIME_SAVE_ALL_CALLEE_SAVES_METHOD_OFFSET(t0)
+    sd    t0, (fp)
+
+    // Place the managed frame SP in Thread::Current()->top_quick_frame.
+    sd    fp, THREAD_TOP_QUICK_FRAME_OFFSET(xSELF)
+
+    DELIVER_PENDING_EXCEPTION_FRAME_READY
 END art_jni_dlsym_lookup_critical_stub
+
+    /*
+     * Read barrier for the method's declaring class needed by JNI stub for static methods.
+     * (We're using a pointer to the declaring class in `ArtMethod` as `jclass`.)
+     */
+// The method argument is already in a0 for call to `artJniReadBarrier(ArtMethod*)`.
+JNI_SAVE_MANAGED_ARGS_TRAMPOLINE art_jni_read_barrier, artJniReadBarrier
+
+    /*
+     * Trampoline to `artJniMethodStart()` that preserves all managed arguments.
+     */
+JNI_SAVE_MANAGED_ARGS_TRAMPOLINE art_jni_method_start, artJniMethodStart, xSELF
+
+    /*
+     * Trampoline to `artJniMethodEntryHook` that preserves all managed arguments.
+     */
+JNI_SAVE_MANAGED_ARGS_TRAMPOLINE art_jni_method_entry_hook, artJniMethodEntryHook, xSELF
+
+    /*
+     * Trampoline to `artJniMonitoredMethodStart()` that preserves all managed arguments.
+     */
+JNI_SAVE_MANAGED_ARGS_TRAMPOLINE art_jni_monitored_method_start, artJniMonitoredMethodStart, xSELF
+
+    /*
+     * Trampoline to `artJniMethodEnd()` that preserves all return registers.
+     */
+JNI_SAVE_RETURN_VALUE_TRAMPOLINE art_jni_method_end, artJniMethodEnd, xSELF
+
+    /*
+     * Trampoline to `artJniMonitoredMethodEnd()` that preserves all return registers.
+     */
+JNI_SAVE_RETURN_VALUE_TRAMPOLINE art_jni_monitored_method_end, artJniMonitoredMethodEnd, xSELF
+
+    /*
+     * Entry from JNI stub that tries to lock the object in a fast path and
+     * calls `artLockObjectFromCode()` (the same as for managed code) for the
+     * difficult cases, may block for GC.
+     * Custom calling convention:
+     *     T0 holds the non-null object to lock.
+     *     Callee-save registers have been saved and can be used as temporaries.
+     *     All argument registers need to be preserved.
+     */
+ENTRY art_jni_lock_object
+    LOCK_OBJECT_FAST_PATH t0, art_jni_lock_object_no_inline, /*can_be_null*/ 0
+END art_jni_lock_object
+
+    /*
+     * Entry from JNI stub that calls `artLockObjectFromCode()`
+     * (the same as for managed code), may block for GC.
+     * Custom calling convention:
+     *     T0 holds the non-null object to lock.
+     *     Callee-save registers have been saved and can be used as temporaries.
+     *     All argument registers need to be preserved.
+     */
+    .extern artLockObjectFromCode
+ENTRY art_jni_lock_object_no_inline
+    // This is also the slow path for art_jni_lock_object.
+    // Save args and RA.
+    SAVE_ALL_ARGS_INCREASE_FRAME /*padding*/ 8 + /*RA*/ 8
+    SAVE_GPR ra, (ALL_ARGS_SIZE + /*padding*/ 8)
+    // Call `artLockObjectFromCode()`.
+    mv    a0, t0                     // Pass the object to lock.
+    mv    a1, xSELF                  // Pass Thread::Current().
+    call  artLockObjectFromCode      // (Object* obj, Thread*)
+    // Restore return address.
+    RESTORE_GPR ra, (ALL_ARGS_SIZE + /*padding*/ 8)
+    // Check result.
+    bnez   a0, 1f
+    // Restore register args a0-a7, fa0-fa7 and return.
+    RESTORE_ALL_ARGS_DECREASE_FRAME /*padding*/ 8 + /*RA*/ 8
+    ret
+    .cfi_adjust_cfa_offset (ALL_ARGS_SIZE + /*padding*/ 8 + /*RA*/ 8)
+1:
+    // All args are irrelevant when throwing an exception. Remove the spill area.
+    DECREASE_FRAME (ALL_ARGS_SIZE + /*padding*/ 8 + /*RA*/ 8)
+    // Make a tail call to `artDeliverPendingExceptionFromCode()`.
+    // Rely on the JNI transition frame constructed in the JNI stub.
+    mv     a0, xSELF                           // Pass Thread::Current().
+    tail   artDeliverPendingExceptionFromCode  // (Thread*)
+END art_jni_lock_object_no_inline
+
+    /*
+     * Entry from JNI stub that tries to unlock the object in a fast path and calls
+     * `artJniUnlockObject()` for the difficult cases. Note that failure to unlock
+     * is fatal, so we do not need to check for exceptions in the slow path.
+     * Custom calling convention:
+     *     T0 holds the non-null object to unlock.
+     *     Callee-save registers have been saved and can be used as temporaries.
+     *     Return registers a0 and fa0 need to be preserved.
+     */
+ENTRY art_jni_unlock_object
+    UNLOCK_OBJECT_FAST_PATH t0, art_jni_unlock_object_no_inline, /*can_be_null*/ 0
+END art_jni_unlock_object
+
+    /*
+     * Entry from JNI stub that calls `artJniUnlockObject()`. Note that failure to
+     * unlock is fatal, so we do not need to check for exceptions.
+     * Custom calling convention:
+     *     T0 holds the non-null object to unlock.
+     *     Callee-save registers have been saved and can be used as temporaries.
+     *     Return registers a0 and fa0 need to be preserved.
+     */
+    // This is also the slow path for art_jni_unlock_object.
+JNI_SAVE_RETURN_VALUE_TRAMPOLINE art_jni_unlock_object_no_inline, artJniUnlockObject, t0, xSELF
diff --git a/runtime/arch/riscv64/jni_frame_riscv64.h b/runtime/arch/riscv64/jni_frame_riscv64.h
new file mode 100644
index 0000000..29fb6d0
--- /dev/null
+++ b/runtime/arch/riscv64/jni_frame_riscv64.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_RUNTIME_ARCH_RISCV64_JNI_FRAME_RISCV64_H_
+#define ART_RUNTIME_ARCH_RISCV64_JNI_FRAME_RISCV64_H_
+
+#include <string.h>
+
+#include "arch/instruction_set.h"
+#include "base/bit_utils.h"
+#include "base/globals.h"
+#include "base/logging.h"
+#include "base/macros.h"
+
+namespace art HIDDEN {
+namespace riscv64 {
+
+constexpr size_t kFramePointerSize = static_cast<size_t>(PointerSize::k64);
+static_assert(kRiscv64PointerSize == PointerSize::k64, "Unexpected RISCV64 pointer size");
+
+// The RISCV64 requires 16-byte alignment. This is the same as the Managed ABI stack alignment.
+static constexpr size_t kNativeStackAlignment = 16u;
+static_assert(kNativeStackAlignment == kStackAlignment);
+
+// Up to how many float-like (float, double) args can be in FP registers.
+// The rest of the args must go to general purpose registers (native ABI only) or on the stack.
+constexpr size_t kMaxFloatOrDoubleArgumentRegisters = 8u;
+// Up to how many integer-like (pointers, objects, longs, int, short, bool, etc) args can be
+// in registers. The rest of the args must go on the stack. Note that even FP args can use these
+// registers in native ABI after using all FP arg registers. We do not pass FP args in registers in
+// managed ABI to avoid some complexity in the compiler - more than 8 FP args are quite rare anyway.
+constexpr size_t kMaxIntLikeArgumentRegisters = 8u;
+
+// Get the size of the arguments for a native call.
+inline size_t GetNativeOutArgsSize(size_t num_fp_args, size_t num_non_fp_args) {
+  // Account for FP arguments passed through FA0-FA7.
+  size_t num_fp_args_without_fprs =
+      num_fp_args - std::min(kMaxFloatOrDoubleArgumentRegisters, num_fp_args);
+  // All other args are passed through A0-A7 (even FP args) and the stack.
+  size_t num_gpr_and_stack_args = num_non_fp_args + num_fp_args_without_fprs;
+  size_t num_stack_args =
+      num_gpr_and_stack_args - std::min(kMaxIntLikeArgumentRegisters, num_gpr_and_stack_args);
+  // Each stack argument takes 8 bytes.
+  return num_stack_args * static_cast<size_t>(kRiscv64PointerSize);
+}
+
+// Get stack args size for @CriticalNative method calls.
+inline size_t GetCriticalNativeCallArgsSize(const char* shorty, uint32_t shorty_len) {
+  DCHECK_EQ(shorty_len, strlen(shorty));
+
+  size_t num_fp_args =
+      std::count_if(shorty + 1, shorty + shorty_len, [](char c) { return c == 'F' || c == 'D'; });
+  size_t num_non_fp_args = shorty_len - 1u - num_fp_args;
+
+  return GetNativeOutArgsSize(num_fp_args, num_non_fp_args);
+}
+
+// Get the frame size for @CriticalNative method stub.
+// This must match the size of the extra frame emitted by the compiler at the native call site.
+inline size_t GetCriticalNativeStubFrameSize(const char* shorty, uint32_t shorty_len) {
+  // The size of outgoing arguments.
+  size_t size = GetCriticalNativeCallArgsSize(shorty, shorty_len);
+
+  // We can make a tail call if there are no stack args. Otherwise, add space for return PC.
+  // Note: Result does not neeed to be zero- or sign-extended.
+  if (size != 0u) {
+    size += kFramePointerSize;  // We need to spill RA with the args.
+  }
+  return RoundUp(size, kNativeStackAlignment);
+}
+
+// Get the frame size for direct call to a @CriticalNative method.
+// This must match the size of the frame emitted by the JNI compiler at the native call site.
+inline size_t GetCriticalNativeDirectCallFrameSize(const char* shorty, uint32_t shorty_len) {
+  // The size of outgoing arguments.
+  size_t size = GetCriticalNativeCallArgsSize(shorty, shorty_len);
+
+  // No return PC to save.
+  return RoundUp(size, kNativeStackAlignment);
+}
+
+}  // namespace riscv64
+}  // namespace art
+
+#endif  // ART_RUNTIME_ARCH_RISCV64_JNI_FRAME_RISCV64_H_
diff --git a/runtime/arch/riscv64/quick_entrypoints_riscv64.S b/runtime/arch/riscv64/quick_entrypoints_riscv64.S
index ef9a043..141974e 100644
--- a/runtime/arch/riscv64/quick_entrypoints_riscv64.S
+++ b/runtime/arch/riscv64/quick_entrypoints_riscv64.S
@@ -17,6 +17,9 @@
 #include "asm_support_riscv64.S"
 #include "interpreter/cfi_asm_support.h"
 
+#include "arch/quick_alloc_entrypoints.S"
+#include "arch/quick_field_entrypoints.S"
+
 
 // Wrap ExecuteSwitchImpl in assembly method which specifies DEX PC for unwinding.
 //  Argument 0: a0: The context pointer for ExecuteSwitchImpl.
@@ -39,39 +42,41 @@
 
 
 .macro INVOKE_STUB_CREATE_FRAME
-    // Save ra, fp, xSELF (current thread) a4, a5 (they will be needed in the invoke stub return)
-    // and callee-save regs s3 - s5 that are clobbered here and in art_quick_invoke_(static_)_stub.
+    // Save RA, FP, xSELF (current thread), A4, A5 (they will be needed in the invoke stub return).
     INCREASE_FRAME 48
-    SAVE_GPR fp,    (8*0)
+    // Slot (8*0) is used for `ArtMethod*` (if no args), args or padding, see below.
     SAVE_GPR xSELF, (8*1)
     SAVE_GPR a4,    (8*2)
     SAVE_GPR a5,    (8*3)
-    SAVE_GPR s3,    (8*4)
+    SAVE_GPR fp,    (8*4)  // Store FP just under the return address.
     SAVE_GPR ra,    (8*5)
 
-    mv fp, sp  // save frame pointer
-    .cfi_def_cfa_register fp
+    // Make the new FP point to the location where we stored the old FP.
+    // Some stack-walking tools may rely on this simply-linked list of saved FPs.
+    addi fp, sp, (8*4)  // save frame pointer
+    .cfi_def_cfa fp, 48 - (8*4)
 
-    addi t0, a2, (__SIZEOF_POINTER__ + 0xf) // Reserve space for ArtMethod*, arguments and
-    andi t0, t0, ~0xf                       // round up for 16-byte stack alignment.
+    // We already have space for `ArtMethod*` on the stack but we need space for args above
+    // the `ArtMethod*`, so add sufficient space now, pushing the `ArtMethod*` slot down.
+    addi t0, a2, 0xf    // Reserve space for arguments and
+    andi t0, t0, ~0xf   // round up for 16-byte stack alignment.
     sub  sp, sp, t0
 
     mv xSELF, a3
 
     // Copy arguments on stack (4 bytes per slot):
-    //   a1: source address
-    //   a2: arguments length
-    //   s3: destination address.
-
-    add s3, sp, 8  // destination address is bottom of the stack + 8 bytes for ArtMethod* (null)
+    //   A1: source address
+    //   A2: arguments length
+    //   T0: destination address if there are any args.
 
     beqz a2, 2f      // loop through 4-byte arguments from the last to the first
+    addi t0, sp, 8   // destination address is bottom of the stack + 8 bytes for ArtMethod* (null)
 1:
     addi a2, a2, -4
-    add  t0, a1, a2  // t0 is the source address of the next copied argument
-    lw   t1, (t0)    // t1 is the 4 bytes at address t0
-    add  t0, s3, a2  // t0 is the destination address of the next copied argument
-    sw   t1, (t0)    // save t1 at the destination address t0
+    add  t1, a1, a2  // T1 is the source address of the next copied argument
+    lw   t2, (t1)    // T2 is the 4 bytes at address T1
+    add  t1, t0, a2  // T1 is the destination address of the next copied argument
+    sw   t2, (t1)    // save T2 at the destination address T1
     bnez a2, 1b
 2:
     sd zero, (sp)  // Store null into ArtMethod* at bottom of frame.
@@ -83,16 +88,14 @@
     ld   t0, ART_METHOD_QUICK_CODE_OFFSET_64(a0)
     jalr t0
 
-    mv sp, fp  // restore frame pointer
-    .cfi_def_cfa_register sp
+    addi sp, fp, -(8*4)  // restore SP (see `INVOKE_STUB_CREATE_FRAME`)
+    .cfi_def_cfa sp, 48
 
-    // Restore ra, fp, xSELF (current thread) a4 (shorty), a5 (result pointer) and callee-save
-    // regs s3 - s5 from stack.
-    RESTORE_GPR fp,    (8*0)
+    // Restore ra, fp, xSELF (current thread) a4 (shorty), a5 (result pointer) from stack.
     RESTORE_GPR xSELF, (8*1)
     RESTORE_GPR a4,    (8*2)
     RESTORE_GPR a5,    (8*3)
-    RESTORE_GPR s3,    (8*4)
+    RESTORE_GPR fp,    (8*4)
     RESTORE_GPR ra,    (8*5)
     DECREASE_FRAME 48
 
@@ -130,137 +133,145 @@
 END art_deliver_pending_exception
 
 
-// Macros for loading an argument into a register.
-//  label - the base name of the label of the load routine,
-//  reg - the register to load,
-//  args - pointer to current argument, incremented by size,
-//  size - the size of the register - 4 or 8 bytes,
+// The size of the handler emitted by `INVOKE_STUB_LOAD_REG` below.
+#define INVOKE_STUB_LOAD_REG_SIZE 8
+
+// The offset within `INVOKE_STUB_LOAD_REG` for skipping arguments.
+#define INVOKE_STUB_LOAD_REG_SKIP_OFFSET 6
+
+// Macro for loading an argument into a register.
 //  load - instruction used for loading,
-//  nh4_reg - the register to fill with the address of the next handler for 4-byte values,
-//  nh4_l - the base name of the label of the next handler for 4-byte values,
-//  nh8_reg - the register to fill with the address of the next handler for 8-byte values,
-//  nh8_l - the base name of the label of the next handler for 8-byte values,
+//  reg - the register to load,
+//  args - pointer to next argument,
+//  size - the size of the register - 4 or 8 bytes, used as an offset for the load,
+//  handler_reg - the register with the address of the handler (points to this handler on entry),
+//  handler_diff - the difference in bytes from the current to the next handler,
 //  cont - the base name of the label for continuing the shorty processing loop,
 //  sfx - suffix added to all labels to make labels unique for different users.
-.macro INVOKE_STUB_LOAD_REG label, reg, args, size, load, nh4_reg, nh4_l, nh8_reg, nh8_l, cont, sfx
-\label\sfx:
-    \load \reg, (\args)
-    addi  \args, \args, \size
-    la    \nh4_reg, \nh4_l\sfx
-    la    \nh8_reg, \nh8_l\sfx
-    j     \cont\sfx
-.endm
-
-
-// Macro for skipping an argument that does not fit into argument registers.
-//  label - the base name of the label of the skip routine,
-//  args - pointer to current argument, incremented by size,
-//  size - the size of the argument - 4 or 8 bytes,
-//  cont - the base name of the label for continuing the shorty processing loop,
-//  sfx - suffix added to all labels to make labels unique for different users.
-.macro INVOKE_STUB_SKIP_ARG label, args, size, cont, sfx
-\label\sfx:
-    addi \args, \args, \size
-    j    \cont\sfx
+.macro INVOKE_STUB_LOAD_REG load, reg, args, size, handler_reg, handler_diff, cont, sfx
+.Linvoke_stub_\load\reg\sfx:
+    \load  \reg, -\size(\args)
+    c.addi \handler_reg, \handler_diff
+.org .Linvoke_stub_\load\reg\sfx + INVOKE_STUB_LOAD_REG_SKIP_OFFSET  // Enforce skip offset.
+    c.j    \cont\sfx
+.org .Linvoke_stub_\load\reg\sfx + INVOKE_STUB_LOAD_REG_SIZE  // Enforce handler size.
 .endm
 
 
 // Fill registers a1 to a7 and fa0 to fa7 with parameters.
 // Parse the passed shorty to determine which register to load.
 //  a5 - shorty,
-//  s3 - points to arguments on the stack,
+//  t0 - points to arguments on the stack if any (undefined for static method without args),
 //  sfx - suffix added to all labels to make labels unique for different users.
 .macro INVOKE_STUB_LOAD_ALL_ARGS sfx
-    mv   t0, a5                        // Load shorty address,
-    addi t0, t0, 1                     // plus one to skip the return type.
+    addi t1, a5, 1                     // Load shorty address, plus one to skip the return type.
 
-    // Load this (if instance method) and addresses for routines that load argument GPRs and FPRs.
+    // Load this (if instance method) and record the number of GPRs to fill.
     .ifc \sfx, _instance
-        lw   a1, (s3)                  // Load "this" parameter,
-        addi s3, s3, 4                 // and increment arg pointer.
-        la   t3, .Lload4i2\sfx
-        la   t4, .Lload8i2\sfx
+        lwu  a1, (t0)                  // Load "this" parameter,
+        addi t0, t0, 4                 // and increment arg pointer.
+        .equ NUM_GPRS_TO_FILL, 6
     .else
-        la   t3, .Lload4i1\sfx
-        la   t4, .Lload8i1\sfx
+        .equ NUM_GPRS_TO_FILL, 7
     .endif
-    la   t5, .Lload4f0\sfx
-    la   t6, .Lload8f0\sfx
+    .equ NUM_FPRS_TO_FILL, 8
+
+    // Load addresses for routines that load argument GPRs and FPRs.
+    lla  t4, .Lreg_handlers_start\sfx  // First handler for non-FP args.
+    addi t5, t4, (3 * NUM_GPRS_TO_FILL * INVOKE_STUB_LOAD_REG_SIZE)  // First handler for FP args.
 
     // Loop to fill registers.
 .Lfill_regs\sfx:
-    lb   t1, (t0)                      // Load next character in signature, and increment.
-    addi t0, t0, 1                     // and increment.
-    beqz t1, .Lcall_method\sfx         // Exit at end of signature. Shorty 0 terminated.
+    lb   t2, (t1)                      // Load next character in signature,
+    addi t1, t1, 1                     // and increment.
+    beqz t2, .Lcall_method\sfx         // Exit at end of signature. Shorty 0 terminated.
 
-    li   t2, 'J'
-    beq  t1, t2, .Lload_long\sfx       // Is this a long?
+    li   t3, 'L'
+    beq  t2, t3, .Lload_reference\sfx  // Is this a reference?
 
-    li   t2, 'F'
-    beq  t1, t2, .Lload_float\sfx      // Is this a float?
+    li   t3, 'J'
+    beq  t2, t3, .Lload_long\sfx       // Is this a long?
 
-    li   t2, 'D'
-    beq  t1, t2, .Lload_double\sfx     // Is this a double?
+    li   t3, 'F'
+    beq  t2, t3, .Lload_float\sfx      // Is this a float?
 
-    // Everything else uses a 4-byte GPR.
-    jr   t3
+    li   t3, 'D'
+    beq  t2, t3, .Lload_double\sfx     // Is this a double?
+
+    // Everything else uses a 4-byte value sign-extened to a 64 bit GPR.
+    addi t0, t0, 4
+    jalr x0, 0(t4)
+
+.Lload_reference\sfx:
+    addi t0, t0, 4
+    jalr x0, (NUM_GPRS_TO_FILL * INVOKE_STUB_LOAD_REG_SIZE)(t4)
 
 .Lload_long\sfx:
-    jr   t4
+    addi t0, t0, 8
+    jalr x0, (2 * NUM_GPRS_TO_FILL * INVOKE_STUB_LOAD_REG_SIZE)(t4)
 
 .Lload_float\sfx:
-    jr   t5
+    addi t0, t0, 4
+    jalr x0, 0(t5)
 
 .Lload_double\sfx:
-    jr   t6
+    addi t0, t0, 8
+    jalr x0, (NUM_FPRS_TO_FILL * INVOKE_STUB_LOAD_REG_SIZE)(t5)
 
-// Handlers for loading other args (not float/double/long) into 4-byte GPRs.
-    .ifnc \sfx, _instance
-        INVOKE_STUB_LOAD_REG \
-            .Lload4i1, a1, s3, 4, lw, t3, .Lload4i2, t4, .Lload8i2, .Lfill_regs, \sfx
-    .endif
-    INVOKE_STUB_LOAD_REG .Lload4i2, a2, s3, 4, lw, t3, .Lload4i3, t4, .Lload8i3, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload4i3, a3, s3, 4, lw, t3, .Lload4i4, t4, .Lload8i4, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload4i4, a4, s3, 4, lw, t3, .Lload4i5, t4, .Lload8i5, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload4i5, a5, s3, 4, lw, t3, .Lload4i6, t4, .Lload8i6, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload4i6, a6, s3, 4, lw, t3, .Lload4i7, t4, .Lload8i7, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload4i7, a7, s3, 4, lw, t3, .Lskip4, t4, .Lskip8, .Lfill_regs, \sfx
+.Lreg_handlers_start\sfx:
 
-// Handlers for loading longs into 8-byte GPRs.
+// Handlers for loading other args (not reference/long/float/double) into GPRs.
     .ifnc \sfx, _instance
-        INVOKE_STUB_LOAD_REG \
-            .Lload8i1, a1, s3, 8, ld, t3, .Lload4i2, t4, .Lload8i2, .Lfill_regs, \sfx
+        INVOKE_STUB_LOAD_REG lw, a1, t0, 4, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
     .endif
-    INVOKE_STUB_LOAD_REG .Lload8i2, a2, s3, 8, ld, t3, .Lload4i3, t4, .Lload8i3, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload8i3, a3, s3, 8, ld, t3, .Lload4i4, t4, .Lload8i4, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload8i4, a4, s3, 8, ld, t3, .Lload4i5, t4, .Lload8i5, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload8i5, a5, s3, 8, ld, t3, .Lload4i6, t4, .Lload8i6, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload8i6, a6, s3, 8, ld, t3, .Lload4i7, t4, .Lload8i7, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload8i7, a7, s3, 8, ld, t3, .Lskip4, t4, .Lskip8, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG lw, a2, t0, 4, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG lw, a3, t0, 4, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG lw, a4, t0, 4, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG lw, a5, t0, 4, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG lw, a6, t0, 4, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG lw, a7, t0, 4, t4, INVOKE_STUB_LOAD_REG_SKIP_OFFSET, .Lfill_regs, \sfx
+
+// Handlers for loading reference args into GPRs.
+    .ifnc \sfx, _instance
+        INVOKE_STUB_LOAD_REG lwu, a1, t0, 4, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    .endif
+    INVOKE_STUB_LOAD_REG lwu, a2, t0, 4, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG lwu, a3, t0, 4, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG lwu, a4, t0, 4, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG lwu, a5, t0, 4, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG lwu, a6, t0, 4, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG lwu, a7, t0, 4, t4, INVOKE_STUB_LOAD_REG_SKIP_OFFSET, .Lfill_regs, \sfx
+
+// Handlers for loading long args into GPRs.
+    .ifnc \sfx, _instance
+        INVOKE_STUB_LOAD_REG ld, a1, t0, 8, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    .endif
+    INVOKE_STUB_LOAD_REG ld, a2, t0, 8, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG ld, a3, t0, 8, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG ld, a4, t0, 8, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG ld, a5, t0, 8, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG ld, a6, t0, 8, t4, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG ld, a7, t0, 8, t4, INVOKE_STUB_LOAD_REG_SKIP_OFFSET, .Lfill_regs, \sfx
 
 // Handlers for loading floats into FPRs.
-    INVOKE_STUB_LOAD_REG .Lload4f0, fa0, s3, 4, flw, t5, .Lload4f1, t6, .Lload8f1, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload4f1, fa1, s3, 4, flw, t5, .Lload4f2, t6, .Lload8f2, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload4f2, fa2, s3, 4, flw, t5, .Lload4f3, t6, .Lload8f3, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload4f3, fa3, s3, 4, flw, t5, .Lload4f4, t6, .Lload8f4, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload4f4, fa4, s3, 4, flw, t5, .Lload4f5, t6, .Lload8f5, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload4f5, fa5, s3, 4, flw, t5, .Lload4f6, t6, .Lload8f6, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload4f6, fa6, s3, 4, flw, t5, .Lload4f7, t6, .Lload8f7, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload4f7, fa7, s3, 4, flw, t5, .Lskip4, t6, .Lskip8, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG flw, fa0, t0, 4, t5, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG flw, fa1, t0, 4, t5, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG flw, fa2, t0, 4, t5, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG flw, fa3, t0, 4, t5, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG flw, fa4, t0, 4, t5, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG flw, fa5, t0, 4, t5, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG flw, fa6, t0, 4, t5, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG flw, fa7, t0, 4, t5, INVOKE_STUB_LOAD_REG_SKIP_OFFSET, .Lfill_regs, \sfx
 
 // Handlers for loading doubles into FPRs.
-    INVOKE_STUB_LOAD_REG .Lload8f0, fa0, s3, 8, fld, t5, .Lload4f1, t6, .Lload8f1, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload8f1, fa1, s3, 8, fld, t5, .Lload4f2, t6, .Lload8f2, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload8f2, fa2, s3, 8, fld, t5, .Lload4f3, t6, .Lload8f3, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload8f3, fa3, s3, 8, fld, t5, .Lload4f4, t6, .Lload8f4, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload8f4, fa4, s3, 8, fld, t5, .Lload4f5, t6, .Lload8f5, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload8f5, fa5, s3, 8, fld, t5, .Lload4f6, t6, .Lload8f6, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload8f6, fa6, s3, 8, fld, t5, .Lload4f7, t6, .Lload8f7, .Lfill_regs, \sfx
-    INVOKE_STUB_LOAD_REG .Lload8f7, fa7, s3, 8, fld, t5, .Lskip4, t6, .Lskip8, .Lfill_regs, \sfx
-
-// Handlers for skipping arguments that do not fit into registers.
-    INVOKE_STUB_SKIP_ARG .Lskip4, s3, 4, .Lfill_regs, \sfx
-    INVOKE_STUB_SKIP_ARG .Lskip8, s3, 8, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG fld, fa0, t0, 8, t5, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG fld, fa1, t0, 8, t5, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG fld, fa2, t0, 8, t5, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG fld, fa3, t0, 8, t5, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG fld, fa4, t0, 8, t5, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG fld, fa5, t0, 8, t5, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG fld, fa6, t0, 8, t5, INVOKE_STUB_LOAD_REG_SIZE, .Lfill_regs, \sfx
+    INVOKE_STUB_LOAD_REG fld, fa7, t0, 8, t5, INVOKE_STUB_LOAD_REG_SKIP_OFFSET, .Lfill_regs, \sfx
 
 .Lcall_method\sfx:
 .endm
@@ -318,7 +329,7 @@
     // Check for error (class init check or locking for synchronized native method can throw).
     beqz a0, .Lexception_in_native
 
-    mv   t0, a0       // save pointer to native method code into temporary
+    mv   t2, a0       // save pointer to native method code into temporary
 
     // Load argument GPRs from stack (saved there by artQuickGenericJniTrampoline).
     ld  a0, 8*0(sp)   // JniEnv* for the native method
@@ -340,12 +351,12 @@
     fld  fa6, 8*14(sp)
     fld  fa7, 8*15(sp)
 
-    ld  t6, 8*16(sp)  // @CriticalNative arg, used by art_jni_dlsym_lookup_critical_stub
+    ld  t0, 8*16(sp)  // @CriticalNative arg, used by art_jni_dlsym_lookup_critical_stub
 
     ld  t1, 8*17(sp)  // restore stack
     mv  sp, t1
 
-    jalr  t0  // call native method
+    jalr  t2  // call native method
 
     // result sign extension is handled in C code, prepare for artQuickGenericJniEndTrampoline call:
     // uint64_t artQuickGenericJniEndTrampoline(Thread* self,       // a0
@@ -362,7 +373,7 @@
 
     // Tear down the alloca.
     mv   sp, fp
-    .cfi_remember_state
+    CFI_REMEMBER_STATE
     .cfi_def_cfa_register sp
 
     LOAD_RUNTIME_INSTANCE a1
@@ -380,7 +391,7 @@
 .Lcall_method_exit_hook:
     fmv.d.x  fa0, a0
     li   a4, FRAME_SIZE_SAVE_REFS_AND_ARGS
-    jal  art_quick_method_exit_hook
+    call  art_quick_method_exit_hook
     j    .Lcall_method_exit_hook_done
 
 .Lexception_in_native:
@@ -409,10 +420,25 @@
 END art_quick_to_interpreter_bridge
 
 
+    .extern artMethodEntryHook
+ENTRY art_quick_method_entry_hook
+    SETUP_SAVE_EVERYTHING_FRAME
+
+    ld   a0, FRAME_SIZE_SAVE_EVERYTHING(sp)   // Pass ArtMethod*.
+    mv   a1, xSELF                            // Pass Thread::Current().
+    mv   a2, sp                               // pass SP
+    call artMethodEntryHook                   // (ArtMethod*, Thread*, SP)
+
+    RESTORE_SAVE_EVERYTHING_FRAME
+    ret
+END art_quick_method_entry_hook
+
+
     .extern artMethodExitHook
 ENTRY art_quick_method_exit_hook
     SETUP_SAVE_EVERYTHING_FRAME
 
+    // frame_size is passed in A4 from JITed code and `art_quick_generic_jni_trampoline`.
     addi a3, sp, SAVE_EVERYTHING_FRAME_OFFSET_FA0  // FP result ptr in kSaveEverything frame
     addi a2, sp, SAVE_EVERYTHING_FRAME_OFFSET_A0   // integer result ptr in kSaveEverything frame
     addi a1, sp, FRAME_SIZE_SAVE_EVERYTHING        // ArtMethod**
@@ -513,6 +539,114 @@
 END art_quick_do_long_jump
 
 
+.macro DEOPT_OR_RETURN temp, is_ref = 0
+    lwu   \temp, THREAD_DEOPT_CHECK_REQUIRED_OFFSET(xSELF)
+    bnez  \temp, 2f
+    ret
+2:
+    SETUP_SAVE_EVERYTHING_FRAME
+    li    a2, \is_ref                 // pass if result is a reference
+    mv    a1, a0                      // pass the result
+    mv    a0, xSELF                   // pass Thread::Current
+    call  artDeoptimizeIfNeeded       // (Thread*, uintptr_t, bool)
+    RESTORE_SAVE_EVERYTHING_FRAME
+    ret
+.endm
+
+
+.macro RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
+    beqz  a0, 1f
+    DEOPT_OR_RETURN a1, /*is_ref=*/ 1
+1:
+    DELIVER_PENDING_EXCEPTION
+.endm
+
+
+.macro RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
+    bnez  a0, 1f
+    DEOPT_OR_RETURN a1
+1:
+    DELIVER_PENDING_EXCEPTION
+.endm
+
+
+.macro RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION is_ref = 0
+    lwu   a1, THREAD_EXCEPTION_OFFSET(xSELF)   // Get exception field.
+    bnez  a1, 1f
+    DEOPT_OR_RETURN a1, \is_ref                // Check if deopt is required.
+1:
+    DELIVER_PENDING_EXCEPTION                  // Deliver exception on current thread.
+.endm
+
+
+.macro RETURN_REF_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+    RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION /* is_ref= */ 1
+.endm
+
+
+.macro DEOPT_OR_RESTORE_SAVE_EVERYTHING_FRAME_AND_RETURN_A0 temp, is_ref
+  ld      \temp, THREAD_DEOPT_CHECK_REQUIRED_OFFSET(xSELF)
+  CFI_REMEMBER_STATE
+  bnez    \temp, 2f
+  RESTORE_SAVE_EVERYTHING_FRAME /* load_a0= */ 0
+  ret
+2:
+  CFI_RESTORE_STATE_AND_DEF_CFA sp, FRAME_SIZE_SAVE_EVERYTHING
+  sd      a0, SAVE_EVERYTHING_FRAME_OFFSET_A0(sp)    // update result in the frame
+  li      a2, \is_ref                                // pass if result is a reference
+  mv      a1, a0                                     // pass the result
+  mv      a0, xSELF                                  // Thread::Current
+  call    artDeoptimizeIfNeeded
+  CFI_REMEMBER_STATE
+  RESTORE_SAVE_EVERYTHING_FRAME
+  ret
+  CFI_RESTORE_STATE_AND_DEF_CFA sp, FRAME_SIZE_SAVE_EVERYTHING
+.endm
+
+
+// Entry from managed code that tries to lock the object in a fast path and
+// calls `artLockObjectFromCode()` for the difficult cases, may block for GC.
+// A0 holds the possibly null object to lock.
+ENTRY art_quick_lock_object
+    LOCK_OBJECT_FAST_PATH a0, art_quick_lock_object_no_inline, /*can_be_null*/ 1
+END art_quick_lock_object
+
+
+// Entry from managed code that calls `artLockObjectFromCode()`, may block for GC.
+// A0 holds the possibly null object to lock.
+    .extern artLockObjectFromCode
+ENTRY art_quick_lock_object_no_inline
+    // This is also the slow path for `art_quick_lock_object`.
+    SETUP_SAVE_REFS_ONLY_FRAME        // save callee saves in case we block
+    mv    a1, xSELF                   // pass Thread::Current
+    call  artLockObjectFromCode       // (Object*, Thread*)
+    RESTORE_SAVE_REFS_ONLY_FRAME
+    RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
+END art_quick_lock_object_no_inline
+
+
+// Entry from managed code that tries to unlock the object in a fast path and calls
+// `artUnlockObjectFromCode()` for the difficult cases and delivers exception on failure.
+// A0 holds the possibly null object to unlock.
+ENTRY art_quick_unlock_object
+    UNLOCK_OBJECT_FAST_PATH a0, art_quick_unlock_object_no_inline, /*can_be_null*/ 1
+END art_quick_unlock_object
+
+
+// Entry from managed code that calls `artUnlockObjectFromCode()`
+// and delivers exception on failure.
+// A0 holds the possibly null object to unlock.
+    .extern artUnlockObjectFromCode
+ENTRY art_quick_unlock_object_no_inline
+    // This is also the slow path for `art_quick_unlock_object`.
+    SETUP_SAVE_REFS_ONLY_FRAME        // save callee saves in case exception allocation triggers GC
+    mv    a1, xSELF                   // pass Thread::Current
+    call  artUnlockObjectFromCode     // (Object*, Thread*)
+    RESTORE_SAVE_REFS_ONLY_FRAME
+    RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
+END art_quick_unlock_object_no_inline
+
+
 // Called by managed code that is attempting to call a method on a proxy class. On entry a0 holds
 // the proxy method and a1 holds the receiver. The frame size of the invoked proxy method agrees
 // with kSaveRefsAndArgs frame.
@@ -530,7 +664,7 @@
 
     ld    a2, THREAD_EXCEPTION_OFFSET(xSELF)
     bnez  a2, .Lexception_in_proxy    // success if no exception is pending
-    .cfi_remember_state
+    CFI_REMEMBER_STATE
     RESTORE_SAVE_REFS_AND_ARGS_FRAME  // Restore frame
     fmv.d.x  fa0, a0                  // Store result in fa0 in case it was float or double
     ret                               // return on success
@@ -542,16 +676,155 @@
 END art_quick_proxy_invoke_handler
 
 
-.macro ONE_ARG_RUNTIME_EXCEPTION c_name, cxx_name
+// Compiled code has requested that we deoptimize into the interpreter. The deoptimization
+// will long jump to the upcall with a special exception of -1.
+    .extern artDeoptimizeFromCompiledCode
+ENTRY art_quick_deoptimize_from_compiled_code
+    SETUP_SAVE_EVERYTHING_FRAME
+    mv    a1, xSELF                           // Pass Thread::Current().
+    call  artDeoptimizeFromCompiledCode       // (DeoptimizationKind, Thread*)
+    unimp
+END art_quick_deoptimize_from_compiled_code
+
+
+    .extern artStringBuilderAppend
+ENTRY art_quick_string_builder_append
+    SETUP_SAVE_REFS_ONLY_FRAME                // Save callee saves in case of GC.
+    addi  a1, sp, (FRAME_SIZE_SAVE_REFS_ONLY + __SIZEOF_POINTER__)  // Pass args.
+    mv    a2, xSELF                           // Pass Thread::Current().
+    call  artStringBuilderAppend              // (uint32_t, const unit32_t*, Thread*)
+    RESTORE_SAVE_REFS_ONLY_FRAME
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
+END art_quick_string_builder_append
+
+
+// Entry from managed code that calls artInstanceOfFromCode and on failure calls
+// artThrowClassCastExceptionForObject.
+    .extern artInstanceOfFromCode
+    .extern artThrowClassCastExceptionForObject
+ENTRY art_quick_check_instance_of
+    // Type check using the bit string passes null as the target class. In that case just throw.
+    beqz  a1, .Lthrow_class_cast_exception_for_bitstring_check
+
+    // Store arguments and return address register.
+    // Stack needs to be 16B aligned on calls.
+    INCREASE_FRAME 32
+    sd    a0, 0*8(sp)
+    sd    a1, 1*8(sp)
+    SAVE_GPR ra, 3*8
+
+    // Call runtime code.
+    call  artInstanceOfFromCode
+
+    // Restore RA.
+    RESTORE_GPR ra, 3*8
+
+    // Check for exception.
+    CFI_REMEMBER_STATE
+    beqz a0, .Lthrow_class_cast_exception
+
+    // Remove spill area and return (no need to restore A0 and A1).
+    DECREASE_FRAME 32
+    ret
+
+.Lthrow_class_cast_exception:
+    CFI_RESTORE_STATE_AND_DEF_CFA sp, 32
+    // Restore A0 and remove spill area.
+    ld    a0, 0*8(sp)
+    ld    a1, 1*8(sp)
+    DECREASE_FRAME 32
+
+.Lthrow_class_cast_exception_for_bitstring_check:
+    SETUP_SAVE_ALL_CALLEE_SAVES_FRAME         // Save all registers as basis for long jump context.
+    mv    a2, xSELF                           // Pass Thread::Current().
+    call  artThrowClassCastExceptionForObject // (Object*, Class*, Thread*)
+    unimp                                     // We should not return here...
+END art_quick_check_instance_of
+
+
+.macro N_ARG_RUNTIME_EXCEPTION_SAVE_EVERYTHING n, c_name, cxx_name
+.extern \cxx_name
+ENTRY \c_name
+    SETUP_SAVE_EVERYTHING_FRAME       // save all registers as basis for long jump context.
+    mv    a\n, xSELF                  // pass Thread::Current.
+    call  \cxx_name                   // \cxx_name(args..., Thread*).
+    unimp
+END \c_name
+.endm
+
+
+.macro NO_ARG_RUNTIME_EXCEPTION_SAVE_EVERYTHING c_name, cxx_name
+    N_ARG_RUNTIME_EXCEPTION_SAVE_EVERYTHING 0, \c_name, \cxx_name
+.endm
+
+
+.macro TWO_ARG_RUNTIME_EXCEPTION_SAVE_EVERYTHING c_name, cxx_name
+    N_ARG_RUNTIME_EXCEPTION_SAVE_EVERYTHING 2, \c_name, \cxx_name
+.endm
+
+
+.macro N_ARG_RUNTIME_EXCEPTION n, c_name, cxx_name
 .extern \cxx_name
 ENTRY \c_name
     SETUP_SAVE_ALL_CALLEE_SAVES_FRAME // save all registers as basis for long jump context.
-    mv  a1, xSELF                     // pass Thread::Current.
-    jal \cxx_name                     // \cxx_name(arg, Thread*).
-    ebreak
+    mv    a\n, xSELF                  // pass Thread::Current.
+    call  \cxx_name                   // \cxx_name(args..., Thread*).
+    unimp
 END \c_name
 .endm
 
+.macro NO_ARG_RUNTIME_EXCEPTION c_name, cxx_name
+    N_ARG_RUNTIME_EXCEPTION 0, \c_name, \cxx_name
+.endm
+
+
+.macro ONE_ARG_RUNTIME_EXCEPTION c_name, cxx_name
+    N_ARG_RUNTIME_EXCEPTION 1, \c_name, \cxx_name
+.endm
+
+
+// Called by managed code to create and deliver a NullPointerException.
+NO_ARG_RUNTIME_EXCEPTION_SAVE_EVERYTHING \
+        art_quick_throw_null_pointer_exception, artThrowNullPointerExceptionFromCode
+
+
+// Call installed by a signal handler to create and deliver a NullPointerException.
+.extern artThrowNullPointerExceptionFromSignal
+ENTRY art_quick_throw_null_pointer_exception_from_signal
+    // The fault handler pushes the gc map address, i.e. "return address", to stack
+    // and passes the fault address in RA. So we need to set up the CFI info accordingly.
+    .cfi_def_cfa_offset __SIZEOF_POINTER__
+    .cfi_rel_offset ra, 0
+    // Save all registers as basis for long jump context.
+    INCREASE_FRAME (FRAME_SIZE_SAVE_EVERYTHING - __SIZEOF_POINTER__)
+    SETUP_SAVE_EVERYTHING_FRAME_DECREMENTED_SP_SKIP_RA
+    mv    a0, ra                      // pass the fault address stored in RA by the fault handler.
+    mv    a1, xSELF                   // pass Thread::Current.
+    call  artThrowNullPointerExceptionFromSignal  // (arg, Thread*).
+    unimp
+END art_quick_throw_null_pointer_exception_from_signal
+
+
+// Called by managed code to deliver an ArithmeticException.
+NO_ARG_RUNTIME_EXCEPTION_SAVE_EVERYTHING art_quick_throw_div_zero, artThrowDivZeroFromCode
+
+
+// Called by managed code to create and deliver an ArrayIndexOutOfBoundsException.
+// Arg0 holds index, arg1 holds limit.
+TWO_ARG_RUNTIME_EXCEPTION_SAVE_EVERYTHING art_quick_throw_array_bounds, artThrowArrayBoundsFromCode
+
+
+// Called by managed code to create and deliver a StringIndexOutOfBoundsException
+// as if thrown from a call to String.charAt(). Arg0 holds index, arg1 holds limit.
+TWO_ARG_RUNTIME_EXCEPTION_SAVE_EVERYTHING \
+        art_quick_throw_string_bounds, artThrowStringBoundsFromCode
+
+// Called by managed code to create and deliver a StackOverflowError.
+NO_ARG_RUNTIME_EXCEPTION art_quick_throw_stack_overflow, artThrowStackOverflowFromCode
+
+// Called by managed code to deliver an exception.
+ONE_ARG_RUNTIME_EXCEPTION art_quick_deliver_exception, artDeliverExceptionFromCode
+
 
 // Called to attempt to execute an obsolete method.
 ONE_ARG_RUNTIME_EXCEPTION art_invoke_obsolete_method_stub, artInvokeObsoleteMethod
@@ -567,9 +840,8 @@
     mv   a2, xSELF
     mv   a3, sp
     call artQuickResolutionTrampoline
-
+    CFI_REMEMBER_STATE
     beqz a0, 1f
-    .cfi_remember_state
     mv   t0, a0    // Remember returned code pointer in t0.
     ld   a0, (sp)  // artQuickResolutionTrampoline puts called method in *sp.
 
@@ -582,208 +854,1131 @@
 END art_quick_resolution_trampoline
 
 
-UNDEFINED art_quick_imt_conflict_trampoline
-UNDEFINED art_quick_deoptimize_from_compiled_code
-UNDEFINED art_quick_string_builder_append
-UNDEFINED art_quick_compile_optimized
-UNDEFINED art_quick_method_entry_hook
-UNDEFINED art_quick_check_instance_of
-UNDEFINED art_quick_osr_stub
+ENTRY art_quick_test_suspend
+    SETUP_SAVE_EVERYTHING_FRAME \
+        RUNTIME_SAVE_EVERYTHING_FOR_SUSPEND_CHECK_METHOD_OFFSET
+    mv   a0, xSELF
+    call artTestSuspendFromCode
+    RESTORE_SAVE_EVERYTHING_FRAME
+    ret
+END art_quick_test_suspend
 
-UNDEFINED art_quick_alloc_array_resolved_dlmalloc
-UNDEFINED art_quick_alloc_array_resolved_dlmalloc_instrumented
-UNDEFINED art_quick_alloc_array_resolved8_dlmalloc
-UNDEFINED art_quick_alloc_array_resolved8_dlmalloc_instrumented
-UNDEFINED art_quick_alloc_array_resolved16_dlmalloc
-UNDEFINED art_quick_alloc_array_resolved16_dlmalloc_instrumented
-UNDEFINED art_quick_alloc_array_resolved32_dlmalloc
-UNDEFINED art_quick_alloc_array_resolved32_dlmalloc_instrumented
-UNDEFINED art_quick_alloc_array_resolved64_dlmalloc
-UNDEFINED art_quick_alloc_array_resolved64_dlmalloc_instrumented
-UNDEFINED art_quick_alloc_object_resolved_dlmalloc
-UNDEFINED art_quick_alloc_object_resolved_dlmalloc_instrumented
-UNDEFINED art_quick_alloc_object_initialized_dlmalloc
-UNDEFINED art_quick_alloc_object_initialized_dlmalloc_instrumented
-UNDEFINED art_quick_alloc_object_with_checks_dlmalloc
-UNDEFINED art_quick_alloc_object_with_checks_dlmalloc_instrumented
-UNDEFINED art_quick_alloc_string_object_dlmalloc
-UNDEFINED art_quick_alloc_string_object_dlmalloc_instrumented
-UNDEFINED art_quick_alloc_string_from_bytes_dlmalloc
-UNDEFINED art_quick_alloc_string_from_bytes_dlmalloc_instrumented
-UNDEFINED art_quick_alloc_string_from_chars_dlmalloc
-UNDEFINED art_quick_alloc_string_from_chars_dlmalloc_instrumented
-UNDEFINED art_quick_alloc_string_from_string_dlmalloc
-UNDEFINED art_quick_alloc_string_from_string_dlmalloc_instrumented
-UNDEFINED art_quick_alloc_array_resolved_rosalloc
-UNDEFINED art_quick_alloc_array_resolved_rosalloc_instrumented
-UNDEFINED art_quick_alloc_array_resolved8_rosalloc
-UNDEFINED art_quick_alloc_array_resolved8_rosalloc_instrumented
-UNDEFINED art_quick_alloc_array_resolved16_rosalloc
-UNDEFINED art_quick_alloc_array_resolved16_rosalloc_instrumented
-UNDEFINED art_quick_alloc_array_resolved32_rosalloc
-UNDEFINED art_quick_alloc_array_resolved32_rosalloc_instrumented
-UNDEFINED art_quick_alloc_array_resolved64_rosalloc
-UNDEFINED art_quick_alloc_array_resolved64_rosalloc_instrumented
-UNDEFINED art_quick_alloc_object_resolved_rosalloc
-UNDEFINED art_quick_alloc_object_resolved_rosalloc_instrumented
-UNDEFINED art_quick_alloc_object_initialized_rosalloc
-UNDEFINED art_quick_alloc_object_initialized_rosalloc_instrumented
-UNDEFINED art_quick_alloc_object_with_checks_rosalloc
-UNDEFINED art_quick_alloc_object_with_checks_rosalloc_instrumented
-UNDEFINED art_quick_alloc_string_object_rosalloc
-UNDEFINED art_quick_alloc_string_object_rosalloc_instrumented
-UNDEFINED art_quick_alloc_string_from_bytes_rosalloc
-UNDEFINED art_quick_alloc_string_from_bytes_rosalloc_instrumented
-UNDEFINED art_quick_alloc_string_from_chars_rosalloc
-UNDEFINED art_quick_alloc_string_from_chars_rosalloc_instrumented
-UNDEFINED art_quick_alloc_string_from_string_rosalloc
-UNDEFINED art_quick_alloc_string_from_string_rosalloc_instrumented
-UNDEFINED art_quick_alloc_array_resolved_bump_pointer
-UNDEFINED art_quick_alloc_array_resolved_bump_pointer_instrumented
-UNDEFINED art_quick_alloc_array_resolved8_bump_pointer
-UNDEFINED art_quick_alloc_array_resolved8_bump_pointer_instrumented
-UNDEFINED art_quick_alloc_array_resolved16_bump_pointer
-UNDEFINED art_quick_alloc_array_resolved16_bump_pointer_instrumented
-UNDEFINED art_quick_alloc_array_resolved32_bump_pointer
-UNDEFINED art_quick_alloc_array_resolved32_bump_pointer_instrumented
-UNDEFINED art_quick_alloc_array_resolved64_bump_pointer
-UNDEFINED art_quick_alloc_array_resolved64_bump_pointer_instrumented
-UNDEFINED art_quick_alloc_object_resolved_bump_pointer
-UNDEFINED art_quick_alloc_object_resolved_bump_pointer_instrumented
-UNDEFINED art_quick_alloc_object_initialized_bump_pointer
-UNDEFINED art_quick_alloc_object_initialized_bump_pointer_instrumented
-UNDEFINED art_quick_alloc_object_with_checks_bump_pointer
-UNDEFINED art_quick_alloc_object_with_checks_bump_pointer_instrumented
-UNDEFINED art_quick_alloc_string_object_bump_pointer
-UNDEFINED art_quick_alloc_string_object_bump_pointer_instrumented
-UNDEFINED art_quick_alloc_string_from_bytes_bump_pointer
-UNDEFINED art_quick_alloc_string_from_bytes_bump_pointer_instrumented
-UNDEFINED art_quick_alloc_string_from_chars_bump_pointer
-UNDEFINED art_quick_alloc_string_from_chars_bump_pointer_instrumented
-UNDEFINED art_quick_alloc_string_from_string_bump_pointer
-UNDEFINED art_quick_alloc_string_from_string_bump_pointer_instrumented
-UNDEFINED art_quick_alloc_array_resolved_tlab
-UNDEFINED art_quick_alloc_array_resolved_tlab_instrumented
-UNDEFINED art_quick_alloc_array_resolved8_tlab
-UNDEFINED art_quick_alloc_array_resolved8_tlab_instrumented
-UNDEFINED art_quick_alloc_array_resolved16_tlab
-UNDEFINED art_quick_alloc_array_resolved16_tlab_instrumented
-UNDEFINED art_quick_alloc_array_resolved32_tlab
-UNDEFINED art_quick_alloc_array_resolved32_tlab_instrumented
-UNDEFINED art_quick_alloc_array_resolved64_tlab
-UNDEFINED art_quick_alloc_array_resolved64_tlab_instrumented
-UNDEFINED art_quick_alloc_object_resolved_tlab
-UNDEFINED art_quick_alloc_object_resolved_tlab_instrumented
-UNDEFINED art_quick_alloc_object_initialized_tlab
-UNDEFINED art_quick_alloc_object_initialized_tlab_instrumented
-UNDEFINED art_quick_alloc_object_with_checks_tlab
-UNDEFINED art_quick_alloc_object_with_checks_tlab_instrumented
-UNDEFINED art_quick_alloc_string_object_tlab
-UNDEFINED art_quick_alloc_string_object_tlab_instrumented
-UNDEFINED art_quick_alloc_string_from_bytes_tlab
-UNDEFINED art_quick_alloc_string_from_bytes_tlab_instrumented
-UNDEFINED art_quick_alloc_string_from_chars_tlab
-UNDEFINED art_quick_alloc_string_from_chars_tlab_instrumented
-UNDEFINED art_quick_alloc_string_from_string_tlab
-UNDEFINED art_quick_alloc_string_from_string_tlab_instrumented
-UNDEFINED art_quick_alloc_array_resolved_region
-UNDEFINED art_quick_alloc_array_resolved_region_instrumented
-UNDEFINED art_quick_alloc_array_resolved8_region
-UNDEFINED art_quick_alloc_array_resolved8_region_instrumented
-UNDEFINED art_quick_alloc_array_resolved16_region
-UNDEFINED art_quick_alloc_array_resolved16_region_instrumented
-UNDEFINED art_quick_alloc_array_resolved32_region
-UNDEFINED art_quick_alloc_array_resolved32_region_instrumented
-UNDEFINED art_quick_alloc_array_resolved64_region
-UNDEFINED art_quick_alloc_array_resolved64_region_instrumented
-UNDEFINED art_quick_alloc_object_resolved_region
-UNDEFINED art_quick_alloc_object_resolved_region_instrumented
-UNDEFINED art_quick_alloc_object_initialized_region
-UNDEFINED art_quick_alloc_object_initialized_region_instrumented
-UNDEFINED art_quick_alloc_object_with_checks_region
-UNDEFINED art_quick_alloc_object_with_checks_region_instrumented
-UNDEFINED art_quick_alloc_string_object_region
-UNDEFINED art_quick_alloc_string_object_region_instrumented
-UNDEFINED art_quick_alloc_string_from_bytes_region
-UNDEFINED art_quick_alloc_string_from_bytes_region_instrumented
-UNDEFINED art_quick_alloc_string_from_chars_region
-UNDEFINED art_quick_alloc_string_from_chars_region_instrumented
-UNDEFINED art_quick_alloc_string_from_string_region
-UNDEFINED art_quick_alloc_string_from_string_region_instrumented
-UNDEFINED art_quick_alloc_array_resolved_region_tlab
-UNDEFINED art_quick_alloc_array_resolved_region_tlab_instrumented
-UNDEFINED art_quick_alloc_array_resolved8_region_tlab
-UNDEFINED art_quick_alloc_array_resolved8_region_tlab_instrumented
-UNDEFINED art_quick_alloc_array_resolved16_region_tlab
-UNDEFINED art_quick_alloc_array_resolved16_region_tlab_instrumented
-UNDEFINED art_quick_alloc_array_resolved32_region_tlab
-UNDEFINED art_quick_alloc_array_resolved32_region_tlab_instrumented
-UNDEFINED art_quick_alloc_array_resolved64_region_tlab
-UNDEFINED art_quick_alloc_array_resolved64_region_tlab_instrumented
-UNDEFINED art_quick_alloc_object_resolved_region_tlab
-UNDEFINED art_quick_alloc_object_resolved_region_tlab_instrumented
-UNDEFINED art_quick_alloc_object_initialized_region_tlab
-UNDEFINED art_quick_alloc_object_initialized_region_tlab_instrumented
-UNDEFINED art_quick_alloc_object_with_checks_region_tlab
-UNDEFINED art_quick_alloc_object_with_checks_region_tlab_instrumented
-UNDEFINED art_quick_alloc_string_object_region_tlab
-UNDEFINED art_quick_alloc_string_object_region_tlab_instrumented
-UNDEFINED art_quick_alloc_string_from_bytes_region_tlab
-UNDEFINED art_quick_alloc_string_from_bytes_region_tlab_instrumented
-UNDEFINED art_quick_alloc_string_from_chars_region_tlab
-UNDEFINED art_quick_alloc_string_from_chars_region_tlab_instrumented
-UNDEFINED art_quick_alloc_string_from_string_region_tlab
-UNDEFINED art_quick_alloc_string_from_string_region_tlab_instrumented
-UNDEFINED art_quick_initialize_static_storage
-UNDEFINED art_quick_resolve_type_and_verify_access
-UNDEFINED art_quick_resolve_type
-UNDEFINED art_quick_resolve_method_handle
-UNDEFINED art_quick_resolve_method_type
-UNDEFINED art_quick_resolve_string
-UNDEFINED art_quick_set8_instance
-UNDEFINED art_quick_set8_static
-UNDEFINED art_quick_set16_instance
-UNDEFINED art_quick_set16_static
-UNDEFINED art_quick_set32_instance
-UNDEFINED art_quick_set32_static
-UNDEFINED art_quick_set64_instance
-UNDEFINED art_quick_set64_static
-UNDEFINED art_quick_set_obj_instance
-UNDEFINED art_quick_set_obj_static
-UNDEFINED art_quick_get_byte_instance
-UNDEFINED art_quick_get_boolean_instance
-UNDEFINED art_quick_get_short_instance
-UNDEFINED art_quick_get_char_instance
-UNDEFINED art_quick_get32_instance
-UNDEFINED art_quick_get64_instance
-UNDEFINED art_quick_get_obj_instance
-UNDEFINED art_quick_get_byte_static
-UNDEFINED art_quick_get_boolean_static
-UNDEFINED art_quick_get_short_static
-UNDEFINED art_quick_get_char_static
-UNDEFINED art_quick_get32_static
-UNDEFINED art_quick_get64_static
-UNDEFINED art_quick_get_obj_static
-UNDEFINED art_quick_aput_obj
-UNDEFINED art_quick_lock_object_no_inline
-UNDEFINED art_quick_lock_object
-UNDEFINED art_quick_unlock_object_no_inline
-UNDEFINED art_quick_unlock_object
-UNDEFINED art_quick_invoke_direct_trampoline_with_access_check
-UNDEFINED art_quick_invoke_interface_trampoline_with_access_check
-UNDEFINED art_quick_invoke_static_trampoline_with_access_check
-UNDEFINED art_quick_invoke_super_trampoline_with_access_check
-UNDEFINED art_quick_invoke_virtual_trampoline_with_access_check
-UNDEFINED art_quick_invoke_polymorphic
-UNDEFINED art_quick_invoke_custom
-UNDEFINED art_quick_test_suspend
-UNDEFINED art_quick_deliver_exception
-UNDEFINED art_quick_throw_array_bounds
-UNDEFINED art_quick_throw_div_zero
-UNDEFINED art_quick_throw_null_pointer_exception
-UNDEFINED art_quick_throw_stack_overflow
-UNDEFINED art_quick_throw_string_bounds
-UNDEFINED art_quick_update_inline_cache
-UNDEFINED art_jni_monitored_method_start
-UNDEFINED art_jni_monitored_method_end
-UNDEFINED art_quick_indexof
+
+ENTRY art_quick_compile_optimized
+    SETUP_SAVE_EVERYTHING_FRAME
+    ld   a0, FRAME_SIZE_SAVE_EVERYTHING(sp)   // pass ArtMethod
+    mv   a1, xSELF                            // pass Thread::Current
+    call artCompileOptimized                  // (ArtMethod*, Thread*)
+    RESTORE_SAVE_EVERYTHING_FRAME
+    // Note: If we implement implicit suspend checks or a marking register for GC, we don't need
+    // to restore such registers here, as artCompileOptimized doesn't allow thread suspension.
+    ret
+END art_quick_compile_optimized
+
+
+/*  extern"C" void art_quick_osr_stub(void*          stack,                 A0
+ *                                    size_t         stack_size_in_bytes,   A1
+ *                                    const uint8_t* native_pc,             A2
+ *                                    JValue*        result,                A3
+ *                                    char*          shorty,                A4
+ *                                    Thread*        self)                  A5
+ */
+ENTRY art_quick_osr_stub
+    // Save all callee-save registers (we do not fill the spill area in the OSR frame, so we
+    // need to preserve them here) and A3 (it will be needed after the OSR method returns).
+    // Also add space for the `ArtMethod*` slot (null to indicate transition) and padding.
+    SAVE_SIZE=(12 + 12 + /* RA */ 1 + /* A3 */ 1 + /* ArtMethod* */ 1 + /* padding */ 1) * 8
+    INCREASE_FRAME SAVE_SIZE
+    sd zero, 0*8(sp)          // Store null to the `ArtMethod*` slot to indicate transition.
+                              // Skip padding.
+    SAVE_GPR a3, 2*8          // Save `result`.
+    SAVE_FPR fs0, 3*8
+    SAVE_FPR fs1, 4*8
+    SAVE_FPR fs2, 5*8
+    SAVE_FPR fs3, 6*8
+    SAVE_FPR fs4, 7*8
+    SAVE_FPR fs5, 8*8
+    SAVE_FPR fs6, 9*8
+    SAVE_FPR fs7, 10*8
+    SAVE_FPR fs8, 11*8
+    SAVE_FPR fs9, 12*8
+    SAVE_FPR fs10, 13*8
+    SAVE_FPR fs11, 14*8
+    SAVE_GPR s2, 15*8
+    SAVE_GPR s3, 16*8
+    SAVE_GPR s4, 17*8
+    SAVE_GPR s5, 18*8
+    SAVE_GPR s6, 19*8
+    SAVE_GPR s7, 20*8
+    SAVE_GPR s8, 21*8
+    SAVE_GPR s9, 22*8
+    SAVE_GPR s10, 23*8
+    SAVE_GPR s11, 24*8
+    SAVE_GPR xSELF, 25*8       // Save xSELF/S1.
+    SAVE_GPR fp, 26*8          // Save FP/S0.
+    SAVE_GPR ra, 27*8          // Save return address.
+
+    // Make the new FP point to the location where we stored the old FP.
+    // Some stack-walking tools may rely on this simply-linked list of saved FPs.
+    addi fp, sp, (26*8)  // save frame pointer
+    .cfi_def_cfa fp, SAVE_SIZE - (26*8)
+
+    mv   xSELF, a5
+
+    CFI_REMEMBER_STATE
+    jal .Losr_entry
+
+    // The called method removes the stack frame created in `.Losr_entry`.
+    // The SP is already correctly restored, we do not need to restore it from FP.
+    .cfi_def_cfa sp, SAVE_SIZE
+
+    // Restore saved registers including the result address.
+    RESTORE_GPR a3, 2*8       // Restore `result`.
+    RESTORE_FPR fs0, 3*8
+    RESTORE_FPR fs1, 4*8
+    RESTORE_FPR fs2, 5*8
+    RESTORE_FPR fs3, 6*8
+    RESTORE_FPR fs4, 7*8
+    RESTORE_FPR fs5, 8*8
+    RESTORE_FPR fs6, 9*8
+    RESTORE_FPR fs7, 10*8
+    RESTORE_FPR fs8, 11*8
+    RESTORE_FPR fs9, 12*8
+    RESTORE_FPR fs10, 13*8
+    RESTORE_FPR fs11, 14*8
+    RESTORE_GPR s2, 15*8
+    RESTORE_GPR s3, 16*8
+    RESTORE_GPR s4, 17*8
+    RESTORE_GPR s5, 18*8
+    RESTORE_GPR s6, 19*8
+    RESTORE_GPR s7, 20*8
+    RESTORE_GPR s8, 21*8
+    RESTORE_GPR s9, 22*8
+    RESTORE_GPR s10, 23*8
+    RESTORE_GPR s11, 24*8
+    RESTORE_GPR xSELF, 25*8   // Restore xSELF/S1.
+    RESTORE_GPR fp, 26*8      // Restore FP/S0.
+    RESTORE_GPR ra, 27*8      // Restore return address.
+    DECREASE_FRAME SAVE_SIZE
+
+    // The compiler put the result in A0. Doesn't matter if it is 64 or 32 bits.
+    sd   a0, (a3)
+    ret
+
+.Losr_entry:
+    CFI_RESTORE_STATE_AND_DEF_CFA fp, SAVE_SIZE - (26*8)
+
+    // Prepare the destination register for backward copy of arguments.
+    addi t1, sp, -8
+
+    // Update stack pointer for the callee frame.
+    sub  sp, sp, a1
+
+    // Subtract the return address slot size from args size.
+    addi a1, a1, -8
+
+    // Update return address slot expected by the callee.
+    sd   ra, (t1)
+
+    // Prepare the source register for backward copy of arguments.
+    add  t0, a0, a1
+
+    // Copy arguments into stack frame. Use simple backward-copy routine for now.
+    // There is always at least the `ArtMethod*` to to copy.
+    // A0 - source address
+    // A1 - args length
+    // SP - destination address.
+    // T0 - loop variable initialized to A0 + A1 for backward copy
+    // T1 - loop variable initialized to SP + A1 for backward copy
+    // T2 - temporary for holding the copied value
+.Losr_loop:
+    addi t0, t0, -8
+    ld   t2, (t0)
+    addi t1, t1, -8
+    sd   t2, (t1)
+    bne  t1, sp, .Losr_loop
+
+    // Branch to the OSR entry point.
+    jr   a2
+
+END art_quick_osr_stub
+
+
+    /*
+     * All generated callsites for interface invokes and invocation slow paths will load arguments
+     * as usual - except instead of loading arg0/A0 with the target Method*, arg0/A0 will contain
+     * the method_idx. This wrapper will call the appropriate C++ helper while preserving arguments
+     * and allowing a moving GC to update references in callee-save registers.
+     * NOTE: "this" is the first visible argument of the target, and so can be found in arg1/A1.
+     *
+     * The helper will attempt to locate the target and return a 128-bit result consisting of the
+     * target `ArtMethod*` in A0 and its `entry_point_from_quick_compiled_code_` in A1.
+     *
+     * If unsuccessful, the helper will return null/null. There will be a pending exception
+     * to deliver in the thread.
+     *
+     * On success this wrapper will restore arguments and *jump* to the target, leaving the RA
+     * pointing back to the original caller.
+     */
+.macro INVOKE_TRAMPOLINE_BODY cxx_name
+    .extern \cxx_name
+    SETUP_SAVE_REFS_AND_ARGS_FRAME
+    mv    a2, xSELF                           // Pass Thread::Current().
+    mv    a3, sp                              // Pass pointer to the saved frame context.
+    call   \cxx_name                          // (method_idx, this, Thread*, $sp)
+    mv    t0, a1                              // Save method's code pointer in T0.
+    RESTORE_SAVE_REFS_AND_ARGS_FRAME
+    beq   a0, zero, 1f
+    jr    t0
+1:
+    DELIVER_PENDING_EXCEPTION
+.endm
+
+.macro INVOKE_TRAMPOLINE c_name, cxx_name
+ENTRY \c_name
+    INVOKE_TRAMPOLINE_BODY \cxx_name
+END \c_name
+.endm
+
+INVOKE_TRAMPOLINE art_quick_invoke_interface_trampoline_with_access_check, \
+                  artInvokeInterfaceTrampolineWithAccessCheck
+INVOKE_TRAMPOLINE art_quick_invoke_static_trampoline_with_access_check, \
+                  artInvokeStaticTrampolineWithAccessCheck
+INVOKE_TRAMPOLINE art_quick_invoke_direct_trampoline_with_access_check, \
+                  artInvokeDirectTrampolineWithAccessCheck
+INVOKE_TRAMPOLINE art_quick_invoke_super_trampoline_with_access_check, \
+                  artInvokeSuperTrampolineWithAccessCheck
+INVOKE_TRAMPOLINE art_quick_invoke_virtual_trampoline_with_access_check, \
+                  artInvokeVirtualTrampolineWithAccessCheck
+
+    /*
+     * Polymorphic method invocation.
+     * On entry:
+     *   A0 = unused
+     *   A1 = receiver
+     */
+.extern artInvokePolymorphic
+ENTRY art_quick_invoke_polymorphic
+    SETUP_SAVE_REFS_AND_ARGS_FRAME
+    mv      a0, a1                            // Pass the receiver.
+    mv      a1, xSELF                         // Pass Thread::Current().
+    mv      a2, sp                            // Pass pointer to the saved frame context.
+    call    artInvokePolymorphic              // artInvokePolymorphic(receiver, Thread*, context)
+    RESTORE_SAVE_REFS_AND_ARGS_FRAME
+    fmv.d.x fa0, a0                           // Copy the result also to the FP return register.
+    RETURN_OR_DELIVER_PENDING_EXCEPTION_REG  t0
+END art_quick_invoke_polymorphic
+
+/*
+     * InvokeCustom invocation.
+     * On entry:
+     *   A0 = call_site_idx
+     */
+.extern artInvokeCustom
+ENTRY art_quick_invoke_custom
+    SETUP_SAVE_REFS_AND_ARGS_FRAME
+    mv      a1, xSELF                         // Pass Thread::Current().
+    mv      a2, sp                            // Pass pointer to the saved frame context.
+    call    artInvokeCustom                   // artInvokeCustom(call_site_idx, Thread*, context)
+    RESTORE_SAVE_REFS_AND_ARGS_FRAME
+    fmv.d.x fa0, a0                           // Copy the result also to the FP return register.
+    RETURN_OR_DELIVER_PENDING_EXCEPTION_REG t0
+END art_quick_invoke_custom
+
+    /*
+     * Called to resolve an imt conflict.
+     * On entry:
+     *   A0 is the conflict ArtMethod.
+     *   T0 is a hidden argument that holds the target interface method's dex method index.
+     */
+ENTRY art_quick_imt_conflict_trampoline
+    ld      t1, ART_METHOD_JNI_OFFSET_64(a0)  // Load ImtConflictTable
+    ld      a0, 0(t1)                         // Load first entry in ImtConflictTable.
+.Limt_table_iterate:
+    // Branch if found.
+    beq     a0, t0, .Limt_table_found
+
+    // If the entry is null, the interface method is not in the ImtConflictTable.
+    beqz    a0, .Lconflict_trampoline
+    // Iterate over the entries of the ImtConflictTable.
+    addi    t1, t1, (2 * __SIZEOF_POINTER__)
+    ld      a0, 0(t1)
+    j       .Limt_table_iterate
+.Limt_table_found:
+    // We successfully hit an entry in the table. Load the target method and jump to it.
+    ld      a0, __SIZEOF_POINTER__(t1)
+    ld      t1, ART_METHOD_QUICK_CODE_OFFSET_64(a0)
+    jr      t1
+.Lconflict_trampoline:
+    // Call the runtime stub to populate the ImtConflictTable and jump to the
+    // resolved method.
+    move a0, t0  // Load interface method
+    INVOKE_TRAMPOLINE_BODY artInvokeInterfaceTrampoline
+END art_quick_imt_conflict_trampoline
+
+
+.macro UPDATE_INLINE_CACHE_ENTRY class, entry, temp, loop_label, done_label, next_label
+\loop_label:
+    lwu     \temp, (\entry)
+    beq     \class, \temp, \done_label
+    bnez    \temp, \next_label
+    lr.w    \temp, (\entry)
+    bnez    \temp, \loop_label
+    sc.w    \temp, \class, (\entry)
+    beqz    \temp, \done_label
+    j       \loop_label
+.endm
+
+// A0 contains the class, T5 contains the inline cache. T6 can be used, T5 can be clobbered.
+ENTRY art_quick_update_inline_cache
+#if (INLINE_CACHE_SIZE != 5)
+#error "INLINE_CACHE_SIZE not as expected."
+#endif
+#if defined(USE_READ_BARRIER) && defined(USE_BAKER_READ_BARRIER)
+    // Don't update the cache if we are marking.
+    lwu     t6, THREAD_IS_GC_MARKING_OFFSET(xSELF)
+    bnez    t6, .Ldone
+#endif
+    addi    t5, t5, INLINE_CACHE_CLASSES_OFFSET
+    UPDATE_INLINE_CACHE_ENTRY a0, t5, t6, .Lentry1_loop, .Ldone, .Lentry2
+.Lentry2:
+    addi    t5, t5, 4
+    UPDATE_INLINE_CACHE_ENTRY a0, t5, t6, .Lentry2_loop, .Ldone, .Lentry3
+.Lentry3:
+    addi    t5, t5, 4
+    UPDATE_INLINE_CACHE_ENTRY a0, t5, t6, .Lentry3_loop, .Ldone, .Lentry4
+.Lentry4:
+    addi    t5, t5, 4
+    UPDATE_INLINE_CACHE_ENTRY a0, t5, t6, .Lentry4_loop, .Ldone, .Lentry5
+.Lentry5:
+    // Unconditionally store, the inline cache is megamorphic.
+    sw      a0, 4(t5)
+.Ldone:
+    ret
+END art_quick_update_inline_cache
+
+
+.macro ONE_ARG_SAVE_EVERYTHING_DOWNCALL \
+        name, entrypoint, runtime_method_offset = RUNTIME_SAVE_EVERYTHING_METHOD_OFFSET
+    .extern \entrypoint
+ENTRY \name
+    SETUP_SAVE_EVERYTHING_FRAME \runtime_method_offset  // Save everything for stack crawl.
+    mv    a1, xSELF                   // Pass Thread::Current().
+    call  \entrypoint                 // (uint32_t/Class* index/klass, Thread* self)
+    beqz  a0, 1f                      // If result is null, deliver the exception.
+    DEOPT_OR_RESTORE_SAVE_EVERYTHING_FRAME_AND_RETURN_A0 /* temp= */ a1, /* is_ref= */ 1
+1:
+    DELIVER_PENDING_EXCEPTION_FRAME_READY
+END \name
+.endm
+
+
+.macro ONE_ARG_SAVE_EVERYTHING_DOWNCALL_FOR_CLINIT name, entrypoint
+    ONE_ARG_SAVE_EVERYTHING_DOWNCALL \
+            \name, \entrypoint, RUNTIME_SAVE_EVERYTHING_FOR_CLINIT_METHOD_OFFSET
+.endm
+
+
+ONE_ARG_SAVE_EVERYTHING_DOWNCALL_FOR_CLINIT \
+        art_quick_initialize_static_storage, artInitializeStaticStorageFromCode
+ONE_ARG_SAVE_EVERYTHING_DOWNCALL_FOR_CLINIT art_quick_resolve_type, artResolveTypeFromCode
+ONE_ARG_SAVE_EVERYTHING_DOWNCALL \
+        art_quick_resolve_type_and_verify_access, artResolveTypeAndVerifyAccessFromCode
+ONE_ARG_SAVE_EVERYTHING_DOWNCALL art_quick_resolve_method_handle, artResolveMethodHandleFromCode
+ONE_ARG_SAVE_EVERYTHING_DOWNCALL art_quick_resolve_method_type, artResolveMethodTypeFromCode
+ONE_ARG_SAVE_EVERYTHING_DOWNCALL art_quick_resolve_string, artResolveStringFromCode
+
+
+// Helper macros for `art_quick_aput_obj`.
+#ifdef USE_READ_BARRIER
+#ifdef USE_BAKER_READ_BARRIER
+.macro BAKER_RB_CHECK_GRAY_BIT_AND_LOAD dest, obj, offset, gray_slow_path_label
+    lw    t6, MIRROR_OBJECT_LOCK_WORD_OFFSET(\obj)
+    slliw t6, t6, 31 - LOCK_WORD_READ_BARRIER_STATE_SHIFT  // Shift the state bit to sign bit.
+    bltz  t6, \gray_slow_path_label
+    // False dependency to avoid needing load/load fence.
+    xor   t6, t6, t6
+    add   \obj, \obj, t6
+    lwu   \dest, \offset(\obj)                     // Heap reference = 32b; zero-extends to `dest`.
+    UNPOISON_HEAP_REF \dest
+.endm
+
+.macro BAKER_RB_LOAD_AND_MARK dest, obj, offset, mark_function
+    lwu   \dest, \offset(\obj)                     // Heap reference = 32b; zero-extends to `dest`.
+    UNPOISON_HEAP_REF \dest
+    // Save RA in a register preserved by `art_quick_read_barrier_mark_regNN`
+    // and unused by the `art_quick_aput_obj`.
+    mv    t2, ra
+    call  \mark_function
+    mv    ra, t2                                   // Restore RA.
+.endm
+#else  // USE_BAKER_READ_BARRIER
+    .extern artReadBarrierSlow
+.macro READ_BARRIER_SLOW dest, obj, offset
+    // Store registers used in art_quick_aput_obj (a0-a4, RA), stack is 16B aligned.
+    INCREASE_FRAME 48
+    SAVE_GPR a0, 0*8
+    SAVE_GPR a1, 1*8
+    SAVE_GPR a2, 2*8
+    SAVE_GPR a3, 3*8
+    SAVE_GPR a4, 4*8
+    SAVE_GPR ra, 5*8
+
+    // mv a0, \ref                  // Pass ref in A0 (no-op for now since parameter ref is unused).
+    .ifnc \obj, a1
+        mv a1, \obj                 // Pass `obj`.
+    .endif
+    li    a2, \offset               // Pass offset.
+    call  artReadBarrierSlow        // artReadBarrierSlow(ref, obj, offset)
+    // No need to unpoison return value in A0, `artReadBarrierSlow()` would do the unpoisoning.
+    .ifnc \dest, a0
+        mv \dest, a0                // save return value in dest
+    .endif
+
+    // Conditionally restore saved registers
+    RESTORE_GPR_NE a0, 0*8, \dest
+    RESTORE_GPR_NE a1, 1*8, \dest
+    RESTORE_GPR_NE a2, 2*8, \dest
+    RESTORE_GPR_NE a3, 3*8, \dest
+    RESTORE_GPR_NE a4, 4*8, \dest
+    RESTORE_GPR ra, 5*8
+    DECREASE_FRAME 48
+.endm
+#endif  // USE_BAKER_READ_BARRIER
+#endif  // USE_READ_BARRIER
+
+ENTRY art_quick_aput_obj
+    beqz  a2, .Laput_obj_null
+#if defined(USE_READ_BARRIER) && !defined(USE_BAKER_READ_BARRIER)
+    READ_BARRIER_SLOW a3, a0, MIRROR_OBJECT_CLASS_OFFSET
+    READ_BARRIER_SLOW a3, a3, MIRROR_CLASS_COMPONENT_TYPE_OFFSET
+    READ_BARRIER_SLOW a4, a2, MIRROR_OBJECT_CLASS_OFFSET
+#else  // !defined(USE_READ_BARRIER) || defined(USE_BAKER_READ_BARRIER)
+#ifdef USE_READ_BARRIER
+    // TODO(riscv64): Define marking register to avoid this load.
+    lw    t6, THREAD_IS_GC_MARKING_OFFSET(xSELF)
+    bnez  t6, .Laput_obj_gc_marking
+#endif  // USE_READ_BARRIER
+    lwu   a3, MIRROR_OBJECT_CLASS_OFFSET(a0)           // Heap reference = 32b; zero-extends to a3.
+    UNPOISON_HEAP_REF a3
+    lwu   a3, MIRROR_CLASS_COMPONENT_TYPE_OFFSET(a3)   // Heap reference = 32b; zero-extends to a3.
+    UNPOISON_HEAP_REF a3
+    lwu   a4, MIRROR_OBJECT_CLASS_OFFSET(a2)           // Heap reference = 32b; zero-extends to a4.
+    UNPOISON_HEAP_REF a4
+#endif  // !defined(USE_READ_BARRIER) || defined(USE_BAKER_READ_BARRIER)
+    // value's type == array's component type - trivial assignability
+    bne   a3, a4, .Laput_obj_check_assignability
+.Laput_obj_store:
+    sh2add a3, a1, a0
+    POISON_HEAP_REF a2
+    sw    a2, MIRROR_OBJECT_ARRAY_DATA_OFFSET(a3)      // Heap reference = 32b.
+    ld    a3, THREAD_CARD_TABLE_OFFSET(xSELF)
+    srli  a0, a0, CARD_TABLE_CARD_SHIFT
+    add   a0, a0, a3
+    sb    a3, (a0)
+    ret
+
+.Laput_obj_null:
+    sh2add a3, a1, a0
+    sw    a2, MIRROR_OBJECT_ARRAY_DATA_OFFSET(a3)      // Heap reference = 32b.
+    ret
+
+.Laput_obj_check_assignability:
+    // Store arguments and return register
+    INCREASE_FRAME 32
+    SAVE_GPR a0, 0*8
+    SAVE_GPR a1, 1*8
+    SAVE_GPR a2, 2*8
+    SAVE_GPR ra, 3*8
+
+    // Call runtime code
+    mv    a0, a3          // Heap reference, 32b, "uncompress" = do nothing, already zero-extended.
+    mv    a1, a4          // Heap reference, 32b, "uncompress" = do nothing, already zero-extended.
+    call  artIsAssignableFromCode
+
+    // Check for exception
+    CFI_REMEMBER_STATE
+    beqz a0, .Laput_obj_throw_array_store_exception
+
+    // Restore
+    RESTORE_GPR a0, 0*8
+    RESTORE_GPR a1, 1*8
+    RESTORE_GPR a2, 2*8
+    RESTORE_GPR ra, 3*8
+    DECREASE_FRAME 32
+
+    sh2add a3, a1, a0
+    POISON_HEAP_REF a2
+    sw    a2, MIRROR_OBJECT_ARRAY_DATA_OFFSET(a3)      // Heap reference = 32b.
+    ld    a3, THREAD_CARD_TABLE_OFFSET(xSELF)
+    srli  a0, a0, CARD_TABLE_CARD_SHIFT
+    add   a0, a0, a3
+    sb    a3, (a0)
+    ret
+
+.Laput_obj_throw_array_store_exception:
+    CFI_RESTORE_STATE_AND_DEF_CFA sp, 32
+    RESTORE_GPR a0, 0*8
+    RESTORE_GPR a1, 1*8
+    RESTORE_GPR a2, 2*8
+    RESTORE_GPR ra, 3*8
+    DECREASE_FRAME 32
+
+#if defined(USE_READ_BARRIER) && defined(USE_BAKER_READ_BARRIER)
+    CFI_REMEMBER_STATE
+#endif  // defined(USE_READ_BARRIER) && defined(USE_BAKER_READ_BARRIER)
+    SETUP_SAVE_ALL_CALLEE_SAVES_FRAME
+    mv    a1, a2                        // Pass value.
+    mv    a2, xSELF                     // Pass Thread::Current().
+    call  artThrowArrayStoreException   // (Object*, Object*, Thread*).
+    unimp                               // Unreachable.
+
+#if defined(USE_READ_BARRIER) && defined(USE_BAKER_READ_BARRIER)
+    CFI_RESTORE_STATE_AND_DEF_CFA sp, 0
+.Laput_obj_gc_marking:
+    BAKER_RB_CHECK_GRAY_BIT_AND_LOAD \
+        a3, a0, MIRROR_OBJECT_CLASS_OFFSET, .Laput_obj_mark_array_class
+.Laput_obj_mark_array_class_continue:
+    BAKER_RB_CHECK_GRAY_BIT_AND_LOAD \
+        a3, a3, MIRROR_CLASS_COMPONENT_TYPE_OFFSET, .Laput_obj_mark_array_element
+.Laput_obj_mark_array_element_continue:
+    BAKER_RB_CHECK_GRAY_BIT_AND_LOAD \
+        a4, a2, MIRROR_OBJECT_CLASS_OFFSET, .Laput_obj_mark_object_class
+.Laput_obj_mark_object_class_continue:
+    // value's type == array's component type - trivial assignability
+    bne   a3, a4, .Laput_obj_check_assignability
+    j     .Laput_obj_store
+
+.Laput_obj_mark_array_class:
+    BAKER_RB_LOAD_AND_MARK a3, a0, MIRROR_OBJECT_CLASS_OFFSET, art_quick_read_barrier_mark_reg13
+    j     .Laput_obj_mark_array_class_continue
+
+.Laput_obj_mark_array_element:
+    BAKER_RB_LOAD_AND_MARK \
+        a3, a3, MIRROR_CLASS_COMPONENT_TYPE_OFFSET, art_quick_read_barrier_mark_reg13
+    j     .Laput_obj_mark_array_element_continue
+
+.Laput_obj_mark_object_class:
+    BAKER_RB_LOAD_AND_MARK a4, a2, MIRROR_OBJECT_CLASS_OFFSET, art_quick_read_barrier_mark_reg14
+    j     .Laput_obj_mark_object_class_continue
+#endif  // defined(USE_READ_BARRIER) && defined(USE_BAKER_READ_BARRIER)
+END art_quick_aput_obj
+
+
+// Create a function `name` calling the art::ReadBarrier::Mark routine, getting its argument and
+// returning its result through \reg, saving and restoring all caller-save registers.
+//
+// The generated function follows a non-standard calling convention:
+// - register `reg` is used to pass the singleton argument,
+// - register `reg` is used to return the result,
+// - all other registers are callee-save (the values they hold are preserved).
+.macro READ_BARRIER_MARK_REG name, reg
+ENTRY \name
+    beqz \reg, .Lrb_return_\name  // early return if null
+
+    // Save t5 and t6 onto stack to honor caller-save calling convention.
+    INCREASE_FRAME 16
+    SAVE_GPR t5, (8*0)
+    SAVE_GPR t6, (8*1)
+
+    lw t5, MIRROR_OBJECT_LOCK_WORD_OFFSET(\reg)  // t5 := lock word
+    slliw t6, t5, 31-LOCK_WORD_MARK_BIT_SHIFT    // mark bit into MSB
+    bltz t6, .Lrb_tmp_restore_\name
+    // Check if the top two bits are set. If so, it is a forwarding address.
+    slliw t6, t5, 1
+    and t6, t6, t5
+    CFI_REMEMBER_STATE
+    bgez t6, .Lrb_full_\name
+    // Extract and zero-extend the forwarding address.
+    slli \reg, t5, (LOCK_WORD_STATE_FORWARDING_ADDRESS_SHIFT + 32)
+    srli \reg, \reg, 32
+    .ifc \reg, t5
+      sd t5, (8*0)(sp)
+    .endif
+    .ifc \reg, t6
+      sd t6, (8*1)(sp)
+    .endif
+.Lrb_tmp_restore_\name:
+    RESTORE_GPR t5, (8*0)
+    RESTORE_GPR t6, (8*1)
+    DECREASE_FRAME 16
+.Lrb_return_\name:
+    ret
+.Lrb_full_\name:
+    CFI_RESTORE_STATE_AND_DEF_CFA sp, 16
+    // Save remaining caller-save registers on stack. t5 and t6 already saved.
+    // fa0-fa7, ft0-ft11, a0-a7, t0-t4, ra: 8 * (8 + 12 + 8 + 5 + 1) = 8 * 34 = 272 bytes
+    INCREASE_FRAME 272
+    SAVE_FPR fa0,  (8*0)
+    SAVE_FPR fa1,  (8*1)
+    SAVE_FPR fa2,  (8*2)
+    SAVE_FPR fa3,  (8*3)
+    SAVE_FPR fa4,  (8*4)
+    SAVE_FPR fa5,  (8*5)
+    SAVE_FPR fa6,  (8*6)
+    SAVE_FPR fa7,  (8*7)
+    SAVE_FPR ft0,  (8*8)
+    SAVE_FPR ft1,  (8*9)
+    SAVE_FPR ft2,  (8*10)
+    SAVE_FPR ft3,  (8*11)
+    SAVE_FPR ft4,  (8*12)
+    SAVE_FPR ft5,  (8*13)
+    SAVE_FPR ft6,  (8*14)
+    SAVE_FPR ft7,  (8*15)
+    SAVE_FPR ft8,  (8*16)
+    SAVE_FPR ft9,  (8*17)
+    SAVE_FPR ft10, (8*18)
+    SAVE_FPR ft11, (8*19)
+
+    SAVE_GPR a0,   (8*20)
+    SAVE_GPR a1,   (8*21)
+    SAVE_GPR a2,   (8*22)
+    SAVE_GPR a3,   (8*23)
+    SAVE_GPR a4,   (8*24)
+    SAVE_GPR a5,   (8*25)
+    SAVE_GPR a6,   (8*26)
+    SAVE_GPR a7,   (8*27)
+    SAVE_GPR t0,   (8*28)
+    SAVE_GPR t1,   (8*29)
+    SAVE_GPR t2,   (8*30)
+    SAVE_GPR t3,   (8*31)
+    SAVE_GPR t4,   (8*32)
+    SAVE_GPR ra,   (8*33)
+
+    .ifc \reg, t5
+      ld a0, (8*34)(sp)
+    .else
+      .ifc \reg, t6
+        ld a0, (8*35)(sp)
+      .else
+        .ifnc \reg, a0
+          mv a0, \reg
+        .endif
+      .endif
+    .endif
+    call artReadBarrierMark
+    .ifnc \reg, a0
+      mv \reg, a0
+    .endif
+
+    // Restore all caller-save registers from stack, including t5 and t6.
+    // fa0-fa7, ft0-ft11, ra, a0-a7, t0-t6: 8 * (8 + 12 + 1 + 8 + 7) = 8 * 36 = 288 bytes
+    RESTORE_FPR fa0,  (8*0)
+    RESTORE_FPR fa1,  (8*1)
+    RESTORE_FPR fa2,  (8*2)
+    RESTORE_FPR fa3,  (8*3)
+    RESTORE_FPR fa4,  (8*4)
+    RESTORE_FPR fa5,  (8*5)
+    RESTORE_FPR fa6,  (8*6)
+    RESTORE_FPR fa7,  (8*7)
+    RESTORE_FPR ft0,  (8*8)
+    RESTORE_FPR ft1,  (8*9)
+    RESTORE_FPR ft2,  (8*10)
+    RESTORE_FPR ft3,  (8*11)
+    RESTORE_FPR ft4,  (8*12)
+    RESTORE_FPR ft5,  (8*13)
+    RESTORE_FPR ft6,  (8*14)
+    RESTORE_FPR ft7,  (8*15)
+    RESTORE_FPR ft8,  (8*16)
+    RESTORE_FPR ft9,  (8*17)
+    RESTORE_FPR ft10, (8*18)
+    RESTORE_FPR ft11, (8*19)
+    RESTORE_GPR_NE \reg, a0, (8*20)
+    RESTORE_GPR_NE \reg, a1, (8*21)
+    RESTORE_GPR_NE \reg, a2, (8*22)
+    RESTORE_GPR_NE \reg, a3, (8*23)
+    RESTORE_GPR_NE \reg, a4, (8*24)
+    RESTORE_GPR_NE \reg, a5, (8*25)
+    RESTORE_GPR_NE \reg, a6, (8*26)
+    RESTORE_GPR_NE \reg, a7, (8*27)
+    RESTORE_GPR_NE \reg, t0, (8*28)
+    RESTORE_GPR_NE \reg, t1, (8*29)
+    RESTORE_GPR_NE \reg, t2, (8*30)
+    RESTORE_GPR_NE \reg, t3, (8*31)
+    RESTORE_GPR_NE \reg, t4, (8*32)
+    RESTORE_GPR_NE \reg, ra, (8*33)
+    RESTORE_GPR_NE \reg, t5, (8*34)
+    RESTORE_GPR_NE \reg, t6, (8*35)
+    DECREASE_FRAME 288
+    ret
+END \name
+.endm
+
+
+// No read barrier for X0 (Zero), X1 (RA), X2 (SP), X3 (GP) and X4 (TP).
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg05, t0
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg06, t1
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg07, t2
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg08, s0
+// No read barrier for X9 (S1/xSELF).
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg10, a0
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg11, a1
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg12, a2
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg13, a3
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg14, a4
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg15, a5
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg16, a6
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg17, a7
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg18, s2
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg19, s3
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg20, s4
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg21, s5
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg22, s6
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg23, s7
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg24, s8
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg25, s9
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg26, s10
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg27, s11
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg28, t3
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg29, t4
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg30, t5
+READ_BARRIER_MARK_REG art_quick_read_barrier_mark_reg31, t6
+
+
+.macro N_ARG_DOWNCALL n, name, entrypoint, return
+    .extern \entrypoint
+ENTRY \name
+    SETUP_SAVE_REFS_ONLY_FRAME        // Save callee saves in case of GC.
+    mv    a\n, xSELF                  // Pass Thread::Current().
+    call  \entrypoint                 // (<n args>, Thread*)
+    RESTORE_SAVE_REFS_ONLY_FRAME
+    \return
+END \name
+.endm
+
+
+.macro ONE_ARG_DOWNCALL name, entrypoint, return
+    N_ARG_DOWNCALL 1, \name, \entrypoint, \return
+.endm
+
+
+.macro TWO_ARG_DOWNCALL name, entrypoint, return
+    N_ARG_DOWNCALL 2, \name, \entrypoint, \return
+.endm
+
+
+.macro THREE_ARG_DOWNCALL name, entrypoint, return
+    N_ARG_DOWNCALL 3, \name, \entrypoint, \return
+.endm
+
+
+.macro FOUR_ARG_DOWNCALL name, entrypoint, return
+    N_ARG_DOWNCALL 4, \name, \entrypoint, \return
+.endm
+
+
+// Entry from managed code that calls artHandleFillArrayDataFromCode and
+// delivers exception on failure.
+TWO_ARG_DOWNCALL art_quick_handle_fill_data, \
+                 artHandleFillArrayDataFromCode, \
+                 RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
+
+
+// Generate the allocation entrypoints for each allocator.
+GENERATE_ALLOC_ENTRYPOINTS_FOR_NON_TLAB_ALLOCATORS
+// Comment out allocators that have riscv64 specific asm.
+// GENERATE_ALLOC_ENTRYPOINTS_ALLOC_OBJECT_RESOLVED(_region_tlab, RegionTLAB)
+// GENERATE_ALLOC_ENTRYPOINTS_ALLOC_OBJECT_INITIALIZED(_region_tlab, RegionTLAB)
+GENERATE_ALLOC_ENTRYPOINTS_ALLOC_OBJECT_WITH_ACCESS_CHECK(_region_tlab, RegionTLAB)
+GENERATE_ALLOC_ENTRYPOINTS_ALLOC_STRING_OBJECT(_region_tlab, RegionTLAB)
+// GENERATE_ALLOC_ENTRYPOINTS_ALLOC_ARRAY_RESOLVED(_region_tlab, RegionTLAB)
+// GENERATE_ALLOC_ENTRYPOINTS_ALLOC_ARRAY_RESOLVED8(_region_tlab, RegionTLAB)
+// GENERATE_ALLOC_ENTRYPOINTS_ALLOC_ARRAY_RESOLVED16(_region_tlab, RegionTLAB)
+// GENERATE_ALLOC_ENTRYPOINTS_ALLOC_ARRAY_RESOLVED32(_region_tlab, RegionTLAB)
+// GENERATE_ALLOC_ENTRYPOINTS_ALLOC_ARRAY_RESOLVED64(_region_tlab, RegionTLAB)
+GENERATE_ALLOC_ENTRYPOINTS_ALLOC_STRING_FROM_BYTES(_region_tlab, RegionTLAB)
+GENERATE_ALLOC_ENTRYPOINTS_ALLOC_STRING_FROM_CHARS(_region_tlab, RegionTLAB)
+GENERATE_ALLOC_ENTRYPOINTS_ALLOC_STRING_FROM_STRING(_region_tlab, RegionTLAB)
+
+// GENERATE_ALLOC_ENTRYPOINTS_ALLOC_OBJECT_RESOLVED(_tlab, TLAB)
+// GENERATE_ALLOC_ENTRYPOINTS_ALLOC_OBJECT_INITIALIZED(_tlab, TLAB)
+GENERATE_ALLOC_ENTRYPOINTS_ALLOC_OBJECT_WITH_ACCESS_CHECK(_tlab, TLAB)
+GENERATE_ALLOC_ENTRYPOINTS_ALLOC_STRING_OBJECT(_tlab, TLAB)
+// GENERATE_ALLOC_ENTRYPOINTS_ALLOC_ARRAY_RESOLVED(_tlab, TLAB)
+// GENERATE_ALLOC_ENTRYPOINTS_ALLOC_ARRAY_RESOLVED8(_tlab, TLAB)
+// GENERATE_ALLOC_ENTRYPOINTS_ALLOC_ARRAY_RESOLVED16(_tlab, TLAB)
+// GENERATE_ALLOC_ENTRYPOINTS_ALLOC_ARRAY_RESOLVED32(_tlab, TLAB)
+// GENERATE_ALLOC_ENTRYPOINTS_ALLOC_ARRAY_RESOLVED64(_tlab, TLAB)
+GENERATE_ALLOC_ENTRYPOINTS_ALLOC_STRING_FROM_BYTES(_tlab, TLAB)
+GENERATE_ALLOC_ENTRYPOINTS_ALLOC_STRING_FROM_CHARS(_tlab, TLAB)
+GENERATE_ALLOC_ENTRYPOINTS_ALLOC_STRING_FROM_STRING(_tlab, TLAB)
+
+// If isInitialized=1 then the compiler assumes the object's class has already been initialized.
+// If isInitialized=0 the compiler can only assume it's been at least resolved.
+.macro ART_QUICK_ALLOC_OBJECT_ROSALLOC c_name, cxx_name, isInitialized
+ENTRY \c_name
+    // Fast path rosalloc allocation.
+    // a0: type, xSELF(s1): Thread::Current
+    // a1-a7: free.
+    ld    a3, THREAD_LOCAL_ALLOC_STACK_TOP_OFFSET(xSELF)    // Check if the thread local
+                                                            // allocation stack has room.
+                                                            // ldp won't work due to large offset.
+    ld    a4, THREAD_LOCAL_ALLOC_STACK_END_OFFSET(xSELF)
+    bgeu  a3, a4, .Lslow_path\c_name
+    lwu   a3, MIRROR_CLASS_OBJECT_SIZE_ALLOC_FAST_PATH_OFFSET(a0)  // Load the object size (a3)
+    li    a5, ROSALLOC_MAX_THREAD_LOCAL_BRACKET_SIZE        // Check if the size is for a thread
+                                                            // local allocation.
+    // If the class is not yet visibly initialized, or it is finalizable,
+    // the object size will be very large to force the branch below to be taken.
+    //
+    // See Class::SetStatus() in class.cc for more details.
+    bgeu  a3, a5, .Lslow_path\c_name
+                                                            // Compute the rosalloc bracket index
+                                                            // from the size. Since the size is
+                                                            // already aligned we can combine the
+                                                            // two shifts together.
+#if ROSALLOC_BRACKET_QUANTUM_SIZE_SHIFT != POINTER_SIZE_SHIFT
+#error "Unexpected ROSALLOC_BRACKET_QUANTUM_SIZE_SHIFT != POINTER_SIZE_SHIFT"
+#endif
+    // No-op: srli  a3, a3, (ROSALLOC_BRACKET_QUANTUM_SIZE_SHIFT - POINTER_SIZE_SHIFT)
+    add   a4, xSELF, a3
+                                                            // Subtract pointer size since there
+                                                            // are no runs for 0 byte allocations
+                                                            // and the size is already aligned.
+    ld    a4, (THREAD_ROSALLOC_RUNS_OFFSET - __SIZEOF_POINTER__)(a4)
+                                                            // Load the free list head (a3). This
+                                                            // will be the return val.
+    ld    a3, (ROSALLOC_RUN_FREE_LIST_OFFSET + ROSALLOC_RUN_FREE_LIST_HEAD_OFFSET)(a4)
+    beqz  a3, .Lslow_path\c_name
+    // "Point of no slow path". Won't go to the slow path from here on. OK to clobber a0 and a1.
+    ld    a1, ROSALLOC_SLOT_NEXT_OFFSET(a3)                 // Load the next pointer of the head
+                                                            // and update the list head with the
+                                                            // next pointer.
+    sd    a1, (ROSALLOC_RUN_FREE_LIST_OFFSET + ROSALLOC_RUN_FREE_LIST_HEAD_OFFSET)(a4)
+                                                            // Store the class pointer in the
+                                                            // header. This also overwrites the
+                                                            // next pointer. The offsets are
+                                                            // asserted to match.
+
+#if ROSALLOC_SLOT_NEXT_OFFSET != MIRROR_OBJECT_CLASS_OFFSET
+#error "Class pointer needs to overwrite next pointer."
+#endif
+    POISON_HEAP_REF a0
+    sw    a0, MIRROR_OBJECT_CLASS_OFFSET(a3)
+                                                            // Push the new object onto the thread
+                                                            // local allocation stack and
+                                                            // increment the thread local
+                                                            // allocation stack top.
+    ld    a1, THREAD_LOCAL_ALLOC_STACK_TOP_OFFSET(xSELF)
+    sw    a3, (a1)
+    addi  a1, a1, COMPRESSED_REFERENCE_SIZE                 // Increment A1 to point to next slot.
+    sd    a1, THREAD_LOCAL_ALLOC_STACK_TOP_OFFSET(xSELF)    // Decrement the size of the free list.
+
+    // After this "SD" the object is published to the thread local allocation stack,
+    // and it will be observable from a runtime internal (eg. Heap::VisitObjects) point of view.
+    // It is not yet visible to the running (user) compiled code until after the return.
+    //
+    // To avoid the memory barrier prior to the "SD", a trick is employed, by differentiating
+    // the state of the allocation stack slot. It can be a pointer to one of:
+    // 0) Null entry, because the stack was bumped but the new pointer wasn't written yet.
+    //       (The stack initial state is "null" pointers).
+    // 1) A partially valid object, with an invalid class pointer to the next free rosalloc slot.
+    // 2) A fully valid object, with a valid class pointer pointing to a real class.
+    // Other states are not allowed.
+    //
+    // An object that is invalid only temporarily, and will eventually become valid.
+    // The internal runtime code simply checks if the object is not null or is partial and then
+    // ignores it.
+    //
+    // (Note: The actual check is done by seeing if a non-null object has a class pointer pointing
+    // to ClassClass, and that the ClassClass's class pointer is self-cyclic. A rosalloc free slot
+    // "next" pointer is not-cyclic.)
+    //
+    // See also b/28790624 for a listing of CLs dealing with this race.
+    lwu   a1, (ROSALLOC_RUN_FREE_LIST_OFFSET + ROSALLOC_RUN_FREE_LIST_SIZE_OFFSET)(a4)
+    addi  a1, a1, -1
+    sw    a1, (ROSALLOC_RUN_FREE_LIST_OFFSET + ROSALLOC_RUN_FREE_LIST_SIZE_OFFSET)(a4)
+
+    mv    a0, a3                                            // Set the return value and return.
+    // No barrier. The class is already observably initialized (otherwise the fast
+    // path size check above would fail) and new-instance allocations are protected
+    // from publishing by the compiler which inserts its own StoreStore barrier.
+    ret
+.Lslow_path\c_name:
+    SETUP_SAVE_REFS_ONLY_FRAME                              // Save callee saves in case of GC.
+    mv    a1, xSELF                                         // Pass Thread::Current().
+    call  \cxx_name
+    RESTORE_SAVE_REFS_ONLY_FRAME
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
+END \c_name
+.endm
+
+ART_QUICK_ALLOC_OBJECT_ROSALLOC art_quick_alloc_object_resolved_rosalloc, \
+                                artAllocObjectFromCodeResolvedRosAlloc, /* isInitialized */ 0
+ART_QUICK_ALLOC_OBJECT_ROSALLOC art_quick_alloc_object_initialized_rosalloc, \
+                                artAllocObjectFromCodeInitializedRosAlloc, /* isInitialized */ 1
+
+// If isInitialized=1 then the compiler assumes the object's class has already been initialized.
+// If isInitialized=0 the compiler can only assume it's been at least resolved.
+.macro ALLOC_OBJECT_TLAB_FAST_PATH_RESOLVED slowPathLabel isInitialized
+    ld    a4, THREAD_LOCAL_POS_OFFSET(xSELF)
+    ld    a5, THREAD_LOCAL_END_OFFSET(xSELF)
+    lwu   a7, MIRROR_CLASS_OBJECT_SIZE_ALLOC_FAST_PATH_OFFSET(a0)  // Load the object size (a7).
+    add   a6, a4, a7                                        // Add object size to tlab pos.
+                                                            // Check if it fits, overflow works
+                                                            // since the tlab pos and end are 32
+                                                            // bit values.
+
+    // If the class is not yet visibly initialized, or it is finalizable,
+    // the object size will be very large to force the branch below to be taken.
+    //
+    // See Class::SetStatus() in class.cc for more details.
+    bgtu  a6, a5, \slowPathLabel
+    sd    a6, THREAD_LOCAL_POS_OFFSET(xSELF)                // Store new thread_local_pos.
+    POISON_HEAP_REF a0
+    sw    a0, MIRROR_OBJECT_CLASS_OFFSET(a4)                // Store the class pointer.
+    mv    a0, a4
+    // No barrier. The class is already observably initialized (otherwise the fast
+    // path size check above would fail) and new-instance allocations are protected
+    // from publishing by the compiler which inserts its own StoreStore barrier.
+    ret
+.endm
+
+// The common code for art_quick_alloc_object_*region_tlab
+// Currently the implementation ignores isInitialized. TODO(b/172087402): clean this up.
+// Caller must execute a constructor fence after this.
+.macro GENERATE_ALLOC_OBJECT_RESOLVED_TLAB name, entrypoint, isInitialized
+ENTRY \name
+    // Fast path region tlab allocation.
+    // a0: type, xSELF(s1): Thread::Current
+    // a1-a7: free.
+    ALLOC_OBJECT_TLAB_FAST_PATH_RESOLVED .Lslow_path\name, \isInitialized
+.Lslow_path\name:
+    SETUP_SAVE_REFS_ONLY_FRAME                              // Save callee saves in case of GC.
+    mv    a1, xSELF                                         // Pass Thread::Current().
+    call  \entrypoint                                       // (mirror::Class*, Thread*)
+    RESTORE_SAVE_REFS_ONLY_FRAME
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
+END \name
+.endm
+
+GENERATE_ALLOC_OBJECT_RESOLVED_TLAB \
+    art_quick_alloc_object_resolved_region_tlab, \
+    artAllocObjectFromCodeResolvedRegionTLAB, /* isInitialized */ 0
+GENERATE_ALLOC_OBJECT_RESOLVED_TLAB \
+    art_quick_alloc_object_initialized_region_tlab, \
+    artAllocObjectFromCodeInitializedRegionTLAB, /* isInitialized */ 1
+GENERATE_ALLOC_OBJECT_RESOLVED_TLAB \
+    art_quick_alloc_object_resolved_tlab, \
+    artAllocObjectFromCodeResolvedTLAB, /* isInitialized */ 0
+GENERATE_ALLOC_OBJECT_RESOLVED_TLAB \
+    art_quick_alloc_object_initialized_tlab, \
+    artAllocObjectFromCodeInitializedTLAB, /* isInitialized */ 1
+
+.macro ALLOC_ARRAY_TLAB_FAST_PATH_RESOLVED_WITH_SIZE \
+    slowPathLabel, class, count, temp0, temp1, temp2
+    andi  \temp1, \temp1, OBJECT_ALIGNMENT_MASK_TOGGLED64   // Apply alignment mask
+                                                            // (addr + 7) & ~7. The mask must
+                                                            // be 64 bits to keep high bits in
+                                                            // case of overflow.
+    // Negative sized arrays are handled here since xCount holds a zero extended 32 bit value.
+    // Negative ints become large 64 bit unsigned ints which will always be larger than max signed
+    // 32 bit int. Since the max shift for arrays is 3, it can not become a negative 64 bit int.
+    li    \temp2, MIN_LARGE_OBJECT_THRESHOLD                // Possibly a large object, go slow
+    bgeu  \temp1, \temp2, \slowPathLabel                    // path.
+
+    ld    \temp0, THREAD_LOCAL_POS_OFFSET(xSELF)            // Check tlab for space, note that
+                                                            // we use (end - begin) to handle
+                                                            // negative size arrays. It is
+                                                            // assumed that a negative size will
+                                                            // always be greater unsigned than
+                                                            // region size.
+    ld    \temp2, THREAD_LOCAL_END_OFFSET(xSELF)
+    sub   \temp2, \temp2, \temp0
+
+    // The array class is always initialized here. Unlike new-instance,
+    // this does not act as a double test.
+    bgtu  \temp1, \temp2, \slowPathLabel
+    // "Point of no slow path". Won't go to the slow path from here on. OK to clobber x0 and x1.
+                                                            // Move old thread_local_pos to x0
+                                                            // for the return value.
+    mv    a0, \temp0
+    add   \temp0, \temp0, \temp1
+    sd    \temp0, THREAD_LOCAL_POS_OFFSET(xSELF)            // Store new thread_local_pos.
+    POISON_HEAP_REF \class
+    sw    \class, MIRROR_OBJECT_CLASS_OFFSET(a0)            // Store the class pointer.
+    sw    \count, MIRROR_ARRAY_LENGTH_OFFSET(a0)            // Store the array length.
+// new-array is special. The class is loaded and immediately goes to the Initialized state
+// before it is published. Therefore the only fence needed is for the publication of the object.
+// See ClassLinker::CreateArrayClass() for more details.
+
+// For publication of the new array, we don't need a 'fence w, w' here.
+// The compiler generates 'fence w, w' for all new-array insts.
+    ret
+.endm
+
+// Caller must execute a constructor fence after this.
+.macro GENERATE_ALLOC_ARRAY_TLAB name, entrypoint, size_setup
+ENTRY \name
+    // Fast path array allocation for region tlab allocation.
+    // a0: mirror::Class* type
+    // a1: int32_t component_count
+    // a2-a7: free.
+    mv    a3, a0
+    \size_setup a3, a1, a4, a5, a6
+    ALLOC_ARRAY_TLAB_FAST_PATH_RESOLVED_WITH_SIZE .Lslow_path\name, a3, a1, a4, a5, a6
+.Lslow_path\name:
+    // a0: mirror::Class* klass
+    // a1: int32_t component_count
+    // a2: Thread* self
+    SETUP_SAVE_REFS_ONLY_FRAME                              // Save callee saves in case of GC.
+    mv    a2, xSELF                                         // Pass Thread::Current().
+    call  \entrypoint
+    RESTORE_SAVE_REFS_ONLY_FRAME
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER
+END \name
+.endm
+
+.macro COMPUTE_ARRAY_SIZE_UNKNOWN class, count, temp0, temp1, temp2
+    // Array classes are never finalizable or uninitialized, no need to check.
+    lwu   \temp0, MIRROR_CLASS_COMPONENT_TYPE_OFFSET(\class) // Load component type
+    UNPOISON_HEAP_REF \temp0
+    lwu   \temp0, MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET(\temp0)
+    srli  \temp0, \temp0, PRIMITIVE_TYPE_SIZE_SHIFT_SHIFT   // Component size shift is in high 16
+                                                            // bits.
+    zext.w \temp1, \count                                   // From \count we use a 32 bit value,
+                                                            // it can not overflow.
+    sll   \temp1, \temp1, \temp0                            // Calculate data size
+    // Add array data offset and alignment.
+    addi   \temp1, \temp1, (MIRROR_INT_ARRAY_DATA_OFFSET + OBJECT_ALIGNMENT_MASK)
+#if MIRROR_LONG_ARRAY_DATA_OFFSET != MIRROR_INT_ARRAY_DATA_OFFSET + 4
+#error Long array data offset must be 4 greater than int array data offset.
+#endif
+
+    addi  \temp0, \temp0, 1                                 // Add 4 to the length only if the
+                                                            // component size shift is 3
+                                                            // (for 64 bit alignment).
+    andi  \temp0, \temp0, 4
+    add   \temp1, \temp1, \temp0
+.endm
+
+.macro COMPUTE_ARRAY_SIZE_8 class, count, temp0, temp1, temp2
+    // Add array data offset and alignment adjustment to the `\count`.
+    li     \temp1, (MIRROR_INT_ARRAY_DATA_OFFSET + OBJECT_ALIGNMENT_MASK)
+    add.uw \temp1, \count, \temp1
+.endm
+
+.macro COMPUTE_ARRAY_SIZE_16 class, count, temp0, temp1, temp2
+    // Add array data offset and alignment adjustment to the shifted `\count`.
+    li     \temp1, (MIRROR_INT_ARRAY_DATA_OFFSET + OBJECT_ALIGNMENT_MASK)
+    sh1add.uw \temp1, \count, \temp1
+.endm
+
+.macro COMPUTE_ARRAY_SIZE_32 class, count, temp0, temp1, temp2
+    // Add array data offset and alignment adjustment to the shifted `\count`.
+    li     \temp1, (MIRROR_INT_ARRAY_DATA_OFFSET + OBJECT_ALIGNMENT_MASK)
+    sh2add.uw \temp1, \count, \temp1
+.endm
+
+.macro COMPUTE_ARRAY_SIZE_64 class, count, temp0, temp1, temp2
+    // Add array data offset and alignment adjustment to the shifted `\count`.
+    li     \temp1, (MIRROR_WIDE_ARRAY_DATA_OFFSET + OBJECT_ALIGNMENT_MASK)
+    sh3add.uw \temp1, \count, \temp1
+.endm
+
+// TODO(ngeoffray): art_quick_alloc_array_resolved_region_tlab is not used for arm64, remove
+// the entrypoint once all backends have been updated to use the size variants.
+GENERATE_ALLOC_ARRAY_TLAB art_quick_alloc_array_resolved_region_tlab, \
+                          artAllocArrayFromCodeResolvedRegionTLAB, \
+                          COMPUTE_ARRAY_SIZE_UNKNOWN
+GENERATE_ALLOC_ARRAY_TLAB art_quick_alloc_array_resolved8_region_tlab, \
+                          artAllocArrayFromCodeResolvedRegionTLAB, \
+                          COMPUTE_ARRAY_SIZE_8
+GENERATE_ALLOC_ARRAY_TLAB art_quick_alloc_array_resolved16_region_tlab, \
+                          artAllocArrayFromCodeResolvedRegionTLAB, \
+                          COMPUTE_ARRAY_SIZE_16
+GENERATE_ALLOC_ARRAY_TLAB art_quick_alloc_array_resolved32_region_tlab, \
+                          artAllocArrayFromCodeResolvedRegionTLAB, \
+                          COMPUTE_ARRAY_SIZE_32
+GENERATE_ALLOC_ARRAY_TLAB art_quick_alloc_array_resolved64_region_tlab, \
+                          artAllocArrayFromCodeResolvedRegionTLAB, \
+                          COMPUTE_ARRAY_SIZE_64
+GENERATE_ALLOC_ARRAY_TLAB art_quick_alloc_array_resolved_tlab, \
+                          artAllocArrayFromCodeResolvedTLAB, \
+                          COMPUTE_ARRAY_SIZE_UNKNOWN
+GENERATE_ALLOC_ARRAY_TLAB art_quick_alloc_array_resolved8_tlab, \
+                          artAllocArrayFromCodeResolvedTLAB, \
+                          COMPUTE_ARRAY_SIZE_8
+GENERATE_ALLOC_ARRAY_TLAB art_quick_alloc_array_resolved16_tlab, \
+                          artAllocArrayFromCodeResolvedTLAB, \
+                          COMPUTE_ARRAY_SIZE_16
+GENERATE_ALLOC_ARRAY_TLAB art_quick_alloc_array_resolved32_tlab, \
+                          artAllocArrayFromCodeResolvedTLAB, \
+                          COMPUTE_ARRAY_SIZE_32
+GENERATE_ALLOC_ARRAY_TLAB art_quick_alloc_array_resolved64_tlab, \
+                          artAllocArrayFromCodeResolvedTLAB, \
+                          COMPUTE_ARRAY_SIZE_64
+
+
+GENERATE_FIELD_ENTRYPOINTS
+
+
+// String's indexOf.
+//
+// TODO: Not very optimized. We should use the vector extension.
+// On entry:
+//    a0:   string object (known non-null)
+//    a1:   char to match (known <= 0xFFFF)
+//    a2:   Starting offset in string data
+ENTRY art_quick_indexof
+#if (STRING_COMPRESSION_FEATURE)
+    lwu   a4, MIRROR_STRING_COUNT_OFFSET(a0)
+#else
+    lwu   a3, MIRROR_STRING_COUNT_OFFSET(a0)
+#endif
+    addi  a0, a0, MIRROR_STRING_VALUE_OFFSET
+#if (STRING_COMPRESSION_FEATURE)
+    /* Split the count into length (a3) and compression flag (a4) */
+    srliw a3, a4, 1
+    andi  a4, a4, 1
+#endif
+    /* Clamp start to [0..count) */
+    sraiw a5, a2, 31
+    andn  a2, a2, a5
+    bge   a2, a3, .Lstring_indexof_nomatch
+
+#if (STRING_COMPRESSION_FEATURE)
+    beqz  a4, .Lstring_indexof_compressed
+#endif
+    /* Build pointers to start and end of the data to compare */
+    sh1add a2, a2, a0
+    sh1add a3, a3, a0
+
+    /*
+     * At this point we have:
+     *  a0: original start of string data
+     *  a1: char to compare
+     *  a2: start of the data to test
+     *  a3: end of the data to test
+     */
+
+.Lstring_indexof_loop:
+    lhu   a4, 0(a2)
+    beq   a4, a1, .Lstring_indexof_match
+    addi  a2, a2, 2
+    bne   a2, a3, .Lstring_indexof_loop
+.Lstring_indexof_nomatch:
+    li    a0, -1
+    ret
+.Lstring_indexof_match:
+    sub   a0, a2, a0
+    srli  a0, a0, 1
+    ret
+
+#if (STRING_COMPRESSION_FEATURE)
+   // Comparing compressed string one character at a time with the input character.
+.Lstring_indexof_compressed:
+    add   a2, a2, a0
+    add   a3, a3, a0
+.Lstring_indexof_compressed_loop:
+    lbu   a4, (a2)
+    beq   a4, a1, .Lstring_indexof_compressed_match
+    addi  a2, a2, 1
+    bne   a2, a3, .Lstring_indexof_compressed_loop
+    li    a0, -1
+    ret
+.Lstring_indexof_compressed_match:
+    sub   a0, a2, a0
+    ret
+#endif
+END art_quick_indexof
diff --git a/runtime/arch/riscv64/registers_riscv64.cc b/runtime/arch/riscv64/registers_riscv64.cc
index b0acb47..822b232 100644
--- a/runtime/arch/riscv64/registers_riscv64.cc
+++ b/runtime/arch/riscv64/registers_riscv64.cc
@@ -18,7 +18,7 @@
 
 #include <ostream>
 
-namespace art {
+namespace art HIDDEN {
 namespace riscv64 {
 
 static const char* kXRegisterNames[] = {"zero", "ra", "sp",  "gp",  "tp", "t0", "t1", "t2",
@@ -31,6 +31,11 @@
                                         "fa6", "fa7", "fs2",  "fs3",  "fs4", "fs5", "fs6",  "fs7",
                                         "fs8", "fs9", "fs10", "fs11", "ft8", "ft9", "ft10", "ft11"};
 
+static const char* kVRegisterNames[] = {"v0",  "v1",  "v2",  "v3",  "v4",  "v5",  "v6",  "v7",
+                                        "v8",  "v9",  "v10", "v11", "v12", "v13", "v14", "v15",
+                                        "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23",
+                                        "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31"};
+
 std::ostream& operator<<(std::ostream& os, const XRegister& rhs) {
   if (rhs >= Zero && rhs < kNumberOfXRegisters) {
     os << kXRegisterNames[rhs];
@@ -49,5 +54,14 @@
   return os;
 }
 
+std::ostream& operator<<(std::ostream& os, const VRegister& rhs) {
+  if (rhs >= V0 && rhs < kNumberOfVRegisters) {
+    os << kVRegisterNames[rhs];
+  } else {
+    os << "VRegister[" << static_cast<int>(rhs) << "]";
+  }
+  return os;
+}
+
 }  // namespace riscv64
 }  // namespace art
diff --git a/runtime/arch/riscv64/registers_riscv64.h b/runtime/arch/riscv64/registers_riscv64.h
index bd0991e..3860a0b 100644
--- a/runtime/arch/riscv64/registers_riscv64.h
+++ b/runtime/arch/riscv64/registers_riscv64.h
@@ -21,7 +21,7 @@
 
 #include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace riscv64 {
 
 enum XRegister {
@@ -67,7 +67,9 @@
   kNoXRegister = -1,  // Signals an illegal X register.
 
   // Aliases.
-  TR = S1,  // ART Thread Register - managed runtime
+  TR = S1,    // ART Thread Register - managed runtime
+  TMP = T6,   // Reserved for special uses, such as assembler macro instructions.
+  TMP2 = T5,  // Reserved for special uses, such as assembler macro instructions.
 };
 
 std::ostream& operator<<(std::ostream& os, const XRegister& rhs);
@@ -112,10 +114,55 @@
 
   kNumberOfFRegisters = 32,
   kNoFRegister = -1,  // Signals an illegal F register.
+
+  FTMP = FT11,  // Reserved for special uses, such as assembler macro instructions.
 };
 
 std::ostream& operator<<(std::ostream& os, const FRegister& rhs);
 
+enum VRegister {
+  V0 = 0,  // V0, argument 0
+  V1 = 1,  // V1, callee-saved 0
+  V2 = 2,  // V2, callee-saved 1
+  V3 = 3,  // V3, callee-saved 2
+  V4 = 4,  // V4, callee-saved 3
+  V5 = 5,  // V5, callee-saved 4
+  V6 = 6,  // V6, callee-saved 5
+  V7 = 7,  // V7, callee-saved 6
+
+  V8 = 8,    // V8, argument 1
+  V9 = 9,    // V9, argument 2
+  V10 = 10,  // V10, argument 3
+  V11 = 11,  // V11, argument 4
+  V12 = 12,  // V12, argument 5
+  V13 = 13,  // V13, argument 6
+  V14 = 14,  // V14, argument 7
+  V15 = 15,  // V15, argument 8
+
+  V16 = 16,  // V16, argument 9
+  V17 = 17,  // V17, argument 10
+  V18 = 18,  // V18, argument 11
+  V19 = 19,  // V19, argument 12
+  V20 = 20,  // V20, argument 13
+  V21 = 21,  // V21, argument 14
+  V22 = 22,  // V22, argument 15
+  V23 = 23,  // V23, argument 16
+
+  V24 = 24,  // V24, callee-saved 7
+  V25 = 25,  // V25, callee-saved 8
+  V26 = 26,  // V26, callee-saved 9
+  V27 = 27,  // V27, callee-saved 10
+  V28 = 28,  // V28, callee-saved 11
+  V29 = 29,  // V29, callee-saved 12
+  V30 = 30,  // V30, callee-saved 13
+  V31 = 31,  // V31, callee-saved 14
+
+  kNumberOfVRegisters = 32,
+  kNoVRegister = -1,  // Signals an illegal V register.
+};
+
+std::ostream& operator<<(std::ostream& os, const VRegister& rhs);
+
 }  // namespace riscv64
 }  // namespace art
 
diff --git a/runtime/arch/riscv64/thread_riscv64.cc b/runtime/arch/riscv64/thread_riscv64.cc
index cb2d2ad..2865aed 100644
--- a/runtime/arch/riscv64/thread_riscv64.cc
+++ b/runtime/arch/riscv64/thread_riscv64.cc
@@ -18,7 +18,7 @@
 #include "base/enums.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 void Thread::InitCpu() {
   CHECK_EQ(THREAD_FLAGS_OFFSET, ThreadFlagsOffset<PointerSize::k64>().Int32Value());
diff --git a/runtime/arch/stub_test.cc b/runtime/arch/stub_test.cc
index 759cd9a..d6d1065 100644
--- a/runtime/arch/stub_test.cc
+++ b/runtime/arch/stub_test.cc
@@ -32,7 +32,7 @@
 #include "mirror/object_array-alloc-inl.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 
 class StubTest : public CommonRuntimeTest {
diff --git a/runtime/arch/x86/asm_support_x86.S b/runtime/arch/x86/asm_support_x86.S
index f5562f6..7ec2e2e 100644
--- a/runtime/arch/x86/asm_support_x86.S
+++ b/runtime/arch/x86/asm_support_x86.S
@@ -164,12 +164,7 @@
 
     /* Cache alignment for function entry */
 MACRO0(ALIGN_FUNCTION_ENTRY)
-    // ART-compiled functions have OatQuickMethodHeader but assembly funtions do not.
-    // Prefix the assembly code with 0xFFs, which means there is no method header.
-    .byte 0xFF, 0xFF, 0xFF, 0xFF
-    // Cache alignment for function entry.
-    // Use 0xFF as the last 4 bytes of alignment stand for OatQuickMethodHeader.
-    .balign 16, 0xFF
+    .balign 16
 END_MACRO
 
 MACRO2(DEFINE_FUNCTION_CUSTOM_CFA, c_name, cfa_offset)
diff --git a/runtime/arch/x86/callee_save_frame_x86.h b/runtime/arch/x86/callee_save_frame_x86.h
index 2edcade..81df066 100644
--- a/runtime/arch/x86/callee_save_frame_x86.h
+++ b/runtime/arch/x86/callee_save_frame_x86.h
@@ -21,11 +21,12 @@
 #include "base/bit_utils.h"
 #include "base/callee_save_type.h"
 #include "base/enums.h"
+#include "base/macros.h"
 #include "quick/quick_method_frame_info.h"
 #include "registers_x86.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace x86 {
 
 static constexpr uint32_t kX86CalleeSaveAlwaysSpills =
diff --git a/runtime/arch/x86/context_x86.cc b/runtime/arch/x86/context_x86.cc
index cff3d7f..f4b5e5b 100644
--- a/runtime/arch/x86/context_x86.cc
+++ b/runtime/arch/x86/context_x86.cc
@@ -21,7 +21,7 @@
 #include "base/memory_tool.h"
 #include "quick/quick_method_frame_info.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace x86 {
 
 static constexpr uintptr_t gZero = 0;
diff --git a/runtime/arch/x86/context_x86.h b/runtime/arch/x86/context_x86.h
index 74b537e..ef2b271 100644
--- a/runtime/arch/x86/context_x86.h
+++ b/runtime/arch/x86/context_x86.h
@@ -23,7 +23,7 @@
 #include "base/macros.h"
 #include "registers_x86.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace x86 {
 
 class X86Context final : public Context {
diff --git a/runtime/arch/x86/entrypoints_init_x86.cc b/runtime/arch/x86/entrypoints_init_x86.cc
index 01853cc..032e9b8 100644
--- a/runtime/arch/x86/entrypoints_init_x86.cc
+++ b/runtime/arch/x86/entrypoints_init_x86.cc
@@ -24,7 +24,7 @@
 #include "entrypoints/runtime_asm_entrypoints.h"
 #include "interpreter/interpreter.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Cast entrypoints.
 extern "C" size_t art_quick_instance_of(mirror::Object* obj, mirror::Class* ref_class);
diff --git a/runtime/arch/x86/fault_handler_x86.cc b/runtime/arch/x86/fault_handler_x86.cc
index cd2d38f..8321466 100644
--- a/runtime/arch/x86/fault_handler_x86.cc
+++ b/runtime/arch/x86/fault_handler_x86.cc
@@ -24,8 +24,7 @@
 #include "base/hex_dump.h"
 #include "base/logging.h"  // For VLOG.
 #include "base/macros.h"
-#include "base/safe_copy.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "runtime_globals.h"
 #include "thread-current-inl.h"
 
@@ -70,7 +69,7 @@
 // X86 (and X86_64) specific fault handler functions.
 //
 
-namespace art {
+namespace art HIDDEN {
 
 extern "C" void art_quick_throw_null_pointer_exception_from_signal();
 extern "C" void art_quick_throw_stack_overflow();
@@ -259,7 +258,7 @@
 #undef FETCH_OR_SKIP_BYTE
 }
 
-uintptr_t FaultManager::GetFaultPc(siginfo_t* siginfo ATTRIBUTE_UNUSED, void* context) {
+uintptr_t FaultManager::GetFaultPc([[maybe_unused]] siginfo_t* siginfo, void* context) {
   ucontext_t* uc = reinterpret_cast<ucontext_t*>(context);
   if (uc->CTX_ESP == 0) {
     VLOG(signals) << "Missing SP";
diff --git a/runtime/arch/x86/instruction_set_features_x86.cc b/runtime/arch/x86/instruction_set_features_x86.cc
index f11aca9..3f9978d 100644
--- a/runtime/arch/x86/instruction_set_features_x86.cc
+++ b/runtime/arch/x86/instruction_set_features_x86.cc
@@ -34,7 +34,7 @@
 #include <cpuinfo_x86.h>
 #endif
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -46,6 +46,7 @@
     "silvermont",
     "goldmont",
     "goldmont-plus",
+    "goldmont-without-sha-xsaves",
     "tremont",
     "kabylake",
     "default",
@@ -57,6 +58,7 @@
     "silvermont",
     "goldmont",
     "goldmont-plus",
+    "goldmont-without-sha-xsaves",
     "tremont",
     "kabylake",
 };
@@ -66,6 +68,7 @@
     "silvermont",
     "goldmont",
     "goldmont-plus",
+    "goldmont-without-sha-xsaves",
     "tremont",
     "kabylake",
 };
@@ -75,6 +78,7 @@
     "silvermont",
     "goldmont",
     "goldmont-plus",
+    "goldmont-without-sha-xsaves",
     "tremont",
     "kabylake",
 };
@@ -84,6 +88,7 @@
     "silvermont",
     "goldmont",
     "goldmont-plus",
+    "goldmont-without-sha-xsaves",
     "tremont",
     "kabylake",
 };
@@ -119,9 +124,9 @@
   }
 }
 
-X86FeaturesUniquePtr X86InstructionSetFeatures::FromVariant(
-    const std::string& variant, std::string* error_msg ATTRIBUTE_UNUSED,
-    bool x86_64) {
+X86FeaturesUniquePtr X86InstructionSetFeatures::FromVariant(const std::string& variant,
+                                                            [[maybe_unused]] std::string* error_msg,
+                                                            bool x86_64) {
   const bool is_runtime_isa =
       kRuntimeISA == (x86_64 ? InstructionSet::kX86_64 : InstructionSet::kX86);
   if (is_runtime_isa && variant == "default") {
diff --git a/runtime/arch/x86/instruction_set_features_x86.h b/runtime/arch/x86/instruction_set_features_x86.h
index 1a8ebb5..e6fbc33 100644
--- a/runtime/arch/x86/instruction_set_features_x86.h
+++ b/runtime/arch/x86/instruction_set_features_x86.h
@@ -18,6 +18,7 @@
 #define ART_RUNTIME_ARCH_X86_INSTRUCTION_SET_FEATURES_X86_H_
 
 #include "arch/instruction_set_features.h"
+#include "base/macros.h"
 
 #define GET_REX_R       0x04
 #define GET_REX_X       0x02
@@ -39,7 +40,7 @@
 #define THREE_BYTE_VEX  0xC4
 #define VEX_INIT        0x00
 
-namespace art {
+namespace art HIDDEN {
 
 class X86InstructionSetFeatures;
 using X86FeaturesUniquePtr = std::unique_ptr<const X86InstructionSetFeatures>;
diff --git a/runtime/arch/x86/instruction_set_features_x86_test.cc b/runtime/arch/x86/instruction_set_features_x86_test.cc
index c50360a..ddfec9a 100644
--- a/runtime/arch/x86/instruction_set_features_x86_test.cc
+++ b/runtime/arch/x86/instruction_set_features_x86_test.cc
@@ -18,7 +18,7 @@
 
 #include <gtest/gtest.h>
 
-namespace art {
+namespace art HIDDEN {
 
 TEST(X86InstructionSetFeaturesTest, X86FeaturesFromDefaultVariant) {
   const bool is_runtime_isa = kRuntimeISA == InstructionSet::kX86;
diff --git a/runtime/arch/x86/jni_entrypoints_x86.S b/runtime/arch/x86/jni_entrypoints_x86.S
index c7cf856..448774a 100644
--- a/runtime/arch/x86/jni_entrypoints_x86.S
+++ b/runtime/arch/x86/jni_entrypoints_x86.S
@@ -173,7 +173,7 @@
     // Calculate the base address of the managed frame.
     leal (%esp, %eax, 1), %eax
 
-    leal 1(%eax), %ecx            // Prepare namaged SP tagged for a GenericJNI frame.
+    leal 1(%eax), %ecx            // Prepare managed SP tagged for a GenericJNI frame.
     testl LITERAL(ACCESS_FLAGS_METHOD_IS_NATIVE), ART_METHOD_ACCESS_FLAGS_OFFSET(%ebx)
     jnz .Lcritical_skip_prepare_runtime_method
 
@@ -221,9 +221,8 @@
 
     // Check for exception.
     test %eax, %eax
-    jz .Lcritical_deliver_exception
-
     CFI_REMEMBER_STATE
+    jz .Lcritical_deliver_exception
 
     // Remember our return PC in EDX.
     movl __SIZEOF_POINTER__(%ebx), %edx
@@ -268,9 +267,9 @@
 
     // Do the tail call.
     jmp *%eax
-    CFI_RESTORE_STATE_AND_DEF_CFA %esp, FRAME_SIZE_SAVE_REFS_AND_ARGS
 
 .Lcritical_deliver_exception:
+    CFI_RESTORE_STATE_AND_DEF_CFA %esp, FRAME_SIZE_SAVE_REFS_AND_ARGS
     DELIVER_PENDING_EXCEPTION_FRAME_READY
 END_FUNCTION art_jni_dlsym_lookup_critical_stub
 
diff --git a/runtime/arch/x86/jni_frame_x86.h b/runtime/arch/x86/jni_frame_x86.h
index 15ccff8..0d95f50 100644
--- a/runtime/arch/x86/jni_frame_x86.h
+++ b/runtime/arch/x86/jni_frame_x86.h
@@ -23,8 +23,9 @@
 #include "base/bit_utils.h"
 #include "base/globals.h"
 #include "base/logging.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace x86 {
 
 constexpr size_t kFramePointerSize = static_cast<size_t>(PointerSize::k32);
@@ -81,4 +82,3 @@
 }  // namespace art
 
 #endif  // ART_RUNTIME_ARCH_X86_JNI_FRAME_X86_H_
-
diff --git a/runtime/arch/x86/memcmp16_x86.S b/runtime/arch/x86/memcmp16_x86.S
index 636ceb9..45f647c 100644
--- a/runtime/arch/x86/memcmp16_x86.S
+++ b/runtime/arch/x86/memcmp16_x86.S
@@ -844,8 +844,11 @@
     subl       %ebx, %eax
     RETURN
 
-
-    CFI_PUSH (%ebx)
+    # Unreachable, but needed for static analysis in the check_cfi.py script,
+    # since it does just single forward pass, but the code below is only
+    # reachable via a backward branch.
+    CFI_DEF_CFA (esp, 4)
+    PUSH       (%ebx)
 
     .p2align 4
 L(more8bytes):
diff --git a/runtime/arch/x86/quick_entrypoints_x86.S b/runtime/arch/x86/quick_entrypoints_x86.S
index bb4399f..5a32464 100644
--- a/runtime/arch/x86/quick_entrypoints_x86.S
+++ b/runtime/arch/x86/quick_entrypoints_x86.S
@@ -18,6 +18,7 @@
 #include "interpreter/cfi_asm_support.h"
 
 #include "arch/quick_alloc_entrypoints.S"
+#include "arch/quick_field_entrypoints.S"
 
 // For x86, the CFA is esp+4, the address above the pushed return address on the stack.
 
@@ -31,8 +32,7 @@
     PUSH esi
     PUSH ebp
     PUSH RAW_VAR(temp_reg)  // Save temp_reg
-    subl MACRO_LITERAL(8), %esp  // Grow stack by 2 words.
-    CFI_ADJUST_CFA_OFFSET(8)
+    INCREASE_FRAME 8             // Grow stack by 2 words.
 
     LOAD_RUNTIME_INSTANCE \temp_reg
     // Push save all callee-save method.
@@ -91,8 +91,7 @@
     movsd 16(%esp), %xmm2
     movsd 24(%esp), %xmm3
 
-    addl MACRO_LITERAL(32), %esp  // Remove FPRs.
-    CFI_ADJUST_CFA_OFFSET(-32)
+    DECREASE_FRAME 32             // Remove FPRs.
 
     POP ecx  // Restore args except eax
     POP edx
@@ -117,8 +116,7 @@
     PUSH ecx
     PUSH eax
     // Create space for FPR registers and stack alignment padding.
-    subl MACRO_LITERAL(12 + 8 * 8), %esp
-    CFI_ADJUST_CFA_OFFSET(12 + 8 * 8)
+    INCREASE_FRAME 12 + 8 * 8
     // Save FPRs.
     movsd %xmm0, 12(%esp)
     movsd %xmm1, 20(%esp)
@@ -190,8 +188,7 @@
     RESTORE_SAVE_EVERYTHING_FRAME_FRPS
 
     // Remove save everything callee save method, stack alignment padding and FPRs.
-    addl MACRO_LITERAL(16 + 8 * 8), %esp
-    CFI_ADJUST_CFA_OFFSET(-(16 + 8 * 8))
+    DECREASE_FRAME 16 + 8 * 8
 
     POP eax
     RESTORE_SAVE_EVERYTHING_FRAME_GPRS_EXCEPT_EAX
@@ -201,8 +198,7 @@
     RESTORE_SAVE_EVERYTHING_FRAME_FRPS
 
     // Remove save everything callee save method, stack alignment padding and FPRs, skip EAX.
-    addl MACRO_LITERAL(16 + 8 * 8 + 4), %esp
-    CFI_ADJUST_CFA_OFFSET(-(16 + 8 * 8 + 4))
+    DECREASE_FRAME 16 + 8 * 8 + 4
 
     RESTORE_SAVE_EVERYTHING_FRAME_GPRS_EXCEPT_EAX
 END_MACRO
@@ -211,8 +207,7 @@
     DEFINE_FUNCTION VAR(c_name)
     SETUP_SAVE_ALL_CALLEE_SAVES_FRAME ebx      // save all registers as basis for long jump context
     // Outgoing argument set up
-    subl MACRO_LITERAL(12), %esp               // alignment padding
-    CFI_ADJUST_CFA_OFFSET(12)
+    INCREASE_FRAME 12                          // alignment padding
     pushl %fs:THREAD_SELF_OFFSET               // pass Thread::Current()
     CFI_ADJUST_CFA_OFFSET(4)
     call CALLVAR(cxx_name)                     // cxx_name(Thread*)
@@ -224,8 +219,7 @@
     DEFINE_FUNCTION VAR(c_name)
     SETUP_SAVE_EVERYTHING_FRAME ebx            // save all registers as basis for long jump context
     // Outgoing argument set up
-    subl MACRO_LITERAL(12), %esp               // alignment padding
-    CFI_ADJUST_CFA_OFFSET(12)
+    INCREASE_FRAME 12                          // alignment padding
     pushl %fs:THREAD_SELF_OFFSET               // pass Thread::Current()
     CFI_ADJUST_CFA_OFFSET(4)
     call CALLVAR(cxx_name)                     // cxx_name(Thread*)
@@ -237,8 +231,7 @@
     DEFINE_FUNCTION VAR(c_name)
     SETUP_SAVE_ALL_CALLEE_SAVES_FRAME ebx      // save all registers as basis for long jump context
     // Outgoing argument set up
-    subl MACRO_LITERAL(8), %esp                // alignment padding
-    CFI_ADJUST_CFA_OFFSET(8)
+    INCREASE_FRAME 8                           // alignment padding
     pushl %fs:THREAD_SELF_OFFSET               // pass Thread::Current()
     CFI_ADJUST_CFA_OFFSET(4)
     PUSH eax                                   // pass arg1
@@ -278,8 +271,7 @@
     movl %edi, (FRAME_SIZE_SAVE_EVERYTHING - 2 * __SIZEOF_POINTER__)(%esp)
     CFI_REL_OFFSET(%edi, (FRAME_SIZE_SAVE_EVERYTHING - 2 * __SIZEOF_POINTER__))
     // Outgoing argument set up
-    subl MACRO_LITERAL(8), %esp                           // alignment padding
-    CFI_ADJUST_CFA_OFFSET(8)
+    INCREASE_FRAME 8                                      // alignment padding
     pushl %fs:THREAD_SELF_OFFSET                          // pass Thread::Current()
     CFI_ADJUST_CFA_OFFSET(4)
     PUSH eax                                              // pass arg1
@@ -342,8 +334,7 @@
     PUSH eax                      // pass arg1
     call CALLVAR(cxx_name)        // cxx_name(arg1, arg2, Thread*, SP)
     movl %edx, %edi               // save code pointer in EDI
-    addl MACRO_LITERAL(20), %esp  // Pop arguments skip eax
-    CFI_ADJUST_CFA_OFFSET(-20)
+    DECREASE_FRAME 20             // Pop arguments skip eax
 
     // Restore FPRs.
     movsd 0(%esp), %xmm0
@@ -352,8 +343,7 @@
     movsd 24(%esp), %xmm3
 
     // Remove space for FPR args.
-    addl MACRO_LITERAL(4 * 8), %esp
-    CFI_ADJUST_CFA_OFFSET(-4 * 8)
+    DECREASE_FRAME 4 * 8
 
     POP ecx  // Restore args except eax
     POP edx
@@ -367,8 +357,7 @@
     // Tail call to intended method.
     ret
 1:
-    addl MACRO_LITERAL(4), %esp   // Pop code pointer off stack
-    CFI_ADJUST_CFA_OFFSET(-4)
+    DECREASE_FRAME 4              // Pop code pointer off stack
     DELIVER_PENDING_EXCEPTION
 END_MACRO
 MACRO2(INVOKE_TRAMPOLINE, c_name, cxx_name)
@@ -659,14 +648,12 @@
     DEFINE_FUNCTION VAR(c_name)
     SETUP_SAVE_REFS_ONLY_FRAME ebx               // save ref containing registers for GC
     // Outgoing argument set up
-    subl MACRO_LITERAL(8), %esp                  // push padding
-    CFI_ADJUST_CFA_OFFSET(8)
+    INCREASE_FRAME 8                             // push padding
     pushl %fs:THREAD_SELF_OFFSET                 // pass Thread::Current()
     CFI_ADJUST_CFA_OFFSET(4)
     PUSH eax                                     // pass arg1
     call CALLVAR(cxx_name)                       // cxx_name(arg1, Thread*)
-    addl MACRO_LITERAL(16), %esp                 // pop arguments
-    CFI_ADJUST_CFA_OFFSET(-16)
+    DECREASE_FRAME 16                            // pop arguments
     RESTORE_SAVE_REFS_ONLY_FRAME                 // restore frame up to return address
     CALL_MACRO(return_macro)                     // return or deliver exception
     END_FUNCTION VAR(c_name)
@@ -682,8 +669,7 @@
     PUSH ecx                                     // pass arg2
     PUSH eax                                     // pass arg1
     call CALLVAR(cxx_name)                       // cxx_name(arg1, arg2, Thread*)
-    addl MACRO_LITERAL(16), %esp                 // pop arguments
-    CFI_ADJUST_CFA_OFFSET(-16)
+    DECREASE_FRAME 16                            // pop arguments
     RESTORE_SAVE_REFS_ONLY_FRAME                 // restore frame up to return address
     CALL_MACRO(return_macro)                     // return or deliver exception
     END_FUNCTION VAR(c_name)
@@ -699,8 +685,7 @@
     PUSH ecx                                     // pass arg2
     PUSH eax                                     // pass arg1
     call CALLVAR(cxx_name)                       // cxx_name(arg1, arg2, arg3, Thread*)
-    addl MACRO_LITERAL(16), %esp                 // pop arguments
-    CFI_ADJUST_CFA_OFFSET(-16)
+    DECREASE_FRAME 16                            // pop arguments
     RESTORE_SAVE_REFS_ONLY_FRAME                 // restore frame up to return address
     CALL_MACRO(return_macro)                     // return or deliver exception
     END_FUNCTION VAR(c_name)
@@ -711,8 +696,7 @@
     SETUP_SAVE_REFS_ONLY_FRAME_PRESERVE_TEMP_REG ebx  // save ref containing registers for GC
 
     // Outgoing argument set up
-    subl MACRO_LITERAL(12), %esp                 // alignment padding
-    CFI_ADJUST_CFA_OFFSET(12)
+    INCREASE_FRAME 12                            // alignment padding
     pushl %fs:THREAD_SELF_OFFSET                 // pass Thread::Current()
     CFI_ADJUST_CFA_OFFSET(4)
     PUSH ebx                                     // pass arg4
@@ -720,64 +704,12 @@
     PUSH ecx                                     // pass arg2
     PUSH eax                                     // pass arg1
     call CALLVAR(cxx_name)                       // cxx_name(arg1, arg2, arg3, arg4, Thread*)
-    addl MACRO_LITERAL(32), %esp                 // pop arguments
-    CFI_ADJUST_CFA_OFFSET(-32)
+    DECREASE_FRAME 32                            // pop arguments
     RESTORE_SAVE_REFS_ONLY_FRAME                 // restore frame up to return address
     CALL_MACRO(return_macro)                     // return or deliver exception
     END_FUNCTION VAR(c_name)
 END_MACRO
 
-MACRO3(ONE_ARG_REF_DOWNCALL, c_name, cxx_name, return_macro)
-    DEFINE_FUNCTION VAR(c_name)
-    SETUP_SAVE_REFS_ONLY_FRAME ebx                    // save ref containing registers for GC
-    // Outgoing argument set up
-    subl MACRO_LITERAL(8), %esp                       // alignment padding
-    CFI_ADJUST_CFA_OFFSET(8)
-    pushl %fs:THREAD_SELF_OFFSET                      // pass Thread::Current()
-    CFI_ADJUST_CFA_OFFSET(4)
-    PUSH eax                                          // pass arg1
-    call CALLVAR(cxx_name)                            // cxx_name(arg1, Thread*)
-    addl MACRO_LITERAL(16), %esp                      // pop arguments
-    CFI_ADJUST_CFA_OFFSET(-16)
-    RESTORE_SAVE_REFS_ONLY_FRAME                      // restore frame up to return address
-    CALL_MACRO(return_macro)                          // return or deliver exception
-    END_FUNCTION VAR(c_name)
-END_MACRO
-
-MACRO3(TWO_ARG_REF_DOWNCALL, c_name, cxx_name, return_macro)
-    DEFINE_FUNCTION VAR(c_name)
-    SETUP_SAVE_REFS_ONLY_FRAME ebx                    // save ref containing registers for GC
-    // Outgoing argument set up
-    PUSH eax                                          // alignment padding
-    pushl %fs:THREAD_SELF_OFFSET                      // pass Thread::Current()
-    CFI_ADJUST_CFA_OFFSET(4)
-    PUSH ecx                                          // pass arg2
-    PUSH eax                                          // pass arg1
-    call CALLVAR(cxx_name)                            // cxx_name(arg1, arg2, referrer, Thread*)
-    addl MACRO_LITERAL(16), %esp                      // pop arguments
-    CFI_ADJUST_CFA_OFFSET(-16)
-    RESTORE_SAVE_REFS_ONLY_FRAME                      // restore frame up to return address
-    CALL_MACRO(return_macro)                          // return or deliver exception
-    END_FUNCTION VAR(c_name)
-END_MACRO
-
-MACRO3(THREE_ARG_REF_DOWNCALL, c_name, cxx_name, return_macro)
-    DEFINE_FUNCTION VAR(c_name)
-    SETUP_SAVE_REFS_ONLY_FRAME ebx                    // save ref containing registers for GC
-    // Outgoing argument set up
-    pushl %fs:THREAD_SELF_OFFSET                      // pass Thread::Current()
-    CFI_ADJUST_CFA_OFFSET(4)
-    PUSH edx                                          // pass arg3
-    PUSH ecx                                          // pass arg2
-    PUSH eax                                          // pass arg1
-    call CALLVAR(cxx_name)                            // cxx_name(arg1, arg2, arg3, Thread*)
-    addl LITERAL(16), %esp                            // pop arguments
-    CFI_ADJUST_CFA_OFFSET(-32)
-    RESTORE_SAVE_REFS_ONLY_FRAME                      // restore frame up to return address
-    CALL_MACRO(return_macro)                          // return or deliver exception
-    END_FUNCTION VAR(c_name)
-END_MACRO
-
     /*
      * Macro for resolution and initialization of indexed DEX file
      * constants such as classes and strings.
@@ -786,14 +718,12 @@
     DEFINE_FUNCTION VAR(c_name)
     SETUP_SAVE_EVERYTHING_FRAME ebx, \runtime_method_offset  // save ref containing registers for GC
     // Outgoing argument set up
-    subl MACRO_LITERAL(8), %esp                       // push padding
-    CFI_ADJUST_CFA_OFFSET(8)
+    INCREASE_FRAME 8                                  // push padding
     pushl %fs:THREAD_SELF_OFFSET                      // pass Thread::Current()
     CFI_ADJUST_CFA_OFFSET(4)
     PUSH eax                                          // pass the index of the constant as arg1
     call CALLVAR(cxx_name)                            // cxx_name(arg1, Thread*)
-    addl MACRO_LITERAL(16), %esp                      // pop arguments
-    CFI_ADJUST_CFA_OFFSET(-16)
+    DECREASE_FRAME 16                                 // pop arguments
     testl %eax, %eax                                  // If result is null deliver pending exception
     jz 1f
     DEOPT_OR_RESTORE_SAVE_EVERYTHING_FRAME_AND_RETURN_EAX ebx,  /* is_ref= */1  // Check for deopt
@@ -806,7 +736,7 @@
     ONE_ARG_SAVE_EVERYTHING_DOWNCALL \c_name, \cxx_name, RUNTIME_SAVE_EVERYTHING_FOR_CLINIT_METHOD_OFFSET
 END_MACRO
 
-MACRO0(RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER)
+MACRO0(RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER)
     testl %eax, %eax                  // eax == 0 ?
     jz  1f                            // if eax == 0 goto 1
     DEOPT_OR_RETURN ebx, /*is_ref=*/1 // check if deopt is required
@@ -814,53 +744,53 @@
     DELIVER_PENDING_EXCEPTION
 END_MACRO
 
-MACRO0(RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION)
+MACRO1(RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION, is_ref = 0)
     cmpl MACRO_LITERAL(0),%fs:THREAD_EXCEPTION_OFFSET // exception field == 0 ?
     jne 1f                                            // if exception field != 0 goto 1
-    DEOPT_OR_RETURN ebx                               // check if deopt is required
+    DEOPT_OR_RETURN ebx, \is_ref                      // check if deopt is required
 1:                                                    // deliver exception on current thread
     DELIVER_PENDING_EXCEPTION
 END_MACRO
 
+MACRO0(RETURN_REF_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION)
+    RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION /*is_ref=*/1
+END_MACRO
+
 MACRO2(DEOPT_OR_RETURN, temp, is_ref = 0)
   cmpl LITERAL(0), %fs:THREAD_DEOPT_CHECK_REQUIRED_OFFSET
   jne 2f
   ret
 2:
   SETUP_SAVE_EVERYTHING_FRAME \temp
-  subl MACRO_LITERAL(4), %esp       // alignment padding
-  CFI_ADJUST_CFA_OFFSET(4)
+  INCREASE_FRAME 4                  // alignment padding
   pushl MACRO_LITERAL(\is_ref)      // is_ref
   CFI_ADJUST_CFA_OFFSET(4)
   PUSH_ARG eax                      // result
   pushl %fs:THREAD_SELF_OFFSET      // Pass Thread::Current
   CFI_ADJUST_CFA_OFFSET(4)
   call SYMBOL(artDeoptimizeIfNeeded)
-  addl LITERAL(16), %esp             // pop arguments
-  CFI_REMEMBER_STATE
+  DECREASE_FRAME(16)                // pop arguments
   RESTORE_SAVE_EVERYTHING_FRAME
   ret
-  CFI_RESTORE_STATE_AND_DEF_CFA esp, FRAME_SIZE_SAVE_EVERYTHING
 END_MACRO
 
 MACRO2(DEOPT_OR_RESTORE_SAVE_EVERYTHING_FRAME_AND_RETURN_EAX, temp, is_ref = 0)
   cmpl LITERAL(0), %fs:THREAD_DEOPT_CHECK_REQUIRED_OFFSET
-  jne 2f
   CFI_REMEMBER_STATE
+  jne 2f
   RESTORE_SAVE_EVERYTHING_FRAME_KEEP_EAX
   ret
-  CFI_RESTORE_STATE_AND_DEF_CFA esp, FRAME_SIZE_SAVE_EVERYTHING
 2:
+  CFI_RESTORE_STATE_AND_DEF_CFA esp, FRAME_SIZE_SAVE_EVERYTHING
   movl %eax, SAVE_EVERYTHING_FRAME_EAX_OFFSET(%esp) // update eax in the frame
-  subl MACRO_LITERAL(4), %esp                       // alignment padding
-  CFI_ADJUST_CFA_OFFSET(4)
+  INCREASE_FRAME 4                                  // alignment padding
   pushl MACRO_LITERAL(\is_ref)                      // is_ref
   CFI_ADJUST_CFA_OFFSET(4)
   PUSH_ARG eax                                      // result
   pushl %fs:THREAD_SELF_OFFSET                      // Pass Thread::Current
   CFI_ADJUST_CFA_OFFSET(4)
   call SYMBOL(artDeoptimizeIfNeeded)
-  addl LITERAL(16), %esp                            // pop arguments
+  DECREASE_FRAME(16)                                // pop arguments
   CFI_REMEMBER_STATE
   RESTORE_SAVE_EVERYTHING_FRAME
   ret
@@ -868,7 +798,7 @@
 END_MACRO
 
 
-MACRO0(RETURN_IF_EAX_ZERO)
+MACRO0(RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER)
     testl %eax, %eax               // eax == 0 ?
     jnz  1f                        // if eax != 0 goto 1
     DEOPT_OR_RETURN ebx            // check if deopt is needed
@@ -970,7 +900,7 @@
 .Lslow_path\c_name:
     SETUP_SAVE_REFS_ONLY_FRAME ebx              // save ref containing registers for GC
     // Outgoing argument set up
-    subl LITERAL(8), %esp                       // alignment padding
+    INCREASE_FRAME(8)                           // alignment padding
     pushl %fs:THREAD_SELF_OFFSET  // pass Thread::Current()
     CFI_ADJUST_CFA_OFFSET(4)
     PUSH eax
@@ -978,7 +908,7 @@
     addl LITERAL(16), %esp                       // pop arguments
     CFI_ADJUST_CFA_OFFSET(-16)
     RESTORE_SAVE_REFS_ONLY_FRAME                 // restore frame up to return address
-    RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER      // return or deliver exception
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER      // return or deliver exception
     END_FUNCTION VAR(c_name)
 END_MACRO
 
@@ -1000,7 +930,6 @@
                                                         // as allocated object.
     addl %edx, %ecx                                     // Add the object size.
     movl %ecx, THREAD_LOCAL_POS_OFFSET(%ebx)            // Update thread_local_pos.
-    incl THREAD_LOCAL_OBJECTS_OFFSET(%ebx)              // Increase thread_local_objects.
                                                         // Store the class pointer in the header.
                                                         // No fence needed for x86.
     POISON_HEAP_REF eax
@@ -1025,7 +954,7 @@
     addl LITERAL(16), %esp
     CFI_ADJUST_CFA_OFFSET(-16)
     RESTORE_SAVE_REFS_ONLY_FRAME                        // restore frame up to return address
-    RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER    // return or deliver exception
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER    // return or deliver exception
 END_MACRO
 
 MACRO2(ART_QUICK_ALLOC_OBJECT_TLAB, c_name, cxx_name)
@@ -1034,8 +963,10 @@
     // EAX: type
     // EBX, ECX, EDX: free.
     PUSH edi
+    CFI_REMEMBER_STATE
     ALLOC_OBJECT_RESOLVED_TLAB_FAST_PATH .Lslow_path\c_name
 .Lslow_path\c_name:
+    CFI_RESTORE_STATE_AND_DEF_CFA esp, 8
     ALLOC_OBJECT_RESOLVED_TLAB_SLOW_PATH RAW_VAR(cxx_name)
     END_FUNCTION VAR(c_name)
 END_MACRO
@@ -1060,7 +991,6 @@
     movl THREAD_LOCAL_POS_OFFSET(%ebx), %edi
     addl %edi, %edx                                            // Add the object size.
     movl %edx, THREAD_LOCAL_POS_OFFSET(%ebx)                   // Update thread_local_pos_
-    addl LITERAL(1), THREAD_LOCAL_OBJECTS_OFFSET(%ebx)         // Increase thread_local_objects.
                                                                // Store the class pointer in the
                                                                // header.
                                                                // No fence needed for x86.
@@ -1076,7 +1006,7 @@
     // Possibly a large object, go slow.
     // Also does negative array size check.
     cmpl LITERAL((MIN_LARGE_OBJECT_THRESHOLD - MIRROR_WIDE_ARRAY_DATA_OFFSET) / 8), %ecx
-    ja RAW_VAR(slow_path)
+    jae RAW_VAR(slow_path)
     PUSH ecx
     movl %ecx, %edx
     movl MIRROR_CLASS_COMPONENT_TYPE_OFFSET(%eax), %ecx        // Load component type.
@@ -1101,7 +1031,7 @@
     // Possibly a large object, go slow.
     // Also does negative array size check.
     cmpl LITERAL(MIN_LARGE_OBJECT_THRESHOLD - MIRROR_INT_ARRAY_DATA_OFFSET), %ecx
-    ja RAW_VAR(slow_path)
+    jae RAW_VAR(slow_path)
     // Add array header + alignment rounding.
     leal (MIRROR_INT_ARRAY_DATA_OFFSET + OBJECT_ALIGNMENT_MASK)(%ecx), %edx
 END_MACRO
@@ -1111,7 +1041,7 @@
     // Possibly a large object, go slow.
     // Also does negative array size check.
     cmpl LITERAL((MIN_LARGE_OBJECT_THRESHOLD - MIRROR_INT_ARRAY_DATA_OFFSET) / 2), %ecx
-    ja RAW_VAR(slow_path)
+    jae RAW_VAR(slow_path)
     // Add array header + alignment rounding.
     leal ((MIRROR_INT_ARRAY_DATA_OFFSET + OBJECT_ALIGNMENT_MASK) / 2)(%ecx), %edx
     sall MACRO_LITERAL(1), %edx
@@ -1122,7 +1052,7 @@
     // Possibly a large object, go slow.
     // Also does negative array size check.
     cmpl LITERAL((MIN_LARGE_OBJECT_THRESHOLD - MIRROR_INT_ARRAY_DATA_OFFSET) / 4), %ecx
-    ja RAW_VAR(slow_path)
+    jae RAW_VAR(slow_path)
     // Add array header + alignment rounding.
     leal ((MIRROR_INT_ARRAY_DATA_OFFSET + OBJECT_ALIGNMENT_MASK) / 4)(%ecx), %edx
     sall MACRO_LITERAL(2), %edx
@@ -1133,7 +1063,7 @@
     // Possibly a large object, go slow.
     // Also does negative array size check.
     cmpl LITERAL((MIN_LARGE_OBJECT_THRESHOLD - MIRROR_WIDE_ARRAY_DATA_OFFSET) / 8), %ecx
-    ja RAW_VAR(slow_path)
+    jae RAW_VAR(slow_path)
     // Add array header + alignment rounding.
     leal ((MIRROR_WIDE_ARRAY_DATA_OFFSET + OBJECT_ALIGNMENT_MASK) / 8)(%ecx), %edx
     sall MACRO_LITERAL(3), %edx
@@ -1144,8 +1074,10 @@
     // EAX: mirror::Class* klass, ECX: int32_t component_count
     PUSH edi
     CALL_MACRO(size_setup) .Lslow_path\c_entrypoint
+    CFI_REMEMBER_STATE
     ALLOC_ARRAY_TLAB_FAST_PATH_RESOLVED_WITH_SIZE .Lslow_path\c_entrypoint
 .Lslow_path\c_entrypoint:
+    CFI_RESTORE_STATE_AND_DEF_CFA esp, 8
     POP edi
     SETUP_SAVE_REFS_ONLY_FRAME ebx                      // save ref containing registers for GC
     // Outgoing argument set up
@@ -1158,7 +1090,7 @@
     addl LITERAL(16), %esp                              // pop arguments
     CFI_ADJUST_CFA_OFFSET(-16)
     RESTORE_SAVE_REFS_ONLY_FRAME                        // restore frame up to return address
-    RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER    // return or deliver exception
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER    // return or deliver exception
     END_FUNCTION VAR(c_entrypoint)
 END_MACRO
 
@@ -1182,7 +1114,9 @@
 ONE_ARG_SAVE_EVERYTHING_DOWNCALL art_quick_resolve_method_type, artResolveMethodTypeFromCode
 ONE_ARG_SAVE_EVERYTHING_DOWNCALL art_quick_resolve_string, artResolveStringFromCode
 
-TWO_ARG_REF_DOWNCALL art_quick_handle_fill_data, artHandleFillArrayDataFromCode, RETURN_IF_EAX_ZERO
+TWO_ARG_DOWNCALL art_quick_handle_fill_data, \
+                 artHandleFillArrayDataFromCode, \
+                 RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
 
     /*
      * Entry from managed code that tries to lock the object in a fast path and
@@ -1214,7 +1148,7 @@
     call SYMBOL(artLockObjectFromCode)    // artLockObjectFromCode(object, Thread*)
     DECREASE_FRAME 16                     // pop arguments
     RESTORE_SAVE_REFS_ONLY_FRAME          // restore frame up to return address
-    RETURN_IF_EAX_ZERO
+    RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
 END_FUNCTION art_quick_lock_object_no_inline
 
     /*
@@ -1248,7 +1182,7 @@
     call SYMBOL(artUnlockObjectFromCode)  // artUnlockObjectFromCode(object, Thread*)
     DECREASE_FRAME 16                     // pop arguments
     RESTORE_SAVE_REFS_ONLY_FRAME          // restore frame up to return address
-    RETURN_IF_EAX_ZERO
+    RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
 END_FUNCTION art_quick_unlock_object_no_inline
 
 DEFINE_FUNCTION art_quick_instance_of
@@ -1298,8 +1232,7 @@
 // Restore reg's value if reg is not the same as exclude_reg, otherwise just adjust stack.
 MACRO2(POP_REG_NE, reg, exclude_reg)
     .ifc RAW_VAR(reg), RAW_VAR(exclude_reg)
-      addl MACRO_LITERAL(4), %esp
-      CFI_ADJUST_CFA_OFFSET(-4)
+      DECREASE_FRAME 4
     .else
       POP RAW_VAR(reg)
     .endif
@@ -1312,6 +1245,7 @@
     UNPOISON_HEAP_REF ebx
 #ifdef USE_READ_BARRIER
     cmpl LITERAL(0), %fs:THREAD_IS_GC_MARKING_OFFSET
+    CFI_REMEMBER_STATE
     jnz .Laput_obj_gc_marking
 #endif  // USE_READ_BARRIER
     movl MIRROR_CLASS_COMPONENT_TYPE_OFFSET(%ebx), %ebx
@@ -1361,9 +1295,6 @@
     ret
 
 .Lthrow_array_store_exception:
-#ifdef USE_READ_BARRIER
-    CFI_REMEMBER_STATE
-#endif  // USE_READ_BARRIER
     SETUP_SAVE_ALL_CALLEE_SAVES_FRAME ebx // Save all registers as basis for long jump context.
     // Outgoing argument set up.
     PUSH_ARG eax                  // Alignment padding.
@@ -1374,8 +1305,8 @@
     UNREACHABLE
 
 #ifdef USE_READ_BARRIER
-    CFI_RESTORE_STATE_AND_DEF_CFA esp, 4
 .Laput_obj_gc_marking:
+    CFI_RESTORE_STATE_AND_DEF_CFA esp, 4
     PUSH_ARG eax                  // Save `art_quick_aput_obj()` arguments.
     PUSH_ARG ecx                  // We need to align stack for `art_quick_read_barrier_mark_regNN`
     PUSH_ARG edx                  // and use a register (EAX) as a temporary for the object class.
@@ -1387,6 +1318,7 @@
     UNPOISON_HEAP_REF eax
     call SYMBOL(art_quick_read_barrier_mark_reg00)  // Mark EAX.
     cmpl %eax, %ebx
+    CFI_REMEMBER_STATE
     jne .Laput_obj_check_assignability_gc_marking
     POP_ARG edx                   // Restore `art_quick_aput_obj()` arguments.
     POP_ARG ecx
@@ -1394,6 +1326,7 @@
     jmp .Laput_obj_store
 
 .Laput_obj_check_assignability_gc_marking:
+    CFI_RESTORE_STATE_AND_DEF_CFA esp, 16
     // Prepare arguments in line with `.Laput_obj_check_assignability_call` and jump there.
     // (EAX, ECX and EDX were already saved in the right stack slots.)
     INCREASE_FRAME 8              // Alignment padding.
@@ -1420,13 +1353,11 @@
 DEFINE_FUNCTION art_quick_test_suspend
     SETUP_SAVE_EVERYTHING_FRAME ebx, RUNTIME_SAVE_EVERYTHING_FOR_SUSPEND_CHECK_METHOD_OFFSET  // save everything for GC
     // Outgoing argument set up
-    subl MACRO_LITERAL(12), %esp                      // push padding
-    CFI_ADJUST_CFA_OFFSET(12)
+    INCREASE_FRAME 12                                 // push padding
     pushl %fs:THREAD_SELF_OFFSET                      // pass Thread::Current()
     CFI_ADJUST_CFA_OFFSET(4)
     call SYMBOL(artTestSuspendFromCode)               // (Thread*)
-    addl MACRO_LITERAL(16), %esp                      // pop arguments
-    CFI_ADJUST_CFA_OFFSET(-16)
+    DECREASE_FRAME 16                                 // pop arguments
     RESTORE_SAVE_EVERYTHING_FRAME                     // restore frame up to return address
     ret                                               // return
 END_FUNCTION art_quick_test_suspend
@@ -1525,35 +1456,17 @@
     ret
 END_FUNCTION art_quick_lushr
 
-// Note: Functions `art{Get,Set}<Kind>{Static,Instance}FromCompiledCode` are
-// defined with a macro in runtime/entrypoints/quick/quick_field_entrypoints.cc.
+GENERATE_STATIC_FIELD_GETTERS
 
-ONE_ARG_REF_DOWNCALL art_quick_get_boolean_static, artGetBooleanStaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get_byte_static, artGetByteStaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get_char_static, artGetCharStaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get_short_static, artGetShortStaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get32_static, artGet32StaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get64_static, artGet64StaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get_obj_static, artGetObjStaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+GENERATE_INSTANCE_FIELD_GETTERS
 
-TWO_ARG_REF_DOWNCALL art_quick_get_boolean_instance, artGetBooleanInstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get_byte_instance, artGetByteInstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get_char_instance, artGetCharInstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get_short_instance, artGetShortInstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get32_instance, artGet32InstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get64_instance, artGet64InstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get_obj_instance, artGetObjInstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+GENERATE_STATIC_FIELD_SETTERS /*emit64=*/0
 
-TWO_ARG_REF_DOWNCALL art_quick_set8_static, artSet8StaticFromCompiledCode, RETURN_IF_EAX_ZERO
-TWO_ARG_REF_DOWNCALL art_quick_set16_static, artSet16StaticFromCompiledCode, RETURN_IF_EAX_ZERO
-TWO_ARG_REF_DOWNCALL art_quick_set32_static, artSet32StaticFromCompiledCode, RETURN_IF_EAX_ZERO
-TWO_ARG_REF_DOWNCALL art_quick_set_obj_static, artSetObjStaticFromCompiledCode, RETURN_IF_EAX_ZERO
+THREE_ARG_DOWNCALL art_quick_set64_static, \
+                   artSet64StaticFromCompiledCode, \
+                   RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
 
-THREE_ARG_REF_DOWNCALL art_quick_set64_static, artSet64StaticFromCompiledCode, RETURN_IF_EAX_ZERO
-THREE_ARG_REF_DOWNCALL art_quick_set8_instance, artSet8InstanceFromCompiledCode, RETURN_IF_EAX_ZERO
-THREE_ARG_REF_DOWNCALL art_quick_set16_instance, artSet16InstanceFromCompiledCode, RETURN_IF_EAX_ZERO
-THREE_ARG_REF_DOWNCALL art_quick_set32_instance, artSet32InstanceFromCompiledCode, RETURN_IF_EAX_ZERO
-THREE_ARG_REF_DOWNCALL art_quick_set_obj_instance, artSetObjInstanceFromCompiledCode, RETURN_IF_EAX_ZERO
+GENERATE_INSTANCE_FIELD_SETTERS /*emit64=*/0
 
 // Call artSet64InstanceFromCode with 4 word size arguments.
 DEFINE_FUNCTION art_quick_set64_instance
@@ -1573,7 +1486,7 @@
     addl LITERAL(32), %esp        // pop arguments
     CFI_ADJUST_CFA_OFFSET(-32)
     RESTORE_SAVE_REFS_ONLY_FRAME  // restore frame up to return address
-    RETURN_IF_EAX_ZERO            // return or deliver exception
+    RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER  // return or deliver exception
 END_FUNCTION art_quick_set64_instance
 
 DEFINE_FUNCTION art_quick_proxy_invoke_handler
@@ -1607,15 +1520,15 @@
     movl ART_METHOD_JNI_OFFSET_32(%eax), %eax  // Load ImtConflictTable.
 .Limt_table_iterate:
     cmpl %esi, 0(%eax)
+    CFI_REMEMBER_STATE
     jne .Limt_table_next_entry
     // We successfully hit an entry in the table. Load the target method
     // and jump to it.
     movl __SIZEOF_POINTER__(%eax), %eax
-    CFI_REMEMBER_STATE
     POP ESI
     jmp *ART_METHOD_QUICK_CODE_OFFSET_32(%eax)
-    CFI_RESTORE_STATE_AND_DEF_CFA esp, 8
 .Limt_table_next_entry:
+    CFI_RESTORE_STATE_AND_DEF_CFA esp, 8
     // If the entry is null, the interface method is not in the ImtConflictTable.
     cmpl LITERAL(0), 0(%eax)
     jz .Lconflict_trampoline
@@ -1644,9 +1557,11 @@
     addl LITERAL(16), %esp        // pop arguments
     CFI_ADJUST_CFA_OFFSET(-16)
     test %eax, %eax               // if code pointer is null goto deliver the OOME.
+    CFI_REMEMBER_STATE
     jz 1f
     RESTORE_SAVE_REFS_AND_ARGS_FRAME_AND_JUMP
 1:
+    CFI_RESTORE_STATE_AND_DEF_CFA esp, 64
     RESTORE_SAVE_REFS_AND_ARGS_FRAME
     DELIVER_PENDING_EXCEPTION
 END_FUNCTION art_quick_resolution_trampoline
@@ -1718,11 +1633,11 @@
 
     LOAD_RUNTIME_INSTANCE ebx
     cmpb MACRO_LITERAL(0), RUN_EXIT_HOOKS_OFFSET_FROM_RUNTIME_INSTANCE(%ebx)
+    CFI_REMEMBER_STATE
     jne .Lcall_method_exit_hook
 .Lcall_method_exit_hook_done:
 
     // Tear down the callee-save frame.
-    CFI_REMEMBER_STATE
     CFI_DEF_CFA_REGISTER(esp)
     // Remove space for the method, FPR and GPR args
     DECREASE_FRAME 4 + 4 * 8 + 3*4
@@ -1732,10 +1647,8 @@
     POP edi
     ret
 
-    // Undo the unwinding information from above since it doesn't apply below.
-    CFI_RESTORE_STATE_AND_DEF_CFA ebp, 64
-
 .Lcall_method_exit_hook:
+    CFI_RESTORE_STATE_AND_DEF_CFA ebp, 64
     movl LITERAL(FRAME_SIZE_SAVE_REFS_AND_ARGS), %ebx
     call art_quick_method_exit_hook
     jmp .Lcall_method_exit_hook_done
@@ -1908,10 +1821,9 @@
     push %eax                                         // pass format
     CFI_ADJUST_CFA_OFFSET(4)
     call SYMBOL(artStringBuilderAppend)               // (uint32_t, const unit32_t*, Thread*)
-    addl MACRO_LITERAL(16), %esp                      // pop arguments
-    CFI_ADJUST_CFA_OFFSET(-16)
+    DECREASE_FRAME 16                                 // pop arguments
     RESTORE_SAVE_REFS_ONLY_FRAME                      // restore frame up to return address
-    RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER  // return or deliver exception
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER  // return or deliver exception
 END_FUNCTION art_quick_string_builder_append
 
 // Create a function `name` calling the ReadBarrier::Mark routine,
@@ -1938,6 +1850,7 @@
     add LITERAL(LOCK_WORD_STATE_FORWARDING_ADDRESS_OVERFLOW), %eax
     // Jump if overflow, the only case where it overflows should be the forwarding address one.
     // Taken ~25% of the time.
+    CFI_REMEMBER_STATE
     jnae .Lret_forwarding_address\name
 
     // Save all potentially live caller-save core registers.
@@ -1947,8 +1860,7 @@
     PUSH ebx
     // 8-byte align the stack to improve (8-byte) XMM register saving and restoring.
     // and create space for caller-save floating-point registers.
-    subl MACRO_LITERAL(4 + 8 * 8), %esp
-    CFI_ADJUST_CFA_OFFSET(4 + 8 * 8)
+    INCREASE_FRAME 4 + 8 * 8
     // Save all potentially live caller-save floating-point registers.
     movsd %xmm0, 0(%esp)
     movsd %xmm1, 8(%esp)
@@ -1979,8 +1891,7 @@
     movsd 48(%esp), %xmm6
     movsd 56(%esp), %xmm7
     // Remove floating-point registers and padding.
-    addl MACRO_LITERAL(8 * 8 + 4), %esp
-    CFI_ADJUST_CFA_OFFSET(-(8 * 8 + 4))
+    DECREASE_FRAME 8 * 8 + 4
     // Restore core regs, except `reg`, as it is used to return the
     // result of this function (simply remove it from the stack instead).
     POP_REG_NE ebx, RAW_VAR(reg)
@@ -1990,6 +1901,7 @@
 .Lret_rb_\name:
     ret
 .Lret_forwarding_address\name:
+    CFI_RESTORE_STATE_AND_DEF_CFA esp, 8
     // The overflow cleared the top bits.
     sall LITERAL(LOCK_WORD_STATE_FORWARDING_ADDRESS_SHIFT), %eax
     mov %eax, REG_VAR(reg)
diff --git a/runtime/arch/x86/registers_x86.cc b/runtime/arch/x86/registers_x86.cc
index 4255d64..e967092 100644
--- a/runtime/arch/x86/registers_x86.cc
+++ b/runtime/arch/x86/registers_x86.cc
@@ -18,7 +18,7 @@
 
 #include <ostream>
 
-namespace art {
+namespace art HIDDEN {
 namespace x86 {
 
 static const char* kRegisterNames[] = {
diff --git a/runtime/arch/x86/registers_x86.h b/runtime/arch/x86/registers_x86.h
index ff6c18f..b26c2ab 100644
--- a/runtime/arch/x86/registers_x86.h
+++ b/runtime/arch/x86/registers_x86.h
@@ -21,7 +21,7 @@
 
 #include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace x86 {
 
 enum Register {
diff --git a/runtime/arch/x86/thread_x86.cc b/runtime/arch/x86/thread_x86.cc
index cca9a91..ab49a32 100644
--- a/runtime/arch/x86/thread_x86.cc
+++ b/runtime/arch/x86/thread_x86.cc
@@ -39,7 +39,7 @@
 #include <asm/ldt.h>
 #endif
 
-namespace art {
+namespace art HIDDEN {
 
 void Thread::InitCpu() {
   // Take the ldt lock, Thread::Current isn't yet established.
diff --git a/runtime/arch/x86_64/asm_support_x86_64.S b/runtime/arch/x86_64/asm_support_x86_64.S
index 012b1df..7efa77b 100644
--- a/runtime/arch/x86_64/asm_support_x86_64.S
+++ b/runtime/arch/x86_64/asm_support_x86_64.S
@@ -170,12 +170,7 @@
 
     /* Cache alignment for function entry */
 MACRO0(ALIGN_FUNCTION_ENTRY)
-    // ART-compiled functions have OatQuickMethodHeader but assembly funtions do not.
-    // Prefix the assembly code with 0xFFs, which means there is no method header.
-    .byte 0xFF, 0xFF, 0xFF, 0xFF
-    // Cache alignment for function entry.
-    // Use 0xFF as the last 4 bytes of alignment stand for OatQuickMethodHeader.
-    .balign 16, 0xFF
+    .balign 16
 END_MACRO
 
 // TODO: we might need to use SYMBOL() here to add the underscore prefix
diff --git a/runtime/arch/x86_64/callee_save_frame_x86_64.h b/runtime/arch/x86_64/callee_save_frame_x86_64.h
index d4f2da7..4865461 100644
--- a/runtime/arch/x86_64/callee_save_frame_x86_64.h
+++ b/runtime/arch/x86_64/callee_save_frame_x86_64.h
@@ -21,11 +21,12 @@
 #include "base/bit_utils.h"
 #include "base/callee_save_type.h"
 #include "base/enums.h"
+#include "base/macros.h"
 #include "quick/quick_method_frame_info.h"
 #include "registers_x86_64.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace x86_64 {
 
 static constexpr uint32_t kX86_64CalleeSaveAlwaysSpills =
diff --git a/runtime/arch/x86_64/context_x86_64.cc b/runtime/arch/x86_64/context_x86_64.cc
index ab3b2c5..196f29f 100644
--- a/runtime/arch/x86_64/context_x86_64.cc
+++ b/runtime/arch/x86_64/context_x86_64.cc
@@ -20,7 +20,7 @@
 #include "base/bit_utils_iterator.h"
 #include "quick/quick_method_frame_info.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace x86_64 {
 
 static constexpr uintptr_t gZero = 0;
diff --git a/runtime/arch/x86_64/context_x86_64.h b/runtime/arch/x86_64/context_x86_64.h
index 1e2658c..19e5f57 100644
--- a/runtime/arch/x86_64/context_x86_64.h
+++ b/runtime/arch/x86_64/context_x86_64.h
@@ -23,7 +23,7 @@
 #include "base/macros.h"
 #include "registers_x86_64.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace x86_64 {
 
 class X86_64Context final : public Context {
diff --git a/runtime/arch/x86_64/entrypoints_init_x86_64.cc b/runtime/arch/x86_64/entrypoints_init_x86_64.cc
index bf98979..f48ff9b 100644
--- a/runtime/arch/x86_64/entrypoints_init_x86_64.cc
+++ b/runtime/arch/x86_64/entrypoints_init_x86_64.cc
@@ -27,7 +27,7 @@
 #include "entrypoints/runtime_asm_entrypoints.h"
 #include "interpreter/interpreter.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Cast entrypoints.
 extern "C" size_t art_quick_instance_of(mirror::Object* obj, mirror::Class* ref_class);
diff --git a/runtime/arch/x86_64/instruction_set_features_x86_64.h b/runtime/arch/x86_64/instruction_set_features_x86_64.h
index 9b90365..e0d4cc3 100644
--- a/runtime/arch/x86_64/instruction_set_features_x86_64.h
+++ b/runtime/arch/x86_64/instruction_set_features_x86_64.h
@@ -18,8 +18,9 @@
 #define ART_RUNTIME_ARCH_X86_64_INSTRUCTION_SET_FEATURES_X86_64_H_
 
 #include "arch/x86/instruction_set_features_x86.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class X86_64InstructionSetFeatures;
 using X86_64FeaturesUniquePtr = std::unique_ptr<const X86_64InstructionSetFeatures>;
diff --git a/runtime/arch/x86_64/instruction_set_features_x86_64_test.cc b/runtime/arch/x86_64/instruction_set_features_x86_64_test.cc
index 3201050..3db81cd 100644
--- a/runtime/arch/x86_64/instruction_set_features_x86_64_test.cc
+++ b/runtime/arch/x86_64/instruction_set_features_x86_64_test.cc
@@ -18,7 +18,7 @@
 
 #include <gtest/gtest.h>
 
-namespace art {
+namespace art HIDDEN {
 
 TEST(X86_64InstructionSetFeaturesTest, X86Features) {
   const bool is_runtime_isa = kRuntimeISA == InstructionSet::kX86_64;
diff --git a/runtime/arch/x86_64/jni_entrypoints_x86_64.S b/runtime/arch/x86_64/jni_entrypoints_x86_64.S
index 55f01b7..a7966db 100644
--- a/runtime/arch/x86_64/jni_entrypoints_x86_64.S
+++ b/runtime/arch/x86_64/jni_entrypoints_x86_64.S
@@ -309,9 +309,8 @@
 
     // Check for exception.
     test %rax, %rax
-    jz .Lcritical_deliver_exception
-
     CFI_REMEMBER_STATE
+    jz .Lcritical_deliver_exception
 
     // Restore the native arg register RDI.
     movq %rbx, %rdi
@@ -382,9 +381,9 @@
 
     // Do the tail call.
     jmp *%rax
-    CFI_RESTORE_STATE_AND_DEF_CFA %rbp, FRAME_SIZE_SAVE_REFS_AND_ARGS
 
 .Lcritical_deliver_exception:
+    CFI_RESTORE_STATE_AND_DEF_CFA %rbp, FRAME_SIZE_SAVE_REFS_AND_ARGS
     DELIVER_PENDING_EXCEPTION_FRAME_READY
 END_FUNCTION art_jni_dlsym_lookup_critical_stub
 
diff --git a/runtime/arch/x86_64/jni_frame_x86_64.h b/runtime/arch/x86_64/jni_frame_x86_64.h
index 959e266..1e16f5f 100644
--- a/runtime/arch/x86_64/jni_frame_x86_64.h
+++ b/runtime/arch/x86_64/jni_frame_x86_64.h
@@ -23,8 +23,9 @@
 #include "base/bit_utils.h"
 #include "base/globals.h"
 #include "base/logging.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace x86_64 {
 
 constexpr size_t kFramePointerSize = static_cast<size_t>(PointerSize::k64);
@@ -98,4 +99,3 @@
 }  // namespace art
 
 #endif  // ART_RUNTIME_ARCH_X86_64_JNI_FRAME_X86_64_H_
-
diff --git a/runtime/arch/x86_64/quick_entrypoints_x86_64.S b/runtime/arch/x86_64/quick_entrypoints_x86_64.S
index e5e200b..10e098d 100644
--- a/runtime/arch/x86_64/quick_entrypoints_x86_64.S
+++ b/runtime/arch/x86_64/quick_entrypoints_x86_64.S
@@ -18,6 +18,7 @@
 #include "interpreter/cfi_asm_support.h"
 
 #include "arch/quick_alloc_entrypoints.S"
+#include "arch/quick_field_entrypoints.S"
 
 MACRO0(ASSERT_USE_READ_BARRIER)
 #if !defined(USE_READ_BARRIER)
@@ -84,8 +85,7 @@
     PUSH rcx
     PUSH rax
     // Create space for FPRs and stack alignment padding.
-    subq MACRO_LITERAL(8 + 16 * 8), %rsp
-    CFI_ADJUST_CFA_OFFSET(8 + 16 * 8)
+    INCREASE_FRAME 8 + 16 * 8
     // R10 := Runtime::Current()
     LOAD_RUNTIME_INSTANCE r10
     // Save FPRs.
@@ -180,8 +180,7 @@
     RESTORE_SAVE_EVERYTHING_FRAME_FRPS
 
     // Remove save everything callee save method, stack alignment padding and FPRs.
-    addq MACRO_LITERAL(16 + 16 * 8), %rsp
-    CFI_ADJUST_CFA_OFFSET(-(16 + 16 * 8))
+    DECREASE_FRAME 16 + 16 * 8
 
     POP rax
     RESTORE_SAVE_EVERYTHING_FRAME_GPRS_EXCEPT_RAX
@@ -191,8 +190,7 @@
     RESTORE_SAVE_EVERYTHING_FRAME_FRPS
 
     // Remove save everything callee save method, stack alignment padding and FPRs, skip RAX.
-    addq MACRO_LITERAL(16 + 16 * 8 + 8), %rsp
-    CFI_ADJUST_CFA_OFFSET(-(16 + 16 * 8 + 8))
+    DECREASE_FRAME 16 + 16 * 8 + 8
 
     RESTORE_SAVE_EVERYTHING_FRAME_GPRS_EXCEPT_RAX
 END_MACRO
@@ -687,39 +685,6 @@
     END_FUNCTION VAR(c_name)
 END_MACRO
 
-MACRO3(ONE_ARG_REF_DOWNCALL, c_name, cxx_name, return_macro)
-    DEFINE_FUNCTION VAR(c_name)
-    SETUP_SAVE_REFS_ONLY_FRAME
-                                        // arg0 is in rdi
-    movq %gs:THREAD_SELF_OFFSET, %rsi   // pass Thread::Current()
-    call CALLVAR(cxx_name)              // cxx_name(arg0, Thread*)
-    RESTORE_SAVE_REFS_ONLY_FRAME        // restore frame up to return address
-    CALL_MACRO(return_macro)
-    END_FUNCTION VAR(c_name)
-END_MACRO
-
-MACRO3(TWO_ARG_REF_DOWNCALL, c_name, cxx_name, return_macro)
-    DEFINE_FUNCTION VAR(c_name)
-    SETUP_SAVE_REFS_ONLY_FRAME
-                                        // arg0 and arg1 are in rdi/rsi
-    movq %gs:THREAD_SELF_OFFSET, %rdx   // pass Thread::Current()
-    call CALLVAR(cxx_name)              // (arg0, arg1, Thread*)
-    RESTORE_SAVE_REFS_ONLY_FRAME        // restore frame up to return address
-    CALL_MACRO(return_macro)
-    END_FUNCTION VAR(c_name)
-END_MACRO
-
-MACRO3(THREE_ARG_REF_DOWNCALL, c_name, cxx_name, return_macro)
-    DEFINE_FUNCTION VAR(c_name)
-    SETUP_SAVE_REFS_ONLY_FRAME
-                                        // arg0, arg1, and arg2 are in rdi/rsi/rdx
-    movq %gs:THREAD_SELF_OFFSET, %rcx   // pass Thread::Current()
-    call CALLVAR(cxx_name)              // cxx_name(arg0, arg1, arg2, Thread*)
-    RESTORE_SAVE_REFS_ONLY_FRAME        // restore frame up to return address
-    CALL_MACRO(return_macro)            // return or deliver exception
-    END_FUNCTION VAR(c_name)
-END_MACRO
-
     /*
      * Macro for resolution and initialization of indexed DEX file
      * constants such as classes and strings.
@@ -743,7 +708,7 @@
     ONE_ARG_SAVE_EVERYTHING_DOWNCALL \c_name, \cxx_name, RUNTIME_SAVE_EVERYTHING_FOR_CLINIT_METHOD_OFFSET
 END_MACRO
 
-MACRO0(RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER)
+MACRO0(RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER)
     testq %rax, %rax               // rax == 0 ?
     jz  1f                         // if rax == 0 goto 1
     DEOPT_OR_RETURN /*is_ref=*/1   // Check if deopt is required
@@ -752,15 +717,19 @@
 END_MACRO
 
 
-MACRO0(RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION)
+MACRO1(RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION, is_ref = 0)
     movq %gs:THREAD_EXCEPTION_OFFSET, %rcx // get exception field
     testq %rcx, %rcx               // rcx == 0 ?
     jnz 1f                         // if rcx != 0 goto 1
-    DEOPT_OR_RETURN                // Check if deopt is required
+    DEOPT_OR_RETURN \is_ref        // Check if deopt is required
 1:                                 // deliver exception on current thread
     DELIVER_PENDING_EXCEPTION
 END_MACRO
 
+MACRO0(RETURN_REF_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION)
+    RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION /*is_ref=*/1
+END_MACRO
+
 MACRO1(DEOPT_OR_RETURN, is_ref = 0)
   cmpl LITERAL(0), %gs:THREAD_DEOPT_CHECK_REQUIRED_OFFSET
   jne 2f
@@ -771,20 +740,18 @@
   movq %rax, %rsi                      // pass the result
   movq %gs:THREAD_SELF_OFFSET, %rdi    // pass Thread::Current
   call SYMBOL(artDeoptimizeIfNeeded)
-  CFI_REMEMBER_STATE
   RESTORE_SAVE_EVERYTHING_FRAME
   ret
-  CFI_RESTORE_STATE_AND_DEF_CFA rsp, FRAME_SIZE_SAVE_EVERYTHING
 END_MACRO
 
 MACRO1(DEOPT_OR_RESTORE_SAVE_EVERYTHING_FRAME_AND_RETURN_RAX, is_ref = 0)
   cmpl LITERAL(0), %gs:THREAD_DEOPT_CHECK_REQUIRED_OFFSET
-  jne 2f
   CFI_REMEMBER_STATE
+  jne 2f
   RESTORE_SAVE_EVERYTHING_FRAME_KEEP_RAX
   ret
-  CFI_RESTORE_STATE_AND_DEF_CFA rsp, FRAME_SIZE_SAVE_EVERYTHING
 2:
+  CFI_RESTORE_STATE_AND_DEF_CFA rsp, FRAME_SIZE_SAVE_EVERYTHING
   movq %rax, SAVE_EVERYTHING_FRAME_RAX_OFFSET(%rsp) // update result in the frame
   movq LITERAL(\is_ref), %rdx                       // pass if result is a reference
   movq %rax, %rsi                                   // pass the result
@@ -798,7 +765,7 @@
 
 
 
-MACRO0(RETURN_IF_EAX_ZERO)
+MACRO0(RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER)
     testl %eax, %eax               // eax == 0 ?
     jnz  1f                        // if eax != 0 goto 1
     DEOPT_OR_RETURN                // Check if we need a deopt
@@ -903,7 +870,7 @@
     movq %gs:THREAD_SELF_OFFSET, %rsi                      // pass Thread::Current()
     call CALLVAR(cxx_name)                                 // cxx_name(arg0, Thread*)
     RESTORE_SAVE_REFS_ONLY_FRAME                           // restore frame up to return address
-    RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER       // return or deliver exception
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER       // return or deliver exception
     END_FUNCTION VAR(c_name)
 END_MACRO
 
@@ -935,7 +902,6 @@
     cmpq THREAD_LOCAL_END_OFFSET(%r8), %rcx                    // Check if it fits.
     ja   RAW_VAR(slowPathLabel)
     movq %rcx, THREAD_LOCAL_POS_OFFSET(%r8)                    // Update thread_local_pos.
-    incq THREAD_LOCAL_OBJECTS_OFFSET(%r8)                      // Increase thread_local_objects.
                                                                // Store the class pointer in the
                                                                // header.
                                                                // No fence needed for x86.
@@ -952,12 +918,13 @@
     movq %gs:THREAD_SELF_OFFSET, %rcx                          // rcx = thread
     // Mask out the unaligned part to make sure we are 8 byte aligned.
     andq LITERAL(OBJECT_ALIGNMENT_MASK_TOGGLED64), %r9
+    cmpq LITERAL(MIN_LARGE_OBJECT_THRESHOLD), %r9              // Possibly a large object.
+    jae  RAW_VAR(slowPathLabel)                                // Go to slow path if large object
     movq THREAD_LOCAL_POS_OFFSET(%rcx), %rax
     addq %rax, %r9
     cmpq THREAD_LOCAL_END_OFFSET(%rcx), %r9                    // Check if it fits.
     ja   RAW_VAR(slowPathLabel)
     movq %r9, THREAD_LOCAL_POS_OFFSET(%rcx)                    // Update thread_local_pos.
-    addq LITERAL(1), THREAD_LOCAL_OBJECTS_OFFSET(%rcx)         // Increase thread_local_objects.
                                                                // Store the class pointer in the
                                                                // header.
                                                                // No fence needed for x86.
@@ -975,7 +942,7 @@
     movq %gs:THREAD_SELF_OFFSET, %rsi                      // pass Thread::Current()
     call CALLVAR(cxx_name)                                 // cxx_name(arg0, Thread*)
     RESTORE_SAVE_REFS_ONLY_FRAME                           // restore frame up to return address
-    RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER       // return or deliver exception
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER       // return or deliver exception
 END_MACRO
 
 // A hand-written override for GENERATE_ALLOC_ENTRYPOINTS_ALLOC_OBJECT_RESOLVED(_tlab, TLAB). May be
@@ -1002,7 +969,7 @@
     movl MIRROR_CLASS_COMPONENT_TYPE_OFFSET(%rdi), %ecx        // Load component type.
     UNPOISON_HEAP_REF ecx
     movl MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET(%rcx), %ecx // Load primitive type.
-    shrq MACRO_LITERAL(PRIMITIVE_TYPE_SIZE_SHIFT_SHIFT), %rcx        // Get component size shift.
+    shrq MACRO_LITERAL(PRIMITIVE_TYPE_SIZE_SHIFT_SHIFT), %rcx  // Get component size shift.
     movq %rsi, %r9
     salq %cl, %r9                                              // Calculate array count shifted.
     // Add array header + alignment rounding.
@@ -1063,7 +1030,7 @@
     movq %gs:THREAD_SELF_OFFSET, %rdx                          // pass Thread::Current()
     call CALLVAR(cxx_name)                                     // cxx_name(arg0, arg1, Thread*)
     RESTORE_SAVE_REFS_ONLY_FRAME                               // restore frame up to return address
-    RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER           // return or deliver exception
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER           // return or deliver exception
     END_FUNCTION VAR(c_entrypoint)
 END_MACRO
 
@@ -1110,7 +1077,9 @@
 ONE_ARG_SAVE_EVERYTHING_DOWNCALL art_quick_resolve_method_type, artResolveMethodTypeFromCode
 ONE_ARG_SAVE_EVERYTHING_DOWNCALL art_quick_resolve_string, artResolveStringFromCode
 
-TWO_ARG_REF_DOWNCALL art_quick_handle_fill_data, artHandleFillArrayDataFromCode, RETURN_IF_EAX_ZERO
+TWO_ARG_DOWNCALL art_quick_handle_fill_data, \
+                 artHandleFillArrayDataFromCode, \
+                 RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
 
     /*
      * Entry from managed code that tries to lock the object in a fast path and
@@ -1133,7 +1102,7 @@
     movq %gs:THREAD_SELF_OFFSET, %rsi     // pass Thread::Current()
     call SYMBOL(artLockObjectFromCode)    // artLockObjectFromCode(object, Thread*)
     RESTORE_SAVE_REFS_ONLY_FRAME          // restore frame up to return address
-    RETURN_IF_EAX_ZERO
+    RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
 END_FUNCTION art_quick_lock_object_no_inline
 
     /*
@@ -1158,7 +1127,7 @@
     movq %gs:THREAD_SELF_OFFSET, %rsi     // pass Thread::Current()
     call SYMBOL(artUnlockObjectFromCode)  // artUnlockObjectFromCode(object, Thread*)
     RESTORE_SAVE_REFS_ONLY_FRAME          // restore frame up to return address
-    RETURN_IF_EAX_ZERO
+    RETURN_OR_DEOPT_IF_INT_RESULT_IS_ZERO_OR_DELIVER
 END_FUNCTION art_quick_unlock_object_no_inline
 
 DEFINE_FUNCTION art_quick_check_instance_of
@@ -1174,15 +1143,15 @@
     SETUP_FP_CALLEE_SAVE_FRAME
     call SYMBOL(artInstanceOfFromCode)  // (Object* obj, Class* ref_klass)
     testq %rax, %rax
-    jz .Lthrow_class_cast_exception   // jump forward if not assignable
     CFI_REMEMBER_STATE
+    jz .Lthrow_class_cast_exception   // jump forward if not assignable
     RESTORE_FP_CALLEE_SAVE_FRAME
     addq LITERAL(24), %rsp            // pop arguments
     CFI_ADJUST_CFA_OFFSET(-24)
     ret
-    CFI_RESTORE_STATE_AND_DEF_CFA rsp, 64  // Reset unwind info so following code unwinds.
 
 .Lthrow_class_cast_exception:
+    CFI_RESTORE_STATE_AND_DEF_CFA rsp, 64  // Reset unwind info so following code unwinds.
     RESTORE_FP_CALLEE_SAVE_FRAME
     addq LITERAL(8), %rsp             // pop padding
     CFI_ADJUST_CFA_OFFSET(-8)
@@ -1200,8 +1169,7 @@
 // Restore reg's value if reg is not the same as exclude_reg, otherwise just adjust stack.
 MACRO2(POP_REG_NE, reg, exclude_reg)
     .ifc RAW_VAR(reg), RAW_VAR(exclude_reg)
-      addq MACRO_LITERAL(8), %rsp
-      CFI_ADJUST_CFA_OFFSET(-8)
+      DECREASE_FRAME 8
     .else
       POP RAW_VAR(reg)
     .endif
@@ -1214,6 +1182,7 @@
     UNPOISON_HEAP_REF ecx
 #ifdef USE_READ_BARRIER
     cmpl LITERAL(0), %gs:THREAD_IS_GC_MARKING_OFFSET
+    CFI_REMEMBER_STATE
     jnz .Laput_obj_gc_marking
 #endif  // USE_READ_BARRIER
     movl MIRROR_CLASS_COMPONENT_TYPE_OFFSET(%rcx), %ecx
@@ -1256,9 +1225,6 @@
     ret
 
 .Laput_obj_throw_array_store_exception:
-#ifdef USE_READ_BARRIER
-    CFI_REMEMBER_STATE
-#endif  // USE_READ_BARRIER
     SETUP_SAVE_ALL_CALLEE_SAVES_FRAME  // Save all registers as basis for long jump context.
     // Outgoing argument set up.
     movq %rdx, %rsi                         // Pass arg 2 = value.
@@ -1268,8 +1234,8 @@
     UNREACHABLE
 
 #ifdef USE_READ_BARRIER
-    CFI_RESTORE_STATE_AND_DEF_CFA rsp, 4
 .Laput_obj_gc_marking:
+    CFI_RESTORE_STATE_AND_DEF_CFA rsp, 8
     // We need to align stack for `art_quick_read_barrier_mark_regNN`.
     INCREASE_FRAME 8                        // Stack alignment.
     call SYMBOL(art_quick_read_barrier_mark_reg01)  // Mark ECX
@@ -1314,36 +1280,7 @@
 UNIMPLEMENTED art_quick_lshr
 UNIMPLEMENTED art_quick_lushr
 
-// Note: Functions `art{Get,Set}<Kind>{Static,Instance}FromCompiledCode` are
-// defined with a macro in runtime/entrypoints/quick/quick_field_entrypoints.cc.
-
-THREE_ARG_REF_DOWNCALL art_quick_set8_instance, artSet8InstanceFromCompiledCode, RETURN_IF_EAX_ZERO
-THREE_ARG_REF_DOWNCALL art_quick_set16_instance, artSet16InstanceFromCompiledCode, RETURN_IF_EAX_ZERO
-THREE_ARG_REF_DOWNCALL art_quick_set32_instance, artSet32InstanceFromCompiledCode, RETURN_IF_EAX_ZERO
-THREE_ARG_REF_DOWNCALL art_quick_set64_instance, artSet64InstanceFromCompiledCode, RETURN_IF_EAX_ZERO
-THREE_ARG_REF_DOWNCALL art_quick_set_obj_instance, artSetObjInstanceFromCompiledCode, RETURN_IF_EAX_ZERO
-
-TWO_ARG_REF_DOWNCALL art_quick_get_byte_instance, artGetByteInstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get_boolean_instance, artGetBooleanInstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get_short_instance, artGetShortInstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get_char_instance, artGetCharInstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get32_instance, artGet32InstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get64_instance, artGet64InstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_get_obj_instance, artGetObjInstanceFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-
-TWO_ARG_REF_DOWNCALL art_quick_set8_static, artSet8StaticFromCompiledCode, RETURN_IF_EAX_ZERO
-TWO_ARG_REF_DOWNCALL art_quick_set16_static, artSet16StaticFromCompiledCode, RETURN_IF_EAX_ZERO
-TWO_ARG_REF_DOWNCALL art_quick_set32_static, artSet32StaticFromCompiledCode, RETURN_IF_EAX_ZERO
-TWO_ARG_REF_DOWNCALL art_quick_set64_static, artSet64StaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-TWO_ARG_REF_DOWNCALL art_quick_set_obj_static, artSetObjStaticFromCompiledCode, RETURN_IF_EAX_ZERO
-
-ONE_ARG_REF_DOWNCALL art_quick_get_byte_static, artGetByteStaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get_boolean_static, artGetBooleanStaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get_short_static, artGetShortStaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get_char_static, artGetCharStaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get32_static, artGet32StaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get64_static, artGet64StaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
-ONE_ARG_REF_DOWNCALL art_quick_get_obj_static, artGetObjStaticFromCompiledCode, RETURN_OR_DEOPT_OR_DELIVER_PENDING_EXCEPTION
+GENERATE_FIELD_ENTRYPOINTS
 
 DEFINE_FUNCTION art_quick_proxy_invoke_handler
     SETUP_SAVE_REFS_AND_ARGS_FRAME_WITH_METHOD_IN_RDI
@@ -1560,11 +1497,11 @@
 
     LOAD_RUNTIME_INSTANCE rcx
     cmpb MACRO_LITERAL(0), RUN_EXIT_HOOKS_OFFSET_FROM_RUNTIME_INSTANCE(%rcx)
+    CFI_REMEMBER_STATE
     jne .Lcall_method_exit_hook
 .Lcall_method_exit_hook_done:
 
     // Tear down the callee-save frame.
-    CFI_REMEMBER_STATE
     CFI_DEF_CFA_REGISTER(rsp)
     // Load callee-save FPRs. Skip FP args.
     movq 80(%rsp), %xmm12
@@ -1583,13 +1520,11 @@
     POP r15  // Callee save.
     ret
 
-    // Undo the unwinding information from above since it doesn't apply below.
-    CFI_RESTORE_STATE_AND_DEF_CFA rbp, 208
-
 .Lcall_method_exit_hook:
-   movq LITERAL(FRAME_SIZE_SAVE_REFS_AND_ARGS), %r8
-   call art_quick_method_exit_hook
-   jmp .Lcall_method_exit_hook_done
+    CFI_RESTORE_STATE_AND_DEF_CFA rbp, 208
+    movq LITERAL(FRAME_SIZE_SAVE_REFS_AND_ARGS), %r8
+    call art_quick_method_exit_hook
+    jmp .Lcall_method_exit_hook_done
 
 .Lexception_in_native:
     pushq %gs:THREAD_TOP_QUICK_FRAME_OFFSET
@@ -1751,7 +1686,7 @@
     movq %gs:THREAD_SELF_OFFSET, %rdx         // pass Thread::Current()
     call artStringBuilderAppend               // (uint32_t, const unit32_t*, Thread*)
     RESTORE_SAVE_REFS_ONLY_FRAME              // restore frame up to return address
-    RETURN_IF_RESULT_IS_NON_ZERO_OR_DEOPT_OR_DELIVER  // return or deopt or deliver exception
+    RETURN_OR_DEOPT_IF_RESULT_IS_NON_NULL_OR_DELIVER  // return or deopt or deliver exception
 END_FUNCTION art_quick_string_builder_append
 
 // Create a function `name` calling the ReadBarrier::Mark routine,
@@ -1780,6 +1715,7 @@
     // Jump if the addl caused eax to unsigned overflow. The only case where it overflows is the
     // forwarding address one.
     // Taken ~25% of the time.
+    CFI_REMEMBER_STATE
     jnae .Lret_forwarding_address\name
 
     // Save all potentially live caller-save core registers.
@@ -1793,8 +1729,7 @@
     PUSH r10
     PUSH r11
     // Create space for caller-save floating-point registers.
-    subq MACRO_LITERAL(12 * 8), %rsp
-    CFI_ADJUST_CFA_OFFSET(12 * 8)
+    INCREASE_FRAME 12 * 8
     // Save all potentially live caller-save floating-point registers.
     movq %xmm0, 0(%rsp)
     movq %xmm1, 8(%rsp)
@@ -1833,8 +1768,7 @@
     movq 80(%rsp), %xmm10
     movq 88(%rsp), %xmm11
     // Remove floating-point registers.
-    addq MACRO_LITERAL(12 * 8), %rsp
-    CFI_ADJUST_CFA_OFFSET(-(12 * 8))
+    DECREASE_FRAME 12 * 8
     // Restore core regs, except `reg`, as it is used to return the
     // result of this function (simply remove it from the stack instead).
     POP_REG_NE r11, RAW_VAR(reg)
@@ -1849,6 +1783,7 @@
 .Lret_rb_\name:
     ret
 .Lret_forwarding_address\name:
+    CFI_RESTORE_STATE_AND_DEF_CFA rsp, 16
     // The overflow cleared the top bits.
     sall LITERAL(LOCK_WORD_STATE_FORWARDING_ADDRESS_SHIFT), %eax
     movq %rax, REG_VAR(reg)
@@ -1928,8 +1863,8 @@
     movl %esi, %ecx               // rcx := size of stack
     movq %rdi, %rsi               // rsi := stack to copy
     movq %rsp, %rbp               // Save stack pointer to RBP for CFI use in .Losr_entry.
-    call .Losr_entry
     CFI_REMEMBER_STATE
+    call .Losr_entry
 
     // Restore stack and callee-saves.
     addq LITERAL(8), %rsp
diff --git a/runtime/arch/x86_64/registers_x86_64.cc b/runtime/arch/x86_64/registers_x86_64.cc
index f29c426..50c382d 100644
--- a/runtime/arch/x86_64/registers_x86_64.cc
+++ b/runtime/arch/x86_64/registers_x86_64.cc
@@ -18,7 +18,7 @@
 
 #include <ostream>
 
-namespace art {
+namespace art HIDDEN {
 namespace x86_64 {
 
 static const char* kRegisterNames[] = {
diff --git a/runtime/arch/x86_64/registers_x86_64.h b/runtime/arch/x86_64/registers_x86_64.h
index 248c82b..511eecc 100644
--- a/runtime/arch/x86_64/registers_x86_64.h
+++ b/runtime/arch/x86_64/registers_x86_64.h
@@ -21,7 +21,7 @@
 
 #include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace x86_64 {
 
 enum Register {
diff --git a/runtime/arch/x86_64/thread_x86_64.cc b/runtime/arch/x86_64/thread_x86_64.cc
index b01a1d3..d157bc6 100644
--- a/runtime/arch/x86_64/thread_x86_64.cc
+++ b/runtime/arch/x86_64/thread_x86_64.cc
@@ -31,7 +31,7 @@
 #include <zircon/syscalls/object.h>
 #endif
 
-namespace art {
+namespace art HIDDEN {
 
 #if defined(__linux__)
 static void arch_prctl(int code, void* val) {
diff --git a/runtime/art_field-inl.h b/runtime/art_field-inl.h
index e99642c..7137658 100644
--- a/runtime/art_field-inl.h
+++ b/runtime/art_field-inl.h
@@ -32,7 +32,7 @@
 #include "obj_ptr-inl.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 inline bool ArtField::IsProxyField() {
   // No read barrier needed, we're reading the constant declaring class only to read
@@ -202,6 +202,10 @@
   FIELD_GET(object, Char);
 }
 
+inline uint16_t ArtField::GetCharacter(ObjPtr<mirror::Object> object) {
+  return GetChar(object);
+}
+
 template<bool kTransactionActive>
 inline void ArtField::SetChar(ObjPtr<mirror::Object> object, uint16_t c) {
   if (kIsDebugBuild) {
@@ -236,6 +240,10 @@
   return Get32(object);
 }
 
+inline int32_t ArtField::GetInteger(ObjPtr<mirror::Object> object) {
+  return GetInt(object);
+}
+
 template<bool kTransactionActive>
 inline void ArtField::SetInt(ObjPtr<mirror::Object> object, int32_t i) {
   if (kIsDebugBuild) {
@@ -409,7 +417,7 @@
   return nullptr;
 }
 
-template <bool kExactOffset>
+template <bool kExactOffset, VerifyObjectFlags kVerifyFlags, ReadBarrierOption kReadBarrierOption>
 inline ArtField* ArtField::FindInstanceFieldWithOffset(ObjPtr<mirror::Class> klass,
                                                        uint32_t field_offset) {
   DCHECK(klass != nullptr);
@@ -418,8 +426,11 @@
     return field;
   }
   // We did not find field in the class: look into superclass.
-  return (klass->GetSuperClass() != nullptr) ?
-      FindInstanceFieldWithOffset<kExactOffset>(klass->GetSuperClass(), field_offset) : nullptr;
+  ObjPtr<mirror::Class> super_class = klass->GetSuperClass<kVerifyFlags, kReadBarrierOption>();
+  return (super_class != nullptr)
+      ? FindInstanceFieldWithOffset<kExactOffset, kVerifyFlags, kReadBarrierOption>(
+          super_class, field_offset) :
+      nullptr;
 }
 
 template <bool kExactOffset>
diff --git a/runtime/art_field.cc b/runtime/art_field.cc
index c248bf7..dcfd758 100644
--- a/runtime/art_field.cc
+++ b/runtime/art_field.cc
@@ -29,7 +29,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 
 void ArtField::SetOffset(MemberOffset num_bytes) {
   DCHECK(GetDeclaringClass()->IsLoaded() || GetDeclaringClass()->IsErroneous());
diff --git a/runtime/art_field.h b/runtime/art_field.h
index c205920..49899da 100644
--- a/runtime/art_field.h
+++ b/runtime/art_field.h
@@ -17,14 +17,16 @@
 #ifndef ART_RUNTIME_ART_FIELD_H_
 #define ART_RUNTIME_ART_FIELD_H_
 
+#include "base/macros.h"
 #include "dex/modifiers.h"
 #include "dex/primitive.h"
 #include "gc_root.h"
 #include "obj_ptr.h"
 #include "offsets.h"
 #include "read_barrier_option.h"
+#include "verify_object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class DexFile;
 template<typename T> class LengthPrefixedArray;
@@ -38,7 +40,7 @@
 class String;
 }  // namespace mirror
 
-class ArtField final {
+class EXPORT ArtField final {
  public:
   // Visit declaring classes of all the art-fields in 'array' that reside
   // in [start_boundary, end_boundary).
@@ -124,6 +126,7 @@
   void SetByte(ObjPtr<mirror::Object> object, int8_t b) REQUIRES_SHARED(Locks::mutator_lock_);
 
   uint16_t GetChar(ObjPtr<mirror::Object> object) REQUIRES_SHARED(Locks::mutator_lock_);
+  uint16_t GetCharacter(ObjPtr<mirror::Object> object) REQUIRES_SHARED(Locks::mutator_lock_);
 
   template<bool kTransactionActive>
   void SetChar(ObjPtr<mirror::Object> object, uint16_t c) REQUIRES_SHARED(Locks::mutator_lock_);
@@ -134,6 +137,7 @@
   void SetShort(ObjPtr<mirror::Object> object, int16_t s) REQUIRES_SHARED(Locks::mutator_lock_);
 
   int32_t GetInt(ObjPtr<mirror::Object> object) REQUIRES_SHARED(Locks::mutator_lock_);
+  int32_t GetInteger(ObjPtr<mirror::Object> object) REQUIRES_SHARED(Locks::mutator_lock_);
 
   template<bool kTransactionActive>
   void SetInt(ObjPtr<mirror::Object> object, int32_t i) REQUIRES_SHARED(Locks::mutator_lock_);
@@ -196,7 +200,9 @@
   // Returns an instance field with this offset in the given class or null if not found.
   // If kExactOffset is true then we only find the matching offset, not the field containing the
   // offset.
-  template <bool kExactOffset = true>
+  template <bool kExactOffset = true,
+            VerifyObjectFlags kVerifyFlags = kDefaultVerifyFlags,
+            ReadBarrierOption kReadBarrierOption = kWithReadBarrier>
   static ArtField* FindInstanceFieldWithOffset(ObjPtr<mirror::Class> klass, uint32_t field_offset)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
diff --git a/runtime/art_method-alloc-inl.h b/runtime/art_method-alloc-inl.h
index 13051b1..f91063c 100644
--- a/runtime/art_method-alloc-inl.h
+++ b/runtime/art_method-alloc-inl.h
@@ -23,7 +23,7 @@
 #include "handle_scope.h"
 #include "mirror/class-alloc-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace detail {
 
diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h
index 3ea5130..297b540 100644
--- a/runtime/art_method-inl.h
+++ b/runtime/art_method-inl.h
@@ -19,7 +19,6 @@
 
 #include "art_method.h"
 
-#include "art_field.h"
 #include "base/callee_save_type.h"
 #include "class_linker-inl.h"
 #include "common_throws.h"
@@ -32,9 +31,7 @@
 #include "dex/signature.h"
 #include "gc_root-inl.h"
 #include "imtable-inl.h"
-#include "intrinsics_enum.h"
-#include "jit/jit.h"
-#include "jit/profiling_info.h"
+#include "jit/jit_options.h"
 #include "mirror/class-inl.h"
 #include "mirror/dex_cache-inl.h"
 #include "mirror/object-inl.h"
@@ -46,13 +43,13 @@
 #include "runtime-inl.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace detail {
 
 template <> struct ShortyTraits<'V'> {
   using Type = void;
-  static Type Get(const JValue& value ATTRIBUTE_UNUSED) {}
+  static Type Get([[maybe_unused]] const JValue& value) {}
   // `kVRegCount` and `Set()` are not defined.
 };
 
@@ -152,8 +149,8 @@
 }
 
 template <char... ArgType>
-inline ALWAYS_INLINE void FillVRegs(uint32_t* vregs ATTRIBUTE_UNUSED,
-                                    typename ShortyTraits<ArgType>::Type... args ATTRIBUTE_UNUSED)
+inline ALWAYS_INLINE void FillVRegs([[maybe_unused]] uint32_t* vregs,
+                                    [[maybe_unused]] typename ShortyTraits<ArgType>::Type... args)
     REQUIRES_SHARED(Locks::mutator_lock_) {}
 
 template <char FirstArgType, char... ArgType>
@@ -184,7 +181,11 @@
   JValue result;
   constexpr auto shorty = detail::MaterializeShorty<ReturnType, ArgType...>();
   auto vregs = detail::MaterializeVRegs<ArgType...>(args...);
-  Invoke(self, vregs.data(), sizeof(vregs), &result, shorty.data());
+  Invoke(self,
+         vregs.empty() ? nullptr : vregs.data(),
+         vregs.size() * sizeof(typename decltype(vregs)::value_type),
+         &result,
+         shorty.data());
   return detail::ShortyTraits<ReturnType>::Get(result);
 }
 
@@ -198,7 +199,11 @@
   JValue result;
   constexpr auto shorty = detail::MaterializeShorty<ReturnType, ArgType...>();
   auto vregs = detail::MaterializeVRegs<'L', ArgType...>(receiver, args...);
-  Invoke(self, vregs.data(), sizeof(vregs), &result, shorty.data());
+  Invoke(self,
+         vregs.data(),
+         vregs.size() * sizeof(typename decltype(vregs)::value_type),
+         &result,
+         shorty.data());
   return detail::ShortyTraits<ReturnType>::Get(result);
 }
 
@@ -396,6 +401,12 @@
   return dex_file->GetMethodShorty(dex_file->GetMethodId(GetDexMethodIndex()), out_length);
 }
 
+inline std::string_view ArtMethod::GetShortyView() {
+  DCHECK(!IsProxyMethod());
+  const DexFile* dex_file = GetDexFile();
+  return dex_file->GetMethodShortyView(dex_file->GetMethodId(GetDexMethodIndex()));
+}
+
 inline const Signature ArtMethod::GetSignature() {
   uint32_t dex_method_idx = GetDexMethodIndex();
   if (dex_method_idx != dex::kDexNoIndex) {
diff --git a/runtime/art_method.cc b/runtime/art_method.cc
index b500d9b..8ceda01 100644
--- a/runtime/art_method.cc
+++ b/runtime/art_method.cc
@@ -48,13 +48,12 @@
 #include "mirror/object-inl.h"
 #include "mirror/object_array-inl.h"
 #include "mirror/string.h"
-#include "oat_file-inl.h"
-#include "quicken_info.h"
+#include "oat/oat_file-inl.h"
 #include "runtime_callbacks.h"
 #include "scoped_thread_state_change-inl.h"
 #include "vdex_file.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -227,11 +226,11 @@
   }
 }
 
-size_t ArtMethod::NumArgRegisters(const char* shorty) {
-  CHECK_NE(shorty[0], '\0');
+size_t ArtMethod::NumArgRegisters(std::string_view shorty) {
+  CHECK(!shorty.empty());
   uint32_t num_registers = 0;
-  for (const char* s = shorty + 1; *s != '\0'; ++s) {
-    if (*s == 'D' || *s == 'J') {
+  for (char c : shorty.substr(1u)) {
+    if (c == 'D' || c == 'J') {
       num_registers += 2;
     } else {
       num_registers += 1;
@@ -606,11 +605,13 @@
   // methods or proxy invoke handlers which are handled earlier.
   DCHECK_NE(pc, 0u) << "PC 0 for " << PrettyMethod();
 
-  // Check whether the current entry point contains this pc.
+  // Check whether the current entry point contains this pc. We need to manually
+  // check some entrypoints in case they are trampolines in the oat file.
   if (!class_linker->IsQuickGenericJniStub(existing_entry_point) &&
       !class_linker->IsQuickResolutionStub(existing_entry_point) &&
       !class_linker->IsQuickToInterpreterBridge(existing_entry_point) &&
-      existing_entry_point != GetInvokeObsoleteMethodStub()) {
+      !OatQuickMethodHeader::IsStub(
+          reinterpret_cast<const uint8_t*>(existing_entry_point)).value_or(true)) {
     OatQuickMethodHeader* method_header =
         OatQuickMethodHeader::FromEntryPoint(existing_entry_point);
 
@@ -632,12 +633,16 @@
       DCHECK(method_header->Contains(pc));
       return method_header;
     } else {
-      DCHECK(!code_cache->ContainsPc(reinterpret_cast<const void*>(pc)))
-          << PrettyMethod()
-          << ", pc=" << std::hex << pc
-          << ", entry_point=" << std::hex << reinterpret_cast<uintptr_t>(existing_entry_point)
-          << ", copy=" << std::boolalpha << IsCopied()
-          << ", proxy=" << std::boolalpha << IsProxyMethod();
+      if (kIsDebugBuild && code_cache->ContainsPc(reinterpret_cast<const void*>(pc))) {
+        code_cache->DumpAllCompiledMethods(LOG_STREAM(FATAL_WITHOUT_ABORT));
+        LOG(FATAL)
+            << PrettyMethod()
+            << ", pc=" << std::hex << pc
+            << ", entry_point=" << std::hex << reinterpret_cast<uintptr_t>(existing_entry_point)
+            << ", copy=" << std::boolalpha << IsCopied()
+            << ", proxy=" << std::boolalpha << IsProxyMethod()
+            << ", is_native=" << std::boolalpha << IsNative();
+      }
     }
   }
 
@@ -646,12 +651,21 @@
   OatFile::OatMethod oat_method =
       FindOatMethodFor(this, class_linker->GetImagePointerSize(), &found);
   if (!found) {
-    CHECK(IsNative());
+    if (!IsNative()) {
+      PrintFileToLog("/proc/self/maps", LogSeverity::FATAL_WITHOUT_ABORT);
+      MemMap::DumpMaps(LOG_STREAM(FATAL_WITHOUT_ABORT), /* terse= */ true);
+      LOG(FATAL)
+          << PrettyMethod()
+          << " pc=" << pc
+          << ", entrypoint= " << std::hex << reinterpret_cast<uintptr_t>(existing_entry_point)
+          << ", jit= " << jit;
+    }
     // We are running the GenericJNI stub. The entrypoint may point
     // to different entrypoints or to a JIT-compiled JNI stub.
     DCHECK(class_linker->IsQuickGenericJniStub(existing_entry_point) ||
            class_linker->IsQuickResolutionStub(existing_entry_point) ||
            (jit != nullptr && jit->GetCodeCache()->ContainsPc(existing_entry_point)))
+        << " method: " << PrettyMethod()
         << " entrypoint: " << existing_entry_point
         << " size: " << OatQuickMethodHeader::FromEntryPoint(existing_entry_point)->GetCodeSize()
         << " pc: " << reinterpret_cast<const void*>(pc);
@@ -659,7 +673,21 @@
   }
   const void* oat_entry_point = oat_method.GetQuickCode();
   if (oat_entry_point == nullptr || class_linker->IsQuickGenericJniStub(oat_entry_point)) {
-    DCHECK(IsNative()) << PrettyMethod();
+    if (kIsDebugBuild && !IsNative()) {
+      PrintFileToLog("/proc/self/maps", LogSeverity::FATAL_WITHOUT_ABORT);
+      MemMap::DumpMaps(LOG_STREAM(FATAL_WITHOUT_ABORT), /* terse= */ true);
+      LOG(FATAL)
+          << PrettyMethod()
+          << std::hex
+          << " pc=" << pc
+          << ", entrypoint= " << reinterpret_cast<uintptr_t>(existing_entry_point)
+          << ", jit= " << jit
+          << ", nterp_start= "
+          << reinterpret_cast<uintptr_t>(OatQuickMethodHeader::NterpImpl.data())
+          << ", nterp_end= "
+          << reinterpret_cast<uintptr_t>(
+                 OatQuickMethodHeader::NterpImpl.data() + OatQuickMethodHeader::NterpImpl.size());
+    }
     return nullptr;
   }
 
diff --git a/runtime/art_method.h b/runtime/art_method.h
index b5d6ee7..dff49e2 100644
--- a/runtime/art_method.h
+++ b/runtime/art_method.h
@@ -39,7 +39,7 @@
 #include "offsets.h"
 #include "read_barrier_option.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class CodeItemDataAccessor;
 class CodeItemDebugInfoAccessor;
@@ -84,7 +84,7 @@
 template <> struct HandleShortyTraits<'L'>;
 }  // namespace detail
 
-class ArtMethod final {
+class EXPORT ArtMethod final {
  public:
   // Should the class state be checked on sensitive operations?
   DECLARE_RUNTIME_DEBUG_FLAG(kCheckDeclaringClassState);
@@ -584,10 +584,19 @@
     AddAccessFlags(kAccNterpEntryPointFastPathFlag);
   }
 
+  void ClearNterpEntryPointFastPathFlag() REQUIRES_SHARED(Locks::mutator_lock_) {
+    DCHECK(!IsNative());
+    ClearAccessFlags(kAccNterpEntryPointFastPathFlag);
+  }
+
   void SetNterpInvokeFastPathFlag() REQUIRES_SHARED(Locks::mutator_lock_) {
     AddAccessFlags(kAccNterpInvokeFastPathFlag);
   }
 
+  void ClearNterpInvokeFastPathFlag() REQUIRES_SHARED(Locks::mutator_lock_) {
+    ClearAccessFlags(kAccNterpInvokeFastPathFlag);
+  }
+
   // Returns whether the method is a string constructor. The method must not
   // be a class initializer. (Class initializers are called from a different
   // context where we do not need to check for string constructors.)
@@ -631,7 +640,7 @@
   }
 
   // Number of 32bit registers that would be required to hold all the arguments
-  static size_t NumArgRegisters(const char* shorty);
+  static size_t NumArgRegisters(std::string_view shorty);
 
   ALWAYS_INLINE uint32_t GetDexMethodIndex() const {
     return dex_method_index_;
@@ -903,6 +912,8 @@
 
   const char* GetShorty(uint32_t* out_length) REQUIRES_SHARED(Locks::mutator_lock_);
 
+  std::string_view GetShortyView() REQUIRES_SHARED(Locks::mutator_lock_);
+
   const Signature GetSignature() REQUIRES_SHARED(Locks::mutator_lock_);
 
   ALWAYS_INLINE const char* GetName() REQUIRES_SHARED(Locks::mutator_lock_);
diff --git a/runtime/art_method_test.cc b/runtime/art_method_test.cc
index b1e9ed3..8176cca 100644
--- a/runtime/art_method_test.cc
+++ b/runtime/art_method_test.cc
@@ -23,7 +23,7 @@
 #include "mirror/class-alloc-inl.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace {
 // Helper function to avoid `ASSERT_EQ` with floating point types.
diff --git a/runtime/art_standalone_runtime_tests.xml b/runtime/art_standalone_runtime_tests.xml
index b210f5e..d0e959c 100644
--- a/runtime/art_standalone_runtime_tests.xml
+++ b/runtime/art_standalone_runtime_tests.xml
@@ -15,6 +15,7 @@
 -->
 <configuration description="Runs art_standalone_runtime_tests.">
     <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
 
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
         <option name="cleanup" value="true" />
@@ -80,8 +81,6 @@
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp/art_standalone_runtime_tests" />
         <option name="module-name" value="art_standalone_runtime_tests" />
-        <option name="ld-library-path-32" value="/apex/com.android.art/lib" />
-        <option name="ld-library-path-64" value="/apex/com.android.art/lib64" />
 
         <!-- The following tests from `art_standalone_runtime_tests` are currently failing
              (observed on `aosp_cf_x86_64_phone-userdebug`).
diff --git a/runtime/backtrace_helper.cc b/runtime/backtrace_helper.cc
index 260843d..16beb8e 100644
--- a/runtime/backtrace_helper.cc
+++ b/runtime/backtrace_helper.cc
@@ -38,7 +38,7 @@
 
 #endif
 
-namespace art {
+namespace art HIDDEN {
 
 // We only really support libunwindstack on linux which is unfortunate but since this is only for
 // gcstress this isn't a huge deal.
diff --git a/runtime/backtrace_helper.h b/runtime/backtrace_helper.h
index 9be2550..9be08ca 100644
--- a/runtime/backtrace_helper.h
+++ b/runtime/backtrace_helper.h
@@ -20,11 +20,13 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include "base/macros.h"
+
 namespace unwindstack {
 class Unwinder;
 }
 
-namespace art {
+namespace art HIDDEN {
 
 // Using libunwindstack
 class BacktraceCollector {
diff --git a/runtime/barrier.cc b/runtime/barrier.cc
index a6cc9ba..6a9bdfc 100644
--- a/runtime/barrier.cc
+++ b/runtime/barrier.cc
@@ -23,7 +23,7 @@
 #include "base/time_utils.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 Barrier::Barrier(int count, bool verify_count_on_shutdown)
     : count_(count),
diff --git a/runtime/barrier.h b/runtime/barrier.h
index 4c94a14..d2ff5b2 100644
--- a/runtime/barrier.h
+++ b/runtime/barrier.h
@@ -30,8 +30,9 @@
 #include <memory>
 
 #include "base/locks.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ConditionVariable;
 class LOCKABLE Mutex;
@@ -39,18 +40,18 @@
 // TODO: Maybe give this a better name.
 class Barrier {
  public:
-  enum LockHandling {
+  enum EXPORT LockHandling {
     kAllowHoldingLocks,
     kDisallowHoldingLocks,
   };
 
   // If verify_count_on_shutdown is true, the destructor verifies that the count is zero in the
   // destructor. This means that all expected threads went through the barrier.
-  explicit Barrier(int count, bool verify_count_on_shutdown = true);
-  virtual ~Barrier();
+  EXPORT explicit Barrier(int count, bool verify_count_on_shutdown = true);
+  EXPORT virtual ~Barrier();
 
   // Pass through the barrier, decrement the count but do not block.
-  void Pass(Thread* self) REQUIRES(!GetLock());
+  EXPORT void Pass(Thread* self) REQUIRES(!GetLock());
   // Increment the barrier but do not block. The caller should ensure that it
   // decrements/passes it eventually.
   void IncrementNoWait(Thread* self) REQUIRES(!GetLock());
@@ -67,7 +68,7 @@
   // Increment the count by delta, wait on condition while count is non zero.  If LockHandling is
   // kAllowHoldingLocks we will not check that all locks are released when waiting.
   template <Barrier::LockHandling locks = kDisallowHoldingLocks>
-  void Increment(Thread* self, int delta) REQUIRES(!GetLock());
+  EXPORT void Increment(Thread* self, int delta) REQUIRES(!GetLock());
 
   // Increment the count by delta, wait on condition while count is non zero, with a timeout.
   // Returns true if time out occurred.
diff --git a/runtime/barrier_test.cc b/runtime/barrier_test.cc
index 52959bd..fbb2639 100644
--- a/runtime/barrier_test.cc
+++ b/runtime/barrier_test.cc
@@ -24,7 +24,7 @@
 #include "thread-current-inl.h"
 #include "thread_pool.h"
 
-namespace art {
+namespace art HIDDEN {
 class CheckWaitTask : public Task {
  public:
   CheckWaitTask(Barrier* barrier, AtomicInteger* count1, AtomicInteger* count2)
@@ -64,15 +64,16 @@
 // Check that barrier wait and barrier increment work.
 TEST_F(BarrierTest, CheckWait) {
   Thread* self = Thread::Current();
-  ThreadPool thread_pool("Barrier test thread pool", num_threads);
+  std::unique_ptr<ThreadPool> thread_pool(
+      ThreadPool::Create("Barrier test thread pool", num_threads));
   Barrier barrier(num_threads + 1);  // One extra Wait() in main thread.
   Barrier timeout_barrier(0);  // Only used for sleeping on timeout.
   AtomicInteger count1(0);
   AtomicInteger count2(0);
   for (int32_t i = 0; i < num_threads; ++i) {
-    thread_pool.AddTask(self, new CheckWaitTask(&barrier, &count1, &count2));
+    thread_pool->AddTask(self, new CheckWaitTask(&barrier, &count1, &count2));
   }
-  thread_pool.StartWorkers(self);
+  thread_pool->StartWorkers(self);
   while (count1.load(std::memory_order_relaxed) != num_threads) {
     timeout_barrier.Increment(self, 1, 100);  // sleep 100 msecs
   }
@@ -81,7 +82,7 @@
   // Perform one additional Wait(), allowing pool threads to proceed.
   barrier.Wait(self);
   // Wait for all the threads to finish.
-  thread_pool.Wait(self, true, false);
+  thread_pool->Wait(self, true, false);
   // Both counts should be equal to num_threads now.
   EXPECT_EQ(count1.load(std::memory_order_relaxed), num_threads);
   EXPECT_EQ(count2.load(std::memory_order_relaxed), num_threads);
@@ -115,15 +116,16 @@
 // Check that barrier pass through works.
 TEST_F(BarrierTest, CheckPass) {
   Thread* self = Thread::Current();
-  ThreadPool thread_pool("Barrier test thread pool", num_threads);
+  std::unique_ptr<ThreadPool> thread_pool(
+      ThreadPool::Create("Barrier test thread pool", num_threads));
   Barrier barrier(0);
   AtomicInteger count(0);
   const int32_t num_tasks = num_threads * 4;
   const int32_t num_sub_tasks = 128;
   for (int32_t i = 0; i < num_tasks; ++i) {
-    thread_pool.AddTask(self, new CheckPassTask(&barrier, &count, num_sub_tasks));
+    thread_pool->AddTask(self, new CheckPassTask(&barrier, &count, num_sub_tasks));
   }
-  thread_pool.StartWorkers(self);
+  thread_pool->StartWorkers(self);
   const int32_t expected_total_tasks = num_sub_tasks * num_tasks;
   // Wait for all the tasks to complete using the barrier.
   barrier.Increment(self, expected_total_tasks);
diff --git a/runtime/base/atomic_pair.h b/runtime/base/atomic_pair.h
index 1523b3b..8ba8faf 100644
--- a/runtime/base/atomic_pair.h
+++ b/runtime/base/atomic_pair.h
@@ -17,65 +17,82 @@
 #ifndef ART_RUNTIME_BASE_ATOMIC_PAIR_H_
 #define ART_RUNTIME_BASE_ATOMIC_PAIR_H_
 
-#include "base/macros.h"
+#include <android-base/logging.h>
 
+#include <atomic>
 #include <type_traits>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
+
+// Implement 16-byte atomic pair using the seq-lock synchronization algorithm.
+// This is currently only used for DexCache.
+//
+// This uses top 4-bytes of the key as version counter and lock bit,
+// which means the stored pair key can not use those bytes.
+//
+// This allows us to read the cache without exclusive access to the cache line.
+//
+// The 8-byte atomic pair uses the normal single-instruction implementation.
+//
+static constexpr uint64_t kSeqMask = (0xFFFFFFFFull << 32);
+static constexpr uint64_t kSeqLock = (0x80000000ull << 32);
+static constexpr uint64_t kSeqIncr = (0x00000001ull << 32);
 
 // std::pair<> is not trivially copyable and as such it is unsuitable for atomic operations.
 template <typename IntType>
 struct PACKED(2 * sizeof(IntType)) AtomicPair {
   static_assert(std::is_integral_v<IntType>);
 
-  constexpr AtomicPair() : first(0), second(0) { }
-  AtomicPair(IntType f, IntType s) : first(f), second(s) { }
-  AtomicPair(const AtomicPair&) = default;
-  AtomicPair& operator=(const AtomicPair&) = default;
+  AtomicPair(IntType f, IntType s) : key(f), val(s) {}
 
-  IntType first;
-  IntType second;
+  IntType key;
+  IntType val;
 };
 
 template <typename IntType>
-ALWAYS_INLINE static inline AtomicPair<IntType> AtomicPairLoadAcquire(
-    std::atomic<AtomicPair<IntType>>* target) {
+ALWAYS_INLINE static inline AtomicPair<IntType> AtomicPairLoadAcquire(AtomicPair<IntType>* pair) {
+  static_assert(std::is_trivially_copyable<AtomicPair<IntType>>::value);
+  auto* target = reinterpret_cast<std::atomic<AtomicPair<IntType>>*>(pair);
   return target->load(std::memory_order_acquire);
 }
 
 template <typename IntType>
-ALWAYS_INLINE static inline void AtomicPairStoreRelease(std::atomic<AtomicPair<IntType>>* target,
+ALWAYS_INLINE static inline void AtomicPairStoreRelease(AtomicPair<IntType>* pair,
                                                         AtomicPair<IntType> value) {
+  static_assert(std::is_trivially_copyable<AtomicPair<IntType>>::value);
+  auto* target = reinterpret_cast<std::atomic<AtomicPair<IntType>>*>(pair);
   target->store(value, std::memory_order_release);
 }
 
-// LLVM uses generic lock-based implementation for x86_64, we can do better with CMPXCHG16B.
-#if defined(__x86_64__)
-ALWAYS_INLINE static inline AtomicPair<uint64_t> AtomicPairLoadAcquire(
-    std::atomic<AtomicPair<uint64_t>>* target) {
-  uint64_t first, second;
-  __asm__ __volatile__(
-      "lock cmpxchg16b (%2)"
-      : "=&a"(first), "=&d"(second)
-      : "r"(target), "a"(0), "d"(0), "b"(0), "c"(0)
-      : "cc");
-  return {first, second};
+ALWAYS_INLINE static inline AtomicPair<uint64_t> AtomicPairLoadAcquire(AtomicPair<uint64_t>* pair) {
+  auto* key_ptr = reinterpret_cast<std::atomic_uint64_t*>(&pair->key);
+  auto* val_ptr = reinterpret_cast<std::atomic_uint64_t*>(&pair->val);
+  while (true) {
+    uint64_t key0 = key_ptr->load(std::memory_order_acquire);
+    uint64_t val = val_ptr->load(std::memory_order_acquire);
+    uint64_t key1 = key_ptr->load(std::memory_order_relaxed);
+    uint64_t key = key0 & ~kSeqMask;
+    if (LIKELY((key0 & kSeqLock) == 0 && key0 == key1)) {
+      return {key, val};
+    }
+  }
 }
 
-ALWAYS_INLINE static inline void AtomicPairStoreRelease(
-    std::atomic<AtomicPair<uint64_t>>* target, AtomicPair<uint64_t> value) {
-  uint64_t first, second;
-  __asm__ __volatile__ (
-      "movq (%2), %%rax\n\t"
-      "movq 8(%2), %%rdx\n\t"
-      "1:\n\t"
-      "lock cmpxchg16b (%2)\n\t"
-      "jnz 1b"
-      : "=&a"(first), "=&d"(second)
-      : "r"(target), "b"(value.first), "c"(value.second)
-      : "cc");
+ALWAYS_INLINE static inline void AtomicPairStoreRelease(AtomicPair<uint64_t>* pair,
+                                                        AtomicPair<uint64_t> value) {
+  DCHECK((value.key & kSeqMask) == 0) << "Key=0x" << std::hex << value.key;
+  auto* key_ptr = reinterpret_cast<std::atomic_uint64_t*>(&pair->key);
+  auto* val_ptr = reinterpret_cast<std::atomic_uint64_t*>(&pair->val);
+  uint64_t key = key_ptr->load(std::memory_order_relaxed);
+  do {
+    key &= ~kSeqLock;  // Ensure that the CAS below fails if the lock bit is already set.
+  } while (!key_ptr->compare_exchange_weak(key, key | kSeqLock));
+  key = (((key & kSeqMask) + kSeqIncr) & ~kSeqLock) | (value.key & ~kSeqMask);
+  val_ptr->store(value.val, std::memory_order_release);
+  key_ptr->store(key, std::memory_order_release);
 }
-#endif  // defined(__x86_64__)
 
 }  // namespace art
 
diff --git a/runtime/base/callee_save_type.h b/runtime/base/callee_save_type.h
index fcafe9c..1849c30 100644
--- a/runtime/base/callee_save_type.h
+++ b/runtime/base/callee_save_type.h
@@ -20,7 +20,9 @@
 #include <cstdint>
 #include <iosfwd>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 // Returns a special method that describes all callee saves being spilled to the stack.
 enum class CalleeSaveType : uint32_t {
diff --git a/runtime/base/gc_visited_arena_pool.cc b/runtime/base/gc_visited_arena_pool.cc
index 4b1494f..57606d1 100644
--- a/runtime/base/gc_visited_arena_pool.cc
+++ b/runtime/base/gc_visited_arena_pool.cc
@@ -25,15 +25,15 @@
 #include "base/utils.h"
 #include "gc/collector/mark_compact-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 TrackedArena::TrackedArena(uint8_t* start, size_t size, bool pre_zygote_fork, bool single_obj_arena)
     : Arena(),
       first_obj_array_(nullptr),
       pre_zygote_fork_(pre_zygote_fork),
       waiting_for_deletion_(false) {
-  static_assert(ArenaAllocator::kArenaAlignment <= kPageSize,
-                "Arena should not need stronger alignment than kPageSize.");
+  static_assert(ArenaAllocator::kArenaAlignment <= kMinPageSize,
+                "Arena should not need stronger alignment than kMinPageSize.");
   memory_ = start;
   size_ = size;
   if (single_obj_arena) {
@@ -41,16 +41,16 @@
     // entire arena.
     bytes_allocated_ = size;
   } else {
-    DCHECK_ALIGNED(size, kPageSize);
-    DCHECK_ALIGNED(start, kPageSize);
-    size_t arr_size = size / kPageSize;
+    DCHECK_ALIGNED_PARAM(size, gPageSize);
+    DCHECK_ALIGNED_PARAM(start, gPageSize);
+    size_t arr_size = DivideByPageSize(size);
     first_obj_array_.reset(new uint8_t*[arr_size]);
     std::fill_n(first_obj_array_.get(), arr_size, nullptr);
   }
 }
 
 void TrackedArena::ReleasePages(uint8_t* begin, size_t size, bool pre_zygote_fork) {
-  DCHECK_ALIGNED(begin, kPageSize);
+  DCHECK_ALIGNED_PARAM(begin, gPageSize);
   // Userfaultfd GC uses MAP_SHARED mappings for linear-alloc and therefore
   // MADV_DONTNEED will not free the pages from page cache. Therefore use
   // MADV_REMOVE instead, which is meant for this purpose.
@@ -61,7 +61,7 @@
     // MADV_REMOVE fails if invoked on anonymous mapping, which could happen
     // if the arena is released before userfaultfd-GC starts using memfd. So
     // use MADV_DONTNEED.
-    ZeroAndReleasePages(begin, size);
+    ZeroAndReleaseMemory(begin, size);
   }
 }
 
@@ -69,7 +69,7 @@
   if (bytes_allocated_ > 0) {
     ReleasePages(Begin(), Size(), pre_zygote_fork_);
     if (first_obj_array_.get() != nullptr) {
-      std::fill_n(first_obj_array_.get(), Size() / kPageSize, nullptr);
+      std::fill_n(first_obj_array_.get(), DivideByPageSize(Size()), nullptr);
     }
     bytes_allocated_ = 0;
   }
@@ -81,15 +81,15 @@
   DCHECK_LT(static_cast<void*>(obj_begin), static_cast<void*>(obj_end));
   GcVisitedArenaPool* arena_pool =
       static_cast<GcVisitedArenaPool*>(Runtime::Current()->GetLinearAllocArenaPool());
-  size_t idx = static_cast<size_t>(obj_begin - Begin()) / kPageSize;
-  size_t last_byte_idx = static_cast<size_t>(obj_end - 1 - Begin()) / kPageSize;
+  size_t idx = DivideByPageSize(static_cast<size_t>(obj_begin - Begin()));
+  size_t last_byte_idx = DivideByPageSize(static_cast<size_t>(obj_end - 1 - Begin()));
   // Do the update below with arena-pool's lock in shared-mode to serialize with
   // the compaction-pause wherein we acquire it exclusively. This is to ensure
   // that last-byte read there doesn't change after reading it and before
   // userfaultfd registration.
   ReaderMutexLock rmu(Thread::Current(), arena_pool->GetLock());
   // If the addr is at the beginning of a page, then we set it for that page too.
-  if (IsAligned<kPageSize>(obj_begin)) {
+  if (IsAlignedParam(obj_begin, gPageSize)) {
     first_obj_array_[idx] = obj_begin;
   }
   while (idx < last_byte_idx) {
@@ -105,8 +105,8 @@
     size = std::max(min_size, kLow4GBLinearAllocPoolSize);
   }
 #endif
-  size_t alignment = BestPageTableAlignment(size);
-  DCHECK_GE(size, kPMDSize);
+  size_t alignment = gc::Heap::BestPageTableAlignment(size);
+  DCHECK_GE(size, gc::Heap::GetPMDSize());
   std::string err_msg;
   maps_.emplace_back(MemMap::MapAnonymousAligned(
       name_, size, PROT_READ | PROT_WRITE, low_4gb_, alignment, &err_msg));
@@ -178,7 +178,7 @@
         new TrackedArena(begin, size, /*pre_zygote_fork=*/true, /*single_obj_arena=*/true));
     arena = *insert_result.first;
   } else {
-    arena = AllocArena(size, /*single_obj_arena=*/true);
+    arena = AllocArena(size, /*need_first_obj_arr=*/true);
   }
   return arena->Begin();
 }
@@ -218,7 +218,7 @@
 
 Arena* GcVisitedArenaPool::AllocArena(size_t size, bool single_obj_arena) {
   // Return only page aligned sizes so that madvise can be leveraged.
-  size = RoundUp(size, kPageSize);
+  size = RoundUp(size, gPageSize);
   if (pre_zygote_fork_) {
     // The first fork out of zygote hasn't happened yet. Allocate arena in a
     // private-anonymous mapping to retain clean pages across fork.
diff --git a/runtime/base/gc_visited_arena_pool.h b/runtime/base/gc_visited_arena_pool.h
index 390da55..802303d 100644
--- a/runtime/base/gc_visited_arena_pool.h
+++ b/runtime/base/gc_visited_arena_pool.h
@@ -28,7 +28,7 @@
 #include "read_barrier_config.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // GcVisitedArenaPool can be used for tracking allocations so that they can
 // be visited during GC to update the GC-roots inside them.
@@ -44,22 +44,24 @@
   void VisitRoots(PageVisitor& visitor) const REQUIRES_SHARED(Locks::mutator_lock_) {
     uint8_t* page_begin = Begin();
     if (first_obj_array_.get() != nullptr) {
-      DCHECK_ALIGNED(Size(), kPageSize);
-      DCHECK_ALIGNED(Begin(), kPageSize);
-      for (int i = 0, nr_pages = Size() / kPageSize; i < nr_pages; i++, page_begin += kPageSize) {
+      DCHECK_ALIGNED_PARAM(Size(), gPageSize);
+      DCHECK_ALIGNED_PARAM(Begin(), gPageSize);
+      for (int i = 0, nr_pages = DivideByPageSize(Size());
+           i < nr_pages;
+           i++, page_begin += gPageSize) {
         uint8_t* first = first_obj_array_[i];
         if (first != nullptr) {
-          visitor(page_begin, first, kPageSize);
+          visitor(page_begin, first, gPageSize);
         } else {
           break;
         }
       }
     } else {
       size_t page_size = Size();
-      while (page_size > kPageSize) {
-        visitor(page_begin, nullptr, kPageSize);
-        page_begin += kPageSize;
-        page_size -= kPageSize;
+      while (page_size > gPageSize) {
+        visitor(page_begin, nullptr, gPageSize);
+        page_begin += gPageSize;
+        page_size -= gPageSize;
       }
       visitor(page_begin, nullptr, page_size);
     }
@@ -69,17 +71,17 @@
   uint8_t* GetLastUsedByte() const REQUIRES_SHARED(Locks::mutator_lock_) {
     // Jump past bytes-allocated for arenas which are not currently being used
     // by arena-allocator. This helps in reducing loop iterations below.
-    uint8_t* last_byte = AlignUp(Begin() + GetBytesAllocated(), kPageSize);
+    uint8_t* last_byte = AlignUp(Begin() + GetBytesAllocated(), gPageSize);
     if (first_obj_array_.get() != nullptr) {
-      DCHECK_ALIGNED(Begin(), kPageSize);
-      DCHECK_ALIGNED(End(), kPageSize);
+      DCHECK_ALIGNED_PARAM(Begin(), gPageSize);
+      DCHECK_ALIGNED_PARAM(End(), gPageSize);
       DCHECK_LE(last_byte, End());
     } else {
       DCHECK_EQ(last_byte, End());
     }
-    for (size_t i = (last_byte - Begin()) / kPageSize;
+    for (size_t i = DivideByPageSize(last_byte - Begin());
          last_byte < End() && first_obj_array_[i] != nullptr;
-         last_byte += kPageSize, i++) {
+         last_byte += gPageSize, i++) {
       // No body.
     }
     return last_byte;
@@ -89,7 +91,7 @@
     DCHECK_LE(Begin(), addr);
     DCHECK_GT(End(), addr);
     if (first_obj_array_.get() != nullptr) {
-      return first_obj_array_[(addr - Begin()) / kPageSize];
+      return first_obj_array_[DivideByPageSize(addr - Begin())];
     } else {
       // The pages of this arena contain array of GC-roots. So we don't need
       // first-object of any given page of the arena.
@@ -100,7 +102,7 @@
 
   // Set 'obj_begin' in first_obj_array_ in every element for which it's the
   // first object.
-  void SetFirstObject(uint8_t* obj_begin, uint8_t* obj_end);
+  EXPORT void SetFirstObject(uint8_t* obj_begin, uint8_t* obj_end);
   // Setup the arena for deferred deletion.
   void SetupForDeferredDeletion(TrackedArena* next_arena) {
     DCHECK(next_arena == nullptr || next_arena->waiting_for_deletion_);
@@ -150,7 +152,7 @@
   // Use by arena allocator.
   Arena* AllocArena(size_t size) override REQUIRES(!lock_) {
     WriterMutexLock wmu(Thread::Current(), lock_);
-    return AllocArena(size, /*single_obj_arena=*/false);
+    return AllocArena(size, /*need_first_obj_arr=*/false);
   }
   void FreeArenaChain(Arena* first) override REQUIRES(!lock_);
   size_t GetBytesAllocated() const override REQUIRES(!lock_);
@@ -158,8 +160,8 @@
   void LockReclaimMemory() override {}
   void TrimMaps() override {}
 
-  uint8_t* AllocSingleObjArena(size_t size) REQUIRES(!lock_);
-  void FreeSingleObjArena(uint8_t* addr) REQUIRES(!lock_);
+  EXPORT uint8_t* AllocSingleObjArena(size_t size) REQUIRES(!lock_);
+  EXPORT void FreeSingleObjArena(uint8_t* addr) REQUIRES(!lock_);
 
   bool Contains(void* ptr) REQUIRES(!lock_) {
     ReaderMutexLock rmu(Thread::Current(), lock_);
@@ -252,7 +254,7 @@
   class TrackedArenaHash {
    public:
     size_t operator()(const TrackedArena* arena) const {
-      return std::hash<size_t>{}(reinterpret_cast<uintptr_t>(arena->Begin()) / kPageSize);
+      return std::hash<size_t>{}(DivideByPageSize(reinterpret_cast<uintptr_t>(arena->Begin())));
     }
   };
   using AllocatedArenaSet =
@@ -313,7 +315,7 @@
     using other = GcRootArenaAllocator<U, kTag>;
   };
 
-  pointer allocate(size_type n, [[maybe_unused]] const_pointer hint = 0) {
+  pointer allocate(size_type n, [[maybe_unused]] const_pointer hint = nullptr) {
     if (!gUseUserfaultfd) {
       return TrackingAllocator<T, kTag>::allocate(n);
     }
diff --git a/runtime/base/locks.cc b/runtime/base/locks.cc
index b375fb4..011d46e 100644
--- a/runtime/base/locks.cc
+++ b/runtime/base/locks.cc
@@ -30,7 +30,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static Atomic<Locks::ClientCallback*> safe_to_call_abort_callback(nullptr);
 
diff --git a/runtime/base/locks.h b/runtime/base/locks.h
index c15e5de..d6a59f8 100644
--- a/runtime/base/locks.h
+++ b/runtime/base/locks.h
@@ -25,7 +25,7 @@
 #include "base/atomic.h"
 #include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class BaseMutex;
 class ConditionVariable;
@@ -108,10 +108,6 @@
   kClassLinkerClassesLock,  // TODO rename.
   kSubtypeCheckLock,
   kBreakpointLock,
-  // This is a generic lock level for a lock meant to be gained after having a
-  // monitor lock.
-  kPostMonitorLock,
-  kMonitorLock,
   kMonitorListLock,
   kThreadListLock,
   kAllocTrackerLock,
@@ -125,7 +121,10 @@
   kRuntimeShutdownLock,
   kTraceLock,
   kHeapBitmapLock,
-
+  // This is a generic lock level for a lock meant to be gained after having a
+  // monitor lock.
+  kPostMonitorLock,
+  kMonitorLock,
   // This is a generic lock level for a top-level lock meant to be gained after having the
   // mutator_lock_.
   kPostMutatorTopLockLevel,
@@ -138,7 +137,7 @@
   kUserCodeSuspensionLock,
   kZygoteCreationLock,
 
-  // The highest valid lock level. Use this if there is code that should only be called with no
+  // The highest valid lock level. Use this for locks that should only be acquired with no
   // other locks held. Since this is the highest lock level we also allow it to be held even if the
   // runtime or current thread is not fully set-up yet (for example during thread attach). Note that
   // this lock also has special behavior around the mutator_lock_. Since the mutator_lock_ is not
@@ -150,7 +149,7 @@
 
   kLockLevelCount  // Must come last.
 };
-std::ostream& operator<<(std::ostream& os, LockLevel rhs);
+EXPORT std::ostream& operator<<(std::ostream& os, LockLevel rhs);
 
 // For StartNoThreadSuspension and EndNoThreadSuspension.
 class CAPABILITY("role") Role {
@@ -164,7 +163,7 @@
 };
 
 // Global mutexes corresponding to the levels above.
-class Locks {
+class EXPORT Locks {
  public:
   static void Init();
   static void InitConditions() NO_THREAD_SAFETY_ANALYSIS;  // Condition variables.
@@ -381,7 +380,7 @@
 class Roles {
  public:
   // Uninterruptible means that the thread may not become suspended.
-  static Uninterruptible uninterruptible_;
+  EXPORT static Uninterruptible uninterruptible_;
 };
 
 }  // namespace art
diff --git a/runtime/base/mem_map_arena_pool.cc b/runtime/base/mem_map_arena_pool.cc
index fc1a61e..2d4d978 100644
--- a/runtime/base/mem_map_arena_pool.cc
+++ b/runtime/base/mem_map_arena_pool.cc
@@ -28,8 +28,9 @@
 #include "base/arena_allocator-inl.h"
 #include "base/mem_map.h"
 #include "base/systrace.h"
+#include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class MemMapArena final : public Arena {
  public:
@@ -46,8 +47,8 @@
 MemMapArena::MemMapArena(size_t size, bool low_4gb, const char* name)
     : map_(Allocate(size, low_4gb, name)) {
   memory_ = map_.Begin();
-  static_assert(ArenaAllocator::kArenaAlignment <= kPageSize,
-                "Arena should not need stronger alignment than kPageSize.");
+  static_assert(ArenaAllocator::kArenaAlignment <= kMinPageSize,
+                "Arena should not need stronger alignment than kMinPageSize.");
   DCHECK_ALIGNED(memory_, ArenaAllocator::kArenaAlignment);
   size_ = map_.Size();
 }
@@ -55,7 +56,7 @@
 MemMap MemMapArena::Allocate(size_t size, bool low_4gb, const char* name) {
   // Round up to a full page as that's the smallest unit of allocation for mmap()
   // and we want to be able to use all memory that we actually allocate.
-  size = RoundUp(size, kPageSize);
+  size = RoundUp(size, gPageSize);
   std::string error_msg;
   // TODO(b/278665389): remove this retry logic if the root cause is found.
   constexpr int MAX_RETRY_CNT = 3;
diff --git a/runtime/base/mem_map_arena_pool.h b/runtime/base/mem_map_arena_pool.h
index e98ef07..19df9a7 100644
--- a/runtime/base/mem_map_arena_pool.h
+++ b/runtime/base/mem_map_arena_pool.h
@@ -19,7 +19,7 @@
 
 #include "base/arena_allocator.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class MemMapArenaPool final : public ArenaPool {
  public:
diff --git a/runtime/base/message_queue.h b/runtime/base/message_queue.h
index b0f1460..e50d84a 100644
--- a/runtime/base/message_queue.h
+++ b/runtime/base/message_queue.h
@@ -28,7 +28,7 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic error "-Wconversion"
 
-namespace art {
+namespace art HIDDEN {
 
 struct TimeoutExpiredMessage {};
 
diff --git a/runtime/base/message_queue_test.cc b/runtime/base/message_queue_test.cc
index 09dbc32..0fd2c64 100644
--- a/runtime/base/message_queue_test.cc
+++ b/runtime/base/message_queue_test.cc
@@ -22,7 +22,7 @@
 #include "thread-current-inl.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class MessageQueueTest : public CommonRuntimeTest {
  protected:
diff --git a/runtime/base/mutator_locked_dumpable.h b/runtime/base/mutator_locked_dumpable.h
index afbd732..94bc596 100644
--- a/runtime/base/mutator_locked_dumpable.h
+++ b/runtime/base/mutator_locked_dumpable.h
@@ -20,7 +20,7 @@
 #include "base/locks.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template<typename T>
 class MutatorLockedDumpable {
diff --git a/runtime/base/mutex-inl.h b/runtime/base/mutex-inl.h
index dba1e12..3893a93 100644
--- a/runtime/base/mutex-inl.h
+++ b/runtime/base/mutex-inl.h
@@ -35,7 +35,7 @@
 
 #define CHECK_MUTEX_CALL(call, args) CHECK_PTHREAD_CALL(call, args, name_)
 
-namespace art {
+namespace art HIDDEN {
 
 #if ART_USE_FUTEXES
 static inline int futex(volatile int *uaddr, int op, int val, const struct timespec *timeout,
@@ -60,43 +60,44 @@
   // The check below enumerates the cases where we expect not to be able to check the validity of
   // locks on a thread. Lock checking is disabled to avoid deadlock when checking shutdown lock.
   // TODO: tighten this check.
-  if (kDebugLocking) {
-    CHECK(!Locks::IsSafeToCallAbortRacy() ||
-          // Used during thread creation to avoid races with runtime shutdown. Thread::Current not
-          // yet established.
-          level == kRuntimeShutdownLock ||
-          // Thread Ids are allocated/released before threads are established.
-          level == kAllocatedThreadIdsLock ||
-          // Thread LDT's are initialized without Thread::Current established.
-          level == kModifyLdtLock ||
-          // Threads are unregistered while holding the thread list lock, during this process they
-          // no longer exist and so we expect an unlock with no self.
-          level == kThreadListLock ||
-          // Ignore logging which may or may not have set up thread data structures.
-          level == kLoggingLock ||
-          // When transitioning from suspended to runnable, a daemon thread might be in
-          // a situation where the runtime is shutting down. To not crash our debug locking
-          // mechanism we just pass null Thread* to the MutexLock during that transition
-          // (see Thread::TransitionFromSuspendedToRunnable).
-          level == kThreadSuspendCountLock ||
-          // Avoid recursive death.
-          level == kAbortLock ||
-          // Locks at the absolute top of the stack can be locked at any time.
-          level == kTopLockLevel ||
-          // The unexpected signal handler may be catching signals from any thread.
-          level == kUnexpectedSignalLock) << level;
-  }
+  CHECK(!Locks::IsSafeToCallAbortRacy() ||
+        // Used during thread creation to avoid races with runtime shutdown. Thread::Current not
+        // yet established.
+        level == kRuntimeShutdownLock ||
+        // Thread Ids are allocated/released before threads are established.
+        level == kAllocatedThreadIdsLock ||
+        // Thread LDT's are initialized without Thread::Current established.
+        level == kModifyLdtLock ||
+        // Threads are unregistered while holding the thread list lock, during this process they
+        // no longer exist and so we expect an unlock with no self.
+        level == kThreadListLock ||
+        // Ignore logging which may or may not have set up thread data structures.
+        level == kLoggingLock ||
+        // When transitioning from suspended to runnable, a daemon thread might be in
+        // a situation where the runtime is shutting down. To not crash our debug locking
+        // mechanism we just pass null Thread* to the MutexLock during that transition
+        // (see Thread::TransitionFromSuspendedToRunnable).
+        level == kThreadSuspendCountLock ||
+        // Avoid recursive death.
+        level == kAbortLock ||
+        // Locks at the absolute top of the stack can be locked at any time.
+        level == kTopLockLevel ||
+        // The unexpected signal handler may be catching signals from any thread.
+        level == kUnexpectedSignalLock)
+      << level;
 }
 
-inline void BaseMutex::RegisterAsLocked(Thread* self) {
+inline void BaseMutex::RegisterAsLocked(Thread* self, bool check) {
   if (UNLIKELY(self == nullptr)) {
-    CheckUnattachedThread(level_);
-    return;
+    if (check) {
+      CheckUnattachedThread(level_);
+    }
+  } else {
+    RegisterAsLockedImpl(self, level_, check);
   }
-  RegisterAsLockedImpl(self, level_);
 }
 
-inline void BaseMutex::RegisterAsLockedImpl(Thread* self, LockLevel level) {
+inline void BaseMutex::RegisterAsLockedImpl(Thread* self, LockLevel level, bool check) {
   DCHECK(self != nullptr);
   DCHECK_EQ(level_, level);
   // It would be nice to avoid this condition checking in the non-debug case,
@@ -107,7 +108,7 @@
   if (UNLIKELY(level == kThreadWaitLock) && self->GetHeldMutex(kThreadWaitLock) != nullptr) {
     level = kThreadWaitWakeLock;
   }
-  if (kDebugLocking) {
+  if (check) {
     // Check if a bad Mutex of this level or lower is held.
     bool bad_mutexes_held = false;
     // Specifically allow a kTopLockLevel lock to be gained when the current thread holds the
@@ -161,10 +162,12 @@
 
 inline void BaseMutex::RegisterAsUnlocked(Thread* self) {
   if (UNLIKELY(self == nullptr)) {
-    CheckUnattachedThread(level_);
-    return;
+    if (kDebugLocking) {
+      CheckUnattachedThread(level_);
+    }
+  } else {
+    RegisterAsUnlockedImpl(self, level_);
   }
-  RegisterAsUnlockedImpl(self , level_);
 }
 
 inline void BaseMutex::RegisterAsUnlockedImpl(Thread* self, LockLevel level) {
@@ -306,7 +309,7 @@
 }
 
 inline void MutatorMutex::TransitionFromSuspendedToRunnable(Thread* self) {
-  RegisterAsLockedImpl(self, kMutatorLock);
+  RegisterAsLockedImpl(self, kMutatorLock, kDebugLocking);
   AssertSharedHeld(self);
 }
 
diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc
index 728dc84..831c535 100644
--- a/runtime/base/mutex.cc
+++ b/runtime/base/mutex.cc
@@ -35,7 +35,7 @@
 #include "thread.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -246,11 +246,23 @@
 }
 
 void BaseMutex::CheckSafeToWait(Thread* self) {
-  if (self == nullptr) {
-    CheckUnattachedThread(level_);
+  if (!kDebugLocking) {
     return;
   }
-  if (kDebugLocking) {
+  // Avoid repeated reporting of the same violation in the common case.
+  // We somewhat ignore races in the duplicate elision code. The first kMaxReports and the first
+  // report for a given level_ should always appear.
+  static std::atomic<uint> last_level_reported(kLockLevelCount);
+  static constexpr int kMaxReports = 5;
+  static std::atomic<uint> num_reports(0);  // For the current level, more or less.
+
+  if (self == nullptr) {
+    CheckUnattachedThread(level_);
+  } else if (num_reports.load(std::memory_order_relaxed) > kMaxReports &&
+             last_level_reported.load(std::memory_order_relaxed) == level_) {
+    LOG(ERROR) << "Eliding probably redundant CheckSafeToWait() complaints";
+    return;
+  } else {
     CHECK(self->GetHeldMutex(level_) == this || level_ == kMonitorLock)
         << "Waiting on unacquired mutex: " << name_;
     bool bad_mutexes_held = false;
@@ -283,6 +295,12 @@
             bad_mutexes_held = true;
           }
         } else if (held_mutex != nullptr) {
+          if (last_level_reported.load(std::memory_order_relaxed) == level_) {
+            num_reports.fetch_add(1, std::memory_order_relaxed);
+          } else {
+            last_level_reported.store(level_, std::memory_order_relaxed);
+            num_reports.store(0, std::memory_order_relaxed);
+          }
           std::ostringstream oss;
           oss << "Holding \"" << held_mutex->name_ << "\" "
               << "(level " << LockLevel(i) << ") while performing wait on "
@@ -570,6 +588,7 @@
   }
 }
 
+template <bool kCheck>
 bool Mutex::ExclusiveTryLock(Thread* self) {
   DCHECK(self == nullptr || self == Thread::Current());
   if (kDebugLocking && !recursive_) {
@@ -600,7 +619,7 @@
 #endif
     DCHECK_EQ(GetExclusiveOwnerTid(), 0);
     exclusive_owner_.store(SafeGetTid(self), std::memory_order_relaxed);
-    RegisterAsLocked(self);
+    RegisterAsLocked(self, kCheck);
   }
   recursion_count_++;
   if (kDebugLocking) {
@@ -611,6 +630,9 @@
   return true;
 }
 
+template bool Mutex::ExclusiveTryLock<false>(Thread* self);
+template bool Mutex::ExclusiveTryLock<true>(Thread* self);
+
 bool Mutex::ExclusiveTryLockWithSpinning(Thread* self) {
   // Spin a small number of times, since this affects our ability to respond to suspension
   // requests. We spin repeatedly only if the mutex repeatedly becomes available and unavailable
@@ -717,11 +739,12 @@
 }
 
 void Mutex::Dump(std::ostream& os) const {
-  os << (recursive_ ? "recursive " : "non-recursive ")
-      << name_
-      << " level=" << static_cast<int>(level_)
-      << " rec=" << recursion_count_
-      << " owner=" << GetExclusiveOwnerTid() << " ";
+  os << (recursive_ ? "recursive " : "non-recursive ") << name_
+     << " level=" << static_cast<int>(level_) << " rec=" << recursion_count_
+#if ART_USE_FUTEXES
+     << " state_and_contenders = " << std::hex << state_and_contenders_ << std::dec
+#endif
+     << " owner=" << GetExclusiveOwnerTid() << " ";
   DumpContention(os);
 }
 
@@ -923,7 +946,7 @@
 }
 #endif
 
-bool ReaderWriterMutex::SharedTryLock(Thread* self) {
+bool ReaderWriterMutex::SharedTryLock(Thread* self, bool check) {
   DCHECK(self == nullptr || self == Thread::Current());
 #if ART_USE_FUTEXES
   bool done = false;
@@ -947,7 +970,7 @@
     PLOG(FATAL) << "pthread_mutex_trylock failed for " << name_;
   }
 #endif
-  RegisterAsLocked(self);
+  RegisterAsLocked(self, check);
   AssertSharedHeld(self);
   return true;
 }
diff --git a/runtime/base/mutex.h b/runtime/base/mutex.h
index 87e9525..e3d89e7 100644
--- a/runtime/base/mutex.h
+++ b/runtime/base/mutex.h
@@ -46,7 +46,7 @@
 #define HAVE_TIMED_RWLOCK 0
 #endif
 
-namespace art {
+namespace art HIDDEN {
 
 class SHARED_LOCKABLE ReaderWriterMutex;
 class SHARED_LOCKABLE MutatorMutex;
@@ -103,10 +103,11 @@
   BaseMutex(const char* name, LockLevel level);
   virtual ~BaseMutex();
 
-  // Add this mutex to those owned by self, and perform appropriate checking.
-  // For this call only, self may also be another suspended thread.
-  void RegisterAsLocked(Thread* self);
-  void RegisterAsLockedImpl(Thread* self, LockLevel level);
+  // Add this mutex to those owned by self, and optionally perform lock order checking.  Caller
+  // may wish to disable checking for trylock calls that cannot result in deadlock.  For this call
+  // only, self may also be another suspended thread.
+  void RegisterAsLocked(Thread* self, bool check = kDebugLocking);
+  void RegisterAsLockedImpl(Thread* self, LockLevel level, bool check);
 
   void RegisterAsUnlocked(Thread* self);
   void RegisterAsUnlockedImpl(Thread* self, LockLevel level);
@@ -172,7 +173,7 @@
 // acquired) by a thread in suspended state. Suspending all threads does NOT prevent mutex state
 // from changing.
 std::ostream& operator<<(std::ostream& os, const Mutex& mu);
-class LOCKABLE Mutex : public BaseMutex {
+class EXPORT LOCKABLE Mutex : public BaseMutex {
  public:
   explicit Mutex(const char* name, LockLevel level = kDefaultMutexLevel, bool recursive = false);
   ~Mutex();
@@ -183,7 +184,10 @@
   void ExclusiveLock(Thread* self) ACQUIRE();
   void Lock(Thread* self) ACQUIRE() {  ExclusiveLock(self); }
 
-  // Returns true if acquires exclusive access, false otherwise.
+  // Returns true if acquires exclusive access, false otherwise. The `check` argument specifies
+  // whether lock level checking should be performed.  Should be defaulted unless we are using
+  // TryLock instead of Lock for deadlock avoidance.
+  template <bool kCheck = kDebugLocking>
   bool ExclusiveTryLock(Thread* self) TRY_ACQUIRE(true);
   bool TryLock(Thread* self) TRY_ACQUIRE(true) { return ExclusiveTryLock(self); }
   // Equivalent to ExclusiveTryLock, but retry for a short period before giving up.
@@ -314,8 +318,8 @@
 // Exclusive | Block         | Free            | Block            | error
 // Shared(n) | Block         | error           | SharedLock(n+1)* | Shared(n-1) or Free
 // * for large values of n the SharedLock may block.
-std::ostream& operator<<(std::ostream& os, const ReaderWriterMutex& mu);
-class SHARED_LOCKABLE ReaderWriterMutex : public BaseMutex {
+EXPORT std::ostream& operator<<(std::ostream& os, const ReaderWriterMutex& mu);
+class EXPORT SHARED_LOCKABLE ReaderWriterMutex : public BaseMutex {
  public:
   explicit ReaderWriterMutex(const char* name, LockLevel level = kDefaultMutexLevel);
   ~ReaderWriterMutex();
@@ -342,7 +346,7 @@
   void ReaderLock(Thread* self) ACQUIRE_SHARED() { SharedLock(self); }
 
   // Try to acquire share of ReaderWriterMutex.
-  bool SharedTryLock(Thread* self) SHARED_TRYLOCK_FUNCTION(true);
+  bool SharedTryLock(Thread* self, bool check = kDebugLocking) SHARED_TRYLOCK_FUNCTION(true);
 
   // Release a share of the access.
   void SharedUnlock(Thread* self) RELEASE_SHARED() ALWAYS_INLINE;
@@ -456,7 +460,7 @@
 
 // ConditionVariables allow threads to queue and sleep. Threads may then be resumed individually
 // (Signal) or all at once (Broadcast).
-class ConditionVariable {
+class EXPORT ConditionVariable {
  public:
   ConditionVariable(const char* name, Mutex& mutex);
   ~ConditionVariable();
@@ -520,6 +524,18 @@
   DISALLOW_COPY_AND_ASSIGN(MutexLock);
 };
 
+// Pretend to acquire a mutex for checking purposes, without actually doing so. Use with
+// extreme caution when it is known the condition that the mutex would guard against cannot arise.
+class SCOPED_CAPABILITY FakeMutexLock {
+ public:
+  explicit FakeMutexLock(Mutex& mu) ACQUIRE(mu) NO_THREAD_SAFETY_ANALYSIS {}
+
+  ~FakeMutexLock() RELEASE() NO_THREAD_SAFETY_ANALYSIS {}
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(FakeMutexLock);
+};
+
 // Scoped locker/unlocker for a ReaderWriterMutex that acquires read access to mu upon
 // construction and releases it upon destruction.
 class SCOPED_CAPABILITY ReaderMutexLock {
diff --git a/runtime/base/mutex_test.cc b/runtime/base/mutex_test.cc
index f1b4e49..fca8c90 100644
--- a/runtime/base/mutex_test.cc
+++ b/runtime/base/mutex_test.cc
@@ -19,7 +19,7 @@
 #include "common_runtime_test.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class MutexTest : public CommonRuntimeTest {
  protected:
diff --git a/runtime/base/quasi_atomic.cc b/runtime/base/quasi_atomic.cc
index 1a82812..0bdca17 100644
--- a/runtime/base/quasi_atomic.cc
+++ b/runtime/base/quasi_atomic.cc
@@ -20,7 +20,7 @@
 #include "base/stl_util.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 std::vector<Mutex*>* QuasiAtomic::gSwapMutexes = nullptr;
 
diff --git a/runtime/base/quasi_atomic.h b/runtime/base/quasi_atomic.h
index 5aa4dde..09894cd 100644
--- a/runtime/base/quasi_atomic.h
+++ b/runtime/base/quasi_atomic.h
@@ -27,7 +27,7 @@
 #include "arch/instruction_set.h"
 #include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class Mutex;
 
@@ -46,7 +46,7 @@
 // quasiatomic operations that are performed on partially-overlapping
 // memory.
 class QuasiAtomic {
-  static constexpr bool NeedSwapMutexes(InstructionSet isa ATTRIBUTE_UNUSED) {
+  static constexpr bool NeedSwapMutexes([[maybe_unused]] InstructionSet isa) {
     // TODO: Remove this function now that mips support has been removed.
     return false;
   }
diff --git a/runtime/base/timing_logger.cc b/runtime/base/timing_logger.cc
index c39b44e..a8a2597 100644
--- a/runtime/base/timing_logger.cc
+++ b/runtime/base/timing_logger.cc
@@ -31,7 +31,7 @@
 #include <cmath>
 #include <iomanip>
 
-namespace art {
+namespace art HIDDEN {
 
 CumulativeLogger::CumulativeLogger(const std::string& name)
     : name_(name),
diff --git a/runtime/base/timing_logger.h b/runtime/base/timing_logger.h
index c1094bb..711a7e1 100644
--- a/runtime/base/timing_logger.h
+++ b/runtime/base/timing_logger.h
@@ -26,7 +26,7 @@
 #include <string>
 #include <vector>
 
-namespace art {
+namespace art HIDDEN {
 class TimingLogger;
 
 class CumulativeLogger {
@@ -153,19 +153,19 @@
     friend class TimingLogger;
   };
 
-  TimingLogger(const char* name,
-               bool precise,
-               bool verbose,
-               TimingKind kind = TimingKind::kMonotonic);
-  ~TimingLogger();
+  EXPORT TimingLogger(const char* name,
+                      bool precise,
+                      bool verbose,
+                      TimingKind kind = TimingKind::kMonotonic);
+  EXPORT ~TimingLogger();
   // Verify that all open timings have related closed timings.
   void Verify();
   // Clears current timings and labels.
   void Reset();
   // Starts a timing.
-  void StartTiming(const char* new_split_label);
+  EXPORT void StartTiming(const char* new_split_label);
   // Ends the current timing.
-  void EndTiming();
+  EXPORT void EndTiming();
   // End the current timing and start a new timing. Usage not recommended.
   void NewTiming(const char* new_split_label) {
     EndTiming();
@@ -175,7 +175,7 @@
   uint64_t GetTotalNs() const;
   // Find the index of a timing by name.
   size_t FindTimingIndex(const char* name, size_t start_idx) const;
-  void Dump(std::ostream& os, const char* indent_string = "  ") const;
+  EXPORT void Dump(std::ostream& os, const char* indent_string = "  ") const;
 
   // Scoped timing splits that can be nested and composed with the explicit split
   // starts and ends.
diff --git a/runtime/base/timing_logger_test.cc b/runtime/base/timing_logger_test.cc
index 38ae9a5..0b35655 100644
--- a/runtime/base/timing_logger_test.cc
+++ b/runtime/base/timing_logger_test.cc
@@ -18,7 +18,7 @@
 
 #include "base/common_art_test.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class TimingLoggerTest : public CommonArtTest {};
 
diff --git a/runtime/cha.cc b/runtime/cha.cc
index a40afb4..da355b7 100644
--- a/runtime/cha.cc
+++ b/runtime/cha.cc
@@ -30,7 +30,7 @@
 #include "thread_list.h"
 #include "thread_pool.h"
 
-namespace art {
+namespace art HIDDEN {
 
 void ClassHierarchyAnalysis::AddDependency(ArtMethod* method,
                                            ArtMethod* dependent_method,
@@ -237,11 +237,10 @@
       : barrier_(0),
         method_headers_(method_headers) {}
 
-  void Run(Thread* thread) override {
+  void Run(Thread* thread) override REQUIRES_SHARED(Locks::mutator_lock_) {
     // Note thread and self may not be equal if thread was already suspended at
     // the point of the request.
     Thread* self = Thread::Current();
-    ScopedObjectAccess soa(self);
     CHAStackVisitor visitor(thread, nullptr, method_headers_);
     visitor.WalkStack();
     barrier_.Pass(self);
@@ -290,7 +289,7 @@
         std::string tmp = in->PrettyClass();
         while (in != failed) {
           in = in->GetSuperClass();
-          tmp = tmp + "->" + in->PrettyClass();
+          tmp += "->" + in->PrettyClass();
         }
         return tmp;
       };
diff --git a/runtime/cha.h b/runtime/cha.h
index 5a403ec..ffdf00a 100644
--- a/runtime/cha.h
+++ b/runtime/cha.h
@@ -22,11 +22,12 @@
 
 #include "base/enums.h"
 #include "base/locks.h"
+#include "base/macros.h"
 #include "handle.h"
 #include "mirror/class.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtMethod;
 class LinearAlloc;
diff --git a/runtime/cha_test.cc b/runtime/cha_test.cc
index 48fd06d..47633a3 100644
--- a/runtime/cha_test.cc
+++ b/runtime/cha_test.cc
@@ -19,7 +19,7 @@
 #include "base/common_art_test.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class CHATest : public CommonArtTest {};
 
diff --git a/runtime/check_reference_map_visitor.h b/runtime/check_reference_map_visitor.h
index d03139b..a4196e6 100644
--- a/runtime/check_reference_map_visitor.h
+++ b/runtime/check_reference_map_visitor.h
@@ -18,14 +18,15 @@
 #define ART_RUNTIME_CHECK_REFERENCE_MAP_VISITOR_H_
 
 #include "art_method-inl.h"
+#include "base/macros.h"
 #include "dex/code_item_accessors-inl.h"
 #include "dex/dex_file_types.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
+#include "oat/stack_map.h"
 #include "scoped_thread_state_change-inl.h"
 #include "stack.h"
-#include "stack_map.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Helper class for tests checking that the compiler keeps track of dex registers
 // holding references.
diff --git a/runtime/class_linker-inl.h b/runtime/class_linker-inl.h
index c4f3b15..e771341 100644
--- a/runtime/class_linker-inl.h
+++ b/runtime/class_linker-inl.h
@@ -36,9 +36,8 @@
 #include "mirror/object_array-inl.h"
 #include "obj_ptr-inl.h"
 #include "scoped_thread_state_change-inl.h"
-#include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 
 inline ObjPtr<mirror::Class> ClassLinker::FindArrayClass(Thread* self,
                                                          ObjPtr<mirror::Class> element_class) {
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 4e18987..57dbd6d 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -39,7 +39,6 @@
 #include "barrier.h"
 #include "base/arena_allocator.h"
 #include "base/arena_bit_vector.h"
-#include "base/membarrier.h"
 #include "base/casts.h"
 #include "base/file_utils.h"
 #include "base/hash_map.h"
@@ -47,6 +46,7 @@
 #include "base/leb128.h"
 #include "base/logging.h"
 #include "base/mem_map_arena_pool.h"
+#include "base/membarrier.h"
 #include "base/metrics/metrics.h"
 #include "base/mutex-inl.h"
 #include "base/os.h"
@@ -90,7 +90,6 @@
 #include "gc_root-inl.h"
 #include "handle_scope-inl.h"
 #include "hidden_api.h"
-#include "image-inl.h"
 #include "imt_conflict_table.h"
 #include "imtable-inl.h"
 #include "intern_table-inl.h"
@@ -118,7 +117,7 @@
 #include "mirror/method.h"
 #include "mirror/method_handle_impl.h"
 #include "mirror/method_handles_lookup.h"
-#include "mirror/method_type.h"
+#include "mirror/method_type-inl.h"
 #include "mirror/object-inl.h"
 #include "mirror/object-refvisitor-inl.h"
 #include "mirror/object.h"
@@ -135,12 +134,14 @@
 #include "mirror/var_handle.h"
 #include "native/dalvik_system_DexFile.h"
 #include "nativehelper/scoped_local_ref.h"
+#include "nterp_helpers-inl.h"
 #include "nterp_helpers.h"
-#include "oat.h"
-#include "oat_file-inl.h"
-#include "oat_file.h"
-#include "oat_file_assistant.h"
-#include "oat_file_manager.h"
+#include "oat/image-inl.h"
+#include "oat/oat.h"
+#include "oat/oat_file-inl.h"
+#include "oat/oat_file.h"
+#include "oat/oat_file_assistant.h"
+#include "oat/oat_file_manager.h"
 #include "object_lock.h"
 #include "profile/profile_compilation_info.h"
 #include "runtime.h"
@@ -157,7 +158,7 @@
 #include "verifier/verifier_deps.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -1102,8 +1103,6 @@
   // initialize the StackOverflowError class (as it might require running the verifier). Instead,
   // ensure that the class will be initialized.
   if (kMemoryToolIsAvailable && !Runtime::Current()->IsAotCompiler()) {
-    verifier::ClassVerifier::Init(this);  // Need to prepare the verifier.
-
     ObjPtr<mirror::Class> soe_klass = FindSystemClass(self, "Ljava/lang/StackOverflowError;");
     if (soe_klass == nullptr || !EnsureInitialized(self, hs.NewHandle(soe_klass), true, true)) {
       // Strange, but don't crash.
@@ -1193,8 +1192,9 @@
       WellKnownClasses::java_lang_reflect_InvocationTargetException_init,
       // Ensure `Parameter` class is initialized (avoid check at runtime).
       WellKnownClasses::java_lang_reflect_Parameter_init,
-      // Ensure `MethodHandles` class is initialized (avoid check at runtime).
+      // Ensure `MethodHandles` and `MethodType` classes are initialized (avoid check at runtime).
       WellKnownClasses::java_lang_invoke_MethodHandles_lookup,
+      WellKnownClasses::java_lang_invoke_MethodType_makeImpl,
       // Ensure `DirectByteBuffer` class is initialized (avoid check at runtime).
       WellKnownClasses::java_nio_DirectByteBuffer_init,
       // Ensure `FloatingDecimal` class is initialized (avoid check at runtime).
@@ -1219,6 +1219,12 @@
       // Initialize empty arrays needed by `StackOverflowError`.
       WellKnownClasses::java_util_Collections_EMPTY_LIST,
       WellKnownClasses::libcore_util_EmptyArray_STACK_TRACE_ELEMENT,
+      // Initialize boxing caches needed by the compiler.
+      WellKnownClasses::java_lang_Byte_ByteCache_cache,
+      WellKnownClasses::java_lang_Character_CharacterCache_cache,
+      WellKnownClasses::java_lang_Integer_IntegerCache_cache,
+      WellKnownClasses::java_lang_Long_LongCache_cache,
+      WellKnownClasses::java_lang_Short_ShortCache_cache,
   };
   for (ArtField* field : fields_of_classes_to_initialize) {
     EnsureRootInitialized(this, self, field->GetDeclaringClass());
@@ -1522,16 +1528,14 @@
   // Visit Class Fields
   void operator()(ObjPtr<mirror::Object> obj,
                   MemberOffset offset,
-                  bool is_static ATTRIBUTE_UNUSED) const
-      REQUIRES_SHARED(Locks::mutator_lock_) {
+                  [[maybe_unused]] bool is_static) const REQUIRES_SHARED(Locks::mutator_lock_) {
     // References within image or across images don't need a read barrier.
     ObjPtr<mirror::Object> referred_obj =
         obj->GetFieldObject<mirror::Object, kVerifyNone, kWithoutReadBarrier>(offset);
     TestObject(referred_obj);
   }
 
-  void operator()(ObjPtr<mirror::Class> klass ATTRIBUTE_UNUSED,
-                  ObjPtr<mirror::Reference> ref) const
+  void operator()([[maybe_unused]] ObjPtr<mirror::Class> klass, ObjPtr<mirror::Reference> ref) const
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::heap_bitmap_lock_) {
     operator()(ref, mirror::Reference::ReferentOffset(), /*is_static=*/ false);
   }
@@ -1699,7 +1703,7 @@
     // the Runtime::LoadAppImageStartupCache() option.
     VerifyInternedStringReferences(space);
   }
-
+  DCHECK(class_loader.Get() != nullptr);
   Thread* const self = Thread::Current();
   Runtime* const runtime = Runtime::Current();
   gc::Heap* const heap = runtime->GetHeap();
@@ -1720,6 +1724,7 @@
           // consistent with `StartupCompletedTask`.
           dex_cache->UnlinkStartupCaches();
         }
+        VLOG(image) << "App image registers dex file " << dex_file->GetLocation();
         class_linker->RegisterDexFileLocked(*dex_file, dex_cache, class_loader.Get());
       }
     }
@@ -1827,7 +1832,7 @@
     REQUIRES_SHARED(Locks::mutator_lock_) {
   DCHECK(error_msg != nullptr);
   std::unique_ptr<const DexFile> dex_file;
-  const OatDexFile* oat_dex_file = oat_file->GetOatDexFile(location, nullptr, error_msg);
+  const OatDexFile* oat_dex_file = oat_file->GetOatDexFile(location, error_msg);
   if (oat_dex_file == nullptr) {
     return std::unique_ptr<const DexFile>();
   }
@@ -1842,12 +1847,14 @@
   }
 
   if (dex_file->GetLocationChecksum() != oat_dex_file->GetDexFileLocationChecksum()) {
+    CHECK(dex_file->GetSha1() != oat_dex_file->GetSha1());
     *error_msg = StringPrintf("Checksums do not match for %s: %x vs %x",
                               location,
                               dex_file->GetLocationChecksum(),
                               oat_dex_file->GetDexFileLocationChecksum());
     return std::unique_ptr<const DexFile>();
   }
+  CHECK(dex_file->GetSha1() == oat_dex_file->GetSha1());
   return dex_file;
 }
 
@@ -2080,7 +2087,7 @@
   if (image_pointer_size_ != space->GetImageHeader().GetPointerSize()) {
     *error_msg = StringPrintf("Application image pointer size does not match runtime: %zu vs %zu",
                               static_cast<size_t>(space->GetImageHeader().GetPointerSize()),
-                              image_pointer_size_);
+                              static_cast<size_t>(image_pointer_size_));
     return false;
   }
   size_t expected_image_roots = ImageHeader::NumberOfImageRoots(app_image);
@@ -2216,7 +2223,9 @@
   }
 
   // Set entry point to interpreter if in InterpretOnly mode.
-  if (!runtime->IsAotCompiler() && runtime->GetInstrumentation()->InterpretOnly()) {
+  if (!runtime->IsAotCompiler() &&
+      (runtime->GetInstrumentation()->InterpretOnly() ||
+       runtime->IsJavaDebuggable())) {
     // Set image methods' entry point to interpreter.
     header.VisitPackedArtMethods([&](ArtMethod& method) REQUIRES_SHARED(Locks::mutator_lock_) {
       if (!method.IsRuntimeMethod()) {
@@ -2230,11 +2239,19 @@
   }
 
   if (!runtime->IsAotCompiler()) {
-    // If we are profiling the boot classpath, disable the shared memory for
-    // boot image method optimization. We need to disable it before doing
-    // ResetCounter below, as counters of shared memory method always hold the
-    // "hot" value.
-    if (runtime->GetJITOptions()->GetProfileSaverOptions().GetProfileBootClassPath()) {
+    // If the boot image is not loaded by the zygote, we don't need the shared
+    // memory optimization.
+    // If we are profiling the boot classpath, we disable the shared memory
+    // optimization to make sure boot classpath methods all get properly
+    // profiled.
+    // For debuggable runtimes we don't use AOT code, so don't use shared memory
+    // optimization so the methods can be JITed better.
+    //
+    // We need to disable the flag before doing ResetCounter below, as counters
+    // of shared memory method always hold the "hot" value.
+    if (!runtime->IsZygote() ||
+        runtime->GetJITOptions()->GetProfileSaverOptions().GetProfileBootClassPath() ||
+        runtime->IsJavaDebuggable()) {
       header.VisitPackedArtMethods([&](ArtMethod& method) REQUIRES_SHARED(Locks::mutator_lock_) {
         method.ClearMemorySharedMethod();
       }, space->Begin(), image_pointer_size_);
@@ -2422,32 +2439,32 @@
     if ((flags & kVisitRootFlagClassLoader) != 0 || tracing_enabled) {
       for (const ClassLoaderData& data : class_loaders_) {
         GcRoot<mirror::Object> root(GcRoot<mirror::Object>(self->DecodeJObject(data.weak_root)));
-        root.VisitRoot(visitor, RootInfo(kRootVMInternal));
+        root.VisitRootIfNonNull(visitor, RootInfo(kRootVMInternal));
       }
     }
   } else if (!gUseReadBarrier && (flags & kVisitRootFlagNewRoots) != 0) {
-    for (auto& root : new_class_roots_) {
-      ObjPtr<mirror::Class> old_ref = root.Read<kWithoutReadBarrier>();
+    for (auto& root : new_roots_) {
+      ObjPtr<mirror::Object> old_ref = root.Read<kWithoutReadBarrier>();
       root.VisitRoot(visitor, RootInfo(kRootStickyClass));
-      ObjPtr<mirror::Class> new_ref = root.Read<kWithoutReadBarrier>();
+      ObjPtr<mirror::Object> new_ref = root.Read<kWithoutReadBarrier>();
       // Concurrent moving GC marked new roots through the to-space invariant.
-      CHECK_EQ(new_ref, old_ref);
+      DCHECK_EQ(new_ref, old_ref);
     }
     for (const OatFile* oat_file : new_bss_roots_boot_oat_files_) {
       for (GcRoot<mirror::Object>& root : oat_file->GetBssGcRoots()) {
         ObjPtr<mirror::Object> old_ref = root.Read<kWithoutReadBarrier>();
         if (old_ref != nullptr) {
-          DCHECK(old_ref->IsClass());
+          DCHECK(old_ref->IsClass() || old_ref->IsString());
           root.VisitRoot(visitor, RootInfo(kRootStickyClass));
           ObjPtr<mirror::Object> new_ref = root.Read<kWithoutReadBarrier>();
           // Concurrent moving GC marked new roots through the to-space invariant.
-          CHECK_EQ(new_ref, old_ref);
+          DCHECK_EQ(new_ref, old_ref);
         }
       }
     }
   }
   if (!gUseReadBarrier && (flags & kVisitRootFlagClearRootLog) != 0) {
-    new_class_roots_.clear();
+    new_roots_.clear();
     new_bss_roots_boot_oat_files_.clear();
   }
   if (!gUseReadBarrier && (flags & kVisitRootFlagStartLoggingNewRoots) != 0) {
@@ -3361,7 +3378,7 @@
     return Finish(h_klass);
   }
 
-  ObjPtr<mirror::Class> Finish(nullptr_t np ATTRIBUTE_UNUSED)
+  ObjPtr<mirror::Class> Finish([[maybe_unused]] nullptr_t np)
       REQUIRES_SHARED(Locks::mutator_lock_) {
     ScopedNullHandle<mirror::Class> snh;
     return Finish(snh);
@@ -3981,21 +3998,7 @@
     }
   }
 
-  // Check for nterp invoke fast-path based on shorty.
-  bool all_parameters_are_reference = true;
-  bool all_parameters_are_reference_or_int = true;
-  for (size_t i = 1; i < shorty.length(); ++i) {
-    if (shorty[i] != 'L') {
-      all_parameters_are_reference = false;
-      if (shorty[i] == 'F' || shorty[i] == 'D' || shorty[i] == 'J') {
-        all_parameters_are_reference_or_int = false;
-        break;
-      }
-    }
-  }
-  if (all_parameters_are_reference_or_int && shorty[0] != 'F' && shorty[0] != 'D') {
-    access_flags |= kAccNterpInvokeFastPathFlag;
-  }
+  access_flags |= GetNterpFastPathFlags(shorty, access_flags, kRuntimeISA);
 
   if (UNLIKELY((access_flags & kAccNative) != 0u)) {
     // Check if the native method is annotated with @FastNative or @CriticalNative.
@@ -4018,10 +4021,6 @@
     DCHECK_EQ(method.GetCodeItemOffset(), 0u);
     dst->SetDataPtrSize(nullptr, image_pointer_size_);  // Single implementation not set yet.
   } else {
-    // Check for nterp entry fast-path based on shorty.
-    if (all_parameters_are_reference) {
-      access_flags |= kAccNterpEntryPointFastPathFlag;
-    }
     const dex::ClassDef& class_def = dex_file.GetClassDef(klass->GetDexClassDefIndex());
     if (annotations::MethodIsNeverCompile(dex_file, class_def, dex_method_idx)) {
       access_flags |= kAccCompileDontBother;
@@ -4049,6 +4048,7 @@
       AllocAndInitializeDexCache(self, *dex_file, /* class_loader= */ nullptr);
   CHECK(dex_cache != nullptr) << "Failed to allocate dex cache for " << dex_file->GetLocation();
   AppendToBootClassPath(dex_file, dex_cache);
+  WriteBarrierOnClassLoader(self, /*class_loader=*/nullptr, dex_cache);
 }
 
 void ClassLinker::AppendToBootClassPath(const DexFile* dex_file,
@@ -4194,6 +4194,32 @@
                            dex_file.GetLocation().c_str());
 }
 
+void ClassLinker::WriteBarrierOnClassLoaderLocked(ObjPtr<mirror::ClassLoader> class_loader,
+                                                  ObjPtr<mirror::Object> root) {
+  if (class_loader != nullptr) {
+    // Since we added a strong root to the class table, do the write barrier as required for
+    // remembered sets and generational GCs.
+    WriteBarrier::ForEveryFieldWrite(class_loader);
+  } else if (log_new_roots_) {
+    new_roots_.push_back(GcRoot<mirror::Object>(root));
+  }
+}
+
+void ClassLinker::WriteBarrierOnClassLoader(Thread* self,
+                                            ObjPtr<mirror::ClassLoader> class_loader,
+                                            ObjPtr<mirror::Object> root) {
+  if (class_loader != nullptr) {
+    // Since we added a strong root to the class table, do the write barrier as required for
+    // remembered sets and generational GCs.
+    WriteBarrier::ForEveryFieldWrite(class_loader);
+  } else {
+    WriterMutexLock mu(self, *Locks::classlinker_classes_lock_);
+    if (log_new_roots_) {
+      new_roots_.push_back(GcRoot<mirror::Object>(root));
+    }
+  }
+}
+
 ObjPtr<mirror::DexCache> ClassLinker::RegisterDexFile(const DexFile& dex_file,
                                                       ObjPtr<mirror::ClassLoader> class_loader) {
   Thread* self = Thread::Current();
@@ -4269,11 +4295,10 @@
     self->AssertPendingOOMException();
     return nullptr;
   }
-  table->InsertStrongRoot(h_dex_cache.Get());
-  if (h_class_loader.Get() != nullptr) {
-    // Since we added a strong root to the class table, do the write barrier as required for
-    // remembered sets and generational GCs.
-    WriteBarrier::ForEveryFieldWrite(h_class_loader.Get());
+  if (table->InsertStrongRoot(h_dex_cache.Get())) {
+    WriteBarrierOnClassLoader(self, h_class_loader.Get(), h_dex_cache.Get());
+  } else {
+    // Write-barrier not required if strong-root isn't inserted.
   }
   VLOG(class_linker) << "Registered dex file " << dex_file.GetLocation();
   PaletteNotifyDexFileLoaded(dex_file.GetLocation().c_str());
@@ -4312,6 +4337,14 @@
     return dex_cache;
   }
   // Failure, dump diagnostic and abort.
+  if (dex_cache_data == nullptr) {
+    LOG(FATAL_WITHOUT_ABORT) << "NULL dex_cache_data";
+  } else {
+    LOG(FATAL_WITHOUT_ABORT)
+        << "dex_cache_data=" << dex_cache_data
+        << " weak_root=" << dex_cache_data->weak_root
+        << " decoded_weak_root=" << self->DecodeJObject(dex_cache_data->weak_root);
+  }
   for (const auto& entry : dex_caches_) {
     const DexCacheData& data = entry.second;
     if (DecodeDexCacheLocked(self, &data) != nullptr) {
@@ -4323,7 +4356,10 @@
           << " oat_dex_file=" << other_oat_dex_file
           << " oat_file=" << oat_file
           << " oat_location=" << (oat_file == nullptr ? "null" : oat_file->GetLocation())
-          << " dex_file=" << &entry.first;
+          << " dex_file=" << &entry.first
+          << " weak_root=" << data.weak_root
+          << " decoded_weak_root=" << self->DecodeJObject(data.weak_root)
+          << " dex_cache_data=" << &data;
     }
   }
   LOG(FATAL) << "Failed to find DexCache for OatDexFile "
@@ -4573,13 +4609,7 @@
     }
     VerifyObject(klass);
     class_table->InsertWithHash(klass, hash);
-    if (class_loader != nullptr) {
-      // This is necessary because we need to have the card dirtied for remembered sets.
-      WriteBarrier::ForEveryFieldWrite(class_loader);
-    }
-    if (log_new_roots_) {
-      new_class_roots_.push_back(GcRoot<mirror::Class>(klass));
-    }
+    WriteBarrierOnClassLoaderLocked(class_loader, klass);
   }
   if (kIsDebugBuild) {
     // Test that copied methods correctly can find their holder.
@@ -6248,15 +6278,8 @@
       ClassTable* const table = InsertClassTableForClassLoader(class_loader);
       const ObjPtr<mirror::Class> existing =
           table->UpdateClass(descriptor, h_new_class.Get(), ComputeModifiedUtf8Hash(descriptor));
-      if (class_loader != nullptr) {
-        // We updated the class in the class table, perform the write barrier so that the GC knows
-        // about the change.
-        WriteBarrier::ForEveryFieldWrite(class_loader);
-      }
       CHECK_EQ(existing, klass.Get());
-      if (log_new_roots_) {
-        new_class_roots_.push_back(GcRoot<mirror::Class>(h_new_class.Get()));
-      }
+      WriteBarrierOnClassLoaderLocked(class_loader, h_new_class.Get());
     }
 
     // Update CHA info based on whether we override methods.
@@ -6317,6 +6340,19 @@
   if (interfaces != nullptr) {
     for (size_t i = 0; i < interfaces->Size(); i++) {
       dex::TypeIndex idx = interfaces->GetTypeItem(i).type_idx_;
+      if (idx.IsValid()) {
+        // Check that a class does not implement itself directly.
+        //
+        // TODO: This is a cheap check to detect the straightforward case of a class implementing
+        // itself, but we should do a proper cycle detection on loaded classes, to detect all cases
+        // of class circularity errors. See b/28685551, b/28830038, and b/301108855
+        if (idx == class_def.class_idx_) {
+          ThrowClassCircularityError(
+              klass.Get(), "Class %s implements itself", klass->PrettyDescriptor().c_str());
+          return false;
+        }
+      }
+
       ObjPtr<mirror::Class> interface = ResolveType(idx, klass.Get());
       if (interface == nullptr) {
         DCHECK(Thread::Current()->IsExceptionPending());
@@ -7383,8 +7419,8 @@
 
   class VTableIndexCheckerRelease {
    protected:
-    explicit VTableIndexCheckerRelease(size_t vtable_length ATTRIBUTE_UNUSED) {}
-    void CheckIndex(uint32_t index ATTRIBUTE_UNUSED) const {}
+    explicit VTableIndexCheckerRelease([[maybe_unused]] size_t vtable_length) {}
+    void CheckIndex([[maybe_unused]] uint32_t index) const {}
   };
 
   using VTableIndexChecker =
@@ -10059,58 +10095,59 @@
     return resolved;
   }
 
-  StackHandleScope<4> hs(self);
+  VariableSizedHandleScope raw_method_type_hs(self);
+  mirror::RawMethodType raw_method_type(&raw_method_type_hs);
+  if (!ResolveMethodType(self, proto_idx, dex_cache, class_loader, raw_method_type)) {
+    DCHECK(self->IsExceptionPending());
+    return nullptr;
+  }
+
+  // The handle scope was filled with return type and paratemer types.
+  DCHECK_EQ(raw_method_type_hs.Size(),
+            dex_cache->GetDexFile()->GetShortyView(proto_idx).length());
+  ObjPtr<mirror::MethodType> method_type = mirror::MethodType::Create(self, raw_method_type);
+  if (method_type != nullptr) {
+    // Ensure all stores for the newly created MethodType are visible, before we attempt to place
+    // it in the DexCache (b/224733324).
+    std::atomic_thread_fence(std::memory_order_release);
+    dex_cache->SetResolvedMethodType(proto_idx, method_type.Ptr());
+  }
+  return method_type;
+}
+
+bool ClassLinker::ResolveMethodType(Thread* self,
+                                    dex::ProtoIndex proto_idx,
+                                    Handle<mirror::DexCache> dex_cache,
+                                    Handle<mirror::ClassLoader> class_loader,
+                                    /*out*/ mirror::RawMethodType method_type) {
+  DCHECK(Runtime::Current()->IsMethodHandlesEnabled());
+  DCHECK(dex_cache != nullptr);
+  DCHECK(dex_cache->GetClassLoader() == class_loader.Get());
 
   // First resolve the return type.
   const DexFile& dex_file = *dex_cache->GetDexFile();
   const dex::ProtoId& proto_id = dex_file.GetProtoId(proto_idx);
-  Handle<mirror::Class> return_type(hs.NewHandle(
-      ResolveType(proto_id.return_type_idx_, dex_cache, class_loader)));
+  ObjPtr<mirror::Class> return_type =
+      ResolveType(proto_id.return_type_idx_, dex_cache, class_loader);
   if (return_type == nullptr) {
     DCHECK(self->IsExceptionPending());
-    return nullptr;
+    return false;
   }
+  method_type.SetRType(return_type);
 
   // Then resolve the argument types.
-  //
-  // TODO: Is there a better way to figure out the number of method arguments
-  // other than by looking at the shorty ?
-  const size_t num_method_args = strlen(dex_file.StringDataByIdx(proto_id.shorty_idx_)) - 1;
-
-  ObjPtr<mirror::Class> array_of_class = GetClassRoot<mirror::ObjectArray<mirror::Class>>(this);
-  Handle<mirror::ObjectArray<mirror::Class>> method_params(hs.NewHandle(
-      mirror::ObjectArray<mirror::Class>::Alloc(self, array_of_class, num_method_args)));
-  if (method_params == nullptr) {
-    DCHECK(self->IsExceptionPending());
-    return nullptr;
-  }
-
   DexFileParameterIterator it(dex_file, proto_id);
-  int32_t i = 0;
-  MutableHandle<mirror::Class> param_class = hs.NewHandle<mirror::Class>(nullptr);
   for (; it.HasNext(); it.Next()) {
     const dex::TypeIndex type_idx = it.GetTypeIdx();
-    param_class.Assign(ResolveType(type_idx, dex_cache, class_loader));
-    if (param_class == nullptr) {
+    ObjPtr<mirror::Class> param_type = ResolveType(type_idx, dex_cache, class_loader);
+    if (param_type == nullptr) {
       DCHECK(self->IsExceptionPending());
-      return nullptr;
+      return false;
     }
-
-    method_params->Set(i++, param_class.Get());
+    method_type.AddPType(param_type);
   }
 
-  DCHECK(!it.HasNext());
-
-  Handle<mirror::MethodType> type = hs.NewHandle(
-      mirror::MethodType::Create(self, return_type, method_params));
-  if (type != nullptr) {
-    // Ensure all stores for the newly created MethodType are visible, before we attempt to place
-    // it in the DexCache (b/224733324).
-    std::atomic_thread_fence(std::memory_order_release);
-    dex_cache->SetResolvedMethodType(proto_idx, type.Get());
-  }
-
-  return type.Get();
+  return true;
 }
 
 ObjPtr<mirror::MethodType> ClassLinker::ResolveMethodType(Thread* self,
@@ -10785,10 +10822,10 @@
   WriterMutexLock mu(self, *Locks::classlinker_classes_lock_);
   ClassTable* const table = ClassTableForClassLoader(class_loader);
   DCHECK(table != nullptr);
-  if (table->InsertStrongRoot(dex_file) && class_loader != nullptr) {
-    // It was not already inserted, perform the write barrier to let the GC know the class loader's
-    // class table was modified.
-    WriteBarrier::ForEveryFieldWrite(class_loader);
+  if (table->InsertStrongRoot(dex_file)) {
+    WriteBarrierOnClassLoaderLocked(class_loader, dex_file);
+  } else {
+    // Write-barrier not required if strong-root isn't inserted.
   }
 }
 
@@ -10963,27 +11000,27 @@
       Runtime::Current()->GetJavaVM()->DecodeWeakGlobalAsStrong(result));
 }
 
-bool ClassLinker::DenyAccessBasedOnPublicSdk(ArtMethod* art_method ATTRIBUTE_UNUSED) const
+bool ClassLinker::DenyAccessBasedOnPublicSdk([[maybe_unused]] ArtMethod* art_method) const
     REQUIRES_SHARED(Locks::mutator_lock_) {
   // Should not be called on ClassLinker, only on AotClassLinker that overrides this.
   LOG(FATAL) << "UNREACHABLE";
   UNREACHABLE();
 }
 
-bool ClassLinker::DenyAccessBasedOnPublicSdk(ArtField* art_field ATTRIBUTE_UNUSED) const
+bool ClassLinker::DenyAccessBasedOnPublicSdk([[maybe_unused]] ArtField* art_field) const
     REQUIRES_SHARED(Locks::mutator_lock_) {
   // Should not be called on ClassLinker, only on AotClassLinker that overrides this.
   LOG(FATAL) << "UNREACHABLE";
   UNREACHABLE();
 }
 
-bool ClassLinker::DenyAccessBasedOnPublicSdk(const char* type_descriptor ATTRIBUTE_UNUSED) const {
+bool ClassLinker::DenyAccessBasedOnPublicSdk([[maybe_unused]] const char* type_descriptor) const {
   // Should not be called on ClassLinker, only on AotClassLinker that overrides this.
   LOG(FATAL) << "UNREACHABLE";
   UNREACHABLE();
 }
 
-void ClassLinker::SetEnablePublicSdkChecks(bool enabled ATTRIBUTE_UNUSED) {
+void ClassLinker::SetEnablePublicSdkChecks([[maybe_unused]] bool enabled) {
   // Should not be called on ClassLinker, only on AotClassLinker that overrides this.
   LOG(FATAL) << "UNREACHABLE";
   UNREACHABLE();
diff --git a/runtime/class_linker.h b/runtime/class_linker.h
index cdb92b2..5597149 100644
--- a/runtime/class_linker.h
+++ b/runtime/class_linker.h
@@ -41,10 +41,10 @@
 #include "jni.h"
 #include "mirror/class.h"
 #include "mirror/object.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 #include "verifier/verifier_enums.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtField;
 class ArtMethod;
@@ -97,6 +97,7 @@
 class MethodHandlesLookup;
 class MethodType;
 template<class T> class ObjectArray;
+class RawMethodType;
 class StackTraceElement;
 }  // namespace mirror
 
@@ -157,7 +158,7 @@
       REQUIRES_SHARED(Locks::classlinker_classes_lock_, Locks::mutator_lock_) = 0;
 };
 
-class ClassLinker {
+class EXPORT ClassLinker {
  public:
   static constexpr bool kAppImageMayContainStrings = true;
 
@@ -448,6 +449,14 @@
                                                ArtMethod* referrer)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
+  bool ResolveMethodType(Thread* self,
+                         dex::ProtoIndex proto_idx,
+                         Handle<mirror::DexCache> dex_cache,
+                         Handle<mirror::ClassLoader> class_loader,
+                         /*out*/ mirror::RawMethodType method_type)
+      REQUIRES_SHARED(Locks::mutator_lock_)
+      REQUIRES(!Locks::dex_lock_, !Roles::uninterruptible_);
+
   // Resolve a method handle with a given ID from the DexFile. The
   // result is not cached in the DexCache as the instance will only be
   // used once in most circumstances.
@@ -784,6 +793,16 @@
       REQUIRES_SHARED(Locks::mutator_lock_)
       NO_THREAD_SAFETY_ANALYSIS;
 
+  // Dirty card in the card-table corresponding to the class_loader. Also log
+  // the root if we are logging new roots and class_loader is null.
+  void WriteBarrierOnClassLoaderLocked(ObjPtr<mirror::ClassLoader> class_loader,
+                                       ObjPtr<mirror::Object> root)
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::classlinker_classes_lock_);
+  void WriteBarrierOnClassLoader(Thread* self,
+                                 ObjPtr<mirror::ClassLoader> class_loader,
+                                 ObjPtr<mirror::Object> root) REQUIRES_SHARED(Locks::mutator_lock_)
+      REQUIRES(!Locks::classlinker_classes_lock_);
+
   // DO NOT use directly. Use `Runtime::AppendToBootClassPath`.
   void AppendToBootClassPath(Thread* self, const DexFile* dex_file)
       REQUIRES_SHARED(Locks::mutator_lock_)
@@ -1330,8 +1349,8 @@
   // Boot class path table. Since the class loader for this is null.
   std::unique_ptr<ClassTable> boot_class_table_ GUARDED_BY(Locks::classlinker_classes_lock_);
 
-  // New class roots, only used by CMS since the GC needs to mark these in the pause.
-  std::vector<GcRoot<mirror::Class>> new_class_roots_ GUARDED_BY(Locks::classlinker_classes_lock_);
+  // New gc-roots, only used by CMS/CMC since the GC needs to mark these in the pause.
+  std::vector<GcRoot<mirror::Object>> new_roots_ GUARDED_BY(Locks::classlinker_classes_lock_);
 
   // Boot image oat files with new .bss GC roots to be visited in the pause by CMS.
   std::vector<const OatFile*> new_bss_roots_boot_oat_files_
@@ -1424,13 +1443,13 @@
   //       different object. It is the listener's responsibility to handle this.
   // Note: This callback is rarely useful so a default implementation has been given that does
   //       nothing.
-  virtual void ClassPreDefine(const char* descriptor ATTRIBUTE_UNUSED,
-                              Handle<mirror::Class> klass ATTRIBUTE_UNUSED,
-                              Handle<mirror::ClassLoader> class_loader ATTRIBUTE_UNUSED,
-                              const DexFile& initial_dex_file ATTRIBUTE_UNUSED,
-                              const dex::ClassDef& initial_class_def ATTRIBUTE_UNUSED,
-                              /*out*/DexFile const** final_dex_file ATTRIBUTE_UNUSED,
-                              /*out*/dex::ClassDef const** final_class_def ATTRIBUTE_UNUSED)
+  virtual void ClassPreDefine([[maybe_unused]] const char* descriptor,
+                              [[maybe_unused]] Handle<mirror::Class> klass,
+                              [[maybe_unused]] Handle<mirror::ClassLoader> class_loader,
+                              [[maybe_unused]] const DexFile& initial_dex_file,
+                              [[maybe_unused]] const dex::ClassDef& initial_class_def,
+                              [[maybe_unused]] /*out*/ DexFile const** final_dex_file,
+                              [[maybe_unused]] /*out*/ dex::ClassDef const** final_class_def)
       REQUIRES_SHARED(Locks::mutator_lock_) {}
 
   // A class has been loaded.
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc
index 95b224f..97f79b7 100644
--- a/runtime/class_linker_test.cc
+++ b/runtime/class_linker_test.cc
@@ -59,7 +59,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ClassLinkerTest : public CommonRuntimeTest {
  protected:
@@ -443,7 +443,7 @@
 
   class TestRootVisitor : public SingleRootVisitor {
    public:
-    void VisitRoot(mirror::Object* root, const RootInfo& info ATTRIBUTE_UNUSED) override {
+    void VisitRoot(mirror::Object* root, [[maybe_unused]] const RootInfo& info) override {
       EXPECT_TRUE(root != nullptr);
     }
   };
@@ -668,6 +668,7 @@
   ClassLoaderOffsets() : CheckOffsets<mirror::ClassLoader>(false, "Ljava/lang/ClassLoader;") {
     addOffset(OFFSETOF_MEMBER(mirror::ClassLoader, allocator_), "allocator");
     addOffset(OFFSETOF_MEMBER(mirror::ClassLoader, class_table_), "classTable");
+    addOffset(OFFSETOF_MEMBER(mirror::ClassLoader, name_), "name");
     addOffset(OFFSETOF_MEMBER(mirror::ClassLoader, packages_), "packages");
     addOffset(OFFSETOF_MEMBER(mirror::ClassLoader, parent_), "parent");
     addOffset(OFFSETOF_MEMBER(mirror::ClassLoader, proxyCache_), "proxyCache");
@@ -1545,12 +1546,8 @@
 
   auto container =
       std::make_shared<MemoryDexFileContainer>(old_dex_file->Begin(), old_dex_file->Size());
-  std::unique_ptr<DexFile> dex_file(new StandardDexFile(old_dex_file->Begin(),
-                                                        old_dex_file->Size(),
-                                                        location->ToModifiedUtf8(),
-                                                        0u,
-                                                        nullptr,
-                                                        std::move(container)));
+  std::unique_ptr<DexFile> dex_file(new StandardDexFile(
+      old_dex_file->Begin(), location->ToModifiedUtf8(), 0u, nullptr, std::move(container)));
   // Make a copy of the dex cache with changed name.
   dex_cache.Assign(class_linker->AllocAndInitializeDexCache(Thread::Current(),
                                                             *dex_file,
diff --git a/runtime/class_loader_context.cc b/runtime/class_loader_context.cc
index 2f34f04..988955c 100644
--- a/runtime/class_loader_context.cc
+++ b/runtime/class_loader_context.cc
@@ -17,6 +17,7 @@
 #include "class_loader_context.h"
 
 #include <algorithm>
+#include <optional>
 
 #include "android-base/file.h"
 #include "android-base/parseint.h"
@@ -39,14 +40,14 @@
 #include "mirror/object.h"
 #include "mirror/object_array-alloc-inl.h"
 #include "nativehelper/scoped_local_ref.h"
-#include "oat_file_assistant.h"
+#include "oat/oat_file_assistant.h"
 #include "obj_ptr-inl.h"
 #include "runtime.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static constexpr char kPathClassLoaderString[] = "PCL";
 static constexpr char kDelegateLastClassLoaderString[] = "DLC";
@@ -454,13 +455,14 @@
       // If path is relative, append it to the provided base directory.
       std::string location = cp_elem;
       if (location[0] != '/' && !classpath_dir.empty()) {
-        location = classpath_dir + (classpath_dir.back() == '/' ? "" : "/") + location;
+        location =
+            ART_FORMAT("{}{}{}", classpath_dir, classpath_dir.back() == '/' ? "" : "/", location);
       }
 
       // If file descriptors were provided for the class loader context dex paths,
       // get the descriptor which corresponds to this dex path. We assume the `fds`
       // vector follows the same order as a flattened class loader context.
-      int fd = -1;
+      File file;
       if (!fds.empty()) {
         if (dex_file_index >= fds.size()) {
           LOG(WARNING) << "Number of FDs is smaller than number of dex files in the context";
@@ -468,43 +470,45 @@
           return false;
         }
 
-        fd = fds[dex_file_index++];
-        DCHECK_GE(fd, 0);
+        file = File(fds[dex_file_index++], /*check_usage=*/false);
+        DCHECK(file.IsValid());
       }
 
       std::string error_msg;
+      std::optional<uint32_t> dex_checksum;
       if (only_read_checksums) {
         bool zip_file_only_contains_uncompress_dex;
-        if (!ArtDexFileLoader::GetMultiDexChecksums(location.c_str(),
-                                                    &dex_checksums,
-                                                    &dex_locations,
-                                                    &error_msg,
-                                                    fd,
-                                                    &zip_file_only_contains_uncompress_dex)) {
-          LOG(WARNING) << "Could not get dex checksums for location " << location << ", fd=" << fd;
+        ArtDexFileLoader dex_file_loader(&file, location);
+        if (!dex_file_loader.GetMultiDexChecksum(
+                &dex_checksum, &error_msg, &zip_file_only_contains_uncompress_dex)) {
+          LOG(WARNING) << "Could not get dex checksums for location " << location
+                       << ", fd=" << file.Fd();
           dex_files_state_ = kDexFilesOpenFailed;
         }
+        file.Release();  // Don't close the file yet (we have only read the checksum).
       } else {
         // When opening the dex files from the context we expect their checksum to match their
         // contents. So pass true to verify_checksum.
         // We don't need to do structural dex file verification, we only need to
         // check the checksum, so pass false to verify.
-        size_t opened_dex_files_index = info->opened_dex_files.size();
-        ArtDexFileLoader dex_file_loader(location.c_str(), fd, location);
+        size_t i = info->opened_dex_files.size();
+        ArtDexFileLoader dex_file_loader(&file, location);
         if (!dex_file_loader.Open(/*verify=*/false,
                                   /*verify_checksum=*/true,
                                   &error_msg,
                                   &info->opened_dex_files)) {
-          LOG(WARNING) << "Could not open dex files for location " << location << ", fd=" << fd;
+          LOG(WARNING) << "Could not open dex files for location " << location
+                       << ", fd=" << file.Fd();
           dex_files_state_ = kDexFilesOpenFailed;
         } else {
-          for (size_t k = opened_dex_files_index; k < info->opened_dex_files.size(); k++) {
-            std::unique_ptr<const DexFile>& dex = info->opened_dex_files[k];
-            dex_locations.push_back(dex->GetLocation());
-            dex_checksums.push_back(dex->GetLocationChecksum());
-          }
+          dex_checksum = DexFileLoader::GetMultiDexChecksum(info->opened_dex_files, &i);
+          DCHECK_EQ(i, info->opened_dex_files.size());
         }
       }
+      if (dex_checksum.has_value()) {
+        dex_locations.push_back(location);
+        dex_checksums.push_back(dex_checksum.value());
+      }
     }
 
     // We finished opening the dex files from the classpath.
@@ -518,8 +522,8 @@
     // Note that this will also remove the paths that could not be opened.
     info->original_classpath = std::move(info->classpath);
     DCHECK(dex_locations.size() == dex_checksums.size());
-    info->classpath = dex_locations;
-    info->checksums = dex_checksums;
+    info->classpath = std::move(dex_locations);
+    info->checksums = std::move(dex_checksums);
     AddToWorkList(info, work_list);
   }
 
@@ -692,31 +696,28 @@
     }
   }
 
-  for (size_t k = 0; k < info.opened_dex_files.size(); k++) {
-    const std::unique_ptr<const DexFile>& dex_file = info.opened_dex_files[k];
+  DCHECK_EQ(info.classpath.size(), info.checksums.size());
+  for (size_t i = 0; i < info.classpath.size(); i++) {
     if (for_dex2oat) {
-      // dex2oat only needs the base location. It cannot accept multidex locations.
-      // So ensure we only add each file once.
-      bool new_insert =
-          seen_locations.insert(DexFileLoader::GetBaseLocation(dex_file->GetLocation())).second;
+      // De-duplicate locations.
+      bool new_insert = seen_locations.insert(info.classpath[i]).second;
       if (!new_insert) {
         continue;
       }
     }
 
-    std::string location = dex_file->GetLocation();
+    std::string location = info.classpath[i];
     // If there is a stored class loader remap, fix up the multidex strings.
     if (!remap.empty()) {
-      std::string base_dex_location = DexFileLoader::GetBaseLocation(location);
-      auto it = remap.find(base_dex_location);
-      CHECK(it != remap.end()) << base_dex_location;
-      location = it->second + DexFileLoader::GetMultiDexSuffix(location);
+      auto it = remap.find(location);
+      CHECK(it != remap.end()) << location;
+      location = it->second;
     }
     locations.emplace_back(std::move(location));
 
     // dex2oat does not need the checksums.
     if (!for_dex2oat) {
-      checksums.push_back(dex_file->GetLocationChecksum());
+      checksums.push_back(info.checksums[i]);
     }
   }
   EncodeClassPath(base_dir, locations, checksums, info.type, out);
@@ -1155,13 +1156,17 @@
   }
 
   // Now that `info` is in the chain, populate dex files.
-  for (const DexFile* dex_file : dex_files_loaded) {
+  for (size_t i = 0; i < dex_files_loaded.size();) {
+    const DexFile* dex_file = dex_files_loaded[i];
+    uint32_t checksum = DexFileLoader::GetMultiDexChecksum(dex_files_loaded, &i);
     // Dex location of dex files loaded with InMemoryDexClassLoader is always bogus.
     // Use a magic value for the classpath instead.
     info->classpath.push_back((type == kInMemoryDexClassLoader) ?
                                   kInMemoryDexClassLoaderDexLocationMagic :
                                   dex_file->GetLocation());
-    info->checksums.push_back(dex_file->GetLocationChecksum());
+    info->checksums.push_back(checksum);
+  }
+  for (auto* dex_file : dex_files_loaded) {
     info->opened_dex_files.emplace_back(dex_file);
   }
 
@@ -1477,8 +1482,10 @@
   // in the Android world) - and as such we decide not to warn on them.
   ClassLoaderInfo* info = class_loader_chain_.get();
   for (size_t k = 0; k < info->classpath.size(); k++) {
-    for (const DexFile* dex_file : dex_files_to_check) {
-      if (info->checksums[k] == dex_file->GetLocationChecksum() &&
+    for (size_t i = 0; i < dex_files_to_check.size();) {
+      const DexFile* dex_file = dex_files_to_check[i];
+      uint32_t checksum = DexFileLoader::GetMultiDexChecksum(dex_files_to_check, &i);
+      if (info->checksums[k] == checksum &&
           AreDexNameMatching(info->classpath[k], dex_file->GetLocation())) {
         result.insert(dex_file);
       }
diff --git a/runtime/class_loader_context.h b/runtime/class_loader_context.h
index 806ab5e..6b819f4 100644
--- a/runtime/class_loader_context.h
+++ b/runtime/class_loader_context.h
@@ -23,19 +23,20 @@
 
 #include "arch/instruction_set.h"
 #include "base/dchecked_vector.h"
+#include "base/macros.h"
 #include "dex/dex_file.h"
 #include "handle_scope.h"
 #include "mirror/class_loader.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 #include "scoped_thread_state_change.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class DexFile;
 class OatFile;
 
 // Utility class which holds the class loader context used during compilation/verification.
-class ClassLoaderContext {
+class EXPORT ClassLoaderContext {
  public:
   enum class VerificationResult {
     kVerifies,
diff --git a/runtime/class_loader_context_test.cc b/runtime/class_loader_context_test.cc
index ce9780a..ec7abb7 100644
--- a/runtime/class_loader_context_test.cc
+++ b/runtime/class_loader_context_test.cc
@@ -20,6 +20,8 @@
 
 #include <filesystem>
 #include <fstream>
+#include <optional>
+#include <vector>
 
 #include "android-base/stringprintf.h"
 #include "android-base/strings.h"
@@ -27,6 +29,7 @@
 #include "art_method-alloc-inl.h"
 #include "base/dchecked_vector.h"
 #include "base/stl_util.h"
+#include "base/string_view_cpp20.h"
 #include "class_linker.h"
 #include "class_root-inl.h"
 #include "common_runtime_test.h"
@@ -37,13 +40,13 @@
 #include "mirror/class_loader-inl.h"
 #include "mirror/object-inl.h"
 #include "mirror/object_array-alloc-inl.h"
-#include "oat_file_assistant.h"
+#include "oat/oat_file_assistant.h"
 #include "runtime.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ClassLoaderContextTest : public CommonRuntimeTest {
  public:
@@ -184,41 +187,62 @@
                 ClassLoaderContext::ContextDexFilesState::kDexFilesOpened);
     }
     ClassLoaderContext::ClassLoaderInfo& info = *context->GetParent(index);
-    ASSERT_EQ(all_dex_files->size(), info.classpath.size());
-    ASSERT_EQ(all_dex_files->size(), info.checksums.size());
+
+    std::vector<const DexFile*> primary_dex_files;
+    std::vector<std::optional<uint32_t>> primary_checksums;
+    for (size_t i = 0; i < all_dex_files->size();) {
+      primary_dex_files.push_back((*all_dex_files)[i].get());
+      primary_checksums.push_back(DexFileLoader::GetMultiDexChecksum(*all_dex_files, &i));
+    }
+    ASSERT_EQ(primary_dex_files.size(), info.classpath.size());
+    ASSERT_EQ(primary_dex_files.size(), info.checksums.size());
+
     if (only_read_checksums) {
       ASSERT_EQ(0u, info.opened_dex_files.size());
+      for (size_t k = 0; k < primary_dex_files.size(); k++) {
+        const std::string& opened_location = info.classpath[k];
+        uint32_t opened_checksum = info.checksums[k];
+
+        const DexFile* expected_dex_file = primary_dex_files[k];
+        std::string expected_location = expected_dex_file->GetLocation();
+
+        if (!IsAbsoluteLocation(opened_location)) {
+          // If the opened location is relative (it was open from a relative path without a
+          // classpath_dir) it might not match the expected location which is absolute in tests).
+          // So we compare the endings (the checksum will validate it's actually the same file).
+          ASSERT_TRUE(EndsWith(expected_location, opened_location))
+              << expected_location << " " << opened_location;
+        } else {
+          ASSERT_EQ(expected_location, opened_location);
+        }
+        ASSERT_EQ(primary_checksums[k], opened_checksum);
+        if (classpath_matches_dex_location) {
+          ASSERT_EQ(info.classpath[k], opened_location);
+        }
+      }
     } else {
       ASSERT_EQ(all_dex_files->size(), info.opened_dex_files.size());
-    }
 
-    for (size_t k = 0, cur_open_dex_index = 0;
-         k < all_dex_files->size();
-         k++, cur_open_dex_index++) {
-      const std::string& opened_location = only_read_checksums
-          ? info.classpath[cur_open_dex_index]
-          : info.opened_dex_files[cur_open_dex_index]->GetLocation();
-      uint32_t opened_checksum = only_read_checksums
-          ? info.checksums[cur_open_dex_index]
-          : info.opened_dex_files[cur_open_dex_index]->GetLocationChecksum();
+      for (size_t k = 0; k < all_dex_files->size(); k++) {
+        const std::string& opened_location = info.opened_dex_files[k]->GetLocation();
+        uint32_t opened_checksum = info.opened_dex_files[k]->GetLocationChecksum();
 
-      std::unique_ptr<const DexFile>& expected_dex_file = (*all_dex_files)[k];
-      std::string expected_location = expected_dex_file->GetLocation();
+        std::unique_ptr<const DexFile>& expected_dex_file = (*all_dex_files)[k];
+        std::string expected_location = expected_dex_file->GetLocation();
 
-      if (!IsAbsoluteLocation(opened_location)) {
-        // If the opened location is relative (it was open from a relative path without a
-        // classpath_dir) it might not match the expected location which is absolute in tests).
-        // So we compare the endings (the checksum will validate it's actually the same file).
-        ASSERT_EQ(0, expected_location.compare(
-            expected_location.length() - opened_location.length(),
-            opened_location.length(),
-            opened_location));
-      } else {
-        ASSERT_EQ(expected_location, opened_location);
-      }
-      ASSERT_EQ(expected_dex_file->GetLocationChecksum(), opened_checksum);
-      if (classpath_matches_dex_location) {
-        ASSERT_EQ(info.classpath[k], opened_location);
+        if (!IsAbsoluteLocation(opened_location)) {
+          // If the opened location is relative (it was open from a relative path without a
+          // classpath_dir) it might not match the expected location which is absolute in tests).
+          // So we compare the endings (the checksum will validate it's actually the same file).
+          ASSERT_TRUE(EndsWith(expected_location, opened_location))
+              << expected_location << " " << opened_location;
+        } else {
+          ASSERT_EQ(expected_location, opened_location);
+        }
+        ASSERT_EQ(expected_dex_file->GetLocationChecksum(), opened_checksum);
+        if (classpath_matches_dex_location) {
+          ASSERT_EQ(info.classpath[k], opened_location);
+        }
       }
     }
   }
@@ -1191,6 +1215,23 @@
   ASSERT_EQ(expected_encoding, context->EncodeContextForOatFile(""));
 }
 
+// Same as above, but passes `only_read_checksums=true` to `OpenDexFiles`.
+TEST_F(ClassLoaderContextTest, EncodeInOatFileOnlyReadChecksums) {
+  std::string dex1_name = GetTestDexFileName("Main");
+  std::string dex2_name = GetTestDexFileName("MyClass");
+  std::unique_ptr<ClassLoaderContext> context =
+      ClassLoaderContext::Create("PCL[" + dex1_name + ":" + dex2_name + "]");
+  ASSERT_TRUE(context->OpenDexFiles(
+      /*classpath_dir=*/"", /*context_fds=*/{}, /*only_read_checksums=*/true));
+
+  std::vector<std::unique_ptr<const DexFile>> dex1 = OpenTestDexFiles("Main");
+  std::vector<std::unique_ptr<const DexFile>> dex2 = OpenTestDexFiles("MyClass");
+  std::string encoding = context->EncodeContextForOatFile("");
+  std::string expected_encoding =
+      "PCL[" + CreateClassPathWithChecksums(dex1) + ":" + CreateClassPathWithChecksums(dex2) + "]";
+  ASSERT_EQ(expected_encoding, context->EncodeContextForOatFile(""));
+}
+
 TEST_F(ClassLoaderContextTest, EncodeInOatFileIMC) {
   jobject class_loader_a = LoadDexInPathClassLoader("Main", nullptr);
   jobject class_loader_b = LoadDexInInMemoryDexClassLoader("MyClass", class_loader_a);
@@ -1202,9 +1243,11 @@
   std::vector<std::unique_ptr<const DexFile>> dex2 = OpenTestDexFiles("MyClass");
   ASSERT_EQ(dex2.size(), 1u);
 
+  uint32_t expected_checksum = DexFileLoader::GetMultiDexChecksum(dex2);
+
   std::string encoding = context->EncodeContextForOatFile("");
-  std::string expected_encoding = "IMC[<unknown>*" + std::to_string(dex2[0]->GetLocationChecksum())
-      + "];PCL[" + CreateClassPathWithChecksums(dex1) + "]";
+  std::string expected_encoding = "IMC[<unknown>*" + std::to_string(expected_checksum) + "];PCL[" +
+                                  CreateClassPathWithChecksums(dex1) + "]";
   ASSERT_EQ(expected_encoding, context->EncodeContextForOatFile(""));
 }
 
@@ -1232,6 +1275,17 @@
   ASSERT_EQ(expected_encoding, context->EncodeContextForDex2oat(""));
 }
 
+TEST_F(ClassLoaderContextTest, EncodeForDex2oatDuplicates) {
+  std::string dex_name = GetTestDexFileName("Main");
+  std::unique_ptr<ClassLoaderContext> context =
+      ClassLoaderContext::Create("PCL[" + dex_name + ":" + dex_name + "]");
+  ASSERT_TRUE(context->OpenDexFiles());
+
+  std::string encoding = context->EncodeContextForDex2oat("");
+  std::string expected_encoding = "PCL[" + dex_name + "]";
+  ASSERT_EQ(expected_encoding, context->EncodeContextForDex2oat(""));
+}
+
 TEST_F(ClassLoaderContextTest, EncodeContextsSinglePath) {
   jobject class_loader = LoadDexInPathClassLoader("Main", nullptr);
   std::unique_ptr<ClassLoaderContext> context =
diff --git a/runtime/class_loader_utils.h b/runtime/class_loader_utils.h
index 6868b3f..54662bf 100644
--- a/runtime/class_loader_utils.h
+++ b/runtime/class_loader_utils.h
@@ -19,6 +19,7 @@
 
 #include "art_field-inl.h"
 #include "base/locks.h"
+#include "base/macros.h"
 #include "handle_scope.h"
 #include "jni/jni_internal.h"
 #include "mirror/class_loader.h"
@@ -28,7 +29,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Returns true if the given class loader derives from BaseDexClassLoader.
 inline bool IsInstanceOfBaseDexClassLoader(Handle<mirror::ClassLoader> class_loader)
diff --git a/runtime/class_root-inl.h b/runtime/class_root-inl.h
index d88b8e1..871f5f3 100644
--- a/runtime/class_root-inl.h
+++ b/runtime/class_root-inl.h
@@ -25,7 +25,7 @@
 #include "obj_ptr-inl.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template <ReadBarrierOption kReadBarrierOption>
 inline ObjPtr<mirror::Class> GetClassRoot(ClassRoot class_root,
diff --git a/runtime/class_root.cc b/runtime/class_root.cc
index 6a6fd26..f0eb761 100644
--- a/runtime/class_root.cc
+++ b/runtime/class_root.cc
@@ -18,7 +18,7 @@
 
 #include "base/logging.h"
 
-namespace art {
+namespace art HIDDEN {
 
 const char* GetClassRootDescriptor(ClassRoot class_root) {
   static const char* const class_roots_descriptors[] = {
diff --git a/runtime/class_root.h b/runtime/class_root.h
index baa2128..67e369f 100644
--- a/runtime/class_root.h
+++ b/runtime/class_root.h
@@ -20,9 +20,10 @@
 #include <stdint.h>
 
 #include "base/locks.h"
+#include "base/macros.h"
 #include "read_barrier_option.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ClassLinker;
 template<class MirrorType> class ObjPtr;
diff --git a/runtime/class_status.h b/runtime/class_status.h
index 6c686a4..c8f42ad 100644
--- a/runtime/class_status.h
+++ b/runtime/class_status.h
@@ -20,15 +20,23 @@
 #include <iosfwd>
 #include <stdint.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 // Class Status
 //
-// kRetired: Class that's temporarily used till class linking time
-// has its (vtable) size figured out and has been cloned to one with the
-// right size which will be the one used later. The old one is retired and
-// will be gc'ed once all refs to the class point to the newly
-// cloned version.
+// kNotReady: Newly allocated Class object.
+// If a Class cannot be found in the class table by FindClass, ClassLinker
+// allocates a new one in the kNotReady state and calls LoadClass. Note
+// if ClassLinker does find a Class, it may not be kResolved and ClassLinker
+// will try to push it forward toward kResolved.
+//
+// kRetired: Class object that was temporarily used until class linking time
+// when it had its final size (including vtable size) figured out and had
+// been cloned to one with the right size which will be the one used later.
+// The old one is retired and will be gc'ed once all refs to the class point
+// to the newly cloned version.
 //
 // kErrorUnresolved, kErrorResolved: Class is erroneous. We need
 // to distinguish between classes that have been resolved and classes that
@@ -37,12 +45,6 @@
 // failed. We also need this to decide whether to wrap a previous
 // initialization failure in ClassDefNotFound error or not.
 //
-// kNotReady: If a Class cannot be found in the class table by
-// FindClass, it allocates an new one with AllocClass in the
-// kNotReady and calls LoadClass. Note if it does find a
-// class, it may not be kResolved and it will try to push it
-// forward toward kResolved.
-//
 // kIdx: LoadClass populates with Class with information from
 // the DexFile, moving the status to kIdx, indicating that the
 // Class value in super_class_ has not been populated. The new Class
@@ -72,13 +74,40 @@
 // compilation, and the compiler will mark the class as resolved in the
 // image and/or oat file.
 //
-// kVerifiedNeedsAccessChecks: The verifier sets a class to
-// this state if it encounters access-checks only soft failure at compile
-// time. This happens when there are unresolved classes in other dex
-// files, and this status marks a class as verified but that will need to run
+// kVerifiedNeedsAccessChecks: The verifier sets a class to this state
+// if it encounters access-checks only soft failure at compile time.
+// This happens when there are unresolved classes in other dex files,
+// and this status marks a class as verified but that will need to run
 // with access checks enabled in the interpreter.
 //
-// TODO: Explain the other states
+// kVerified: The class has been verified.
+//
+// kSuperclassValidated: Types referenced by virtual method signatures have
+// been verified to match the types referenced by the virtual and interface
+// methods from superclass and interfaces that they override or implement.
+// TODO: This is similar to loading constraints in the RI but the check is too
+// weak to fully ensure type safety. For example, the `DelegateLastClassLoader`
+// can easily break the type safety if a class name is resolved differently in
+// the parent class loader.
+//
+// kInitializing: The class is being initialized by some thread. Other threads
+// trying to initialize the class shall be blocked until the initialization is
+// completed by the initializing thread.
+//
+// kInitialized: The class has been fully initialized. However, a thread that
+// needs to see its fields in their initialized state needs to check for this
+// state with an acquire load on the class status field to ensure correct
+// memory visibility.
+//
+// kVisiblyInitialized: The class has been initialized and the fields in their
+// initialized state are visible to all threads without additional memory
+// synchronization. A thread can use a relaxed load of the class status field
+// and, if it finds this state, it can safely use the class's static fields.
+// This is ensured by executing a checkpoint on all threads after the class
+// was initialized; this operation is batched due to the high checkpoint cost.
+// This state enables cheap class initialization checks in compiled managed
+// code (especially AOT-compiled; JITted code could be eventually re-JITted
+// without any checks at all) and the runtime.
 enum class ClassStatus : uint8_t {
   kNotReady = 0,  // Zero-initialized Class object starts in this state.
   kRetired = 1,  // Retired, should not be used. Use the newly cloned one instead.
@@ -99,7 +128,7 @@
   kLast = kVisiblyInitialized
 };
 
-std::ostream& operator<<(std::ostream& os, ClassStatus rhs);
+EXPORT std::ostream& operator<<(std::ostream& os, ClassStatus rhs);
 
 }  // namespace art
 
diff --git a/runtime/class_table-inl.h b/runtime/class_table-inl.h
index 4ee59a7..8a8487c 100644
--- a/runtime/class_table-inl.h
+++ b/runtime/class_table-inl.h
@@ -23,10 +23,10 @@
 #include "dex/utf.h"
 #include "gc_root-inl.h"
 #include "mirror/class.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 #include "obj_ptr-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 inline ClassTable::TableSlot::TableSlot(ObjPtr<mirror::Class> klass)
     : TableSlot(klass, klass->DescriptorHash()) {}
diff --git a/runtime/class_table.cc b/runtime/class_table.cc
index 429f926..f66bd1e 100644
--- a/runtime/class_table.cc
+++ b/runtime/class_table.cc
@@ -19,9 +19,9 @@
 #include "base/stl_util.h"
 #include "mirror/class-inl.h"
 #include "mirror/string-inl.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 
-namespace art {
+namespace art HIDDEN {
 
 ClassTable::ClassTable() : lock_("Class loader classes", kClassLoaderClassesLock) {
   Runtime* const runtime = Runtime::Current();
diff --git a/runtime/class_table.h b/runtime/class_table.h
index 54e066a..1c9b0ce 100644
--- a/runtime/class_table.h
+++ b/runtime/class_table.h
@@ -28,7 +28,7 @@
 #include "gc_root.h"
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class OatFile;
 
@@ -153,7 +153,7 @@
                            ClassDescriptorEquals,
                            GcRootArenaAllocator<TableSlot, kAllocatorTagClassTable>>;
 
-  ClassTable();
+  EXPORT ClassTable();
 
   // Freeze the current class tables by allocating a new table and never updating or modifying the
   // existing table. This helps prevents dirty pages after caused by inserting after zygote fork.
@@ -172,7 +172,7 @@
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Returns the number of classes in previous snapshots no matter the defining loader.
-  size_t NumReferencedZygoteClasses() const
+  EXPORT size_t NumReferencedZygoteClasses() const
       REQUIRES(!lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
@@ -252,7 +252,7 @@
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Read a table from ptr and put it at the front of the class set.
-  size_t ReadFromMemory(uint8_t* ptr)
+  EXPORT size_t ReadFromMemory(uint8_t* ptr)
       REQUIRES(!lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
diff --git a/runtime/class_table_test.cc b/runtime/class_table_test.cc
index 14c5d70..15cca6d 100644
--- a/runtime/class_table_test.cc
+++ b/runtime/class_table_test.cc
@@ -28,7 +28,7 @@
 #include "obj_ptr.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 class CollectRootVisitor {
diff --git a/runtime/common_dex_operations.h b/runtime/common_dex_operations.h
index ce2090c..58b54af 100644
--- a/runtime/common_dex_operations.h
+++ b/runtime/common_dex_operations.h
@@ -42,7 +42,7 @@
 #include "stack.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace interpreter {
   void ArtInterpreterToInterpreterBridge(Thread* self,
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc
index ee574bc..922d678 100644
--- a/runtime/common_runtime_test.cc
+++ b/runtime/common_runtime_test.cc
@@ -65,7 +65,7 @@
 #include "thread.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
diff --git a/runtime/common_runtime_test.h b/runtime/common_runtime_test.h
index 85c48a2..8f9d7a8 100644
--- a/runtime/common_runtime_test.h
+++ b/runtime/common_runtime_test.h
@@ -28,6 +28,7 @@
 #include "arch/instruction_set.h"
 #include "base/common_art_test.h"
 #include "base/locks.h"
+#include "base/macros.h"
 #include "base/os.h"
 #include "base/unix_file/fd_file.h"
 #include "dex/art_dex_file_loader.h"
@@ -37,7 +38,7 @@
 #include "runtime_globals.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class MethodReference;
 class TypeReference;
@@ -136,7 +137,7 @@
 
  protected:
   // Allow subclases such as CommonCompilerTest to add extra options.
-  virtual void SetUpRuntimeOptions(RuntimeOptions* options ATTRIBUTE_UNUSED) {}
+  virtual void SetUpRuntimeOptions([[maybe_unused]] RuntimeOptions* options) {}
 
   // Called before the runtime is created.
   virtual void PreRuntimeCreate() {}
@@ -270,58 +271,47 @@
   DISALLOW_COPY_AND_ASSIGN(CheckJniAbortCatcher);
 };
 
-#define TEST_DISABLED() \
-  do { \
-    printf("WARNING: TEST DISABLED\n"); \
-    return; \
-  } while (false)
+#define TEST_DISABLED() GTEST_SKIP() << "WARNING: TEST DISABLED";
 
-#define TEST_DISABLED_FOR_ARM() \
+#define TEST_DISABLED_FOR_ARM()                                                        \
   if (kRuntimeISA == InstructionSet::kArm || kRuntimeISA == InstructionSet::kThumb2) { \
-    printf("WARNING: TEST DISABLED FOR ARM\n"); \
-    return; \
+    GTEST_SKIP() << "WARNING: TEST DISABLED FOR ARM";                                  \
   }
 
-#define TEST_DISABLED_FOR_ARM64() \
-  if (kRuntimeISA == InstructionSet::kArm64) { \
-    printf("WARNING: TEST DISABLED FOR ARM64\n"); \
-    return; \
+#define TEST_DISABLED_FOR_ARM64()                       \
+  if (kRuntimeISA == InstructionSet::kArm64) {          \
+    GTEST_SKIP() << "WARNING: TEST DISABLED FOR ARM64"; \
   }
 
-#define TEST_DISABLED_FOR_X86() \
-  if (kRuntimeISA == InstructionSet::kX86) { \
-    printf("WARNING: TEST DISABLED FOR X86\n"); \
-    return; \
+#define TEST_DISABLED_FOR_RISCV64()                       \
+  if (kRuntimeISA == InstructionSet::kRiscv64) {          \
+    GTEST_SKIP() << "WARNING: TEST DISABLED FOR RISCV64"; \
   }
 
-#define TEST_DISABLED_FOR_X86_64() \
-  if (kRuntimeISA == InstructionSet::kX86_64) { \
-    printf("WARNING: TEST DISABLED FOR X86_64\n"); \
-    return; \
+#define TEST_DISABLED_FOR_X86()                       \
+  if (kRuntimeISA == InstructionSet::kX86) {          \
+    GTEST_SKIP() << "WARNING: TEST DISABLED FOR X86"; \
   }
 
-#define TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS() \
-  if (!gUseReadBarrier || !kUseBakerReadBarrier) { \
-    printf("WARNING: TEST DISABLED FOR GC WITHOUT BAKER READ BARRIER\n"); \
-    return; \
+#define TEST_DISABLED_FOR_X86_64()                       \
+  if (kRuntimeISA == InstructionSet::kX86_64) {          \
+    GTEST_SKIP() << "WARNING: TEST DISABLED FOR X86_64"; \
   }
 
-#define TEST_DISABLED_FOR_HEAP_POISONING() \
-  if (kPoisonHeapReferences) { \
-    printf("WARNING: TEST DISABLED FOR HEAP POISONING\n"); \
-    return; \
+#define TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS()                             \
+  if (!gUseReadBarrier || !kUseBakerReadBarrier) {                              \
+    GTEST_SKIP() << "WARNING: TEST DISABLED FOR GC WITHOUT BAKER READ BARRIER"; \
   }
 
-#define TEST_DISABLED_FOR_MEMORY_TOOL_WITH_HEAP_POISONING_WITHOUT_READ_BARRIERS() \
-  if (kRunningOnMemoryTool && kPoisonHeapReferences && !gUseReadBarrier) { \
-    printf("WARNING: TEST DISABLED FOR MEMORY TOOL WITH HEAP POISONING WITHOUT READ BARRIERS\n"); \
-    return; \
+#define TEST_DISABLED_FOR_MEMORY_TOOL_WITH_HEAP_POISONING_WITHOUT_READ_BARRIERS()              \
+  if (kRunningOnMemoryTool && kPoisonHeapReferences && !gUseReadBarrier) {                     \
+    GTEST_SKIP()                                                                               \
+        << "WARNING: TEST DISABLED FOR MEMORY TOOL WITH HEAP POISONING WITHOUT READ BARRIERS"; \
   }
 
-#define TEST_DISABLED_FOR_KERNELS_WITH_CACHE_SEGFAULT() \
-  if (CacheOperationsMaySegFault()) { \
-    printf("WARNING: TEST DISABLED ON KERNEL THAT SEGFAULT ON CACHE OPERATIONS\n"); \
-    return; \
+#define TEST_DISABLED_FOR_KERNELS_WITH_CACHE_SEGFAULT()                                   \
+  if (CacheOperationsMaySegFault()) {                                                     \
+    GTEST_SKIP() << "WARNING: TEST DISABLED ON KERNEL THAT SEGFAULT ON CACHE OPERATIONS"; \
   }
 
 }  // namespace art
diff --git a/runtime/common_throws.cc b/runtime/common_throws.cc
index 5182689..3724866 100644
--- a/runtime/common_throws.cc
+++ b/runtime/common_throws.cc
@@ -38,7 +38,7 @@
 #include "thread.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringAppendV;
 using android::base::StringPrintf;
diff --git a/runtime/common_throws.h b/runtime/common_throws.h
index d9620df..aeba3bb 100644
--- a/runtime/common_throws.h
+++ b/runtime/common_throws.h
@@ -20,9 +20,10 @@
 #include <string_view>
 
 #include "base/locks.h"
+#include "base/macros.h"
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 class Class;
 class Object;
@@ -83,13 +84,13 @@
 
 // ClassFormatError
 
-void ThrowClassFormatError(ObjPtr<mirror::Class> referrer, const char* fmt, ...)
-    __attribute__((__format__(__printf__, 2, 3)))
-    REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR;
+EXPORT void ThrowClassFormatError(ObjPtr<mirror::Class> referrer, const char* fmt, ...)
+    __attribute__((__format__(__printf__, 2, 3))) REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR;
 
 // IllegalAccessError
 
-void ThrowIllegalAccessErrorClass(ObjPtr<mirror::Class> referrer, ObjPtr<mirror::Class> accessed)
+EXPORT void ThrowIllegalAccessErrorClass(ObjPtr<mirror::Class> referrer,
+                                         ObjPtr<mirror::Class> accessed)
     REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR;
 
 void ThrowIllegalAccessErrorClassForMethodDispatch(ObjPtr<mirror::Class> referrer,
@@ -101,10 +102,10 @@
 void ThrowIllegalAccessErrorMethod(ObjPtr<mirror::Class> referrer, ArtMethod* accessed)
     REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR;
 
-void ThrowIllegalAccessErrorField(ObjPtr<mirror::Class> referrer, ArtField* accessed)
+EXPORT void ThrowIllegalAccessErrorField(ObjPtr<mirror::Class> referrer, ArtField* accessed)
     REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR;
 
-void ThrowIllegalAccessErrorFinalField(ArtMethod* referrer, ArtField* accessed)
+EXPORT void ThrowIllegalAccessErrorFinalField(ArtMethod* referrer, ArtField* accessed)
     REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR;
 
 void ThrowIllegalAccessError(ObjPtr<mirror::Class> referrer, const char* fmt, ...)
@@ -128,7 +129,7 @@
 
 // IllegalAccessException
 
-void ThrowIllegalStateException(const char* msg)
+EXPORT void ThrowIllegalStateException(const char* msg)
     REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR;
 
 // IncompatibleClassChangeError
@@ -144,9 +145,9 @@
                                                                 ArtMethod* referrer)
     REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR;
 
-void ThrowIncompatibleClassChangeErrorField(ArtField* resolved_field,
-                                            bool is_static,
-                                            ArtMethod* referrer)
+EXPORT void ThrowIncompatibleClassChangeErrorField(ArtField* resolved_field,
+                                                   bool is_static,
+                                                   ArtMethod* referrer)
     REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR;
 
 void ThrowIncompatibleClassChangeError(ObjPtr<mirror::Class> referrer, const char* fmt, ...)
@@ -196,10 +197,10 @@
 
 // NoSuchFieldError
 
-void ThrowNoSuchFieldError(std::string_view scope,
-                           ObjPtr<mirror::Class> c,
-                           std::string_view type,
-                           std::string_view name)
+EXPORT void ThrowNoSuchFieldError(std::string_view scope,
+                                  ObjPtr<mirror::Class> c,
+                                  std::string_view type,
+                                  std::string_view name)
     REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR;
 
 void ThrowNoSuchFieldException(ObjPtr<mirror::Class> c, std::string_view name)
@@ -229,7 +230,7 @@
 void ThrowNullPointerExceptionFromDexPC(bool check_address = false, uintptr_t addr = 0)
     REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR;
 
-void ThrowNullPointerException(const char* msg)
+EXPORT void ThrowNullPointerException(const char* msg)
     REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR;
 
 void ThrowNullPointerException()
diff --git a/runtime/compat_framework.cc b/runtime/compat_framework.cc
index 17d423b..e693508 100644
--- a/runtime/compat_framework.cc
+++ b/runtime/compat_framework.cc
@@ -22,7 +22,7 @@
 #include "android-base/logging.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Compat change states as strings.
 static constexpr char kUnknownChangeState[] = "UNKNOWN";
diff --git a/runtime/compat_framework.h b/runtime/compat_framework.h
index 99a9215..1e71362 100644
--- a/runtime/compat_framework.h
+++ b/runtime/compat_framework.h
@@ -23,7 +23,7 @@
 #include "base/mutex.h"
 #include "base/string_view_cpp20.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // ART counterpart of the compat framework (go/compat-framework).
 // Created in order to avoid repeated up-calls to Java.
diff --git a/runtime/compilation_kind.h b/runtime/compilation_kind.h
index c289e98..08c5025 100644
--- a/runtime/compilation_kind.h
+++ b/runtime/compilation_kind.h
@@ -20,7 +20,9 @@
 #include <iosfwd>
 #include <stdint.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 enum class CompilationKind {
   kOsr,
diff --git a/runtime/compiler_callbacks.h b/runtime/compiler_callbacks.h
index f76ee66..cd6f6b8 100644
--- a/runtime/compiler_callbacks.h
+++ b/runtime/compiler_callbacks.h
@@ -18,11 +18,12 @@
 #define ART_RUNTIME_COMPILER_CALLBACKS_H_
 
 #include "base/locks.h"
+#include "base/macros.h"
 #include "class_status.h"
 #include "dex/class_reference.h"
 #include "dex/method_reference.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class CompilerDriver;
 
@@ -52,25 +53,25 @@
   virtual void ClassRejected(ClassReference ref) = 0;
 
   virtual verifier::VerifierDeps* GetVerifierDeps() const = 0;
-  virtual void SetVerifierDeps(verifier::VerifierDeps* deps ATTRIBUTE_UNUSED) {}
+  virtual void SetVerifierDeps([[maybe_unused]] verifier::VerifierDeps* deps) {}
 
   // Return the class status of a previous stage of the compilation. This can be used, for example,
   // when class unloading is enabled during multidex compilation.
-  virtual ClassStatus GetPreviousClassState(ClassReference ref ATTRIBUTE_UNUSED) {
+  virtual ClassStatus GetPreviousClassState([[maybe_unused]] ClassReference ref) {
     return ClassStatus::kNotReady;
   }
 
-  virtual void SetDoesClassUnloading(bool does_class_unloading ATTRIBUTE_UNUSED,
-                                     CompilerDriver* compiler_driver ATTRIBUTE_UNUSED) {}
+  virtual void SetDoesClassUnloading([[maybe_unused]] bool does_class_unloading,
+                                     [[maybe_unused]] CompilerDriver* compiler_driver) {}
 
   bool IsBootImage() {
     return mode_ == CallbackMode::kCompileBootImage;
   }
 
-  virtual void UpdateClassState(ClassReference ref ATTRIBUTE_UNUSED,
-                                ClassStatus state ATTRIBUTE_UNUSED) {}
+  virtual void UpdateClassState([[maybe_unused]] ClassReference ref,
+                                [[maybe_unused]] ClassStatus state) {}
 
-  virtual bool CanUseOatStatusForVerification(mirror::Class* klass ATTRIBUTE_UNUSED)
+  virtual bool CanUseOatStatusForVerification([[maybe_unused]] mirror::Class* klass)
       REQUIRES_SHARED(Locks::mutator_lock_) {
     return false;
   }
diff --git a/runtime/debug_print.cc b/runtime/debug_print.cc
index fd9e050..ef4143a 100644
--- a/runtime/debug_print.cc
+++ b/runtime/debug_print.cc
@@ -31,7 +31,7 @@
 #include "thread-current-inl.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 std::string DescribeSpace(ObjPtr<mirror::Class> klass) {
   std::ostringstream oss;
diff --git a/runtime/debug_print.h b/runtime/debug_print.h
index 7c68402..b4c3bba 100644
--- a/runtime/debug_print.h
+++ b/runtime/debug_print.h
@@ -18,13 +18,14 @@
 #define ART_RUNTIME_DEBUG_PRINT_H_
 
 #include "base/locks.h"
+#include "base/macros.h"
 #include "mirror/object.h"
 
 // Helper functions for printing extra information for certain hard to diagnose bugs.
 
-namespace art {
+namespace art HIDDEN {
 
-std::string DescribeSpace(ObjPtr<mirror::Class> klass)
+EXPORT std::string DescribeSpace(ObjPtr<mirror::Class> klass)
     REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR;
 std::string DescribeLoaders(ObjPtr<mirror::ClassLoader> loader, const char* class_descriptor)
     REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR;
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index a7b818e..673379c 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -68,7 +68,7 @@
 #include "mirror/throwable.h"
 #include "nativehelper/scoped_local_ref.h"
 #include "nativehelper/scoped_primitive_array.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 #include "obj_ptr-inl.h"
 #include "reflection.h"
 #include "reflective_handle.h"
@@ -83,7 +83,7 @@
 #include "thread_pool.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -340,7 +340,11 @@
       Dbg::DdmSendThreadNotification(thread, CHUNK_TYPE("THCR"));
       finish_barrier.Pass(cls_self);
     });
-    size_t checkpoints = Runtime::Current()->GetThreadList()->RunCheckpoint(&fc);
+    // TODO(b/253671779): The above eventually results in calls to EventHandler::DispatchEvent,
+    // which does a ScopedThreadStateChange, which amounts to a thread state change inside the
+    // checkpoint run method. Hence the normal check would fail, and thus we specify Unchecked
+    // here.
+    size_t checkpoints = Runtime::Current()->GetThreadList()->RunCheckpointUnchecked(&fc);
     ScopedThreadSuspension sts(self, ThreadState::kWaitingForCheckPointsToRun);
     finish_barrier.Increment(self, checkpoints);
   }
@@ -568,7 +572,7 @@
       // of the use of mmaps, so don't report. If not free memory then start a new segment.
       bool flush = true;
       if (start > startOfNextMemoryChunk_) {
-        const size_t kMaxFreeLen = 2 * kPageSize;
+        const size_t kMaxFreeLen = 2 * gPageSize;
         void* free_start = startOfNextMemoryChunk_;
         void* free_end = start;
         const size_t free_len =
diff --git a/runtime/debugger.h b/runtime/debugger.h
index a79add9..fd261ab 100644
--- a/runtime/debugger.h
+++ b/runtime/debugger.h
@@ -27,18 +27,19 @@
 #include "base/array_ref.h"
 #include "base/locks.h"
 #include "base/logging.h"
+#include "base/macros.h"
 #include "jni.h"
 #include "runtime.h"
 #include "runtime_callbacks.h"
 #include "thread.h"
 #include "thread_state.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class Dbg {
  public:
-  static void SetJdwpAllowed(bool allowed);
-  static bool IsJdwpAllowed();
+  EXPORT static void SetJdwpAllowed(bool allowed);
+  EXPORT static bool IsJdwpAllowed();
 
   // Invoked by the GC in case we need to keep DDMS informed.
   static void GcDidFinish() REQUIRES(!Locks::mutator_lock_);
@@ -82,15 +83,14 @@
       REQUIRES_SHARED(Locks::mutator_lock_);
   static void DdmSetThreadNotification(bool enable)
       REQUIRES(!Locks::thread_list_lock_);
-  static bool DdmHandleChunk(
-      JNIEnv* env,
-      uint32_t type,
-      const ArrayRef<const jbyte>& data,
-      /*out*/uint32_t* out_type,
-      /*out*/std::vector<uint8_t>* out_data);
+  EXPORT static bool DdmHandleChunk(JNIEnv* env,
+                                    uint32_t type,
+                                    const ArrayRef<const jbyte>& data,
+                                    /*out*/ uint32_t* out_type,
+                                    /*out*/ std::vector<uint8_t>* out_data);
 
-  static void DdmConnected() REQUIRES_SHARED(Locks::mutator_lock_);
-  static void DdmDisconnected() REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT static void DdmConnected() REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT static void DdmDisconnected() REQUIRES_SHARED(Locks::mutator_lock_);
 
   /*
    * Allocation tracking support.
diff --git a/runtime/deoptimization_kind.h b/runtime/deoptimization_kind.h
index 65a1cf1..76a11b3 100644
--- a/runtime/deoptimization_kind.h
+++ b/runtime/deoptimization_kind.h
@@ -18,8 +18,9 @@
 #define ART_RUNTIME_DEOPTIMIZATION_KIND_H_
 
 #include "base/logging.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 enum class DeoptimizationKind {
   kAotInlineCache = 0,
diff --git a/runtime/dex/dex_file_annotations.cc b/runtime/dex/dex_file_annotations.cc
index 7c1dd1e..ab2384e 100644
--- a/runtime/dex/dex_file_annotations.cc
+++ b/runtime/dex/dex_file_annotations.cc
@@ -35,14 +35,13 @@
 #include "mirror/method.h"
 #include "mirror/object_array-alloc-inl.h"
 #include "mirror/object_array-inl.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 #include "obj_ptr-inl.h"
-#include "quicken_info.h"
 #include "reflection.h"
 #include "thread.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
diff --git a/runtime/dex/dex_file_annotations.h b/runtime/dex/dex_file_annotations.h
index cffeb25..3a79e11 100644
--- a/runtime/dex/dex_file_annotations.h
+++ b/runtime/dex/dex_file_annotations.h
@@ -23,7 +23,7 @@
 #include "mirror/object_array.h"
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class ClassLoader;
@@ -40,7 +40,7 @@
     REQUIRES_SHARED(Locks::mutator_lock_);
 ObjPtr<mirror::ObjectArray<mirror::Object>> GetAnnotationsForField(ArtField* field)
     REQUIRES_SHARED(Locks::mutator_lock_);
-ObjPtr<mirror::ObjectArray<mirror::String>> GetSignatureAnnotationForField(ArtField* field)
+EXPORT ObjPtr<mirror::ObjectArray<mirror::String>> GetSignatureAnnotationForField(ArtField* field)
     REQUIRES_SHARED(Locks::mutator_lock_);
 bool IsFieldAnnotationPresent(ArtField* field, Handle<mirror::Class> annotation_class)
     REQUIRES_SHARED(Locks::mutator_lock_);
@@ -67,8 +67,8 @@
     ArtMethod* method,
     /*out*/ MutableHandle<mirror::ObjectArray<mirror::String>>* names,
     /*out*/ MutableHandle<mirror::IntArray>* access_flags) REQUIRES_SHARED(Locks::mutator_lock_);
-ObjPtr<mirror::ObjectArray<mirror::String>> GetSignatureAnnotationForMethod(ArtMethod* method)
-    REQUIRES_SHARED(Locks::mutator_lock_);
+EXPORT ObjPtr<mirror::ObjectArray<mirror::String>> GetSignatureAnnotationForMethod(
+    ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_);
 // Check whether `method` is annotated with `annotation_class`.
 // If `lookup_in_resolved_boot_classes` is true, look up any of the
 // method's annotations' classes in the bootstrap class loader's
@@ -83,14 +83,14 @@
 // is annotated with @dalvik.annotation.optimization.FastNative or
 // @dalvik.annotation.optimization.CriticalNative with build visibility.
 // If yes, return the associated access flags, i.e. kAccFastNative or kAccCriticalNative.
-uint32_t GetNativeMethodAnnotationAccessFlags(const DexFile& dex_file,
-                                              const dex::ClassDef& class_def,
-                                              uint32_t method_index);
+EXPORT uint32_t GetNativeMethodAnnotationAccessFlags(const DexFile& dex_file,
+                                                     const dex::ClassDef& class_def,
+                                                     uint32_t method_index);
 // Is the method from the `dex_file` with the given `field_index`
 // annotated with @dalvik.annotation.optimization.NeverCompile?
-bool MethodIsNeverCompile(const DexFile& dex_file,
-                          const dex::ClassDef& class_def,
-                          uint32_t method_index);
+EXPORT bool MethodIsNeverCompile(const DexFile& dex_file,
+                                 const dex::ClassDef& class_def,
+                                 uint32_t method_index);
 // Is the method from the `dex_file` with the given `field_index`
 // annotated with @dalvik.annotation.optimization.NeverInline?
 bool MethodIsNeverInline(const DexFile& dex_file,
@@ -137,9 +137,9 @@
     REQUIRES_SHARED(Locks::mutator_lock_);
 bool GetInnerClassFlags(Handle<mirror::Class> klass, uint32_t* flags)
     REQUIRES_SHARED(Locks::mutator_lock_);
-ObjPtr<mirror::ObjectArray<mirror::String>> GetSignatureAnnotationForClass(
+EXPORT ObjPtr<mirror::ObjectArray<mirror::String>> GetSignatureAnnotationForClass(
     Handle<mirror::Class> klass) REQUIRES_SHARED(Locks::mutator_lock_);
-const char* GetSourceDebugExtension(Handle<mirror::Class> klass)
+EXPORT const char* GetSourceDebugExtension(Handle<mirror::Class> klass)
     REQUIRES_SHARED(Locks::mutator_lock_);
 ObjPtr<mirror::Class> GetNestHost(Handle<mirror::Class> klass)
     REQUIRES_SHARED(Locks::mutator_lock_);
diff --git a/runtime/dex2oat_environment_test.h b/runtime/dex2oat_environment_test.h
index c7febcd..08b36bb 100644
--- a/runtime/dex2oat_environment_test.h
+++ b/runtime/dex2oat_environment_test.h
@@ -18,10 +18,12 @@
 #define ART_RUNTIME_DEX2OAT_ENVIRONMENT_TEST_H_
 
 #include <fstream>
+#include <optional>
 #include <string>
 #include <vector>
 
 #include "base/file_utils.h"
+#include "base/macros.h"
 #include "base/os.h"
 #include "base/stl_util.h"
 #include "base/utils.h"
@@ -33,11 +35,11 @@
 #include "gc/heap.h"
 #include "gc/space/image_space.h"
 #include "gtest/gtest.h"
-#include "oat_file_assistant.h"
+#include "oat/oat_file_assistant.h"
 #include "runtime.h"
 #include "ziparchive/zip_writer.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static constexpr bool kDebugArgs = false;
 
@@ -98,8 +100,7 @@
     Dex2oatScratchDirs::SetUp(android_data_);
 
     // Verify the environment is as we expect
-    std::vector<uint32_t> checksums;
-    std::vector<std::string> dex_locations;
+    std::optional<uint32_t> checksum;
     std::string error_msg;
     ASSERT_TRUE(OS::FileExists(GetSystemImageFile().c_str()))
       << "Expected pre-compiled boot image to be at: " << GetSystemImageFile();
@@ -107,8 +108,8 @@
       << "Expected dex file to be at: " << GetDexSrc1();
     ASSERT_TRUE(OS::FileExists(GetResourceOnlySrc1().c_str()))
       << "Expected stripped dex file to be at: " << GetResourceOnlySrc1();
-    ASSERT_TRUE(ArtDexFileLoader::GetMultiDexChecksums(
-        GetResourceOnlySrc1().c_str(), &checksums, &dex_locations, &error_msg))
+    ArtDexFileLoader dex_file_loader0(GetResourceOnlySrc1());
+    ASSERT_TRUE(dex_file_loader0.GetMultiDexChecksum(&checksum, &error_msg))
         << "Expected stripped dex file to be stripped: " << GetResourceOnlySrc1();
     ASSERT_TRUE(OS::FileExists(GetDexSrc2().c_str()))
       << "Expected dex file to be at: " << GetDexSrc2();
@@ -128,8 +129,17 @@
         << error_msg;
     ASSERT_GT(multi2.size(), 1u);
 
-    ASSERT_EQ(multi1[0]->GetLocationChecksum(), multi2[0]->GetLocationChecksum());
-    ASSERT_NE(multi1[1]->GetLocationChecksum(), multi2[1]->GetLocationChecksum());
+    ASSERT_EQ(multi1[0]->GetHeader().checksum_, multi2[0]->GetHeader().checksum_);
+    ASSERT_NE(multi1[1]->GetHeader().checksum_, multi2[1]->GetHeader().checksum_);
+
+    if (multi1[0]->HasDexContainer()) {
+      // Checksum is the CRC of the whole container, so both of them should differ.
+      ASSERT_NE(multi1[0]->GetLocationChecksum(), multi2[0]->GetLocationChecksum());
+      ASSERT_NE(multi1[1]->GetLocationChecksum(), multi2[1]->GetLocationChecksum());
+    } else {
+      ASSERT_EQ(multi1[0]->GetLocationChecksum(), multi2[0]->GetLocationChecksum());
+      ASSERT_NE(multi1[1]->GetLocationChecksum(), multi2[1]->GetLocationChecksum());
+    }
   }
 
   void SetUpRuntimeOptions(RuntimeOptions* options) override {
diff --git a/runtime/dex_reference_collection.h b/runtime/dex_reference_collection.h
index 047771f..d571cf0 100644
--- a/runtime/dex_reference_collection.h
+++ b/runtime/dex_reference_collection.h
@@ -22,7 +22,7 @@
 
 #include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class DexFile;
 
diff --git a/runtime/dex_register_location.cc b/runtime/dex_register_location.cc
index f3b0973..a425b68 100644
--- a/runtime/dex_register_location.cc
+++ b/runtime/dex_register_location.cc
@@ -16,7 +16,7 @@
 
 #include "dex_register_location.h"
 
-namespace art {
+namespace art HIDDEN {
 
 std::ostream& operator<<(std::ostream& stream, DexRegisterLocation::Kind kind) {
   return stream << "Kind<" <<  static_cast<int32_t>(kind) << ">";
diff --git a/runtime/dex_register_location.h b/runtime/dex_register_location.h
index 98b4d41..f33fd44 100644
--- a/runtime/dex_register_location.h
+++ b/runtime/dex_register_location.h
@@ -21,9 +21,10 @@
 #include <cstdint>
 
 #include "base/dchecked_vector.h"
+#include "base/macros.h"
 #include "base/memory_region.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Dex register location container used by DexRegisterMap and StackMapStream.
 class DexRegisterLocation {
@@ -85,7 +86,7 @@
   friend class DexRegisterMap;  // Allow creation of uninitialized array of locations.
 };
 
-std::ostream& operator<<(std::ostream& stream, DexRegisterLocation::Kind kind);
+EXPORT std::ostream& operator<<(std::ostream& stream, DexRegisterLocation::Kind kind);
 std::ostream& operator<<(std::ostream& stream, const DexRegisterLocation& reg);
 
 }  // namespace art
diff --git a/runtime/dexopt_test.cc b/runtime/dexopt_test.cc
index 3eee9e0..edb2882 100644
--- a/runtime/dexopt_test.cc
+++ b/runtime/dexopt_test.cc
@@ -34,11 +34,11 @@
 #include "dex2oat_environment_test.h"
 #include "gc/space/image_space.h"
 #include "hidden_api.h"
-#include "oat.h"
-#include "oat_file_assistant.h"
+#include "oat/oat.h"
+#include "oat/oat_file_assistant.h"
 #include "profile/profile_compilation_info.h"
 
-namespace art {
+namespace art HIDDEN {
 void DexoptTest::SetUp() {
   ReserveImageSpace();
   Dex2oatEnvironmentTest::SetUp();
diff --git a/runtime/dexopt_test.h b/runtime/dexopt_test.h
index a236393..cf32785 100644
--- a/runtime/dexopt_test.h
+++ b/runtime/dexopt_test.h
@@ -20,9 +20,10 @@
 #include <string>
 #include <vector>
 
+#include "base/macros.h"
 #include "dex2oat_environment_test.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class DexoptTest : public Dex2oatEnvironmentTest {
  public:
diff --git a/runtime/entrypoints/entrypoint_utils-inl.h b/runtime/entrypoints/entrypoint_utils-inl.h
index 4a1dfba..c87aa76 100644
--- a/runtime/entrypoints/entrypoint_utils-inl.h
+++ b/runtime/entrypoints/entrypoint_utils-inl.h
@@ -40,14 +40,14 @@
 #include "mirror/object-inl.h"
 #include "mirror/throwable.h"
 #include "nth_caller_visitor.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
+#include "oat/stack_map.h"
 #include "reflective_handle_scope-inl.h"
 #include "runtime.h"
-#include "stack_map.h"
 #include "thread.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 
 inline std::string GetResolvedMethodErrorString(ClassLinker* class_linker,
                                                 ArtMethod* inlined_method,
diff --git a/runtime/entrypoints/entrypoint_utils.cc b/runtime/entrypoints/entrypoint_utils.cc
index aa27df4..fb29a66 100644
--- a/runtime/entrypoints/entrypoint_utils.cc
+++ b/runtime/entrypoints/entrypoint_utils.cc
@@ -29,21 +29,20 @@
 #include "entrypoints/quick/callee_save_frame.h"
 #include "entrypoints/runtime_asm_entrypoints.h"
 #include "gc/accounting/card_table-inl.h"
-#include "index_bss_mapping.h"
 #include "jni/java_vm_ext.h"
 #include "mirror/class-inl.h"
 #include "mirror/method.h"
 #include "mirror/object-inl.h"
 #include "mirror/object_array-alloc-inl.h"
 #include "nth_caller_visitor.h"
-#include "oat_file.h"
-#include "oat_file-inl.h"
-#include "oat_quick_method_header.h"
+#include "oat/index_bss_mapping.h"
+#include "oat/oat_file-inl.h"
+#include "oat/oat_quick_method_header.h"
 #include "reflection.h"
 #include "scoped_thread_state_change-inl.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 void CheckReferenceResult(Handle<mirror::Object> o, Thread* self) {
   if (o == nullptr) {
diff --git a/runtime/entrypoints/entrypoint_utils.h b/runtime/entrypoints/entrypoint_utils.h
index cfa744d..3dfeaae 100644
--- a/runtime/entrypoints/entrypoint_utils.h
+++ b/runtime/entrypoints/entrypoint_utils.h
@@ -29,7 +29,7 @@
 #include "handle.h"
 #include "jvalue.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Array;
diff --git a/runtime/entrypoints/jni/jni_entrypoints.cc b/runtime/entrypoints/jni/jni_entrypoints.cc
index e606c21..6e6763b 100644
--- a/runtime/entrypoints/jni/jni_entrypoints.cc
+++ b/runtime/entrypoints/jni/jni_entrypoints.cc
@@ -19,6 +19,7 @@
 #include "arch/arm/jni_frame_arm.h"
 #include "arch/arm64/jni_frame_arm64.h"
 #include "arch/instruction_set.h"
+#include "arch/riscv64/jni_frame_riscv64.h"
 #include "arch/x86/jni_frame_x86.h"
 #include "arch/x86_64/jni_frame_x86_64.h"
 #include "art_method-inl.h"
@@ -27,12 +28,12 @@
 #include "entrypoints/entrypoint_utils-inl.h"
 #include "jni/java_vm_ext.h"
 #include "mirror/object-inl.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
+#include "oat/stack_map.h"
 #include "scoped_thread_state_change-inl.h"
-#include "stack_map.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static inline uint32_t GetInvokeStaticMethodIndex(ArtMethod* caller, uint32_t dex_pc)
     REQUIRES_SHARED(Locks::mutator_lock_) {
@@ -147,6 +148,8 @@
         return arm::GetCriticalNativeStubFrameSize(shorty, shorty_len);
       case InstructionSet::kArm64:
         return arm64::GetCriticalNativeStubFrameSize(shorty, shorty_len);
+      case InstructionSet::kRiscv64:
+        return riscv64::GetCriticalNativeStubFrameSize(shorty, shorty_len);
       case InstructionSet::kX86:
         return x86::GetCriticalNativeStubFrameSize(shorty, shorty_len);
       case InstructionSet::kX86_64:
@@ -183,6 +186,8 @@
         return arm::GetCriticalNativeDirectCallFrameSize(shorty, shorty_len);
       case InstructionSet::kArm64:
         return arm64::GetCriticalNativeDirectCallFrameSize(shorty, shorty_len);
+      case InstructionSet::kRiscv64:
+        return riscv64::GetCriticalNativeDirectCallFrameSize(shorty, shorty_len);
       case InstructionSet::kX86:
         return x86::GetCriticalNativeDirectCallFrameSize(shorty, shorty_len);
       case InstructionSet::kX86_64:
diff --git a/runtime/entrypoints/jni/jni_entrypoints.h b/runtime/entrypoints/jni/jni_entrypoints.h
index def9ddb..4b515db 100644
--- a/runtime/entrypoints/jni/jni_entrypoints.h
+++ b/runtime/entrypoints/jni/jni_entrypoints.h
@@ -25,7 +25,7 @@
 #define JNI_ENTRYPOINT_OFFSET(ptr_size, x) \
     Thread::JniEntryPointOffset<ptr_size>(OFFSETOF_MEMBER(JniEntryPoints, x))
 
-namespace art {
+namespace art HIDDEN {
 
 // Pointers to functions that are called by JNI trampolines via thread-local storage.
 struct JniEntryPoints {
diff --git a/runtime/entrypoints/math_entrypoints.cc b/runtime/entrypoints/math_entrypoints.cc
index b0eaf1e..5db8dbf 100644
--- a/runtime/entrypoints/math_entrypoints.cc
+++ b/runtime/entrypoints/math_entrypoints.cc
@@ -18,7 +18,7 @@
 
 #include "entrypoint_utils-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 extern "C" double art_l2d(int64_t l) {
   return static_cast<double>(l);
diff --git a/runtime/entrypoints/math_entrypoints_test.cc b/runtime/entrypoints/math_entrypoints_test.cc
index fe61f5d..337f9f0 100644
--- a/runtime/entrypoints/math_entrypoints_test.cc
+++ b/runtime/entrypoints/math_entrypoints_test.cc
@@ -20,7 +20,7 @@
 
 #include "base/common_art_test.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class MathEntrypointsTest : public CommonArtTest {};
 
diff --git a/runtime/entrypoints/quick/callee_save_frame.h b/runtime/entrypoints/quick/callee_save_frame.h
index 7d9b844..8121923 100644
--- a/runtime/entrypoints/quick/callee_save_frame.h
+++ b/runtime/entrypoints/quick/callee_save_frame.h
@@ -32,7 +32,7 @@
 #include "arch/x86/callee_save_frame_x86.h"
 #include "arch/x86_64/callee_save_frame_x86_64.h"
 
-namespace art {
+namespace art HIDDEN {
 class ArtMethod;
 
 class ScopedQuickEntrypointChecks {
diff --git a/runtime/entrypoints/quick/quick_alloc_entrypoints.cc b/runtime/entrypoints/quick/quick_alloc_entrypoints.cc
index 7b3d849..82595ed 100644
--- a/runtime/entrypoints/quick/quick_alloc_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_alloc_entrypoints.cc
@@ -27,7 +27,7 @@
 #include "mirror/object_array-inl.h"
 #include "mirror/string-alloc-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static constexpr bool kUseTlabFastPath = true;
 
diff --git a/runtime/entrypoints/quick/quick_alloc_entrypoints.h b/runtime/entrypoints/quick/quick_alloc_entrypoints.h
index c4d8a80..94f4a27 100644
--- a/runtime/entrypoints/quick/quick_alloc_entrypoints.h
+++ b/runtime/entrypoints/quick/quick_alloc_entrypoints.h
@@ -21,7 +21,7 @@
 #include "gc/allocator_type.h"
 #include "quick_entrypoints.h"
 
-namespace art {
+namespace art HIDDEN {
 
 void ResetQuickAllocEntryPoints(QuickEntryPoints* qpoints);
 
diff --git a/runtime/entrypoints/quick/quick_cast_entrypoints.cc b/runtime/entrypoints/quick/quick_cast_entrypoints.cc
index 083d578..a32c483 100644
--- a/runtime/entrypoints/quick/quick_cast_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_cast_entrypoints.cc
@@ -17,7 +17,7 @@
 #include "mirror/class-inl.h"
 #include "mirror/object-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Assignable test for code, won't throw.  Null and equality tests already performed
 extern "C" size_t artIsAssignableFromCode(mirror::Class* klass, mirror::Class* ref_class)
diff --git a/runtime/entrypoints/quick/quick_default_externs.h b/runtime/entrypoints/quick/quick_default_externs.h
index cb3caac..5119b27 100644
--- a/runtime/entrypoints/quick/quick_default_externs.h
+++ b/runtime/entrypoints/quick/quick_default_externs.h
@@ -19,7 +19,7 @@
 
 #include <cstdint>
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 class Array;
 class Class;
diff --git a/runtime/entrypoints/quick/quick_default_init_entrypoints.h b/runtime/entrypoints/quick/quick_default_init_entrypoints.h
index ea07788..46840e6 100644
--- a/runtime/entrypoints/quick/quick_default_init_entrypoints.h
+++ b/runtime/entrypoints/quick/quick_default_init_entrypoints.h
@@ -24,7 +24,7 @@
 #include "quick_default_externs.h"
 #include "quick_entrypoints.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static void DefaultInitEntryPoints(JniEntryPoints* jpoints,
                                    QuickEntryPoints* qpoints,
diff --git a/runtime/entrypoints/quick/quick_deoptimization_entrypoints.cc b/runtime/entrypoints/quick/quick_deoptimization_entrypoints.cc
index 277bc7b..2906045 100644
--- a/runtime/entrypoints/quick/quick_deoptimization_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_deoptimization_entrypoints.cc
@@ -23,7 +23,7 @@
 #include "runtime.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 NO_RETURN static void artDeoptimizeImpl(Thread* self,
                                         DeoptimizationKind kind,
diff --git a/runtime/entrypoints/quick/quick_dexcache_entrypoints.cc b/runtime/entrypoints/quick/quick_dexcache_entrypoints.cc
index 76bee21..32c709c 100644
--- a/runtime/entrypoints/quick/quick_dexcache_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_dexcache_entrypoints.cc
@@ -28,11 +28,11 @@
 #include "mirror/class_loader.h"
 #include "mirror/object-inl.h"
 #include "mirror/object_array-inl.h"
-#include "oat_file.h"
-#include "oat_file-inl.h"
+#include "oat/oat_file.h"
+#include "oat/oat_file-inl.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static void StoreObjectInBss(ArtMethod* outer_method,
                              const OatFile* oat_file,
@@ -162,13 +162,51 @@
   // Perform the update if we found a mapping.
   if (mapping != nullptr) {
     size_t bss_offset = IndexBssMappingLookup::GetBssOffset(
-        mapping, string_idx.index_, dex_file->NumStringIds(), sizeof(GcRoot<mirror::Class>));
+        mapping, string_idx.index_, dex_file->NumStringIds(), sizeof(GcRoot<mirror::String>));
     if (bss_offset != IndexBssMappingLookup::npos) {
       StoreObjectInBss(outer_method, outer_oat_file, bss_offset, resolved_string);
     }
   }
 }
 
+static inline void StoreMethodTypeInBss(ArtMethod* caller,
+                                        dex::ProtoIndex proto_idx,
+                                        ObjPtr<mirror::MethodType> resolved_method_type,
+                                        ArtMethod* outer_method)
+    REQUIRES_SHARED(Locks::mutator_lock_) {
+  const DexFile* dex_file = caller->GetDexFile();
+  DCHECK_NE(dex_file, nullptr);
+
+  if (outer_method->GetDexFile()->GetOatDexFile() == nullptr ||
+      outer_method->GetDexFile()->GetOatDexFile()->GetOatFile() == nullptr) {
+    // No OatFile to update.
+    return;
+  }
+  const OatFile* outer_oat_file = outer_method->GetDexFile()->GetOatDexFile()->GetOatFile();
+
+  const OatDexFile* oat_dex_file = dex_file->GetOatDexFile();
+  const IndexBssMapping* mapping = nullptr;
+  if (oat_dex_file != nullptr && oat_dex_file->GetOatFile() == outer_oat_file) {
+    // DexFiles compiled together to an oat file case.
+    mapping = oat_dex_file->GetMethodTypeBssMapping();
+  } else {
+    // Try to find the DexFile in the BCP of the outer_method.
+    const OatFile::BssMappingInfo* mapping_info = outer_oat_file->FindBcpMappingInfo(dex_file);
+    if (mapping_info != nullptr) {
+      mapping = mapping_info->method_type_bss_mapping;
+    }
+  }
+
+  // Perform the update if we found a mapping.
+  if (mapping != nullptr) {
+    size_t bss_offset = IndexBssMappingLookup::GetBssOffset(
+        mapping, proto_idx.index_, dex_file->NumProtoIds(), sizeof(GcRoot<mirror::MethodType>));
+    if (bss_offset != IndexBssMappingLookup::npos) {
+      StoreObjectInBss(outer_method, outer_oat_file, bss_offset, resolved_method_type);
+    }
+  }
+}
+
 extern "C" mirror::Class* artInitializeStaticStorageFromCode(mirror::Class* klass, Thread* self)
     REQUIRES_SHARED(Locks::mutator_lock_) {
   // Called to ensure static storage base is initialized for direct static field reads and writes.
@@ -243,6 +281,10 @@
                                                                   CalleeSaveType::kSaveEverything);
   ArtMethod* caller = caller_and_outer.caller;
   ObjPtr<mirror::MethodType> result = ResolveMethodTypeFromCode(caller, dex::ProtoIndex(proto_idx));
+  ArtMethod* outer_method = caller_and_outer.outer_method;
+  if (LIKELY(result != nullptr)) {
+    StoreMethodTypeInBss(caller, dex::ProtoIndex(proto_idx), result, outer_method);
+  }
   return result.Ptr();
 }
 
diff --git a/runtime/entrypoints/quick/quick_entrypoints.h b/runtime/entrypoints/quick/quick_entrypoints.h
index 0e73c63..fe01424 100644
--- a/runtime/entrypoints/quick/quick_entrypoints.h
+++ b/runtime/entrypoints/quick/quick_entrypoints.h
@@ -27,7 +27,7 @@
 #define QUICK_ENTRYPOINT_OFFSET(ptr_size, x) \
     Thread::QuickEntryPointOffset<ptr_size>(OFFSETOF_MEMBER(QuickEntryPoints, x))
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Array;
diff --git a/runtime/entrypoints/quick/quick_entrypoints_enum.cc b/runtime/entrypoints/quick/quick_entrypoints_enum.cc
index 5387e44..80d9313 100644
--- a/runtime/entrypoints/quick/quick_entrypoints_enum.cc
+++ b/runtime/entrypoints/quick/quick_entrypoints_enum.cc
@@ -16,7 +16,7 @@
 
 #include "quick_entrypoints_enum.h"
 
-namespace art {
+namespace art HIDDEN {
 
 bool EntrypointRequiresStackMap(QuickEntrypointEnum trampoline) {
   // Entrypoints that do not require a stackmap. In general leaf methods
diff --git a/runtime/entrypoints/quick/quick_entrypoints_enum.h b/runtime/entrypoints/quick/quick_entrypoints_enum.h
index 017cba6..c84ca20 100644
--- a/runtime/entrypoints/quick/quick_entrypoints_enum.h
+++ b/runtime/entrypoints/quick/quick_entrypoints_enum.h
@@ -20,7 +20,7 @@
 #include "quick_entrypoints.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Define an enum for the entrypoints. Names are prepended a 'kQuick'.
 enum QuickEntrypointEnum {  // NOLINT(whitespace/braces)
diff --git a/runtime/entrypoints/quick/quick_field_entrypoints.cc b/runtime/entrypoints/quick/quick_field_entrypoints.cc
index e2fc232..39b21ea 100644
--- a/runtime/entrypoints/quick/quick_field_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_field_entrypoints.cc
@@ -26,7 +26,7 @@
 #include "mirror/class-inl.h"
 #include "mirror/object_reference.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Fast path field resolution that can't initialize classes or throw exceptions.
 inline ArtField* FindFieldFast(uint32_t field_idx,
@@ -106,8 +106,8 @@
 //   art{Get,Set}<Kind>{Static,Instance}FromCode
 //   art{Get,Set}<Kind>{Static,Instance}FromCompiledCode
 //
-#define ART_GET_FIELD_FROM_CODE(Kind, PrimitiveType, RetType, SetType,         \
-                                PrimitiveOrObject, IsObject, Ptr)              \
+#define ART_GET_FIELD_FROM_CODE(Kind, RetType, SetType, PrimitiveOrObject,     \
+                                IsObject, Ptr)                                 \
   extern "C" RetType artGet ## Kind ## StaticFromCode(uint32_t field_idx,      \
                                                       ArtMethod* referrer,     \
                                                       Thread* self)            \
@@ -264,7 +264,7 @@
 //   artSetByteStaticFromCompiledCode
 //   artSetByteInstanceFromCompiledCode
 //
-ART_GET_FIELD_FROM_CODE(Byte, int8_t, ssize_t, uint32_t, Primitive, false, )
+ART_GET_FIELD_FROM_CODE(Byte, ssize_t, uint32_t, Primitive, false, )
 
 // Define these functions:
 //
@@ -277,7 +277,7 @@
 //   artSetBooleanStaticFromCompiledCode
 //   artSetBooleanInstanceFromCompiledCode
 //
-ART_GET_FIELD_FROM_CODE(Boolean, int8_t, size_t, uint32_t, Primitive, false, )
+ART_GET_FIELD_FROM_CODE(Boolean, size_t, uint32_t, Primitive, false, )
 
 // Define these functions:
 //
@@ -290,7 +290,7 @@
 //   artSetShortStaticFromCompiledCode
 //   artSetShortInstanceFromCompiledCode
 //
-ART_GET_FIELD_FROM_CODE(Short, int16_t, ssize_t, uint16_t, Primitive, false, )
+ART_GET_FIELD_FROM_CODE(Short, ssize_t, uint16_t, Primitive, false, )
 
 // Define these functions:
 //
@@ -303,7 +303,7 @@
 //   artSetCharStaticFromCompiledCode
 //   artSetCharInstanceFromCompiledCode
 //
-ART_GET_FIELD_FROM_CODE(Char, int16_t, size_t, uint16_t, Primitive, false, )
+ART_GET_FIELD_FROM_CODE(Char, size_t, uint16_t, Primitive, false, )
 
 // Define these functions:
 //
@@ -316,7 +316,18 @@
 //   artSet32StaticFromCompiledCode
 //   artSet32InstanceFromCompiledCode
 //
-ART_GET_FIELD_FROM_CODE(32, int32_t, size_t, uint32_t, Primitive, false, )
+#if defined(__riscv)
+// On riscv64 we need to sign-extend `int` values to the full 64-bit register.
+// `ArtField::Get32()` returns a `uint32_t`, so let the getters return the same,
+// allowing the sign-extension specified by the RISC-V native calling convention:
+//     "[I]nteger scalars narrower than XLEN bits are widened according to the
+//     sign of their type up to 32 bits, then sign-extended to XLEN bits."
+// This is OK for `float` as the compiled code shall transfer it using FMV.W.X,
+// ignoring the upper 32 bits.
+ART_GET_FIELD_FROM_CODE(32, uint32_t, uint32_t, Primitive, false, )
+#else
+ART_GET_FIELD_FROM_CODE(32, size_t, uint32_t, Primitive, false, )
+#endif
 
 // Define these functions:
 //
@@ -329,7 +340,7 @@
 //   artSet64StaticFromCompiledCode
 //   artSet64InstanceFromCompiledCode
 //
-ART_GET_FIELD_FROM_CODE(64, int64_t, uint64_t, uint64_t, Primitive, false, )
+ART_GET_FIELD_FROM_CODE(64, uint64_t, uint64_t, Primitive, false, )
 
 // Define these functions:
 //
@@ -342,8 +353,7 @@
 //   artSetObjStaticFromCompiledCode
 //   artSetObjInstanceFromCompiledCode
 //
-ART_GET_FIELD_FROM_CODE(Obj, mirror::HeapReference<mirror::Object>, mirror::Object*,
-                        mirror::Object*, Object, true, .Ptr())
+ART_GET_FIELD_FROM_CODE(Obj, mirror::Object*, mirror::Object*, Object, true, .Ptr())
 
 #undef ART_GET_FIELD_FROM_CODE
 
@@ -420,7 +430,7 @@
   return ReadBarrier::Mark(obj);
 }
 
-extern "C" mirror::Object* artReadBarrierSlow(mirror::Object* ref ATTRIBUTE_UNUSED,
+extern "C" mirror::Object* artReadBarrierSlow([[maybe_unused]] mirror::Object* ref,
                                               mirror::Object* obj,
                                               uint32_t offset) {
   // Used only in connection with non-volatile loads.
diff --git a/runtime/entrypoints/quick/quick_fillarray_entrypoints.cc b/runtime/entrypoints/quick/quick_fillarray_entrypoints.cc
index 5b7fe0c..b87d815 100644
--- a/runtime/entrypoints/quick/quick_fillarray_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_fillarray_entrypoints.cc
@@ -19,7 +19,7 @@
 #include "entrypoints/entrypoint_utils.h"
 #include "mirror/array.h"
 
-namespace art {
+namespace art HIDDEN {
 
 /*
  * Handle fill array data by copying appropriate part of dex file into array.
diff --git a/runtime/entrypoints/quick/quick_jni_entrypoints.cc b/runtime/entrypoints/quick/quick_jni_entrypoints.cc
index 6f69001..3c1dbff 100644
--- a/runtime/entrypoints/quick/quick_jni_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_jni_entrypoints.cc
@@ -36,7 +36,7 @@
     }                                                    \
   }
 
-namespace art {
+namespace art HIDDEN {
 
 extern "C" int artMethodExitHook(Thread* self,
                                  ArtMethod* method,
@@ -81,13 +81,14 @@
   if (UNLIKELY(env->IsCheckJniEnabled())) {
     env->CheckNoHeldMonitors();
   }
-  env->SetLocalSegmentState(env->GetLocalRefCookie());
-  env->SetLocalRefCookie(bit_cast<jni::LRTSegmentState>(saved_local_ref_cookie));
+  env->PopLocalReferenceFrame(bit_cast<jni::LRTSegmentState>(saved_local_ref_cookie));
 }
 
 // TODO: annotalysis disabled as monitor semantics are maintained in Java code.
-extern "C" void artJniUnlockObject(mirror::Object* locked, Thread* self)
-    NO_THREAD_SAFETY_ANALYSIS REQUIRES(!Roles::uninterruptible_) {
+__attribute__((no_sanitize("memtag")))  // TODO(b/305919664)
+extern "C" void
+artJniUnlockObject(mirror::Object* locked, Thread* self) NO_THREAD_SAFETY_ANALYSIS
+    REQUIRES(!Roles::uninterruptible_) {
   // Note: No thread suspension is allowed for successful unlocking, otherwise plain
   // `mirror::Object*` return value saved by the assembly stub would need to be updated.
   uintptr_t old_poison_object_cookie = kIsDebugBuild ? self->GetPoisonObjectCookie() : 0u;
diff --git a/runtime/entrypoints/quick/quick_lock_entrypoints.cc b/runtime/entrypoints/quick/quick_lock_entrypoints.cc
index 87286cf..402f8f6 100644
--- a/runtime/entrypoints/quick/quick_lock_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_lock_entrypoints.cc
@@ -18,7 +18,7 @@
 #include "common_throws.h"
 #include "mirror/object-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 extern "C" int artLockObjectFromCode(mirror::Object* obj, Thread* self)
     NO_THREAD_SAFETY_ANALYSIS
diff --git a/runtime/entrypoints/quick/quick_math_entrypoints.cc b/runtime/entrypoints/quick/quick_math_entrypoints.cc
index 51d2784..e318a46 100644
--- a/runtime/entrypoints/quick/quick_math_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_math_entrypoints.cc
@@ -16,7 +16,9 @@
 
 #include <stdint.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wfloat-equal"
diff --git a/runtime/entrypoints/quick/quick_string_builder_append_entrypoints.cc b/runtime/entrypoints/quick/quick_string_builder_append_entrypoints.cc
index 9afaf43..9e5fe1c 100644
--- a/runtime/entrypoints/quick/quick_string_builder_append_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_string_builder_append_entrypoints.cc
@@ -19,7 +19,7 @@
 #include "string_builder_append.h"
 #include "obj_ptr-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 extern "C" mirror::String* artStringBuilderAppend(uint32_t format,
                                                   const uint32_t* args,
diff --git a/runtime/entrypoints/quick/quick_thread_entrypoints.cc b/runtime/entrypoints/quick/quick_thread_entrypoints.cc
index 5dca58a..53e14d0 100644
--- a/runtime/entrypoints/quick/quick_thread_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_thread_entrypoints.cc
@@ -19,7 +19,7 @@
 #include "runtime.h"
 #include "thread-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 extern "C" void artDeoptimizeIfNeeded(Thread* self, uintptr_t result, bool is_ref)
     REQUIRES_SHARED(Locks::mutator_lock_) {
diff --git a/runtime/entrypoints/quick/quick_throw_entrypoints.cc b/runtime/entrypoints/quick/quick_throw_entrypoints.cc
index 202b031..781f3e5 100644
--- a/runtime/entrypoints/quick/quick_throw_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_throw_entrypoints.cc
@@ -24,7 +24,7 @@
 #include "thread.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Deliver an exception that's pending on thread helping set up a callee save frame on the way.
 extern "C" NO_RETURN void artDeliverPendingExceptionFromCode(Thread* self)
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
index 7e96f29..cf09256 100644
--- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
@@ -47,9 +47,9 @@
 #include "mirror/object-inl.h"
 #include "mirror/object_array-inl.h"
 #include "mirror/var_handle.h"
-#include "oat.h"
-#include "oat_file.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat.h"
+#include "oat/oat_file.h"
+#include "oat/oat_quick_method_header.h"
 #include "quick_exception_handler.h"
 #include "runtime.h"
 #include "scoped_thread_state_change-inl.h"
@@ -58,7 +58,7 @@
 #include "var_handles.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 
 extern "C" NO_RETURN void artDeoptimizeFromCompiledCode(DeoptimizationKind kind, Thread* self);
 extern "C" NO_RETURN void artDeoptimize(Thread* self, bool skip_method_exit_callbacks);
@@ -106,6 +106,7 @@
   static constexpr size_t kNumQuickGprArgs = 3;
   static constexpr size_t kNumQuickFprArgs = 16;
   static constexpr bool kGprFprLockstep = false;
+  static constexpr bool kNaNBoxing = false;
   static size_t GprIndexToGprOffset(uint32_t gpr_index) {
     return gpr_index * GetBytesPerGprSpillLocation(kRuntimeISA);
   }
@@ -138,6 +139,7 @@
   static constexpr size_t kNumQuickGprArgs = 7;  // 7 arguments passed in GPRs.
   static constexpr size_t kNumQuickFprArgs = 8;  // 8 arguments passed in FPRs.
   static constexpr bool kGprFprLockstep = false;
+  static constexpr bool kNaNBoxing = false;
   static size_t GprIndexToGprOffset(uint32_t gpr_index) {
     return gpr_index * GetBytesPerGprSpillLocation(kRuntimeISA);
   }
@@ -183,6 +185,7 @@
   static constexpr size_t kNumQuickGprArgs = 7;
   static constexpr size_t kNumQuickFprArgs = 8;
   static constexpr bool kGprFprLockstep = false;
+  static constexpr bool kNaNBoxing = true;
   static size_t GprIndexToGprOffset(uint32_t gpr_index) {
     return (gpr_index + 1) * GetBytesPerGprSpillLocation(kRuntimeISA);  // skip S0/X8/FP
   }
@@ -213,6 +216,7 @@
   static constexpr size_t kNumQuickGprArgs = 3;  // 3 arguments passed in GPRs.
   static constexpr size_t kNumQuickFprArgs = 4;  // 4 arguments passed in FPRs.
   static constexpr bool kGprFprLockstep = false;
+  static constexpr bool kNaNBoxing = false;
   static size_t GprIndexToGprOffset(uint32_t gpr_index) {
     return gpr_index * GetBytesPerGprSpillLocation(kRuntimeISA);
   }
@@ -252,6 +256,7 @@
   static constexpr size_t kNumQuickGprArgs = 5;  // 5 arguments passed in GPRs.
   static constexpr size_t kNumQuickFprArgs = 8;  // 8 arguments passed in FPRs.
   static constexpr bool kGprFprLockstep = false;
+  static constexpr bool kNaNBoxing = false;
   static size_t GprIndexToGprOffset(uint32_t gpr_index) {
     switch (gpr_index) {
       case 0: return (4 * GetBytesPerGprSpillLocation(kRuntimeISA));
@@ -269,6 +274,8 @@
 #endif
 
  public:
+  static constexpr bool NaNBoxing() { return kNaNBoxing; }
+
   static StackReference<mirror::Object>* GetThisObjectReference(ArtMethod** sp)
       REQUIRES_SHARED(Locks::mutator_lock_) {
     CHECK_GT(kNumQuickGprArgs, 0u);
@@ -309,15 +316,20 @@
     return *reinterpret_cast<uintptr_t*>(GetCallingPcAddr(sp));
   }
 
-  QuickArgumentVisitor(ArtMethod** sp, bool is_static, const char* shorty,
-                       uint32_t shorty_len) REQUIRES_SHARED(Locks::mutator_lock_) :
-          is_static_(is_static), shorty_(shorty), shorty_len_(shorty_len),
-          gpr_args_(reinterpret_cast<uint8_t*>(sp) + kQuickCalleeSaveFrame_RefAndArgs_Gpr1Offset),
-          fpr_args_(reinterpret_cast<uint8_t*>(sp) + kQuickCalleeSaveFrame_RefAndArgs_Fpr1Offset),
-          stack_args_(reinterpret_cast<uint8_t*>(sp) + kQuickCalleeSaveFrame_RefAndArgs_FrameSize
-              + sizeof(ArtMethod*)),  // Skip ArtMethod*.
-          gpr_index_(0), fpr_index_(0), fpr_double_index_(0), stack_index_(0),
-          cur_type_(Primitive::kPrimVoid), is_split_long_or_double_(false) {
+  QuickArgumentVisitor(ArtMethod** sp, bool is_static, std::string_view shorty)
+      REQUIRES_SHARED(Locks::mutator_lock_)
+      : is_static_(is_static),
+        shorty_(shorty),
+        gpr_args_(reinterpret_cast<uint8_t*>(sp) + kQuickCalleeSaveFrame_RefAndArgs_Gpr1Offset),
+        fpr_args_(reinterpret_cast<uint8_t*>(sp) + kQuickCalleeSaveFrame_RefAndArgs_Fpr1Offset),
+        stack_args_(reinterpret_cast<uint8_t*>(sp) + kQuickCalleeSaveFrame_RefAndArgs_FrameSize +
+            sizeof(ArtMethod*)),  // Skip ArtMethod*.
+        gpr_index_(0),
+        fpr_index_(0),
+        fpr_double_index_(0),
+        stack_index_(0),
+        cur_type_(Primitive::kPrimVoid),
+        is_split_long_or_double_(false) {
     static_assert(kQuickSoftFloatAbi == (kNumQuickFprArgs == 0),
                   "Number of Quick FPR arguments unexpected");
     static_assert(!(kQuickSoftFloatAbi && kQuickDoubleRegAlignedFloatBackFilled),
@@ -414,8 +426,8 @@
         IncGprIndex();
       }
     }
-    for (uint32_t shorty_index = 1; shorty_index < shorty_len_; ++shorty_index) {
-      cur_type_ = Primitive::GetType(shorty_[shorty_index]);
+    for (char c : shorty_.substr(1u)) {
+      cur_type_ = Primitive::GetType(c);
       switch (cur_type_) {
         case Primitive::kPrimNot:
         case Primitive::kPrimBoolean:
@@ -523,8 +535,7 @@
 
  protected:
   const bool is_static_;
-  const char* const shorty_;
-  const uint32_t shorty_len_;
+  const std::string_view shorty_;
 
  private:
   uint8_t* const gpr_args_;  // Address of GPR arguments in callee save frame.
@@ -557,9 +568,12 @@
 // Visits arguments on the stack placing them into the shadow frame.
 class BuildQuickShadowFrameVisitor final : public QuickArgumentVisitor {
  public:
-  BuildQuickShadowFrameVisitor(ArtMethod** sp, bool is_static, const char* shorty,
-                               uint32_t shorty_len, ShadowFrame* sf, size_t first_arg_reg) :
-      QuickArgumentVisitor(sp, is_static, shorty, shorty_len), sf_(sf), cur_reg_(first_arg_reg) {}
+  BuildQuickShadowFrameVisitor(ArtMethod** sp,
+                               bool is_static,
+                               std::string_view shorty,
+                               ShadowFrame* sf,
+                               size_t first_arg_reg)
+      : QuickArgumentVisitor(sp, is_static, shorty), sf_(sf), cur_reg_(first_arg_reg) {}
 
   void Visit() REQUIRES_SHARED(Locks::mutator_lock_) override;
 
@@ -669,6 +683,12 @@
                                               method_type);
 }
 
+static int64_t NanBoxResultIfNeeded(int64_t result, char result_shorty) {
+  return (QuickArgumentVisitor::NaNBoxing() && result_shorty == 'F')
+      ? result | UINT64_C(0xffffffff00000000)
+      : result;
+}
+
 NO_STACK_PROTECTOR
 extern "C" uint64_t artQuickToInterpreterBridge(ArtMethod* method, Thread* self, ArtMethod** sp)
     REQUIRES_SHARED(Locks::mutator_lock_) {
@@ -690,8 +710,7 @@
 
   ArtMethod* non_proxy_method = method->GetInterfaceMethodIfProxy(kRuntimePointerSize);
   DCHECK(non_proxy_method->GetCodeItem() != nullptr) << method->PrettyMethod();
-  uint32_t shorty_len = 0;
-  const char* shorty = non_proxy_method->GetShorty(&shorty_len);
+  std::string_view shorty = non_proxy_method->GetShortyView();
 
   ManagedStack fragment;
   ShadowFrame* deopt_frame = self->MaybePopDeoptimizedStackedShadowFrame();
@@ -707,8 +726,8 @@
         CREATE_SHADOW_FRAME(num_regs, method, /* dex_pc= */ 0);
     ShadowFrame* shadow_frame = shadow_frame_unique_ptr.get();
     size_t first_arg_reg = accessor.RegistersSize() - accessor.InsSize();
-    BuildQuickShadowFrameVisitor shadow_frame_builder(sp, method->IsStatic(), shorty, shorty_len,
-                                                      shadow_frame, first_arg_reg);
+    BuildQuickShadowFrameVisitor shadow_frame_builder(
+        sp, method->IsStatic(), shorty, shadow_frame, first_arg_reg);
     shadow_frame_builder.VisitArguments();
     self->EndAssertNoThreadSuspension(old_cause);
 
@@ -739,7 +758,7 @@
     // Push the context of the deoptimization stack so we can restore the return value and the
     // exception before executing the deoptimized frames.
     self->PushDeoptimizationContext(result,
-                                    shorty[0] == 'L' || shorty[0] == '[', /* class or array */
+                                    shorty[0] == 'L' || shorty[0] == '[',  // class or array
                                     self->GetException(),
                                     /* from_code= */ false,
                                     DeoptimizationMethodType::kDefault);
@@ -749,16 +768,19 @@
   }
 
   // No need to restore the args since the method has already been run by the interpreter.
-  return result.GetJ();
+  return NanBoxResultIfNeeded(result.GetJ(), shorty[0]);
 }
 
 // Visits arguments on the stack placing them into the args vector, Object* arguments are converted
 // to jobjects.
 class BuildQuickArgumentVisitor final : public QuickArgumentVisitor {
  public:
-  BuildQuickArgumentVisitor(ArtMethod** sp, bool is_static, const char* shorty, uint32_t shorty_len,
-                            ScopedObjectAccessUnchecked* soa, std::vector<jvalue>* args) :
-      QuickArgumentVisitor(sp, is_static, shorty, shorty_len), soa_(soa), args_(args) {}
+  BuildQuickArgumentVisitor(ArtMethod** sp,
+                            bool is_static,
+                            std::string_view shorty,
+                            ScopedObjectAccessUnchecked* soa,
+                            std::vector<jvalue>* args)
+      : QuickArgumentVisitor(sp, is_static, shorty), soa_(soa), args_(args) {}
 
   void Visit() REQUIRES_SHARED(Locks::mutator_lock_) override;
 
@@ -830,9 +852,9 @@
                                        << non_proxy_method->PrettyMethod();
   std::vector<jvalue> args;
   uint32_t shorty_len = 0;
-  const char* shorty = non_proxy_method->GetShorty(&shorty_len);
-  BuildQuickArgumentVisitor local_ref_visitor(
-      sp, /* is_static= */ false, shorty, shorty_len, &soa, &args);
+  const char* raw_shorty = non_proxy_method->GetShorty(&shorty_len);
+  std::string_view shorty(raw_shorty, shorty_len);
+  BuildQuickArgumentVisitor local_ref_visitor(sp, /* is_static= */ false, shorty, &soa, &args);
 
   local_ref_visitor.VisitArguments();
   DCHECK_GT(args.size(), 0U) << proxy_method->PrettyMethod();
@@ -865,7 +887,8 @@
       return 0;
     }
   }
-  JValue result = InvokeProxyInvocationHandler(soa, shorty, rcvr_jobj, interface_method_jobj, args);
+  JValue result =
+      InvokeProxyInvocationHandler(soa, raw_shorty, rcvr_jobj, interface_method_jobj, args);
   if (soa.Self()->IsExceptionPending()) {
     if (instr->HasMethodUnwindListeners()) {
       instr->MethodUnwindEvent(self,
@@ -878,23 +901,21 @@
                            {},
                            result);
   }
-  return result.GetJ();
+
+  return NanBoxResultIfNeeded(result.GetJ(), shorty[0]);
 }
 
 // Visitor returning a reference argument at a given position in a Quick stack frame.
 // NOTE: Only used for testing purposes.
 class GetQuickReferenceArgumentAtVisitor final : public QuickArgumentVisitor {
  public:
-  GetQuickReferenceArgumentAtVisitor(ArtMethod** sp,
-                                     const char* shorty,
-                                     uint32_t shorty_len,
-                                     size_t arg_pos)
-      : QuickArgumentVisitor(sp, /* is_static= */ false, shorty, shorty_len),
+  GetQuickReferenceArgumentAtVisitor(ArtMethod** sp, std::string_view shorty, size_t arg_pos)
+      : QuickArgumentVisitor(sp, /* is_static= */ false, shorty),
         cur_pos_(0u),
         arg_pos_(arg_pos),
         ref_arg_(nullptr) {
-          CHECK_LT(arg_pos, shorty_len) << "Argument position greater than the number arguments";
-        }
+    CHECK_LT(arg_pos, shorty.length()) << "Argument position greater than the number arguments";
+  }
 
   void Visit() REQUIRES_SHARED(Locks::mutator_lock_) override {
     if (cur_pos_ == arg_pos_) {
@@ -922,16 +943,14 @@
 
 // Returning reference argument at position `arg_pos` in Quick stack frame at address `sp`.
 // NOTE: Only used for testing purposes.
-extern "C" StackReference<mirror::Object>* artQuickGetProxyReferenceArgumentAt(size_t arg_pos,
-                                                                               ArtMethod** sp)
-    REQUIRES_SHARED(Locks::mutator_lock_) {
+EXPORT extern "C" StackReference<mirror::Object>* artQuickGetProxyReferenceArgumentAt(
+    size_t arg_pos, ArtMethod** sp) REQUIRES_SHARED(Locks::mutator_lock_) {
   ArtMethod* proxy_method = *sp;
   ArtMethod* non_proxy_method = proxy_method->GetInterfaceMethodIfProxy(kRuntimePointerSize);
   CHECK(!non_proxy_method->IsStatic())
       << proxy_method->PrettyMethod() << " " << non_proxy_method->PrettyMethod();
-  uint32_t shorty_len = 0;
-  const char* shorty = non_proxy_method->GetShorty(&shorty_len);
-  GetQuickReferenceArgumentAtVisitor ref_arg_visitor(sp, shorty, shorty_len, arg_pos);
+  std::string_view shorty = non_proxy_method->GetShortyView();
+  GetQuickReferenceArgumentAtVisitor ref_arg_visitor(sp, shorty, arg_pos);
   ref_arg_visitor.VisitArguments();
   StackReference<mirror::Object>* ref_arg = ref_arg_visitor.GetReferenceArgument();
   return ref_arg;
@@ -940,11 +959,8 @@
 // Visitor returning all the reference arguments in a Quick stack frame.
 class GetQuickReferenceArgumentsVisitor final : public QuickArgumentVisitor {
  public:
-  GetQuickReferenceArgumentsVisitor(ArtMethod** sp,
-                                    bool is_static,
-                                    const char* shorty,
-                                    uint32_t shorty_len)
-      : QuickArgumentVisitor(sp, is_static, shorty, shorty_len) {}
+  GetQuickReferenceArgumentsVisitor(ArtMethod** sp, bool is_static, std::string_view shorty)
+      : QuickArgumentVisitor(sp, is_static, shorty) {}
 
   void Visit() REQUIRES_SHARED(Locks::mutator_lock_) override {
     Primitive::Type type = GetParamPrimitiveType();
@@ -973,9 +989,8 @@
   ArtMethod* non_proxy_method = proxy_method->GetInterfaceMethodIfProxy(kRuntimePointerSize);
   CHECK(!non_proxy_method->IsStatic())
       << proxy_method->PrettyMethod() << " " << non_proxy_method->PrettyMethod();
-  uint32_t shorty_len = 0;
-  const char* shorty = non_proxy_method->GetShorty(&shorty_len);
-  GetQuickReferenceArgumentsVisitor ref_args_visitor(sp, /*is_static=*/ false, shorty, shorty_len);
+  std::string_view shorty = non_proxy_method->GetShortyView();
+  GetQuickReferenceArgumentsVisitor ref_args_visitor(sp, /*is_static=*/ false, shorty);
   ref_args_visitor.VisitArguments();
   std::vector<StackReference<mirror::Object>*> ref_args = ref_args_visitor.GetReferenceArguments();
   return ref_args;
@@ -985,9 +1000,11 @@
 // so they don't get garbage collected.
 class RememberForGcArgumentVisitor final : public QuickArgumentVisitor {
  public:
-  RememberForGcArgumentVisitor(ArtMethod** sp, bool is_static, const char* shorty,
-                               uint32_t shorty_len, ScopedObjectAccessUnchecked* soa) :
-      QuickArgumentVisitor(sp, is_static, shorty, shorty_len), soa_(soa) {}
+  RememberForGcArgumentVisitor(ArtMethod** sp,
+                               bool is_static,
+                               std::string_view shorty,
+                               ScopedObjectAccessUnchecked* soa)
+      : QuickArgumentVisitor(sp, is_static, shorty), soa_(soa) {}
 
   void Visit() REQUIRES_SHARED(Locks::mutator_lock_) override;
 
@@ -1200,10 +1217,9 @@
     called_method.dex_file = called->GetDexFile();
     called_method.index = called->GetDexMethodIndex();
   }
-  uint32_t shorty_len;
-  const char* shorty =
-      called_method.dex_file->GetMethodShorty(called_method.GetMethodId(), &shorty_len);
-  RememberForGcArgumentVisitor visitor(sp, invoke_type == kStatic, shorty, shorty_len, &soa);
+  std::string_view shorty =
+      called_method.dex_file->GetMethodShortyView(called_method.GetMethodId());
+  RememberForGcArgumentVisitor visitor(sp, invoke_type == kStatic, shorty, &soa);
   visitor.VisitArguments();
   self->EndAssertNoThreadSuspension(old_cause);
   const bool virtual_or_interface = invoke_type == kVirtual || invoke_type == kInterface;
@@ -1339,8 +1355,10 @@
  */
 template<class T> class BuildNativeCallFrameStateMachine {
  public:
+  static constexpr bool kNaNBoxing = QuickArgumentVisitor::NaNBoxing();
 #if defined(__arm__)
   static constexpr bool kNativeSoftFloatAbi = true;
+  static constexpr bool kNativeSoftFloatAfterHardFloat = false;
   static constexpr size_t kNumNativeGprArgs = 4;  // 4 arguments passed in GPRs, r0-r3
   static constexpr size_t kNumNativeFprArgs = 0;  // 0 arguments passed in FPRs.
 
@@ -1350,9 +1368,9 @@
   static constexpr bool kMultiGPRegistersWidened = false;
   static constexpr bool kAlignLongOnStack = true;
   static constexpr bool kAlignDoubleOnStack = true;
-  static constexpr bool kNaNBoxing = false;
 #elif defined(__aarch64__)
   static constexpr bool kNativeSoftFloatAbi = false;  // This is a hard float ABI.
+  static constexpr bool kNativeSoftFloatAfterHardFloat = false;
   static constexpr size_t kNumNativeGprArgs = 8;  // 8 arguments passed in GPRs.
   static constexpr size_t kNumNativeFprArgs = 8;  // 8 arguments passed in FPRs.
 
@@ -1362,9 +1380,9 @@
   static constexpr bool kMultiGPRegistersWidened = false;
   static constexpr bool kAlignLongOnStack = false;
   static constexpr bool kAlignDoubleOnStack = false;
-  static constexpr bool kNaNBoxing = false;
 #elif defined(__riscv)
   static constexpr bool kNativeSoftFloatAbi = false;
+  static constexpr bool kNativeSoftFloatAfterHardFloat = true;
   static constexpr size_t kNumNativeGprArgs = 8;
   static constexpr size_t kNumNativeFprArgs = 8;
 
@@ -1374,9 +1392,9 @@
   static constexpr bool kMultiGPRegistersWidened = true;
   static constexpr bool kAlignLongOnStack = false;
   static constexpr bool kAlignDoubleOnStack = false;
-  static constexpr bool kNaNBoxing = true;
 #elif defined(__i386__)
   static constexpr bool kNativeSoftFloatAbi = false;  // Not using int registers for fp
+  static constexpr bool kNativeSoftFloatAfterHardFloat = false;
   static constexpr size_t kNumNativeGprArgs = 0;  // 0 arguments passed in GPRs.
   static constexpr size_t kNumNativeFprArgs = 0;  // 0 arguments passed in FPRs.
 
@@ -1386,9 +1404,9 @@
   static constexpr bool kMultiGPRegistersWidened = false;
   static constexpr bool kAlignLongOnStack = false;
   static constexpr bool kAlignDoubleOnStack = false;
-  static constexpr bool kNaNBoxing = false;
 #elif defined(__x86_64__)
   static constexpr bool kNativeSoftFloatAbi = false;  // This is a hard float ABI.
+  static constexpr bool kNativeSoftFloatAfterHardFloat = false;
   static constexpr size_t kNumNativeGprArgs = 6;  // 6 arguments passed in GPRs.
   static constexpr size_t kNumNativeFprArgs = 8;  // 8 arguments passed in FPRs.
 
@@ -1398,7 +1416,6 @@
   static constexpr bool kMultiGPRegistersWidened = false;
   static constexpr bool kAlignLongOnStack = false;
   static constexpr bool kAlignDoubleOnStack = false;
-  static constexpr bool kNaNBoxing = false;
 #else
 #error "Unsupported architecture"
 #endif
@@ -1507,29 +1524,30 @@
     return fpr_index_ > 0;
   }
 
-  void AdvanceFloat(float val) {
+  void AdvanceFloat(uint32_t val) {
     if (kNativeSoftFloatAbi) {
-      AdvanceInt(bit_cast<uint32_t, float>(val));
-    } else {
-      if (HaveFloatFpr()) {
-        fpr_index_--;
-        if (kRegistersNeededForDouble == 1) {
-          if (kNaNBoxing) {
-            // NaN boxing: no widening, just use the bits, but reset upper bits to 1s.
-            // See e.g. RISC-V manual, D extension, section "NaN Boxing of Narrower Values".
-            PushFpr8(0xFFFFFFFF00000000lu | static_cast<uint64_t>(bit_cast<uint32_t, float>(val)));
-          } else {
-            // No widening, just use the bits.
-            PushFpr8(static_cast<uint64_t>(bit_cast<uint32_t, float>(val)));
-          }
+      AdvanceInt(val);
+    } else if (HaveFloatFpr()) {
+      fpr_index_--;
+      if (kRegistersNeededForDouble == 1) {
+        if (kNaNBoxing) {
+          // NaN boxing: no widening, just use the bits, but reset upper bits to 1s.
+          // See e.g. RISC-V manual, D extension, section "NaN Boxing of Narrower Values".
+          PushFpr8(UINT64_C(0xFFFFFFFF00000000) | static_cast<uint64_t>(val));
         } else {
-          PushFpr4(val);
+          // No widening, just use the bits.
+          PushFpr8(static_cast<uint64_t>(val));
         }
       } else {
-        stack_entries_++;
-        PushStack(static_cast<uintptr_t>(bit_cast<uint32_t, float>(val)));
-        fpr_index_ = 0;
+        PushFpr4(val);
       }
+    } else if (kNativeSoftFloatAfterHardFloat) {
+      // After using FP arg registers, pass FP args in general purpose registers or on the stack.
+      AdvanceInt(val);
+    } else {
+      stack_entries_++;
+      PushStack(static_cast<uintptr_t>(val));
+      fpr_index_ = 0;
     }
   }
 
@@ -1552,29 +1570,30 @@
   void AdvanceDouble(uint64_t val) {
     if (kNativeSoftFloatAbi) {
       AdvanceLong(val);
-    } else {
-      if (HaveDoubleFpr()) {
-        if (DoubleFprNeedsPadding()) {
-          PushFpr4(0);
-          fpr_index_--;
-        }
-        PushFpr8(val);
-        fpr_index_ -= kRegistersNeededForDouble;
-      } else {
-        if (DoubleStackNeedsPadding()) {
-          PushStack(0);
-          stack_entries_++;
-        }
-        if (kRegistersNeededForDouble == 1) {
-          PushStack(static_cast<uintptr_t>(val));
-          stack_entries_++;
-        } else {
-          PushStack(static_cast<uintptr_t>(val & 0xFFFFFFFF));
-          PushStack(static_cast<uintptr_t>((val >> 32) & 0xFFFFFFFF));
-          stack_entries_ += 2;
-        }
-        fpr_index_ = 0;
+    } else if (HaveDoubleFpr()) {
+      if (DoubleFprNeedsPadding()) {
+        PushFpr4(0);
+        fpr_index_--;
       }
+      PushFpr8(val);
+      fpr_index_ -= kRegistersNeededForDouble;
+    } else if (kNativeSoftFloatAfterHardFloat) {
+      // After using FP arg registers, pass FP args in general purpose registers or on the stack.
+      AdvanceLong(val);
+    } else {
+      if (DoubleStackNeedsPadding()) {
+        PushStack(0);
+        stack_entries_++;
+      }
+      if (kRegistersNeededForDouble == 1) {
+        PushStack(static_cast<uintptr_t>(val));
+        stack_entries_++;
+      } else {
+        PushStack(static_cast<uintptr_t>(val & 0xFFFFFFFF));
+        PushStack(static_cast<uintptr_t>((val >> 32) & 0xFFFFFFFF));
+        stack_entries_ += 2;
+      }
+      fpr_index_ = 0;
     }
   }
 
@@ -1634,17 +1653,16 @@
   }
 
   virtual void WalkHeader(
-      BuildNativeCallFrameStateMachine<ComputeNativeCallFrameSize>* sm ATTRIBUTE_UNUSED)
-      REQUIRES_SHARED(Locks::mutator_lock_) {
-  }
+      [[maybe_unused]] BuildNativeCallFrameStateMachine<ComputeNativeCallFrameSize>* sm)
+      REQUIRES_SHARED(Locks::mutator_lock_) {}
 
-  void Walk(const char* shorty, uint32_t shorty_len) REQUIRES_SHARED(Locks::mutator_lock_) {
+  void Walk(std::string_view shorty) REQUIRES_SHARED(Locks::mutator_lock_) {
     BuildNativeCallFrameStateMachine<ComputeNativeCallFrameSize> sm(this);
 
     WalkHeader(&sm);
 
-    for (uint32_t i = 1; i < shorty_len; ++i) {
-      Primitive::Type cur_type_ = Primitive::GetType(shorty[i]);
+    for (char c : shorty.substr(1u)) {
+      Primitive::Type cur_type_ = Primitive::GetType(c);
       switch (cur_type_) {
         case Primitive::kPrimNot:
           sm.AdvancePointer(nullptr);
@@ -1699,11 +1717,11 @@
   explicit ComputeGenericJniFrameSize(bool critical_native)
     : critical_native_(critical_native) {}
 
-  uintptr_t* ComputeLayout(ArtMethod** managed_sp, const char* shorty, uint32_t shorty_len)
+  uintptr_t* ComputeLayout(ArtMethod** managed_sp, std::string_view shorty)
       REQUIRES_SHARED(Locks::mutator_lock_) {
     DCHECK_EQ(Runtime::Current()->GetClassLinker()->GetImagePointerSize(), kRuntimePointerSize);
 
-    Walk(shorty, shorty_len);
+    Walk(shorty);
 
     // Add space for cookie.
     DCHECK_ALIGNED(managed_sp, sizeof(uintptr_t));
@@ -1811,11 +1829,10 @@
   BuildGenericJniFrameVisitor(Thread* self,
                               bool is_static,
                               bool critical_native,
-                              const char* shorty,
-                              uint32_t shorty_len,
+                              std::string_view shorty,
                               ArtMethod** managed_sp,
                               uintptr_t* reserved_area)
-      : QuickArgumentVisitor(managed_sp, is_static, shorty, shorty_len),
+      : QuickArgumentVisitor(managed_sp, is_static, shorty),
         jni_call_(nullptr, nullptr, nullptr),
         sm_(&jni_call_),
         current_vreg_(nullptr) {
@@ -1823,7 +1840,7 @@
     DCHECK_ALIGNED(reserved_area, sizeof(uintptr_t));
 
     ComputeGenericJniFrameSize fsc(critical_native);
-    uintptr_t* out_args_sp = fsc.ComputeLayout(managed_sp, shorty, shorty_len);
+    uintptr_t* out_args_sp = fsc.ComputeLayout(managed_sp, shorty);
 
     // Store hidden argument for @CriticalNative.
     uintptr_t* hidden_arg_slot = fsc.GetHiddenArgSlot(reserved_area);
@@ -1914,7 +1931,7 @@
       break;
     }
     case Primitive::kPrimFloat:
-      sm_.AdvanceFloat(*reinterpret_cast<float*>(GetParamAddress()));
+      sm_.AdvanceFloat(*reinterpret_cast<uint32_t*>(GetParamAddress()));
       current_vreg_ += 1u;
       break;
     case Primitive::kPrimBoolean:  // Fall-through.
@@ -1958,8 +1975,7 @@
   ArtMethod* called = *managed_sp;
   DCHECK(called->IsNative()) << called->PrettyMethod(true);
   Runtime* runtime = Runtime::Current();
-  uint32_t shorty_len = 0;
-  const char* shorty = called->GetShorty(&shorty_len);
+  std::string_view shorty = called->GetShortyView();
   bool critical_native = called->IsCriticalNative();
   bool fast_native = called->IsFastNative();
   bool normal_native = !critical_native && !fast_native;
@@ -1969,7 +1985,6 @@
                                       called->IsStatic(),
                                       critical_native,
                                       shorty,
-                                      shorty_len,
                                       managed_sp,
                                       reserved_area);
   {
@@ -2030,13 +2045,12 @@
         << "@FastNative/@CriticalNative and synchronize is not supported";
   }
 
-  // Skip pushing IRT frame for @CriticalNative.
+  // Skip pushing LRT frame for @CriticalNative.
   if (LIKELY(!critical_native)) {
     // Push local reference frame.
     JNIEnvExt* env = self->GetJniEnv();
     DCHECK(env != nullptr);
-    uint32_t cookie = bit_cast<uint32_t>(env->GetLocalRefCookie());
-    env->SetLocalRefCookie(env->GetLocalsSegmentState());
+    uint32_t cookie = bit_cast<uint32_t>(env->PushLocalReferenceFrame());
 
     // Save the cookie on the stack.
     uint32_t* sp32 = reinterpret_cast<uint32_t*>(managed_sp);
@@ -2112,12 +2126,12 @@
       return GetTwoWordFailureValue();  // Failure.
     }
     const DexFile* dex_file = caller_method->GetDexFile();
-    uint32_t shorty_len;
-    const char* shorty = dex_file->GetMethodShorty(dex_file->GetMethodId(method_idx), &shorty_len);
+    std::string_view shorty =
+        dex_file->GetMethodShortyView(dex_file->GetMethodId(method_idx));
     {
       // Remember the args in case a GC happens in FindMethodToCall.
       ScopedObjectAccessUnchecked soa(self->GetJniEnv());
-      RememberForGcArgumentVisitor visitor(sp, type == kStatic, shorty, shorty_len, &soa);
+      RememberForGcArgumentVisitor visitor(sp, type == kStatic, shorty, &soa);
       visitor.VisitArguments();
 
       method = FindMethodToCall<type>(self,
@@ -2174,10 +2188,8 @@
 }
 
 extern "C" TwoWordReturn artInvokeStaticTrampolineWithAccessCheck(
-    uint32_t method_idx,
-    mirror::Object* this_object ATTRIBUTE_UNUSED,
-    Thread* self,
-    ArtMethod** sp) REQUIRES_SHARED(Locks::mutator_lock_) {
+    uint32_t method_idx, [[maybe_unused]] mirror::Object* this_object, Thread* self, ArtMethod** sp)
+    REQUIRES_SHARED(Locks::mutator_lock_) {
   // For static, this_object is not required and may be random garbage. Don't pass it down so that
   // it doesn't cause ObjPtr alignment failure check.
   return artInvokeCommon<kStatic>(method_idx, nullptr, self, sp);
@@ -2227,13 +2239,12 @@
     }
 
     const DexFile& dex_file = *caller_method->GetDexFile();
-    uint32_t shorty_len;
-    const char* shorty = dex_file.GetMethodShorty(dex_file.GetMethodId(dex_method_idx),
-                                                  &shorty_len);
+    std::string_view shorty =
+        dex_file.GetMethodShortyView(dex_file.GetMethodId(dex_method_idx));
     {
       // Remember the args in case a GC happens in ClassLinker::ResolveMethod().
       ScopedObjectAccessUnchecked soa(self->GetJniEnv());
-      RememberForGcArgumentVisitor visitor(sp, false, shorty, shorty_len, &soa);
+      RememberForGcArgumentVisitor visitor(sp, false, shorty, &soa);
       visitor.VisitArguments();
       ClassLinker* class_linker = runtime->GetClassLinker();
       interface_method = class_linker->ResolveMethod<ClassLinker::ResolveMode::kNoChecks>(
@@ -2338,10 +2349,9 @@
   DCHECK(inst.Opcode() == Instruction::INVOKE_POLYMORPHIC ||
          inst.Opcode() == Instruction::INVOKE_POLYMORPHIC_RANGE);
   const dex::ProtoIndex proto_idx(inst.VRegH());
-  const char* shorty = caller_method->GetDexFile()->GetShorty(proto_idx);
-  const size_t shorty_length = strlen(shorty);
+  std::string_view shorty = caller_method->GetDexFile()->GetShortyView(proto_idx);
   static const bool kMethodIsStatic = false;  // invoke() and invokeExact() are not static.
-  RememberForGcArgumentVisitor gc_visitor(sp, kMethodIsStatic, shorty, shorty_length, &soa);
+  RememberForGcArgumentVisitor gc_visitor(sp, kMethodIsStatic, shorty, &soa);
   gc_visitor.VisitArguments();
 
   // Wrap raw_receiver in a Handle for safety.
@@ -2380,7 +2390,6 @@
   BuildQuickShadowFrameVisitor shadow_frame_builder(sp,
                                                     kMethodIsStatic,
                                                     shorty,
-                                                    strlen(shorty),
                                                     shadow_frame,
                                                     first_arg);
   shadow_frame_builder.VisitArguments();
@@ -2439,7 +2448,7 @@
   Runtime::Current()->GetInstrumentation()->PushDeoptContextIfNeeded(
       self, DeoptimizationMethodType::kDefault, is_ref, result);
 
-  return result.GetJ();
+  return NanBoxResultIfNeeded(result.GetJ(), shorty[0]);
 }
 
 // Returns uint64_t representing raw bits from JValue.
@@ -2463,8 +2472,7 @@
   ArtMethod* caller_method = QuickArgumentVisitor::GetCallingMethodAndDexPc(sp, &dex_pc);
   const DexFile* dex_file = caller_method->GetDexFile();
   const dex::ProtoIndex proto_idx(dex_file->GetProtoIndexForCallSite(call_site_idx));
-  const char* shorty = caller_method->GetDexFile()->GetShorty(proto_idx);
-  const uint32_t shorty_len = strlen(shorty);
+  std::string_view shorty = caller_method->GetDexFile()->GetShortyView(proto_idx);
 
   // Construct the shadow frame placing arguments consecutively from |first_arg|.
   const size_t first_arg = 0;
@@ -2476,7 +2484,6 @@
   BuildQuickShadowFrameVisitor shadow_frame_builder(sp,
                                                     kMethodIsStatic,
                                                     shorty,
-                                                    shorty_len,
                                                     shadow_frame,
                                                     first_arg);
   shadow_frame_builder.VisitArguments();
@@ -2500,7 +2507,7 @@
   Runtime::Current()->GetInstrumentation()->PushDeoptContextIfNeeded(
       self, DeoptimizationMethodType::kDefault, is_ref, result);
 
-  return result.GetJ();
+  return NanBoxResultIfNeeded(result.GetJ(), shorty[0]);
 }
 
 extern "C" void artJniMethodEntryHook(Thread* self)
@@ -2513,6 +2520,11 @@
 extern "C" void artMethodEntryHook(ArtMethod* method, Thread* self, ArtMethod** sp)
     REQUIRES_SHARED(Locks::mutator_lock_) {
   instrumentation::Instrumentation* instr = Runtime::Current()->GetInstrumentation();
+  if (instr->HasFastMethodEntryListenersOnly()) {
+    instr->MethodEnterEvent(self, method);
+    return;
+  }
+
   if (instr->HasMethodEntryListeners()) {
     instr->MethodEnterEvent(self, method);
     // MethodEnter callback could have requested a deopt for ex: by setting a breakpoint, so
@@ -2542,8 +2554,16 @@
   instrumentation::Instrumentation* instr = Runtime::Current()->GetInstrumentation();
   DCHECK(instr->RunExitHooks());
 
-  bool is_ref = false;
   ArtMethod* method = *sp;
+  if (instr->HasFastMethodExitListenersOnly()) {
+    // Fast method listeners are only used for tracing which don't need any deoptimization checks
+    // or a return value.
+    JValue return_value;
+    instr->MethodExitEvent(self, method, /* frame= */ {}, return_value);
+    return;
+  }
+
+  bool is_ref = false;
   if (instr->HasMethodExitListeners()) {
     StackHandleScope<1> hs(self);
 
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints_test.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints_test.cc
index 0f0fb69..14e5a7c 100644
--- a/runtime/entrypoints/quick/quick_trampoline_entrypoints_test.cc
+++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints_test.cc
@@ -22,7 +22,7 @@
 #include "common_runtime_test.h"
 #include "quick/quick_method_frame_info.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class QuickTrampolineEntrypointsTest : public CommonRuntimeTest {
  protected:
diff --git a/runtime/entrypoints_order_test.cc b/runtime/entrypoints_order_test.cc
index be1c58d..20f2863 100644
--- a/runtime/entrypoints_order_test.cc
+++ b/runtime/entrypoints_order_test.cc
@@ -25,7 +25,7 @@
 // that an oat version bump may be in order, and some defines should be carefully checked (or their
 // corresponding tests run).
 
-namespace art {
+namespace art HIDDEN {
 
 // OFFSETOF_MEMBER uses reinterpret_cast. This means it is not a constexpr. So we cannot use
 // compile-time assertions. Once we find another way, adjust the define accordingly.
@@ -70,7 +70,6 @@
     EXPECT_OFFSET_DIFFP(Thread, tls32_, daemon, throwing_OutOfMemoryError, 4);
     EXPECT_OFFSET_DIFFP(Thread, tls32_, throwing_OutOfMemoryError, no_thread_suspension, 4);
     EXPECT_OFFSET_DIFFP(Thread, tls32_, no_thread_suspension, thread_exit_check_count, 4);
-    EXPECT_OFFSET_DIFFP(Thread, tls32_, thread_exit_check_count, is_transitioning_to_runnable, 4);
 
     // TODO: Better connection. Take alignment into account.
     EXPECT_OFFSET_DIFF_GT3(Thread, tls32_.thread_exit_check_count, tls64_.trace_clock_base, 4,
@@ -108,13 +107,14 @@
     EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, name, pthread_self, sizeof(void*));
     EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, pthread_self, last_no_thread_suspension_cause,
                         sizeof(void*));
-    EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, last_no_thread_suspension_cause, active_suspend_barriers,
-                        sizeof(void*));
-    EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, active_suspend_barriers, thread_local_start,
-                        sizeof(Thread::tls_ptr_sized_values::active_suspend_barriers));
-    EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_start, thread_local_pos, sizeof(void*));
+    EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, last_no_thread_suspension_cause,
+                        active_suspendall_barrier, sizeof(void*));
+    EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, active_suspendall_barrier,
+                        active_suspend1_barriers, sizeof(void*));
+    EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, active_suspend1_barriers, thread_local_pos, sizeof(void*));
     EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_pos, thread_local_end, sizeof(void*));
-    EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_end, thread_local_limit, sizeof(void*));
+    EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_end, thread_local_start, sizeof(void*));
+    EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_start, thread_local_limit, sizeof(void*));
     EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_limit, thread_local_objects, sizeof(void*));
     EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_objects, checkpoint_function, sizeof(size_t));
     EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, checkpoint_function, jni_entrypoints,
@@ -129,8 +129,7 @@
     EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, mutator_lock, held_mutexes, sizeof(void*));
     EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, held_mutexes, flip_function,
                         sizeof(void*) * kLockLevelCount);
-    EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, flip_function, method_verifier, sizeof(void*));
-    EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, method_verifier, thread_local_mark_stack, sizeof(void*));
+    EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, flip_function, thread_local_mark_stack, sizeof(void*));
     EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_mark_stack, async_exception, sizeof(void*));
     EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, async_exception, top_reflective_handle_scope,
                         sizeof(void*));
@@ -138,11 +137,12 @@
         Thread, tlsPtr_, top_reflective_handle_scope, method_trace_buffer, sizeof(void*));
     EXPECT_OFFSET_DIFFP(
         Thread, tlsPtr_, method_trace_buffer, method_trace_buffer_index, sizeof(void*));
+    EXPECT_OFFSET_DIFFP(
+        Thread, tlsPtr_, method_trace_buffer_index, thread_exit_flags, sizeof(void*));
     // The first field after tlsPtr_ is forced to a 16 byte alignment so it might have some space.
     auto offset_tlsptr_end = OFFSETOF_MEMBER(Thread, tlsPtr_) +
         sizeof(decltype(reinterpret_cast<Thread*>(16)->tlsPtr_));
-    CHECKED(offset_tlsptr_end - OFFSETOF_MEMBER(Thread, tlsPtr_.method_trace_buffer_index) ==
-                sizeof(void*),
+    CHECKED(offset_tlsptr_end - OFFSETOF_MEMBER(Thread, tlsPtr_.thread_exit_flags) == sizeof(void*),
             "async_exception last field");
   }
 
diff --git a/runtime/exec_utils.cc b/runtime/exec_utils.cc
index b4d6553..1266ed1 100644
--- a/runtime/exec_utils.cc
+++ b/runtime/exec_utils.cc
@@ -48,7 +48,7 @@
 #include "base/utils.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace {
 
diff --git a/runtime/exec_utils.h b/runtime/exec_utils.h
index e09f285..8e3e3df 100644
--- a/runtime/exec_utils.h
+++ b/runtime/exec_utils.h
@@ -26,8 +26,9 @@
 #include <vector>
 
 #include "android-base/unique_fd.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 struct ProcessStat {
   // The total wall time, in milliseconds, that the process spent, or 0 if failed to get the value.
@@ -75,7 +76,7 @@
 // These spawn child processes using the environment as it was set when the single instance
 // of the runtime (Runtime::Current()) was started.  If no instance of the runtime was started, it
 // will use the current environment settings.
-class ExecUtils {
+class EXPORT ExecUtils {
  public:
   virtual ~ExecUtils() = default;
 
diff --git a/runtime/exec_utils_test.cc b/runtime/exec_utils_test.cc
index fc628fc..e3b1dc5 100644
--- a/runtime/exec_utils_test.cc
+++ b/runtime/exec_utils_test.cc
@@ -34,7 +34,7 @@
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using ::android::base::Result;
 using ::testing::_;
diff --git a/runtime/experimental_flags.h b/runtime/experimental_flags.h
index 5f14438..903a4b3 100644
--- a/runtime/experimental_flags.h
+++ b/runtime/experimental_flags.h
@@ -19,7 +19,9 @@
 
 #include <ostream>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 // Possible experimental features that might be enabled.
 struct ExperimentalFlags {
diff --git a/runtime/fault_handler.cc b/runtime/fault_handler.cc
index 6f1452e..635de2a 100644
--- a/runtime/fault_handler.cc
+++ b/runtime/fault_handler.cc
@@ -25,7 +25,6 @@
 #include "art_method-inl.h"
 #include "base/logging.h"  // For VLOG
 #include "base/membarrier.h"
-#include "base/safe_copy.h"
 #include "base/stl_util.h"
 #include "dex/dex_file_types.h"
 #include "gc/heap.h"
@@ -33,13 +32,13 @@
 #include "jit/jit_code_cache.h"
 #include "mirror/class.h"
 #include "mirror/object_reference.h"
-#include "oat_file.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_file.h"
+#include "oat/oat_quick_method_header.h"
 #include "sigchain.h"
 #include "thread-current-inl.h"
 #include "verify_object-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 // Static fault manger object accessed by signal handler.
 FaultManager fault_manager;
 
@@ -227,7 +226,7 @@
   return false;
 }
 
-bool FaultManager::HandleSigbusFault(int sig, siginfo_t* info, void* context ATTRIBUTE_UNUSED) {
+bool FaultManager::HandleSigbusFault(int sig, siginfo_t* info, [[maybe_unused]] void* context) {
   DCHECK_EQ(sig, SIGBUS);
   if (VLOG_IS_ON(signals)) {
     PrintSignalInfo(VLOG_STREAM(signals) << "Handling SIGBUS fault:\n", info);
@@ -631,7 +630,7 @@
   manager_->AddHandler(this, false);
 }
 
-bool JavaStackTraceHandler::Action(int sig ATTRIBUTE_UNUSED, siginfo_t* siginfo, void* context) {
+bool JavaStackTraceHandler::Action([[maybe_unused]] int sig, siginfo_t* siginfo, void* context) {
   // Make sure that we are in the generated code, but we may not have a dex pc.
   bool in_generated_code = manager_->IsInGeneratedCode(siginfo, context);
   if (in_generated_code) {
diff --git a/runtime/fault_handler.h b/runtime/fault_handler.h
index 6be1743..4d9c3f5 100644
--- a/runtime/fault_handler.h
+++ b/runtime/fault_handler.h
@@ -25,10 +25,11 @@
 #include <vector>
 
 #include "base/locks.h"  // For annotalysis.
+#include "base/macros.h"
 #include "base/mutex.h"
 #include "runtime_globals.h"  // For CanDoImplicitNullCheckOn.
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtMethod;
 class FaultHandler;
@@ -55,8 +56,8 @@
   bool HandleSigbusFault(int sig, siginfo_t* info, void* context);
 
   // Added handlers are owned by the fault handler and will be freed on Shutdown().
-  void AddHandler(FaultHandler* handler, bool generated_code);
-  void RemoveHandler(FaultHandler* handler);
+  EXPORT void AddHandler(FaultHandler* handler, bool generated_code);
+  EXPORT void RemoveHandler(FaultHandler* handler);
 
   void AddGeneratedCodeRange(const void* start, size_t size);
   void RemoveGeneratedCodeRange(const void* start, size_t size)
@@ -120,7 +121,7 @@
 
 class FaultHandler {
  public:
-  explicit FaultHandler(FaultManager* manager);
+  EXPORT explicit FaultHandler(FaultManager* manager);
   virtual ~FaultHandler() {}
   FaultManager* GetFaultManager() {
     return manager_;
@@ -196,8 +197,8 @@
 };
 
 // Statically allocated so the the signal handler can Get access to it.
-extern FaultManager fault_manager;
+EXPORT extern FaultManager fault_manager;
 
-}       // namespace art
+}  // namespace art
 #endif  // ART_RUNTIME_FAULT_HANDLER_H_
 
diff --git a/runtime/gc/accounting/atomic_stack.h b/runtime/gc/accounting/atomic_stack.h
index a90a319..074978d 100644
--- a/runtime/gc/accounting/atomic_stack.h
+++ b/runtime/gc/accounting/atomic_stack.h
@@ -37,7 +37,7 @@
 // - Multiple calls to AtomicPushBack*() and AtomicBumpBack() may be made concurrently,
 // provided no other calls are made at the same time.
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace accounting {
 
diff --git a/runtime/gc/accounting/bitmap-inl.h b/runtime/gc/accounting/bitmap-inl.h
index a4273e5..20133be 100644
--- a/runtime/gc/accounting/bitmap-inl.h
+++ b/runtime/gc/accounting/bitmap-inl.h
@@ -26,7 +26,7 @@
 #include "base/atomic.h"
 #include "base/bit_utils.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace accounting {
 
diff --git a/runtime/gc/accounting/bitmap.cc b/runtime/gc/accounting/bitmap.cc
index 4e4109d..690a495 100644
--- a/runtime/gc/accounting/bitmap.cc
+++ b/runtime/gc/accounting/bitmap.cc
@@ -24,7 +24,7 @@
 #include "gc/collector/mark_compact.h"
 #include "jit/jit_memory_region.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace accounting {
 
@@ -47,7 +47,7 @@
 
 MemMap Bitmap::AllocateMemMap(const std::string& name, size_t num_bits) {
   const size_t bitmap_size = RoundUp(
-      RoundUp(num_bits, kBitsPerBitmapWord) / kBitsPerBitmapWord * sizeof(uintptr_t), kPageSize);
+      RoundUp(num_bits, kBitsPerBitmapWord) / kBitsPerBitmapWord * sizeof(uintptr_t), gPageSize);
   std::string error_msg;
   MemMap mem_map = MemMap::MapAnonymous(name.c_str(),
                                         bitmap_size,
diff --git a/runtime/gc/accounting/bitmap.h b/runtime/gc/accounting/bitmap.h
index f413243..5a2cd06 100644
--- a/runtime/gc/accounting/bitmap.h
+++ b/runtime/gc/accounting/bitmap.h
@@ -29,7 +29,7 @@
 #include "base/mem_map.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace gc {
 namespace accounting {
diff --git a/runtime/gc/accounting/card_table-inl.h b/runtime/gc/accounting/card_table-inl.h
index cc24a1a..213836e 100644
--- a/runtime/gc/accounting/card_table-inl.h
+++ b/runtime/gc/accounting/card_table-inl.h
@@ -26,7 +26,7 @@
 #include "base/mem_map.h"
 #include "space_bitmap.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace accounting {
 
diff --git a/runtime/gc/accounting/card_table.cc b/runtime/gc/accounting/card_table.cc
index b8b328c..f247f56 100644
--- a/runtime/gc/accounting/card_table.cc
+++ b/runtime/gc/accounting/card_table.cc
@@ -27,7 +27,7 @@
 #include "heap_bitmap.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace accounting {
 
@@ -106,7 +106,7 @@
   static_assert(kCardClean == 0, "kCardClean must be 0");
   uint8_t* start_card = CardFromAddr(start);
   uint8_t* end_card = CardFromAddr(end);
-  ZeroAndReleasePages(start_card, end_card - start_card);
+  ZeroAndReleaseMemory(start_card, end_card - start_card);
 }
 
 bool CardTable::AddrIsInCardTable(const void* addr) const {
diff --git a/runtime/gc/accounting/card_table.h b/runtime/gc/accounting/card_table.h
index 5f4675d..72cf571 100644
--- a/runtime/gc/accounting/card_table.h
+++ b/runtime/gc/accounting/card_table.h
@@ -23,7 +23,7 @@
 #include "base/mem_map.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Object;
diff --git a/runtime/gc/accounting/card_table_test.cc b/runtime/gc/accounting/card_table_test.cc
index b34a883..bbedb81 100644
--- a/runtime/gc/accounting/card_table_test.cc
+++ b/runtime/gc/accounting/card_table_test.cc
@@ -27,7 +27,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread_pool.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Object;
diff --git a/runtime/gc/accounting/heap_bitmap-inl.h b/runtime/gc/accounting/heap_bitmap-inl.h
index edf2e5b..38dc73b 100644
--- a/runtime/gc/accounting/heap_bitmap-inl.h
+++ b/runtime/gc/accounting/heap_bitmap-inl.h
@@ -21,7 +21,7 @@
 
 #include "space_bitmap-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace accounting {
 
diff --git a/runtime/gc/accounting/heap_bitmap.cc b/runtime/gc/accounting/heap_bitmap.cc
index 4a3902e..b1d4d8e 100644
--- a/runtime/gc/accounting/heap_bitmap.cc
+++ b/runtime/gc/accounting/heap_bitmap.cc
@@ -19,7 +19,7 @@
 #include "gc/accounting/space_bitmap-inl.h"
 #include "gc/space/space.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace accounting {
 
diff --git a/runtime/gc/accounting/heap_bitmap.h b/runtime/gc/accounting/heap_bitmap.h
index a5f4499..93272ff 100644
--- a/runtime/gc/accounting/heap_bitmap.h
+++ b/runtime/gc/accounting/heap_bitmap.h
@@ -24,7 +24,7 @@
 #include "base/macros.h"
 #include "space_bitmap.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 class Heap;
diff --git a/runtime/gc/accounting/mod_union_table-inl.h b/runtime/gc/accounting/mod_union_table-inl.h
index f0a82e0..1c8a841 100644
--- a/runtime/gc/accounting/mod_union_table-inl.h
+++ b/runtime/gc/accounting/mod_union_table-inl.h
@@ -21,7 +21,7 @@
 
 #include "gc/space/space.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace accounting {
 
diff --git a/runtime/gc/accounting/mod_union_table.cc b/runtime/gc/accounting/mod_union_table.cc
index 4a84799..6bad61f 100644
--- a/runtime/gc/accounting/mod_union_table.cc
+++ b/runtime/gc/accounting/mod_union_table.cc
@@ -32,7 +32,7 @@
 #include "space_bitmap-inl.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace accounting {
 
@@ -43,7 +43,7 @@
 
   inline void operator()(uint8_t* card,
                          uint8_t expected_value,
-                         uint8_t new_value ATTRIBUTE_UNUSED) const {
+                         [[maybe_unused]] uint8_t new_value) const {
     if (expected_value == CardTable::kCardDirty) {
       cleared_cards_->insert(card);
     }
@@ -60,7 +60,7 @@
 
   inline void operator()(uint8_t* card,
                          uint8_t expected_value,
-                         uint8_t new_value ATTRIBUTE_UNUSED) const {
+                         [[maybe_unused]] uint8_t new_value) const {
     if (expected_value == CardTable::kCardDirty) {
       // We want the address the card represents, not the address of the card.
       bitmap_->Set(reinterpret_cast<uintptr_t>(card_table_->AddrFromCard(card)));
@@ -78,7 +78,7 @@
       : cleared_cards_(cleared_cards) {
   }
 
-  void operator()(uint8_t* card, uint8_t expected_card, uint8_t new_card ATTRIBUTE_UNUSED) const {
+  void operator()(uint8_t* card, uint8_t expected_card, [[maybe_unused]] uint8_t new_card) const {
     if (expected_card == CardTable::kCardDirty) {
       cleared_cards_->push_back(card);
     }
@@ -100,7 +100,7 @@
       contains_reference_to_other_space_(contains_reference_to_other_space) {}
 
   // Extra parameters are required since we use this same visitor signature for checking objects.
-  void operator()(mirror::Object* obj, MemberOffset offset, bool is_static ATTRIBUTE_UNUSED) const
+  void operator()(mirror::Object* obj, MemberOffset offset, [[maybe_unused]] bool is_static) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     MarkReference(obj->GetFieldObjectReferenceAddr(offset));
   }
@@ -195,7 +195,7 @@
         has_target_reference_(has_target_reference) {}
 
   // Extra parameters are required since we use this same visitor signature for checking objects.
-  void operator()(mirror::Object* obj, MemberOffset offset, bool is_static ATTRIBUTE_UNUSED) const
+  void operator()(mirror::Object* obj, MemberOffset offset, [[maybe_unused]] bool is_static) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     mirror::HeapReference<mirror::Object>* ref_ptr = obj->GetFieldObjectReferenceAddr(offset);
     mirror::Object* ref = ref_ptr->AsMirrorPtr();
@@ -270,7 +270,7 @@
         references_(references) {}
 
   // Extra parameters are required since we use this same visitor signature for checking objects.
-  void operator()(mirror::Object* obj, MemberOffset offset, bool is_static ATTRIBUTE_UNUSED) const
+  void operator()(mirror::Object* obj, MemberOffset offset, [[maybe_unused]] bool is_static) const
       REQUIRES_SHARED(Locks::heap_bitmap_lock_, Locks::mutator_lock_) {
     mirror::Object* ref = obj->GetFieldObject<mirror::Object>(offset);
     if (ref != nullptr &&
diff --git a/runtime/gc/accounting/mod_union_table.h b/runtime/gc/accounting/mod_union_table.h
index 1fa602f..ca53c53 100644
--- a/runtime/gc/accounting/mod_union_table.h
+++ b/runtime/gc/accounting/mod_union_table.h
@@ -28,7 +28,7 @@
 #include <set>
 #include <vector>
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Object;
diff --git a/runtime/gc/accounting/mod_union_table_test.cc b/runtime/gc/accounting/mod_union_table_test.cc
index 3f38f50..396e117 100644
--- a/runtime/gc/accounting/mod_union_table_test.cc
+++ b/runtime/gc/accounting/mod_union_table_test.cc
@@ -26,7 +26,7 @@
 #include "thread-current-inl.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace accounting {
 
@@ -100,7 +100,7 @@
  public:
   explicit CollectVisitedVisitor(std::set<mirror::Object*>* out) : out_(out) {}
   void MarkHeapReference(mirror::HeapReference<mirror::Object>* ref,
-                         bool do_atomic_update ATTRIBUTE_UNUSED) override
+                         [[maybe_unused]] bool do_atomic_update) override
       REQUIRES_SHARED(Locks::mutator_lock_) {
     DCHECK(ref != nullptr);
     MarkObject(ref->AsMirrorPtr());
diff --git a/runtime/gc/accounting/read_barrier_table.h b/runtime/gc/accounting/read_barrier_table.h
index 44cdb5e..d5f7f08 100644
--- a/runtime/gc/accounting/read_barrier_table.h
+++ b/runtime/gc/accounting/read_barrier_table.h
@@ -25,7 +25,7 @@
 #include "gc/space/space.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace accounting {
 
diff --git a/runtime/gc/accounting/remembered_set.cc b/runtime/gc/accounting/remembered_set.cc
index fba62c3..6551cbb 100644
--- a/runtime/gc/accounting/remembered_set.cc
+++ b/runtime/gc/accounting/remembered_set.cc
@@ -33,7 +33,7 @@
 #include "space_bitmap-inl.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace accounting {
 
@@ -42,7 +42,7 @@
   explicit RememberedSetCardVisitor(RememberedSet::CardSet* const dirty_cards)
       : dirty_cards_(dirty_cards) {}
 
-  void operator()(uint8_t* card, uint8_t expected_value, uint8_t new_value ATTRIBUTE_UNUSED) const {
+  void operator()(uint8_t* card, uint8_t expected_value, [[maybe_unused]] uint8_t new_value) const {
     if (expected_value == CardTable::kCardDirty) {
       dirty_cards_->insert(card);
     }
@@ -69,8 +69,7 @@
 
   void operator()(ObjPtr<mirror::Object> obj,
                   MemberOffset offset,
-                  bool is_static ATTRIBUTE_UNUSED) const
-      REQUIRES_SHARED(Locks::mutator_lock_) {
+                  [[maybe_unused]] bool is_static) const REQUIRES_SHARED(Locks::mutator_lock_) {
     DCHECK(obj != nullptr);
     mirror::HeapReference<mirror::Object>* ref_ptr = obj->GetFieldObjectReferenceAddr(offset);
     if (target_space_->HasAddress(ref_ptr->AsMirrorPtr())) {
diff --git a/runtime/gc/accounting/remembered_set.h b/runtime/gc/accounting/remembered_set.h
index 8b390df..4a611df 100644
--- a/runtime/gc/accounting/remembered_set.h
+++ b/runtime/gc/accounting/remembered_set.h
@@ -25,7 +25,7 @@
 #include <set>
 #include <vector>
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 namespace collector {
diff --git a/runtime/gc/accounting/space_bitmap-inl.h b/runtime/gc/accounting/space_bitmap-inl.h
index e7825e6..4f9e5a3 100644
--- a/runtime/gc/accounting/space_bitmap-inl.h
+++ b/runtime/gc/accounting/space_bitmap-inl.h
@@ -26,7 +26,7 @@
 #include "base/atomic.h"
 #include "base/bit_utils.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace accounting {
 
diff --git a/runtime/gc/accounting/space_bitmap.cc b/runtime/gc/accounting/space_bitmap.cc
index a0458d2..fc7c4a7 100644
--- a/runtime/gc/accounting/space_bitmap.cc
+++ b/runtime/gc/accounting/space_bitmap.cc
@@ -28,7 +28,7 @@
 #include "mirror/object-inl.h"
 #include "mirror/object_array.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace accounting {
 
@@ -148,9 +148,11 @@
 }
 
 template<size_t kAlignment>
-void SpaceBitmap<kAlignment>::Clear() {
+void SpaceBitmap<kAlignment>::Clear(bool release_eagerly) {
   if (bitmap_begin_ != nullptr) {
-    mem_map_.MadviseDontNeedAndZero();
+    // We currently always eagerly release the memory to the OS.
+    static constexpr bool kAlwaysEagerlyReleaseBitmapMemory = true;
+    mem_map_.FillWithZero(kAlwaysEagerlyReleaseBitmapMemory || release_eagerly);
   }
 }
 
@@ -170,8 +172,8 @@
   // Bitmap word boundaries.
   const uintptr_t start_index = OffsetToIndex(begin_offset);
   const uintptr_t end_index = OffsetToIndex(end_offset);
-  ZeroAndReleasePages(reinterpret_cast<uint8_t*>(&bitmap_begin_[start_index]),
-                      (end_index - start_index) * sizeof(*bitmap_begin_));
+  ZeroAndReleaseMemory(reinterpret_cast<uint8_t*>(&bitmap_begin_[start_index]),
+                       (end_index - start_index) * sizeof(*bitmap_begin_));
 }
 
 template<size_t kAlignment>
@@ -248,7 +250,7 @@
 }
 
 template class SpaceBitmap<kObjectAlignment>;
-template class SpaceBitmap<kPageSize>;
+template class SpaceBitmap<kMinPageSize>;
 
 }  // namespace accounting
 }  // namespace gc
diff --git a/runtime/gc/accounting/space_bitmap.h b/runtime/gc/accounting/space_bitmap.h
index be3ccba..8c3796d 100644
--- a/runtime/gc/accounting/space_bitmap.h
+++ b/runtime/gc/accounting/space_bitmap.h
@@ -27,7 +27,7 @@
 #include "base/mem_map.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Class;
@@ -45,7 +45,9 @@
 
   // Initialize a space bitmap so that it points to a bitmap large enough to cover a heap at
   // heap_begin of heap_capacity bytes, where objects are guaranteed to be kAlignment-aligned.
-  static SpaceBitmap Create(const std::string& name, uint8_t* heap_begin, size_t heap_capacity);
+  EXPORT static SpaceBitmap Create(const std::string& name,
+                                   uint8_t* heap_begin,
+                                   size_t heap_capacity);
 
   // Initialize a space bitmap using the provided mem_map as the live bits. Takes ownership of the
   // mem map. The address range covered starts at heap_begin and is of size equal to heap_capacity.
@@ -55,7 +57,7 @@
                                       uint8_t* heap_begin,
                                       size_t heap_capacity);
 
-  ~SpaceBitmap();
+  EXPORT ~SpaceBitmap();
 
   // Return the bitmap word index corresponding to memory offset (relative to
   // `HeapBegin()`) `offset`.
@@ -102,7 +104,9 @@
   bool AtomicTestAndSet(const mirror::Object* obj);
 
   // Fill the bitmap with zeroes.  Returns the bitmap's memory to the system as a side-effect.
-  void Clear();
+  // If `release_eagerly` is true, this method will also try to give back the
+  // memory to the OS eagerly.
+  void Clear(bool release_eagerly = true);
 
   // Clear a range covered by the bitmap using madvise if possible.
   void ClearRange(const mirror::Object* begin, const mirror::Object* end);
@@ -272,7 +276,20 @@
 };
 
 using ContinuousSpaceBitmap = SpaceBitmap<kObjectAlignment>;
-using LargeObjectBitmap = SpaceBitmap<kLargeObjectAlignment>;
+
+// We pick the lowest supported page size to ensure that it's a constexpr, so
+// that we can keep bitmap accesses optimized. However, this means that when the
+// large-object alignment is higher than kMinPageSize, then not all bits in the
+// bitmap are actually in use.
+// In practice, this happens when running with a kernel that uses 16kB as the
+// page size, where 1 out of every 4 bits of the bitmap is used.
+
+// TODO: In the future, we should consider alternative fixed alignments for
+// large objects, disassociated from the page size. This would allow us to keep
+// accesses optimized, while also packing the bitmap efficiently, and reducing
+// its size enough that it would no longer make sense to allocate it with
+// mmap().
+using LargeObjectBitmap = SpaceBitmap<kMinPageSize>;
 
 template<size_t kAlignment>
 std::ostream& operator << (std::ostream& stream, const SpaceBitmap<kAlignment>& bitmap);
diff --git a/runtime/gc/accounting/space_bitmap_test.cc b/runtime/gc/accounting/space_bitmap_test.cc
index 8fcf102..44229c9 100644
--- a/runtime/gc/accounting/space_bitmap_test.cc
+++ b/runtime/gc/accounting/space_bitmap_test.cc
@@ -19,28 +19,64 @@
 #include <stdint.h>
 #include <memory>
 
-#include "base/common_art_test.h"
 #include "base/mutex.h"
+#include "common_runtime_test.h"
+#include "gc/space/large_object_space.h"
 #include "runtime_globals.h"
 #include "space_bitmap-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace accounting {
 
-class SpaceBitmapTest : public CommonArtTest {};
+// SpaceBitmapTest is a CommonRuntimeTest as the test requires runtime to be initialized to enable
+// access to space::LargeObjectSpace::ObjectAlignment().
+template <typename T>
+class SpaceBitmapTest : public CommonRuntimeTest {};
 
-TEST_F(SpaceBitmapTest, Init) {
+// Main test parameters. For each test case, we pair together a SpaceBitmap
+// implementation with an object alignment. The object alignment may be larger
+// than the underlying SpaceBitmap alignment.
+template <typename T, size_t kAlignment>
+struct SpaceBitmapTestType {
+  using SpaceBitmap = T;
+  static constexpr size_t GetObjectAlignment() {
+    return kAlignment;
+  }
+};
+
+// This is a special case where object alignment is chosen to be the large-object
+// alignment determined at runtime.
+template <typename T>
+struct SpaceBitmapTestPageSizeType {
+  using SpaceBitmap = T;
+  static size_t GetObjectAlignment() {
+    return space::LargeObjectSpace::ObjectAlignment();
+  }
+};
+
+using SpaceBitmapTestTypes =
+    ::testing::Types<SpaceBitmapTestType<ContinuousSpaceBitmap, kObjectAlignment>,
+                     // Large objects are aligned to the OS page size, try
+                     // different supported values, including the current
+                     // runtime page size.
+                     SpaceBitmapTestType<LargeObjectBitmap, kMinPageSize>,
+                     SpaceBitmapTestPageSizeType<LargeObjectBitmap>,
+                     SpaceBitmapTestType<LargeObjectBitmap, kMaxPageSize>>;
+
+TYPED_TEST_CASE(SpaceBitmapTest, SpaceBitmapTestTypes);
+
+TYPED_TEST(SpaceBitmapTest, Init) {
   uint8_t* heap_begin = reinterpret_cast<uint8_t*>(0x10000000);
   size_t heap_capacity = 16 * MB;
-  ContinuousSpaceBitmap space_bitmap(
-      ContinuousSpaceBitmap::Create("test bitmap", heap_begin, heap_capacity));
+  auto space_bitmap(TypeParam::SpaceBitmap::Create("test bitmap", heap_begin, heap_capacity));
   EXPECT_TRUE(space_bitmap.IsValid());
 }
 
+template <typename SpaceBitmap>
 class BitmapVerify {
  public:
-  BitmapVerify(ContinuousSpaceBitmap* bitmap, const mirror::Object* begin,
+  BitmapVerify(SpaceBitmap* bitmap, const mirror::Object* begin,
                const mirror::Object* end)
     : bitmap_(bitmap),
       begin_(begin),
@@ -52,23 +88,23 @@
     EXPECT_EQ(bitmap_->Test(obj), ((reinterpret_cast<uintptr_t>(obj) & 0xF) != 0));
   }
 
-  ContinuousSpaceBitmap* const bitmap_;
+  SpaceBitmap* const bitmap_;
   const mirror::Object* begin_;
   const mirror::Object* end_;
 };
 
-TEST_F(SpaceBitmapTest, ScanRange) {
+TYPED_TEST(SpaceBitmapTest, ScanRange) {
   uint8_t* heap_begin = reinterpret_cast<uint8_t*>(0x10000000);
   size_t heap_capacity = 16 * MB;
+  const size_t gObjectAlignment = TypeParam::GetObjectAlignment();
 
-  ContinuousSpaceBitmap space_bitmap(
-      ContinuousSpaceBitmap::Create("test bitmap", heap_begin, heap_capacity));
+  auto space_bitmap(TypeParam::SpaceBitmap::Create("test bitmap", heap_begin, heap_capacity));
   EXPECT_TRUE(space_bitmap.IsValid());
 
   // Set all the odd bits in the first BitsPerIntPtrT * 3 to one.
   for (size_t j = 0; j < kBitsPerIntPtrT * 3; ++j) {
     const mirror::Object* obj =
-        reinterpret_cast<mirror::Object*>(heap_begin + j * kObjectAlignment);
+        reinterpret_cast<mirror::Object*>(heap_begin + j * gObjectAlignment);
     if (reinterpret_cast<uintptr_t>(obj) & 0xF) {
       space_bitmap.Set(obj);
     }
@@ -79,35 +115,37 @@
   // words.
   for (size_t i = 0; i < static_cast<size_t>(kBitsPerIntPtrT); ++i) {
     mirror::Object* start =
-        reinterpret_cast<mirror::Object*>(heap_begin + i * kObjectAlignment);
+        reinterpret_cast<mirror::Object*>(heap_begin + i * gObjectAlignment);
     for (size_t j = 0; j < static_cast<size_t>(kBitsPerIntPtrT * 2); ++j) {
       mirror::Object* end =
-          reinterpret_cast<mirror::Object*>(heap_begin + (i + j) * kObjectAlignment);
+          reinterpret_cast<mirror::Object*>(heap_begin + (i + j) * gObjectAlignment);
       BitmapVerify(&space_bitmap, start, end);
     }
   }
 }
 
-TEST_F(SpaceBitmapTest, ClearRange) {
+TYPED_TEST(SpaceBitmapTest, ClearRange) {
+  const size_t page_size = MemMap::GetPageSize();
   uint8_t* heap_begin = reinterpret_cast<uint8_t*>(0x10000000);
   size_t heap_capacity = 16 * MB;
+  const size_t gObjectAlignment = TypeParam::GetObjectAlignment();
 
-  ContinuousSpaceBitmap bitmap(
-      ContinuousSpaceBitmap::Create("test bitmap", heap_begin, heap_capacity));
+  auto bitmap(TypeParam::SpaceBitmap::Create("test bitmap", heap_begin, heap_capacity));
   EXPECT_TRUE(bitmap.IsValid());
 
   // Set all of the bits in the bitmap.
-  for (size_t j = 0; j < heap_capacity; j += kObjectAlignment) {
+  for (size_t j = 0; j < heap_capacity; j += gObjectAlignment) {
     const mirror::Object* obj = reinterpret_cast<mirror::Object*>(heap_begin + j);
     bitmap.Set(obj);
   }
 
   std::vector<std::pair<uintptr_t, uintptr_t>> ranges = {
-      {0, 10 * KB + kObjectAlignment},
-      {kObjectAlignment, kObjectAlignment},
-      {kObjectAlignment, 2 * kObjectAlignment},
-      {kObjectAlignment, 5 * kObjectAlignment},
-      {1 * KB + kObjectAlignment, 2 * KB + 5 * kObjectAlignment},
+      {0, RoundUp(10 * KB, gObjectAlignment) + gObjectAlignment},
+      {gObjectAlignment, gObjectAlignment},
+      {gObjectAlignment, 2 * gObjectAlignment},
+      {gObjectAlignment, 5 * gObjectAlignment},
+      {RoundUp(1 * KB, gObjectAlignment) + gObjectAlignment,
+       RoundUp(2 * KB, gObjectAlignment) + 5 * gObjectAlignment},
   };
   // Try clearing a few ranges.
   for (const std::pair<uintptr_t, uintptr_t>& range : ranges) {
@@ -115,14 +153,14 @@
     const mirror::Object* obj_end = reinterpret_cast<mirror::Object*>(heap_begin + range.second);
     bitmap.ClearRange(obj_begin, obj_end);
     // Boundaries should still be marked.
-    for (uintptr_t i = 0; i < range.first; i += kObjectAlignment) {
+    for (uintptr_t i = 0; i < range.first; i += gObjectAlignment) {
       EXPECT_TRUE(bitmap.Test(reinterpret_cast<mirror::Object*>(heap_begin + i)));
     }
-    for (uintptr_t i = range.second; i < range.second + kPageSize; i += kObjectAlignment) {
+    for (uintptr_t i = range.second; i < range.second + page_size; i += gObjectAlignment) {
       EXPECT_TRUE(bitmap.Test(reinterpret_cast<mirror::Object*>(heap_begin + i)));
     }
     // Everything inside should be cleared.
-    for (uintptr_t i = range.first; i < range.second; i += kObjectAlignment) {
+    for (uintptr_t i = range.first; i < range.second; i += gObjectAlignment) {
       EXPECT_FALSE(bitmap.Test(reinterpret_cast<mirror::Object*>(heap_begin + i)));
       bitmap.Set(reinterpret_cast<mirror::Object*>(heap_begin + i));
     }
@@ -134,9 +172,7 @@
  public:
   explicit SimpleCounter(size_t* counter) : count_(counter) {}
 
-  void operator()(mirror::Object* obj ATTRIBUTE_UNUSED) const {
-    (*count_)++;
-  }
+  void operator()([[maybe_unused]] mirror::Object* obj) const { (*count_)++; }
 
   size_t* const count_;
 };
@@ -153,8 +189,8 @@
   uint32_t val_;
 };
 
-template <size_t kAlignment, typename TestFn>
-static void RunTest(TestFn&& fn) NO_THREAD_SAFETY_ANALYSIS {
+template <typename SpaceBitmap, typename TestFn>
+static void RunTest(size_t alignment, TestFn&& fn) NO_THREAD_SAFETY_ANALYSIS {
   uint8_t* heap_begin = reinterpret_cast<uint8_t*>(0x10000000);
   size_t heap_capacity = 16 * MB;
 
@@ -162,11 +198,10 @@
   RandGen r(0x1234);
 
   for (int i = 0; i < 5 ; ++i) {
-    ContinuousSpaceBitmap space_bitmap(
-        ContinuousSpaceBitmap::Create("test bitmap", heap_begin, heap_capacity));
+    SpaceBitmap space_bitmap(SpaceBitmap::Create("test bitmap", heap_begin, heap_capacity));
 
     for (int j = 0; j < 10000; ++j) {
-      size_t offset = RoundDown(r.next() % heap_capacity, kAlignment);
+      size_t offset = RoundDown(r.next() % heap_capacity, alignment);
       bool set = r.next() % 2 == 1;
 
       if (set) {
@@ -177,12 +212,12 @@
     }
 
     for (int j = 0; j < 50; ++j) {
-      const size_t offset = RoundDown(r.next() % heap_capacity, kAlignment);
+      const size_t offset = RoundDown(r.next() % heap_capacity, alignment);
       const size_t remain = heap_capacity - offset;
-      const size_t end = offset + RoundDown(r.next() % (remain + 1), kAlignment);
+      const size_t end = offset + RoundDown(r.next() % (remain + 1), alignment);
 
       size_t manual = 0;
-      for (uintptr_t k = offset; k < end; k += kAlignment) {
+      for (uintptr_t k = offset; k < end; k += alignment) {
         if (space_bitmap.Test(reinterpret_cast<mirror::Object*>(heap_begin + k))) {
           manual++;
         }
@@ -196,33 +231,23 @@
   }
 }
 
-template <size_t kAlignment>
-static void RunTestCount() {
-  auto count_test_fn = [](ContinuousSpaceBitmap* space_bitmap,
+TYPED_TEST(SpaceBitmapTest, VisitorAlignment) {
+  using SpaceBitmap = typename TypeParam::SpaceBitmap;
+  auto count_test_fn = [](SpaceBitmap* space_bitmap,
                           uintptr_t range_begin,
                           uintptr_t range_end,
                           size_t manual_count) {
     size_t count = 0;
-    auto count_fn = [&count](mirror::Object* obj ATTRIBUTE_UNUSED) {
-      count++;
-    };
+    auto count_fn = [&count]([[maybe_unused]] mirror::Object* obj) { count++; };
     space_bitmap->VisitMarkedRange(range_begin, range_end, count_fn);
     EXPECT_EQ(count, manual_count);
   };
-  RunTest<kAlignment>(count_test_fn);
+  RunTest<SpaceBitmap>(TypeParam::GetObjectAlignment(), count_test_fn);
 }
 
-TEST_F(SpaceBitmapTest, VisitorObjectAlignment) {
-  RunTestCount<kObjectAlignment>();
-}
-
-TEST_F(SpaceBitmapTest, VisitorPageAlignment) {
-  RunTestCount<kPageSize>();
-}
-
-template <size_t kAlignment>
-void RunTestOrder() {
-  auto order_test_fn = [](ContinuousSpaceBitmap* space_bitmap,
+TYPED_TEST(SpaceBitmapTest, OrderAlignment) {
+  using SpaceBitmap = typename TypeParam::SpaceBitmap;
+  auto order_test_fn = [](SpaceBitmap* space_bitmap,
                           uintptr_t range_begin,
                           uintptr_t range_end,
                           size_t manual_count)
@@ -246,15 +271,7 @@
       EXPECT_NE(nullptr, last_ptr);
     }
   };
-  RunTest<kAlignment>(order_test_fn);
-}
-
-TEST_F(SpaceBitmapTest, OrderObjectAlignment) {
-  RunTestOrder<kObjectAlignment>();
-}
-
-TEST_F(SpaceBitmapTest, OrderPageAlignment) {
-  RunTestOrder<kPageSize>();
+  RunTest<SpaceBitmap>(TypeParam::GetObjectAlignment(), order_test_fn);
 }
 
 }  // namespace accounting
diff --git a/runtime/gc/allocation_listener.h b/runtime/gc/allocation_listener.h
index 376b524..15daab2 100644
--- a/runtime/gc/allocation_listener.h
+++ b/runtime/gc/allocation_listener.h
@@ -26,7 +26,7 @@
 #include "handle.h"
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Class;
@@ -54,9 +54,9 @@
   // PreObjectAlloc and the newly allocated object being visible to heap-walks.
   //
   // This can also be used to make any last-minute changes to the type or size of the allocation.
-  virtual void PreObjectAllocated(Thread* self ATTRIBUTE_UNUSED,
-                                  MutableHandle<mirror::Class> type ATTRIBUTE_UNUSED,
-                                  size_t* byte_count ATTRIBUTE_UNUSED)
+  virtual void PreObjectAllocated([[maybe_unused]] Thread* self,
+                                  [[maybe_unused]] MutableHandle<mirror::Class> type,
+                                  [[maybe_unused]] size_t* byte_count)
       REQUIRES(!Roles::uninterruptible_) REQUIRES_SHARED(Locks::mutator_lock_) {}
   // Fast check if we want to get the PreObjectAllocated callback, to avoid the expense of creating
   // handles. Defaults to false.
diff --git a/runtime/gc/allocation_record.cc b/runtime/gc/allocation_record.cc
index f0d379f..f98edf4 100644
--- a/runtime/gc/allocation_record.cc
+++ b/runtime/gc/allocation_record.cc
@@ -27,7 +27,7 @@
 
 #include <android-base/properties.h>
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 int32_t AllocRecordStackTraceElement::ComputeLineNumber() const {
diff --git a/runtime/gc/allocation_record.h b/runtime/gc/allocation_record.h
index 8b4cc67..8273ea4 100644
--- a/runtime/gc/allocation_record.h
+++ b/runtime/gc/allocation_record.h
@@ -20,11 +20,12 @@
 #include <list>
 #include <memory>
 
+#include "base/macros.h"
 #include "base/mutex.h"
 #include "gc_root.h"
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtMethod;
 class IsMarkedVisitor;
@@ -215,11 +216,8 @@
 
   // Caller needs to check that it is enabled before calling since we read the stack trace before
   // checking the enabled boolean.
-  void RecordAllocation(Thread* self,
-                        ObjPtr<mirror::Object>* obj,
-                        size_t byte_count)
-      REQUIRES(!Locks::alloc_tracker_lock_)
-      REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void RecordAllocation(Thread* self, ObjPtr<mirror::Object>* obj, size_t byte_count)
+      REQUIRES(!Locks::alloc_tracker_lock_) REQUIRES_SHARED(Locks::mutator_lock_);
 
   static void SetAllocTrackingEnabled(bool enabled) REQUIRES(!Locks::alloc_tracker_lock_);
 
diff --git a/runtime/gc/allocator/art-dlmalloc.cc b/runtime/gc/allocator/art-dlmalloc.cc
index de0c85a..8673232 100644
--- a/runtime/gc/allocator/art-dlmalloc.cc
+++ b/runtime/gc/allocator/art-dlmalloc.cc
@@ -19,6 +19,7 @@
 #include <android-base/logging.h>
 
 #include "base/bit_utils.h"
+#include "gc/space/dlmalloc_space.h"
 
 // ART specific morecore implementation defined in space.cc.
 static void* art_heap_morecore(void* m, intptr_t increment);
@@ -57,50 +58,3 @@
   LOG(FATAL) << "Incorrect use of function '" << function << "' argument " << p
       << " not expected";
 }
-
-#include <sys/mman.h>
-
-#include "base/utils.h"
-#include "runtime_globals.h"
-
-extern "C" void DlmallocMadviseCallback(void* start, void* end, size_t used_bytes, void* arg) {
-  // Is this chunk in use?
-  if (used_bytes != 0) {
-    return;
-  }
-  // Do we have any whole pages to give back?
-  start = reinterpret_cast<void*>(art::RoundUp(reinterpret_cast<uintptr_t>(start), art::kPageSize));
-  end = reinterpret_cast<void*>(art::RoundDown(reinterpret_cast<uintptr_t>(end), art::kPageSize));
-  if (end > start) {
-    size_t length = reinterpret_cast<uint8_t*>(end) - reinterpret_cast<uint8_t*>(start);
-    int rc = madvise(start, length, MADV_DONTNEED);
-    if (UNLIKELY(rc != 0)) {
-      errno = rc;
-      PLOG(FATAL) << "madvise failed during heap trimming";
-    }
-    size_t* reclaimed = reinterpret_cast<size_t*>(arg);
-    *reclaimed += length;
-  }
-}
-
-extern "C" void DlmallocBytesAllocatedCallback(void* start ATTRIBUTE_UNUSED,
-                                               void* end ATTRIBUTE_UNUSED,
-                                               size_t used_bytes,
-                                               void* arg) {
-  if (used_bytes == 0) {
-    return;
-  }
-  size_t* bytes_allocated = reinterpret_cast<size_t*>(arg);
-  *bytes_allocated += used_bytes + sizeof(size_t);
-}
-
-extern "C" void DlmallocObjectsAllocatedCallback(void* start ATTRIBUTE_UNUSED,
-                                                 void* end ATTRIBUTE_UNUSED,
-                                                 size_t used_bytes,
-                                                 void* arg) {
-  if (used_bytes == 0) {
-    return;
-  }
-  size_t* objects_allocated = reinterpret_cast<size_t*>(arg);
-  ++(*objects_allocated);
-}
diff --git a/runtime/gc/allocator/art-dlmalloc.h b/runtime/gc/allocator/art-dlmalloc.h
index 296de72..cffde4d 100644
--- a/runtime/gc/allocator/art-dlmalloc.h
+++ b/runtime/gc/allocator/art-dlmalloc.h
@@ -36,26 +36,4 @@
 #include "dlmalloc.h"
 #pragma GCC diagnostic pop
 
-// Callback for dlmalloc_inspect_all or mspace_inspect_all that will madvise(2) unused
-// pages back to the kernel.
-extern "C" void DlmallocMadviseCallback(void* start, void* end, size_t used_bytes, void* /*arg*/);
-
-// Callbacks for dlmalloc_inspect_all or mspace_inspect_all that will
-// count the number of bytes allocated and objects allocated,
-// respectively.
-extern "C" void DlmallocBytesAllocatedCallback(void* start, void* end, size_t used_bytes, void* arg);
-extern "C" void DlmallocObjectsAllocatedCallback(void* start, void* end, size_t used_bytes, void* arg);
-
-namespace art {
-namespace gc {
-namespace allocator {
-
-// Callback from dlmalloc when it needs to increase the footprint. Must be implemented somewhere
-// else (currently dlmalloc_space.cc).
-void* ArtDlMallocMoreCore(void* mspace, intptr_t increment);
-
-}  // namespace allocator
-}  // namespace gc
-}  // namespace art
-
 #endif  // ART_RUNTIME_GC_ALLOCATOR_ART_DLMALLOC_H_
diff --git a/runtime/gc/allocator/rosalloc-inl.h b/runtime/gc/allocator/rosalloc-inl.h
index d1c81e3..3bbd296 100644
--- a/runtime/gc/allocator/rosalloc-inl.h
+++ b/runtime/gc/allocator/rosalloc-inl.h
@@ -19,7 +19,7 @@
 
 #include "rosalloc.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace allocator {
 
diff --git a/runtime/gc/allocator/rosalloc.cc b/runtime/gc/allocator/rosalloc.cc
index 320440d..03f52ee 100644
--- a/runtime/gc/allocator/rosalloc.cc
+++ b/runtime/gc/allocator/rosalloc.cc
@@ -34,7 +34,7 @@
 #include "thread-current-inl.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace allocator {
 
@@ -49,7 +49,7 @@
 size_t RosAlloc::numOfSlots[kNumOfSizeBrackets];
 size_t RosAlloc::headerSizes[kNumOfSizeBrackets];
 bool RosAlloc::initialized_ = false;
-size_t RosAlloc::dedicated_full_run_storage_[kPageSize / sizeof(size_t)] = { 0 };
+size_t RosAlloc::dedicated_full_run_storage_[kMaxPageSize / sizeof(size_t)] = { 0 };
 RosAlloc::Run* RosAlloc::dedicated_full_run_ =
     reinterpret_cast<RosAlloc::Run*>(dedicated_full_run_storage_);
 
@@ -63,11 +63,11 @@
       page_release_mode_(page_release_mode),
       page_release_size_threshold_(page_release_size_threshold),
       is_running_on_memory_tool_(running_on_memory_tool) {
-  DCHECK_ALIGNED(base, kPageSize);
-  DCHECK_EQ(RoundUp(capacity, kPageSize), capacity);
-  DCHECK_EQ(RoundUp(max_capacity, kPageSize), max_capacity);
+  DCHECK_ALIGNED_PARAM(base, gPageSize);
+  DCHECK_EQ(RoundUp(capacity, gPageSize), capacity);
+  DCHECK_EQ(RoundUp(max_capacity, gPageSize), max_capacity);
   CHECK_LE(capacity, max_capacity);
-  CHECK_ALIGNED(page_release_size_threshold_, kPageSize);
+  CHECK_ALIGNED_PARAM(page_release_size_threshold_, gPageSize);
   // Zero the memory explicitly (don't rely on that the mem map is zero-initialized).
   if (!kMadviseZeroes) {
     memset(base_, 0, max_capacity);
@@ -88,11 +88,11 @@
     current_runs_[i] = dedicated_full_run_;
   }
   DCHECK_EQ(footprint_, capacity_);
-  size_t num_of_pages = footprint_ / kPageSize;
-  size_t max_num_of_pages = max_capacity_ / kPageSize;
+  size_t num_of_pages = DivideByPageSize(footprint_);
+  size_t max_num_of_pages = DivideByPageSize(max_capacity_);
   std::string error_msg;
   page_map_mem_map_ = MemMap::MapAnonymous("rosalloc page map",
-                                           RoundUp(max_num_of_pages, kPageSize),
+                                           RoundUp(max_num_of_pages, gPageSize),
                                            PROT_READ | PROT_WRITE,
                                            /*low_4gb=*/ false,
                                            &error_msg);
@@ -106,7 +106,7 @@
     free_pages->magic_num_ = kMagicNumFree;
   }
   free_pages->SetByteSize(this, capacity_);
-  DCHECK_EQ(capacity_ % kPageSize, static_cast<size_t>(0));
+  DCHECK_EQ(ModuloPageSize(capacity_), static_cast<size_t>(0));
   DCHECK(free_pages->IsFree());
   free_pages->ReleasePages(this);
   DCHECK(free_pages->IsFree());
@@ -131,13 +131,13 @@
   lock_.AssertHeld(self);
   DCHECK(page_map_type == kPageMapRun || page_map_type == kPageMapLargeObject);
   FreePageRun* res = nullptr;
-  const size_t req_byte_size = num_pages * kPageSize;
+  const size_t req_byte_size = num_pages * gPageSize;
   // Find the lowest address free page run that's large enough.
   for (auto it = free_page_runs_.begin(); it != free_page_runs_.end(); ) {
     FreePageRun* fpr = *it;
     DCHECK(fpr->IsFree());
     size_t fpr_byte_size = fpr->ByteSize(this);
-    DCHECK_EQ(fpr_byte_size % kPageSize, static_cast<size_t>(0));
+    DCHECK_EQ(ModuloPageSize(fpr_byte_size), static_cast<size_t>(0));
     if (req_byte_size <= fpr_byte_size) {
       // Found one.
       it = free_page_runs_.erase(it);
@@ -154,7 +154,7 @@
           remainder->magic_num_ = kMagicNumFree;
         }
         remainder->SetByteSize(this, fpr_byte_size - req_byte_size);
-        DCHECK_EQ(remainder->ByteSize(this) % kPageSize, static_cast<size_t>(0));
+        DCHECK_EQ(ModuloPageSize(remainder->ByteSize(this)), static_cast<size_t>(0));
         // Don't need to call madvise on remainder here.
         free_page_runs_.insert(remainder);
         if (kTraceRosAlloc) {
@@ -163,7 +163,7 @@
                     << " into free_page_runs_";
         }
         fpr->SetByteSize(this, req_byte_size);
-        DCHECK_EQ(fpr->ByteSize(this) % kPageSize, static_cast<size_t>(0));
+        DCHECK_EQ(ModuloPageSize(fpr->ByteSize(this)), static_cast<size_t>(0));
       }
       res = fpr;
       break;
@@ -191,9 +191,9 @@
       // If we grow the heap, we can allocate it.
       size_t increment = std::min(std::max(2 * MB, req_byte_size - last_free_page_run_size),
                                   capacity_ - footprint_);
-      DCHECK_EQ(increment % kPageSize, static_cast<size_t>(0));
+      DCHECK_EQ(ModuloPageSize(increment), static_cast<size_t>(0));
       size_t new_footprint = footprint_ + increment;
-      size_t new_num_of_pages = new_footprint / kPageSize;
+      size_t new_num_of_pages = DivideByPageSize(new_footprint);
       DCHECK_LT(page_map_size_, new_num_of_pages);
       DCHECK_LT(free_page_run_size_map_.size(), new_num_of_pages);
       page_map_size_ = new_num_of_pages;
@@ -204,7 +204,7 @@
         // There was a free page run at the end. Expand its size.
         DCHECK_EQ(last_free_page_run_size, last_free_page_run->ByteSize(this));
         last_free_page_run->SetByteSize(this, last_free_page_run_size + increment);
-        DCHECK_EQ(last_free_page_run->ByteSize(this) % kPageSize, static_cast<size_t>(0));
+        DCHECK_EQ(ModuloPageSize(last_free_page_run->ByteSize(this)), static_cast<size_t>(0));
         DCHECK_EQ(last_free_page_run->End(this), base_ + new_footprint);
       } else {
         // Otherwise, insert a new free page run at the end.
@@ -213,7 +213,7 @@
           new_free_page_run->magic_num_ = kMagicNumFree;
         }
         new_free_page_run->SetByteSize(this, increment);
-        DCHECK_EQ(new_free_page_run->ByteSize(this) % kPageSize, static_cast<size_t>(0));
+        DCHECK_EQ(ModuloPageSize(new_free_page_run->ByteSize(this)), static_cast<size_t>(0));
         free_page_runs_.insert(new_free_page_run);
         DCHECK_EQ(*free_page_runs_.rbegin(), new_free_page_run);
         if (kTraceRosAlloc) {
@@ -238,7 +238,7 @@
         DCHECK_EQ(last_free_page_run, fpr);
       }
       size_t fpr_byte_size = fpr->ByteSize(this);
-      DCHECK_EQ(fpr_byte_size % kPageSize, static_cast<size_t>(0));
+      DCHECK_EQ(ModuloPageSize(fpr_byte_size), static_cast<size_t>(0));
       DCHECK_LE(req_byte_size, fpr_byte_size);
       free_page_runs_.erase(fpr);
       if (kTraceRosAlloc) {
@@ -252,7 +252,7 @@
           remainder->magic_num_ = kMagicNumFree;
         }
         remainder->SetByteSize(this, fpr_byte_size - req_byte_size);
-        DCHECK_EQ(remainder->ByteSize(this) % kPageSize, static_cast<size_t>(0));
+        DCHECK_EQ(ModuloPageSize(remainder->ByteSize(this)), static_cast<size_t>(0));
         free_page_runs_.insert(remainder);
         if (kTraceRosAlloc) {
           LOG(INFO) << "RosAlloc::AllocPages() : Inserted run 0x" << std::hex
@@ -260,7 +260,7 @@
                     << " into free_page_runs_";
         }
         fpr->SetByteSize(this, req_byte_size);
-        DCHECK_EQ(fpr->ByteSize(this) % kPageSize, static_cast<size_t>(0));
+        DCHECK_EQ(ModuloPageSize(fpr->ByteSize(this)), static_cast<size_t>(0));
       }
       res = fpr;
     }
@@ -290,12 +290,12 @@
     }
     if (kIsDebugBuild) {
       // Clear the first page since it is not madvised due to the magic number.
-      memset(res, 0, kPageSize);
+      memset(res, 0, gPageSize);
     }
     if (kTraceRosAlloc) {
       LOG(INFO) << "RosAlloc::AllocPages() : 0x" << std::hex << reinterpret_cast<intptr_t>(res)
-                << "-0x" << (reinterpret_cast<intptr_t>(res) + num_pages * kPageSize)
-                << "(" << std::dec << (num_pages * kPageSize) << ")";
+                << "-0x" << (reinterpret_cast<intptr_t>(res) + num_pages * gPageSize)
+                << "(" << std::dec << (num_pages * gPageSize) << ")";
     }
     return res;
   }
@@ -337,7 +337,7 @@
     num_pages++;
     idx++;
   }
-  const size_t byte_size = num_pages * kPageSize;
+  const size_t byte_size = num_pages * gPageSize;
   if (already_zero) {
     if (ShouldCheckZeroMemory()) {
       const uintptr_t* word_ptr = reinterpret_cast<uintptr_t*>(ptr);
@@ -352,7 +352,7 @@
   if (kTraceRosAlloc) {
     LOG(INFO) << __PRETTY_FUNCTION__ << " : 0x" << std::hex << reinterpret_cast<intptr_t>(ptr)
               << "-0x" << (reinterpret_cast<intptr_t>(ptr) + byte_size)
-              << "(" << std::dec << (num_pages * kPageSize) << ")";
+              << "(" << std::dec << (num_pages * gPageSize) << ")";
   }
 
   // Turn it into a free run.
@@ -361,7 +361,7 @@
     fpr->magic_num_ = kMagicNumFree;
   }
   fpr->SetByteSize(this, byte_size);
-  DCHECK_ALIGNED(fpr->ByteSize(this), kPageSize);
+  DCHECK_ALIGNED_PARAM(fpr->ByteSize(this), gPageSize);
 
   DCHECK(free_page_runs_.find(fpr) == free_page_runs_.end());
   if (!free_page_runs_.empty()) {
@@ -374,7 +374,7 @@
     }
     for (auto it = free_page_runs_.upper_bound(fpr); it != free_page_runs_.end(); ) {
       FreePageRun* h = *it;
-      DCHECK_EQ(h->ByteSize(this) % kPageSize, static_cast<size_t>(0));
+      DCHECK_EQ(ModuloPageSize(h->ByteSize(this)), static_cast<size_t>(0));
       if (kTraceRosAlloc) {
         LOG(INFO) << "RosAlloc::FreePages() : trying to coalesce with a higher free page run 0x"
                   << std::hex << reinterpret_cast<uintptr_t>(h) << " [" << std::dec << ToPageMapIndex(h) << "] -0x"
@@ -396,7 +396,7 @@
                     << " from free_page_runs_";
         }
         fpr->SetByteSize(this, fpr->ByteSize(this) + h->ByteSize(this));
-        DCHECK_EQ(fpr->ByteSize(this) % kPageSize, static_cast<size_t>(0));
+        DCHECK_EQ(ModuloPageSize(fpr->ByteSize(this)), static_cast<size_t>(0));
       } else {
         // Not adjacent. Stop.
         if (kTraceRosAlloc) {
@@ -410,7 +410,7 @@
       --it;
 
       FreePageRun* l = *it;
-      DCHECK_EQ(l->ByteSize(this) % kPageSize, static_cast<size_t>(0));
+      DCHECK_EQ(ModuloPageSize(l->ByteSize(this)), static_cast<size_t>(0));
       if (kTraceRosAlloc) {
         LOG(INFO) << "RosAlloc::FreePages() : trying to coalesce with a lower free page run 0x"
                   << std::hex << reinterpret_cast<uintptr_t>(l) << " [" << std::dec << ToPageMapIndex(l) << "] -0x"
@@ -428,7 +428,7 @@
                     << " from free_page_runs_";
         }
         l->SetByteSize(this, l->ByteSize(this) + fpr->ByteSize(this));
-        DCHECK_EQ(l->ByteSize(this) % kPageSize, static_cast<size_t>(0));
+        DCHECK_EQ(ModuloPageSize(l->ByteSize(this)), static_cast<size_t>(0));
         // Clear magic num since this is no longer the start of a free page run.
         if (kIsDebugBuild) {
           fpr->magic_num_ = 0;
@@ -445,7 +445,7 @@
   }
 
   // Insert it.
-  DCHECK_EQ(fpr->ByteSize(this) % kPageSize, static_cast<size_t>(0));
+  DCHECK_EQ(ModuloPageSize(fpr->ByteSize(this)), static_cast<size_t>(0));
   DCHECK(free_page_runs_.find(fpr) == free_page_runs_.end());
   DCHECK(fpr->IsFree());
   fpr->ReleasePages(this);
@@ -464,7 +464,7 @@
   DCHECK(bytes_allocated != nullptr);
   DCHECK(usable_size != nullptr);
   DCHECK_GT(size, kLargeSizeThreshold);
-  size_t num_pages = RoundUp(size, kPageSize) / kPageSize;
+  size_t num_pages = DivideByPageSize(RoundUp(size, gPageSize));
   void* r;
   {
     MutexLock mu(self, lock_);
@@ -476,14 +476,14 @@
     }
     return nullptr;
   }
-  const size_t total_bytes = num_pages * kPageSize;
+  const size_t total_bytes = num_pages * gPageSize;
   *bytes_allocated = total_bytes;
   *usable_size = total_bytes;
   *bytes_tl_bulk_allocated = total_bytes;
   if (kTraceRosAlloc) {
     LOG(INFO) << "RosAlloc::AllocLargeObject() : 0x" << std::hex << reinterpret_cast<intptr_t>(r)
-              << "-0x" << (reinterpret_cast<intptr_t>(r) + num_pages * kPageSize)
-              << "(" << std::dec << (num_pages * kPageSize) << ")";
+              << "-0x" << (reinterpret_cast<intptr_t>(r) + num_pages * gPageSize)
+              << "(" << std::dec << (num_pages * gPageSize) << ")";
   }
   // Check if the returned memory is really all zero.
   if (ShouldCheckZeroMemory()) {
@@ -519,11 +519,11 @@
         // Find the beginning of the run.
         do {
           --pm_idx;
-          DCHECK_LT(pm_idx, capacity_ / kPageSize);
+          DCHECK_LT(pm_idx, DivideByPageSize(capacity_));
         } while (page_map_[pm_idx] != kPageMapRun);
         FALLTHROUGH_INTENDED;
       case kPageMapRun:
-        run = reinterpret_cast<Run*>(base_ + pm_idx * kPageSize);
+        run = reinterpret_cast<Run*>(base_ + pm_idx * gPageSize);
         DCHECK_EQ(run->magic_num_, kMagicNum);
         break;
       case kPageMapReleased:
@@ -950,7 +950,7 @@
   memset(this, 0, headerSizes[idx]);
   // Check that the entire run is all zero.
   if (kIsDebugBuild) {
-    const size_t size = numOfPages[idx] * kPageSize;
+    const size_t size = numOfPages[idx] * gPageSize;
     const uintptr_t* word_ptr = reinterpret_cast<uintptr_t*>(this);
     for (size_t i = 0; i < size / sizeof(uintptr_t); ++i) {
       CHECK_EQ(word_ptr[i], 0U) << "words don't match at index " << i;
@@ -971,7 +971,7 @@
   size_t num_slots = numOfSlots[idx];
   size_t bracket_size = IndexToBracketSize(idx);
   DCHECK_EQ(slot_base + num_slots * bracket_size,
-            reinterpret_cast<uint8_t*>(this) + numOfPages[idx] * kPageSize);
+            reinterpret_cast<uint8_t*>(this) + numOfPages[idx] * gPageSize);
   // Free slots are on the free list and the allocated/used slots are not. We traverse the free list
   // to find out and record which slots are free in the is_free array.
   std::unique_ptr<bool[]> is_free(new bool[num_slots]());  // zero initialized
@@ -1037,15 +1037,15 @@
                   << ", page_map_entry=" << static_cast<int>(page_map_entry);
       }
       if (LIKELY(page_map_entry == kPageMapRun)) {
-        run = reinterpret_cast<Run*>(base_ + pm_idx * kPageSize);
+        run = reinterpret_cast<Run*>(base_ + pm_idx * gPageSize);
       } else if (LIKELY(page_map_entry == kPageMapRunPart)) {
         size_t pi = pm_idx;
         // Find the beginning of the run.
         do {
           --pi;
-          DCHECK_LT(pi, capacity_ / kPageSize);
+          DCHECK_LT(pi, DivideByPageSize(capacity_));
         } while (page_map_[pi] != kPageMapRun);
-        run = reinterpret_cast<Run*>(base_ + pi * kPageSize);
+        run = reinterpret_cast<Run*>(base_ + pi * gPageSize);
       } else if (page_map_entry == kPageMapLargeObject) {
         MutexLock mu(self, lock_);
         freed_bytes += FreePages(self, ptr, false);
@@ -1064,15 +1064,15 @@
                   << ", page_map_entry=" << static_cast<int>(page_map_entry);
       }
       if (LIKELY(page_map_entry == kPageMapRun)) {
-        run = reinterpret_cast<Run*>(base_ + pm_idx * kPageSize);
+        run = reinterpret_cast<Run*>(base_ + pm_idx * gPageSize);
       } else if (LIKELY(page_map_entry == kPageMapRunPart)) {
         size_t pi = pm_idx;
         // Find the beginning of the run.
         do {
           --pi;
-          DCHECK_LT(pi, capacity_ / kPageSize);
+          DCHECK_LT(pi, DivideByPageSize(capacity_));
         } while (page_map_[pi] != kPageMapRun);
-        run = reinterpret_cast<Run*>(base_ + pi * kPageSize);
+        run = reinterpret_cast<Run*>(base_ + pi * gPageSize);
       } else if (page_map_entry == kPageMapLargeObject) {
         freed_bytes += FreePages(self, ptr, false);
         continue;
@@ -1220,7 +1220,7 @@
       case kPageMapReleased:
         // Fall-through.
       case kPageMapEmpty: {
-        FreePageRun* fpr = reinterpret_cast<FreePageRun*>(base_ + i * kPageSize);
+        FreePageRun* fpr = reinterpret_cast<FreePageRun*>(base_ + i * gPageSize);
         if (free_page_runs_.find(fpr) != free_page_runs_.end()) {
           // Encountered a fresh free page run.
           DCHECK_EQ(remaining_curr_fpr_size, static_cast<size_t>(0));
@@ -1229,8 +1229,8 @@
           DCHECK_EQ(curr_fpr_size, static_cast<size_t>(0));
           curr_fpr = fpr;
           curr_fpr_size = fpr->ByteSize(this);
-          DCHECK_EQ(curr_fpr_size % kPageSize, static_cast<size_t>(0));
-          remaining_curr_fpr_size = curr_fpr_size - kPageSize;
+          DCHECK_EQ(ModuloPageSize(curr_fpr_size), static_cast<size_t>(0));
+          remaining_curr_fpr_size = curr_fpr_size - gPageSize;
           stream << "[" << i << "]=" << (pm == kPageMapReleased ? "Released" : "Empty")
                  << " (FPR start) fpr_size=" << curr_fpr_size
                  << " remaining_fpr_size=" << remaining_curr_fpr_size << std::endl;
@@ -1245,9 +1245,9 @@
           // Still part of the current free page run.
           DCHECK_NE(num_running_empty_pages, static_cast<size_t>(0));
           DCHECK(curr_fpr != nullptr && curr_fpr_size > 0 && remaining_curr_fpr_size > 0);
-          DCHECK_EQ(remaining_curr_fpr_size % kPageSize, static_cast<size_t>(0));
-          DCHECK_GE(remaining_curr_fpr_size, static_cast<size_t>(kPageSize));
-          remaining_curr_fpr_size -= kPageSize;
+          DCHECK_EQ(ModuloPageSize(remaining_curr_fpr_size), static_cast<size_t>(0));
+          DCHECK_GE(remaining_curr_fpr_size, static_cast<size_t>(gPageSize));
+          remaining_curr_fpr_size -= gPageSize;
           stream << "[" << i << "]=Empty (FPR part)"
                  << " remaining_fpr_size=" << remaining_curr_fpr_size << std::endl;
           if (remaining_curr_fpr_size == 0) {
@@ -1273,7 +1273,7 @@
       case kPageMapRun: {
         DCHECK_EQ(remaining_curr_fpr_size, static_cast<size_t>(0));
         num_running_empty_pages = 0;
-        Run* run = reinterpret_cast<Run*>(base_ + i * kPageSize);
+        Run* run = reinterpret_cast<Run*>(base_ + i * gPageSize);
         size_t idx = run->size_bracket_idx_;
         stream << "[" << i << "]=Run (start)"
                << " idx=" << idx
@@ -1316,7 +1316,7 @@
         num_pages++;
         idx++;
       }
-      return num_pages * kPageSize;
+      return num_pages * gPageSize;
     }
     case kPageMapLargeObjectPart:
       LOG(FATAL) << "Unreachable - " << __PRETTY_FUNCTION__ << ": pm_idx=" << pm_idx << ", ptr="
@@ -1327,10 +1327,10 @@
       // Find the beginning of the run.
       while (page_map_[pm_idx] != kPageMapRun) {
         pm_idx--;
-        DCHECK_LT(pm_idx, capacity_ / kPageSize);
+        DCHECK_LT(pm_idx, DivideByPageSize(capacity_));
       }
       DCHECK_EQ(page_map_[pm_idx], kPageMapRun);
-      Run* run = reinterpret_cast<Run*>(base_ + pm_idx * kPageSize);
+      Run* run = reinterpret_cast<Run*>(base_ + pm_idx * gPageSize);
       DCHECK_EQ(run->magic_num_, kMagicNum);
       size_t idx = run->size_bracket_idx_;
       size_t offset_from_slot_base = reinterpret_cast<const uint8_t*>(ptr)
@@ -1348,28 +1348,28 @@
 bool RosAlloc::Trim() {
   MutexLock mu(Thread::Current(), lock_);
   FreePageRun* last_free_page_run;
-  DCHECK_EQ(footprint_ % kPageSize, static_cast<size_t>(0));
+  DCHECK_EQ(ModuloPageSize(footprint_), static_cast<size_t>(0));
   auto it = free_page_runs_.rbegin();
   if (it != free_page_runs_.rend() && (last_free_page_run = *it)->End(this) == base_ + footprint_) {
     // Remove the last free page run, if any.
     DCHECK(last_free_page_run->IsFree());
     DCHECK(IsFreePage(ToPageMapIndex(last_free_page_run)));
-    DCHECK_EQ(last_free_page_run->ByteSize(this) % kPageSize, static_cast<size_t>(0));
+    DCHECK_EQ(ModuloPageSize(last_free_page_run->ByteSize(this)), static_cast<size_t>(0));
     DCHECK_EQ(last_free_page_run->End(this), base_ + footprint_);
     free_page_runs_.erase(last_free_page_run);
     size_t decrement = last_free_page_run->ByteSize(this);
     size_t new_footprint = footprint_ - decrement;
-    DCHECK_EQ(new_footprint % kPageSize, static_cast<size_t>(0));
-    size_t new_num_of_pages = new_footprint / kPageSize;
+    DCHECK_EQ(ModuloPageSize(new_footprint), static_cast<size_t>(0));
+    size_t new_num_of_pages = DivideByPageSize(new_footprint);
     DCHECK_GE(page_map_size_, new_num_of_pages);
     // Zero out the tail of the page map.
     uint8_t* zero_begin = const_cast<uint8_t*>(page_map_) + new_num_of_pages;
-    uint8_t* madvise_begin = AlignUp(zero_begin, kPageSize);
+    uint8_t* madvise_begin = AlignUp(zero_begin, gPageSize);
     DCHECK_LE(madvise_begin, page_map_mem_map_.End());
     size_t madvise_size = page_map_mem_map_.End() - madvise_begin;
     if (madvise_size > 0) {
-      DCHECK_ALIGNED(madvise_begin, kPageSize);
-      DCHECK_EQ(RoundUp(madvise_size, kPageSize), madvise_size);
+      DCHECK_ALIGNED_PARAM(madvise_begin, gPageSize);
+      DCHECK_EQ(RoundUp(madvise_size, gPageSize), madvise_size);
       if (!kMadviseZeroes) {
         memset(madvise_begin, 0, madvise_size);
       }
@@ -1410,25 +1410,25 @@
         // Fall-through.
       case kPageMapEmpty: {
         // The start of a free page run.
-        FreePageRun* fpr = reinterpret_cast<FreePageRun*>(base_ + i * kPageSize);
+        FreePageRun* fpr = reinterpret_cast<FreePageRun*>(base_ + i * gPageSize);
         DCHECK(free_page_runs_.find(fpr) != free_page_runs_.end());
         size_t fpr_size = fpr->ByteSize(this);
-        DCHECK_ALIGNED(fpr_size, kPageSize);
+        DCHECK_ALIGNED_PARAM(fpr_size, gPageSize);
         void* start = fpr;
         if (kIsDebugBuild) {
           // In the debug build, the first page of a free page run
           // contains a magic number for debugging. Exclude it.
-          start = reinterpret_cast<uint8_t*>(fpr) + kPageSize;
+          start = reinterpret_cast<uint8_t*>(fpr) + gPageSize;
         }
         void* end = reinterpret_cast<uint8_t*>(fpr) + fpr_size;
         handler(start, end, 0, arg);
-        size_t num_pages = fpr_size / kPageSize;
+        size_t num_pages = DivideByPageSize(fpr_size);
         if (kIsDebugBuild) {
           for (size_t j = i + 1; j < i + num_pages; ++j) {
             DCHECK(IsFreePage(j));
           }
         }
-        i += fpr_size / kPageSize;
+        i += DivideByPageSize(fpr_size);
         DCHECK_LE(i, pm_end);
         break;
       }
@@ -1440,9 +1440,9 @@
           num_pages++;
           idx++;
         }
-        void* start = base_ + i * kPageSize;
-        void* end = base_ + (i + num_pages) * kPageSize;
-        size_t used_bytes = num_pages * kPageSize;
+        void* start = base_ + i * gPageSize;
+        void* end = base_ + (i + num_pages) * gPageSize;
+        size_t used_bytes = num_pages * gPageSize;
         handler(start, end, used_bytes, arg);
         if (kIsDebugBuild) {
           for (size_t j = i + 1; j < i + num_pages; ++j) {
@@ -1458,7 +1458,7 @@
         UNREACHABLE();
       case kPageMapRun: {
         // The start of a run.
-        Run* run = reinterpret_cast<Run*>(base_ + i * kPageSize);
+        Run* run = reinterpret_cast<Run*>(base_ + i * gPageSize);
         DCHECK_EQ(run->magic_num_, kMagicNum);
         // The dedicated full run doesn't contain any real allocations, don't visit the slots in
         // there.
@@ -1495,7 +1495,7 @@
 
 void RosAlloc::SetFootprintLimit(size_t new_capacity) {
   MutexLock mu(Thread::Current(), lock_);
-  DCHECK_EQ(RoundUp(new_capacity, kPageSize), new_capacity);
+  DCHECK_EQ(RoundUp(new_capacity, gPageSize), new_capacity);
   // Only growing is supported here. But Trim() is supported.
   if (capacity_ < new_capacity) {
     CHECK_LE(new_capacity, max_capacity_);
@@ -1664,7 +1664,7 @@
   // Compute numOfSlots and slotOffsets.
   for (size_t i = 0; i < kNumOfSizeBrackets; i++) {
     size_t bracket_size = bracketSizes[i];
-    size_t run_size = kPageSize * numOfPages[i];
+    size_t run_size = gPageSize * numOfPages[i];
     size_t max_num_of_slots = run_size / bracket_size;
     // Compute the actual number of slots by taking the header and
     // alignment into account.
@@ -1720,8 +1720,10 @@
   DCHECK_EQ(kMaxRegularBracketSize, bracketSizes[kNumRegularSizeBrackets - 1]);
 }
 
-void RosAlloc::BytesAllocatedCallback(void* start ATTRIBUTE_UNUSED, void* end ATTRIBUTE_UNUSED,
-                                      size_t used_bytes, void* arg) {
+void RosAlloc::BytesAllocatedCallback([[maybe_unused]] void* start,
+                                      [[maybe_unused]] void* end,
+                                      size_t used_bytes,
+                                      void* arg) {
   if (used_bytes == 0) {
     return;
   }
@@ -1729,8 +1731,10 @@
   *bytes_allocated += used_bytes;
 }
 
-void RosAlloc::ObjectsAllocatedCallback(void* start ATTRIBUTE_UNUSED, void* end ATTRIBUTE_UNUSED,
-                                        size_t used_bytes, void* arg) {
+void RosAlloc::ObjectsAllocatedCallback([[maybe_unused]] void* start,
+                                        [[maybe_unused]] void* end,
+                                        size_t used_bytes,
+                                        void* arg) {
   if (used_bytes == 0) {
     return;
   }
@@ -1759,14 +1763,14 @@
           // Fall-through.
         case kPageMapEmpty: {
           // The start of a free page run.
-          FreePageRun* fpr = reinterpret_cast<FreePageRun*>(base_ + i * kPageSize);
+          FreePageRun* fpr = reinterpret_cast<FreePageRun*>(base_ + i * gPageSize);
           DCHECK_EQ(fpr->magic_num_, kMagicNumFree);
           CHECK(free_page_runs_.find(fpr) != free_page_runs_.end())
               << "An empty page must belong to the free page run set";
           size_t fpr_size = fpr->ByteSize(this);
-          CHECK_ALIGNED(fpr_size, kPageSize)
+          CHECK_ALIGNED_PARAM(fpr_size, gPageSize)
               << "A free page run size isn't page-aligned : " << fpr_size;
-          size_t num_pages = fpr_size / kPageSize;
+          size_t num_pages = DivideByPageSize(fpr_size);
           CHECK_GT(num_pages, static_cast<uintptr_t>(0))
               << "A free page run size must be > 0 : " << fpr_size;
           for (size_t j = i + 1; j < i + num_pages; ++j) {
@@ -1789,7 +1793,7 @@
             num_pages++;
             idx++;
           }
-          uint8_t* start = base_ + i * kPageSize;
+          uint8_t* start = base_ + i * gPageSize;
           if (is_running_on_memory_tool_) {
             start += ::art::gc::space::kDefaultMemoryToolRedZoneBytes;
           }
@@ -1797,9 +1801,9 @@
           size_t obj_size = obj->SizeOf();
           CHECK_GT(obj_size + memory_tool_modifier, kLargeSizeThreshold)
               << "A rosalloc large object size must be > " << kLargeSizeThreshold;
-          CHECK_EQ(num_pages, RoundUp(obj_size + memory_tool_modifier, kPageSize) / kPageSize)
+          CHECK_EQ(num_pages, DivideByPageSize(RoundUp(obj_size + memory_tool_modifier, gPageSize)))
               << "A rosalloc large object size " << obj_size + memory_tool_modifier
-              << " does not match the page map table " << (num_pages * kPageSize)
+              << " does not match the page map table " << (num_pages * gPageSize)
               << std::endl << DumpPageMap();
           i += num_pages;
           CHECK_LE(i, pm_end) << "Page map index " << i << " out of range < " << pm_end
@@ -1811,7 +1815,7 @@
           UNREACHABLE();
         case kPageMapRun: {
           // The start of a run.
-          Run* run = reinterpret_cast<Run*>(base_ + i * kPageSize);
+          Run* run = reinterpret_cast<Run*>(base_ + i * gPageSize);
           DCHECK_EQ(run->magic_num_, kMagicNum);
           size_t idx = run->size_bracket_idx_;
           CHECK_LT(idx, kNumOfSizeBrackets) << "Out of range size bracket index : " << idx;
@@ -1875,7 +1879,7 @@
   const size_t num_slots = numOfSlots[idx];
   size_t bracket_size = IndexToBracketSize(idx);
   CHECK_EQ(slot_base + num_slots * bracket_size,
-           reinterpret_cast<uint8_t*>(this) + numOfPages[idx] * kPageSize)
+           reinterpret_cast<uint8_t*>(this) + numOfPages[idx] * gPageSize)
       << "Mismatch in the end address of the run " << Dump();
   // Check that the bulk free list is empty. It's only used during BulkFree().
   CHECK(IsBulkFreeListEmpty()) << "The bulk free isn't empty " << Dump();
@@ -2002,17 +2006,17 @@
         if (IsFreePage(i)) {
           // Free page runs can start with a released page if we coalesced a released page free
           // page run with an empty page run.
-          FreePageRun* fpr = reinterpret_cast<FreePageRun*>(base_ + i * kPageSize);
+          FreePageRun* fpr = reinterpret_cast<FreePageRun*>(base_ + i * gPageSize);
           // There is a race condition where FreePage can coalesce fpr with the previous
           // free page run before we acquire lock_. In that case free_page_runs_.find will not find
           // a run starting at fpr. To handle this race, we skip reclaiming the page range and go
           // to the next page.
           if (free_page_runs_.find(fpr) != free_page_runs_.end()) {
             size_t fpr_size = fpr->ByteSize(this);
-            DCHECK_ALIGNED(fpr_size, kPageSize);
+            DCHECK_ALIGNED_PARAM(fpr_size, gPageSize);
             uint8_t* start = reinterpret_cast<uint8_t*>(fpr);
             reclaimed_bytes += ReleasePageRange(start, start + fpr_size);
-            size_t pages = fpr_size / kPageSize;
+            size_t pages = DivideByPageSize(fpr_size);
             CHECK_GT(pages, 0U) << "Infinite loop probable";
             i += pages;
             DCHECK_LE(i, page_map_size_);
@@ -2036,13 +2040,13 @@
 }
 
 size_t RosAlloc::ReleasePageRange(uint8_t* start, uint8_t* end) {
-  DCHECK_ALIGNED(start, kPageSize);
-  DCHECK_ALIGNED(end, kPageSize);
+  DCHECK_ALIGNED_PARAM(start, gPageSize);
+  DCHECK_ALIGNED_PARAM(end, gPageSize);
   DCHECK_LT(start, end);
   if (kIsDebugBuild) {
     // In the debug build, the first page of a free page run
     // contains a magic number for debugging. Exclude it.
-    start += kPageSize;
+    start += gPageSize;
 
     // Single pages won't be released.
     if (start == end) {
@@ -2057,12 +2061,12 @@
   size_t pm_idx = ToPageMapIndex(start);
   size_t reclaimed_bytes = 0;
   // Calculate reclaimed bytes and upate page map.
-  const size_t max_idx = pm_idx + (end - start) / kPageSize;
+  const size_t max_idx = pm_idx + DivideByPageSize(end - start);
   for (; pm_idx < max_idx; ++pm_idx) {
     DCHECK(IsFreePage(pm_idx));
     if (page_map_[pm_idx] == kPageMapEmpty) {
       // Mark the page as released and update how many bytes we released.
-      reclaimed_bytes += kPageSize;
+      reclaimed_bytes += gPageSize;
       page_map_[pm_idx] = kPageMapReleased;
     }
   }
@@ -2084,10 +2088,10 @@
   const char* new_buffer_msg = "";
   if (failed_alloc_bytes > kLargeSizeThreshold) {
     // Large allocation.
-    required_bytes = RoundUp(failed_alloc_bytes, kPageSize);
+    required_bytes = RoundUp(failed_alloc_bytes, gPageSize);
   } else {
     // Non-large allocation.
-    required_bytes = numOfPages[SizeToIndex(failed_alloc_bytes)] * kPageSize;
+    required_bytes = numOfPages[SizeToIndex(failed_alloc_bytes)] * gPageSize;
     new_buffer_msg = " for a new buffer";
   }
   if (required_bytes > largest_continuous_free_pages) {
@@ -2141,7 +2145,7 @@
                    << DumpPageMap();
         UNREACHABLE();
       case kPageMapRun: {
-        Run* run = reinterpret_cast<Run*>(base_ + i * kPageSize);
+        Run* run = reinterpret_cast<Run*>(base_ + i * gPageSize);
         size_t idx = run->size_bracket_idx_;
         size_t num_pages = numOfPages[idx];
         num_runs[idx]++;
@@ -2166,7 +2170,7 @@
     os << "Bracket " << i << " (" << bracketSizes[i] << "):"
        << " #runs=" << num_runs[i]
        << " #pages=" << num_pages_runs[i]
-       << " (" << PrettySize(num_pages_runs[i] * kPageSize) << ")"
+       << " (" << PrettySize(num_pages_runs[i] * gPageSize) << ")"
        << " #metadata_bytes=" << PrettySize(num_metadata_bytes[i])
        << " #slots=" << num_slots[i] << " (" << PrettySize(num_slots[i] * bracketSizes[i]) << ")"
        << " #used_slots=" << num_used_slots[i]
@@ -2174,7 +2178,7 @@
   }
   os << "Large #allocations=" << num_large_objects
      << " #pages=" << num_pages_large_objects
-     << " (" << PrettySize(num_pages_large_objects * kPageSize) << ")\n";
+     << " (" << PrettySize(num_pages_large_objects * gPageSize) << ")\n";
   size_t total_num_pages = 0;
   size_t total_metadata_bytes = 0;
   size_t total_allocated_bytes = 0;
@@ -2184,8 +2188,8 @@
     total_allocated_bytes += num_used_slots[i] * bracketSizes[i];
   }
   total_num_pages += num_pages_large_objects;
-  total_allocated_bytes += num_pages_large_objects * kPageSize;
-  os << "Total #total_bytes=" << PrettySize(total_num_pages * kPageSize)
+  total_allocated_bytes += num_pages_large_objects * gPageSize;
+  os << "Total #total_bytes=" << PrettySize(total_num_pages * gPageSize)
      << " #metadata_bytes=" << PrettySize(total_metadata_bytes)
      << " #used_bytes=" << PrettySize(total_allocated_bytes) << "\n";
   os << "\n";
diff --git a/runtime/gc/allocator/rosalloc.h b/runtime/gc/allocator/rosalloc.h
index 9a09c88..333f80f 100644
--- a/runtime/gc/allocator/rosalloc.h
+++ b/runtime/gc/allocator/rosalloc.h
@@ -30,12 +30,13 @@
 
 #include "base/allocator.h"
 #include "base/bit_utils.h"
+#include "base/macros.h"
 #include "base/mem_map.h"
 #include "base/mutex.h"
 #include "runtime_globals.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace gc {
 namespace allocator {
@@ -56,12 +57,12 @@
       size_t pm_idx = rosalloc->ToPageMapIndex(fpr_base);
       size_t byte_size = rosalloc->free_page_run_size_map_[pm_idx];
       DCHECK_GE(byte_size, static_cast<size_t>(0));
-      DCHECK_ALIGNED(byte_size, kPageSize);
+      DCHECK_ALIGNED_PARAM(byte_size, gPageSize);
       return byte_size;
     }
     void SetByteSize(RosAlloc* rosalloc, size_t byte_size)
         REQUIRES(rosalloc->lock_) {
-      DCHECK_EQ(byte_size % kPageSize, static_cast<size_t>(0));
+      DCHECK_EQ(ModuloPageSize(byte_size), static_cast<size_t>(0));
       uint8_t* fpr_base = reinterpret_cast<uint8_t*>(this);
       size_t pm_idx = rosalloc->ToPageMapIndex(fpr_base);
       rosalloc->free_page_run_size_map_[pm_idx] = byte_size;
@@ -102,7 +103,7 @@
     void ReleasePages(RosAlloc* rosalloc) REQUIRES(rosalloc->lock_) {
       uint8_t* start = reinterpret_cast<uint8_t*>(this);
       size_t byte_size = ByteSize(rosalloc);
-      DCHECK_EQ(byte_size % kPageSize, static_cast<size_t>(0));
+      DCHECK_EQ(ModuloPageSize(byte_size), static_cast<size_t>(0));
       if (ShouldReleasePages(rosalloc)) {
         rosalloc->ReleasePageRange(start, start + byte_size);
       }
@@ -303,7 +304,7 @@
     // The number of slots in the list. This is used to make it fast to check if a free list is all
     // free without traversing the whole free list.
     uint32_t size_;
-    uint32_t padding_ ATTRIBUTE_UNUSED;
+    [[maybe_unused]] uint32_t padding_;
     friend class RosAlloc;
   };
 
@@ -354,7 +355,7 @@
     uint8_t is_thread_local_;           // True if this run is used as a thread-local run.
     bool to_be_bulk_freed_;             // Used within BulkFree() to flag a run that's involved with
                                         // a bulk free.
-    uint32_t padding_ ATTRIBUTE_UNUSED;
+    [[maybe_unused]] uint32_t padding_;
     // Use a tailless free list for free_list_ so that the alloc fast path does not manage the tail.
     SlotFreeList<false> free_list_;
     SlotFreeList<true> bulk_free_list_;
@@ -390,7 +391,7 @@
       return &thread_local_free_list_;
     }
     void* End() {
-      return reinterpret_cast<uint8_t*>(this) + kPageSize * numOfPages[size_bracket_idx_];
+      return reinterpret_cast<uint8_t*>(this) + gPageSize * numOfPages[size_bracket_idx_];
     }
     void SetIsThreadLocal(bool is_thread_local) {
       is_thread_local_  = is_thread_local ? 1 : 0;
@@ -500,7 +501,7 @@
   // The numbers of pages that are used for runs for each size bracket.
   static size_t numOfPages[kNumOfSizeBrackets];
   // The numbers of slots of the runs for each size bracket.
-  static size_t numOfSlots[kNumOfSizeBrackets];
+  EXPORT static size_t numOfSlots[kNumOfSizeBrackets];
   // The header sizes in bytes of the runs for each size bracket.
   static size_t headerSizes[kNumOfSizeBrackets];
 
@@ -610,13 +611,13 @@
     DCHECK_LE(base_, addr);
     DCHECK_LT(addr, base_ + capacity_);
     size_t byte_offset = reinterpret_cast<const uint8_t*>(addr) - base_;
-    DCHECK_EQ(byte_offset % static_cast<size_t>(kPageSize), static_cast<size_t>(0));
-    return byte_offset / kPageSize;
+    DCHECK_EQ(ModuloPageSize(byte_offset), static_cast<size_t>(0));
+    return DivideByPageSize(byte_offset);
   }
   // Returns the page map index from an address with rounding.
   size_t RoundDownToPageMapIndex(const void* addr) const {
     DCHECK(base_ <= addr && addr < reinterpret_cast<uint8_t*>(base_) + capacity_);
-    return (reinterpret_cast<uintptr_t>(addr) - reinterpret_cast<uintptr_t>(base_)) / kPageSize;
+    return DivideByPageSize(reinterpret_cast<uintptr_t>(addr) - reinterpret_cast<uintptr_t>(base_));
   }
 
   // A memory allocation request larger than this size is treated as a large object and allocated
@@ -783,9 +784,11 @@
   size_t FreePages(Thread* self, void* ptr, bool already_zero) REQUIRES(lock_);
 
   // Allocate/free a run slot.
-  void* AllocFromRun(Thread* self, size_t size, size_t* bytes_allocated, size_t* usable_size,
-                     size_t* bytes_tl_bulk_allocated)
-      REQUIRES(!lock_);
+  EXPORT void* AllocFromRun(Thread* self,
+                            size_t size,
+                            size_t* bytes_allocated,
+                            size_t* usable_size,
+                            size_t* bytes_tl_bulk_allocated) REQUIRES(!lock_);
   // Allocate/free a run slot without acquiring locks.
   // TODO: REQUIRES(Locks::mutator_lock_)
   void* AllocFromRunThreadUnsafe(Thread* self, size_t size, size_t* bytes_allocated,
@@ -808,9 +811,11 @@
   size_t FreeInternal(Thread* self, void* ptr) REQUIRES(!lock_);
 
   // Allocates large objects.
-  void* AllocLargeObject(Thread* self, size_t size, size_t* bytes_allocated,
-                         size_t* usable_size, size_t* bytes_tl_bulk_allocated)
-      REQUIRES(!lock_);
+  EXPORT void* AllocLargeObject(Thread* self,
+                                size_t size,
+                                size_t* bytes_allocated,
+                                size_t* usable_size,
+                                size_t* bytes_tl_bulk_allocated) REQUIRES(!lock_);
 
   // Revoke a run by adding it to non_full_runs_ or freeing the pages.
   void RevokeRun(Thread* self, size_t idx, Run* run) REQUIRES(!lock_);
@@ -872,7 +877,7 @@
   // Returns the size of the allocated slot for a given size.
   size_t UsableSize(size_t bytes) {
     if (UNLIKELY(bytes > kLargeSizeThreshold)) {
-      return RoundUp(bytes, kPageSize);
+      return RoundUp(bytes, gPageSize);
     } else {
       return RoundToBracketSize(bytes);
     }
@@ -911,7 +916,7 @@
     return dedicated_full_run_;
   }
   bool IsFreePage(size_t idx) const {
-    DCHECK_LT(idx, capacity_ / kPageSize);
+    DCHECK_LT(idx, DivideByPageSize(capacity_));
     uint8_t pm_type = page_map_[idx];
     return pm_type == kPageMapReleased || pm_type == kPageMapEmpty;
   }
diff --git a/runtime/gc/allocator_type.h b/runtime/gc/allocator_type.h
index fb29837..7118886 100644
--- a/runtime/gc/allocator_type.h
+++ b/runtime/gc/allocator_type.h
@@ -19,7 +19,9 @@
 
 #include <iosfwd>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 namespace gc {
 
 // Different types of allocators.
diff --git a/runtime/gc/collector/concurrent_copying-inl.h b/runtime/gc/collector/concurrent_copying-inl.h
index 5a25166..a905e81 100644
--- a/runtime/gc/collector/concurrent_copying-inl.h
+++ b/runtime/gc/collector/concurrent_copying-inl.h
@@ -28,7 +28,7 @@
 #include "mirror/class.h"
 #include "mirror/object-readbarrier-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
diff --git a/runtime/gc/collector/concurrent_copying.cc b/runtime/gc/collector/concurrent_copying.cc
index 6af30fe..32a13f0 100644
--- a/runtime/gc/collector/concurrent_copying.cc
+++ b/runtime/gc/collector/concurrent_copying.cc
@@ -36,18 +36,18 @@
 #include "gc/space/image_space.h"
 #include "gc/space/space-inl.h"
 #include "gc/verification.h"
-#include "image-inl.h"
 #include "intern_table.h"
 #include "mirror/class-inl.h"
 #include "mirror/object-inl.h"
 #include "mirror/object-refvisitor-inl.h"
 #include "mirror/object_reference.h"
+#include "oat/image-inl.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread-inl.h"
 #include "thread_list.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
@@ -95,7 +95,6 @@
       region_space_bitmap_(nullptr),
       heap_mark_bitmap_(nullptr),
       live_stack_freeze_size_(0),
-      from_space_num_objects_at_first_pause_(0),
       from_space_num_bytes_at_first_pause_(0),
       mark_stack_mode_(kMarkStackModeOff),
       weak_ref_access_enabled_(true),
@@ -103,7 +102,6 @@
       gc_count_(0),
       reclaimed_bytes_ratio_sum_(0.f),
       cumulative_bytes_moved_(0),
-      cumulative_objects_moved_(0),
       skipped_blocks_lock_("concurrent copying bytes blocks lock", kMarkSweepMarkStackLock),
       measure_read_barrier_slow_path_(measure_read_barrier_slow_path),
       mark_from_read_barrier_measurements_(false),
@@ -137,7 +135,7 @@
     for (size_t i = 0; i < kMarkStackPoolSize; ++i) {
       accounting::AtomicStack<mirror::Object>* mark_stack =
           accounting::AtomicStack<mirror::Object>::Create(
-              "thread local mark stack", kMarkStackSize, kMarkStackSize);
+              "thread local mark stack", GetMarkStackSize(), GetMarkStackSize());
       pooled_mark_stacks_.push_back(mark_stack);
     }
   }
@@ -146,7 +144,7 @@
     std::string error_msg;
     sweep_array_free_buffer_mem_map_ = MemMap::MapAnonymous(
         "concurrent copying sweep array free buffer",
-        RoundUp(kSweepArrayChunkFreeSize * sizeof(mirror::Object*), kPageSize),
+        RoundUp(kSweepArrayChunkFreeSize * sizeof(mirror::Object*), gPageSize),
         PROT_READ | PROT_WRITE,
         /*low_4gb=*/ false,
         &error_msg);
@@ -205,6 +203,12 @@
           break;
         }
       } while (!field->CasWeakRelaxed(from_ref, to_ref));
+      // "Relaxed" is not technically sufficient by C++ rules. However, we use a "release"
+      // operation to originally store the forwarding pointer, or a constructor fence if we
+      // directly obtained to_ref from Copy(). We then count on the fact that all later accesses
+      // to the to_ref object are data/address-dependent on the forwarding pointer, and there is
+      // no reasonable way for the compiler to eliminate that depenency. This is very similar to
+      // the reasoning we must use for final fields in any case.
     }
   } else {
     // Used for preserving soft references, should be OK to not have a CAS here since there should be
@@ -300,7 +304,7 @@
   explicit ActivateReadBarrierEntrypointsCallback(ConcurrentCopying* concurrent_copying)
       : concurrent_copying_(concurrent_copying) {}
 
-  void Run(Thread* self ATTRIBUTE_UNUSED) override REQUIRES(Locks::thread_list_lock_) {
+  void Run([[maybe_unused]] Thread* self) override REQUIRES(Locks::thread_list_lock_) {
     // This needs to run under the thread_list_lock_ critical section in ThreadList::RunCheckpoint()
     // to avoid a race with ThreadList::Register().
     CHECK(!concurrent_copying_->is_using_read_barrier_entrypoints_);
@@ -391,7 +395,7 @@
           // It is OK to clear the bitmap with mutators running since the only place it is read is
           // VisitObjects which has exclusion with CC.
           region_space_bitmap_ = region_space_->GetMarkBitmap();
-          region_space_bitmap_->Clear();
+          region_space_bitmap_->Clear(ShouldEagerlyReleaseMemoryToOS());
         }
       }
     }
@@ -461,9 +465,9 @@
     LOG(INFO) << "GC end of InitializePhase";
   }
   if (use_generational_cc_ && !young_gen_) {
-    region_space_bitmap_->Clear();
+    region_space_bitmap_->Clear(ShouldEagerlyReleaseMemoryToOS());
   }
-  mark_stack_mode_.store(ConcurrentCopying::kMarkStackModeThreadLocal, std::memory_order_relaxed);
+  mark_stack_mode_.store(ConcurrentCopying::kMarkStackModeThreadLocal, std::memory_order_release);
   // Mark all of the zygote large objects without graying them.
   MarkZygoteLargeObjects();
 }
@@ -476,24 +480,14 @@
   }
 
   void Run(Thread* thread) override REQUIRES_SHARED(Locks::mutator_lock_) {
-    // Note: self is not necessarily equal to thread since thread may be suspended.
+    // We are either running this in the target thread, or the target thread will wait for us
+    // before switching back to runnable.
     Thread* self = Thread::Current();
     CHECK(thread == self || thread->GetState() != ThreadState::kRunnable)
         << thread->GetState() << " thread " << thread << " self " << self;
     thread->SetIsGcMarkingAndUpdateEntrypoints(true);
     if (use_tlab_ && thread->HasTlab()) {
-      // We should not reuse the partially utilized TLABs revoked here as they
-      // are going to be part of from-space.
-      if (ConcurrentCopying::kEnableFromSpaceAccountingCheck) {
-        // This must come before the revoke.
-        size_t thread_local_objects = thread->GetThreadLocalObjectsAllocated();
-        concurrent_copying_->region_space_->RevokeThreadLocalBuffers(thread, /*reuse=*/ false);
-        reinterpret_cast<Atomic<size_t>*>(
-            &concurrent_copying_->from_space_num_objects_at_first_pause_)->
-                fetch_add(thread_local_objects, std::memory_order_relaxed);
-      } else {
-        concurrent_copying_->region_space_->RevokeThreadLocalBuffers(thread, /*reuse=*/ false);
-      }
+      concurrent_copying_->region_space_->RevokeThreadLocalBuffers(thread, /*reuse=*/ false);
     }
     if (kUseThreadLocalAllocationStack) {
       thread->RevokeThreadLocalAllocationStack();
@@ -502,12 +496,11 @@
     // We can use the non-CAS VisitRoots functions below because we update thread-local GC roots
     // only.
     thread->VisitRoots(this, kVisitRootFlagAllRoots);
-    concurrent_copying_->GetBarrier().Pass(self);
   }
 
   void VisitRoots(mirror::Object*** roots,
                   size_t count,
-                  const RootInfo& info ATTRIBUTE_UNUSED) override
+                  [[maybe_unused]] const RootInfo& info) override
       REQUIRES_SHARED(Locks::mutator_lock_) {
     Thread* self = Thread::Current();
     for (size_t i = 0; i < count; ++i) {
@@ -524,7 +517,7 @@
 
   void VisitRoots(mirror::CompressedReference<mirror::Object>** roots,
                   size_t count,
-                  const RootInfo& info ATTRIBUTE_UNUSED) override
+                  [[maybe_unused]] const RootInfo& info) override
       REQUIRES_SHARED(Locks::mutator_lock_) {
     Thread* self = Thread::Current();
     for (size_t i = 0; i < count; ++i) {
@@ -580,7 +573,6 @@
     cc->SwapStacks();
     if (ConcurrentCopying::kEnableFromSpaceAccountingCheck) {
       cc->RecordLiveStackFreezeSize(self);
-      cc->from_space_num_objects_at_first_pause_ = cc->region_space_->GetObjectsAllocated();
       cc->from_space_num_bytes_at_first_pause_ = cc->region_space_->GetBytesAllocated();
     }
     cc->is_marking_ = true;
@@ -698,7 +690,7 @@
 
   void operator()(ObjPtr<mirror::Object> obj,
                   MemberOffset offset,
-                  bool is_static ATTRIBUTE_UNUSED) const
+                  [[maybe_unused]] bool is_static) const
       REQUIRES_SHARED(Locks::mutator_lock_) ALWAYS_INLINE {
     if (offset.Uint32Value() != mirror::Object::ClassOffset().Uint32Value()) {
      CheckReference(obj->GetFieldObject<mirror::Object, kDefaultVerifyFlags, kWithoutReadBarrier>(
@@ -772,19 +764,14 @@
   }
   Thread* self = Thread::Current();
   Locks::mutator_lock_->AssertNotHeld(self);
-  gc_barrier_->Init(self, 0);
   ThreadFlipVisitor thread_flip_visitor(this, heap_->use_tlab_);
   FlipCallback flip_callback(this);
 
-  size_t barrier_count = Runtime::Current()->GetThreadList()->FlipThreadRoots(
+  Runtime::Current()->GetThreadList()->FlipThreadRoots(
       &thread_flip_visitor, &flip_callback, this, GetHeap()->GetGcPauseListener());
 
-  {
-    ScopedThreadStateChange tsc(self, ThreadState::kWaitingForCheckPointsToRun);
-    gc_barrier_->Increment(self, barrier_count);
-  }
   is_asserting_to_space_invariant_ = true;
-  QuasiAtomic::ThreadFenceForConstructor();
+  QuasiAtomic::ThreadFenceForConstructor();  // TODO: Remove?
   if (kVerboseMode) {
     LOG(INFO) << "time=" << region_space_->Time();
     region_space_->DumpNonFreeRegions(LOG_STREAM(INFO));
@@ -952,7 +939,7 @@
 
   void VisitRoots(mirror::Object*** roots,
                   size_t count,
-                  const RootInfo& info ATTRIBUTE_UNUSED) override
+                  [[maybe_unused]] const RootInfo& info) override
       REQUIRES_SHARED(Locks::mutator_lock_) {
     for (size_t i = 0; i < count; ++i) {
       mirror::Object** root = roots[i];
@@ -965,7 +952,7 @@
 
   void VisitRoots(mirror::CompressedReference<mirror::Object>** roots,
                   size_t count,
-                  const RootInfo& info ATTRIBUTE_UNUSED) override
+                  [[maybe_unused]] const RootInfo& info) override
       REQUIRES_SHARED(Locks::mutator_lock_) {
     for (size_t i = 0; i < count; ++i) {
       mirror::CompressedReference<mirror::Object>* const root = roots[i];
@@ -1230,9 +1217,9 @@
     DCHECK(heap_mark_bitmap_->GetContinuousSpaceBitmap(ref)->Test(ref));
     return true;
   } else {
-    // Should be a large object. Must be page aligned and the LOS must exist.
-    if (kIsDebugBuild
-        && (!IsAligned<kPageSize>(ref) || heap_->GetLargeObjectsSpace() == nullptr)) {
+    // Should be a large object. Must be aligned and the LOS must exist.
+    if (kIsDebugBuild && (!IsAlignedParam(ref, space::LargeObjectSpace::ObjectAlignment()) ||
+                          heap_->GetLargeObjectsSpace() == nullptr)) {
       // It must be heap corruption. Remove memory protection and dump data.
       region_space_->Unprotect();
       heap_->GetVerification()->LogHeapCorruption(/* obj */ nullptr,
@@ -1259,9 +1246,9 @@
     DCHECK(heap_mark_bitmap_->GetContinuousSpaceBitmap(ref)->Test(ref));
     return true;
   } else {
-    // Should be a large object. Must be page aligned and the LOS must exist.
-    if (kIsDebugBuild
-        && (!IsAligned<kPageSize>(ref) || heap_->GetLargeObjectsSpace() == nullptr)) {
+    // Should be a large object. Must be aligned and the LOS must exist.
+    if (kIsDebugBuild && (!IsAlignedParam(ref, space::LargeObjectSpace::ObjectAlignment()) ||
+                          heap_->GetLargeObjectsSpace() == nullptr)) {
       // It must be heap corruption. Remove memory protection and dump data.
       region_space_->Unprotect();
       heap_->GetVerification()->LogHeapCorruption(/* obj */ nullptr,
@@ -1770,7 +1757,7 @@
       : concurrent_copying_(concurrent_copying) {
   }
 
-  void Run(Thread* self ATTRIBUTE_UNUSED) override REQUIRES(Locks::thread_list_lock_) {
+  void Run([[maybe_unused]] Thread* self) override REQUIRES(Locks::thread_list_lock_) {
     // This needs to run under the thread_list_lock_ critical section in ThreadList::RunCheckpoint()
     // to avoid a race with ThreadList::Register().
     CHECK(concurrent_copying_->is_marking_);
@@ -1817,8 +1804,10 @@
     heap_->rb_table_->ClearAll();
     DCHECK(heap_->rb_table_->IsAllCleared());
   }
-  is_mark_stack_push_disallowed_.store(1, std::memory_order_seq_cst);
-  mark_stack_mode_.store(kMarkStackModeOff, std::memory_order_seq_cst);
+  if (kIsDebugBuild) {
+    is_mark_stack_push_disallowed_.store(1, std::memory_order_relaxed);
+  }
+  mark_stack_mode_.store(kMarkStackModeOff, std::memory_order_release);
 }
 
 void ConcurrentCopying::IssueEmptyCheckpoint() {
@@ -1843,10 +1832,10 @@
 }
 
 void ConcurrentCopying::PushOntoMarkStack(Thread* const self, mirror::Object* to_ref) {
-  CHECK_EQ(is_mark_stack_push_disallowed_.load(std::memory_order_relaxed), 0)
+  DCHECK_EQ(is_mark_stack_push_disallowed_.load(std::memory_order_relaxed), 0)
       << " " << to_ref << " " << mirror::Object::PrettyTypeOf(to_ref);
   CHECK(thread_running_gc_ != nullptr);
-  MarkStackMode mark_stack_mode = mark_stack_mode_.load(std::memory_order_relaxed);
+  MarkStackMode mark_stack_mode = mark_stack_mode_.load(std::memory_order_acquire);
   if (LIKELY(mark_stack_mode == kMarkStackModeThreadLocal)) {
     if (LIKELY(self == thread_running_gc_)) {
       // If GC-running thread, use the GC mark stack instead of a thread-local mark stack.
@@ -1941,8 +1930,8 @@
     }
   }
 
-  void VisitRoot(mirror::Object* root, const RootInfo& info ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_) {
+  void VisitRoot(mirror::Object* root, [[maybe_unused]] const RootInfo& info) override
+      REQUIRES_SHARED(Locks::mutator_lock_) {
     DCHECK(root != nullptr);
     operator()(root);
   }
@@ -1958,7 +1947,7 @@
 
   void operator()(ObjPtr<mirror::Object> obj,
                   MemberOffset offset,
-                  bool is_static ATTRIBUTE_UNUSED) const
+                  [[maybe_unused]] bool is_static) const
       REQUIRES_SHARED(Locks::mutator_lock_) ALWAYS_INLINE {
     mirror::Object* ref =
         obj->GetFieldObject<mirror::Object, kDefaultVerifyFlags, kWithoutReadBarrier>(offset);
@@ -2053,13 +2042,13 @@
 
   void operator()(ObjPtr<mirror::Object> obj,
                   MemberOffset offset,
-                  bool is_static ATTRIBUTE_UNUSED) const
+                  [[maybe_unused]] bool is_static) const
       REQUIRES_SHARED(Locks::mutator_lock_) ALWAYS_INLINE {
     mirror::Object* ref =
         obj->GetFieldObject<mirror::Object, kDefaultVerifyFlags, kWithoutReadBarrier>(offset);
     collector_->AssertToSpaceInvariant(obj.Ptr(), offset, ref);
   }
-  void operator()(ObjPtr<mirror::Class> klass, ObjPtr<mirror::Reference> ref ATTRIBUTE_UNUSED) const
+  void operator()(ObjPtr<mirror::Class> klass, [[maybe_unused]] ObjPtr<mirror::Reference> ref) const
       REQUIRES_SHARED(Locks::mutator_lock_) ALWAYS_INLINE {
     CHECK(klass->IsTypeOfReferenceClass());
   }
@@ -2149,7 +2138,7 @@
   DCHECK(self == thread_running_gc_);
   DCHECK(thread_running_gc_->GetThreadLocalMarkStack() == nullptr);
   size_t count = 0;
-  MarkStackMode mark_stack_mode = mark_stack_mode_.load(std::memory_order_relaxed);
+  MarkStackMode mark_stack_mode = mark_stack_mode_.load(std::memory_order_acquire);
   if (mark_stack_mode == kMarkStackModeThreadLocal) {
     // Process the thread-local mark stacks and the GC mark stack.
     count += ProcessThreadLocalMarkStacks(/* disable_weak_ref_access= */ false,
@@ -2316,7 +2305,7 @@
             heap_->GetNonMovingSpace()->GetMarkBitmap();
         const bool is_los = !mark_bitmap->HasAddress(to_ref);
         if (is_los) {
-          if (!IsAligned<kPageSize>(to_ref)) {
+          if (!IsAlignedParam(to_ref, space::LargeObjectSpace::ObjectAlignment())) {
             // Ref is a large object that is not aligned, it must be heap
             // corruption. Remove memory protection and dump data before
             // AtomicSetReadBarrierState since it will fault if the address is not
@@ -2416,7 +2405,7 @@
       : concurrent_copying_(concurrent_copying) {
   }
 
-  void Run(Thread* self ATTRIBUTE_UNUSED) override REQUIRES(Locks::thread_list_lock_) {
+  void Run([[maybe_unused]] Thread* self) override REQUIRES(Locks::thread_list_lock_) {
     // This needs to run under the thread_list_lock_ critical section in ThreadList::RunCheckpoint()
     // to avoid a deadlock b/31500969.
     CHECK(concurrent_copying_->weak_ref_access_enabled_);
@@ -2432,10 +2421,9 @@
   DCHECK(thread_running_gc_ != nullptr);
   DCHECK(self == thread_running_gc_);
   DCHECK(thread_running_gc_->GetThreadLocalMarkStack() == nullptr);
-  MarkStackMode before_mark_stack_mode = mark_stack_mode_.load(std::memory_order_relaxed);
-  CHECK_EQ(static_cast<uint32_t>(before_mark_stack_mode),
+  CHECK_EQ(static_cast<uint32_t>(mark_stack_mode_.load(std::memory_order_relaxed)),
            static_cast<uint32_t>(kMarkStackModeThreadLocal));
-  mark_stack_mode_.store(kMarkStackModeShared, std::memory_order_relaxed);
+  mark_stack_mode_.store(kMarkStackModeShared, std::memory_order_release);
   DisableWeakRefAccessCallback dwrac(this);
   // Process the thread local mark stacks one last time after switching to the shared mark stack
   // mode and disable weak ref accesses.
@@ -2455,11 +2443,9 @@
   DCHECK(thread_running_gc_ != nullptr);
   DCHECK(self == thread_running_gc_);
   DCHECK(thread_running_gc_->GetThreadLocalMarkStack() == nullptr);
-  MarkStackMode before_mark_stack_mode = mark_stack_mode_.load(std::memory_order_relaxed);
-  CHECK_EQ(static_cast<uint32_t>(before_mark_stack_mode),
+  CHECK_EQ(static_cast<uint32_t>(mark_stack_mode_.load(std::memory_order_relaxed)),
            static_cast<uint32_t>(kMarkStackModeShared));
-  mark_stack_mode_.store(kMarkStackModeGcExclusive, std::memory_order_relaxed);
-  QuasiAtomic::ThreadFenceForConstructor();
+  mark_stack_mode_.store(kMarkStackModeGcExclusive, std::memory_order_release);
   if (kVerboseMode) {
     LOG(INFO) << "Switched to GC exclusive mark stack mode";
   }
@@ -2470,7 +2456,7 @@
   DCHECK(thread_running_gc_ != nullptr);
   DCHECK(self == thread_running_gc_);
   DCHECK(thread_running_gc_->GetThreadLocalMarkStack() == nullptr);
-  MarkStackMode mark_stack_mode = mark_stack_mode_.load(std::memory_order_relaxed);
+  MarkStackMode mark_stack_mode = mark_stack_mode_.load(std::memory_order_acquire);
   if (mark_stack_mode == kMarkStackModeThreadLocal) {
     // Thread-local mark stack mode.
     RevokeThreadLocalMarkStacks(false, nullptr);
@@ -2666,19 +2652,19 @@
   if (Runtime::Current()->GetDumpGCPerformanceOnShutdown()) {
     std::list<range_t> gc_ranges;
     auto add_gc_range = [&gc_ranges](void* start, size_t size) {
-      void* end = static_cast<char*>(start) + RoundUp(size, kPageSize);
+      void* end = static_cast<char*>(start) + RoundUp(size, gPageSize);
       gc_ranges.emplace_back(range_t(start, end));
     };
 
     // region space
-    DCHECK(IsAligned<kPageSize>(region_space_->Limit()));
+    DCHECK(IsAlignedParam(region_space_->Limit(), gPageSize));
     gc_ranges.emplace_back(range_t(region_space_->Begin(), region_space_->Limit()));
     // mark bitmap
     add_gc_range(region_space_bitmap_->Begin(), region_space_bitmap_->Size());
 
     // non-moving space
     {
-      DCHECK(IsAligned<kPageSize>(heap_->non_moving_space_->Limit()));
+      DCHECK(IsAlignedParam(heap_->non_moving_space_->Limit(), gPageSize));
       gc_ranges.emplace_back(range_t(heap_->non_moving_space_->Begin(),
                                      heap_->non_moving_space_->Limit()));
       // mark bitmap
@@ -2687,7 +2673,8 @@
       // live bitmap. Deal with bound bitmaps.
       ReaderMutexLock mu(Thread::Current(), *Locks::heap_bitmap_lock_);
       if (heap_->non_moving_space_->HasBoundBitmaps()) {
-        DCHECK_EQ(bitmap, heap_->non_moving_space_->GetLiveBitmap());
+        DCHECK_EQ(bitmap->Begin(),
+                  heap_->non_moving_space_->GetLiveBitmap()->Begin());
         bitmap = heap_->non_moving_space_->GetTempBitmap();
       } else {
         bitmap = heap_->non_moving_space_->GetLiveBitmap();
@@ -2697,7 +2684,7 @@
     // large-object space
     if (heap_->GetLargeObjectsSpace()) {
       heap_->GetLargeObjectsSpace()->ForEachMemMap([&add_gc_range](const MemMap& map) {
-        DCHECK(IsAligned<kPageSize>(map.BaseSize()));
+        DCHECK(IsAlignedParam(map.BaseSize(), gPageSize));
         add_gc_range(map.BaseBegin(), map.BaseSize());
       });
       // mark bitmap
@@ -2739,13 +2726,15 @@
     // Double-check that the mark stack is empty.
     // Note: need to set this after VerifyNoFromSpaceRef().
     is_asserting_to_space_invariant_ = false;
-    QuasiAtomic::ThreadFenceForConstructor();
+    QuasiAtomic::ThreadFenceForConstructor();  // TODO: Remove?
     if (kVerboseMode) {
       LOG(INFO) << "Issue an empty check point. ";
     }
     IssueEmptyCheckpoint();
     // Disable the check.
-    is_mark_stack_push_disallowed_.store(0, std::memory_order_seq_cst);
+    if (kIsDebugBuild) {
+      is_mark_stack_push_disallowed_.store(0, std::memory_order_relaxed);
+    }
     if (kUseBakerReadBarrier) {
       updated_all_immune_objects_.store(false, std::memory_order_seq_cst);
     }
@@ -2779,18 +2768,13 @@
     TimingLogger::ScopedTiming split2("RecordFree", GetTimings());
     // Don't include thread-locals that are in the to-space.
     const uint64_t from_bytes = region_space_->GetBytesAllocatedInFromSpace();
-    const uint64_t from_objects = region_space_->GetObjectsAllocatedInFromSpace();
     const uint64_t unevac_from_bytes = region_space_->GetBytesAllocatedInUnevacFromSpace();
-    const uint64_t unevac_from_objects = region_space_->GetObjectsAllocatedInUnevacFromSpace();
     uint64_t to_bytes = bytes_moved_.load(std::memory_order_relaxed) + bytes_moved_gc_thread_;
     cumulative_bytes_moved_ += to_bytes;
     uint64_t to_objects = objects_moved_.load(std::memory_order_relaxed) + objects_moved_gc_thread_;
-    cumulative_objects_moved_ += to_objects;
     if (kEnableFromSpaceAccountingCheck) {
-      CHECK_EQ(from_space_num_objects_at_first_pause_, from_objects + unevac_from_objects);
       CHECK_EQ(from_space_num_bytes_at_first_pause_, from_bytes + unevac_from_bytes);
     }
-    CHECK_LE(to_objects, from_objects);
     // to_bytes <= from_bytes is only approximately true, because objects expand a little when
     // copying to non-moving space in near-OOM situations.
     if (from_bytes > 0) {
@@ -2801,25 +2785,35 @@
     // Cleared bytes and objects, populated by the call to RegionSpace::ClearFromSpace below.
     uint64_t cleared_bytes;
     uint64_t cleared_objects;
+    bool should_eagerly_release_memory = ShouldEagerlyReleaseMemoryToOS();
     {
       TimingLogger::ScopedTiming split4("ClearFromSpace", GetTimings());
-      region_space_->ClearFromSpace(&cleared_bytes, &cleared_objects, /*clear_bitmap*/ !young_gen_);
-      // `cleared_bytes` and `cleared_objects` may be greater than the from space equivalents since
+      region_space_->ClearFromSpace(&cleared_bytes,
+                                    &cleared_objects,
+                                    /*clear_bitmap*/ !young_gen_,
+                                    should_eagerly_release_memory);
+      // `cleared_bytes` may be greater than the from space equivalents since
       // RegionSpace::ClearFromSpace may clear empty unevac regions.
       CHECK_GE(cleared_bytes, from_bytes);
-      CHECK_GE(cleared_objects, from_objects);
     }
+
+    // If we need to release available memory to the OS, go over all free
+    // regions which the kernel might still cache.
+    if (should_eagerly_release_memory) {
+      TimingLogger::ScopedTiming split4("Release free regions", GetTimings());
+      region_space_->ReleaseFreeRegions();
+    }
+
     // freed_bytes could conceivably be negative if we fall back to nonmoving space and have to
     // pad to a larger size.
     int64_t freed_bytes = (int64_t)cleared_bytes - (int64_t)to_bytes;
     uint64_t freed_objects = cleared_objects - to_objects;
     if (kVerboseMode) {
       LOG(INFO) << "RecordFree:"
-                << " from_bytes=" << from_bytes << " from_objects=" << from_objects
+                << " from_bytes=" << from_bytes
                 << " unevac_from_bytes=" << unevac_from_bytes
-                << " unevac_from_objects=" << unevac_from_objects
-                << " to_bytes=" << to_bytes << " to_objects=" << to_objects
-                << " freed_bytes=" << freed_bytes << " freed_objects=" << freed_objects
+                << " to_bytes=" << to_bytes
+                << " freed_bytes=" << freed_bytes
                 << " from_space size=" << region_space_->FromSpaceSize()
                 << " unevac_from_space size=" << region_space_->UnevacFromSpaceSize()
                 << " to_space size=" << region_space_->ToSpaceSize();
@@ -3265,8 +3259,9 @@
 }
 
 // Process some roots.
-inline void ConcurrentCopying::VisitRoots(
-    mirror::Object*** roots, size_t count, const RootInfo& info ATTRIBUTE_UNUSED) {
+inline void ConcurrentCopying::VisitRoots(mirror::Object*** roots,
+                                          size_t count,
+                                          [[maybe_unused]] const RootInfo& info) {
   Thread* const self = Thread::Current();
   for (size_t i = 0; i < count; ++i) {
     mirror::Object** root = roots[i];
@@ -3307,9 +3302,9 @@
   }
 }
 
-inline void ConcurrentCopying::VisitRoots(
-    mirror::CompressedReference<mirror::Object>** roots, size_t count,
-    const RootInfo& info ATTRIBUTE_UNUSED) {
+inline void ConcurrentCopying::VisitRoots(mirror::CompressedReference<mirror::Object>** roots,
+                                          size_t count,
+                                          [[maybe_unused]] const RootInfo& info) {
   Thread* const self = Thread::Current();
   for (size_t i = 0; i < count; ++i) {
     mirror::CompressedReference<mirror::Object>* const root = roots[i];
@@ -3685,7 +3680,7 @@
   accounting::LargeObjectBitmap* los_bitmap = nullptr;
   const bool is_los = !mark_bitmap->HasAddress(ref);
   if (is_los) {
-    if (!IsAligned<kPageSize>(ref)) {
+    if (!IsAlignedParam(ref, space::LargeObjectSpace::ObjectAlignment())) {
       // Ref is a large object that is not aligned, it must be heap
       // corruption. Remove memory protection and dump data before
       // AtomicSetReadBarrierState since it will fault if the address is not
@@ -3767,6 +3762,7 @@
     CHECK(revoked_mark_stacks_.empty());
     CHECK_EQ(pooled_mark_stacks_.size(), kMarkStackPoolSize);
   }
+  bool should_eagerly_release_memory = ShouldEagerlyReleaseMemoryToOS();
   // kVerifyNoMissingCardMarks relies on the region space cards not being cleared to avoid false
   // positives.
   if (!kVerifyNoMissingCardMarks && !use_generational_cc_) {
@@ -3774,8 +3770,8 @@
     // We do not currently use the region space cards at all, madvise them away to save ram.
     heap_->GetCardTable()->ClearCardRange(region_space_->Begin(), region_space_->Limit());
   } else if (use_generational_cc_ && !young_gen_) {
-    region_space_inter_region_bitmap_.Clear();
-    non_moving_space_inter_region_bitmap_.Clear();
+    region_space_inter_region_bitmap_.Clear(should_eagerly_release_memory);
+    non_moving_space_inter_region_bitmap_.Clear(should_eagerly_release_memory);
   }
   {
     MutexLock mu(self, skipped_blocks_lock_);
@@ -3785,7 +3781,7 @@
     ReaderMutexLock mu(self, *Locks::mutator_lock_);
     {
       WriterMutexLock mu2(self, *Locks::heap_bitmap_lock_);
-      heap_->ClearMarkedObjects();
+      heap_->ClearMarkedObjects(should_eagerly_release_memory);
     }
     if (kUseBakerReadBarrier && kFilterModUnionCards) {
       TimingLogger::ScopedTiming split("FilterModUnionCards", GetTimings());
@@ -3841,6 +3837,7 @@
           break;
         }
       } while (!field->CasWeakRelaxed(from_ref, to_ref));
+      // See comment in MarkHeapReference() for memory ordering.
     } else {
       field->Assign(to_ref);
     }
@@ -3911,7 +3908,6 @@
      << " " << (young_gen_ ? "minor" : "major") << " GCs\n";
 
   os << "Cumulative bytes moved " << cumulative_bytes_moved_ << "\n";
-  os << "Cumulative objects moved " << cumulative_objects_moved_ << "\n";
 
   os << "Peak regions allocated "
      << region_space_->GetMaxPeakNumNonFreeRegions() << " ("
diff --git a/runtime/gc/collector/concurrent_copying.h b/runtime/gc/collector/concurrent_copying.h
index 888c38a..469d54a 100644
--- a/runtime/gc/collector/concurrent_copying.h
+++ b/runtime/gc/collector/concurrent_copying.h
@@ -17,6 +17,7 @@
 #ifndef ART_RUNTIME_GC_COLLECTOR_CONCURRENT_COPYING_H_
 #define ART_RUNTIME_GC_COLLECTOR_CONCURRENT_COPYING_H_
 
+#include "base/macros.h"
 #include "garbage_collector.h"
 #include "gc/accounting/space_bitmap.h"
 #include "immune_spaces.h"
@@ -27,7 +28,7 @@
 #include <unordered_map>
 #include <vector>
 
-namespace art {
+namespace art HIDDEN {
 class Barrier;
 class Closure;
 class RootInfo;
@@ -167,17 +168,15 @@
       REQUIRES_SHARED(Locks::mutator_lock_);
 
  private:
-  void PushOntoMarkStack(Thread* const self, mirror::Object* obj)
-      REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(!mark_stack_lock_);
+  EXPORT void PushOntoMarkStack(Thread* const self, mirror::Object* obj)
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!mark_stack_lock_);
   // Returns a to-space copy of the from-space object from_ref, and atomically installs a
   // forwarding pointer. Ensures that the forwarding reference is visible to other threads before
   // the returned to-space pointer becomes visible to them.
-  mirror::Object* Copy(Thread* const self,
-                       mirror::Object* from_ref,
-                       mirror::Object* holder,
-                       MemberOffset offset)
-      REQUIRES_SHARED(Locks::mutator_lock_)
+  EXPORT mirror::Object* Copy(Thread* const self,
+                              mirror::Object* from_ref,
+                              mirror::Object* holder,
+                              MemberOffset offset) REQUIRES_SHARED(Locks::mutator_lock_)
       REQUIRES(!mark_stack_lock_, !skipped_blocks_lock_, !immune_gray_stack_lock_);
   // Scan the reference fields of object `to_ref`.
   template <bool kNoUnEvac>
@@ -288,8 +287,9 @@
       REQUIRES_SHARED(Locks::mutator_lock_);
   // Dump information about heap reference `ref`, referenced from object `obj` at offset `offset`,
   // and return it as a string.
-  std::string DumpHeapReference(mirror::Object* obj, MemberOffset offset, mirror::Object* ref)
-      REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT std::string DumpHeapReference(mirror::Object* obj,
+                                       MemberOffset offset,
+                                       mirror::Object* ref) REQUIRES_SHARED(Locks::mutator_lock_);
   // Dump information about GC root `ref` and return it as a string.
   std::string DumpGcRoot(mirror::Object* ref) REQUIRES_SHARED(Locks::mutator_lock_);
   void AssertToSpaceInvariantInNonMovingSpace(mirror::Object* obj, mirror::Object* ref)
@@ -298,12 +298,11 @@
   void DisableMarking() REQUIRES_SHARED(Locks::mutator_lock_);
   void IssueDisableMarkingCheckpoint() REQUIRES_SHARED(Locks::mutator_lock_);
   void ExpandGcMarkStack() REQUIRES_SHARED(Locks::mutator_lock_);
-  mirror::Object* MarkNonMoving(Thread* const self,
-                                mirror::Object* from_ref,
-                                mirror::Object* holder = nullptr,
-                                MemberOffset offset = MemberOffset(0))
-      REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(!mark_stack_lock_, !skipped_blocks_lock_);
+  EXPORT mirror::Object* MarkNonMoving(Thread* const self,
+                                       mirror::Object* from_ref,
+                                       mirror::Object* holder = nullptr,
+                                       MemberOffset offset = MemberOffset(0))
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!mark_stack_lock_, !skipped_blocks_lock_);
   ALWAYS_INLINE mirror::Object* MarkUnevacFromSpaceRegion(Thread* const self,
       mirror::Object* from_ref,
       accounting::SpaceBitmap<kObjectAlignment>* bitmap)
@@ -315,8 +314,8 @@
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!immune_gray_stack_lock_);
   void ScanImmuneObject(mirror::Object* obj)
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!mark_stack_lock_);
-  mirror::Object* MarkFromReadBarrierWithMeasurements(Thread* const self,
-                                                      mirror::Object* from_ref)
+  EXPORT mirror::Object* MarkFromReadBarrierWithMeasurements(Thread* const self,
+                                                             mirror::Object* from_ref)
       REQUIRES_SHARED(Locks::mutator_lock_)
       REQUIRES(!mark_stack_lock_, !skipped_blocks_lock_, !immune_gray_stack_lock_);
   void DumpPerformanceInfo(std::ostream& os) override REQUIRES(!rb_slow_path_histogram_lock_);
@@ -375,7 +374,10 @@
   Mutex mark_stack_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
   std::vector<accounting::ObjectStack*> revoked_mark_stacks_
       GUARDED_BY(mark_stack_lock_);
-  static constexpr size_t kMarkStackSize = kPageSize;
+  // Size of thread local mark stack.
+  static size_t GetMarkStackSize() {
+    return gPageSize;
+  }
   static constexpr size_t kMarkStackPoolSize = 256;
   std::vector<accounting::ObjectStack*> pooled_mark_stacks_
       GUARDED_BY(mark_stack_lock_);
@@ -390,9 +392,8 @@
   // A cache of Heap::GetMarkBitmap().
   accounting::HeapBitmap* heap_mark_bitmap_;
   size_t live_stack_freeze_size_;
-  size_t from_space_num_objects_at_first_pause_;  // Computed if kEnableFromSpaceAccountingCheck
   size_t from_space_num_bytes_at_first_pause_;  // Computed if kEnableFromSpaceAccountingCheck
-  Atomic<int> is_mark_stack_push_disallowed_;
+  Atomic<int> is_mark_stack_push_disallowed_;   // Debug only.
   enum MarkStackMode {
     kMarkStackModeOff = 0,      // Mark stack is off.
     kMarkStackModeThreadLocal,  // All threads except for the GC-running thread push refs onto
@@ -402,6 +403,11 @@
     kMarkStackModeGcExclusive   // The GC-running thread pushes onto and pops from the GC mark stack
                                 // without a lock. Other threads won't access the mark stack.
   };
+  // mark_stack_mode_ is updated asynchronoulsy by the GC. We cannot assume that another thread
+  // has seen it until it has run some kind of checkpoint.  We generally access this using
+  // acquire/release ordering, to ensure that any relevant prior changes are visible to readers of
+  // the flag, and to ensure that CHECKs prior to a state change cannot be delayed past the state
+  // change.
   Atomic<MarkStackMode> mark_stack_mode_;
   bool weak_ref_access_enabled_ GUARDED_BY(Locks::thread_list_lock_);
 
@@ -439,7 +445,6 @@
   size_t objects_moved_gc_thread_;
   uint64_t bytes_scanned_;
   uint64_t cumulative_bytes_moved_;
-  uint64_t cumulative_objects_moved_;
 
   // The skipped blocks are memory blocks/chucks that were copies of
   // objects that were unused due to lost races (cas failures) at
diff --git a/runtime/gc/collector/garbage_collector.cc b/runtime/gc/collector/garbage_collector.cc
index b051bfb..d6d3ab3 100644
--- a/runtime/gc/collector/garbage_collector.cc
+++ b/runtime/gc/collector/garbage_collector.cc
@@ -38,7 +38,7 @@
 #include "thread-current-inl.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
@@ -131,26 +131,13 @@
       pause_histogram_lock_("pause histogram lock", kDefaultMutexLevel, true),
       is_transaction_active_(false),
       are_metrics_initialized_(false) {
-  ResetCumulativeStatistics();
+  ResetMeasurements();
 }
 
 void GarbageCollector::RegisterPause(uint64_t nano_length) {
   GetCurrentIteration()->pause_times_.push_back(nano_length);
 }
 
-void GarbageCollector::ResetCumulativeStatistics() {
-  cumulative_timings_.Reset();
-  total_thread_cpu_time_ns_ = 0u;
-  total_time_ns_ = 0u;
-  total_freed_objects_ = 0u;
-  total_freed_bytes_ = 0;
-  total_scanned_bytes_ = 0;
-  rss_histogram_.Reset();
-  freed_bytes_histogram_.Reset();
-  MutexLock mu(Thread::Current(), pause_histogram_lock_);
-  pause_histogram_.Reset();
-}
-
 uint64_t GarbageCollector::ExtractRssFromMincore(
     std::list<std::pair<void*, void*>>* gc_ranges) {
   uint64_t rss = 0;
@@ -181,13 +168,13 @@
     }
     size_t length = static_cast<uint8_t*>(it->second) - static_cast<uint8_t*>(it->first);
     // Compute max length for vector allocation later.
-    vec_len = std::max(vec_len, length / kPageSize);
+    vec_len = std::max(vec_len, DivideByPageSize(length));
   }
   std::unique_ptr<unsigned char[]> vec(new unsigned char[vec_len]);
   for (const auto it : *gc_ranges) {
     size_t length = static_cast<uint8_t*>(it.second) - static_cast<uint8_t*>(it.first);
     if (mincore(it.first, length, vec.get()) == 0) {
-      for (size_t i = 0; i < length / kPageSize; i++) {
+      for (size_t i = 0; i < DivideByPageSize(length); i++) {
         // Least significant bit represents residency of a page. Other bits are
         // reserved.
         rss += vec[i] & 0x1;
@@ -197,7 +184,7 @@
                    << ", 0x" << it.second << std::dec << ") failed: " << strerror(errno);
     }
   }
-  rss *= kPageSize;
+  rss *= gPageSize;
   rss_histogram_.AddValue(rss / KB);
 #endif
   return rss;
@@ -365,6 +352,23 @@
   return heap_->GetCurrentGcIteration();
 }
 
+bool GarbageCollector::ShouldEagerlyReleaseMemoryToOS() const {
+  Runtime* runtime = Runtime::Current();
+  // Zygote isn't a memory heavy process, we should always instantly release memory to the OS.
+  if (runtime->IsZygote()) {
+    return true;
+  }
+  if (GetCurrentIteration()->GetGcCause() == kGcCauseExplicit &&
+      !runtime->IsEagerlyReleaseExplicitGcDisabled()) {
+    // Our behavior with explicit GCs is to always release any available memory.
+    return true;
+  }
+  // Keep on the memory if the app is in foreground. If it is in background or
+  // goes into the background (see invocation with cause kGcCauseCollectorTransition),
+  // release the memory.
+  return !runtime->InJankPerceptibleProcessState();
+}
+
 void GarbageCollector::RecordFree(const ObjectBytePair& freed) {
   GetCurrentIteration()->freed_.Add(freed);
   heap_->RecordFree(freed.objects, freed.bytes);
@@ -389,7 +393,6 @@
   const uint64_t total_ns = logger.GetTotalNs();
   const double seconds = NsToMs(total_ns) / 1000.0;
   const uint64_t freed_bytes = GetTotalFreedBytes();
-  const uint64_t freed_objects = GetTotalFreedObjects();
   const uint64_t scanned_bytes = GetTotalScannedBytes();
   {
     MutexLock mu(Thread::Current(), pause_histogram_lock_);
@@ -422,10 +425,8 @@
   const double cpu_seconds = NsToMs(GetTotalCpuTime()) / 1000.0;
   os << GetName() << " total time: " << PrettyDuration(total_ns)
      << " mean time: " << PrettyDuration(total_ns / iterations) << "\n"
-     << GetName() << " freed: " << freed_objects
-     << " objects with total size " << PrettySize(freed_bytes) << "\n"
-     << GetName() << " throughput: " << freed_objects / seconds << "/s / "
-     << PrettySize(freed_bytes / seconds) << "/s"
+     << GetName() << " freed: " << PrettySize(freed_bytes) << "\n"
+     << GetName() << " throughput: " << PrettySize(freed_bytes / seconds) << "/s"
      << "  per cpu-time: "
      << static_cast<uint64_t>(freed_bytes / cpu_seconds) << "/s / "
      << PrettySize(freed_bytes / cpu_seconds) << "/s\n"
diff --git a/runtime/gc/collector/garbage_collector.h b/runtime/gc/collector/garbage_collector.h
index 948a868..ea5acdf 100644
--- a/runtime/gc/collector/garbage_collector.h
+++ b/runtime/gc/collector/garbage_collector.h
@@ -21,6 +21,7 @@
 #include <list>
 
 #include "base/histogram.h"
+#include "base/macros.h"
 #include "base/metrics/metrics.h"
 #include "base/mutex.h"
 #include "base/timing_logger.h"
@@ -32,7 +33,7 @@
 #include "object_byte_pair.h"
 #include "object_callbacks.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Class;
@@ -76,7 +77,6 @@
   const CumulativeLogger& GetCumulativeTimings() const {
     return cumulative_timings_;
   }
-  void ResetCumulativeStatistics() REQUIRES(!pause_histogram_lock_);
   // Swap the live and mark bitmaps of spaces that are active for the collector. For partial GC,
   // this is the allocation space, for full GC then we swap the zygote bitmaps too.
   void SwapBitmaps()
@@ -143,6 +143,8 @@
     return is_transaction_active_;
   }
 
+  bool ShouldEagerlyReleaseMemoryToOS() const;
+
  protected:
   // Run all of the GC phases.
   virtual void RunPhases() = 0;
diff --git a/runtime/gc/collector/gc_type.h b/runtime/gc/collector/gc_type.h
index f03ba1f..e666c04 100644
--- a/runtime/gc/collector/gc_type.h
+++ b/runtime/gc/collector/gc_type.h
@@ -19,7 +19,9 @@
 
 #include <iosfwd>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
diff --git a/runtime/gc/collector/immune_region.cc b/runtime/gc/collector/immune_region.cc
index 8a04c17..a6b90b8 100644
--- a/runtime/gc/collector/immune_region.cc
+++ b/runtime/gc/collector/immune_region.cc
@@ -19,7 +19,7 @@
 #include "gc/space/space-inl.h"
 #include "mirror/object.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
diff --git a/runtime/gc/collector/immune_region.h b/runtime/gc/collector/immune_region.h
index 80ee44c..ee0ce84 100644
--- a/runtime/gc/collector/immune_region.h
+++ b/runtime/gc/collector/immune_region.h
@@ -19,7 +19,7 @@
 
 #include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 class Object;
 }  // namespace mirror
diff --git a/runtime/gc/collector/immune_spaces.cc b/runtime/gc/collector/immune_spaces.cc
index 84fcc3f..4128242c 100644
--- a/runtime/gc/collector/immune_spaces.cc
+++ b/runtime/gc/collector/immune_spaces.cc
@@ -22,9 +22,9 @@
 #include "base/logging.h"  // For VLOG.
 #include "gc/space/space-inl.h"
 #include "mirror/object.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
@@ -50,7 +50,8 @@
       // be if the app image was mapped at a random address.
       space::ImageSpace* image_space = space->AsImageSpace();
       // Update the end to include the other non-heap sections.
-      space_end = RoundUp(reinterpret_cast<uintptr_t>(image_space->GetImageEnd()), kPageSize);
+      space_end = RoundUp(reinterpret_cast<uintptr_t>(image_space->GetImageEnd()),
+                          kElfSegmentAlignment);
       // For the app image case, GetOatFileBegin is where the oat file was mapped during image
       // creation, the actual oat file could be somewhere else.
       const OatFile* const image_oat_file = image_space->GetOatFile();
diff --git a/runtime/gc/collector/immune_spaces.h b/runtime/gc/collector/immune_spaces.h
index 950c35b..5ee4ffc 100644
--- a/runtime/gc/collector/immune_spaces.h
+++ b/runtime/gc/collector/immune_spaces.h
@@ -24,7 +24,7 @@
 
 #include <set>
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 class ContinuousSpace;
diff --git a/runtime/gc/collector/immune_spaces_test.cc b/runtime/gc/collector/immune_spaces_test.cc
index caa8106..6cc7e30 100644
--- a/runtime/gc/collector/immune_spaces_test.cc
+++ b/runtime/gc/collector/immune_spaces_test.cc
@@ -21,10 +21,10 @@
 #include "gc/collector/immune_spaces.h"
 #include "gc/space/image_space.h"
 #include "gc/space/space-inl.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 class Object;
 }  // namespace mirror
@@ -67,18 +67,39 @@
   ImmuneSpacesTest() {}
 
   void ReserveBitmaps() {
+    const size_t page_size = MemMap::GetPageSize();
+
     // Create a bunch of fake bitmaps since these are required to create image spaces. The bitmaps
     // do not need to cover the image spaces though.
     for (size_t i = 0; i < kMaxBitmaps; ++i) {
       accounting::ContinuousSpaceBitmap bitmap(
-          accounting::ContinuousSpaceBitmap::Create("bitmap",
-                                                    reinterpret_cast<uint8_t*>(kPageSize),
-                                                    kPageSize));
+          accounting::ContinuousSpaceBitmap::Create(
+              "bitmap", reinterpret_cast<uint8_t*>(static_cast<size_t>(page_size)), page_size));
       CHECK(bitmap.IsValid());
       live_bitmaps_.push_back(std::move(bitmap));
     }
   }
 
+  MemMap ReserveImage(size_t image_size, /*out*/ std::string* error_str) {
+    // If the image is aligned to the current runtime page size, it will already
+    // be naturally aligned. On the other hand, MayAnonymousAligned() requires
+    // that the requested alignment is higher.
+    DCHECK_LE(MemMap::GetPageSize(), kElfSegmentAlignment);
+    if (MemMap::GetPageSize() == kElfSegmentAlignment) {
+      return MemMap::MapAnonymous("reserve",
+                                  image_size,
+                                  PROT_READ | PROT_WRITE,
+                                  /*low_4gb=*/true,
+                                  error_str);
+    }
+    return MemMap::MapAnonymousAligned("reserve",
+                                       image_size,
+                                       PROT_READ | PROT_WRITE,
+                                       /*low_4gb=*/true,
+                                       kElfSegmentAlignment,
+                                       error_str);
+  }
+
   // Create an image space, the oat file is optional.
   FakeImageSpace* CreateImageSpace(size_t image_size,
                                    size_t oat_size,
@@ -189,16 +210,12 @@
 TEST_F(ImmuneSpacesTest, AppendAfterImage) {
   ReserveBitmaps();
   ImmuneSpaces spaces;
-  constexpr size_t kImageSize = 123 * kPageSize;
-  constexpr size_t kImageOatSize = 321 * kPageSize;
-  constexpr size_t kOtherSpaceSize = 100 * kPageSize;
+  constexpr size_t kImageSize = 123 * kElfSegmentAlignment;
+  constexpr size_t kImageOatSize = 321 * kElfSegmentAlignment;
+  constexpr size_t kOtherSpaceSize = 100 * kElfSegmentAlignment;
 
   std::string error_str;
-  MemMap reservation = MemMap::MapAnonymous("reserve",
-                                            kImageSize + kImageOatSize + kOtherSpaceSize,
-                                            PROT_READ | PROT_WRITE,
-                                            /*low_4gb=*/ true,
-                                            &error_str);
+  MemMap reservation = ReserveImage(kImageSize + kImageOatSize + kOtherSpaceSize, &error_str);
   ASSERT_TRUE(reservation.IsValid()) << "Failed to allocate memory region " << error_str;
   MemMap image_reservation = reservation.TakeReservedMemory(kImageSize);
   ASSERT_TRUE(image_reservation.IsValid());
@@ -248,20 +265,16 @@
 TEST_F(ImmuneSpacesTest, MultiImage) {
   ReserveBitmaps();
   // Image 2 needs to be smaller or else it may be chosen for immune region.
-  constexpr size_t kImage1Size = kPageSize * 17;
-  constexpr size_t kImage2Size = kPageSize * 13;
-  constexpr size_t kImage3Size = kPageSize * 3;
-  constexpr size_t kImage1OatSize = kPageSize * 5;
-  constexpr size_t kImage2OatSize = kPageSize * 8;
-  constexpr size_t kImage3OatSize = kPageSize;
+  constexpr size_t kImage1Size = kElfSegmentAlignment * 17;
+  constexpr size_t kImage2Size = kElfSegmentAlignment * 13;
+  constexpr size_t kImage3Size = kElfSegmentAlignment * 3;
+  constexpr size_t kImage1OatSize = kElfSegmentAlignment * 5;
+  constexpr size_t kImage2OatSize = kElfSegmentAlignment * 8;
+  constexpr size_t kImage3OatSize = kElfSegmentAlignment;
   constexpr size_t kImageBytes = kImage1Size + kImage2Size + kImage3Size;
   constexpr size_t kMemorySize = kImageBytes + kImage1OatSize + kImage2OatSize + kImage3OatSize;
   std::string error_str;
-  MemMap reservation = MemMap::MapAnonymous("reserve",
-                                            kMemorySize,
-                                            PROT_READ | PROT_WRITE,
-                                            /*low_4gb=*/ true,
-                                            &error_str);
+  MemMap reservation = ReserveImage(kMemorySize, &error_str);
   ASSERT_TRUE(reservation.IsValid()) << "Failed to allocate memory region " << error_str;
   MemMap image_reservation = reservation.TakeReservedMemory(kImage1Size + kImage2Size);
   ASSERT_TRUE(image_reservation.IsValid());
@@ -323,19 +336,15 @@
             space3->Limit());
 
   // Add a smaller non-adjacent space and ensure it does not become part of the immune region.
-  // Image size is kImageBytes - kPageSize
-  // Oat size is kPageSize.
+  // Image size is kImageBytes - kElfSegmentAlignment
+  // Oat size is kElfSegmentAlignment.
   // Guard pages to ensure it is not adjacent to an existing immune region.
   // Layout:  [guard page][image][oat][guard page]
-  constexpr size_t kGuardSize = kPageSize;
-  constexpr size_t kImage4Size = kImageBytes - kPageSize;
-  constexpr size_t kImage4OatSize = kPageSize;
+  constexpr size_t kGuardSize = kElfSegmentAlignment;
+  constexpr size_t kImage4Size = kImageBytes - kElfSegmentAlignment;
+  constexpr size_t kImage4OatSize = kElfSegmentAlignment;
 
-  reservation = MemMap::MapAnonymous("reserve",
-                                     kImage4Size + kImage4OatSize + kGuardSize * 2,
-                                     PROT_READ | PROT_WRITE,
-                                     /*low_4gb=*/ true,
-                                     &error_str);
+  reservation = ReserveImage(kImage4Size + kImage4OatSize + kGuardSize * 2, &error_str);
   ASSERT_TRUE(reservation.IsValid()) << "Failed to allocate memory region " << error_str;
   MemMap guard = reservation.TakeReservedMemory(kGuardSize);
   ASSERT_TRUE(guard.IsValid());
@@ -364,17 +373,13 @@
             space3->Limit());
 
   // Add a larger non-adjacent space and ensure it becomes the new largest immune region.
-  // Image size is kImageBytes + kPageSize
-  // Oat size is kPageSize.
+  // Image size is kImageBytes + kElfSegmentAlignment
+  // Oat size is kElfSegmentAlignment.
   // Guard pages to ensure it is not adjacent to an existing immune region.
   // Layout:  [guard page][image][oat][guard page]
-  constexpr size_t kImage5Size = kImageBytes + kPageSize;
-  constexpr size_t kImage5OatSize = kPageSize;
-  reservation = MemMap::MapAnonymous("reserve",
-                                     kImage5Size + kImage5OatSize + kGuardSize * 2,
-                                     PROT_READ | PROT_WRITE,
-                                     /*low_4gb=*/ true,
-                                     &error_str);
+  constexpr size_t kImage5Size = kImageBytes + kElfSegmentAlignment;
+  constexpr size_t kImage5OatSize = kElfSegmentAlignment;
+  reservation = ReserveImage(kImage5Size + kImage5OatSize + kGuardSize * 2, &error_str);
   ASSERT_TRUE(reservation.IsValid()) << "Failed to allocate memory region " << error_str;
   guard = reservation.TakeReservedMemory(kGuardSize);
   ASSERT_TRUE(guard.IsValid());
diff --git a/runtime/gc/collector/iteration.h b/runtime/gc/collector/iteration.h
index 348f49d..d70a30b 100644
--- a/runtime/gc/collector/iteration.h
+++ b/runtime/gc/collector/iteration.h
@@ -21,11 +21,12 @@
 #include <vector>
 
 #include "android-base/macros.h"
+#include "base/macros.h"
 #include "base/timing_logger.h"
 #include "gc/gc_cause.h"
 #include "object_byte_pair.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
diff --git a/runtime/gc/collector/mark_compact-inl.h b/runtime/gc/collector/mark_compact-inl.h
index fe67906..454d79a 100644
--- a/runtime/gc/collector/mark_compact-inl.h
+++ b/runtime/gc/collector/mark_compact-inl.h
@@ -21,7 +21,7 @@
 #include "mark_compact.h"
 #include "mirror/object-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
diff --git a/runtime/gc/collector/mark_compact.cc b/runtime/gc/collector/mark_compact.cc
index a7252a1..0840461 100644
--- a/runtime/gc/collector/mark_compact.cc
+++ b/runtime/gc/collector/mark_compact.cc
@@ -58,6 +58,7 @@
 #include "thread_list.h"
 
 #ifdef ART_TARGET_ANDROID
+#include "android-modules-utils/sdk_level.h"
 #include "com_android_art.h"
 #endif
 
@@ -89,19 +90,21 @@
 using ::android::base::GetBoolProperty;
 using ::android::base::ParseBool;
 using ::android::base::ParseBoolResult;
+using ::android::modules::sdklevel::IsAtLeastV;
 
 }  // namespace
 #endif
 
-namespace art {
+namespace art HIDDEN {
 
 static bool HaveMremapDontunmap() {
-  void* old = mmap(nullptr, kPageSize, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0);
+  const size_t page_size = GetPageSizeSlow();
+  void* old = mmap(nullptr, page_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0);
   CHECK_NE(old, MAP_FAILED);
-  void* addr = mremap(old, kPageSize, kPageSize, MREMAP_MAYMOVE | MREMAP_DONTUNMAP, nullptr);
-  CHECK_EQ(munmap(old, kPageSize), 0);
+  void* addr = mremap(old, page_size, page_size, MREMAP_MAYMOVE | MREMAP_DONTUNMAP, nullptr);
+  CHECK_EQ(munmap(old, page_size), 0);
   if (addr != MAP_FAILED) {
-    CHECK_EQ(munmap(addr, kPageSize), 0);
+    CHECK_EQ(munmap(addr, page_size), 0);
     return true;
   } else {
     return false;
@@ -116,17 +119,13 @@
 static constexpr uint64_t kUffdFeaturesForMinorFault =
     UFFD_FEATURE_MISSING_SHMEM | UFFD_FEATURE_MINOR_SHMEM;
 static constexpr uint64_t kUffdFeaturesForSigbus = UFFD_FEATURE_SIGBUS;
+
 // We consider SIGBUS feature necessary to enable this GC as it's superior than
 // threading-based implementation for janks. However, since we have the latter
 // already implemented, for testing purposes, we allow choosing either of the
 // two at boot time in the constructor below.
-// Note that having minor-fault feature implies having SIGBUS feature as the
-// latter was introduced earlier than the former. In other words, having
-// minor-fault feature implies having SIGBUS. We still want minor-fault to be
-// available for making jit-code-cache updation concurrent, which uses shmem.
-static constexpr uint64_t kUffdFeaturesRequired =
-    kUffdFeaturesForMinorFault | kUffdFeaturesForSigbus;
-
+// We may want minor-fault in future to be available for making jit-code-cache
+// updation concurrent, which uses shmem.
 bool KernelSupportsUffd() {
 #ifdef __linux__
   if (gHaveMremapDontunmap) {
@@ -144,8 +143,8 @@
       CHECK_EQ(ioctl(fd, UFFDIO_API, &api), 0) << "ioctl_userfaultfd : API:" << strerror(errno);
       gUffdFeatures = api.features;
       close(fd);
-      // Allow this GC to be used only if minor-fault and sigbus feature is available.
-      return (api.features & kUffdFeaturesRequired) == kUffdFeaturesRequired;
+      // Minimum we need is sigbus feature for using userfaultfd.
+      return (api.features & kUffdFeaturesForSigbus) == kUffdFeaturesForSigbus;
     }
   }
 #endif
@@ -260,12 +259,17 @@
   // The phenotype flag can change at time time after boot, but it shouldn't take effect until a
   // reboot. Therefore, we read the phenotype flag from the cache info, which is generated on boot.
   std::unordered_map<std::string, std::string> cached_properties = GetCachedProperties();
-  return !GetCachedBoolProperty(
+  bool phenotype_enable = GetCachedBoolProperty(
+      cached_properties, "persist.device_config.runtime_native_boot.enable_uffd_gc_2", false);
+  bool phenotype_force_disable = GetCachedBoolProperty(
       cached_properties, "persist.device_config.runtime_native_boot.force_disable_uffd_gc", false);
+  bool build_enable = GetBoolProperty("ro.dalvik.vm.enable_uffd_gc", false);
+  bool is_at_most_u = !IsAtLeastV();
+  return (phenotype_enable || build_enable || is_at_most_u) && !phenotype_force_disable;
 }
 #else
 // Never called.
-static bool SysPropSaysUffdGc() { return true; }
+static bool SysPropSaysUffdGc() { return false; }
 #endif
 
 static bool ShouldUseUserfaultfd() {
@@ -353,8 +357,21 @@
       } else {
         DCHECK(IsValidFd(uffd_));
         // Initialize uffd with the features which are required and available.
-        struct uffdio_api api = {.api = UFFD_API, .features = gUffdFeatures, .ioctls = 0};
-        api.features &= use_uffd_sigbus_ ? kUffdFeaturesRequired : kUffdFeaturesForMinorFault;
+        // Using private anonymous mapping in threading mode is the default,
+        // for which we don't need to ask for any features. Note: this mode
+        // is not used in production.
+        struct uffdio_api api = {.api = UFFD_API, .features = 0, .ioctls = 0};
+        if (use_uffd_sigbus_) {
+          // We should add SIGBUS feature only if we plan on using it as
+          // requesting it here will mean threading mode will not work.
+          CHECK_EQ(gUffdFeatures & kUffdFeaturesForSigbus, kUffdFeaturesForSigbus);
+          api.features |= kUffdFeaturesForSigbus;
+        }
+        if (uffd_minor_fault_supported_) {
+          // NOTE: This option is currently disabled.
+          CHECK_EQ(gUffdFeatures & kUffdFeaturesForMinorFault, kUffdFeaturesForMinorFault);
+          api.features |= kUffdFeaturesForMinorFault;
+        }
         CHECK_EQ(ioctl(uffd_, UFFDIO_API, &api), 0)
             << "ioctl_userfaultfd: API: " << strerror(errno);
       }
@@ -375,18 +392,18 @@
 
 static bool IsSigbusFeatureAvailable() {
   MarkCompact::GetUffdAndMinorFault();
-  return gUffdFeatures & UFFD_FEATURE_SIGBUS;
+  return (gUffdFeatures & kUffdFeaturesForSigbus) == kUffdFeaturesForSigbus;
 }
 
 size_t MarkCompact::InitializeInfoMap(uint8_t* p, size_t moving_space_sz) {
-  size_t nr_moving_pages = moving_space_sz / kPageSize;
+  size_t nr_moving_pages = DivideByPageSize(moving_space_sz);
 
   chunk_info_vec_ = reinterpret_cast<uint32_t*>(p);
   vector_length_ = moving_space_sz / kOffsetChunkSize;
   size_t total = vector_length_ * sizeof(uint32_t);
 
   first_objs_non_moving_space_ = reinterpret_cast<ObjReference*>(p + total);
-  total += heap_->GetNonMovingSpace()->Capacity() / kPageSize * sizeof(ObjReference);
+  total += DivideByPageSize(heap_->GetNonMovingSpace()->Capacity()) * sizeof(ObjReference);
 
   first_objs_moving_space_ = reinterpret_cast<ObjReference*>(p + total);
   total += nr_moving_pages * sizeof(ObjReference);
@@ -439,8 +456,8 @@
   // Create one MemMap for all the data structures
   size_t moving_space_size = bump_pointer_space_->Capacity();
   size_t chunk_info_vec_size = moving_space_size / kOffsetChunkSize;
-  size_t nr_moving_pages = moving_space_size / kPageSize;
-  size_t nr_non_moving_pages = heap->GetNonMovingSpace()->Capacity() / kPageSize;
+  size_t nr_moving_pages = DivideByPageSize(moving_space_size);
+  size_t nr_non_moving_pages = DivideByPageSize(heap->GetNonMovingSpace()->Capacity());
 
   std::string err_msg;
   info_map_ = MemMap::MapAnonymous("Concurrent mark-compact chunk-info vector",
@@ -458,7 +475,7 @@
     DCHECK_EQ(total, info_map_.Size());
   }
 
-  size_t moving_space_alignment = BestPageTableAlignment(moving_space_size);
+  size_t moving_space_alignment = Heap::BestPageTableAlignment(moving_space_size);
   // The moving space is created at a fixed address, which is expected to be
   // PMD-size aligned.
   if (!IsAlignedParam(bump_pointer_space_->Begin(), moving_space_alignment)) {
@@ -503,7 +520,7 @@
       1 + (use_uffd_sigbus_ ? kMutatorCompactionBufferCount :
                               std::min(heap_->GetParallelGCThreadCount(), kMaxNumUffdWorkers));
   compaction_buffers_map_ = MemMap::MapAnonymous("Concurrent mark-compact compaction buffers",
-                                                 kPageSize * num_pages,
+                                                 gPageSize * num_pages,
                                                  PROT_READ | PROT_WRITE,
                                                  /*low_4gb=*/kObjPtrPoisoning,
                                                  &err_msg);
@@ -539,10 +556,10 @@
 }
 
 void MarkCompact::AddLinearAllocSpaceData(uint8_t* begin, size_t len) {
-  DCHECK_ALIGNED(begin, kPageSize);
-  DCHECK_ALIGNED(len, kPageSize);
-  DCHECK_GE(len, kPMDSize);
-  size_t alignment = BestPageTableAlignment(len);
+  DCHECK_ALIGNED_PARAM(begin, gPageSize);
+  DCHECK_ALIGNED_PARAM(len, gPageSize);
+  DCHECK_GE(len, Heap::GetPMDSize());
+  size_t alignment = Heap::BestPageTableAlignment(len);
   bool is_shared = false;
   // We use MAP_SHARED on non-zygote processes for leveraging userfaultfd's minor-fault feature.
   if (map_linear_alloc_shared_) {
@@ -568,7 +585,7 @@
   }
 
   MemMap page_status_map(MemMap::MapAnonymous("linear-alloc page-status map",
-                                              len / kPageSize,
+                                              DivideByPageSize(len),
                                               PROT_READ | PROT_WRITE,
                                               /*low_4gb=*/false,
                                               &err_msg));
@@ -745,7 +762,6 @@
     CHECK(collector_->compacting_);
     thread->SweepInterpreterCache(collector_);
     thread->AdjustTlab(collector_->black_objs_slide_diff_);
-    collector_->GetBarrier().Pass(self);
   }
 
  private:
@@ -756,7 +772,7 @@
  public:
   explicit FlipCallback(MarkCompact* collector) : collector_(collector) {}
 
-  void Run(Thread* thread ATTRIBUTE_UNUSED) override REQUIRES(Locks::mutator_lock_) {
+  void Run([[maybe_unused]] Thread* thread) override REQUIRES(Locks::mutator_lock_) {
     collector_->CompactionPause();
   }
 
@@ -782,10 +798,6 @@
       bump_pointer_space_->AssertAllThreadLocalBuffersAreRevoked();
     }
   }
-  // To increase likelihood of black allocations. For testing purposes only.
-  if (kIsDebugBuild && heap_->GetTaskProcessor()->GetRunningThread() == thread_running_gc_) {
-    usleep(500'000);
-  }
   {
     ReaderMutexLock mu(self, *Locks::mutator_lock_);
     ReclaimPhase();
@@ -797,15 +809,10 @@
 
   {
     // Compaction pause
-    gc_barrier_.Init(self, 0);
     ThreadFlipVisitor visitor(this);
     FlipCallback callback(this);
-    size_t barrier_count = runtime->GetThreadList()->FlipThreadRoots(
+    runtime->GetThreadList()->FlipThreadRoots(
         &visitor, &callback, this, GetHeap()->GetGcPauseListener());
-    {
-      ScopedThreadStateChange tsc(self, ThreadState::kWaitingForCheckPointsToRun);
-      gc_barrier_.Increment(self, barrier_count);
-    }
   }
 
   if (IsValidFd(uffd_)) {
@@ -815,7 +822,6 @@
 
   FinishPhase();
   thread_running_gc_ = nullptr;
-  GetHeap()->PostGcVerification(this);
 }
 
 void MarkCompact::InitMovingSpaceFirstObjects(const size_t vec_len) {
@@ -853,7 +859,7 @@
 
   uint32_t page_live_bytes = 0;
   while (true) {
-    for (; page_live_bytes <= kPageSize; chunk_idx++) {
+    for (; page_live_bytes <= gPageSize; chunk_idx++) {
       if (chunk_idx > vec_len) {
         moving_first_objs_count_ = to_space_page_idx;
         return;
@@ -861,7 +867,7 @@
       page_live_bytes += chunk_info_vec_[chunk_idx];
     }
     chunk_idx--;
-    page_live_bytes -= kPageSize;
+    page_live_bytes -= gPageSize;
     DCHECK_LE(page_live_bytes, kOffsetChunkSize);
     DCHECK_LE(page_live_bytes, chunk_info_vec_[chunk_idx])
         << " chunk_idx=" << chunk_idx
@@ -911,7 +917,7 @@
       // There are no live objects in the non-moving space
       return;
     }
-    page_idx = (reinterpret_cast<uintptr_t>(obj) - begin) / kPageSize;
+    page_idx = DivideByPageSize(reinterpret_cast<uintptr_t>(obj) - begin);
     first_objs_non_moving_space_[page_idx++].Assign(obj);
     prev_obj = obj;
   }
@@ -921,7 +927,7 @@
   // For every page find the object starting from which we need to call
   // VisitReferences. It could either be an object that started on some
   // preceding page, or some object starting within this page.
-  begin = RoundDown(reinterpret_cast<uintptr_t>(prev_obj) + kPageSize, kPageSize);
+  begin = RoundDown(reinterpret_cast<uintptr_t>(prev_obj) + gPageSize, gPageSize);
   while (begin < end) {
     // Utilize, if any, large object that started in some preceding page, but
     // overlaps with this page as well.
@@ -940,7 +946,7 @@
       // If no live object started in that page and some object had started in
       // the page preceding to that page, which was big enough to overlap with
       // the current page, then we wouldn't be in the else part.
-      prev_obj = bitmap->FindPrecedingObject(begin, begin - kPageSize);
+      prev_obj = bitmap->FindPrecedingObject(begin, begin - gPageSize);
       if (prev_obj != nullptr) {
         prev_obj_end = reinterpret_cast<uintptr_t>(prev_obj)
                         + RoundUp(prev_obj->SizeOf<kDefaultVerifyFlags>(), kAlignment);
@@ -957,7 +963,7 @@
         // Find the first live object in this page
         bitmap->VisitMarkedRange</*kVisitOnce*/ true>(
                 begin,
-                begin + kPageSize,
+                begin + gPageSize,
                 [this, page_idx] (mirror::Object* obj) {
                   first_objs_non_moving_space_[page_idx].Assign(obj);
                 });
@@ -965,14 +971,14 @@
       // An empty entry indicates that the page has no live objects and hence
       // can be skipped.
     }
-    begin += kPageSize;
+    begin += gPageSize;
     page_idx++;
   }
   non_moving_first_objs_count_ = page_idx;
 }
 
 bool MarkCompact::CanCompactMovingSpaceWithMinorFault() {
-  size_t min_size = (moving_first_objs_count_ + black_page_count_) * kPageSize;
+  size_t min_size = (moving_first_objs_count_ + black_page_count_) * gPageSize;
   return minor_fault_initialized_ && shadow_to_space_map_.IsValid() &&
          shadow_to_space_map_.Size() >= min_size;
 }
@@ -982,14 +988,14 @@
   explicit ConcurrentCompactionGcTask(MarkCompact* collector, size_t idx)
       : collector_(collector), index_(idx) {}
 
-  void Run(Thread* self ATTRIBUTE_UNUSED) override REQUIRES_SHARED(Locks::mutator_lock_) {
+  void Run([[maybe_unused]] Thread* self) override REQUIRES_SHARED(Locks::mutator_lock_) {
     if (collector_->CanCompactMovingSpaceWithMinorFault()) {
       collector_->ConcurrentCompaction<MarkCompact::kMinorFaultMode>(/*buf=*/nullptr);
     } else {
       // The passed page/buf to ConcurrentCompaction is used by the thread as a
-      // kPageSize buffer for compacting and updating objects into and then
+      // gPageSize buffer for compacting and updating objects into and then
       // passing the buf to uffd ioctls.
-      uint8_t* buf = collector_->compaction_buffers_map_.Begin() + index_ * kPageSize;
+      uint8_t* buf = collector_->compaction_buffers_map_.Begin() + index_ * gPageSize;
       collector_->ConcurrentCompaction<MarkCompact::kCopyMode>(buf);
     }
   }
@@ -1050,8 +1056,8 @@
   for (size_t i = vector_len; i < vector_length_; i++) {
     DCHECK_EQ(chunk_info_vec_[i], 0u);
   }
-  post_compact_end_ = AlignUp(space_begin + total, kPageSize);
-  CHECK_EQ(post_compact_end_, space_begin + moving_first_objs_count_ * kPageSize);
+  post_compact_end_ = AlignUp(space_begin + total, gPageSize);
+  CHECK_EQ(post_compact_end_, space_begin + moving_first_objs_count_ * gPageSize);
   black_objs_slide_diff_ = black_allocations_begin_ - post_compact_end_;
   // We shouldn't be consuming more space after compaction than pre-compaction.
   CHECK_GE(black_objs_slide_diff_, 0);
@@ -1072,7 +1078,7 @@
       // Register the buffer that we use for terminating concurrent compaction
       struct uffdio_register uffd_register;
       uffd_register.range.start = reinterpret_cast<uintptr_t>(conc_compaction_termination_page_);
-      uffd_register.range.len = kPageSize;
+      uffd_register.range.len = gPageSize;
       uffd_register.mode = UFFDIO_REGISTER_MODE_MISSING;
       CHECK_EQ(ioctl(uffd_, UFFDIO_REGISTER, &uffd_register), 0)
           << "ioctl_userfaultfd: register compaction termination page: " << strerror(errno);
@@ -1186,7 +1192,7 @@
         DCHECK_GE(moving_to_space_fd_, 0);
         // Take extra 4MB to reduce the likelihood of requiring resizing this
         // map in the pause due to black allocations.
-        size_t reqd_size = std::min(moving_first_objs_count_ * kPageSize + 4 * MB,
+        size_t reqd_size = std::min(moving_first_objs_count_ * gPageSize + 4 * MB,
                                     bump_pointer_space_->Capacity());
         // We cannot support memory-tool with shadow-map (as it requires
         // appending a redzone) in this case because the mapping may have to be expanded
@@ -1341,8 +1347,8 @@
     // Align-up to page boundary so that black allocations happen from next page
     // onwards. Also, it ensures that 'end' is aligned for card-table's
     // ClearCardRange().
-    black_allocations_begin_ = bump_pointer_space_->AlignEnd(thread_running_gc_, kPageSize, heap_);
-    DCHECK_ALIGNED_PARAM(black_allocations_begin_, kPageSize);
+    black_allocations_begin_ = bump_pointer_space_->AlignEnd(thread_running_gc_, gPageSize, heap_);
+    DCHECK_ALIGNED_PARAM(black_allocations_begin_, gPageSize);
 
     // Re-mark root set. Doesn't include thread-roots as they are already marked
     // above.
@@ -1468,9 +1474,10 @@
     DCHECK(!kCheckEnd || end != nullptr);
   }
 
-  void operator()(mirror::Object* old ATTRIBUTE_UNUSED, MemberOffset offset, bool /* is_static */)
-      const ALWAYS_INLINE REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES_SHARED(Locks::heap_bitmap_lock_) {
+  void operator()([[maybe_unused]] mirror::Object* old,
+                  MemberOffset offset,
+                  [[maybe_unused]] bool is_static) const ALWAYS_INLINE
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES_SHARED(Locks::heap_bitmap_lock_) {
     bool update = true;
     if (kCheckBegin || kCheckEnd) {
       uint8_t* ref = reinterpret_cast<uint8_t*>(obj_) + offset.Int32Value();
@@ -1485,12 +1492,11 @@
   // VisitReferenes().
   // TODO: Optimize reference updating using SIMD instructions. Object arrays
   // are perfect as all references are tightly packed.
-  void operator()(mirror::Object* old ATTRIBUTE_UNUSED,
+  void operator()([[maybe_unused]] mirror::Object* old,
                   MemberOffset offset,
-                  bool /*is_static*/,
-                  bool /*is_obj_array*/)
-      const ALWAYS_INLINE REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES_SHARED(Locks::heap_bitmap_lock_) {
+                  [[maybe_unused]] bool is_static,
+                  [[maybe_unused]] bool is_obj_array) const ALWAYS_INLINE
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES_SHARED(Locks::heap_bitmap_lock_) {
     collector_->UpdateRef(obj_, offset, moving_space_begin_, moving_space_end_);
   }
 
@@ -1594,52 +1600,39 @@
                                   << " start_addr=" << static_cast<void*>(start_addr);
                              };
   obj = GetFromSpaceAddr(obj);
-  live_words_bitmap_->VisitLiveStrides(offset,
-                                       black_allocations_begin_,
-                                       kPageSize,
-                                       [&addr,
-                                        &last_stride,
-                                        &stride_count,
-                                        &last_stride_begin,
-                                        verify_obj_callback,
-                                        this] (uint32_t stride_begin,
-                                               size_t stride_size,
-                                               bool /*is_last*/)
-                                        REQUIRES_SHARED(Locks::mutator_lock_) {
-                                         const size_t stride_in_bytes = stride_size * kAlignment;
-                                         DCHECK_LE(stride_in_bytes, kPageSize);
-                                         last_stride_begin = stride_begin;
-                                         DCHECK(IsAligned<kAlignment>(addr));
-                                         memcpy(addr,
-                                                from_space_begin_ + stride_begin * kAlignment,
-                                                stride_in_bytes);
-                                         if (kIsDebugBuild) {
-                                           uint8_t* space_begin = bump_pointer_space_->Begin();
-                                           // We can interpret the first word of the stride as an
-                                           // obj only from second stride onwards, as the first
-                                           // stride's first-object may have started on previous
-                                           // page. The only exception is the first page of the
-                                           // moving space.
-                                           if (stride_count > 0
-                                               || stride_begin * kAlignment < kPageSize) {
-                                             mirror::Object* o =
-                                                reinterpret_cast<mirror::Object*>(space_begin
-                                                                                  + stride_begin
-                                                                                  * kAlignment);
-                                             CHECK(live_words_bitmap_->Test(o)) << "ref=" << o;
-                                             CHECK(moving_space_bitmap_->Test(o))
-                                                 << "ref=" << o
-                                                 << " bitmap: "
-                                                 << moving_space_bitmap_->DumpMemAround(o);
-                                             VerifyObject(reinterpret_cast<mirror::Object*>(addr),
-                                                          verify_obj_callback);
-                                           }
-                                         }
-                                         last_stride = addr;
-                                         addr += stride_in_bytes;
-                                         stride_count++;
-                                       });
-  DCHECK_LT(last_stride, start_addr + kPageSize);
+  live_words_bitmap_->VisitLiveStrides(
+      offset,
+      black_allocations_begin_,
+      gPageSize,
+      [&addr, &last_stride, &stride_count, &last_stride_begin, verify_obj_callback, this](
+          uint32_t stride_begin, size_t stride_size, [[maybe_unused]] bool is_last)
+          REQUIRES_SHARED(Locks::mutator_lock_) {
+            const size_t stride_in_bytes = stride_size * kAlignment;
+            DCHECK_LE(stride_in_bytes, gPageSize);
+            last_stride_begin = stride_begin;
+            DCHECK(IsAligned<kAlignment>(addr));
+            memcpy(addr, from_space_begin_ + stride_begin * kAlignment, stride_in_bytes);
+            if (kIsDebugBuild) {
+              uint8_t* space_begin = bump_pointer_space_->Begin();
+              // We can interpret the first word of the stride as an
+              // obj only from second stride onwards, as the first
+              // stride's first-object may have started on previous
+              // page. The only exception is the first page of the
+              // moving space.
+              if (stride_count > 0 || stride_begin * kAlignment < gPageSize) {
+                mirror::Object* o =
+                    reinterpret_cast<mirror::Object*>(space_begin + stride_begin * kAlignment);
+                CHECK(live_words_bitmap_->Test(o)) << "ref=" << o;
+                CHECK(moving_space_bitmap_->Test(o))
+                    << "ref=" << o << " bitmap: " << moving_space_bitmap_->DumpMemAround(o);
+                VerifyObject(reinterpret_cast<mirror::Object*>(addr), verify_obj_callback);
+              }
+            }
+            last_stride = addr;
+            addr += stride_in_bytes;
+            stride_count++;
+          });
+  DCHECK_LT(last_stride, start_addr + gPageSize);
   DCHECK_GT(stride_count, 0u);
   size_t obj_size = 0;
   uint32_t offset_within_obj = offset * kAlignment
@@ -1658,10 +1651,10 @@
       RefsUpdateVisitor</*kCheckBegin*/true, /*kCheckEnd*/true> visitor(this,
                                                                         to_ref,
                                                                         start_addr,
-                                                                        start_addr + kPageSize);
+                                                                        start_addr + gPageSize);
       obj_size = obj->VisitRefsForCompaction</*kFetchObjSize*/true, /*kVisitNativeRoots*/false>(
               visitor, MemberOffset(offset_within_obj), MemberOffset(offset_within_obj
-                                                                     + kPageSize));
+                                                                     + gPageSize));
     }
     obj_size = RoundUp(obj_size, kAlignment);
     DCHECK_GT(obj_size, offset_within_obj)
@@ -1691,7 +1684,7 @@
   }
 
   // Except for the last page being compacted, the pages will have addr ==
-  // start_addr + kPageSize.
+  // start_addr + gPageSize.
   uint8_t* const end_addr = addr;
   addr = start_addr;
   size_t bytes_done = obj_size;
@@ -1699,7 +1692,7 @@
   // checks.
   DCHECK_LE(addr, last_stride);
   size_t bytes_to_visit = last_stride - addr;
-  DCHECK_LE(bytes_to_visit, kPageSize);
+  DCHECK_LE(bytes_to_visit, gPageSize);
   while (bytes_to_visit > bytes_done) {
     mirror::Object* ref = reinterpret_cast<mirror::Object*>(addr + bytes_done);
     VerifyObject(ref, verify_obj_callback);
@@ -1716,13 +1709,13 @@
   // which in case of klass requires 'class_size_'.
   uint8_t* from_addr = from_space_begin_ + last_stride_begin * kAlignment;
   bytes_to_visit = end_addr - addr;
-  DCHECK_LE(bytes_to_visit, kPageSize);
+  DCHECK_LE(bytes_to_visit, gPageSize);
   while (bytes_to_visit > bytes_done) {
     mirror::Object* ref = reinterpret_cast<mirror::Object*>(addr + bytes_done);
     obj = reinterpret_cast<mirror::Object*>(from_addr);
     VerifyObject(ref, verify_obj_callback);
     RefsUpdateVisitor</*kCheckBegin*/false, /*kCheckEnd*/true>
-            visitor(this, ref, nullptr, start_addr + kPageSize);
+            visitor(this, ref, nullptr, start_addr + gPageSize);
     obj_size = obj->VisitRefsForCompaction(visitor,
                                            MemberOffset(0),
                                            MemberOffset(end_addr - (addr + bytes_done)));
@@ -1751,8 +1744,8 @@
   }
   // The last page that we compact may have some bytes left untouched in the
   // end, we should zero them as the kernel copies at page granularity.
-  if (needs_memset_zero && UNLIKELY(bytes_done < kPageSize)) {
-    std::memset(addr + bytes_done, 0x0, kPageSize - bytes_done);
+  if (needs_memset_zero && UNLIKELY(bytes_done < gPageSize)) {
+    std::memset(addr + bytes_done, 0x0, gPageSize - bytes_done);
   }
 }
 
@@ -1767,12 +1760,12 @@
                                  uint8_t* const pre_compact_page,
                                  uint8_t* dest,
                                  bool needs_memset_zero) {
-  DCHECK(IsAligned<kPageSize>(pre_compact_page));
+  DCHECK(IsAlignedParam(pre_compact_page, gPageSize));
   size_t bytes_copied;
   uint8_t* src_addr = reinterpret_cast<uint8_t*>(GetFromSpaceAddr(first_obj));
   uint8_t* pre_compact_addr = reinterpret_cast<uint8_t*>(first_obj);
-  uint8_t* const pre_compact_page_end = pre_compact_page + kPageSize;
-  uint8_t* const dest_page_end = dest + kPageSize;
+  uint8_t* const pre_compact_page_end = pre_compact_page + gPageSize;
+  uint8_t* const dest_page_end = dest + gPageSize;
 
   auto verify_obj_callback = [&] (std::ostream& os) {
                                os << " first_obj=" << first_obj
@@ -1785,7 +1778,7 @@
   // We have empty portion at the beginning of the page. Zero it.
   if (pre_compact_addr > pre_compact_page) {
     bytes_copied = pre_compact_addr - pre_compact_page;
-    DCHECK_LT(bytes_copied, kPageSize);
+    DCHECK_LT(bytes_copied, gPageSize);
     if (needs_memset_zero) {
       std::memset(dest, 0x0, bytes_copied);
     }
@@ -1795,7 +1788,7 @@
     size_t offset = pre_compact_page - pre_compact_addr;
     pre_compact_addr = pre_compact_page;
     src_addr += offset;
-    DCHECK(IsAligned<kPageSize>(src_addr));
+    DCHECK(IsAlignedParam(src_addr, gPageSize));
   }
   // Copy the first chunk of live words
   std::memcpy(dest, src_addr, first_chunk_size);
@@ -1832,7 +1825,7 @@
                 /*kFetchObjSize*/true, /*kVisitNativeRoots*/false>(visitor,
                                                                    MemberOffset(offset),
                                                                    MemberOffset(offset
-                                                                                + kPageSize));
+                                                                                + gPageSize));
         if (first_obj == next_page_first_obj) {
           // First object is the only object on this page. So there's nothing else left to do.
           return;
@@ -1848,9 +1841,9 @@
     bool check_last_obj = false;
     if (next_page_first_obj != nullptr
         && reinterpret_cast<uint8_t*>(next_page_first_obj) < pre_compact_page_end
-        && bytes_copied == kPageSize) {
+        && bytes_copied == gPageSize) {
       size_t diff = pre_compact_page_end - reinterpret_cast<uint8_t*>(next_page_first_obj);
-      DCHECK_LE(diff, kPageSize);
+      DCHECK_LE(diff, gPageSize);
       DCHECK_LE(diff, bytes_to_visit);
       bytes_to_visit -= diff;
       check_last_obj = true;
@@ -1884,7 +1877,7 @@
   }
 
   // Probably a TLAB finished on this page and/or a new TLAB started as well.
-  if (bytes_copied < kPageSize) {
+  if (bytes_copied < gPageSize) {
     src_addr += first_chunk_size;
     pre_compact_addr += first_chunk_size;
     // Use mark-bitmap to identify where objects are. First call
@@ -1900,7 +1893,7 @@
                                                                 [&found_obj](mirror::Object* obj) {
                                                                   found_obj = obj;
                                                                 });
-    size_t remaining_bytes = kPageSize - bytes_copied;
+    size_t remaining_bytes = gPageSize - bytes_copied;
     if (found_obj == nullptr) {
       if (needs_memset_zero) {
         // No more black objects in this page. Zero the remaining bytes and return.
@@ -1953,19 +1946,19 @@
                                     size_t arr_len) {
   DCHECK(minor_fault_initialized_);
   DCHECK_LT(arr_idx, arr_len);
-  DCHECK_ALIGNED(to_space_start, kPageSize);
+  DCHECK_ALIGNED_PARAM(to_space_start, gPageSize);
   // Claim all the contiguous pages, which are ready to be mapped, and then do
   // so in a single ioctl. This helps avoid the overhead of invoking syscall
   // several times and also maps the already-processed pages, avoiding
   // unnecessary faults on them.
-  size_t length = kFirstPageMapping ? kPageSize : 0;
+  size_t length = kFirstPageMapping ? gPageSize : 0;
   if (kFirstPageMapping) {
     arr_idx++;
   }
   // We need to guarantee that we don't end up sucsessfully marking a later
   // page 'mapping' and then fail to mark an earlier page. To guarantee that
   // we use acq_rel order.
-  for (; arr_idx < arr_len; arr_idx++, length += kPageSize) {
+  for (; arr_idx < arr_len; arr_idx++, length += gPageSize) {
     PageState expected_state = PageState::kProcessed;
     if (!state_arr[arr_idx].compare_exchange_strong(
             expected_state, PageState::kProcessedAndMapping, std::memory_order_acq_rel)) {
@@ -2000,17 +1993,17 @@
       // Bail out by setting the remaining pages' state back to kProcessed and
       // then waking up any waiting threads.
       DCHECK_GE(uffd_continue.mapped, 0);
-      DCHECK_ALIGNED(uffd_continue.mapped, kPageSize);
+      DCHECK_ALIGNED_PARAM(uffd_continue.mapped, gPageSize);
       DCHECK_LT(uffd_continue.mapped, static_cast<ssize_t>(length));
       if (kFirstPageMapping) {
         // In this case the first page must be mapped.
-        DCHECK_GE(uffd_continue.mapped, static_cast<ssize_t>(kPageSize));
+        DCHECK_GE(uffd_continue.mapped, static_cast<ssize_t>(gPageSize));
       }
       // Nobody would modify these pages' state simultaneously so only atomic
       // store is sufficient. Use 'release' order to ensure that all states are
       // modified sequentially.
       for (size_t remaining_len = length - uffd_continue.mapped; remaining_len > 0;
-           remaining_len -= kPageSize) {
+           remaining_len -= gPageSize) {
         arr_idx--;
         DCHECK_EQ(state_arr[arr_idx].load(std::memory_order_relaxed),
                   PageState::kProcessedAndMapping);
@@ -2034,7 +2027,7 @@
     if (use_uffd_sigbus_) {
       // Nobody else would modify these pages' state simultaneously so atomic
       // store is sufficient.
-      for (; uffd_continue.mapped > 0; uffd_continue.mapped -= kPageSize) {
+      for (; uffd_continue.mapped > 0; uffd_continue.mapped -= gPageSize) {
         arr_idx--;
         DCHECK_EQ(state_arr[arr_idx].load(std::memory_order_relaxed),
                   PageState::kProcessedAndMapping);
@@ -2046,13 +2039,13 @@
 
 void MarkCompact::ZeropageIoctl(void* addr, bool tolerate_eexist, bool tolerate_enoent) {
   struct uffdio_zeropage uffd_zeropage;
-  DCHECK(IsAligned<kPageSize>(addr));
+  DCHECK(IsAlignedParam(addr, gPageSize));
   uffd_zeropage.range.start = reinterpret_cast<uintptr_t>(addr);
-  uffd_zeropage.range.len = kPageSize;
+  uffd_zeropage.range.len = gPageSize;
   uffd_zeropage.mode = 0;
   int ret = ioctl(uffd_, UFFDIO_ZEROPAGE, &uffd_zeropage);
   if (LIKELY(ret == 0)) {
-    DCHECK_EQ(uffd_zeropage.zeropage, static_cast<ssize_t>(kPageSize));
+    DCHECK_EQ(uffd_zeropage.zeropage, static_cast<ssize_t>(gPageSize));
   } else {
     CHECK((tolerate_enoent && errno == ENOENT) || (tolerate_eexist && errno == EEXIST))
         << "ioctl_userfaultfd: zeropage failed: " << strerror(errno) << ". addr:" << addr;
@@ -2063,12 +2056,12 @@
   struct uffdio_copy uffd_copy;
   uffd_copy.src = reinterpret_cast<uintptr_t>(buffer);
   uffd_copy.dst = reinterpret_cast<uintptr_t>(dst);
-  uffd_copy.len = kPageSize;
+  uffd_copy.len = gPageSize;
   uffd_copy.mode = 0;
   CHECK_EQ(ioctl(uffd_, UFFDIO_COPY, &uffd_copy), 0)
       << "ioctl_userfaultfd: copy failed: " << strerror(errno) << ". src:" << buffer
       << " dst:" << dst;
-  DCHECK_EQ(uffd_copy.copy, static_cast<ssize_t>(kPageSize));
+  DCHECK_EQ(uffd_copy.copy, static_cast<ssize_t>(gPageSize));
 }
 
 template <int kMode, typename CompactionFn>
@@ -2153,7 +2146,7 @@
   // normal cases as objects are smaller than page size.
   if (idx >= moving_first_objs_count_) {
     // black-allocated portion of the moving-space
-    idx_addr = black_allocations_begin_ + (idx - moving_first_objs_count_) * kPageSize;
+    idx_addr = black_allocations_begin_ + (idx - moving_first_objs_count_) * gPageSize;
     reclaim_begin = idx_addr;
     mirror::Object* first_obj = first_objs_moving_space_[idx].AsMirrorPtr();
     if (first_obj != nullptr && reinterpret_cast<uint8_t*>(first_obj) < reclaim_begin) {
@@ -2164,8 +2157,8 @@
         // not used yet. So we can compute its from-space page and use that.
         if (obj != first_obj) {
           reclaim_begin = obj != nullptr
-                          ? AlignUp(reinterpret_cast<uint8_t*>(obj), kPageSize)
-                          : (black_allocations_begin_ + (i - moving_first_objs_count_) * kPageSize);
+                          ? AlignUp(reinterpret_cast<uint8_t*>(obj), gPageSize)
+                          : (black_allocations_begin_ + (i - moving_first_objs_count_) * gPageSize);
           break;
         }
       }
@@ -2192,12 +2185,12 @@
         reclaim_begin = black_allocations_begin_;
       }
     }
-    reclaim_begin = AlignUp(reclaim_begin, kPageSize);
+    reclaim_begin = AlignUp(reclaim_begin, gPageSize);
   }
 
   DCHECK_NE(reclaim_begin, nullptr);
-  DCHECK_ALIGNED(reclaim_begin, kPageSize);
-  DCHECK_ALIGNED(last_reclaimed_page_, kPageSize);
+  DCHECK_ALIGNED_PARAM(reclaim_begin, gPageSize);
+  DCHECK_ALIGNED_PARAM(last_reclaimed_page_, gPageSize);
   // Check if the 'class_after_obj_map_' map allows pages to be freed.
   for (; class_after_obj_iter_ != class_after_obj_ordered_map_.rend(); class_after_obj_iter_++) {
     mirror::Object* klass = class_after_obj_iter_->first.AsMirrorPtr();
@@ -2213,7 +2206,7 @@
       if (obj_addr < idx_addr) {
         // Its lowest-address object is not compacted yet. Reclaim starting from
         // the end of this class.
-        reclaim_begin = AlignUp(klass_end, kPageSize);
+        reclaim_begin = AlignUp(klass_end, gPageSize);
       } else {
         // Continue consuming pairs wherein the lowest address object has already
         // been compacted.
@@ -2273,14 +2266,14 @@
   TimingLogger::ScopedTiming t(__FUNCTION__, GetTimings());
   size_t page_status_arr_len = moving_first_objs_count_ + black_page_count_;
   size_t idx = page_status_arr_len;
-  uint8_t* to_space_end = bump_pointer_space_->Begin() + page_status_arr_len * kPageSize;
+  uint8_t* to_space_end = bump_pointer_space_->Begin() + page_status_arr_len * gPageSize;
   uint8_t* shadow_space_end = nullptr;
   if (kMode == kMinorFaultMode) {
-    shadow_space_end = shadow_to_space_map_.Begin() + page_status_arr_len * kPageSize;
+    shadow_space_end = shadow_to_space_map_.Begin() + page_status_arr_len * gPageSize;
   }
-  uint8_t* pre_compact_page = black_allocations_begin_ + (black_page_count_ * kPageSize);
+  uint8_t* pre_compact_page = black_allocations_begin_ + (black_page_count_ * gPageSize);
 
-  DCHECK(IsAligned<kPageSize>(pre_compact_page));
+  DCHECK(IsAlignedParam(pre_compact_page, gPageSize));
 
   UpdateClassAfterObjMap();
   // These variables are maintained by FreeFromSpacePages().
@@ -2291,10 +2284,10 @@
   mirror::Object* next_page_first_obj = nullptr;
   while (idx > moving_first_objs_count_) {
     idx--;
-    pre_compact_page -= kPageSize;
-    to_space_end -= kPageSize;
+    pre_compact_page -= gPageSize;
+    to_space_end -= gPageSize;
     if (kMode == kMinorFaultMode) {
-      shadow_space_end -= kPageSize;
+      shadow_space_end -= gPageSize;
       page = shadow_space_end;
     } else if (kMode == kFallbackMode) {
       page = to_space_end;
@@ -2316,7 +2309,7 @@
                                              });
       // We are sliding here, so no point attempting to madvise for every
       // page. Wait for enough pages to be done.
-      if (idx % (kMinFromSpaceMadviseSize / kPageSize) == 0) {
+      if (idx % DivideByPageSize(kMinFromSpaceMadviseSize) == 0) {
         FreeFromSpacePages(idx, kMode);
       }
     }
@@ -2326,9 +2319,9 @@
 
   while (idx > 0) {
     idx--;
-    to_space_end -= kPageSize;
+    to_space_end -= gPageSize;
     if (kMode == kMinorFaultMode) {
-      shadow_space_end -= kPageSize;
+      shadow_space_end -= gPageSize;
       page = shadow_space_end;
     } else if (kMode == kFallbackMode) {
       page = to_space_end;
@@ -2344,7 +2337,7 @@
 }
 
 void MarkCompact::UpdateNonMovingPage(mirror::Object* first, uint8_t* page) {
-  DCHECK_LT(reinterpret_cast<uint8_t*>(first), page + kPageSize);
+  DCHECK_LT(reinterpret_cast<uint8_t*>(first), page + gPageSize);
   // For every object found in the page, visit the previous object. This ensures
   // that we can visit without checking page-end boundary.
   // Call VisitRefsForCompaction with from-space read-barrier as the klass object and
@@ -2354,14 +2347,14 @@
   mirror::Object* curr_obj = first;
   non_moving_space_bitmap_->VisitMarkedRange(
           reinterpret_cast<uintptr_t>(first) + mirror::kObjectHeaderSize,
-          reinterpret_cast<uintptr_t>(page + kPageSize),
+          reinterpret_cast<uintptr_t>(page + gPageSize),
           [&](mirror::Object* next_obj) {
             // TODO: Once non-moving space update becomes concurrent, we'll
             // require fetching the from-space address of 'curr_obj' and then call
             // visitor on that.
             if (reinterpret_cast<uint8_t*>(curr_obj) < page) {
               RefsUpdateVisitor</*kCheckBegin*/true, /*kCheckEnd*/false>
-                      visitor(this, curr_obj, page, page + kPageSize);
+                      visitor(this, curr_obj, page, page + gPageSize);
               MemberOffset begin_offset(page - reinterpret_cast<uint8_t*>(curr_obj));
               // Native roots shouldn't be visited as they are done when this
               // object's beginning was visited in the preceding page.
@@ -2369,7 +2362,7 @@
                       visitor, begin_offset, MemberOffset(-1));
             } else {
               RefsUpdateVisitor</*kCheckBegin*/false, /*kCheckEnd*/false>
-                      visitor(this, curr_obj, page, page + kPageSize);
+                      visitor(this, curr_obj, page, page + gPageSize);
               curr_obj->VisitRefsForCompaction</*kFetchObjSize*/false>(visitor,
                                                                        MemberOffset(0),
                                                                        MemberOffset(-1));
@@ -2377,15 +2370,15 @@
             curr_obj = next_obj;
           });
 
-  MemberOffset end_offset(page + kPageSize - reinterpret_cast<uint8_t*>(curr_obj));
+  MemberOffset end_offset(page + gPageSize - reinterpret_cast<uint8_t*>(curr_obj));
   if (reinterpret_cast<uint8_t*>(curr_obj) < page) {
     RefsUpdateVisitor</*kCheckBegin*/true, /*kCheckEnd*/true>
-            visitor(this, curr_obj, page, page + kPageSize);
+            visitor(this, curr_obj, page, page + gPageSize);
     curr_obj->VisitRefsForCompaction</*kFetchObjSize*/false, /*kVisitNativeRoots*/false>(
             visitor, MemberOffset(page - reinterpret_cast<uint8_t*>(curr_obj)), end_offset);
   } else {
     RefsUpdateVisitor</*kCheckBegin*/false, /*kCheckEnd*/true>
-            visitor(this, curr_obj, page, page + kPageSize);
+            visitor(this, curr_obj, page, page + gPageSize);
     curr_obj->VisitRefsForCompaction</*kFetchObjSize*/false>(visitor, MemberOffset(0), end_offset);
   }
 }
@@ -2398,10 +2391,10 @@
   // TODO: If and when we make non-moving space update concurrent, implement a
   // mechanism to remember class pointers for such objects off-heap and pass it
   // to VisitRefsForCompaction().
-  uint8_t* page = non_moving_space_->Begin() + non_moving_first_objs_count_ * kPageSize;
+  uint8_t* page = non_moving_space_->Begin() + non_moving_first_objs_count_ * gPageSize;
   for (ssize_t i = non_moving_first_objs_count_ - 1; i >= 0; i--) {
     mirror::Object* obj = first_objs_non_moving_space_[i].AsMirrorPtr();
-    page -= kPageSize;
+    page -= gPageSize;
     // null means there are no objects on the page to update references.
     if (obj != nullptr) {
       UpdateNonMovingPage(obj, page);
@@ -2419,7 +2412,7 @@
   // size in black_alloc_pages_first_chunk_size_ array.
   // For the pages which may have holes after the first chunk, which could happen
   // if a new TLAB starts in the middle of the page, we mark the objects in
-  // the mark-bitmap. So, if the first-chunk size is smaller than kPageSize,
+  // the mark-bitmap. So, if the first-chunk size is smaller than gPageSize,
   // then we use the mark-bitmap for the remainder of the page.
   uint8_t* const begin = bump_pointer_space_->Begin();
   uint8_t* black_allocs = black_allocations_begin_;
@@ -2472,9 +2465,9 @@
         }
         // Handle objects which cross page boundary, including objects larger
         // than page size.
-        if (remaining_chunk_size + obj_size >= kPageSize) {
+        if (remaining_chunk_size + obj_size >= gPageSize) {
           set_mark_bit = false;
-          first_chunk_size += kPageSize - remaining_chunk_size;
+          first_chunk_size += gPageSize - remaining_chunk_size;
           remaining_chunk_size += obj_size;
           // We should not store first-object and remaining_chunk_size if there were
           // unused bytes before this TLAB, in which case we must have already
@@ -2484,13 +2477,13 @@
             first_objs_moving_space_[black_page_idx].Assign(first_obj);
           }
           black_page_idx++;
-          remaining_chunk_size -= kPageSize;
+          remaining_chunk_size -= gPageSize;
           // Consume an object larger than page size.
-          while (remaining_chunk_size >= kPageSize) {
-            black_alloc_pages_first_chunk_size_[black_page_idx] = kPageSize;
+          while (remaining_chunk_size >= gPageSize) {
+            black_alloc_pages_first_chunk_size_[black_page_idx] = gPageSize;
             first_objs_moving_space_[black_page_idx].Assign(obj);
             black_page_idx++;
-            remaining_chunk_size -= kPageSize;
+            remaining_chunk_size -= gPageSize;
           }
           first_obj = remaining_chunk_size > 0 ? obj : nullptr;
           first_chunk_size = remaining_chunk_size;
@@ -2503,7 +2496,7 @@
         obj = reinterpret_cast<mirror::Object*>(black_allocs);
       }
       DCHECK_LE(black_allocs, block_end);
-      DCHECK_LT(remaining_chunk_size, kPageSize);
+      DCHECK_LT(remaining_chunk_size, gPageSize);
       // consume the unallocated portion of the block
       if (black_allocs < block_end) {
         // first-chunk of the current page ends here. Store it.
@@ -2513,20 +2506,20 @@
         }
         first_chunk_size = 0;
         first_obj = nullptr;
-        size_t page_remaining = kPageSize - remaining_chunk_size;
+        size_t page_remaining = gPageSize - remaining_chunk_size;
         size_t block_remaining = block_end - black_allocs;
         if (page_remaining <= block_remaining) {
           block_remaining -= page_remaining;
           // current page and the subsequent empty pages in the block
-          black_page_idx += 1 + block_remaining / kPageSize;
-          remaining_chunk_size = block_remaining % kPageSize;
+          black_page_idx += 1 + DivideByPageSize(block_remaining);
+          remaining_chunk_size = ModuloPageSize(block_remaining);
         } else {
           remaining_chunk_size += block_remaining;
         }
         black_allocs = block_end;
       }
     }
-    if (black_page_idx < bump_pointer_space_->Size() / kPageSize) {
+    if (black_page_idx < DivideByPageSize(bump_pointer_space_->Size())) {
       // Store the leftover first-chunk, if any, and update page index.
       if (black_alloc_pages_first_chunk_size_[black_page_idx] > 0) {
         black_page_idx++;
@@ -2574,22 +2567,22 @@
       non_moving_space_bitmap_->Set(obj);
       // Clear so that we don't try to set the bit again in the next GC-cycle.
       it->Clear();
-      size_t idx = (reinterpret_cast<uint8_t*>(obj) - space_begin) / kPageSize;
-      uint8_t* page_begin = AlignDown(reinterpret_cast<uint8_t*>(obj), kPageSize);
+      size_t idx = DivideByPageSize(reinterpret_cast<uint8_t*>(obj) - space_begin);
+      uint8_t* page_begin = AlignDown(reinterpret_cast<uint8_t*>(obj), gPageSize);
       mirror::Object* first_obj = first_objs_non_moving_space_[idx].AsMirrorPtr();
       if (first_obj == nullptr
           || (obj < first_obj && reinterpret_cast<uint8_t*>(first_obj) > page_begin)) {
         first_objs_non_moving_space_[idx].Assign(obj);
       }
       mirror::Object* next_page_first_obj = first_objs_non_moving_space_[++idx].AsMirrorPtr();
-      uint8_t* next_page_begin = page_begin + kPageSize;
+      uint8_t* next_page_begin = page_begin + gPageSize;
       if (next_page_first_obj == nullptr
           || reinterpret_cast<uint8_t*>(next_page_first_obj) > next_page_begin) {
         size_t obj_size = RoundUp(obj->SizeOf<kDefaultVerifyFlags>(), kAlignment);
         uint8_t* obj_end = reinterpret_cast<uint8_t*>(obj) + obj_size;
         while (next_page_begin < obj_end) {
           first_objs_non_moving_space_[idx++].Assign(obj);
-          next_page_begin += kPageSize;
+          next_page_begin += gPageSize;
         }
       }
       // update first_objs count in case we went past non_moving_first_objs_count_
@@ -2666,8 +2659,8 @@
   void MultiObjectArena(uint8_t* page_begin, uint8_t* first_obj)
       REQUIRES_SHARED(Locks::mutator_lock_) {
     DCHECK(first_obj != nullptr);
-    DCHECK_ALIGNED(page_begin, kPageSize);
-    uint8_t* page_end = page_begin + kPageSize;
+    DCHECK_ALIGNED_PARAM(page_begin, gPageSize);
+    uint8_t* page_end = page_begin + gPageSize;
     uint32_t obj_size;
     for (uint8_t* byte = first_obj; byte < page_end;) {
       TrackingHeader* header = reinterpret_cast<TrackingHeader*>(byte);
@@ -3079,7 +3072,7 @@
   int mode = kCopyMode;
   size_t moving_space_register_sz;
   if (minor_fault_initialized_) {
-    moving_space_register_sz = (moving_first_objs_count_ + black_page_count_) * kPageSize;
+    moving_space_register_sz = (moving_first_objs_count_ + black_page_count_) * gPageSize;
     if (shadow_to_space_map_.IsValid()) {
       size_t shadow_size = shadow_to_space_map_.Size();
       void* addr = shadow_to_space_map_.Begin();
@@ -3193,14 +3186,14 @@
       } else {
         struct uffdio_range uffd_range;
         uffd_range.start = msg.arg.pagefault.address;
-        uffd_range.len = kPageSize;
+        uffd_range.len = gPageSize;
         CHECK_EQ(ioctl(uffd_, UFFDIO_WAKE, &uffd_range), 0)
             << "ioctl_userfaultfd: wake failed for concurrent-compaction termination page: "
             << strerror(errno);
       }
       break;
     }
-    uint8_t* fault_page = AlignDown(fault_addr, kPageSize);
+    uint8_t* fault_page = AlignDown(fault_addr, gPageSize);
     if (HasAddress(reinterpret_cast<mirror::Object*>(fault_addr))) {
       ConcurrentlyProcessMovingPage<kMode>(fault_page, buf, nr_moving_space_used_pages);
     } else if (minor_fault_initialized_) {
@@ -3254,7 +3247,7 @@
   }
 
   ScopedInProgressCount spc(this);
-  uint8_t* fault_page = AlignDown(reinterpret_cast<uint8_t*>(info->si_addr), kPageSize);
+  uint8_t* fault_page = AlignDown(reinterpret_cast<uint8_t*>(info->si_addr), gPageSize);
   if (!spc.IsCompactionDone()) {
     if (HasAddress(reinterpret_cast<mirror::Object*>(fault_page))) {
       Thread* self = Thread::Current();
@@ -3328,8 +3321,8 @@
   };
 
   uint8_t* unused_space_begin =
-      bump_pointer_space_->Begin() + nr_moving_space_used_pages * kPageSize;
-  DCHECK(IsAligned<kPageSize>(unused_space_begin));
+      bump_pointer_space_->Begin() + nr_moving_space_used_pages * gPageSize;
+  DCHECK(IsAlignedParam(unused_space_begin, gPageSize));
   DCHECK(kMode == kCopyMode || fault_page < unused_space_begin);
   if (kMode == kCopyMode && fault_page >= unused_space_begin) {
     // There is a race which allows more than one thread to install a
@@ -3338,7 +3331,7 @@
     ZeropageIoctl(fault_page, /*tolerate_eexist=*/true, /*tolerate_enoent=*/true);
     return;
   }
-  size_t page_idx = (fault_page - bump_pointer_space_->Begin()) / kPageSize;
+  size_t page_idx = DivideByPageSize(fault_page - bump_pointer_space_->Begin());
   DCHECK_LT(page_idx, moving_first_objs_count_ + black_page_count_);
   mirror::Object* first_obj = first_objs_moving_space_[page_idx].AsMirrorPtr();
   if (first_obj == nullptr) {
@@ -3374,13 +3367,13 @@
                 state, PageState::kMutatorProcessing, std::memory_order_acq_rel)) {
           if (kMode == kMinorFaultMode) {
             DCHECK_EQ(buf, nullptr);
-            buf = shadow_to_space_map_.Begin() + page_idx * kPageSize;
+            buf = shadow_to_space_map_.Begin() + page_idx * gPageSize;
           } else if (UNLIKELY(buf == nullptr)) {
             DCHECK_EQ(kMode, kCopyMode);
             uint16_t idx = compaction_buffer_counter_.fetch_add(1, std::memory_order_relaxed);
             // The buffer-map is one page bigger as the first buffer is used by GC-thread.
             CHECK_LE(idx, kMutatorCompactionBufferCount);
-            buf = compaction_buffers_map_.Begin() + idx * kPageSize;
+            buf = compaction_buffers_map_.Begin() + idx * gPageSize;
             DCHECK(compaction_buffers_map_.HasAddress(buf));
             Thread::Current()->SetThreadLocalGcBuffer(buf);
           }
@@ -3398,7 +3391,7 @@
             if (page_idx + 1 < moving_first_objs_count_ + black_page_count_) {
               next_page_first_obj = first_objs_moving_space_[page_idx + 1].AsMirrorPtr();
             }
-            DCHECK(IsAligned<kPageSize>(pre_compact_page));
+            DCHECK(IsAlignedParam(pre_compact_page, gPageSize));
             SlideBlackPage(first_obj,
                            next_page_first_obj,
                            first_chunk_size,
@@ -3526,7 +3519,7 @@
     }
     DCHECK_NE(space_data, nullptr);
     ptrdiff_t diff = space_data->shadow_.Begin() - space_data->begin_;
-    size_t page_idx = (fault_page - space_data->begin_) / kPageSize;
+    size_t page_idx = DivideByPageSize(fault_page - space_data->begin_);
     Atomic<PageState>* state_arr =
         reinterpret_cast<Atomic<PageState>*>(space_data->page_status_map_.Begin());
     PageState state = state_arr[page_idx].load(use_uffd_sigbus_ ? std::memory_order_acquire :
@@ -3547,7 +3540,7 @@
               if (first_obj != nullptr) {
                 updater.MultiObjectArena(fault_page + diff, first_obj + diff);
               } else {
-                updater.SingleObjectArena(fault_page + diff, kPageSize);
+                updater.SingleObjectArena(fault_page + diff, gPageSize);
               }
               if (kMode == kCopyMode) {
                 MapUpdatedLinearAllocPage(fault_page,
@@ -3637,7 +3630,7 @@
         continue;
       }
       uint8_t* last_byte = pair.second;
-      DCHECK_ALIGNED(last_byte, kPageSize);
+      DCHECK_ALIGNED_PARAM(last_byte, gPageSize);
       others_processing = false;
       arena_begin = arena->Begin();
       arena_size = arena->Size();
@@ -3661,7 +3654,7 @@
           return;
         }
         LinearAllocPageUpdater updater(this);
-        size_t page_idx = (page_begin - space_data->begin_) / kPageSize;
+        size_t page_idx = DivideByPageSize(page_begin - space_data->begin_);
         DCHECK_LT(page_idx, space_data->page_status_map_.Size());
         Atomic<PageState>* state_arr =
             reinterpret_cast<Atomic<PageState>*>(space_data->page_status_map_.Begin());
@@ -3678,7 +3671,7 @@
           if (first_obj != nullptr) {
             updater.MultiObjectArena(page_begin + diff, first_obj + diff);
           } else {
-            DCHECK_EQ(page_size, kPageSize);
+            DCHECK_EQ(page_size, gPageSize);
             updater.SingleObjectArena(page_begin + diff, page_size);
           }
           expected_state = PageState::kProcessing;
@@ -3706,7 +3699,7 @@
     // processing any pages in this arena, then we can madvise the shadow size.
     // Otherwise, we will double the memory use for linear-alloc.
     if (!minor_fault_initialized_ && !others_processing) {
-      ZeroAndReleasePages(arena_begin + diff, arena_size);
+      ZeroAndReleaseMemory(arena_begin + diff, arena_size);
     }
   }
 }
@@ -3754,7 +3747,7 @@
   }
 
   size_t moving_space_size = bump_pointer_space_->Capacity();
-  size_t used_size = (moving_first_objs_count_ + black_page_count_) * kPageSize;
+  size_t used_size = (moving_first_objs_count_ + black_page_count_) * gPageSize;
   if (CanCompactMovingSpaceWithMinorFault()) {
     CompactMovingSpace<kMinorFaultMode>(/*page=*/nullptr);
   } else {
@@ -3845,11 +3838,11 @@
       count &= ~kSigbusCounterCompactionDoneMask;
     }
   } else {
-    DCHECK(IsAligned<kPageSize>(conc_compaction_termination_page_));
+    DCHECK(IsAlignedParam(conc_compaction_termination_page_, gPageSize));
     // We will only iterate once if gKernelHasFaultRetry is true.
     do {
       // madvise the page so that we can get userfaults on it.
-      ZeroAndReleasePages(conc_compaction_termination_page_, kPageSize);
+      ZeroAndReleaseMemory(conc_compaction_termination_page_, gPageSize);
       // The following load triggers 'special' userfaults. When received by the
       // thread-pool workers, they will exit out of the compaction task. This fault
       // happens because we madvised the page.
@@ -3888,9 +3881,10 @@
     Flush();
   }
 
-  void VisitRoots(mirror::Object*** roots, size_t count, const RootInfo& info ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(Locks::heap_bitmap_lock_) {
+  void VisitRoots(mirror::Object*** roots,
+                  size_t count,
+                  [[maybe_unused]] const RootInfo& info) override
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::heap_bitmap_lock_) {
     for (size_t i = 0; i < count; i++) {
       mirror::Object* obj = *roots[i];
       if (mark_compact_->MarkObjectNonNullNoPush</*kParallel*/true>(obj)) {
@@ -3901,9 +3895,8 @@
 
   void VisitRoots(mirror::CompressedReference<mirror::Object>** roots,
                   size_t count,
-                  const RootInfo& info ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(Locks::heap_bitmap_lock_) {
+                  [[maybe_unused]] const RootInfo& info) override
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::heap_bitmap_lock_) {
     for (size_t i = 0; i < count; i++) {
       mirror::Object* obj = roots[i]->AsMirrorPtr();
       if (mark_compact_->MarkObjectNonNullNoPush</*kParallel*/true>(obj)) {
@@ -4158,9 +4151,8 @@
 
   ALWAYS_INLINE void operator()(mirror::Object* obj,
                                 MemberOffset offset,
-                                bool is_static ATTRIBUTE_UNUSED) const
-      REQUIRES(Locks::heap_bitmap_lock_)
-      REQUIRES_SHARED(Locks::mutator_lock_) {
+                                [[maybe_unused]] bool is_static) const
+      REQUIRES(Locks::heap_bitmap_lock_) REQUIRES_SHARED(Locks::mutator_lock_) {
     if (kCheckLocks) {
       Locks::mutator_lock_->AssertSharedHeld(Thread::Current());
       Locks::heap_bitmap_lock_->AssertExclusiveHeld(Thread::Current());
@@ -4297,10 +4289,10 @@
     return false;
   } else {
     // Must be a large-object space, otherwise it's a case of heap corruption.
-    if (!IsAligned<kPageSize>(obj)) {
-      // Objects in large-object space are page aligned. So if we have an object
-      // which doesn't belong to any space and is not page-aligned as well, then
-      // it's memory corruption.
+    if (!IsAlignedParam(obj, space::LargeObjectSpace::ObjectAlignment())) {
+      // Objects in large-object space are aligned to the large-object alignment.
+      // So if we have an object which doesn't belong to any space and is not
+      // page-aligned as well, then it's memory corruption.
       // TODO: implement protect/unprotect in bump-pointer space.
       heap_->GetVerification()->LogHeapCorruption(holder, offset, obj, /*fatal*/ true);
     }
@@ -4335,7 +4327,7 @@
 }
 
 void MarkCompact::MarkHeapReference(mirror::HeapReference<mirror::Object>* obj,
-                                    bool do_atomic_update ATTRIBUTE_UNUSED) {
+                                    [[maybe_unused]] bool do_atomic_update) {
   MarkObject(obj->AsMirrorPtr(), nullptr, MemberOffset(0));
 }
 
@@ -4395,7 +4387,7 @@
         << " doesn't belong to any of the spaces and large object space doesn't exist";
     accounting::LargeObjectBitmap* los_bitmap = heap_->GetLargeObjectsSpace()->GetMarkBitmap();
     if (los_bitmap->HasAddress(obj)) {
-      DCHECK(IsAligned<kPageSize>(obj));
+      DCHECK(IsAlignedParam(obj, space::LargeObjectSpace::ObjectAlignment()));
       return los_bitmap->Test(obj) ? obj : nullptr;
     } else {
       // The given obj is not in any of the known spaces, so return null. This could
@@ -4409,7 +4401,7 @@
 }
 
 bool MarkCompact::IsNullOrMarkedHeapReference(mirror::HeapReference<mirror::Object>* obj,
-                                              bool do_atomic_update ATTRIBUTE_UNUSED) {
+                                              [[maybe_unused]] bool do_atomic_update) {
   mirror::Object* ref = obj->AsMirrorPtr();
   if (ref == nullptr) {
     return true;
@@ -4436,14 +4428,14 @@
   // physical memory because we already madvised it above and then we triggered a read
   // userfault, which maps a special zero-page.
   if (use_uffd_sigbus_ || !minor_fault_initialized_ || !shadow_to_space_map_.IsValid() ||
-      shadow_to_space_map_.Size() < (moving_first_objs_count_ + black_page_count_) * kPageSize) {
-    size_t adjustment = use_uffd_sigbus_ ? 0 : kPageSize;
-    ZeroAndReleasePages(compaction_buffers_map_.Begin() + adjustment,
-                        compaction_buffers_map_.Size() - adjustment);
+      shadow_to_space_map_.Size() < (moving_first_objs_count_ + black_page_count_) * gPageSize) {
+    size_t adjustment = use_uffd_sigbus_ ? 0 : gPageSize;
+    ZeroAndReleaseMemory(compaction_buffers_map_.Begin() + adjustment,
+                         compaction_buffers_map_.Size() - adjustment);
   } else if (shadow_to_space_map_.Size() == bump_pointer_space_->Capacity()) {
     // Now that we are going to use minor-faults from next GC cycle, we can
     // unmap the buffers used by worker threads.
-    compaction_buffers_map_.SetSize(kPageSize);
+    compaction_buffers_map_.SetSize(gPageSize);
   }
   info_map_.MadviseDontNeedAndZero();
   live_words_bitmap_->ClearBitmap();
diff --git a/runtime/gc/collector/mark_compact.h b/runtime/gc/collector/mark_compact.h
index 1ecb49a..076249b 100644
--- a/runtime/gc/collector/mark_compact.h
+++ b/runtime/gc/collector/mark_compact.h
@@ -37,9 +37,9 @@
 #include "immune_spaces.h"
 #include "offsets.h"
 
-namespace art {
+namespace art HIDDEN {
 
-bool KernelSupportsUffd();
+EXPORT bool KernelSupportsUffd();
 
 namespace mirror {
 class DexCache;
@@ -182,7 +182,7 @@
   // consider using 128-bit in order to halve the chunk-info size.
   static constexpr uint32_t kBitsPerVectorWord = kBitsPerIntPtrT;
   static constexpr uint32_t kOffsetChunkSize = kBitsPerVectorWord * kAlignment;
-  static_assert(kOffsetChunkSize < kPageSize);
+  static_assert(kOffsetChunkSize < kMinPageSize);
   // Bitmap with bits corresponding to every live word set. For an object
   // which is 4 words in size will have the corresponding 4 bits set. This is
   // required for efficient computation of new-address (post-compaction) from
@@ -333,8 +333,8 @@
   // during concurrent compaction.
   void PrepareForCompaction() REQUIRES_SHARED(Locks::mutator_lock_);
 
-  // Copy kPageSize live bytes starting from 'offset' (within the moving space),
-  // which must be within 'obj', into the kPageSize sized memory pointed by 'addr'.
+  // Copy gPageSize live bytes starting from 'offset' (within the moving space),
+  // which must be within 'obj', into the gPageSize sized memory pointed by 'addr'.
   // Then update the references within the copied objects. The boundary objects are
   // partially updated such that only the references that lie in the page are updated.
   // This is necessary to avoid cascading userfaults.
@@ -382,7 +382,7 @@
   // Slides (retain the empty holes, which are usually part of some in-use TLAB)
   // black page in the moving space. 'first_obj' is the object that overlaps with
   // the first byte of the page being slid. pre_compact_page is the pre-compact
-  // address of the page being slid. 'dest' is the kPageSize sized memory where
+  // address of the page being slid. 'dest' is the gPageSize sized memory where
   // the contents would be copied.
   void SlideBlackPage(mirror::Object* first_obj,
                       mirror::Object* next_page_first_obj,
diff --git a/runtime/gc/collector/mark_sweep-inl.h b/runtime/gc/collector/mark_sweep-inl.h
index 2257b0d..2eac037 100644
--- a/runtime/gc/collector/mark_sweep-inl.h
+++ b/runtime/gc/collector/mark_sweep-inl.h
@@ -25,7 +25,7 @@
 #include "mirror/object_array-inl.h"
 #include "mirror/reference.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc
index 4fefe65..984d71c 100644
--- a/runtime/gc/collector/mark_sweep.cc
+++ b/runtime/gc/collector/mark_sweep.cc
@@ -46,7 +46,7 @@
 #include "thread-current-inl.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
@@ -105,7 +105,7 @@
   std::string error_msg;
   sweep_array_free_buffer_mem_map_ = MemMap::MapAnonymous(
       "mark sweep sweep array free buffer",
-      RoundUp(kSweepArrayChunkFreeSize * sizeof(mirror::Object*), kPageSize),
+      RoundUp(kSweepArrayChunkFreeSize * sizeof(mirror::Object*), gPageSize),
       PROT_READ | PROT_WRITE,
       /*low_4gb=*/ false,
       &error_msg);
@@ -416,7 +416,7 @@
 }
 
 bool MarkSweep::IsNullOrMarkedHeapReference(mirror::HeapReference<mirror::Object>* ref,
-                                            bool do_atomic_update ATTRIBUTE_UNUSED) {
+                                            [[maybe_unused]] bool do_atomic_update) {
   mirror::Object* obj = ref->AsMirrorPtr();
   if (obj == nullptr) {
     return true;
@@ -440,7 +440,8 @@
       ++mark_sweep_->large_object_mark_;
     }
     space::LargeObjectSpace* large_object_space = mark_sweep_->GetHeap()->GetLargeObjectsSpace();
-    if (UNLIKELY(obj == nullptr || !IsAligned<kPageSize>(obj) ||
+    if (UNLIKELY(obj == nullptr ||
+                 !IsAlignedParam(obj, space::LargeObjectSpace::ObjectAlignment()) ||
                  (kIsDebugBuild && large_object_space != nullptr &&
                      !large_object_space->Contains(obj)))) {
       // Lowest priority logging first:
@@ -558,7 +559,7 @@
 }
 
 void MarkSweep::MarkHeapReference(mirror::HeapReference<mirror::Object>* ref,
-                                  bool do_atomic_update ATTRIBUTE_UNUSED) {
+                                  [[maybe_unused]] bool do_atomic_update) {
   MarkObject(ref->AsMirrorPtr(), nullptr, MemberOffset(0));
 }
 
@@ -588,7 +589,7 @@
 
 void MarkSweep::VisitRoots(mirror::Object*** roots,
                            size_t count,
-                           const RootInfo& info ATTRIBUTE_UNUSED) {
+                           [[maybe_unused]] const RootInfo& info) {
   for (size_t i = 0; i < count; ++i) {
     MarkObjectNonNull(*roots[i]);
   }
@@ -596,7 +597,7 @@
 
 void MarkSweep::VisitRoots(mirror::CompressedReference<mirror::Object>** roots,
                            size_t count,
-                           const RootInfo& info ATTRIBUTE_UNUSED) {
+                           [[maybe_unused]] const RootInfo& info) {
   for (size_t i = 0; i < count; ++i) {
     MarkObjectNonNull(roots[i]->AsMirrorPtr());
   }
@@ -698,8 +699,8 @@
         : chunk_task_(chunk_task), mark_sweep_(mark_sweep) {}
 
     ALWAYS_INLINE void operator()(mirror::Object* obj,
-                    MemberOffset offset,
-                    bool is_static ATTRIBUTE_UNUSED) const
+                                  MemberOffset offset,
+                                  [[maybe_unused]] bool is_static) const
         REQUIRES_SHARED(Locks::mutator_lock_) {
       Mark(obj->GetFieldObject<mirror::Object>(offset));
     }
@@ -793,8 +794,7 @@
   }
 
   // Scans all of the objects
-  void Run(Thread* self ATTRIBUTE_UNUSED) override
-      REQUIRES(Locks::heap_bitmap_lock_)
+  void Run([[maybe_unused]] Thread* self) override REQUIRES(Locks::heap_bitmap_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_) {
     ScanObjectParallelVisitor visitor(this);
     // TODO: Tune this.
@@ -1142,9 +1142,10 @@
             revoke_ros_alloc_thread_local_buffers_at_checkpoint) {
   }
 
-  void VisitRoots(mirror::Object*** roots, size_t count, const RootInfo& info ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(Locks::heap_bitmap_lock_) {
+  void VisitRoots(mirror::Object*** roots,
+                  size_t count,
+                  [[maybe_unused]] const RootInfo& info) override
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::heap_bitmap_lock_) {
     for (size_t i = 0; i < count; ++i) {
       mark_sweep_->MarkObjectNonNullParallel(*roots[i]);
     }
@@ -1152,9 +1153,8 @@
 
   void VisitRoots(mirror::CompressedReference<mirror::Object>** roots,
                   size_t count,
-                  const RootInfo& info ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(Locks::heap_bitmap_lock_) {
+                  [[maybe_unused]] const RootInfo& info) override
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::heap_bitmap_lock_) {
     for (size_t i = 0; i < count; ++i) {
       mark_sweep_->MarkObjectNonNullParallel(roots[i]->AsMirrorPtr());
     }
@@ -1352,9 +1352,8 @@
 
   ALWAYS_INLINE void operator()(mirror::Object* obj,
                                 MemberOffset offset,
-                                bool is_static ATTRIBUTE_UNUSED) const
-      REQUIRES(Locks::heap_bitmap_lock_)
-      REQUIRES_SHARED(Locks::mutator_lock_) {
+                                [[maybe_unused]] bool is_static) const
+      REQUIRES(Locks::heap_bitmap_lock_) REQUIRES_SHARED(Locks::mutator_lock_) {
     if (kCheckLocks) {
       Locks::mutator_lock_->AssertSharedHeld(Thread::Current());
       Locks::heap_bitmap_lock_->AssertExclusiveHeld(Thread::Current());
diff --git a/runtime/gc/collector/mark_sweep.h b/runtime/gc/collector/mark_sweep.h
index 12fd7f9..2a628a4 100644
--- a/runtime/gc/collector/mark_sweep.h
+++ b/runtime/gc/collector/mark_sweep.h
@@ -29,7 +29,7 @@
 #include "immune_spaces.h"
 #include "offsets.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Class;
diff --git a/runtime/gc/collector/object_byte_pair.h b/runtime/gc/collector/object_byte_pair.h
index 16ef06b..06268b9 100644
--- a/runtime/gc/collector/object_byte_pair.h
+++ b/runtime/gc/collector/object_byte_pair.h
@@ -19,7 +19,9 @@
 
 #include <inttypes.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
diff --git a/runtime/gc/collector/partial_mark_sweep.cc b/runtime/gc/collector/partial_mark_sweep.cc
index e283a95..dc6d99e 100644
--- a/runtime/gc/collector/partial_mark_sweep.cc
+++ b/runtime/gc/collector/partial_mark_sweep.cc
@@ -20,7 +20,7 @@
 #include "gc/space/space.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
diff --git a/runtime/gc/collector/partial_mark_sweep.h b/runtime/gc/collector/partial_mark_sweep.h
index 76c44a3..8b2c3a8 100644
--- a/runtime/gc/collector/partial_mark_sweep.h
+++ b/runtime/gc/collector/partial_mark_sweep.h
@@ -19,7 +19,9 @@
 
 #include "mark_sweep.h"
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
diff --git a/runtime/gc/collector/semi_space-inl.h b/runtime/gc/collector/semi_space-inl.h
index 86ab1fc..8ef6512 100644
--- a/runtime/gc/collector/semi_space-inl.h
+++ b/runtime/gc/collector/semi_space-inl.h
@@ -22,7 +22,7 @@
 #include "gc/accounting/heap_bitmap.h"
 #include "mirror/object-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
@@ -63,7 +63,7 @@
     auto slow_path = [this](const mirror::Object* ref) {
       CHECK(!to_space_->HasAddress(ref)) << "Marking " << ref << " in to_space_";
       // Marking a large object, make sure its aligned as a consistency check.
-      CHECK_ALIGNED(ref, kPageSize);
+      CHECK_ALIGNED_PARAM(ref, space::LargeObjectSpace::ObjectAlignment());
     };
     if (!mark_bitmap_->Set(obj, slow_path)) {
       // This object was not previously marked.
diff --git a/runtime/gc/collector/semi_space.cc b/runtime/gc/collector/semi_space.cc
index acd4807..77800c3 100644
--- a/runtime/gc/collector/semi_space.cc
+++ b/runtime/gc/collector/semi_space.cc
@@ -52,7 +52,7 @@
 
 using ::art::mirror::Object;
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
@@ -209,7 +209,6 @@
   const int64_t to_bytes = bytes_moved_;
   const uint64_t from_objects = from_space_->GetObjectsAllocated();
   const uint64_t to_objects = objects_moved_;
-  CHECK_LE(to_objects, from_objects);
   // Note: Freed bytes can be negative if we copy form a compacted space to a free-list backed
   // space.
   RecordFree(ObjectBytePair(from_objects - to_objects, from_bytes - to_bytes));
@@ -376,7 +375,7 @@
 }
 
 static inline size_t CopyAvoidingDirtyingPages(void* dest, const void* src, size_t size) {
-  if (LIKELY(size <= static_cast<size_t>(kPageSize))) {
+  if (LIKELY(size <= static_cast<size_t>(gPageSize))) {
     // We will dirty the current page and somewhere in the middle of the next page. This means
     // that the next object copied will also dirty that page.
     // TODO: Worth considering the last object copied? We may end up dirtying one page which is
@@ -394,19 +393,19 @@
   // Process the start of the page. The page must already be dirty, don't bother with checking.
   const uint8_t* byte_src = reinterpret_cast<const uint8_t*>(src);
   const uint8_t* limit = byte_src + size;
-  size_t page_remain = AlignUp(byte_dest, kPageSize) - byte_dest;
+  size_t page_remain = AlignUp(byte_dest, gPageSize) - byte_dest;
   // Copy the bytes until the start of the next page.
   memcpy(dest, src, page_remain);
   byte_src += page_remain;
   byte_dest += page_remain;
-  DCHECK_ALIGNED(reinterpret_cast<uintptr_t>(byte_dest), kPageSize);
+  DCHECK_ALIGNED_PARAM(reinterpret_cast<uintptr_t>(byte_dest), gPageSize);
   DCHECK_ALIGNED(reinterpret_cast<uintptr_t>(byte_dest), sizeof(uintptr_t));
   DCHECK_ALIGNED(reinterpret_cast<uintptr_t>(byte_src), sizeof(uintptr_t));
-  while (byte_src + kPageSize < limit) {
+  while (byte_src + gPageSize < limit) {
     bool all_zero = true;
     uintptr_t* word_dest = reinterpret_cast<uintptr_t*>(byte_dest);
     const uintptr_t* word_src = reinterpret_cast<const uintptr_t*>(byte_src);
-    for (size_t i = 0; i < kPageSize / sizeof(*word_src); ++i) {
+    for (size_t i = 0; i < gPageSize / sizeof(*word_src); ++i) {
       // Assumes the destination of the copy is all zeros.
       if (word_src[i] != 0) {
         all_zero = false;
@@ -415,10 +414,10 @@
     }
     if (all_zero) {
       // Avoided copying into the page since it was all zeros.
-      saved_bytes += kPageSize;
+      saved_bytes += gPageSize;
     }
-    byte_src += kPageSize;
-    byte_dest += kPageSize;
+    byte_src += gPageSize;
+    byte_dest += gPageSize;
   }
   // Handle the part of the page at the end.
   memcpy(byte_dest, byte_src, limit - byte_src);
@@ -467,12 +466,13 @@
 }
 
 void SemiSpace::MarkHeapReference(mirror::HeapReference<mirror::Object>* obj_ptr,
-                                  bool do_atomic_update ATTRIBUTE_UNUSED) {
+                                  [[maybe_unused]] bool do_atomic_update) {
   MarkObject(obj_ptr);
 }
 
-void SemiSpace::VisitRoots(mirror::Object*** roots, size_t count,
-                           const RootInfo& info ATTRIBUTE_UNUSED) {
+void SemiSpace::VisitRoots(mirror::Object*** roots,
+                           size_t count,
+                           [[maybe_unused]] const RootInfo& info) {
   for (size_t i = 0; i < count; ++i) {
     auto* root = roots[i];
     auto ref = StackReference<mirror::Object>::FromMirrorPtr(*root);
@@ -485,8 +485,9 @@
   }
 }
 
-void SemiSpace::VisitRoots(mirror::CompressedReference<mirror::Object>** roots, size_t count,
-                           const RootInfo& info ATTRIBUTE_UNUSED) {
+void SemiSpace::VisitRoots(mirror::CompressedReference<mirror::Object>** roots,
+                           size_t count,
+                           [[maybe_unused]] const RootInfo& info) {
   for (size_t i = 0; i < count; ++i) {
     MarkObjectIfNotInToSpace(roots[i]);
   }
@@ -610,7 +611,7 @@
 
 bool SemiSpace::IsNullOrMarkedHeapReference(mirror::HeapReference<mirror::Object>* object,
                                             // SemiSpace does the GC in a pause. No CAS needed.
-                                            bool do_atomic_update ATTRIBUTE_UNUSED) {
+                                            [[maybe_unused]] bool do_atomic_update) {
   mirror::Object* obj = object->AsMirrorPtr();
   if (obj == nullptr) {
     return true;
diff --git a/runtime/gc/collector/semi_space.h b/runtime/gc/collector/semi_space.h
index 6d3ac08..b6d98ce 100644
--- a/runtime/gc/collector/semi_space.h
+++ b/runtime/gc/collector/semi_space.h
@@ -29,7 +29,7 @@
 #include "mirror/object_reference.h"
 #include "offsets.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class Thread;
 
diff --git a/runtime/gc/collector/sticky_mark_sweep.cc b/runtime/gc/collector/sticky_mark_sweep.cc
index d93bd89..96c1322 100644
--- a/runtime/gc/collector/sticky_mark_sweep.cc
+++ b/runtime/gc/collector/sticky_mark_sweep.cc
@@ -24,7 +24,7 @@
 #include "runtime.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
@@ -73,7 +73,7 @@
       static_cast<VisitRootFlags>(flags | kVisitRootFlagClassLoader));
 }
 
-void StickyMarkSweep::Sweep(bool swap_bitmaps ATTRIBUTE_UNUSED) {
+void StickyMarkSweep::Sweep([[maybe_unused]] bool swap_bitmaps) {
   SweepArray(GetHeap()->GetLiveStack(), false);
 }
 
diff --git a/runtime/gc/collector/sticky_mark_sweep.h b/runtime/gc/collector/sticky_mark_sweep.h
index f65413d..0c1cd2d 100644
--- a/runtime/gc/collector/sticky_mark_sweep.h
+++ b/runtime/gc/collector/sticky_mark_sweep.h
@@ -20,7 +20,7 @@
 #include "base/macros.h"
 #include "partial_mark_sweep.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 
diff --git a/runtime/gc/collector_type.h b/runtime/gc/collector_type.h
index 2908601..3c19079 100644
--- a/runtime/gc/collector_type.h
+++ b/runtime/gc/collector_type.h
@@ -19,7 +19,9 @@
 
 #include <iosfwd>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 namespace gc {
 
 // Which types of collections are able to be performed.
diff --git a/runtime/gc/gc_cause.cc b/runtime/gc/gc_cause.cc
index 02fe2f9..ec213e5 100644
--- a/runtime/gc/gc_cause.cc
+++ b/runtime/gc/gc_cause.cc
@@ -23,7 +23,7 @@
 
 #include <ostream>
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 const char* PrettyCause(GcCause cause) {
diff --git a/runtime/gc/gc_cause.h b/runtime/gc/gc_cause.h
index 5c039b3..e035510 100644
--- a/runtime/gc/gc_cause.h
+++ b/runtime/gc/gc_cause.h
@@ -19,7 +19,9 @@
 
 #include <iosfwd>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 namespace gc {
 
 // What caused the GC?
diff --git a/runtime/gc/gc_pause_listener.h b/runtime/gc/gc_pause_listener.h
index da35d2a..a626a3c 100644
--- a/runtime/gc/gc_pause_listener.h
+++ b/runtime/gc/gc_pause_listener.h
@@ -17,7 +17,9 @@
 #ifndef ART_RUNTIME_GC_GC_PAUSE_LISTENER_H_
 #define ART_RUNTIME_GC_GC_PAUSE_LISTENER_H_
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 namespace gc {
 
 class GcPauseListener {
diff --git a/runtime/gc/heap-inl.h b/runtime/gc/heap-inl.h
index c5bd79d..5d6e149 100644
--- a/runtime/gc/heap-inl.h
+++ b/runtime/gc/heap-inl.h
@@ -38,7 +38,7 @@
 #include "verify_object.h"
 #include "write_barrier-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 template <bool kInstrumented, bool kCheckLargeObject, typename PreFenceVisitor>
@@ -291,7 +291,9 @@
   mirror::Object* obj = AllocObjectWithAllocator<kInstrumented, false, PreFenceVisitor>
                         (self, *klass, byte_count, kAllocatorTypeLOS, pre_fence_visitor);
   // Java Heap Profiler check and sample allocation.
-  JHPCheckNonTlabSampleAllocation(self, obj, byte_count);
+  if (GetHeapSampler().IsEnabled()) {
+    JHPCheckNonTlabSampleAllocation(self, obj, byte_count);
+  }
   return obj;
 }
 
@@ -440,7 +442,7 @@
   return byte_count >= large_object_threshold_ && (c->IsPrimitiveArray() || c->IsStringClass());
 }
 
-inline bool Heap::IsOutOfMemoryOnAllocation(AllocatorType allocator_type ATTRIBUTE_UNUSED,
+inline bool Heap::IsOutOfMemoryOnAllocation([[maybe_unused]] AllocatorType allocator_type,
                                             size_t alloc_size,
                                             bool grow) {
   size_t old_target = target_footprint_.load(std::memory_order_relaxed);
diff --git a/runtime/gc/heap-visit-objects-inl.h b/runtime/gc/heap-visit-objects-inl.h
index a235c44..2b719ee 100644
--- a/runtime/gc/heap-visit-objects-inl.h
+++ b/runtime/gc/heap-visit-objects-inl.h
@@ -29,7 +29,7 @@
 #include "thread-current-inl.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 // Visit objects when threads aren't suspended. If concurrent moving
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index ab82f14..c1505dd 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -78,7 +78,6 @@
 #include "handle_scope-inl.h"
 #include "heap-inl.h"
 #include "heap-visit-objects-inl.h"
-#include "image.h"
 #include "intern_table.h"
 #include "jit/jit.h"
 #include "jit/jit_code_cache.h"
@@ -93,6 +92,7 @@
 #include "mirror/reference-inl.h"
 #include "mirror/var_handle.h"
 #include "nativehelper/scoped_local_ref.h"
+#include "oat/image.h"
 #include "obj_ptr-inl.h"
 #ifdef ART_TARGET_ANDROID
 #include "perfetto/heap_profile.h"
@@ -110,7 +110,7 @@
 #include <malloc.h>  // For mallinfo()
 #endif
 
-namespace art {
+namespace art HIDDEN {
 
 #ifdef ART_TARGET_ANDROID
 namespace {
@@ -134,7 +134,7 @@
 
 // Disable the heap sampler Callback function used by Perfetto.
 void DisableHeapSamplerCallback(void* disable_ptr,
-                                const AHeapProfileDisableCallbackInfo* info_ptr ATTRIBUTE_UNUSED) {
+                                [[maybe_unused]] const AHeapProfileDisableCallbackInfo* info_ptr) {
   HeapSampler* sampler_self = reinterpret_cast<HeapSampler*>(disable_ptr);
   sampler_self->DisableHeapSampler();
 }
@@ -178,8 +178,13 @@
 static constexpr size_t kDefaultAllocationStackSize = 8 * MB /
     sizeof(mirror::HeapReference<mirror::Object>);
 
+// If we violate BOTH of the following constraints, we throw OOME.
+// They differ due to concurrent allocation.
 // After a GC (due to allocation failure) we should retrieve at least this
-// fraction of the current max heap size. Otherwise throw OOME.
+// fraction of the current max heap size.
+static constexpr double kMinFreedHeapAfterGcForAlloc = 0.05;
+// After a GC (due to allocation failure), at least this fraction of the
+// heap should be available.
 static constexpr double kMinFreeHeapAfterGcForAlloc = 0.01;
 
 // For deterministic compilation, we need the heap to be at a well-known address.
@@ -244,7 +249,7 @@
       const ImageHeader& current_header = image_spaces[i + j]->GetImageHeader();
       CHECK_EQ(current_heap, image_spaces[i + j]->Begin());
       CHECK_EQ(current_oat, current_header.GetOatFileBegin());
-      current_heap += RoundUp(current_header.GetImageSize(), kPageSize);
+      current_heap += RoundUp(current_header.GetImageSize(), kElfSegmentAlignment);
       CHECK_GT(current_header.GetOatFileEnd(), current_header.GetOatFileBegin());
       current_oat = current_header.GetOatFileEnd();
     }
@@ -269,10 +274,10 @@
            size_t non_moving_space_capacity,
            const std::vector<std::string>& boot_class_path,
            const std::vector<std::string>& boot_class_path_locations,
-           const std::vector<int>& boot_class_path_fds,
-           const std::vector<int>& boot_class_path_image_fds,
-           const std::vector<int>& boot_class_path_vdex_fds,
-           const std::vector<int>& boot_class_path_oat_fds,
+           ArrayRef<File> boot_class_path_files,
+           ArrayRef<File> boot_class_path_image_files,
+           ArrayRef<File> boot_class_path_vdex_files,
+           ArrayRef<File> boot_class_path_oat_files,
            const std::vector<std::string>& image_file_names,
            const InstructionSet image_instruction_set,
            CollectorType foreground_collector_type,
@@ -364,9 +369,11 @@
        * verification is enabled, we limit the size of allocation stacks to speed up their
        * searching.
        */
-      max_allocation_stack_size_(kGCALotMode ? kGcAlotAllocationStackSize
-          : (kVerifyObjectSupport > kVerifyObjectModeFast) ? kVerifyObjectAllocationStackSize :
-          kDefaultAllocationStackSize),
+      max_allocation_stack_size_(kGCALotMode
+          ? kGcAlotAllocationStackSize
+          : (kVerifyObjectSupport > kVerifyObjectModeFast)
+              ? kVerifyObjectAllocationStackSize
+              : kDefaultAllocationStackSize),
       current_allocator_(kAllocatorTypeDlMalloc),
       current_non_moving_allocator_(kAllocatorTypeNonMoving),
       bump_pointer_space_(nullptr),
@@ -404,8 +411,8 @@
       gc_count_last_window_(0U),
       blocking_gc_count_last_window_(0U),
       gc_count_rate_histogram_("gc count rate histogram", 1U, kGcCountRateMaxBucketCount),
-      blocking_gc_count_rate_histogram_("blocking gc count rate histogram", 1U,
-                                        kGcCountRateMaxBucketCount),
+      blocking_gc_count_rate_histogram_(
+          "blocking gc count rate histogram", 1U, kGcCountRateMaxBucketCount),
       alloc_tracking_enabled_(false),
       alloc_record_depth_(AllocRecordObjectMap::kDefaultAllocStackDepth),
       backtrace_lock_(nullptr),
@@ -487,22 +494,23 @@
   } else if (foreground_collector_type_ != kCollectorTypeCC && is_zygote) {
     heap_reservation_size = capacity_;
   }
-  heap_reservation_size = RoundUp(heap_reservation_size, kPageSize);
+  heap_reservation_size = RoundUp(heap_reservation_size, gPageSize);
   // Load image space(s).
   std::vector<std::unique_ptr<space::ImageSpace>> boot_image_spaces;
   MemMap heap_reservation;
   if (space::ImageSpace::LoadBootImage(boot_class_path,
                                        boot_class_path_locations,
-                                       boot_class_path_fds,
-                                       boot_class_path_image_fds,
-                                       boot_class_path_vdex_fds,
-                                       boot_class_path_oat_fds,
+                                       boot_class_path_files,
+                                       boot_class_path_image_files,
+                                       boot_class_path_vdex_files,
+                                       boot_class_path_oat_files,
                                        image_file_names,
                                        image_instruction_set,
                                        runtime->ShouldRelocate(),
-                                       /*executable=*/ !runtime->IsAotCompiler(),
+                                       /*executable=*/!runtime->IsAotCompiler(),
                                        heap_reservation_size,
                                        runtime->AllowInMemoryCompilation(),
+                                       runtime->GetApexVersions(),
                                        &boot_image_spaces,
                                        &heap_reservation)) {
     DCHECK_EQ(heap_reservation_size, heap_reservation.IsValid() ? heap_reservation.Size() : 0u);
@@ -618,7 +626,7 @@
     const void* non_moving_space_mem_map_begin = non_moving_space_mem_map.Begin();
     non_moving_space_ = space::DlMallocSpace::CreateFromMemMap(std::move(non_moving_space_mem_map),
                                                                "zygote / non moving space",
-                                                               kDefaultStartingSize,
+                                                               GetDefaultStartingSize(),
                                                                initial_size,
                                                                size,
                                                                size,
@@ -889,7 +897,7 @@
     // Create rosalloc space.
     malloc_space = space::RosAllocSpace::CreateFromMemMap(std::move(mem_map),
                                                           name,
-                                                          kDefaultStartingSize,
+                                                          GetDefaultStartingSize(),
                                                           initial_size,
                                                           growth_limit,
                                                           capacity,
@@ -898,7 +906,7 @@
   } else {
     malloc_space = space::DlMallocSpace::CreateFromMemMap(std::move(mem_map),
                                                           name,
-                                                          kDefaultStartingSize,
+                                                          GetDefaultStartingSize(),
                                                           initial_size,
                                                           growth_limit,
                                                           capacity,
@@ -1022,12 +1030,12 @@
   if (gUseUserfaultfd) {
     // Use volatile to ensure that compiler loads from memory to trigger userfaults, if required.
     const uint8_t* start = reinterpret_cast<uint8_t*>(obj.Ptr());
-    const uint8_t* end = AlignUp(start + obj->SizeOf(), kPageSize);
+    const uint8_t* end = AlignUp(start + obj->SizeOf(), gPageSize);
     // The first page is already touched by SizeOf().
-    start += kPageSize;
+    start += gPageSize;
     while (start < end) {
       ForceRead(start);
-      start += kPageSize;
+      start += gPageSize;
     }
   }
 }
@@ -1121,7 +1129,7 @@
     num_threads = std::max(parallel_gc_threads_, conc_gc_threads_);
   }
   if (num_threads != 0) {
-    thread_pool_.reset(new ThreadPool("Heap thread pool", num_threads));
+    thread_pool_.reset(ThreadPool::Create("Heap thread pool", num_threads));
   }
 }
 
@@ -1273,11 +1281,7 @@
        << PrettySize(GetBytesFreedEver() / total_seconds) << "/s"
        << " per cpu-time: "
        << PrettySize(GetBytesFreedEver() / total_cpu_seconds) << "/s\n";
-    os << "Mean GC object throughput: "
-       << (GetObjectsFreedEver() / total_seconds) << " objects/s\n";
   }
-  uint64_t total_objects_allocated = GetObjectsAllocatedEver();
-  os << "Total number of allocations " << total_objects_allocated << "\n";
   os << "Total bytes allocated " << PrettySize(GetBytesAllocatedEver()) << "\n";
   os << "Total bytes freed " << PrettySize(GetBytesFreedEver()) << "\n";
   os << "Free memory " << PrettySize(GetFreeMemory()) << "\n";
@@ -1605,7 +1609,7 @@
  public:
   explicit TrimIndirectReferenceTableClosure(Barrier* barrier) : barrier_(barrier) {
   }
-  void Run(Thread* thread) override NO_THREAD_SAFETY_ANALYSIS {
+  void Run(Thread* thread) override REQUIRES_SHARED(Locks::mutator_lock_) {
     thread->GetJniEnv()->TrimLocals();
     // If thread is a running mutator, then act on behalf of the trim thread.
     // See the code in ThreadList::RunCheckpoint.
@@ -1626,8 +1630,8 @@
   // TODO: May also want to look for entirely empty pages maintained by SmallIrtAllocator.
   Barrier barrier(0);
   TrimIndirectReferenceTableClosure closure(&barrier);
-  ScopedThreadStateChange tsc(self, ThreadState::kWaitingForCheckPointsToRun);
   size_t barrier_count = Runtime::Current()->GetThreadList()->RunCheckpoint(&closure);
+  ScopedThreadStateChange tsc(self, ThreadState::kWaitingForCheckPointsToRun);
   if (barrier_count != 0) {
     barrier.Increment(self, barrier_count);
   }
@@ -1938,12 +1942,28 @@
       return ptr;
     }
   }
+  if (IsGCDisabledForShutdown()) {
+    // We're just shutting down and GCs don't work anymore. Try a different allocator.
+    mirror::Object* ptr = TryToAllocate<true, false>(self,
+                                                     kAllocatorTypeNonMoving,
+                                                     alloc_size,
+                                                     bytes_allocated,
+                                                     usable_size,
+                                                     bytes_tl_bulk_allocated);
+    if (ptr != nullptr) {
+      return ptr;
+    }
+  }
 
+  int64_t bytes_freed_before = GetBytesFreedEver();
   auto have_reclaimed_enough = [&]() {
     size_t curr_bytes_allocated = GetBytesAllocated();
-    double curr_free_heap =
-        static_cast<double>(growth_limit_ - curr_bytes_allocated) / growth_limit_;
-    return curr_free_heap >= kMinFreeHeapAfterGcForAlloc;
+    size_t free_heap = UnsignedDifference(growth_limit_, curr_bytes_allocated);
+    int64_t newly_freed = GetBytesFreedEver() - bytes_freed_before;
+    double free_heap_ratio = static_cast<double>(free_heap) / growth_limit_;
+    double newly_freed_ratio = static_cast<double>(newly_freed) / growth_limit_;
+    return free_heap_ratio >= kMinFreeHeapAfterGcForAlloc ||
+           newly_freed_ratio >= kMinFreedHeapAfterGcForAlloc;
   };
   // We perform one GC as per the next_gc_type_ (chosen in GrowForUtilization),
   // if it's not already tried. If that doesn't succeed then go for the most
@@ -1980,58 +2000,42 @@
   // We don't need a WaitForGcToComplete here either.
   // TODO: Should check whether another thread already just ran a GC with soft
   // references.
-  DCHECK(!gc_plan_.empty());
-  pre_oome_gc_count_.fetch_add(1, std::memory_order_relaxed);
-  PERFORM_SUSPENDING_OPERATION(
-      CollectGarbageInternal(gc_plan_.back(), kGcCauseForAlloc, true, GC_NUM_ANY));
-  if ((was_default_allocator && allocator != GetCurrentAllocator()) ||
-      (!instrumented && EntrypointsInstrumented())) {
-    return nullptr;
-  }
-  mirror::Object* ptr = nullptr;
-  if (have_reclaimed_enough()) {
-    ptr = TryToAllocate<true, true>(self, allocator, alloc_size, bytes_allocated,
-                                    usable_size, bytes_tl_bulk_allocated);
-  }
 
-  if (ptr == nullptr) {
-    const uint64_t current_time = NanoTime();
-    switch (allocator) {
-      case kAllocatorTypeRosAlloc:
-        // Fall-through.
-      case kAllocatorTypeDlMalloc: {
+  DCHECK(!gc_plan_.empty());
+
+  int64_t min_freed_to_continue =
+      static_cast<int64_t>(kMinFreedHeapAfterGcForAlloc * growth_limit_ + alloc_size);
+  // Repeatedly collect the entire heap until either
+  // (a) this was insufficiently productive at reclaiming memory and we should give upt to avoid
+  // "GC thrashing", or
+  // (b) GC was sufficiently productive (reclaimed min_freed_to_continue bytes) AND allowed us to
+  // satisfy the allocation request.
+  do {
+    bytes_freed_before = GetBytesFreedEver();
+    pre_oome_gc_count_.fetch_add(1, std::memory_order_relaxed);
+    PERFORM_SUSPENDING_OPERATION(
+        CollectGarbageInternal(gc_plan_.back(), kGcCauseForAlloc, true, GC_NUM_ANY));
+    if ((was_default_allocator && allocator != GetCurrentAllocator()) ||
+        (!instrumented && EntrypointsInstrumented())) {
+      return nullptr;
+    }
+    bool ran_homogeneous_space_compaction = false;
+    bool immediately_reclaimed_enough = have_reclaimed_enough();
+    if (!immediately_reclaimed_enough) {
+      const uint64_t current_time = NanoTime();
+      if (allocator == kAllocatorTypeRosAlloc || allocator == kAllocatorTypeDlMalloc) {
         if (use_homogeneous_space_compaction_for_oom_ &&
             current_time - last_time_homogeneous_space_compaction_by_oom_ >
             min_interval_homogeneous_space_compaction_by_oom_) {
           last_time_homogeneous_space_compaction_by_oom_ = current_time;
-          HomogeneousSpaceCompactResult result =
-              PERFORM_SUSPENDING_OPERATION(PerformHomogeneousSpaceCompact());
+          ran_homogeneous_space_compaction =
+              (PERFORM_SUSPENDING_OPERATION(PerformHomogeneousSpaceCompact()) ==
+               HomogeneousSpaceCompactResult::kSuccess);
           // Thread suspension could have occurred.
           if ((was_default_allocator && allocator != GetCurrentAllocator()) ||
               (!instrumented && EntrypointsInstrumented())) {
             return nullptr;
           }
-          switch (result) {
-            case HomogeneousSpaceCompactResult::kSuccess:
-              // If the allocation succeeded, we delayed an oom.
-              ptr = TryToAllocate<true, true>(self, allocator, alloc_size, bytes_allocated,
-                                              usable_size, bytes_tl_bulk_allocated);
-              if (ptr != nullptr) {
-                count_delayed_oom_++;
-              }
-              break;
-            case HomogeneousSpaceCompactResult::kErrorReject:
-              // Reject due to disabled moving GC.
-              break;
-            case HomogeneousSpaceCompactResult::kErrorVMShuttingDown:
-              // Throw OOM by default.
-              break;
-            default: {
-              UNIMPLEMENTED(FATAL) << "homogeneous space compaction result: "
-                  << static_cast<size_t>(result);
-              UNREACHABLE();
-            }
-          }
           // Always print that we ran homogeneous space compation since this can cause jank.
           VLOG(heap) << "Ran heap homogeneous space compaction, "
                     << " requested defragmentation "
@@ -2043,20 +2047,32 @@
                     << " delayed count = "
                     << count_delayed_oom_.load();
         }
-        break;
-      }
-      default: {
-        // Do nothing for others allocators.
       }
     }
-  }
+    if (immediately_reclaimed_enough ||
+        (ran_homogeneous_space_compaction && have_reclaimed_enough())) {
+      mirror::Object* ptr = TryToAllocate<true, true>(
+          self, allocator, alloc_size, bytes_allocated, usable_size, bytes_tl_bulk_allocated);
+      if (ptr != nullptr) {
+        if (ran_homogeneous_space_compaction) {
+          count_delayed_oom_++;
+        }
+        return ptr;
+      }
+    }
+    // This loops only if we reclaimed plenty of memory, but presumably some other thread beat us
+    // to allocating it. In the very unlikely case that we're running into a serious fragmentation
+    // issue, and there is no other thread allocating, GCs will quickly become unsuccessful, and we
+    // will stop then. If another thread is allocating aggressively, this may go on for a while,
+    // but we are still making progress somewhere.
+  } while (GetBytesFreedEver() - bytes_freed_before > min_freed_to_continue);
 #undef PERFORM_SUSPENDING_OPERATION
-  // If the allocation hasn't succeeded by this point, throw an OOM error.
-  if (ptr == nullptr) {
+  // Throw an OOM error.
+  {
     ScopedAllowThreadSuspension ats;
     ThrowOutOfMemoryError(self, alloc_size, allocator);
   }
-  return ptr;
+  return nullptr;
 }
 
 void Heap::SetTargetHeapUtilization(float target) {
@@ -2083,15 +2099,6 @@
   return total;
 }
 
-uint64_t Heap::GetObjectsAllocatedEver() const {
-  uint64_t total = GetObjectsFreedEver();
-  // If we are detached, we can't use GetObjectsAllocated since we can't change thread states.
-  if (Thread::Current() != nullptr) {
-    total += GetObjectsAllocated();
-  }
-  return total;
-}
-
 uint64_t Heap::GetBytesAllocatedEver() const {
   // Force the returned value to be monotonically increasing, in the sense that if this is called
   // at A and B, such that A happens-before B, then the call at B returns a value no smaller than
@@ -2099,8 +2106,8 @@
   // and total_bytes_freed_ever_ is incremented later.
   static std::atomic<uint64_t> max_bytes_so_far(0);
   uint64_t so_far = max_bytes_so_far.load(std::memory_order_relaxed);
-  uint64_t current_bytes = GetBytesFreedEver(std::memory_order_acquire);
-  current_bytes += GetBytesAllocated();
+  uint64_t current_bytes = GetBytesFreedEver(std::memory_order_acquire) + GetBytesAllocated();
+  DCHECK(current_bytes < (static_cast<uint64_t>(1) << 63));  // result is "positive".
   do {
     if (current_bytes <= so_far) {
       return so_far;
@@ -2347,7 +2354,7 @@
     }
   }
 
-  bool ShouldSweepSpace(space::ContinuousSpace* space ATTRIBUTE_UNUSED) const override {
+  bool ShouldSweepSpace([[maybe_unused]] space::ContinuousSpace* space) const override {
     // Don't sweep any spaces since we probably blasted the internal accounting of the free list
     // allocator.
     return false;
@@ -2725,113 +2732,122 @@
   }
   ScopedThreadStateChange tsc(self, ThreadState::kWaitingPerformingGc);
   Locks::mutator_lock_->AssertNotHeld(self);
-  if (self->IsHandlingStackOverflow()) {
-    // If we are throwing a stack overflow error we probably don't have enough remaining stack
-    // space to run the GC.
-    // Count this as a GC in case someone is waiting for it to complete.
-    gcs_completed_.fetch_add(1, std::memory_order_release);
-    return collector::kGcTypeNone;
-  }
-  bool compacting_gc;
+  SelfDeletingTask* clear;  // Unconditionally set below.
   {
-    gc_complete_lock_->AssertNotHeld(self);
-    ScopedThreadStateChange tsc2(self, ThreadState::kWaitingForGcToComplete);
-    MutexLock mu(self, *gc_complete_lock_);
-    // Ensure there is only one GC at a time.
-    WaitForGcToCompleteLocked(gc_cause, self);
-    if (requested_gc_num != GC_NUM_ANY && !GCNumberLt(GetCurrentGcNum(), requested_gc_num)) {
-      // The appropriate GC was already triggered elsewhere.
-      return collector::kGcTypeNone;
-    }
-    compacting_gc = IsMovingGc(collector_type_);
-    // GC can be disabled if someone has a used GetPrimitiveArrayCritical.
-    if (compacting_gc && disable_moving_gc_count_ != 0) {
-      LOG(WARNING) << "Skipping GC due to disable moving GC count " << disable_moving_gc_count_;
-      // Again count this as a GC.
+    // We should not ever become runnable and re-suspend while executing a GC.
+    // This would likely cause a deadlock if we acted on a suspension request.
+    // TODO: We really want to assert that we don't transition to kRunnable.
+    ScopedAssertNoThreadSuspension("Performing GC");
+    if (self->IsHandlingStackOverflow()) {
+      // If we are throwing a stack overflow error we probably don't have enough remaining stack
+      // space to run the GC.
+      // Count this as a GC in case someone is waiting for it to complete.
       gcs_completed_.fetch_add(1, std::memory_order_release);
       return collector::kGcTypeNone;
     }
-    if (gc_disabled_for_shutdown_) {
-      gcs_completed_.fetch_add(1, std::memory_order_release);
-      return collector::kGcTypeNone;
-    }
-    collector_type_running_ = collector_type_;
-    last_gc_cause_ = gc_cause;
-  }
-  if (gc_cause == kGcCauseForAlloc && runtime->HasStatsEnabled()) {
-    ++runtime->GetStats()->gc_for_alloc_count;
-    ++self->GetStats()->gc_for_alloc_count;
-  }
-  const size_t bytes_allocated_before_gc = GetBytesAllocated();
-
-  DCHECK_LT(gc_type, collector::kGcTypeMax);
-  DCHECK_NE(gc_type, collector::kGcTypeNone);
-
-  collector::GarbageCollector* collector = nullptr;
-  // TODO: Clean this up.
-  if (compacting_gc) {
-    DCHECK(current_allocator_ == kAllocatorTypeBumpPointer ||
-           current_allocator_ == kAllocatorTypeTLAB ||
-           current_allocator_ == kAllocatorTypeRegion ||
-           current_allocator_ == kAllocatorTypeRegionTLAB);
-    switch (collector_type_) {
-      case kCollectorTypeSS:
-        semi_space_collector_->SetFromSpace(bump_pointer_space_);
-        semi_space_collector_->SetToSpace(temp_space_);
-        semi_space_collector_->SetSwapSemiSpaces(true);
-        collector = semi_space_collector_;
-        break;
-      case kCollectorTypeCMC:
-        collector = mark_compact_;
-        break;
-      case kCollectorTypeCC:
-        collector::ConcurrentCopying* active_cc_collector;
-        if (use_generational_cc_) {
-          // TODO: Other threads must do the flip checkpoint before they start poking at
-          // active_concurrent_copying_collector_. So we should not concurrency here.
-          active_cc_collector = (gc_type == collector::kGcTypeSticky) ?
-                  young_concurrent_copying_collector_ : concurrent_copying_collector_;
-          active_concurrent_copying_collector_.store(active_cc_collector,
-                                                     std::memory_order_relaxed);
-          DCHECK(active_cc_collector->RegionSpace() == region_space_);
-          collector = active_cc_collector;
-        } else {
-          collector = active_concurrent_copying_collector_.load(std::memory_order_relaxed);
-        }
-        break;
-      default:
-        LOG(FATAL) << "Invalid collector type " << static_cast<size_t>(collector_type_);
-    }
-    // temp_space_ will be null for kCollectorTypeCMC.
-    if (temp_space_ != nullptr
-        && collector != active_concurrent_copying_collector_.load(std::memory_order_relaxed)) {
-      temp_space_->GetMemMap()->Protect(PROT_READ | PROT_WRITE);
-      if (kIsDebugBuild) {
-        // Try to read each page of the memory map in case mprotect didn't work properly b/19894268.
-        temp_space_->GetMemMap()->TryReadable();
+    bool compacting_gc;
+    {
+      gc_complete_lock_->AssertNotHeld(self);
+      ScopedThreadStateChange tsc2(self, ThreadState::kWaitingForGcToComplete);
+      MutexLock mu(self, *gc_complete_lock_);
+      // Ensure there is only one GC at a time.
+      WaitForGcToCompleteLocked(gc_cause, self);
+      if (requested_gc_num != GC_NUM_ANY && !GCNumberLt(GetCurrentGcNum(), requested_gc_num)) {
+        // The appropriate GC was already triggered elsewhere.
+        return collector::kGcTypeNone;
       }
-      CHECK(temp_space_->IsEmpty());
+      compacting_gc = IsMovingGc(collector_type_);
+      // GC can be disabled if someone has a used GetPrimitiveArrayCritical.
+      if (compacting_gc && disable_moving_gc_count_ != 0) {
+        LOG(WARNING) << "Skipping GC due to disable moving GC count " << disable_moving_gc_count_;
+        // Again count this as a GC.
+        gcs_completed_.fetch_add(1, std::memory_order_release);
+        return collector::kGcTypeNone;
+      }
+      if (gc_disabled_for_shutdown_) {
+        gcs_completed_.fetch_add(1, std::memory_order_release);
+        return collector::kGcTypeNone;
+      }
+      collector_type_running_ = collector_type_;
+      last_gc_cause_ = gc_cause;
     }
-  } else if (current_allocator_ == kAllocatorTypeRosAlloc ||
-      current_allocator_ == kAllocatorTypeDlMalloc) {
-    collector = FindCollectorByGcType(gc_type);
-  } else {
-    LOG(FATAL) << "Invalid current allocator " << current_allocator_;
-  }
+    if (gc_cause == kGcCauseForAlloc && runtime->HasStatsEnabled()) {
+      ++runtime->GetStats()->gc_for_alloc_count;
+      ++self->GetStats()->gc_for_alloc_count;
+    }
+    const size_t bytes_allocated_before_gc = GetBytesAllocated();
 
-  CHECK(collector != nullptr)
-      << "Could not find garbage collector with collector_type="
-      << static_cast<size_t>(collector_type_) << " and gc_type=" << gc_type;
-  collector->Run(gc_cause, clear_soft_references || runtime->IsZygote());
-  IncrementFreedEver();
-  RequestTrim(self);
-  // Collect cleared references.
-  SelfDeletingTask* clear = reference_processor_->CollectClearedReferences(self);
-  // Grow the heap so that we know when to perform the next GC.
-  GrowForUtilization(collector, bytes_allocated_before_gc);
-  old_native_bytes_allocated_.store(GetNativeBytes());
-  LogGC(gc_cause, collector);
-  FinishGC(self, gc_type);
+    DCHECK_LT(gc_type, collector::kGcTypeMax);
+    DCHECK_NE(gc_type, collector::kGcTypeNone);
+
+    collector::GarbageCollector* collector = nullptr;
+    // TODO: Clean this up.
+    if (compacting_gc) {
+      DCHECK(current_allocator_ == kAllocatorTypeBumpPointer ||
+             current_allocator_ == kAllocatorTypeTLAB ||
+             current_allocator_ == kAllocatorTypeRegion ||
+             current_allocator_ == kAllocatorTypeRegionTLAB);
+      switch (collector_type_) {
+        case kCollectorTypeSS:
+          semi_space_collector_->SetFromSpace(bump_pointer_space_);
+          semi_space_collector_->SetToSpace(temp_space_);
+          semi_space_collector_->SetSwapSemiSpaces(true);
+          collector = semi_space_collector_;
+          break;
+        case kCollectorTypeCMC:
+          collector = mark_compact_;
+          break;
+        case kCollectorTypeCC:
+          collector::ConcurrentCopying* active_cc_collector;
+          if (use_generational_cc_) {
+            // TODO: Other threads must do the flip checkpoint before they start poking at
+            // active_concurrent_copying_collector_. So we should not concurrency here.
+            active_cc_collector = (gc_type == collector::kGcTypeSticky) ?
+                                      young_concurrent_copying_collector_ :
+                                      concurrent_copying_collector_;
+            active_concurrent_copying_collector_.store(active_cc_collector,
+                                                       std::memory_order_relaxed);
+            DCHECK(active_cc_collector->RegionSpace() == region_space_);
+            collector = active_cc_collector;
+          } else {
+            collector = active_concurrent_copying_collector_.load(std::memory_order_relaxed);
+          }
+          break;
+        default:
+          LOG(FATAL) << "Invalid collector type " << static_cast<size_t>(collector_type_);
+      }
+      // temp_space_ will be null for kCollectorTypeCMC.
+      if (temp_space_ != nullptr &&
+          collector != active_concurrent_copying_collector_.load(std::memory_order_relaxed)) {
+        temp_space_->GetMemMap()->Protect(PROT_READ | PROT_WRITE);
+        if (kIsDebugBuild) {
+          // Try to read each page of the memory map in case mprotect didn't work properly
+          // b/19894268.
+          temp_space_->GetMemMap()->TryReadable();
+        }
+        CHECK(temp_space_->IsEmpty());
+      }
+    } else if (current_allocator_ == kAllocatorTypeRosAlloc ||
+               current_allocator_ == kAllocatorTypeDlMalloc) {
+      collector = FindCollectorByGcType(gc_type);
+    } else {
+      LOG(FATAL) << "Invalid current allocator " << current_allocator_;
+    }
+
+    CHECK(collector != nullptr) << "Could not find garbage collector with collector_type="
+                                << static_cast<size_t>(collector_type_)
+                                << " and gc_type=" << gc_type;
+    collector->Run(gc_cause, clear_soft_references || runtime->IsZygote());
+    IncrementFreedEver();
+    RequestTrim(self);
+    // Collect cleared references.
+    clear = reference_processor_->CollectClearedReferences(self);
+    // Grow the heap so that we know when to perform the next GC.
+    GrowForUtilization(collector, bytes_allocated_before_gc);
+    old_native_bytes_allocated_.store(GetNativeBytes());
+    LogGC(gc_cause, collector);
+    FinishGC(self, gc_type);
+  }
   // Actually enqueue all cleared references. Do this after the GC has officially finished since
   // otherwise we can deadlock.
   clear->Run(self);
@@ -2883,8 +2899,8 @@
     }
     LOG(INFO) << gc_cause << " " << collector->GetName()
               << (is_sampled ? " (sampled)" : "")
-              << " GC freed "  << current_gc_iteration_.GetFreedObjects() << "("
-              << PrettySize(current_gc_iteration_.GetFreedBytes()) << ") AllocSpace objects, "
+              << " GC freed "
+              << PrettySize(current_gc_iteration_.GetFreedBytes()) << " AllocSpace bytes, "
               << current_gc_iteration_.GetFreedLargeObjects() << "("
               << PrettySize(current_gc_iteration_.GetFreedLargeObjectBytes()) << ") LOS objects, "
               << percent_free << "% free, " << PrettySize(current_heap_size) << "/"
@@ -2993,7 +3009,7 @@
     CHECK_EQ(self_, Thread::Current());
   }
 
-  void operator()(ObjPtr<mirror::Class> klass ATTRIBUTE_UNUSED, ObjPtr<mirror::Reference> ref) const
+  void operator()([[maybe_unused]] ObjPtr<mirror::Class> klass, ObjPtr<mirror::Reference> ref) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     if (verify_referent_) {
       VerifyReference(ref.Ptr(), ref->GetReferent(), mirror::Reference::ReferentOffset());
@@ -3002,8 +3018,7 @@
 
   void operator()(ObjPtr<mirror::Object> obj,
                   MemberOffset offset,
-                  bool is_static ATTRIBUTE_UNUSED) const
-      REQUIRES_SHARED(Locks::mutator_lock_) {
+                  [[maybe_unused]] bool is_static) const REQUIRES_SHARED(Locks::mutator_lock_) {
     VerifyReference(obj.Ptr(), obj->GetFieldObject<mirror::Object>(offset), offset);
   }
 
@@ -3258,9 +3273,9 @@
   }
 
   // There is no card marks for native roots on a class.
-  void VisitRootIfNonNull(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED)
-      const {}
-  void VisitRoot(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED) const {}
+  void VisitRootIfNonNull(
+      [[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {}
+  void VisitRoot([[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {}
 
   // TODO: Fix lock analysis to not use NO_THREAD_SAFETY_ANALYSIS, requires support for
   // annotalysis on visitors.
@@ -3509,7 +3524,7 @@
   }
 }
 
-void Heap::PrePauseRosAllocVerification(collector::GarbageCollector* gc ATTRIBUTE_UNUSED) {
+void Heap::PrePauseRosAllocVerification([[maybe_unused]] collector::GarbageCollector* gc) {
   // TODO: Add a new runtime option for this?
   if (verify_pre_gc_rosalloc_) {
     RosAllocVerification(current_gc_iteration_.GetTimings(), "PreGcRosAllocVerification");
@@ -3599,7 +3614,7 @@
   GcCause last_gc_cause = kGcCauseNone;
   uint64_t wait_start = NanoTime();
   while (collector_type_running_ != kCollectorTypeNone) {
-    if (self != task_processor_->GetRunningThread()) {
+    if (!task_processor_->IsRunningThread(self)) {
       // The current thread is about to wait for a currently running
       // collection to finish. If the waiting thread is not the heap
       // task daemon thread, the currently running collection is
@@ -3619,7 +3634,7 @@
     LOG(INFO) << "WaitForGcToComplete blocked " << cause << " on " << last_gc_cause << " for "
               << PrettyDuration(wait_time);
   }
-  if (self != task_processor_->GetRunningThread()) {
+  if (!task_processor_->IsRunningThread(self)) {
     // The current thread is about to run a collection. If the thread
     // is not the heap task daemon thread, it's considered as a
     // blocking GC (i.e., blocking itself).
@@ -3636,7 +3651,7 @@
 
 void Heap::DumpForSigQuit(std::ostream& os) {
   os << "Heap: " << GetPercentFree() << "% free, " << PrettySize(GetBytesAllocated()) << "/"
-     << PrettySize(GetTotalMemory()) << "; " << GetObjectsAllocated() << " objects\n";
+     << PrettySize(GetTotalMemory());
   {
     os << "Image spaces:\n";
     ScopedObjectAccess soa(Thread::Current());
@@ -4209,7 +4224,9 @@
     CheckGCForNative(Thread::ForEnv(env));
   }
   // Heap profiler treats this as a Java allocation with a null object.
-  JHPCheckNonTlabSampleAllocation(Thread::Current(), nullptr, bytes);
+  if (GetHeapSampler().IsEnabled()) {
+    JHPCheckNonTlabSampleAllocation(Thread::Current(), nullptr, bytes);
+  }
 }
 
 void Heap::RegisterNativeFree(JNIEnv*, size_t bytes) {
@@ -4269,16 +4286,16 @@
   CHECK(remembered_sets_.find(space) == remembered_sets_.end());
 }
 
-void Heap::ClearMarkedObjects() {
+void Heap::ClearMarkedObjects(bool release_eagerly) {
   // Clear all of the spaces' mark bitmaps.
   for (const auto& space : GetContinuousSpaces()) {
     if (space->GetLiveBitmap() != nullptr && !space->HasBoundBitmaps()) {
-      space->GetMarkBitmap()->Clear();
+      space->GetMarkBitmap()->Clear(release_eagerly);
     }
   }
   // Clear the marked objects in the discontinous space object sets.
   for (const auto& space : GetDiscontinuousSpaces()) {
-    space->GetMarkBitmap()->Clear();
+    space->GetMarkBitmap()->Clear(release_eagerly);
   }
 }
 
@@ -4359,32 +4376,23 @@
   VLOG(heap) << "Java Heap Profiler Initialized";
 }
 
-// Check if the Java Heap Profiler is enabled and initialized.
-int Heap::CheckPerfettoJHPEnabled() {
-  return GetHeapSampler().IsEnabled();
-}
-
 void Heap::JHPCheckNonTlabSampleAllocation(Thread* self, mirror::Object* obj, size_t alloc_size) {
   bool take_sample = false;
   size_t bytes_until_sample = 0;
   HeapSampler& prof_heap_sampler = GetHeapSampler();
-  if (prof_heap_sampler.IsEnabled()) {
-    // An allocation occurred, sample it, even if non-Tlab.
-    // In case take_sample is already set from the previous GetSampleOffset
-    // because we tried the Tlab allocation first, we will not use this value.
-    // A new value is generated below. Also bytes_until_sample will be updated.
-    // Note that we are not using the return value from the GetSampleOffset in
-    // the NonTlab case here.
-    prof_heap_sampler.GetSampleOffset(alloc_size,
-                                      self->GetTlabPosOffset(),
-                                      &take_sample,
-                                      &bytes_until_sample);
-    prof_heap_sampler.SetBytesUntilSample(bytes_until_sample);
-    if (take_sample) {
-      prof_heap_sampler.ReportSample(obj, alloc_size);
-    }
-    VLOG(heap) << "JHP:NonTlab Non-moving or Large Allocation or RegisterNativeAllocation";
+  // An allocation occurred, sample it, even if non-Tlab.
+  // In case take_sample is already set from the previous GetSampleOffset
+  // because we tried the Tlab allocation first, we will not use this value.
+  // A new value is generated below. Also bytes_until_sample will be updated.
+  // Note that we are not using the return value from the GetSampleOffset in
+  // the NonTlab case here.
+  prof_heap_sampler.GetSampleOffset(
+      alloc_size, self->GetTlabPosOffset(), &take_sample, &bytes_until_sample);
+  prof_heap_sampler.SetBytesUntilSample(bytes_until_sample);
+  if (take_sample) {
+    prof_heap_sampler.ReportSample(obj, alloc_size);
   }
+  VLOG(heap) << "JHP:NonTlab Non-moving or Large Allocation or RegisterNativeAllocation";
 }
 
 size_t Heap::JHPCalculateNextTlabSize(Thread* self,
@@ -4392,16 +4400,9 @@
                                       size_t alloc_size,
                                       bool* take_sample,
                                       size_t* bytes_until_sample) {
-  size_t next_tlab_size = jhp_def_tlab_size;
-  if (CheckPerfettoJHPEnabled()) {
-    size_t next_sample_point =
-        GetHeapSampler().GetSampleOffset(alloc_size,
-                                         self->GetTlabPosOffset(),
-                                         take_sample,
-                                         bytes_until_sample);
-    next_tlab_size = std::min(next_sample_point, jhp_def_tlab_size);
-  }
-  return next_tlab_size;
+  size_t next_sample_point = GetHeapSampler().GetSampleOffset(
+      alloc_size, self->GetTlabPosOffset(), take_sample, bytes_until_sample);
+  return std::min(next_sample_point, jhp_def_tlab_size);
 }
 
 void Heap::AdjustSampleOffset(size_t adjustment) {
@@ -4500,17 +4501,17 @@
   mirror::Object* ret = nullptr;
   bool take_sample = false;
   size_t bytes_until_sample = 0;
+  bool jhp_enabled = GetHeapSampler().IsEnabled();
 
   if (kUsePartialTlabs && alloc_size <= self->TlabRemainingCapacity()) {
     DCHECK_GT(alloc_size, self->TlabSize());
     // There is enough space if we grow the TLAB. Lets do that. This increases the
     // TLAB bytes.
     const size_t min_expand_size = alloc_size - self->TlabSize();
-    size_t next_tlab_size = JHPCalculateNextTlabSize(self,
-                                                     kPartialTlabSize,
-                                                     alloc_size,
-                                                     &take_sample,
-                                                     &bytes_until_sample);
+    size_t next_tlab_size =
+        jhp_enabled ? JHPCalculateNextTlabSize(
+                          self, kPartialTlabSize, alloc_size, &take_sample, &bytes_until_sample) :
+                      kPartialTlabSize;
     const size_t expand_bytes = std::max(
         min_expand_size,
         std::min(self->TlabRemainingCapacity() - self->TlabSize(), next_tlab_size));
@@ -4526,12 +4527,11 @@
     // TODO: for large allocations, which are rare, maybe we should allocate
     // that object and return. There is no need to revoke the current TLAB,
     // particularly if it's mostly unutilized.
-    size_t def_pr_tlab_size = RoundDown(alloc_size + kDefaultTLABSize, kPageSize) - alloc_size;
-    size_t next_tlab_size = JHPCalculateNextTlabSize(self,
-                                                     def_pr_tlab_size,
-                                                     alloc_size,
-                                                     &take_sample,
-                                                     &bytes_until_sample);
+    size_t next_tlab_size = RoundDown(alloc_size + kDefaultTLABSize, gPageSize) - alloc_size;
+    if (jhp_enabled) {
+      next_tlab_size = JHPCalculateNextTlabSize(
+          self, next_tlab_size, alloc_size, &take_sample, &bytes_until_sample);
+    }
     const size_t new_tlab_size = alloc_size + next_tlab_size;
     if (UNLIKELY(IsOutOfMemoryOnAllocation(allocator_type, new_tlab_size, grow))) {
       return nullptr;
@@ -4541,7 +4541,7 @@
     if (!bump_pointer_space_->AllocNewTlab(self, new_tlab_size, bytes_tl_bulk_allocated)) {
       return nullptr;
     }
-    if (CheckPerfettoJHPEnabled()) {
+    if (jhp_enabled) {
       VLOG(heap) << "JHP:kAllocatorTypeTLAB, New Tlab bytes allocated= " << new_tlab_size;
     }
   } else {
@@ -4552,14 +4552,12 @@
       if (LIKELY(!IsOutOfMemoryOnAllocation(allocator_type,
                                             space::RegionSpace::kRegionSize,
                                             grow))) {
-        size_t def_pr_tlab_size = kUsePartialTlabs
-                                      ? kPartialTlabSize
-                                      : gc::space::RegionSpace::kRegionSize;
-        size_t next_pr_tlab_size = JHPCalculateNextTlabSize(self,
-                                                            def_pr_tlab_size,
-                                                            alloc_size,
-                                                            &take_sample,
-                                                            &bytes_until_sample);
+        size_t next_pr_tlab_size =
+            kUsePartialTlabs ? kPartialTlabSize : gc::space::RegionSpace::kRegionSize;
+        if (jhp_enabled) {
+          next_pr_tlab_size = JHPCalculateNextTlabSize(
+              self, next_pr_tlab_size, alloc_size, &take_sample, &bytes_until_sample);
+        }
         const size_t new_tlab_size = kUsePartialTlabs
             ? std::max(alloc_size, next_pr_tlab_size)
             : next_pr_tlab_size;
@@ -4570,7 +4568,9 @@
                                                       bytes_allocated,
                                                       usable_size,
                                                       bytes_tl_bulk_allocated);
-          JHPCheckNonTlabSampleAllocation(self, ret, alloc_size);
+          if (jhp_enabled) {
+            JHPCheckNonTlabSampleAllocation(self, ret, alloc_size);
+          }
           return ret;
         }
         // Fall-through to using the TLAB below.
@@ -4581,7 +4581,9 @@
                                                       bytes_allocated,
                                                       usable_size,
                                                       bytes_tl_bulk_allocated);
-          JHPCheckNonTlabSampleAllocation(self, ret, alloc_size);
+          if (jhp_enabled) {
+            JHPCheckNonTlabSampleAllocation(self, ret, alloc_size);
+          }
           return ret;
         }
         // Neither tlab or non-tlab works. Give up.
@@ -4594,7 +4596,9 @@
                                                     bytes_allocated,
                                                     usable_size,
                                                     bytes_tl_bulk_allocated);
-        JHPCheckNonTlabSampleAllocation(self, ret, alloc_size);
+        if (jhp_enabled) {
+          JHPCheckNonTlabSampleAllocation(self, ret, alloc_size);
+        }
         return ret;
       }
       return nullptr;
@@ -4609,7 +4613,7 @@
   // JavaHeapProfiler: Send the thread information about this allocation in case a sample is
   // requested.
   // This is the fallthrough from both the if and else if above cases => Cases that use TLAB.
-  if (CheckPerfettoJHPEnabled()) {
+  if (jhp_enabled) {
     if (take_sample) {
       GetHeapSampler().ReportSample(ret, alloc_size);
       // Update the bytes_until_sample now that the allocation is already done.
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h
index 489be37..1243f4f 100644
--- a/runtime/gc/heap.h
+++ b/runtime/gc/heap.h
@@ -17,18 +17,19 @@
 #ifndef ART_RUNTIME_GC_HEAP_H_
 #define ART_RUNTIME_GC_HEAP_H_
 
+#include <android-base/logging.h>
+
 #include <iosfwd>
 #include <string>
 #include <unordered_set>
 #include <vector>
 
-#include <android-base/logging.h>
-
 #include "allocator_type.h"
 #include "base/atomic.h"
 #include "base/histogram.h"
 #include "base/macros.h"
 #include "base/mutex.h"
+#include "base/os.h"
 #include "base/runtime_debug.h"
 #include "base/safe_map.h"
 #include "base/time_utils.h"
@@ -38,15 +39,17 @@
 #include "gc/collector_type.h"
 #include "gc/gc_cause.h"
 #include "gc/space/large_object_space.h"
+#include "gc/space/space.h"
 #include "handle.h"
 #include "obj_ptr.h"
 #include "offsets.h"
 #include "process_state.h"
 #include "read_barrier_config.h"
 #include "runtime_globals.h"
+#include "scoped_thread_state_change.h"
 #include "verify_object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ConditionVariable;
 enum class InstructionSet;
@@ -134,21 +137,22 @@
   static constexpr size_t kPartialTlabSize = 16 * KB;
   static constexpr bool kUsePartialTlabs = true;
 
-  static constexpr size_t kDefaultStartingSize = kPageSize;
   static constexpr size_t kDefaultInitialSize = 2 * MB;
   static constexpr size_t kDefaultMaximumSize = 256 * MB;
   static constexpr size_t kDefaultNonMovingSpaceCapacity = 64 * MB;
-  static constexpr size_t kDefaultMaxFree = 2 * MB;
+  static constexpr size_t kDefaultMaxFree = 32 * MB;
   static constexpr size_t kDefaultMinFree = kDefaultMaxFree / 4;
   static constexpr size_t kDefaultLongPauseLogThreshold = MsToNs(5);
   static constexpr size_t kDefaultLongPauseLogThresholdGcStress = MsToNs(50);
   static constexpr size_t kDefaultLongGCLogThreshold = MsToNs(100);
   static constexpr size_t kDefaultLongGCLogThresholdGcStress = MsToNs(1000);
   static constexpr size_t kDefaultTLABSize = 32 * KB;
-  static constexpr double kDefaultTargetUtilization = 0.75;
+  static constexpr double kDefaultTargetUtilization = 0.6;
   static constexpr double kDefaultHeapGrowthMultiplier = 2.0;
   // Primitive arrays larger than this size are put in the large object space.
-  static constexpr size_t kMinLargeObjectThreshold = 3 * kPageSize;
+  // TODO: Preliminary experiments suggest this value might be not optimal.
+  //       This might benefit from further investigation.
+  static constexpr size_t kMinLargeObjectThreshold = 12 * KB;
   static constexpr size_t kDefaultLargeObjectThreshold = kMinLargeObjectThreshold;
   // Whether or not parallel GC is enabled. If not, then we never create the thread pool.
   static constexpr bool kDefaultEnableParallelGC = true;
@@ -178,10 +182,16 @@
   // RegisterNativeAllocation checks immediately whether GC is needed if size exceeds the
   // following. kCheckImmediatelyThreshold * kNotifyNativeInterval should be small enough to
   // make it safe to allocate that many bytes between checks.
-  static constexpr size_t kCheckImmediatelyThreshold = 300000;
+  static constexpr size_t kCheckImmediatelyThreshold = (10'000'000 / kNotifyNativeInterval);
 
   // How often we allow heap trimming to happen (nanoseconds).
   static constexpr uint64_t kHeapTrimWait = MsToNs(5000);
+
+  // Starting size of DlMalloc/RosAlloc spaces.
+  static size_t GetDefaultStartingSize() {
+    return gPageSize;
+  }
+
   // Whether the transition-GC heap threshold condition applies or not for non-low memory devices.
   // Stressing GC will bypass the heap threshold condition.
   DECLARE_RUNTIME_DEBUG_FLAG(kStressCollectorTransition);
@@ -200,10 +210,10 @@
        size_t non_moving_space_capacity,
        const std::vector<std::string>& boot_class_path,
        const std::vector<std::string>& boot_class_path_locations,
-       const std::vector<int>& boot_class_path_fds,
-       const std::vector<int>& boot_class_path_image_fds,
-       const std::vector<int>& boot_class_path_vdex_fds,
-       const std::vector<int>& boot_class_path_oat_fds,
+       ArrayRef<File> boot_class_path_files,
+       ArrayRef<File> boot_class_path_image_files,
+       ArrayRef<File> boot_class_path_vdex_files,
+       ArrayRef<File> boot_class_path_oat_files,
        const std::vector<std::string>& image_file_names,
        InstructionSet image_instruction_set,
        CollectorType foreground_collector_type,
@@ -270,7 +280,9 @@
                                                                   GetCurrentNonMovingAllocator(),
                                                                   pre_fence_visitor);
     // Java Heap Profiler check and sample allocation.
-    JHPCheckNonTlabSampleAllocation(self, obj, num_bytes);
+    if (GetHeapSampler().IsEnabled()) {
+      JHPCheckNonTlabSampleAllocation(self, obj, num_bytes);
+    }
     return obj;
   }
 
@@ -375,8 +387,8 @@
   bool IsMovableObject(ObjPtr<mirror::Object> obj) const REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Enables us to compacting GC until objects are released.
-  void IncrementDisableMovingGC(Thread* self) REQUIRES(!*gc_complete_lock_);
-  void DecrementDisableMovingGC(Thread* self) REQUIRES(!*gc_complete_lock_);
+  EXPORT void IncrementDisableMovingGC(Thread* self) REQUIRES(!*gc_complete_lock_);
+  EXPORT void DecrementDisableMovingGC(Thread* self) REQUIRES(!*gc_complete_lock_);
 
   // Temporarily disable thread flip for JNI critical calls.
   void IncrementDisableThreadFlip(Thread* self) REQUIRES(!*thread_flip_lock_);
@@ -389,13 +401,13 @@
 
   // Clear all of the mark bits, doesn't clear bitmaps which have the same live bits as mark bits.
   // Mutator lock is required for GetContinuousSpaces.
-  void ClearMarkedObjects()
+  void ClearMarkedObjects(bool release_eagerly = true)
       REQUIRES(Locks::heap_bitmap_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Initiates an explicit garbage collection. Guarantees that a GC started after this call has
   // completed.
-  void CollectGarbage(bool clear_soft_references, GcCause cause = kGcCauseExplicit)
+  EXPORT void CollectGarbage(bool clear_soft_references, GcCause cause = kGcCauseExplicit)
       REQUIRES(!*gc_complete_lock_, !*pending_task_lock_, !process_state_update_lock_);
 
   // Does a concurrent GC, provided the GC numbered requested_gc_num has not already been
@@ -473,7 +485,8 @@
   // Blocks the caller until the garbage collector becomes idle and returns the type of GC we
   // waited for. Only waits for running collections, ignoring a requested but unstarted GC. Only
   // heuristic, since a new GC may have started by the time we return.
-  collector::GcType WaitForGcToComplete(GcCause cause, Thread* self) REQUIRES(!*gc_complete_lock_);
+  EXPORT collector::GcType WaitForGcToComplete(GcCause cause, Thread* self)
+      REQUIRES(!*gc_complete_lock_);
 
   // Update the heap's process state to a new value, may cause compaction to occur.
   void UpdateProcessState(ProcessState old_process_state, ProcessState new_process_state)
@@ -542,7 +555,7 @@
     return rb_table_.get();
   }
 
-  void AddFinalizerReference(Thread* self, ObjPtr<mirror::Object>* object);
+  EXPORT void AddFinalizerReference(Thread* self, ObjPtr<mirror::Object>* object);
 
   // Returns the number of bytes currently allocated.
   // The result should be treated as an approximation, if it is being concurrently updated.
@@ -563,21 +576,14 @@
   size_t GetObjectsAllocated() const
       REQUIRES(!Locks::heap_bitmap_lock_);
 
-  // Returns the total number of objects allocated since the heap was created.
-  uint64_t GetObjectsAllocatedEver() const;
-
   // Returns the total number of bytes allocated since the heap was created.
   uint64_t GetBytesAllocatedEver() const;
 
-  // Returns the total number of objects freed since the heap was created.
-  // With default memory order, this should be viewed only as a hint.
-  uint64_t GetObjectsFreedEver(std::memory_order mo = std::memory_order_relaxed) const {
-    return total_objects_freed_ever_.load(mo);
-  }
-
   // Returns the total number of bytes freed since the heap was created.
+  // Can decrease over time, and may even be negative, since moving an object to
+  // a space in which it occupies more memory results in negative "freed bytes".
   // With default memory order, this should be viewed only as a hint.
-  uint64_t GetBytesFreedEver(std::memory_order mo = std::memory_order_relaxed) const {
+  int64_t GetBytesFreedEver(std::memory_order mo = std::memory_order_relaxed) const {
     return total_bytes_freed_ever_.load(mo);
   }
 
@@ -600,7 +606,7 @@
 
   // Implements java.lang.Runtime.totalMemory, returning approximate amount of memory currently
   // consumed by an application.
-  size_t GetTotalMemory() const;
+  EXPORT size_t GetTotalMemory() const;
 
   // Returns approximately how much free memory we have until the next GC happens.
   size_t GetFreeMemoryUntilGC() const {
@@ -623,7 +629,8 @@
   // Get the space that corresponds to an object's address. Current implementation searches all
   // spaces in turn. If fail_ok is false then failing to find a space will cause an abort.
   // TODO: consider using faster data structure like binary tree.
-  space::ContinuousSpace* FindContinuousSpaceFromObject(ObjPtr<mirror::Object>, bool fail_ok) const
+  EXPORT space::ContinuousSpace* FindContinuousSpaceFromObject(ObjPtr<mirror::Object>,
+                                                               bool fail_ok) const
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   space::ContinuousSpace* FindContinuousSpaceFromAddress(const mirror::Object* addr) const
@@ -633,7 +640,7 @@
                                                               bool fail_ok) const
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  space::Space* FindSpaceFromObject(ObjPtr<mirror::Object> obj, bool fail_ok) const
+  EXPORT space::Space* FindSpaceFromObject(ObjPtr<mirror::Object> obj, bool fail_ok) const
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   space::Space* FindSpaceFromAddress(const void* ptr) const
@@ -649,7 +656,7 @@
       REQUIRES(!*gc_complete_lock_, !*pending_task_lock_, !process_state_update_lock_);
 
   // Deflate monitors, ... and trim the spaces.
-  void Trim(Thread* self) REQUIRES(!*gc_complete_lock_);
+  EXPORT void Trim(Thread* self) REQUIRES(!*gc_complete_lock_);
 
   void RevokeThreadLocalBuffers(Thread* thread);
   void RevokeRosAllocThreadLocalBuffers(Thread* thread);
@@ -678,19 +685,18 @@
   void PreZygoteFork() NO_THREAD_SAFETY_ANALYSIS;
 
   // Mark and empty stack.
-  void FlushAllocStack()
-      REQUIRES_SHARED(Locks::mutator_lock_)
+  EXPORT void FlushAllocStack() REQUIRES_SHARED(Locks::mutator_lock_)
       REQUIRES(Locks::heap_bitmap_lock_);
 
   // Revoke all the thread-local allocation stacks.
-  void RevokeAllThreadLocalAllocationStacks(Thread* self)
+  EXPORT void RevokeAllThreadLocalAllocationStacks(Thread* self)
       REQUIRES(Locks::mutator_lock_, !Locks::runtime_shutdown_lock_, !Locks::thread_list_lock_);
 
   // Mark all the objects in the allocation stack in the specified bitmap.
   // TODO: Refactor?
-  void MarkAllocStack(accounting::SpaceBitmap<kObjectAlignment>* bitmap1,
-                      accounting::SpaceBitmap<kObjectAlignment>* bitmap2,
-                      accounting::SpaceBitmap<kLargeObjectAlignment>* large_objects,
+  void MarkAllocStack(accounting::ContinuousSpaceBitmap* bitmap1,
+                      accounting::ContinuousSpaceBitmap* bitmap2,
+                      accounting::LargeObjectBitmap* large_objects,
                       accounting::ObjectStack* stack)
       REQUIRES_SHARED(Locks::mutator_lock_)
       REQUIRES(Locks::heap_bitmap_lock_);
@@ -710,7 +716,9 @@
     return boot_image_spaces_;
   }
 
-  bool ObjectIsInBootImageSpace(ObjPtr<mirror::Object> obj) const
+  // TODO(b/260881207): refactor to only use this function in debug builds and
+  // remove EXPORT.
+  EXPORT bool ObjectIsInBootImageSpace(ObjPtr<mirror::Object> obj) const
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   bool IsInBootImageOatFile(const void* p) const
@@ -767,7 +775,7 @@
   }
 
   void DumpSpaces(std::ostream& stream) const REQUIRES_SHARED(Locks::mutator_lock_);
-  std::string DumpSpaces() const REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT std::string DumpSpaces() const REQUIRES_SHARED(Locks::mutator_lock_);
 
   // GC performance measuring
   void DumpGcPerformanceInfo(std::ostream& os)
@@ -800,6 +808,16 @@
   bool HasBootImageSpace() const {
     return !boot_image_spaces_.empty();
   }
+  bool HasAppImageSpace() const {
+    ScopedObjectAccess soa(Thread::Current());
+    for (const space::ContinuousSpace* space : continuous_spaces_) {
+      // An image space is either a boot image space or an app image space.
+      if (space->IsImageSpace() && !IsBootImageAddress(space->Begin())) {
+        return true;
+      }
+    }
+    return false;
+  }
 
   ReferenceProcessor* GetReferenceProcessor() {
     return reference_processor_.get();
@@ -843,7 +861,8 @@
   bool IsMovingGc() const { return IsMovingGc(CurrentCollectorType()); }
 
   CollectorType GetForegroundCollectorType() const { return foreground_collector_type_; }
-  std::string GetForegroundCollectorName();
+  // EXPORT is needed to make this method visible for libartservice.
+  EXPORT std::string GetForegroundCollectorName();
 
   bool IsGcConcurrentAndMoving() const {
     if (IsGcConcurrent() && IsMovingGc(collector_type_)) {
@@ -903,14 +922,11 @@
   }
 
   void InitPerfettoJavaHeapProf();
-  int CheckPerfettoJHPEnabled();
   // In NonTlab case: Check whether we should report a sample allocation and if so report it.
   // Also update state (bytes_until_sample).
   // By calling JHPCheckNonTlabSampleAllocation from different functions for Large allocations and
   // non-moving allocations we are able to use the stack to identify these allocations separately.
-  void JHPCheckNonTlabSampleAllocation(Thread* self,
-                                       mirror::Object* ret,
-                                       size_t alloc_size);
+  EXPORT void JHPCheckNonTlabSampleAllocation(Thread* self, mirror::Object* ret, size_t alloc_size);
   // In Tlab case: Calculate the next tlab size (location of next sample point) and whether
   // a sample should be taken.
   size_t JHPCalculateNextTlabSize(Thread* self,
@@ -971,34 +987,53 @@
   bool IsGCDisabledForShutdown() const REQUIRES(!*gc_complete_lock_);
 
   // Create a new alloc space and compact default alloc space to it.
-  HomogeneousSpaceCompactResult PerformHomogeneousSpaceCompact()
+  EXPORT HomogeneousSpaceCompactResult PerformHomogeneousSpaceCompact()
       REQUIRES(!*gc_complete_lock_, !process_state_update_lock_);
-  bool SupportHomogeneousSpaceCompactAndCollectorTransitions() const;
+  EXPORT bool SupportHomogeneousSpaceCompactAndCollectorTransitions() const;
 
   // Install an allocation listener.
-  void SetAllocationListener(AllocationListener* l);
+  EXPORT void SetAllocationListener(AllocationListener* l);
   // Remove an allocation listener. Note: the listener must not be deleted, as for performance
   // reasons, we assume it stays valid when we read it (so that we don't require a lock).
-  void RemoveAllocationListener();
+  EXPORT void RemoveAllocationListener();
 
   // Install a gc pause listener.
-  void SetGcPauseListener(GcPauseListener* l);
+  EXPORT void SetGcPauseListener(GcPauseListener* l);
   // Get the currently installed gc pause listener, or null.
   GcPauseListener* GetGcPauseListener() {
     return gc_pause_listener_.load(std::memory_order_acquire);
   }
   // Remove a gc pause listener. Note: the listener must not be deleted, as for performance
   // reasons, we assume it stays valid when we read it (so that we don't require a lock).
-  void RemoveGcPauseListener();
+  EXPORT void RemoveGcPauseListener();
 
-  const Verification* GetVerification() const;
+  EXPORT const Verification* GetVerification() const;
 
   void PostForkChildAction(Thread* self) REQUIRES(!*gc_complete_lock_);
 
-  void TraceHeapSize(size_t heap_size);
+  EXPORT void TraceHeapSize(size_t heap_size);
 
   bool AddHeapTask(gc::HeapTask* task);
 
+  // TODO: Kernels for arm and x86 in both, 32-bit and 64-bit modes use 512 entries per page-table
+  // page. Find a way to confirm that in userspace.
+  // Address range covered by 1 Page Middle Directory (PMD) entry in the page table
+  static inline ALWAYS_INLINE size_t GetPMDSize() {
+    return (gPageSize / sizeof(uint64_t)) * gPageSize;
+  }
+  // Address range covered by 1 Page Upper Directory (PUD) entry in the page table
+  static inline ALWAYS_INLINE size_t GetPUDSize() {
+    return (gPageSize / sizeof(uint64_t)) * GetPMDSize();
+  }
+
+  // Returns the ideal alignment corresponding to page-table levels for the
+  // given size.
+  static inline size_t BestPageTableAlignment(size_t size) {
+    const size_t pud_size = GetPUDSize();
+    const size_t pmd_size = GetPMDSize();
+    return size < pud_size ? pmd_size : pud_size;
+  }
+
  private:
   class ConcurrentGCTask;
   class CollectorTransitionTask;
@@ -1082,17 +1117,16 @@
   // attempt failed.
   // Called with thread suspension disallowed, but re-enables it, and may suspend, internally.
   // Returns null if instrumentation or the allocator changed.
-  mirror::Object* AllocateInternalWithGc(Thread* self,
-                                         AllocatorType allocator,
-                                         bool instrumented,
-                                         size_t num_bytes,
-                                         size_t* bytes_allocated,
-                                         size_t* usable_size,
-                                         size_t* bytes_tl_bulk_allocated,
-                                         ObjPtr<mirror::Class>* klass)
+  EXPORT mirror::Object* AllocateInternalWithGc(Thread* self,
+                                                AllocatorType allocator,
+                                                bool instrumented,
+                                                size_t num_bytes,
+                                                size_t* bytes_allocated,
+                                                size_t* usable_size,
+                                                size_t* bytes_tl_bulk_allocated,
+                                                ObjPtr<mirror::Class>* klass)
       REQUIRES(!Locks::thread_suspend_count_lock_, !*gc_complete_lock_, !*pending_task_lock_)
-      REQUIRES(Roles::uninterruptible_)
-      REQUIRES_SHARED(Locks::mutator_lock_);
+          REQUIRES(Roles::uninterruptible_) REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Allocate into a specific space.
   mirror::Object* AllocateInto(Thread* self,
@@ -1116,13 +1150,13 @@
                                               size_t* bytes_tl_bulk_allocated)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  mirror::Object* AllocWithNewTLAB(Thread* self,
-                                   AllocatorType allocator_type,
-                                   size_t alloc_size,
-                                   bool grow,
-                                   size_t* bytes_allocated,
-                                   size_t* usable_size,
-                                   size_t* bytes_tl_bulk_allocated)
+  EXPORT mirror::Object* AllocWithNewTLAB(Thread* self,
+                                          AllocatorType allocator_type,
+                                          size_t alloc_size,
+                                          bool grow,
+                                          size_t* bytes_allocated,
+                                          size_t* usable_size,
+                                          size_t* bytes_tl_bulk_allocated)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   void ThrowOutOfMemoryError(Thread* self, size_t byte_count, AllocatorType allocator_type)
@@ -1145,12 +1179,11 @@
   void RequestCollectorTransition(CollectorType desired_collector_type, uint64_t delta_time)
       REQUIRES(!*pending_task_lock_);
 
-  void RequestConcurrentGCAndSaveObject(Thread* self,
-                                        bool force_full,
-                                        uint32_t observed_gc_num,
-                                        ObjPtr<mirror::Object>* obj)
-      REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(!*pending_task_lock_);
+  EXPORT void RequestConcurrentGCAndSaveObject(Thread* self,
+                                               bool force_full,
+                                               uint32_t observed_gc_num,
+                                               ObjPtr<mirror::Object>* obj)
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*pending_task_lock_);
 
   static constexpr uint32_t GC_NUM_ANY = std::numeric_limits<uint32_t>::max();
 
@@ -1229,9 +1262,10 @@
   void PushOnAllocationStackWithInternalGC(Thread* self, ObjPtr<mirror::Object>* obj)
       REQUIRES_SHARED(Locks::mutator_lock_)
       REQUIRES(!*gc_complete_lock_, !*pending_task_lock_, !process_state_update_lock_);
-  void PushOnThreadLocalAllocationStackWithInternalGC(Thread* thread, ObjPtr<mirror::Object>* obj)
+  EXPORT void PushOnThreadLocalAllocationStackWithInternalGC(Thread* thread,
+                                                             ObjPtr<mirror::Object>* obj)
       REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(!*gc_complete_lock_, !*pending_task_lock_, !process_state_update_lock_);
+          REQUIRES(!*gc_complete_lock_, !*pending_task_lock_, !process_state_update_lock_);
 
   void ClearPendingTrim(Thread* self) REQUIRES(!*pending_task_lock_);
   void ClearPendingCollectorTransition(Thread* self) REQUIRES(!*pending_task_lock_);
@@ -1262,10 +1296,11 @@
   void UpdateGcCountRateHistograms() REQUIRES(gc_complete_lock_);
 
   // GC stress mode attempts to do one GC per unique backtrace.
-  void CheckGcStressMode(Thread* self, ObjPtr<mirror::Object>* obj)
-      REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(!*gc_complete_lock_, !*pending_task_lock_,
-               !*backtrace_lock_, !process_state_update_lock_);
+  EXPORT void CheckGcStressMode(Thread* self, ObjPtr<mirror::Object>* obj)
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*gc_complete_lock_,
+                                                     !*pending_task_lock_,
+                                                     !*backtrace_lock_,
+                                                     !process_state_update_lock_);
 
   collector::GcType NonStickyGcType() const {
     return HasZygoteSpace() ? collector::kGcTypePartial : collector::kGcTypeFull;
@@ -1290,7 +1325,9 @@
   void IncrementFreedEver();
 
   // Remove a vlog code from heap-inl.h which is transitively included in half the world.
-  static void VlogHeapGrowth(size_t max_allowed_footprint, size_t new_footprint, size_t alloc_size);
+  EXPORT static void VlogHeapGrowth(size_t max_allowed_footprint,
+                                    size_t new_footprint,
+                                    size_t alloc_size);
 
   // Return our best approximation of the number of bytes of native memory that
   // are currently in use, and could possibly be reclaimed as an indirect result
@@ -1469,7 +1506,7 @@
   size_t concurrent_start_bytes_;
 
   // Since the heap was created, how many bytes have been freed.
-  std::atomic<uint64_t> total_bytes_freed_ever_;
+  std::atomic<int64_t> total_bytes_freed_ever_;
 
   // Since the heap was created, how many objects have been freed.
   std::atomic<uint64_t> total_objects_freed_ever_;
diff --git a/runtime/gc/heap_test.cc b/runtime/gc/heap_test.cc
index b569241..bd8fdc6 100644
--- a/runtime/gc/heap_test.cc
+++ b/runtime/gc/heap_test.cc
@@ -28,7 +28,7 @@
 #include "mirror/object_array-inl.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 class HeapTest : public CommonRuntimeTest {
@@ -111,6 +111,7 @@
 TEST_F(HeapTest, GCMetrics) {
   // Allocate a few string objects (to be collected), then trigger garbage
   // collection, and check that GC metrics are updated (where applicable).
+  Heap* heap = Runtime::Current()->GetHeap();
   {
     constexpr const size_t kNumObj = 128;
     ScopedObjectAccess soa(Thread::Current());
@@ -119,8 +120,11 @@
       Handle<mirror::String> string [[maybe_unused]] (
           hs.NewHandle(mirror::String::AllocFromModifiedUtf8(soa.Self(), "test")));
     }
+    // Do one GC while the temporary objects are reachable, forcing the GC to scan something.
+    // The subsequent GC at line 127 may not scan anything but will certainly free some bytes.
+    // Together the two GCs ensure success of the test.
+    heap->CollectGarbage(/* clear_soft_references= */ false);
   }
-  Heap* heap = Runtime::Current()->GetHeap();
   heap->CollectGarbage(/* clear_soft_references= */ false);
 
   // ART Metrics.
diff --git a/runtime/gc/heap_verification_test.cc b/runtime/gc/heap_verification_test.cc
index a7583fe..168feef 100644
--- a/runtime/gc/heap_verification_test.cc
+++ b/runtime/gc/heap_verification_test.cc
@@ -28,7 +28,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "verification-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 class VerificationTest : public CommonRuntimeTest {
diff --git a/runtime/gc/reference_processor.cc b/runtime/gc/reference_processor.cc
index f24c942..cb777c8 100644
--- a/runtime/gc/reference_processor.cc
+++ b/runtime/gc/reference_processor.cc
@@ -36,7 +36,7 @@
 #include "thread_pool.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 static constexpr bool kAsyncReferenceQueueAdd = false;
diff --git a/runtime/gc/reference_processor.h b/runtime/gc/reference_processor.h
index 0f84211..48aff6c 100644
--- a/runtime/gc/reference_processor.h
+++ b/runtime/gc/reference_processor.h
@@ -17,12 +17,13 @@
 #ifndef ART_RUNTIME_GC_REFERENCE_PROCESSOR_H_
 #define ART_RUNTIME_GC_REFERENCE_PROCESSOR_H_
 
+#include "base/macros.h"
 #include "base/locks.h"
 #include "jni.h"
 #include "reference_queue.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class IsMarkedVisitor;
 class TimingLogger;
diff --git a/runtime/gc/reference_queue.cc b/runtime/gc/reference_queue.cc
index 53eef9c..82fd89e 100644
--- a/runtime/gc/reference_queue.cc
+++ b/runtime/gc/reference_queue.cc
@@ -25,7 +25,7 @@
 #include "mirror/reference-inl.h"
 #include "object_callbacks.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 ReferenceQueue::ReferenceQueue(Mutex* lock) : lock_(lock), list_(nullptr) {
diff --git a/runtime/gc/reference_queue.h b/runtime/gc/reference_queue.h
index 69f04d7..d43eb34 100644
--- a/runtime/gc/reference_queue.h
+++ b/runtime/gc/reference_queue.h
@@ -23,6 +23,7 @@
 
 #include "base/atomic.h"
 #include "base/locks.h"
+#include "base/macros.h"
 #include "base/timing_logger.h"
 #include "jni.h"
 #include "obj_ptr.h"
@@ -30,7 +31,7 @@
 #include "runtime_globals.h"
 #include "thread_pool.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class Mutex;
 
diff --git a/runtime/gc/reference_queue_test.cc b/runtime/gc/reference_queue_test.cc
index c8e71b0..2b5c3fd 100644
--- a/runtime/gc/reference_queue_test.cc
+++ b/runtime/gc/reference_queue_test.cc
@@ -23,7 +23,7 @@
 #include "reference_queue.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 class ReferenceQueueTest : public CommonRuntimeTest {
diff --git a/runtime/gc/scoped_gc_critical_section.cc b/runtime/gc/scoped_gc_critical_section.cc
index 7a0a6e8..368649a 100644
--- a/runtime/gc/scoped_gc_critical_section.cc
+++ b/runtime/gc/scoped_gc_critical_section.cc
@@ -21,7 +21,7 @@
 #include "runtime.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 const char* GCCriticalSection::Enter(GcCause cause, CollectorType type) {
diff --git a/runtime/gc/scoped_gc_critical_section.h b/runtime/gc/scoped_gc_critical_section.h
index 8ad0158..8481767 100644
--- a/runtime/gc/scoped_gc_critical_section.h
+++ b/runtime/gc/scoped_gc_critical_section.h
@@ -18,10 +18,11 @@
 #define ART_RUNTIME_GC_SCOPED_GC_CRITICAL_SECTION_H_
 
 #include "base/locks.h"
+#include "base/macros.h"
 #include "collector_type.h"
 #include "gc_cause.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class Thread;
 
@@ -35,10 +36,10 @@
   ~GCCriticalSection() {}
 
   // Starts a GCCriticalSection. Returns the previous no-suspension reason.
-  const char* Enter(GcCause cause, CollectorType type) ACQUIRE(Roles::uninterruptible_);
+  EXPORT const char* Enter(GcCause cause, CollectorType type) ACQUIRE(Roles::uninterruptible_);
 
   // Ends a GCCriticalSection. Takes the old no-suspension reason.
-  void Exit(const char* old_reason) RELEASE(Roles::uninterruptible_);
+  EXPORT void Exit(const char* old_reason) RELEASE(Roles::uninterruptible_);
 
  private:
   Thread* const self_;
@@ -50,9 +51,9 @@
 // suspended.
 class ScopedGCCriticalSection {
  public:
-  ScopedGCCriticalSection(Thread* self, GcCause cause, CollectorType collector_type)
+  EXPORT ScopedGCCriticalSection(Thread* self, GcCause cause, CollectorType collector_type)
       ACQUIRE(Roles::uninterruptible_);
-  ~ScopedGCCriticalSection() RELEASE(Roles::uninterruptible_);
+  EXPORT ~ScopedGCCriticalSection() RELEASE(Roles::uninterruptible_);
 
  private:
   GCCriticalSection critical_section_;
diff --git a/runtime/gc/space/bump_pointer_space-inl.h b/runtime/gc/space/bump_pointer_space-inl.h
index 2774b9e..6751344 100644
--- a/runtime/gc/space/bump_pointer_space-inl.h
+++ b/runtime/gc/space/bump_pointer_space-inl.h
@@ -22,7 +22,7 @@
 #include "base/bit_utils.h"
 #include "mirror/object-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
diff --git a/runtime/gc/space/bump_pointer_space-walk-inl.h b/runtime/gc/space/bump_pointer_space-walk-inl.h
index 89e42bc..86af045 100644
--- a/runtime/gc/space/bump_pointer_space-walk-inl.h
+++ b/runtime/gc/space/bump_pointer_space-walk-inl.h
@@ -25,7 +25,7 @@
 
 #include <memory>
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
diff --git a/runtime/gc/space/bump_pointer_space.cc b/runtime/gc/space/bump_pointer_space.cc
index c63559a..17e0835 100644
--- a/runtime/gc/space/bump_pointer_space.cc
+++ b/runtime/gc/space/bump_pointer_space.cc
@@ -20,12 +20,12 @@
 #include "mirror/object-inl.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
 BumpPointerSpace* BumpPointerSpace::Create(const std::string& name, size_t capacity) {
-  capacity = RoundUp(capacity, kPageSize);
+  capacity = RoundUp(capacity, gPageSize);
   std::string error_msg;
   MemMap mem_map = MemMap::MapAnonymous(name.c_str(),
                                         capacity,
diff --git a/runtime/gc/space/bump_pointer_space.h b/runtime/gc/space/bump_pointer_space.h
index d5ab506..77beb47 100644
--- a/runtime/gc/space/bump_pointer_space.h
+++ b/runtime/gc/space/bump_pointer_space.h
@@ -22,7 +22,7 @@
 
 #include <deque>
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Object;
@@ -39,7 +39,7 @@
 
 // A bump pointer space allocates by incrementing a pointer, it doesn't provide a free
 // implementation as its intended to be evacuated.
-class BumpPointerSpace final : public ContinuousMemMapAllocSpace {
+class EXPORT BumpPointerSpace final : public ContinuousMemMapAllocSpace {
  public:
   using WalkCallback = void (*)(void *, void *, int, void *);
 
diff --git a/runtime/gc/space/dlmalloc_space-inl.h b/runtime/gc/space/dlmalloc_space-inl.h
index 6041fd0..0d94673 100644
--- a/runtime/gc/space/dlmalloc_space-inl.h
+++ b/runtime/gc/space/dlmalloc_space-inl.h
@@ -21,7 +21,7 @@
 #include "gc/allocator/art-dlmalloc.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
diff --git a/runtime/gc/space/dlmalloc_space.cc b/runtime/gc/space/dlmalloc_space.cc
index 1edcdbd..b45e482 100644
--- a/runtime/gc/space/dlmalloc_space.cc
+++ b/runtime/gc/space/dlmalloc_space.cc
@@ -16,6 +16,8 @@
 
 #include "dlmalloc_space-inl.h"
 
+#include <sys/mman.h>
+
 #include "base/logging.h"  // For VLOG.
 #include "base/time_utils.h"
 #include "base/utils.h"
@@ -32,12 +34,60 @@
 #include "thread.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
 static constexpr bool kPrefetchDuringDlMallocFreeList = true;
 
+// Callback for mspace_inspect_all that will madvise(2) unused pages back to
+// the kernel.
+void DlmallocMadviseCallback(void* start, void* end, size_t used_bytes, void* arg) {
+  // Is this chunk in use?
+  if (used_bytes != 0) {
+    return;
+  }
+  // Do we have any whole pages to give back?
+  start = reinterpret_cast<void*>(art::RoundUp(reinterpret_cast<uintptr_t>(start), art::gPageSize));
+  end = reinterpret_cast<void*>(art::RoundDown(reinterpret_cast<uintptr_t>(end), art::gPageSize));
+  if (end > start) {
+    size_t length = reinterpret_cast<uint8_t*>(end) - reinterpret_cast<uint8_t*>(start);
+    int rc = madvise(start, length, MADV_DONTNEED);
+    if (UNLIKELY(rc != 0)) {
+      errno = rc;
+      PLOG(FATAL) << "madvise failed during heap trimming";
+    }
+    size_t* reclaimed = reinterpret_cast<size_t*>(arg);
+    *reclaimed += length;
+  }
+}
+
+// Callback for mspace_inspect_all that will count the number of bytes
+// allocated.
+void DlmallocBytesAllocatedCallback([[maybe_unused]] void* start,
+                                    [[maybe_unused]] void* end,
+                                    size_t used_bytes,
+                                    void* arg) {
+  if (used_bytes == 0) {
+    return;
+  }
+  size_t* bytes_allocated = reinterpret_cast<size_t*>(arg);
+  *bytes_allocated += used_bytes + sizeof(size_t);
+}
+
+// Callback for mspace_inspect_all that will count the number of objects
+// allocated.
+void DlmallocObjectsAllocatedCallback([[maybe_unused]] void* start,
+                                      [[maybe_unused]] void* end,
+                                      size_t used_bytes,
+                                      void* arg) {
+  if (used_bytes == 0) {
+    return;
+  }
+  size_t* objects_allocated = reinterpret_cast<size_t*>(arg);
+  ++(*objects_allocated);
+}
+
 DlMallocSpace::DlMallocSpace(MemMap&& mem_map,
                              size_t initial_size,
                              const std::string& name,
@@ -126,7 +176,7 @@
   // Note: making this value large means that large allocations are unlikely to succeed as dlmalloc
   // will ask for this memory from sys_alloc which will fail as the footprint (this value plus the
   // size of the large allocation) will be greater than the footprint limit.
-  size_t starting_size = kPageSize;
+  size_t starting_size = gPageSize;
   MemMap mem_map = CreateMemMap(name, starting_size, &initial_size, &growth_limit, &capacity);
   if (!mem_map.IsValid()) {
     LOG(ERROR) << "Failed to create mem map for alloc space (" << name << ") of size "
diff --git a/runtime/gc/space/dlmalloc_space.h b/runtime/gc/space/dlmalloc_space.h
index 429b4d0..774d2e3 100644
--- a/runtime/gc/space/dlmalloc_space.h
+++ b/runtime/gc/space/dlmalloc_space.h
@@ -20,7 +20,7 @@
 #include "malloc_space.h"
 #include "space.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 namespace collector {
@@ -188,6 +188,14 @@
 };
 
 }  // namespace space
+
+namespace allocator {
+
+// Callback from dlmalloc when it needs to increase the footprint.
+// Must be implemented outside of art-dlmalloc.cc.
+void* ArtDlMallocMoreCore(void* mspace, intptr_t increment);
+
+}  // namespace allocator
 }  // namespace gc
 }  // namespace art
 
diff --git a/runtime/gc/space/dlmalloc_space_random_test.cc b/runtime/gc/space/dlmalloc_space_random_test.cc
index b653bcf..bcca442 100644
--- a/runtime/gc/space/dlmalloc_space_random_test.cc
+++ b/runtime/gc/space/dlmalloc_space_random_test.cc
@@ -18,7 +18,7 @@
 
 #include "dlmalloc_space.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 namespace {
diff --git a/runtime/gc/space/dlmalloc_space_static_test.cc b/runtime/gc/space/dlmalloc_space_static_test.cc
index 74dd765..c07a8ea 100644
--- a/runtime/gc/space/dlmalloc_space_static_test.cc
+++ b/runtime/gc/space/dlmalloc_space_static_test.cc
@@ -18,7 +18,7 @@
 
 #include "dlmalloc_space.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 namespace {
diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc
index f460601..e3e14ca 100644
--- a/runtime/gc/space/image_space.cc
+++ b/runtime/gc/space/image_space.cc
@@ -20,7 +20,9 @@
 #include <sys/types.h>
 #include <unistd.h>
 
+#include <array>
 #include <memory>
+#include <optional>
 #include <random>
 #include <string>
 #include <vector>
@@ -53,21 +55,21 @@
 #include "exec_utils.h"
 #include "gc/accounting/space_bitmap-inl.h"
 #include "gc/task_processor.h"
-#include "image-inl.h"
-#include "image.h"
 #include "intern_table-inl.h"
 #include "mirror/class-inl.h"
 #include "mirror/executable-inl.h"
 #include "mirror/object-inl.h"
 #include "mirror/object-refvisitor-inl.h"
 #include "mirror/var_handle.h"
-#include "oat.h"
-#include "oat_file.h"
+#include "oat/image-inl.h"
+#include "oat/image.h"
+#include "oat/oat.h"
+#include "oat/oat_file.h"
 #include "profile/profile_compilation_info.h"
 #include "runtime.h"
 #include "space-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
@@ -105,19 +107,19 @@
 }
 
 static int32_t ChooseRelocationOffsetDelta(int32_t min_delta, int32_t max_delta) {
-  CHECK_ALIGNED(min_delta, kPageSize);
-  CHECK_ALIGNED(max_delta, kPageSize);
+  CHECK_ALIGNED(min_delta, kElfSegmentAlignment);
+  CHECK_ALIGNED(max_delta, kElfSegmentAlignment);
   CHECK_LT(min_delta, max_delta);
 
   int32_t r = GetRandomNumber<int32_t>(min_delta, max_delta);
   if (r % 2 == 0) {
-    r = RoundUp(r, kPageSize);
+    r = RoundUp(r, kElfSegmentAlignment);
   } else {
-    r = RoundDown(r, kPageSize);
+    r = RoundDown(r, kElfSegmentAlignment);
   }
   CHECK_LE(min_delta, r);
   CHECK_GE(max_delta, r);
-  CHECK_ALIGNED(r, kPageSize);
+  CHECK_ALIGNED(r, kElfSegmentAlignment);
   return r;
 }
 
@@ -332,7 +334,7 @@
   }
 
   template <typename T>
-  T* operator()(T* ptr, void** dest_addr ATTRIBUTE_UNUSED) const {
+  T* operator()(T* ptr, [[maybe_unused]] void** dest_addr) const {
     return (ptr != nullptr) ? native_visitor_(ptr) : nullptr;
   }
 
@@ -373,9 +375,9 @@
     this->operator()(ref, mirror::Reference::ReferentOffset(), /*is_static=*/ false);
   }
   // Ignore class native roots; not called from VisitReferences() for kVisitNativeRoots == false.
-  void VisitRootIfNonNull(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED)
-      const {}
-  void VisitRoot(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED) const {}
+  void VisitRootIfNonNull(
+      [[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {}
+  void VisitRoot([[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {}
 
   template <typename T> void VisitNativeDexCacheArray(mirror::NativeArray<T>* array)
       REQUIRES_SHARED(Locks::mutator_lock_) {
@@ -516,8 +518,8 @@
   // Visitor for VisitReferences().
   ALWAYS_INLINE void operator()(ObjPtr<mirror::Object> object,
                                 MemberOffset field_offset,
-                                bool is_static ATTRIBUTE_UNUSED)
-      const REQUIRES_SHARED(Locks::mutator_lock_) {
+                                [[maybe_unused]] bool is_static) const
+      REQUIRES_SHARED(Locks::mutator_lock_) {
     ObjPtr<mirror::Object> old_value =
         object->GetFieldObject<mirror::Object, kVerifyNone, kWithoutReadBarrier>(field_offset);
     if (old_value != nullptr &&
@@ -538,9 +540,9 @@
     this->operator()(ref, mirror::Reference::ReferentOffset(), /*is_static=*/ false);
   }
   // Ignore class native roots; not called from VisitReferences() for kVisitNativeRoots == false.
-  void VisitRootIfNonNull(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED)
-      const {}
-  void VisitRoot(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED) const {}
+  void VisitRootIfNonNull(
+      [[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {}
+  void VisitRoot([[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {}
 
  private:
   mirror::Class* GetStringClass() REQUIRES_SHARED(Locks::mutator_lock_) {
@@ -595,7 +597,8 @@
         return nullptr;
       }
 
-      uint32_t expected_reservation_size = RoundUp(image_header.GetImageSize(), kPageSize);
+      uint32_t expected_reservation_size = RoundUp(image_header.GetImageSize(),
+          kElfSegmentAlignment);
       if (!CheckImageReservationSize(*space, expected_reservation_size, error_msg) ||
           !CheckImageComponentCount(*space, /*expected_component_count=*/ 1u, error_msg)) {
         return nullptr;
@@ -730,7 +733,7 @@
     // The location we want to map from is the first aligned page after the end of the stored
     // (possibly compressed) data.
     const size_t image_bitmap_offset =
-        RoundUp(sizeof(ImageHeader) + image_header.GetDataSize(), kPageSize);
+        RoundUp(sizeof(ImageHeader) + image_header.GetDataSize(), kElfSegmentAlignment);
     const size_t end_of_bitmap = image_bitmap_offset + bitmap_section.Size();
     if (end_of_bitmap != image_file_size) {
       *error_msg = StringPrintf(
@@ -996,8 +999,11 @@
     const bool is_compressed = image_header.HasCompressedBlock();
     if (!is_compressed && allow_direct_mapping) {
       uint8_t* address = (image_reservation != nullptr) ? image_reservation->Begin() : nullptr;
+      // The reserved memory size is aligned up to kElfSegmentAlignment to ensure
+      // that the next reserved area will be aligned to the value.
       return MemMap::MapFileAtAddress(address,
-                                      image_header.GetImageSize(),
+                                      CondRoundUp<kPageSizeAgnostic>(image_header.GetImageSize(),
+                                                                     kElfSegmentAlignment),
                                       PROT_READ | PROT_WRITE,
                                       MAP_PRIVATE,
                                       fd,
@@ -1010,8 +1016,11 @@
     }
 
     // Reserve output and copy/decompress into it.
+    // The reserved memory size is aligned up to kElfSegmentAlignment to ensure
+    // that the next reserved area will be aligned to the value.
     MemMap map = MemMap::MapAnonymous(image_location,
-                                      image_header.GetImageSize(),
+                                      CondRoundUp<kPageSizeAgnostic>(image_header.GetImageSize(),
+                                                                     kElfSegmentAlignment),
                                       PROT_READ | PROT_WRITE,
                                       /*low_4gb=*/ true,
                                       image_reservation,
@@ -1187,15 +1196,14 @@
 
     // Fix up separately since we also need to fix up method entrypoints.
     ALWAYS_INLINE void VisitRootIfNonNull(
-        mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED) const {}
+        [[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {}
 
-    ALWAYS_INLINE void VisitRoot(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED)
-        const {}
+    ALWAYS_INLINE void VisitRoot(
+        [[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {}
 
     ALWAYS_INLINE void operator()(ObjPtr<mirror::Object> obj,
                                   MemberOffset offset,
-                                  bool is_static ATTRIBUTE_UNUSED) const
-        NO_THREAD_SAFETY_ANALYSIS {
+                                  [[maybe_unused]] bool is_static) const NO_THREAD_SAFETY_ANALYSIS {
       // Space is not yet added to the heap, don't do a read barrier.
       mirror::Object* ref = obj->GetFieldObject<mirror::Object, kVerifyNone, kWithoutReadBarrier>(
           offset);
@@ -1746,16 +1754,18 @@
   std::string art_location = ExpandLocation(base_location, bcp_index);
   std::string oat_filename = ImageHeader::GetOatLocationFromImageLocation(art_filename);
   std::string oat_location = ImageHeader::GetOatLocationFromImageLocation(art_location);
-  int oat_fd =
-      bcp_index < boot_class_path_oat_fds_.size() ? boot_class_path_oat_fds_[bcp_index] : -1;
-  int vdex_fd =
-      bcp_index < boot_class_path_vdex_fds_.size() ? boot_class_path_vdex_fds_[bcp_index] : -1;
+  int oat_fd = bcp_index < boot_class_path_oat_files_.size()
+      ? boot_class_path_oat_files_[bcp_index].Fd()
+      : -1;
+  int vdex_fd = bcp_index < boot_class_path_vdex_files_.size()
+      ? boot_class_path_vdex_files_[bcp_index].Fd()
+      : -1;
   auto dex_filenames =
       ArrayRef<const std::string>(boot_class_path_).SubArray(bcp_index, component_count);
-  auto dex_fds =
-      bcp_index + component_count < boot_class_path_fds_.size() ?
-          ArrayRef<const int>(boot_class_path_fds_).SubArray(bcp_index, component_count) :
-          ArrayRef<const int>();
+  ArrayRef<File> dex_files =
+      bcp_index + component_count < boot_class_path_files_.size() ?
+          ArrayRef<File>(boot_class_path_files_).SubArray(bcp_index, component_count) :
+          ArrayRef<File>();
   // We open the oat file here only for validating that it's up-to-date. We don't open it as
   // executable or mmap it to a reserved space. This `OatFile` object will be dropped after
   // validation, and will not go into the `ImageSpace`.
@@ -1770,7 +1780,7 @@
         /*executable=*/ false,
         /*low_4gb=*/ false,
         dex_filenames,
-        dex_fds,
+        dex_files,
         /*reservation=*/ nullptr,
         error_msg));
   } else {
@@ -1781,7 +1791,7 @@
         /*executable=*/ false,
         /*low_4gb=*/ false,
         dex_filenames,
-        dex_fds,
+        dex_files,
         /*reservation=*/ nullptr,
         error_msg));
   }
@@ -1792,7 +1802,8 @@
                               error_msg->c_str());
     return false;
   }
-  if (!ImageSpace::ValidateOatFile(*oat_file, error_msg, dex_filenames, dex_fds, apex_versions_)) {
+  if (!ImageSpace::ValidateOatFile(
+          *oat_file, error_msg, dex_filenames, dex_files, apex_versions_)) {
     return false;
   }
   return true;
@@ -1806,9 +1817,9 @@
   DCHECK_LT(bcp_index, boot_class_path_.size());
 
   std::string actual_filename = ExpandLocation(base_filename, bcp_index);
-  int bcp_image_fd = bcp_index < boot_class_path_image_fds_.size()
-      ? boot_class_path_image_fds_[bcp_index]
-      : -1;
+  int bcp_image_fd = bcp_index < boot_class_path_image_files_.size() ?
+                         boot_class_path_image_files_[bcp_index].Fd() :
+                         -1;
   ImageHeader header;
   // When BCP image is provided as FD, it needs to be dup'ed (since it's stored in unique_fd) so
   // that it can later be used in LoadComponents.
@@ -1906,7 +1917,7 @@
     // TODO: Rewrite ProfileCompilationInfo to provide a better interface and
     // to store the dex locations in uncompressed section of the file.
     auto collect_fn = [&dex_locations](const std::string& dex_location,
-                                       uint32_t checksum ATTRIBUTE_UNUSED) {
+                                       [[maybe_unused]] uint32_t checksum) {
       dex_locations.insert(dex_location);  // Just collect locations.
       return false;                        // Do not read the profile data.
     };
@@ -2196,8 +2207,8 @@
                                                  bool allow_in_memory_compilation,
                                                  /*out*/ std::string* error_msg) {
   auto filename_fn = [image_isa](const std::string& location,
-                                 /*out*/std::string* filename,
-                                 /*out*/std::string* err_msg ATTRIBUTE_UNUSED) {
+                                 /*out*/ std::string* filename,
+                                 [[maybe_unused]] /*out*/ std::string* err_msg) {
     *filename = GetSystemImageFilename(location.c_str(), image_isa);
     return true;
   };
@@ -2206,37 +2217,41 @@
 
 class ImageSpace::BootImageLoader {
  public:
+  // Creates an instance.
+  // `apex_versions` is created from `Runtime::GetApexVersions` and must outlive this instance.
   BootImageLoader(const std::vector<std::string>& boot_class_path,
                   const std::vector<std::string>& boot_class_path_locations,
-                  const std::vector<int>& boot_class_path_fds,
-                  const std::vector<int>& boot_class_path_image_fds,
-                  const std::vector<int>& boot_class_path_vdex_fds,
-                  const std::vector<int>& boot_class_path_oat_fds,
+                  ArrayRef<File> boot_class_path_files,
+                  ArrayRef<File> boot_class_path_image_files,
+                  ArrayRef<File> boot_class_path_vdex_files,
+                  ArrayRef<File> boot_class_path_oat_files,
                   const std::vector<std::string>& image_locations,
                   InstructionSet image_isa,
                   bool relocate,
-                  bool executable)
+                  bool executable,
+                  const std::string* apex_versions)
       : boot_class_path_(boot_class_path),
         boot_class_path_locations_(boot_class_path_locations),
-        boot_class_path_fds_(boot_class_path_fds),
-        boot_class_path_image_fds_(boot_class_path_image_fds),
-        boot_class_path_vdex_fds_(boot_class_path_vdex_fds),
-        boot_class_path_oat_fds_(boot_class_path_oat_fds),
+        boot_class_path_files_(boot_class_path_files),
+        boot_class_path_image_files_(boot_class_path_image_files),
+        boot_class_path_vdex_files_(boot_class_path_vdex_files),
+        boot_class_path_oat_files_(boot_class_path_oat_files),
         image_locations_(image_locations),
         image_isa_(image_isa),
         relocate_(relocate),
         executable_(executable),
-        has_system_(false) {
-  }
+        has_system_(false),
+        apex_versions_(apex_versions) {}
 
   void FindImageFiles() {
     BootImageLayout layout(image_locations_,
                            boot_class_path_,
                            boot_class_path_locations_,
-                           boot_class_path_fds_,
-                           boot_class_path_image_fds_,
-                           boot_class_path_vdex_fds_,
-                           boot_class_path_oat_fds_);
+                           boot_class_path_files_,
+                           boot_class_path_image_files_,
+                           boot_class_path_vdex_files_,
+                           boot_class_path_oat_files_,
+                           apex_versions_);
     std::string image_location = layout.GetPrimaryImageLocation();
     std::string system_filename;
     bool found_image = FindImageFilenameImpl(image_location.c_str(),
@@ -2838,12 +2853,12 @@
                    android::base::unique_fd vdex_fd,
                    android::base::unique_fd oat_fd,
                    ArrayRef<const std::string> dex_filenames,
-                   ArrayRef<const int> dex_fds,
+                   ArrayRef<File> dex_files,
                    bool validate_oat_file,
                    ArrayRef<const std::unique_ptr<ImageSpace>> dependencies,
                    TimingLogger* logger,
-                   /*inout*/MemMap* image_reservation,
-                   /*out*/std::string* error_msg) {
+                   /*inout*/ MemMap* image_reservation,
+                   /*out*/ std::string* error_msg) {
     // VerifyImageAllocations() will be called later in Runtime::Init()
     // as some class roots like ArtMethod::java_lang_reflect_ArtMethod_
     // and ArtField::java_lang_reflect_ArtField_, which are used from
@@ -2860,24 +2875,24 @@
 
       DCHECK_EQ(vdex_fd.get() != -1, oat_fd.get() != -1);
       if (vdex_fd.get() == -1) {
-        oat_file.reset(OatFile::Open(/*zip_fd=*/ -1,
+        oat_file.reset(OatFile::Open(/*zip_fd=*/-1,
                                      oat_filename,
                                      oat_location,
                                      executable_,
-                                     /*low_4gb=*/ false,
+                                     /*low_4gb=*/false,
                                      dex_filenames,
-                                     dex_fds,
+                                     dex_files,
                                      image_reservation,
                                      error_msg));
       } else {
-        oat_file.reset(OatFile::Open(/*zip_fd=*/ -1,
+        oat_file.reset(OatFile::Open(/*zip_fd=*/-1,
                                      vdex_fd.get(),
                                      oat_fd.get(),
                                      oat_location,
                                      executable_,
-                                     /*low_4gb=*/ false,
+                                     /*low_4gb=*/false,
                                      dex_filenames,
-                                     dex_fds,
+                                     dex_files,
                                      image_reservation,
                                      error_msg));
         // We no longer need the file descriptors and they will be closed by
@@ -3042,8 +3057,8 @@
         image_fd = std::move(chunk.art_fd);
       } else {
         size_t pos = chunk.start_index + i;
-        int arg_image_fd = pos < boot_class_path_image_fds_.size() ? boot_class_path_image_fds_[pos]
-            : -1;
+        int arg_image_fd =
+            pos < boot_class_path_image_files_.size() ? boot_class_path_image_files_[pos].Fd() : -1;
         if (arg_image_fd >= 0) {
           image_fd.reset(DupCloexec(arg_image_fd));
         }
@@ -3114,8 +3129,10 @@
       size_t bcp_chunk_size = (chunk.image_space_count == 1u) ? chunk.component_count : 1u;
 
       size_t pos = chunk.start_index + i;
-      auto boot_class_path_fds = boot_class_path_fds_.empty() ? ArrayRef<const int>()
-          : boot_class_path_fds_.SubArray(/*pos=*/ pos, bcp_chunk_size);
+      ArrayRef<File> boot_class_path_files =
+          boot_class_path_files_.empty() ?
+              ArrayRef<File>() :
+              boot_class_path_files_.SubArray(/*pos=*/pos, bcp_chunk_size);
 
       // Select vdex and oat FD if any exists.
       android::base::unique_fd vdex_fd;
@@ -3124,8 +3141,8 @@
         DCHECK_EQ(locations.size(), 1u);
         vdex_fd = std::move(chunk.vdex_fd);
       } else {
-        int arg_vdex_fd = pos < boot_class_path_vdex_fds_.size() ? boot_class_path_vdex_fds_[pos]
-            : -1;
+        int arg_vdex_fd =
+            pos < boot_class_path_vdex_files_.size() ? boot_class_path_vdex_files_[pos].Fd() : -1;
         if (arg_vdex_fd >= 0) {
           vdex_fd.reset(DupCloexec(arg_vdex_fd));
         }
@@ -3134,8 +3151,8 @@
         DCHECK_EQ(locations.size(), 1u);
         oat_fd = std::move(chunk.oat_fd);
       } else {
-        int arg_oat_fd = pos < boot_class_path_oat_fds_.size() ? boot_class_path_oat_fds_[pos]
-            : -1;
+        int arg_oat_fd =
+            pos < boot_class_path_oat_files_.size() ? boot_class_path_oat_files_[pos].Fd() : -1;
         if (arg_oat_fd >= 0) {
           oat_fd.reset(DupCloexec(arg_oat_fd));
         }
@@ -3144,8 +3161,8 @@
       if (!OpenOatFile(space,
                        std::move(vdex_fd),
                        std::move(oat_fd),
-                       boot_class_path_.SubArray(/*pos=*/ pos, bcp_chunk_size),
-                       boot_class_path_fds,
+                       boot_class_path_.SubArray(/*pos=*/pos, bcp_chunk_size),
+                       boot_class_path_files,
                        validate_oat_file,
                        dependencies,
                        logger,
@@ -3162,8 +3179,8 @@
   MemMap ReserveBootImageMemory(uint8_t* addr,
                                 uint32_t reservation_size,
                                 /*out*/std::string* error_msg) {
-    DCHECK_ALIGNED(reservation_size, kPageSize);
-    DCHECK_ALIGNED(addr, kPageSize);
+    DCHECK_ALIGNED(reservation_size, kElfSegmentAlignment);
+    DCHECK_ALIGNED(addr, kElfSegmentAlignment);
     return MemMap::MapAnonymous("Boot image reservation",
                                 addr,
                                 reservation_size,
@@ -3178,7 +3195,7 @@
                              /*inout*/MemMap* image_reservation,
                              /*out*/MemMap* extra_reservation,
                              /*out*/std::string* error_msg) {
-    DCHECK_ALIGNED(extra_reservation_size, kPageSize);
+    DCHECK_ALIGNED(extra_reservation_size, kElfSegmentAlignment);
     DCHECK(!extra_reservation->IsValid());
     size_t expected_size = image_reservation->IsValid() ? image_reservation->Size() : 0u;
     if (extra_reservation_size != expected_size) {
@@ -3204,15 +3221,16 @@
 
   const ArrayRef<const std::string> boot_class_path_;
   const ArrayRef<const std::string> boot_class_path_locations_;
-  const ArrayRef<const int> boot_class_path_fds_;
-  const ArrayRef<const int> boot_class_path_image_fds_;
-  const ArrayRef<const int> boot_class_path_vdex_fds_;
-  const ArrayRef<const int> boot_class_path_oat_fds_;
+  ArrayRef<File> boot_class_path_files_;
+  ArrayRef<File> boot_class_path_image_files_;
+  ArrayRef<File> boot_class_path_vdex_files_;
+  ArrayRef<File> boot_class_path_oat_files_;
   const ArrayRef<const std::string> image_locations_;
   const InstructionSet image_isa_;
   const bool relocate_;
   const bool executable_;
   bool has_system_;
+  const std::string* apex_versions_;
 };
 
 bool ImageSpace::BootImageLoader::LoadFromSystem(
@@ -3226,10 +3244,11 @@
   BootImageLayout layout(image_locations_,
                          boot_class_path_,
                          boot_class_path_locations_,
-                         boot_class_path_fds_,
-                         boot_class_path_image_fds_,
-                         boot_class_path_vdex_fds_,
-                         boot_class_path_oat_fds_);
+                         boot_class_path_files_,
+                         boot_class_path_image_files_,
+                         boot_class_path_vdex_files_,
+                         boot_class_path_oat_files_,
+                         apex_versions_);
   if (!layout.LoadFromSystem(image_isa_, allow_in_memory_compilation, error_msg)) {
     return false;
   }
@@ -3259,10 +3278,11 @@
   BootImageLayout layout(ArrayRef<const std::string>(runtime->GetImageLocations()),
                          ArrayRef<const std::string>(runtime->GetBootClassPath()),
                          ArrayRef<const std::string>(runtime->GetBootClassPathLocations()),
-                         ArrayRef<const int>(runtime->GetBootClassPathFds()),
-                         ArrayRef<const int>(runtime->GetBootClassPathImageFds()),
-                         ArrayRef<const int>(runtime->GetBootClassPathVdexFds()),
-                         ArrayRef<const int>(runtime->GetBootClassPathOatFds()));
+                         runtime->GetBootClassPathFiles(),
+                         runtime->GetBootClassPathImageFiles(),
+                         runtime->GetBootClassPathVdexFiles(),
+                         runtime->GetBootClassPathOatFiles(),
+                         &runtime->GetApexVersions());
   const std::string image_location = layout.GetPrimaryImageLocation();
   std::unique_ptr<ImageHeader> image_header;
   std::string error_msg;
@@ -3281,26 +3301,26 @@
   return image_header != nullptr;
 }
 
-bool ImageSpace::LoadBootImage(
-    const std::vector<std::string>& boot_class_path,
-    const std::vector<std::string>& boot_class_path_locations,
-    const std::vector<int>& boot_class_path_fds,
-    const std::vector<int>& boot_class_path_image_fds,
-    const std::vector<int>& boot_class_path_vdex_fds,
-    const std::vector<int>& boot_class_path_odex_fds,
-    const std::vector<std::string>& image_locations,
-    const InstructionSet image_isa,
-    bool relocate,
-    bool executable,
-    size_t extra_reservation_size,
-    bool allow_in_memory_compilation,
-    /*out*/std::vector<std::unique_ptr<ImageSpace>>* boot_image_spaces,
-    /*out*/MemMap* extra_reservation) {
+bool ImageSpace::LoadBootImage(const std::vector<std::string>& boot_class_path,
+                               const std::vector<std::string>& boot_class_path_locations,
+                               ArrayRef<File> boot_class_path_files,
+                               ArrayRef<File> boot_class_path_image_files,
+                               ArrayRef<File> boot_class_path_vdex_files,
+                               ArrayRef<File> boot_class_path_odex_files,
+                               const std::vector<std::string>& image_locations,
+                               const InstructionSet image_isa,
+                               bool relocate,
+                               bool executable,
+                               size_t extra_reservation_size,
+                               bool allow_in_memory_compilation,
+                               const std::string& apex_versions,
+                               /*out*/ std::vector<std::unique_ptr<ImageSpace>>* boot_image_spaces,
+                               /*out*/ MemMap* extra_reservation) {
   ScopedTrace trace(__FUNCTION__);
 
   DCHECK(boot_image_spaces != nullptr);
   DCHECK(boot_image_spaces->empty());
-  DCHECK_ALIGNED(extra_reservation_size, kPageSize);
+  DCHECK_ALIGNED(extra_reservation_size, kElfSegmentAlignment);
   DCHECK(extra_reservation != nullptr);
   DCHECK_NE(image_isa, InstructionSet::kNone);
 
@@ -3310,14 +3330,15 @@
 
   BootImageLoader loader(boot_class_path,
                          boot_class_path_locations,
-                         boot_class_path_fds,
-                         boot_class_path_image_fds,
-                         boot_class_path_vdex_fds,
-                         boot_class_path_odex_fds,
+                         boot_class_path_files,
+                         boot_class_path_image_files,
+                         boot_class_path_vdex_files,
+                         boot_class_path_odex_files,
                          image_locations,
                          image_isa,
                          relocate,
-                         executable);
+                         executable,
+                         &apex_versions);
   loader.FindImageFiles();
 
   // Collect all the errors.
@@ -3428,17 +3449,13 @@
 
 bool ImageSpace::ValidateOatFile(const OatFile& oat_file, std::string* error_msg) {
   DCHECK(Runtime::Current() != nullptr);
-  return ValidateOatFile(oat_file,
-                         error_msg,
-                         ArrayRef<const std::string>(),
-                         ArrayRef<const int>(),
-                         Runtime::Current()->GetApexVersions());
+  return ValidateOatFile(oat_file, error_msg, {}, {}, Runtime::Current()->GetApexVersions());
 }
 
 bool ImageSpace::ValidateOatFile(const OatFile& oat_file,
                                  std::string* error_msg,
                                  ArrayRef<const std::string> dex_filenames,
-                                 ArrayRef<const int> dex_fds,
+                                 ArrayRef<File> dex_files,
                                  const std::string& apex_versions) {
   if (!ValidateApexVersions(oat_file.GetOatHeader(),
                             apex_versions,
@@ -3457,67 +3474,47 @@
     return false;
   }
 
-  size_t dex_file_index = 0;
-  for (const OatDexFile* oat_dex_file : oat_file.GetOatDexFiles()) {
-    // Skip multidex locations - These will be checked when we visit their
-    // corresponding primary non-multidex location.
-    if (DexFileLoader::IsMultiDexLocation(oat_dex_file->GetDexFileLocation().c_str())) {
-      continue;
-    }
-
+  size_t dex_file_index = 0;  // Counts only primary dex files.
+  const std::vector<const OatDexFile*>& oat_dex_files = oat_file.GetOatDexFiles();
+  for (size_t i = 0; i < oat_dex_files.size();) {
     DCHECK(dex_filenames.empty() || dex_file_index < dex_filenames.size());
-    const std::string& dex_file_location =
-        dex_filenames.empty() ? oat_dex_file->GetDexFileLocation() : dex_filenames[dex_file_index];
-    int dex_fd = dex_file_index < dex_fds.size() ? dex_fds[dex_file_index] : -1;
+    const std::string& dex_file_location = dex_filenames.empty() ?
+                                               oat_dex_files[i]->GetDexFileLocation() :
+                                               dex_filenames[dex_file_index];
+    File no_file;  // Invalid object.
+    File& dex_file = dex_file_index < dex_files.size() ? dex_files[dex_file_index] : no_file;
     dex_file_index++;
 
-    std::vector<uint32_t> checksums;
-    std::vector<std::string> dex_locations_ignored;
-    if (!ArtDexFileLoader::GetMultiDexChecksums(
-            dex_file_location.c_str(), &checksums, &dex_locations_ignored, error_msg, dex_fd)) {
-      *error_msg = StringPrintf("ValidateOatFile failed to get checksums of dex file '%s' "
-                                "referenced by oat file %s: %s",
-                                dex_file_location.c_str(),
-                                oat_file.GetLocation().c_str(),
-                                error_msg->c_str());
+    if (DexFileLoader::IsMultiDexLocation(oat_dex_files[i]->GetDexFileLocation())) {
+      return false;  // Expected primary dex file.
+    }
+    uint32_t oat_checksum = DexFileLoader::GetMultiDexChecksum(oat_dex_files, &i);
+
+    // Original checksum.
+    std::optional<uint32_t> dex_checksum;
+    ArtDexFileLoader dex_loader(&dex_file, dex_file_location);
+    bool ok = dex_loader.GetMultiDexChecksum(&dex_checksum, error_msg);
+    if (!ok) {
+      *error_msg = StringPrintf(
+          "ValidateOatFile failed to get checksum of dex file '%s' "
+          "referenced by oat file %s: %s",
+          dex_file_location.c_str(),
+          oat_file.GetLocation().c_str(),
+          error_msg->c_str());
       return false;
     }
-    CHECK(!checksums.empty());
-    if (checksums[0] != oat_dex_file->GetDexFileLocationChecksum()) {
-      *error_msg = StringPrintf("ValidateOatFile found checksum mismatch between oat file "
-                                "'%s' and dex file '%s' (0x%x != 0x%x)",
-                                oat_file.GetLocation().c_str(),
-                                dex_file_location.c_str(),
-                                oat_dex_file->GetDexFileLocationChecksum(),
-                                checksums[0]);
+    CHECK(dex_checksum.has_value());
+
+    if (oat_checksum != dex_checksum) {
+      *error_msg = StringPrintf(
+          "ValidateOatFile found checksum mismatch between oat file "
+          "'%s' and dex file '%s' (0x%x != 0x%x)",
+          oat_file.GetLocation().c_str(),
+          dex_file_location.c_str(),
+          oat_checksum,
+          dex_checksum.value());
       return false;
     }
-
-    // Verify checksums for any related multidex entries.
-    for (size_t i = 1; i < checksums.size(); i++) {
-      std::string multi_dex_location = DexFileLoader::GetMultiDexLocation(
-          i,
-          dex_file_location.c_str());
-      const OatDexFile* multi_dex = oat_file.GetOatDexFile(multi_dex_location.c_str(),
-                                                           nullptr,
-                                                           error_msg);
-      if (multi_dex == nullptr) {
-        *error_msg = StringPrintf("ValidateOatFile oat file '%s' is missing entry '%s'",
-                                  oat_file.GetLocation().c_str(),
-                                  multi_dex_location.c_str());
-        return false;
-      }
-
-      if (checksums[i] != multi_dex->GetDexFileLocationChecksum()) {
-        *error_msg = StringPrintf("ValidateOatFile found checksum mismatch between oat file "
-                                  "'%s' and dex file '%s' (0x%x != 0x%x)",
-                                  oat_file.GetLocation().c_str(),
-                                  multi_dex_location.c_str(),
-                                  multi_dex->GetDexFileLocationChecksum(),
-                                  checksums[i]);
-        return false;
-      }
-    }
   }
   return true;
 }
@@ -3564,15 +3561,14 @@
   ArrayRef<const DexFile* const> boot_class_path_tail =
       ArrayRef<const DexFile* const>(boot_class_path).SubArray(bcp_pos);
   DCHECK(boot_class_path_tail.empty() ||
-         !DexFileLoader::IsMultiDexLocation(boot_class_path_tail.front()->GetLocation().c_str()));
-  for (const DexFile* dex_file : boot_class_path_tail) {
-    if (!DexFileLoader::IsMultiDexLocation(dex_file->GetLocation().c_str())) {
-      if (!boot_image_checksum.empty()) {
-        boot_image_checksum += ':';
-      }
-      boot_image_checksum += kDexFileChecksumPrefix;
+         !DexFileLoader::IsMultiDexLocation(boot_class_path_tail.front()->GetLocation()));
+  for (size_t i = 0; i < boot_class_path_tail.size();) {
+    uint32_t checksum = DexFileLoader::GetMultiDexChecksum(boot_class_path_tail, &i);
+    if (!boot_image_checksum.empty()) {
+      boot_image_checksum += ':';
     }
-    StringAppendF(&boot_image_checksum, "/%08x", dex_file->GetLocationChecksum());
+    boot_image_checksum += kDexFileChecksumPrefix;
+    StringAppendF(&boot_image_checksum, "/%08x", checksum);
   }
   return boot_image_checksum;
 }
@@ -3673,11 +3669,11 @@
         CHECK_NE(num_dex_files, 0u);
         const std::string main_location = oat_file->GetOatDexFiles()[0]->GetDexFileLocation();
         CHECK_EQ(main_location, boot_class_path_locations[bcp_pos + space_index]);
-        CHECK(!DexFileLoader::IsMultiDexLocation(main_location.c_str()));
+        CHECK(!DexFileLoader::IsMultiDexLocation(main_location));
         size_t num_base_locations = 1u;
         for (size_t i = 1u; i != num_dex_files; ++i) {
           if (!DexFileLoader::IsMultiDexLocation(
-                  oat_file->GetOatDexFiles()[i]->GetDexFileLocation().c_str())) {
+                  oat_file->GetOatDexFiles()[i]->GetDexFileLocation())) {
             CHECK_EQ(image_space_count, 1u);  // We can find base locations only for --single-image.
             ++num_base_locations;
           }
@@ -3765,7 +3761,7 @@
     if (last_dex_dot != std::string::npos) {
       name.resize(last_dex_dot);
     }
-    locations.push_back(base + name + extension);
+    locations.push_back(ART_FORMAT("{}{}{}", base, name, extension));
   }
   return locations;
 }
@@ -3785,8 +3781,8 @@
   const ImageSection& metadata = GetImageHeader().GetMetadataSection();
   VLOG(image) << "Releasing " << metadata.Size() << " image metadata bytes";
   // Avoid using ZeroAndReleasePages since the zero fill might not be word atomic.
-  uint8_t* const page_begin = AlignUp(Begin() + metadata.Offset(), kPageSize);
-  uint8_t* const page_end = AlignDown(Begin() + metadata.End(), kPageSize);
+  uint8_t* const page_begin = AlignUp(Begin() + metadata.Offset(), gPageSize);
+  uint8_t* const page_end = AlignDown(Begin() + metadata.End(), gPageSize);
   if (page_begin < page_end) {
     CHECK_NE(madvise(page_begin, page_end - page_begin, MADV_DONTNEED), -1) << "madvise failed";
   }
diff --git a/runtime/gc/space/image_space.h b/runtime/gc/space/image_space.h
index 1a85456..3b59ffd 100644
--- a/runtime/gc/space/image_space.h
+++ b/runtime/gc/space/image_space.h
@@ -20,11 +20,11 @@
 #include "android-base/unique_fd.h"
 #include "base/array_ref.h"
 #include "gc/accounting/space_bitmap.h"
-#include "image.h"
+#include "oat/image.h"
 #include "runtime.h"
 #include "space.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class DexFile;
 enum class InstructionSet;
@@ -133,27 +133,28 @@
   //           extension is not found or broken compile it in memory using
   //           the specified profile file in the BCP component path, each
   //           extension is compiled only against the primary boot image.
-  static bool LoadBootImage(
-      const std::vector<std::string>& boot_class_path,
-      const std::vector<std::string>& boot_class_path_locations,
-      const std::vector<int>& boot_class_path_fds,
-      const std::vector<int>& boot_class_path_image_fds,
-      const std::vector<int>& boot_class_path_vdex_fds,
-      const std::vector<int>& boot_class_path_oat_fds,
-      const std::vector<std::string>& image_locations,
-      const InstructionSet image_isa,
-      bool relocate,
-      bool executable,
-      size_t extra_reservation_size,
-      bool allow_in_memory_compilation,
-      /*out*/std::vector<std::unique_ptr<ImageSpace>>* boot_image_spaces,
-      /*out*/MemMap* extra_reservation) REQUIRES_SHARED(Locks::mutator_lock_);
+  static bool LoadBootImage(const std::vector<std::string>& boot_class_path,
+                            const std::vector<std::string>& boot_class_path_locations,
+                            ArrayRef<File> boot_class_path_files,
+                            ArrayRef<File> boot_class_path_image_files,
+                            ArrayRef<File> boot_class_path_vdex_files,
+                            ArrayRef<File> boot_class_path_oat_files,
+                            const std::vector<std::string>& image_locations,
+                            const InstructionSet image_isa,
+                            bool relocate,
+                            bool executable,
+                            size_t extra_reservation_size,
+                            bool allow_in_memory_compilation,
+                            const std::string& apex_versions,
+                            /*out*/ std::vector<std::unique_ptr<ImageSpace>>* boot_image_spaces,
+                            /*out*/ MemMap* extra_reservation)
+      REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Try to open an existing app image space for an oat file,
   // using the boot image spaces from the current Runtime.
-  static std::unique_ptr<ImageSpace> CreateFromAppImage(const char* image,
-                                                        const OatFile* oat_file,
-                                                        std::string* error_msg)
+  EXPORT static std::unique_ptr<ImageSpace> CreateFromAppImage(const char* image,
+                                                               const OatFile* oat_file,
+                                                               std::string* error_msg)
       REQUIRES_SHARED(Locks::mutator_lock_);
   // Try to open an existing app image space for an the oat file and given boot image spaces.
   static std::unique_ptr<ImageSpace> CreateFromAppImage(
@@ -166,7 +167,7 @@
   static bool IsBootClassPathOnDisk(InstructionSet image_isa);
 
   // Give access to the OatFile.
-  const OatFile* GetOatFile() const;
+  EXPORT const OatFile* GetOatFile() const;
 
   // Releases the OatFile from the ImageSpace so it can be transfer to
   // the caller, presumably the OatFileManager.
@@ -237,8 +238,8 @@
   // Returns the checksums for the boot image, extensions and extra boot class path dex files,
   // based on the image spaces and boot class path dex files loaded in memory.
   // The `image_spaces` must correspond to the head of the `boot_class_path`.
-  static std::string GetBootClassPathChecksums(ArrayRef<ImageSpace* const> image_spaces,
-                                               ArrayRef<const DexFile* const> boot_class_path);
+  EXPORT static std::string GetBootClassPathChecksums(
+      ArrayRef<ImageSpace* const> image_spaces, ArrayRef<const DexFile* const> boot_class_path);
 
   // Returns the total number of components (jar files) associated with the image spaces.
   static size_t GetNumberOfComponents(ArrayRef<gc::space::ImageSpace* const> image_spaces);
@@ -254,7 +255,7 @@
       /*out*/std::string* error_msg);
 
   // Expand a single image location to multi-image locations based on the dex locations.
-  static std::vector<std::string> ExpandMultiImageLocations(
+  EXPORT static std::vector<std::string> ExpandMultiImageLocations(
       ArrayRef<const std::string> dex_locations,
       const std::string& image_location,
       bool boot_image_extension = false);
@@ -289,7 +290,7 @@
   static bool ValidateOatFile(const OatFile& oat_file,
                               std::string* error_msg,
                               ArrayRef<const std::string> dex_filenames,
-                              ArrayRef<const int> dex_fds,
+                              ArrayRef<File> dex_files,
                               const std::string& apex_versions);
 
   // Return the end of the image which includes non-heap objects such as ArtMethods and ArtFields.
@@ -341,22 +342,24 @@
       mutable android::base::unique_fd oat_fd;
     };
 
+    // Creates an instance.
+    // `apex_versions` is created from `Runtime::GetApexVersions` and must outlive this instance.
     BootImageLayout(ArrayRef<const std::string> image_locations,
                     ArrayRef<const std::string> boot_class_path,
                     ArrayRef<const std::string> boot_class_path_locations,
-                    ArrayRef<const int> boot_class_path_fds,
-                    ArrayRef<const int> boot_class_path_image_fds,
-                    ArrayRef<const int> boot_class_path_vdex_fds,
-                    ArrayRef<const int> boot_class_path_oat_fds,
-                    const std::string* apex_versions = nullptr)
+                    ArrayRef<File> boot_class_path_files,
+                    ArrayRef<File> boot_class_path_image_files,
+                    ArrayRef<File> boot_class_path_vdex_files,
+                    ArrayRef<File> boot_class_path_oat_files,
+                    const std::string* apex_versions)
         : image_locations_(image_locations),
           boot_class_path_(boot_class_path),
           boot_class_path_locations_(boot_class_path_locations),
-          boot_class_path_fds_(boot_class_path_fds),
-          boot_class_path_image_fds_(boot_class_path_image_fds),
-          boot_class_path_vdex_fds_(boot_class_path_vdex_fds),
-          boot_class_path_oat_fds_(boot_class_path_oat_fds),
-          apex_versions_(GetApexVersions(apex_versions)) {}
+          boot_class_path_files_(boot_class_path_files),
+          boot_class_path_image_files_(boot_class_path_image_files),
+          boot_class_path_vdex_files_(boot_class_path_vdex_files),
+          boot_class_path_oat_files_(boot_class_path_oat_files),
+          apex_versions_(*apex_versions) {}
 
     std::string GetPrimaryImageLocation();
 
@@ -453,24 +456,13 @@
               bool allow_in_memory_compilation,
               /*out*/ std::string* error_msg);
 
-    // This function prefers taking APEX versions from the input instead of from the runtime if
-    // possible. If the input is present, `ValidateFromSystem` can work without an active runtime.
-    static const std::string& GetApexVersions(const std::string* apex_versions) {
-      if (apex_versions == nullptr) {
-        DCHECK(Runtime::Current() != nullptr);
-        return Runtime::Current()->GetApexVersions();
-      } else {
-        return *apex_versions;
-      }
-    }
-
     ArrayRef<const std::string> image_locations_;
     ArrayRef<const std::string> boot_class_path_;
     ArrayRef<const std::string> boot_class_path_locations_;
-    ArrayRef<const int> boot_class_path_fds_;
-    ArrayRef<const int> boot_class_path_image_fds_;
-    ArrayRef<const int> boot_class_path_vdex_fds_;
-    ArrayRef<const int> boot_class_path_oat_fds_;
+    ArrayRef<File> boot_class_path_files_;
+    ArrayRef<File> boot_class_path_image_files_;
+    ArrayRef<File> boot_class_path_vdex_files_;
+    ArrayRef<File> boot_class_path_oat_files_;
 
     std::vector<ImageChunk> chunks_;
     uint32_t base_address_ = 0u;
diff --git a/runtime/gc/space/image_space_test.cc b/runtime/gc/space/image_space_test.cc
index d6bb86b..2979544 100644
--- a/runtime/gc/space/image_space_test.cc
+++ b/runtime/gc/space/image_space_test.cc
@@ -26,9 +26,9 @@
 #include "dexopt_test.h"
 #include "intern_table-inl.h"
 #include "noop_compiler_callbacks.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
@@ -58,17 +58,10 @@
   int mkdir_result = mkdir(image_dir.c_str(), 0700);
   ASSERT_EQ(0, mkdir_result);
 
-  // Prepare boot class path variables, exclude core-icu4j and conscrypt
-  // which are not in the primary boot image.
+  // Prepare boot class path variables.
   std::vector<std::string> bcp = GetLibCoreDexFileNames();
   std::vector<std::string> bcp_locations = GetLibCoreDexLocations();
   CHECK_EQ(bcp.size(), bcp_locations.size());
-  ASSERT_NE(std::string::npos, bcp.back().find("conscrypt"));
-  bcp.pop_back();
-  bcp_locations.pop_back();
-  ASSERT_NE(std::string::npos, bcp.back().find("core-icu4j"));
-  bcp.pop_back();
-  bcp_locations.pop_back();
   std::string base_bcp_string = android::base::Join(bcp, ':');
   std::string base_bcp_locations_string = android::base::Join(bcp_locations, ':');
   std::string base_image_location = GetImageLocation();
@@ -83,14 +76,15 @@
     std::vector<std::string> extra_args = {
         "--profile-file=" + profile_file.GetFilename(),
         "--runtime-arg",
-        "-Xbootclasspath:" + base_bcp_string + ':' + jar_name,
+        ART_FORMAT("-Xbootclasspath:{}:{}", base_bcp_string, jar_name),
         "--runtime-arg",
-        "-Xbootclasspath-locations:" + base_bcp_locations_string + ':' + jar_name,
+        ART_FORMAT("-Xbootclasspath-locations:{}:{}", base_bcp_locations_string, jar_name),
         "--boot-image=" + base_image_location,
     };
     std::string prefix = GetFilenameBase(base_image_location);
     std::string error_msg;
-    bool success = CompileBootImage(extra_args, image_dir + '/' + prefix, dex_files, &error_msg);
+    bool success =
+        CompileBootImage(extra_args, ART_FORMAT("{}/{}", image_dir, prefix), dex_files, &error_msg);
     ASSERT_TRUE(success) << error_msg;
     bcp.push_back(jar_name);
     bcp_locations.push_back(jar_name);
@@ -135,20 +129,22 @@
   auto load_boot_image = [&]() REQUIRES_SHARED(Locks::mutator_lock_) {
     boot_image_spaces.clear();
     extra_reservation = MemMap::Invalid();
-    return ImageSpace::LoadBootImage(bcp,
-                                     bcp_locations,
-                                     /*boot_class_path_fds=*/std::vector<int>(),
-                                     /*boot_class_path_image_fds=*/std::vector<int>(),
-                                     /*boot_class_path_vdex_fds=*/std::vector<int>(),
-                                     /*boot_class_path_oat_fds=*/std::vector<int>(),
-                                     full_image_locations,
-                                     kRuntimeISA,
-                                     /*relocate=*/false,
-                                     /*executable=*/true,
-                                     /*extra_reservation_size=*/0u,
-                                     /*allow_in_memory_compilation=*/false,
-                                     &boot_image_spaces,
-                                     &extra_reservation);
+    return ImageSpace::LoadBootImage(
+        bcp,
+        bcp_locations,
+        /*boot_class_path_files=*/{},
+        /*boot_class_path_image_files=*/{},
+        /*boot_class_path_vdex_files=*/{},
+        /*boot_class_path_oat_files=*/{},
+        full_image_locations,
+        kRuntimeISA,
+        /*relocate=*/false,
+        /*executable=*/true,
+        /*extra_reservation_size=*/0u,
+        /*allow_in_memory_compilation=*/false,
+        Runtime::GetApexVersions(ArrayRef<const std::string>(bcp_locations)),
+        &boot_image_spaces,
+        &extra_reservation);
   };
 
   const char test_string[] = "SharedBootImageExtensionTestString";
@@ -259,7 +255,7 @@
                                                 /*executable=*/false,
                                                 /*low_4gb=*/false,
                                                 ArrayRef<const std::string>(dex_filenames),
-                                                /*dex_fds=*/ArrayRef<const int>(),
+                                                /*dex_files=*/{},
                                                 /*reservation=*/nullptr,
                                                 &error_msg));
     ASSERT_TRUE(oat2 != nullptr) << error_msg;
diff --git a/runtime/gc/space/large_object_space.cc b/runtime/gc/space/large_object_space.cc
index b5f26cd..a4b9d24 100644
--- a/runtime/gc/space/large_object_space.cc
+++ b/runtime/gc/space/large_object_space.cc
@@ -30,13 +30,13 @@
 #include "gc/accounting/heap_bitmap-inl.h"
 #include "gc/accounting/space_bitmap-inl.h"
 #include "gc/heap.h"
-#include "image.h"
 #include "mirror/object-readbarrier-inl.h"
+#include "oat/image.h"
 #include "scoped_thread_state_change-inl.h"
 #include "space-inl.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
@@ -55,14 +55,14 @@
                         size_t* usable_size, size_t* bytes_tl_bulk_allocated)
       override {
     mirror::Object* obj =
-        LargeObjectMapSpace::Alloc(self, num_bytes + kMemoryToolRedZoneBytes * 2, bytes_allocated,
+        LargeObjectMapSpace::Alloc(self, num_bytes + MemoryToolRedZoneBytes() * 2, bytes_allocated,
                                    usable_size, bytes_tl_bulk_allocated);
     mirror::Object* object_without_rdz = reinterpret_cast<mirror::Object*>(
-        reinterpret_cast<uintptr_t>(obj) + kMemoryToolRedZoneBytes);
-    MEMORY_TOOL_MAKE_NOACCESS(reinterpret_cast<void*>(obj), kMemoryToolRedZoneBytes);
+        reinterpret_cast<uintptr_t>(obj) + MemoryToolRedZoneBytes());
+    MEMORY_TOOL_MAKE_NOACCESS(reinterpret_cast<void*>(obj), MemoryToolRedZoneBytes());
     MEMORY_TOOL_MAKE_NOACCESS(
         reinterpret_cast<uint8_t*>(object_without_rdz) + num_bytes,
-        kMemoryToolRedZoneBytes);
+        MemoryToolRedZoneBytes());
     if (usable_size != nullptr) {
       *usable_size = num_bytes;  // Since we have redzones, shrink the usable size.
     }
@@ -88,17 +88,19 @@
   }
 
  private:
+  static size_t MemoryToolRedZoneBytes() {
+    return gPageSize;
+  }
+
   static const mirror::Object* ObjectWithRedzone(const mirror::Object* obj) {
     return reinterpret_cast<const mirror::Object*>(
-        reinterpret_cast<uintptr_t>(obj) - kMemoryToolRedZoneBytes);
+        reinterpret_cast<uintptr_t>(obj) - MemoryToolRedZoneBytes());
   }
 
   static mirror::Object* ObjectWithRedzone(mirror::Object* obj) {
     return reinterpret_cast<mirror::Object*>(
-        reinterpret_cast<uintptr_t>(obj) - kMemoryToolRedZoneBytes);
+        reinterpret_cast<uintptr_t>(obj) - MemoryToolRedZoneBytes());
   }
-
-  static constexpr size_t kMemoryToolRedZoneBytes = kPageSize;
 };
 
 void LargeObjectSpace::SwapBitmaps() {
@@ -136,11 +138,14 @@
 mirror::Object* LargeObjectMapSpace::Alloc(Thread* self, size_t num_bytes,
                                            size_t* bytes_allocated, size_t* usable_size,
                                            size_t* bytes_tl_bulk_allocated) {
+  DCHECK_LE(gPageSize, ObjectAlignment())
+      << "MapAnonymousAligned() should be used if the large-object alignment is larger than the "
+         "runtime page size";
   std::string error_msg;
   MemMap mem_map = MemMap::MapAnonymous("large object space allocation",
                                         num_bytes,
                                         PROT_READ | PROT_WRITE,
-                                        /*low_4gb=*/ true,
+                                        /*low_4gb=*/true,
                                         &error_msg);
   if (UNLIKELY(!mem_map.IsValid())) {
     LOG(WARNING) << "Large object allocation failed: " << error_msg;
@@ -263,19 +268,20 @@
  public:
   AllocationInfo() : prev_free_(0), alloc_size_(0) {
   }
-  // Return the number of pages that the allocation info covers.
+  // Return the number of blocks, of the large-object alignment in size each, that the allocation
+  // info covers.
   size_t AlignSize() const {
     return alloc_size_ & kFlagsMask;
   }
   // Returns the allocation size in bytes.
   size_t ByteSize() const {
-    return AlignSize() * FreeListSpace::kAlignment;
+    return AlignSize() * LargeObjectSpace::ObjectAlignment();
   }
   // Updates the allocation size and whether or not it is free.
   void SetByteSize(size_t size, bool free) {
     DCHECK_EQ(size & ~kFlagsMask, 0u);
-    DCHECK_ALIGNED(size, FreeListSpace::kAlignment);
-    alloc_size_ = (size / FreeListSpace::kAlignment) | (free ? kFlagFree : 0u);
+    DCHECK_ALIGNED_PARAM(size, LargeObjectSpace::ObjectAlignment());
+    alloc_size_ = (size / LargeObjectSpace::ObjectAlignment()) | (free ? kFlagFree : 0u);
   }
   // Returns true if the block is free.
   bool IsFree() const {
@@ -308,29 +314,30 @@
   mirror::Object* GetObjectAddress() {
     return reinterpret_cast<mirror::Object*>(reinterpret_cast<uintptr_t>(this) + sizeof(*this));
   }
-  // Return how many kAlignment units there are before the free block.
+  // Return how many units, the large-object alignment value in size,
+  // there are before the free block.
   size_t GetPrevFree() const {
     return prev_free_;
   }
-  // Returns how many free bytes there is before the block.
+  // Returns how many free bytes there are before the block.
   size_t GetPrevFreeBytes() const {
-    return GetPrevFree() * FreeListSpace::kAlignment;
+    return GetPrevFree() * LargeObjectSpace::ObjectAlignment();
   }
   // Update the size of the free block prior to the allocation.
   void SetPrevFreeBytes(size_t bytes) {
-    DCHECK_ALIGNED(bytes, FreeListSpace::kAlignment);
-    prev_free_ = bytes / FreeListSpace::kAlignment;
+    DCHECK_ALIGNED_PARAM(bytes, LargeObjectSpace::ObjectAlignment());
+    prev_free_ = bytes / LargeObjectSpace::ObjectAlignment();
   }
 
  private:
   static constexpr uint32_t kFlagFree = 0x80000000;  // If block is free.
   static constexpr uint32_t kFlagZygote = 0x40000000;  // If the large object is a zygote object.
   static constexpr uint32_t kFlagsMask = ~(kFlagFree | kFlagZygote);  // Combined flags for masking.
-  // Contains the size of the previous free block with kAlignment as the unit. If 0 then the
-  // allocation before us is not free.
+  // Contains the size of the previous free block with the large-object alignment value as the
+  // unit. If 0 then the allocation before us is not free.
   // These variables are undefined in the middle of allocations / free blocks.
   uint32_t prev_free_;
-  // Allocation size of this object in kAlignment as the unit.
+  // Allocation size of this object in the large-object alignment value as the unit.
   uint32_t alloc_size_;
 };
 
@@ -358,12 +365,15 @@
 }
 
 FreeListSpace* FreeListSpace::Create(const std::string& name, size_t size) {
-  CHECK_EQ(size % kAlignment, 0U);
+  CHECK_ALIGNED_PARAM(size, ObjectAlignment());
+  DCHECK_LE(gPageSize, ObjectAlignment())
+      << "MapAnonymousAligned() should be used if the large-object alignment is larger than the "
+         "runtime page size";
   std::string error_msg;
   MemMap mem_map = MemMap::MapAnonymous(name.c_str(),
                                         size,
                                         PROT_READ | PROT_WRITE,
-                                        /*low_4gb=*/ true,
+                                        /*low_4gb=*/true,
                                         &error_msg);
   CHECK(mem_map.IsValid()) << "Failed to allocate large object space mem map: " << error_msg;
   return new FreeListSpace(name, std::move(mem_map), mem_map.Begin(), mem_map.End());
@@ -377,8 +387,8 @@
       mem_map_(std::move(mem_map)) {
   const size_t space_capacity = end - begin;
   free_end_ = space_capacity;
-  CHECK_ALIGNED(space_capacity, kAlignment);
-  const size_t alloc_info_size = sizeof(AllocationInfo) * (space_capacity / kAlignment);
+  CHECK_ALIGNED_PARAM(space_capacity, ObjectAlignment());
+  const size_t alloc_info_size = sizeof(AllocationInfo) * (space_capacity / ObjectAlignment());
   std::string error_msg;
   allocation_info_map_ =
       MemMap::MapAnonymous("large object free list space allocation info map",
@@ -392,7 +402,7 @@
 
 void FreeListSpace::ClampGrowthLimit(size_t new_capacity) {
   MutexLock mu(Thread::Current(), lock_);
-  new_capacity = RoundUp(new_capacity, kAlignment);
+  new_capacity = RoundUp(new_capacity, ObjectAlignment());
   CHECK_LE(new_capacity, Size());
   size_t diff = Size() - new_capacity;
   // If we don't have enough free-bytes at the end to clamp, then do the best
@@ -402,7 +412,7 @@
     diff = free_end_;
   }
 
-  size_t alloc_info_size = sizeof(AllocationInfo) * (new_capacity / kAlignment);
+  size_t alloc_info_size = sizeof(AllocationInfo) * (new_capacity / ObjectAlignment());
   allocation_info_map_.SetSize(alloc_info_size);
   mem_map_.SetSize(new_capacity);
   // We don't need to change anything in 'free_blocks_' as the free block at
@@ -448,12 +458,12 @@
 size_t FreeListSpace::Free(Thread* self, mirror::Object* obj) {
   DCHECK(Contains(obj)) << reinterpret_cast<void*>(Begin()) << " " << obj << " "
                         << reinterpret_cast<void*>(End());
-  DCHECK_ALIGNED(obj, kAlignment);
+  DCHECK_ALIGNED_PARAM(obj, ObjectAlignment());
   AllocationInfo* info = GetAllocationInfoForAddress(reinterpret_cast<uintptr_t>(obj));
   DCHECK(!info->IsFree());
   const size_t allocation_size = info->ByteSize();
   DCHECK_GT(allocation_size, 0U);
-  DCHECK_ALIGNED(allocation_size, kAlignment);
+  DCHECK_ALIGNED_PARAM(allocation_size, ObjectAlignment());
 
   // madvise the pages without lock
   madvise(obj, allocation_size, MADV_DONTNEED);
@@ -493,7 +503,7 @@
       AllocationInfo* next_next_info = next_info->GetNextInfo();
       // Next next info can't be free since we always coalesce.
       DCHECK(!next_next_info->IsFree());
-      DCHECK_ALIGNED(next_next_info->ByteSize(), kAlignment);
+      DCHECK_ALIGNED_PARAM(next_next_info->ByteSize(), ObjectAlignment());
       new_free_info = next_next_info;
       new_free_size += next_next_info->GetPrevFreeBytes();
       RemoveFreePrev(next_next_info);
@@ -525,7 +535,7 @@
 mirror::Object* FreeListSpace::Alloc(Thread* self, size_t num_bytes, size_t* bytes_allocated,
                                      size_t* usable_size, size_t* bytes_tl_bulk_allocated) {
   MutexLock mu(self, lock_);
-  const size_t allocation_size = RoundUp(num_bytes, kAlignment);
+  const size_t allocation_size = RoundUp(num_bytes, ObjectAlignment());
   AllocationInfo temp_info;
   temp_info.SetPrevFreeBytes(allocation_size);
   temp_info.SetByteSize(0, false);
@@ -606,7 +616,7 @@
   }
 }
 
-bool FreeListSpace::IsZygoteLargeObject(Thread* self ATTRIBUTE_UNUSED, mirror::Object* obj) const {
+bool FreeListSpace::IsZygoteLargeObject([[maybe_unused]] Thread* self, mirror::Object* obj) const {
   const AllocationInfo* info = GetAllocationInfoForAddress(reinterpret_cast<uintptr_t>(obj));
   DCHECK(info != nullptr);
   return info->IsZygoteObject();
diff --git a/runtime/gc/space/large_object_space.h b/runtime/gc/space/large_object_space.h
index 7611784..ae1526d 100644
--- a/runtime/gc/space/large_object_space.h
+++ b/runtime/gc/space/large_object_space.h
@@ -27,7 +27,7 @@
 #include <set>
 #include <vector>
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
@@ -118,6 +118,16 @@
   // Clamp the space size to the given capacity.
   virtual void ClampGrowthLimit(size_t capacity) = 0;
 
+  // The way large object spaces are implemented, the object alignment has to be
+  // the same as the *runtime* OS page size. However, in the future this may
+  // change so it is important to use LargeObjectSpace::ObjectAlignment() rather
+  // than gPageSize when appropriate.
+#if defined(ART_PAGE_SIZE_AGNOSTIC)
+  static ALWAYS_INLINE size_t ObjectAlignment() { return gPageSize; }
+#else
+  static constexpr size_t ObjectAlignment() { return kMinPageSize; }
+#endif
+
  protected:
   explicit LargeObjectSpace(const std::string& name, uint8_t* begin, uint8_t* end,
                             const char* lock_name);
@@ -188,8 +198,6 @@
 // A continuous large object space with a free-list to handle holes.
 class FreeListSpace final : public LargeObjectSpace {
  public:
-  static constexpr size_t kAlignment = kPageSize;
-
   virtual ~FreeListSpace();
   static FreeListSpace* Create(const std::string& name, size_t capacity);
   size_t AllocationSize(mirror::Object* obj, size_t* usable_size) override
@@ -208,13 +216,13 @@
   FreeListSpace(const std::string& name, MemMap&& mem_map, uint8_t* begin, uint8_t* end);
   size_t GetSlotIndexForAddress(uintptr_t address) const {
     DCHECK(Contains(reinterpret_cast<mirror::Object*>(address)));
-    return (address - reinterpret_cast<uintptr_t>(Begin())) / kAlignment;
+    return (address - reinterpret_cast<uintptr_t>(Begin())) / ObjectAlignment();
   }
   size_t GetSlotIndexForAllocationInfo(const AllocationInfo* info) const;
   AllocationInfo* GetAllocationInfoForAddress(uintptr_t address);
   const AllocationInfo* GetAllocationInfoForAddress(uintptr_t address) const;
   uintptr_t GetAllocationAddressForSlot(size_t slot) const {
-    return reinterpret_cast<uintptr_t>(Begin()) + slot * kAlignment;
+    return reinterpret_cast<uintptr_t>(Begin()) + slot * ObjectAlignment();
   }
   uintptr_t GetAddressForAllocationInfo(const AllocationInfo* info) const {
     return GetAllocationAddressForSlot(GetSlotIndexForAllocationInfo(info));
diff --git a/runtime/gc/space/large_object_space_test.cc b/runtime/gc/space/large_object_space_test.cc
index 9736c5d..1d1bc6e 100644
--- a/runtime/gc/space/large_object_space_test.cc
+++ b/runtime/gc/space/large_object_space_test.cc
@@ -19,7 +19,7 @@
 #include "base/time_utils.h"
 #include "space_test.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
@@ -161,14 +161,15 @@
     }
 
     Thread* self = Thread::Current();
-    ThreadPool thread_pool("Large object space test thread pool", kNumThreads);
+    std::unique_ptr<ThreadPool> thread_pool(
+        ThreadPool::Create("Large object space test thread pool", kNumThreads));
     for (size_t i = 0; i < kNumThreads; ++i) {
-      thread_pool.AddTask(self, new AllocRaceTask(i, kNumIterations, 16 * KB, los));
+      thread_pool->AddTask(self, new AllocRaceTask(i, kNumIterations, 16 * KB, los));
     }
 
-    thread_pool.StartWorkers(self);
+    thread_pool->StartWorkers(self);
 
-    thread_pool.Wait(self, true, false);
+    thread_pool->Wait(self, true, false);
 
     delete los;
   }
diff --git a/runtime/gc/space/malloc_space.cc b/runtime/gc/space/malloc_space.cc
index a9402d2..ca2991a 100644
--- a/runtime/gc/space/malloc_space.cc
+++ b/runtime/gc/space/malloc_space.cc
@@ -35,7 +35,7 @@
 #include "thread.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
@@ -102,8 +102,8 @@
   }
 
   // Page align growth limit and capacity which will be used to manage mmapped storage
-  *growth_limit = RoundUp(*growth_limit, kPageSize);
-  *capacity = RoundUp(*capacity, kPageSize);
+  *growth_limit = RoundUp(*growth_limit, gPageSize);
+  *capacity = RoundUp(*capacity, gPageSize);
 
   std::string error_msg;
   MemMap mem_map = MemMap::MapAnonymous(name.c_str(),
@@ -140,7 +140,7 @@
 }
 
 void MallocSpace::SetGrowthLimit(size_t growth_limit) {
-  growth_limit = RoundUp(growth_limit, kPageSize);
+  growth_limit = RoundUp(growth_limit, gPageSize);
   growth_limit_ = growth_limit;
   if (Size() > growth_limit_) {
     SetEnd(begin_ + growth_limit);
@@ -183,12 +183,12 @@
   // alloc space so that we won't mix thread local runs from different
   // alloc spaces.
   RevokeAllThreadLocalBuffers();
-  SetEnd(reinterpret_cast<uint8_t*>(RoundUp(reinterpret_cast<uintptr_t>(End()), kPageSize)));
+  SetEnd(reinterpret_cast<uint8_t*>(RoundUp(reinterpret_cast<uintptr_t>(End()), gPageSize)));
   DCHECK_ALIGNED(begin_, accounting::CardTable::kCardSize);
   DCHECK_ALIGNED(End(), accounting::CardTable::kCardSize);
-  DCHECK_ALIGNED(begin_, kPageSize);
-  DCHECK_ALIGNED(End(), kPageSize);
-  size_t size = RoundUp(Size(), kPageSize);
+  DCHECK_ALIGNED_PARAM(begin_, gPageSize);
+  DCHECK_ALIGNED_PARAM(End(), gPageSize);
+  size_t size = RoundUp(Size(), gPageSize);
   // Trimming the heap should be done by the caller since we may have invalidated the accounting
   // stored in between objects.
   // Remaining size is for the new alloc space.
@@ -200,7 +200,7 @@
              << "Size " << size << "\n"
              << "GrowthLimit " << growth_limit_ << "\n"
              << "Capacity " << Capacity();
-  SetGrowthLimit(RoundUp(size, kPageSize));
+  SetGrowthLimit(RoundUp(size, gPageSize));
   // FIXME: Do we need reference counted pointers here?
   // Make the two spaces share the same mark bitmaps since the bitmaps span both of the spaces.
   VLOG(heap) << "Creating new AllocSpace: ";
diff --git a/runtime/gc/space/malloc_space.h b/runtime/gc/space/malloc_space.h
index 59ab3f3..73ce4e7 100644
--- a/runtime/gc/space/malloc_space.h
+++ b/runtime/gc/space/malloc_space.h
@@ -24,7 +24,7 @@
 #include "base/memory_tool.h"
 #include "base/mutex.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 namespace collector {
diff --git a/runtime/gc/space/memory_tool_malloc_space-inl.h b/runtime/gc/space/memory_tool_malloc_space-inl.h
index ba08889..3fc2b7a 100644
--- a/runtime/gc/space/memory_tool_malloc_space-inl.h
+++ b/runtime/gc/space/memory_tool_malloc_space-inl.h
@@ -23,7 +23,7 @@
 #include "memory_tool_settings.h"
 #include "mirror/object-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
diff --git a/runtime/gc/space/memory_tool_malloc_space.h b/runtime/gc/space/memory_tool_malloc_space.h
index 33bddfa..c76bb9c 100644
--- a/runtime/gc/space/memory_tool_malloc_space.h
+++ b/runtime/gc/space/memory_tool_malloc_space.h
@@ -19,7 +19,7 @@
 
 #include "malloc_space.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
@@ -48,7 +48,7 @@
   size_t FreeList(Thread* self, size_t num_ptrs, mirror::Object** ptrs) override
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  void RegisterRecentFree(mirror::Object* ptr ATTRIBUTE_UNUSED) override {}
+  void RegisterRecentFree([[maybe_unused]] mirror::Object* ptr) override {}
 
   size_t MaxBytesBulkAllocatedFor(size_t num_bytes) override;
 
diff --git a/runtime/gc/space/memory_tool_settings.h b/runtime/gc/space/memory_tool_settings.h
index e9333c8..6fe4f59 100644
--- a/runtime/gc/space/memory_tool_settings.h
+++ b/runtime/gc/space/memory_tool_settings.h
@@ -17,7 +17,7 @@
 #ifndef ART_RUNTIME_GC_SPACE_MEMORY_TOOL_SETTINGS_H_
 #define ART_RUNTIME_GC_SPACE_MEMORY_TOOL_SETTINGS_H_
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
diff --git a/runtime/gc/space/region_space-inl.h b/runtime/gc/space/region_space-inl.h
index 1026f42..d67fc0e 100644
--- a/runtime/gc/space/region_space-inl.h
+++ b/runtime/gc/space/region_space-inl.h
@@ -22,11 +22,11 @@
 #include "region_space.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
-inline mirror::Object* RegionSpace::Alloc(Thread* self ATTRIBUTE_UNUSED,
+inline mirror::Object* RegionSpace::Alloc([[maybe_unused]] Thread* self,
                                           size_t num_bytes,
                                           /* out */ size_t* bytes_allocated,
                                           /* out */ size_t* usable_size,
diff --git a/runtime/gc/space/region_space.cc b/runtime/gc/space/region_space.cc
index 60141d6..e891739 100644
--- a/runtime/gc/space/region_space.cc
+++ b/runtime/gc/space/region_space.cc
@@ -24,7 +24,7 @@
 #include "mirror/object-inl.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
@@ -393,16 +393,30 @@
   evac_region_ = &full_region_;
 }
 
-static void ZeroAndProtectRegion(uint8_t* begin, uint8_t* end) {
-  ZeroAndReleasePages(begin, end - begin);
+static void ZeroAndProtectRegion(uint8_t* begin, uint8_t* end, bool release_eagerly) {
+  ZeroMemory(begin, end - begin, release_eagerly);
   if (kProtectClearedRegions) {
     CheckedCall(mprotect, __FUNCTION__, begin, end - begin, PROT_NONE);
   }
 }
 
+void RegionSpace::ReleaseFreeRegions() {
+  MutexLock mu(Thread::Current(), region_lock_);
+  for (size_t i = 0u; i < num_regions_; ++i) {
+    if (regions_[i].IsFree()) {
+      uint8_t* begin = regions_[i].Begin();
+      DCHECK_ALIGNED_PARAM(begin, gPageSize);
+      DCHECK_ALIGNED_PARAM(regions_[i].End(), gPageSize);
+      bool res = madvise(begin, regions_[i].End() - begin, MADV_DONTNEED);
+      CHECK_NE(res, -1) << "madvise failed";
+    }
+  }
+}
+
 void RegionSpace::ClearFromSpace(/* out */ uint64_t* cleared_bytes,
                                  /* out */ uint64_t* cleared_objects,
-                                 const bool clear_bitmap) {
+                                 const bool clear_bitmap,
+                                 const bool release_eagerly) {
   DCHECK(cleared_bytes != nullptr);
   DCHECK(cleared_objects != nullptr);
   *cleared_bytes = 0;
@@ -483,7 +497,7 @@
   // Madvise the memory ranges.
   uint64_t start_time = NanoTime();
   for (const auto &iter : madvise_list) {
-    ZeroAndProtectRegion(iter.first, iter.second);
+    ZeroAndProtectRegion(iter.first, iter.second, release_eagerly);
   }
   madvise_time_ += NanoTime() - start_time;
 
@@ -1012,7 +1026,7 @@
   alloc_time_ = 0;
   live_bytes_ = static_cast<size_t>(-1);
   if (zero_and_release_pages) {
-    ZeroAndProtectRegion(begin_, end_);
+    ZeroAndProtectRegion(begin_, end_, /* release_eagerly= */ true);
   }
   is_newly_allocated_ = false;
   is_a_tlab_ = false;
diff --git a/runtime/gc/space/region_space.h b/runtime/gc/space/region_space.h
index 27b9e9c..c6b6825 100644
--- a/runtime/gc/space/region_space.h
+++ b/runtime/gc/space/region_space.h
@@ -25,7 +25,7 @@
 #include <functional>
 #include <map>
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 namespace accounting {
@@ -99,7 +99,7 @@
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!region_lock_) {
     return AllocationSizeNonvirtual(obj, usable_size);
   }
-  size_t AllocationSizeNonvirtual(mirror::Object* obj, size_t* usable_size)
+  EXPORT size_t AllocationSizeNonvirtual(mirror::Object* obj, size_t* usable_size)
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!region_lock_);
 
   size_t Free(Thread*, mirror::Object*) override {
@@ -117,7 +117,7 @@
     return &mark_bitmap_;
   }
 
-  void Clear() override REQUIRES(!region_lock_);
+  EXPORT void Clear() override REQUIRES(!region_lock_);
 
   // Remove read and write memory protection from the whole region space,
   // i.e. make memory pages backing the region area not readable and not
@@ -128,7 +128,7 @@
   // pages backing the region area readable and writable. This method is useful
   // to avoid page protection faults when dumping information about an invalid
   // reference.
-  void Unprotect();
+  EXPORT void Unprotect();
 
   // Change the non growth limit capacity to new capacity by shrinking or expanding the map.
   // Currently, only shrinking is supported.
@@ -137,15 +137,15 @@
   // growth limit.
   void ClampGrowthLimit(size_t new_capacity) REQUIRES(!region_lock_);
 
-  void Dump(std::ostream& os) const override;
+  EXPORT void Dump(std::ostream& os) const override;
   void DumpRegions(std::ostream& os) REQUIRES(!region_lock_);
   // Dump region containing object `obj`. Precondition: `obj` is in the region space.
   void DumpRegionForObject(std::ostream& os, mirror::Object* obj) REQUIRES(!region_lock_);
-  void DumpNonFreeRegions(std::ostream& os) REQUIRES(!region_lock_);
+  EXPORT void DumpNonFreeRegions(std::ostream& os) REQUIRES(!region_lock_);
 
-  size_t RevokeThreadLocalBuffers(Thread* thread) override REQUIRES(!region_lock_);
+  EXPORT size_t RevokeThreadLocalBuffers(Thread* thread) override REQUIRES(!region_lock_);
   size_t RevokeThreadLocalBuffers(Thread* thread, const bool reuse) REQUIRES(!region_lock_);
-  size_t RevokeAllThreadLocalBuffers() override
+  EXPORT size_t RevokeAllThreadLocalBuffers() override
       REQUIRES(!Locks::runtime_shutdown_lock_, !Locks::thread_list_lock_, !region_lock_);
   void AssertThreadLocalBuffersAreRevoked(Thread* thread) REQUIRES(!region_lock_);
   void AssertAllThreadLocalBuffersAreRevoked()
@@ -227,7 +227,7 @@
   accounting::ContinuousSpaceBitmap::SweepCallback* GetSweepCallback() override {
     return nullptr;
   }
-  bool LogFragmentationAllocFailure(std::ostream& os, size_t failed_alloc_bytes) override
+  EXPORT bool LogFragmentationAllocFailure(std::ostream& os, size_t failed_alloc_bytes) override
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!region_lock_);
 
   // Object alignment within the space.
@@ -313,7 +313,8 @@
   size_t ToSpaceSize() REQUIRES(!region_lock_);
   void ClearFromSpace(/* out */ uint64_t* cleared_bytes,
                       /* out */ uint64_t* cleared_objects,
-                      const bool clear_bitmap)
+                      const bool clear_bitmap,
+                      const bool release_eagerly)
       REQUIRES(!region_lock_);
 
   void AddLiveBytes(mirror::Object* ref, size_t alloc_size) {
@@ -384,6 +385,8 @@
     return madvise_time_;
   }
 
+  void ReleaseFreeRegions();
+
  private:
   RegionSpace(const std::string& name, MemMap&& mem_map, bool use_generational_cc);
 
@@ -450,11 +453,11 @@
         REQUIRES(region_space->region_lock_);
 
     // Given a free region, declare it non-free (allocated) and large.
-    void UnfreeLarge(RegionSpace* region_space, uint32_t alloc_time)
+    EXPORT void UnfreeLarge(RegionSpace* region_space, uint32_t alloc_time)
         REQUIRES(region_space->region_lock_);
 
     // Given a free region, declare it non-free (allocated) and large tail.
-    void UnfreeLargeTail(RegionSpace* region_space, uint32_t alloc_time)
+    EXPORT void UnfreeLargeTail(RegionSpace* region_space, uint32_t alloc_time)
         REQUIRES(region_space->region_lock_);
 
     void MarkAsAllocated(RegionSpace* region_space, uint32_t alloc_time)
@@ -712,7 +715,7 @@
     }
   }
 
-  Region* AllocateRegion(bool for_evac) REQUIRES(region_lock_);
+  EXPORT Region* AllocateRegion(bool for_evac) REQUIRES(region_lock_);
   void RevokeThreadLocalBuffersLocked(Thread* thread, bool reuse) REQUIRES(region_lock_);
 
   // Scan region range [`begin`, `end`) in increasing order to try to
diff --git a/runtime/gc/space/rosalloc_space-inl.h b/runtime/gc/space/rosalloc_space-inl.h
index 09aa7cf..f373763 100644
--- a/runtime/gc/space/rosalloc_space-inl.h
+++ b/runtime/gc/space/rosalloc_space-inl.h
@@ -24,7 +24,7 @@
 #include "gc/space/memory_tool_settings.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
diff --git a/runtime/gc/space/rosalloc_space.cc b/runtime/gc/space/rosalloc_space.cc
index 80430bd..2639755 100644
--- a/runtime/gc/space/rosalloc_space.cc
+++ b/runtime/gc/space/rosalloc_space.cc
@@ -31,7 +31,7 @@
 #include "thread.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
@@ -152,7 +152,7 @@
   // Note: making this value large means that large allocations are unlikely to succeed as rosalloc
   // will ask for this memory from sys_alloc which will fail as the footprint (this value plus the
   // size of the large allocation) will be greater than the footprint limit.
-  size_t starting_size = Heap::kDefaultStartingSize;
+  size_t starting_size = Heap::GetDefaultStartingSize();
   MemMap mem_map = CreateMemMap(name, starting_size, &initial_size, &growth_limit, &capacity);
   if (!mem_map.IsValid()) {
     LOG(ERROR) << "Failed to create mem map for alloc space (" << name << ") of size "
diff --git a/runtime/gc/space/rosalloc_space.h b/runtime/gc/space/rosalloc_space.h
index 7becea0..712b344 100644
--- a/runtime/gc/space/rosalloc_space.h
+++ b/runtime/gc/space/rosalloc_space.h
@@ -21,7 +21,7 @@
 #include "malloc_space.h"
 #include "space.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 namespace collector {
diff --git a/runtime/gc/space/rosalloc_space_random_test.cc b/runtime/gc/space/rosalloc_space_random_test.cc
index 3010b77..211c6be 100644
--- a/runtime/gc/space/rosalloc_space_random_test.cc
+++ b/runtime/gc/space/rosalloc_space_random_test.cc
@@ -18,7 +18,7 @@
 
 #include "rosalloc_space.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 namespace {
diff --git a/runtime/gc/space/rosalloc_space_static_test.cc b/runtime/gc/space/rosalloc_space_static_test.cc
index 860a461..fcb03ce 100644
--- a/runtime/gc/space/rosalloc_space_static_test.cc
+++ b/runtime/gc/space/rosalloc_space_static_test.cc
@@ -18,7 +18,7 @@
 
 #include "rosalloc_space.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 namespace {
diff --git a/runtime/gc/space/space-inl.h b/runtime/gc/space/space-inl.h
index 3ea68cf..d5fb081 100644
--- a/runtime/gc/space/space-inl.h
+++ b/runtime/gc/space/space-inl.h
@@ -24,7 +24,7 @@
 #include "image_space.h"
 #include "large_object_space.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
diff --git a/runtime/gc/space/space.cc b/runtime/gc/space/space.cc
index cae9ce8..5fc09b8 100644
--- a/runtime/gc/space/space.cc
+++ b/runtime/gc/space/space.cc
@@ -25,7 +25,7 @@
 #include "runtime.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
diff --git a/runtime/gc/space/space.h b/runtime/gc/space/space.h
index 160c730..abe26b4 100644
--- a/runtime/gc/space/space.h
+++ b/runtime/gc/space/space.h
@@ -28,7 +28,7 @@
 #include "gc/collector/object_byte_pair.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 class Object;
 }  // namespace mirror
@@ -77,7 +77,7 @@
 std::ostream& operator<<(std::ostream& os, SpaceType space_type);
 
 // A space contains memory allocated for managed objects.
-class Space {
+class EXPORT Space {
  public:
   // Dump space. Also key method for C++ vtables.
   virtual void Dump(std::ostream& os) const;
diff --git a/runtime/gc/space/space_create_test.cc b/runtime/gc/space/space_create_test.cc
index 25bc12e..8356835 100644
--- a/runtime/gc/space/space_create_test.cc
+++ b/runtime/gc/space/space_create_test.cc
@@ -20,7 +20,7 @@
 #include "rosalloc_space.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
diff --git a/runtime/gc/space/space_test.h b/runtime/gc/space/space_test.h
index 4b01e83..2be1b94 100644
--- a/runtime/gc/space/space_test.h
+++ b/runtime/gc/space/space_test.h
@@ -31,7 +31,7 @@
 #include "thread_list.h"
 #include "zygote_space.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
diff --git a/runtime/gc/space/zygote_space.cc b/runtime/gc/space/zygote_space.cc
index c5e3a70..cab183e 100644
--- a/runtime/gc/space/zygote_space.cc
+++ b/runtime/gc/space/zygote_space.cc
@@ -25,7 +25,7 @@
 #include "runtime.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 namespace space {
 
@@ -34,9 +34,7 @@
   explicit CountObjectsAllocated(size_t* objects_allocated)
       : objects_allocated_(objects_allocated) {}
 
-  void operator()(mirror::Object* obj ATTRIBUTE_UNUSED) const {
-    ++*objects_allocated_;
-  }
+  void operator()([[maybe_unused]] mirror::Object* obj) const { ++*objects_allocated_; }
 
  private:
   size_t* const objects_allocated_;
diff --git a/runtime/gc/space/zygote_space.h b/runtime/gc/space/zygote_space.h
index 3ebc943..12cc5c7 100644
--- a/runtime/gc/space/zygote_space.h
+++ b/runtime/gc/space/zygote_space.h
@@ -21,7 +21,7 @@
 #include "gc/accounting/space_bitmap.h"
 #include "malloc_space.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 namespace space {
diff --git a/runtime/gc/system_weak.h b/runtime/gc/system_weak.h
index 77b9548..721977d 100644
--- a/runtime/gc/system_weak.h
+++ b/runtime/gc/system_weak.h
@@ -17,11 +17,12 @@
 #ifndef ART_RUNTIME_GC_SYSTEM_WEAK_H_
 #define ART_RUNTIME_GC_SYSTEM_WEAK_H_
 
+#include "base/macros.h"
 #include "base/mutex.h"
 #include "object_callbacks.h"
 #include "thread-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 class AbstractSystemWeakHolder {
@@ -62,7 +63,7 @@
     allow_new_system_weak_ = false;
   }
 
-  void Broadcast(bool broadcast_for_checkpoint ATTRIBUTE_UNUSED) override
+  void Broadcast([[maybe_unused]] bool broadcast_for_checkpoint) override
       REQUIRES(!allow_disallow_lock_) {
     MutexLock mu(Thread::Current(), allow_disallow_lock_);
     new_weak_condition_.Broadcast(Thread::Current());
diff --git a/runtime/gc/system_weak_test.cc b/runtime/gc/system_weak_test.cc
index dd93653..b2a8c4d 100644
--- a/runtime/gc/system_weak_test.cc
+++ b/runtime/gc/system_weak_test.cc
@@ -31,7 +31,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 class SystemWeakTest : public CommonRuntimeTest {
diff --git a/runtime/gc/task_processor.cc b/runtime/gc/task_processor.cc
index 494cf2b..50be93e 100644
--- a/runtime/gc/task_processor.cc
+++ b/runtime/gc/task_processor.cc
@@ -19,7 +19,7 @@
 #include "base/time_utils.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 TaskProcessor::TaskProcessor()
@@ -103,9 +103,31 @@
   return is_running_;
 }
 
-Thread* TaskProcessor::GetRunningThread() const {
-  MutexLock mu(Thread::Current(), lock_);
-  return running_thread_;
+bool TaskProcessor::WaitForThread(Thread* self) {
+  // Waiting for too little time here may cause us to fail to get stack traces, since we can't
+  // safely do so without identifying a HeapTaskDaemon to avoid it. Waiting too long could
+  // conceivably deadlock if we somehow try to get a stack trace on the way to starting the
+  // HeapTaskDaemon. Under normal circumstances. this should terminate immediately, since
+  // HeapTaskDaemon should normally be running.
+  constexpr int kTotalWaitMillis = 100;
+  for (int i = 0; i < kTotalWaitMillis; ++i) {
+    if (is_running_) {
+      return true;
+    }
+    cond_.TimedWait(self, 1 /*msecs*/, 0 /*nsecs*/);
+  }
+  LOG(ERROR) << "No identifiable HeapTaskDaemon; unsafe to get thread stacks.";
+  return false;
+}
+
+bool TaskProcessor::IsRunningThread(Thread* t, bool wait) {
+  Thread* self = Thread::Current();
+  MutexLock mu(self, lock_);
+  if (wait && !WaitForThread(self)) {
+    // If Wait failed, either answer may be correct; in our case, true is safer.
+    return true;
+  }
+  return running_thread_ == t;
 }
 
 void TaskProcessor::Stop(Thread* self) {
diff --git a/runtime/gc/task_processor.h b/runtime/gc/task_processor.h
index 86e36ab..65d703d 100644
--- a/runtime/gc/task_processor.h
+++ b/runtime/gc/task_processor.h
@@ -20,11 +20,12 @@
 #include <memory>
 #include <set>
 
+#include "base/macros.h"
 #include "base/mutex.h"
 #include "runtime_globals.h"
 #include "thread_pool.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 class HeapTask : public SelfDeletingTask {
@@ -64,9 +65,15 @@
   bool IsRunning() const REQUIRES(!lock_);
   void UpdateTargetRunTime(Thread* self, HeapTask* target_time, uint64_t new_target_time)
       REQUIRES(!lock_);
-  Thread* GetRunningThread() const REQUIRES(!lock_);
+  // Is the given thread the task processor thread?
+  // If wait is true, and no thread has been registered via Start(), we briefly
+  // wait for one to be registered. If we time out, we return true.
+  bool IsRunningThread(Thread* t, bool wait = false) REQUIRES(!lock_);
 
  private:
+  // Wait briefly for running_thread_ to become non-null. Return false on timeout.
+  bool WaitForThread(Thread* self) REQUIRES(lock_);
+
   class CompareByTargetRunTime {
    public:
     bool operator()(const HeapTask* a, const HeapTask* b) const {
diff --git a/runtime/gc/task_processor_test.cc b/runtime/gc/task_processor_test.cc
index 7cb678b..5ee4941 100644
--- a/runtime/gc/task_processor_test.cc
+++ b/runtime/gc/task_processor_test.cc
@@ -20,7 +20,7 @@
 #include "thread-current-inl.h"
 #include "thread_pool.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 class TaskProcessorTest : public CommonRuntimeTest {
@@ -63,7 +63,7 @@
 };
 
 TEST_F(TaskProcessorTest, Interrupt) {
-  ThreadPool thread_pool("task processor test", 1U);
+  std::unique_ptr<ThreadPool> thread_pool(ThreadPool::Create("task processor test", 1U));
   Thread* const self = Thread::Current();
   TaskProcessor task_processor;
   static constexpr size_t kRecursion = 10;
@@ -72,8 +72,8 @@
   task_processor.AddTask(self, new RecursiveTask(&task_processor, &counter, kRecursion));
   task_processor.Start(self);
   // Add a task which will wait until interrupted to the thread pool.
-  thread_pool.AddTask(self, new WorkUntilDoneTask(&task_processor, &done_running));
-  thread_pool.StartWorkers(self);
+  thread_pool->AddTask(self, new WorkUntilDoneTask(&task_processor, &done_running));
+  thread_pool->StartWorkers(self);
   ASSERT_FALSE(done_running);
   // Wait until all the tasks are done, but since we didn't interrupt, done_running should be 0.
   while (counter.load(std::memory_order_seq_cst) != kRecursion) {
@@ -81,7 +81,7 @@
   }
   ASSERT_FALSE(done_running);
   task_processor.Stop(self);
-  thread_pool.Wait(self, true, false);
+  thread_pool->Wait(self, true, false);
   // After the interrupt and wait, the WorkUntilInterruptedTasktask should have terminated and
   // set done_running_ to true.
   ASSERT_TRUE(done_running.load(std::memory_order_seq_cst));
@@ -93,9 +93,9 @@
   // working until all the tasks are completed.
   task_processor.Stop(self);
   task_processor.AddTask(self, new RecursiveTask(&task_processor, &counter, kRecursion));
-  thread_pool.AddTask(self, new WorkUntilDoneTask(&task_processor, &done_running));
-  thread_pool.StartWorkers(self);
-  thread_pool.Wait(self, true, false);
+  thread_pool->AddTask(self, new WorkUntilDoneTask(&task_processor, &done_running));
+  thread_pool->StartWorkers(self);
+  thread_pool->Wait(self, true, false);
   ASSERT_TRUE(done_running.load(std::memory_order_seq_cst));
   ASSERT_EQ(counter.load(std::memory_order_seq_cst), kRecursion);
 }
@@ -105,7 +105,7 @@
   TestOrderTask(uint64_t expected_time, size_t expected_counter, size_t* counter)
      : HeapTask(expected_time), expected_counter_(expected_counter), counter_(counter) {
   }
-  void Run(Thread* thread ATTRIBUTE_UNUSED) override {
+  void Run([[maybe_unused]] Thread* thread) override {
     ASSERT_EQ(*counter_, expected_counter_);
     ++*counter_;
   }
@@ -133,13 +133,13 @@
     auto* task = new TestOrderTask(pair.first, pair.second, &counter);
     task_processor.AddTask(self, task);
   }
-  ThreadPool thread_pool("task processor test", 1U);
+  std::unique_ptr<ThreadPool> thread_pool(ThreadPool::Create("task processor test", 1U));
   Atomic<bool> done_running(false);
   // Add a task which will wait until interrupted to the thread pool.
-  thread_pool.AddTask(self, new WorkUntilDoneTask(&task_processor, &done_running));
+  thread_pool->AddTask(self, new WorkUntilDoneTask(&task_processor, &done_running));
   ASSERT_FALSE(done_running.load(std::memory_order_seq_cst));
-  thread_pool.StartWorkers(self);
-  thread_pool.Wait(self, true, false);
+  thread_pool->StartWorkers(self);
+  thread_pool->Wait(self, true, false);
   ASSERT_TRUE(done_running.load(std::memory_order_seq_cst));
   ASSERT_EQ(counter, kNumTasks);
 }
diff --git a/runtime/gc/verification-inl.h b/runtime/gc/verification-inl.h
index 1ef96e2..6becd26 100644
--- a/runtime/gc/verification-inl.h
+++ b/runtime/gc/verification-inl.h
@@ -21,7 +21,7 @@
 
 #include "mirror/class-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 template <ReadBarrierOption kReadBarrierOption>
diff --git a/runtime/gc/verification.cc b/runtime/gc/verification.cc
index 195986f..858c62a 100644
--- a/runtime/gc/verification.cc
+++ b/runtime/gc/verification.cc
@@ -19,13 +19,15 @@
 #include <iomanip>
 #include <sstream>
 
+#include <android-base/unique_fd.h>
+
 #include "art_field-inl.h"
 #include "base/file_utils.h"
 #include "base/logging.h"
 #include "mirror/class-inl.h"
 #include "mirror/object-refvisitor-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 
 std::string Verification::DumpRAMAroundAddress(uintptr_t addr, uintptr_t bytes) const {
@@ -33,6 +35,21 @@
   uintptr_t* dump_end = reinterpret_cast<uintptr_t*>(addr + bytes);
   std::ostringstream oss;
   oss << " adjacent_ram=";
+
+  {
+    // Check if the RAM is accessible.
+    android::base::unique_fd read_fd, write_fd;
+    if (!android::base::Pipe(&read_fd, &write_fd)) {
+      LOG(WARNING) << "Could not create pipe, RAM being dumped may be unaccessible";
+    } else {
+      size_t count = 2 * bytes;
+      if (write(write_fd.get(), dump_start, count) != static_cast<ssize_t>(count)) {
+        oss << "unaccessible";
+        dump_start = dump_end;
+      }
+    }
+  }
+
   for (const uintptr_t* p = dump_start; p < dump_end; ++p) {
     if (p == reinterpret_cast<uintptr_t*>(addr)) {
       // Marker of where the address is.
@@ -133,7 +150,7 @@
  public:
   explicit BFSFindReachable(ObjectSet* visited) : visited_(visited) {}
 
-  void operator()(mirror::Object* obj, MemberOffset offset, bool is_static ATTRIBUTE_UNUSED) const
+  void operator()(mirror::Object* obj, MemberOffset offset, [[maybe_unused]] bool is_static) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     ArtField* field = obj->FindFieldByOffset(offset);
     Visit(obj->GetFieldObject<mirror::Object>(offset),
diff --git a/runtime/gc/verification.h b/runtime/gc/verification.h
index 7a5d01a..fb323f6 100644
--- a/runtime/gc/verification.h
+++ b/runtime/gc/verification.h
@@ -17,11 +17,12 @@
 #ifndef ART_RUNTIME_GC_VERIFICATION_H_
 #define ART_RUNTIME_GC_VERIFICATION_H_
 
+#include "base/macros.h"
 #include "obj_ptr.h"
 #include "offsets.h"
 #include "read_barrier_option.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Class;
@@ -40,15 +41,15 @@
  public:
   explicit Verification(gc::Heap* heap) : heap_(heap) {}
 
-  // Dump some reveant to debugging info about an object.
+  // Dump some debugging-relevant info about an object.
   std::string DumpObjectInfo(const void* obj, const char* tag) const
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Don't use ObjPtr for things that might not be aligned like the invalid reference.
-  void LogHeapCorruption(ObjPtr<mirror::Object> holder,
-                         MemberOffset offset,
-                         mirror::Object* ref,
-                         bool fatal) const REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void LogHeapCorruption(ObjPtr<mirror::Object> holder,
+                                MemberOffset offset,
+                                mirror::Object* ref,
+                                bool fatal) const REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Return true if the klass is likely to be a valid mirror::Class.
   // Returns true if the class is a valid mirror::Class or possibly spuriously.
@@ -68,7 +69,7 @@
 
   // Find the first path to the target from the root set. Should be called while paused since
   // visiting roots is not safe otherwise.
-  std::string FirstPathFromRootSet(ObjPtr<mirror::Object> target) const
+  EXPORT std::string FirstPathFromRootSet(ObjPtr<mirror::Object> target) const
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Does not check alignment, used by DumpRAMAroundAddress.
diff --git a/runtime/gc/weak_root_state.h b/runtime/gc/weak_root_state.h
index 0784d3c..316527f 100644
--- a/runtime/gc/weak_root_state.h
+++ b/runtime/gc/weak_root_state.h
@@ -19,7 +19,9 @@
 
 #include <iosfwd>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 namespace gc {
 
 enum WeakRootState {
diff --git a/runtime/gc_root-inl.h b/runtime/gc_root-inl.h
index e561d29..736fdd3 100644
--- a/runtime/gc_root-inl.h
+++ b/runtime/gc_root-inl.h
@@ -24,7 +24,7 @@
 #include "obj_ptr-inl.h"
 #include "read_barrier-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template<class MirrorType>
 template<ReadBarrierOption kReadBarrierOption>
diff --git a/runtime/gc_root.h b/runtime/gc_root.h
index 19e2786..da9d3af 100644
--- a/runtime/gc_root.h
+++ b/runtime/gc_root.h
@@ -22,7 +22,7 @@
 #include "mirror/object_reference.h"
 #include "read_barrier_option.h"
 
-namespace art {
+namespace art HIDDEN {
 class ArtField;
 class ArtMethod;
 template<class MirrorType> class ObjPtr;
@@ -54,7 +54,7 @@
   kRootVMInternal,
   kRootJNIMonitor,
 };
-std::ostream& operator<<(std::ostream& os, RootType root_type);
+EXPORT std::ostream& operator<<(std::ostream& os, RootType root_type);
 
 // Only used by hprof. thread_id_ and type_ are only used by hprof.
 class RootInfo {
diff --git a/runtime/handle.cc b/runtime/handle.cc
index e9c9113..d1a00f3 100644
--- a/runtime/handle.cc
+++ b/runtime/handle.cc
@@ -40,7 +40,7 @@
 
 #include "class_root-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // NOLINTBEGIN(bugprone-macro-parentheses)
 #define MAKE_OBJECT_FOR_GDB(ROOT, NAME, MIRROR)                 \
diff --git a/runtime/handle.h b/runtime/handle.h
index b34d983..318f863 100644
--- a/runtime/handle.h
+++ b/runtime/handle.h
@@ -27,7 +27,7 @@
 #include "obj_ptr.h"
 #include "stack_reference.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class Thread;
 
diff --git a/runtime/handle_scope-inl.h b/runtime/handle_scope-inl.h
index 60a82a2..48c61c2 100644
--- a/runtime/handle_scope-inl.h
+++ b/runtime/handle_scope-inl.h
@@ -19,6 +19,7 @@
 
 #include "handle_scope.h"
 
+#include "base/casts.h"
 #include "base/mutex.h"
 #include "handle.h"
 #include "handle_wrapper.h"
@@ -27,26 +28,27 @@
 #include "thread-current-inl.h"
 #include "verify_object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template<size_t kNumReferences>
-inline FixedSizeHandleScope<kNumReferences>::FixedSizeHandleScope(BaseHandleScope* link,
-                                                                  ObjPtr<mirror::Object> fill_value)
+inline FixedSizeHandleScope<kNumReferences>::FixedSizeHandleScope(BaseHandleScope* link)
     : HandleScope(link, kNumReferences) {
   if (kDebugLocking) {
     Locks::mutator_lock_->AssertSharedHeld(Thread::Current());
   }
   static_assert(kNumReferences >= 1, "FixedSizeHandleScope must contain at least 1 reference");
   DCHECK_EQ(&storage_[0], GetReferences());  // TODO: Figure out how to use a compile assert.
-  for (size_t i = 0; i < kNumReferences; ++i) {
-    SetReference(i, fill_value);
+  if (kIsDebugBuild) {
+    // Fill storage with "DEAD HAndleSCope", mapping H->"4" and S->"5".
+    for (size_t i = 0; i < kNumReferences; ++i) {
+      GetReferences()[i].Assign(reinterpret_cast32<mirror::Object*>(0xdead4a5c));
+    }
   }
 }
 
 template<size_t kNumReferences>
-inline StackHandleScope<kNumReferences>::StackHandleScope(Thread* self,
-                                                          ObjPtr<mirror::Object> fill_value)
-    : FixedSizeHandleScope<kNumReferences>(self->GetTopHandleScope(), fill_value),
+inline StackHandleScope<kNumReferences>::StackHandleScope(Thread* self)
+    : FixedSizeHandleScope<kNumReferences>(self->GetTopHandleScope()),
       self_(self) {
   DCHECK_EQ(self, Thread::Current());
   if (kDebugLocking) {
@@ -64,113 +66,96 @@
   DCHECK_EQ(top_handle_scope, this);
 }
 
-inline size_t HandleScope::SizeOf(uint32_t num_references) {
-  size_t header_size = sizeof(HandleScope);
-  size_t data_size = sizeof(StackReference<mirror::Object>) * num_references;
-  return header_size + data_size;
-}
-
-inline size_t HandleScope::SizeOf(PointerSize pointer_size, uint32_t num_references) {
-  // Assume that the layout is packed.
-  size_t header_size = ReferencesOffset(pointer_size);
-  size_t data_size = sizeof(StackReference<mirror::Object>) * num_references;
-  return header_size + data_size;
-}
-
 inline ObjPtr<mirror::Object> HandleScope::GetReference(size_t i) const {
-  DCHECK_LT(i, NumberOfReferences());
+  DCHECK_LT(i, Size());
   if (kDebugLocking) {
     Locks::mutator_lock_->AssertSharedHeld(Thread::Current());
   }
   return GetReferences()[i].AsMirrorPtr();
 }
 
-inline Handle<mirror::Object> HandleScope::GetHandle(size_t i) {
-  DCHECK_LT(i, NumberOfReferences());
-  return Handle<mirror::Object>(&GetReferences()[i]);
+template<class T>
+inline Handle<T> HandleScope::GetHandle(size_t i) {
+  DCHECK_LT(i, Size());
+  return Handle<T>(&GetReferences()[i]);
 }
 
-inline MutableHandle<mirror::Object> HandleScope::GetMutableHandle(size_t i) {
-  DCHECK_LT(i, NumberOfReferences());
-  return MutableHandle<mirror::Object>(&GetReferences()[i]);
+template<class T>
+inline MutableHandle<T> HandleScope::GetMutableHandle(size_t i) {
+  DCHECK_LT(i, Size());
+  return MutableHandle<T>(&GetReferences()[i]);
 }
 
 inline void HandleScope::SetReference(size_t i, ObjPtr<mirror::Object> object) {
   if (kDebugLocking) {
     Locks::mutator_lock_->AssertSharedHeld(Thread::Current());
   }
-  DCHECK_LT(i, NumberOfReferences());
+  DCHECK_LT(i, Size());
+  VerifyObject(object);
   GetReferences()[i].Assign(object);
 }
 
+template<class T>
+inline MutableHandle<T> HandleScope::NewHandle(T* object) {
+  return NewHandle(ObjPtr<T>(object));
+}
+
+template<class MirrorType>
+inline MutableHandle<MirrorType> HandleScope::NewHandle(
+    ObjPtr<MirrorType> object) {
+  DCHECK_LT(Size(), Capacity());
+  size_t pos = size_;
+  ++size_;
+  SetReference(pos, object);
+  MutableHandle<MirrorType> h(GetMutableHandle<MirrorType>(pos));
+  return h;
+}
+
+template<class T>
+inline HandleWrapper<T> HandleScope::NewHandleWrapper(T** object) {
+  return HandleWrapper<T>(object, NewHandle(*object));
+}
+
+template<class T>
+inline HandleWrapperObjPtr<T> HandleScope::NewHandleWrapper(
+    ObjPtr<T>* object) {
+  return HandleWrapperObjPtr<T>(object, NewHandle(*object));
+}
+
 inline bool HandleScope::Contains(StackReference<mirror::Object>* handle_scope_entry) const {
-  // A HandleScope should always contain something. One created by the
-  // jni_compiler should have a jobject/jclass as a native method is
-  // passed in a this pointer or a class
-  DCHECK_GT(NumberOfReferences(), 0U);
-  return &GetReferences()[0] <= handle_scope_entry &&
-      handle_scope_entry <= &GetReferences()[number_of_references_ - 1];
+  return GetReferences() <= handle_scope_entry && handle_scope_entry < GetReferences() + size_;
 }
 
 template <typename Visitor>
 inline void HandleScope::VisitRoots(Visitor& visitor) {
-  for (size_t i = 0, count = NumberOfReferences(); i < count; ++i) {
+  for (size_t i = 0, size = Size(); i < size; ++i) {
     // GetReference returns a pointer to the stack reference within the handle scope. If this
     // needs to be updated, it will be done by the root visitor.
-    visitor.VisitRootIfNonNull(GetHandle(i).GetReference());
+    visitor.VisitRootIfNonNull(GetHandle<mirror::Object>(i).GetReference());
   }
 }
 
 template <typename Visitor>
 inline void HandleScope::VisitHandles(Visitor& visitor) {
-  for (size_t i = 0, count = NumberOfReferences(); i < count; ++i) {
-    if (GetHandle(i) != nullptr) {
-      visitor.Visit(GetHandle(i));
+  for (size_t i = 0, size = Size(); i < size; ++i) {
+    if (GetHandle<mirror::Object>(i) != nullptr) {
+      visitor.Visit(GetHandle<mirror::Object>(i));
     }
   }
 }
 
-template<size_t kNumReferences> template<class T>
-inline MutableHandle<T> FixedSizeHandleScope<kNumReferences>::NewHandle(T* object) {
-  return NewHandle(ObjPtr<T>(object));
-}
-
-template<size_t kNumReferences> template<class MirrorType>
-inline MutableHandle<MirrorType> FixedSizeHandleScope<kNumReferences>::NewHandle(
-    ObjPtr<MirrorType> object) {
-  SetReference(pos_, object);
-  MutableHandle<MirrorType> h(GetHandle<MirrorType>(pos_));
-  ++pos_;
-  return h;
-}
-
-template<size_t kNumReferences> template<class T>
-inline HandleWrapper<T> FixedSizeHandleScope<kNumReferences>::NewHandleWrapper(T** object) {
-  return HandleWrapper<T>(object, NewHandle(*object));
-}
-
-template<size_t kNumReferences> template<class T>
-inline HandleWrapperObjPtr<T> FixedSizeHandleScope<kNumReferences>::NewHandleWrapper(
-    ObjPtr<T>* object) {
-  return HandleWrapperObjPtr<T>(object, NewHandle(*object));
-}
-
-template<size_t kNumReferences>
-inline void FixedSizeHandleScope<kNumReferences>::SetReference(size_t i,
-                                                               ObjPtr<mirror::Object> object) {
-  if (kDebugLocking) {
-    Locks::mutator_lock_->AssertSharedHeld(Thread::Current());
-  }
-  DCHECK_LT(i, kNumReferences);
-  VerifyObject(object);
-  GetReferences()[i].Assign(object);
-}
-
-// Number of references contained within this handle scope.
-inline uint32_t BaseHandleScope::NumberOfReferences() const {
+// The current size of this handle scope.
+inline uint32_t BaseHandleScope::Size() const {
   return LIKELY(!IsVariableSized())
-      ? AsHandleScope()->NumberOfReferences()
-      : AsVariableSized()->NumberOfReferences();
+      ? AsHandleScope()->Size()
+      : AsVariableSized()->Size();
+}
+
+// The current capacity of this handle scope.
+inline uint32_t BaseHandleScope::Capacity() const {
+  return LIKELY(!IsVariableSized())
+      ? AsHandleScope()->Capacity()
+      : AsVariableSized()->Capacity();
 }
 
 inline bool BaseHandleScope::Contains(StackReference<mirror::Object>* handle_scope_entry) const {
@@ -224,7 +209,8 @@
 
 template<class MirrorType>
 inline MutableHandle<MirrorType> VariableSizedHandleScope::NewHandle(ObjPtr<MirrorType> ptr) {
-  if (current_scope_->RemainingSlots() == 0) {
+  DCHECK_EQ(current_scope_->Capacity(), kNumReferencesPerScope);
+  if (current_scope_->Size() == kNumReferencesPerScope) {
     current_scope_ = new LocalScopeType(current_scope_);
   }
   return current_scope_->NewHandle(ptr);
@@ -256,12 +242,28 @@
   }
 }
 
-inline uint32_t VariableSizedHandleScope::NumberOfReferences() const {
+inline uint32_t VariableSizedHandleScope::Size() const {
+  const LocalScopeType* cur = current_scope_;
+  DCHECK(cur != nullptr);
+  // The linked list of local scopes starts from the latest which may not be fully filled.
+  uint32_t sum = cur->Size();
+  cur = down_cast<const LocalScopeType*>(cur->GetLink());
+  while (cur != nullptr) {
+    // All other local scopes are fully filled.
+    DCHECK_EQ(cur->Size(), kNumReferencesPerScope);
+    sum += kNumReferencesPerScope;
+    cur = down_cast<const LocalScopeType*>(cur->GetLink());
+  }
+  return sum;
+}
+
+inline uint32_t VariableSizedHandleScope::Capacity() const {
   uint32_t sum = 0;
   const LocalScopeType* cur = current_scope_;
   while (cur != nullptr) {
-    sum += cur->NumberOfReferences();
-    cur = reinterpret_cast<const LocalScopeType*>(cur->GetLink());
+    DCHECK_EQ(cur->Capacity(), kNumReferencesPerScope);
+    sum += kNumReferencesPerScope;
+    cur = down_cast<const LocalScopeType*>(cur->GetLink());
   }
   return sum;
 }
@@ -273,17 +275,41 @@
     if (cur->Contains(handle_scope_entry)) {
       return true;
     }
-    cur = reinterpret_cast<const LocalScopeType*>(cur->GetLink());
+    cur = down_cast<const LocalScopeType*>(cur->GetLink());
   }
   return false;
 }
 
+template<class T>
+Handle<T> VariableSizedHandleScope::GetHandle(size_t i) {
+  // Handle the most common path efficiently.
+  if (i < kNumReferencesPerScope) {
+    return first_scope_.GetHandle<T>(i);
+  }
+
+  uint32_t size = Size();
+  DCHECK_GT(size, kNumReferencesPerScope);
+  DCHECK_LT(i, size);
+  LocalScopeType* cur = current_scope_;
+  DCHECK(cur != &first_scope_);
+  // The linked list of local scopes starts from the latest which may not be fully filled.
+  uint32_t cur_start = size - cur->Size();
+  DCHECK_EQ(cur_start % kNumReferencesPerScope, 0u);  // All other local scopes are fully filled.
+  while (i < cur_start) {
+    cur = down_cast<LocalScopeType*>(cur->GetLink());
+    DCHECK(cur != nullptr);
+    DCHECK_EQ(cur->Size(), kNumReferencesPerScope);
+    cur_start -= kNumReferencesPerScope;
+  }
+  return cur->GetHandle<T>(i - cur_start);
+}
+
 template <typename Visitor>
 inline void VariableSizedHandleScope::VisitRoots(Visitor& visitor) {
   LocalScopeType* cur = current_scope_;
   while (cur != nullptr) {
     cur->VisitRoots(visitor);
-    cur = reinterpret_cast<LocalScopeType*>(cur->GetLink());
+    cur = down_cast<LocalScopeType*>(cur->GetLink());
   }
 }
 
@@ -292,7 +318,7 @@
   LocalScopeType* cur = current_scope_;
   while (cur != nullptr) {
     cur->VisitHandles(visitor);
-    cur = reinterpret_cast<LocalScopeType*>(cur->GetLink());
+    cur = down_cast<LocalScopeType*>(cur->GetLink());
   }
 }
 
diff --git a/runtime/handle_scope.h b/runtime/handle_scope.h
index a43e889..dbfd774 100644
--- a/runtime/handle_scope.h
+++ b/runtime/handle_scope.h
@@ -26,7 +26,7 @@
 #include "base/macros.h"
 #include "stack_reference.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template<class T> class Handle;
 class HandleScope;
@@ -45,11 +45,15 @@
 class PACKED(4) BaseHandleScope {
  public:
   bool IsVariableSized() const {
-    return number_of_references_ == kNumReferencesVariableSized;
+    return capacity_ == kNumReferencesVariableSized;
   }
 
-  // Number of references contained within this handle scope.
-  ALWAYS_INLINE uint32_t NumberOfReferences() const;
+  // The current size of this handle scope.
+  ALWAYS_INLINE uint32_t Size() const;
+
+  // The current capacity of this handle scope.
+  // It can change (increase) only for a `VariableSizedHandleScope`.
+  ALWAYS_INLINE uint32_t Capacity() const;
 
   ALWAYS_INLINE bool Contains(StackReference<mirror::Object>* handle_scope_entry) const;
 
@@ -70,14 +74,14 @@
   ALWAYS_INLINE const HandleScope* AsHandleScope() const;
 
  protected:
-  BaseHandleScope(BaseHandleScope* link, uint32_t num_references)
+  BaseHandleScope(BaseHandleScope* link, uint32_t capacity)
       : link_(link),
-        number_of_references_(num_references) {}
+        capacity_(capacity) {}
 
   // Variable sized constructor.
   explicit BaseHandleScope(BaseHandleScope* link)
       : link_(link),
-        number_of_references_(kNumReferencesVariableSized) {}
+        capacity_(kNumReferencesVariableSized) {}
 
   static constexpr int32_t kNumReferencesVariableSized = -1;
 
@@ -85,7 +89,7 @@
   BaseHandleScope* const link_;
 
   // Number of handlerized references. -1 for variable sized handle scopes.
-  const int32_t number_of_references_;
+  const int32_t capacity_;
 
  private:
   DISALLOW_COPY_AND_ASSIGN(BaseHandleScope);
@@ -98,86 +102,18 @@
  public:
   ~HandleScope() {}
 
-  // We have versions with and without explicit pointer size of the following. The first two are
-  // used at runtime, so OFFSETOF_MEMBER computes the right offsets automatically. The last one
-  // takes the pointer size explicitly so that at compile time we can cross-compile correctly.
-
-  // Returns the size of a HandleScope containing num_references handles.
-  static size_t SizeOf(uint32_t num_references);
-
-  // Returns the size of a HandleScope containing num_references handles.
-  static size_t SizeOf(PointerSize pointer_size, uint32_t num_references);
-
   ALWAYS_INLINE ObjPtr<mirror::Object> GetReference(size_t i) const
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  ALWAYS_INLINE Handle<mirror::Object> GetHandle(size_t i);
+  template<class T>
+  ALWAYS_INLINE Handle<T> GetHandle(size_t i) REQUIRES_SHARED(Locks::mutator_lock_);
 
-  ALWAYS_INLINE MutableHandle<mirror::Object> GetMutableHandle(size_t i)
-      REQUIRES_SHARED(Locks::mutator_lock_);
+  template<class T>
+  ALWAYS_INLINE MutableHandle<T> GetMutableHandle(size_t i) REQUIRES_SHARED(Locks::mutator_lock_);
 
   ALWAYS_INLINE void SetReference(size_t i, ObjPtr<mirror::Object> object)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  ALWAYS_INLINE bool Contains(StackReference<mirror::Object>* handle_scope_entry) const;
-
-  // Offset of link within HandleScope, used by generated code.
-  static constexpr size_t LinkOffset(PointerSize pointer_size ATTRIBUTE_UNUSED) {
-    return 0;
-  }
-
-  // Offset of length within handle scope, used by generated code.
-  static constexpr size_t NumberOfReferencesOffset(PointerSize pointer_size) {
-    return static_cast<size_t>(pointer_size);
-  }
-
-  // Offset of link within handle scope, used by generated code.
-  static constexpr size_t ReferencesOffset(PointerSize pointer_size) {
-    return NumberOfReferencesOffset(pointer_size) + sizeof(number_of_references_);
-  }
-
-  // Placement new creation.
-  static HandleScope* Create(void* storage, BaseHandleScope* link, uint32_t num_references)
-      WARN_UNUSED {
-    return new (storage) HandleScope(link, num_references);
-  }
-
-  // Number of references contained within this handle scope.
-  ALWAYS_INLINE uint32_t NumberOfReferences() const {
-    DCHECK_GE(number_of_references_, 0);
-    return static_cast<uint32_t>(number_of_references_);
-  }
-
-  template <typename Visitor>
-  ALWAYS_INLINE void VisitRoots(Visitor& visitor) REQUIRES_SHARED(Locks::mutator_lock_);
-
-  template <typename Visitor>
-  ALWAYS_INLINE void VisitHandles(Visitor& visitor) REQUIRES_SHARED(Locks::mutator_lock_);
-
- protected:
-  // Return backing storage used for references.
-  ALWAYS_INLINE StackReference<mirror::Object>* GetReferences() const {
-    uintptr_t address = reinterpret_cast<uintptr_t>(this) + ReferencesOffset(kRuntimePointerSize);
-    return reinterpret_cast<StackReference<mirror::Object>*>(address);
-  }
-
-  explicit HandleScope(size_t number_of_references) : HandleScope(nullptr, number_of_references) {}
-
-  // Semi-hidden constructor. Construction expected by generated code and StackHandleScope.
-  HandleScope(BaseHandleScope* link, uint32_t num_references)
-      : BaseHandleScope(link, num_references) {}
-
-  // Storage for references.
-  // StackReference<mirror::Object> references_[number_of_references_]
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(HandleScope);
-};
-
-// Fixed size handle scope that is not necessarily linked in the thread.
-template<size_t kNumReferences>
-class PACKED(4) FixedSizeHandleScope : public HandleScope {
- public:
   template<class T>
   ALWAYS_INLINE MutableHandle<T> NewHandle(T* object) REQUIRES_SHARED(Locks::mutator_lock_);
 
@@ -193,31 +129,75 @@
   ALWAYS_INLINE MutableHandle<MirrorType> NewHandle(ObjPtr<MirrorType> object)
     REQUIRES_SHARED(Locks::mutator_lock_);
 
-  ALWAYS_INLINE void SetReference(size_t i, ObjPtr<mirror::Object> object)
-      REQUIRES_SHARED(Locks::mutator_lock_);
+  ALWAYS_INLINE bool Contains(StackReference<mirror::Object>* handle_scope_entry) const;
 
-  size_t RemainingSlots() const {
-    return kNumReferences - pos_;
+  // Offset of link within HandleScope, used by generated code.
+  static constexpr size_t LinkOffset([[maybe_unused]] PointerSize pointer_size) { return 0; }
+
+  // Offset of length within handle scope, used by generated code.
+  static constexpr size_t CapacityOffset(PointerSize pointer_size) {
+    return static_cast<size_t>(pointer_size);
   }
 
+  // Offset of link within handle scope, used by generated code.
+  static constexpr size_t ReferencesOffset(PointerSize pointer_size) {
+    return CapacityOffset(pointer_size) + sizeof(capacity_) + sizeof(size_);
+  }
+
+  // The current size of this handle scope.
+  ALWAYS_INLINE uint32_t Size() const {
+    return size_;
+  }
+
+  // The capacity of this handle scope, immutable.
+  ALWAYS_INLINE uint32_t Capacity() const {
+    DCHECK_GT(capacity_, 0);
+    return static_cast<uint32_t>(capacity_);
+  }
+
+  template <typename Visitor>
+  ALWAYS_INLINE void VisitRoots(Visitor& visitor) REQUIRES_SHARED(Locks::mutator_lock_);
+
+  template <typename Visitor>
+  ALWAYS_INLINE void VisitHandles(Visitor& visitor) REQUIRES_SHARED(Locks::mutator_lock_);
+
+ protected:
+  // Return backing storage used for references.
+  ALWAYS_INLINE StackReference<mirror::Object>* GetReferences() const {
+    uintptr_t address = reinterpret_cast<uintptr_t>(this) + ReferencesOffset(kRuntimePointerSize);
+    return reinterpret_cast<StackReference<mirror::Object>*>(address);
+  }
+
+  explicit HandleScope(size_t capacity) : HandleScope(nullptr, capacity) {}
+
+  HandleScope(BaseHandleScope* link, uint32_t capacity)
+      : BaseHandleScope(link, capacity) {
+    // Handle scope should be created only if we have a code path that stores something in it.
+    // We may not take that code path and the handle scope may remain empty.
+    DCHECK_NE(capacity, 0u);
+  }
+
+  // Position new handles will be created.
+  uint32_t size_ = 0;
+
+  // Storage for references is in derived classes.
+  // StackReference<mirror::Object> references_[capacity_]
+
  private:
-  explicit ALWAYS_INLINE FixedSizeHandleScope(BaseHandleScope* link,
-                                              ObjPtr<mirror::Object> fill_value = nullptr)
+  DISALLOW_COPY_AND_ASSIGN(HandleScope);
+};
+
+// Fixed size handle scope that is not necessarily linked in the thread.
+template<size_t kNumReferences>
+class PACKED(4) FixedSizeHandleScope : public HandleScope {
+ private:
+  explicit ALWAYS_INLINE FixedSizeHandleScope(BaseHandleScope* link)
       REQUIRES_SHARED(Locks::mutator_lock_);
   ALWAYS_INLINE ~FixedSizeHandleScope() REQUIRES_SHARED(Locks::mutator_lock_) {}
 
-  template<class T>
-  ALWAYS_INLINE MutableHandle<T> GetHandle(size_t i) REQUIRES_SHARED(Locks::mutator_lock_) {
-    DCHECK_LT(i, kNumReferences);
-    return MutableHandle<T>(&GetReferences()[i]);
-  }
-
-  // Reference storage needs to be first as expected by the HandleScope layout.
+  // Reference storage.
   StackReference<mirror::Object> storage_[kNumReferences];
 
-  // Position new handles will be created.
-  uint32_t pos_ = 0;
-
   template<size_t kNumRefs> friend class StackHandleScope;
   friend class VariableSizedHandleScope;
 };
@@ -226,8 +206,7 @@
 template<size_t kNumReferences>
 class PACKED(4) StackHandleScope final : public FixedSizeHandleScope<kNumReferences> {
  public:
-  explicit ALWAYS_INLINE StackHandleScope(Thread* self,
-                                          ObjPtr<mirror::Object> fill_value = nullptr)
+  explicit ALWAYS_INLINE StackHandleScope(Thread* self)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   ALWAYS_INLINE ~StackHandleScope() REQUIRES_SHARED(Locks::mutator_lock_);
@@ -259,8 +238,16 @@
   MutableHandle<MirrorType> NewHandle(ObjPtr<MirrorType> ptr)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  // Number of references contained within this handle scope.
-  ALWAYS_INLINE uint32_t NumberOfReferences() const;
+  // The current size of this handle scope.
+  ALWAYS_INLINE uint32_t Size() const;
+
+  // The current capacity of this handle scope.
+  ALWAYS_INLINE uint32_t Capacity() const;
+
+  // Retrieve a `Handle<>` based on the slot index (in handle creation order).
+  // Note: This is linear in the size of the scope, so it should be used carefully.
+  template<class T>
+  ALWAYS_INLINE Handle<T> GetHandle(size_t i) REQUIRES_SHARED(Locks::mutator_lock_);
 
   ALWAYS_INLINE bool Contains(StackReference<mirror::Object>* handle_scope_entry) const;
 
@@ -275,8 +262,8 @@
   static constexpr size_t kSizeOfReferencesPerScope =
       kLocalScopeSize
           - /* BaseHandleScope::link_ */ sizeof(BaseHandleScope*)
-          - /* BaseHandleScope::number_of_references_ */ sizeof(int32_t)
-          - /* FixedSizeHandleScope<>::pos_ */ sizeof(uint32_t);
+          - /* BaseHandleScope::capacity_ */ sizeof(int32_t)
+          - /* HandleScope<>::size_ */ sizeof(uint32_t);
   static constexpr size_t kNumReferencesPerScope =
       kSizeOfReferencesPerScope / sizeof(StackReference<mirror::Object>);
 
diff --git a/runtime/handle_scope_test.cc b/runtime/handle_scope_test.cc
index 9207303..3352c09 100644
--- a/runtime/handle_scope_test.cc
+++ b/runtime/handle_scope_test.cc
@@ -28,7 +28,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Handles are value objects and should be trivially copyable.
 static_assert(std::is_trivially_copyable<Handle<mirror::Object>>::value,
@@ -57,7 +57,7 @@
   static const size_t kNumReferences = 0x9ABC;
   StackHandleScope<kNumReferences> test_table(soa.Self());
   ObjPtr<mirror::Class> c = class_linker->FindSystemClass(soa.Self(), "Ljava/lang/Object;");
-  test_table.SetReference(0, c.Ptr());
+  test_table.NewHandle(c);
 
   uint8_t* table_base_ptr = reinterpret_cast<uint8_t*>(&test_table);
 
@@ -68,8 +68,8 @@
   }
 
   {
-    uint32_t* num_ptr = reinterpret_cast<uint32_t*>(table_base_ptr +
-        HandleScope::NumberOfReferencesOffset(kRuntimePointerSize));
+    uint32_t* num_ptr = reinterpret_cast<uint32_t*>(
+        table_base_ptr + HandleScope::CapacityOffset(kRuntimePointerSize));
     EXPECT_EQ(*num_ptr, static_cast<size_t>(kNumReferences));
   }
 
@@ -97,15 +97,16 @@
 TEST_F(HandleScopeTest, VariableSized) {
   ScopedObjectAccess soa(Thread::Current());
   VariableSizedHandleScope hs(soa.Self());
+  std::vector<Handle<mirror::Object>> handles;
   ClassLinker* const class_linker = Runtime::Current()->GetClassLinker();
   Handle<mirror::Class> c =
       hs.NewHandle(class_linker->FindSystemClass(soa.Self(), "Ljava/lang/Object;"));
+  handles.push_back(c);
   // Test nested scopes.
   StackHandleScope<1> inner(soa.Self());
   inner.NewHandle(c->AllocObject(soa.Self()));
   // Add a bunch of handles and make sure callbacks work.
   static const size_t kNumHandles = 100;
-  std::vector<Handle<mirror::Object>> handles;
   for (size_t i = 0; i < kNumHandles; ++i) {
     BaseHandleScope* base = &hs;
     ObjPtr<mirror::Object> o = c->AllocObject(soa.Self());
@@ -113,16 +114,23 @@
     EXPECT_OBJ_PTR_EQ(o, handles.back().Get());
     EXPECT_TRUE(hs.Contains(handles.back().GetReference()));
     EXPECT_TRUE(base->Contains(handles.back().GetReference()));
-    EXPECT_EQ(hs.NumberOfReferences(), base->NumberOfReferences());
+    EXPECT_EQ(hs.Capacity(), base->Capacity());
   }
+  // Add one null handle.
+  Handle<mirror::Object> null_handle = hs.NewHandle<mirror::Object>(nullptr);
+  handles.push_back(null_handle);
   CollectVisitor visitor;
   BaseHandleScope* base = &hs;
   base->VisitRoots(visitor);
-  EXPECT_LE(visitor.visited.size(), base->NumberOfReferences());
-  EXPECT_EQ(visitor.total_visited, base->NumberOfReferences());
+  EXPECT_EQ(visitor.visited.size() + /* null handle */ 1u, base->Size());
+  EXPECT_EQ(visitor.total_visited, base->Size());
   for (StackReference<mirror::Object>* ref : visitor.visited) {
     EXPECT_TRUE(base->Contains(ref));
   }
+  // Test `VariableSizedHandleScope::GetHandle<.>()`.
+  for (size_t i = 0, size = handles.size(); i != size; ++i) {
+    EXPECT_EQ(handles[i].GetReference(), hs.GetHandle<mirror::Object>(i).GetReference());
+  }
 }
 
 }  // namespace art
diff --git a/runtime/handle_wrapper.h b/runtime/handle_wrapper.h
index a0bb772..29e74ce 100644
--- a/runtime/handle_wrapper.h
+++ b/runtime/handle_wrapper.h
@@ -17,10 +17,11 @@
 #ifndef ART_RUNTIME_HANDLE_WRAPPER_H_
 #define ART_RUNTIME_HANDLE_WRAPPER_H_
 
+#include "base/macros.h"
 #include "handle.h"
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // A wrapper which wraps around Object** and restores the pointer in the destructor.
 // TODO: Delete
diff --git a/runtime/hidden_api.cc b/runtime/hidden_api.cc
index 9d32e51..c2884d6 100644
--- a/runtime/hidden_api.cc
+++ b/runtime/hidden_api.cc
@@ -29,13 +29,13 @@
 #include "mirror/class_ext.h"
 #include "mirror/proxy.h"
 #include "nativehelper/scoped_local_ref.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 #include "scoped_thread_state_change.h"
 #include "stack.h"
 #include "thread-inl.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace hiddenapi {
 
 // Should be the same as dalvik.system.VMRuntime.HIDE_MAXTARGETSDK_P_HIDDEN_APIS,
@@ -191,6 +191,13 @@
         if (declaring_class->IsClassClass()) {
           return true;
         }
+
+        // MethodHandles.makeIdentity is doing findStatic to find hidden methods,
+        // where reflection is used.
+        if (m == WellKnownClasses::java_lang_invoke_MethodHandles_makeIdentity) {
+          return false;
+        }
+
         // Check classes in the java.lang.invoke package. At the time of writing, the
         // classes of interest are MethodHandles and MethodHandles.Lookup, but this
         // is subject to change so conservatively cover the entire package.
@@ -628,7 +635,7 @@
       static_assert(RAND_MAX >= 0xffff, "RAND_MAX too small");
       if (eventLogSampleRate != 0) {
         const uint32_t sampled_value = static_cast<uint32_t>(std::rand()) & 0xffff;
-        if (sampled_value < eventLogSampleRate) {
+        if (sampled_value <= eventLogSampleRate) {
           member_signature.LogAccessToEventLog(sampled_value, access_method, deny_access);
         }
       }
diff --git a/runtime/hidden_api.h b/runtime/hidden_api.h
index 531448b..4b97b0d 100644
--- a/runtime/hidden_api.h
+++ b/runtime/hidden_api.h
@@ -22,6 +22,7 @@
 #include "base/hiddenapi_domain.h"
 #include "base/hiddenapi_flags.h"
 #include "base/locks.h"
+#include "base/macros.h"
 #include "dex/class_accessor.h"
 #include "intrinsics_enum.h"
 #include "jni/jni_internal.h"
@@ -30,7 +31,7 @@
 #include "reflection.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace hiddenapi {
 
 // Hidden API enforcement policy
@@ -331,24 +332,24 @@
       case Intrinsics::kJdkUnsafeCASObject:
       case Intrinsics::kJdkUnsafeCompareAndSetInt:
       case Intrinsics::kJdkUnsafeCompareAndSetLong:
-      case Intrinsics::kJdkUnsafeCompareAndSetObject:
+      case Intrinsics::kJdkUnsafeCompareAndSetReference:
       case Intrinsics::kJdkUnsafeGetAndAddInt:
       case Intrinsics::kJdkUnsafeGetAndAddLong:
       case Intrinsics::kJdkUnsafeGetAndSetInt:
       case Intrinsics::kJdkUnsafeGetAndSetLong:
-      case Intrinsics::kJdkUnsafeGetAndSetObject:
+      case Intrinsics::kJdkUnsafeGetAndSetReference:
       case Intrinsics::kJdkUnsafeGetLongVolatile:
       case Intrinsics::kJdkUnsafeGetLongAcquire:
-      case Intrinsics::kJdkUnsafeGetObjectVolatile:
-      case Intrinsics::kJdkUnsafeGetObjectAcquire:
+      case Intrinsics::kJdkUnsafeGetReferenceVolatile:
+      case Intrinsics::kJdkUnsafeGetReferenceAcquire:
       case Intrinsics::kJdkUnsafeGetVolatile:
       case Intrinsics::kJdkUnsafeGetAcquire:
       case Intrinsics::kJdkUnsafePutLongOrdered:
       case Intrinsics::kJdkUnsafePutLongVolatile:
       case Intrinsics::kJdkUnsafePutLongRelease:
       case Intrinsics::kJdkUnsafePutObjectOrdered:
-      case Intrinsics::kJdkUnsafePutObjectVolatile:
-      case Intrinsics::kJdkUnsafePutObjectRelease:
+      case Intrinsics::kJdkUnsafePutReferenceVolatile:
+      case Intrinsics::kJdkUnsafePutReferenceRelease:
       case Intrinsics::kJdkUnsafePutOrdered:
       case Intrinsics::kJdkUnsafePutVolatile:
       case Intrinsics::kJdkUnsafePutRelease:
@@ -357,11 +358,11 @@
       case Intrinsics::kJdkUnsafeFullFence:
       case Intrinsics::kJdkUnsafeGet:
       case Intrinsics::kJdkUnsafeGetLong:
-      case Intrinsics::kJdkUnsafeGetObject:
       case Intrinsics::kJdkUnsafeGetByte:
+      case Intrinsics::kJdkUnsafeGetReference:
       case Intrinsics::kJdkUnsafePutLong:
       case Intrinsics::kJdkUnsafePut:
-      case Intrinsics::kJdkUnsafePutObject:
+      case Intrinsics::kJdkUnsafePutReference:
       case Intrinsics::kJdkUnsafePutByte:
         return 0u;
       case Intrinsics::kFP16Ceil:
diff --git a/runtime/hidden_api_test.cc b/runtime/hidden_api_test.cc
index 3fb447a..7dc3d90 100644
--- a/runtime/hidden_api_test.cc
+++ b/runtime/hidden_api_test.cc
@@ -28,7 +28,7 @@
 #include "proxy_test.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 using hiddenapi::detail::MemberSignature;
diff --git a/runtime/hprof/hprof.cc b/runtime/hprof/hprof.cc
index 5e4a5f3..9e1bc29 100644
--- a/runtime/hprof/hprof.cc
+++ b/runtime/hprof/hprof.cc
@@ -68,7 +68,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace hprof {
 
@@ -237,7 +237,7 @@
     HandleU4List(values, count);
     length_ += count * sizeof(uint32_t);
   }
-  virtual void UpdateU4(size_t offset, uint32_t new_value ATTRIBUTE_UNUSED) {
+  virtual void UpdateU4(size_t offset, [[maybe_unused]] uint32_t new_value) {
     DCHECK_LE(offset, length_ - 4);
   }
   void AddU8List(const uint64_t* values, size_t count) {
@@ -271,21 +271,16 @@
   }
 
  protected:
-  virtual void HandleU1List(const uint8_t* values ATTRIBUTE_UNUSED,
-                            size_t count ATTRIBUTE_UNUSED) {
+  virtual void HandleU1List([[maybe_unused]] const uint8_t* values, [[maybe_unused]] size_t count) {
   }
-  virtual void HandleU1AsU2List(const uint8_t* values ATTRIBUTE_UNUSED,
-                                size_t count ATTRIBUTE_UNUSED) {
-  }
-  virtual void HandleU2List(const uint16_t* values ATTRIBUTE_UNUSED,
-                            size_t count ATTRIBUTE_UNUSED) {
-  }
-  virtual void HandleU4List(const uint32_t* values ATTRIBUTE_UNUSED,
-                            size_t count ATTRIBUTE_UNUSED) {
-  }
-  virtual void HandleU8List(const uint64_t* values ATTRIBUTE_UNUSED,
-                            size_t count ATTRIBUTE_UNUSED) {
-  }
+  virtual void HandleU1AsU2List([[maybe_unused]] const uint8_t* values,
+                                [[maybe_unused]] size_t count) {}
+  virtual void HandleU2List([[maybe_unused]] const uint16_t* values,
+                            [[maybe_unused]] size_t count) {}
+  virtual void HandleU4List([[maybe_unused]] const uint32_t* values,
+                            [[maybe_unused]] size_t count) {}
+  virtual void HandleU8List([[maybe_unused]] const uint64_t* values,
+                            [[maybe_unused]] size_t count) {}
   virtual void HandleEndRecord() {
   }
 
@@ -382,7 +377,7 @@
     buffer_.clear();
   }
 
-  virtual void HandleFlush(const uint8_t* buffer ATTRIBUTE_UNUSED, size_t length ATTRIBUTE_UNUSED) {
+  virtual void HandleFlush([[maybe_unused]] const uint8_t* buffer, [[maybe_unused]] size_t length) {
   }
 
   std::vector<uint8_t> buffer_;
@@ -743,7 +738,7 @@
     }
   }
 
-  bool DumpToDdmsBuffered(size_t overall_size ATTRIBUTE_UNUSED, size_t max_length ATTRIBUTE_UNUSED)
+  bool DumpToDdmsBuffered([[maybe_unused]] size_t overall_size, [[maybe_unused]] size_t max_length)
       REQUIRES(Locks::mutator_lock_) {
     LOG(FATAL) << "Unimplemented";
     UNREACHABLE();
diff --git a/runtime/hprof/hprof.h b/runtime/hprof/hprof.h
index 9168464..3d79d30 100644
--- a/runtime/hprof/hprof.h
+++ b/runtime/hprof/hprof.h
@@ -17,7 +17,9 @@
 #ifndef ART_RUNTIME_HPROF_HPROF_H_
 #define ART_RUNTIME_HPROF_HPROF_H_
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 namespace hprof {
 
diff --git a/runtime/imt_conflict_table.h b/runtime/imt_conflict_table.h
index 02b3be4..b9a1d81 100644
--- a/runtime/imt_conflict_table.h
+++ b/runtime/imt_conflict_table.h
@@ -23,7 +23,7 @@
 #include "base/enums.h"
 #include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtMethod;
 
diff --git a/runtime/imtable-inl.h b/runtime/imtable-inl.h
index a0e56dd..9be56cb 100644
--- a/runtime/imtable-inl.h
+++ b/runtime/imtable-inl.h
@@ -23,7 +23,7 @@
 #include "dex/dex_file.h"
 #include "dex/utf.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static constexpr bool kImTableHashUseName = true;
 static constexpr bool kImTableHashUseCoefficients = true;
diff --git a/runtime/imtable.h b/runtime/imtable.h
index df10cda..6615042 100644
--- a/runtime/imtable.h
+++ b/runtime/imtable.h
@@ -23,7 +23,7 @@
 #include "base/locks.h"
 #include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtMethod;
 class DexFile;
diff --git a/runtime/imtable_test.cc b/runtime/imtable_test.cc
index d662114..9fed220 100644
--- a/runtime/imtable_test.cc
+++ b/runtime/imtable_test.cc
@@ -31,7 +31,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ImTableTest : public CommonRuntimeTest {
  public:
diff --git a/runtime/indirect_reference_table-inl.h b/runtime/indirect_reference_table-inl.h
index 23df2c8..2a01bc4 100644
--- a/runtime/indirect_reference_table-inl.h
+++ b/runtime/indirect_reference_table-inl.h
@@ -26,7 +26,7 @@
 #include "obj_ptr-inl.h"
 #include "verify_object.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 class Object;
 }  // namespace mirror
diff --git a/runtime/indirect_reference_table.cc b/runtime/indirect_reference_table.cc
index 67010f3..3784d0b 100644
--- a/runtime/indirect_reference_table.cc
+++ b/runtime/indirect_reference_table.cc
@@ -34,7 +34,7 @@
 
 #include <cstdlib>
 
-namespace art {
+namespace art HIDDEN {
 
 static constexpr bool kDebugIRT = false;
 
@@ -96,7 +96,7 @@
   // Overflow and maximum check.
   CHECK_LE(max_count, kMaxTableSizeInBytes / sizeof(IrtEntry));
 
-  const size_t table_bytes = RoundUp(max_count * sizeof(IrtEntry), kPageSize);
+  const size_t table_bytes = RoundUp(max_count * sizeof(IrtEntry), gPageSize);
   table_mem_map_ = NewIRTMap(table_bytes, error_msg);
   if (!table_mem_map_.IsValid()) {
     DCHECK(!error_msg->empty());
@@ -314,11 +314,11 @@
   ScopedTrace trace(__PRETTY_FUNCTION__);
   DCHECK(table_mem_map_.IsValid());
   const size_t top_index = Capacity();
-  uint8_t* release_start = AlignUp(reinterpret_cast<uint8_t*>(&table_[top_index]), kPageSize);
+  uint8_t* release_start = AlignUp(reinterpret_cast<uint8_t*>(&table_[top_index]), gPageSize);
   uint8_t* release_end = static_cast<uint8_t*>(table_mem_map_.BaseEnd());
   DCHECK_GE(reinterpret_cast<uintptr_t>(release_end), reinterpret_cast<uintptr_t>(release_start));
-  DCHECK_ALIGNED(release_end, kPageSize);
-  DCHECK_ALIGNED(release_end - release_start, kPageSize);
+  DCHECK_ALIGNED_PARAM(release_end, gPageSize);
+  DCHECK_ALIGNED_PARAM(release_end - release_start, gPageSize);
   if (release_start != release_end) {
     madvise(release_start, release_end - release_start, MADV_DONTNEED);
   }
diff --git a/runtime/indirect_reference_table.h b/runtime/indirect_reference_table.h
index ded6bcd..172b71d 100644
--- a/runtime/indirect_reference_table.h
+++ b/runtime/indirect_reference_table.h
@@ -35,7 +35,7 @@
 #include "offsets.h"
 #include "read_barrier_option.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class IsMarkedVisitor;
 class RootInfo;
@@ -72,7 +72,7 @@
   kWeakGlobal    = 3,  // <<weak global reference>>
   kLastKind      = kWeakGlobal
 };
-std::ostream& operator<<(std::ostream& os, IndirectRefKind rhs);
+EXPORT std::ostream& operator<<(std::ostream& os, IndirectRefKind rhs);
 const char* GetIndirectRefKindString(IndirectRefKind kind);
 
 // Maintain a table of indirect references.  Used for global and weak global JNI references.
@@ -251,8 +251,7 @@
   bool IsValidReference(IndirectRef, /*out*/std::string* error_msg) const
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  void SweepJniWeakGlobals(IsMarkedVisitor* visitor)
-      REQUIRES_SHARED(Locks::mutator_lock_)
+  EXPORT void SweepJniWeakGlobals(IsMarkedVisitor* visitor) REQUIRES_SHARED(Locks::mutator_lock_)
       REQUIRES(!Locks::jni_weak_globals_lock_);
 
  private:
diff --git a/runtime/indirect_reference_table_test.cc b/runtime/indirect_reference_table_test.cc
index ac22f3f..76d7e31 100644
--- a/runtime/indirect_reference_table_test.cc
+++ b/runtime/indirect_reference_table_test.cc
@@ -24,7 +24,7 @@
 #include "mirror/object-inl.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
diff --git a/runtime/instrumentation.cc b/runtime/instrumentation.cc
index de3a9da..ed968b8 100644
--- a/runtime/instrumentation.cc
+++ b/runtime/instrumentation.cc
@@ -48,13 +48,13 @@
 #include "mirror/object_array-inl.h"
 #include "nterp_helpers.h"
 #include "nth_caller_visitor.h"
-#include "oat_file_manager.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_file_manager.h"
+#include "oat/oat_quick_method_header.h"
 #include "runtime-inl.h"
 #include "thread.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 extern "C" NO_RETURN void artDeoptimize(Thread* self, bool skip_method_exit_callbacks);
 extern "C" NO_RETURN void artDeliverPendingExceptionFromCode(Thread* self);
 
@@ -111,8 +111,8 @@
     : run_exit_hooks_(false),
       instrumentation_level_(InstrumentationLevel::kInstrumentNothing),
       forced_interpret_only_(false),
-      have_method_entry_listeners_(false),
-      have_method_exit_listeners_(false),
+      have_method_entry_listeners_(0),
+      have_method_exit_listeners_(0),
       have_method_unwind_listeners_(false),
       have_dex_pc_listeners_(false),
       have_field_read_listeners_(false),
@@ -264,7 +264,10 @@
     }
     const Instrumentation* instr = Runtime::Current()->GetInstrumentation();
     if (instr->EntryExitStubsInstalled()) {
-      DCHECK(CodeSupportsEntryExitHooks(quick_code, method));
+      CHECK(CodeSupportsEntryExitHooks(quick_code, method));
+    }
+    if (instr->InterpreterStubsInstalled() && !method->IsNative()) {
+      CHECK_EQ(quick_code, GetQuickToInterpreterBridge());
     }
   }
   // If the method is from a boot image, don't dirty it if the entrypoint
@@ -727,15 +730,14 @@
   return (events & expected) != 0;
 }
 
-static void PotentiallyAddListenerTo(Instrumentation::InstrumentationEvent event,
+static bool PotentiallyAddListenerTo(Instrumentation::InstrumentationEvent event,
                                      uint32_t events,
                                      std::list<InstrumentationListener*>& list,
-                                     InstrumentationListener* listener,
-                                     bool* has_listener)
+                                     InstrumentationListener* listener)
     REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_, !Locks::classlinker_classes_lock_) {
   Locks::mutator_lock_->AssertExclusiveHeld(Thread::Current());
   if (!HasEvent(event, events)) {
-    return;
+    return false;
   }
   // If there is a free slot in the list, we insert the listener in that slot.
   // Otherwise we add it to the end of the list.
@@ -745,21 +747,66 @@
   } else {
     list.push_back(listener);
   }
-  *has_listener = true;
+  return true;
 }
 
-void Instrumentation::AddListener(InstrumentationListener* listener, uint32_t events) {
+static void PotentiallyAddListenerTo(Instrumentation::InstrumentationEvent event,
+                                     uint32_t events,
+                                     std::list<InstrumentationListener*>& list,
+                                     InstrumentationListener* listener,
+                                     bool* has_listener)
+    REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_, !Locks::classlinker_classes_lock_) {
+  if (PotentiallyAddListenerTo(event, events, list, listener)) {
+    *has_listener = true;
+  }
+}
+
+static void PotentiallyAddListenerTo(Instrumentation::InstrumentationEvent event,
+                                     uint32_t events,
+                                     std::list<InstrumentationListener*>& list,
+                                     InstrumentationListener* listener,
+                                     uint8_t* has_listener,
+                                     uint8_t flag)
+    REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_, !Locks::classlinker_classes_lock_) {
+  if (PotentiallyAddListenerTo(event, events, list, listener)) {
+    *has_listener = *has_listener | flag;
+  }
+}
+
+void Instrumentation::AddListener(InstrumentationListener* listener,
+                                  uint32_t events,
+                                  bool is_trace_listener) {
   Locks::mutator_lock_->AssertExclusiveHeld(Thread::Current());
-  PotentiallyAddListenerTo(kMethodEntered,
-                           events,
-                           method_entry_listeners_,
-                           listener,
-                           &have_method_entry_listeners_);
-  PotentiallyAddListenerTo(kMethodExited,
-                           events,
-                           method_exit_listeners_,
-                           listener,
-                           &have_method_exit_listeners_);
+  if (is_trace_listener) {
+    PotentiallyAddListenerTo(kMethodEntered,
+                             events,
+                             method_entry_fast_trace_listeners_,
+                             listener,
+                             &have_method_entry_listeners_,
+                             kFastTraceListeners);
+  } else {
+    PotentiallyAddListenerTo(kMethodEntered,
+                             events,
+                             method_entry_slow_listeners_,
+                             listener,
+                             &have_method_entry_listeners_,
+                             kSlowMethodEntryExitListeners);
+  }
+  if (is_trace_listener) {
+    PotentiallyAddListenerTo(kMethodExited,
+                             events,
+                             method_exit_fast_trace_listeners_,
+                             listener,
+                             &have_method_exit_listeners_,
+                             kFastTraceListeners);
+  } else {
+    PotentiallyAddListenerTo(kMethodExited,
+                             events,
+                             method_exit_slow_listeners_,
+                             listener,
+                             &have_method_exit_listeners_,
+                             kSlowMethodEntryExitListeners);
+  }
   PotentiallyAddListenerTo(kMethodUnwind,
                            events,
                            method_unwind_listeners_,
@@ -808,15 +855,14 @@
   }
 }
 
-static void PotentiallyRemoveListenerFrom(Instrumentation::InstrumentationEvent event,
+static bool PotentiallyRemoveListenerFrom(Instrumentation::InstrumentationEvent event,
                                           uint32_t events,
                                           std::list<InstrumentationListener*>& list,
-                                          InstrumentationListener* listener,
-                                          bool* has_listener)
+                                          InstrumentationListener* listener)
     REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_, !Locks::classlinker_classes_lock_) {
   Locks::mutator_lock_->AssertExclusiveHeld(Thread::Current());
   if (!HasEvent(event, events)) {
-    return;
+    return false;
   }
   auto it = std::find(list.begin(), list.end(), listener);
   if (it != list.end()) {
@@ -825,28 +871,73 @@
     *it = nullptr;
   }
 
-  // Check if the list contains any non-null listener, and update 'has_listener'.
+  // Check if the list contains any non-null listener.
   for (InstrumentationListener* l : list) {
     if (l != nullptr) {
-      *has_listener = true;
-      return;
+      return false;
     }
   }
-  *has_listener = false;
+
+  return true;
 }
 
-void Instrumentation::RemoveListener(InstrumentationListener* listener, uint32_t events) {
+static void PotentiallyRemoveListenerFrom(Instrumentation::InstrumentationEvent event,
+                                          uint32_t events,
+                                          std::list<InstrumentationListener*>& list,
+                                          InstrumentationListener* listener,
+                                          bool* has_listener)
+    REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_, !Locks::classlinker_classes_lock_) {
+  if (PotentiallyRemoveListenerFrom(event, events, list, listener)) {
+    *has_listener = false;
+  }
+}
+
+static void PotentiallyRemoveListenerFrom(Instrumentation::InstrumentationEvent event,
+                                          uint32_t events,
+                                          std::list<InstrumentationListener*>& list,
+                                          InstrumentationListener* listener,
+                                          uint8_t* has_listener,
+                                          uint8_t flag)
+    REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_, !Locks::classlinker_classes_lock_) {
+  if (PotentiallyRemoveListenerFrom(event, events, list, listener)) {
+    *has_listener = *has_listener & ~flag;
+  }
+}
+
+void Instrumentation::RemoveListener(InstrumentationListener* listener,
+                                     uint32_t events,
+                                     bool is_trace_listener) {
   Locks::mutator_lock_->AssertExclusiveHeld(Thread::Current());
-  PotentiallyRemoveListenerFrom(kMethodEntered,
-                                events,
-                                method_entry_listeners_,
-                                listener,
-                                &have_method_entry_listeners_);
-  PotentiallyRemoveListenerFrom(kMethodExited,
-                                events,
-                                method_exit_listeners_,
-                                listener,
-                                &have_method_exit_listeners_);
+  if (is_trace_listener) {
+    PotentiallyRemoveListenerFrom(kMethodEntered,
+                                  events,
+                                  method_entry_fast_trace_listeners_,
+                                  listener,
+                                  &have_method_entry_listeners_,
+                                  kFastTraceListeners);
+  } else {
+    PotentiallyRemoveListenerFrom(kMethodEntered,
+                                  events,
+                                  method_entry_slow_listeners_,
+                                  listener,
+                                  &have_method_entry_listeners_,
+                                  kSlowMethodEntryExitListeners);
+  }
+  if (is_trace_listener) {
+    PotentiallyRemoveListenerFrom(kMethodExited,
+                                  events,
+                                  method_exit_fast_trace_listeners_,
+                                  listener,
+                                  &have_method_exit_listeners_,
+                                  kFastTraceListeners);
+  } else {
+    PotentiallyRemoveListenerFrom(kMethodExited,
+                                  events,
+                                  method_exit_slow_listeners_,
+                                  listener,
+                                  &have_method_exit_listeners_,
+                                  kSlowMethodEntryExitListeners);
+  }
   PotentiallyRemoveListenerFrom(kMethodUnwind,
                                 events,
                                 method_unwind_listeners_,
@@ -995,7 +1086,7 @@
   }
 }
 
-static void ResetQuickAllocEntryPointsForThread(Thread* thread, void* arg ATTRIBUTE_UNUSED) {
+static void ResetQuickAllocEntryPointsForThread(Thread* thread, [[maybe_unused]] void* arg) {
   thread->ResetQuickAllocEntryPointsForThread();
 }
 
@@ -1080,6 +1171,8 @@
     return "generic jni";
   } else if (Runtime::Current()->GetOatFileManager().ContainsPc(code)) {
     return "oat";
+  } else if (OatQuickMethodHeader::IsStub(reinterpret_cast<const uint8_t*>(code)).value_or(false)) {
+    return "stub";
   }
   return "unknown";
 }
@@ -1099,7 +1192,7 @@
     return;
   }
 
-  if (IsDeoptimized(method)) {
+  if (InterpretOnly(method)) {
     DCHECK(class_linker->IsQuickToInterpreterBridge(method->GetEntryPointFromQuickCompiledCode()))
         << EntryPointString(method->GetEntryPointFromQuickCompiledCode());
     // Don't update, stay deoptimized.
@@ -1177,6 +1270,7 @@
     // If by the time we hit this frame we no longer need a deopt it is safe to continue.
     InstrumentAllThreadStacks(/* force_deopt= */ false);
   }
+  CHECK_EQ(method->GetEntryPointFromQuickCompiledCode(), GetQuickToInterpreterBridge());
 }
 
 void Instrumentation::Undeoptimize(ArtMethod* method) {
@@ -1348,7 +1442,12 @@
 void Instrumentation::MethodEnterEventImpl(Thread* thread, ArtMethod* method) const {
   DCHECK(!method->IsRuntimeMethod());
   if (HasMethodEntryListeners()) {
-    for (InstrumentationListener* listener : method_entry_listeners_) {
+    for (InstrumentationListener* listener : method_entry_slow_listeners_) {
+      if (listener != nullptr) {
+        listener->MethodEntered(thread, method);
+      }
+    }
+    for (InstrumentationListener* listener : method_entry_fast_trace_listeners_) {
       if (listener != nullptr) {
         listener->MethodEntered(thread, method);
       }
@@ -1362,7 +1461,12 @@
                                           OptionalFrame frame,
                                           MutableHandle<mirror::Object>& return_value) const {
   if (HasMethodExitListeners()) {
-    for (InstrumentationListener* listener : method_exit_listeners_) {
+    for (InstrumentationListener* listener : method_exit_slow_listeners_) {
+      if (listener != nullptr) {
+        listener->MethodExited(thread, method, frame, return_value);
+      }
+    }
+    for (InstrumentationListener* listener : method_exit_fast_trace_listeners_) {
       if (listener != nullptr) {
         listener->MethodExited(thread, method, frame, return_value);
       }
@@ -1379,7 +1483,12 @@
     StackHandleScope<1> hs(self);
     if (method->GetInterfaceMethodIfProxy(kRuntimePointerSize)->GetReturnTypePrimitive() !=
         Primitive::kPrimNot) {
-      for (InstrumentationListener* listener : method_exit_listeners_) {
+      for (InstrumentationListener* listener : method_exit_slow_listeners_) {
+        if (listener != nullptr) {
+          listener->MethodExited(thread, method, frame, return_value);
+        }
+      }
+      for (InstrumentationListener* listener : method_exit_fast_trace_listeners_) {
         if (listener != nullptr) {
           listener->MethodExited(thread, method, frame, return_value);
         }
diff --git a/runtime/instrumentation.h b/runtime/instrumentation.h
index fe7548d..d578412 100644
--- a/runtime/instrumentation.h
+++ b/runtime/instrumentation.h
@@ -35,7 +35,7 @@
 #include "jvalue.h"
 #include "offsets.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 class Class;
 class Object;
@@ -149,8 +149,8 @@
   // Call-back when a shadow_frame with the needs_notify_pop_ boolean set is popped off the stack by
   // either return or exceptions. Normally instrumentation listeners should ensure that there are
   // shadow-frames by deoptimizing stacks.
-  virtual void WatchedFramePop(Thread* thread ATTRIBUTE_UNUSED,
-                               const ShadowFrame& frame ATTRIBUTE_UNUSED)
+  virtual void WatchedFramePop([[maybe_unused]] Thread* thread,
+                               [[maybe_unused]] const ShadowFrame& frame)
       REQUIRES_SHARED(Locks::mutator_lock_) = 0;
 };
 
@@ -199,6 +199,9 @@
     kInstrumentWithInterpreter      // execute with interpreter
   };
 
+  static constexpr uint8_t kFastTraceListeners = 0b01;
+  static constexpr uint8_t kSlowMethodEntryExitListeners = 0b10;
+
   Instrumentation();
 
   static constexpr MemberOffset RunExitHooksOffset() {
@@ -219,7 +222,7 @@
   }
 
   static constexpr MemberOffset HaveMethodExitListenersOffset() {
-    // Assert that have_method_exit_listeners_ is 8bits wide. If the size changes
+    // Assert that have_method_exit_slow_listeners_ is 8bits wide. If the size changes
     // update the compare instructions in the code generator when generating checks for
     // MethodEntryExitHooks.
     static_assert(sizeof(have_method_exit_listeners_) == 1,
@@ -231,11 +234,15 @@
   // suspend the runtime to install stubs. You are expected to hold the mutator lock as a proxy
   // for saying you should have suspended all threads (installing stubs while threads are running
   // will break).
-  void AddListener(InstrumentationListener* listener, uint32_t events)
+  EXPORT void AddListener(InstrumentationListener* listener,
+                          uint32_t events,
+                          bool is_trace_listener = false)
       REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_, !Locks::classlinker_classes_lock_);
 
   // Removes listeners for the specified events.
-  void RemoveListener(InstrumentationListener* listener, uint32_t events)
+  EXPORT void RemoveListener(InstrumentationListener* listener,
+                             uint32_t events,
+                             bool is_trace_listener = false)
       REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_, !Locks::classlinker_classes_lock_);
 
   // Calls UndeoptimizeEverything which may visit class linker classes through ConfigureStubs.
@@ -245,63 +252,61 @@
   // deoptimization for other reasons (ex: removing the last breakpoint) while the debugger is still
   // connected, we pass false to stay in debuggable. Switching runtimes is expensive so we only want
   // to switch when we know debug features aren't needed anymore.
-  void DisableDeoptimization(const char* key, bool try_switch_to_non_debuggable)
+  EXPORT void DisableDeoptimization(const char* key, bool try_switch_to_non_debuggable)
       REQUIRES(Locks::mutator_lock_, Roles::uninterruptible_);
 
   // Enables entry exit hooks support. This is called in preparation for debug requests that require
   // calling method entry / exit hooks.
-  void EnableEntryExitHooks(const char* key)
+  EXPORT void EnableEntryExitHooks(const char* key)
       REQUIRES(Locks::mutator_lock_, Roles::uninterruptible_);
 
-
   bool AreAllMethodsDeoptimized() const {
     return InterpreterStubsInstalled();
   }
   bool ShouldNotifyMethodEnterExitEvents() const REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Executes everything with interpreter.
-  void DeoptimizeEverything(const char* key)
+  EXPORT void DeoptimizeEverything(const char* key)
       REQUIRES(Locks::mutator_lock_, Roles::uninterruptible_)
-      REQUIRES(!Locks::thread_list_lock_,
-               !Locks::classlinker_classes_lock_);
+          REQUIRES(!Locks::thread_list_lock_, !Locks::classlinker_classes_lock_);
 
   // Executes everything with compiled code (or interpreter if there is no code). May visit class
   // linker classes through ConfigureStubs.
-  void UndeoptimizeEverything(const char* key)
+  EXPORT void UndeoptimizeEverything(const char* key)
       REQUIRES(Locks::mutator_lock_, Roles::uninterruptible_)
-      REQUIRES(!Locks::thread_list_lock_,
-               !Locks::classlinker_classes_lock_);
+          REQUIRES(!Locks::thread_list_lock_, !Locks::classlinker_classes_lock_);
 
   // Deoptimize a method by forcing its execution with the interpreter. Nevertheless, a static
   // method (except a class initializer) set to the resolution trampoline will be deoptimized only
   // once its declaring class is initialized.
-  void Deoptimize(ArtMethod* method) REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_);
+  EXPORT void Deoptimize(ArtMethod* method)
+      REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_);
 
   // Undeoptimze the method by restoring its entrypoints. Nevertheless, a static method
   // (except a class initializer) set to the resolution trampoline will be updated only once its
   // declaring class is initialized.
-  void Undeoptimize(ArtMethod* method) REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_);
+  EXPORT void Undeoptimize(ArtMethod* method)
+      REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_);
 
   // Indicates whether the method has been deoptimized so it is executed with the interpreter.
-  bool IsDeoptimized(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT bool IsDeoptimized(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Indicates if any method needs to be deoptimized. This is used to avoid walking the stack to
   // determine if a deoptimization is required.
   bool IsDeoptimizedMethodsEmpty() const REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Enable method tracing by installing instrumentation entry/exit stubs or interpreter.
-  void EnableMethodTracing(const char* key,
-                           InstrumentationListener* listener,
-                           bool needs_interpreter = kDeoptimizeForAccurateMethodEntryExitListeners)
+  EXPORT void EnableMethodTracing(
+      const char* key,
+      InstrumentationListener* listener,
+      bool needs_interpreter = kDeoptimizeForAccurateMethodEntryExitListeners)
       REQUIRES(Locks::mutator_lock_, Roles::uninterruptible_)
           REQUIRES(!Locks::thread_list_lock_, !Locks::classlinker_classes_lock_);
 
   // Disable method tracing by uninstalling instrumentation entry/exit stubs or interpreter.
-  void DisableMethodTracing(const char* key)
+  EXPORT void DisableMethodTracing(const char* key)
       REQUIRES(Locks::mutator_lock_, Roles::uninterruptible_)
-      REQUIRES(!Locks::thread_list_lock_,
-               !Locks::classlinker_classes_lock_);
-
+          REQUIRES(!Locks::thread_list_lock_, !Locks::classlinker_classes_lock_);
 
   void InstrumentQuickAllocEntryPoints() REQUIRES(!Locks::instrument_entrypoints_lock_);
   void UninstrumentQuickAllocEntryPoints() REQUIRES(!Locks::instrument_entrypoints_lock_);
@@ -317,7 +322,7 @@
   static std::string EntryPointString(const void* code);
 
   // Initialize the entrypoint of the method .`aot_code` is the AOT code.
-  void InitializeMethodsCode(ArtMethod* method, const void* aot_code)
+  EXPORT void InitializeMethodsCode(ArtMethod* method, const void* aot_code)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Update the code of a method respecting any installed stubs.
@@ -329,7 +334,7 @@
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Return the code that we can execute for an invoke including from the JIT.
-  const void* GetCodeForInvoke(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT const void* GetCodeForInvoke(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Return the code that we can execute considering the current instrumentation level.
   // If interpreter stubs are installed return interpreter bridge. If the entry exit stubs
@@ -366,11 +371,19 @@
   }
 
   bool HasMethodEntryListeners() const REQUIRES_SHARED(Locks::mutator_lock_) {
-    return have_method_entry_listeners_;
+    return have_method_entry_listeners_ != 0;
   }
 
   bool HasMethodExitListeners() const REQUIRES_SHARED(Locks::mutator_lock_) {
-    return have_method_exit_listeners_;
+    return have_method_exit_listeners_ != 0;
+  }
+
+  bool HasFastMethodEntryListenersOnly() const REQUIRES_SHARED(Locks::mutator_lock_) {
+    return have_method_entry_listeners_ == kFastTraceListeners;
+  }
+
+  bool HasFastMethodExitListenersOnly() const REQUIRES_SHARED(Locks::mutator_lock_) {
+    return have_method_exit_listeners_ == kFastTraceListeners;
   }
 
   bool HasMethodUnwindListeners() const REQUIRES_SHARED(Locks::mutator_lock_) {
@@ -544,7 +557,7 @@
 
   void InstallStubsForMethod(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_);
 
-  void UpdateEntrypointsForDebuggable() REQUIRES(art::Locks::mutator_lock_);
+  EXPORT void UpdateEntrypointsForDebuggable() REQUIRES(art::Locks::mutator_lock_);
 
   // Install instrumentation exit stub on every method of the stack of the given thread.
   // This is used by:
@@ -552,14 +565,15 @@
   //    example, after updating local variables)
   //  - to call method entry / exit hooks for tracing. For this we instrument
   //    the stack frame to run entry / exit hooks but we don't need to deoptimize.
-  // deopt_all_frames indicates whether the frames need to deoptimize or not.
-  void InstrumentThreadStack(Thread* thread, bool deopt_all_frames) REQUIRES(Locks::mutator_lock_);
-  void InstrumentAllThreadStacks(bool deopt_all_frames) REQUIRES(Locks::mutator_lock_)
+  // force_deopt indicates whether the frames need to deoptimize or not.
+  EXPORT void InstrumentThreadStack(Thread* thread, bool force_deopt)
+      REQUIRES(Locks::mutator_lock_);
+  void InstrumentAllThreadStacks(bool force_deopt) REQUIRES(Locks::mutator_lock_)
       REQUIRES(!Locks::thread_list_lock_);
 
   // Force all currently running frames to be deoptimized back to interpreter. This should only be
   // used in cases where basically all compiled code has been invalidated.
-  void DeoptimizeAllThreadFrames() REQUIRES(art::Locks::mutator_lock_);
+  EXPORT void DeoptimizeAllThreadFrames() REQUIRES(art::Locks::mutator_lock_);
 
   static size_t ComputeFrameId(Thread* self,
                                size_t frame_depth,
@@ -577,7 +591,7 @@
                                     MutableHandle<mirror::Throwable>& exception)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  InstrumentationLevel GetCurrentInstrumentationLevel() const;
+  EXPORT InstrumentationLevel GetCurrentInstrumentationLevel() const;
 
   bool MethodSupportsExitEvents(ArtMethod* method, const OatQuickMethodHeader* header)
       REQUIRES_SHARED(Locks::mutator_lock_);
@@ -682,41 +696,37 @@
   // Did the runtime request we only run in the interpreter? ie -Xint mode.
   bool forced_interpret_only_;
 
-  // Do we have any listeners for method entry events? Short-cut to avoid taking the
-  // instrumentation_lock_.
-  bool have_method_entry_listeners_ GUARDED_BY(Locks::mutator_lock_);
+  // For method entry / exit events, we maintain fast trace listeners in a separate list to make
+  // implementation of fast trace listeners more efficient by JITing the code to handle fast trace
+  // events. We use a uint8_t (and not bool) to encode if there are none / fast / slow listeners.
+  // Do we have any listeners for method entry events.
+  uint8_t have_method_entry_listeners_ GUARDED_BY(Locks::mutator_lock_);
 
-  // Do we have any listeners for method exit events? Short-cut to avoid taking the
-  // instrumentation_lock_.
-  bool have_method_exit_listeners_ GUARDED_BY(Locks::mutator_lock_);
+  // Do we have any listeners for method exit events.
+  uint8_t have_method_exit_listeners_ GUARDED_BY(Locks::mutator_lock_);
 
-  // Do we have any listeners for method unwind events? Short-cut to avoid taking the
-  // instrumentation_lock_.
+  // Do we have any listeners for method unwind events?
   bool have_method_unwind_listeners_ GUARDED_BY(Locks::mutator_lock_);
 
-  // Do we have any listeners for dex move events? Short-cut to avoid taking the
-  // instrumentation_lock_.
+  // Do we have any listeners for dex move events?
   bool have_dex_pc_listeners_ GUARDED_BY(Locks::mutator_lock_);
 
-  // Do we have any listeners for field read events? Short-cut to avoid taking the
-  // instrumentation_lock_.
+  // Do we have any listeners for field read events?
   bool have_field_read_listeners_ GUARDED_BY(Locks::mutator_lock_);
 
-  // Do we have any listeners for field write events? Short-cut to avoid taking the
-  // instrumentation_lock_.
+  // Do we have any listeners for field write events?
   bool have_field_write_listeners_ GUARDED_BY(Locks::mutator_lock_);
 
-  // Do we have any exception thrown listeners? Short-cut to avoid taking the instrumentation_lock_.
+  // Do we have any exception thrown listeners?
   bool have_exception_thrown_listeners_ GUARDED_BY(Locks::mutator_lock_);
 
-  // Do we have any frame pop listeners? Short-cut to avoid taking the instrumentation_lock_.
+  // Do we have any frame pop listeners?
   bool have_watched_frame_pop_listeners_ GUARDED_BY(Locks::mutator_lock_);
 
-  // Do we have any branch listeners? Short-cut to avoid taking the instrumentation_lock_.
+  // Do we have any branch listeners?
   bool have_branch_listeners_ GUARDED_BY(Locks::mutator_lock_);
 
-  // Do we have any exception handled listeners? Short-cut to avoid taking the
-  // instrumentation_lock_.
+  // Do we have any exception handled listeners?
   bool have_exception_handled_listeners_ GUARDED_BY(Locks::mutator_lock_);
 
   // Contains the instrumentation level required by each client of the instrumentation identified
@@ -734,8 +744,12 @@
   // listeners can also be deleted concurrently.
   // As a result, these lists are never trimmed. That's acceptable given the low number of
   // listeners we have.
-  std::list<InstrumentationListener*> method_entry_listeners_ GUARDED_BY(Locks::mutator_lock_);
-  std::list<InstrumentationListener*> method_exit_listeners_ GUARDED_BY(Locks::mutator_lock_);
+  std::list<InstrumentationListener*> method_entry_slow_listeners_ GUARDED_BY(Locks::mutator_lock_);
+  std::list<InstrumentationListener*> method_entry_fast_trace_listeners_
+      GUARDED_BY(Locks::mutator_lock_);
+  std::list<InstrumentationListener*> method_exit_slow_listeners_ GUARDED_BY(Locks::mutator_lock_);
+  std::list<InstrumentationListener*> method_exit_fast_trace_listeners_
+      GUARDED_BY(Locks::mutator_lock_);
   std::list<InstrumentationListener*> method_unwind_listeners_ GUARDED_BY(Locks::mutator_lock_);
   std::list<InstrumentationListener*> branch_listeners_ GUARDED_BY(Locks::mutator_lock_);
   std::list<InstrumentationListener*> dex_pc_listeners_ GUARDED_BY(Locks::mutator_lock_);
diff --git a/runtime/instrumentation_test.cc b/runtime/instrumentation_test.cc
index b2a6dcf..ad14eb8 100644
--- a/runtime/instrumentation_test.cc
+++ b/runtime/instrumentation_test.cc
@@ -34,7 +34,7 @@
 #include "thread_list.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace instrumentation {
 
 class TestInstrumentationListener final : public instrumentation::InstrumentationListener {
@@ -55,93 +55,93 @@
 
   virtual ~TestInstrumentationListener() {}
 
-  void MethodEntered(Thread* thread ATTRIBUTE_UNUSED, ArtMethod* method ATTRIBUTE_UNUSED) override
+  void MethodEntered([[maybe_unused]] Thread* thread, [[maybe_unused]] ArtMethod* method) override
       REQUIRES_SHARED(Locks::mutator_lock_) {
     received_method_enter_event = true;
   }
 
-  void MethodExited(Thread* thread ATTRIBUTE_UNUSED,
-                    ArtMethod* method ATTRIBUTE_UNUSED,
-                    instrumentation::OptionalFrame frame ATTRIBUTE_UNUSED,
-                    MutableHandle<mirror::Object>& return_value ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_) {
+  void MethodExited([[maybe_unused]] Thread* thread,
+                    [[maybe_unused]] ArtMethod* method,
+                    [[maybe_unused]] instrumentation::OptionalFrame frame,
+                    [[maybe_unused]] MutableHandle<mirror::Object>& return_value) override
+      REQUIRES_SHARED(Locks::mutator_lock_) {
     received_method_exit_object_event = true;
   }
 
-  void MethodExited(Thread* thread ATTRIBUTE_UNUSED,
-                    ArtMethod* method ATTRIBUTE_UNUSED,
-                    instrumentation::OptionalFrame frame ATTRIBUTE_UNUSED,
-                    JValue& return_value ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_) {
+  void MethodExited([[maybe_unused]] Thread* thread,
+                    [[maybe_unused]] ArtMethod* method,
+                    [[maybe_unused]] instrumentation::OptionalFrame frame,
+                    [[maybe_unused]] JValue& return_value) override
+      REQUIRES_SHARED(Locks::mutator_lock_) {
     received_method_exit_event = true;
   }
 
-  void MethodUnwind(Thread* thread ATTRIBUTE_UNUSED,
-                    ArtMethod* method ATTRIBUTE_UNUSED,
-                    uint32_t dex_pc ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_) {
+  void MethodUnwind([[maybe_unused]] Thread* thread,
+                    [[maybe_unused]] ArtMethod* method,
+                    [[maybe_unused]] uint32_t dex_pc) override
+      REQUIRES_SHARED(Locks::mutator_lock_) {
     received_method_unwind_event = true;
   }
 
-  void DexPcMoved(Thread* thread ATTRIBUTE_UNUSED,
-                  Handle<mirror::Object> this_object ATTRIBUTE_UNUSED,
-                  ArtMethod* method ATTRIBUTE_UNUSED,
-                  uint32_t new_dex_pc ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_) {
+  void DexPcMoved([[maybe_unused]] Thread* thread,
+                  [[maybe_unused]] Handle<mirror::Object> this_object,
+                  [[maybe_unused]] ArtMethod* method,
+                  [[maybe_unused]] uint32_t new_dex_pc) override
+      REQUIRES_SHARED(Locks::mutator_lock_) {
     received_dex_pc_moved_event = true;
   }
 
-  void FieldRead(Thread* thread ATTRIBUTE_UNUSED,
-                 Handle<mirror::Object> this_object ATTRIBUTE_UNUSED,
-                 ArtMethod* method ATTRIBUTE_UNUSED,
-                 uint32_t dex_pc ATTRIBUTE_UNUSED,
-                 ArtField* field ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_) {
+  void FieldRead([[maybe_unused]] Thread* thread,
+                 [[maybe_unused]] Handle<mirror::Object> this_object,
+                 [[maybe_unused]] ArtMethod* method,
+                 [[maybe_unused]] uint32_t dex_pc,
+                 [[maybe_unused]] ArtField* field) override REQUIRES_SHARED(Locks::mutator_lock_) {
     received_field_read_event = true;
   }
 
-  void FieldWritten(Thread* thread ATTRIBUTE_UNUSED,
-                    Handle<mirror::Object> this_object ATTRIBUTE_UNUSED,
-                    ArtMethod* method ATTRIBUTE_UNUSED,
-                    uint32_t dex_pc ATTRIBUTE_UNUSED,
-                    ArtField* field ATTRIBUTE_UNUSED,
-                    Handle<mirror::Object> field_value ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_) {
+  void FieldWritten([[maybe_unused]] Thread* thread,
+                    [[maybe_unused]] Handle<mirror::Object> this_object,
+                    [[maybe_unused]] ArtMethod* method,
+                    [[maybe_unused]] uint32_t dex_pc,
+                    [[maybe_unused]] ArtField* field,
+                    [[maybe_unused]] Handle<mirror::Object> field_value) override
+      REQUIRES_SHARED(Locks::mutator_lock_) {
     received_field_written_object_event = true;
   }
 
-  void FieldWritten(Thread* thread ATTRIBUTE_UNUSED,
-                    Handle<mirror::Object> this_object ATTRIBUTE_UNUSED,
-                    ArtMethod* method ATTRIBUTE_UNUSED,
-                    uint32_t dex_pc ATTRIBUTE_UNUSED,
-                    ArtField* field ATTRIBUTE_UNUSED,
-                    const JValue& field_value ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_) {
+  void FieldWritten([[maybe_unused]] Thread* thread,
+                    [[maybe_unused]] Handle<mirror::Object> this_object,
+                    [[maybe_unused]] ArtMethod* method,
+                    [[maybe_unused]] uint32_t dex_pc,
+                    [[maybe_unused]] ArtField* field,
+                    [[maybe_unused]] const JValue& field_value) override
+      REQUIRES_SHARED(Locks::mutator_lock_) {
     received_field_written_event = true;
   }
 
-  void ExceptionThrown(Thread* thread ATTRIBUTE_UNUSED,
-                       Handle<mirror::Throwable> exception_object ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_) {
+  void ExceptionThrown([[maybe_unused]] Thread* thread,
+                       [[maybe_unused]] Handle<mirror::Throwable> exception_object) override
+      REQUIRES_SHARED(Locks::mutator_lock_) {
     received_exception_thrown_event = true;
   }
 
-  void ExceptionHandled(Thread* self ATTRIBUTE_UNUSED,
-                        Handle<mirror::Throwable> throwable ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_) {
+  void ExceptionHandled([[maybe_unused]] Thread* self,
+                        [[maybe_unused]] Handle<mirror::Throwable> throwable) override
+      REQUIRES_SHARED(Locks::mutator_lock_) {
     received_exception_handled_event = true;
   }
 
-  void Branch(Thread* thread ATTRIBUTE_UNUSED,
-              ArtMethod* method ATTRIBUTE_UNUSED,
-              uint32_t dex_pc ATTRIBUTE_UNUSED,
-              int32_t dex_pc_offset ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_) {
+  void Branch([[maybe_unused]] Thread* thread,
+              [[maybe_unused]] ArtMethod* method,
+              [[maybe_unused]] uint32_t dex_pc,
+              [[maybe_unused]] int32_t dex_pc_offset) override
+      REQUIRES_SHARED(Locks::mutator_lock_) {
     received_branch_event = true;
   }
 
-  void WatchedFramePop(Thread* thread ATTRIBUTE_UNUSED, const ShadowFrame& frame ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_) {
+  void WatchedFramePop([[maybe_unused]] Thread* thread,
+                       [[maybe_unused]] const ShadowFrame& frame) override
+      REQUIRES_SHARED(Locks::mutator_lock_) {
     received_watched_frame_pop  = true;
   }
 
diff --git a/runtime/intern_table-inl.h b/runtime/intern_table-inl.h
index 84b730e..2640ef8 100644
--- a/runtime/intern_table-inl.h
+++ b/runtime/intern_table-inl.h
@@ -22,11 +22,11 @@
 #include "dex/utf.h"
 #include "gc/space/image_space.h"
 #include "gc_root-inl.h"
-#include "image.h"
 #include "mirror/string-inl.h"
+#include "oat/image.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 ALWAYS_INLINE
 inline uint32_t InternTable::Utf8String::Hash(uint32_t utf16_length, const char* utf8_data) {
diff --git a/runtime/intern_table.cc b/runtime/intern_table.cc
index 10b2d65..670fd58 100644
--- a/runtime/intern_table.cc
+++ b/runtime/intern_table.cc
@@ -24,17 +24,17 @@
 #include "gc/weak_root_state.h"
 #include "gc_root-inl.h"
 #include "handle_scope-inl.h"
-#include "image-inl.h"
 #include "mirror/dex_cache-inl.h"
 #include "mirror/object-inl.h"
 #include "mirror/object_array-inl.h"
 #include "mirror/string-inl.h"
+#include "oat/image-inl.h"
 #include "object_callbacks.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread.h"
 #include "thread-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 InternTable::InternTable()
     : log_new_roots_(false),
diff --git a/runtime/intern_table.h b/runtime/intern_table.h
index 0fcada1..6a76c74 100644
--- a/runtime/intern_table.h
+++ b/runtime/intern_table.h
@@ -20,11 +20,12 @@
 #include "base/dchecked_vector.h"
 #include "base/gc_visited_arena_pool.h"
 #include "base/hash_set.h"
+#include "base/macros.h"
 #include "base/mutex.h"
 #include "gc/weak_root_state.h"
 #include "gc_root.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class IsMarkedVisitor;
 
@@ -116,20 +117,19 @@
               StringEquals,
               GcRootArenaAllocator<GcRoot<mirror::String>, kAllocatorTagInternTable>>;
 
-  InternTable();
+  EXPORT InternTable();
 
   // Interns a potentially new string in the 'strong' table. May cause thread suspension.
-  ObjPtr<mirror::String> InternStrong(uint32_t utf16_length, const char* utf8_data)
+  EXPORT ObjPtr<mirror::String> InternStrong(uint32_t utf16_length, const char* utf8_data)
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   // Interns a potentially new string in the 'strong' table. May cause thread suspension.
-  ObjPtr<mirror::String> InternStrong(const char* utf8_data) REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(!Roles::uninterruptible_);
+  EXPORT ObjPtr<mirror::String> InternStrong(const char* utf8_data)
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   // Interns a potentially new string in the 'strong' table. May cause thread suspension.
-  ObjPtr<mirror::String> InternStrong(ObjPtr<mirror::String> s)
-      REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(!Roles::uninterruptible_);
+  EXPORT ObjPtr<mirror::String> InternStrong(ObjPtr<mirror::String> s)
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   // Interns a potentially new string in the 'weak' table. May cause thread suspension.
   ObjPtr<mirror::String> InternWeak(const char* utf8_data) REQUIRES_SHARED(Locks::mutator_lock_)
@@ -160,7 +160,7 @@
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::intern_table_lock_);
 
   // Total number of interned strings.
-  size_t Size() const REQUIRES(!Locks::intern_table_lock_);
+  EXPORT size_t Size() const REQUIRES(!Locks::intern_table_lock_);
 
   // Total number of weakly live interned strings.
   size_t StrongSize() const REQUIRES(!Locks::intern_table_lock_);
@@ -168,7 +168,7 @@
   // Total number of strongly live interned strings.
   size_t WeakSize() const REQUIRES(!Locks::intern_table_lock_);
 
-  void VisitRoots(RootVisitor* visitor, VisitRootFlags flags)
+  EXPORT void VisitRoots(RootVisitor* visitor, VisitRootFlags flags)
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Locks::intern_table_lock_);
 
   // Visit all of the interns in the table.
@@ -292,7 +292,7 @@
       REQUIRES(!Locks::intern_table_lock_) REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Note: Transaction rollback calls these helper functions directly.
-  ObjPtr<mirror::String> InsertStrong(ObjPtr<mirror::String> s, uint32_t hash)
+  EXPORT ObjPtr<mirror::String> InsertStrong(ObjPtr<mirror::String> s, uint32_t hash)
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::intern_table_lock_);
   ObjPtr<mirror::String> InsertWeak(ObjPtr<mirror::String> s, uint32_t hash)
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::intern_table_lock_);
diff --git a/runtime/intern_table_test.cc b/runtime/intern_table_test.cc
index d77ffcb..e8aeb0d 100644
--- a/runtime/intern_table_test.cc
+++ b/runtime/intern_table_test.cc
@@ -25,7 +25,7 @@
 #include "mirror/string.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class InternTableTest : public CommonRuntimeTest {
  protected:
diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc
index 3ca531f..6097077 100644
--- a/runtime/interpreter/interpreter.cc
+++ b/runtime/interpreter/interpreter.cc
@@ -35,7 +35,7 @@
 #include "thread-inl.h"
 #include "unstarted_runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace interpreter {
 
 ALWAYS_INLINE static ObjPtr<mirror::Object> ObjArg(uint32_t arg)
@@ -272,7 +272,10 @@
     ArtMethod *method = shadow_frame.GetMethod();
 
     // If we can continue in JIT and have JITed code available execute JITed code.
-    if (!stay_in_interpreter && !self->IsForceInterpreter() && !shadow_frame.GetForcePopFrame()) {
+    if (!stay_in_interpreter &&
+        !self->IsForceInterpreter() &&
+        !shadow_frame.GetForcePopFrame() &&
+        !shadow_frame.GetNotifyDexPcMoveEvents()) {
       jit::Jit* jit = Runtime::Current()->GetJit();
       if (jit != nullptr) {
         jit->MethodEntered(self, shadow_frame.GetMethod());
@@ -377,7 +380,7 @@
     return;
   } else {
     DCHECK(method->IsNative()) << method->PrettyMethod();
-    num_regs = num_ins = ArtMethod::NumArgRegisters(method->GetShorty());
+    num_regs = num_ins = ArtMethod::NumArgRegisters(method->GetShortyView());
     if (!method->IsStatic()) {
       num_regs++;
       num_ins++;
diff --git a/runtime/interpreter/interpreter.h b/runtime/interpreter/interpreter.h
index f7bc1a3..c7508f6 100644
--- a/runtime/interpreter/interpreter.h
+++ b/runtime/interpreter/interpreter.h
@@ -18,10 +18,11 @@
 #define ART_RUNTIME_INTERPRETER_INTERPRETER_H_
 
 #include "base/locks.h"
+#include "base/macros.h"
 #include "dex/dex_file.h"
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 class Object;
 }  // namespace mirror
diff --git a/runtime/interpreter/interpreter_cache-inl.h b/runtime/interpreter/interpreter_cache-inl.h
index 804d382..a325ea4 100644
--- a/runtime/interpreter/interpreter_cache-inl.h
+++ b/runtime/interpreter/interpreter_cache-inl.h
@@ -21,7 +21,7 @@
 
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 inline bool InterpreterCache::Get(Thread* self, const void* key, /* out */ size_t* value) {
   DCHECK(self->GetInterpreterCache() == this) << "Must be called from owning thread";
diff --git a/runtime/interpreter/interpreter_cache.cc b/runtime/interpreter/interpreter_cache.cc
index 7e7b294..a272d14 100644
--- a/runtime/interpreter/interpreter_cache.cc
+++ b/runtime/interpreter/interpreter_cache.cc
@@ -17,7 +17,7 @@
 #include "interpreter_cache.h"
 #include "thread-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 void InterpreterCache::Clear(Thread* owning_thread) {
   DCHECK(owning_thread->GetInterpreterCache() == this);
diff --git a/runtime/interpreter/interpreter_cache.h b/runtime/interpreter/interpreter_cache.h
index 8714bc6..410fdf5 100644
--- a/runtime/interpreter/interpreter_cache.h
+++ b/runtime/interpreter/interpreter_cache.h
@@ -23,7 +23,7 @@
 #include "base/bit_utils.h"
 #include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class Thread;
 
@@ -60,7 +60,7 @@
   }
 
   // Clear the whole cache. It requires the owning thread for DCHECKs.
-  void Clear(Thread* owning_thread);
+  EXPORT void Clear(Thread* owning_thread);
 
   ALWAYS_INLINE bool Get(Thread* self, const void* key, /* out */ size_t* value);
 
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc
index ac9980f..85ed318 100644
--- a/runtime/interpreter/interpreter_common.cc
+++ b/runtime/interpreter/interpreter_common.cc
@@ -26,6 +26,7 @@
 #include "entrypoints/runtime_asm_entrypoints.h"
 #include "handle.h"
 #include "intrinsics_enum.h"
+#include "intrinsics_list.h"
 #include "jit/jit.h"
 #include "jvalue-inl.h"
 #include "method_handles-inl.h"
@@ -49,7 +50,7 @@
 #include "var_handles.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace interpreter {
 
 void ThrowNullPointerExceptionFromInterpreter() {
@@ -451,44 +452,75 @@
     return false;
   }
 
-  StackHandleScope<2> hs(self);
   bool is_var_args = inst->HasVarArgs();
+  const uint32_t vRegC = is_var_args ? inst->VRegC_45cc() : inst->VRegC_4rcc();
   const uint16_t vRegH = is_var_args ? inst->VRegH_45cc() : inst->VRegH_4rcc();
+  StackHandleScope<4> hs(self);
+  Handle<mirror::VarHandle> var_handle = hs.NewHandle(
+      ObjPtr<mirror::VarHandle>::DownCast(shadow_frame.GetVRegReference(vRegC)));
+  ArtMethod* method = shadow_frame.GetMethod();
+  Handle<mirror::DexCache> dex_cache = hs.NewHandle(method->GetDexCache());
+  Handle<mirror::ClassLoader> class_loader = hs.NewHandle(method->GetClassLoader());
+  uint32_t var_args[Instruction::kMaxVarArgRegs];
+  std::optional<VarArgsInstructionOperands> var_args_operands(std::nullopt);
+  std::optional<RangeInstructionOperands> range_operands(std::nullopt);
+  InstructionOperands* all_operands;
+  if (is_var_args) {
+    inst->GetVarArgs(var_args, inst_data);
+    var_args_operands.emplace(var_args, inst->VRegA_45cc());
+    all_operands = &var_args_operands.value();
+  } else {
+    range_operands.emplace(inst->VRegC_4rcc(), inst->VRegA_4rcc());
+    all_operands = &range_operands.value();
+  }
+  NoReceiverInstructionOperands operands(all_operands);
   ClassLinker* const class_linker = Runtime::Current()->GetClassLinker();
+
+  // If the `ThreadLocalRandom` class is not yet initialized, do the `VarHandle` operation
+  // without creating a managed `MethodType` object. This avoids a circular initialization
+  // issue when `ThreadLocalRandom.<clinit>` indirectly calls `AtomicLong.compareAndSet()`
+  // (implemented with a `VarHandle`) and the `MethodType` caching circles back to the
+  // `ThreadLocalRandom` with uninitialized `seeder` and throws NPE.
+  //
+  // Do a quick test for "visibly initialized" without a read barrier and, if that fails,
+  // do a thorough test for "initialized" (including load acquire) with the read barrier.
+  ArtField* field = WellKnownClasses::java_util_concurrent_ThreadLocalRandom_seeder;
+  if (UNLIKELY(!field->GetDeclaringClass<kWithoutReadBarrier>()->IsVisiblyInitialized()) &&
+      !field->GetDeclaringClass()->IsInitialized()) {
+    VariableSizedHandleScope callsite_type_hs(self);
+    mirror::RawMethodType callsite_type(&callsite_type_hs);
+    if (!class_linker->ResolveMethodType(self,
+                                         dex::ProtoIndex(vRegH),
+                                         dex_cache,
+                                         class_loader,
+                                         callsite_type)) {
+      CHECK(self->IsExceptionPending());
+      return false;
+    }
+    return VarHandleInvokeAccessor(self,
+                                   shadow_frame,
+                                   var_handle,
+                                   callsite_type,
+                                   access_mode,
+                                   &operands,
+                                   result);
+  }
+
   Handle<mirror::MethodType> callsite_type(hs.NewHandle(
-      class_linker->ResolveMethodType(self, dex::ProtoIndex(vRegH), shadow_frame.GetMethod())));
+      class_linker->ResolveMethodType(self, dex::ProtoIndex(vRegH), dex_cache, class_loader)));
   // This implies we couldn't resolve one or more types in this VarHandle.
   if (UNLIKELY(callsite_type == nullptr)) {
     CHECK(self->IsExceptionPending());
     return false;
   }
 
-  const uint32_t vRegC = is_var_args ? inst->VRegC_45cc() : inst->VRegC_4rcc();
-  ObjPtr<mirror::Object> receiver(shadow_frame.GetVRegReference(vRegC));
-  Handle<mirror::VarHandle> var_handle(hs.NewHandle(ObjPtr<mirror::VarHandle>::DownCast(receiver)));
-  if (is_var_args) {
-    uint32_t args[Instruction::kMaxVarArgRegs];
-    inst->GetVarArgs(args, inst_data);
-    VarArgsInstructionOperands all_operands(args, inst->VRegA_45cc());
-    NoReceiverInstructionOperands operands(&all_operands);
-    return VarHandleInvokeAccessor(self,
-                                   shadow_frame,
-                                   var_handle,
-                                   callsite_type,
-                                   access_mode,
-                                   &operands,
-                                   result);
-  } else {
-    RangeInstructionOperands all_operands(inst->VRegC_4rcc(), inst->VRegA_4rcc());
-    NoReceiverInstructionOperands operands(&all_operands);
-    return VarHandleInvokeAccessor(self,
-                                   shadow_frame,
-                                   var_handle,
-                                   callsite_type,
-                                   access_mode,
-                                   &operands,
-                                   result);
-  }
+  return VarHandleInvokeAccessor(self,
+                                 shadow_frame,
+                                 var_handle,
+                                 callsite_type,
+                                 access_mode,
+                                 &operands,
+                                 result);
 }
 
 #define DO_VAR_HANDLE_ACCESSOR(_access_mode)                                                \
@@ -555,10 +587,7 @@
 #define CASE_SIGNATURE_POLYMORPHIC_INTRINSIC(Name, ...) \
     case Intrinsics::k##Name:                           \
       return Do ## Name(self, shadow_frame, inst, inst_data, result);
-#include "intrinsics_list.h"
-    SIGNATURE_POLYMORPHIC_INTRINSICS_LIST(CASE_SIGNATURE_POLYMORPHIC_INTRINSIC)
-#undef INTRINSICS_LIST
-#undef SIGNATURE_POLYMORPHIC_INTRINSICS_LIST
+    ART_SIGNATURE_POLYMORPHIC_INTRINSICS_LIST(CASE_SIGNATURE_POLYMORPHIC_INTRINSIC)
 #undef CASE_SIGNATURE_POLYMORPHIC_INTRINSIC
     default:
       LOG(FATAL) << "Unreachable: " << invoke_method->GetIntrinsic();
@@ -609,6 +638,8 @@
     case EncodedArrayValueIterator::ValueType::kAnnotation:
     case EncodedArrayValueIterator::ValueType::kNull:
       return nullptr;
+    case EncodedArrayValueIterator::ValueType::kEndOfInput:
+      UNREACHABLE();
   }
 }
 
@@ -691,6 +722,8 @@
       // determining the effect call site type based on the bootstrap
       // argument types.
       UNREACHABLE();
+    case EncodedArrayValueIterator::ValueType::kEndOfInput:
+      UNREACHABLE();
   }
 }
 
@@ -734,6 +767,8 @@
       // determining the effect call site type based on the bootstrap
       // argument types.
       UNREACHABLE();
+    case EncodedArrayValueIterator::ValueType::kEndOfInput:
+      UNREACHABLE();
   }
 }
 
diff --git a/runtime/interpreter/interpreter_common.h b/runtime/interpreter/interpreter_common.h
index b8d6817..0745a00 100644
--- a/runtime/interpreter/interpreter_common.h
+++ b/runtime/interpreter/interpreter_common.h
@@ -47,6 +47,7 @@
 #include "handle_scope-inl.h"
 #include "interpreter_cache-inl.h"
 #include "interpreter_switch_impl.h"
+#include "intrinsics_list.h"
 #include "jit/jit-inl.h"
 #include "mirror/call_site.h"
 #include "mirror/class-inl.h"
@@ -62,9 +63,8 @@
 #include "thread-inl.h"
 #include "unstarted_runtime.h"
 #include "verifier/method_verifier.h"
-#include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace interpreter {
 
 void ThrowNullPointerExceptionFromInterpreter()
@@ -235,9 +235,7 @@
                 const Instruction* inst,                              \
                 uint16_t inst_data,                                   \
                 JValue* result) REQUIRES_SHARED(Locks::mutator_lock_);
-#include "intrinsics_list.h"
-INTRINSICS_LIST(DECLARE_SIGNATURE_POLYMORPHIC_HANDLER)
-#undef INTRINSICS_LIST
+ART_INTRINSICS_LIST(DECLARE_SIGNATURE_POLYMORPHIC_HANDLER)
 #undef DECLARE_SIGNATURE_POLYMORPHIC_HANDLER
 
 // Performs a invoke-polymorphic or invoke-polymorphic-range.
diff --git a/runtime/interpreter/interpreter_switch_impl-inl.h b/runtime/interpreter/interpreter_switch_impl-inl.h
index ddde26d..db20f39 100644
--- a/runtime/interpreter/interpreter_switch_impl-inl.h
+++ b/runtime/interpreter/interpreter_switch_impl-inl.h
@@ -40,7 +40,7 @@
 #include "thread.h"
 #include "verifier/method_verifier.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace interpreter {
 
 // Short-lived helper class which executes single DEX bytecode.  It is inlined by compiler.
diff --git a/runtime/interpreter/interpreter_switch_impl.h b/runtime/interpreter/interpreter_switch_impl.h
index 3a42c21..c390692 100644
--- a/runtime/interpreter/interpreter_switch_impl.h
+++ b/runtime/interpreter/interpreter_switch_impl.h
@@ -24,7 +24,7 @@
 #include "jvalue.h"
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ShadowFrame;
 class Thread;
diff --git a/runtime/interpreter/interpreter_switch_impl0.cc b/runtime/interpreter/interpreter_switch_impl0.cc
index b4e5f50..65ae2fe 100644
--- a/runtime/interpreter/interpreter_switch_impl0.cc
+++ b/runtime/interpreter/interpreter_switch_impl0.cc
@@ -19,7 +19,7 @@
 
 #include "interpreter_switch_impl-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace interpreter {
 
 // Explicit definition of ExecuteSwitchImplCpp.
diff --git a/runtime/interpreter/interpreter_switch_impl1.cc b/runtime/interpreter/interpreter_switch_impl1.cc
index f8f9fcc..b9033d9 100644
--- a/runtime/interpreter/interpreter_switch_impl1.cc
+++ b/runtime/interpreter/interpreter_switch_impl1.cc
@@ -19,7 +19,7 @@
 
 #include "interpreter_switch_impl-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace interpreter {
 
 // Explicit definition of ExecuteSwitchImplCpp.
diff --git a/runtime/interpreter/lock_count_data.cc b/runtime/interpreter/lock_count_data.cc
index 64b59cd..ad53d70 100644
--- a/runtime/interpreter/lock_count_data.cc
+++ b/runtime/interpreter/lock_count_data.cc
@@ -23,7 +23,7 @@
 #include "mirror/object-inl.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 void LockCountData::AddMonitor(Thread* self, mirror::Object* obj) {
   if (obj == nullptr) {
diff --git a/runtime/interpreter/lock_count_data.h b/runtime/interpreter/lock_count_data.h
index efa14c5..ec108fc 100644
--- a/runtime/interpreter/lock_count_data.h
+++ b/runtime/interpreter/lock_count_data.h
@@ -21,8 +21,9 @@
 #include <vector>
 
 #include "base/locks.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Object;
diff --git a/runtime/interpreter/mterp/arm64ng/arithmetic.S b/runtime/interpreter/mterp/arm64ng/arithmetic.S
index cf9dd86..f751f99 100644
--- a/runtime/interpreter/mterp/arm64ng/arithmetic.S
+++ b/runtime/interpreter/mterp/arm64ng/arithmetic.S
@@ -141,21 +141,22 @@
      *      xor-long, add-double, sub-double, mul-double, div-double, rem-double
      */
     /* binop vAA, vBB, vCC */
-    FETCH w0, 1                         // w0<- CCBB
-    lsr     w4, wINST, #8               // w4<- AA
-    lsr     w2, w0, #8                  // w2<- CC
-    and     w1, w0, #255                // w1<- BB
-    GET_VREG_WIDE $r2, w2               // w2<- vCC
-    GET_VREG_WIDE $r1, w1               // w1<- vBB
+    FETCH w0, 1                           // w0<- CCBB
+    LOAD_SCALED_VREG_MASK w5, 0xff        // w5<- ff * sizeof(vreg)
+    EXTRACT_SCALED_VREG w4, w5, wINST, 8  // w4<- AA * sizeof(vreg)
+    EXTRACT_SCALED_VREG w2, w5, w0, 8     // w2<- CC * sizeof(vreg)
+    EXTRACT_SCALED_VREG w1, w5, w0, 0     // w1<- BB * sizeof(vreg)
+    GET_VREG_WIDE_PRESCALED $r2, w2       // w2<- vCC
+    GET_VREG_WIDE_PRESCALED $r1, w1       // w1<- vBB
     .if $chkzero
-    cbz     $r2, common_errDivideByZero  // is second operand zero?
+    cbz     $r2, common_errDivideByZero   // is second operand zero?
     .endif
-    FETCH_ADVANCE_INST 2                // advance rPC, load rINST
+    FETCH_ADVANCE_INST 2                  // advance rPC, load rINST
     $preinstr
-    $instr                              // $result<- op, w0-w4 changed
-    GET_INST_OPCODE ip                  // extract opcode from rINST
-    SET_VREG_WIDE $result, w4           // vAA<- $result
-    GOTO_OPCODE ip                      // jump to next instruction
+    $instr                                // $result<- op, w0-w4 changed
+    GET_INST_OPCODE ip                    // extract opcode from rINST
+    SET_VREG_WIDE_PRESCALED $result, w4   // vAA<- $result
+    GOTO_OPCODE ip                        // jump to next instruction
     /* 11-14 instructions */
 
 %def binopWide2addr(preinstr="", instr="add x0, x0, x1", r0="x0", r1="x1", chkzero="0"):
@@ -300,11 +301,12 @@
 
 %def op_cmp_long():
     FETCH w0, 1                         // w0<- CCBB
+    LOAD_SCALED_VREG_MASK w5, 0xff      // w4<- ff * sizeof(vreg)
     lsr     w4, wINST, #8               // w4<- AA
-    and     w2, w0, #255                // w2<- BB
-    lsr     w3, w0, #8                  // w3<- CC
-    GET_VREG_WIDE x1, w2
-    GET_VREG_WIDE x2, w3
+    EXTRACT_SCALED_VREG w2, w5, w0, 0   // w2<- BB * sizeof(vreg)
+    EXTRACT_SCALED_VREG w3, w5, w0, 8   // w3<- CC * sizeof(vreg)
+    GET_VREG_WIDE_PRESCALED x1, w2
+    GET_VREG_WIDE_PRESCALED x2, w3
     cmp     x1, x2
     cset    w0, ne
     cneg    w0, w0, lt
diff --git a/runtime/interpreter/mterp/arm64ng/array.S b/runtime/interpreter/mterp/arm64ng/array.S
index 1689b01..a08fbe1 100644
--- a/runtime/interpreter/mterp/arm64ng/array.S
+++ b/runtime/interpreter/mterp/arm64ng/array.S
@@ -23,6 +23,7 @@
     GOTO_OPCODE x10                     // jump to next instruction
     .elseif $is_object
     $load   w2, [x0, #$data_offset]     // w2<- vBB[vCC]
+    UNPOISON_HEAP_REF w2
     TEST_IF_MARKING 2f
 1:
     SET_VREG_OBJECT w2, w9              // vAA<- w2
diff --git a/runtime/interpreter/mterp/arm64ng/floating_point.S b/runtime/interpreter/mterp/arm64ng/floating_point.S
index ad42db3..a91fcf7 100644
--- a/runtime/interpreter/mterp/arm64ng/floating_point.S
+++ b/runtime/interpreter/mterp/arm64ng/floating_point.S
@@ -69,20 +69,24 @@
     SET_VREG_DOUBLE $r0, w2             // vAA<- result
     GOTO_OPCODE ip                      // jump to next instruction
 
-%def fcmp(wide="", r1="s1", r2="s2", cond="lt"):
+%def fcmp(r1="s1", r2="s2", cond="lt"):
     /*
      * Compare two floating-point values.  Puts 0, 1, or -1 into the
      * destination register based on the results of the comparison.
      */
     /* op vAA, vBB, vCC */
     FETCH w0, 1                         // w0<- CCBB
+%  if r1.startswith("d"):
+    LOAD_SCALED_VREG_MASK w5, 0xff      // w4<- ff * sizeof(vreg)
+    lsr     w4, wINST, #8               // w4<- AA
+    EXTRACT_SCALED_VREG w2, w5, w0, 0   // w2<- BB * sizeof(vreg)
+    EXTRACT_SCALED_VREG w3, w5, w0, 8   // w3<- CC * sizeof(vreg)
+    GET_VREG_DOUBLE_PRESCALED $r1, w2
+    GET_VREG_DOUBLE_PRESCALED $r2, w3
+%  else:
     lsr     w4, wINST, #8               // w4<- AA
     and     w2, w0, #255                // w2<- BB
     lsr     w3, w0, #8                  // w3<- CC
-%  if r1.startswith("d"):
-    GET_VREG_DOUBLE $r1, w2
-    GET_VREG_DOUBLE $r2, w3
-%  else:
     GET_VREG $r1, w2
     GET_VREG $r2, w3
 %  #endif
@@ -188,16 +192,16 @@
 %  fbinop2addr(instr="fadd   s2, s0, s1")
 
 %def op_cmpg_double():
-%  fcmp(wide="_WIDE", r1="d1", r2="d2", cond="cc")
+%  fcmp(r1="d1", r2="d2", cond="cc")
 
 %def op_cmpg_float():
-%  fcmp(wide="", r1="s1", r2="s2", cond="cc")
+%  fcmp(r1="s1", r2="s2", cond="cc")
 
 %def op_cmpl_double():
-%  fcmp(wide="_WIDE", r1="d1", r2="d2", cond="lt")
+%  fcmp(r1="d1", r2="d2", cond="lt")
 
 %def op_cmpl_float():
-%  fcmp(wide="", r1="s1", r2="s2", cond="lt")
+%  fcmp(r1="s1", r2="s2", cond="lt")
 
 %def op_div_double():
 %  fbinopWide(instr="fdiv d0, d1, d2", result="d0", r1="d1", r2="d2")
diff --git a/runtime/interpreter/mterp/arm64ng/invoke.S b/runtime/interpreter/mterp/arm64ng/invoke.S
index 9dd7b64..cfc012b 100644
--- a/runtime/interpreter/mterp/arm64ng/invoke.S
+++ b/runtime/interpreter/mterp/arm64ng/invoke.S
@@ -70,10 +70,11 @@
    b NterpCommonInvokePolymorphicRange
 
 %def invoke_interface(range=""):
+%  slow_path = add_slow_path(invoke_interface_slow_path, range)
    EXPORT_PC
    // Fast-path which gets the method from thread-local cache.
-%  fetch_from_thread_cache("x26", miss_label="5f")
-1:
+%  fetch_from_thread_cache("x26", miss_label=slow_path)
+.L${opcode}_resume:
    // First argument is the 'this' pointer.
    FETCH w1, 2
    .if !$range
@@ -82,13 +83,14 @@
    GET_VREG w1, w1
    // Note: if w1 is null, this will be handled by our SIGSEGV handler.
    ldr w2, [x1, #MIRROR_OBJECT_CLASS_OFFSET]
+   UNPOISON_HEAP_REF w2
    // Test the first two bits of the fetched ArtMethod:
    // - If the first bit is set, this is a method on j.l.Object
    // - If the second bit is set, this is a default method.
    tst w26, #0x3
-   b.ne 3f
+   b.ne 2f
    ldrh w3, [x26, #ART_METHOD_IMT_INDEX_OFFSET]
-2:
+1:
    ldr x2, [x2, #MIRROR_CLASS_IMT_PTR_OFFSET_64]
    ldr x0, [x2, w3, uxtw #3]
    .if $range
@@ -96,13 +98,13 @@
    .else
    b NterpCommonInvokeInterface
    .endif
-3:
-   tbnz w26, #0, 4f
+2:
+   tbnz w26, #0, 3f
    and x26, x26, #-4
    ldrh w3, [x26, #ART_METHOD_METHOD_INDEX_OFFSET]
    and w3, w3, #ART_METHOD_IMT_MASK
-   b 2b
-4:
+   b 1b
+3:
    lsr w26, w26, #16
    add w2, w2, #MIRROR_CLASS_VTABLE_OFFSET_64
    ldr x0, [x2, w26, uxtw #3]
@@ -111,13 +113,14 @@
    .else
    b NterpCommonInvokeInstance
    .endif
-5:
+
+%def invoke_interface_slow_path(range):
    mov x0, xSELF
    ldr x1, [sp]
    mov x2, xPC
    bl nterp_get_method
    mov x26, x0
-   b 1b
+   b .L${opcode}_resume
 
 %def op_invoke_interface():
 %  invoke_interface(range="0")
@@ -155,6 +158,7 @@
    GET_VREG w1, w1
    // Note: if w1 is null, this will be handled by our SIGSEGV handler.
    ldr w0, [x1, #MIRROR_OBJECT_CLASS_OFFSET]
+   UNPOISON_HEAP_REF w0
    add w0, w0, #MIRROR_CLASS_VTABLE_OFFSET_64
    ldr x0, [x0, w2, uxtw #3]
    b $helper
diff --git a/runtime/interpreter/mterp/arm64ng/main.S b/runtime/interpreter/mterp/arm64ng/main.S
index 424d060..602273f 100644
--- a/runtime/interpreter/mterp/arm64ng/main.S
+++ b/runtime/interpreter/mterp/arm64ng/main.S
@@ -203,25 +203,39 @@
 /*
  * Get/set the 64-bit value from a Dalvik register.
  */
+.macro LOAD_SCALED_VREG_MASK scaled_mask_reg, unscaled_mask
+    mov     \scaled_mask_reg, \unscaled_mask << 2
+.endm
+.macro EXTRACT_SCALED_VREG scaled_vreg, scaled_mask_reg, src_reg, lsb
+    .if \lsb < 2
+    and     \scaled_vreg, \scaled_mask_reg, \src_reg, lsl #(2 - \lsb)
+    .else
+    and     \scaled_vreg, \scaled_mask_reg, \src_reg, lsr #(\lsb - 2)
+    .endif
+.endm
+.macro GET_VREG_WIDE_PRESCALED reg, scaled_vreg
+    ldr     \reg, [xFP, \scaled_vreg, uxtw]
+.endm
 .macro GET_VREG_WIDE reg, vreg
-    add     ip2, xFP, \vreg, uxtw #2
-    ldr     \reg, [ip2]
+    lsl     wip2, \vreg, #2
+    GET_VREG_WIDE_PRESCALED \reg, wip2
+.endm
+.macro SET_VREG_WIDE_PRESCALED reg, scaled_vreg
+    str     \reg, [xFP, \scaled_vreg, uxtw]
+    str     xzr, [xREFS, \scaled_vreg, uxtw]
 .endm
 .macro SET_VREG_WIDE reg, vreg
-    add     ip2, xFP, \vreg, uxtw #2
-    str     \reg, [ip2]
-    add     ip2, xREFS, \vreg, uxtw #2
-    str     xzr, [ip2]
+    lsl     wip2, \vreg, #2
+    SET_VREG_WIDE_PRESCALED \reg, wip2
+.endm
+.macro GET_VREG_DOUBLE_PRESCALED reg, scaled_vreg
+    GET_VREG_WIDE_PRESCALED \reg, \scaled_vreg
 .endm
 .macro GET_VREG_DOUBLE reg, vreg
-    add     ip2, xFP, \vreg, uxtw #2
-    ldr     \reg, [ip2]
+    GET_VREG_WIDE \reg, \vreg
 .endm
 .macro SET_VREG_DOUBLE reg, vreg
-    add     ip2, xFP, \vreg, uxtw #2
-    str     \reg, [ip2]
-    add     ip2, xREFS, \vreg, uxtw #2
-    str     xzr, [ip2]
+    SET_VREG_WIDE \reg, \vreg
 .endm
 
 /*
@@ -232,18 +246,12 @@
     ldrsw   \reg, [xFP, \vreg, uxtw #2]
 .endm
 
-// An assembly entry that has a OatQuickMethodHeader prefix.
-.macro OAT_ENTRY name, end
+// An assembly entry for nterp.
+.macro OAT_ENTRY name
     .type \name, #function
     .hidden \name
     .global \name
     .balign 16
-    // Padding of 3 * 4 bytes to get 16 bytes alignment of code entry.
-    .long 0
-    .long 0
-    .long 0
-    // OatQuickMethodHeader. Note that the top two bits must be clear.
-    .long (\end - \name)
 \name:
 .endm
 
@@ -1404,6 +1412,12 @@
    GOTO_OPCODE ip
 .endm
 
+.macro POISON_HEAP_REF_IF_OBJECT is_object, rRef
+   .if \is_object
+   POISON_HEAP_REF \rRef
+   .endif
+.endm
+
 .macro WRITE_BARRIER_IF_OBJECT is_object, value, holder, label
    .if \is_object
    cbz     \value, \label
@@ -1592,20 +1606,22 @@
  *  rest  method parameters
  */
 
-OAT_ENTRY ExecuteNterpWithClinitImpl, EndExecuteNterpWithClinitImpl
+OAT_ENTRY ExecuteNterpWithClinitImpl
+    .cfi_startproc
     // For simplicity, we don't do a read barrier here, but instead rely
     // on art_quick_resolution_trampoline to always have a suspend point before
     // calling back here.
     ldr wip, [x0, #ART_METHOD_DECLARING_CLASS_OFFSET]
-    ldrb wip2, [ip, #MIRROR_CLASS_IS_VISIBLY_INITIALIZED_OFFSET]
-    cmp ip2, #MIRROR_CLASS_IS_VISIBLY_INITIALIZED_VALUE
+    ldr wip2, [ip, #MIRROR_CLASS_STATUS_OFFSET]
+    lsr wip2, wip2, #MIRROR_CLASS_STATUS_SHIFT
+    cmp wip2, #MIRROR_CLASS_STATUS_VISIBLY_INITIALIZED
     b.hs ExecuteNterpImpl
-    cmp ip2, #MIRROR_CLASS_IS_INITIALIZED_VALUE
+    cmp wip2, #MIRROR_CLASS_STATUS_INITIALIZED
     b.lo .Linitializing_check
     dmb ish
     b ExecuteNterpImpl
 .Linitializing_check:
-    cmp ip2, #MIRROR_CLASS_IS_INITIALIZING_VALUE
+    cmp wip2, #MIRROR_CLASS_STATUS_INITIALIZING
     b.lo .Lresolution_trampoline
     ldr wip2, [ip, #MIRROR_CLASS_CLINIT_THREAD_ID_OFFSET]
     ldr wip, [xSELF, #THREAD_TID_OFFSET]
@@ -1613,9 +1629,13 @@
     b.eq ExecuteNterpImpl
 .Lresolution_trampoline:
     b art_quick_resolution_trampoline
+    .cfi_endproc
+    .type EndExecuteNterpWithClinitImpl, #function
+    .hidden EndExecuteNterpWithClinitImpl
+    .global EndExecuteNterpWithClinitImpl
 EndExecuteNterpWithClinitImpl:
 
-OAT_ENTRY ExecuteNterpImpl, EndExecuteNterpImpl
+OAT_ENTRY ExecuteNterpImpl
     .cfi_startproc
     sub x16, sp, #STACK_OVERFLOW_RESERVED_BYTES
     ldr wzr, [x16]
diff --git a/runtime/interpreter/mterp/arm64ng/object.S b/runtime/interpreter/mterp/arm64ng/object.S
index b6a6e24..5202ebc 100644
--- a/runtime/interpreter/mterp/arm64ng/object.S
+++ b/runtime/interpreter/mterp/arm64ng/object.S
@@ -7,6 +7,7 @@
    GET_VREG w0, w2                     // w0<- vA (object)
    cbz     w0, .L${opcode}_resume
    ldr     w2, [x0, #MIRROR_OBJECT_CLASS_OFFSET]
+   UNPOISON_HEAP_REF w2
    // Fast path: do a comparison without read barrier.
    cmp     w1, w2
    bne     ${slow_path}
@@ -32,9 +33,11 @@
    ldr     w3, [x1, #MIRROR_CLASS_ACCESS_FLAGS_OFFSET]
    tbnz    w3, #MIRROR_CLASS_IS_INTERFACE_FLAG_BIT, 2f
    ldr     w3, [x1, #MIRROR_CLASS_COMPONENT_TYPE_OFFSET]
+   UNPOISON_HEAP_REF w3
    cbnz    w3, 5f
 1:
    ldr     w2, [x2, #MIRROR_CLASS_SUPER_CLASS_OFFSET]
+   UNPOISON_HEAP_REF w2
    cmp     w1, w2
    beq     .L${opcode}_resume
    cbnz    w2, 1b
@@ -50,9 +53,11 @@
 5:
    // Class in w1 is an array, w3 is the component type.
    ldr     w2, [x2, #MIRROR_CLASS_COMPONENT_TYPE_OFFSET]
+   UNPOISON_HEAP_REF w2
    // Check if object is an array.
    cbz     w2, 2b
    ldr     w4, [x3, #MIRROR_CLASS_SUPER_CLASS_OFFSET]
+   UNPOISON_HEAP_REF w4
    // If the super class of the component type is not null, go slow path.
    cbnz    w4, 2b
    ldrh    w3, [x3, #MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET]
@@ -74,6 +79,7 @@
    GET_VREG w0, w2                     // w0<- vB (object)
    cbz     w0, .L${opcode}_resume
    ldr     w2, [x0, #MIRROR_OBJECT_CLASS_OFFSET]
+   UNPOISON_HEAP_REF w2
    // Fast path: do a comparison without read barrier.
    cmp     w1, w2
    bne     ${slow_path}
@@ -101,9 +107,11 @@
    ldr     w3, [x1, #MIRROR_CLASS_ACCESS_FLAGS_OFFSET]
    tbnz    w3, #MIRROR_CLASS_IS_INTERFACE_FLAG_BIT, 5f
    ldr     w3, [x1, #MIRROR_CLASS_COMPONENT_TYPE_OFFSET]
+   UNPOISON_HEAP_REF w3
    cbnz    w3, 3f
 1:
    ldr     w2, [x2, #MIRROR_CLASS_SUPER_CLASS_OFFSET]
+   UNPOISON_HEAP_REF w2
    cmp     w1, w2
    beq     .L${opcode}_set_one
    cbnz    w2, 1b
@@ -113,10 +121,12 @@
 3:
    // Class in x1 is an array, x3 is the component type of x1, and x2 is the class of the object.
    ldr     w2, [x2, #MIRROR_CLASS_COMPONENT_TYPE_OFFSET]
+   UNPOISON_HEAP_REF w2
    // Check if object is an array.
    cbz     w2, 2b
    // Check of x1 is Object[]
    ldr     w4, [x3, #MIRROR_CLASS_SUPER_CLASS_OFFSET]
+   UNPOISON_HEAP_REF w4
    // If the super class is not Object, go to slow path.
    cbnz    w4, 5f
    // Super class is null, this could either be a primitive array or Object[].
@@ -161,6 +171,7 @@
    SET_VREG_WIDE x0, w2                // fp[A] <- value
    .elseif $is_object
    $load   w0, [x3, x0]
+   UNPOISON_HEAP_REF w0
    TEST_IF_MARKING .L${opcode}_read_barrier
 .L${opcode}_resume_after_read_barrier:
    SET_VREG_OBJECT w0, w2              // fp[A] <- value
@@ -196,6 +207,7 @@
    SET_VREG_WIDE x0, w2                // fp[A] <- value
    .elseif $is_object
    $volatile_load w0, [x3]
+   UNPOISON_HEAP_REF w0
    TEST_IF_MARKING .L${opcode}_read_barrier
    SET_VREG_OBJECT w0, w2              // fp[A] <- value
    .else
@@ -242,6 +254,7 @@
    .if $wide
    $store  x26, [x2, x0]
    .else
+   POISON_HEAP_REF_IF_OBJECT $is_object, w26
    $store  w26, [x2, x0]
    WRITE_BARRIER_IF_OBJECT $is_object, w26, w2, .L${opcode}_skip_write_barrier
    .endif
@@ -274,6 +287,7 @@
    .if $wide
    $volatile_store x26, [x3]
    .else
+   POISON_HEAP_REF_IF_OBJECT $is_object, w26
    $volatile_store w26, [x3]
    WRITE_BARRIER_IF_OBJECT $is_object, w26, w2, .L${opcode}_slow_path_skip_write_barrier
    .endif
@@ -314,6 +328,7 @@
    SET_VREG_WIDE x0, w2                // fp[A] <- value
    .elseif $is_object
    $load   w0, [x0, x1]
+   UNPOISON_HEAP_REF w0
    // No need to check the marking register, we know it's not set here.
 .L${opcode}_after_reference_load:
    SET_VREG_OBJECT w0, w2              // fp[A] <- value
@@ -328,6 +343,7 @@
    bl      art_quick_read_barrier_mark_reg00
    .if $is_object
    $load   w0, [x0, x1]
+   UNPOISON_HEAP_REF w0
 .L${opcode}_mark_after_load:
    // Here, we know the marking register is set.
    bl      art_quick_read_barrier_mark_reg00
@@ -356,6 +372,7 @@
    SET_VREG_WIDE x0, w2                // fp[A] <- value
    .elseif $is_object
    $volatile_load w0, [x0]
+   UNPOISON_HEAP_REF w0
    TEST_IF_MARKING .L${opcode}_mark_after_load
    SET_VREG_OBJECT w0, w2              // fp[A] <- value
    .else
@@ -406,6 +423,7 @@
    .if $wide
    $store  x26, [x0, x1]
    .else
+   POISON_HEAP_REF_IF_OBJECT $is_object, w26
    $store  w26, [x0, x1]
    WRITE_BARRIER_IF_OBJECT $is_object, w26, w0, .L${opcode}_skip_write_barrier
    .endif
@@ -442,6 +460,7 @@
    .if $wide
    $volatile_store    x26, [x1]
    .else
+   POISON_HEAP_REF_IF_OBJECT $is_object, w26
    $volatile_store    w26, [x1]
    WRITE_BARRIER_IF_OBJECT $is_object, w26, w0, .L${opcode}_slow_path_skip_write_barrier
    .endif
diff --git a/runtime/interpreter/mterp/armng/array.S b/runtime/interpreter/mterp/armng/array.S
index e685cbf..008081c 100644
--- a/runtime/interpreter/mterp/armng/array.S
+++ b/runtime/interpreter/mterp/armng/array.S
@@ -26,6 +26,7 @@
     GOTO_OPCODE ip                      @ jump to next instruction
     .elseif $is_object
     $load   r2, [r0, #$data_offset]     @ w2<- vBB[vCC]
+    UNPOISON_HEAP_REF r2
     TEST_IF_MARKING 2f
 1:
     GET_INST_OPCODE ip                  @ extract opcode from rINST
diff --git a/runtime/interpreter/mterp/armng/invoke.S b/runtime/interpreter/mterp/armng/invoke.S
index f12b18f..a4f76d8 100644
--- a/runtime/interpreter/mterp/armng/invoke.S
+++ b/runtime/interpreter/mterp/armng/invoke.S
@@ -87,6 +87,7 @@
    GET_VREG r1, r1
    // Note: if r1 is null, this will be handled by our SIGSEGV handler.
    ldr r2, [r1, #MIRROR_OBJECT_CLASS_OFFSET]
+   UNPOISON_HEAP_REF r2
    // Test the first two bits of the fetched ArtMethod:
    // - If the first bit is set, this is a method on j.l.Object
    // - If the second bit is set, this is a default method.
@@ -162,6 +163,7 @@
    GET_VREG r1, r1
    // Note: if r1 is null, this will be handled by our SIGSEGV handler.
    ldr r0, [r1, #MIRROR_OBJECT_CLASS_OFFSET]
+   UNPOISON_HEAP_REF r0
    add r0, r0, #MIRROR_CLASS_VTABLE_OFFSET_32
    ldr r0, [r0, r2, lsl #2]
    b $helper
diff --git a/runtime/interpreter/mterp/armng/main.S b/runtime/interpreter/mterp/armng/main.S
index 3647f3e..ec23572 100644
--- a/runtime/interpreter/mterp/armng/main.S
+++ b/runtime/interpreter/mterp/armng/main.S
@@ -241,19 +241,13 @@
     add     \reg, rFP, \vreg, lsl #2
 .endm
 
-// An assembly entry that has a OatQuickMethodHeader prefix.
-.macro OAT_ENTRY name, end
+// An assembly entry for nterp.
+.macro OAT_ENTRY name
     .arm
     .type \name, #function
     .hidden \name
     .global \name
     .balign 16
-    // Padding of 3 * 4 bytes to get 16 bytes alignment of code entry.
-    .long 0
-    .long 0
-    .long 0
-    // OatQuickMethodHeader. Note that the top two bits must be clear.
-    .long (\end - \name)
 \name:
 .endm
 
@@ -1451,6 +1445,12 @@
    GOTO_OPCODE ip
 .endm
 
+.macro POISON_HEAP_REF_IF_OBJECT is_object, rRef
+   .if \is_object
+   POISON_HEAP_REF \rRef
+   .endif
+.endm
+
 .macro WRITE_BARRIER_IF_OBJECT is_object, value, holder, label, tmp
    .if \is_object
    // In T32, we would use `SMART_CBZ \value, \label`
@@ -1611,29 +1611,34 @@
  *  rest  method parameters
  */
 
-OAT_ENTRY ExecuteNterpWithClinitImpl, EndExecuteNterpWithClinitImpl
+OAT_ENTRY ExecuteNterpWithClinitImpl
+    .cfi_startproc
     // For simplicity, we don't do a read barrier here, but instead rely
     // on art_quick_resolution_trampoline to always have a suspend point before
     // calling back here.
     ldr r4, [r0, ART_METHOD_DECLARING_CLASS_OFFSET]
-    ldrb ip, [r4, MIRROR_CLASS_IS_VISIBLY_INITIALIZED_OFFSET]
-    cmp ip, #MIRROR_CLASS_IS_VISIBLY_INITIALIZED_VALUE
+    ldr ip, [r4, MIRROR_CLASS_STATUS_OFFSET]
+    cmp ip, #MIRROR_CLASS_STATUS_VISIBLY_INITIALIZED_SHIFTED
     bcs ExecuteNterpImpl
-    cmp ip, #MIRROR_CLASS_IS_INITIALIZED_VALUE
+    cmp ip, #MIRROR_CLASS_STATUS_INITIALIZED_SHIFTED
     blo .Linitializing_check
     dmb ish
     b ExecuteNterpImpl
 .Linitializing_check:
-    cmp ip, #MIRROR_CLASS_IS_INITIALIZING_VALUE
+    cmp ip, #MIRROR_CLASS_STATUS_INITIALIZING_SHIFTED
     blo art_quick_resolution_trampoline
     ldr r4, [r4, #MIRROR_CLASS_CLINIT_THREAD_ID_OFFSET]
     ldr ip, [rSELF, #THREAD_TID_OFFSET]
     cmp r4, ip
     beq ExecuteNterpImpl
     b art_quick_resolution_trampoline
+    .cfi_endproc
+    .type EndExecuteNterpWithClinitImpl, #function
+    .hidden EndExecuteNterpWithClinitImpl
+    .global EndExecuteNterpWithClinitImpl
 EndExecuteNterpWithClinitImpl:
 
-OAT_ENTRY ExecuteNterpImpl, EndExecuteNterpImpl
+OAT_ENTRY ExecuteNterpImpl
     .cfi_startproc
     sub ip, sp, #STACK_OVERFLOW_RESERVED_BYTES
     ldr ip, [ip]
diff --git a/runtime/interpreter/mterp/armng/object.S b/runtime/interpreter/mterp/armng/object.S
index cde8cf9..9188592 100644
--- a/runtime/interpreter/mterp/armng/object.S
+++ b/runtime/interpreter/mterp/armng/object.S
@@ -8,6 +8,7 @@
    cmp     r0, #0
    beq     .L${opcode}_resume
    ldr     r2, [r0, #MIRROR_OBJECT_CLASS_OFFSET]
+   UNPOISON_HEAP_REF r2
    // Fast path: do a comparison without read barrier.
    cmp     r1, r2
    bne     ${slow_path}
@@ -29,10 +30,12 @@
    tst     r3, #MIRROR_CLASS_IS_INTERFACE_FLAG
    bne     2f
    ldr     r3, [r1, #MIRROR_CLASS_COMPONENT_TYPE_OFFSET]
+   UNPOISON_HEAP_REF r3
    cmp     r3, #0
    bne     5f
 1:
    ldr     r2, [r2, #MIRROR_CLASS_SUPER_CLASS_OFFSET]
+   UNPOISON_HEAP_REF r2
    cmp     r1, r2
    beq     .L${opcode}_resume
    cmp     r2, #0
@@ -49,10 +52,12 @@
 5:
    // Class in r1 is an array, r3 is the component type.
    ldr     r2, [r2, #MIRROR_CLASS_COMPONENT_TYPE_OFFSET]
+   UNPOISON_HEAP_REF r2
    // Check if object is an array.
    cmp     r2, #0
    beq     2b
    ldr     r4, [r3, #MIRROR_CLASS_SUPER_CLASS_OFFSET]
+   UNPOISON_HEAP_REF r4
    cmp     r4, #0
    // If the super class of the component type is not null, go slow path.
    bne     2b
@@ -75,6 +80,7 @@
    cmp     r0, #0
    beq     .L${opcode}_resume
    ldr     r2, [r0, #MIRROR_OBJECT_CLASS_OFFSET]
+   UNPOISON_HEAP_REF r2
    // Fast path: do a comparison without read barrier.
    cmp     r1, r2
    bne     ${slow_path}
@@ -103,10 +109,12 @@
    tst     r3, #MIRROR_CLASS_IS_INTERFACE_FLAG
    bne     5f
    ldr     r3, [r1, #MIRROR_CLASS_COMPONENT_TYPE_OFFSET]
+   UNPOISON_HEAP_REF r3
    cmp     r3, #0
    bne     3f
 1:
    ldr     r2, [r2, #MIRROR_CLASS_SUPER_CLASS_OFFSET]
+   UNPOISON_HEAP_REF r2
    cmp     r1, r2
    beq     .L${opcode}_set_one
    cmp     r2, #0
@@ -117,10 +125,12 @@
 3:
    // Class in r1 is an array, r3 is the component type.
    ldr     r2, [r2, #MIRROR_CLASS_COMPONENT_TYPE_OFFSET]
+   UNPOISON_HEAP_REF r2
    // Check if object is an array.
    cmp     r2, #0
    beq     2b
    ldr     r4, [r3, #MIRROR_CLASS_SUPER_CLASS_OFFSET]
+   UNPOISON_HEAP_REF r4
    cmp     r4, #0
    bne     5f
    ldrh    r3, [r3, #MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET]
@@ -167,6 +177,7 @@
    SET_VREG_WIDE_BY_ADDR r0, r1, r2    // fp[A] <- value
    .elseif $is_object
    $load   r0, [r3, r0]
+   UNPOISON_HEAP_REF r0
    TEST_IF_MARKING .L${opcode}_read_barrier
 .L${opcode}_resume_after_read_barrier:
    SET_VREG_OBJECT r0, r2              // fp[A] <- value
@@ -209,6 +220,7 @@
    $load   r0, [r3, r0]
    dmb     ish
    .if $is_object
+   UNPOISON_HEAP_REF r0
    TEST_IF_MARKING .L${opcode}_read_barrier
    SET_VREG_OBJECT r0, r2              // fp[A] <- value
    .else
@@ -257,6 +269,7 @@
    add     r1, r1, r0
    strd    r2, r3, [r1]
    .else
+   POISON_HEAP_REF_IF_OBJECT $is_object, r4
    $store  r4, [r1, r0]
    WRITE_BARRIER_IF_OBJECT $is_object, r4, r1, .L${opcode}_skip_write_barrier, r0
    .endif
@@ -301,6 +314,7 @@
    cmp     r1, #0
    beq     common_errNullObject
    dmb     ish
+   POISON_HEAP_REF_IF_OBJECT $is_object, r4
    $store  r4, [r1, r0]
    dmb     ish
    WRITE_BARRIER_IF_OBJECT $is_object, r4, r1, .L${opcode}_slow_path_skip_write_barrier, r0
@@ -345,6 +359,7 @@
    SET_VREG_WIDE_BY_ADDR r0, r1, r2    // fp[A] <- value
    .elseif $is_object
    $load   r0, [r0, r1]
+   UNPOISON_HEAP_REF r0
    // No need to check the marking register, we know it's not set here.
 .L${opcode}_after_reference_load:
    SET_VREG_OBJECT r0, r2              // fp[A] <- value
@@ -359,6 +374,7 @@
    bl      art_quick_read_barrier_mark_reg00
    .if $is_object
    ldr     r0, [r0, r1]
+   UNPOISON_HEAP_REF r0
 .L${opcode}_mark_after_load:
    // Here, we know the marking register is set.
    bl      art_quick_read_barrier_mark_reg00
@@ -393,6 +409,7 @@
    $load   r0, [r0, r1]
    dmb     ish
    .if $is_object
+   UNPOISON_HEAP_REF r0
    TEST_IF_MARKING .L${opcode}_mark_after_load
    SET_VREG_OBJECT r0, r2              // fp[A] <- value
    .else
@@ -444,6 +461,7 @@
    add     r0, r0, r1
    strd    r2, r3, [r0]
    .else
+   POISON_HEAP_REF_IF_OBJECT $is_object, r4
    $store  r4, [r0, r1]
    WRITE_BARRIER_IF_OBJECT $is_object, r4, r0, .L${opcode}_skip_write_barrier, r1
    .endif
@@ -487,6 +505,7 @@
    dmb     ish
    .else
    dmb     ish
+   POISON_HEAP_REF_IF_OBJECT $is_object r4
    $store  r4, [r0, r1]
    dmb     ish
    WRITE_BARRIER_IF_OBJECT $is_object, r4, r0, .L${opcode}_slow_path_skip_write_barrier, r1
diff --git a/runtime/interpreter/mterp/nterp.cc b/runtime/interpreter/mterp/nterp.cc
index 81e80ed..bcc59a4 100644
--- a/runtime/interpreter/mterp/nterp.cc
+++ b/runtime/interpreter/mterp/nterp.cc
@@ -19,6 +19,7 @@
  */
 #include "nterp.h"
 
+#include "arch/instruction_set.h"
 #include "base/quasi_atomic.h"
 #include "class_linker-inl.h"
 #include "dex/dex_instruction_utils.h"
@@ -30,13 +31,94 @@
 #include "mirror/string-alloc-inl.h"
 #include "nterp_helpers.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace interpreter {
 
+bool IsNterpSupported() {
+  switch (kRuntimeISA) {
+    case InstructionSet::kArm:
+    case InstructionSet::kThumb2:
+    case InstructionSet::kArm64:
+      return kReserveMarkingRegister && !kUseTableLookupReadBarrier;
+    case InstructionSet::kRiscv64:
+      return true;
+    case InstructionSet::kX86:
+    case InstructionSet::kX86_64:
+      return !kUseTableLookupReadBarrier;
+    default:
+      return false;
+  }
+}
+
+bool CanRuntimeUseNterp() REQUIRES_SHARED(Locks::mutator_lock_) {
+  Runtime* runtime = Runtime::Current();
+  instrumentation::Instrumentation* instr = runtime->GetInstrumentation();
+  // If the runtime is interpreter only, we currently don't use nterp as some
+  // parts of the runtime (like instrumentation) make assumption on an
+  // interpreter-only runtime to always be in a switch-like interpreter.
+  return IsNterpSupported() && !runtime->IsJavaDebuggable() && !instr->EntryExitStubsInstalled() &&
+         !instr->InterpretOnly() && !runtime->IsAotCompiler() &&
+         !instr->NeedsSlowInterpreterForListeners() &&
+         // An async exception has been thrown. We need to go to the switch interpreter. nterp
+         // doesn't know how to deal with these so we could end up never dealing with it if we are
+         // in an infinite loop.
+         !runtime->AreAsyncExceptionsThrown() &&
+         (runtime->GetJit() == nullptr || !runtime->GetJit()->JitAtFirstUse());
+}
+
+// The entrypoint for nterp, which ArtMethods can directly point to.
+extern "C" void ExecuteNterpImpl() REQUIRES_SHARED(Locks::mutator_lock_);
+extern "C" void EndExecuteNterpImpl() REQUIRES_SHARED(Locks::mutator_lock_);
+
+const void* GetNterpEntryPoint() {
+  return reinterpret_cast<const void*>(interpreter::ExecuteNterpImpl);
+}
+
+ArrayRef<const uint8_t> NterpImpl() {
+  const uint8_t* entry_point = reinterpret_cast<const uint8_t*>(ExecuteNterpImpl);
+  size_t size = reinterpret_cast<const uint8_t*>(EndExecuteNterpImpl) - entry_point;
+  const uint8_t* code = reinterpret_cast<const uint8_t*>(EntryPointToCodePointer(entry_point));
+  return ArrayRef<const uint8_t>(code, size);
+}
+
+// Another entrypoint, which does a clinit check at entry.
+extern "C" void ExecuteNterpWithClinitImpl() REQUIRES_SHARED(Locks::mutator_lock_);
+extern "C" void EndExecuteNterpWithClinitImpl() REQUIRES_SHARED(Locks::mutator_lock_);
+
+const void* GetNterpWithClinitEntryPoint() {
+  return reinterpret_cast<const void*>(interpreter::ExecuteNterpWithClinitImpl);
+}
+
+ArrayRef<const uint8_t> NterpWithClinitImpl() {
+  const uint8_t* entry_point = reinterpret_cast<const uint8_t*>(ExecuteNterpWithClinitImpl);
+  size_t size = reinterpret_cast<const uint8_t*>(EndExecuteNterpWithClinitImpl) - entry_point;
+  const uint8_t* code = reinterpret_cast<const uint8_t*>(EntryPointToCodePointer(entry_point));
+  return ArrayRef<const uint8_t>(code, size);
+}
+
+/*
+ * Verify some constants used by the nterp interpreter.
+ */
+void CheckNterpAsmConstants() {
+  /*
+   * If we're using computed goto instruction transitions, make sure
+   * none of the handlers overflows the byte limit.  This won't tell
+   * which one did, but if any one is too big the total size will
+   * overflow.
+   */
+  const int width = kNterpHandlerSize;
+  ptrdiff_t interp_size = reinterpret_cast<uintptr_t>(artNterpAsmInstructionEnd) -
+                          reinterpret_cast<uintptr_t>(artNterpAsmInstructionStart);
+  if ((interp_size == 0) || (interp_size != (art::kNumPackedOpcodes * width))) {
+    LOG(FATAL) << "ERROR: unexpected asm interp size " << interp_size
+               << "(did an instruction handler exceed " << width << " bytes?)";
+  }
+}
+
 inline void UpdateHotness(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_) {
   // The hotness we will add to a method when we perform a
   // field/method/class/string lookup.
-  constexpr uint16_t kNterpHotnessLookup = 0xf;
+  constexpr uint16_t kNterpHotnessLookup = 0xff;
   method->UpdateCounter(kNterpHotnessLookup);
 }
 
diff --git a/runtime/interpreter/mterp/nterp.h b/runtime/interpreter/mterp/nterp.h
index 4d5af39..446fb85 100644
--- a/runtime/interpreter/mterp/nterp.h
+++ b/runtime/interpreter/mterp/nterp.h
@@ -17,12 +17,14 @@
 #ifndef ART_RUNTIME_INTERPRETER_MTERP_NTERP_H_
 #define ART_RUNTIME_INTERPRETER_MTERP_NTERP_H_
 
+#include "base/array_ref.h"
 #include "base/globals.h"
+#include "base/macros.h"
 
 extern "C" void* artNterpAsmInstructionStart[];
 extern "C" void* artNterpAsmInstructionEnd[];
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtMethod;
 
@@ -33,6 +35,8 @@
 bool CanRuntimeUseNterp();
 const void* GetNterpEntryPoint();
 const void* GetNterpWithClinitEntryPoint();
+ArrayRef<const uint8_t> NterpWithClinitImpl();
+ArrayRef<const uint8_t> NterpImpl();
 
 constexpr uint16_t kNterpHotnessValue = 0;
 
diff --git a/runtime/interpreter/mterp/nterp_impl.cc b/runtime/interpreter/mterp/nterp_impl.cc
deleted file mode 100644
index f2a9855..0000000
--- a/runtime/interpreter/mterp/nterp_impl.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "arch/instruction_set.h"
-#include "interpreter/interpreter_common.h"
-#include "nterp.h"
-
-/*
- * Definitions for targets that support nterp.
- */
-
-namespace art {
-
-namespace interpreter {
-
-bool IsNterpSupported() {
-  return !kPoisonHeapReferences && kReserveMarkingRegister &&
-         kRuntimeISA != InstructionSet::kRiscv64;
-}
-
-bool CanRuntimeUseNterp() REQUIRES_SHARED(Locks::mutator_lock_) {
-  Runtime* runtime = Runtime::Current();
-  instrumentation::Instrumentation* instr = runtime->GetInstrumentation();
-  // If the runtime is interpreter only, we currently don't use nterp as some
-  // parts of the runtime (like instrumentation) make assumption on an
-  // interpreter-only runtime to always be in a switch-like interpreter.
-  return IsNterpSupported() && !runtime->IsJavaDebuggable() && !instr->EntryExitStubsInstalled() &&
-         !instr->InterpretOnly() && !runtime->IsAotCompiler() &&
-         !instr->NeedsSlowInterpreterForListeners() &&
-         // An async exception has been thrown. We need to go to the switch interpreter. nterp
-         // doesn't know how to deal with these so we could end up never dealing with it if we are
-         // in an infinite loop.
-         !runtime->AreAsyncExceptionsThrown() &&
-         (runtime->GetJit() == nullptr || !runtime->GetJit()->JitAtFirstUse());
-}
-
-// The entrypoint for nterp, which ArtMethods can directly point to.
-extern "C" void ExecuteNterpImpl() REQUIRES_SHARED(Locks::mutator_lock_);
-
-const void* GetNterpEntryPoint() {
-  return reinterpret_cast<const void*>(interpreter::ExecuteNterpImpl);
-}
-
-// Another entrypoint, which does a clinit check at entry.
-extern "C" void ExecuteNterpWithClinitImpl() REQUIRES_SHARED(Locks::mutator_lock_);
-
-const void* GetNterpWithClinitEntryPoint() {
-  return reinterpret_cast<const void*>(interpreter::ExecuteNterpWithClinitImpl);
-}
-
-/*
- * Verify some constants used by the nterp interpreter.
- */
-void CheckNterpAsmConstants() {
-  /*
-   * If we're using computed goto instruction transitions, make sure
-   * none of the handlers overflows the byte limit.  This won't tell
-   * which one did, but if any one is too big the total size will
-   * overflow.
-   */
-  const int width = kNterpHandlerSize;
-  ptrdiff_t interp_size = reinterpret_cast<uintptr_t>(artNterpAsmInstructionEnd) -
-                          reinterpret_cast<uintptr_t>(artNterpAsmInstructionStart);
-  if ((interp_size == 0) || (interp_size != (art::kNumPackedOpcodes * width))) {
-    LOG(FATAL) << "ERROR: unexpected asm interp size " << interp_size
-               << "(did an instruction handler exceed " << width << " bytes?)";
-  }
-}
-
-}  // namespace interpreter
-}  // namespace art
diff --git a/runtime/interpreter/mterp/riscv64/arithmetic.S b/runtime/interpreter/mterp/riscv64/arithmetic.S
index 30cb903..dd7ebac 100644
--- a/runtime/interpreter/mterp/riscv64/arithmetic.S
+++ b/runtime/interpreter/mterp/riscv64/arithmetic.S
@@ -1,248 +1,625 @@
-%def binop(preinstr="", result="r0", chkzero="0", instr=""):
-    unimp
+//
+// unop vA, vB
+// Format 12x: B|A|op
+// (see floating_point.S for float/double ops)
+//
 
-%def binop2addr(preinstr="", result="r0", chkzero="0", instr=""):
-    unimp
-
-%def binopLit16(result="r0", chkzero="0", instr=""):
-    unimp
-
-%def binopLit8(extract="unimp", result="r0", chkzero="0", instr=""):
-    unimp
-
-%def binopWide(preinstr="", result0="r0", result1="r1", chkzero="0", instr=""):
-    unimp
-
-%def binopWide2addr(preinstr="", result0="r0", result1="r1", chkzero="0", instr=""):
-    unimp
-
-%def unop(preinstr="", instr=""):
-    unimp
-
-%def unopNarrower(preinstr="", instr=""):
-    unimp
-
-%def unopWide(preinstr="", instr=""):
-    unimp
-
-%def unopWider(preinstr="", instr=""):
-    unimp
-
-%def op_add_int():
-    unimp
-
-%def op_add_int_2addr():
-    unimp
-
-%def op_add_int_lit16():
-    unimp
-
-%def op_add_int_lit8():
-    unimp
-
-%def op_add_long():
-    unimp
-
-%def op_add_long_2addr():
-    unimp
-
-%def op_and_int():
-    unimp
-
-%def op_and_int_2addr():
-    unimp
-
-%def op_and_int_lit16():
-    unimp
-
-%def op_and_int_lit8():
-    unimp
-
-%def op_and_long():
-    unimp
-
-%def op_and_long_2addr():
-    unimp
-
-%def op_cmp_long():
-    unimp
-
-%def op_div_int():
-    unimp
-
-%def op_div_int_2addr():
-    unimp
-
-%def op_div_int_lit16():
-    unimp
-
-%def op_div_int_lit8():
-    unimp
-
-%def op_div_long():
-    unimp
-
-%def op_div_long_2addr():
-    unimp
-
-%def op_int_to_byte():
-    unimp
-
-%def op_int_to_char():
-    unimp
-
-%def op_int_to_long():
-    unimp
-
-%def op_int_to_short():
-    unimp
-
-%def op_long_to_int():
-    unimp
-
-%def op_mul_int():
-    unimp
-
-%def op_mul_int_2addr():
-    unimp
-
-%def op_mul_int_lit16():
-    unimp
-
-%def op_mul_int_lit8():
-    unimp
-
-%def op_mul_long():
-    unimp
-
-%def op_mul_long_2addr():
-    unimp
-
+// neg-int vA, vB
+// Format 12x: B|A|7b
 %def op_neg_int():
-    unimp
+%  generic_unop(instr="negw t1, t1")
 
-%def op_neg_long():
-    unimp
-
+// not-int vA, vB
+// Format 12x: B|A|7c
 %def op_not_int():
-    unimp
+%  generic_unop(instr="not t1, t1")
 
+// neg-long vA, vB
+// Format 12x: B|A|7d
+%def op_neg_long():
+%  generic_unop(instr="neg t1, t1", is_wide=True)
+
+// not-long vA, vB
+// Format 12x: B|A|7e
 %def op_not_long():
-    unimp
+%  generic_unop(instr="not t1, t1", is_wide=True)
 
-%def op_or_int():
-    unimp
+// int-to-long vA, vB
+// Format 12x: B|A|81
+// Note: Sign extension of int32 into int64.
+// Read from 32-bit vreg and write to 64-bit vreg, hence a custom impl.
+%def op_int_to_long():
+   srliw t1, xINST, 12   // t1 := B
+   srliw t2, xINST, 8    // t2 := B|A
+%  get_vreg("t1", "t1")  #  t1 := fp[B] with sign extension to 64 bits
+   FETCH_ADVANCE_INST 1  // advance xPC, load xINST
+   and t2, t2, 0xF       // t2 := A
+   GET_INST_OPCODE t3    // t3 holds next opcode
+   SET_VREG_WIDE t1, t2, z0=t0
+                         // fp[A:A+1] := t1
+   GOTO_OPCODE t3        // continue to next
 
-%def op_or_int_2addr():
-    unimp
+// long-to-int vA, vB
+// Format 12x: B|A|84
+// Note: Truncation of int64 into int32.
+// Implemented as a read from the low bits from vB, write them to vA.
+// Note: instr is intentionally empty.
+%def op_long_to_int():
+%  generic_unop(instr="")
 
-%def op_or_int_lit16():
-    unimp
+// int-to-byte vA, vB
+// Format 12x: B|A|8d
+// Note: Truncation of int32 to int8, sign extending the result.
+%def op_int_to_byte():
+%  generic_unop(instr="sext.b t1, t1")
 
-%def op_or_int_lit8():
-    unimp
+// int-to-byte vA, vB
+// Format 12x: B|A|8e
+// Note: Truncation of int32 to uint16, without sign extension.
+%def op_int_to_char():
+%  generic_unop(instr="zext.h t1, t1")
 
-%def op_or_long():
-    unimp
+// int-to-byte vA, vB
+// Format 12x: B|A|8f
+// Note: Truncation of int32 to int16, sign extending the result.
+%def op_int_to_short():
+%  generic_unop(instr="sext.h t1, t1")
 
-%def op_or_long_2addr():
-    unimp
+// unop boilerplate
+// instr: operand held in t1, result written to t1.
+// instr must not clobber t2.
+// Clobbers: t0, t1, t2
+%def generic_unop(instr, is_wide=False):
+   srliw t1, xINST, 12   // t1 := B
+   srliw t2, xINST, 8    // t2 := B|A
+%  get_vreg("t1", "t1", is_wide=is_wide)
+                         // t1 := fp[B]
+   and t2, t2, 0xF       // t2 := A
+   FETCH_ADVANCE_INST 1  // advance xPC, load xINST
+   $instr                // read t1, write result to t1.
+                         // do not clobber t2!
+%  set_vreg("t1", "t2", z0="t0", is_wide=is_wide)
+                         // fp[A] := t1
+   GET_INST_OPCODE t0    // t0 holds next opcode
+   GOTO_OPCODE t0        // continue to next
 
-%def op_rem_int():
-    unimp
+//
+// binop vAA, vBB, vCC
+// Format 23x: AA|op CC|BB
+// (see floating_point.S for float/double ops)
+//
 
-%def op_rem_int_2addr():
-    unimp
+// add-int vAA, vBB, vCC
+// Format 23x: AA|90 CC|BB
+%def op_add_int():
+%  generic_binop(instr="addw t1, t1, t2")
 
-%def op_rem_int_lit16():
-    unimp
-
-%def op_rem_int_lit8():
-    unimp
-
-%def op_rem_long():
-    unimp
-
-%def op_rem_long_2addr():
-    unimp
-
-%def op_rsub_int():
-    unimp
-
-%def op_rsub_int_lit8():
-    unimp
-
-%def op_shl_int():
-    unimp
-
-%def op_shl_int_2addr():
-    unimp
-
-%def op_shl_int_lit8():
-    unimp
-
-%def op_shl_long():
-    unimp
-
-%def op_shl_long_2addr():
-    unimp
-
-%def op_shr_int():
-    unimp
-
-%def op_shr_int_2addr():
-    unimp
-
-%def op_shr_int_lit8():
-    unimp
-
-%def op_shr_long():
-    unimp
-
-%def op_shr_long_2addr():
-    unimp
-
+// sub-int vAA, vBB, vCC
+// Format 23x: AA|91 CC|BB
 %def op_sub_int():
-    unimp
+%  generic_binop(instr="subw t1, t1, t2")
 
-%def op_sub_int_2addr():
-    unimp
+// mul-int vAA, vBB, vCC
+// Format 23x: AA|92 CC|BB
+%def op_mul_int():
+%  generic_binop(instr="mulw t1, t1, t2")
 
-%def op_sub_long():
-    unimp
+// div-int vAA, vBB, vCC
+// Format 23x: AA|93 CC|BB
+// Note: Twos-complement division, rounded towards zero (that is, truncated to integer). This throws
+// ArithmeticException if b == 0.
+%def op_div_int():
+%  generic_binop(instr="divw t1, t1, t2", divz_throw=True)
 
-%def op_sub_long_2addr():
-    unimp
+// rem-int vAA, vBB, vCC
+// Format 23x: AA|94 CC|BB
+// Note: Twos-complement remainder after division. The sign of the result is the same as that of a,
+// and it is more precisely defined as result == a - (a / b) * b. This throws ArithmeticException if
+// b == 0.
+%def op_rem_int():
+%  generic_binop(instr="remw t1, t1, t2", divz_throw=True)
 
-%def op_ushr_int():
-    unimp
+// and-int vAA, vBB, vCC
+// Format 23x: AA|95 CC|BB
+%def op_and_int():
+%  generic_binop(instr="and t1, t1, t2")
 
-%def op_ushr_int_2addr():
-    unimp
+// or-int vAA, vBB, vCC
+// Format 23x: AA|96 CC|BB
+%def op_or_int():
+%  generic_binop(instr="or t1, t1, t2")
 
-%def op_ushr_int_lit8():
-    unimp
-
-%def op_ushr_long():
-    unimp
-
-%def op_ushr_long_2addr():
-    unimp
-
+// xor-int vAA, vBB, vCC
+// Format 23x: AA|97 CC|BB
 %def op_xor_int():
-    unimp
+%  generic_binop(instr="xor t1, t1, t2")
 
-%def op_xor_int_2addr():
-    unimp
+// shl-int vAA, vBB, vCC
+// Format 23x: AA|98 CC|BB
+// Note: SLLW uses t2[4:0] for the shift amount.
+%def op_shl_int():
+%  generic_binop(instr="sllw t1, t1, t2")
 
-%def op_xor_int_lit16():
-    unimp
+// shr-int vAA, vBB, vCC
+// Format 23x: AA|99 CC|BB
+// Note: SRAW uses t2[4:0] for the shift amount.
+%def op_shr_int():
+%  generic_binop(instr="sraw t1, t1, t2")
 
-%def op_xor_int_lit8():
-    unimp
+// ushr-int vAA, vBB, vCC
+// Format 23x: AA|9a CC|BB
+// Note: SRLW uses t2[4:0] for the shift amount.
+%def op_ushr_int():
+%  generic_binop(instr="srlw t1, t1, t2")
 
+// add-long vAA, vBB, vCC
+// Format 23x: AA|9b CC|BB
+%def op_add_long():
+%  generic_binop(instr="add t1, t1, t2", is_wide=True)
+
+// sub-long vAA, vBB, vCC
+// Format 23x: AA|9c CC|BB
+%def op_sub_long():
+%  generic_binop(instr="sub t1, t1, t2", is_wide=True)
+
+// mul-long vAA, vBB, vCC
+// Format 23x: AA|9d CC|BB
+%def op_mul_long():
+%  generic_binop(instr="mul t1, t1, t2", is_wide=True)
+
+// div-long vAA, vBB, vCC
+// Format 23x: AA|9e CC|BB
+// Note: Twos-complement division, rounded towards zero (that is, truncated to integer). This throws
+// ArithmeticException if b == 0.
+%def op_div_long():
+%  generic_binop(instr="div t1, t1, t2", divz_throw=True, is_wide=True)
+
+// rem-long vAA, vBB, vCC
+// Format 23x: AA|9f CC|BB
+// Note: Twos-complement remainder after division. The sign of the result is the same as that of a,
+// and it is more precisely defined as result == a - (a / b) * b. This throws ArithmeticException if
+// b == 0.
+%def op_rem_long():
+%  generic_binop(instr="rem t1, t1, t2", divz_throw=True, is_wide=True)
+
+// and-long vAA, vBB, vCC
+// Format 23x: AA|a0 CC|BB
+%def op_and_long():
+%  generic_binop(instr="and t1, t1, t2", is_wide=True)
+
+// or-long vAA, vBB, vCC
+// Format 23x: AA|a1 CC|BB
+%def op_or_long():
+%  generic_binop(instr="or t1, t1, t2", is_wide=True)
+
+// xor-long vAA, vBB, vCC
+// Format 23x: AA|a2 CC|BB
 %def op_xor_long():
-    unimp
+%  generic_binop(instr="xor t1, t1, t2", is_wide=True)
 
+// shl-long vAA, vBB, vCC
+// Format 23x: AA|a3 CC|BB
+// Note: SLL uses t2[5:0] for the shift amount.
+%def op_shl_long():
+%  generic_shift_wide(instr="sll t1, t1, t2")
+
+// shr-long vAA, vBB, vCC
+// Format 23x: AA|a4 CC|BB
+// Note: SRA uses t2[5:0] for the shift amount.
+%def op_shr_long():
+%  generic_shift_wide(instr="sra t1, t1, t2")
+
+// ushr-long vAA, vBB, vCC
+// Format 23x: AA|a5 CC|BB
+// Note: SRL uses t2[5:0] for the shift amount.
+%def op_ushr_long():
+%  generic_shift_wide(instr="srl t1, t1, t2")
+
+// binop boilerplate
+// instr: operands held in t1 and t2, result written to t1.
+// instr must not throw. Exceptions to be thrown prior to instr.
+// instr must not clobber t3.
+//
+// The divz_throw flag generates check-and-throw code for div/0.
+// The is_wide flag ensures vregs are read and written in 64-bit widths.
+// Clobbers: t0, t1, t2, t3
+%def generic_binop(instr, divz_throw=False, is_wide=False):
+   FETCH t1, count=1     // t1 := CC|BB
+   srliw t3, xINST, 8    // t3 := AA
+   srliw t2, t1, 8       // t2 := CC
+   and t1, t1, 0xFF      // t1 := BB
+%  get_vreg("t2", "t2", is_wide=is_wide)  # t2 := fp[CC]
+%  get_vreg("t1", "t1", is_wide=is_wide)  # t1 := fp[BB]
+%  if divz_throw:
+     beqz t2, 1f         // Must throw before FETCH_ADVANCE_INST.
+%#:
+   FETCH_ADVANCE_INST 2  // advance xPC, load xINST
+   $instr                // read t1 and t2, write result to t1.
+                         // do not clobber t3!
+   GET_INST_OPCODE t2    // t2 holds next opcode
+%  set_vreg("t1", "t3", z0="t0", is_wide=is_wide)
+                         // fp[AA] := t1
+   GOTO_OPCODE t2        // continue to next
+1:
+%  if divz_throw:
+     tail common_errDivideByZero
+%#:
+
+// binop wide shift boilerplate
+// instr: operands held in t1 (64-bit) and t2 (32-bit), result written to t1.
+// instr must not clobber t3.
+// Clobbers: t0, t1, t2, t3
+//
+// Note: Contrary to other -long mathematical operations (which take register pairs for both their
+// first and their second source), shl-long, shr-long, and ushr-long take a register pair for their
+// first source (the value to be shifted), but a single register for their second source (the
+// shifting distance).
+%def generic_shift_wide(instr):
+   FETCH t1, count=1     // t1 := CC|BB
+   srliw t3, xINST, 8    // t3 := AA
+   srliw t2, t1, 8       // t2 := CC
+   and t1, t1, 0xFF      // t1 := BB
+%  get_vreg("t2", "t2")  #  t2 := fp[CC]
+   GET_VREG_WIDE t1, t1  // t1 := fp[BB]
+   FETCH_ADVANCE_INST 2  // advance xPC, load xINST
+   $instr                // read t1 and t2, write result to t1.
+                         // do not clobber t3!
+   GET_INST_OPCODE t2    // t2 holds next opcode
+   SET_VREG_WIDE t1, t3, z0=t0
+                         // fp[AA] := t1
+   GOTO_OPCODE t2        // continue to next
+
+//
+// binop/2addr vA, vB
+// Format 12x: B|A|op
+// (see floating_point.S for float/double ops)
+//
+
+// add-int/2addr vA, vB
+// Format 12x: B|A|b0
+%def op_add_int_2addr():
+%  generic_binop_2addr(instr="addw t1, t1, t2")
+
+// sub-int/2addr vA, vB
+// Format 12x: B|A|b1
+%def op_sub_int_2addr():
+%  generic_binop_2addr(instr="subw t1, t1, t2")
+
+// mul-int/2addr vA, vB
+// Format 12x: B|A|b2
+%def op_mul_int_2addr():
+%  generic_binop_2addr(instr="mulw t1, t1, t2")
+
+// div-int/2addr vA, vB
+// Format 12x: B|A|b3
+// Note: Twos-complement division, rounded towards zero (that is, truncated to integer). This throws
+// ArithmeticException if b == 0.
+%def op_div_int_2addr():
+%  generic_binop_2addr(instr="divw t1, t1, t2", divz_throw=True)
+
+// rem-int/2addr vA, vB
+// Format 12x: B|A|b4
+// Note: Twos-complement remainder after division. The sign of the result is the same as that of a,
+// and it is more precisely defined as result == a - (a / b) * b. This throws ArithmeticException if
+// b == 0.
+%def op_rem_int_2addr():
+%  generic_binop_2addr(instr="remw t1, t1, t2", divz_throw=True)
+
+// and-int/2addr vA, vB
+// Format 12x: B|A|b5
+%def op_and_int_2addr():
+%  generic_binop_2addr(instr="and t1, t1, t2")
+
+// or-int/2addr vA, vB
+// Format 12x: B|A|b6
+%def op_or_int_2addr():
+%  generic_binop_2addr(instr="or t1, t1, t2")
+
+// xor-int/2addr vA, vB
+// Format 12x: B|A|b7
+%def op_xor_int_2addr():
+%  generic_binop_2addr(instr="xor t1, t1, t2")
+
+// shl-int/2addr vA, vB
+// Format 12x: B|A|b8
+%def op_shl_int_2addr():
+%  generic_binop_2addr(instr="sllw t1, t1, t2")
+
+// shr-int/2addr vA, vB
+// Format 12x: B|A|b9
+%def op_shr_int_2addr():
+%  generic_binop_2addr(instr="sraw t1, t1, t2")
+
+// ushr-int/2addr vA, vB
+// Format 12x: B|A|ba
+%def op_ushr_int_2addr():
+%  generic_binop_2addr(instr="srlw t1, t1, t2")
+
+// add-long/2addr vA, vB
+// Format 12x: B|A|bb
+%def op_add_long_2addr():
+%  generic_binop_2addr(instr="add t1, t1, t2", is_wide=True)
+
+// sub-long/2addr vA, vB
+// Format 12x: B|A|bc
+%def op_sub_long_2addr():
+%  generic_binop_2addr(instr="sub t1, t1, t2", is_wide=True)
+
+// mul-long/2addr vA, vB
+// Format 12x: B|A|bd
+%def op_mul_long_2addr():
+%  generic_binop_2addr(instr="mul t1, t1, t2", is_wide=True)
+
+// div-long/2addr vA, vB
+// Format 12x: B|A|be
+%def op_div_long_2addr():
+%  generic_binop_2addr(instr="div t1, t1, t2", divz_throw=True, is_wide=True)
+
+// rem-long/2addr vA, vB
+// Format 12x: B|A|bf
+%def op_rem_long_2addr():
+%  generic_binop_2addr(instr="rem t1, t1, t2", divz_throw=True, is_wide=True)
+
+// and-long/2addr vA, vB
+// Format 12x: B|A|c0
+%def op_and_long_2addr():
+%  generic_binop_2addr(instr="and t1, t1, t2", is_wide=True)
+
+// or-long/2addr vA, vB
+// Format 12x: B|A|c1
+%def op_or_long_2addr():
+%  generic_binop_2addr(instr="or t1, t1, t2", is_wide=True)
+
+// xor-long/2addr vA, vB
+// Format 12x: B|A|c2
 %def op_xor_long_2addr():
-    unimp
+%  generic_binop_2addr(instr="xor t1, t1, t2", is_wide=True)
+
+// shl-long/2addr vA, vB
+// Format 12x: B|A|c3
+// Note: SLL uses t2[5:0] for the shift amount.
+%def op_shl_long_2addr():
+%  generic_shift_wide_2addr(instr="sll t1, t1, t2")
+
+// shr-long/2addr vA, vB
+// Format 12x: B|A|c4
+// Note: SRA uses t2[5:0] for the shift amount.
+%def op_shr_long_2addr():
+%  generic_shift_wide_2addr(instr="sra t1, t1, t2")
+
+// ushr-long/2addr vA, vB
+// Format 12x: B|A|c5
+// Note: SRL uses t2[5:0] for the shift amount.
+%def op_ushr_long_2addr():
+%  generic_shift_wide_2addr(instr="srl t1, t1, t2")
+
+// binop 2addr boilerplate
+// instr: operands held in t1 and t2, result written to t1.
+// instr must not throw. Exceptions to be thrown prior to instr.
+// instr must not clobber t3.
+//
+// The divz_throw flag generates check-and-throw code for div/0.
+// The is_wide flag ensures vregs are read and written in 64-bit widths.
+// Clobbers: t0, t1, t2, t3, t4
+%def generic_binop_2addr(instr, divz_throw=False, is_wide=False):
+   srliw t2, xINST, 12   // t2 := B
+   srliw t3, xINST, 8    // t3 := B|A
+%  get_vreg("t2", "t2", is_wide=is_wide)
+                         // t2 := fp[B]
+   and t3, t3, 0xF       // t3 := A (cached for SET_VREG)
+   mv t4, t3             // t4 := A
+%  get_vreg("t1", "t4", is_wide=is_wide)
+                         // t1 := fp[A]
+%  if divz_throw:
+     beqz t2, 1f         // Must throw before FETCH_ADVANCE_INST.
+%#:
+   FETCH_ADVANCE_INST 1  // advance xPC, load xINST
+   $instr                // read t1 and t2, write result to t1.
+                         // do not clobber t3!
+   GET_INST_OPCODE t2    // t2 holds next opcode
+%  set_vreg("t1", "t3", z0="t0", is_wide=is_wide)
+                         // fp[A] := t1
+   GOTO_OPCODE t2        // continue to next
+1:
+%  if divz_throw:
+     tail common_errDivideByZero
+%#:
+
+// binop wide shift 2addr boilerplate
+// instr: operands held in t1 (64-bit) and t2 (32-bit), result written to t1.
+// instr must not clobber t3.
+// Clobbers: t0, t1, t2, t3, t4
+//
+// Note: Contrary to other -long/2addr mathematical operations (which take register pairs for both
+// their destination/first source and their second source), shl-long/2addr, shr-long/2addr, and
+// ushr-long/2addr take a register pair for their destination/first source (the value to be
+// shifted), but a single register for their second source (the shifting distance).
+%def generic_shift_wide_2addr(instr):
+   srliw t2, xINST, 12   // t2 := B
+   srliw t3, xINST, 8    // t3 := B|A
+%  get_vreg("t2", "t2")  #  t2 := fp[B]
+   and t3, t3, 0xF       // t3 := A (cached for SET_VREG_WIDE)
+   mv t4, t3             // t4 := A
+   FETCH_ADVANCE_INST 1  // advance xPC, load xINST
+   GET_VREG_WIDE t1, t4  // t1 := fp[A]
+   $instr                // read t1 and t2, write result to t1.
+                         // do not clobber t3!
+   GET_INST_OPCODE t2    // t2 holds next opcode
+   SET_VREG_WIDE t1, t3, z0=t0
+                         // fp[A] := t1
+   GOTO_OPCODE t2        // continue to next
+
+//
+// binop/lit16 vA, vB, #+CCCC
+// Format 22s: B|A|op CCCC
+//
+
+// add-int/lit16 vA, vB, #+CCCC
+// Format 22s: B|A|d0 CCCC
+%def op_add_int_lit16():
+%  generic_binop_lit16(instr="addw t1, t1, t2")
+
+// rsub-int vA, vB, #+CCCC
+// Format 22s: B|A|d1 CCCC
+// Note: rsub-int does not have a suffix since this version is the main opcode of its family.
+// Note: Twos-complement reverse subtraction.
+%def op_rsub_int():
+%  generic_binop_lit16(instr="subw t1, t2, t1")
+
+// mul-int/lit16 vA, vB, #+CCCC
+// Format 22s: B|A|d2 CCCC
+%def op_mul_int_lit16():
+%  generic_binop_lit16(instr="mulw t1, t1, t2")
+
+// div-int/lit16 vA, vB, #+CCCC
+// Format 22s: B|A|d3 CCCC
+// Note: Twos-complement division, rounded towards zero (that is, truncated to integer). This throws
+// ArithmeticException if b == 0.
+%def op_div_int_lit16():
+%  generic_binop_lit16(instr="divw t1, t1, t2", divz_throw=True)
+
+// rem-int/lit16 vA, vB, #+CCCC
+// Format 22s: B|A|d4 CCCC
+// Note: Twos-complement remainder after division. The sign of the result is the same as that of a,
+// and it is more precisely defined as result == a - (a / b) * b. This throws ArithmeticException if
+// b == 0.
+%def op_rem_int_lit16():
+%  generic_binop_lit16(instr="remw t1, t1, t2", divz_throw=True)
+
+// and-int/lit16 vA, vB, #+CCCC
+// Format 22s: B|A|d5 CCCC
+%def op_and_int_lit16():
+%  generic_binop_lit16(instr="and t1, t1, t2")
+
+// or-int/lit16 vA, vB, #+CCCC
+// Format 22s: B|A|d6 CCCC
+%def op_or_int_lit16():
+%  generic_binop_lit16(instr="or t1, t1, t2")
+
+// xor-int/lit16 vA, vB, #+CCCC
+// Format 22s: B|A|d7 CCCC
+%def op_xor_int_lit16():
+%  generic_binop_lit16(instr="xor t1, t1, t2")
+
+// binop lit16 boilerplate
+// instr: operands held in t1 and t2, result written to t1.
+// instr must not throw. Exceptions to be thrown prior to instr.
+// instr must not clobber t3.
+//
+// The divz_throw flag generates check-and-throw code for div/0.
+// Clobbers: t0, t1, t2, t3
+%def generic_binop_lit16(instr, divz_throw=False):
+   FETCH t2, count=1, signed=1  // t2 := ssssCCCC
+   srliw t1, xINST, 12          // t1 := B
+   srliw t3, xINST, 8           // t3 := B|A
+%  if divz_throw:
+     beqz t2, 1f                // Must throw before FETCH_ADVANCE_INST.
+%#:
+%  get_vreg("t1", "t1")         #  t1 := fp[B]
+   and t3, t3, 0xF              // t3 := A
+   FETCH_ADVANCE_INST 2         // advance xPC, load xINST
+   $instr                       // read t1 and t2, write result to t1.
+                                // do not clobber t3!
+   GET_INST_OPCODE t2           // t2 holds next opcode
+%  set_vreg("t1", "t3", z0="t0")  # fp[A] := t1
+   GOTO_OPCODE t2               // continue to next
+1:
+%  if divz_throw:
+     tail common_errDivideByZero
+%#:
+
+//
+// binop/lit8 vAA, vBB, #+CC
+// Format 22b: AA|op CC|BB
+//
+
+// add-int/lit8, vAA, vBB, #+CC
+// Format 22b: AA|d8, CC|BB
+%def op_add_int_lit8():
+%  generic_binop_lit8(instr="addw t1, t1, t2")
+
+// rsub-int/lit8, vAA, vBB, #+CC
+// Format 22b: AA|d9, CC|BB
+// Note: Twos-complement reverse subtraction.
+%def op_rsub_int_lit8():
+%  generic_binop_lit8(instr="subw t1, t2, t1")
+
+// mul-int/lit8, vAA, vBB, #+CC
+// Format 22b: AA|da, CC|BB
+%def op_mul_int_lit8():
+%  generic_binop_lit8(instr="mulw t1, t1, t2")
+
+// div-int/lit8, vAA, vBB, #+CC
+// Format 22b: AA|db, CC|BB
+// Note: Twos-complement division, rounded towards zero (that is, truncated to integer). This throws
+// ArithmeticException if b == 0.
+%def op_div_int_lit8():
+%  generic_binop_lit8(instr="divw t1, t1, t2", divz_throw=True)
+
+// rem-int/lit8, vAA, vBB, #+CC
+// Format 22b: AA|dc, CC|BB
+// Note: Twos-complement remainder after division. The sign of the result is the same as that of a,
+// and it is more precisely defined as result == a - (a / b) * b. This throws ArithmeticException if
+// b == 0.
+%def op_rem_int_lit8():
+%  generic_binop_lit8(instr="remw t1, t1, t2", divz_throw=True)
+
+// and-int/lit8, vAA, vBB, #+CC
+// Format 22b: AA|dd, CC|BB
+%def op_and_int_lit8():
+%  generic_binop_lit8(instr="and t1, t1, t2")
+
+// or-int/lit8, vAA, vBB, #+CC
+// Format 22b: AA|de, CC|BB
+%def op_or_int_lit8():
+%  generic_binop_lit8(instr="or t1, t1, t2")
+
+// xor-int/lit8, vAA, vBB, #+CC
+// Format 22b: AA|df, CC|BB
+%def op_xor_int_lit8():
+%  generic_binop_lit8(instr="xor t1, t1, t2")
+
+// shl-int/lit8, vAA, vBB, #+CC
+// Format 22b: AA|e0, CC|BB
+// Note: SLLW uses t2[4:0] for the shift amount.
+%def op_shl_int_lit8():
+%  generic_binop_lit8(instr="sllw t1, t1, t2")
+
+// shr-int/lit8, vAA, vBB, #+CC
+// Format 22b: AA|e1, CC|BB
+// Note: SRAW uses t2[4:0] for the shift amount.
+%def op_shr_int_lit8():
+%  generic_binop_lit8(instr="sraw t1, t1, t2")
+
+// ushr-int/lit8, vAA, vBB, #+CC
+// Format 22b: AA|e2, CC|BB
+// Note: SRLW uses t2[4:0] for the shift amount.
+%def op_ushr_int_lit8():
+%  generic_binop_lit8(instr="srlw t1, t1, t2")
+
+// binop lit8 boilerplate
+// instr: operands held in t1 and t2, result written to t1.
+// instr must not throw. Exceptions to be thrown prior to instr.
+// instr must not clobber t3.
+//
+// The divz_throw flag generates check-and-throw code for div/0.
+// Clobbers: t0, t1, t2, t3
+%def generic_binop_lit8(instr, divz_throw=False):
+   FETCH t1, count=1, signed=1  // t1 := ssssCC|BB
+   srliw t3, xINST, 8           // t3 := AA
+   sraiw t2, t1, 8              // t2 := ssssssCC
+   andi t1, t1, 0xFF            // t1 := BB
+%  if divz_throw:
+     beqz t2, 1f                // Must throw before FETCH_ADVANCE_INST.
+%#:
+%  get_vreg("t1", "t1")         #  t1 := fp[BB]
+   FETCH_ADVANCE_INST 2         // advance xPC, load xINST
+   $instr                       // read t1 and t2, write result to t1.
+                                // do not clobber t3!
+   GET_INST_OPCODE t2           // t2 holds next opcode
+%  set_vreg("t1", "t3", z0="t0")  # fp[AA] := t1
+   GOTO_OPCODE t2               // continue to next
+1:
+%  if divz_throw:
+     tail common_errDivideByZero
+%#:
diff --git a/runtime/interpreter/mterp/riscv64/array.S b/runtime/interpreter/mterp/riscv64/array.S
index e58f384..769747e 100644
--- a/runtime/interpreter/mterp/riscv64/array.S
+++ b/runtime/interpreter/mterp/riscv64/array.S
@@ -1,57 +1,317 @@
-%def op_aget(load="unimp", shift="2", data_offset="MIRROR_INT_ARRAY_DATA_OFFSET", wide="0", is_object="0"):
-    unimp
-
-%def op_aget_boolean():
-%  op_aget(load="unimp", shift="0", data_offset="MIRROR_BOOLEAN_ARRAY_DATA_OFFSET", wide="0", is_object="0")
-
-%def op_aget_byte():
-%  op_aget(load="unimp", shift="0", data_offset="MIRROR_BYTE_ARRAY_DATA_OFFSET", wide="0", is_object="0")
-
-%def op_aget_char():
-%  op_aget(load="unimp", shift="1", data_offset="MIRROR_CHAR_ARRAY_DATA_OFFSET", wide="0", is_object="0")
-
-%def op_aget_object():
-%  op_aget(load="unimp", shift="2", data_offset="MIRROR_OBJECT_ARRAY_DATA_OFFSET", wide="0", is_object="1")
-
-%def op_aget_short():
-%  op_aget(load="unimp", shift="1", data_offset="MIRROR_SHORT_ARRAY_DATA_OFFSET", wide="0", is_object="0")
-
-%def op_aget_wide():
-%  op_aget(load="unimp", shift="3", data_offset="MIRROR_WIDE_ARRAY_DATA_OFFSET", wide="1", is_object="0")
-
-%def op_aput(store="unimp", shift="2", data_offset="MIRROR_INT_ARRAY_DATA_OFFSET", wide="0", is_object="0"):
-    unimp
-
-%def op_aput_boolean():
-%  op_aput(store="unimp", shift="0", data_offset="MIRROR_BOOLEAN_ARRAY_DATA_OFFSET", wide="0", is_object="0")
-
-%def op_aput_byte():
-%  op_aput(store="unimp", shift="0", data_offset="MIRROR_BYTE_ARRAY_DATA_OFFSET", wide="0", is_object="0")
-
-%def op_aput_char():
-%  op_aput(store="unimp", shift="1", data_offset="MIRROR_CHAR_ARRAY_DATA_OFFSET", wide="0", is_object="0")
-
-%def op_aput_short():
-%  op_aput(store="unimp", shift="1", data_offset="MIRROR_SHORT_ARRAY_DATA_OFFSET", wide="0", is_object="0")
-
-%def op_aput_wide():
-%  op_aput(store="unimp", shift="3", data_offset="MIRROR_WIDE_ARRAY_DATA_OFFSET", wide="1", is_object="0")
-
-%def op_aput_object():
-%  op_aput(store="unimp", shift="2", data_offset="MIRROR_OBJECT_ARRAY_DATA_OFFSET", wide="0", is_object="1")
-
+// array-length vA, vB
+// Format 12x: B|A|21
+// Store in the given destination register the length of the indicated array, in entries
 %def op_array_length():
-    unimp
+   srliw t0, xINST, 12     // t0 := B
+   GET_VREG_OBJECT t0, t0  // t0 := refs[B]
+   beqz t0, 1f
+   srliw t1, xINST, 8      // t1 := B|A
+   FETCH_ADVANCE_INST 1
+   andi t1, t1, 0xF        // t1 := A
+   GET_INST_OPCODE t3
+   lw t2, MIRROR_ARRAY_LENGTH_OFFSET(t0)
+%  set_vreg("t2", "t1", z0="t0")
+   GOTO_OPCODE t3
+1:
+   tail common_errNullObject
 
-%def op_fill_array_data():
-    unimp
 
-%def op_filled_new_array(helper="nterp_filled_new_array"):
-    unimp
-
-%def op_filled_new_array_range():
-%  op_filled_new_array(helper="nterp_filled_new_array_range")
-
+// new-array vA, vB, type@CCCC
+// Format 22c: B|A|23 CCCC
+// Construct a new array of the indicated type and size. The type must be an array type.
 %def op_new_array():
-    unimp
+   EXPORT_PC
+   srliw s8, xINST, 8   // s8 := B|A
+   srliw s7, xINST, 12  // s7 := B
+   andi s8, s8, 0xF     // s8 := A
+   FETCH_FROM_THREAD_CACHE /*resolved klass*/a0, .L${opcode}_miss, t0, t1
+   TEST_IF_MARKING t0, .L${opcode}_mark
+.L${opcode}_resume:
 
+%  get_vreg("a1", "s7")  # a1 := fp[B] length
+   ld t0, THREAD_ALLOC_ARRAY_ENTRYPOINT_OFFSET(xSELF)
+   jalr t0     // args a0 (klass), a1 (length)
+               // return a0 := new-array
+   fence w, w  // constructor fence; main.S has details
+
+   SET_VREG_OBJECT a0, s8, z0=t0  // refs[A] := new-array
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_mark:
+   call art_quick_read_barrier_mark_reg10  // a0, klass
+   j .L${opcode}_resume
+
+.L${opcode}_miss:
+   EXPORT_PC
+   mv a0, xSELF
+   ld a1, (sp)  // caller ArtMethod*
+   mv a2, xPC
+   call nterp_get_class
+   j .L${opcode}_resume
+
+
+
+
+// filled-new-array {vC, vD, vE, vF, vG}, type@BBBB
+// Format 35c: A|G|24 BBBB F|E|D|C
+// Construct an array of the given type and size, filling it with the supplied contents. The type
+// must be an array type. The array's contents must be single-word (that is, no arrays of long or
+// double, but reference types are acceptable). The constructed instance is stored as a "result" in
+// the same way that the method invocation instructions store their results, so the constructed
+// instance must be moved to a register with an immediately subsequent move-result-object
+// instruction (if it is to be used).
+%def op_filled_new_array(is_range=False):
+   EXPORT_PC
+   mv a0, xSELF
+   ld a1, (sp)  // a1 := caller ArtMethod*
+   mv a2, xFP   // a2 := vreg array
+   mv a3, xPC
+%  if is_range:
+     call nterp_filled_new_array_range  // args a0, a1, a2, a3
+%  else:
+     call nterp_filled_new_array  // args a0, a1, a2, a3
+%#:
+   FETCH_ADVANCE_INST 3
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+
+// filled-new-array/range {vCCCC .. vNNNN}, type@BBBB
+// where NNNN = CCCC + AA - 1
+// Format 3rc: AA|25 BBBB CCCC
+// Construct an array of the given type and size, filling it with the supplied contents.
+// Clarifications and restrictions are the same as filled-new-array, described above.
+%def op_filled_new_array_range():
+%  op_filled_new_array(is_range=True)
+
+
+// fill-array-data vAA, +BBBBBBBB
+// Format 31t: AA|26 BBBB(lo) BBBB(hi)
+// Fill the given array with the indicated data. The reference must be to an array of primitives,
+// and the data table must match it in type and must contain no more elements than will fit in the
+// array. That is, the array may be larger than the table, and if so, only the initial elements of
+// the array are set, leaving the remainder alone.
+%def op_fill_array_data():
+   EXPORT_PC
+   srliw t0, xINST, 8      // t0 := AA
+   FETCH t1, count=1, signed=1, width=32
+                           // t1 := ssssssssBBBBBBBB
+   GET_VREG_OBJECT a1, t0  // a1 := refs[AA] (array ref)
+   // +BBBBBBBB offset is in code units. Multiply by 2 for byte offset against dex PC.
+   sh1add a0, t1, xPC      // a0 := payload address
+   call art_quick_handle_fill_data  // args a0, a1
+   FETCH_ADVANCE_INST 3
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+
+// Common setup across APUT and AGET variants.
+// Sets \array, \index, and \length registers.
+// Branches to null handler and out-of-bounds handler.
+%def array_prelude(array, index, length, null_label, oob_label):
+   FETCH $index, count=1           // index := CC|BB
+   andi $array, $index, 0xFF       // array := BB
+   GET_VREG_OBJECT $array, $array  // array := refs[BB], array obj
+   beqz $array, $null_label
+
+   srliw $index, $index, 8         // index := CC
+%  get_vreg(index, index)          # index := fp[CC]
+   lw $length, MIRROR_ARRAY_LENGTH_OFFSET($array)  // length (signed 32b)
+   bgeu $index, $length, $oob_label  // Unsigned comparison also catches negative index.
+
+
+// aget vAA, vBB, vCC
+// Format 23x: AA|44 CC|BB
+// vAA := vBB[vCC]
+%def op_aget(width=32, zext=False):
+%  array_prelude(array="t0", index="a0", length="a1", null_label=f".L{opcode}_null", oob_label=f".L{opcode}_oob")
+       // t0 := vBB array object, a0 := vCC index, a1 := array length
+
+%  if width == 8 and zext:
+     add t0, a0, t0
+     lbu t0, MIRROR_BOOLEAN_ARRAY_DATA_OFFSET(t0)
+%  elif width == 8:
+     add t0, a0, t0
+     lb t0, MIRROR_BYTE_ARRAY_DATA_OFFSET(t0)
+%  elif width == 16 and zext:
+     sh1add t0, a0, t0
+     lhu t0, MIRROR_CHAR_ARRAY_DATA_OFFSET(t0)
+%  elif width == 16:
+     sh1add t0, a0, t0
+     lh t0, MIRROR_SHORT_ARRAY_DATA_OFFSET(t0)
+%  elif width == 32:
+     sh2add t0, a0, t0
+     lw t0, MIRROR_INT_ARRAY_DATA_OFFSET(t0)
+%  elif width == 64:
+     sh3add t0, a0, t0
+     ld t0, MIRROR_WIDE_ARRAY_DATA_OFFSET(t0)
+%  else:
+%    assert False, width
+%#:
+                       // t0 := *(array obj + data offset + idx * elem_size)
+   srliw t1, xINST, 8  // t1 := AA
+%  set_vreg("t0", "t1", z0="t2", width=width)
+
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_null:
+   tail common_errNullObject
+.L${opcode}_oob:
+   tail common_errArrayIndex  // args a0 (index), a1 (length)
+
+
+// aget-wide vAA, vBB, vCC
+// Format 23x: AA|45 CC|BB
+%def op_aget_wide():
+%  op_aget(width=64)
+
+
+// aget-object vAA, vBB, vCC
+// Format 23x: AA|46 CC|BB
+%def op_aget_object():
+%  array_prelude(array="t0", index="a0", length="a1", null_label=f".L{opcode}_null", oob_label=f".L{opcode}_oob")
+       // t0 := vBB array object, a0 := vCC index, a1 := array length
+
+   sh2add t0, a0, t0
+   lwu a0, MIRROR_OBJECT_ARRAY_DATA_OFFSET(t0)
+       // a0 := *(array obj + data offset + idx * elem_size)
+   UNPOISON_HEAP_REF a0
+   TEST_IF_MARKING t1, .L${opcode}_mark
+.L${opcode}_mark_resume:
+   srliw t1, xINST, 8  // t1 := AA
+   SET_VREG_OBJECT a0, t1, z0=t2
+
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_mark:
+   call art_quick_read_barrier_mark_reg10  // a0, object elem
+   j .L${opcode}_mark_resume
+.L${opcode}_null:
+   tail common_errNullObject
+.L${opcode}_oob:
+   tail common_errArrayIndex  // args a0 (index), a1 (length)
+
+
+// aget-boolean vAA, vBB, vCC
+// Format 23x: AA|47 CC|BB
+%def op_aget_boolean():
+%  op_aget(width=8, zext=True)
+
+
+// aget-byte vAA, vBB, vCC
+// Format 23x: AA|48 CC|BB
+%def op_aget_byte():
+%  op_aget(width=8)
+
+
+// aget_char vAA, vBB, vCC
+// Format 23x: AA|49 CC|BB
+%def op_aget_char():
+%  op_aget(width=16, zext=True)
+
+
+// aget-short vAA, vBB, vCC
+// Format 23x: AA|4a CC|BB
+%def op_aget_short():
+%  op_aget(width=16)
+
+
+// aput vAA, vBB, vCC
+// Format 23x: AA|4b CC|BB
+// vBB[vCC] := vAA
+%def op_aput(width=32, zext=False):
+%  array_prelude(array="t0", index="t1", length="t2", null_label=f".L{opcode}_null", oob_label=f".L{opcode}_oob")
+       // t0 := vBB array object, t1 := vCC zext index, t2 := array length
+
+   srliw t2, xINST, 8      // t2 := AA
+%  get_vreg("t2", "t2", width=width)  # t2 := fp[AA]
+%  if width == 8 and zext:
+     add t0, t1, t0
+     sb t2, MIRROR_BOOLEAN_ARRAY_DATA_OFFSET(t0)
+%  elif width == 8:
+     add t0, t1, t0
+     sb t2, MIRROR_BYTE_ARRAY_DATA_OFFSET(t0)
+%  elif width == 16 and zext:
+     sh1add t0, t1, t0
+     sh t2, MIRROR_CHAR_ARRAY_DATA_OFFSET(t0)
+%  elif width == 16:
+     sh1add t0, t1, t0
+     sh t2, MIRROR_SHORT_ARRAY_DATA_OFFSET(t0)
+%  elif width == 32:
+     sh2add t0, t1, t0
+     sw t2, MIRROR_INT_ARRAY_DATA_OFFSET(t0)
+%  elif width == 64:
+     sh3add t0, t1, t0
+     sd t2, MIRROR_WIDE_ARRAY_DATA_OFFSET(t0)
+%  else:
+%    assert False, width
+%#:
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_null:
+   tail common_errNullObject
+.L${opcode}_oob:
+   sext.w a0, t1
+   mv a1, t2
+   tail common_errArrayIndex  // args a0 (index), a1 (length)
+
+
+// aput-wide vAA, vBB, vCC
+// Format 23x: AA|4c CC|BB
+%def op_aput_wide():
+%  op_aput(width=64)
+
+
+// aput-object vAA, vBB, vCC
+// Format 23x: AA|4d CC|BB
+%def op_aput_object():
+%  array_prelude(array="a0", index="a1", length="a2", null_label=f".L{opcode}_null", oob_label=f".L{opcode}_oob")
+       // a0 := vBB array object, a1 := vCC zext index, a2 := array length
+
+   EXPORT_PC
+   srliw a2, xINST, 8       // a2 := AA
+   GET_VREG_OBJECT a2, a2   // a2 := fp[AA]
+   sext.w a1, a1            // a1 := sext index
+   call art_quick_aput_obj  // args a0 (array obj), a1 (index), a2 (obj)
+
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_null:
+   tail common_errNullObject
+.L${opcode}_oob:
+   sext.w a0, a1
+   mv a1, a2
+   tail common_errArrayIndex  // args a0 (index), a1 (length)
+
+// aput-boolean vAA, vBB, vCC
+// Format 23x: AA|4e CC|BB
+%def op_aput_boolean():
+%  op_aput(width=8, zext=True)
+
+
+// aput-byte vAA, vBB, vCC
+// Format 23x: AA|4f CC|BB
+%def op_aput_byte():
+%  op_aput(width=8)
+
+
+// aput-char vAA, vBB, vCC
+// Format 23x: AA|50 CC|BB
+%def op_aput_char():
+%  op_aput(width=16, zext=True)
+
+
+// aput-short vAA, vBB, vCC
+// Format 23x: AA|51 CC|BB
+%def op_aput_short():
+%  op_aput(width=16)
diff --git a/runtime/interpreter/mterp/riscv64/control_flow.S b/runtime/interpreter/mterp/riscv64/control_flow.S
index 6e263f3..215439c 100644
--- a/runtime/interpreter/mterp/riscv64/control_flow.S
+++ b/runtime/interpreter/mterp/riscv64/control_flow.S
@@ -1,74 +1,243 @@
-%def bincmp(condition=""):
-    unimp
-
-%def zcmp(condition=""):
-    unimp
-
-%def op_goto():
-    unimp
-
-%def op_goto_16():
-    unimp
-
-%def op_goto_32():
-    unimp
-
-%def op_if_eq():
-%  bincmp(condition="eq")
-
-%def op_if_eqz():
-%  zcmp(condition="eq")
-
-%def op_if_ge():
-%  bincmp(condition="ge")
-
-%def op_if_gez():
-%  zcmp(condition="ge")
-
-%def op_if_gt():
-%  bincmp(condition="gt")
-
-%def op_if_gtz():
-%  zcmp(condition="gt")
-
-%def op_if_le():
-%  bincmp(condition="le")
-
-%def op_if_lez():
-%  zcmp(condition="le")
-
-%def op_if_lt():
-%  bincmp(condition="lt")
-
-%def op_if_ltz():
-%  zcmp(condition="lt")
-
-%def op_if_ne():
-%  bincmp(condition="ne")
-
-%def op_if_nez():
-%  zcmp(condition="ne")
-
-%def op_packed_switch(func="NterpDoPackedSwitch"):
-    unimp
-
-%def op_sparse_switch():
-%  op_packed_switch(func="NterpDoSparseSwitch")
-
-/*
- * Return a 32-bit value.
- */
-%def op_return(is_object="0", is_void="0", is_wide="0"):
-    unimp
-
-%def op_return_object():
-%  op_return(is_object="1", is_void="0", is_wide="0")
-
+// return-void
+// Format 10x: 00|0e
 %def op_return_void():
-%  op_return(is_object="0", is_void="1", is_wide="0")
+%  op_return(is_void=True)
 
+
+// return vAA
+// Format 11x: AA|0f
+// Clobbers: t0
+%def op_return(is_object=False, is_void=False, is_wide=False):
+%  if is_void:
+     // Thread fence for constructor
+     fence w, w
+%  else:
+     srliw t0, xINST, 8  // t0 := AA
+%    if is_wide:
+       GET_VREG_WIDE a0, t0  // a0 := fp[AA:AA+1]
+       // The method may return to compiled code, so also place result in fa0.
+       fmv.d.x fa0, a0
+%    elif is_object:
+       GET_VREG_OBJECT a0, t0  // a0 := refs[AA]
+%    else:
+%      get_vreg("a0", "t0")    #  a0 := fp[AA]
+       // The method may return to compiled code, so also place result in fa0.
+       fmv.w.x fa0, a0
+%#:
+
+   CFI_REMEMBER_STATE
+   ld sp, -8(xREFS)  // caller's interpreted frame pointer
+   .cfi_def_cfa sp, NTERP_SIZE_SAVE_CALLEE_SAVES
+   RESTORE_NTERP_SAVE_CALLEE_SAVES
+   DECREASE_FRAME NTERP_SIZE_SAVE_CALLEE_SAVES
+   ret
+   // Since opcode handlers are merely labeled asm chunks within ExecuteNterpImpl's FDE, we must
+   // restate the correct CFA rule for subsequent handlers. It is initially stated when setting up
+   // the nterp frame (setup_nterp_frame).
+   .cfi_restore_state
+   CFI_DEF_CFA_BREG_PLUS_UCONST CFI_REFS, -8, NTERP_SIZE_SAVE_CALLEE_SAVES
+
+// return-wide vAA
+// Format 11x: AA|10
 %def op_return_wide():
-%  op_return(is_object="0", is_void="0", is_wide="1")
+%  op_return(is_wide=True)
 
+// return-object vAA
+// Format 11x: AA|11
+%def op_return_object():
+%  op_return(is_object=True)
+
+// throw vAA
+// Format 11x: AA|27
+// Throw the indicated exception.
 %def op_throw():
-    unimp
+   EXPORT_PC
+   srliw t0, xINST, 8      // t0 := AA
+   GET_VREG_OBJECT a0, t0  // a0 := exception object
+   mv a1, xSELF
+   call art_quick_deliver_exception  // args a0, a1
+   unimp
+
+// goto +AA
+// Format 10t: AA|28
+// Unconditionally jump to the indicated instruction.
+// Note: The branch offset must not be 0.
+%def op_goto():
+   srliw t0, xINST, 8  // t0 := AA (zext)
+   sext.b t0, t0       // t0 := +AA (sext)
+   BRANCH units=t0
+
+// goto/16 +AAAA
+// Format 20t: 00|29 AAAA
+// Unconditionally jump to the indicated instruction.
+// Note: The branch offset must not be 0.
+%def op_goto_16():
+   FETCH t0, 1, signed=1  // t0 := +AAAA (sext)
+   BRANCH units=t0
+
+// goto/32 +AAAAAAAA
+// Format 30t: 00|2a AAAA(lo) AAAA(hi)
+// Unconditionally jump to the indicated instruction.
+%def op_goto_32():
+   FETCH t0, 1, signed=1, width=32  // t0 := +AAAAAAAA (sext)
+   BRANCH units=t0
+
+// packed-switch vAA, +BBBBBBBB
+// Format 31t: AA|2b BBBB(lo) BBBB(hi)
+// Jump to a new instruction based on the value in the given register, using a table of offsets
+// corresponding to each value in a particular integral range, or fall through to the next
+// instruction if there is no match.
+%def op_packed_switch(is_packed=True):
+   srliw t0, xINST, 8          // t0 := AA
+   FETCH t1, count=1, signed=1, width=32  // t1 := +BBBBBBBB (sext)
+%  get_vreg("a1", "t0")        #  a1 := vAA
+   sh1add a0, t1, xPC          // a0 := +BBBBBBBB * 2 + xPC
+%  if is_packed:
+     call NterpDoPackedSwitch  // args a0 (switchData), a1 (value)
+%  else:
+     call NterpDoSparseSwitch  // args a0 (switchData), a1 (value)
+%#:
+   BRANCH units=a0
+
+// sparse-switch vAA, +BBBBBBBB
+// Format 31t: AA|2c BBBB(lo) BBBB(hi)
+// Jump to a new instruction based on the value in the given register, using an ordered table of
+// value-offset pairs, or fall through to the next instruction if there is no match.
+%def op_sparse_switch():
+%  op_packed_switch(is_packed=False)
+
+// cmp-long vAA, vBB, vCC
+// Format 23x: AA|31 CC|BB
+%def op_cmp_long():
+   FETCH t1, count=1     // t1 := CC|BB
+   srliw t0, xINST, 8    // t0 := AA
+   srliw t2, t1, 8       // t2 := CC
+   andi t1, t1, 0xFF     // t1 := BB
+   GET_VREG_WIDE t1, t1  // t1 := fp[BB]
+   GET_VREG_WIDE t2, t2  // t2 := fp[CC]
+   // Note: Formula "(SLT r,l) - (SLT l,r)" lifted from compiler.
+   slt t3, t1, t2
+   slt t4, t2, t1
+   sub t4, t4, t3
+   FETCH_ADVANCE_INST 2
+%  set_vreg("t4", "t0", z0="t1")  # fp[AA] := t4
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+// Common helper for if-test.
+// Format 22t: B|A|op CCCC
+%def bincmp(op):
+   srliw t0, xINST, 8   // t0 := B|A
+   srliw t1, xINST, 12  // t1 := B
+   andi t0, t0, 0xF     // t0 := A
+%  get_vreg("t0", "t0")  # t0 := vA
+%  get_vreg("t1", "t1")  # t1 := vB
+   b${op} t0, t1, .L${opcode}_branch
+
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE t2
+   GOTO_OPCODE t2
+
+.L${opcode}_branch:
+   FETCH t2, count=1, signed=1  // t2 := +CCCC (sext)
+   BRANCH units=t2
+
+// if-eq vA, vB, +CCCC
+// Format 22t: B|A|32 CCCC
+// Branch to the given destination if the given two registers' values compare as specified.
+// Note: The branch offset must not be 0.
+%def op_if_eq():
+%  bincmp(op="eq")
+
+// if-ne vA, vB, +CCCC
+// Format 22t: B|A|33 CCCC
+// Branch to the given destination if the given two registers' values compare as specified.
+// Note: The branch offset must not be 0.
+%def op_if_ne():
+%  bincmp(op="ne")
+
+// if-lt vA, vB, +CCCC
+// Format 22t: B|A|34 CCCC
+// Branch to the given destination if the given two registers' values compare as specified.
+// Note: The branch offset must not be 0.
+%def op_if_lt():
+%  bincmp(op="lt")
+
+// if-ge vA, vB, +CCCC
+// Format 22t: B|A|35 CCCC
+// Branch to the given destination if the given two registers' values compare as specified.
+// Note: The branch offset must not be 0.
+%def op_if_ge():
+%  bincmp(op="ge")
+
+// if-gt vA, vB, +CCCC
+// Format 22t: B|A|36 CCCC
+// Branch to the given destination if the given two registers' values compare as specified.
+// Note: The branch offset must not be 0.
+%def op_if_gt():
+%  bincmp(op="gt")
+
+// if-le vA, vB, +CCCC
+// Format 22t: B|A|37 CCCC
+// Branch to the given destination if the given two registers' values compare as specified.
+// Note: The branch offset must not be 0.
+%def op_if_le():
+%  bincmp(op="le")
+
+// Common helper for if-testz.
+// Format 21t: AA|op BBBB
+%def zcmp(op):
+   srliw t0, xINST, 8   // t0 := AA
+%  get_vreg("t0", "t0")  # t0 := vAA
+   b${op} t0, .L${opcode}_branch
+
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE t1
+   GOTO_OPCODE t1
+
+.L${opcode}_branch:
+   FETCH t1, count=1, signed=1  // t1 := +BBBB (sext)
+   BRANCH units=t1
+
+// if-eqz vAA, +BBBB
+// Format 21t: AA|38 BBBB
+// Branch to the given destination if the given register's value compares with 0 as specified.
+// Note: The branch offset must not be 0.
+%def op_if_eqz():
+%  zcmp(op="eqz")
+
+// if-nez vAA, +BBBB
+// Format 21t: AA|39 BBBB
+// Branch to the given destination if the given register's value compares with 0 as specified.
+// Note: The branch offset must not be 0.
+%def op_if_nez():
+%  zcmp(op="nez")
+
+// if-ltz vAA, +BBBB
+// Format 21t: AA|3a BBBB
+// Branch to the given destination if the given register's value compares with 0 as specified.
+// Note: The branch offset must not be 0.
+%def op_if_ltz():
+%  zcmp(op="ltz")
+
+// if-gez vAA, +BBBB
+// Format 21t: AA|3b BBBB
+// Branch to the given destination if the given register's value compares with 0 as specified.
+// Note: The branch offset must not be 0.
+%def op_if_gez():
+%  zcmp(op="gez")
+
+// if-gtz vAA, +BBBB
+// Format 21t: AA|3c BBBB
+// Branch to the given destination if the given register's value compares with 0 as specified.
+// Note: The branch offset must not be 0.
+%def op_if_gtz():
+%  zcmp(op="gtz")
+
+// if-lez vAA, +BBBB
+// Format 21t: AA|3d BBBB
+// Branch to the given destination if the given register's value compares with 0 as specified.
+// Note: The branch offset must not be 0.
+%def op_if_lez():
+%  zcmp(op="lez")
+
diff --git a/runtime/interpreter/mterp/riscv64/floating_point.S b/runtime/interpreter/mterp/riscv64/floating_point.S
index cd6c82a..4a2ae21 100644
--- a/runtime/interpreter/mterp/riscv64/floating_point.S
+++ b/runtime/interpreter/mterp/riscv64/floating_point.S
@@ -1,128 +1,381 @@
-%def fbinop(instr=""):
-    unimp
+// Note: Floating point operations must follow IEEE 754 rules, using round-to-nearest and gradual
+// underflow, except where stated otherwise.
 
-%def fbinop2addr(instr=""):
-    unimp
+//
+// floating-point comparators vAA, vBB, vCC
+// Note: Perform the indicated floating point comparison, setting a to 0 if b == c, 1 if b > c, or
+// -1 if b < c. The "bias" listed indicates how NaN comparisons are treated: "gt bias" instructions
+// return 1 for NaN comparisons, and "lt bias" instructions return -1.
+//
 
-%def fbinopWide(instr=""):
-    unimp
+// cmpl-float vAA, vBB, vCC
+// Format 23x: AA|2d CC|BB
+// LT bias, if NaN then vAA := -1
+%def op_cmpl_float(is_double=False):
+   FETCH t1, count=1     // t1 := CC|BB
+   srliw t0, xINST, 8    // t0 := AA
+   srliw t2, t1, 8       // t2 := CC
+   andi t1, t1, 0xFF     // t1 := BB
+%  get_vreg_float("ft1", "t1", is_double=is_double)  # ft1 := fp[BB]
+%  get_vreg_float("ft2", "t2", is_double=is_double)  # ft2 := fp[CC]
+   // Note: Formula "((FLE r,l) - 1) + (FLT r,l)" lifted from compiler.
+%  precision = "d" if is_double else "s"
+   fle.${precision} t1, ft2, ft1
+   flt.${precision} t2, ft2, ft1
+   addi t1, t1, -1
+   add t2, t2, t1
+   FETCH_ADVANCE_INST 2
+%  set_vreg("t2", "t0", z0="t1")  # fp[AA] := result
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
 
-%def fbinopWide2addr(instr=""):
-    unimp
+// cmpg-float vvAA, vBB, vCC
+// Format 23x: AA|2e CC|BB
+// GT bias, if NaN then vAA := 1
+%def op_cmpg_float(is_double=False):
+   FETCH t1, count=1     // t1 := CC|BB
+   srliw t0, xINST, 8    // t0 := AA
+   srliw t2, t1, 8       // t2 := CC
+   andi t1, t1, 0xFF     // t1 := BB
+%  get_vreg_float("ft1", "t1", is_double=is_double)  # ft1 := fp[BB]
+%  get_vreg_float("ft2", "t2", is_double=is_double)  # ft2 := fp[CC]
+   // Note: Formula "((FLE l,r) ^ 1) - (FLT l,r)" lifted from compiler.
+%  precision = "d" if is_double else "s"
+   fle.${precision} t1, ft1, ft2
+   flt.${precision} t2, ft1, ft2
+   xori t1, t1, 1
+   sub t2, t1, t2
+   FETCH_ADVANCE_INST 2
+%  set_vreg("t2", "t0", z0="t1")  # fp[AA] := result
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
 
-%def funop(instr=""):
-    unimp
-
-%def funopNarrower(instr=""):
-    unimp
-
-%def funopWider(instr=""):
-    unimp
-
-%def op_add_double():
-    unimp
-
-%def op_add_double_2addr():
-    unimp
-
-%def op_add_float():
-    unimp
-
-%def op_add_float_2addr():
-    unimp
-
-%def op_cmpg_double():
-    unimp
-
-%def op_cmpg_float():
-    unimp
-
+// cmpl-double vAA, vBB, vCC
+// Format 23x: AA|2f CC|BB
+// LT bias, if NaN then vAA := -1
 %def op_cmpl_double():
-    unimp
+%  op_cmpl_float(is_double=True)
 
-%def op_cmpl_float():
-    unimp
+// cmpg-double vAA, vBB, vCC
+// Format 23x: AA|30 CC|BB
+// Note: Formula "((FLE l,r) ^ 1) - (FLT l,r)" lifted from compiler.
+// GT bias, if NaN then vAA := 1
+%def op_cmpg_double():
+%  op_cmpg_float(is_double=True)
 
-%def op_div_double():
-    unimp
+//
+// funop vA, vB
+// Format 12x: B|A|op
+//
 
-%def op_div_double_2addr():
-    unimp
-
-%def op_div_float():
-    unimp
-
-%def op_div_float_2addr():
-    unimp
-
-%def op_double_to_float():
-    unimp
-
-%def op_double_to_int():
-    unimp
-
-%def op_double_to_long():
-    unimp
-
-%def op_float_to_double():
-    unimp
-
-%def op_float_to_int():
-    unimp
-
-%def op_float_to_long():
-    unimp
-
-%def op_int_to_double():
-    unimp
-
-%def op_int_to_float():
-    unimp
-
-%def op_long_to_double():
-    unimp
-
-%def op_long_to_float():
-    unimp
-
-%def op_mul_double():
-    unimp
-
-%def op_mul_double_2addr():
-    unimp
-
-%def op_mul_float():
-    unimp
-
-%def op_mul_float_2addr():
-    unimp
-
-%def op_neg_double():
-    unimp
-
+// neg-float vA, vB
+// Format 12x: B|A|7f
 %def op_neg_float():
-    unimp
+%  generic_funop(instr="fneg.s ft0, ft0", dst="s", src="s")
 
-%def op_rem_double():
-    unimp
+// neg-double vA, vB
+// Format 12x: B|A|80
+%def op_neg_double():
+%  generic_funop(instr="fneg.d ft0, ft0", dst="d", src="d")
 
-%def op_rem_double_2addr():
-    unimp
+// int-to-float vA, vB
+// Format 12x: B|A|82
+// Note: Conversion of int32 to float, using round-to-nearest. This loses precision for some values.
+// Note: For ties, the IEEE 754-2008 standard defaults to "roundTiesToEven" for binary floats.
+%def op_int_to_float():
+%  generic_funop(instr="fcvt.s.w ft0, t1, rne", dst="s", src="w")
 
-%def op_rem_float():
-    unimp
+// int-to-double vA, vB
+// Format 12x: B|A|83
+// Note: Conversion of int32 to double.
+%def op_int_to_double():
+%  generic_funop(instr="fcvt.d.w ft0, t1", dst="d", src="w")
 
-%def op_rem_float_2addr():
-    unimp
+// long-to-float vA, vB
+// Format 12x: B|A|85
+// Note: Conversion of int64 to float, using round-to-nearest. This loses precision for some values.
+// Note: For ties, the IEEE 754-2008 standard defaults to "roundTiesToEven" for binary floats.
+%def op_long_to_float():
+%  generic_funop(instr="fcvt.s.l ft0, t1, rne", dst="s", src="l")
 
-%def op_sub_double():
-    unimp
+// long-to-double vA, vB
+// Format 12x: B|A|86
+// Note: Conversion of int64 to double, using round-to-nearest. This loses precision for some values.
+// Note: For ties, the IEEE 754-2008 standard defaults to "roundTiesToEven" for binary floats.
+%def op_long_to_double():
+%  generic_funop(instr="fcvt.d.l ft0, t1, rne", dst="d", src="l")
 
-%def op_sub_double_2addr():
-    unimp
+// float-to-int vA, vB
+// Format 12x: B|A|87
+// Note: Conversion of float to int32, using round-toward-zero. NaN and -0.0 (negative zero)
+// convert to the integer 0. Infinities and values with too large a magnitude to be represented
+// get converted to either 0x7fffffff or -0x80000000 depending on sign.
+//
+// FCVT.W.S RTZ has the following behavior:
+// - NaN rounds to 0x7ffffff - requires check and set to zero.
+// - negative zero rounds to zero - matches dex spec.
+// - pos inf rounds to 0x7fffffff - matches dex spec.
+// - neg inf rounds to 0x80000000 - matches dex spec.
+%def op_float_to_int():
+%  generic_funop(instr="fcvt.w.s t1, ft0, rtz", dst="w", src="s", nan_zeroed=True)
 
+// float-to-long vA, vB
+// Format 12x: B|A|88
+// Note: Conversion of float to int64, using round-toward-zero. The same special case rules as for
+// float-to-int apply here, except that out-of-range values get converted to either
+// 0x7fffffffffffffff or -0x8000000000000000 depending on sign.
+//
+// FCVT.L.S RTZ has the following behavior:
+// - NaN rounds to 0x7fffffffffffffff - requires check and set to zero.
+// - negative zero rounds to zero - matches dex spec.
+// - pos inf rounds to 0x7fffffffffffffff - matches dex spec.
+// - neg inf rounds to 0x8000000000000000 - matches dex spec.
+%def op_float_to_long():
+%  generic_funop(instr="fcvt.l.s t1, ft0, rtz", dst="l", src="s", nan_zeroed=True)
+
+// float-to-double vA, vB
+// Format 12x: B|A|89
+// Note: Conversion of float to double, preserving the value exactly.
+%def op_float_to_double():
+%  generic_funop(instr="fcvt.d.s ft0, ft0", dst="d", src="s")
+
+// double-to-int vA, vB
+// Format 12x: B|A|8a
+// Note: Conversion of double to int32, using round-toward-zero. The same special case rules as for
+// float-to-int apply here.
+%def op_double_to_int():
+%  generic_funop(instr="fcvt.w.d t1, ft0, rtz", dst="w", src="d", nan_zeroed=True)
+
+// double-to-long vA, vB
+// Format 12x: B|A|8b
+// Note: Conversion of double to int64, using round-toward-zero. The same special case rules as for
+// float-to-long apply here.
+%def op_double_to_long():
+%  generic_funop(instr="fcvt.l.d t1, ft0, rtz", dst="l", src="d", nan_zeroed=True)
+
+// double-to-float vA, vB
+// Format 12x: B|A|8c
+// Note: Conversion of double to float, using round-to-nearest. This loses precision for some values.
+// Note: For ties, the IEEE 754-2008 standard defaults to "roundTiesToEven" for binary floats.
+%def op_double_to_float():
+%  generic_funop(instr="fcvt.s.d ft0, ft0, rne", dst="s", src="d")
+
+// unop boilerplate
+// instr: operand held in t1 or ft0, result written to t1 or ft0.
+// instr must not clobber t2.
+// dst: one of w (int32), l (int64), s (float), d (double)
+// src: one of w (int32), l (int64), s (float), d (double)
+// Clobbers: ft0, t0, t1, t2
+%def generic_funop(instr, dst, src, nan_zeroed=False):
+    srliw t0, xINST, 12        // t0 := B
+    srliw t2, xINST, 8         // t2 := B|A
+
+%  if src == "w":
+%    get_vreg("t1", "t0")     #  t1 := fp[B]
+%  elif src == "l":
+     GET_VREG_WIDE t1, t0     // t1 := fp[B]
+%  elif src == "s":
+%    get_vreg_float("ft0", "t0")  #  ft0 := fp[B]
+%  elif src == "d":
+     GET_VREG_DOUBLE ft0, t0  // ft0 := fp[B]
+%  else:
+%    assert false, src
+%#:
+    and t2, t2, 0xF            // t2 := A
+    FETCH_ADVANCE_INST 1       // advance xPC, load xINST
+%  if nan_zeroed:
+     // Okay to clobber T1. It is not read if nan_zeroed=True.
+     fclass.${src} t1, ft0  // fclass.s or fclass.d on the source register ft0
+     sltiu t1, t1, 0x100    // t1 := 0 if NaN, per dex spec. Skip the conversion.
+     beqz t1, 1f
+%#:
+    $instr                     // read operand (from t1|ft0), write result (to t1|ft0)
+                               // do not clobber t2!
+1:
+
+%  if dst == "w":
+%    set_vreg("t1", "t2", z0="t0")   #  fp[A] := t1
+%  elif dst == "l":
+     SET_VREG_WIDE t1, t2, z0=t0     // fp[A] := t1
+%  elif dst == "s":
+%    set_vreg_float("ft0", "t2", z0="t0")  # fp[A] := ft0
+%  elif dst == "d":
+     SET_VREG_DOUBLE ft0, t2, z0=t0  // fp[B] := ft0
+%  else:
+%    assert false, dst
+%#:
+
+   GET_INST_OPCODE t0         // t0 holds next opcode
+   GOTO_OPCODE t0             // continue to next
+
+//
+// fbinop vAA, vBB, vCC
+// Format 23x: AA|op CC|BB
+//
+
+// add-float vAA, vBB, vCC
+// Format 23x: AA|a6 CC|BB
+%def op_add_float():
+%  generic_fbinop(instr="fadd.s fa0, fa0, fa1, rne")
+
+// sub-float vAA, vBB, vCC
+// Format 23x: AA|a7 CC|BB
 %def op_sub_float():
-    unimp
+%  generic_fbinop(instr="fsub.s fa0, fa0, fa1, rne")
 
+// mul-float vAA, vBB, vCC
+// Format 23x: AA|a8 CC|BB
+%def op_mul_float():
+%  generic_fbinop(instr="fmul.s fa0, fa0, fa1, rne")
+
+// div-float vAA, vBB, vCC
+// Format 23x: AA|a9 CC|BB
+%def op_div_float():
+%  generic_fbinop(instr="fdiv.s fa0, fa0, fa1, rne")
+
+// rem-float vAA, vBB, vCC
+// Format 23x: AA|aa CC|BB
+// Note: Floating point remainder after division. This function is different than IEEE 754 remainder
+// and is defined as result == a - roundTowardZero(a / b) * b.
+// Note: RISC-V does not offer floating point remainder; use fmodf in libm.
+%def op_rem_float():
+%  generic_fbinop(instr="call fmodf")
+
+// add-double vAA, vBB, vCC
+// Format 23x: AA|ab CC|BB
+%def op_add_double():
+%  generic_fbinop(instr="fadd.d fa0, fa0, fa1, rne", is_double=True)
+
+// sub-double vAA, vBB, vCC
+// Format 23x: AA|ac CC|BB
+%def op_sub_double():
+%  generic_fbinop(instr="fsub.d fa0, fa0, fa1, rne", is_double=True)
+
+// mul-double vAA, vBB, vCC
+// Format 23x: AA|ad CC|BB
+%def op_mul_double():
+%  generic_fbinop(instr="fmul.d fa0, fa0, fa1, rne", is_double=True)
+
+// div-double vAA, vBB, vCC
+// Format 23x: AA|ae CC|BB
+%def op_div_double():
+%  generic_fbinop(instr="fdiv.d fa0, fa0, fa1, rne", is_double=True)
+
+// rem-double vAA, vBB, vCC
+// Format 23x: AA|af CC|BB
+// Note: Floating point remainder after division. This function is different than IEEE 754 remainder
+// and is defined as result == a - roundTowardZero(a / b) * b.
+// Note: RISC-V does not offer floating point remainder; use fmod in libm.
+%def op_rem_double():
+%  generic_fbinop(instr="call fmod", is_double=True)
+
+// fbinop boilerplate
+// instr: operands held in fa0 and fa1, result written to fa0
+// instr may be a libm call, so:
+//  - avoid caller-save state across instr; s11 is used instead.
+//  - fa0 and fa1 are used instead of ft0 and ft1.
+//
+// The is_double flag ensures vregs are read and written in 64-bit widths.
+// Clobbers: t0, t1, fa0, fa1, s11
+%def generic_fbinop(instr, is_double=False):
+   FETCH t0, count=1     // t0 := CC|BB
+   srliw s11, xINST, 8   // s11 := AA
+   srliw t1, t0, 8       // t1 := CC
+   and t0, t0, 0xFF      // t0 := BB
+%  get_vreg_float("fa1", "t1", is_double=is_double)
+                         // fa1 := fp[CC]
+%  get_vreg_float("fa0", "t0", is_double=is_double)
+                         // fa0 := fp[BB]
+   FETCH_ADVANCE_INST 2  // advance xPC, load xINST
+   $instr                // read fa0 and fa1, write result to fa0.
+                         // instr may be a function call.
+%  set_vreg_float("fa0", "s11", z0="t0", is_double=is_double)
+                         // fp[AA] := fa0
+   GET_INST_OPCODE t0    // t0 holds next opcode
+   GOTO_OPCODE t0        // continue to next
+
+//
+// fbinop/2addr vA, vB
+// Format 12x: B|A|op
+//
+
+// add-float/2addr vA, vB
+// Format 12x: B|A|c6
+%def op_add_float_2addr():
+%  generic_fbinop_2addr(instr="fadd.s fa0, fa0, fa1")
+
+// sub-float/2addr vA, vB
+// Format 12x: B|A|c7
 %def op_sub_float_2addr():
-    unimp
+%  generic_fbinop_2addr(instr="fsub.s fa0, fa0, fa1")
+
+// mul-float/2addr vA, vB
+// Format 12x: B|A|c8
+%def op_mul_float_2addr():
+%  generic_fbinop_2addr(instr="fmul.s fa0, fa0, fa1")
+
+// div-float/2addr vA, vB
+// Format 12x: B|A|c9
+%def op_div_float_2addr():
+%  generic_fbinop_2addr(instr="fdiv.s fa0, fa0, fa1")
+
+// rem-float/2addr vA, vB
+// Format 12x: B|A|ca
+// Note: Floating point remainder after division. This function is different than IEEE 754 remainder
+// and is defined as result == a - roundTowardZero(a / b) * b.
+// Note: RISC-V does not offer floating point remainder; use fmodf in libm.
+%def op_rem_float_2addr():
+%  generic_fbinop_2addr(instr="call fmodf")
+
+// add-double/2addr vA, vB
+// Format 12x: B|A|cb
+%def op_add_double_2addr():
+%  generic_fbinop_2addr(instr="fadd.d fa0, fa0, fa1", is_double=True)
+
+// sub-double/2addr vA, vB
+// Format 12x: B|A|cc
+%def op_sub_double_2addr():
+%  generic_fbinop_2addr(instr="fsub.d fa0, fa0, fa1", is_double=True)
+
+// mul-double/2addr vA, vB
+// Format 12x: B|A|cd
+%def op_mul_double_2addr():
+%  generic_fbinop_2addr(instr="fmul.d fa0, fa0, fa1", is_double=True)
+
+// div-double/2addr vA, vB
+// Format 12x: B|A|ce
+%def op_div_double_2addr():
+%  generic_fbinop_2addr(instr="fdiv.d fa0, fa0, fa1", is_double=True)
+
+// rem-double/2addr vA, vB
+// Format 12x: B|A|cf
+// Note: Floating point remainder after division. This function is different than IEEE 754 remainder
+// and is defined as result == a - roundTowardZero(a / b) * b.
+// Note: RISC-V does not offer floating point remainder; use fmod in libm.
+%def op_rem_double_2addr():
+%  generic_fbinop_2addr(instr="call fmod", is_double=True)
+
+// fbinop/2addr boilerplate
+// instr: operands held in fa0 and fa1, result written to fa0
+// instr may be a libm call, so:
+//  - avoid caller-save state across instr; s11 is used instead.
+//  - use fa0 and fa1 instead of ft0 and ft1.
+//
+// The is_double flag ensures vregs are read and written in 64-bit widths.
+// Clobbers: t0, t1, fa0, fa1, s11
+%def generic_fbinop_2addr(instr, is_double=False):
+   srliw t0, xINST, 8       // t0 := B|A
+   srliw t1, xINST, 12      // t1 := B
+   and t0, t0, 0xF          // t0 := A
+%  get_vreg_float("fa1", "t1", is_double=is_double)
+                             // fa1 := fp[B]
+   mv s11, t0               // s11 := A
+%  get_vreg_float("fa0", "t0", is_double=is_double)
+                             // fa0 := fp[A]
+   FETCH_ADVANCE_INST 1     // advance xPC, load xINST
+   $instr                   // read fa0 and f1, write result to fa0.
+                            // instr may be a function call.
+   GET_INST_OPCODE t1       // t1 holds next opcode
+%  set_vreg_float("fa0", "s11", z0="t0", is_double=is_double)
+                            // fp[A] := fa0
+   GOTO_OPCODE t1           // continue to next
diff --git a/runtime/interpreter/mterp/riscv64/invoke.S b/runtime/interpreter/mterp/riscv64/invoke.S
index 8d3b522..75229dc 100644
--- a/runtime/interpreter/mterp/riscv64/invoke.S
+++ b/runtime/interpreter/mterp/riscv64/invoke.S
@@ -1,56 +1,1699 @@
-%def op_invoke_custom():
-    unimp
+// Theory of operation. These invoke-X opcodes bounce to code labels in main.S which attempt a
+// variety of fast paths; the full asm doesn't fit in the per-opcode handler's size limit.
+//
+// Calling convention. There are three argument transfer types.
+// (A) Managed ABI -> Nterp. The ExecuteNterpImpl handles this case. We set up a fresh nterp frame
+//     and move arguments from machine arg registers (and sometimes stack) into the frame.
+// (B) Nterp -> Nterp. An invoke op's fast path handles this case. If we can stay in nterp, then
+//     we set up a fresh nterp frame, and copy the register slots from caller to callee.
+// (C) Nterp -> Managed ABI. Invoke op's remaining cases. To leave nterp, we read out arguments from
+//     the caller's nterp frame and place them into machine arg registers (and sometimes stack).
+//     Doing so requires obtaining and deciphering the method's shorty for arg type, width, and
+//     order info.
+//
+// Fast path structure.
+// (0) If the next method's "quick code" is nterp, then set up a fresh nterp frame and perform a
+//     vreg->vreg transfer. Jump to handler for the next method's first opcode.
+// - The following paths leave nterp. -
+// (1) If the next method is guaranteed to be only object refs, then the managed ABI is very simple:
+//     just place all arguments in the native arg registers using LWU. Call the quick code.
+// (2) The next method might have an arg/return shape that can avoid the shorty, or at least avoid
+//     most complications of the managed ABI arg setup.
+// (2.1) If the next method has 0 args, then peek ahead in dex: if no scalar return, then call the
+//       quick code. (Even when the next opcode is move-result-object, nterp will expect the
+//       reference at a0, matching where the managed ABI leaves it after the call.)
+// (2.2) If the next method has 0 args and scalar return, or has 1 arg, then obtain the shorty.
+// (2.2.1) Post-shorty: if 0 args, call the quick code. (After the call, a returned float must be
+//         copied from fa0 into a0.)
+// (2.2.2) Post-shorty: check the arg's shorty type. If 'L', we must load it with LWU. Otherwise, we
+//         load it with LW and store a copy into FA0 (to avoid another branch). Call the quick code.
+// - The fully pessimistic case. -
+// (3) The next method has 2+ arguments with a mix of float/double/long, OR it is polymorphic OR
+//     custom. Obtain the shorty and perform the full setup for managed ABI. Polymorphic and
+//     custom invokes are specially shunted to the runtime. Otherwise we call the quick code.
+//
+// Code organization. These functions are organized in a three tier structure to aid readability.
+// (P) The "front end" is an opcode handler, such as op_invoke_virtual(). They are defined in
+//     invoke.S. Since all the invoke code cannot fit in the allotted handler region, every invoke
+//     handler has code extending into a "back end".
+// (Q) The opcode handler calls a "back end" label that is located in main.S. The code for that
+//     label is defined in invoke.S. As a convention, the label in main.S is NterpInvokeVirtual. The
+//     code in invoke.S is nterp_invoke_virtual().
+// (R) For the Nterp to Nterp fast path case, the back end calls a label located in main.S, the code
+//     for which is defined in invoke.S. As a convention, the label in main.S is
+//     NterpToNterpInstance, and the code in invoke.S is nterp_to_nterp_instance().
+// Helpers for each tier are placed just after the functions of each tier.
 
-%def op_invoke_custom_range():
-    unimp
+//
+// invoke-kind {vC, vD, vE, vF, vG}, meth@BBBB
+// Format 35c: A|G|op BBBB F|E|D|C
+//
 
-%def invoke_direct_or_super(helper="", range="", is_super=""):
-    unimp
+// invoke-virtual {vC, vD, vE, vF, vG}, meth@BBBB
+// Format 35c: A|G|6e BBBB F|E|D|C
+//
+// Note: invoke-virtual is used to invoke a normal virtual method (a method that is not private,
+// static, or final, and is also not a constructor).
+%def op_invoke_virtual(range=""):
+   EXPORT_PC
+   FETCH s7, count=2                // s7 := F|E|D|C or CCCC (range)
+   FETCH_FROM_THREAD_CACHE a0, /*slow path*/2f, t0, t1
+                                    // a0 := method idx of resolved virtual method
+1:
+%  fetch_receiver(reg="a1", vreg="s7", range=range)
+                                    // a1 := fp[C] (this)
+   // Note: null case handled by SEGV handler.
+   lwu t0, MIRROR_OBJECT_CLASS_OFFSET(a1)
+                                    // t0 := klass object (32-bit addr)
+   UNPOISON_HEAP_REF t0
+   // Entry address = entry's byte offset in vtable + vtable's byte offset in klass object.
+   sh3add a0, a0, t0                // a0 := entry's byte offset
+   ld a0, MIRROR_CLASS_VTABLE_OFFSET_64(a0)
+                                    // a0 := ArtMethod*
+   tail NterpInvokeVirtual${range}  // args a0, a1, s7
+2:
+%  resolve_method_into_a0()
+   j 1b
 
-%def op_invoke_direct():
-    unimp
 
-%def op_invoke_direct_range():
-    unimp
+// invoke-super {vC, vD, vE, vF, vG}, meth@BBBB
+// Format 35c: A|G|6f BBBB F|E|D|C
+//
+// Note: When the method_id references a method of a non-interface class, invoke-super is used to
+// invoke the closest superclass's virtual method (as opposed to the one with the same method_id in
+// the calling class).
+// Note: In Dex files version 037 or later, if the method_id refers to an interface method,
+// invoke-super is used to invoke the most specific, non-overridden version of that method defined
+// on that interface. The same method restrictions hold as for invoke-virtual. In Dex files prior to
+// version 037, having an interface method_id is illegal and undefined.
+%def op_invoke_super(range=""):
+   EXPORT_PC
+   FETCH s7, count=2              // s7 := F|E|D|C or CCCC (range)
+   FETCH_FROM_THREAD_CACHE a0, /*slow path*/2f, t0, t1
+                                  // a0 := ArtMethod*
+1:
+%  fetch_receiver(reg="a1", vreg="s7", range=range)
+                                  // a1 := fp[C] (this)
+   beqz a1, 3f                    // throw if null
+   tail NterpInvokeSuper${range}  // args a0, a1, s7
+2:
+%  resolve_method_into_a0()
+   j 1b
+3:
+   tail common_errNullObject
 
-%def op_invoke_super():
-    unimp
 
-%def op_invoke_super_range():
-    unimp
+// invoke-direct {vC, vD, vE, vF, vG}, meth@BBBB
+// Format 35c: A|G|70 BBBB F|E|D|C
+//
+// Note: invoke-direct is used to invoke a non-static direct method (that is, an instance method
+// that is by its nature non-overridable, namely either a private instance method or a constructor).
+//
+// For additional context on string init, see b/28555675. The object reference is replaced after
+// the string factory call, so we disable thread-caching the resolution of string init, and skip
+// fast paths out to managed ABI calls.
+%def op_invoke_direct(range=""):
+   EXPORT_PC
+   FETCH s7, count=2               // s7 := F|E|D|C or CCCC (range)
+   FETCH_FROM_THREAD_CACHE a0, /*slow path*/2f, t0, t1
+                                   // a0 := ArtMethod*, never String.<init>
+1:
+%  fetch_receiver(reg="a1", vreg="s7", range=range)
+                                   // a1 := fp[C] (this)
+   beqz a1, 3f                     // throw if null
+   tail NterpInvokeDirect${range}  // args a0, a1, s7
+2:
+%  resolve_method_into_a0()        #  a0 := ArtMethod* or String.<init>
+   and t0, a0, 0x1                 // t0 := string-init bit
+   beqz t0, 1b                     // not string init
+   and a0, a0, ~0x1                // clear string-init bit
+   tail NterpInvokeStringInit${range}  // args a0, s7
+3:
+   tail common_errNullObject
 
-%def op_invoke_polymorphic():
-    unimp
 
-%def op_invoke_polymorphic_range():
-    unimp
+// invoke-static {vC, vD, vE, vF, vG}, meth@BBBB
+// Format 35c: A|G|71 BBBB F|E|D|C
+//
+// Note: invoke-static is used to invoke a static method (which is always considered a direct
+// method).
+%def op_invoke_static(range=""):
+   EXPORT_PC
+   // TODO: Unnecessary if A=0, and unnecessary if nterp-to-nterp.
+   FETCH s7, count=2               // s7 := F|E|D|C or CCCC (range)
+   FETCH_FROM_THREAD_CACHE a0, /*slow path*/1f, t0, t1
+                                   // a0 := ArtMethod*
+   tail NterpInvokeStatic${range}  // arg a0, s7
+1:
+%  resolve_method_into_a0()
+   tail NterpInvokeStatic${range}  // arg a0, s7
 
-%def invoke_interface(range=""):
-    unimp
 
-%def op_invoke_interface_slow_path():
-    unimp
+// invoke-interface {vC, vD, vE, vF, vG}, meth@BBBB
+// Format 35c: A|G|72 BBBB F|E|D|C
+//
+// Note: invoke-interface is used to invoke an interface method, that is, on an object whose
+// concrete class isn't known, using a method_id that refers to an interface.
+%def op_invoke_interface(range=""):
+   EXPORT_PC
+   FETCH s7, count=2               // s7 := F|E|D|C or CCCC (range)
+   // T0 is eventually used to carry the "hidden argument" in the managed ABI.
+   // This handler is tight on space, so we cache this arg in A0 and move it to T0 later.
+   // Here, A0 is one of
+   // (1) ArtMethod*
+   // (2) ArtMethod* with LSB #1 set (default method)
+   // (3) method index << 16 with LSB #0 set (j.l.Object method)
+   FETCH_FROM_THREAD_CACHE a0, /*slow path*/5f, t0, t1
+1:
+%  fetch_receiver(reg="a1", vreg="s7", range=range)
+                          // a1 := fp[C] (this)
+   // Note: null case handled by SEGV handler.
+   lwu t0, MIRROR_OBJECT_CLASS_OFFSET(a1)
+                          // t0 := klass object (32-bit addr)
+   UNPOISON_HEAP_REF t0
+   slliw t1, a0, 30       // test LSB #0 and #1
+   bltz t1, 3f            // LSB #1 is set; handle default method
+   bgtz t1, 4f            // LSB #0 is set; handle object method
+   // no signal bits; it is a clean ArtMethod*
+   lhu t1, ART_METHOD_IMT_INDEX_OFFSET(a0)
+                          // t1 := idx into interface method table (16-bit value)
+2:
+   ld t0, MIRROR_CLASS_IMT_PTR_OFFSET_64(t0)
+                          // t0 := base address of imt
+   sh3add t0, t1, t0      // t0 := entry's address in imt
+   ld a2, (t0)            // a2 := ArtMethod*
+   tail NterpInvokeInterface${range}  // a0 (hidden arg), a1 (this), a2 (ArtMethod*), s7 (vregs)
+3:
+   andi a0, a0, ~2        // a0 := default ArtMethod*, LSB #1 cleared
+   lhu t1, ART_METHOD_METHOD_INDEX_OFFSET(a0)
+                          // t1 := method_index_ (16-bit value)
+   // Default methods have a contract with art::IMTable.
+   andi t1, t1, ART_METHOD_IMT_MASK
+                          // t1 := idx into interface method table
+   j 2b
+4:
+   // Interface methods on j.l.Object have a contract with NterpGetMethod.
+   srliw t1, a0, 16       // t3 := method index
+   sh3add t0, t1, t0      // t0 := entry's byte offset, before vtable offset adjustment
+   ld a0, MIRROR_CLASS_VTABLE_OFFSET_64(t0)
+   tail NterpInvokeDirect${range}  // args a0, a1, s7
+5:
+%  resolve_method_into_a0()
+   j 1b
 
-%def op_invoke_interface():
-    unimp
 
-%def op_invoke_interface_range():
-    unimp
+//
+// invoke-kind/range {vCCCC .. vNNNN}, meth@BBBB
+// Format 3rc: AA|op BBBB CCCC
+// where NNNN = CCCC + AA - 1, that is A determines the count 0..255, and C determines the first
+// register.
+//
 
-%def invoke_static(helper=""):
-    unimp
-
-%def op_invoke_static():
-    unimp
-
-%def op_invoke_static_range():
-    unimp
-
-%def invoke_virtual(helper="", range=""):
-    unimp
-
-%def op_invoke_virtual():
-    unimp
-
+// invoke-virtual/range {vCCCC .. vNNNN}, meth@BBBB
+// Format 3rc: AA|74 BBBB CCCC
+//
+// Note: invoke-virtual/range is used to invoke a normal virtual method (a method that is not
+// private, static, or final, and is also not a constructor).
 %def op_invoke_virtual_range():
-    unimp
+%   op_invoke_virtual(range="Range")
+
+
+// invoke-super/range {vCCCC .. vNNNN}, meth@BBBB
+// Format 3rc: AA|75 BBBB CCCC
+//
+// Note: When the method_id references a method of a non-interface class, invoke-super/range is used
+// to invoke the closest superclass's virtual method (as opposed to the one with the same method_id
+// in the calling class).
+// Note: In Dex files version 037 or later, if the method_id refers to an interface method,
+// invoke-super/range is used to invoke the most specific, non-overridden version of that method
+// defined on that interface. In Dex files prior to version 037, having an interface method_id is
+// illegal and undefined.
+%def op_invoke_super_range():
+%   op_invoke_super(range="Range")
+
+
+// invoke-direct/range {vCCCC .. vNNNN}, meth@BBBB
+// Format 3rc: AA|76 BBBB CCCC
+//
+// Note: invoke-direct/range is used to invoke a non-static direct method (that is, an instance
+// method that is by its nature non-overridable, namely either a private instance method or a
+// constructor).
+%def op_invoke_direct_range():
+%   op_invoke_direct(range="Range")
+
+
+// invoke-static/range {vCCCC .. vNNNN}, meth@BBBB
+// Format 3rc: AA|77 BBBB CCCC
+//
+// Note: invoke-static/range is used to invoke a static method (which is always considered a direct
+// method).
+%def op_invoke_static_range():
+%   op_invoke_static(range="Range")
+
+
+// invoke-interface/range {vCCCC .. vNNNN}, meth@BBBB
+// Format 3rc: AA|78 BBBB CCCC
+//
+// Note: invoke-interface/range is used to invoke an interface method, that is, on an object whose
+// concrete class isn't known, using a method_id that refers to an interface.
+%def op_invoke_interface_range():
+%   op_invoke_interface(range="Range")
+
+
+// invoke-polymorphic {vC, vD, vE, vF, vG}, meth@BBBB, proto@HHHH
+// Format 45cc: A|G|fa BBBB F|E|D|C HHHH
+//
+// Note: Invoke the indicated signature polymorphic method. The result (if any) may be stored with
+// an appropriate move-result* variant as the immediately subsequent instruction.
+//
+// The method reference must be to a signature polymorphic method, such as
+// java.lang.invoke.MethodHandle.invoke or java.lang.invoke.MethodHandle.invokeExact.
+//
+// The receiver must be an object supporting the signature polymorphic method being invoked.
+//
+// The prototype reference describes the argument types provided and the expected return type.
+//
+// The invoke-polymorphic bytecode may raise exceptions when it executes. The exceptions are
+// described in the API documentation for the signature polymorphic method being invoked.
+//
+// Present in Dex files from version 038 onwards.
+%def op_invoke_polymorphic(range=""):
+   EXPORT_PC
+   FETCH s7, count=2  // s7 := F|E|D|C or CCCC (range)
+   // No need to fetch the target method; the runtime handles it.
+%  fetch_receiver(reg="s8", vreg="s7", range=range)
+   beqz s8, 1f        // throw if null
+
+   ld a0, (sp)        // a0 := caller ArtMethod*
+   mv a1, xPC
+   call NterpGetShortyFromInvokePolymorphic  // args a0, a1
+   mv a1, s8
+   tail NterpInvokePolymorphic${range}  // args a0 (shorty), a1 (this), s7 (vregs)
+1:
+   tail common_errNullObject
+
+
+// invoke-polymorphic/range {vCCCC .. vNNNN}, meth@BBBB, proto@HHHH
+// Format 4rcc: AA|fb BBBB CCCC HHHH
+// where NNNN = CCCC + AA - 1, that is A determines the count 0..255, and C determines the first
+// register.
+//
+// Note: Invoke the indicated method handle. See the invoke-polymorphic description above for
+// details.
+//
+// Present in Dex files from version 038 onwards.
+%def op_invoke_polymorphic_range():
+%   op_invoke_polymorphic(range="Range")
+
+
+// invoke-custom {vC, vD, vE, vF, vG}, call_site@BBBB
+// Format 35c: A|G|fc BBBB F|E|D|C
+//
+// Note: Resolves and invokes the indicated call site. The result from the invocation (if any) may
+// be stored with an appropriate move-result* variant as the immediately subsequent instruction.
+//
+// This instruction executes in two phases: call site resolution and call site invocation.
+//
+// Call site resolution checks whether the indicated call site has an associated
+// java.lang.invoke.CallSite instance. If not, the bootstrap linker method for the indicated call
+// site is invoked using arguments present in the DEX file (see call_site_item). The bootstrap
+// linker method returns a java.lang.invoke.CallSite instance that will then be associated with the
+// indicated call site if no association exists. Another thread may have already made the
+// association first, and if so execution of the instruction continues with the first associated
+// java.lang.invoke.CallSite instance.
+//
+// Call site invocation is made on the java.lang.invoke.MethodHandle target of the resolved
+// java.lang.invoke.CallSite instance. The target is invoked as if executing invoke-polymorphic
+// (described above) using the method handle and arguments to the invoke-custom instruction as the
+// arguments to an exact method handle invocation.
+//
+// Exceptions raised by the bootstrap linker method are wrapped in a java.lang.BootstrapMethodError.
+// A BootstrapMethodError is also raised if:
+// - the bootstrap linker method fails to return a java.lang.invoke.CallSite instance.
+// - the returned java.lang.invoke.CallSite has a null method handle target.
+// - the method handle target is not of the requested type.
+//
+// Present in Dex files from version 038 onwards.
+%def op_invoke_custom(range=""):
+   EXPORT_PC
+   ld a0, (sp)  // a0 := caller ArtMethod*
+   mv a1, xPC
+   call NterpGetShortyFromInvokeCustom  // args a0, a1
+   mv s7, a0    // s7 := shorty
+   FETCH a0, 1  // a0 := BBBB
+   FETCH s8, 2  // s8 := F|E|D|C or CCCC (range)
+   tail NterpInvokeCustom${range}  // args a0 (BBBB), s7 (shorty), s8 (vregs)
+
+
+// invoke-custom/range {vCCCC .. vNNNN}, call_site@BBBB
+// Format 3rc: AA|fd BBBB CCCC
+// where NNNN = CCCC + AA - 1, that is A determines the count 0..255, and C determines the first
+// register.
+//
+// Note: Resolve and invoke a call site. See the invoke-custom description above for details.
+//
+// Present in Dex files from version 038 onwards.
+%def op_invoke_custom_range():
+%  op_invoke_custom(range="Range")
+
+
+// handler helpers
+
+%def resolve_method_into_a0():
+   mv a0, xSELF
+   ld a1, (sp)  // We can't always rely on a0 = ArtMethod*.
+   mv a2, xPC
+   call nterp_get_method
+
+
+%def fetch_receiver(reg="", vreg="", range=""):
+%  if range == 'Range':
+     GET_VREG_OBJECT $reg, $vreg           // reg := refs[CCCC]
+%  else:
+     andi $reg, $vreg, 0xF                 // reg := C
+     GET_VREG_OBJECT $reg, $reg            // reg := refs[C]
+
+
+//
+// These asm blocks are positioned in main.S for visibility to stack walking.
+//
+
+
+// NterpInvokeVirtual
+// a0: ArtMethod*
+// a1: this
+// s7: vreg ids F|E|D|C
+%def nterp_invoke_virtual():
+%  nterp_invoke_direct(uniq="invoke_virtual")
+
+
+// NterpInvokeSuper
+// a0: ArtMethod*
+// a1: this
+// s7: vreg ids F|E|D|C
+%def nterp_invoke_super():
+%  nterp_invoke_direct(uniq="invoke_super")
+
+
+// NterpInvokeDirect
+// a0: ArtMethod*
+// a1: this
+// s7: (regular) vreg ids F|E|D|C, (range) vreg id CCCC
+%def nterp_invoke_direct(uniq="invoke_direct", range=""):
+   ld s8, ART_METHOD_QUICK_CODE_OFFSET_64(a0)
+                                 // s8 := quick code
+%  try_nterp(quick="s8", z0="t0", skip=f".L{uniq}_simple")
+   call NterpToNterpInstance${range}  // args a0, a1
+   j .L${uniq}_next_op
+
+.L${uniq}_simple:
+%  if range == 'Range':
+%    try_simple_args_range(vC="s7", z0="t0", z1="t1", z2="t2", z3="t3", z4="t4", skip=f".L{uniq}_01", uniq=uniq)
+%  else:
+%    try_simple_args(v_fedc="s7", z0="t0", z1="t1", skip=f".L{uniq}_01", uniq=uniq)
+%#:
+   jalr s8                       // (regular) args a0 - a5, (range) args a0 - a7 and stack
+   j .L${uniq}_next_op
+
+.L${uniq}_01:
+   mv s9, zero                   // initialize shorty reg
+%  try_01_args(vreg="s7", shorty="s9", z0="t0", z1="t1", z2="t2", y0="s10", y1="s11", y2="s0", skip=f".L{uniq}_slow", call=f".L{uniq}_01_call", uniq=uniq, range=range)
+                                 // if s9 := shorty, then maybe (a2, fa0) := fp[D] or fp[CCCC + 1]
+.L${uniq}_01_call:
+   jalr s8                       // args a0, a1, and maybe a2, fa0
+   beqz s9, .L${uniq}_next_op    // no shorty, no scalar return
+%  maybe_float_returned(shorty="s9", z0="t0", z1="t1", uniq=f"{uniq}_0")
+                                 // a0 := fa0 if float return
+   j .L${uniq}_next_op
+
+.L${uniq}_slow:
+%  get_shorty_save_a0_a1(shorty="s9", y0="s10", y1="s11")
+%  if range == 'Range':
+%    slow_setup_args_range(shorty="s9", vC="s7", z0="t0", z1="t1", z2="t2", z3="t3", z4="t4", z5="t5", z6="t6", z7="s10", uniq=uniq)
+%  else:
+%    slow_setup_args(shorty="s9", vregs="s7", z0="t0", z1="t1", z2="t2", z3="t3", z4="t4", z5="t5", z6="t6", uniq=uniq)
+%#:
+   jalr s8                       // args in a0-a5, fa0-fa4
+%  maybe_float_returned(shorty="s9", z0="t0", z1="t1", uniq=f"{uniq}_1")
+                                 // a0 := fa0 if float return
+.L${uniq}_next_op:
+   FETCH_ADVANCE_INST 3
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+
+// NterpInvokeStringInit
+// a0: ArtMethod*
+// s7: (regular) vreg ids F|E|D|C, (range) vreg id CCCC
+%def nterp_invoke_string_init(uniq="invoke_string_init", range=""):
+   ld s8, ART_METHOD_QUICK_CODE_OFFSET_64(a0)
+                        // s8 := quick code
+%  try_nterp(quick="s8", z0="t0", skip=f".L{uniq}_slow")
+   call NterpToNterpStringInit${range}  // arg a0
+   j .L${uniq}_next_op
+
+.L${uniq}_slow:
+%  get_shorty_save_a0_a1(shorty="s9", y0="s10", y1="s11")
+%  if range == 'Range':
+%    slow_setup_args_string_init_range(shorty="s9", vC="s7", z0="t0", z1="t1", z2="t2", z3="t3", uniq=uniq)
+%  else:
+%    slow_setup_args_string_init(shorty="s9", v_fedc="s7", z0="t0", z1="t1", z2="t2", uniq=uniq)
+%#:
+   jalr s8              // args (regular) a0 - a5, (range) a0 - a5
+
+.L${uniq}_next_op:
+%  fetch_receiver(reg="t0", vreg="s7", range=range)
+                        // t0 := fp[C] (this)
+%  subst_vreg_references(old="t0", new="a0", z0="t1", z1="t2", z2="t3", uniq=uniq)
+   FETCH_ADVANCE_INST 3
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+
+// NterpInvokeStatic
+// a0: ArtMethod*
+// s7: (regular) vreg ids F|E|D|C, (range) vreg id CCCC
+%def nterp_invoke_static(uniq="invoke_static", range=""):
+   ld s8, ART_METHOD_QUICK_CODE_OFFSET_64(a0)
+                               // s8 := quick code
+%  try_nterp(quick="s8", z0="t0", skip=f".L{uniq}_simple")
+   call NterpToNterpStatic${range}  // arg a0
+   j .L${uniq}_next_op
+
+.L${uniq}_simple:
+%  if range == 'Range':
+%    try_simple_args_range(vC="s7", z0="t0", z1="t1", z2="t2", z3="t3", z4="t4", arg_start="0", skip=f".L{uniq}_01", uniq=uniq)
+%  else:
+%    try_simple_args(v_fedc="s7", z0="t0", z1="t1", arg_start="0", skip=f".L{uniq}_01", uniq=uniq)
+%#:
+   jalr s8                     // args (regular) a0 - a5, (range) a0 - a7 and maybe stack
+   j .L${uniq}_next_op
+
+.L${uniq}_01:
+   mv s9, zero                 // initialize shorty reg
+%  try_01_args_static(vreg="s7", shorty="s9", z0="t0", z1="t1", z2="t2", y0="s10", y1="s11", skip=f".L{uniq}_slow", call=f".L{uniq}_01_call", uniq=uniq, range=range)
+                               // if s9 := shorty, then maybe (a2, fa0) := fp[C] or fp[CCCC]
+.L${uniq}_01_call:
+   jalr s8                     // args a0, and maybe a1, fa0
+   beqz s9, .L${uniq}_next_op  // no shorty, no scalar return
+%  maybe_float_returned(shorty="s9", z0="t0", z1="t1", uniq=f"{uniq}_0")
+                               // a0 := fa0 if float return
+   j .L${uniq}_next_op
+
+.L${uniq}_slow:
+%  get_shorty_save_a0(shorty="s9", y0="s10")
+%  if range == 'Range':
+%    slow_setup_args_range(shorty="s9", vC="s7", z0="t0", z1="t1", z2="t2", z3="t3", z4="t4", z5="t5", z6="t6", z7="s10", arg_start="0", uniq=uniq)
+%  else:
+%    slow_setup_args(shorty="s9", vregs="s7", z0="t0", z1="t1", z2="t2", z3="t3", z4="t4", z5="t5", z6="t6", arg_start="0", uniq=uniq)
+%#:
+   jalr s8                     // args (regular) a0 - a5 and fa0 - fa4, (range) a0 - a7 and fa0 - fa7 and maybe stack
+%  maybe_float_returned(shorty="s9", z0="t0", z1="t1", uniq=f"{uniq}_1")
+                               // a0 := fa0 if float return
+.L${uniq}_next_op:
+   FETCH_ADVANCE_INST 3
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+
+// NterpInvokeInterface
+// a0: the target interface method
+//     - ignored in nterp-to-nterp transfer
+//     - preserved through shorty calls
+//     - side-loaded in T0 as a "hidden argument" in managed ABI transfer
+// a1: this
+// a2: ArtMethod*
+// s7: vreg ids F|E|D|C
+%def nterp_invoke_interface(uniq="invoke_interface", range=""):
+   // We immediately adjust the incoming arguments to suit the rest of the invoke.
+   mv t0, a0                   // t0 := hidden arg, preserve until quick call
+   mv a0, a2                   // a0 := ArtMethod*
+
+   ld s8, ART_METHOD_QUICK_CODE_OFFSET_64(a0)
+                               // s8 := quick code
+%  try_nterp(quick="s8", z0="t1", skip=f".L{uniq}_simple")
+   call NterpToNterpInstance${range}  // args a0, a1
+   j .L${uniq}_next_op
+
+.L${uniq}_simple:
+%  if range == 'Range':
+%    try_simple_args_range(vC="s7", z0="t1", z1="t2", z2="t3", z3="t4", z4="t5", skip=f".L{uniq}_01", uniq=uniq)
+%  else:
+%    try_simple_args(v_fedc="s7", z0="t1", z1="t2", skip=f".L{uniq}_01", uniq=uniq)
+%#:
+   jalr s8                     // args (regular) a0 - a5 and t0, (range) a0 - a7 and t0 and maybe stack
+   j .L${uniq}_next_op
+
+.L${uniq}_01:
+   mv s9, zero                 // initialize shorty reg
+%  try_01_args(vreg="s7", shorty="s9", z0="t1", z1="t2", z2="t3", y0="s10", y1="s11", y2="s0", interface=True, skip=f".L{uniq}_slow", call=f".L{uniq}_01_call", uniq=uniq, range=range)
+                               // if s9 := shorty, then maybe (a2, fa0) := fp[D] or fp[CCCC + 1]
+                               // (xINST clobbered, if taking this fast path)
+.L${uniq}_01_call:
+   jalr s8                     // args a0, a1, and t0, and maybe a2, fa0
+   beqz s9, .L${uniq}_next_op  // no shorty, no scalar return
+%  maybe_float_returned(shorty="s9", z0="t0", z1="t1", uniq=f"{uniq}_0")
+                               // a0 := fa0 if float return
+   j .L${uniq}_next_op
+
+.L${uniq}_slow:
+%  get_shorty_for_interface_save_a0_a1_t0(shorty="s9", y0="s10", y1="s11", y2="s0")
+%  if range == 'Range':
+%    slow_setup_args_range(shorty="s9", vC="s7", z0="s10", z1="t1", z2="t2", z3="t3", z4="t4", z5="t5", z6="t6", z7="s11", uniq=uniq)
+%  else:
+%    slow_setup_args(shorty="s9", vregs="s7", z0="s10", z1="t1", z2="t2", z3="t3", z4="t4", z5="t5", z6="t6", uniq=uniq)
+%#:
+   jalr s8                     // args (regular) a0 - a5, fa0 - fa4, t0, (range) a0 - a7, fa0 - fa7, t0
+%  maybe_float_returned(shorty="s9", z0="t0", z1="t1", uniq=f"{uniq}_1")
+                               // a0 := fa0 if float return
+.L${uniq}_next_op:
+   FETCH_ADVANCE_INST 3
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+
+// NterpInvokePolymorphic
+// a0: shorty
+// a1: receiver this
+// s7: (regular) vreg ids F|E|D|C, (range) vreg id CCCC
+%def nterp_invoke_polymorphic(uniq="invoke_polymorphic", range=""):
+%  if range == "Range":
+%    slow_setup_args_range(shorty="a0", vC="s7", z0="t0", z1="t1", z2="t2", z3="t3", z4="t4", z5="t5", z6="t6", z7="s8", uniq=uniq)
+%  else:
+%    slow_setup_args(shorty="a0", vregs="s7", z0="t0", z1="t1", z2="t2", z3="t3", z4="t4", z5="t5", z6="t6", uniq=uniq)
+%#:
+   // Managed ABI argument regs get spilled to stack and consumed by artInvokePolymorphic.
+   call art_quick_invoke_polymorphic  // args a1 - a7, fa0 - fa7, and maybe stack
+   // Note: If float return, artInvokePolymorphic will place the value in A0, as Nterp expects.
+   FETCH_ADVANCE_INST 4
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+
+// NterpInvokeCustom
+// a0: BBBB
+// s7: shorty
+// s8: (regular) vreg ids F|E|D|C, (range) vreg id CCCC
+%def nterp_invoke_custom(uniq="invoke_custom", range=""):
+%  if range == "Range":
+%    slow_setup_args_range(shorty="s7", vC="s8", z0="t0", z1="t1", z2="t2", z3="t3", z4="t4", z5="t5", z6="t6", z7="s9", arg_start="0", uniq=uniq)
+%  else:
+%    slow_setup_args(shorty="s7", vregs="s8", z0="t0", z1="t1", z2="t2", z3="t3", z4="t4", z5="t5", z6="t6", arg_start="0", uniq=uniq)
+%#:
+   // Managed ABI argument regs get spilled to stack and consumed by artInvokeCustom.
+   call art_quick_invoke_custom  // args a0 - a7, fa0 - fa7, and maybe stack
+   // Note: If float return, artInvokeCustom will place the value in A0, as Nterp expects.
+   FETCH_ADVANCE_INST 3
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+
+// NterpInvokeVirtualRange
+// a0: ArtMethod*
+// a1: this
+// s7: vreg id CCCC
+%def nterp_invoke_virtual_range():
+%  nterp_invoke_direct(uniq="invoke_virtual_range", range="Range")
+
+
+// NterpInvokeSuperRange
+// a0: ArtMethod*
+// a1: this
+// s7: vreg id CCCC
+%def nterp_invoke_super_range():
+%  nterp_invoke_direct(uniq="invoke_super_range", range="Range")
+
+
+// NterpInvokeDirectRange
+// Hardcoded:
+// a0: ArtMethod*
+// a1: this
+// s7: vreg id CCCC
+%def nterp_invoke_direct_range():
+%  nterp_invoke_direct(uniq="invoke_direct_range", range="Range")
+
+
+// NterpInvokeStringInitRange
+// a0: ArtMethod*
+// s7: vreg id CCCC
+%def nterp_invoke_string_init_range():
+%  nterp_invoke_string_init(uniq="invoke_string_init_range", range="Range")
+
+
+// NterpInvokeStaticRange
+// a0: ArtMethod*
+// s7: vreg id CCCC
+%def nterp_invoke_static_range():
+%  nterp_invoke_static(uniq="invoke_static_range", range="Range")
+
+
+// NterpInvokeInterfaceRange
+// a0: the target interface method
+//     - ignored in nterp-to-nterp transfer
+//     - preserved through shorty calls
+//     - side-loaded in T0 as a "hidden argument" in managed ABI transfer
+// a1: this
+// a2: ArtMethod*
+// s7: vreg id CCCC
+%def nterp_invoke_interface_range():
+%  nterp_invoke_interface(uniq="invoke_interface_range", range="Range")
+
+
+// NterpInvokePolymorphicRange
+%def nterp_invoke_polymorphic_range():
+%  nterp_invoke_polymorphic(uniq="invoke_polymorphic_range", range="Range")
+
+
+// NterpInvokeCustomRange
+%def nterp_invoke_custom_range():
+%  nterp_invoke_custom(uniq="invoke_custom_range", range="Range")
+
+
+// fast path and slow path helpers
+
+
+// Input
+// - quick: quick code ptr
+// Temporaries: z0
+%def try_nterp(quick="", z0="", skip=""):
+   lla $z0, ExecuteNterpImpl
+   bne $z0, $quick, $skip
+
+
+// Hardcoded
+// - a0: ArtMethod*
+// - xINST
+// Input
+// - v_fedc: vreg ids F|E|D|C
+// Temporaries: z0, z1
+%def try_simple_args(v_fedc="", z0="", z1="", arg_start="1", skip="", uniq=""):
+   lwu $z0, ART_METHOD_ACCESS_FLAGS_OFFSET(a0)
+   // The meaning of nterp-invoke-fast-path-flag for RISC-V diverges from other ISAs.
+   BRANCH_IF_BIT_CLEAR $z0, $z0, ART_METHOD_NTERP_INVOKE_FAST_PATH_FLAG_BIT, $skip
+
+   srliw $z0, xINST, 12              // z0 := A
+%  if arg_start == "0":
+     beqz $z0, .L${uniq}_simple_done  // A = 0: no further args.
+%#:
+   li $z1, 2
+   blt $z0, $z1, .L${uniq}_simple_1  // A = 1
+   beq $z0, $z1, .L${uniq}_simple_2  // A = 2
+   li $z1, 4
+   blt $z0, $z1, .L${uniq}_simple_3  // A = 3
+   beq $z0, $z1, .L${uniq}_simple_4  // A = 4
+   // A = 5
+   srliw $z1, xINST, 8               // z1 := A|G
+   andi $z1, $z1, 0xF                // z1 := G
+   GET_VREG_OBJECT a5, $z1
+.L${uniq}_simple_4:
+   srliw $z1, $v_fedc, 12            // z1 := F
+   GET_VREG_OBJECT a4, $z1
+.L${uniq}_simple_3:
+   srliw $z1, $v_fedc, 8             // z1 := F|E
+   andi $z1, $z1, 0xF                // z1 := E
+   GET_VREG_OBJECT a3, $z1
+.L${uniq}_simple_2:
+   srliw $z1, $v_fedc, 4             // z1 := F|E|D
+   andi $z1, $z1, 0xF                // z1 := D
+   GET_VREG_OBJECT a2, $z1
+.L${uniq}_simple_1:
+%  if arg_start == "0":
+     andi $z1, $v_fedc, 0xF          // z1 := C
+     GET_VREG_OBJECT a1, $z1
+   // instance: a1 already set to "this"
+.L${uniq}_simple_done:
+
+
+// Range variant.
+%def try_simple_args_range(vC="", z0="", z1="", z2="", z3="", z4="", skip="", arg_start="1", uniq=""):
+   lwu $z0, ART_METHOD_ACCESS_FLAGS_OFFSET(a0)
+   // The meaning of nterp-invoke-fast-path-flag for RISC-V diverges from other ISAs.
+   BRANCH_IF_BIT_CLEAR $z0, $z0, ART_METHOD_NTERP_INVOKE_FAST_PATH_FLAG_BIT, $skip
+
+   srliw $z0, xINST, 8                 // z0 := AA
+%  if arg_start == "0":  # static:
+     beqz $z0, .L${uniq}_simple_done   // AA = 0: no further args.
+     sh2add $z1, $vC, xFP              // z1 := &FP[CCCC]
+     li $z2, 2
+     blt $z0, $z2, .L${uniq}_simple_1  // AA = 1
+%  else:  # instance:
+     li $z2, 2
+     blt $z0, $z2, .L${uniq}_simple_done  // AA = 1, and a1 already loaded.
+     sh2add $z1, $vC, xFP               // z1 := &FP[CCCC]
+%#:
+   // Here: z0, z1, z2 same values for static vs instance.
+   beq $z0, $z2, .L${uniq}_simple_2  // AA = 2
+   li $z2, 4
+   blt $z0, $z2, .L${uniq}_simple_3  // AA = 3
+   beq $z0, $z2, .L${uniq}_simple_4  // AA = 4
+   li $z2, 6
+   blt $z0, $z2, .L${uniq}_simple_5  // AA = 5
+   beq $z0, $z2, .L${uniq}_simple_6  // AA = 6
+   li $z2, 7
+   beq $z0, $z2, .L${uniq}_simple_7  // AA = 7
+
+   // AA >= 8: store in stack. Load/store from FP[CCCC + 7] upwards.
+   slli $z2, $z0, 63                 // z2 := negative if z0 bit #0 is set (odd)
+   sh2add $z0, $z0, $z1              // z0 := loop guard at top of stack
+   addi $z3, $z1, 7*4                // z3 := &FP[CCCC + 7]
+   addi $z4, sp, __SIZEOF_POINTER__ + 7*4
+                                     // z4 := &OUT[CCCC + 7]
+   bltz $z2, .L${uniq}_simple_loop_wide
+                                     // if AA odd, branch to wide-copy
+   lwu $z2, ($z3)
+   sw $z2, ($z4)
+   addi $z3, $z3, 4
+   addi $z4, $z4, 4
+
+.L${uniq}_simple_loop_wide:
+   // TODO: Consider ensuring 64-bit stores are aligned.
+   beq $z3, $z0, .L${uniq}_simple_7
+   ld $z2, ($z3)
+   sd $z2, ($z4)
+   addi $z3, $z3, 8
+   addi $z4, $z4, 8
+   j .L${uniq}_simple_loop_wide
+
+   // Bottom 7 slots of OUT array never written; first args are passed with a1-a7.
+.L${uniq}_simple_7:
+   lwu a7, 6*4($z1)
+.L${uniq}_simple_6:
+   lwu a6, 5*4($z1)
+.L${uniq}_simple_5:
+   lwu a5, 4*4($z1)
+.L${uniq}_simple_4:
+   lwu a4, 3*4($z1)
+.L${uniq}_simple_3:
+   lwu a3, 2*4($z1)
+.L${uniq}_simple_2:
+   lwu a2, 1*4($z1)
+.L${uniq}_simple_1:
+%  if arg_start == "0":  # static:
+     lwu a1, 0*4($z1)
+%#:
+.L${uniq}_simple_done:
+
+
+// Check if a 0/1 arg invoke form is possible, set up a2 and fa0 if needed.
+// If a return value expected, move possible float return to a0.
+// Hardcoded: xINST, xPC, xFP, a0, a1, t0, fa0
+// NOTE xINST clobbered if interface=True and we're taking the fast path.
+// zN are temporaries, yN are callee-save
+%def try_01_args(vreg="", shorty="", z0="", z1="", z2="", y0="", y1="", y2="", interface=False, skip="", call="", uniq="", range=""):
+%  if range == 'Range':
+     srliw $y0, xINST, 8   // y0 := AA
+%  else:
+     srliw $y0, xINST, 12  // y0 := A
+%#:
+   addi $y0, $y0, -2       // y0 := A - 2 or (range) AA - 2
+   bgtz $y0, $skip         // 2+ args: slow path
+   beqz $y0, .L${uniq}_01_shorty  // this and 1 arg: determine arg type with shorty
+   // 0 args
+%  try_01_args_peek_next(z0=z0)  # z0 is zero if invoke has scalar return
+   bnez $z0, $call         // Non-scalar return, 0 args: make the call.
+   // Scalar return, 0 args: determine return type with shorty
+
+.L${uniq}_01_shorty:
+   // Get shorty, stash in callee-save to be available on return.
+   // When getting shorty, stash this fast path's A0 and A1, then restore.
+%  if interface:
+     // xINST is a regular callee save. Safe: orig xINST value unused before FETCH_ADVANCE_INST.
+%    get_shorty_for_interface_save_a0_a1_t0(shorty=shorty, y0=y1, y1=y2, y2="xINST")
+%  else:
+%    get_shorty_save_a0_a1(shorty=shorty, y0=y1, y1=y2)
+%#:
+   // shorty assigned
+   bltz $y0, $call         // Scalar return, 0 args: make the call.
+   // ins = 2: this and 1 arg. Load arg type.
+   lb $z0, 1($shorty)      // z0 := first arg
+   li $z1, 'L'             // ref type
+%  if range == 'Range':
+     sh2add $z2, $vreg, xFP  // z2 := &fp[CCCC]
+     lwu a2, 4($z2)        // a2 := fp[CCCC + 1], zext
+%  else:
+     srliw $z2, $vreg, 4   // z2 := F|E|D
+     andi $z2, $z2, 0xF    // z2 := D
+     sh2add $z2, $z2, xFP  // z2 := &fp[D]
+     lwu a2, ($z2)         // a2 := fp[D], zext
+%#:
+   beq $z0, $z1, $call     // ref type: LWU into a2
+   // non-'L' type
+   fmv.w.x fa0, a2         // overload of managed ABI, for one arg
+   sext.w a2, a2           // scalar type: LW into a2
+   // immediately followed by call
+
+
+// Static variant.
+%def try_01_args_static(vreg="", shorty="", z0="", z1="", z2="", y0="", y1="", skip="", call="", uniq="", range=""):
+%  if range == 'Range':
+     srliw $y0, xINST, 8     // y0 := AA
+%  else:
+     srliw $y0, xINST, 12    // y0 := A
+%#:
+   addi $y0, $y0, -1         // y0 := A - 1 or (range) AA - 1
+   bgtz $y0, $skip           // 2+ args: slow path
+   beqz $y0, .L${uniq}_01_shorty  // 1 arg: determine arg type with shorty
+   // 0 args
+%  try_01_args_peek_next(z0=z0)  # z0 is zero if invoke has scalar return
+   bnez $z0, $call           // Non-scalar return, 0 args: make the call.
+   // Scalar return, 0 args: determine return type with shorty.
+
+.L${uniq}_01_shorty:
+   // Get shorty, stash in callee-save to be available on return.
+   // When getting shorty, stash this fast path's A0 then restore.
+%  get_shorty_save_a0(shorty=shorty, y0=y1)
+   // shorty assigned
+   bltz $y0, $call           // Scalar return, 0 args: make the call.
+   // ins = 1: load arg type
+   lb $z0, 1($shorty)        // z0 := first arg
+   li $z1, 'L'               // ref type
+%  if range == 'Range':
+     sh2add $z2, $vreg, xFP  // z2 := &fp[CCCC]
+%  else:
+     andi $z2, $vreg, 0xF    // z2 := C
+     sh2add $z2, $z2, xFP    // z2 := &fp[C]
+%#:
+   lwu a1, ($z2)             // a1 := fp[C] or (range) fp[CCCC], zext
+   beq $z0, $z1, $call       // ref type: LWU into a1
+   // non-'L' type
+   fmv.w.x fa0, a1           // overload of managed ABI, for one arg
+   sext.w a1, a1             // scalar type: LW into a1
+   // immediately followed by call
+
+
+%def try_01_args_peek_next(z0=""):
+   FETCH $z0, count=3, width=8, byte=0
+                                // z0 := next op
+   andi $z0, $z0, ~1            // clear bit #0
+   addi $z0, $z0, -0x0A         // z0 := zero if op is 0x0A or 0x0B
+
+
+// The invoked method might return in FA0, via managed ABI.
+// The next opcode, MOVE-RESULT{-WIDE}, expects the value in A0.
+%def maybe_float_returned(shorty="", z0="", z1="", uniq=""):
+   lb $z0, ($shorty)  // z0 := first byte of shorty; type of return
+   li $z1, 'F'        //
+   beq $z0, $z1, .L${uniq}_float_return_move
+   li $z1, 'D'        //
+   bne $z0, $z1, .L${uniq}_float_return_done
+.L${uniq}_float_return_move:
+   // If fa0 carries a 32-bit float, the hi bits of fa0 will contain all 1's (NaN boxing).
+   // The use of fmv.x.d will transfer those hi bits into a0, and that's okay, because the next
+   // opcode, move-result, will only read the lo 32-bits of a0 - the box bits are correctly ignored.
+   // If fa0 carries a 64-bit float, then fmv.x.d works as expected.
+   fmv.x.d a0, fa0
+.L${uniq}_float_return_done:
+
+
+// Hardcoded:
+// - a0: ArtMethod*
+// - a1: this
+// Callee-saves: y0, y1
+%def get_shorty_save_a0_a1(shorty="", y0="", y1=""):
+   mv $y1, a1
+   mv $y0, a0
+   call NterpGetShorty  // arg a0
+   mv $shorty, a0
+   mv a0, $y0
+   mv a1, $y1
+
+
+// Static variant.
+// Hardcoded:
+// - a0: ArtMethod*
+// Callee-saves: y0
+%def get_shorty_save_a0(shorty="", y0=""):
+   mv $y0, a0
+   call NterpGetShorty  // arg a0
+   mv $shorty, a0
+   mv a0, $y0
+
+
+// Interface variant.
+// Hardcoded:
+// - a0: ArtMethod*
+// - a1: this
+// - t0: "hidden argument"
+// Callee-saves: y0, y1, y2
+%def get_shorty_for_interface_save_a0_a1_t0(shorty="", y0="", y1="", y2=""):
+   mv $y2, t0
+   mv $y1, a1
+   mv $y0, a0
+   ld a0, (sp)            // a0 := caller ArtMethod*
+   FETCH reg=a1, count=1  // a1 := BBBB method idx
+   call NterpGetShortyFromMethodId
+   mv $shorty, a0
+   mv a0, $y0
+   mv a1, $y1
+   mv t0, $y2
+
+
+// Hardcoded: xFP, xREFS
+// Starting with vreg index 0, replace any old reference with new reference.
+%def subst_vreg_references(old="", new="", z0="", z1="", z2="", uniq=""):
+   mv $z0, xFP               // z0 := &fp[0]
+   mv $z1, xREFS             // z1 := &refs[0]
+.L${uniq}_subst_try:
+   lwu $z2, ($z1)
+   bne $z2, $old, .L${uniq}_subst_next
+   sw $new, ($z0)
+   sw $new, ($z1)
+.L${uniq}_subst_next:
+   addi $z0, $z0, 4
+   addi $z1, $z1, 4
+   bne $z1, xFP, .L${uniq}_subst_try
+
+
+// Hardcoded
+// - a0: ArtMethod*
+// - a1: this
+// Input
+// - vregs: F|E|D|C from dex
+%def slow_setup_args(shorty="", vregs="", z0="", z1="", z2="", z3="", z4="", z5="", z6="", arg_start="1", uniq=""):
+   srliw $z0, xINST, 12     // z0 := A
+   li $z1, 5
+   blt $z0, $z1, .L${uniq}_slow_gpr
+   // A = 5: need vreg G
+   srliw $z1, xINST, 8      // z1 := A|G
+   andi $z1, $z1, 0xF       // z1 := G
+   slliw $z1, $z1, 16       // z1 := G0000
+   add $vregs, $z1, $vregs  // vregs := G|F|E|D|C
+
+.L${uniq}_slow_gpr:
+   addi $z0, $shorty, 1     // z0 := first arg of shorty
+   srliw $z1, $vregs, 4*$arg_start
+                            // z1 := (instance) F|E|D or G|F|E|D, (static) F|E|D|C or G|F|E|D|C
+   li $z2, 'D'              // double
+   li $z3, 'F'              // float
+   li $z4, 'J'              // long
+   li $z5, 'L'              // ref
+   // linear scan through shorty: extract non-float vregs
+%  if arg_start == "0":  # static can place vC into a1; instance already loaded "this" into a1.
+%    load_vreg_in_gpr(gpr="a1", shorty=z0, vregs=z1, D=z2, F=z3, J=z4, L=z5, z0=z6, done=f".L{uniq}_slow_fpr", uniq=f"{uniq}_0")
+%  load_vreg_in_gpr(gpr="a2", shorty=z0, vregs=z1, D=z2, F=z3, J=z4, L=z5, z0=z6, done=f".L{uniq}_slow_fpr", uniq=f"{uniq}_1")
+%  load_vreg_in_gpr(gpr="a3", shorty=z0, vregs=z1, D=z2, F=z3, J=z4, L=z5, z0=z6, done=f".L{uniq}_slow_fpr", uniq=f"{uniq}_2")
+%  load_vreg_in_gpr(gpr="a4", shorty=z0, vregs=z1, D=z2, F=z3, J=z4, L=z5, z0=z6, done=f".L{uniq}_slow_fpr", uniq=f"{uniq}_3")
+%  load_vreg_in_gpr(gpr="a5", shorty=z0, vregs=z1, D=z2, F=z3, J=z4, L=z5, z0=z6, done=f".L{uniq}_slow_fpr", uniq=f"{uniq}_4")
+
+.L${uniq}_slow_fpr:
+   addi $z0, $shorty, 1     // z0 := first arg of shorty
+   srliw $z1, $vregs, 4*$arg_start
+                            // z1 := (instance) F|E|D or G|F|E|D, (static) F|E|D|C or G|F|E|D|C
+   // linear scan through shorty: extract float/double vregs
+%  load_vreg_in_fpr(fpr="fa0", shorty=z0, vregs=z1, D=z2, F=z3, J=z4, z0=z5, done=f".L{uniq}_slow_done", uniq=f"{uniq}_0")
+%  load_vreg_in_fpr(fpr="fa1", shorty=z0, vregs=z1, D=z2, F=z3, J=z4, z0=z5, done=f".L{uniq}_slow_done", uniq=f"{uniq}_1")
+%  load_vreg_in_fpr(fpr="fa2", shorty=z0, vregs=z1, D=z2, F=z3, J=z4, z0=z5, done=f".L{uniq}_slow_done", uniq=f"{uniq}_2")
+%  load_vreg_in_fpr(fpr="fa3", shorty=z0, vregs=z1, D=z2, F=z3, J=z4, z0=z5, done=f".L{uniq}_slow_done", uniq=f"{uniq}_3")
+%  if arg_start == "0":  # static can place G into fa4; instance has only 4 args.
+%    load_vreg_in_fpr(fpr="fa4", shorty=z0, vregs=z1, D=z2, F=z3, J=z4, z0=z5, done=f".L{uniq}_slow_done", uniq=f"{uniq}_4")
+%#:
+.L${uniq}_slow_done:
+
+
+// String-init variant: up to 4 args, no long/double/float args.
+// Ref args ('L') loaded with LW *must* apply ZEXT.W to avoid subtle address bugs.
+%def slow_setup_args_string_init(shorty="", v_fedc="", z0="", z1="", z2="", uniq=""):
+   srliw $z0, xINST, 12            // z0 := A; possible values 1-5
+   li $z1, 2
+   blt $z0, $z1, .L${uniq}_slow_1  // A = 1
+   li $z2, 'L'                     // z2 := ref type
+   beq $z0, $z1, .L${uniq}_slow_2  // A = 2
+   li $z1, 4
+   blt $z0, $z1, .L${uniq}_slow_3  // A = 3
+   beq $z0, $z1, .L${uniq}_slow_4  // A = 4
+
+   // A = 5
+   srliw $z0, xINST, 8             // z0 := A|G
+   andi $z0, $z0, 0xF              // z0 := G
+%  get_vreg("a4", z0)
+   lb $z1, 4($shorty)              // shorty RDEFG
+   bne $z1, $z2, .L${uniq}_slow_4
+   zext.w a4, a4
+.L${uniq}_slow_4:
+   srliw $z1, $v_fedc, 12          // z1 := F
+%  get_vreg("a3", z1)
+   lb $z1, 3($shorty)              // shorty RDEF
+   bne $z1, $z2, .L${uniq}_slow_3
+   zext.w a3, a3
+.L${uniq}_slow_3:
+   srliw $z1, $v_fedc, 8           // z1 := F|E
+   andi $z1, $z1, 0xF              // z1 := E
+%  get_vreg("a2", z1)
+   lb $z1, 2($shorty)              // shorty RDE
+   bne $z1, $z2, .L${uniq}_slow_2
+   zext.w a2, a2
+.L${uniq}_slow_2:
+   srliw $z1, $v_fedc, 4           // z1 := F|E|D
+   andi $z1, $z1, 0xF              // z1 := D
+%  get_vreg("a1", z1)
+   lb $z1, 1($shorty)              // shorty RD
+   bne $z1, $z2, .L${uniq}_slow_1
+   zext.w a1, a1
+.L${uniq}_slow_1:
+   // "this" never read in string-init
+
+
+// Range and static-range variant.
+// Hardcoded
+// - (caller) xPC, xINST, xFP
+// - (callee) sp
+// Input
+// - vC: CCCC from dex
+%def slow_setup_args_range(shorty="", vC="", z0="", z1="", z2="", z3="", z4="", z5="", z6="", z7="", arg_start="1", uniq=""):
+   addi $z0, $shorty, 1       // z0 := first arg of shorty
+   addi $z1, $vC, $arg_start  // z1 := (instance) CCCC+1, (static) CCCC
+   mv $z2, zero               // z2 := is_out_stack_needed false
+   li $z3, 'D'                // double
+   li $z4, 'F'                // float
+   li $z5, 'J'                // long
+   li $z6, 'L'                // ref
+
+   // linear scan through shorty: extract non-float vregs
+%  if arg_start == "0":  # static can place vCCCC into a1; instance already loaded "this" into a1.
+%    load_vreg_in_gpr_range(gpr="a1", shorty=z0, idx=z1, D=z3, F=z4, J=z5, L=z6, z0=z7, done=f".L{uniq}_slow_fpr", uniq=f"{uniq}_1")
+%  load_vreg_in_gpr_range(gpr="a2", shorty=z0, idx=z1, D=z3, F=z4, J=z5, L=z6, z0=z7, done=f".L{uniq}_slow_fpr", uniq=f"{uniq}_2")
+%  load_vreg_in_gpr_range(gpr="a3", shorty=z0, idx=z1, D=z3, F=z4, J=z5, L=z6, z0=z7, done=f".L{uniq}_slow_fpr", uniq=f"{uniq}_3")
+%  load_vreg_in_gpr_range(gpr="a4", shorty=z0, idx=z1, D=z3, F=z4, J=z5, L=z6, z0=z7, done=f".L{uniq}_slow_fpr", uniq=f"{uniq}_4")
+%  load_vreg_in_gpr_range(gpr="a5", shorty=z0, idx=z1, D=z3, F=z4, J=z5, L=z6, z0=z7, done=f".L{uniq}_slow_fpr", uniq=f"{uniq}_5")
+%  load_vreg_in_gpr_range(gpr="a6", shorty=z0, idx=z1, D=z3, F=z4, J=z5, L=z6, z0=z7, done=f".L{uniq}_slow_fpr", uniq=f"{uniq}_6")
+%  load_vreg_in_gpr_range(gpr="a7", shorty=z0, idx=z1, D=z3, F=z4, J=z5, L=z6, z0=z7, done=f".L{uniq}_slow_fpr", uniq=f"{uniq}_7")
+%  is_out_stack_needed(needed=z2, shorty=z0, D=z3, F=z4, z0=z1, uniq=uniq)
+
+.L${uniq}_slow_fpr:
+   addi $z0, $shorty, 1       // z0 := first arg of shorty
+   addi $z1, $vC, $arg_start  // z1 := (instance) CCCC+1, (static) CCCC
+   // linear scan through shorty: extract float/double vregs
+%  load_vreg_in_fpr_range(fpr="fa0", shorty=z0, idx=z1, D=z3, F=z4, J=z5, z0=z6, done=f".L{uniq}_slow_stack", uniq=f"{uniq}_0")
+%  load_vreg_in_fpr_range(fpr="fa1", shorty=z0, idx=z1, D=z3, F=z4, J=z5, z0=z6, done=f".L{uniq}_slow_stack", uniq=f"{uniq}_1")
+%  load_vreg_in_fpr_range(fpr="fa2", shorty=z0, idx=z1, D=z3, F=z4, J=z5, z0=z6, done=f".L{uniq}_slow_stack", uniq=f"{uniq}_2")
+%  load_vreg_in_fpr_range(fpr="fa3", shorty=z0, idx=z1, D=z3, F=z4, J=z5, z0=z6, done=f".L{uniq}_slow_stack", uniq=f"{uniq}_3")
+%  load_vreg_in_fpr_range(fpr="fa4", shorty=z0, idx=z1, D=z3, F=z4, J=z5, z0=z6, done=f".L{uniq}_slow_stack", uniq=f"{uniq}_4")
+%  load_vreg_in_fpr_range(fpr="fa5", shorty=z0, idx=z1, D=z3, F=z4, J=z5, z0=z6, done=f".L{uniq}_slow_stack", uniq=f"{uniq}_5")
+%  load_vreg_in_fpr_range(fpr="fa6", shorty=z0, idx=z1, D=z3, F=z4, J=z5, z0=z6, done=f".L{uniq}_slow_stack", uniq=f"{uniq}_6")
+%  load_vreg_in_fpr_range(fpr="fa7", shorty=z0, idx=z1, D=z3, F=z4, J=z5, z0=z6, done=f".L{uniq}_slow_stack", uniq=f"{uniq}_7")
+%  is_out_stack_needed_float(needed=z2, shorty=z0, D=z3, F=z4, z0=z1, uniq=uniq)
+
+.L${uniq}_slow_stack:
+   beqz $z2, .L${uniq}_slow_done  // No stack needed, skip it. Otherwise copy-paste it all with LD/SD.
+   addi $z0, sp, 8            // z0 := base addr of out array
+   sh2add $z1, $vC, xFP       // z1 := base addr of FP[CCCC]
+   srliw $z2, xINST, 8        // z2 := AA, vreg count
+   sh2add $z2, $z2, $z1       // z2 := loop guard, addr of one slot past top of xFP array
+%  copy_vregs_to_out(out=z0, fp=z1, fp_top=z2, z0=z3, uniq=uniq)
+.L${uniq}_slow_done:
+
+
+// String-init variant: up to 4 args, no long/float/double args.
+// Ref args ('L') loaded with LW *must* apply ZEXT.W to avoid subtle address bugs.
+%def slow_setup_args_string_init_range(shorty="", vC="", z0="", z1="", z2="", z3="", uniq=""):
+   srliw $z0, xINST, 8             // z0 := AA; possible values 1-5
+   li $z1, 2
+   blt $z0, $z1, .L${uniq}_slow_1  // A = 1
+   sh2add $z2, $vC, xFP            // z2 := &fp[CCCC]
+   li $z3, 'L'                     // z3 := ref type
+   beq $z0, $z1, .L${uniq}_slow_2  // A = 2
+   li $z1, 4
+   blt $z0, $z1, .L${uniq}_slow_3  // A = 3
+   beq $z0, $z1, .L${uniq}_slow_4  // A = 4
+   // A = 5
+   lw a4, 4*4($z2)
+   lb $z1, 4($shorty)
+   bne $z1, $z3, .L${uniq}_slow_4
+   zext.w a4, a4
+.L${uniq}_slow_4:
+   lw a3, 3*4($z2)
+   lb $z1, 3($shorty)
+   bne $z1, $z3, .L${uniq}_slow_3
+   zext.w a3, a3
+.L${uniq}_slow_3:
+   lw a2, 2*4($z2)
+   lb $z1, 2($shorty)
+   bne $z1, $z3, .L${uniq}_slow_2
+   zext.w a2, a2
+.L${uniq}_slow_2:
+   lw a1, 1*4($z2)
+   lb $z1, 1($shorty)
+   bne $z1, $z3, .L${uniq}_slow_1
+   zext.w a1, a1
+.L${uniq}_slow_1:
+   // "this" never read in string-init
+
+
+// Iterate through 4-bit vreg ids in the "vregs" register, load a non-FP value
+// into one argument register.
+%def load_vreg_in_gpr(gpr="", shorty="", vregs="", D="", F="", J="", L="", z0="", done="", uniq=""):
+.L${uniq}_gpr_find:
+   lb $z0, ($shorty)         // z0 := next shorty arg spec
+   addi $shorty, $shorty, 1  // increment char ptr
+   beqz $z0, $done           // z0 == \0
+   beq $z0, $F, .L${uniq}_gpr_skip_4_bytes
+   beq $z0, $D, .L${uniq}_gpr_skip_8_bytes
+
+   andi $gpr, $vregs, 0xF    // gpr := vreg id
+   beq $z0, $J, .L${uniq}_gpr_load_8_bytes
+%  get_vreg(gpr, gpr)        #  gpr := 32-bit load
+   bne $z0, $L, .L${uniq}_gpr_load_common
+   zext.w $gpr, $gpr
+.L${uniq}_gpr_load_common:
+   srliw $vregs, $vregs, 4   // shift out the processed arg, one vreg
+   j .L${uniq}_gpr_set       // and exit
+.L${uniq}_gpr_load_8_bytes:
+   GET_VREG_WIDE $gpr, $gpr  // gpr := 64-bit load
+   srliw $vregs, $vregs, 8   // shift out the processed arg, a vreg pair
+   j .L${uniq}_gpr_set       // and exit
+
+.L${uniq}_gpr_skip_8_bytes:
+   srliw $vregs, $vregs, 4   // shift out a skipped arg
+.L${uniq}_gpr_skip_4_bytes:
+   srliw $vregs, $vregs, 4   // shift out a skipped arg
+   j .L${uniq}_gpr_find
+.L${uniq}_gpr_set:
+
+
+// Iterate through 4-bit vreg ids in the "vregs" register, load a float or double
+// value into one floating point argument register.
+%def load_vreg_in_fpr(fpr="", shorty="", vregs="", D="", F="", J="", z0="", done="", uniq=""):
+.L${uniq}_fpr_find:
+   lb $z0, ($shorty)         // z0 := next shorty arg spec
+   addi $shorty, $shorty, 1  // increment char ptr
+   beqz $z0, $done           // z0 == \0
+   beq $z0, $F, .L${uniq}_fpr_load_4_bytes
+   beq $z0, $D, .L${uniq}_fpr_load_8_bytes
+
+   srliw $vregs, $vregs, 4   // shift out a skipped arg, one vreg
+   bne $z0, $J, .L${uniq}_fpr_find
+   srliw $vregs, $vregs, 4   // shift out one more skipped arg, for J
+   j .L${uniq}_fpr_find
+
+.L${uniq}_fpr_load_4_bytes:
+   andi $z0, $vregs, 0xF
+%  get_vreg_float(fpr, z0)
+   srliw $vregs, $vregs, 4   // shift out the processed arg, one vreg
+   j .L${uniq}_fpr_set
+.L${uniq}_fpr_load_8_bytes:
+   andi $z0, $vregs, 0xF
+   GET_VREG_DOUBLE $fpr, $z0
+   srliw $vregs, $vregs, 8   // shift out the processed arg, a vreg pair
+.L${uniq}_fpr_set:
+
+
+// Range variant
+%def load_vreg_in_gpr_range(gpr="", shorty="", idx="", D="", F="", J="", L="", z0="", done="", uniq=""):
+.L${uniq}_gpr_range_find:
+   lb $z0, ($shorty)           // z0 := next shorty arg
+   addi $shorty, $shorty, 1    // increment char ptr
+   beqz $z0, $done             // z0 == \0
+   beq $z0, $F, .L${uniq}_gpr_range_skip_1_vreg
+   beq $z0, $D, .L${uniq}_gpr_range_skip_2_vreg
+
+   beq $z0, $J, .L${uniq}_gpr_range_load_2_vreg
+%  get_vreg(gpr, idx)
+   bne $z0, $L, .L${uniq}_gpr_range_load_common
+   zext.w $gpr, $gpr
+.L${uniq}_gpr_range_load_common:
+   addi $idx, $idx, 1
+   j .L${uniq}_gpr_range_done
+.L${uniq}_gpr_range_load_2_vreg:
+   GET_VREG_WIDE $gpr, $idx
+   addi $idx, $idx, 2
+   j .L${uniq}_gpr_range_done
+
+.L${uniq}_gpr_range_skip_2_vreg:
+   addi $idx, $idx, 1
+.L${uniq}_gpr_range_skip_1_vreg:
+   addi $idx, $idx, 1
+   j .L${uniq}_gpr_range_find
+.L${uniq}_gpr_range_done:
+
+
+// Range variant.
+%def load_vreg_in_fpr_range(fpr="", shorty="", idx="", D="", F="", J="", z0="", done="", uniq=""):
+.L${uniq}_fpr_range_find:
+   lb $z0, ($shorty)         // z0 := next shorty arg
+   addi $shorty, $shorty, 1  // increment char ptr
+   beqz $z0, $done           // z0 == \0
+   beq $z0, $F, .L${uniq}_fpr_range_load_4_bytes
+   beq $z0, $D, .L${uniq}_fpr_range_load_8_bytes
+
+   addi $idx, $idx, 1        // increment idx
+   bne $z0, $J, .L${uniq}_fpr_range_find
+   addi $idx, $idx, 1        // increment once more for J
+   j .L${uniq}_fpr_range_find
+
+.L${uniq}_fpr_range_load_4_bytes:
+   mv $z0, $idx
+%  get_vreg_float(fpr, z0)
+   addi $idx, $idx, 1
+   j .L${uniq}_fpr_range_set
+.L${uniq}_fpr_range_load_8_bytes:
+   mv $z0, $idx
+   GET_VREG_DOUBLE $fpr, $z0
+   addi $idx, $idx, 2
+.L${uniq}_fpr_range_set:
+
+
+%def is_out_stack_needed(needed="", shorty="", D="", F="", z0="", uniq=""):
+.L${uniq}_scan_arg:
+   lb $z0, ($shorty)
+   addi $shorty, $shorty, 1
+   beqz $z0, .L${uniq}_scan_done
+   beq $z0, $F, .L${uniq}_scan_arg
+   beq $z0, $D, .L${uniq}_scan_arg
+   li $needed, 1
+.L${uniq}_scan_done:
+
+
+%def is_out_stack_needed_float(needed="", shorty="", D="", F="", z0="", uniq=""):
+   bnez $needed, .L${uniq}_scan_float_done
+.L${uniq}_scan_float_arg:
+   lb $z0, ($shorty)
+   addi $shorty, $shorty, 1
+   beqz $z0, .L${uniq}_scan_float_done
+   beq $z0, $F, .L${uniq}_scan_float_found
+   beq $z0, $D, .L${uniq}_scan_float_found
+   j .L${uniq}_scan_float_arg
+.L${uniq}_scan_float_found:
+   li $needed, 1
+.L${uniq}_scan_float_done:
+
+
+%def copy_vregs_to_out(out="", fp="", fp_top="", z0="", uniq=""):
+   sub $z0, $fp_top, $fp  // z0 := byte range
+   BRANCH_IF_BIT_CLEAR $z0, $z0, 2, .L${uniq}_copy_wide
+                          // branch if odd count of slots
+   lwu $z0, ($fp)
+   sw $z0, ($out)
+   addi $fp, $fp, 4
+   addi $out, $out, 4
+.L${uniq}_copy_wide:
+   beq $fp, $fp_top, .L${uniq}_copy_done
+   ld $z0, ($fp)
+   sd $z0, ($out)
+   addi $fp, $fp, 8
+   addi $out, $out, 8
+   j .L${uniq}_copy_wide
+.L${uniq}_copy_done:
+
+
+// NterpToNterpInstance
+// a0: ArtMethod*
+// a1: this
+%def nterp_to_nterp_instance():
+%  nterp_to_nterp(how_vC="in_a1", uniq="n2n_instance")
+
+
+// NterpToNterpStringInit
+// a0: ArtMethod*
+%def nterp_to_nterp_string_init():
+%  nterp_to_nterp(how_vC="skip", uniq="n2n_string_init")
+
+
+// NterpToNterpStatic
+// a0: ArtMethod*
+%def nterp_to_nterp_static():
+%  nterp_to_nterp(a1_instance=False, how_vC="load", uniq="n2n_static")
+
+
+// NterpToNterpInstanceRange
+%def nterp_to_nterp_instance_range():
+%  nterp_to_nterp(how_vC="in_a1", uniq="n2n_instance_range", range="Range")
+
+
+// NterpToNterpStringInitRange
+%def nterp_to_nterp_string_init_range():
+%  nterp_to_nterp(how_vC="skip", uniq="n2n_string_init_range", range="Range")
+
+
+// NterpToNterpStaticRange
+%def nterp_to_nterp_static_range():
+%  nterp_to_nterp(a1_instance=False, how_vC="load", uniq="n2n_static_range", range="Range")
+
+
+// helpers
+
+
+%def nterp_to_nterp(a1_instance=True, how_vC="", uniq="", range=""):
+   .cfi_startproc
+%  setup_nterp_frame(cfi_refs="23", refs="s8", fp="s9", pc="s10", regs="s11", spills_sp="t0", z0="t1", z1="t2", z2="t3", z3="t4", uniq=uniq)
+       // s8  := callee xREFS
+       // s9  := callee xFP
+       // s10 := callee xPC
+       // s11 := fp/refs vreg count
+       // t0  := post-spills pre-frame sp (unused here)
+       // sp  := post-frame callee sp
+%  if range == 'Range':
+%    n2n_arg_move_range(refs="s8", fp="s9", regs="s11", vC="s7", z0="t0", z1="t1", z2="t2", z3="t3", z4="t4", z5="t5", a1_instance=a1_instance, how_vC=how_vC, uniq=uniq)
+%  else:
+%    n2n_arg_move(refs="s8", fp="s9", pc="s10", regs="s11", v_fedc="s7", z0="t0", z1="t1", z2="t2", z3="t3", a1_instance=a1_instance, how_vC=how_vC, uniq=uniq)
+%#:
+   mv xREFS, s8
+   mv xFP, s9
+   mv xPC, s10
+   CFI_DEFINE_DEX_PC_WITH_OFFSET(/*tmpReg*/CFI_TMP, /*dexReg*/CFI_DEX, /*dexOffset*/0)
+
+   START_EXECUTING_INSTRUCTIONS
+   .cfi_endproc
+
+
+// See runtime/nterp_helpers.cc for a diagram of the setup.
+// Hardcoded
+// - a0 - ArtMethod*
+// Input
+// - \cfi_refs: dwarf register number of \refs, for CFI
+// - \uniq: string to ensure unique symbolic labels between instantiations
+// Output
+// - sp: adjusted downward for callee-saves and nterp frame
+// - \refs: callee xREFS
+// - \fp: callee xFP
+// - \pc: callee xPC
+// - \regs: register count in \refs
+// - \ins: in count
+// - \spills_sp: stack pointer after reg spills
+%def setup_nterp_frame(cfi_refs="", refs="", fp="", pc="", regs="", ins="zero", spills_sp="", z0="", z1="", z2="", z3="", uniq=""):
+   // Check guard page for stack overflow.
+   li $z0, -STACK_OVERFLOW_RESERVED_BYTES
+   add $z0, $z0, sp
+   ld zero, ($z0)
+
+   INCREASE_FRAME NTERP_SIZE_SAVE_CALLEE_SAVES
+                        // sp := sp + callee-saves
+   SETUP_NTERP_SAVE_CALLEE_SAVES
+
+   ld $pc, ART_METHOD_DATA_OFFSET_64(a0)
+   FETCH_CODE_ITEM_INFO code_item=$pc, regs=$regs, outs=$z0, ins=$ins
+                        // pc   := callee dex array
+                        // regs := vreg count for fp array and refs array
+                        // z0   := vreg count for outs array
+                        // ins  := vreg count for ins array
+
+   // Compute required frame size: ((2 * \regs) + \z0) * 4 + 24
+   // - The register array and reference array each have \regs number of slots.
+   // - The out array has \z0 slots.
+   // - Each register slot is 4 bytes.
+   // - Additional 24 bytes for 3 fields: saved frame pointer, dex pc, and ArtMethod*.
+   sh1add $z1, $regs, $z0
+   slli $z1, $z1, 2
+   addi $z1, $z1, 24    // z1 := frame size, without alignment padding
+
+   // compute new stack pointer
+   sub $z1, sp, $z1
+   // 16-byte alignment.
+   andi $z1, $z1, ~0xF  // z1 := new sp
+
+   // Set \refs to base of reference array. Align to pointer size for the frame pointer and dex pc
+   // pointer, below the reference array.
+   sh2add $z0, $z0, $z1  // z0 := out array size in bytes
+   addi $z0, $z0, 28     //     + 24 bytes for 3 fields, plus 4 for alignment slack.
+   andi $refs, $z0, -__SIZEOF_POINTER__
+                         // refs := refs array base
+
+   // Set \fp to base of register array, above the reference array. This region is already aligned.
+   sh2add $fp, $regs, $refs
+                         // fp := fp array base
+
+   // Set up the stack pointer.
+   mv $spills_sp, sp     // spills_sp := old sp
+   .cfi_def_cfa_register $spills_sp
+   mv sp, $z1            // sp := new sp
+   sd $spills_sp, -8($refs)
+   // The CFA rule is now a dwarf expression, because the nterp frame offset for SP is a dynamic
+   // value, and thus SP cannot help compute CFA. For the duration of the nterp frame, CFI
+   // directives cannot adjust this CFA rule, but may still capture CFI for register spills as
+   // "register + offset" with a dwarf expression.
+   CFI_DEF_CFA_BREG_PLUS_UCONST $cfi_refs, -8, NTERP_SIZE_SAVE_CALLEE_SAVES
+
+   // Put nulls in reference array.
+   beqz $regs, .L${uniq}_ref_zero_done
+   mv $z0, $refs         // z0 := address iterator
+.L${uniq}_ref_zero:
+   // Write in 8-byte increments, so fp[0] gets zero'ed too, if \regs is odd.
+   sd zero, ($z0)
+   addi $z0, $z0, 8
+   bltu $z0, $fp, .L${uniq}_ref_zero
+.L${uniq}_ref_zero_done:
+   // Save the ArtMethod*.
+   sd a0, (sp)
+
+
+// Hardcoded
+// - (caller) xINST, xFP, xREFS, xPC
+// - a0: ArtMethod*
+// - a1: this, for instance invoke
+%def n2n_arg_move(refs="", fp="", regs="", pc="", v_fedc="", z0="", z1="", z2="", z3="", a1_instance=True, how_vC="", uniq=""):
+   srliw $z0, xINST, 12       // z0 := A (arg count)
+
+%  if not a1_instance:
+     beqz $z0, .L${uniq}_arg_done
+%#:
+   // A >= 1, decide and branch
+   li $z1, 2
+   sub $z2, $regs, $z0        // z2 := regs - A; vC's index in fp
+   sh2add $z3, $z2, $fp       // z3 := addr of fp[C]
+   sh2add $z2, $z2, $refs     // z2 := addr of refs[C]
+   blt $z0, $z1, .L${uniq}_arg_1
+   beq $z0, $z1, .L${uniq}_arg_2
+   li $z1, 4
+   blt $z0, $z1, .L${uniq}_arg_3
+   beq $z0, $z1, .L${uniq}_arg_4
+
+   // A = 5
+   srliw $z0, xINST, 8
+   andi $z0, $z0, 0xF         // z0 := G
+%  get_vreg(z1, z0)           #  z1 := xFP[G]
+   sw $z1, (4*4)($z3)         // fp[G] := z1
+   GET_VREG_OBJECT $z0, $z0   // z0 := xREFS[G]
+   sw $z0, (4*4)($z2)         // refs[G] := z0
+.L${uniq}_arg_4:
+   srliw $z0, $v_fedc, 12     // z0 := F
+%  get_vreg(z1, z0)           #  z1 := xFP[F]
+   sw $z1, (3*4)($z3)         // fp[F] := z1
+   GET_VREG_OBJECT $z0, $z0   // z0 := xREFS[F]
+   sw $z0, (3*4)($z2)         // refs[F] := z0
+.L${uniq}_arg_3:
+   srliw $z0, $v_fedc, 8      // z0 := F|E
+   andi $z0, $z0, 0xF         // z0 := E
+%  get_vreg(z1, z0)           #  z1 := xFP[E]
+   sw $z1, (2*4)($z3)         // fp[E] := z1
+   GET_VREG_OBJECT $z0, $z0   // z0 := xREFS[E]
+   sw $z0, (2*4)($z2)         // refs[E] := z0
+.L${uniq}_arg_2:
+   srliw $z0, $v_fedc, 4      // z0 := F|E|D
+   andi $z0, $z0, 0xF         // z0 := D
+%  get_vreg(z1, z0)           #  z1 := xFP[D]
+   sw $z1, (1*4)($z3)         // fp[D] := z1
+   GET_VREG_OBJECT $z0, $z0   // z0 := xREFS[D]
+   sw $z0, (1*4)($z2)         // refs[D] := z0
+.L${uniq}_arg_1:
+%  if how_vC == "in_a1":
+     // a1 = xFP[C] from earlier stage of instance invoke
+     sw a1, (0*4)($z3)        // fp[C] := a1
+     sw a1, (0*4)($z2)        // refs[C] := a1
+%  elif how_vC == "skip":
+     // string init doesn't read "this"
+%  elif how_vC == "load":
+     // static method loads vC just like other vregs
+     andi $z0, $v_fedc, 0xF   // z0 := C
+%    get_vreg(z1, z0)         #  z1 := xFP[C]
+     sw $z1, (0*4)($z3)       // fp[C] := z1
+     GET_VREG_OBJECT $z0, $z0  // z0 := xREFS[C]
+     sw $z0, (0*4)($z2)       // refs[C] := z0
+%#:
+.L${uniq}_arg_done:
+
+
+%def n2n_arg_move_range(refs="", fp="", regs="", vC="", z0="", z1="", z2="", z3="", z4="", z5="", a1_instance=True, how_vC="", uniq=""):
+   srliw $z0, xINST, 8     // z0 := AA (arg count)
+
+%  if not a1_instance:
+     beqz $z0, .L${uniq}_arg_range_done
+%#:
+   // AA >= 1, iterator setup
+   sub $z4, $regs, $z0     // z4 := regs - AA; starting idx in fp and refs
+   sh2add $z1, $vC, xREFS  // z1 := addr of xREFS[CCCC]
+   sh2add $z2, $vC, xFP    // z2 := addr of xFP[CCCC]
+   sh2add $z3, $z4, $refs  // z3 := addr of refs[z4]
+   sh2add $z4, $z4, $fp    // z4 := addr of fp[z4]
+
+   BRANCH_IF_BIT_CLEAR $z0, $z0, 0, .L${uniq}_arg_range_copy_wide
+                           // branch if AA is even
+   // AA is odd, transfer one slot. Apply some optimizations.
+%  if how_vC == "in_a1":
+     sw a1, ($z3)
+     sw a1, ($z4)
+%  elif how_vC == "skip":
+     // string init doesn't read "this"
+%  elif how_vC == "load":
+     lw $z0, ($z1)
+     lw $z5, ($z2)
+     sw $z0, ($z3)
+     sw $z5, ($z4)
+%#:
+   addi $z1, $z1, 4
+   addi $z2, $z2, 4
+   addi $z3, $z3, 4
+   addi $z4, $z4, 4
+.L${uniq}_arg_range_copy_wide:
+   // Even count of vreg slots, apply LD/SD.
+   beq $z3, $fp, .L${uniq}_arg_range_done  // terminate loop if refs[regs] == fp[0]
+   ld $z0, ($z1)
+   ld $z5, ($z2)
+   sd $z0, ($z3)
+   sd $z5, ($z4)
+   addi $z1, $z1, 8
+   addi $z2, $z2, 8
+   addi $z3, $z3, 8
+   addi $z4, $z4, 8
+   j .L${uniq}_arg_range_copy_wide
+.L${uniq}_arg_range_done:
+
+
+//
+// Nterp entry point helpers
+//
+
+
+// Hardcoded:
+// - a0: ArtMethod*
+%def setup_ref_args_and_go(fp="", refs="", refs_end="", spills_sp="", z0="", z1="", done=""):
+   // Store managed-ABI register args into fp/refs arrays.
+%  store_ref_to_vreg(gpr="a1", fp=fp, refs=refs, refs_end=refs_end, done=done)
+%  store_ref_to_vreg(gpr="a2", fp=fp, refs=refs, refs_end=refs_end, done=done)
+%  store_ref_to_vreg(gpr="a3", fp=fp, refs=refs, refs_end=refs_end, done=done)
+%  store_ref_to_vreg(gpr="a4", fp=fp, refs=refs, refs_end=refs_end, done=done)
+%  store_ref_to_vreg(gpr="a5", fp=fp, refs=refs, refs_end=refs_end, done=done)
+%  store_ref_to_vreg(gpr="a6", fp=fp, refs=refs, refs_end=refs_end, done=done)
+%  store_ref_to_vreg(gpr="a7", fp=fp, refs=refs, refs_end=refs_end, done=done)
+   // We drained arg registers, so continue from caller's stack.
+   // A ref arg is 4 bytes, so the continuation offset is well known.
+   addi $z0, $spills_sp, (NTERP_SIZE_SAVE_CALLEE_SAVES + 8 + 7*4)
+       // z0 := out array base addr + 7 vreg slots
+.Lentry_ref_stack:
+   lwu $z1, ($z0)
+   sw $z1, ($fp)
+   sw $z1, ($refs)
+   addi $z0, $z0, 4
+   addi $fp, $fp, 4
+   addi $refs, $refs, 4
+   bne $refs, $refs_end, .Lentry_ref_stack
+
+   j $done
+
+
+%def store_ref_to_vreg(gpr="", fp="", refs="", refs_end="", done=""):
+   sw $gpr, ($fp)
+   sw $gpr, ($refs)
+   addi $fp, $fp, 4
+   addi $refs, $refs, 4
+   beq $refs, $refs_end, $done
+
+
+// \fp and \refs are used as array base addrs, unmodified.
+%def store_gpr_to_vreg(gpr="", offset="", shorty="", fp="", refs="", z0="", z1="", D="", F="", J="", L="", next=""):
+.Lentry_arg_${gpr}:
+   lb $z0, ($shorty)         // z0 := shorty type
+   addi $shorty, $shorty, 1  // Increment char ptr.
+   beqz $z0, $next           // z0 = \0: finished shorty pass
+   beq $z0, $D, .Lentry_arg_skip_double_${gpr}
+   beq $z0, $F, .Lentry_arg_skip_float_${gpr}
+
+   add $z1, $offset, $fp
+   beq $z0, $J, .Lentry_arg_long_${gpr}
+   sw $gpr, ($z1)
+   bne $z0, $L, .Lentry_arg_finish_${gpr}
+   add $z1, $offset, $refs
+   sw $gpr, ($z1)
+   j .Lentry_arg_finish_${gpr}
+.Lentry_arg_skip_double_${gpr}:
+   addi $offset, $offset, 4
+.Lentry_arg_skip_float_${gpr}:
+   addi $offset, $offset, 4
+   j .Lentry_arg_${gpr}
+.Lentry_arg_long_${gpr}:
+   sd $gpr, ($z1)
+   addi $offset, $offset, 4
+.Lentry_arg_finish_${gpr}:
+   addi $offset, $offset, 4
+
+
+// \fp is used as array base addr, unmodified.
+%def store_fpr_to_vreg(fpr="", offset="", shorty="", fp="", z0="", z1="", D="", F="", J="", next=""):
+.Lentry_farg_${fpr}:
+   lb $z0, ($shorty)         // z0 := shorty type
+   addi $shorty, $shorty, 1  // Increment char ptr.
+   beqz $z0, $next           // z0 = \0: finished shorty pass
+   beq $z0, $D, .Lentry_farg_double_${fpr}
+   beq $z0, $F, .Lentry_farg_float_${fpr}
+   addi $offset, $offset, 4
+   bne $z0, $J, .Lentry_farg_${fpr}
+   addi $offset, $offset, 4
+   j .Lentry_farg_${fpr}
+
+.Lentry_farg_float_${fpr}:
+   add $z1, $offset, $fp
+   fsw $fpr, ($z1)
+   j .Lentry_farg_finish_${fpr}
+.Lentry_farg_double_${fpr}:
+   add $z1, $offset, $fp
+   fsd $fpr, ($z1)
+   addi $offset, $offset, 4
+.Lentry_farg_finish_${fpr}:
+   addi $offset, $offset, 4
+
+
+// \outs, \fp, \refs are used as iterators, modified.
+%def store_outs_to_vregs(outs="", shorty="", fp="", refs="", z0="", z1="", D="", F="", J="", L="", next=""):
+.Lentry_stack:
+   lb $z0, ($shorty)         // z0 := next shorty arg spec
+   addi $shorty, $shorty, 1  // Increment char ptr.
+   beqz $z0, $next           // z0 == \0
+   beq $z0, $F, .Lentry_stack_next_4
+   beq $z0, $D, .Lentry_stack_next_8
+   beq $z0, $J, .Lentry_stack_long
+   // 32-bit arg
+   lwu $z1, ($outs)
+   sw $z1, ($fp)
+   bne $z0, $L, .Lentry_stack_next_4
+   // and also a ref
+   sw $z1, ($refs)
+.Lentry_stack_next_4:
+   addi $outs, $outs, 4
+   addi $fp, $fp, 4
+   addi $refs, $refs, 4
+   j .Lentry_stack
+.Lentry_stack_long:
+   ld $z1, ($outs)
+   sd $z1, ($fp)
+.Lentry_stack_next_8:
+   addi $outs, $outs, 8
+   addi $fp, $fp, 8
+   addi $refs, $refs, 8
+   j .Lentry_stack
+
+
+// \outs, \fp are used as iterators, modified.
+%def store_float_outs_to_vregs(outs="", shorty="", fp="", z0="", D="", F="", J="", next=""):
+.Lentry_fstack:
+   lb $z0, ($shorty)         // z0 := next shorty arg spec
+   addi $shorty, $shorty, 1  // Increment char ptr.
+   beqz $z0, $next           // z0 == \0
+   beq $z0, $F, .Lentry_fstack_float
+   beq $z0, $D, .Lentry_fstack_double
+   beq $z0, $J, .Lentry_fstack_next_8
+   // 32-bit arg
+   addi $outs, $outs, 4
+   addi $fp, $fp, 4
+   j .Lentry_fstack
+.Lentry_fstack_float:
+   lwu $z0, ($outs)
+   sw $z0, ($fp)
+   addi $outs, $outs, 4
+   addi $fp, $fp, 4
+   j .Lentry_fstack
+.Lentry_fstack_double:
+   ld $z0, ($outs)
+   sd $z0, ($fp)
+.Lentry_fstack_next_8:
+   addi $outs, $outs, 8
+   addi $fp, $fp, 8
+   j .Lentry_fstack
+
diff --git a/runtime/interpreter/mterp/riscv64/main.S b/runtime/interpreter/mterp/riscv64/main.S
index b2ca460..bfc49c0 100644
--- a/runtime/interpreter/mterp/riscv64/main.S
+++ b/runtime/interpreter/mterp/riscv64/main.S
@@ -22,16 +22,68 @@
 #include "asm_support.h"
 #include "arch/riscv64/asm_support_riscv64.S"
 
-// An assembly entry that has a OatQuickMethodHeader prefix.
-.macro OAT_ENTRY name, end
+/**
+ * RISC-V 64 ABI general notes
+ *
+ * References
+ * - https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc
+ * - runtime/arch/riscv64/registers_riscv64.h
+ *
+ * 32 general purposes registers
+ * - fixed purpose: zero, ra, sp, gp, tp, s1
+ *     gp/scs: shadow call stack - do not clobber!
+ *     s1/tr: ART thread register - do not clobber!
+ * - temporaries: t0-t6
+ * - arguments: a0-a7
+ * - callee saved: ra, s0/fp, s2-s11
+ *     s0 is flexible, available to use as a frame pointer if needed.
+ *
+ * 32 floating point registers
+ * - temporaries: ft0-ft11
+ * - arguments: fa0-fa7
+ * - callee saved: fs0-fs11
+ */
+
+// Android references
+//   Bytecodes: https://source.android.com/docs/core/runtime/dalvik-bytecode
+//   Instruction formats: https://source.android.com/docs/core/runtime/instruction-formats
+//   Shorty: https://source.android.com/docs/core/runtime/dex-format#shortydescriptor
+
+// Fixed register usages in Nterp.
+//    nickname  ABI    reg   purpose
+#define xSELF    s1  // x9,   Thread* self pointer
+#define xFP      s2  // x18,  interpreted frame pointer: to access locals and args
+#define xPC      s3  // x19,  interpreted program counter: to fetch instructions
+#define xINST    s4  // x20,  first 16-bit code unit of current instruction
+#define xIBASE   s5  // x21,  interpreted instruction base pointer: for computed goto
+#define xREFS    s6  // x22,  base of object references of dex registers
+
+// DWARF registers reference
+// https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-dwarf.adoc
+#define CFI_TMP  10  // DWARF register number for       a0/x10
+#define CFI_DEX  19  // DWARF register number for xPC  /s3/x19
+#define CFI_REFS 22  // DWARF register number for xREFS/s6/x22
+
+// Synchronization
+// This code follows the RISC-V atomics ABI specification [1].
+//
+// Object publication.
+// new-instance and new-array operations must first perform a `fence w,w` "constructor fence" to
+// ensure their new object references are correctly published with a subsequent SET_VREG_OBJECT.
+//
+// Volatile load/store.
+// A volatile load is implemented as: fence rw,rw ; load ; fence r,rw.
+// A 32-bit or 64-bit volatile store is implemented as: amoswap.{w,d}.rl
+// A volatile store for a narrower type is implemented as: fence rw,w ; store ; fence rw,rw
+//
+// [1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-atomic.adoc
+
+// An assembly entry for nterp.
+.macro OAT_ENTRY name
     .type \name, @function
     .hidden \name
     .global \name
     .balign 16
-    // Padding of 3 * 4 bytes to get 16 bytes alignment of code entry.
-    .4byte 0, 0, 0
-    // OatQuickMethodHeader `data_` field. Note that the top two bits must be clear.
-    .4byte (\end - \name)
 \name:
 .endm
 
@@ -44,7 +96,7 @@
     .type \name, @function
     .hidden \name  // Hide this as a global symbol, so we do not incur plt calls.
     .global \name
-    /* XXX Cache alignment for function entry */
+    /* Cache alignment for function entry */
     .balign 16
 \name:
 .endm
@@ -53,27 +105,461 @@
   SIZE \name
 .endm
 
+// Macro for defining entrypoints into runtime. We don't need to save registers (we're not holding
+// references there), but there is no kDontSave runtime method. So just use the kSaveRefsOnly
+// runtime method.
+.macro NTERP_TRAMPOLINE name, helper
+ENTRY \name
+    SETUP_SAVE_REFS_ONLY_FRAME
+    call \helper
+    RESTORE_SAVE_REFS_ONLY_FRAME
+    ld t0, THREAD_EXCEPTION_OFFSET(xSELF)
+    bnez t0, nterp_deliver_pending_exception
+    ret
+END \name
+.endm
+
+// Unpack code items from dex format.
+// Input: \code_item
+// Output:
+//   - \regs: register count
+//   - \outs: out count
+//   - \ins: in count. If set to register "zero" (x0), load is skipped.
+//   - \code_item: holds instruction array on exit
+.macro FETCH_CODE_ITEM_INFO code_item, regs, outs, ins
+    // Check LSB of \code_item. If 1, it's a compact dex file.
+    BRANCH_IF_BIT_CLEAR \regs, \code_item, 0, 1f  // Regular dex.
+    unimp  // Compact dex: unimplemented.
+1:
+    // Unpack values from regular dex format.
+    lhu \regs, CODE_ITEM_REGISTERS_SIZE_OFFSET(\code_item)
+    lhu \outs, CODE_ITEM_OUTS_SIZE_OFFSET(\code_item)
+    .ifnc \ins, zero
+      lhu \ins, CODE_ITEM_INS_SIZE_OFFSET(\code_item)
+    .endif
+    addi \code_item, \code_item, CODE_ITEM_INSNS_OFFSET
+.endm
+
+.macro EXPORT_PC
+    sd xPC, -16(xREFS)
+.endm
+
+.macro TEST_IF_MARKING reg, label
+    lb \reg, THREAD_IS_GC_MARKING_OFFSET(xSELF)
+    bnez \reg, \label
+.endm
+
+.macro DO_SUSPEND_CHECK continue
+    lwu t0, THREAD_FLAGS_OFFSET(xSELF)
+    andi t0, t0, THREAD_SUSPEND_OR_CHECKPOINT_REQUEST
+    beqz t0, \continue
+    EXPORT_PC
+    call art_quick_test_suspend
+.endm
+
+// Fetch one or more half-word units from an offset past the current PC.
+// The offset is specified in 16-bit code units.
+//
+// A \width flag allows reading 32 bits (2 units) or 64 bits (4 units) from the offset.
+// The RISC-V ISA supports unaligned accesses for these wider loads.
+//
+// If \width=8, \byte={0,1} indexes into the code unit at the offset.
+//
+// Default behavior loads one code unit with unsigned zext.
+// The \signed flag is for signed sext, for shorter loads.
+//
+// Does not advance xPC.
+.macro FETCH reg, count, signed=0, width=16, byte=0
+    .if \width == 8
+      .if \signed
+        lb  \reg, (\count*2 + \byte)(xPC)
+      .else
+        lbu \reg, (\count*2 + \byte)(xPC)
+      .endif
+    .elseif \width == 16
+      .if \signed
+        lh  \reg, (\count*2)(xPC)
+      .else
+        lhu \reg, (\count*2)(xPC)
+      .endif
+    .elseif \width == 32
+      .if \signed
+        lw  \reg, (\count*2)(xPC)
+      .else
+        lwu \reg, (\count*2)(xPC)
+      .endif
+    .elseif \width == 64
+      ld  \reg, (\count*2)(xPC)
+    .else
+      unimp  // impossible
+    .endif
+.endm
+
+// Fetch the next instruction, from xPC into xINST.
+// Does not advance xPC.
+.macro FETCH_INST
+    lhu xINST, (xPC)  // zero in upper 48 bits
+.endm
+
+// Fetch the next instruction, from xPC into xINST. Advance xPC by \count units, each 2 bytes.
+//
+// Immediates have a 12-bit offset range from xPC. Thus, \count can range from -1024 to 1023.
+//
+// Note: Must be placed AFTER anything that can throw an exception, or the exception catch may miss.
+// Thus, this macro must be placed after EXPORT_PC.
+.macro FETCH_ADVANCE_INST count
+    lhu xINST, (\count*2)(xPC)  // zero in upper 48 bits
+    addi xPC, xPC, (\count*2)
+.endm
+
+// Clobbers: \reg
+.macro GET_INST_OPCODE reg
+    and \reg, xINST, 0xFF
+.endm
+
+// Clobbers: \reg
+.macro GOTO_OPCODE reg
+    slliw \reg, \reg, ${handler_size_bits}
+    add \reg, xIBASE, \reg
+    jr \reg
+.endm
+
+.macro FETCH_FROM_THREAD_CACHE reg, miss_label, z0, z1
+    // See art::InterpreterCache::IndexOf() for computing index of key within cache array.
+    // Entry address:
+    //   xSELF + OFFSET + ((xPC>>2 & xFF) << 4)
+    // = xSELF + OFFSET + ((xPC & xFF<<2) << 2)
+    // = xSELF + ((OFFSET>>2 + (xPC & xFF<<2)) << 2)
+    // => ANDI, ADD, SH2ADD
+#if (THREAD_INTERPRETER_CACHE_SIZE_LOG2 != 8)
+#error Expected interpreter cache array size = 256 elements
+#endif
+#if (THREAD_INTERPRETER_CACHE_SIZE_SHIFT != 2)
+#error Expected interpreter cache entry size = 16 bytes
+#endif
+#if ((THREAD_INTERPRETER_CACHE_OFFSET & 0x3) != 0)
+#error Expected interpreter cache offset to be 4-byte aligned
+#endif
+    andi \z0, xPC, 0xFF << 2
+    addi \z0, \z0, THREAD_INTERPRETER_CACHE_OFFSET >> 2
+    sh2add \z0, \z0, xSELF  // z0 := entry's address
+    ld \z1, (\z0)           // z1 := dex PC
+    bne xPC, \z1, \miss_label
+    ld \reg, 8(\z0)         // value: depends on context; see call site
+.endm
+
+// Inputs:
+//   - a0
+//   - xSELF
+// Clobbers: t0
+.macro CHECK_AND_UPDATE_SHARED_MEMORY_METHOD if_hot, if_not_hot
+    lwu t0, ART_METHOD_ACCESS_FLAGS_OFFSET(a0)
+    BRANCH_IF_BIT_CLEAR t0, t0, ART_METHOD_IS_MEMORY_SHARED_FLAG_BIT, \if_hot
+
+    lwu t0, THREAD_SHARED_METHOD_HOTNESS_OFFSET(xSELF)  // t0 := hotness
+    beqz t0, \if_hot
+
+    addi t0, t0, -1  // increase hotness
+    sw t0,  THREAD_SHARED_METHOD_HOTNESS_OFFSET(xSELF)
+    j \if_not_hot
+.endm
+
+// Update xPC by \units code units. On back edges, perform hotness and suspend.
+.macro BRANCH units
+    sh1add xPC, \units, xPC
+    blez \units, 2f  // If branch is <= 0, increase hotness and do a suspend check.
+1:
+    FETCH_INST
+    GET_INST_OPCODE t0
+    GOTO_OPCODE t0
+2:
+    ld a0, (sp)
+    lhu t0, ART_METHOD_HOTNESS_COUNT_OFFSET(a0)  // t0 := hotness
+#if (NTERP_HOTNESS_VALUE != 0)
+#error Expected 0 for hotness value
+#endif
+    // If the counter is at zero (hot), handle it in the runtime.
+    beqz t0, 3f
+    addi t0, t0, -1  // increase hotness
+    sh t0, ART_METHOD_HOTNESS_COUNT_OFFSET(a0)
+    DO_SUSPEND_CHECK continue=1b
+    j 1b
+3:
+    tail NterpHandleHotnessOverflow  // arg a0 (ArtMethod*)
+.endm
+
+// Increase method hotness before starting the method.
+// Hardcoded:
+// - a0: ArtMethod*
+// Clobbers: t0
+.macro START_EXECUTING_INSTRUCTIONS
+    ld a0, (sp)
+    lhu t0, ART_METHOD_HOTNESS_COUNT_OFFSET(a0)  // t0 := hotness
+#if (NTERP_HOTNESS_VALUE != 0)
+#error Expected 0 for hotness value
+#endif
+    // If the counter is at zero (hot), handle it in the runtime.
+    beqz t0, 3f
+    addi t0, t0, -1  // increase hotness
+    sh t0, ART_METHOD_HOTNESS_COUNT_OFFSET(a0)
+1:
+    DO_SUSPEND_CHECK continue=2f
+2:
+    FETCH_INST
+    GET_INST_OPCODE t0
+    GOTO_OPCODE t0
+3:
+    CHECK_AND_UPDATE_SHARED_MEMORY_METHOD if_hot=4f, if_not_hot=1b
+4:
+    mv a1, zero  // dex_pc_ptr=nullptr
+    mv a2, zero  // vergs=nullptr
+    call nterp_hot_method
+    j 2b
+.endm
+
+// 64 bit read
+// Clobbers: \reg
+// Safe if \reg == \vreg.
+.macro GET_VREG_WIDE reg, vreg
+    sh2add \reg, \vreg, xFP  // vreg addr in register array
+    ld \reg, (\reg)          // reg := fp[vreg](lo) | fp[vreg+1](hi)
+.endm
+
+// 64 bit write
+// Clobbers: z0
+.macro SET_VREG_WIDE reg, vreg, z0
+    sh2add \z0, \vreg, xFP    // vreg addr in register array
+    sd \reg, (\z0)            // fp[vreg] := reg(lo) ; fp[vreg+1] := reg(hi)
+    sh2add \z0, \vreg, xREFS  // vreg addr in reference array
+    sd zero, (\z0)            // refs[vreg] := null ; refs[vreg+1] := null
+.endm
+
+// Object read
+// Clobbers: \reg
+// Safe if \reg == \vreg.
+.macro GET_VREG_OBJECT reg, vreg
+    sh2add \reg, \vreg, xREFS  // vreg addr in reference array
+    lwu \reg, (\reg)           // reg := refs[vreg]
+.endm
+
+// Object write
+// Clobbers: z0
+.macro SET_VREG_OBJECT reg, vreg, z0
+    sh2add \z0, \vreg, xFP    // vreg addr in register array
+    sw \reg, (\z0)            // fp[vreg] := reg
+    sh2add \z0, \vreg, xREFS  // vreg addr in reference array
+    sw \reg, (\z0)            // refs[vreg] := reg
+.endm
+
+// Floating-point 64 bit read
+// Clobbers: \reg, \vreg
+.macro GET_VREG_DOUBLE reg, vreg
+    sh2add \vreg, \vreg, xFP  // vreg addr in register array
+    fld \reg, (\vreg)         // reg := fp[vreg](lo) | fp[vreg+1](hi)
+.endm
+
+// Floating-point 64 bit write
+// Clobbers: \reg, z0
+.macro SET_VREG_DOUBLE reg, vreg, z0
+    sh2add \z0, \vreg, xFP    // vreg addr in register array
+    fsd \reg, (\z0)           // fp[vreg] := reg(lo) ; fp[vreg+1] := reg(hi)
+    sh2add \z0, \vreg, xREFS  // vreg addr in reference array
+    sd zero, (\z0)            // refs[vreg] := null ; refs[vreg+1] := null
+.endm
+
+// Put "%def" definitions after ".macro" definitions for proper expansion. %def is greedy.
+
+// Typed read, defaults to 32-bit read
+// Note: An object ref requires LWU, or LW;ZEXT.W.
+// Clobbers: \reg
+// Safe if \reg == \vreg.
+%def get_vreg(reg, vreg, width=32, is_wide=False, is_unsigned=False):
+%  if is_wide or width == 64:
+     GET_VREG_WIDE $reg, $vreg
+%  elif is_unsigned:
+     sh2add $reg, $vreg, xFP  // vreg addr in register array
+     lwu $reg, ($reg)         // reg := fp[vreg], zext
+%  else:
+     sh2add $reg, $vreg, xFP  // vreg addr in register array
+     lw $reg, ($reg)          // reg := fp[vreg]
+%#:
+
+// Typed write, defaults to 32-bit write.
+// Note: Incorrect for an object ref; it requires 2nd SW into xREFS.
+// Clobbers: z0
+%def set_vreg(reg, vreg, z0, width=32, is_wide=False):
+%  if is_wide or width == 64:
+     SET_VREG_WIDE $reg, $vreg, $z0
+%  else:
+     sh2add $z0, $vreg, xFP    // vreg addr in register array
+     sw $reg, ($z0)            // fp[vreg] := reg
+     sh2add $z0, $vreg, xREFS  // vreg addr in reference array
+     sw zero, ($z0)            // refs[vreg] := null
+%#:
+
+// Floating-point read, defaults to 32-bit read.
+// Clobbers: reg, vreg
+%def get_vreg_float(reg, vreg, is_double=False):
+%  if is_double:
+     GET_VREG_DOUBLE $reg, $vreg
+%  else:
+     sh2add $vreg, $vreg, xFP  // vreg addr in register array
+     flw $reg, ($vreg)         // reg := fp[vreg]
+%#:
+
+// Floating-point write, defaults to 32-bit write.
+// Clobbers: reg, z0
+%def set_vreg_float(reg, vreg, z0, is_double=False):
+%  if is_double:
+     SET_VREG_DOUBLE $reg, $vreg, $z0
+%  else:
+     sh2add $z0, $vreg, xFP    // vreg addr in register array
+     fsw $reg, ($z0)           // fp[vreg] := reg
+     sh2add $z0, $vreg, xREFS  // vreg addr in reference array
+     sw zero, ($z0)            // refs[vreg] := null
+%#:
+
 %def entry():
 /*
  * ArtMethod entry point.
  *
  * On entry:
- *  XXX   ArtMethod* callee
- *  rest  method parameters
+ *  a0     ArtMethod* callee
+ *  a1-a7  method parameters
  */
-
-OAT_ENTRY ExecuteNterpWithClinitImpl, EndExecuteNterpWithClinitImpl
+OAT_ENTRY ExecuteNterpWithClinitImpl
+#if MIRROR_CLASS_STATUS_SHIFT < 12
+#error mirror class status bits cannot use LUI load technique
+#endif
+    .cfi_startproc
     // For simplicity, we don't do a read barrier here, but instead rely
     // on art_quick_resolution_trampoline to always have a suspend point before
     // calling back here.
-    unimp
+    lwu t0, ART_METHOD_DECLARING_CLASS_OFFSET(a0)
+    lw t1, MIRROR_CLASS_STATUS_OFFSET(t0)  // t1 := status word, sext
+    lui t2, MIRROR_CLASS_STATUS_VISIBLY_INITIALIZED << (MIRROR_CLASS_STATUS_SHIFT - 12)
+    // The unsigned comparison works in tandem with the 64-bit sign-extension of
+    // the status bits at the top of the 32-bit word. The order of the status
+    // constants (sign extended from LUI) is unchanged with unsigned comparison.
+    bgeu t1, t2, ExecuteNterpImpl
+    lui t2, MIRROR_CLASS_STATUS_INITIALIZED << (MIRROR_CLASS_STATUS_SHIFT - 12)
+    bltu t1, t2, .Linitializing_check
+    fence w, w
+    j ExecuteNterpImpl
+.Linitializing_check:
+    lui t2, MIRROR_CLASS_STATUS_INITIALIZING << (MIRROR_CLASS_STATUS_SHIFT - 12)
+    bltu t1, t2, .Lresolution_trampoline
+    lwu t1, MIRROR_CLASS_CLINIT_THREAD_ID_OFFSET(t0)
+    lwu t0, THREAD_TID_OFFSET(xSELF)
+    beq t0, t1, ExecuteNterpImpl
+.Lresolution_trampoline:
+    tail art_quick_resolution_trampoline
+    .cfi_endproc
+    .type EndExecuteNterpWithClinitImpl, @function
+    .hidden EndExecuteNterpWithClinitImpl
+    .global EndExecuteNterpWithClinitImpl
 EndExecuteNterpWithClinitImpl:
 
-OAT_ENTRY ExecuteNterpImpl, EndExecuteNterpImpl
-    .cfi_startproc
-    unimp
+OAT_ENTRY ExecuteNterpImpl
+   .cfi_startproc
+%  setup_nterp_frame(cfi_refs="CFI_REFS", refs="xREFS", fp="xFP", pc="xPC", regs="s7", ins="s8", spills_sp="s9", z0="t0", z1="t1", z2="t2", z3="t3", uniq="entry")
+                            // xREFS := callee refs array
+                            // xFP   := callee fp array
+                            // xPC   := callee dex array
+                            // s7    := refs/fp vreg count
+                            // s8    := ins count
+                            // s9    := post-spills pre-frame sp
+                            // sp    := post-frame sp
+   CFI_DEFINE_DEX_PC_WITH_OFFSET(/*tmpReg*/CFI_TMP, /*dexReg*/CFI_DEX, /*dexOffset*/0)
 
-%def fetch_from_thread_cache(dest_reg, miss_label):
+   // Fast path: zero args.
+   beqz s8, .Lentry_go
+
+   sub s7, s7, s8           // s7 := a1 index in fp/refs
+   lwu s10, ART_METHOD_ACCESS_FLAGS_OFFSET(a0)
+                            // s10 := method flags
+
+   // Fast path: all reference args.
+   sh2add t0, s7, xFP       // t0 := &xFP[a1]
+   sh2add t1, s7, xREFS     // t1 := &xREFS[a1]
+   BRANCH_IF_BIT_CLEAR t2, s10, ART_METHOD_NTERP_ENTRY_POINT_FAST_PATH_FLAG_BIT, .Lentry_a1
+%  setup_ref_args_and_go(fp="t0", refs="t1", refs_end="xFP", spills_sp="s9", z0="t2", z1="t3", done=".Lentry_go")
+
+   // Fast path: instance with zero args.
+.Lentry_a1:
+   bexti s10, s10, ART_METHOD_IS_STATIC_FLAG_BIT
+                            // s10 := 1 if static, 0 if instance
+   bnez s10, .Lentry_shorty
+   sw a1, (t0)
+   sw a1, (t1)
+   li t2, 1
+   beq s8, t2, .Lentry_go
+
+   // Slow path: runtime call to obtain shorty, full setup from managed ABI.
+.Lentry_shorty:
+   SPILL_ALL_ARGUMENTS
+   // TODO: Better way to get shorty
+   call NterpGetShorty      // arg a0
+   mv s11, a0               // s11 := shorty
+   RESTORE_ALL_ARGUMENTS
+
+   // temporaries are trashed, recompute some values
+   sh2add t0, s7, xFP       // t0 := &xFP[a1]
+   sh2add t1, s7, xREFS     // t1 := &xREFS[a1]
+   addi t2, s11, 1          // t2 := shorty arg (skip return type)
+   xori s10, s10, 1         // s10 := 0 if static, 1 if instance
+   slliw t3, s10, 2         // t3 := (static) 0, (instance) 4: fp/refs/outs byte offset
+   // constant setup for gpr/fpr shorty comparisons
+   li s0, 'D'               // s0 := double char (unused fp)
+   li s4, 'F'               // s4 := float char (unused xINST)
+   li s5, 'J'               // s5 := long char (unused xIBASE)
+   li s8, 'L'               // s8 := ref char (unused ins count)
+   bnez s10, .Lentry_args   // instance a1 already stored into callee's xFP and xREFS
+
+%  store_gpr_to_vreg(gpr="a1", offset="t3", shorty="t2", fp="t0", refs="t1", z0="t4", z1="t5", D="s0", F="s4", J="s5", L="s8", next=".Lentry_fargs")
+
+.Lentry_args:
+   // linear scan through shorty: extract non-float args
+%  store_gpr_to_vreg(gpr="a2", offset="t3", shorty="t2", fp="t0", refs="t1", z0="t4", z1="t5", D="s0", F="s4", J="s5", L="s8", next=".Lentry_fargs")
+%  store_gpr_to_vreg(gpr="a3", offset="t3", shorty="t2", fp="t0", refs="t1", z0="t4", z1="t5", D="s0", F="s4", J="s5", L="s8", next=".Lentry_fargs")
+%  store_gpr_to_vreg(gpr="a4", offset="t3", shorty="t2", fp="t0", refs="t1", z0="t4", z1="t5", D="s0", F="s4", J="s5", L="s8", next=".Lentry_fargs")
+%  store_gpr_to_vreg(gpr="a5", offset="t3", shorty="t2", fp="t0", refs="t1", z0="t4", z1="t5", D="s0", F="s4", J="s5", L="s8", next=".Lentry_fargs")
+%  store_gpr_to_vreg(gpr="a6", offset="t3", shorty="t2", fp="t0", refs="t1", z0="t4", z1="t5", D="s0", F="s4", J="s5", L="s8", next=".Lentry_fargs")
+%  store_gpr_to_vreg(gpr="a7", offset="t3", shorty="t2", fp="t0", refs="t1", z0="t4", z1="t5", D="s0", F="s4", J="s5", L="s8", next=".Lentry_fargs")
+   // We drained arg registers, so continue from caller stack's out array. Unlike the reference-only
+   // fast-path, the continuation offset in the out array can vary, depending on the presence of
+   // 64-bit values in the arg registers. \offset tracks this value as a byte offset.
+   addi t5, s9, (NTERP_SIZE_SAVE_CALLEE_SAVES + 8)
+                            // t5 := (caller) outs array base address
+   add t4, t3, t0           // t4 := (callee) &FP[next]
+   add t1, t3, t1           // t1 := (callee) &REFS[next]
+   add t3, t3, t5           // t3 := (caller) &OUTS[next]
+%  store_outs_to_vregs(outs="t3", shorty="t2", fp="t4", refs="t1", z0="t5", z1="t6", D="s0", F="s4", J="s5", L="s8", next=".Lentry_fargs")
+                            // t0 = &xFP[a1], unclobbered
+.Lentry_fargs:
+   addi t1, s11, 1          // t1 := shorty arg (skip return type)
+   slliw t2, s10, 2         // t2 := starting byte offset for fp/outs, static and instance
+   // linear scan through shorty: extract float args
+%  store_fpr_to_vreg(fpr="fa0", offset="t2", shorty="t1", fp="t0", z0="t3", z1="t4", D="s0", F="s4", J="s5", next=".Lentry_go")
+%  store_fpr_to_vreg(fpr="fa1", offset="t2", shorty="t1", fp="t0", z0="t3", z1="t4", D="s0", F="s4", J="s5", next=".Lentry_go")
+%  store_fpr_to_vreg(fpr="fa2", offset="t2", shorty="t1", fp="t0", z0="t3", z1="t4", D="s0", F="s4", J="s5", next=".Lentry_go")
+%  store_fpr_to_vreg(fpr="fa3", offset="t2", shorty="t1", fp="t0", z0="t3", z1="t4", D="s0", F="s4", J="s5", next=".Lentry_go")
+%  store_fpr_to_vreg(fpr="fa4", offset="t2", shorty="t1", fp="t0", z0="t3", z1="t4", D="s0", F="s4", J="s5", next=".Lentry_go")
+%  store_fpr_to_vreg(fpr="fa5", offset="t2", shorty="t1", fp="t0", z0="t3", z1="t4", D="s0", F="s4", J="s5", next=".Lentry_go")
+%  store_fpr_to_vreg(fpr="fa6", offset="t2", shorty="t1", fp="t0", z0="t3", z1="t4", D="s0", F="s4", J="s5", next=".Lentry_go")
+%  store_fpr_to_vreg(fpr="fa7", offset="t2", shorty="t1", fp="t0", z0="t3", z1="t4", D="s0", F="s4", J="s5", next=".Lentry_go")
+   addi t3, s9, (NTERP_SIZE_SAVE_CALLEE_SAVES + 8)
+                            // t3 := (caller) outs array base address
+   add t0, t2, t0           // t0 := (callee) &FP[next]
+   add t2, t2, t3           // t2 := (caller) &OUTS[next]
+%  store_float_outs_to_vregs(outs="t2", shorty="t1", fp="t0", z0="t3", D="s0", F="s4", J="s5", next=".Lentry_go")
+
+.Lentry_go:
+    la xIBASE, artNterpAsmInstructionStart
+    START_EXECUTING_INSTRUCTIONS
+    // NOTE: no fallthrough
+    // cfi info continues, and covers the whole nterp implementation.
+    SIZE ExecuteNterpImpl
 
 %def footer():
 /*
@@ -88,19 +574,138 @@
 
 // Enclose all code below in a symbol (which gets printed in backtraces).
 NAME_START nterp_helper
+
+common_errArrayIndex:
+    EXPORT_PC
+    // CALL preserves RA for stack walking.
+    call art_quick_throw_array_bounds  // args a0 (index), a1 (length)
+
+common_errDivideByZero:
+    EXPORT_PC
+    // CALL preserves RA for stack walking.
+    call art_quick_throw_div_zero
+
+common_errNullObject:
+    EXPORT_PC
+    // CALL preserves RA for stack walking.
+    call art_quick_throw_null_pointer_exception
+
+NterpInvokeVirtual:
+%  nterp_invoke_virtual()
+NterpInvokeSuper:
+%  nterp_invoke_super()
+NterpInvokeDirect:
+%  nterp_invoke_direct()
+NterpInvokeStringInit:
+%  nterp_invoke_string_init()
+NterpInvokeStatic:
+%  nterp_invoke_static()
+NterpInvokeInterface:
+%  nterp_invoke_interface()
+NterpInvokePolymorphic:
+%  nterp_invoke_polymorphic()
+NterpInvokeCustom:
+%  nterp_invoke_custom()
+NterpInvokeVirtualRange:
+%  nterp_invoke_virtual_range()
+NterpInvokeSuperRange:
+%  nterp_invoke_super_range()
+NterpInvokeDirectRange:
+%  nterp_invoke_direct_range()
+NterpInvokeStringInitRange:
+%  nterp_invoke_string_init_range()
+NterpInvokeStaticRange:
+%  nterp_invoke_static_range()
+NterpInvokeInterfaceRange:
+%  nterp_invoke_interface_range()
+NterpInvokePolymorphicRange:
+%  nterp_invoke_polymorphic_range()
+NterpInvokeCustomRange:
+%  nterp_invoke_custom_range()
+
+// Arg a0: ArtMethod*
+NterpHandleHotnessOverflow:
+   CHECK_AND_UPDATE_SHARED_MEMORY_METHOD if_hot=.Lhotspill_hot, if_not_hot=.Lhotspill_suspend
+.Lhotspill_hot:
+   mv a1, xPC
+   mv a2, xFP
+   call nterp_hot_method  // args a0, a1, a2
+   bnez a0, .Lhotspill_osr
+.Lhotspill_advance:
+   FETCH_INST
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+.Lhotspill_osr:
+   // a0 = OsrData*
+   // Drop most of the current nterp frame, but keep the callee-saves.
+   // The nterp callee-saves (count and layout) match the OSR frame's callee-saves.
+   ld sp, -8(xREFS)  // caller's interpreted frame pointer
+   .cfi_def_cfa sp, NTERP_SIZE_SAVE_CALLEE_SAVES
+   lwu t0, OSR_DATA_FRAME_SIZE(a0)
+   addi t0, t0, -NTERP_SIZE_SAVE_CALLEE_SAVES  // t0 := osr frame - callee saves, in bytes
+   mv s7, sp         // Remember CFA in a callee-save register.
+   .cfi_def_cfa_register s7
+   sub sp, sp, t0    // OSR size guaranteed to be stack aligned (16 bytes).
+
+   addi t1, a0, OSR_DATA_MEMORY  // t1 := read start
+   add t1, t1, t0                // t1 := read end (exclusive)
+   mv t2, s7                     // t2 := write end (exclusive)
+   // t0 >= 8 (OSR places ArtMethod* at bottom of frame), so loop will terminate.
+.Lhotspill_osr_copy_loop:
+   addi t1, t1, -8
+   ld t3, (t1)
+   addi t2, t2, -8
+   sd t3, (t2)
+   bne t2, sp, .Lhotspill_osr_copy_loop
+
+   ld s8, OSR_DATA_NATIVE_PC(a0)  // s8 := native PC; jump after free
+   call free  // arg a0; release OsrData*
+   jr s8      // Jump to the compiled code.
+.Lhotspill_suspend:
+   DO_SUSPEND_CHECK continue=.Lhotspill_advance
+   j .Lhotspill_advance
+
 // This is the logical end of ExecuteNterpImpl, where the frame info applies.
-// EndExecuteNterpImpl includes the methods below as we want the runtime to
-// see them as part of the Nterp PCs.
 .cfi_endproc
+
+NterpToNterpInstance:
+%  nterp_to_nterp_instance()
+NterpToNterpStringInit:
+%  nterp_to_nterp_string_init()
+NterpToNterpStatic:
+%  nterp_to_nterp_static()
+NterpToNterpInstanceRange:
+%  nterp_to_nterp_instance_range()
+NterpToNterpStringInitRange:
+%  nterp_to_nterp_string_init_range()
+NterpToNterpStaticRange:
+%  nterp_to_nterp_static_range()
+
 NAME_END nterp_helper
 
-// This is the end of PCs contained by the OatQuickMethodHeader created for the interpreter
-// entry point.
+// EndExecuteNterpImpl includes the methods after .cfi_endproc, as we want the runtime to see them
+// as part of the Nterp PCs. This label marks the end of PCs contained by the OatQuickMethodHeader
+// created for the interpreter entry point.
     .type EndExecuteNterpImpl, @function
     .hidden EndExecuteNterpImpl
     .global EndExecuteNterpImpl
 EndExecuteNterpImpl:
 
+// Entrypoints into runtime.
+NTERP_TRAMPOLINE nterp_allocate_object, NterpAllocateObject
+NTERP_TRAMPOLINE nterp_filled_new_array, NterpFilledNewArray
+NTERP_TRAMPOLINE nterp_filled_new_array_range, NterpFilledNewArrayRange
+NTERP_TRAMPOLINE nterp_get_class, NterpGetClass
+NTERP_TRAMPOLINE nterp_get_instance_field_offset, NterpGetInstanceFieldOffset
+NTERP_TRAMPOLINE nterp_get_method, NterpGetMethod
+NTERP_TRAMPOLINE nterp_get_static_field, NterpGetStaticField
+NTERP_TRAMPOLINE nterp_hot_method, NterpHotMethod
+NTERP_TRAMPOLINE nterp_load_object, NterpLoadObject
+
+ENTRY nterp_deliver_pending_exception
+    DELIVER_PENDING_EXCEPTION
+END nterp_deliver_pending_exception
+
 // gen_mterp.py will inline the following definitions
 // within [ExecuteNterpImpl, EndExecuteNterpImpl).
 %def instruction_start():
@@ -115,7 +720,11 @@
     .hidden artNterpAsmInstructionEnd
     .global artNterpAsmInstructionEnd
 artNterpAsmInstructionEnd:
-    unimp
+    // artNterpAsmInstructionEnd is used as landing pad for exception handling.
+    // xPC (S3) for the exception handler was set just prior to the long jump coming here.
+    FETCH_INST
+    GET_INST_OPCODE t0
+    GOTO_OPCODE t0
 
 %def opcode_pre():
 %   pass
@@ -125,7 +734,6 @@
     NAME_START nterp_${opcode}
 %def opcode_end():
     NAME_END nterp_${opcode}
-    unimp
 %def opcode_slow_path_start(name):
     NAME_START ${name}
 %def opcode_slow_path_end(name):
diff --git a/runtime/interpreter/mterp/riscv64/object.S b/runtime/interpreter/mterp/riscv64/object.S
index 449df1e..43bb31f 100644
--- a/runtime/interpreter/mterp/riscv64/object.S
+++ b/runtime/interpreter/mterp/riscv64/object.S
@@ -1,109 +1,971 @@
+// check-cast vAA, type@BBBB
+// Format 21c: AA|1f BBBB
+// Throw a ClassCastException if the reference in the given register cannot be cast to the indicated
+// type.
 %def op_check_cast():
-    unimp
+   FETCH_FROM_THREAD_CACHE /*expected klass*/a1, .L${opcode}_miss, t0, t1
+.L${opcode}_miss_resume:
 
-%def op_check_cast_slow_path():
-    unimp
+   srliw t0, xINST, 8         // t0 := AA
+%  get_vreg("a0", "t0", is_unsigned=True)  # a0 := fp[AA], zext
+   beqz a0, .L${opcode}_next  // null
+   lwu a2, MIRROR_OBJECT_CLASS_OFFSET(a0)  // a2 := actual klass
+   UNPOISON_HEAP_REF a2
+   // Fast path: compare without read barrier.
+   bne a1, a2, .L${opcode}_slow
 
+.L${opcode}_next:
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_miss:
+   EXPORT_PC
+   mv a0, xSELF
+   ld a1, (sp)  // caller ArtMethod*
+   mv a2, xPC
+   call nterp_get_class
+   mv a1, a0
+   j .L${opcode}_miss_resume
+
+.L${opcode}_slow:
+   // A0 and A1 in position for quick call.
+%  slow_path = add_slow_path(op_check_cast_slow_path, "t0", "t1", "t2")
+   tail $slow_path  // slow offset exceeds branch imm
+                    // args a0, a1, a2
+
+
+// Checks cases for (1) interface, (2) array, and (3) super classes.
+// Hardcoded: a0 (obj), a1 (expected klass), a2 (actual klass)
+//
+// Note. We don't do read barriers for simplicity. However, this means that fetched objects may be a
+// from-space reference. That's OK as we only fetch constant information from the references. This
+// also means that some of the comparisons below may lead to false negative due to stale data, so
+// all negative cases must pass through the runtime, via potential read barrier.
+%def op_check_cast_slow_path(z0, z1, z2):
+   // Interface check: cut to runtime.
+   lwu $z0, MIRROR_CLASS_ACCESS_FLAGS_OFFSET(a1)
+   BRANCH_IF_BIT_SET $z0, $z0, MIRROR_CLASS_IS_INTERFACE_FLAG_BIT, .L${opcode}_runtime
+
+   // Array check handled below.
+   lwu $z0, MIRROR_CLASS_COMPONENT_TYPE_OFFSET(a1)
+   // Defer z0 unpoison to array path.
+   bnez $z0, .L${opcode}_array
+
+   // Super check: find expected class, else cut to runtime.
+.L${opcode}_super:
+   lwu a2, MIRROR_CLASS_SUPER_CLASS_OFFSET(a2)
+   UNPOISON_HEAP_REF a2
+   beq a2, a1, .L${opcode}_slow_next
+   bnez a2, .L${opcode}_super
+
+.L${opcode}_runtime:
+   TEST_IF_MARKING $z0, .L${opcode}_mark
+.L${opcode}_mark_resume:
+   EXPORT_PC
+   call art_quick_check_instance_of  // args a0 (obj), a1 (expected klass)
+
+   // Advancement logic replicated here for branch distance.
+.L${opcode}_slow_next:
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE $z0
+   GOTO_OPCODE $z0
+
+.L${opcode}_mark:
+   call art_quick_read_barrier_mark_reg11  // a1, expected klass
+   j .L${opcode}_mark_resume
+
+.L${opcode}_array:
+   UNPOISON_HEAP_REF $z0          // z0 = expected.component
+   lwu $z1, MIRROR_CLASS_COMPONENT_TYPE_OFFSET(a2)  // z1 := actual.component
+   beqz $z1, .L${opcode}_runtime  // null: actual not an array
+   UNPOISON_HEAP_REF $z1
+   lwu $z2, MIRROR_CLASS_SUPER_CLASS_OFFSET($z0)  // z2 := expected.component.super
+   // z2 can skip unpoison for null check
+   bnez $z2, .L${opcode}_runtime  // super type exists
+   // expected.component.super is null: expected is either Object[] or primitive array.
+   lhu $z2, MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET($z0)  // z2 := expected.component.primitive
+   bnez $z2, .L${opcode}_runtime  // expected's component is primitive
+   lwu $z2, MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET($z1)  // z2 := actual.component.primitive
+   bnez $z2, .L${opcode}_runtime  // actual's component is primitive
+   // Here, z0 is Object, and z1 is a subclass of Object.
+   j .L${opcode}_slow_next
+
+
+// instance-of vA, vB, type@CCCC
+// Format 22c: B|A|20 CCCC
+// vA := 1 if vB instance-of CCCC, else 0
+// Store in the given destination register 1 if the indicated reference is an instance of the given
+// type, or 0 if not.
 %def op_instance_of():
-    unimp
+   srliw s7, xINST, 8    // s7 := B|A
+   srliw s8, xINST, 12   // s8 := B
+   andi s7, s7, 0xF      // s7 := A, used in slow path
+   FETCH_FROM_THREAD_CACHE /*expected klass*/ a1, .L${opcode}_miss, t0, t1
+.L${opcode}_miss_resume:
 
-%def op_instance_of_slow_path():
-    unimp
+%  get_vreg("a0", "s8", is_unsigned=True)  # a0 := fp[B], zext
+   beqz a0, .L${opcode}_next  // a0 = null = dst value "false"
+   lwu a2, MIRROR_OBJECT_CLASS_OFFSET(a0)  // a2 := actual klass
+   UNPOISON_HEAP_REF a2
+   // Fast path: compare without read barrier.
+   bne a1, a2, .L${opcode}_slow
 
-%def op_iget_boolean():
-%  op_iget(load="ldrb", wide="0", is_object="0")
+   li a0, 1  // dst value "true"
 
-%def op_iget_byte():
-%  op_iget(load="ldrsb", wide="0", is_object="0")
+.L${opcode}_next:
+%  set_vreg("a0", "s7", z0="t1")  # fp[A] := a0
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
 
-%def op_iget_char():
-%  op_iget(load="ldrh", wide="0", is_object="0")
+.L${opcode}_miss:
+   EXPORT_PC
+   mv a0, xSELF
+   ld a1, (sp)  // caller ArtMethod*
+   mv a2, xPC
+   call nterp_get_class
+   mv a1, a0
+   j .L${opcode}_miss_resume
 
-%def op_iget_short():
-%  op_iget(load="ldrsh", wide="0", is_object="0")
+.L${opcode}_slow:
+   // A0 and A1 in position for quick call.
+%  slow_path = add_slow_path(op_instance_of_slow_path, "s7", "t0", "t1", "t2")
+   tail $slow_path  // slow offset exceeds branch imm
+                    // args a0, a1, a2
 
-%def op_iget(load="ldr", wide="0", is_object="0"):
-    unimp
 
-%def op_iget_slow_path(load, wide, is_object):
+// Checks cases for (1) interface, (2) array, and (3) super classes.
+// Hardcoded: a0 (obj), a1 (expected klass), a2 (actual klass)
+//
+// Npte. If marking, don't bother with read barrier calls - cut to runtime. This arrangement allows
+// the (non marking) super class fast path's negative case to skip the read barrier and runtime
+// call, and correctly diagnose the situation with fp[A] := 0.
+%def op_instance_of_slow_path(vA, z0, z1, z2):
+   TEST_IF_MARKING $z0, .L${opcode}_runtime_with_read_barrier
 
-%def op_iget_wide():
-%  op_iget(load="ldr", wide="1", is_object="0")
+   // Interface check: cut to runtime.
+   lwu $z0, MIRROR_CLASS_ACCESS_FLAGS_OFFSET(a1)
+   BRANCH_IF_BIT_SET $z0, $z0, MIRROR_CLASS_IS_INTERFACE_FLAG_BIT, .L${opcode}_runtime
 
-%def op_iget_object():
-%  op_iget(load="ldr", wide="0", is_object="1")
+   // Array check handled below.
+   lwu $z0, MIRROR_CLASS_COMPONENT_TYPE_OFFSET(a1)
+   // Defer z0 unpoison to array path.
+   bnez $z0, .L${opcode}_array
 
-%def op_iput_boolean():
-%  op_iput(store="strb", wide="0", is_object="0")
+   // Super check: find klass up the hierarchy.
+.L${opcode}_super:
+   lwu a2, MIRROR_CLASS_SUPER_CLASS_OFFSET(a2)
+   UNPOISON_HEAP_REF a2
+   beq a2, a1, .L${opcode}_super_exit
+   bnez a2, .L${opcode}_super
+.L${opcode}_super_exit:
+   snez a0, a2  // a0 := 1 if (a1 = a2 != null), else 0 (because a2 = null)
 
-%def op_iput_byte():
-%  op_iput(store="strb", wide="0", is_object="0")
+.L${opcode}_slow_next:
+%  set_vreg("a0", vA, z0=z0)  # fp[A] := a0
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE $z0
+   GOTO_OPCODE $z0
 
-%def op_iput_char():
-%  op_iput(store="strh", wide="0", is_object="0")
+.L${opcode}_runtime_with_read_barrier:
+   call art_quick_read_barrier_mark_reg11  // a1, expected klass
+.L${opcode}_runtime:
+   EXPORT_PC
+   call artInstanceOfFromCode  // args a0 (obj), a1 (expected klass)
+       // return a0: 1 if true, else 0
+   j .L${opcode}_slow_next
 
-%def op_iput_short():
-%  op_iput(store="strh", wide="0", is_object="0")
+.L${opcode}_array:
+   UNPOISON_HEAP_REF $z0           // z0 = expected.component
+   lwu $z1, MIRROR_CLASS_SUPER_CLASS_OFFSET($z0)  // z1 := expected.component.super
+   // z1 can skip unpoison for null check
+   bnez $z1, .L${opcode}_runtime   // super type exists
+   // Here, expected.component.super is null: expected is either Object[] or primitive array.
+   lwu a0, MIRROR_CLASS_COMPONENT_TYPE_OFFSET(a2)  // a0 := actual.component
+   beqz a0, .L${opcode}_slow_next  // actual not an array, a0 = null = dst value "false"
+   UNPOISON_HEAP_REF a0
+   lhu $z1, MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET($z0)  // z1 := expected.component.primitive
+   lhu $z2, MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET(a0)   // z2 := actual.component.primitive
+   or a0, $z1, $z2  // a0 := 0 if z1 = z2 = 0, else non-zero (Primitive::Type enum)
+   seqz a0, a0      // a0 := 1 if both are class types, else 0
+   // Here, when a0 = 1, expected.component is Object, and actual.component is a subclass of Object.
+   j .L${opcode}_slow_next
 
-%def op_iput(store="str", wide="0", is_object="0"):
-    unimp
 
-%def op_iput_slow_path(store, wide, is_object):
-    unimp
-
-%def op_iput_wide():
-%  op_iput(store="str", wide="1", is_object="0")
-
-%def op_iput_object():
-%  op_iput(store="str", wide="0", is_object="1")
-
-%def op_sget_boolean():
-%  op_sget(load="ldrb", wide="0", is_object="0")
-
-%def op_sget_byte():
-%  op_sget(load="ldrsb", wide="0", is_object="0")
-
-%def op_sget_char():
-%  op_sget(load="ldrh", wide="0", is_object="0")
-
-%def op_sget_short():
-%  op_sget(load="ldrsh", wide="0", is_object="0")
-
-%def op_sget(load="ldr", wide="0", is_object="0"):
-    unimp
-
-%def op_sget_slow_path(load="ldr", wide="0", is_object="0"):
-    unimp
-
-%def op_sget_wide():
-%  op_sget(load="ldr", wide="1", is_object="0")
-
-%def op_sget_object():
-%  op_sget(load="ldr", wide="0", is_object="1")
-
-%def op_sput_boolean():
-%  op_sput(store="strb", wide="0", is_object="0")
-
-%def op_sput_byte():
-%  op_sput(store="strb", wide="0", is_object="0")
-
-%def op_sput_char():
-%  op_sput(store="strh", wide="0", is_object="0")
-
-%def op_sput_short():
-%  op_sput(store="strh", wide="0", is_object="0")
-
-%def op_sput(store="str", wide="0", is_object="0"):
-    unimp
-
-%def op_sput_slow_path(store, wide, is_object):
-    unimp
-
-%def op_sput_wide():
-%  op_sput(store="str", wide="1", is_object="0")
-
-%def op_sput_object():
-%  op_sput(store="str", wide="0", is_object="1")
-
+// new-instance vAA, type@BBBB
+// Format 21c: AA|22 BBBB
+// Construct a new instance of the indicated type, storing a reference to it in the destination. The
+// type must refer to a non-array class.
 %def op_new_instance():
-    unimp
+   EXPORT_PC
+   srliw s7, xINST, 8  // s7 := AA
+   FETCH_FROM_THREAD_CACHE /*resolved klass*/a0, .L${opcode}_miss, t0, t1
+   TEST_IF_MARKING t0, .L${opcode}_mark
+.L${opcode}_mark_resume:
+
+   ld t0, THREAD_ALLOC_OBJECT_ENTRYPOINT_OFFSET(xSELF)
+   jalr t0     // arg a0 (klass)
+               // return a0 := new-obj
+   fence w, w  // constructor fence; main.S has details
+
+.L${opcode}_miss_resume:
+   SET_VREG_OBJECT a0, s7, z0=t0  // refs[AA] := new-obj
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_mark:
+   call art_quick_read_barrier_mark_reg10  // a0, klass
+   j .L${opcode}_mark_resume
+
+.L${opcode}_miss:
+   EXPORT_PC
+   mv a0, xSELF
+   ld a1, (sp)  // caller ArtMethod*
+   mv a2, xPC
+   call nterp_allocate_object
+       // return a0 := new-obj, plus cache entry is updated with the resolved klass
+   j .L${opcode}_miss_resume
+
+
+// *** iget ***
+
+%def load(dst, src, width, zext):
+%  if width == 8 and zext:
+     lbu $dst, ($src)
+%  elif width == 8:
+     lb $dst, ($src)
+%  elif width == 16 and zext:
+     lhu $dst, ($src)
+%  elif width == 16:
+     lh $dst, ($src)
+%  elif width == 32:
+     lw $dst, ($src)
+%  elif width == 64:
+     ld $dst, ($src)
+%  else:
+%    assert False, width
+%#:
+
+
+%def store(src, dst, width):
+%  if width == 8:
+     sb $src, ($dst)
+%  elif width == 16:
+     sh $src, ($dst)
+%  elif width == 32:
+     sw $src, ($dst)
+%  elif width == 64:
+     sd $src, ($dst)
+%  else:
+%    assert False, width
+%#:
+
+
+// iget vA, vB, field@CCCC
+// Format 22c: B|A|52 CCCC
+// vA := vB.field
+%def op_iget(width=32, zext=False):
+   srliw s8, xINST, 8
+   srliw s7, xINST, 12     // s7 := B
+   andi s8, s8, 0xF        // s8 := A
+
+   // Fast path: NterpGetInstanceFieldOffset's byte offset from thread-local cache.
+   FETCH_FROM_THREAD_CACHE /*field_offset*/a0, .L${opcode}_slow, t1, t2
+.L${opcode}_slow_resume:
+
+%  get_vreg("t0", "s7", is_unsigned=True)  # t0 := holder
+   beqz t0, .L${opcode}_null
+   add t0, a0, t0          // t0 := field addr
+%  load(dst="t1", src="t0", width=width, zext=zext)
+                           // t1 := value
+   FETCH_ADVANCE_INST 2
+%  set_vreg("t1", "s8", z0="t0", width=width)
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_slow:
+   mv a0, xSELF
+   ld a1, (sp)  // a1 := caller ArtMethod*
+   mv a2, xPC
+   mv a3, zero
+   EXPORT_PC
+   call nterp_get_instance_field_offset  // result a0 := field_offset
+
+   // Test for volatile (negative value).
+   bgez a0, .L${opcode}_slow_resume
+%  volatile_path = add_slow_path(op_iget_volatile, width, zext, "s7", "s8", "t0", "t1")
+   tail $volatile_path
+
+.L${opcode}_null:
+   tail common_errNullObject
+
+
+%def op_iget_volatile(width, zext, holder, dst, z0, z1):
+%  get_vreg(z0, holder, is_unsigned=True)  # z0 := holder
+   beqz $z0, .L${opcode}_volatile_null
+   sub $z0, $z0, a0           // z0 := field addr (holder - (-offset))
+   // Atomic load: "fence rw,rw ; LOAD ; fence r,rw"
+   fence rw, rw
+%  load(dst=z1, src=z0, width=width, zext=zext)
+   fence r, rw
+                              // t1 := value
+   FETCH_ADVANCE_INST 2
+%  set_vreg(z1, dst, z0=z0, width=width)
+   GET_INST_OPCODE $z0
+   GOTO_OPCODE $z0
+
+.L${opcode}_volatile_null:
+   tail common_errNullObject
+
+
+// iget-wide vA, vB, field@CCCC
+// Format 22c: B|A|53 CCCC
+%def op_iget_wide():
+%  op_iget(width=64)
+
+
+// iget-object vA, vB, field@CCCC
+// Format 22c: B|A|54 CCCC
+%def op_iget_object():
+   srliw s8, xINST, 8
+   srliw s7, xINST, 12     // s7 := B
+   andi s8, s8, 0xF        // s8 := A
+
+   // Fast path: NterpGetInstanceFieldOffset's byte offset from thread-local cache.
+   FETCH_FROM_THREAD_CACHE /*field_offset*/a0, .L${opcode}_slow, t1, t2
+.L${opcode}_slow_resume:
+
+%  get_vreg("t0", "s7", is_unsigned=True)  # t0 := holder
+   beqz t0, .L${opcode}_null
+   add t0, a0, t0          // t0 := field addr
+   lwu a0, (t0)            // a0 := object
+   UNPOISON_HEAP_REF a0
+   TEST_IF_MARKING t1, .L${opcode}_mark
+.L${opcode}_mark_resume:
+
+   FETCH_ADVANCE_INST 2
+   SET_VREG_OBJECT a0, s8, z0=t0
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_mark:
+   call art_quick_read_barrier_mark_reg10  // a0, object
+   j .L${opcode}_mark_resume
+
+.L${opcode}_slow:
+%  slow_path = add_slow_path(op_iget_object_slow_path, "s7", "s8", "t0", "t1")
+   tail $slow_path
+
+.L${opcode}_null:
+   tail common_errNullObject
+
+
+%def op_iget_object_slow_path(holder, dst, z0, z1):
+   mv a0, xSELF
+   ld a1, (sp)  // a1 := caller ArtMethod*
+   mv a2, xPC
+   mv a3, zero
+   EXPORT_PC
+   call nterp_get_instance_field_offset  // result a0 := field_offset
+
+   // Test for volatile (negative value).
+   bltz a0, .L${opcode}_volatile
+   tail .L${opcode}_slow_resume  // resume offset exceeds branch imm
+
+.L${opcode}_volatile:
+%  get_vreg(z0, holder, is_unsigned=True)  # z0 := holder
+   beqz $z0, .L${opcode}_volatile_null
+   sub $z0, $z0, a0           // z0 := field addr (holder - (-offset))
+   // Atomic load: "fence rw,rw ; LOAD ; fence r,rw"
+   fence rw, rw
+   lwu a0, ($z0)              // a0 := object
+   fence r, rw
+   UNPOISON_HEAP_REF a0
+   TEST_IF_MARKING t1, .L${opcode}_volatile_mark
+.L${opcode}_volatile_mark_resume:
+
+   FETCH_ADVANCE_INST 2
+   SET_VREG_OBJECT a0, $dst, z0=$z0
+   GET_INST_OPCODE $z0
+   GOTO_OPCODE $z0
+
+.L${opcode}_volatile_mark:
+   call art_quick_read_barrier_mark_reg10  // a0, object
+   j .L${opcode}_volatile_mark_resume
+
+.L${opcode}_volatile_null:
+   tail common_errNullObject
+
+
+// iget-boolean vA, vB, field@CCCC
+// Format 22c: B|A|55 CCCC
+%def op_iget_boolean():
+%  op_iget(width=8, zext=True)
+
+
+// iget-byte vA, vB, field@CCCC
+// Format 22c: B|A|56 CCCC
+%def op_iget_byte():
+%  op_iget(width=8)
+
+
+// iget-char vA, vB, field@CCCC
+// Format 22c: B|A|57 CCCC
+%def op_iget_char():
+%  op_iget(width=16, zext=True)
+
+
+// iget-short vA, vB, field@CCCC
+// Format 22c: B|A|58 CCCC
+%def op_iget_short():
+%  op_iget(width=16)
+
+
+// *** iput ***
+
+// iput vA, vB, field@CCCC
+// Format 22c: B|A|59 CCCC
+// vB.field := vA
+%def op_iput(width=32):
+   srliw s8, xINST, 8
+   srliw s7, xINST, 12     // s7 := B
+   andi s8, s8, 0xF        // s8 := A
+%  get_vreg("s8", "s8", width=width)
+                           // s8 := value, held across slow path call
+
+   // Fast path: NterpGetInstanceFieldOffset's byte offset from thread-local cache.
+   FETCH_FROM_THREAD_CACHE /*resolved_field*/a0, .L${opcode}_slow, t0, t1
+.L${opcode}_slow_resume:
+
+%  get_vreg("t0", "s7", is_unsigned=True)  # t0 := holder
+   beqz t0, .L${opcode}_null
+   add t0, a0, t0          // t0 := field addr
+   FETCH_ADVANCE_INST 2
+%  store(src="s8", dst="t0", width=width)
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_slow:
+   mv a0, xSELF
+   ld a1, (sp)  // a1 := caller ArtMethod*
+   mv a2, xPC
+   mv a3, zero
+   EXPORT_PC
+   call nterp_get_instance_field_offset  // result a0 := field_offset
+
+   // Test for volatile (negative value).
+   bgez a0, .L${opcode}_slow_resume
+%  volatile_path = add_slow_path(op_iput_volatile, width, "s7", "s8", "t0", "t1")
+   tail $volatile_path
+
+.L${opcode}_null:
+   tail common_errNullObject
+
+
+%def op_iput_volatile(width, holder, value, z0, z1):
+%  get_vreg(z0, holder, is_unsigned=True)  # z0 := holder
+   beqz $z0, .L${opcode}_volatile_null
+   sub $z0, $z0, a0              // z0 := field addr (holder - (-offset))
+   // Ensure the volatile store is released.
+%  if width == 8:
+     fence rw, w
+     sb $value, ($z0)
+     fence rw, rw
+%  elif width == 16:
+     fence rw, w
+     sh $value, ($z0)
+     fence rw, rw
+%  elif width == 32:
+     amoswap.w.rl zero, $value, ($z0)
+%  elif width == 64:
+     amoswap.d.rl zero, $value, ($z0)
+%  else:
+%    assert False, width
+%#:
+
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE $z0
+   GOTO_OPCODE $z0
+
+.L${opcode}_volatile_null:
+   tail common_errNullObject
+
+
+// iput-wide vA, vB, field@CCCC
+// Format 22c: B|A|5a CCCC
+%def op_iput_wide():
+%  op_iput(width=64)
+
+
+// iput-object vA, vB, field@CCCC
+// Format 22c: B|A|5b CCCC
+%def op_iput_object():
+   srliw s8, xINST, 8
+   srliw s7, xINST, 12     // s7 := B
+   andi s8, s8, 0xF        // s8 := A
+%  get_vreg("s9", "s8", is_unsigned=True)  # s9 := reference
+
+   // Fast path: NterpGetInstanceFieldOffset's byte offset from thread-local cache.
+   FETCH_FROM_THREAD_CACHE /*resolved_field*/a0, .L${opcode}_slow, t0, t1
+.L${opcode}_slow_resume:   // s9 := reference (slow path only)
+
+%  get_vreg("t0", "s7", is_unsigned=True)  # t0 := holder
+   beqz t0, .L${opcode}_null
+   add t1, a0, t0          // t1 := field addr
+   POISON_HEAP_REF s9      // Poisoning maps null to null for the null check in write barrier.
+   sw s9, (t1)
+%  object_write_barrier(value="s9", holder="t0", z0="t1", z1="t2", uniq=f"{opcode}")
+
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_slow:
+%  slow_path = add_slow_path(op_iput_object_slow_path, "s7", "s8", "s9", "t0", "t1", "t2")
+   tail $slow_path
+
+.L${opcode}_null:
+   tail common_errNullObject
+
+
+%def op_iput_object_slow_path(holder, src, value, z0, z1, z2):
+   mv a0, xSELF
+   ld a1, (sp)  // a1 := caller ArtMethod*
+   mv a2, xPC
+   mv a3, $value
+   EXPORT_PC
+   call nterp_get_instance_field_offset  // result a0 := field_offset
+
+   // Reload value, object may have moved.
+%  get_vreg(value, src, is_unsigned=True)  # value := fp[A] zext
+
+   // Test for volatile (negative value).
+   bltz a0, .L${opcode}_volatile
+   tail .L${opcode}_slow_resume  // resume offset exceeds branch imm
+
+.L${opcode}_volatile:
+%  get_vreg(z0, holder, is_unsigned=True)  # z0 := holder
+   beqz $z0, .L${opcode}_volatile_null
+   sub $z1, $z0, a0              // z1 := field addr (holder - (-offset))
+   // Ensure the volatile store is released.
+   POISON_HEAP_REF $value  // Poisoning maps null to null for the null check in write barrier.
+   amoswap.w.rl zero, $value, ($z1)
+%  object_write_barrier(value=value, holder=z0, z0=z1, z1=z2, uniq=f"slow_{opcode}")
+
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE $z0
+   GOTO_OPCODE $z0
+
+.L${opcode}_volatile_null:
+   tail common_errNullObject
+
+
+// iput-boolean vA, vB, field@CCCC
+// Format 22c: B|A|5c CCCC
+%def op_iput_boolean():
+%  op_iput(width=8)
+
+
+// iput-byte vA, vB, field@CCCC
+// Format 22c: B|A|5d CCCC
+%def op_iput_byte():
+%  op_iput(width=8)
+
+
+// iput-char vA, vB, field@CCCC
+// Format 22c: B|A|5e CCCC
+%def op_iput_char():
+%  op_iput(width=16)
+
+
+// iput-short vA, vB, field@CCCC
+// Format 22c: B|A|5f CCCC
+%def op_iput_short():
+%  op_iput(width=16)
+
+
+// *** sget ***
+
+.macro CLEAR_STATIC_VOLATILE_MARKER reg
+    andi \reg, \reg, ~0x1
+.endm
+
+// sget vAA, field@BBBB
+// Format 21c: AA|60 BBBB
+// vAA := klass.field
+%def op_sget(width=32, zext=False):
+   srliw s7, xINST, 8  // s7 := AA (live through volatile path)
+   // Fast path: NterpGetStaticField's resolved_field from thread-local cache.
+   // Stores cache value in a0 to match slow path's return from NterpGetStaticField.
+   FETCH_FROM_THREAD_CACHE /*resolved_field*/a0, .L${opcode}_slow, t0, t1
+.L${opcode}_slow_resume:
+
+   lwu t0, ART_FIELD_OFFSET_OFFSET(a0)           // t0 := field offset
+   lwu a0, ART_FIELD_DECLARING_CLASS_OFFSET(a0)  // a0 := holder
+   TEST_IF_MARKING t2, .L${opcode}_mark
+.L${opcode}_mark_resume:
+
+   add t0, t0, a0      // t0 := field addr, after possible a0 update
+%  load(dst="t1", src="t0", width=width, zext=zext)
+                       // t1 := value
+   FETCH_ADVANCE_INST 2
+%  set_vreg("t1", "s7", z0="t0", width=width)
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_mark:
+   call art_quick_read_barrier_mark_reg10  // a0, holder
+   j .L${opcode}_mark_resume
+
+.L${opcode}_slow:
+   mv a0, xSELF
+   ld a1, (sp)  // a1 := caller ArtMethod*
+   mv a2, xPC
+   mv a3, zero
+   EXPORT_PC
+   call nterp_get_static_field  // result a0 := resolved_field
+
+   // Test for volatile bit
+   slli t0, a0, 63
+   bgez t0, .L${opcode}_slow_resume
+%  volatile_path = add_slow_path(op_sget_volatile, width, zext, "s7", "t0", "t1")
+   tail $volatile_path
+
+
+// Volatile static load.
+// Temporaries: z0, z1, z2
+%def op_sget_volatile(width, zext, dst_vreg, z0, z1):
+   CLEAR_STATIC_VOLATILE_MARKER a0
+   lwu $z0, ART_FIELD_OFFSET_OFFSET(a0)          // z0 := field offset
+   lwu a0, ART_FIELD_DECLARING_CLASS_OFFSET(a0)  // a0 := holder
+   TEST_IF_MARKING $z1, .L${opcode}_volatile_mark
+.L${opcode}_volatile_mark_resume:
+
+   add $z0, $z0, a0  // z0 := field addr, after possible a0 update
+   // Atomic load: "fence rw,rw ; LOAD ; fence r,rw"
+   fence rw, rw
+%  load(dst=z1, src=z0, width=width, zext=zext)
+   fence r, rw
+       // z1 := value
+   FETCH_ADVANCE_INST 2
+%  set_vreg(z1, dst_vreg, z0=z0, width=width)
+   GET_INST_OPCODE $z0
+   GOTO_OPCODE $z0
+
+.L${opcode}_volatile_mark:
+   call art_quick_read_barrier_mark_reg10  // a0, holder
+   j .L${opcode}_volatile_mark_resume
+
+
+// sget-wide vAA, field@BBBB
+// Format 21c: AA|61 BBBB
+%def op_sget_wide():
+%  op_sget(width=64)
+
+
+// sget-object vAA, field@BBBB
+// Format 21c: AA|62 BBBB
+// Variant for object load contains extra logic for GC mark.
+%def op_sget_object():
+   srliw s7, xINST, 8  // s7 := AA (live through volatile path)
+   // Fast path: NterpGetStaticField's resolved_field from thread-local cache.
+   // Stores cache value in a0 to match slow path's return from NterpGetStaticField.
+   FETCH_FROM_THREAD_CACHE /*resolved_field*/a0, .L${opcode}_slow, t0, t1
+.L${opcode}_slow_resume:
+
+   lwu t0, ART_FIELD_OFFSET_OFFSET(a0)           // t0 := field offset
+   lwu a0, ART_FIELD_DECLARING_CLASS_OFFSET(a0)  // a0 := holder
+   TEST_IF_MARKING t1, .L${opcode}_mark
+
+   add t0, t0, a0      // t0 := field addr
+   lwu a0, (t0)        // a0 := value (ref)
+   UNPOISON_HEAP_REF a0
+
+.L${opcode}_mark_resume:
+   FETCH_ADVANCE_INST 2
+   SET_VREG_OBJECT a0, s7, z0=t0
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_mark:
+   call art_quick_read_barrier_mark_reg10  // a0, holder
+   add t0, t0, a0      // t0 := field addr, after a0 update
+   lwu a0, (t0)        // a0 := value (ref)
+   UNPOISON_HEAP_REF a0
+   call art_quick_read_barrier_mark_reg10  // a0, object
+   j .L${opcode}_mark_resume
+
+.L${opcode}_slow:
+%  slow_path = add_slow_path(op_sget_object_slow_path, "s7", "t0", "t1")
+   tail $slow_path
+
+
+// Static load, object variant. Contains both slow path and volatile path
+// due to handler size limitation in op_sget_object.
+// Hardcoded: a0, a1, a2, a3, xSELF, xPC, xINST, xFP, xREFS
+// Temporaries: z0, z1
+%def op_sget_object_slow_path(dst_vreg, z0, z1):
+   mv a0, xSELF
+   ld a1, (sp)  // a1 := caller ArtMethod*
+   mv a2, xPC
+   mv a3, zero
+   EXPORT_PC
+   call nterp_get_static_field  // result a0 := resolved_field
+
+   // Test for volatile bit
+   slli $z0, a0, 63
+   bltz $z0, .L${opcode}_volatile
+   tail .L${opcode}_slow_resume  // resume offset exceeds branch imm
+
+.L${opcode}_volatile:
+   CLEAR_STATIC_VOLATILE_MARKER a0
+   lwu $z0, ART_FIELD_OFFSET_OFFSET(a0)          // z0 := field offset
+   lwu a0, ART_FIELD_DECLARING_CLASS_OFFSET(a0)  // a0 := holder
+   TEST_IF_MARKING $z1, .L${opcode}_volatile_mark
+
+   add $z0, $z0, a0  // z0 := field addr
+   fence rw, rw
+   lwu a0, ($z0)  // Atomic ref load: "fence rw,rw, ; LOAD ; fence r,rw"
+   fence r, rw
+   UNPOISON_HEAP_REF a0
+
+.L${opcode}_volatile_mark_resume:
+   FETCH_ADVANCE_INST 2
+   SET_VREG_OBJECT a0, $dst_vreg, z0=$z0
+   GET_INST_OPCODE $z0
+   GOTO_OPCODE $z0
+
+.L${opcode}_volatile_mark:
+   call art_quick_read_barrier_mark_reg10  // a0, holder
+   add $z0, $z0, a0  // z0 := field addr, after a0 update
+   fence rw, rw
+   lwu a0, ($z0)  // Atomic ref load: "fence rw,rw, ; LOAD ; fence r,rw"
+   fence r, rw
+   UNPOISON_HEAP_REF a0
+   call art_quick_read_barrier_mark_reg10  // a0, object
+   j .L${opcode}_volatile_mark_resume
+
+
+// sget-boolean vAA, field@BBBB
+// Format 21c: AA|63 BBBB
+%def op_sget_boolean():
+%  op_sget(width=8, zext=True)
+
+
+// sget-byte vAA, field@BBBB
+// Format 21c: AA|64 BBBB
+%def op_sget_byte():
+%  op_sget(width=8)
+
+
+// sget-char vAA, field@BBBB
+// Format 21c: AA|65 BBBB
+%def op_sget_char():
+%  op_sget(width=16, zext=True)
+
+
+// sget-short vAA, field@BBBB
+// Format 21c: AA|66 BBBB
+%def op_sget_short():
+%  op_sget(width=16)
+
+
+// *** sput ***
+
+// sput vAA, field@BBBB
+// Format 21c: AA|67 BBBB
+// klass.field := vAA
+%def op_sput(width=32):
+   srliw t2, xINST, 8  // t2 := AA
+%  get_vreg("s7", "t2", width=width)
+                       // s7 := value, held across slow path call
+
+   // Fast path: NterpGetStaticField's resolved_field from thread-local cache.
+   // Stores cache value in a0 to match slow path's return from NterpGetStaticField.
+   FETCH_FROM_THREAD_CACHE /*resolved_field*/a0, .L${opcode}_slow, t0, t1
+.L${opcode}_slow_resume:
+
+   lwu t0, ART_FIELD_OFFSET_OFFSET(a0)
+   lwu a0, ART_FIELD_DECLARING_CLASS_OFFSET(a0)  // a0 := holder
+   TEST_IF_MARKING t1, .L${opcode}_mark
+.L${opcode}_mark_resume:
+
+   add t0, t0, a0  // t0 := field addr, after possible a0 update
+   FETCH_ADVANCE_INST 2
+%  store(src="s7", dst="t0", width=width)
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_mark:
+   call art_quick_read_barrier_mark_reg10  // a0, holder
+   j .L${opcode}_mark_resume
+
+.L${opcode}_slow:
+   mv a0, xSELF
+   ld a1, (sp)
+   mv a2, xPC
+   mv a3, zero
+   EXPORT_PC
+   call nterp_get_static_field  // result a0 := resolved_field
+
+   // Test for volatile bit
+   slli t0, a0, 63
+   bgez t0, .L${opcode}_slow_resume
+%  volatile_path = add_slow_path(op_sput_volatile, width, "s7", "t0", "t1")
+   tail $volatile_path
+
+
+// Volatile static store.
+// Temporaries: z0, z1
+%def op_sput_volatile(width, value, z0, z1):
+   CLEAR_STATIC_VOLATILE_MARKER a0
+   lwu $z0, ART_FIELD_OFFSET_OFFSET(a0)          // z0 := field offset
+   lwu a0, ART_FIELD_DECLARING_CLASS_OFFSET(a0)  // a0 := holder
+   TEST_IF_MARKING $z1, .L${opcode}_volatile_mark
+.L${opcode}_volatile_mark_resume:
+
+   add $z0, $z0, a0                              // z0 := field addr, after possible a0 update
+   // Ensure the volatile store is released.
+%  if width == 8:
+     fence rw, w
+     sb $value, ($z0)
+     fence rw, rw
+%  elif width == 16:
+     fence rw, w
+     sh $value, ($z0)
+     fence rw, rw
+%  elif width == 32:
+     amoswap.w.rl zero, $value, ($z0)
+%  elif width == 64:
+     amoswap.d.rl zero, $value, ($z0)
+%  else:
+%    assert False, width
+%#:
+
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE $z0
+   GOTO_OPCODE $z0
+
+.L${opcode}_volatile_mark:
+   call art_quick_read_barrier_mark_reg10  // a0, holder
+   j .L${opcode}_volatile_mark_resume
+
+
+// sput-wide vAA, field@BBBB
+// Format 21c: AA|68 BBBB
+%def op_sput_wide():
+%  op_sput(width=64)
+
+
+// sput-object vAA, field@BBBB
+// Format 21c: AA|69 BBBB
+%def op_sput_object():
+   srliw s7, xINST, 8      // s7 := AA (live through slow path)
+%  get_vreg("s8", "s7", is_unsigned=True)  # s8 := reference, replaced in slow path
+
+   // Fast path: NterpGetStaticField's resolved_field from thread-local cache.
+   // Stores cache value in a0 to match slow path's return from NterpGetStaticField.
+   FETCH_FROM_THREAD_CACHE /*resolved_field*/a0, .L${opcode}_slow, t0, t1
+.L${opcode}_slow_resume:   // s8 := reference (slow path only)
+
+   lwu t0, ART_FIELD_OFFSET_OFFSET(a0)
+   lwu a0, ART_FIELD_DECLARING_CLASS_OFFSET(a0)  // a0 := holder
+   TEST_IF_MARKING t1, .L${opcode}_mark
+.L${opcode}_mark_resume:
+
+   add t0, t0, a0          // t0 := field addr, after possible a0 update
+   POISON_HEAP_REF s8      // Poisoning maps null to null for the null check in write barrier.
+   sw s8, (t0)             // store reference
+%  object_write_barrier(value="s8", holder="a0", z0="t0", z1="t1", uniq=f"{opcode}")
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_mark:
+   call art_quick_read_barrier_mark_reg10  // a0, holder
+   j .L${opcode}_mark_resume
+
+.L${opcode}_slow:
+%  slow_path = add_slow_path(op_sput_object_slow_path, "s7", "s8", "t0", "t1")
+   tail $slow_path  // slow path offset exceeds regular branch imm in FETCH_FROM_THREAD_CACHE
+
+
+// Static store, object variant. Contains both slow path and volatile path
+// due to handler size limitation in op_sput_object.
+// Hardcoded: a0, a1, a2, a3, xSELF, xPC, xINST, xFP, xREFS
+// Temporaries z0, z1
+%def op_sput_object_slow_path(src_vreg, value, z0, z1):
+   // Args for nterp_get_static_field
+   mv a0, xSELF
+   ld a1, (sp)
+   mv a2, xPC
+   mv a3, $value
+   EXPORT_PC
+   call nterp_get_static_field  // result a0 := resolved_field
+
+   // Reload value, it may have moved.
+%  get_vreg(value, src_vreg, is_unsigned=True)  # value := fp[AA], zext
+
+   // Test for volatile bit
+   slli $z0, a0, 63
+   bltz $z0, .L${opcode}_volatile
+   tail .L${opcode}_slow_resume  // resume offset exceeds branch imm
+
+.L${opcode}_volatile:
+   CLEAR_STATIC_VOLATILE_MARKER a0
+   lwu $z0, ART_FIELD_OFFSET_OFFSET(a0)          // z0 := field offset
+   lwu a0, ART_FIELD_DECLARING_CLASS_OFFSET(a0)  // a0 := holder
+   TEST_IF_MARKING $z1, .L${opcode}_volatile_mark
+.L${opcode}_volatile_mark_resume:
+
+   add $z0, $z0, a0  // z0 := field addr, after possible a0 update
+   // Ensure the volatile store is released.
+   // \value must NOT be the destination register, the destination gets clobbered!
+   // \value's original value is used in the write barrier below.
+   POISON_HEAP_REF $value  // Poisoning maps null to null for the null check in write barrier.
+   amoswap.w.rl zero, $value, ($z0)
+%  object_write_barrier(value=value, holder="a0", z0=z0, z1=z1, uniq=f"slow_{opcode}")
+
+   FETCH_ADVANCE_INST 2
+   GET_INST_OPCODE $z0
+   GOTO_OPCODE $z0
+
+.L${opcode}_volatile_mark:
+   call art_quick_read_barrier_mark_reg10  // a0, holder
+   j .L${opcode}_volatile_mark_resume
+
+
+%def object_write_barrier(value, holder, z0, z1, uniq):
+   beqz $value, .L${uniq}_skip_write_barrier  // No object, skip out.
+   ld $z0, THREAD_CARD_TABLE_OFFSET(xSELF)
+   srli $z1, $holder, CARD_TABLE_CARD_SHIFT
+   add $z1, $z0, $z1
+   sb $z0, ($z1)
+.L${uniq}_skip_write_barrier:
+
+
+// sput-object vAA, field@BBBB
+// Format 21c: AA|6a BBBB
+%def op_sput_boolean():
+%  op_sput(width=8)
+
+
+// sput-object vAA, field@BBBB
+// Format 21c: AA|6b BBBB
+%def op_sput_byte():
+%  op_sput(width=8)
+
+
+// sput-object vAA, field@BBBB
+// Format 21c: AA|6c BBBB
+%def op_sput_char():
+%  op_sput(width=16)
+
+
+// sput-object vAA, field@BBBB
+// Format 21c: AA|6d BBBB
+%def op_sput_short():
+%  op_sput(width=16)
+
diff --git a/runtime/interpreter/mterp/riscv64/other.S b/runtime/interpreter/mterp/riscv64/other.S
index 0e7ba95..15f1d9d 100644
--- a/runtime/interpreter/mterp/riscv64/other.S
+++ b/runtime/interpreter/mterp/riscv64/other.S
@@ -1,67 +1,340 @@
 %def unused():
-    ebreak
-%def op_const():
-    unimp
+   ebreak
 
-%def op_const_16():
-    unimp
-%def op_const_4():
-    unimp
-%def op_const_high16():
-    unimp
-%def op_const_object(jumbo="0", helper="nterp_load_object"):
-    unimp
-%def op_const_class():
-    unimp
-%def op_const_method_handle():
-    unimp
-%def op_const_method_type():
-    unimp
-%def op_const_string():
-    unimp
-%def op_const_string_jumbo():
-    unimp
-%def op_const_wide():
-    unimp
-%def op_const_wide_16():
-    unimp
-%def op_const_wide_32():
-    unimp
-%def op_const_wide_high16():
-    unimp
-%def op_monitor_enter():
-    unimp
-%def op_monitor_exit():
-    unimp
-%def op_move(is_object="0"):
-    unimp
-%def op_move_16(is_object="0"):
-    unimp
-%def op_move_exception():
-    unimp
-%def op_move_from16(is_object="0"):
-    unimp
-%def op_move_object():
-    unimp
-%def op_move_object_16():
-    unimp
-%def op_move_object_from16():
-    unimp
-%def op_move_result(is_object="0"):
-    unimp
-%def op_move_result_object():
-    unimp
-%def op_move_result_wide():
-    unimp
-%def op_move_wide():
-    unimp
-%def op_move_wide_16():
-    unimp
-%def op_move_wide_from16():
-    unimp
-
+// nop
+// Format 10x: 00|00
 %def op_nop():
-    unimp
+   FETCH_ADVANCE_INST 1  // advance xPC, load xINST
+   GET_INST_OPCODE t0    // t0 holds next opcode
+   GOTO_OPCODE t0        // continue to next
+
+// move vA, vB
+// Format 12x: B|A|01
+%def op_move(is_object=False, is_wide=False):
+   srliw t1, xINST, 12   // t1 := B
+   srliw t2, xINST, 8    // t2 := B|A
+%  if is_object:
+     // Note: leaves a useful breadcrumb if the reference is corrupted, unlike GET_VREG_OBJECT.
+%    get_vreg("t1", "t1", is_unsigned=True)  # t1 = fp[B], zext
+%  else:
+%    get_vreg("t1", "t1", is_wide=is_wide)  # t1 := fp[B]
+%#:
+   and t2, t2, 0xF       // t2 := A
+   FETCH_ADVANCE_INST 1  // advance xPC, load xINST
+   GET_INST_OPCODE t3    // t3 holds next opcode
+%  if is_object:
+     SET_VREG_OBJECT t1, t2, z0=t0  // refs[A] := fp[B]
+%  else:
+%    set_vreg("t1", "t2", z0="t0", is_wide=is_wide)  # fp[A] := fp[B]
+%#:
+   GOTO_OPCODE t3       // continue to next
+
+// move/from16 vAA, vBBBB
+// Format 22x: AA|16 BBBB
+%def op_move_from16(is_object=False, is_wide=False):
+   FETCH t1, count=1     // t1 := BBBB
+   srliw t2, xINST, 8    // t2 := AA
+%  if is_object:
+     // Note: leaves a useful breadcrumb if the reference is corrupted, unlike GET_VREG_OBJECT.
+%    get_vreg("t1", "t1", is_unsigned=True)  # t1 = fp[BBBB], zext
+%  else:
+%    get_vreg("t1", "t1", is_wide=is_wide)  # t1 := fp[BBBB]
+%#:
+   FETCH_ADVANCE_INST 2  // advance xPC, load xINST
+   GET_INST_OPCODE t3    // t3 := next opcode
+%  if is_object:
+     SET_VREG_OBJECT t1, t2, z0=t0  // refs[AA] := fp[BBBB]
+%  else:
+%    set_vreg("t1", "t2", z0="t0", is_wide=is_wide)  # fp[AA] := fp[BBBB]
+%#:
+   GOTO_OPCODE t3        // continue to next
+
+// move/16 vAAAA, vBBBB
+// Format 32x: 00|03 AAAA BBBB
+%def op_move_16(is_object=False, is_wide=False):
+   FETCH t1, count=2     // t1 := BBBB
+   FETCH t2, count=1     // t2 := AAAA
+%  if is_object:
+     // Note: leaves a useful breadcrumb if the reference is corrupted, unlike GET_VREG_OBJECT.
+%    get_vreg("t1", "t1", is_unsigned=True)  # t1 = fp[BBBB], zext
+%  else:
+%    get_vreg("t1", "t1", is_wide=is_wide)  # t1 := fp[BBBB]
+%#:
+   FETCH_ADVANCE_INST 3  // advance xPC, load xINST
+   GET_INST_OPCODE t3    // t3 := next opcode
+%  if is_object:
+     SET_VREG_OBJECT t1, t2, z0=t0  // refs[AAAA] := fp[BBBB]
+%  else:
+%    set_vreg("t1", "t2", z0="t0", is_wide=is_wide)  # fp[AAAA] := fp[BBBB]
+%#:
+   GOTO_OPCODE t3        // continue to next
+
+// move-wide vA, vB
+// Format 12x: B|A|04
+// NOTE: vregs can overlap, e.g. "move-wide v6,v7" or "move-wide v7,v6"
+%def op_move_wide():
+%  op_move(is_wide=True)
+
+// move-wide/from16 vAA, vBBBB
+// Format 22x: AA|05 BBBB
+// NOTE: vregs can overlap, e.g. "move-wide v6,v7" or "move-wide v7,v6"
+%def op_move_wide_from16():
+%  op_move_from16(is_wide=True)
+
+// move-wide/16, vAAAA, vBBBB
+// Format 32x: 00|06 AAAA BBBB
+// NOTE: vregs can overlap, e.g. "move-wide v6,v7" or "move-wide v7,v6"
+%def op_move_wide_16():
+%  op_move_16(is_wide=True)
+
+// move-object vA, vB
+// Format 12x: B|A|07
+%def op_move_object():
+%  op_move(is_object=True)
+
+// move-object/from16 vAA, vBBBB
+// Format 22x: AA|08 BBBB
+%def op_move_object_from16():
+%  op_move_from16(is_object=True)
+
+// move-object/16 vAAAA, vBBBB
+// Format 32x: 00|09 AAAA BBBB
+%def op_move_object_16():
+%  op_move_16(is_object=True)
+
+// move-result vAA
+// Format 11x: AA|0a
+%def op_move_result(is_object=False, is_wide=False):
+   srliw t1, xINST, 8    // t1 := AA
+   FETCH_ADVANCE_INST 1  // advance xPC, load xINST
+   GET_INST_OPCODE t2    // t2 := next opcode
+%  if is_object:
+     SET_VREG_OBJECT a0, t1, z0=t0  // refs[AA] := a0
+%  else:
+%    set_vreg("a0", "t1", z0="t0", is_wide=is_wide)  # fp[AA] := a0
+%#:
+   GOTO_OPCODE t2        // continue to next
+
+// move-result-wide vAA
+// Format 11x: AA|0b
+%def op_move_result_wide():
+%  op_move_result(is_wide=True)
+
+// move-result-object vAA
+// Format 11x: AA|0c
+%def op_move_result_object():
+%  op_move_result(is_object=True)
+
+// move-exception vAA
+// Format 11x: AA|0d
+%def op_move_exception():
+   ld t1, THREAD_EXCEPTION_OFFSET(xSELF)    // t1 := exception object
+   srliw t2, xINST, 8                       // t2 := AA
+   FETCH_ADVANCE_INST 1                     // advance xPC, load xINST
+   SET_VREG_OBJECT t1, t2, z0=t0            // refs[AA] := exception object
+   GET_INST_OPCODE t3                       // t3 := next opcode
+   sd zero, THREAD_EXCEPTION_OFFSET(xSELF)  // clear exception
+   GOTO_OPCODE t3                           // continue to next
+
+// const/4 vA, #+B
+// Format 11n: B|A|12
+// Clobbers: t0, t1, t2, t3
+%def op_const_4():
+   slliw t1, xINST, 16     // B as MSB of word
+   sraiw t1, t1, 28        // t1 := sssssssB
+   slliw t2, xINST, 20     // A as MSB of word
+   srliw t2, t2, 28        // t2 := A
+   FETCH_ADVANCE_INST 1    // advance xPC, load xINST
+   GET_INST_OPCODE t3      // t3 holds next opcode
+%  set_vreg("t1", "t2", z0="t0")  # fp[A] := sssssssB
+   GOTO_OPCODE t3          // continue to next
+
+// const/16 vAA, #+BBBB
+// Format 21s: AA|13 BBBB
+// Clobbers: t0, t1, t2, t3
+%def op_const_16(is_wide=False):
+   FETCH t1, count=1, signed=1
+                         // t1 := ssssssssssssBBBB
+   srliw t2, xINST, 8    // t2 := AA
+   FETCH_ADVANCE_INST 2  // advance xPC, load xINST
+   GET_INST_OPCODE t3    // t3 := next opcode
+%  set_vreg("t1", "t2", z0="t0", is_wide=is_wide)
+                         // fp[AA] := +BBBB
+   GOTO_OPCODE t3        // continue to next
+
+// const vAA, #+BBBBBBBB
+// Format 31i: AA|14 BBBB(lo) BBBB(hi)
+// Clobbers: t0, t1, t2, t3
+%def op_const(is_wide=False):
+   FETCH t1, count=1, signed=1, width=32
+                         // t1 := ssssssssBBBBBBBB
+   srliw t2, xINST, 8    // t2 := AA
+   FETCH_ADVANCE_INST 3  // advance xPC, load xINST
+   GET_INST_OPCODE t3    // t3 := next opcode
+%  set_vreg("t1", "t2", z0="t0", is_wide=is_wide)
+                         // fp[AA] := +BBBBBBBB
+   GOTO_OPCODE t3        // continue to next
+
+// const/high16 vAA, #+BBBB0000
+// Format 21h: AA|15 BBBB
+// Clobbers: t0, t1, t2, t3
+%def op_const_high16():
+   FETCH t1, count=1       // t1 := BBBB
+   srliw t2, xINST, 8      // t2 := AA
+   slliw t1, t1, 16        // t1 := BBBB0000
+   FETCH_ADVANCE_INST 2    // advance xPC, load xINST
+   GET_INST_OPCODE t3      // t3 := next opcode
+%  set_vreg("t1", "t2", z0="t0")  # fp[AA] := BBBB0000
+   GOTO_OPCODE t3          // continue to next
+
+// const-wide/16 vAA, #+BBBB
+// Format 21s: AA|16 BBBB
+%def op_const_wide_16():
+%   op_const_16(is_wide=True)
+
+// const-wide/32 vAA, #+BBBBBBBB
+// Format 31i: AA|17 BBBB(lo) BBBB(hi)
+%def op_const_wide_32():
+%   op_const(is_wide=True)
+
+// const-wide vAA, #+BBBBBBBBBBBBBBBB
+// Format 51l: AA|18 BBBB(lo) BBBB BBBB BBBB(hi)
+%def op_const_wide():
+   FETCH t1, count=1, width=64
+                         // t1 := BBBBBBBBBBBBBBBB
+   srliw t2, xINST, 8    // t2 := AA
+   FETCH_ADVANCE_INST 5  // advance xPC, load xINST
+   GET_INST_OPCODE t3    // t3 := next opcode
+   SET_VREG_WIDE t1, t2, z0=t0
+                         // fp[AA] := BBBBBBBBBBBBBBBB
+   GOTO_OPCODE t3        // continue to next
+
+// const-wide/high16 vAA, #+BBBB000000000000
+// Format 21h: AA|19 BBBB
+%def op_const_wide_high16():
+   FETCH t1, count=1     // t1 := BBBB
+   srliw t2, xINST, 8    // t2 := AA
+   slli t1, t1, 48       // t1 := BBBB000000000000
+   FETCH_ADVANCE_INST 2  // advance xPC, load xINST
+   GET_INST_OPCODE t3    // t3 := next opcode
+   SET_VREG_WIDE t1, t2, z0=t0
+                         // fp[AA] := BBBB000000000000
+   GOTO_OPCODE t3        // continue to next
+
+
+// const-string vAA, string@BBBB
+// Format 21c: AA|1a BBBB
+%def op_const_string(jumbo=False):
+   // Fast path: string from thread-local cache.
+   FETCH_FROM_THREAD_CACHE /*object*/a0, .L${opcode}_slow, t0, t1
+   TEST_IF_MARKING t2, .L${opcode}_mark
+
+.L${opcode}_resume:
+   srliw t0, xINST, 8  // t0 := AA
+%  code_units = "3" if jumbo else "2"
+   FETCH_ADVANCE_INST $code_units
+   SET_VREG_OBJECT a0, t0, z0=t1
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_mark:
+   call art_quick_read_barrier_mark_reg10  // a0, string
+   j .L${opcode}_resume
+.L${opcode}_slow:
+   EXPORT_PC
+   mv a0, xSELF
+   ld a1, (sp)  // caller ArtMethod*
+   mv a2, xPC
+   call nterp_load_object  // return a0 := string
+   j .L${opcode}_resume
+
+
+// const-string/jumbo vAA, string@BBBBBBBB
+// Format 31c: AA|1b BBBB(lo) BBBB(hi)
+%def op_const_string_jumbo():
+%  op_const_string(jumbo=True)
+
+// const-class vAA, type@BBBB
+// Format 21c: AA|1c BBBB
+%def op_const_class():
+   // Fast path: klass reference from thread-local cache.
+   FETCH_FROM_THREAD_CACHE /*object*/a0, .L${opcode}_slow, t0, t1
+   TEST_IF_MARKING t2, .L${opcode}_mark
+
+.L${opcode}_resume:
+   srliw t0, xINST, 8  // t0 := AA
+   FETCH_ADVANCE_INST 2
+   SET_VREG_OBJECT a0, t0, z0=t1
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+.L${opcode}_mark:
+   call art_quick_read_barrier_mark_reg10  // a0, klass
+   j .L${opcode}_resume
+.L${opcode}_slow:
+   EXPORT_PC
+   mv a0, xSELF
+   ld a1, (sp)  // caller ArtMethod*
+   mv a2, xPC
+   call nterp_get_class  // return a0 := klass
+   j .L${opcode}_resume
+
+
+// const-method-handle vAA, method_handle@BBBB
+// Format 21c: AA|fe BBBB
+%def op_const_method_handle():
+   // Method handle and method type are not cached, just call helper directly.
+   EXPORT_PC
+   mv a0, xSELF
+   ld a1, (sp)  // caller ArtMethod*
+   mv a2, xPC
+   call nterp_load_object  // return a0 := method handle or method type
+   srliw t0, xINST, 8  // t0 := AA
+   FETCH_ADVANCE_INST 2
+   SET_VREG_OBJECT a0, t0, z0=t1
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+
+// const-method-type vAA, proto@BBBB
+// Format 21c: AA|ff BBBB
+%def op_const_method_type():
+%  op_const_method_handle()
+
+
+// monitor-enter vAA
+// Format 11x: AA|1d
+// Acquire the monitor for the indicated object.
+%def op_monitor_enter():
+   EXPORT_PC
+   srliw t0, xINST, 8  // t0 := AA
+   GET_VREG_OBJECT a0, t0
+   call art_quick_lock_object  // arg a0
+   FETCH_ADVANCE_INST 1
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
+
+// monitor-exit vAA
+// Format 11x: AA|1e
+// Release the monitor for the indicated object.
+// Note: If this instruction needs to throw an exception, it must do so as if the pc has
+//       already advanced past the instruction. It may be useful to think of this as the instruction
+//       successfully executing (in a sense), and the exception getting thrown after the instruction
+//       but before the next one gets a chance to run. This definition makes it possible for a
+//       method to use a monitor cleanup catch-all (e.g., finally) block as the monitor cleanup for
+//       that block itself, as a way to handle the arbitrary exceptions that might get thrown due to
+//       the historical implementation of Thread.stop(), while still managing to have proper monitor
+//       hygiene.
+%def op_monitor_exit():
+   EXPORT_PC
+   srliw t0, xINST, 8  // t0 := AA
+   GET_VREG_OBJECT a0, t0
+   call art_quick_unlock_object  // arg a0
+   FETCH_ADVANCE_INST 1
+   GET_INST_OPCODE t0
+   GOTO_OPCODE t0
+
 
 %def op_unused_3e():
 %  unused()
diff --git a/runtime/interpreter/mterp/x86_64ng/array.S b/runtime/interpreter/mterp/x86_64ng/array.S
index c8dd8b0..7aa34c7 100644
--- a/runtime/interpreter/mterp/x86_64ng/array.S
+++ b/runtime/interpreter/mterp/x86_64ng/array.S
@@ -22,10 +22,12 @@
     testb $$READ_BARRIER_TEST_VALUE, GRAY_BYTE_OFFSET(%edi)
     $load   $data_offset(%rdi,%rsi,$shift), %eax
     jnz 2f
+    UNPOISON_HEAP_REF eax  // Affects flags, so we cannot unpoison before the jnz.
 1:
     SET_VREG_OBJECT %eax, rINSTq
     ADVANCE_PC_FETCH_AND_GOTO_NEXT 2
 2:
+    UNPOISON_HEAP_REF eax
     // reg00 is eax
     call art_quick_read_barrier_mark_reg00
     jmp 1b
diff --git a/runtime/interpreter/mterp/x86_64ng/invoke.S b/runtime/interpreter/mterp/x86_64ng/invoke.S
index 731a2bc..f8f09af 100644
--- a/runtime/interpreter/mterp/x86_64ng/invoke.S
+++ b/runtime/interpreter/mterp/x86_64ng/invoke.S
@@ -84,6 +84,7 @@
    .endif
    movl (rFP, %r11, 4), %esi
    movl MIRROR_OBJECT_CLASS_OFFSET(%esi), %edx
+   UNPOISON_HEAP_REF edx
    // Test the first two bits of the fetched ArtMethod:
    // - If the first bit is set, this is a method on j.l.Object
    // - If the second bit is set, this is a default method.
@@ -158,6 +159,7 @@
    movl (rFP, %r11, 4), %esi
    // Note: if esi is null, this will be handled by our SIGSEGV handler.
    movl MIRROR_OBJECT_CLASS_OFFSET(%esi), %edx
+   UNPOISON_HEAP_REF edx
    movq MIRROR_CLASS_VTABLE_OFFSET_64(%edx, %edi, 8), %rdi
    jmp $helper
 2:
diff --git a/runtime/interpreter/mterp/x86_64ng/main.S b/runtime/interpreter/mterp/x86_64ng/main.S
index 9ad7efa..f346cb8 100644
--- a/runtime/interpreter/mterp/x86_64ng/main.S
+++ b/runtime/interpreter/mterp/x86_64ng/main.S
@@ -202,18 +202,12 @@
     movsd \_xmmreg, VREG_ADDRESS(\_vreg)
 .endm
 
-// An assembly entry that has a OatQuickMethodHeader prefix.
-.macro OAT_ENTRY name, end
+// An assembly entry for nterp.
+.macro OAT_ENTRY name
     FUNCTION_TYPE(\name)
     ASM_HIDDEN SYMBOL(\name)
     .global SYMBOL(\name)
     .balign 16
-    // Padding of 3 * 4 bytes to get 16 bytes alignment of code entry.
-    .long 0
-    .long 0
-    .long 0
-    // OatQuickMethodHeader. Note that the top two bits must be clear.
-    .long (SYMBOL(\end) - SYMBOL(\name))
 SYMBOL(\name):
 .endm
 
@@ -1696,22 +1690,25 @@
  *  rest  method parameters
  */
 
-OAT_ENTRY ExecuteNterpWithClinitImpl, EndExecuteNterpWithClinitImpl
+OAT_ENTRY ExecuteNterpWithClinitImpl
+    .cfi_startproc
     // For simplicity, we don't do a read barrier here, but instead rely
     // on art_quick_resolution_trampoline to always have a suspend point before
     // calling back here.
     movl ART_METHOD_DECLARING_CLASS_OFFSET(%rdi), %r10d
-    cmpb  $$(MIRROR_CLASS_IS_VISIBLY_INITIALIZED_VALUE), MIRROR_CLASS_IS_VISIBLY_INITIALIZED_OFFSET(%r10d)
+    cmpl $$(MIRROR_CLASS_STATUS_VISIBLY_INITIALIZED_SHIFTED), MIRROR_CLASS_STATUS_OFFSET(%r10d)
     jae ExecuteNterpImpl
-    cmpb  $$(MIRROR_CLASS_IS_INITIALIZING_VALUE), MIRROR_CLASS_IS_VISIBLY_INITIALIZED_OFFSET(%r10d)
+    cmpl $$(MIRROR_CLASS_STATUS_INITIALIZING_SHIFTED), MIRROR_CLASS_STATUS_OFFSET(%r10d)
     jb art_quick_resolution_trampoline
     movl MIRROR_CLASS_CLINIT_THREAD_ID_OFFSET(%r10d), %r10d
     cmpl %r10d, rSELF:THREAD_TID_OFFSET
     je ExecuteNterpImpl
     jmp art_quick_resolution_trampoline
-EndExecuteNterpWithClinitImpl:
+    .cfi_endproc
+    .global SYMBOL(EndExecuteNterpWithClinitImpl)
+SYMBOL(EndExecuteNterpWithClinitImpl):
 
-OAT_ENTRY ExecuteNterpImpl, EndExecuteNterpImpl
+OAT_ENTRY ExecuteNterpImpl
     .cfi_startproc
     .cfi_def_cfa rsp, 8
     testq %rax, -STACK_OVERFLOW_RESERVED_BYTES(%rsp)
@@ -1985,6 +1982,7 @@
    GET_VREG rINST, rINSTq                  # vB (object we're operating on)
    testl   rINST, rINST                    # is object null?
    je      common_errNullObject
+   POISON_HEAP_REF ecx
    movl %ecx, (rINSTq,%rax,1)
    testl %ecx, %ecx
    je 4f
@@ -2008,6 +2006,7 @@
    testl   rINST, rINST                    # is object null?
    je      common_errNullObject
    negl %eax
+   POISON_HEAP_REF ecx
    movl %ecx, (rINSTq,%rax,1)
    testl %ecx, %ecx
    je 5f
@@ -2030,6 +2029,7 @@
    testb $$READ_BARRIER_TEST_VALUE, GRAY_BYTE_OFFSET(%ecx)
    movl (%rcx,%rax,1), %eax
    jnz 3f
+   UNPOISON_HEAP_REF eax  // Affects flags, so we cannot unpoison before the jnz.
 4:
    andb    $$0xf,rINSTbl                   # rINST <- A
    SET_VREG_OBJECT %eax, rINSTq            # fp[A] <- value
@@ -2048,6 +2048,7 @@
    negl %eax
    jmp 1b
 3:
+   UNPOISON_HEAP_REF eax
    // reg00 is eax
    call art_quick_read_barrier_mark_reg00
    jmp 4b
@@ -2062,6 +2063,7 @@
    cmpq $$0, rSELF:THREAD_READ_BARRIER_MARK_REG00_OFFSET
    jne 3f
 5:
+   POISON_HEAP_REF ebp
    movl %ebp, (%eax, %edx, 1)
    testl %ebp, %ebp
    je 4f
@@ -2087,6 +2089,7 @@
    cmpq $$0, rSELF:THREAD_READ_BARRIER_MARK_REG00_OFFSET
    jne 7f
 6:
+   POISON_HEAP_REF ebp
    movl %ebp, (%eax, %edx, 1)
    testl %ebp, %ebp
    je 8f
@@ -2115,6 +2118,7 @@
    testb $$READ_BARRIER_TEST_VALUE, GRAY_BYTE_OFFSET(%eax)
    movl (%eax, %edx, 1), %eax
    jnz 3f
+   UNPOISON_HEAP_REF eax  // Affects flags, so we cannot unpoison before the jnz.
 4:
    SET_VREG_OBJECT %eax, rINSTq            # fp[A] <- value
    ADVANCE_PC_FETCH_AND_GOTO_NEXT 2
@@ -2128,6 +2132,7 @@
    andq $$-2, %rax
    jmp 1b
 3:
+   UNPOISON_HEAP_REF eax
    call art_quick_read_barrier_mark_reg00
    jmp 4b
 5:
diff --git a/runtime/interpreter/mterp/x86_64ng/object.S b/runtime/interpreter/mterp/x86_64ng/object.S
index 21a6e67..9edf4ec 100644
--- a/runtime/interpreter/mterp/x86_64ng/object.S
+++ b/runtime/interpreter/mterp/x86_64ng/object.S
@@ -7,6 +7,7 @@
    testl %edi, %edi
    je .L${opcode}_resume
    // Fast path without read barriers.
+   POISON_HEAP_REF esi  // Poison class reference for in-memory comparison.
    cmpl MIRROR_OBJECT_CLASS_OFFSET(%edi), %esi
    jne ${slow_path}
 .L${opcode}_resume:
@@ -21,13 +22,16 @@
    jmp 1b
 
 %def op_check_cast_slow_path():
+   UNPOISON_HEAP_REF esi  // Unpoison class reference poisoned in main path.
    testl $$MIRROR_CLASS_IS_INTERFACE_FLAG, MIRROR_CLASS_ACCESS_FLAGS_OFFSET(%rsi)
    jne 2f
    movl MIRROR_OBJECT_CLASS_OFFSET(%edi), %eax
+   UNPOISON_HEAP_REF eax
    cmpl $$0, MIRROR_CLASS_COMPONENT_TYPE_OFFSET(%rsi)
    jne 2f
 1:
    movl MIRROR_CLASS_SUPER_CLASS_OFFSET(%eax), %eax
+   UNPOISON_HEAP_REF eax
    cmpl %eax, %esi
    je .L${opcode}_resume
    testl %eax, %eax
@@ -45,10 +49,12 @@
    jmp 3b
 5:
    movl MIRROR_CLASS_COMPONENT_TYPE_OFFSET(%eax), %eax
+   UNPOISON_HEAP_REF eax
    // Check if object is an array.
    testl %eax, %eax
    je 2b
    movl MIRROR_CLASS_COMPONENT_TYPE_OFFSET(%esi), %ecx
+   UNPOISON_HEAP_REF ecx
    cmpl $$0, MIRROR_CLASS_SUPER_CLASS_OFFSET(%ecx)
    jne 2b
    cmpw $$0, MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET(%ecx)
@@ -90,6 +96,7 @@
    testl %edi, %edi
    je .L${opcode}_set_vreg
    // Fast path without read barriers.
+   POISON_HEAP_REF esi  // Poison class reference for in-memory comparison.
    cmpl MIRROR_OBJECT_CLASS_OFFSET(%edi), %esi
    jne ${slow_path}
 .L${opcode}_set_one:
@@ -100,6 +107,7 @@
    ADVANCE_PC_FETCH_AND_GOTO_NEXT 2
 
 %def op_instance_of_slow_path():
+   UNPOISON_HEAP_REF esi  // Unpoison class reference poisoned in main path.
    // Go slow path if we are marking. Checking now allows
    // not going to slow path if the super class hierarchy check fails.
    cmpq $$0, rSELF:THREAD_READ_BARRIER_MARK_REG00_OFFSET
@@ -107,10 +115,12 @@
    testl $$MIRROR_CLASS_IS_INTERFACE_FLAG, MIRROR_CLASS_ACCESS_FLAGS_OFFSET(%rsi)
    jne 5f
    movl MIRROR_OBJECT_CLASS_OFFSET(%edi), %eax
+   UNPOISON_HEAP_REF eax
    cmpl $$0, MIRROR_CLASS_COMPONENT_TYPE_OFFSET(%rsi)
    jne 3f
 1:
    movl MIRROR_CLASS_SUPER_CLASS_OFFSET(%eax), %eax
+   UNPOISON_HEAP_REF eax
    cmpl %eax, %esi
    je .L${opcode}_set_one
    testl %eax, %eax
@@ -120,10 +130,12 @@
    jmp       .L${opcode}_resume
 3:
    movl MIRROR_CLASS_COMPONENT_TYPE_OFFSET(%eax), %eax
+   UNPOISON_HEAP_REF eax
    // Check if object is an array.
    testl %eax, %eax
    je 2b
    movl MIRROR_CLASS_COMPONENT_TYPE_OFFSET(%esi), %ecx
+   UNPOISON_HEAP_REF ecx
    cmpl $$0, MIRROR_CLASS_SUPER_CLASS_OFFSET(%ecx)
    jne 5f
    cmpw $$0, MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET(%ecx)
diff --git a/runtime/interpreter/mterp/x86ng/array.S b/runtime/interpreter/mterp/x86ng/array.S
index fced2e8..8a00769 100644
--- a/runtime/interpreter/mterp/x86ng/array.S
+++ b/runtime/interpreter/mterp/x86ng/array.S
@@ -22,10 +22,12 @@
     testb $$READ_BARRIER_TEST_VALUE, GRAY_BYTE_OFFSET(%eax)
     $load   $data_offset(%eax,%ecx,$multiplier), %eax
     jnz 2f
+    UNPOISON_HEAP_REF eax  // Affects flags, so we cannot unpoison before the jnz.
 1:
     SET_VREG_OBJECT %eax, rINST
     ADVANCE_PC_FETCH_AND_GOTO_NEXT 2
 2:
+    UNPOISON_HEAP_REF eax
     // reg00 is eax
     call art_quick_read_barrier_mark_reg00
     jmp 1b
diff --git a/runtime/interpreter/mterp/x86ng/invoke.S b/runtime/interpreter/mterp/x86ng/invoke.S
index f45ff80..91a9077 100644
--- a/runtime/interpreter/mterp/x86ng/invoke.S
+++ b/runtime/interpreter/mterp/x86ng/invoke.S
@@ -86,6 +86,7 @@
    .endif
    movl (rFP, %ecx, 4), %ecx
    movl MIRROR_OBJECT_CLASS_OFFSET(%ecx), %edx
+   UNPOISON_HEAP_REF edx
    // Test the first two bits of the fetched ArtMethod:
    // - If the first bit is set, this is a method on j.l.Object
    // - If the second bit is set, this is a default method.
@@ -163,6 +164,7 @@
    movl (rFP, %ecx, 4), %ecx
    // Note: if ecx is null, this will be handled by our SIGSEGV handler.
    movl MIRROR_OBJECT_CLASS_OFFSET(%ecx), %edx
+   UNPOISON_HEAP_REF edx
    movl MIRROR_CLASS_VTABLE_OFFSET_32(%edx, %eax, 4), %eax
    jmp $helper
 2:
diff --git a/runtime/interpreter/mterp/x86ng/main.S b/runtime/interpreter/mterp/x86ng/main.S
index 5b0edd4..b64040f 100644
--- a/runtime/interpreter/mterp/x86ng/main.S
+++ b/runtime/interpreter/mterp/x86ng/main.S
@@ -204,6 +204,15 @@
     addl MACRO_LITERAL(SYMBOL(artNterpAsmInstructionStart) - 0b), rIBASE
 .endm
 
+.macro RESTORE_IBASE_WITH_CFA
+    call 0f
+0:
+    CFI_ADJUST_CFA_OFFSET(4)
+    popl rIBASE
+    CFI_ADJUST_CFA_OFFSET(-4)
+    addl MACRO_LITERAL(SYMBOL(artNterpAsmInstructionStart) - 0b), rIBASE
+.endm
+
 .macro SPILL_ALL_CORE_PARAMETERS
     PUSH_ARG eax
     PUSH_ARG ecx
@@ -230,18 +239,12 @@
     movl LOCAL2(%esp), \reg
 .endm
 
-// An assembly entry that has a OatQuickMethodHeader prefix.
-.macro OAT_ENTRY name, end
+// An assembly entry for nterp.
+.macro OAT_ENTRY name
     FUNCTION_TYPE(\name)
     ASM_HIDDEN SYMBOL(\name)
     .global SYMBOL(\name)
     .balign 16
-    // Padding of 3 * 4 bytes to get 16 bytes alignment of code entry.
-    .long 0
-    .long 0
-    .long 0
-    // OatQuickMethodHeader. Note that the top two bits must be clear.
-    .long (SYMBOL(\end) - SYMBOL(\name))
 SYMBOL(\name):
 .endm
 
@@ -270,9 +273,8 @@
   PUSH_ARG ecx
   PUSH_ARG eax
   call \helper
-  addl MACRO_LITERAL(16), %esp
-  CFI_ADJUST_CFA_OFFSET(-16)
-  RESTORE_IBASE
+  DECREASE_FRAME 16
+  RESTORE_IBASE_WITH_CFA
   FETCH_INST_CLEAR_OPCODE
   RESTORE_SAVE_REFS_ONLY_FRAME
   cmpl LITERAL(0), %fs:THREAD_EXCEPTION_OFFSET
@@ -1759,28 +1761,33 @@
  *  rest  method parameters
  */
 
-OAT_ENTRY ExecuteNterpWithClinitImpl, EndExecuteNterpWithClinitImpl
-    push %esi
+OAT_ENTRY ExecuteNterpWithClinitImpl
+    .cfi_startproc
+    PUSH_ARG esi
     // For simplicity, we don't do a read barrier here, but instead rely
     // on art_quick_resolution_trampoline to always have a suspend point before
     // calling back here.
     movl ART_METHOD_DECLARING_CLASS_OFFSET(%eax), %esi
-    cmpb $$(MIRROR_CLASS_IS_VISIBLY_INITIALIZED_VALUE), MIRROR_CLASS_IS_VISIBLY_INITIALIZED_OFFSET(%esi)
+    cmpl $$(MIRROR_CLASS_STATUS_VISIBLY_INITIALIZED_SHIFTED), MIRROR_CLASS_STATUS_OFFSET(%esi)
     jae .Lcontinue_execute_nterp
-    cmpb  $$(MIRROR_CLASS_IS_INITIALIZING_VALUE), MIRROR_CLASS_IS_VISIBLY_INITIALIZED_OFFSET(%esi)
+    cmpl $$(MIRROR_CLASS_STATUS_INITIALIZING_SHIFTED), MIRROR_CLASS_STATUS_OFFSET(%esi)
     jb .Linvoke_trampoline
     movl MIRROR_CLASS_CLINIT_THREAD_ID_OFFSET(%esi), %esi
     cmpl %esi, rSELF:THREAD_TID_OFFSET
+    CFI_REMEMBER_STATE
     je .Lcontinue_execute_nterp
 .Linvoke_trampoline:
-    pop %esi
+    POP_ARG esi
     jmp art_quick_resolution_trampoline
 .Lcontinue_execute_nterp:
-    pop %esi
+    CFI_RESTORE_STATE_AND_DEF_CFA esp, 8
+    POP_ARG esi
     jmp ExecuteNterpImpl
-EndExecuteNterpWithClinitImpl:
+    .cfi_endproc
+    .global SYMBOL(EndExecuteNterpWithClinitImpl)
+SYMBOL(EndExecuteNterpWithClinitImpl):
 
-OAT_ENTRY ExecuteNterpImpl, EndExecuteNterpImpl
+OAT_ENTRY ExecuteNterpImpl
     .cfi_startproc
     .cfi_def_cfa esp, 4
     testl %eax, -STACK_OVERFLOW_RESERVED_BYTES(%esp)
@@ -2049,6 +2056,7 @@
    GET_VREG rINST, rINST                   # vB (object we're operating on)
    testl   rINST, rINST                    # is object null?
    je      common_errNullObject
+   POISON_HEAP_REF ecx
    movl %ecx, (rINST, %eax, 1)
    testl %ecx, %ecx
    je 4f
@@ -2078,6 +2086,7 @@
    GET_VREG rINST, rINST                   # vB (object we're operating on)
    testl   rINST, rINST                    # is object null?
    je      common_errNullObject
+   POISON_HEAP_REF ecx
    movl %ecx, (rINST, %eax, 1)
    testl %ecx, %ecx
    je 5f
@@ -2100,6 +2109,7 @@
    testb $$READ_BARRIER_TEST_VALUE, GRAY_BYTE_OFFSET(%ecx)
    movl (%ecx,%eax,1), %eax
    jnz 3f
+   UNPOISON_HEAP_REF eax  // Affects flags, so we cannot unpoison before the jnz.
 4:
    andb    $$0xf,rINSTbl                   # rINST <- A
    SET_VREG_OBJECT %eax, rINST             # fp[A] <- value
@@ -2118,6 +2128,7 @@
    negl %eax
    jmp 1b
 3:
+   UNPOISON_HEAP_REF eax
    // reg00 is eax
    call art_quick_read_barrier_mark_reg00
    jmp 4b
@@ -2132,6 +2143,7 @@
    cmpl $$0, rSELF:THREAD_READ_BARRIER_MARK_REG00_OFFSET
    jne 3f
 5:
+   POISON_HEAP_REF ebx  // `rINST` is `%ebx` but we need to pass `ebx`.
    movl rINST, (%eax, %ecx, 1)
    testl rINST, rINST
    je 4f
@@ -2157,6 +2169,7 @@
    cmpl $$0, rSELF:THREAD_READ_BARRIER_MARK_REG00_OFFSET
    jne 7f
 6:
+   POISON_HEAP_REF ebx  // `rINST` is `%ebx` but we need to pass `ebx`.
    movl rINST, (%eax, %ecx, 1)
    testl rINST, rINST
    je 8f
@@ -2185,6 +2198,7 @@
    testb $$READ_BARRIER_TEST_VALUE, GRAY_BYTE_OFFSET(%eax)
    movl (%eax, %ecx, 1), %eax
    jnz 3f
+   UNPOISON_HEAP_REF eax  // Affects flags, so we cannot unpoison before the jnz.
 4:
    SET_VREG_OBJECT %eax, rINST             # fp[A] <- value
    ADVANCE_PC_FETCH_AND_GOTO_NEXT 2
@@ -2198,6 +2212,7 @@
    CLEAR_VOLATILE_MARKER %eax
    jmp 1b
 3:
+   UNPOISON_HEAP_REF eax
    call art_quick_read_barrier_mark_reg00
    jmp 4b
 5:
diff --git a/runtime/interpreter/mterp/x86ng/object.S b/runtime/interpreter/mterp/x86ng/object.S
index 39091ce..b56084e 100644
--- a/runtime/interpreter/mterp/x86ng/object.S
+++ b/runtime/interpreter/mterp/x86ng/object.S
@@ -7,6 +7,7 @@
    testl %eax, %eax
    je .L${opcode}_resume
    // Fast path without read barriers.
+   POISON_HEAP_REF ecx  // Poison class reference for in-memory comparison.
    cmpl MIRROR_OBJECT_CLASS_OFFSET(%eax), %ecx
    jne ${slow_path}
 .L${opcode}_resume:
@@ -21,6 +22,7 @@
    jmp 1b
 
 %def op_check_cast_slow_path():
+   UNPOISON_HEAP_REF ecx  // Unpoison class reference poisoned in main path.
    cmpl $$0, rSELF:THREAD_READ_BARRIER_MARK_REG00_OFFSET
    jne 2f
 1:
@@ -45,6 +47,7 @@
    testl %eax, %eax
    je .L${opcode}_resume
    // Fast path without read barriers.
+   POISON_HEAP_REF ecx  // Poison class reference for in-memory comparison.
    cmpl MIRROR_OBJECT_CLASS_OFFSET(%eax), %ecx
    jne ${slow_path}
 .L${opcode}_set_one:
@@ -63,6 +66,7 @@
    jmp 1b
 
 %def op_instance_of_slow_path():
+   UNPOISON_HEAP_REF ecx  // Unpoison class reference poisoned in main path.
    cmpl $$0, rSELF:THREAD_READ_BARRIER_MARK_REG00_OFFSET
    jne 2f
    testl $$MIRROR_CLASS_IS_INTERFACE_FLAG, MIRROR_CLASS_ACCESS_FLAGS_OFFSET(%ecx)
@@ -70,8 +74,10 @@
    cmpl $$0, MIRROR_CLASS_COMPONENT_TYPE_OFFSET(%ecx)
    jne 3f
    movl MIRROR_OBJECT_CLASS_OFFSET(%eax), %eax
+   UNPOISON_HEAP_REF eax
 1:
    movl MIRROR_CLASS_SUPER_CLASS_OFFSET(%eax), %eax
+   UNPOISON_HEAP_REF eax
    cmpl %eax, %ecx
    je .L${opcode}_set_one
    testl %eax, %eax
diff --git a/runtime/interpreter/safe_math.h b/runtime/interpreter/safe_math.h
index 25a9353..9b6265f 100644
--- a/runtime/interpreter/safe_math.h
+++ b/runtime/interpreter/safe_math.h
@@ -20,7 +20,9 @@
 #include <functional>
 #include <type_traits>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 namespace interpreter {
 
 // Declares a type which is the larger in bit size of the two template parameters.
diff --git a/runtime/interpreter/safe_math_test.cc b/runtime/interpreter/safe_math_test.cc
index 28087a3..c88ac4e 100644
--- a/runtime/interpreter/safe_math_test.cc
+++ b/runtime/interpreter/safe_math_test.cc
@@ -20,7 +20,7 @@
 
 #include "gtest/gtest.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace interpreter {
 
 TEST(SafeMath, Add) {
diff --git a/runtime/interpreter/shadow_frame-inl.h b/runtime/interpreter/shadow_frame-inl.h
index 799b2d2..a05d60f 100644
--- a/runtime/interpreter/shadow_frame-inl.h
+++ b/runtime/interpreter/shadow_frame-inl.h
@@ -21,7 +21,7 @@
 
 #include "obj_ptr-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template<VerifyObjectFlags kVerifyFlags /*= kDefaultVerifyFlags*/>
 inline void ShadowFrame::SetVRegReference(size_t i, ObjPtr<mirror::Object> val)
diff --git a/runtime/interpreter/shadow_frame.cc b/runtime/interpreter/shadow_frame.cc
index 264ec6a..5ed4224 100644
--- a/runtime/interpreter/shadow_frame.cc
+++ b/runtime/interpreter/shadow_frame.cc
@@ -18,7 +18,7 @@
 
 #include "art_method-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 mirror::Object* ShadowFrame::GetThisObject() const {
   ArtMethod* m = GetMethod();
diff --git a/runtime/interpreter/shadow_frame.h b/runtime/interpreter/shadow_frame.h
index 7ca2423..54c40b2 100644
--- a/runtime/interpreter/shadow_frame.h
+++ b/runtime/interpreter/shadow_frame.h
@@ -28,7 +28,7 @@
 #include "stack_reference.h"
 #include "verify_object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Object;
diff --git a/runtime/interpreter/unstarted_runtime.cc b/runtime/interpreter/unstarted_runtime.cc
index 32ed430..3b5bee80 100644
--- a/runtime/interpreter/unstarted_runtime.cc
+++ b/runtime/interpreter/unstarted_runtime.cc
@@ -16,24 +16,26 @@
 
 #include "unstarted_runtime.h"
 
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
 #include <ctype.h>
 #include <errno.h>
 #include <stdlib.h>
 
+#include <atomic>
 #include <cmath>
 #include <initializer_list>
 #include <limits>
 #include <locale>
 
-#include <android-base/logging.h>
-#include <android-base/stringprintf.h>
-
 #include "art_method-inl.h"
 #include "base/casts.h"
 #include "base/enums.h"
 #include "base/hash_map.h"
 #include "base/macros.h"
+#include "base/os.h"
 #include "base/quasi_atomic.h"
+#include "base/unix_file/fd_file.h"
 #include "base/zip_archive.h"
 #include "class_linker.h"
 #include "common_throws.h"
@@ -64,7 +66,7 @@
 #include "unstarted_runtime_list.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace interpreter {
 
 using android::base::StringAppendV;
@@ -574,17 +576,17 @@
     return;
   }
 
-  const std::vector<int>& boot_class_path_fds = Runtime::Current()->GetBootClassPathFds();
-  DCHECK(boot_class_path_fds.empty() || boot_class_path_fds.size() == boot_class_path.size());
+  ArrayRef<File> boot_class_path_files = Runtime::Current()->GetBootClassPathFiles();
+  DCHECK(boot_class_path_files.empty() || boot_class_path_files.size() == boot_class_path.size());
 
   MemMap mem_map;
   size_t map_size;
   std::string last_error_msg;  // Only store the last message (we could concatenate).
 
-  bool has_bcp_fds = !boot_class_path_fds.empty();
+  bool has_bcp_fds = !boot_class_path_files.empty();
   for (size_t i = 0; i < boot_class_path.size(); ++i) {
     const std::string& jar_file = boot_class_path[i];
-    const int jar_fd = has_bcp_fds ? boot_class_path_fds[i] : -1;
+    const int jar_fd = has_bcp_fds ? boot_class_path_files[i].Fd() : -1;
     mem_map = FindAndExtractEntry(jar_file, jar_fd, resource_cstr, &map_size, &last_error_msg);
     if (mem_map.IsValid()) {
       break;
@@ -813,8 +815,10 @@
   }
 }
 
-void UnstartedRuntime::UnstartedSystemArraycopy(
-    Thread* self, ShadowFrame* shadow_frame, JValue* result ATTRIBUTE_UNUSED, size_t arg_offset) {
+void UnstartedRuntime::UnstartedSystemArraycopy(Thread* self,
+                                                ShadowFrame* shadow_frame,
+                                                [[maybe_unused]] JValue* result,
+                                                size_t arg_offset) {
   // Special case array copying without initializing System.
   jint src_pos = shadow_frame->GetVReg(arg_offset + 1);
   jint dst_pos = shadow_frame->GetVReg(arg_offset + 3);
@@ -930,9 +934,10 @@
   UnstartedRuntime::UnstartedSystemArraycopy(self, shadow_frame, result, arg_offset);
 }
 
-void UnstartedRuntime::UnstartedSystemGetSecurityManager(
-    Thread* self ATTRIBUTE_UNUSED, ShadowFrame* shadow_frame ATTRIBUTE_UNUSED,
-    JValue* result, size_t arg_offset ATTRIBUTE_UNUSED) {
+void UnstartedRuntime::UnstartedSystemGetSecurityManager([[maybe_unused]] Thread* self,
+                                                         [[maybe_unused]] ShadowFrame* shadow_frame,
+                                                         JValue* result,
+                                                         [[maybe_unused]] size_t arg_offset) {
   result->SetL(nullptr);
 }
 
@@ -1089,8 +1094,10 @@
   return nullptr;
 }
 
-void UnstartedRuntime::UnstartedThreadLocalGet(
-    Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset ATTRIBUTE_UNUSED) {
+void UnstartedRuntime::UnstartedThreadLocalGet(Thread* self,
+                                               ShadowFrame* shadow_frame,
+                                               JValue* result,
+                                               [[maybe_unused]] size_t arg_offset) {
   if (CheckCallers(shadow_frame, { "jdk.internal.math.FloatingDecimal$BinaryToASCIIBuffer "
                                        "jdk.internal.math.FloatingDecimal.getBinaryToASCIIBuffer()" })) {
     result->SetL(CreateInstanceOf(self, "Ljdk/internal/math/FloatingDecimal$BinaryToASCIIBuffer;"));
@@ -1101,8 +1108,10 @@
   }
 }
 
-void UnstartedRuntime::UnstartedThreadCurrentThread(
-    Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset ATTRIBUTE_UNUSED) {
+void UnstartedRuntime::UnstartedThreadCurrentThread(Thread* self,
+                                                    ShadowFrame* shadow_frame,
+                                                    JValue* result,
+                                                    [[maybe_unused]] size_t arg_offset) {
   if (CheckCallers(shadow_frame,
                    { "void java.lang.Thread.<init>(java.lang.ThreadGroup, java.lang.Runnable, "
                          "java.lang.String, long, java.security.AccessControlContext, boolean)",
@@ -1131,8 +1140,10 @@
   }
 }
 
-void UnstartedRuntime::UnstartedThreadGetNativeState(
-    Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset ATTRIBUTE_UNUSED) {
+void UnstartedRuntime::UnstartedThreadGetNativeState(Thread* self,
+                                                     ShadowFrame* shadow_frame,
+                                                     JValue* result,
+                                                     [[maybe_unused]] size_t arg_offset) {
   if (CheckCallers(shadow_frame,
                    { "java.lang.Thread$State java.lang.Thread.getState()",
                      "java.lang.ThreadGroup java.lang.Thread.getThreadGroup()",
@@ -1154,45 +1165,61 @@
   }
 }
 
-void UnstartedRuntime::UnstartedMathCeil(
-    Thread* self ATTRIBUTE_UNUSED, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
+void UnstartedRuntime::UnstartedMathCeil([[maybe_unused]] Thread* self,
+                                         ShadowFrame* shadow_frame,
+                                         JValue* result,
+                                         size_t arg_offset) {
   result->SetD(ceil(shadow_frame->GetVRegDouble(arg_offset)));
 }
 
-void UnstartedRuntime::UnstartedMathFloor(
-    Thread* self ATTRIBUTE_UNUSED, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
+void UnstartedRuntime::UnstartedMathFloor([[maybe_unused]] Thread* self,
+                                          ShadowFrame* shadow_frame,
+                                          JValue* result,
+                                          size_t arg_offset) {
   result->SetD(floor(shadow_frame->GetVRegDouble(arg_offset)));
 }
 
-void UnstartedRuntime::UnstartedMathSin(
-    Thread* self ATTRIBUTE_UNUSED, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
+void UnstartedRuntime::UnstartedMathSin([[maybe_unused]] Thread* self,
+                                        ShadowFrame* shadow_frame,
+                                        JValue* result,
+                                        size_t arg_offset) {
   result->SetD(sin(shadow_frame->GetVRegDouble(arg_offset)));
 }
 
-void UnstartedRuntime::UnstartedMathCos(
-    Thread* self ATTRIBUTE_UNUSED, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
+void UnstartedRuntime::UnstartedMathCos([[maybe_unused]] Thread* self,
+                                        ShadowFrame* shadow_frame,
+                                        JValue* result,
+                                        size_t arg_offset) {
   result->SetD(cos(shadow_frame->GetVRegDouble(arg_offset)));
 }
 
-void UnstartedRuntime::UnstartedMathPow(
-    Thread* self ATTRIBUTE_UNUSED, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
+void UnstartedRuntime::UnstartedMathPow([[maybe_unused]] Thread* self,
+                                        ShadowFrame* shadow_frame,
+                                        JValue* result,
+                                        size_t arg_offset) {
   result->SetD(pow(shadow_frame->GetVRegDouble(arg_offset),
                    shadow_frame->GetVRegDouble(arg_offset + 2)));
 }
 
-void UnstartedRuntime::UnstartedMathTan(
-    Thread* self ATTRIBUTE_UNUSED, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
+void UnstartedRuntime::UnstartedMathTan([[maybe_unused]] Thread* self,
+                                        ShadowFrame* shadow_frame,
+                                        JValue* result,
+                                        size_t arg_offset) {
   result->SetD(tan(shadow_frame->GetVRegDouble(arg_offset)));
 }
 
-void UnstartedRuntime::UnstartedObjectHashCode(
-    Thread* self ATTRIBUTE_UNUSED, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
+void UnstartedRuntime::UnstartedObjectHashCode([[maybe_unused]] Thread* self,
+                                               ShadowFrame* shadow_frame,
+                                               JValue* result,
+                                               size_t arg_offset) {
   mirror::Object* obj = shadow_frame->GetVRegReference(arg_offset);
   result->SetI(obj->IdentityHashCode());
 }
 
-void UnstartedRuntime::UnstartedDoubleDoubleToRawLongBits(
-    Thread* self ATTRIBUTE_UNUSED, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
+void UnstartedRuntime::UnstartedDoubleDoubleToRawLongBits([[maybe_unused]] Thread* self,
+                                                          ShadowFrame* shadow_frame,
+                                                          JValue* result,
+                                                          size_t arg_offset) {
   double in = shadow_frame->GetVRegDouble(arg_offset);
   result->SetJ(bit_cast<int64_t, double>(in));
 }
@@ -1240,23 +1267,31 @@
   UNREACHABLE();
 }
 
-void UnstartedRuntime::UnstartedMemoryPeekByte(
-    Thread* self ATTRIBUTE_UNUSED, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
+void UnstartedRuntime::UnstartedMemoryPeekByte([[maybe_unused]] Thread* self,
+                                               ShadowFrame* shadow_frame,
+                                               JValue* result,
+                                               size_t arg_offset) {
   UnstartedMemoryPeek(Primitive::kPrimByte, shadow_frame, result, arg_offset);
 }
 
-void UnstartedRuntime::UnstartedMemoryPeekShort(
-    Thread* self ATTRIBUTE_UNUSED, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
+void UnstartedRuntime::UnstartedMemoryPeekShort([[maybe_unused]] Thread* self,
+                                                ShadowFrame* shadow_frame,
+                                                JValue* result,
+                                                size_t arg_offset) {
   UnstartedMemoryPeek(Primitive::kPrimShort, shadow_frame, result, arg_offset);
 }
 
-void UnstartedRuntime::UnstartedMemoryPeekInt(
-    Thread* self ATTRIBUTE_UNUSED, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
+void UnstartedRuntime::UnstartedMemoryPeekInt([[maybe_unused]] Thread* self,
+                                              ShadowFrame* shadow_frame,
+                                              JValue* result,
+                                              size_t arg_offset) {
   UnstartedMemoryPeek(Primitive::kPrimInt, shadow_frame, result, arg_offset);
 }
 
-void UnstartedRuntime::UnstartedMemoryPeekLong(
-    Thread* self ATTRIBUTE_UNUSED, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
+void UnstartedRuntime::UnstartedMemoryPeekLong([[maybe_unused]] Thread* self,
+                                               ShadowFrame* shadow_frame,
+                                               JValue* result,
+                                               size_t arg_offset) {
   UnstartedMemoryPeek(Primitive::kPrimLong, shadow_frame, result, arg_offset);
 }
 
@@ -1309,14 +1344,18 @@
   UNREACHABLE();
 }
 
-void UnstartedRuntime::UnstartedMemoryPeekByteArray(
-    Thread* self, ShadowFrame* shadow_frame, JValue* result ATTRIBUTE_UNUSED, size_t arg_offset) {
+void UnstartedRuntime::UnstartedMemoryPeekByteArray(Thread* self,
+                                                    ShadowFrame* shadow_frame,
+                                                    [[maybe_unused]] JValue* result,
+                                                    size_t arg_offset) {
   UnstartedMemoryPeekArray(Primitive::kPrimByte, self, shadow_frame, arg_offset);
 }
 
 // This allows reading the new style of String objects during compilation.
-void UnstartedRuntime::UnstartedStringGetCharsNoCheck(
-    Thread* self, ShadowFrame* shadow_frame, JValue* result ATTRIBUTE_UNUSED, size_t arg_offset) {
+void UnstartedRuntime::UnstartedStringGetCharsNoCheck(Thread* self,
+                                                      ShadowFrame* shadow_frame,
+                                                      [[maybe_unused]] JValue* result,
+                                                      size_t arg_offset) {
   jint start = shadow_frame->GetVReg(arg_offset + 1);
   jint end = shadow_frame->GetVReg(arg_offset + 2);
   jint index = shadow_frame->GetVReg(arg_offset + 4);
@@ -1477,8 +1516,10 @@
 // where we can predict the behavior (somewhat).
 // Note: this is required (instead of lazy initialization) as these classes are used in the static
 //       initialization of other classes, so will *use* the value.
-void UnstartedRuntime::UnstartedRuntimeAvailableProcessors(
-    Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset ATTRIBUTE_UNUSED) {
+void UnstartedRuntime::UnstartedRuntimeAvailableProcessors(Thread* self,
+                                                           ShadowFrame* shadow_frame,
+                                                           JValue* result,
+                                                           [[maybe_unused]] size_t arg_offset) {
   if (CheckCallers(shadow_frame, { "void java.util.concurrent.SynchronousQueue.<clinit>()" })) {
     // SynchronousQueue really only separates between single- and multiprocessor case. Return
     // 8 as a conservative upper approximation.
@@ -1510,13 +1551,13 @@
 void UnstartedRuntime::UnstartedUnsafeGetObjectVolatile(
     Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset)
     REQUIRES_SHARED(Locks::mutator_lock_) {
-  UnstartedJdkUnsafeGetObjectVolatile(self, shadow_frame, result, arg_offset);
+  UnstartedJdkUnsafeGetReferenceVolatile(self, shadow_frame, result, arg_offset);
 }
 
 void UnstartedRuntime::UnstartedUnsafePutObjectVolatile(
     Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset)
     REQUIRES_SHARED(Locks::mutator_lock_) {
-  UnstartedJdkUnsafePutObjectVolatile(self, shadow_frame, result, arg_offset);
+  UnstartedJdkUnsafePutReferenceVolatile(self, shadow_frame, result, arg_offset);
 }
 
 void UnstartedRuntime::UnstartedUnsafePutOrderedObject(
@@ -1525,6 +1566,16 @@
   UnstartedJdkUnsafePutOrderedObject(self, shadow_frame, result, arg_offset);
 }
 
+void UnstartedRuntime::UnstartedJdkUnsafeCompareAndSetLong(
+    Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
+  UnstartedJdkUnsafeCompareAndSwapLong(self, shadow_frame, result, arg_offset);
+}
+
+void UnstartedRuntime::UnstartedJdkUnsafeCompareAndSetReference(
+    Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
+  UnstartedJdkUnsafeCompareAndSwapObject(self, shadow_frame, result, arg_offset);
+}
+
 void UnstartedRuntime::UnstartedJdkUnsafeCompareAndSwapLong(
     Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
   // Argument 0 is the Unsafe instance, skip.
@@ -1554,11 +1605,6 @@
   result->SetZ(success ? 1 : 0);
 }
 
-void UnstartedRuntime::UnstartedJdkUnsafeCompareAndSetLong(
-    Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
-  UnstartedJdkUnsafeCompareAndSwapLong(self, shadow_frame, result, arg_offset);
-}
-
 void UnstartedRuntime::UnstartedJdkUnsafeCompareAndSwapObject(
     Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
   // Argument 0 is the Unsafe instance, skip.
@@ -1609,12 +1655,7 @@
   result->SetZ(success ? 1 : 0);
 }
 
-void UnstartedRuntime::UnstartedJdkUnsafeCompareAndSetObject(
-    Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
-  UnstartedJdkUnsafeCompareAndSwapObject(self, shadow_frame, result, arg_offset);
-}
-
-void UnstartedRuntime::UnstartedJdkUnsafeGetObjectVolatile(
+void UnstartedRuntime::UnstartedJdkUnsafeGetReferenceVolatile(
     Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset)
     REQUIRES_SHARED(Locks::mutator_lock_) {
   // Argument 0 is the Unsafe instance, skip.
@@ -1628,8 +1669,10 @@
   result->SetL(value);
 }
 
-void UnstartedRuntime::UnstartedJdkUnsafePutObjectVolatile(
-    Thread* self, ShadowFrame* shadow_frame, JValue* result ATTRIBUTE_UNUSED, size_t arg_offset)
+void UnstartedRuntime::UnstartedJdkUnsafePutReferenceVolatile(Thread* self,
+                                                              ShadowFrame* shadow_frame,
+                                                              [[maybe_unused]] JValue* result,
+                                                              size_t arg_offset)
     REQUIRES_SHARED(Locks::mutator_lock_) {
   // Argument 0 is the Unsafe instance, skip.
   mirror::Object* obj = shadow_frame->GetVRegReference(arg_offset + 1);
@@ -1650,8 +1693,10 @@
   }
 }
 
-void UnstartedRuntime::UnstartedJdkUnsafePutOrderedObject(
-    Thread* self, ShadowFrame* shadow_frame, JValue* result ATTRIBUTE_UNUSED, size_t arg_offset)
+void UnstartedRuntime::UnstartedJdkUnsafePutOrderedObject(Thread* self,
+                                                          ShadowFrame* shadow_frame,
+                                                          [[maybe_unused]] JValue* result,
+                                                          size_t arg_offset)
     REQUIRES_SHARED(Locks::mutator_lock_) {
   // Argument 0 is the Unsafe instance, skip.
   mirror::Object* obj = shadow_frame->GetVRegReference(arg_offset + 1);
@@ -1799,8 +1844,10 @@
   }
 }
 
-void UnstartedRuntime::UnstartedSystemIdentityHashCode(
-    Thread* self ATTRIBUTE_UNUSED, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset)
+void UnstartedRuntime::UnstartedSystemIdentityHashCode([[maybe_unused]] Thread* self,
+                                                       ShadowFrame* shadow_frame,
+                                                       JValue* result,
+                                                       size_t arg_offset)
     REQUIRES_SHARED(Locks::mutator_lock_) {
   mirror::Object* obj = shadow_frame->GetVRegReference(arg_offset);
   result->SetI((obj != nullptr) ? obj->IdentityHashCode() : 0);
@@ -1810,9 +1857,11 @@
 // java.lang.invoke.VarHandle clinit. The clinit determines sets of
 // available VarHandle accessors and these differ based on machine
 // word size.
-void UnstartedRuntime::UnstartedJNIVMRuntimeIs64Bit(
-    Thread* self ATTRIBUTE_UNUSED, ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver ATTRIBUTE_UNUSED, uint32_t* args ATTRIBUTE_UNUSED, JValue* result) {
+void UnstartedRuntime::UnstartedJNIVMRuntimeIs64Bit([[maybe_unused]] Thread* self,
+                                                    [[maybe_unused]] ArtMethod* method,
+                                                    [[maybe_unused]] mirror::Object* receiver,
+                                                    [[maybe_unused]] uint32_t* args,
+                                                    JValue* result) {
   PointerSize pointer_size = Runtime::Current()->GetClassLinker()->GetImagePointerSize();
   jboolean is64bit = (pointer_size == PointerSize::k64) ? JNI_TRUE : JNI_FALSE;
   result->SetZ(is64bit);
@@ -1820,8 +1869,8 @@
 
 void UnstartedRuntime::UnstartedJNIVMRuntimeNewUnpaddedArray(
     Thread* self,
-    ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver ATTRIBUTE_UNUSED,
+    [[maybe_unused]] ArtMethod* method,
+    [[maybe_unused]] mirror::Object* receiver,
     uint32_t* args,
     JValue* result) {
   int32_t length = args[1];
@@ -1841,14 +1890,19 @@
 }
 
 void UnstartedRuntime::UnstartedJNIVMStackGetCallingClassLoader(
-    Thread* self ATTRIBUTE_UNUSED, ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver ATTRIBUTE_UNUSED, uint32_t* args ATTRIBUTE_UNUSED, JValue* result) {
+    [[maybe_unused]] Thread* self,
+    [[maybe_unused]] ArtMethod* method,
+    [[maybe_unused]] mirror::Object* receiver,
+    [[maybe_unused]] uint32_t* args,
+    JValue* result) {
   result->SetL(nullptr);
 }
 
-void UnstartedRuntime::UnstartedJNIVMStackGetStackClass2(
-    Thread* self, ArtMethod* method ATTRIBUTE_UNUSED, mirror::Object* receiver ATTRIBUTE_UNUSED,
-    uint32_t* args ATTRIBUTE_UNUSED, JValue* result) {
+void UnstartedRuntime::UnstartedJNIVMStackGetStackClass2(Thread* self,
+                                                         [[maybe_unused]] ArtMethod* method,
+                                                         [[maybe_unused]] mirror::Object* receiver,
+                                                         [[maybe_unused]] uint32_t* args,
+                                                         JValue* result) {
   NthCallerVisitor visitor(self, 3);
   visitor.WalkStack();
   if (visitor.caller != nullptr) {
@@ -1856,75 +1910,91 @@
   }
 }
 
-void UnstartedRuntime::UnstartedJNIMathLog(
-    Thread* self ATTRIBUTE_UNUSED, ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver ATTRIBUTE_UNUSED, uint32_t* args, JValue* result) {
+void UnstartedRuntime::UnstartedJNIMathLog([[maybe_unused]] Thread* self,
+                                           [[maybe_unused]] ArtMethod* method,
+                                           [[maybe_unused]] mirror::Object* receiver,
+                                           uint32_t* args,
+                                           JValue* result) {
   JValue value;
   value.SetJ((static_cast<uint64_t>(args[1]) << 32) | args[0]);
   result->SetD(log(value.GetD()));
 }
 
-void UnstartedRuntime::UnstartedJNIMathExp(
-    Thread* self ATTRIBUTE_UNUSED, ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver ATTRIBUTE_UNUSED, uint32_t* args, JValue* result) {
+void UnstartedRuntime::UnstartedJNIMathExp([[maybe_unused]] Thread* self,
+                                           [[maybe_unused]] ArtMethod* method,
+                                           [[maybe_unused]] mirror::Object* receiver,
+                                           uint32_t* args,
+                                           JValue* result) {
   JValue value;
   value.SetJ((static_cast<uint64_t>(args[1]) << 32) | args[0]);
   result->SetD(exp(value.GetD()));
 }
 
 void UnstartedRuntime::UnstartedJNIAtomicLongVMSupportsCS8(
-    Thread* self ATTRIBUTE_UNUSED,
-    ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver ATTRIBUTE_UNUSED,
-    uint32_t* args ATTRIBUTE_UNUSED,
+    [[maybe_unused]] Thread* self,
+    [[maybe_unused]] ArtMethod* method,
+    [[maybe_unused]] mirror::Object* receiver,
+    [[maybe_unused]] uint32_t* args,
     JValue* result) {
   result->SetZ(QuasiAtomic::LongAtomicsUseMutexes(Runtime::Current()->GetInstructionSet())
                    ? 0
                    : 1);
 }
 
-void UnstartedRuntime::UnstartedJNIClassGetNameNative(
-    Thread* self, ArtMethod* method ATTRIBUTE_UNUSED, mirror::Object* receiver,
-    uint32_t* args ATTRIBUTE_UNUSED, JValue* result) {
+void UnstartedRuntime::UnstartedJNIClassGetNameNative(Thread* self,
+                                                      [[maybe_unused]] ArtMethod* method,
+                                                      mirror::Object* receiver,
+                                                      [[maybe_unused]] uint32_t* args,
+                                                      JValue* result) {
   StackHandleScope<1> hs(self);
   result->SetL(mirror::Class::ComputeName(hs.NewHandle(receiver->AsClass())));
 }
 
-void UnstartedRuntime::UnstartedJNIDoubleLongBitsToDouble(
-    Thread* self ATTRIBUTE_UNUSED, ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver ATTRIBUTE_UNUSED, uint32_t* args, JValue* result) {
+void UnstartedRuntime::UnstartedJNIDoubleLongBitsToDouble([[maybe_unused]] Thread* self,
+                                                          [[maybe_unused]] ArtMethod* method,
+                                                          [[maybe_unused]] mirror::Object* receiver,
+                                                          uint32_t* args,
+                                                          JValue* result) {
   uint64_t long_input = args[0] | (static_cast<uint64_t>(args[1]) << 32);
   result->SetD(bit_cast<double>(long_input));
 }
 
-void UnstartedRuntime::UnstartedJNIFloatFloatToRawIntBits(
-    Thread* self ATTRIBUTE_UNUSED, ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver ATTRIBUTE_UNUSED, uint32_t* args, JValue* result) {
+void UnstartedRuntime::UnstartedJNIFloatFloatToRawIntBits([[maybe_unused]] Thread* self,
+                                                          [[maybe_unused]] ArtMethod* method,
+                                                          [[maybe_unused]] mirror::Object* receiver,
+                                                          uint32_t* args,
+                                                          JValue* result) {
   result->SetI(args[0]);
 }
 
-void UnstartedRuntime::UnstartedJNIFloatIntBitsToFloat(
-    Thread* self ATTRIBUTE_UNUSED, ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver ATTRIBUTE_UNUSED, uint32_t* args, JValue* result) {
+void UnstartedRuntime::UnstartedJNIFloatIntBitsToFloat([[maybe_unused]] Thread* self,
+                                                       [[maybe_unused]] ArtMethod* method,
+                                                       [[maybe_unused]] mirror::Object* receiver,
+                                                       uint32_t* args,
+                                                       JValue* result) {
   result->SetI(args[0]);
 }
 
-void UnstartedRuntime::UnstartedJNIObjectInternalClone(
-    Thread* self, ArtMethod* method ATTRIBUTE_UNUSED, mirror::Object* receiver,
-    uint32_t* args ATTRIBUTE_UNUSED, JValue* result) {
+void UnstartedRuntime::UnstartedJNIObjectInternalClone(Thread* self,
+                                                       [[maybe_unused]] ArtMethod* method,
+                                                       mirror::Object* receiver,
+                                                       [[maybe_unused]] uint32_t* args,
+                                                       JValue* result) {
   StackHandleScope<1> hs(self);
   Handle<mirror::Object> h_receiver = hs.NewHandle(receiver);
   result->SetL(mirror::Object::Clone(h_receiver, self));
 }
 
-void UnstartedRuntime::UnstartedJNIObjectNotifyAll(
-    Thread* self, ArtMethod* method ATTRIBUTE_UNUSED, mirror::Object* receiver,
-    uint32_t* args ATTRIBUTE_UNUSED, JValue* result ATTRIBUTE_UNUSED) {
+void UnstartedRuntime::UnstartedJNIObjectNotifyAll(Thread* self,
+                                                   [[maybe_unused]] ArtMethod* method,
+                                                   mirror::Object* receiver,
+                                                   [[maybe_unused]] uint32_t* args,
+                                                   [[maybe_unused]] JValue* result) {
   receiver->NotifyAll(self);
 }
 
 void UnstartedRuntime::UnstartedJNIStringCompareTo(Thread* self,
-                                                   ArtMethod* method ATTRIBUTE_UNUSED,
+                                                   [[maybe_unused]] ArtMethod* method,
                                                    mirror::Object* receiver,
                                                    uint32_t* args,
                                                    JValue* result) {
@@ -1936,9 +2006,11 @@
   result->SetI(receiver->AsString()->CompareTo(rhs->AsString()));
 }
 
-void UnstartedRuntime::UnstartedJNIStringFillBytesLatin1(
-    Thread* self, ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver, uint32_t* args, JValue* ATTRIBUTE_UNUSED) {
+void UnstartedRuntime::UnstartedJNIStringFillBytesLatin1(Thread* self,
+                                                         [[maybe_unused]] ArtMethod* method,
+                                                         mirror::Object* receiver,
+                                                         uint32_t* args,
+                                                         [[maybe_unused]] JValue*) {
   StackHandleScope<2> hs(self);
   Handle<mirror::String> h_receiver(hs.NewHandle(
       reinterpret_cast<mirror::String*>(receiver)->AsString()));
@@ -1948,9 +2020,11 @@
   h_receiver->FillBytesLatin1(h_buffer, index);
 }
 
-void UnstartedRuntime::UnstartedJNIStringFillBytesUTF16(
-    Thread* self, ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver, uint32_t* args, JValue* ATTRIBUTE_UNUSED) {
+void UnstartedRuntime::UnstartedJNIStringFillBytesUTF16(Thread* self,
+                                                        [[maybe_unused]] ArtMethod* method,
+                                                        mirror::Object* receiver,
+                                                        uint32_t* args,
+                                                        [[maybe_unused]] JValue*) {
   StackHandleScope<2> hs(self);
   Handle<mirror::String> h_receiver(hs.NewHandle(
       reinterpret_cast<mirror::String*>(receiver)->AsString()));
@@ -1960,24 +2034,30 @@
   h_receiver->FillBytesUTF16(h_buffer, index);
 }
 
-void UnstartedRuntime::UnstartedJNIStringIntern(
-    Thread* self ATTRIBUTE_UNUSED, ArtMethod* method ATTRIBUTE_UNUSED, mirror::Object* receiver,
-    uint32_t* args ATTRIBUTE_UNUSED, JValue* result) {
+void UnstartedRuntime::UnstartedJNIStringIntern([[maybe_unused]] Thread* self,
+                                                [[maybe_unused]] ArtMethod* method,
+                                                mirror::Object* receiver,
+                                                [[maybe_unused]] uint32_t* args,
+                                                JValue* result) {
   result->SetL(receiver->AsString()->Intern());
 }
 
-void UnstartedRuntime::UnstartedJNIArrayCreateMultiArray(
-    Thread* self, ArtMethod* method ATTRIBUTE_UNUSED, mirror::Object* receiver ATTRIBUTE_UNUSED,
-    uint32_t* args, JValue* result) {
+void UnstartedRuntime::UnstartedJNIArrayCreateMultiArray(Thread* self,
+                                                         [[maybe_unused]] ArtMethod* method,
+                                                         [[maybe_unused]] mirror::Object* receiver,
+                                                         uint32_t* args,
+                                                         JValue* result) {
   StackHandleScope<2> hs(self);
   auto h_class(hs.NewHandle(reinterpret_cast<mirror::Class*>(args[0])->AsClass()));
   auto h_dimensions(hs.NewHandle(reinterpret_cast<mirror::IntArray*>(args[1])->AsIntArray()));
   result->SetL(mirror::Array::CreateMultiArray(self, h_class, h_dimensions));
 }
 
-void UnstartedRuntime::UnstartedJNIArrayCreateObjectArray(
-    Thread* self, ArtMethod* method ATTRIBUTE_UNUSED, mirror::Object* receiver ATTRIBUTE_UNUSED,
-    uint32_t* args, JValue* result) {
+void UnstartedRuntime::UnstartedJNIArrayCreateObjectArray(Thread* self,
+                                                          [[maybe_unused]] ArtMethod* method,
+                                                          [[maybe_unused]] mirror::Object* receiver,
+                                                          uint32_t* args,
+                                                          JValue* result) {
   int32_t length = static_cast<int32_t>(args[1]);
   if (length < 0) {
     ThrowNegativeArraySizeException(length);
@@ -1998,8 +2078,11 @@
 }
 
 void UnstartedRuntime::UnstartedJNIThrowableNativeFillInStackTrace(
-    Thread* self, ArtMethod* method ATTRIBUTE_UNUSED, mirror::Object* receiver ATTRIBUTE_UNUSED,
-    uint32_t* args ATTRIBUTE_UNUSED, JValue* result) {
+    Thread* self,
+    [[maybe_unused]] ArtMethod* method,
+    [[maybe_unused]] mirror::Object* receiver,
+    [[maybe_unused]] uint32_t* args,
+    JValue* result) {
   ScopedObjectAccessUnchecked soa(self);
   ScopedLocalRef<jobject> stack_trace(self->GetJniEnv(), self->CreateInternalStackTrace(soa));
   result->SetL(soa.Decode<mirror::Object>(stack_trace.get()));
@@ -2027,7 +2110,7 @@
                                                    mirror::Object* receiver,
                                                    uint32_t* args,
                                                    JValue* result) {
-  UnstartedJNIJdkUnsafePutObject(self, method, receiver, args, result);
+  UnstartedJNIJdkUnsafePutReference(self, method, receiver, args, result);
 }
 
 void UnstartedRuntime::UnstartedJNIUnsafeGetArrayBaseOffsetForComponentType(
@@ -2048,19 +2131,18 @@
   UnstartedJNIJdkUnsafeGetArrayIndexScaleForComponentType(self, method, receiver, args, result);
 }
 
-void UnstartedRuntime::UnstartedJNIJdkUnsafeAddressSize(
-    Thread* self ATTRIBUTE_UNUSED,
-    ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver ATTRIBUTE_UNUSED,
-    uint32_t* args ATTRIBUTE_UNUSED,
-    JValue* result) {
+void UnstartedRuntime::UnstartedJNIJdkUnsafeAddressSize([[maybe_unused]] Thread* self,
+                                                        [[maybe_unused]] ArtMethod* method,
+                                                        [[maybe_unused]] mirror::Object* receiver,
+                                                        [[maybe_unused]] uint32_t* args,
+                                                        JValue* result) {
   result->SetI(sizeof(void*));
 }
 
 void UnstartedRuntime::UnstartedJNIJdkUnsafeCompareAndSwapInt(
     Thread* self,
-    ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver ATTRIBUTE_UNUSED,
+    [[maybe_unused]] ArtMethod* method,
+    [[maybe_unused]] mirror::Object* receiver,
     uint32_t* args,
     JValue* result) {
   ObjPtr<mirror::Object> obj = reinterpret_cast32<mirror::Object*>(args[0]);
@@ -2101,11 +2183,12 @@
   UnstartedJNIJdkUnsafeCompareAndSwapInt(self, method, receiver, args, result);
 }
 
-void UnstartedRuntime::UnstartedJNIJdkUnsafeGetIntVolatile(Thread* self,
-                                                        ArtMethod* method ATTRIBUTE_UNUSED,
-                                                        mirror::Object* receiver ATTRIBUTE_UNUSED,
-                                                        uint32_t* args,
-                                                        JValue* result) {
+void UnstartedRuntime::UnstartedJNIJdkUnsafeGetIntVolatile(
+    Thread* self,
+    [[maybe_unused]] ArtMethod* method,
+    [[maybe_unused]] mirror::Object* receiver,
+    uint32_t* args,
+    JValue* result) {
   ObjPtr<mirror::Object> obj = reinterpret_cast32<mirror::Object*>(args[0]);
   if (obj == nullptr) {
     AbortTransactionOrFail(self, "Unsafe.compareAndSwapIntVolatile with null object.");
@@ -2116,11 +2199,11 @@
   result->SetI(obj->GetField32Volatile(MemberOffset(offset)));
 }
 
-void UnstartedRuntime::UnstartedJNIJdkUnsafePutObject(Thread* self,
-                                                   ArtMethod* method ATTRIBUTE_UNUSED,
-                                                   mirror::Object* receiver ATTRIBUTE_UNUSED,
-                                                   uint32_t* args,
-                                                   JValue* result ATTRIBUTE_UNUSED) {
+void UnstartedRuntime::UnstartedJNIJdkUnsafePutReference(Thread* self,
+                                                         [[maybe_unused]] ArtMethod* method,
+                                                         [[maybe_unused]] mirror::Object* receiver,
+                                                         uint32_t* args,
+                                                         [[maybe_unused]] JValue* result) {
   ObjPtr<mirror::Object> obj = reinterpret_cast32<mirror::Object*>(args[0]);
   if (obj == nullptr) {
     AbortTransactionOrFail(self, "Unsafe.putObject with null object.");
@@ -2139,10 +2222,18 @@
   }
 }
 
+void UnstartedRuntime::UnstartedJNIJdkUnsafeStoreFence(Thread* self ATTRIBUTE_UNUSED,
+                                                       ArtMethod* method ATTRIBUTE_UNUSED,
+                                                       mirror::Object* receiver ATTRIBUTE_UNUSED,
+                                                       uint32_t* args ATTRIBUTE_UNUSED,
+                                                       JValue* result ATTRIBUTE_UNUSED) {
+  std::atomic_thread_fence(std::memory_order_release);
+}
+
 void UnstartedRuntime::UnstartedJNIJdkUnsafeGetArrayBaseOffsetForComponentType(
     Thread* self,
-    ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver ATTRIBUTE_UNUSED,
+    [[maybe_unused]] ArtMethod* method,
+    [[maybe_unused]] mirror::Object* receiver,
     uint32_t* args,
     JValue* result) {
   ObjPtr<mirror::Object> component = reinterpret_cast32<mirror::Object*>(args[0]);
@@ -2156,8 +2247,8 @@
 
 void UnstartedRuntime::UnstartedJNIJdkUnsafeGetArrayIndexScaleForComponentType(
     Thread* self,
-    ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver ATTRIBUTE_UNUSED,
+    [[maybe_unused]] ArtMethod* method,
+    [[maybe_unused]] mirror::Object* receiver,
     uint32_t* args,
     JValue* result) {
   ObjPtr<mirror::Object> component = reinterpret_cast32<mirror::Object*>(args[0]);
@@ -2169,23 +2260,21 @@
   result->SetI(Primitive::ComponentSize(primitive_type));
 }
 
-void UnstartedRuntime::UnstartedJNIFieldGetArtField(
-    Thread* self ATTRIBUTE_UNUSED,
-    ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver,
-    uint32_t* args ATTRIBUTE_UNUSED,
-    JValue* result) {
+void UnstartedRuntime::UnstartedJNIFieldGetArtField([[maybe_unused]] Thread* self,
+                                                    [[maybe_unused]] ArtMethod* method,
+                                                    mirror::Object* receiver,
+                                                    [[maybe_unused]] uint32_t* args,
+                                                    JValue* result) {
   ObjPtr<mirror::Field> field = ObjPtr<mirror::Field>::DownCast(receiver);
   ArtField* art_field = field->GetArtField();
   result->SetJ(reinterpret_cast<int64_t>(art_field));
 }
 
-void UnstartedRuntime::UnstartedJNIFieldGetNameInternal(
-    Thread* self ATTRIBUTE_UNUSED,
-    ArtMethod* method ATTRIBUTE_UNUSED,
-    mirror::Object* receiver,
-    uint32_t* args ATTRIBUTE_UNUSED,
-    JValue* result) {
+void UnstartedRuntime::UnstartedJNIFieldGetNameInternal([[maybe_unused]] Thread* self,
+                                                        [[maybe_unused]] ArtMethod* method,
+                                                        mirror::Object* receiver,
+                                                        [[maybe_unused]] uint32_t* args,
+                                                        JValue* result) {
   ObjPtr<mirror::Field> field = ObjPtr<mirror::Field>::DownCast(receiver);
   ArtField* art_field = field->GetArtField();
   result->SetL(art_field->ResolveNameString());
diff --git a/runtime/interpreter/unstarted_runtime.h b/runtime/interpreter/unstarted_runtime.h
index 8b31f8f..60092ad 100644
--- a/runtime/interpreter/unstarted_runtime.h
+++ b/runtime/interpreter/unstarted_runtime.h
@@ -19,11 +19,12 @@
 
 #include "interpreter.h"
 
+#include "base/macros.h"
 #include "dex/dex_file.h"
 #include "jvalue.h"
 #include "unstarted_runtime_list.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtMethod;
 class CodeItemDataAccessor;
@@ -47,7 +48,7 @@
 
 class UnstartedRuntime {
  public:
-  static void Initialize();
+  EXPORT static void Initialize();
 
   // For testing. When we destroy the Runtime and create a new one,
   // we need to reinitialize maps with new `ArtMethod*` keys.
diff --git a/runtime/interpreter/unstarted_runtime_list.h b/runtime/interpreter/unstarted_runtime_list.h
index dd2028a..71e3ae7 100644
--- a/runtime/interpreter/unstarted_runtime_list.h
+++ b/runtime/interpreter/unstarted_runtime_list.h
@@ -80,11 +80,11 @@
   V(UnsafePutObjectVolatile, "Lsun/misc/Unsafe;", "putObjectVolatile", "(Ljava/lang/Object;JLjava/lang/Object;)V") \
   V(UnsafePutOrderedObject, "Lsun/misc/Unsafe;", "putOrderedObject", "(Ljava/lang/Object;JLjava/lang/Object;)V") \
   V(JdkUnsafeCompareAndSetLong, "Ljdk/internal/misc/Unsafe;", "compareAndSetLong", "(Ljava/lang/Object;JJJ)Z") \
-  V(JdkUnsafeCompareAndSetObject, "Ljdk/internal/misc/Unsafe;", "compareAndSetObject", "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z") \
+  V(JdkUnsafeCompareAndSetReference, "Ljdk/internal/misc/Unsafe;", "compareAndSetReference", "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z") \
   V(JdkUnsafeCompareAndSwapLong, "Ljdk/internal/misc/Unsafe;", "compareAndSwapLong", "(Ljava/lang/Object;JJJ)Z") \
   V(JdkUnsafeCompareAndSwapObject, "Ljdk/internal/misc/Unsafe;", "compareAndSwapObject", "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z") \
-  V(JdkUnsafeGetObjectVolatile, "Ljdk/internal/misc/Unsafe;", "getObjectVolatile", "(Ljava/lang/Object;J)Ljava/lang/Object;") \
-  V(JdkUnsafePutObjectVolatile, "Ljdk/internal/misc/Unsafe;", "putObjectVolatile", "(Ljava/lang/Object;JLjava/lang/Object;)V") \
+  V(JdkUnsafeGetReferenceVolatile, "Ljdk/internal/misc/Unsafe;", "getReferenceVolatile", "(Ljava/lang/Object;J)Ljava/lang/Object;") \
+  V(JdkUnsafePutReferenceVolatile, "Ljdk/internal/misc/Unsafe;", "putReferenceVolatile", "(Ljava/lang/Object;JLjava/lang/Object;)V") \
   V(JdkUnsafePutOrderedObject, "Ljdk/internal/misc/Unsafe;", "putOrderedObject", "(Ljava/lang/Object;JLjava/lang/Object;)V") \
   V(IntegerParseInt, "Ljava/lang/Integer;", "parseInt", "(Ljava/lang/String;)I") \
   V(LongParseLong, "Ljava/lang/Long;", "parseLong", "(Ljava/lang/String;)J") \
@@ -121,7 +121,8 @@
   V(JdkUnsafeCompareAndSetInt, "Ljdk/internal/misc/Unsafe;", "compareAndSetInt", "(Ljava/lang/Object;JII)Z") \
   V(JdkUnsafeCompareAndSwapInt, "Ljdk/internal/misc/Unsafe;", "compareAndSwapInt", "(Ljava/lang/Object;JII)Z") \
   V(JdkUnsafeGetIntVolatile, "Ljdk/internal/misc/Unsafe;", "getIntVolatile", "(Ljava/lang/Object;J)I") \
-  V(JdkUnsafePutObject, "Ljdk/internal/misc/Unsafe;", "putObject", "(Ljava/lang/Object;JLjava/lang/Object;)V") \
+  V(JdkUnsafePutReference, "Ljdk/internal/misc/Unsafe;", "putReference", "(Ljava/lang/Object;JLjava/lang/Object;)V") \
+  V(JdkUnsafeStoreFence, "Ljdk/internal/misc/Unsafe;", "storeFence", "()V") \
   V(JdkUnsafeGetArrayBaseOffsetForComponentType, "Ljdk/internal/misc/Unsafe;", "getArrayBaseOffsetForComponentType", "(Ljava/lang/Class;)I") \
   V(JdkUnsafeGetArrayIndexScaleForComponentType, "Ljdk/internal/misc/Unsafe;", "getArrayIndexScaleForComponentType", "(Ljava/lang/Class;)I") \
   V(FieldGetArtField, "Ljava/lang/reflect/Field;", "getArtField", "()J") \
diff --git a/runtime/interpreter/unstarted_runtime_test.cc b/runtime/interpreter/unstarted_runtime_test.cc
index 3227ef7..d58d42d 100644
--- a/runtime/interpreter/unstarted_runtime_test.cc
+++ b/runtime/interpreter/unstarted_runtime_test.cc
@@ -45,7 +45,7 @@
 #include "transaction.h"
 #include "unstarted_runtime_list.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace interpreter {
 
 // Deleter to be used with ShadowFrame::CreateDeoptimizedFrame objects.
@@ -125,7 +125,7 @@
                                const StackHandleScope<3>& data)
       REQUIRES_SHARED(Locks::mutator_lock_) {
     CHECK_EQ(array->GetLength(), 3);
-    CHECK_EQ(data.NumberOfReferences(), 3U);
+    CHECK_EQ(data.Size(), 3U);
     for (size_t i = 0; i < 3; ++i) {
       EXPECT_OBJ_PTR_EQ(data.GetReference(i), array->Get(static_cast<int32_t>(i))) << i;
     }
@@ -1305,7 +1305,9 @@
     oss << elem->AsString()->ToModifiedUtf8();
   }
   std::string output_string = oss.str();
-  ASSERT_EQ(output_string, "<E:Ljava/lang/Object;>Ljava/lang/Object;Ljava/util/Collection<TE;>;");
+  ASSERT_EQ(output_string,
+            "<E:Ljava/lang/Object;>Ljava/lang/Object;Ljava/util/SequencedCollection<TE;>;"
+            "Ljava/util/Collection<TE;>;");
 }
 
 TEST_F(UnstartedRuntimeTest, ConstructorNewInstance0) {
diff --git a/runtime/intrinsics_enum.h b/runtime/intrinsics_enum.h
index d46d0cc..16f01e0 100644
--- a/runtime/intrinsics_enum.h
+++ b/runtime/intrinsics_enum.h
@@ -17,15 +17,16 @@
 #ifndef ART_RUNTIME_INTRINSICS_ENUM_H_
 #define ART_RUNTIME_INTRINSICS_ENUM_H_
 
-namespace art {
+#include "base/macros.h"
+#include "intrinsics_list.h"
+
+namespace art HIDDEN {
 
 enum class Intrinsics {
 #define OPTIMIZING_INTRINSICS(Name, ...) \
   k ## Name,
-#include "intrinsics_list.h"
   kNone,
-  INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
-#undef INTRINSICS_LIST
+  ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS)
 #undef OPTIMIZING_INTRINSICS
 };
 std::ostream& operator<<(std::ostream& os, const Intrinsics& intrinsic);
diff --git a/runtime/intrinsics_list.h b/runtime/intrinsics_list.h
index c4b687e..d6fa39f 100644
--- a/runtime/intrinsics_list.h
+++ b/runtime/intrinsics_list.h
@@ -48,7 +48,7 @@
 // of finer grain side effects representation.
 
 // Intrinsics for methods with signature polymorphic behaviours.
-#define SIGNATURE_POLYMORPHIC_INTRINSICS_LIST(V) \
+#define ART_SIGNATURE_POLYMORPHIC_INTRINSICS_LIST(V) \
   V(MethodHandleInvokeExact, kPolymorphic, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljava/lang/invoke/MethodHandle;", "invokeExact", "([Ljava/lang/Object;)Ljava/lang/Object;") \
   V(MethodHandleInvoke, kPolymorphic, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljava/lang/invoke/MethodHandle;", "invoke", "([Ljava/lang/Object;)Ljava/lang/Object;") \
   V(VarHandleCompareAndExchange, kPolymorphic, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljava/lang/invoke/VarHandle;", "compareAndExchange", "([Ljava/lang/Object;)Ljava/lang/Object;") \
@@ -83,49 +83,23 @@
   V(VarHandleWeakCompareAndSetPlain, kPolymorphic, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljava/lang/invoke/VarHandle;", "weakCompareAndSetPlain", "([Ljava/lang/Object;)Z") \
   V(VarHandleWeakCompareAndSetRelease, kPolymorphic, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljava/lang/invoke/VarHandle;", "weakCompareAndSetRelease", "([Ljava/lang/Object;)Z")
 
-// The complete list of intrinsics.
-#define INTRINSICS_LIST(V) \
-  V(DoubleDoubleToRawLongBits, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Double;", "doubleToRawLongBits", "(D)J") \
-  V(DoubleDoubleToLongBits, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Double;", "doubleToLongBits", "(D)J") \
-  V(DoubleIsInfinite, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Double;", "isInfinite", "(D)Z") \
+// Intrinics that have specialized intermediate representation in the compiler
+// and therefore should never be recorded in a generic `HInvoke`.
+#define ART_INTRINSICS_WITH_SPECIALIZED_HIR_LIST(V) \
   V(DoubleIsNaN, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Double;", "isNaN", "(D)Z") \
-  V(DoubleLongBitsToDouble, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Double;", "longBitsToDouble", "(J)D") \
-  V(FloatFloatToRawIntBits, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Float;", "floatToRawIntBits", "(F)I") \
-  V(FloatFloatToIntBits, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Float;", "floatToIntBits", "(F)I") \
-  V(FloatIsInfinite, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Float;", "isInfinite", "(F)Z") \
   V(FloatIsNaN, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Float;", "isNaN", "(F)Z") \
-  V(FloatIntBitsToFloat, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Float;", "intBitsToFloat", "(I)F") \
-  V(IntegerReverse, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "reverse", "(I)I") \
-  V(IntegerReverseBytes, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "reverseBytes", "(I)I") \
-  V(IntegerBitCount, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "bitCount", "(I)I") \
   V(IntegerCompare, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "compare", "(II)I") \
-  V(IntegerDivideUnsigned, kStatic, kNeedsEnvironment, kNoSideEffects, kCanThrow, "Ljava/lang/Integer;", "divideUnsigned", "(II)I") \
-  V(IntegerHighestOneBit, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "highestOneBit", "(I)I") \
-  V(IntegerLowestOneBit, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "lowestOneBit", "(I)I") \
-  V(IntegerNumberOfLeadingZeros, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "numberOfLeadingZeros", "(I)I") \
-  V(IntegerNumberOfTrailingZeros, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "numberOfTrailingZeros", "(I)I") \
   V(IntegerRotateRight, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "rotateRight", "(II)I") \
   V(IntegerRotateLeft, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "rotateLeft", "(II)I") \
   V(IntegerSignum, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "signum", "(I)I") \
-  V(LongReverse, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "reverse", "(J)J") \
-  V(LongReverseBytes, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "reverseBytes", "(J)J") \
-  V(LongBitCount, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "bitCount", "(J)I") \
   V(LongCompare, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "compare", "(JJ)I") \
-  V(LongDivideUnsigned, kStatic, kNeedsEnvironment, kNoSideEffects, kCanThrow, "Ljava/lang/Long;", "divideUnsigned", "(JJ)J") \
-  V(LongHighestOneBit, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "highestOneBit", "(J)J") \
-  V(LongLowestOneBit, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "lowestOneBit", "(J)J") \
-  V(LongNumberOfLeadingZeros, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "numberOfLeadingZeros", "(J)I") \
-  V(LongNumberOfTrailingZeros, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "numberOfTrailingZeros", "(J)I") \
   V(LongRotateRight, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "rotateRight", "(JI)J") \
   V(LongRotateLeft, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "rotateLeft", "(JI)J") \
   V(LongSignum, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "signum", "(J)I") \
-  V(ShortReverseBytes, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Short;", "reverseBytes", "(S)S") \
   V(MathAbsDouble, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "abs", "(D)D") \
   V(MathAbsFloat, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "abs", "(F)F") \
   V(MathAbsLong, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "abs", "(J)J") \
   V(MathAbsInt, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "abs", "(I)I") \
-  V(MathFmaDouble, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "fma", "(DDD)D") \
-  V(MathFmaFloat, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "fma", "(FFF)F") \
   V(MathMinDoubleDouble, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "min", "(DD)D") \
   V(MathMinFloatFloat, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "min", "(FF)F") \
   V(MathMinLongLong, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "min", "(JJ)J") \
@@ -134,6 +108,50 @@
   V(MathMaxFloatFloat, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "max", "(FF)F") \
   V(MathMaxLongLong, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "max", "(JJ)J") \
   V(MathMaxIntInt, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "max", "(II)I") \
+  V(StringCharAt, kVirtual, kNeedsEnvironment, kReadSideEffects, kCanThrow, "Ljava/lang/String;", "charAt", "(I)C") \
+  V(StringIsEmpty, kVirtual, kNeedsEnvironment, kReadSideEffects, kNoThrow, "Ljava/lang/String;", "isEmpty", "()Z") \
+  V(StringLength, kVirtual, kNeedsEnvironment, kReadSideEffects, kNoThrow, "Ljava/lang/String;", "length", "()I") \
+  V(UnsafeLoadFence, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Lsun/misc/Unsafe;", "loadFence", "()V") \
+  V(UnsafeStoreFence, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Lsun/misc/Unsafe;", "storeFence", "()V") \
+  V(UnsafeFullFence, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Lsun/misc/Unsafe;", "fullFence", "()V") \
+  V(JdkUnsafeLoadFence, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "loadFence", "()V") \
+  V(JdkUnsafeStoreFence, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "storeFence", "()V") \
+  V(JdkUnsafeFullFence, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "fullFence", "()V") \
+  V(VarHandleFullFence, kStatic, kNeedsEnvironment, kWriteSideEffects, kNoThrow, "Ljava/lang/invoke/VarHandle;", "fullFence", "()V") \
+  V(VarHandleAcquireFence, kStatic, kNeedsEnvironment, kWriteSideEffects, kNoThrow, "Ljava/lang/invoke/VarHandle;", "acquireFence", "()V") \
+  V(VarHandleReleaseFence, kStatic, kNeedsEnvironment, kWriteSideEffects, kNoThrow, "Ljava/lang/invoke/VarHandle;", "releaseFence", "()V") \
+  V(VarHandleLoadLoadFence, kStatic, kNeedsEnvironment, kWriteSideEffects, kNoThrow, "Ljava/lang/invoke/VarHandle;", "loadLoadFence", "()V") \
+  V(VarHandleStoreStoreFence, kStatic, kNeedsEnvironment, kReadSideEffects, kNoThrow, "Ljava/lang/invoke/VarHandle;", "storeStoreFence", "()V")
+
+// Intrinics without specialized intermediate representation in the compiler, using `HInvoke`.
+#define ART_INTRINSICS_WITH_HINVOKE_LIST(V) \
+  V(DoubleDoubleToRawLongBits, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Double;", "doubleToRawLongBits", "(D)J") \
+  V(DoubleDoubleToLongBits, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Double;", "doubleToLongBits", "(D)J") \
+  V(DoubleIsInfinite, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Double;", "isInfinite", "(D)Z") \
+  V(DoubleLongBitsToDouble, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Double;", "longBitsToDouble", "(J)D") \
+  V(FloatFloatToRawIntBits, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Float;", "floatToRawIntBits", "(F)I") \
+  V(FloatFloatToIntBits, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Float;", "floatToIntBits", "(F)I") \
+  V(FloatIsInfinite, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Float;", "isInfinite", "(F)Z") \
+  V(FloatIntBitsToFloat, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Float;", "intBitsToFloat", "(I)F") \
+  V(IntegerReverse, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "reverse", "(I)I") \
+  V(IntegerReverseBytes, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "reverseBytes", "(I)I") \
+  V(IntegerBitCount, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "bitCount", "(I)I") \
+  V(IntegerDivideUnsigned, kStatic, kNeedsEnvironment, kNoSideEffects, kCanThrow, "Ljava/lang/Integer;", "divideUnsigned", "(II)I") \
+  V(IntegerHighestOneBit, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "highestOneBit", "(I)I") \
+  V(IntegerLowestOneBit, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "lowestOneBit", "(I)I") \
+  V(IntegerNumberOfLeadingZeros, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "numberOfLeadingZeros", "(I)I") \
+  V(IntegerNumberOfTrailingZeros, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "numberOfTrailingZeros", "(I)I") \
+  V(LongReverse, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "reverse", "(J)J") \
+  V(LongReverseBytes, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "reverseBytes", "(J)J") \
+  V(LongBitCount, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "bitCount", "(J)I") \
+  V(LongDivideUnsigned, kStatic, kNeedsEnvironment, kNoSideEffects, kCanThrow, "Ljava/lang/Long;", "divideUnsigned", "(JJ)J") \
+  V(LongHighestOneBit, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "highestOneBit", "(J)J") \
+  V(LongLowestOneBit, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "lowestOneBit", "(J)J") \
+  V(LongNumberOfLeadingZeros, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "numberOfLeadingZeros", "(J)I") \
+  V(LongNumberOfTrailingZeros, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Long;", "numberOfTrailingZeros", "(J)I") \
+  V(ShortReverseBytes, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Short;", "reverseBytes", "(S)S") \
+  V(MathFmaDouble, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "fma", "(DDD)D") \
+  V(MathFmaFloat, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "fma", "(FFF)F") \
   V(MathCos, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "cos", "(D)D") \
   V(MathSin, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "sin", "(D)D") \
   V(MathAcos, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Math;", "acos", "(D)D") \
@@ -184,7 +202,6 @@
   V(FP16LessEquals, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Llibcore/util/FP16;", "lessEquals", "(SS)Z") \
   V(FP16Min, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Llibcore/util/FP16;", "min", "(SS)S") \
   V(FP16Max, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Llibcore/util/FP16;", "max", "(SS)S") \
-  V(StringCharAt, kVirtual, kNeedsEnvironment, kReadSideEffects, kCanThrow, "Ljava/lang/String;", "charAt", "(I)C") \
   V(StringCompareTo, kVirtual, kNeedsEnvironment, kReadSideEffects, kCanThrow, "Ljava/lang/String;", "compareTo", "(Ljava/lang/String;)I") \
   V(StringEquals, kVirtual, kNeedsEnvironment, kReadSideEffects, kCanThrow, "Ljava/lang/String;", "equals", "(Ljava/lang/Object;)Z") \
   V(StringGetCharsNoCheck, kVirtual, kNeedsEnvironment, kReadSideEffects, kCanThrow, "Ljava/lang/String;", "getCharsNoCheck", "(II[CI)V") \
@@ -192,8 +209,6 @@
   V(StringIndexOfAfter, kVirtual, kNeedsEnvironment, kReadSideEffects, kNoThrow, "Ljava/lang/String;", "indexOf", "(II)I") \
   V(StringStringIndexOf, kVirtual, kNeedsEnvironment, kReadSideEffects, kCanThrow, "Ljava/lang/String;", "indexOf", "(Ljava/lang/String;)I") \
   V(StringStringIndexOfAfter, kVirtual, kNeedsEnvironment, kReadSideEffects, kCanThrow, "Ljava/lang/String;", "indexOf", "(Ljava/lang/String;I)I") \
-  V(StringIsEmpty, kVirtual, kNeedsEnvironment, kReadSideEffects, kNoThrow, "Ljava/lang/String;", "isEmpty", "()Z") \
-  V(StringLength, kVirtual, kNeedsEnvironment, kReadSideEffects, kNoThrow, "Ljava/lang/String;", "length", "()I") \
   V(StringNewStringFromBytes, kStatic, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljava/lang/StringFactory;", "newStringFromBytes", "([BIII)Ljava/lang/String;") \
   V(StringNewStringFromChars, kStatic, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljava/lang/StringFactory;", "newStringFromChars", "(II[C)Ljava/lang/String;") \
   V(StringNewStringFromString, kStatic, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljava/lang/StringFactory;", "newStringFromString", "(Ljava/lang/String;)Ljava/lang/String;") \
@@ -237,21 +252,18 @@
   V(UnsafeGetAndSetInt, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Lsun/misc/Unsafe;", "getAndSetInt", "(Ljava/lang/Object;JI)I") \
   V(UnsafeGetAndSetLong, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Lsun/misc/Unsafe;", "getAndSetLong", "(Ljava/lang/Object;JJ)J") \
   V(UnsafeGetAndSetObject, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Lsun/misc/Unsafe;", "getAndSetObject", "(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;") \
-  V(UnsafeLoadFence, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Lsun/misc/Unsafe;", "loadFence", "()V") \
-  V(UnsafeStoreFence, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Lsun/misc/Unsafe;", "storeFence", "()V") \
-  V(UnsafeFullFence, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Lsun/misc/Unsafe;", "fullFence", "()V") \
   V(JdkUnsafeCASInt, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "compareAndSwapInt", "(Ljava/lang/Object;JII)Z") \
   V(JdkUnsafeCASLong, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "compareAndSwapLong", "(Ljava/lang/Object;JJJ)Z") \
   V(JdkUnsafeCASObject, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "compareAndSwapObject", "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z") \
   V(JdkUnsafeCompareAndSetInt, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "compareAndSetInt", "(Ljava/lang/Object;JII)Z") \
   V(JdkUnsafeCompareAndSetLong, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "compareAndSetLong", "(Ljava/lang/Object;JJJ)Z") \
-  V(JdkUnsafeCompareAndSetObject, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "compareAndSetObject", "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z") \
+  V(JdkUnsafeCompareAndSetReference, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "compareAndSetReference", "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z") \
   V(JdkUnsafeGet, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getInt", "(Ljava/lang/Object;J)I") \
   V(JdkUnsafeGetVolatile, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getIntVolatile", "(Ljava/lang/Object;J)I") \
   V(JdkUnsafeGetAcquire, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getIntAcquire", "(Ljava/lang/Object;J)I") \
-  V(JdkUnsafeGetObject, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getObject", "(Ljava/lang/Object;J)Ljava/lang/Object;") \
-  V(JdkUnsafeGetObjectVolatile, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getObjectVolatile", "(Ljava/lang/Object;J)Ljava/lang/Object;") \
-  V(JdkUnsafeGetObjectAcquire, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getObjectAcquire", "(Ljava/lang/Object;J)Ljava/lang/Object;") \
+  V(JdkUnsafeGetReference, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getReference", "(Ljava/lang/Object;J)Ljava/lang/Object;") \
+  V(JdkUnsafeGetReferenceVolatile, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getReferenceVolatile", "(Ljava/lang/Object;J)Ljava/lang/Object;") \
+  V(JdkUnsafeGetReferenceAcquire, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getReferenceAcquire", "(Ljava/lang/Object;J)Ljava/lang/Object;") \
   V(JdkUnsafeGetLong, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getLong", "(Ljava/lang/Object;J)J") \
   V(JdkUnsafeGetLongVolatile, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getLongVolatile", "(Ljava/lang/Object;J)J") \
   V(JdkUnsafeGetLongAcquire, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getLongAcquire", "(Ljava/lang/Object;J)J") \
@@ -260,10 +272,10 @@
   V(JdkUnsafePutOrdered, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "putOrderedInt", "(Ljava/lang/Object;JI)V") \
   V(JdkUnsafePutRelease, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "putIntRelease", "(Ljava/lang/Object;JI)V") \
   V(JdkUnsafePutVolatile, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "putIntVolatile", "(Ljava/lang/Object;JI)V") \
-  V(JdkUnsafePutObject, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "putObject", "(Ljava/lang/Object;JLjava/lang/Object;)V") \
+  V(JdkUnsafePutReference, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "putReference", "(Ljava/lang/Object;JLjava/lang/Object;)V") \
   V(JdkUnsafePutObjectOrdered, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "putOrderedObject", "(Ljava/lang/Object;JLjava/lang/Object;)V") \
-  V(JdkUnsafePutObjectVolatile, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "putObjectVolatile", "(Ljava/lang/Object;JLjava/lang/Object;)V") \
-  V(JdkUnsafePutObjectRelease, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "putObjectRelease", "(Ljava/lang/Object;JLjava/lang/Object;)V") \
+  V(JdkUnsafePutReferenceVolatile, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "putReferenceVolatile", "(Ljava/lang/Object;JLjava/lang/Object;)V") \
+  V(JdkUnsafePutReferenceRelease, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "putReferenceRelease", "(Ljava/lang/Object;JLjava/lang/Object;)V") \
   V(JdkUnsafePutLong, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "putLong", "(Ljava/lang/Object;JJ)V") \
   V(JdkUnsafePutLongOrdered, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "putOrderedLong", "(Ljava/lang/Object;JJ)V") \
   V(JdkUnsafePutLongVolatile, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "putLongVolatile", "(Ljava/lang/Object;JJ)V") \
@@ -273,24 +285,23 @@
   V(JdkUnsafeGetAndAddLong, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getAndAddLong", "(Ljava/lang/Object;JJ)J") \
   V(JdkUnsafeGetAndSetInt, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getAndSetInt", "(Ljava/lang/Object;JI)I") \
   V(JdkUnsafeGetAndSetLong, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getAndSetLong", "(Ljava/lang/Object;JJ)J") \
-  V(JdkUnsafeGetAndSetObject, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getAndSetObject", "(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;") \
-  V(JdkUnsafeLoadFence, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "loadFence", "()V") \
-  V(JdkUnsafeStoreFence, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "storeFence", "()V") \
-  V(JdkUnsafeFullFence, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "fullFence", "()V") \
+  V(JdkUnsafeGetAndSetReference, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljdk/internal/misc/Unsafe;", "getAndSetReference", "(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;") \
   V(ReferenceGetReferent, kDirect, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljava/lang/ref/Reference;", "getReferent", "()Ljava/lang/Object;") \
   V(ReferenceRefersTo, kVirtual, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljava/lang/ref/Reference;", "refersTo", "(Ljava/lang/Object;)Z") \
-  V(IntegerValueOf, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "valueOf", "(I)Ljava/lang/Integer;") \
   V(ThreadInterrupted, kStatic, kNeedsEnvironment, kAllSideEffects, kNoThrow, "Ljava/lang/Thread;", "interrupted", "()Z") \
-  V(VarHandleFullFence, kStatic, kNeedsEnvironment, kWriteSideEffects, kNoThrow, "Ljava/lang/invoke/VarHandle;", "fullFence", "()V") \
-  V(VarHandleAcquireFence, kStatic, kNeedsEnvironment, kWriteSideEffects, kNoThrow, "Ljava/lang/invoke/VarHandle;", "acquireFence", "()V") \
-  V(VarHandleReleaseFence, kStatic, kNeedsEnvironment, kWriteSideEffects, kNoThrow, "Ljava/lang/invoke/VarHandle;", "releaseFence", "()V") \
-  V(VarHandleLoadLoadFence, kStatic, kNeedsEnvironment, kWriteSideEffects, kNoThrow, "Ljava/lang/invoke/VarHandle;", "loadLoadFence", "()V") \
-  V(VarHandleStoreStoreFence, kStatic, kNeedsEnvironment, kReadSideEffects, kNoThrow, "Ljava/lang/invoke/VarHandle;", "storeStoreFence", "()V") \
   V(ReachabilityFence, kStatic, kNeedsEnvironment, kWriteSideEffects, kNoThrow, "Ljava/lang/ref/Reference;", "reachabilityFence", "(Ljava/lang/Object;)V") \
   V(CRC32Update, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/util/zip/CRC32;", "update", "(II)I") \
   V(CRC32UpdateBytes, kStatic, kNeedsEnvironment, kReadSideEffects, kCanThrow, "Ljava/util/zip/CRC32;", "updateBytes", "(I[BII)I") \
   V(CRC32UpdateByteBuffer, kStatic, kNeedsEnvironment, kReadSideEffects, kNoThrow, "Ljava/util/zip/CRC32;", "updateByteBuffer", "(IJII)I") \
-  SIGNATURE_POLYMORPHIC_INTRINSICS_LIST(V)
+  V(ByteValueOf, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Byte;", "valueOf", "(B)Ljava/lang/Byte;") \
+  V(ShortValueOf, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Short;", "valueOf", "(S)Ljava/lang/Short;") \
+  V(CharacterValueOf, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Character;", "valueOf", "(C)Ljava/lang/Character;") \
+  V(IntegerValueOf, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Integer;", "valueOf", "(I)Ljava/lang/Integer;") \
+  ART_SIGNATURE_POLYMORPHIC_INTRINSICS_LIST(V)
+
+// The complete list of intrinsics.
+#define ART_INTRINSICS_LIST(V) \
+  ART_INTRINSICS_WITH_SPECIALIZED_HIR_LIST(V) \
+  ART_INTRINSICS_WITH_HINVOKE_LIST(V)
 
 #endif  // ART_RUNTIME_INTRINSICS_LIST_H_
-#undef ART_RUNTIME_INTRINSICS_LIST_H_   // #define is only for lint.
diff --git a/runtime/java_frame_root_info.cc b/runtime/java_frame_root_info.cc
index 9a0f184..b752211 100644
--- a/runtime/java_frame_root_info.cc
+++ b/runtime/java_frame_root_info.cc
@@ -18,7 +18,7 @@
 
 #include "stack.h"
 
-namespace art {
+namespace art HIDDEN {
 
 void JavaFrameRootInfo::Describe(std::ostream& os) const {
   const StackVisitor* visitor = stack_visitor_;
diff --git a/runtime/java_frame_root_info.h b/runtime/java_frame_root_info.h
index c2b4493..8850009 100644
--- a/runtime/java_frame_root_info.h
+++ b/runtime/java_frame_root_info.h
@@ -24,7 +24,7 @@
 #include "base/macros.h"
 #include "gc_root.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class StackVisitor;
 
diff --git a/runtime/javaheapprof/javaheapsampler.cc b/runtime/javaheapprof/javaheapsampler.cc
index 7467134..959934b 100644
--- a/runtime/javaheapprof/javaheapsampler.cc
+++ b/runtime/javaheapprof/javaheapsampler.cc
@@ -23,7 +23,7 @@
 #endif
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 
 size_t HeapSampler::NextGeoDistRandSample() {
   // Make sure that rng_ and geo_dist are thread safe by acquiring a lock to access.
diff --git a/runtime/javaheapprof/javaheapsampler.h b/runtime/javaheapprof/javaheapsampler.h
index 4151472..b7742c0 100644
--- a/runtime/javaheapprof/javaheapsampler.h
+++ b/runtime/javaheapprof/javaheapsampler.h
@@ -22,7 +22,7 @@
 #include "base/mutex.h"
 #include "mirror/object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class HeapSampler {
  public:
diff --git a/runtime/jdwp_provider.h b/runtime/jdwp_provider.h
index c7711ec..6ae3ce2 100644
--- a/runtime/jdwp_provider.h
+++ b/runtime/jdwp_provider.h
@@ -19,9 +19,10 @@
 
 #include <ios>
 
+#include "base/macros.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 
 enum class JdwpProvider {
   kNone,
diff --git a/runtime/jit/debugger_interface.cc b/runtime/jit/debugger_interface.cc
index 986003b..8c9fb4c 100644
--- a/runtime/jit/debugger_interface.cc
+++ b/runtime/jit/debugger_interface.cc
@@ -93,7 +93,7 @@
 //     attempting to run TSAN on this code.
 //
 
-namespace art {
+namespace art HIDDEN {
 
 static Mutex g_jit_debug_lock("JIT native debug entries", kNativeDebugInterfaceLock);
 static Mutex g_dex_debug_lock("DEX native debug entries", kNativeDebugInterfaceLock);
@@ -108,8 +108,11 @@
 // Automatically call the repack method every 'n' new entries.
 constexpr uint32_t kJitRepackFrequency = 64;
 
+}  // namespace art
+
 // Public binary interface between ART and native tools (gdb, libunwind, etc).
 // The fields below need to be exported and have special names as per the gdb api.
+namespace art EXPORT {
 extern "C" {
   enum JITAction {
     JIT_NOACTION = 0,
@@ -198,6 +201,9 @@
   void (*__dex_debug_register_code_ptr)() = __dex_debug_register_code;
   JITDescriptor __dex_debug_descriptor GUARDED_BY(g_dex_debug_lock) {};
 }
+}  // namespace art
+
+namespace art HIDDEN {
 
 // The fields below are internal, but we keep them here anyway for consistency.
 // Their state is related to the static state above and it must be kept in sync.
@@ -410,9 +416,13 @@
 void AddNativeDebugInfoForDex(Thread* self, const DexFile* dexfile) {
   MutexLock mu(self, g_dex_debug_lock);
   DCHECK(dexfile != nullptr);
-  // Compact dex files may store data past the size defined in the header.
-  const DexFile::Header& header = dexfile->GetHeader();
-  uint32_t size = std::max(header.file_size_, header.data_off_ + header.data_size_);
+  // Container dex files (v41) may store data past the size defined in the header.
+  uint32_t size = dexfile->SizeIncludingSharedData();
+  if (dexfile->IsCompactDexFile()) {
+    // Compact dex files may store data past the size defined in the header.
+    const DexFile::Header& header = dexfile->GetHeader();
+    size = std::max(size, header.data_off_ + header.data_size_);
+  }
   const ArrayRef<const uint8_t> symfile(dexfile->Begin(), size);
   CreateJITCodeEntryInternal<DexNativeInfo>(symfile);
 }
@@ -588,10 +598,13 @@
                                             /*allow_packing=*/ allow_packing,
                                             /*is_compressed=*/ false);
 
-  VLOG(jit)
-      << "JIT mini-debug-info added"
-      << " for " << code_ptr
-      << " size=" << PrettySize(symfile.size());
+  if (code_ptr == nullptr) {
+    VLOG(jit) << "JIT mini-debug-info added for new type, size=" << PrettySize(symfile.size());
+  } else {
+    VLOG(jit)
+        << "JIT mini-debug-info added for native code at " << code_ptr
+        << ", size=" << PrettySize(symfile.size());
+  }
 
   // Automatically repack entries on regular basis to save space.
   // Pack (but don't compress) recent entries - this is cheap and reduces memory use by ~4x.
diff --git a/runtime/jit/debugger_interface.h b/runtime/jit/debugger_interface.h
index 62288de..da7e907 100644
--- a/runtime/jit/debugger_interface.h
+++ b/runtime/jit/debugger_interface.h
@@ -25,7 +25,7 @@
 #include "base/array_ref.h"
 #include "base/locks.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class DexFile;
 class Mutex;
@@ -70,7 +70,7 @@
 // Get the lock which protects the native debug info.
 // Used only in tests to unwind while the JIT thread is running.
 // TODO: Unwinding should be race-free. Remove this.
-Mutex* GetNativeDebugInfoLock();
+EXPORT Mutex* GetNativeDebugInfoLock();
 
 // Call given callback for every non-zygote symbol.
 // The callback parameters are (address, size, name).
diff --git a/runtime/jit/jit-inl.h b/runtime/jit/jit-inl.h
index 237f63c..52099c2 100644
--- a/runtime/jit/jit-inl.h
+++ b/runtime/jit/jit-inl.h
@@ -24,7 +24,7 @@
 #include "thread.h"
 #include "runtime-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace jit {
 
 inline void Jit::AddSamples(Thread* self, ArtMethod* method) {
diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc
index 3472c78..54a56f2 100644
--- a/runtime/jit/jit.cc
+++ b/runtime/jit/jit.cc
@@ -31,134 +31,40 @@
 #include "compilation_kind.h"
 #include "debugger.h"
 #include "dex/type_lookup_table.h"
-#include "gc/space/image_space.h"
 #include "entrypoints/entrypoint_utils-inl.h"
 #include "entrypoints/runtime_asm_entrypoints.h"
-#include "image-inl.h"
+#include "gc/space/image_space.h"
 #include "interpreter/interpreter.h"
 #include "jit-inl.h"
 #include "jit_code_cache.h"
+#include "jit_create.h"
 #include "jni/java_vm_ext.h"
 #include "mirror/method_handle_impl.h"
 #include "mirror/var_handle.h"
-#include "oat_file.h"
-#include "oat_file_manager.h"
-#include "oat_quick_method_header.h"
+#include "oat/image-inl.h"
+#include "oat/oat_file.h"
+#include "oat/oat_file_manager.h"
+#include "oat/oat_quick_method_header.h"
+#include "oat/stack_map.h"
 #include "profile/profile_boot_info.h"
 #include "profile/profile_compilation_info.h"
 #include "profile_saver.h"
 #include "runtime.h"
 #include "runtime_options.h"
+#include "small_pattern_matcher.h"
 #include "stack.h"
-#include "stack_map.h"
 #include "thread-inl.h"
 #include "thread_list.h"
 
 using android::base::unique_fd;
 
-namespace art {
+namespace art HIDDEN {
 namespace jit {
 
 static constexpr bool kEnableOnStackReplacement = true;
 
-// Maximum permitted threshold value.
-static constexpr uint32_t kJitMaxThreshold = std::numeric_limits<uint16_t>::max();
-
-static constexpr uint32_t kJitDefaultOptimizeThreshold = 0xffff;
-// Different optimization threshold constants. These default to the equivalent optimization
-// thresholds divided by 2, but can be overridden at the command-line.
-static constexpr uint32_t kJitStressDefaultOptimizeThreshold = kJitDefaultOptimizeThreshold / 2;
-static constexpr uint32_t kJitSlowStressDefaultOptimizeThreshold =
-    kJitStressDefaultOptimizeThreshold / 2;
-
-static constexpr uint32_t kJitDefaultWarmupThreshold = 0x3fff;
-// Different warm-up threshold constants. These default to the equivalent warmup thresholds divided
-// by 2, but can be overridden at the command-line.
-static constexpr uint32_t kJitStressDefaultWarmupThreshold = kJitDefaultWarmupThreshold / 2;
-static constexpr uint32_t kJitSlowStressDefaultWarmupThreshold =
-    kJitStressDefaultWarmupThreshold / 2;
-
-DEFINE_RUNTIME_DEBUG_FLAG(Jit, kSlowMode);
-
 // JIT compiler
-void* Jit::jit_library_handle_ = nullptr;
 JitCompilerInterface* Jit::jit_compiler_ = nullptr;
-JitCompilerInterface* (*Jit::jit_load_)(void) = nullptr;
-
-JitOptions* JitOptions::CreateFromRuntimeArguments(const RuntimeArgumentMap& options) {
-  auto* jit_options = new JitOptions;
-  jit_options->use_jit_compilation_ = options.GetOrDefault(RuntimeArgumentMap::UseJitCompilation);
-  jit_options->use_profiled_jit_compilation_ =
-      options.GetOrDefault(RuntimeArgumentMap::UseProfiledJitCompilation);
-
-  jit_options->code_cache_initial_capacity_ =
-      options.GetOrDefault(RuntimeArgumentMap::JITCodeCacheInitialCapacity);
-  jit_options->code_cache_max_capacity_ =
-      options.GetOrDefault(RuntimeArgumentMap::JITCodeCacheMaxCapacity);
-  jit_options->dump_info_on_shutdown_ =
-      options.Exists(RuntimeArgumentMap::DumpJITInfoOnShutdown);
-  jit_options->profile_saver_options_ =
-      options.GetOrDefault(RuntimeArgumentMap::ProfileSaverOpts);
-  jit_options->thread_pool_pthread_priority_ =
-      options.GetOrDefault(RuntimeArgumentMap::JITPoolThreadPthreadPriority);
-  jit_options->zygote_thread_pool_pthread_priority_ =
-      options.GetOrDefault(RuntimeArgumentMap::JITZygotePoolThreadPthreadPriority);
-
-  // Set default optimize threshold to aid with checking defaults.
-  jit_options->optimize_threshold_ =
-      kIsDebugBuild
-      ? (Jit::kSlowMode
-         ? kJitSlowStressDefaultOptimizeThreshold
-         : kJitStressDefaultOptimizeThreshold)
-      : kJitDefaultOptimizeThreshold;
-
-  // Set default warm-up threshold to aid with checking defaults.
-  jit_options->warmup_threshold_ =
-      kIsDebugBuild ? (Jit::kSlowMode
-                       ? kJitSlowStressDefaultWarmupThreshold
-                       : kJitStressDefaultWarmupThreshold)
-      : kJitDefaultWarmupThreshold;
-
-  if (options.Exists(RuntimeArgumentMap::JITOptimizeThreshold)) {
-    jit_options->optimize_threshold_ = *options.Get(RuntimeArgumentMap::JITOptimizeThreshold);
-  }
-  DCHECK_LE(jit_options->optimize_threshold_, kJitMaxThreshold);
-
-  if (options.Exists(RuntimeArgumentMap::JITWarmupThreshold)) {
-    jit_options->warmup_threshold_ = *options.Get(RuntimeArgumentMap::JITWarmupThreshold);
-  }
-  DCHECK_LE(jit_options->warmup_threshold_, kJitMaxThreshold);
-
-  if (options.Exists(RuntimeArgumentMap::JITPriorityThreadWeight)) {
-    jit_options->priority_thread_weight_ =
-        *options.Get(RuntimeArgumentMap::JITPriorityThreadWeight);
-    if (jit_options->priority_thread_weight_ > jit_options->warmup_threshold_) {
-      LOG(FATAL) << "Priority thread weight is above the warmup threshold.";
-    } else if (jit_options->priority_thread_weight_ == 0) {
-      LOG(FATAL) << "Priority thread weight cannot be 0.";
-    }
-  } else {
-    jit_options->priority_thread_weight_ = std::max(
-        jit_options->warmup_threshold_ / Jit::kDefaultPriorityThreadWeightRatio,
-        static_cast<size_t>(1));
-  }
-
-  if (options.Exists(RuntimeArgumentMap::JITInvokeTransitionWeight)) {
-    jit_options->invoke_transition_weight_ =
-        *options.Get(RuntimeArgumentMap::JITInvokeTransitionWeight);
-    if (jit_options->invoke_transition_weight_ > jit_options->warmup_threshold_) {
-      LOG(FATAL) << "Invoke transition weight is above the warmup threshold.";
-    } else if (jit_options->invoke_transition_weight_  == 0) {
-      LOG(FATAL) << "Invoke transition weight cannot be 0.";
-    }
-  } else {
-    jit_options->invoke_transition_weight_ = std::max(
-        jit_options->warmup_threshold_ / Jit::kDefaultInvokeTransitionWeightRatio,
-        static_cast<size_t>(1));
-  }
-
-  return jit_options;
-}
 
 void Jit::DumpInfo(std::ostream& os) {
   code_cache_->Dump(os);
@@ -187,16 +93,8 @@
       fd_methods_(-1),
       fd_methods_size_(0) {}
 
-Jit* Jit::Create(JitCodeCache* code_cache, JitOptions* options) {
-  if (jit_load_ == nullptr) {
-    LOG(WARNING) << "Not creating JIT: library not loaded";
-    return nullptr;
-  }
-  jit_compiler_ = (jit_load_)();
-  if (jit_compiler_ == nullptr) {
-    LOG(WARNING) << "Not creating JIT: failed to allocate a compiler";
-    return nullptr;
-  }
+std::unique_ptr<Jit> Jit::Create(JitCodeCache* code_cache, JitOptions* options) {
+  jit_compiler_ = jit_create();
   std::unique_ptr<Jit> jit(new Jit(code_cache, options));
 
   // If the code collector is enabled, check if that still holds:
@@ -229,43 +127,33 @@
 
   // Notify native debugger about the classes already loaded before the creation of the jit.
   jit->DumpTypeInfoForLoadedTypes(Runtime::Current()->GetClassLinker());
-  return jit.release();
+
+  return jit;
 }
 
-template <typename T>
-bool Jit::LoadSymbol(T* address, const char* name, std::string* error_msg) {
-  *address = reinterpret_cast<T>(dlsym(jit_library_handle_, name));
-  if (*address == nullptr) {
-    *error_msg = std::string("JIT couldn't find ") + name + std::string(" entry point");
-    return false;
-  }
-  return true;
-}
 
-bool Jit::LoadCompilerLibrary(std::string* error_msg) {
-  jit_library_handle_ = dlopen(
-      kIsDebugBuild ? "libartd-compiler.so" : "libart-compiler.so", RTLD_NOW);
-  if (jit_library_handle_ == nullptr) {
-    std::ostringstream oss;
-    oss << "JIT could not load libart-compiler.so: " << dlerror();
-    *error_msg = oss.str();
-    return false;
+bool Jit::TryPatternMatch(ArtMethod* method_to_compile, CompilationKind compilation_kind) {
+  // Try to pattern match the method. Only on arm and arm64 for now as we have
+  // sufficiently similar calling convention between C++ and managed code.
+  if (kRuntimeISA == InstructionSet::kArm || kRuntimeISA == InstructionSet::kArm64) {
+    if (!Runtime::Current()->IsJavaDebuggable() &&
+        compilation_kind == CompilationKind::kBaseline &&
+        !method_to_compile->StillNeedsClinitCheck()) {
+      const void* pattern = SmallPatternMatcher::TryMatch(method_to_compile);
+      if (pattern != nullptr) {
+        VLOG(jit) << "Successfully pattern matched " << method_to_compile->PrettyMethod();
+        Runtime::Current()->GetInstrumentation()->UpdateMethodsCode(method_to_compile, pattern);
+        return true;
+      }
+    }
   }
-  if (!LoadSymbol(&jit_load_, "jit_load", error_msg)) {
-    dlclose(jit_library_handle_);
-    return false;
-  }
-  return true;
+  return false;
 }
 
 bool Jit::CompileMethodInternal(ArtMethod* method,
                                 Thread* self,
                                 CompilationKind compilation_kind,
                                 bool prejit) {
-  if (kIsDebugBuild) {
-    MutexLock mu(self, *Locks::jit_lock_);
-    CHECK(GetCodeCache()->IsMethodBeingCompiled(method, compilation_kind));
-  }
   DCHECK(Runtime::Current()->UseJitCompilation());
   DCHECK(!method->IsRuntimeMethod());
 
@@ -317,6 +205,11 @@
   // If we get a request to compile a proxy method, we pass the actual Java method
   // of that proxy method, as the compiler does not expect a proxy method.
   ArtMethod* method_to_compile = method->GetInterfaceMethodIfProxy(kRuntimePointerSize);
+
+  if (TryPatternMatch(method_to_compile, compilation_kind)) {
+    return true;
+  }
+
   if (!code_cache_->NotifyCompilationOf(method_to_compile, self, compilation_kind, prejit)) {
     return false;
   }
@@ -352,7 +245,7 @@
 void Jit::DeleteThreadPool() {
   Thread* self = Thread::Current();
   if (thread_pool_ != nullptr) {
-    std::unique_ptr<ThreadPool> pool;
+    std::unique_ptr<JitThreadPool> pool;
     {
       ScopedSuspendAll ssa(__FUNCTION__);
       // Clear thread_pool_ field while the threads are suspended.
@@ -409,10 +302,6 @@
     delete jit_compiler_;
     jit_compiler_ = nullptr;
   }
-  if (jit_library_handle_ != nullptr) {
-    dlclose(jit_library_handle_);
-    jit_library_handle_ = nullptr;
-  }
 }
 
 void Jit::NewTypeLoadedIfUsingJit(mirror::Class* type) {
@@ -633,9 +522,9 @@
     // within a page range. For methods that falls above or below the range,
     // the child processes will copy their contents to their private mapping
     // in `child_mapping_methods`. See `MapBootImageMethods`.
-    uint8_t* page_start = AlignUp(header.GetImageBegin() + section.Offset(), kPageSize);
+    uint8_t* page_start = AlignUp(header.GetImageBegin() + section.Offset(), gPageSize);
     uint8_t* page_end =
-        AlignDown(header.GetImageBegin() + section.Offset() + section.Size(), kPageSize);
+        AlignDown(header.GetImageBegin() + section.Offset() + section.Size(), gPageSize);
     if (page_end > page_start) {
       uint64_t capacity = page_end - page_start;
       memcpy(zygote_mapping_methods_.Begin() + offset, page_start, capacity);
@@ -692,9 +581,9 @@
     // within a page range. For methods that falls above or below the range,
     // the child processes will copy their contents to their private mapping
     // in `child_mapping_methods`. See `MapBootImageMethods`.
-    uint8_t* page_start = AlignUp(header.GetImageBegin() + section.Offset(), kPageSize);
+    uint8_t* page_start = AlignUp(header.GetImageBegin() + section.Offset(), gPageSize);
     uint8_t* page_end =
-        AlignDown(header.GetImageBegin() + section.Offset() + section.Size(), kPageSize);
+        AlignDown(header.GetImageBegin() + section.Offset() + section.Size(), gPageSize);
     if (page_end > page_start) {
       uint64_t capacity = page_end - page_start;
       if (memcmp(child_mapping_methods.Begin() + offset, page_start, capacity) != 0) {
@@ -720,9 +609,9 @@
     // within a page range. For methods that falls above or below the range,
     // the child processes will copy their contents to their private mapping
     // in `child_mapping_methods`. See `MapBootImageMethods`.
-    uint8_t* page_start = AlignUp(header.GetImageBegin() + section.Offset(), kPageSize);
+    uint8_t* page_start = AlignUp(header.GetImageBegin() + section.Offset(), gPageSize);
     uint8_t* page_end =
-        AlignDown(header.GetImageBegin() + section.Offset() + section.Size(), kPageSize);
+        AlignDown(header.GetImageBegin() + section.Offset() + section.Size(), gPageSize);
     if (page_end > page_start) {
       uint64_t capacity = page_end - page_start;
       if (mremap(child_mapping_methods.Begin() + offset,
@@ -749,51 +638,6 @@
   child_mapping_methods.Reset();
 }
 
-class ScopedCompilation {
- public:
-  ScopedCompilation(ScopedCompilation&& other) noexcept :
-      jit_(other.jit_),
-      method_(other.method_),
-      compilation_kind_(other.compilation_kind_),
-      owns_compilation_(other.owns_compilation_) {
-    other.owns_compilation_ = false;
-  }
-
-  ScopedCompilation(Jit* jit, ArtMethod* method, CompilationKind compilation_kind)
-      : jit_(jit),
-        method_(method),
-        compilation_kind_(compilation_kind),
-        owns_compilation_(true) {
-    MutexLock mu(Thread::Current(), *Locks::jit_lock_);
-    // We don't want to enqueue any new tasks when thread pool has stopped. This simplifies
-    // the implementation of redefinition feature in jvmti.
-    if (jit_->GetThreadPool() == nullptr ||
-        !jit_->GetThreadPool()->HasStarted(Thread::Current()) ||
-        jit_->GetCodeCache()->IsMethodBeingCompiled(method_, compilation_kind_)) {
-      owns_compilation_ = false;
-      return;
-    }
-    jit_->GetCodeCache()->AddMethodBeingCompiled(method_, compilation_kind_);
-  }
-
-  bool OwnsCompilation() const {
-    return owns_compilation_;
-  }
-
-  ~ScopedCompilation() {
-    if (owns_compilation_) {
-      MutexLock mu(Thread::Current(), *Locks::jit_lock_);
-      jit_->GetCodeCache()->RemoveMethodBeingCompiled(method_, compilation_kind_);
-    }
-  }
-
- private:
-  Jit* const jit_;
-  ArtMethod* const method_;
-  const CompilationKind compilation_kind_;
-  bool owns_compilation_;
-};
-
 class JitCompileTask final : public Task {
  public:
   enum class TaskKind {
@@ -803,14 +647,10 @@
 
   JitCompileTask(ArtMethod* method,
                  TaskKind task_kind,
-                 CompilationKind compilation_kind,
-                 ScopedCompilation&& sc)
+                 CompilationKind compilation_kind)
       : method_(method),
         kind_(task_kind),
-        compilation_kind_(compilation_kind),
-        scoped_compilation_(std::move(sc)) {
-    DCHECK(scoped_compilation_.OwnsCompilation());
-    DCHECK(!sc.OwnsCompilation());
+        compilation_kind_(compilation_kind) {
   }
 
   void Run(Thread* self) override {
@@ -832,14 +672,25 @@
   }
 
   void Finalize() override {
+    JitThreadPool* thread_pool = Runtime::Current()->GetJit()->GetThreadPool();
+    if (thread_pool != nullptr) {
+      thread_pool->Remove(this);
+    }
     delete this;
   }
 
+  ArtMethod* GetArtMethod() const {
+    return method_;
+  }
+
+  CompilationKind GetCompilationKind() const {
+    return compilation_kind_;
+  }
+
  private:
   ArtMethod* const method_;
   const TaskKind kind_;
   const CompilationKind compilation_kind_;
-  ScopedCompilation scoped_compilation_;
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(JitCompileTask);
 };
@@ -866,12 +717,12 @@
   explicit JitDoneCompilingProfileTask(const std::vector<const DexFile*>& dex_files)
       : dex_files_(dex_files) {}
 
-  void Run(Thread* self ATTRIBUTE_UNUSED) override {
+  void Run([[maybe_unused]] Thread* self) override {
     // Madvise DONTNEED dex files now that we're done compiling methods.
     for (const DexFile* dex_file : dex_files_) {
       if (IsAddressKnownBackedByFileOrShared(dex_file->Begin())) {
-        int result = madvise(const_cast<uint8_t*>(AlignDown(dex_file->Begin(), kPageSize)),
-                             RoundUp(dex_file->Size(), kPageSize),
+        int result = madvise(const_cast<uint8_t*>(AlignDown(dex_file->Begin(), gPageSize)),
+                             RoundUp(dex_file->Size(), gPageSize),
                              MADV_DONTNEED);
         if (result == -1) {
           PLOG(WARNING) << "Madvise failed";
@@ -890,7 +741,7 @@
  public:
   JitZygoteDoneCompilingTask() {}
 
-  void Run(Thread* self ATTRIBUTE_UNUSED) override {
+  void Run([[maybe_unused]] Thread* self) override {
     DCHECK(Runtime::Current()->IsZygote());
     Runtime::Current()->GetJit()->GetCodeCache()->GetZygoteMap()->SetCompilationState(
         ZygoteCompilationState::kDone);
@@ -1122,9 +973,9 @@
   for (gc::space::ImageSpace* space : Runtime::Current()->GetHeap()->GetBootImageSpaces()) {
     const ImageHeader& header = space->GetImageHeader();
     const ImageSection& section = header.GetMethodsSection();
-    uint8_t* page_start = AlignUp(header.GetImageBegin() + section.Offset(), kPageSize);
+    uint8_t* page_start = AlignUp(header.GetImageBegin() + section.Offset(), gPageSize);
     uint8_t* page_end =
-        AlignDown(header.GetImageBegin() + section.Offset() + section.Size(), kPageSize);
+        AlignDown(header.GetImageBegin() + section.Offset() + section.Size(), gPageSize);
     if (page_end <= page_start) {
       // Section doesn't contain one aligned entire page.
       continue;
@@ -1201,9 +1052,7 @@
   // There is a DCHECK in the 'AddSamples' method to ensure the tread pool
   // is not null when we instrument.
 
-  // We need peers as we may report the JIT thread, e.g., in the debugger.
-  constexpr bool kJitPoolNeedsPeers = true;
-  thread_pool_.reset(new ThreadPool("Jit thread pool", 1, kJitPoolNeedsPeers));
+  thread_pool_.reset(JitThreadPool::Create("Jit thread pool", 1));
 
   Runtime* runtime = Runtime::Current();
   thread_pool_->SetPthreadPriority(
@@ -1243,9 +1092,9 @@
       const ImageHeader& header = space->GetImageHeader();
       const ImageSection& section = header.GetMethodsSection();
       // Mappings need to be at the page level.
-      uint8_t* page_start = AlignUp(header.GetImageBegin() + section.Offset(), kPageSize);
+      uint8_t* page_start = AlignUp(header.GetImageBegin() + section.Offset(), gPageSize);
       uint8_t* page_end =
-          AlignDown(header.GetImageBegin() + section.Offset() + section.Size(), kPageSize);
+          AlignDown(header.GetImageBegin() + section.Offset() + section.Size(), gPageSize);
       if (page_end > page_start) {
         total_capacity += (page_end - page_start);
       }
@@ -1332,17 +1181,8 @@
 
 void Jit::AddCompileTask(Thread* self,
                          ArtMethod* method,
-                         CompilationKind compilation_kind,
-                         bool precompile) {
-  ScopedCompilation sc(this, method, compilation_kind);
-  if (!sc.OwnsCompilation()) {
-    return;
-  }
-  JitCompileTask::TaskKind task_kind = precompile
-      ? JitCompileTask::TaskKind::kPreCompile
-      : JitCompileTask::TaskKind::kCompile;
-  thread_pool_->AddTask(
-      self, new JitCompileTask(method, task_kind, compilation_kind, std::move(sc)));
+                         CompilationKind compilation_kind) {
+  thread_pool_->AddTask(self, method, compilation_kind);
 }
 
 bool Jit::CompileMethodFromProfile(Thread* self,
@@ -1377,15 +1217,11 @@
     VLOG(jit) << "JIT Zygote processing method " << ArtMethod::PrettyMethod(method)
               << " from profile";
     method->SetPreCompiled();
-    ScopedCompilation sc(this, method, compilation_kind);
-    if (!sc.OwnsCompilation()) {
-      return false;
-    }
     if (!add_to_queue) {
       CompileMethodInternal(method, self, compilation_kind, /* prejit= */ true);
     } else {
       Task* task = new JitCompileTask(
-          method, JitCompileTask::TaskKind::kPreCompile, compilation_kind, std::move(sc));
+          method, JitCompileTask::TaskKind::kPreCompile, compilation_kind);
       if (compile_after_boot) {
         AddPostBootTask(self, task);
       } else {
@@ -1525,9 +1361,7 @@
 }
 
 void Jit::EnqueueOptimizedCompilation(ArtMethod* method, Thread* self) {
-  // Reset the hotness counter so the baseline compiled code doesn't call this
-  // method repeatedly.
-  GetCodeCache()->ResetHotnessCounter(method, self);
+  // Note the hotness counter will be reset by the compiled code.
 
   if (thread_pool_ == nullptr) {
     return;
@@ -1838,11 +1672,6 @@
                         Thread* self,
                         CompilationKind compilation_kind,
                         bool prejit) {
-  ScopedCompilation sc(this, method, compilation_kind);
-  // TODO: all current users of this method expect us to wait if it is being compiled.
-  if (!sc.OwnsCompilation()) {
-    return false;
-  }
   // Fake being in a runtime thread so that class-load behavior will be the same as normal jit.
   ScopedSetRuntimeThread ssrt(self);
   // TODO(ngeoffray): For JIT at first use, use kPreCompile. Currently we don't due to
@@ -1850,5 +1679,178 @@
   return CompileMethodInternal(method, self, compilation_kind, prejit);
 }
 
+size_t JitThreadPool::GetTaskCount(Thread* self) {
+  MutexLock mu(self, task_queue_lock_);
+  return generic_queue_.size() +
+      baseline_queue_.size() +
+      optimized_queue_.size() +
+      osr_queue_.size();
+}
+
+void JitThreadPool::RemoveAllTasks(Thread* self) {
+  // The ThreadPool is responsible for calling Finalize (which usually deletes
+  // the task memory) on all the tasks.
+  Task* task = nullptr;
+  do {
+    {
+      MutexLock mu(self, task_queue_lock_);
+      if (generic_queue_.empty()) {
+        break;
+      }
+      task = generic_queue_.front();
+      generic_queue_.pop_front();
+    }
+    task->Finalize();
+  } while (true);
+
+  MutexLock mu(self, task_queue_lock_);
+  baseline_queue_.clear();
+  optimized_queue_.clear();
+  osr_queue_.clear();
+}
+
+JitThreadPool::~JitThreadPool() {
+  DeleteThreads();
+  RemoveAllTasks(Thread::Current());
+}
+
+void JitThreadPool::AddTask(Thread* self, Task* task) {
+  MutexLock mu(self, task_queue_lock_);
+  // We don't want to enqueue any new tasks when thread pool has stopped. This simplifies
+  // the implementation of redefinition feature in jvmti.
+  if (!started_) {
+    task->Finalize();
+    return;
+  }
+  generic_queue_.push_back(task);
+  // If we have any waiters, signal one.
+  if (waiting_count_ != 0) {
+    task_queue_condition_.Signal(self);
+  }
+}
+
+void JitThreadPool::AddTask(Thread* self, ArtMethod* method, CompilationKind kind) {
+  MutexLock mu(self, task_queue_lock_);
+  // We don't want to enqueue any new tasks when thread pool has stopped. This simplifies
+  // the implementation of redefinition feature in jvmti.
+  if (!started_) {
+    return;
+  }
+  switch (kind) {
+    case CompilationKind::kOsr:
+      if (ContainsElement(osr_enqueued_methods_, method)) {
+        return;
+      }
+      osr_enqueued_methods_.insert(method);
+      osr_queue_.push_back(method);
+      break;
+    case CompilationKind::kBaseline:
+      if (ContainsElement(baseline_enqueued_methods_, method)) {
+        return;
+      }
+      baseline_enqueued_methods_.insert(method);
+      baseline_queue_.push_back(method);
+      break;
+    case CompilationKind::kOptimized:
+      if (ContainsElement(optimized_enqueued_methods_, method)) {
+        return;
+      }
+      optimized_enqueued_methods_.insert(method);
+      optimized_queue_.push_back(method);
+      break;
+  }
+  // If we have any waiters, signal one.
+  if (waiting_count_ != 0) {
+    task_queue_condition_.Signal(self);
+  }
+}
+
+Task* JitThreadPool::TryGetTaskLocked() {
+  if (!started_) {
+    return nullptr;
+  }
+
+  // Fetch generic tasks first.
+  if (!generic_queue_.empty()) {
+    Task* task = generic_queue_.front();
+    generic_queue_.pop_front();
+    return task;
+  }
+
+  // OSR requests second, then baseline and finally optimized.
+  Task* task = FetchFrom(osr_queue_, CompilationKind::kOsr);
+  if (task == nullptr) {
+    task = FetchFrom(baseline_queue_, CompilationKind::kBaseline);
+    if (task == nullptr) {
+      task = FetchFrom(optimized_queue_, CompilationKind::kOptimized);
+    }
+  }
+  return task;
+}
+
+Task* JitThreadPool::FetchFrom(std::deque<ArtMethod*>& methods, CompilationKind kind) {
+  if (!methods.empty()) {
+    ArtMethod* method = methods.front();
+    methods.pop_front();
+    JitCompileTask* task = new JitCompileTask(method, JitCompileTask::TaskKind::kCompile, kind);
+    current_compilations_.insert(task);
+    return task;
+  }
+  return nullptr;
+}
+
+void JitThreadPool::Remove(JitCompileTask* task) {
+  MutexLock mu(Thread::Current(), task_queue_lock_);
+  current_compilations_.erase(task);
+  switch (task->GetCompilationKind()) {
+    case CompilationKind::kOsr: {
+      osr_enqueued_methods_.erase(task->GetArtMethod());
+      break;
+    }
+    case CompilationKind::kBaseline: {
+      baseline_enqueued_methods_.erase(task->GetArtMethod());
+      break;
+    }
+    case CompilationKind::kOptimized: {
+      optimized_enqueued_methods_.erase(task->GetArtMethod());
+      break;
+    }
+  }
+}
+
+void Jit::VisitRoots(RootVisitor* visitor) {
+  if (thread_pool_ != nullptr) {
+    thread_pool_->VisitRoots(visitor);
+  }
+}
+
+void JitThreadPool::VisitRoots(RootVisitor* visitor) {
+  if (Runtime::Current()->GetHeap()->IsPerformingUffdCompaction()) {
+    // In case of userfaultfd compaction, ArtMethods are updated concurrently
+    // via linear-alloc.
+    return;
+  }
+  // Fetch all ArtMethod first, to avoid holding `task_queue_lock_` for too
+  // long.
+  std::vector<ArtMethod*> methods;
+  {
+    MutexLock mu(Thread::Current(), task_queue_lock_);
+    // We don't look at `generic_queue_` because it contains:
+    // - Generic tasks like `ZygoteVerificationTask` which don't hold any root.
+    // - `JitCompileTask` for precompiled methods, which we know are live, being
+    //   part of the boot classpath or system server classpath.
+    methods.insert(methods.end(), osr_queue_.begin(), osr_queue_.end());
+    methods.insert(methods.end(), baseline_queue_.begin(), baseline_queue_.end());
+    methods.insert(methods.end(), optimized_queue_.begin(), optimized_queue_.end());
+    for (JitCompileTask* task : current_compilations_) {
+      methods.push_back(task->GetArtMethod());
+    }
+  }
+  UnbufferedRootVisitor root_visitor(visitor, RootInfo(kRootStickyClass));
+  for (ArtMethod* method : methods) {
+    method->VisitRoots(root_visitor, kRuntimePointerSize);
+  }
+}
+
 }  // namespace jit
 }  // namespace art
diff --git a/runtime/jit/jit.h b/runtime/jit/jit.h
index c95fd9d..64b5222 100644
--- a/runtime/jit/jit.h
+++ b/runtime/jit/jit.h
@@ -17,28 +17,30 @@
 #ifndef ART_RUNTIME_JIT_JIT_H_
 #define ART_RUNTIME_JIT_JIT_H_
 
+#include <unordered_set>
+
 #include <android-base/unique_fd.h>
 
 #include "base/histogram-inl.h"
 #include "base/macros.h"
 #include "base/mutex.h"
-#include "base/runtime_debug.h"
 #include "base/timing_logger.h"
 #include "compilation_kind.h"
 #include "handle.h"
 #include "offsets.h"
 #include "interpreter/mterp/nterp.h"
 #include "jit/debugger_interface.h"
-#include "jit/profile_saver_options.h"
+#include "jit_options.h"
 #include "obj_ptr.h"
 #include "thread_pool.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtMethod;
 class ClassLinker;
 class DexFile;
 class OatDexFile;
+class RootVisitor;
 struct RuntimeArgumentMap;
 union JValue;
 
@@ -59,130 +61,6 @@
 
 static constexpr int16_t kJitCheckForOSR = -1;
 static constexpr int16_t kJitHotnessDisabled = -2;
-// At what priority to schedule jit threads. 9 is the lowest foreground priority on device.
-// See android/os/Process.java.
-static constexpr int kJitPoolThreadPthreadDefaultPriority = 9;
-// At what priority to schedule jit zygote threads compiling profiles in the background.
-// 19 is the lowest background priority on device.
-// See android/os/Process.java.
-static constexpr int kJitZygotePoolThreadPthreadDefaultPriority = 19;
-
-class JitOptions {
- public:
-  static JitOptions* CreateFromRuntimeArguments(const RuntimeArgumentMap& options);
-
-  uint16_t GetOptimizeThreshold() const {
-    return optimize_threshold_;
-  }
-
-  uint16_t GetWarmupThreshold() const {
-    return warmup_threshold_;
-  }
-
-  uint16_t GetPriorityThreadWeight() const {
-    return priority_thread_weight_;
-  }
-
-  uint16_t GetInvokeTransitionWeight() const {
-    return invoke_transition_weight_;
-  }
-
-  size_t GetCodeCacheInitialCapacity() const {
-    return code_cache_initial_capacity_;
-  }
-
-  size_t GetCodeCacheMaxCapacity() const {
-    return code_cache_max_capacity_;
-  }
-
-  bool DumpJitInfoOnShutdown() const {
-    return dump_info_on_shutdown_;
-  }
-
-  const ProfileSaverOptions& GetProfileSaverOptions() const {
-    return profile_saver_options_;
-  }
-
-  bool GetSaveProfilingInfo() const {
-    return profile_saver_options_.IsEnabled();
-  }
-
-  int GetThreadPoolPthreadPriority() const {
-    return thread_pool_pthread_priority_;
-  }
-
-  int GetZygoteThreadPoolPthreadPriority() const {
-    return zygote_thread_pool_pthread_priority_;
-  }
-
-  bool UseJitCompilation() const {
-    return use_jit_compilation_;
-  }
-
-  bool UseProfiledJitCompilation() const {
-    return use_profiled_jit_compilation_;
-  }
-
-  void SetUseJitCompilation(bool b) {
-    use_jit_compilation_ = b;
-  }
-
-  void SetSaveProfilingInfo(bool save_profiling_info) {
-    profile_saver_options_.SetEnabled(save_profiling_info);
-  }
-
-  void SetWaitForJitNotificationsToSaveProfile(bool value) {
-    profile_saver_options_.SetWaitForJitNotificationsToSave(value);
-  }
-
-  void SetJitAtFirstUse() {
-    use_jit_compilation_ = true;
-    optimize_threshold_ = 0;
-  }
-
-  void SetUseBaselineCompiler() {
-    use_baseline_compiler_ = true;
-  }
-
-  bool UseBaselineCompiler() const {
-    return use_baseline_compiler_;
-  }
-
- private:
-  // We add the sample in batches of size kJitSamplesBatchSize.
-  // This method rounds the threshold so that it is multiple of the batch size.
-  static uint32_t RoundUpThreshold(uint32_t threshold);
-
-  bool use_jit_compilation_;
-  bool use_profiled_jit_compilation_;
-  bool use_baseline_compiler_;
-  size_t code_cache_initial_capacity_;
-  size_t code_cache_max_capacity_;
-  uint32_t optimize_threshold_;
-  uint32_t warmup_threshold_;
-  uint16_t priority_thread_weight_;
-  uint16_t invoke_transition_weight_;
-  bool dump_info_on_shutdown_;
-  int thread_pool_pthread_priority_;
-  int zygote_thread_pool_pthread_priority_;
-  ProfileSaverOptions profile_saver_options_;
-
-  JitOptions()
-      : use_jit_compilation_(false),
-        use_profiled_jit_compilation_(false),
-        use_baseline_compiler_(false),
-        code_cache_initial_capacity_(0),
-        code_cache_max_capacity_(0),
-        optimize_threshold_(0),
-        warmup_threshold_(0),
-        priority_thread_weight_(0),
-        invoke_transition_weight_(0),
-        dump_info_on_shutdown_(false),
-        thread_pool_pthread_priority_(kJitPoolThreadPthreadDefaultPriority),
-        zygote_thread_pool_pthread_priority_(kJitZygotePoolThreadPthreadDefaultPriority) {}
-
-  DISALLOW_COPY_AND_ASSIGN(JitOptions);
-};
 
 // Implemented and provided by the compiler library.
 class JitCompilerInterface {
@@ -197,6 +75,7 @@
   virtual void ParseCompilerOptions() = 0;
   virtual bool IsBaselineCompiler() const = 0;
   virtual void SetDebuggableCompilerOption(bool value) = 0;
+  virtual uint32_t GetInlineMaxCodeUnits() const = 0;
 
   virtual std::vector<uint8_t> PackElfFileForJIT(ArrayRef<const JITCodeEntry*> elf_files,
                                                  ArrayRef<const void*> removed_symbols,
@@ -228,22 +107,93 @@
   }
 };
 
+/**
+ * A customized thread pool for the JIT, to prioritize compilation kinds, and
+ * simplify root visiting.
+ */
+class JitThreadPool : public AbstractThreadPool {
+ public:
+  static JitThreadPool* Create(const char* name,
+                               size_t num_threads,
+                               size_t worker_stack_size = ThreadPoolWorker::kDefaultStackSize) {
+    JitThreadPool* pool = new JitThreadPool(name, num_threads, worker_stack_size);
+    pool->CreateThreads();
+    return pool;
+  }
+
+  // Add a task to the generic queue. This is for tasks like
+  // ZygoteVerificationTask, or JitCompileTask for precompile.
+  void AddTask(Thread* self, Task* task) REQUIRES(!task_queue_lock_) override;
+  size_t GetTaskCount(Thread* self) REQUIRES(!task_queue_lock_) override;
+  void RemoveAllTasks(Thread* self) REQUIRES(!task_queue_lock_) override;
+  ~JitThreadPool() override;
+
+  // Remove the task from the list of compiling tasks.
+  void Remove(JitCompileTask* task) REQUIRES(!task_queue_lock_);
+
+  // Add a custom compilation task in the right queue.
+  void AddTask(Thread* self, ArtMethod* method, CompilationKind kind) REQUIRES(!task_queue_lock_);
+
+  // Visit the ArtMethods stored in the various queues.
+  void VisitRoots(RootVisitor* visitor);
+
+ protected:
+  Task* TryGetTaskLocked() REQUIRES(task_queue_lock_) override;
+
+  bool HasOutstandingTasks() const REQUIRES(task_queue_lock_) override {
+    return started_ &&
+        (!generic_queue_.empty() ||
+         !baseline_queue_.empty() ||
+         !optimized_queue_.empty() ||
+         !osr_queue_.empty());
+  }
+
+ private:
+  JitThreadPool(const char* name,
+                size_t num_threads,
+                size_t worker_stack_size)
+      // We need peers as we may report the JIT thread, e.g., in the debugger.
+      : AbstractThreadPool(name, num_threads, /* create_peers= */ true, worker_stack_size) {}
+
+  // Try to fetch an entry from `methods`. Return null if `methods` is empty.
+  Task* FetchFrom(std::deque<ArtMethod*>& methods, CompilationKind kind) REQUIRES(task_queue_lock_);
+
+  std::deque<Task*> generic_queue_ GUARDED_BY(task_queue_lock_);
+
+  std::deque<ArtMethod*> osr_queue_ GUARDED_BY(task_queue_lock_);
+  std::deque<ArtMethod*> baseline_queue_ GUARDED_BY(task_queue_lock_);
+  std::deque<ArtMethod*> optimized_queue_ GUARDED_BY(task_queue_lock_);
+
+  // We track the methods that are currently enqueued to avoid
+  // adding them to the queue multiple times, which could bloat the
+  // queues.
+  std::set<ArtMethod*> osr_enqueued_methods_ GUARDED_BY(task_queue_lock_);
+  std::set<ArtMethod*> baseline_enqueued_methods_ GUARDED_BY(task_queue_lock_);
+  std::set<ArtMethod*> optimized_enqueued_methods_ GUARDED_BY(task_queue_lock_);
+
+  // A set to keep track of methods that are currently being compiled. Entries
+  // will be removed when JitCompileTask->Finalize is called.
+  std::unordered_set<JitCompileTask*> current_compilations_ GUARDED_BY(task_queue_lock_);
+
+  DISALLOW_COPY_AND_ASSIGN(JitThreadPool);
+};
+
 class Jit {
  public:
-  static constexpr size_t kDefaultPriorityThreadWeightRatio = 1000;
-  static constexpr size_t kDefaultInvokeTransitionWeightRatio = 500;
   // How frequently should the interpreter check to see if OSR compilation is ready.
   static constexpr int16_t kJitRecheckOSRThreshold = 101;  // Prime number to avoid patterns.
 
-  DECLARE_RUNTIME_DEBUG_FLAG(kSlowMode);
-
   virtual ~Jit();
 
   // Create JIT itself.
-  static Jit* Create(JitCodeCache* code_cache, JitOptions* options);
+  static std::unique_ptr<Jit> Create(JitCodeCache* code_cache, JitOptions* options);
 
-  bool CompileMethod(ArtMethod* method, Thread* self, CompilationKind compilation_kind, bool prejit)
-      REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT bool CompileMethod(ArtMethod* method,
+                            Thread* self,
+                            CompilationKind compilation_kind,
+                            bool prejit) REQUIRES_SHARED(Locks::mutator_lock_);
+
+  void VisitRoots(RootVisitor* visitor);
 
   const JitCodeCache* GetCodeCache() const {
     return code_cache_;
@@ -302,7 +252,7 @@
   }
 
   // Wait until there is no more pending compilation tasks.
-  void WaitForCompilationToFinish(Thread* self);
+  EXPORT void WaitForCompilationToFinish(Thread* self);
 
   // Profiling methods.
   void MethodEntered(Thread* thread, ArtMethod* method)
@@ -343,7 +293,7 @@
   void DumpTypeInfoForLoadedTypes(ClassLinker* linker);
 
   // Return whether we should try to JIT compiled code as soon as an ArtMethod is invoked.
-  bool JitAtFirstUse();
+  EXPORT bool JitAtFirstUse();
 
   // Return whether we can invoke JIT code for `method`.
   bool CanInvokeCompiledCode(ArtMethod* method);
@@ -364,24 +314,21 @@
                                         JValue* result)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  // Load the compiler library.
-  static bool LoadCompilerLibrary(std::string* error_msg);
-
-  ThreadPool* GetThreadPool() const {
+  JitThreadPool* GetThreadPool() const {
     return thread_pool_.get();
   }
 
   // Stop the JIT by waiting for all current compilations and enqueued compilations to finish.
-  void Stop();
+  EXPORT void Stop();
 
   // Start JIT threads.
-  void Start();
+  EXPORT void Start();
 
   // Transition to a child state.
-  void PostForkChildAction(bool is_system_server, bool is_zygote);
+  EXPORT void PostForkChildAction(bool is_system_server, bool is_zygote);
 
   // Prepare for forking.
-  void PreZygoteFork();
+  EXPORT void PreZygoteFork();
 
   // Adjust state after forking.
   void PostZygoteFork();
@@ -438,9 +385,12 @@
   // class path methods.
   void NotifyZygoteCompilationDone();
 
-  void EnqueueOptimizedCompilation(ArtMethod* method, Thread* self);
+  EXPORT void EnqueueOptimizedCompilation(ArtMethod* method, Thread* self);
 
-  void MaybeEnqueueCompilation(ArtMethod* method, Thread* self)
+  EXPORT void MaybeEnqueueCompilation(ArtMethod* method, Thread* self)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+
+  EXPORT static bool TryPatternMatch(ArtMethod* method, CompilationKind compilation_kind)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
  private:
@@ -465,8 +415,7 @@
 
   void AddCompileTask(Thread* self,
                       ArtMethod* method,
-                      CompilationKind compilation_kind,
-                      bool precompile = false);
+                      CompilationKind compilation_kind);
 
   bool CompileMethodInternal(ArtMethod* method,
                              Thread* self,
@@ -475,16 +424,13 @@
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // JIT compiler
-  static void* jit_library_handle_;
-  static JitCompilerInterface* jit_compiler_;
-  static JitCompilerInterface* (*jit_load_)(void);
-  template <typename T> static bool LoadSymbol(T*, const char* symbol, std::string* error_msg);
+  EXPORT static JitCompilerInterface* jit_compiler_;
 
   // JIT resources owned by runtime.
   jit::JitCodeCache* const code_cache_;
   const JitOptions* const options_;
 
-  std::unique_ptr<ThreadPool> thread_pool_;
+  std::unique_ptr<JitThreadPool> thread_pool_;
   std::vector<std::unique_ptr<OatDexFile>> type_lookup_tables_;
 
   Mutex boot_completed_lock_;
@@ -526,7 +472,7 @@
 };
 
 // Helper class to stop the JIT for a given scope. This will wait for the JIT to quiesce.
-class ScopedJitSuspend {
+class EXPORT ScopedJitSuspend {
  public:
   ScopedJitSuspend();
   ~ScopedJitSuspend();
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index 30631ac..3560ac1 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -50,8 +50,8 @@
 #include "jit/profiling_info.h"
 #include "jit/jit_scoped_code_cache_write.h"
 #include "linear_alloc.h"
-#include "oat_file-inl.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_file-inl.h"
+#include "oat/oat_quick_method_header.h"
 #include "object_callbacks.h"
 #include "profile/profile_compilation_info.h"
 #include "scoped_thread_state_change-inl.h"
@@ -60,7 +60,7 @@
 #include "thread-inl.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace jit {
 
 static constexpr size_t kCodeSizeLogThreshold = 50 * KB;
@@ -258,10 +258,10 @@
 JitCodeCache::JitCodeCache()
     : is_weak_access_enabled_(true),
       inline_cache_cond_("Jit inline cache condition variable", *Locks::jit_lock_),
+      reserved_capacity_(GetInitialCapacity() * kReservedCapacityMultiplier),
       zygote_map_(&shared_region_),
       lock_cond_("Jit code cache condition variable", *Locks::jit_lock_),
       collection_in_progress_(false),
-      last_collection_increased_code_cache_(false),
       garbage_collect_code_(true),
       number_of_baseline_compilations_(0),
       number_of_optimized_compilations_(0),
@@ -447,8 +447,9 @@
   // Walk over inline caches to clear entries containing unloaded classes.
   for (auto it : profiling_infos_) {
     ProfilingInfo* info = it.second;
+    InlineCache* caches = info->GetInlineCaches();
     for (size_t i = 0; i < info->number_of_inline_caches_; ++i) {
-      InlineCache* cache = &info->cache_[i];
+      InlineCache* cache = &caches[i];
       for (size_t j = 0; j < InlineCache::kIndividualCacheSize; ++j) {
         mirror::Class* klass = cache->classes_[j].Read<kWithoutReadBarrier>();
         if (klass != nullptr) {
@@ -615,15 +616,15 @@
     const InlineCache& ic,
     /*out*/StackHandleScope<InlineCache::kIndividualCacheSize>* classes) {
   static_assert(arraysize(ic.classes_) == InlineCache::kIndividualCacheSize);
-  DCHECK_EQ(classes->NumberOfReferences(), InlineCache::kIndividualCacheSize);
-  DCHECK_EQ(classes->RemainingSlots(), InlineCache::kIndividualCacheSize);
+  DCHECK_EQ(classes->Capacity(), InlineCache::kIndividualCacheSize);
+  DCHECK_EQ(classes->Size(), 0u);
   WaitUntilInlineCacheAccessible(Thread::Current());
   // Note that we don't need to lock `lock_` here, the compiler calling
   // this method has already ensured the inline cache will not be deleted.
   for (const GcRoot<mirror::Class>& root : ic.classes_) {
     mirror::Class* object = root.Read();
     if (object != nullptr) {
-      DCHECK_NE(classes->RemainingSlots(), 0u);
+      DCHECK_LT(classes->Size(), classes->Capacity());
       classes->NewHandle(object);
     }
   }
@@ -663,7 +664,6 @@
                           const std::vector<uint8_t>& debug_info,
                           bool is_full_debug_info,
                           CompilationKind compilation_kind,
-                          bool has_should_deoptimize_flag,
                           const ArenaSet<ArtMethod*>& cha_single_implementation_list) {
   DCHECK_IMPLIES(method->IsNative(), (compilation_kind != CompilationKind::kOsr));
 
@@ -677,43 +677,42 @@
   size_t root_table_size = ComputeRootTableSize(roots.size());
   const uint8_t* stack_map_data = roots_data + root_table_size;
 
-  MutexLock mu(self, *Locks::jit_lock_);
-  // We need to make sure that there will be no jit-gcs going on and wait for any ongoing one to
-  // finish.
-  WaitForPotentialCollectionToCompleteRunnable(self);
-  const uint8_t* code_ptr = region->CommitCode(
-      reserved_code, code, stack_map_data, has_should_deoptimize_flag);
-  if (code_ptr == nullptr) {
-    return false;
-  }
-  OatQuickMethodHeader* method_header = OatQuickMethodHeader::FromCodePointer(code_ptr);
-
-  // Commit roots and stack maps before updating the entry point.
-  if (!region->CommitData(reserved_data, roots, stack_map)) {
-    return false;
-  }
-
-  switch (compilation_kind) {
-    case CompilationKind::kOsr:
-      number_of_osr_compilations_++;
-      break;
-    case CompilationKind::kBaseline:
-      number_of_baseline_compilations_++;
-      break;
-    case CompilationKind::kOptimized:
-      number_of_optimized_compilations_++;
-      break;
-  }
-
-  // We need to update the debug info before the entry point gets set.
-  // At the same time we want to do under JIT lock so that debug info and JIT maps are in sync.
-  if (!debug_info.empty()) {
-    // NB: Don't allow packing of full info since it would remove non-backtrace data.
-    AddNativeDebugInfoForJit(code_ptr, debug_info, /*allow_packing=*/ !is_full_debug_info);
-  }
-
-  // We need to update the entry point in the runnable state for the instrumentation.
+  OatQuickMethodHeader* method_header = nullptr;
   {
+    MutexLock mu(self, *Locks::jit_lock_);
+    // We need to make sure that there will be no jit-gcs going on and wait for any ongoing one to
+    // finish.
+    WaitForPotentialCollectionToCompleteRunnable(self);
+    const uint8_t* code_ptr = region->CommitCode(reserved_code, code, stack_map_data);
+    if (code_ptr == nullptr) {
+      return false;
+    }
+    method_header = OatQuickMethodHeader::FromCodePointer(code_ptr);
+
+    // Commit roots and stack maps before updating the entry point.
+    if (!region->CommitData(reserved_data, roots, stack_map)) {
+      return false;
+    }
+
+    switch (compilation_kind) {
+      case CompilationKind::kOsr:
+        number_of_osr_compilations_++;
+        break;
+      case CompilationKind::kBaseline:
+        number_of_baseline_compilations_++;
+        break;
+      case CompilationKind::kOptimized:
+        number_of_optimized_compilations_++;
+        break;
+    }
+
+    // We need to update the debug info before the entry point gets set.
+    // At the same time we want to do under JIT lock so that debug info and JIT maps are in sync.
+    if (!debug_info.empty()) {
+      // NB: Don't allow packing of full info since it would remove non-backtrace data.
+      AddNativeDebugInfoForJit(code_ptr, debug_info, /*allow_packing=*/ !is_full_debug_info);
+    }
+
     // The following needs to be guarded by cha_lock_ also. Otherwise it's possible that the
     // compiled code is considered invalidated by some class linking, but below we still make the
     // compiled code valid for the method.  Need cha_lock_ for checking all single-implementation
@@ -798,6 +797,12 @@
                                          method_header->GetCodeSize());
   }
 
+  if (kIsDebugBuild) {
+    uintptr_t entry_point = reinterpret_cast<uintptr_t>(method_header->GetEntryPoint());
+    DCHECK_EQ(LookupMethodHeader(entry_point, method), method_header) << method->PrettyMethod();
+    DCHECK_EQ(LookupMethodHeader(entry_point + method_header->GetCodeSize() - 1, method),
+              method_header) << method->PrettyMethod();
+  }
   return true;
 }
 
@@ -1098,23 +1103,6 @@
   return private_region_.GetCurrentCapacity() == private_region_.GetMaxCapacity();
 }
 
-bool JitCodeCache::ShouldDoFullCollection() {
-  if (IsAtMaxCapacity()) {
-    // Always do a full collection when the code cache is full.
-    return true;
-  } else if (private_region_.GetCurrentCapacity() < kReservedCapacity) {
-    // Always do partial collection when the code cache size is below the reserved
-    // capacity.
-    return false;
-  } else if (last_collection_increased_code_cache_) {
-    // This time do a full collection.
-    return true;
-  } else {
-    // This time do a partial collection.
-    return false;
-  }
-}
-
 void JitCodeCache::GarbageCollectCache(Thread* self) {
   ScopedTrace trace(__FUNCTION__);
   // Wait for an existing collection, or let everyone know we are starting one.
@@ -1141,19 +1129,11 @@
   {
     TimingLogger::ScopedTiming st("Code cache collection", &logger);
 
-    bool do_full_collection = false;
-    {
-      MutexLock mu(self, *Locks::jit_lock_);
-      do_full_collection = ShouldDoFullCollection();
-    }
-
-    VLOG(jit) << "Do "
-              << (do_full_collection ? "full" : "partial")
-              << " code cache collection, code="
+    VLOG(jit) << "Do code cache collection, code="
               << PrettySize(CodeCacheSize())
               << ", data=" << PrettySize(DataCacheSize());
 
-    DoCollection(self, /* collect_profiling_info= */ do_full_collection);
+    DoCollection(self);
 
     VLOG(jit) << "After code cache collection, code="
               << PrettySize(CodeCacheSize())
@@ -1161,43 +1141,7 @@
 
     {
       MutexLock mu(self, *Locks::jit_lock_);
-
-      // Increase the code cache only when we do partial collections.
-      // TODO: base this strategy on how full the code cache is?
-      if (do_full_collection) {
-        last_collection_increased_code_cache_ = false;
-      } else {
-        last_collection_increased_code_cache_ = true;
-        private_region_.IncreaseCodeCacheCapacity();
-      }
-
-      bool next_collection_will_be_full = ShouldDoFullCollection();
-
-      // Start polling the liveness of compiled code to prepare for the next full collection.
-      if (next_collection_will_be_full) {
-        ScopedDebugDisallowReadBarriers sddrb(self);
-        for (auto it : profiling_infos_) {
-          it.second->ResetCounter();
-        }
-
-        // Change entry points of native methods back to the GenericJNI entrypoint.
-        for (const auto& entry : jni_stubs_map_) {
-          const JniStubData& data = entry.second;
-          if (!data.IsCompiled() || IsInZygoteExecSpace(data.GetCode())) {
-            continue;
-          }
-          const OatQuickMethodHeader* method_header =
-              OatQuickMethodHeader::FromCodePointer(data.GetCode());
-          for (ArtMethod* method : data.GetMethods()) {
-            if (method->GetEntryPointFromQuickCompiledCode() == method_header->GetEntryPoint()) {
-              // Don't call Instrumentation::UpdateMethodsCode(), same as for normal methods above.
-              // Make sure a single invocation of the GenericJNI trampoline tries to recompile.
-              method->SetHotCounter();
-              method->SetEntryPointFromQuickCompiledCode(GetQuickGenericJniStub());
-            }
-          }
-        }
-      }
+      private_region_.IncreaseCodeCacheCapacity();
       live_bitmap_.reset(nullptr);
       NotifyCollectionDone(self);
     }
@@ -1254,62 +1198,9 @@
   garbage_collect_code_ = value;
 }
 
-void JitCodeCache::RemoveMethodBeingCompiled(ArtMethod* method, CompilationKind kind) {
-  ScopedDebugDisallowReadBarriers sddrb(Thread::Current());
-  DCHECK(IsMethodBeingCompiled(method, kind));
-  switch (kind) {
-    case CompilationKind::kOsr:
-      current_osr_compilations_.erase(method);
-      break;
-    case CompilationKind::kBaseline:
-      current_baseline_compilations_.erase(method);
-      break;
-    case CompilationKind::kOptimized:
-      current_optimized_compilations_.erase(method);
-      break;
-  }
-}
-
-void JitCodeCache::AddMethodBeingCompiled(ArtMethod* method, CompilationKind kind) {
-  ScopedDebugDisallowReadBarriers sddrb(Thread::Current());
-  DCHECK(!IsMethodBeingCompiled(method, kind));
-  switch (kind) {
-    case CompilationKind::kOsr:
-      current_osr_compilations_.insert(method);
-      break;
-    case CompilationKind::kBaseline:
-      current_baseline_compilations_.insert(method);
-      break;
-    case CompilationKind::kOptimized:
-      current_optimized_compilations_.insert(method);
-      break;
-  }
-}
-
-bool JitCodeCache::IsMethodBeingCompiled(ArtMethod* method, CompilationKind kind) {
-  ScopedDebugDisallowReadBarriers sddrb(Thread::Current());
-  switch (kind) {
-    case CompilationKind::kOsr:
-      return ContainsElement(current_osr_compilations_, method);
-    case CompilationKind::kBaseline:
-      return ContainsElement(current_baseline_compilations_, method);
-    case CompilationKind::kOptimized:
-      return ContainsElement(current_optimized_compilations_, method);
-  }
-}
-
-bool JitCodeCache::IsMethodBeingCompiled(ArtMethod* method) {
-  ScopedDebugDisallowReadBarriers sddrb(Thread::Current());
-  return ContainsElement(current_optimized_compilations_, method) ||
-      ContainsElement(current_osr_compilations_, method) ||
-      ContainsElement(current_baseline_compilations_, method);
-}
-
 ProfilingInfo* JitCodeCache::GetProfilingInfo(ArtMethod* method, Thread* self) {
   ScopedDebugDisallowReadBarriers sddrb(self);
   MutexLock mu(self, *Locks::jit_lock_);
-  DCHECK(IsMethodBeingCompiled(method))
-      << "GetProfilingInfo should only be called when the method is being compiled";
   auto it = profiling_infos_.find(method);
   if (it == profiling_infos_.end()) {
     return nullptr;
@@ -1317,6 +1208,21 @@
   return it->second;
 }
 
+void JitCodeCache::MaybeUpdateInlineCache(ArtMethod* method,
+                                          uint32_t dex_pc,
+                                          ObjPtr<mirror::Class> cls,
+                                          Thread* self) {
+  ScopedDebugDisallowReadBarriers sddrb(self);
+  MutexLock mu(self, *Locks::jit_lock_);
+  auto it = profiling_infos_.find(method);
+  if (it == profiling_infos_.end()) {
+    return;
+  }
+  ProfilingInfo* info = it->second;
+  ScopedAssertNoThreadSuspension sants("ProfilingInfo");
+  info->AddInvokeInfo(dex_pc, cls.Ptr());
+}
+
 void JitCodeCache::ResetHotnessCounter(ArtMethod* method, Thread* self) {
   ScopedDebugDisallowReadBarriers sddrb(self);
   MutexLock mu(self, *Locks::jit_lock_);
@@ -1326,35 +1232,11 @@
 }
 
 
-void JitCodeCache::DoCollection(Thread* self, bool collect_profiling_info) {
+void JitCodeCache::DoCollection(Thread* self) {
   ScopedTrace trace(__FUNCTION__);
   {
     ScopedDebugDisallowReadBarriers sddrb(self);
     MutexLock mu(self, *Locks::jit_lock_);
-
-    // Update to interpreter the methods that have baseline entrypoints and whose baseline
-    // hotness count hasn't changed.
-    // Note that these methods may be in thread stack or concurrently revived
-    // between. That's OK, as the thread executing it will mark it.
-    uint16_t warmup_threshold = Runtime::Current()->GetJITOptions()->GetWarmupThreshold();
-    for (auto it : profiling_infos_) {
-      ProfilingInfo* info = it.second;
-      if (!info->CounterHasChanged()) {
-        const void* entry_point = info->GetMethod()->GetEntryPointFromQuickCompiledCode();
-        if (ContainsPc(entry_point)) {
-          OatQuickMethodHeader* method_header =
-              OatQuickMethodHeader::FromEntryPoint(entry_point);
-          if (CodeInfo::IsBaseline(method_header->GetOptimizedCodeInfoPtr())) {
-            info->GetMethod()->ResetCounter(warmup_threshold);
-            Runtime::Current()->GetInstrumentation()->InitializeMethodsCode(
-                info->GetMethod(), /*aot_code=*/ nullptr);
-          }
-        }
-      }
-    }
-    // TODO: collect profiling info
-    // TODO: collect optimized code
-
     // Mark compiled code that are entrypoints of ArtMethods. Compiled code that is not
     // an entry point is either:
     // - an osr compiled code, that will be removed if not in a thread call stack.
@@ -1397,19 +1279,12 @@
   // change. We do know they cannot change to a code cache entry that is not marked,
   // therefore we can safely remove those entries.
   RemoveUnmarkedCode(self);
-
-  if (collect_profiling_info) {
-    // TODO: Collect unused profiling infos.
-  }
 }
 
 OatQuickMethodHeader* JitCodeCache::LookupMethodHeader(uintptr_t pc, ArtMethod* method) {
   static_assert(kRuntimeISA != InstructionSet::kThumb2, "kThumb2 cannot be a runtime ISA");
-  if (kRuntimeISA == InstructionSet::kArm) {
-    // On Thumb-2, the pc is offset by one.
-    --pc;
-  }
-  if (!ContainsPc(reinterpret_cast<const void*>(pc))) {
+  const void* pc_ptr = reinterpret_cast<const void*>(pc);
+  if (!ContainsPc(pc_ptr)) {
     return nullptr;
   }
 
@@ -1425,7 +1300,14 @@
   ArtMethod* found_method = nullptr;  // Only for DCHECK(), not for JNI stubs.
   if (method != nullptr && UNLIKELY(method->IsNative())) {
     auto it = jni_stubs_map_.find(JniStubKey(method));
-    if (it == jni_stubs_map_.end() || !ContainsElement(it->second.GetMethods(), method)) {
+    if (it == jni_stubs_map_.end()) {
+      return nullptr;
+    }
+    if (!ContainsElement(it->second.GetMethods(), method)) {
+      DCHECK(!OatQuickMethodHeader::FromCodePointer(it->second.GetCode())->Contains(pc))
+          << "Method missing from stub map, but pc executing the method points to the stub."
+          << " method= " << method->PrettyMethod()
+          << " pc= " << std::hex << pc;
       return nullptr;
     }
     const void* code_ptr = it->second.GetCode();
@@ -1434,15 +1316,18 @@
       return nullptr;
     }
   } else {
-    if (shared_region_.IsInExecSpace(reinterpret_cast<const void*>(pc))) {
+    if (shared_region_.IsInExecSpace(pc_ptr)) {
       const void* code_ptr = zygote_map_.GetCodeFor(method, pc);
       if (code_ptr != nullptr) {
         return OatQuickMethodHeader::FromCodePointer(code_ptr);
       }
     }
-    auto it = method_code_map_.lower_bound(reinterpret_cast<const void*>(pc));
-    if (it != method_code_map_.begin()) {
+    auto it = method_code_map_.lower_bound(pc_ptr);
+    if ((it == method_code_map_.end() || it->first != pc_ptr) &&
+        it != method_code_map_.begin()) {
       --it;
+    }
+    if (it != method_code_map_.end()) {
       const void* code_ptr = it->first;
       if (OatQuickMethodHeader::FromCodePointer(code_ptr)->Contains(pc)) {
         method_header = OatQuickMethodHeader::FromCodePointer(code_ptr);
@@ -1487,25 +1372,28 @@
 
 ProfilingInfo* JitCodeCache::AddProfilingInfo(Thread* self,
                                               ArtMethod* method,
-                                              const std::vector<uint32_t>& entries) {
+                                              const std::vector<uint32_t>& inline_cache_entries,
+                                              const std::vector<uint32_t>& branch_cache_entries) {
   DCHECK(CanAllocateProfilingInfo());
   ProfilingInfo* info = nullptr;
   {
     MutexLock mu(self, *Locks::jit_lock_);
-    info = AddProfilingInfoInternal(self, method, entries);
+    info = AddProfilingInfoInternal(self, method, inline_cache_entries, branch_cache_entries);
   }
 
   if (info == nullptr) {
     GarbageCollectCache(self);
     MutexLock mu(self, *Locks::jit_lock_);
-    info = AddProfilingInfoInternal(self, method, entries);
+    info = AddProfilingInfoInternal(self, method, inline_cache_entries, branch_cache_entries);
   }
   return info;
 }
 
-ProfilingInfo* JitCodeCache::AddProfilingInfoInternal(Thread* self,
-                                                      ArtMethod* method,
-                                                      const std::vector<uint32_t>& entries) {
+ProfilingInfo* JitCodeCache::AddProfilingInfoInternal(
+    Thread* self,
+    ArtMethod* method,
+    const std::vector<uint32_t>& inline_cache_entries,
+    const std::vector<uint32_t>& branch_cache_entries) {
   ScopedDebugDisallowReadBarriers sddrb(self);
   // Check whether some other thread has concurrently created it.
   auto it = profiling_infos_.find(method);
@@ -1513,16 +1401,16 @@
     return it->second;
   }
 
-  size_t profile_info_size = RoundUp(
-      sizeof(ProfilingInfo) + sizeof(InlineCache) * entries.size(),
-      sizeof(void*));
+  size_t profile_info_size =
+      ProfilingInfo::ComputeSize(inline_cache_entries.size(), branch_cache_entries.size());
 
   const uint8_t* data = private_region_.AllocateData(profile_info_size);
   if (data == nullptr) {
     return nullptr;
   }
   uint8_t* writable_data = private_region_.GetWritableDataAddress(data);
-  ProfilingInfo* info = new (writable_data) ProfilingInfo(method, entries);
+  ProfilingInfo* info =
+      new (writable_data) ProfilingInfo(method, inline_cache_entries, branch_cache_entries);
 
   profiling_infos_.Put(method, info);
   histogram_profiling_info_memory_use_.AddValue(profile_info_size);
@@ -1536,22 +1424,25 @@
 }
 
 void JitCodeCache::GetProfiledMethods(const std::set<std::string>& dex_base_locations,
-                                      std::vector<ProfileMethodInfo>& methods) {
+                                      std::vector<ProfileMethodInfo>& methods,
+                                      uint16_t inline_cache_threshold) {
   ScopedTrace trace(__FUNCTION__);
   Thread* self = Thread::Current();
   WaitUntilInlineCacheAccessible(self);
-  std::vector<ProfilingInfo*> copies;
+  SafeMap<ArtMethod*, ProfilingInfo*> profiling_infos;
+  std::vector<ArtMethod*> copies;
   // TODO: Avoid read barriers for potentially dead methods.
   // ScopedDebugDisallowReadBarriers sddrb(self);
   {
     MutexLock mu(self, *Locks::jit_lock_);
-    copies.reserve(profiling_infos_.size());
-    for (const auto& entry : profiling_infos_) {
+    profiling_infos = profiling_infos_;
+    for (const auto& entry : method_code_map_) {
       copies.push_back(entry.second);
     }
   }
-  for (ProfilingInfo* info : copies) {
-    ArtMethod* method = info->GetMethod();
+  for (ArtMethod* method : copies) {
+    auto it = profiling_infos.find(method);
+    ProfilingInfo* info = (it == profiling_infos.end()) ? nullptr : it->second;
     const DexFile* dex_file = method->GetDexFile();
     const std::string base_location = DexFileLoader::GetBaseLocation(dex_file->GetLocation());
     if (!ContainsElement(dex_base_locations, base_location)) {
@@ -1560,69 +1451,75 @@
     }
     std::vector<ProfileMethodInfo::ProfileInlineCache> inline_caches;
 
-    // If the method is still baseline compiled, don't save the inline caches.
-    // They might be incomplete and cause unnecessary deoptimizations.
-    // If the inline cache is empty the compiler will generate a regular invoke virtual/interface.
-    const void* entry_point = method->GetEntryPointFromQuickCompiledCode();
-    if (ContainsPc(entry_point) &&
-        CodeInfo::IsBaseline(
-            OatQuickMethodHeader::FromEntryPoint(entry_point)->GetOptimizedCodeInfoPtr())) {
-      methods.emplace_back(/*ProfileMethodInfo*/
-          MethodReference(dex_file, method->GetDexMethodIndex()), inline_caches);
-      continue;
-    }
-
-    for (size_t i = 0; i < info->number_of_inline_caches_; ++i) {
-      std::vector<TypeReference> profile_classes;
-      const InlineCache& cache = info->cache_[i];
-      ArtMethod* caller = info->GetMethod();
-      bool is_missing_types = false;
-      for (size_t k = 0; k < InlineCache::kIndividualCacheSize; k++) {
-        mirror::Class* cls = cache.classes_[k].Read();
-        if (cls == nullptr) {
-          break;
-        }
-
-        // Check if the receiver is in the boot class path or if it's in the
-        // same class loader as the caller. If not, skip it, as there is not
-        // much we can do during AOT.
-        if (!cls->IsBootStrapClassLoaded() &&
-            caller->GetClassLoader() != cls->GetClassLoader()) {
-          is_missing_types = true;
-          continue;
-        }
-
-        const DexFile* class_dex_file = nullptr;
-        dex::TypeIndex type_index;
-
-        if (cls->GetDexCache() == nullptr) {
-          DCHECK(cls->IsArrayClass()) << cls->PrettyClass();
-          // Make a best effort to find the type index in the method's dex file.
-          // We could search all open dex files but that might turn expensive
-          // and probably not worth it.
-          class_dex_file = dex_file;
-          type_index = cls->FindTypeIndexInOtherDexFile(*dex_file);
-        } else {
-          class_dex_file = &(cls->GetDexFile());
-          type_index = cls->GetDexTypeIndex();
-        }
-        if (!type_index.IsValid()) {
-          // Could be a proxy class or an array for which we couldn't find the type index.
-          is_missing_types = true;
-          continue;
-        }
-        if (ContainsElement(dex_base_locations,
-                            DexFileLoader::GetBaseLocation(class_dex_file->GetLocation()))) {
-          // Only consider classes from the same apk (including multidex).
-          profile_classes.emplace_back(/*ProfileMethodInfo::ProfileClassReference*/
-              class_dex_file, type_index);
-        } else {
-          is_missing_types = true;
-        }
+    if (info != nullptr) {
+      // If the method is still baseline compiled and doesn't meet the inline cache threshold, don't
+      // save the inline caches because they might be incomplete.
+      // Although we don't deoptimize for incomplete inline caches in AOT-compiled code, inlining
+      // leads to larger generated code.
+      // If the inline cache is empty the compiler will generate a regular invoke virtual/interface.
+      const void* entry_point = method->GetEntryPointFromQuickCompiledCode();
+      if (ContainsPc(entry_point) &&
+          CodeInfo::IsBaseline(
+              OatQuickMethodHeader::FromEntryPoint(entry_point)->GetOptimizedCodeInfoPtr()) &&
+          (ProfilingInfo::GetOptimizeThreshold() - info->GetBaselineHotnessCount()) <
+              inline_cache_threshold) {
+        methods.emplace_back(/*ProfileMethodInfo*/
+            MethodReference(dex_file, method->GetDexMethodIndex()), inline_caches);
+        continue;
       }
-      if (!profile_classes.empty()) {
-        inline_caches.emplace_back(/*ProfileMethodInfo::ProfileInlineCache*/
-            cache.dex_pc_, is_missing_types, profile_classes);
+
+      for (size_t i = 0; i < info->number_of_inline_caches_; ++i) {
+        std::vector<TypeReference> profile_classes;
+        const InlineCache& cache = info->GetInlineCaches()[i];
+        ArtMethod* caller = info->GetMethod();
+        bool is_missing_types = false;
+        for (size_t k = 0; k < InlineCache::kIndividualCacheSize; k++) {
+          mirror::Class* cls = cache.classes_[k].Read();
+          if (cls == nullptr) {
+            break;
+          }
+
+          // Check if the receiver is in the boot class path or if it's in the
+          // same class loader as the caller. If not, skip it, as there is not
+          // much we can do during AOT.
+          if (!cls->IsBootStrapClassLoaded() &&
+              caller->GetClassLoader() != cls->GetClassLoader()) {
+            is_missing_types = true;
+            continue;
+          }
+
+          const DexFile* class_dex_file = nullptr;
+          dex::TypeIndex type_index;
+
+          if (cls->GetDexCache() == nullptr) {
+            DCHECK(cls->IsArrayClass()) << cls->PrettyClass();
+            // Make a best effort to find the type index in the method's dex file.
+            // We could search all open dex files but that might turn expensive
+            // and probably not worth it.
+            class_dex_file = dex_file;
+            type_index = cls->FindTypeIndexInOtherDexFile(*dex_file);
+          } else {
+            class_dex_file = &(cls->GetDexFile());
+            type_index = cls->GetDexTypeIndex();
+          }
+          if (!type_index.IsValid()) {
+            // Could be a proxy class or an array for which we couldn't find the type index.
+            is_missing_types = true;
+            continue;
+          }
+          if (ContainsElement(dex_base_locations,
+                              DexFileLoader::GetBaseLocation(class_dex_file->GetLocation()))) {
+            // Only consider classes from the same apk (including multidex).
+            profile_classes.emplace_back(/*ProfileMethodInfo::ProfileClassReference*/
+                class_dex_file, type_index);
+          } else {
+            is_missing_types = true;
+          }
+        }
+        if (!profile_classes.empty()) {
+          inline_caches.emplace_back(/*ProfileMethodInfo::ProfileInlineCache*/
+              cache.dex_pc_, is_missing_types, profile_classes);
+        }
       }
     }
     methods.emplace_back(/*ProfileMethodInfo*/
@@ -1637,47 +1534,18 @@
   return osr_code_map_.find(method) != osr_code_map_.end();
 }
 
-void JitCodeCache::VisitRoots(RootVisitor* visitor) {
-  if (Runtime::Current()->GetHeap()->IsPerformingUffdCompaction()) {
-    // In case of userfaultfd compaction, ArtMethods are updated concurrently
-    // via linear-alloc.
-    return;
-  }
-  MutexLock mu(Thread::Current(), *Locks::jit_lock_);
-  UnbufferedRootVisitor root_visitor(visitor, RootInfo(kRootStickyClass));
-  for (ArtMethod* method : current_optimized_compilations_) {
-    method->VisitRoots(root_visitor, kRuntimePointerSize);
-  }
-  for (ArtMethod* method : current_baseline_compilations_) {
-    method->VisitRoots(root_visitor, kRuntimePointerSize);
-  }
-  for (ArtMethod* method : current_osr_compilations_) {
-    method->VisitRoots(root_visitor, kRuntimePointerSize);
-  }
-}
-
 bool JitCodeCache::NotifyCompilationOf(ArtMethod* method,
                                        Thread* self,
                                        CompilationKind compilation_kind,
                                        bool prejit) {
-  if (kIsDebugBuild) {
-    MutexLock mu(self, *Locks::jit_lock_);
-    // Note: the compilation kind may have been adjusted after what was passed initially.
-    // We really just want to check that the method is indeed being compiled.
-    CHECK(IsMethodBeingCompiled(method));
-  }
   const void* existing_entry_point = method->GetEntryPointFromQuickCompiledCode();
-  if (compilation_kind != CompilationKind::kOsr && ContainsPc(existing_entry_point)) {
-    OatQuickMethodHeader* method_header =
-        OatQuickMethodHeader::FromEntryPoint(existing_entry_point);
-    bool is_baseline = (compilation_kind == CompilationKind::kBaseline);
-    if (CodeInfo::IsBaseline(method_header->GetOptimizedCodeInfoPtr()) == is_baseline) {
-      VLOG(jit) << "Not compiling "
-                << method->PrettyMethod()
-                << " because it has already been compiled"
-                << " kind=" << compilation_kind;
-      return false;
-    }
+  if (compilation_kind == CompilationKind::kBaseline && ContainsPc(existing_entry_point)) {
+    // The existing entry point is either already baseline, or optimized. No
+    // need to compile.
+    VLOG(jit) << "Not compiling "
+              << method->PrettyMethod()
+              << " baseline, because it has already been compiled";
+    return false;
   }
 
   if (method->NeedsClinitCheckBeforeCall() && !prejit) {
@@ -1742,18 +1610,6 @@
   } else {
     if (compilation_kind == CompilationKind::kBaseline) {
       DCHECK(CanAllocateProfilingInfo());
-      bool has_profiling_info = false;
-      {
-        MutexLock mu(self, *Locks::jit_lock_);
-        has_profiling_info = (profiling_infos_.find(method) != profiling_infos_.end());
-      }
-      if (!has_profiling_info) {
-        if (ProfilingInfo::Create(self, method) == nullptr) {
-          VLOG(jit) << method->PrettyMethod() << " needs a ProfilingInfo to be compiled baseline";
-          ClearMethodCounter(method, /*was_warm=*/ false);
-          return false;
-        }
-      }
     }
   }
   return true;
@@ -1805,7 +1661,22 @@
   Runtime* runtime = Runtime::Current();
   ClassLinker* linker = runtime->GetClassLinker();
   instrumentation::Instrumentation* instr = runtime->GetInstrumentation();
-  // TODO: Clear `jni_stubs_map_`?
+
+  // Change entry points of native methods back to the GenericJNI entrypoint.
+  for (const auto& entry : jni_stubs_map_) {
+    const JniStubData& data = entry.second;
+    if (!data.IsCompiled() || IsInZygoteExecSpace(data.GetCode())) {
+      continue;
+    }
+    const OatQuickMethodHeader* method_header =
+        OatQuickMethodHeader::FromCodePointer(data.GetCode());
+    for (ArtMethod* method : data.GetMethods()) {
+      if (method->GetEntryPointFromQuickCompiledCode() == method_header->GetEntryPoint()) {
+        ClearMethodCounter(method, /*was_warm=*/true);
+        instr->InitializeMethodsCode(method, /*aot_code=*/ nullptr);
+      }
+    }
+  }
   for (const auto& entry : method_code_map_) {
     ArtMethod* meth = entry.second;
     // We were compiled, so we must be warm.
@@ -1824,8 +1695,7 @@
     if (entry.method->IsPreCompiled()) {
       entry.method->ClearPreCompiled();
     }
-    Runtime::Current()->GetInstrumentation()->InitializeMethodsCode(entry.method,
-                                                                    /*aot_code=*/nullptr);
+    instr->InitializeMethodsCode(entry.method, /*aot_code=*/nullptr);
   }
 
   saved_compiled_methods_map_.clear();
@@ -1892,6 +1762,31 @@
   histogram_profiling_info_memory_use_.PrintMemoryUse(os);
 }
 
+void JitCodeCache::DumpAllCompiledMethods(std::ostream& os) {
+  MutexLock mu(Thread::Current(), *Locks::jit_lock_);
+  for (auto it : method_code_map_) {  // Includes OSR methods.
+    ArtMethod* meth = it.second;
+    const void* code_ptr = it.first;
+    OatQuickMethodHeader* header = OatQuickMethodHeader::FromCodePointer(code_ptr);
+    os << meth->PrettyMethod() << "@"  << std::hex
+       << code_ptr << "-" << reinterpret_cast<uintptr_t>(code_ptr) + header->GetCodeSize() << '\n';
+  }
+  os << "JNIStubs: \n";
+  for (auto it : jni_stubs_map_) {
+    const void* code_ptr = it.second.GetCode();
+    if (code_ptr == nullptr) {
+      continue;
+    }
+    OatQuickMethodHeader* header = OatQuickMethodHeader::FromCodePointer(code_ptr);
+    os << std::hex << code_ptr << "-"
+       << reinterpret_cast<uintptr_t>(code_ptr) + header->GetCodeSize() << " ";
+    for (ArtMethod* m : it.second.GetMethods()) {
+      os << m->PrettyMethod() << ";";
+    }
+    os << "\n";
+  }
+}
+
 void JitCodeCache::PostForkChildAction(bool is_system_server, bool is_zygote) {
   Thread* self = Thread::Current();
 
@@ -1900,7 +1795,7 @@
   // JitCodeCache::PostForkChildAction first, and then does some code loading
   // that may result in new JIT tasks that we want to keep.
   Runtime* runtime = Runtime::Current();
-  ThreadPool* pool = runtime->GetJit()->GetThreadPool();
+  JitThreadPool* pool = runtime->GetJit()->GetThreadPool();
   if (pool != nullptr) {
     pool->RemoveAllTasks(self);
   }
@@ -1934,7 +1829,7 @@
                                   /* rwx_memory_allowed= */ !is_system_server,
                                   is_zygote,
                                   &error_msg)) {
-    LOG(WARNING) << "Could not create private region after zygote fork: " << error_msg;
+    LOG(FATAL) << "Could not create private region after zygote fork: " << error_msg;
   }
   if (private_region_.HasCodeMapping()) {
     const MemMap* exec_pages = private_region_.GetExecPages();
diff --git a/runtime/jit/jit_code_cache.h b/runtime/jit/jit_code_cache.h
index a6b101b..96fc7e2 100644
--- a/runtime/jit/jit_code_cache.h
+++ b/runtime/jit/jit_code_cache.h
@@ -17,6 +17,7 @@
 #ifndef ART_RUNTIME_JIT_JIT_CODE_CACHE_H_
 #define ART_RUNTIME_JIT_JIT_CODE_CACHE_H_
 
+#include <cstdint>
 #include <iosfwd>
 #include <memory>
 #include <set>
@@ -36,7 +37,7 @@
 #include "jit_memory_region.h"
 #include "profiling_info.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtMethod;
 template<class T> class Handle;
@@ -181,12 +182,19 @@
 class JitCodeCache {
  public:
   static constexpr size_t kMaxCapacity = 64 * MB;
-  // Put the default to a very low amount for debug builds to stress the code cache
-  // collection.
-  static constexpr size_t kInitialCapacity = kIsDebugBuild ? 8 * KB : 64 * KB;
 
-  // By default, do not GC until reaching 256KB.
-  static constexpr size_t kReservedCapacity = kInitialCapacity * 4;
+  // Default initial capacity of the JIT code cache.
+  static size_t GetInitialCapacity() {
+    // This function is called during static initialization
+    // when gPageSize might not be available yet.
+    const size_t page_size = GetPageSizeSlow();
+
+    // Put the default to a very low amount for debug builds to stress the code cache
+    // collection. It should be at least two pages, however, as the storage is split
+    // into data and code sections with sizes that should be aligned to page size each
+    // as that's the unit mspaces use. See also: JitMemoryRegion::Initialize.
+    return std::max(kIsDebugBuild ? 8 * KB : 64 * KB, 2 * page_size);
+  }
 
   // Create the code cache with a code + data capacity equal to "capacity", error message is passed
   // in the out arg error_msg.
@@ -203,7 +211,7 @@
       REQUIRES_SHARED(Locks::mutator_lock_)
       REQUIRES(!Locks::jit_lock_);
 
-  void NotifyMethodRedefined(ArtMethod* method)
+  EXPORT void NotifyMethodRedefined(ArtMethod* method)
       REQUIRES(Locks::mutator_lock_)
       REQUIRES(!Locks::jit_lock_);
 
@@ -224,13 +232,13 @@
       REQUIRES(!Locks::jit_lock_);
 
   // Return true if the code cache contains this pc.
-  bool ContainsPc(const void* pc) const;
+  EXPORT bool ContainsPc(const void* pc) const;
 
   // Return true if the code cache contains this pc in the private region (i.e. not from zygote).
   bool PrivateRegionContainsPc(const void* pc) const;
 
   // Return true if the code cache contains this method.
-  bool ContainsMethod(ArtMethod* method)
+  EXPORT bool ContainsMethod(ArtMethod* method)
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Locks::jit_lock_);
 
   // Return the code pointer for a JNI-compiled stub if the method is in the cache, null otherwise.
@@ -264,11 +272,10 @@
               ArrayRef<const uint8_t> code,           // Compiler output (source).
               ArrayRef<const uint8_t> reserved_data,  // Uninitialized destination.
               const std::vector<Handle<mirror::Object>>& roots,
-              ArrayRef<const uint8_t> stack_map,      // Compiler output (source).
+              ArrayRef<const uint8_t> stack_map,  // Compiler output (source).
               const std::vector<uint8_t>& debug_info,
               bool is_full_debug_info,
               CompilationKind compilation_kind,
-              bool has_should_deoptimize_flag,
               const ArenaSet<ArtMethod*>& cha_single_implementation_list)
       REQUIRES_SHARED(Locks::mutator_lock_)
       REQUIRES(!Locks::jit_lock_);
@@ -282,7 +289,7 @@
       REQUIRES(Locks::jit_lock_);
 
   // Perform a collection on the code cache.
-  void GarbageCollectCache(Thread* self)
+  EXPORT void GarbageCollectCache(Thread* self)
       REQUIRES(!Locks::jit_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
@@ -293,14 +300,14 @@
       REQUIRES(!Locks::jit_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  OatQuickMethodHeader* LookupOsrMethodHeader(ArtMethod* method)
+  EXPORT OatQuickMethodHeader* LookupOsrMethodHeader(ArtMethod* method)
       REQUIRES(!Locks::jit_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Removes method from the cache for testing purposes. The caller
   // must ensure that all threads are suspended and the method should
   // not be in any thread's stack.
-  bool RemoveMethod(ArtMethod* method, bool release_memory)
+  EXPORT bool RemoveMethod(ArtMethod* method, bool release_memory)
       REQUIRES(!Locks::jit_lock_)
       REQUIRES(Locks::mutator_lock_);
 
@@ -317,7 +324,8 @@
   // Create a 'ProfileInfo' for 'method'.
   ProfilingInfo* AddProfilingInfo(Thread* self,
                                   ArtMethod* method,
-                                  const std::vector<uint32_t>& entries)
+                                  const std::vector<uint32_t>& inline_cache_entries,
+                                  const std::vector<uint32_t>& branch_cache_entries)
       REQUIRES(!Locks::jit_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
@@ -328,12 +336,14 @@
   void* MoreCore(const void* mspace, intptr_t increment);
 
   // Adds to `methods` all profiled methods which are part of any of the given dex locations.
-  void GetProfiledMethods(const std::set<std::string>& dex_base_locations,
-                          std::vector<ProfileMethodInfo>& methods)
-      REQUIRES(!Locks::jit_lock_)
+  // Saves inline caches for a method if its hotness meets `inline_cache_threshold` after being
+  // baseline compiled.
+  EXPORT void GetProfiledMethods(const std::set<std::string>& dex_base_locations,
+                                 std::vector<ProfileMethodInfo>& methods,
+                                 uint16_t inline_cache_threshold) REQUIRES(!Locks::jit_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  void InvalidateAllCompiledCode()
+  EXPORT void InvalidateAllCompiledCode()
       REQUIRES(!Locks::jit_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
@@ -342,6 +352,9 @@
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   void Dump(std::ostream& os) REQUIRES(!Locks::jit_lock_);
+  void DumpAllCompiledMethods(std::ostream& os)
+      REQUIRES(!Locks::jit_lock_)
+      REQUIRES_SHARED(Locks::mutator_lock_);
 
   bool IsOsrCompiled(ArtMethod* method) REQUIRES(!Locks::jit_lock_);
 
@@ -357,11 +370,11 @@
 
   // Notify the code cache that the method at the pointer 'old_method' is being moved to the pointer
   // 'new_method' since it is being made obsolete.
-  void MoveObsoleteMethod(ArtMethod* old_method, ArtMethod* new_method)
+  EXPORT void MoveObsoleteMethod(ArtMethod* old_method, ArtMethod* new_method)
       REQUIRES(!Locks::jit_lock_) REQUIRES(Locks::mutator_lock_);
 
   // Dynamically change whether we want to garbage collect code.
-  void SetGarbageCollectCode(bool value) REQUIRES(!Locks::jit_lock_);
+  EXPORT void SetGarbageCollectCode(bool value) REQUIRES(!Locks::jit_lock_);
 
   bool GetGarbageCollectCode() REQUIRES(!Locks::jit_lock_);
 
@@ -379,13 +392,13 @@
       REQUIRES(!Locks::jit_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  void PostForkChildAction(bool is_system_server, bool is_zygote);
+  EXPORT void PostForkChildAction(bool is_system_server, bool is_zygote);
 
   // Clear the entrypoints of JIT compiled methods that belong in the zygote space.
   // This is used for removing non-debuggable JIT code at the point we realize the runtime
   // is debuggable. Also clear the Precompiled flag from all methods so the non-debuggable code
   // doesn't come back.
-  void TransitionToDebuggable() REQUIRES(!Locks::jit_lock_) REQUIRES(Locks::mutator_lock_);
+  EXPORT void TransitionToDebuggable() REQUIRES(!Locks::jit_lock_) REQUIRES(Locks::mutator_lock_);
 
   JitMemoryRegion* GetCurrentRegion();
   bool IsSharedRegion(const JitMemoryRegion& region) const { return &region == &shared_region_; }
@@ -404,27 +417,19 @@
 
   ProfilingInfo* GetProfilingInfo(ArtMethod* method, Thread* self);
   void ResetHotnessCounter(ArtMethod* method, Thread* self);
-
-  void VisitRoots(RootVisitor* visitor);
-
-  // Return whether `method` is being compiled with the given mode.
-  bool IsMethodBeingCompiled(ArtMethod* method, CompilationKind compilation_kind)
-      REQUIRES(Locks::jit_lock_);
-
-  // Remove `method` from the list of methods meing compiled with the given mode.
-  void RemoveMethodBeingCompiled(ArtMethod* method, CompilationKind compilation_kind)
-      REQUIRES(Locks::jit_lock_);
-
-  // Record that `method` is being compiled with the given mode.
-  void AddMethodBeingCompiled(ArtMethod* method, CompilationKind compilation_kind)
-      REQUIRES(Locks::jit_lock_);
+  void MaybeUpdateInlineCache(ArtMethod* method,
+                              uint32_t dex_pc,
+                              ObjPtr<mirror::Class> cls,
+                              Thread* self)
+      REQUIRES_SHARED(Locks::mutator_lock_);
 
  private:
   JitCodeCache();
 
   ProfilingInfo* AddProfilingInfoInternal(Thread* self,
                                           ArtMethod* method,
-                                          const std::vector<uint32_t>& entries)
+                                          const std::vector<uint32_t>& inline_cache_entries,
+                                          const std::vector<uint32_t>& branch_cache_entries)
       REQUIRES(Locks::jit_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
@@ -478,12 +483,7 @@
   // Return whether the code cache's capacity is at its maximum.
   bool IsAtMaxCapacity() const REQUIRES(Locks::jit_lock_);
 
-  // Return whether we should do a full collection given the current state of the cache.
-  bool ShouldDoFullCollection()
-      REQUIRES(Locks::jit_lock_)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-
-  void DoCollection(Thread* self, bool collect_profiling_info)
+  void DoCollection(Thread* self)
       REQUIRES(!Locks::jit_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
@@ -503,14 +503,15 @@
     return shared_region_.IsInDataSpace(ptr);
   }
 
+  size_t GetReservedCapacity() {
+    return reserved_capacity_;
+  }
+
   bool IsWeakAccessEnabled(Thread* self) const;
   void WaitUntilInlineCacheAccessible(Thread* self)
       REQUIRES(!Locks::jit_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  // Return whether `method` is being compiled in any mode.
-  bool IsMethodBeingCompiled(ArtMethod* method) REQUIRES(Locks::jit_lock_);
-
   class JniStubKey;
   class JniStubData;
 
@@ -522,6 +523,12 @@
   // Condition to wait on for accessing inline caches.
   ConditionVariable inline_cache_cond_ GUARDED_BY(Locks::jit_lock_);
 
+  // Reserved capacity of the JIT code cache.
+  const size_t reserved_capacity_;
+
+  // By default, do not GC until reaching four times the initial capacity.
+  static constexpr size_t kReservedCapacityMultiplier = 4;
+
   // -------------- JIT memory regions ------------------------------------- //
 
   // Shared region, inherited from the zygote.
@@ -556,11 +563,6 @@
   // ProfilingInfo objects we have allocated.
   SafeMap<ArtMethod*, ProfilingInfo*> profiling_infos_ GUARDED_BY(Locks::jit_lock_);
 
-  // Methods we are currently compiling, one set for each kind of compilation.
-  std::set<ArtMethod*> current_optimized_compilations_ GUARDED_BY(Locks::jit_lock_);
-  std::set<ArtMethod*> current_osr_compilations_ GUARDED_BY(Locks::jit_lock_);
-  std::set<ArtMethod*> current_baseline_compilations_ GUARDED_BY(Locks::jit_lock_);
-
   // Methods that the zygote has compiled and can be shared across processes
   // forked from the zygote.
   ZygoteMap zygote_map_;
@@ -576,9 +578,6 @@
   // Bitmap for collecting code and data.
   std::unique_ptr<CodeCacheBitmap> live_bitmap_;
 
-  // Whether the last collection round increased the code cache.
-  bool last_collection_increased_code_cache_ GUARDED_BY(Locks::jit_lock_);
-
   // Whether we can do garbage collection. Not 'const' as tests may override this.
   bool garbage_collect_code_ GUARDED_BY(Locks::jit_lock_);
 
@@ -605,7 +604,6 @@
   // Histograms for keeping track of profiling info statistics.
   Histogram<uint64_t> histogram_profiling_info_memory_use_ GUARDED_BY(Locks::jit_lock_);
 
-  friend class art::JitJniStubTestHelper;
   friend class ScopedCodeCacheWrite;
   friend class MarkCodeClosure;
 
diff --git a/runtime/jit/jit_load_test.cc b/runtime/jit/jit_load_test.cc
deleted file mode 100644
index 4b080a5..0000000
--- a/runtime/jit/jit_load_test.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "common_runtime_test.h"
-#include "compiler_callbacks.h"
-
-namespace art {
-
-class JitLoadTest : public CommonRuntimeTest {
- protected:
-  void SetUpRuntimeOptions(RuntimeOptions *options) override {
-    callbacks_.reset();
-    CommonRuntimeTest::SetUpRuntimeOptions(options);
-    options->push_back(std::make_pair("-Xusejit:true", nullptr));
-  }
-};
-
-
-TEST_F(JitLoadTest, JitLoad) {
-  Thread::Current()->TransitionFromSuspendedToRunnable();
-  runtime_->Start();
-  ASSERT_NE(runtime_->GetJit(), nullptr);
-}
-
-}  // namespace art
diff --git a/runtime/jit/jit_memory_region.cc b/runtime/jit/jit_memory_region.cc
index 410bf70..e3a97ef 100644
--- a/runtime/jit/jit_memory_region.cc
+++ b/runtime/jit/jit_memory_region.cc
@@ -29,17 +29,17 @@
 #include "base/systrace.h"
 #include "gc/allocator/art-dlmalloc.h"
 #include "jit/jit_scoped_code_cache_write.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "palette/palette.h"
 
 using android::base::unique_fd;
 
-namespace art {
+namespace art HIDDEN {
 namespace jit {
 
 // Data cache will be half of the capacity
 // Code cache will be the other half of the capacity.
-// TODO: Make this variable?
+// TODO: Make this adjustable. Currently must be 2. JitCodeCache relies on that.
 static constexpr size_t kCodeAndDataCapacityDivider = 2;
 
 bool JitMemoryRegion::Initialize(size_t initial_capacity,
@@ -52,8 +52,8 @@
   CHECK_GE(max_capacity, initial_capacity);
   CHECK(max_capacity <= 1 * GB) << "The max supported size for JIT code cache is 1GB";
   // Align both capacities to page size, as that's the unit mspaces use.
-  initial_capacity_ = RoundDown(initial_capacity, 2 * kPageSize);
-  max_capacity_ = RoundDown(max_capacity, 2 * kPageSize);
+  initial_capacity_ = RoundDown(initial_capacity, 2 * gPageSize);
+  max_capacity_ = RoundDown(max_capacity, 2 * gPageSize);
   current_capacity_ = initial_capacity,
   data_end_ = initial_capacity / kCodeAndDataCapacityDivider;
   exec_end_ = initial_capacity - data_end_;
@@ -276,7 +276,7 @@
 
   // Allow mspace to use the full data capacity.
   // It will still only use as litle memory as possible and ask for MoreCore as needed.
-  CHECK(IsAlignedParam(data_capacity, kPageSize));
+  CHECK(IsAlignedParam(data_capacity, gPageSize));
   mspace_set_footprint_limit(data_mspace_, data_capacity);
 
   // Initialize the code heap.
@@ -304,7 +304,7 @@
 
 void JitMemoryRegion::SetFootprintLimit(size_t new_footprint) {
   size_t data_space_footprint = new_footprint / kCodeAndDataCapacityDivider;
-  DCHECK(IsAlignedParam(data_space_footprint, kPageSize));
+  DCHECK(IsAlignedParam(data_space_footprint, gPageSize));
   DCHECK_EQ(data_space_footprint * kCodeAndDataCapacityDivider, new_footprint);
   if (HasCodeMapping()) {
     ScopedCodeCacheWrite scc(*this);
@@ -355,8 +355,7 @@
 
 const uint8_t* JitMemoryRegion::CommitCode(ArrayRef<const uint8_t> reserved_code,
                                            ArrayRef<const uint8_t> code,
-                                           const uint8_t* stack_map,
-                                           bool has_should_deoptimize_flag) {
+                                           const uint8_t* stack_map) {
   DCHECK(IsInExecSpace(reserved_code.data()));
   ScopedCodeCacheWrite scc(*this);
 
@@ -382,9 +381,6 @@
   OatQuickMethodHeader* method_header =
       OatQuickMethodHeader::FromCodePointer(w_memory + header_size);
   new (method_header) OatQuickMethodHeader((stack_map != nullptr) ? result - stack_map : 0u);
-  if (has_should_deoptimize_flag) {
-    method_header->SetHasShouldDeoptimizeFlag();
-  }
 
   // Both instruction and data caches need flushing to the point of unification where both share
   // a common view of memory. Flushing the data cache ensures the dirty cachelines from the
@@ -590,8 +586,8 @@
   return fd;
 }
 
-bool JitMemoryRegion::ProtectZygoteMemory(int fd ATTRIBUTE_UNUSED,
-                                          std::string* error_msg ATTRIBUTE_UNUSED) {
+bool JitMemoryRegion::ProtectZygoteMemory([[maybe_unused]] int fd,
+                                          [[maybe_unused]] std::string* error_msg) {
   return true;
 }
 
diff --git a/runtime/jit/jit_memory_region.h b/runtime/jit/jit_memory_region.h
index 6db931d..7391541 100644
--- a/runtime/jit/jit_memory_region.h
+++ b/runtime/jit/jit_memory_region.h
@@ -26,7 +26,7 @@
 #include "gc_root-inl.h"
 #include "handle.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Object;
@@ -90,8 +90,7 @@
   // Returns pointer to copied code (within reserved_code region; after OatQuickMethodHeader).
   const uint8_t* CommitCode(ArrayRef<const uint8_t> reserved_code,
                             ArrayRef<const uint8_t> code,
-                            const uint8_t* stack_map,
-                            bool has_should_deoptimize_flag)
+                            const uint8_t* stack_map)
       REQUIRES(Locks::jit_lock_);
 
   // Emit roots and stack map into the memory pointed by `roots_data` (despite it being const).
diff --git a/runtime/jit/jit_memory_region_test.cc b/runtime/jit/jit_memory_region_test.cc
index 2a79777..449255a 100644
--- a/runtime/jit/jit_memory_region_test.cc
+++ b/runtime/jit/jit_memory_region_test.cc
@@ -29,7 +29,7 @@
 #include "base/utils.h"
 #include "common_runtime_test.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace jit {
 
 // These tests only run on bionic.
@@ -39,8 +39,7 @@
 // These globals are only set in child processes.
 void* gAddrToFaultOn = nullptr;
 
-[[noreturn]]
-void handler(int ATTRIBUTE_UNUSED, siginfo_t* info, void* ATTRIBUTE_UNUSED) {
+[[noreturn]] void handler([[maybe_unused]] int, siginfo_t* info, [[maybe_unused]] void*) {
   CHECK_EQ(info->si_addr, gAddrToFaultOn);
   exit(kReturnFromFault);
 }
@@ -59,13 +58,13 @@
     // Zygote JIT memory only works on kernels that don't segfault on flush.
     TEST_DISABLED_FOR_KERNELS_WITH_CACHE_SEGFAULT();
     std::string error_msg;
-    size_t size = kPageSize;
-    android::base::unique_fd fd(JitMemoryRegion::CreateZygoteMemory(size, &error_msg));
+    const size_t page_size = GetPageSizeSlow();
+    android::base::unique_fd fd(JitMemoryRegion::CreateZygoteMemory(page_size, &error_msg));
     CHECK_NE(fd.get(), -1);
 
     // Create a writable mapping.
     int32_t* addr = reinterpret_cast<int32_t*>(
-        mmap(nullptr, kPageSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0));
+        mmap(nullptr, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0));
     CHECK(addr != nullptr);
     CHECK_NE(addr, MAP_FAILED);
 
@@ -83,24 +82,24 @@
 
     // Test that we cannot create another writable mapping.
     int32_t* addr2 = reinterpret_cast<int32_t*>(
-        mmap(nullptr, kPageSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0));
+        mmap(nullptr, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0));
     CHECK_EQ(addr2, MAP_FAILED);
 
     // With the existing mapping, we can toggle read/write.
-    CHECK_EQ(mprotect(addr, size, PROT_READ), 0) << strerror(errno);
-    CHECK_EQ(mprotect(addr, size, PROT_READ | PROT_WRITE), 0) << strerror(errno);
+    CHECK_EQ(mprotect(addr, page_size, PROT_READ), 0) << strerror(errno);
+    CHECK_EQ(mprotect(addr, page_size, PROT_READ | PROT_WRITE), 0) << strerror(errno);
 
     // Test mremap with old_size = 0. From the man pages:
     //    If the value of old_size is zero, and old_address refers to a shareable mapping
     //    (see mmap(2) MAP_SHARED), then mremap() will create a new mapping of the same pages.
-    addr2 = reinterpret_cast<int32_t*>(mremap(addr, 0, kPageSize, MREMAP_MAYMOVE));
+    addr2 = reinterpret_cast<int32_t*>(mremap(addr, 0, page_size, MREMAP_MAYMOVE));
     CHECK_NE(addr2, MAP_FAILED);
 
     // Test that we can  write into the remapped mapping.
     addr2[0] = 3;
     CHECK_EQ(addr2[0], 3);
 
-    addr2 = reinterpret_cast<int32_t*>(mremap(addr, kPageSize, 2 * kPageSize, MREMAP_MAYMOVE));
+    addr2 = reinterpret_cast<int32_t*>(mremap(addr, page_size, 2 * page_size, MREMAP_MAYMOVE));
     CHECK_NE(addr2, MAP_FAILED);
 
     // Test that we can  write into the remapped mapping.
@@ -112,16 +111,16 @@
     // Zygote JIT memory only works on kernels that don't segfault on flush.
     TEST_DISABLED_FOR_KERNELS_WITH_CACHE_SEGFAULT();
     std::string error_msg;
-    size_t size = kPageSize;
+    const size_t page_size = GetPageSizeSlow();
     int32_t* addr = nullptr;
     int32_t* addr2 = nullptr;
     {
-      android::base::unique_fd fd(JitMemoryRegion::CreateZygoteMemory(size, &error_msg));
+      android::base::unique_fd fd(JitMemoryRegion::CreateZygoteMemory(page_size, &error_msg));
       CHECK_NE(fd.get(), -1);
 
       // Create a writable mapping.
       addr = reinterpret_cast<int32_t*>(
-          mmap(nullptr, kPageSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0));
+          mmap(nullptr, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0));
       CHECK(addr != nullptr);
       CHECK_NE(addr, MAP_FAILED);
 
@@ -131,7 +130,7 @@
 
       // Create a read-only mapping.
       addr2 = reinterpret_cast<int32_t*>(
-          mmap(nullptr, kPageSize, PROT_READ, MAP_SHARED, fd.get(), 0));
+          mmap(nullptr, page_size, PROT_READ, MAP_SHARED, fd.get(), 0));
       CHECK(addr2 != nullptr);
 
       // Protect the memory.
@@ -142,10 +141,10 @@
     // there.
 
     // Create a mapping of atomic ints to communicate between processes.
-    android::base::unique_fd fd2(JitMemoryRegion::CreateZygoteMemory(size, &error_msg));
+    android::base::unique_fd fd2(JitMemoryRegion::CreateZygoteMemory(page_size, &error_msg));
     CHECK_NE(fd2.get(), -1);
     std::atomic<int32_t>* shared = reinterpret_cast<std::atomic<int32_t>*>(
-        mmap(nullptr, kPageSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2.get(), 0));
+        mmap(nullptr, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd2.get(), 0));
 
     // Values used for the tests below.
     const int32_t parent_value = 66;
@@ -164,7 +163,7 @@
       CHECK_EQ(addr2[0], child_value);
 
       // Unmap the writable mappping.
-      munmap(addr, kPageSize);
+      munmap(addr, page_size);
 
       CHECK_EQ(addr2[0], child_value);
 
@@ -199,9 +198,9 @@
       CHECK_EQ(WEXITSTATUS(status), kReturnFromFault);
       CHECK_EQ(addr[0], parent_value);
       CHECK_EQ(addr2[0], parent_value);
-      munmap(addr, kPageSize);
-      munmap(addr2, kPageSize);
-      munmap(shared, kPageSize);
+      munmap(addr, page_size);
+      munmap(addr2, page_size);
+      munmap(shared, page_size);
     }
   }
 
@@ -209,19 +208,19 @@
     // Zygote JIT memory only works on kernels that don't segfault on flush.
     TEST_DISABLED_FOR_KERNELS_WITH_CACHE_SEGFAULT();
     std::string error_msg;
-    size_t size = kPageSize;
+    const size_t page_size = GetPageSizeSlow();
     int32_t* addr = nullptr;
     int32_t* addr2 = nullptr;
     {
-      android::base::unique_fd fd(JitMemoryRegion::CreateZygoteMemory(size, &error_msg));
+      android::base::unique_fd fd(JitMemoryRegion::CreateZygoteMemory(page_size, &error_msg));
       CHECK_NE(fd.get(), -1);
 
       // Create a writable mapping.
       addr = reinterpret_cast<int32_t*>(
-          mmap(nullptr, kPageSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0));
+          mmap(nullptr, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0));
       CHECK(addr != nullptr);
       CHECK_NE(addr, MAP_FAILED);
-      CHECK_EQ(madvise(addr, kPageSize, MADV_DONTFORK), 0);
+      CHECK_EQ(madvise(addr, page_size, MADV_DONTFORK), 0);
 
       // Test that we can write into the mapping.
       addr[0] = 42;
@@ -229,7 +228,7 @@
 
       // Create a read-only mapping.
       addr2 = reinterpret_cast<int32_t*>(
-          mmap(nullptr, kPageSize, PROT_READ, MAP_SHARED, fd.get(), 0));
+          mmap(nullptr, page_size, PROT_READ, MAP_SHARED, fd.get(), 0));
       CHECK(addr2 != nullptr);
 
       // Protect the memory.
@@ -240,10 +239,10 @@
     // there.
 
     // Create a mapping of atomic ints to communicate between processes.
-    android::base::unique_fd fd2(JitMemoryRegion::CreateZygoteMemory(size, &error_msg));
+    android::base::unique_fd fd2(JitMemoryRegion::CreateZygoteMemory(page_size, &error_msg));
     CHECK_NE(fd2.get(), -1);
     std::atomic<int32_t>* shared = reinterpret_cast<std::atomic<int32_t>*>(
-        mmap(nullptr, kPageSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2.get(), 0));
+        mmap(nullptr, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd2.get(), 0));
 
     // Values used for the tests below.
     const int32_t parent_value = 66;
@@ -289,9 +288,9 @@
       CHECK_EQ(addr[0], parent_value);
       CHECK_EQ(addr2[0], parent_value);
 
-      munmap(addr, kPageSize);
-      munmap(addr2, kPageSize);
-      munmap(shared, kPageSize);
+      munmap(addr, page_size);
+      munmap(addr2, page_size);
+      munmap(shared, page_size);
     }
   }
 
@@ -308,14 +307,14 @@
       return;
     }
     std::string error_msg;
-    size_t size = kPageSize;
+    const size_t page_size = GetPageSizeSlow();
     int32_t* addr = nullptr;
-    android::base::unique_fd fd(JitMemoryRegion::CreateZygoteMemory(size, &error_msg));
+    android::base::unique_fd fd(JitMemoryRegion::CreateZygoteMemory(page_size, &error_msg));
     CHECK_NE(fd.get(), -1);
 
     // Create a writable mapping.
     addr = reinterpret_cast<int32_t*>(
-        mmap(nullptr, kPageSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0));
+        mmap(nullptr, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0));
     CHECK(addr != nullptr);
     CHECK_NE(addr, MAP_FAILED);
 
@@ -324,10 +323,10 @@
     CHECK_EQ(addr[0], 42);
 
     // Create another mapping of atomic ints to communicate between processes.
-    android::base::unique_fd fd2(JitMemoryRegion::CreateZygoteMemory(size, &error_msg));
+    android::base::unique_fd fd2(JitMemoryRegion::CreateZygoteMemory(page_size, &error_msg));
     CHECK_NE(fd2.get(), -1);
     std::atomic<int32_t>* shared = reinterpret_cast<std::atomic<int32_t>*>(
-        mmap(nullptr, kPageSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2.get(), 0));
+        mmap(nullptr, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd2.get(), 0));
 
     // Protect the memory.
     CHECK(JitMemoryRegion::ProtectZygoteMemory(fd.get(), &error_msg));
@@ -343,7 +342,7 @@
     shared[0] = 0;
     pid_t pid = fork();
     if (pid == 0) {
-      CHECK_EQ(mmap(addr, kPageSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd.get(), 0),
+      CHECK_EQ(mmap(addr, page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd.get(), 0),
                addr);
       addr[0] = child_value;
       exit(0);
@@ -362,18 +361,18 @@
     if (pid == 0) {
       // Map it private with write access. MAP_FIXED will replace the existing
       // mapping.
-      CHECK_EQ(mmap(addr, kPageSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd.get(), 0),
+      CHECK_EQ(mmap(addr, page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd.get(), 0),
                addr);
       addr[0] = child_value;
       CHECK_EQ(addr[0], child_value);
 
       // Check that mapping shared with write access fails.
-      CHECK_EQ(mmap(addr, kPageSize, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, fd.get(), 0),
+      CHECK_EQ(mmap(addr, page_size, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, fd.get(), 0),
                MAP_FAILED);
       CHECK_EQ(errno, EPERM);
 
       // Map shared with read access.
-      CHECK_EQ(mmap(addr, kPageSize, PROT_READ, MAP_SHARED | MAP_FIXED, fd.get(), 0), addr);
+      CHECK_EQ(mmap(addr, page_size, PROT_READ, MAP_SHARED | MAP_FIXED, fd.get(), 0), addr);
       CHECK_NE(addr[0], child_value);
 
       // Wait for the parent to notify.
@@ -386,13 +385,13 @@
       shared[0] = 2;
 
       // Map it private again.
-      CHECK_EQ(mmap(addr, kPageSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd.get(), 0),
+      CHECK_EQ(mmap(addr, page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd.get(), 0),
                addr);
       addr[0] = child_value + 1;
       CHECK_EQ(addr[0], child_value + 1);
 
       // And map it back shared.
-      CHECK_EQ(mmap(addr, kPageSize, PROT_READ, MAP_SHARED | MAP_FIXED, fd.get(), 0), addr);
+      CHECK_EQ(mmap(addr, page_size, PROT_READ, MAP_SHARED | MAP_FIXED, fd.get(), 0), addr);
       while (shared[0] != 3) {
         sched_yield();
       }
@@ -426,7 +425,7 @@
     addr[0] = starting_value;
     pid = fork();
     if (pid == 0) {
-      CHECK_EQ(mmap(addr, kPageSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd.get(), 0),
+      CHECK_EQ(mmap(addr, page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd.get(), 0),
                addr);
       CHECK_EQ(addr[0], starting_value);
       addr[0] = child_value;
@@ -443,7 +442,7 @@
       CHECK_EQ(addr[0], child_value);
 
       // Test the buffer contains the parent data after a new mmap.
-      CHECK_EQ(mmap(addr, kPageSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd.get(), 0),
+      CHECK_EQ(mmap(addr, page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd.get(), 0),
                addr);
       CHECK_EQ(addr[0], parent_value);
       exit(0);
@@ -468,7 +467,7 @@
     addr[0] = starting_value;
     pid = fork();
     if (pid == 0) {
-      CHECK_EQ(mmap(addr, kPageSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd.get(), 0),
+      CHECK_EQ(mmap(addr, page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd.get(), 0),
                addr);
       CHECK_EQ(addr[0], starting_value);
       // Notify the parent for a new update of the buffer.
@@ -490,8 +489,8 @@
       CHECK(WIFEXITED(status)) << strerror(errno);
       CHECK_EQ(addr[0], parent_value);
     }
-    munmap(addr, kPageSize);
-    munmap(shared, kPageSize);
+    munmap(addr, page_size);
+    munmap(shared, page_size);
   }
 
   // Test that a readable mapping created befire sealing future writes, can be
@@ -500,15 +499,15 @@
     // Zygote JIT memory only works on kernels that don't segfault on flush.
     TEST_DISABLED_FOR_KERNELS_WITH_CACHE_SEGFAULT();
     std::string error_msg;
-    size_t size = kPageSize;
+    const size_t page_size = GetPageSizeSlow();
     int32_t* addr = nullptr;
     {
-      android::base::unique_fd fd(JitMemoryRegion::CreateZygoteMemory(size, &error_msg));
+      android::base::unique_fd fd(JitMemoryRegion::CreateZygoteMemory(page_size, &error_msg));
       CHECK_NE(fd.get(), -1);
 
       // Create a shared readable mapping.
       addr = reinterpret_cast<int32_t*>(
-          mmap(nullptr, kPageSize, PROT_READ, MAP_SHARED, fd.get(), 0));
+          mmap(nullptr, page_size, PROT_READ, MAP_SHARED, fd.get(), 0));
       CHECK(addr != nullptr);
       CHECK_NE(addr, MAP_FAILED);
 
@@ -518,7 +517,7 @@
     }
     // At this point, the fd has been dropped, but the memory mappings are still
     // there.
-    int res = mprotect(addr, kPageSize, PROT_WRITE);
+    int res = mprotect(addr, page_size, PROT_WRITE);
     CHECK_EQ(res, 0);
   }
 
@@ -527,10 +526,10 @@
     // Zygote JIT memory only works on kernels that don't segfault on flush.
     TEST_DISABLED_FOR_KERNELS_WITH_CACHE_SEGFAULT();
     std::string error_msg;
-    size_t size = kPageSize;
+    const size_t page_size = GetPageSizeSlow();
     int32_t* addr = nullptr;
     {
-      android::base::unique_fd fd(JitMemoryRegion::CreateZygoteMemory(size, &error_msg));
+      android::base::unique_fd fd(JitMemoryRegion::CreateZygoteMemory(page_size, &error_msg));
       CHECK_NE(fd.get(), -1);
 
       // Protect the memory.
@@ -539,13 +538,13 @@
 
       // Create a shared readable mapping.
       addr = reinterpret_cast<int32_t*>(
-          mmap(nullptr, kPageSize, PROT_READ, MAP_SHARED, fd.get(), 0));
+          mmap(nullptr, page_size, PROT_READ, MAP_SHARED, fd.get(), 0));
       CHECK(addr != nullptr);
       CHECK_NE(addr, MAP_FAILED);
     }
     // At this point, the fd has been dropped, but the memory mappings are still
     // there.
-    int res = mprotect(addr, kPageSize, PROT_WRITE);
+    int res = mprotect(addr, page_size, PROT_WRITE);
     CHECK_EQ(res, -1);
     CHECK_EQ(errno, EACCES);
   }
diff --git a/runtime/jit/jit_options.cc b/runtime/jit/jit_options.cc
new file mode 100644
index 0000000..3c31d1d
--- /dev/null
+++ b/runtime/jit/jit_options.cc
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "jit_options.h"
+
+#include "runtime_options.h"
+
+namespace art HIDDEN {
+namespace jit {
+
+// Maximum permitted threshold value.
+static constexpr uint32_t kJitMaxThreshold = std::numeric_limits<uint16_t>::max();
+
+static constexpr uint32_t kJitDefaultOptimizeThreshold = 0xffff;
+// Different optimization threshold constants. These default to the equivalent optimization
+// thresholds divided by 2, but can be overridden at the command-line.
+static constexpr uint32_t kJitStressDefaultOptimizeThreshold = kJitDefaultOptimizeThreshold / 2;
+static constexpr uint32_t kJitSlowStressDefaultOptimizeThreshold =
+    kJitStressDefaultOptimizeThreshold / 2;
+
+static constexpr uint32_t kJitDefaultWarmupThreshold = 0x3fff;
+// Different warm-up threshold constants. These default to the equivalent warmup thresholds divided
+// by 2, but can be overridden at the command-line.
+static constexpr uint32_t kJitStressDefaultWarmupThreshold = kJitDefaultWarmupThreshold / 2;
+static constexpr uint32_t kJitSlowStressDefaultWarmupThreshold =
+    kJitStressDefaultWarmupThreshold / 2;
+
+static constexpr size_t kDefaultPriorityThreadWeightRatio = 1000;
+static constexpr size_t kDefaultInvokeTransitionWeightRatio = 500;
+
+DEFINE_RUNTIME_DEBUG_FLAG(JitOptions, kSlowMode);
+
+JitOptions* JitOptions::CreateFromRuntimeArguments(const RuntimeArgumentMap& options) {
+  auto* jit_options = new JitOptions;
+  jit_options->use_jit_compilation_ = options.GetOrDefault(RuntimeArgumentMap::UseJitCompilation);
+  jit_options->use_profiled_jit_compilation_ =
+      options.GetOrDefault(RuntimeArgumentMap::UseProfiledJitCompilation);
+
+  jit_options->code_cache_initial_capacity_ =
+      options.GetOrDefault(RuntimeArgumentMap::JITCodeCacheInitialCapacity);
+  jit_options->code_cache_max_capacity_ =
+      options.GetOrDefault(RuntimeArgumentMap::JITCodeCacheMaxCapacity);
+  jit_options->dump_info_on_shutdown_ =
+      options.Exists(RuntimeArgumentMap::DumpJITInfoOnShutdown);
+  jit_options->profile_saver_options_ =
+      options.GetOrDefault(RuntimeArgumentMap::ProfileSaverOpts);
+  jit_options->thread_pool_pthread_priority_ =
+      options.GetOrDefault(RuntimeArgumentMap::JITPoolThreadPthreadPriority);
+  jit_options->zygote_thread_pool_pthread_priority_ =
+      options.GetOrDefault(RuntimeArgumentMap::JITZygotePoolThreadPthreadPriority);
+
+  // Set default optimize threshold to aid with checking defaults.
+  jit_options->optimize_threshold_ = kIsDebugBuild
+      ? (kSlowMode ? kJitSlowStressDefaultOptimizeThreshold : kJitStressDefaultOptimizeThreshold)
+      : kJitDefaultOptimizeThreshold;
+
+  // Set default warm-up threshold to aid with checking defaults.
+  jit_options->warmup_threshold_ = kIsDebugBuild
+      ? (kSlowMode ? kJitSlowStressDefaultWarmupThreshold : kJitStressDefaultWarmupThreshold)
+      : kJitDefaultWarmupThreshold;
+
+  if (options.Exists(RuntimeArgumentMap::JITOptimizeThreshold)) {
+    jit_options->optimize_threshold_ = *options.Get(RuntimeArgumentMap::JITOptimizeThreshold);
+  }
+  DCHECK_LE(jit_options->optimize_threshold_, kJitMaxThreshold);
+
+  if (options.Exists(RuntimeArgumentMap::JITWarmupThreshold)) {
+    jit_options->warmup_threshold_ = *options.Get(RuntimeArgumentMap::JITWarmupThreshold);
+  }
+  DCHECK_LE(jit_options->warmup_threshold_, kJitMaxThreshold);
+
+  if (options.Exists(RuntimeArgumentMap::JITPriorityThreadWeight)) {
+    jit_options->priority_thread_weight_ =
+        *options.Get(RuntimeArgumentMap::JITPriorityThreadWeight);
+    if (jit_options->priority_thread_weight_ > jit_options->warmup_threshold_) {
+      LOG(FATAL) << "Priority thread weight is above the warmup threshold.";
+    } else if (jit_options->priority_thread_weight_ == 0) {
+      LOG(FATAL) << "Priority thread weight cannot be 0.";
+    }
+  } else {
+    jit_options->priority_thread_weight_ = std::max(
+        jit_options->warmup_threshold_ / kDefaultPriorityThreadWeightRatio,
+        static_cast<size_t>(1));
+  }
+
+  if (options.Exists(RuntimeArgumentMap::JITInvokeTransitionWeight)) {
+    jit_options->invoke_transition_weight_ =
+        *options.Get(RuntimeArgumentMap::JITInvokeTransitionWeight);
+    if (jit_options->invoke_transition_weight_ > jit_options->warmup_threshold_) {
+      LOG(FATAL) << "Invoke transition weight is above the warmup threshold.";
+    } else if (jit_options->invoke_transition_weight_  == 0) {
+      LOG(FATAL) << "Invoke transition weight cannot be 0.";
+    }
+  } else {
+    jit_options->invoke_transition_weight_ = std::max(
+        jit_options->warmup_threshold_ / kDefaultInvokeTransitionWeightRatio,
+        static_cast<size_t>(1));
+  }
+
+  return jit_options;
+}
+
+}  // namespace jit
+}  // namespace art
diff --git a/runtime/jit/jit_options.h b/runtime/jit/jit_options.h
new file mode 100644
index 0000000..be305b4
--- /dev/null
+++ b/runtime/jit/jit_options.h
@@ -0,0 +1,160 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_RUNTIME_JIT_JIT_OPTIONS_H_
+#define ART_RUNTIME_JIT_JIT_OPTIONS_H_
+
+#include "base/macros.h"
+#include "base/runtime_debug.h"
+#include "profile_saver_options.h"
+
+namespace art HIDDEN {
+
+struct RuntimeArgumentMap;
+
+namespace jit {
+
+// At what priority to schedule jit threads. 9 is the lowest foreground priority on device.
+// See android/os/Process.java.
+static constexpr int kJitPoolThreadPthreadDefaultPriority = 9;
+// At what priority to schedule jit zygote threads compiling profiles in the background.
+// 19 is the lowest background priority on device.
+// See android/os/Process.java.
+static constexpr int kJitZygotePoolThreadPthreadDefaultPriority = 19;
+
+class JitOptions {
+ public:
+  DECLARE_RUNTIME_DEBUG_FLAG(kSlowMode);
+
+  static JitOptions* CreateFromRuntimeArguments(const RuntimeArgumentMap& options);
+
+  uint16_t GetOptimizeThreshold() const {
+    return optimize_threshold_;
+  }
+
+  uint16_t GetWarmupThreshold() const {
+    return warmup_threshold_;
+  }
+
+  uint16_t GetPriorityThreadWeight() const {
+    return priority_thread_weight_;
+  }
+
+  uint16_t GetInvokeTransitionWeight() const {
+    return invoke_transition_weight_;
+  }
+
+  size_t GetCodeCacheInitialCapacity() const {
+    return code_cache_initial_capacity_;
+  }
+
+  size_t GetCodeCacheMaxCapacity() const {
+    return code_cache_max_capacity_;
+  }
+
+  bool DumpJitInfoOnShutdown() const {
+    return dump_info_on_shutdown_;
+  }
+
+  const ProfileSaverOptions& GetProfileSaverOptions() const {
+    return profile_saver_options_;
+  }
+
+  bool GetSaveProfilingInfo() const {
+    return profile_saver_options_.IsEnabled();
+  }
+
+  int GetThreadPoolPthreadPriority() const {
+    return thread_pool_pthread_priority_;
+  }
+
+  int GetZygoteThreadPoolPthreadPriority() const {
+    return zygote_thread_pool_pthread_priority_;
+  }
+
+  bool UseJitCompilation() const {
+    return use_jit_compilation_;
+  }
+
+  bool UseProfiledJitCompilation() const {
+    return use_profiled_jit_compilation_;
+  }
+
+  void SetUseJitCompilation(bool b) {
+    use_jit_compilation_ = b;
+  }
+
+  void SetSaveProfilingInfo(bool save_profiling_info) {
+    profile_saver_options_.SetEnabled(save_profiling_info);
+  }
+
+  void SetWaitForJitNotificationsToSaveProfile(bool value) {
+    profile_saver_options_.SetWaitForJitNotificationsToSave(value);
+  }
+
+  void SetJitAtFirstUse() {
+    use_jit_compilation_ = true;
+    optimize_threshold_ = 0;
+  }
+
+  void SetUseBaselineCompiler() {
+    use_baseline_compiler_ = true;
+  }
+
+  bool UseBaselineCompiler() const {
+    return use_baseline_compiler_;
+  }
+
+ private:
+  // We add the sample in batches of size kJitSamplesBatchSize.
+  // This method rounds the threshold so that it is multiple of the batch size.
+  static uint32_t RoundUpThreshold(uint32_t threshold);
+
+  bool use_jit_compilation_;
+  bool use_profiled_jit_compilation_;
+  bool use_baseline_compiler_;
+  size_t code_cache_initial_capacity_;
+  size_t code_cache_max_capacity_;
+  uint32_t optimize_threshold_;
+  uint32_t warmup_threshold_;
+  uint16_t priority_thread_weight_;
+  uint16_t invoke_transition_weight_;
+  bool dump_info_on_shutdown_;
+  int thread_pool_pthread_priority_;
+  int zygote_thread_pool_pthread_priority_;
+  ProfileSaverOptions profile_saver_options_;
+
+  JitOptions()
+      : use_jit_compilation_(false),
+        use_profiled_jit_compilation_(false),
+        use_baseline_compiler_(false),
+        code_cache_initial_capacity_(0),
+        code_cache_max_capacity_(0),
+        optimize_threshold_(0),
+        warmup_threshold_(0),
+        priority_thread_weight_(0),
+        invoke_transition_weight_(0),
+        dump_info_on_shutdown_(false),
+        thread_pool_pthread_priority_(kJitPoolThreadPthreadDefaultPriority),
+        zygote_thread_pool_pthread_priority_(kJitZygotePoolThreadPthreadDefaultPriority) {}
+
+  DISALLOW_COPY_AND_ASSIGN(JitOptions);
+};
+
+}  // namespace jit
+}  // namespace art
+
+#endif  // ART_RUNTIME_JIT_JIT_OPTIONS_H_
diff --git a/runtime/jit/jit_scoped_code_cache_write.h b/runtime/jit/jit_scoped_code_cache_write.h
index e2adebf..ed21cf9 100644
--- a/runtime/jit/jit_scoped_code_cache_write.h
+++ b/runtime/jit/jit_scoped_code_cache_write.h
@@ -22,7 +22,7 @@
 #include "base/systrace.h"
 #include "base/utils.h"  // For CheckedCall
 
-namespace art {
+namespace art HIDDEN {
 namespace jit {
 
 class JitMemoryRegion;
diff --git a/runtime/jit/profile_saver.cc b/runtime/jit/profile_saver.cc
index 3321636..759e946 100644
--- a/runtime/jit/profile_saver.cc
+++ b/runtime/jit/profile_saver.cc
@@ -39,11 +39,11 @@
 #include "gc/gc_cause.h"
 #include "jit/jit.h"
 #include "jit/profiling_info.h"
-#include "oat_file_manager.h"
+#include "oat/oat_file_manager.h"
 #include "profile/profile_compilation_info.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using Hotness = ProfileCompilationInfo::MethodHotness;
 
@@ -542,6 +542,9 @@
     dex::TypeIndex type_index = k->GetDexTypeIndex();
     uint32_t copied_methods_start = klass->GetCopiedMethodsStartOffset();
     LengthPrefixedArray<ArtMethod>* methods = klass->GetMethodsPtr();
+    if (methods != nullptr) {
+      CHECK_LE(copied_methods_start, methods->size()) << k->PrettyClass();
+    }
 
     DexFileRecords* dex_file_records;
     auto it = dex_file_records_map_.find(&dex_file);
@@ -593,11 +596,13 @@
         continue;
       }
       const size_t methods_size = methods->size();
+      CHECK_LE(class_record.copied_methods_start, methods_size)
+          << dex_file->PrettyType(class_record.type_index);
       for (size_t index = class_record.copied_methods_start; index != methods_size; ++index) {
         // Note: Using `ArtMethod` array with implicit `kRuntimePointerSize`.
         ArtMethod& method = methods->At(index);
-        DCHECK(method.IsCopied());
-        DCHECK(!method.IsNative());
+        CHECK(method.IsCopied()) << dex_file->PrettyType(class_record.type_index);
+        CHECK(!method.IsNative()) << dex_file->PrettyType(class_record.type_index);
         if (method.IsInvokable()) {
           const DexFile* method_dex_file = method.GetDexFile();
           DexFileRecords* method_dex_file_records = dex_file_records;
@@ -863,7 +868,8 @@
     std::vector<ProfileMethodInfo> profile_methods;
     {
       ScopedObjectAccess soa(Thread::Current());
-      jit_code_cache_->GetProfiledMethods(locations, profile_methods);
+      jit_code_cache_->GetProfiledMethods(
+          locations, profile_methods, options_.GetInlineCacheThreshold());
       total_number_of_code_cache_queries_++;
     }
     {
diff --git a/runtime/jit/profile_saver.h b/runtime/jit/profile_saver.h
index b5fb1e6..1042db9 100644
--- a/runtime/jit/profile_saver.h
+++ b/runtime/jit/profile_saver.h
@@ -24,7 +24,7 @@
 #include "profile/profile_compilation_info.h"
 #include "profile_saver_options.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ProfileSaver {
  public:
@@ -53,7 +53,7 @@
   static void NotifyJitActivity() REQUIRES(!Locks::profiler_lock_, !instance_->wait_lock_);
 
   // For testing or manual purposes (SIGUSR1).
-  static void ForceProcessProfiles() REQUIRES(!Locks::profiler_lock_, !Locks::mutator_lock_);
+  EXPORT static void ForceProcessProfiles() REQUIRES(!Locks::profiler_lock_, !Locks::mutator_lock_);
 
   // Notify that startup has completed.
   static void NotifyStartupCompleted() REQUIRES(!Locks::profiler_lock_, !instance_->wait_lock_);
diff --git a/runtime/jit/profile_saver_options.h b/runtime/jit/profile_saver_options.h
index 7492054..f6d928f 100644
--- a/runtime/jit/profile_saver_options.h
+++ b/runtime/jit/profile_saver_options.h
@@ -13,10 +13,11 @@
 #ifndef ART_RUNTIME_JIT_PROFILE_SAVER_OPTIONS_H_
 #define ART_RUNTIME_JIT_PROFILE_SAVER_OPTIONS_H_
 
+#include <cstdint>
 #include <ostream>
 #include <string>
 
-namespace art {
+namespace art HIDDEN {
 
 struct ProfileSaverOptions {
  public:
@@ -33,6 +34,7 @@
   static constexpr uint32_t kMinNotificationBeforeWake = 10;
   static constexpr uint32_t kMaxNotificationBeforeWake = 50;
   static constexpr uint32_t kHotStartupMethodSamplesNotSet = std::numeric_limits<uint32_t>::max();
+  static constexpr uint16_t kInlineCacheThreshold = 4000;
 
   ProfileSaverOptions() :
     enabled_(false),
@@ -44,6 +46,7 @@
     min_classes_to_save_(kMinClassesToSave),
     min_notification_before_wake_(kMinNotificationBeforeWake),
     max_notification_before_wake_(kMaxNotificationBeforeWake),
+    inline_cache_threshold_(kInlineCacheThreshold),
     profile_path_(""),
     profile_boot_class_path_(false),
     profile_aot_code_(false),
@@ -59,6 +62,7 @@
       uint32_t min_classes_to_save,
       uint32_t min_notification_before_wake,
       uint32_t max_notification_before_wake,
+      uint16_t inline_cache_threshold,
       const std::string& profile_path,
       bool profile_boot_class_path,
       bool profile_aot_code = false,
@@ -72,6 +76,7 @@
     min_classes_to_save_(min_classes_to_save),
     min_notification_before_wake_(min_notification_before_wake),
     max_notification_before_wake_(max_notification_before_wake),
+    inline_cache_threshold_(inline_cache_threshold),
     profile_path_(profile_path),
     profile_boot_class_path_(profile_boot_class_path),
     profile_aot_code_(profile_aot_code),
@@ -112,6 +117,9 @@
   uint32_t GetMaxNotificationBeforeWake() const {
     return max_notification_before_wake_;
   }
+  uint16_t GetInlineCacheThreshold() const {
+    return inline_cache_threshold_;
+  }
   std::string GetProfilePath() const {
     return profile_path_;
   }
@@ -138,6 +146,7 @@
         << ", min_classes_to_save_" << pso.min_classes_to_save_
         << ", min_notification_before_wake_" << pso.min_notification_before_wake_
         << ", max_notification_before_wake_" << pso.max_notification_before_wake_
+        << ", inline_cache_threshold_" << pso.inline_cache_threshold_
         << ", profile_boot_class_path_" << pso.profile_boot_class_path_
         << ", profile_aot_code_" << pso.profile_aot_code_
         << ", wait_for_jit_notifications_to_save_" << pso.wait_for_jit_notifications_to_save_;
@@ -155,6 +164,7 @@
   uint32_t min_classes_to_save_;
   uint32_t min_notification_before_wake_;
   uint32_t max_notification_before_wake_;
+  uint16_t inline_cache_threshold_;
   std::string profile_path_;
   bool profile_boot_class_path_;
   bool profile_aot_code_;
diff --git a/runtime/jit/profile_saver_test.cc b/runtime/jit/profile_saver_test.cc
index e737b7c..e522677 100644
--- a/runtime/jit/profile_saver_test.cc
+++ b/runtime/jit/profile_saver_test.cc
@@ -22,7 +22,7 @@
 #include "profile_saver.h"
 #include "profile/profile_compilation_info.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using Hotness = ProfileCompilationInfo::MethodHotness;
 
diff --git a/runtime/jit/profiling_info.cc b/runtime/jit/profiling_info.cc
index d859d5a..1df34eb 100644
--- a/runtime/jit/profiling_info.cc
+++ b/runtime/jit/profiling_info.cc
@@ -23,16 +23,26 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
-ProfilingInfo::ProfilingInfo(ArtMethod* method, const std::vector<uint32_t>& entries)
+ProfilingInfo::ProfilingInfo(ArtMethod* method,
+                             const std::vector<uint32_t>& inline_cache_entries,
+                             const std::vector<uint32_t>& branch_cache_entries)
       : baseline_hotness_count_(GetOptimizeThreshold()),
         method_(method),
-        number_of_inline_caches_(entries.size()),
+        number_of_inline_caches_(inline_cache_entries.size()),
+        number_of_branch_caches_(branch_cache_entries.size()),
         current_inline_uses_(0) {
-  memset(&cache_, 0, number_of_inline_caches_ * sizeof(InlineCache));
+  InlineCache* inline_caches = GetInlineCaches();
+  memset(inline_caches, 0, number_of_inline_caches_ * sizeof(InlineCache));
   for (size_t i = 0; i < number_of_inline_caches_; ++i) {
-    cache_[i].dex_pc_ = entries[i];
+    inline_caches[i].dex_pc_ = inline_cache_entries[i];
+  }
+
+  BranchCache* branch_caches = GetBranchCaches();
+  memset(branch_caches, 0, number_of_branch_caches_ * sizeof(BranchCache));
+  for (size_t i = 0; i < number_of_branch_caches_; ++i) {
+    branch_caches[i].dex_pc_ = branch_cache_entries[i];
   }
 }
 
@@ -40,19 +50,29 @@
   return Runtime::Current()->GetJITOptions()->GetOptimizeThreshold();
 }
 
-ProfilingInfo* ProfilingInfo::Create(Thread* self, ArtMethod* method) {
+ProfilingInfo* ProfilingInfo::Create(Thread* self,
+                                     ArtMethod* method,
+                                     const std::vector<uint32_t>& inline_cache_entries) {
   // Walk over the dex instructions of the method and keep track of
   // instructions we are interested in profiling.
   DCHECK(!method->IsNative());
 
-  std::vector<uint32_t> entries;
+  std::vector<uint32_t> branch_cache_entries;
   for (const DexInstructionPcPair& inst : method->DexInstructions()) {
     switch (inst->Opcode()) {
-      case Instruction::INVOKE_VIRTUAL:
-      case Instruction::INVOKE_VIRTUAL_RANGE:
-      case Instruction::INVOKE_INTERFACE:
-      case Instruction::INVOKE_INTERFACE_RANGE:
-        entries.push_back(inst.DexPc());
+      case Instruction::IF_EQ:
+      case Instruction::IF_EQZ:
+      case Instruction::IF_NE:
+      case Instruction::IF_NEZ:
+      case Instruction::IF_LT:
+      case Instruction::IF_LTZ:
+      case Instruction::IF_LE:
+      case Instruction::IF_LEZ:
+      case Instruction::IF_GT:
+      case Instruction::IF_GTZ:
+      case Instruction::IF_GE:
+      case Instruction::IF_GEZ:
+        branch_cache_entries.push_back(inst.DexPc());
         break;
 
       default:
@@ -61,27 +81,42 @@
   }
 
   // We always create a `ProfilingInfo` object, even if there is no instruction we are
-  // interested in. The JIT code cache internally uses it.
+  // interested in. The JIT code cache internally uses it for hotness counter.
 
   // Allocate the `ProfilingInfo` object int the JIT's data space.
   jit::JitCodeCache* code_cache = Runtime::Current()->GetJit()->GetCodeCache();
-  return code_cache->AddProfilingInfo(self, method, entries);
+  return code_cache->AddProfilingInfo(self, method, inline_cache_entries, branch_cache_entries);
 }
 
 InlineCache* ProfilingInfo::GetInlineCache(uint32_t dex_pc) {
   // TODO: binary search if array is too long.
+  InlineCache* caches = GetInlineCaches();
   for (size_t i = 0; i < number_of_inline_caches_; ++i) {
-    if (cache_[i].dex_pc_ == dex_pc) {
-      return &cache_[i];
+    if (caches[i].dex_pc_ == dex_pc) {
+      return &caches[i];
     }
   }
-  ScopedObjectAccess soa(Thread::Current());
-  LOG(FATAL) << "No inline cache found for "  << ArtMethod::PrettyMethod(method_) << "@" << dex_pc;
-  UNREACHABLE();
+  return nullptr;
+}
+
+BranchCache* ProfilingInfo::GetBranchCache(uint32_t dex_pc) {
+  // TODO: binary search if array is too long.
+  BranchCache* caches = GetBranchCaches();
+  for (size_t i = 0; i < number_of_branch_caches_; ++i) {
+    if (caches[i].dex_pc_ == dex_pc) {
+      return &caches[i];
+    }
+  }
+  // Currently, only if instructions are profiled. The compiler will see other
+  // branches, like switches.
+  return nullptr;
 }
 
 void ProfilingInfo::AddInvokeInfo(uint32_t dex_pc, mirror::Class* cls) {
   InlineCache* cache = GetInlineCache(dex_pc);
+  if (cache == nullptr) {
+    return;
+  }
   for (size_t i = 0; i < InlineCache::kIndividualCacheSize; ++i) {
     mirror::Class* existing = cache->classes_[i].Read<kWithoutReadBarrier>();
     mirror::Class* marked = ReadBarrier::IsMarked(existing);
@@ -127,4 +162,39 @@
   }
 }
 
+uint32_t InlineCache::EncodeDexPc(ArtMethod* method,
+                                  const std::vector<uint32_t>& dex_pcs,
+                                  uint32_t inline_max_code_units) {
+  if (kIsDebugBuild) {
+    // Make sure `inline_max_code_units` is always the same.
+    static uint32_t global_max_code_units = inline_max_code_units;
+    CHECK_EQ(global_max_code_units, inline_max_code_units);
+  }
+  if (dex_pcs.size() - 1 > MaxDexPcEncodingDepth(method, inline_max_code_units)) {
+    return -1;
+  }
+  uint32_t size = dex_pcs.size();
+  uint32_t insns_size = method->DexInstructions().InsnsSizeInCodeUnits();
+
+  uint32_t dex_pc = dex_pcs[size - 1];
+  uint32_t shift = MinimumBitsToStore(insns_size - 1);
+  for (uint32_t i = size - 1; i > 0; --i) {
+    DCHECK_LT(shift, BitSizeOf<uint32_t>());
+    dex_pc += ((dex_pcs[i - 1] + 1) << shift);
+    shift += MinimumBitsToStore(inline_max_code_units);
+  }
+  return dex_pc;
+}
+
+uint32_t InlineCache::MaxDexPcEncodingDepth(ArtMethod* method, uint32_t inline_max_code_units) {
+  uint32_t insns_size = method->DexInstructions().InsnsSizeInCodeUnits();
+  uint32_t num_bits = MinimumBitsToStore(insns_size - 1);
+  uint32_t depth = 0;
+  do {
+    depth++;
+    num_bits += MinimumBitsToStore(inline_max_code_units);
+  } while (num_bits <= BitSizeOf<uint32_t>());
+  return depth - 1;
+}
+
 }  // namespace art
diff --git a/runtime/jit/profiling_info.h b/runtime/jit/profiling_info.h
index ed0847c..ae59d0a 100644
--- a/runtime/jit/profiling_info.h
+++ b/runtime/jit/profiling_info.h
@@ -25,9 +25,10 @@
 #include "interpreter/mterp/nterp.h"
 #include "offsets.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtMethod;
+class CompilerOptions;
 class ProfilingInfo;
 
 namespace jit {
@@ -50,6 +51,18 @@
     return MemberOffset(OFFSETOF_MEMBER(InlineCache, classes_));
   }
 
+  // Encode the list of `dex_pcs` to fit into an uint32_t.
+  static uint32_t EncodeDexPc(ArtMethod* method,
+                              const std::vector<uint32_t>& dex_pcs,
+                              uint32_t inline_max_code_units)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+
+  // Return the maximum inlining depth that we support to encode a list of dex
+  // pcs.
+  static uint32_t MaxDexPcEncodingDepth(ArtMethod* method,
+                                        uint32_t inline_max_code_units)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+
  private:
   uint32_t dex_pc_;
   GcRoot<mirror::Class> classes_[kIndividualCacheSize];
@@ -60,6 +73,38 @@
   DISALLOW_COPY_AND_ASSIGN(InlineCache);
 };
 
+class BranchCache {
+ public:
+  static constexpr MemberOffset FalseOffset() {
+    return MemberOffset(OFFSETOF_MEMBER(BranchCache, false_));
+  }
+
+  static constexpr MemberOffset TrueOffset() {
+    return MemberOffset(OFFSETOF_MEMBER(BranchCache, true_));
+  }
+
+  uint32_t GetExecutionCount() const {
+    return true_ + false_;
+  }
+
+  uint16_t GetTrue() const {
+    return true_;
+  }
+
+  uint16_t GetFalse() const {
+    return false_;
+  }
+
+ private:
+  uint32_t dex_pc_;
+  uint16_t false_;
+  uint16_t true_;
+
+  friend class ProfilingInfo;
+
+  DISALLOW_COPY_AND_ASSIGN(BranchCache);
+};
+
 /**
  * Profiling info for a method, created and filled by the interpreter once the
  * method is warm, and used by the compiler to drive optimizations.
@@ -67,7 +112,9 @@
 class ProfilingInfo {
  public:
   // Create a ProfilingInfo for 'method'.
-  static ProfilingInfo* Create(Thread* self, ArtMethod* method)
+  EXPORT static ProfilingInfo* Create(Thread* self,
+                                      ArtMethod* method,
+                                      const std::vector<uint32_t>& inline_cache_entries)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Add information from an executed INVOKE instruction to the profile.
@@ -82,6 +129,23 @@
   }
 
   InlineCache* GetInlineCache(uint32_t dex_pc);
+  BranchCache* GetBranchCache(uint32_t dex_pc);
+
+  InlineCache* GetInlineCaches() {
+    return reinterpret_cast<InlineCache*>(
+        reinterpret_cast<uintptr_t>(this) + sizeof(ProfilingInfo));
+  }
+  BranchCache* GetBranchCaches() {
+    return reinterpret_cast<BranchCache*>(
+        reinterpret_cast<uintptr_t>(this) + sizeof(ProfilingInfo) +
+        number_of_inline_caches_ * sizeof(InlineCache));
+  }
+
+  static size_t ComputeSize(uint32_t number_of_inline_caches, uint32_t number_of_branch_caches) {
+    return sizeof(ProfilingInfo) +
+        number_of_inline_caches * sizeof(InlineCache) +
+        number_of_branch_caches * sizeof(BranchCache);
+  }
 
   // Increments the number of times this method is currently being inlined.
   // Returns whether it was successful, that is it could increment without
@@ -119,11 +183,13 @@
     return baseline_hotness_count_;
   }
 
- private:
-  ProfilingInfo(ArtMethod* method, const std::vector<uint32_t>& entries);
-
   static uint16_t GetOptimizeThreshold();
 
+ private:
+  ProfilingInfo(ArtMethod* method,
+                const std::vector<uint32_t>& inline_cache_entries,
+                const std::vector<uint32_t>& branch_cache_entries);
+
   // Hotness count for methods compiled with the JIT baseline compiler. Once
   // a threshold is hit (currentily the maximum value of uint16_t), we will
   // JIT compile optimized the method.
@@ -134,16 +200,19 @@
   // See JitCodeCache::MoveObsoleteMethod.
   ArtMethod* method_;
 
-  // Number of instructions we are profiling in the ArtMethod.
+  // Number of invokes we are profiling in the ArtMethod.
   const uint32_t number_of_inline_caches_;
 
+  // Number of branches we are profiling in the ArtMethod.
+  const uint32_t number_of_branch_caches_;
+
   // When the compiler inlines the method associated to this ProfilingInfo,
   // it updates this counter so that the GC does not try to clear the inline caches.
   uint16_t current_inline_uses_;
 
-  // Dynamically allocated array of size `number_of_inline_caches_`.
-  InlineCache cache_[0];
-
+  // Memory following the object:
+  // - Dynamically allocated array of `InlineCache` of size `number_of_inline_caches_`.
+  // - Dynamically allocated array of `BranchCache of size `number_of_branch_caches_`.
   friend class jit::JitCodeCache;
 
   DISALLOW_COPY_AND_ASSIGN(ProfilingInfo);
diff --git a/runtime/jit/profiling_info_test.cc b/runtime/jit/profiling_info_test.cc
index 021bebf..674cb73 100644
--- a/runtime/jit/profiling_info_test.cc
+++ b/runtime/jit/profiling_info_test.cc
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include "profiling_info.h"
+
 #include <gtest/gtest.h>
 #include <stdio.h>
 
@@ -33,7 +35,7 @@
 #include "profile/profile_test_helper.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using Hotness = ProfileCompilationInfo::MethodHotness;
 
diff --git a/runtime/jit/small_pattern_matcher.cc b/runtime/jit/small_pattern_matcher.cc
new file mode 100644
index 0000000..5dd116c
--- /dev/null
+++ b/runtime/jit/small_pattern_matcher.cc
@@ -0,0 +1,422 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "small_pattern_matcher.h"
+
+#include "art_method-inl.h"
+#include "dex/dex_instruction-inl.h"
+#include "entrypoints/entrypoint_utils-inl.h"
+
+namespace art HIDDEN {
+namespace jit {
+
+// The following methods will be directly invoked by our own JIT/AOT compiled
+// code.
+
+static void EmptyMethod() {}
+static int32_t ReturnZero() { return 0; }
+static int32_t ReturnOne() { return 1; }
+static int32_t ReturnFirstArgMethod([[maybe_unused]] ArtMethod* method, int32_t first_arg) {
+  return first_arg;
+}
+
+template <int offset, typename T>
+static std::conditional_t<(sizeof(T) < sizeof(int32_t)), int32_t, T> ReturnFieldAt(
+    [[maybe_unused]] ArtMethod* method, mirror::Object* obj) REQUIRES_SHARED(Locks::mutator_lock_) {
+  return obj->GetFieldPrimitive<T, /* kIsVolatile= */ false>(
+      MemberOffset(offset + sizeof(mirror::Object)));
+}
+
+template <int offset, typename unused>
+static mirror::Object* ReturnFieldObjectAt([[maybe_unused]] ArtMethod* method, mirror::Object* obj)
+    REQUIRES_SHARED(Locks::mutator_lock_) {
+  return obj->GetFieldObject<mirror::Object>(MemberOffset(offset + sizeof(mirror::Object)));
+}
+
+template <int offset, typename T>
+static std::conditional_t<(sizeof(T) < sizeof(int32_t)), int32_t, T> ReturnStaticFieldAt(
+    ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_) {
+  ObjPtr<mirror::Class> cls = method->GetDeclaringClass();
+  MemberOffset first_field_offset = cls->GetFirstReferenceStaticFieldOffset(kRuntimePointerSize);
+  return cls->GetFieldPrimitive<T, /* kIsVolatile= */ false>(
+      MemberOffset(offset + first_field_offset.Int32Value()));
+}
+
+template <int offset, typename unused>
+static mirror::Object* ReturnStaticFieldObjectAt(ArtMethod* method)
+    REQUIRES_SHARED(Locks::mutator_lock_) {
+  ObjPtr<mirror::Class> cls = method->GetDeclaringClass();
+  MemberOffset first_field_offset = cls->GetFirstReferenceStaticFieldOffset(kRuntimePointerSize);
+  return cls->GetFieldObject<mirror::Object>(
+      MemberOffset(offset + first_field_offset.Int32Value()));
+}
+
+template <int offset, typename T>
+static void SetFieldAt([[maybe_unused]] ArtMethod* method, mirror::Object* obj, T value)
+    REQUIRES_SHARED(Locks::mutator_lock_) {
+  obj->SetFieldPrimitive<T, /* kIsVolatile= */ false>(
+      MemberOffset(offset + sizeof(mirror::Object)), value);
+}
+
+template <int offset, typename unused>
+static void SetFieldObjectAt([[maybe_unused]] ArtMethod* method,
+                             mirror::Object* obj,
+                             mirror::Object* value)
+    REQUIRES_SHARED(Locks::mutator_lock_) {
+  obj->SetFieldObject</* kTransactionActive */ false>(
+      MemberOffset(offset + sizeof(mirror::Object)), value);
+}
+
+template <int offset, typename T>
+static void ConstructorSetFieldAt([[maybe_unused]] ArtMethod* method, mirror::Object* obj, T value)
+    REQUIRES_SHARED(Locks::mutator_lock_) {
+  obj->SetFieldPrimitive<T, /* kIsVolatile= */ false>(
+      MemberOffset(offset + sizeof(mirror::Object)), value);
+  QuasiAtomic::ThreadFenceForConstructor();
+}
+
+template <int offset, typename unused>
+static void ConstructorSetFieldObjectAt([[maybe_unused]] ArtMethod* method,
+                                        mirror::Object* obj,
+                                        mirror::Object* value)
+    REQUIRES_SHARED(Locks::mutator_lock_) {
+  obj->SetFieldObject</* kTransactionActive */ false>(
+      MemberOffset(offset + sizeof(mirror::Object)), value);
+  QuasiAtomic::ThreadFenceForConstructor();
+}
+
+#define SWITCH_CASE(offset, func, type) \
+  case offset:                          \
+    return reinterpret_cast<void*>(&func<offset, type>);  // NOLINT [bugprone-macro-parentheses]
+
+#define DO_SWITCH_OFFSET(offset, F, T) \
+  switch (offset) { \
+    SWITCH_CASE(0, F, T) \
+    SWITCH_CASE(4, F, T) \
+    SWITCH_CASE(8, F, T) \
+    SWITCH_CASE(12, F, T) \
+    SWITCH_CASE(16, F, T) \
+    SWITCH_CASE(20, F, T) \
+    SWITCH_CASE(24, F, T) \
+    SWITCH_CASE(28, F, T) \
+    SWITCH_CASE(32, F, T) \
+    SWITCH_CASE(36, F, T) \
+    SWITCH_CASE(40, F, T) \
+    SWITCH_CASE(44, F, T) \
+    SWITCH_CASE(48, F, T) \
+    SWITCH_CASE(52, F, T) \
+    SWITCH_CASE(56, F, T) \
+    SWITCH_CASE(60, F, T) \
+    SWITCH_CASE(64, F, T) \
+    default: return nullptr; \
+  }
+
+#define DO_SWITCH(offset, O, P, K)                  \
+  DCHECK_EQ(is_object, (K) == Primitive::kPrimNot); \
+  switch (K) {                                      \
+    case Primitive::kPrimBoolean:                   \
+      DO_SWITCH_OFFSET(offset, P, uint8_t);         \
+    case Primitive::kPrimInt:                       \
+      DO_SWITCH_OFFSET(offset, P, int32_t);         \
+    case Primitive::kPrimLong:                      \
+      DO_SWITCH_OFFSET(offset, P, int64_t);         \
+    case Primitive::kPrimNot:                       \
+      DO_SWITCH_OFFSET(offset, O, mirror::Object*); \
+    case Primitive::kPrimFloat:                     \
+      if (kRuntimeISA == InstructionSet::kArm64) {  \
+        DO_SWITCH_OFFSET(offset, P, float);         \
+      } else {                                      \
+        return nullptr;                             \
+      }                                             \
+    case Primitive::kPrimDouble:                    \
+      if (kRuntimeISA == InstructionSet::kArm64) {  \
+        DO_SWITCH_OFFSET(offset, P, double);        \
+      } else {                                      \
+        return nullptr;                             \
+      }                                             \
+    default:                                        \
+      return nullptr;                               \
+  }
+
+const void* SmallPatternMatcher::TryMatch(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_) {
+  CodeItemDataAccessor accessor(*method->GetDexFile(), method->GetCodeItem());
+
+  ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
+
+  bool is_recognizable_constructor =
+      method->IsConstructor() &&
+      !method->IsStatic() &&
+      method->GetDeclaringClass()->GetSuperClass() != nullptr &&
+      method->GetDeclaringClass()->GetSuperClass()->IsObjectClass();
+
+  size_t insns_size = accessor.InsnsSizeInCodeUnits();
+  if (insns_size >= 4u) {
+    if (!is_recognizable_constructor) {
+      return nullptr;
+    }
+    // We can recognize a constructor with 6 or 4 code units.
+    if (insns_size != 4u && insns_size != 6u) {
+      return nullptr;
+    }
+  }
+
+  auto is_object_init_invoke = [&](const Instruction& instruction)
+      REQUIRES_SHARED(Locks::mutator_lock_) {
+    uint16_t method_idx = instruction.VRegB_35c();
+    Thread* self = Thread::Current();
+    ArtMethod* target_method =
+        class_linker->ResolveMethod<ClassLinker::ResolveMode::kNoChecks>(self,
+                                                                         method_idx,
+                                                                         method,
+                                                                         kDirect);
+    if (target_method == nullptr) {
+      self->ClearException();
+      return false;
+    }
+    if (!target_method->GetDeclaringClass()->IsObjectClass()) {
+      return false;
+    }
+    DCHECK(target_method->GetDeclaringClass()->IsVerified());
+    CodeItemDataAccessor accessor(*target_method->GetDexFile(), target_method->GetCodeItem());
+    DCHECK_EQ(accessor.InsnsSizeInCodeUnits(), 1u);
+    DCHECK_EQ(accessor.begin().Inst().Opcode(), Instruction::RETURN_VOID);
+    return true;
+  };
+
+  // Recognize a constructor of the form:
+  //   invoke-direct v0, j.l.Object.<init>
+  //   return-void
+  if (insns_size == 4u) {
+    DCHECK(is_recognizable_constructor);
+    const Instruction& instruction = accessor.begin().Inst();
+    if (instruction.Opcode() == Instruction::INVOKE_DIRECT &&
+        is_object_init_invoke(instruction)) {
+      return reinterpret_cast<void*>(&EmptyMethod);
+    }
+    return nullptr;
+  }
+
+  // Recognize:
+  //   return-void
+  // Or:
+  //   return-object v0
+  if (insns_size == 1u) {
+    const Instruction& instruction = accessor.begin().Inst();
+    if (instruction.Opcode() == Instruction::RETURN_VOID) {
+      return reinterpret_cast<void*>(&EmptyMethod);
+    }
+
+    if (instruction.Opcode() == Instruction::RETURN_OBJECT) {
+      uint16_t number_of_vregs = accessor.RegistersSize();
+      uint16_t number_of_parameters = accessor.InsSize();
+      uint16_t obj_reg = number_of_vregs - number_of_parameters;
+      if (obj_reg == instruction.VRegA_11x()) {
+        return reinterpret_cast<void*>(&ReturnFirstArgMethod);
+      }
+    }
+    return nullptr;
+  }
+
+  // Recognize:
+  //   const vX, 0/1
+  //   return{-object} vX
+  if (insns_size == 2u) {
+    if (method->GetReturnTypePrimitive() == Primitive::kPrimFloat) {
+      // Too rare to bother.
+      return nullptr;
+    }
+    int32_t register_index = -1;
+    int32_t constant = -1;
+    for (DexInstructionPcPair pair : accessor) {
+      const Instruction& instruction = pair.Inst();
+      switch (pair->Opcode()) {
+        case Instruction::CONST_4: {
+          register_index = instruction.VRegA_11n();
+          constant = instruction.VRegB_11n();
+          if (constant != 0 && constant != 1) {
+            return nullptr;
+          }
+          break;
+        }
+        case Instruction::CONST_16: {
+          register_index = instruction.VRegA_21s();
+          constant = instruction.VRegB_21s();
+          if (constant != 0 && constant != 1) {
+            return nullptr;
+          }
+          break;
+        }
+        case Instruction::RETURN:
+        case Instruction::RETURN_OBJECT: {
+          if (register_index == instruction.VRegA_11x()) {
+            if (constant == 0) {
+              return reinterpret_cast<void*>(&ReturnZero);
+            } else if (constant == 1) {
+              return reinterpret_cast<void*>(&ReturnOne);
+            }
+          }
+          return nullptr;
+        }
+        default:
+          return nullptr;
+      }
+    }
+    return nullptr;
+  }
+
+  // Recognize:
+  //   iget-{object,wide,boolean} vX, v0, field
+  //   return-{object} vX
+  // Or:
+  //   iput-{object,wide,boolean} v1, v0, field
+  //   return-void
+  // Or:
+  //   sget-object vX, field
+  //   return-object vX
+  // Or:
+  //   iput-{object,wide,boolean} v1, v0, field
+  //   invoke-direct v0, j.l.Object.<init>
+  //   return-void
+  // Or:
+  //   invoke-direct v0, j.l.Object.<init>
+  //   iput-{object,wide,boolean} v1, v0, field
+  //   return-void
+  if (insns_size == 3u || insns_size == 6u) {
+    DCHECK_IMPLIES(insns_size == 6u, is_recognizable_constructor);
+    uint16_t number_of_vregs = accessor.RegistersSize();
+    uint16_t number_of_parameters = accessor.InsSize();
+    uint16_t obj_reg = number_of_vregs - number_of_parameters;
+    uint16_t first_param_reg = number_of_vregs - number_of_parameters + 1;
+    uint16_t dest_reg = -1;
+    uint32_t offset = -1;
+    bool is_object = false;
+    bool is_put = false;
+    bool is_static = false;
+    bool is_final = false;
+    Primitive::Type field_type;
+    for (DexInstructionPcPair pair : accessor) {
+      const Instruction& instruction = pair.Inst();
+      switch (pair->Opcode()) {
+        case Instruction::INVOKE_DIRECT:
+          if (!is_recognizable_constructor || !is_object_init_invoke(instruction)) {
+            return nullptr;
+          }
+          break;
+        case Instruction::SGET_OBJECT:
+          is_static = true;
+          FALLTHROUGH_INTENDED;
+        case Instruction::IPUT_OBJECT:
+        case Instruction::IGET_OBJECT:
+          is_object = true;
+          FALLTHROUGH_INTENDED;
+        case Instruction::IPUT:
+        case Instruction::IGET:
+        case Instruction::IGET_BOOLEAN:
+        case Instruction::IPUT_BOOLEAN:
+        case Instruction::IGET_WIDE:
+        case Instruction::IPUT_WIDE: {
+          is_put = (pair->Opcode() == Instruction::IPUT ||
+                    pair->Opcode() == Instruction::IPUT_OBJECT ||
+                    pair->Opcode() == Instruction::IPUT_BOOLEAN ||
+                    pair->Opcode() == Instruction::IPUT_WIDE);
+          if (!is_static && obj_reg != instruction.VRegB_22c()) {
+            // The field access is not on the first parameter.
+            return nullptr;
+          }
+          if (!is_static && method->IsStatic()) {
+            // Getting/setting an instance field on an object that can be null.
+            // Our stubs cannot handle implicit null checks.
+            return nullptr;
+          }
+          if (is_put) {
+            if (first_param_reg != instruction.VRegA_22c()) {
+              // The value being stored is not the first parameter after 'this'.
+              return nullptr;
+            }
+          } else {
+            dest_reg = is_static ? instruction.VRegA_21c() : instruction.VRegA_22c();
+          }
+          uint16_t field_index = is_static ? instruction.VRegB_21c() : instruction.VRegC_22c();
+          Thread* self = Thread::Current();
+          ArtField* field =
+              ResolveFieldWithAccessChecks(Thread::Current(),
+                                           class_linker,
+                                           field_index,
+                                           method,
+                                           is_static,
+                                           is_put,
+                                           /* resolve_field_type= */ is_put && is_object);
+          if (field == nullptr) {
+            self->ClearException();
+            return nullptr;
+          }
+          if (field->IsVolatile()) {
+            return nullptr;
+          }
+          if (is_static && field->GetDeclaringClass() != method->GetDeclaringClass()) {
+            return nullptr;
+          }
+          offset = field->GetOffset().Int32Value();
+          if (is_static) {
+            // We subtract the start of reference fields to share more stubs.
+            MemberOffset first_field_offset =
+                field->GetDeclaringClass()->GetFirstReferenceStaticFieldOffset(kRuntimePointerSize);
+            offset = offset - first_field_offset.Int32Value();
+          } else {
+            offset = offset - sizeof(mirror::Object);
+          }
+          if (offset > 64) {
+            return nullptr;
+          }
+          field_type = field->GetTypeAsPrimitiveType();
+          is_final = field->IsFinal();
+          break;
+        }
+        case Instruction::RETURN_OBJECT:
+        case Instruction::RETURN_WIDE:
+        case Instruction::RETURN: {
+          if (is_put || dest_reg != instruction.VRegA_11x()) {
+            // The returned value is not the fetched field.
+            return nullptr;
+          }
+          if (is_static) {
+            DO_SWITCH(offset, ReturnStaticFieldObjectAt, ReturnStaticFieldAt, field_type);
+          } else {
+            DO_SWITCH(offset, ReturnFieldObjectAt, ReturnFieldAt, field_type);
+          }
+        }
+        case Instruction::RETURN_VOID: {
+          if (!is_put) {
+            return nullptr;
+          }
+          if (is_final) {
+            DCHECK(is_recognizable_constructor);
+            DO_SWITCH(offset,  ConstructorSetFieldObjectAt, ConstructorSetFieldAt, field_type);
+          } else {
+            DO_SWITCH(offset, SetFieldObjectAt, SetFieldAt, field_type);
+          }
+        }
+        default:
+          return nullptr;
+      }
+    }
+  }
+
+  return nullptr;
+}
+
+}  // namespace jit
+}  // namespace art
diff --git a/runtime/jit/small_pattern_matcher.h b/runtime/jit/small_pattern_matcher.h
new file mode 100644
index 0000000..fddd999
--- /dev/null
+++ b/runtime/jit/small_pattern_matcher.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_RUNTIME_JIT_SMALL_PATTERN_MATCHER_H_
+#define ART_RUNTIME_JIT_SMALL_PATTERN_MATCHER_H_
+
+#include "base/locks.h"
+#include "base/macros.h"
+
+namespace art HIDDEN {
+
+class ArtMethod;
+
+namespace jit {
+
+class SmallPatternMatcher {
+ public:
+  static const void* TryMatch(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_);
+};
+
+}  // namespace jit
+}  // namespace art
+
+#endif  // ART_RUNTIME_JIT_SMALL_PATTERN_MATCHER_H_
diff --git a/runtime/jni/check_jni.cc b/runtime/jni/check_jni.cc
index eb54f98..db4205c 100644
--- a/runtime/jni/check_jni.cc
+++ b/runtime/jni/check_jni.cc
@@ -51,7 +51,7 @@
 #include "thread.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // This helper cannot be in the anonymous namespace because it needs to be
 // declared as a friend by JniVmExt and JniEnvExt.
@@ -1617,8 +1617,10 @@
    * Perform the array "release" operation, which may or may not copy data
    * back into the managed heap, and may or may not release the underlying storage.
    */
-  static void* ReleaseGuardedPACopy(const char* function_name, JNIEnv* env,
-                                    jarray java_array ATTRIBUTE_UNUSED, void* embedded_buf,
+  static void* ReleaseGuardedPACopy(const char* function_name,
+                                    JNIEnv* env,
+                                    [[maybe_unused]] jarray java_array,
+                                    void* embedded_buf,
                                     int mode) {
     ScopedObjectAccess soa(env);
     if (!GuardedCopy::Check(function_name, embedded_buf, true)) {
@@ -1635,7 +1637,6 @@
     return original_ptr;
   }
 
-
   /*
    * Free up the guard buffer, scrub it, and return the original pointer.
    */
diff --git a/runtime/jni/check_jni.h b/runtime/jni/check_jni.h
index 10fdfe8..854aa20 100644
--- a/runtime/jni/check_jni.h
+++ b/runtime/jni/check_jni.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 const JNINativeInterface* GetCheckJniNativeInterface();
 const JNIInvokeInterface* GetCheckJniInvokeInterface();
diff --git a/runtime/jni/java_vm_ext-inl.h b/runtime/jni/java_vm_ext-inl.h
index c98a553..75cfabb 100644
--- a/runtime/jni/java_vm_ext-inl.h
+++ b/runtime/jni/java_vm_ext-inl.h
@@ -22,7 +22,7 @@
 #include "read_barrier_config.h"
 #include "thread-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 inline bool JavaVMExt::MayAccessWeakGlobals(Thread* self) const {
   DCHECK(self != nullptr);
diff --git a/runtime/jni/java_vm_ext.cc b/runtime/jni/java_vm_ext.cc
index 7ae6c99..2a364f3 100644
--- a/runtime/jni/java_vm_ext.cc
+++ b/runtime/jni/java_vm_ext.cc
@@ -54,7 +54,7 @@
 #include "ti/agent.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringAppendF;
 using android::base::StringAppendV;
@@ -161,11 +161,11 @@
   }
 
   // No mutator lock since dlsym may block for a while if another thread is doing dlopen.
-  void* FindSymbol(const std::string& symbol_name, const char* shorty = nullptr)
-      REQUIRES(!Locks::mutator_lock_) {
-    return NeedsNativeBridge()
-        ? FindSymbolWithNativeBridge(symbol_name, shorty)
-        : FindSymbolWithoutNativeBridge(symbol_name);
+  void* FindSymbol(const std::string& symbol_name,
+                   const char* shorty,
+                   android::JNICallType jni_call_type) REQUIRES(!Locks::mutator_lock_) {
+    return NeedsNativeBridge() ? FindSymbolWithNativeBridge(symbol_name, shorty, jni_call_type) :
+                                 FindSymbolWithoutNativeBridge(symbol_name);
   }
 
   // No mutator lock since dlsym may block for a while if another thread is doing dlopen.
@@ -176,12 +176,15 @@
     return dlsym(handle_, symbol_name.c_str());
   }
 
-  void* FindSymbolWithNativeBridge(const std::string& symbol_name, const char* shorty)
+  void* FindSymbolWithNativeBridge(const std::string& symbol_name,
+                                   const char* shorty,
+                                   android::JNICallType jni_call_type)
       REQUIRES(!Locks::mutator_lock_) {
     CHECK(NeedsNativeBridge());
 
     uint32_t len = 0;
-    return android::NativeBridgeGetTrampoline(handle_, symbol_name.c_str(), shorty, len);
+    return android::NativeBridgeGetTrampoline2(
+        handle_, symbol_name.c_str(), shorty, len, jni_call_type);
   }
 
  private:
@@ -283,6 +286,8 @@
     // TODO: Avoid calling GetShorty here to prevent dirtying dex pages?
     const char* shorty = m->GetShorty();
     void* native_code = nullptr;
+    android::JNICallType jni_call_type =
+        m->IsCriticalNative() ? android::kJNICallTypeCriticalNative : android::kJNICallTypeRegular;
     if (can_suspend) {
       // Go to suspended since dlsym may block for a long time if other threads are using dlopen.
       ScopedThreadSuspension sts(self, ThreadState::kNative);
@@ -290,13 +295,15 @@
                                              declaring_class_loader_allocator,
                                              shorty,
                                              jni_short_name,
-                                             jni_long_name);
+                                             jni_long_name,
+                                             jni_call_type);
     } else {
       native_code = FindNativeMethodInternal(self,
                                              declaring_class_loader_allocator,
                                              shorty,
                                              jni_short_name,
-                                             jni_long_name);
+                                             jni_long_name,
+                                             jni_call_type);
     }
     if (native_code != nullptr) {
       return native_code;
@@ -314,7 +321,8 @@
                                  void* declaring_class_loader_allocator,
                                  const char* shorty,
                                  const std::string& jni_short_name,
-                                 const std::string& jni_long_name)
+                                 const std::string& jni_long_name,
+                                 android::JNICallType jni_call_type)
       REQUIRES(!Locks::jni_libraries_lock_) {
     MutexLock mu(self, *Locks::jni_libraries_lock_);
     for (const auto& lib : libraries_) {
@@ -326,9 +334,9 @@
       }
       // Try the short name then the long name...
       const char* arg_shorty = library->NeedsNativeBridge() ? shorty : nullptr;
-      void* fn = library->FindSymbol(jni_short_name, arg_shorty);
+      void* fn = library->FindSymbol(jni_short_name, arg_shorty, jni_call_type);
       if (fn == nullptr) {
-        fn = library->FindSymbol(jni_long_name, arg_shorty);
+        fn = library->FindSymbol(jni_long_name, arg_shorty, jni_call_type);
       }
       if (fn != nullptr) {
         VLOG(jni) << "[Found native code for " << jni_long_name
@@ -372,7 +380,7 @@
   static void UnloadLibraries(JavaVM* vm, const std::vector<SharedLibrary*>& libraries) {
     using JNI_OnUnloadFn = void(*)(JavaVM*, void*);
     for (SharedLibrary* library : libraries) {
-      void* const sym = library->FindSymbol("JNI_OnUnload", nullptr);
+      void* const sym = library->FindSymbol("JNI_OnUnload", nullptr, android::kJNICallTypeRegular);
       if (sym == nullptr) {
         VLOG(jni) << "[No JNI_OnUnload found in \"" << library->GetPath() << "\"]";
       } else {
@@ -1092,7 +1100,7 @@
   VLOG(jni) << "[Added shared library \"" << path << "\" for ClassLoader " << class_loader << "]";
 
   bool was_successful = false;
-  void* sym = library->FindSymbol("JNI_OnLoad", nullptr);
+  void* sym = library->FindSymbol("JNI_OnLoad", nullptr, android::kJNICallTypeRegular);
   if (sym == nullptr) {
     VLOG(jni) << "[No JNI_OnLoad found in \"" << path << "\"]";
     was_successful = true;
@@ -1202,7 +1210,7 @@
 
 // JNI Invocation interface.
 
-extern "C" jint JNI_CreateJavaVM(JavaVM** p_vm, JNIEnv** p_env, void* vm_args) {
+extern "C" EXPORT jint JNI_CreateJavaVM(JavaVM** p_vm, JNIEnv** p_env, void* vm_args) {
   ScopedTrace trace(__FUNCTION__);
   const JavaVMInitArgs* args = static_cast<JavaVMInitArgs*>(vm_args);
   if (JavaVMExt::IsBadJniVersion(args->version)) {
@@ -1244,7 +1252,7 @@
   return JNI_OK;
 }
 
-extern "C" jint JNI_GetCreatedJavaVMs(JavaVM** vms_buf, jsize buf_len, jsize* vm_count) {
+extern "C" EXPORT jint JNI_GetCreatedJavaVMs(JavaVM** vms_buf, jsize buf_len, jsize* vm_count) {
   Runtime* runtime = Runtime::Current();
   if (runtime == nullptr || buf_len == 0) {
     *vm_count = 0;
@@ -1256,7 +1264,7 @@
 }
 
 // Historically unsupported.
-extern "C" jint JNI_GetDefaultJavaVMInitArgs(void* /*vm_args*/) {
+extern "C" EXPORT jint JNI_GetDefaultJavaVMInitArgs(void* /*vm_args*/) {
   return JNI_ERR;
 }
 
diff --git a/runtime/jni/java_vm_ext.h b/runtime/jni/java_vm_ext.h
index 7f4f548..c04bee7 100644
--- a/runtime/jni/java_vm_ext.h
+++ b/runtime/jni/java_vm_ext.h
@@ -25,7 +25,7 @@
 #include "obj_ptr.h"
 #include "reference_table.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace linker {
 class ImageWriter;
@@ -103,11 +103,11 @@
    * Returns 'true' on success. On failure, sets 'error_msg' to a
    * human-readable description of the error.
    */
-  bool LoadNativeLibrary(JNIEnv* env,
-                         const std::string& path,
-                         jobject class_loader,
-                         jclass caller_class,
-                         std::string* error_msg);
+  EXPORT bool LoadNativeLibrary(JNIEnv* env,
+                                const std::string& path,
+                                jobject class_loader,
+                                jclass caller_class,
+                                std::string* error_msg);
 
   // Unload native libraries with cleared class loaders.
   void UnloadNativeLibraries()
@@ -139,7 +139,7 @@
 
   bool SetCheckJniEnabled(bool enabled);
 
-  void VisitRoots(RootVisitor* visitor) REQUIRES_SHARED(Locks::mutator_lock_)
+  EXPORT void VisitRoots(RootVisitor* visitor) REQUIRES_SHARED(Locks::mutator_lock_)
       REQUIRES(!Locks::jni_globals_lock_);
 
   void DisallowNewWeakGlobals()
@@ -151,17 +151,15 @@
   void BroadcastForNewWeakGlobals()
       REQUIRES(!Locks::jni_weak_globals_lock_);
 
-  jobject AddGlobalRef(Thread* self, ObjPtr<mirror::Object> obj)
-      REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(!Locks::jni_globals_lock_);
+  EXPORT jobject AddGlobalRef(Thread* self, ObjPtr<mirror::Object> obj)
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Locks::jni_globals_lock_);
 
-  jweak AddWeakGlobalRef(Thread* self, ObjPtr<mirror::Object> obj)
-      REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(!Locks::jni_weak_globals_lock_);
+  EXPORT jweak AddWeakGlobalRef(Thread* self, ObjPtr<mirror::Object> obj)
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Locks::jni_weak_globals_lock_);
 
-  void DeleteGlobalRef(Thread* self, jobject obj) REQUIRES(!Locks::jni_globals_lock_);
+  EXPORT void DeleteGlobalRef(Thread* self, jobject obj) REQUIRES(!Locks::jni_globals_lock_);
 
-  void DeleteWeakGlobalRef(Thread* self, jweak obj) REQUIRES(!Locks::jni_weak_globals_lock_);
+  EXPORT void DeleteWeakGlobalRef(Thread* self, jweak obj) REQUIRES(!Locks::jni_weak_globals_lock_);
 
   void SweepJniWeakGlobals(IsMarkedVisitor* visitor)
       REQUIRES_SHARED(Locks::mutator_lock_)
@@ -214,8 +212,7 @@
   jint HandleGetEnv(/*out*/void** env, jint version)
       REQUIRES(!env_hooks_lock_);
 
-  void AddEnvironmentHook(GetEnvHook hook)
-      REQUIRES(!env_hooks_lock_);
+  EXPORT void AddEnvironmentHook(GetEnvHook hook) REQUIRES(!env_hooks_lock_);
 
   static bool IsBadJniVersion(int version);
 
diff --git a/runtime/jni/java_vm_ext_test.cc b/runtime/jni/java_vm_ext_test.cc
index cae33b5..f9176fc 100644
--- a/runtime/jni/java_vm_ext_test.cc
+++ b/runtime/jni/java_vm_ext_test.cc
@@ -23,7 +23,7 @@
 #include "java_vm_ext.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class JavaVmExtTest : public CommonRuntimeTest {
  protected:
@@ -62,7 +62,7 @@
 static bool gSmallStack = false;
 static bool gAsDaemon = false;
 
-static void* attach_current_thread_callback(void* arg ATTRIBUTE_UNUSED) {
+static void* attach_current_thread_callback([[maybe_unused]] void* arg) {
   JavaVM* vms_buf[1];
   jsize num_vms;
   JNIEnv* env;
diff --git a/runtime/jni/jni_env_ext-inl.h b/runtime/jni/jni_env_ext-inl.h
index 0c04192..bfd5469 100644
--- a/runtime/jni/jni_env_ext-inl.h
+++ b/runtime/jni/jni_env_ext-inl.h
@@ -22,14 +22,14 @@
 #include "local_reference_table-inl.h"
 #include "mirror/object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template<typename T>
 inline T JNIEnvExt::AddLocalReference(ObjPtr<mirror::Object> obj) {
   std::string error_msg;
-  IndirectRef ref = locals_.Add(local_ref_cookie_, obj, &error_msg);
+  jobject ref = reinterpret_cast<jobject>(locals_.Add(obj, &error_msg));
   if (UNLIKELY(ref == nullptr)) {
-    // This is really unexpected if we allow resizing local IRTs...
+    // This is really unexpected if we allow resizing LRTs...
     LOG(FATAL) << error_msg;
     UNREACHABLE();
   }
diff --git a/runtime/jni/jni_env_ext.cc b/runtime/jni/jni_env_ext.cc
index bef0fd3..3b10ce2 100644
--- a/runtime/jni/jni_env_ext.cc
+++ b/runtime/jni/jni_env_ext.cc
@@ -36,7 +36,7 @@
 #include "thread-inl.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -70,7 +70,6 @@
 JNIEnvExt::JNIEnvExt(Thread* self_in, JavaVMExt* vm_in)
     : self_(self_in),
       vm_(vm_in),
-      local_ref_cookie_(jni::kLRTFirstSegment),
       locals_(vm_in->IsCheckJniEnabled()),
       monitors_("monitors", kMonitorsInitial, kMonitorsMax),
       critical_(0),
@@ -98,9 +97,9 @@
     return nullptr;
   }
   std::string error_msg;
-  jobject ref = reinterpret_cast<jobject>(locals_.Add(local_ref_cookie_, obj, &error_msg));
+  jobject ref = reinterpret_cast<jobject>(locals_.Add(obj, &error_msg));
   if (UNLIKELY(ref == nullptr)) {
-    // This is really unexpected if we allow resizing local IRTs...
+    // This is really unexpected if we allow resizing LRTs...
     LOG(FATAL) << error_msg;
     UNREACHABLE();
   }
@@ -109,7 +108,7 @@
 
 void JNIEnvExt::DeleteLocalRef(jobject obj) {
   if (obj != nullptr) {
-    locals_.Remove(local_ref_cookie_, reinterpret_cast<IndirectRef>(obj));
+    locals_.Remove(reinterpret_cast<IndirectRef>(obj));
   }
 }
 
@@ -131,13 +130,11 @@
 
 void JNIEnvExt::PushFrame(int capacity) {
   DCHECK_GE(locals_.FreeCapacity(), static_cast<size_t>(capacity));
-  stacked_local_ref_cookies_.push_back(local_ref_cookie_);
-  local_ref_cookie_ = locals_.GetSegmentState();
+  stacked_local_ref_cookies_.push_back(PushLocalReferenceFrame());
 }
 
 void JNIEnvExt::PopFrame() {
-  locals_.SetSegmentState(local_ref_cookie_);
-  local_ref_cookie_ = stacked_local_ref_cookies_.back();
+  PopLocalReferenceFrame(stacked_local_ref_cookies_.back());
   stacked_local_ref_cookies_.pop_back();
 }
 
@@ -145,27 +142,27 @@
 //       are tests in jni_internal_test to match the results against the actual values.
 
 // This is encoding the knowledge of the structure and layout of JNIEnv fields.
-static size_t JNIEnvSize(size_t pointer_size) {
+static size_t JNIEnvSize(PointerSize pointer_size) {
   // A single pointer.
-  return pointer_size;
+  return static_cast<size_t>(pointer_size);
 }
 
-MemberOffset JNIEnvExt::SegmentStateOffset(size_t pointer_size) {
-  size_t locals_offset = JNIEnvSize(pointer_size) +
-                         2 * pointer_size +          // Thread* self + JavaVMExt* vm.
-                         4 +                         // local_ref_cookie.
-                         (pointer_size - 4);         // Padding.
-  size_t irt_segment_state_offset =
-      jni::LocalReferenceTable::SegmentStateOffset(pointer_size).Int32Value();
-  return MemberOffset(locals_offset + irt_segment_state_offset);
-}
-
-MemberOffset JNIEnvExt::LocalRefCookieOffset(size_t pointer_size) {
+inline MemberOffset JNIEnvExt::LocalReferenceTableOffset(PointerSize pointer_size) {
   return MemberOffset(JNIEnvSize(pointer_size) +
-                      2 * pointer_size);          // Thread* self + JavaVMExt* vm
+                      2 * static_cast<size_t>(pointer_size));  // Thread* self + JavaVMExt* vm
 }
 
-MemberOffset JNIEnvExt::SelfOffset(size_t pointer_size) {
+MemberOffset JNIEnvExt::LrtSegmentStateOffset(PointerSize pointer_size) {
+  return MemberOffset(LocalReferenceTableOffset(pointer_size).SizeValue() +
+                      jni::LocalReferenceTable::SegmentStateOffset().SizeValue());
+}
+
+MemberOffset JNIEnvExt::LrtPreviousStateOffset(PointerSize pointer_size) {
+  return MemberOffset(LocalReferenceTableOffset(pointer_size).SizeValue() +
+                      jni::LocalReferenceTable::PreviousStateOffset().SizeValue());
+}
+
+MemberOffset JNIEnvExt::SelfOffset(PointerSize pointer_size) {
   return MemberOffset(JNIEnvSize(pointer_size));
 }
 
@@ -289,7 +286,7 @@
   }
 }
 
-void ThreadResetFunctionTable(Thread* thread, void* arg ATTRIBUTE_UNUSED)
+void ThreadResetFunctionTable(Thread* thread, [[maybe_unused]] void* arg)
     REQUIRES(Locks::jni_function_table_lock_) {
   JNIEnvExt* env = thread->GetJniEnv();
   bool check_jni = env->IsCheckJniEnabled();
diff --git a/runtime/jni/jni_env_ext.h b/runtime/jni/jni_env_ext.h
index 1f57658..ca5cc0a 100644
--- a/runtime/jni/jni_env_ext.h
+++ b/runtime/jni/jni_env_ext.h
@@ -25,7 +25,7 @@
 #include "obj_ptr.h"
 #include "reference_table.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtMethod;
 class ArtField;
@@ -42,9 +42,9 @@
   // Creates a new JNIEnvExt. Returns null on error, in which case error_msg
   // will contain a description of the error.
   static JNIEnvExt* Create(Thread* self, JavaVMExt* vm, std::string* error_msg);
-  static MemberOffset SegmentStateOffset(size_t pointer_size);
-  static MemberOffset LocalRefCookieOffset(size_t pointer_size);
-  static MemberOffset SelfOffset(size_t pointer_size);
+  static MemberOffset LrtSegmentStateOffset(PointerSize pointer_size);
+  static MemberOffset LrtPreviousStateOffset(PointerSize pointer_size);
+  static MemberOffset SelfOffset(PointerSize pointer_size);
   static jint GetEnvHandler(JavaVMExt* vm, /*out*/void** out, jint version);
 
   ~JNIEnvExt();
@@ -66,8 +66,8 @@
   void UpdateLocal(IndirectRef iref, ObjPtr<mirror::Object> obj)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  jobject NewLocalRef(mirror::Object* obj) REQUIRES_SHARED(Locks::mutator_lock_);
-  void DeleteLocalRef(jobject obj) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT jobject NewLocalRef(mirror::Object* obj) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void DeleteLocalRef(jobject obj) REQUIRES_SHARED(Locks::mutator_lock_);
 
   void TrimLocals() REQUIRES_SHARED(Locks::mutator_lock_) {
     locals_.Trim();
@@ -79,14 +79,11 @@
     return locals_.Capacity();
   }
 
-  jni::LRTSegmentState GetLocalRefCookie() const { return local_ref_cookie_; }
-  void SetLocalRefCookie(jni::LRTSegmentState new_cookie) { local_ref_cookie_ = new_cookie; }
-
-  jni::LRTSegmentState GetLocalsSegmentState() const REQUIRES_SHARED(Locks::mutator_lock_) {
-    return locals_.GetSegmentState();
+  jni::LRTSegmentState PushLocalReferenceFrame() {
+    return locals_.PushFrame();
   }
-  void SetLocalSegmentState(jni::LRTSegmentState new_state) REQUIRES_SHARED(Locks::mutator_lock_) {
-    locals_.SetSegmentState(new_state);
+  void PopLocalReferenceFrame(jni::LRTSegmentState previous_state) {
+    locals_.PopFrame(previous_state);
   }
 
   void VisitJniLocalRoots(RootVisitor* visitor, const RootInfo& root_info)
@@ -138,18 +135,20 @@
   // to all threads.
   // Note: JNI function table overrides are sensitive to the order of operations wrt/ CheckJNI.
   //       After overriding the JNI function table, CheckJNI toggling is ignored.
-  static void SetTableOverride(const JNINativeInterface* table_override)
+  EXPORT static void SetTableOverride(const JNINativeInterface* table_override)
       REQUIRES(!Locks::thread_list_lock_, !Locks::jni_function_table_lock_);
 
   // Return either the regular, or the CheckJNI function table. Will return table_override_ instead
   // if it is not null.
-  static const JNINativeInterface* GetFunctionTable(bool check_jni)
+  EXPORT static const JNINativeInterface* GetFunctionTable(bool check_jni)
       REQUIRES(Locks::jni_function_table_lock_);
 
   static void ResetFunctionTable()
       REQUIRES(!Locks::thread_list_lock_, !Locks::jni_function_table_lock_);
 
  private:
+  static MemberOffset LocalReferenceTableOffset(PointerSize pointer_size);
+
   // Override of function tables. This applies to both default as well as instrumented (CheckJNI)
   // function tables.
   static const JNINativeInterface* table_override_ GUARDED_BY(Locks::jni_function_table_lock_);
@@ -168,9 +167,6 @@
   // The invocation interface JavaVM.
   JavaVMExt* const vm_;
 
-  // Cookie used when using the local indirect reference table.
-  jni::LRTSegmentState local_ref_cookie_;
-
   // JNI local references.
   jni::LocalReferenceTable locals_;
 
@@ -204,7 +200,6 @@
   std::atomic<bool> runtime_deleted_;
 
   template<bool kEnableIndexIds> friend class JNI;
-  friend class ScopedJniEnvLocalRefState;
   friend class Thread;
   friend IndirectReferenceTable* GetIndirectReferenceTable(ScopedObjectAccess& soa,
                                                            IndirectRefKind kind);
@@ -219,13 +214,10 @@
  public:
   explicit ScopedJniEnvLocalRefState(JNIEnvExt* env) :
       env_(env),
-      saved_local_ref_cookie_(env->local_ref_cookie_) {
-    env->local_ref_cookie_ = env->locals_.GetSegmentState();
-  }
+      saved_local_ref_cookie_(env->PushLocalReferenceFrame()) {}
 
   ~ScopedJniEnvLocalRefState() {
-    env_->locals_.SetSegmentState(env_->local_ref_cookie_);
-    env_->local_ref_cookie_ = saved_local_ref_cookie_;
+    env_->PopLocalReferenceFrame(saved_local_ref_cookie_);
   }
 
  private:
diff --git a/runtime/jni/jni_id_manager.cc b/runtime/jni/jni_id_manager.cc
index a668fe5..c7c2733 100644
--- a/runtime/jni/jni_id_manager.cc
+++ b/runtime/jni/jni_id_manager.cc
@@ -46,7 +46,7 @@
 #include "thread-inl.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace jni {
 
 constexpr bool kTraceIds = false;
@@ -100,7 +100,7 @@
     REQUIRES_SHARED(Locks::mutator_lock_);
 
 template <>
-bool ShouldReturnPointer(ObjPtr<mirror::Class> klass, ArtMethod* t ATTRIBUTE_UNUSED) {
+bool ShouldReturnPointer(ObjPtr<mirror::Class> klass, [[maybe_unused]] ArtMethod* t) {
   ObjPtr<mirror::ClassExt> ext(klass->GetExtData());
   if (ext.IsNull()) {
     return true;
@@ -154,7 +154,7 @@
       LOG(INFO) << "jmethodID for Obsolete / Default conflicting method " << method->PrettyMethod()
                 << " requested!";
     }
-    // No ids array for obsolete methods. Just do a linear scan.
+    // No ids array for obsolete / default conflicting methods. Just do a linear scan.
     return false;
   }
   StackHandleScope<1> hs(self);
@@ -176,7 +176,7 @@
 size_t GetIdOffset(ObjPtr<mirror::Class> k, ArtType* t, PointerSize pointer_size)
     REQUIRES_SHARED(Locks::mutator_lock_);
 template <>
-size_t GetIdOffset(ObjPtr<mirror::Class> k, ArtField* f, PointerSize ptr_size ATTRIBUTE_UNUSED) {
+size_t GetIdOffset(ObjPtr<mirror::Class> k, ArtField* f, [[maybe_unused]] PointerSize ptr_size) {
   return f->IsStatic() ? k->GetStaticFieldIdOffset(f) : k->GetInstanceFieldIdOffset(f);
 }
 template <>
@@ -208,7 +208,7 @@
 template <typename ArtType>
 bool CanUseIdArrays(ReflectiveHandle<ArtType> t) REQUIRES_SHARED(Locks::mutator_lock_);
 template <>
-bool CanUseIdArrays(ReflectiveHandle<ArtField> t ATTRIBUTE_UNUSED) {
+bool CanUseIdArrays([[maybe_unused]] ReflectiveHandle<ArtField> t) {
   return true;
 }
 template <>
@@ -264,7 +264,7 @@
 }
 template <>
 size_t JniIdManager::GetLinearSearchStartId<ArtField>(
-    ReflectiveHandle<ArtField> t ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] ReflectiveHandle<ArtField> t) {
   return deferred_allocation_field_id_start_;
 }
 
diff --git a/runtime/jni/jni_id_manager.h b/runtime/jni/jni_id_manager.h
index c8ebfc3..c7ebeb8 100644
--- a/runtime/jni/jni_id_manager.h
+++ b/runtime/jni/jni_id_manager.h
@@ -29,7 +29,7 @@
 #include "jni_id_type.h"
 #include "reflective_value_visitor.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 class Object;
 class ClassExt;
@@ -50,15 +50,15 @@
 
   void Init(Thread* self) REQUIRES_SHARED(Locks::mutator_lock_);
 
-  ArtMethod* DecodeMethodId(jmethodID method) REQUIRES(!Locks::jni_id_lock_);
-  ArtField* DecodeFieldId(jfieldID field) REQUIRES(!Locks::jni_id_lock_);
-  jmethodID EncodeMethodId(ReflectiveHandle<ArtMethod> method) REQUIRES(!Locks::jni_id_lock_)
+  EXPORT ArtMethod* DecodeMethodId(jmethodID method) REQUIRES(!Locks::jni_id_lock_);
+  EXPORT ArtField* DecodeFieldId(jfieldID field) REQUIRES(!Locks::jni_id_lock_);
+  EXPORT jmethodID EncodeMethodId(ReflectiveHandle<ArtMethod> method) REQUIRES(!Locks::jni_id_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
-  jmethodID EncodeMethodId(ArtMethod* method) REQUIRES(!Locks::jni_id_lock_)
+  EXPORT jmethodID EncodeMethodId(ArtMethod* method) REQUIRES(!Locks::jni_id_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
-  jfieldID EncodeFieldId(ReflectiveHandle<ArtField> field) REQUIRES(!Locks::jni_id_lock_)
+  EXPORT jfieldID EncodeFieldId(ReflectiveHandle<ArtField> field) REQUIRES(!Locks::jni_id_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
-  jfieldID EncodeFieldId(ArtField* field) REQUIRES(!Locks::jni_id_lock_)
+  EXPORT jfieldID EncodeFieldId(ArtField* field) REQUIRES(!Locks::jni_id_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   void VisitReflectiveTargets(ReflectiveValueVisitor* rvv)
@@ -66,7 +66,7 @@
 
   void VisitRoots(RootVisitor* visitor) REQUIRES_SHARED(Locks::mutator_lock_);
 
-  ObjPtr<mirror::Object> GetPointerMarker() REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT ObjPtr<mirror::Object> GetPointerMarker() REQUIRES_SHARED(Locks::mutator_lock_);
 
  private:
   template <typename ArtType>
@@ -113,7 +113,7 @@
 // This is required since normally we need to be able to allocate to encode new ids. This should
 // only be used when absolutely required, for example to invoke user-callbacks during heap walking
 // or similar.
-class ScopedEnableSuspendAllJniIdQueries {
+class EXPORT ScopedEnableSuspendAllJniIdQueries {
  public:
   ScopedEnableSuspendAllJniIdQueries() REQUIRES_SHARED(Locks::mutator_lock_);
   ~ScopedEnableSuspendAllJniIdQueries() REQUIRES_SHARED(Locks::mutator_lock_);
diff --git a/runtime/jni/jni_internal.cc b/runtime/jni/jni_internal.cc
index ad2efc5..d6f7522 100644
--- a/runtime/jni/jni_internal.cc
+++ b/runtime/jni/jni_internal.cc
@@ -66,7 +66,7 @@
 #include "thread.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace {
 
@@ -162,7 +162,7 @@
   NewStringUTFVisitor(const char* utf, size_t utf8_length, int32_t count, bool has_bad_char)
       : utf_(utf), utf8_length_(utf8_length), count_(count), has_bad_char_(has_bad_char) {}
 
-  void operator()(ObjPtr<mirror::Object> obj, size_t usable_size ATTRIBUTE_UNUSED) const
+  void operator()(ObjPtr<mirror::Object> obj, [[maybe_unused]] size_t usable_size) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     // Avoid AsString as object is not yet in live bitmap or allocation stack.
     ObjPtr<mirror::String> string = ObjPtr<mirror::String>::DownCast(obj);
@@ -226,7 +226,7 @@
 jsize GetUncompressedStringUTFLength(const uint16_t* chars, size_t length) {
   jsize byte_count = 0;
   ConvertUtf16ToUtf8<kUtfUseShortZero, kUtfUse4ByteSequence, kUtfReplaceBadSurrogates>(
-      chars, length, [&](char c ATTRIBUTE_UNUSED) { ++byte_count; });
+      chars, length, [&]([[maybe_unused]] char c) { ++byte_count; });
   return byte_count;
 }
 
@@ -891,7 +891,7 @@
     // it. b/22119403
     ScopedObjectAccess soa(env);
     auto* ext_env = down_cast<JNIEnvExt*>(env);
-    if (!ext_env->locals_.Remove(ext_env->local_ref_cookie_, obj)) {
+    if (!ext_env->locals_.Remove(obj)) {
       // Attempting to delete a local reference that is not in the
       // topmost local reference frame is a no-op.  DeleteLocalRef returns
       // void and doesn't throw any exceptions, but we should probably
@@ -2830,7 +2830,7 @@
     return static_cast<jlong>(WellKnownClasses::java_nio_Buffer_capacity->GetInt(buffer.Get()));
   }
 
-  static jobjectRefType GetObjectRefType(JNIEnv* env ATTRIBUTE_UNUSED, jobject java_object) {
+  static jobjectRefType GetObjectRefType([[maybe_unused]] JNIEnv* env, jobject java_object) {
     if (java_object == nullptr) {
       return JNIInvalidRefType;
     }
diff --git a/runtime/jni/jni_internal.h b/runtime/jni/jni_internal.h
index cfe8208..10168b5 100644
--- a/runtime/jni/jni_internal.h
+++ b/runtime/jni/jni_internal.h
@@ -27,14 +27,14 @@
 #include "runtime.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtField;
 class ArtMethod;
 class ScopedObjectAccess;
 
 const JNINativeInterface* GetJniNativeInterface();
-const JNINativeInterface* GetRuntimeShutdownNativeInterface();
+EXPORT const JNINativeInterface* GetRuntimeShutdownNativeInterface();
 
 int ThrowNewException(JNIEnv* env, jclass exception_class, const char* msg, jobject cause);
 
diff --git a/runtime/jni/jni_internal_test.cc b/runtime/jni/jni_internal_test.cc
index 3d7f7c4..ed97e4d 100644
--- a/runtime/jni/jni_internal_test.cc
+++ b/runtime/jni/jni_internal_test.cc
@@ -28,7 +28,7 @@
 #include "nativehelper/scoped_local_ref.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -1555,10 +1555,10 @@
   // For the following tests, allocate two pages, one R/W and the next inaccessible.
   std::string error_msg;
   MemMap head_map = MemMap::MapAnonymous(
-      "head", 2 * kPageSize, PROT_READ | PROT_WRITE, /*low_4gb=*/ false, &error_msg);
+      "head", 2 * gPageSize, PROT_READ | PROT_WRITE, /*low_4gb=*/ false, &error_msg);
   ASSERT_TRUE(head_map.IsValid()) << error_msg;
   MemMap tail_map = head_map.RemapAtEnd(
-      head_map.Begin() + kPageSize, "tail", PROT_NONE, &error_msg);
+      head_map.Begin() + gPageSize, "tail", PROT_NONE, &error_msg);
   ASSERT_TRUE(tail_map.IsValid()) << error_msg;
   char* utf_src = reinterpret_cast<char*>(head_map.Begin());
 
@@ -1572,28 +1572,28 @@
   const JNINativeInterface* base_env = down_cast<JNIEnvExt*>(env_)->GetUncheckedFunctions();
 
   // Start with a simple ASCII string consisting of 4095 characters 'x'.
-  memset(utf_src, 'x', kPageSize - 1u);
-  utf_src[kPageSize - 1u] = 0u;
+  memset(utf_src, 'x', gPageSize - 1u);
+  utf_src[gPageSize - 1u] = 0u;
   jstring s = base_env->NewStringUTF(env_, utf_src);
-  ASSERT_EQ(mirror::String::GetFlaggedCount(kPageSize - 1u, /* compressible= */ true),
+  ASSERT_EQ(mirror::String::GetFlaggedCount(gPageSize - 1u, /* compressible= */ true),
             env_->GetIntField(s, count_fid));
   const char* chars = env_->GetStringUTFChars(s, nullptr);
-  for (size_t pos = 0; pos != kPageSize - 1u; ++pos) {
+  for (size_t pos = 0; pos != gPageSize - 1u; ++pos) {
     ASSERT_EQ('x', chars[pos]) << pos;
   }
   env_->ReleaseStringUTFChars(s, chars);
 
   // Replace the last character with invalid character that requires continuation.
   for (char invalid : { '\xc0', '\xe0', '\xf0' }) {
-    utf_src[kPageSize - 2u] = invalid;
+    utf_src[gPageSize - 2u] = invalid;
     s = base_env->NewStringUTF(env_, utf_src);
-    ASSERT_EQ(mirror::String::GetFlaggedCount(kPageSize - 1u, /* compressible= */ true),
+    ASSERT_EQ(mirror::String::GetFlaggedCount(gPageSize - 1u, /* compressible= */ true),
               env_->GetIntField(s, count_fid));
     chars = env_->GetStringUTFChars(s, nullptr);
-    for (size_t pos = 0; pos != kPageSize - 2u; ++pos) {
+    for (size_t pos = 0; pos != gPageSize - 2u; ++pos) {
       ASSERT_EQ('x', chars[pos]) << pos;
     }
-    EXPECT_EQ('?', chars[kPageSize - 2u]);
+    EXPECT_EQ('?', chars[gPageSize - 2u]);
     env_->ReleaseStringUTFChars(s, chars);
   }
 
@@ -1601,14 +1601,14 @@
   utf_src[0] = '\xc2';
   utf_src[1] = '\x80';
   s = base_env->NewStringUTF(env_, utf_src);
-  ASSERT_EQ(mirror::String::GetFlaggedCount(kPageSize - 2u, /* compressible= */ false),
+  ASSERT_EQ(mirror::String::GetFlaggedCount(gPageSize - 2u, /* compressible= */ false),
             env_->GetIntField(s, count_fid));
   const jchar* jchars = env_->GetStringChars(s, nullptr);
   EXPECT_EQ(jchars[0], 0x80u);
-  for (size_t pos = 1; pos != kPageSize - 3u; ++pos) {
+  for (size_t pos = 1; pos != gPageSize - 3u; ++pos) {
     ASSERT_EQ('x', jchars[pos]) << pos;
   }
-  EXPECT_EQ('?', jchars[kPageSize - 3u]);
+  EXPECT_EQ('?', jchars[gPageSize - 3u]);
   env_->ReleaseStringChars(s, jchars);
 
   // Replace the leading two-byte sequence with a two-byte sequence that decodes as ASCII (0x40).
@@ -1616,14 +1616,14 @@
   utf_src[1] = '\x80';
   s = base_env->NewStringUTF(env_, utf_src);
   // Note: All invalid characters are replaced by ASCII replacement character.
-  ASSERT_EQ(mirror::String::GetFlaggedCount(kPageSize - 2u, /* compressible= */ true),
+  ASSERT_EQ(mirror::String::GetFlaggedCount(gPageSize - 2u, /* compressible= */ true),
             env_->GetIntField(s, count_fid));
   jchars = env_->GetStringChars(s, nullptr);
   EXPECT_EQ('\x40', jchars[0]);
-  for (size_t pos = 1; pos != kPageSize - 3u; ++pos) {
+  for (size_t pos = 1; pos != gPageSize - 3u; ++pos) {
     ASSERT_EQ('x', jchars[pos]) << pos;
   }
-  EXPECT_EQ('?', jchars[kPageSize - 3u]);
+  EXPECT_EQ('?', jchars[gPageSize - 3u]);
   env_->ReleaseStringChars(s, jchars);
 
   // Replace the leading three bytes with a three-byte sequence that decodes as ASCII (0x40).
@@ -1632,44 +1632,44 @@
   utf_src[2] = '\x80';
   s = base_env->NewStringUTF(env_, utf_src);
   // Note: All invalid characters are replaced by ASCII replacement character.
-  ASSERT_EQ(mirror::String::GetFlaggedCount(kPageSize - 3u, /* compressible= */ true),
+  ASSERT_EQ(mirror::String::GetFlaggedCount(gPageSize - 3u, /* compressible= */ true),
             env_->GetIntField(s, count_fid));
   jchars = env_->GetStringChars(s, nullptr);
   EXPECT_EQ('\x40', jchars[0]);
-  for (size_t pos = 1; pos != kPageSize - 4u; ++pos) {
+  for (size_t pos = 1; pos != gPageSize - 4u; ++pos) {
     ASSERT_EQ('x', jchars[pos]) << pos;
   }
-  EXPECT_EQ('?', jchars[kPageSize - 4u]);
+  EXPECT_EQ('?', jchars[gPageSize - 4u]);
   env_->ReleaseStringChars(s, jchars);
 
   // Replace the last two characters with a valid two-byte sequence that decodes as 0.
-  utf_src[kPageSize - 3u] = '\xc0';
-  utf_src[kPageSize - 2u] = '\x80';
+  utf_src[gPageSize - 3u] = '\xc0';
+  utf_src[gPageSize - 2u] = '\x80';
   s = base_env->NewStringUTF(env_, utf_src);
-  ASSERT_EQ(mirror::String::GetFlaggedCount(kPageSize - 4u, /* compressible= */ false),
+  ASSERT_EQ(mirror::String::GetFlaggedCount(gPageSize - 4u, /* compressible= */ false),
             env_->GetIntField(s, count_fid));
   jchars = env_->GetStringChars(s, nullptr);
   EXPECT_EQ('\x40', jchars[0]);
-  for (size_t pos = 1; pos != kPageSize - 5u; ++pos) {
+  for (size_t pos = 1; pos != gPageSize - 5u; ++pos) {
     ASSERT_EQ('x', jchars[pos]) << pos;
   }
-  EXPECT_EQ('\0', jchars[kPageSize - 5u]);
+  EXPECT_EQ('\0', jchars[gPageSize - 5u]);
   env_->ReleaseStringChars(s, jchars);
 
   // Replace the last three characters with a three-byte sequence that decodes as 0.
   // This is an incorrect encoding but `NewStringUTF()` is permissive.
-  utf_src[kPageSize - 4u] = '\xe0';
-  utf_src[kPageSize - 3u] = '\x80';
-  utf_src[kPageSize - 2u] = '\x80';
+  utf_src[gPageSize - 4u] = '\xe0';
+  utf_src[gPageSize - 3u] = '\x80';
+  utf_src[gPageSize - 2u] = '\x80';
   s = base_env->NewStringUTF(env_, utf_src);
-  ASSERT_EQ(mirror::String::GetFlaggedCount(kPageSize - 5u, /* compressible= */ false),
+  ASSERT_EQ(mirror::String::GetFlaggedCount(gPageSize - 5u, /* compressible= */ false),
             env_->GetIntField(s, count_fid));
   jchars = env_->GetStringChars(s, nullptr);
   EXPECT_EQ('\x40', jchars[0]);
-  for (size_t pos = 1; pos != kPageSize - 6u; ++pos) {
+  for (size_t pos = 1; pos != gPageSize - 6u; ++pos) {
     ASSERT_EQ('x', jchars[pos]) << pos;
   }
-  EXPECT_EQ('\0', jchars[kPageSize - 6u]);
+  EXPECT_EQ('\0', jchars[gPageSize - 6u]);
   env_->ReleaseStringChars(s, jchars);
 }
 
@@ -2576,42 +2576,80 @@
 
 // Test the offset computation of IndirectReferenceTable offsets. b/26071368.
 TEST_F(JniInternalTest, IndirectReferenceTableOffsets) {
+  ScopedObjectAccess soa(Thread::Current());
   // The segment_state_ field is private, and we want to avoid friend declaration. So we'll check
-  // by modifying memory.
+  // by modifying LRT state and checking the memory contents directly.
   // The parameters don't really matter here.
   std::string error_msg;
   jni::LocalReferenceTable lrt(/*check_jni=*/ true);
   bool success = lrt.Initialize(/*max_count=*/ 5, &error_msg);
   ASSERT_TRUE(success) << error_msg;
-  jni::LRTSegmentState old_state = lrt.GetSegmentState();
 
-  // Write some new state directly. We invert parts of old_state to ensure a new value.
-  jni::LRTSegmentState new_state;
-  new_state.top_index = old_state.top_index ^ 0x07705005;
-  ASSERT_NE(old_state.top_index, new_state.top_index);
+  // Check initial state.
+  jni::LRTSegmentState* previous_state = reinterpret_cast<jni::LRTSegmentState*>(
+      reinterpret_cast<uint8_t*>(&lrt) +
+      jni::LocalReferenceTable::PreviousStateOffset().SizeValue());
+  jni::LRTSegmentState* segment_state = reinterpret_cast<jni::LRTSegmentState*>(
+      reinterpret_cast<uint8_t*>(&lrt) +
+      jni::LocalReferenceTable::SegmentStateOffset().SizeValue());
+  ASSERT_EQ(jni::kLRTFirstSegment.top_index, previous_state->top_index);
+  ASSERT_EQ(jni::kLRTFirstSegment.top_index, segment_state->top_index);
 
-  uint8_t* base = reinterpret_cast<uint8_t*>(&lrt);
-  int32_t segment_state_offset =
-      jni::LocalReferenceTable::SegmentStateOffset(sizeof(void*)).Int32Value();
-  *reinterpret_cast<jni::LRTSegmentState*>(base + segment_state_offset) = new_state;
+  // Push an empty LRT frame at the bottom.
+  jni::LRTSegmentState cookie0 = lrt.PushFrame();
+  ASSERT_EQ(jni::kLRTFirstSegment.top_index, cookie0.top_index);
+  ASSERT_EQ(jni::kLRTFirstSegment.top_index, previous_state->top_index);
+  ASSERT_EQ(jni::kLRTFirstSegment.top_index, segment_state->top_index);
 
-  // Read and compare.
-  EXPECT_EQ(new_state.top_index, lrt.GetSegmentState().top_index);
+  // Add a bogus reference.
+  IndirectRef ref = lrt.Add(reinterpret_cast32<mirror::Object*>(0xdeadbee0u), &error_msg);
+  ASSERT_TRUE(ref != nullptr) << error_msg;
+  ASSERT_EQ(jni::kLRTFirstSegment.top_index, previous_state->top_index);
+  ASSERT_NE(jni::kLRTFirstSegment.top_index, segment_state->top_index);
+  jni::LRTSegmentState expected_cookie2 = *segment_state;
+
+  // Push the non-empty LRT frame.
+  jni::LRTSegmentState cookie1 = lrt.PushFrame();
+  ASSERT_EQ(jni::kLRTFirstSegment.top_index, cookie1.top_index);
+  ASSERT_EQ(expected_cookie2.top_index, previous_state->top_index);
+  ASSERT_EQ(expected_cookie2.top_index, segment_state->top_index);
+
+  // Push another empty LRT frame.
+  jni::LRTSegmentState cookie2 = lrt.PushFrame();
+  ASSERT_EQ(expected_cookie2.top_index, cookie2.top_index);
+  ASSERT_EQ(expected_cookie2.top_index, previous_state->top_index);
+  ASSERT_EQ(expected_cookie2.top_index, segment_state->top_index);
+
+  // Pop the LRT frames and check state transitions.
+  lrt.PopFrame(cookie2);
+  ASSERT_EQ(expected_cookie2.top_index, previous_state->top_index);
+  ASSERT_EQ(expected_cookie2.top_index, segment_state->top_index);
+  lrt.PopFrame(cookie1);
+  ASSERT_EQ(jni::kLRTFirstSegment.top_index, previous_state->top_index);
+  ASSERT_EQ(expected_cookie2.top_index, segment_state->top_index);
+  lrt.PopFrame(cookie0);
+  ASSERT_EQ(jni::kLRTFirstSegment.top_index, previous_state->top_index);
+  ASSERT_EQ(jni::kLRTFirstSegment.top_index, segment_state->top_index);
 }
 
 // Test the offset computation of JNIEnvExt offsets. b/26071368.
 TEST_F(JniInternalTest, JNIEnvExtOffsets) {
-  EXPECT_EQ(OFFSETOF_MEMBER(JNIEnvExt, local_ref_cookie_),
-            JNIEnvExt::LocalRefCookieOffset(sizeof(void*)).Uint32Value());
+  EXPECT_EQ(OFFSETOF_MEMBER(JNIEnvExt, self_),
+            JNIEnvExt::SelfOffset(kRuntimePointerSize).Uint32Value());
 
-  EXPECT_EQ(OFFSETOF_MEMBER(JNIEnvExt, self_), JNIEnvExt::SelfOffset(sizeof(void*)).Uint32Value());
-
-  // segment_state_ is private in the IndirectReferenceTable. So this test isn't as good as we'd
-  // hope it to be.
+  // `previous_state_` amd `segment_state_` are private in the IndirectReferenceTable.
+  // So this test isn't as good as we'd hope it to be.
+  uint32_t previous_state_now =
+      OFFSETOF_MEMBER(JNIEnvExt, locals_) +
+      jni::LocalReferenceTable::PreviousStateOffset().Uint32Value();
+  uint32_t previous_state_computed =
+      JNIEnvExt::LrtPreviousStateOffset(kRuntimePointerSize).Uint32Value();
+  EXPECT_EQ(previous_state_now, previous_state_computed);
   uint32_t segment_state_now =
       OFFSETOF_MEMBER(JNIEnvExt, locals_) +
-      jni::LocalReferenceTable::SegmentStateOffset(sizeof(void*)).Uint32Value();
-  uint32_t segment_state_computed = JNIEnvExt::SegmentStateOffset(sizeof(void*)).Uint32Value();
+      jni::LocalReferenceTable::SegmentStateOffset().Uint32Value();
+  uint32_t segment_state_computed =
+      JNIEnvExt::LrtSegmentStateOffset(kRuntimePointerSize).Uint32Value();
   EXPECT_EQ(segment_state_now, segment_state_computed);
 }
 
diff --git a/runtime/jni/local_reference_table-inl.h b/runtime/jni/local_reference_table-inl.h
index 8b46049..cc94e9c 100644
--- a/runtime/jni/local_reference_table-inl.h
+++ b/runtime/jni/local_reference_table-inl.h
@@ -27,7 +27,7 @@
 #include "mirror/object_reference.h"
 #include "verify_object.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace jni {
 
 inline void LrtEntry::SetReference(ObjPtr<mirror::Object> ref) {
diff --git a/runtime/jni/local_reference_table.cc b/runtime/jni/local_reference_table.cc
index 15aaf5b..670db19 100644
--- a/runtime/jni/local_reference_table.cc
+++ b/runtime/jni/local_reference_table.cc
@@ -34,11 +34,10 @@
 
 #include <cstdlib>
 
-namespace art {
+namespace art HIDDEN {
 namespace jni {
 
 static constexpr bool kDumpStackOnNonLocalReference = false;
-static constexpr bool kDebugLRT = false;
 
 // Mmap an "indirect ref table region. Table_bytes is a multiple of a page size.
 static inline MemMap NewLRTMap(size_t table_bytes, std::string* error_msg) {
@@ -50,17 +49,17 @@
 }
 
 SmallLrtAllocator::SmallLrtAllocator()
-    : free_lists_(kNumSlots, nullptr),
+    : free_lists_(num_lrt_slots_, nullptr),
       shared_lrt_maps_(),
       lock_("Small LRT allocator lock", LockLevel::kGenericBottomLock) {
 }
 
 inline size_t SmallLrtAllocator::GetIndex(size_t size) {
   DCHECK_GE(size, kSmallLrtEntries);
-  DCHECK_LT(size, kPageSize / sizeof(LrtEntry));
+  DCHECK_LT(size, gPageSize / sizeof(LrtEntry));
   DCHECK(IsPowerOfTwo(size));
   size_t index = WhichPowerOf2(size / kSmallLrtEntries);
-  DCHECK_LT(index, kNumSlots);
+  DCHECK_LT(index, num_lrt_slots_);
   return index;
 }
 
@@ -68,17 +67,17 @@
   size_t index = GetIndex(size);
   MutexLock lock(Thread::Current(), lock_);
   size_t fill_from = index;
-  while (fill_from != kNumSlots && free_lists_[fill_from] == nullptr) {
+  while (fill_from != num_lrt_slots_ && free_lists_[fill_from] == nullptr) {
     ++fill_from;
   }
   void* result = nullptr;
-  if (fill_from != kNumSlots) {
+  if (fill_from != num_lrt_slots_) {
     // We found a slot with enough memory.
     result = free_lists_[fill_from];
     free_lists_[fill_from] = *reinterpret_cast<void**>(result);
   } else {
     // We need to allocate a new page and split it into smaller pieces.
-    MemMap map = NewLRTMap(kPageSize, error_msg);
+    MemMap map = NewLRTMap(gPageSize, error_msg);
     if (!map.IsValid()) {
       return nullptr;
     }
@@ -101,13 +100,13 @@
 void SmallLrtAllocator::Deallocate(LrtEntry* unneeded, size_t size) {
   size_t index = GetIndex(size);
   MutexLock lock(Thread::Current(), lock_);
-  while (index < kNumSlots) {
+  while (index < num_lrt_slots_) {
     // Check if we can merge this free block with another block with the same size.
     void** other = reinterpret_cast<void**>(
         reinterpret_cast<uintptr_t>(unneeded) ^ (kInitialLrtBytes << index));
     void** before = &free_lists_[index];
-    if (index + 1u == kNumSlots && *before == other && *other == nullptr) {
-      // Do not unmap the page if we do not have other free blocks with index `kNumSlots - 1`.
+    if (index + 1u == num_lrt_slots_ && *before == other && *other == nullptr) {
+      // Do not unmap the page if we do not have other free blocks with index `num_lrt_slots_ - 1`.
       // (Keep at least one free block to avoid a situation where creating and destroying a single
       // thread with no local references would map and unmap a page in the `SmallLrtAllocator`.)
       break;
@@ -125,9 +124,9 @@
     unneeded = reinterpret_cast<LrtEntry*>(
         reinterpret_cast<uintptr_t>(unneeded) & reinterpret_cast<uintptr_t>(other));
   }
-  if (index == kNumSlots) {
+  if (index == num_lrt_slots_) {
     // Free the entire page.
-    DCHECK(free_lists_[kNumSlots - 1u] != nullptr);
+    DCHECK(free_lists_[num_lrt_slots_ - 1u] != nullptr);
     auto match = [=](MemMap& map) { return unneeded == reinterpret_cast<LrtEntry*>(map.Begin()); };
     auto it = std::find_if(shared_lrt_maps_.begin(), shared_lrt_maps_.end(), match);
     DCHECK(it != shared_lrt_maps_.end());
@@ -140,7 +139,8 @@
 }
 
 LocalReferenceTable::LocalReferenceTable(bool check_jni)
-    : segment_state_(kLRTFirstSegment),
+    : previous_state_(kLRTFirstSegment),
+      segment_state_(kLRTFirstSegment),
       max_entries_(0u),
       free_entries_list_(
           FirstFreeField::Update(kFreeListEnd, check_jni ? 1u << kFlagCheckJni : 0u)),
@@ -262,18 +262,16 @@
   return new_serial_number;
 }
 
-IndirectRef LocalReferenceTable::Add(LRTSegmentState previous_state,
-                                     ObjPtr<mirror::Object> obj,
-                                     std::string* error_msg) {
+IndirectRef LocalReferenceTable::Add(ObjPtr<mirror::Object> obj, std::string* error_msg) {
   if (kDebugLRT) {
-    LOG(INFO) << "+++ Add: previous_state=" << previous_state.top_index
+    LOG(INFO) << "+++ Add: previous_state=" << previous_state_.top_index
               << " top_index=" << segment_state_.top_index;
   }
 
   DCHECK(obj != nullptr);
   VerifyObject(obj);
 
-  DCHECK_LE(previous_state.top_index, segment_state_.top_index);
+  DCHECK_LE(previous_state_.top_index, segment_state_.top_index);
   DCHECK(max_entries_ == kSmallLrtEntries ? small_table_ != nullptr : !tables_.empty());
 
   auto store_obj = [obj, this](LrtEntry* free_entry, const char* tag)
@@ -310,7 +308,7 @@
         PrunePoppedFreeEntries(get_entry);
         first_free_index = GetFirstFreeIndex();
       }
-      if (first_free_index != kFreeListEnd && first_free_index >= previous_state.top_index) {
+      if (first_free_index != kFreeListEnd && first_free_index >= previous_state_.top_index) {
         DCHECK_LT(first_free_index, segment_state_.top_index);  // Popped entries pruned above.
         LrtEntry* free_entry = get_entry(first_free_index);
         // Use the `free_entry` only if it was created with CheckJNI disabled.
@@ -335,7 +333,7 @@
     PrunePoppedFreeEntries([&](size_t index) { return GetEntry(index); });
     first_free_index = GetFirstFreeIndex();
   }
-  if (first_free_index != kFreeListEnd && first_free_index >= previous_state.top_index) {
+  if (first_free_index != kFreeListEnd && first_free_index >= previous_state_.top_index) {
     // Reuse the free entry if it was created with the same CheckJNI setting.
     DCHECK_LT(first_free_index, top_index);  // Popped entries have been pruned above.
     LrtEntry* free_entry = GetEntry(first_free_index);
@@ -393,7 +391,7 @@
   // Use the next entry.
   if (UNLIKELY(IsCheckJniEnabled())) {
     DCHECK_ALIGNED(top_index, kCheckJniEntriesPerReference);
-    DCHECK_ALIGNED(previous_state.top_index, kCheckJniEntriesPerReference);
+    DCHECK_ALIGNED(previous_state_.top_index, kCheckJniEntriesPerReference);
     DCHECK_ALIGNED(max_entries_, kCheckJniEntriesPerReference);
     LrtEntry* serial_number_entry = GetEntry(top_index);
     uint32_t serial_number = IncrementSerialNumber(serial_number_entry);
@@ -417,9 +415,9 @@
 // free entries under it to remove in order to reduce the size of the table.
 //
 // Returns "false" if nothing was removed.
-bool LocalReferenceTable::Remove(LRTSegmentState previous_state, IndirectRef iref) {
+bool LocalReferenceTable::Remove(IndirectRef iref) {
   if (kDebugLRT) {
-    LOG(INFO) << "+++ Remove: previous_state=" << previous_state.top_index
+    LOG(INFO) << "+++ Remove: previous_state=" << previous_state_.top_index
               << " top_index=" << segment_state_.top_index;
   }
 
@@ -456,14 +454,14 @@
     return false;
   }
 
-  DCHECK_LE(previous_state.top_index, segment_state_.top_index);
+  DCHECK_LE(previous_state_.top_index, segment_state_.top_index);
   DCHECK(max_entries_ == kSmallLrtEntries ? small_table_ != nullptr : !tables_.empty());
   DCheckValidReference(iref);
 
   LrtEntry* entry = ToLrtEntry(iref);
   uint32_t entry_index = GetReferenceEntryIndex(iref);
   uint32_t top_index = segment_state_.top_index;
-  const uint32_t bottom_index = previous_state.top_index;
+  const uint32_t bottom_index = previous_state_.top_index;
 
   if (entry_index < bottom_index) {
     // Wrong segment.
@@ -614,9 +612,9 @@
     PrunePoppedFreeEntries([&](size_t index) { return GetEntry(index); });
   }
   // Small tables can hold as many entries as the next table.
-  constexpr size_t kSmallTablesCapacity = GetTableSize(MaxSmallTables());
+  const size_t small_tables_capacity = GetTableSize(MaxSmallTables());
   size_t mem_map_index = 0u;
-  if (top_index > kSmallTablesCapacity) {
+  if (top_index > small_tables_capacity) {
     const size_t table_size = TruncToPowerOfTwo(top_index);
     const size_t table_index = NumTablesForSize(table_size);
     const size_t start_index = top_index - table_size;
@@ -624,12 +622,12 @@
     if (start_index != 0u) {
       ++mem_map_index;
       LrtEntry* table = tables_[table_index];
-      uint8_t* release_start = AlignUp(reinterpret_cast<uint8_t*>(&table[start_index]), kPageSize);
+      uint8_t* release_start = AlignUp(reinterpret_cast<uint8_t*>(&table[start_index]), gPageSize);
       uint8_t* release_end = reinterpret_cast<uint8_t*>(&table[table_size]);
       DCHECK_GE(reinterpret_cast<uintptr_t>(release_end),
                 reinterpret_cast<uintptr_t>(release_start));
-      DCHECK_ALIGNED(release_end, kPageSize);
-      DCHECK_ALIGNED(release_end - release_start, kPageSize);
+      DCHECK_ALIGNED_PARAM(release_end, gPageSize);
+      DCHECK_ALIGNED_PARAM(release_end - release_start, gPageSize);
       if (release_start != release_end) {
         madvise(release_start, release_end - release_start, MADV_DONTNEED);
       }
@@ -692,16 +690,6 @@
   ReferenceTable::Dump(os, entries);
 }
 
-void LocalReferenceTable::SetSegmentState(LRTSegmentState new_state) {
-  if (kDebugLRT) {
-    LOG(INFO) << "Setting segment state: "
-              << segment_state_.top_index
-              << " -> "
-              << new_state.top_index;
-  }
-  segment_state_ = new_state;
-}
-
 bool LocalReferenceTable::EnsureFreeCapacity(size_t free_capacity, std::string* error_msg) {
   // TODO: Pass `previous_state` so that we can check holes.
   DCHECK_GE(free_capacity, static_cast<size_t>(1));
diff --git a/runtime/jni/local_reference_table.h b/runtime/jni/local_reference_table.h
index 900e4c3..294e0a4 100644
--- a/runtime/jni/local_reference_table.h
+++ b/runtime/jni/local_reference_table.h
@@ -39,7 +39,7 @@
 #include "obj_ptr.h"
 #include "offsets.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class RootInfo;
 
@@ -80,13 +80,9 @@
 // should satisfy JNI requirements (e.g. EnsureLocalCapacity).
 
 // To get the desired behavior for JNI locals, we need to know the bottom and top of the current
-// "segment". The top is managed internally, and the bottom is passed in as a function argument.
-// When we call a native method or push a local frame, the current top index gets pushed on, and
-// serves as the new bottom. When we pop a frame off, the value from the stack becomes the new top
-// index, and the value stored in the previous frame becomes the new bottom.
-// TODO: Move the bottom index from `JniEnvExt` to the `LocalReferenceTable`. Use this in the JNI
-// compiler to improve the emitted local frame push/pop code by using two-register loads/stores
-// where available (LDRD/STRD on arm, LDP/STP on arm64).
+// "segment". When we call a native method or push a local frame, the current top index gets pushed
+// on, and serves as the new bottom. When we pop a frame off, the value from the stack becomes the
+// new top index, and the value stored in the previous frame becomes the new bottom.
 //
 // If we delete entries from the middle of the list, we will be left with "holes" which we track
 // with a singly-linked list, so that they can be reused quickly. After a segment has been removed,
@@ -211,7 +207,8 @@
 static constexpr size_t kInitialLrtBytes = 512;  // Number of bytes in an initial local table.
 static constexpr size_t kSmallLrtEntries = kInitialLrtBytes / sizeof(LrtEntry);
 static_assert(IsPowerOfTwo(kInitialLrtBytes));
-static_assert(kPageSize % kInitialLrtBytes == 0);
+
+static_assert(kMinPageSize % kInitialLrtBytes == 0);
 static_assert(kInitialLrtBytes % sizeof(LrtEntry) == 0);
 
 // A minimal stopgap allocator for initial small local LRT tables.
@@ -226,9 +223,14 @@
   void Deallocate(LrtEntry* unneeded, size_t size) REQUIRES(!lock_);
 
  private:
-  static constexpr size_t kNumSlots = WhichPowerOf2(kPageSize / kInitialLrtBytes);
+  // Number of free lists in the allocator.
+#ifdef ART_PAGE_SIZE_AGNOSTIC
+  const size_t num_lrt_slots_ = (WhichPowerOf2(gPageSize / kInitialLrtBytes));
+#else
+  static constexpr size_t num_lrt_slots_ = (WhichPowerOf2(gPageSize / kInitialLrtBytes));
+#endif
 
-  static size_t GetIndex(size_t size);
+  size_t GetIndex(size_t size);
 
   // Free lists of small chunks linked through the first word.
   dchecked_vector<void*> free_lists_;
@@ -266,9 +268,7 @@
 
   // Add a new entry. The `obj` must be a valid non-null object reference. This function
   // will return null if an error happened (with an appropriate error message set).
-  IndirectRef Add(LRTSegmentState previous_state,
-                  ObjPtr<mirror::Object> obj,
-                  std::string* error_msg)
+  EXPORT IndirectRef Add(ObjPtr<mirror::Object> obj, std::string* error_msg)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Given an `IndirectRef` in the table, return the `Object` it refers to.
@@ -290,7 +290,7 @@
   // required by JNI's DeleteLocalRef function.
   //
   // Returns "false" if nothing was removed.
-  bool Remove(LRTSegmentState previous_state, IndirectRef iref)
+  bool Remove(IndirectRef iref)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   void AssertEmpty();
@@ -324,20 +324,38 @@
   // without recovering holes. Thus this is a conservative estimate.
   size_t FreeCapacity() const;
 
-  void VisitRoots(RootVisitor* visitor, const RootInfo& root_info)
+  EXPORT void VisitRoots(RootVisitor* visitor, const RootInfo& root_info)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  LRTSegmentState GetSegmentState() const {
-    return segment_state_;
+  LRTSegmentState PushFrame() {
+    if (kDebugLRT) {
+      LOG(INFO) << "+++ Push frame: previous state " << previous_state_.top_index << " -> "
+                << segment_state_.top_index;
+    }
+    LRTSegmentState result = previous_state_;
+    previous_state_ = segment_state_;
+    return result;
   }
 
-  void SetSegmentState(LRTSegmentState new_state);
+  void PopFrame(LRTSegmentState previous_state) {
+    if (kDebugLRT) {
+      LOG(INFO) << "+++ Pop frame: current state " << segment_state_.top_index << " -> "
+                << previous_state_.top_index << ", previous state -> " << previous_state.top_index;
+    }
+    segment_state_ = previous_state_;
+    previous_state_ = previous_state;
+  }
 
-  static Offset SegmentStateOffset(size_t pointer_size ATTRIBUTE_UNUSED) {
-    // Note: Currently segment_state_ is at offset 0. We're testing the expected value in
-    //       jni_internal_test to make sure it stays correct. It is not OFFSETOF_MEMBER, as that
-    //       is not pointer-size-safe.
-    return Offset(0);
+  static MemberOffset PreviousStateOffset() {
+    // Note: The `previous_state_` must be before any pointer-size-dependent members, so that
+    // `MEMBER_OFFSET()` gives the correct value even for cross-compilation.
+    return MemberOffset(OFFSETOF_MEMBER(LocalReferenceTable, previous_state_));
+  }
+
+  static MemberOffset SegmentStateOffset() {
+    // Note: The `segment_state_` must be before any pointer-size-dependent members, so that
+    // `MEMBER_OFFSET()` gives the correct value even for cross-compilation.
+    return MemberOffset(OFFSETOF_MEMBER(LocalReferenceTable, segment_state_));
   }
 
   // Release pages past the end of the table that may have previously held references.
@@ -348,6 +366,8 @@
       REQUIRES_SHARED(Locks::mutator_lock_);
 
  private:
+  static constexpr bool kDebugLRT = false;
+
   // Flags and fields in the `free_entries_list_`.
   static constexpr size_t kFlagCheckJni = 0u;
   // Skip a bit to have the same value range for the "first free" as the "next free" in `LrtEntry`.
@@ -400,8 +420,8 @@
     return 1u + WhichPowerOf2(size / kSmallLrtEntries);
   }
 
-  static constexpr size_t MaxSmallTables() {
-    return NumTablesForSize(kPageSize / sizeof(LrtEntry));
+  static size_t MaxSmallTables() {
+    return NumTablesForSize(gPageSize / sizeof(LrtEntry));
   }
 
   LrtEntry* GetEntry(size_t entry_index) const {
@@ -457,6 +477,9 @@
   void VisitRootsInternal(Visitor&& visitor) const REQUIRES_SHARED(Locks::mutator_lock_);
 
   /// semi-public - read/write by jni down calls.
+  // These two members need to be before any pointer-size-dependent members, so that
+  // `MEMBER_OFFSET()` gives the correct value even for cross-compilation.
+  LRTSegmentState previous_state_;
   LRTSegmentState segment_state_;
 
   // The maximum number of entries (modulo resizing).
diff --git a/runtime/jni/local_reference_table_test.cc b/runtime/jni/local_reference_table_test.cc
index 32c6d48..70eaa53 100644
--- a/runtime/jni/local_reference_table_test.cc
+++ b/runtime/jni/local_reference_table_test.cc
@@ -24,7 +24,7 @@
 #include "mirror/object-inl.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace jni {
 
 using android::base::StringPrintf;
@@ -85,23 +85,21 @@
   bool success = lrt.Initialize(max_count, &error_msg);
   ASSERT_TRUE(success) << error_msg;
 
-  const LRTSegmentState cookie = kLRTFirstSegment;
-
   CheckDump(&lrt, 0, 0);
 
   if (check_jni) {
     IndirectRef bad_iref = (IndirectRef) 0x11110;
-    EXPECT_FALSE(lrt.Remove(cookie, bad_iref)) << "unexpectedly successful removal";
+    EXPECT_FALSE(lrt.Remove(bad_iref)) << "unexpectedly successful removal";
   }
 
   // Add three, check, remove in the order in which they were added.
-  IndirectRef iref0 = lrt.Add(cookie, obj0.Get(), &error_msg);
+  IndirectRef iref0 = lrt.Add(obj0.Get(), &error_msg);
   EXPECT_TRUE(iref0 != nullptr);
   CheckDump(&lrt, 1, 1);
-  IndirectRef iref1 = lrt.Add(cookie, obj1.Get(), &error_msg);
+  IndirectRef iref1 = lrt.Add(obj1.Get(), &error_msg);
   EXPECT_TRUE(iref1 != nullptr);
   CheckDump(&lrt, 2, 2);
-  IndirectRef iref2 = lrt.Add(cookie, obj2.Get(), &error_msg);
+  IndirectRef iref2 = lrt.Add(obj2.Get(), &error_msg);
   EXPECT_TRUE(iref2 != nullptr);
   CheckDump(&lrt, 3, 3);
 
@@ -109,11 +107,11 @@
   EXPECT_OBJ_PTR_EQ(obj1.Get(), lrt.Get(iref1));
   EXPECT_OBJ_PTR_EQ(obj2.Get(), lrt.Get(iref2));
 
-  EXPECT_TRUE(lrt.Remove(cookie, iref0));
+  EXPECT_TRUE(lrt.Remove(iref0));
   CheckDump(&lrt, 2, 2);
-  EXPECT_TRUE(lrt.Remove(cookie, iref1));
+  EXPECT_TRUE(lrt.Remove(iref1));
   CheckDump(&lrt, 1, 1);
-  EXPECT_TRUE(lrt.Remove(cookie, iref2));
+  EXPECT_TRUE(lrt.Remove(iref2));
   CheckDump(&lrt, 0, 0);
 
   // Table should be empty now.
@@ -124,19 +122,19 @@
   EXPECT_FALSE(lrt.IsValidReference(iref0, &error_msg));
 
   // Add three, remove in the opposite order.
-  iref0 = lrt.Add(cookie, obj0.Get(), &error_msg);
+  iref0 = lrt.Add(obj0.Get(), &error_msg);
   EXPECT_TRUE(iref0 != nullptr);
-  iref1 = lrt.Add(cookie, obj1.Get(), &error_msg);
+  iref1 = lrt.Add(obj1.Get(), &error_msg);
   EXPECT_TRUE(iref1 != nullptr);
-  iref2 = lrt.Add(cookie, obj2.Get(), &error_msg);
+  iref2 = lrt.Add(obj2.Get(), &error_msg);
   EXPECT_TRUE(iref2 != nullptr);
   CheckDump(&lrt, 3, 3);
 
-  ASSERT_TRUE(lrt.Remove(cookie, iref2));
+  ASSERT_TRUE(lrt.Remove(iref2));
   CheckDump(&lrt, 2, 2);
-  ASSERT_TRUE(lrt.Remove(cookie, iref1));
+  ASSERT_TRUE(lrt.Remove(iref1));
   CheckDump(&lrt, 1, 1);
-  ASSERT_TRUE(lrt.Remove(cookie, iref0));
+  ASSERT_TRUE(lrt.Remove(iref0));
   CheckDump(&lrt, 0, 0);
 
   // Table should be empty now.
@@ -144,29 +142,29 @@
 
   // Add three, remove middle / middle / bottom / top.  (Second attempt
   // to remove middle should fail.)
-  iref0 = lrt.Add(cookie, obj0.Get(), &error_msg);
+  iref0 = lrt.Add(obj0.Get(), &error_msg);
   EXPECT_TRUE(iref0 != nullptr);
-  iref1 = lrt.Add(cookie, obj1.Get(), &error_msg);
+  iref1 = lrt.Add(obj1.Get(), &error_msg);
   EXPECT_TRUE(iref1 != nullptr);
-  iref2 = lrt.Add(cookie, obj2.Get(), &error_msg);
+  iref2 = lrt.Add(obj2.Get(), &error_msg);
   EXPECT_TRUE(iref2 != nullptr);
   CheckDump(&lrt, 3, 3);
 
   ASSERT_EQ(3U, lrt.Capacity());
 
-  ASSERT_TRUE(lrt.Remove(cookie, iref1));
+  ASSERT_TRUE(lrt.Remove(iref1));
   CheckDump(&lrt, 2, 2);
   if (check_jni) {
-    ASSERT_FALSE(lrt.Remove(cookie, iref1));
+    ASSERT_FALSE(lrt.Remove(iref1));
     CheckDump(&lrt, 2, 2);
   }
 
   // Check that the reference to the hole is not valid.
   EXPECT_FALSE(lrt.IsValidReference(iref1, &error_msg));
 
-  ASSERT_TRUE(lrt.Remove(cookie, iref2));
+  ASSERT_TRUE(lrt.Remove(iref2));
   CheckDump(&lrt, 1, 1);
-  ASSERT_TRUE(lrt.Remove(cookie, iref0));
+  ASSERT_TRUE(lrt.Remove(iref0));
   CheckDump(&lrt, 0, 0);
 
   // Table should be empty now.
@@ -175,35 +173,35 @@
   // Add four entries.  Remove #1, add new entry, verify that table size
   // is still 4 (i.e. holes are getting filled).  Remove #1 and #3, verify
   // that we delete one and don't hole-compact the other.
-  iref0 = lrt.Add(cookie, obj0.Get(), &error_msg);
+  iref0 = lrt.Add(obj0.Get(), &error_msg);
   EXPECT_TRUE(iref0 != nullptr);
-  iref1 = lrt.Add(cookie, obj1.Get(), &error_msg);
+  iref1 = lrt.Add(obj1.Get(), &error_msg);
   EXPECT_TRUE(iref1 != nullptr);
-  iref2 = lrt.Add(cookie, obj2.Get(), &error_msg);
+  iref2 = lrt.Add(obj2.Get(), &error_msg);
   EXPECT_TRUE(iref2 != nullptr);
-  IndirectRef iref3 = lrt.Add(cookie, obj3.Get(), &error_msg);
+  IndirectRef iref3 = lrt.Add(obj3.Get(), &error_msg);
   EXPECT_TRUE(iref3 != nullptr);
   CheckDump(&lrt, 4, 4);
 
-  ASSERT_TRUE(lrt.Remove(cookie, iref1));
+  ASSERT_TRUE(lrt.Remove(iref1));
   CheckDump(&lrt, 3, 3);
 
-  iref1 = lrt.Add(cookie, obj1.Get(), &error_msg);
+  iref1 = lrt.Add(obj1.Get(), &error_msg);
   EXPECT_TRUE(iref1 != nullptr);
 
   ASSERT_EQ(4U, lrt.Capacity()) << "hole not filled";
   CheckDump(&lrt, 4, 4);
 
-  ASSERT_TRUE(lrt.Remove(cookie, iref1));
+  ASSERT_TRUE(lrt.Remove(iref1));
   CheckDump(&lrt, 3, 3);
-  ASSERT_TRUE(lrt.Remove(cookie, iref3));
+  ASSERT_TRUE(lrt.Remove(iref3));
   CheckDump(&lrt, 2, 2);
 
   ASSERT_EQ(3U, lrt.Capacity()) << "should be 3 after two deletions";
 
-  ASSERT_TRUE(lrt.Remove(cookie, iref2));
+  ASSERT_TRUE(lrt.Remove(iref2));
   CheckDump(&lrt, 1, 1);
-  ASSERT_TRUE(lrt.Remove(cookie, iref0));
+  ASSERT_TRUE(lrt.Remove(iref0));
   CheckDump(&lrt, 0, 0);
 
   ASSERT_EQ(0U, lrt.Capacity()) << "not empty after split remove";
@@ -211,45 +209,45 @@
   // Add an entry, remove it, add a new entry, and try to use the original
   // iref.  They have the same slot number but are for different objects.
   // With the extended checks in place, this should fail.
-  iref0 = lrt.Add(cookie, obj0.Get(), &error_msg);
+  iref0 = lrt.Add(obj0.Get(), &error_msg);
   EXPECT_TRUE(iref0 != nullptr);
   CheckDump(&lrt, 1, 1);
-  ASSERT_TRUE(lrt.Remove(cookie, iref0));
+  ASSERT_TRUE(lrt.Remove(iref0));
   CheckDump(&lrt, 0, 0);
-  iref1 = lrt.Add(cookie, obj1.Get(), &error_msg);
+  iref1 = lrt.Add(obj1.Get(), &error_msg);
   EXPECT_TRUE(iref1 != nullptr);
   CheckDump(&lrt, 1, 1);
   if (check_jni) {
-    ASSERT_FALSE(lrt.Remove(cookie, iref0)) << "mismatched del succeeded";
+    ASSERT_FALSE(lrt.Remove(iref0)) << "mismatched del succeeded";
     CheckDump(&lrt, 1, 1);
   }
-  ASSERT_TRUE(lrt.Remove(cookie, iref1)) << "switched del failed";
+  ASSERT_TRUE(lrt.Remove(iref1)) << "switched del failed";
   ASSERT_EQ(0U, lrt.Capacity()) << "switching del not empty";
   CheckDump(&lrt, 0, 0);
 
   // Same as above, but with the same object.  A more rigorous checker
   // (e.g. with slot serialization) will catch this.
-  iref0 = lrt.Add(cookie, obj0.Get(), &error_msg);
+  iref0 = lrt.Add(obj0.Get(), &error_msg);
   EXPECT_TRUE(iref0 != nullptr);
   CheckDump(&lrt, 1, 1);
-  ASSERT_TRUE(lrt.Remove(cookie, iref0));
+  ASSERT_TRUE(lrt.Remove(iref0));
   CheckDump(&lrt, 0, 0);
-  iref1 = lrt.Add(cookie, obj0.Get(), &error_msg);
+  iref1 = lrt.Add(obj0.Get(), &error_msg);
   EXPECT_TRUE(iref1 != nullptr);
   CheckDump(&lrt, 1, 1);
   if (iref0 != iref1) {
     // Try 0, should not work.
-    ASSERT_FALSE(lrt.Remove(cookie, iref0)) << "temporal del succeeded";
+    ASSERT_FALSE(lrt.Remove(iref0)) << "temporal del succeeded";
   }
-  ASSERT_TRUE(lrt.Remove(cookie, iref1)) << "temporal cleanup failed";
+  ASSERT_TRUE(lrt.Remove(iref1)) << "temporal cleanup failed";
   ASSERT_EQ(0U, lrt.Capacity()) << "temporal del not empty";
   CheckDump(&lrt, 0, 0);
 
   // Stale reference is not valid.
-  iref0 = lrt.Add(cookie, obj0.Get(), &error_msg);
+  iref0 = lrt.Add(obj0.Get(), &error_msg);
   EXPECT_TRUE(iref0 != nullptr);
   CheckDump(&lrt, 1, 1);
-  ASSERT_TRUE(lrt.Remove(cookie, iref0));
+  ASSERT_TRUE(lrt.Remove(iref0));
   EXPECT_FALSE(lrt.IsValidReference(iref0, &error_msg)) << "stale lookup succeeded";
   CheckDump(&lrt, 0, 0);
 
@@ -258,24 +256,24 @@
   static const size_t kTableInitial = max_count / 2;
   IndirectRef manyRefs[kTableInitial];
   for (size_t i = 0; i < kTableInitial; i++) {
-    manyRefs[i] = lrt.Add(cookie, obj0.Get(), &error_msg);
+    manyRefs[i] = lrt.Add(obj0.Get(), &error_msg);
     ASSERT_TRUE(manyRefs[i] != nullptr) << "Failed adding " << i;
     CheckDump(&lrt, i + 1, 1);
   }
   // ...this one causes overflow.
-  iref0 = lrt.Add(cookie, obj0.Get(), &error_msg);
+  iref0 = lrt.Add(obj0.Get(), &error_msg);
   ASSERT_TRUE(iref0 != nullptr);
   ASSERT_EQ(kTableInitial + 1, lrt.Capacity());
   CheckDump(&lrt, kTableInitial + 1, 1);
 
   for (size_t i = 0; i < kTableInitial; i++) {
-    ASSERT_TRUE(lrt.Remove(cookie, manyRefs[i])) << "failed removing " << i;
+    ASSERT_TRUE(lrt.Remove(manyRefs[i])) << "failed removing " << i;
     CheckDump(&lrt, kTableInitial - i, 1);
   }
   // Because of removal order, should have 11 entries, 10 of them holes.
   ASSERT_EQ(kTableInitial + 1, lrt.Capacity());
 
-  ASSERT_TRUE(lrt.Remove(cookie, iref0)) << "multi-remove final failed";
+  ASSERT_TRUE(lrt.Remove(iref0)) << "multi-remove final failed";
 
   ASSERT_EQ(0U, lrt.Capacity()) << "multi-del not empty";
   CheckDump(&lrt, 0, 0);
@@ -327,26 +325,28 @@
     bool success = lrt.Initialize(max_count, &error_msg);
     ASSERT_TRUE(success) << error_msg;
 
-    const LRTSegmentState cookie0 = kLRTFirstSegment;
-
     CheckDump(&lrt, 0, 0);
 
-    IndirectRef iref0 = lrt.Add(cookie0, obj0.Get(), &error_msg);
-    IndirectRef iref1 = lrt.Add(cookie0, obj1.Get(), &error_msg);
-    IndirectRef iref2 = lrt.Add(cookie0, obj2.Get(), &error_msg);
+    IndirectRef iref0 = lrt.Add(obj0.Get(), &error_msg);
+    IndirectRef iref1 = lrt.Add(obj1.Get(), &error_msg);
+    IndirectRef iref2 = lrt.Add(obj2.Get(), &error_msg);
 
-    EXPECT_TRUE(lrt.Remove(cookie0, iref1));
+    EXPECT_TRUE(lrt.Remove(iref1));
+    EXPECT_EQ(lrt.Capacity(), 3u);
 
     // New segment.
-    const LRTSegmentState cookie1 = lrt.GetSegmentState();
+    const LRTSegmentState cookie = lrt.PushFrame();
 
-    IndirectRef iref3 = lrt.Add(cookie1, obj3.Get(), &error_msg);
+    IndirectRef iref3 = lrt.Add(obj3.Get(), &error_msg);
 
     // Must not have filled the previous hole.
     EXPECT_EQ(lrt.Capacity(), 4u);
     EXPECT_FALSE(lrt.IsValidReference(iref1, &error_msg));
     CheckDump(&lrt, 3, 3);
 
+    lrt.PopFrame(cookie);
+    EXPECT_EQ(lrt.Capacity(), 3u);
+
     UNUSED(iref0, iref1, iref2, iref3);
   }
 
@@ -356,25 +356,23 @@
     bool success = lrt.Initialize(max_count, &error_msg);
     ASSERT_TRUE(success) << error_msg;
 
-    const LRTSegmentState cookie0 = kLRTFirstSegment;
-
     CheckDump(&lrt, 0, 0);
 
-    IndirectRef iref0 = lrt.Add(cookie0, obj0.Get(), &error_msg);
+    IndirectRef iref0 = lrt.Add(obj0.Get(), &error_msg);
 
     // New segment.
-    const LRTSegmentState cookie1 = lrt.GetSegmentState();
+    const LRTSegmentState cookie = lrt.PushFrame();
 
-    IndirectRef iref1 = lrt.Add(cookie1, obj1.Get(), &error_msg);
-    IndirectRef iref2 = lrt.Add(cookie1, obj2.Get(), &error_msg);
-    IndirectRef iref3 = lrt.Add(cookie1, obj3.Get(), &error_msg);
+    IndirectRef iref1 = lrt.Add(obj1.Get(), &error_msg);
+    IndirectRef iref2 = lrt.Add(obj2.Get(), &error_msg);
+    IndirectRef iref3 = lrt.Add(obj3.Get(), &error_msg);
 
-    EXPECT_TRUE(lrt.Remove(cookie1, iref2));
+    EXPECT_TRUE(lrt.Remove(iref2));
 
     // Pop segment.
-    lrt.SetSegmentState(cookie1);
+    lrt.PopFrame(cookie);
 
-    IndirectRef iref4 = lrt.Add(cookie1, obj4.Get(), &error_msg);
+    IndirectRef iref4 = lrt.Add(obj4.Get(), &error_msg);
 
     EXPECT_EQ(lrt.Capacity(), 2u);
     EXPECT_FALSE(lrt.IsValidReference(iref2, &error_msg));
@@ -390,29 +388,27 @@
     bool success = lrt.Initialize(max_count, &error_msg);
     ASSERT_TRUE(success) << error_msg;
 
-    const LRTSegmentState cookie0 = kLRTFirstSegment;
-
     CheckDump(&lrt, 0, 0);
 
-    IndirectRef iref0 = lrt.Add(cookie0, obj0.Get(), &error_msg);
+    IndirectRef iref0 = lrt.Add(obj0.Get(), &error_msg);
 
     // New segment.
-    const LRTSegmentState cookie1 = lrt.GetSegmentState();
+    const LRTSegmentState cookie0 = lrt.PushFrame();
 
-    IndirectRef iref1 = lrt.Add(cookie1, obj1.Get(), &error_msg);
-    IndirectRef iref2 = lrt.Add(cookie1, obj2.Get(), &error_msg);
+    IndirectRef iref1 = lrt.Add(obj1.Get(), &error_msg);
+    IndirectRef iref2 = lrt.Add(obj2.Get(), &error_msg);
 
-    EXPECT_TRUE(lrt.Remove(cookie1, iref1));
+    EXPECT_TRUE(lrt.Remove(iref1));
 
     // New segment.
-    const LRTSegmentState cookie2 = lrt.GetSegmentState();
+    const LRTSegmentState cookie1 = lrt.PushFrame();
 
-    IndirectRef iref3 = lrt.Add(cookie2, obj3.Get(), &error_msg);
+    IndirectRef iref3 = lrt.Add(obj3.Get(), &error_msg);
 
     // Pop segment.
-    lrt.SetSegmentState(cookie2);
+    lrt.PopFrame(cookie1);
 
-    IndirectRef iref4 = lrt.Add(cookie1, obj4.Get(), &error_msg);
+    IndirectRef iref4 = lrt.Add(obj4.Get(), &error_msg);
 
     EXPECT_EQ(lrt.Capacity(), 3u);
     if (check_jni) {
@@ -420,6 +416,9 @@
     }
     CheckDump(&lrt, 3, 3);
 
+    lrt.PopFrame(cookie0);
+    CheckDump(&lrt, 1, 1);
+
     UNUSED(iref0, iref1, iref2, iref3, iref4);
   }
 
@@ -429,37 +428,38 @@
     bool success = lrt.Initialize(max_count, &error_msg);
     ASSERT_TRUE(success) << error_msg;
 
-    const LRTSegmentState cookie0 = kLRTFirstSegment;
-
     CheckDump(&lrt, 0, 0);
 
-    IndirectRef iref0 = lrt.Add(cookie0, obj0.Get(), &error_msg);
+    IndirectRef iref0 = lrt.Add(obj0.Get(), &error_msg);
 
     // New segment.
-    const LRTSegmentState cookie1 = lrt.GetSegmentState();
+    const LRTSegmentState cookie0 = lrt.PushFrame();
 
-    IndirectRef iref1 = lrt.Add(cookie1, obj1.Get(), &error_msg);
-    EXPECT_TRUE(lrt.Remove(cookie1, iref1));
+    IndirectRef iref1 = lrt.Add(obj1.Get(), &error_msg);
+    EXPECT_TRUE(lrt.Remove(iref1));
 
     // Emptied segment, push new one.
-    const LRTSegmentState cookie2 = lrt.GetSegmentState();
+    const LRTSegmentState cookie1 = lrt.PushFrame();
 
-    IndirectRef iref2 = lrt.Add(cookie1, obj1.Get(), &error_msg);
-    IndirectRef iref3 = lrt.Add(cookie1, obj2.Get(), &error_msg);
-    IndirectRef iref4 = lrt.Add(cookie1, obj3.Get(), &error_msg);
+    IndirectRef iref2 = lrt.Add(obj1.Get(), &error_msg);
+    IndirectRef iref3 = lrt.Add(obj2.Get(), &error_msg);
+    IndirectRef iref4 = lrt.Add(obj3.Get(), &error_msg);
 
-    EXPECT_TRUE(lrt.Remove(cookie1, iref3));
+    EXPECT_TRUE(lrt.Remove(iref3));
 
     // Pop segment.
-    UNUSED(cookie2);
-    lrt.SetSegmentState(cookie1);
+    lrt.PopFrame(cookie1);
 
-    IndirectRef iref5 = lrt.Add(cookie1, obj4.Get(), &error_msg);
+    IndirectRef iref5 = lrt.Add(obj4.Get(), &error_msg);
 
     EXPECT_EQ(lrt.Capacity(), 2u);
     EXPECT_FALSE(lrt.IsValidReference(iref3, &error_msg));
     CheckDump(&lrt, 2, 2);
 
+    // Pop segment.
+    lrt.PopFrame(cookie0);
+    CheckDump(&lrt, 1, 1);
+
     UNUSED(iref0, iref1, iref2, iref3, iref4, iref5);
   }
 
@@ -470,29 +470,27 @@
     bool success = lrt.Initialize(max_count, &error_msg);
     ASSERT_TRUE(success) << error_msg;
 
-    const LRTSegmentState cookie0 = kLRTFirstSegment;
-
     CheckDump(&lrt, 0, 0);
 
-    IndirectRef iref0 = lrt.Add(cookie0, obj0.Get(), &error_msg);
+    IndirectRef iref0 = lrt.Add(obj0.Get(), &error_msg);
 
     // New segment.
-    const LRTSegmentState cookie1 = lrt.GetSegmentState();
+    const LRTSegmentState cookie0 = lrt.PushFrame();
 
-    IndirectRef iref1 = lrt.Add(cookie1, obj1.Get(), &error_msg);
-    IndirectRef iref2 = lrt.Add(cookie1, obj1.Get(), &error_msg);
-    IndirectRef iref3 = lrt.Add(cookie1, obj2.Get(), &error_msg);
+    IndirectRef iref1 = lrt.Add(obj1.Get(), &error_msg);
+    IndirectRef iref2 = lrt.Add(obj1.Get(), &error_msg);
+    IndirectRef iref3 = lrt.Add(obj2.Get(), &error_msg);
 
-    EXPECT_TRUE(lrt.Remove(cookie1, iref2));
+    EXPECT_TRUE(lrt.Remove(iref2));
 
     // Pop segment.
-    lrt.SetSegmentState(cookie1);
+    lrt.PopFrame(cookie0);
 
     // Push segment.
-    const LRTSegmentState cookie1_second = lrt.GetSegmentState();
-    UNUSED(cookie1_second);
+    const LRTSegmentState cookie0_second = lrt.PushFrame();
+    EXPECT_EQ(cookie0.top_index, cookie0_second.top_index);
 
-    IndirectRef iref4 = lrt.Add(cookie1, obj3.Get(), &error_msg);
+    IndirectRef iref4 = lrt.Add(obj3.Get(), &error_msg);
 
     EXPECT_EQ(lrt.Capacity(), 2u);
     EXPECT_FALSE(lrt.IsValidReference(iref3, &error_msg));
@@ -528,10 +526,9 @@
   ASSERT_TRUE(success) << error_msg;
 
   CheckDump(&lrt, 0, 0);
-  const LRTSegmentState cookie = kLRTFirstSegment;
 
   for (size_t i = 0; i != max_count + 1; ++i) {
-    lrt.Add(cookie, obj0.Get(), &error_msg);
+    lrt.Add(obj0.Get(), &error_msg);
   }
 
   EXPECT_EQ(lrt.Capacity(), max_count + 1);
@@ -541,14 +538,14 @@
   BasicResizeTest(/*check_jni=*/ false, 20u);
   BasicResizeTest(/*check_jni=*/ false, /*max_count=*/ kSmallLrtEntries);
   BasicResizeTest(/*check_jni=*/ false, /*max_count=*/ 2u * kSmallLrtEntries);
-  BasicResizeTest(/*check_jni=*/ false, /*max_count=*/ kPageSize / sizeof(LrtEntry));
+  BasicResizeTest(/*check_jni=*/ false, /*max_count=*/ gPageSize / sizeof(LrtEntry));
 }
 
 TEST_F(LocalReferenceTableTest, BasicResizeTestCheckJNI) {
   BasicResizeTest(/*check_jni=*/ true, 20u);
   BasicResizeTest(/*check_jni=*/ true, /*max_count=*/ kSmallLrtEntries);
   BasicResizeTest(/*check_jni=*/ true, /*max_count=*/ 2u * kSmallLrtEntries);
-  BasicResizeTest(/*check_jni=*/ true, /*max_count=*/ kPageSize / sizeof(LrtEntry));
+  BasicResizeTest(/*check_jni=*/ true, /*max_count=*/ gPageSize / sizeof(LrtEntry));
 }
 
 void LocalReferenceTableTest::TestAddRemove(bool check_jni, size_t max_count, size_t fill_count) {
@@ -581,9 +578,8 @@
   bool success = lrt.Initialize(max_count, &error_msg);
   ASSERT_TRUE(success) << error_msg;
 
-  const LRTSegmentState cookie0 = kLRTFirstSegment;
   for (size_t i = 0; i != fill_count; ++i) {
-    IndirectRef iref = lrt.Add(cookie0, c.Get(), &error_msg);
+    IndirectRef iref = lrt.Add(c.Get(), &error_msg);
     ASSERT_TRUE(iref != nullptr) << error_msg;
     ASSERT_EQ(i + 1u, lrt.Capacity());
     EXPECT_OBJ_PTR_EQ(c.Get(), lrt.Get(iref));
@@ -591,87 +587,89 @@
 
   IndirectRef iref0, iref1, iref2, iref3;
 
-#define ADD_REF(iref, cookie, obj, expected_capacity)             \
+#define ADD_REF(iref, obj, expected_capacity)                     \
   do {                                                            \
-    (iref) = lrt.Add(cookie, (obj).Get(), &error_msg);            \
+    (iref) = lrt.Add((obj).Get(), &error_msg);                    \
     ASSERT_TRUE((iref) != nullptr) << error_msg;                  \
     ASSERT_EQ(fill_count + (expected_capacity), lrt.Capacity());  \
     EXPECT_OBJ_PTR_EQ((obj).Get(), lrt.Get(iref));                \
   } while (false)
-#define REMOVE_REF(cookie, iref, expected_capacity)               \
+#define REMOVE_REF(iref, expected_capacity)                       \
   do {                                                            \
-    ASSERT_TRUE(lrt.Remove(cookie, iref));                        \
+    ASSERT_TRUE(lrt.Remove(iref));                                \
     ASSERT_EQ(fill_count + (expected_capacity), lrt.Capacity());  \
   } while (false)
 #define POP_SEGMENT(cookie, expected_capacity)                    \
   do {                                                            \
-    lrt.SetSegmentState(cookie);                                  \
+    lrt.PopFrame(cookie);                                         \
     ASSERT_EQ(fill_count + (expected_capacity), lrt.Capacity());  \
   } while (false)
 
-  const LRTSegmentState cookie1 = lrt.GetSegmentState();
-  ADD_REF(iref0, cookie1, obj0, 1u);
-  ADD_REF(iref1, cookie1, obj1, 2u);
-  REMOVE_REF(cookie1, iref1, 1u);  // Remove top entry.
+  const LRTSegmentState cookie0 = lrt.PushFrame();
+  ADD_REF(iref0, obj0, 1u);
+  ADD_REF(iref1, obj1, 2u);
+  REMOVE_REF(iref1, 1u);  // Remove top entry.
   if (check_jni) {
-    ASSERT_FALSE(lrt.Remove(cookie1, iref1));
+    ASSERT_FALSE(lrt.Remove(iref1));
   }
-  ADD_REF(iref1, cookie1, obj1x, 2u);
-  REMOVE_REF(cookie1, iref0, 2u);  // Create hole.
+  ADD_REF(iref1, obj1x, 2u);
+  REMOVE_REF(iref0, 2u);  // Create hole.
   IndirectRef obsolete_iref0 = iref0;
   if (check_jni) {
-    ASSERT_FALSE(lrt.Remove(cookie1, iref0));
+    ASSERT_FALSE(lrt.Remove(iref0));
   }
-  ADD_REF(iref0, cookie1, obj0x, 2u);  // Reuse hole
+  ADD_REF(iref0, obj0x, 2u);  // Reuse hole
   if (check_jni) {
-    ASSERT_FALSE(lrt.Remove(cookie1, obsolete_iref0));
+    ASSERT_FALSE(lrt.Remove(obsolete_iref0));
   }
 
   // Test addition to the second segment without a hole in the first segment.
   // Also test removal from the wrong segment here.
-  LRTSegmentState cookie2 = lrt.GetSegmentState();  // Create second segment.
-  ASSERT_FALSE(lrt.Remove(cookie2, iref0));  // Cannot remove from inactive segment.
-  ADD_REF(iref2, cookie2, obj2, 3u);
-  POP_SEGMENT(cookie2, 2u);  // Pop the second segment.
+  LRTSegmentState cookie1 = lrt.PushFrame();  // Create second segment.
+  ASSERT_FALSE(lrt.Remove(iref0));  // Cannot remove from inactive segment.
+  ADD_REF(iref2, obj2, 3u);
+  POP_SEGMENT(cookie1, 2u);  // Pop the second segment.
   if (check_jni) {
-    ASSERT_FALSE(lrt.Remove(cookie1, iref2));  // Cannot remove from popped segment.
+    ASSERT_FALSE(lrt.Remove(iref2));  // Cannot remove from popped segment.
   }
 
   // Test addition to the second segment with a hole in the first.
   // Use one more reference in the first segment to allow hitting the small table
   // overflow path either above or here, based on the provided `fill_count`.
-  ADD_REF(iref2, cookie2, obj2x, 3u);
-  REMOVE_REF(cookie1, iref1, 3u);  // Create hole.
-  cookie2 = lrt.GetSegmentState();  // Create second segment.
-  ADD_REF(iref3, cookie2, obj3, 4u);
-  POP_SEGMENT(cookie2, 3u);  // Pop the second segment.
-  REMOVE_REF(cookie1, iref2, 1u);  // Remove top entry, prune previous entry.
-  ADD_REF(iref1, cookie1, obj1, 2u);
+  ADD_REF(iref2, obj2x, 3u);
+  REMOVE_REF(iref1, 3u);  // Create hole.
+  cookie1 = lrt.PushFrame();  // Create second segment.
+  ADD_REF(iref3,  obj3, 4u);
+  POP_SEGMENT(cookie1, 3u);  // Pop the second segment.
+  REMOVE_REF(iref2, 1u);  // Remove top entry, prune previous entry.
+  ADD_REF(iref1, obj1, 2u);
 
-  cookie2 = lrt.GetSegmentState();  // Create second segment.
-  ADD_REF(iref2, cookie2, obj2, 3u);
-  ADD_REF(iref3, cookie2, obj3, 4u);
-  REMOVE_REF(cookie2, iref2, 4u);  // Create hole in second segment.
-  POP_SEGMENT(cookie2, 2u);  // Pop the second segment with hole.
-  ADD_REF(iref2, cookie1, obj2x, 3u);  // Prune free list, use new entry.
-  REMOVE_REF(cookie1, iref2, 2u);
+  cookie1 = lrt.PushFrame();  // Create second segment.
+  ADD_REF(iref2, obj2, 3u);
+  ADD_REF(iref3, obj3, 4u);
+  REMOVE_REF(iref2, 4u);  // Create hole in second segment.
+  POP_SEGMENT(cookie1, 2u);  // Pop the second segment with hole.
+  ADD_REF(iref2, obj2x, 3u);  // Prune free list, use new entry.
+  REMOVE_REF(iref2, 2u);
 
-  REMOVE_REF(cookie1, iref0, 2u);  // Create hole.
-  cookie2 = lrt.GetSegmentState();  // Create second segment.
-  ADD_REF(iref2, cookie2, obj2, 3u);
-  ADD_REF(iref3, cookie2, obj3x, 4u);
-  REMOVE_REF(cookie2, iref2, 4u);  // Create hole in second segment.
-  POP_SEGMENT(cookie2, 2u);  // Pop the second segment with hole.
-  ADD_REF(iref0, cookie1, obj0, 2u);  // Prune free list, use remaining entry from free list.
+  REMOVE_REF(iref0, 2u);  // Create hole.
+  cookie1 = lrt.PushFrame();  // Create second segment.
+  ADD_REF(iref2, obj2, 3u);
+  ADD_REF(iref3, obj3x, 4u);
+  REMOVE_REF(iref2, 4u);  // Create hole in second segment.
+  POP_SEGMENT(cookie1, 2u);  // Pop the second segment with hole.
+  ADD_REF(iref0, obj0, 2u);  // Prune free list, use remaining entry from free list.
 
-  REMOVE_REF(cookie1, iref0, 2u);  // Create hole.
-  cookie2 = lrt.GetSegmentState();  // Create second segment.
-  ADD_REF(iref2, cookie2, obj2x, 3u);
-  ADD_REF(iref3, cookie2, obj3, 4u);
-  REMOVE_REF(cookie2, iref2, 4u);  // Create hole in second segment.
-  REMOVE_REF(cookie2, iref3, 2u);  // Remove top entry, prune previous entry, keep hole above.
-  POP_SEGMENT(cookie2, 2u);  // Pop the empty second segment.
-  ADD_REF(iref0, cookie1, obj0x, 2u);  // Reuse hole.
+  REMOVE_REF(iref0, 2u);  // Create hole.
+  cookie1 = lrt.PushFrame();  // Create second segment.
+  ADD_REF(iref2, obj2x, 3u);
+  ADD_REF(iref3, obj3, 4u);
+  REMOVE_REF(iref2, 4u);  // Create hole in second segment.
+  REMOVE_REF(iref3, 2u);  // Remove top entry, prune previous entry, keep hole above.
+  POP_SEGMENT(cookie1, 2u);  // Pop the empty second segment.
+  ADD_REF(iref0, obj0x, 2u);  // Reuse hole.
+
+  POP_SEGMENT(cookie0, 0u);  // Pop the first segment.
 
 #undef REMOVE_REF
 #undef ADD_REF
@@ -714,11 +712,10 @@
 
   std::string error_msg;
   std::array<IndirectRef, kMaxUniqueRefs> irefs;
-  const LRTSegmentState cookie0 = kLRTFirstSegment;
 
-#define ADD_REF(iref, cookie, obj)                                \
+#define ADD_REF(iref, obj)                                        \
   do {                                                            \
-    (iref) = lrt.Add(cookie, (obj).Get(), &error_msg);            \
+    (iref) = lrt.Add((obj).Get(), &error_msg);                    \
     ASSERT_TRUE((iref) != nullptr) << error_msg;                  \
     EXPECT_OBJ_PTR_EQ((obj).Get(), lrt.Get(iref));                \
   } while (false)
@@ -730,35 +727,43 @@
         bool success = lrt.Initialize(kSmallLrtEntries, &error_msg);
         ASSERT_TRUE(success) << error_msg;
         for (size_t i = 0; i != split; ++i) {
-          ADD_REF(irefs[i], cookie0, objs[i]);
+          ADD_REF(irefs[i], objs[i]);
           ASSERT_EQ(i + 1u, lrt.Capacity());
         }
         for (size_t i = 0; i != deleted_at_start; ++i) {
-          ASSERT_TRUE(lrt.Remove(cookie0, irefs[i]));
+          ASSERT_TRUE(lrt.Remove(irefs[i]));
           if (lrt.IsCheckJniEnabled()) {
-            ASSERT_FALSE(lrt.Remove(cookie0, irefs[i]));
+            ASSERT_FALSE(lrt.Remove(irefs[i]));
           }
           ASSERT_EQ(split, lrt.Capacity());
         }
         lrt.SetCheckJniEnabled(!start_check_jni);
         // Check top index instead of `Capacity()` after changing the CheckJNI setting.
-        uint32_t split_top_index = lrt.GetSegmentState().top_index;
+        auto get_segment_state = [&lrt]() {
+          LRTSegmentState cookie0 = lrt.PushFrame();
+          LRTSegmentState cookie1 = lrt.PushFrame();
+          uint32_t result = cookie1.top_index;
+          lrt.PopFrame(cookie1);
+          lrt.PopFrame(cookie0);
+          return result;
+        };
+        uint32_t split_top_index = get_segment_state();
         uint32_t last_top_index = split_top_index;
         for (size_t i = split; i != total; ++i) {
-          ADD_REF(irefs[i], cookie0, objs[i]);
-          ASSERT_LT(last_top_index, lrt.GetSegmentState().top_index);
-          last_top_index = lrt.GetSegmentState().top_index;
+          ADD_REF(irefs[i], objs[i]);
+          ASSERT_LT(last_top_index, get_segment_state());
+          last_top_index = get_segment_state();
         }
         for (size_t i = split; i != total; ++i) {
-          ASSERT_TRUE(lrt.Remove(cookie0, irefs[i]));
+          ASSERT_TRUE(lrt.Remove(irefs[i]));
           if (lrt.IsCheckJniEnabled()) {
-            ASSERT_FALSE(lrt.Remove(cookie0, irefs[i]));
+            ASSERT_FALSE(lrt.Remove(irefs[i]));
           }
           if (i + 1u != total) {
-            ASSERT_LE(last_top_index, lrt.GetSegmentState().top_index);
+            ASSERT_LE(last_top_index, get_segment_state());
           } else {
-            ASSERT_GT(last_top_index, lrt.GetSegmentState().top_index);
-            ASSERT_LE(split_top_index, lrt.GetSegmentState().top_index);
+            ASSERT_GT(last_top_index, get_segment_state());
+            ASSERT_LE(split_top_index, get_segment_state());
           }
         }
       }
@@ -781,42 +786,50 @@
   ScopedObjectAccess soa(Thread::Current());
   ObjPtr<mirror::Class> c = GetClassRoot<mirror::Object>();
 
+  auto get_previous_state = [&lrt]() {
+    LRTSegmentState previous_state = lrt.PushFrame();
+    lrt.PopFrame(previous_state);
+    return previous_state;
+  };
+
   // Create the first segment with two references.
-  const LRTSegmentState cookie0 = kLRTFirstSegment;
-  IndirectRef ref0 = lrt.Add(cookie0, c, &error_msg);
+  IndirectRef ref0 = lrt.Add(c, &error_msg);
   ASSERT_TRUE(ref0 != nullptr);
-  IndirectRef ref1 = lrt.Add(cookie0, c, &error_msg);
+  IndirectRef ref1 = lrt.Add(c, &error_msg);
   ASSERT_TRUE(ref1 != nullptr);
 
   // Create a second segment with a hole, then pop it.
-  const LRTSegmentState cookieA = lrt.GetSegmentState();
-  IndirectRef ref2a = lrt.Add(cookieA, c, &error_msg);
+  const LRTSegmentState cookie0A = lrt.PushFrame();
+  const LRTSegmentState previous_state_A = get_previous_state();
+  IndirectRef ref2a = lrt.Add(c, &error_msg);
   ASSERT_TRUE(ref2a != nullptr);
-  IndirectRef ref3a = lrt.Add(cookieA, c, &error_msg);
+  IndirectRef ref3a = lrt.Add(c, &error_msg);
   ASSERT_TRUE(ref3a != nullptr);
-  EXPECT_TRUE(lrt.Remove(cookieA, ref2a));
-  lrt.SetSegmentState(cookieA);
+  EXPECT_TRUE(lrt.Remove(ref2a));
+  lrt.PopFrame(cookie0A);
 
   // Create a hole in the first segment.
   // There was previously a bug that `Remove()` would not prune the popped free entries,
   // so the new free entry would point to the hole in the popped segment. The code below
   // would then overwrite that hole with a new segment, pop that segment, reuse the good
   // free entry and then crash trying to prune the overwritten hole. b/276210372
-  EXPECT_TRUE(lrt.Remove(cookie0, ref0));
+  EXPECT_TRUE(lrt.Remove(ref0));
 
   // Create a second segment again and overwite the old hole, then pop the segment.
-  const LRTSegmentState cookieB = lrt.GetSegmentState();
-  ASSERT_EQ(cookieB.top_index, cookieA.top_index);
-  IndirectRef ref2b = lrt.Add(cookieB, c, &error_msg);
+  const LRTSegmentState cookie0B = lrt.PushFrame();
+  const LRTSegmentState previous_state_B = get_previous_state();
+  ASSERT_EQ(cookie0B.top_index, cookie0A.top_index);
+  ASSERT_EQ(previous_state_B.top_index, previous_state_A.top_index);
+  IndirectRef ref2b = lrt.Add(c, &error_msg);
   ASSERT_TRUE(ref2b != nullptr);
-  lrt.SetSegmentState(cookieB);
+  lrt.PopFrame(cookie0B);
 
   // Reuse the hole in first segment.
-  IndirectRef reused0 = lrt.Add(cookie0, c, &error_msg);
+  IndirectRef reused0 = lrt.Add(c, &error_msg);
   ASSERT_TRUE(reused0 != nullptr);
 
   // Add a new reference.
-  IndirectRef new_ref = lrt.Add(cookie0, c, &error_msg);
+  IndirectRef new_ref = lrt.Add(c, &error_msg);
   ASSERT_TRUE(new_ref != nullptr);
 }
 
@@ -829,11 +842,10 @@
   ObjPtr<mirror::Class> c = GetClassRoot<mirror::Object>();
 
   // Add refs to fill all small tables and one bigger table.
-  const LRTSegmentState cookie0 = kLRTFirstSegment;
-  constexpr size_t kRefsPerPage = kPageSize / sizeof(LrtEntry);
+  const size_t refs_per_page = gPageSize / sizeof(LrtEntry);
   std::vector<IndirectRef> refs;
-  for (size_t i = 0; i != 2 * kRefsPerPage; ++i) {
-    refs.push_back(lrt.Add(cookie0, c, &error_msg));
+  for (size_t i = 0; i != 2 * refs_per_page; ++i) {
+    refs.push_back(lrt.Add(c, &error_msg));
     ASSERT_TRUE(refs.back() != nullptr);
   }
 
@@ -853,11 +865,11 @@
   ObjPtr<mirror::Class> c = GetClassRoot<mirror::Object>();
 
   // Add refs to fill all small tables.
-  const LRTSegmentState cookie0 = kLRTFirstSegment;
-  constexpr size_t kRefsPerPage = kPageSize / sizeof(LrtEntry);
+  LRTSegmentState cookie0 = lrt.PushFrame();
+  const size_t refs_per_page = gPageSize / sizeof(LrtEntry);
   std::vector<IndirectRef> refs0;
-  for (size_t i = 0; i != kRefsPerPage; ++i) {
-    refs0.push_back(lrt.Add(cookie0, c, &error_msg));
+  for (size_t i = 0; i != refs_per_page; ++i) {
+    refs0.push_back(lrt.Add(c, &error_msg));
     ASSERT_TRUE(refs0.back() != nullptr);
   }
 
@@ -867,9 +879,9 @@
 
   // Add refs to fill the next, page-sized table.
   std::vector<IndirectRef> refs1;
-  LRTSegmentState cookie1 = lrt.GetSegmentState();
-  for (size_t i = 0; i != kRefsPerPage; ++i) {
-    refs1.push_back(lrt.Add(cookie1, c, &error_msg));
+  LRTSegmentState cookie1 = lrt.PushFrame();
+  for (size_t i = 0; i != refs_per_page; ++i) {
+    refs1.push_back(lrt.Add(c, &error_msg));
     ASSERT_TRUE(refs1.back() != nullptr);
   }
 
@@ -878,13 +890,13 @@
   ASSERT_FALSE(IndirectReferenceTable::ClearIndirectRefKind<LrtEntry*>(refs1.back())->IsNull());
 
   // Pop one reference and try to trim, there is no page to trim.
-  ASSERT_TRUE(lrt.Remove(cookie1, refs1.back()));
+  ASSERT_TRUE(lrt.Remove(refs1.back()));
   lrt.Trim();
   ASSERT_FALSE(
       IndirectReferenceTable::ClearIndirectRefKind<LrtEntry*>(refs1[refs1.size() - 2u])->IsNull());
 
   // Pop the entire segment with the page-sized table and trim, clearing the page.
-  lrt.SetSegmentState(cookie1);
+  lrt.PopFrame(cookie1);
   lrt.Trim();
   for (IndirectRef ref : refs1) {
     ASSERT_TRUE(IndirectReferenceTable::ClearIndirectRefKind<LrtEntry*>(ref)->IsNull());
@@ -892,17 +904,17 @@
   refs1.clear();
 
   // Add refs to fill the page-sized table and half of the next one.
-  cookie1 = lrt.GetSegmentState();  // Push a new segment.
-  for (size_t i = 0; i != 2 * kRefsPerPage; ++i) {
-    refs1.push_back(lrt.Add(cookie1, c, &error_msg));
+  cookie1 = lrt.PushFrame();  // Push a new segment.
+  for (size_t i = 0; i != 2 * refs_per_page; ++i) {
+    refs1.push_back(lrt.Add(c, &error_msg));
     ASSERT_TRUE(refs1.back() != nullptr);
   }
 
   // Add refs to fill the other half of the table with two pages.
   std::vector<IndirectRef> refs2;
-  const LRTSegmentState cookie2 = lrt.GetSegmentState();
-  for (size_t i = 0; i != kRefsPerPage; ++i) {
-    refs2.push_back(lrt.Add(cookie2, c, &error_msg));
+  const LRTSegmentState cookie2 = lrt.PushFrame();
+  for (size_t i = 0; i != refs_per_page; ++i) {
+    refs2.push_back(lrt.Add(c, &error_msg));
     ASSERT_TRUE(refs2.back() != nullptr);
   }
 
@@ -911,7 +923,7 @@
   ASSERT_FALSE(IndirectReferenceTable::ClearIndirectRefKind<LrtEntry*>(refs1.back())->IsNull());
 
   // Pop the last segment with one page worth of references and trim that page.
-  lrt.SetSegmentState(cookie2);
+  lrt.PopFrame(cookie2);
   lrt.Trim();
   for (IndirectRef ref : refs2) {
     ASSERT_TRUE(IndirectReferenceTable::ClearIndirectRefKind<LrtEntry*>(ref)->IsNull());
@@ -922,7 +934,7 @@
   }
 
   // Pop the middle segment with two pages worth of references, and trim those pages.
-  lrt.SetSegmentState(cookie1);
+  lrt.PopFrame(cookie1);
   lrt.Trim();
   for (IndirectRef ref : refs1) {
     ASSERT_TRUE(IndirectReferenceTable::ClearIndirectRefKind<LrtEntry*>(ref)->IsNull());
@@ -930,7 +942,7 @@
   refs1.clear();
 
   // Pop the first segment with small tables and try to trim. Small tables are never trimmed.
-  lrt.SetSegmentState(cookie0);
+  lrt.PopFrame(cookie0);
   lrt.Trim();
   for (IndirectRef ref : refs0) {
     ASSERT_FALSE(IndirectReferenceTable::ClearIndirectRefKind<LrtEntry*>(ref)->IsNull());
@@ -938,13 +950,15 @@
   refs0.clear();
 
   // Fill small tables and one more reference, then another segment up to 4 pages.
-  for (size_t i = 0; i != kRefsPerPage + 1u; ++i) {
-    refs0.push_back(lrt.Add(cookie0, c, &error_msg));
+  LRTSegmentState cookie0_second = lrt.PushFrame();
+  ASSERT_EQ(cookie0.top_index, cookie0_second.top_index);
+  for (size_t i = 0; i != refs_per_page + 1u; ++i) {
+    refs0.push_back(lrt.Add(c, &error_msg));
     ASSERT_TRUE(refs0.back() != nullptr);
   }
-  cookie1 = lrt.GetSegmentState();  // Push a new segment.
-  for (size_t i = 0; i != 3u * kRefsPerPage - 1u; ++i) {
-    refs1.push_back(lrt.Add(cookie1, c, &error_msg));
+  cookie1 = lrt.PushFrame();  // Push a new segment.
+  for (size_t i = 0; i != 3u * refs_per_page - 1u; ++i) {
+    refs1.push_back(lrt.Add(c, &error_msg));
     ASSERT_TRUE(refs1.back() != nullptr);
   }
 
@@ -953,17 +967,17 @@
   ASSERT_FALSE(IndirectReferenceTable::ClearIndirectRefKind<LrtEntry*>(refs1.back())->IsNull());
 
   // Pop the middle segment, trim two pages.
-  lrt.SetSegmentState(cookie1);
+  lrt.PopFrame(cookie1);
   lrt.Trim();
   for (IndirectRef ref : refs0) {
     ASSERT_FALSE(IndirectReferenceTable::ClearIndirectRefKind<LrtEntry*>(ref)->IsNull());
   }
   ASSERT_EQ(refs0.size(), lrt.Capacity());
-  for (IndirectRef ref : ArrayRef<IndirectRef>(refs1).SubArray(0u, kRefsPerPage - 1u)) {
+  for (IndirectRef ref : ArrayRef<IndirectRef>(refs1).SubArray(0u, refs_per_page - 1u)) {
     // Popped but not trimmed as these are at the same page as the last entry in `refs0`.
     ASSERT_FALSE(IndirectReferenceTable::ClearIndirectRefKind<LrtEntry*>(ref)->IsNull());
   }
-  for (IndirectRef ref : ArrayRef<IndirectRef>(refs1).SubArray(kRefsPerPage - 1u)) {
+  for (IndirectRef ref : ArrayRef<IndirectRef>(refs1).SubArray(refs_per_page - 1u)) {
     ASSERT_TRUE(IndirectReferenceTable::ClearIndirectRefKind<LrtEntry*>(ref)->IsNull());
   }
 }
@@ -977,11 +991,11 @@
   ObjPtr<mirror::Class> c = GetClassRoot<mirror::Object>();
 
   // Add refs to fill all small tables and one bigger table.
-  const LRTSegmentState cookie0 = kLRTFirstSegment;
-  constexpr size_t kRefsPerPage = kPageSize / sizeof(LrtEntry);
+  const LRTSegmentState cookie0 = lrt.PushFrame();
+  const size_t refs_per_page = gPageSize / sizeof(LrtEntry);
   std::vector<IndirectRef> refs;
-  for (size_t i = 0; i != 2 * kRefsPerPage; ++i) {
-    refs.push_back(lrt.Add(cookie0, c, &error_msg));
+  for (size_t i = 0; i != 2 * refs_per_page; ++i) {
+    refs.push_back(lrt.Add(c, &error_msg));
     ASSERT_TRUE(refs.back() != nullptr);
   }
 
@@ -991,20 +1005,20 @@
 
   // Create a hole in the last page.
   IndirectRef removed = refs[refs.size() - 2u];
-  ASSERT_TRUE(lrt.Remove(cookie0, removed));
+  ASSERT_TRUE(lrt.Remove(removed));
 
   // Pop the entire segment and trim. Small tables are not pruned.
-  lrt.SetSegmentState(cookie0);
+  lrt.PopFrame(cookie0);
   lrt.Trim();
-  for (IndirectRef ref : ArrayRef<IndirectRef>(refs).SubArray(0u, kRefsPerPage)) {
+  for (IndirectRef ref : ArrayRef<IndirectRef>(refs).SubArray(0u, refs_per_page)) {
     ASSERT_FALSE(IndirectReferenceTable::ClearIndirectRefKind<LrtEntry*>(ref)->IsNull());
   }
-  for (IndirectRef ref : ArrayRef<IndirectRef>(refs).SubArray(kRefsPerPage)) {
+  for (IndirectRef ref : ArrayRef<IndirectRef>(refs).SubArray(refs_per_page)) {
     ASSERT_TRUE(IndirectReferenceTable::ClearIndirectRefKind<LrtEntry*>(ref)->IsNull());
   }
 
   // Add a new reference and check that it reused the first slot rather than the old hole.
-  IndirectRef new_ref = lrt.Add(cookie0, c, &error_msg);
+  IndirectRef new_ref = lrt.Add(c, &error_msg);
   ASSERT_TRUE(new_ref != nullptr);
   ASSERT_NE(new_ref, removed);
   ASSERT_EQ(new_ref, refs[0]);
diff --git a/runtime/jni_id_type.h b/runtime/jni_id_type.h
index a8908fc..0092f22 100644
--- a/runtime/jni_id_type.h
+++ b/runtime/jni_id_type.h
@@ -19,7 +19,9 @@
 
 #include <iosfwd>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 enum class JniIdType {
   // All Jni method/field IDs are pointers to the corresponding Art{Field,Method} type
@@ -35,7 +37,7 @@
   kDefault = kPointer,
 };
 
-std::ostream& operator<<(std::ostream& os, JniIdType rhs);
+EXPORT std::ostream& operator<<(std::ostream& os, JniIdType rhs);
 
 }  // namespace art
 #endif  // ART_RUNTIME_JNI_ID_TYPE_H_
diff --git a/runtime/jvalue-inl.h b/runtime/jvalue-inl.h
index 5bd4f17..7c38700 100644
--- a/runtime/jvalue-inl.h
+++ b/runtime/jvalue-inl.h
@@ -21,7 +21,7 @@
 
 #include "obj_ptr-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 inline void JValue::SetL(ObjPtr<mirror::Object> new_l) {
   l = new_l.Ptr();
diff --git a/runtime/jvalue.h b/runtime/jvalue.h
index d03749c..7a44247 100644
--- a/runtime/jvalue.h
+++ b/runtime/jvalue.h
@@ -24,7 +24,7 @@
 
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 class Object;
 }  // namespace mirror
diff --git a/runtime/linear_alloc-inl.h b/runtime/linear_alloc-inl.h
index 7c81352..fba24c8 100644
--- a/runtime/linear_alloc-inl.h
+++ b/runtime/linear_alloc-inl.h
@@ -22,7 +22,7 @@
 #include "base/gc_visited_arena_pool.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 inline void LinearAlloc::SetFirstObject(void* begin, size_t bytes) const {
   DCHECK(track_allocations_);
diff --git a/runtime/linear_alloc.h b/runtime/linear_alloc.h
index c81077a..ce073cc 100644
--- a/runtime/linear_alloc.h
+++ b/runtime/linear_alloc.h
@@ -19,9 +19,10 @@
 
 #include "base/arena_allocator.h"
 #include "base/casts.h"
+#include "base/macros.h"
 #include "base/mutex.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArenaPool;
 
diff --git a/runtime/lock_word-inl.h b/runtime/lock_word-inl.h
index 4a2a293..4108b1a 100644
--- a/runtime/lock_word-inl.h
+++ b/runtime/lock_word-inl.h
@@ -20,7 +20,7 @@
 #include "lock_word.h"
 #include "monitor_pool.h"
 
-namespace art {
+namespace art HIDDEN {
 
 inline uint32_t LockWord::ThinLockOwner() const {
   DCHECK_EQ(GetState(), kThinLocked);
diff --git a/runtime/lock_word.h b/runtime/lock_word.h
index 21b40b7..b717b1f 100644
--- a/runtime/lock_word.h
+++ b/runtime/lock_word.h
@@ -23,9 +23,10 @@
 #include <android-base/logging.h>
 
 #include "base/bit_utils.h"
+#include "base/macros.h"
 #include "read_barrier.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 class Object;
 }  // namespace mirror
@@ -318,9 +319,8 @@
   // The encoded value holding all the state.
   uint32_t value_;
 };
-std::ostream& operator<<(std::ostream& os, LockWord::LockState code);
+EXPORT std::ostream& operator<<(std::ostream& os, LockWord::LockState code);
 
 }  // namespace art
 
-
 #endif  // ART_RUNTIME_LOCK_WORD_H_
diff --git a/runtime/managed_stack-inl.h b/runtime/managed_stack-inl.h
index ca983ea..a57b75b 100644
--- a/runtime/managed_stack-inl.h
+++ b/runtime/managed_stack-inl.h
@@ -21,7 +21,7 @@
 
 #include "interpreter/shadow_frame.h"
 
-namespace art {
+namespace art HIDDEN {
 
 inline ShadowFrame* ManagedStack::PushShadowFrame(ShadowFrame* new_top_frame) {
   DCHECK(!HasTopQuickFrame());
diff --git a/runtime/managed_stack.h b/runtime/managed_stack.h
index 0e7dfe3..5046e17 100644
--- a/runtime/managed_stack.h
+++ b/runtime/managed_stack.h
@@ -27,7 +27,7 @@
 #include "base/macros.h"
 #include "base/bit_utils.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Object;
@@ -41,6 +41,17 @@
 // may either be shadow frames or lists of frames using fixed frame sizes. Transition records are
 // necessary for transitions between code using different frame layouts and transitions into native
 // code.
+//
+// Each ManagedStack fragment may contain either a quick code's sp or address to a shadow frame.
+// It is an invariant that both are never set at the same time.
+//
+// Each fragment may contain a mini stack, more than one call frame. For quick code, we extract the
+// call's frame size (known a priori) to obtain the caller's sp. The walk for this fragment
+// terminates when a potential caller's sp contains null (instead of a valid ArtMethod*). A
+// null-valued sp is set up by a quick code stub. For shadow frames, we chase the link_ pointer
+// until null. Once a mini stack is completely walked, we move onto the next fragment.
+//
+// The topmost fragment is always held in the thread's TLS region.
 class PACKED(4) ManagedStack {
  public:
   static size_t constexpr kTaggedJniSpMask = 0x3;
diff --git a/runtime/mapping_table.h b/runtime/mapping_table.h
deleted file mode 100644
index 6686473..0000000
--- a/runtime/mapping_table.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ART_RUNTIME_MAPPING_TABLE_H_
-#define ART_RUNTIME_MAPPING_TABLE_H_
-
-#include "base/leb128.h"
-#include "base/logging.h"
-
-namespace art {
-
-// A utility for processing the raw uleb128 encoded mapping table created by the quick compiler.
-class MappingTable {
- public:
-  explicit MappingTable(const uint8_t* encoded_map) : encoded_table_(encoded_map) {
-  }
-
-  uint32_t TotalSize() const PURE {
-    const uint8_t* table = encoded_table_;
-    if (table == nullptr) {
-      return 0;
-    } else {
-      return DecodeUnsignedLeb128(&table);
-    }
-  }
-
-  uint32_t DexToPcSize() const PURE {
-    const uint8_t* table = encoded_table_;
-    if (table == nullptr) {
-      return 0;
-    } else {
-      uint32_t total_size = DecodeUnsignedLeb128(&table);
-      uint32_t pc_to_dex_size = DecodeUnsignedLeb128(&table);
-      return total_size - pc_to_dex_size;
-    }
-  }
-
-  const uint8_t* FirstDexToPcPtr() const {
-    const uint8_t* table = encoded_table_;
-    if (table != nullptr) {
-      uint32_t total_size = DecodeUnsignedLeb128(&table);
-      uint32_t pc_to_dex_size = DecodeUnsignedLeb128(&table);
-      // We must have dex to pc entries or else the loop will go beyond the end of the table.
-      DCHECK_GT(total_size, pc_to_dex_size);
-      for (uint32_t i = 0; i < pc_to_dex_size; ++i) {
-        DecodeUnsignedLeb128(&table);  // Move ptr past native PC delta.
-        DecodeSignedLeb128(&table);  // Move ptr past dex PC delta.
-      }
-    }
-    return table;
-  }
-
-  class DexToPcIterator {
-   public:
-    DexToPcIterator(const MappingTable* table, uint32_t element) :
-        table_(table), element_(element), end_(table_->DexToPcSize()), encoded_table_ptr_(nullptr),
-        native_pc_offset_(0), dex_pc_(0) {
-      if (element == 0) {  // An iterator wanted from the start.
-        if (end_ > 0) {
-          encoded_table_ptr_ = table_->FirstDexToPcPtr();
-          native_pc_offset_ = DecodeUnsignedLeb128(&encoded_table_ptr_);
-          // First delta is always positive.
-          dex_pc_ = static_cast<uint32_t>(DecodeSignedLeb128(&encoded_table_ptr_));
-        }
-      } else {  // An iterator wanted from the end.
-        DCHECK_EQ(table_->DexToPcSize(), element);
-      }
-    }
-    uint32_t NativePcOffset() const {
-      return native_pc_offset_;
-    }
-    uint32_t DexPc() const {
-      return dex_pc_;
-    }
-    void operator++() {
-      ++element_;
-      if (element_ != end_) {  // Avoid reading beyond the end of the table.
-        native_pc_offset_ += DecodeUnsignedLeb128(&encoded_table_ptr_);
-        // For negative delta, unsigned overflow after static_cast does exactly what we need.
-        dex_pc_ += static_cast<uint32_t>(DecodeSignedLeb128(&encoded_table_ptr_));
-      }
-    }
-    bool operator==(const DexToPcIterator& rhs) const {
-      CHECK(table_ == rhs.table_);
-      return element_ == rhs.element_;
-    }
-    bool operator!=(const DexToPcIterator& rhs) const {
-      CHECK(table_ == rhs.table_);
-      return element_ != rhs.element_;
-    }
-
-   private:
-    const MappingTable* const table_;  // The original table.
-    uint32_t element_;  // A value in the range 0 to end_.
-    const uint32_t end_;  // Equal to table_->DexToPcSize().
-    const uint8_t* encoded_table_ptr_;  // Either null or points to encoded data after this entry.
-    uint32_t native_pc_offset_;  // The current value of native pc offset.
-    uint32_t dex_pc_;  // The current value of dex pc.
-  };
-
-  DexToPcIterator DexToPcBegin() const {
-    return DexToPcIterator(this, 0);
-  }
-
-  DexToPcIterator DexToPcEnd() const {
-    uint32_t size = DexToPcSize();
-    return DexToPcIterator(this, size);
-  }
-
-  uint32_t PcToDexSize() const PURE {
-    const uint8_t* table = encoded_table_;
-    if (table == nullptr) {
-      return 0;
-    } else {
-      DecodeUnsignedLeb128(&table);  // Total_size, unused.
-      uint32_t pc_to_dex_size = DecodeUnsignedLeb128(&table);
-      return pc_to_dex_size;
-    }
-  }
-
-  const uint8_t* FirstPcToDexPtr() const {
-    const uint8_t* table = encoded_table_;
-    if (table != nullptr) {
-      DecodeUnsignedLeb128(&table);  // Total_size, unused.
-      DecodeUnsignedLeb128(&table);  // PC to Dex size, unused.
-    }
-    return table;
-  }
-
-  class PcToDexIterator {
-   public:
-    PcToDexIterator(const MappingTable* table, uint32_t element) :
-        table_(table), element_(element), end_(table_->PcToDexSize()), encoded_table_ptr_(nullptr),
-        native_pc_offset_(0), dex_pc_(0) {
-      if (element == 0) {  // An iterator wanted from the start.
-        if (end_ > 0) {
-          encoded_table_ptr_ = table_->FirstPcToDexPtr();
-          native_pc_offset_ = DecodeUnsignedLeb128(&encoded_table_ptr_);
-          // First delta is always positive.
-          dex_pc_ = static_cast<uint32_t>(DecodeSignedLeb128(&encoded_table_ptr_));
-        }
-      } else {  // An iterator wanted from the end.
-        DCHECK_EQ(table_->PcToDexSize(), element);
-      }
-    }
-    uint32_t NativePcOffset() const {
-      return native_pc_offset_;
-    }
-    uint32_t DexPc() const {
-      return dex_pc_;
-    }
-    void operator++() {
-      ++element_;
-      if (element_ != end_) {  // Avoid reading beyond the end of the table.
-        native_pc_offset_ += DecodeUnsignedLeb128(&encoded_table_ptr_);
-        // For negative delta, unsigned overflow after static_cast does exactly what we need.
-        dex_pc_ += static_cast<uint32_t>(DecodeSignedLeb128(&encoded_table_ptr_));
-      }
-    }
-    bool operator==(const PcToDexIterator& rhs) const {
-      CHECK(table_ == rhs.table_);
-      return element_ == rhs.element_;
-    }
-    bool operator!=(const PcToDexIterator& rhs) const {
-      CHECK(table_ == rhs.table_);
-      return element_ != rhs.element_;
-    }
-
-   private:
-    const MappingTable* const table_;  // The original table.
-    uint32_t element_;  // A value in the range 0 to PcToDexSize.
-    const uint32_t end_;  // Equal to table_->PcToDexSize().
-    const uint8_t* encoded_table_ptr_;  // Either null or points to encoded data after this entry.
-    uint32_t native_pc_offset_;  // The current value of native pc offset.
-    uint32_t dex_pc_;  // The current value of dex pc.
-  };
-
-  PcToDexIterator PcToDexBegin() const {
-    return PcToDexIterator(this, 0);
-  }
-
-  PcToDexIterator PcToDexEnd() const {
-    uint32_t size = PcToDexSize();
-    return PcToDexIterator(this, size);
-  }
-
- private:
-  const uint8_t* const encoded_table_;
-};
-
-}  // namespace art
-
-#endif  // ART_RUNTIME_MAPPING_TABLE_H_
diff --git a/runtime/method_handles-inl.h b/runtime/method_handles-inl.h
index 1a1507a..be9f0d3 100644
--- a/runtime/method_handles-inl.h
+++ b/runtime/method_handles-inl.h
@@ -30,7 +30,7 @@
 #include "reflection.h"
 #include "stack.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // A convenience class that allows for iteration through a list of
 // input argument registers. This is used to iterate over input
@@ -105,20 +105,18 @@
   size_t arg_index_;
 };
 
-inline bool ConvertArgumentValue(Handle<mirror::MethodType> callsite_type,
-                                 Handle<mirror::MethodType> callee_type,
-                                 ObjPtr<mirror::Class> from_class,
-                                 ObjPtr<mirror::Class> to_class,
-                                 JValue* value) REQUIRES_SHARED(Locks::mutator_lock_) {
-  if (from_class == to_class) {
+inline bool ConvertArgumentValue(const ThrowWrongMethodTypeFunction& throw_wmt,
+                                 ObjPtr<mirror::Class> from,
+                                 ObjPtr<mirror::Class> to,
+                                 /*inout*/ JValue* value) {
+  if (from == to) {
     return true;
   }
 
-  // |value| may contain a bare heap pointer which is generally
-  // |unsafe. ConvertJValueCommon() saves |value|, |from_class|, and
-  // |to_class| to Handles where necessary to avoid issues if the heap
-  // changes.
-  if (ConvertJValueCommon(callsite_type, callee_type, from_class, to_class, value)) {
+  // `*value` may contain a bare heap pointer which is generally unsafe.
+  // `ConvertJValueCommon()` saves `*value`, `from`, and `to` to Handles
+  // where necessary to avoid issues if the heap changes.
+  if (ConvertJValueCommon(throw_wmt, from, to, value)) {
     DCHECK(!Thread::Current()->IsExceptionPending());
     return true;
   } else {
@@ -128,31 +126,18 @@
   }
 }
 
-inline bool ConvertArgumentValue(Handle<mirror::MethodType> callsite_type,
-                                 Handle<mirror::MethodType> callee_type,
-                                 int index,
-                                 JValue* value) REQUIRES_SHARED(Locks::mutator_lock_) {
-  return ConvertArgumentValue(callsite_type,
-                              callee_type,
-                              callsite_type->GetPTypes()->GetWithoutChecks(index),
-                              callee_type->GetPTypes()->GetWithoutChecks(index),
-                              value);
-}
-
-inline bool ConvertReturnValue(Handle<mirror::MethodType> callsite_type,
-                               Handle<mirror::MethodType> callee_type,
-                               JValue* value)  REQUIRES_SHARED(Locks::mutator_lock_) {
-  ObjPtr<mirror::Class> from_class(callee_type->GetRType());
-  ObjPtr<mirror::Class> to_class(callsite_type->GetRType());
-  if (to_class->GetPrimitiveType() == Primitive::kPrimVoid || from_class == to_class) {
+inline bool ConvertReturnValue(const ThrowWrongMethodTypeFunction& throw_wmt,
+                               ObjPtr<mirror::Class> from,
+                               ObjPtr<mirror::Class> to,
+                               /*inout*/ JValue* value) {
+  if (to->GetPrimitiveType() == Primitive::kPrimVoid || from == to) {
     return true;
   }
 
-  // |value| may contain a bare heap pointer which is generally
-  // unsafe. ConvertJValueCommon() saves |value|, |from_class|, and
-  // |to_class| to Handles where necessary to avoid issues if the heap
-  // changes.
-  if (ConvertJValueCommon(callsite_type, callee_type, from_class, to_class, value)) {
+  // `*value` may contain a bare heap pointer which is generally unsafe.
+  // `ConvertJValueCommon()` saves `*value`, `from`, and `to` to Handles
+  // where necessary to avoid issues if the heap changes.
+  if (ConvertJValueCommon(throw_wmt, from, to, value)) {
     DCHECK(!Thread::Current()->IsExceptionPending());
     return true;
   } else {
@@ -162,21 +147,16 @@
   }
 }
 
-template <typename G, typename S>
-bool PerformConversions(Thread* self,
-                        Handle<mirror::MethodType> callsite_type,
-                        Handle<mirror::MethodType> callee_type,
+template <typename FromPTypes, typename ToPTypes, typename G, typename S>
+bool PerformConversions(const ThrowWrongMethodTypeFunction& throw_wmt,
+                        FromPTypes from_types,
+                        ToPTypes to_types,
                         G* getter,
-                        S* setter,
-                        int32_t start_index,
-                        int32_t end_index) REQUIRES_SHARED(Locks::mutator_lock_) {
-  StackHandleScope<2> hs(self);
-  Handle<mirror::ObjectArray<mirror::Class>> from_types(hs.NewHandle(callsite_type->GetPTypes()));
-  Handle<mirror::ObjectArray<mirror::Class>> to_types(hs.NewHandle(callee_type->GetPTypes()));
-
-  for (int32_t i = start_index; i < end_index; ++i) {
-    ObjPtr<mirror::Class> from(from_types->GetWithoutChecks(i));
-    ObjPtr<mirror::Class> to(to_types->GetWithoutChecks(i - start_index));
+                        S* setter) {
+  DCHECK_EQ(from_types.GetLength(), to_types.GetLength());
+  for (int32_t i = 0, length = to_types.GetLength(); i != length; ++i) {
+    ObjPtr<mirror::Class> from = from_types.Get(i);
+    ObjPtr<mirror::Class> to = to_types.Get(i);
     const Primitive::Type from_type = from->GetPrimitiveType();
     const Primitive::Type to_type = to->GetPrimitiveType();
     if (from == to) {
@@ -199,8 +179,8 @@
         value.SetI(getter->Get());
       }
       // Caveat emptor - ObjPtr's not guaranteed valid after this call.
-      if (!ConvertArgumentValue(callsite_type, callee_type, from, to, &value)) {
-        DCHECK(self->IsExceptionPending());
+      if (!ConvertArgumentValue(throw_wmt, from, to, &value)) {
+        DCHECK(Thread::Current()->IsExceptionPending());
         return false;
       }
       if (Primitive::Is64BitType(to_type)) {
@@ -216,28 +196,6 @@
 }
 
 template <typename G, typename S>
-bool PerformConversions(Thread* self,
-                        Handle<mirror::MethodType> callsite_type,
-                        Handle<mirror::MethodType> callee_type,
-                        G* getter,
-                        S* setter,
-                        int32_t num_conversions)
-    REQUIRES_SHARED(Locks::mutator_lock_) {
-  return PerformConversions(self, callsite_type, callee_type, getter, setter, 0, num_conversions);
-}
-
-template <typename G, typename S>
-bool PerformConversions(Thread* self,
-                        Handle<mirror::MethodType> callsite_type,
-                        Handle<mirror::MethodType> callee_type,
-                        G* getter,
-                        S* setter)
-    REQUIRES_SHARED(Locks::mutator_lock_) {
-  int32_t num_conversions = callee_type->GetPTypes()->GetLength();
-  return PerformConversions(self, callsite_type, callee_type, getter, setter, 0, num_conversions);
-}
-
-template <typename G, typename S>
 bool CopyArguments(Thread* self,
                    Handle<mirror::MethodType> method_type,
                    G* getter,
diff --git a/runtime/method_handles.cc b/runtime/method_handles.cc
index c8c6ef9..f2ac3c8 100644
--- a/runtime/method_handles.cc
+++ b/runtime/method_handles.cc
@@ -37,7 +37,7 @@
 #include "var_handles.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -197,11 +197,10 @@
 }
 
 bool ConvertJValueCommon(
-    Handle<mirror::MethodType> callsite_type,
-    Handle<mirror::MethodType> callee_type,
+    const ThrowWrongMethodTypeFunction& throw_wmt,
     ObjPtr<mirror::Class> from,
     ObjPtr<mirror::Class> to,
-    JValue* value) {
+    /*inout*/ JValue* value) {
   // The reader maybe concerned about the safety of the heap object
   // that may be in |value|. There is only one case where allocation
   // is obviously needed and that's for boxing. However, in the case
@@ -226,7 +225,7 @@
   if (IsPrimitiveType(from_type) && IsPrimitiveType(to_type)) {
     // The source and target types are both primitives.
     if (UNLIKELY(!ConvertPrimitiveValueNoThrow(from_type, to_type, src_value, value))) {
-      ThrowWrongMethodTypeException(callee_type.Get(), callsite_type.Get());
+      throw_wmt();
       return false;
     }
     return true;
@@ -258,18 +257,18 @@
       if (LIKELY(boxed_from_class->IsSubClass(to))) {
         type = from_type;
       } else {
-        ThrowWrongMethodTypeException(callee_type.Get(), callsite_type.Get());
+        throw_wmt();
         return false;
       }
     }
 
     if (UNLIKELY(from_type != type)) {
-      ThrowWrongMethodTypeException(callee_type.Get(), callsite_type.Get());
+      throw_wmt();
       return false;
     }
 
     if (UNLIKELY(!ConvertPrimitiveValueNoThrow(from_type, type, src_value, value))) {
-      ThrowWrongMethodTypeException(callee_type.Get(), callsite_type.Get());
+      throw_wmt();
       return false;
     }
 
@@ -300,7 +299,7 @@
     Primitive::Type unboxed_type;
     JValue unboxed_value;
     if (UNLIKELY(!GetUnboxedTypeAndValue(from_obj, &unboxed_type, &unboxed_value))) {
-      ThrowWrongMethodTypeException(callee_type.Get(), callsite_type.Get());
+      throw_wmt();
       return false;
     }
 
@@ -311,7 +310,7 @@
         ThrowClassCastException(from, to);
       } else {
         // CallSite is incompatible, e.g. Integer for a short.
-        ThrowWrongMethodTypeException(callee_type.Get(), callsite_type.Get());
+        throw_wmt();
       }
       return false;
     }
diff --git a/runtime/method_handles.h b/runtime/method_handles.h
index 510b6e1..efe6f69 100644
--- a/runtime/method_handles.h
+++ b/runtime/method_handles.h
@@ -19,12 +19,13 @@
 
 #include <ostream>
 
+#include "base/macros.h"
 #include "dex/dex_instruction.h"
 #include "handle.h"
 #include "jvalue.h"
 #include "mirror/class.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ShadowFrame;
 
@@ -44,42 +45,47 @@
 bool IsReturnTypeConvertible(ObjPtr<mirror::Class> from,
                              ObjPtr<mirror::Class> to);
 
-// Performs a conversion from type |from| to a distinct type |to| as
-// part of conversion of |caller_type| to |callee_type|. The value to
-// be converted is in |value|. Returns true on success and updates
-// |value| with the converted value, false otherwise.
-bool ConvertJValueCommon(Handle<mirror::MethodType> callsite_type,
-                         Handle<mirror::MethodType> callee_type,
+// Interface for throwing `WrongMethodTypeException` by conversion functions.
+class ThrowWrongMethodTypeFunction {
+ public:
+  virtual void operator()() const REQUIRES_SHARED(Locks::mutator_lock_) = 0;
+
+ protected:
+  ~ThrowWrongMethodTypeFunction() {}
+};
+
+// Performs a conversion from type `from` to a distinct type `to`.
+// The value to be converted is in `*value`. Returns true on success
+// and updates `*value` with the converted value, false otherwise.
+bool ConvertJValueCommon(const ThrowWrongMethodTypeFunction& throw_wmt,
                          ObjPtr<mirror::Class> from,
                          ObjPtr<mirror::Class> to,
-                         JValue* value)
+                         /*inout*/ JValue* value)
     REQUIRES_SHARED(Locks::mutator_lock_);
 
-// Converts the value of the argument at position |index| from type
-// expected by |callee_type| to type used by |callsite_type|. |value|
-// represents the value to be converted. Returns true on success and
-// updates |value|, false otherwise.
-ALWAYS_INLINE bool ConvertArgumentValue(Handle<mirror::MethodType> callsite_type,
-                                        Handle<mirror::MethodType> callee_type,
-                                        int index,
-                                        JValue* value)
+// Converts the value of the argument from type `from` to type `to`.
+// `*value` represents the value to be converted. Returns true on success
+// and updates `*value`, false otherwise.
+ALWAYS_INLINE bool ConvertArgumentValue(const ThrowWrongMethodTypeFunction& throw_wmt,
+                                        ObjPtr<mirror::Class> from,
+                                        ObjPtr<mirror::Class> to,
+                                        /*inout*/ JValue* value)
     REQUIRES_SHARED(Locks::mutator_lock_);
 
-// Converts the return value from return type yielded by
-// |callee_type| to the return type yielded by
-// |callsite_type|. |value| represents the value to be
-// converted. Returns true on success and updates |value|, false
-// otherwise.
-ALWAYS_INLINE bool ConvertReturnValue(Handle<mirror::MethodType> callsite_type,
-                                      Handle<mirror::MethodType> callee_type,
-                                      JValue* value)
+// Converts the return value from return type `from` to the return type `to`.
+// `*value` represents the value to be converted. Returns true on success and
+// updates `*value`, false otherwise.
+ALWAYS_INLINE bool ConvertReturnValue(const ThrowWrongMethodTypeFunction& throw_wmt,
+                                      ObjPtr<mirror::Class> from,
+                                      ObjPtr<mirror::Class> to,
+                                      /*inout*/ JValue* value)
     REQUIRES_SHARED(Locks::mutator_lock_);
 
-// Perform argument conversions between |callsite_type| (the type of the
-// incoming arguments) and |callee_type| (the type of the method being
-// invoked). These include widening and narrowing conversions as well as
-// boxing and unboxing. Returns true on success, on false on failure. A
-// pending exception will always be set on failure.
+// Perform argument conversions between `from_types` (the types of the incoming
+// arguments) and `to_types` (the parameter types of the method being invoked).
+// These include widening and narrowing conversions as well as boxing and
+// unboxing. Returns true on success, false on failure. A pending exception
+// will always be set on failure.
 //
 // The values to be converted are read from an input source (of type G)
 // that provides three methods :
@@ -119,14 +125,12 @@
 // TODO(narayan): If we find that the instantiations of this function take
 // up too much space, we can make G / S abstract base classes that are
 // overridden by concrete classes.
-template <typename G, typename S>
-bool PerformConversions(Thread* self,
-                        Handle<mirror::MethodType> callsite_type,
-                        Handle<mirror::MethodType> callee_type,
+template <typename FromPTypes, typename ToPTypes, typename G, typename S>
+bool PerformConversions(const ThrowWrongMethodTypeFunction& throw_wmt,
+                        FromPTypes from_types,
+                        ToPTypes to_types,
                         G* getter,
-                        S* setter,
-                        int32_t start_index,
-                        int32_t end_index) REQUIRES_SHARED(Locks::mutator_lock_);
+                        S* setter) REQUIRES_SHARED(Locks::mutator_lock_);
 
 template <typename G, typename S>
 bool CopyArguments(Thread* self,
diff --git a/runtime/method_handles_test.cc b/runtime/method_handles_test.cc
index 588f861..53604cd 100644
--- a/runtime/method_handles_test.cc
+++ b/runtime/method_handles_test.cc
@@ -28,7 +28,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace {
   bool IsClassCastException(ObjPtr<mirror::Throwable> throwable)
@@ -46,28 +46,15 @@
     return throwable->GetClass()->DescriptorEquals("Ljava/lang/invoke/WrongMethodTypeException;");
   }
 
-  static ObjPtr<mirror::MethodType> CreateVoidMethodType(Thread* self,
-                                                         Handle<mirror::Class> parameter_type)
-        REQUIRES_SHARED(Locks::mutator_lock_) {
-    ClassLinker* cl = Runtime::Current()->GetClassLinker();
-    StackHandleScope<2> hs(self);
-    ObjPtr<mirror::Class> class_array_type = GetClassRoot<mirror::ObjectArray<mirror::Class>>(cl);
-    auto parameter_types = hs.NewHandle(
-        mirror::ObjectArray<mirror::Class>::Alloc(self, class_array_type, 1));
-    parameter_types->Set(0, parameter_type.Get());
-    Handle<mirror::Class> void_class = hs.NewHandle(GetClassRoot(ClassRoot::kPrimitiveVoid, cl));
-    return mirror::MethodType::Create(self, void_class, parameter_types);
-  }
-
-  static bool TryConversion(Thread* self,
-                            Handle<mirror::Class> from,
-                            Handle<mirror::Class> to,
-                            JValue* value)
+  static bool TryConversion(Handle<mirror::Class> from, Handle<mirror::Class> to, JValue* value)
       REQUIRES_SHARED(Locks::mutator_lock_) {
-    StackHandleScope<2> hs(self);
-    Handle<mirror::MethodType> from_mt = hs.NewHandle(CreateVoidMethodType(self, from));
-    Handle<mirror::MethodType> to_mt = hs.NewHandle(CreateVoidMethodType(self, to));
-    return ConvertJValueCommon(from_mt, to_mt, from.Get(), to.Get(), value);
+    class ThrowWrongMethodTypeFunctionImpl final : public ThrowWrongMethodTypeFunction {
+      void operator()() const override REQUIRES_SHARED(Locks::mutator_lock_) {
+        ThrowWrongMethodTypeException("<callee-descriptor>", "<callsite-descriptor>");
+      }
+    };
+    ThrowWrongMethodTypeFunctionImpl throw_wmt;
+    return ConvertJValueCommon(throw_wmt, from.Get(), to.Get(), value);
   }
 }  // namespace
 
@@ -89,7 +76,7 @@
   Handle<mirror::Class> from = hs.NewHandle(cl->FindPrimitiveClass('B'));
   Handle<mirror::Class> to = hs.NewHandle(cl->FindPrimitiveClass('I'));
   JValue value = JValue::FromPrimitive(static_cast<int8_t>(3));
-  ASSERT_TRUE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_TRUE(TryConversion(from, to, &value));
   ASSERT_EQ(3, value.GetI());
   ASSERT_FALSE(soa.Self()->IsExceptionPending());
 }
@@ -102,7 +89,7 @@
   Handle<mirror::Class> to = hs.NewHandle(cl->FindPrimitiveClass('J'));
   uint16_t raw_value = 0x8000;
   JValue value = JValue::FromPrimitive(raw_value);
-  ASSERT_TRUE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_TRUE(TryConversion(from, to, &value));
   ASSERT_FALSE(soa.Self()->IsExceptionPending());
   ASSERT_EQ(static_cast<int64_t>(raw_value), value.GetJ());
 }
@@ -114,7 +101,7 @@
   Handle<mirror::Class> from = hs.NewHandle(cl->FindPrimitiveClass('I'));
   Handle<mirror::Class> to = hs.NewHandle(cl->FindPrimitiveClass('F'));
   JValue value = JValue::FromPrimitive(-16);
-  ASSERT_TRUE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_TRUE(TryConversion(from, to, &value));
   ASSERT_FALSE(soa.Self()->IsExceptionPending());
   ASSERT_FLOAT_EQ(-16.0f, value.GetF());
 }
@@ -127,7 +114,7 @@
   Handle<mirror::Class> to = hs.NewHandle(cl->FindPrimitiveClass('C'));
   JValue value;
   value.SetB(0);
-  ASSERT_FALSE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_FALSE(TryConversion(from, to, &value));
   ASSERT_TRUE(soa.Self()->IsExceptionPending());
   ASSERT_TRUE(IsWrongMethodTypeException(soa.Self()->GetException()));
   soa.Self()->ClearException();
@@ -141,7 +128,7 @@
   Handle<mirror::Class> to = hs.NewHandle(cl->FindPrimitiveClass('C'));
   JValue value;
   value.SetS(0x1234);
-  ASSERT_FALSE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_FALSE(TryConversion(from, to, &value));
   ASSERT_TRUE(soa.Self()->IsExceptionPending());
   ASSERT_TRUE(IsWrongMethodTypeException(soa.Self()->GetException()));
   soa.Self()->ClearException();
@@ -155,7 +142,7 @@
   Handle<mirror::Class> to = hs.NewHandle(cl->FindPrimitiveClass('J'));
   JValue value;
   value.SetD(1e72);
-  ASSERT_FALSE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_FALSE(TryConversion(from, to, &value));
   ASSERT_TRUE(soa.Self()->IsExceptionPending());
   ASSERT_TRUE(IsWrongMethodTypeException(soa.Self()->GetException()));
   soa.Self()->ClearException();
@@ -169,7 +156,7 @@
   Handle<mirror::Class> to = hs.NewHandle(cl->FindPrimitiveClass('I'));
   JValue value;
   value.SetZ(true);
-  ASSERT_FALSE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_FALSE(TryConversion(from, to, &value));
   ASSERT_TRUE(soa.Self()->IsExceptionPending());
   ASSERT_TRUE(IsWrongMethodTypeException(soa.Self()->GetException()));
   soa.Self()->ClearException();
@@ -189,7 +176,7 @@
   Handle<mirror::Class> from = hs.NewHandle(boxed_value->GetClass());
   Handle<mirror::Class> to = hs.NewHandle(cl->FindSystemClass(soa.Self(), "Ljava/lang/Number;"));
   value.SetL(boxed_value.Get());
-  ASSERT_TRUE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_TRUE(TryConversion(from, to, &value));
   ASSERT_FALSE(soa.Self()->IsExceptionPending());
   JValue unboxed_value;
   ASSERT_TRUE(UnboxPrimitiveForResult(value.GetL(), cl->FindPrimitiveClass('I'), &unboxed_value));
@@ -206,7 +193,7 @@
   Handle<mirror::Class> to = hs.NewHandle(cl->FindSystemClass(soa.Self(), "Ljava/lang/Integer;"));
   value.SetL(boxed_value.Get());
   ASSERT_FALSE(soa.Self()->IsExceptionPending());
-  ASSERT_FALSE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_FALSE(TryConversion(from, to, &value));
   ASSERT_TRUE(soa.Self()->IsExceptionPending());
   ASSERT_TRUE(IsClassCastException(soa.Self()->GetException()));
   soa.Self()->ClearException();
@@ -224,7 +211,7 @@
   JValue value = JValue::FromPrimitive(kInitialValue);
   Handle<mirror::Class> from = hs.NewHandle(cl->FindPrimitiveClass('I'));
   Handle<mirror::Class> to = hs.NewHandle(cl->FindSystemClass(soa.Self(), "Ljava/lang/Integer;"));
-  ASSERT_TRUE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_TRUE(TryConversion(from, to, &value));
   ASSERT_FALSE(soa.Self()->IsExceptionPending());
   JValue unboxed_to_value;
   ASSERT_TRUE(UnboxPrimitiveForResult(value.GetL(), from.Get(), &unboxed_to_value));
@@ -239,7 +226,7 @@
   JValue value = JValue::FromPrimitive(kInitialValue);
   Handle<mirror::Class> from = hs.NewHandle(cl->FindPrimitiveClass('I'));
   Handle<mirror::Class> to = hs.NewHandle(cl->FindSystemClass(soa.Self(), "Ljava/lang/Number;"));
-  ASSERT_TRUE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_TRUE(TryConversion(from, to, &value));
   ASSERT_FALSE(soa.Self()->IsExceptionPending());
   JValue unboxed_to_value;
   ASSERT_TRUE(UnboxPrimitiveForResult(value.GetL(), from.Get(), &unboxed_to_value));
@@ -254,7 +241,7 @@
   JValue value = JValue::FromPrimitive(kInitialValue);
   Handle<mirror::Class> from = hs.NewHandle(cl->FindPrimitiveClass('I'));
   Handle<mirror::Class> to = hs.NewHandle(cl->FindSystemClass(soa.Self(), "Ljava/lang/Runtime;"));
-  ASSERT_FALSE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_FALSE(TryConversion(from, to, &value));
   ASSERT_TRUE(soa.Self()->IsExceptionPending());
   ASSERT_TRUE(IsWrongMethodTypeException(soa.Self()->GetException()));
   soa.Self()->ClearException();
@@ -268,7 +255,7 @@
   JValue value = JValue::FromPrimitive(kInitialValue);
   Handle<mirror::Class> from = hs.NewHandle(cl->FindPrimitiveClass('I'));
   Handle<mirror::Class> to = hs.NewHandle(cl->FindSystemClass(soa.Self(), "Ljava/lang/Long;"));
-  ASSERT_FALSE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_FALSE(TryConversion(from, to, &value));
   ASSERT_TRUE(soa.Self()->IsExceptionPending());
   ASSERT_TRUE(IsWrongMethodTypeException(soa.Self()->GetException()));
   soa.Self()->ClearException();
@@ -282,7 +269,7 @@
   JValue value = JValue::FromPrimitive(kInitialValue);
   Handle<mirror::Class> from = hs.NewHandle(cl->FindPrimitiveClass('I'));
   Handle<mirror::Class> to = hs.NewHandle(cl->FindSystemClass(soa.Self(), "Ljava/lang/Byte;"));
-  ASSERT_FALSE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_FALSE(TryConversion(from, to, &value));
   ASSERT_TRUE(soa.Self()->IsExceptionPending());
   ASSERT_TRUE(IsWrongMethodTypeException(soa.Self()->GetException()));
   soa.Self()->ClearException();
@@ -302,7 +289,7 @@
   Handle<mirror::Class> from = hs.NewHandle(cl->FindSystemClass(soa.Self(), "Ljava/lang/Integer;"));
   Handle<mirror::Class> to = hs.NewHandle(cl->FindPrimitiveClass('I'));
   value.SetL(boxed_value.Get());
-  ASSERT_TRUE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_TRUE(TryConversion(from, to, &value));
   ASSERT_FALSE(soa.Self()->IsExceptionPending());
   ASSERT_EQ(kInitialValue, value.GetI());
 }
@@ -317,7 +304,7 @@
   Handle<mirror::Class> from = hs.NewHandle(cl->FindSystemClass(soa.Self(), "Ljava/lang/Integer;"));
   Handle<mirror::Class> to = hs.NewHandle(cl->FindPrimitiveClass('J'));
   value.SetL(boxed_value.Get());
-  ASSERT_TRUE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_TRUE(TryConversion(from, to, &value));
   ASSERT_EQ(kInitialValue, value.GetJ());
 }
 
@@ -330,7 +317,7 @@
   Handle<mirror::Class> from = hs.NewHandle(cl->FindSystemClass(soa.Self(), "Ljava/lang/Integer;"));
   Handle<mirror::Class> to = hs.NewHandle(cl->FindPrimitiveClass('I'));
   value.SetL(boxed_value.Get());
-  ASSERT_FALSE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_FALSE(TryConversion(from, to, &value));
   ASSERT_TRUE(soa.Self()->IsExceptionPending());
   ASSERT_TRUE(IsNullPointerException(soa.Self()->GetException()));
   soa.Self()->ClearException();
@@ -345,7 +332,7 @@
   // Set value to be converted as some non-primitive type.
   JValue value;
   value.SetL(cl->FindPrimitiveClass('V'));
-  ASSERT_FALSE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_FALSE(TryConversion(from, to, &value));
   ASSERT_TRUE(soa.Self()->IsExceptionPending());
   ASSERT_TRUE(IsClassCastException(soa.Self()->GetException()));
   soa.Self()->ClearException();
@@ -361,7 +348,7 @@
   Handle<mirror::Class> from = hs.NewHandle(cl->FindSystemClass(soa.Self(), "Ljava/lang/Integer;"));
   Handle<mirror::Class> to = hs.NewHandle(cl->FindPrimitiveClass('S'));
   value.SetL(boxed_value.Get());
-  ASSERT_FALSE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_FALSE(TryConversion(from, to, &value));
   ASSERT_TRUE(soa.Self()->IsExceptionPending());
   ASSERT_TRUE(IsWrongMethodTypeException(soa.Self()->GetException()));
   soa.Self()->ClearException();
@@ -377,7 +364,7 @@
   Handle<mirror::Class> from = hs.NewHandle(cl->FindSystemClass(soa.Self(), "Ljava/lang/Number;"));
   Handle<mirror::Class> to = hs.NewHandle(cl->FindPrimitiveClass('F'));
   value.SetL(boxed_value.Get());
-  ASSERT_FALSE(TryConversion(soa.Self(), from, to, &value));
+  ASSERT_FALSE(TryConversion(from, to, &value));
   ASSERT_TRUE(soa.Self()->IsExceptionPending());
   ASSERT_TRUE(IsClassCastException(soa.Self()->GetException()));
   soa.Self()->ClearException();
diff --git a/runtime/metrics/reporter.cc b/runtime/metrics/reporter.cc
index 6fc1a14..91f28aa 100644
--- a/runtime/metrics/reporter.cc
+++ b/runtime/metrics/reporter.cc
@@ -22,7 +22,7 @@
 
 #include "base/flags.h"
 #include "base/stl_util.h"
-#include "oat_file_manager.h"
+#include "oat/oat_file_manager.h"
 #include "runtime.h"
 #include "runtime_options.h"
 #include "statsd.h"
@@ -31,7 +31,7 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic error "-Wconversion"
 
-namespace art {
+namespace art HIDDEN {
 namespace metrics {
 
 std::unique_ptr<MetricsReporter> MetricsReporter::Create(
@@ -293,12 +293,12 @@
 
   return {
       .dump_to_logcat = gFlags.MetricsWriteToLogcat(),
-      .dump_to_file = gFlags.MetricsWriteToFile.GetValueOptional(),
       .dump_to_statsd = gFlags.MetricsWriteToStatsd(),
+      .dump_to_file = gFlags.MetricsWriteToFile.GetValueOptional(),
       .metrics_format = gFlags.MetricsFormat(),
       .period_spec = period_spec,
-      .reporting_num_mods = reporting_num_mods,
       .reporting_mods = reporting_mods,
+      .reporting_num_mods = reporting_num_mods,
   };
 }
 
diff --git a/runtime/metrics/reporter.h b/runtime/metrics/reporter.h
index 865815e..2de54fd 100644
--- a/runtime/metrics/reporter.h
+++ b/runtime/metrics/reporter.h
@@ -18,13 +18,14 @@
 #define ART_RUNTIME_METRICS_REPORTER_H_
 
 #include "app_info.h"
+#include "base/macros.h"
 #include "base/message_queue.h"
 #include "base/metrics/metrics.h"
 
 #pragma clang diagnostic push
 #pragma clang diagnostic error "-Wconversion"
 
-namespace art {
+namespace art HIDDEN {
 namespace metrics {
 
 /**
diff --git a/runtime/metrics/reporter_test.cc b/runtime/metrics/reporter_test.cc
index 848a74e..97a845c 100644
--- a/runtime/metrics/reporter_test.cc
+++ b/runtime/metrics/reporter_test.cc
@@ -24,7 +24,7 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic error "-Wconversion"
 
-namespace art {
+namespace art HIDDEN {
 namespace metrics {
 
 // Helper class to verify the metrics reporter.
@@ -65,10 +65,10 @@
     current_report_->data.Put(counter_type, value);
   }
 
-  void ReportHistogram(DatumId histogram_type ATTRIBUTE_UNUSED,
-                       int64_t low_value ATTRIBUTE_UNUSED,
-                       int64_t high_value ATTRIBUTE_UNUSED,
-                       const std::vector<uint32_t>& buckets ATTRIBUTE_UNUSED) override {
+  void ReportHistogram([[maybe_unused]] DatumId histogram_type,
+                       [[maybe_unused]] int64_t low_value,
+                       [[maybe_unused]] int64_t high_value,
+                       [[maybe_unused]] const std::vector<uint32_t>& buckets) override {
     // TODO: nothing yet. We should implement and test histograms as well.
   }
 
diff --git a/runtime/metrics/statsd.cc b/runtime/metrics/statsd.cc
index 2105bdb..67d677b 100644
--- a/runtime/metrics/statsd.cc
+++ b/runtime/metrics/statsd.cc
@@ -28,7 +28,7 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic error "-Wconversion"
 
-namespace art {
+namespace art HIDDEN {
 namespace metrics {
 
 namespace {
@@ -192,6 +192,9 @@
       return std::make_optional(
           statsd::
               ART_DATUM_DELTA_REPORTED__KIND__ART_DATUM_DELTA_GC_FULL_HEAP_COLLECTION_DURATION_MS);
+    case DatumId::kTimeElapsedDelta:
+      return std::make_optional(
+          statsd::ART_DATUM_DELTA_REPORTED__KIND__ART_DATUM_DELTA_TIME_ELAPSED_MS);
   }
 }
 
@@ -383,12 +386,11 @@
         EncodeCompileFilter(session_data_.compiler_filter),
         EncodeCompilationReason(session_data_.compilation_reason),
         current_timestamp_,
-        0,  // TODO: collect and report thread type (0 means UNKNOWN, but that
-            // constant is not present in all branches)
+        0,  // deprecated - was ArtThreadType
         datum_id.value(),
         static_cast<int64_t>(value),
-        statsd::ART_DATUM_REPORTED__DEX_METADATA_TYPE__ART_DEX_METADATA_TYPE_UNKNOWN,
-        statsd::ART_DATUM_REPORTED__APK_TYPE__ART_APK_TYPE_UNKNOWN,
+        0,  // deprecated - was ArtDexMetadataType
+        0,  // deprecated - was ArtApkType
         EncodeInstructionSet(kRuntimeISA),
         EncodeGcCollectorType(Runtime::Current()->GetHeap()->GetForegroundCollectorType()),
         EncodeUffdMinorFaultSupport());
diff --git a/runtime/metrics/statsd.h b/runtime/metrics/statsd.h
index cb84825..ae53a22 100644
--- a/runtime/metrics/statsd.h
+++ b/runtime/metrics/statsd.h
@@ -19,7 +19,9 @@
 
 #include <memory>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 namespace metrics {
 
 class MetricsBackend;
diff --git a/runtime/mirror/accessible_object.h b/runtime/mirror/accessible_object.h
index 7c0d91a..84e1e88 100644
--- a/runtime/mirror/accessible_object.h
+++ b/runtime/mirror/accessible_object.h
@@ -17,10 +17,11 @@
 #ifndef ART_RUNTIME_MIRROR_ACCESSIBLE_OBJECT_H_
 #define ART_RUNTIME_MIRROR_ACCESSIBLE_OBJECT_H_
 
+#include "base/macros.h"
 #include "object.h"
 #include "read_barrier_option.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 
@@ -39,7 +40,7 @@
 
  private:
   // We only use the field indirectly using the FlagOffset() method.
-  uint8_t flag_ ATTRIBUTE_UNUSED;
+  [[maybe_unused]] uint8_t flag_;
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(AccessibleObject);
 };
diff --git a/runtime/mirror/array-alloc-inl.h b/runtime/mirror/array-alloc-inl.h
index c1e0175..b905fd1 100644
--- a/runtime/mirror/array-alloc-inl.h
+++ b/runtime/mirror/array-alloc-inl.h
@@ -30,7 +30,7 @@
 #include "obj_ptr-inl.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 static inline size_t ComputeArraySize(int32_t component_count, size_t component_size_shift) {
@@ -67,7 +67,7 @@
   explicit SetLengthVisitor(int32_t length) : length_(length) {
   }
 
-  void operator()(ObjPtr<Object> obj, size_t usable_size ATTRIBUTE_UNUSED) const
+  void operator()(ObjPtr<Object> obj, [[maybe_unused]] size_t usable_size) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     // Avoid AsArray as object is not yet in live bitmap or allocation stack.
     ObjPtr<Array> array = ObjPtr<Array>::DownCast(obj);
diff --git a/runtime/mirror/array-inl.h b/runtime/mirror/array-inl.h
index 8f81ae5..579b153 100644
--- a/runtime/mirror/array-inl.h
+++ b/runtime/mirror/array-inl.h
@@ -28,7 +28,7 @@
 #include "runtime.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 inline uint32_t Array::ClassSize(PointerSize pointer_size) {
diff --git a/runtime/mirror/array.cc b/runtime/mirror/array.cc
index 7b61b86..a4f6c88 100644
--- a/runtime/mirror/array.cc
+++ b/runtime/mirror/array.cc
@@ -31,7 +31,7 @@
 #include "object_array-inl.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 using android::base::StringPrintf;
diff --git a/runtime/mirror/array.h b/runtime/mirror/array.h
index 5d64167..b8724cc 100644
--- a/runtime/mirror/array.h
+++ b/runtime/mirror/array.h
@@ -19,10 +19,11 @@
 
 #include "base/bit_utils.h"
 #include "base/enums.h"
+#include "base/macros.h"
 #include "obj_ptr.h"
 #include "object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace gc {
 enum AllocatorType : char;
@@ -127,23 +128,23 @@
   template<VerifyObjectFlags kVerifyFlags = kDefaultVerifyFlags>
   ALWAYS_INLINE bool CheckIsValidIndex(int32_t index) REQUIRES_SHARED(Locks::mutator_lock_);
 
-  static ObjPtr<Array> CopyOf(Handle<Array> h_this, Thread* self, int32_t new_length)
+  EXPORT static ObjPtr<Array> CopyOf(Handle<Array> h_this, Thread* self, int32_t new_length)
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
  protected:
-  void ThrowArrayStoreException(ObjPtr<Object> object) REQUIRES_SHARED(Locks::mutator_lock_)
+  EXPORT void ThrowArrayStoreException(ObjPtr<Object> object) REQUIRES_SHARED(Locks::mutator_lock_)
       REQUIRES(!Roles::uninterruptible_);
 
  private:
-  void ThrowArrayIndexOutOfBoundsException(int32_t index)
+  EXPORT void ThrowArrayIndexOutOfBoundsException(int32_t index)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // The number of array elements.
   // We only use the field indirectly using the LengthOffset() method.
-  int32_t length_ ATTRIBUTE_UNUSED;
+  [[maybe_unused]] int32_t length_;
   // Marker for the data (used by generated code)
   // We only use the field indirectly using the DataOffset() method.
-  uint32_t first_element_[0] ATTRIBUTE_UNUSED;
+  [[maybe_unused]] uint32_t first_element_[0];
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(Array);
 };
@@ -162,13 +163,14 @@
 
   using ElementType = T;
 
-  static ObjPtr<PrimitiveArray<T>> Alloc(Thread* self, size_t length)
+  EXPORT static ObjPtr<PrimitiveArray<T>> Alloc(Thread* self, size_t length)
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
-  static ObjPtr<PrimitiveArray<T>> AllocateAndFill(Thread* self, const T* data, size_t length)
+  EXPORT static ObjPtr<PrimitiveArray<T>> AllocateAndFill(Thread* self,
+                                                          const T* data,
+                                                          size_t length)
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
-
   const T* GetData() const ALWAYS_INLINE  REQUIRES_SHARED(Locks::mutator_lock_) {
     return reinterpret_cast<const T*>(GetRawData<sizeof(T)>(0));
   }
@@ -211,7 +213,7 @@
    * smaller than element size copies). Arguments are assumed to be within the bounds of the array
    * and the arrays non-null.
    */
-  void Memcpy(int32_t dst_pos, ObjPtr<PrimitiveArray<T>> src, int32_t src_pos, int32_t count)
+  EXPORT void Memcpy(int32_t dst_pos, ObjPtr<PrimitiveArray<T>> src, int32_t src_pos, int32_t count)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
  private:
diff --git a/runtime/mirror/call_site-inl.h b/runtime/mirror/call_site-inl.h
index dbbd4d1..d38d47b 100644
--- a/runtime/mirror/call_site-inl.h
+++ b/runtime/mirror/call_site-inl.h
@@ -21,7 +21,7 @@
 
 #include "object-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 inline ObjPtr<MethodHandle> CallSite::GetTarget() {
diff --git a/runtime/mirror/call_site.h b/runtime/mirror/call_site.h
index 88387a3..1ec766c 100644
--- a/runtime/mirror/call_site.h
+++ b/runtime/mirror/call_site.h
@@ -17,10 +17,11 @@
 #ifndef ART_RUNTIME_MIRROR_CALL_SITE_H_
 #define ART_RUNTIME_MIRROR_CALL_SITE_H_
 
+#include "base/macros.h"
 #include "mirror/method_handle_impl.h"
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 
 struct CallSiteOffsets;
 
diff --git a/runtime/mirror/class-alloc-inl.h b/runtime/mirror/class-alloc-inl.h
index ed3967b..d1dd5db 100644
--- a/runtime/mirror/class-alloc-inl.h
+++ b/runtime/mirror/class-alloc-inl.h
@@ -24,7 +24,7 @@
 #include "object-inl.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 inline void Class::CheckObjectAlloc() {
diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h
index e2fd82f..9c58ff6 100644
--- a/runtime/mirror/class-inl.h
+++ b/runtime/mirror/class-inl.h
@@ -42,7 +42,7 @@
 #include "subtype_check.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 template<VerifyObjectFlags kVerifyFlags>
diff --git a/runtime/mirror/class-refvisitor-inl.h b/runtime/mirror/class-refvisitor-inl.h
index ee5c11f..21ed1cd 100644
--- a/runtime/mirror/class-refvisitor-inl.h
+++ b/runtime/mirror/class-refvisitor-inl.h
@@ -22,7 +22,7 @@
 #include "art_field-inl.h"
 #include "class_ext-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 template <bool kVisitNativeRoots,
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc
index 6458613..3feb9d8 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -58,7 +58,7 @@
 #include "throwable.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 
@@ -1605,9 +1605,9 @@
 
 class ReadBarrierOnNativeRootsVisitor {
  public:
-  void operator()(ObjPtr<Object> obj ATTRIBUTE_UNUSED,
-                  MemberOffset offset ATTRIBUTE_UNUSED,
-                  bool is_static ATTRIBUTE_UNUSED) const {}
+  void operator()([[maybe_unused]] ObjPtr<Object> obj,
+                  [[maybe_unused]] MemberOffset offset,
+                  [[maybe_unused]] bool is_static) const {}
 
   void VisitRootIfNonNull(CompressedReference<Object>* root) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
@@ -1644,7 +1644,7 @@
         copy_bytes_(copy_bytes), imt_(imt), pointer_size_(pointer_size) {
   }
 
-  void operator()(ObjPtr<Object> obj, size_t usable_size ATTRIBUTE_UNUSED) const
+  void operator()(ObjPtr<Object> obj, [[maybe_unused]] size_t usable_size) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     StackHandleScope<1> hs(self_);
     Handle<mirror::Class> h_new_class_obj(hs.NewHandle(obj->AsClass()));
@@ -2142,26 +2142,47 @@
   return true;
 }
 
+ALWAYS_INLINE
+static bool IsInterfaceMethodAccessible(ArtMethod* interface_method)
+    REQUIRES_SHARED(Locks::mutator_lock_) {
+  // If the interface method is part of the public SDK, return it.
+  if ((hiddenapi::GetRuntimeFlags(interface_method) & kAccPublicApi) != 0) {
+    hiddenapi::ApiList api_list(hiddenapi::detail::GetDexFlags(interface_method));
+    // The kAccPublicApi flag is also used as an optimization to avoid
+    // other hiddenapi checks to always go on the slow path. Therefore, we
+    // need to check here if the method is in the SDK list.
+    if (api_list.IsSdkApi()) {
+      return true;
+    }
+  }
+  return false;
+}
+
 ArtMethod* Class::FindAccessibleInterfaceMethod(ArtMethod* implementation_method,
                                                 PointerSize pointer_size)
     REQUIRES_SHARED(Locks::mutator_lock_) {
   ObjPtr<mirror::IfTable> iftable = GetIfTable();
-  for (int32_t i = 0, iftable_count = iftable->Count(); i < iftable_count; ++i) {
-    ObjPtr<mirror::PointerArray> methods = iftable->GetMethodArrayOrNull(i);
-    if (methods == nullptr) {
-      continue;
+  if (IsInterface()) {  // Interface class doesn't resolve methods into the iftable.
+    for (int32_t i = 0, iftable_count = iftable->Count(); i < iftable_count; ++i) {
+      ObjPtr<mirror::Class> iface = iftable->GetInterface(i);
+      for (ArtMethod& interface_method : iface->GetVirtualMethodsSlice(pointer_size)) {
+        if (implementation_method->HasSameNameAndSignature(&interface_method) &&
+            IsInterfaceMethodAccessible(&interface_method)) {
+          return &interface_method;
+        }
+      }
     }
-    for (size_t j = 0, count = iftable->GetMethodArrayCount(i); j < count; ++j) {
-      if (implementation_method == methods->GetElementPtrSize<ArtMethod*>(j, pointer_size)) {
-        ObjPtr<mirror::Class> iface = iftable->GetInterface(i);
-        ArtMethod* interface_method = &iface->GetVirtualMethodsSlice(pointer_size)[j];
-        // If the interface method is part of the public SDK, return it.
-        if ((hiddenapi::GetRuntimeFlags(interface_method) & kAccPublicApi) != 0) {
-          hiddenapi::ApiList api_list(hiddenapi::detail::GetDexFlags(interface_method));
-          // The kAccPublicApi flag is also used as an optimization to avoid
-          // other hiddenapi checks to always go on the slow path. Therefore, we
-          // need to check here if the method is in the SDK list.
-          if (api_list.IsSdkApi()) {
+  } else {
+    for (int32_t i = 0, iftable_count = iftable->Count(); i < iftable_count; ++i) {
+      ObjPtr<mirror::PointerArray> methods = iftable->GetMethodArrayOrNull(i);
+      if (methods == nullptr) {
+        continue;
+      }
+      for (size_t j = 0, count = iftable->GetMethodArrayCount(i); j < count; ++j) {
+        if (implementation_method == methods->GetElementPtrSize<ArtMethod*>(j, pointer_size)) {
+          ObjPtr<mirror::Class> iface = iftable->GetInterface(i);
+          ArtMethod* interface_method = &iface->GetVirtualMethodsSlice(pointer_size)[j];
+          if (IsInterfaceMethodAccessible(interface_method)) {
             return interface_method;
           }
         }
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h
index a375616..b69086c 100644
--- a/runtime/mirror/class.h
+++ b/runtime/mirror/class.h
@@ -30,7 +30,7 @@
 #include "object_array.h"
 #include "read_barrier_option.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace dex {
 struct ClassDef;
@@ -76,13 +76,10 @@
 class Field;
 class IfTable;
 class Method;
-template <typename T> struct PACKED(8) DexCachePair;
-
-using StringDexCachePair = DexCachePair<String>;
-using StringDexCacheType = std::atomic<StringDexCachePair>;
+template <typename T> struct alignas(8) DexCachePair;
 
 // C++ mirror of java.lang.Class
-class MANAGED Class final : public Object {
+class EXPORT MANAGED Class final : public Object {
  public:
   MIRROR_CLASS("Ljava/lang/Class;");
 
@@ -580,7 +577,7 @@
   // The size of java.lang.Class.class.
   static uint32_t ClassClassSize(PointerSize pointer_size) {
     // The number of vtable entries in java.lang.Class.
-    uint32_t vtable_entries = Object::kVTableLength + 81;
+    uint32_t vtable_entries = Object::kVTableLength + 83;
     return ComputeClassSize(true, vtable_entries, 0, 0, 4, 1, 0, pointer_size);
   }
 
diff --git a/runtime/mirror/class_ext-inl.h b/runtime/mirror/class_ext-inl.h
index 9d6ac43..1fba26c 100644
--- a/runtime/mirror/class_ext-inl.h
+++ b/runtime/mirror/class_ext-inl.h
@@ -31,9 +31,8 @@
 #include "mirror/object.h"
 #include "object-inl.h"
 #include "verify_object.h"
-#include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 template <VerifyObjectFlags kVerifyFlags, ReadBarrierOption kReadBarrierOption>
diff --git a/runtime/mirror/class_ext.cc b/runtime/mirror/class_ext.cc
index 097e0de..4d915f7 100644
--- a/runtime/mirror/class_ext.cc
+++ b/runtime/mirror/class_ext.cc
@@ -33,7 +33,7 @@
 #include "stack_trace_element.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 uint32_t ClassExt::ClassSize(PointerSize pointer_size) {
diff --git a/runtime/mirror/class_ext.h b/runtime/mirror/class_ext.h
index b025eb2..302e172 100644
--- a/runtime/mirror/class_ext.h
+++ b/runtime/mirror/class_ext.h
@@ -18,13 +18,14 @@
 #define ART_RUNTIME_MIRROR_CLASS_EXT_H_
 
 #include "array.h"
+#include "base/macros.h"
 #include "class.h"
 #include "dex_cache.h"
 #include "object.h"
 #include "object_array.h"
 #include "string.h"
 
-namespace art {
+namespace art HIDDEN {
 
 struct ClassExtOffsets;
 class DexCacheVisitor;
@@ -104,29 +105,31 @@
 
   // Used to manually initialize the ext-ids arrays for the ClassExt associated
   // with the Class<ClassExt>. This simplifies the id allocation path.
-  void SetIdsArraysForClassExtExtData(ObjPtr<Object> marker) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void SetIdsArraysForClassExtExtData(ObjPtr<Object> marker)
+      REQUIRES_SHARED(Locks::mutator_lock_);
 
-  void SetOriginalDexFile(ObjPtr<Object> bytes) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void SetOriginalDexFile(ObjPtr<Object> bytes) REQUIRES_SHARED(Locks::mutator_lock_);
 
   uint16_t GetPreRedefineClassDefIndex() REQUIRES_SHARED(Locks::mutator_lock_) {
     return static_cast<uint16_t>(
         GetField32(OFFSET_OF_OBJECT_MEMBER(ClassExt, pre_redefine_class_def_index_)));
   }
 
-  void SetPreRedefineClassDefIndex(uint16_t index) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void SetPreRedefineClassDefIndex(uint16_t index) REQUIRES_SHARED(Locks::mutator_lock_);
 
   const DexFile* GetPreRedefineDexFile() REQUIRES_SHARED(Locks::mutator_lock_) {
     return reinterpret_cast<const DexFile*>(static_cast<uintptr_t>(
         GetField64(OFFSET_OF_OBJECT_MEMBER(ClassExt, pre_redefine_dex_file_ptr_))));
   }
 
-  void SetPreRedefineDexFile(const DexFile* dex_file) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void SetPreRedefineDexFile(const DexFile* dex_file) REQUIRES_SHARED(Locks::mutator_lock_);
 
-  void SetObsoleteArrays(ObjPtr<PointerArray> methods, ObjPtr<ObjectArray<DexCache>> dex_caches)
+  EXPORT void SetObsoleteArrays(ObjPtr<PointerArray> methods,
+                                ObjPtr<ObjectArray<DexCache>> dex_caches)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Extend the obsolete arrays by the given amount.
-  static bool ExtendObsoleteArrays(Handle<ClassExt> h_this, Thread* self, uint32_t increase)
+  EXPORT static bool ExtendObsoleteArrays(Handle<ClassExt> h_this, Thread* self, uint32_t increase)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   template<ReadBarrierOption kReadBarrierOption = kWithReadBarrier,
@@ -156,7 +159,7 @@
   template<VerifyObjectFlags kVerifyFlags = kDefaultVerifyFlags,
            ReadBarrierOption kReadBarrierOption = kWithReadBarrier>
   ObjPtr<Class> GetObsoleteClass() REQUIRES_SHARED(Locks::mutator_lock_);
-  void SetObsoleteClass(ObjPtr<Class> classes) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void SetObsoleteClass(ObjPtr<Class> classes) REQUIRES_SHARED(Locks::mutator_lock_);
 
   template<ReadBarrierOption kReadBarrierOption = kWithReadBarrier, typename Visitor>
   inline void VisitJFieldIDs(Visitor v) REQUIRES_SHARED(Locks::mutator_lock_);
diff --git a/runtime/mirror/class_flags.h b/runtime/mirror/class_flags.h
index c85b9e0..26a87c9 100644
--- a/runtime/mirror/class_flags.h
+++ b/runtime/mirror/class_flags.h
@@ -19,7 +19,9 @@
 
 #include <stdint.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 namespace mirror {
 
 // Normal instance with at least one ref field other than the class.
diff --git a/runtime/mirror/class_loader-inl.h b/runtime/mirror/class_loader-inl.h
index 1c98e0a..00dfdc7 100644
--- a/runtime/mirror/class_loader-inl.h
+++ b/runtime/mirror/class_loader-inl.h
@@ -22,7 +22,7 @@
 #include "class_table-inl.h"
 #include "object-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 inline ObjPtr<ClassLoader> ClassLoader::GetParent() {
diff --git a/runtime/mirror/class_loader.h b/runtime/mirror/class_loader.h
index 197172c..0e925f4 100644
--- a/runtime/mirror/class_loader.h
+++ b/runtime/mirror/class_loader.h
@@ -18,11 +18,13 @@
 #define ART_RUNTIME_MIRROR_CLASS_LOADER_H_
 
 #include "base/locks.h"
+#include "base/macros.h"
 #include "obj_ptr.h"
 #include "object.h"
 #include "object_reference.h"
+#include "string.h"
 
-namespace art {
+namespace art HIDDEN {
 
 struct ClassLoaderOffsets;
 class ClassTable;
@@ -77,11 +79,10 @@
       REQUIRES(!Locks::classlinker_classes_lock_);
 
   // Field order required by test "ValidateFieldOrderOfJavaCppUnionClasses".
+  HeapReference<String> name_;
   HeapReference<Object> packages_;
   HeapReference<ClassLoader> parent_;
   HeapReference<Object> proxyCache_;
-  // Native pointer to class table, need to zero this out when image writing.
-  uint32_t padding_ ATTRIBUTE_UNUSED;
   uint64_t allocator_;
   uint64_t class_table_;
 
diff --git a/runtime/mirror/dex_cache-inl.h b/runtime/mirror/dex_cache-inl.h
index 8b8eecc..48a41e6 100644
--- a/runtime/mirror/dex_cache-inl.h
+++ b/runtime/mirror/dex_cache-inl.h
@@ -40,7 +40,7 @@
 
 #include <atomic>
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 template<typename DexCachePair>
@@ -110,8 +110,8 @@
   first_elem.object = nullptr;
   first_elem.index = InvalidIndexForSlot(0);
 
-  auto* array = reinterpret_cast<std::atomic<AtomicPair<uintptr_t>>*>(dex_cache);
-  AtomicPair<uintptr_t> v(reinterpret_cast<size_t>(first_elem.object), first_elem.index);
+  auto* array = reinterpret_cast<AtomicPair<uintptr_t>*>(dex_cache);
+  AtomicPair<uintptr_t> v(first_elem.index, reinterpret_cast<size_t>(first_elem.object));
   AtomicPairStoreRelease(&array[0], v);
 }
 
diff --git a/runtime/mirror/dex_cache.cc b/runtime/mirror/dex_cache.cc
index d3f474e..b981f08 100644
--- a/runtime/mirror/dex_cache.cc
+++ b/runtime/mirror/dex_cache.cc
@@ -22,7 +22,7 @@
 #include "gc/heap.h"
 #include "jit/profile_saver.h"
 #include "linear_alloc.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 #include "object-inl.h"
 #include "object.h"
 #include "object_array-inl.h"
@@ -33,7 +33,7 @@
 #include "thread.h"
 #include "write_barrier.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 // Whether to allocate full dex cache arrays during startup. Currently disabled
diff --git a/runtime/mirror/dex_cache.h b/runtime/mirror/dex_cache.h
index 20e3e6c..d934647 100644
--- a/runtime/mirror/dex_cache.h
+++ b/runtime/mirror/dex_cache.h
@@ -22,6 +22,7 @@
 #include "base/atomic_pair.h"
 #include "base/bit_utils.h"
 #include "base/locks.h"
+#include "base/macros.h"
 #include "dex/dex_file.h"
 #include "dex/dex_file_types.h"
 #include "gc_root.h"  // Note: must not use -inl here to avoid circular dependency.
@@ -29,7 +30,7 @@
 #include "object.h"
 #include "object_array.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace linker {
 class ImageWriter;
@@ -52,7 +53,7 @@
 class MethodType;
 class String;
 
-template <typename T> struct PACKED(8) DexCachePair {
+template <typename T> struct alignas(8) DexCachePair {
   GcRoot<T> object;
   uint32_t index;
   // The array is initially [ {0,0}, {0,0}, {0,0} ... ]
@@ -89,7 +90,7 @@
   T* GetObjectForIndex(uint32_t idx) REQUIRES_SHARED(Locks::mutator_lock_);
 };
 
-template <typename T> struct PACKED(2 * __SIZEOF_POINTER__) NativeDexCachePair {
+template <typename T> struct alignas(2 * __SIZEOF_POINTER__) NativeDexCachePair {
   T* object;
   size_t index;
   // This is similar to DexCachePair except that we're storing a native pointer
@@ -142,16 +143,16 @@
 
  private:
   NativeDexCachePair<T> GetNativePair(std::atomic<NativeDexCachePair<T>>* pair_array, size_t idx) {
-    auto* array = reinterpret_cast<std::atomic<AtomicPair<uintptr_t>>*>(pair_array);
+    auto* array = reinterpret_cast<AtomicPair<uintptr_t>*>(pair_array);
     AtomicPair<uintptr_t> value = AtomicPairLoadAcquire(&array[idx]);
-    return NativeDexCachePair<T>(reinterpret_cast<T*>(value.first), value.second);
+    return NativeDexCachePair<T>(reinterpret_cast<T*>(value.val), value.key);
   }
 
   void SetNativePair(std::atomic<NativeDexCachePair<T>>* pair_array,
                      size_t idx,
                      NativeDexCachePair<T> pair) {
-    auto* array = reinterpret_cast<std::atomic<AtomicPair<uintptr_t>>*>(pair_array);
-    AtomicPair<uintptr_t> v(reinterpret_cast<size_t>(pair.object), pair.index);
+    auto* array = reinterpret_cast<AtomicPair<uintptr_t>*>(pair_array);
+    AtomicPair<uintptr_t> v(pair.index, reinterpret_cast<size_t>(pair.object));
     AtomicPairStoreRelease(&array[idx], v);
   }
 
@@ -300,13 +301,12 @@
                                      DexCachePair<Object>* pairs_end)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  void Initialize(const DexFile* dex_file, ObjPtr<ClassLoader> class_loader)
-      REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(Locks::dex_lock_);
+  EXPORT void Initialize(const DexFile* dex_file, ObjPtr<ClassLoader> class_loader)
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::dex_lock_);
 
   // Zero all array references.
   // WARNING: This does not free the memory since it is in LinearAlloc.
-  void ResetNativeArrays() REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void ResetNativeArrays() REQUIRES_SHARED(Locks::mutator_lock_);
 
   template<VerifyObjectFlags kVerifyFlags = kDefaultVerifyFlags,
            ReadBarrierOption kReadBarrierOption = kWithReadBarrier>
@@ -368,7 +368,7 @@
     SetFieldPtr<false>(OFFSET_OF_OBJECT_MEMBER(DexCache, dex_file_), dex_file);
   }
 
-  void SetLocation(ObjPtr<String> location) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void SetLocation(ObjPtr<String> location) REQUIRES_SHARED(Locks::mutator_lock_);
 
   void VisitReflectiveTargets(ReflectiveValueVisitor* visitor) REQUIRES(Locks::mutator_lock_);
 
diff --git a/runtime/mirror/dex_cache_test.cc b/runtime/mirror/dex_cache_test.cc
index bc521f5..9ca8d30 100644
--- a/runtime/mirror/dex_cache_test.cc
+++ b/runtime/mirror/dex_cache_test.cc
@@ -27,7 +27,7 @@
 #include "mirror/dex_cache-inl.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 class DexCacheTest : public CommonRuntimeTest {
diff --git a/runtime/mirror/emulated_stack_frame-inl.h b/runtime/mirror/emulated_stack_frame-inl.h
index 8dc4c70..58c1064 100644
--- a/runtime/mirror/emulated_stack_frame-inl.h
+++ b/runtime/mirror/emulated_stack_frame-inl.h
@@ -23,7 +23,7 @@
 #include "object-inl.h"
 #include "object_array-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 inline ObjPtr<mirror::MethodType> EmulatedStackFrame::GetType() {
diff --git a/runtime/mirror/emulated_stack_frame.cc b/runtime/mirror/emulated_stack_frame.cc
index 4bae657..a4fde72 100644
--- a/runtime/mirror/emulated_stack_frame.cc
+++ b/runtime/mirror/emulated_stack_frame.cc
@@ -29,7 +29,7 @@
 #include "object_array-inl.h"
 #include "reflection-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 // Calculates the size of a stack frame based on the size of its argument
diff --git a/runtime/mirror/emulated_stack_frame.h b/runtime/mirror/emulated_stack_frame.h
index 590f653..93c543c 100644
--- a/runtime/mirror/emulated_stack_frame.h
+++ b/runtime/mirror/emulated_stack_frame.h
@@ -18,12 +18,13 @@
 #define ART_RUNTIME_MIRROR_EMULATED_STACK_FRAME_H_
 
 #include "base/utils.h"
+#include "base/macros.h"
 #include "dex/dex_instruction.h"
 #include "handle.h"
 #include "object.h"
 #include "stack.h"
 
-namespace art {
+namespace art HIDDEN {
 
 struct EmulatedStackFrameOffsets;
 
diff --git a/runtime/mirror/executable-inl.h b/runtime/mirror/executable-inl.h
index 77669da..fa4fa64 100644
--- a/runtime/mirror/executable-inl.h
+++ b/runtime/mirror/executable-inl.h
@@ -23,7 +23,7 @@
 #include "reflective_value_visitor.h"
 #include "verify_object.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 template <bool kTransactionActive,
diff --git a/runtime/mirror/executable.cc b/runtime/mirror/executable.cc
index 3996f49..96b633a 100644
--- a/runtime/mirror/executable.cc
+++ b/runtime/mirror/executable.cc
@@ -19,7 +19,7 @@
 #include "art_method-inl.h"
 #include "object-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 template <PointerSize kPointerSize>
diff --git a/runtime/mirror/executable.h b/runtime/mirror/executable.h
index dc4ec95..241fea3 100644
--- a/runtime/mirror/executable.h
+++ b/runtime/mirror/executable.h
@@ -18,10 +18,11 @@
 #define ART_RUNTIME_MIRROR_EXECUTABLE_H_
 
 #include "accessible_object.h"
+#include "base/macros.h"
 #include "object.h"
 #include "read_barrier_option.h"
 
-namespace art {
+namespace art HIDDEN {
 
 struct ExecutableOffsets;
 class ArtMethod;
@@ -64,7 +65,7 @@
   uint8_t has_real_parameter_data_;
 
   // Padding required for matching alignment with the Java peer.
-  uint8_t padding_[2] ATTRIBUTE_UNUSED;
+  [[maybe_unused]] uint8_t padding_[2];
 
   HeapReference<mirror::Class> declaring_class_;
   HeapReference<mirror::Class> declaring_class_of_overridden_method_;
diff --git a/runtime/mirror/field-inl.h b/runtime/mirror/field-inl.h
index f1f8b25..d47e8c6 100644
--- a/runtime/mirror/field-inl.h
+++ b/runtime/mirror/field-inl.h
@@ -24,7 +24,7 @@
 #include "class_root-inl.h"
 #include "object-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 
diff --git a/runtime/mirror/field.cc b/runtime/mirror/field.cc
index 7faa55c..5ad59fa 100644
--- a/runtime/mirror/field.cc
+++ b/runtime/mirror/field.cc
@@ -22,7 +22,7 @@
 #include "object_array-inl.h"
 #include "write_barrier.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 void Field::VisitTarget(ReflectiveValueVisitor* v) {
diff --git a/runtime/mirror/field.h b/runtime/mirror/field.h
index bbae8ce..dc5e911 100644
--- a/runtime/mirror/field.h
+++ b/runtime/mirror/field.h
@@ -19,13 +19,14 @@
 
 #include "accessible_object.h"
 #include "base/enums.h"
+#include "base/macros.h"
 #include "dex/modifiers.h"
 #include "dex/primitive.h"
 #include "obj_ptr.h"
 #include "object.h"
 #include "read_barrier_option.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtField;
 struct FieldOffsets;
diff --git a/runtime/mirror/iftable-inl.h b/runtime/mirror/iftable-inl.h
index ce9d3f8..631f74f 100644
--- a/runtime/mirror/iftable-inl.h
+++ b/runtime/mirror/iftable-inl.h
@@ -21,7 +21,7 @@
 #include "obj_ptr-inl.h"
 #include "object_array-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 template<VerifyObjectFlags kVerifyFlags,
diff --git a/runtime/mirror/iftable.h b/runtime/mirror/iftable.h
index 30fed56..09fdea8 100644
--- a/runtime/mirror/iftable.h
+++ b/runtime/mirror/iftable.h
@@ -18,9 +18,10 @@
 #define ART_RUNTIME_MIRROR_IFTABLE_H_
 
 #include "base/casts.h"
+#include "base/macros.h"
 #include "object_array.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 class MANAGED IfTable final : public ObjectArray<Object> {
diff --git a/runtime/mirror/method.cc b/runtime/mirror/method.cc
index f83f03c..2511941 100644
--- a/runtime/mirror/method.cc
+++ b/runtime/mirror/method.cc
@@ -22,7 +22,7 @@
 #include "mirror/object-inl.h"
 #include "obj_ptr-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 template <PointerSize kPointerSize>
diff --git a/runtime/mirror/method.h b/runtime/mirror/method.h
index 4b8dcff..e72ffc9 100644
--- a/runtime/mirror/method.h
+++ b/runtime/mirror/method.h
@@ -17,9 +17,10 @@
 #ifndef ART_RUNTIME_MIRROR_METHOD_H_
 #define ART_RUNTIME_MIRROR_METHOD_H_
 
+#include "base/macros.h"
 #include "executable.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template<class MirrorType> class ObjPtr;
 
diff --git a/runtime/mirror/method_handle_impl-inl.h b/runtime/mirror/method_handle_impl-inl.h
index 8c5e479..54ce8bd 100644
--- a/runtime/mirror/method_handle_impl-inl.h
+++ b/runtime/mirror/method_handle_impl-inl.h
@@ -22,7 +22,7 @@
 #include "art_method-inl.h"
 #include "object-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 inline MethodHandle::Kind MethodHandle::GetHandleKind() REQUIRES_SHARED(Locks::mutator_lock_) {
diff --git a/runtime/mirror/method_handle_impl.cc b/runtime/mirror/method_handle_impl.cc
index 79ed2b0..0a37f95 100644
--- a/runtime/mirror/method_handle_impl.cc
+++ b/runtime/mirror/method_handle_impl.cc
@@ -19,7 +19,7 @@
 #include "class-alloc-inl.h"
 #include "class_root-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 const char* MethodHandle::GetReturnTypeDescriptor(const char* invoke_method_name) {
diff --git a/runtime/mirror/method_handle_impl.h b/runtime/mirror/method_handle_impl.h
index ef354a9..ba1763a 100644
--- a/runtime/mirror/method_handle_impl.h
+++ b/runtime/mirror/method_handle_impl.h
@@ -19,12 +19,13 @@
 
 #include "art_field.h"
 #include "art_method.h"
+#include "base/macros.h"
 #include "class.h"
 #include "method_type.h"
 #include "obj_ptr.h"
 #include "object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 struct MethodHandleOffsets;
 struct MethodHandleImplOffsets;
@@ -117,10 +118,10 @@
  public:
   MIRROR_CLASS("Ljava/lang/invoke/MethodHandleImpl;");
 
-  static ObjPtr<mirror::MethodHandleImpl> Create(Thread* const self,
-                                                 uintptr_t art_field_or_method,
-                                                 MethodHandle::Kind kind,
-                                                 Handle<MethodType> method_type)
+  EXPORT static ObjPtr<mirror::MethodHandleImpl> Create(Thread* const self,
+                                                        uintptr_t art_field_or_method,
+                                                        MethodHandle::Kind kind,
+                                                        Handle<MethodType> method_type)
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
  private:
diff --git a/runtime/mirror/method_handles_lookup.cc b/runtime/mirror/method_handles_lookup.cc
index 62c35df..702588c 100644
--- a/runtime/mirror/method_handles_lookup.cc
+++ b/runtime/mirror/method_handles_lookup.cc
@@ -25,7 +25,7 @@
 #include "object-inl.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 ObjPtr<MethodHandlesLookup> MethodHandlesLookup::Create(Thread* const self,
diff --git a/runtime/mirror/method_handles_lookup.h b/runtime/mirror/method_handles_lookup.h
index 3ed150a..9ee9dbe 100644
--- a/runtime/mirror/method_handles_lookup.h
+++ b/runtime/mirror/method_handles_lookup.h
@@ -18,11 +18,12 @@
 #define ART_RUNTIME_MIRROR_METHOD_HANDLES_LOOKUP_H_
 
 #include "base/utils.h"
+#include "base/macros.h"
 #include "handle.h"
 #include "obj_ptr.h"
 #include "object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 struct MethodHandlesLookupOffsets;
 class RootVisitor;
diff --git a/runtime/mirror/method_type-inl.h b/runtime/mirror/method_type-inl.h
index 86b8099..d7b8647 100644
--- a/runtime/mirror/method_type-inl.h
+++ b/runtime/mirror/method_type-inl.h
@@ -19,11 +19,56 @@
 
 #include "method_type.h"
 
+#include "base/casts.h"
+#include "handle_scope-inl.h"
 #include "mirror/object-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
+inline RawMethodType::RawMethodType(VariableSizedHandleScope* hs)
+    : hs_(hs) {
+  DCHECK(hs != nullptr);
+}
+
+inline bool RawMethodType::IsValid() const {
+  return hs_->Size() != 0u;
+}
+
+inline void RawMethodType::SetRType(ObjPtr<mirror::Class> rtype) {
+  DCHECK(rtype != nullptr);
+  DCHECK_EQ(hs_->Size(), 0u);
+  hs_->NewHandle(rtype);
+  DCHECK_EQ(rtype, GetRType());
+}
+
+inline void RawMethodType::AddPType(ObjPtr<mirror::Class> ptype) {
+  DCHECK(ptype != nullptr);
+  DCHECK_NE(hs_->Size(), 0u);
+  hs_->NewHandle(ptype);
+  DCHECK_NE(GetNumberOfPTypes(), 0);
+  DCHECK_EQ(GetPType(GetNumberOfPTypes() - 1), ptype);
+}
+
+inline int32_t RawMethodType::GetNumberOfPTypes() const {
+  DCHECK_NE(hs_->Size(), 0u);
+  return dchecked_integral_cast<int32_t>(hs_->Size() - 1u);
+}
+
+inline ObjPtr<mirror::Class> RawMethodType::GetPType(int32_t i) const {
+  DCHECK_LT(i, GetNumberOfPTypes());
+  return hs_->GetHandle<mirror::Class>(i + 1).Get();
+}
+
+inline ObjPtr<mirror::Class> RawMethodType::GetRType() const {
+  return GetRTypeHandle().Get();
+}
+
+inline Handle<mirror::Class> RawMethodType::GetRTypeHandle() const {
+  DCHECK_NE(hs_->Size(), 0u);
+  return hs_->GetHandle<mirror::Class>(0u);
+}
+
 inline ObjPtr<ObjectArray<Class>> MethodType::GetPTypes() {
   return GetFieldObject<ObjectArray<Class>>(OFFSET_OF_OBJECT_MEMBER(MethodType, p_types_));
 }
@@ -36,6 +81,71 @@
   return GetFieldObject<Class>(OFFSET_OF_OBJECT_MEMBER(MethodType, r_type_));
 }
 
+template <typename PTypesType>
+inline MethodType::PTypesAccessor<PTypesType>::PTypesAccessor(PTypesType p_types)
+    : p_types_(p_types) {}
+
+template <typename PTypesType>
+inline int32_t MethodType::PTypesAccessor<PTypesType>::GetLength() const {
+  return p_types_->GetLength();
+}
+
+template <typename PTypesType>
+inline ObjPtr<mirror::Class> MethodType::PTypesAccessor<PTypesType>::Get(int32_t i) const {
+  DCHECK_LT(i, GetLength());
+  return p_types_->GetWithoutChecks(i);
+}
+
+inline MethodType::RawPTypesAccessor::RawPTypesAccessor(RawMethodType method_type)
+    : method_type_(method_type) {
+  DCHECK(method_type.IsValid());
+}
+
+inline int32_t MethodType::RawPTypesAccessor::GetLength() const {
+  return method_type_.GetNumberOfPTypes();
+}
+
+inline ObjPtr<mirror::Class> MethodType::RawPTypesAccessor::Get(int32_t i) const {
+  return method_type_.GetPType(i);
+}
+
+template <typename HandleScopeType>
+inline MethodType::HandlePTypesAccessor MethodType::NewHandlePTypes(
+    Handle<MethodType> method_type, HandleScopeType* hs) {
+  Handle<ObjectArray<mirror::Class>> p_types = hs->NewHandle(method_type->GetPTypes());
+  return HandlePTypesAccessor(p_types);
+}
+
+template <typename HandleScopeType>
+inline MethodType::RawPTypesAccessor MethodType::NewHandlePTypes(
+    RawMethodType method_type, [[maybe_unused]] HandleScopeType* hs) {
+  return RawPTypesAccessor(method_type);
+}
+
+inline MethodType::ObjPtrPTypesAccessor MethodType::GetPTypes(ObjPtr<MethodType> method_type) {
+  return ObjPtrPTypesAccessor(method_type->GetPTypes());
+}
+
+inline MethodType::ObjPtrPTypesAccessor MethodType::GetPTypes(Handle<MethodType> method_type) {
+  return GetPTypes(method_type.Get());
+}
+
+inline MethodType::RawPTypesAccessor MethodType::GetPTypes(RawMethodType method_type) {
+  return RawPTypesAccessor(method_type);
+}
+
+inline ObjPtr<mirror::Class> MethodType::GetRType(ObjPtr<MethodType> method_type) {
+  return method_type->GetRType();
+}
+
+inline ObjPtr<mirror::Class> MethodType::GetRType(Handle<MethodType> method_type) {
+  return GetRType(method_type.Get());
+}
+
+inline ObjPtr<mirror::Class> MethodType::GetRType(RawMethodType method_type) {
+  return method_type.GetRType();
+}
+
 }  // namespace mirror
 }  // namespace art
 
diff --git a/runtime/mirror/method_type.cc b/runtime/mirror/method_type.cc
index ccc2b9d..a3785c1 100644
--- a/runtime/mirror/method_type.cc
+++ b/runtime/mirror/method_type.cc
@@ -18,12 +18,14 @@
 
 #include "class-alloc-inl.h"
 #include "class_root-inl.h"
+#include "handle_scope-inl.h"
 #include "method_handles.h"
 #include "obj_ptr-inl.h"
 #include "object_array-alloc-inl.h"
 #include "object_array-inl.h"
+#include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 namespace {
@@ -36,35 +38,45 @@
 
 }  // namespace
 
-ObjPtr<MethodType> MethodType::Create(Thread* const self,
+ObjPtr<MethodType> MethodType::Create(Thread* self,
                                       Handle<Class> return_type,
                                       Handle<ObjectArray<Class>> parameter_types) {
-  StackHandleScope<1> hs(self);
-  Handle<MethodType> mt(
-      hs.NewHandle(ObjPtr<MethodType>::DownCast(GetClassRoot<MethodType>()->AllocObject(self))));
+  ArtMethod* make_impl = WellKnownClasses::java_lang_invoke_MethodType_makeImpl;
 
-  if (mt == nullptr) {
-    self->AssertPendingOOMException();
+  const bool is_trusted = true;
+  ObjPtr<MethodType> mt = ObjPtr<MethodType>::DownCast(make_impl->InvokeStatic<'L', 'L', 'L', 'Z'>(
+      self, return_type.Get(), parameter_types.Get(), is_trusted));
+
+  if (self->IsExceptionPending()) {
     return nullptr;
   }
 
-  // We're initializing a newly allocated object, so we do not need to record that under
-  // a transaction. If the transaction is aborted, the whole object shall be unreachable.
-  mt->SetFieldObject</*kTransactionActive=*/ false, /*kCheckTransaction=*/ false>(
-      FormOffset(), nullptr);
-  mt->SetFieldObject</*kTransactionActive=*/ false, /*kCheckTransaction=*/ false>(
-      MethodDescriptorOffset(), nullptr);
-  mt->SetFieldObject</*kTransactionActive=*/ false, /*kCheckTransaction=*/ false>(
-      RTypeOffset(), return_type.Get());
-  mt->SetFieldObject</*kTransactionActive=*/ false, /*kCheckTransaction=*/ false>(
-      PTypesOffset(), parameter_types.Get());
-  mt->SetFieldObject</*kTransactionActive=*/ false, /*kCheckTransaction=*/ false>(
-      WrapAltOffset(), nullptr);
-
-  return mt.Get();
+  return mt;
 }
 
-ObjPtr<MethodType> MethodType::CloneWithoutLeadingParameter(Thread* const self,
+ObjPtr<MethodType> MethodType::Create(Thread* self, RawMethodType method_type) {
+  Handle<mirror::Class> return_type = method_type.GetRTypeHandle();
+  RawPTypesAccessor p_types(method_type);
+  int32_t num_method_args = p_types.GetLength();
+
+  // Create the argument types array.
+  StackHandleScope<1u> hs(self);
+  Handle<mirror::ObjectArray<mirror::Class>> method_params = hs.NewHandle(
+      mirror::ObjectArray<mirror::Class>::Alloc(
+          self, GetClassRoot<mirror::ObjectArray<mirror::Class>>(), num_method_args));
+  if (method_params == nullptr) {
+    DCHECK(self->IsExceptionPending());
+    return nullptr;
+  }
+
+  for (int32_t i = 0; i != num_method_args; ++i) {
+    method_params->Set(i, p_types.Get(i));
+  }
+
+  return Create(self, return_type, method_params);
+}
+
+ObjPtr<MethodType> MethodType::CloneWithoutLeadingParameter(Thread* self,
                                                             ObjPtr<MethodType> method_type) {
   StackHandleScope<3> hs(self);
   Handle<ObjectArray<Class>> src_ptypes = hs.NewHandle(method_type->GetPTypes());
@@ -104,15 +116,16 @@
   return Create(self, dst_rtype, dst_ptypes);
 }
 
-size_t MethodType::NumberOfVRegs() {
-  const ObjPtr<ObjectArray<Class>> p_types = GetPTypes();
-  const int32_t p_types_length = p_types->GetLength();
+template <typename MethodTypeType>
+size_t NumberOfVRegsImpl(MethodTypeType method_type) REQUIRES_SHARED(Locks::mutator_lock_) {
+  auto p_types = MethodType::GetPTypes(method_type);
+  const int32_t p_types_length = p_types.GetLength();
 
   // Initialize |num_vregs| with number of parameters and only increment it for
   // types requiring a second vreg.
   size_t num_vregs = static_cast<size_t>(p_types_length);
   for (int32_t i = 0; i < p_types_length; ++i) {
-    ObjPtr<Class> klass = p_types->GetWithoutChecks(i);
+    ObjPtr<Class> klass = p_types.Get(i);
     if (klass->IsPrimitiveLong() || klass->IsPrimitiveDouble()) {
       ++num_vregs;
     }
@@ -120,6 +133,24 @@
   return num_vregs;
 }
 
+size_t MethodType::NumberOfVRegs() {
+  return NumberOfVRegs(this);
+}
+
+size_t MethodType::NumberOfVRegs(ObjPtr<mirror::MethodType> method_type) {
+  DCHECK(method_type != nullptr);
+  return NumberOfVRegsImpl(method_type);
+}
+
+size_t MethodType::NumberOfVRegs(Handle<mirror::MethodType> method_type) {
+  return NumberOfVRegs(method_type.Get());
+}
+
+size_t MethodType::NumberOfVRegs(RawMethodType method_type) {
+  DCHECK(method_type.IsValid());
+  return NumberOfVRegsImpl(method_type);
+}
+
 bool MethodType::IsExactMatch(ObjPtr<MethodType> target) {
   const ObjPtr<ObjectArray<Class>> p_types = GetPTypes();
   const int32_t params_length = p_types->GetLength();
@@ -212,24 +243,46 @@
          IsParameterInPlaceConvertible(target->GetRType(), GetRType());
 }
 
-std::string MethodType::PrettyDescriptor() {
+template <typename MethodTypeType>
+std::string PrettyDescriptorImpl(MethodTypeType method_type)
+    REQUIRES_SHARED(Locks::mutator_lock_) {
+  auto p_types = MethodType::GetPTypes(method_type);
+  ObjPtr<mirror::Class> r_type = MethodType::GetRType(method_type);
+
   std::ostringstream ss;
   ss << "(";
 
-  const ObjPtr<ObjectArray<Class>> p_types = GetPTypes();
-  const int32_t params_length = p_types->GetLength();
+  const int32_t params_length = p_types.GetLength();
   for (int32_t i = 0; i < params_length; ++i) {
-    ss << p_types->GetWithoutChecks(i)->PrettyDescriptor();
+    ss << p_types.Get(i)->PrettyDescriptor();
     if (i != (params_length - 1)) {
       ss << ", ";
     }
   }
 
   ss << ")";
-  ss << GetRType()->PrettyDescriptor();
+  ss << r_type->PrettyDescriptor();
 
   return ss.str();
 }
 
+std::string MethodType::PrettyDescriptor() {
+  return PrettyDescriptor(this);
+}
+
+std::string MethodType::PrettyDescriptor(ObjPtr<mirror::MethodType> method_type) {
+  DCHECK(method_type != nullptr);
+  return PrettyDescriptorImpl(method_type);
+}
+
+std::string MethodType::PrettyDescriptor(Handle<MethodType> method_type) {
+  return PrettyDescriptor(method_type.Get());
+}
+
+std::string MethodType::PrettyDescriptor(RawMethodType method_type) {
+  DCHECK(method_type.IsValid());
+  return PrettyDescriptorImpl(method_type);
+}
+
 }  // namespace mirror
 }  // namespace art
diff --git a/runtime/mirror/method_type.h b/runtime/mirror/method_type.h
index 19444bb..1efc0c5 100644
--- a/runtime/mirror/method_type.h
+++ b/runtime/mirror/method_type.h
@@ -17,33 +17,60 @@
 #ifndef ART_RUNTIME_MIRROR_METHOD_TYPE_H_
 #define ART_RUNTIME_MIRROR_METHOD_TYPE_H_
 
+#include "base/macros.h"
 #include "object_array.h"
 #include "object.h"
 #include "string.h"
 
-namespace art {
+namespace art HIDDEN {
 
 struct MethodTypeOffsets;
+class VariableSizedHandleScope;
 
 namespace mirror {
 
+// We use a wrapped `VariableSizedHandleScope` as a raw method type without allocating a managed
+// object.  It must contain the return type followed by argument types and no other handles.
+// The data is filled by calling `SetRType()` followed by `AddPType()` for each argument.
+class RawMethodType {
+ public:
+  explicit RawMethodType(VariableSizedHandleScope* hs);
+
+  bool IsValid() const;
+
+  void SetRType(ObjPtr<mirror::Class> rtype) REQUIRES_SHARED(Locks::mutator_lock_);
+  void AddPType(ObjPtr<mirror::Class> ptype) REQUIRES_SHARED(Locks::mutator_lock_);
+
+  int32_t GetNumberOfPTypes() const REQUIRES_SHARED(Locks::mutator_lock_);
+  ObjPtr<mirror::Class> GetPType(int32_t i) const REQUIRES_SHARED(Locks::mutator_lock_);
+  ObjPtr<mirror::Class> GetRType() const REQUIRES_SHARED(Locks::mutator_lock_);
+  Handle<mirror::Class> GetRTypeHandle() const REQUIRES_SHARED(Locks::mutator_lock_);
+
+ private:
+  VariableSizedHandleScope* hs_;
+};
+
 // C++ mirror of java.lang.invoke.MethodType
 class MANAGED MethodType : public Object {
  public:
   MIRROR_CLASS("Ljava/lang/invoke/MethodType;");
 
-  static ObjPtr<MethodType> Create(Thread* const self,
-                                   Handle<Class> return_type,
-                                   Handle<ObjectArray<Class>> param_types)
+  EXPORT static ObjPtr<MethodType> Create(Thread* self,
+                                          Handle<Class> return_type,
+                                          Handle<ObjectArray<Class>> param_types)
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
-  static ObjPtr<MethodType> CloneWithoutLeadingParameter(Thread* const self,
+  // Create a `MethodType` from a `RawMethodType`.
+  static ObjPtr<MethodType> Create(Thread* self, RawMethodType method_type)
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
+
+  static ObjPtr<MethodType> CloneWithoutLeadingParameter(Thread* self,
                                                          ObjPtr<MethodType> method_type)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Collects trailing parameter types into an array. Assumes caller
   // has checked trailing arguments are all of the same type.
-  static ObjPtr<MethodType> CollectTrailingArguments(Thread* const self,
+  static ObjPtr<MethodType> CollectTrailingArguments(Thread* self,
                                                      ObjPtr<MethodType> method_type,
                                                      ObjPtr<Class> collector_array_class,
                                                      int32_t start_index)
@@ -76,6 +103,71 @@
   // exception messages and the like.
   std::string PrettyDescriptor() REQUIRES_SHARED(Locks::mutator_lock_);
 
+  // The `PTypesType` is either `ObjPtr<>` or `Handle<>`.
+  template <typename PTypesType>
+  class PTypesAccessor {
+   public:
+    explicit PTypesAccessor(PTypesType p_types) REQUIRES_SHARED(Locks::mutator_lock_);
+
+    int32_t GetLength() const REQUIRES_SHARED(Locks::mutator_lock_);
+    ObjPtr<mirror::Class> Get(int32_t i) const REQUIRES_SHARED(Locks::mutator_lock_);
+
+   private:
+    static_assert(std::is_same_v<PTypesType, ObjPtr<ObjectArray<Class>>> ||
+                  std::is_same_v<PTypesType, Handle<ObjectArray<Class>>>);
+
+    const PTypesType p_types_;
+  };
+
+  using ObjPtrPTypesAccessor = PTypesAccessor<ObjPtr<ObjectArray<Class>>>;
+  using HandlePTypesAccessor = PTypesAccessor<Handle<ObjectArray<Class>>>;
+
+  class RawPTypesAccessor {
+   public:
+    explicit RawPTypesAccessor(RawMethodType method_type);
+
+    int32_t GetLength() const REQUIRES_SHARED(Locks::mutator_lock_);
+    ObjPtr<mirror::Class> Get(int32_t i) const REQUIRES_SHARED(Locks::mutator_lock_);
+
+   private:
+    RawMethodType method_type_;
+  };
+
+  template <typename HandleScopeType>
+  static HandlePTypesAccessor NewHandlePTypes(Handle<MethodType> method_type, HandleScopeType* hs)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+  template <typename HandleScopeType>
+  static RawPTypesAccessor NewHandlePTypes(RawMethodType method_type, HandleScopeType* hs)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+
+  static ObjPtrPTypesAccessor GetPTypes(ObjPtr<MethodType> method_type)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+  static ObjPtrPTypesAccessor GetPTypes(Handle<MethodType> method_type)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+  static RawPTypesAccessor GetPTypes(RawMethodType method_type)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+
+  static ObjPtr<mirror::Class> GetRType(ObjPtr<MethodType> method_type)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+  static ObjPtr<mirror::Class> GetRType(Handle<MethodType> method_type)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+  static ObjPtr<mirror::Class> GetRType(RawMethodType method_type)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+
+  static size_t NumberOfVRegs(ObjPtr<mirror::MethodType> method_type)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+  static size_t NumberOfVRegs(Handle<mirror::MethodType> method_type)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+  static size_t NumberOfVRegs(RawMethodType method_type)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+
+  static std::string PrettyDescriptor(ObjPtr<MethodType> method_type)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+  static std::string PrettyDescriptor(Handle<MethodType> method_type)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+  static std::string PrettyDescriptor(RawMethodType method_type)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+
  private:
   static MemberOffset FormOffset() {
     return MemberOffset(OFFSETOF_MEMBER(MethodType, form_));
diff --git a/runtime/mirror/method_type_test.cc b/runtime/mirror/method_type_test.cc
index c9d7e91..9d23f8f 100644
--- a/runtime/mirror/method_type_test.cc
+++ b/runtime/mirror/method_type_test.cc
@@ -29,7 +29,7 @@
 #include "object_array-inl.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 class MethodTypeTest : public CommonRuntimeTest {};
diff --git a/runtime/mirror/object-inl.h b/runtime/mirror/object-inl.h
index 318a811..60b8a05 100644
--- a/runtime/mirror/object-inl.h
+++ b/runtime/mirror/object-inl.h
@@ -41,7 +41,7 @@
 #include "throwable.h"
 #include "write_barrier-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 inline uint32_t Object::ClassSize(PointerSize pointer_size) {
diff --git a/runtime/mirror/object-readbarrier-inl.h b/runtime/mirror/object-readbarrier-inl.h
index 2895009..15179b9 100644
--- a/runtime/mirror/object-readbarrier-inl.h
+++ b/runtime/mirror/object-readbarrier-inl.h
@@ -26,7 +26,7 @@
 #include "read_barrier.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 template<VerifyObjectFlags kVerifyFlags>
diff --git a/runtime/mirror/object-refvisitor-inl.h b/runtime/mirror/object-refvisitor-inl.h
index de60c8e..d4f4749 100644
--- a/runtime/mirror/object-refvisitor-inl.h
+++ b/runtime/mirror/object-refvisitor-inl.h
@@ -23,7 +23,7 @@
 #include "class_loader-inl.h"
 #include "dex_cache-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 template <VerifyObjectFlags kVerifyFlags,
@@ -145,7 +145,6 @@
     VisitInstanceFieldsReferences<kVerifyFlags, kReadBarrierOption>(klass, visitor);
     size = kFetchObjSize ? klass->GetObjectSize<kSizeOfFlags>() : 0;
   } else if ((class_flags & kClassFlagNoReferenceFields) != 0) {
-    CheckNoReferenceField<kVerifyFlags, kReadBarrierOption>(klass);
     if ((class_flags & kClassFlagString) != 0) {
       size = kFetchObjSize ? static_cast<String*>(this)->SizeOf<kSizeOfFlags>() : 0;
     } else if (klass->IsArrayClass<kVerifyFlags>()) {
@@ -168,7 +167,6 @@
                                                                                    visitor);
     size = kFetchObjSize ? as_klass->SizeOf<kSizeOfFlags>() : 0;
   } else if (class_flags == kClassFlagObjectArray) {
-    DCHECK((klass->IsObjectArrayClass<kVerifyFlags, kReadBarrierOption>()));
     ObjPtr<ObjectArray<Object>> obj_arr = ObjPtr<ObjectArray<Object>>::DownCast(this);
     obj_arr->VisitReferences(visitor, begin, end);
     size = kFetchObjSize ?
diff --git a/runtime/mirror/object.cc b/runtime/mirror/object.cc
index 5016c20..b289786 100644
--- a/runtime/mirror/object.cc
+++ b/runtime/mirror/object.cc
@@ -38,7 +38,7 @@
 #include "throwable.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 Atomic<uint32_t> Object::hash_code_seed(987654321U + std::time(nullptr));
@@ -66,9 +66,9 @@
   }
 
   // Unused since we don't copy class native roots.
-  void VisitRootIfNonNull(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED)
-      const {}
-  void VisitRoot(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED) const {}
+  void VisitRootIfNonNull(
+      [[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {}
+  void VisitRoot([[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {}
 
  private:
   const ObjPtr<Object> dest_obj_;
@@ -144,7 +144,7 @@
   CopyObjectVisitor(Handle<Object>* orig, size_t num_bytes)
       : orig_(orig), num_bytes_(num_bytes) {}
 
-  void operator()(ObjPtr<Object> obj, size_t usable_size ATTRIBUTE_UNUSED) const
+  void operator()(ObjPtr<Object> obj, [[maybe_unused]] size_t usable_size) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     Object::CopyObject(obj, orig_->Get(), num_bytes_);
   }
@@ -185,7 +185,8 @@
   hash_code_seed.store(new_seed, std::memory_order_relaxed);
 }
 
-int32_t Object::IdentityHashCode() {
+template <bool kAllowInflation>
+int32_t Object::IdentityHashCodeHelper() {
   ObjPtr<Object> current_this = this;  // The this pointer may get invalidated by thread suspension.
   while (true) {
     LockWord lw = current_this->GetLockWord(false);
@@ -203,6 +204,9 @@
         break;
       }
       case LockWord::kThinLocked: {
+        if (!kAllowInflation) {
+          return 0;
+        }
         // Inflate the thin lock to a monitor and stick the hash code inside of the monitor. May
         // fail spuriously.
         Thread* self = Thread::Current();
@@ -230,6 +234,12 @@
   }
 }
 
+int32_t Object::IdentityHashCode() { return IdentityHashCodeHelper</* kAllowInflation= */ true>(); }
+
+int32_t Object::IdentityHashCodeNoInflation() {
+  return IdentityHashCodeHelper</* kAllowInflation= */ false>();
+}
+
 void Object::CheckFieldAssignmentImpl(MemberOffset field_offset, ObjPtr<Object> new_value) {
   ObjPtr<Class> c = GetClass();
   Runtime* runtime = Runtime::Current();
diff --git a/runtime/mirror/object.h b/runtime/mirror/object.h
index 54a17b1..f0b6a03 100644
--- a/runtime/mirror/object.h
+++ b/runtime/mirror/object.h
@@ -20,6 +20,7 @@
 #include "base/atomic.h"
 #include "base/casts.h"
 #include "base/enums.h"
+#include "base/macros.h"
 #include "dex/primitive.h"
 #include "obj_ptr.h"
 #include "object_reference.h"
@@ -29,7 +30,7 @@
 #include "runtime_globals.h"
 #include "verify_object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtField;
 class ArtMethod;
@@ -74,7 +75,7 @@
 static constexpr uint32_t kObjectHeaderSize = 8;
 
 // C++ mirror of java.lang.Object
-class MANAGED LOCKABLE Object {
+class EXPORT MANAGED LOCKABLE Object {
  public:
   MIRROR_CLASS("Ljava/lang/Object;");
 
@@ -138,11 +139,16 @@
       REQUIRES_SHARED(Locks::mutator_lock_)
       REQUIRES(!Roles::uninterruptible_);
 
+  // Returns a nonzero value that fits into lockword slot.
   int32_t IdentityHashCode()
       REQUIRES_SHARED(Locks::mutator_lock_)
       REQUIRES(!Locks::thread_list_lock_,
                !Locks::thread_suspend_count_lock_);
 
+  // Identical to the above, but returns 0 if monitor inflation would otherwise be needed.
+  int32_t IdentityHashCodeNoInflation() REQUIRES_SHARED(Locks::mutator_lock_)
+      REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_);
+
   static constexpr MemberOffset MonitorOffset() {
     return OFFSET_OF_OBJECT_MEMBER(Object, monitor_);
   }
@@ -727,6 +733,10 @@
       REQUIRES_SHARED(Locks::mutator_lock_);
 
  private:
+  template <bool kAllowInflation>
+  int32_t IdentityHashCodeHelper() REQUIRES_SHARED(Locks::mutator_lock_)
+      REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_);
+
   // Get a field with acquire semantics.
   template<typename kSize>
   ALWAYS_INLINE kSize GetFieldAcquire(MemberOffset field_offset)
diff --git a/runtime/mirror/object_array-alloc-inl.h b/runtime/mirror/object_array-alloc-inl.h
index 594b0a6..e79d154 100644
--- a/runtime/mirror/object_array-alloc-inl.h
+++ b/runtime/mirror/object_array-alloc-inl.h
@@ -29,7 +29,7 @@
 #include "object-inl.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 template<class T>
diff --git a/runtime/mirror/object_array-inl.h b/runtime/mirror/object_array-inl.h
index 87f24eb..b0ca6c2 100644
--- a/runtime/mirror/object_array-inl.h
+++ b/runtime/mirror/object_array-inl.h
@@ -33,7 +33,7 @@
 #include "thread-current-inl.h"
 #include "write_barrier-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 template<class T> template<VerifyObjectFlags kVerifyFlags, ReadBarrierOption kReadBarrierOption>
diff --git a/runtime/mirror/object_array.h b/runtime/mirror/object_array.h
index 9a53708..de12e65 100644
--- a/runtime/mirror/object_array.h
+++ b/runtime/mirror/object_array.h
@@ -20,9 +20,10 @@
 #include <iterator>
 #include "array.h"
 #include "base/iteration_range.h"
+#include "base/macros.h"
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 template<typename T, typename Container> class ArrayIter;
@@ -162,11 +163,17 @@
 // Everything is NO_THREAD_SAFETY_ANALYSIS to work-around STL incompat with thread-annotations.
 // Everything should have REQUIRES_SHARED(Locks::mutator_lock_).
 template <typename T, typename Container>
-class ArrayIter : public std::iterator<std::forward_iterator_tag, ObjPtr<T>> {
+class ArrayIter {
  private:
   using Iter = ArrayIter<T, Container>;
 
  public:
+  using iterator_category = std::forward_iterator_tag;
+  using value_type = ObjPtr<T>;
+  using difference_type = ptrdiff_t;
+  using pointer = value_type*;
+  using reference = value_type&;
+
   ArrayIter(Container array, int32_t idx) NO_THREAD_SAFETY_ANALYSIS : array_(array), idx_(idx) {
     CheckIdx();
   }
diff --git a/runtime/mirror/object_reference-inl.h b/runtime/mirror/object_reference-inl.h
index 183a5af..8f793b4 100644
--- a/runtime/mirror/object_reference-inl.h
+++ b/runtime/mirror/object_reference-inl.h
@@ -21,7 +21,7 @@
 
 #include "obj_ptr-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 template<bool kPoisonReferences, class MirrorType>
diff --git a/runtime/mirror/object_reference.h b/runtime/mirror/object_reference.h
index 251bcfd..177b968 100644
--- a/runtime/mirror/object_reference.h
+++ b/runtime/mirror/object_reference.h
@@ -23,11 +23,12 @@
 #include "base/atomic.h"
 #include "base/casts.h"
 #include "base/locks.h"  // For Locks::mutator_lock_.
+#include "base/macros.h"
 #include "heap_poisoning.h"
 #include "obj_ptr.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 class Object;
diff --git a/runtime/mirror/object_test.cc b/runtime/mirror/object_test.cc
index 6f42c5b..88b9924 100644
--- a/runtime/mirror/object_test.cc
+++ b/runtime/mirror/object_test.cc
@@ -45,7 +45,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "string-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 class ObjectTest : public CommonRuntimeTest {
diff --git a/runtime/mirror/proxy.h b/runtime/mirror/proxy.h
index 3291669..996c218 100644
--- a/runtime/mirror/proxy.h
+++ b/runtime/mirror/proxy.h
@@ -17,9 +17,10 @@
 #ifndef ART_RUNTIME_MIRROR_PROXY_H_
 #define ART_RUNTIME_MIRROR_PROXY_H_
 
+#include "base/macros.h"
 #include "object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 struct ProxyOffsets;
 
diff --git a/runtime/mirror/reference-inl.h b/runtime/mirror/reference-inl.h
index f8de6e6..c8a0957 100644
--- a/runtime/mirror/reference-inl.h
+++ b/runtime/mirror/reference-inl.h
@@ -22,7 +22,7 @@
 #include "obj_ptr-inl.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 inline uint32_t Reference::ClassSize(PointerSize pointer_size) {
diff --git a/runtime/mirror/reference.h b/runtime/mirror/reference.h
index ef6d273..9df0fb3 100644
--- a/runtime/mirror/reference.h
+++ b/runtime/mirror/reference.h
@@ -24,7 +24,7 @@
 #include "object.h"
 #include "read_barrier_option.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace gc {
 
diff --git a/runtime/mirror/stack_frame_info.cc b/runtime/mirror/stack_frame_info.cc
index dd3e8f7..f15783a 100644
--- a/runtime/mirror/stack_frame_info.cc
+++ b/runtime/mirror/stack_frame_info.cc
@@ -24,7 +24,7 @@
 #include "object-inl.h"
 #include "string.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 void StackFrameInfo::AssignFields(Handle<Class> declaring_class,
diff --git a/runtime/mirror/stack_frame_info.h b/runtime/mirror/stack_frame_info.h
index 24f8c8f..b9b1519 100644
--- a/runtime/mirror/stack_frame_info.h
+++ b/runtime/mirror/stack_frame_info.h
@@ -17,11 +17,12 @@
 #ifndef ART_RUNTIME_MIRROR_STACK_FRAME_INFO_H_
 #define ART_RUNTIME_MIRROR_STACK_FRAME_INFO_H_
 
+#include "base/macros.h"
 #include "method_type.h"
 #include "object.h"
 #include "stack_trace_element.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template<class T> class Handle;
 struct StackFrameInfoOffsets;
@@ -46,7 +47,7 @@
   HeapReference<Class> declaring_class_;
   HeapReference<String> file_name_;
   HeapReference<String> method_name_;
-  HeapReference<Class> method_type_;
+  HeapReference<MethodType> method_type_;
   HeapReference<StackTraceElement> ste_;
   int32_t bci_;
   int32_t line_number_;
diff --git a/runtime/mirror/stack_trace_element-inl.h b/runtime/mirror/stack_trace_element-inl.h
index 0ce6866..182793d 100644
--- a/runtime/mirror/stack_trace_element-inl.h
+++ b/runtime/mirror/stack_trace_element-inl.h
@@ -21,7 +21,7 @@
 
 #include "object-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 inline ObjPtr<String> StackTraceElement::GetDeclaringClass() {
diff --git a/runtime/mirror/stack_trace_element.cc b/runtime/mirror/stack_trace_element.cc
index 7fc6c09..180e0cd 100644
--- a/runtime/mirror/stack_trace_element.cc
+++ b/runtime/mirror/stack_trace_element.cc
@@ -24,7 +24,7 @@
 #include "object-inl.h"
 #include "string.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 ObjPtr<StackTraceElement> StackTraceElement::Alloc(Thread* self,
diff --git a/runtime/mirror/stack_trace_element.h b/runtime/mirror/stack_trace_element.h
index c07e63d..e203c3b 100644
--- a/runtime/mirror/stack_trace_element.h
+++ b/runtime/mirror/stack_trace_element.h
@@ -17,9 +17,10 @@
 #ifndef ART_RUNTIME_MIRROR_STACK_TRACE_ELEMENT_H_
 #define ART_RUNTIME_MIRROR_STACK_TRACE_ELEMENT_H_
 
+#include "base/macros.h"
 #include "object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template<class T> class Handle;
 struct StackTraceElementOffsets;
diff --git a/runtime/mirror/string-alloc-inl.h b/runtime/mirror/string-alloc-inl.h
index cb2dcb2..944dea0 100644
--- a/runtime/mirror/string-alloc-inl.h
+++ b/runtime/mirror/string-alloc-inl.h
@@ -32,7 +32,7 @@
 #include "runtime_globals.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 // Sets string count in the allocation code path to ensure it is guarded by a CAS.
@@ -41,7 +41,7 @@
   explicit SetStringCountVisitor(int32_t count) : count_(count) {
   }
 
-  void operator()(ObjPtr<Object> obj, size_t usable_size ATTRIBUTE_UNUSED) const
+  void operator()(ObjPtr<Object> obj, [[maybe_unused]] size_t usable_size) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     // Avoid AsString as object is not yet in live bitmap or allocation stack.
     ObjPtr<String> string = ObjPtr<String>::DownCast(obj);
@@ -61,7 +61,7 @@
       : count_(count), src_array_(src_array), offset_(offset), high_byte_(high_byte) {
   }
 
-  void operator()(ObjPtr<Object> obj, size_t usable_size ATTRIBUTE_UNUSED) const
+  void operator()(ObjPtr<Object> obj, [[maybe_unused]] size_t usable_size) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     // Avoid AsString as object is not yet in live bitmap or allocation stack.
     ObjPtr<String> string = ObjPtr<String>::DownCast(obj);
@@ -96,7 +96,7 @@
       : count_(count), src_array_(src_array), offset_(offset) {
   }
 
-  void operator()(ObjPtr<Object> obj, size_t usable_size ATTRIBUTE_UNUSED) const
+  void operator()(ObjPtr<Object> obj, [[maybe_unused]] size_t usable_size) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     // Avoid AsString as object is not yet in live bitmap or allocation stack.
     ObjPtr<String> string = ObjPtr<String>::DownCast(obj);
@@ -132,7 +132,7 @@
     count_(count), src_array_(src_array), offset_(offset) {
   }
 
-  void operator()(ObjPtr<Object> obj, size_t usable_size ATTRIBUTE_UNUSED) const
+  void operator()(ObjPtr<Object> obj, [[maybe_unused]] size_t usable_size) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     // Avoid AsString as object is not yet in live bitmap or allocation stack.
     ObjPtr<String> string = ObjPtr<String>::DownCast(obj);
@@ -163,7 +163,7 @@
     count_(count), src_string_(src_string), offset_(offset) {
   }
 
-  void operator()(ObjPtr<Object> obj, size_t usable_size ATTRIBUTE_UNUSED) const
+  void operator()(ObjPtr<Object> obj, [[maybe_unused]] size_t usable_size) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     // Avoid AsString as object is not yet in live bitmap or allocation stack.
     ObjPtr<String> string = ObjPtr<String>::DownCast(obj);
diff --git a/runtime/mirror/string-inl.h b/runtime/mirror/string-inl.h
index 883a45c..c76ef69 100644
--- a/runtime/mirror/string-inl.h
+++ b/runtime/mirror/string-inl.h
@@ -25,7 +25,7 @@
 #include "dex/utf.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 inline uint32_t String::ClassSize(PointerSize pointer_size) {
@@ -35,11 +35,11 @@
   //   lambda$codePoints$1$CharSequence
   // which were virtual functions in standalone desugar, becomes
   // direct functions with D8 desugaring.
-  uint32_t vtable_entries = Object::kVTableLength + 67;
+  uint32_t vtable_entries = Object::kVTableLength + 70;
 #else
-  uint32_t vtable_entries = Object::kVTableLength + 69;
+  uint32_t vtable_entries = Object::kVTableLength + 72;
 #endif
-  return Class::ComputeClassSize(true, vtable_entries, 3, 0, 0, 1, 2, pointer_size);
+  return Class::ComputeClassSize(true, vtable_entries, 3, 0, 0, 1, 3, pointer_size);
 }
 
 inline uint16_t String::CharAt(int32_t index) {
@@ -67,6 +67,20 @@
   return -1;
 }
 
+template <typename MemoryType>
+int32_t String::LastIndexOf(MemoryType* chars, int32_t ch, int32_t from_index) {
+  DCHECK_LT(from_index, GetLength());
+  const MemoryType* start = chars;
+  const MemoryType* p = chars + from_index;
+  while (p >= start) {
+    if (*p == ch) {
+      return p - chars;
+    }
+    p--;
+  }
+  return -1;
+}
+
 inline int32_t String::ComputeHashCode() {
   uint32_t hash = IsCompressed()
       ? ComputeUtf16Hash(GetValueCompressed(), GetLength())
diff --git a/runtime/mirror/string.cc b/runtime/mirror/string.cc
index 839e01a..f4d13ab 100644
--- a/runtime/mirror/string.cc
+++ b/runtime/mirror/string.cc
@@ -32,15 +32,15 @@
 #include "string-inl.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 int32_t String::FastIndexOf(int32_t ch, int32_t start) {
   int32_t count = GetLength();
-  if (start < 0) {
+  if (start >= count) {
+    return -1;
+  } else if (start < 0) {
     start = 0;
-  } else if (start > count) {
-    start = count;
   }
   if (IsCompressed()) {
     return FastIndexOf<uint8_t>(GetValueCompressed(), ch, start);
@@ -49,6 +49,18 @@
   }
 }
 
+int32_t String::LastIndexOf(int32_t ch) {
+  int32_t count = GetLength();
+  if (count == 0) {
+    return -1;
+  }
+  if (IsCompressed()) {
+    return LastIndexOf<uint8_t>(GetValueCompressed(), ch, count - 1);
+  } else {
+    return LastIndexOf<uint16_t>(GetValue(), ch, count - 1);
+  }
+}
+
 int32_t String::ComputeAndSetHashCode() {
   int32_t new_hash_code = ComputeHashCode();
   SetHashCode(new_hash_code);
diff --git a/runtime/mirror/string.h b/runtime/mirror/string.h
index 90eb092..62890f5 100644
--- a/runtime/mirror/string.h
+++ b/runtime/mirror/string.h
@@ -18,11 +18,12 @@
 #define ART_RUNTIME_MIRROR_STRING_H_
 
 #include "base/bit_utils.h"
+#include "base/macros.h"
 #include "class.h"
 #include "object.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace gc {
 enum AllocatorType : char;
@@ -123,7 +124,7 @@
   static ObjPtr<String> DoReplace(Thread* self, Handle<String> src, uint16_t old_c, uint16_t new_c)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  ObjPtr<String> Intern() REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT ObjPtr<String> Intern() REQUIRES_SHARED(Locks::mutator_lock_);
 
   template <bool kIsInstrumented = true, typename PreFenceVisitor>
   ALWAYS_INLINE static ObjPtr<String> Alloc(Thread* self,
@@ -181,7 +182,7 @@
                                        const uint16_t* utf16_data_in)
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
-  static ObjPtr<String> AllocFromModifiedUtf8(Thread* self, const char* utf)
+  EXPORT static ObjPtr<String> AllocFromModifiedUtf8(Thread* self, const char* utf)
       REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   static ObjPtr<String> AllocFromModifiedUtf8(Thread* self,
@@ -204,10 +205,10 @@
   // A version that takes a mirror::String pointer instead of ObjPtr as it's being
   // called by the runtime app image code which can encode mirror::String at 64bit
   // addresses (ObjPtr only works with 32bit pointers).
-  bool Equals(mirror::String* that) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT bool Equals(mirror::String* that) REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Create a modified UTF-8 encoded std::string from a java/lang/String object.
-  std::string ToModifiedUtf8() REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT std::string ToModifiedUtf8() REQUIRES_SHARED(Locks::mutator_lock_);
 
   int32_t FastIndexOf(int32_t ch, int32_t start) REQUIRES_SHARED(Locks::mutator_lock_);
 
@@ -215,6 +216,12 @@
   int32_t FastIndexOf(MemoryType* chars, int32_t ch, int32_t start)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
+  int32_t LastIndexOf(int32_t ch) REQUIRES_SHARED(Locks::mutator_lock_);
+
+  template <typename MemoryType>
+  int32_t LastIndexOf(MemoryType* chars, int32_t ch, int32_t from_index)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+
   int32_t CompareTo(ObjPtr<String> other) REQUIRES_SHARED(Locks::mutator_lock_);
 
   static ObjPtr<CharArray> ToCharArray(Handle<String> h_this, Thread* self)
@@ -283,7 +290,7 @@
   static bool AllASCIIExcept(const uint16_t* chars, int32_t length, uint16_t non_ascii);
 
   // Computes, stores, and returns the hash code.
-  int32_t ComputeAndSetHashCode() REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT int32_t ComputeAndSetHashCode() REQUIRES_SHARED(Locks::mutator_lock_);
 
   void SetHashCode(int32_t new_hash_code) REQUIRES_SHARED(Locks::mutator_lock_) {
     if (kIsDebugBuild) {
diff --git a/runtime/mirror/throwable.cc b/runtime/mirror/throwable.cc
index a38ba1c..94567ef 100644
--- a/runtime/mirror/throwable.cc
+++ b/runtime/mirror/throwable.cc
@@ -33,7 +33,7 @@
 #include "string.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 using android::base::StringPrintf;
diff --git a/runtime/mirror/throwable.h b/runtime/mirror/throwable.h
index 995b04a..fa5ead3 100644
--- a/runtime/mirror/throwable.h
+++ b/runtime/mirror/throwable.h
@@ -19,7 +19,7 @@
 
 #include "object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class RootVisitor;
 struct ThrowableOffsets;
@@ -37,7 +37,7 @@
 
   ObjPtr<String> GetDetailMessage() REQUIRES_SHARED(Locks::mutator_lock_);
 
-  std::string Dump() REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT std::string Dump() REQUIRES_SHARED(Locks::mutator_lock_);
 
   // This is a runtime version of initCause, you shouldn't use it if initCause may have been
   // overridden. Also it asserts rather than throwing exceptions. Currently this is only used
diff --git a/runtime/mirror/var_handle.cc b/runtime/mirror/var_handle.cc
index 2220f92..a623e42 100644
--- a/runtime/mirror/var_handle.cc
+++ b/runtime/mirror/var_handle.cc
@@ -31,7 +31,7 @@
 #include "obj_ptr-inl.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 static constexpr bool kTransactionActive = true;
@@ -1335,13 +1335,13 @@
   return GetField32(AccessModesBitMaskOffset());
 }
 
-VarHandle::MatchKind VarHandle::GetMethodTypeMatchForAccessMode(AccessMode access_mode,
-                                                                ObjPtr<MethodType> method_type) {
+template <typename MethodTypeType>
+VarHandle::MatchKind VarHandle::GetMethodTypeMatchForAccessModeImpl(
+    AccessMode access_mode, ObjPtr<VarHandle> var_handle, MethodTypeType method_type) {
   MatchKind match = MatchKind::kExact;
 
-  ObjPtr<VarHandle> vh = this;
-  ObjPtr<Class> var_type = vh->GetVarType();
-  ObjPtr<Class> mt_rtype = method_type->GetRType();
+  ObjPtr<Class> var_type = var_handle->GetVarType();
+  ObjPtr<Class> mt_rtype = MethodType::GetRType(method_type);
   ObjPtr<Class> void_type = WellKnownClasses::ToClass(WellKnownClasses::java_lang_Void);
   AccessModeTemplate access_mode_template = GetAccessModeTemplate(access_mode);
 
@@ -1358,28 +1358,28 @@
   }
 
   // Check the number of parameters matches.
-  ObjPtr<Class> vh_ptypes[VarHandle::kMaxAccessorParameters];
+  ObjPtr<Class> vh_ptypes[kMaxAccessorParameters];
   const int32_t vh_ptypes_count = BuildParameterArray(vh_ptypes,
                                                       access_mode_template,
                                                       var_type,
-                                                      GetCoordinateType0(),
-                                                      GetCoordinateType1());
-  if (vh_ptypes_count != method_type->GetPTypes()->GetLength()) {
+                                                      var_handle->GetCoordinateType0(),
+                                                      var_handle->GetCoordinateType1());
+  auto mt_ptypes = MethodType::GetPTypes(method_type);
+  if (vh_ptypes_count != mt_ptypes.GetLength()) {
     return MatchKind::kNone;
   }
 
   // Check the parameter types are compatible.
-  ObjPtr<ObjectArray<Class>> mt_ptypes = method_type->GetPTypes();
   for (int32_t i = 0; i < vh_ptypes_count; ++i) {
-    if (vh_ptypes[i]->IsAssignableFrom(mt_ptypes->Get(i))) {
+    if (vh_ptypes[i]->IsAssignableFrom(mt_ptypes.Get(i))) {
       continue;
     }
-    if (mt_ptypes->Get(i) == void_type && !vh_ptypes[i]->IsPrimitive()) {
+    if (mt_ptypes.Get(i) == void_type && !vh_ptypes[i]->IsPrimitive()) {
       // The expected parameter is a reference and the parameter type from the call site is j.l.Void
       // which means the value is null. It is always valid for a reference parameter to be null.
       continue;
     }
-    if (!IsParameterTypeConvertible(mt_ptypes->Get(i), vh_ptypes[i])) {
+    if (!IsParameterTypeConvertible(mt_ptypes.Get(i), vh_ptypes[i])) {
       return MatchKind::kNone;
     }
     match = MatchKind::kWithConversions;
@@ -1387,39 +1387,46 @@
   return match;
 }
 
-ObjPtr<MethodType> VarHandle::GetMethodTypeForAccessMode(Thread* self,
-                                                         ObjPtr<VarHandle> var_handle,
-                                                         AccessMode access_mode) {
-  // This is a static method as the var_handle might be moved by the GC during it's execution.
-  AccessModeTemplate access_mode_template = GetAccessModeTemplate(access_mode);
+VarHandle::MatchKind VarHandle::GetMethodTypeMatchForAccessMode(
+    AccessMode access_mode, ObjPtr<MethodType> method_type) {
+  return GetMethodTypeMatchForAccessModeImpl(access_mode, this, method_type);
+}
 
-  StackHandleScope<3> hs(self);
-  Handle<VarHandle> vh = hs.NewHandle(var_handle);
-  Handle<Class> rtype = hs.NewHandle(GetReturnType(access_mode_template, vh->GetVarType()));
-  const int32_t ptypes_count = GetNumberOfParameters(access_mode_template,
-                                                     vh->GetCoordinateType0(),
-                                                     vh->GetCoordinateType1());
-  ObjPtr<Class> array_of_class = GetClassRoot<ObjectArray<Class>>();
-  Handle<ObjectArray<Class>> ptypes =
-      hs.NewHandle(ObjectArray<Class>::Alloc(Thread::Current(), array_of_class, ptypes_count));
-  if (ptypes == nullptr) {
-    return nullptr;
-  }
+VarHandle::MatchKind VarHandle::GetMethodTypeMatchForAccessMode(
+    AccessMode access_mode, Handle<MethodType> method_type) {
+  return GetMethodTypeMatchForAccessMode(access_mode, method_type.Get());
+}
 
-  ObjPtr<Class> ptypes_array[VarHandle::kMaxAccessorParameters];
-  BuildParameterArray(ptypes_array,
-                      access_mode_template,
-                      vh->GetVarType(),
-                      vh->GetCoordinateType0(),
-                      vh->GetCoordinateType1());
-  for (int32_t i = 0; i < ptypes_count; ++i) {
-    ptypes->Set(i, ptypes_array[i]);
-  }
-  return MethodType::Create(self, rtype, ptypes);
+VarHandle::MatchKind VarHandle::GetMethodTypeMatchForAccessMode(
+    AccessMode access_mode, RawMethodType method_type) {
+  return GetMethodTypeMatchForAccessModeImpl(access_mode, this, method_type);
 }
 
 ObjPtr<MethodType> VarHandle::GetMethodTypeForAccessMode(Thread* self, AccessMode access_mode) {
-  return GetMethodTypeForAccessMode(self, this, access_mode);
+  VariableSizedHandleScope method_type_hs(self);
+  RawMethodType method_type(&method_type_hs);
+  GetMethodTypeForAccessMode(access_mode, method_type);
+  return MethodType::Create(self, method_type);
+}
+
+void VarHandle::GetMethodTypeForAccessMode(AccessMode access_mode,
+                                           /*out*/ RawMethodType method_type) {
+  DCHECK(!method_type.IsValid());
+  AccessModeTemplate access_mode_template = GetAccessModeTemplate(access_mode);
+
+  // Store return type in `method_type`.
+  method_type.SetRType(GetReturnType(access_mode_template, GetVarType()));
+
+  // Store parameter types in `method_type`.
+  ObjPtr<Class> ptypes_array[kMaxAccessorParameters];
+  int32_t ptypes_count = BuildParameterArray(ptypes_array,
+                                             access_mode_template,
+                                             GetVarType(),
+                                             GetCoordinateType0(),
+                                             GetCoordinateType1());
+  for (int32_t i = 0; i < ptypes_count; ++i) {
+    method_type.AddPType(ptypes_array[i]);
+  }
 }
 
 std::string VarHandle::PrettyDescriptorForAccessMode(AccessMode access_mode) {
diff --git a/runtime/mirror/var_handle.h b/runtime/mirror/var_handle.h
index 18e0c3a..bf9329f 100644
--- a/runtime/mirror/var_handle.h
+++ b/runtime/mirror/var_handle.h
@@ -22,7 +22,7 @@
 #include "jvalue.h"
 #include "object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template<class T> class Handle;
 class InstructionOperands;
@@ -43,6 +43,7 @@
 namespace mirror {
 
 class MethodType;
+class RawMethodType;
 class VarHandleTest;
 
 // C++ mirror of java.lang.invoke.VarHandle
@@ -128,12 +129,21 @@
   // 'access_mode' and the provided 'method_type'.
   MatchKind GetMethodTypeMatchForAccessMode(AccessMode access_mode, ObjPtr<MethodType> method_type)
         REQUIRES_SHARED(Locks::mutator_lock_);
+  MatchKind GetMethodTypeMatchForAccessMode(AccessMode access_mode, Handle<MethodType> method_type)
+        REQUIRES_SHARED(Locks::mutator_lock_);
+  MatchKind GetMethodTypeMatchForAccessMode(AccessMode access_mode, RawMethodType method_type)
+        REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Allocates and returns the MethodType associated with the
   // AccessMode. No check is made for whether the AccessMode is a
   // supported operation so the MethodType can be used when raising a
   // WrongMethodTypeException exception.
-  ObjPtr<MethodType> GetMethodTypeForAccessMode(Thread* self, AccessMode accessMode)
+  ObjPtr<MethodType> GetMethodTypeForAccessMode(Thread* self, AccessMode access_mode)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+
+  // Overload that fills a handle scope with the return type and argument types
+  // instead of creating an actual `MethodType`.
+  void GetMethodTypeForAccessMode(AccessMode access_mode, /*out*/ RawMethodType method_type)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Returns a string representing the descriptor of the MethodType associated with
@@ -193,10 +203,11 @@
   ObjPtr<Class> GetCoordinateType1() REQUIRES_SHARED(Locks::mutator_lock_);
   int32_t GetAccessModesBitMask() REQUIRES_SHARED(Locks::mutator_lock_);
 
-  static ObjPtr<MethodType> GetMethodTypeForAccessMode(Thread* self,
+  template <typename MethodTypeType>
+  static MatchKind GetMethodTypeMatchForAccessModeImpl(AccessMode access_mode,
                                                        ObjPtr<VarHandle> var_handle,
-                                                       AccessMode access_mode)
-      REQUIRES_SHARED(Locks::mutator_lock_);
+                                                       MethodTypeType method_type)
+        REQUIRES_SHARED(Locks::mutator_lock_);
 
   HeapReference<mirror::Class> coordinate_type0_;
   HeapReference<mirror::Class> coordinate_type1_;
diff --git a/runtime/mirror/var_handle_test.cc b/runtime/mirror/var_handle_test.cc
index 859e86c..22d1e4a 100644
--- a/runtime/mirror/var_handle_test.cc
+++ b/runtime/mirror/var_handle_test.cc
@@ -34,7 +34,7 @@
 #include "reflection.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 
 // Tests for mirror::VarHandle and it's descendents.
diff --git a/runtime/monitor-inl.h b/runtime/monitor-inl.h
index f7e31a0..85ae063 100644
--- a/runtime/monitor-inl.h
+++ b/runtime/monitor-inl.h
@@ -22,7 +22,7 @@
 #include "gc_root-inl.h"
 #include "obj_ptr-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template<ReadBarrierOption kReadBarrierOption>
 inline ObjPtr<mirror::Object> Monitor::GetObject() REQUIRES_SHARED(Locks::mutator_lock_) {
@@ -30,7 +30,7 @@
 }
 
 // Check for request to set lock owner info.
-void Monitor::CheckLockOwnerRequest(Thread* self) {
+inline void Monitor::CheckLockOwnerRequest(Thread* self) {
   DCHECK(self != nullptr);
   Thread* request_thread = lock_owner_request_.load(std::memory_order_relaxed);
   if (request_thread == self) {
@@ -40,13 +40,13 @@
   }
 }
 
-uintptr_t Monitor::LockOwnerInfoChecksum(ArtMethod* m, uint32_t dex_pc, Thread* t) {
+inline uintptr_t Monitor::LockOwnerInfoChecksum(ArtMethod* m, uint32_t dex_pc, Thread* t) {
   uintptr_t dpc_and_thread = static_cast<uintptr_t>(dex_pc << 8) ^ reinterpret_cast<uintptr_t>(t);
   return reinterpret_cast<uintptr_t>(m) ^ dpc_and_thread
       ^ (dpc_and_thread << (/* ptr_size / 2 */ (sizeof m) << 2));
 }
 
-void Monitor::SetLockOwnerInfo(ArtMethod* method, uint32_t dex_pc, Thread* t) {
+inline void Monitor::SetLockOwnerInfo(ArtMethod* method, uint32_t dex_pc, Thread* t) {
   lock_owner_method_.store(method, std::memory_order_relaxed);
   lock_owner_dex_pc_.store(dex_pc, std::memory_order_relaxed);
   lock_owner_.store(t, std::memory_order_relaxed);
@@ -54,8 +54,9 @@
   lock_owner_sum_.store(sum, std::memory_order_relaxed);
 }
 
-void Monitor::GetLockOwnerInfo(/*out*/ArtMethod** method, /*out*/uint32_t* dex_pc,
-                               Thread* t) {
+inline void Monitor::GetLockOwnerInfo(/*out*/ ArtMethod** method,
+                                      /*out*/ uint32_t* dex_pc,
+                                      Thread* t) {
   ArtMethod* owners_method;
   uint32_t owners_dex_pc;
   Thread* owner;
@@ -79,7 +80,6 @@
   }
 }
 
-
 }  // namespace art
 
 #endif  // ART_RUNTIME_MONITOR_INL_H_
diff --git a/runtime/monitor.cc b/runtime/monitor.cc
index 3fed8d4..3458508 100644
--- a/runtime/monitor.cc
+++ b/runtime/monitor.cc
@@ -14,12 +14,11 @@
  * limitations under the License.
  */
 
-#include "monitor-inl.h"
+#include <android-base/properties.h>
 
 #include <vector>
 
 #include "android-base/stringprintf.h"
-
 #include "art_method-inl.h"
 #include "base/logging.h"  // For VLOG.
 #include "base/mutex.h"
@@ -32,9 +31,11 @@
 #include "dex/dex_file_types.h"
 #include "dex/dex_instruction-inl.h"
 #include "entrypoints/entrypoint_utils-inl.h"
+#include "gc/verification-inl.h"
 #include "lock_word-inl.h"
 #include "mirror/class-inl.h"
 #include "mirror/object-inl.h"
+#include "monitor-inl.h"
 #include "object_callbacks.h"
 #include "scoped_thread_state_change-inl.h"
 #include "stack.h"
@@ -42,11 +43,10 @@
 #include "thread_list.h"
 #include "verifier/method_verifier.h"
 #include "well_known_classes.h"
-#include <android-base/properties.h>
 
 static_assert(ART_USE_FUTEXES);
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -1005,7 +1005,7 @@
     if (monitor->num_waiters_.load(std::memory_order_relaxed) > 0) {
       return false;
     }
-    if (!monitor->monitor_lock_.ExclusiveTryLock(self)) {
+    if (!monitor->monitor_lock_.ExclusiveTryLock</* check= */ false>(self)) {
       // We cannot deflate a monitor that's currently held. It's unclear whether we should if
       // we could.
       return false;
@@ -1054,8 +1054,11 @@
   }
 }
 
-void Monitor::InflateThinLocked(Thread* self, Handle<mirror::Object> obj, LockWord lock_word,
-                                uint32_t hash_code) {
+void Monitor::InflateThinLocked(Thread* self,
+                                Handle<mirror::Object> obj,
+                                LockWord lock_word,
+                                uint32_t hash_code,
+                                int attempt_of_4) {
   DCHECK_EQ(lock_word.GetState(), LockWord::kThinLocked);
   uint32_t owner_thread_id = lock_word.ThinLockOwner();
   if (owner_thread_id == self->GetThreadId()) {
@@ -1065,13 +1068,11 @@
     ThreadList* thread_list = Runtime::Current()->GetThreadList();
     // Suspend the owner, inflate. First change to blocked and give up mutator_lock_.
     self->SetMonitorEnterObject(obj.Get());
-    bool timed_out;
     Thread* owner;
     {
       ScopedThreadSuspension sts(self, ThreadState::kWaitingForLockInflation);
-      owner = thread_list->SuspendThreadByThreadId(owner_thread_id,
-                                                   SuspendReason::kInternal,
-                                                   &timed_out);
+      owner = thread_list->SuspendThreadByThreadId(
+          owner_thread_id, SuspendReason::kInternal, attempt_of_4);
     }
     if (owner != nullptr) {
       // We succeeded in suspending the thread, check the lock's status didn't change.
@@ -1110,6 +1111,7 @@
   uint32_t thread_id = self->GetThreadId();
   size_t contention_count = 0;
   constexpr size_t kExtraSpinIters = 100;
+  int inflation_attempt = 1;
   StackHandleScope<1> hs(self);
   Handle<mirror::Object> h_obj(hs.NewHandle(obj));
   while (true) {
@@ -1156,7 +1158,7 @@
             continue;  // Go again.
           } else {
             // We'd overflow the recursion count, so inflate the monitor.
-            InflateThinLocked(self, h_obj, lock_word, 0);
+            InflateThinLocked(self, h_obj, lock_word, 0, inflation_attempt++);
           }
         } else {
           if (trylock) {
@@ -1177,7 +1179,7 @@
           } else {
             contention_count = 0;
             // No ordering required for initial lockword read. Install rereads it anyway.
-            InflateThinLocked(self, h_obj, lock_word, 0);
+            InflateThinLocked(self, h_obj, lock_word, 0, inflation_attempt++);
           }
         }
         continue;  // Start from the beginning.
@@ -1522,18 +1524,29 @@
       // not be optimized out.
       success = stack_visitor->GetVReg(m, dex_reg, kReferenceVReg, &value);
       if (success) {
-        ObjPtr<mirror::Object> o = reinterpret_cast<mirror::Object*>(value);
-        callback(o, callback_context);
-        break;
+        mirror::Object* mp = reinterpret_cast<mirror::Object*>(value);
+        // TODO(b/299577730) Remove the extra checks here once the underlying bug is fixed.
+        const gc::Verification* v = Runtime::Current()->GetHeap()->GetVerification();
+        if (v->IsValidObject(mp)) {
+          ObjPtr<mirror::Object> o = mp;
+          callback(o, callback_context);
+          break;
+        } else {
+          LOG(ERROR) << "Encountered bad lock object: " << std::hex << value << std::dec;
+          success = false;
+        }
       }
     }
-    DCHECK(success) << "Failed to find/read reference for monitor-enter at dex pc "
-                    << dex_lock_info.dex_pc
-                    << " in method "
-                    << m->PrettyMethod();
     if (!success) {
-      LOG(WARNING) << "Had a lock reported for dex pc " << dex_lock_info.dex_pc
-                   << " but was not able to fetch a corresponding object!";
+      LOG(ERROR) << "Failed to find/read reference for monitor-enter at dex pc "
+                 << dex_lock_info.dex_pc << " in method " << m->PrettyMethod();
+      if (kIsDebugBuild) {
+        // Crash only in debug ART builds.
+        LOG(FATAL) << "Had a lock reported for a dex pc "
+                      "but was not able to fetch a corresponding object!";
+      } else {
+        LOG(ERROR) << "Held monitor information in stack trace will be incomplete!";
+      }
     }
   }
 }
diff --git a/runtime/monitor.h b/runtime/monitor.h
index ad7a0b4..0ee2dbb 100644
--- a/runtime/monitor.h
+++ b/runtime/monitor.h
@@ -28,6 +28,7 @@
 
 #include "base/allocator.h"
 #include "base/atomic.h"
+#include "base/macros.h"
 #include "base/mutex.h"
 #include "gc_root.h"
 #include "lock_word.h"
@@ -36,7 +37,7 @@
 #include "runtime_callbacks.h"
 #include "thread_state.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtMethod;
 class IsMarkedVisitor;
@@ -72,20 +73,20 @@
   static void Init(uint32_t lock_profiling_threshold, uint32_t stack_dump_lock_profiling_threshold);
 
   // Return the thread id of the lock owner or 0 when there is no owner.
-  static uint32_t GetLockOwnerThreadId(ObjPtr<mirror::Object> obj)
+  EXPORT static uint32_t GetLockOwnerThreadId(ObjPtr<mirror::Object> obj)
       NO_THREAD_SAFETY_ANALYSIS;  // TODO: Reading lock owner without holding lock is racy.
 
   // NO_THREAD_SAFETY_ANALYSIS for mon->Lock.
-  static ObjPtr<mirror::Object> MonitorEnter(Thread* thread,
-                                             ObjPtr<mirror::Object> obj,
-                                             bool trylock)
+  EXPORT static ObjPtr<mirror::Object> MonitorEnter(Thread* thread,
+                                                    ObjPtr<mirror::Object> obj,
+                                                    bool trylock)
       EXCLUSIVE_LOCK_FUNCTION(obj.Ptr())
       NO_THREAD_SAFETY_ANALYSIS
       REQUIRES(!Roles::uninterruptible_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // NO_THREAD_SAFETY_ANALYSIS for mon->Unlock.
-  static bool MonitorExit(Thread* thread, ObjPtr<mirror::Object> obj)
+  EXPORT static bool MonitorExit(Thread* thread, ObjPtr<mirror::Object> obj)
       NO_THREAD_SAFETY_ANALYSIS
       REQUIRES(!Roles::uninterruptible_)
       REQUIRES_SHARED(Locks::mutator_lock_)
@@ -102,11 +103,12 @@
 
   // Object.wait().  Also called for class init.
   // NO_THREAD_SAFETY_ANALYSIS for mon->Wait.
-  static void Wait(Thread* self,
-                   ObjPtr<mirror::Object> obj,
-                   int64_t ms,
-                   int32_t ns,
-                   bool interruptShouldThrow, ThreadState why)
+  EXPORT static void Wait(Thread* self,
+                          ObjPtr<mirror::Object> obj,
+                          int64_t ms,
+                          int32_t ns,
+                          bool interruptShouldThrow,
+                          ThreadState why)
       REQUIRES_SHARED(Locks::mutator_lock_) NO_THREAD_SAFETY_ANALYSIS;
 
   static ThreadState FetchState(const Thread* thread,
@@ -116,18 +118,17 @@
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Used to implement JDWP's ThreadReference.CurrentContendedMonitor.
-  static ObjPtr<mirror::Object> GetContendedMonitor(Thread* thread)
+  EXPORT static ObjPtr<mirror::Object> GetContendedMonitor(Thread* thread)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Calls 'callback' once for each lock held in the single stack frame represented by
   // the current state of 'stack_visitor'.
   // The abort_on_failure flag allows to not die when the state of the runtime is unorderly. This
   // is necessary when we have already aborted but want to dump the stack as much as we can.
-  static void VisitLocks(StackVisitor* stack_visitor,
-                         void (*callback)(ObjPtr<mirror::Object>, void*),
-                         void* callback_context,
-                         bool abort_on_failure = true)
-      REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT static void VisitLocks(StackVisitor* stack_visitor,
+                                void (*callback)(ObjPtr<mirror::Object>, void*),
+                                void* callback_context,
+                                bool abort_on_failure = true) REQUIRES_SHARED(Locks::mutator_lock_);
 
   static bool IsValidLockWord(LockWord lock_word);
 
@@ -155,13 +156,19 @@
   }
 
   // Inflate the lock on obj. May fail to inflate for spurious reasons, always re-check.
-  static void InflateThinLocked(Thread* self, Handle<mirror::Object> obj, LockWord lock_word,
-                                uint32_t hash_code) REQUIRES_SHARED(Locks::mutator_lock_);
+  // attempt_of_4 is in 1..4 inclusive or 0. A non-zero value indicates that we are retrying
+  // up to 4 times, and should only abort on 4. Zero means we are only trying once, with the
+  // full suspend timeout instead of a quarter.
+  static void InflateThinLocked(Thread* self,
+                                Handle<mirror::Object> obj,
+                                LockWord lock_word,
+                                uint32_t hash_code,
+                                int attempt_of_4 = 0) REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Not exclusive because ImageWriter calls this during a Heap::VisitObjects() that
   // does not allow a thread suspension in the middle. TODO: maybe make this exclusive.
   // NO_THREAD_SAFETY_ANALYSIS for monitor->monitor_lock_.
-  static bool Deflate(Thread* self, ObjPtr<mirror::Object> obj)
+  EXPORT static bool Deflate(Thread* self, ObjPtr<mirror::Object> obj)
       REQUIRES_SHARED(Locks::mutator_lock_) NO_THREAD_SAFETY_ANALYSIS;
 
 #ifndef __LP64__
@@ -450,7 +457,7 @@
   void BroadcastForNewMonitors() REQUIRES(!monitor_list_lock_);
   // Returns how many monitors were deflated.
   size_t DeflateMonitors() REQUIRES(!monitor_list_lock_) REQUIRES(Locks::mutator_lock_);
-  size_t Size() REQUIRES(!monitor_list_lock_);
+  EXPORT size_t Size() REQUIRES(!monitor_list_lock_);
 
   using Monitors = std::list<Monitor*, TrackingAllocator<Monitor*, kAllocatorTagMonitorList>>;
 
@@ -476,7 +483,7 @@
   MonitorInfo() : owner_(nullptr), entry_count_(0) {}
   MonitorInfo(const MonitorInfo&) = default;
   MonitorInfo& operator=(const MonitorInfo&) = default;
-  explicit MonitorInfo(ObjPtr<mirror::Object> o) REQUIRES(Locks::mutator_lock_);
+  EXPORT explicit MonitorInfo(ObjPtr<mirror::Object> o) REQUIRES(Locks::mutator_lock_);
 
   Thread* owner_;
   size_t entry_count_;
diff --git a/runtime/monitor_android.cc b/runtime/monitor_android.cc
index f661631..aee157c 100644
--- a/runtime/monitor_android.cc
+++ b/runtime/monitor_android.cc
@@ -30,7 +30,7 @@
 
 #define EVENT_LOG_TAG_dvm_lock_sample 20003
 
-namespace art {
+namespace art HIDDEN {
 
 void Monitor::LogContentionEvent(Thread* self,
                                  uint32_t wait_ms,
diff --git a/runtime/monitor_linux.cc b/runtime/monitor_linux.cc
index 6678661..f711e96 100644
--- a/runtime/monitor_linux.cc
+++ b/runtime/monitor_linux.cc
@@ -16,7 +16,7 @@
 
 #include "monitor.h"
 
-namespace art {
+namespace art HIDDEN {
 
 void Monitor::LogContentionEvent(Thread*, uint32_t, uint32_t, ArtMethod*, uint32_t) {
 }
diff --git a/runtime/monitor_objects_stack_visitor.cc b/runtime/monitor_objects_stack_visitor.cc
index 524c0ec..f53f6af 100644
--- a/runtime/monitor_objects_stack_visitor.cc
+++ b/runtime/monitor_objects_stack_visitor.cc
@@ -20,7 +20,7 @@
 #include "read_barrier-inl.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 bool MonitorObjectsStackVisitor::VisitFrame() {
   ArtMethod* m = GetMethod();
diff --git a/runtime/monitor_objects_stack_visitor.h b/runtime/monitor_objects_stack_visitor.h
index 8e148aa..e3fe153 100644
--- a/runtime/monitor_objects_stack_visitor.h
+++ b/runtime/monitor_objects_stack_visitor.h
@@ -21,12 +21,13 @@
 
 #include "art_method.h"
 #include "base/locks.h"
+#include "base/macros.h"
 #include "monitor.h"
 #include "stack.h"
 #include "thread.h"
 #include "thread_state.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Object;
diff --git a/runtime/monitor_pool.cc b/runtime/monitor_pool.cc
index b2b0024..0501ea5 100644
--- a/runtime/monitor_pool.cc
+++ b/runtime/monitor_pool.cc
@@ -21,7 +21,7 @@
 #include "monitor.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Object;
diff --git a/runtime/monitor_pool.h b/runtime/monitor_pool.h
index 133cde0..b6340d7 100644
--- a/runtime/monitor_pool.h
+++ b/runtime/monitor_pool.h
@@ -20,6 +20,7 @@
 #include "monitor.h"
 
 #include "base/allocator.h"
+#include "base/macros.h"
 #ifdef __LP64__
 #include <stdint.h>
 #include "base/atomic.h"
@@ -28,7 +29,7 @@
 #include "base/stl_util.h"     // STLDeleteElements
 #endif
 
-namespace art {
+namespace art HIDDEN {
 
 // Abstraction to keep monitors small enough to fit in a lock word (32bits). On 32bit systems the
 // monitor id loses the alignment bits of the Monitor*.
diff --git a/runtime/monitor_pool_test.cc b/runtime/monitor_pool_test.cc
index 5463877..d6ddca9 100644
--- a/runtime/monitor_pool_test.cc
+++ b/runtime/monitor_pool_test.cc
@@ -20,7 +20,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class MonitorPoolTest : public CommonRuntimeTest {};
 
diff --git a/runtime/monitor_test.cc b/runtime/monitor_test.cc
index 699f2b0..00e30ff 100644
--- a/runtime/monitor_test.cc
+++ b/runtime/monitor_test.cc
@@ -32,7 +32,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread_pool.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class MonitorTest : public CommonRuntimeTest {
  protected:
@@ -278,15 +278,15 @@
 
   // Need to drop the mutator lock to allow barriers.
   ScopedThreadSuspension sts(soa.Self(), ThreadState::kNative);
-  ThreadPool thread_pool(pool_name, 3);
-  thread_pool.AddTask(self, new CreateTask(test, create_sleep, c_millis, c_expected));
+  std::unique_ptr<ThreadPool> thread_pool(ThreadPool::Create(pool_name, 3));
+  thread_pool->AddTask(self, new CreateTask(test, create_sleep, c_millis, c_expected));
   if (interrupt) {
-    thread_pool.AddTask(self, new InterruptTask(test, use_sleep, static_cast<uint64_t>(u_millis)));
+    thread_pool->AddTask(self, new InterruptTask(test, use_sleep, static_cast<uint64_t>(u_millis)));
   } else {
-    thread_pool.AddTask(self, new UseTask(test, use_sleep, u_millis, u_expected));
+    thread_pool->AddTask(self, new UseTask(test, use_sleep, u_millis, u_expected));
   }
-  thread_pool.AddTask(self, new WatchdogTask(test));
-  thread_pool.StartWorkers(self);
+  thread_pool->AddTask(self, new WatchdogTask(test));
+  thread_pool->StartWorkers(self);
 
   // Wait on completion barrier.
   test->complete_barrier_->Wait(self);
@@ -300,7 +300,7 @@
     watchdog_obj->MonitorExit(self);      // Release the lock.
   }
 
-  thread_pool.StopWorkers(self);
+  thread_pool->StopWorkers(self);
 }
 
 
@@ -361,7 +361,7 @@
   ScopedLogSeverity sls(LogSeverity::FATAL);
 
   Thread* const self = Thread::Current();
-  ThreadPool thread_pool("the pool", 2);
+  std::unique_ptr<ThreadPool> thread_pool(ThreadPool::Create("the pool", 2));
   ScopedObjectAccess soa(self);
   StackHandleScope<1> hs(self);
   Handle<mirror::Object> obj1(
@@ -375,10 +375,10 @@
       EXPECT_TRUE(trylock.Acquired());
     }
     // Test failure case.
-    thread_pool.AddTask(self, new TryLockTask(g_obj1));
-    thread_pool.StartWorkers(self);
+    thread_pool->AddTask(self, new TryLockTask(g_obj1));
+    thread_pool->StartWorkers(self);
     ScopedThreadSuspension sts(self, ThreadState::kSuspended);
-    thread_pool.Wait(Thread::Current(), /*do_work=*/false, /*may_hold_locks=*/false);
+    thread_pool->Wait(Thread::Current(), /*do_work=*/false, /*may_hold_locks=*/false);
   }
   // Test that the trylock actually locks the object.
   {
@@ -388,7 +388,7 @@
     // Since we hold the lock there should be no monitor state exeception.
     self->AssertNoPendingException();
   }
-  thread_pool.StopWorkers(self);
+  thread_pool->StopWorkers(self);
 }
 
 
diff --git a/runtime/mutator_gc_coord.md b/runtime/mutator_gc_coord.md
index aba8421..01e3ef0 100644
--- a/runtime/mutator_gc_coord.md
+++ b/runtime/mutator_gc_coord.md
@@ -100,7 +100,11 @@
 
 Logically the mutator lock is held in shared/reader mode if ***either*** the
 underlying reader-writer lock is held in shared mode, ***or*** if a mutator is in
-runnable state.
+runnable state. These two ways of holding the mutator mutex are ***not***
+equivalent: In particular, we rely on the garbage collector never actually
+entering a "runnable" state while active (see below). However, it often runs with
+the explicit mutator mutex in shared mode, thus blocking others from acquiring it
+in exclusive mode.
 
 Suspension and checkpoint API
 -----------------------------
@@ -217,13 +221,99 @@
 checkpoints do not preclude client threads from being in the middle of an
 operation that involves a weak reference access, while nonempty checkpoints do.
 
+**Suspending the GC**
+Under unusual conditions, the GC can run on any thread. This means that when
+thread *A* suspends thread *B* for some other reason, Thread *B* might be
+running the garbage collector and conceivably thus cause it to block.  This
+would be very deadlock prone. If Thread *A* allocates while Thread *B* is
+suspended in the GC, and the allocation requires the GC's help to complete, we
+deadlock.
 
-[^1]: Some comments in the code refer to a not-yet-really-implemented scheme in
-which the compiler-generated code would load through the address at
-`tlsPtr_.suspend_trigger`. A thread suspension is requested by setting this to
-null, triggering a `SIGSEGV`, causing that thread to check for GC cooperation
-requests. The real mechanism instead sets an appropriate `ThreadFlag` entry to
-request suspension or a checkpoint. Note that the actual checkpoint function
-value is set, along with the flag, while holding `suspend_count_lock_`. If the
-target thread notices that a checkpoint is requested, it then acquires
-the `suspend_count_lock_` to read the checkpoint function.
+Thus we ensure that the GC, together with anything else that can block GCs,
+cannot be blocked for thread suspension requests. This is accomplished by
+ensuring that it always appears to be in a suspended thread state. Since we
+only check for suspend requests when entering the runnable state, suspend
+requests go unnoticed until the GC completes. It may physically acquire and
+release the actual `mutator_lock_` in either shared or exclusive mode.
+
+Thread Suspension Mechanics
+---------------------------
+
+Thread suspension is initiated by a registered thread, except that, for testing
+purposes, `SuspendAll` may be invoked with `self == nullptr`.  We never suspend
+the initiating thread, explicitly exclusing it from `SuspendAll()`, and failing
+`SuspendThreadBy...()` requests to that effect.
+
+The suspend calls invoke `IncrementSuspendCount()` to increment the thread
+suspend count for each thread. That adds a "suspend barrier" (atomic counter) to
+the per-thread list of such counters to decrement. It normally sets the
+`kSuspendRequest` ("should enter safepoint handler") and `kActiveSuspendBarrier`
+("need to notify us when suspended") flags.
+
+After setting these two flags, we check whether the thread is suspended and
+`kSuspendRequest` is still set. Since the thread is already suspended, it cannot
+be expected to respond to "pass the suspend barrier" (decrement the atomic
+counter) in a timely fashion.  Hence we do so on its behalf. This decrements
+the "barrier" and removes it from the thread's list of barriers to decrement,
+and clears `kActiveSuspendBarrier`. `kSuspendRequest` remains to ensure the
+thread doesn't prematurely return to runnable state.
+
+If `SuspendAllInternal()` does not immediately see a suspended state, then it is up
+to the target thread to decrement the suspend barrier.
+`TransitionFromRunnableToSuspended()` calls
+`TransitionToSuspendedAndRunCheckpoints()`, which changes the thread state
+and returns. `TransitionFromRunnableToSuspended()` then calls
+`CheckActiveSuspendBarriers()` to check for the `kActiveSuspendBarrier` flag
+and decrement the suspend barrier if set.
+
+The `suspend_count_lock_` is not consistently held in the target thread
+during this process.  Thus correctness in resolving the race between a
+suspension-requesting thread and a target thread voluntarily suspending relies
+on first requesting suspension, and then checking whether the target is
+already suspended, The detailed correctness argument is given in a comment
+inside `SuspendAllInternal()`. This also ensures that the barrier cannot be
+decremented after the stack frame holding the barrier goes away.
+
+This relies on the fact that the two stores in the two threads to the state and
+kActiveSuspendBarrier flag are ordered with respect to the later loads. That's
+guaranteed, since they are all stored in a single `atomic<>`. Thus even relaxed
+accesses are OK.
+
+The actual suspend barrier representation still varies between `SuspendAll()`
+and `SuspendThreadBy...()`.  The former relies on the fact that only one such
+barrier can be in use at a time, while the latter maintains a linked list of
+active suspend barriers for each target thread, relying on the fact that each
+one can appear on the list of only one thread, and we can thus use list nodes
+allocated in the stack frames of requesting threads.
+
+**Avoiding suspension cycles**
+
+Any thread can issue a `SuspendThreadByPeer()`, `SuspendThreadByThreadId()` or
+`SuspendAll()` request. But if Thread A increments Thread B's suspend count
+while Thread B increments Thread A's suspend count, and they then both suspend
+during a subsequent thread transition, we're deadlocked.
+
+For single-thread suspension requests, we refuse to initiate
+a suspend request from a registered thread that is also being asked to suspend
+(i.e. the suspend count is nonzero).  Instead the requestor waits for that
+condition to change.  This means that we cannot create a cycle in which each
+thread has asked to suspend the next one, and thus no thread can progress.  The
+required atomicity of the requestor suspend count check with setting the suspend
+count of the target(s) target is ensured by holding `suspend_count_lock_`.
+
+For `SuspendAll()`, we enforce a requirement that at most one `SuspendAll()`
+request is running at one time. We also set the `kSuspensionImmune` thread flag
+to prevent a single thread suspension of a thread currently between
+`SuspendAll()` and `ResumeAll()` calls. Thus once a `SuspendAll()` call starts,
+it will complete before it can be affected by suspension requests from other
+threads.
+
+[^1]: In the most recent versions of ART, compiler-generated code loads through
+    the address at `tlsPtr_.suspend_trigger`. A thread suspension is requested
+    by setting this to null, triggering a `SIGSEGV`, causing that thread to
+    check for GC cooperation requests. The older mechanism instead sets an
+    appropriate `ThreadFlag` entry to request suspension or a checkpoint. Note
+    that the actual checkpoint function value is set, along with the flag, while
+    holding `suspend_count_lock_`. If the target thread notices that a
+    checkpoint is requested, it then acquires the `suspend_count_lock_` to read
+    the checkpoint function.
diff --git a/runtime/native/dalvik_system_BaseDexClassLoader.cc b/runtime/native/dalvik_system_BaseDexClassLoader.cc
index a4f702c..f9a1aba 100644
--- a/runtime/native/dalvik_system_BaseDexClassLoader.cc
+++ b/runtime/native/dalvik_system_BaseDexClassLoader.cc
@@ -25,7 +25,7 @@
 #include "nativehelper/jni_macros.h"
 #include "thread-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static bool append_string(Thread* self,
                           Handle<mirror::ObjectArray<mirror::String>> array,
diff --git a/runtime/native/dalvik_system_BaseDexClassLoader.h b/runtime/native/dalvik_system_BaseDexClassLoader.h
index 4ec03ef..5a18b18 100644
--- a/runtime/native/dalvik_system_BaseDexClassLoader.h
+++ b/runtime/native/dalvik_system_BaseDexClassLoader.h
@@ -20,7 +20,9 @@
 #include <jni.h>
 #include <unistd.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_dalvik_system_BaseDexClassLoader(JNIEnv* env);
 
diff --git a/runtime/native/dalvik_system_DexFile.cc b/runtime/native/dalvik_system_DexFile.cc
index 9f0c216..f7f4465 100644
--- a/runtime/native/dalvik_system_DexFile.cc
+++ b/runtime/native/dalvik_system_DexFile.cc
@@ -49,9 +49,9 @@
 #include "nativehelper/jni_macros.h"
 #include "nativehelper/scoped_local_ref.h"
 #include "nativehelper/scoped_utf_chars.h"
-#include "oat_file.h"
-#include "oat_file_assistant.h"
-#include "oat_file_manager.h"
+#include "oat/oat_file.h"
+#include "oat/oat_file_assistant.h"
+#include "oat/oat_file_manager.h"
 #include "runtime.h"
 #include "scoped_thread_state_change-inl.h"
 #include "string_array_utils.h"
@@ -62,7 +62,7 @@
 #include <sys/system_properties.h>
 #endif  // ART_TARGET_ANDROID
 
-namespace art {
+namespace art HIDDEN {
 
 // Should be the same as dalvik.system.DexFile.ENFORCE_READ_ONLY_JAVA_DCL
 static constexpr uint64_t kEnforceReadOnlyJavaDcl = 218865702;
@@ -368,8 +368,8 @@
 static jobject DexFile_openDexFileNative(JNIEnv* env,
                                          jclass,
                                          jstring javaSourceName,
-                                         jstring javaOutputName ATTRIBUTE_UNUSED,
-                                         jint flags ATTRIBUTE_UNUSED,
+                                         [[maybe_unused]] jstring javaOutputName,
+                                         [[maybe_unused]] jint flags,
                                          jobject class_loader,
                                          jobjectArray dex_elements) {
   ScopedUtfChars sourceName(env, javaSourceName);
@@ -758,8 +758,8 @@
 }
 
 static jboolean DexFile_isValidCompilerFilter(JNIEnv* env,
-                                            jclass javeDexFileClass ATTRIBUTE_UNUSED,
-                                            jstring javaCompilerFilter) {
+                                              [[maybe_unused]] jclass javaDexFileClass,
+                                              jstring javaCompilerFilter) {
   ScopedUtfChars compiler_filter(env, javaCompilerFilter);
   if (env->ExceptionCheck()) {
     return -1;
@@ -771,7 +771,7 @@
 }
 
 static jboolean DexFile_isProfileGuidedCompilerFilter(JNIEnv* env,
-                                                      jclass javeDexFileClass ATTRIBUTE_UNUSED,
+                                                      [[maybe_unused]] jclass javaDexFileClass,
                                                       jstring javaCompilerFilter) {
   ScopedUtfChars compiler_filter(env, javaCompilerFilter);
   if (env->ExceptionCheck()) {
@@ -786,7 +786,7 @@
 }
 
 static jboolean DexFile_isVerifiedCompilerFilter(JNIEnv* env,
-                                                 jclass javeDexFileClass ATTRIBUTE_UNUSED,
+                                                 [[maybe_unused]] jclass javaDexFileClass,
                                                  jstring javaCompilerFilter) {
   ScopedUtfChars compiler_filter(env, javaCompilerFilter);
   if (env->ExceptionCheck()) {
@@ -801,7 +801,7 @@
 }
 
 static jboolean DexFile_isOptimizedCompilerFilter(JNIEnv* env,
-                                                  jclass javeDexFileClass ATTRIBUTE_UNUSED,
+                                                  [[maybe_unused]] jclass javaDexFileClass,
                                                   jstring javaCompilerFilter) {
   ScopedUtfChars compiler_filter(env, javaCompilerFilter);
   if (env->ExceptionCheck()) {
@@ -816,12 +816,12 @@
 }
 
 static jboolean DexFile_isReadOnlyJavaDclEnforced(JNIEnv* env,
-                                                  jclass javeDexFileClass ATTRIBUTE_UNUSED) {
+                                                  [[maybe_unused]] jclass javaDexFileClass) {
   return (isReadOnlyJavaDclChecked() && isReadOnlyJavaDclEnforced(env)) ? JNI_TRUE : JNI_FALSE;
 }
 
 static jstring DexFile_getNonProfileGuidedCompilerFilter(JNIEnv* env,
-                                                         jclass javeDexFileClass ATTRIBUTE_UNUSED,
+                                                         [[maybe_unused]] jclass javaDexFileClass,
                                                          jstring javaCompilerFilter) {
   ScopedUtfChars compiler_filter(env, javaCompilerFilter);
   if (env->ExceptionCheck()) {
@@ -846,7 +846,7 @@
 }
 
 static jstring DexFile_getSafeModeCompilerFilter(JNIEnv* env,
-                                                 jclass javeDexFileClass ATTRIBUTE_UNUSED,
+                                                 [[maybe_unused]] jclass javaDexFileClass,
                                                  jstring javaCompilerFilter) {
   ScopedUtfChars compiler_filter(env, javaCompilerFilter);
   if (env->ExceptionCheck()) {
diff --git a/runtime/native/dalvik_system_DexFile.h b/runtime/native/dalvik_system_DexFile.h
index 77d219d..c22b83d 100644
--- a/runtime/native/dalvik_system_DexFile.h
+++ b/runtime/native/dalvik_system_DexFile.h
@@ -20,7 +20,9 @@
 #include <jni.h>
 #include <unistd.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 constexpr size_t kOatFileIndex = 0;
 constexpr size_t kDexFileIndexStart = 1;
diff --git a/runtime/native/dalvik_system_VMDebug.cc b/runtime/native/dalvik_system_VMDebug.cc
index 3653a83..137b04f 100644
--- a/runtime/native/dalvik_system_VMDebug.cc
+++ b/runtime/native/dalvik_system_VMDebug.cc
@@ -51,7 +51,7 @@
 #include "thread-inl.h"
 #include "trace.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static jobjectArray VMDebug_getVmFeatureList(JNIEnv* env, jclass) {
   ScopedObjectAccess soa(Thread::ForEnv(env));
@@ -90,7 +90,7 @@
 
 static void VMDebug_startMethodTracingFd(JNIEnv* env,
                                          jclass,
-                                         jstring javaTraceFilename ATTRIBUTE_UNUSED,
+                                         [[maybe_unused]] jstring javaTraceFilename,
                                          jint javaFd,
                                          jint bufferSize,
                                          jint flags,
@@ -117,9 +117,8 @@
   }
 
   // Ignore the traceFilename.
-  Trace::TraceOutputMode outputMode = streamingOutput
-                                          ? Trace::TraceOutputMode::kStreaming
-                                          : Trace::TraceOutputMode::kFile;
+  TraceOutputMode outputMode =
+      streamingOutput ? TraceOutputMode::kStreaming : TraceOutputMode::kFile;
   Trace::Start(fd,
                bufferSize,
                flags,
@@ -138,7 +137,7 @@
   Trace::Start(traceFilename.c_str(),
                bufferSize,
                flags,
-               Trace::TraceOutputMode::kFile,
+               TraceOutputMode::kFile,
                samplingEnabled ? Trace::TraceMode::kSampling : Trace::TraceMode::kMethodTracing,
                intervalUs);
 }
diff --git a/runtime/native/dalvik_system_VMDebug.h b/runtime/native/dalvik_system_VMDebug.h
index b7eb8a8..6d53fbe 100644
--- a/runtime/native/dalvik_system_VMDebug.h
+++ b/runtime/native/dalvik_system_VMDebug.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_dalvik_system_VMDebug(JNIEnv* env);
 
diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc
index 9e2e8b9..593b98d 100644
--- a/runtime/native/dalvik_system_VMRuntime.cc
+++ b/runtime/native/dalvik_system_VMRuntime.cc
@@ -66,7 +66,7 @@
 #include "thread-inl.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -237,8 +237,8 @@
   return down_cast<JNIEnvExt*>(env)->GetVm()->IsCheckJniEnabled() ? JNI_TRUE : JNI_FALSE;
 }
 
-static jint VMRuntime_getSdkVersionNative(JNIEnv* env ATTRIBUTE_UNUSED,
-                                          jclass klass ATTRIBUTE_UNUSED,
+static jint VMRuntime_getSdkVersionNative([[maybe_unused]] JNIEnv* env,
+                                          [[maybe_unused]] jclass klass,
                                           jint default_sdk_version) {
   return android::base::GetIntProperty("ro.build.version.sdk",
                                        default_sdk_version);
@@ -267,10 +267,13 @@
     return;
   }
   std::set<uint64_t> disabled_compat_changes_set;
-  int length = env->GetArrayLength(disabled_compat_changes);
-  jlong* elements = env->GetLongArrayElements(disabled_compat_changes, /*isCopy*/nullptr);
-  for (int i = 0; i < length; i++) {
-    disabled_compat_changes_set.insert(static_cast<uint64_t>(elements[i]));
+  {
+    ScopedObjectAccess soa(env);
+    ObjPtr<mirror::LongArray> array = soa.Decode<mirror::LongArray>(disabled_compat_changes);
+    int length = array->GetLength();
+    for (int i = 0; i < length; i++) {
+      disabled_compat_changes_set.insert(static_cast<uint64_t>(array->Get(i)));
+    }
   }
   Runtime::Current()->GetCompatFramework().SetDisabledCompatChanges(disabled_compat_changes_set);
 }
@@ -355,8 +358,7 @@
   Runtime::Current()->GetHeap()->GetTaskProcessor()->RunAllTasks(Thread::ForEnv(env));
 }
 
-static void VMRuntime_preloadDexCaches(JNIEnv* env ATTRIBUTE_UNUSED, jobject) {
-}
+static void VMRuntime_preloadDexCaches([[maybe_unused]] JNIEnv* env, jobject) {}
 
 /*
  * This is called by the framework after it loads a code path on behalf of the app.
@@ -364,7 +366,7 @@
  * for more precise telemetry (e.g. is the split apk odex up to date?) and debugging.
  */
 static void VMRuntime_registerAppInfo(JNIEnv* env,
-                                      jclass clazz ATTRIBUTE_UNUSED,
+                                      [[maybe_unused]] jclass clazz,
                                       jstring package_name,
                                       jstring cur_profile_file,
                                       jstring ref_profile_file,
@@ -418,8 +420,8 @@
   return env->NewStringUTF(GetInstructionSetString(kRuntimeISA));
 }
 
-static void VMRuntime_setSystemDaemonThreadPriority(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                    jclass klass ATTRIBUTE_UNUSED) {
+static void VMRuntime_setSystemDaemonThreadPriority([[maybe_unused]] JNIEnv* env,
+                                                    [[maybe_unused]] jclass klass) {
 #ifdef ART_TARGET_ANDROID
   Thread* self = Thread::Current();
   DCHECK(self != nullptr);
@@ -435,14 +437,14 @@
 #endif
 }
 
-static void VMRuntime_setDedupeHiddenApiWarnings(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                 jclass klass ATTRIBUTE_UNUSED,
+static void VMRuntime_setDedupeHiddenApiWarnings([[maybe_unused]] JNIEnv* env,
+                                                 [[maybe_unused]] jclass klass,
                                                  jboolean dedupe) {
   Runtime::Current()->SetDedupeHiddenApiWarnings(dedupe);
 }
 
 static void VMRuntime_setProcessPackageName(JNIEnv* env,
-                                            jclass klass ATTRIBUTE_UNUSED,
+                                            [[maybe_unused]] jclass klass,
                                             jstring java_package_name) {
   ScopedUtfChars package_name(env, java_package_name);
   Runtime::Current()->SetProcessPackageName(package_name.c_str());
@@ -453,8 +455,7 @@
   Runtime::Current()->SetProcessDataDirectory(data_dir.c_str());
 }
 
-static void VMRuntime_bootCompleted(JNIEnv* env ATTRIBUTE_UNUSED,
-                                    jclass klass ATTRIBUTE_UNUSED) {
+static void VMRuntime_bootCompleted([[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass klass) {
   jit::Jit* jit = Runtime::Current()->GetJit();
   if (jit != nullptr) {
     jit->BootCompleted();
@@ -482,14 +483,14 @@
   }
 };
 
-static void VMRuntime_resetJitCounters(JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+static void VMRuntime_resetJitCounters(JNIEnv* env, [[maybe_unused]] jclass klass) {
   ScopedObjectAccess soa(env);
   ClearJitCountersVisitor visitor;
   Runtime::Current()->GetClassLinker()->VisitClasses(&visitor);
 }
 
 static jboolean VMRuntime_isValidClassLoaderContext(JNIEnv* env,
-                                                    jclass klass ATTRIBUTE_UNUSED,
+                                                    [[maybe_unused]] jclass klass,
                                                     jstring jencoded_class_loader_context) {
   if (UNLIKELY(jencoded_class_loader_context == nullptr)) {
     ScopedFastNativeObjectAccess soa(env);
@@ -500,7 +501,7 @@
   return ClassLoaderContext::IsValidEncoding(encoded_class_loader_context.c_str());
 }
 
-static jobject VMRuntime_getBaseApkOptimizationInfo(JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+static jobject VMRuntime_getBaseApkOptimizationInfo(JNIEnv* env, [[maybe_unused]] jclass klass) {
   AppInfo* app_info = Runtime::Current()->GetAppInfo();
   DCHECK(app_info != nullptr);
 
@@ -589,6 +590,15 @@
 };
 
 void register_dalvik_system_VMRuntime(JNIEnv* env) {
+  if (Runtime::Current()->GetTargetSdkVersion() <= static_cast<uint32_t>(SdkVersion::kU)) {
+    real_register_dalvik_system_VMRuntime(env);
+  } else {
+    Runtime::Current()->Abort(
+        "Call to internal function 'register_dalvik_system_VMRuntime' is not allowed");
+  }
+}
+
+void real_register_dalvik_system_VMRuntime(JNIEnv* env) {
   REGISTER_NATIVE_METHODS("dalvik/system/VMRuntime");
 }
 
diff --git a/runtime/native/dalvik_system_VMRuntime.h b/runtime/native/dalvik_system_VMRuntime.h
index 795caa5..3876a60 100644
--- a/runtime/native/dalvik_system_VMRuntime.h
+++ b/runtime/native/dalvik_system_VMRuntime.h
@@ -19,9 +19,17 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
 
-void register_dalvik_system_VMRuntime(JNIEnv* env);
+namespace art HIDDEN {
+
+// TODO(260881207): register_dalvik_system_VMRuntime should be HIDDEN,
+// but some apps fail to launch (e.g. b/319255249).
+// The function is still exported for now, but it does a targetSdk check
+// and aborts for SdkVersion after U. Libart code should use
+// `real_register...` until exported function is removed.
+EXPORT void register_dalvik_system_VMRuntime(JNIEnv* env);
+void real_register_dalvik_system_VMRuntime(JNIEnv* env);
 
 }  // namespace art
 
diff --git a/runtime/native/dalvik_system_VMStack.cc b/runtime/native/dalvik_system_VMStack.cc
index 71078c9..599bdb9 100644
--- a/runtime/native/dalvik_system_VMStack.cc
+++ b/runtime/native/dalvik_system_VMStack.cc
@@ -32,7 +32,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template <typename T,
           typename ResultT =
@@ -45,35 +45,30 @@
   ObjPtr<mirror::Object> decoded_peer = soa.Decode<mirror::Object>(peer);
   if (decoded_peer == soa.Self()->GetPeer()) {
     trace = fn(soa.Self(), soa);
-  } else {
-    // Never allow suspending the heap task thread since it may deadlock if allocations are
-    // required for the stack trace.
-    Thread* heap_task_thread =
-        Runtime::Current()->GetHeap()->GetTaskProcessor()->GetRunningThread();
-    // heap_task_thread could be null if the daemons aren't yet started.
-    if (heap_task_thread != nullptr && decoded_peer == heap_task_thread->GetPeerFromOtherThread()) {
-      return nullptr;
-    }
-    // Suspend thread to build stack trace.
-    ScopedThreadSuspension sts(soa.Self(), ThreadState::kNative);
-    ThreadList* thread_list = Runtime::Current()->GetThreadList();
-    bool timed_out;
-    Thread* thread = thread_list->SuspendThreadByPeer(peer,
-                                                      SuspendReason::kInternal,
-                                                      &timed_out);
-    if (thread != nullptr) {
-      // Must be runnable to create returned array.
+    return trace;
+  }
+  // Suspend thread to build stack trace.
+  ScopedThreadSuspension sts(soa.Self(), ThreadState::kNative);
+  Runtime* runtime = Runtime::Current();
+  ThreadList* thread_list = runtime->GetThreadList();
+  Thread* thread = thread_list->SuspendThreadByPeer(peer, SuspendReason::kInternal);
+  if (thread != nullptr) {
+    // If we were asked for the HeapTaskDaemon's stack trace, we went ahead and suspended it.
+    // It's usually already in a suspended state anyway. But we should immediately give up and
+    // resume it, since we must be able to allocate while generating the stack trace.
+    if (!runtime->GetHeap()->GetTaskProcessor()->IsRunningThread(thread, /*wait=*/true)) {
       {
+        // Must be runnable to create returned array.
         ScopedObjectAccess soa2(soa.Self());
         trace = fn(thread, soa);
       }
-      // Restart suspended thread.
-      bool resumed = thread_list->Resume(thread, SuspendReason::kInternal);
-      DCHECK(resumed);
-    } else if (timed_out) {
-      LOG(ERROR) << "Trying to get thread's stack failed as the thread failed to suspend within a "
-          "generous timeout.";
+      // Else either thread is the HeapTaskDaemon, or we couldn't identify the thread yet. The
+      // HeapTaskDaemon can appear in enumerations before it is registered with the task
+      // processor, and we don't wait indefinitely, so there is a tiny chance of the latter.
     }
+    // Restart suspended thread.
+    bool resumed = thread_list->Resume(thread, SuspendReason::kInternal);
+    DCHECK(resumed);
   }
   return trace;
 }
diff --git a/runtime/native/dalvik_system_VMStack.h b/runtime/native/dalvik_system_VMStack.h
index 5638f99..c7a62ad 100644
--- a/runtime/native/dalvik_system_VMStack.h
+++ b/runtime/native/dalvik_system_VMStack.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_dalvik_system_VMStack(JNIEnv* env);
 
diff --git a/runtime/native/dalvik_system_ZygoteHooks.cc b/runtime/native/dalvik_system_ZygoteHooks.cc
index af0ee53..3af1978 100644
--- a/runtime/native/dalvik_system_ZygoteHooks.cc
+++ b/runtime/native/dalvik_system_ZygoteHooks.cc
@@ -36,8 +36,8 @@
 #include "nativehelper/jni_macros.h"
 #include "nativehelper/scoped_utf_chars.h"
 #include "non_debuggable_classes.h"
-#include "oat_file.h"
-#include "oat_file_manager.h"
+#include "oat/oat_file.h"
+#include "oat/oat_file_manager.h"
 #include "scoped_thread_state_change-inl.h"
 #include "stack.h"
 #include "startup_completed_task.h"
@@ -47,7 +47,7 @@
 
 #include <sys/resource.h>
 
-namespace art {
+namespace art HIDDEN {
 
 // Set to true to always determine the non-debuggable classes even if we would not allow a debugger
 // to actually attach.
@@ -187,8 +187,8 @@
 
   const bool safe_mode = (runtime_flags & DEBUG_ENABLE_SAFEMODE) != 0;
   if (safe_mode) {
-    // Only quicken oat files.
-    runtime->AddCompilerOption("--compiler-filter=quicken");
+    // Only verify oat files.
+    runtime->AddCompilerOption("--compiler-filter=verify");
     runtime->SetSafeMode(true);
     runtime_flags &= ~DEBUG_ENABLE_SAFEMODE;
   }
@@ -266,8 +266,8 @@
   Runtime::Current()->PostZygoteFork();
 }
 
-static void ZygoteHooks_nativePostForkSystemServer(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                   jclass klass ATTRIBUTE_UNUSED,
+static void ZygoteHooks_nativePostForkSystemServer([[maybe_unused]] JNIEnv* env,
+                                                   [[maybe_unused]] jclass klass,
                                                    jint runtime_flags) {
   // Reload the current flags first. In case we need to take actions based on them.
   Runtime::Current()->ReloadAllFlags(__FUNCTION__);
@@ -366,7 +366,7 @@
 
   // Update tracing.
   if (Trace::GetMethodTracingMode() != TracingMode::kTracingInactive) {
-    Trace::TraceOutputMode output_mode = Trace::GetOutputMode();
+    TraceOutputMode output_mode = Trace::GetOutputMode();
     Trace::TraceMode trace_mode = Trace::GetMode();
     size_t buffer_size = Trace::GetBufferSize();
     int flags = Trace::GetFlags();
@@ -377,7 +377,7 @@
 
     // Only restart if it was streaming mode.
     // TODO: Expose buffer size, so we can also do file mode.
-    if (output_mode == Trace::TraceOutputMode::kStreaming) {
+    if (output_mode == TraceOutputMode::kStreaming) {
       static constexpr size_t kMaxProcessNameLength = 100;
       char name_buf[kMaxProcessNameLength] = {};
       int rc = pthread_getname_np(pthread_self(), name_buf, kMaxProcessNameLength);
@@ -443,18 +443,18 @@
   }
 }
 
-static void ZygoteHooks_startZygoteNoThreadCreation(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                    jclass klass ATTRIBUTE_UNUSED) {
+static void ZygoteHooks_startZygoteNoThreadCreation([[maybe_unused]] JNIEnv* env,
+                                                    [[maybe_unused]] jclass klass) {
   Runtime::Current()->SetZygoteNoThreadSection(true);
 }
 
-static void ZygoteHooks_stopZygoteNoThreadCreation(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                   jclass klass ATTRIBUTE_UNUSED) {
+static void ZygoteHooks_stopZygoteNoThreadCreation([[maybe_unused]] JNIEnv* env,
+                                                   [[maybe_unused]] jclass klass) {
   Runtime::Current()->SetZygoteNoThreadSection(false);
 }
 
-static jboolean ZygoteHooks_nativeZygoteLongSuspendOk(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                    jclass klass ATTRIBUTE_UNUSED) {
+static jboolean ZygoteHooks_nativeZygoteLongSuspendOk([[maybe_unused]] JNIEnv* env,
+                                                      [[maybe_unused]] jclass klass) {
   // Indefinite thread suspensions are not OK if we're supposed to be JIT-compiling for other
   // processes.  We only care about JIT compilation that affects other processes.  The zygote
   // itself doesn't run appreciable amounts of Java code when running single-threaded, so
@@ -466,7 +466,6 @@
   return (isJitZygote || explicitlyDisabled) ? JNI_FALSE : JNI_TRUE;
 }
 
-
 static JNINativeMethod gMethods[] = {
   NATIVE_METHOD(ZygoteHooks, nativePreFork, "()J"),
   NATIVE_METHOD(ZygoteHooks, nativePostZygoteFork, "()V"),
diff --git a/runtime/native/dalvik_system_ZygoteHooks.h b/runtime/native/dalvik_system_ZygoteHooks.h
index ca0658d..fbd14c0 100644
--- a/runtime/native/dalvik_system_ZygoteHooks.h
+++ b/runtime/native/dalvik_system_ZygoteHooks.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_dalvik_system_ZygoteHooks(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc
index 5e54f85..1dc74e0 100644
--- a/runtime/native/java_lang_Class.cc
+++ b/runtime/native/java_lang_Class.cc
@@ -56,7 +56,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static std::function<hiddenapi::AccessContext()> GetHiddenapiAccessContextFunction(Thread* self) {
   return [=]() REQUIRES_SHARED(Locks::mutator_lock_) {
@@ -681,22 +681,46 @@
   return mirror::Class::GetInnerClassFlags(klass, defaultValue);
 }
 
-static jstring Class_getInnerClassName(JNIEnv* env, jobject javaThis) {
+static jstring Class_getSimpleNameNative(JNIEnv* env, jobject javaThis) {
   ScopedFastNativeObjectAccess soa(env);
-  StackHandleScope<1> hs(soa.Self());
+  StackHandleScope<3> hs(soa.Self());
   Handle<mirror::Class> klass(hs.NewHandle(DecodeClass(soa, javaThis)));
   if (klass->IsObsoleteObject()) {
     ThrowRuntimeException("Obsolete Object!");
     return nullptr;
   }
-  if (klass->IsProxyClass() || klass->GetDexCache() == nullptr) {
+  if (!klass->IsProxyClass() && klass->GetDexCache() != nullptr) {
+    ObjPtr<mirror::String> class_name = nullptr;
+    if (annotations::GetInnerClass(klass, &class_name)) {
+      if (class_name == nullptr) {  // Anonymous class
+        ObjPtr<mirror::Class> j_l_String =
+            WellKnownClasses::java_lang_String_EMPTY->GetDeclaringClass();
+        ObjPtr<mirror::Object> empty_string =
+            WellKnownClasses::java_lang_String_EMPTY->GetObject(j_l_String);
+        DCHECK(empty_string != nullptr);
+        return soa.AddLocalReference<jstring>(empty_string);
+      }
+      Handle<mirror::String> h_inner_name(hs.NewHandle<mirror::String>(class_name));
+      if (annotations::GetDeclaringClass(klass) != nullptr ||   // member class
+          annotations::GetEnclosingMethod(klass) != nullptr) {  // local class
+        return soa.AddLocalReference<jstring>(h_inner_name.Get());
+      }
+    }
+  }
+
+  Handle<mirror::String> h_name(hs.NewHandle<mirror::String>(mirror::Class::ComputeName(klass)));
+  if (h_name == nullptr) {
     return nullptr;
   }
-  ObjPtr<mirror::String> class_name = nullptr;
-  if (!annotations::GetInnerClass(klass, &class_name)) {
-    return nullptr;
+  int32_t dot_index = h_name->LastIndexOf('.');
+  if (dot_index < 0) {
+    return soa.AddLocalReference<jstring>(h_name.Get());
   }
-  return soa.AddLocalReference<jstring>(class_name);
+  int32_t start_index = dot_index + 1;
+  int32_t length = h_name->GetLength() - start_index;
+  gc::AllocatorType allocator_type = Runtime::Current()->GetHeap()->GetCurrentAllocator();
+  return soa.AddLocalReference<jstring>(
+      mirror::String::AllocFromString(soa.Self(), length, h_name, start_index, allocator_type));
 }
 
 static jobjectArray Class_getSignatureAnnotation(JNIEnv* env, jobject javaThis) {
@@ -971,7 +995,6 @@
   FAST_NATIVE_METHOD(Class, getEnclosingConstructorNative, "()Ljava/lang/reflect/Constructor;"),
   FAST_NATIVE_METHOD(Class, getEnclosingMethodNative, "()Ljava/lang/reflect/Method;"),
   FAST_NATIVE_METHOD(Class, getInnerClassFlags, "(I)I"),
-  FAST_NATIVE_METHOD(Class, getInnerClassName, "()Ljava/lang/String;"),
   FAST_NATIVE_METHOD(Class, getInterfacesInternal, "()[Ljava/lang/Class;"),
   FAST_NATIVE_METHOD(Class, getPrimitiveClass, "(Ljava/lang/String;)Ljava/lang/Class;"),
   FAST_NATIVE_METHOD(Class, getNameNative, "()Ljava/lang/String;"),
@@ -981,6 +1004,7 @@
   FAST_NATIVE_METHOD(Class, getPublicDeclaredFields, "()[Ljava/lang/reflect/Field;"),
   FAST_NATIVE_METHOD(Class, getRecordAnnotationElement, "(Ljava/lang/String;Ljava/lang/Class;)[Ljava/lang/Object;"),
   FAST_NATIVE_METHOD(Class, getSignatureAnnotation, "()[Ljava/lang/String;"),
+  FAST_NATIVE_METHOD(Class, getSimpleNameNative, "()Ljava/lang/String;"),
   FAST_NATIVE_METHOD(Class, isAnonymousClass, "()Z"),
   FAST_NATIVE_METHOD(Class, isDeclaredAnnotationPresent, "(Ljava/lang/Class;)Z"),
   FAST_NATIVE_METHOD(Class, isRecord0, "()Z"),
diff --git a/runtime/native/java_lang_Class.h b/runtime/native/java_lang_Class.h
index 8f769c3..aaa9b66 100644
--- a/runtime/native/java_lang_Class.h
+++ b/runtime/native/java_lang_Class.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_Class(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_Object.cc b/runtime/native/java_lang_Object.cc
index 8fc10d1..5649b2c 100644
--- a/runtime/native/java_lang_Object.cc
+++ b/runtime/native/java_lang_Object.cc
@@ -24,7 +24,7 @@
 #include "native_util.h"
 #include "scoped_fast_native_object_access-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static jobject Object_internalClone(JNIEnv* env, jobject java_this) {
   ScopedFastNativeObjectAccess soa(env);
diff --git a/runtime/native/java_lang_Object.h b/runtime/native/java_lang_Object.h
index c860571..1ea2c05 100644
--- a/runtime/native/java_lang_Object.h
+++ b/runtime/native/java_lang_Object.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_Object(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_StackStreamFactory.cc b/runtime/native/java_lang_StackStreamFactory.cc
index f876c10..24d9030 100644
--- a/runtime/native/java_lang_StackStreamFactory.cc
+++ b/runtime/native/java_lang_StackStreamFactory.cc
@@ -23,7 +23,7 @@
 #include "scoped_fast_native_object_access-inl.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static jobject StackStreamFactory_nativeGetStackAnchor(JNIEnv* env, jclass) {
   ScopedFastNativeObjectAccess soa(env);
diff --git a/runtime/native/java_lang_StackStreamFactory.h b/runtime/native/java_lang_StackStreamFactory.h
index 2216871..31b3c95 100644
--- a/runtime/native/java_lang_StackStreamFactory.h
+++ b/runtime/native/java_lang_StackStreamFactory.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_StackStreamFactory(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_String.cc b/runtime/native/java_lang_String.cc
index f70a188..1ba0028 100644
--- a/runtime/native/java_lang_String.cc
+++ b/runtime/native/java_lang_String.cc
@@ -31,7 +31,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "verify_object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static jchar String_charAt(JNIEnv* env, jobject java_this, jint index) {
   ScopedFastNativeObjectAccess soa(env);
diff --git a/runtime/native/java_lang_String.h b/runtime/native/java_lang_String.h
index 357eb3d..a78fdce 100644
--- a/runtime/native/java_lang_String.h
+++ b/runtime/native/java_lang_String.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_String(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_StringFactory.cc b/runtime/native/java_lang_StringFactory.cc
index 2fbebc0..e6c03db 100644
--- a/runtime/native/java_lang_StringFactory.cc
+++ b/runtime/native/java_lang_StringFactory.cc
@@ -28,7 +28,7 @@
 #include "scoped_fast_native_object_access-inl.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static jstring StringFactory_newStringFromBytes(JNIEnv* env, jclass, jbyteArray java_data,
                                                 jint high, jint offset, jint byte_count) {
diff --git a/runtime/native/java_lang_StringFactory.h b/runtime/native/java_lang_StringFactory.h
index c476ad3..cdc19df 100644
--- a/runtime/native/java_lang_StringFactory.h
+++ b/runtime/native/java_lang_StringFactory.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_StringFactory(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_System.cc b/runtime/native/java_lang_System.cc
index 63cbd2c..203d98d 100644
--- a/runtime/native/java_lang_System.cc
+++ b/runtime/native/java_lang_System.cc
@@ -29,7 +29,7 @@
 #include "native_util.h"
 #include "scoped_fast_native_object_access-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 /*
  * We make guarantees about the atomicity of accesses to primitive variables.  These guarantees
diff --git a/runtime/native/java_lang_System.h b/runtime/native/java_lang_System.h
index e371fa5..a529727 100644
--- a/runtime/native/java_lang_System.h
+++ b/runtime/native/java_lang_System.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_System(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_Thread.cc b/runtime/native/java_lang_Thread.cc
index 570c554..65e3009 100644
--- a/runtime/native/java_lang_Thread.cc
+++ b/runtime/native/java_lang_Thread.cc
@@ -29,7 +29,7 @@
 #include "thread_list.h"
 #include "verify_object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static jobject Thread_currentThread(JNIEnv* env, jclass) {
   ScopedFastNativeObjectAccess soa(env);
@@ -147,11 +147,8 @@
   // thread list lock to avoid this, as setting the thread name causes mutator to lock/unlock
   // in the DDMS send code.
   ThreadList* thread_list = Runtime::Current()->GetThreadList();
-  bool timed_out;
   // Take suspend thread lock to avoid races with threads trying to suspend this one.
-  Thread* thread = thread_list->SuspendThreadByPeer(peer,
-                                                    SuspendReason::kInternal,
-                                                    &timed_out);
+  Thread* thread = thread_list->SuspendThreadByPeer(peer, SuspendReason::kInternal);
   if (thread != nullptr) {
     {
       ScopedObjectAccess soa(env);
@@ -159,9 +156,6 @@
     }
     bool resumed = thread_list->Resume(thread, SuspendReason::kInternal);
     DCHECK(resumed);
-  } else if (timed_out) {
-    LOG(ERROR) << "Trying to set thread name to '" << name.c_str() << "' failed as the thread "
-        "failed to suspend within a generous timeout.";
   }
 }
 
diff --git a/runtime/native/java_lang_Thread.h b/runtime/native/java_lang_Thread.h
index 7700ce2..ef880a9 100644
--- a/runtime/native/java_lang_Thread.h
+++ b/runtime/native/java_lang_Thread.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_Thread(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_Throwable.cc b/runtime/native/java_lang_Throwable.cc
index b89e287..091ad03 100644
--- a/runtime/native/java_lang_Throwable.cc
+++ b/runtime/native/java_lang_Throwable.cc
@@ -23,7 +23,7 @@
 #include "scoped_fast_native_object_access-inl.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static jobject Throwable_nativeFillInStackTrace(JNIEnv* env, jclass) {
   ScopedFastNativeObjectAccess soa(env);
diff --git a/runtime/native/java_lang_Throwable.h b/runtime/native/java_lang_Throwable.h
index f9aea84..6758e48 100644
--- a/runtime/native/java_lang_Throwable.h
+++ b/runtime/native/java_lang_Throwable.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_Throwable(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_VMClassLoader.cc b/runtime/native/java_lang_VMClassLoader.cc
index b9c72b8..ba1fde0 100644
--- a/runtime/native/java_lang_VMClassLoader.cc
+++ b/runtime/native/java_lang_VMClassLoader.cc
@@ -38,7 +38,7 @@
 #include "thread-inl.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // A class so we can be friends with ClassLinker and access internal methods.
 class VMClassLoader {
@@ -134,7 +134,7 @@
   ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
   const std::vector<const DexFile*>& path = class_linker->GetBootClassPath();
   auto is_base_dex = [](const DexFile* dex_file) {
-    return !DexFileLoader::IsMultiDexLocation(dex_file->GetLocation().c_str());
+    return !DexFileLoader::IsMultiDexLocation(dex_file->GetLocation());
   };
   size_t jar_count = std::count_if(path.begin(), path.end(), is_base_dex);
 
diff --git a/runtime/native/java_lang_VMClassLoader.h b/runtime/native/java_lang_VMClassLoader.h
index bf8d94f..adf0c0a 100644
--- a/runtime/native/java_lang_VMClassLoader.h
+++ b/runtime/native/java_lang_VMClassLoader.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_VMClassLoader(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_invoke_MethodHandle.cc b/runtime/native/java_lang_invoke_MethodHandle.cc
index 5309a28..819656f 100644
--- a/runtime/native/java_lang_invoke_MethodHandle.cc
+++ b/runtime/native/java_lang_invoke_MethodHandle.cc
@@ -27,7 +27,7 @@
 #include "native_util.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static void MethodHandle_invokeExactWithFrame(JNIEnv* env, jobject thiz, jobject arguments) {
   ScopedObjectAccess soa(env);
diff --git a/runtime/native/java_lang_invoke_MethodHandle.h b/runtime/native/java_lang_invoke_MethodHandle.h
index 1f38ac7..f46f324 100644
--- a/runtime/native/java_lang_invoke_MethodHandle.h
+++ b/runtime/native/java_lang_invoke_MethodHandle.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_invoke_MethodHandle(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_invoke_MethodHandleImpl.cc b/runtime/native/java_lang_invoke_MethodHandleImpl.cc
index 00ce01f..ccd3370 100644
--- a/runtime/native/java_lang_invoke_MethodHandleImpl.cc
+++ b/runtime/native/java_lang_invoke_MethodHandleImpl.cc
@@ -28,7 +28,7 @@
 #include "runtime.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static jobject MethodHandleImpl_getMemberInternal(JNIEnv* env, jobject thiz) {
   ScopedObjectAccess soa(env);
diff --git a/runtime/native/java_lang_invoke_MethodHandleImpl.h b/runtime/native/java_lang_invoke_MethodHandleImpl.h
index 0e50371..49d4c2c 100644
--- a/runtime/native/java_lang_invoke_MethodHandleImpl.h
+++ b/runtime/native/java_lang_invoke_MethodHandleImpl.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_invoke_MethodHandleImpl(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_ref_FinalizerReference.cc b/runtime/native/java_lang_ref_FinalizerReference.cc
index 535b243..52f6f73 100644
--- a/runtime/native/java_lang_ref_FinalizerReference.cc
+++ b/runtime/native/java_lang_ref_FinalizerReference.cc
@@ -26,7 +26,7 @@
 #include "native_util.h"
 #include "scoped_fast_native_object_access-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static jboolean FinalizerReference_makeCircularListIfUnenqueued(JNIEnv* env, jobject javaThis) {
   ScopedFastNativeObjectAccess soa(env);
diff --git a/runtime/native/java_lang_ref_FinalizerReference.h b/runtime/native/java_lang_ref_FinalizerReference.h
index 848a7ad..13d1a12 100644
--- a/runtime/native/java_lang_ref_FinalizerReference.h
+++ b/runtime/native/java_lang_ref_FinalizerReference.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_ref_FinalizerReference(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_ref_Reference.cc b/runtime/native/java_lang_ref_Reference.cc
index 8b5635d..4c411c8 100644
--- a/runtime/native/java_lang_ref_Reference.cc
+++ b/runtime/native/java_lang_ref_Reference.cc
@@ -26,7 +26,7 @@
 #include "native_util.h"
 #include "scoped_fast_native_object_access-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static jobject Reference_getReferent(JNIEnv* env, jobject javaThis) {
   ScopedFastNativeObjectAccess soa(env);
@@ -52,16 +52,19 @@
     return JNI_FALSE;
   }
   // Explicitly handle the case in which referent is a from-space pointer.  Don't use a
-  // read-barrier, since that could easily mark an object we no longer need and, since it
-  // creates new gray objects, may not be safe without blocking.
+  // read-barrier, since that could easily mark an object we no longer need and, since it creates
+  // new gray objects, may not be safe without blocking.
   //
-  // ConcurrentCopying::Copy ensure that whenever a pointer to a to_space object is published,
-  // the forwarding pointer is also visible. We need that guarantee to ensure that if referent
-  // == other and referent is in from-space, then referent has a forwarding pointer. In order to
-  // use that guarantee, we need to ensure that the forwarding pointer is loaded after we
-  // retrieved other. Hence this fence:
+  // Assume we're post flip in a GC. 'other' will always be a to-space reference. Thus the only
+  // remaining case in which we should return true is when 'referent' still points to from-space.
+  // ConcurrentCopying::Copy ensures that whenever a pointer to a to-space object is published,
+  // the forwarding pointer is also visible. Thus if 'other' and 'javaThis' refer to the same
+  // object, and we can ensure that the read of the forwarding pointer is ordered after the read
+  // of other, which ensured the forwarding pointer was set, then we're guaranteed to see the
+  // correct forwarding pointer, which should then match 'other'. This fence ensures that the
+  // forwarding pointer read is ordered with respect to the access to 'other':
   atomic_thread_fence(std::memory_order_acquire);
-  // Note: On ARM, the above could be replaced by an asm fake-dependency hack to make
+  // Note: On ARM and RISC-V, the above could be replaced by an asm fake-dependency hack to make
   // referent appear to depend on other. That would be faster and uglier.
   return gc::collector::ConcurrentCopying::GetFwdPtrUnchecked(referent.Ptr()) == other.Ptr() ?
       JNI_TRUE : JNI_FALSE;
diff --git a/runtime/native/java_lang_ref_Reference.h b/runtime/native/java_lang_ref_Reference.h
index 0cbf116..cc75069 100644
--- a/runtime/native/java_lang_ref_Reference.h
+++ b/runtime/native/java_lang_ref_Reference.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_ref_Reference(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_reflect_Array.cc b/runtime/native/java_lang_reflect_Array.cc
index ff94593..9ac6e61 100644
--- a/runtime/native/java_lang_reflect_Array.cc
+++ b/runtime/native/java_lang_reflect_Array.cc
@@ -29,7 +29,7 @@
 #include "native_util.h"
 #include "scoped_fast_native_object_access-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static jobject Array_createMultiArray(
     JNIEnv* env, jclass, jclass javaElementClass, jintArray javaDimArray) {
diff --git a/runtime/native/java_lang_reflect_Array.h b/runtime/native/java_lang_reflect_Array.h
index 805bf79..35b87b7 100644
--- a/runtime/native/java_lang_reflect_Array.h
+++ b/runtime/native/java_lang_reflect_Array.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_reflect_Array(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_reflect_Constructor.cc b/runtime/native/java_lang_reflect_Constructor.cc
index 4b2cc43..f9278ab 100644
--- a/runtime/native/java_lang_reflect_Constructor.cc
+++ b/runtime/native/java_lang_reflect_Constructor.cc
@@ -34,7 +34,7 @@
 #include "reflection.h"
 #include "scoped_fast_native_object_access-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static jobjectArray Constructor_getExceptionTypes(JNIEnv* env, jobject javaMethod) {
   ScopedFastNativeObjectAccess soa(env);
@@ -120,11 +120,13 @@
   return javaReceiver;
 }
 
-static jobject Constructor_newInstanceFromSerialization(JNIEnv* env, jclass unused ATTRIBUTE_UNUSED,
-                                                        jclass ctorClass, jclass allocClass) {
-    jmethodID ctor = env->GetMethodID(ctorClass, "<init>", "()V");
-    DCHECK(ctor != nullptr);
-    return env->NewObject(allocClass, ctor);
+static jobject Constructor_newInstanceFromSerialization(JNIEnv* env,
+                                                        [[maybe_unused]] jclass unused,
+                                                        jclass ctorClass,
+                                                        jclass allocClass) {
+  jmethodID ctor = env->GetMethodID(ctorClass, "<init>", "()V");
+  DCHECK(ctor != nullptr);
+  return env->NewObject(allocClass, ctor);
 }
 
 static JNINativeMethod gMethods[] = {
diff --git a/runtime/native/java_lang_reflect_Constructor.h b/runtime/native/java_lang_reflect_Constructor.h
index 7baae97..9c36ef4 100644
--- a/runtime/native/java_lang_reflect_Constructor.h
+++ b/runtime/native/java_lang_reflect_Constructor.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_reflect_Constructor(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_reflect_Executable.cc b/runtime/native/java_lang_reflect_Executable.cc
index 87c9f6c..3f3b648 100644
--- a/runtime/native/java_lang_reflect_Executable.cc
+++ b/runtime/native/java_lang_reflect_Executable.cc
@@ -35,7 +35,7 @@
 #include "scoped_fast_native_object_access-inl.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
diff --git a/runtime/native/java_lang_reflect_Executable.h b/runtime/native/java_lang_reflect_Executable.h
index 0cfed62..05b0a23 100644
--- a/runtime/native/java_lang_reflect_Executable.h
+++ b/runtime/native/java_lang_reflect_Executable.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_reflect_Executable(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_reflect_Field.cc b/runtime/native/java_lang_reflect_Field.cc
index f2603d4..622b514 100644
--- a/runtime/native/java_lang_reflect_Field.cc
+++ b/runtime/native/java_lang_reflect_Field.cc
@@ -37,7 +37,7 @@
 #include "scoped_fast_native_object_access-inl.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
diff --git a/runtime/native/java_lang_reflect_Field.h b/runtime/native/java_lang_reflect_Field.h
index 1739711..b5368b9 100644
--- a/runtime/native/java_lang_reflect_Field.h
+++ b/runtime/native/java_lang_reflect_Field.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_reflect_Field(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_reflect_Method.cc b/runtime/native/java_lang_reflect_Method.cc
index 5f02ad0..8cbc070 100644
--- a/runtime/native/java_lang_reflect_Method.cc
+++ b/runtime/native/java_lang_reflect_Method.cc
@@ -32,7 +32,7 @@
 #include "reflection.h"
 #include "scoped_fast_native_object_access-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static jobject Method_getDefaultValue(JNIEnv* env, jobject javaMethod) {
   ScopedFastNativeObjectAccess soa(env);
diff --git a/runtime/native/java_lang_reflect_Method.h b/runtime/native/java_lang_reflect_Method.h
index 3a93cd0..4b48ced 100644
--- a/runtime/native/java_lang_reflect_Method.h
+++ b/runtime/native/java_lang_reflect_Method.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_reflect_Method(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_reflect_Parameter.cc b/runtime/native/java_lang_reflect_Parameter.cc
index 263a567..fe9e4e3 100644
--- a/runtime/native/java_lang_reflect_Parameter.cc
+++ b/runtime/native/java_lang_reflect_Parameter.cc
@@ -28,7 +28,7 @@
 #include "native_util.h"
 #include "scoped_fast_native_object_access-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
diff --git a/runtime/native/java_lang_reflect_Parameter.h b/runtime/native/java_lang_reflect_Parameter.h
index f6322b1..97873fb 100644
--- a/runtime/native/java_lang_reflect_Parameter.h
+++ b/runtime/native/java_lang_reflect_Parameter.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_reflect_Parameter(JNIEnv* env);
 
diff --git a/runtime/native/java_lang_reflect_Proxy.cc b/runtime/native/java_lang_reflect_Proxy.cc
index f723ed2..a89f827 100644
--- a/runtime/native/java_lang_reflect_Proxy.cc
+++ b/runtime/native/java_lang_reflect_Proxy.cc
@@ -27,7 +27,7 @@
 #include "scoped_fast_native_object_access-inl.h"
 #include "verify_object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static jclass Proxy_generateProxy(JNIEnv* env, jclass, jstring name, jobjectArray interfaces,
                                   jobject loader, jobjectArray methods, jobjectArray throws) {
diff --git a/runtime/native/java_lang_reflect_Proxy.h b/runtime/native/java_lang_reflect_Proxy.h
index e25f0f7..e6b3f24 100644
--- a/runtime/native/java_lang_reflect_Proxy.h
+++ b/runtime/native/java_lang_reflect_Proxy.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_lang_reflect_Proxy(JNIEnv* env);
 
diff --git a/runtime/native/java_util_concurrent_atomic_AtomicLong.cc b/runtime/native/java_util_concurrent_atomic_AtomicLong.cc
index fa288ed..3f4c609 100644
--- a/runtime/native/java_util_concurrent_atomic_AtomicLong.cc
+++ b/runtime/native/java_util_concurrent_atomic_AtomicLong.cc
@@ -24,7 +24,7 @@
 #include "jni/jni_internal.h"
 #include "native_util.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static jboolean AtomicLong_VMSupportsCS8(JNIEnv*, jclass) {
   return QuasiAtomic::LongAtomicsUseMutexes(kRuntimeISA) ? JNI_FALSE : JNI_TRUE;
diff --git a/runtime/native/java_util_concurrent_atomic_AtomicLong.h b/runtime/native/java_util_concurrent_atomic_AtomicLong.h
index 990dc86..de442ed 100644
--- a/runtime/native/java_util_concurrent_atomic_AtomicLong.h
+++ b/runtime/native/java_util_concurrent_atomic_AtomicLong.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_java_util_concurrent_atomic_AtomicLong(JNIEnv* env);
 
diff --git a/runtime/native/jdk_internal_misc_Unsafe.cc b/runtime/native/jdk_internal_misc_Unsafe.cc
index 6e2f558..ba64c81 100644
--- a/runtime/native/jdk_internal_misc_Unsafe.cc
+++ b/runtime/native/jdk_internal_misc_Unsafe.cc
@@ -36,7 +36,7 @@
 #include "scoped_fast_native_object_access-inl.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace {
   // Checks a JNI argument `size` fits inside a size_t and throws a RuntimeException if not (see
@@ -261,11 +261,11 @@
   return Primitive::ComponentSize(primitive_type);
 }
 
-static jint Unsafe_addressSize(JNIEnv* env ATTRIBUTE_UNUSED, jobject ob ATTRIBUTE_UNUSED) {
+static jint Unsafe_addressSize([[maybe_unused]] JNIEnv* env, [[maybe_unused]] jobject ob) {
   return sizeof(void*);
 }
 
-static jint Unsafe_pageSize(JNIEnv* env ATTRIBUTE_UNUSED, jobject ob ATTRIBUTE_UNUSED) {
+static jint Unsafe_pageSize([[maybe_unused]] JNIEnv* env, [[maybe_unused]] jobject ob) {
   return sysconf(_SC_PAGESIZE);
 }
 
@@ -288,73 +288,80 @@
   return reinterpret_cast<uintptr_t>(mem);
 }
 
-static void Unsafe_freeMemory(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address) {
+static void Unsafe_freeMemory([[maybe_unused]] JNIEnv* env, jobject, jlong address) {
   free(reinterpret_cast<void*>(static_cast<uintptr_t>(address)));
 }
 
-static void Unsafe_setMemory(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address, jlong bytes, jbyte value) {
+static void Unsafe_setMemory(
+    [[maybe_unused]] JNIEnv* env, jobject, jlong address, jlong bytes, jbyte value) {
   memset(reinterpret_cast<void*>(static_cast<uintptr_t>(address)), value, bytes);
 }
 
-static jbyte Unsafe_getByteJ(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address) {
+static jbyte Unsafe_getByteJ([[maybe_unused]] JNIEnv* env, jobject, jlong address) {
   return *reinterpret_cast<jbyte*>(address);
 }
 
-static void Unsafe_putByteJB(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address, jbyte value) {
+static void Unsafe_putByteJB([[maybe_unused]] JNIEnv* env, jobject, jlong address, jbyte value) {
   *reinterpret_cast<jbyte*>(address) = value;
 }
 
-static jshort Unsafe_getShortJ(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address) {
+static jshort Unsafe_getShortJ([[maybe_unused]] JNIEnv* env, jobject, jlong address) {
   return *reinterpret_cast<jshort*>(address);
 }
 
-static void Unsafe_putShortJS(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address, jshort value) {
+static void Unsafe_putShortJS([[maybe_unused]] JNIEnv* env, jobject, jlong address, jshort value) {
   *reinterpret_cast<jshort*>(address) = value;
 }
 
-static jchar Unsafe_getCharJ(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address) {
+static jchar Unsafe_getCharJ([[maybe_unused]] JNIEnv* env, jobject, jlong address) {
   return *reinterpret_cast<jchar*>(address);
 }
 
-static void Unsafe_putCharJC(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address, jchar value) {
+static void Unsafe_putCharJC([[maybe_unused]] JNIEnv* env, jobject, jlong address, jchar value) {
   *reinterpret_cast<jchar*>(address) = value;
 }
 
-static jint Unsafe_getIntJ(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address) {
+static jint Unsafe_getIntJ([[maybe_unused]] JNIEnv* env, jobject, jlong address) {
   return *reinterpret_cast<jint*>(address);
 }
 
-static void Unsafe_putIntJI(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address, jint value) {
+static void Unsafe_putIntJI([[maybe_unused]] JNIEnv* env, jobject, jlong address, jint value) {
   *reinterpret_cast<jint*>(address) = value;
 }
 
-static jlong Unsafe_getLongJ(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address) {
+static jlong Unsafe_getLongJ([[maybe_unused]] JNIEnv* env, jobject, jlong address) {
   return *reinterpret_cast<jlong*>(address);
 }
 
-static void Unsafe_putLongJJ(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address, jlong value) {
+static void Unsafe_putLongJJ([[maybe_unused]] JNIEnv* env, jobject, jlong address, jlong value) {
   *reinterpret_cast<jlong*>(address) = value;
 }
 
-static jfloat Unsafe_getFloatJ(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address) {
+static jfloat Unsafe_getFloatJ([[maybe_unused]] JNIEnv* env, jobject, jlong address) {
   return *reinterpret_cast<jfloat*>(address);
 }
 
-static void Unsafe_putFloatJF(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address, jfloat value) {
+static void Unsafe_putFloatJF([[maybe_unused]] JNIEnv* env, jobject, jlong address, jfloat value) {
   *reinterpret_cast<jfloat*>(address) = value;
 }
-static jdouble Unsafe_getDoubleJ(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address) {
+static jdouble Unsafe_getDoubleJ([[maybe_unused]] JNIEnv* env, jobject, jlong address) {
   return *reinterpret_cast<jdouble*>(address);
 }
 
-static void Unsafe_putDoubleJD(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address, jdouble value) {
+static void Unsafe_putDoubleJD([[maybe_unused]] JNIEnv* env,
+                               jobject,
+                               jlong address,
+                               jdouble value) {
   *reinterpret_cast<jdouble*>(address) = value;
 }
 
-static void Unsafe_copyMemory0(JNIEnv *env, jobject unsafe ATTRIBUTE_UNUSED,
-                              jobject srcObj, jlong srcOffset,
-                              jobject dstObj, jlong dstOffset,
-                              jlong size) {
+static void Unsafe_copyMemory0(JNIEnv* env,
+                               [[maybe_unused]] jobject unsafe,
+                               jobject srcObj,
+                               jlong srcOffset,
+                               jobject dstObj,
+                               jlong dstOffset,
+                               jlong size) {
   ScopedFastNativeObjectAccess soa(env);
   if (size == 0) {
     return;
@@ -484,8 +491,9 @@
     ThrowIllegalArgumentException("Argument to unpark() was not a Thread");
     return;
   }
-  art::MutexLock mu(soa.Self(), *art::Locks::thread_list_lock_);
-  art::Thread* thread = art::Thread::FromManagedThread(soa, mirror_thread);
+  Thread* self = soa.Self();
+  art::MutexLock mu(self, *art::Locks::thread_list_lock_);
+  art::Thread* thread = art::Thread::FromManagedThread(self, mirror_thread);
   if (thread != nullptr) {
     thread->Unpark();
   } else {
diff --git a/runtime/native/jdk_internal_misc_Unsafe.h b/runtime/native/jdk_internal_misc_Unsafe.h
index 779cd5f..61b377b 100644
--- a/runtime/native/jdk_internal_misc_Unsafe.h
+++ b/runtime/native/jdk_internal_misc_Unsafe.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_jdk_internal_misc_Unsafe(JNIEnv* env);
 
diff --git a/runtime/native/libcore_io_Memory.cc b/runtime/native/libcore_io_Memory.cc
index 5e38280..66a16ed 100644
--- a/runtime/native/libcore_io_Memory.cc
+++ b/runtime/native/libcore_io_Memory.cc
@@ -25,7 +25,7 @@
 #include "nativehelper/scoped_primitive_array.h"
 #include "scoped_fast_native_object_access-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Use packed structures for access to unaligned data on targets with alignment restrictions.
 // The compiler will generate appropriate code to access these structures without
diff --git a/runtime/native/libcore_io_Memory.h b/runtime/native/libcore_io_Memory.h
index 8c8a2ec..bf60986 100644
--- a/runtime/native/libcore_io_Memory.h
+++ b/runtime/native/libcore_io_Memory.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_libcore_io_Memory(JNIEnv* env);
 
diff --git a/runtime/native/libcore_util_CharsetUtils.cc b/runtime/native/libcore_util_CharsetUtils.cc
index c53fd6e..b497f10 100644
--- a/runtime/native/libcore_util_CharsetUtils.cc
+++ b/runtime/native/libcore_util_CharsetUtils.cc
@@ -28,7 +28,7 @@
 #include "nativehelper/jni_macros.h"
 #include "scoped_fast_native_object_access-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static void CharsetUtils_asciiBytesToChars(JNIEnv* env, jclass, jbyteArray javaBytes, jint offset,
                                            jint length, jcharArray javaChars) {
@@ -113,7 +113,7 @@
     utf8_length = length;
   } else {
     const uint16_t* utf16 = string->GetValue() + offset;
-    auto count_length = [&utf8_length](jbyte c ATTRIBUTE_UNUSED) ALWAYS_INLINE { ++utf8_length; };
+    auto count_length = [&utf8_length]([[maybe_unused]] jbyte c) ALWAYS_INLINE { ++utf8_length; };
     ConvertUtf16ToUtf8</*kUseShortZero=*/ true,
                        /*kUse4ByteSequence=*/ true,
                        /*kReplaceBadSurrogates=*/ true>(utf16, length, count_length);
diff --git a/runtime/native/libcore_util_CharsetUtils.h b/runtime/native/libcore_util_CharsetUtils.h
index 3518bdb..eaafcab 100644
--- a/runtime/native/libcore_util_CharsetUtils.h
+++ b/runtime/native/libcore_util_CharsetUtils.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_libcore_util_CharsetUtils(JNIEnv* env);
 
diff --git a/runtime/native/native_util.h b/runtime/native/native_util.h
index 784dba3..f399359 100644
--- a/runtime/native/native_util.h
+++ b/runtime/native/native_util.h
@@ -23,7 +23,7 @@
 #include "base/macros.h"
 #include "nativehelper/scoped_local_ref.h"
 
-namespace art {
+namespace art HIDDEN {
 
 ALWAYS_INLINE inline void RegisterNativeMethodsInternal(JNIEnv* env,
                                                         const char* jni_class_name,
diff --git a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc
index 419aed8..b2e94f9 100644
--- a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc
+++ b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc
@@ -26,7 +26,7 @@
 #include "nativehelper/scoped_primitive_array.h"
 #include "scoped_fast_native_object_access-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static void DdmServer_nativeSendChunk(JNIEnv* env, jclass, jint type,
                                       jbyteArray javaData, jint offset, jint length) {
diff --git a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.h b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.h
index 9a4645c..fc5cfc9 100644
--- a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.h
+++ b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_org_apache_harmony_dalvik_ddmc_DdmServer(JNIEnv* env);
 
diff --git a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc
index 081ec20..6da4529 100644
--- a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc
+++ b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc
@@ -31,7 +31,7 @@
 #include "scoped_fast_native_object_access-inl.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static void DdmVmInternal_setRecentAllocationsTrackingEnabled(JNIEnv*, jclass, jboolean enable) {
   Dbg::SetAllocTrackingEnabled(enable);
@@ -59,7 +59,6 @@
     trace = Thread::InternalStackTraceToStackTraceElementArray(soa, internal_trace);
   } else {
     ThreadList* thread_list = Runtime::Current()->GetThreadList();
-    bool timed_out;
 
     // Check for valid thread
     if (thin_lock_id == ThreadList::kInvalidThreadId) {
@@ -67,9 +66,7 @@
     }
 
     // Suspend thread to build stack trace.
-    Thread* thread = thread_list->SuspendThreadByThreadId(thin_lock_id,
-                                                          SuspendReason::kInternal,
-                                                          &timed_out);
+    Thread* thread = thread_list->SuspendThreadByThreadId(thin_lock_id, SuspendReason::kInternal);
     if (thread != nullptr) {
       {
         ScopedObjectAccess soa(env);
@@ -79,11 +76,6 @@
       // Restart suspended thread.
       bool resumed = thread_list->Resume(thread, SuspendReason::kInternal);
       DCHECK(resumed);
-    } else {
-      if (timed_out) {
-        LOG(ERROR) << "Trying to get thread's stack by id failed as the thread failed to suspend "
-            "within a generous timeout.";
-      }
     }
   }
   return trace;
diff --git a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.h b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.h
index 736e4c8..5484f36 100644
--- a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.h
+++ b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_org_apache_harmony_dalvik_ddmc_DdmVmInternal(JNIEnv* env);
 
diff --git a/runtime/native/scoped_fast_native_object_access-inl.h b/runtime/native/scoped_fast_native_object_access-inl.h
index 0b8ad11..cd1a0b2 100644
--- a/runtime/native/scoped_fast_native_object_access-inl.h
+++ b/runtime/native/scoped_fast_native_object_access-inl.h
@@ -22,7 +22,7 @@
 #include "art_method.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 inline ScopedFastNativeObjectAccess::ScopedFastNativeObjectAccess(JNIEnv* env)
     : ScopedObjectAccessAlreadyRunnable(env) {
diff --git a/runtime/native/scoped_fast_native_object_access.h b/runtime/native/scoped_fast_native_object_access.h
index 6a9365d..a3b01d7 100644
--- a/runtime/native/scoped_fast_native_object_access.h
+++ b/runtime/native/scoped_fast_native_object_access.h
@@ -19,9 +19,10 @@
 
 #include <jni.h>
 
+#include "base/macros.h"
 #include "scoped_thread_state_change.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Variant of ScopedObjectAccess that does no runnable transitions. Should only be used by "fast"
 // JNI methods.
diff --git a/runtime/native/string_array_utils.h b/runtime/native/string_array_utils.h
index 41d5093..f1fbe54 100644
--- a/runtime/native/string_array_utils.h
+++ b/runtime/native/string_array_utils.h
@@ -17,13 +17,14 @@
 #ifndef ART_RUNTIME_NATIVE_STRING_ARRAY_UTILS_H_
 #define ART_RUNTIME_NATIVE_STRING_ARRAY_UTILS_H_
 
+#include "base/macros.h"
 #include "base/locks.h"
 #include "class_root-inl.h"
 #include "handle_scope-inl.h"
 #include "mirror/object_array-alloc-inl.h"
 #include "mirror/string.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace detail {
 
diff --git a/runtime/native/sun_misc_Unsafe.cc b/runtime/native/sun_misc_Unsafe.cc
index 8a203ce..38fe725 100644
--- a/runtime/native/sun_misc_Unsafe.cc
+++ b/runtime/native/sun_misc_Unsafe.cc
@@ -36,7 +36,7 @@
 #include "scoped_fast_native_object_access-inl.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static jboolean Unsafe_compareAndSwapInt(JNIEnv* env, jobject, jobject javaObj, jlong offset,
                                          jint expectedValue, jint newValue) {
@@ -219,11 +219,11 @@
   return Primitive::ComponentSize(primitive_type);
 }
 
-static jint Unsafe_addressSize(JNIEnv* env ATTRIBUTE_UNUSED, jobject ob ATTRIBUTE_UNUSED) {
+static jint Unsafe_addressSize([[maybe_unused]] JNIEnv* env, [[maybe_unused]] jobject ob) {
   return sizeof(void*);
 }
 
-static jint Unsafe_pageSize(JNIEnv* env ATTRIBUTE_UNUSED, jobject ob ATTRIBUTE_UNUSED) {
+static jint Unsafe_pageSize([[maybe_unused]] JNIEnv* env, [[maybe_unused]] jobject ob) {
   return sysconf(_SC_PAGESIZE);
 }
 
@@ -242,71 +242,75 @@
   return (uintptr_t) mem;
 }
 
-static void Unsafe_freeMemory(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address) {
+static void Unsafe_freeMemory([[maybe_unused]] JNIEnv* env, jobject, jlong address) {
   free(reinterpret_cast<void*>(static_cast<uintptr_t>(address)));
 }
 
-static void Unsafe_setMemory(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address, jlong bytes, jbyte value) {
+static void Unsafe_setMemory(
+    [[maybe_unused]] JNIEnv* env, jobject, jlong address, jlong bytes, jbyte value) {
   memset(reinterpret_cast<void*>(static_cast<uintptr_t>(address)), value, bytes);
 }
 
-static jbyte Unsafe_getByteJ(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address) {
+static jbyte Unsafe_getByteJ([[maybe_unused]] JNIEnv* env, jobject, jlong address) {
   return *reinterpret_cast<jbyte*>(address);
 }
 
-static void Unsafe_putByteJB(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address, jbyte value) {
+static void Unsafe_putByteJB([[maybe_unused]] JNIEnv* env, jobject, jlong address, jbyte value) {
   *reinterpret_cast<jbyte*>(address) = value;
 }
 
-static jshort Unsafe_getShortJ(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address) {
+static jshort Unsafe_getShortJ([[maybe_unused]] JNIEnv* env, jobject, jlong address) {
   return *reinterpret_cast<jshort*>(address);
 }
 
-static void Unsafe_putShortJS(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address, jshort value) {
+static void Unsafe_putShortJS([[maybe_unused]] JNIEnv* env, jobject, jlong address, jshort value) {
   *reinterpret_cast<jshort*>(address) = value;
 }
 
-static jchar Unsafe_getCharJ(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address) {
+static jchar Unsafe_getCharJ([[maybe_unused]] JNIEnv* env, jobject, jlong address) {
   return *reinterpret_cast<jchar*>(address);
 }
 
-static void Unsafe_putCharJC(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address, jchar value) {
+static void Unsafe_putCharJC([[maybe_unused]] JNIEnv* env, jobject, jlong address, jchar value) {
   *reinterpret_cast<jchar*>(address) = value;
 }
 
-static jint Unsafe_getIntJ(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address) {
+static jint Unsafe_getIntJ([[maybe_unused]] JNIEnv* env, jobject, jlong address) {
   return *reinterpret_cast<jint*>(address);
 }
 
-static void Unsafe_putIntJI(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address, jint value) {
+static void Unsafe_putIntJI([[maybe_unused]] JNIEnv* env, jobject, jlong address, jint value) {
   *reinterpret_cast<jint*>(address) = value;
 }
 
-static jlong Unsafe_getLongJ(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address) {
+static jlong Unsafe_getLongJ([[maybe_unused]] JNIEnv* env, jobject, jlong address) {
   return *reinterpret_cast<jlong*>(address);
 }
 
-static void Unsafe_putLongJJ(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address, jlong value) {
+static void Unsafe_putLongJJ([[maybe_unused]] JNIEnv* env, jobject, jlong address, jlong value) {
   *reinterpret_cast<jlong*>(address) = value;
 }
 
-static jfloat Unsafe_getFloatJ(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address) {
+static jfloat Unsafe_getFloatJ([[maybe_unused]] JNIEnv* env, jobject, jlong address) {
   return *reinterpret_cast<jfloat*>(address);
 }
 
-static void Unsafe_putFloatJF(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address, jfloat value) {
+static void Unsafe_putFloatJF([[maybe_unused]] JNIEnv* env, jobject, jlong address, jfloat value) {
   *reinterpret_cast<jfloat*>(address) = value;
 }
-static jdouble Unsafe_getDoubleJ(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address) {
+static jdouble Unsafe_getDoubleJ([[maybe_unused]] JNIEnv* env, jobject, jlong address) {
   return *reinterpret_cast<jdouble*>(address);
 }
 
-static void Unsafe_putDoubleJD(JNIEnv* env ATTRIBUTE_UNUSED, jobject, jlong address, jdouble value) {
+static void Unsafe_putDoubleJD([[maybe_unused]] JNIEnv* env,
+                               jobject,
+                               jlong address,
+                               jdouble value) {
   *reinterpret_cast<jdouble*>(address) = value;
 }
 
-static void Unsafe_copyMemory(JNIEnv *env, jobject unsafe ATTRIBUTE_UNUSED, jlong src,
-                              jlong dst, jlong size) {
+static void Unsafe_copyMemory(
+    JNIEnv* env, [[maybe_unused]] jobject unsafe, jlong src, jlong dst, jlong size) {
   if (size == 0) {
     return;
   }
@@ -347,8 +351,8 @@
   }
 }
 
-static void Unsafe_copyMemoryToPrimitiveArray(JNIEnv *env,
-                                              jobject unsafe ATTRIBUTE_UNUSED,
+static void Unsafe_copyMemoryToPrimitiveArray(JNIEnv* env,
+                                              [[maybe_unused]] jobject unsafe,
                                               jlong srcAddr,
                                               jobject dstObj,
                                               jlong dstOffset,
@@ -382,8 +386,8 @@
   }
 }
 
-static void Unsafe_copyMemoryFromPrimitiveArray(JNIEnv *env,
-                                                jobject unsafe ATTRIBUTE_UNUSED,
+static void Unsafe_copyMemoryFromPrimitiveArray(JNIEnv* env,
+                                                [[maybe_unused]] jobject unsafe,
                                                 jobject srcObj,
                                                 jlong srcOffset,
                                                 jlong dstAddr,
@@ -527,8 +531,9 @@
     ThrowIllegalArgumentException("Argument to unpark() was not a Thread");
     return;
   }
-  art::MutexLock mu(soa.Self(), *art::Locks::thread_list_lock_);
-  art::Thread* thread = art::Thread::FromManagedThread(soa, mirror_thread);
+  Thread* self = soa.Self();
+  art::MutexLock mu(self, *art::Locks::thread_list_lock_);
+  art::Thread* thread = art::Thread::FromManagedThread(self, mirror_thread);
   if (thread != nullptr) {
     thread->Unpark();
   } else {
diff --git a/runtime/native/sun_misc_Unsafe.h b/runtime/native/sun_misc_Unsafe.h
index 93194f4..fe120b5 100644
--- a/runtime/native/sun_misc_Unsafe.h
+++ b/runtime/native/sun_misc_Unsafe.h
@@ -19,7 +19,9 @@
 
 #include <jni.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 void register_sun_misc_Unsafe(JNIEnv* env);
 
diff --git a/runtime/native_bridge_art_interface.cc b/runtime/native_bridge_art_interface.cc
index 0651f0c..a081a2d 100644
--- a/runtime/native_bridge_art_interface.cc
+++ b/runtime/native_bridge_art_interface.cc
@@ -30,7 +30,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "sigchain.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static const char* GetMethodShorty(JNIEnv* env, jmethodID mid) {
   ScopedObjectAccess soa(env);
diff --git a/runtime/native_bridge_art_interface.h b/runtime/native_bridge_art_interface.h
index 873cd1f..5aeaebf 100644
--- a/runtime/native_bridge_art_interface.h
+++ b/runtime/native_bridge_art_interface.h
@@ -21,7 +21,9 @@
 #include <stdint.h>
 #include <string>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 // Mirror libnativebridge interface. Done to have the ART callbacks out of line, and not require
 // the system/core header file in other files.
diff --git a/runtime/native_stack_dump.cc b/runtime/native_stack_dump.cc
index d6a0fae..ad09762 100644
--- a/runtime/native_stack_dump.cc
+++ b/runtime/native_stack_dump.cc
@@ -53,13 +53,13 @@
 #include "base/utils.h"
 #include "class_linker.h"
 #include "entrypoints/runtime_asm_entrypoints.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "runtime.h"
 #include "thread-current-inl.h"
 
 #endif
 
-namespace art {
+namespace art HIDDEN {
 
 #if defined(__linux__)
 
@@ -431,22 +431,20 @@
 
 #elif defined(__APPLE__)
 
-void DumpNativeStack(std::ostream& os ATTRIBUTE_UNUSED,
-                     pid_t tid ATTRIBUTE_UNUSED,
-                     const char* prefix ATTRIBUTE_UNUSED,
-                     ArtMethod* current_method ATTRIBUTE_UNUSED,
-                     void* ucontext_ptr ATTRIBUTE_UNUSED,
-                     bool skip_frames ATTRIBUTE_UNUSED) {
-}
+void DumpNativeStack([[maybe_unused]] std::ostream& os,
+                     [[maybe_unused]] pid_t tid,
+                     [[maybe_unused]] const char* prefix,
+                     [[maybe_unused]] ArtMethod* current_method,
+                     [[maybe_unused]] void* ucontext_ptr,
+                     [[maybe_unused]] bool skip_frames) {}
 
-void DumpNativeStack(std::ostream& os ATTRIBUTE_UNUSED,
-                     unwindstack::AndroidLocalUnwinder& existing_map ATTRIBUTE_UNUSED,
-                     pid_t tid ATTRIBUTE_UNUSED,
-                     const char* prefix ATTRIBUTE_UNUSED,
-                     ArtMethod* current_method ATTRIBUTE_UNUSED,
-                     void* ucontext_ptr ATTRIBUTE_UNUSED,
-                     bool skip_frames ATTRIBUTE_UNUSED) {
-}
+void DumpNativeStack([[maybe_unused]] std::ostream& os,
+                     [[maybe_unused]] unwindstack::AndroidLocalUnwinder& existing_map,
+                     [[maybe_unused]] pid_t tid,
+                     [[maybe_unused]] const char* prefix,
+                     [[maybe_unused]] ArtMethod* current_method,
+                     [[maybe_unused]] void* ucontext_ptr,
+                     [[maybe_unused]] bool skip_frames) {}
 
 #else
 #error "Unsupported architecture for native stack dumps."
diff --git a/runtime/native_stack_dump.h b/runtime/native_stack_dump.h
index 86a8ce2..06c2fb7 100644
--- a/runtime/native_stack_dump.h
+++ b/runtime/native_stack_dump.h
@@ -27,7 +27,7 @@
 class AndroidLocalUnwinder;
 }  // namespace unwindstack
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtMethod;
 
diff --git a/runtime/native_stack_dump_test.cc b/runtime/native_stack_dump_test.cc
index 4446495..d2a2fc3 100644
--- a/runtime/native_stack_dump_test.cc
+++ b/runtime/native_stack_dump_test.cc
@@ -18,7 +18,7 @@
 
 #include <gtest/gtest.h>
 
-namespace art {
+namespace art HIDDEN {
 
 TEST(StripParametersTest, ValidInput) {
   EXPECT_EQ(StripParameters("foo(int)"), "foo");
diff --git a/runtime/non_debuggable_classes.cc b/runtime/non_debuggable_classes.cc
index a35152f..15e05c0 100644
--- a/runtime/non_debuggable_classes.cc
+++ b/runtime/non_debuggable_classes.cc
@@ -24,7 +24,7 @@
 #include "thread-current-inl.h"
 #include "thread-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 std::vector<jclass>  NonDebuggableClasses::non_debuggable_classes;
 
diff --git a/runtime/non_debuggable_classes.h b/runtime/non_debuggable_classes.h
index e2c51e6..eb0d474 100644
--- a/runtime/non_debuggable_classes.h
+++ b/runtime/non_debuggable_classes.h
@@ -20,9 +20,10 @@
 #include <vector>
 
 #include "base/locks.h"
+#include "base/macros.h"
 #include "jni.h"
 
-namespace art {
+namespace art HIDDEN {
 
 struct NonDebuggableClasses {
  public:
@@ -34,7 +35,7 @@
       REQUIRES_SHARED(Locks::mutator_lock_);
 
  private:
-  static std::vector<jclass> non_debuggable_classes;
+  EXPORT static std::vector<jclass> non_debuggable_classes;
 };
 
 }  // namespace art
diff --git a/runtime/noop_compiler_callbacks.h b/runtime/noop_compiler_callbacks.h
index aed0014..34e15e7 100644
--- a/runtime/noop_compiler_callbacks.h
+++ b/runtime/noop_compiler_callbacks.h
@@ -17,18 +17,19 @@
 #ifndef ART_RUNTIME_NOOP_COMPILER_CALLBACKS_H_
 #define ART_RUNTIME_NOOP_COMPILER_CALLBACKS_H_
 
+#include "base/macros.h"
 #include "compiler_callbacks.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class NoopCompilerCallbacks final : public CompilerCallbacks {
  public:
   NoopCompilerCallbacks() : CompilerCallbacks(CompilerCallbacks::CallbackMode::kCompileApp) {}
   ~NoopCompilerCallbacks() {}
 
-  void AddUncompilableMethod(MethodReference ref ATTRIBUTE_UNUSED) override {}
-  void AddUncompilableClass(ClassReference ref ATTRIBUTE_UNUSED) override {}
-  void ClassRejected(ClassReference ref ATTRIBUTE_UNUSED) override {}
+  void AddUncompilableMethod([[maybe_unused]] MethodReference ref) override {}
+  void AddUncompilableClass([[maybe_unused]] ClassReference ref) override {}
+  void ClassRejected([[maybe_unused]] ClassReference ref) override {}
 
   verifier::VerifierDeps* GetVerifierDeps() const override { return nullptr; }
 
diff --git a/runtime/nterp_helpers-inl.h b/runtime/nterp_helpers-inl.h
new file mode 100644
index 0000000..1662bab
--- /dev/null
+++ b/runtime/nterp_helpers-inl.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_RUNTIME_NTERP_HELPERS_INL_H_
+#define ART_RUNTIME_NTERP_HELPERS_INL_H_
+
+#include "nterp_helpers.h"
+
+namespace art HIDDEN {
+
+ALWAYS_INLINE inline uint32_t GetNterpFastPathFlags(std::string_view shorty,
+                                                    uint32_t access_flags,
+                                                    InstructionSet isa) {
+  bool all_parameters_are_reference = true;
+  bool all_parameters_are_reference_or_int = true;
+  for (size_t i = 1; i < shorty.length(); ++i) {
+    if (shorty[i] != 'L') {
+      all_parameters_are_reference = false;
+      if (shorty[i] == 'F' || shorty[i] == 'D' || shorty[i] == 'J') {
+        all_parameters_are_reference_or_int = false;
+        break;
+      }
+    }
+  }
+
+  // Check for nterp entry fast-path based on shorty.
+  uint32_t nterp_flags = 0u;
+  if ((access_flags & kAccNative) == 0u && all_parameters_are_reference) {
+    nterp_flags |= kAccNterpEntryPointFastPathFlag;
+  }
+
+  // Check for nterp invoke fast-path based on shorty.
+  const bool no_float_return = shorty[0] != 'F' && shorty[0] != 'D';
+  if (isa != InstructionSet::kRiscv64 && all_parameters_are_reference_or_int && no_float_return) {
+    nterp_flags |= kAccNterpInvokeFastPathFlag;
+  } else if (isa == InstructionSet::kRiscv64 && all_parameters_are_reference && no_float_return) {
+    nterp_flags |= kAccNterpInvokeFastPathFlag;
+  }
+  return nterp_flags;
+}
+
+}  // namespace art
+
+#endif  // ART_RUNTIME_NTERP_HELPERS_INL_H_
diff --git a/runtime/nterp_helpers.cc b/runtime/nterp_helpers.cc
index 36135fd..ba93df6 100644
--- a/runtime/nterp_helpers.cc
+++ b/runtime/nterp_helpers.cc
@@ -14,15 +14,16 @@
  * limitations under the License.
  */
 
+#include "arch/instruction_set.h"
 #include "art_method-inl.h"
 #include "dex/code_item_accessors.h"
 #include "entrypoints/quick/callee_save_frame.h"
 #include "interpreter/mterp/nterp.h"
 #include "nterp_helpers.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "quick/quick_method_frame_info.h"
 
-namespace art {
+namespace art HIDDEN {
 
 /**
  * An nterp frame follows the optimizing compiler's ABI conventions, with
@@ -233,6 +234,9 @@
       method->IsProxyMethod()) {
     return false;
   }
+  if (isa == InstructionSet::kRiscv64 && method->GetDexFile()->IsCompactDexFile()) {
+    return false;  // Riscv64 nterp does not support compact dex yet.
+  }
   // There is no need to add the alignment padding size for comparison with aligned limit.
   size_t frame_size_without_padding = NterpGetFrameSizeWithoutPadding(method, isa);
   DCHECK_EQ(NterpGetFrameSize(method, isa), RoundUp(frame_size_without_padding, kStackAlignment));
diff --git a/runtime/nterp_helpers.h b/runtime/nterp_helpers.h
index 236059b..6ce2038 100644
--- a/runtime/nterp_helpers.h
+++ b/runtime/nterp_helpers.h
@@ -17,9 +17,10 @@
 #ifndef ART_RUNTIME_NTERP_HELPERS_H_
 #define ART_RUNTIME_NTERP_HELPERS_H_
 
+#include "base/macros.h"
 #include "quick/quick_method_frame_info.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtMethod;
 
@@ -72,9 +73,14 @@
  * Returns whether the given method can run with nterp. The instruction set can
  * be passed for cross-compilation.
  */
-bool CanMethodUseNterp(ArtMethod* method, InstructionSet isa = kRuntimeISA)
+EXPORT bool CanMethodUseNterp(ArtMethod* method, InstructionSet isa = kRuntimeISA)
     REQUIRES_SHARED(Locks::mutator_lock_);
 
+/**
+ * Returns kAccNterpInvokeFastPathFlag and/or kAccNterpEntryPointFastPathFlag, if appropriate.
+ */
+uint32_t GetNterpFastPathFlags(std::string_view shorty, uint32_t access_flags, InstructionSet isa);
+
 }  // namespace art
 
 #endif  // ART_RUNTIME_NTERP_HELPERS_H_
diff --git a/runtime/nth_caller_visitor.h b/runtime/nth_caller_visitor.h
index ffec179..771c672 100644
--- a/runtime/nth_caller_visitor.h
+++ b/runtime/nth_caller_visitor.h
@@ -17,11 +17,12 @@
 #ifndef ART_RUNTIME_NTH_CALLER_VISITOR_H_
 #define ART_RUNTIME_NTH_CALLER_VISITOR_H_
 
+#include "base/macros.h"
 #include "art_method.h"
 #include "base/locks.h"
 #include "stack.h"
 
-namespace art {
+namespace art HIDDEN {
 class Thread;
 
 // Walks up the stack 'n' callers, when used with Thread::WalkStack.
diff --git a/runtime/aot_class_linker.cc b/runtime/oat/aot_class_linker.cc
similarity index 99%
rename from runtime/aot_class_linker.cc
rename to runtime/oat/aot_class_linker.cc
index 9b2e876..dfdc3d7 100644
--- a/runtime/aot_class_linker.cc
+++ b/runtime/oat/aot_class_linker.cc
@@ -25,7 +25,7 @@
 #include "runtime.h"
 #include "verifier/verifier_enums.h"
 
-namespace art {
+namespace art HIDDEN {
 
 AotClassLinker::AotClassLinker(InternTable* intern_table)
     : ClassLinker(intern_table, /*fast_class_not_found_exceptions=*/ false) {}
diff --git a/runtime/aot_class_linker.h b/runtime/oat/aot_class_linker.h
similarity index 78%
rename from runtime/aot_class_linker.h
rename to runtime/oat/aot_class_linker.h
index 30a19c8..16290de 100644
--- a/runtime/aot_class_linker.h
+++ b/runtime/oat/aot_class_linker.h
@@ -14,18 +14,20 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_AOT_CLASS_LINKER_H_
-#define ART_RUNTIME_AOT_CLASS_LINKER_H_
+#ifndef ART_RUNTIME_OAT_AOT_CLASS_LINKER_H_
+#define ART_RUNTIME_OAT_AOT_CLASS_LINKER_H_
 
+#include "base/macros.h"
 #include "sdk_checker.h"
 #include "class_linker.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace gc {
 class Heap;
 }  // namespace gc
 
+// TODO: move to dex2oat/.
 // AotClassLinker is only used for AOT compiler, which includes some logic for class initialization
 // which will only be used in pre-compilation.
 class AotClassLinker : public ClassLinker {
@@ -33,17 +35,17 @@
   explicit AotClassLinker(InternTable *intern_table);
   ~AotClassLinker();
 
-static bool CanReferenceInBootImageExtension(ObjPtr<mirror::Class> klass, gc::Heap* heap)
+  EXPORT static bool CanReferenceInBootImageExtension(ObjPtr<mirror::Class> klass, gc::Heap* heap)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  void SetSdkChecker(std::unique_ptr<SdkChecker>&& sdk_checker_);
+  EXPORT void SetSdkChecker(std::unique_ptr<SdkChecker>&& sdk_checker_);
   const SdkChecker* GetSdkChecker() const;
 
-  bool DenyAccessBasedOnPublicSdk(ArtMethod* art_method ATTRIBUTE_UNUSED) const override
+  bool DenyAccessBasedOnPublicSdk([[maybe_unused]] ArtMethod* art_method) const override
       REQUIRES_SHARED(Locks::mutator_lock_);
-  bool DenyAccessBasedOnPublicSdk(ArtField* art_field ATTRIBUTE_UNUSED) const override
+  bool DenyAccessBasedOnPublicSdk([[maybe_unused]] ArtField* art_field) const override
       REQUIRES_SHARED(Locks::mutator_lock_);
-  bool DenyAccessBasedOnPublicSdk(const char* type_descriptor ATTRIBUTE_UNUSED) const override;
+  bool DenyAccessBasedOnPublicSdk([[maybe_unused]] const char* type_descriptor) const override;
   void SetEnablePublicSdkChecks(bool enabled) override;
 
  protected:
@@ -78,4 +80,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_AOT_CLASS_LINKER_H_
+#endif  // ART_RUNTIME_OAT_AOT_CLASS_LINKER_H_
diff --git a/runtime/elf_file.cc b/runtime/oat/elf_file.cc
similarity index 99%
rename from runtime/elf_file.cc
rename to runtime/oat/elf_file.cc
index 0b4f1f3..30e0197 100644
--- a/runtime/elf_file.cc
+++ b/runtime/oat/elf_file.cc
@@ -32,7 +32,7 @@
 #include "elf/elf_utils.h"
 #include "elf_file_impl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -1056,8 +1056,8 @@
       max_vaddr = end_vaddr;
     }
   }
-  min_vaddr = RoundDown(min_vaddr, kPageSize);
-  max_vaddr = RoundUp(max_vaddr, kPageSize);
+  min_vaddr = RoundDown(min_vaddr, kElfSegmentAlignment);
+  max_vaddr = RoundUp(max_vaddr, kElfSegmentAlignment);
   CHECK_LT(min_vaddr, max_vaddr) << file_path_;
   // Check that the range fits into the runtime address space.
   if (UNLIKELY(max_vaddr - 1u > std::numeric_limits<size_t>::max())) {
@@ -1076,12 +1076,14 @@
 }
 
 static InstructionSet GetInstructionSetFromELF(uint16_t e_machine,
-                                               uint32_t e_flags ATTRIBUTE_UNUSED) {
+                                               [[maybe_unused]] uint32_t e_flags) {
   switch (e_machine) {
     case EM_ARM:
       return InstructionSet::kArm;
     case EM_AARCH64:
       return InstructionSet::kArm64;
+    case EM_RISCV:
+      return InstructionSet::kRiscv64;
     case EM_386:
       return InstructionSet::kX86;
     case EM_X86_64:
@@ -1205,7 +1207,7 @@
       return false;
     }
     if (program_header->p_filesz < program_header->p_memsz &&
-        !IsAligned<kPageSize>(program_header->p_filesz)) {
+        !IsAligned<kElfSegmentAlignment>(program_header->p_filesz)) {
       *error_msg = StringPrintf("Unsupported unaligned p_filesz < p_memsz (%" PRIu64
                                 " < %" PRIu64 "): %s",
                                 static_cast<uint64_t>(program_header->p_filesz),
diff --git a/runtime/elf_file.h b/runtime/oat/elf_file.h
similarity index 95%
rename from runtime/elf_file.h
rename to runtime/oat/elf_file.h
index 8516b51..a921810 100644
--- a/runtime/elf_file.h
+++ b/runtime/oat/elf_file.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_ELF_FILE_H_
-#define ART_RUNTIME_ELF_FILE_H_
+#ifndef ART_RUNTIME_OAT_ELF_FILE_H_
+#define ART_RUNTIME_OAT_ELF_FILE_H_
 
 #include <memory>
 #include <string>
@@ -24,7 +24,7 @@
 #include "base/os.h"
 #include "elf/elf_utils.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class MemMap;
 
@@ -110,4 +110,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_ELF_FILE_H_
+#endif  // ART_RUNTIME_OAT_ELF_FILE_H_
diff --git a/runtime/elf_file_impl.h b/runtime/oat/elf_file_impl.h
similarity index 97%
rename from runtime/elf_file_impl.h
rename to runtime/oat/elf_file_impl.h
index 26d960e..ffc6a2c 100644
--- a/runtime/elf_file_impl.h
+++ b/runtime/oat/elf_file_impl.h
@@ -14,18 +14,19 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_ELF_FILE_IMPL_H_
-#define ART_RUNTIME_ELF_FILE_IMPL_H_
+#ifndef ART_RUNTIME_OAT_ELF_FILE_IMPL_H_
+#define ART_RUNTIME_OAT_ELF_FILE_IMPL_H_
 
 #include <map>
 #include <memory>
 #include <type_traits>
 #include <vector>
 
+#include "base/macros.h"
 #include "base/mem_map.h"
 #include "elf/elf_utils.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template <typename ElfTypes>
 class ElfFileImpl {
@@ -221,4 +222,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_ELF_FILE_IMPL_H_
+#endif  // ART_RUNTIME_OAT_ELF_FILE_IMPL_H_
diff --git a/runtime/image-inl.h b/runtime/oat/image-inl.h
similarity index 96%
rename from runtime/image-inl.h
rename to runtime/oat/image-inl.h
index 0404e99..5995600 100644
--- a/runtime/image-inl.h
+++ b/runtime/oat/image-inl.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_IMAGE_INL_H_
-#define ART_RUNTIME_IMAGE_INL_H_
+#ifndef ART_RUNTIME_OAT_IMAGE_INL_H_
+#define ART_RUNTIME_OAT_IMAGE_INL_H_
 
 #include "image.h"
 
@@ -26,7 +26,7 @@
 #include "obj_ptr-inl.h"
 #include "read_barrier-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template <ReadBarrierOption kReadBarrierOption>
 inline ObjPtr<mirror::Object> ImageHeader::GetImageRoot(ImageRoot image_root) const {
@@ -117,4 +117,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_IMAGE_INL_H_
+#endif  // ART_RUNTIME_OAT_IMAGE_INL_H_
diff --git a/runtime/image.cc b/runtime/oat/image.cc
similarity index 88%
rename from runtime/image.cc
rename to runtime/oat/image.cc
index fda7553..a7ac8e0 100644
--- a/runtime/image.cc
+++ b/runtime/oat/image.cc
@@ -31,11 +31,11 @@
 #include "mirror/object_array-inl.h"
 #include "mirror/object_array.h"
 
-namespace art {
+namespace art HIDDEN {
 
 const uint8_t ImageHeader::kImageMagic[] = { 'a', 'r', 't', '\n' };
-// Last change: Add DexCacheSection.
-const uint8_t ImageHeader::kImageVersion[] = { '1', '0', '8', '\0' };
+// Last change: Split intrinsics list - with and without HIR.
+const uint8_t ImageHeader::kImageVersion[] = { '1', '0', '9', '\0' };
 
 ImageHeader::ImageHeader(uint32_t image_reservation_size,
                          uint32_t component_count,
@@ -69,10 +69,10 @@
     boot_image_checksum_(boot_image_checksum),
     image_roots_(image_roots),
     pointer_size_(pointer_size) {
-  CHECK_EQ(image_begin, RoundUp(image_begin, kPageSize));
+  CHECK_EQ(image_begin, RoundUp(image_begin, kElfSegmentAlignment));
   if (oat_checksum != 0u) {
-    CHECK_EQ(oat_file_begin, RoundUp(oat_file_begin, kPageSize));
-    CHECK_EQ(oat_data_begin, RoundUp(oat_data_begin, kPageSize));
+    CHECK_EQ(oat_file_begin, RoundUp(oat_file_begin, kElfSegmentAlignment));
+    CHECK_EQ(oat_data_begin, RoundUp(oat_data_begin, kElfSegmentAlignment));
     CHECK_LT(image_roots, oat_file_begin);
     CHECK_LE(oat_file_begin, oat_data_begin);
     CHECK_LT(oat_data_begin, oat_data_end);
@@ -85,7 +85,27 @@
 }
 
 void ImageHeader::RelocateImageReferences(int64_t delta) {
-  CHECK_ALIGNED(delta, kPageSize) << "relocation delta must be page aligned";
+  // App Images can be relocated to a page aligned address.
+  // Unlike with the Boot Image, for which the memory is reserved in advance of
+  // loading and is aligned to kElfSegmentAlignment, the App Images can be mapped
+  // without reserving memory i.e. via direct file mapping in which case the
+  // memory range is aligned by the kernel and the only guarantee is that it is
+  // aligned to the page sizes.
+  //
+  // NOTE: While this might be less than alignment required via information in
+  //       the ELF header, it should be sufficient in practice as the only reason
+  //       for the ELF segment alignment to be more than one page size is the
+  //       compatibility of the ELF with system configurations that use larger
+  //       page size.
+  //
+  //       Adding preliminary memory reservation would introduce certain overhead.
+  //
+  //       However, technically the alignment requirement isn't fulfilled and that
+  //       might be worth addressing even if it adds certain overhead. This will have
+  //       to be done in alignment with the dynamic linker's ELF loader as
+  //       otherwise inconsistency would still be possible e.g. when using
+  //       `dlopen`-like calls to load OAT files.
+  CHECK_ALIGNED_PARAM(delta, gPageSize) << "relocation delta must be page aligned";
   oat_file_begin_ += delta;
   oat_data_begin_ += delta;
   oat_data_end_ += delta;
@@ -95,7 +115,7 @@
 }
 
 void ImageHeader::RelocateBootImageReferences(int64_t delta) {
-  CHECK_ALIGNED(delta, kPageSize) << "relocation delta must be page aligned";
+  CHECK_ALIGNED(delta, kElfSegmentAlignment) << "relocation delta must be Elf segment aligned";
   DCHECK_EQ(boot_image_begin_ != 0u, boot_image_size_ != 0u);
   if (boot_image_begin_ != 0u) {
     boot_image_begin_ += delta;
@@ -108,8 +128,8 @@
 bool ImageHeader::IsAppImage() const {
   // Unlike boot image and boot image extensions which include address space for
   // oat files in their reservation size, app images are loaded separately from oat
-  // files and their reservation size is the image size rounded up to full page.
-  return image_reservation_size_ == RoundUp(image_size_, kPageSize);
+  // files and their reservation size is the image size rounded up to Elf alignment.
+  return image_reservation_size_ == RoundUp(image_size_, kElfSegmentAlignment);
 }
 
 uint32_t ImageHeader::GetImageSpaceCount() const {
@@ -127,7 +147,7 @@
   if (memcmp(version_, kImageVersion, sizeof(kImageVersion)) != 0) {
     return false;
   }
-  if (!IsAligned<kPageSize>(image_reservation_size_)) {
+  if (!IsAligned<kElfSegmentAlignment>(image_reservation_size_)) {
     return false;
   }
   // Unsigned so wraparound is well defined.
@@ -403,7 +423,7 @@
   // possibly compressed image.
   ImageSection& bitmap_section = GetImageSection(ImageHeader::kSectionImageBitmap);
   // Align up since data size may be unaligned if the image is compressed.
-  out_offset = RoundUp(out_offset, kPageSize);
+  out_offset = RoundUp(out_offset, kElfSegmentAlignment);
   bitmap_section = ImageSection(out_offset, bitmap_section.Size());
 
   if (!image_file->PwriteFully(bitmap_data,
@@ -421,7 +441,7 @@
   }
 
   if (update_checksum) {
-      // Calculate the image checksum of the remaining data.
+    // Calculate the image checksum of the remaining data.
     image_checksum = adler32(image_checksum,
                              reinterpret_cast<const uint8_t*>(bitmap_data),
                              bitmap_section.Size());
diff --git a/runtime/image.h b/runtime/oat/image.h
similarity index 89%
rename from runtime/image.h
rename to runtime/oat/image.h
index 324cd3c..23c92a1 100644
--- a/runtime/image.h
+++ b/runtime/oat/image.h
@@ -14,19 +14,20 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_IMAGE_H_
-#define ART_RUNTIME_IMAGE_H_
+#ifndef ART_RUNTIME_OAT_IMAGE_H_
+#define ART_RUNTIME_OAT_IMAGE_H_
 
 #include <string.h>
 
 #include "base/enums.h"
 #include "base/iteration_range.h"
+#include "base/macros.h"
 #include "base/os.h"
 #include "base/unix_file/fd_file.h"
 #include "mirror/object.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtField;
 class ArtMethod;
@@ -128,25 +129,25 @@
   };
 
   ImageHeader() {}
-  ImageHeader(uint32_t image_reservation_size,
-              uint32_t component_count,
-              uint32_t image_begin,
-              uint32_t image_size,
-              ImageSection* sections,
-              uint32_t image_roots,
-              uint32_t oat_checksum,
-              uint32_t oat_file_begin,
-              uint32_t oat_data_begin,
-              uint32_t oat_data_end,
-              uint32_t oat_file_end,
-              uint32_t boot_image_begin,
-              uint32_t boot_image_size,
-              uint32_t boot_image_component_count,
-              uint32_t boot_image_checksum,
-              uint32_t pointer_size);
+  EXPORT ImageHeader(uint32_t image_reservation_size,
+                     uint32_t component_count,
+                     uint32_t image_begin,
+                     uint32_t image_size,
+                     ImageSection* sections,
+                     uint32_t image_roots,
+                     uint32_t oat_checksum,
+                     uint32_t oat_file_begin,
+                     uint32_t oat_data_begin,
+                     uint32_t oat_data_end,
+                     uint32_t oat_file_end,
+                     uint32_t boot_image_begin,
+                     uint32_t boot_image_size,
+                     uint32_t boot_image_component_count,
+                     uint32_t boot_image_checksum,
+                     uint32_t pointer_size);
 
-  bool IsValid() const;
-  const char* GetMagic() const;
+  EXPORT bool IsValid() const;
+  EXPORT const char* GetMagic() const;
 
   uint32_t GetImageReservationSize() const {
     return image_reservation_size_;
@@ -198,7 +199,7 @@
     return reinterpret_cast<uint8_t*>(oat_file_end_);
   }
 
-  PointerSize GetPointerSize() const;
+  EXPORT PointerSize GetPointerSize() const;
 
   uint32_t GetPointerSizeUnchecked() const {
     return pointer_size_;
@@ -274,15 +275,15 @@
     kSectionCount,  // Number of elements in enum.
   };
 
-  static size_t NumberOfImageRoots(bool app_image ATTRIBUTE_UNUSED) {
+  static size_t NumberOfImageRoots([[maybe_unused]] bool app_image) {
     // At the moment, boot image and app image have the same number of roots,
     // though the meaning of the kSpecialRoots is different.
     return kImageRootsMax;
   }
 
-  ArtMethod* GetImageMethod(ImageMethod index) const;
+  EXPORT ArtMethod* GetImageMethod(ImageMethod index) const;
 
-  static const char* GetImageSectionName(ImageSections index);
+  EXPORT static const char* GetImageSectionName(ImageSections index);
 
   ImageSection& GetImageSection(ImageSections index) {
     DCHECK_LT(static_cast<size_t>(index), kSectionCount);
@@ -369,15 +370,13 @@
     return data_size_;
   }
 
-  bool IsAppImage() const;
+  EXPORT bool IsAppImage() const;
 
-  uint32_t GetImageSpaceCount() const;
+  EXPORT uint32_t GetImageSpaceCount() const;
 
   // Visit mirror::Objects in the section starting at base.
   // TODO: Delete base parameter if it is always equal to GetImageBegin.
-  void VisitObjects(ObjectVisitor* visitor,
-                    uint8_t* base,
-                    PointerSize pointer_size) const
+  EXPORT void VisitObjects(ObjectVisitor* visitor, uint8_t* base, PointerSize pointer_size) const
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Visit ArtMethods in the section starting at base. Includes runtime methods.
@@ -424,13 +423,13 @@
 
   // Helper for writing `data` and `bitmap_data` into `image_file`, following
   // the information stored in this header and passed as arguments.
-  bool WriteData(const ImageFileGuard& image_file,
-                 const uint8_t* data,
-                 const uint8_t* bitmap_data,
-                 ImageHeader::StorageMode image_storage_mode,
-                 uint32_t max_image_block_size,
-                 bool update_checksum,
-                 std::string* error_msg);
+  EXPORT bool WriteData(const ImageFileGuard& image_file,
+                        const uint8_t* data,
+                        const uint8_t* bitmap_data,
+                        ImageHeader::StorageMode image_storage_mode,
+                        uint32_t max_image_block_size,
+                        bool update_checksum,
+                        std::string* error_msg);
 
  private:
   static const uint8_t kImageMagic[4];
@@ -591,10 +590,10 @@
 
 std::ostream& operator<<(std::ostream& os, ImageHeader::ImageMethod method);
 std::ostream& operator<<(std::ostream& os, ImageHeader::ImageRoot root);
-std::ostream& operator<<(std::ostream& os, ImageHeader::ImageSections section);
-std::ostream& operator<<(std::ostream& os, ImageHeader::StorageMode mode);
+EXPORT std::ostream& operator<<(std::ostream& os, ImageHeader::ImageSections section);
+EXPORT std::ostream& operator<<(std::ostream& os, ImageHeader::StorageMode mode);
 
-std::ostream& operator<<(std::ostream& os, const ImageSection& section);
+EXPORT std::ostream& operator<<(std::ostream& os, const ImageSection& section);
 
 // Wrapper over LZ4_decompress_safe() that checks if return value is negative. See b/242914915.
 bool LZ4_decompress_safe_checked(const char* source,
@@ -606,4 +605,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_IMAGE_H_
+#endif  // ART_RUNTIME_OAT_IMAGE_H_
diff --git a/runtime/index_bss_mapping.cc b/runtime/oat/index_bss_mapping.cc
similarity index 98%
rename from runtime/index_bss_mapping.cc
rename to runtime/oat/index_bss_mapping.cc
index f6e083d..ce19230 100644
--- a/runtime/index_bss_mapping.cc
+++ b/runtime/oat/index_bss_mapping.cc
@@ -21,7 +21,7 @@
 #include "base/bit_utils.h"
 #include "base/length_prefixed_array.h"
 
-namespace art {
+namespace art HIDDEN {
 
 size_t IndexBssMappingEntry::GetBssOffset(size_t index_bits,
                                           uint32_t index,
diff --git a/runtime/index_bss_mapping.h b/runtime/oat/index_bss_mapping.h
similarity index 93%
rename from runtime/index_bss_mapping.h
rename to runtime/oat/index_bss_mapping.h
index dcbc05c..9fd4214 100644
--- a/runtime/index_bss_mapping.h
+++ b/runtime/oat/index_bss_mapping.h
@@ -14,14 +14,15 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_INDEX_BSS_MAPPING_H_
-#define ART_RUNTIME_INDEX_BSS_MAPPING_H_
+#ifndef ART_RUNTIME_OAT_INDEX_BSS_MAPPING_H_
+#define ART_RUNTIME_OAT_INDEX_BSS_MAPPING_H_
 
 #include <android-base/logging.h>
 
 #include "base/bit_utils.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template<typename T> class LengthPrefixedArray;
 
@@ -79,4 +80,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_INDEX_BSS_MAPPING_H_
+#endif  // ART_RUNTIME_OAT_INDEX_BSS_MAPPING_H_
diff --git a/runtime/oat.cc b/runtime/oat/oat.cc
similarity index 97%
rename from runtime/oat.cc
rename to runtime/oat/oat.cc
index 2c7a73f..9cec2e9 100644
--- a/runtime/oat.cc
+++ b/runtime/oat/oat.cc
@@ -25,7 +25,7 @@
 #include "base/bit_utils.h"
 #include "base/strlcpy.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -100,7 +100,7 @@
   if (version_ != kOatVersion) {
     return false;
   }
-  if (!IsAligned<kPageSize>(executable_offset_)) {
+  if (!IsAligned<kElfSegmentAlignment>(executable_offset_)) {
     return false;
   }
   if (!IsValidInstructionSet(instruction_set_)) {
@@ -122,8 +122,8 @@
                         kOatVersion[0], kOatVersion[1], kOatVersion[2], kOatVersion[3],
                         version_[0], version_[1], version_[2], version_[3]);
   }
-  if (!IsAligned<kPageSize>(executable_offset_)) {
-    return "Executable offset not page-aligned.";
+  if (!IsAligned<kElfSegmentAlignment>(executable_offset_)) {
+    return "Executable offset not properly aligned.";
   }
   if (!IsValidInstructionSet(instruction_set_)) {
     return StringPrintf("Invalid instruction set, %d.", static_cast<int>(instruction_set_));
@@ -199,13 +199,13 @@
 
 uint32_t OatHeader::GetExecutableOffset() const {
   DCHECK(IsValid());
-  DCHECK_ALIGNED(executable_offset_, kPageSize);
+  DCHECK_ALIGNED(executable_offset_, kElfSegmentAlignment);
   CHECK_GT(executable_offset_, sizeof(OatHeader));
   return executable_offset_;
 }
 
 void OatHeader::SetExecutableOffset(uint32_t executable_offset) {
-  DCHECK_ALIGNED(executable_offset, kPageSize);
+  DCHECK_ALIGNED(executable_offset, kElfSegmentAlignment);
   CHECK_GT(executable_offset, sizeof(OatHeader));
   DCHECK(IsValid());
   DCHECK_EQ(executable_offset_, 0U);
diff --git a/runtime/oat.h b/runtime/oat/oat.h
similarity index 94%
rename from runtime/oat.h
rename to runtime/oat/oat.h
index 3355d91..1d6a71a 100644
--- a/runtime/oat.h
+++ b/runtime/oat/oat.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_OAT_H_
-#define ART_RUNTIME_OAT_H_
+#ifndef ART_RUNTIME_OAT_OAT_H_
+#define ART_RUNTIME_OAT_OAT_H_
 
 #include <array>
 #include <vector>
@@ -24,7 +24,7 @@
 #include "base/macros.h"
 #include "base/safe_map.h"
 
-namespace art {
+namespace art HIDDEN {
 
 enum class InstructionSet;
 class InstructionSetFeatures;
@@ -41,11 +41,11 @@
 };
 std::ostream& operator<<(std::ostream& stream, StubType stub_type);
 
-class PACKED(4) OatHeader {
+class EXPORT PACKED(4) OatHeader {
  public:
   static constexpr std::array<uint8_t, 4> kOatMagic { { 'o', 'a', 't', '\n' } };
-  // Last oat version changed reason: Re-enable implicit suspend checks; b/291839153
-  static constexpr std::array<uint8_t, 4> kOatVersion{{'2', '3', '6', '\0'}};
+  // Last oat version changed reason: store resolved MethodType-s in .bss.
+  static constexpr std::array<uint8_t, 4> kOatVersion{{'2', '4', '1', '\0'}};
 
   static constexpr const char* kDex2OatCmdLineKey = "dex2oat-cmdline";
   static constexpr const char* kDebuggableKey = "debuggable";
@@ -164,4 +164,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_OAT_H_
+#endif  // ART_RUNTIME_OAT_OAT_H_
diff --git a/runtime/oat_file-inl.h b/runtime/oat/oat_file-inl.h
similarity index 96%
rename from runtime/oat_file-inl.h
rename to runtime/oat/oat_file-inl.h
index fd42e45..1a81f22 100644
--- a/runtime/oat_file-inl.h
+++ b/runtime/oat/oat_file-inl.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_OAT_FILE_INL_H_
-#define ART_RUNTIME_OAT_FILE_INL_H_
+#ifndef ART_RUNTIME_OAT_OAT_FILE_INL_H_
+#define ART_RUNTIME_OAT_OAT_FILE_INL_H_
 
 #include "oat_file.h"
 
@@ -23,7 +23,7 @@
 #include "oat_quick_method_header.h"
 #include "runtime-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 inline const OatQuickMethodHeader* OatFile::OatMethod::GetOatQuickMethodHeader() const {
   const void* code = EntryPointToCodePointer(GetQuickCode());
@@ -114,4 +114,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_OAT_FILE_INL_H_
+#endif  // ART_RUNTIME_OAT_OAT_FILE_INL_H_
diff --git a/runtime/oat_file.cc b/runtime/oat/oat_file.cc
similarity index 91%
rename from runtime/oat_file.cc
rename to runtime/oat/oat_file.cc
index 558441a..4e1c887 100644
--- a/runtime/oat_file.cc
+++ b/runtime/oat/oat_file.cc
@@ -17,6 +17,7 @@
 #include "oat_file.h"
 
 #include <dlfcn.h>
+
 #ifndef __APPLE__
 #include <link.h>  // for dl_iterate_phdr.
 #endif
@@ -73,7 +74,7 @@
 #include "vdex_file.h"
 #include "verifier/verifier_deps.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -114,9 +115,9 @@
                                   bool executable,
                                   bool low_4gb,
                                   ArrayRef<const std::string> dex_filenames,
-                                  ArrayRef<const int> dex_fds,
-                                  /*inout*/MemMap* reservation,  // Where to load if not null.
-                                  /*out*/std::string* error_msg);
+                                  ArrayRef<File> dex_files,
+                                  /*inout*/ MemMap* reservation,  // Where to load if not null.
+                                  /*out*/ std::string* error_msg);
 
   template <typename kOatFileBaseSubType>
   static OatFileBase* OpenOatFile(int zip_fd,
@@ -128,9 +129,9 @@
                                   bool executable,
                                   bool low_4gb,
                                   ArrayRef<const std::string> dex_filenames,
-                                  ArrayRef<const int> dex_fds,
-                                  /*inout*/MemMap* reservation,  // Where to load if not null.
-                                  /*out*/std::string* error_msg);
+                                  ArrayRef<File> dex_files,
+                                  /*inout*/ MemMap* reservation,  // Where to load if not null.
+                                  /*out*/ std::string* error_msg);
 
  protected:
   OatFileBase(const std::string& filename, bool executable) : OatFile(filename, executable) {}
@@ -171,7 +172,7 @@
 
   bool Setup(int zip_fd,
              ArrayRef<const std::string> dex_filenames,
-             ArrayRef<const int> dex_fds,
+             ArrayRef<File> dex_files,
              std::string* error_msg);
 
   bool Setup(const std::vector<const DexFile*>& dex_files, std::string* error_msg);
@@ -203,9 +204,9 @@
                                       bool executable,
                                       bool low_4gb,
                                       ArrayRef<const std::string> dex_filenames,
-                                      ArrayRef<const int> dex_fds,
-                                      /*inout*/MemMap* reservation,
-                                      /*out*/std::string* error_msg) {
+                                      ArrayRef<File> dex_files,
+                                      /*inout*/ MemMap* reservation,
+                                      /*out*/ std::string* error_msg) {
   std::unique_ptr<OatFileBase> ret(new kOatFileBaseSubType(location, executable));
 
   ret->PreLoad();
@@ -229,7 +230,7 @@
     return nullptr;
   }
 
-  if (!ret->Setup(zip_fd, dex_filenames, dex_fds, error_msg)) {
+  if (!ret->Setup(zip_fd, dex_filenames, dex_files, error_msg)) {
     return nullptr;
   }
 
@@ -246,9 +247,9 @@
                                       bool executable,
                                       bool low_4gb,
                                       ArrayRef<const std::string> dex_filenames,
-                                      ArrayRef<const int> dex_fds,
-                                      /*inout*/MemMap* reservation,
-                                      /*out*/std::string* error_msg) {
+                                      ArrayRef<File> dex_files,
+                                      /*inout*/ MemMap* reservation,
+                                      /*out*/ std::string* error_msg) {
   std::unique_ptr<OatFileBase> ret(new kOatFileBaseSubType(oat_location, executable));
 
   if (!ret->Load(oat_fd,
@@ -270,7 +271,7 @@
     return nullptr;
   }
 
-  if (!ret->Setup(zip_fd, dex_filenames, dex_fds, error_msg)) {
+  if (!ret->Setup(zip_fd, dex_filenames, dex_files, error_msg)) {
     return nullptr;
   }
 
@@ -547,13 +548,15 @@
       return false;
     }
     // Create an OatDexFile and add it to the owning container.
-    OatDexFile* oat_dex_file = new OatDexFile(
-        this,
-        dex_file->Begin(),
-        dex_file->GetLocationChecksum(),
-        dex_location,
-        canonical_location,
-        type_lookup_table_data);
+    OatDexFile* oat_dex_file = new OatDexFile(this,
+                                              dex_file->GetContainer(),
+                                              dex_file->Begin(),
+                                              dex_file->GetHeader().magic_,
+                                              dex_file->GetLocationChecksum(),
+                                              dex_file->GetSha1(),
+                                              dex_location,
+                                              canonical_location,
+                                              type_lookup_table_data);
     oat_dex_files_storage_.push_back(oat_dex_file);
 
     // Add the location and canonical location (if different) to the oat_dex_files_ table.
@@ -573,7 +576,7 @@
 
 bool OatFileBase::Setup(int zip_fd,
                         ArrayRef<const std::string> dex_filenames,
-                        ArrayRef<const int> dex_fds,
+                        ArrayRef<File> dex_files,
                         std::string* error_msg) {
   if (!GetOatHeader().IsValid()) {
     std::string cause = GetOatHeader().GetValidationErrorMessage();
@@ -619,7 +622,11 @@
   }
 
   DCHECK_GE(static_cast<size_t>(pointer_size), alignof(GcRoot<mirror::Object>));
-  if (!IsAligned<kPageSize>(bss_begin_) ||
+  // In certain cases, ELF can be mapped at an address which is page aligned,
+  // however not aligned to kElfSegmentAlignment. While technically this isn't
+  // correct as per requirement in the ELF header, it has to be supported for
+  // now. See also the comment at ImageHeader::RelocateImageReferences.
+  if (!IsAlignedParam(bss_begin_, MemMap::GetPageSize()) ||
       !IsAlignedParam(bss_methods_, static_cast<size_t>(pointer_size)) ||
       !IsAlignedParam(bss_roots_, static_cast<size_t>(pointer_size)) ||
       !IsAligned<alignof(GcRoot<mirror::Object>)>(bss_end_)) {
@@ -657,7 +664,8 @@
 
   std::string_view primary_location;
   std::string_view primary_location_replacement;
-  int dex_fd = -1;
+  File no_file;
+  File* dex_file = &no_file;
   size_t dex_filenames_pos = 0u;
   uint32_t dex_file_count = GetOatHeader().GetDexFileCount();
   oat_dex_files_storage_.reserve(dex_file_count);
@@ -689,7 +697,7 @@
     // Location encoded in the oat file. We will use this for multidex naming.
     std::string_view oat_dex_file_location(dex_file_location_data, dex_file_location_size);
     std::string dex_file_location(oat_dex_file_location);
-    bool is_multidex = DexFileLoader::IsMultiDexLocation(dex_file_location.c_str());
+    bool is_multidex = DexFileLoader::IsMultiDexLocation(dex_file_location);
     // Check that `is_multidex` does not clash with other indicators. The first dex location
     // must be primary location and, if we're opening external dex files, the location must
     // be multi-dex if and only if we already have a dex file opened for it.
@@ -714,7 +722,7 @@
           return false;
         }
         primary_location_replacement = dex_filenames[dex_filenames_pos];
-        dex_fd = dex_filenames_pos < dex_fds.size() ? dex_fds[dex_filenames_pos] : -1;
+        dex_file = dex_filenames_pos < dex_files.size() ? &dex_files[dex_filenames_pos] : &no_file;
         ++dex_filenames_pos;
       }
     }
@@ -743,6 +751,16 @@
       }
     }
 
+    DexFile::Magic dex_file_magic;
+    if (UNLIKELY(!ReadOatDexFileData(*this, &oat, &dex_file_magic))) {
+      *error_msg = StringPrintf(
+          "In oat file '%s' found OatDexFile #%zu for '%s' truncated after dex file magic",
+          GetLocation().c_str(),
+          i,
+          dex_file_location.c_str());
+      return false;
+    }
+
     uint32_t dex_file_checksum;
     if (UNLIKELY(!ReadOatDexFileData(*this, &oat, &dex_file_checksum))) {
       *error_msg = StringPrintf("In oat file '%s' found OatDexFile #%zu for '%s' truncated after "
@@ -753,6 +771,16 @@
       return false;
     }
 
+    DexFile::Sha1 dex_file_sha1;
+    if (UNLIKELY(!ReadOatDexFileData(*this, &oat, &dex_file_sha1))) {
+      *error_msg = StringPrintf(
+          "In oat file '%s' found OatDexFile #%zu for '%s' truncated after dex file sha1",
+          GetLocation().c_str(),
+          i,
+          dex_file_location.c_str());
+      return false;
+    }
+
     uint32_t dex_file_offset;
     if (UNLIKELY(!ReadOatDexFileData(*this, &oat, &dex_file_offset))) {
       *error_msg = StringPrintf("In oat file '%s' found OatDexFile #%zu for '%s' truncated "
@@ -772,6 +800,7 @@
                                 DexSize());
       return false;
     }
+    std::shared_ptr<DexFileContainer> dex_file_container;
     const uint8_t* dex_file_pointer = nullptr;
     if (UNLIKELY(dex_file_offset == 0U)) {
       // Do not support mixed-mode oat files.
@@ -788,26 +817,21 @@
         std::vector<std::unique_ptr<const DexFile>> new_dex_files;
         // No dex files, load it from location.
         bool loaded = false;
-        CHECK(zip_fd == -1 || dex_fds.empty());  // Allow only the supported combinations.
+        CHECK(zip_fd == -1 || dex_files.empty());  // Allow only the supported combinations.
         if (zip_fd != -1) {
-          ArtDexFileLoader dex_file_loader(zip_fd, dex_file_location);
-          loaded = dex_file_loader.Open(/*verify=*/false,
-                                        /*verify_checksum=*/false,
-                                        error_msg,
-                                        &new_dex_files);
-        } else if (dex_fd != -1) {
+          File file(zip_fd, /*check_usage=*/false);
+          ArtDexFileLoader dex_file_loader(&file, dex_file_location);
+          loaded = dex_file_loader.Open(
+              /*verify=*/false, /*verify_checksum=*/false, error_msg, &new_dex_files);
+        } else if (dex_file->IsValid()) {
           // Note that we assume dex_fds are backing by jars.
-          ArtDexFileLoader dex_file_loader(DupCloexec(dex_fd), dex_file_location);
-          loaded = dex_file_loader.Open(/*verify=*/false,
-                                        /*verify_checksum=*/false,
-                                        error_msg,
-                                        &new_dex_files);
+          ArtDexFileLoader dex_file_loader(dex_file, dex_file_location);
+          loaded = dex_file_loader.Open(
+              /*verify=*/false, /*verify_checksum=*/false, error_msg, &new_dex_files);
         } else {
           ArtDexFileLoader dex_file_loader(dex_file_name.c_str(), dex_file_location);
-          loaded = dex_file_loader.Open(/*verify=*/false,
-                                        /*verify_checksum=*/false,
-                                        error_msg,
-                                        &new_dex_files);
+          loaded = dex_file_loader.Open(
+              /*verify=*/false, /*verify_checksum=*/false, error_msg, &new_dex_files);
         }
         if (!loaded) {
           if (Runtime::Current() == nullptr) {
@@ -816,9 +840,8 @@
             LOG(WARNING) << "Could not find associated dex files of oat file. "
                          << "Oatdump will only dump the header.";
             return true;
-          } else {
-            return false;
           }
+          return false;
         }
         // The oat file may be out of date wrt/ the dex-file location. We need to be defensive
         // here and ensure that at least the number of dex files still matches.
@@ -840,14 +863,15 @@
                                     dex_file_location.c_str());
           return false;
         }
-        for (std::unique_ptr<const DexFile>& dex_file : new_dex_files) {
-          external_dex_files_.push_back(std::move(dex_file));
+        for (std::unique_ptr<const DexFile>& dex_file_ptr : new_dex_files) {
+          external_dex_files_.push_back(std::move(dex_file_ptr));
         }
       }
       // Defensively verify external dex file checksum. `OatFileAssistant`
       // expects this check to happen during oat file setup when the oat file
       // does not contain dex code.
       if (dex_file_checksum != external_dex_files_[i]->GetLocationChecksum()) {
+        CHECK(dex_file_sha1 != external_dex_files_[i]->GetSha1());
         *error_msg = StringPrintf("In oat file '%s', dex file checksum 0x%08x does not match"
                                       " checksum 0x%08x of external dex file '%s'",
                                   GetLocation().c_str(),
@@ -856,6 +880,8 @@
                                   external_dex_files_[i]->GetLocation().c_str());
         return false;
       }
+      CHECK(dex_file_sha1 == external_dex_files_[i]->GetSha1());
+      dex_file_container = external_dex_files_[i]->GetContainer();
       dex_file_pointer = external_dex_files_[i]->Begin();
     } else {
       // Do not support mixed-mode oat files.
@@ -878,6 +904,7 @@
                                   sizeof(DexFile::Header));
         return false;
       }
+      dex_file_container = std::make_shared<MemoryDexFileContainer>(DexBegin(), DexEnd());
       dex_file_pointer = DexBegin() + dex_file_offset;
     }
 
@@ -989,6 +1016,7 @@
     const IndexBssMapping* public_type_bss_mapping;
     const IndexBssMapping* package_type_bss_mapping;
     const IndexBssMapping* string_bss_mapping;
+    const IndexBssMapping* method_type_bss_mapping = nullptr;
     auto read_index_bss_mapping = [&](const char* tag, /*out*/const IndexBssMapping** mapping) {
       return ReadIndexBssMapping(this, &oat, i, dex_file_location, tag, mapping, error_msg);
     };
@@ -996,25 +1024,30 @@
         !read_index_bss_mapping("type", &type_bss_mapping) ||
         !read_index_bss_mapping("public type", &public_type_bss_mapping) ||
         !read_index_bss_mapping("package type", &package_type_bss_mapping) ||
-        !read_index_bss_mapping("string", &string_bss_mapping)) {
+        !read_index_bss_mapping("string", &string_bss_mapping) ||
+        !read_index_bss_mapping("method type", &method_type_bss_mapping)) {
       return false;
     }
 
     // Create the OatDexFile and add it to the owning container.
-    OatDexFile* oat_dex_file = new OatDexFile(
-        this,
-        dex_file_location,
-        DexFileLoader::GetDexCanonicalLocation(dex_file_name.c_str()),
-        dex_file_checksum,
-        dex_file_pointer,
-        lookup_table_data,
-        method_bss_mapping,
-        type_bss_mapping,
-        public_type_bss_mapping,
-        package_type_bss_mapping,
-        string_bss_mapping,
-        class_offsets_pointer,
-        dex_layout_sections);
+    OatDexFile* oat_dex_file =
+        new OatDexFile(this,
+                       dex_file_location,
+                       DexFileLoader::GetDexCanonicalLocation(dex_file_name.c_str()),
+                       dex_file_magic,
+                       dex_file_checksum,
+                       dex_file_sha1,
+                       dex_file_container,
+                       dex_file_pointer,
+                       lookup_table_data,
+                       method_bss_mapping,
+                       type_bss_mapping,
+                       public_type_bss_mapping,
+                       package_type_bss_mapping,
+                       string_bss_mapping,
+                       method_type_bss_mapping,
+                       class_offsets_pointer,
+                       dex_layout_sections);
     oat_dex_files_storage_.push_back(oat_dex_file);
 
     // Add the location and canonical location (if different) to the oat_dex_files_ table.
@@ -1159,12 +1192,12 @@
             /*inout*/MemMap* reservation,  // Where to load if not null.
             /*out*/std::string* error_msg) override;
 
-  bool Load(int oat_fd ATTRIBUTE_UNUSED,
-            bool writable ATTRIBUTE_UNUSED,
-            bool executable ATTRIBUTE_UNUSED,
-            bool low_4gb ATTRIBUTE_UNUSED,
-            /*inout*/MemMap* reservation ATTRIBUTE_UNUSED,
-            /*out*/std::string* error_msg ATTRIBUTE_UNUSED) override {
+  bool Load([[maybe_unused]] int oat_fd,
+            [[maybe_unused]] bool writable,
+            [[maybe_unused]] bool executable,
+            [[maybe_unused]] bool low_4gb,
+            [[maybe_unused]] /*inout*/ MemMap* reservation,
+            [[maybe_unused]] /*out*/ std::string* error_msg) override {
     return false;
   }
 
@@ -1211,8 +1244,8 @@
 #else
   // Count the entries in dl_iterate_phdr we get at this point in time.
   struct dl_iterate_context {
-    static int callback(dl_phdr_info* info ATTRIBUTE_UNUSED,
-                        size_t size ATTRIBUTE_UNUSED,
+    static int callback([[maybe_unused]] dl_phdr_info* info,
+                        [[maybe_unused]] size_t size,
                         void* data) {
       reinterpret_cast<dl_iterate_context*>(data)->count++;
       return 0;  // Continue iteration.
@@ -1335,7 +1368,7 @@
     if (reservation != nullptr && dlopen_handle_ != nullptr) {
       // Find used pages from the reservation.
       struct dl_iterate_context {
-        static int callback(dl_phdr_info* info, size_t size ATTRIBUTE_UNUSED, void* data) {
+        static int callback(dl_phdr_info* info, [[maybe_unused]] size_t size, void* data) {
           auto* context = reinterpret_cast<dl_iterate_context*>(data);
           static_assert(std::is_same<Elf32_Half, Elf64_Half>::value, "Half must match");
           using Elf_Half = Elf64_Half;
@@ -1391,7 +1424,10 @@
       // Take ownership of the memory used by the shared object. dlopen() does not assume
       // full ownership of this memory and dlclose() shall just remap it as zero pages with
       // PROT_NONE. We need to unmap the memory when destroying this oat file.
-      dlopen_mmaps_.push_back(reservation->TakeReservedMemory(context.max_size));
+      // The reserved memory size is aligned up to kElfSegmentAlignment to ensure
+      // that the next reserved area will be aligned to the value.
+      dlopen_mmaps_.push_back(reservation->TakeReservedMemory(
+          CondRoundUp<kPageSizeAgnostic>(context.max_size, kElfSegmentAlignment)));
     }
 #else
     static_assert(!kIsTargetBuild || kIsTargetLinux || kIsTargetFuchsia,
@@ -1433,7 +1469,7 @@
     size_t memsz;
   };
   struct dl_iterate_context {
-    static int callback(dl_phdr_info* info, size_t size ATTRIBUTE_UNUSED, void* data) {
+    static int callback(dl_phdr_info* info, [[maybe_unused]] size_t size, void* data) {
       auto* context = reinterpret_cast<dl_iterate_context*>(data);
       static_assert(std::is_same<Elf32_Half, Elf64_Half>::value, "Half must match");
       using Elf_Half = Elf64_Half;
@@ -1597,8 +1633,7 @@
             /*inout*/MemMap* reservation,  // Where to load if not null.
             /*out*/std::string* error_msg) override;
 
-  void PreSetup(const std::string& elf_filename ATTRIBUTE_UNUSED) override {
-  }
+  void PreSetup([[maybe_unused]] const std::string& elf_filename) override {}
 
  private:
   bool ElfFileOpen(File* file,
@@ -1633,7 +1668,7 @@
   SetBegin(elf_file->Begin() + offset);
   SetEnd(elf_file->Begin() + size + offset);
   // Ignore the optional .bss section when opening non-executable.
-  return Setup(zip_fd, dex_filenames, /*dex_fds=*/ArrayRef<const int>(), error_msg);
+  return Setup(zip_fd, dex_filenames, /*dex_files=*/{}, error_msg);
 }
 
 bool ElfOatFile::Load(const std::string& elf_filename,
@@ -1736,6 +1771,8 @@
     if (vdex_file->HasDexSection()) {
       uint32_t i = 0;
       const uint8_t* type_lookup_table_start = nullptr;
+      auto dex_file_container =
+          std::make_shared<MemoryDexFileContainer>(vdex_file->Begin(), vdex_file->End());
       for (const uint8_t* dex_file_start = vdex_file->GetNextDexFileData(nullptr, i);
            dex_file_start != nullptr;
            dex_file_start = vdex_file->GetNextDexFileData(dex_file_start, ++i)) {
@@ -1782,8 +1819,11 @@
         }
 
         OatDexFile* oat_dex_file = new OatDexFile(oat_file.get(),
+                                                  dex_file_container,
                                                   dex_file_start,
+                                                  header->magic_,
                                                   vdex_file->GetLocationChecksum(i),
+                                                  header->signature_,
                                                   location,
                                                   canonical_location,
                                                   type_lookup_table_data);
@@ -1802,7 +1842,8 @@
       // a vdex file.
       bool loaded = false;
       if (zip_fd != -1) {
-        ArtDexFileLoader dex_file_loader(zip_fd, dex_location);
+        File file(zip_fd, /*check_usage=*/false);
+        ArtDexFileLoader dex_file_loader(&file, dex_location);
         loaded = dex_file_loader.Open(/*verify=*/false,
                                       /*verify_checksum=*/false,
                                       error_msg,
@@ -1853,29 +1894,29 @@
  protected:
   void PreLoad() override {}
 
-  bool Load(const std::string& elf_filename ATTRIBUTE_UNUSED,
-            bool writable ATTRIBUTE_UNUSED,
-            bool executable ATTRIBUTE_UNUSED,
-            bool low_4gb ATTRIBUTE_UNUSED,
-            MemMap* reservation ATTRIBUTE_UNUSED,
-            std::string* error_msg ATTRIBUTE_UNUSED) override {
+  bool Load([[maybe_unused]] const std::string& elf_filename,
+            [[maybe_unused]] bool writable,
+            [[maybe_unused]] bool executable,
+            [[maybe_unused]] bool low_4gb,
+            [[maybe_unused]] MemMap* reservation,
+            [[maybe_unused]] std::string* error_msg) override {
     LOG(FATAL) << "Unsupported";
     UNREACHABLE();
   }
 
-  bool Load(int oat_fd ATTRIBUTE_UNUSED,
-            bool writable ATTRIBUTE_UNUSED,
-            bool executable ATTRIBUTE_UNUSED,
-            bool low_4gb ATTRIBUTE_UNUSED,
-            MemMap* reservation ATTRIBUTE_UNUSED,
-            std::string* error_msg ATTRIBUTE_UNUSED) override {
+  bool Load([[maybe_unused]] int oat_fd,
+            [[maybe_unused]] bool writable,
+            [[maybe_unused]] bool executable,
+            [[maybe_unused]] bool low_4gb,
+            [[maybe_unused]] MemMap* reservation,
+            [[maybe_unused]] std::string* error_msg) override {
     LOG(FATAL) << "Unsupported";
     UNREACHABLE();
   }
 
-  void PreSetup(const std::string& elf_filename ATTRIBUTE_UNUSED) override {}
+  void PreSetup([[maybe_unused]] const std::string& elf_filename) override {}
 
-  const uint8_t* FindDynamicSymbolAddress(const std::string& symbol_name ATTRIBUTE_UNUSED,
+  const uint8_t* FindDynamicSymbolAddress([[maybe_unused]] const std::string& symbol_name,
                                           std::string* error_msg) const override {
     *error_msg = "Unsupported";
     return nullptr;
@@ -1901,9 +1942,9 @@
                        bool executable,
                        bool low_4gb,
                        ArrayRef<const std::string> dex_filenames,
-                       ArrayRef<const int> dex_fds,
-                       /*inout*/MemMap* reservation,
-                       /*out*/std::string* error_msg) {
+                       ArrayRef<File> dex_files,
+                       /*inout*/ MemMap* reservation,
+                       /*out*/ std::string* error_msg) {
   ScopedTrace trace("Open oat file " + oat_location);
   CHECK(!oat_filename.empty()) << oat_location;
   CheckLocation(oat_location);
@@ -1928,7 +1969,7 @@
                                                                  executable,
                                                                  low_4gb,
                                                                  dex_filenames,
-                                                                 dex_fds,
+                                                                 dex_files,
                                                                  reservation,
                                                                  error_msg);
   if (with_dlopen != nullptr) {
@@ -1958,7 +1999,7 @@
                                                                 executable,
                                                                 low_4gb,
                                                                 dex_filenames,
-                                                                dex_fds,
+                                                                dex_files,
                                                                 reservation,
                                                                 error_msg);
   return with_internal;
@@ -1971,9 +2012,9 @@
                        bool executable,
                        bool low_4gb,
                        ArrayRef<const std::string> dex_filenames,
-                       ArrayRef<const int> dex_fds,
-                       /*inout*/MemMap* reservation,
-                       /*out*/std::string* error_msg) {
+                       ArrayRef<File> dex_files,
+                       /*inout*/ MemMap* reservation,
+                       /*out*/ std::string* error_msg) {
   CHECK(!oat_location.empty()) << oat_location;
 
   std::string vdex_location = GetVdexFilename(oat_location);
@@ -1987,7 +2028,7 @@
                                                                 executable,
                                                                 low_4gb,
                                                                 dex_filenames,
-                                                                dex_fds,
+                                                                dex_files,
                                                                 reservation,
                                                                 error_msg);
   return with_internal;
@@ -2085,9 +2126,7 @@
   }
 }
 
-const OatDexFile* OatFile::GetOatDexFile(const char* dex_location,
-                                         const uint32_t* dex_location_checksum,
-                                         std::string* error_msg) const {
+const OatDexFile* OatFile::GetOatDexFile(const char* dex_location, std::string* error_msg) const {
   // NOTE: We assume here that the canonical location for a given dex_location never
   // changes. If it does (i.e. some symlink used by the filename changes) we may return
   // an incorrect OatDexFile. As long as we have a checksum to check, we shall return
@@ -2139,25 +2178,16 @@
     return nullptr;
   }
 
-  if (dex_location_checksum != nullptr &&
-      oat_dex_file->GetDexFileLocationChecksum() != *dex_location_checksum) {
-    if (error_msg != nullptr) {
-      std::string dex_canonical_location = DexFileLoader::GetDexCanonicalLocation(dex_location);
-      std::string checksum = StringPrintf("0x%08x", oat_dex_file->GetDexFileLocationChecksum());
-      std::string required_checksum = StringPrintf("0x%08x", *dex_location_checksum);
-      *error_msg = "OatDexFile for DexFile " + std::string(dex_location)
-          + " (canonical path " + dex_canonical_location + ") in OatFile " + GetLocation()
-          + " has checksum " + checksum + " but " + required_checksum + " was required";
-    }
-    return nullptr;
-  }
   return oat_dex_file;
 }
 
 OatDexFile::OatDexFile(const OatFile* oat_file,
                        const std::string& dex_file_location,
                        const std::string& canonical_dex_file_location,
+                       DexFile::Magic dex_file_magic,
                        uint32_t dex_file_location_checksum,
+                       DexFile::Sha1 dex_file_sha1,
+                       const std::shared_ptr<DexFileContainer>& dex_file_container,
                        const uint8_t* dex_file_pointer,
                        const uint8_t* lookup_table_data,
                        const IndexBssMapping* method_bss_mapping_data,
@@ -2165,12 +2195,16 @@
                        const IndexBssMapping* public_type_bss_mapping_data,
                        const IndexBssMapping* package_type_bss_mapping_data,
                        const IndexBssMapping* string_bss_mapping_data,
+                       const IndexBssMapping* method_type_bss_mapping_data,
                        const uint32_t* oat_class_offsets_pointer,
                        const DexLayoutSections* dex_layout_sections)
     : oat_file_(oat_file),
       dex_file_location_(dex_file_location),
       canonical_dex_file_location_(canonical_dex_file_location),
+      dex_file_magic_(dex_file_magic),
       dex_file_location_checksum_(dex_file_location_checksum),
+      dex_file_sha1_(dex_file_sha1),
+      dex_file_container_(dex_file_container),
       dex_file_pointer_(dex_file_pointer),
       lookup_table_data_(lookup_table_data),
       method_bss_mapping_(method_bss_mapping_data),
@@ -2178,6 +2212,7 @@
       public_type_bss_mapping_(public_type_bss_mapping_data),
       package_type_bss_mapping_(package_type_bss_mapping_data),
       string_bss_mapping_(string_bss_mapping_data),
+      method_type_bss_mapping_(method_type_bss_mapping_data),
       oat_class_offsets_pointer_(oat_class_offsets_pointer),
       lookup_table_(),
       dex_layout_sections_(dex_layout_sections) {
@@ -2189,7 +2224,7 @@
   // Initialize TypeLookupTable.
   if (lookup_table_data_ != nullptr) {
     // Peek the number of classes from the DexFile.
-    const DexFile::Header* dex_header = reinterpret_cast<const DexFile::Header*>(dex_file_pointer_);
+    auto* dex_header = reinterpret_cast<const DexFile::Header*>(dex_file_pointer_);
     const uint32_t num_class_defs = dex_header->class_defs_size_;
     if (lookup_table_data_ + TypeLookupTable::RawDataLength(num_class_defs) >
             GetOatFile()->DexEnd()) {
@@ -2197,6 +2232,9 @@
     } else {
       const uint8_t* dex_data = dex_file_pointer_;
       // TODO: Clean this up to create the type lookup table after the dex file has been created?
+      if (StandardDexFile::IsMagicValid(dex_header->magic_)) {
+        dex_data -= dex_header->HeaderOffset();
+      }
       if (CompactDexFile::IsMagicValid(dex_header->magic_)) {
         dex_data += dex_header->data_off_;
       }
@@ -2206,15 +2244,21 @@
 }
 
 OatDexFile::OatDexFile(const OatFile* oat_file,
+                       const std::shared_ptr<DexFileContainer>& dex_file_container,
                        const uint8_t* dex_file_pointer,
+                       DexFile::Magic dex_file_magic,
                        uint32_t dex_file_location_checksum,
+                       DexFile::Sha1 dex_file_sha1,
                        const std::string& dex_file_location,
                        const std::string& canonical_dex_file_location,
                        const uint8_t* lookup_table_data)
     : oat_file_(oat_file),
       dex_file_location_(dex_file_location),
       canonical_dex_file_location_(canonical_dex_file_location),
+      dex_file_magic_(dex_file_magic),
       dex_file_location_checksum_(dex_file_location_checksum),
+      dex_file_sha1_(dex_file_sha1),
+      dex_file_container_(dex_file_container),
       dex_file_pointer_(dex_file_pointer),
       lookup_table_data_(lookup_table_data) {
   InitializeTypeLookupTable();
@@ -2240,9 +2284,13 @@
   ScopedTrace trace(__PRETTY_FUNCTION__);
   static constexpr bool kVerify = false;
   static constexpr bool kVerifyChecksum = false;
-  ArtDexFileLoader dex_file_loader(dex_file_pointer_, FileSize(), dex_file_location_);
-  return dex_file_loader.Open(
-      dex_file_location_checksum_, this, kVerify, kVerifyChecksum, error_msg);
+  ArtDexFileLoader dex_file_loader(dex_file_container_, dex_file_location_);
+  return dex_file_loader.OpenOne(dex_file_pointer_ - dex_file_container_->Begin(),
+                                 dex_file_location_checksum_,
+                                 this,
+                                 kVerify,
+                                 kVerifyChecksum,
+                                 error_msg);
 }
 
 uint32_t OatDexFile::GetOatClassOffset(uint16_t class_def_index) const {
@@ -2532,6 +2580,10 @@
   CHECK(Runtime::Current()->IsAotCompiler());
 }
 
+uint32_t OatDexFile::GetDexVersion() const {
+  return atoi(reinterpret_cast<const char*>(&dex_file_magic_[4]));
+}
+
 bool OatFile::IsBackedByVdexOnly() const {
   return oat_dex_files_storage_.size() >= 1 && oat_dex_files_storage_[0]->IsBackedByVdexOnly();
 }
diff --git a/runtime/oat_file.h b/runtime/oat/oat_file.h
similarity index 82%
rename from runtime/oat_file.h
rename to runtime/oat/oat_file.h
index b7fa867..3c7aaa7 100644
--- a/runtime/oat_file.h
+++ b/runtime/oat/oat_file.h
@@ -14,31 +14,33 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_OAT_FILE_H_
-#define ART_RUNTIME_OAT_FILE_H_
+#ifndef ART_RUNTIME_OAT_OAT_FILE_H_
+#define ART_RUNTIME_OAT_OAT_FILE_H_
 
 #include <list>
+#include <memory>
 #include <string>
 #include <string_view>
 #include <vector>
 
 #include "base/array_ref.h"
 #include "base/compiler_filter.h"
+#include "base/macros.h"
 #include "base/mutex.h"
 #include "base/os.h"
 #include "base/safe_map.h"
 #include "base/tracking_safe_map.h"
 #include "class_status.h"
+#include "dex/dex_file.h"
 #include "dex/dex_file_layout.h"
 #include "dex/type_lookup_table.h"
 #include "dex/utf.h"
 #include "index_bss_mapping.h"
 #include "mirror/object.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class BitVector;
-class DexFile;
 class ClassLoaderContext;
 class ElfFile;
 class DexLayoutSections;
@@ -75,7 +77,7 @@
   kOatClassMax = 3,
 };
 
-std::ostream& operator<<(std::ostream& os, OatClassType rhs);
+EXPORT std::ostream& operator<<(std::ostream& os, OatClassType rhs);
 
 class PACKED(4) OatMethodOffsets {
  public:
@@ -104,31 +106,31 @@
   // from oat file when opening the dex files if they are not embedded in the
   // vdex file. These may differ for cross-compilation (the dex file name is
   // the host path and dex location is the future path on target) and testing.
-  static OatFile* Open(int zip_fd,
-                       const std::string& filename,
-                       const std::string& location,
-                       bool executable,
-                       bool low_4gb,
-                       ArrayRef<const std::string> dex_filenames,
-                       ArrayRef<const int> dex_fds,
-                       /*inout*/MemMap* reservation,  // Where to load if not null.
-                       /*out*/std::string* error_msg);
+  EXPORT static OatFile* Open(int zip_fd,
+                              const std::string& filename,
+                              const std::string& location,
+                              bool executable,
+                              bool low_4gb,
+                              ArrayRef<const std::string> dex_filenames,
+                              ArrayRef<File> dex_files,
+                              /*inout*/ MemMap* reservation,  // Where to load if not null.
+                              /*out*/ std::string* error_msg);
   // Helper overload that takes a single dex filename and no reservation.
-  static OatFile* Open(int zip_fd,
-                       const std::string& filename,
-                       const std::string& location,
-                       bool executable,
-                       bool low_4gb,
-                       const std::string& dex_filename,
-                       /*out*/std::string* error_msg) {
+  EXPORT static OatFile* Open(int zip_fd,
+                              const std::string& filename,
+                              const std::string& location,
+                              bool executable,
+                              bool low_4gb,
+                              const std::string& dex_filename,
+                              /*out*/ std::string* error_msg) {
     return Open(zip_fd,
                 filename,
                 location,
                 executable,
                 low_4gb,
-                ArrayRef<const std::string>(&dex_filename, /*size=*/ 1u),
-                /*dex_fds=*/ ArrayRef<const int>(),  // not currently supported
-                /*reservation=*/ nullptr,
+                ArrayRef<const std::string>(&dex_filename, /*size=*/1u),
+                /*dex_files=*/{},  // not currently supported
+                /*reservation=*/nullptr,
                 error_msg);
   }
   // Helper overload that takes no dex filename and no reservation.
@@ -143,9 +145,9 @@
                 location,
                 executable,
                 low_4gb,
-                /*dex_filenames=*/ ArrayRef<const std::string>(),
-                /*dex_fds=*/ ArrayRef<const int>(),  // not currently supported
-                /*reservation=*/ nullptr,
+                /*dex_filenames=*/{},
+                /*dex_files=*/{},  // not currently supported
+                /*reservation=*/nullptr,
                 error_msg);
   }
 
@@ -159,9 +161,9 @@
                        bool executable,
                        bool low_4gb,
                        ArrayRef<const std::string> dex_filenames,
-                       ArrayRef<const int> dex_fds,
-                       /*inout*/MemMap* reservation,  // Where to load if not null.
-                       /*out*/std::string* error_msg);
+                       ArrayRef<File> dex_files,
+                       /*inout*/ MemMap* reservation,  // Where to load if not null.
+                       /*out*/ std::string* error_msg);
 
   // Initialize OatFile instance from an already loaded VdexFile. This assumes
   // the vdex does not have a dex section and accepts a vector of DexFiles separately.
@@ -190,7 +192,7 @@
   // Indicates whether the oat file was compiled with full debugging capability.
   bool IsDebuggable() const;
 
-  CompilerFilter::Filter GetCompilerFilter() const;
+  EXPORT CompilerFilter::Filter GetCompilerFilter() const;
 
   std::string GetClassLoaderContext() const;
 
@@ -200,7 +202,7 @@
     return location_;
   }
 
-  const OatHeader& GetOatHeader() const;
+  EXPORT const OatHeader& GetOatHeader() const;
 
   class OatMethod final {
    public:
@@ -259,17 +261,17 @@
     // defintion. Direct methods come first, followed by virtual
     // methods. Note that runtime created methods such as miranda
     // methods are not included.
-    const OatMethod GetOatMethod(uint32_t method_index) const;
+    EXPORT const OatMethod GetOatMethod(uint32_t method_index) const;
 
     // Return a pointer to the OatMethodOffsets for the requested
     // method_index, or null if none is present. Note that most
     // callers should use GetOatMethod.
-    const OatMethodOffsets* GetOatMethodOffsets(uint32_t method_index) const;
+    EXPORT const OatMethodOffsets* GetOatMethodOffsets(uint32_t method_index) const;
 
     // Return the offset from the start of the OatFile to the
     // OatMethodOffsets for the requested method_index, or 0 if none
     // is present. Note that most callers should use GetOatMethod.
-    uint32_t GetOatMethodOffsetsOffset(uint32_t method_index) const;
+    EXPORT uint32_t GetOatMethodOffsetsOffset(uint32_t method_index) const;
 
     // A representation of an invalid OatClass, used when an OatClass can't be found.
     // See FindOatClass().
@@ -306,8 +308,7 @@
   // If error_msg is non-null and no OatDexFile is returned, error_msg will
   // be updated with a description of why no OatDexFile was returned.
   const OatDexFile* GetOatDexFile(const char* dex_location,
-                                  const uint32_t* const dex_location_checksum,
-                                  /*out*/std::string* error_msg = nullptr) const
+                                  /*out*/ std::string* error_msg = nullptr) const
       REQUIRES(!secondary_lookup_lock_);
 
   const std::vector<const OatDexFile*>& GetOatDexFiles() const {
@@ -348,8 +349,8 @@
     return DexEnd() - DexBegin();
   }
 
-  const uint8_t* Begin() const;
-  const uint8_t* End() const;
+  EXPORT const uint8_t* Begin() const;
+  EXPORT const uint8_t* End() const;
 
   const uint8_t* DataBimgRelRoBegin() const { return data_bimg_rel_ro_begin_; }
   const uint8_t* DataBimgRelRoEnd() const { return data_bimg_rel_ro_end_; }
@@ -360,19 +361,19 @@
   const uint8_t* VdexBegin() const { return vdex_begin_; }
   const uint8_t* VdexEnd() const { return vdex_end_; }
 
-  const uint8_t* DexBegin() const;
-  const uint8_t* DexEnd() const;
+  EXPORT const uint8_t* DexBegin() const;
+  EXPORT const uint8_t* DexEnd() const;
 
-  ArrayRef<const uint32_t> GetBootImageRelocations() const;
-  ArrayRef<ArtMethod*> GetBssMethods() const;
-  ArrayRef<GcRoot<mirror::Object>> GetBssGcRoots() const;
+  EXPORT ArrayRef<const uint32_t> GetBootImageRelocations() const;
+  EXPORT ArrayRef<ArtMethod*> GetBssMethods() const;
+  EXPORT ArrayRef<GcRoot<mirror::Object>> GetBssGcRoots() const;
 
   // Initialize relocation sections (.data.bimg.rel.ro and .bss).
   void InitializeRelocations() const;
 
   // Finds the associated oat class for a dex_file and descriptor. Returns an invalid OatClass on
   // error and sets found to false.
-  static OatClass FindOatClass(const DexFile& dex_file, uint16_t class_def_idx, bool* found);
+  EXPORT static OatClass FindOatClass(const DexFile& dex_file, uint16_t class_def_idx, bool* found);
 
   VdexFile* GetVdexFile() const {
     return vdex_.get();
@@ -392,6 +393,7 @@
     const IndexBssMapping* public_type_bss_mapping = nullptr;
     const IndexBssMapping* package_type_bss_mapping = nullptr;
     const IndexBssMapping* string_bss_mapping = nullptr;
+    const IndexBssMapping* method_type_bss_mapping = nullptr;
   };
 
   ArrayRef<const BssMappingInfo> GetBcpBssInfo() const {
@@ -502,7 +504,7 @@
 class OatDexFile final {
  public:
   // Opens the DexFile referred to by this OatDexFile from within the containing OatFile.
-  std::unique_ptr<const DexFile> OpenDexFile(std::string* error_msg) const;
+  EXPORT std::unique_ptr<const DexFile> OpenDexFile(std::string* error_msg) const;
 
   // May return null if the OatDexFile only contains a type lookup table. This case only happens
   // for the compiler to speed up compilation, or in jitzygote.
@@ -511,28 +513,40 @@
   }
 
   // Returns the size of the DexFile refered to by this OatDexFile.
-  size_t FileSize() const;
+  EXPORT size_t FileSize() const;
 
   // Returns original path of DexFile that was the source of this OatDexFile.
   const std::string& GetDexFileLocation() const {
     return dex_file_location_;
   }
 
+  // Returns original path of DexFile that was the source of this OatDexFile.
+  const std::string& GetLocation() const { return dex_file_location_; }
+
   // Returns the canonical location of DexFile that was the source of this OatDexFile.
   const std::string& GetCanonicalDexFileLocation() const {
     return canonical_dex_file_location_;
   }
 
+  DexFile::Magic GetMagic() const { return dex_file_magic_; }
+
+  uint32_t GetDexVersion() const;
+
   // Returns checksum of original DexFile that was the source of this OatDexFile;
   uint32_t GetDexFileLocationChecksum() const {
     return dex_file_location_checksum_;
   }
 
+  // Returns checksum of original DexFile that was the source of this OatDexFile;
+  uint32_t GetLocationChecksum() const { return dex_file_location_checksum_; }
+
+  DexFile::Sha1 GetSha1() const { return dex_file_sha1_; }
+
   // Returns the OatClass for the class specified by the given DexFile class_def_index.
-  OatFile::OatClass GetOatClass(uint16_t class_def_index) const;
+  EXPORT OatFile::OatClass GetOatClass(uint16_t class_def_index) const;
 
   // Returns the offset to the OatClass information. Most callers should use GetOatClass.
-  uint32_t GetOatClassOffset(uint16_t class_def_index) const;
+  EXPORT uint32_t GetOatClassOffset(uint16_t class_def_index) const;
 
   const uint8_t* GetLookupTableData() const {
     return lookup_table_data_;
@@ -558,24 +572,28 @@
     return string_bss_mapping_;
   }
 
+  const IndexBssMapping* GetMethodTypeBssMapping() const {
+    return method_type_bss_mapping_;
+  }
+
   const uint8_t* GetDexFilePointer() const {
     return dex_file_pointer_;
   }
 
   // Looks up a class definition by its class descriptor. Hash must be
   // ComputeModifiedUtf8Hash(descriptor).
-  static const dex::ClassDef* FindClassDef(const DexFile& dex_file,
-                                           const char* descriptor,
-                                           size_t hash);
+  EXPORT static const dex::ClassDef* FindClassDef(const DexFile& dex_file,
+                                                  const char* descriptor,
+                                                  size_t hash);
 
   const TypeLookupTable& GetTypeLookupTable() const {
     return lookup_table_;
   }
 
-  ~OatDexFile();
+  EXPORT ~OatDexFile();
 
   // Create only with a type lookup table, used by the compiler to speed up compilation.
-  explicit OatDexFile(TypeLookupTable&& lookup_table);
+  EXPORT explicit OatDexFile(TypeLookupTable&& lookup_table);
 
   // Return the dex layout sections.
   const DexLayoutSections* GetDexLayoutSections() const {
@@ -586,7 +604,10 @@
   OatDexFile(const OatFile* oat_file,
              const std::string& dex_file_location,
              const std::string& canonical_dex_file_location,
+             DexFile::Magic dex_file_magic,
              uint32_t dex_file_checksum,
+             DexFile::Sha1 dex_file_sha1,
+             const std::shared_ptr<DexFileContainer>& dex_file_container_,
              const uint8_t* dex_file_pointer,
              const uint8_t* lookup_table_data,
              const IndexBssMapping* method_bss_mapping,
@@ -594,14 +615,18 @@
              const IndexBssMapping* public_type_bss_mapping,
              const IndexBssMapping* package_type_bss_mapping,
              const IndexBssMapping* string_bss_mapping,
+             const IndexBssMapping* method_type_bss_mapping,
              const uint32_t* oat_class_offsets_pointer,
              const DexLayoutSections* dex_layout_sections);
 
   // Create an OatDexFile wrapping an existing DexFile. Will set the OatDexFile
   // pointer in the DexFile.
   OatDexFile(const OatFile* oat_file,
+             const std::shared_ptr<DexFileContainer>& dex_file_container_,
              const uint8_t* dex_file_pointer,
+             DexFile::Magic dex_file_magic,
              uint32_t dex_file_checksum,
+             DexFile::Sha1 dex_file_sha1,
              const std::string& dex_file_location,
              const std::string& canonical_dex_file_location,
              const uint8_t* lookup_table_data);
@@ -614,7 +639,10 @@
   const OatFile* const oat_file_ = nullptr;
   const std::string dex_file_location_;
   const std::string canonical_dex_file_location_;
+  const DexFile::Magic dex_file_magic_ = {};
   const uint32_t dex_file_location_checksum_ = 0u;
+  const DexFile::Sha1 dex_file_sha1_ = {};
+  const std::shared_ptr<DexFileContainer> dex_file_container_;
   const uint8_t* const dex_file_pointer_ = nullptr;
   const uint8_t* const lookup_table_data_ = nullptr;
   const IndexBssMapping* const method_bss_mapping_ = nullptr;
@@ -622,6 +650,7 @@
   const IndexBssMapping* const public_type_bss_mapping_ = nullptr;
   const IndexBssMapping* const package_type_bss_mapping_ = nullptr;
   const IndexBssMapping* const string_bss_mapping_ = nullptr;
+  const IndexBssMapping* const method_type_bss_mapping_ = nullptr;
   const uint32_t* const oat_class_offsets_pointer_ = nullptr;
   TypeLookupTable lookup_table_;
   const DexLayoutSections* const dex_layout_sections_ = nullptr;
@@ -634,4 +663,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_OAT_FILE_H_
+#endif  // ART_RUNTIME_OAT_OAT_FILE_H_
diff --git a/runtime/oat_file_assistant.cc b/runtime/oat/oat_file_assistant.cc
similarity index 94%
rename from runtime/oat_file_assistant.cc
rename to runtime/oat/oat_file_assistant.cc
index 7fed9f3..2eaf966 100644
--- a/runtime/oat_file_assistant.cc
+++ b/runtime/oat/oat_file_assistant.cc
@@ -32,6 +32,7 @@
 #include "base/array_ref.h"
 #include "base/compiler_filter.h"
 #include "base/file_utils.h"
+#include "base/globals.h"
 #include "base/logging.h"  // For VLOG.
 #include "base/macros.h"
 #include "base/os.h"
@@ -55,7 +56,7 @@
 #include "vdex_file.h"
 #include "zlib.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using ::android::base::ConsumePrefix;
 using ::android::base::StringPrintf;
@@ -200,7 +201,9 @@
       vdex_for_oat_.Reset(vdex_file_name, UseFdToReadFiles(), zip_fd, vdex_fd, oat_fd);
       std::string dm_file_name = GetDmFilename(dex_location);
       dm_for_oat_.Reset(dm_file_name, UseFdToReadFiles(), zip_fd, vdex_fd, oat_fd);
-    } else {
+    } else if (kIsTargetAndroid) {
+      // No need to warn on host. We are probably in oatdump, where we only need OatFileAssistant to
+      // validate BCP checksums.
       LOG(WARNING) << "Failed to determine oat file name for dex location " << dex_location_ << ": "
                    << error_msg;
     }
@@ -311,6 +314,7 @@
                                       bool downgrade) {
   OatFileInfo& info = GetBestInfo();
   if (info.CheckDisableCompactDex()) {  // TODO(b/256664509): Clean this up.
+    VLOG(oat) << "Should recompile: disable cdex";
     return kDex2OatFromScratch;
   }
   DexOptNeeded dexopt_needed = info.GetDexOptNeeded(
@@ -336,17 +340,7 @@
     return true;
   }
   DexOptNeeded dexopt_needed = info.GetDexOptNeeded(target_compiler_filter, dexopt_trigger);
-  if (info.IsUseable()) {
-    if (&info == &dm_for_oat_ || &info == &dm_for_odex_) {
-      dexopt_status->location_ = kLocationDm;
-    } else if (info.IsOatLocation()) {
-      dexopt_status->location_ = kLocationOat;
-    } else {
-      dexopt_status->location_ = kLocationOdex;
-    }
-  } else {
-    dexopt_status->location_ = kLocationNoneOrError;
-  }
+  dexopt_status->location_ = GetLocation(info);
   return dexopt_needed != kNoDexOptNeeded;
 }
 
@@ -418,8 +412,7 @@
                                     std::vector<std::unique_ptr<const DexFile>>* out_dex_files) {
   // Load the main dex file.
   std::string error_msg;
-  const OatDexFile* oat_dex_file =
-      oat_file.GetOatDexFile(dex_location.c_str(), nullptr, &error_msg);
+  const OatDexFile* oat_dex_file = oat_file.GetOatDexFile(dex_location.c_str(), &error_msg);
   if (oat_dex_file == nullptr) {
     LOG(WARNING) << error_msg;
     return false;
@@ -435,7 +428,7 @@
   // Load the rest of the multidex entries
   for (size_t i = 1;; i++) {
     std::string multidex_dex_location = DexFileLoader::GetMultiDexLocation(i, dex_location.c_str());
-    oat_dex_file = oat_file.GetOatDexFile(multidex_dex_location.c_str(), nullptr);
+    oat_dex_file = oat_file.GetOatDexFile(multidex_dex_location.c_str());
     if (oat_dex_file == nullptr) {
       // There are no more multidex entries to load.
       break;
@@ -453,11 +446,11 @@
 
 std::optional<bool> OatFileAssistant::HasDexFiles(std::string* error_msg) {
   ScopedTrace trace("HasDexFiles");
-  const std::vector<std::uint32_t>* checksums = GetRequiredDexChecksums(error_msg);
-  if (checksums == nullptr) {
+  std::optional<std::uint32_t> checksum;
+  if (!GetRequiredDexChecksum(&checksum, error_msg)) {
     return std::nullopt;
   }
-  return !checksums->empty();
+  return checksum.has_value();
 }
 
 OatFileAssistant::OatStatus OatFileAssistant::OdexFileStatus() { return odex_.Status(); }
@@ -471,37 +464,35 @@
     return true;
   }
   ScopedTrace trace("DexChecksumUpToDate");
-  const std::vector<uint32_t>* required_dex_checksums = GetRequiredDexChecksums(error_msg);
-  if (required_dex_checksums == nullptr) {
+  std::optional<std::uint32_t> dex_checksum;
+  if (!GetRequiredDexChecksum(&dex_checksum, error_msg)) {
     return false;
   }
-  if (required_dex_checksums->empty()) {
+  if (!dex_checksum.has_value()) {
     LOG(WARNING) << "Required dex checksums not found. Assuming dex checksums are up to date.";
     return true;
   }
 
+  std::vector<const OatDexFile*> oat_dex_files;
   uint32_t number_of_dex_files = file.GetOatHeader().GetDexFileCount();
-  if (required_dex_checksums->size() != number_of_dex_files) {
-    *error_msg = StringPrintf(
-        "expected %zu dex files but found %u", required_dex_checksums->size(), number_of_dex_files);
-    return false;
-  }
-
   for (uint32_t i = 0; i < number_of_dex_files; i++) {
     std::string dex = DexFileLoader::GetMultiDexLocation(i, dex_location_.c_str());
-    uint32_t expected_checksum = (*required_dex_checksums)[i];
-    const OatDexFile* oat_dex_file = file.GetOatDexFile(dex.c_str(), nullptr);
+    const OatDexFile* oat_dex_file = file.GetOatDexFile(dex.c_str());
     if (oat_dex_file == nullptr) {
       *error_msg = StringPrintf("failed to find %s in %s", dex.c_str(), file.GetLocation().c_str());
       return false;
     }
-    uint32_t actual_checksum = oat_dex_file->GetDexFileLocationChecksum();
-    if (expected_checksum != actual_checksum) {
-      VLOG(oat) << "Dex checksum does not match for dex: " << dex
-                << ". Expected: " << expected_checksum << ", Actual: " << actual_checksum;
-      return false;
-    }
+    oat_dex_files.push_back(oat_dex_file);
   }
+  uint32_t oat_checksum = DexFileLoader::GetMultiDexChecksum(oat_dex_files);
+
+  CHECK(dex_checksum.has_value());
+  if (dex_checksum != oat_checksum) {
+    VLOG(oat) << "Checksum does not match: " << std::hex << file.GetLocation() << " ("
+              << oat_checksum << ") vs " << dex_location_ << " (" << *dex_checksum << ")";
+    return false;
+  }
+
   return true;
 }
 
@@ -714,33 +705,38 @@
   return GetDalvikCacheFilename(location.c_str(), dalvik_cache.c_str(), oat_filename, error_msg);
 }
 
-const std::vector<uint32_t>* OatFileAssistant::GetRequiredDexChecksums(std::string* error_msg) {
+bool OatFileAssistant::GetRequiredDexChecksum(std::optional<uint32_t>* checksum,
+                                              std::string* error) {
   if (!required_dex_checksums_attempted_) {
     required_dex_checksums_attempted_ = true;
-    std::vector<uint32_t> checksums;
-    std::vector<std::string> dex_locations_ignored;
-    if (ArtDexFileLoader::GetMultiDexChecksums(dex_location_.c_str(),
-                                               &checksums,
-                                               &dex_locations_ignored,
-                                               &cached_required_dex_checksums_error_,
-                                               zip_fd_,
-                                               &zip_file_only_contains_uncompressed_dex_)) {
-      if (checksums.empty()) {
-        // The only valid case here is for APKs without dex files.
-        VLOG(oat) << "No dex file found in " << dex_location_;
-      }
 
-      cached_required_dex_checksums_ = std::move(checksums);
+    File file(zip_fd_, /*check_usage=*/false);
+    ArtDexFileLoader dex_loader(&file, dex_location_);
+    std::optional<uint32_t> checksum2;
+    std::string error2;
+    if (dex_loader.GetMultiDexChecksum(
+            &checksum2, &error2, &zip_file_only_contains_uncompressed_dex_)) {
+      cached_required_dex_checksums_ = checksum2;
+      cached_required_dex_checksums_error_ = std::nullopt;
+    } else {
+      cached_required_dex_checksums_ = std::nullopt;
+      cached_required_dex_checksums_error_ = error2;
     }
+    file.Release();  // Don't close the file yet (we have only read the checksum).
   }
 
-  if (cached_required_dex_checksums_.has_value()) {
-    return &cached_required_dex_checksums_.value();
-  } else {
-    *error_msg = cached_required_dex_checksums_error_;
-    DCHECK(!error_msg->empty());
-    return nullptr;
+  if (cached_required_dex_checksums_error_.has_value()) {
+    *error = cached_required_dex_checksums_error_.value();
+    DCHECK(!error->empty());
+    return false;
   }
+
+  if (!cached_required_dex_checksums_.has_value()) {
+    // The only valid case here is for APKs without dex files.
+    VLOG(oat) << "No dex file found in " << dex_location_;
+  }
+  *checksum = cached_required_dex_checksums_;
+  return true;
 }
 
 bool OatFileAssistant::ValidateBootClassPathChecksums(OatFileAssistantContext* ofa_context,
@@ -1126,7 +1122,7 @@
                                   executable,
                                   /*low_4gb=*/false,
                                   dex_locations,
-                                  /*dex_fds=*/ArrayRef<const int>(),
+                                  /*dex_files=*/{},
                                   /*reservation=*/nullptr,
                                   &error_msg));
       }
@@ -1306,16 +1302,22 @@
                                       ofa_context);
   std::string out_odex_location;  // unused
   std::string out_odex_status;    // unused
-  oat_file_assistant.GetOptimizationStatus(
-      &out_odex_location, out_compilation_filter, out_compilation_reason, &out_odex_status);
+  Location out_location;          // unused
+  oat_file_assistant.GetOptimizationStatus(&out_odex_location,
+                                           out_compilation_filter,
+                                           out_compilation_reason,
+                                           &out_odex_status,
+                                           &out_location);
 }
 
 void OatFileAssistant::GetOptimizationStatus(std::string* out_odex_location,
                                              std::string* out_compilation_filter,
                                              std::string* out_compilation_reason,
-                                             std::string* out_odex_status) {
+                                             std::string* out_odex_status,
+                                             Location* out_location) {
   OatFileInfo& oat_file_info = GetBestInfo();
-  const OatFile* oat_file = GetBestInfo().GetFile();
+  const OatFile* oat_file = oat_file_info.GetFile();
+  *out_location = GetLocation(oat_file_info);
 
   if (oat_file == nullptr) {
     std::string error_msg;
@@ -1381,11 +1383,26 @@
 
 bool OatFileAssistant::ZipFileOnlyContainsUncompressedDex() {
   // zip_file_only_contains_uncompressed_dex_ is only set during fetching the dex checksums.
+  std::optional<uint32_t> checksum;
   std::string error_msg;
-  if (GetRequiredDexChecksums(&error_msg) == nullptr) {
+  if (!GetRequiredDexChecksum(&checksum, &error_msg)) {
     LOG(ERROR) << error_msg;
   }
   return zip_file_only_contains_uncompressed_dex_;
 }
 
+OatFileAssistant::Location OatFileAssistant::GetLocation(OatFileInfo& info) {
+  if (info.IsUseable()) {
+    if (&info == &dm_for_oat_ || &info == &dm_for_odex_) {
+      return kLocationDm;
+    } else if (info.IsOatLocation()) {
+      return kLocationOat;
+    } else {
+      return kLocationOdex;
+    }
+  } else {
+    return kLocationNoneOrError;
+  }
+}
+
 }  // namespace art
diff --git a/runtime/oat_file_assistant.h b/runtime/oat/oat_file_assistant.h
similarity index 87%
rename from runtime/oat_file_assistant.h
rename to runtime/oat/oat_file_assistant.h
index c81dea1..2c9b8ab 100644
--- a/runtime/oat_file_assistant.h
+++ b/runtime/oat/oat_file_assistant.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_OAT_FILE_ASSISTANT_H_
-#define ART_RUNTIME_OAT_FILE_ASSISTANT_H_
+#ifndef ART_RUNTIME_OAT_OAT_FILE_ASSISTANT_H_
+#define ART_RUNTIME_OAT_OAT_FILE_ASSISTANT_H_
 
 #include <cstdint>
 #include <memory>
@@ -27,6 +27,7 @@
 
 #include "arch/instruction_set.h"
 #include "base/compiler_filter.h"
+#include "base/macros.h"
 #include "base/os.h"
 #include "base/scoped_flock.h"
 #include "base/unix_file/fd_file.h"
@@ -34,7 +35,7 @@
 #include "oat_file.h"
 #include "oat_file_assistant_context.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace gc {
 namespace space {
@@ -161,31 +162,31 @@
   //
   // runtime_options should be provided with all the required fields filled if the caller intends to
   // use OatFileAssistant without a runtime.
-  OatFileAssistant(const char* dex_location,
-                   const InstructionSet isa,
-                   ClassLoaderContext* context,
-                   bool load_executable,
-                   bool only_load_trusted_executable = false,
-                   OatFileAssistantContext* ofa_context = nullptr);
+  EXPORT OatFileAssistant(const char* dex_location,
+                          const InstructionSet isa,
+                          ClassLoaderContext* context,
+                          bool load_executable,
+                          bool only_load_trusted_executable = false,
+                          OatFileAssistantContext* ofa_context = nullptr);
 
   // Similar to this(const char*, const InstructionSet, bool), however, if a valid zip_fd is
   // provided, vdex, oat, and zip files will be read from vdex_fd, oat_fd and zip_fd respectively.
   // Otherwise, dex_location will be used to construct necessary filenames.
-  OatFileAssistant(const char* dex_location,
-                   const InstructionSet isa,
-                   ClassLoaderContext* context,
-                   bool load_executable,
-                   bool only_load_trusted_executable,
-                   OatFileAssistantContext* ofa_context,
-                   int vdex_fd,
-                   int oat_fd,
-                   int zip_fd);
+  EXPORT OatFileAssistant(const char* dex_location,
+                          const InstructionSet isa,
+                          ClassLoaderContext* context,
+                          bool load_executable,
+                          bool only_load_trusted_executable,
+                          OatFileAssistantContext* ofa_context,
+                          int vdex_fd,
+                          int oat_fd,
+                          int zip_fd);
 
   // A convenient factory function that accepts ISA, class loader context, and compiler filter in
   // strings. Returns the created instance and ClassLoaderContext on success, or returns nullptr and
   // outputs an error message if it fails to parse the input strings.
   // The returned ClassLoaderContext must live at least as long as the OatFileAssistant.
-  static std::unique_ptr<OatFileAssistant> Create(
+  EXPORT static std::unique_ptr<OatFileAssistant> Create(
       const std::string& filename,
       const std::string& isa_str,
       const std::optional<std::string>& context_str,
@@ -197,17 +198,15 @@
 
   // Returns true if the dex location refers to an element of the boot class
   // path.
-  bool IsInBootClassPath();
+  EXPORT bool IsInBootClassPath();
 
   // Return what action needs to be taken to produce up-to-date code for this
   // dex location. If "downgrade" is set to false, it verifies if the current
   // compiler filter is at least as good as an oat file generated with the
   // given compiler filter otherwise, if its set to true, it checks whether
   // the oat file generated with the target filter will be downgraded as
-  // compared to the current state. For example, if the current compiler filter is
-  // quicken, and target filter is verify, it will recommend to dexopt, while
-  // if the target filter is speed profile, it will recommend to keep it in its
-  // current state.
+  // compared to the current state. For example, if the current compiler filter is verify and the
+  // target filter is speed profile it will recommend to keep it in its current state.
   // profile_changed should be true to indicate the profile has recently changed
   // for this dex location.
   // If the purpose of the dexopt is to downgrade the compiler filter,
@@ -217,15 +216,15 @@
   // the oat file in the odex location.
   //
   // Deprecated. Use the other overload.
-  int GetDexOptNeeded(CompilerFilter::Filter target_compiler_filter,
-                      bool profile_changed = false,
-                      bool downgrade = false);
+  EXPORT int GetDexOptNeeded(CompilerFilter::Filter target_compiler_filter,
+                             bool profile_changed = false,
+                             bool downgrade = false);
 
   // Returns true if dexopt needs to be performed with respect to the given target compilation
   // filter and dexopt trigger. Also returns the status of the current oat file and/or vdex file.
-  bool GetDexOptNeeded(CompilerFilter::Filter target_compiler_filter,
-                       const DexOptTrigger dexopt_trigger,
-                       /*out*/ DexOptStatus* dexopt_status);
+  EXPORT bool GetDexOptNeeded(CompilerFilter::Filter target_compiler_filter,
+                              const DexOptTrigger dexopt_trigger,
+                              /*out*/ DexOptStatus* dexopt_status);
 
   // Returns true if there is up-to-date code for this dex location,
   // irrespective of the compiler filter of the up-to-date code.
@@ -256,10 +255,11 @@
   // This method will try to mimic the runtime effect of loading the dex file.
   // For example, if there is no usable oat file, the compiler filter will be set
   // to "run-from-apk".
-  void GetOptimizationStatus(std::string* out_odex_location,
-                             std::string* out_compilation_filter,
-                             std::string* out_compilation_reason,
-                             std::string* out_odex_status);
+  EXPORT void GetOptimizationStatus(std::string* out_odex_location,
+                                    std::string* out_compilation_filter,
+                                    std::string* out_compilation_reason,
+                                    std::string* out_odex_status,
+                                    Location* out_location);
 
   static void GetOptimizationStatus(const std::string& filename,
                                     InstructionSet isa,
@@ -289,7 +289,7 @@
                            std::vector<std::unique_ptr<const DexFile>>* out_dex_files);
 
   // Returns whether this is an apk/zip wit a classes.dex entry, or nullopt if an error occurred.
-  std::optional<bool> HasDexFiles(std::string* error_msg);
+  EXPORT std::optional<bool> HasDexFiles(std::string* error_msg);
 
   // If the dex file has been installed with a compiled oat file alongside
   // it, the compiled oat file will have the extension .odex, and is referred
@@ -318,10 +318,10 @@
   // Returns false on error, in which case error_msg describes the error and
   // odex_filename is not changed.
   // Neither odex_filename nor error_msg may be null.
-  static bool DexLocationToOdexFilename(const std::string& location,
-                                        InstructionSet isa,
-                                        std::string* odex_filename,
-                                        std::string* error_msg);
+  EXPORT static bool DexLocationToOdexFilename(const std::string& location,
+                                               InstructionSet isa,
+                                               std::string* odex_filename,
+                                               std::string* error_msg);
 
   // Constructs the oat file name for the given dex location.
   // Returns true on success, in which case oat_filename is set to the oat
@@ -339,11 +339,11 @@
   // Same as above, but also takes `deny_art_apex_data_files` from input.
   //
   // Calling this function does not require an active runtime.
-  static bool DexLocationToOatFilename(const std::string& location,
-                                       InstructionSet isa,
-                                       bool deny_art_apex_data_files,
-                                       std::string* oat_filename,
-                                       std::string* error_msg);
+  EXPORT static bool DexLocationToOatFilename(const std::string& location,
+                                              InstructionSet isa,
+                                              bool deny_art_apex_data_files,
+                                              std::string* oat_filename,
+                                              std::string* error_msg);
 
   // Computes the dex location and vdex filename. If the data directory of the process
   // is known, creates an absolute path in that directory and tries to infer path
@@ -358,12 +358,12 @@
 
   // Returns true if a filename (given as basename) is a name of a vdex for
   // anonymous dex file(s) created by AnonymousDexVdexLocation.
-  static bool IsAnonymousVdexBasename(const std::string& basename);
+  EXPORT static bool IsAnonymousVdexBasename(const std::string& basename);
 
   bool ClassLoaderContextIsOkay(const OatFile& oat_file) const;
 
   // Validates the boot class path checksum of an OatFile.
-  bool ValidateBootClassPathChecksums(const OatFile& oat_file);
+  EXPORT bool ValidateBootClassPathChecksums(const OatFile& oat_file);
 
   // Validates the given bootclasspath and bootclasspath checksums found in an oat header.
   static bool ValidateBootClassPathChecksums(OatFileAssistantContext* ofa_context,
@@ -494,11 +494,9 @@
   // location.
   OatStatus GivenOatFileStatus(const OatFile& file);
 
-  // Gets the dex checksums required for an up-to-date oat file.
-  // Returns cached_required_dex_checksums if the required checksums were located. Returns an empty
-  // list if `dex_location_` refers to a zip and there is no dex file in it. Returns nullptr if an
-  // error occurred. The caller shouldn't clean up or free the returned pointer.
-  const std::vector<uint32_t>* GetRequiredDexChecksums(std::string* error_msg);
+  // Gets the dex checksum required for an up-to-date oat file.
+  // Returns cached result from GetMultiDexChecksum.
+  bool GetRequiredDexChecksum(std::optional<uint32_t>* checksum, std::string* error);
 
   // Returns whether there is at least one boot image usable.
   bool IsPrimaryBootImageUsable();
@@ -530,6 +528,9 @@
   // Returns whether the zip file only contains uncompressed dex.
   bool ZipFileOnlyContainsUncompressedDex();
 
+  // Returns the location of the given oat file.
+  Location GetLocation(OatFileInfo& info);
+
   std::string dex_location_;
 
   // The class loader context to check against, or null representing that the check should be
@@ -555,8 +556,8 @@
 
   // Cached value of the required dex checksums.
   // This should be accessed only by the GetRequiredDexChecksums() method.
-  std::optional<std::vector<uint32_t>> cached_required_dex_checksums_;
-  std::string cached_required_dex_checksums_error_;
+  std::optional<uint32_t> cached_required_dex_checksums_;
+  std::optional<std::string> cached_required_dex_checksums_error_;
   bool required_dex_checksums_attempted_ = false;
 
   // The AOT-compiled file of an app when the APK of the app is in /data.
@@ -591,4 +592,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_OAT_FILE_ASSISTANT_H_
+#endif  // ART_RUNTIME_OAT_OAT_FILE_ASSISTANT_H_
diff --git a/runtime/oat_file_assistant_context.cc b/runtime/oat/oat_file_assistant_context.cc
similarity index 79%
rename from runtime/oat_file_assistant_context.cc
rename to runtime/oat/oat_file_assistant_context.cc
index c3fb73d..fd168ff 100644
--- a/runtime/oat_file_assistant_context.cc
+++ b/runtime/oat/oat_file_assistant_context.cc
@@ -17,6 +17,7 @@
 #include "oat_file_assistant_context.h"
 
 #include <memory>
+#include <optional>
 #include <string>
 #include <vector>
 
@@ -24,6 +25,7 @@
 #include "android-base/stringprintf.h"
 #include "arch/instruction_set.h"
 #include "base/array_ref.h"
+#include "base/file_utils.h"
 #include "base/logging.h"
 #include "base/mem_map.h"
 #include "class_linker.h"
@@ -31,7 +33,7 @@
 #include "gc/heap.h"
 #include "gc/space/image_space.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using ::android::base::StringPrintf;
 using ::art::gc::space::ImageSpace;
@@ -42,8 +44,8 @@
   DCHECK_EQ(runtime_options_->boot_class_path.size(),
             runtime_options_->boot_class_path_locations.size());
   DCHECK_IMPLIES(
-      runtime_options_->boot_class_path_fds != nullptr,
-      runtime_options_->boot_class_path.size() == runtime_options_->boot_class_path_fds->size());
+      runtime_options_->boot_class_path_files.has_value(),
+      runtime_options_->boot_class_path.size() == runtime_options_->boot_class_path_files->size());
   // Opening dex files and boot images require MemMap.
   MemMap::Init();
 }
@@ -54,9 +56,9 @@
               .image_locations = runtime->GetImageLocations(),
               .boot_class_path = runtime->GetBootClassPath(),
               .boot_class_path_locations = runtime->GetBootClassPathLocations(),
-              .boot_class_path_fds = !runtime->GetBootClassPathFds().empty() ?
-                                         &runtime->GetBootClassPathFds() :
-                                         nullptr,
+              .boot_class_path_files = !runtime->GetBootClassPathFiles().empty() ?
+                                           runtime->GetBootClassPathFiles() :
+                                           std::optional<ArrayRef<File>>(),
               .deny_art_apex_data_files = runtime->DenyArtApexDataFiles(),
           })) {
   // Fetch boot image info from the runtime.
@@ -76,13 +78,13 @@
   // Fetch BCP checksums from the runtime.
   size_t bcp_index = 0;
   std::vector<std::string>* current_bcp_checksums = nullptr;
-  for (const DexFile* dex_file : runtime->GetClassLinker()->GetBootClassPath()) {
-    if (!DexFileLoader::IsMultiDexLocation(dex_file->GetLocation().c_str())) {
-      DCHECK_LT(bcp_index, runtime_options_->boot_class_path.size());
-      current_bcp_checksums = &bcp_checksums_by_index_[bcp_index++];
-    }
+  const std::vector<const DexFile*>& bcp_dex_files = runtime->GetClassLinker()->GetBootClassPath();
+  for (size_t i = 0; i < bcp_dex_files.size();) {
+    uint32_t checksum = DexFileLoader::GetMultiDexChecksum(bcp_dex_files, &i);
+    DCHECK_LT(bcp_index, runtime_options_->boot_class_path.size());
+    current_bcp_checksums = &bcp_checksums_by_index_[bcp_index++];
     DCHECK_NE(current_bcp_checksums, nullptr);
-    current_bcp_checksums->push_back(StringPrintf("/%08x", dex_file->GetLocationChecksum()));
+    current_bcp_checksums->push_back(StringPrintf("/%08x", checksum));
   }
   DCHECK_EQ(bcp_index, runtime_options_->boot_class_path.size());
 
@@ -121,12 +123,10 @@
       ArrayRef<const std::string>(runtime_options_->image_locations),
       ArrayRef<const std::string>(runtime_options_->boot_class_path),
       ArrayRef<const std::string>(runtime_options_->boot_class_path_locations),
-      runtime_options_->boot_class_path_fds != nullptr ?
-          ArrayRef<const int>(*runtime_options_->boot_class_path_fds) :
-          ArrayRef<const int>(),
-      /*boot_class_path_image_fds=*/ArrayRef<const int>(),
-      /*boot_class_path_vdex_fds=*/ArrayRef<const int>(),
-      /*boot_class_path_oat_fds=*/ArrayRef<const int>(),
+      runtime_options_->boot_class_path_files.value_or(ArrayRef<File>()),
+      /*boot_class_path_image_files=*/{},
+      /*boot_class_path_vdex_files=*/{},
+      /*boot_class_path_oat_files=*/{},
       &GetApexVersions());
 
   std::string error_msg;
@@ -156,23 +156,20 @@
     return &it->second;
   }
 
-  std::vector<uint32_t> checksums;
-  std::vector<std::string> dex_locations;
-  if (!ArtDexFileLoader::GetMultiDexChecksums(
-          runtime_options_->boot_class_path[bcp_index].c_str(),
-          &checksums,
-          &dex_locations,
-          error_msg,
-          runtime_options_->boot_class_path_fds != nullptr ?
-              (*runtime_options_->boot_class_path_fds)[bcp_index] :
-              -1)) {
+  std::optional<ArrayRef<File>> bcp_files = runtime_options_->boot_class_path_files;
+  File noFile;
+  File* file = bcp_files.has_value() ? &(*bcp_files)[bcp_index] : &noFile;
+  ArtDexFileLoader dex_loader(file, runtime_options_->boot_class_path[bcp_index]);
+  std::optional<uint32_t> checksum;
+  bool ok = dex_loader.GetMultiDexChecksum(&checksum, error_msg);
+  if (!ok) {
     return nullptr;
   }
 
-  DCHECK(!checksums.empty());
+  DCHECK(checksum.has_value());
   std::vector<std::string>& bcp_checksums = bcp_checksums_by_index_[bcp_index];
-  for (uint32_t checksum : checksums) {
-    bcp_checksums.push_back(StringPrintf("/%08x", checksum));
+  if (checksum.has_value()) {
+    bcp_checksums.push_back(StringPrintf("/%08x", checksum.value()));
   }
   return &bcp_checksums;
 }
diff --git a/runtime/oat_file_assistant_context.h b/runtime/oat/oat_file_assistant_context.h
similarity index 87%
rename from runtime/oat_file_assistant_context.h
rename to runtime/oat/oat_file_assistant_context.h
index cc98c59..82b79ed 100644
--- a/runtime/oat_file_assistant_context.h
+++ b/runtime/oat/oat_file_assistant_context.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_OAT_FILE_ASSISTANT_CONTEXT_H_
-#define ART_RUNTIME_OAT_FILE_ASSISTANT_CONTEXT_H_
+#ifndef ART_RUNTIME_OAT_OAT_FILE_ASSISTANT_CONTEXT_H_
+#define ART_RUNTIME_OAT_OAT_FILE_ASSISTANT_CONTEXT_H_
 
 #include <optional>
 #include <string>
@@ -23,9 +23,10 @@
 #include <vector>
 
 #include "arch/instruction_set.h"
+#include "base/macros.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // A helper class for OatFileAssistant that fetches and caches information including boot image
 // checksums, bootclasspath checksums, and APEX versions. The same instance can be reused across
@@ -44,7 +45,7 @@
     // Required. See `-Xbootclasspath-locations`.
     const std::vector<std::string>& boot_class_path_locations;
     // Optional. See `-Xbootclasspathfds`.
-    const std::vector<int>* const boot_class_path_fds = nullptr;
+    std::optional<ArrayRef<File>> boot_class_path_files = {};
     // Optional. See `-Xdeny-art-apex-data-files`.
     const bool deny_art_apex_data_files = false;
   };
@@ -59,7 +60,7 @@
 
   // Constructs OatFileAssistantContext from runtime options. Does not fetch information on
   // construction. Information will be fetched from disk when needed.
-  explicit OatFileAssistantContext(std::unique_ptr<RuntimeOptions> runtime_options);
+  EXPORT explicit OatFileAssistantContext(std::unique_ptr<RuntimeOptions> runtime_options);
   // Constructs OatFileAssistantContext from a runtime instance. Fetches as much information as
   // possible from the runtime. The rest information will be fetched from disk when needed.
   explicit OatFileAssistantContext(Runtime* runtime);
@@ -67,9 +68,9 @@
   const RuntimeOptions& GetRuntimeOptions() const;
   // Fetches all information that hasn't been fetched from disk and caches it. All operations will
   // be read-only after a successful call to this function.
-  bool FetchAll(std::string* error_msg);
+  EXPORT bool FetchAll(std::string* error_msg);
   // Returns information about the boot image of the given instruction set.
-  const std::vector<BootImageInfo>& GetBootImageInfoList(InstructionSet isa);
+  EXPORT const std::vector<BootImageInfo>& GetBootImageInfoList(InstructionSet isa);
   // Returns the checksums of the dex files in the BCP jar at the given index, or nullptr on error.
   // The format of each checksum is "/<checksum_in_8_digit_hex>".
   const std::vector<std::string>* GetBcpChecksums(size_t bcp_index, std::string* error_msg);
@@ -86,4 +87,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_OAT_FILE_ASSISTANT_CONTEXT_H_
+#endif  // ART_RUNTIME_OAT_OAT_FILE_ASSISTANT_CONTEXT_H_
diff --git a/runtime/oat_file_assistant_test.cc b/runtime/oat/oat_file_assistant_test.cc
similarity index 96%
rename from runtime/oat_file_assistant_test.cc
rename to runtime/oat/oat_file_assistant_test.cc
index bbaced5..a3b3704 100644
--- a/runtime/oat_file_assistant_test.cc
+++ b/runtime/oat/oat_file_assistant_test.cc
@@ -45,7 +45,7 @@
 #include "scoped_thread_state_change.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class OatFileAssistantBaseTest : public DexoptTest {};
 
@@ -68,6 +68,7 @@
                                 const T& expected_filter,
                                 const std::string& expected_reason,
                                 const std::string& expected_odex_status,
+                                OatFileAssistant::Location expected_location,
                                 bool check_context = false) {
     std::string expected_filter_name;
     if constexpr (std::is_same_v<T, CompilerFilter::Filter>) {
@@ -95,24 +96,27 @@
     // Verify the instance methods (called at runtime and from artd).
     OatFileAssistant assistant = CreateOatFileAssistant(file.c_str(), context);
     VerifyOptimizationStatusWithInstance(
-        &assistant, expected_filter_name, expected_reason, expected_odex_status);
+        &assistant, expected_filter_name, expected_reason, expected_odex_status, expected_location);
   }
 
   void VerifyOptimizationStatusWithInstance(OatFileAssistant* assistant,
                                             const std::string& expected_filter,
                                             const std::string& expected_reason,
-                                            const std::string& expected_odex_status) {
+                                            const std::string& expected_odex_status,
+                                            OatFileAssistant::Location expected_location) {
     std::string odex_location;  // ignored
     std::string compilation_filter;
     std::string compilation_reason;
     std::string odex_status;
+    OatFileAssistant::Location location;
 
     assistant->GetOptimizationStatus(
-        &odex_location, &compilation_filter, &compilation_reason, &odex_status);
+        &odex_location, &compilation_filter, &compilation_reason, &odex_status, &location);
 
     ASSERT_EQ(expected_filter, compilation_filter);
     ASSERT_EQ(expected_reason, compilation_reason);
     ASSERT_EQ(expected_odex_status, odex_status);
+    ASSERT_EQ(expected_location, location);
   }
 
   bool InsertNewBootClasspathEntry(const std::string& src, std::string* error_msg) {
@@ -190,9 +194,9 @@
                 .image_locations = runtime_->GetImageLocations(),
                 .boot_class_path = runtime_->GetBootClassPath(),
                 .boot_class_path_locations = runtime_->GetBootClassPathLocations(),
-                .boot_class_path_fds = !runtime_->GetBootClassPathFds().empty() ?
-                                           &runtime_->GetBootClassPathFds() :
-                                           nullptr,
+                .boot_class_path_files = !runtime_->GetBootClassPathFiles().empty() ?
+                                             runtime_->GetBootClassPathFiles() :
+                                             std::optional<ArrayRef<File>>(),
                 .deny_art_apex_data_files = runtime_->DenyArtApexDataFiles(),
             }));
   }
@@ -403,8 +407,12 @@
   EXPECT_EQ(OatFileAssistant::kOatCannotOpen, oat_file_assistant.OatFileStatus());
   ExpectHasDexFiles(&oat_file_assistant, true);
 
-  VerifyOptimizationStatus(
-      dex_location, default_context_.get(), "run-from-apk", "unknown", "io-error-no-oat");
+  VerifyOptimizationStatus(dex_location,
+                           default_context_.get(),
+                           "run-from-apk",
+                           "unknown",
+                           "io-error-no-oat",
+                           OatFileAssistant::kLocationNoneOrError);
 }
 
 // Case: We have no DEX file and no OAT file.
@@ -429,8 +437,11 @@
   std::unique_ptr<OatFile> oat_file = oat_file_assistant.GetBestOatFile();
   EXPECT_EQ(nullptr, oat_file.get());
 
-  VerifyOptimizationStatusWithInstance(
-      &oat_file_assistant, "unknown", "unknown", "io-error-no-apk");
+  VerifyOptimizationStatusWithInstance(&oat_file_assistant,
+                                       "unknown",
+                                       "unknown",
+                                       "io-error-no-apk",
+                                       OatFileAssistant::kLocationNoneOrError);
 }
 
 // Case: We have a DEX file and an ODEX file, but no OAT file.
@@ -470,8 +481,12 @@
   EXPECT_EQ(OatFileAssistant::kOatCannotOpen, oat_file_assistant.OatFileStatus());
   ExpectHasDexFiles(&oat_file_assistant, true);
 
-  VerifyOptimizationStatus(
-      dex_location, default_context_.get(), CompilerFilter::kSpeed, "install", "up-to-date");
+  VerifyOptimizationStatus(dex_location,
+                           default_context_.get(),
+                           CompilerFilter::kSpeed,
+                           "install",
+                           "up-to-date",
+                           OatFileAssistant::kLocationOdex);
 }
 
 // Case: We have an ODEX file compiled against partial boot image.
@@ -515,8 +530,12 @@
   EXPECT_EQ(OatFileAssistant::kOatCannotOpen, oat_file_assistant.OatFileStatus());
   ExpectHasDexFiles(&oat_file_assistant, true);
 
-  VerifyOptimizationStatus(
-      dex_location, default_context_.get(), CompilerFilter::kSpeed, "install", "up-to-date");
+  VerifyOptimizationStatus(dex_location,
+                           default_context_.get(),
+                           CompilerFilter::kSpeed,
+                           "install",
+                           "up-to-date",
+                           OatFileAssistant::kLocationOdex);
 }
 
 // Case: We have a DEX file and a PIC ODEX file, but no OAT file. We load the dex
@@ -609,8 +628,12 @@
   EXPECT_EQ(OatFileAssistant::kOatUpToDate, oat_file_assistant.OatFileStatus());
   ExpectHasDexFiles(&oat_file_assistant, true);
 
-  VerifyOptimizationStatus(
-      dex_location, default_context_.get(), CompilerFilter::kSpeed, "unknown", "up-to-date");
+  VerifyOptimizationStatus(dex_location,
+                           default_context_.get(),
+                           CompilerFilter::kSpeed,
+                           "unknown",
+                           "up-to-date",
+                           OatFileAssistant::kLocationOat);
 }
 
 // Case: Passing valid file descriptors of updated odex/vdex files along with the dex file.
@@ -809,7 +832,12 @@
   // care what the actual dumped value is.
   oat_file_assistant.GetStatusDump();
 
-  VerifyOptimizationStatus(dex_location, default_context_.get(), "verify", "vdex", "up-to-date");
+  VerifyOptimizationStatus(dex_location,
+                           default_context_.get(),
+                           "verify",
+                           "vdex",
+                           "up-to-date",
+                           OatFileAssistant::kLocationOdex);
 }
 
 // Case: We have a DEX file and empty VDEX and ODEX files.
@@ -1047,8 +1075,12 @@
   EXPECT_EQ(OatFileAssistant::kOatDexOutOfDate, oat_file_assistant.OatFileStatus());
   ExpectHasDexFiles(&oat_file_assistant, true);
 
-  VerifyOptimizationStatus(
-      dex_location, default_context_.get(), "run-from-apk-fallback", "unknown", "apk-more-recent");
+  VerifyOptimizationStatus(dex_location,
+                           default_context_.get(),
+                           "run-from-apk-fallback",
+                           "unknown",
+                           "apk-more-recent",
+                           OatFileAssistant::kLocationNoneOrError);
 }
 
 // Case: We have a DEX file and an (ODEX) VDEX file out of date with respect
@@ -1137,7 +1169,12 @@
   EXPECT_EQ(OatFileAssistant::kOatBootImageOutOfDate, oat_file_assistant.OatFileStatus());
   ExpectHasDexFiles(&oat_file_assistant, true);
 
-  VerifyOptimizationStatus(dex_location, default_context_.get(), "verify", "vdex", "up-to-date");
+  VerifyOptimizationStatus(dex_location,
+                           default_context_.get(),
+                           "verify",
+                           "vdex",
+                           "up-to-date",
+                           OatFileAssistant::kLocationOat);
 }
 
 TEST_P(OatFileAssistantTest, OatContextOutOfDate) {
@@ -1165,8 +1202,13 @@
 
   auto scoped_maybe_without_runtime = ScopedMaybeWithoutRuntime();
 
-  VerifyOptimizationStatus(
-      dex_location, context.get(), "verify", "vdex", "up-to-date", /*check_context=*/true);
+  VerifyOptimizationStatus(dex_location,
+                           context.get(),
+                           "verify",
+                           "vdex",
+                           "up-to-date",
+                           OatFileAssistant::kLocationOdex,
+                           /*check_context=*/true);
 }
 
 // Case: We have a DEX file and an ODEX file, but no OAT file.
@@ -1242,7 +1284,11 @@
   EXPECT_EQ(OatFileAssistant::kOatCannotOpen, oat_file_assistant.OatFileStatus());
   ExpectHasDexFiles(&oat_file_assistant, false);
 
-  VerifyOptimizationStatusWithInstance(&oat_file_assistant, "unknown", "unknown", "no-dex-code");
+  VerifyOptimizationStatusWithInstance(&oat_file_assistant,
+                                       "unknown",
+                                       "unknown",
+                                       "no-dex-code",
+                                       OatFileAssistant::kLocationNoneOrError);
 }
 
 // Case: We have a DEX file, an ODEX file and an OAT file.
@@ -1504,7 +1550,7 @@
         lock_(lock),
         loaded_oat_file_(nullptr) {}
 
-  void Run(Thread* self ATTRIBUTE_UNUSED) override {
+  void Run([[maybe_unused]] Thread* self) override {
     // Load the dex files, and save a pointer to the loaded oat file, so that
     // we can verify only one oat file was loaded for the dex location.
     std::vector<std::unique_ptr<const DexFile>> dex_files;
@@ -1561,17 +1607,18 @@
 
   const size_t kNumThreads = 16;
   Thread* self = Thread::Current();
-  ThreadPool thread_pool("Oat file assistant test thread pool", kNumThreads);
+  std::unique_ptr<ThreadPool> thread_pool(
+      ThreadPool::Create("Oat file assistant test thread pool", kNumThreads));
   std::vector<std::unique_ptr<RaceGenerateTask>> tasks;
   Mutex lock("RaceToGenerate");
   for (size_t i = 0; i < kNumThreads; i++) {
     std::unique_ptr<RaceGenerateTask> task(
         new RaceGenerateTask(*this, dex_location, oat_location, &lock));
-    thread_pool.AddTask(self, task.get());
+    thread_pool->AddTask(self, task.get());
     tasks.push_back(std::move(task));
   }
-  thread_pool.StartWorkers(self);
-  thread_pool.Wait(self, /* do_work= */ true, /* may_hold_locks= */ false);
+  thread_pool->StartWorkers(self);
+  thread_pool->Wait(self, /* do_work= */ true, /* may_hold_locks= */ false);
 
   // Verify that tasks which got an oat file got a unique one.
   std::set<const OatFile*> oat_files;
@@ -2080,8 +2127,11 @@
                                /*expected_location=*/OatFileAssistant::kLocationNoneOrError,
                                /*expected_legacy_result=*/OatFileAssistant::kNoDexOptNeeded);
 
-  VerifyOptimizationStatusWithInstance(
-      &oat_file_assistant, "unknown", "unknown", "io-error-no-apk");
+  VerifyOptimizationStatusWithInstance(&oat_file_assistant,
+                                       "unknown",
+                                       "unknown",
+                                       "io-error-no-apk",
+                                       OatFileAssistant::kLocationNoneOrError);
 }
 
 // Case: We have a VDEX file, but the DEX file is gone.
@@ -2106,8 +2156,11 @@
                                /*expected_location=*/OatFileAssistant::kLocationNoneOrError,
                                /*expected_legacy_result=*/OatFileAssistant::kNoDexOptNeeded);
 
-  VerifyOptimizationStatusWithInstance(
-      &oat_file_assistant, "unknown", "unknown", "io-error-no-apk");
+  VerifyOptimizationStatusWithInstance(&oat_file_assistant,
+                                       "unknown",
+                                       "unknown",
+                                       "io-error-no-apk",
+                                       OatFileAssistant::kLocationNoneOrError);
 }
 
 // Case: We have a VDEX file, generated without a boot image, and we now have a boot image.
@@ -2493,7 +2546,8 @@
   ASSERT_NE(oat_file_assistant, nullptr);
 
   // Verify that the created instance is usable.
-  VerifyOptimizationStatusWithInstance(oat_file_assistant.get(), "speed", "install", "up-to-date");
+  VerifyOptimizationStatusWithInstance(
+      oat_file_assistant.get(), "speed", "install", "up-to-date", OatFileAssistant::kLocationOdex);
 }
 
 TEST_P(OatFileAssistantTest, CreateWithNullContext) {
@@ -2519,7 +2573,8 @@
   ASSERT_EQ(context, nullptr);
 
   // Verify that the created instance is usable.
-  VerifyOptimizationStatusWithInstance(oat_file_assistant.get(), "speed", "install", "up-to-date");
+  VerifyOptimizationStatusWithInstance(
+      oat_file_assistant.get(), "speed", "install", "up-to-date", OatFileAssistant::kLocationOdex);
 }
 
 TEST_P(OatFileAssistantTest, ErrorOnInvalidIsaString) {
diff --git a/runtime/oat_file_manager.cc b/runtime/oat/oat_file_manager.cc
similarity index 97%
rename from runtime/oat_file_manager.cc
rename to runtime/oat/oat_file_manager.cc
index 29b4560..11333b0 100644
--- a/runtime/oat_file_manager.cc
+++ b/runtime/oat/oat_file_manager.cc
@@ -60,7 +60,7 @@
 #include "verifier/verifier_deps.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -174,9 +174,9 @@
   return oat_files;
 }
 
-bool OatFileManager::ShouldLoadAppImage(const OatFile* source_oat_file) const {
+bool OatFileManager::ShouldLoadAppImage() const {
   Runtime* const runtime = Runtime::Current();
-  if (!kEnableAppImage || (runtime->IsJavaDebuggableAtInit() && !source_oat_file->IsDebuggable())) {
+  if (!kEnableAppImage || runtime->IsJavaDebuggableAtInit()) {
     return false;
   }
 
@@ -232,8 +232,9 @@
     std::string compilation_filter;
     std::string compilation_reason;
     std::string odex_status;
+    OatFileAssistant::Location ignored_location;
     oat_file_assistant->GetOptimizationStatus(
-        &odex_location, &compilation_filter, &compilation_reason, &odex_status);
+        &odex_location, &compilation_filter, &compilation_reason, &odex_status, &ignored_location);
 
     ScopedTrace odex_loading(StringPrintf(
         "location=%s status=%s filter=%s reason=%s",
@@ -283,12 +284,15 @@
       // We need to throw away the image space if we are debuggable but the oat-file source of the
       // image is not otherwise we might get classes with inlined methods or other such things.
       std::unique_ptr<gc::space::ImageSpace> image_space;
-      if (ShouldLoadAppImage(oat_file.get())) {
+      if (ShouldLoadAppImage()) {
         if (oat_file->IsExecutable()) {
           // App images generated by the compiler can only be used if the oat file
           // is executable.
           image_space = oat_file_assistant->OpenImageSpace(oat_file.get());
         }
+        // Load the runtime image. This logic must be aligned with the one that determines when to
+        // keep runtime images in `ArtManagerLocal.cleanup` in
+        // `art/libartservice/service/java/com/android/server/art/ArtManagerLocal.java`.
         if (kEnableRuntimeAppImage && image_space == nullptr && !compilation_enabled) {
           std::string art_file = RuntimeImage::GetRuntimeImagePath(dex_location);
           std::string error_msg;
@@ -338,13 +342,6 @@
             for (const auto& dex_file : dex_files) {
               dex::tracking::RegisterDexFile(dex_file.get());
             }
-
-            if (!compilation_enabled) {
-              // Update the filter we are going to report to 'speed-profile'.
-              // Ideally, we would also update the compiler filter of the odex
-              // file, but at this point it's just too late.
-              compilation_filter = CompilerFilter::NameOfFilter(CompilerFilter::kSpeedProfile);
-            }
           } else {
             LOG(INFO) << "Failed to add image file: " << temp_error_msg;
             dex_files.clear();
@@ -856,7 +853,7 @@
     WriterMutexLock mu(self, *Locks::oat_file_manager_lock_);
     if (verification_thread_pool_ == nullptr) {
       verification_thread_pool_.reset(
-          new ThreadPool("Verification thread pool", /* num_threads= */ 1));
+          ThreadPool::Create("Verification thread pool", /* num_threads= */ 1));
       verification_thread_pool_->StartWorkers(self);
     }
   }
diff --git a/runtime/oat_file_manager.h b/runtime/oat/oat_file_manager.h
similarity index 91%
rename from runtime/oat_file_manager.h
rename to runtime/oat/oat_file_manager.h
index e09390b..c5d79c9 100644
--- a/runtime/oat_file_manager.h
+++ b/runtime/oat/oat_file_manager.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_OAT_FILE_MANAGER_H_
-#define ART_RUNTIME_OAT_FILE_MANAGER_H_
+#ifndef ART_RUNTIME_OAT_OAT_FILE_MANAGER_H_
+#define ART_RUNTIME_OAT_OAT_FILE_MANAGER_H_
 
 #include <memory>
 #include <set>
@@ -28,7 +28,7 @@
 #include "base/macros.h"
 #include "jni.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace gc {
 namespace space {
@@ -55,14 +55,15 @@
   // with the same base address. Returns the oat file pointer from oat_file.
   // The `in_memory` parameter is whether the oat file is not present on disk,
   // but only in memory (for example files created with memfd).
-  const OatFile* RegisterOatFile(std::unique_ptr<const OatFile> oat_file, bool in_memory = false)
+  EXPORT const OatFile* RegisterOatFile(std::unique_ptr<const OatFile> oat_file,
+                                        bool in_memory = false)
       REQUIRES(!Locks::oat_file_manager_lock_);
 
   void UnRegisterAndDeleteOatFile(const OatFile* oat_file)
       REQUIRES(!Locks::oat_file_manager_lock_);
 
   // Find the first opened oat file with the same location, returns null if there are none.
-  const OatFile* FindOpenedOatFileFromOatLocation(const std::string& oat_location) const
+  EXPORT const OatFile* FindOpenedOatFileFromOatLocation(const std::string& oat_location) const
       REQUIRES(!Locks::oat_file_manager_lock_);
 
   // Find the oat file which contains a dex files with the given dex base location,
@@ -71,7 +72,7 @@
       REQUIRES(!Locks::oat_file_manager_lock_);
 
   // Returns the boot image oat files.
-  std::vector<const OatFile*> GetBootOatFiles() const;
+  EXPORT std::vector<const OatFile*> GetBootOatFiles() const;
 
   // Returns the oat files for the images, registers the oat files.
   // Takes ownership of the imagespace's underlying oat files.
@@ -135,10 +136,10 @@
   void DeleteThreadPool();
 
   // Wait for any ongoing background verification tasks to finish.
-  void WaitForBackgroundVerificationTasksToFinish();
+  EXPORT void WaitForBackgroundVerificationTasksToFinish();
 
   // Wait for all background verification tasks to finish. This is only used by tests.
-  void WaitForBackgroundVerificationTasks();
+  EXPORT void WaitForBackgroundVerificationTasks();
 
   // Maximum number of anonymous vdex files kept in the process' data folder.
   static constexpr size_t kAnonymousVdexCacheSize = 8u;
@@ -158,7 +159,7 @@
       REQUIRES(Locks::oat_file_manager_lock_);
 
   // Return true if we should attempt to load the app image.
-  bool ShouldLoadAppImage(const OatFile* source_oat_file) const;
+  bool ShouldLoadAppImage() const;
 
   std::set<std::unique_ptr<const OatFile>> oat_files_ GUARDED_BY(Locks::oat_file_manager_lock_);
 
@@ -174,4 +175,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_OAT_FILE_MANAGER_H_
+#endif  // ART_RUNTIME_OAT_OAT_FILE_MANAGER_H_
diff --git a/runtime/oat_file_test.cc b/runtime/oat/oat_file_test.cc
similarity index 99%
rename from runtime/oat_file_test.cc
rename to runtime/oat/oat_file_test.cc
index 80265f7..12a26f1 100644
--- a/runtime/oat_file_test.cc
+++ b/runtime/oat/oat_file_test.cc
@@ -24,7 +24,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "vdex_file.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class OatFileTest : public DexoptTest {};
 
diff --git a/runtime/oat_quick_method_header.cc b/runtime/oat/oat_quick_method_header.cc
similarity index 74%
rename from runtime/oat_quick_method_header.cc
rename to runtime/oat/oat_quick_method_header.cc
index f0764da..3d086e8 100644
--- a/runtime/oat_quick_method_header.cc
+++ b/runtime/oat/oat_quick_method_header.cc
@@ -16,6 +16,12 @@
 
 #include "oat_quick_method_header.h"
 
+#include <optional>
+
+#ifndef __APPLE__
+#include <link.h>  // for dl_iterate_phdr.
+#endif
+
 #include "arch/instruction_set.h"
 #include "art_method.h"
 #include "dex/dex_file_types.h"
@@ -25,7 +31,7 @@
 #include "stack_map.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 uint32_t OatQuickMethodHeader::ToDexPc(ArtMethod** frame,
                                        const uintptr_t pc,
@@ -128,8 +134,48 @@
 
 OatQuickMethodHeader* OatQuickMethodHeader::NterpMethodHeader = GetNterpMethodHeader();
 
+ArrayRef<const uint8_t> OatQuickMethodHeader::NterpWithClinitImpl =
+    interpreter::NterpWithClinitImpl();
+
+ArrayRef<const uint8_t> OatQuickMethodHeader::NterpImpl = interpreter::NterpImpl();
+
 bool OatQuickMethodHeader::IsNterpMethodHeader() const {
   return interpreter::IsNterpSupported() ? (this == NterpMethodHeader) : false;
 }
 
+// Find memory range where all libart code is located in memory.
+static ArrayRef<const uint8_t> FindLibartCode() {
+  ArrayRef<const uint8_t> result;
+#ifndef __APPLE__
+  auto callback = [](dl_phdr_info* info, size_t, void* ctx) {
+    auto res = reinterpret_cast<decltype(result)*>(ctx);
+    for (size_t i = 0; i < info->dlpi_phnum; i++) {
+      if (info->dlpi_phdr[i].p_type == PT_LOAD) {
+        uintptr_t self = reinterpret_cast<uintptr_t>(Runtime::Current);
+        uintptr_t code = info->dlpi_addr + info->dlpi_phdr[i].p_vaddr;
+        uintptr_t size = info->dlpi_phdr[i].p_memsz;
+        if (code <= self && self - code < size) {
+          *res = ArrayRef<const uint8_t>(reinterpret_cast<const uint8_t*>(code), size);
+          return 1;  // Stop iteration and return 1 from dl_iterate_phdr.
+        }
+      }
+    }
+    return 0;  // Continue iteration and return 0 from dl_iterate_phdr when finished.
+  };
+  bool ok = dl_iterate_phdr(callback, &result) != 0;
+  CHECK(ok) << "Can not find libart code in memory";
+#endif
+  return result;
+}
+
+// Check if the current method header is in libart.
+std::optional<bool> OatQuickMethodHeader::IsStub(const uint8_t* pc) {
+#ifndef __APPLE__
+  static ArrayRef<const uint8_t> libart_code = FindLibartCode();
+  return libart_code.begin() <= pc && pc < libart_code.end();
+#else
+  return std::nullopt;
+#endif
+}
+
 }  // namespace art
diff --git a/runtime/oat_quick_method_header.h b/runtime/oat/oat_quick_method_header.h
similarity index 73%
rename from runtime/oat_quick_method_header.h
rename to runtime/oat/oat_quick_method_header.h
index 769d67f..c32eb7f 100644
--- a/runtime/oat_quick_method_header.h
+++ b/runtime/oat/oat_quick_method_header.h
@@ -14,8 +14,10 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_OAT_QUICK_METHOD_HEADER_H_
-#define ART_RUNTIME_OAT_QUICK_METHOD_HEADER_H_
+#ifndef ART_RUNTIME_OAT_OAT_QUICK_METHOD_HEADER_H_
+#define ART_RUNTIME_OAT_OAT_QUICK_METHOD_HEADER_H_
+
+#include <optional>
 
 #include "arch/instruction_set.h"
 #include "base/locks.h"
@@ -24,7 +26,7 @@
 #include "quick/quick_method_frame_info.h"
 #include "stack_map.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtMethod;
 
@@ -41,8 +43,10 @@
   }
 
   static OatQuickMethodHeader* NterpMethodHeader;
+  EXPORT static ArrayRef<const uint8_t> NterpWithClinitImpl;
+  EXPORT static ArrayRef<const uint8_t> NterpImpl;
 
-  bool IsNterpMethodHeader() const;
+  EXPORT bool IsNterpMethodHeader() const;
 
   static bool IsNterpPc(uintptr_t pc) {
     return OatQuickMethodHeader::NterpMethodHeader != nullptr &&
@@ -73,11 +77,17 @@
     return pc - reinterpret_cast<uintptr_t>(GetEntryPoint());
   }
 
+  // Check if this is hard-written assembly (i.e. inside libart.so).
+  // Returns std::nullop on Mac.
+  static std::optional<bool> IsStub(const uint8_t* pc);
+
   ALWAYS_INLINE bool IsOptimized() const {
-    uintptr_t code = reinterpret_cast<uintptr_t>(code_);
-    DCHECK_NE(data_, 0u) << std::hex << code;          // Probably a padding of native code.
-    DCHECK_NE(data_, kInvalidData) << std::hex << code;  // Probably a stub or trampoline.
-    return (data_ & kIsCodeInfoMask) != 0;
+    if (code_ == NterpWithClinitImpl.data() || code_ == NterpImpl.data()) {
+      DCHECK(IsStub(code_).value_or(true));
+      return false;
+    }
+    DCHECK(!IsStub(code_).value_or(false));
+    return true;
   }
 
   ALWAYS_INLINE const uint8_t* GetOptimizedCodeInfoPtr() const {
@@ -97,26 +107,30 @@
   }
 
   ALWAYS_INLINE uint32_t GetCodeSize() const {
-    return LIKELY(IsOptimized())
-        ? CodeInfo::DecodeCodeSize(GetOptimizedCodeInfoPtr())
-        : (data_ & kCodeSizeMask);
+    if (code_ == NterpWithClinitImpl.data()) {
+      return NterpWithClinitImpl.size();
+    }
+    if (code_ == NterpImpl.data()) {
+      return NterpImpl.size();
+    }
+    return CodeInfo::DecodeCodeSize(GetOptimizedCodeInfoPtr());
   }
 
   ALWAYS_INLINE uint32_t GetCodeInfoOffset() const {
     DCHECK(IsOptimized());
-    return data_ & kCodeInfoMask;
+    return code_info_offset_;
   }
 
-  void SetCodeInfoOffset(uint32_t offset) {
-    data_ = kIsCodeInfoMask | offset;
-    DCHECK_EQ(GetCodeInfoOffset(), offset);
-  }
+  void SetCodeInfoOffset(uint32_t offset) { code_info_offset_ = offset; }
 
   bool Contains(uintptr_t pc) const {
-    // We should not call `Contains` on a stub or trampoline.
-    DCHECK_NE(data_, kInvalidData) << std::hex << reinterpret_cast<uintptr_t>(code_);
-    // Remove hwasan tag to make comparison below valid. The PC from the stack does not have it.
-    uintptr_t code_start = reinterpret_cast<uintptr_t>(HWASanUntag(code_));
+    uintptr_t code_start = reinterpret_cast<uintptr_t>(code_);
+// Let's not make assumptions about other architectures.
+#if defined(__aarch64__) || defined(__riscv__) || defined(__riscv)
+    // Verify that the code pointer is not tagged. Memory for code gets allocated with
+    // mspace_memalign or memory mapped from a file, neither of which is tagged by MTE/HWASan.
+    DCHECK_EQ(code_start, reinterpret_cast<uintptr_t>(code_start) & ((UINT64_C(1) << 56) - 1));
+#endif
     static_assert(kRuntimeISA != InstructionSet::kThumb2, "kThumb2 cannot be a runtime ISA");
     if (kRuntimeISA == InstructionSet::kArm) {
       // On Thumb-2, the pc is offset by one.
@@ -162,9 +176,9 @@
   }
 
   // For non-catch handlers. Only used in test code.
-  uintptr_t ToNativeQuickPc(ArtMethod* method,
-                            const uint32_t dex_pc,
-                            bool abort_on_failure = true) const;
+  EXPORT uintptr_t ToNativeQuickPc(ArtMethod* method,
+                                   const uint32_t dex_pc,
+                                   bool abort_on_failure = true) const;
 
   // For catch handlers.
   uintptr_t ToNativeQuickPcForCatchHandlers(ArtMethod* method,
@@ -177,29 +191,15 @@
                    bool abort_on_failure = true) const
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  void SetHasShouldDeoptimizeFlag() {
-    DCHECK(!HasShouldDeoptimizeFlag());
-    data_ |= kShouldDeoptimizeMask;
-  }
-
   bool HasShouldDeoptimizeFlag() const {
-    return (data_ & kShouldDeoptimizeMask) != 0;
+    return IsOptimized() && CodeInfo::HasShouldDeoptimizeFlag(GetOptimizedCodeInfoPtr());
   }
 
  private:
-  static constexpr uint32_t kShouldDeoptimizeMask = 0x80000000;
-  static constexpr uint32_t kIsCodeInfoMask       = 0x40000000;
-  static constexpr uint32_t kCodeInfoMask         = 0x3FFFFFFF;  // If kIsCodeInfoMask is set.
-  static constexpr uint32_t kCodeSizeMask         = 0x3FFFFFFF;  // If kIsCodeInfoMask is clear.
-
-  // In order to not confuse a stub with Java-generated code, we prefix each
-  // stub with a 0xFFFFFFFF marker.
-  static constexpr uint32_t kInvalidData = 0xFFFFFFFF;
-
-  uint32_t data_ = 0u;  // Combination of fields using the above masks.
+  uint32_t code_info_offset_ = 0u;
   uint8_t code_[0];     // The actual method code.
 };
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_OAT_QUICK_METHOD_HEADER_H_
+#endif  // ART_RUNTIME_OAT_OAT_QUICK_METHOD_HEADER_H_
diff --git a/runtime/stack_map.cc b/runtime/oat/stack_map.cc
similarity index 99%
rename from runtime/stack_map.cc
rename to runtime/oat/stack_map.cc
index 2c311fb..abef5cd 100644
--- a/runtime/stack_map.cc
+++ b/runtime/oat/stack_map.cc
@@ -25,7 +25,7 @@
 #include "oat_quick_method_header.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // The callback is used to inform the caller about memory bounds of the bit-tables.
 template<typename DecodeCallback>
diff --git a/runtime/stack_map.h b/runtime/oat/stack_map.h
similarity index 88%
rename from runtime/stack_map.h
rename to runtime/oat/stack_map.h
index 514d30e..07f393a 100644
--- a/runtime/stack_map.h
+++ b/runtime/oat/stack_map.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_STACK_MAP_H_
-#define ART_RUNTIME_STACK_MAP_H_
+#ifndef ART_RUNTIME_OAT_STACK_MAP_H_
+#define ART_RUNTIME_OAT_STACK_MAP_H_
 
 #include <limits>
 
@@ -26,12 +26,13 @@
 #include "base/bit_utils.h"
 #include "base/globals.h"
 #include "base/logging.h"
+#include "base/macros.h"
 #include "base/memory_region.h"
 #include "dex/dex_file_types.h"
 #include "dex_register_location.h"
 #include "quick/quick_method_frame_info.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace linker {
 class CodeInfoTableDeduper;
@@ -166,10 +167,10 @@
     return native_pc;
   }
 
-  void Dump(VariableIndentationOutputStream* vios,
-            const CodeInfo& code_info,
-            uint32_t code_offset,
-            InstructionSet instruction_set) const;
+  EXPORT void Dump(VariableIndentationOutputStream* vios,
+                   const CodeInfo& code_info,
+                   uint32_t code_offset,
+                   InstructionSet instruction_set) const;
 };
 
 /**
@@ -287,8 +288,8 @@
 class CodeInfo {
  public:
   ALWAYS_INLINE CodeInfo() {}
-  ALWAYS_INLINE explicit CodeInfo(const uint8_t* data, size_t* num_read_bits = nullptr);
-  ALWAYS_INLINE explicit CodeInfo(const OatQuickMethodHeader* header);
+  EXPORT ALWAYS_INLINE explicit CodeInfo(const uint8_t* data, size_t* num_read_bits = nullptr);
+  EXPORT ALWAYS_INLINE explicit CodeInfo(const OatQuickMethodHeader* header);
 
   // The following methods decode only part of the data.
   static CodeInfo DecodeGcMasksOnly(const OatQuickMethodHeader* header);
@@ -467,28 +468,51 @@
     return stack_maps_.GetInvalidRow();
   }
 
-  StackMap GetStackMapForNativePcOffset(uintptr_t pc, InstructionSet isa = kRuntimeISA) const;
+  EXPORT StackMap GetStackMapForNativePcOffset(uintptr_t pc,
+                                               InstructionSet isa = kRuntimeISA) const;
 
   // Dump this CodeInfo object on `vios`.
   // `code_offset` is the (absolute) native PC of the compiled method.
-  void Dump(VariableIndentationOutputStream* vios,
-            uint32_t code_offset,
-            bool verbose,
-            InstructionSet instruction_set) const;
+  EXPORT void Dump(VariableIndentationOutputStream* vios,
+                   uint32_t code_offset,
+                   bool verbose,
+                   InstructionSet instruction_set) const;
 
   // Accumulate code info size statistics into the given Stats tree.
-  static void CollectSizeStats(const uint8_t* code_info, /*out*/ Stats& parent);
+  EXPORT static void CollectSizeStats(const uint8_t* code_info, /*out*/ Stats& parent);
+
+  template <uint32_t kFlag>
+  ALWAYS_INLINE static bool HasFlag(const uint8_t* code_info_data) {
+    // Fast path - read just the one specific bit from the header.
+    bool result;
+    uint8_t varint = (*code_info_data) & MaxInt<uint8_t>(kVarintBits);
+    if (LIKELY(varint <= kVarintMax)) {
+      result = (varint & kFlag) != 0;
+    } else {
+      DCHECK_EQ(varint, kVarintMax + 1);  // Only up to 8 flags are supported for now.
+      constexpr uint32_t bit_offset = kNumHeaders * kVarintBits + WhichPowerOf2(kFlag);
+      result = (code_info_data[bit_offset / kBitsPerByte] & (1 << bit_offset % kBitsPerByte)) != 0;
+    }
+    // Slow path - dcheck that we got the correct result against the naive implementation.
+    BitMemoryReader reader(code_info_data);
+    DCHECK_EQ(result, (reader.ReadInterleavedVarints<kNumHeaders>()[0] & kFlag) != 0);
+    return result;
+  }
 
   ALWAYS_INLINE static bool HasInlineInfo(const uint8_t* code_info_data) {
-    return (*code_info_data & kHasInlineInfo) != 0;
+    return HasFlag<kHasInlineInfo>(code_info_data);
+  }
+
+  ALWAYS_INLINE static bool HasShouldDeoptimizeFlag(const uint8_t* code_info_data) {
+    return HasFlag<kHasShouldDeoptimizeFlag>(code_info_data);
   }
 
   ALWAYS_INLINE static bool IsBaseline(const uint8_t* code_info_data) {
-    return (*code_info_data & kIsBaseline) != 0;
+    return HasFlag<kIsBaseline>(code_info_data);
   }
 
   ALWAYS_INLINE static bool IsDebuggable(const uint8_t* code_info_data) {
-    return (*code_info_data & kIsDebuggable) != 0;
+    return HasFlag<kIsDebuggable>(code_info_data);
   }
 
   uint32_t GetNumberOfDexRegisters() {
@@ -497,9 +521,9 @@
 
  private:
   // Scan backward to determine dex register locations at given stack map.
-  void DecodeDexRegisterMap(uint32_t stack_map_index,
-                            uint32_t first_dex_register,
-                            /*out*/ DexRegisterMap* map) const;
+  EXPORT void DecodeDexRegisterMap(uint32_t stack_map_index,
+                                   uint32_t first_dex_register,
+                                   /*out*/ DexRegisterMap* map) const;
 
   template<typename DecodeCallback>  // (size_t index, BitTable<...>*, BitMemoryRegion).
   ALWAYS_INLINE CodeInfo(const uint8_t* data, size_t* num_read_bits, DecodeCallback callback);
@@ -538,20 +562,18 @@
   void SetBitTableDeduped(size_t i) { bit_table_flags_ |= 1 << (kNumBitTables + i); }
   bool HasDedupedBitTables() { return (bit_table_flags_ >> kNumBitTables) != 0u; }
 
+  // NB: The first three flags should be the most common ones.
+  //     Maximum of 8 flags is supported right now (see the HasFlag method).
   enum Flags {
     kHasInlineInfo = 1 << 0,
-    kIsBaseline = 1 << 1,
-    kIsDebuggable = 1 << 2,
+    kHasShouldDeoptimizeFlag = 1 << 1,
+    kIsBaseline = 1 << 2,
+    kIsDebuggable = 1 << 3,
   };
 
   // The CodeInfo starts with sequence of variable-length bit-encoded integers.
   // (Please see kVarintMax for more details about encoding).
   static constexpr size_t kNumHeaders = 7;
-  // Note that the space for flags is limited to three bits. We use a custom encoding where we
-  // encode the value inline if it is less than kVarintMax. We want to access flags without
-  // decoding the entire CodeInfo header so the value of flags cannot be more than kVarintMax.
-  // See IsDebuggable / IsBaseline / HasInlineInfo on how we access flags_ without decoding the
-  // header.
   uint32_t flags_ = 0;
   uint32_t code_size_ = 0;  // The size of native PC range in bytes.
   uint32_t packed_frame_size_ = 0;  // Frame size in kStackAlignment units.
@@ -581,4 +603,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_STACK_MAP_H_
+#endif  // ART_RUNTIME_OAT_STACK_MAP_H_
diff --git a/runtime/obj_ptr-inl.h b/runtime/obj_ptr-inl.h
index ae13465..039c32b 100644
--- a/runtime/obj_ptr-inl.h
+++ b/runtime/obj_ptr-inl.h
@@ -23,7 +23,7 @@
 #include "obj_ptr.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template<class MirrorType>
 inline uintptr_t ObjPtr<MirrorType>::GetCurrentTrimedCookie() {
diff --git a/runtime/obj_ptr.h b/runtime/obj_ptr.h
index 7e52a50..9c756a1 100644
--- a/runtime/obj_ptr.h
+++ b/runtime/obj_ptr.h
@@ -27,7 +27,7 @@
 // Always inline ObjPtr methods even in debug builds.
 #define OBJPTR_INLINE __attribute__ ((always_inline))
 
-namespace art {
+namespace art HIDDEN {
 
 constexpr bool kObjPtrPoisoning = kIsDebugBuild;
 
diff --git a/runtime/object_callbacks.h b/runtime/object_callbacks.h
index d36913b..485e3a8 100644
--- a/runtime/object_callbacks.h
+++ b/runtime/object_callbacks.h
@@ -19,7 +19,7 @@
 
 #include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 class Object;
 template<class MirrorType> class HeapReference;
diff --git a/runtime/object_lock.cc b/runtime/object_lock.cc
index 9e02484..a421549 100644
--- a/runtime/object_lock.cc
+++ b/runtime/object_lock.cc
@@ -20,7 +20,7 @@
 #include "mirror/object-inl.h"
 #include "monitor.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template <typename T>
 ObjectLock<T>::ObjectLock(Thread* self, Handle<T> object) : self_(self), obj_(object) {
diff --git a/runtime/object_lock.h b/runtime/object_lock.h
index 15b763a..0f6f39f 100644
--- a/runtime/object_lock.h
+++ b/runtime/object_lock.h
@@ -21,16 +21,16 @@
 #include "base/macros.h"
 #include "handle.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class Thread;
 
 template <typename T>
 class ObjectLock {
  public:
-  ObjectLock(Thread* self, Handle<T> object) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT ObjectLock(Thread* self, Handle<T> object) REQUIRES_SHARED(Locks::mutator_lock_);
 
-  ~ObjectLock() REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT ~ObjectLock() REQUIRES_SHARED(Locks::mutator_lock_);
 
   void WaitIgnoringInterrupts() REQUIRES_SHARED(Locks::mutator_lock_);
 
@@ -65,7 +65,6 @@
   DISALLOW_COPY_AND_ASSIGN(ObjectTryLock);
 };
 
-
 }  // namespace art
 
 #endif  // ART_RUNTIME_OBJECT_LOCK_H_
diff --git a/runtime/offsets.cc b/runtime/offsets.cc
index f59ed88..e02d060 100644
--- a/runtime/offsets.cc
+++ b/runtime/offsets.cc
@@ -18,7 +18,7 @@
 
 #include <ostream>
 
-namespace art {
+namespace art HIDDEN {
 
 std::ostream& operator<<(std::ostream& os, const Offset& offs) {
   return os << offs.Int32Value();
diff --git a/runtime/offsets.h b/runtime/offsets.h
index 7974111..1748051 100644
--- a/runtime/offsets.h
+++ b/runtime/offsets.h
@@ -20,9 +20,10 @@
 #include <iosfwd>
 
 #include "base/enums.h"
+#include "base/macros.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Allow the meaning of offsets to be strongly typed.
 class Offset {
diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc
index 7df765f..d241ebe 100644
--- a/runtime/parsed_options.cc
+++ b/runtime/parsed_options.cc
@@ -38,7 +38,7 @@
 #include "cmdline_parser.h"
 #include "runtime_options.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using MemoryKiB = Memory<1024>;
 
@@ -313,6 +313,7 @@
                "-Xps-min-classes-to-save:_",
                "-Xps-min-notification-before-wake:_",
                "-Xps-max-notification-before-wake:_",
+               "-Xps-inline-cache-threshold:_",
                "-Xps-profile-path:_"})
           .WithHelp("profile-saver options -Xps-<key>:<value>")
           .WithType<ProfileSaverOptions>()
@@ -341,6 +342,8 @@
           .IntoKey(M::BackgroundGc)
       .Define("-XX:+DisableExplicitGC")
           .IntoKey(M::DisableExplicitGC)
+      .Define("-XX:+DisableEagerlyReleaseExplicitGC")
+          .IntoKey(M::DisableEagerlyReleaseExplicitGC)
       .Define("-Xlockprofthreshold:_")
           .WithType<unsigned int>()
           .IntoKey(M::LockProfThreshold)
diff --git a/runtime/parsed_options.h b/runtime/parsed_options.h
index 00e0a97..527304d 100644
--- a/runtime/parsed_options.h
+++ b/runtime/parsed_options.h
@@ -24,13 +24,14 @@
 #include <jni.h>
 
 #include "arch/instruction_set.h"
+#include "base/macros.h"
 #include "gc/collector_type.h"
 #include "gc/space/large_object_space.h"
 // #include "jit/profile_saver_options.h"
 #include "runtime_globals.h"
 #include "runtime_options.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class CompilerCallbacks;
 class DexFile;
diff --git a/runtime/parsed_options_test.cc b/runtime/parsed_options_test.cc
index 7cc6432..973adb5 100644
--- a/runtime/parsed_options_test.cc
+++ b/runtime/parsed_options_test.cc
@@ -21,7 +21,7 @@
 #include "arch/instruction_set.h"
 #include "base/common_art_test.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ParsedOptionsTest : public CommonArtTest {
  public:
@@ -165,9 +165,10 @@
     EXPECT_EQ(kRuntimeISA, isa);
   }
 
-  const char* isa_strings[] = { "arm", "arm64", "x86", "x86_64" };
+  const char* isa_strings[] = { "arm", "arm64", "riscv64", "x86", "x86_64" };
   InstructionSet ISAs[] = { InstructionSet::kArm,
                             InstructionSet::kArm64,
+                            InstructionSet::kRiscv64,
                             InstructionSet::kX86,
                             InstructionSet::kX86_64 };
   static_assert(arraysize(isa_strings) == arraysize(ISAs), "Need same amount.");
diff --git a/runtime/plugin.cc b/runtime/plugin.cc
index 6b9e008..29ac7a6 100644
--- a/runtime/plugin.cc
+++ b/runtime/plugin.cc
@@ -23,7 +23,7 @@
 #include "base/mutex.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
diff --git a/runtime/plugin.h b/runtime/plugin.h
index 4885b2e..6164a33 100644
--- a/runtime/plugin.h
+++ b/runtime/plugin.h
@@ -21,7 +21,9 @@
 
 #include <android-base/logging.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 // This function is loaded from the plugin (if present) and called during runtime initialization.
 // By the time this has been called the runtime has been fully initialized but not other native
diff --git a/runtime/prebuilt_tools_test.cc b/runtime/prebuilt_tools_test.cc
index e05a8e4..a86cf74 100644
--- a/runtime/prebuilt_tools_test.cc
+++ b/runtime/prebuilt_tools_test.cc
@@ -20,7 +20,7 @@
 
 #include "gtest/gtest.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Run the tests only on host.
 #ifndef ART_TARGET_ANDROID
diff --git a/runtime/process_state.h b/runtime/process_state.h
index aee200a..94f8bd9 100644
--- a/runtime/process_state.h
+++ b/runtime/process_state.h
@@ -17,7 +17,9 @@
 #ifndef ART_RUNTIME_PROCESS_STATE_H_
 #define ART_RUNTIME_PROCESS_STATE_H_
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 // The process state passed in from the activity manager, used to determine when to do trimming
 // and compaction.
diff --git a/runtime/proxy_test.cc b/runtime/proxy_test.cc
index ac8ec56..c57b3d4 100644
--- a/runtime/proxy_test.cc
+++ b/runtime/proxy_test.cc
@@ -25,7 +25,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace proxy_test {
 
 class ProxyTest : public CommonRuntimeTest {
diff --git a/runtime/proxy_test.h b/runtime/proxy_test.h
index 9a01441..8c69a2e 100644
--- a/runtime/proxy_test.h
+++ b/runtime/proxy_test.h
@@ -21,13 +21,14 @@
 #include <vector>
 
 #include "art_method-inl.h"
+#include "base/macros.h"
 #include "class_linker-inl.h"
 #include "class_root-inl.h"
 #include "mirror/class-inl.h"
 #include "mirror/method.h"
 #include "obj_ptr-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace proxy_test {
 
 // Generate a proxy class with the given name and interfaces. This is a simplification from what
diff --git a/runtime/quick/quick_method_frame_info.h b/runtime/quick/quick_method_frame_info.h
index 71f8265..1d5f173 100644
--- a/runtime/quick/quick_method_frame_info.h
+++ b/runtime/quick/quick_method_frame_info.h
@@ -21,7 +21,7 @@
 
 #include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class PACKED(4) QuickMethodFrameInfo {
  public:
diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc
index fd57b4a..cc276ca 100644
--- a/runtime/quick_exception_handler.cc
+++ b/runtime/quick_exception_handler.cc
@@ -29,6 +29,7 @@
 #include "base/systrace.h"
 #include "dex/dex_file_types.h"
 #include "dex/dex_instruction.h"
+#include "dex/dex_instruction-inl.h"
 #include "entrypoints/entrypoint_utils.h"
 #include "entrypoints/quick/quick_entrypoints_enum.h"
 #include "entrypoints/runtime_asm_entrypoints.h"
@@ -40,11 +41,11 @@
 #include "mirror/class_loader.h"
 #include "mirror/throwable.h"
 #include "nterp_helpers.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
+#include "oat/stack_map.h"
 #include "stack.h"
-#include "stack_map.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static constexpr bool kDebugExceptionDelivery = false;
 static constexpr size_t kInvalidFrameDepth = 0xffffffff;
@@ -385,6 +386,7 @@
       : StackVisitor(self, context, StackVisitor::StackWalkKind::kIncludeInlinedFrames),
         exception_handler_(exception_handler),
         prev_shadow_frame_(nullptr),
+        bottom_shadow_frame_(nullptr),
         stacked_shadow_frame_pushed_(false),
         single_frame_deopt_(single_frame),
         single_frame_done_(false),
@@ -401,6 +403,14 @@
     return single_frame_deopt_quick_method_header_;
   }
 
+  ShadowFrame* GetBottomShadowFrame() const {
+    return bottom_shadow_frame_;
+  }
+
+  const std::vector<uint32_t>& GetDexPcs() const {
+    return dex_pcs_;
+  }
+
   void FinishStackWalk() REQUIRES_SHARED(Locks::mutator_lock_) {
     // This is the upcall, or the next full frame in single-frame deopt, or the
     // code isn't deoptimizeable. We remember the frame and last pc so that we
@@ -503,16 +513,20 @@
         // Will be popped after the long jump after DeoptimizeStack(),
         // right before interpreter::EnterInterpreterFromDeoptimize().
         stacked_shadow_frame_pushed_ = true;
+        bottom_shadow_frame_ = new_frame;
         GetThread()->PushStackedShadowFrame(
             new_frame, StackedShadowFrameType::kDeoptimizationShadowFrame);
       }
       prev_shadow_frame_ = new_frame;
 
-      if (single_frame_deopt_ && !IsInInlinedFrame()) {
-        // Single-frame deopt ends at the first non-inlined frame and needs to store that method.
-        single_frame_done_ = true;
-        single_frame_deopt_method_ = method;
-        single_frame_deopt_quick_method_header_ = GetCurrentOatQuickMethodHeader();
+      if (single_frame_deopt_) {
+        dex_pcs_.push_back(GetDexPc());
+        if (!IsInInlinedFrame()) {
+          // Single-frame deopt ends at the first non-inlined frame and needs to store that method.
+          single_frame_done_ = true;
+          single_frame_deopt_method_ = method;
+          single_frame_deopt_quick_method_header_ = GetCurrentOatQuickMethodHeader();
+        }
       }
       callee_method_ = method;
       return true;
@@ -641,6 +655,7 @@
 
   QuickExceptionHandler* const exception_handler_;
   ShadowFrame* prev_shadow_frame_;
+  ShadowFrame* bottom_shadow_frame_;
   bool stacked_shadow_frame_pushed_;
   const bool single_frame_deopt_;
   bool single_frame_done_;
@@ -651,6 +666,7 @@
   // a deopt after running method exit callbacks if the callback throws or requests events that
   // need a deopt.
   bool skip_method_exit_callbacks_;
+  std::vector<uint32_t> dex_pcs_;
 
   DISALLOW_COPY_AND_ASSIGN(DeoptimizeStackVisitor);
 };
@@ -707,14 +723,58 @@
   // When deoptimizing for debug support the optimized code is still valid and
   // can be reused when debugging support (like breakpoints) are no longer
   // needed fot this method.
-  if (Runtime::Current()->UseJitCompilation() && (kind != DeoptimizationKind::kDebugging)) {
-    Runtime::Current()->GetJit()->GetCodeCache()->InvalidateCompiledCodeFor(
+  Runtime* runtime = Runtime::Current();
+  if (runtime->UseJitCompilation() && (kind != DeoptimizationKind::kDebugging)) {
+    runtime->GetJit()->GetCodeCache()->InvalidateCompiledCodeFor(
         deopt_method, visitor.GetSingleFrameDeoptQuickMethodHeader());
   } else {
-    Runtime::Current()->GetInstrumentation()->InitializeMethodsCode(
+    runtime->GetInstrumentation()->InitializeMethodsCode(
         deopt_method, /*aot_code=*/ nullptr);
   }
 
+  // If the deoptimization is due to an inline cache, update it with the type
+  // that made us deoptimize. This avoids pathological cases of never seeing
+  // that type while executing baseline generated code.
+  if (kind == DeoptimizationKind::kJitInlineCache || kind == DeoptimizationKind::kJitSameTarget) {
+    DCHECK(runtime->UseJitCompilation());
+    ShadowFrame* shadow_frame = visitor.GetBottomShadowFrame();
+    uint32_t dex_pc = shadow_frame->GetDexPC();
+    CodeItemDataAccessor accessor(shadow_frame->GetMethod()->DexInstructionData());
+    const uint16_t* const insns = accessor.Insns();
+    const Instruction* inst = Instruction::At(insns + dex_pc);
+    switch (inst->Opcode()) {
+      case Instruction::INVOKE_INTERFACE:
+      case Instruction::INVOKE_VIRTUAL:
+      case Instruction::INVOKE_INTERFACE_RANGE:
+      case Instruction::INVOKE_VIRTUAL_RANGE: {
+        uint32_t encoded_dex_pc = InlineCache::EncodeDexPc(
+            visitor.GetSingleFrameDeoptMethod(),
+            visitor.GetDexPcs(),
+            runtime->GetJit()->GetJitCompiler()->GetInlineMaxCodeUnits());
+        if (encoded_dex_pc != static_cast<uint32_t>(-1)) {
+          // The inline cache comes from the top-level method.
+          runtime->GetJit()->GetCodeCache()->MaybeUpdateInlineCache(
+              visitor.GetSingleFrameDeoptMethod(),
+              encoded_dex_pc,
+              shadow_frame->GetVRegReference(inst->VRegC())->GetClass(),
+              self_);
+        } else {
+          // If the top-level inline cache did not exist, update the one for the
+          // bottom method, we know it's the one that was used for compilation.
+          runtime->GetJit()->GetCodeCache()->MaybeUpdateInlineCache(
+              shadow_frame->GetMethod(),
+              dex_pc,
+              shadow_frame->GetVRegReference(inst->VRegC())->GetClass(),
+              self_);
+        }
+        break;
+      }
+      default: {
+        LOG(FATAL) << "Unexpected instruction for inline cache: " << inst->Name();
+      }
+    }
+  }
+
   PrepareForLongJumpToInvokeStubOrInterpreterBridge();
 }
 
diff --git a/runtime/quick_exception_handler.h b/runtime/quick_exception_handler.h
index 39462e5..d39c82b 100644
--- a/runtime/quick_exception_handler.h
+++ b/runtime/quick_exception_handler.h
@@ -25,10 +25,10 @@
 #include "base/macros.h"
 #include "base/mutex.h"
 #include "deoptimization_kind.h"
-#include "stack_map.h"
+#include "oat/stack_map.h"
 #include "stack_reference.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Throwable;
diff --git a/runtime/quicken_info.h b/runtime/quicken_info.h
deleted file mode 100644
index 83dc5f1..0000000
--- a/runtime/quicken_info.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ART_RUNTIME_QUICKEN_INFO_H_
-#define ART_RUNTIME_QUICKEN_INFO_H_
-
-#include "base/array_ref.h"
-#include "base/leb128.h"
-#include "dex/compact_offset_table.h"
-#include "dex/dex_instruction.h"
-
-namespace art {
-
-// QuickenInfoTable is a table of 16 bit dex indices. There is one slot for every instruction that
-// is possibly dequickenable.
-class QuickenInfoTable {
- public:
-  class Builder {
-   public:
-    Builder(std::vector<uint8_t>* out_data, size_t num_elements) : out_data_(out_data) {
-      EncodeUnsignedLeb128(out_data_, num_elements);
-    }
-
-    void AddIndex(uint16_t index) {
-      out_data_->push_back(static_cast<uint8_t>(index));
-      out_data_->push_back(static_cast<uint8_t>(index >> 8));
-    }
-
-   private:
-    std::vector<uint8_t>* const out_data_;
-  };
-
-  explicit QuickenInfoTable(ArrayRef<const uint8_t> data)
-      : data_(data.data()),
-        num_elements_(!data.empty() ? DecodeUnsignedLeb128(&data_) : 0u) {}
-
-  bool IsNull() const {
-    return data_ == nullptr;
-  }
-
-  uint16_t GetData(size_t index) const {
-    return data_[index * 2] | (static_cast<uint16_t>(data_[index * 2 + 1]) << 8);
-  }
-
-  // Returns true if the dex instruction has an index in the table. (maybe dequickenable).
-  static bool NeedsIndexForInstruction(const Instruction* inst) {
-    return inst->IsQuickened();
-  }
-
-  static size_t NumberOfIndices(size_t bytes) {
-    return bytes / sizeof(uint16_t);
-  }
-
-  static size_t SizeInBytes(ArrayRef<const uint8_t> data) {
-    QuickenInfoTable table(data);
-    return table.data_ + table.NumIndices() * 2 - data.data();
-  }
-
-  uint32_t NumIndices() const {
-    return num_elements_;
-  }
-
- private:
-  const uint8_t* data_;
-  const uint32_t num_elements_;
-
-  DISALLOW_COPY_AND_ASSIGN(QuickenInfoTable);
-};
-
-}  // namespace art
-
-#endif  // ART_RUNTIME_QUICKEN_INFO_H_
diff --git a/runtime/read_barrier-inl.h b/runtime/read_barrier-inl.h
index 91406c6..b3aa053 100644
--- a/runtime/read_barrier-inl.h
+++ b/runtime/read_barrier-inl.h
@@ -28,7 +28,7 @@
 #include "mirror/reference.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template <typename MirrorType, bool kIsVolatile, ReadBarrierOption kReadBarrierOption,
           bool kAlwaysUpdateField>
diff --git a/runtime/read_barrier.cc b/runtime/read_barrier.cc
index 89ae910..db22d46 100644
--- a/runtime/read_barrier.cc
+++ b/runtime/read_barrier.cc
@@ -16,7 +16,7 @@
 
 #include "read_barrier.h"
 
-namespace art {
+namespace art HIDDEN {
 
 DEFINE_RUNTIME_DEBUG_FLAG(ReadBarrier, kEnableToSpaceInvariantChecks);
 DEFINE_RUNTIME_DEBUG_FLAG(ReadBarrier, kEnableReadBarrierInvariantChecks);
diff --git a/runtime/read_barrier.h b/runtime/read_barrier.h
index be5a9a0..4e53cd2 100644
--- a/runtime/read_barrier.h
+++ b/runtime/read_barrier.h
@@ -28,7 +28,7 @@
 #include "offsets.h"
 #include "read_barrier_config.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 class Object;
 template<typename MirrorType> class HeapReference;
diff --git a/runtime/read_barrier_config.h b/runtime/read_barrier_config.h
index 876e3d7..5a5fc05 100644
--- a/runtime/read_barrier_config.h
+++ b/runtime/read_barrier_config.h
@@ -53,8 +53,9 @@
 #ifdef __cplusplus
 
 #include "base/globals.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 #ifdef USE_BAKER_READ_BARRIER
 static constexpr bool kUseBakerReadBarrier = true;
@@ -86,8 +87,8 @@
 constexpr bool gUseUserfaultfd = false;
 #endif
 #else
-extern const bool gUseReadBarrier;
-extern const bool gUseUserfaultfd;
+EXPORT extern const bool gUseReadBarrier;
+EXPORT extern const bool gUseUserfaultfd;
 #endif
 #endif
 
diff --git a/runtime/read_barrier_option.h b/runtime/read_barrier_option.h
index 36fc2d2..ad82973 100644
--- a/runtime/read_barrier_option.h
+++ b/runtime/read_barrier_option.h
@@ -16,7 +16,10 @@
 
 #ifndef ART_RUNTIME_READ_BARRIER_OPTION_H_
 #define ART_RUNTIME_READ_BARRIER_OPTION_H_
-namespace art {
+
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 // Options for performing a read barrier or not.
 //
@@ -81,9 +84,9 @@
 //
 // The superclass becomes constant during the ClassStatus::kIdx stage, so it's safe to treat it
 // as constant when reading from locations that can reference only resolved classes.
-enum ReadBarrierOption {
-  kWithReadBarrier,     // Perform a read barrier.
-  kWithoutReadBarrier,  // Don't perform a read barrier.
+enum EXPORT ReadBarrierOption {
+  kWithReadBarrier,       // Perform a read barrier.
+  kWithoutReadBarrier,    // Don't perform a read barrier.
   kWithFromSpaceBarrier,  // Get the from-space address for the given to-space address. Used by CMC
 };
 
diff --git a/runtime/reference_table.cc b/runtime/reference_table.cc
index 45f5633..e777786 100644
--- a/runtime/reference_table.cc
+++ b/runtime/reference_table.cc
@@ -32,7 +32,7 @@
 #include "runtime-inl.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringAppendF;
 using android::base::StringPrintf;
diff --git a/runtime/reference_table.h b/runtime/reference_table.h
index b204533..6e559ca 100644
--- a/runtime/reference_table.h
+++ b/runtime/reference_table.h
@@ -24,10 +24,11 @@
 
 #include "base/allocator.h"
 #include "base/locks.h"
+#include "base/macros.h"
 #include "gc_root.h"
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace jni {
 class LocalReferenceTable;
 }  // namespace jni
@@ -54,7 +55,7 @@
       REQUIRES_SHARED(Locks::mutator_lock_)
       REQUIRES(!Locks::alloc_tracker_lock_);
 
-  void VisitRoots(RootVisitor* visitor, const RootInfo& root_info)
+  EXPORT void VisitRoots(RootVisitor* visitor, const RootInfo& root_info)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
  private:
diff --git a/runtime/reference_table_test.cc b/runtime/reference_table_test.cc
index 420543e..af8f4e5 100644
--- a/runtime/reference_table_test.cc
+++ b/runtime/reference_table_test.cc
@@ -36,7 +36,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
diff --git a/runtime/reflection-inl.h b/runtime/reflection-inl.h
index 8ad61f0..b05862b 100644
--- a/runtime/reflection-inl.h
+++ b/runtime/reflection-inl.h
@@ -28,7 +28,7 @@
 #include "mirror/object-inl.h"
 #include "obj_ptr-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 inline bool ConvertPrimitiveValueNoThrow(Primitive::Type srcType,
                                          Primitive::Type dstType,
diff --git a/runtime/reflection.cc b/runtime/reflection.cc
index bfe9c8f..c292f2a 100644
--- a/runtime/reflection.cc
+++ b/runtime/reflection.cc
@@ -34,9 +34,9 @@
 #include "scoped_thread_state_change-inl.h"
 #include "stack_reference.h"
 #include "thread-inl.h"
-#include "well_known_classes.h"
+#include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace {
 
 using android::base::StringPrintf;
@@ -259,15 +259,15 @@
         }
       }
 
-#define DO_FIRST_ARG(match_descriptor, get_fn, append) { \
+#define DO_FIRST_ARG(boxed, get_fn, append) { \
           if (LIKELY(arg != nullptr && \
-              arg->GetClass()->DescriptorEquals(match_descriptor))) { \
+                     arg->GetClass() == WellKnownClasses::java_lang_##boxed)) { \
             ArtField* primitive_field = arg->GetClass()->GetInstanceField(0); \
             append(primitive_field-> get_fn(arg.Get()));
 
-#define DO_ARG(match_descriptor, get_fn, append) \
+#define DO_ARG(boxed, get_fn, append) \
           } else if (LIKELY(arg != nullptr && \
-                            arg->GetClass<>()->DescriptorEquals(match_descriptor))) { \
+                            arg->GetClass() == WellKnownClasses::java_lang_##boxed)) { \
             ArtField* primitive_field = arg->GetClass()->GetInstanceField(0); \
             append(primitive_field-> get_fn(arg.Get()));
 
@@ -293,54 +293,54 @@
           Append(arg.Get());
           break;
         case 'Z':
-          DO_FIRST_ARG("Ljava/lang/Boolean;", GetBoolean, Append)
+          DO_FIRST_ARG(Boolean, GetBoolean, Append)
           DO_FAIL("boolean")
           break;
         case 'B':
-          DO_FIRST_ARG("Ljava/lang/Byte;", GetByte, Append)
+          DO_FIRST_ARG(Byte, GetByte, Append)
           DO_FAIL("byte")
           break;
         case 'C':
-          DO_FIRST_ARG("Ljava/lang/Character;", GetChar, Append)
+          DO_FIRST_ARG(Character, GetChar, Append)
           DO_FAIL("char")
           break;
         case 'S':
-          DO_FIRST_ARG("Ljava/lang/Short;", GetShort, Append)
-          DO_ARG("Ljava/lang/Byte;", GetByte, Append)
+          DO_FIRST_ARG(Short, GetShort, Append)
+          DO_ARG(Byte, GetByte, Append)
           DO_FAIL("short")
           break;
         case 'I':
-          DO_FIRST_ARG("Ljava/lang/Integer;", GetInt, Append)
-          DO_ARG("Ljava/lang/Character;", GetChar, Append)
-          DO_ARG("Ljava/lang/Short;", GetShort, Append)
-          DO_ARG("Ljava/lang/Byte;", GetByte, Append)
+          DO_FIRST_ARG(Integer, GetInt, Append)
+          DO_ARG(Character, GetChar, Append)
+          DO_ARG(Short, GetShort, Append)
+          DO_ARG(Byte, GetByte, Append)
           DO_FAIL("int")
           break;
         case 'J':
-          DO_FIRST_ARG("Ljava/lang/Long;", GetLong, AppendWide)
-          DO_ARG("Ljava/lang/Integer;", GetInt, AppendWide)
-          DO_ARG("Ljava/lang/Character;", GetChar, AppendWide)
-          DO_ARG("Ljava/lang/Short;", GetShort, AppendWide)
-          DO_ARG("Ljava/lang/Byte;", GetByte, AppendWide)
+          DO_FIRST_ARG(Long, GetLong, AppendWide)
+          DO_ARG(Integer, GetInt, AppendWide)
+          DO_ARG(Character, GetChar, AppendWide)
+          DO_ARG(Short, GetShort, AppendWide)
+          DO_ARG(Byte, GetByte, AppendWide)
           DO_FAIL("long")
           break;
         case 'F':
-          DO_FIRST_ARG("Ljava/lang/Float;", GetFloat, AppendFloat)
-          DO_ARG("Ljava/lang/Long;", GetLong, AppendFloat)
-          DO_ARG("Ljava/lang/Integer;", GetInt, AppendFloat)
-          DO_ARG("Ljava/lang/Character;", GetChar, AppendFloat)
-          DO_ARG("Ljava/lang/Short;", GetShort, AppendFloat)
-          DO_ARG("Ljava/lang/Byte;", GetByte, AppendFloat)
+          DO_FIRST_ARG(Float, GetFloat, AppendFloat)
+          DO_ARG(Long, GetLong, AppendFloat)
+          DO_ARG(Integer, GetInt, AppendFloat)
+          DO_ARG(Character, GetChar, AppendFloat)
+          DO_ARG(Short, GetShort, AppendFloat)
+          DO_ARG(Byte, GetByte, AppendFloat)
           DO_FAIL("float")
           break;
         case 'D':
-          DO_FIRST_ARG("Ljava/lang/Double;", GetDouble, AppendDouble)
-          DO_ARG("Ljava/lang/Float;", GetFloat, AppendDouble)
-          DO_ARG("Ljava/lang/Long;", GetLong, AppendDouble)
-          DO_ARG("Ljava/lang/Integer;", GetInt, AppendDouble)
-          DO_ARG("Ljava/lang/Character;", GetChar, AppendDouble)
-          DO_ARG("Ljava/lang/Short;", GetShort, AppendDouble)
-          DO_ARG("Ljava/lang/Byte;", GetByte, AppendDouble)
+          DO_FIRST_ARG(Double, GetDouble, AppendDouble)
+          DO_ARG(Float, GetFloat, AppendDouble)
+          DO_ARG(Long, GetLong, AppendDouble)
+          DO_ARG(Integer, GetInt, AppendDouble)
+          DO_ARG(Character, GetChar, AppendDouble)
+          DO_ARG(Short, GetShort, AppendDouble)
+          DO_ARG(Byte, GetByte, AppendDouble)
           DO_FAIL("double")
           break;
 #ifndef NDEBUG
@@ -952,28 +952,28 @@
   ObjPtr<mirror::Class> klass = o->GetClass();
   Primitive::Type primitive_type;
   ArtField* primitive_field = &klass->GetIFieldsPtr()->At(0);
-  if (klass->DescriptorEquals("Ljava/lang/Boolean;")) {
+  if (klass == WellKnownClasses::java_lang_Boolean) {
     primitive_type = Primitive::kPrimBoolean;
     boxed_value.SetZ(primitive_field->GetBoolean(o));
-  } else if (klass->DescriptorEquals("Ljava/lang/Byte;")) {
+  } else if (klass == WellKnownClasses::java_lang_Byte) {
     primitive_type = Primitive::kPrimByte;
     boxed_value.SetB(primitive_field->GetByte(o));
-  } else if (klass->DescriptorEquals("Ljava/lang/Character;")) {
+  } else if (klass == WellKnownClasses::java_lang_Character) {
     primitive_type = Primitive::kPrimChar;
     boxed_value.SetC(primitive_field->GetChar(o));
-  } else if (klass->DescriptorEquals("Ljava/lang/Float;")) {
+  } else if (klass == WellKnownClasses::java_lang_Float) {
     primitive_type = Primitive::kPrimFloat;
     boxed_value.SetF(primitive_field->GetFloat(o));
-  } else if (klass->DescriptorEquals("Ljava/lang/Double;")) {
+  } else if (klass == WellKnownClasses::java_lang_Double) {
     primitive_type = Primitive::kPrimDouble;
     boxed_value.SetD(primitive_field->GetDouble(o));
-  } else if (klass->DescriptorEquals("Ljava/lang/Integer;")) {
+  } else if (klass == WellKnownClasses::java_lang_Integer) {
     primitive_type = Primitive::kPrimInt;
     boxed_value.SetI(primitive_field->GetInt(o));
-  } else if (klass->DescriptorEquals("Ljava/lang/Long;")) {
+  } else if (klass == WellKnownClasses::java_lang_Long) {
     primitive_type = Primitive::kPrimLong;
     boxed_value.SetJ(primitive_field->GetLong(o));
-  } else if (klass->DescriptorEquals("Ljava/lang/Short;")) {
+  } else if (klass == WellKnownClasses::java_lang_Short) {
     primitive_type = Primitive::kPrimShort;
     boxed_value.SetS(primitive_field->GetShort(o));
   } else {
diff --git a/runtime/reflection.h b/runtime/reflection.h
index 13dc8e1..552762b 100644
--- a/runtime/reflection.h
+++ b/runtime/reflection.h
@@ -19,11 +19,12 @@
 
 #include "base/enums.h"
 #include "base/locks.h"
+#include "base/macros.h"
 #include "dex/primitive.h"
 #include "jni.h"
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 class Class;
 class Object;
@@ -34,19 +35,17 @@
 class ScopedObjectAccessAlreadyRunnable;
 class ShadowFrame;
 
-ObjPtr<mirror::Object> BoxPrimitive(Primitive::Type src_class, const JValue& value)
+EXPORT ObjPtr<mirror::Object> BoxPrimitive(Primitive::Type src_class, const JValue& value)
     REQUIRES_SHARED(Locks::mutator_lock_);
 
-bool UnboxPrimitiveForField(ObjPtr<mirror::Object> o,
-                            ObjPtr<mirror::Class> dst_class,
-                            ArtField* f,
-                            JValue* unboxed_value)
-    REQUIRES_SHARED(Locks::mutator_lock_);
+EXPORT bool UnboxPrimitiveForField(ObjPtr<mirror::Object> o,
+                                   ObjPtr<mirror::Class> dst_class,
+                                   ArtField* f,
+                                   JValue* unboxed_value) REQUIRES_SHARED(Locks::mutator_lock_);
 
-bool UnboxPrimitiveForResult(ObjPtr<mirror::Object> o,
-                             ObjPtr<mirror::Class> dst_class,
-                             JValue* unboxed_value)
-    REQUIRES_SHARED(Locks::mutator_lock_);
+EXPORT bool UnboxPrimitiveForResult(ObjPtr<mirror::Object> o,
+                                    ObjPtr<mirror::Class> dst_class,
+                                    JValue* unboxed_value) REQUIRES_SHARED(Locks::mutator_lock_);
 
 ALWAYS_INLINE bool ConvertPrimitiveValueNoThrow(Primitive::Type src_class,
                                                 Primitive::Type dst_class,
diff --git a/runtime/reflection_test.cc b/runtime/reflection_test.cc
index 4a24d2a..d6b58c0 100644
--- a/runtime/reflection_test.cc
+++ b/runtime/reflection_test.cc
@@ -29,7 +29,7 @@
 #include "nativehelper/scoped_local_ref.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ReflectionTest : public CommonRuntimeTest {
  protected:
diff --git a/runtime/reflective_handle.h b/runtime/reflective_handle.h
index c2dbf53..15abef9 100644
--- a/runtime/reflective_handle.h
+++ b/runtime/reflective_handle.h
@@ -17,10 +17,11 @@
 #ifndef ART_RUNTIME_REFLECTIVE_HANDLE_H_
 #define ART_RUNTIME_REFLECTIVE_HANDLE_H_
 
+#include "base/macros.h"
 #include "base/value_object.h"
 #include "reflective_reference.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // This is a holder similar to Handle<T> that is used to hold reflective references to ArtField and
 // ArtMethod structures. A reflective reference is one that must be updated if the underlying class
diff --git a/runtime/reflective_handle_scope-inl.h b/runtime/reflective_handle_scope-inl.h
index 64ea9f9..2ffa73d 100644
--- a/runtime/reflective_handle_scope-inl.h
+++ b/runtime/reflective_handle_scope-inl.h
@@ -23,7 +23,7 @@
 #include "reflective_handle_scope.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template <size_t kNumFields, size_t kNumMethods>
 StackReflectiveHandleScope<kNumFields, kNumMethods>::StackReflectiveHandleScope(Thread* self) : field_pos_(0), method_pos_(0) {
diff --git a/runtime/reflective_handle_scope.cc b/runtime/reflective_handle_scope.cc
index 2c3ae5e..c340ec3 100644
--- a/runtime/reflective_handle_scope.cc
+++ b/runtime/reflective_handle_scope.cc
@@ -20,7 +20,7 @@
 
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 
 void BaseReflectiveHandleScope::Describe(std::ostream& os) const {
diff --git a/runtime/reflective_handle_scope.h b/runtime/reflective_handle_scope.h
index 46cff8b..1f10521 100644
--- a/runtime/reflective_handle_scope.h
+++ b/runtime/reflective_handle_scope.h
@@ -34,7 +34,7 @@
 #include "reflective_reference.h"
 #include "reflective_value_visitor.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtField;
 class ArtMethod;
diff --git a/runtime/reflective_reference.h b/runtime/reflective_reference.h
index f57c030..ef1ff2e 100644
--- a/runtime/reflective_reference.h
+++ b/runtime/reflective_reference.h
@@ -21,7 +21,7 @@
 #include "base/macros.h"
 #include "mirror/object_reference.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtField;
 class ArtMethod;
diff --git a/runtime/reflective_value_visitor.cc b/runtime/reflective_value_visitor.cc
index 5a288d3..04e1af0 100644
--- a/runtime/reflective_value_visitor.cc
+++ b/runtime/reflective_value_visitor.cc
@@ -22,7 +22,7 @@
 #include "mirror/class.h"
 #include "mirror/object-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 void HeapReflectiveSourceInfo::Describe(std::ostream& os) const {
   Locks::mutator_lock_->AssertExclusiveHeld(Thread::Current());
diff --git a/runtime/reflective_value_visitor.h b/runtime/reflective_value_visitor.h
index 87c5fe7..db8fba6 100644
--- a/runtime/reflective_value_visitor.h
+++ b/runtime/reflective_value_visitor.h
@@ -35,7 +35,7 @@
 #include "mirror/dex_cache.h"
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtField;
 class ArtMethod;
@@ -98,7 +98,7 @@
   kSourceDexCacheResolvedField,
   kSourceMiscInternal,
 };
-std::ostream& operator<<(std::ostream& os, ReflectionSourceType type);
+EXPORT std::ostream& operator<<(std::ostream& os, ReflectionSourceType type);
 
 class ReflectionSourceInfo : public ValueObject {
  public:
@@ -123,7 +123,7 @@
   return os;
 }
 
-class ReflectiveHandleScopeSourceInfo : public ReflectionSourceInfo {
+class EXPORT ReflectiveHandleScopeSourceInfo : public ReflectionSourceInfo {
  public:
   explicit ReflectiveHandleScopeSourceInfo(BaseReflectiveHandleScope* source)
       : ReflectionSourceInfo(kSourceThreadHandleScope), source_(source) {}
diff --git a/runtime/runtime-inl.h b/runtime/runtime-inl.h
index 0daa776..f90dcd1 100644
--- a/runtime/runtime-inl.h
+++ b/runtime/runtime-inl.h
@@ -29,7 +29,7 @@
 #include "obj_ptr-inl.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 
 inline bool Runtime::IsClearedJniWeakGlobal(ObjPtr<mirror::Object> obj) {
   return obj == GetClearedJniWeakGlobal();
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 7eff246..b7587c0 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -16,6 +16,7 @@
 
 #include "runtime.h"
 
+#include <optional>
 #include <utility>
 
 #ifdef __linux__
@@ -41,7 +42,6 @@
 
 #include "android-base/strings.h"
 
-#include "aot_class_linker.h"
 #include "arch/arm/registers_arm.h"
 #include "arch/arm64/registers_arm64.h"
 #include "arch/context.h"
@@ -75,7 +75,6 @@
 #include "debugger.h"
 #include "dex/art_dex_file_loader.h"
 #include "dex/dex_file_loader.h"
-#include "elf_file.h"
 #include "entrypoints/runtime_asm_entrypoints.h"
 #include "entrypoints/entrypoint_utils-inl.h"
 #include "experimental_flags.h"
@@ -89,7 +88,6 @@
 #include "gc/task_processor.h"
 #include "handle_scope-inl.h"
 #include "hidden_api.h"
-#include "image-inl.h"
 #include "indirect_reference_table.h"
 #include "instrumentation.h"
 #include "intern_table-inl.h"
@@ -155,9 +153,12 @@
 #include "native_stack_dump.h"
 #include "nativehelper/scoped_local_ref.h"
 #include "nterp_helpers.h"
-#include "oat.h"
-#include "oat_file_manager.h"
-#include "oat_quick_method_header.h"
+#include "oat/aot_class_linker.h"
+#include "oat/elf_file.h"
+#include "oat/image-inl.h"
+#include "oat/oat.h"
+#include "oat/oat_file_manager.h"
+#include "oat/oat_quick_method_header.h"
 #include "object_callbacks.h"
 #include "odr_statslog/odr_statslog.h"
 #include "parsed_options.h"
@@ -194,7 +195,7 @@
 #include "asm_defines.def"
 #undef ASM_DEFINE
 
-namespace art {
+namespace art HIDDEN {
 
 // If a signal isn't handled properly, enable a handler that attempts to dump the Java stack.
 static constexpr bool kEnableJavaStackTraceHandler = false;
@@ -205,11 +206,17 @@
 static constexpr double kNormalMinLoadFactor = 0.4;
 static constexpr double kNormalMaxLoadFactor = 0.7;
 
+#ifdef ART_PAGE_SIZE_AGNOSTIC
+// Declare the constant as ALWAYS_HIDDEN to ensure it isn't visible from outside libart.so.
+const size_t PageSize::value_ ALWAYS_HIDDEN = GetPageSizeSlow();
+PageSize gPageSize ALWAYS_HIDDEN;
+#endif
+
 Runtime* Runtime::instance_ = nullptr;
 
 struct TraceConfig {
   Trace::TraceMode trace_mode;
-  Trace::TraceOutputMode trace_output_mode;
+  TraceOutputMode trace_output_mode;
   std::string trace_file;
   size_t trace_file_size;
   TraceClockSource clock_source;
@@ -227,7 +234,7 @@
 #else
 // Some POSIX platforms expect you to declare environ. extern "C" makes
 // it reside in the global namespace.
-extern "C" char** environ;
+EXPORT extern "C" char** environ;
 inline char** GetEnviron() { return environ; }
 #endif
 
@@ -249,6 +256,7 @@
       must_relocate_(false),
       is_concurrent_gc_enabled_(true),
       is_explicit_gc_disabled_(false),
+      is_eagerly_release_explicit_gc_disabled_(false),
       image_dex2oat_enabled_(true),
       default_stack_size_(0),
       heap_(nullptr),
@@ -422,6 +430,10 @@
   // Make sure to let the GC complete if it is running.
   heap_->WaitForGcToComplete(gc::kGcCauseBackground, self);
 
+  // Shutdown any trace before SetShuttingDown. Trace uses thread pool workers to flush entries
+  // and we want to make sure they are fully created. Threads cannot attach while shutting down.
+  Trace::Shutdown();
+
   {
     ScopedTrace trace2("Wait for shutdown cond");
     MutexLock mu(self, *Locks::runtime_shutdown_lock_);
@@ -440,9 +452,6 @@
     WellKnownClasses::java_lang_Daemons_stop->InvokeStatic<'V'>(self);
   }
 
-  // Shutdown any trace running.
-  Trace::Shutdown();
-
   // Report death. Clients may require a working thread, still, so do it before GC completes and
   // all non-daemon threads are done.
   {
@@ -526,7 +535,6 @@
   oat_file_manager_ = nullptr;
   Thread::Shutdown();
   QuasiAtomic::Shutdown();
-  verifier::ClassVerifier::Shutdown();
 
   // Destroy allocators before shutting down the MemMap because they may use it.
   java_vm_.reset();
@@ -546,6 +554,12 @@
   // instance. We rely on a small initialization order issue in Runtime::Start() that requires
   // elements of WellKnownClasses to be null, see b/65500943.
   WellKnownClasses::Clear();
+
+#ifdef ART_PAGE_SIZE_AGNOSTIC
+  // This is added to ensure no test is able to access gPageSize prior to initializing Runtime just
+  // because a Runtime instance was created (and subsequently destroyed) by another test.
+  gPageSize.DisallowAccess();
+#endif
 }
 
 struct AbortState {
@@ -644,21 +658,24 @@
   }
 };
 
-void Runtime::Abort(const char* msg) {
+void Runtime::SetAbortMessage(const char* msg) {
   auto old_value = gAborting.fetch_add(1);  // set before taking any locks
 
   // Only set the first abort message.
   if (old_value == 0) {
 #ifdef ART_TARGET_ANDROID
     android_set_abort_message(msg);
-#else
+#endif
     // Set the runtime fault message in case our unexpected-signal code will run.
     Runtime* current = Runtime::Current();
     if (current != nullptr) {
       current->SetFaultMessage(msg);
     }
-#endif
   }
+}
+
+void Runtime::Abort(const char* msg) {
+  SetAbortMessage(msg);
 
   // May be coming from an unattached thread.
   if (Thread::Current() == nullptr) {
@@ -751,12 +768,15 @@
   // break atomicity of the read.
   static constexpr size_t kNumTries = 1000;
   static constexpr size_t kNumThreadsIndex = 20;
+  static constexpr ssize_t BUF_SIZE = 500;
+  static constexpr ssize_t BUF_PRINT_SIZE = 150;  // Only log this much on failure to limit length.
+  static_assert(BUF_SIZE > BUF_PRINT_SIZE);
+  char buf[BUF_SIZE];
+  ssize_t bytes_read = -1;
   for (size_t tries = 0; tries < kNumTries; ++tries) {
-    static constexpr int BUF_SIZE = 500;
-    char buf[BUF_SIZE];
     int stat_fd = open("/proc/self/stat", O_RDONLY | O_CLOEXEC);
     CHECK(stat_fd >= 0) << strerror(errno);
-    ssize_t bytes_read = TEMP_FAILURE_RETRY(read(stat_fd, buf, BUF_SIZE));
+    bytes_read = TEMP_FAILURE_RETRY(read(stat_fd, buf, BUF_SIZE));
     CHECK(bytes_read >= 0) << strerror(errno);
     int ret = close(stat_fd);
     DCHECK(ret == 0) << strerror(errno);
@@ -779,7 +799,9 @@
     }
     usleep(1000);
   }
-  LOG(FATAL) << "Failed to reach single-threaded state";
+  buf[std::min(BUF_PRINT_SIZE, bytes_read)] = '\0';  // Truncate buf before printing.
+  LOG(FATAL) << "Failed to reach single-threaded state: bytes_read = " << bytes_read
+             << " stat contents = \"" << buf << "...\"";
 #else  // Not Linux; shouldn't matter, but this has a high probability of working slowly.
   usleep(20'000);
 #endif
@@ -1058,11 +1080,6 @@
   // recoding profiles. Maybe we should consider changing the name to be more clear it's
   // not only about compiling. b/28295073.
   if (jit_options_->UseJitCompilation() || jit_options_->GetSaveProfilingInfo()) {
-    // Try to load compiler pre zygote to reduce PSS. b/27744947
-    std::string error_msg;
-    if (!jit::Jit::LoadCompilerLibrary(&error_msg)) {
-      LOG(WARNING) << "Failed to load JIT compiler with error " << error_msg;
-    }
     CreateJit();
 #ifdef ADDRESS_SANITIZER
     // (b/238730394): In older implementations of sanitizer + glibc there is a race between
@@ -1245,7 +1262,8 @@
         std::min(static_cast<size_t>(std::thread::hardware_concurrency()), kMaxRuntimeWorkers);
     MutexLock mu(Thread::Current(), *Locks::runtime_thread_pool_lock_);
     CHECK(thread_pool_ == nullptr);
-    thread_pool_.reset(new ThreadPool("Runtime", num_workers, /*create_peers=*/false, kStackSize));
+    thread_pool_.reset(
+        ThreadPool::Create("Runtime", num_workers, /*create_peers=*/false, kStackSize));
     thread_pool_->StartWorkers(Thread::Current());
   }
 
@@ -1347,27 +1365,32 @@
 
 static size_t OpenBootDexFiles(ArrayRef<const std::string> dex_filenames,
                                ArrayRef<const std::string> dex_locations,
-                               ArrayRef<const int> dex_fds,
-                               std::vector<std::unique_ptr<const DexFile>>* dex_files) {
-  DCHECK(dex_files != nullptr) << "OpenDexFiles: out-param is nullptr";
+                               ArrayRef<File> dex_files,
+                               std::vector<std::unique_ptr<const DexFile>>* out_dex_files) {
+  DCHECK(out_dex_files != nullptr) << "OpenDexFiles: out-param is nullptr";
   size_t failure_count = 0;
   for (size_t i = 0; i < dex_filenames.size(); i++) {
     const char* dex_filename = dex_filenames[i].c_str();
     const char* dex_location = dex_locations[i].c_str();
-    const int dex_fd = i < dex_fds.size() ? dex_fds[i] : -1;
+    File noFile;
+    File* file = i < dex_files.size() ? &dex_files[i] : &noFile;
     static constexpr bool kVerifyChecksum = true;
     std::string error_msg;
-    if (!OS::FileExists(dex_filename) && dex_fd < 0) {
+    if (!OS::FileExists(dex_filename) && file->IsValid()) {
       LOG(WARNING) << "Skipping non-existent dex file '" << dex_filename << "'";
       continue;
     }
     bool verify = Runtime::Current()->IsVerificationEnabled();
-    ArtDexFileLoader dex_file_loader(dex_filename, dex_fd, dex_location);
-    if (!dex_file_loader.Open(verify, kVerifyChecksum, &error_msg, dex_files)) {
-      LOG(WARNING) << "Failed to open .dex from file '" << dex_filename << "' / fd " << dex_fd
+    ArtDexFileLoader dex_file_loader(dex_filename, file, dex_location);
+    if (!dex_file_loader.Open(verify, kVerifyChecksum, &error_msg, out_dex_files)) {
+      LOG(WARNING) << "Failed to open .dex from file '" << dex_filename << "' / fd " << file->Fd()
                    << ": " << error_msg;
       ++failure_count;
     }
+    if (file->IsValid()) {
+      bool close_ok = file->Close();
+      DCHECK(close_ok) << dex_filename;
+    }
   }
   return failure_count;
 }
@@ -1471,15 +1494,28 @@
   FlagBase::ReloadAllFlags(caller);
 }
 
+static std::vector<File> FileFdsToFileObjects(std::vector<int>&& fds) {
+  std::vector<File> files;
+  files.reserve(fds.size());
+  for (int fd : fds) {
+    files.push_back(File(fd, /*check_usage=*/false));
+  }
+  return files;
+}
+
 bool Runtime::Init(RuntimeArgumentMap&& runtime_options_in) {
   // (b/30160149): protect subprocesses from modifications to LD_LIBRARY_PATH, etc.
   // Take a snapshot of the environment at the time the runtime was created, for use by Exec, etc.
   env_snapshot_.TakeSnapshot();
 
+#ifdef ART_PAGE_SIZE_AGNOSTIC
+  gPageSize.AllowAccess();
+#endif
+
   using Opt = RuntimeArgumentMap;
   Opt runtime_options(std::move(runtime_options_in));
   ScopedTrace trace(__FUNCTION__);
-  CHECK_EQ(static_cast<size_t>(sysconf(_SC_PAGE_SIZE)), kPageSize);
+  CHECK_EQ(static_cast<size_t>(sysconf(_SC_PAGE_SIZE)), gPageSize);
 
   // Reload all the flags value (from system properties and device configs).
   ReloadAllFlags(__FUNCTION__);
@@ -1509,11 +1545,11 @@
   // Note: Don't request an error message. That will lead to a maps dump in the case of failure,
   //       leading to logspam.
   {
-    constexpr uintptr_t kSentinelAddr =
-        RoundDown(static_cast<uintptr_t>(Context::kBadGprBase), kPageSize);
+    const uintptr_t sentinel_addr =
+        RoundDown(static_cast<uintptr_t>(Context::kBadGprBase), gPageSize);
     protected_fault_page_ = MemMap::MapAnonymous("Sentinel fault page",
-                                                 reinterpret_cast<uint8_t*>(kSentinelAddr),
-                                                 kPageSize,
+                                                 reinterpret_cast<uint8_t*>(sentinel_addr),
+                                                 gPageSize,
                                                  PROT_NONE,
                                                  /*low_4gb=*/ true,
                                                  /*reuse=*/ false,
@@ -1521,7 +1557,7 @@
                                                  /*error_msg=*/ nullptr);
     if (!protected_fault_page_.IsValid()) {
       LOG(WARNING) << "Could not reserve sentinel fault page";
-    } else if (reinterpret_cast<uintptr_t>(protected_fault_page_.Begin()) != kSentinelAddr) {
+    } else if (reinterpret_cast<uintptr_t>(protected_fault_page_.Begin()) != sentinel_addr) {
       LOG(WARNING) << "Could not reserve sentinel fault page at the right address.";
       protected_fault_page_.Reset();
     }
@@ -1551,22 +1587,26 @@
     return false;
   }
 
-  boot_class_path_fds_ = runtime_options.ReleaseOrDefault(Opt::BootClassPathFds);
-  if (!boot_class_path_fds_.empty() && boot_class_path_fds_.size() != boot_class_path_.size()) {
+  boot_class_path_files_ =
+      FileFdsToFileObjects(runtime_options.ReleaseOrDefault(Opt::BootClassPathFds));
+  if (!boot_class_path_files_.empty() && boot_class_path_files_.size() != boot_class_path_.size()) {
     LOG(ERROR) << "Number of FDs specified in -Xbootclasspathfds must match the number of JARs in "
                << "-Xbootclasspath.";
     return false;
   }
 
-  boot_class_path_image_fds_ = runtime_options.ReleaseOrDefault(Opt::BootClassPathImageFds);
-  boot_class_path_vdex_fds_ = runtime_options.ReleaseOrDefault(Opt::BootClassPathVdexFds);
-  boot_class_path_oat_fds_ = runtime_options.ReleaseOrDefault(Opt::BootClassPathOatFds);
-  CHECK(boot_class_path_image_fds_.empty() ||
-        boot_class_path_image_fds_.size() == boot_class_path_.size());
-  CHECK(boot_class_path_vdex_fds_.empty() ||
-        boot_class_path_vdex_fds_.size() == boot_class_path_.size());
-  CHECK(boot_class_path_oat_fds_.empty() ||
-        boot_class_path_oat_fds_.size() == boot_class_path_.size());
+  boot_class_path_image_files_ =
+      FileFdsToFileObjects(runtime_options.ReleaseOrDefault(Opt::BootClassPathImageFds));
+  boot_class_path_vdex_files_ =
+      FileFdsToFileObjects(runtime_options.ReleaseOrDefault(Opt::BootClassPathVdexFds));
+  boot_class_path_oat_files_ =
+      FileFdsToFileObjects(runtime_options.ReleaseOrDefault(Opt::BootClassPathOatFds));
+  CHECK(boot_class_path_image_files_.empty() ||
+        boot_class_path_image_files_.size() == boot_class_path_.size());
+  CHECK(boot_class_path_vdex_files_.empty() ||
+        boot_class_path_vdex_files_.size() == boot_class_path_.size());
+  CHECK(boot_class_path_oat_files_.empty() ||
+        boot_class_path_oat_files_.size() == boot_class_path_.size());
 
   class_path_string_ = runtime_options.ReleaseOrDefault(Opt::ClassPath);
   properties_ = runtime_options.ReleaseOrDefault(Opt::PropertiesList);
@@ -1576,6 +1616,8 @@
   is_zygote_ = runtime_options.Exists(Opt::Zygote);
   is_primary_zygote_ = runtime_options.Exists(Opt::PrimaryZygote);
   is_explicit_gc_disabled_ = runtime_options.Exists(Opt::DisableExplicitGC);
+  is_eagerly_release_explicit_gc_disabled_ =
+      runtime_options.Exists(Opt::DisableEagerlyReleaseExplicitGC);
   image_dex2oat_enabled_ = runtime_options.GetOrDefault(Opt::ImageDex2Oat);
   dump_native_stack_on_sig_quit_ = runtime_options.GetOrDefault(Opt::DumpNativeStackOnSigQuit);
   allow_in_memory_compilation_ = runtime_options.Exists(Opt::AllowInMemoryCompilation);
@@ -1707,10 +1749,10 @@
                        runtime_options.GetOrDefault(Opt::NonMovingSpaceCapacity),
                        GetBootClassPath(),
                        GetBootClassPathLocations(),
-                       GetBootClassPathFds(),
-                       GetBootClassPathImageFds(),
-                       GetBootClassPathVdexFds(),
-                       GetBootClassPathOatFds(),
+                       GetBootClassPathFiles(),
+                       GetBootClassPathImageFiles(),
+                       GetBootClassPathVdexFiles(),
+                       GetBootClassPathOatFiles(),
                        image_locations_,
                        instruction_set_,
                        // Override the collector type to CC if the read barrier config.
@@ -1820,6 +1862,7 @@
       FALLTHROUGH_INTENDED;
     case InstructionSet::kArm:
     case InstructionSet::kThumb2:
+    case InstructionSet::kRiscv64:
     case InstructionSet::kX86:
     case InstructionSet::kX86_64:
       implicit_null_checks_ = true;
@@ -1931,12 +1974,12 @@
       if (runtime_options.Exists(Opt::BootClassPathDexList)) {
         extra_boot_class_path.swap(*runtime_options.GetOrDefault(Opt::BootClassPathDexList));
       } else {
-        ArrayRef<const int> bcp_fds = start < GetBootClassPathFds().size()
-            ? ArrayRef<const int>(GetBootClassPathFds()).SubArray(start)
-            : ArrayRef<const int>();
+        ArrayRef<File> bcp_files = start < GetBootClassPathFiles().size() ?
+                                       ArrayRef<File>(GetBootClassPathFiles()).SubArray(start) :
+                                       ArrayRef<File>();
         OpenBootDexFiles(ArrayRef<const std::string>(GetBootClassPath()).SubArray(start),
                          ArrayRef<const std::string>(GetBootClassPathLocations()).SubArray(start),
-                         bcp_fds,
+                         bcp_files,
                          &extra_boot_class_path);
       }
       class_linker_->AddExtraBootDexFiles(self, std::move(extra_boot_class_path));
@@ -1955,7 +1998,7 @@
     } else {
       OpenBootDexFiles(ArrayRef<const std::string>(GetBootClassPath()),
                        ArrayRef<const std::string>(GetBootClassPathLocations()),
-                       ArrayRef<const int>(GetBootClassPathFds()),
+                       ArrayRef<File>(GetBootClassPathFiles()),
                        &boot_class_path);
     }
     if (!class_linker_->InitWithoutImage(std::move(boot_class_path), &error_msg)) {
@@ -1982,16 +2025,14 @@
 
   CHECK(class_linker_ != nullptr);
 
-  verifier::ClassVerifier::Init(class_linker_);
-
   if (runtime_options.Exists(Opt::MethodTrace)) {
     trace_config_.reset(new TraceConfig());
     trace_config_->trace_file = runtime_options.ReleaseOrDefault(Opt::MethodTraceFile);
     trace_config_->trace_file_size = runtime_options.ReleaseOrDefault(Opt::MethodTraceFileSize);
     trace_config_->trace_mode = Trace::TraceMode::kMethodTracing;
     trace_config_->trace_output_mode = runtime_options.Exists(Opt::MethodTraceStreaming) ?
-        Trace::TraceOutputMode::kStreaming :
-        Trace::TraceOutputMode::kFile;
+                                           TraceOutputMode::kStreaming :
+                                           TraceOutputMode::kFile;
     trace_config_->clock_source = runtime_options.GetOrDefault(Opt::MethodTraceClock);
   }
 
@@ -2340,7 +2381,7 @@
   register_dalvik_system_DexFile(env);
   register_dalvik_system_BaseDexClassLoader(env);
   register_dalvik_system_VMDebug(env);
-  register_dalvik_system_VMRuntime(env);
+  real_register_dalvik_system_VMRuntime(env);
   register_dalvik_system_VMStack(env);
   register_dalvik_system_ZygoteHooks(env);
   register_java_lang_Class(env);
@@ -2389,6 +2430,10 @@
   }
 }
 
+std::optional<uint64_t> Runtime::SiqQuitNanoTime() const {
+  return signal_catcher_ != nullptr ? signal_catcher_->SiqQuitNanoTime() : std::nullopt;
+}
+
 void Runtime::DumpForSigQuit(std::ostream& os) {
   // Print backtraces first since they are important do diagnose ANRs,
   // and ANRs can often be trimmed to limit upload size.
@@ -2590,7 +2635,7 @@
   jni_id_manager_->VisitRoots(visitor);
   heap_->VisitAllocationRecords(visitor);
   if (jit_ != nullptr) {
-    jit_->GetCodeCache()->VisitRoots(visitor);
+    jit_->VisitRoots(visitor);
   }
   if ((flags & kVisitRootFlagNewRoots) == 0) {
     // Guaranteed to have no new roots in the constant roots.
@@ -2615,7 +2660,6 @@
       .VisitRootIfNonNull(visitor, RootInfo(kRootVMInternal));
   pre_allocated_NoClassDefFoundError_.VisitRootIfNonNull(visitor, RootInfo(kRootVMInternal));
   VisitImageRoots(visitor);
-  verifier::ClassVerifier::VisitStaticRoots(visitor);
   VisitTransactionRoots(visitor);
 }
 
@@ -2847,21 +2891,22 @@
   bool has_code = false;
   for (const std::string& path : code_paths) {
     std::string error_msg;
-    std::vector<uint32_t> checksums;
+    std::optional<uint32_t> checksum;
     std::vector<std::string> dex_locations;
-    if (!ArtDexFileLoader::GetMultiDexChecksums(
-            path.c_str(), &checksums, &dex_locations, &error_msg)) {
+    DexFileLoader loader(path);
+    if (!loader.GetMultiDexChecksum(&checksum, &error_msg)) {
       LOG(WARNING) << error_msg;
       continue;
     }
-    if (dex_locations.size() > 0) {
+    if (checksum.has_value()) {
       has_code = true;
       break;
     }
   }
   if (!has_code) {
-    VLOG(profiler) << "JIT profile information will not be recorded: no dex code in '" +
-                          android::base::Join(code_paths, ',') + "'.";
+    VLOG(profiler) << ART_FORMAT(
+        "JIT profile information will not be recorded: no dex code in '{}'.",
+        android::base::Join(code_paths, ','));
     return;
   }
 
@@ -3094,7 +3139,7 @@
 void Runtime::AddCurrentRuntimeFeaturesAsDex2OatArguments(std::vector<std::string>* argv)
     const {
   if (GetInstrumentation()->InterpretOnly()) {
-    argv->push_back("--compiler-filter=quicken");
+    argv->push_back("--compiler-filter=verify");
   }
 
   // Make the dex2oat instruction set match that of the launching runtime. If we have multiple
@@ -3142,15 +3187,8 @@
     return;
   }
 
-  jit::Jit* jit = jit::Jit::Create(jit_code_cache_.get(), jit_options_.get());
-  jit_.reset(jit);
-  if (jit == nullptr) {
-    LOG(WARNING) << "Failed to allocate JIT";
-    // Release JIT code cache resources (several MB of memory).
-    jit_code_cache_.reset();
-  } else {
-    jit->CreateThreadPool();
-  }
+  jit_ = jit::Jit::Create(jit_code_cache_.get(), jit_options_.get());
+  jit_->CreateThreadPool();
 }
 
 bool Runtime::CanRelocate() const {
@@ -3333,10 +3371,12 @@
   return callbacks_.get();
 }
 
-// Used to patch boot image method entry point to interpreter bridge.
-class UpdateEntryPointsClassVisitor : public ClassVisitor {
+// Used to update boot image to not use AOT code. This is used when transitioning the runtime to
+// java debuggable. This visitor re-initializes the entry points without using AOT code. This also
+// disables shared hotness counters so the necessary methods can be JITed more efficiently.
+class DeoptimizeBootImageClassVisitor : public ClassVisitor {
  public:
-  explicit UpdateEntryPointsClassVisitor(instrumentation::Instrumentation* instrumentation)
+  explicit DeoptimizeBootImageClassVisitor(instrumentation::Instrumentation* instrumentation)
       : instrumentation_(instrumentation) {}
 
   bool operator()(ObjPtr<mirror::Class> klass) override REQUIRES(Locks::mutator_lock_) {
@@ -3370,6 +3410,9 @@
         m.ClearPreCompiled();
         instrumentation_->InitializeMethodsCode(&m, /*aot_code=*/ nullptr);
       }
+
+      // Clear MemorySharedAccessFlags so the boot class methods can be JITed better.
+      m.ClearMemorySharedMethod();
     }
     return true;
   }
@@ -3390,7 +3433,7 @@
   // If we've already started and we are setting this runtime to debuggable,
   // we patch entry points of methods in boot image to interpreter bridge, as
   // boot image code may be AOT compiled as not debuggable.
-  UpdateEntryPointsClassVisitor visitor(GetInstrumentation());
+  DeoptimizeBootImageClassVisitor visitor(GetInstrumentation());
   GetClassLinker()->VisitClasses(&visitor);
   jit::Jit* jit = GetJit();
   if (jit != nullptr) {
@@ -3499,8 +3542,8 @@
                                   const uint8_t* map_begin,
                                   const uint8_t* map_end,
                                   const std::string& file_name) {
-  map_begin = AlignDown(map_begin, kPageSize);
-  map_size_bytes = RoundUp(map_size_bytes, kPageSize);
+  map_begin = AlignDown(map_begin, gPageSize);
+  map_size_bytes = RoundUp(map_size_bytes, gPageSize);
 #ifdef ART_TARGET_ANDROID
   // Short-circuit the madvise optimization for background processes. This
   // avoids IO and memory contention with foreground processes, particularly
@@ -3572,10 +3615,10 @@
 }
 
 void Runtime::AppendToBootClassPath(const std::string& filename, const std::string& location) {
-  DCHECK(!DexFileLoader::IsMultiDexLocation(filename.c_str()));
+  DCHECK(!DexFileLoader::IsMultiDexLocation(filename));
   boot_class_path_.push_back(filename);
   if (!boot_class_path_locations_.empty()) {
-    DCHECK(!DexFileLoader::IsMultiDexLocation(location.c_str()));
+    DCHECK(!DexFileLoader::IsMultiDexLocation(location));
     boot_class_path_locations_.push_back(location);
   }
 }
@@ -3588,7 +3631,7 @@
   ScopedObjectAccess soa(Thread::Current());
   for (const std::unique_ptr<const art::DexFile>& dex_file : dex_files) {
     // The first element must not be at a multi-dex location, while other elements must be.
-    DCHECK_NE(DexFileLoader::IsMultiDexLocation(dex_file->GetLocation().c_str()),
+    DCHECK_NE(DexFileLoader::IsMultiDexLocation(dex_file->GetLocation()),
               dex_file.get() == dex_files.begin()->get());
     GetClassLinker()->AppendToBootClassPath(Thread::Current(), dex_file.get());
   }
@@ -3601,7 +3644,7 @@
   ScopedObjectAccess soa(Thread::Current());
   for (const art::DexFile* dex_file : dex_files) {
     // The first element must not be at a multi-dex location, while other elements must be.
-    DCHECK_NE(DexFileLoader::IsMultiDexLocation(dex_file->GetLocation().c_str()),
+    DCHECK_NE(DexFileLoader::IsMultiDexLocation(dex_file->GetLocation()),
               dex_file == *dex_files.begin());
     GetClassLinker()->AppendToBootClassPath(Thread::Current(), dex_file);
   }
@@ -3616,7 +3659,7 @@
   ScopedObjectAccess soa(Thread::Current());
   for (const auto& [dex_file, dex_cache] : dex_files_and_cache) {
     // The first element must not be at a multi-dex location, while other elements must be.
-    DCHECK_NE(DexFileLoader::IsMultiDexLocation(dex_file->GetLocation().c_str()),
+    DCHECK_NE(DexFileLoader::IsMultiDexLocation(dex_file->GetLocation()),
               dex_file == dex_files_and_cache.begin()->first);
     GetClassLinker()->AppendToBootClassPath(dex_file, dex_cache);
   }
@@ -3630,7 +3673,7 @@
   if (kIsDebugBuild) {
     for (const std::unique_ptr<const art::DexFile>& dex_file : dex_files) {
       // The first element must not be at a multi-dex location, while other elements must be.
-      DCHECK_NE(DexFileLoader::IsMultiDexLocation(dex_file->GetLocation().c_str()),
+      DCHECK_NE(DexFileLoader::IsMultiDexLocation(dex_file->GetLocation()),
                 dex_file.get() == dex_files.begin()->get());
     }
   }
diff --git a/runtime/runtime.h b/runtime/runtime.h
index fc8c050..1a1c28b 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -23,6 +23,7 @@
 #include <forward_list>
 #include <iosfwd>
 #include <memory>
+#include <optional>
 #include <set>
 #include <string>
 #include <utility>
@@ -33,7 +34,9 @@
 #include "base/macros.h"
 #include "base/mem_map.h"
 #include "base/metrics/metrics.h"
+#include "base/os.h"
 #include "base/string_view_cpp20.h"
+#include "base/unix_file/fd_file.h"
 #include "compat_framework.h"
 #include "deoptimization_kind.h"
 #include "dex/dex_file_types.h"
@@ -51,7 +54,7 @@
 #include "reflective_value_visitor.h"
 #include "runtime_stats.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace gc {
 class AbstractSystemWeakHolder;
@@ -124,16 +127,16 @@
 class Runtime {
  public:
   // Parse raw runtime options.
-  static bool ParseOptions(const RuntimeOptions& raw_options,
-                           bool ignore_unrecognized,
-                           RuntimeArgumentMap* runtime_options);
+  EXPORT static bool ParseOptions(const RuntimeOptions& raw_options,
+                                  bool ignore_unrecognized,
+                                  RuntimeArgumentMap* runtime_options);
 
   // Creates and initializes a new runtime.
-  static bool Create(RuntimeArgumentMap&& runtime_options)
+  EXPORT static bool Create(RuntimeArgumentMap&& runtime_options)
       SHARED_TRYLOCK_FUNCTION(true, Locks::mutator_lock_);
 
   // Creates and initializes a new runtime.
-  static bool Create(const RuntimeOptions& raw_options, bool ignore_unrecognized)
+  EXPORT static bool Create(const RuntimeOptions& raw_options, bool ignore_unrecognized)
       SHARED_TRYLOCK_FUNCTION(true, Locks::mutator_lock_);
 
   enum class RuntimeDebugState {
@@ -217,6 +220,10 @@
     return is_explicit_gc_disabled_;
   }
 
+  bool IsEagerlyReleaseExplicitGcDisabled() const {
+    return is_eagerly_release_explicit_gc_disabled_;
+  }
+
   std::string GetCompilerExecutable() const;
 
   const std::vector<std::string>& GetCompilerOptions() const {
@@ -238,7 +245,7 @@
   // Starts a runtime, which may cause threads to be started and code to run.
   bool Start() UNLOCK_FUNCTION(Locks::mutator_lock_);
 
-  bool IsShuttingDown(Thread* self);
+  EXPORT bool IsShuttingDown(Thread* self);
   bool IsShuttingDownLocked() const REQUIRES(Locks::runtime_shutdown_lock_) {
     return shutting_down_.load(std::memory_order_relaxed);
   }
@@ -257,7 +264,7 @@
     threads_being_born_++;
   }
 
-  void EndThreadBirth() REQUIRES(Locks::runtime_shutdown_lock_);
+  EXPORT void EndThreadBirth() REQUIRES(Locks::runtime_shutdown_lock_);
 
   bool IsStarted() const {
     return started_;
@@ -267,7 +274,7 @@
     return finished_starting_;
   }
 
-  void RunRootClinits(Thread* self) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void RunRootClinits(Thread* self) REQUIRES_SHARED(Locks::mutator_lock_);
 
   static Runtime* Current() {
     return instance_;
@@ -280,36 +287,43 @@
   // For test use only.
   static void TestOnlySetCurrent(Runtime* instance) { instance_ = instance; }
 
+  // Set whichever abort message locations are appropriate to copies of the argument. Used by
+  // Abort() and Thread::AbortInThis().
+  static void SetAbortMessage(const char* msg) REQUIRES(!Locks::abort_lock_);
+
   // Aborts semi-cleanly. Used in the implementation of LOG(FATAL), which most
   // callers should prefer.
-  NO_RETURN static void Abort(const char* msg) REQUIRES(!Locks::abort_lock_);
+  NO_RETURN EXPORT static void Abort(const char* msg) REQUIRES(!Locks::abort_lock_);
 
   // Returns the "main" ThreadGroup, used when attaching user threads.
   jobject GetMainThreadGroup() const;
 
   // Returns the "system" ThreadGroup, used when attaching our internal threads.
-  jobject GetSystemThreadGroup() const;
+  EXPORT jobject GetSystemThreadGroup() const;
 
   // Returns the system ClassLoader which represents the CLASSPATH.
-  jobject GetSystemClassLoader() const;
+  EXPORT jobject GetSystemClassLoader() const;
 
   // Attaches the calling native thread to the runtime.
-  bool AttachCurrentThread(const char* thread_name,
-                           bool as_daemon,
-                           jobject thread_group,
-                           bool create_peer,
-                           bool should_run_callbacks = true);
+  EXPORT bool AttachCurrentThread(const char* thread_name,
+                                  bool as_daemon,
+                                  jobject thread_group,
+                                  bool create_peer,
+                                  bool should_run_callbacks = true);
 
-  void CallExitHook(jint status);
+  EXPORT void CallExitHook(jint status);
 
   // Detaches the current native thread from the runtime.
   void DetachCurrentThread(bool should_run_callbacks = true) REQUIRES(!Locks::mutator_lock_);
 
+  // If we are handling SIQQUIT return the time when we received it.
+  std::optional<uint64_t> SiqQuitNanoTime() const;
+
   void DumpDeoptimizations(std::ostream& os);
   void DumpForSigQuit(std::ostream& os);
   void DumpLockHolders(std::ostream& os);
 
-  ~Runtime();
+  EXPORT ~Runtime();
 
   const std::vector<std::string>& GetBootClassPath() const {
     return boot_class_path_;
@@ -322,42 +336,37 @@
   }
 
   // Dynamically adds an element to boot class path.
-  void AppendToBootClassPath(const std::string& filename,
-                             const std::string& location,
-                             const std::vector<std::unique_ptr<const art::DexFile>>& dex_files);
+  EXPORT void AppendToBootClassPath(
+      const std::string& filename,
+      const std::string& location,
+      const std::vector<std::unique_ptr<const art::DexFile>>& dex_files);
 
   // Same as above, but takes raw pointers.
-  void AppendToBootClassPath(const std::string& filename,
-                             const std::string& location,
-                             const std::vector<const art::DexFile*>& dex_files);
+  EXPORT void AppendToBootClassPath(const std::string& filename,
+                                    const std::string& location,
+                                    const std::vector<const art::DexFile*>& dex_files);
 
   // Same as above, but also takes a dex cache for each dex file.
-  void AppendToBootClassPath(
+  EXPORT void AppendToBootClassPath(
       const std::string& filename,
       const std::string& location,
       const std::vector<std::pair<const art::DexFile*, ObjPtr<mirror::DexCache>>>&
           dex_files_and_cache);
 
   // Dynamically adds an element to boot class path and takes ownership of the dex files.
-  void AddExtraBootDexFiles(const std::string& filename,
-                            const std::string& location,
-                            std::vector<std::unique_ptr<const art::DexFile>>&& dex_files);
+  EXPORT void AddExtraBootDexFiles(const std::string& filename,
+                                   const std::string& location,
+                                   std::vector<std::unique_ptr<const art::DexFile>>&& dex_files);
 
-  const std::vector<int>& GetBootClassPathFds() const {
-    return boot_class_path_fds_;
+  ArrayRef<File> GetBootClassPathFiles() { return ArrayRef<File>(boot_class_path_files_); }
+
+  ArrayRef<File> GetBootClassPathImageFiles() {
+    return ArrayRef<File>(boot_class_path_image_files_);
   }
 
-  const std::vector<int>& GetBootClassPathImageFds() const {
-    return boot_class_path_image_fds_;
-  }
+  ArrayRef<File> GetBootClassPathVdexFiles() { return ArrayRef<File>(boot_class_path_vdex_files_); }
 
-  const std::vector<int>& GetBootClassPathVdexFds() const {
-    return boot_class_path_vdex_fds_;
-  }
-
-  const std::vector<int>& GetBootClassPathOatFds() const {
-    return boot_class_path_oat_fds_;
-  }
+  ArrayRef<File> GetBootClassPathOatFiles() { return ArrayRef<File>(boot_class_path_oat_files_); }
 
   // Returns the checksums for the boot image, extensions and extra boot class path dex files,
   // based on the image spaces and boot class path dex files loaded in memory.
@@ -420,14 +429,14 @@
   // Get the special object used to mark a cleared JNI weak global.
   mirror::Object* GetClearedJniWeakGlobal() REQUIRES_SHARED(Locks::mutator_lock_);
 
-  mirror::Throwable* GetPreAllocatedOutOfMemoryErrorWhenThrowingException()
+  EXPORT mirror::Throwable* GetPreAllocatedOutOfMemoryErrorWhenThrowingException()
       REQUIRES_SHARED(Locks::mutator_lock_);
-  mirror::Throwable* GetPreAllocatedOutOfMemoryErrorWhenThrowingOOME()
+  EXPORT mirror::Throwable* GetPreAllocatedOutOfMemoryErrorWhenThrowingOOME()
       REQUIRES_SHARED(Locks::mutator_lock_);
-  mirror::Throwable* GetPreAllocatedOutOfMemoryErrorWhenHandlingStackOverflow()
+  EXPORT mirror::Throwable* GetPreAllocatedOutOfMemoryErrorWhenHandlingStackOverflow()
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  mirror::Throwable* GetPreAllocatedNoClassDefFoundError()
+  EXPORT mirror::Throwable* GetPreAllocatedNoClassDefFoundError()
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   const std::vector<std::string>& GetProperties() const {
@@ -455,13 +464,13 @@
 
   // Visit all the roots. If only_dirty is true then non-dirty roots won't be visited. If
   // clean_dirty is true then dirty roots will be marked as non-dirty after visiting.
-  void VisitRoots(RootVisitor* visitor, VisitRootFlags flags = kVisitRootFlagAllRoots)
+  EXPORT void VisitRoots(RootVisitor* visitor, VisitRootFlags flags = kVisitRootFlagAllRoots)
       REQUIRES(!Locks::classlinker_classes_lock_, !Locks::trace_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Visit image roots, only used for hprof since the GC uses the image space mod union table
   // instead.
-  void VisitImageRoots(RootVisitor* visitor) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void VisitImageRoots(RootVisitor* visitor) REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Visit all of the roots we can safely visit concurrently.
   void VisitConcurrentRoots(RootVisitor* visitor,
@@ -478,11 +487,12 @@
 
   // Sweep system weaks, the system weak is deleted if the visitor return null. Otherwise, the
   // system weak is updated to be the visitor's returned value.
-  void SweepSystemWeaks(IsMarkedVisitor* visitor) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void SweepSystemWeaks(IsMarkedVisitor* visitor) REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Walk all reflective objects and visit their targets as well as any method/fields held by the
   // runtime threads that are marked as being reflective.
-  void VisitReflectiveTargets(ReflectiveValueVisitor* visitor) REQUIRES(Locks::mutator_lock_);
+  EXPORT void VisitReflectiveTargets(ReflectiveValueVisitor* visitor)
+      REQUIRES(Locks::mutator_lock_);
   // Helper for visiting reflective targets with lambdas for both field and method reflective
   // targets.
   template <typename FieldVis, typename MethodVis>
@@ -553,13 +563,13 @@
     return instruction_set_;
   }
 
-  void SetInstructionSet(InstructionSet instruction_set);
+  EXPORT void SetInstructionSet(InstructionSet instruction_set);
   void ClearInstructionSet();
 
-  void SetCalleeSaveMethod(ArtMethod* method, CalleeSaveType type);
+  EXPORT void SetCalleeSaveMethod(ArtMethod* method, CalleeSaveType type);
   void ClearCalleeSaveMethods();
 
-  ArtMethod* CreateCalleeSaveMethod() REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT ArtMethod* CreateCalleeSaveMethod() REQUIRES_SHARED(Locks::mutator_lock_);
 
   uint64_t GetStat(int kind);
 
@@ -590,7 +600,7 @@
   }
 
   // Returns true if JIT compilations are enabled. GetJit() will be not null in this case.
-  bool UseJitCompilation() const;
+  EXPORT bool UseJitCompilation() const;
 
   void PreZygoteFork();
   void PostZygoteFork();
@@ -617,11 +627,12 @@
                        int32_t code_type);
 
   // Transaction support.
-  bool IsActiveTransaction() const;
+  EXPORT bool IsActiveTransaction() const;
   // EnterTransactionMode may suspend.
-  void EnterTransactionMode(bool strict, mirror::Class* root) REQUIRES_SHARED(Locks::mutator_lock_);
-  void ExitTransactionMode();
-  void RollbackAllTransactions() REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void EnterTransactionMode(bool strict, mirror::Class* root)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void ExitTransactionMode();
+  EXPORT void RollbackAllTransactions() REQUIRES_SHARED(Locks::mutator_lock_);
   // Transaction rollback and exit transaction are always done together, it's convenience to
   // do them in one function.
   void RollbackAndExitTransactionMode() REQUIRES_SHARED(Locks::mutator_lock_);
@@ -651,20 +662,19 @@
                              MemberOffset field_offset,
                              int16_t value,
                              bool is_volatile);
-  void RecordWriteField32(mirror::Object* obj,
-                          MemberOffset field_offset,
-                          uint32_t value,
-                          bool is_volatile);
+  EXPORT void RecordWriteField32(mirror::Object* obj,
+                                 MemberOffset field_offset,
+                                 uint32_t value,
+                                 bool is_volatile);
   void RecordWriteField64(mirror::Object* obj,
                           MemberOffset field_offset,
                           uint64_t value,
                           bool is_volatile);
-  void RecordWriteFieldReference(mirror::Object* obj,
-                                 MemberOffset field_offset,
-                                 ObjPtr<mirror::Object> value,
-                                 bool is_volatile)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-  void RecordWriteArray(mirror::Array* array, size_t index, uint64_t value)
+  EXPORT void RecordWriteFieldReference(mirror::Object* obj,
+                                        MemberOffset field_offset,
+                                        ObjPtr<mirror::Object> value,
+                                        bool is_volatile) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void RecordWriteArray(mirror::Array* array, size_t index, uint64_t value)
       REQUIRES_SHARED(Locks::mutator_lock_);
   void RecordStrongStringInsertion(ObjPtr<mirror::String> s)
       REQUIRES(Locks::intern_table_lock_);
@@ -697,7 +707,7 @@
 
   void DisableVerifier();
   bool IsVerificationEnabled() const;
-  bool IsVerificationSoftFail() const;
+  EXPORT bool IsVerificationSoftFail() const;
 
   void SetHiddenApiEnforcementPolicy(hiddenapi::EnforcementPolicy policy) {
     hidden_api_policy_ = policy;
@@ -817,7 +827,7 @@
     return jit_arena_pool_.get();
   }
 
-  void ReclaimArenaPoolMemory();
+  EXPORT void ReclaimArenaPoolMemory();
 
   LinearAlloc* GetLinearAlloc() {
     return linear_alloc_.get();
@@ -856,10 +866,10 @@
     return is_profileable_;
   }
 
-  void SetRuntimeDebugState(RuntimeDebugState state);
+  EXPORT void SetRuntimeDebugState(RuntimeDebugState state);
 
   // Deoptimize the boot image, called for Java debuggable apps.
-  void DeoptimizeBootImage() REQUIRES(Locks::mutator_lock_);
+  EXPORT void DeoptimizeBootImage() REQUIRES(Locks::mutator_lock_);
 
   bool IsNativeDebuggable() const {
     return is_native_debuggable_;
@@ -896,8 +906,7 @@
   void SetSentinel(ObjPtr<mirror::Object> sentinel) REQUIRES_SHARED(Locks::mutator_lock_);
   // For testing purpose only.
   // TODO: Remove this when this is no longer needed (b/116087961).
-  GcRoot<mirror::Object> GetSentinel() REQUIRES_SHARED(Locks::mutator_lock_);
-
+  EXPORT GcRoot<mirror::Object> GetSentinel() REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Use a sentinel for marking entries in a table that have been cleared.
   // This helps diagnosing in case code tries to wrongly access such
@@ -907,7 +916,7 @@
   }
 
   // Create a normal LinearAlloc or low 4gb version if we are 64 bit AOT compiler.
-  LinearAlloc* CreateLinearAlloc();
+  EXPORT LinearAlloc* CreateLinearAlloc();
   // Setup linear-alloc allocators to stop using the current arena so that the
   // next allocations, which would be after zygote fork, happens in userfaultfd
   // visited space.
@@ -934,7 +943,7 @@
     return dump_native_stack_on_sig_quit_;
   }
 
-  void UpdateProcessState(ProcessState process_state);
+  EXPORT void UpdateProcessState(ProcessState process_state);
 
   // Returns true if we currently care about long mutator pause.
   bool InJankPerceptibleProcessState() const {
@@ -953,7 +962,7 @@
 
   // Returns if the code can be deoptimized asynchronously. Code may be compiled with some
   // optimization that makes it impossible to deoptimize.
-  bool IsAsyncDeoptimizeable(ArtMethod* method, uintptr_t code) const
+  EXPORT bool IsAsyncDeoptimizeable(ArtMethod* method, uintptr_t code) const
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Returns a saved copy of the environment (getenv/setenv values).
@@ -962,16 +971,16 @@
     return env_snapshot_.GetSnapshot();
   }
 
-  void AddSystemWeakHolder(gc::AbstractSystemWeakHolder* holder);
-  void RemoveSystemWeakHolder(gc::AbstractSystemWeakHolder* holder);
+  EXPORT void AddSystemWeakHolder(gc::AbstractSystemWeakHolder* holder);
+  EXPORT void RemoveSystemWeakHolder(gc::AbstractSystemWeakHolder* holder);
 
-  void AttachAgent(JNIEnv* env, const std::string& agent_arg, jobject class_loader);
+  EXPORT void AttachAgent(JNIEnv* env, const std::string& agent_arg, jobject class_loader);
 
   const std::list<std::unique_ptr<ti::Agent>>& GetAgents() const {
     return agents_;
   }
 
-  RuntimeCallbacks* GetRuntimeCallbacks();
+  EXPORT RuntimeCallbacks* GetRuntimeCallbacks();
 
   bool HasLoadedPlugins() const {
     return !plugins_.empty();
@@ -1034,7 +1043,7 @@
 
   // Changes the JniIdType to the given type. Only allowed if CanSetJniIdType(). All threads must be
   // suspended to call this function.
-  void SetJniIdType(JniIdType t);
+  EXPORT void SetJniIdType(JniIdType t);
 
   uint32_t GetVerifierLoggingThresholdMs() const {
     return verifier_logging_threshold_ms_;
@@ -1076,7 +1085,7 @@
 
   // Reset the startup completed status so that we can call NotifyStartupCompleted again. Should
   // only be used for testing.
-  void ResetStartupCompleted();
+  EXPORT void ResetStartupCompleted();
 
   // Notify the runtime that application startup is considered completed. Only has effect for the
   // first call. Returns whether this was the first call.
@@ -1087,7 +1096,7 @@
   void NotifyDexFileLoaded();
 
   // Return true if startup is already completed.
-  bool GetStartupCompleted() const;
+  EXPORT bool GetStartupCompleted() const;
 
   bool IsVerifierMissingKThrowFatal() const {
     return verifier_missing_kthrow_fatal_;
@@ -1225,8 +1234,10 @@
 
   void AppendToBootClassPath(const std::string& filename, const std::string& location);
 
+  // Don't use EXPORT ("default" visibility), because quick_entrypoints_x86.o
+  // refers to this symbol and it can't link with R_386_PC32 relocation.
   // A pointer to the active runtime or null.
-  static Runtime* instance_;
+  LIBART_PROTECTED static Runtime* instance_;
 
   // NOTE: these must match the gc::ProcessState values as they come directly from the framework.
   static constexpr int kProfileForground = 0;
@@ -1260,6 +1271,7 @@
   bool must_relocate_;
   bool is_concurrent_gc_enabled_;
   bool is_explicit_gc_disabled_;
+  bool is_eagerly_release_explicit_gc_disabled_;
   bool image_dex2oat_enabled_;
 
   std::string compiler_executable_;
@@ -1270,10 +1282,10 @@
   std::vector<std::string> boot_class_path_;
   std::vector<std::string> boot_class_path_locations_;
   std::string boot_class_path_checksums_;
-  std::vector<int> boot_class_path_fds_;
-  std::vector<int> boot_class_path_image_fds_;
-  std::vector<int> boot_class_path_vdex_fds_;
-  std::vector<int> boot_class_path_oat_fds_;
+  std::vector<File> boot_class_path_files_;
+  std::vector<File> boot_class_path_image_files_;
+  std::vector<File> boot_class_path_vdex_files_;
+  std::vector<File> boot_class_path_oat_files_;
   std::string class_path_string_;
   std::vector<std::string> properties_;
 
diff --git a/runtime/runtime_android.cc b/runtime/runtime_android.cc
index 55ba293..043a833 100644
--- a/runtime/runtime_android.cc
+++ b/runtime/runtime_android.cc
@@ -22,7 +22,7 @@
 
 #include "runtime_common.h"
 
-namespace art {
+namespace art HIDDEN {
 
 struct sigaction old_action;
 
diff --git a/runtime/runtime_callbacks.cc b/runtime/runtime_callbacks.cc
index 28c81a2..aad9430 100644
--- a/runtime/runtime_callbacks.cc
+++ b/runtime/runtime_callbacks.cc
@@ -25,7 +25,7 @@
 #include "monitor.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 RuntimeCallbacks::RuntimeCallbacks()
     : callback_lock_(new ReaderWriterMutex("Runtime callbacks lock",
diff --git a/runtime/runtime_callbacks.h b/runtime/runtime_callbacks.h
index 98584a8..9d7e199 100644
--- a/runtime/runtime_callbacks.h
+++ b/runtime/runtime_callbacks.h
@@ -24,7 +24,7 @@
 #include "base/macros.h"
 #include "handle.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace dex {
 struct ClassDef;
@@ -158,7 +158,7 @@
       REQUIRES(Locks::mutator_lock_) = 0;
 };
 
-class RuntimeCallbacks {
+class EXPORT RuntimeCallbacks {
  public:
   RuntimeCallbacks();
 
diff --git a/runtime/runtime_callbacks_test.cc b/runtime/runtime_callbacks_test.cc
index 6f0b8a1..719cae5 100644
--- a/runtime/runtime_callbacks_test.cc
+++ b/runtime/runtime_callbacks_test.cc
@@ -46,7 +46,7 @@
 #include "thread_list.h"
 #include "well_known_classes-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class RuntimeCallbacksTest : public CommonRuntimeTest {
  protected:
@@ -88,7 +88,7 @@
 
 class ThreadLifecycleCallbackRuntimeCallbacksTest : public RuntimeCallbacksTest {
  public:
-  static void* PthreadsCallback(void* arg ATTRIBUTE_UNUSED) {
+  static void* PthreadsCallback([[maybe_unused]] void* arg) {
     // Attach.
     Runtime* runtime = Runtime::Current();
     CHECK(runtime->AttachCurrentThread("ThreadLifecycle test thread", true, nullptr, false));
@@ -199,7 +199,7 @@
 TEST_F(ThreadLifecycleCallbackRuntimeCallbacksTest, ThreadLifecycleCallbackAttach) {
   std::string error_msg;
   MemMap stack = MemMap::MapAnonymous("ThreadLifecycleCallback Thread",
-                                      128 * kPageSize,  // Just some small stack.
+                                      128 * gPageSize,  // Just some small stack.
                                       PROT_READ | PROT_WRITE,
                                       /*low_4gb=*/ false,
                                       &error_msg);
@@ -260,12 +260,12 @@
 
   struct Callback : public ClassLoadCallback {
     void ClassPreDefine(const char* descriptor,
-                        Handle<mirror::Class> klass ATTRIBUTE_UNUSED,
-                        Handle<mirror::ClassLoader> class_loader ATTRIBUTE_UNUSED,
+                        [[maybe_unused]] Handle<mirror::Class> klass,
+                        [[maybe_unused]] Handle<mirror::ClassLoader> class_loader,
                         const DexFile& initial_dex_file,
-                        const dex::ClassDef& initial_class_def ATTRIBUTE_UNUSED,
-                        /*out*/DexFile const** final_dex_file ATTRIBUTE_UNUSED,
-                        /*out*/dex::ClassDef const** final_class_def ATTRIBUTE_UNUSED) override
+                        [[maybe_unused]] const dex::ClassDef& initial_class_def,
+                        [[maybe_unused]] /*out*/ DexFile const** final_dex_file,
+                        [[maybe_unused]] /*out*/ dex::ClassDef const** final_class_def) override
         REQUIRES_SHARED(Locks::mutator_lock_) {
       const std::string& location = initial_dex_file.GetLocation();
       std::string event =
@@ -468,20 +468,20 @@
       ref_ = { &k->GetDexFile(), k->GetDexClassDefIndex() };
     }
 
-    void MonitorContendedLocking(Monitor* mon ATTRIBUTE_UNUSED) override
-        REQUIRES_SHARED(Locks::mutator_lock_) { }
+    void MonitorContendedLocking([[maybe_unused]] Monitor* mon) override
+        REQUIRES_SHARED(Locks::mutator_lock_) {}
 
-    void MonitorContendedLocked(Monitor* mon ATTRIBUTE_UNUSED) override
-        REQUIRES_SHARED(Locks::mutator_lock_) { }
+    void MonitorContendedLocked([[maybe_unused]] Monitor* mon) override
+        REQUIRES_SHARED(Locks::mutator_lock_) {}
 
-    void ObjectWaitStart(Handle<mirror::Object> obj, int64_t millis ATTRIBUTE_UNUSED) override
+    void ObjectWaitStart(Handle<mirror::Object> obj, [[maybe_unused]] int64_t millis) override
         REQUIRES_SHARED(Locks::mutator_lock_) {
       if (IsInterestingObject(obj.Get())) {
         saw_wait_start_ = true;
       }
     }
 
-    void MonitorWaitFinished(Monitor* m, bool timed_out ATTRIBUTE_UNUSED) override
+    void MonitorWaitFinished(Monitor* m, [[maybe_unused]] bool timed_out) override
         REQUIRES_SHARED(Locks::mutator_lock_) {
       if (IsInterestingObject(m->GetObject())) {
         saw_wait_finished_ = true;
diff --git a/runtime/runtime_common.cc b/runtime/runtime_common.cc
index c4a695f..bc4d605 100644
--- a/runtime/runtime_common.cc
+++ b/runtime/runtime_common.cc
@@ -36,7 +36,7 @@
 #include "thread-current-inl.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
diff --git a/runtime/runtime_common.h b/runtime/runtime_common.h
index ec08907..803b1aa 100644
--- a/runtime/runtime_common.h
+++ b/runtime/runtime_common.h
@@ -31,10 +31,11 @@
 #include <iomanip>
 
 #include "base/dumpable.h"
+#include "base/macros.h"
 #include "base/utils.h"
 #include "native_stack_dump.h"
 
-namespace art {
+namespace art HIDDEN {
 
 struct Backtrace {
  public:
diff --git a/runtime/runtime_globals.h b/runtime/runtime_globals.h
index 81d350b..dc69063 100644
--- a/runtime/runtime_globals.h
+++ b/runtime/runtime_globals.h
@@ -17,23 +17,105 @@
 #ifndef ART_RUNTIME_RUNTIME_GLOBALS_H_
 #define ART_RUNTIME_RUNTIME_GLOBALS_H_
 
-#include "base/globals.h"
+#include <android-base/logging.h>
 
-namespace art {
+#include "base/bit_utils.h"
+#include "base/globals.h"
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 // Size of Dex virtual registers.
 static constexpr size_t kVRegSize = 4;
 
+#ifdef ART_PAGE_SIZE_AGNOSTIC
+// Accessor for the page size constant local to the libart.
+//
+// The value is only available after the Runtime initialization started - to ensure there is no
+// static initialization order issues where initialization of other values is dependent on the page
+// size. In those cases, GetPageSizeSlow() should be used.
+struct PageSize {
+  PageSize()
+    : is_initialized_(true), is_access_allowed_(false) {}
+
+  constexpr ALWAYS_INLINE operator size_t() const {
+    DCHECK(is_initialized_ && is_access_allowed_);
+    return value_;
+  }
+
+ private:
+  friend class Runtime;
+
+  void AllowAccess() {
+    SetAccessAllowed(true);
+  }
+
+  void DisallowAccess() {
+    SetAccessAllowed(false);
+  }
+
+  void SetAccessAllowed(bool is_allowed) {
+    // is_initialized_ is set to true when the page size value is initialized during the static
+    // initialization. This CHECK is added as an auxiliary way to help catching incorrect use of
+    // the method.
+    CHECK(is_initialized_);
+    is_access_allowed_ = is_allowed;
+  }
+
+  // The page size value.
+  //
+  // It is declared as a static constant value to ensure compiler recognizes that it doesn't change
+  // once it is initialized.
+  //
+  // It is declared as "hidden" i.e. local to the libart, to ensure:
+  //  - no other library can access it, so no static initialization dependency from other libraries
+  //    is possible;
+  //  - the variable can be addressed via offset from the program counter, instead of the global
+  //    offset table which would've added another level of indirection.
+  static const size_t value_ ALWAYS_HIDDEN;
+
+  // There are two flags in the accessor which help to ensure the value is accessed only after the
+  // static initialization is complete.
+  //
+  // is_initialized_ is used to assert the page size value is indeed initialized when the value
+  // access is allowed and when it is accessed.
+  //
+  // is_access_allowed_ is used to ensure the value is only accessed after Runtime initialization
+  // started.
+  const bool is_initialized_;
+  bool is_access_allowed_;
+};
+
+// gPageSize should only be used within libart. For most of the other cases MemMap::GetPageSize()
+// or GetPageSizeSlow() should be used. See also the comment for GetPageSizeSlow().
+extern PageSize gPageSize ALWAYS_HIDDEN;
+#else
+static constexpr size_t gPageSize = kMinPageSize;
+#endif
+
+// In the page-size-agnostic configuration the compiler may not recognise gPageSize as a
+// power-of-two value, and may therefore miss opportunities to optimize: divisions via a
+// right-shift, modulo via a bitwise-AND.
+// Here, define two functions which use the optimized implementations explicitly, which should be
+// used when dividing by or applying modulo of the page size. For simplificty, the same functions
+// are used under both configurations, as they optimize the page-size-agnostic configuration while
+// only replicating what the compiler already does on the non-page-size-agnostic configuration.
+static constexpr ALWAYS_INLINE size_t DivideByPageSize(size_t num) {
+  return (num >> WhichPowerOf2(static_cast<size_t>(gPageSize)));
+}
+static constexpr ALWAYS_INLINE size_t ModuloPageSize(size_t num) {
+  return (num & (gPageSize-1));
+}
+
 // Returns whether the given memory offset can be used for generating
 // an implicit null check.
 static inline bool CanDoImplicitNullCheckOn(uintptr_t offset) {
-  return offset < kPageSize;
+  return offset < gPageSize;
 }
 
 // Required object alignment
 static constexpr size_t kObjectAlignmentShift = 3;
 static constexpr size_t kObjectAlignment = 1u << kObjectAlignmentShift;
-static constexpr size_t kLargeObjectAlignment = kPageSize;
 
 // Garbage collector constants.
 static constexpr bool kMovingCollector = true;
diff --git a/runtime/runtime_image.cc b/runtime/runtime_image.cc
index b586c8b..5d30469 100644
--- a/runtime/runtime_image.cc
+++ b/runtime/runtime_image.cc
@@ -17,13 +17,13 @@
 #include "runtime_image.h"
 
 #include <lz4.h>
-#include <sstream>
 #include <unistd.h>
 
 #include "android-base/file.h"
 #include "android-base/stringprintf.h"
 #include "android-base/strings.h"
-
+#include "arch/instruction_set.h"
+#include "arch/instruction_set_features.h"
 #include "base/arena_allocator.h"
 #include "base/arena_containers.h"
 #include "base/bit_utils.h"
@@ -39,7 +39,6 @@
 #include "class_root-inl.h"
 #include "dex/class_accessor-inl.h"
 #include "gc/space/image_space.h"
-#include "image.h"
 #include "mirror/object-inl.h"
 #include "mirror/object-refvisitor-inl.h"
 #include "mirror/object_array-alloc-inl.h"
@@ -47,12 +46,13 @@
 #include "mirror/object_array.h"
 #include "mirror/string-inl.h"
 #include "nterp_helpers.h"
-#include "oat.h"
+#include "oat/image.h"
+#include "oat/oat.h"
 #include "profile/profile_compilation_info.h"
 #include "scoped_thread_state_change-inl.h"
 #include "vdex_file.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -113,13 +113,14 @@
     // size, relocate native pointers inside classes and ImTables.
     RelocateNativePointers();
 
-    // Generate the bitmap section, stored page aligned after the sections data
-    // and of size `object_section_size_` page aligned.
+    // Generate the bitmap section, stored kElfSegmentAlignment-aligned after the sections data and
+    // of size `object_section_size_` rounded up to kCardSize to match the bitmap size expected by
+    // Loader::Init at art::gc::space::ImageSpace.
     size_t sections_end = sections_[ImageHeader::kSectionMetadata].End();
     image_bitmap_ = gc::accounting::ContinuousSpaceBitmap::Create(
         "image bitmap",
         reinterpret_cast<uint8_t*>(image_begin_),
-        RoundUp(object_section_size_, kPageSize));
+        RoundUp(object_section_size_, gc::accounting::CardTable::kCardSize));
     for (uint32_t offset : object_offsets_) {
       DCHECK(IsAligned<kObjectAlignment>(image_begin_ + sizeof(ImageHeader) + offset));
       image_bitmap_.Set(
@@ -127,8 +128,11 @@
     }
     const size_t bitmap_bytes = image_bitmap_.Size();
     auto* bitmap_section = &sections_[ImageHeader::kSectionImageBitmap];
-    *bitmap_section = ImageSection(RoundUp(sections_end, kPageSize),
-                                   RoundUp(bitmap_bytes, kPageSize));
+    // The offset of the bitmap section should be aligned to kElfSegmentAlignment to enable mapping
+    // the section from file to memory. However the section size doesn't have to be rounded up as
+    // it is located at the end of the file. When mapping file contents to memory, if the last page
+    // of the mapping is only partially filled with data, the rest will be zero-filled.
+    *bitmap_section = ImageSection(RoundUp(sections_end, kElfSegmentAlignment), bitmap_bytes);
 
     // Compute boot image checksum and boot image components, to be stored in
     // the header.
@@ -145,7 +149,7 @@
     }
 
     header_ = ImageHeader(
-        /* image_reservation_size= */ RoundUp(sections_end, kPageSize),
+        /* image_reservation_size= */ RoundUp(sections_end, kElfSegmentAlignment),
         /* component_count= */ 1,
         image_begin_,
         sections_end,
@@ -600,8 +604,11 @@
     }
 
     for (Handle<mirror::Class> cls : classes_to_write) {
-      ScopedAssertNoThreadSuspension sants("Writing class");
-      CopyClass(cls.Get());
+      {
+        ScopedAssertNoThreadSuspension sants("Writing class");
+        CopyClass(cls.Get());
+      }
+      self->AllowThreadSuspension();
     }
 
     // Relocate the type array entries. We do this now before creating image
@@ -670,7 +677,7 @@
     explicit NativePointerVisitor(RuntimeImageHelper* helper) : helper_(helper) {}
 
     template <typename T>
-    T* operator()(T* ptr, void** dest_addr ATTRIBUTE_UNUSED) const {
+    T* operator()(T* ptr, [[maybe_unused]] void** dest_addr) const {
       return helper_->NativeLocationInImage(ptr, /* must_have_relocation= */ true);
     }
 
@@ -811,25 +818,25 @@
     ScopedTrace relocate_native_pointers("Relocate native pointers");
     ScopedObjectAccess soa(Thread::Current());
     NativePointerVisitor visitor(this);
-    for (auto entry : classes_) {
+    for (auto&& entry : classes_) {
       mirror::Class* cls = reinterpret_cast<mirror::Class*>(&objects_[entry.second]);
       cls->FixupNativePointers(cls, kRuntimePointerSize, visitor);
       RelocateMethodPointerArrays(cls, visitor);
     }
-    for (auto it : array_classes_) {
-      mirror::Class* cls = reinterpret_cast<mirror::Class*>(&objects_[it.second]);
+    for (auto&& entry : array_classes_) {
+      mirror::Class* cls = reinterpret_cast<mirror::Class*>(&objects_[entry.second]);
       cls->FixupNativePointers(cls, kRuntimePointerSize, visitor);
       RelocateMethodPointerArrays(cls, visitor);
     }
-    for (auto it : native_relocations_) {
-      if (it.second.first == NativeRelocationKind::kImTable) {
-        ImTable* im_table = reinterpret_cast<ImTable*>(im_tables_.data() + it.second.second);
+    for (auto&& entry : native_relocations_) {
+      if (entry.second.first == NativeRelocationKind::kImTable) {
+        ImTable* im_table = reinterpret_cast<ImTable*>(im_tables_.data() + entry.second.second);
         RelocateImTable(im_table, visitor);
       }
     }
-    for (auto it : dex_caches_) {
-      mirror::DexCache* cache = reinterpret_cast<mirror::DexCache*>(&objects_[it.second]);
-      RelocateDexCacheArrays(cache, *it.first, visitor);
+    for (auto&& entry : dex_caches_) {
+      mirror::DexCache* cache = reinterpret_cast<mirror::DexCache*>(&objects_[entry.second]);
+      RelocateDexCacheArrays(cache, *entry.first, visitor);
     }
   }
 
@@ -1189,11 +1196,11 @@
         : image_(image), copy_offset_(copy_offset) {}
 
     // We do not visit native roots. These are handled with other logic.
-    void VisitRootIfNonNull(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED)
-        const {
+    void VisitRootIfNonNull(
+        [[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {
       LOG(FATAL) << "UNREACHABLE";
     }
-    void VisitRoot(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED) const {
+    void VisitRoot([[maybe_unused]] mirror::CompressedReference<mirror::Object>* root) const {
       LOG(FATAL) << "UNREACHABLE";
     }
 
@@ -1212,9 +1219,8 @@
     }
 
     // java.lang.ref.Reference visitor.
-    void operator()(ObjPtr<mirror::Class> klass ATTRIBUTE_UNUSED,
-                    ObjPtr<mirror::Reference> ref) const
-        REQUIRES_SHARED(Locks::mutator_lock_) {
+    void operator()([[maybe_unused]] ObjPtr<mirror::Class> klass,
+                    ObjPtr<mirror::Reference> ref) const REQUIRES_SHARED(Locks::mutator_lock_) {
       operator()(ref, mirror::Reference::ReferentOffset(), /* is_static */ false);
     }
 
@@ -1814,21 +1820,28 @@
   friend class NativePointerVisitor;
 };
 
-static std::string GetOatPath() {
-  const std::string& data_dir = Runtime::Current()->GetProcessDataDirectory();
-  if (data_dir.empty()) {
-    // The data ditectory is empty for tests.
+std::string RuntimeImage::GetRuntimeImageDir(const std::string& app_data_dir) {
+  if (app_data_dir.empty()) {
+    // The data directory is empty for tests.
     return "";
   }
-  return data_dir + "/cache/oat_primary/";
+  return app_data_dir + "/cache/oat_primary/";
 }
 
 // Note: this may return a relative path for tests.
-std::string RuntimeImage::GetRuntimeImagePath(const std::string& dex_location) {
+std::string RuntimeImage::GetRuntimeImagePath(const std::string& app_data_dir,
+                                              const std::string& dex_location,
+                                              const std::string& isa) {
   std::string basename = android::base::Basename(dex_location);
   std::string filename = ReplaceFileExtension(basename, "art");
 
-  return GetOatPath() + GetInstructionSetString(kRuntimeISA) + "/" + filename;
+  return GetRuntimeImageDir(app_data_dir) + isa + "/" + filename;
+}
+
+std::string RuntimeImage::GetRuntimeImagePath(const std::string& dex_location) {
+  return GetRuntimeImagePath(Runtime::Current()->GetProcessDataDirectory(),
+                             dex_location,
+                             GetInstructionSetString(kRuntimeISA));
 }
 
 static bool EnsureDirectoryExists(const std::string& directory, std::string* error_msg) {
@@ -1849,7 +1862,7 @@
     *error_msg = "Cannot generate an app image without a boot image";
     return false;
   }
-  std::string oat_path = GetOatPath();
+  std::string oat_path = GetRuntimeImageDir(Runtime::Current()->GetProcessDataDirectory());
   if (!oat_path.empty() && !EnsureDirectoryExists(oat_path, error_msg)) {
     return false;
   }
diff --git a/runtime/runtime_image.h b/runtime/runtime_image.h
index d494e1c..1def1ba 100644
--- a/runtime/runtime_image.h
+++ b/runtime/runtime_image.h
@@ -19,7 +19,9 @@
 
 #include <string>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 class RuntimeImage {
  public:
@@ -27,7 +29,22 @@
   static bool WriteImageToDisk(std::string* error_msg);
 
   // Gets the path where a runtime-generated app image is stored.
+  //
+  // If any of the arguments is a valid glob (a pattern that contains '**' or those documented in
+  // glob(7)), returns a valid glob.
+  EXPORT static std::string GetRuntimeImagePath(const std::string& app_data_dir,
+                                                const std::string& dex_location,
+                                                const std::string& isa);
+
+  // Same as above, but takes data dir and ISA from the runtime.
   static std::string GetRuntimeImagePath(const std::string& dex_location);
+
+  // Gets the directory that stores runtime-generated app images. Note that the return value
+  // contains a trailing '/'.
+  //
+  // If the argument is a valid glob (a pattern that contains '**' or those documented in glob(7)),
+  // returns a valid glob.
+  EXPORT static std::string GetRuntimeImageDir(const std::string& app_data_dir);
 };
 
 }  // namespace art
diff --git a/runtime/runtime_intrinsics.cc b/runtime/runtime_intrinsics.cc
index fb60cfe..40e6ace 100644
--- a/runtime/runtime_intrinsics.cc
+++ b/runtime/runtime_intrinsics.cc
@@ -26,7 +26,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace {
 
@@ -99,7 +99,7 @@
                          ClassName,                                                              \
                          MethodName,                                                             \
                          Signature) &&
-  bool result = INTRINSICS_LIST(IS_INTRINSIC_INITIALIZED) true;
+  bool result = ART_INTRINSICS_LIST(IS_INTRINSIC_INITIALIZED) true;
 #undef IS_INTRINSIC_INITIALIZED
   return result;
 }
@@ -117,7 +117,7 @@
                       ClassName,                                                             \
                       MethodName,                                                            \
                       Signature) ||
-  INTRINSICS_LIST(INITIALIZE_INTRINSIC) true;
+  ART_INTRINSICS_LIST(INITIALIZE_INTRINSIC) true;
 #undef INITIALIZE_INTRINSIC
   DCHECK(AreAllIntrinsicsInitialized());
 }
diff --git a/runtime/runtime_intrinsics.h b/runtime/runtime_intrinsics.h
index bf2cb2b..d1b7d08 100644
--- a/runtime/runtime_intrinsics.h
+++ b/runtime/runtime_intrinsics.h
@@ -18,10 +18,11 @@
 #define ART_RUNTIME_RUNTIME_INTRINSICS_H_
 
 #include "base/locks.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
-void InitializeIntrinsics() REQUIRES_SHARED(Locks::mutator_lock_);
+EXPORT void InitializeIntrinsics() REQUIRES_SHARED(Locks::mutator_lock_);
 
 }  // namespace art
 
diff --git a/runtime/runtime_linux.cc b/runtime/runtime_linux.cc
index cfa8ea6..8c65ac8 100644
--- a/runtime/runtime_linux.cc
+++ b/runtime/runtime_linux.cc
@@ -23,7 +23,7 @@
 #include "base/memory_tool.h"
 #include "runtime_common.h"
 
-namespace art {
+namespace art HIDDEN {
 
 void HandleUnexpectedSignalLinux(int signal_number, siginfo_t* info, void* raw_context) {
   // Linux is mainly used for host testing. Under those conditions, react to the timeout signal,
diff --git a/runtime/runtime_options.cc b/runtime/runtime_options.cc
index e21587a..a4ea859 100644
--- a/runtime/runtime_options.cc
+++ b/runtime/runtime_options.cc
@@ -28,7 +28,7 @@
 #include "thread_list.h"
 #include "trace.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Specify storage for the RuntimeOptions keys.
 
diff --git a/runtime/runtime_options.def b/runtime/runtime_options.def
index b2fcf7d..8dcba19 100644
--- a/runtime/runtime_options.def
+++ b/runtime/runtime_options.def
@@ -98,7 +98,7 @@
 RUNTIME_OPTIONS_KEY (unsigned int,        JITInvokeTransitionWeight)
 RUNTIME_OPTIONS_KEY (int,                 JITPoolThreadPthreadPriority,   jit::kJitPoolThreadPthreadDefaultPriority)
 RUNTIME_OPTIONS_KEY (int,                 JITZygotePoolThreadPthreadPriority,   jit::kJitZygotePoolThreadPthreadDefaultPriority)
-RUNTIME_OPTIONS_KEY (MemoryKiB,           JITCodeCacheInitialCapacity,    jit::JitCodeCache::kInitialCapacity)
+RUNTIME_OPTIONS_KEY (MemoryKiB,           JITCodeCacheInitialCapacity,    jit::JitCodeCache::GetInitialCapacity())
 RUNTIME_OPTIONS_KEY (MemoryKiB,           JITCodeCacheMaxCapacity,        jit::JitCodeCache::kMaxCapacity)
 RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \
                                           HSpaceCompactForOOMMinIntervalsMs,\
@@ -117,6 +117,7 @@
 RUNTIME_OPTIONS_KEY (BackgroundGcOption,  BackgroundGc)
 
 RUNTIME_OPTIONS_KEY (Unit,                DisableExplicitGC)
+RUNTIME_OPTIONS_KEY (Unit,                DisableEagerlyReleaseExplicitGC)
 RUNTIME_OPTIONS_KEY (Unit,                NoSigChain)
 RUNTIME_OPTIONS_KEY (Unit,                ForceNativeBridge)
 RUNTIME_OPTIONS_KEY (LogVerbosity,        Verbose)
diff --git a/runtime/runtime_options.h b/runtime/runtime_options.h
index 8fec9ea..3cadd09 100644
--- a/runtime/runtime_options.h
+++ b/runtime/runtime_options.h
@@ -23,17 +23,18 @@
 #include <vector>
 
 #include "arch/instruction_set.h"
+#include "base/macros.h"
 #include "base/variant_map.h"
 #include "cmdline_types.h"  // TODO: don't need to include this file here
 #include "gc/collector_type.h"
 #include "gc/space/large_object_space.h"
 #include "hidden_api.h"
-#include "jit/jit.h"
 #include "jit/jit_code_cache.h"
+#include "jit/jit_options.h"
 #include "jit/profile_saver_options.h"
 #include "verifier/verifier_enums.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class CompilerCallbacks;
 class DexFile;
@@ -61,7 +62,7 @@
 //    map.Set(RuntimeArgumentMap::HeapTargetUtilization, 5.0);
 //    double *target_utilization = map.Get(RuntimeArgumentMap);
 //
-struct RuntimeArgumentMap : VariantMap<RuntimeArgumentMap, RuntimeArgumentMapKey> {
+struct EXPORT RuntimeArgumentMap : VariantMap<RuntimeArgumentMap, RuntimeArgumentMapKey> {
   // This 'using' line is necessary to inherit the variadic constructor.
   using VariantMap<RuntimeArgumentMap, RuntimeArgumentMapKey>::VariantMap;
 
diff --git a/runtime/runtime_stats.h b/runtime/runtime_stats.h
index 6ed7fd5..0a71b61 100644
--- a/runtime/runtime_stats.h
+++ b/runtime/runtime_stats.h
@@ -19,7 +19,9 @@
 
 #include <stdint.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 // These must match the values in dalvik.system.VMDebug.
 enum StatKinds {
diff --git a/runtime/runtime_test.cc b/runtime/runtime_test.cc
index 3fe281b..210ad7d 100644
--- a/runtime/runtime_test.cc
+++ b/runtime/runtime_test.cc
@@ -24,7 +24,7 @@
 #include "runtime.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class RuntimeTest : public CommonRuntimeTest {};
 
diff --git a/runtime/scoped_disable_public_sdk_checker.h b/runtime/scoped_disable_public_sdk_checker.h
index 4ec1af3..5365d17 100644
--- a/runtime/scoped_disable_public_sdk_checker.h
+++ b/runtime/scoped_disable_public_sdk_checker.h
@@ -19,7 +19,9 @@
 
 #include "class_linker.h"
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 // Utility class to disabled the public sdk checker within a scope (if installed).
 class ScopedDisablePublicSdkChecker : public ValueObject {
diff --git a/runtime/scoped_thread_state_change-inl.h b/runtime/scoped_thread_state_change-inl.h
index 674d791..f4e2bf9 100644
--- a/runtime/scoped_thread_state_change-inl.h
+++ b/runtime/scoped_thread_state_change-inl.h
@@ -28,7 +28,7 @@
 #include "runtime.h"
 #include "thread-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 inline ScopedThreadStateChange::ScopedThreadStateChange(Thread* self, ThreadState new_thread_state)
     : self_(self), thread_state_(new_thread_state), expected_has_no_thread_(false) {
diff --git a/runtime/scoped_thread_state_change.cc b/runtime/scoped_thread_state_change.cc
index 4051c31..cbca4e0 100644
--- a/runtime/scoped_thread_state_change.cc
+++ b/runtime/scoped_thread_state_change.cc
@@ -25,7 +25,7 @@
 #include "obj_ptr-inl.h"
 #include "runtime-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // See ScopedObjectAccessAlreadyRunnable::ScopedObjectAccessAlreadyRunnable(JavaVM*).
 static_assert(std::is_base_of<JavaVM, JavaVMExt>::value, "JavaVMExt does not extend JavaVM");
diff --git a/runtime/scoped_thread_state_change.h b/runtime/scoped_thread_state_change.h
index 7416d18..08aace9 100644
--- a/runtime/scoped_thread_state_change.h
+++ b/runtime/scoped_thread_state_change.h
@@ -24,7 +24,7 @@
 #include "base/value_object.h"
 #include "thread_state.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class JavaVMExt;
 class JNIEnvExt;
@@ -58,7 +58,7 @@
   const ThreadState thread_state_ = ThreadState::kTerminated;
 
  private:
-  void ScopedThreadChangeDestructorCheck();
+  EXPORT void ScopedThreadChangeDestructorCheck();
 
   ThreadState old_thread_state_ = ThreadState::kTerminated;
   const bool expected_has_no_thread_ = true;
@@ -207,7 +207,6 @@
   DISALLOW_COPY_AND_ASSIGN(ScopedThreadSuspension);
 };
 
-
 }  // namespace art
 
 #endif  // ART_RUNTIME_SCOPED_THREAD_STATE_CHANGE_H_
diff --git a/runtime/sdk_checker.cc b/runtime/sdk_checker.cc
index 9502382..0ad8ce5 100644
--- a/runtime/sdk_checker.cc
+++ b/runtime/sdk_checker.cc
@@ -21,7 +21,7 @@
 #include "dex/art_dex_file_loader.h"
 #include "mirror/class-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 SdkChecker::SdkChecker() : enabled_(true) {}
 
diff --git a/runtime/sdk_checker.h b/runtime/sdk_checker.h
index 8d82237..6bd0b2a 100644
--- a/runtime/sdk_checker.h
+++ b/runtime/sdk_checker.h
@@ -20,9 +20,10 @@
 #include "art_field.h"
 #include "art_method.h"
 #include "base/locks.h"
+#include "base/macros.h"
 #include "dex/dex_file.h"
 
-namespace art {
+namespace art HIDDEN {
 
 /**
  * The SdkChecker verifies if a given symbol is present in a given classpath.
@@ -43,7 +44,7 @@
   // format is the same as the classpath format (e.g. `dex1:dex2:dex3`). The
   // method will attempt to open the dex files and if there are errors it will
   // return a nullptr and set the error_msg appropriately.
-  static SdkChecker* Create(const std::string& public_sdk, std::string* error_msg);
+  EXPORT static SdkChecker* Create(const std::string& public_sdk, std::string* error_msg);
 
   // Verify if it should deny access to the given methods.
   // The decision is based on whether or not any of the API dex files declares a method
diff --git a/runtime/signal_catcher.cc b/runtime/signal_catcher.cc
index 70cebaf..3660ef3 100644
--- a/runtime/signal_catcher.cc
+++ b/runtime/signal_catcher.cc
@@ -25,6 +25,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
+#include <optional>
 #include <sstream>
 
 #include <android-base/file.h>
@@ -45,7 +46,7 @@
 #include "thread.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static void DumpCmdLine(std::ostream& os) {
 #if defined(__linux__)
@@ -89,8 +90,12 @@
   // Since we know the thread is just sitting around waiting for signals
   // to arrive, send it one.
   SetHaltFlag(true);
-  CHECK_PTHREAD_CALL(pthread_kill, (pthread_, SIGQUIT), "signal catcher shutdown");
-  CHECK_PTHREAD_CALL(pthread_join, (pthread_, nullptr), "signal catcher shutdown");
+  CHECK_PTHREAD_CALL(pthread_kill,
+                     (pthread_, SIGQUIT),
+                     android::base::StringPrintf("signal catcher shutdown: %lu", pthread_));
+  CHECK_PTHREAD_CALL(pthread_join,
+                     (pthread_, nullptr),
+                     android::base::StringPrintf("signal catcher shutdown: %lu", pthread_));
 }
 
 void SignalCatcher::SetHaltFlag(bool new_value) {
@@ -115,6 +120,7 @@
 }
 
 void SignalCatcher::HandleSigQuit() {
+  sigquit_nanotime_ = NanoTime();
   Runtime* runtime = Runtime::Current();
   std::ostringstream os;
   os << "\n"
@@ -140,6 +146,7 @@
   }
   os << "----- end " << getpid() << " -----\n";
   Output(os.str());
+  sigquit_nanotime_ = std::nullopt;
 }
 
 void SignalCatcher::HandleSigUsr1() {
diff --git a/runtime/signal_catcher.h b/runtime/signal_catcher.h
index 46eae7e..79014ea 100644
--- a/runtime/signal_catcher.h
+++ b/runtime/signal_catcher.h
@@ -17,10 +17,13 @@
 #ifndef ART_RUNTIME_SIGNAL_CATCHER_H_
 #define ART_RUNTIME_SIGNAL_CATCHER_H_
 
+#include <optional>
+
 #include "android-base/unique_fd.h"
 #include "base/mutex.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class Runtime;
 class SignalSet;
@@ -39,6 +42,7 @@
   void HandleSigQuit() REQUIRES(!Locks::mutator_lock_, !Locks::thread_list_lock_,
                                 !Locks::thread_suspend_count_lock_);
 
+  std::optional<uint64_t> SiqQuitNanoTime() const { return sigquit_nanotime_; }
 
  private:
   // NO_THREAD_SAFETY_ANALYSIS for static function calling into member function with excludes lock.
@@ -55,6 +59,7 @@
   bool halt_ GUARDED_BY(lock_);
   pthread_t pthread_ GUARDED_BY(lock_);
   Thread* thread_ GUARDED_BY(lock_);
+  std::optional<uint64_t> sigquit_nanotime_;
 };
 
 }  // namespace art
diff --git a/runtime/signal_set.h b/runtime/signal_set.h
index 8e70a51..470319c 100644
--- a/runtime/signal_set.h
+++ b/runtime/signal_set.h
@@ -21,6 +21,8 @@
 
 #include <android-base/logging.h>
 
+#include "base/macros.h"
+
 #if defined(__GLIBC__) || defined(ANDROID_HOST_MUSL)
 #define sigset64_t sigset_t
 #define sigemptyset64 sigemptyset
@@ -29,7 +31,7 @@
 #define sigwait64 sigwait
 #endif
 
-namespace art {
+namespace art HIDDEN {
 
 class SignalSet {
  public:
diff --git a/runtime/stack.cc b/runtime/stack.cc
index bf844b4..942b155 100644
--- a/runtime/stack.cc
+++ b/runtime/stack.cc
@@ -40,14 +40,14 @@
 #include "mirror/object-inl.h"
 #include "mirror/object_array-inl.h"
 #include "nterp_helpers.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "obj_ptr-inl.h"
 #include "quick/quick_method_frame_info.h"
 #include "runtime.h"
 #include "thread.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
diff --git a/runtime/stack.h b/runtime/stack.h
index a4bcf17..71948b2 100644
--- a/runtime/stack.h
+++ b/runtime/stack.h
@@ -25,11 +25,11 @@
 #include "base/locks.h"
 #include "base/macros.h"
 #include "deoptimization_kind.h"
+#include "oat/stack_map.h"
 #include "obj_ptr.h"
 #include "quick/quick_method_frame_info.h"
-#include "stack_map.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Object;
@@ -118,10 +118,10 @@
   };
 
  protected:
-  StackVisitor(Thread* thread,
-               Context* context,
-               StackWalkKind walk_kind,
-               bool check_suspended = true);
+  EXPORT StackVisitor(Thread* thread,
+                      Context* context,
+                      StackWalkKind walk_kind,
+                      bool check_suspended = true);
 
   bool GetRegisterIfAccessible(uint32_t reg, DexRegisterLocation::Kind kind, uint32_t* val) const
       REQUIRES_SHARED(Locks::mutator_lock_);
@@ -134,13 +134,13 @@
   // Return 'true' if we should continue to visit more frames, 'false' to stop.
   virtual bool VisitFrame() REQUIRES_SHARED(Locks::mutator_lock_) = 0;
 
-  enum class CountTransitions {
+  enum class EXPORT CountTransitions {
     kYes,
     kNo,
   };
 
   template <CountTransitions kCount = CountTransitions::kYes>
-  void WalkStack(bool include_transitions = false) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT void WalkStack(bool include_transitions = false) REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Convenience helper function to walk the stack with a lambda as a visitor.
   template <CountTransitions kCountTransitions = CountTransitions::kYes,
@@ -176,11 +176,11 @@
     return thread_;
   }
 
-  ArtMethod* GetMethod() const REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT ArtMethod* GetMethod() const REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Sets this stack frame's method pointer. This requires a full lock of the MutatorLock. This
   // doesn't work with inlined methods.
-  void SetMethod(ArtMethod* method) REQUIRES(Locks::mutator_lock_);
+  EXPORT void SetMethod(ArtMethod* method) REQUIRES(Locks::mutator_lock_);
 
   ArtMethod* GetOuterMethod() const {
     return *GetCurrentQuickFrame();
@@ -190,7 +190,8 @@
     return cur_shadow_frame_ != nullptr;
   }
 
-  uint32_t GetDexPc(bool abort_on_failure = true) const REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT uint32_t GetDexPc(bool abort_on_failure = true) const
+      REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Returns a vector of the inlined dex pcs, in order from outermost to innermost but it replaces
   // the innermost one with `handler_dex_pc`. In essence, (outermost dex pc, mid dex pc #1, ..., mid
@@ -198,9 +199,9 @@
   std::vector<uint32_t> ComputeDexPcList(uint32_t handler_dex_pc) const
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  ObjPtr<mirror::Object> GetThisObject() const REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT ObjPtr<mirror::Object> GetThisObject() const REQUIRES_SHARED(Locks::mutator_lock_);
 
-  size_t GetNativePcOffset() const REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT size_t GetNativePcOffset() const REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Returns the height of the stack in the managed stack frames, including transitions.
   size_t GetFrameHeight() REQUIRES_SHARED(Locks::mutator_lock_) {
@@ -227,35 +228,37 @@
   bool GetNextMethodAndDexPc(ArtMethod** next_method, uint32_t* next_dex_pc)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  bool GetVReg(ArtMethod* m,
-               uint16_t vreg,
-               VRegKind kind,
-               uint32_t* val,
-               std::optional<DexRegisterLocation> location = std::optional<DexRegisterLocation>(),
-               bool need_full_register_list = false) const REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT bool GetVReg(
+      ArtMethod* m,
+      uint16_t vreg,
+      VRegKind kind,
+      uint32_t* val,
+      std::optional<DexRegisterLocation> location = std::optional<DexRegisterLocation>(),
+      bool need_full_register_list = false) const REQUIRES_SHARED(Locks::mutator_lock_);
 
-  bool GetVRegPair(ArtMethod* m, uint16_t vreg, VRegKind kind_lo, VRegKind kind_hi,
-                   uint64_t* val) const
+  EXPORT bool GetVRegPair(ArtMethod* m,
+                          uint16_t vreg,
+                          VRegKind kind_lo,
+                          VRegKind kind_hi,
+                          uint64_t* val) const REQUIRES_SHARED(Locks::mutator_lock_);
+
+  // Values will be set in debugger shadow frames. Debugger will make sure deoptimization
+  // is triggered to make the values effective.
+  EXPORT bool SetVReg(ArtMethod* m, uint16_t vreg, uint32_t new_value, VRegKind kind)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Values will be set in debugger shadow frames. Debugger will make sure deoptimization
   // is triggered to make the values effective.
-  bool SetVReg(ArtMethod* m, uint16_t vreg, uint32_t new_value, VRegKind kind)
+  EXPORT bool SetVRegReference(ArtMethod* m, uint16_t vreg, ObjPtr<mirror::Object> new_value)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Values will be set in debugger shadow frames. Debugger will make sure deoptimization
   // is triggered to make the values effective.
-  bool SetVRegReference(ArtMethod* m, uint16_t vreg, ObjPtr<mirror::Object> new_value)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-
-  // Values will be set in debugger shadow frames. Debugger will make sure deoptimization
-  // is triggered to make the values effective.
-  bool SetVRegPair(ArtMethod* m,
-                   uint16_t vreg,
-                   uint64_t new_value,
-                   VRegKind kind_lo,
-                   VRegKind kind_hi)
-      REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT bool SetVRegPair(ArtMethod* m,
+                          uint16_t vreg,
+                          uint64_t new_value,
+                          VRegKind kind_lo,
+                          VRegKind kind_hi) REQUIRES_SHARED(Locks::mutator_lock_);
 
   uintptr_t* GetGPRAddress(uint32_t reg) const;
 
@@ -292,7 +295,7 @@
 
   std::string DescribeLocation() const REQUIRES_SHARED(Locks::mutator_lock_);
 
-  static size_t ComputeNumFrames(Thread* thread, StackWalkKind walk_kind)
+  EXPORT static size_t ComputeNumFrames(Thread* thread, StackWalkKind walk_kind)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   static void DescribeStack(Thread* thread) REQUIRES_SHARED(Locks::mutator_lock_);
@@ -330,12 +333,11 @@
 
  private:
   // Private constructor known in the case that num_frames_ has already been computed.
-  StackVisitor(Thread* thread,
-               Context* context,
-               StackWalkKind walk_kind,
-               size_t num_frames,
-               bool check_suspended = true)
-      REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT StackVisitor(Thread* thread,
+                      Context* context,
+                      StackWalkKind walk_kind,
+                      size_t num_frames,
+                      bool check_suspended = true) REQUIRES_SHARED(Locks::mutator_lock_);
 
   bool IsAccessibleRegister(uint32_t reg, bool is_float) const {
     return is_float ? IsAccessibleFPR(reg) : IsAccessibleGPR(reg);
diff --git a/runtime/stack_reference.h b/runtime/stack_reference.h
index 3d37b76..1bfcb92 100644
--- a/runtime/stack_reference.h
+++ b/runtime/stack_reference.h
@@ -20,7 +20,7 @@
 #include "base/macros.h"
 #include "mirror/object_reference.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // A reference from the shadow stack to a MirrorType object within the Java heap.
 template<class MirrorType>
diff --git a/runtime/startup_completed_task.cc b/runtime/startup_completed_task.cc
index 9709965..fa768d5 100644
--- a/runtime/startup_completed_task.cc
+++ b/runtime/startup_completed_task.cc
@@ -32,7 +32,7 @@
 #include "thread.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class UnlinkStartupDexCacheVisitor : public DexCacheVisitor {
  public:
@@ -56,7 +56,8 @@
       runtime->GetAppInfo()->GetPrimaryApkOptimizationStatus(&compiler_filter, &compilation_reason);
       CompilerFilter::Filter filter;
       if (CompilerFilter::ParseCompilerFilter(compiler_filter.c_str(), &filter) &&
-          !CompilerFilter::IsAotCompilationEnabled(filter)) {
+          !CompilerFilter::IsAotCompilationEnabled(filter) &&
+          !runtime->GetHeap()->HasAppImageSpace()) {
         std::string error_msg;
         if (!RuntimeImage::WriteImageToDisk(&error_msg)) {
           LOG(DEBUG) << "Could not write temporary image to disk " << error_msg;
diff --git a/runtime/startup_completed_task.h b/runtime/startup_completed_task.h
index 8077561..ac9c858 100644
--- a/runtime/startup_completed_task.h
+++ b/runtime/startup_completed_task.h
@@ -17,9 +17,10 @@
 #ifndef ART_RUNTIME_STARTUP_COMPLETED_TASK_H_
 #define ART_RUNTIME_STARTUP_COMPLETED_TASK_H_
 
+#include "base/macros.h"
 #include "gc/task_processor.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class Thread;
 
diff --git a/runtime/string_builder_append.cc b/runtime/string_builder_append.cc
index 0083b91..3db2256 100644
--- a/runtime/string_builder_append.cc
+++ b/runtime/string_builder_append.cc
@@ -26,7 +26,7 @@
 #include "runtime.h"
 #include "well_known_classes.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class StringBuilderAppend::Builder {
  public:
@@ -396,7 +396,6 @@
         UNREACHABLE();
     }
     ++current_arg;
-    DCHECK_LE(hs_.NumberOfReferences(), kMaxArgs);
   }
 
   if (UNLIKELY(has_fp_args)) {
@@ -430,6 +429,7 @@
     DCHECK_LE(f & kArgMask, static_cast<uint32_t>(Argument::kLast));
     switch (static_cast<Argument>(f & kArgMask)) {
       case Argument::kString: {
+        DCHECK_LT(handle_index, hs_.Size());
         ObjPtr<mirror::String> str =
             ObjPtr<mirror::String>::DownCast(hs_.GetReference(handle_index));
         ++handle_index;
@@ -485,14 +485,13 @@
         UNREACHABLE();
     }
     ++current_arg;
-    DCHECK_LE(handle_index, hs_.NumberOfReferences());
     DCHECK_LE(fp_arg_index, std::size(converted_fp_args_));
   }
   DCHECK_EQ(RemainingSpace(new_string, data), 0u) << std::hex << format_;
 }
 
 inline void StringBuilderAppend::Builder::operator()(ObjPtr<mirror::Object> obj,
-                                                     size_t usable_size ATTRIBUTE_UNUSED) const {
+                                                     [[maybe_unused]] size_t usable_size) const {
   ObjPtr<mirror::String> new_string = ObjPtr<mirror::String>::DownCast(obj);
   new_string->SetCount(length_with_flag_);
   if (mirror::String::IsCompressed(length_with_flag_)) {
diff --git a/runtime/string_builder_append.h b/runtime/string_builder_append.h
index fee6419..9629c99 100644
--- a/runtime/string_builder_append.h
+++ b/runtime/string_builder_append.h
@@ -22,9 +22,10 @@
 
 #include "base/bit_utils.h"
 #include "base/locks.h"
+#include "base/macros.h"
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class Thread;
 
diff --git a/runtime/subtype_check.h b/runtime/subtype_check.h
index 90b9b57..45b82f5 100644
--- a/runtime/subtype_check.h
+++ b/runtime/subtype_check.h
@@ -21,6 +21,7 @@
 #include "subtype_check_info.h"
 
 #include "base/locks.h"
+#include "base/macros.h"
 #include "mirror/class.h"
 #include "runtime.h"
 
@@ -219,7 +220,7 @@
  * All node targets (in `src <: target`) get Assigned, and any parent of an Initialized
  * node also gets Assigned.
  */
-namespace art {
+namespace art HIDDEN {
 
 struct MockSubtypeCheck;  // Forward declaration for testing.
 
diff --git a/runtime/subtype_check_bits.h b/runtime/subtype_check_bits.h
index 7e73afb..6d46d78 100644
--- a/runtime/subtype_check_bits.h
+++ b/runtime/subtype_check_bits.h
@@ -20,8 +20,9 @@
 #include "base/bit_string.h"
 #include "base/bit_struct.h"
 #include "base/bit_utils.h"
+#include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 /**
  * The SubtypeCheckBits memory layout (in bits):
diff --git a/runtime/subtype_check_bits_and_status.h b/runtime/subtype_check_bits_and_status.h
index e774955..266f977 100644
--- a/runtime/subtype_check_bits_and_status.h
+++ b/runtime/subtype_check_bits_and_status.h
@@ -20,10 +20,11 @@
 #include "base/bit_struct.h"
 #include "base/bit_utils.h"
 #include "base/casts.h"
+#include "base/macros.h"
 #include "class_status.h"
 #include "subtype_check_bits.h"
 
-namespace art {
+namespace art HIDDEN {
 
 /*
  * Enables a highly efficient O(1) subtype comparison by storing extra data
diff --git a/runtime/subtype_check_info.h b/runtime/subtype_check_info.h
index eef68d7..ce7f3a0 100644
--- a/runtime/subtype_check_info.h
+++ b/runtime/subtype_check_info.h
@@ -19,12 +19,13 @@
 
 #include "base/bit_string.h"
 #include "base/logging.h"
+#include "base/macros.h"
 #include "subtype_check_bits.h"
 
 // Forward-declare for testing purposes.
 struct SubtypeCheckInfoTest;
 
-namespace art {
+namespace art HIDDEN {
 
 /**
  * SubtypeCheckInfo is a logical label for the class SubtypeCheck data, which is necessary to
diff --git a/runtime/subtype_check_info_test.cc b/runtime/subtype_check_info_test.cc
index 44a2a69..a592a25 100644
--- a/runtime/subtype_check_info_test.cc
+++ b/runtime/subtype_check_info_test.cc
@@ -19,7 +19,7 @@
 #include "gtest/gtest.h"
 #include "android-base/logging.h"
 
-namespace art {
+namespace art HIDDEN {
 
 constexpr size_t BitString::kBitSizeAtPosition[BitString::kCapacity];
 constexpr size_t BitString::kCapacity;
diff --git a/runtime/subtype_check_test.cc b/runtime/subtype_check_test.cc
index 719e5d9..d634671 100644
--- a/runtime/subtype_check_test.cc
+++ b/runtime/subtype_check_test.cc
@@ -19,7 +19,7 @@
 #include "gtest/gtest.h"
 #include "android-base/logging.h"
 
-namespace art {
+namespace art HIDDEN {
 
 constexpr size_t BitString::kBitSizeAtPosition[BitString::kCapacity];
 constexpr size_t BitString::kCapacity;
@@ -89,8 +89,8 @@
   bool CasField32(art::MemberOffset offset,
                   int32_t old_value,
                   int32_t new_value,
-                  CASMode mode ATTRIBUTE_UNUSED,
-                  std::memory_order memory_order ATTRIBUTE_UNUSED)
+                  [[maybe_unused]] CASMode mode,
+                  [[maybe_unused]] std::memory_order memory_order)
       REQUIRES_SHARED(Locks::mutator_lock_) {
     UNUSED(offset);
     if (old_value == GetField32Volatile(offset)) {
diff --git a/runtime/suspend_reason.h b/runtime/suspend_reason.h
index f45505a..3af67a9 100644
--- a/runtime/suspend_reason.h
+++ b/runtime/suspend_reason.h
@@ -19,7 +19,9 @@
 
 #include <iosfwd>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 // The various reasons that we might be suspending a thread.
 enum class SuspendReason : char {
diff --git a/runtime/thread-current-inl.h b/runtime/thread-current-inl.h
index d12a45c..ecc7067 100644
--- a/runtime/thread-current-inl.h
+++ b/runtime/thread-current-inl.h
@@ -25,7 +25,7 @@
 
 #include <pthread.h>
 
-namespace art {
+namespace art HIDDEN {
 
 inline Thread* Thread::Current() {
   // We rely on Thread::Current returning null for a detached thread, so it's not obvious
diff --git a/runtime/thread-inl.h b/runtime/thread-inl.h
index ce50471..57d606c 100644
--- a/runtime/thread-inl.h
+++ b/runtime/thread-inl.h
@@ -17,8 +17,6 @@
 #ifndef ART_RUNTIME_THREAD_INL_H_
 #define ART_RUNTIME_THREAD_INL_H_
 
-#include "thread.h"
-
 #include "arch/instruction_set.h"
 #include "base/aborting.h"
 #include "base/casts.h"
@@ -28,11 +26,13 @@
 #include "jni/jni_env_ext.h"
 #include "managed_stack-inl.h"
 #include "obj_ptr-inl.h"
-#include "suspend_reason.h"
+#include "runtime.h"
 #include "thread-current-inl.h"
+#include "thread.h"
+#include "thread_list.h"
 #include "thread_pool.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // Quickly access the current thread from a JNIEnv.
 inline Thread* Thread::ForEnv(JNIEnv* env) {
@@ -40,6 +40,13 @@
   return full_env->GetSelf();
 }
 
+inline size_t Thread::GetStackOverflowProtectedSize() {
+  // The kMemoryToolStackGuardSizeScale is expected to be 1 when ASan is not enabled.
+  // As the function is always inlined, in those cases each function call should turn
+  // into a simple reference to gPageSize.
+  return kMemoryToolStackGuardSizeScale * gPageSize;
+}
+
 inline ObjPtr<mirror::Object> Thread::DecodeJObject(jobject obj) const {
   if (obj == nullptr) {
     return nullptr;
@@ -81,12 +88,15 @@
       break;
     } else if (state_and_flags.IsFlagSet(ThreadFlag::kCheckpointRequest)) {
       RunCheckpointFunction();
-    } else if (state_and_flags.IsFlagSet(ThreadFlag::kSuspendRequest)) {
+    } else if (state_and_flags.IsFlagSet(ThreadFlag::kSuspendRequest) &&
+               !state_and_flags.IsFlagSet(ThreadFlag::kSuspensionImmune)) {
       FullSuspendCheck(implicit);
       implicit = false;  // We do not need to `MadviseAwayAlternateSignalStack()` anymore.
-    } else {
-      DCHECK(state_and_flags.IsFlagSet(ThreadFlag::kEmptyCheckpointRequest));
+    } else if (state_and_flags.IsFlagSet(ThreadFlag::kEmptyCheckpointRequest)) {
       RunEmptyCheckpoint();
+    } else {
+      DCHECK(state_and_flags.IsFlagSet(ThreadFlag::kSuspensionImmune));
+      break;
     }
   }
   if (implicit) {
@@ -106,9 +116,10 @@
       if (kIsDebugBuild) {
         for (int i = kLockLevelCount - 1; i >= 0; --i) {
           BaseMutex* held_mutex = self->GetHeldMutex(static_cast<LockLevel>(i));
-          if (held_mutex != nullptr &&
-              held_mutex != GetMutatorLock() &&
-              held_mutex != cond_var_mutex) {
+          if (held_mutex != nullptr && held_mutex != GetMutatorLock() &&
+              held_mutex != cond_var_mutex &&
+              held_mutex != cp_placeholder_mutex_.load(std::memory_order_relaxed)) {
+            // placeholder_mutex may still be nullptr. That's OK.
             CHECK(Locks::IsExpectedOnWeakRefAccess(held_mutex))
                 << "Holding unexpected mutex " << held_mutex->GetName()
                 << " when accessing weak ref";
@@ -226,6 +237,7 @@
     StateAndFlags old_state_and_flags = GetStateAndFlags(std::memory_order_relaxed);
     DCHECK_EQ(old_state_and_flags.GetState(), ThreadState::kRunnable);
     if (UNLIKELY(old_state_and_flags.IsFlagSet(ThreadFlag::kCheckpointRequest))) {
+      IncrementStatsCounter(&checkpoint_count_);
       RunCheckpointFunction();
       continue;
     }
@@ -244,12 +256,14 @@
         tls32_.state_and_flags.CompareAndSetWeakRelease(old_state_and_flags.GetValue(),
                                                         new_state_and_flags.GetValue());
     if (LIKELY(done)) {
+      IncrementStatsCounter(&suspended_count_);
       break;
     }
   }
 }
 
-inline void Thread::PassActiveSuspendBarriers() {
+inline void Thread::CheckActiveSuspendBarriers() {
+  DCHECK_NE(GetState(), ThreadState::kRunnable);
   while (true) {
     StateAndFlags state_and_flags = GetStateAndFlags(std::memory_order_relaxed);
     if (LIKELY(!state_and_flags.IsFlagSet(ThreadFlag::kCheckpointRequest) &&
@@ -257,7 +271,7 @@
                !state_and_flags.IsFlagSet(ThreadFlag::kActiveSuspendBarrier))) {
       break;
     } else if (state_and_flags.IsFlagSet(ThreadFlag::kActiveSuspendBarrier)) {
-      PassActiveSuspendBarriers(this);
+      PassActiveSuspendBarriers();
     } else {
       // Impossible
       LOG(FATAL) << "Fatal, thread transitioned into suspended without running the checkpoint";
@@ -265,6 +279,44 @@
   }
 }
 
+inline void Thread::CheckBarrierInactive(WrappedSuspend1Barrier* suspend1_barrier) {
+  for (WrappedSuspend1Barrier* w = tlsPtr_.active_suspend1_barriers; w != nullptr; w = w->next_) {
+    CHECK_EQ(w->magic_, WrappedSuspend1Barrier::kMagic)
+        << "first = " << tlsPtr_.active_suspend1_barriers << " current = " << w
+        << " next = " << w->next_;
+    CHECK_NE(w, suspend1_barrier);
+  }
+}
+
+inline void Thread::AddSuspend1Barrier(WrappedSuspend1Barrier* suspend1_barrier) {
+  if (tlsPtr_.active_suspend1_barriers != nullptr) {
+    CHECK_EQ(tlsPtr_.active_suspend1_barriers->magic_, WrappedSuspend1Barrier::kMagic)
+        << "first = " << tlsPtr_.active_suspend1_barriers;
+  }
+  CHECK_EQ(suspend1_barrier->magic_, WrappedSuspend1Barrier::kMagic);
+  suspend1_barrier->next_ = tlsPtr_.active_suspend1_barriers;
+  tlsPtr_.active_suspend1_barriers = suspend1_barrier;
+}
+
+inline void Thread::RemoveFirstSuspend1Barrier(WrappedSuspend1Barrier* suspend1_barrier) {
+  DCHECK_EQ(tlsPtr_.active_suspend1_barriers, suspend1_barrier);
+  tlsPtr_.active_suspend1_barriers = tlsPtr_.active_suspend1_barriers->next_;
+}
+
+inline void Thread::RemoveSuspend1Barrier(WrappedSuspend1Barrier* barrier) {
+  // 'barrier' should be in the list. If not, we will get a SIGSEGV with fault address of 4 or 8.
+  WrappedSuspend1Barrier** last = &tlsPtr_.active_suspend1_barriers;
+  while (*last != barrier) {
+    last = &((*last)->next_);
+  }
+  *last = (*last)->next_;
+}
+
+inline bool Thread::HasActiveSuspendBarrier() {
+  return tlsPtr_.active_suspend1_barriers != nullptr ||
+         tlsPtr_.active_suspendall_barrier != nullptr;
+}
+
 inline void Thread::TransitionFromRunnableToSuspended(ThreadState new_state) {
   // Note: JNI stubs inline a fast path of this method that transitions to suspended if
   // there are no flags set and then clears the `held_mutexes[kMutatorLock]` (this comes
@@ -280,7 +332,7 @@
   // Mark the release of the share of the mutator lock.
   GetMutatorLock()->TransitionFromRunnableToSuspended(this);
   // Once suspended - check the active suspend barrier flag
-  PassActiveSuspendBarriers();
+  CheckActiveSuspendBarriers();
 }
 
 inline ThreadState Thread::TransitionFromSuspendedToRunnable() {
@@ -290,6 +342,7 @@
   // inlined from the `GetMutatorLock()->TransitionFromSuspendedToRunnable(this)` below).
   // Therefore any code added here (other than debug build assertions) should be gated
   // on some flag being set, so that the JNI stub can take the slow path to get here.
+  DCHECK(this == Current());
   StateAndFlags old_state_and_flags = GetStateAndFlags(std::memory_order_relaxed);
   ThreadState old_state = old_state_and_flags.GetState();
   DCHECK_NE(old_state, ThreadState::kRunnable);
@@ -311,7 +364,7 @@
         break;
       }
     } else if (old_state_and_flags.IsFlagSet(ThreadFlag::kActiveSuspendBarrier)) {
-      PassActiveSuspendBarriers(this);
+      PassActiveSuspendBarriers();
     } else if (UNLIKELY(old_state_and_flags.IsFlagSet(ThreadFlag::kCheckpointRequest) ||
                         old_state_and_flags.IsFlagSet(ThreadFlag::kEmptyCheckpointRequest))) {
       // Checkpoint flags should not be set while in suspended state.
@@ -333,7 +386,6 @@
         thread_to_pass = this;
       }
       MutexLock mu(thread_to_pass, *Locks::thread_suspend_count_lock_);
-      ScopedTransitioningToRunnable scoped_transitioning_to_runnable(this);
       // Reload state and flags after locking the mutex.
       old_state_and_flags = GetStateAndFlags(std::memory_order_relaxed);
       DCHECK_EQ(old_state, old_state_and_flags.GetState());
@@ -345,14 +397,15 @@
         DCHECK_EQ(old_state, old_state_and_flags.GetState());
       }
       DCHECK_EQ(GetSuspendCount(), 0);
-    } else if (UNLIKELY(old_state_and_flags.IsFlagSet(ThreadFlag::kRunningFlipFunction)) ||
-               UNLIKELY(old_state_and_flags.IsFlagSet(ThreadFlag::kWaitingForFlipFunction))) {
-      // It's possible that some thread runs this thread's flip-function in
-      // Thread::GetPeerFromOtherThread() even though it was runnable.
+    } else if (UNLIKELY(old_state_and_flags.IsFlagSet(ThreadFlag::kRunningFlipFunction))) {
+      DCHECK(!old_state_and_flags.IsFlagSet(ThreadFlag::kPendingFlipFunction));
+      // Do this before transitioning to runnable, both because we shouldn't wait in a runnable
+      // state, and so that the thread running the flip function can DCHECK we're not runnable.
       WaitForFlipFunction(this);
-    } else {
-      DCHECK(old_state_and_flags.IsFlagSet(ThreadFlag::kPendingFlipFunction));
-      if (EnsureFlipFunctionStarted(this, old_state_and_flags)) {
+    } else if (old_state_and_flags.IsFlagSet(ThreadFlag::kPendingFlipFunction)) {
+      // Logically acquire mutator lock in shared mode.
+      DCHECK(!old_state_and_flags.IsFlagSet(ThreadFlag::kRunningFlipFunction));
+      if (EnsureFlipFunctionStarted(this, this, old_state_and_flags)) {
         break;
       }
     }
@@ -360,6 +413,7 @@
     old_state_and_flags = GetStateAndFlags(std::memory_order_relaxed);
     DCHECK_EQ(old_state, old_state_and_flags.GetState());
   }
+  DCHECK_EQ(this->GetState(), ThreadState::kRunnable);
   return static_cast<ThreadState>(old_state);
 }
 
@@ -438,35 +492,66 @@
   }
 }
 
-inline bool Thread::ModifySuspendCount(Thread* self,
-                                       int delta,
-                                       AtomicInteger* suspend_barrier,
-                                       SuspendReason reason) {
-  if (delta > 0 &&
-      (((gUseUserfaultfd || gUseReadBarrier) && this != self) || suspend_barrier != nullptr)) {
-    // When delta > 0 (requesting a suspend), ModifySuspendCountInternal() may fail either if
-    // active_suspend_barriers is full or we are in the middle of a thread flip. Retry in a loop.
-    while (true) {
-      if (LIKELY(ModifySuspendCountInternal(self, delta, suspend_barrier, reason))) {
-        return true;
-      } else {
-        // Failure means the list of active_suspend_barriers is full or we are in the middle of a
-        // thread flip, we should release the thread_suspend_count_lock_ (to avoid deadlock) and
-        // wait till the target thread has executed or Thread::PassActiveSuspendBarriers() or the
-        // flip function. Note that we could not simply wait for the thread to change to a suspended
-        // state, because it might need to run checkpoint function before the state change or
-        // resumes from the resume_cond_, which also needs thread_suspend_count_lock_.
-        //
-        // The list of active_suspend_barriers is very unlikely to be full since more than
-        // kMaxSuspendBarriers threads need to execute SuspendAllInternal() simultaneously, and
-        // target thread stays in kRunnable in the mean time.
-        Locks::thread_suspend_count_lock_->ExclusiveUnlock(self);
-        NanoSleep(100000);
-        Locks::thread_suspend_count_lock_->ExclusiveLock(self);
-      }
+inline void Thread::IncrementSuspendCount(Thread* self,
+                                          AtomicInteger* suspendall_barrier,
+                                          WrappedSuspend1Barrier* suspend1_barrier,
+                                          SuspendReason reason) {
+  if (kIsDebugBuild) {
+    Locks::thread_suspend_count_lock_->AssertHeld(self);
+    if (this != self) {
+      Locks::thread_list_lock_->AssertHeld(self);
     }
-  } else {
-    return ModifySuspendCountInternal(self, delta, suspend_barrier, reason);
+  }
+  if (UNLIKELY(reason == SuspendReason::kForUserCode)) {
+    Locks::user_code_suspension_lock_->AssertHeld(self);
+  }
+
+  uint32_t flags = enum_cast<uint32_t>(ThreadFlag::kSuspendRequest);
+  if (suspendall_barrier != nullptr) {
+    DCHECK(suspend1_barrier == nullptr);
+    DCHECK(tlsPtr_.active_suspendall_barrier == nullptr);
+    tlsPtr_.active_suspendall_barrier = suspendall_barrier;
+    flags |= enum_cast<uint32_t>(ThreadFlag::kActiveSuspendBarrier);
+  } else if (suspend1_barrier != nullptr) {
+    AddSuspend1Barrier(suspend1_barrier);
+    flags |= enum_cast<uint32_t>(ThreadFlag::kActiveSuspendBarrier);
+  }
+
+  ++tls32_.suspend_count;
+  if (reason == SuspendReason::kForUserCode) {
+    ++tls32_.user_code_suspend_count;
+  }
+
+  // Two bits might be set simultaneously.
+  tls32_.state_and_flags.fetch_or(flags, std::memory_order_release);
+  TriggerSuspend();
+}
+
+inline void Thread::IncrementSuspendCount(Thread* self) {
+  IncrementSuspendCount(self, nullptr, nullptr, SuspendReason::kInternal);
+}
+
+inline void Thread::DecrementSuspendCount(Thread* self, bool for_user_code) {
+  DCHECK(ReadFlag(ThreadFlag::kSuspendRequest));
+  Locks::thread_suspend_count_lock_->AssertHeld(self);
+  if (UNLIKELY(tls32_.suspend_count <= 0)) {
+    UnsafeLogFatalForSuspendCount(self, this);
+    UNREACHABLE();
+  }
+  if (for_user_code) {
+    Locks::user_code_suspension_lock_->AssertHeld(self);
+    if (UNLIKELY(tls32_.user_code_suspend_count <= 0)) {
+      LOG(ERROR) << "user_code_suspend_count incorrect";
+      UnsafeLogFatalForSuspendCount(self, this);
+      UNREACHABLE();
+    }
+    --tls32_.user_code_suspend_count;
+  }
+
+  --tls32_.suspend_count;
+
+  if (tls32_.suspend_count == 0) {
+    AtomicClearFlag(ThreadFlag::kSuspendRequest, std::memory_order_release);
   }
 }
 
@@ -499,6 +584,93 @@
   tlsPtr_.stack_end = tlsPtr_.stack_begin + GetStackOverflowReservedBytes(kRuntimeISA);
 }
 
+inline void Thread::NotifyOnThreadExit(ThreadExitFlag* tef) {
+  DCHECK_EQ(tef->exited_, false);
+  DCHECK(tlsPtr_.thread_exit_flags == nullptr || !tlsPtr_.thread_exit_flags->exited_);
+  tef->next_ = tlsPtr_.thread_exit_flags;
+  tlsPtr_.thread_exit_flags = tef;
+  if (tef->next_ != nullptr) {
+    DCHECK(!tef->next_->HasExited());
+    tef->next_->prev_ = tef;
+  }
+  tef->prev_ = nullptr;
+}
+
+inline void Thread::UnregisterThreadExitFlag(ThreadExitFlag* tef) {
+  if (tef->HasExited()) {
+    // List is no longer used; each client will deallocate its own ThreadExitFlag.
+    return;
+  }
+  DCHECK(IsRegistered(tef));
+  // Remove tef from the list.
+  if (tef->next_ != nullptr) {
+    tef->next_->prev_ = tef->prev_;
+  }
+  if (tef->prev_ == nullptr) {
+    DCHECK_EQ(tlsPtr_.thread_exit_flags, tef);
+    tlsPtr_.thread_exit_flags = tef->next_;
+  } else {
+    DCHECK_NE(tlsPtr_.thread_exit_flags, tef);
+    tef->prev_->next_ = tef->next_;
+  }
+  DCHECK(tlsPtr_.thread_exit_flags == nullptr || tlsPtr_.thread_exit_flags->prev_ == nullptr);
+}
+
+inline void Thread::DCheckUnregisteredEverywhere(ThreadExitFlag* first, ThreadExitFlag* last) {
+  if (!kIsDebugBuild) {
+    return;
+  }
+  Thread* self = Thread::Current();
+  MutexLock mu(self, *Locks::thread_list_lock_);
+  Runtime::Current()->GetThreadList()->ForEach([&](Thread* t) REQUIRES(Locks::thread_list_lock_) {
+    for (ThreadExitFlag* tef = t->tlsPtr_.thread_exit_flags; tef != nullptr; tef = tef->next_) {
+      CHECK(tef < first || tef > last)
+          << "tef = " << std::hex << tef << " first = " << first << std::dec;
+    }
+    // Also perform a minimal consistency check on each list.
+    ThreadExitFlag* flags = t->tlsPtr_.thread_exit_flags;
+    CHECK(flags == nullptr || flags->prev_ == nullptr);
+  });
+}
+
+inline bool Thread::IsRegistered(ThreadExitFlag* query_tef) {
+  for (ThreadExitFlag* tef = tlsPtr_.thread_exit_flags; tef != nullptr; tef = tef->next_) {
+    if (tef == query_tef) {
+      return true;
+    }
+  }
+  return false;
+}
+
+inline void Thread::DisallowPreMonitorMutexes() {
+  if (kIsDebugBuild) {
+    CHECK(this == Thread::Current());
+    CHECK(GetHeldMutex(kMonitorLock) == nullptr);
+    // Pretend we hold a kMonitorLock level mutex to detect disallowed mutex
+    // acquisitions by checkpoint Run() methods.  We don't normally register or thus check
+    // kMonitorLock level mutexes, but this is an exception.
+    Mutex* ph = cp_placeholder_mutex_.load(std::memory_order_acquire);
+    if (UNLIKELY(ph == nullptr)) {
+      Mutex* new_ph = new Mutex("checkpoint placeholder mutex", kMonitorLock);
+      if (LIKELY(cp_placeholder_mutex_.compare_exchange_strong(ph, new_ph))) {
+        ph = new_ph;
+      } else {
+        // ph now has the value set by another thread.
+        delete new_ph;
+      }
+    }
+    SetHeldMutex(kMonitorLock, ph);
+  }
+}
+
+// Undo the effect of the previous call. Again only invoked by the thread itself.
+inline void Thread::AllowPreMonitorMutexes() {
+  if (kIsDebugBuild) {
+    CHECK_EQ(GetHeldMutex(kMonitorLock), cp_placeholder_mutex_.load(std::memory_order_relaxed));
+    SetHeldMutex(kMonitorLock, nullptr);
+  }
+}
+
 }  // namespace art
 
 #endif  // ART_RUNTIME_THREAD_INL_H_
diff --git a/runtime/thread.cc b/runtime/thread.cc
index f7fad4a..2ebbe13 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -29,6 +29,7 @@
 #include <cerrno>
 #include <iostream>
 #include <list>
+#include <optional>
 #include <sstream>
 
 #include "android-base/file.h"
@@ -90,7 +91,8 @@
 #include "nativehelper/scoped_utf_chars.h"
 #include "nterp_helpers.h"
 #include "nth_caller_visitor.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
+#include "oat/stack_map.h"
 #include "obj_ptr-inl.h"
 #include "object_lock.h"
 #include "palette/palette.h"
@@ -105,14 +107,16 @@
 #include "scoped_thread_state_change-inl.h"
 #include "scoped_disable_public_sdk_checker.h"
 #include "stack.h"
-#include "stack_map.h"
 #include "thread-inl.h"
 #include "thread_list.h"
 #include "trace.h"
-#include "verifier/method_verifier.h"
 #include "verify_object.h"
 #include "well_known_classes-inl.h"
 
+#ifdef ART_TARGET_ANDROID
+#include <android/set_abort_message.h>
+#endif
+
 #if ART_USE_FUTEXES
 #include "linux/futex.h"
 #include "sys/syscall.h"
@@ -127,7 +131,7 @@
 extern "C" __attribute__((weak)) void* __hwasan_tag_pointer(const volatile void* p,
                                                             unsigned char tag);
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringAppendV;
 using android::base::StringPrintf;
@@ -140,20 +144,12 @@
 const size_t Thread::kStackOverflowImplicitCheckSize = GetStackOverflowReservedBytes(kRuntimeISA);
 bool (*Thread::is_sensitive_thread_hook_)() = nullptr;
 Thread* Thread::jit_sensitive_thread_ = nullptr;
+std::atomic<Mutex*> Thread::cp_placeholder_mutex_(nullptr);
 #ifndef __BIONIC__
 thread_local Thread* Thread::self_tls_ = nullptr;
 #endif
 
 static constexpr bool kVerifyImageObjectsMarked = kIsDebugBuild;
-// Amount of time (in microseconds) that we sleep if another thread is running
-// flip function of the thread that we are interested in.
-static constexpr size_t kSuspendTimeDuringFlip = 5'000;
-
-// For implicit overflow checks we reserve an extra piece of memory at the bottom
-// of the stack (lowest memory).  The higher portion of the memory
-// is protected against reads and the lower is available for use while
-// throwing the StackOverflow exception.
-constexpr size_t kStackOverflowProtectedSize = 4 * kMemoryToolStackGuardSizeScale * KB;
 
 static const char* kThreadNameDuringStartup = "<native thread without managed peer>";
 
@@ -679,16 +675,15 @@
   return nullptr;
 }
 
-Thread* Thread::FromManagedThread(const ScopedObjectAccessAlreadyRunnable& soa,
-                                  ObjPtr<mirror::Object> thread_peer) {
+Thread* Thread::FromManagedThread(Thread* self, ObjPtr<mirror::Object> thread_peer) {
   ArtField* f = WellKnownClasses::java_lang_Thread_nativePeer;
   Thread* result = reinterpret_cast64<Thread*>(f->GetLong(thread_peer));
   // Check that if we have a result it is either suspended or we hold the thread_list_lock_
   // to stop it from going away.
   if (kIsDebugBuild) {
-    MutexLock mu(soa.Self(), *Locks::thread_suspend_count_lock_);
+    MutexLock mu(self, *Locks::thread_suspend_count_lock_);
     if (result != nullptr && !result->IsSuspended()) {
-      Locks::thread_list_lock_->AssertHeld(soa.Self());
+      Locks::thread_list_lock_->AssertHeld(self);
     }
   }
   return result;
@@ -696,7 +691,7 @@
 
 Thread* Thread::FromManagedThread(const ScopedObjectAccessAlreadyRunnable& soa,
                                   jobject java_thread) {
-  return FromManagedThread(soa, soa.Decode<mirror::Object>(java_thread));
+  return FromManagedThread(soa.Self(), soa.Decode<mirror::Object>(java_thread));
 }
 
 static size_t FixStackSize(size_t stack_size) {
@@ -734,7 +729,7 @@
   }
 
   // Some systems require the stack size to be a multiple of the system page size, so round up.
-  stack_size = RoundUp(stack_size, kPageSize);
+  stack_size = RoundUp(stack_size, gPageSize);
 
   return stack_size;
 }
@@ -743,26 +738,26 @@
 NO_INLINE
 static uint8_t* FindStackTop() {
   return reinterpret_cast<uint8_t*>(
-      AlignDown(__builtin_frame_address(0), kPageSize));
+      AlignDown(__builtin_frame_address(0), gPageSize));
 }
 
 // Install a protected region in the stack.  This is used to trigger a SIGSEGV if a stack
 // overflow is detected.  It is located right below the stack_begin_.
 ATTRIBUTE_NO_SANITIZE_ADDRESS
 void Thread::InstallImplicitProtection() {
-  uint8_t* pregion = tlsPtr_.stack_begin - kStackOverflowProtectedSize;
+  uint8_t* pregion = tlsPtr_.stack_begin - GetStackOverflowProtectedSize();
   // Page containing current top of stack.
   uint8_t* stack_top = FindStackTop();
 
   // Try to directly protect the stack.
   VLOG(threads) << "installing stack protected region at " << std::hex <<
         static_cast<void*>(pregion) << " to " <<
-        static_cast<void*>(pregion + kStackOverflowProtectedSize - 1);
+        static_cast<void*>(pregion + GetStackOverflowProtectedSize() - 1);
   if (ProtectStack(/* fatal_on_error= */ false)) {
     // Tell the kernel that we won't be needing these pages any more.
     // NB. madvise will probably write zeroes into the memory (on linux it does).
     size_t unwanted_size =
-        reinterpret_cast<uintptr_t>(stack_top) - reinterpret_cast<uintptr_t>(pregion) - kPageSize;
+        reinterpret_cast<uintptr_t>(stack_top) - reinterpret_cast<uintptr_t>(pregion) - gPageSize;
     madvise(pregion, unwanted_size, MADV_DONTNEED);
     return;
   }
@@ -812,12 +807,12 @@
 #endif
       // Keep space uninitialized as it can overflow the stack otherwise (should Clang actually
       // auto-initialize this local variable).
-      volatile char space[kPageSize - (kAsanMultiplier * 256)] __attribute__((uninitialized));
-      char sink ATTRIBUTE_UNUSED = space[zero];  // NOLINT
+      volatile char space[gPageSize - (kAsanMultiplier * 256)] __attribute__((uninitialized));
+      [[maybe_unused]] char sink = space[zero];
       // Remove tag from the pointer. Nop in non-hwasan builds.
       uintptr_t addr = reinterpret_cast<uintptr_t>(
           __hwasan_tag_pointer != nullptr ? __hwasan_tag_pointer(space, 0) : space);
-      if (addr >= target + kPageSize) {
+      if (addr >= target + gPageSize) {
         Touch(target);
       }
       zero *= 2;  // Try to avoid tail recursion.
@@ -828,7 +823,7 @@
 
   VLOG(threads) << "(again) installing stack protected region at " << std::hex <<
       static_cast<void*>(pregion) << " to " <<
-      static_cast<void*>(pregion + kStackOverflowProtectedSize - 1);
+      static_cast<void*>(pregion + GetStackOverflowProtectedSize() - 1);
 
   // Protect the bottom of the stack to prevent read/write to it.
   ProtectStack(/* fatal_on_error= */ true);
@@ -836,7 +831,7 @@
   // Tell the kernel that we won't be needing these pages any more.
   // NB. madvise will probably write zeroes into the memory (on linux it does).
   size_t unwanted_size =
-      reinterpret_cast<uintptr_t>(stack_top) - reinterpret_cast<uintptr_t>(pregion) - kPageSize;
+      reinterpret_cast<uintptr_t>(stack_top) - reinterpret_cast<uintptr_t>(pregion) - gPageSize;
   madvise(pregion, unwanted_size, MADV_DONTNEED);
 }
 
@@ -1345,12 +1340,28 @@
   tlsPtr_.stack_begin = reinterpret_cast<uint8_t*>(read_stack_base);
   tlsPtr_.stack_size = read_stack_size;
 
-  // The minimum stack size we can cope with is the overflow reserved bytes (typically
-  // 8K) + the protected region size (4K) + another page (4K).  Typically this will
-  // be 8+4+4 = 16K.  The thread won't be able to do much with this stack even the GC takes
-  // between 8K and 12K.
-  uint32_t min_stack = GetStackOverflowReservedBytes(kRuntimeISA) + kStackOverflowProtectedSize
-    + 4 * KB;
+  // The minimum stack size we can cope with is the protected region size + stack overflow check
+  // region size + some memory for normal stack usage.
+  //
+  // The protected region is located at the beginning (lowest address) of the stack region.
+  // Therefore, it starts at a page-aligned address. Its size should be a multiple of page sizes.
+  // Typically, it is one page in size, however this varies in some configurations.
+  //
+  // The overflow reserved bytes is size of the stack overflow check region, located right after
+  // the protected region, so also starts at a page-aligned address. The size is discretionary.
+  // Typically it is 8K, but this varies in some configurations.
+  //
+  // The rest of the stack memory is available for normal stack usage. It is located right after
+  // the stack overflow check region, so its starting address isn't necessarily page-aligned. The
+  // size of the region is discretionary, however should be chosen in a way that the overall stack
+  // size is a multiple of page sizes. Historically, it is chosen to be at least 4 KB.
+  //
+  // On systems with 4K page size, typically the minimum stack size will be 4+8+4 = 16K.
+  // The thread won't be able to do much with this stack: even the GC takes between 8K and 12K.
+  DCHECK_ALIGNED_PARAM(static_cast<size_t>(GetStackOverflowProtectedSize()),
+                       static_cast<int32_t>(gPageSize));
+  size_t min_stack = GetStackOverflowProtectedSize() +
+      RoundUp(GetStackOverflowReservedBytes(kRuntimeISA) + 4 * KB, gPageSize);
   if (read_stack_size <= min_stack) {
     // Note, as we know the stack is small, avoid operations that could use a lot of stack.
     LogHelper::LogLineLowStack(__PRETTY_FUNCTION__,
@@ -1380,9 +1391,9 @@
     // to install our own region so we need to move the limits
     // of the stack to make room for it.
 
-    tlsPtr_.stack_begin += read_guard_size + kStackOverflowProtectedSize;
-    tlsPtr_.stack_end += read_guard_size + kStackOverflowProtectedSize;
-    tlsPtr_.stack_size -= read_guard_size + kStackOverflowProtectedSize;
+    tlsPtr_.stack_begin += read_guard_size + GetStackOverflowProtectedSize();
+    tlsPtr_.stack_end += read_guard_size + GetStackOverflowProtectedSize();
+    tlsPtr_.stack_size -= read_guard_size + GetStackOverflowProtectedSize();
 
     InstallImplicitProtection();
   }
@@ -1436,7 +1447,8 @@
 void Thread::GetThreadName(std::string& name) const {
   tls32_.num_name_readers.fetch_add(1, std::memory_order_seq_cst);
   // The store part of the increment has to be ordered with respect to the following load.
-  name.assign(tlsPtr_.name.load(std::memory_order_seq_cst));
+  const char* c_name = tlsPtr_.name.load(std::memory_order_seq_cst);
+  name.assign(c_name == nullptr ? "<no name>" : c_name);
   tls32_.num_name_readers.fetch_sub(1 /* at least memory_order_release */);
 }
 
@@ -1455,7 +1467,7 @@
 }
 
 // Attempt to rectify locks so that we dump thread list with required locks before exiting.
-static void UnsafeLogFatalForSuspendCount(Thread* self, Thread* thread) NO_THREAD_SAFETY_ANALYSIS {
+void Thread::UnsafeLogFatalForSuspendCount(Thread* self, Thread* thread) NO_THREAD_SAFETY_ANALYSIS {
   LOG(ERROR) << *thread << " suspend count already zero.";
   Locks::thread_suspend_count_lock_->Unlock(self);
   if (!Locks::mutator_lock_->IsSharedHeld(self)) {
@@ -1473,141 +1485,65 @@
   std::ostringstream ss;
   Runtime::Current()->GetThreadList()->Dump(ss);
   LOG(FATAL) << ss.str();
+  UNREACHABLE();
 }
 
-bool Thread::ModifySuspendCountInternal(Thread* self,
-                                        int delta,
-                                        AtomicInteger* suspend_barrier,
-                                        SuspendReason reason) {
-  if (kIsDebugBuild) {
-    DCHECK(delta == -1 || delta == +1)
-          << reason << " " << delta << " " << this;
-    Locks::thread_suspend_count_lock_->AssertHeld(self);
-    if (this != self && !IsSuspended()) {
-      Locks::thread_list_lock_->AssertHeld(self);
-    }
-  }
-  // User code suspensions need to be checked more closely since they originate from code outside of
-  // the runtime's control.
-  if (UNLIKELY(reason == SuspendReason::kForUserCode)) {
-    Locks::user_code_suspension_lock_->AssertHeld(self);
-    if (UNLIKELY(delta + tls32_.user_code_suspend_count < 0)) {
-      LOG(ERROR) << "attempting to modify suspend count in an illegal way.";
+bool Thread::PassActiveSuspendBarriers() {
+  DCHECK_EQ(this, Thread::Current());
+  DCHECK_NE(GetState(), ThreadState::kRunnable);
+  // Grab the suspend_count lock and copy the current set of barriers. Then clear the list and the
+  // flag. The IncrementSuspendCount function requires the lock so we prevent a race between setting
+  // the kActiveSuspendBarrier flag and clearing it.
+  // TODO: Consider doing this without the temporary vector. That code will be a bit
+  // tricky, since the WrappedSuspend1Barrier may disappear once the barrier is decremented.
+  std::vector<AtomicInteger*> pass_barriers{};
+  {
+    MutexLock mu(this, *Locks::thread_suspend_count_lock_);
+    if (!ReadFlag(ThreadFlag::kActiveSuspendBarrier)) {
+      // Quick exit test: The barriers have already been claimed - this is possible as there may
+      // be a race to claim and it doesn't matter who wins.  All of the callers of this function
+      // (except SuspendAllInternal) will first test the kActiveSuspendBarrier flag without the
+      // lock. Here we double-check whether the barrier has been passed with the
+      // suspend_count_lock_.
       return false;
     }
-  }
-  if (UNLIKELY(delta < 0 && tls32_.suspend_count <= 0)) {
-    UnsafeLogFatalForSuspendCount(self, this);
-    return false;
-  }
-
-  if (delta > 0 && this != self && tlsPtr_.flip_function != nullptr) {
-    // Force retry of a suspend request if it's in the middle of a thread flip to avoid a
-    // deadlock. b/31683379.
-    return false;
-  }
-
-  uint32_t flags = enum_cast<uint32_t>(ThreadFlag::kSuspendRequest);
-  if (delta > 0 && suspend_barrier != nullptr) {
-    uint32_t available_barrier = kMaxSuspendBarriers;
-    for (uint32_t i = 0; i < kMaxSuspendBarriers; ++i) {
-      if (tlsPtr_.active_suspend_barriers[i] == nullptr) {
-        available_barrier = i;
-        break;
+    if (tlsPtr_.active_suspendall_barrier != nullptr) {
+      // We have at most one active active_suspendall_barrier. See thread.h comment.
+      pass_barriers.push_back(tlsPtr_.active_suspendall_barrier);
+      tlsPtr_.active_suspendall_barrier = nullptr;
+    }
+    for (WrappedSuspend1Barrier* w = tlsPtr_.active_suspend1_barriers; w != nullptr; w = w->next_) {
+      CHECK_EQ(w->magic_, WrappedSuspend1Barrier::kMagic)
+          << "first = " << tlsPtr_.active_suspend1_barriers << " current = " << w
+          << " next = " << w->next_;
+      pass_barriers.push_back(&(w->barrier_));
+    }
+    tlsPtr_.active_suspend1_barriers = nullptr;
+    AtomicClearFlag(ThreadFlag::kActiveSuspendBarrier);
+    CHECK_GT(pass_barriers.size(), 0U);  // Since kActiveSuspendBarrier was set.
+    // Decrement suspend barrier(s) while we still hold the lock, since SuspendThread may
+    // remove and deallocate suspend barriers while holding suspend_count_lock_ .
+    // There will typically only be a single barrier to pass here.
+    for (AtomicInteger*& barrier : pass_barriers) {
+      int32_t old_val = barrier->fetch_sub(1, std::memory_order_release);
+      CHECK_GT(old_val, 0) << "Unexpected value for PassActiveSuspendBarriers(): " << old_val;
+      if (old_val != 1) {
+        // We're done with it.
+        barrier = nullptr;
       }
     }
-    if (available_barrier == kMaxSuspendBarriers) {
-      // No barrier spaces available, we can't add another.
-      return false;
-    }
-    tlsPtr_.active_suspend_barriers[available_barrier] = suspend_barrier;
-    flags |= enum_cast<uint32_t>(ThreadFlag::kActiveSuspendBarrier);
   }
-
-  tls32_.suspend_count += delta;
-  switch (reason) {
-    case SuspendReason::kForUserCode:
-      tls32_.user_code_suspend_count += delta;
-      break;
-    case SuspendReason::kInternal:
-      break;
-  }
-
-  if (tls32_.suspend_count == 0) {
-    AtomicClearFlag(ThreadFlag::kSuspendRequest);
-  } else {
-    // Two bits might be set simultaneously.
-    tls32_.state_and_flags.fetch_or(flags, std::memory_order_seq_cst);
-    TriggerSuspend();
-  }
-  return true;
-}
-
-bool Thread::PassActiveSuspendBarriers(Thread* self) {
-  // Grab the suspend_count lock and copy the current set of
-  // barriers. Then clear the list and the flag. The ModifySuspendCount
-  // function requires the lock so we prevent a race between setting
-  // the kActiveSuspendBarrier flag and clearing it.
-  AtomicInteger* pass_barriers[kMaxSuspendBarriers];
-  {
-    MutexLock mu(self, *Locks::thread_suspend_count_lock_);
-    if (!ReadFlag(ThreadFlag::kActiveSuspendBarrier)) {
-      // quick exit test: the barriers have already been claimed - this is
-      // possible as there may be a race to claim and it doesn't matter
-      // who wins.
-      // All of the callers of this function (except the SuspendAllInternal)
-      // will first test the kActiveSuspendBarrier flag without lock. Here
-      // double-check whether the barrier has been passed with the
-      // suspend_count lock.
-      return false;
-    }
-
-    for (uint32_t i = 0; i < kMaxSuspendBarriers; ++i) {
-      pass_barriers[i] = tlsPtr_.active_suspend_barriers[i];
-      tlsPtr_.active_suspend_barriers[i] = nullptr;
-    }
-    AtomicClearFlag(ThreadFlag::kActiveSuspendBarrier);
-  }
-
-  uint32_t barrier_count = 0;
-  for (uint32_t i = 0; i < kMaxSuspendBarriers; i++) {
-    AtomicInteger* pending_threads = pass_barriers[i];
-    if (pending_threads != nullptr) {
-      bool done = false;
-      do {
-        int32_t cur_val = pending_threads->load(std::memory_order_relaxed);
-        CHECK_GT(cur_val, 0) << "Unexpected value for PassActiveSuspendBarriers(): " << cur_val;
-        // Reduce value by 1.
-        done = pending_threads->CompareAndSetWeakRelaxed(cur_val, cur_val - 1);
+  // Finally do futex_wakes after releasing the lock.
+  for (AtomicInteger* barrier : pass_barriers) {
 #if ART_USE_FUTEXES
-        if (done && (cur_val - 1) == 0) {  // Weak CAS may fail spuriously.
-          futex(pending_threads->Address(), FUTEX_WAKE_PRIVATE, INT_MAX, nullptr, nullptr, 0);
-        }
+    if (barrier != nullptr) {
+      futex(barrier->Address(), FUTEX_WAKE_PRIVATE, INT_MAX, nullptr, nullptr, 0);
+    }
 #endif
-      } while (!done);
-      ++barrier_count;
-    }
   }
-  CHECK_GT(barrier_count, 0U);
   return true;
 }
 
-void Thread::ClearSuspendBarrier(AtomicInteger* target) {
-  CHECK(ReadFlag(ThreadFlag::kActiveSuspendBarrier));
-  bool clear_flag = true;
-  for (uint32_t i = 0; i < kMaxSuspendBarriers; ++i) {
-    AtomicInteger* ptr = tlsPtr_.active_suspend_barriers[i];
-    if (ptr == target) {
-      tlsPtr_.active_suspend_barriers[i] = nullptr;
-    } else if (ptr != nullptr) {
-      clear_flag = false;
-    }
-  }
-  if (LIKELY(clear_flag)) {
-    AtomicClearFlag(ThreadFlag::kActiveSuspendBarrier);
-  }
-}
-
 void Thread::RunCheckpointFunction() {
   DCHECK_EQ(Thread::Current(), this);
   CHECK(!GetStateAndFlags(std::memory_order_relaxed).IsAnyOfFlagsSet(FlipFunctionFlags()));
@@ -1642,28 +1578,26 @@
 }
 
 bool Thread::RequestCheckpoint(Closure* function) {
-  StateAndFlags old_state_and_flags = GetStateAndFlags(std::memory_order_relaxed);
-  if (old_state_and_flags.GetState() != ThreadState::kRunnable) {
-    return false;  // Fail, thread is suspended and so can't run a checkpoint.
-  }
-
-  // We must be runnable to request a checkpoint.
-  DCHECK_EQ(old_state_and_flags.GetState(), ThreadState::kRunnable);
-  StateAndFlags new_state_and_flags = old_state_and_flags;
-  new_state_and_flags.SetFlag(ThreadFlag::kCheckpointRequest);
-  bool success = tls32_.state_and_flags.CompareAndSetStrongSequentiallyConsistent(
-      old_state_and_flags.GetValue(), new_state_and_flags.GetValue());
-  if (success) {
-    // Succeeded setting checkpoint flag, now insert the actual checkpoint.
-    if (tlsPtr_.checkpoint_function == nullptr) {
-      tlsPtr_.checkpoint_function = function;
-    } else {
-      checkpoint_overflow_.push_back(function);
+  bool success;
+  do {
+    StateAndFlags old_state_and_flags = GetStateAndFlags(std::memory_order_relaxed);
+    if (old_state_and_flags.GetState() != ThreadState::kRunnable) {
+      return false;  // Fail, thread is suspended and so can't run a checkpoint.
     }
-    CHECK(ReadFlag(ThreadFlag::kCheckpointRequest));
-    TriggerSuspend();
+    StateAndFlags new_state_and_flags = old_state_and_flags;
+    new_state_and_flags.SetFlag(ThreadFlag::kCheckpointRequest);
+    success = tls32_.state_and_flags.CompareAndSetWeakSequentiallyConsistent(
+        old_state_and_flags.GetValue(), new_state_and_flags.GetValue());
+  } while (!success);
+  // Succeeded setting checkpoint flag, now insert the actual checkpoint.
+  if (tlsPtr_.checkpoint_function == nullptr) {
+    tlsPtr_.checkpoint_function = function;
+  } else {
+    checkpoint_overflow_.push_back(function);
   }
-  return success;
+  DCHECK(ReadFlag(ThreadFlag::kCheckpointRequest));
+  TriggerSuspend();
+  return true;
 }
 
 bool Thread::RequestEmptyCheckpoint() {
@@ -1695,8 +1629,8 @@
     barrier_.Pass(self);
   }
 
-  void Wait(Thread* self, ThreadState suspend_state) {
-    if (suspend_state != ThreadState::kRunnable) {
+  void Wait(Thread* self, ThreadState wait_state) {
+    if (wait_state != ThreadState::kRunnable) {
       barrier_.Increment<Barrier::kDisallowHoldingLocks>(self, 1);
     } else {
       barrier_.Increment<Barrier::kAllowHoldingLocks>(self, 1);
@@ -1709,9 +1643,9 @@
 };
 
 // RequestSynchronousCheckpoint releases the thread_list_lock_ as a part of its execution.
-bool Thread::RequestSynchronousCheckpoint(Closure* function, ThreadState suspend_state) {
+bool Thread::RequestSynchronousCheckpoint(Closure* function, ThreadState wait_state) {
   Thread* self = Thread::Current();
-  if (this == Thread::Current()) {
+  if (this == self) {
     Locks::thread_list_lock_->AssertExclusiveHeld(self);
     // Unlock the tll before running so that the state is the same regardless of thread.
     Locks::thread_list_lock_->ExclusiveUnlock(self);
@@ -1722,213 +1656,297 @@
 
   // The current thread is not this thread.
 
-  if (GetState() == ThreadState::kTerminated) {
-    Locks::thread_list_lock_->ExclusiveUnlock(self);
-    return false;
+  VerifyState();
+
+  Locks::thread_list_lock_->AssertExclusiveHeld(self);
+  // If target "this" thread is runnable, try to schedule a checkpoint. Do some gymnastics to not
+  // hold the suspend-count lock for too long.
+  if (GetState() == ThreadState::kRunnable) {
+    BarrierClosure barrier_closure(function);
+    bool installed = false;
+    {
+      MutexLock mu(self, *Locks::thread_suspend_count_lock_);
+      installed = RequestCheckpoint(&barrier_closure);
+    }
+    if (installed) {
+      // Relinquish the thread-list lock. We should not wait holding any locks. We cannot
+      // reacquire it since we don't know if 'this' hasn't been deleted yet.
+      Locks::thread_list_lock_->ExclusiveUnlock(self);
+      ScopedThreadStateChange sts(self, wait_state);
+      // Wait state can be kRunnable, in which case, for lock ordering purposes, it's as if we ran
+      // the closure ourselves. This means that the target thread should not acquire a pre-mutator
+      // lock without running the checkpoint, and the closure should not acquire a pre-mutator
+      // lock or suspend.
+      barrier_closure.Wait(self, wait_state);
+      return true;
+    }
+    // No longer runnable. Fall-through.
   }
 
-  struct ScopedThreadListLockUnlock {
-    explicit ScopedThreadListLockUnlock(Thread* self_in) RELEASE(*Locks::thread_list_lock_)
-        : self_thread(self_in) {
-      Locks::thread_list_lock_->AssertHeld(self_thread);
-      Locks::thread_list_lock_->Unlock(self_thread);
-    }
-
-    ~ScopedThreadListLockUnlock() ACQUIRE(*Locks::thread_list_lock_) {
-      Locks::thread_list_lock_->AssertNotHeld(self_thread);
-      Locks::thread_list_lock_->Lock(self_thread);
-    }
-
-    Thread* self_thread;
-  };
-
-  for (;;) {
-    Locks::thread_list_lock_->AssertExclusiveHeld(self);
-    // If this thread is runnable, try to schedule a checkpoint. Do some gymnastics to not hold the
-    // suspend-count lock for too long.
-    if (GetState() == ThreadState::kRunnable) {
-      BarrierClosure barrier_closure(function);
-      bool installed = false;
-      {
-        MutexLock mu(self, *Locks::thread_suspend_count_lock_);
-        installed = RequestCheckpoint(&barrier_closure);
-      }
-      if (installed) {
-        // Relinquish the thread-list lock. We should not wait holding any locks. We cannot
-        // reacquire it since we don't know if 'this' hasn't been deleted yet.
-        Locks::thread_list_lock_->ExclusiveUnlock(self);
-        ScopedThreadStateChange sts(self, suspend_state);
-        barrier_closure.Wait(self, suspend_state);
-        return true;
-      }
-      // Fall-through.
-    }
-
-    // This thread is not runnable, make sure we stay suspended, then run the checkpoint.
-    // Note: ModifySuspendCountInternal also expects the thread_list_lock to be held in
-    //       certain situations.
-    {
-      MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
-
-      if (!ModifySuspendCount(self, +1, nullptr, SuspendReason::kInternal)) {
-        // Just retry the loop.
-        sched_yield();
-        continue;
-      }
-    }
+  // Target "this" thread was not runnable. Suspend it, hopefully redundantly,
+  // but it might have become runnable in the meantime.
+  // Although this is a thread suspension, the target thread only blocks while we run the
+  // checkpoint, which is presumed to terminate quickly even if other threads are blocked.
+  // Note: IncrementSuspendCount also expects the thread_list_lock to be held unless this == self.
+  WrappedSuspend1Barrier wrapped_barrier{};
+  {
+    bool is_suspended = false;
 
     {
-      // Release for the wait. The suspension will keep us from being deleted. Reacquire after so
-      // that we can call ModifySuspendCount without racing against ThreadList::Unregister.
-      ScopedThreadListLockUnlock stllu(self);
-      {
-        ScopedThreadStateChange sts(self, suspend_state);
-        while (GetState() == ThreadState::kRunnable) {
-          // We became runnable again. Wait till the suspend triggered in ModifySuspendCount
-          // moves us to suspended.
-          sched_yield();
+      MutexLock suspend_count_mu(self, *Locks::thread_suspend_count_lock_);
+      // If wait_state is kRunnable, function may not suspend. We thus never block because
+      // we ourselves are being asked to suspend.
+      if (UNLIKELY(wait_state != ThreadState::kRunnable && self->GetSuspendCount() != 0)) {
+        // We are being asked to suspend while we are suspending another thread that may be
+        // responsible for our suspension. This is likely to result in deadlock if we each
+        // block on the suspension request. Instead we wait for the situation to change.
+        ThreadExitFlag target_status;
+        NotifyOnThreadExit(&target_status);
+        for (int iter_count = 1; self->GetSuspendCount() != 0; ++iter_count) {
+          Locks::thread_suspend_count_lock_->ExclusiveUnlock(self);
+          Locks::thread_list_lock_->ExclusiveUnlock(self);
+          {
+            ScopedThreadStateChange sts(self, wait_state);
+            usleep(ThreadList::kThreadSuspendSleepUs);
+          }
+          CHECK_LT(iter_count, ThreadList::kMaxSuspendRetries);
+          Locks::thread_list_lock_->ExclusiveLock(self);
+          if (target_status.HasExited()) {
+            Locks::thread_list_lock_->ExclusiveUnlock(self);
+            DCheckUnregisteredEverywhere(&target_status, &target_status);
+            return false;
+          }
+          Locks::thread_suspend_count_lock_->ExclusiveLock(self);
         }
+        UnregisterThreadExitFlag(&target_status);
       }
-      // Ensure that the flip function for this thread, if pending, is finished *before*
-      // the checkpoint function is run. Otherwise, we may end up with both `to' and 'from'
-      // space references on the stack, confusing the GC's thread-flip logic. The caller is
-      // runnable so can't have a pending flip function.
-      DCHECK_EQ(self->GetState(), ThreadState::kRunnable);
-      DCHECK(
-          !self->GetStateAndFlags(std::memory_order_relaxed).IsAnyOfFlagsSet(FlipFunctionFlags()));
-      EnsureFlipFunctionStarted(self);
-      while (GetStateAndFlags(std::memory_order_acquire).IsAnyOfFlagsSet(FlipFunctionFlags())) {
-        usleep(kSuspendTimeDuringFlip);
+      IncrementSuspendCount(self, nullptr, &wrapped_barrier, SuspendReason::kInternal);
+      VerifyState();
+      DCHECK_GT(GetSuspendCount(), 0);
+      if (wait_state != ThreadState::kRunnable) {
+        DCHECK_EQ(self->GetSuspendCount(), 0);
       }
-
-      function->Run(this);
+      // Since we've incremented the suspend count, "this" thread can no longer disappear.
+      Locks::thread_list_lock_->ExclusiveUnlock(self);
+      if (IsSuspended()) {
+        // See the discussion in mutator_gc_coord.md and SuspendAllInternal for the race here.
+        RemoveFirstSuspend1Barrier(&wrapped_barrier);
+        if (!HasActiveSuspendBarrier()) {
+          AtomicClearFlag(ThreadFlag::kActiveSuspendBarrier);
+        }
+        is_suspended = true;
+      }
+    }
+    if (!is_suspended) {
+      // This waits while holding the mutator lock. Effectively `self` becomes
+      // impossible to suspend until `this` responds to the suspend request.
+      // Arguably that's not making anything qualitatively worse.
+      bool success = !Runtime::Current()
+                          ->GetThreadList()
+                          ->WaitForSuspendBarrier(&wrapped_barrier.barrier_)
+                          .has_value();
+      CHECK(success);
     }
 
-    {
-      MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
-
-      DCHECK_NE(GetState(), ThreadState::kRunnable);
-      bool updated = ModifySuspendCount(self, -1, nullptr, SuspendReason::kInternal);
-      DCHECK(updated);
-      // Imitate ResumeAll, the thread may be waiting on Thread::resume_cond_ since we raised its
-      // suspend count. Now the suspend_count_ is lowered so we must do the broadcast.
-      Thread::resume_cond_->Broadcast(self);
+    // Ensure that the flip function for this thread, if pending, is finished *before*
+    // the checkpoint function is run. Otherwise, we may end up with both `to' and 'from'
+    // space references on the stack, confusing the GC's thread-flip logic. The caller is
+    // runnable so can't have a pending flip function.
+    DCHECK_EQ(self->GetState(), ThreadState::kRunnable);
+    DCHECK(IsSuspended());
+    DCHECK(!self->GetStateAndFlags(std::memory_order_relaxed).IsAnyOfFlagsSet(FlipFunctionFlags()));
+    EnsureFlipFunctionStarted(self, this);
+    // Since we're runnable, and kPendingFlipFunction is set with all threads suspended, it
+    // cannot be set again here. Thus kRunningFlipFunction is either already set after the
+    // EnsureFlipFunctionStarted call, or will not be set before we call Run().
+    if (ReadFlag(ThreadFlag::kRunningFlipFunction)) {
+      WaitForFlipFunction(self);
     }
-
-    // Release the thread_list_lock_ to be consistent with the barrier-closure path.
-    Locks::thread_list_lock_->ExclusiveUnlock(self);
-
-    return true;  // We're done, break out of the loop.
+    function->Run(this);
   }
+
+  {
+    MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
+    DCHECK_NE(GetState(), ThreadState::kRunnable);
+    DCHECK_GT(GetSuspendCount(), 0);
+    DecrementSuspendCount(self);
+    if (kIsDebugBuild) {
+      CheckBarrierInactive(&wrapped_barrier);
+    }
+    resume_cond_->Broadcast(self);
+  }
+
+  Locks::thread_list_lock_->AssertNotHeld(self);
+  return true;
 }
 
 void Thread::SetFlipFunction(Closure* function) {
   // This is called with all threads suspended, except for the calling thread.
   DCHECK(IsSuspended() || Thread::Current() == this);
   DCHECK(function != nullptr);
-  DCHECK(tlsPtr_.flip_function == nullptr);
-  tlsPtr_.flip_function = function;
+  DCHECK(GetFlipFunction() == nullptr);
+  tlsPtr_.flip_function.store(function, std::memory_order_relaxed);
   DCHECK(!GetStateAndFlags(std::memory_order_relaxed).IsAnyOfFlagsSet(FlipFunctionFlags()));
   AtomicSetFlag(ThreadFlag::kPendingFlipFunction, std::memory_order_release);
 }
 
-bool Thread::EnsureFlipFunctionStarted(Thread* self, StateAndFlags old_state_and_flags) {
+bool Thread::EnsureFlipFunctionStarted(Thread* self,
+                                       Thread* target,
+                                       StateAndFlags old_state_and_flags,
+                                       ThreadExitFlag* tef,
+                                       bool* finished) {
+  //  Note: If tef is non-null, *target may have been destroyed. We have to be careful about
+  //  accessing it. That is the reason this is static and not a member function.
+  DCHECK(self == Current());
+  bool check_exited = (tef != nullptr);
+  // Check that the thread can't unexpectedly exit while we are running.
+  DCHECK(self == target || check_exited || target->ReadFlag(ThreadFlag::kSuspendRequest) ||
+         Locks::thread_list_lock_->IsExclusiveHeld(self))
+      << *target;
   bool become_runnable;
+  auto maybe_release = [=]() NO_THREAD_SAFETY_ANALYSIS /* conditionally unlocks */ {
+    if (check_exited) {
+      Locks::thread_list_lock_->Unlock(self);
+    }
+  };
+  auto set_finished = [=](bool value) {
+    if (finished != nullptr) {
+      *finished = value;
+    }
+  };
+
+  if (check_exited) {
+    Locks::thread_list_lock_->Lock(self);
+    if (tef->HasExited()) {
+      Locks::thread_list_lock_->Unlock(self);
+      set_finished(true);
+      return false;
+    }
+  }
+  target->VerifyState();
   if (old_state_and_flags.GetValue() == 0) {
     become_runnable = false;
-    old_state_and_flags = GetStateAndFlags(std::memory_order_relaxed);
+    old_state_and_flags = target->GetStateAndFlags(std::memory_order_relaxed);
   } else {
     become_runnable = true;
+    DCHECK(!check_exited);
+    DCHECK(target == self);
+    DCHECK(old_state_and_flags.IsFlagSet(ThreadFlag::kPendingFlipFunction));
     DCHECK(!old_state_and_flags.IsFlagSet(ThreadFlag::kSuspendRequest));
   }
-
-  while (old_state_and_flags.IsFlagSet(ThreadFlag::kPendingFlipFunction)) {
+  while (true) {
+    DCHECK(!check_exited || (Locks::thread_list_lock_->IsExclusiveHeld(self) && !tef->HasExited()));
+    if (!old_state_and_flags.IsFlagSet(ThreadFlag::kPendingFlipFunction)) {
+      maybe_release();
+      set_finished(!old_state_and_flags.IsFlagSet(ThreadFlag::kRunningFlipFunction));
+      return false;
+    }
     DCHECK(!old_state_and_flags.IsFlagSet(ThreadFlag::kRunningFlipFunction));
     StateAndFlags new_state_and_flags =
         old_state_and_flags.WithFlag(ThreadFlag::kRunningFlipFunction)
                            .WithoutFlag(ThreadFlag::kPendingFlipFunction);
     if (become_runnable) {
-      DCHECK_EQ(self, this);
+      DCHECK_EQ(self, target);
       DCHECK_NE(self->GetState(), ThreadState::kRunnable);
       new_state_and_flags = new_state_and_flags.WithState(ThreadState::kRunnable);
     }
-    if (tls32_.state_and_flags.CompareAndSetWeakAcquire(old_state_and_flags.GetValue(),
-                                                        new_state_and_flags.GetValue())) {
+    if (target->tls32_.state_and_flags.CompareAndSetWeakAcquire(old_state_and_flags.GetValue(),
+                                                                new_state_and_flags.GetValue())) {
       if (become_runnable) {
-        GetMutatorLock()->TransitionFromSuspendedToRunnable(this);
+        self->GetMutatorLock()->TransitionFromSuspendedToRunnable(self);
       }
       art::Locks::mutator_lock_->AssertSharedHeld(self);
-      RunFlipFunction(self, /*notify=*/ true);
-      DCHECK(!GetStateAndFlags(std::memory_order_relaxed).IsAnyOfFlagsSet(FlipFunctionFlags()));
-      return true;
-    } else {
-      old_state_and_flags = GetStateAndFlags(std::memory_order_relaxed);
-      if (become_runnable && old_state_and_flags.IsFlagSet(ThreadFlag::kSuspendRequest)) {
-        break;
-      }
+      maybe_release();
+      // Thread will not go away while kRunningFlipFunction is set.
+      target->RunFlipFunction(self);
+      // At this point, no flip function flags should be set. It's unsafe to DCHECK that, since
+      // the thread may now have exited.
+      set_finished(true);
+      return become_runnable;
     }
+    if (become_runnable) {
+      DCHECK(!check_exited);  // We didn't acquire thread_list_lock_ .
+      // Let caller retry.
+      return false;
+    }
+    old_state_and_flags = target->GetStateAndFlags(std::memory_order_acquire);
   }
-  return false;
+  // Unreachable.
 }
 
-void Thread::RunFlipFunction(Thread* self, bool notify) {
-  // This function is called for suspended threads and by the thread running
-  // `ThreadList::FlipThreadRoots()` after we've successfully set the flag
-  // `ThreadFlag::kRunningFlipFunction`. This flag is not set if the thread is
-  // running the flip function right after transitioning to Runnable as
-  // no other thread may run checkpoints on a thread that's actually Runnable.
-  DCHECK_EQ(notify, ReadFlag(ThreadFlag::kRunningFlipFunction));
+void Thread::RunFlipFunction(Thread* self) {
+  // This function is called either by the thread running `ThreadList::FlipThreadRoots()` or when
+  // a thread becomes runnable, after we've successfully set the kRunningFlipFunction ThreadFlag.
+  DCHECK(ReadFlag(ThreadFlag::kRunningFlipFunction));
 
-  Closure* flip_function = tlsPtr_.flip_function;
-  tlsPtr_.flip_function = nullptr;
+  Closure* flip_function = GetFlipFunction();
+  tlsPtr_.flip_function.store(nullptr, std::memory_order_relaxed);
   DCHECK(flip_function != nullptr);
+  VerifyState();
   flip_function->Run(this);
+  DCHECK(!ReadFlag(ThreadFlag::kPendingFlipFunction));
+  VerifyState();
+  AtomicClearFlag(ThreadFlag::kRunningFlipFunction, std::memory_order_release);
+  // From here on this thread may go away, and it is no longer safe to access.
 
-  if (notify) {
-    // Clear the `ThreadFlag::kRunningFlipFunction` and `ThreadFlag::kWaitingForFlipFunction`.
-    // Check if the latter was actually set, indicating that there is at least one waiting thread.
-    constexpr uint32_t kFlagsToClear = enum_cast<uint32_t>(ThreadFlag::kRunningFlipFunction) |
-                                       enum_cast<uint32_t>(ThreadFlag::kWaitingForFlipFunction);
-    StateAndFlags old_state_and_flags(
-        tls32_.state_and_flags.fetch_and(~kFlagsToClear, std::memory_order_release));
-    if (old_state_and_flags.IsFlagSet(ThreadFlag::kWaitingForFlipFunction)) {
-      // Notify all threads that are waiting for completion (at least one).
-      // TODO: Should we create a separate mutex and condition variable instead
-      // of piggy-backing on the `thread_suspend_count_lock_` and `resume_cond_`?
-      MutexLock mu(self, *Locks::thread_suspend_count_lock_);
-      resume_cond_->Broadcast(self);
-    }
-  }
+  // Notify all threads that are waiting for completion.
+  // TODO: Should we create a separate mutex and condition variable instead
+  // of piggy-backing on the `thread_suspend_count_lock_` and `resume_cond_`?
+  MutexLock mu(self, *Locks::thread_suspend_count_lock_);
+  resume_cond_->Broadcast(self);
 }
 
-void Thread::WaitForFlipFunction(Thread* self) {
+void Thread::WaitForFlipFunction(Thread* self) const {
   // Another thread is running the flip function. Wait for it to complete.
   // Check the flag while holding the mutex so that we do not miss the broadcast.
   // Repeat the check after waiting to guard against spurious wakeups (and because
   // we share the `thread_suspend_count_lock_` and `resume_cond_` with other code).
+  // Check that the thread can't unexpectedly exit while we are running.
+  DCHECK(self == this || ReadFlag(ThreadFlag::kSuspendRequest) ||
+         Locks::thread_list_lock_->IsExclusiveHeld(self));
   MutexLock mu(self, *Locks::thread_suspend_count_lock_);
   while (true) {
     StateAndFlags old_state_and_flags = GetStateAndFlags(std::memory_order_acquire);
-    DCHECK(!old_state_and_flags.IsFlagSet(ThreadFlag::kPendingFlipFunction));
     if (!old_state_and_flags.IsFlagSet(ThreadFlag::kRunningFlipFunction)) {
-      DCHECK(!old_state_and_flags.IsAnyOfFlagsSet(FlipFunctionFlags()));
-      break;
+      return;
     }
-    if (!old_state_and_flags.IsFlagSet(ThreadFlag::kWaitingForFlipFunction)) {
-      // Mark that there is a waiting thread.
-      StateAndFlags new_state_and_flags =
-          old_state_and_flags.WithFlag(ThreadFlag::kWaitingForFlipFunction);
-      if (!tls32_.state_and_flags.CompareAndSetWeakRelaxed(old_state_and_flags.GetValue(),
-                                                           new_state_and_flags.GetValue())) {
-        continue;  // Retry.
-      }
+    // We sometimes hold mutator lock here. OK since the flip function must complete quickly.
+    resume_cond_->WaitHoldingLocks(self);
+  }
+}
+
+void Thread::WaitForFlipFunctionTestingExited(Thread* self, ThreadExitFlag* tef) {
+  Locks::thread_list_lock_->Lock(self);
+  if (tef->HasExited()) {
+    Locks::thread_list_lock_->Unlock(self);
+    return;
+  }
+  // We need to hold suspend_count_lock_ to avoid missed wakeups when the flip function finishes.
+  // We need to hold thread_list_lock_ because the tef test result is only valid while we hold the
+  // lock, and once kRunningFlipFunction is no longer set, "this" may be deallocated. Hence the
+  // complicated locking dance.
+  MutexLock mu(self, *Locks::thread_suspend_count_lock_);
+  while (true) {
+    StateAndFlags old_state_and_flags = GetStateAndFlags(std::memory_order_acquire);
+    Locks::thread_list_lock_->Unlock(self);  // So we can wait or return.
+    if (!old_state_and_flags.IsFlagSet(ThreadFlag::kRunningFlipFunction)) {
+      return;
     }
-    resume_cond_->Wait(self);
+    resume_cond_->WaitHoldingLocks(self);
+    Locks::thread_suspend_count_lock_->Unlock(self);  // To re-lock thread_list_lock.
+    Locks::thread_list_lock_->Lock(self);
+    Locks::thread_suspend_count_lock_->Lock(self);
+    if (tef->HasExited()) {
+      Locks::thread_list_lock_->Unlock(self);
+      return;
+    }
   }
 }
 
 void Thread::FullSuspendCheck(bool implicit) {
   ScopedTrace trace(__FUNCTION__);
+  DCHECK(!ReadFlag(ThreadFlag::kSuspensionImmune));
+  DCHECK(this == Thread::Current());
   VLOG(threads) << this << " self-suspending";
   // Make thread appear suspended to other threads, release mutator_lock_.
   // Transition to suspended and back to runnable, re-acquire share on mutator_lock_.
@@ -2150,8 +2168,7 @@
 
   static constexpr size_t kMaxRepetition = 3u;
 
-  VisitMethodResult StartMethod(ArtMethod* m, size_t frame_nr ATTRIBUTE_UNUSED)
-      override
+  VisitMethodResult StartMethod(ArtMethod* m, [[maybe_unused]] size_t frame_nr) override
       REQUIRES_SHARED(Locks::mutator_lock_) {
     m = m->GetInterfaceMethodIfProxy(kRuntimePointerSize);
     ObjPtr<mirror::DexCache> dex_cache = m->GetDexCache();
@@ -2196,12 +2213,11 @@
     return VisitMethodResult::kContinueMethod;
   }
 
-  VisitMethodResult EndMethod(ArtMethod* m ATTRIBUTE_UNUSED) override {
+  VisitMethodResult EndMethod([[maybe_unused]] ArtMethod* m) override {
     return VisitMethodResult::kContinueMethod;
   }
 
-  void VisitWaitingObject(ObjPtr<mirror::Object> obj, ThreadState state ATTRIBUTE_UNUSED)
-      override
+  void VisitWaitingObject(ObjPtr<mirror::Object> obj, [[maybe_unused]] ThreadState state) override
       REQUIRES_SHARED(Locks::mutator_lock_) {
     PrintObject(obj, "  - waiting on ", ThreadList::kInvalidThreadId);
   }
@@ -2245,19 +2261,27 @@
     if (obj == nullptr) {
       os << msg << "an unknown object";
     } else {
-      if ((obj->GetLockWord(true).GetState() == LockWord::kThinLocked) &&
-          Locks::mutator_lock_->IsExclusiveHeld(Thread::Current())) {
-        // Getting the identity hashcode here would result in lock inflation and suspension of the
-        // current thread, which isn't safe if this is the only runnable thread.
-        os << msg << StringPrintf("<@addr=0x%" PRIxPTR "> (a %s)",
-                                  reinterpret_cast<intptr_t>(obj.Ptr()),
-                                  obj->PrettyTypeOf().c_str());
+      const std::string pretty_type(obj->PrettyTypeOf());
+      // It's often unsafe to allow lock inflation here. We may be the only runnable thread, or
+      // this may be called from a checkpoint. We get the hashcode on a best effort basis.
+      static constexpr int kNumRetries = 3;
+      static constexpr int kSleepMicros = 10;
+      int32_t hash_code;
+      for (int i = 0;; ++i) {
+        hash_code = obj->IdentityHashCodeNoInflation();
+        if (hash_code != 0 || i == kNumRetries) {
+          break;
+        }
+        usleep(kSleepMicros);
+      }
+      if (hash_code == 0) {
+        os << msg
+           << StringPrintf("<@addr=0x%" PRIxPTR "> (a %s)",
+                           reinterpret_cast<intptr_t>(obj.Ptr()),
+                           pretty_type.c_str());
       } else {
-        // - waiting on <0x6008c468> (a java.lang.Class<java.lang.ref.ReferenceQueue>)
-        // Call PrettyTypeOf before IdentityHashCode since IdentityHashCode can cause thread
-        // suspension and move pretty_object.
-        const std::string pretty_type(obj->PrettyTypeOf());
-        os << msg << StringPrintf("<0x%08x> (a %s)", obj->IdentityHashCode(), pretty_type.c_str());
+        // - waiting on <0x608c468> (a java.lang.Class<java.lang.ref.ReferenceQueue>)
+        os << msg << StringPrintf("<0x%08x> (a %s)", hash_code, pretty_type.c_str());
       }
     }
     if (owner_tid != ThreadList::kInvalidThreadId) {
@@ -2350,6 +2374,7 @@
   }
   DumpOrder dump_order = DumpOrder::kDefault;
   if (safe_to_dump || force_dump_stack) {
+    uint64_t nanotime = NanoTime();
     // If we're currently in native code, dump that stack before dumping the managed stack.
     if (dump_native_stack && (dump_for_abort || force_dump_stack || ShouldShowNativeStack(this))) {
       ArtMethod* method =
@@ -2361,6 +2386,11 @@
     dump_order = DumpJavaStack(os,
                                /*check_suspended=*/ !force_dump_stack,
                                /*dump_locks=*/ !force_dump_stack);
+    Runtime* runtime = Runtime::Current();
+    std::optional<uint64_t> start = runtime != nullptr ? runtime->SiqQuitNanoTime() : std::nullopt;
+    if (start.has_value()) {
+      os << "DumpLatencyMs: " << static_cast<float>(nanotime - start.value()) / 1000000.0 << "\n";
+    }
   } else {
     os << "Not able to dump stack of thread that isn't suspended";
   }
@@ -2455,6 +2485,21 @@
       soa.Self(), thread_group_object, thread_object);
 }
 
+void Thread::SignalExitFlags() {
+  ThreadExitFlag* next;
+  for (ThreadExitFlag* tef = tlsPtr_.thread_exit_flags; tef != nullptr; tef = next) {
+    DCHECK(!tef->exited_);
+    tef->exited_ = true;
+    next = tef->next_;
+    if (kIsDebugBuild) {
+      ThreadExitFlag* const garbage_tef = reinterpret_cast<ThreadExitFlag*>(1);
+      // Link fields should no longer be used.
+      tef->prev_ = tef->next_ = garbage_tef;
+    }
+  }
+  tlsPtr_.thread_exit_flags = nullptr;  // Now unused.
+}
+
 Thread::Thread(bool daemon)
     : tls32_(daemon),
       wait_monitor_(nullptr),
@@ -2464,6 +2509,7 @@
   tlsPtr_.mutator_lock = Locks::mutator_lock_;
   DCHECK(tlsPtr_.mutator_lock != nullptr);
   tlsPtr_.name.store(kThreadNameDuringStartup, std::memory_order_relaxed);
+  CHECK_NE(GetStackOverflowProtectedSize(), 0u);
 
   static_assert((sizeof(Thread) % 4) == 0U,
                 "art::Thread has a size which is not a multiple of 4.");
@@ -2479,12 +2525,10 @@
             tlsPtr_.rosalloc_runs + kNumRosAllocThreadLocalSizeBracketsInThread,
             gc::allocator::RosAlloc::GetDedicatedFullRun());
   tlsPtr_.checkpoint_function = nullptr;
-  for (uint32_t i = 0; i < kMaxSuspendBarriers; ++i) {
-    tlsPtr_.active_suspend_barriers[i] = nullptr;
-  }
-  tlsPtr_.flip_function = nullptr;
+  tlsPtr_.active_suspendall_barrier = nullptr;
+  tlsPtr_.active_suspend1_barriers = nullptr;
+  tlsPtr_.flip_function.store(nullptr, std::memory_order_relaxed);
   tlsPtr_.thread_local_mark_stack = nullptr;
-  tls32_.is_transitioning_to_runnable = false;
   ResetTlab();
 }
 
@@ -2533,8 +2577,8 @@
   explicit MonitorExitVisitor(Thread* self) : self_(self) { }
 
   // NO_THREAD_SAFETY_ANALYSIS due to MonitorExit.
-  void VisitRoot(mirror::Object* entered_monitor, const RootInfo& info ATTRIBUTE_UNUSED)
-      override NO_THREAD_SAFETY_ANALYSIS {
+  void VisitRoot(mirror::Object* entered_monitor,
+                 [[maybe_unused]] const RootInfo& info) override NO_THREAD_SAFETY_ANALYSIS {
     if (self_->HoldsLock(entered_monitor)) {
       LOG(WARNING) << "Calling MonitorExit on object "
                    << entered_monitor << " (" << entered_monitor->PrettyTypeOf() << ")"
@@ -2573,10 +2617,6 @@
 
   if (tlsPtr_.opeer != nullptr) {
     ScopedObjectAccess soa(self);
-    if (UNLIKELY(self->GetMethodTraceBuffer() != nullptr)) {
-      Trace::FlushThreadBuffer(self);
-      self->ResetMethodTraceBuffer();
-    }
     // We may need to call user-supplied managed code, do this before final clean-up.
     HandleUncaughtExceptions();
     RemoveFromThreadGroup();
@@ -2599,12 +2639,17 @@
       ObjectLock<mirror::Object> locker(self, h_obj);
       locker.NotifyAll();
     }
+
     tlsPtr_.opeer = nullptr;
   }
 
   {
     ScopedObjectAccess soa(self);
     Runtime::Current()->GetHeap()->RevokeThreadLocalBuffers(this);
+
+    if (UNLIKELY(self->GetMethodTraceBuffer() != nullptr)) {
+      Trace::FlushThreadBuffer(self);
+    }
   }
   // Mark-stack revocation must be performed at the very end. No
   // checkpoint/flip-function or read-barrier should be called after this.
@@ -2625,10 +2670,11 @@
   CHECK_NE(GetState(), ThreadState::kRunnable);
   CHECK(!ReadFlag(ThreadFlag::kCheckpointRequest));
   CHECK(!ReadFlag(ThreadFlag::kEmptyCheckpointRequest));
+  CHECK(!ReadFlag(ThreadFlag::kSuspensionImmune));
   CHECK(tlsPtr_.checkpoint_function == nullptr);
   CHECK_EQ(checkpoint_overflow_.size(), 0u);
-  CHECK(tlsPtr_.flip_function == nullptr);
-  CHECK_EQ(tls32_.is_transitioning_to_runnable, false);
+  // A pending flip function request is OK. FlipThreadRoots will have been notified that we
+  // exited, and nobody will attempt to process the request.
 
   // Make sure we processed all deoptimization requests.
   CHECK(tlsPtr_.deoptimization_context_stack == nullptr) << "Missed deoptimization";
@@ -2652,9 +2698,7 @@
   SetCachedThreadName(nullptr);  // Deallocate name.
   delete tlsPtr_.deps_or_stack_trace_sample.stack_trace_sample;
 
-  if (tlsPtr_.method_trace_buffer != nullptr) {
-    delete[] tlsPtr_.method_trace_buffer;
-  }
+  CHECK_EQ(tlsPtr_.method_trace_buffer, nullptr);
 
   Runtime::Current()->GetHeap()->AssertThreadLocalBuffersAreRevoked(this);
 
@@ -3347,8 +3391,7 @@
           soaa_(soaa_in) {}
 
    protected:
-    VisitMethodResult StartMethod(ArtMethod* m, size_t frame_nr ATTRIBUTE_UNUSED)
-        override
+    VisitMethodResult StartMethod(ArtMethod* m, [[maybe_unused]] size_t frame_nr) override
         REQUIRES_SHARED(Locks::mutator_lock_) {
       ObjPtr<mirror::StackTraceElement> obj = CreateStackTraceElement(
           soaa_, m, GetDexPc(/* abort on error */ false));
@@ -3359,7 +3402,7 @@
       return VisitMethodResult::kContinueMethod;
     }
 
-    VisitMethodResult EndMethod(ArtMethod* m ATTRIBUTE_UNUSED) override {
+    VisitMethodResult EndMethod([[maybe_unused]] ArtMethod* m) override {
       lock_objects_.push_back({});
       lock_objects_[lock_objects_.size() - 1].swap(frame_lock_objects_);
 
@@ -3368,8 +3411,7 @@
       return VisitMethodResult::kContinueMethod;
     }
 
-    void VisitWaitingObject(ObjPtr<mirror::Object> obj, ThreadState state ATTRIBUTE_UNUSED)
-        override
+    void VisitWaitingObject(ObjPtr<mirror::Object> obj, [[maybe_unused]] ThreadState state) override
         REQUIRES_SHARED(Locks::mutator_lock_) {
       wait_jobject_.reset(soaa_.AddLocalReference<jobject>(obj));
     }
@@ -3379,9 +3421,8 @@
       wait_jobject_.reset(soaa_.AddLocalReference<jobject>(obj));
     }
     void VisitBlockedOnObject(ObjPtr<mirror::Object> obj,
-                              ThreadState state ATTRIBUTE_UNUSED,
-                              uint32_t owner_tid ATTRIBUTE_UNUSED)
-        override
+                              [[maybe_unused]] ThreadState state,
+                              [[maybe_unused]] uint32_t owner_tid) override
         REQUIRES_SHARED(Locks::mutator_lock_) {
       block_jobject_.reset(soaa_.AddLocalReference<jobject>(obj));
     }
@@ -4273,26 +4314,23 @@
 
   void VisitQuickFrameNonPrecise() REQUIRES_SHARED(Locks::mutator_lock_) {
     struct UndefinedVRegInfo {
-      UndefinedVRegInfo(ArtMethod* method ATTRIBUTE_UNUSED,
-                        const CodeInfo& code_info ATTRIBUTE_UNUSED,
-                        const StackMap& map ATTRIBUTE_UNUSED,
+      UndefinedVRegInfo([[maybe_unused]] ArtMethod* method,
+                        [[maybe_unused]] const CodeInfo& code_info,
+                        [[maybe_unused]] const StackMap& map,
                         RootVisitor& _visitor)
-          : visitor(_visitor) {
-      }
+          : visitor(_visitor) {}
 
       ALWAYS_INLINE
       void VisitStack(mirror::Object** ref,
-                      size_t stack_index ATTRIBUTE_UNUSED,
-                      const StackVisitor* stack_visitor)
-          REQUIRES_SHARED(Locks::mutator_lock_) {
+                      [[maybe_unused]] size_t stack_index,
+                      const StackVisitor* stack_visitor) REQUIRES_SHARED(Locks::mutator_lock_) {
         visitor(ref, JavaFrameRootInfo::kImpreciseVreg, stack_visitor);
       }
 
       ALWAYS_INLINE
       void VisitRegister(mirror::Object** ref,
-                         size_t register_index ATTRIBUTE_UNUSED,
-                         const StackVisitor* stack_visitor)
-          REQUIRES_SHARED(Locks::mutator_lock_) {
+                         [[maybe_unused]] size_t register_index,
+                         const StackVisitor* stack_visitor) REQUIRES_SHARED(Locks::mutator_lock_) {
         visitor(ref, JavaFrameRootInfo::kImpreciseVreg, stack_visitor);
       }
 
@@ -4443,9 +4481,6 @@
       mapper.VisitShadowFrame(record->GetShadowFrame());
     }
   }
-  for (auto* verifier = tlsPtr_.method_verifier; verifier != nullptr; verifier = verifier->link_) {
-    verifier->VisitRoots(visitor, RootInfo(kRootNativeStack, thread_id));
-  }
   // Visit roots on this thread's stack
   RuntimeContextType context;
   RootCallbackVisitor visitor_to_callback(visitor, thread_id);
@@ -4543,8 +4578,8 @@
 
 class VerifyRootVisitor : public SingleRootVisitor {
  public:
-  void VisitRoot(mirror::Object* root, const RootInfo& info ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(Locks::mutator_lock_) {
+  void VisitRoot(mirror::Object* root, [[maybe_unused]] const RootInfo& info) override
+      REQUIRES_SHARED(Locks::mutator_lock_) {
     VerifyObject(root);
   }
 };
@@ -4629,14 +4664,14 @@
 }
 
 bool Thread::ProtectStack(bool fatal_on_error) {
-  void* pregion = tlsPtr_.stack_begin - kStackOverflowProtectedSize;
+  void* pregion = tlsPtr_.stack_begin - GetStackOverflowProtectedSize();
   VLOG(threads) << "Protecting stack at " << pregion;
-  if (mprotect(pregion, kStackOverflowProtectedSize, PROT_NONE) == -1) {
+  if (mprotect(pregion, GetStackOverflowProtectedSize(), PROT_NONE) == -1) {
     if (fatal_on_error) {
       // b/249586057, LOG(FATAL) times out
       LOG(ERROR) << "Unable to create protected region in stack for implicit overflow check. "
           "Reason: "
-          << strerror(errno) << " size:  " << kStackOverflowProtectedSize;
+          << strerror(errno) << " size:  " << GetStackOverflowProtectedSize();
       exit(1);
     }
     return false;
@@ -4645,19 +4680,9 @@
 }
 
 bool Thread::UnprotectStack() {
-  void* pregion = tlsPtr_.stack_begin - kStackOverflowProtectedSize;
+  void* pregion = tlsPtr_.stack_begin - GetStackOverflowProtectedSize();
   VLOG(threads) << "Unprotecting stack at " << pregion;
-  return mprotect(pregion, kStackOverflowProtectedSize, PROT_READ|PROT_WRITE) == 0;
-}
-
-void Thread::PushVerifier(verifier::MethodVerifier* verifier) {
-  verifier->link_ = tlsPtr_.method_verifier;
-  tlsPtr_.method_verifier = verifier;
-}
-
-void Thread::PopVerifier(verifier::MethodVerifier* verifier) {
-  CHECK_EQ(tlsPtr_.method_verifier, verifier);
-  tlsPtr_.method_verifier = verifier->link_;
+  return mprotect(pregion, GetStackOverflowProtectedSize(), PROT_READ|PROT_WRITE) == 0;
 }
 
 size_t Thread::NumberOfHeldMutexes() const {
@@ -4736,11 +4761,47 @@
 }
 
 mirror::Object* Thread::GetPeerFromOtherThread() {
+  Thread* self = Thread::Current();
+  if (this == self) {
+    // We often call this on every thread, including ourselves.
+    return GetPeer();
+  }
+  // If "this" thread is not suspended, it could disappear.
+  DCHECK(IsSuspended()) << *this;
   DCHECK(tlsPtr_.jpeer == nullptr);
+  // Some JVMTI code may unfortunately hold thread_list_lock_, but if it does, it should hold the
+  // mutator lock in exclusive mode, and we should not have a pending flip function.
+  if (kIsDebugBuild && Locks::thread_list_lock_->IsExclusiveHeld(self)) {
+    Locks::mutator_lock_->AssertExclusiveHeld(self);
+    CHECK(!ReadFlag(ThreadFlag::kPendingFlipFunction));
+  }
   // Ensure that opeer is not obsolete.
-  EnsureFlipFunctionStarted(Thread::Current());
-  while (GetStateAndFlags(std::memory_order_acquire).IsAnyOfFlagsSet(FlipFunctionFlags())) {
-    usleep(kSuspendTimeDuringFlip);
+  EnsureFlipFunctionStarted(self, this);
+  if (ReadFlag(ThreadFlag::kRunningFlipFunction)) {
+    // Does not release mutator lock. Hence no new flip requests can be issued.
+    WaitForFlipFunction(self);
+  }
+  return tlsPtr_.opeer;
+}
+
+mirror::Object* Thread::LockedGetPeerFromOtherThread(ThreadExitFlag* tef) {
+  DCHECK(tlsPtr_.jpeer == nullptr);
+  Thread* self = Thread::Current();
+  Locks::thread_list_lock_->AssertHeld(self);
+  if (ReadFlag(ThreadFlag::kPendingFlipFunction)) {
+    // It is unsafe to call EnsureFlipFunctionStarted with thread_list_lock_. Thus we temporarily
+    // release it, taking care to handle the case in which "this" thread disapppears while we no
+    // longer hold it.
+    Locks::thread_list_lock_->Unlock(self);
+    EnsureFlipFunctionStarted(self, this, StateAndFlags(0), tef);
+    Locks::thread_list_lock_->Lock(self);
+    if (tef->HasExited()) {
+      return nullptr;
+    }
+  }
+  if (ReadFlag(ThreadFlag::kRunningFlipFunction)) {
+    // Does not release mutator lock. Hence no new flip requests can be issued.
+    WaitForFlipFunction(self);
   }
   return tlsPtr_.opeer;
 }
@@ -4785,6 +4846,27 @@
   return priority;
 }
 
+void Thread::AbortInThis(std::string message) {
+  std::string thread_name;
+  Thread::Current()->GetThreadName(thread_name);
+  LOG(ERROR) << message;
+  LOG(ERROR) << "Aborting culprit thread";
+  Runtime::Current()->SetAbortMessage(("Caused " + thread_name + " failure : " + message).c_str());
+  // Unlike Runtime::Abort() we do not fflush(nullptr), since we want to send the signal with as
+  // little delay as possible.
+  int res = pthread_kill(tlsPtr_.pthread_self, SIGABRT);
+  if (res != 0) {
+    LOG(ERROR) << "pthread_kill failed with " << res << " " << strerror(res) << " target was "
+               << tls32_.tid;
+  } else {
+    // Wait for our process to be aborted.
+    sleep(10 /* seconds */);
+  }
+  // The process should have died long before we got here. Never return.
+  LOG(FATAL) << "Failed to abort in culprit thread: " << message;
+  UNREACHABLE();
+}
+
 bool Thread::IsSystemDaemon() const {
   if (GetPeer() == nullptr) {
     return false;
diff --git a/runtime/thread.h b/runtime/thread.h
index 8921631..8bcd815 100644
--- a/runtime/thread.h
+++ b/runtime/thread.h
@@ -47,13 +47,14 @@
 #include "reflective_handle_scope.h"
 #include "runtime_globals.h"
 #include "runtime_stats.h"
+#include "suspend_reason.h"
 #include "thread_state.h"
 
 namespace unwindstack {
 class AndroidLocalUnwinder;
 }  // namespace unwindstack
 
-namespace art {
+namespace art HIDDEN {
 
 namespace gc {
 namespace accounting {
@@ -82,7 +83,6 @@
 }  // namespace mirror
 
 namespace verifier {
-class MethodVerifier;
 class VerifierDeps;
 }  // namespace verifier
 
@@ -102,7 +102,6 @@
 class ScopedObjectAccessAlreadyRunnable;
 class ShadowFrame;
 class StackedShadowFrameRecord;
-enum class SuspendReason : char;
 class Thread;
 class ThreadList;
 enum VisitRootFlags : uint8_t;
@@ -134,25 +133,35 @@
   kEmptyCheckpointRequest = 1u << 2,
 
   // Register that at least 1 suspend barrier needs to be passed.
+  // Changes to this flag are guarded by suspend_count_lock_ .
   kActiveSuspendBarrier = 1u << 3,
 
   // Marks that a "flip function" needs to be executed on this thread.
+  // Set only while holding thread_list_lock_.
   kPendingFlipFunction = 1u << 4,
 
   // Marks that the "flip function" is being executed by another thread.
   //
-  // This is used to guards against multiple threads trying to run the
+  // This is used to guard against multiple threads trying to run the
   // "flip function" for the same thread while the thread is suspended.
   //
-  // This is not needed when the thread is running the flip function
-  // on its own after transitioning to Runnable.
+  // Set when we have some way to ensure that the thread cannot disappear out from under us,
+  // Either:
+  //   1) Set by the thread itself,
+  //   2) by a thread holding thread_list_lock_, or
+  //   3) while the target has a pending suspension request.
+  // Once set, prevents a thread from exiting.
   kRunningFlipFunction = 1u << 5,
 
-  // Marks that a thread is wating for "flip function" to complete.
-  //
-  // This is used to check if we need to broadcast the completion of the
-  // "flip function" to other threads. See also `kRunningFlipFunction`.
-  kWaitingForFlipFunction = 1u << 6,
+  // We are responsible for resuming all other threads. We ignore suspension requests,
+  // but not checkpoint requests, until a more opportune time. GC code should
+  // in any case not check for such requests; other clients of SuspendAll might.
+  // Prevents a situation in which we are asked to suspend just before we suspend all
+  // other threads, and then notice the suspension request and suspend ourselves,
+  // leading to deadlock. Guarded by suspend_count_lock_ .
+  // TODO(b/296639267): Generalize use to prevent SuspendAll from blocking
+  // in-progress GC.
+  kSuspensionImmune = 1u << 6,
 
   // Request that compiled JNI stubs do not transition to Native or Runnable with
   // inlined code, but take a slow path for monitoring method entry and exit events.
@@ -188,6 +197,34 @@
   kDisabled
 };
 
+// See Thread.tlsPtr_.active_suspend1_barriers below for explanation.
+struct WrappedSuspend1Barrier {
+  // TODO(b/23668816): At least weaken CHECKs to DCHECKs once the bug is fixed.
+  static constexpr int kMagic = 0xba8;
+  WrappedSuspend1Barrier() : magic_(kMagic), barrier_(1), next_(nullptr) {}
+  int magic_;
+  AtomicInteger barrier_;
+  struct WrappedSuspend1Barrier* next_ GUARDED_BY(Locks::thread_suspend_count_lock_);
+};
+
+// Mostly opaque structure allocated by the client of NotifyOnThreadExit.  Allows a client to
+// check whether the thread still exists after temporarily releasing thread_list_lock_, usually
+// because we need to wait for something.
+class ThreadExitFlag {
+ public:
+  ThreadExitFlag() : exited_(false) {}
+  bool HasExited() REQUIRES(Locks::thread_list_lock_) { return exited_; }
+
+ private:
+  // All ThreadExitFlags associated with a thread and with exited_ == false are in a doubly linked
+  // list.  tlsPtr_.thread_exit_flags points to the first element.  first.prev_ and last.next_ are
+  // null. This list contains no ThreadExitFlags with exited_ == true;
+  ThreadExitFlag* next_ GUARDED_BY(Locks::thread_list_lock_);
+  ThreadExitFlag* prev_ GUARDED_BY(Locks::thread_list_lock_);
+  bool exited_ GUARDED_BY(Locks::thread_list_lock_);
+  friend class Thread;
+};
+
 // This should match RosAlloc::kNumThreadLocalSizeBrackets.
 static constexpr size_t kNumRosAllocThreadLocalSizeBracketsInThread = 16;
 
@@ -214,14 +251,14 @@
 // that is set mprotect(PROT_NONE).  Any attempt to read/write to this region will
 // result in a segmentation fault signal.  At any point, the thread's SP will be somewhere
 // between the stack_end and the highest address in stack memory.  An implicit stack
-// overflow check is a read of memory at a certain offset below the current SP (4K typically).
+// overflow check is a read of memory at a certain offset below the current SP (8K typically).
 // If the thread's SP is below the stack_end address this will be a read into the protected
 // region.  If the SP is above the stack_end address, the thread is guaranteed to have
-// at least 4K of space.  Because stack overflow checks are only performed in generated code,
+// at least 8K of space.  Because stack overflow checks are only performed in generated code,
 // if the thread makes a call out to a native function (through JNI), that native function
 // might only have 4K of memory (if the SP is adjacent to stack_end).
 
-class Thread {
+class EXPORT Thread {
  public:
   static const size_t kStackOverflowImplicitCheckSize;
   static constexpr bool kVerifyStack = kIsDebugBuild;
@@ -251,6 +288,11 @@
   // Get the thread from the JNI environment.
   static Thread* ForEnv(JNIEnv* env);
 
+  // For implicit overflow checks we reserve an extra piece of memory at the bottom of the stack
+  // (lowest memory). The higher portion of the memory is protected against reads and the lower is
+  // available for use while throwing the StackOverflow exception.
+  ALWAYS_INLINE static size_t GetStackOverflowProtectedSize();
+
   // On a runnable thread, check for pending thread suspension request and handle if pending.
   void AllowThreadSuspension() REQUIRES_SHARED(Locks::mutator_lock_);
 
@@ -261,8 +303,7 @@
   void CheckEmptyCheckpointFromWeakRefAccess(BaseMutex* cond_var_mutex);
   void CheckEmptyCheckpointFromMutex();
 
-  static Thread* FromManagedThread(const ScopedObjectAccessAlreadyRunnable& ts,
-                                   ObjPtr<mirror::Object> thread_peer)
+  static Thread* FromManagedThread(Thread* self, ObjPtr<mirror::Object> thread_peer)
       REQUIRES(Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
   static Thread* FromManagedThread(const ScopedObjectAccessAlreadyRunnable& ts, jobject thread)
@@ -321,7 +362,10 @@
   }
 
   bool IsSuspended() const {
-    StateAndFlags state_and_flags = GetStateAndFlags(std::memory_order_relaxed);
+    // We need to ensure that once we return true, all prior accesses to the Java data by "this"
+    // thread are complete. Hence we need "acquire" ordering here, and "release" when the flags
+    // are set.
+    StateAndFlags state_and_flags = GetStateAndFlags(std::memory_order_acquire);
     return state_and_flags.GetState() != ThreadState::kRunnable &&
            state_and_flags.IsFlagSet(ThreadFlag::kSuspendRequest);
   }
@@ -337,20 +381,38 @@
     return tls32_.define_class_counter;
   }
 
-  // If delta > 0 and (this != self or suspend_barrier is not null), this function may temporarily
-  // release thread_suspend_count_lock_ internally.
+  // Increment suspend count and optionally install at most one suspend barrier.
+  // Must hold thread_list_lock, OR be called with self == this, so that the Thread cannot
+  // disappear while we're running. If it's known that this == self, and thread_list_lock_
+  // is not held, FakeMutexLock should be used to fake-acquire thread_list_lock_ for
+  // static checking purposes.
   ALWAYS_INLINE
-  bool ModifySuspendCount(Thread* self,
-                          int delta,
-                          AtomicInteger* suspend_barrier,
-                          SuspendReason reason)
-      WARN_UNUSED
+  void IncrementSuspendCount(Thread* self,
+                             AtomicInteger* suspendall_barrier,
+                             WrappedSuspend1Barrier* suspend1_barrier,
+                             SuspendReason reason) REQUIRES(Locks::thread_suspend_count_lock_)
+      REQUIRES(Locks::thread_list_lock_);
+
+  // The same, but default reason to kInternal, and barriers to nullptr.
+  ALWAYS_INLINE void IncrementSuspendCount(Thread* self) REQUIRES(Locks::thread_suspend_count_lock_)
+      REQUIRES(Locks::thread_list_lock_);
+
+  // Follows one of the above calls. For_user_code indicates if SuspendReason was kForUserCode.
+  // Generally will need to be closely followed by Thread::resume_cond_->Broadcast(self);
+  // since there may be waiters. DecrementSuspendCount() itself does not do this, since we often
+  // wake more than a single thread.
+  ALWAYS_INLINE void DecrementSuspendCount(Thread* self, bool for_user_code = false)
       REQUIRES(Locks::thread_suspend_count_lock_);
 
+ private:
+  NO_RETURN static void UnsafeLogFatalForSuspendCount(Thread* self, Thread* thread);
+
+ public:
   // Requests a checkpoint closure to run on another thread. The closure will be run when the
   // thread notices the request, either in an explicit runtime CheckSuspend() call, or in a call
   // originating from a compiler generated suspend point check. This returns true if the closure
-  // was added and will (eventually) be executed. It returns false otherwise.
+  // was added and will (eventually) be executed. It returns false if this was impossible
+  // because the thread was suspended, and we thus did nothing.
   //
   // Since multiple closures can be queued and some closures can delay other threads from running,
   // no closure should attempt to suspend another thread while running.
@@ -364,27 +426,37 @@
 
   // RequestSynchronousCheckpoint releases the thread_list_lock_ as a part of its execution. This is
   // due to the fact that Thread::Current() needs to go to sleep to allow the targeted thread to
-  // execute the checkpoint for us if it is Runnable. The suspend_state is the state that the thread
+  // execute the checkpoint for us if it is Runnable. The wait_state is the state that the thread
   // will go into while it is awaiting the checkpoint to be run.
-  // NB Passing ThreadState::kRunnable may cause the current thread to wait in a condition variable
-  // while holding the mutator_lock_.  Callers should ensure that this will not cause any problems
-  // for the closure or the rest of the system.
+  // The closure may be run on Thread::Current() on behalf of "this" thread.
+  // Thus for lock ordering purposes, the closure should be runnable by the caller. This also
+  // sometimes makes it reasonable to pass ThreadState::kRunnable as wait_state: We may wait on
+  // a condition variable for the "this" thread to act, but for lock ordering purposes, this is
+  // exactly as though Thread::Current() had run the closure.
   // NB Since multiple closures can be queued and some closures can delay other threads from running
   // no closure should attempt to suspend another thread while running.
   bool RequestSynchronousCheckpoint(Closure* function,
-                                    ThreadState suspend_state = ThreadState::kWaiting)
-      REQUIRES_SHARED(Locks::mutator_lock_)
-      RELEASE(Locks::thread_list_lock_)
-      REQUIRES(!Locks::thread_suspend_count_lock_);
+                                    ThreadState wait_state = ThreadState::kWaiting)
+      REQUIRES_SHARED(Locks::mutator_lock_) RELEASE(Locks::thread_list_lock_)
+          REQUIRES(!Locks::thread_suspend_count_lock_);
 
   bool RequestEmptyCheckpoint()
       REQUIRES(Locks::thread_suspend_count_lock_);
 
-  // Set the flip function. This is done with all threads suspended, except for the calling thread.
-  void SetFlipFunction(Closure* function);
+  Closure* GetFlipFunction() { return tlsPtr_.flip_function.load(std::memory_order_relaxed); }
 
-  // Wait for the flip function to complete if still running on another thread.
-  void WaitForFlipFunction(Thread* self);
+  // Set the flip function. This is done with all threads suspended, except for the calling thread.
+  void SetFlipFunction(Closure* function) REQUIRES(Locks::thread_suspend_count_lock_)
+      REQUIRES(Locks::thread_list_lock_);
+
+  // Wait for the flip function to complete if still running on another thread. Assumes the "this"
+  // thread remains live.
+  void WaitForFlipFunction(Thread* self) const REQUIRES(!Locks::thread_suspend_count_lock_);
+
+  // An enhanced version of the above that uses tef to safely return if the thread exited in the
+  // meantime.
+  void WaitForFlipFunctionTestingExited(Thread* self, ThreadExitFlag* tef)
+      REQUIRES(!Locks::thread_suspend_count_lock_, !Locks::thread_list_lock_);
 
   gc::accounting::AtomicStack<mirror::Object>* GetThreadLocalMarkStack() {
     CHECK(gUseReadBarrier);
@@ -406,6 +478,7 @@
 
   // Called when thread detected that the thread_suspend_count_ was non-zero. Gives up share of
   // mutator_lock_ and waits until it is resumed and thread_suspend_count_ is zero.
+  // Should be called only when the kSuspensionImmune flag is clear. Requires this == Current();
   void FullSuspendCheck(bool implicit = false)
       REQUIRES(!Locks::thread_suspend_count_lock_)
       REQUIRES_SHARED(Locks::mutator_lock_);
@@ -520,10 +593,33 @@
   // GetPeer is not safe if called on another thread in the middle of the thread flip and
   // the thread's stack may have not been flipped yet and peer may be a from-space (stale) ref.
   // This function will force a flip for the other thread if necessary.
-  // Since we hold a shared mutator lock, a new flip function cannot be concurrently
-  // installed
+  // Since we hold a shared mutator lock, a new flip function cannot be concurrently installed.
+  // The target thread must be suspended, so that it cannot disappear during the call.
+  // We should ideally not hold thread_list_lock_ . GetReferenceKind in ti_heap.cc, currently does
+  // hold it, but in a context in which we do not invoke EnsureFlipFunctionStarted().
   mirror::Object* GetPeerFromOtherThread() REQUIRES_SHARED(Locks::mutator_lock_);
 
+  // A version of the above that requires thread_list_lock_, but does not require the thread to
+  // be suspended. This may temporarily release thread_list_lock_. It thus needs a ThreadExitFlag
+  // describing the thread's status, so we can tell if it exited in the interim. Returns null if
+  // the thread exited.
+  mirror::Object* LockedGetPeerFromOtherThread(ThreadExitFlag* tef)
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::thread_list_lock_);
+
+  // A convenience version of the above that creates the ThreadExitFlag locally. This is often
+  // unsafe if more than one thread is being processed. A prior call may have released
+  // thread_list_lock_, and thus the NotifyOnThreadExit() call here could see a deallocated
+  // Thread. We must hold the thread_list_lock continuously between obtaining the Thread*
+  // and calling NotifyOnThreadExit().
+  mirror::Object* LockedGetPeerFromOtherThread() REQUIRES_SHARED(Locks::mutator_lock_)
+      REQUIRES(Locks::thread_list_lock_) {
+    ThreadExitFlag tef;
+    NotifyOnThreadExit(&tef);
+    mirror::Object* result = LockedGetPeerFromOtherThread(&tef);
+    UnregisterThreadExitFlag(&tef);
+    return result;
+  }
+
   bool HasPeer() const {
     return tlsPtr_.jpeer != nullptr || tlsPtr_.opeer != nullptr;
   }
@@ -645,6 +741,33 @@
   void NotifyThreadGroup(ScopedObjectAccessAlreadyRunnable& soa, jobject thread_group = nullptr)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
+  // Request notification when this thread is unregistered, typically because it has exited.
+  //
+  // The ThreadExitFlag status is only changed when we remove the thread from the thread list,
+  // which we only do once no suspend requests are outstanding, and no flip-functions are still
+  // running.
+  //
+  // The caller must allocate a fresh ThreadExitFlag, and pass it in. The caller is responsible
+  // for either waiting until the thread has exited, or unregistering the ThreadExitFlag, and
+  // then, and only then, deallocating the ThreadExitFlag.  (This scheme avoids an allocation and
+  // questions about what to do if the allocation fails. Allows detection of thread exit after
+  // temporary release of thread_list_lock_)
+  void NotifyOnThreadExit(ThreadExitFlag* tef) REQUIRES(Locks::thread_list_lock_);
+  void UnregisterThreadExitFlag(ThreadExitFlag* tef) REQUIRES(Locks::thread_list_lock_);
+
+  // Is the ThreadExitFlag currently registered in this thread, which has not yet terminated?
+  // Intended only for testing.
+  bool IsRegistered(ThreadExitFlag* query_tef) REQUIRES(Locks::thread_list_lock_);
+
+  // For debuggable builds, CHECK that neither first nor last, nor any ThreadExitFlag with an
+  // address in-between, is currently registered with any thread.
+  static void DCheckUnregisteredEverywhere(ThreadExitFlag* first, ThreadExitFlag* last)
+      REQUIRES(!Locks::thread_list_lock_);
+
+  // Called when thread is unregistered. May be called repeatedly, in which case only newly
+  // registered clients are processed.
+  void SignalExitFlags() REQUIRES(Locks::thread_list_lock_);
+
   // JNI methods
   JNIEnvExt* GetJniEnv() const {
     return tlsPtr_.jni_env;
@@ -763,6 +886,17 @@
   void VisitReflectiveTargets(ReflectiveValueVisitor* visitor)
       REQUIRES(Locks::mutator_lock_);
 
+  // Check that the thread state is valid. Try to fail if the thread has erroneously terminated.
+  // Note that once the thread has been terminated, it can also be deallocated.  But even if the
+  // thread state has been overwritten, the value is unlikely to be in the correct range.
+  void VerifyState() {
+    if (kIsDebugBuild) {
+      ThreadState state = GetState();
+      StateAndFlags::ValidateThreadState(state);
+      DCHECK_NE(state, ThreadState::kTerminated);
+    }
+  }
+
   void VerifyStack() REQUIRES_SHARED(Locks::mutator_lock_) {
     if (kVerifyStack) {
       VerifyStackImpl();
@@ -946,6 +1080,18 @@
                                                                 thread_local_alloc_stack_end));
   }
 
+  template <PointerSize pointer_size>
+  static constexpr ThreadOffset<pointer_size> TraceBufferIndexOffset() {
+    return ThreadOffsetFromTlsPtr<pointer_size>(
+        OFFSETOF_MEMBER(tls_ptr_sized_values, method_trace_buffer_index));
+  }
+
+  template <PointerSize pointer_size>
+  static constexpr ThreadOffset<pointer_size> TraceBufferPtrOffset() {
+    return ThreadOffsetFromTlsPtr<pointer_size>(
+        OFFSETOF_MEMBER(tls_ptr_sized_values, method_trace_buffer));
+  }
+
   // Size of stack less any space reserved for stack overflow
   size_t GetStackSize() const {
     return tlsPtr_.stack_size - (tlsPtr_.stack_end - tlsPtr_.stack_begin);
@@ -1206,14 +1352,6 @@
     return tlsPtr_.method_trace_buffer = buffer;
   }
 
-  void ResetMethodTraceBuffer() {
-    if (tlsPtr_.method_trace_buffer != nullptr) {
-      delete[] tlsPtr_.method_trace_buffer;
-    }
-    tlsPtr_.method_trace_buffer = nullptr;
-    tlsPtr_.method_trace_buffer_index = 0;
-  }
-
   uint64_t GetTraceClockBase() const {
     return tls64_.trace_clock_base;
   }
@@ -1230,18 +1368,24 @@
     tlsPtr_.held_mutexes[level] = mutex;
   }
 
-  void ClearSuspendBarrier(AtomicInteger* target)
-      REQUIRES(Locks::thread_suspend_count_lock_);
+  // Possibly check that no mutexes at level kMonitorLock or above are subsequently acquired.
+  // Only invoked by the thread itself.
+  void DisallowPreMonitorMutexes();
+
+  // Undo the effect of the previous call. Again only invoked by the thread itself.
+  void AllowPreMonitorMutexes();
 
   bool ReadFlag(ThreadFlag flag) const {
     return GetStateAndFlags(std::memory_order_relaxed).IsFlagSet(flag);
   }
 
   void AtomicSetFlag(ThreadFlag flag, std::memory_order order = std::memory_order_seq_cst) {
+    // Since we discard the returned value, memory_order_release will often suffice.
     tls32_.state_and_flags.fetch_or(enum_cast<uint32_t>(flag), order);
   }
 
   void AtomicClearFlag(ThreadFlag flag, std::memory_order order = std::memory_order_seq_cst) {
+    // Since we discard the returned value, memory_order_release will often suffice.
     tls32_.state_and_flags.fetch_and(~enum_cast<uint32_t>(flag), order);
   }
 
@@ -1288,21 +1432,18 @@
   }
   // Remove the suspend trigger for this thread by making the suspend_trigger_ TLS value
   // equal to a valid pointer.
-  // TODO: does this need to atomic?  I don't think so.
   void RemoveSuspendTrigger() {
-    tlsPtr_.suspend_trigger = reinterpret_cast<uintptr_t*>(&tlsPtr_.suspend_trigger);
+    tlsPtr_.suspend_trigger.store(reinterpret_cast<uintptr_t*>(&tlsPtr_.suspend_trigger),
+                                  std::memory_order_relaxed);
   }
 
   // Trigger a suspend check by making the suspend_trigger_ TLS value an invalid pointer.
   // The next time a suspend check is done, it will load from the value at this address
   // and trigger a SIGSEGV.
-  // Only needed if Runtime::implicit_suspend_checks_ is true and fully implemented.  It currently
-  // is always false. Client code currently just looks at the thread flags directly to determine
-  // whether we should suspend, so this call is currently unnecessary.
-  void TriggerSuspend() {
-    tlsPtr_.suspend_trigger = nullptr;
-  }
-
+  // Only needed if Runtime::implicit_suspend_checks_ is true. On some platforms, and in the
+  // interpreter, client code currently just looks at the thread flags directly to determine
+  // whether we should suspend, so this call is not always necessary.
+  void TriggerSuspend() { tlsPtr_.suspend_trigger.store(nullptr, std::memory_order_release); }
 
   // Push an object onto the allocation stack.
   bool PushOnThreadLocalAllocationStack(mirror::Object* obj)
@@ -1334,14 +1475,6 @@
   bool ProtectStack(bool fatal_on_error = true);
   bool UnprotectStack();
 
-  bool IsTransitioningToRunnable() const {
-    return tls32_.is_transitioning_to_runnable;
-  }
-
-  void SetIsTransitioningToRunnable(bool value) {
-    tls32_.is_transitioning_to_runnable = value;
-  }
-
   uint32_t DecrementForceInterpreterCount() REQUIRES(Locks::thread_list_lock_) {
     return --tls32_.force_interpreter_count;
   }
@@ -1372,9 +1505,6 @@
     return false;
   }
 
-  void PushVerifier(verifier::MethodVerifier* verifier);
-  void PopVerifier(verifier::MethodVerifier* verifier);
-
   void InitStringEntryPoints();
 
   void ModifyDebugDisallowReadBarrier(int8_t delta) {
@@ -1403,6 +1533,13 @@
 
   bool IsSystemDaemon() const REQUIRES_SHARED(Locks::mutator_lock_);
 
+  // Cause the 'this' thread to abort the process by sending SIGABRT.  Thus we should get an
+  // asynchronous stack trace for 'this' thread, rather than waiting for it to process a
+  // checkpoint. Useful mostly to discover why a thread isn't responding to a suspend request or
+  // checkpoint. The caller should "suspend" (in the Java sense) 'thread' before invoking this, so
+  // 'thread' can't get deallocated before we access it.
+  NO_RETURN void AbortInThis(std::string message);
+
   // Returns true if StrictMode events are traced for the current thread.
   static bool IsSensitiveThread() {
     if (is_sensitive_thread_hook_ != nullptr) {
@@ -1455,8 +1592,7 @@
 
   static constexpr uint32_t FlipFunctionFlags() {
     return enum_cast<uint32_t>(ThreadFlag::kPendingFlipFunction) |
-           enum_cast<uint32_t>(ThreadFlag::kRunningFlipFunction) |
-           enum_cast<uint32_t>(ThreadFlag::kWaitingForFlipFunction);
+           enum_cast<uint32_t>(ThreadFlag::kRunningFlipFunction);
   }
 
   static constexpr uint32_t StoredThreadStateValue(ThreadState state) {
@@ -1477,8 +1613,23 @@
   }
 
  private:
+  // We pretend to acquire this while running a checkpoint to detect lock ordering issues.
+  // Initialized lazily.
+  static std::atomic<Mutex*> cp_placeholder_mutex_;
+
   explicit Thread(bool daemon);
+
+  // A successfully started thread is only deleted by the thread itself.
+  // Threads are deleted after they have been removed from the thread list while holding
+  // suspend_count_lock_ and thread_list_lock_. We refuse to do this while either kSuspendRequest
+  // or kRunningFlipFunction are set. We can prevent Thread destruction by holding either of those
+  // locks, ensuring that either of those flags are set, or possibly by registering and checking a
+  // ThreadExitFlag.
   ~Thread() REQUIRES(!Locks::mutator_lock_, !Locks::thread_suspend_count_lock_);
+
+  // Thread destruction actions that do not invalidate the thread. Checkpoints and flip_functions
+  // may still be called on this Thread object, though not by this thread, during and after the
+  // Destroy() call.
   void Destroy(bool should_run_callbacks);
 
   // Deletes and clears the tlsPtr_.jpeer field. Done in a way so that both it and opeer cannot be
@@ -1505,7 +1656,8 @@
 
   // Avoid use, callers should use SetState.
   // Used only by `Thread` destructor and stack trace collection in semi-space GC (currently
-  // disabled by `kStoreStackTraces = false`).
+  // disabled by `kStoreStackTraces = false`). May not be called on a runnable thread other
+  // than Thread::Current().
   // NO_THREAD_SAFETY_ANALYSIS: This function is "Unsafe" and can be called in
   // different states, so clang cannot perform the thread safety analysis.
   ThreadState SetStateUnsafe(ThreadState new_state) NO_THREAD_SAFETY_ANALYSIS {
@@ -1514,19 +1666,19 @@
     if (old_state == new_state) {
       // Nothing to do.
     } else if (old_state == ThreadState::kRunnable) {
+      DCHECK_EQ(this, Thread::Current());
       // Need to run pending checkpoint and suspend barriers. Run checkpoints in runnable state in
       // case they need to use a ScopedObjectAccess. If we are holding the mutator lock and a SOA
       // attempts to TransitionFromSuspendedToRunnable, it results in a deadlock.
       TransitionToSuspendedAndRunCheckpoints(new_state);
       // Since we transitioned to a suspended state, check the pass barrier requests.
-      PassActiveSuspendBarriers();
+      CheckActiveSuspendBarriers();
     } else {
       while (true) {
         StateAndFlags new_state_and_flags = old_state_and_flags;
         new_state_and_flags.SetState(new_state);
         if (LIKELY(tls32_.state_and_flags.CompareAndSetWeakAcquire(
-                                              old_state_and_flags.GetValue(),
-                                              new_state_and_flags.GetValue()))) {
+                old_state_and_flags.GetValue(), new_state_and_flags.GetValue()))) {
           break;
         }
         // Reload state and flags.
@@ -1593,8 +1745,36 @@
       REQUIRES(!Locks::thread_suspend_count_lock_, !Roles::uninterruptible_)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  ALWAYS_INLINE void PassActiveSuspendBarriers()
-      REQUIRES(!Locks::thread_suspend_count_lock_, !Roles::uninterruptible_);
+  // Call PassActiveSuspendBarriers() if there are active barriers. Only called on current thread.
+  ALWAYS_INLINE void CheckActiveSuspendBarriers()
+      REQUIRES(!Locks::thread_suspend_count_lock_, !Locks::mutator_lock_, !Roles::uninterruptible_);
+
+  // Decrement all "suspend barriers" for the current thread, notifying threads that requested our
+  // suspension. Only called on current thread, when suspended. If suspend_count_ > 0 then we
+  // promise that we are and will remain "suspended" until the suspend count is decremented.
+  bool PassActiveSuspendBarriers()
+      REQUIRES(!Locks::thread_suspend_count_lock_, !Locks::mutator_lock_);
+
+  // Add an entry to active_suspend1_barriers.
+  ALWAYS_INLINE void AddSuspend1Barrier(WrappedSuspend1Barrier* suspend1_barrier)
+      REQUIRES(Locks::thread_suspend_count_lock_);
+
+  // Remove last-added entry from active_suspend1_barriers.
+  // Only makes sense if we're still holding thread_suspend_count_lock_ since insertion.
+  // We redundantly pass in the barrier to be removed in order to enable a DCHECK.
+  ALWAYS_INLINE void RemoveFirstSuspend1Barrier(WrappedSuspend1Barrier* suspend1_barrier)
+      REQUIRES(Locks::thread_suspend_count_lock_);
+
+  // Remove the "barrier" from the list no matter where it appears. Called only under exceptional
+  // circumstances. The barrier must be in the list.
+  ALWAYS_INLINE void RemoveSuspend1Barrier(WrappedSuspend1Barrier* suspend1_barrier)
+      REQUIRES(Locks::thread_suspend_count_lock_);
+
+  ALWAYS_INLINE bool HasActiveSuspendBarrier() REQUIRES(Locks::thread_suspend_count_lock_);
+
+  // CHECK that the given barrier is no longer on our list.
+  ALWAYS_INLINE void CheckBarrierInactive(WrappedSuspend1Barrier* suspend1_barrier)
+      REQUIRES(Locks::thread_suspend_count_lock_);
 
   // Registers the current thread as the jit sensitive thread. Should be called just once.
   static void SetJitSensitiveThread() {
@@ -1610,13 +1790,6 @@
     is_sensitive_thread_hook_ = is_sensitive_thread_hook;
   }
 
-  bool ModifySuspendCountInternal(Thread* self,
-                                  int delta,
-                                  AtomicInteger* suspend_barrier,
-                                  SuspendReason reason)
-      WARN_UNUSED
-      REQUIRES(Locks::thread_suspend_count_lock_);
-
   // Runs a single checkpoint function. If there are no more pending checkpoint functions it will
   // clear the kCheckpointRequest flag. The caller is responsible for calling this in a loop until
   // the kCheckpointRequest flag is cleared.
@@ -1625,9 +1798,6 @@
       REQUIRES_SHARED(Locks::mutator_lock_);
   void RunEmptyCheckpoint();
 
-  bool PassActiveSuspendBarriers(Thread* self)
-      REQUIRES(!Locks::thread_suspend_count_lock_);
-
   // Install the protected region for implicit stack checks.
   void InstallImplicitProtection();
 
@@ -1704,7 +1874,6 @@
       return ThreadStateField::Encode(state);
     }
 
-   private:
     static constexpr void ValidateThreadState(ThreadState state) {
       if (kIsDebugBuild && state != ThreadState::kRunnable) {
         CHECK_GE(state, ThreadState::kTerminated);
@@ -1731,21 +1900,31 @@
   // Format state and flags as a hex string. For diagnostic output.
   std::string StateAndFlagsAsHexString() const;
 
-  // Run the flip function and, if requested, notify other threads that may have tried
+  // Run the flip function and notify other threads that may have tried
   // to do that concurrently.
-  void RunFlipFunction(Thread* self, bool notify) REQUIRES_SHARED(Locks::mutator_lock_);
+  void RunFlipFunction(Thread* self) REQUIRES_SHARED(Locks::mutator_lock_);
 
-  // Ensure that thread flip function started running. If no other thread is executing
-  // it, the calling thread shall run the flip function and then notify other threads
+  // Ensure that thread flip function for thread target started running. If no other thread is
+  // executing it, the calling thread shall run the flip function and then notify other threads
   // that have tried to do that concurrently. After this function returns, the
-  // `ThreadFlag::kPendingFlipFunction` is cleared but another thread may still
-  // run the flip function as indicated by the `ThreadFlag::kRunningFlipFunction`.
-  // A non-zero 'old_state_and_flags' indicates that the thread should logically
-  // acquire mutator lock if we win the race to run the flip function, if a
-  // suspend request is not already set. A zero 'old_state_and_flags' indicates
-  // we already hold the mutator lock.
-  // Returns true if this call ran the flip function.
-  bool EnsureFlipFunctionStarted(Thread* self, StateAndFlags old_state_and_flags = StateAndFlags(0))
+  // `ThreadFlag::kPendingFlipFunction` is cleared but another thread may still be running the
+  // flip function as indicated by the `ThreadFlag::kRunningFlipFunction`. Optional arguments:
+  //  - old_state_and_flags indicates the current and state and flags value for the thread, with
+  //    at least kPendingFlipFunction set. The thread should logically acquire the
+  //    mutator lock before running the flip function.  A special zero value indicates that the
+  //    thread already holds the mutator lock, and the actual state_and_flags must be read.
+  //    A non-zero value implies this == Current().
+  //  - If tef is non-null, we check that the target thread has not yet exited, as indicated by
+  //    tef. In that case, we acquire thread_list_lock_ as needed.
+  //  - If finished is non-null, we assign to *finished to indicate whether the flip was known to
+  //    be completed when we returned.
+  //  Returns true if and only if we acquired the mutator lock (which implies that we ran the flip
+  //  function after finding old_state_and_flags unchanged).
+  static bool EnsureFlipFunctionStarted(Thread* self,
+                                        Thread* target,
+                                        StateAndFlags old_state_and_flags = StateAndFlags(0),
+                                        ThreadExitFlag* tef = nullptr,
+                                        /*out*/ bool* finished = nullptr)
       TRY_ACQUIRE_SHARED(true, Locks::mutator_lock_);
 
   static void ThreadExitCallback(void* arg);
@@ -1777,7 +1956,7 @@
   // first if possible.
   /***********************************************************************************************/
 
-  struct PACKED(4) tls_32bit_sized_values {
+  struct alignas(4) tls_32bit_sized_values {
     // We have no control over the size of 'bool', but want our boolean fields
     // to be 4-byte quantities.
     using bool32_t = uint32_t;
@@ -1791,7 +1970,6 @@
           throwing_OutOfMemoryError(false),
           no_thread_suspension(0),
           thread_exit_check_count(0),
-          is_transitioning_to_runnable(false),
           is_gc_marking(false),
           is_deopt_check_required(false),
           weak_ref_access_enabled(WeakRefAccessState::kVisiblyEnabled),
@@ -1801,8 +1979,7 @@
           make_visibly_initialized_counter(0),
           define_class_counter(0),
           num_name_readers(0),
-          shared_method_hotness(kSharedMethodHotnessThreshold)
-        {}
+          shared_method_hotness(kSharedMethodHotnessThreshold) {}
 
     // The state and flags field must be changed atomically so that flag values aren't lost.
     // See `StateAndFlags` for bit assignments of `ThreadFlag` and `ThreadState` values.
@@ -1838,11 +2015,6 @@
     // How many times has our pthread key's destructor been called?
     uint32_t thread_exit_check_count;
 
-    // True if the thread is in TransitionFromSuspendedToRunnable(). This is used to distinguish the
-    // non-runnable threads (eg. kNative, kWaiting) that are about to transition to runnable from
-    // the rest of them.
-    bool32_t is_transitioning_to_runnable;
-
     // True if the GC is in the marking phase. This is used for the CC collector only. This is
     // thread local so that we can simplify the logic to check for the fast path of read barriers of
     // GC roots.
@@ -1912,7 +2084,7 @@
     uint32_t shared_method_hotness;
   } tls32_;
 
-  struct PACKED(8) tls_64bit_sized_values {
+  struct alignas(8) tls_64bit_sized_values {
     tls_64bit_sized_values() : trace_clock_base(0) {
     }
 
@@ -1922,7 +2094,7 @@
     RuntimeStats stats;
   } tls64_;
 
-  struct PACKED(sizeof(void*)) tls_ptr_sized_values {
+  struct alignas(sizeof(void*)) tls_ptr_sized_values {
       tls_ptr_sized_values() : card_table(nullptr),
                                exception(nullptr),
                                stack_end(nullptr),
@@ -1947,9 +2119,11 @@
                                name(nullptr),
                                pthread_self(0),
                                last_no_thread_suspension_cause(nullptr),
-                               thread_local_start(nullptr),
+                               active_suspendall_barrier(nullptr),
+                               active_suspend1_barriers(nullptr),
                                thread_local_pos(nullptr),
                                thread_local_end(nullptr),
+                               thread_local_start(nullptr),
                                thread_local_limit(nullptr),
                                thread_local_objects(0),
                                checkpoint_function(nullptr),
@@ -1957,12 +2131,12 @@
                                thread_local_alloc_stack_end(nullptr),
                                mutator_lock(nullptr),
                                flip_function(nullptr),
-                               method_verifier(nullptr),
                                thread_local_mark_stack(nullptr),
                                async_exception(nullptr),
                                top_reflective_handle_scope(nullptr),
                                method_trace_buffer(nullptr),
-                               method_trace_buffer_index(0) {
+                               method_trace_buffer_index(0),
+                               thread_exit_flags(nullptr) {
       std::fill(held_mutexes, held_mutexes + kLockLevelCount, nullptr);
     }
 
@@ -1980,8 +2154,12 @@
     ManagedStack managed_stack;
 
     // In certain modes, setting this to 0 will trigger a SEGV and thus a suspend check.  It is
-    // normally set to the address of itself.
-    uintptr_t* suspend_trigger;
+    // normally set to the address of itself. It should be cleared with release semantics to ensure
+    // that prior state changes etc. are visible to any thread that faults as a result.
+    // We assume that the kernel ensures that such changes are then visible to the faulting
+    // thread, even if it is not an acquire load that faults. (Indeed, it seems unlikely that the
+    // ordering semantics associated with the faulting load has any impact.)
+    std::atomic<uintptr_t*> suspend_trigger;
 
     // Every thread may have an associated JNI environment
     JNIEnvExt* jni_env;
@@ -2060,27 +2238,37 @@
     // If no_thread_suspension_ is > 0, what is causing that assertion.
     const char* last_no_thread_suspension_cause;
 
-    // Pending barriers that require passing or NULL if non-pending. Installation guarding by
-    // Locks::thread_suspend_count_lock_.
-    // They work effectively as art::Barrier, but implemented directly using AtomicInteger and futex
-    // to avoid additional cost of a mutex and a condition variable, as used in art::Barrier.
-    AtomicInteger* active_suspend_barriers[kMaxSuspendBarriers];
-
-    // Thread-local allocation pointer. Moved here to force alignment for thread_local_pos on ARM.
-    uint8_t* thread_local_start;
+    // After a thread observes a suspend request and enters a suspended state,
+    // it notifies the requestor by arriving at a "suspend barrier". This consists of decrementing
+    // the atomic integer representing the barrier. (This implementation was introduced in 2015 to
+    // minimize cost. There may be other options.) These atomic integer barriers are always
+    // stored on the requesting thread's stack. They are referenced from the target thread's
+    // data structure in one of two ways; in either case the data structure referring to these
+    // barriers is guarded by suspend_count_lock:
+    // 1. A SuspendAll barrier is directly referenced from the target thread. Only one of these
+    // can be active at a time:
+    AtomicInteger* active_suspendall_barrier GUARDED_BY(Locks::thread_suspend_count_lock_);
+    // 2. For individual thread suspensions, active barriers are embedded in a struct that is used
+    // to link together all suspend requests for this thread. Unlike the SuspendAll case, each
+    // barrier is referenced by a single target thread, and thus can appear only on a single list.
+    // The struct as a whole is still stored on the requesting thread's stack.
+    WrappedSuspend1Barrier* active_suspend1_barriers GUARDED_BY(Locks::thread_suspend_count_lock_);
 
     // thread_local_pos and thread_local_end must be consecutive for ldrd and are 8 byte aligned for
     // potentially better performance.
     uint8_t* thread_local_pos;
     uint8_t* thread_local_end;
 
+    // Thread-local allocation pointer. Can be moved above the preceding two to correct alignment.
+    uint8_t* thread_local_start;
+
     // Thread local limit is how much we can expand the thread local buffer to, it is greater or
     // equal to thread_local_end.
     uint8_t* thread_local_limit;
 
     size_t thread_local_objects;
 
-    // Pending checkpoint function or null if non-pending. If this checkpoint is set and someone\
+    // Pending checkpoint function or null if non-pending. If this checkpoint is set and someone
     // requests another checkpoint, it goes to the checkpoint overflow list.
     Closure* checkpoint_function GUARDED_BY(Locks::thread_suspend_count_lock_);
 
@@ -2103,11 +2291,9 @@
     // Support for Mutex lock hierarchy bug detection.
     BaseMutex* held_mutexes[kLockLevelCount];
 
-    // The function used for thread flip.
-    Closure* flip_function;
-
-    // Current method verifier, used for root marking.
-    verifier::MethodVerifier* method_verifier;
+    // The function used for thread flip.  Set while holding Locks::thread_suspend_count_lock_ and
+    // with all other threads suspended.  May be cleared while being read.
+    std::atomic<Closure*> flip_function;
 
     union {
       // Thread-local mark stack for the concurrent copying collector.
@@ -2127,6 +2313,9 @@
 
     // The index of the next free entry in method_trace_buffer.
     size_t method_trace_buffer_index;
+
+    // Pointer to the first node of an intrusively doubly-linked list of ThreadExitFlags.
+    ThreadExitFlag* thread_exit_flags GUARDED_BY(Locks::thread_list_lock_);
   } tlsPtr_;
 
   // Small thread-local cache to be used from the interpreter.
@@ -2148,6 +2337,15 @@
   // Debug disable read barrier count, only is checked for debug builds and only in the runtime.
   uint8_t debug_disallow_read_barrier_ = 0;
 
+  // Counters used only for debugging and error reporting.  Likely to wrap.  Small to avoid
+  // increasing Thread size.
+  // We currently maintain these unconditionally, since it doesn't cost much, and we seem to have
+  // persistent issues with suspension timeouts, which these should help to diagnose.
+  // TODO: Reconsider this.
+  std::atomic<uint8_t> suspended_count_ = 0;   // Number of times we entered a suspended state after
+                                               // running checkpoints.
+  std::atomic<uint8_t> checkpoint_count_ = 0;  // Number of checkpoints we started running.
+
   // Note that it is not in the packed struct, may not be accessed for cross compilation.
   uintptr_t poison_object_cookie_ = 0;
 
@@ -2274,20 +2472,6 @@
   Thread* const self_;
 };
 
-class ScopedTransitioningToRunnable : public ValueObject {
- public:
-  explicit ScopedTransitioningToRunnable(Thread* self)
-      : self_(self) {
-    DCHECK_EQ(self, Thread::Current());
-    self_->SetIsTransitioningToRunnable(true);
-  }
-
-  ~ScopedTransitioningToRunnable() { self_->SetIsTransitioningToRunnable(false); }
-
- private:
-  Thread* const self_;
-};
-
 class ThreadLifecycleCallback {
  public:
   virtual ~ThreadLifecycleCallback() {}
@@ -2299,9 +2483,9 @@
 // Store an exception from the thread and suppress it for the duration of this object.
 class ScopedExceptionStorage {
  public:
-  explicit ScopedExceptionStorage(Thread* self) REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT explicit ScopedExceptionStorage(Thread* self) REQUIRES_SHARED(Locks::mutator_lock_);
   void SuppressOldException(const char* message = "") REQUIRES_SHARED(Locks::mutator_lock_);
-  ~ScopedExceptionStorage() REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT ~ScopedExceptionStorage() REQUIRES_SHARED(Locks::mutator_lock_);
 
  private:
   Thread* self_;
@@ -2309,7 +2493,7 @@
   MutableHandle<mirror::Throwable> excp_;
 };
 
-std::ostream& operator<<(std::ostream& os, const Thread& thread);
+EXPORT std::ostream& operator<<(std::ostream& os, const Thread& thread);
 std::ostream& operator<<(std::ostream& os, StackedShadowFrameType thread);
 
 }  // namespace art
diff --git a/runtime/thread_android.cc b/runtime/thread_android.cc
index 0f41e2f..5135d3c 100644
--- a/runtime/thread_android.cc
+++ b/runtime/thread_android.cc
@@ -21,7 +21,7 @@
 #include "base/bit_utils.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 void Thread::SetUpAlternateSignalStack() {
   // Bionic does this for us.
@@ -39,8 +39,8 @@
   // create different arbitrary alternate signal stacks and we do not want to erroneously
   // `madvise()` away pages that may hold data other than the alternate signal stack.
   if ((old_ss.ss_flags & SS_DISABLE) == 0 &&
-      IsAligned<kPageSize>(old_ss.ss_sp) &&
-      IsAligned<kPageSize>(old_ss.ss_size)) {
+      IsAlignedParam(old_ss.ss_sp, gPageSize) &&
+      IsAlignedParam(old_ss.ss_size, gPageSize)) {
     CHECK_EQ(old_ss.ss_flags & SS_ONSTACK, 0);
     // Note: We're testing and benchmarking ART on devices with old kernels
     // which may not support `MADV_FREE`, so we do not check the result.
diff --git a/runtime/thread_linux.cc b/runtime/thread_linux.cc
index afce796..860d0e5 100644
--- a/runtime/thread_linux.cc
+++ b/runtime/thread_linux.cc
@@ -21,7 +21,7 @@
 #include "base/logging.h"  // For VLOG.
 #include "base/utils.h"
 
-namespace art {
+namespace art HIDDEN {
 
 static void SigAltStack(stack_t* new_stack, stack_t* old_stack) {
   if (sigaltstack(new_stack, old_stack) == -1) {
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc
index 84def82..02e3f54 100644
--- a/runtime/thread_list.cc
+++ b/runtime/thread_list.cc
@@ -62,15 +62,11 @@
 #endif
 #endif  // ART_USE_FUTEXES
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
 static constexpr uint64_t kLongThreadSuspendThreshold = MsToNs(5);
-// Use 0 since we want to yield to prevent blocking for an unpredictable amount of time.
-static constexpr useconds_t kThreadSuspendInitialSleepUs = 0;
-static constexpr useconds_t kThreadSuspendMaxYieldUs = 3000;
-static constexpr useconds_t kThreadSuspendMaxSleepUs = 5000;
 
 // Whether we should try to dump the native stack of unattached threads. See commit ed8b723 for
 // some history.
@@ -79,7 +75,7 @@
 ThreadList::ThreadList(uint64_t thread_suspend_timeout_ns)
     : suspend_all_count_(0),
       unregistering_count_(0),
-      suspend_all_historam_("suspend all histogram", 16, 64),
+      suspend_all_histogram_("suspend all histogram", 16, 64),
       long_suspend_(false),
       shut_down_(false),
       thread_suspend_timeout_ns_(thread_suspend_timeout_ns),
@@ -140,10 +136,10 @@
   {
     ScopedObjectAccess soa(Thread::Current());
     // Only print if we have samples.
-    if (suspend_all_historam_.SampleSize() > 0) {
+    if (suspend_all_histogram_.SampleSize() > 0) {
       Histogram<uint64_t>::CumulativeData data;
-      suspend_all_historam_.CreateHistogram(&data);
-      suspend_all_historam_.PrintConfidenceIntervals(os, 0.99, data);  // Dump time to suspend.
+      suspend_all_histogram_.CreateHistogram(&data);
+      suspend_all_histogram_.PrintConfidenceIntervals(os, 0.99, data);  // Dump time to suspend.
     }
   }
   bool dump_native_stack = Runtime::Current()->GetDumpNativeStackOnSigQuit();
@@ -279,11 +275,11 @@
   }
 }
 
-void ThreadList::AssertThreadsAreSuspended(Thread* self, Thread* ignore1, Thread* ignore2) {
+void ThreadList::AssertOtherThreadsAreSuspended(Thread* self) {
   MutexLock mu(self, *Locks::thread_list_lock_);
   MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
   for (const auto& thread : list_) {
-    if (thread != ignore1 && thread != ignore2) {
+    if (thread != self) {
       CHECK(thread->IsSuspended())
             << "\nUnsuspended thread: <<" << *thread << "\n"
             << "self: <<" << *Thread::Current();
@@ -310,20 +306,9 @@
 }
 #endif
 
-// Unlike suspending all threads where we can wait to acquire the mutator_lock_, suspending an
-// individual thread requires polling. delay_us is the requested sleep wait. If delay_us is 0 then
-// we use sched_yield instead of calling usleep.
-// Although there is the possibility, here and elsewhere, that usleep could return -1 and
-// errno = EINTR, there should be no problem if interrupted, so we do not check.
-static void ThreadSuspendSleep(useconds_t delay_us) {
-  if (delay_us == 0) {
-    sched_yield();
-  } else {
-    usleep(delay_us);
-  }
-}
-
-size_t ThreadList::RunCheckpoint(Closure* checkpoint_function, Closure* callback) {
+size_t ThreadList::RunCheckpoint(Closure* checkpoint_function,
+                                 Closure* callback,
+                                 bool allow_lock_checking) {
   Thread* self = Thread::Current();
   Locks::mutator_lock_->AssertNotExclusiveHeld(self);
   Locks::thread_list_lock_->AssertNotHeld(self);
@@ -332,9 +317,12 @@
   std::vector<Thread*> suspended_count_modified_threads;
   size_t count = 0;
   {
-    // Call a checkpoint function for each thread, threads which are suspended get their checkpoint
-    // manually called.
+    // Call a checkpoint function for each thread. We directly invoke the function on behalf of
+    // suspended threads.
     MutexLock mu(self, *Locks::thread_list_lock_);
+    if (kIsDebugBuild && allow_lock_checking) {
+      self->DisallowPreMonitorMutexes();
+    }
     MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
     count = list_.size();
     for (const auto& thread : list_) {
@@ -345,39 +333,36 @@
             // This thread will run its checkpoint some time in the near future.
             if (requested_suspend) {
               // The suspend request is now unnecessary.
-              bool updated =
-                  thread->ModifySuspendCount(self, -1, nullptr, SuspendReason::kInternal);
-              DCHECK(updated);
+              thread->DecrementSuspendCount(self);
+              Thread::resume_cond_->Broadcast(self);
               requested_suspend = false;
             }
             break;
           } else {
-            // The thread is probably suspended, try to make sure that it stays suspended.
-            if (thread->GetState() == ThreadState::kRunnable) {
-              // Spurious fail, try again.
-              continue;
-            }
+            // The thread was, and probably still is, suspended.
             if (!requested_suspend) {
-              bool updated =
-                  thread->ModifySuspendCount(self, +1, nullptr, SuspendReason::kInternal);
-              DCHECK(updated);
+              // This does not risk suspension cycles: We may have a pending suspension request,
+              // but it cannot block us: Checkpoint Run() functions may not suspend, thus we cannot
+              // be blocked from decrementing the count again.
+              thread->IncrementSuspendCount(self);
               requested_suspend = true;
-              if (thread->IsSuspended()) {
-                break;
-              }
-              // The thread raced us to become Runnable. Try to RequestCheckpoint() again.
-            } else {
-              // The thread previously raced our suspend request to become Runnable but
-              // since it is suspended again, it must honor that suspend request now.
-              DCHECK(thread->IsSuspended());
+            }
+            if (thread->IsSuspended()) {
+              // We saw it suspended after incrementing suspend count, so it will stay that way.
               break;
             }
           }
+          // We only get here if the thread entered kRunnable again. Retry immediately.
         }
+        // At this point, either the thread was runnable, and will run the checkpoint itself,
+        // or requested_suspend is true, and the thread is safely suspended.
         if (requested_suspend) {
+          DCHECK(thread->IsSuspended());
           suspended_count_modified_threads.push_back(thread);
         }
       }
+      // Thread either has honored or will honor the checkpoint, or it has been added to
+      // suspended_count_modified_threads.
     }
     // Run the callback to be called inside this critical section.
     if (callback != nullptr) {
@@ -388,6 +373,7 @@
   // Run the checkpoint on ourself while we wait for threads to suspend.
   checkpoint_function->Run(self);
 
+  bool mutator_lock_held = Locks::mutator_lock_->IsSharedHeld(self);
   bool repeat = true;
   // Run the checkpoint on the suspended threads.
   while (repeat) {
@@ -396,21 +382,23 @@
       if (thread != nullptr) {
         // We know for sure that the thread is suspended at this point.
         DCHECK(thread->IsSuspended());
-        // Make sure there is no pending flip function before running checkpoint
-        // on behalf of thread.
-        thread->EnsureFlipFunctionStarted(self);
-        if (thread->GetStateAndFlags(std::memory_order_acquire)
-                .IsAnyOfFlagsSet(Thread::FlipFunctionFlags())) {
-          // There is another thread running the flip function for 'thread'.
-          // Instead of waiting for it to complete, move to the next thread.
-          repeat = true;
-          continue;
-        }
+        if (mutator_lock_held) {
+          // Make sure there is no pending flip function before running Java-heap-accessing
+          // checkpoint on behalf of thread.
+          Thread::EnsureFlipFunctionStarted(self, thread);
+          if (thread->GetStateAndFlags(std::memory_order_acquire)
+                  .IsAnyOfFlagsSet(Thread::FlipFunctionFlags())) {
+            // There is another thread running the flip function for 'thread'.
+            // Instead of waiting for it to complete, move to the next thread.
+            repeat = true;
+            continue;
+          }
+        }  // O.w. the checkpoint will not access Java data structures, and doesn't care whether
+           // the flip function has been called.
         checkpoint_function->Run(thread);
         {
           MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
-          bool updated = thread->ModifySuspendCount(self, -1, nullptr, SuspendReason::kInternal);
-          DCHECK(updated);
+          thread->DecrementSuspendCount(self);
         }
         // We are done with 'thread' so set it to nullptr so that next outer
         // loop iteration, if any, skips 'thread'.
@@ -429,6 +417,9 @@
     Thread::resume_cond_->Broadcast(self);
   }
 
+  if (kIsDebugBuild && allow_lock_checking) {
+    self->AllowPreMonitorMutexes();
+  }
   return count;
 }
 
@@ -537,113 +528,252 @@
   }
 }
 
+// Separate function to disable just the right amount of thread-safety analysis.
+ALWAYS_INLINE void AcquireMutatorLockSharedUncontended(Thread* self)
+    ACQUIRE_SHARED(*Locks::mutator_lock_) NO_THREAD_SAFETY_ANALYSIS {
+  bool success = Locks::mutator_lock_->SharedTryLock(self, /*check=*/false);
+  CHECK(success);
+}
+
 // A checkpoint/suspend-all hybrid to switch thread roots from
 // from-space to to-space refs. Used to synchronize threads at a point
 // to mark the initiation of marking while maintaining the to-space
 // invariant.
-size_t ThreadList::FlipThreadRoots(Closure* thread_flip_visitor,
-                                   Closure* flip_callback,
-                                   gc::collector::GarbageCollector* collector,
-                                   gc::GcPauseListener* pause_listener) {
+void ThreadList::FlipThreadRoots(Closure* thread_flip_visitor,
+                                 Closure* flip_callback,
+                                 gc::collector::GarbageCollector* collector,
+                                 gc::GcPauseListener* pause_listener) {
   TimingLogger::ScopedTiming split("ThreadListFlip", collector->GetTimings());
   Thread* self = Thread::Current();
   Locks::mutator_lock_->AssertNotHeld(self);
   Locks::thread_list_lock_->AssertNotHeld(self);
   Locks::thread_suspend_count_lock_->AssertNotHeld(self);
   CHECK_NE(self->GetState(), ThreadState::kRunnable);
-  size_t runnable_thread_count = 0;
-  std::vector<Thread*> other_threads;
 
   collector->GetHeap()->ThreadFlipBegin(self);  // Sync with JNI critical calls.
 
   // ThreadFlipBegin happens before we suspend all the threads, so it does not
   // count towards the pause.
   const uint64_t suspend_start_time = NanoTime();
-  SuspendAllInternal(self, self, nullptr);
+  VLOG(threads) << "Suspending all for thread flip";
+  SuspendAllInternal(self);
   if (pause_listener != nullptr) {
     pause_listener->StartPause();
   }
 
   // Run the flip callback for the collector.
   Locks::mutator_lock_->ExclusiveLock(self);
-  suspend_all_historam_.AdjustAndAddValue(NanoTime() - suspend_start_time);
+  suspend_all_histogram_.AdjustAndAddValue(NanoTime() - suspend_start_time);
   flip_callback->Run(self);
-  // Releasing mutator-lock *before* setting up flip function in the threads
-  // leaves a gap for another thread trying to suspend all threads. That thread
-  // gets to run with mutator-lock, thereby accessing the heap, without running
-  // its flip function. It's not a problem with CC as the gc-thread hasn't
-  // started marking yet and the from-space is accessible. By delaying releasing
-  // mutator-lock until after the flip function are running on all threads we
-  // fix that without increasing pause time, except for any thread that might be
-  // trying to suspend all. Even though the change works irrespective of the GC,
-  // it has been limited to userfaultfd GC to keep the change behind the flag.
-  //
-  // TODO: It's a temporary change as aosp/2377951 is going to clean-up at a
-  // broad scale, including not allowing concurrent suspend-all.
 
-  // Resume runnable threads.
+  std::vector<Thread*> flipping_threads;  // All suspended threads. Includes us.
+  int thread_count;
+  // Flipping threads might exit between the time we resume them and try to run the flip function.
+  // Track that in a parallel vector.
+  std::unique_ptr<ThreadExitFlag[]> exit_flags;
   {
     TimingLogger::ScopedTiming split2("ResumeRunnableThreads", collector->GetTimings());
     MutexLock mu(self, *Locks::thread_list_lock_);
     MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
-    --suspend_all_count_;
+    thread_count = list_.size();
+    exit_flags.reset(new ThreadExitFlag[thread_count]);
+    flipping_threads.resize(thread_count, nullptr);
+    int i = 1;
     for (Thread* thread : list_) {
       // Set the flip function for all threads because once we start resuming any threads,
       // they may need to run the flip function on behalf of other threads, even this one.
+      DCHECK(thread == self || thread->IsSuspended());
       thread->SetFlipFunction(thread_flip_visitor);
-      if (thread == self) {
-        continue;
-      }
-      // Resume early the threads that were runnable but are suspended just for this thread flip or
-      // about to transition from non-runnable (eg. kNative at the SOA entry in a JNI function) to
-      // runnable (both cases waiting inside Thread::TransitionFromSuspendedToRunnable), or waiting
-      // for the thread flip to end at the JNI critical section entry (kWaitingForGcThreadFlip),
-      ThreadState state = thread->GetState();
-      if ((state == ThreadState::kWaitingForGcThreadFlip || thread->IsTransitioningToRunnable()) &&
-          thread->GetSuspendCount() == 1) {
-        // The thread will resume right after the broadcast.
-        bool updated = thread->ModifySuspendCount(self, -1, nullptr, SuspendReason::kInternal);
-        DCHECK(updated);
-        ++runnable_thread_count;
-      } else {
-        other_threads.push_back(thread);
-      }
+      // Put ourselves first, so other threads are more likely to have finished before we get
+      // there.
+      int thread_index = thread == self ? 0 : i++;
+      flipping_threads[thread_index] = thread;
+      thread->NotifyOnThreadExit(&exit_flags[thread_index]);
     }
-    Thread::resume_cond_->Broadcast(self);
+    DCHECK(i == thread_count);
   }
 
-  collector->RegisterPause(NanoTime() - suspend_start_time);
   if (pause_listener != nullptr) {
     pause_listener->EndPause();
   }
-  collector->GetHeap()->ThreadFlipEnd(self);
+  // Any new threads created after this will be created by threads that already ran their flip
+  // functions. In the normal GC use case in which the flip function converts all local references
+  // to to-space references, these newly created threads will also see only to-space references.
+
+  // Resume threads, making sure that we do not release suspend_count_lock_ until we've reacquired
+  // the mutator_lock_ in shared mode, and decremented suspend_all_count_.  This avoids a
+  // concurrent SuspendAll, and ensures that newly started threads see a correct value of
+  // suspend_all_count.
+  {
+    MutexLock mu(self, *Locks::thread_list_lock_);
+    Locks::thread_suspend_count_lock_->Lock(self);
+    ResumeAllInternal(self);
+  }
+
+  collector->RegisterPause(NanoTime() - suspend_start_time);
+
+  // Since all threads were suspended, they will attempt to run the flip function before
+  // reentering a runnable state. We will also attempt to run the flip functions ourselves.  Any
+  // intervening checkpoint request will do the same.  Exactly one of those flip function attempts
+  // will succeed, and the target thread will not be able to reenter a runnable state until one of
+  // them does.
 
   // Try to run the closure on the other threads.
-  {
-    TimingLogger::ScopedTiming split3("FlipOtherThreads", collector->GetTimings());
-    for (Thread* thread : other_threads) {
-      thread->EnsureFlipFunctionStarted(self);
-      DCHECK(!thread->ReadFlag(ThreadFlag::kPendingFlipFunction));
+  TimingLogger::ScopedTiming split3("RunningThreadFlips", collector->GetTimings());
+  // Reacquire the mutator lock while holding suspend_count_lock. This cannot fail, since we
+  // do not acquire the mutator lock unless suspend_all_count was read as 0 while holding
+  // suspend_count_lock. We did not release suspend_count_lock since releasing the mutator
+  // lock.
+  AcquireMutatorLockSharedUncontended(self);
+
+  Locks::thread_suspend_count_lock_->Unlock(self);
+  // Concurrent SuspendAll may now see zero suspend_all_count_, but block on mutator_lock_.
+
+  collector->GetHeap()->ThreadFlipEnd(self);
+
+  for (int i = 0; i < thread_count; ++i) {
+    bool finished;
+    Thread::EnsureFlipFunctionStarted(
+        self, flipping_threads[i], Thread::StateAndFlags(0), &exit_flags[i], &finished);
+    if (finished) {
+      MutexLock mu2(self, *Locks::thread_list_lock_);
+      flipping_threads[i]->UnregisterThreadExitFlag(&exit_flags[i]);
+      flipping_threads[i] = nullptr;
     }
-    // Try to run the flip function for self.
-    self->EnsureFlipFunctionStarted(self);
-    DCHECK(!self->ReadFlag(ThreadFlag::kPendingFlipFunction));
+  }
+  // Make sure all flips complete before we return.
+  for (int i = 0; i < thread_count; ++i) {
+    if (UNLIKELY(flipping_threads[i] != nullptr)) {
+      flipping_threads[i]->WaitForFlipFunctionTestingExited(self, &exit_flags[i]);
+      MutexLock mu2(self, *Locks::thread_list_lock_);
+      flipping_threads[i]->UnregisterThreadExitFlag(&exit_flags[i]);
+    }
   }
 
-  Locks::mutator_lock_->ExclusiveUnlock(self);
+  Thread::DCheckUnregisteredEverywhere(&exit_flags[0], &exit_flags[thread_count - 1]);
 
-  // Resume other threads.
-  {
-    TimingLogger::ScopedTiming split4("ResumeOtherThreads", collector->GetTimings());
-    MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
-    for (const auto& thread : other_threads) {
-      bool updated = thread->ModifySuspendCount(self, -1, nullptr, SuspendReason::kInternal);
-      DCHECK(updated);
+  Locks::mutator_lock_->SharedUnlock(self);
+}
+
+// True only for debugging suspend timeout code. The resulting timeouts are short enough that
+// failures are expected.
+static constexpr bool kShortSuspendTimeouts = false;
+
+static constexpr unsigned kSuspendBarrierIters = kShortSuspendTimeouts ? 5 : 20;
+
+#if ART_USE_FUTEXES
+
+// Returns true if it timed out.
+static bool WaitOnceForSuspendBarrier(AtomicInteger* barrier,
+                                      int32_t cur_val,
+                                      uint64_t timeout_ns) {
+  timespec wait_timeout;
+  if (kShortSuspendTimeouts) {
+    timeout_ns = MsToNs(kSuspendBarrierIters);
+    CHECK_GE(NsToMs(timeout_ns / kSuspendBarrierIters), 1ul);
+  } else {
+    DCHECK_GE(NsToMs(timeout_ns / kSuspendBarrierIters), 10ul);
+  }
+  InitTimeSpec(false, CLOCK_MONOTONIC, NsToMs(timeout_ns / kSuspendBarrierIters), 0, &wait_timeout);
+  if (futex(barrier->Address(), FUTEX_WAIT_PRIVATE, cur_val, &wait_timeout, nullptr, 0) != 0) {
+    if (errno == ETIMEDOUT) {
+      return true;
+    } else if (errno != EAGAIN && errno != EINTR) {
+      PLOG(FATAL) << "futex wait for suspend barrier failed";
     }
-    Thread::resume_cond_->Broadcast(self);
+  }
+  return false;
+}
+
+#else
+
+static bool WaitOnceForSuspendBarrier(AtomicInteger* barrier,
+                                      int32_t cur_val,
+                                      uint64_t timeout_ns) {
+  // In the normal case, aim for a couple of hundred milliseconds.
+  static constexpr unsigned kInnerIters =
+      kShortSuspendTimeouts ? 1'000 : (timeout_ns / 1000) / kSuspendBarrierIters;
+  DCHECK_GE(kInnerIters, 1'000u);
+  for (int i = 0; i < kInnerIters; ++i) {
+    sched_yield();
+    if (barrier->load(std::memory_order_acquire) == 0) {
+      return false;
+    }
+  }
+  return true;
+}
+
+#endif  // ART_USE_FUTEXES
+
+// Return a short string describing the scheduling state of the thread with the given tid.
+static std::string GetThreadState(pid_t t) {
+#if defined(__linux__)
+  static constexpr int BUF_SIZE = 90;
+  char file_name_buf[BUF_SIZE];
+  char buf[BUF_SIZE];
+  snprintf(file_name_buf, BUF_SIZE, "/proc/%d/stat", t);
+  int stat_fd = open(file_name_buf, O_RDONLY | O_CLOEXEC);
+  if (stat_fd < 0) {
+    return std::string("failed to get thread state: ") + std::string(strerror(errno));
+  }
+  CHECK(stat_fd >= 0) << strerror(errno);
+  ssize_t bytes_read = TEMP_FAILURE_RETRY(read(stat_fd, buf, BUF_SIZE));
+  CHECK(bytes_read >= 0) << strerror(errno);
+  int ret = close(stat_fd);
+  DCHECK(ret == 0) << strerror(errno);
+  buf[BUF_SIZE - 1] = '\0';
+  return buf;
+#else
+  return "unknown state";
+#endif
+}
+
+std::optional<std::string> ThreadList::WaitForSuspendBarrier(AtomicInteger* barrier,
+                                                             pid_t t,
+                                                             int attempt_of_4) {
+  // Only fail after kIter timeouts, to make us robust against app freezing.
+#if ART_USE_FUTEXES
+  const uint64_t start_time = NanoTime();
+#endif
+  uint64_t timeout_ns =
+      attempt_of_4 == 0 ? thread_suspend_timeout_ns_ : thread_suspend_timeout_ns_ / 4;
+  bool collect_state = (t != 0 && (attempt_of_4 == 0 || attempt_of_4 == 4));
+  int32_t cur_val = barrier->load(std::memory_order_acquire);
+  if (cur_val <= 0) {
+    DCHECK_EQ(cur_val, 0);
+    return std::nullopt;
+  }
+  unsigned i = 0;
+  if (WaitOnceForSuspendBarrier(barrier, cur_val, timeout_ns)) {
+    i = 1;
+  }
+  cur_val = barrier->load(std::memory_order_acquire);
+  if (cur_val <= 0) {
+    DCHECK_EQ(cur_val, 0);
+    return std::nullopt;
   }
 
-  return runnable_thread_count + other_threads.size() + 1;  // +1 for self.
+  // Long wait; gather information in case of timeout.
+  std::string sampled_state = collect_state ? GetThreadState(t) : "";
+  while (i < kSuspendBarrierIters) {
+    if (WaitOnceForSuspendBarrier(barrier, cur_val, timeout_ns)) {
+      ++i;
+#if ART_USE_FUTEXES
+      if (!kShortSuspendTimeouts) {
+        CHECK_GE(NanoTime() - start_time, i * timeout_ns / kSuspendBarrierIters - 1'000'000);
+      }
+#endif
+    }
+    cur_val = barrier->load(std::memory_order_acquire);
+    if (cur_val <= 0) {
+      DCHECK_EQ(cur_val, 0);
+      return std::nullopt;
+    }
+  }
+  return collect_state ? "Target states: [" + sampled_state + ", " + GetThreadState(t) + "]" +
+                             std::to_string(cur_val) + "@" + std::to_string((uintptr_t)barrier) +
+                             " Final wait time: " + PrettyDuration(NanoTime() - start_time) :
+                         "";
 }
 
 void ThreadList::SuspendAll(const char* cause, bool long_suspend) {
@@ -658,7 +788,7 @@
     ScopedTrace trace("Suspending mutator threads");
     const uint64_t start_time = NanoTime();
 
-    SuspendAllInternal(self, self);
+    SuspendAllInternal(self);
     // All threads are known to have suspended (but a thread may still own the mutator lock)
     // Make sure this thread grabs exclusive access to the mutator lock and its protected data.
 #if HAVE_TIMED_RWLOCK
@@ -682,16 +812,21 @@
 
     const uint64_t end_time = NanoTime();
     const uint64_t suspend_time = end_time - start_time;
-    suspend_all_historam_.AdjustAndAddValue(suspend_time);
+    suspend_all_histogram_.AdjustAndAddValue(suspend_time);
     if (suspend_time > kLongThreadSuspendThreshold) {
       LOG(WARNING) << "Suspending all threads took: " << PrettyDuration(suspend_time);
     }
 
     if (kDebugLocking) {
       // Debug check that all threads are suspended.
-      AssertThreadsAreSuspended(self, self);
+      AssertOtherThreadsAreSuspended(self);
     }
   }
+
+  // SuspendAllInternal blocks if we are in the middle of a flip.
+  DCHECK(!self->ReadFlag(ThreadFlag::kPendingFlipFunction));
+  DCHECK(!self->ReadFlag(ThreadFlag::kRunningFlipFunction));
+
   ATraceBegin((std::string("Mutator threads suspended for ") + cause).c_str());
 
   if (self != nullptr) {
@@ -702,10 +837,8 @@
 }
 
 // Ensures all threads running Java suspend and that those not running Java don't start.
-void ThreadList::SuspendAllInternal(Thread* self,
-                                    Thread* ignore1,
-                                    Thread* ignore2,
-                                    SuspendReason reason) {
+void ThreadList::SuspendAllInternal(Thread* self, SuspendReason reason) {
+  // self can be nullptr if this is an unregistered thread.
   Locks::mutator_lock_->AssertNotExclusiveHeld(self);
   Locks::thread_list_lock_->AssertNotHeld(self);
   Locks::thread_suspend_count_lock_->AssertNotHeld(self);
@@ -723,91 +856,127 @@
 
   // The atomic counter for number of threads that need to pass the barrier.
   AtomicInteger pending_threads;
-  uint32_t num_ignored = 0;
-  if (ignore1 != nullptr) {
-    ++num_ignored;
-  }
-  if (ignore2 != nullptr && ignore1 != ignore2) {
-    ++num_ignored;
-  }
-  {
-    MutexLock mu(self, *Locks::thread_list_lock_);
-    MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
-    // Update global suspend all state for attaching threads.
-    ++suspend_all_count_;
-    pending_threads.store(list_.size() - num_ignored, std::memory_order_relaxed);
-    // Increment everybody's suspend count (except those that should be ignored).
-    for (const auto& thread : list_) {
-      if (thread == ignore1 || thread == ignore2) {
-        continue;
-      }
-      VLOG(threads) << "requesting thread suspend: " << *thread;
-      bool updated = thread->ModifySuspendCount(self, +1, &pending_threads, reason);
-      DCHECK(updated);
 
-      // Must install the pending_threads counter first, then check thread->IsSuspend() and clear
-      // the counter. Otherwise there's a race with Thread::TransitionFromRunnableToSuspended()
-      // that can lead a thread to miss a call to PassActiveSuspendBarriers().
-      if (thread->IsSuspended()) {
-        // Only clear the counter for the current thread.
-        thread->ClearSuspendBarrier(&pending_threads);
-        pending_threads.fetch_sub(1, std::memory_order_seq_cst);
+  for (int iter_count = 1;; ++iter_count) {
+    {
+      MutexLock mu(self, *Locks::thread_list_lock_);
+      MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
+      if (suspend_all_count_ == 0) {
+        // Never run multiple SuspendAlls concurrently.
+        // If we are asked to suspend ourselves, we proceed anyway, but must ignore suspend
+        // request from other threads until we resume them.
+        bool found_myself = false;
+        // Update global suspend all state for attaching threads.
+        ++suspend_all_count_;
+        pending_threads.store(list_.size() - (self == nullptr ? 0 : 1), std::memory_order_relaxed);
+        // Increment everybody else's suspend count.
+        for (const auto& thread : list_) {
+          if (thread == self) {
+            found_myself = true;
+          } else {
+            VLOG(threads) << "requesting thread suspend: " << *thread;
+            DCHECK_EQ(suspend_all_count_, 1);
+            thread->IncrementSuspendCount(self, &pending_threads, nullptr, reason);
+            if (thread->IsSuspended()) {
+              // Effectively pass the barrier on behalf of the already suspended thread.
+              // The thread itself cannot yet have acted on our request since we still hold the
+              // suspend_count_lock_, and it will notice that kActiveSuspendBarrier has already
+              // been cleared if and when it acquires the lock in PassActiveSuspendBarriers().
+              DCHECK_EQ(thread->tlsPtr_.active_suspendall_barrier, &pending_threads);
+              pending_threads.fetch_sub(1, std::memory_order_seq_cst);
+              thread->tlsPtr_.active_suspendall_barrier = nullptr;
+              if (!thread->HasActiveSuspendBarrier()) {
+                thread->AtomicClearFlag(ThreadFlag::kActiveSuspendBarrier);
+              }
+            }
+            // else:
+            // The target thread was not yet suspended, and hence will be forced to execute
+            // TransitionFromRunnableToSuspended shortly. Since we set the kSuspendRequest flag
+            // before checking, and it checks kActiveSuspendBarrier after noticing kSuspendRequest,
+            // it must notice kActiveSuspendBarrier when it does. Thus it is guaranteed to
+            // decrement the suspend barrier. We're relying on store; load ordering here, but
+            // that's not a problem, since state and flags all reside in the same atomic, and
+            // are thus properly ordered, even for relaxed accesses.
+          }
+        }
+        self->AtomicSetFlag(ThreadFlag::kSuspensionImmune, std::memory_order_relaxed);
+        DCHECK(self == nullptr || found_myself);
+        break;
       }
     }
+    if (iter_count >= kMaxSuspendRetries) {
+      LOG(FATAL) << "Too many SuspendAll retries: " << iter_count;
+    } else {
+      MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
+      DCHECK_LE(suspend_all_count_, 1);
+      if (suspend_all_count_ != 0) {
+        // This may take a while, and we're not runnable, and thus would otherwise not block.
+        Thread::resume_cond_->WaitHoldingLocks(self);
+        continue;
+      }
+    }
+    // We're already not runnable, so an attempt to suspend us should succeed.
   }
 
-  // Wait for the barrier to be passed by all runnable threads. This wait
-  // is done with a timeout so that we can detect problems.
-#if ART_USE_FUTEXES
-  timespec wait_timeout;
-  InitTimeSpec(false, CLOCK_MONOTONIC, NsToMs(thread_suspend_timeout_ns_), 0, &wait_timeout);
-#endif
-  const uint64_t start_time = NanoTime();
-  while (true) {
-    int32_t cur_val = pending_threads.load(std::memory_order_relaxed);
-    if (LIKELY(cur_val > 0)) {
-#if ART_USE_FUTEXES
-      if (futex(pending_threads.Address(), FUTEX_WAIT_PRIVATE, cur_val, &wait_timeout, nullptr, 0)
-          != 0) {
-        if ((errno == EAGAIN) || (errno == EINTR)) {
-          // EAGAIN and EINTR both indicate a spurious failure, try again from the beginning.
-          continue;
-        }
-        if (errno == ETIMEDOUT) {
-          const uint64_t wait_time = NanoTime() - start_time;
-          MutexLock mu(self, *Locks::thread_list_lock_);
-          MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
-          std::ostringstream oss;
-          for (const auto& thread : list_) {
-            if (thread == ignore1 || thread == ignore2) {
-              continue;
-            }
-            if (!thread->IsSuspended()) {
-              oss << std::endl << "Thread not suspended: " << *thread;
-            }
-          }
-          LOG(kIsDebugBuild ? ::android::base::FATAL : ::android::base::ERROR)
-              << "Timed out waiting for threads to suspend, waited for "
-              << PrettyDuration(wait_time)
-              << oss.str();
-        } else {
-          PLOG(FATAL) << "futex wait failed for SuspendAllInternal()";
-        }
-      }  // else re-check pending_threads in the next iteration (this may be a spurious wake-up).
-#else
-      // Spin wait. This is likely to be slow, but on most architecture ART_USE_FUTEXES is set.
-      UNUSED(start_time);
-#endif
-    } else {
-      CHECK_EQ(cur_val, 0);
+  Thread* culprit = nullptr;
+  pid_t tid = 0;
+  std::ostringstream oss;
+  for (int attempt_of_4 = 1; attempt_of_4 <= 4; ++attempt_of_4) {
+    auto result = WaitForSuspendBarrier(&pending_threads, tid, attempt_of_4);
+    if (!result.has_value()) {
+      // Wait succeeded.
       break;
     }
+    if (attempt_of_4 == 3) {
+      // Second to the last attempt; Try to gather more information in case we time out.
+      MutexLock mu(self, *Locks::thread_list_lock_);
+      MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
+      oss << "Unsuspended threads: ";
+      for (const auto& thread : list_) {
+        if (thread != self && !thread->IsSuspended()) {
+          culprit = thread;
+          oss << *thread << ", ";
+        }
+      }
+      if (culprit != nullptr) {
+        tid = culprit->GetTid();
+      }
+    } else if (attempt_of_4 == 4) {
+      // Final attempt still timed out.
+      if (culprit == nullptr) {
+        LOG(FATAL) << "SuspendAll timeout. Couldn't find holdouts.";
+      } else {
+        std::string name;
+        culprit->GetThreadName(name);
+        oss << "Info for " << *culprit << ":";
+        std::string thr_descr =
+            StringPrintf("%s tid: %d, state&flags: 0x%x, priority: %d,  barrier value: %d, ",
+                         name.c_str(),
+                         tid,
+                         culprit->GetStateAndFlags(std::memory_order_relaxed).GetValue(),
+                         culprit->GetNativePriority(),
+                         pending_threads.load());
+        oss << thr_descr << result.value();
+        culprit->AbortInThis("SuspendAll timeout: " + oss.str());
+      }
+    }
   }
 }
 
 void ThreadList::ResumeAll() {
   Thread* self = Thread::Current();
+  if (kDebugLocking) {
+    // Debug check that all threads are suspended.
+    AssertOtherThreadsAreSuspended(self);
+  }
+  MutexLock mu(self, *Locks::thread_list_lock_);
+  MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
+  ResumeAllInternal(self);
+}
 
+// Holds thread_list_lock_ and suspend_count_lock_
+void ThreadList::ResumeAllInternal(Thread* self) {
+  DCHECK_NE(self->GetState(), ThreadState::kRunnable);
   if (self != nullptr) {
     VLOG(threads) << *self << " ResumeAll starting";
   } else {
@@ -818,38 +987,32 @@
 
   ScopedTrace trace("Resuming mutator threads");
 
-  if (kDebugLocking) {
-    // Debug check that all threads are suspended.
-    AssertThreadsAreSuspended(self, self);
-  }
-
   long_suspend_ = false;
 
   Locks::mutator_lock_->ExclusiveUnlock(self);
-  {
-    MutexLock mu(self, *Locks::thread_list_lock_);
-    MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
-    // Update global suspend all state for attaching threads.
-    --suspend_all_count_;
-    // Decrement the suspend counts for all threads.
-    for (const auto& thread : list_) {
-      if (thread == self) {
-        continue;
-      }
-      bool updated = thread->ModifySuspendCount(self, -1, nullptr, SuspendReason::kInternal);
-      DCHECK(updated);
-    }
 
-    // Broadcast a notification to all suspended threads, some or all of
-    // which may choose to wake up.  No need to wait for them.
-    if (self != nullptr) {
-      VLOG(threads) << *self << " ResumeAll waking others";
-    } else {
-      VLOG(threads) << "Thread[null] ResumeAll waking others";
+  // Decrement the suspend counts for all threads.
+  for (const auto& thread : list_) {
+    if (thread != self) {
+      thread->DecrementSuspendCount(self);
     }
-    Thread::resume_cond_->Broadcast(self);
   }
 
+  // Update global suspend all state for attaching threads. Unblocks other SuspendAlls once
+  // suspend_count_lock_ is released.
+  --suspend_all_count_;
+  self->AtomicClearFlag(ThreadFlag::kSuspensionImmune, std::memory_order_relaxed);
+  // Pending suspend requests for us will be handled when we become Runnable again.
+
+  // Broadcast a notification to all suspended threads, some or all of
+  // which may choose to wake up.  No need to wait for them.
+  if (self != nullptr) {
+    VLOG(threads) << *self << " ResumeAll waking others";
+  } else {
+    VLOG(threads) << "Thread[null] ResumeAll waking others";
+  }
+  Thread::resume_cond_->Broadcast(self);
+
   if (self != nullptr) {
     VLOG(threads) << *self << " ResumeAll complete";
   } else {
@@ -871,271 +1034,227 @@
     // To check IsSuspended.
     MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
     if (UNLIKELY(!thread->IsSuspended())) {
-      LOG(ERROR) << "Resume(" << reinterpret_cast<void*>(thread)
-          << ") thread not suspended";
+      LOG(reason == SuspendReason::kForUserCode ? ERROR : FATAL)
+          << "Resume(" << reinterpret_cast<void*>(thread) << ") thread not suspended";
       return false;
     }
     if (!Contains(thread)) {
       // We only expect threads within the thread-list to have been suspended otherwise we can't
       // stop such threads from delete-ing themselves.
-      LOG(ERROR) << "Resume(" << reinterpret_cast<void*>(thread)
-          << ") thread not within thread list";
+      LOG(reason == SuspendReason::kForUserCode ? ERROR : FATAL)
+          << "Resume(" << reinterpret_cast<void*>(thread) << ") thread not within thread list";
       return false;
     }
-    if (UNLIKELY(!thread->ModifySuspendCount(self, -1, nullptr, reason))) {
-      LOG(ERROR) << "Resume(" << reinterpret_cast<void*>(thread)
-                 << ") could not modify suspend count.";
-      return false;
-    }
-  }
-
-  {
-    VLOG(threads) << "Resume(" << reinterpret_cast<void*>(thread) << ") waking others";
-    MutexLock mu(self, *Locks::thread_suspend_count_lock_);
+    thread->DecrementSuspendCount(self, /*for_user_code=*/(reason == SuspendReason::kForUserCode));
     Thread::resume_cond_->Broadcast(self);
   }
 
-  VLOG(threads) << "Resume(" << reinterpret_cast<void*>(thread) << ") complete";
+  VLOG(threads) << "Resume(" << reinterpret_cast<void*>(thread) << ") finished waking others";
   return true;
 }
 
-static void ThreadSuspendByPeerWarning(ScopedObjectAccess& soa,
-                                       LogSeverity severity,
-                                       const char* message,
-                                       jobject peer) REQUIRES_SHARED(Locks::mutator_lock_) {
-  ObjPtr<mirror::Object> name =
-      WellKnownClasses::java_lang_Thread_name->GetObject(soa.Decode<mirror::Object>(peer));
-  if (name == nullptr) {
-    LOG(severity) << message << ": " << peer;
-  } else {
-    LOG(severity) << message << ": " << peer << ":" << name->AsString()->ToModifiedUtf8();
-  }
-}
-
-Thread* ThreadList::SuspendThreadByPeer(jobject peer,
-                                        SuspendReason reason,
-                                        bool* timed_out) {
-  bool request_suspension = true;
-  const uint64_t start_time = NanoTime();
-  int self_suspend_count = 0;
-  useconds_t sleep_us = kThreadSuspendInitialSleepUs;
-  *timed_out = false;
-  Thread* const self = Thread::Current();
-  Thread* suspended_thread = nullptr;
-  VLOG(threads) << "SuspendThreadByPeer starting";
-  while (true) {
-    Thread* thread;
+bool ThreadList::SuspendThread(Thread* self,
+                               Thread* thread,
+                               SuspendReason reason,
+                               ThreadState self_state,
+                               const char* func_name,
+                               int attempt_of_4) {
+  bool is_suspended = false;
+  VLOG(threads) << func_name << "starting";
+  pid_t tid = thread->GetTid();
+  uint8_t suspended_count;
+  uint8_t checkpoint_count;
+  WrappedSuspend1Barrier wrapped_barrier{};
+  static_assert(sizeof wrapped_barrier.barrier_ == sizeof(uint32_t));
+  ThreadExitFlag tef;
+  bool exited = false;
+  thread->NotifyOnThreadExit(&tef);
+  int iter_count = 1;
+  do {
     {
-      // Note: this will transition to runnable and potentially suspend. We ensure only one thread
-      // is requesting another suspend, to avoid deadlock, by requiring this function be called
-      // holding Locks::thread_list_suspend_thread_lock_. Its important this thread suspend rather
-      // than request thread suspension, to avoid potential cycles in threads requesting each other
-      // suspend.
-      ScopedObjectAccess soa(self);
-      MutexLock thread_list_mu(self, *Locks::thread_list_lock_);
-      thread = Thread::FromManagedThread(soa, peer);
-      if (thread == nullptr) {
-        if (suspended_thread != nullptr) {
-          MutexLock suspend_count_mu(self, *Locks::thread_suspend_count_lock_);
-          // If we incremented the suspend count but the thread reset its peer, we need to
-          // re-decrement it since it is shutting down and may deadlock the runtime in
-          // ThreadList::WaitForOtherNonDaemonThreadsToExit.
-          bool updated = suspended_thread->ModifySuspendCount(soa.Self(),
-                                                              -1,
-                                                              nullptr,
-                                                              reason);
-          DCHECK(updated);
-        }
-        ThreadSuspendByPeerWarning(soa,
-                                   ::android::base::WARNING,
-                                    "No such thread for suspend",
-                                    peer);
-        return nullptr;
-      }
-      if (!Contains(thread)) {
-        CHECK(suspended_thread == nullptr);
-        VLOG(threads) << "SuspendThreadByPeer failed for unattached thread: "
-            << reinterpret_cast<void*>(thread);
-        return nullptr;
-      }
-      VLOG(threads) << "SuspendThreadByPeer found thread: " << *thread;
+      Locks::mutator_lock_->AssertSharedHeld(self);
+      Locks::thread_list_lock_->AssertHeld(self);
+      // Note: this will transition to runnable and potentially suspend.
+      DCHECK(Contains(thread));
+      // This implementation fails if thread == self. Let the clients handle that case
+      // appropriately.
+      CHECK_NE(thread, self) << func_name << "(self)";
+      VLOG(threads) << func_name << " suspending: " << *thread;
       {
         MutexLock suspend_count_mu(self, *Locks::thread_suspend_count_lock_);
-        if (request_suspension) {
-          if (self->GetSuspendCount() > 0) {
-            // We hold the suspend count lock but another thread is trying to suspend us. Its not
-            // safe to try to suspend another thread in case we get a cycle. Start the loop again
-            // which will allow this thread to be suspended.
-            ++self_suspend_count;
-            continue;
+        if (LIKELY(self->GetSuspendCount() == 0)) {
+          suspended_count = thread->suspended_count_;
+          checkpoint_count = thread->checkpoint_count_;
+          thread->IncrementSuspendCount(self, nullptr, &wrapped_barrier, reason);
+          if (thread->IsSuspended()) {
+            // See the discussion in mutator_gc_coord.md and SuspendAllInternal for the race here.
+            thread->RemoveFirstSuspend1Barrier(&wrapped_barrier);
+            // PassActiveSuspendBarriers couldn't have seen our barrier, since it also acquires
+            // 'thread_suspend_count_lock_'. `wrapped_barrier` will not be accessed.
+            if (!thread->HasActiveSuspendBarrier()) {
+              thread->AtomicClearFlag(ThreadFlag::kActiveSuspendBarrier);
+            }
+            is_suspended = true;
           }
-          CHECK(suspended_thread == nullptr);
-          suspended_thread = thread;
-          bool updated = suspended_thread->ModifySuspendCount(self, +1, nullptr, reason);
-          DCHECK(updated);
-          request_suspension = false;
-        } else {
-          // If the caller isn't requesting suspension, a suspension should have already occurred.
-          CHECK_GT(thread->GetSuspendCount(), 0);
+          DCHECK_GT(thread->GetSuspendCount(), 0);
+          break;
         }
-        // IsSuspended on the current thread will fail as the current thread is changed into
-        // Runnable above. As the suspend count is now raised if this is the current thread
-        // it will self suspend on transition to Runnable, making it hard to work with. It's simpler
-        // to just explicitly handle the current thread in the callers to this code.
-        CHECK_NE(thread, self) << "Attempt to suspend the current thread for the debugger";
-        // If thread is suspended (perhaps it was already not Runnable but didn't have a suspend
-        // count, or else we've waited and it has self suspended) or is the current thread, we're
-        // done.
-        if (thread->IsSuspended()) {
-          VLOG(threads) << "SuspendThreadByPeer thread suspended: " << *thread;
-          if (ATraceEnabled()) {
-            std::string name;
-            thread->GetThreadName(name);
-            ATraceBegin(StringPrintf("SuspendThreadByPeer suspended %s for peer=%p", name.c_str(),
-                                      peer).c_str());
-          }
-          return thread;
-        }
-        const uint64_t total_delay = NanoTime() - start_time;
-        if (total_delay >= thread_suspend_timeout_ns_) {
-          if (suspended_thread == nullptr) {
-            ThreadSuspendByPeerWarning(soa,
-                                       ::android::base::FATAL,
-                                       "Failed to issue suspend request",
-                                       peer);
-          } else {
-            CHECK_EQ(suspended_thread, thread);
-            LOG(WARNING) << "Suspended thread state_and_flags: "
-                         << suspended_thread->StateAndFlagsAsHexString()
-                         << ", self_suspend_count = " << self_suspend_count;
-            // Explicitly release thread_suspend_count_lock_; we haven't held it for long, so
-            // seeing threads blocked on it is not informative.
-            Locks::thread_suspend_count_lock_->Unlock(self);
-            ThreadSuspendByPeerWarning(soa,
-                                       ::android::base::FATAL,
-                                       "Thread suspension timed out",
-                                       peer);
-          }
-          UNREACHABLE();
-        } else if (sleep_us == 0 &&
-            total_delay > static_cast<uint64_t>(kThreadSuspendMaxYieldUs) * 1000) {
-          // We have spun for kThreadSuspendMaxYieldUs time, switch to sleeps to prevent
-          // excessive CPU usage.
-          sleep_us = kThreadSuspendMaxYieldUs / 2;
-        }
+        // Else we hold the suspend count lock but another thread is trying to suspend us,
+        // making it unsafe to try to suspend another thread in case we get a cycle.
+        // Start the loop again, which will allow this thread to be suspended.
       }
-      // Release locks and come out of runnable state.
     }
-    VLOG(threads) << "SuspendThreadByPeer waiting to allow thread chance to suspend";
-    ThreadSuspendSleep(sleep_us);
-    // This may stay at 0 if sleep_us == 0, but this is WAI since we want to avoid using usleep at
-    // all if possible. This shouldn't be an issue since time to suspend should always be small.
-    sleep_us = std::min(sleep_us * 2, kThreadSuspendMaxSleepUs);
+    // All locks are released, and we should quickly exit the suspend-unfriendly state. Retry.
+    if (iter_count >= kMaxSuspendRetries) {
+      LOG(FATAL) << "Too many suspend retries";
+    }
+    Locks::thread_list_lock_->ExclusiveUnlock(self);
+    {
+      ScopedThreadSuspension sts(self, ThreadState::kSuspended);
+      usleep(kThreadSuspendSleepUs);
+      ++iter_count;
+    }
+    Locks::thread_list_lock_->ExclusiveLock(self);
+    exited = tef.HasExited();
+  } while (!exited);
+  thread->UnregisterThreadExitFlag(&tef);
+  Locks::thread_list_lock_->ExclusiveUnlock(self);
+  self->TransitionFromRunnableToSuspended(self_state);
+  if (exited) {
+    // This is OK: There's a race in inflating a lock and the owner giving up ownership and then
+    // dying.
+    LOG(WARNING) << StringPrintf("Thread with tid %d exited before suspending", tid);
+    return false;
   }
+  // Now wait for target to decrement suspend barrier.
+  std::optional<std::string> failure_info;
+  if (!is_suspended) {
+    failure_info = WaitForSuspendBarrier(&wrapped_barrier.barrier_, tid, attempt_of_4);
+    if (!failure_info.has_value()) {
+      is_suspended = true;
+    }
+  }
+  while (!is_suspended) {
+    if (attempt_of_4 > 0 && attempt_of_4 < 4) {
+      // Caller will try again. Give up and resume the thread for now.  We need to make sure
+      // that wrapped_barrier is removed from the list before we deallocate it.
+      MutexLock suspend_count_mu(self, *Locks::thread_suspend_count_lock_);
+      if (wrapped_barrier.barrier_.load() == 0) {
+        // Succeeded in the meantime.
+        is_suspended = true;
+        continue;
+      }
+      thread->RemoveSuspend1Barrier(&wrapped_barrier);
+      if (!thread->HasActiveSuspendBarrier()) {
+        thread->AtomicClearFlag(ThreadFlag::kActiveSuspendBarrier);
+      }
+      // Do not call Resume(), since we are probably not fully suspended.
+      thread->DecrementSuspendCount(self,
+                                    /*for_user_code=*/(reason == SuspendReason::kForUserCode));
+      Thread::resume_cond_->Broadcast(self);
+      return false;
+    }
+    std::string name;
+    thread->GetThreadName(name);
+    WrappedSuspend1Barrier* first_barrier;
+    {
+      MutexLock suspend_count_mu(self, *Locks::thread_suspend_count_lock_);
+      first_barrier = thread->tlsPtr_.active_suspend1_barriers;
+    }
+    // 'thread' should still have a suspend request pending, and hence stick around. Try to abort
+    // there, since its stack trace is much more interesting than ours.
+    std::string message = StringPrintf(
+        "%s timed out: %d (%s), state&flags: 0x%x, priority: %d,"
+        " barriers: %p, ours: %p, barrier value: %d, nsusps: %d, ncheckpts: %d, thread_info: %s",
+        func_name,
+        thread->GetTid(),
+        name.c_str(),
+        thread->GetStateAndFlags(std::memory_order_relaxed).GetValue(),
+        thread->GetNativePriority(),
+        first_barrier,
+        &wrapped_barrier,
+        wrapped_barrier.barrier_.load(),
+        thread->suspended_count_ - suspended_count,
+        thread->checkpoint_count_ - checkpoint_count,
+        failure_info.value().c_str());
+    // Check one last time whether thread passed the suspend barrier. Empirically this seems to
+    // happen maybe between 1 and 5% of the time.
+    if (wrapped_barrier.barrier_.load() != 0) {
+      // thread still has a pointer to wrapped_barrier. Returning and continuing would be unsafe
+      // without additional cleanup.
+      thread->AbortInThis(message);
+      UNREACHABLE();
+    }
+    is_suspended = true;
+  }
+  // wrapped_barrier.barrier_ will no longer be accessed.
+  VLOG(threads) << func_name << " suspended: " << *thread;
+  if (ATraceEnabled()) {
+    std::string name;
+    thread->GetThreadName(name);
+    ATraceBegin(
+        StringPrintf("%s suspended %s for tid=%d", func_name, name.c_str(), thread->GetTid())
+            .c_str());
+  }
+  if (kIsDebugBuild) {
+    CHECK(thread->IsSuspended());
+    MutexLock suspend_count_mu(self, *Locks::thread_suspend_count_lock_);
+    thread->CheckBarrierInactive(&wrapped_barrier);
+  }
+  return true;
 }
 
-static void ThreadSuspendByThreadIdWarning(LogSeverity severity,
-                                           const char* message,
-                                           uint32_t thread_id) {
-  LOG(severity) << StringPrintf("%s: %d", message, thread_id);
+Thread* ThreadList::SuspendThreadByPeer(jobject peer, SuspendReason reason) {
+  Thread* const self = Thread::Current();
+  ThreadState old_self_state = self->GetState();
+  self->TransitionFromSuspendedToRunnable();
+  Locks::thread_list_lock_->ExclusiveLock(self);
+  ObjPtr<mirror::Object> thread_ptr = self->DecodeJObject(peer);
+  Thread* thread = Thread::FromManagedThread(self, thread_ptr);
+  if (thread == nullptr || !Contains(thread)) {
+    if (thread == nullptr) {
+      ObjPtr<mirror::Object> name = WellKnownClasses::java_lang_Thread_name->GetObject(thread_ptr);
+      std::string thr_name = (name == nullptr ? "<unknown>" : name->AsString()->ToModifiedUtf8());
+      LOG(WARNING) << "No such thread for suspend"
+                   << ": " << peer << ":" << thr_name;
+    } else {
+      LOG(WARNING) << "SuspendThreadByPeer failed for unattached thread: "
+                   << reinterpret_cast<void*>(thread);
+    }
+    Locks::thread_list_lock_->ExclusiveUnlock(self);
+    self->TransitionFromRunnableToSuspended(old_self_state);
+    return nullptr;
+  }
+  VLOG(threads) << "SuspendThreadByPeer found thread: " << *thread;
+  // Releases thread_list_lock_ and mutator lock.
+  bool success = SuspendThread(self, thread, reason, old_self_state, __func__, 0);
+  Locks::thread_list_lock_->AssertNotHeld(self);
+  return success ? thread : nullptr;
 }
 
 Thread* ThreadList::SuspendThreadByThreadId(uint32_t thread_id,
                                             SuspendReason reason,
-                                            bool* timed_out) {
-  const uint64_t start_time = NanoTime();
-  useconds_t sleep_us = kThreadSuspendInitialSleepUs;
-  *timed_out = false;
-  Thread* suspended_thread = nullptr;
+                                            int attempt_of_4) {
   Thread* const self = Thread::Current();
+  ThreadState old_self_state = self->GetState();
   CHECK_NE(thread_id, kInvalidThreadId);
   VLOG(threads) << "SuspendThreadByThreadId starting";
-  while (true) {
-    {
-      // Note: this will transition to runnable and potentially suspend. We ensure only one thread
-      // is requesting another suspend, to avoid deadlock, by requiring this function be called
-      // holding Locks::thread_list_suspend_thread_lock_. Its important this thread suspend rather
-      // than request thread suspension, to avoid potential cycles in threads requesting each other
-      // suspend.
-      ScopedObjectAccess soa(self);
-      MutexLock thread_list_mu(self, *Locks::thread_list_lock_);
-      Thread* thread = nullptr;
-      for (const auto& it : list_) {
-        if (it->GetThreadId() == thread_id) {
-          thread = it;
-          break;
-        }
-      }
-      if (thread == nullptr) {
-        CHECK(suspended_thread == nullptr) << "Suspended thread " << suspended_thread
-            << " no longer in thread list";
-        // There's a race in inflating a lock and the owner giving up ownership and then dying.
-        ThreadSuspendByThreadIdWarning(::android::base::WARNING,
-                                       "No such thread id for suspend",
-                                       thread_id);
-        return nullptr;
-      }
-      VLOG(threads) << "SuspendThreadByThreadId found thread: " << *thread;
-      DCHECK(Contains(thread));
-      {
-        MutexLock suspend_count_mu(self, *Locks::thread_suspend_count_lock_);
-        if (suspended_thread == nullptr) {
-          if (self->GetSuspendCount() > 0) {
-            // We hold the suspend count lock but another thread is trying to suspend us. Its not
-            // safe to try to suspend another thread in case we get a cycle. Start the loop again
-            // which will allow this thread to be suspended.
-            continue;
-          }
-          bool updated = thread->ModifySuspendCount(self, +1, nullptr, reason);
-          DCHECK(updated);
-          suspended_thread = thread;
-        } else {
-          CHECK_EQ(suspended_thread, thread);
-          // If the caller isn't requesting suspension, a suspension should have already occurred.
-          CHECK_GT(thread->GetSuspendCount(), 0);
-        }
-        // IsSuspended on the current thread will fail as the current thread is changed into
-        // Runnable above. As the suspend count is now raised if this is the current thread
-        // it will self suspend on transition to Runnable, making it hard to work with. It's simpler
-        // to just explicitly handle the current thread in the callers to this code.
-        CHECK_NE(thread, self) << "Attempt to suspend the current thread for the debugger";
-        // If thread is suspended (perhaps it was already not Runnable but didn't have a suspend
-        // count, or else we've waited and it has self suspended) or is the current thread, we're
-        // done.
-        if (thread->IsSuspended()) {
-          if (ATraceEnabled()) {
-            std::string name;
-            thread->GetThreadName(name);
-            ATraceBegin(StringPrintf("SuspendThreadByThreadId suspended %s id=%d",
-                                      name.c_str(), thread_id).c_str());
-          }
-          VLOG(threads) << "SuspendThreadByThreadId thread suspended: " << *thread;
-          return thread;
-        }
-        const uint64_t total_delay = NanoTime() - start_time;
-        if (total_delay >= thread_suspend_timeout_ns_) {
-          ThreadSuspendByThreadIdWarning(::android::base::WARNING,
-                                         "Thread suspension timed out",
-                                         thread_id);
-          if (suspended_thread != nullptr) {
-            bool updated = thread->ModifySuspendCount(soa.Self(), -1, nullptr, reason);
-            DCHECK(updated);
-          }
-          *timed_out = true;
-          return nullptr;
-        } else if (sleep_us == 0 &&
-            total_delay > static_cast<uint64_t>(kThreadSuspendMaxYieldUs) * 1000) {
-          // We have spun for kThreadSuspendMaxYieldUs time, switch to sleeps to prevent
-          // excessive CPU usage.
-          sleep_us = kThreadSuspendMaxYieldUs / 2;
-        }
-      }
-      // Release locks and come out of runnable state.
-    }
-    VLOG(threads) << "SuspendThreadByThreadId waiting to allow thread chance to suspend";
-    ThreadSuspendSleep(sleep_us);
-    sleep_us = std::min(sleep_us * 2, kThreadSuspendMaxSleepUs);
+  self->TransitionFromSuspendedToRunnable();
+  Locks::thread_list_lock_->ExclusiveLock(self);
+  Thread* thread = FindThreadByThreadId(thread_id);
+  if (thread == nullptr) {
+    // There's a race in inflating a lock and the owner giving up ownership and then dying.
+    LOG(WARNING) << StringPrintf("No such thread id %d for suspend", thread_id);
+    Locks::thread_list_lock_->ExclusiveUnlock(self);
+    self->TransitionFromRunnableToSuspended(old_self_state);
+    return nullptr;
   }
+  DCHECK(Contains(thread));
+  VLOG(threads) << "SuspendThreadByThreadId found thread: " << *thread;
+  // Releases thread_list_lock_ and mutator lock.
+  bool success = SuspendThread(self, thread, reason, old_self_state, __func__, attempt_of_4);
+  Locks::thread_list_lock_->AssertNotHeld(self);
+  return success ? thread : nullptr;
 }
 
 Thread* ThreadList::FindThreadByThreadId(uint32_t thread_id) {
@@ -1210,8 +1329,7 @@
       // daemons.
       CHECK(thread->IsDaemon()) << *thread;
       if (thread != self) {
-        bool updated = thread->ModifySuspendCount(self, +1, nullptr, SuspendReason::kInternal);
-        DCHECK(updated);
+        thread->IncrementSuspendCount(self);
         ++daemons_left;
       }
       // We are shutting down the runtime, set the JNI functions of all the JNIEnvs to be
@@ -1311,11 +1429,10 @@
   // SuspendAll requests.
   MutexLock mu(self, *Locks::thread_list_lock_);
   MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
-  // Modify suspend count in increments of 1 to maintain invariants in ModifySuspendCount. While
-  // this isn't particularly efficient the suspend counts are most commonly 0 or 1.
-  for (int delta = suspend_all_count_; delta > 0; delta--) {
-    bool updated = self->ModifySuspendCount(self, +1, nullptr, SuspendReason::kInternal);
-    DCHECK(updated);
+  if (suspend_all_count_ == 1) {
+    self->IncrementSuspendCount(self);
+  } else {
+    DCHECK_EQ(suspend_all_count_, 0);
   }
   CHECK(!Contains(self));
   list_.push_back(self);
@@ -1354,9 +1471,6 @@
   // list.
   self->Destroy(should_run_callbacks);
 
-  // If tracing, remember thread id and name before thread exits.
-  Trace::StoreExitingThreadInfo(self);
-
   uint32_t thin_lock_id = self->GetThreadId();
   while (true) {
     // Remove and delete the Thread* while holding the thread_list_lock_ and
@@ -1369,12 +1483,15 @@
         self->GetThreadName(thread_name);
         std::ostringstream os;
         DumpNativeStack(os, GetTid(), "  native: ", nullptr);
-        LOG(ERROR) << "Request to unregister unattached thread " << thread_name << "\n" << os.str();
-        break;
+        LOG(FATAL) << "Request to unregister unattached thread " << thread_name << "\n" << os.str();
+        UNREACHABLE();
       } else {
         MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
-        if (!self->IsSuspended()) {
+        Thread::StateAndFlags state_and_flags = self->GetStateAndFlags(std::memory_order_acquire);
+        if (!state_and_flags.IsFlagSet(ThreadFlag::kRunningFlipFunction) &&
+            !state_and_flags.IsFlagSet(ThreadFlag::kSuspendRequest)) {
           list_.remove(self);
+          self->SignalExitFlags();
           break;
         }
       }
@@ -1382,7 +1499,7 @@
     // In the case where we are not suspended yet, sleep to leave other threads time to execute.
     // This is important if there are realtime threads. b/111277984
     usleep(1);
-    // We failed to remove the thread due to a suspend request, loop and try again.
+    // We failed to remove the thread due to a suspend request or the like, loop and try again.
   }
   delete self;
 
@@ -1429,13 +1546,11 @@
     MutexLock mu(self, *Locks::thread_list_lock_);
     MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
     for (Thread* thread : list_) {
-      bool suspended = thread->ModifySuspendCount(self, +1, nullptr, SuspendReason::kInternal);
-      DCHECK(suspended);
+      thread->IncrementSuspendCount(self);
       if (thread == self || thread->IsSuspended()) {
         threads_to_visit.push_back(thread);
       } else {
-        bool resumed = thread->ModifySuspendCount(self, -1, nullptr, SuspendReason::kInternal);
-        DCHECK(resumed);
+        thread->DecrementSuspendCount(self);
       }
     }
   }
@@ -1450,9 +1565,9 @@
   {
     MutexLock mu2(self, *Locks::thread_suspend_count_lock_);
     for (Thread* thread : threads_to_visit) {
-      bool updated = thread->ModifySuspendCount(self, -1, nullptr, SuspendReason::kInternal);
-      DCHECK(updated);
+      thread->DecrementSuspendCount(self);
     }
+    Thread::resume_cond_->Broadcast(self);
   }
 }
 
diff --git a/runtime/thread_list.h b/runtime/thread_list.h
index db06611..8be2d4e 100644
--- a/runtime/thread_list.h
+++ b/runtime/thread_list.h
@@ -17,19 +17,21 @@
 #ifndef ART_RUNTIME_THREAD_LIST_H_
 #define ART_RUNTIME_THREAD_LIST_H_
 
-#include "barrier.h"
-#include "base/histogram.h"
-#include "base/mutex.h"
-#include "base/value_object.h"
-#include "jni.h"
-#include "reflective_handle_scope.h"
-#include "suspend_reason.h"
-
 #include <bitset>
 #include <list>
 #include <vector>
 
-namespace art {
+#include "barrier.h"
+#include "base/histogram.h"
+#include "base/mutex.h"
+#include "base/macros.h"
+#include "base/value_object.h"
+#include "jni.h"
+#include "reflective_handle_scope.h"
+#include "suspend_reason.h"
+#include "thread_state.h"
+
+namespace art HIDDEN {
 namespace gc {
 namespace collector {
 class GarbageCollector;
@@ -49,7 +51,11 @@
   static constexpr uint32_t kInvalidThreadId = 0;
   static constexpr uint32_t kMainThreadId = 1;
   static constexpr uint64_t kDefaultThreadSuspendTimeout =
-      kIsDebugBuild ? 50'000'000'000ull : 10'000'000'000ull;
+      kIsDebugBuild ? 2'000'000'000ull : 4'000'000'000ull;
+  // We fail more aggressively in debug builds to catch potential issues early.
+  // The number of times we may retry when we find ourselves in a suspend-unfriendly state.
+  static constexpr int kMaxSuspendRetries = kIsDebugBuild ? 500 : 5000;
+  static constexpr useconds_t kThreadSuspendSleepUs = 100;
 
   explicit ThreadList(uint64_t thread_suspend_timeout_ns);
   ~ThreadList();
@@ -59,21 +65,21 @@
   void DumpForSigQuit(std::ostream& os)
       REQUIRES(!Locks::thread_list_lock_, !Locks::mutator_lock_);
   // For thread suspend timeout dumps.
-  void Dump(std::ostream& os, bool dump_native_stack = true)
+  EXPORT void Dump(std::ostream& os, bool dump_native_stack = true)
       REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_);
   pid_t GetLockOwner();  // For SignalCatcher.
 
   // Thread suspension support.
-  void ResumeAll()
+  EXPORT void ResumeAll()
       REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_)
       UNLOCK_FUNCTION(Locks::mutator_lock_);
-  bool Resume(Thread* thread, SuspendReason reason = SuspendReason::kInternal)
+  EXPORT bool Resume(Thread* thread, SuspendReason reason = SuspendReason::kInternal)
       REQUIRES(!Locks::thread_suspend_count_lock_) WARN_UNUSED;
 
-  // Suspends all threads and gets exclusive access to the mutator lock.
+  // Suspends all other threads and gets exclusive access to the mutator lock.
   // If long_suspend is true, then other threads who try to suspend will never timeout.
   // long_suspend is currenly used for hprof since large heaps take a long time.
-  void SuspendAll(const char* cause, bool long_suspend = false)
+  EXPORT void SuspendAll(const char* cause, bool long_suspend = false)
       EXCLUSIVE_LOCK_FUNCTION(Locks::mutator_lock_)
       REQUIRES(!Locks::thread_list_lock_,
                !Locks::thread_suspend_count_lock_,
@@ -81,10 +87,7 @@
 
   // Suspend a thread using a peer, typically used by the debugger. Returns the thread on success,
   // else null. The peer is used to identify the thread to avoid races with the thread terminating.
-  // If the suspension times out then *timeout is set to true.
-  Thread* SuspendThreadByPeer(jobject peer,
-                              SuspendReason reason,
-                              bool* timed_out)
+  EXPORT Thread* SuspendThreadByPeer(jobject peer, SuspendReason reason)
       REQUIRES(!Locks::mutator_lock_,
                !Locks::thread_list_lock_,
                !Locks::thread_suspend_count_lock_);
@@ -92,14 +95,16 @@
   // Suspend a thread using its thread id, typically used by lock/monitor inflation. Returns the
   // thread on success else null. The thread id is used to identify the thread to avoid races with
   // the thread terminating. Note that as thread ids are recycled this may not suspend the expected
-  // thread, that may be terminating. If the suspension times out then *timeout is set to true.
-  Thread* SuspendThreadByThreadId(uint32_t thread_id, SuspendReason reason, bool* timed_out)
+  // thread, that may be terminating. 'attempt_of_4' is zero if this is the only
+  // attempt, or 1..4 to try 4 times with fractional timeouts.
+  // TODO: Reconsider the use of thread_id, now that we have ThreadExitFlag.
+  Thread* SuspendThreadByThreadId(uint32_t thread_id, SuspendReason reason, int attempt_of_4 = 0)
       REQUIRES(!Locks::mutator_lock_,
                !Locks::thread_list_lock_,
                !Locks::thread_suspend_count_lock_);
 
   // Find an existing thread (or self) by its thread id (not tid).
-  Thread* FindThreadByThreadId(uint32_t thread_id) REQUIRES(Locks::thread_list_lock_);
+  EXPORT Thread* FindThreadByThreadId(uint32_t thread_id) REQUIRES(Locks::thread_list_lock_);
 
   // Find an existing thread (or self) by its tid (not thread id).
   Thread* FindThreadByTid(int tid) REQUIRES(Locks::thread_list_lock_);
@@ -113,11 +118,24 @@
   // Running threads are not suspended but run the checkpoint inside of the suspend check. The
   // return value includes already suspended threads for b/24191051. Runs or requests the
   // callback, if non-null, inside the thread_list_lock critical section after determining the
-  // runnable/suspended states of the threads. Does not wait for completion of the callbacks in
-  // running threads.
-  size_t RunCheckpoint(Closure* checkpoint_function, Closure* callback = nullptr)
+  // runnable/suspended states of the threads. Does not wait for completion of the checkpoint
+  // function in running threads. If the caller holds the mutator lock, then all instances of the
+  // checkpoint function are run with the mutator lock. If the caller does not hold the mutator
+  // lock (see mutator_gc_coord.md) then, since the checkpoint code may not acquire or release the
+  // mutator lock, the checkpoint will have no way to access Java data.
+  // TODO: Is it possible to just require the mutator lock here?
+  EXPORT size_t RunCheckpoint(Closure* checkpoint_function,
+                       Closure* callback = nullptr,
+                       bool allow_lock_checking = true)
       REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_);
 
+  // Convenience version of the above to disable lock checking inside Run function. Hopefully this
+  // and the third parameter above will eventually disappear.
+  size_t RunCheckpointUnchecked(Closure* checkpoint_function, Closure* callback = nullptr)
+      REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_) {
+    return RunCheckpoint(checkpoint_function, callback, false);
+  }
+
   // Run an empty checkpoint on threads. Wait until threads pass the next suspend point or are
   // suspended. This is used to ensure that the threads finish or aren't in the middle of an
   // in-flight mutator heap access (eg. a read barrier.) Runnable threads will respond by
@@ -126,18 +144,23 @@
   void RunEmptyCheckpoint()
       REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_);
 
-  // Flip thread roots from from-space refs to to-space refs. Used by
-  // the concurrent moving collectors.
-  size_t FlipThreadRoots(Closure* thread_flip_visitor,
-                         Closure* flip_callback,
-                         gc::collector::GarbageCollector* collector,
-                         gc::GcPauseListener* pause_listener)
+  // Used to flip thread roots from from-space refs to to-space refs. Used only by the concurrent
+  // moving collectors during a GC, and hence cannot be called from multiple threads concurrently.
+  //
+  // Briefly suspends all threads to atomically install a checkpoint-like thread_flip_visitor
+  // function to be run on each thread. Run flip_callback while threads are suspended.
+  // Thread_flip_visitors are run by each thread before it becomes runnable, or by us. We do not
+  // return until all thread_flip_visitors have been run.
+  void FlipThreadRoots(Closure* thread_flip_visitor,
+                       Closure* flip_callback,
+                       gc::collector::GarbageCollector* collector,
+                       gc::GcPauseListener* pause_listener)
       REQUIRES(!Locks::mutator_lock_,
                !Locks::thread_list_lock_,
                !Locks::thread_suspend_count_lock_);
 
   // Iterates over all the threads.
-  void ForEach(void (*callback)(Thread*, void*), void* context)
+  EXPORT void ForEach(void (*callback)(Thread*, void*), void* context)
       REQUIRES(Locks::thread_list_lock_);
 
   template<typename CallBack>
@@ -171,7 +194,7 @@
 
   void VisitReflectiveTargets(ReflectiveValueVisitor* visitor) const REQUIRES(Locks::mutator_lock_);
 
-  void SweepInterpreterCaches(IsMarkedVisitor* visitor) const
+  EXPORT void SweepInterpreterCaches(IsMarkedVisitor* visitor) const
       REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_);
 
   // Return a copy of the thread list.
@@ -192,26 +215,49 @@
       REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_,
                !Locks::mutator_lock_);
 
+  // Wait for suspend barrier to reach zero. Return a string possibly containing diagnostic
+  // information on timeout, nothing on success.  The argument t specifies a thread to monitor for
+  // the diagnostic information. If 0 is passed, we return an empty string on timeout.  Normally
+  // the caller does not hold the mutator lock. See the comment at the call in
+  // RequestSynchronousCheckpoint for the only exception.
+  std::optional<std::string> WaitForSuspendBarrier(AtomicInteger* barrier,
+                                                   pid_t t = 0,
+                                                   int attempt_of_4 = 0)
+      REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_);
+
  private:
   uint32_t AllocThreadId(Thread* self);
   void ReleaseThreadId(Thread* self, uint32_t id) REQUIRES(!Locks::allocated_thread_ids_lock_);
 
-  size_t RunCheckpoint(Closure* checkpoint_function, bool includeSuspended)
-      REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_);
-
   void DumpUnattachedThreads(std::ostream& os, bool dump_native_stack)
       REQUIRES(!Locks::thread_list_lock_);
 
   void SuspendAllDaemonThreadsForShutdown()
       REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_);
 
-  void SuspendAllInternal(Thread* self,
-                          Thread* ignore1,
-                          Thread* ignore2 = nullptr,
-                          SuspendReason reason = SuspendReason::kInternal)
-      REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_);
+  void ResumeAllInternal(Thread* self)
+      REQUIRES(Locks::thread_list_lock_, Locks::thread_suspend_count_lock_)
+          UNLOCK_FUNCTION(Locks::mutator_lock_);
 
-  void AssertThreadsAreSuspended(Thread* self, Thread* ignore1, Thread* ignore2 = nullptr)
+  // Helper to actually suspend a single thread. This is called with thread_list_lock_ held and
+  // the caller guarantees that *thread is valid until that is released.  We "release the mutator
+  // lock", by switching to self_state.  'attempt_of_4' is 0 if we only attempt once, and 1..4 if
+  // we are going to try 4 times with a quarter of the full timeout. 'func_name' is used only to
+  // identify ourselves for logging.
+  bool SuspendThread(Thread* self,
+                     Thread* thread,
+                     SuspendReason reason,
+                     ThreadState self_state,
+                     const char* func_name,
+                     int attempt_of_4) RELEASE(Locks::thread_list_lock_)
+      RELEASE_SHARED(Locks::mutator_lock_);
+
+  void SuspendAllInternal(Thread* self, SuspendReason reason = SuspendReason::kInternal)
+      REQUIRES(!Locks::thread_list_lock_,
+               !Locks::thread_suspend_count_lock_,
+               !Locks::mutator_lock_);
+
+  void AssertOtherThreadsAreSuspended(Thread* self)
       REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_);
 
   std::bitset<kMaxThreadId> allocated_ids_ GUARDED_BY(Locks::allocated_thread_ids_lock_);
@@ -219,7 +265,10 @@
   // The actual list of all threads.
   std::list<Thread*> list_ GUARDED_BY(Locks::thread_list_lock_);
 
-  // Ongoing suspend all requests, used to ensure threads added to list_ respect SuspendAll.
+  // Ongoing suspend all requests, used to ensure threads added to list_ respect SuspendAll, and
+  // to ensure that only one SuspendAll ot FlipThreadRoots call is active at a time.  The value is
+  // always either 0 or 1. Thread_suspend_count_lock must be held continuously while these two
+  // functions modify suspend counts of all other threads and modify suspend_all_count_ .
   int suspend_all_count_ GUARDED_BY(Locks::thread_suspend_count_lock_);
 
   // Number of threads unregistering, ~ThreadList blocks until this hits 0.
@@ -227,7 +276,7 @@
 
   // Thread suspend time histogram. Only modified when all the threads are suspended, so guarding
   // by mutator lock ensures no thread can read when another thread is modifying it.
-  Histogram<uint64_t> suspend_all_historam_ GUARDED_BY(Locks::mutator_lock_);
+  Histogram<uint64_t> suspend_all_histogram_ GUARDED_BY(Locks::mutator_lock_);
 
   // Whether or not the current thread suspension is long.
   bool long_suspend_;
@@ -243,19 +292,22 @@
 
   friend class Thread;
 
+  friend class Mutex;
+  friend class BaseMutex;
+
   DISALLOW_COPY_AND_ASSIGN(ThreadList);
 };
 
 // Helper for suspending all threads and getting exclusive access to the mutator lock.
 class ScopedSuspendAll : public ValueObject {
  public:
-  explicit ScopedSuspendAll(const char* cause, bool long_suspend = false)
+  EXPORT explicit ScopedSuspendAll(const char* cause, bool long_suspend = false)
      EXCLUSIVE_LOCK_FUNCTION(Locks::mutator_lock_)
      REQUIRES(!Locks::thread_list_lock_,
               !Locks::thread_suspend_count_lock_,
               !Locks::mutator_lock_);
   // No REQUIRES(mutator_lock_) since the unlock function already asserts this.
-  ~ScopedSuspendAll()
+  EXPORT ~ScopedSuspendAll()
       REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_)
       UNLOCK_FUNCTION(Locks::mutator_lock_);
 };
diff --git a/runtime/thread_pool.cc b/runtime/thread_pool.cc
index 92ac845..f0ea078 100644
--- a/runtime/thread_pool.cc
+++ b/runtime/thread_pool.cc
@@ -34,7 +34,7 @@
 #include "runtime.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -46,7 +46,8 @@
 static constexpr bool kUseCustomThreadPoolStack = true;
 #endif
 
-ThreadPoolWorker::ThreadPoolWorker(ThreadPool* thread_pool, const std::string& name,
+ThreadPoolWorker::ThreadPoolWorker(AbstractThreadPool* thread_pool,
+                                   const std::string& name,
                                    size_t stack_size)
     : thread_pool_(thread_pool),
       name_(name) {
@@ -55,18 +56,18 @@
   // a guard page, so don't do anything special on Bionic libc.
   if (kUseCustomThreadPoolStack) {
     // Add an inaccessible page to catch stack overflow.
-    stack_size += kPageSize;
+    stack_size += gPageSize;
     stack_ = MemMap::MapAnonymous(name.c_str(),
                                   stack_size,
                                   PROT_READ | PROT_WRITE,
                                   /*low_4gb=*/ false,
                                   &error_msg);
     CHECK(stack_.IsValid()) << error_msg;
-    CHECK_ALIGNED(stack_.Begin(), kPageSize);
+    CHECK_ALIGNED_PARAM(stack_.Begin(), gPageSize);
     CheckedCall(mprotect,
                 "mprotect bottom page of thread pool worker stack",
                 stack_.Begin(),
-                kPageSize,
+                gPageSize,
                 PROT_NONE);
   }
   const char* reason = "new thread pool worker thread";
@@ -159,17 +160,28 @@
   // The ThreadPool is responsible for calling Finalize (which usually delete
   // the task memory) on all the tasks.
   Task* task = nullptr;
-  while ((task = TryGetTask(self)) != nullptr) {
+  do {
+    {
+      MutexLock mu(self, task_queue_lock_);
+      if (tasks_.empty()) {
+        return;
+      }
+      task = tasks_.front();
+      tasks_.pop_front();
+    }
     task->Finalize();
-  }
-  MutexLock mu(self, task_queue_lock_);
-  tasks_.clear();
+  } while (true);
 }
 
-ThreadPool::ThreadPool(const char* name,
-                       size_t num_threads,
-                       bool create_peers,
-                       size_t worker_stack_size)
+ThreadPool::~ThreadPool() {
+  DeleteThreads();
+  RemoveAllTasks(Thread::Current());
+}
+
+AbstractThreadPool::AbstractThreadPool(const char* name,
+                                       size_t num_threads,
+                                       bool create_peers,
+                                       size_t worker_stack_size)
   : name_(name),
     task_queue_lock_("task queue lock", kGenericBottomLock),
     task_queue_condition_("task queue condition", task_queue_lock_),
@@ -182,11 +194,9 @@
     creation_barier_(0),
     max_active_workers_(num_threads),
     create_peers_(create_peers),
-    worker_stack_size_(worker_stack_size) {
-  CreateThreads();
-}
+    worker_stack_size_(worker_stack_size) {}
 
-void ThreadPool::CreateThreads() {
+void AbstractThreadPool::CreateThreads() {
   CHECK(threads_.empty());
   Thread* self = Thread::Current();
   {
@@ -203,17 +213,17 @@
   }
 }
 
-void ThreadPool::WaitForWorkersToBeCreated() {
+void AbstractThreadPool::WaitForWorkersToBeCreated() {
   creation_barier_.Increment(Thread::Current(), 0);
 }
 
-const std::vector<ThreadPoolWorker*>& ThreadPool::GetWorkers() {
+const std::vector<ThreadPoolWorker*>& AbstractThreadPool::GetWorkers() {
   // Wait for all the workers to be created before returning them.
   WaitForWorkersToBeCreated();
   return threads_;
 }
 
-void ThreadPool::DeleteThreads() {
+void AbstractThreadPool::DeleteThreads() {
   {
     Thread* self = Thread::Current();
     MutexLock mu(self, task_queue_lock_);
@@ -229,18 +239,13 @@
   STLDeleteElements(&threads_);
 }
 
-void ThreadPool::SetMaxActiveWorkers(size_t max_workers) {
+void AbstractThreadPool::SetMaxActiveWorkers(size_t max_workers) {
   MutexLock mu(Thread::Current(), task_queue_lock_);
   CHECK_LE(max_workers, GetThreadCount());
   max_active_workers_ = max_workers;
 }
 
-ThreadPool::~ThreadPool() {
-  DeleteThreads();
-  RemoveAllTasks(Thread::Current());
-}
-
-void ThreadPool::StartWorkers(Thread* self) {
+void AbstractThreadPool::StartWorkers(Thread* self) {
   MutexLock mu(self, task_queue_lock_);
   started_ = true;
   task_queue_condition_.Broadcast(self);
@@ -248,17 +253,17 @@
   total_wait_time_ = 0;
 }
 
-void ThreadPool::StopWorkers(Thread* self) {
+void AbstractThreadPool::StopWorkers(Thread* self) {
   MutexLock mu(self, task_queue_lock_);
   started_ = false;
 }
 
-bool ThreadPool::HasStarted(Thread* self) {
+bool AbstractThreadPool::HasStarted(Thread* self) {
   MutexLock mu(self, task_queue_lock_);
   return started_;
 }
 
-Task* ThreadPool::GetTask(Thread* self) {
+Task* AbstractThreadPool::GetTask(Thread* self) {
   MutexLock mu(self, task_queue_lock_);
   while (!IsShuttingDown()) {
     const size_t thread_count = GetThreadCount();
@@ -290,7 +295,7 @@
   return nullptr;
 }
 
-Task* ThreadPool::TryGetTask(Thread* self) {
+Task* AbstractThreadPool::TryGetTask(Thread* self) {
   MutexLock mu(self, task_queue_lock_);
   return TryGetTaskLocked();
 }
@@ -304,7 +309,7 @@
   return nullptr;
 }
 
-void ThreadPool::Wait(Thread* self, bool do_work, bool may_hold_locks) {
+void AbstractThreadPool::Wait(Thread* self, bool do_work, bool may_hold_locks) {
   if (do_work) {
     CHECK(!create_peers_);
     Task* task = nullptr;
@@ -329,13 +334,13 @@
   return tasks_.size();
 }
 
-void ThreadPool::SetPthreadPriority(int priority) {
+void AbstractThreadPool::SetPthreadPriority(int priority) {
   for (ThreadPoolWorker* worker : threads_) {
     worker->SetPthreadPriority(priority);
   }
 }
 
-void ThreadPool::CheckPthreadPriority(int priority) {
+void AbstractThreadPool::CheckPthreadPriority(int priority) {
 #if defined(ART_TARGET_ANDROID)
   for (ThreadPoolWorker* worker : threads_) {
     CHECK_EQ(worker->GetPthreadPriority(), priority);
diff --git a/runtime/thread_pool.h b/runtime/thread_pool.h
index 5c75733..6d17654 100644
--- a/runtime/thread_pool.h
+++ b/runtime/thread_pool.h
@@ -22,12 +22,13 @@
 #include <vector>
 
 #include "barrier.h"
+#include "base/macros.h"
 #include "base/mem_map.h"
 #include "base/mutex.h"
 
-namespace art {
+namespace art HIDDEN {
 
-class ThreadPool;
+class AbstractThreadPool;
 
 class Closure {
  public:
@@ -92,60 +93,51 @@
   Thread* GetThread() const { return thread_; }
 
  protected:
-  ThreadPoolWorker(ThreadPool* thread_pool, const std::string& name, size_t stack_size);
+  ThreadPoolWorker(AbstractThreadPool* thread_pool, const std::string& name, size_t stack_size);
   static void* Callback(void* arg) REQUIRES(!Locks::mutator_lock_);
   virtual void Run();
 
-  ThreadPool* const thread_pool_;
+  AbstractThreadPool* const thread_pool_;
   const std::string name_;
   MemMap stack_;
   pthread_t pthread_;
   Thread* thread_;
 
  private:
-  friend class ThreadPool;
+  friend class AbstractThreadPool;
   DISALLOW_COPY_AND_ASSIGN(ThreadPoolWorker);
 };
 
 // Note that thread pool workers will set Thread#setCanCallIntoJava to false.
-class ThreadPool {
+class AbstractThreadPool {
  public:
   // Returns the number of threads in the thread pool.
   size_t GetThreadCount() const {
     return threads_.size();
   }
 
-  const std::vector<ThreadPoolWorker*>& GetWorkers();
+  EXPORT const std::vector<ThreadPoolWorker*>& GetWorkers();
 
   // Broadcast to the workers and tell them to empty out the work queue.
-  void StartWorkers(Thread* self) REQUIRES(!task_queue_lock_);
+  EXPORT void StartWorkers(Thread* self) REQUIRES(!task_queue_lock_);
 
   // Do not allow workers to grab any new tasks.
-  void StopWorkers(Thread* self) REQUIRES(!task_queue_lock_);
+  EXPORT void StopWorkers(Thread* self) REQUIRES(!task_queue_lock_);
 
   // Returns if the thread pool has started.
   bool HasStarted(Thread* self) REQUIRES(!task_queue_lock_);
 
   // Add a new task, the first available started worker will process it. Does not delete the task
   // after running it, it is the caller's responsibility.
-  void AddTask(Thread* self, Task* task) REQUIRES(!task_queue_lock_);
+  virtual void AddTask(Thread* self, Task* task) REQUIRES(!task_queue_lock_) = 0;
 
   // Remove all tasks in the queue.
-  void RemoveAllTasks(Thread* self) REQUIRES(!task_queue_lock_);
+  virtual void RemoveAllTasks(Thread* self) REQUIRES(!task_queue_lock_) = 0;
 
-  // Create a named thread pool with the given number of threads.
-  //
-  // If create_peers is true, all worker threads will have a Java peer object. Note that if the
-  // pool is asked to do work on the current thread (see Wait), a peer may not be available. Wait
-  // will conservatively abort if create_peers and do_work are true.
-  ThreadPool(const char* name,
-             size_t num_threads,
-             bool create_peers = false,
-             size_t worker_stack_size = ThreadPoolWorker::kDefaultStackSize);
-  virtual ~ThreadPool();
+  virtual size_t GetTaskCount(Thread* self) REQUIRES(!task_queue_lock_) = 0;
 
   // Create the threads of this pool.
-  void CreateThreads();
+  EXPORT void CreateThreads();
 
   // Stops and deletes all threads in this pool.
   void DeleteThreads();
@@ -153,9 +145,7 @@
   // Wait for all tasks currently on queue to get completed. If the pool has been stopped, only
   // wait till all already running tasks are done.
   // When the pool was created with peers for workers, do_work must not be true (see ThreadPool()).
-  void Wait(Thread* self, bool do_work, bool may_hold_locks) REQUIRES(!task_queue_lock_);
-
-  size_t GetTaskCount(Thread* self) REQUIRES(!task_queue_lock_);
+  EXPORT void Wait(Thread* self, bool do_work, bool may_hold_locks) REQUIRES(!task_queue_lock_);
 
   // Returns the total amount of workers waited for tasks.
   uint64_t GetWaitTime() const {
@@ -176,22 +166,27 @@
   // Wait for workers to be created.
   void WaitForWorkersToBeCreated();
 
+  virtual ~AbstractThreadPool() {}
+
  protected:
   // get a task to run, blocks if there are no tasks left
-  virtual Task* GetTask(Thread* self) REQUIRES(!task_queue_lock_);
+  Task* GetTask(Thread* self) REQUIRES(!task_queue_lock_);
 
   // Try to get a task, returning null if there is none available.
   Task* TryGetTask(Thread* self) REQUIRES(!task_queue_lock_);
-  Task* TryGetTaskLocked() REQUIRES(task_queue_lock_);
+  virtual Task* TryGetTaskLocked() REQUIRES(task_queue_lock_) = 0;
 
   // Are we shutting down?
   bool IsShuttingDown() const REQUIRES(task_queue_lock_) {
     return shutting_down_;
   }
 
-  bool HasOutstandingTasks() const REQUIRES(task_queue_lock_) {
-    return started_ && !tasks_.empty();
-  }
+  virtual bool HasOutstandingTasks() const REQUIRES(task_queue_lock_) = 0;
+
+  EXPORT AbstractThreadPool(const char* name,
+                            size_t num_threads,
+                            bool create_peers,
+                            size_t worker_stack_size);
 
   const std::string name_;
   Mutex task_queue_lock_;
@@ -201,7 +196,6 @@
   volatile bool shutting_down_ GUARDED_BY(task_queue_lock_);
   // How many worker threads are waiting on the condition.
   volatile size_t waiting_count_ GUARDED_BY(task_queue_lock_);
-  std::deque<Task*> tasks_ GUARDED_BY(task_queue_lock_);
   std::vector<ThreadPoolWorker*> threads_;
   // Work balance detection.
   uint64_t start_time_ GUARDED_BY(task_queue_lock_);
@@ -214,6 +208,46 @@
  private:
   friend class ThreadPoolWorker;
   friend class WorkStealingWorker;
+  DISALLOW_COPY_AND_ASSIGN(AbstractThreadPool);
+};
+
+class EXPORT ThreadPool : public AbstractThreadPool {
+ public:
+  // Create a named thread pool with the given number of threads.
+  //
+  // If create_peers is true, all worker threads will have a Java peer object. Note that if the
+  // pool is asked to do work on the current thread (see Wait), a peer may not be available. Wait
+  // will conservatively abort if create_peers and do_work are true.
+  static ThreadPool* Create(const char* name,
+                            size_t num_threads,
+                            bool create_peers = false,
+                            size_t worker_stack_size = ThreadPoolWorker::kDefaultStackSize) {
+    ThreadPool* pool = new ThreadPool(name, num_threads, create_peers, worker_stack_size);
+    pool->CreateThreads();
+    return pool;
+  }
+
+  void AddTask(Thread* self, Task* task) REQUIRES(!task_queue_lock_) override;
+  size_t GetTaskCount(Thread* self) REQUIRES(!task_queue_lock_) override;
+  void RemoveAllTasks(Thread* self) REQUIRES(!task_queue_lock_) override;
+  ~ThreadPool() override;
+
+ protected:
+  Task* TryGetTaskLocked() REQUIRES(task_queue_lock_) override;
+
+  bool HasOutstandingTasks() const REQUIRES(task_queue_lock_) override {
+    return started_ && !tasks_.empty();
+  }
+
+  ThreadPool(const char* name,
+             size_t num_threads,
+             bool create_peers,
+             size_t worker_stack_size)
+      : AbstractThreadPool(name, num_threads, create_peers, worker_stack_size) {}
+
+ private:
+  std::deque<Task*> tasks_ GUARDED_BY(task_queue_lock_);
+
   DISALLOW_COPY_AND_ASSIGN(ThreadPool);
 };
 
diff --git a/runtime/thread_pool_test.cc b/runtime/thread_pool_test.cc
index 9e7c44a..33b7f5b 100644
--- a/runtime/thread_pool_test.cc
+++ b/runtime/thread_pool_test.cc
@@ -23,7 +23,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class CountTask : public Task {
  public:
@@ -61,65 +61,68 @@
 // Check that the thread pool actually runs tasks that you assign it.
 TEST_F(ThreadPoolTest, CheckRun) {
   Thread* self = Thread::Current();
-  ThreadPool thread_pool("Thread pool test thread pool", num_threads);
+  std::unique_ptr<ThreadPool> thread_pool(
+      ThreadPool::Create("Thread pool test thread pool", num_threads));
   AtomicInteger count(0);
   static const int32_t num_tasks = num_threads * 4;
   for (int32_t i = 0; i < num_tasks; ++i) {
-    thread_pool.AddTask(self, new CountTask(&count));
+    thread_pool->AddTask(self, new CountTask(&count));
   }
-  thread_pool.StartWorkers(self);
+  thread_pool->StartWorkers(self);
   // Wait for tasks to complete.
-  thread_pool.Wait(self, true, false);
+  thread_pool->Wait(self, true, false);
   // Make sure that we finished all the work.
   EXPECT_EQ(num_tasks, count.load(std::memory_order_seq_cst));
 }
 
 TEST_F(ThreadPoolTest, StopStart) {
   Thread* self = Thread::Current();
-  ThreadPool thread_pool("Thread pool test thread pool", num_threads);
+  std::unique_ptr<ThreadPool> thread_pool(
+      ThreadPool::Create("Thread pool test thread pool", num_threads));
   AtomicInteger count(0);
   static const int32_t num_tasks = num_threads * 4;
   for (int32_t i = 0; i < num_tasks; ++i) {
-    thread_pool.AddTask(self, new CountTask(&count));
+    thread_pool->AddTask(self, new CountTask(&count));
   }
   usleep(200);
   // Check that no threads started prematurely.
   EXPECT_EQ(0, count.load(std::memory_order_seq_cst));
   // Signal the threads to start processing tasks.
-  thread_pool.StartWorkers(self);
+  thread_pool->StartWorkers(self);
   usleep(200);
-  thread_pool.StopWorkers(self);
+  thread_pool->StopWorkers(self);
   AtomicInteger bad_count(0);
-  thread_pool.AddTask(self, new CountTask(&bad_count));
+  thread_pool->AddTask(self, new CountTask(&bad_count));
   usleep(200);
   // Ensure that the task added after the workers were stopped doesn't get run.
   EXPECT_EQ(0, bad_count.load(std::memory_order_seq_cst));
   // Allow tasks to finish up and delete themselves.
-  thread_pool.StartWorkers(self);
-  thread_pool.Wait(self, false, false);
+  thread_pool->StartWorkers(self);
+  thread_pool->Wait(self, false, false);
 }
 
 TEST_F(ThreadPoolTest, StopWait) {
   Thread* self = Thread::Current();
-  ThreadPool thread_pool("Thread pool test thread pool", num_threads);
+  std::unique_ptr<ThreadPool> thread_pool(
+      ThreadPool::Create("Thread pool test thread pool", num_threads));
 
   AtomicInteger count(0);
   static const int32_t num_tasks = num_threads * 100;
   for (int32_t i = 0; i < num_tasks; ++i) {
-    thread_pool.AddTask(self, new CountTask(&count));
+    thread_pool->AddTask(self, new CountTask(&count));
   }
 
   // Signal the threads to start processing tasks.
-  thread_pool.StartWorkers(self);
+  thread_pool->StartWorkers(self);
   usleep(200);
-  thread_pool.StopWorkers(self);
+  thread_pool->StopWorkers(self);
 
-  thread_pool.Wait(self, false, false);  // We should not deadlock here.
+  thread_pool->Wait(self, false, false);  // We should not deadlock here.
 
   // Drain the task list. Note: we have to restart here, as no tasks will be finished when
   // the pool is stopped.
-  thread_pool.StartWorkers(self);
-  thread_pool.Wait(self, /* do_work= */ true, false);
+  thread_pool->StartWorkers(self);
+  thread_pool->Wait(self, /* do_work= */ true, false);
 }
 
 class TreeTask : public Task {
@@ -151,12 +154,13 @@
 // Test that adding new tasks from within a task works.
 TEST_F(ThreadPoolTest, RecursiveTest) {
   Thread* self = Thread::Current();
-  ThreadPool thread_pool("Thread pool test thread pool", num_threads);
+  std::unique_ptr<ThreadPool> thread_pool(
+      ThreadPool::Create("Thread pool test thread pool", num_threads));
   AtomicInteger count(0);
   static const int depth = 8;
-  thread_pool.AddTask(self, new TreeTask(&thread_pool, &count, depth));
-  thread_pool.StartWorkers(self);
-  thread_pool.Wait(self, true, false);
+  thread_pool->AddTask(self, new TreeTask(thread_pool.get(), &count, depth));
+  thread_pool->StartWorkers(self);
+  thread_pool->Wait(self, true, false);
   EXPECT_EQ((1 << depth) - 1, count.load(std::memory_order_seq_cst));
 }
 
@@ -192,10 +196,11 @@
 TEST_F(ThreadPoolTest, PeerTest) {
   Thread* self = Thread::Current();
   {
-    ThreadPool thread_pool("Thread pool test thread pool", 1);
-    thread_pool.AddTask(self, new NoPeerTask());
-    thread_pool.StartWorkers(self);
-    thread_pool.Wait(self, false, false);
+    std::unique_ptr<ThreadPool> thread_pool(
+        ThreadPool::Create("Thread pool test thread pool", 1));
+    thread_pool->AddTask(self, new NoPeerTask());
+    thread_pool->StartWorkers(self);
+    thread_pool->Wait(self, false, false);
   }
 
   {
@@ -204,10 +209,11 @@
     bool started = runtime_->Start();
     ASSERT_TRUE(started);
 
-    ThreadPool thread_pool("Thread pool test thread pool", 1, true);
-    thread_pool.AddTask(self, new PeerTask());
-    thread_pool.StartWorkers(self);
-    thread_pool.Wait(self, false, false);
+    std::unique_ptr<ThreadPool> thread_pool(
+        ThreadPool::Create("Thread pool test thread pool", 1, true));
+    thread_pool->AddTask(self, new PeerTask());
+    thread_pool->StartWorkers(self);
+    thread_pool->Wait(self, false, false);
   }
 }
 
diff --git a/runtime/thread_state.h b/runtime/thread_state.h
index e03df27..120f72e 100644
--- a/runtime/thread_state.h
+++ b/runtime/thread_state.h
@@ -19,7 +19,9 @@
 
 #include <iosfwd>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 
 // State stored in our C++ class Thread.
 // When we refer to "a suspended state", or when function names mention "ToSuspended" or
@@ -63,7 +65,7 @@
   kNative,                          // RUNNABLE       TS_RUNNING   running in a JNI native method
   kSuspended,                       // RUNNABLE       TS_RUNNING   suspended by GC or debugger
 };
-std::ostream& operator<<(std::ostream& os, ThreadState rhs);
+EXPORT std::ostream& operator<<(std::ostream& os, ThreadState rhs);
 
 }  // namespace art
 
diff --git a/runtime/thread_test.cc b/runtime/thread_test.cc
new file mode 100644
index 0000000..780e89d
--- /dev/null
+++ b/runtime/thread_test.cc
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "thread.h"
+
+#include "android-base/logging.h"
+#include "base/locks.h"
+#include "base/mutex.h"
+#include "common_runtime_test.h"
+#include "thread-current-inl.h"
+#include "thread-inl.h"
+
+namespace art HIDDEN {
+
+class ThreadTest : public CommonRuntimeTest {};
+
+// Ensure that basic list operations on ThreadExitFlags work. These are rarely
+// exercised in practice, since normally only one flag is registered at a time.
+
+TEST_F(ThreadTest, ThreadExitFlagTest) {
+  Thread* self = Thread::Current();
+  ThreadExitFlag tefs[3];
+  {
+    MutexLock mu(self, *Locks::thread_list_lock_);
+    self->NotifyOnThreadExit(&tefs[2]);
+    ASSERT_TRUE(self->IsRegistered(&tefs[2]));
+    ASSERT_FALSE(tefs[2].HasExited());
+    ASSERT_FALSE(self->IsRegistered(&tefs[1]));
+    self->NotifyOnThreadExit(&tefs[1]);
+    self->NotifyOnThreadExit(&tefs[0]);
+    ASSERT_TRUE(self->IsRegistered(&tefs[0]));
+    ASSERT_TRUE(self->IsRegistered(&tefs[1]));
+    ASSERT_TRUE(self->IsRegistered(&tefs[2]));
+    self->UnregisterThreadExitFlag(&tefs[1]);
+    ASSERT_TRUE(self->IsRegistered(&tefs[0]));
+    ASSERT_FALSE(self->IsRegistered(&tefs[1]));
+    ASSERT_TRUE(self->IsRegistered(&tefs[2]));
+    self->UnregisterThreadExitFlag(&tefs[2]);
+    ASSERT_TRUE(self->IsRegistered(&tefs[0]));
+    ASSERT_FALSE(self->IsRegistered(&tefs[1]));
+    ASSERT_FALSE(self->IsRegistered(&tefs[2]));
+  }
+  Thread::DCheckUnregisteredEverywhere(&tefs[1], &tefs[2]);
+  {
+    MutexLock mu(self, *Locks::thread_list_lock_);
+    self->UnregisterThreadExitFlag(&tefs[0]);
+    ASSERT_FALSE(self->IsRegistered(&tefs[0]));
+    ASSERT_FALSE(self->IsRegistered(&tefs[1]));
+    ASSERT_FALSE(self->IsRegistered(&tefs[2]));
+  }
+  Thread::DCheckUnregisteredEverywhere(&tefs[0], &tefs[2]);
+}
+
+TEST_F(ThreadTest, ThreadExitSignalTest) {
+  Thread* self = Thread::Current();
+  ThreadExitFlag tefs[3];
+  {
+    MutexLock mu(self, *Locks::thread_list_lock_);
+    self->NotifyOnThreadExit(&tefs[2]);
+    ASSERT_TRUE(self->IsRegistered(&tefs[2]));
+    ASSERT_FALSE(self->IsRegistered(&tefs[1]));
+    self->NotifyOnThreadExit(&tefs[1]);
+    ASSERT_TRUE(self->IsRegistered(&tefs[1]));
+    self->SignalExitFlags();
+    ASSERT_TRUE(tefs[1].HasExited());
+    ASSERT_TRUE(tefs[2].HasExited());
+  }
+  Thread::DCheckUnregisteredEverywhere(&tefs[1], &tefs[2]);
+  {
+    MutexLock mu(self, *Locks::thread_list_lock_);
+    self->NotifyOnThreadExit(&tefs[0]);
+    tefs[2].~ThreadExitFlag();  //  Destroy and reinitialize.
+    new (&tefs[2]) ThreadExitFlag();
+    self->NotifyOnThreadExit(&tefs[2]);
+    ASSERT_FALSE(tefs[0].HasExited());
+    ASSERT_TRUE(tefs[1].HasExited());
+    ASSERT_FALSE(tefs[2].HasExited());
+    self->SignalExitFlags();
+    ASSERT_TRUE(tefs[0].HasExited());
+    ASSERT_TRUE(tefs[1].HasExited());
+    ASSERT_TRUE(tefs[2].HasExited());
+  }
+  Thread::DCheckUnregisteredEverywhere(&tefs[0], &tefs[2]);
+}
+
+}  // namespace art
diff --git a/runtime/ti/agent.cc b/runtime/ti/agent.cc
index cdfe727..b560727 100644
--- a/runtime/ti/agent.cc
+++ b/runtime/ti/agent.cc
@@ -27,7 +27,7 @@
 #include "thread-current-inl.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace ti {
 
 using android::base::StringPrintf;
diff --git a/runtime/ti/agent.h b/runtime/ti/agent.h
index 598c8ff..5d4cf50 100644
--- a/runtime/ti/agent.h
+++ b/runtime/ti/agent.h
@@ -25,7 +25,9 @@
 #include <android-base/logging.h>
 #include <android-base/macros.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 namespace ti {
 
 class Agent;
diff --git a/runtime/trace.cc b/runtime/trace.cc
index 81c86f1..04f4de6 100644
--- a/runtime/trace.cc
+++ b/runtime/trace.cc
@@ -21,10 +21,10 @@
 
 #include "android-base/macros.h"
 #include "android-base/stringprintf.h"
-
 #include "art_method-inl.h"
 #include "base/casts.h"
 #include "base/enums.h"
+#include "base/leb128.h"
 #include "base/os.h"
 #include "base/stl_util.h"
 #include "base/systrace.h"
@@ -51,7 +51,14 @@
 #include "thread.h"
 #include "thread_list.h"
 
-namespace art {
+namespace art HIDDEN {
+
+struct MethodTraceRecord {
+  ArtMethod* method;
+  TraceAction action;
+  uint32_t wall_clock_time;
+  uint32_t thread_cpu_time;
+};
 
 using android::base::StringPrintf;
 
@@ -68,6 +75,23 @@
 static const uint16_t kTraceVersionDualClock      = 3;
 static const uint16_t kTraceRecordSizeSingleClock = 10;  // using v2
 static const uint16_t kTraceRecordSizeDualClock   = 14;  // using v3 with two timestamps
+static const size_t kNumTracePoolBuffers = 32;
+
+// Packet type encoding for the new method tracing format.
+static const int kThreadInfoHeaderV2 = 0;
+static const int kMethodInfoHeaderV2 = 1;
+static const int kEntryHeaderV2 = 2;
+static const int kSummaryHeaderV2 = 3;
+
+// Packet sizes for the new method trace format.
+static const uint16_t kTraceHeaderLengthV2 = 32;
+static const uint16_t kTraceRecordSizeSingleClockV2 = 6;
+static const uint16_t kTraceRecordSizeDualClockV2 = kTraceRecordSizeSingleClockV2 + 2;
+static const uint16_t kEntryHeaderSizeSingleClockV2 = 17;
+static const uint16_t kEntryHeaderSizeDualClockV2 = kEntryHeaderSizeSingleClockV2 + 4;
+
+static const uint16_t kTraceVersionSingleClockV2 = 4;
+static const uint16_t kTraceVersionDualClockV2 = 5;
 
 TraceClockSource Trace::default_clock_source_ = kDefaultTraceClockSource;
 
@@ -107,6 +131,8 @@
   unsigned int lo, hi;
   asm volatile("rdtsc" : "=a"(lo), "=d"(hi));
   t = (static_cast<uint64_t>(hi) << 32) | lo;
+#elif defined(__riscv)
+  asm volatile("rdtime %0" : "=r"(t));
 #else
   t = MicroTime();
 #endif
@@ -208,31 +234,85 @@
 
 }  // namespace
 
-ArtMethod* Trace::DecodeTraceMethod(uint32_t tmid) {
-  uint32_t method_index = tmid >> TraceActionBits;
-  // This is used only for logging which is usually needed only for debugging ART. So it's not
-  // performance critical.
-  for (auto const& entry : art_method_id_map_) {
-    if (method_index == entry.second) {
-      return entry.first;
-    }
-  }
-  return nullptr;
+bool TraceWriter::HasMethodEncoding(ArtMethod* method) {
+  return art_method_id_map_.find(method) != art_method_id_map_.end();
 }
 
-uint32_t Trace::EncodeTraceMethod(ArtMethod* method) {
-  uint32_t idx = 0;
+std::pair<uint32_t, bool> TraceWriter::GetMethodEncoding(ArtMethod* method) {
   auto it = art_method_id_map_.find(method);
   if (it != art_method_id_map_.end()) {
-    idx = it->second;
+    return std::pair<uint32_t, bool>(it->second, false);
   } else {
-    idx = current_method_index_;
+    uint32_t idx = current_method_index_;
     art_method_id_map_.emplace(method, idx);
     current_method_index_++;
+    return std::pair<uint32_t, bool>(idx, true);
   }
+}
+
+uint16_t TraceWriter::GetThreadEncoding(pid_t thread_id) {
+  auto it = thread_id_map_.find(thread_id);
+  if (it != thread_id_map_.end()) {
+    return it->second;
+  }
+
+  uint16_t idx = current_thread_index_;
+  thread_id_map_.emplace(thread_id, current_thread_index_);
+  DCHECK_LT(current_thread_index_, (1 << 16) - 2);
+  current_thread_index_++;
   return idx;
 }
 
+class TraceWriterTask final : public SelfDeletingTask {
+ public:
+  TraceWriterTask(
+      TraceWriter* trace_writer, int index, uintptr_t* buffer, size_t cur_offset, size_t thread_id)
+      : trace_writer_(trace_writer),
+        index_(index),
+        buffer_(buffer),
+        cur_offset_(cur_offset),
+        thread_id_(thread_id),
+        reserve_buf_for_tid_(0) {}
+
+  void Run(Thread* self ATTRIBUTE_UNUSED) override {
+    std::unordered_map<ArtMethod*, std::string> method_infos;
+    {
+      ScopedObjectAccess soa(Thread::Current());
+      trace_writer_->PreProcessTraceForMethodInfos(buffer_, cur_offset_, method_infos);
+    }
+    trace_writer_->FlushBuffer(buffer_, cur_offset_, thread_id_, method_infos);
+    if (index_ == -1) {
+      // This was a temporary buffer we allocated since there are no more free buffers and we
+      // couldn't find one by flushing the pending tasks either. This should only happen when we
+      // have fewer buffers than the number of threads.
+      if (reserve_buf_for_tid_ == 0) {
+        // Just free the buffer here if it wasn't reserved for any thread.
+        delete[] buffer_;
+      }
+    } else {
+      trace_writer_->FetchTraceBufferForThread(index_, reserve_buf_for_tid_);
+    }
+  }
+
+  // Reserves the buffer for a particular thread. The thread is free to use this buffer once the
+  // task has finished running. This is used when there are no free buffers for the thread to use.
+  uintptr_t* ReserveBufferForTid(size_t tid) {
+    reserve_buf_for_tid_ = tid;
+    return buffer_;
+  }
+
+ private:
+  TraceWriter* trace_writer_;
+  int index_;
+  uintptr_t* buffer_;
+  size_t cur_offset_;
+  size_t thread_id_;
+  // Sometimes we want to acquire a buffer for a particular thread. This holds
+  // the tid of the thread that we want to acquire the buffer for. If this value
+  // is 0 then it means we can use it for other threads.
+  size_t reserve_buf_for_tid_;
+};
+
 std::vector<ArtMethod*>* Trace::AllocStackTrace() {
   return (temp_stack_trace_.get() != nullptr)  ? temp_stack_trace_.release() :
       new std::vector<ArtMethod*>();
@@ -253,31 +333,45 @@
 #endif
 }
 
-static uint16_t GetTraceVersion(TraceClockSource clock_source) {
-  return (clock_source == TraceClockSource::kDual) ? kTraceVersionDualClock
-                                                    : kTraceVersionSingleClock;
+static uint16_t GetTraceVersion(TraceClockSource clock_source, int version) {
+  if (version == Trace::kFormatV1) {
+    return (clock_source == TraceClockSource::kDual) ? kTraceVersionDualClock :
+                                                       kTraceVersionSingleClock;
+  } else {
+    return (clock_source == TraceClockSource::kDual) ? kTraceVersionDualClockV2 :
+                                                       kTraceVersionSingleClockV2;
+  }
 }
 
-static uint16_t GetRecordSize(TraceClockSource clock_source) {
-  return (clock_source == TraceClockSource::kDual) ? kTraceRecordSizeDualClock
-                                                    : kTraceRecordSizeSingleClock;
+static uint16_t GetRecordSize(TraceClockSource clock_source, int version) {
+  if (version == Trace::kFormatV1) {
+    return (clock_source == TraceClockSource::kDual) ? kTraceRecordSizeDualClock :
+                                                       kTraceRecordSizeSingleClock;
+  } else {
+    return (clock_source == TraceClockSource::kDual) ? kTraceRecordSizeDualClockV2 :
+                                                       kTraceRecordSizeSingleClockV2;
+  }
 }
 
-bool Trace::UseThreadCpuClock() {
-  return (clock_source_ == TraceClockSource::kThreadCpu) ||
-      (clock_source_ == TraceClockSource::kDual);
+static uint16_t GetNumEntries(TraceClockSource clock_source) {
+  return (clock_source == TraceClockSource::kDual) ? kNumEntriesForDualClock
+                                                   : kNumEntriesForWallClock;
 }
 
-bool Trace::UseWallClock() {
-  return (clock_source_ == TraceClockSource::kWall) ||
-      (clock_source_ == TraceClockSource::kDual);
+bool UseThreadCpuClock(TraceClockSource clock_source) {
+  return (clock_source == TraceClockSource::kThreadCpu) ||
+         (clock_source == TraceClockSource::kDual);
+}
+
+bool UseWallClock(TraceClockSource clock_source) {
+  return (clock_source == TraceClockSource::kWall) || (clock_source == TraceClockSource::kDual);
 }
 
 void Trace::MeasureClockOverhead() {
-  if (UseThreadCpuClock()) {
+  if (UseThreadCpuClock(clock_source_)) {
     Thread::Current()->GetCpuMicroTime();
   }
-  if (UseWallClock()) {
+  if (UseWallClock(clock_source_)) {
     GetTimestamp();
   }
 }
@@ -346,7 +440,7 @@
   the_trace->CompareAndUpdateStackTrace(thread, stack_trace);
 }
 
-static void ClearThreadStackTraceAndClockBase(Thread* thread, void* arg ATTRIBUTE_UNUSED) {
+static void ClearThreadStackTraceAndClockBase(Thread* thread, [[maybe_unused]] void* arg) {
   thread->SetTraceClockBase(0);
   std::vector<ArtMethod*>* stack_trace = thread->GetStackTraceSample();
   thread->SetStackTraceSample(nullptr);
@@ -486,7 +580,7 @@
   auto deleter = [](File* file) {
     if (file != nullptr) {
       file->MarkUnchecked();  // Don't deal with flushing requirements.
-      int result ATTRIBUTE_UNUSED = file->Close();
+      [[maybe_unused]] int result = file->Close();
       delete file;
     }
   };
@@ -552,16 +646,20 @@
           runtime->GetInstrumentation()->UpdateEntrypointsForDebuggable();
           runtime->DeoptimizeBootImage();
         }
+        // For thread cpu clocks, we need to make a kernel call and hence we call into c++ to
+        // support them.
+        bool is_fast_trace = !UseThreadCpuClock(the_trace_->GetClockSource());
+#if defined(__arm__)
+        // On ARM 32 bit, we don't always have access to the timestamp counters from
+        // user space. Seem comment in GetTimestamp for more details.
+        is_fast_trace = false;
+#endif
         runtime->GetInstrumentation()->AddListener(
             the_trace_,
             instrumentation::Instrumentation::kMethodEntered |
                 instrumentation::Instrumentation::kMethodExited |
-                instrumentation::Instrumentation::kMethodUnwind);
-        // TODO: In full-PIC mode, we don't need to fully deopt.
-        // TODO: We can only use trampoline entrypoints if we are java-debuggable since in that case
-        // we know that inlining and other problematic optimizations are disabled. We might just
-        // want to use the trampolines anyway since it is faster. It makes the story with disabling
-        // jit-gc more complex though.
+                instrumentation::Instrumentation::kMethodUnwind,
+            is_fast_trace);
         runtime->GetInstrumentation()->EnableMethodTracing(kTracerInstrumentationKey,
                                                            the_trace_,
                                                            /*needs_interpreter=*/false);
@@ -575,32 +673,10 @@
   }
 }
 
-void Trace::UpdateThreadsList(Thread* thread) {
-  // TODO(mythria): Clean this up and update threads_list_ when recording the trace event similar
-  // to what we do for streaming case.
-  std::string name;
-  thread->GetThreadName(name);
-  // In tests, we destroy VM after already detaching the current thread. When a thread is
-  // detached we record the information about the threads_list_. We re-attach the current
-  // thread again as a "Shutdown thread" in the process of shutting down. So don't record
-  // information about shutdown threads.
-  if (name.compare("Shutdown thread") == 0) {
-    return;
-  }
-
-  // There can be races when unregistering a thread and stopping the trace and it is possible to
-  // update the list twice. For example, This information is updated here when stopping tracing and
-  // also when a thread is detaching. In thread detach, we first update this information and then
-  // remove the thread from the list of active threads. If the tracing was stopped in between these
-  // events, we can see two updates for the same thread. Since we need a trace_lock_ it isn't easy
-  // to prevent this race (for ex: update this information when holding thread_list_lock_). It is
-  // harmless to do two updates so just use overwrite here.
-  threads_list_.Overwrite(thread->GetTid(), name);
-}
-
-void Trace::StopTracing(bool finish_tracing, bool flush_file) {
+void Trace::StopTracing(bool flush_entries) {
   Runtime* const runtime = Runtime::Current();
   Thread* const self = Thread::Current();
+
   pthread_t sampling_pthread = 0U;
   {
     MutexLock mu(self, *Locks::trace_lock_);
@@ -635,11 +711,20 @@
       MutexLock mu(self, *Locks::thread_list_lock_);
       runtime->GetThreadList()->ForEach(ClearThreadStackTraceAndClockBase, nullptr);
     } else {
+      // For thread cpu clocks, we need to make a kernel call and hence we call into c++ to support
+      // them.
+      bool is_fast_trace = !UseThreadCpuClock(the_trace_->GetClockSource());
+#if defined(__arm__)
+        // On ARM 32 bit, we don't always have access to the timestamp counters from
+        // user space. Seem comment in GetTimestamp for more details.
+        is_fast_trace = false;
+#endif
       runtime->GetInstrumentation()->RemoveListener(
           the_trace,
           instrumentation::Instrumentation::kMethodEntered |
               instrumentation::Instrumentation::kMethodExited |
-              instrumentation::Instrumentation::kMethodUnwind);
+              instrumentation::Instrumentation::kMethodUnwind,
+          is_fast_trace);
       runtime->GetInstrumentation()->DisableMethodTracing(kTracerInstrumentationKey);
     }
 
@@ -647,43 +732,30 @@
     // We also flush the buffer when destroying a thread which expects the_trace_ to be valid so
     // make sure that the per-thread buffer is reset before resetting the_trace_.
     {
+      MutexLock mu(self, *Locks::trace_lock_);
       MutexLock tl_lock(Thread::Current(), *Locks::thread_list_lock_);
+      // Flush the per-thread buffers and reset the trace inside the trace_lock_ to avoid any
+      // race if the thread is detaching and trying to flush the buffer too. Since we hold the
+      // trace_lock_ both here and when flushing on a thread detach only one of them will succeed
+      // in actually flushing the buffer.
       for (Thread* thread : Runtime::Current()->GetThreadList()->GetList()) {
         if (thread->GetMethodTraceBuffer() != nullptr) {
-          the_trace_->FlushStreamingBuffer(thread);
-          thread->ResetMethodTraceBuffer();
+          // We may have pending requests to flush the data. So just enqueue a
+          // request to flush the current buffer so all the requests are
+          // processed in order.
+          the_trace->trace_writer_->FlushBuffer(
+              thread, /* is_sync= */ false, /* free_buffer= */ true);
         }
-        // Record threads here before resetting the_trace_ to prevent any races between
-        // unregistering the thread and resetting the_trace_.
-        the_trace->UpdateThreadsList(thread);
       }
+      the_trace_ = nullptr;
+      sampling_pthread_ = 0U;
     }
-
-    // Reset the_trace_ by taking a trace_lock
-    MutexLock mu(self, *Locks::trace_lock_);
-    the_trace_ = nullptr;
-    sampling_pthread_ = 0U;
   }
 
   // At this point, code may read buf_ as its writers are shutdown
   // and the ScopedSuspendAll above has ensured all stores to buf_
   // are now visible.
-  if (finish_tracing) {
-    the_trace->FinishTracing();
-  }
-  if (the_trace->trace_file_.get() != nullptr) {
-    // Do not try to erase, so flush and close explicitly.
-    if (flush_file) {
-      if (the_trace->trace_file_->Flush() != 0) {
-        PLOG(WARNING) << "Could not flush trace file.";
-      }
-    } else {
-      the_trace->trace_file_->MarkUnchecked();  // Do not trigger guard.
-    }
-    if (the_trace->trace_file_->Close() != 0) {
-      PLOG(ERROR) << "Could not close trace file.";
-    }
-  }
+  the_trace->trace_writer_->FinishTracing(the_trace->flags_, flush_entries);
   delete the_trace;
 
   if (stop_alloc_counting) {
@@ -694,17 +766,23 @@
 
 void Trace::FlushThreadBuffer(Thread* self) {
   MutexLock mu(self, *Locks::trace_lock_);
-  the_trace_->FlushStreamingBuffer(self);
+  // Check if we still need to flush inside the trace_lock_. If we are stopping tracing it is
+  // possible we already deleted the trace and flushed the buffer too.
+  if (the_trace_ == nullptr) {
+    DCHECK_EQ(self->GetMethodTraceBuffer(), nullptr);
+    return;
+  }
+  the_trace_->trace_writer_->FlushBuffer(self, /* is_sync= */ false, /* free_buffer= */ true);
 }
 
 void Trace::Abort() {
   // Do not write anything anymore.
-  StopTracing(false, false);
+  StopTracing(/* flush_entries= */ false);
 }
 
 void Trace::Stop() {
   // Finish writing.
-  StopTracing(true, true);
+  StopTracing(/* flush_entries= */ true);
 }
 
 void Trace::Shutdown() {
@@ -734,6 +812,9 @@
 // should be greater than kMinBufSize.
 static constexpr size_t kPerThreadBufSize = 512 * 1024;
 static_assert(kPerThreadBufSize > kMinBufSize);
+// On average we need 12 bytes for encoding an entry. We typically use two
+// entries in per-thread buffer, the scaling factor is 6.
+static constexpr size_t kScalingFactorEncodedEntries = 6;
 
 namespace {
 
@@ -751,45 +832,58 @@
   }
 }
 
+int GetTraceFormatVersionFromFlags(int flags) {
+  int version = (flags & Trace::kTraceFormatVersionFlagMask) >> Trace::kTraceFormatVersionShift;
+  return version;
+}
+
 }  // namespace
 
-Trace::Trace(File* trace_file,
-             size_t buffer_size,
-             int flags,
-             TraceOutputMode output_mode,
-             TraceMode trace_mode)
+TraceWriter::TraceWriter(File* trace_file,
+                         TraceOutputMode output_mode,
+                         TraceClockSource clock_source,
+                         size_t buffer_size,
+                         int num_trace_buffers,
+                         int trace_format_version,
+                         uint32_t clock_overhead_ns)
     : trace_file_(trace_file),
-      buf_(new uint8_t[std::max(kMinBufSize, buffer_size)]()),
-      flags_(flags),
       trace_output_mode_(output_mode),
-      trace_mode_(trace_mode),
-      clock_source_(GetClockSourceFromFlags(flags)),
+      clock_source_(clock_source),
+      buf_(new uint8_t[std::max(kMinBufSize, buffer_size)]()),
       buffer_size_(std::max(kMinBufSize, buffer_size)),
+      trace_format_version_(trace_format_version),
       start_time_(GetMicroTime(GetTimestamp())),
-      clock_overhead_ns_(GetClockOverheadNanoSeconds()),
       overflow_(false),
-      interval_us_(0),
-      stop_tracing_(false),
+      num_records_(0),
+      clock_overhead_ns_(clock_overhead_ns),
+      owner_tids_(num_trace_buffers),
       tracing_lock_("tracing lock", LockLevel::kTracingStreamingLock) {
-  CHECK_IMPLIES(trace_file == nullptr, output_mode == TraceOutputMode::kDDMS);
-
-  uint16_t trace_version = GetTraceVersion(clock_source_);
+  uint16_t trace_version = GetTraceVersion(clock_source_, trace_format_version_);
   if (output_mode == TraceOutputMode::kStreaming) {
     trace_version |= 0xF0U;
   }
-  // Set up the beginning of the trace.
-  memset(buf_.get(), 0, kTraceHeaderLength);
-  Append4LE(buf_.get(), kTraceMagicValue);
-  Append2LE(buf_.get() + 4, trace_version);
-  Append2LE(buf_.get() + 6, kTraceHeaderLength);
-  Append8LE(buf_.get() + 8, start_time_);
-  if (trace_version >= kTraceVersionDualClock) {
-    uint16_t record_size = GetRecordSize(clock_source_);
-    Append2LE(buf_.get() + 16, record_size);
-  }
-  static_assert(18 <= kMinBufSize, "Minimum buffer size not large enough for trace header");
 
-  cur_offset_.store(kTraceHeaderLength, std::memory_order_relaxed);
+  // Set up the beginning of the trace.
+  if (trace_format_version_ == Trace::kFormatV1) {
+    memset(buf_.get(), 0, kTraceHeaderLength);
+    Append4LE(buf_.get(), kTraceMagicValue);
+    Append2LE(buf_.get() + 4, trace_version);
+    Append2LE(buf_.get() + 6, kTraceHeaderLength);
+    Append8LE(buf_.get() + 8, start_time_);
+    if (trace_version >= kTraceVersionDualClock) {
+      uint16_t record_size = GetRecordSize(clock_source_, trace_format_version_);
+      Append2LE(buf_.get() + 16, record_size);
+    }
+    static_assert(18 <= kMinBufSize, "Minimum buffer size not large enough for trace header");
+
+    cur_offset_ = kTraceHeaderLength;
+  } else {
+    memset(buf_.get(), 0, kTraceHeaderLengthV2);
+    Append4LE(buf_.get(), kTraceMagicValue);
+    Append2LE(buf_.get() + 4, trace_version);
+    Append8LE(buf_.get() + 6, start_time_);
+    cur_offset_ = kTraceHeaderLengthV2;
+  }
 
   if (output_mode == TraceOutputMode::kStreaming) {
     // Flush the header information to the file. We use a per thread buffer, so
@@ -797,116 +891,179 @@
     if (!trace_file_->WriteFully(buf_.get(), kTraceHeaderLength)) {
       PLOG(WARNING) << "Failed streaming a tracing event.";
     }
-    cur_offset_.store(0, std::memory_order_relaxed);
+    cur_offset_ = 0;
   }
+  // Thread index of 0 is a special identifier used to distinguish between trace
+  // event entries and thread / method info entries.
+  current_thread_index_ = 1;
+
+  // Don't create threadpool for a zygote. This would cause slowdown when forking because we need
+  // to stop and start this thread pool. Method tracing on zygote isn't a frequent use case and
+  // it is okay to flush on the main thread in such cases.
+  if (!Runtime::Current()->IsZygote()) {
+    thread_pool_.reset(TraceWriterThreadPool::Create("Trace writer pool"));
+    thread_pool_->StartWorkers(Thread::Current());
+  }
+
+  // Initialize the pool of per-thread buffers.
+  InitializeTraceBuffers();
 }
 
-static uint64_t ReadBytes(uint8_t* buf, size_t bytes) {
-  uint64_t ret = 0;
-  for (size_t i = 0; i < bytes; ++i) {
-    ret |= static_cast<uint64_t>(buf[i]) << (i * 8);
-  }
-  return ret;
+Trace::Trace(File* trace_file,
+             size_t buffer_size,
+             int flags,
+             TraceOutputMode output_mode,
+             TraceMode trace_mode)
+    : flags_(flags),
+      trace_mode_(trace_mode),
+      clock_source_(GetClockSourceFromFlags(flags)),
+      interval_us_(0),
+      stop_tracing_(false) {
+  CHECK_IMPLIES(trace_file == nullptr, output_mode == TraceOutputMode::kDDMS);
+
+  int trace_format_version = GetTraceFormatVersionFromFlags(flags_);
+  // In streaming mode, we only need a buffer big enough to store data per each
+  // thread buffer. In non-streaming mode this is specified by the user and we
+  // stop tracing when the buffer is full.
+  size_t buf_size = (output_mode == TraceOutputMode::kStreaming) ?
+                        kPerThreadBufSize * kScalingFactorEncodedEntries :
+                        buffer_size;
+  trace_writer_.reset(new TraceWriter(trace_file,
+                                      output_mode,
+                                      clock_source_,
+                                      buf_size,
+                                      kNumTracePoolBuffers,
+                                      trace_format_version,
+                                      GetClockOverheadNanoSeconds()));
 }
 
-void Trace::DumpBuf(uint8_t* buf, size_t buf_size, TraceClockSource clock_source) {
-  uint8_t* ptr = buf + kTraceHeaderLength;
-  uint8_t* end = buf + buf_size;
-
-  MutexLock mu(Thread::Current(), tracing_lock_);
-  while (ptr < end) {
-    uint32_t tmid = ReadBytes(ptr + 2, sizeof(tmid));
-    ArtMethod* method = DecodeTraceMethod(tmid);
-    TraceAction action = DecodeTraceAction(tmid);
-    LOG(INFO) << ArtMethod::PrettyMethod(method) << " " << static_cast<int>(action);
-    ptr += GetRecordSize(clock_source);
-  }
-}
-
-void Trace::FinishTracing() {
-  size_t final_offset = 0;
-  if (trace_output_mode_ != TraceOutputMode::kStreaming) {
-    final_offset = cur_offset_.load(std::memory_order_relaxed);
-  }
-
-  // Compute elapsed time.
-  uint64_t elapsed = GetMicroTime(GetTimestamp()) - start_time_;
-
-  std::ostringstream os;
-
-  os << StringPrintf("%cversion\n", kTraceTokenChar);
-  os << StringPrintf("%d\n", GetTraceVersion(clock_source_));
-  os << StringPrintf("data-file-overflow=%s\n", overflow_ ? "true" : "false");
-  if (UseThreadCpuClock()) {
-    if (UseWallClock()) {
-      os << StringPrintf("clock=dual\n");
-    } else {
-      os << StringPrintf("clock=thread-cpu\n");
+void TraceWriter::FinishTracing(int flags, bool flush_entries) {
+  Thread* self = Thread::Current();
+  if (flush_entries) {
+    if (thread_pool_ != nullptr) {
+      // Wait for any workers to be created. If we are stopping tracing as a part of runtime
+      // shutdown, any unstarted workers can create problems if they try attaching while shutting
+      // down.
+      thread_pool_->WaitForWorkersToBeCreated();
+      // Wait for any outstanding writer tasks to finish.
+      thread_pool_->Wait(self, /* do_work= */ true, /* may_hold_locks= */ true);
+      DCHECK_EQ(thread_pool_->GetTaskCount(self), 0u);
+      thread_pool_->StopWorkers(self);
     }
-  } else {
-    os << StringPrintf("clock=wall\n");
-  }
-  os << StringPrintf("elapsed-time-usec=%" PRIu64 "\n", elapsed);
-  if (trace_output_mode_ != TraceOutputMode::kStreaming) {
-    size_t num_records = (final_offset - kTraceHeaderLength) / GetRecordSize(clock_source_);
-    os << StringPrintf("num-method-calls=%zd\n", num_records);
-  }
-  os << StringPrintf("clock-call-overhead-nsec=%d\n", clock_overhead_ns_);
-  os << StringPrintf("vm=art\n");
-  os << StringPrintf("pid=%d\n", getpid());
-  if ((flags_ & kTraceCountAllocs) != 0) {
-    os << "alloc-count=" << Runtime::Current()->GetStat(KIND_ALLOCATED_OBJECTS) << "\n";
-    os << "alloc-size=" << Runtime::Current()->GetStat(KIND_ALLOCATED_BYTES) << "\n";
-    os << "gc-count=" <<  Runtime::Current()->GetStat(KIND_GC_INVOCATIONS) << "\n";
-  }
-  os << StringPrintf("%cthreads\n", kTraceTokenChar);
-  DumpThreadList(os);
-  os << StringPrintf("%cmethods\n", kTraceTokenChar);
-  DumpMethodList(os);
-  os << StringPrintf("%cend\n", kTraceTokenChar);
-  std::string header(os.str());
 
-  if (trace_output_mode_ == TraceOutputMode::kStreaming) {
-    // It is expected that this method is called when all other threads are suspended, so there
-    // cannot be any writes to trace_file_ after finish tracing.
-    // Write a special token to mark the end of trace records and the start of
-    // trace summary.
-    uint8_t buf[7];
-    Append2LE(buf, 0);
-    buf[2] = kOpTraceSummary;
-    Append4LE(buf + 3, static_cast<uint32_t>(header.length()));
-    // Write the trace summary. The summary is identical to the file header when
-    // the output mode is not streaming (except for methods).
-    if (!trace_file_->WriteFully(buf, sizeof(buf)) ||
-        !trace_file_->WriteFully(header.c_str(), header.length())) {
-      PLOG(WARNING) << "Failed streaming a tracing event.";
+    size_t final_offset = 0;
+    if (trace_output_mode_ != TraceOutputMode::kStreaming) {
+      MutexLock mu(Thread::Current(), tracing_lock_);
+      final_offset = cur_offset_;
     }
-  } else {
-    if (trace_file_.get() == nullptr) {
-      std::vector<uint8_t> data;
-      data.resize(header.length() + final_offset);
-      memcpy(data.data(), header.c_str(), header.length());
-      memcpy(data.data() + header.length(), buf_.get(), final_offset);
-      Runtime::Current()->GetRuntimeCallbacks()->DdmPublishChunk(CHUNK_TYPE("MPSE"),
-                                                                 ArrayRef<const uint8_t>(data));
-      const bool kDumpTraceInfo = false;
-      if (kDumpTraceInfo) {
-        LOG(INFO) << "Trace sent:\n" << header;
-        DumpBuf(buf_.get(), final_offset, clock_source_);
+
+    // Compute elapsed time.
+    uint64_t elapsed = GetMicroTime(GetTimestamp()) - start_time_;
+
+    std::ostringstream os;
+
+    os << StringPrintf("%cversion\n", kTraceTokenChar);
+    os << StringPrintf("%d\n", GetTraceVersion(clock_source_, trace_format_version_));
+    os << StringPrintf("data-file-overflow=%s\n", overflow_ ? "true" : "false");
+    if (UseThreadCpuClock(clock_source_)) {
+      if (UseWallClock(clock_source_)) {
+        os << StringPrintf("clock=dual\n");
+      } else {
+        os << StringPrintf("clock=thread-cpu\n");
       }
     } else {
-      if (!trace_file_->WriteFully(header.c_str(), header.length()) ||
-          !trace_file_->WriteFully(buf_.get(), final_offset)) {
-        std::string detail(StringPrintf("Trace data write failed: %s", strerror(errno)));
-        PLOG(ERROR) << detail;
-        ThrowRuntimeException("%s", detail.c_str());
+      os << StringPrintf("clock=wall\n");
+    }
+    os << StringPrintf("elapsed-time-usec=%" PRIu64 "\n", elapsed);
+    if (trace_output_mode_ != TraceOutputMode::kStreaming) {
+      os << StringPrintf("num-method-calls=%zd\n", num_records_);
+    }
+    os << StringPrintf("clock-call-overhead-nsec=%d\n", clock_overhead_ns_);
+    os << StringPrintf("vm=art\n");
+    os << StringPrintf("pid=%d\n", getpid());
+    if ((flags & Trace::kTraceCountAllocs) != 0) {
+      os << "alloc-count=" << Runtime::Current()->GetStat(KIND_ALLOCATED_OBJECTS) << "\n";
+      os << "alloc-size=" << Runtime::Current()->GetStat(KIND_ALLOCATED_BYTES) << "\n";
+      os << "gc-count=" <<  Runtime::Current()->GetStat(KIND_GC_INVOCATIONS) << "\n";
+    }
+
+    if (trace_format_version_ == Trace::kFormatV1) {
+      os << StringPrintf("%cthreads\n", kTraceTokenChar);
+      DumpThreadList(os);
+      os << StringPrintf("%cmethods\n", kTraceTokenChar);
+      DumpMethodList(os);
+    }
+    os << StringPrintf("%cend\n", kTraceTokenChar);
+    std::string header(os.str());
+
+    if (trace_output_mode_ == TraceOutputMode::kStreaming) {
+      DCHECK_NE(trace_file_.get(), nullptr);
+      // It is expected that this method is called when all other threads are suspended, so there
+      // cannot be any writes to trace_file_ after finish tracing.
+      // Write a special token to mark the end of trace records and the start of
+      // trace summary.
+      if (trace_format_version_ == Trace::kFormatV1) {
+        uint8_t buf[7];
+        Append2LE(buf, 0);
+        buf[2] = kOpTraceSummary;
+        Append4LE(buf + 3, static_cast<uint32_t>(header.length()));
+        // Write the trace summary. The summary is identical to the file header when
+        // the output mode is not streaming (except for methods).
+        if (!trace_file_->WriteFully(buf, sizeof(buf)) ||
+            !trace_file_->WriteFully(header.c_str(), header.length())) {
+          PLOG(WARNING) << "Failed streaming a tracing event.";
+        }
+      } else {
+        uint8_t buf[3];
+        buf[0] = kSummaryHeaderV2;
+        Append2LE(buf + 1, static_cast<uint32_t>(header.length()));
+        // Write the trace summary. Reports information about tracing mode, number of records and
+        // clock overhead in plain text format.
+        if (!trace_file_->WriteFully(buf, sizeof(buf)) ||
+            !trace_file_->WriteFully(header.c_str(), header.length())) {
+          PLOG(WARNING) << "Failed streaming a tracing event.";
+        }
       }
+    } else {
+      if (trace_file_.get() == nullptr) {
+        std::vector<uint8_t> data;
+        data.resize(header.length() + final_offset);
+        memcpy(data.data(), header.c_str(), header.length());
+        memcpy(data.data() + header.length(), buf_.get(), final_offset);
+        Runtime::Current()->GetRuntimeCallbacks()->DdmPublishChunk(CHUNK_TYPE("MPSE"),
+                                                                   ArrayRef<const uint8_t>(data));
+      } else {
+        if (!trace_file_->WriteFully(header.c_str(), header.length()) ||
+            !trace_file_->WriteFully(buf_.get(), final_offset)) {
+          std::string detail(StringPrintf("Trace data write failed: %s", strerror(errno)));
+          PLOG(ERROR) << detail;
+          ThrowRuntimeException("%s", detail.c_str());
+        }
+      }
+    }
+  } else {
+    // This is only called from the child process post fork to abort the trace.
+    // We shouldn't have any workers in the thread pool here.
+    DCHECK_EQ(thread_pool_, nullptr);
+  }
+
+  if (trace_file_.get() != nullptr) {
+    // Do not try to erase, so flush and close explicitly.
+    if (flush_entries) {
+      if (trace_file_->Flush() != 0) {
+        PLOG(WARNING) << "Could not flush trace file.";
+      }
+    } else {
+      trace_file_->MarkUnchecked();  // Do not trigger guard.
+    }
+    if (trace_file_->Close() != 0) {
+      PLOG(ERROR) << "Could not close trace file.";
     }
   }
 }
 
-void Trace::DexPcMoved(Thread* thread ATTRIBUTE_UNUSED,
-                       Handle<mirror::Object> this_object ATTRIBUTE_UNUSED,
+void Trace::DexPcMoved([[maybe_unused]] Thread* thread,
+                       [[maybe_unused]] Handle<mirror::Object> this_object,
                        ArtMethod* method,
                        uint32_t new_dex_pc) {
   // We're not recorded to listen to this kind of event, so complain.
@@ -914,23 +1071,22 @@
              << " " << new_dex_pc;
 }
 
-void Trace::FieldRead(Thread* thread ATTRIBUTE_UNUSED,
-                      Handle<mirror::Object> this_object ATTRIBUTE_UNUSED,
+void Trace::FieldRead([[maybe_unused]] Thread* thread,
+                      [[maybe_unused]] Handle<mirror::Object> this_object,
                       ArtMethod* method,
                       uint32_t dex_pc,
-                      ArtField* field ATTRIBUTE_UNUSED)
-    REQUIRES_SHARED(Locks::mutator_lock_) {
+                      [[maybe_unused]] ArtField* field) REQUIRES_SHARED(Locks::mutator_lock_) {
   // We're not recorded to listen to this kind of event, so complain.
   LOG(ERROR) << "Unexpected field read event in tracing " << ArtMethod::PrettyMethod(method)
              << " " << dex_pc;
 }
 
-void Trace::FieldWritten(Thread* thread ATTRIBUTE_UNUSED,
-                         Handle<mirror::Object> this_object ATTRIBUTE_UNUSED,
+void Trace::FieldWritten([[maybe_unused]] Thread* thread,
+                         [[maybe_unused]] Handle<mirror::Object> this_object,
                          ArtMethod* method,
                          uint32_t dex_pc,
-                         ArtField* field ATTRIBUTE_UNUSED,
-                         const JValue& field_value ATTRIBUTE_UNUSED)
+                         [[maybe_unused]] ArtField* field,
+                         [[maybe_unused]] const JValue& field_value)
     REQUIRES_SHARED(Locks::mutator_lock_) {
   // We're not recorded to listen to this kind of event, so complain.
   LOG(ERROR) << "Unexpected field write event in tracing " << ArtMethod::PrettyMethod(method)
@@ -946,31 +1102,29 @@
 
 void Trace::MethodExited(Thread* thread,
                          ArtMethod* method,
-                         instrumentation::OptionalFrame frame ATTRIBUTE_UNUSED,
-                         JValue& return_value ATTRIBUTE_UNUSED) {
+                         [[maybe_unused]] instrumentation::OptionalFrame frame,
+                         [[maybe_unused]] JValue& return_value) {
   uint32_t thread_clock_diff = 0;
   uint64_t timestamp_counter = 0;
   ReadClocks(thread, &thread_clock_diff, &timestamp_counter);
   LogMethodTraceEvent(thread, method, kTraceMethodExit, thread_clock_diff, timestamp_counter);
 }
 
-void Trace::MethodUnwind(Thread* thread,
-                         ArtMethod* method,
-                         uint32_t dex_pc ATTRIBUTE_UNUSED) {
+void Trace::MethodUnwind(Thread* thread, ArtMethod* method, [[maybe_unused]] uint32_t dex_pc) {
   uint32_t thread_clock_diff = 0;
   uint64_t timestamp_counter = 0;
   ReadClocks(thread, &thread_clock_diff, &timestamp_counter);
   LogMethodTraceEvent(thread, method, kTraceUnroll, thread_clock_diff, timestamp_counter);
 }
 
-void Trace::ExceptionThrown(Thread* thread ATTRIBUTE_UNUSED,
-                            Handle<mirror::Throwable> exception_object ATTRIBUTE_UNUSED)
+void Trace::ExceptionThrown([[maybe_unused]] Thread* thread,
+                            [[maybe_unused]] Handle<mirror::Throwable> exception_object)
     REQUIRES_SHARED(Locks::mutator_lock_) {
   LOG(ERROR) << "Unexpected exception thrown event in tracing";
 }
 
-void Trace::ExceptionHandled(Thread* thread ATTRIBUTE_UNUSED,
-                             Handle<mirror::Throwable> exception_object ATTRIBUTE_UNUSED)
+void Trace::ExceptionHandled([[maybe_unused]] Thread* thread,
+                             [[maybe_unused]] Handle<mirror::Throwable> exception_object)
     REQUIRES_SHARED(Locks::mutator_lock_) {
   LOG(ERROR) << "Unexpected exception thrown event in tracing";
 }
@@ -981,13 +1135,13 @@
   LOG(ERROR) << "Unexpected branch event in tracing" << ArtMethod::PrettyMethod(method);
 }
 
-void Trace::WatchedFramePop(Thread* self ATTRIBUTE_UNUSED,
-                            const ShadowFrame& frame ATTRIBUTE_UNUSED) {
+void Trace::WatchedFramePop([[maybe_unused]] Thread* self,
+                            [[maybe_unused]] const ShadowFrame& frame) {
   LOG(ERROR) << "Unexpected WatchedFramePop event in tracing";
 }
 
 void Trace::ReadClocks(Thread* thread, uint32_t* thread_clock_diff, uint64_t* timestamp_counter) {
-  if (UseThreadCpuClock()) {
+  if (UseThreadCpuClock(clock_source_)) {
     uint64_t clock_base = thread->GetTraceClockBase();
     if (UNLIKELY(clock_base == 0)) {
       // First event, record the base time in the map.
@@ -997,221 +1151,444 @@
       *thread_clock_diff = thread->GetCpuMicroTime() - clock_base;
     }
   }
-  if (UseWallClock()) {
+  if (UseWallClock(clock_source_)) {
     *timestamp_counter = GetTimestamp();
   }
 }
 
-std::string Trace::GetMethodLine(ArtMethod* method, uint32_t method_index) {
+uintptr_t* TraceWriterThreadPool::FinishTaskAndClaimBuffer(size_t tid) {
+  Thread* self = Thread::Current();
+  TraceWriterTask* task = static_cast<TraceWriterTask*>(TryGetTask(self));
+  if (task == nullptr) {
+    // TODO(mythria): We need to ensure we have at least as many buffers in the pool as the number
+    // of active threads for efficiency. It's a bit unlikely to hit this case and not trivial to
+    // handle this. So we haven't fixed this yet.
+    LOG(WARNING)
+        << "Fewer buffers in the pool than the number of threads. Might cause some slowdown";
+    return nullptr;
+  }
+
+  uintptr_t* buffer = task->ReserveBufferForTid(tid);
+  task->Run(self);
+  task->Finalize();
+  return buffer;
+}
+
+std::string TraceWriter::GetMethodLine(const std::string& method_line, uint32_t method_index) {
+  return StringPrintf("%#x\t%s", (method_index << TraceActionBits), method_line.c_str());
+}
+
+std::string TraceWriter::GetMethodInfoLine(ArtMethod* method) {
   method = method->GetInterfaceMethodIfProxy(kRuntimePointerSize);
-  return StringPrintf("%#x\t%s\t%s\t%s\t%s\n",
-                      (method_index << TraceActionBits),
+  return StringPrintf("%s\t%s\t%s\t%s\n",
                       PrettyDescriptor(method->GetDeclaringClassDescriptor()).c_str(),
                       method->GetName(),
                       method->GetSignature().ToString().c_str(),
                       method->GetDeclaringClassSourceFile());
 }
 
-void Trace::RecordStreamingMethodEvent(Thread* thread,
-                                       ArtMethod* method,
-                                       TraceAction action,
-                                       uint32_t thread_clock_diff,
-                                       uint64_t timestamp_counter) {
-  uintptr_t* method_trace_buffer = thread->GetMethodTraceBuffer();
-  size_t* current_offset = thread->GetMethodTraceIndexPtr();
-  // Initialize the buffer lazily. It's just simpler to keep the creation at one place.
-  if (method_trace_buffer == nullptr) {
-    method_trace_buffer = new uintptr_t[std::max(kMinBufSize, kPerThreadBufSize)]();
-    thread->SetMethodTraceBuffer(method_trace_buffer);
-    *current_offset = 0;
+void TraceWriter::RecordThreadInfo(Thread* thread) {
+  // This is the first event from this thread, so first record information about the thread.
+  std::string thread_name;
+  thread->GetThreadName(thread_name);
 
-    // This is the first event from this thread, so first record information about the thread.
-    std::string thread_name;
-    thread->GetThreadName(thread_name);
-    static constexpr size_t kThreadNameHeaderSize = 7;
-    uint8_t header[kThreadNameHeaderSize];
+  // In tests, we destroy VM after already detaching the current thread. We re-attach the current
+  // thread again as a "Shutdown thread" during the process of shutting down. So don't record
+  // information about shutdown threads since it overwrites the actual thread_name.
+  if (thread_name.compare("Shutdown thread") == 0) {
+    return;
+  }
+
+  MutexLock mu(Thread::Current(), tracing_lock_);
+  if (trace_output_mode_ != TraceOutputMode::kStreaming) {
+    threads_list_.Overwrite(GetThreadEncoding(thread->GetTid()), thread_name);
+    return;
+  }
+
+  static constexpr size_t kThreadNameHeaderSize = 7;
+  uint8_t header[kThreadNameHeaderSize];
+  if (trace_format_version_ == Trace::kFormatV1) {
     Append2LE(header, 0);
     header[2] = kOpNewThread;
-    // We use only 16 bits to encode thread id. On Android, we don't expect to use more than
-    // 16-bits for a Tid. For 32-bit platforms it is always ensured we use less than 16 bits.
-    // See  __check_max_thread_id in bionic for more details. Even on 64-bit the max threads
-    // is currently less than 65536.
-    // TODO(mythria): On host, we know thread ids can be greater than 16 bits. Consider adding
-    // a map similar to method ids.
-    DCHECK(!kIsTargetBuild || thread->GetTid() < (1 << 16));
-    Append2LE(header + 3, static_cast<uint16_t>(thread->GetTid()));
-    Append2LE(header + 5, static_cast<uint16_t>(thread_name.length()));
-
-    {
-      MutexLock mu(Thread::Current(), tracing_lock_);
-      if (!trace_file_->WriteFully(header, kThreadNameHeaderSize) ||
-          !trace_file_->WriteFully(reinterpret_cast<const uint8_t*>(thread_name.c_str()),
-                                   thread_name.length())) {
-        PLOG(WARNING) << "Failed streaming a tracing event.";
-      }
-    }
-  }
-
-  size_t required_entries = (clock_source_ == TraceClockSource::kDual) ? 4 : 3;
-  if (*current_offset + required_entries >= kPerThreadBufSize) {
-    // We don't have space for further entries. Flush the contents of the buffer and reuse the
-    // buffer to store contents. Reset the index to the start of the buffer.
-    FlushStreamingBuffer(thread);
-    *current_offset = 0;
-  }
-
-  // Record entry in per-thread trace buffer.
-  int current_index = *current_offset;
-  method_trace_buffer[current_index++] = reinterpret_cast<uintptr_t>(method);
-  // TODO(mythria): We only need two bits to record the action. Consider merging
-  // it with the method entry to save space.
-  method_trace_buffer[current_index++] = action;
-  if (UseThreadCpuClock()) {
-    method_trace_buffer[current_index++] = thread_clock_diff;
-  }
-  if (UseWallClock()) {
-    if (art::kRuntimePointerSize == PointerSize::k32) {
-      // On 32-bit architectures store timestamp counter as two 32-bit values.
-      method_trace_buffer[current_index++] = timestamp_counter >> 32;
-      method_trace_buffer[current_index++] = static_cast<uint32_t>(timestamp_counter);
-    } else {
-      method_trace_buffer[current_index++] = timestamp_counter;
-    }
-  }
-  *current_offset = current_index;
-}
-
-void Trace::WriteToBuf(uint8_t* header,
-                       size_t header_size,
-                       const std::string& data,
-                       size_t* current_index,
-                       uint8_t* buffer,
-                       size_t buffer_size) {
-  EnsureSpace(buffer, current_index, buffer_size, header_size);
-  memcpy(buffer + *current_index, header, header_size);
-  *current_index += header_size;
-
-  EnsureSpace(buffer, current_index, buffer_size, data.length());
-  if (data.length() < buffer_size) {
-    memcpy(buffer + *current_index, reinterpret_cast<const uint8_t*>(data.c_str()), data.length());
-    *current_index += data.length();
+    Append2LE(header + 3, GetThreadEncoding(thread->GetTid()));
   } else {
-    // The data is larger than buffer, so write directly to the file. EnsureSpace should have
-    // flushed any data in the buffer.
-    DCHECK_EQ(*current_index, 0U);
-    if (!trace_file_->WriteFully(reinterpret_cast<const uint8_t*>(data.c_str()), data.length())) {
-      PLOG(WARNING) << "Failed streaming a tracing event.";
-    }
+    header[0] = kThreadInfoHeaderV2;
+    Append4LE(header + 1, thread->GetTid());
   }
-}
+  DCHECK(thread_name.length() < (1 << 16));
+  Append2LE(header + 5, static_cast<uint16_t>(thread_name.length()));
 
-void Trace::FlushStreamingBuffer(Thread* thread) {
-  // Take a tracing_lock_ to serialize writes across threads. We also need to allocate a unique
-  // method id for each method. We do that by maintaining a map from id to method for each newly
-  // seen method. tracing_lock_ is required to serialize these.
-  MutexLock mu(Thread::Current(), tracing_lock_);
-  uintptr_t* method_trace_buffer = thread->GetMethodTraceBuffer();
-  // Create a temporary buffer to encode the trace events from the specified thread.
-  size_t buffer_size = kPerThreadBufSize;
-  size_t current_index = 0;
-  std::unique_ptr<uint8_t[]> buffer(new uint8_t[std::max(kMinBufSize, buffer_size)]);
-
-  size_t num_entries = *(thread->GetMethodTraceIndexPtr());
-  for (size_t entry_index = 0; entry_index < num_entries;) {
-    ArtMethod* method = reinterpret_cast<ArtMethod*>(method_trace_buffer[entry_index++]);
-    TraceAction action = DecodeTraceAction(method_trace_buffer[entry_index++]);
-    uint32_t thread_time = 0;
-    uint32_t wall_time = 0;
-    if (UseThreadCpuClock()) {
-      thread_time = method_trace_buffer[entry_index++];
-    }
-    if (UseWallClock()) {
-      uint64_t timestamp = method_trace_buffer[entry_index++];
-      if (art::kRuntimePointerSize == PointerSize::k32) {
-        // On 32-bit architectures timestamp is stored as two 32-bit values.
-        timestamp = (timestamp << 32 | method_trace_buffer[entry_index++]);
-      }
-      wall_time = GetMicroTime(timestamp) - start_time_;
-    }
-
-    auto it = art_method_id_map_.find(method);
-    uint32_t method_index = 0;
-    // If we haven't seen this method before record information about the method.
-    if (it == art_method_id_map_.end()) {
-      art_method_id_map_.emplace(method, current_method_index_);
-      method_index = current_method_index_;
-      current_method_index_++;
-      // Write a special block with the name.
-      std::string method_line(GetMethodLine(method, method_index));
-      static constexpr size_t kMethodNameHeaderSize = 5;
-      uint8_t method_header[kMethodNameHeaderSize];
-      DCHECK_LT(kMethodNameHeaderSize, kPerThreadBufSize);
-      Append2LE(method_header, 0);
-      method_header[2] = kOpNewMethod;
-      Append2LE(method_header + 3, static_cast<uint16_t>(method_line.length()));
-      WriteToBuf(method_header,
-                 kMethodNameHeaderSize,
-                 method_line,
-                 &current_index,
-                 buffer.get(),
-                 buffer_size);
-    } else {
-      method_index = it->second;
-    }
-
-    const size_t record_size = GetRecordSize(clock_source_);
-    DCHECK_LT(record_size, kPerThreadBufSize);
-    EnsureSpace(buffer.get(), &current_index, buffer_size, record_size);
-    EncodeEventEntry(
-        buffer.get() + current_index, thread, method_index, action, thread_time, wall_time);
-    current_index += record_size;
-  }
-
-  // Flush the contents of buffer to file.
-  if (!trace_file_->WriteFully(buffer.get(), current_index)) {
+  if (!trace_file_->WriteFully(header, kThreadNameHeaderSize) ||
+      !trace_file_->WriteFully(reinterpret_cast<const uint8_t*>(thread_name.c_str()),
+                               thread_name.length())) {
     PLOG(WARNING) << "Failed streaming a tracing event.";
   }
 }
 
-void Trace::RecordMethodEvent(Thread* thread,
-                              ArtMethod* method,
-                              TraceAction action,
-                              uint32_t thread_clock_diff,
-                              uint64_t timestamp_counter) {
-  // Advance cur_offset_ atomically.
-  int32_t new_offset;
-  int32_t old_offset = 0;
+void TraceWriter::PreProcessTraceForMethodInfos(
+    uintptr_t* method_trace_entries,
+    size_t current_offset,
+    std::unordered_map<ArtMethod*, std::string>& method_infos) {
+  // Compute the method infos before we process the entries. We don't want to assign an encoding
+  // for the method here. The expectation is that once we assign a method id we write it to the
+  // file before any other thread can see the method id. So we should assign method encoding while
+  // holding the tracing_lock_ and not release it till we flush the method info to the file. We
+  // don't want to flush entries to file while holding the mutator lock. We need the mutator lock to
+  // get method info. So we just precompute method infos without assigning a method encoding here.
+  // There may be a race and multiple threads computing the method info but only one of them would
+  // actually put into the method_id_map_.
+  MutexLock mu(Thread::Current(), tracing_lock_);
+  size_t num_entries = GetNumEntries(clock_source_);
+  DCHECK_EQ((kPerThreadBufSize - current_offset) % num_entries, 0u);
+  for (size_t entry_index = kPerThreadBufSize; entry_index != current_offset;) {
+    entry_index -= num_entries;
+    uintptr_t method_and_action = method_trace_entries[entry_index];
+    ArtMethod* method = reinterpret_cast<ArtMethod*>(method_and_action & kMaskTraceAction);
+    if (!HasMethodEncoding(method) && method_infos.find(method) == method_infos.end()) {
+      method_infos.emplace(method, std::move(GetMethodInfoLine(method)));
+    }
+  }
+}
 
-  // In the non-streaming case, we do a busy loop here trying to get
-  // an offset to write our record and advance cur_offset_ for the
-  // next use.
-  // Although multiple threads can call this method concurrently,
-  // the compare_exchange_weak here is still atomic (by definition).
-  // A succeeding update is visible to other cores when they pass
-  // through this point.
-  old_offset = cur_offset_.load(std::memory_order_relaxed);  // Speculative read
-  do {
-    new_offset = old_offset + GetRecordSize(clock_source_);
-    if (static_cast<size_t>(new_offset) > buffer_size_) {
+void TraceWriter::RecordMethodInfo(const std::string& method_info_line, uint32_t method_id) {
+  // Write a special block with the name.
+  std::string method_line;
+  size_t header_size;
+  static constexpr size_t kMaxMethodNameHeaderSize = 7;
+  uint8_t method_header[kMaxMethodNameHeaderSize];
+  uint16_t method_line_length = static_cast<uint16_t>(method_line.length());
+  DCHECK(method_line.length() < (1 << 16));
+  if (trace_format_version_ == Trace::kFormatV1) {
+    // Write a special block with the name.
+    static constexpr size_t kMethodNameHeaderSize = 5;
+    DCHECK_LT(kMethodNameHeaderSize, kPerThreadBufSize);
+    Append2LE(method_header, 0);
+    method_header[2] = kOpNewMethod;
+    method_line = GetMethodLine(method_info_line, method_id);
+    method_line_length = static_cast<uint16_t>(method_line.length());
+    Append2LE(method_header + 3, method_line_length);
+    header_size = kMethodNameHeaderSize;
+  } else {
+    method_line = method_info_line;
+    method_line_length = static_cast<uint16_t>(method_line.length());
+    method_header[0] = kMethodInfoHeaderV2;
+    Append4LE(method_header + 1, method_id);
+    Append2LE(method_header + 5, method_line_length);
+    header_size = 7;
+  }
+
+  const uint8_t* ptr = reinterpret_cast<const uint8_t*>(method_line.c_str());
+  if (!trace_file_->WriteFully(method_header, header_size) ||
+      !trace_file_->WriteFully(ptr, method_line_length)) {
+    PLOG(WARNING) << "Failed streaming a tracing event.";
+  }
+}
+
+void TraceWriter::FlushAllThreadBuffers() {
+  ScopedThreadStateChange stsc(Thread::Current(), ThreadState::kSuspended);
+  ScopedSuspendAll ssa(__FUNCTION__);
+  MutexLock mu(Thread::Current(), *Locks::thread_list_lock_);
+  for (Thread* thread : Runtime::Current()->GetThreadList()->GetList()) {
+    if (thread->GetMethodTraceBuffer() != nullptr) {
+      FlushBuffer(thread, /* is_sync= */ true, /* free_buffer= */ false);
+      // We cannot flush anynore data, so just return.
+      if (overflow_) {
+        return;
+      }
+    }
+  }
+  return;
+}
+
+uintptr_t* TraceWriter::PrepareBufferForNewEntries(Thread* thread) {
+  if (trace_output_mode_ == TraceOutputMode::kStreaming) {
+    // In streaming mode, just flush the per-thread buffer and reuse the
+    // existing buffer for new entries.
+    FlushBuffer(thread, /* is_sync= */ false, /* free_buffer= */ false);
+    DCHECK_EQ(overflow_, false);
+  } else {
+    // For non-streaming mode, flush all the threads to check if we have space in the common
+    // buffer to record any future events.
+    FlushAllThreadBuffers();
+  }
+  if (overflow_) {
+    return nullptr;
+  }
+  return thread->GetMethodTraceBuffer();
+}
+
+void TraceWriter::InitializeTraceBuffers() {
+  for (size_t i = 0; i < owner_tids_.size(); i++) {
+    owner_tids_[i].store(0);
+  }
+
+  trace_buffer_.reset(new uintptr_t[kPerThreadBufSize * owner_tids_.size()]);
+  CHECK(trace_buffer_.get() != nullptr);
+}
+
+uintptr_t* TraceWriter::AcquireTraceBuffer(size_t tid) {
+  for (size_t index = 0; index < owner_tids_.size(); index++) {
+    size_t owner = 0;
+    if (owner_tids_[index].compare_exchange_strong(owner, tid)) {
+      return trace_buffer_.get() + index * kPerThreadBufSize;
+    }
+  }
+
+  // No free buffers, flush the buffer at the start of task queue synchronously and then use that
+  // buffer.
+  uintptr_t* buffer = thread_pool_->FinishTaskAndClaimBuffer(tid);
+  if (buffer == nullptr) {
+    // We couldn't find a free buffer even after flushing all the tasks. So allocate a new buffer
+    // here. This should only happen if we have more threads than the number of pool buffers.
+    // TODO(mythria): Add a check for the above case here.
+    buffer = new uintptr_t[kPerThreadBufSize];
+    CHECK(buffer != nullptr);
+  }
+  return buffer;
+}
+
+void TraceWriter::FetchTraceBufferForThread(int index, size_t tid) {
+  // Only the trace_writer_ thread can release the buffer.
+  owner_tids_[index].store(tid);
+}
+
+int TraceWriter::GetMethodTraceIndex(uintptr_t* current_buffer) {
+  if (current_buffer < trace_buffer_.get() ||
+      current_buffer > trace_buffer_.get() + (owner_tids_.size() - 1) * kPerThreadBufSize) {
+    // This was the temporary buffer we allocated.
+    return -1;
+  }
+  return (current_buffer - trace_buffer_.get()) / kPerThreadBufSize;
+}
+
+void TraceWriter::FlushBuffer(Thread* thread, bool is_sync, bool release) {
+  uintptr_t* method_trace_entries = thread->GetMethodTraceBuffer();
+  size_t* current_offset = thread->GetMethodTraceIndexPtr();
+  size_t tid = thread->GetTid();
+  DCHECK(method_trace_entries != nullptr);
+
+  if (is_sync || thread_pool_ == nullptr) {
+    std::unordered_map<ArtMethod*, std::string> method_infos;
+    PreProcessTraceForMethodInfos(method_trace_entries, *current_offset, method_infos);
+    FlushBuffer(method_trace_entries, *current_offset, tid, method_infos);
+
+    // This is a synchronous flush, so no need to allocate a new buffer. This is used either
+    // when the tracing has finished or in non-streaming mode.
+    // Just reset the buffer pointer to the initial value, so we can reuse the same buffer.
+    if (release) {
+      thread->SetMethodTraceBuffer(nullptr);
+      *current_offset = 0;
+    } else {
+      *current_offset = kPerThreadBufSize;
+    }
+  } else {
+    int old_index = GetMethodTraceIndex(method_trace_entries);
+    // The TraceWriterTask takes the ownership of the buffer and releases the buffer once the
+    // entries are flushed.
+    thread_pool_->AddTask(
+        Thread::Current(),
+        new TraceWriterTask(this, old_index, method_trace_entries, *current_offset, tid));
+    if (release) {
+      thread->SetMethodTraceBuffer(nullptr);
+      *current_offset = 0;
+    } else {
+      thread->SetMethodTraceBuffer(AcquireTraceBuffer(tid));
+      *current_offset = kPerThreadBufSize;
+    }
+  }
+
+  return;
+}
+
+void TraceWriter::ReadValuesFromRecord(uintptr_t* method_trace_entries,
+                                       size_t record_index,
+                                       MethodTraceRecord& record,
+                                       bool has_thread_cpu_clock,
+                                       bool has_wall_clock) {
+  uintptr_t method_and_action = method_trace_entries[record_index++];
+  record.method = reinterpret_cast<ArtMethod*>(method_and_action & kMaskTraceAction);
+  CHECK(record.method != nullptr);
+  record.action = DecodeTraceAction(method_and_action);
+
+  record.thread_cpu_time = 0;
+  record.wall_clock_time = 0;
+  if (has_thread_cpu_clock) {
+    record.thread_cpu_time = method_trace_entries[record_index++];
+  }
+  if (has_wall_clock) {
+    uint64_t timestamp = method_trace_entries[record_index++];
+    if (art::kRuntimePointerSize == PointerSize::k32) {
+      // On 32-bit architectures timestamp is stored as two 32-bit values.
+      uint64_t high_timestamp = method_trace_entries[record_index++];
+      timestamp = (high_timestamp << 32 | timestamp);
+    }
+    record.wall_clock_time = GetMicroTime(timestamp) - start_time_;
+  }
+}
+
+void TraceWriter::FlushEntriesFormatV1(
+    uintptr_t* method_trace_entries,
+    size_t tid,
+    const std::unordered_map<ArtMethod*, std::string>& method_infos,
+    size_t end_offset,
+    size_t* current_index,
+    uint8_t* buffer_ptr) {
+  uint16_t thread_id = GetThreadEncoding(tid);
+  bool has_thread_cpu_clock = UseThreadCpuClock(clock_source_);
+  bool has_wall_clock = UseWallClock(clock_source_);
+  size_t buffer_index = *current_index;
+  size_t num_entries = GetNumEntries(clock_source_);
+  const size_t record_size = GetRecordSize(clock_source_, trace_format_version_);
+
+  for (size_t entry_index = kPerThreadBufSize; entry_index != end_offset;) {
+    entry_index -= num_entries;
+
+    MethodTraceRecord record;
+    ReadValuesFromRecord(
+        method_trace_entries, entry_index, record, has_thread_cpu_clock, has_wall_clock);
+
+    auto [method_id, is_new_method] = GetMethodEncoding(record.method);
+    if (is_new_method && trace_output_mode_ == TraceOutputMode::kStreaming) {
+      RecordMethodInfo(method_infos.find(record.method)->second, method_id);
+    }
+
+    DCHECK_LT(buffer_index + record_size, buffer_size_);
+    EncodeEventEntry(buffer_ptr + buffer_index,
+                     thread_id,
+                     method_id,
+                     record.action,
+                     record.thread_cpu_time,
+                     record.wall_clock_time);
+    buffer_index += record_size;
+  }
+  *current_index = buffer_index;
+}
+
+void TraceWriter::FlushEntriesFormatV2(
+    uintptr_t* method_trace_entries,
+    size_t tid,
+    const std::unordered_map<ArtMethod*, std::string>& method_infos,
+    size_t num_records,
+    size_t* current_index,
+    uint8_t* init_buffer_ptr) {
+  bool has_thread_cpu_clock = UseThreadCpuClock(clock_source_);
+  bool has_wall_clock = UseWallClock(clock_source_);
+  size_t num_entries = GetNumEntries(clock_source_);
+  uint32_t prev_wall_timestamp = 0;
+  uint32_t prev_thread_timestamp = 0;
+  int32_t init_method_action_encoding = 0;
+  bool is_first_entry = true;
+  uint8_t* current_buffer_ptr = init_buffer_ptr;
+  uint32_t header_size = (clock_source_ == TraceClockSource::kDual) ? kEntryHeaderSizeDualClockV2 :
+                                                                      kEntryHeaderSizeSingleClockV2;
+
+  size_t entry_index = kPerThreadBufSize;
+  for (size_t i = 0; i < num_records; i++) {
+    entry_index -= num_entries;
+
+    MethodTraceRecord record;
+    ReadValuesFromRecord(
+        method_trace_entries, entry_index, record, has_thread_cpu_clock, has_wall_clock);
+
+    // TODO(mythria): Explore the possibility of using method pointer instead of having an encoding.
+    // On 64-bit this means method ids would use 8 bytes but that is okay since we only encode the
+    // full method id in the header and then encode the diff against the method id in the header.
+    // The diff is usually expected to be small.
+    auto [method_id, is_new_method] = GetMethodEncoding(record.method);
+    if (is_new_method && trace_output_mode_ == TraceOutputMode::kStreaming) {
+      RecordMethodInfo(method_infos.find(record.method)->second, method_id);
+    }
+    DCHECK(method_id < (1 << (31 - TraceActionBits)));
+    uint32_t method_action_encoding = (method_id << TraceActionBits) | record.action;
+
+    if (is_first_entry) {
+      prev_wall_timestamp = record.wall_clock_time;
+      prev_thread_timestamp = record.thread_cpu_time;
+      init_method_action_encoding = method_action_encoding;
+      is_first_entry = false;
+
+      EncodeEventBlockHeader(init_buffer_ptr,
+                             tid,
+                             method_action_encoding,
+                             prev_thread_timestamp,
+                             prev_wall_timestamp,
+                             num_records);
+      current_buffer_ptr += header_size;
+    } else {
+      current_buffer_ptr = EncodeSignedLeb128(current_buffer_ptr,
+                                           (method_action_encoding - init_method_action_encoding));
+
+      if (has_wall_clock) {
+        current_buffer_ptr =
+            EncodeUnsignedLeb128(current_buffer_ptr, (record.wall_clock_time - prev_wall_timestamp));
+        prev_wall_timestamp = record.wall_clock_time;
+      }
+
+      if (has_thread_cpu_clock) {
+        current_buffer_ptr =
+            EncodeUnsignedLeb128(current_buffer_ptr, (record.thread_cpu_time - prev_thread_timestamp));
+        prev_thread_timestamp = record.thread_cpu_time;
+      }
+    }
+  }
+
+  // Update the total size of the block excluding header size.
+  uint8_t* total_size_loc = init_buffer_ptr + header_size - 2;
+  Append2LE(total_size_loc, current_buffer_ptr - (init_buffer_ptr + header_size));
+  *current_index += current_buffer_ptr - init_buffer_ptr;
+}
+
+void TraceWriter::FlushBuffer(uintptr_t* method_trace_entries,
+                              size_t current_offset,
+                              size_t tid,
+                              const std::unordered_map<ArtMethod*, std::string>& method_infos) {
+  // Take a tracing_lock_ to serialize writes across threads. We also need to allocate a unique
+  // method id for each method. We do that by maintaining a map from id to method for each newly
+  // seen method. tracing_lock_ is required to serialize these.
+  MutexLock mu(Thread::Current(), tracing_lock_);
+  size_t current_index = 0;
+  uint8_t* buffer_ptr = buf_.get();
+  size_t buffer_size = buffer_size_;
+
+  size_t num_entries = GetNumEntries(clock_source_);
+  size_t num_records = (kPerThreadBufSize - current_offset) / num_entries;
+  DCHECK_EQ((kPerThreadBufSize - current_offset) % num_entries, 0u);
+  const size_t record_size = GetRecordSize(clock_source_, trace_format_version_);
+  DCHECK_LT(record_size, kPerThreadBufSize);
+
+  if (trace_output_mode_ != TraceOutputMode::kStreaming) {
+    // In non-streaming mode we only flush to file at the end, so retain the earlier data. If the
+    // buffer is full we don't process any more entries.
+    current_index = cur_offset_;
+
+    // Check if there is sufficient place in the buffer for non-streaming case. If not return early.
+    if (cur_offset_ + record_size * num_records >= buffer_size) {
       overflow_ = true;
       return;
     }
-  } while (!cur_offset_.compare_exchange_weak(old_offset, new_offset, std::memory_order_relaxed));
+  }
+  num_records_ += num_records;
 
-  // Write data into the tracing buffer (if not streaming) or into a
-  // small buffer on the stack (if streaming) which we'll put into the
-  // tracing buffer below.
-  //
-  // These writes to the tracing buffer are synchronised with the
-  // future reads that (only) occur under FinishTracing(). The callers
-  // of FinishTracing() acquire locks and (implicitly) synchronise
-  // the buffer memory.
-  uint8_t* ptr;
-  ptr = buf_.get() + old_offset;
-  uint32_t wall_clock_diff = GetMicroTime(timestamp_counter) - start_time_;
-  MutexLock mu(Thread::Current(), tracing_lock_);
-  EncodeEventEntry(
-      ptr, thread, EncodeTraceMethod(method), action, thread_clock_diff, wall_clock_diff);
+  DCHECK_GT(buffer_size_, record_size * num_entries);
+  if (trace_format_version_ == Trace::kFormatV1) {
+    FlushEntriesFormatV1(
+        method_trace_entries, tid, method_infos, current_offset, &current_index, buffer_ptr);
+  } else {
+    FlushEntriesFormatV2(
+        method_trace_entries, tid, method_infos, num_records, &current_index, buffer_ptr);
+  }
+
+  if (trace_output_mode_ == TraceOutputMode::kStreaming) {
+    // Flush the contents of buffer to file.
+    if (!trace_file_->WriteFully(buffer_ptr, current_index)) {
+      PLOG(WARNING) << "Failed streaming a tracing event.";
+    }
+  } else {
+    // In non-streaming mode, we keep the data in the buffer and write to the
+    // file when tracing has stopped. Just updated the offset of the buffer.
+    cur_offset_ = current_index;
+  }
+  return;
 }
 
 void Trace::LogMethodTraceEvent(Thread* thread,
@@ -1223,43 +1600,106 @@
   // method is only called by the sampling thread. In method tracing mode, it can be called
   // concurrently.
 
+  // In non-streaming modes, we stop recoding events once the buffer is full.
+  if (trace_writer_->HasOverflow()) {
+    return;
+  }
+
+  uintptr_t* method_trace_buffer = thread->GetMethodTraceBuffer();
+  size_t* current_index = thread->GetMethodTraceIndexPtr();
+  // Initialize the buffer lazily. It's just simpler to keep the creation at one place.
+  if (method_trace_buffer == nullptr) {
+    method_trace_buffer = trace_writer_->AcquireTraceBuffer(thread->GetTid());
+    DCHECK(method_trace_buffer != nullptr);
+    thread->SetMethodTraceBuffer(method_trace_buffer);
+    *current_index = kPerThreadBufSize;
+    trace_writer_->RecordThreadInfo(thread);
+  }
+
+  size_t required_entries = GetNumEntries(clock_source_);
+  if (*current_index < required_entries) {
+    // This returns nullptr in non-streaming mode if there's an overflow and we cannot record any
+    // more entries. In streaming mode, it returns nullptr if it fails to allocate a new buffer.
+    method_trace_buffer = trace_writer_->PrepareBufferForNewEntries(thread);
+    if (method_trace_buffer == nullptr) {
+      return;
+    }
+  }
+
+  // Record entry in per-thread trace buffer.
+  // Update the offset
+  int new_entry_index = *current_index - required_entries;
+  *current_index = new_entry_index;
+
   // Ensure we always use the non-obsolete version of the method so that entry/exit events have the
   // same pointer value.
   method = method->GetNonObsoleteMethod();
-
-  if (trace_output_mode_ == TraceOutputMode::kStreaming) {
-    RecordStreamingMethodEvent(thread, method, action, thread_clock_diff, timestamp_counter);
-  } else {
-    RecordMethodEvent(thread, method, action, thread_clock_diff, timestamp_counter);
+  method_trace_buffer[new_entry_index++] = reinterpret_cast<uintptr_t>(method) | action;
+  if (UseThreadCpuClock(clock_source_)) {
+    method_trace_buffer[new_entry_index++] = thread_clock_diff;
+  }
+  if (UseWallClock(clock_source_)) {
+    if (art::kRuntimePointerSize == PointerSize::k32) {
+      // On 32-bit architectures store timestamp counter as two 32-bit values.
+      method_trace_buffer[new_entry_index++] = static_cast<uint32_t>(timestamp_counter);
+      method_trace_buffer[new_entry_index++] = timestamp_counter >> 32;
+    } else {
+      method_trace_buffer[new_entry_index++] = timestamp_counter;
+    }
   }
 }
 
-void Trace::EncodeEventEntry(uint8_t* ptr,
-                             Thread* thread,
-                             uint32_t method_index,
-                             TraceAction action,
-                             uint32_t thread_clock_diff,
-                             uint32_t wall_clock_diff) {
+void TraceWriter::EncodeEventEntry(uint8_t* ptr,
+                                   uint16_t thread_id,
+                                   uint32_t method_index,
+                                   TraceAction action,
+                                   uint32_t thread_clock_diff,
+                                   uint32_t wall_clock_diff) {
   static constexpr size_t kPacketSize = 14U;  // The maximum size of data in a packet.
+  DCHECK(method_index < (1 << (32 - TraceActionBits)));
   uint32_t method_value = (method_index << TraceActionBits) | action;
-  Append2LE(ptr, thread->GetTid());
+  Append2LE(ptr, thread_id);
   Append4LE(ptr + 2, method_value);
   ptr += 6;
 
-  if (UseThreadCpuClock()) {
+  if (UseThreadCpuClock(clock_source_)) {
     Append4LE(ptr, thread_clock_diff);
     ptr += 4;
   }
-  if (UseWallClock()) {
+  if (UseWallClock(clock_source_)) {
     Append4LE(ptr, wall_clock_diff);
   }
   static_assert(kPacketSize == 2 + 4 + 4 + 4, "Packet size incorrect.");
 }
 
-void Trace::EnsureSpace(uint8_t* buffer,
-                        size_t* current_index,
-                        size_t buffer_size,
-                        size_t required_size) {
+void TraceWriter::EncodeEventBlockHeader(uint8_t* ptr,
+                                         uint32_t thread_id,
+                                         uint32_t init_method_index,
+                                         uint32_t init_thread_clock,
+                                         uint32_t init_wall_clock,
+                                         uint16_t num_records) {
+  ptr[0] = kEntryHeaderV2;
+  Append4LE(ptr + 1, thread_id);
+  Append4LE(ptr + 5, init_method_index);
+  ptr += 9;
+
+  if (UseThreadCpuClock(clock_source_)) {
+    Append4LE(ptr, init_thread_clock);
+    ptr += 4;
+  }
+  if (UseWallClock(clock_source_)) {
+    Append4LE(ptr, init_wall_clock);
+    ptr += 4;
+  }
+  // This specifies the total number of records encoded in the block using lebs. We encode the first
+  // entry in the header, so the block contains one less than num_records.
+  Append2LE(ptr, num_records - 1);
+}
+
+void TraceWriter::EnsureSpace(uint8_t* buffer,
+                              size_t* current_index,
+                              size_t buffer_size,
+                              size_t required_size) {
   if (*current_index + required_size < buffer_size) {
     return;
   }
@@ -1270,37 +1710,24 @@
   *current_index = 0;
 }
 
-void Trace::DumpMethodList(std::ostream& os) {
+void TraceWriter::DumpMethodList(std::ostream& os) {
   MutexLock mu(Thread::Current(), tracing_lock_);
   for (auto const& entry : art_method_id_map_) {
-    os << GetMethodLine(entry.first, entry.second);
+    os << GetMethodLine(GetMethodInfoLine(entry.first), entry.second);
   }
 }
 
-void Trace::DumpThreadList(std::ostream& os) {
+void TraceWriter::DumpThreadList(std::ostream& os) {
+  MutexLock mu(Thread::Current(), tracing_lock_);
   for (const auto& it : threads_list_) {
-    // We use only 16 bits to encode thread id. On Android, we don't expect to use more than
-    // 16-bits for a Tid. For 32-bit platforms it is always ensured we use less than 16 bits.
-    // See  __check_max_thread_id in bionic for more details. Even on 64-bit the max threads
-    // is currently less than 65536.
-    // TODO(mythria): On host, we know thread ids can be greater than 16 bits. Consider adding
-    // a map similar to method ids.
-    DCHECK(!kIsTargetBuild || it.first < (1 << 16));
-    os << static_cast<uint16_t>(it.first) << "\t" << it.second << "\n";
+    os << it.first << "\t" << it.second << "\n";
   }
 }
 
-void Trace::StoreExitingThreadInfo(Thread* thread) {
-  MutexLock mu(thread, *Locks::trace_lock_);
-  if (the_trace_ != nullptr) {
-    the_trace_->UpdateThreadsList(thread);
-  }
-}
-
-Trace::TraceOutputMode Trace::GetOutputMode() {
+TraceOutputMode Trace::GetOutputMode() {
   MutexLock mu(Thread::Current(), *Locks::trace_lock_);
   CHECK(the_trace_ != nullptr) << "Trace output mode requested, but no trace currently running";
-  return the_trace_->trace_output_mode_;
+  return the_trace_->trace_writer_->GetOutputMode();
 }
 
 Trace::TraceMode Trace::GetMode() {
@@ -1324,7 +1751,7 @@
 size_t Trace::GetBufferSize() {
   MutexLock mu(Thread::Current(), *Locks::trace_lock_);
   CHECK(the_trace_ != nullptr) << "Trace buffer size requested, but no trace currently running";
-  return the_trace_->buffer_size_;
+  return the_trace_->trace_writer_->GetBufferSize();
 }
 
 bool Trace::IsTracingEnabled() {
diff --git a/runtime/trace.h b/runtime/trace.h
index 6df21c6..227955f 100644
--- a/runtime/trace.h
+++ b/runtime/trace.h
@@ -34,12 +34,13 @@
 #include "base/safe_map.h"
 #include "instrumentation.h"
 #include "runtime_globals.h"
+#include "thread_pool.h"
 
 namespace unix_file {
 class FdFile;
 }  // namespace unix_file
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtField;
 class ArtMethod;
@@ -47,6 +48,8 @@
 class ShadowFrame;
 class Thread;
 
+struct MethodTraceRecord;
+
 using DexIndexBitSet = std::bitset<65536>;
 
 enum TracingMode {
@@ -98,6 +101,253 @@
     kTraceMethodActionMask = 0x03,  // two bits
 };
 
+enum class TraceOutputMode {
+    kFile,
+    kDDMS,
+    kStreaming
+};
+
+// We need 3 entries to store 64-bit timestamp counter as two 32-bit values on 32-bit architectures.
+static constexpr uint32_t kNumEntriesForWallClock =
+    (kRuntimePointerSize == PointerSize::k64) ? 2 : 3;
+static constexpr uint32_t kNumEntriesForDualClock = kNumEntriesForWallClock + 1;
+
+// These define offsets in bytes for the individual fields of a trace entry. These are used by the
+// JITed code when storing a trace entry.
+static constexpr int32_t kMethodOffsetInBytes = 0;
+static constexpr int32_t kTimestampOffsetInBytes = 1 * static_cast<uint32_t>(kRuntimePointerSize);
+// On 32-bit architectures we store 64-bit timestamp as two 32-bit values.
+// kHighTimestampOffsetInBytes is only relevant on 32-bit architectures.
+static constexpr int32_t kHighTimestampOffsetInBytes =
+    2 * static_cast<uint32_t>(kRuntimePointerSize);
+
+static constexpr uintptr_t kMaskTraceAction = ~0b11;
+
+class TraceWriterThreadPool : public ThreadPool {
+ public:
+  static TraceWriterThreadPool* Create(const char* name) {
+    TraceWriterThreadPool* pool = new TraceWriterThreadPool(name);
+    pool->CreateThreads();
+    return pool;
+  }
+
+  uintptr_t* FinishTaskAndClaimBuffer(size_t tid);
+
+ private:
+  explicit TraceWriterThreadPool(const char* name)
+      : ThreadPool(name,
+                   /* num_threads= */ 1,
+                   /* create_peers= */ false,
+                   /* worker_stack_size= */ ThreadPoolWorker::kDefaultStackSize) {}
+};
+
+class TraceWriter {
+ public:
+  TraceWriter(File* trace_file,
+              TraceOutputMode output_mode,
+              TraceClockSource clock_source,
+              size_t buffer_size,
+              int num_trace_buffers,
+              int trace_format_version,
+              uint32_t clock_overhead_ns);
+
+  // This encodes all the events in the per-thread trace buffer and writes it to the trace file /
+  // buffer. This acquires streaming lock to prevent any other threads writing concurrently. It is
+  // required to serialize these since each method is encoded with a unique id which is assigned
+  // when the method is seen for the first time in the recoreded events. So we need to serialize
+  // these flushes across threads.
+  void FlushBuffer(Thread* thread, bool is_sync, bool free_buffer)
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!tracing_lock_);
+
+  // This is called when the per-thread buffer is full and a new entry needs to be recorded. This
+  // returns a pointer to the new buffer where the entries should be recorded.
+  // In streaming mode, we just flush the per-thread buffer. The buffer is flushed asynchronously
+  // on a thread pool worker. This creates a new buffer and updates the per-thread buffer pointer
+  // and returns a pointer to the newly created buffer.
+  // In non-streaming mode, buffers from all threads are flushed to see if there's enough room
+  // in the centralized buffer before recording new entries. We just flush these buffers
+  // synchronously and reuse the existing buffer. Since this mode is mostly deprecated we want to
+  // keep the implementation simple here.
+  uintptr_t* PrepareBufferForNewEntries(Thread* thread) REQUIRES_SHARED(Locks::mutator_lock_)
+      REQUIRES(!tracing_lock_);
+
+  // Flushes all per-thread buffer and also write a summary entry.
+  void FinishTracing(int flags, bool flush_entries) REQUIRES(!tracing_lock_)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+
+  void PreProcessTraceForMethodInfos(uintptr_t* buffer,
+                                     size_t num_entries,
+                                     std::unordered_map<ArtMethod*, std::string>& method_infos)
+      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!tracing_lock_);
+
+  // Flush buffer to the file (for streaming) or to the common buffer (for non-streaming). In
+  // non-streaming case it returns false if all the contents couldn't be flushed.
+  void FlushBuffer(uintptr_t* buffer,
+                   size_t num_entries,
+                   size_t tid,
+                   const std::unordered_map<ArtMethod*, std::string>& method_infos)
+      REQUIRES(!tracing_lock_);
+
+  // This is called when we see the first entry from the thread to record the information about the
+  // thread.
+  void RecordThreadInfo(Thread* thread) REQUIRES(!tracing_lock_);
+
+  bool HasOverflow() { return overflow_; }
+  TraceOutputMode GetOutputMode() { return trace_output_mode_; }
+  size_t GetBufferSize() { return buffer_size_; }
+
+  // Performs the initialization for the buffer pool. It marks all buffers as free by storing 0
+  // as the owner tid. This also allocates the buffer pool.
+  void InitializeTraceBuffers();
+
+  // Releases the trace buffer and transfers the ownership to the specified tid. If the tid is 0,
+  // then it means it is free and other threads can claim it.
+  void FetchTraceBufferForThread(int index, size_t tid);
+
+  // Tries to find a free buffer (which has owner of 0) from the pool. If there are no free buffers
+  // it fetches a task, flushes the contents of the buffer and returns that buffer.
+  uintptr_t* AcquireTraceBuffer(size_t tid);
+
+  // Returns the index corresponding to the start of the current_buffer. We allocate one large
+  // buffer and assign parts of it for each thread.
+  int GetMethodTraceIndex(uintptr_t* current_buffer);
+
+ private:
+  void ReadValuesFromRecord(uintptr_t* method_trace_entries,
+                            size_t record_index,
+                            MethodTraceRecord& record,
+                            bool has_thread_cpu_clock,
+                            bool has_wall_clock);
+
+  void FlushEntriesFormatV2(uintptr_t* method_trace_entries,
+                            size_t tid,
+                            const std::unordered_map<ArtMethod*, std::string>& method_infos,
+                            size_t num_records,
+                            size_t* current_index,
+                            uint8_t* init_buffer_ptr) REQUIRES(tracing_lock_);
+
+  void FlushEntriesFormatV1(uintptr_t* method_trace_entries,
+                            size_t tid,
+                            const std::unordered_map<ArtMethod*, std::string>& method_infos,
+                            size_t end_offset,
+                            size_t* current_index,
+                            uint8_t* buffer_ptr) REQUIRES(tracing_lock_);
+  // Get a 32-bit id for the method and specify if the method hasn't been seen before. If this is
+  // the first time we see this method record information (like method name, declaring class etc.,)
+  // about the method.
+  std::pair<uint32_t, bool> GetMethodEncoding(ArtMethod* method) REQUIRES(tracing_lock_);
+  bool HasMethodEncoding(ArtMethod* method) REQUIRES(tracing_lock_);
+
+  // Get a 16-bit id for the thread. We don't want to use thread ids directly since they can be
+  // more than 16-bit.
+  uint16_t GetThreadEncoding(pid_t thread_id) REQUIRES(tracing_lock_);
+
+  // Get the information about the method.
+  std::string GetMethodLine(const std::string& method_line, uint32_t method_id);
+  std::string GetMethodInfoLine(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_);
+
+  // Helper function to record method information when processing the events. These are used by
+  // streaming output mode. Non-streaming modes dump the methods and threads list at the end of
+  // tracing.
+  void RecordMethodInfo(const std::string& method_line, uint32_t method_id) REQUIRES(tracing_lock_);
+
+  // Encodes the trace event. This assumes that there is enough space reserved to encode the entry.
+  void EncodeEventEntry(uint8_t* ptr,
+                        uint16_t thread_id,
+                        uint32_t method_index,
+                        TraceAction action,
+                        uint32_t thread_clock_diff,
+                        uint32_t wall_clock_diff) REQUIRES(tracing_lock_);
+
+  // Encodes the header for the events block. This assumes that there is enough space reserved to
+  // encode the entry.
+  void EncodeEventBlockHeader(uint8_t* ptr,
+                              uint32_t thread_id,
+                              uint32_t method_index,
+                              uint32_t init_thread_clock_time,
+                              uint32_t init_wall_clock_time,
+                              uint16_t num_records) REQUIRES(tracing_lock_);
+
+  // Ensures there is sufficient space in the buffer to record the requested_size. If there is not
+  // enough sufficient space the current contents of the buffer are written to the file and
+  // current_index is reset to 0. This doesn't check if buffer_size is big enough to hold the
+  // requested size.
+  void EnsureSpace(uint8_t* buffer,
+                   size_t* current_index,
+                   size_t buffer_size,
+                   size_t required_size);
+
+  // Flush tracing buffers from all the threads.
+  void FlushAllThreadBuffers() REQUIRES(!Locks::thread_list_lock_) REQUIRES(!tracing_lock_);
+
+
+  // Methods to output traced methods and threads.
+  void DumpMethodList(std::ostream& os) REQUIRES_SHARED(Locks::mutator_lock_)
+      REQUIRES(!tracing_lock_);
+  void DumpThreadList(std::ostream& os) REQUIRES(!Locks::thread_list_lock_, !tracing_lock_);
+
+  // File to write trace data out to, null if direct to ddms.
+  std::unique_ptr<File> trace_file_;
+
+  // The kind of output for this tracing.
+  const TraceOutputMode trace_output_mode_;
+
+  // The clock source for this tracing.
+  const TraceClockSource clock_source_;
+
+  // Map of thread ids and names. This is used only in non-streaming mode, since we have to dump
+  // information about all threads in one block. In streaming mode, thread info is recorded directly
+  // in the file when we see the first even from this thread.
+  SafeMap<uint16_t, std::string> threads_list_;
+
+  // Map from ArtMethod* to index.
+  std::unordered_map<ArtMethod*, uint32_t> art_method_id_map_ GUARDED_BY(tracing_lock_);
+  uint32_t current_method_index_ = 0;
+
+  // Map from thread_id to a 16-bit identifier.
+  std::unordered_map<pid_t, uint16_t> thread_id_map_ GUARDED_BY(tracing_lock_);
+  uint16_t current_thread_index_;
+
+  // Buffer used when generating trace data from the raw entries.
+  // In streaming mode, the trace data is flushed to file when the per-thread buffer gets full.
+  // In non-streaming mode, this data is flushed at the end of tracing. If the buffer gets full
+  // we stop tracing and following trace events are ignored. The size of this buffer is
+  // specified by the user in non-streaming mode.
+  std::unique_ptr<uint8_t[]> buf_;
+
+  // The cur_offset_ into the buf_. Accessed only in SuspendAll scope when flushing data from the
+  // thread local buffers to buf_.
+  size_t cur_offset_ GUARDED_BY(tracing_lock_);
+
+  // Size of buf_.
+  const size_t buffer_size_;
+
+  // Version of trace output
+  const int trace_format_version_;
+
+  // Time trace was created.
+  const uint64_t start_time_;
+
+  // Did we overflow the buffer recording traces?
+  bool overflow_;
+
+  // Total number of records flushed to file.
+  size_t num_records_;
+
+  // Clock overhead.
+  const uint32_t clock_overhead_ns_;
+
+  std::vector<std::atomic<size_t>> owner_tids_;
+  std::unique_ptr<uintptr_t[]> trace_buffer_;
+
+  // Lock to protect common data structures accessed from multiple threads like
+  // art_method_id_map_, thread_id_map_.
+  Mutex tracing_lock_;
+
+  // Thread pool to flush the trace entries to file.
+  std::unique_ptr<TraceWriterThreadPool> thread_pool_;
+};
+
 // Class for recording event traces. Trace data is either collected
 // synchronously during execution (TracingMode::kMethodTracingActive),
 // or by a separate sampling thread (TracingMode::kSampleProfilingActive).
@@ -109,11 +359,10 @@
     kTraceClockSourceThreadCpu = 0x100,
   };
 
-  enum class TraceOutputMode {
-    kFile,
-    kDDMS,
-    kStreaming
-  };
+  static const int kFormatV1 = 0;
+  static const int kFormatV2 = 1;
+  static const int kTraceFormatVersionFlagMask = 0b110;
+  static const int kTraceFormatVersionShift = 1;
 
   enum class TraceMode {
     kMethodTracing,
@@ -161,71 +410,58 @@
       REQUIRES(!Locks::mutator_lock_, !Locks::thread_list_lock_, !Locks::trace_lock_);
   static void Shutdown()
       REQUIRES(!Locks::mutator_lock_, !Locks::thread_list_lock_, !Locks::trace_lock_);
+
   static TracingMode GetMethodTracingMode() REQUIRES(!Locks::trace_lock_);
 
   // Flush the per-thread buffer. This is called when the thread is about to detach.
   static void FlushThreadBuffer(Thread* thread) REQUIRES_SHARED(Locks::mutator_lock_)
       REQUIRES(!Locks::trace_lock_) NO_THREAD_SAFETY_ANALYSIS;
 
-  bool UseWallClock();
-  bool UseThreadCpuClock();
   void MeasureClockOverhead();
   uint32_t GetClockOverheadNanoSeconds();
 
   void CompareAndUpdateStackTrace(Thread* thread, std::vector<ArtMethod*>* stack_trace)
-      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!tracing_lock_);
+      REQUIRES_SHARED(Locks::mutator_lock_);
 
   // InstrumentationListener implementation.
-  void MethodEntered(Thread* thread, ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(!tracing_lock_) override;
+  void MethodEntered(Thread* thread, ArtMethod* method)
+      REQUIRES_SHARED(Locks::mutator_lock_) override;
   void MethodExited(Thread* thread,
                     ArtMethod* method,
                     instrumentation::OptionalFrame frame,
-                    JValue& return_value)
-      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!tracing_lock_)
-      override;
-  void MethodUnwind(Thread* thread,
-                    ArtMethod* method,
-                    uint32_t dex_pc)
-      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!tracing_lock_)
-      override;
+                    JValue& return_value) REQUIRES_SHARED(Locks::mutator_lock_) override;
+  void MethodUnwind(Thread* thread, ArtMethod* method, uint32_t dex_pc)
+      REQUIRES_SHARED(Locks::mutator_lock_) override;
   void DexPcMoved(Thread* thread,
                   Handle<mirror::Object> this_object,
                   ArtMethod* method,
-                  uint32_t new_dex_pc)
-      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!tracing_lock_)
-      override;
+                  uint32_t new_dex_pc) REQUIRES_SHARED(Locks::mutator_lock_) override;
   void FieldRead(Thread* thread,
                  Handle<mirror::Object> this_object,
                  ArtMethod* method,
                  uint32_t dex_pc,
-                 ArtField* field)
-      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!tracing_lock_) override;
+                 ArtField* field) REQUIRES_SHARED(Locks::mutator_lock_) override;
   void FieldWritten(Thread* thread,
                     Handle<mirror::Object> this_object,
                     ArtMethod* method,
                     uint32_t dex_pc,
                     ArtField* field,
-                    const JValue& field_value)
-      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!tracing_lock_) override;
-  void ExceptionThrown(Thread* thread,
-                       Handle<mirror::Throwable> exception_object)
-      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!tracing_lock_) override;
+                    const JValue& field_value) REQUIRES_SHARED(Locks::mutator_lock_) override;
+  void ExceptionThrown(Thread* thread, Handle<mirror::Throwable> exception_object)
+      REQUIRES_SHARED(Locks::mutator_lock_) override;
   void ExceptionHandled(Thread* thread, Handle<mirror::Throwable> exception_object)
-      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!tracing_lock_) override;
-  void Branch(Thread* thread,
-              ArtMethod* method,
-              uint32_t dex_pc,
-              int32_t dex_pc_offset)
-      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!tracing_lock_) override;
+      REQUIRES_SHARED(Locks::mutator_lock_) override;
+  void Branch(Thread* thread, ArtMethod* method, uint32_t dex_pc, int32_t dex_pc_offset)
+      REQUIRES_SHARED(Locks::mutator_lock_) override;
   void WatchedFramePop(Thread* thread, const ShadowFrame& frame)
       REQUIRES_SHARED(Locks::mutator_lock_) override;
+
+  TraceClockSource GetClockSource() { return clock_source_; }
+
   // Reuse an old stack trace if it exists, otherwise allocate a new one.
   static std::vector<ArtMethod*>* AllocStackTrace();
   // Clear and store an old stack trace for later use.
   static void FreeStackTrace(std::vector<ArtMethod*>* stack_trace);
-  // Save id and name of a thread before it exits.
-  static void StoreExitingThreadInfo(Thread* thread);
 
   static TraceOutputMode GetOutputMode() REQUIRES(!Locks::trace_lock_);
   static TraceMode GetMode() REQUIRES(!Locks::trace_lock_);
@@ -246,15 +482,13 @@
   // The sampling interval in microseconds is passed as an argument.
   static void* RunSamplingThread(void* arg) REQUIRES(!Locks::trace_lock_);
 
-  static void StopTracing(bool finish_tracing, bool flush_file)
+  static void StopTracing(bool flush_entries)
       REQUIRES(!Locks::mutator_lock_, !Locks::thread_list_lock_, !Locks::trace_lock_)
       // There is an annoying issue with static functions that create a new object and call into
       // that object that causes them to not be able to tell that we don't currently hold the lock.
       // This causes the negative annotations to incorrectly have a false positive. TODO: Figure out
       // how to annotate this.
       NO_THREAD_SAFETY_ANALYSIS;
-  void FinishTracing()
-      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!tracing_lock_);
 
   void ReadClocks(Thread* thread, uint32_t* thread_clock_diff, uint64_t* timestamp_counter);
 
@@ -262,73 +496,7 @@
                            ArtMethod* method,
                            TraceAction action,
                            uint32_t thread_clock_diff,
-                           uint64_t timestamp_counter) REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(!tracing_lock_);
-
-  // Methods to output traced methods and threads.
-  void DumpMethodList(std::ostream& os)
-      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!tracing_lock_);
-  void DumpThreadList(std::ostream& os) REQUIRES(!Locks::thread_list_lock_);
-
-  void RecordMethodEvent(Thread* thread,
-                         ArtMethod* method,
-                         TraceAction action,
-                         uint32_t thread_clock_diff,
-                         uint64_t timestamp) REQUIRES(!tracing_lock_);
-
-  // Encodes event in non-streaming mode. This assumes that there is enough space reserved to
-  // encode the entry.
-  void EncodeEventEntry(uint8_t* ptr,
-                        Thread* thread,
-                        uint32_t method_index,
-                        TraceAction action,
-                        uint32_t thread_clock_diff,
-                        uint32_t wall_clock_diff) REQUIRES(tracing_lock_);
-
-  // These methods are used to encode events in streaming mode.
-
-  // This records the method event in the per-thread buffer if there is sufficient space for the
-  // entire record. If the buffer is full then it just flushes the buffer and then records the
-  // entry.
-  void RecordStreamingMethodEvent(Thread* thread,
-                                  ArtMethod* method,
-                                  TraceAction action,
-                                  uint32_t thread_clock_diff,
-                                  uint64_t timestamp) REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(!tracing_lock_);
-  // This encodes all the events in the per-thread trace buffer and writes it to the trace file.
-  // This acquires streaming lock to prevent any other threads writing concurrently. It is required
-  // to serialize these since each method is encoded with a unique id which is assigned when the
-  // method is seen for the first time in the recoreded events. So we need to serialize these
-  // flushes across threads.
-  void FlushStreamingBuffer(Thread* thread) REQUIRES_SHARED(Locks::mutator_lock_)
-      REQUIRES(!tracing_lock_);
-  // Ensures there is sufficient space in the buffer to record the requested_size. If there is not
-  // enough sufficient space the current contents of the buffer are written to the file and
-  // current_index is reset to 0. This doesn't check if buffer_size is big enough to hold the
-  // requested size.
-  void EnsureSpace(uint8_t* buffer,
-                   size_t* current_index,
-                   size_t buffer_size,
-                   size_t required_size);
-  // Writes header followed by data to the buffer at the current_index. This also updates the
-  // current_index to point to the next entry.
-  void WriteToBuf(uint8_t* header,
-                  size_t header_size,
-                  const std::string& data,
-                  size_t* current_index,
-                  uint8_t* buffer,
-                  size_t buffer_size);
-
-  uint32_t EncodeTraceMethod(ArtMethod* method) REQUIRES(tracing_lock_);
-  ArtMethod* DecodeTraceMethod(uint32_t tmid) REQUIRES(tracing_lock_);
-  std::string GetMethodLine(ArtMethod* method, uint32_t method_id) REQUIRES(tracing_lock_)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-
-  void DumpBuf(uint8_t* buf, size_t buf_size, TraceClockSource clock_source)
-      REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!tracing_lock_);
-
-  void UpdateThreadsList(Thread* thread);
+                           uint64_t timestamp_counter) REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Singleton instance of the Trace or null when no method tracing is active.
   static Trace* volatile the_trace_ GUARDED_BY(Locks::trace_lock_);
@@ -342,77 +510,21 @@
   // Used to remember an unused stack trace to avoid re-allocation during sampling.
   static std::unique_ptr<std::vector<ArtMethod*>> temp_stack_trace_;
 
-  // File to write trace data out to, null if direct to ddms.
-  std::unique_ptr<File> trace_file_;
-
-  // Buffer to store trace data. In streaming mode, this is protected
-  // by the tracing_lock_. In non-streaming mode, reserved regions
-  // are atomically allocated (using cur_offset_) for log entries to
-  // be written.
-  std::unique_ptr<uint8_t[]> buf_;
-
   // Flags enabling extra tracing of things such as alloc counts.
   const int flags_;
 
-  // The kind of output for this tracing.
-  const TraceOutputMode trace_output_mode_;
-
   // The tracing method.
   const TraceMode trace_mode_;
 
   const TraceClockSource clock_source_;
 
-  // Size of buf_.
-  const size_t buffer_size_;
-
-  // Time trace was created.
-  const uint64_t start_time_;
-
-  // Clock overhead.
-  const uint32_t clock_overhead_ns_;
-
-  // Offset into buf_. The field is atomic to allow multiple writers
-  // to concurrently reserve space in the buffer. The newly written
-  // buffer contents are not read without some other form of thread
-  // synchronization, such as suspending all potential writers or
-  // acquiring *tracing_lock_. Reading cur_offset_ is thus never
-  // used to ensure visibility of any other objects, and all accesses
-  // are memory_order_relaxed.
-  //
-  // All accesses to buf_ in streaming mode occur whilst holding the
-  // streaming lock. In streaming mode, the buffer may be written out
-  // so cur_offset_ can move forwards and backwards.
-  //
-  // When not in streaming mode, the buf_ writes can come from
-  // multiple threads when the trace mode is kMethodTracing. When
-  // trace mode is kSampling, writes only come from the sampling
-  // thread.
-  //
-  // Reads to the buffer happen after the event sources writing to the
-  // buffer have been shutdown and all stores have completed. The
-  // stores are made visible in StopTracing() when execution leaves
-  // the ScopedSuspendAll block.
-  AtomicInteger cur_offset_;
-
-  // Did we overflow the buffer recording traces?
-  bool overflow_;
-
-  // Map of thread ids and names. We record the information when the threads are
-  // exiting and when the tracing has finished.
-  SafeMap<pid_t, std::string> threads_list_;
-
   // Sampling profiler sampling interval.
   int interval_us_;
 
   // A flag to indicate to the sampling thread whether to stop tracing
   bool stop_tracing_;
 
-  // Streaming mode data.
-  Mutex tracing_lock_;
-
-  // Map from ArtMethod* to index.
-  std::unordered_map<ArtMethod*, uint32_t> art_method_id_map_ GUARDED_BY(tracing_lock_);
-  uint32_t current_method_index_ = 0;
+  std::unique_ptr<TraceWriter> trace_writer_;
 
   DISALLOW_COPY_AND_ASSIGN(Trace);
 };
diff --git a/runtime/transaction.cc b/runtime/transaction.cc
index 08452bd..bc66516 100644
--- a/runtime/transaction.cc
+++ b/runtime/transaction.cc
@@ -18,7 +18,6 @@
 
 #include <android-base/logging.h>
 
-#include "aot_class_linker.h"
 #include "base/mutex-inl.h"
 #include "base/stl_util.h"
 #include "dex/descriptors_names.h"
@@ -30,12 +29,13 @@
 #include "mirror/dex_cache-inl.h"
 #include "mirror/object-inl.h"
 #include "mirror/object_array-inl.h"
+#include "oat/aot_class_linker.h"
 #include "obj_ptr-inl.h"
 #include "runtime.h"
 
 #include <list>
 
-namespace art {
+namespace art HIDDEN {
 
 // TODO: remove (only used for debugging purpose).
 static constexpr bool kEnableTransactionStats = false;
diff --git a/runtime/transaction.h b/runtime/transaction.h
index 6fa8e58..9f3282f 100644
--- a/runtime/transaction.h
+++ b/runtime/transaction.h
@@ -30,7 +30,7 @@
 #include <list>
 #include <map>
 
-namespace art {
+namespace art HIDDEN {
 namespace gc {
 class Heap;
 }  // namespace gc
diff --git a/runtime/transaction_test.cc b/runtime/transaction_test.cc
index 04aa7cd..c4eb7e8 100644
--- a/runtime/transaction_test.cc
+++ b/runtime/transaction_test.cc
@@ -25,7 +25,7 @@
 #include "mirror/class-alloc-inl.h"
 #include "scoped_thread_state_change-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class TransactionTest : public CommonRuntimeTest {
  protected:
@@ -530,16 +530,33 @@
   ASSERT_FALSE(soa.Self()->IsExceptionPending());
 }
 
+class MethodTypeTransactionTest : public TransactionTest {
+ protected:
+  MethodTypeTransactionTest() {
+    // java.lang.invoke.MethodType factory methods and mirror::MethodType::Create
+    // are backed by the same cache, which is in the primary boot image. As as a
+    // result, MethodType creation can lead to writes to the map under a
+    // transaction, which is forbidden.
+    this->use_boot_image_ = false;
+  }
+};
+
 // Tests rolling back resolved method types in dex cache.
-TEST_F(TransactionTest, ResolveMethodType) {
+TEST_F(MethodTypeTransactionTest, ResolveMethodType) {
   ScopedObjectAccess soa(Thread::Current());
   StackHandleScope<3> hs(soa.Self());
   Handle<mirror::ClassLoader> class_loader(
       hs.NewHandle(soa.Decode<mirror::ClassLoader>(LoadDex("Transaction"))));
   ASSERT_TRUE(class_loader != nullptr);
 
-  Handle<mirror::Class> h_klass(
-      hs.NewHandle(class_linker_->FindClass(soa.Self(), "LTransaction;", class_loader)));
+  MutableHandle<mirror::Class> h_klass(hs.NewHandle(
+      class_linker_->FindSystemClass(soa.Self(), "Ljava/util/concurrent/ConcurrentHashMap$Node;")));
+  ASSERT_TRUE(h_klass != nullptr);
+
+  class_linker_->EnsureInitialized(soa.Self(), h_klass, true, true);
+  ASSERT_TRUE(h_klass->IsInitialized());
+
+  h_klass.Assign(class_linker_->FindClass(soa.Self(), "LTransaction;", class_loader));
   ASSERT_TRUE(h_klass != nullptr);
 
   Handle<mirror::DexCache> h_dex_cache(hs.NewHandle(h_klass->GetDexCache()));
diff --git a/runtime/two_runtimes_test.cc b/runtime/two_runtimes_test.cc
index b52f66a..a827426 100644
--- a/runtime/two_runtimes_test.cc
+++ b/runtime/two_runtimes_test.cc
@@ -19,7 +19,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread.h"
 
-namespace art {
+namespace art HIDDEN {
 
 // This test creates two runtimes consecutively to check that state is
 // setup and cleaned-up correctly each time.
diff --git a/runtime/var_handles.cc b/runtime/var_handles.cc
index 0c7e3bd..872e780 100644
--- a/runtime/var_handles.cc
+++ b/runtime/var_handles.cc
@@ -23,48 +23,84 @@
 #include "mirror/method_type-inl.h"
 #include "mirror/var_handle.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace {
 
+template <typename CallSiteType, typename CalleeType>
+class ThrowWrongMethodTypeFunctionImpl final : public ThrowWrongMethodTypeFunction {
+ public:
+  ThrowWrongMethodTypeFunctionImpl(CallSiteType callsite_type, CalleeType callee_type)
+      : callsite_type_(callsite_type),
+        callee_type_(callee_type) {}
+
+  ~ThrowWrongMethodTypeFunctionImpl() {}
+
+  void operator()() const override REQUIRES_SHARED(Locks::mutator_lock_) {
+    ThrowWrongMethodTypeException(mirror::MethodType::PrettyDescriptor(callee_type_),
+                                  mirror::MethodType::PrettyDescriptor(callsite_type_));
+  }
+
+ private:
+  CallSiteType callsite_type_;
+  CalleeType callee_type_;
+};
+
+template <typename CallSiteType>
 bool VarHandleInvokeAccessorWithConversions(Thread* self,
                                             ShadowFrame& shadow_frame,
                                             Handle<mirror::VarHandle> var_handle,
-                                            Handle<mirror::MethodType> callsite_type,
-                                            const mirror::VarHandle::AccessMode access_mode,
-                                            const InstructionOperands* const operands,
+                                            CallSiteType callsite_type,
+                                            mirror::VarHandle::AccessMode access_mode,
+                                            const InstructionOperands* operands,
                                             JValue* result)
     REQUIRES_SHARED(Locks::mutator_lock_) {
-  StackHandleScope<1> hs(self);
-  Handle<mirror::MethodType> accessor_type(hs.NewHandle(
-      var_handle->GetMethodTypeForAccessMode(self, access_mode)));
-  const size_t num_vregs = accessor_type->NumberOfVRegs();
-  const int num_params = accessor_type->GetPTypes()->GetLength();
+  // Use a raw method handle for `accessor_type`, avoid allocating a managed `MethodType`.
+  VariableSizedHandleScope accessor_type_hs(self);
+  mirror::RawMethodType accessor_type(&accessor_type_hs);
+  var_handle->GetMethodTypeForAccessMode(access_mode, accessor_type);
+  using HandleScopeType = std::conditional_t<
+      std::is_same_v<VariableSizedHandleScope*, CallSiteType>,
+      Thread*,  // No handle scope needed, use `Thread*` that can be initialized from `self`.
+      StackHandleScope<3>>;
+  HandleScopeType hs(self);
+  ThrowWrongMethodTypeFunctionImpl throw_wmt(callsite_type, accessor_type);
+  auto from_types = mirror::MethodType::NewHandlePTypes(callsite_type, &hs);
+  auto to_types = mirror::MethodType::NewHandlePTypes(accessor_type, &hs);
+  const size_t num_vregs = mirror::MethodType::NumberOfVRegs(accessor_type);
   ShadowFrameAllocaUniquePtr accessor_frame =
       CREATE_SHADOW_FRAME(num_vregs, shadow_frame.GetMethod(), shadow_frame.GetDexPC());
   ShadowFrameGetter getter(shadow_frame, operands);
   static const uint32_t kFirstDestinationReg = 0;
   ShadowFrameSetter setter(accessor_frame.get(), kFirstDestinationReg);
-  if (!PerformConversions(self, callsite_type, accessor_type, &getter, &setter, num_params)) {
+  if (!PerformConversions(throw_wmt, from_types, to_types, &getter, &setter)) {
+    DCHECK(self->IsExceptionPending());
     return false;
   }
   RangeInstructionOperands accessor_operands(kFirstDestinationReg,
                                              kFirstDestinationReg + num_vregs);
   if (!var_handle->Access(access_mode, accessor_frame.get(), &accessor_operands, result)) {
+    DCHECK(self->IsExceptionPending());
     return false;
   }
-  return ConvertReturnValue(callsite_type, accessor_type, result);
+  if (!ConvertReturnValue(throw_wmt,
+                          mirror::MethodType::GetRType(accessor_type),
+                          mirror::MethodType::GetRType(callsite_type),
+                          result)) {
+    DCHECK(self->IsExceptionPending());
+    return false;
+  }
+  return true;
 }
 
-}  // namespace
-
-bool VarHandleInvokeAccessor(Thread* self,
-                             ShadowFrame& shadow_frame,
-                             Handle<mirror::VarHandle> var_handle,
-                             Handle<mirror::MethodType> callsite_type,
-                             const mirror::VarHandle::AccessMode access_mode,
-                             const InstructionOperands* const operands,
-                             JValue* result) {
+template <typename CallSiteType>
+bool VarHandleInvokeAccessorImpl(Thread* self,
+                                 ShadowFrame& shadow_frame,
+                                 Handle<mirror::VarHandle> var_handle,
+                                 CallSiteType callsite_type,
+                                 const mirror::VarHandle::AccessMode access_mode,
+                                 const InstructionOperands* const operands,
+                                 JValue* result) REQUIRES_SHARED(Locks::mutator_lock_) {
   if (var_handle.IsNull()) {
     ThrowNullPointerExceptionFromDexPC();
     return false;
@@ -76,7 +112,7 @@
   }
 
   mirror::VarHandle::MatchKind match_kind =
-      var_handle->GetMethodTypeMatchForAccessMode(access_mode, callsite_type.Get());
+      var_handle->GetMethodTypeMatchForAccessMode(access_mode, callsite_type);
   if (LIKELY(match_kind == mirror::VarHandle::MatchKind::kExact)) {
     return var_handle->Access(access_mode, &shadow_frame, operands, result);
   } else if (match_kind == mirror::VarHandle::MatchKind::kWithConversions) {
@@ -90,9 +126,33 @@
   } else {
     DCHECK_EQ(match_kind, mirror::VarHandle::MatchKind::kNone);
     ThrowWrongMethodTypeException(var_handle->PrettyDescriptorForAccessMode(access_mode),
-                                  callsite_type->PrettyDescriptor());
+                                  mirror::MethodType::PrettyDescriptor(callsite_type));
     return false;
   }
 }
 
+}  // namespace
+
+bool VarHandleInvokeAccessor(Thread* self,
+                             ShadowFrame& shadow_frame,
+                             Handle<mirror::VarHandle> var_handle,
+                             Handle<mirror::MethodType> callsite_type,
+                             const mirror::VarHandle::AccessMode access_mode,
+                             const InstructionOperands* const operands,
+                             JValue* result) {
+  return VarHandleInvokeAccessorImpl(
+      self, shadow_frame, var_handle, callsite_type, access_mode, operands, result);
+}
+
+bool VarHandleInvokeAccessor(Thread* self,
+                             ShadowFrame& shadow_frame,
+                             Handle<mirror::VarHandle> var_handle,
+                             mirror::RawMethodType callsite_type,
+                             const mirror::VarHandle::AccessMode access_mode,
+                             const InstructionOperands* const operands,
+                             JValue* result) {
+  return VarHandleInvokeAccessorImpl(
+      self, shadow_frame, var_handle, callsite_type, access_mode, operands, result);
+}
+
 }  // namespace art
diff --git a/runtime/var_handles.h b/runtime/var_handles.h
index 2ff8405..82056ca 100644
--- a/runtime/var_handles.h
+++ b/runtime/var_handles.h
@@ -17,9 +17,14 @@
 #ifndef ART_RUNTIME_VAR_HANDLES_H_
 #define ART_RUNTIME_VAR_HANDLES_H_
 
+#include "base/macros.h"
 #include "mirror/var_handle.h"
 
-namespace art {
+namespace art HIDDEN {
+
+namespace mirror {
+class RawMethodType;
+}  // namespace mirror
 
 bool VarHandleInvokeAccessor(Thread* self,
                              ShadowFrame& shadow_frame,
@@ -30,6 +35,15 @@
                              JValue* result)
     REQUIRES_SHARED(Locks::mutator_lock_);
 
+bool VarHandleInvokeAccessor(Thread* self,
+                             ShadowFrame& shadow_frame,
+                             Handle<mirror::VarHandle> var_handle,
+                             mirror::RawMethodType callsite_type,
+                             const mirror::VarHandle::AccessMode access_mode,
+                             const InstructionOperands* const operands,
+                             JValue* result)
+    REQUIRES_SHARED(Locks::mutator_lock_);
+
 }  // namespace art
 
 #endif  // ART_RUNTIME_VAR_HANDLES_H_
diff --git a/runtime/vdex_file.cc b/runtime/vdex_file.cc
index 9bcde00..b67786c 100644
--- a/runtime/vdex_file.cc
+++ b/runtime/vdex_file.cc
@@ -40,12 +40,11 @@
 #include "gc/heap.h"
 #include "gc/space/image_space.h"
 #include "mirror/class-inl.h"
-#include "quicken_info.h"
 #include "handle_scope-inl.h"
 #include "runtime.h"
 #include "verifier/verifier_deps.h"
 
-namespace art {
+namespace art HIDDEN {
 
 using android::base::StringPrintf;
 
@@ -57,7 +56,7 @@
   return (memcmp(vdex_version_, kVdexVersion, sizeof(kVdexVersion)) == 0);
 }
 
-VdexFile::VdexFileHeader::VdexFileHeader(bool has_dex_section ATTRIBUTE_UNUSED)
+VdexFile::VdexFileHeader::VdexFileHeader([[maybe_unused]] bool has_dex_section)
     : number_of_sections_(static_cast<uint32_t>(VdexSection::kNumberOfSections)) {
   memcpy(magic_, kVdexMagic, sizeof(kVdexMagic));
   memcpy(vdex_version_, kVdexVersion, sizeof(kVdexVersion));
@@ -216,19 +215,20 @@
 bool VdexFile::OpenAllDexFiles(std::vector<std::unique_ptr<const DexFile>>* dex_files,
                                std::string* error_msg) const {
   size_t i = 0;
+  auto dex_file_container = std::make_shared<MemoryDexFileContainer>(Begin(), End());
   for (const uint8_t* dex_file_start = GetNextDexFileData(nullptr, i);
        dex_file_start != nullptr;
        dex_file_start = GetNextDexFileData(dex_file_start, ++i)) {
-    size_t size = reinterpret_cast<const DexFile::Header*>(dex_file_start)->file_size_;
     // TODO: Supply the location information for a vdex file.
     static constexpr char kVdexLocation[] = "";
     std::string location = DexFileLoader::GetMultiDexLocation(i, kVdexLocation);
-    ArtDexFileLoader dex_file_loader(dex_file_start, size, location);
-    std::unique_ptr<const DexFile> dex(dex_file_loader.Open(GetLocationChecksum(i),
-                                                            /*oat_dex_file=*/nullptr,
-                                                            /*verify=*/false,
-                                                            /*verify_checksum=*/false,
-                                                            error_msg));
+    ArtDexFileLoader dex_file_loader(dex_file_container, location);
+    std::unique_ptr<const DexFile> dex(dex_file_loader.OpenOne(dex_file_start - Begin(),
+                                                               GetLocationChecksum(i),
+                                                               /*oat_dex_file=*/nullptr,
+                                                               /*verify=*/false,
+                                                               /*verify_checksum=*/false,
+                                                               error_msg));
     if (dex == nullptr) {
       return false;
     }
diff --git a/runtime/vdex_file.h b/runtime/vdex_file.h
index fe65c07..4a1665b 100644
--- a/runtime/vdex_file.h
+++ b/runtime/vdex_file.h
@@ -27,10 +27,9 @@
 #include "class_status.h"
 #include "dex/compact_offset_table.h"
 #include "dex/dex_file.h"
-#include "quicken_info.h"
 #include "handle.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ClassLoaderContext;
 class Thread;
@@ -102,7 +101,7 @@
 
   struct VdexFileHeader {
    public:
-    explicit VdexFileHeader(bool has_dex_section);
+    EXPORT explicit VdexFileHeader(bool has_dex_section);
 
     const char* GetMagic() const { return reinterpret_cast<const char*>(magic_); }
     const char* GetVdexVersion() const {
@@ -111,8 +110,8 @@
     uint32_t GetNumberOfSections() const {
       return number_of_sections_;
     }
-    bool IsMagicValid() const;
-    bool IsVdexVersionValid() const;
+    EXPORT bool IsMagicValid() const;
+    EXPORT bool IsVdexVersionValid() const;
     bool IsValid() const {
       return IsMagicValid() && IsVdexVersionValid();
     }
@@ -188,25 +187,25 @@
 
   // Returns nullptr if the vdex file cannot be opened or is not valid.
   // The mmap_* parameters can be left empty (nullptr/0/false) to allocate at random address.
-  static std::unique_ptr<VdexFile> OpenAtAddress(uint8_t* mmap_addr,
-                                                 size_t mmap_size,
-                                                 bool mmap_reuse,
-                                                 const std::string& vdex_filename,
-                                                 bool writable,
-                                                 bool low_4gb,
-                                                 std::string* error_msg);
+  EXPORT static std::unique_ptr<VdexFile> OpenAtAddress(uint8_t* mmap_addr,
+                                                        size_t mmap_size,
+                                                        bool mmap_reuse,
+                                                        const std::string& vdex_filename,
+                                                        bool writable,
+                                                        bool low_4gb,
+                                                        std::string* error_msg);
 
   // Returns nullptr if the vdex file cannot be opened or is not valid.
   // The mmap_* parameters can be left empty (nullptr/0/false) to allocate at random address.
-  static std::unique_ptr<VdexFile> OpenAtAddress(uint8_t* mmap_addr,
-                                                 size_t mmap_size,
-                                                 bool mmap_reuse,
-                                                 int file_fd,
-                                                 size_t vdex_length,
-                                                 const std::string& vdex_filename,
-                                                 bool writable,
-                                                 bool low_4gb,
-                                                 std::string* error_msg);
+  EXPORT static std::unique_ptr<VdexFile> OpenAtAddress(uint8_t* mmap_addr,
+                                                        size_t mmap_size,
+                                                        bool mmap_reuse,
+                                                        int file_fd,
+                                                        size_t vdex_length,
+                                                        const std::string& vdex_filename,
+                                                        bool writable,
+                                                        bool low_4gb,
+                                                        std::string* error_msg);
 
   // Returns nullptr if the vdex file cannot be opened or is not valid.
   static std::unique_ptr<VdexFile> Open(const std::string& vdex_filename,
@@ -240,8 +239,8 @@
                          error_msg);
   }
 
-  static std::unique_ptr<VdexFile> OpenFromDm(const std::string& filename,
-                                              const ZipArchive& archive);
+  EXPORT static std::unique_ptr<VdexFile> OpenFromDm(const std::string& filename,
+                                                     const ZipArchive& archive);
 
   const uint8_t* Begin() const { return mmap_.Begin(); }
   const uint8_t* End() const { return mmap_.End(); }
@@ -268,7 +267,7 @@
   // the first dex file is returned. If `cursor` is not null, it must point to a dex
   // file and this method returns the next dex file if there is one, or null if there
   // is none.
-  const uint8_t* GetNextDexFileData(const uint8_t* cursor, uint32_t dex_file_index) const;
+  EXPORT const uint8_t* GetNextDexFileData(const uint8_t* cursor, uint32_t dex_file_index) const;
 
   const uint8_t* GetNextTypeLookupTableData(const uint8_t* cursor, uint32_t dex_file_index) const;
 
@@ -279,8 +278,8 @@
   }
 
   // Open all the dex files contained in this vdex file.
-  bool OpenAllDexFiles(std::vector<std::unique_ptr<const DexFile>>* dex_files,
-                       std::string* error_msg) const;
+  EXPORT bool OpenAllDexFiles(std::vector<std::unique_ptr<const DexFile>>* dex_files,
+                              std::string* error_msg) const;
 
   // Writes a vdex into `path` and returns true on success.
   // The vdex will not contain a dex section but will store checksums of `dex_files`,
diff --git a/runtime/vdex_file_test.cc b/runtime/vdex_file_test.cc
index 1ac10eb..4c359e3 100644
--- a/runtime/vdex_file_test.cc
+++ b/runtime/vdex_file_test.cc
@@ -22,7 +22,7 @@
 
 #include "base/common_art_test.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class VdexFileTest : public CommonArtTest {};
 
diff --git a/runtime/verifier/class_verifier.cc b/runtime/verifier/class_verifier.cc
index 8946bb2..d1b882f 100644
--- a/runtime/verifier/class_verifier.cc
+++ b/runtime/verifier/class_verifier.cc
@@ -42,7 +42,7 @@
 #include "verifier/method_verifier.h"
 #include "verifier/reg_type_cache.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace verifier {
 
 using android::base::StringPrintf;
@@ -159,8 +159,9 @@
             StringPrintf("Method %s failed lock verification and will run slower.",
                          dex_file->PrettyMethod(method.GetIndex()).c_str());
         if (!gPrintedDxMonitorText) {
-          tmp = tmp + "\nCommon causes for lock verification issues are non-optimized dex code\n"
-                      "and incorrect proguard optimizations.";
+          tmp +=
+              "\nCommon causes for lock verification issues are non-optimized dex code\n"
+              "and incorrect proguard optimizations.";
           gPrintedDxMonitorText = true;
         }
         LOG(WARNING) << tmp;
@@ -187,17 +188,5 @@
   return failure_data.kind;
 }
 
-void ClassVerifier::Init(ClassLinker* class_linker) {
-  MethodVerifier::Init(class_linker);
-}
-
-void ClassVerifier::Shutdown() {
-  MethodVerifier::Shutdown();
-}
-
-void ClassVerifier::VisitStaticRoots(RootVisitor* visitor) {
-  MethodVerifier::VisitStaticRoots(visitor);
-}
-
 }  // namespace verifier
 }  // namespace art
diff --git a/runtime/verifier/class_verifier.h b/runtime/verifier/class_verifier.h
index 3048e6f..75a5a35 100644
--- a/runtime/verifier/class_verifier.h
+++ b/runtime/verifier/class_verifier.h
@@ -23,18 +23,18 @@
 #include <android-base/thread_annotations.h>
 
 #include "base/locks.h"
+#include "base/macros.h"
 #include "handle.h"
 #include "obj_ptr.h"
 #include "verifier/method_verifier.h"
 #include "verifier/reg_type_cache.h"
 #include "verifier_enums.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ClassLinker;
 class CompilerCallbacks;
 class DexFile;
-class RootVisitor;
 class Thread;
 
 namespace dex {
@@ -56,24 +56,17 @@
  public:
   // The main entrypoint for class verification. During AOT, `klass` can be
   // null.
-  static FailureKind VerifyClass(Thread* self,
-                                 VerifierDeps* verifier_deps,
-                                 const DexFile* dex_file,
-                                 Handle<mirror::Class> klass,
-                                 Handle<mirror::DexCache> dex_cache,
-                                 Handle<mirror::ClassLoader> class_loader,
-                                 const dex::ClassDef& class_def,
-                                 CompilerCallbacks* callbacks,
-                                 HardFailLogMode log_level,
-                                 uint32_t api_level,
-                                 std::string* error)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-
-  static void Init(ClassLinker* class_linker) REQUIRES_SHARED(Locks::mutator_lock_);
-  static void Shutdown();
-
-  static void VisitStaticRoots(RootVisitor* visitor)
-      REQUIRES_SHARED(Locks::mutator_lock_);
+  EXPORT static FailureKind VerifyClass(Thread* self,
+                                        VerifierDeps* verifier_deps,
+                                        const DexFile* dex_file,
+                                        Handle<mirror::Class> klass,
+                                        Handle<mirror::DexCache> dex_cache,
+                                        Handle<mirror::ClassLoader> class_loader,
+                                        const dex::ClassDef& class_def,
+                                        CompilerCallbacks* callbacks,
+                                        HardFailLogMode log_level,
+                                        uint32_t api_level,
+                                        std::string* error) REQUIRES_SHARED(Locks::mutator_lock_);
 
  private:
   DISALLOW_COPY_AND_ASSIGN(ClassVerifier);
diff --git a/runtime/verifier/instruction_flags.cc b/runtime/verifier/instruction_flags.cc
index ca3c687..73fb375 100644
--- a/runtime/verifier/instruction_flags.cc
+++ b/runtime/verifier/instruction_flags.cc
@@ -18,7 +18,7 @@
 
 #include <string.h>
 
-namespace art {
+namespace art HIDDEN {
 namespace verifier {
 
 std::string InstructionFlags::ToString() const {
diff --git a/runtime/verifier/instruction_flags.h b/runtime/verifier/instruction_flags.h
index 6cd2865..da5e2cd 100644
--- a/runtime/verifier/instruction_flags.h
+++ b/runtime/verifier/instruction_flags.h
@@ -22,7 +22,7 @@
 
 #include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace verifier {
 
 class InstructionFlags final {
diff --git a/runtime/verifier/method_verifier-inl.h b/runtime/verifier/method_verifier-inl.h
index a9fb1a0..a13a58e 100644
--- a/runtime/verifier/method_verifier-inl.h
+++ b/runtime/verifier/method_verifier-inl.h
@@ -19,7 +19,7 @@
 
 #include "method_verifier.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace verifier {
 
 inline RegisterLine* MethodVerifier::GetRegLine(uint32_t dex_pc) {
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index 9cdbce9..fc5a57e 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -65,7 +65,7 @@
 #include "verifier/method_verifier.h"
 #include "verifier_deps.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace verifier {
 
 using android::base::StringPrintf;
@@ -2649,9 +2649,9 @@
             !cast_type.IsUnresolvedTypes() && !orig_type.IsUnresolvedTypes() &&
             cast_type.HasClass() &&             // Could be conflict type, make sure it has a class.
             !cast_type.GetClass()->IsInterface() &&
-            (orig_type.IsZeroOrNull() ||
-                orig_type.IsStrictlyAssignableFrom(
-                    cast_type.Merge(orig_type, &reg_types_, this), this))) {
+            !orig_type.IsZeroOrNull() &&
+            orig_type.IsStrictlyAssignableFrom(
+                cast_type.Merge(orig_type, &reg_types_, this), this)) {
           RegisterLine* update_line = RegisterLine::Create(code_item_accessor_.RegistersSize(),
                                                            allocator_,
                                                            GetRegTypeCache());
@@ -4147,12 +4147,14 @@
       // We cannot differentiate on whether this is a class change error or just
       // a missing method. This will be handled at runtime.
       Fail(VERIFY_ERROR_NO_METHOD) << "Unable to find referenced class from invoke-super";
+      VerifyInvocationArgsUnresolvedMethod(inst, method_type, is_range);
       return nullptr;
     }
     if (reference_type.GetClass()->IsInterface()) {
       if (!GetDeclaringClass().HasClass()) {
         Fail(VERIFY_ERROR_NO_CLASS) << "Unable to resolve the full class of 'this' used in an"
                                     << "interface invoke-super";
+        VerifyInvocationArgsUnresolvedMethod(inst, method_type, is_range);
         return nullptr;
       } else if (!reference_type.IsStrictlyAssignableFrom(GetDeclaringClass(), this)) {
         Fail(VERIFY_ERROR_CLASS_CHANGE)
@@ -4161,6 +4163,7 @@
             << dex_file_->PrettyMethod(dex_method_idx_) << " to method "
             << dex_file_->PrettyMethod(method_idx) << " references "
             << "non-super-interface type " << mirror::Class::PrettyClass(reference_type.GetClass());
+        VerifyInvocationArgsUnresolvedMethod(inst, method_type, is_range);
         return nullptr;
       }
     } else {
@@ -4169,6 +4172,7 @@
         Fail(VERIFY_ERROR_NO_METHOD) << "unknown super class in invoke-super from "
                                     << dex_file_->PrettyMethod(dex_method_idx_)
                                     << " to super " << res_method->PrettyMethod();
+        VerifyInvocationArgsUnresolvedMethod(inst, method_type, is_range);
         return nullptr;
       }
       if (!reference_type.IsStrictlyAssignableFrom(GetDeclaringClass(), this) ||
@@ -4178,6 +4182,7 @@
                                     << " to super " << super
                                     << "." << res_method->GetName()
                                     << res_method->GetSignature();
+        VerifyInvocationArgsUnresolvedMethod(inst, method_type, is_range);
         return nullptr;
       }
     }
@@ -4950,9 +4955,10 @@
                                bool allow_thread_suspension,
                                bool aot_mode)
     : self_(self),
+      handles_(self),
       arena_stack_(arena_pool),
       allocator_(&arena_stack_),
-      reg_types_(class_linker, can_load_classes, allocator_, allow_thread_suspension),
+      reg_types_(class_linker, can_load_classes, allocator_, handles_, allow_thread_suspension),
       reg_table_(allocator_),
       work_insn_idx_(dex::kDexNoIndex),
       dex_method_idx_(dex_method_idx),
@@ -4966,11 +4972,9 @@
       class_linker_(class_linker),
       verifier_deps_(verifier_deps),
       link_(nullptr) {
-  self->PushVerifier(this);
 }
 
 MethodVerifier::~MethodVerifier() {
-  Thread::Current()->PopVerifier(this);
   STLDeleteElements(&failure_messages_);
 }
 
@@ -5168,10 +5172,9 @@
 MethodVerifier* MethodVerifier::CalculateVerificationInfo(
       Thread* self,
       ArtMethod* method,
+      Handle<mirror::DexCache> dex_cache,
+      Handle<mirror::ClassLoader> class_loader,
       uint32_t dex_pc) {
-  StackHandleScope<2> hs(self);
-  Handle<mirror::DexCache> dex_cache(hs.NewHandle(method->GetDexCache()));
-  Handle<mirror::ClassLoader> class_loader(hs.NewHandle(method->GetClassLoader()));
   std::unique_ptr<impl::MethodVerifier<false>> verifier(
       new impl::MethodVerifier<false>(self,
                                       Runtime::Current()->GetClassLinker(),
@@ -5307,22 +5310,6 @@
                                          api_level);
 }
 
-void MethodVerifier::Init(ClassLinker* class_linker) {
-  art::verifier::RegTypeCache::Init(class_linker);
-}
-
-void MethodVerifier::Shutdown() {
-  verifier::RegTypeCache::ShutDown();
-}
-
-void MethodVerifier::VisitStaticRoots(RootVisitor* visitor) {
-  RegTypeCache::VisitStaticRoots(visitor);
-}
-
-void MethodVerifier::VisitRoots(RootVisitor* visitor, const RootInfo& root_info) {
-  reg_types_.VisitRoots(visitor, root_info);
-}
-
 std::ostream& MethodVerifier::Fail(VerifyError error, bool pending_exc) {
   // Mark the error type as encountered.
   encountered_failure_types_ |= static_cast<uint32_t>(error);
diff --git a/runtime/verifier/method_verifier.h b/runtime/verifier/method_verifier.h
index 92cfb45..2880436 100644
--- a/runtime/verifier/method_verifier.h
+++ b/runtime/verifier/method_verifier.h
@@ -36,7 +36,7 @@
 #include "register_line.h"
 #include "verifier_enums.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ClassLinker;
 class DexFile;
@@ -97,23 +97,25 @@
 // The verifier
 class MethodVerifier {
  public:
-  static MethodVerifier* VerifyMethodAndDump(Thread* self,
-                                             VariableIndentationOutputStream* vios,
-                                             uint32_t method_idx,
-                                             const DexFile* dex_file,
-                                             Handle<mirror::DexCache> dex_cache,
-                                             Handle<mirror::ClassLoader> class_loader,
-                                             const dex::ClassDef& class_def,
-                                             const dex::CodeItem* code_item,
-                                             uint32_t method_access_flags,
-                                             uint32_t api_level)
+  EXPORT static MethodVerifier* VerifyMethodAndDump(Thread* self,
+                                                    VariableIndentationOutputStream* vios,
+                                                    uint32_t method_idx,
+                                                    const DexFile* dex_file,
+                                                    Handle<mirror::DexCache> dex_cache,
+                                                    Handle<mirror::ClassLoader> class_loader,
+                                                    const dex::ClassDef& class_def,
+                                                    const dex::CodeItem* code_item,
+                                                    uint32_t method_access_flags,
+                                                    uint32_t api_level)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Calculates the type information at the given `dex_pc`.
   // No classes will be loaded.
-  static MethodVerifier* CalculateVerificationInfo(Thread* self,
-                                                   ArtMethod* method,
-                                                   uint32_t dex_pc)
+  EXPORT static MethodVerifier* CalculateVerificationInfo(Thread* self,
+                                                          ArtMethod* method,
+                                                          Handle<mirror::DexCache> dex_cache,
+                                                          Handle<mirror::ClassLoader> class_loader,
+                                                          uint32_t dex_pc)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   const DexFile& GetDexFile() const {
@@ -155,16 +157,8 @@
                                uint32_t api_level)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  static void Init(ClassLinker* class_linker) REQUIRES_SHARED(Locks::mutator_lock_);
-  static void Shutdown();
-
   virtual ~MethodVerifier();
 
-  static void VisitStaticRoots(RootVisitor* visitor)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-  void VisitRoots(RootVisitor* visitor, const RootInfo& roots)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-
   const CodeItemDataAccessor& CodeItem() const {
     return code_item_accessor_;
   }
@@ -291,6 +285,9 @@
   // The thread we're verifying on.
   Thread* const self_;
 
+  // Handles for classes in the `RegTypeCache`.
+  VariableSizedHandleScope handles_;
+
   // Arena allocator.
   ArenaStack arena_stack_;
   ScopedArenaAllocator allocator_;
diff --git a/runtime/verifier/method_verifier_test.cc b/runtime/verifier/method_verifier_test.cc
index 0f0fd17..1c6ed7c 100644
--- a/runtime/verifier/method_verifier_test.cc
+++ b/runtime/verifier/method_verifier_test.cc
@@ -30,7 +30,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "verifier_enums.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace verifier {
 
 using metrics::test::CounterValue;
diff --git a/runtime/verifier/reg_type-inl.h b/runtime/verifier/reg_type-inl.h
index efe03a8..8db2fe6 100644
--- a/runtime/verifier/reg_type-inl.h
+++ b/runtime/verifier/reg_type-inl.h
@@ -25,7 +25,7 @@
 #include "mirror/class.h"
 #include "verifier_deps.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace verifier {
 
 inline bool RegType::CanAccess(const RegType& other) const {
@@ -154,72 +154,6 @@
   return AssignableFrom(*this, src, true, verifier);
 }
 
-inline const DoubleHiType* DoubleHiType::GetInstance() {
-  DCHECK(instance_ != nullptr);
-  return instance_;
-}
-
-inline const DoubleLoType* DoubleLoType::GetInstance() {
-  DCHECK(instance_ != nullptr);
-  return instance_;
-}
-
-inline const LongHiType* LongHiType::GetInstance() {
-  DCHECK(instance_ != nullptr);
-  return instance_;
-}
-
-inline const LongLoType* LongLoType::GetInstance() {
-  DCHECK(instance_ != nullptr);
-  return instance_;
-}
-
-inline const FloatType* FloatType::GetInstance() {
-  DCHECK(instance_ != nullptr);
-  return instance_;
-}
-
-inline const CharType* CharType::GetInstance() {
-  DCHECK(instance_ != nullptr);
-  return instance_;
-}
-
-inline const ShortType* ShortType::GetInstance() {
-  DCHECK(instance_ != nullptr);
-  return instance_;
-}
-
-inline const ByteType* ByteType::GetInstance() {
-  DCHECK(instance_ != nullptr);
-  return instance_;
-}
-
-
-inline const IntegerType* IntegerType::GetInstance() {
-  DCHECK(instance_ != nullptr);
-  return instance_;
-}
-
-inline const BooleanType* BooleanType::GetInstance() {
-  DCHECK(BooleanType::instance_ != nullptr);
-  return BooleanType::instance_;
-}
-
-inline const ConflictType* ConflictType::GetInstance() {
-  DCHECK(instance_ != nullptr);
-  return instance_;
-}
-
-inline const UndefinedType* UndefinedType::GetInstance() {
-  DCHECK(instance_ != nullptr);
-  return instance_;
-}
-
-inline const NullType* NullType::GetInstance() {
-  DCHECK(instance_ != nullptr);
-  return instance_;
-}
-
 inline void* RegType::operator new(size_t size, ScopedArenaAllocator* allocator) {
   return allocator->Alloc(size, kArenaAllocMisc);
 }
diff --git a/runtime/verifier/reg_type.cc b/runtime/verifier/reg_type.cc
index 40b880e..845bcdc 100644
--- a/runtime/verifier/reg_type.cc
+++ b/runtime/verifier/reg_type.cc
@@ -35,26 +35,12 @@
 #include <limits>
 #include <sstream>
 
-namespace art {
+namespace art HIDDEN {
 namespace verifier {
 
 using android::base::StringPrintf;
 
-const UndefinedType* UndefinedType::instance_ = nullptr;
-const ConflictType* ConflictType::instance_ = nullptr;
-const BooleanType* BooleanType::instance_ = nullptr;
-const ByteType* ByteType::instance_ = nullptr;
-const ShortType* ShortType::instance_ = nullptr;
-const CharType* CharType::instance_ = nullptr;
-const FloatType* FloatType::instance_ = nullptr;
-const LongLoType* LongLoType::instance_ = nullptr;
-const LongHiType* LongHiType::instance_ = nullptr;
-const DoubleLoType* DoubleLoType::instance_ = nullptr;
-const DoubleHiType* DoubleHiType::instance_ = nullptr;
-const IntegerType* IntegerType::instance_ = nullptr;
-const NullType* NullType::instance_ = nullptr;
-
-PrimitiveType::PrimitiveType(ObjPtr<mirror::Class> klass,
+PrimitiveType::PrimitiveType(Handle<mirror::Class> klass,
                              const std::string_view& descriptor,
                              uint16_t cache_id)
     : RegType(klass, descriptor, cache_id) {
@@ -62,13 +48,13 @@
   CHECK(!descriptor.empty());
 }
 
-Cat1Type::Cat1Type(ObjPtr<mirror::Class> klass,
+Cat1Type::Cat1Type(Handle<mirror::Class> klass,
                    const std::string_view& descriptor,
                    uint16_t cache_id)
     : PrimitiveType(klass, descriptor, cache_id) {
 }
 
-Cat2Type::Cat2Type(ObjPtr<mirror::Class> klass,
+Cat2Type::Cat2Type(Handle<mirror::Class> klass,
                    const std::string_view& descriptor,
                    uint16_t cache_id)
     : PrimitiveType(klass, descriptor, cache_id) {
@@ -135,191 +121,11 @@
   return "Integer";
 }
 
-const DoubleHiType* DoubleHiType::CreateInstance(ObjPtr<mirror::Class> klass,
-                                                 const std::string_view& descriptor,
-                                                 uint16_t cache_id) {
-  CHECK(instance_ == nullptr);
-  instance_ = new DoubleHiType(klass, descriptor, cache_id);
-  return instance_;
-}
-
-void DoubleHiType::Destroy() {
-  if (instance_ != nullptr) {
-    delete instance_;
-    instance_ = nullptr;
-  }
-}
-
-const DoubleLoType* DoubleLoType::CreateInstance(ObjPtr<mirror::Class> klass,
-                                                 const std::string_view& descriptor,
-                                                 uint16_t cache_id) {
-  CHECK(instance_ == nullptr);
-  instance_ = new DoubleLoType(klass, descriptor, cache_id);
-  return instance_;
-}
-
-void DoubleLoType::Destroy() {
-  if (instance_ != nullptr) {
-    delete instance_;
-    instance_ = nullptr;
-  }
-}
-
-const LongLoType* LongLoType::CreateInstance(ObjPtr<mirror::Class> klass,
-                                             const std::string_view& descriptor,
-                                             uint16_t cache_id) {
-  CHECK(instance_ == nullptr);
-  instance_ = new LongLoType(klass, descriptor, cache_id);
-  return instance_;
-}
-
-const LongHiType* LongHiType::CreateInstance(ObjPtr<mirror::Class> klass,
-                                             const std::string_view& descriptor,
-                                             uint16_t cache_id) {
-  CHECK(instance_ == nullptr);
-  instance_ = new LongHiType(klass, descriptor, cache_id);
-  return instance_;
-}
-
-void LongHiType::Destroy() {
-  if (instance_ != nullptr) {
-    delete instance_;
-    instance_ = nullptr;
-  }
-}
-
-void LongLoType::Destroy() {
-  if (instance_ != nullptr) {
-    delete instance_;
-    instance_ = nullptr;
-  }
-}
-
-const FloatType* FloatType::CreateInstance(ObjPtr<mirror::Class> klass,
-                                           const std::string_view& descriptor,
-                                           uint16_t cache_id) {
-  CHECK(instance_ == nullptr);
-  instance_ = new FloatType(klass, descriptor, cache_id);
-  return instance_;
-}
-
-void FloatType::Destroy() {
-  if (instance_ != nullptr) {
-    delete instance_;
-    instance_ = nullptr;
-  }
-}
-
-const CharType* CharType::CreateInstance(ObjPtr<mirror::Class> klass,
-                                         const std::string_view& descriptor,
-                                         uint16_t cache_id) {
-  CHECK(instance_ == nullptr);
-  instance_ = new CharType(klass, descriptor, cache_id);
-  return instance_;
-}
-
-void CharType::Destroy() {
-  if (instance_ != nullptr) {
-    delete instance_;
-    instance_ = nullptr;
-  }
-}
-
-const ShortType* ShortType::CreateInstance(ObjPtr<mirror::Class> klass,
-                                           const std::string_view& descriptor,
-                                           uint16_t cache_id) {
-  CHECK(instance_ == nullptr);
-  instance_ = new ShortType(klass, descriptor, cache_id);
-  return instance_;
-}
-
-void ShortType::Destroy() {
-  if (instance_ != nullptr) {
-    delete instance_;
-    instance_ = nullptr;
-  }
-}
-
-const ByteType* ByteType::CreateInstance(ObjPtr<mirror::Class> klass,
-                                         const std::string_view& descriptor,
-                                         uint16_t cache_id) {
-  CHECK(instance_ == nullptr);
-  instance_ = new ByteType(klass, descriptor, cache_id);
-  return instance_;
-}
-
-void ByteType::Destroy() {
-  if (instance_ != nullptr) {
-    delete instance_;
-    instance_ = nullptr;
-  }
-}
-
-const IntegerType* IntegerType::CreateInstance(ObjPtr<mirror::Class> klass,
-                                               const std::string_view& descriptor,
-                                               uint16_t cache_id) {
-  CHECK(instance_ == nullptr);
-  instance_ = new IntegerType(klass, descriptor, cache_id);
-  return instance_;
-}
-
-void IntegerType::Destroy() {
-  if (instance_ != nullptr) {
-    delete instance_;
-    instance_ = nullptr;
-  }
-}
-
-const ConflictType* ConflictType::CreateInstance(ObjPtr<mirror::Class> klass,
-                                                 const std::string_view& descriptor,
-                                                 uint16_t cache_id) {
-  CHECK(instance_ == nullptr);
-  instance_ = new ConflictType(klass, descriptor, cache_id);
-  return instance_;
-}
-
-void ConflictType::Destroy() {
-  if (instance_ != nullptr) {
-    delete instance_;
-    instance_ = nullptr;
-  }
-}
-
-const BooleanType* BooleanType::CreateInstance(ObjPtr<mirror::Class> klass,
-                                               const std::string_view& descriptor,
-                                               uint16_t cache_id) {
-  CHECK(BooleanType::instance_ == nullptr);
-  instance_ = new BooleanType(klass, descriptor, cache_id);
-  return BooleanType::instance_;
-}
-
-void BooleanType::Destroy() {
-  if (BooleanType::instance_ != nullptr) {
-    delete instance_;
-    instance_ = nullptr;
-  }
-}
-
 std::string UndefinedType::Dump() const REQUIRES_SHARED(Locks::mutator_lock_) {
   return "Undefined";
 }
 
-const UndefinedType* UndefinedType::CreateInstance(ObjPtr<mirror::Class> klass,
-                                                   const std::string_view& descriptor,
-                                                   uint16_t cache_id) {
-  CHECK(instance_ == nullptr);
-  instance_ = new UndefinedType(klass, descriptor, cache_id);
-  return instance_;
-}
-
-void UndefinedType::Destroy() {
-  if (instance_ != nullptr) {
-    delete instance_;
-    instance_ = nullptr;
-  }
-}
-
-PreciseReferenceType::PreciseReferenceType(ObjPtr<mirror::Class> klass,
+PreciseReferenceType::PreciseReferenceType(Handle<mirror::Class> klass,
                                            const std::string_view& descriptor,
                                            uint16_t cache_id)
     : RegType(klass, descriptor, cache_id) {
@@ -935,14 +741,10 @@
   if (!klass_.IsNull()) {
     CHECK(!descriptor_.empty()) << *this;
     std::string temp;
-    CHECK_EQ(descriptor_, klass_.Read()->GetDescriptor(&temp)) << *this;
+    CHECK_EQ(descriptor_, klass_->GetDescriptor(&temp)) << *this;
   }
 }
 
-void RegType::VisitRoots(RootVisitor* visitor, const RootInfo& root_info) const {
-  klass_.VisitRootIfNonNull(visitor, root_info);
-}
-
 void UninitializedThisReferenceType::CheckInvariants() const {
   CHECK_EQ(GetAllocationPc(), 0U) << *this;
 }
@@ -950,19 +752,19 @@
 void UnresolvedUninitializedThisRefType::CheckInvariants() const {
   CHECK_EQ(GetAllocationPc(), 0U) << *this;
   CHECK(!descriptor_.empty()) << *this;
-  CHECK(klass_.IsNull()) << *this;
+  CHECK(!HasClass()) << *this;
 }
 
 void UnresolvedUninitializedRefType::CheckInvariants() const {
   CHECK(!descriptor_.empty()) << *this;
-  CHECK(klass_.IsNull()) << *this;
+  CHECK(!HasClass()) << *this;
 }
 
 UnresolvedMergedType::UnresolvedMergedType(const RegType& resolved,
                                            const BitVector& unresolved,
                                            const RegTypeCache* reg_type_cache,
                                            uint16_t cache_id)
-    : UnresolvedType("", cache_id),
+    : UnresolvedType(reg_type_cache->GetNullHandle(), "", cache_id),
       reg_type_cache_(reg_type_cache),
       resolved_part_(resolved),
       unresolved_types_(unresolved, false, unresolved.GetAllocator()) {
@@ -973,7 +775,7 @@
 
   // Unresolved merged types: merged types should be defined.
   CHECK(descriptor_.empty()) << *this;
-  CHECK(klass_.IsNull()) << *this;
+  CHECK(!HasClass()) << *this;
 
   CHECK(!resolved_part_.IsConflict());
   CHECK(resolved_part_.IsReferenceTypes());
@@ -1017,13 +819,13 @@
 
 void UnresolvedReferenceType::CheckInvariants() const {
   CHECK(!descriptor_.empty()) << *this;
-  CHECK(klass_.IsNull()) << *this;
+  CHECK(!HasClass()) << *this;
 }
 
 void UnresolvedSuperClass::CheckInvariants() const {
   // Unresolved merged types: merged types should be defined.
   CHECK(descriptor_.empty()) << *this;
-  CHECK(klass_.IsNull()) << *this;
+  CHECK(!HasClass()) << *this;
   CHECK_NE(unresolved_child_id_, 0U) << *this;
 }
 
@@ -1032,21 +834,5 @@
   return os;
 }
 
-const NullType* NullType::CreateInstance(ObjPtr<mirror::Class> klass,
-                                         const std::string_view& descriptor,
-                                         uint16_t cache_id) {
-  CHECK(instance_ == nullptr);
-  instance_ = new NullType(klass, descriptor, cache_id);
-  return instance_;
-}
-
-void NullType::Destroy() {
-  if (NullType::instance_ != nullptr) {
-    delete instance_;
-    instance_ = nullptr;
-  }
-}
-
-
 }  // namespace verifier
 }  // namespace art
diff --git a/runtime/verifier/reg_type.h b/runtime/verifier/reg_type.h
index 965bbaf..66f075e 100644
--- a/runtime/verifier/reg_type.h
+++ b/runtime/verifier/reg_type.h
@@ -29,10 +29,11 @@
 #include "base/macros.h"
 #include "dex/primitive.h"
 #include "gc_root.h"
+#include "handle.h"
 #include "handle_scope.h"
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace mirror {
 class Class;
 class ClassLoader;
@@ -193,9 +194,15 @@
   }
   ObjPtr<mirror::Class> GetClass() const REQUIRES_SHARED(Locks::mutator_lock_) {
     DCHECK(!IsUnresolvedReference());
-    DCHECK(!klass_.IsNull()) << Dump();
+    DCHECK(!klass_.IsNull());
     DCHECK(HasClass());
-    return klass_.Read();
+    return klass_.Get();
+  }
+  Handle<mirror::Class> GetClassHandle() const REQUIRES_SHARED(Locks::mutator_lock_) {
+    DCHECK(!IsUnresolvedReference());
+    DCHECK(!klass_.IsNull()) << Dump();
+    DCHECK(HasClass()) << Dump();
+    return klass_;
   }
   uint16_t GetId() const { return cache_id_; }
   const RegType& GetSuperClass(RegTypeCache* cache) const
@@ -247,9 +254,6 @@
 
   virtual ~RegType() {}
 
-  void VisitRoots(RootVisitor* visitor, const RootInfo& root_info) const
-      REQUIRES_SHARED(Locks::mutator_lock_);
-
   static void* operator new(size_t size) noexcept {
     return ::operator new(size);
   }
@@ -304,7 +308,7 @@
   }
 
  protected:
-  RegType(ObjPtr<mirror::Class> klass,
+  RegType(Handle<mirror::Class> klass,
           const std::string_view& descriptor,
           uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_)
       : descriptor_(descriptor),
@@ -312,7 +316,7 @@
         cache_id_(cache_id) {}
 
   template <typename Class>
-  void CheckConstructorInvariants(Class* this_ ATTRIBUTE_UNUSED) const
+  void CheckConstructorInvariants([[maybe_unused]] Class* this_) const
       REQUIRES_SHARED(Locks::mutator_lock_) {
     static_assert(std::is_final<Class>::value, "Class must be final.");
     if (kIsDebugBuild) {
@@ -323,7 +327,7 @@
   virtual AssignmentType GetAssignmentTypeImpl() const = 0;
 
   const std::string_view descriptor_;
-  mutable GcRoot<mirror::Class> klass_;  // Non-const only due to moving classes.
+  const Handle<mirror::Class> klass_;
   const uint16_t cache_id_;
 
   friend class RegTypeCache;
@@ -348,31 +352,16 @@
 
   std::string Dump() const override REQUIRES_SHARED(Locks::mutator_lock_);
 
-  // Get the singleton Conflict instance.
-  static const ConflictType* GetInstance() PURE;
-
-  // Create the singleton instance.
-  static const ConflictType* CreateInstance(ObjPtr<mirror::Class> klass,
-                                            const std::string_view& descriptor,
-                                            uint16_t cache_id)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-
-  // Destroy the singleton instance.
-  static void Destroy();
-
   AssignmentType GetAssignmentTypeImpl() const override {
     return AssignmentType::kConflict;
   }
 
- private:
-  ConflictType(ObjPtr<mirror::Class> klass,
+  ConflictType(Handle<mirror::Class> klass,
                const std::string_view& descriptor,
                uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_)
       : RegType(klass, descriptor, cache_id) {
     CheckConstructorInvariants(this);
   }
-
-  static const ConflictType* instance_;
 };
 
 // A variant of the bottom type used to specify an undefined value in the
@@ -384,36 +373,21 @@
 
   std::string Dump() const override REQUIRES_SHARED(Locks::mutator_lock_);
 
-  // Get the singleton Undefined instance.
-  static const UndefinedType* GetInstance() PURE;
-
-  // Create the singleton instance.
-  static const UndefinedType* CreateInstance(ObjPtr<mirror::Class> klass,
-                                             const std::string_view& descriptor,
-                                             uint16_t cache_id)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-
-  // Destroy the singleton instance.
-  static void Destroy();
-
   AssignmentType GetAssignmentTypeImpl() const override {
     return AssignmentType::kNotAssignable;
   }
 
- private:
-  UndefinedType(ObjPtr<mirror::Class> klass,
+  UndefinedType(Handle<mirror::Class> klass,
                 const std::string_view& descriptor,
                 uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_)
       : RegType(klass, descriptor, cache_id) {
     CheckConstructorInvariants(this);
   }
-
-  static const UndefinedType* instance_;
 };
 
 class PrimitiveType : public RegType {
  public:
-  PrimitiveType(ObjPtr<mirror::Class> klass,
+  PrimitiveType(Handle<mirror::Class> klass,
                 const std::string_view& descriptor,
                 uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_);
 
@@ -422,7 +396,7 @@
 
 class Cat1Type : public PrimitiveType {
  public:
-  Cat1Type(ObjPtr<mirror::Class> klass,
+  Cat1Type(Handle<mirror::Class> klass,
            const std::string_view& descriptor,
            uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_);
 };
@@ -431,155 +405,107 @@
  public:
   bool IsInteger() const override { return true; }
   std::string Dump() const override REQUIRES_SHARED(Locks::mutator_lock_);
-  static const IntegerType* CreateInstance(ObjPtr<mirror::Class> klass,
-                                           const std::string_view& descriptor,
-                                           uint16_t cache_id)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-  static const IntegerType* GetInstance() PURE;
-  static void Destroy();
 
   AssignmentType GetAssignmentTypeImpl() const override {
     return AssignmentType::kInteger;
   }
 
- private:
-  IntegerType(ObjPtr<mirror::Class> klass,
+  IntegerType(Handle<mirror::Class> klass,
               const std::string_view& descriptor,
               uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_)
       : Cat1Type(klass, descriptor, cache_id) {
     CheckConstructorInvariants(this);
   }
-  static const IntegerType* instance_;
 };
 
 class BooleanType final : public Cat1Type {
  public:
   bool IsBoolean() const override { return true; }
   std::string Dump() const override REQUIRES_SHARED(Locks::mutator_lock_);
-  static const BooleanType* CreateInstance(ObjPtr<mirror::Class> klass,
-                                           const std::string_view& descriptor,
-                                           uint16_t cache_id)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-  static const BooleanType* GetInstance() PURE;
-  static void Destroy();
 
   AssignmentType GetAssignmentTypeImpl() const override {
     return AssignmentType::kBoolean;
   }
 
- private:
-  BooleanType(ObjPtr<mirror::Class> klass,
+  BooleanType(Handle<mirror::Class> klass,
               const std::string_view& descriptor,
               uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_)
       : Cat1Type(klass, descriptor, cache_id) {
     CheckConstructorInvariants(this);
   }
-
-  static const BooleanType* instance_;
 };
 
 class ByteType final : public Cat1Type {
  public:
   bool IsByte() const override { return true; }
   std::string Dump() const override REQUIRES_SHARED(Locks::mutator_lock_);
-  static const ByteType* CreateInstance(ObjPtr<mirror::Class> klass,
-                                        const std::string_view& descriptor,
-                                        uint16_t cache_id)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-  static const ByteType* GetInstance() PURE;
-  static void Destroy();
 
   AssignmentType GetAssignmentTypeImpl() const override {
     return AssignmentType::kByte;
   }
 
- private:
-  ByteType(ObjPtr<mirror::Class> klass,
+  ByteType(Handle<mirror::Class> klass,
            const std::string_view& descriptor,
            uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_)
       : Cat1Type(klass, descriptor, cache_id) {
     CheckConstructorInvariants(this);
   }
-  static const ByteType* instance_;
 };
 
 class ShortType final : public Cat1Type {
  public:
   bool IsShort() const override { return true; }
   std::string Dump() const override REQUIRES_SHARED(Locks::mutator_lock_);
-  static const ShortType* CreateInstance(ObjPtr<mirror::Class> klass,
-                                         const std::string_view& descriptor,
-                                         uint16_t cache_id)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-  static const ShortType* GetInstance() PURE;
-  static void Destroy();
 
   AssignmentType GetAssignmentTypeImpl() const override {
     return AssignmentType::kShort;
   }
 
- private:
-  ShortType(ObjPtr<mirror::Class> klass, const std::string_view& descriptor,
+  ShortType(Handle<mirror::Class> klass,
+            const std::string_view& descriptor,
             uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_)
       : Cat1Type(klass, descriptor, cache_id) {
     CheckConstructorInvariants(this);
   }
-  static const ShortType* instance_;
 };
 
 class CharType final : public Cat1Type {
  public:
   bool IsChar() const override { return true; }
   std::string Dump() const override REQUIRES_SHARED(Locks::mutator_lock_);
-  static const CharType* CreateInstance(ObjPtr<mirror::Class> klass,
-                                        const std::string_view& descriptor,
-                                        uint16_t cache_id)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-  static const CharType* GetInstance() PURE;
-  static void Destroy();
 
   AssignmentType GetAssignmentTypeImpl() const override {
     return AssignmentType::kChar;
   }
 
- private:
-  CharType(ObjPtr<mirror::Class> klass,
+  CharType(Handle<mirror::Class> klass,
            const std::string_view& descriptor,
            uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_)
       : Cat1Type(klass, descriptor, cache_id) {
     CheckConstructorInvariants(this);
   }
-  static const CharType* instance_;
 };
 
 class FloatType final : public Cat1Type {
  public:
   bool IsFloat() const override { return true; }
   std::string Dump() const override REQUIRES_SHARED(Locks::mutator_lock_);
-  static const FloatType* CreateInstance(ObjPtr<mirror::Class> klass,
-                                         const std::string_view& descriptor,
-                                         uint16_t cache_id)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-  static const FloatType* GetInstance() PURE;
-  static void Destroy();
 
   AssignmentType GetAssignmentTypeImpl() const override {
     return AssignmentType::kFloat;
   }
 
- private:
-  FloatType(ObjPtr<mirror::Class> klass,
+  FloatType(Handle<mirror::Class> klass,
             const std::string_view& descriptor,
             uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_)
       : Cat1Type(klass, descriptor, cache_id) {
     CheckConstructorInvariants(this);
   }
-  static const FloatType* instance_;
 };
 
 class Cat2Type : public PrimitiveType {
  public:
-  Cat2Type(ObjPtr<mirror::Class> klass,
+  Cat2Type(Handle<mirror::Class> klass,
            const std::string_view& descriptor,
            uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_);
 };
@@ -589,50 +515,34 @@
   std::string Dump() const override REQUIRES_SHARED(Locks::mutator_lock_);
   bool IsLongLo() const override { return true; }
   bool IsLong() const override { return true; }
-  static const LongLoType* CreateInstance(ObjPtr<mirror::Class> klass,
-                                          const std::string_view& descriptor,
-                                          uint16_t cache_id)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-  static const LongLoType* GetInstance() PURE;
-  static void Destroy();
 
   AssignmentType GetAssignmentTypeImpl() const override {
     return AssignmentType::kLongLo;
   }
 
- private:
-  LongLoType(ObjPtr<mirror::Class> klass,
+  LongLoType(Handle<mirror::Class> klass,
              const std::string_view& descriptor,
              uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_)
       : Cat2Type(klass, descriptor, cache_id) {
     CheckConstructorInvariants(this);
   }
-  static const LongLoType* instance_;
 };
 
 class LongHiType final : public Cat2Type {
  public:
   std::string Dump() const override REQUIRES_SHARED(Locks::mutator_lock_);
   bool IsLongHi() const override { return true; }
-  static const LongHiType* CreateInstance(ObjPtr<mirror::Class> klass,
-                                          const std::string_view& descriptor,
-                                          uint16_t cache_id)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-  static const LongHiType* GetInstance() PURE;
-  static void Destroy();
 
   AssignmentType GetAssignmentTypeImpl() const override {
     return AssignmentType::kNotAssignable;
   }
 
- private:
-  LongHiType(ObjPtr<mirror::Class> klass,
+  LongHiType(Handle<mirror::Class> klass,
              const std::string_view& descriptor,
              uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_)
       : Cat2Type(klass, descriptor, cache_id) {
     CheckConstructorInvariants(this);
   }
-  static const LongHiType* instance_;
 };
 
 class DoubleLoType final : public Cat2Type {
@@ -640,56 +550,42 @@
   std::string Dump() const override REQUIRES_SHARED(Locks::mutator_lock_);
   bool IsDoubleLo() const override { return true; }
   bool IsDouble() const override { return true; }
-  static const DoubleLoType* CreateInstance(ObjPtr<mirror::Class> klass,
-                                            const std::string_view& descriptor,
-                                            uint16_t cache_id)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-  static const DoubleLoType* GetInstance() PURE;
-  static void Destroy();
 
   AssignmentType GetAssignmentTypeImpl() const override {
     return AssignmentType::kDoubleLo;
   }
 
- private:
-  DoubleLoType(ObjPtr<mirror::Class> klass,
+  DoubleLoType(Handle<mirror::Class> klass,
                const std::string_view& descriptor,
                uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_)
       : Cat2Type(klass, descriptor, cache_id) {
     CheckConstructorInvariants(this);
   }
-  static const DoubleLoType* instance_;
 };
 
 class DoubleHiType final : public Cat2Type {
  public:
   std::string Dump() const override REQUIRES_SHARED(Locks::mutator_lock_);
   bool IsDoubleHi() const override { return true; }
-  static const DoubleHiType* CreateInstance(ObjPtr<mirror::Class> klass,
-                                            const std::string_view& descriptor,
-                                            uint16_t cache_id)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-  static const DoubleHiType* GetInstance() PURE;
-  static void Destroy();
 
   AssignmentType GetAssignmentTypeImpl() const override {
     return AssignmentType::kNotAssignable;
   }
 
- private:
-  DoubleHiType(ObjPtr<mirror::Class> klass,
+  DoubleHiType(Handle<mirror::Class> klass,
                const std::string_view& descriptor,
                uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_)
       : Cat2Type(klass, descriptor, cache_id) {
     CheckConstructorInvariants(this);
   }
-  static const DoubleHiType* instance_;
 };
 
 class ConstantType : public RegType {
  public:
-  ConstantType(uint32_t constant, uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_)
-      : RegType(nullptr, "", cache_id), constant_(constant) {
+  ConstantType(Handle<mirror::Class> klass,
+               uint32_t constant,
+               uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_)
+      : RegType(klass, "", cache_id), constant_(constant) {
   }
 
 
@@ -749,9 +645,9 @@
 
 class PreciseConstType final : public ConstantType {
  public:
-  PreciseConstType(uint32_t constant, uint16_t cache_id)
+  PreciseConstType(Handle<mirror::Class> cls, uint32_t constant, uint16_t cache_id)
       REQUIRES_SHARED(Locks::mutator_lock_)
-      : ConstantType(constant, cache_id) {
+      : ConstantType(cls, constant, cache_id) {
     CheckConstructorInvariants(this);
   }
 
@@ -766,9 +662,9 @@
 
 class PreciseConstLoType final : public ConstantType {
  public:
-  PreciseConstLoType(uint32_t constant, uint16_t cache_id)
+  PreciseConstLoType(Handle<mirror::Class> cls, uint32_t constant, uint16_t cache_id)
       REQUIRES_SHARED(Locks::mutator_lock_)
-      : ConstantType(constant, cache_id) {
+      : ConstantType(cls, constant, cache_id) {
     CheckConstructorInvariants(this);
   }
   bool IsPreciseConstantLo() const override { return true; }
@@ -781,9 +677,9 @@
 
 class PreciseConstHiType final : public ConstantType {
  public:
-  PreciseConstHiType(uint32_t constant, uint16_t cache_id)
+  PreciseConstHiType(Handle<mirror::Class> cls, uint32_t constant, uint16_t cache_id)
       REQUIRES_SHARED(Locks::mutator_lock_)
-      : ConstantType(constant, cache_id) {
+      : ConstantType(cls, constant, cache_id) {
     CheckConstructorInvariants(this);
   }
   bool IsPreciseConstantHi() const override { return true; }
@@ -796,9 +692,9 @@
 
 class ImpreciseConstType final : public ConstantType {
  public:
-  ImpreciseConstType(uint32_t constat, uint16_t cache_id)
+  ImpreciseConstType(Handle<mirror::Class> cls, uint32_t constat, uint16_t cache_id)
        REQUIRES_SHARED(Locks::mutator_lock_)
-       : ConstantType(constat, cache_id) {
+       : ConstantType(cls, constat, cache_id) {
     CheckConstructorInvariants(this);
   }
   bool IsImpreciseConstant() const override { return true; }
@@ -811,9 +707,9 @@
 
 class ImpreciseConstLoType final : public ConstantType {
  public:
-  ImpreciseConstLoType(uint32_t constant, uint16_t cache_id)
+  ImpreciseConstLoType(Handle<mirror::Class> cls, uint32_t constant, uint16_t cache_id)
       REQUIRES_SHARED(Locks::mutator_lock_)
-      : ConstantType(constant, cache_id) {
+      : ConstantType(cls, constant, cache_id) {
     CheckConstructorInvariants(this);
   }
   bool IsImpreciseConstantLo() const override { return true; }
@@ -826,9 +722,9 @@
 
 class ImpreciseConstHiType final : public ConstantType {
  public:
-  ImpreciseConstHiType(uint32_t constant, uint16_t cache_id)
+  ImpreciseConstHiType(Handle<mirror::Class> cls, uint32_t constant, uint16_t cache_id)
       REQUIRES_SHARED(Locks::mutator_lock_)
-      : ConstantType(constant, cache_id) {
+      : ConstantType(cls, constant, cache_id) {
     CheckConstructorInvariants(this);
   }
   bool IsImpreciseConstantHi() const override { return true; }
@@ -846,17 +742,6 @@
     return true;
   }
 
-  // Get the singleton Null instance.
-  static const NullType* GetInstance() PURE;
-
-  // Create the singleton instance.
-  static const NullType* CreateInstance(ObjPtr<mirror::Class> klass,
-                                        const std::string_view& descriptor,
-                                        uint16_t cache_id)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-
-  static void Destroy();
-
   std::string Dump() const override {
     return "null";
   }
@@ -869,14 +754,11 @@
     return true;
   }
 
- private:
-  NullType(ObjPtr<mirror::Class> klass, const std::string_view& descriptor, uint16_t cache_id)
+  NullType(Handle<mirror::Class> klass, const std::string_view& descriptor, uint16_t cache_id)
       REQUIRES_SHARED(Locks::mutator_lock_)
       : RegType(klass, descriptor, cache_id) {
     CheckConstructorInvariants(this);
   }
-
-  static const NullType* instance_;
 };
 
 // Common parent of all uninitialized types. Uninitialized types are created by
@@ -884,7 +766,7 @@
 // instructions and must be passed to a constructor.
 class UninitializedType : public RegType {
  public:
-  UninitializedType(ObjPtr<mirror::Class> klass,
+  UninitializedType(Handle<mirror::Class> klass,
                     const std::string_view& descriptor,
                     uint32_t allocation_pc,
                     uint16_t cache_id)
@@ -909,7 +791,7 @@
 // Similar to ReferenceType but not yet having been passed to a constructor.
 class UninitializedReferenceType final : public UninitializedType {
  public:
-  UninitializedReferenceType(ObjPtr<mirror::Class> klass,
+  UninitializedReferenceType(Handle<mirror::Class> klass,
                              const std::string_view& descriptor,
                              uint32_t allocation_pc,
                              uint16_t cache_id)
@@ -929,11 +811,12 @@
 // constructor.
 class UnresolvedUninitializedRefType final : public UninitializedType {
  public:
-  UnresolvedUninitializedRefType(const std::string_view& descriptor,
+  UnresolvedUninitializedRefType(Handle<mirror::Class> klass,
+                                 const std::string_view& descriptor,
                                  uint32_t allocation_pc,
                                  uint16_t cache_id)
       REQUIRES_SHARED(Locks::mutator_lock_)
-      : UninitializedType(nullptr, descriptor, allocation_pc, cache_id) {
+      : UninitializedType(klass, descriptor, allocation_pc, cache_id) {
     CheckConstructorInvariants(this);
   }
 
@@ -951,7 +834,7 @@
 // of a constructor.
 class UninitializedThisReferenceType final : public UninitializedType {
  public:
-  UninitializedThisReferenceType(ObjPtr<mirror::Class> klass,
+  UninitializedThisReferenceType(Handle<mirror::Class> klass,
                                  const std::string_view& descriptor,
                                  uint16_t cache_id)
       REQUIRES_SHARED(Locks::mutator_lock_)
@@ -971,9 +854,11 @@
 
 class UnresolvedUninitializedThisRefType final : public UninitializedType {
  public:
-  UnresolvedUninitializedThisRefType(const std::string_view& descriptor, uint16_t cache_id)
+  UnresolvedUninitializedThisRefType(Handle<mirror::Class> klass,
+                                     const std::string_view& descriptor,
+                                     uint16_t cache_id)
       REQUIRES_SHARED(Locks::mutator_lock_)
-      : UninitializedType(nullptr, descriptor, 0, cache_id) {
+      : UninitializedType(klass, descriptor, 0, cache_id) {
     CheckConstructorInvariants(this);
   }
 
@@ -991,7 +876,7 @@
 // sub-class.
 class ReferenceType final : public RegType {
  public:
-  ReferenceType(ObjPtr<mirror::Class> klass,
+  ReferenceType(Handle<mirror::Class> klass,
                 const std::string_view& descriptor,
                 uint16_t cache_id) REQUIRES_SHARED(Locks::mutator_lock_)
       : RegType(klass, descriptor, cache_id) {
@@ -1016,7 +901,7 @@
 // type.
 class PreciseReferenceType final : public RegType {
  public:
-  PreciseReferenceType(ObjPtr<mirror::Class> klass,
+  PreciseReferenceType(Handle<mirror::Class> klass,
                        const std::string_view& descriptor,
                        uint16_t cache_id)
       REQUIRES_SHARED(Locks::mutator_lock_);
@@ -1037,9 +922,11 @@
 // Common parent of unresolved types.
 class UnresolvedType : public RegType {
  public:
-  UnresolvedType(const std::string_view& descriptor, uint16_t cache_id)
+  UnresolvedType(Handle<mirror::Class> klass,
+                 const std::string_view& descriptor,
+                 uint16_t cache_id)
       REQUIRES_SHARED(Locks::mutator_lock_)
-      : RegType(nullptr, descriptor, cache_id) {}
+      : RegType(klass, descriptor, cache_id) {}
 
   bool IsNonZeroReferenceTypes() const override;
 
@@ -1053,9 +940,11 @@
 // of this type must be conservative.
 class UnresolvedReferenceType final : public UnresolvedType {
  public:
-  UnresolvedReferenceType(const std::string_view& descriptor, uint16_t cache_id)
+  UnresolvedReferenceType(Handle<mirror::Class> cls,
+                          const std::string_view& descriptor,
+                          uint16_t cache_id)
       REQUIRES_SHARED(Locks::mutator_lock_)
-      : UnresolvedType(descriptor, cache_id) {
+      : UnresolvedType(cls, descriptor, cache_id) {
     CheckConstructorInvariants(this);
   }
 
@@ -1072,10 +961,12 @@
 // Type representing the super-class of an unresolved type.
 class UnresolvedSuperClass final : public UnresolvedType {
  public:
-  UnresolvedSuperClass(uint16_t child_id, RegTypeCache* reg_type_cache,
+  UnresolvedSuperClass(Handle<mirror::Class> cls,
+                       uint16_t child_id,
+                       RegTypeCache* reg_type_cache,
                        uint16_t cache_id)
       REQUIRES_SHARED(Locks::mutator_lock_)
-      : UnresolvedType("", cache_id),
+      : UnresolvedType(cls, "", cache_id),
         unresolved_child_id_(child_id),
         reg_type_cache_(reg_type_cache) {
     CheckConstructorInvariants(this);
diff --git a/runtime/verifier/reg_type_cache-inl.h b/runtime/verifier/reg_type_cache-inl.h
index c5ff2b3..b619694 100644
--- a/runtime/verifier/reg_type_cache-inl.h
+++ b/runtime/verifier/reg_type_cache-inl.h
@@ -28,7 +28,7 @@
 #include "reg_type.h"
 #include "reg_type_cache.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace verifier {
 
 inline const art::verifier::RegType& RegTypeCache::GetFromId(uint16_t id) const {
@@ -42,49 +42,49 @@
   // We only expect 0 to be a precise constant.
   DCHECK_IMPLIES(value == 0, precise);
   if (precise && (value >= kMinSmallConstant) && (value <= kMaxSmallConstant)) {
-    return *small_precise_constants_[value - kMinSmallConstant];
+    return *down_cast<const ConstantType*>(entries_[value - kMinSmallConstant]);
   }
   return FromCat1NonSmallConstant(value, precise);
 }
 
 inline const BooleanType& RegTypeCache::Boolean() {
-  return *BooleanType::GetInstance();
+  return *down_cast<const BooleanType*>(entries_[kBooleanCacheId]);
 }
 inline const ByteType& RegTypeCache::Byte() {
-  return *ByteType::GetInstance();
+  return *down_cast<const ByteType*>(entries_[kByteCacheId]);
 }
 inline const CharType& RegTypeCache::Char() {
-  return *CharType::GetInstance();
+  return *down_cast<const CharType*>(entries_[kCharCacheId]);
 }
 inline const ShortType& RegTypeCache::Short() {
-  return *ShortType::GetInstance();
+  return *down_cast<const ShortType*>(entries_[kShortCacheId]);
 }
 inline const IntegerType& RegTypeCache::Integer() {
-  return *IntegerType::GetInstance();
+  return *down_cast<const IntegerType*>(entries_[kIntCacheId]);
 }
 inline const FloatType& RegTypeCache::Float() {
-  return *FloatType::GetInstance();
+  return *down_cast<const FloatType*>(entries_[kFloatCacheId]);
 }
 inline const LongLoType& RegTypeCache::LongLo() {
-  return *LongLoType::GetInstance();
+  return *down_cast<const LongLoType*>(entries_[kLongLoCacheId]);
 }
 inline const LongHiType& RegTypeCache::LongHi() {
-  return *LongHiType::GetInstance();
+  return *down_cast<const LongHiType*>(entries_[kLongHiCacheId]);
 }
 inline const DoubleLoType& RegTypeCache::DoubleLo() {
-  return *DoubleLoType::GetInstance();
+  return *down_cast<const DoubleLoType*>(entries_[kDoubleLoCacheId]);
 }
 inline const DoubleHiType& RegTypeCache::DoubleHi() {
-  return *DoubleHiType::GetInstance();
+  return *down_cast<const DoubleHiType*>(entries_[kDoubleHiCacheId]);
 }
 inline const UndefinedType& RegTypeCache::Undefined() {
-  return *UndefinedType::GetInstance();
+  return *down_cast<const UndefinedType*>(entries_[kUndefinedCacheId]);
 }
 inline const ConflictType& RegTypeCache::Conflict() {
-  return *ConflictType::GetInstance();
+  return *down_cast<const ConflictType*>(entries_[kConflictCacheId]);
 }
 inline const NullType& RegTypeCache::Null() {
-  return *NullType::GetInstance();
+  return *down_cast<const NullType*>(entries_[kNullCacheId]);
 }
 
 inline const ImpreciseConstType& RegTypeCache::ByteConstant() {
@@ -186,9 +186,9 @@
   DCHECK(new_entry != nullptr);
   entries_.push_back(new_entry);
   if (new_entry->HasClass()) {
-    ObjPtr<mirror::Class> klass = new_entry->GetClass();
+    Handle<mirror::Class> klass = new_entry->GetClassHandle();
     DCHECK(!klass->IsPrimitive());
-    klass_entries_.push_back(std::make_pair(GcRoot<mirror::Class>(klass), new_entry));
+    klass_entries_.push_back(std::make_pair(klass, new_entry));
   }
   return *new_entry;
 }
diff --git a/runtime/verifier/reg_type_cache.cc b/runtime/verifier/reg_type_cache.cc
index 0bba6e8..e57290c 100644
--- a/runtime/verifier/reg_type_cache.cc
+++ b/runtime/verifier/reg_type_cache.cc
@@ -25,26 +25,16 @@
 #include "base/scoped_arena_allocator.h"
 #include "base/stl_util.h"
 #include "class_linker-inl.h"
+#include "class_root-inl.h"
 #include "dex/descriptors_names.h"
 #include "dex/dex_file-inl.h"
 #include "mirror/class-inl.h"
 #include "mirror/object-inl.h"
 #include "reg_type-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace verifier {
 
-bool RegTypeCache::primitive_initialized_ = false;
-uint16_t RegTypeCache::primitive_count_ = 0;
-const PreciseConstType* RegTypeCache::small_precise_constants_[kMaxSmallConstant -
-                                                               kMinSmallConstant + 1];
-
-namespace {
-
-ClassLinker* gInitClassLinker = nullptr;
-
-}  // namespace
-
 ALWAYS_INLINE static inline bool MatchingPrecisionForClass(const RegType* entry, bool precise)
     REQUIRES_SHARED(Locks::mutator_lock_) {
   if (entry->IsPreciseReference() == precise) {
@@ -61,32 +51,42 @@
 }
 
 void RegTypeCache::FillPrimitiveAndSmallConstantTypes() {
-  // Note: this must have the same order as CreatePrimitiveAndSmallConstantTypes.
-  entries_.push_back(UndefinedType::GetInstance());
-  entries_.push_back(ConflictType::GetInstance());
-  entries_.push_back(NullType::GetInstance());
-  entries_.push_back(BooleanType::GetInstance());
-  entries_.push_back(ByteType::GetInstance());
-  entries_.push_back(ShortType::GetInstance());
-  entries_.push_back(CharType::GetInstance());
-  entries_.push_back(IntegerType::GetInstance());
-  entries_.push_back(LongLoType::GetInstance());
-  entries_.push_back(LongHiType::GetInstance());
-  entries_.push_back(FloatType::GetInstance());
-  entries_.push_back(DoubleLoType::GetInstance());
-  entries_.push_back(DoubleHiType::GetInstance());
+  entries_.resize(kNumPrimitivesAndSmallConstants);
   for (int32_t value = kMinSmallConstant; value <= kMaxSmallConstant; ++value) {
     int32_t i = value - kMinSmallConstant;
-    DCHECK_EQ(entries_.size(), small_precise_constants_[i]->GetId());
-    entries_.push_back(small_precise_constants_[i]);
+    entries_[i] = new (&allocator_) PreciseConstType(null_handle_, value, i);
   }
-  DCHECK_EQ(entries_.size(), primitive_count_);
+
+#define CREATE_PRIMITIVE_TYPE(type, class_root, descriptor, id) \
+  entries_[id] = new (&allocator_) type( \
+        handles_.NewHandle(GetClassRoot(class_root, class_linker_)), \
+        descriptor, \
+        id); \
+
+  CREATE_PRIMITIVE_TYPE(BooleanType, ClassRoot::kPrimitiveBoolean, "Z", kBooleanCacheId);
+  CREATE_PRIMITIVE_TYPE(ByteType, ClassRoot::kPrimitiveByte, "B", kByteCacheId);
+  CREATE_PRIMITIVE_TYPE(ShortType, ClassRoot::kPrimitiveShort, "S", kShortCacheId);
+  CREATE_PRIMITIVE_TYPE(CharType, ClassRoot::kPrimitiveChar, "C", kCharCacheId);
+  CREATE_PRIMITIVE_TYPE(IntegerType, ClassRoot::kPrimitiveInt, "I", kIntCacheId);
+  CREATE_PRIMITIVE_TYPE(LongLoType, ClassRoot::kPrimitiveLong, "J", kLongLoCacheId);
+  CREATE_PRIMITIVE_TYPE(LongHiType, ClassRoot::kPrimitiveLong, "J", kLongHiCacheId);
+  CREATE_PRIMITIVE_TYPE(FloatType, ClassRoot::kPrimitiveFloat, "F", kFloatCacheId);
+  CREATE_PRIMITIVE_TYPE(DoubleLoType, ClassRoot::kPrimitiveDouble, "D", kDoubleLoCacheId);
+  CREATE_PRIMITIVE_TYPE(DoubleHiType, ClassRoot::kPrimitiveDouble, "D", kDoubleHiCacheId);
+
+#undef CREATE_PRIMITIVE_TYPE
+
+  entries_[kUndefinedCacheId] =
+      new (&allocator_) UndefinedType(null_handle_, "", kUndefinedCacheId);
+  entries_[kConflictCacheId] =
+      new (&allocator_) ConflictType(null_handle_, "", kConflictCacheId);
+  entries_[kNullCacheId] =
+      new (&allocator_) NullType(null_handle_, "", kNullCacheId);
 }
 
 const RegType& RegTypeCache::FromDescriptor(ObjPtr<mirror::ClassLoader> loader,
                                             const char* descriptor,
                                             bool precise) {
-  DCHECK(RegTypeCache::primitive_initialized_);
   if (descriptor[1] == '\0') {
     switch (descriptor[0]) {
       case 'Z':
@@ -116,28 +116,28 @@
   }
 }
 
+
 const RegType& RegTypeCache::RegTypeFromPrimitiveType(Primitive::Type prim_type) const {
-  DCHECK(RegTypeCache::primitive_initialized_);
   switch (prim_type) {
     case Primitive::kPrimBoolean:
-      return *BooleanType::GetInstance();
+      return *entries_[kBooleanCacheId];
     case Primitive::kPrimByte:
-      return *ByteType::GetInstance();
+      return *entries_[kByteCacheId];
     case Primitive::kPrimShort:
-      return *ShortType::GetInstance();
+      return *entries_[kShortCacheId];
     case Primitive::kPrimChar:
-      return *CharType::GetInstance();
+      return *entries_[kCharCacheId];
     case Primitive::kPrimInt:
-      return *IntegerType::GetInstance();
+      return *entries_[kIntCacheId];
     case Primitive::kPrimLong:
-      return *LongLoType::GetInstance();
+      return *entries_[kLongLoCacheId];
     case Primitive::kPrimFloat:
-      return *FloatType::GetInstance();
+      return *entries_[kFloatCacheId];
     case Primitive::kPrimDouble:
-      return *DoubleLoType::GetInstance();
+      return *entries_[kDoubleLoCacheId];
     case Primitive::kPrimVoid:
     default:
-      return *ConflictType::GetInstance();
+      return *entries_[kConflictCacheId];
   }
 }
 
@@ -187,7 +187,7 @@
   std::string_view sv_descriptor(descriptor);
   // Try looking up the class in the cache first. We use a std::string_view to avoid
   // repeated strlen operations on the descriptor.
-  for (size_t i = primitive_count_; i < entries_.size(); i++) {
+  for (size_t i = kNumPrimitivesAndSmallConstants; i < entries_.size(); i++) {
     if (MatchDescriptor(i, sv_descriptor, precise)) {
       return *(entries_[i]);
     }
@@ -209,10 +209,13 @@
     if (klass->CannotBeAssignedFromOtherTypes() || precise) {
       DCHECK_IMPLIES(klass->IsAbstract(), klass->IsArrayClass());
       DCHECK(!klass->IsInterface());
-      entry =
-          new (&allocator_) PreciseReferenceType(klass, AddString(sv_descriptor), entries_.size());
+      entry = new (&allocator_) PreciseReferenceType(handles_.NewHandle(klass),
+                                                     AddString(sv_descriptor),
+                                                     entries_.size());
     } else {
-      entry = new (&allocator_) ReferenceType(klass, AddString(sv_descriptor), entries_.size());
+      entry = new (&allocator_) ReferenceType(handles_.NewHandle(klass),
+                                              AddString(sv_descriptor),
+                                              entries_.size());
     }
     return AddEntry(entry);
   } else {  // Class not resolved.
@@ -225,8 +228,9 @@
       DCHECK(!Thread::Current()->IsExceptionPending());
     }
     if (IsValidDescriptor(descriptor)) {
-      return AddEntry(
-          new (&allocator_) UnresolvedReferenceType(AddString(sv_descriptor), entries_.size()));
+      return AddEntry(new (&allocator_) UnresolvedReferenceType(null_handle_,
+                                                                AddString(sv_descriptor),
+                                                                entries_.size()));
     } else {
       // The descriptor is broken return the unknown type as there's nothing sensible that
       // could be done at runtime
@@ -237,7 +241,8 @@
 
 const RegType& RegTypeCache::MakeUnresolvedReference() {
   // The descriptor is intentionally invalid so nothing else will match this type.
-  return AddEntry(new (&allocator_) UnresolvedReferenceType(AddString("a"), entries_.size()));
+  return AddEntry(new (&allocator_) UnresolvedReferenceType(
+      null_handle_, AddString("a"), entries_.size()));
 }
 
 const RegType* RegTypeCache::FindClass(ObjPtr<mirror::Class> klass, bool precise) const {
@@ -248,8 +253,8 @@
     return &RegTypeFromPrimitiveType(klass->GetPrimitiveType());
   }
   for (auto& pair : klass_entries_) {
-    const ObjPtr<mirror::Class> reg_klass = pair.first.Read();
-    if (reg_klass == klass) {
+    const Handle<mirror::Class> reg_klass = pair.first;
+    if (reg_klass.Get() == klass) {
       const RegType* reg_type = pair.second;
       if (MatchingPrecisionForClass(reg_type, precise)) {
         return reg_type;
@@ -266,8 +271,10 @@
   DCHECK(FindClass(klass, precise) == nullptr);
   RegType* const reg_type = precise
       ? static_cast<RegType*>(
-          new (&allocator_) PreciseReferenceType(klass, descriptor, entries_.size()))
-      : new (&allocator_) ReferenceType(klass, descriptor, entries_.size());
+          new (&allocator_) PreciseReferenceType(handles_.NewHandle(klass),
+                                                 descriptor,
+                                                 entries_.size()))
+      : new (&allocator_) ReferenceType(handles_.NewHandle(klass), descriptor, entries_.size());
   return &AddEntry(reg_type);
 }
 
@@ -285,13 +292,14 @@
 RegTypeCache::RegTypeCache(ClassLinker* class_linker,
                            bool can_load_classes,
                            ScopedArenaAllocator& allocator,
+                           VariableSizedHandleScope& handles,
                            bool can_suspend)
     : entries_(allocator.Adapter(kArenaAllocVerifier)),
       klass_entries_(allocator.Adapter(kArenaAllocVerifier)),
       allocator_(allocator),
+      handles_(handles),
       class_linker_(class_linker),
       can_load_classes_(can_load_classes) {
-  DCHECK_EQ(class_linker, gInitClassLinker);
   DCHECK(can_suspend || !can_load_classes) << "Cannot load classes if suspension is disabled!";
   if (kIsDebugBuild && can_suspend) {
     Thread::Current()->AssertThreadSuspensionIsAllowable(gAborting == 0);
@@ -305,92 +313,6 @@
   FillPrimitiveAndSmallConstantTypes();
 }
 
-RegTypeCache::~RegTypeCache() {
-  DCHECK_LE(primitive_count_, entries_.size());
-}
-
-void RegTypeCache::ShutDown() {
-  if (RegTypeCache::primitive_initialized_) {
-    UndefinedType::Destroy();
-    ConflictType::Destroy();
-    BooleanType::Destroy();
-    ByteType::Destroy();
-    ShortType::Destroy();
-    CharType::Destroy();
-    IntegerType::Destroy();
-    LongLoType::Destroy();
-    LongHiType::Destroy();
-    FloatType::Destroy();
-    DoubleLoType::Destroy();
-    DoubleHiType::Destroy();
-    NullType::Destroy();
-    for (int32_t value = kMinSmallConstant; value <= kMaxSmallConstant; ++value) {
-      const PreciseConstType* type = small_precise_constants_[value - kMinSmallConstant];
-      delete type;
-      small_precise_constants_[value - kMinSmallConstant] = nullptr;
-    }
-    RegTypeCache::primitive_initialized_ = false;
-    RegTypeCache::primitive_count_ = 0;
-  }
-}
-
-// Helper for create_primitive_type_instance lambda.
-namespace {
-template <typename T>
-struct TypeHelper {
-  using type = T;
-  static_assert(std::is_convertible<T*, RegType*>::value, "T must be a RegType");
-
-  const char* descriptor;
-
-  explicit TypeHelper(const char* d) : descriptor(d) {}
-};
-}  // namespace
-
-void RegTypeCache::CreatePrimitiveAndSmallConstantTypes(ClassLinker* class_linker) {
-  gInitClassLinker = class_linker;
-
-  // Note: this must have the same order as FillPrimitiveAndSmallConstantTypes.
-
-  // It is acceptable to pass on the const char* in type to CreateInstance, as all calls below are
-  // with compile-time constants that will have global lifetime. Use of the lambda ensures this
-  // code cannot leak to other users.
-  auto create_primitive_type_instance = [&](auto type) REQUIRES_SHARED(Locks::mutator_lock_) {
-    using Type = typename decltype(type)::type;
-    ObjPtr<mirror::Class> klass = nullptr;
-    // Try loading the class from linker.
-    DCHECK(type.descriptor != nullptr);
-    if (strlen(type.descriptor) > 0) {
-      klass = class_linker->FindSystemClass(Thread::Current(), type.descriptor);
-      DCHECK(klass != nullptr);
-    }
-    const Type* entry = Type::CreateInstance(klass,
-                                             type.descriptor,
-                                             RegTypeCache::primitive_count_);
-    RegTypeCache::primitive_count_++;
-    return entry;
-  };
-  create_primitive_type_instance(TypeHelper<UndefinedType>(""));
-  create_primitive_type_instance(TypeHelper<ConflictType>(""));
-  create_primitive_type_instance(TypeHelper<NullType>(""));
-  create_primitive_type_instance(TypeHelper<BooleanType>("Z"));
-  create_primitive_type_instance(TypeHelper<ByteType>("B"));
-  create_primitive_type_instance(TypeHelper<ShortType>("S"));
-  create_primitive_type_instance(TypeHelper<CharType>("C"));
-  create_primitive_type_instance(TypeHelper<IntegerType>("I"));
-  create_primitive_type_instance(TypeHelper<LongLoType>("J"));
-  create_primitive_type_instance(TypeHelper<LongHiType>("J"));
-  create_primitive_type_instance(TypeHelper<FloatType>("F"));
-  create_primitive_type_instance(TypeHelper<DoubleLoType>("D"));
-  create_primitive_type_instance(TypeHelper<DoubleHiType>("D"));
-
-  for (int32_t value = kMinSmallConstant; value <= kMaxSmallConstant; ++value) {
-    PreciseConstType* type = new PreciseConstType(value, primitive_count_);
-    small_precise_constants_[value - kMinSmallConstant] = type;
-    primitive_count_++;
-  }
-}
-
 const RegType& RegTypeCache::FromUnresolvedMerge(const RegType& left,
                                                  const RegType& right,
                                                  MethodVerifier* verifier) {
@@ -461,7 +383,7 @@
   }
 
   // Check if entry already exists.
-  for (size_t i = primitive_count_; i < entries_.size(); i++) {
+  for (size_t i = kNumPrimitivesAndSmallConstants; i < entries_.size(); i++) {
     const RegType* cur_entry = entries_[i];
     if (cur_entry->IsUnresolvedMergedReference()) {
       const UnresolvedMergedType* cmp_type = down_cast<const UnresolvedMergedType*>(cur_entry);
@@ -482,7 +404,7 @@
 
 const RegType& RegTypeCache::FromUnresolvedSuperClass(const RegType& child) {
   // Check if entry already exists.
-  for (size_t i = primitive_count_; i < entries_.size(); i++) {
+  for (size_t i = kNumPrimitivesAndSmallConstants; i < entries_.size(); i++) {
     const RegType* cur_entry = entries_[i];
     if (cur_entry->IsUnresolvedSuperClass()) {
       const UnresolvedSuperClass* tmp_entry =
@@ -494,14 +416,15 @@
       }
     }
   }
-  return AddEntry(new (&allocator_) UnresolvedSuperClass(child.GetId(), this, entries_.size()));
+  return AddEntry(new (&allocator_) UnresolvedSuperClass(
+      null_handle_, child.GetId(), this, entries_.size()));
 }
 
 const UninitializedType& RegTypeCache::Uninitialized(const RegType& type, uint32_t allocation_pc) {
   UninitializedType* entry = nullptr;
   const std::string_view& descriptor(type.GetDescriptor());
   if (type.IsUnresolvedTypes()) {
-    for (size_t i = primitive_count_; i < entries_.size(); i++) {
+    for (size_t i = kNumPrimitivesAndSmallConstants; i < entries_.size(); i++) {
       const RegType* cur_entry = entries_[i];
       if (cur_entry->IsUnresolvedAndUninitializedReference() &&
           down_cast<const UnresolvedUninitializedRefType*>(cur_entry)->GetAllocationPc()
@@ -510,12 +433,13 @@
         return *down_cast<const UnresolvedUninitializedRefType*>(cur_entry);
       }
     }
-    entry = new (&allocator_) UnresolvedUninitializedRefType(descriptor,
+    entry = new (&allocator_) UnresolvedUninitializedRefType(null_handle_,
+                                                             descriptor,
                                                              allocation_pc,
                                                              entries_.size());
   } else {
     ObjPtr<mirror::Class> klass = type.GetClass();
-    for (size_t i = primitive_count_; i < entries_.size(); i++) {
+    for (size_t i = kNumPrimitivesAndSmallConstants; i < entries_.size(); i++) {
       const RegType* cur_entry = entries_[i];
       if (cur_entry->IsUninitializedReference() &&
           down_cast<const UninitializedReferenceType*>(cur_entry)
@@ -524,7 +448,7 @@
         return *down_cast<const UninitializedReferenceType*>(cur_entry);
       }
     }
-    entry = new (&allocator_) UninitializedReferenceType(klass,
+    entry = new (&allocator_) UninitializedReferenceType(handles_.NewHandle(klass),
                                                          descriptor,
                                                          allocation_pc,
                                                          entries_.size());
@@ -537,25 +461,25 @@
 
   if (uninit_type.IsUnresolvedTypes()) {
     const std::string_view& descriptor(uninit_type.GetDescriptor());
-    for (size_t i = primitive_count_; i < entries_.size(); i++) {
+    for (size_t i = kNumPrimitivesAndSmallConstants; i < entries_.size(); i++) {
       const RegType* cur_entry = entries_[i];
       if (cur_entry->IsUnresolvedReference() &&
           cur_entry->GetDescriptor() == descriptor) {
         return *cur_entry;
       }
     }
-    entry = new (&allocator_) UnresolvedReferenceType(descriptor, entries_.size());
+    entry = new (&allocator_) UnresolvedReferenceType(null_handle_, descriptor, entries_.size());
   } else {
     ObjPtr<mirror::Class> klass = uninit_type.GetClass();
     if (uninit_type.IsUninitializedThisReference() && !klass->IsFinal()) {
       // For uninitialized "this reference" look for reference types that are not precise.
-      for (size_t i = primitive_count_; i < entries_.size(); i++) {
+      for (size_t i = kNumPrimitivesAndSmallConstants; i < entries_.size(); i++) {
         const RegType* cur_entry = entries_[i];
         if (cur_entry->IsReference() && cur_entry->GetClass() == klass) {
           return *cur_entry;
         }
       }
-      entry = new (&allocator_) ReferenceType(klass, "", entries_.size());
+      entry = new (&allocator_) ReferenceType(handles_.NewHandle(klass), "", entries_.size());
     } else if (!klass->IsPrimitive()) {
       // We're uninitialized because of allocation, look or create a precise type as allocations
       // may only create objects of that type.
@@ -568,13 +492,13 @@
       //       2) Checking whether the klass is instantiable and using conflict may produce a hard
       //          error when the value is used, which leads to a VerifyError, which is not the
       //          correct semantics.
-      for (size_t i = primitive_count_; i < entries_.size(); i++) {
+      for (size_t i = kNumPrimitivesAndSmallConstants; i < entries_.size(); i++) {
         const RegType* cur_entry = entries_[i];
         if (cur_entry->IsPreciseReference() && cur_entry->GetClass() == klass) {
           return *cur_entry;
         }
       }
-      entry = new (&allocator_) PreciseReferenceType(klass,
+      entry = new (&allocator_) PreciseReferenceType(handles_.NewHandle(klass),
                                                      uninit_type.GetDescriptor(),
                                                      entries_.size());
     } else {
@@ -588,31 +512,34 @@
   UninitializedType* entry;
   const std::string_view& descriptor(type.GetDescriptor());
   if (type.IsUnresolvedTypes()) {
-    for (size_t i = primitive_count_; i < entries_.size(); i++) {
+    for (size_t i = kNumPrimitivesAndSmallConstants; i < entries_.size(); i++) {
       const RegType* cur_entry = entries_[i];
       if (cur_entry->IsUnresolvedAndUninitializedThisReference() &&
           cur_entry->GetDescriptor() == descriptor) {
         return *down_cast<const UninitializedType*>(cur_entry);
       }
     }
-    entry = new (&allocator_) UnresolvedUninitializedThisRefType(descriptor, entries_.size());
+    entry = new (&allocator_) UnresolvedUninitializedThisRefType(
+        null_handle_, descriptor, entries_.size());
   } else {
     ObjPtr<mirror::Class> klass = type.GetClass();
-    for (size_t i = primitive_count_; i < entries_.size(); i++) {
+    for (size_t i = kNumPrimitivesAndSmallConstants; i < entries_.size(); i++) {
       const RegType* cur_entry = entries_[i];
       if (cur_entry->IsUninitializedThisReference() && cur_entry->GetClass() == klass) {
         return *down_cast<const UninitializedType*>(cur_entry);
       }
     }
-    entry = new (&allocator_) UninitializedThisReferenceType(klass, descriptor, entries_.size());
+    entry = new (&allocator_) UninitializedThisReferenceType(handles_.NewHandle(klass),
+                                                             descriptor,
+                                                             entries_.size());
   }
   return AddEntry(entry);
 }
 
 const ConstantType& RegTypeCache::FromCat1NonSmallConstant(int32_t value, bool precise) {
-  for (size_t i = primitive_count_; i < entries_.size(); i++) {
+  for (size_t i = kNumPrimitivesAndSmallConstants; i < entries_.size(); i++) {
     const RegType* cur_entry = entries_[i];
-    if (cur_entry->klass_.IsNull() && cur_entry->IsConstant() &&
+    if (!cur_entry->HasClass() && cur_entry->IsConstant() &&
         cur_entry->IsPreciseConstant() == precise &&
         (down_cast<const ConstantType*>(cur_entry))->ConstantValue() == value) {
       return *down_cast<const ConstantType*>(cur_entry);
@@ -620,15 +547,15 @@
   }
   ConstantType* entry;
   if (precise) {
-    entry = new (&allocator_) PreciseConstType(value, entries_.size());
+    entry = new (&allocator_) PreciseConstType(null_handle_, value, entries_.size());
   } else {
-    entry = new (&allocator_) ImpreciseConstType(value, entries_.size());
+    entry = new (&allocator_) ImpreciseConstType(null_handle_, value, entries_.size());
   }
   return AddEntry(entry);
 }
 
 const ConstantType& RegTypeCache::FromCat2ConstLo(int32_t value, bool precise) {
-  for (size_t i = primitive_count_; i < entries_.size(); i++) {
+  for (size_t i = kNumPrimitivesAndSmallConstants; i < entries_.size(); i++) {
     const RegType* cur_entry = entries_[i];
     if (cur_entry->IsConstantLo() && (cur_entry->IsPrecise() == precise) &&
         (down_cast<const ConstantType*>(cur_entry))->ConstantValueLo() == value) {
@@ -637,15 +564,15 @@
   }
   ConstantType* entry;
   if (precise) {
-    entry = new (&allocator_) PreciseConstLoType(value, entries_.size());
+    entry = new (&allocator_) PreciseConstLoType(null_handle_, value, entries_.size());
   } else {
-    entry = new (&allocator_) ImpreciseConstLoType(value, entries_.size());
+    entry = new (&allocator_) ImpreciseConstLoType(null_handle_, value, entries_.size());
   }
   return AddEntry(entry);
 }
 
 const ConstantType& RegTypeCache::FromCat2ConstHi(int32_t value, bool precise) {
-  for (size_t i = primitive_count_; i < entries_.size(); i++) {
+  for (size_t i = kNumPrimitivesAndSmallConstants; i < entries_.size(); i++) {
     const RegType* cur_entry = entries_[i];
     if (cur_entry->IsConstantHi() && (cur_entry->IsPrecise() == precise) &&
         (down_cast<const ConstantType*>(cur_entry))->ConstantValueHi() == value) {
@@ -654,9 +581,9 @@
   }
   ConstantType* entry;
   if (precise) {
-    entry = new (&allocator_) PreciseConstHiType(value, entries_.size());
+    entry = new (&allocator_) PreciseConstHiType(null_handle_, value, entries_.size());
   } else {
-    entry = new (&allocator_) ImpreciseConstHiType(value, entries_.size());
+    entry = new (&allocator_) ImpreciseConstHiType(null_handle_, value, entries_.size());
   }
   return AddEntry(entry);
 }
@@ -693,39 +620,5 @@
   }
 }
 
-void RegTypeCache::VisitStaticRoots(RootVisitor* visitor) {
-  // Visit the primitive types, this is required since if there are no active verifiers they wont
-  // be in the entries array, and therefore not visited as roots.
-  if (primitive_initialized_) {
-    RootInfo ri(kRootUnknown);
-    UndefinedType::GetInstance()->VisitRoots(visitor, ri);
-    ConflictType::GetInstance()->VisitRoots(visitor, ri);
-    BooleanType::GetInstance()->VisitRoots(visitor, ri);
-    ByteType::GetInstance()->VisitRoots(visitor, ri);
-    ShortType::GetInstance()->VisitRoots(visitor, ri);
-    CharType::GetInstance()->VisitRoots(visitor, ri);
-    IntegerType::GetInstance()->VisitRoots(visitor, ri);
-    LongLoType::GetInstance()->VisitRoots(visitor, ri);
-    LongHiType::GetInstance()->VisitRoots(visitor, ri);
-    FloatType::GetInstance()->VisitRoots(visitor, ri);
-    DoubleLoType::GetInstance()->VisitRoots(visitor, ri);
-    DoubleHiType::GetInstance()->VisitRoots(visitor, ri);
-    for (int32_t value = kMinSmallConstant; value <= kMaxSmallConstant; ++value) {
-      small_precise_constants_[value - kMinSmallConstant]->VisitRoots(visitor, ri);
-    }
-  }
-}
-
-void RegTypeCache::VisitRoots(RootVisitor* visitor, const RootInfo& root_info) {
-  // Exclude the static roots that are visited by VisitStaticRoots().
-  for (size_t i = primitive_count_; i < entries_.size(); ++i) {
-    entries_[i]->VisitRoots(visitor, root_info);
-  }
-  for (auto& pair : klass_entries_) {
-    GcRoot<mirror::Class>& root = pair.first;
-    root.VisitRoot(visitor, root_info);
-  }
-}
-
 }  // namespace verifier
 }  // namespace art
diff --git a/runtime/verifier/reg_type_cache.h b/runtime/verifier/reg_type_cache.h
index a6d226a..ae8b904 100644
--- a/runtime/verifier/reg_type_cache.h
+++ b/runtime/verifier/reg_type_cache.h
@@ -26,8 +26,9 @@
 #include "base/scoped_arena_containers.h"
 #include "dex/primitive.h"
 #include "gc_root.h"
+#include "handle_scope.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Class;
@@ -68,17 +69,8 @@
   RegTypeCache(ClassLinker* class_linker,
                bool can_load_classes,
                ScopedArenaAllocator& allocator,
+               VariableSizedHandleScope& handles,
                bool can_suspend = true);
-  ~RegTypeCache();
-  static void Init(ClassLinker* class_linker) REQUIRES_SHARED(Locks::mutator_lock_) {
-    if (!RegTypeCache::primitive_initialized_) {
-      CHECK_EQ(RegTypeCache::primitive_count_, 0);
-      CreatePrimitiveAndSmallConstantTypes(class_linker);
-      CHECK_EQ(RegTypeCache::primitive_count_, kNumPrimitivesAndSmallConstants);
-      RegTypeCache::primitive_initialized_ = true;
-    }
-  }
-  static void ShutDown();
   const art::verifier::RegType& GetFromId(uint16_t id) const;
   const RegType& From(ObjPtr<mirror::ClassLoader> loader, const char* descriptor, bool precise)
       REQUIRES_SHARED(Locks::mutator_lock_);
@@ -161,15 +153,32 @@
   void Dump(std::ostream& os) REQUIRES_SHARED(Locks::mutator_lock_);
   const RegType& RegTypeFromPrimitiveType(Primitive::Type) const;
 
-  void VisitRoots(RootVisitor* visitor, const RootInfo& root_info)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-  static void VisitStaticRoots(RootVisitor* visitor)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-
   ClassLinker* GetClassLinker() {
     return class_linker_;
   }
 
+  Handle<mirror::Class> GetNullHandle() const {
+    return null_handle_;
+  }
+
+  static constexpr int32_t kMinSmallConstant = -1;
+  static constexpr int32_t kMaxSmallConstant = 4;
+  static constexpr int32_t kNumSmallConstants = kMaxSmallConstant - kMinSmallConstant + 1;
+  static constexpr size_t kNumPrimitivesAndSmallConstants = 13 + kNumSmallConstants;
+  static constexpr int32_t kBooleanCacheId = kNumSmallConstants;
+  static constexpr int32_t kByteCacheId = kNumSmallConstants + 1;
+  static constexpr int32_t kShortCacheId = kNumSmallConstants + 2;
+  static constexpr int32_t kCharCacheId = kNumSmallConstants + 3;
+  static constexpr int32_t kIntCacheId = kNumSmallConstants + 4;
+  static constexpr int32_t kLongLoCacheId = kNumSmallConstants + 5;
+  static constexpr int32_t kLongHiCacheId = kNumSmallConstants + 6;
+  static constexpr int32_t kFloatCacheId = kNumSmallConstants + 7;
+  static constexpr int32_t kDoubleLoCacheId = kNumSmallConstants + 8;
+  static constexpr int32_t kDoubleHiCacheId = kNumSmallConstants + 9;
+  static constexpr int32_t kUndefinedCacheId = kNumSmallConstants + 10;
+  static constexpr int32_t kConflictCacheId = kNumSmallConstants + 11;
+  static constexpr int32_t kNullCacheId = kNumSmallConstants + 12;
+
  private:
   void FillPrimitiveAndSmallConstantTypes() REQUIRES_SHARED(Locks::mutator_lock_);
   ObjPtr<mirror::Class> ResolveClass(const char* descriptor, ObjPtr<mirror::ClassLoader> loader)
@@ -187,33 +196,19 @@
   // verifier and return a string view.
   std::string_view AddString(const std::string_view& str);
 
-  static void CreatePrimitiveAndSmallConstantTypes(ClassLinker* class_linker)
-      REQUIRES_SHARED(Locks::mutator_lock_);
-
-  // A quick look up for popular small constants.
-  static constexpr int32_t kMinSmallConstant = -1;
-  static constexpr int32_t kMaxSmallConstant = 4;
-  static const PreciseConstType* small_precise_constants_[kMaxSmallConstant -
-                                                          kMinSmallConstant + 1];
-
-  static constexpr size_t kNumPrimitivesAndSmallConstants =
-      13 + (kMaxSmallConstant - kMinSmallConstant + 1);
-
-  // Have the well known global primitives been created?
-  static bool primitive_initialized_;
-
-  // Number of well known primitives that will be copied into a RegTypeCache upon construction.
-  static uint16_t primitive_count_;
-
   // The actual storage for the RegTypes.
   ScopedArenaVector<const RegType*> entries_;
 
   // Fast lookup for quickly finding entries that have a matching class.
-  ScopedArenaVector<std::pair<GcRoot<mirror::Class>, const RegType*>> klass_entries_;
+  ScopedArenaVector<std::pair<Handle<mirror::Class>, const RegType*>> klass_entries_;
 
   // Arena allocator.
   ScopedArenaAllocator& allocator_;
 
+  // Handle scope containing classes.
+  VariableSizedHandleScope& handles_;
+  ScopedNullHandle<mirror::Class> null_handle_;
+
   ClassLinker* class_linker_;
 
   // Whether or not we're allowed to load classes.
diff --git a/runtime/verifier/reg_type_test.cc b/runtime/verifier/reg_type_test.cc
index a36cf71..ec4c23e 100644
--- a/runtime/verifier/reg_type_test.cc
+++ b/runtime/verifier/reg_type_test.cc
@@ -28,7 +28,7 @@
 #include "scoped_thread_state_change-inl.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace verifier {
 
 class RegTypeTest : public CommonRuntimeTest {
@@ -43,7 +43,9 @@
   ArenaStack stack(Runtime::Current()->GetArenaPool());
   ScopedArenaAllocator allocator(&stack);
   ScopedObjectAccess soa(Thread::Current());
-  RegTypeCache cache(Runtime::Current()->GetClassLinker(), true, allocator);
+  VariableSizedHandleScope handles(soa.Self());
+  RegTypeCache cache(
+      Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
   const RegType& ref_type_const_0 = cache.FromCat1Const(10, true);
   const RegType& ref_type_const_1 = cache.FromCat1Const(10, true);
   const RegType& ref_type_const_2 = cache.FromCat1Const(30, true);
@@ -67,7 +69,9 @@
   ArenaStack stack(Runtime::Current()->GetArenaPool());
   ScopedArenaAllocator allocator(&stack);
   ScopedObjectAccess soa(Thread::Current());
-  RegTypeCache cache(Runtime::Current()->GetClassLinker(), true, allocator);
+  VariableSizedHandleScope handles(soa.Self());
+  RegTypeCache cache(
+      Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
   int64_t val = static_cast<int32_t>(1234);
   const RegType& precise_lo = cache.FromCat2ConstLo(static_cast<int32_t>(val), true);
   const RegType& precise_hi = cache.FromCat2ConstHi(static_cast<int32_t>(val >> 32), true);
@@ -93,7 +97,9 @@
   ArenaStack stack(Runtime::Current()->GetArenaPool());
   ScopedArenaAllocator allocator(&stack);
   ScopedObjectAccess soa(Thread::Current());
-  RegTypeCache cache(Runtime::Current()->GetClassLinker(), true, allocator);
+  VariableSizedHandleScope handles(soa.Self());
+  RegTypeCache cache(
+      Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
 
   const RegType& bool_reg_type = cache.Boolean();
   EXPECT_FALSE(bool_reg_type.IsUndefined());
@@ -368,7 +374,9 @@
   ArenaStack stack(Runtime::Current()->GetArenaPool());
   ScopedArenaAllocator allocator(&stack);
   ScopedObjectAccess soa(Thread::Current());
-  RegTypeCache cache(Runtime::Current()->GetClassLinker(), true, allocator);
+  VariableSizedHandleScope handles(soa.Self());
+  RegTypeCache cache(
+      Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
   const RegType& imprecise_obj = cache.JavaLangObject(false);
   const RegType& precise_obj = cache.JavaLangObject(true);
   const RegType& precise_obj_2 = cache.FromDescriptor(nullptr, "Ljava/lang/Object;", true);
@@ -385,7 +393,9 @@
   ArenaStack stack(Runtime::Current()->GetArenaPool());
   ScopedArenaAllocator allocator(&stack);
   ScopedObjectAccess soa(Thread::Current());
-  RegTypeCache cache(Runtime::Current()->GetClassLinker(), true, allocator);
+  VariableSizedHandleScope handles(soa.Self());
+  RegTypeCache cache(
+      Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
   const RegType& ref_type_0 = cache.FromDescriptor(nullptr, "Ljava/lang/DoesNotExist;", true);
   EXPECT_TRUE(ref_type_0.IsUnresolvedReference());
   EXPECT_TRUE(ref_type_0.IsNonZeroReferenceTypes());
@@ -403,7 +413,9 @@
   ArenaStack stack(Runtime::Current()->GetArenaPool());
   ScopedArenaAllocator allocator(&stack);
   ScopedObjectAccess soa(Thread::Current());
-  RegTypeCache cache(Runtime::Current()->GetClassLinker(), true, allocator);
+  VariableSizedHandleScope handles(soa.Self());
+  RegTypeCache cache(
+      Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
   const RegType& ref_type_0 = cache.FromDescriptor(nullptr, "Ljava/lang/DoesNotExist;", true);
   EXPECT_TRUE(ref_type_0.IsUnresolvedReference());
   const RegType& ref_type = cache.FromDescriptor(nullptr, "Ljava/lang/DoesNotExist;", true);
@@ -427,7 +439,9 @@
   ArenaStack stack(Runtime::Current()->GetArenaPool());
   ScopedArenaAllocator allocator(&stack);
   ScopedObjectAccess soa(Thread::Current());
-  RegTypeCache cache(Runtime::Current()->GetClassLinker(), true, allocator);
+  VariableSizedHandleScope handles(soa.Self());
+  RegTypeCache cache(
+      Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
   const RegType& unresolved_ref = cache.FromDescriptor(nullptr, "Ljava/lang/DoesNotExist;", true);
   const RegType& unresolved_ref_another = cache.FromDescriptor(nullptr, "Ljava/lang/DoesNotExistEither;", true);
   const RegType& resolved_ref = cache.JavaLangString();
@@ -455,7 +469,9 @@
   ArenaStack stack(Runtime::Current()->GetArenaPool());
   ScopedArenaAllocator allocator(&stack);
   ScopedObjectAccess soa(Thread::Current());
-  RegTypeCache cache(Runtime::Current()->GetClassLinker(), true, allocator);
+  VariableSizedHandleScope handles(soa.Self());
+  RegTypeCache cache(
+      Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
   const RegType& ref_type = cache.JavaLangString();
   const RegType& ref_type_2 = cache.JavaLangString();
   const RegType& ref_type_3 = cache.FromDescriptor(nullptr, "Ljava/lang/String;", true);
@@ -477,7 +493,9 @@
   ArenaStack stack(Runtime::Current()->GetArenaPool());
   ScopedArenaAllocator allocator(&stack);
   ScopedObjectAccess soa(Thread::Current());
-  RegTypeCache cache(Runtime::Current()->GetClassLinker(), true, allocator);
+  VariableSizedHandleScope handles(soa.Self());
+  RegTypeCache cache(
+      Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
   const RegType& ref_type = cache.JavaLangObject(true);
   const RegType& ref_type_2 = cache.JavaLangObject(true);
   const RegType& ref_type_3 = cache.FromDescriptor(nullptr, "Ljava/lang/Object;", true);
@@ -492,7 +510,9 @@
   ScopedObjectAccess soa(Thread::Current());
   ArenaStack stack(Runtime::Current()->GetArenaPool());
   ScopedArenaAllocator allocator(&stack);
-  RegTypeCache cache_new(Runtime::Current()->GetClassLinker(), true, allocator);
+  VariableSizedHandleScope handles(soa.Self());
+  RegTypeCache cache_new(
+      Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
   const RegType& string = cache_new.JavaLangString();
   const RegType& Object = cache_new.JavaLangObject(true);
   EXPECT_TRUE(string.Merge(Object, &cache_new, /* verifier= */ nullptr).IsJavaLangObject());
@@ -517,7 +537,9 @@
   ArenaStack stack(Runtime::Current()->GetArenaPool());
   ScopedArenaAllocator allocator(&stack);
   ScopedObjectAccess soa(Thread::Current());
-  RegTypeCache cache_new(Runtime::Current()->GetClassLinker(), true, allocator);
+  VariableSizedHandleScope handles(soa.Self());
+  RegTypeCache cache_new(
+      Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
 
   constexpr int32_t kTestConstantValue = 10;
   const RegType& float_type = cache_new.Float();
@@ -550,7 +572,9 @@
   ArenaStack stack(Runtime::Current()->GetArenaPool());
   ScopedArenaAllocator allocator(&stack);
   ScopedObjectAccess soa(Thread::Current());
-  RegTypeCache cache_new(Runtime::Current()->GetClassLinker(), true, allocator);
+  VariableSizedHandleScope handles(soa.Self());
+  RegTypeCache cache_new(
+      Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
 
   constexpr int32_t kTestConstantValue = 10;
   const RegType& long_lo_type = cache_new.LongLo();
@@ -610,7 +634,9 @@
   ArenaStack stack(Runtime::Current()->GetArenaPool());
   ScopedArenaAllocator allocator(&stack);
   ScopedObjectAccess soa(Thread::Current());
-  RegTypeCache cache_new(Runtime::Current()->GetClassLinker(), true, allocator);
+  VariableSizedHandleScope handles(soa.Self());
+  RegTypeCache cache_new(
+      Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
 
   constexpr int32_t kTestConstantValue = 10;
   const RegType& double_lo_type = cache_new.DoubleLo();
@@ -724,7 +750,9 @@
 
   ScopedDisableMovingGC no_gc(soa.Self());
 
-  RegTypeCache cache(Runtime::Current()->GetClassLinker(), true, allocator);
+  VariableSizedHandleScope handles(soa.Self());
+  RegTypeCache cache(
+      Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
 
   const RegType& conflict = cache.Conflict();
   const RegType& zero = cache.Zero();
@@ -1048,7 +1076,9 @@
   ArenaStack stack(Runtime::Current()->GetArenaPool());
   ScopedArenaAllocator allocator(&stack);
   ScopedObjectAccess soa(Thread::Current());
-  RegTypeCache cache_new(Runtime::Current()->GetClassLinker(), true, allocator);
+  VariableSizedHandleScope handles(soa.Self());
+  RegTypeCache cache_new(
+      Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
   const RegType& imprecise_const = cache_new.FromCat1Const(10, false);
   const RegType& precise_const = cache_new.FromCat1Const(10, true);
 
@@ -1087,7 +1117,9 @@
   constexpr const char* kNumberArrayFour = "[[[[Ljava/lang/Number;";
   constexpr const char* kNumberArrayFive = "[[[[[Ljava/lang/Number;";
 
-  RegTypeCache cache(Runtime::Current()->GetClassLinker(), true, allocator);
+  VariableSizedHandleScope handles(soa.Self());
+  RegTypeCache cache(
+      Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
   const RegType& int_array_array = cache.From(nullptr, kIntArrayFive, false);
   ASSERT_TRUE(int_array_array.HasClass());
   const RegType& float_array_array = cache.From(nullptr, kFloatArrayFive, false);
@@ -1127,7 +1159,9 @@
 
     ScopedDisableMovingGC no_gc(soa.Self());
 
-    RegTypeCache cache(Runtime::Current()->GetClassLinker(), true, allocator);
+    VariableSizedHandleScope handles(soa.Self());
+    RegTypeCache cache(
+        Runtime::Current()->GetClassLinker(), /* can_load_classes= */ true, allocator, handles);
     const RegType& c1_reg_type = *cache.InsertClass(in1, c1.Get(), false);
     const RegType& c2_reg_type = *cache.InsertClass(in2, c2.Get(), false);
 
diff --git a/runtime/verifier/register_line-inl.h b/runtime/verifier/register_line-inl.h
index 7b5a496..3967aaa 100644
--- a/runtime/verifier/register_line-inl.h
+++ b/runtime/verifier/register_line-inl.h
@@ -23,7 +23,7 @@
 #include "method_verifier.h"
 #include "reg_type_cache-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace verifier {
 
 // Should we dump a warning on failures to verify balanced locking? That would be an indication to
@@ -184,7 +184,7 @@
       reg_to_lock_depths_(std::less<uint32_t>(),
                           allocator.Adapter(kArenaAllocVerifier)),
       this_initialized_(false) {
-  std::uninitialized_fill_n(line_, num_regs_, 0u);
+  std::uninitialized_fill_n(line_, num_regs_, RegTypeCache::kUndefinedCacheId);
   SetResultTypeToUnknown(reg_types);
 }
 
diff --git a/runtime/verifier/register_line.cc b/runtime/verifier/register_line.cc
index 0e9e0d4..62f2eb3 100644
--- a/runtime/verifier/register_line.cc
+++ b/runtime/verifier/register_line.cc
@@ -23,7 +23,7 @@
 #include "reg_type-inl.h"
 #include "register_line-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace verifier {
 
 using android::base::StringPrintf;
diff --git a/runtime/verifier/register_line.h b/runtime/verifier/register_line.h
index 3db1efb..fc8c4cb 100644
--- a/runtime/verifier/register_line.h
+++ b/runtime/verifier/register_line.h
@@ -24,10 +24,11 @@
 #include <android-base/logging.h>
 
 #include "base/locks.h"
+#include "base/macros.h"
 #include "base/safe_map.h"
 #include "base/scoped_arena_containers.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class Instruction;
 
diff --git a/runtime/verifier/scoped_newline.h b/runtime/verifier/scoped_newline.h
index fb29e3e..ef2fc92 100644
--- a/runtime/verifier/scoped_newline.h
+++ b/runtime/verifier/scoped_newline.h
@@ -21,7 +21,9 @@
 
 #include <android-base/logging.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 namespace verifier {
 
 // RAII to inject a newline after a message.
diff --git a/runtime/verifier/verifier_compiler_binding.h b/runtime/verifier/verifier_compiler_binding.h
index 2266d50..f94ea02 100644
--- a/runtime/verifier/verifier_compiler_binding.h
+++ b/runtime/verifier/verifier_compiler_binding.h
@@ -22,7 +22,7 @@
 #include "base/macros.h"
 #include "verifier_enums.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace verifier {
 
 ALWAYS_INLINE
diff --git a/runtime/verifier/verifier_deps.cc b/runtime/verifier/verifier_deps.cc
index e9e488b..ffd5206 100644
--- a/runtime/verifier/verifier_deps.cc
+++ b/runtime/verifier/verifier_deps.cc
@@ -29,13 +29,13 @@
 #include "dex/dex_file-inl.h"
 #include "mirror/class-inl.h"
 #include "mirror/class_loader.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 #include "obj_ptr-inl.h"
 #include "reg_type.h"
 #include "reg_type_cache-inl.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace verifier {
 
 VerifierDeps::VerifierDeps(const std::vector<const DexFile*>& dex_files, bool output_only)
@@ -728,7 +728,7 @@
 
       DCHECK(destination->IsResolved() && source->IsResolved());
       if (!destination->IsAssignableFrom(source.Get())) {
-        *error_msg = "Class " + destination_desc + " not assignable from " + source_desc;
+        *error_msg = ART_FORMAT("Class {} not assignable from {}", destination_desc, source_desc);
         return false;
       }
     }
diff --git a/runtime/verifier/verifier_deps.h b/runtime/verifier/verifier_deps.h
index 46b3554..dfa13ea 100644
--- a/runtime/verifier/verifier_deps.h
+++ b/runtime/verifier/verifier_deps.h
@@ -23,6 +23,7 @@
 
 #include "base/array_ref.h"
 #include "base/locks.h"
+#include "base/macros.h"
 #include "dex/dex_file_structs.h"
 #include "dex/dex_file_types.h"
 #include "handle.h"
@@ -30,7 +31,7 @@
 #include "thread.h"
 #include "verifier_enums.h"  // For MethodVerifier::FailureKind.
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtField;
 class ArtMethod;
@@ -60,18 +61,21 @@
 // changes in the classpath.
 class VerifierDeps {
  public:
-  explicit VerifierDeps(const std::vector<const DexFile*>& dex_files, bool output_only = true);
+  EXPORT explicit VerifierDeps(const std::vector<const DexFile*>& dex_files,
+                               bool output_only = true);
 
   // Marker to know whether a class is verified. A non-verified class will have
   // this marker as its offset entry in the encoded data.
   static uint32_t constexpr kNotVerifiedMarker = std::numeric_limits<uint32_t>::max();
 
   // Fill dependencies from stored data. Returns true on success, false on failure.
-  bool ParseStoredData(const std::vector<const DexFile*>& dex_files, ArrayRef<const uint8_t> data);
+  EXPORT bool ParseStoredData(const std::vector<const DexFile*>& dex_files,
+                              ArrayRef<const uint8_t> data);
 
   // Merge `other` into this `VerifierDeps`'. `other` and `this` must be for the
   // same set of dex files.
-  void MergeWith(std::unique_ptr<VerifierDeps> other, const std::vector<const DexFile*>& dex_files);
+  EXPORT void MergeWith(std::unique_ptr<VerifierDeps> other,
+                        const std::vector<const DexFile*>& dex_files);
 
   // Record information that a class was verified.
   // Note that this function is different from MaybeRecordVerificationStatus() which
@@ -80,10 +84,10 @@
       REQUIRES(!Locks::verifier_deps_lock_);
 
   // Record the verification status of the class defined in `class_def`.
-  static void MaybeRecordVerificationStatus(VerifierDeps* verifier_deps,
-                                            const DexFile& dex_file,
-                                            const dex::ClassDef& class_def,
-                                            FailureKind failure_kind)
+  EXPORT static void MaybeRecordVerificationStatus(VerifierDeps* verifier_deps,
+                                                   const DexFile& dex_file,
+                                                   const dex::ClassDef& class_def,
+                                                   FailureKind failure_kind)
       REQUIRES(!Locks::verifier_deps_lock_);
 
   // Record the outcome `is_assignable` of type assignability test from `source`
@@ -110,15 +114,16 @@
   // Serialize the recorded dependencies and store the data into `buffer`.
   // `dex_files` provides the order of the dex files in which the dependencies
   // should be emitted.
-  void Encode(const std::vector<const DexFile*>& dex_files, std::vector<uint8_t>* buffer) const;
+  EXPORT void Encode(const std::vector<const DexFile*>& dex_files,
+                     std::vector<uint8_t>* buffer) const;
 
-  void Dump(VariableIndentationOutputStream* vios) const;
+  EXPORT void Dump(VariableIndentationOutputStream* vios) const;
 
   // Verify the encoded dependencies of this `VerifierDeps` are still valid.
-  bool ValidateDependencies(Thread* self,
-                            Handle<mirror::ClassLoader> class_loader,
-                            const std::vector<const DexFile*>& dex_files,
-                            /* out */ std::string* error_msg) const
+  EXPORT bool ValidateDependencies(Thread* self,
+                                   Handle<mirror::ClassLoader> class_loader,
+                                   const std::vector<const DexFile*>& dex_files,
+                                   /* out */ std::string* error_msg) const
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   const std::vector<bool>& GetVerifiedClasses(const DexFile& dex_file) const {
@@ -138,7 +143,7 @@
   }
 
   // Resets the data related to the given dex files.
-  void ClearData(const std::vector<const DexFile*>& dex_files);
+  EXPORT void ClearData(const std::vector<const DexFile*>& dex_files);
 
   // Parses raw VerifierDeps data to extract bitvectors of which class def indices
   // were verified or not. The given `dex_files` must match the order and count of
@@ -195,7 +200,7 @@
   // `dex_file` is not reported as being compiled.
   DexFileDeps* GetDexFileDeps(const DexFile& dex_file);
 
-  const DexFileDeps* GetDexFileDeps(const DexFile& dex_file) const;
+  EXPORT const DexFileDeps* GetDexFileDeps(const DexFile& dex_file) const;
 
   // Returns the index of `str`. If it is defined in `dex_file_`, this is the dex
   // string ID. If not, an ID is assigned to the string and cached in `strings_`
diff --git a/runtime/verifier/verifier_enums.h b/runtime/verifier/verifier_enums.h
index 9c55e99..5799458 100644
--- a/runtime/verifier/verifier_enums.h
+++ b/runtime/verifier/verifier_enums.h
@@ -19,7 +19,9 @@
 
 #include <stdint.h>
 
-namespace art {
+#include "base/macros.h"
+
+namespace art HIDDEN {
 namespace verifier {
 
 // The mode that the verifier should run as.
diff --git a/runtime/verify_object-inl.h b/runtime/verify_object-inl.h
index 363fde2..b38fc9c 100644
--- a/runtime/verify_object-inl.h
+++ b/runtime/verify_object-inl.h
@@ -22,7 +22,7 @@
 #include "mirror/object-inl.h"
 #include "obj_ptr-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 inline bool VerifyClassClass(ObjPtr<mirror::Class> c) {
   if (UNLIKELY(c == nullptr)) {
diff --git a/runtime/verify_object.cc b/runtime/verify_object.cc
index 61b502d..5684fc1 100644
--- a/runtime/verify_object.cc
+++ b/runtime/verify_object.cc
@@ -23,7 +23,7 @@
 #include "runtime.h"
 #include "runtime_globals.h"
 
-namespace art {
+namespace art HIDDEN {
 
 void VerifyObjectImpl(ObjPtr<mirror::Object> obj) {
   if (kVerifyObjectSupport > kVerifyObjectModeFast) {
diff --git a/runtime/verify_object.h b/runtime/verify_object.h
index ae87cad..d09e03a 100644
--- a/runtime/verify_object.h
+++ b/runtime/verify_object.h
@@ -22,7 +22,7 @@
 #include "base/macros.h"
 #include "obj_ptr.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace mirror {
 class Class;
@@ -36,7 +36,7 @@
   kVerifyObjectModeAll  // Check heap accesses thoroughly.
 };
 
-enum VerifyObjectFlags {
+enum EXPORT VerifyObjectFlags {
   kVerifyNone = 0x0,
   // Verify self when we are doing an operation.
   kVerifyThis = 0x1,
diff --git a/runtime/well_known_classes-inl.h b/runtime/well_known_classes-inl.h
index 23fe145..9e4c530 100644
--- a/runtime/well_known_classes-inl.h
+++ b/runtime/well_known_classes-inl.h
@@ -22,7 +22,7 @@
 #include "art_field-inl.h"
 #include "art_method-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 namespace detail {
 
 template <typename MemberType, MemberType** kMember>
diff --git a/runtime/well_known_classes.cc b/runtime/well_known_classes.cc
index 780fa83..21aaf72 100644
--- a/runtime/well_known_classes.cc
+++ b/runtime/well_known_classes.cc
@@ -43,7 +43,7 @@
 #include "scoped_thread_state_change.h"
 #include "thread-current-inl.h"
 
-namespace art {
+namespace art HIDDEN {
 
 jclass WellKnownClasses::dalvik_annotation_optimization_CriticalNative;
 jclass WellKnownClasses::dalvik_annotation_optimization_FastNative;
@@ -96,7 +96,9 @@
 ArtMethod* WellKnownClasses::java_lang_invoke_MethodHandle_asType;
 ArtMethod* WellKnownClasses::java_lang_invoke_MethodHandle_invokeExact;
 ArtMethod* WellKnownClasses::java_lang_invoke_MethodHandles_lookup;
+ArtMethod* WellKnownClasses::java_lang_invoke_MethodHandles_makeIdentity;
 ArtMethod* WellKnownClasses::java_lang_invoke_MethodHandles_Lookup_findConstructor;
+ArtMethod* WellKnownClasses::java_lang_invoke_MethodType_makeImpl;
 ArtMethod* WellKnownClasses::java_lang_ref_FinalizerReference_add;
 ArtMethod* WellKnownClasses::java_lang_ref_ReferenceQueue_add;
 ArtMethod* WellKnownClasses::java_lang_reflect_InvocationTargetException_init;
@@ -124,6 +126,7 @@
 ArtField* WellKnownClasses::dalvik_system_VMRuntime_nonSdkApiUsageConsumer;
 ArtField* WellKnownClasses::java_io_FileDescriptor_descriptor;
 ArtField* WellKnownClasses::java_lang_ClassLoader_parent;
+ArtField* WellKnownClasses::java_lang_String_EMPTY;
 ArtField* WellKnownClasses::java_lang_Thread_parkBlocker;
 ArtField* WellKnownClasses::java_lang_Thread_daemon;
 ArtField* WellKnownClasses::java_lang_Thread_group;
@@ -153,6 +156,7 @@
 ArtField* WellKnownClasses::java_nio_ByteBuffer_isReadOnly;
 ArtField* WellKnownClasses::java_nio_ByteBuffer_offset;
 ArtField* WellKnownClasses::java_util_Collections_EMPTY_LIST;
+ArtField* WellKnownClasses::java_util_concurrent_ThreadLocalRandom_seeder;
 ArtField* WellKnownClasses::jdk_internal_math_FloatingDecimal_BinaryToASCIIBuffer_buffer;
 ArtField* WellKnownClasses::jdk_internal_math_FloatingDecimal_ExceptionalBinaryToASCIIBuffer_image;
 ArtField* WellKnownClasses::libcore_util_EmptyArray_STACK_TRACE_ELEMENT;
@@ -161,6 +165,18 @@
 ArtField* WellKnownClasses::org_apache_harmony_dalvik_ddmc_Chunk_offset;
 ArtField* WellKnownClasses::org_apache_harmony_dalvik_ddmc_Chunk_type;
 
+ArtField* WellKnownClasses::java_lang_Byte_ByteCache_cache;
+ArtField* WellKnownClasses::java_lang_Character_CharacterCache_cache;
+ArtField* WellKnownClasses::java_lang_Short_ShortCache_cache;
+ArtField* WellKnownClasses::java_lang_Integer_IntegerCache_cache;
+ArtField* WellKnownClasses::java_lang_Long_LongCache_cache;
+
+ArtField* WellKnownClasses::java_lang_Byte_value;
+ArtField* WellKnownClasses::java_lang_Character_value;
+ArtField* WellKnownClasses::java_lang_Short_value;
+ArtField* WellKnownClasses::java_lang_Integer_value;
+ArtField* WellKnownClasses::java_lang_Long_value;
+
 static ObjPtr<mirror::Class> FindSystemClass(ClassLinker* class_linker,
                                              Thread* self,
                                              const char* descriptor)
@@ -225,6 +241,24 @@
   return CacheMethod(boxed_class, /*is_static=*/ true, "valueOf", signature.c_str(), pointer_size);
 }
 
+static ArtField* CacheBoxingCacheField(ClassLinker* class_linker,
+                                       Thread* self,
+                                       const char* class_name,
+                                       const char* cache_type)
+    REQUIRES_SHARED(Locks::mutator_lock_) {
+  ObjPtr<mirror::Class> boxed_class = FindSystemClass(class_linker, self, class_name);
+  return CacheField(boxed_class, /*is_static=*/ true, "cache", cache_type);
+}
+
+static ArtField* CacheValueInBoxField(ClassLinker* class_linker,
+                                      Thread* self,
+                                      const char* class_name,
+                                      const char* cache_type)
+    REQUIRES_SHARED(Locks::mutator_lock_) {
+  ObjPtr<mirror::Class> boxed_class = FindSystemClass(class_linker, self, class_name);
+  return CacheField(boxed_class, /*is_static=*/ false, "value", cache_type);
+}
+
 #define STRING_INIT_LIST(V) \
   V(java_lang_String_init, "()V", newEmptyString, "newEmptyString", "()Ljava/lang/String;", NewEmptyString) \
   V(java_lang_String_init_B, "([B)V", newStringFromBytes_B, "newStringFromBytes", "([B)Ljava/lang/String;", NewStringFromBytes_B) \
@@ -361,7 +395,29 @@
   java_lang_Short_valueOf =
       CachePrimitiveBoxingMethod(class_linker, self, 'S', "Ljava/lang/Short;");
 
-  StackHandleScope<42u> hs(self);
+  java_lang_Byte_ByteCache_cache = CacheBoxingCacheField(
+      class_linker, self, "Ljava/lang/Byte$ByteCache;", "[Ljava/lang/Byte;");
+  java_lang_Character_CharacterCache_cache = CacheBoxingCacheField(
+      class_linker, self, "Ljava/lang/Character$CharacterCache;", "[Ljava/lang/Character;");
+  java_lang_Short_ShortCache_cache = CacheBoxingCacheField(
+      class_linker, self, "Ljava/lang/Short$ShortCache;", "[Ljava/lang/Short;");
+  java_lang_Integer_IntegerCache_cache = CacheBoxingCacheField(
+      class_linker, self, "Ljava/lang/Integer$IntegerCache;", "[Ljava/lang/Integer;");
+  java_lang_Long_LongCache_cache = CacheBoxingCacheField(
+      class_linker, self, "Ljava/lang/Long$LongCache;", "[Ljava/lang/Long;");
+
+  java_lang_Byte_value = CacheValueInBoxField(
+      class_linker, self, "Ljava/lang/Byte;", "B");
+  java_lang_Character_value = CacheValueInBoxField(
+      class_linker, self, "Ljava/lang/Character;", "C");
+  java_lang_Short_value = CacheValueInBoxField(
+      class_linker, self, "Ljava/lang/Short;", "S");
+  java_lang_Integer_value = CacheValueInBoxField(
+      class_linker, self, "Ljava/lang/Integer;", "I");
+  java_lang_Long_value = CacheValueInBoxField(
+      class_linker, self, "Ljava/lang/Long;", "J");
+
+  StackHandleScope<44u> hs(self);
   Handle<mirror::Class> d_s_bdcl =
       hs.NewHandle(FindSystemClass(class_linker, self, "Ldalvik/system/BaseDexClassLoader;"));
   Handle<mirror::Class> d_s_dlcl =
@@ -412,6 +468,8 @@
       hs.NewHandle(FindSystemClass(class_linker, self, "Ljava/lang/invoke/MethodHandles;"));
   Handle<mirror::Class> j_l_i_MethodHandles_Lookup =
       hs.NewHandle(FindSystemClass(class_linker, self, "Ljava/lang/invoke/MethodHandles$Lookup;"));
+  Handle<mirror::Class> j_l_i_MethodType =
+      hs.NewHandle(FindSystemClass(class_linker, self, "Ljava/lang/invoke/MethodType;"));
   Handle<mirror::Class> j_l_r_fr =
       hs.NewHandle(FindSystemClass(class_linker, self, "Ljava/lang/ref/FinalizerReference;"));
   Handle<mirror::Class> j_l_r_rq =
@@ -428,6 +486,8 @@
       hs.NewHandle(FindSystemClass(class_linker, self, "Ljava/nio/DirectByteBuffer;"));
   Handle<mirror::Class> j_u_c =
       hs.NewHandle(FindSystemClass(class_linker, self, "Ljava/util/Collections;"));
+  Handle<mirror::Class> j_u_c_tlr =
+      hs.NewHandle(FindSystemClass(class_linker, self, "Ljava/util/concurrent/ThreadLocalRandom;"));
   Handle<mirror::Class> j_u_f_c =
       hs.NewHandle(FindSystemClass(class_linker, self, "Ljava/util/function/Consumer;"));
   Handle<mirror::Class> j_i_m_fd =
@@ -576,12 +636,24 @@
       "lookup",
       "()Ljava/lang/invoke/MethodHandles$Lookup;",
       pointer_size);
+  java_lang_invoke_MethodHandles_makeIdentity = CacheMethod(
+      j_l_i_MethodHandles.Get(),
+      /*is_static=*/ true,
+      "makeIdentity",
+      "(Ljava/lang/Class;)Ljava/lang/invoke/MethodHandle;",
+      pointer_size);
   java_lang_invoke_MethodHandles_Lookup_findConstructor = CacheMethod(
       j_l_i_MethodHandles_Lookup.Get(),
       /*is_static=*/ false,
       "findConstructor",
       "(Ljava/lang/Class;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/MethodHandle;",
       pointer_size);
+  java_lang_invoke_MethodType_makeImpl = CacheMethod(
+      j_l_i_MethodType.Get(),
+      /* is_static=*/ true,
+      "makeImpl",
+      "(Ljava/lang/Class;[Ljava/lang/Class;Z)Ljava/lang/invoke/MethodType;",
+      pointer_size);
 
   java_lang_ref_FinalizerReference_add = CacheMethod(
       j_l_r_fr.Get(), /*is_static=*/ true, "add", "(Ljava/lang/Object;)V", pointer_size);
@@ -686,6 +758,8 @@
   java_lang_ClassLoader_parent = CacheField(
       j_l_cl.Get(), /*is_static=*/ false, "parent", "Ljava/lang/ClassLoader;");
 
+  java_lang_String_EMPTY =
+      CacheField(j_l_String, /*is_static=*/true, "EMPTY", "Ljava/lang/String;");
   java_lang_Thread_parkBlocker =
       CacheField(j_l_Thread.Get(), /*is_static=*/ false, "parkBlocker", "Ljava/lang/Object;");
   java_lang_Thread_daemon = CacheField(j_l_Thread.Get(), /*is_static=*/ false, "daemon", "Z");
@@ -742,6 +816,9 @@
   java_util_Collections_EMPTY_LIST =
       CacheField(j_u_c.Get(), /*is_static=*/ true, "EMPTY_LIST", "Ljava/util/List;");
 
+  java_util_concurrent_ThreadLocalRandom_seeder = CacheField(
+      j_u_c_tlr.Get(), /*is_static=*/ true, "seeder", "Ljava/util/concurrent/atomic/AtomicLong;");
+
   jdk_internal_math_FloatingDecimal_BinaryToASCIIBuffer_buffer =
       CacheField(j_i_m_fd_btab.Get(), /*is_static=*/ false, "buffer", "[C");
   jdk_internal_math_FloatingDecimal_ExceptionalBinaryToASCIIBuffer_image = CacheField(
@@ -847,7 +924,9 @@
   java_lang_invoke_MethodHandle_asType = nullptr;
   java_lang_invoke_MethodHandle_invokeExact = nullptr;
   java_lang_invoke_MethodHandles_lookup = nullptr;
+  java_lang_invoke_MethodHandles_makeIdentity = nullptr;
   java_lang_invoke_MethodHandles_Lookup_findConstructor = nullptr;
+  java_lang_invoke_MethodType_makeImpl = nullptr;
   java_lang_ref_FinalizerReference_add = nullptr;
   java_lang_ref_ReferenceQueue_add = nullptr;
   java_lang_reflect_InvocationTargetException_init = nullptr;
@@ -871,6 +950,7 @@
   dalvik_system_DexPathList__Element_dexFile = nullptr;
   dalvik_system_VMRuntime_nonSdkApiUsageConsumer = nullptr;
   java_lang_ClassLoader_parent = nullptr;
+  java_lang_String_EMPTY = nullptr;
   java_lang_Thread_parkBlocker = nullptr;
   java_lang_Thread_daemon = nullptr;
   java_lang_Thread_group = nullptr;
@@ -897,6 +977,7 @@
   java_nio_ByteBuffer_isReadOnly = nullptr;
   java_nio_ByteBuffer_offset = nullptr;
   java_util_Collections_EMPTY_LIST = nullptr;
+  java_util_concurrent_ThreadLocalRandom_seeder = nullptr;
   jdk_internal_math_FloatingDecimal_BinaryToASCIIBuffer_buffer = nullptr;
   jdk_internal_math_FloatingDecimal_ExceptionalBinaryToASCIIBuffer_image = nullptr;
   libcore_util_EmptyArray_STACK_TRACE_ELEMENT = nullptr;
@@ -904,6 +985,18 @@
   org_apache_harmony_dalvik_ddmc_Chunk_length = nullptr;
   org_apache_harmony_dalvik_ddmc_Chunk_offset = nullptr;
   org_apache_harmony_dalvik_ddmc_Chunk_type = nullptr;
+
+  java_lang_Byte_ByteCache_cache = nullptr;
+  java_lang_Character_CharacterCache_cache = nullptr;
+  java_lang_Short_ShortCache_cache = nullptr;
+  java_lang_Integer_IntegerCache_cache = nullptr;
+  java_lang_Long_LongCache_cache = nullptr;
+
+  java_lang_Byte_value = nullptr;
+  java_lang_Character_value = nullptr;
+  java_lang_Short_value = nullptr;
+  java_lang_Integer_value = nullptr;
+  java_lang_Long_value = nullptr;
 }
 
 ObjPtr<mirror::Class> WellKnownClasses::ToClass(jclass global_jclass) {
diff --git a/runtime/well_known_classes.h b/runtime/well_known_classes.h
index cc6347c..bd8bbe0 100644
--- a/runtime/well_known_classes.h
+++ b/runtime/well_known_classes.h
@@ -18,11 +18,12 @@
 #define ART_RUNTIME_WELL_KNOWN_CLASSES_H_
 
 #include "base/locks.h"
+#include "base/macros.h"
 #include "jni.h"
 #include "obj_ptr.h"
 #include "read_barrier_option.h"
 
-namespace art {
+namespace art HIDDEN {
 
 class ArtField;
 class ArtMethod;
@@ -61,7 +62,7 @@
 
 // Various classes used in JNI. We cache them so we don't have to keep looking them up.
 
-struct WellKnownClasses {
+struct EXPORT WellKnownClasses {
  public:
   // Run before native methods are registered.
   static void Init(JNIEnv* env);
@@ -141,7 +142,9 @@
   static ArtMethod* java_lang_invoke_MethodHandle_asType;
   static ArtMethod* java_lang_invoke_MethodHandle_invokeExact;
   static ArtMethod* java_lang_invoke_MethodHandles_lookup;
+  static ArtMethod* java_lang_invoke_MethodHandles_makeIdentity;
   static ArtMethod* java_lang_invoke_MethodHandles_Lookup_findConstructor;
+  static ArtMethod* java_lang_invoke_MethodType_makeImpl;
   static ArtMethod* java_lang_ref_FinalizerReference_add;
   static ArtMethod* java_lang_ref_ReferenceQueue_add;
   static ArtMethod* java_lang_reflect_InvocationTargetException_init;
@@ -169,6 +172,7 @@
   static ArtField* dalvik_system_VMRuntime_nonSdkApiUsageConsumer;
   static ArtField* java_io_FileDescriptor_descriptor;
   static ArtField* java_lang_ClassLoader_parent;
+  static ArtField* java_lang_String_EMPTY;
   static ArtField* java_lang_Thread_parkBlocker;
   static ArtField* java_lang_Thread_daemon;
   static ArtField* java_lang_Thread_group;
@@ -198,6 +202,7 @@
   static ArtField* java_nio_ByteBuffer_isReadOnly;
   static ArtField* java_nio_ByteBuffer_offset;
   static ArtField* java_util_Collections_EMPTY_LIST;
+  static ArtField* java_util_concurrent_ThreadLocalRandom_seeder;
   static ArtField* jdk_internal_math_FloatingDecimal_BinaryToASCIIBuffer_buffer;
   static ArtField* jdk_internal_math_FloatingDecimal_ExceptionalBinaryToASCIIBuffer_image;
   static ArtField* libcore_util_EmptyArray_STACK_TRACE_ELEMENT;
@@ -206,6 +211,18 @@
   static ArtField* org_apache_harmony_dalvik_ddmc_Chunk_offset;
   static ArtField* org_apache_harmony_dalvik_ddmc_Chunk_type;
 
+  static ArtField* java_lang_Byte_ByteCache_cache;
+  static ArtField* java_lang_Character_CharacterCache_cache;
+  static ArtField* java_lang_Short_ShortCache_cache;
+  static ArtField* java_lang_Integer_IntegerCache_cache;
+  static ArtField* java_lang_Long_LongCache_cache;
+
+  static ArtField* java_lang_Byte_value;
+  static ArtField* java_lang_Character_value;
+  static ArtField* java_lang_Short_value;
+  static ArtField* java_lang_Integer_value;
+  static ArtField* java_lang_Long_value;
+
   static constexpr ClassFromField<&dalvik_system_BaseDexClassLoader_pathList>
       dalvik_system_BaseDexClassLoader;
   static constexpr ClassFromMethod<&dalvik_system_DelegateLastClassLoader_init>
@@ -242,6 +259,23 @@
   static constexpr ClassFromField<&java_util_Collections_EMPTY_LIST> java_util_Collections;
   static constexpr ClassFromField<&libcore_util_EmptyArray_STACK_TRACE_ELEMENT>
       libcore_util_EmptyArray;
+
+  static constexpr ClassFromField<&java_lang_Byte_ByteCache_cache> java_lang_Byte_ByteCache;
+  static constexpr ClassFromField<&java_lang_Character_CharacterCache_cache>
+      java_lang_Character_CharacterCache;
+  static constexpr ClassFromField<&java_lang_Short_ShortCache_cache> java_lang_Short_ShortCache;
+  static constexpr ClassFromField<&java_lang_Integer_IntegerCache_cache>
+      java_lang_Integer_IntegerCache;
+  static constexpr ClassFromField<&java_lang_Long_LongCache_cache> java_lang_Long_LongCache;
+
+  static constexpr ClassFromMethod<&java_lang_Boolean_valueOf> java_lang_Boolean;
+  static constexpr ClassFromMethod<&java_lang_Byte_valueOf> java_lang_Byte;
+  static constexpr ClassFromMethod<&java_lang_Character_valueOf> java_lang_Character;
+  static constexpr ClassFromMethod<&java_lang_Short_valueOf> java_lang_Short;
+  static constexpr ClassFromMethod<&java_lang_Integer_valueOf> java_lang_Integer;
+  static constexpr ClassFromMethod<&java_lang_Float_valueOf> java_lang_Float;
+  static constexpr ClassFromMethod<&java_lang_Long_valueOf> java_lang_Long;
+  static constexpr ClassFromMethod<&java_lang_Double_valueOf> java_lang_Double;
 };
 
 }  // namespace art
diff --git a/runtime/write_barrier-inl.h b/runtime/write_barrier-inl.h
index af8c1be..e4efe5f 100644
--- a/runtime/write_barrier-inl.h
+++ b/runtime/write_barrier-inl.h
@@ -24,11 +24,11 @@
 #include "obj_ptr-inl.h"
 #include "runtime.h"
 
-namespace art {
+namespace art HIDDEN {
 
 template <WriteBarrier::NullCheck kNullCheck>
 inline void WriteBarrier::ForFieldWrite(ObjPtr<mirror::Object> dst,
-                                        MemberOffset offset ATTRIBUTE_UNUSED,
+                                        [[maybe_unused]] MemberOffset offset,
                                         ObjPtr<mirror::Object> new_value) {
   if (kNullCheck == kWithNullCheck && new_value == nullptr) {
     return;
@@ -38,8 +38,8 @@
 }
 
 inline void WriteBarrier::ForArrayWrite(ObjPtr<mirror::Object> dst,
-                                        int start_offset ATTRIBUTE_UNUSED,
-                                        size_t length ATTRIBUTE_UNUSED) {
+                                        [[maybe_unused]] int start_offset,
+                                        [[maybe_unused]] size_t length) {
   GetCardTable()->MarkCard(dst.Ptr());
 }
 
diff --git a/runtime/write_barrier.h b/runtime/write_barrier.h
index 112154e..dcb7f8f 100644
--- a/runtime/write_barrier.h
+++ b/runtime/write_barrier.h
@@ -19,7 +19,7 @@
 
 #include "base/macros.h"
 
-namespace art {
+namespace art HIDDEN {
 
 namespace gc {
 namespace accounting {
@@ -38,15 +38,15 @@
   // safe-point. The call is not needed if null is stored in the field.
   template <NullCheck kNullCheck = kWithNullCheck>
   ALWAYS_INLINE static void ForFieldWrite(ObjPtr<mirror::Object> dst,
-                                          MemberOffset offset ATTRIBUTE_UNUSED,
-                                          ObjPtr<mirror::Object> new_value ATTRIBUTE_UNUSED)
+                                          [[maybe_unused]] MemberOffset offset,
+                                          [[maybe_unused]] ObjPtr<mirror::Object> new_value)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Must be called if a reference field of an ObjectArray in the heap changes, and before any GC
   // safe-point. The call is not needed if null is stored in the field.
   ALWAYS_INLINE static void ForArrayWrite(ObjPtr<mirror::Object> dst,
-                                          int start_offset ATTRIBUTE_UNUSED,
-                                          size_t length ATTRIBUTE_UNUSED)
+                                          [[maybe_unused]] int start_offset,
+                                          [[maybe_unused]] size_t length)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Write barrier for every reference field in an object.
diff --git a/sigchainlib/Android.bp b/sigchainlib/Android.bp
index 68dec35..6160b33 100644
--- a/sigchainlib/Android.bp
+++ b/sigchainlib/Android.bp
@@ -51,6 +51,7 @@
         android: {
             header_libs: ["bionic_libc_platform_headers"],
             static_libs: ["libasync_safe"],
+            shared_libs: ["libunwindstack"],
         },
 
         linux_bionic: {
@@ -90,7 +91,6 @@
 art_cc_defaults {
     name: "art_sigchain_tests_defaults",
     srcs: ["sigchain_test.cc"],
-    shared_libs: ["libsigchain"],
 }
 
 // Version of ART gtest `art_sigchain_tests` bundled with the ART APEX on target.
diff --git a/sigchainlib/OWNERS b/sigchainlib/OWNERS
index 6062b9c..9b2e806 100644
--- a/sigchainlib/OWNERS
+++ b/sigchainlib/OWNERS
@@ -1,5 +1,4 @@
 # Default maintainers and code reviewers:
-calin@google.com
 dimitry@google.com
-jmgao@google.com
+dsrbecky@google.com
 ngeoffray@google.com
diff --git a/sigchainlib/log.h b/sigchainlib/log.h
index d689930..cbfc88f 100644
--- a/sigchainlib/log.h
+++ b/sigchainlib/log.h
@@ -21,7 +21,7 @@
 
 #include <async_safe/log.h>
 
-#define log(...) async_safe_format_log(ANDROID_LOG_ERROR, "libsigchain", __VA_ARGS__)
+#define LogError(...) async_safe_format_log(ANDROID_LOG_ERROR, "libsigchain", __VA_ARGS__)
 #define fatal async_safe_fatal
 
 #else
@@ -29,7 +29,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 
-static void log(const char* format, ...) {
+static void LogError(const char* format, ...) {
   va_list ap;
   va_start(ap, format);
   vprintf(format, ap);
@@ -38,7 +38,9 @@
   printf("\n");
 }
 
-#define fatal(...) log(__VA_ARGS__); abort()
+#define fatal(...)       \
+  LogError(__VA_ARGS__); \
+  abort()
 
 #endif
 
diff --git a/sigchainlib/sigchain.cc b/sigchainlib/sigchain.cc
index a7f73f7..e2e96df 100644
--- a/sigchainlib/sigchain.cc
+++ b/sigchainlib/sigchain.cc
@@ -16,6 +16,7 @@
 
 #include <dlfcn.h>
 #include <errno.h>
+#include <inttypes.h>
 #include <pthread.h>
 #include <signal.h>
 #include <stdio.h>
@@ -24,6 +25,7 @@
 
 #if defined(__BIONIC__)
 #include <bionic/macros.h>
+#include <unwindstack/AndroidUnwinder.h>
 #endif
 
 #include <algorithm>
@@ -96,6 +98,28 @@
   return 0;
 }
 
+void LogStack() {
+#if defined(__BIONIC__)
+  unwindstack::AndroidLocalUnwinder unwinder;
+  unwindstack::AndroidUnwinderData data;
+  if (!unwinder.Unwind(data)) {
+    LogError("Failed to get callstack.");
+    return;
+  }
+  data.DemangleFunctionNames();
+  for (const unwindstack::FrameData& frame : data.frames) {
+    auto& map = frame.map_info;
+    LogError("  #%02zu pc %08" PRIx64 "  %s (%s+%" PRIu64 ") (BuildId: %s)",
+             frame.num,
+             frame.rel_pc,
+             map != nullptr ? map->name().c_str() : "???",
+             frame.function_name.c_str(),
+             frame.function_offset,
+             map != nullptr ? map->GetPrintableBuildID().c_str() : "???");
+  }
+#endif
+}
+
 namespace art {
 
 static decltype(&sigaction) linked_sigaction;
@@ -427,6 +451,24 @@
 
       linked_sigprocmask(SIG_SETMASK, &previous_mask, nullptr);
     }
+  } else {
+#if defined(__aarch64__)
+    // Log the specific value if we're handling more than one signal (or if the bit is
+    // concurrently cleared) to help diagnose rare crashes. Multiple bits set may
+    // indicate memory corruption of the specific value in TLS. Bugs: 304237198, 294339122.
+    size_t bit_idx = signo - 1;
+    size_t key_idx = bit_idx / kNumSignalsPerKey;
+    uintptr_t expected = static_cast<uintptr_t>(1) << (bit_idx % kNumSignalsPerKey);
+    uintptr_t value =
+        reinterpret_cast<uintptr_t>(pthread_getspecific(GetHandlingSignalKey(key_idx)));
+    if (value != expected) {
+      LogError(
+          "Already handling signal %d, value=0x%" PRIxPTR " differs from expected=0x%" PRIxPTR,
+          signo,
+          value,
+          expected);
+    }
+#endif
   }
 
   // In Android 14, there's a special feature called "recoverable" GWP-ASan. GWP-ASan is a tool that
@@ -490,7 +532,8 @@
       // the crash will have no way to know our ucontext, and thus no way to dump the original crash
       // stack (since we're on an alternate stack.) Let's remove our handler and return. Then the
       // pre-crash state is restored, the crash happens again, and the next handler gets a chance.
-      log("reverting to SIG_DFL handler for signal %d, ucontext %p", signo, ucontext);
+      LogError("reverting to SIG_DFL handler for signal %d, ucontext %p", signo, ucontext);
+      LogStack();
       struct sigaction dfl = {};
       dfl.sa_handler = SIG_DFL;
       linked_sigaction(signo, &dfl, nullptr);
@@ -519,6 +562,11 @@
     return -1;
   }
 
+  if (signal == SIGSEGV && new_action != nullptr && new_action->sa_handler == SIG_DFL) {
+    LogError("Setting SIGSEGV to SIG_DFL");
+    LogStack();
+  }
+
   if (chains[signal].IsClaimed()) {
     SigactionType saved_action = chains[signal].GetAction<SigactionType>();
     if (new_action != nullptr) {
@@ -672,7 +720,7 @@
   // If the sigactions don't match then we put the current action on the chain and make ourself as
   // the main action.
   if (current_action.sa_sigaction != SignalChain::Handler) {
-    log("Warning: Unexpected sigaction action found %p\n", current_action.sa_sigaction);
+    LogError("Warning: Unexpected sigaction action found %p\n", current_action.sa_sigaction);
     chains[signal].Register(signal);
   }
 }
diff --git a/sigchainlib/sigchain_fake.cc b/sigchainlib/sigchain_fake.cc
index 2386154..06f6569 100644
--- a/sigchainlib/sigchain_fake.cc
+++ b/sigchainlib/sigchain_fake.cc
@@ -20,8 +20,6 @@
 #include "log.h"
 #include "sigchain.h"
 
-#define ATTRIBUTE_UNUSED __attribute__((__unused__))
-
 // We cannot annotate the declarations, as they are not no-return in the non-fake version.
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
@@ -29,25 +27,25 @@
 
 namespace art {
 
-extern "C" void EnsureFrontOfChain(int signal ATTRIBUTE_UNUSED) {
-  log("EnsureFrontOfChain is not exported by the main executable.");
+extern "C" void EnsureFrontOfChain([[maybe_unused]] int signal) {
+  LogError("EnsureFrontOfChain is not exported by the main executable.");
   abort();
 }
 
-extern "C" void AddSpecialSignalHandlerFn(int signal ATTRIBUTE_UNUSED,
-                                          SigchainAction* sa ATTRIBUTE_UNUSED) {
-  log("SetSpecialSignalHandlerFn is not exported by the main executable.");
+extern "C" void AddSpecialSignalHandlerFn([[maybe_unused]] int signal,
+                                          [[maybe_unused]] SigchainAction* sa) {
+  LogError("SetSpecialSignalHandlerFn is not exported by the main executable.");
   abort();
 }
 
-extern "C" void RemoveSpecialSignalHandlerFn(int signal ATTRIBUTE_UNUSED,
-                                             bool (*fn)(int, siginfo_t*, void*) ATTRIBUTE_UNUSED) {
-  log("SetSpecialSignalHandlerFn is not exported by the main executable.");
+extern "C" void RemoveSpecialSignalHandlerFn([[maybe_unused]] int signal,
+                                             [[maybe_unused]] bool (*fn)(int, siginfo_t*, void*)) {
+  LogError("SetSpecialSignalHandlerFn is not exported by the main executable.");
   abort();
 }
 
-extern "C" void SkipAddSignalHandler(bool value ATTRIBUTE_UNUSED) {
-  log("SkipAddSignalHandler is not exported by the main executable.");
+extern "C" void SkipAddSignalHandler([[maybe_unused]] bool value) {
+  LogError("SkipAddSignalHandler is not exported by the main executable.");
   abort();
 }
 
diff --git a/sigchainlib/sigchain_test.cc b/sigchainlib/sigchain_test.cc
index 5e9c7fe..3a68381 100644
--- a/sigchainlib/sigchain_test.cc
+++ b/sigchainlib/sigchain_test.cc
@@ -190,25 +190,23 @@
   });
 }
 
-#if defined(__BIONIC__)
+#if !defined(__riscv)
 // Not exposed via headers, but the symbols are available if you declare them yourself.
 extern "C" int sigblock(int);
-extern "C" int sigsetmask(int);
-#endif
-
 TEST_F(SigchainTest, sigblock) {
   TestSignalBlocking([]() {
     int mask = ~0U;
     ASSERT_EQ(0, sigblock(mask));
   });
 }
-
+extern "C" int sigsetmask(int);
 TEST_F(SigchainTest, sigsetmask) {
   TestSignalBlocking([]() {
     int mask = ~0U;
     ASSERT_EQ(0, sigsetmask(mask));
   });
 }
+#endif
 
 #endif
 
@@ -267,8 +265,8 @@
   ASSERT_EQ(0, sigaction(SIGSEGV, &action, nullptr));
 
   auto* tagged_null = reinterpret_cast<int*>(0x2bULL << 56);
-  EXPECT_EXIT({ volatile int load __attribute__((unused)) = *tagged_null; },
-              testing::ExitedWithCode(0), "");
+  EXPECT_EXIT(
+      { [[maybe_unused]] volatile int load = *tagged_null; }, testing::ExitedWithCode(0), "");
 
   // Our sigaction implementation always implements the "clear unknown bits"
   // semantics for oldact.sa_flags regardless of kernel version so we rely on it
@@ -277,8 +275,9 @@
   ASSERT_EQ(0, sigaction(SIGSEGV, &action, nullptr));
   ASSERT_EQ(0, sigaction(SIGSEGV, nullptr, &action));
   if (action.sa_flags & SA_EXPOSE_TAGBITS) {
-    EXPECT_EXIT({ volatile int load __attribute__((unused)) = *tagged_null; },
-                testing::ExitedWithCode(0x2b), "");
+      EXPECT_EXIT({ [[maybe_unused]] volatile int load = *tagged_null; },
+                  testing::ExitedWithCode(0x2b),
+                  "");
   }
 }
 #endif
diff --git a/simulator/Android.bp b/simulator/Android.bp
index d29319a..043a1bc 100644
--- a/simulator/Android.bp
+++ b/simulator/Android.bp
@@ -83,34 +83,24 @@
     srcs: [
         "code_simulator_container.cc",
     ],
-    shared_libs: [
-        "libbase",
+    header_libs: [
+        "libart_simulator_headers",
+        "libbase_headers",
+        "libart_headers",
+        "art_libartbase_headers",
     ],
-
-    header_libs: ["libart_simulator_headers"],
     export_include_dirs: ["."], // TODO: Consider a proper separation.
 }
 
-art_cc_library {
+art_cc_library_static {
     name: "libart-simulator-container",
     defaults: ["libart_simulator_container_defaults"],
-    shared_libs: [
-        "libartbase",
-        "libart",
-    ],
 }
 
-art_cc_library {
+art_cc_library_static {
     name: "libartd-simulator-container",
     defaults: [
         "art_debug_defaults",
         "libart_simulator_container_defaults",
     ],
-    shared_libs: [
-        "libartbased",
-        "libartd",
-    ],
-    apex_available: [
-        "com.android.art.debug",
-    ],
 }
diff --git a/test.py b/test.py
index 4ef6592..3f7bd6a 100755
--- a/test.py
+++ b/test.py
@@ -26,8 +26,11 @@
 import argparse
 
 ANDROID_BUILD_TOP = os.environ.get('ANDROID_BUILD_TOP', os.getcwd())
+TEST_RUNNER = 'art/test/testrunner/testrunner.py'
 
-parser = argparse.ArgumentParser()
+parser = argparse.ArgumentParser(
+    description='Test runner wrapper to run ART run tests. All unrecognised ' +
+    'arguments are passed on to ' + TEST_RUNNER + '.')
 parser.add_argument('-j', default='', dest='n_threads', help='specify number of concurrent tests')
 parser.add_argument('--run-test', '-r', action='store_true', dest='run_test', help='execute run tests')
 parser.add_argument('--gtest', '-g', action='store_true', dest='gtest', help='execute gtest tests')
@@ -37,9 +40,7 @@
 options, unknown = parser.parse_known_args()
 
 if options.run_test or options.help_runner or not options.gtest:
-  testrunner = os.path.join('./',
-                          ANDROID_BUILD_TOP,
-                            'art/test/testrunner/testrunner.py')
+  testrunner = os.path.join('./', ANDROID_BUILD_TOP, TEST_RUNNER)
   run_test_args = []
   for arg in sys.argv[1:]:
     if arg == '--run-test' or arg == '--gtest' \
@@ -51,7 +52,7 @@
     run_test_args.append(arg)
 
   test_runner_cmd = [testrunner] + run_test_args
-  print(test_runner_cmd)
+  print(' '.join(test_runner_cmd))
   if subprocess.call(test_runner_cmd) or options.help_runner:
     sys.exit(1)
 
diff --git a/test/004-NativeAllocations/Android.bp b/test/004-NativeAllocations/Android.bp
index 478f611..91a3303 100644
--- a/test/004-NativeAllocations/Android.bp
+++ b/test/004-NativeAllocations/Android.bp
@@ -15,7 +15,7 @@
 java_test {
     name: "art-run-test-004-NativeAllocations",
     defaults: ["art-run-test-defaults"],
-    test_config_template: ":art-run-test-target-template",
+    test_config_template: ":art-run-test-target-no-test-suite-tag-template",
     srcs: ["src-art/**/*.java"],
     data: [
         ":art-run-test-004-NativeAllocations-expected-stdout",
diff --git a/test/004-NativeAllocations/run.py b/test/004-NativeAllocations/run.py
new file mode 100644
index 0000000..dee6ffc
--- /dev/null
+++ b/test/004-NativeAllocations/run.py
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def run(ctx, args):
+  # Test requires a small max free value.
+  ctx.default_run(args, runtime_option=["-XX:HeapMaxFree=2M"])
diff --git a/test/004-NativeAllocations/src-art/Main.java b/test/004-NativeAllocations/src-art/Main.java
index 7bd064c..6731683 100644
--- a/test/004-NativeAllocations/src-art/Main.java
+++ b/test/004-NativeAllocations/src-art/Main.java
@@ -17,6 +17,7 @@
 import java.lang.Runtime;
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.PhantomReference;
+import java.util.concurrent.atomic.AtomicInteger;
 import dalvik.system.VMRuntime;
 
 public class Main {
@@ -36,11 +37,23 @@
         }
     }
 
-    private static void allocateDeadlockingFinalizer() {
+    private static void $noinline$allocateDeadlockingFinalizer() {
         new DeadlockingFinalizer();
     }
 
-    public static PhantomReference allocPhantom(ReferenceQueue<Object> queue) {
+    static AtomicInteger finalizeCounter = new AtomicInteger(0);
+
+    static class IncrementingFinalizer {
+        protected void finalize() throws Exception {
+            finalizeCounter.incrementAndGet();
+        }
+    }
+
+    private static void $noinline$allocateIncrementingFinalizer() {
+        new IncrementingFinalizer();
+    }
+
+    public static PhantomReference $noinline$allocPhantom(ReferenceQueue<Object> queue) {
         return new PhantomReference(new Object(), queue);
     }
 
@@ -50,14 +63,21 @@
         long maxMem = Runtime.getRuntime().maxMemory();
         int size = (int)(maxMem / 32);
         int allocationCount = 256;
+        final long startTime = System.currentTimeMillis();
 
+        int initialFinalizeCount = finalizeCounter.get();
         ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
-        ref = allocPhantom(queue);
+        ref = $noinline$allocPhantom(queue);
         long total = 0;
-        for (int i = 0; !ref.isEnqueued() && i < allocationCount; ++i) {
+        int i;
+        for (i = 0; !ref.isEnqueued() && i < allocationCount; ++i) {
             runtime.registerNativeAllocation(size);
             total += size;
 
+            // Allocate a new finalizable object each time, so that we can see if anything
+            // was finalized while we were running.
+            $noinline$allocateIncrementingFinalizer();
+
             // Sleep a little bit to ensure not all of the calls to
             // registerNativeAllocation complete while GC is in the process of
             // running.
@@ -69,7 +89,22 @@
         // pretty unlikely (though technically still possible) that GC was
         // triggered as intended.
         if (queue.remove(MAX_EXPECTED_GC_DURATION_MS) == null) {
-            throw new RuntimeException("GC failed to complete");
+            System.out.println("GC failed to complete after " + i
+                + " iterations, is_enqueued = " + ref.isEnqueued());
+            System.out.println("  size = " + size + ", elapsed msecs = "
+                + (System.currentTimeMillis() - startTime));
+            System.out.println("  original maxMemory() = " + maxMem + " current maxMemory() = "
+                + Runtime.getRuntime().maxMemory());
+            System.out.println("  Initial finalize count = " + initialFinalizeCount
+                + " current finalize count = " + finalizeCounter.get());
+            Thread.sleep(2 * MAX_EXPECTED_GC_DURATION_MS);
+            System.out.println("  After delay, queue.poll() = " + queue.poll()
+                + " is_enqueued = " + ref.isEnqueued());
+            System.out.println("    elapsed msecs = " + (System.currentTimeMillis() - startTime));
+            Runtime.getRuntime().gc();
+            System.runFinalization();
+            System.out.println("  After GC, queue.poll() = " + queue.poll()
+                + " is_enqueued = " + ref.isEnqueued());
         }
 
         while (total > 0) {
@@ -112,7 +147,7 @@
         // Test that we don't get a deadlock if we call
         // registerNativeAllocation with a blocked finalizer.
         synchronized (deadlockLock) {
-            allocateDeadlockingFinalizer();
+            $noinline$allocateDeadlockingFinalizer();
             while (!aboutToDeadlock) {
                 Runtime.getRuntime().gc();
             }
diff --git a/test/004-SignalTest/signaltest.cc b/test/004-SignalTest/signaltest.cc
index daa31d3..916fb57 100644
--- a/test/004-SignalTest/signaltest.cc
+++ b/test/004-SignalTest/signaltest.cc
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include <android-base/logging.h>
+
 #include <jni.h>
 #include <signal.h>
 #include <stdio.h>
@@ -51,15 +53,15 @@
 #define BLOCKED_SIGNAL SIGUSR1
 #define UNBLOCKED_SIGNAL SIGUSR2
 
-static void blocked_signal(int sig ATTRIBUTE_UNUSED) {
+static void blocked_signal([[maybe_unused]] int sig) {
   printf("blocked signal received\n");
 }
 
-static void unblocked_signal(int sig ATTRIBUTE_UNUSED) {
+static void unblocked_signal([[maybe_unused]] int sig) {
   printf("unblocked signal received\n");
 }
 
-static void signalhandler(int sig ATTRIBUTE_UNUSED, siginfo_t* info ATTRIBUTE_UNUSED,
+static void signalhandler([[maybe_unused]] int sig, [[maybe_unused]] siginfo_t* info,
                           void* context) {
   printf("signal caught\n");
   ++signal_count;
@@ -79,11 +81,15 @@
 #if defined(__arm__)
   ucontext_t* uc = reinterpret_cast<ucontext_t*>(context);
   mcontext_t* mc = reinterpret_cast<mcontext_t*>(&uc->uc_mcontext);
-  mc->arm_pc += 2;          // Skip instruction causing segv.
+  mc->arm_pc += 2;  // Skip instruction causing segv.
 #elif defined(__aarch64__)
   ucontext_t* uc = reinterpret_cast<ucontext_t*>(context);
   mcontext_t* mc = reinterpret_cast<mcontext_t*>(&uc->uc_mcontext);
-  mc->pc += 4;          // Skip instruction causing segv.
+  mc->pc += 4;  // Skip instruction causing segv.
+#elif defined(__riscv)
+  ucontext_t* uc = reinterpret_cast<ucontext_t*>(context);
+  mcontext_t* mc = reinterpret_cast<mcontext_t*>(&uc->uc_mcontext);
+  mc->__gregs[REG_PC] += 4;  // Skip instruction causing segv.
 #elif defined(__i386__)
   ucontext_t* uc = reinterpret_cast<ucontext_t*>(context);
   uc->CTX_EIP += 3;
@@ -92,6 +98,7 @@
   uc->CTX_EIP += 2;
 #else
   UNUSED(context);
+  UNIMPLEMENTED(FATAL) << "Unsupported architecture";
 #endif
 
   printf("signal handler done\n");
@@ -157,6 +164,10 @@
 #if defined(__arm__) || defined(__i386__) || defined(__aarch64__)
   // On supported architectures we cause a real SEGV.
   *go_away_compiler = 'a';
+#elif defined(__riscv)
+  // Cause a SEGV using an instruction known to be 4 bytes long to account for hardcoded jump
+  // in the signal handler
+  asm volatile("ld zero, (zero);" : : :);
 #elif defined(__x86_64__)
   // Cause a SEGV using an instruction known to be 2 bytes long to account for hardcoded jump
   // in the signal handler
diff --git a/test/013-math2/expected-stdout.txt b/test/013-math2/expected-stdout.txt
index 84fb9e2..5b68c0a 100644
--- a/test/013-math2/expected-stdout.txt
+++ b/test/013-math2/expected-stdout.txt
@@ -1,2 +1,6 @@
 a:32003
 b:-31993
+c:0x0000000012345678
+d:0xfffffffffedcba98
+e:0x123456789abcdef0
+f:0xabcd000000000000
diff --git a/test/013-math2/src/Main.java b/test/013-math2/src/Main.java
index 7b8c4e4..0bb0049 100644
--- a/test/013-math2/src/Main.java
+++ b/test/013-math2/src/Main.java
@@ -29,6 +29,30 @@
         b -= 32000;
         System.out.println("a:" + a);
         System.out.println("b:" + b);
+
+        long c = constWide32();
+        System.out.println(String.format("c:0x%016x", c));
+
+        long d = constWide32Neg();
+        System.out.println(String.format("d:0x%016x", d));
+
+        long e = constWide();
+        System.out.println(String.format("e:0x%016x", e));
+
+        long f = constWideHigh16();
+        System.out.println(String.format("f:0x%016x", f));
+    }
+    public static long constWide32() {
+        return 0x12345678;
+    }
+    public static long constWide32Neg() {
+        return 0xfedcba98;
+    }
+    public static long constWide() {
+        return 0x123456789abcdef0L;
+    }
+    public static long constWideHigh16() {
+        return 0xabcd000000000000L;
     }
     public static void main(String args[]) {
         math_013();
diff --git a/test/015-checker-switch/Android.bp b/test/015-checker-switch/Android.bp
new file mode 100644
index 0000000..110dcac
--- /dev/null
+++ b/test/015-checker-switch/Android.bp
@@ -0,0 +1,43 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `015-checker-switch`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-015-checker-switch",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-template",
+    srcs: ["src/**/*.java"],
+    data: [
+        ":art-run-test-015-checker-switch-expected-stdout",
+        ":art-run-test-015-checker-switch-expected-stderr",
+    ],
+    // Include the Java source files in the test's artifacts, to make Checker assertions
+    // available to the TradeFed test runner.
+    include_srcs: true,
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-015-checker-switch-expected-stdout",
+    out: ["art-run-test-015-checker-switch-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-015-checker-switch-expected-stderr",
+    out: ["art-run-test-015-checker-switch-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/test/015-switch/expected-stderr.txt b/test/015-checker-switch/expected-stderr.txt
similarity index 100%
rename from test/015-switch/expected-stderr.txt
rename to test/015-checker-switch/expected-stderr.txt
diff --git a/test/015-switch/expected-stdout.txt b/test/015-checker-switch/expected-stdout.txt
similarity index 83%
rename from test/015-switch/expected-stdout.txt
rename to test/015-checker-switch/expected-stdout.txt
index be6d2ca..371d56b 100644
--- a/test/015-switch/expected-stdout.txt
+++ b/test/015-checker-switch/expected-stdout.txt
@@ -28,15 +28,16 @@
 default
 packed4
 default
+2147483644
+2147483645
 2147483646
 2147483647
 default
 packed5
 -2147483648
 -2147483647
-default
-packed6
--2147483648
+-2147483646
+-2147483645
 default
 packed7
 default
@@ -62,18 +63,18 @@
 default
 0
 1
-default
-3
+2
 default
 default
+2147483647
 sparse2
 -2
 -1
 0
 default
-2
 default
 default
+2147483647
 sparse3
 default
 default
@@ -83,18 +84,22 @@
 default
 4
 5
-6
 default
 default
-sparse4
-2147483645
-default
 2147483647
+sparse4
 default
+2147483645
+2147483646
+2147483647
+-2147483648
 sparse5
 -2147483648
 default
 default
+sparse6
+-2147483648
+default
 sparse7
 default
 default
@@ -103,15 +108,15 @@
 default
 4
 5
-6
-7
-8
-9
-10
-11
-12
-13
-14
+default
+default
+default
+default
+default
+default
+default
+default
+default
 15
 default
 CORRECT (one)
diff --git a/test/015-switch/info.txt b/test/015-checker-switch/info.txt
similarity index 100%
rename from test/015-switch/info.txt
rename to test/015-checker-switch/info.txt
diff --git a/test/015-switch/src/Main.java b/test/015-checker-switch/src/Main.java
similarity index 77%
rename from test/015-switch/src/Main.java
rename to test/015-checker-switch/src/Main.java
index 2b724a1..705c3a4 100644
--- a/test/015-switch/src/Main.java
+++ b/test/015-checker-switch/src/Main.java
@@ -18,12 +18,10 @@
  * Test switch() blocks
  */
 public class Main {
-
-    // TODO: This should be translated to smali tests, so it is guaranteed we have the right kind
-    //       of switch.
-
+    /// CHECK-START: void Main.$noinline$packedSwitch(int) builder (after)
+    /// CHECK: PackedSwitch
     // Simple packed-switch.
-    public static void packedSwitch(int value) {
+    public static void $noinline$packedSwitch(int value) {
         switch (value) {
             case 0:
                 System.out.println("0"); break;
@@ -40,8 +38,10 @@
         }
     }
 
+    /// CHECK-START: void Main.$noinline$packedSwitch2(int) builder (after)
+    /// CHECK: PackedSwitch
     // Simple packed-switch starting at a negative index.
-    public static void packedSwitch2(int value) {
+    public static void $noinline$packedSwitch2(int value) {
         switch (value) {
             case -3:
                 System.out.println("-3"); break;
@@ -60,8 +60,10 @@
         }
     }
 
+    /// CHECK-START: void Main.$noinline$packedSwitch3(int) builder (after)
+    /// CHECK: PackedSwitch
     // Simple packed-switch starting above 0.
-    public static void packedSwitch3(int value) {
+    public static void $noinline$packedSwitch3(int value) {
         switch (value) {
             case 2:
                 System.out.println("2"); break;
@@ -78,9 +80,15 @@
         }
     }
 
+    /// CHECK-START: void Main.$noinline$packedSwitch4(int) builder (after)
+    /// CHECK: PackedSwitch
     // Simple packed-switch going up to max_int.
-    public static void packedSwitch4(int value) {
+    public static void $noinline$packedSwitch4(int value) {
         switch (value) {
+            case Integer.MAX_VALUE - 3:
+                System.out.println(Integer.MAX_VALUE - 3); break;
+            case Integer.MAX_VALUE - 2:
+                System.out.println(Integer.MAX_VALUE - 2); break;
             case Integer.MAX_VALUE - 1:
                 System.out.println(Integer.MAX_VALUE - 1); break;
             case Integer.MAX_VALUE:
@@ -90,30 +98,28 @@
         }
     }
 
+    /// CHECK-START: void Main.$noinline$packedSwitch5(int) builder (after)
+    /// CHECK: PackedSwitch
     // Simple packed-switch starting at min_int.
-    public static void packedSwitch5(int value) {
+    public static void $noinline$packedSwitch5(int value) {
         switch (value) {
             case Integer.MIN_VALUE:
                 System.out.println(Integer.MIN_VALUE); break;
             case Integer.MIN_VALUE + 1:
                 System.out.println(Integer.MIN_VALUE + 1); break;
+            case Integer.MIN_VALUE + 2:
+                System.out.println(Integer.MIN_VALUE + 2); break;
+            case Integer.MIN_VALUE + 3:
+                System.out.println(Integer.MIN_VALUE + 3); break;
             default:
                 System.out.println("default"); break;
         }
     }
 
-    // Simple (packed-)switch with only min_int.
-    public static void packedSwitch6(int value) {
-        switch (value) {
-            case Integer.MIN_VALUE:
-                System.out.println(Integer.MIN_VALUE); break;
-            default:
-                System.out.println("default"); break;
-        }
-    }
-
+    /// CHECK-START: long Main.$noinline$packedSwitch7(int) builder (after)
+    /// CHECK: PackedSwitch
     // Long packed-switch that might lead to not creating chained-ifs.
-    public static long packedSwitch7(int value) {
+    public static long $noinline$packedSwitch7(int value) {
         switch (value) {
             case 1:
                 System.out.println(1); break;
@@ -257,24 +263,28 @@
         return temp;
     }
 
-    // Sparse switch, just leave a gap.
-    public static void sparseSwitch(int value) {
+    /// CHECK-START: void Main.$noinline$sparseSwitch(int) builder (after)
+    /// CHECK-NOT: PackedSwitch
+    // Sparse switch, just leave a large gap.
+    public static void $noinline$sparseSwitch(int value) {
         switch (value) {
             case 0:
                 System.out.println("0"); break;
             case 1:
                 System.out.println("1"); break;
-            case 3:
-                System.out.println("3"); break;
-            case 4:
-                System.out.println("4"); break;
+            case 2:
+                System.out.println("2"); break;
+            case Integer.MAX_VALUE:
+                System.out.println(Integer.MAX_VALUE); break;
             default:
                 System.out.println("default"); break;
         }
     }
 
+    /// CHECK-START: void Main.$noinline$sparseSwitch2(int) builder (after)
+    /// CHECK-NOT: PackedSwitch
     // Simple sparse-switch starting at a negative index.
-    public static void sparseSwitch2(int value) {
+    public static void $noinline$sparseSwitch2(int value) {
         switch (value) {
             case -3:
                 System.out.println("-3"); break;
@@ -284,34 +294,6 @@
                 System.out.println("-1"); break;
             case 0:
                 System.out.println("0"); break;
-            case 2:
-                System.out.println("2"); break;
-            default:
-                System.out.println("default"); break;
-        }
-    }
-
-    // Simple sparse-switch starting above 0.
-    public static void sparseSwitch3(int value) {
-        switch (value) {
-            case 2:
-                System.out.println("2"); break;
-            case 4:
-                System.out.println("4"); break;
-            case 5:
-                System.out.println("5"); break;
-            case 6:
-                System.out.println("6"); break;
-            default:
-                System.out.println("default"); break;
-        }
-    }
-
-    // Simple sparse-switch going up to max_int.
-    public static void sparseSwitch4(int value) {
-        switch (value) {
-            case Integer.MAX_VALUE - 2:
-                System.out.println(Integer.MAX_VALUE - 2); break;
             case Integer.MAX_VALUE:
                 System.out.println(Integer.MAX_VALUE); break;
             default:
@@ -319,8 +301,46 @@
         }
     }
 
+    /// CHECK-START: void Main.$noinline$sparseSwitch3(int) builder (after)
+    /// CHECK-NOT: PackedSwitch
+    // Simple sparse-switch starting above 0.
+    public static void $noinline$sparseSwitch3(int value) {
+        switch (value) {
+            case 2:
+                System.out.println("2"); break;
+            case 4:
+                System.out.println("4"); break;
+            case 5:
+                System.out.println("5"); break;
+            case Integer.MAX_VALUE:
+                System.out.println(Integer.MAX_VALUE); break;
+            default:
+                System.out.println("default"); break;
+        }
+    }
+
+    /// CHECK-START: void Main.$noinline$sparseSwitch4(int) builder (after)
+    /// CHECK-NOT: PackedSwitch
+    // Simple sparse-switch going up to max_int.
+    public static void $noinline$sparseSwitch4(int value) {
+        switch (value) {
+            case Integer.MIN_VALUE:
+                System.out.println(Integer.MIN_VALUE); break;
+            case Integer.MAX_VALUE - 2:
+                System.out.println(Integer.MAX_VALUE - 2); break;
+            case Integer.MAX_VALUE - 1:
+                System.out.println(Integer.MAX_VALUE - 1); break;
+            case Integer.MAX_VALUE:
+                System.out.println(Integer.MAX_VALUE); break;
+            default:
+                System.out.println("default"); break;
+        }
+    }
+
+    /// CHECK-START: void Main.$noinline$sparseSwitch5(int) builder (after)
+    /// CHECK-NOT: PackedSwitch
     // Simple sparse-switch starting at min_int.
-    public static void sparseSwitch5(int value) {
+    public static void $noinline$sparseSwitch5(int value) {
         switch (value) {
             case Integer.MIN_VALUE:
                 System.out.println(Integer.MIN_VALUE); break;
@@ -331,8 +351,23 @@
         }
     }
 
+    /// CHECK-START: void Main.$noinline$sparseSwitch6(int) builder (after)
+    /// CHECK-NOT: PackedSwitch
+    // Simple switch with only min_int. It is sparse since it has less than kSmallSwitchThreshold
+    // values.
+    public static void $noinline$sparseSwitch6(int value) {
+        switch (value) {
+            case Integer.MIN_VALUE:
+                System.out.println(Integer.MIN_VALUE); break;
+            default:
+                System.out.println("default"); break;
+        }
+    }
+
+    /// CHECK-START: void Main.$noinline$sparseSwitch7(int) builder (after)
+    /// CHECK-NOT: PackedSwitch
     // Long sparse-switch that might lead to not creating chained-ifs.
-    public static void sparseSwitch7(int value) {
+    public static void $noinline$sparseSwitch7(int value) {
         switch (value) {
             case 1:
                 System.out.println(1); break;
@@ -342,24 +377,6 @@
                 System.out.println(4); break;
             case 5:
                 System.out.println(5); break;
-            case 6:
-                System.out.println(6); break;
-            case 7:
-                System.out.println(7); break;
-            case 8:
-                System.out.println(8); break;
-            case 9:
-                System.out.println(9); break;
-            case 10:
-                System.out.println(10); break;
-            case 11:
-                System.out.println(11); break;
-            case 12:
-                System.out.println(12); break;
-            case 13:
-                System.out.println(13); break;
-            case 14:
-                System.out.println(14); break;
             case 15:
                 System.out.println(15); break;
             default:
@@ -368,91 +385,85 @@
     }
 
     public static void main(String args[]) {
-        /*
-         * Note: We are using for loops and calls to hopefully avoid simplifying the switch
-         *       structure from constant propagation. When inlining is supported, this needs to
-         *       be revisited.
-         */
-
         System.out.println("packed");
         for (int i = -2; i < 3; i++) {
-            packedSwitch(i);
+            $noinline$packedSwitch(i);
         }
-        packedSwitch(Integer.MIN_VALUE);
-        packedSwitch(Integer.MAX_VALUE);
+        $noinline$packedSwitch(Integer.MIN_VALUE);
+        $noinline$packedSwitch(Integer.MAX_VALUE);
 
         System.out.println("packed2");
         for (int i = -2; i < 3; i++) {
-            packedSwitch2(i);
+            $noinline$packedSwitch2(i);
         }
-        packedSwitch2(Integer.MIN_VALUE);
-        packedSwitch2(Integer.MAX_VALUE);
+        $noinline$packedSwitch2(Integer.MIN_VALUE);
+        $noinline$packedSwitch2(Integer.MAX_VALUE);
 
         System.out.println("packed3");
         for (int i = -2; i < 7; i++) {
-            packedSwitch3(i);
+            $noinline$packedSwitch3(i);
         }
-        packedSwitch3(Integer.MIN_VALUE);
-        packedSwitch3(Integer.MAX_VALUE);
+        $noinline$packedSwitch3(Integer.MIN_VALUE);
+        $noinline$packedSwitch3(Integer.MAX_VALUE);
 
         System.out.println("packed4");
-        for (int i = Integer.MAX_VALUE - 2; i > 0; i++) {
-            packedSwitch4(i);
+        for (int i = Integer.MAX_VALUE - 4; i > 0; i++) {
+            $noinline$packedSwitch4(i);
         }
-        packedSwitch4(Integer.MIN_VALUE);
+        $noinline$packedSwitch4(Integer.MIN_VALUE);
 
         System.out.println("packed5");
-        for (int i = Integer.MIN_VALUE; i < Integer.MIN_VALUE + 2; i++) {
-            packedSwitch5(i);
+        for (int i = Integer.MIN_VALUE; i < Integer.MIN_VALUE + 4; i++) {
+            $noinline$packedSwitch5(i);
         }
-        packedSwitch5(Integer.MAX_VALUE);
-
-        System.out.println("packed6");
-        packedSwitch6(Integer.MIN_VALUE);
-        packedSwitch6(Integer.MAX_VALUE);
+        $noinline$packedSwitch5(Integer.MAX_VALUE);
 
         System.out.println("packed7");
         for (int i = -1; i < 17; i++) {
-            packedSwitch7(i);
+            $noinline$packedSwitch7(i);
         }
 
 
         System.out.println("sparse");
         for (int i = -2; i < 4; i++) {
-            sparseSwitch(i);
+            $noinline$sparseSwitch(i);
         }
-        sparseSwitch(Integer.MIN_VALUE);
-        sparseSwitch(Integer.MAX_VALUE);
+        $noinline$sparseSwitch(Integer.MIN_VALUE);
+        $noinline$sparseSwitch(Integer.MAX_VALUE);
 
         System.out.println("sparse2");
         for (int i = -2; i < 3; i++) {
-            sparseSwitch2(i);
+            $noinline$sparseSwitch2(i);
         }
-        sparseSwitch2(Integer.MIN_VALUE);
-        sparseSwitch2(Integer.MAX_VALUE);
+        $noinline$sparseSwitch2(Integer.MIN_VALUE);
+        $noinline$sparseSwitch2(Integer.MAX_VALUE);
 
         System.out.println("sparse3");
         for (int i = -2; i < 7; i++) {
-            sparseSwitch3(i);
+            $noinline$sparseSwitch3(i);
         }
-        sparseSwitch3(Integer.MIN_VALUE);
-        sparseSwitch3(Integer.MAX_VALUE);
+        $noinline$sparseSwitch3(Integer.MIN_VALUE);
+        $noinline$sparseSwitch3(Integer.MAX_VALUE);
 
         System.out.println("sparse4");
-        for (int i = Integer.MAX_VALUE - 2; i > 0; i++) {
-            sparseSwitch4(i);
+        for (int i = Integer.MAX_VALUE - 3; i > 0; i++) {
+            $noinline$sparseSwitch4(i);
         }
-        sparseSwitch4(Integer.MIN_VALUE);
+        $noinline$sparseSwitch4(Integer.MIN_VALUE);
 
         System.out.println("sparse5");
         for (int i = Integer.MIN_VALUE; i < Integer.MIN_VALUE + 2; i++) {
-            sparseSwitch5(i);
+            $noinline$sparseSwitch5(i);
         }
-        sparseSwitch5(Integer.MAX_VALUE);
+        $noinline$sparseSwitch5(Integer.MAX_VALUE);
+
+        System.out.println("sparse6");
+        $noinline$sparseSwitch6(Integer.MIN_VALUE);
+        $noinline$sparseSwitch6(Integer.MAX_VALUE);
 
         System.out.println("sparse7");
         for (int i = -1; i < 17; i++) {
-            sparseSwitch7(i);
+            $noinline$sparseSwitch7(i);
         }
 
         // Older tests.
diff --git a/test/018-stack-overflow/test-metadata.json b/test/018-stack-overflow/test-metadata.json
index 975ada7..4d699c0 100644
--- a/test/018-stack-overflow/test-metadata.json
+++ b/test/018-stack-overflow/test-metadata.json
@@ -1,3 +1,3 @@
 {
-  "test_suites": ["cts"]
+  "test_suites": ["cts", "mcts-art"]
 }
diff --git a/test/024-illegal-access/Android.bp b/test/024-illegal-access/Android.bp
index 7ed1a67..956f799 100644
--- a/test/024-illegal-access/Android.bp
+++ b/test/024-illegal-access/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-024-illegal-access-src"
+        "art-run-test-024-illegal-access-src",
     ],
     data: [
         ":art-run-test-024-illegal-access-expected-stdout",
diff --git a/test/032-concrete-sub/Android.bp b/test/032-concrete-sub/Android.bp
index f4c43f8..236137e 100644
--- a/test/032-concrete-sub/Android.bp
+++ b/test/032-concrete-sub/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-032-concrete-sub-src"
+        "art-run-test-032-concrete-sub-src",
     ],
     data: [
         ":art-run-test-032-concrete-sub-expected-stdout",
diff --git a/test/042-new-instance/Android.bp b/test/042-new-instance/Android.bp
index fd777be..c2c40dd 100644
--- a/test/042-new-instance/Android.bp
+++ b/test/042-new-instance/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-042-new-instance-src"
+        "art-run-test-042-new-instance-src",
     ],
     data: [
         ":art-run-test-042-new-instance-expected-stdout",
diff --git a/test/044-proxy/native_proxy.cc b/test/044-proxy/native_proxy.cc
index f3178f9..e86c5a8 100644
--- a/test/044-proxy/native_proxy.cc
+++ b/test/044-proxy/native_proxy.cc
@@ -21,7 +21,7 @@
 namespace art {
 
 extern "C" JNIEXPORT void JNICALL Java_NativeProxy_nativeCall(
-    JNIEnv* env, jclass clazz ATTRIBUTE_UNUSED, jobject inf_ref) {
+    JNIEnv* env, [[maybe_unused]] jclass clazz, jobject inf_ref) {
   jclass native_inf_class = env->FindClass("NativeInterface");
   CHECK(native_inf_class != nullptr);
   jmethodID mid = env->GetMethodID(native_inf_class, "callback", "()V");
diff --git a/test/048-reflect-v8/test-metadata.json b/test/048-reflect-v8/test-metadata.json
index 975ada7..4d699c0 100644
--- a/test/048-reflect-v8/test-metadata.json
+++ b/test/048-reflect-v8/test-metadata.json
@@ -1,3 +1,3 @@
 {
-  "test_suites": ["cts"]
+  "test_suites": ["cts", "mcts-art"]
 }
diff --git a/test/051-thread/run.py b/test/051-thread/run.py
new file mode 100644
index 0000000..918e076
--- /dev/null
+++ b/test/051-thread/run.py
@@ -0,0 +1,26 @@
+#
+# Copyright 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import os
+
+
+def run(ctx, args):
+  ctx.default_run(args)
+  if os.environ.get("ART_TEST_ON_VM"):
+    # On Linux, max thread priority is not the same as on Android, but otherwise
+    # test results are the same. Cut the offending line to make the test pass.
+    line = "thread priority for t[12] was 5 \[expected Thread.MAX_PRIORITY\]"
+    ctx.run(fr"sed -i -E '/{line}/d' '{args.stdout_file}'")
diff --git a/test/051-thread/thread_test.cc b/test/051-thread/thread_test.cc
index 33841eb..6c70923 100644
--- a/test/051-thread/thread_test.cc
+++ b/test/051-thread/thread_test.cc
@@ -21,13 +21,12 @@
 namespace art {
 
 extern "C" JNIEXPORT jint JNICALL Java_Main_getNativePriority(JNIEnv* env,
-                                                              jclass clazz ATTRIBUTE_UNUSED) {
+                                                              [[maybe_unused]] jclass clazz) {
   return Thread::ForEnv(env)->GetNativePriority();
 }
 
 extern "C" JNIEXPORT jboolean JNICALL Java_Main_supportsThreadPriorities(
-    JNIEnv* env ATTRIBUTE_UNUSED,
-    jclass clazz ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass clazz) {
 #if defined(ART_TARGET_ANDROID)
   return JNI_TRUE;
 #else
diff --git a/test/069-field-type/Android.bp b/test/069-field-type/Android.bp
index c407a92..4f7acf7 100644
--- a/test/069-field-type/Android.bp
+++ b/test/069-field-type/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-069-field-type-src"
+        "art-run-test-069-field-type-src",
     ],
     data: [
         ":art-run-test-069-field-type-expected-stdout",
diff --git a/test/073-mismatched-field/Android.bp b/test/073-mismatched-field/Android.bp
index 16ca7da..83f9d6d 100644
--- a/test/073-mismatched-field/Android.bp
+++ b/test/073-mismatched-field/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-073-mismatched-field-src"
+        "art-run-test-073-mismatched-field-src",
     ],
     data: [
         ":art-run-test-073-mismatched-field-expected-stdout",
diff --git a/test/075-verification-error/Android.bp b/test/075-verification-error/Android.bp
index ab87fc8..6d024a9 100644
--- a/test/075-verification-error/Android.bp
+++ b/test/075-verification-error/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-075-verification-error-src"
+        "art-run-test-075-verification-error-src",
     ],
     data: [
         ":art-run-test-075-verification-error-expected-stdout",
diff --git a/test/077-method-override/Android.bp b/test/077-method-override/Android.bp
index f33a9ac..0bf8ecc 100644
--- a/test/077-method-override/Android.bp
+++ b/test/077-method-override/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-077-method-override-src"
+        "art-run-test-077-method-override-src",
     ],
     data: [
         ":art-run-test-077-method-override-expected-stdout",
diff --git a/test/099-vmdebug/run.py b/test/099-vmdebug/run.py
index 4492f36..e3eac8d 100644
--- a/test/099-vmdebug/run.py
+++ b/test/099-vmdebug/run.py
@@ -19,4 +19,4 @@
   ctx.default_run(args)
 
   # Strip the process pids and line numbers from exact error messages.
-  ctx.run(fr"sed -i '/^.*dalvikvm\(\|32\|64\) E.*\] /d' '{args.stderr_file}'")
+  ctx.run(fr"sed -i '/^.* E dalvikvm\(\|32\|64\): .*/d' '{args.stderr_file}'")
diff --git a/test/100-reflect2/expected-stdout.txt b/test/100-reflect2/expected-stdout.txt
index ca85392..d152468 100644
--- a/test/100-reflect2/expected-stdout.txt
+++ b/test/100-reflect2/expected-stdout.txt
@@ -32,10 +32,10 @@
 62 (class java.lang.Long)
 14 (class java.lang.Short)
 [java.lang.String(byte[],byte), java.lang.String(int,int,char[]), public java.lang.String(), public java.lang.String(byte[]), public java.lang.String(byte[],int), public java.lang.String(byte[],int,int), public java.lang.String(byte[],int,int,int), public java.lang.String(byte[],int,int,java.lang.String) throws java.io.UnsupportedEncodingException, public java.lang.String(byte[],int,int,java.nio.charset.Charset), public java.lang.String(byte[],java.lang.String) throws java.io.UnsupportedEncodingException, public java.lang.String(byte[],java.nio.charset.Charset), public java.lang.String(char[]), public java.lang.String(char[],int,int), public java.lang.String(int[],int,int), public java.lang.String(java.lang.String), public java.lang.String(java.lang.StringBuffer), public java.lang.String(java.lang.StringBuilder)]
-[private final int java.lang.String.count, private int java.lang.String.hash, private static final java.io.ObjectStreamField[] java.lang.String.serialPersistentFields, private static final long java.lang.String.serialVersionUID, public static final java.util.Comparator java.lang.String.CASE_INSENSITIVE_ORDER, static final boolean java.lang.String.COMPACT_STRINGS, static final byte java.lang.String.LATIN1, static final byte java.lang.String.UTF16]
-[byte java.lang.String.coder(), native void java.lang.String.getCharsNoCheck(int,int,char[],int), private boolean java.lang.String.nonSyncContentEquals(java.lang.AbstractStringBuilder), private int java.lang.String.indexOfNonWhitespace(), private int java.lang.String.indexOfSupplementary(int,int), private int java.lang.String.lastIndexOfNonWhitespace(), private int java.lang.String.lastIndexOfSupplementary(int,int), private native java.lang.String java.lang.String.doRepeat(int), private native java.lang.String java.lang.String.doReplace(char,char), private native java.lang.String java.lang.String.fastSubstring(int,int), private native void java.lang.String.fillBytesLatin1(byte[],int), private native void java.lang.String.fillBytesUTF16(byte[],int), private static int java.lang.String.indexOf(java.lang.String,java.lang.String,int), private static int java.lang.String.lastIndexOf(java.lang.String,java.lang.String,int), private static int java.lang.String.outdent(java.util.List), public boolean java.lang.String.contains(java.lang.CharSequence), public boolean java.lang.String.contentEquals(java.lang.CharSequence), public boolean java.lang.String.contentEquals(java.lang.StringBuffer), public boolean java.lang.String.endsWith(java.lang.String), public boolean java.lang.String.equals(java.lang.Object), public boolean java.lang.String.equalsIgnoreCase(java.lang.String), public boolean java.lang.String.isBlank(), public boolean java.lang.String.isEmpty(), public boolean java.lang.String.matches(java.lang.String), public boolean java.lang.String.regionMatches(boolean,int,java.lang.String,int,int), public boolean java.lang.String.regionMatches(int,java.lang.String,int,int), public boolean java.lang.String.startsWith(java.lang.String), public boolean java.lang.String.startsWith(java.lang.String,int), public byte[] java.lang.String.getBytes(), public byte[] java.lang.String.getBytes(java.lang.String) throws java.io.UnsupportedEncodingException, public byte[] java.lang.String.getBytes(java.nio.charset.Charset), public int java.lang.String.codePointAt(int), public int java.lang.String.codePointBefore(int), public int java.lang.String.codePointCount(int,int), public int java.lang.String.compareTo(java.lang.Object), public int java.lang.String.compareToIgnoreCase(java.lang.String), public int java.lang.String.hashCode(), public int java.lang.String.indexOf(int), public int java.lang.String.indexOf(int,int), public int java.lang.String.indexOf(java.lang.String), public int java.lang.String.indexOf(java.lang.String,int), public int java.lang.String.lastIndexOf(int), public int java.lang.String.lastIndexOf(int,int), public int java.lang.String.lastIndexOf(java.lang.String), public int java.lang.String.lastIndexOf(java.lang.String,int), public int java.lang.String.length(), public int java.lang.String.offsetByCodePoints(int,int), public java.lang.CharSequence java.lang.String.subSequence(int,int), public java.lang.Object java.lang.String.transform(java.util.function.Function), public java.lang.String java.lang.String.formatted(java.lang.Object[]), public java.lang.String java.lang.String.indent(int), public java.lang.String java.lang.String.repeat(int), public java.lang.String java.lang.String.replace(char,char), public java.lang.String java.lang.String.replace(java.lang.CharSequence,java.lang.CharSequence), public java.lang.String java.lang.String.replaceAll(java.lang.String,java.lang.String), public java.lang.String java.lang.String.replaceFirst(java.lang.String,java.lang.String), public java.lang.String java.lang.String.strip(), public java.lang.String java.lang.String.stripIndent(), public java.lang.String java.lang.String.stripLeading(), public java.lang.String java.lang.String.stripTrailing(), public java.lang.String java.lang.String.substring(int), public java.lang.String java.lang.String.substring(int,int), public java.lang.String java.lang.String.toLowerCase(), public java.lang.String java.lang.String.toLowerCase(java.util.Locale), public java.lang.String java.lang.String.toString(), public java.lang.String java.lang.String.toUpperCase(), public java.lang.String java.lang.String.toUpperCase(java.util.Locale), public java.lang.String java.lang.String.translateEscapes(), public java.lang.String java.lang.String.trim(), public java.lang.String[] java.lang.String.split(java.lang.String), public java.lang.String[] java.lang.String.split(java.lang.String,int), public java.util.stream.IntStream java.lang.String.chars(), public java.util.stream.IntStream java.lang.String.codePoints(), public java.util.stream.Stream java.lang.String.lines(), public native char java.lang.String.charAt(int), public native char[] java.lang.String.toCharArray(), public native int java.lang.String.compareTo(java.lang.String), public native java.lang.String java.lang.String.concat(java.lang.String), public native java.lang.String java.lang.String.intern(), public static java.lang.String java.lang.String.copyValueOf(char[]), public static java.lang.String java.lang.String.copyValueOf(char[],int,int), public static java.lang.String java.lang.String.format(java.lang.String,java.lang.Object[]), public static java.lang.String java.lang.String.format(java.util.Locale,java.lang.String,java.lang.Object[]), public static java.lang.String java.lang.String.join(java.lang.CharSequence,java.lang.CharSequence[]), public static java.lang.String java.lang.String.join(java.lang.CharSequence,java.lang.Iterable), public static java.lang.String java.lang.String.valueOf(boolean), public static java.lang.String java.lang.String.valueOf(char), public static java.lang.String java.lang.String.valueOf(char[]), public static java.lang.String java.lang.String.valueOf(char[],int,int), public static java.lang.String java.lang.String.valueOf(double), public static java.lang.String java.lang.String.valueOf(float), public static java.lang.String java.lang.String.valueOf(int), public static java.lang.String java.lang.String.valueOf(java.lang.Object), public static java.lang.String java.lang.String.valueOf(long), public void java.lang.String.getBytes(int,int,byte[],int), public void java.lang.String.getChars(int,int,char[],int), static int java.lang.String.indexOf(byte[],byte,int,java.lang.String,int), static int java.lang.String.lastIndexOf(byte[],byte,int,java.lang.String,int), static int java.lang.String.lastIndexOf(char[],int,int,char[],int,int,int), static java.lang.String java.lang.String.lambda$indent$0(java.lang.String,java.lang.String), static java.lang.String java.lang.String.lambda$indent$1(java.lang.String), static java.lang.String java.lang.String.lambda$indent$2(int,java.lang.String), static java.lang.String java.lang.String.lambda$stripIndent$3(int,java.lang.String), static void java.lang.String.checkBoundsBeginEnd(int,int,int), static void java.lang.String.checkBoundsOffCount(int,int,int), static void java.lang.String.checkIndex(int,int), static void java.lang.String.checkOffset(int,int), void java.lang.String.getBytes(byte[],int,byte), void java.lang.String.getChars(char[],int)]
+[private final int java.lang.String.count, private int java.lang.String.hash, private static final java.io.ObjectStreamField[] java.lang.String.serialPersistentFields, private static final long java.lang.String.serialVersionUID, public static final java.lang.String java.lang.String.EMPTY, public static final java.util.Comparator java.lang.String.CASE_INSENSITIVE_ORDER, static final boolean java.lang.String.COMPACT_STRINGS, static final byte java.lang.String.LATIN1, static final byte java.lang.String.UTF16]
+[byte java.lang.String.coder(), native void java.lang.String.getCharsNoCheck(int,int,char[],int), private boolean java.lang.String.nonSyncContentEquals(java.lang.AbstractStringBuilder), private int java.lang.String.indexOfNonWhitespace(), private int java.lang.String.indexOfSupplementary(int,int), private int java.lang.String.lastIndexOfNonWhitespace(), private int java.lang.String.lastIndexOfSupplementary(int,int), private native java.lang.String java.lang.String.doRepeat(int), private native java.lang.String java.lang.String.doReplace(char,char), private native java.lang.String java.lang.String.fastSubstring(int,int), private native void java.lang.String.fillBytesLatin1(byte[],int), private native void java.lang.String.fillBytesUTF16(byte[],int), private static int java.lang.String.indexOf(java.lang.String,java.lang.String,int), private static int java.lang.String.lastIndexOf(java.lang.String,java.lang.String,int), private static int java.lang.String.outdent(java.util.List), public boolean java.lang.String.contains(java.lang.CharSequence), public boolean java.lang.String.contentEquals(java.lang.CharSequence), public boolean java.lang.String.contentEquals(java.lang.StringBuffer), public boolean java.lang.String.endsWith(java.lang.String), public boolean java.lang.String.equals(java.lang.Object), public boolean java.lang.String.equalsIgnoreCase(java.lang.String), public boolean java.lang.String.isBlank(), public boolean java.lang.String.isEmpty(), public boolean java.lang.String.matches(java.lang.String), public boolean java.lang.String.regionMatches(boolean,int,java.lang.String,int,int), public boolean java.lang.String.regionMatches(int,java.lang.String,int,int), public boolean java.lang.String.startsWith(java.lang.String), public boolean java.lang.String.startsWith(java.lang.String,int), public byte[] java.lang.String.getBytes(), public byte[] java.lang.String.getBytes(java.lang.String) throws java.io.UnsupportedEncodingException, public byte[] java.lang.String.getBytes(java.nio.charset.Charset), public int java.lang.String.codePointAt(int), public int java.lang.String.codePointBefore(int), public int java.lang.String.codePointCount(int,int), public int java.lang.String.compareTo(java.lang.Object), public int java.lang.String.compareToIgnoreCase(java.lang.String), public int java.lang.String.hashCode(), public int java.lang.String.indexOf(int), public int java.lang.String.indexOf(int,int), public int java.lang.String.indexOf(java.lang.String), public int java.lang.String.indexOf(java.lang.String,int), public int java.lang.String.lastIndexOf(int), public int java.lang.String.lastIndexOf(int,int), public int java.lang.String.lastIndexOf(java.lang.String), public int java.lang.String.lastIndexOf(java.lang.String,int), public int java.lang.String.length(), public int java.lang.String.offsetByCodePoints(int,int), public java.lang.CharSequence java.lang.String.subSequence(int,int), public java.lang.Object java.lang.String.resolveConstantDesc(java.lang.invoke.MethodHandles$Lookup) throws java.lang.ReflectiveOperationException, public java.lang.Object java.lang.String.transform(java.util.function.Function), public java.lang.String java.lang.String.formatted(java.lang.Object[]), public java.lang.String java.lang.String.indent(int), public java.lang.String java.lang.String.repeat(int), public java.lang.String java.lang.String.replace(char,char), public java.lang.String java.lang.String.replace(java.lang.CharSequence,java.lang.CharSequence), public java.lang.String java.lang.String.replaceAll(java.lang.String,java.lang.String), public java.lang.String java.lang.String.replaceFirst(java.lang.String,java.lang.String), public java.lang.String java.lang.String.resolveConstantDesc(java.lang.invoke.MethodHandles$Lookup), public java.lang.String java.lang.String.strip(), public java.lang.String java.lang.String.stripIndent(), public java.lang.String java.lang.String.stripLeading(), public java.lang.String java.lang.String.stripTrailing(), public java.lang.String java.lang.String.substring(int), public java.lang.String java.lang.String.substring(int,int), public java.lang.String java.lang.String.toLowerCase(), public java.lang.String java.lang.String.toLowerCase(java.util.Locale), public java.lang.String java.lang.String.toString(), public java.lang.String java.lang.String.toUpperCase(), public java.lang.String java.lang.String.toUpperCase(java.util.Locale), public java.lang.String java.lang.String.translateEscapes(), public java.lang.String java.lang.String.trim(), public java.lang.String[] java.lang.String.split(java.lang.String), public java.lang.String[] java.lang.String.split(java.lang.String,int), public java.util.Optional java.lang.String.describeConstable(), public java.util.stream.IntStream java.lang.String.chars(), public java.util.stream.IntStream java.lang.String.codePoints(), public java.util.stream.Stream java.lang.String.lines(), public native char java.lang.String.charAt(int), public native char[] java.lang.String.toCharArray(), public native int java.lang.String.compareTo(java.lang.String), public native java.lang.String java.lang.String.concat(java.lang.String), public native java.lang.String java.lang.String.intern(), public static java.lang.String java.lang.String.copyValueOf(char[]), public static java.lang.String java.lang.String.copyValueOf(char[],int,int), public static java.lang.String java.lang.String.format(java.lang.String,java.lang.Object[]), public static java.lang.String java.lang.String.format(java.util.Locale,java.lang.String,java.lang.Object[]), public static java.lang.String java.lang.String.join(java.lang.CharSequence,java.lang.CharSequence[]), public static java.lang.String java.lang.String.join(java.lang.CharSequence,java.lang.Iterable), public static java.lang.String java.lang.String.valueOf(boolean), public static java.lang.String java.lang.String.valueOf(char), public static java.lang.String java.lang.String.valueOf(char[]), public static java.lang.String java.lang.String.valueOf(char[],int,int), public static java.lang.String java.lang.String.valueOf(double), public static java.lang.String java.lang.String.valueOf(float), public static java.lang.String java.lang.String.valueOf(int), public static java.lang.String java.lang.String.valueOf(java.lang.Object), public static java.lang.String java.lang.String.valueOf(long), public void java.lang.String.getBytes(int,int,byte[],int), public void java.lang.String.getChars(int,int,char[],int), static int java.lang.String.indexOf(byte[],byte,int,java.lang.String,int), static int java.lang.String.lastIndexOf(byte[],byte,int,java.lang.String,int), static int java.lang.String.lastIndexOf(char[],int,int,char[],int,int,int), static java.lang.String java.lang.String.lambda$indent$0(java.lang.String,java.lang.String), static java.lang.String java.lang.String.lambda$indent$1(java.lang.String), static java.lang.String java.lang.String.lambda$indent$2(int,java.lang.String), static java.lang.String java.lang.String.lambda$stripIndent$3(int,java.lang.String), static java.lang.String java.lang.String.valueOfCodePoint(int), static void java.lang.String.checkBoundsBeginEnd(int,int,int), static void java.lang.String.checkBoundsOffCount(int,int,int), static void java.lang.String.checkIndex(int,int), static void java.lang.String.checkOffset(int,int), void java.lang.String.getBytes(byte[],int,byte), void java.lang.String.getChars(char[],int)]
 []
-[interface java.io.Serializable, interface java.lang.Comparable, interface java.lang.CharSequence]
+[interface java.io.Serializable, interface java.lang.Comparable, interface java.lang.CharSequence, interface java.lang.constant.Constable, interface java.lang.constant.ConstantDesc]
 0
 17
 false
diff --git a/test/1001-app-image-regions/app_image_regions.cc b/test/1001-app-image-regions/app_image_regions.cc
index dc16a84..976f295 100644
--- a/test/1001-app-image-regions/app_image_regions.cc
+++ b/test/1001-app-image-regions/app_image_regions.cc
@@ -18,10 +18,10 @@
 
 #include "gc/heap.h"
 #include "gc/space/image_space.h"
-#include "gc/space/space-inl.h"
 #include "gc/space/region_space.h"
-#include "image.h"
+#include "gc/space/space-inl.h"
 #include "mirror/class.h"
+#include "oat/image.h"
 #include "runtime.h"
 #include "scoped_thread_state_change-inl.h"
 
diff --git a/test/1004-checker-volatile-ref-load/info.txt b/test/1004-checker-volatile-ref-load/info.txt
index 1ba4a52..80ef530 100644
--- a/test/1004-checker-volatile-ref-load/info.txt
+++ b/test/1004-checker-volatile-ref-load/info.txt
@@ -2,5 +2,5 @@
 emitted for a volatile field load on ARM64 at the beginning of the
 Baker read barrier thunk, so that a null holder object is properly
 caught (and throws a NullPointerException as expected), instead of
-trigerring a SIGSEGV, when the Concurrent Copying GC is in the marking
+triggering a SIGSEGV, when the Concurrent Copying GC is in the marking
 phase.
diff --git a/test/1004-checker-volatile-ref-load/src/Main.java b/test/1004-checker-volatile-ref-load/src/Main.java
index 6455e3e..c3d55ce 100644
--- a/test/1004-checker-volatile-ref-load/src/Main.java
+++ b/test/1004-checker-volatile-ref-load/src/Main.java
@@ -36,23 +36,20 @@
   /// CHECK:       <<Foo:l\d+>> InstanceFieldGet [{{l\d+}}] field_name:Main.foo field_type:Reference loop:<<Loop:B\d+>>
   /// CHECK:       NullCheck [<<Foo>>] dex_pc:<<PC:\d+>> loop:<<Loop>>
   /// CHECK-NEXT:  InstanceFieldGet [<<Foo>>] dex_pc:<<PC>> field_name:Foo.bar field_type:Reference loop:<<Loop>>
-  /* The following following Checker assertions are only valid when the compiler is emitting Baker
-     read barriers, i.e. when ART is using the Concurrent Copying (CC) garbage collector.
-
-     TODO(b/283392413, b/283780888): Re-enable the following Checker assertions (by replacing the
-     double forward slash comments with triple forward slash ones) when b/283780888 is resolved.
-
-  // CHECK-NEXT:      add w<<BaseRegNum:\d+>>, {{w\d+}}, #0x8 (8)
-  // CHECK-NEXT:      adr lr, #+0x{{c|10}}
-  // The following instruction (generated by
-  // `art::arm64::CodeGeneratorARM64::EmitBakerReadBarrierCbnz`) checks the
-  // Marking Register (X20) and goes into the Baker read barrier thunk if MR is
-  // not null. The null offset (#+0x0) in the CBNZ instruction is a placeholder
-  // for the offset to the Baker read barrier thunk (which is not yet set when
-  // the CFG output is emitted).
-  // CHECK-NEXT:      cbnz x20, #+0x0
-  // CHECK-NEXT:      ldar {{w\d+}}, [x<<BaseRegNum>>]
-  */
+  /// CHECK-IF: readBarrierType('baker')
+  ///   CHECK-NEXT:      add w<<BaseRegNum:\d+>>, {{w\d+}}, #0x8 (8)
+  ///   CHECK-NEXT:      adr lr, #+0x{{c|10}}
+  //    The following instruction (generated by
+  //    `art::arm64::CodeGeneratorARM64::EmitBakerReadBarrierCbnz`) checks the
+  //    Marking Register (X20) and goes into the Baker read barrier thunk if MR is
+  //    not null. The null offset (#+0x0) in the CBNZ instruction is a placeholder
+  //    for the offset to the Baker read barrier thunk (which is not yet set when
+  //    the CFG output is emitted).
+  ///   CHECK-NEXT:      cbnz x20, #+0x0
+  /// CHECK-ELSE:
+  ///   CHECK-NEXT:      add x<<BaseRegNum:\d+>>, {{x\d+}}, #0x8 (8)
+  /// CHECK-FI:
+  /// CHECK-NEXT:      ldar {{w\d+}}, [x<<BaseRegNum>>]
 
   public void test() {
     // Continually check that reading field `foo.bar` throws a
diff --git a/test/115-native-bridge/nativebridge.cc b/test/115-native-bridge/nativebridge.cc
index a5541ce..be3a201 100644
--- a/test/115-native-bridge/nativebridge.cc
+++ b/test/115-native-bridge/nativebridge.cc
@@ -30,6 +30,7 @@
 #include <jni.h>
 #include <nativebridge/native_bridge.h>
 
+#include "base/casts.h"
 #include "base/macros.h"
 
 struct NativeBridgeMethod {
@@ -185,9 +186,9 @@
 // This code is adapted from 004-SignalTest and causes a segfault.
 char *go_away_compiler = nullptr;
 
-[[ noreturn ]] static void test_sigaction_handler(int sig ATTRIBUTE_UNUSED,
-                                                  siginfo_t* info ATTRIBUTE_UNUSED,
-                                                  void* context ATTRIBUTE_UNUSED) {
+[[ noreturn ]] static void test_sigaction_handler([[maybe_unused]] int sig,
+                                                  [[maybe_unused]] siginfo_t* info,
+                                                  [[maybe_unused]] void* context) {
   printf("Should not reach the test sigaction handler.");
   abort();
 }
@@ -195,6 +196,10 @@
 static void raise_sigsegv() {
 #if defined(__arm__) || defined(__i386__) || defined(__aarch64__)
   *go_away_compiler = 'a';
+#elif defined(__riscv)
+  // Cause a SEGV using an instruction known to be 4 bytes long to account for hardcoded jump
+  // in the signal handler
+  asm volatile("ld zero, (zero);" : : :);
 #elif defined(__x86_64__)
   // Cause a SEGV using an instruction known to be 2 bytes long to account for hardcoded jump
   // in the signal handler
@@ -305,7 +310,9 @@
 
   void AssertState(TestStatus expected) {
     if (state_ != expected) {
-      printf("ERROR: unexpected state, was %d, expected %d\n", state_, expected);
+      printf("ERROR: unexpected state, was %d, expected %d\n",
+             art::enum_cast<int>(state_),
+             art::enum_cast<int>(expected));
     }
   }
 };
@@ -419,7 +426,7 @@
 // NativeBridgeCallbacks implementations
 extern "C" bool native_bridge_initialize(const android::NativeBridgeRuntimeCallbacks* art_cbs,
                                          const char* app_code_cache_dir,
-                                         const char* isa ATTRIBUTE_UNUSED) {
+                                         [[maybe_unused]] const char* isa) {
   struct stat st;
   if (app_code_cache_dir != nullptr) {
     if (stat(app_code_cache_dir, &st) == 0) {
@@ -467,7 +474,7 @@
 }
 
 extern "C" void* native_bridge_getTrampoline(void* handle, const char* name, const char* shorty,
-                                             uint32_t len ATTRIBUTE_UNUSED) {
+                                             [[maybe_unused]] uint32_t len) {
   printf("Getting trampoline for %s with shorty %s.\n", name, shorty);
 
   // The name here is actually the JNI name, so we can directly do the lookup.
@@ -528,8 +535,8 @@
 
 // v2 parts.
 
-extern "C" bool native_bridge_isCompatibleWith(uint32_t bridge_version ATTRIBUTE_UNUSED) {
-  return true;
+extern "C" bool native_bridge_isCompatibleWith(uint32_t bridge_version) {
+  return bridge_version <= 3;
 }
 
 #if defined(__i386__) || defined(__x86_64__)
@@ -553,17 +560,20 @@
 #endif
 #endif
 
-static bool StandardSignalHandler(int sig, siginfo_t* info ATTRIBUTE_UNUSED,
-                                     void* context) {
+static bool StandardSignalHandler(int sig, [[maybe_unused]] siginfo_t* info, void* context) {
   if (sig == SIGSEGV) {
 #if defined(__arm__)
     ucontext_t* uc = reinterpret_cast<ucontext_t*>(context);
     mcontext_t* mc = reinterpret_cast<mcontext_t*>(&uc->uc_mcontext);
-    mc->arm_pc += 2;          // Skip instruction causing segv & sigill.
+    mc->arm_pc += 2;  // Skip instruction causing segv & sigill.
 #elif defined(__aarch64__)
     ucontext_t* uc = reinterpret_cast<ucontext_t*>(context);
     mcontext_t* mc = reinterpret_cast<mcontext_t*>(&uc->uc_mcontext);
-    mc->pc += 4;          // Skip instruction causing segv & sigill.
+    mc->pc += 4;  // Skip instruction causing segv & sigill.
+#elif defined(__riscv)
+    ucontext_t* uc = reinterpret_cast<ucontext_t*>(context);
+    mcontext_t* mc = reinterpret_cast<mcontext_t*>(&uc->uc_mcontext);
+    mc->__gregs[REG_PC] += 4;  // Skip instruction causing segv & sigill.
 #elif defined(__i386__)
     ucontext_t* uc = reinterpret_cast<ucontext_t*>(context);
     uc->CTX_EIP += 3;
@@ -572,6 +582,7 @@
     uc->CTX_EIP += 2;
 #else
     UNUSED(context);
+    UNIMPLEMENTED(FATAL) << "Unsupported architecture";
 #endif
   }
 
@@ -602,7 +613,7 @@
   return nullptr;
 }
 
-extern "C" int native_bridge_unloadLibrary(void* handle ATTRIBUTE_UNUSED) {
+extern "C" int native_bridge_unloadLibrary([[maybe_unused]] void* handle) {
   printf("dlclose() in native bridge.\n");
   return 0;
 }
@@ -612,40 +623,43 @@
   return "";
 }
 
-extern "C" bool native_bridge_isPathSupported(const char* library_path ATTRIBUTE_UNUSED) {
+extern "C" bool native_bridge_isPathSupported([[maybe_unused]] const char* library_path) {
   printf("Checking for path support in native bridge.\n");
   return false;
 }
 
-extern "C" bool native_bridge_initAnonymousNamespace(const char* public_ns_sonames ATTRIBUTE_UNUSED,
-                                                     const char* anon_ns_library_path ATTRIBUTE_UNUSED) {
+extern "C" bool native_bridge_initAnonymousNamespace(
+    [[maybe_unused]] const char* public_ns_sonames,
+    [[maybe_unused]] const char* anon_ns_library_path) {
   printf("Initializing anonymous namespace in native bridge.\n");
   return false;
 }
 
 extern "C" android::native_bridge_namespace_t*
-native_bridge_createNamespace(const char* name ATTRIBUTE_UNUSED,
-                              const char* ld_library_path ATTRIBUTE_UNUSED,
-                              const char* default_library_path ATTRIBUTE_UNUSED,
-                              uint64_t type ATTRIBUTE_UNUSED,
-                              const char* permitted_when_isolated_path ATTRIBUTE_UNUSED,
-                              android::native_bridge_namespace_t* parent_ns ATTRIBUTE_UNUSED) {
+native_bridge_createNamespace([[maybe_unused]] const char* name,
+                              [[maybe_unused]] const char* ld_library_path,
+                              [[maybe_unused]] const char* default_library_path,
+                              [[maybe_unused]] uint64_t type,
+                              [[maybe_unused]] const char* permitted_when_isolated_path,
+                              [[maybe_unused]] android::native_bridge_namespace_t* parent_ns) {
   printf("Creating namespace in native bridge.\n");
   return nullptr;
 }
 
-extern "C" bool native_bridge_linkNamespaces(android::native_bridge_namespace_t* from ATTRIBUTE_UNUSED,
-                                             android::native_bridge_namespace_t* to ATTRIBUTE_UNUSED,
-                                             const char* shared_libs_sonames ATTRIBUTE_UNUSED) {
+extern "C" bool native_bridge_linkNamespaces(
+    [[maybe_unused]] android::native_bridge_namespace_t* from,
+    [[maybe_unused]] android::native_bridge_namespace_t* to,
+    [[maybe_unused]] const char* shared_libs_sonames) {
   printf("Linking namespaces in native bridge.\n");
   return false;
 }
 
-extern "C" void* native_bridge_loadLibraryExt(const char* libpath ATTRIBUTE_UNUSED,
-                                               int flag ATTRIBUTE_UNUSED,
-                                               android::native_bridge_namespace_t* ns ATTRIBUTE_UNUSED) {
-    printf("Loading library with Extension in native bridge.\n");
-    return nullptr;
+extern "C" void* native_bridge_loadLibraryExt(
+    [[maybe_unused]] const char* libpath,
+    [[maybe_unused]] int flag,
+    [[maybe_unused]] android::native_bridge_namespace_t* ns) {
+  printf("Loading library with Extension in native bridge.\n");
+  return nullptr;
 }
 
 // "NativeBridgeItf" is effectively an API (it is the name of the symbol that will be loaded
diff --git a/test/126-miranda-multidex/run.py b/test/126-miranda-multidex/run.py
index 1896315..f60c7ba 100644
--- a/test/126-miranda-multidex/run.py
+++ b/test/126-miranda-multidex/run.py
@@ -22,4 +22,7 @@
 
   # The problem was first exposed in a no-verify setting, as that changes the resolution path
   # taken. Make sure we also test in that environment.
-  ctx.default_run(args, no_verify=True)
+  ctx.default_run(args, verify=False)
+
+  line = "OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release."
+  ctx.run(fr"sed -i -E '/{line}/d' '{args.stderr_file}'")
diff --git a/test/129-ThreadGetId/expected-stdout.txt b/test/129-ThreadGetId/expected-stdout.txt
index aadf90d..4455320 100644
--- a/test/129-ThreadGetId/expected-stdout.txt
+++ b/test/129-ThreadGetId/expected-stdout.txt
@@ -1,2 +1,8 @@
+Thread finished
+Thread finished
+Thread finished
+Thread finished
+Thread finished
+All joined
 HeapTaskDaemon depth 0
 Finishing
diff --git a/test/129-ThreadGetId/src/Main.java b/test/129-ThreadGetId/src/Main.java
index 50e8c09..3b4b076 100644
--- a/test/129-ThreadGetId/src/Main.java
+++ b/test/129-ThreadGetId/src/Main.java
@@ -16,23 +16,71 @@
 
 import java.lang.reflect.Field;
 import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
 
 public class Main implements Runnable {
     static final int NUMBER_OF_THREADS = 5;
-    static final int TOTAL_OPERATIONS = 900;
+    static volatile int ops_per_thread = 1000;
+    static AtomicInteger operations_completed = new AtomicInteger(0);
+    static int[] progress = new int[NUMBER_OF_THREADS];
+    static AtomicInteger totalStackFrames = new AtomicInteger(0);
+    static final boolean printStats = false;  // True causes test to fail.
+    int index;
+
+    Main(int i) {
+        index = i;
+    }
 
     public static void main(String[] args) throws Exception {
         final Thread[] threads = new Thread[NUMBER_OF_THREADS];
+        Thread watchdog = new Thread() {
+            public void run() {
+                try {
+                    if (printStats) {
+                        System.out.println("ops_per_thread = " + ops_per_thread);
+                    }
+                    Thread.sleep(10_000);
+                    if (printStats) {
+                        System.out.println("Ops completed after 10 seconds: " +
+                                operations_completed.get());
+                    }
+                    if (operations_completed.get() < NUMBER_OF_THREADS * ops_per_thread / 2) {
+                        // We're in some sort of "go slow" mode, probably gcstress. Finish early.
+                        ops_per_thread /= 10;
+                    }
+                    if (printStats) {
+                        System.out.println("ops_per_thread = " + ops_per_thread);
+                    }
+                    Thread.sleep(200_000);
+                    System.out.print("Watchdog timed out: ");
+                    for (int i = 0; i < NUMBER_OF_THREADS; ++i) {
+                        System.out.print(progress[i] + ", ");
+                    }
+                    System.out.println("");
+                    System.err.println("Watchdog thread timed out");
+                    System.exit(1);
+                } catch (InterruptedException e) {}
+            }
+        };
+        watchdog.start();
+        long start_millis = System.currentTimeMillis();
         for (int t = 0; t < threads.length; t++) {
-            threads[t] = new Thread(new Main());
+            threads[t] = new Thread(new Main(t));
             threads[t].start();
         }
         for (Thread t : threads) {
             t.join();
         }
+        if (printStats) {
+            long elapsed_millis = System.currentTimeMillis() - start_millis;
+            System.out.println("Captured " + totalStackFrames + " stack frames in " +
+                    elapsed_millis + "msecs");
+        }
+        System.out.println("All joined");
         // Do this test after the other part to leave some time for the heap task daemon to start
         // up.
         test_getStackTraces();
+        watchdog.interrupt();
         System.out.println("Finishing");
     }
 
@@ -46,9 +94,9 @@
             Thread[] array = new Thread[activeCount];
             systemThreadGroup.enumerate(array);
             for (Thread thread : array) {
-               if (thread.getName().equals("HeapTaskDaemon") &&
-                   thread.getState() != Thread.State.NEW) {
-                  return thread;
+                if (thread.getName().equals("HeapTaskDaemon") &&
+                    thread.getState() != Thread.State.NEW) {
+                    return thread;
                 }
             }
             // Yield to eventually get the daemon started.
@@ -83,12 +131,16 @@
             if (thread.getId() <= 0) {
                 System.out.println("thread's ID is not positive: " + thread.getName());
             }
+            totalStackFrames.addAndGet(stMap.get(thread).length);
         }
     }
 
     public void run() {
-        for (int i = 0; i < TOTAL_OPERATIONS; ++i) {
+        for (int i = 1; i <= ops_per_thread; ++i) {
             test_getId();
+            operations_completed.addAndGet(1);
+            progress[index] = i;
         }
+        System.out.println("Thread finished");
     }
 }
diff --git a/test/137-cfi/cfi.cc b/test/137-cfi/cfi.cc
index cd5b4cf..6c9c3fe 100644
--- a/test/137-cfi/cfi.cc
+++ b/test/137-cfi/cfi.cc
@@ -38,7 +38,7 @@
 #include "gc/heap.h"
 #include "gc/space/image_space.h"
 #include "jit/debugger_interface.h"
-#include "oat_file.h"
+#include "oat/oat_file.h"
 #include "runtime.h"
 
 namespace art {
@@ -212,7 +212,7 @@
 static constexpr int kMaxTotalSleepTimeMicroseconds = 10000000;  // 10 seconds
 
 // Wait for a sigstop. This code is copied from libbacktrace.
-int wait_for_sigstop(pid_t tid, int* total_sleep_time_usec, bool* detach_failed ATTRIBUTE_UNUSED) {
+int wait_for_sigstop(pid_t tid, int* total_sleep_time_usec, [[maybe_unused]] bool* detach_failed) {
   for (;;) {
     int status;
     pid_t n = TEMP_FAILURE_RETRY(waitpid(tid, &status, __WALL | WNOHANG | WUNTRACED));
diff --git a/test/143-string-value/run.py b/test/143-string-value/run.py
index 5f32b06..2680d57 100644
--- a/test/143-string-value/run.py
+++ b/test/143-string-value/run.py
@@ -19,4 +19,4 @@
   ctx.default_run(args)
 
   # Strip error log messages.
-  ctx.run(fr"sed -i '/^.*dalvikvm\(\|32\|64\) E.*\] /d' '{args.stderr_file}'")
+  ctx.run(fr"sed -i '/^.* E dalvikvm\(\|32\|64\): .*/d' '{args.stderr_file}'")
diff --git a/test/160-read-barrier-stress/src/Main.java b/test/160-read-barrier-stress/src/Main.java
index ab23358..df403db 100644
--- a/test/160-read-barrier-stress/src/Main.java
+++ b/test/160-read-barrier-stress/src/Main.java
@@ -22,20 +22,20 @@
 
 public class Main {
     public static void main(String[] args) throws Exception {
-        testFieldReads();
-        testArrayReadsWithConstIndex();
-        testArrayReadsWithNonConstIndex();
-        testGcRoots();
-        testUnsafeGet();
-        testUnsafeCas();
-        testUnsafeCasRegression();
-        testVarHandleCompareAndSet();
-        testVarHandleCompareAndExchange();
-        testVarHandleGetAndSet();
-        testReferenceRefersTo();
+        $noinline$testFieldReads();
+        $noinline$testArrayReadsWithConstIndex();
+        $noinline$testArrayReadsWithNonConstIndex();
+        $noinline$testGcRoots();
+        $noinline$testUnsafeGet();
+        $noinline$testUnsafeCas();
+        $noinline$testUnsafeCasRegression();
+        $noinline$testVarHandleCompareAndSet();
+        $noinline$testVarHandleCompareAndExchange();
+        $noinline$testVarHandleGetAndSet();
+        $noinline$testReferenceRefersTo();
     }
 
-    public static void testFieldReads() {
+    public static void $noinline$testFieldReads() {
         // Initialize local variables for comparison.
         Object f0000 = manyFields.testField0000;
         Object f1024 = manyFields.testField1024;
@@ -46,19 +46,19 @@
         // over 64MiB memory (with heap size limited to 16MiB), ensuring we run GC and
         // stress the read barrier implementation if concurrent collector is enabled.
         for (int i = 0; i != 64 * 1024; ++i) {
-            allocateAtLeast1KiB();
+            $noinline$allocateAtLeast1KiB();
             ManyFields mf = manyFields;  // Load the volatile `manyFields` once on each iteration.
             // Test reference field access.
-            assertSameObject(f0000, mf.testField0000);
-            assertDifferentObject(f0000, mf.testField0001);
-            assertSameObject(f1024, mf.testField1024);
-            assertSameObject(f4444, mf.testField4444);
-            assertDifferentObject(f4999, mf.testField4998);
-            assertSameObject(f4999, mf.testField4999);
+            $noinline$assertSameObject(f0000, mf.testField0000);
+            $noinline$assertDifferentObject(f0000, mf.testField0001);
+            $noinline$assertSameObject(f1024, mf.testField1024);
+            $noinline$assertSameObject(f4444, mf.testField4444);
+            $noinline$assertDifferentObject(f4999, mf.testField4998);
+            $noinline$assertSameObject(f4999, mf.testField4999);
         }
     }
 
-    public static void testArrayReadsWithConstIndex() {
+    public static void $noinline$testArrayReadsWithConstIndex() {
         // Initialize local variables for comparison.
         Object f0000 = new Integer(0);
         Object f1024 = new Integer(1024);
@@ -79,19 +79,19 @@
         // over 64MiB memory (with heap size limited to 16MiB), ensuring we run GC and
         // stress the read barrier implementation if concurrent collector is enabled.
         for (int i = 0; i != 64 * 1024; ++i) {
-            allocateAtLeast1KiB();
+            $noinline$allocateAtLeast1KiB();
             Object[] la = largeArray;    // Load the volatile `largeArray` once on each iteration.
             // Test array access with constant index.
-            assertSameObject(f0000, la[0]);
-            assertDifferentObject(f0000, la[1]);
-            assertSameObject(f1024, la[1024]);
-            assertSameObject(f4444, la[4444]);
-            assertDifferentObject(f4999, la[4998]);
-            assertSameObject(f4999, la[4999]);
+            $noinline$assertSameObject(f0000, la[0]);
+            $noinline$assertDifferentObject(f0000, la[1]);
+            $noinline$assertSameObject(f1024, la[1024]);
+            $noinline$assertSameObject(f4444, la[4444]);
+            $noinline$assertDifferentObject(f4999, la[4998]);
+            $noinline$assertSameObject(f4999, la[4999]);
         }
     }
 
-    public static void testArrayReadsWithNonConstIndex() {
+    public static void $noinline$testArrayReadsWithNonConstIndex() {
         // Initialize local variables for comparison.
         Object f0000 = new Integer(0);
         Object f1024 = new Integer(1024);
@@ -119,15 +119,15 @@
         // over 64MiB memory (with heap size limited to 16MiB), ensuring we run GC and
         // stress the read barrier implementation if concurrent collector is enabled.
         for (int i = 0; i != 64 * 1024; ++i) {
-            allocateAtLeast1KiB();
+            $noinline$allocateAtLeast1KiB();
             Object[] la = largeArray;    // Load the volatile `largeArray` once on each iteration.
             // Test array access with non-constant index.
-            assertSameObject(f0000, la[i0]);
-            assertDifferentObject(f0000, la[i1]);
-            assertSameObject(f1024, la[i1024]);
-            assertSameObject(f4444, la[i4444]);
-            assertDifferentObject(f4999, la[i4998]);
-            assertSameObject(f4999, la[i4999]);
+            $noinline$assertSameObject(f0000, la[i0]);
+            $noinline$assertDifferentObject(f0000, la[i1]);
+            $noinline$assertSameObject(f1024, la[i1024]);
+            $noinline$assertSameObject(f4444, la[i4444]);
+            $noinline$assertDifferentObject(f4999, la[i4998]);
+            $noinline$assertSameObject(f4999, la[i4999]);
 
             la = largeArray;
             // Group the ArrayGets so they aren't divided by a function call; this will enable
@@ -139,16 +139,16 @@
             Object tmp5 = la[i0 + 4998];
             Object tmp6 = la[i0 + 4999];
 
-            assertSameObject(f0000, tmp1);
-            assertDifferentObject(f0000, tmp2);
-            assertSameObject(f1024, tmp3);
-            assertSameObject(f4444, tmp4);
-            assertDifferentObject(f4999, tmp5);
-            assertSameObject(f4999, tmp6);
+            $noinline$assertSameObject(f0000, tmp1);
+            $noinline$assertDifferentObject(f0000, tmp2);
+            $noinline$assertSameObject(f1024, tmp3);
+            $noinline$assertSameObject(f4444, tmp4);
+            $noinline$assertDifferentObject(f4999, tmp5);
+            $noinline$assertSameObject(f4999, tmp6);
         }
     }
 
-    public static void testGcRoots() {
+    public static void $noinline$testGcRoots() {
         // Initialize strings, hide this under a condition based on a volatile field.
         String testString0 = null;
         String testString1 = null;
@@ -167,19 +167,19 @@
         // over 64MiB memory (with heap size limited to 16MiB), ensuring we run GC and
         // stress the read barrier implementation if concurrent collector is enabled.
         for (int i = 0; i != 64 * 1024; ++i) {
-            allocateAtLeast1KiB();
+            $noinline$allocateAtLeast1KiB();
             // Test GC roots.
             if (index0 != 12345678) {
-              assertSameObject(testString0, "testString0");
-              assertSameObject(testString1, "testString1");
-              assertSameObject(testString2, "testString2");
-              assertSameObject(testString3, "testString3");
+              $noinline$assertSameObject(testString0, "testString0");
+              $noinline$assertSameObject(testString1, "testString1");
+              $noinline$assertSameObject(testString2, "testString2");
+              $noinline$assertSameObject(testString3, "testString3");
             }
             // TODO: Stress GC roots (const-class, kBssEntry/kReferrersClass).
         }
     }
 
-    public static void testUnsafeGet() throws Exception {
+    public static void $noinline$testUnsafeGet() throws Exception {
         // Initialize local variables for comparison.
         Object f0000 = manyFields.testField0000;
         Object f1024 = manyFields.testField1024;
@@ -204,19 +204,19 @@
         // over 64MiB memory (with heap size limited to 16MiB), ensuring we run GC and
         // stress the read barrier implementation if concurrent collector is enabled.
         for (int i = 0; i != 64 * 1024; ++i) {
-            allocateAtLeast1KiB();
+            $noinline$allocateAtLeast1KiB();
             ManyFields mf = manyFields;  // Load the volatile `manyFields` once on each iteration.
             // Test Unsafe.getObject().
-            assertSameObject(f0000, unsafe.getObject(mf, f0000Offset));
-            assertDifferentObject(f0000, unsafe.getObject(mf, f0001Offset));
-            assertSameObject(f1024, unsafe.getObject(mf, f1024Offset));
-            assertSameObject(f4444, unsafe.getObject(mf, f4444Offset));
-            assertDifferentObject(f4999, unsafe.getObject(mf, f4998Offset));
-            assertSameObject(f4999, unsafe.getObject(mf, f4999Offset));
+            $noinline$assertSameObject(f0000, unsafe.getObject(mf, f0000Offset));
+            $noinline$assertDifferentObject(f0000, unsafe.getObject(mf, f0001Offset));
+            $noinline$assertSameObject(f1024, unsafe.getObject(mf, f1024Offset));
+            $noinline$assertSameObject(f4444, unsafe.getObject(mf, f4444Offset));
+            $noinline$assertDifferentObject(f4999, unsafe.getObject(mf, f4998Offset));
+            $noinline$assertSameObject(f4999, unsafe.getObject(mf, f4999Offset));
         }
     }
 
-    public static void testUnsafeCas() throws Exception {
+    public static void $noinline$testUnsafeCas() throws Exception {
         // Initialize local variables for comparison.
         Object f0000 = manyFields.testField0000;
         Object f1024 = manyFields.testField1024;
@@ -241,21 +241,29 @@
         // over 64MiB memory (with heap size limited to 16MiB), ensuring we run GC and
         // stress the read barrier implementation if concurrent collector is enabled.
         for (int i = 0; i != 64 * 1024; ++i) {
-            allocateAtLeast1KiB();
+            $noinline$allocateAtLeast1KiB();
             ManyFields mf = manyFields;  // Load the volatile `manyFields` once on each iteration.
             // Test Unsafe.compareAndSwapObject().
-            assertEqual(false, unsafe.compareAndSwapObject(mf, f0000Offset, f1024, f4444));
-            assertEqual(false, unsafe.compareAndSwapObject(mf, f0001Offset, f1024, f4444));
-            assertEqual(true, unsafe.compareAndSwapObject(mf, f1024Offset, f1024, f4444));
-            assertEqual(true, unsafe.compareAndSwapObject(mf, f1024Offset, f4444, f1024));
-            assertEqual(false, unsafe.compareAndSwapObject(mf, f1024Offset, f4444, f1024));
-            assertEqual(false, unsafe.compareAndSwapObject(mf, f4444Offset, f1024, f4444));
-            assertEqual(false, unsafe.compareAndSwapObject(mf, f4998Offset, f1024, f4444));
-            assertEqual(false, unsafe.compareAndSwapObject(mf, f4999Offset, f1024, f4444));
+            $noinline$assertEqual(
+                   false, unsafe.compareAndSwapObject(mf, f0000Offset, f1024, f4444));
+            $noinline$assertEqual(
+                   false, unsafe.compareAndSwapObject(mf, f0001Offset, f1024, f4444));
+            $noinline$assertEqual(
+                   true, unsafe.compareAndSwapObject(mf, f1024Offset, f1024, f4444));
+            $noinline$assertEqual(
+                   true, unsafe.compareAndSwapObject(mf, f1024Offset, f4444, f1024));
+            $noinline$assertEqual(
+                   false, unsafe.compareAndSwapObject(mf, f1024Offset, f4444, f1024));
+            $noinline$assertEqual(
+                   false, unsafe.compareAndSwapObject(mf, f4444Offset, f1024, f4444));
+            $noinline$assertEqual(
+                   false, unsafe.compareAndSwapObject(mf, f4998Offset, f1024, f4444));
+            $noinline$assertEqual(
+                   false, unsafe.compareAndSwapObject(mf, f4999Offset, f1024, f4444));
         }
     }
 
-    public static void testUnsafeCasRegression() throws Exception {
+    public static void $noinline$testUnsafeCasRegression() throws Exception {
         // Initialize local variables for comparison.
         Object f0000 = manyFields.testField0000;
         // Initialize Unsafe.
@@ -267,7 +275,7 @@
         // over 64MiB memory (with heap size limited to 16MiB), ensuring we run GC and
         // stress the read barrier implementation if concurrent collector is enabled.
         for (int i = 0; i != 64 * 1024; ++i) {
-            allocateAtLeast1KiB();
+            $noinline$allocateAtLeast1KiB();
             ManyFields mf = manyFields;  // Load the volatile `manyFields` once on each iteration.
 
             // With https://android-review.googlesource.com/729224 , the intrinsic could
@@ -286,7 +294,7 @@
         }
     }
 
-    public static void testVarHandleCompareAndSet() throws Exception {
+    public static void $noinline$testVarHandleCompareAndSet() throws Exception {
         // Initialize local variables for comparison.
         Object f0000 = manyFields.testField0000;
         Object f1024 = manyFields.testField1024;
@@ -310,21 +318,21 @@
         // over 64MiB memory (with heap size limited to 16MiB), ensuring we run GC and
         // stress the read barrier implementation if concurrent collector is enabled.
         for (int i = 0; i != 64 * 1024; ++i) {
-            allocateAtLeast1KiB();
+            $noinline$allocateAtLeast1KiB();
             ManyFields mf = manyFields;  // Load the volatile `manyFields` once on each iteration.
             // Test VarHandle.compareAndSet().
-            assertEqual(false, f0000vh.compareAndSet(mf, f1024, f4444));
-            assertEqual(false, f0001vh.compareAndSet(mf, f1024, f4444));
-            assertEqual(true, f1024vh.compareAndSet(mf, f1024, f4444));
-            assertEqual(true, f1024vh.compareAndSet(mf, f4444, f1024));
-            assertEqual(false, f1024vh.compareAndSet(mf, f4444, f1024));
-            assertEqual(false, f4444vh.compareAndSet(mf, f1024, f4444));
-            assertEqual(false, f4998vh.compareAndSet(mf, f1024, f4444));
-            assertEqual(false, f4999vh.compareAndSet(mf, f1024, f4444));
+            $noinline$assertEqual(false, f0000vh.compareAndSet(mf, f1024, f4444));
+            $noinline$assertEqual(false, f0001vh.compareAndSet(mf, f1024, f4444));
+            $noinline$assertEqual(true, f1024vh.compareAndSet(mf, f1024, f4444));
+            $noinline$assertEqual(true, f1024vh.compareAndSet(mf, f4444, f1024));
+            $noinline$assertEqual(false, f1024vh.compareAndSet(mf, f4444, f1024));
+            $noinline$assertEqual(false, f4444vh.compareAndSet(mf, f1024, f4444));
+            $noinline$assertEqual(false, f4998vh.compareAndSet(mf, f1024, f4444));
+            $noinline$assertEqual(false, f4999vh.compareAndSet(mf, f1024, f4444));
         }
     }
 
-    public static void testVarHandleCompareAndExchange() throws Exception {
+    public static void $noinline$testVarHandleCompareAndExchange() throws Exception {
         // Initialize local variables for comparison.
         Object f0000 = manyFields.testField0000;
         Object f0001 = manyFields.testField0001;
@@ -350,21 +358,29 @@
         // over 64MiB memory (with heap size limited to 16MiB), ensuring we run GC and
         // stress the read barrier implementation if concurrent collector is enabled.
         for (int i = 0; i != 64 * 1024; ++i) {
-            allocateAtLeast1KiB();
+            $noinline$allocateAtLeast1KiB();
             ManyFields mf = manyFields;  // Load the volatile `manyFields` once on each iteration.
             // Test VarHandle.compareAndExchange(). Use reference comparison, not equals().
-            assertSameObject(f0000, f0000vh.compareAndExchange(mf, f1024, f4444));  // Unchanged.
-            assertSameObject(f0001, f0001vh.compareAndExchange(mf, f1024, f4444));  // Unchanged.
-            assertSameObject(f1024, f1024vh.compareAndExchange(mf, f1024, f4444));  // Replaced.
-            assertSameObject(f4444, f1024vh.compareAndExchange(mf, f4444, f1024));  // Replaced.
-            assertSameObject(f1024, f1024vh.compareAndExchange(mf, f4444, f1024));  // Unchanged.
-            assertSameObject(f4444, f4444vh.compareAndExchange(mf, f1024, f4444));  // Unchanged.
-            assertSameObject(f4998, f4998vh.compareAndExchange(mf, f1024, f4444));  // Unchanged.
-            assertSameObject(f4999, f4999vh.compareAndExchange(mf, f1024, f4444));  // Unchanged.
+            $noinline$assertSameObject(
+                    f0000, f0000vh.compareAndExchange(mf, f1024, f4444));  // Unchanged.
+            $noinline$assertSameObject(
+                    f0001, f0001vh.compareAndExchange(mf, f1024, f4444));  // Unchanged.
+            $noinline$assertSameObject(
+                    f1024, f1024vh.compareAndExchange(mf, f1024, f4444));  // Replaced.
+            $noinline$assertSameObject(
+                    f4444, f1024vh.compareAndExchange(mf, f4444, f1024));  // Replaced.
+            $noinline$assertSameObject(
+                    f1024, f1024vh.compareAndExchange(mf, f4444, f1024));  // Unchanged.
+            $noinline$assertSameObject(
+                    f4444, f4444vh.compareAndExchange(mf, f1024, f4444));  // Unchanged.
+            $noinline$assertSameObject(
+                    f4998, f4998vh.compareAndExchange(mf, f1024, f4444));  // Unchanged.
+            $noinline$assertSameObject(
+                    f4999, f4999vh.compareAndExchange(mf, f1024, f4444));  // Unchanged.
         }
     }
 
-    public static void testVarHandleGetAndSet() throws Exception {
+    public static void $noinline$testVarHandleGetAndSet() throws Exception {
         // Initialize local variables for comparison.
         Object f0000 = manyFields.testField0000;
         Object f0001 = manyFields.testField0001;
@@ -390,21 +406,21 @@
         // over 64MiB memory (with heap size limited to 16MiB), ensuring we run GC and
         // stress the read barrier implementation if concurrent collector is enabled.
         for (int i = 0; i != 64 * 1024; ++i) {
-            allocateAtLeast1KiB();
+            $noinline$allocateAtLeast1KiB();
             ManyFields mf = manyFields;  // Load the volatile `manyFields` once on each iteration.
             // Test VarHandle.getAndSet(). Use reference comparison, not equals().
-            assertSameObject(f0000, f0000vh.getAndSet(mf, f0000));  // Unchanged.
-            assertSameObject(f0001, f0001vh.getAndSet(mf, f0001));  // Unchanged.
-            assertSameObject(f1024, f1024vh.getAndSet(mf, f4444));  // Replaced.
-            assertSameObject(f4444, f1024vh.getAndSet(mf, f1024));  // Replaced.
-            assertSameObject(f1024, f1024vh.getAndSet(mf, f1024));  // Unchanged.
-            assertSameObject(f4444, f4444vh.getAndSet(mf, f4444));  // Unchanged.
-            assertSameObject(f4998, f4998vh.getAndSet(mf, f4998));  // Unchanged.
-            assertSameObject(f4999, f4999vh.getAndSet(mf, f4999));  // Unchanged.
+            $noinline$assertSameObject(f0000, f0000vh.getAndSet(mf, f0000));  // Unchanged.
+            $noinline$assertSameObject(f0001, f0001vh.getAndSet(mf, f0001));  // Unchanged.
+            $noinline$assertSameObject(f1024, f1024vh.getAndSet(mf, f4444));  // Replaced.
+            $noinline$assertSameObject(f4444, f1024vh.getAndSet(mf, f1024));  // Replaced.
+            $noinline$assertSameObject(f1024, f1024vh.getAndSet(mf, f1024));  // Unchanged.
+            $noinline$assertSameObject(f4444, f4444vh.getAndSet(mf, f4444));  // Unchanged.
+            $noinline$assertSameObject(f4998, f4998vh.getAndSet(mf, f4998));  // Unchanged.
+            $noinline$assertSameObject(f4999, f4999vh.getAndSet(mf, f4999));  // Unchanged.
         }
     }
 
-    public static void testReferenceRefersTo() throws Exception {
+    public static void $noinline$testReferenceRefersTo() throws Exception {
         // Initialize local variables for comparison.
         manyFields.testField0000 = new Object();
         manyFields.testField1024 = new Object();
@@ -419,46 +435,46 @@
         // over 64MiB memory (with heap size limited to 16MiB), ensuring we run GC and stress the
         // read barrier implementation in Reference.refersTo() if concurrent collector is enabled.
         for (int i = 0; i != 64 * 1024; ++i) {
-            allocateAtLeast1KiB();
+            $noinline$allocateAtLeast1KiB();
             ManyFields mf = manyFields;  // Load the volatile `manyFields` once on each iteration.
             // Test Reference.refersTo() with reference field access.
-            assertEqual(true, f0000.refersTo(mf.testField0000));
-            assertEqual(false, f0000.refersTo(mf.testField0001));
-            assertEqual(true, f1024.refersTo(mf.testField1024));
-            assertEqual(true, f4444.refersTo(mf.testField4444));
-            assertEqual(false, f4999.refersTo(mf.testField4998));
-            assertEqual(true, f4999.refersTo(mf.testField4999));
+            $noinline$assertEqual(true, f0000.refersTo(mf.testField0000));
+            $noinline$assertEqual(false, f0000.refersTo(mf.testField0001));
+            $noinline$assertEqual(true, f1024.refersTo(mf.testField1024));
+            $noinline$assertEqual(true, f4444.refersTo(mf.testField4444));
+            $noinline$assertEqual(false, f4999.refersTo(mf.testField4998));
+            $noinline$assertEqual(true, f4999.refersTo(mf.testField4999));
         }
     }
 
     public static int $noinline$foo() { return 42; }
 
-    public static void assertDifferentObject(Object lhs, Object rhs) {
+    public static void $noinline$assertDifferentObject(Object lhs, Object rhs) {
         if (lhs == rhs) {
             throw new Error("Same objects: " + lhs + " and " + rhs);
         }
     }
 
-    public static void assertSameObject(Object lhs, Object rhs) {
-      if (lhs != rhs) {
-          throw new Error("Different objects: " + lhs + " and " + rhs);
-      }
-  }
+    public static void $noinline$assertSameObject(Object lhs, Object rhs) {
+        if (lhs != rhs) {
+            throw new Error("Different objects: " + lhs + " and " + rhs);
+        }
+    }
 
-    public static void assertEqual(boolean expected, boolean actual) {
-      if (expected != actual) {
-        throw new Error("Expected " + expected +", got " + actual);
-      }
+    public static void $noinline$assertEqual(boolean expected, boolean actual) {
+        if (expected != actual) {
+            throw new Error("Expected " + expected +", got " + actual);
+        }
     }
 
     public static Unsafe getUnsafe() throws Exception {
-      Class<?> unsafeClass = Class.forName("sun.misc.Unsafe");
-      Field f = unsafeClass.getDeclaredField("theUnsafe");
-      f.setAccessible(true);
-      return (Unsafe) f.get(null);
+        Class<?> unsafeClass = Class.forName("sun.misc.Unsafe");
+        Field f = unsafeClass.getDeclaredField("theUnsafe");
+        f.setAccessible(true);
+        return (Unsafe) f.get(null);
     }
 
-    public static void allocateAtLeast1KiB() {
+    public static void $noinline$allocateAtLeast1KiB() {
         // Give GC more work by allocating Object arrays.
         memory[allocationIndex] = new Object[1024 / 4];
         ++allocationIndex;
diff --git a/test/178-app-image-native-method/native_methods.cc b/test/178-app-image-native-method/native_methods.cc
index 709c5df..51fcbf2 100644
--- a/test/178-app-image-native-method/native_methods.cc
+++ b/test/178-app-image-native-method/native_methods.cc
@@ -26,7 +26,7 @@
 
 namespace art {
 
-static inline bool VerifyManyParameters(
+static inline jint VerifyManyParameters(
     jint i1, jlong l1, jfloat f1, jdouble d1,
     jint i2, jlong l2, jfloat f2, jdouble d2,
     jint i3, jlong l3, jfloat f3, jdouble d3,
@@ -35,15 +35,39 @@
     jint i6, jlong l6, jfloat f6, jdouble d6,
     jint i7, jlong l7, jfloat f7, jdouble d7,
     jint i8, jlong l8, jfloat f8, jdouble d8) {
-  return
-      (i1 == 11) && (l1 == 12) && (f1 == 13.0) && (d1 == 14.0) &&
-      (i2 == 21) && (l2 == 22) && (f2 == 23.0) && (d2 == 24.0) &&
-      (i3 == 31) && (l3 == 32) && (f3 == 33.0) && (d3 == 34.0) &&
-      (i4 == 41) && (l4 == 42) && (f4 == 43.0) && (d4 == 44.0) &&
-      (i5 == 51) && (l5 == 52) && (f5 == 53.0) && (d5 == 54.0) &&
-      (i6 == 61) && (l6 == 62) && (f6 == 63.0) && (d6 == 64.0) &&
-      (i7 == 71) && (l7 == 72) && (f7 == 73.0) && (d7 == 74.0) &&
-      (i8 == 81) && (l8 == 82) && (f8 == 83.0) && (d8 == 84.0);
+  if (i1 != 11) return -1;
+  if (l1 != 12) return -2;
+  if (f1 != 13.0) return -3;
+  if (d1 != 14.0) return -4;
+  if (i2 != 21) return -5;
+  if (l2 != 22) return -6;
+  if (f2 != 23.0) return -7;
+  if (d2 != 24.0) return -8;
+  if (i3 != 31) return -9;
+  if (l3 != 32) return -10;
+  if (f3 != 33.0) return -11;
+  if (d3 != 34.0) return -12;
+  if (i4 != 41) return -13;
+  if (l4 != 42) return -14;
+  if (f4 != 43.0) return -15;
+  if (d4 != 44.0) return -16;
+  if (i5 != 51) return -17;
+  if (l5 != 52) return -18;
+  if (f5 != 53.0) return -19;
+  if (d5 != 54.0) return -20;
+  if (i6 != 61) return -21;
+  if (l6 != 62) return -22;
+  if (f6 != 63.0) return -23;
+  if (d6 != 64.0) return -24;
+  if (i7 != 71) return -25;
+  if (l7 != 72) return -26;
+  if (f7 != 73.0) return -27;
+  if (d7 != 74.0) return -28;
+  if (i8 != 81) return -29;
+  if (l8 != 82) return -30;
+  if (f8 != 83.0) return -31;
+  if (d8 != 84.0) return -32;
+  return 42;
 }
 
 extern "C" JNIEXPORT jint JNICALL Java_Test_nativeMethodVoid(JNIEnv*, jclass) {
@@ -64,7 +88,7 @@
     jint i6, jlong l6, jfloat f6, jdouble d6,
     jint i7, jlong l7, jfloat f7, jdouble d7,
     jint i8, jlong l8, jfloat f8, jdouble d8) {
-  bool ok = VerifyManyParameters(
+  return VerifyManyParameters(
       i1, l1, f1, d1,
       i2, l2, f2, d2,
       i3, l3, f3, d3,
@@ -73,7 +97,6 @@
       i6, l6, f6, d6,
       i7, l7, f7, d7,
       i8, l8, f8, d8);
-  return ok ? 42 : -1;
 }
 
 extern "C" JNIEXPORT jint JNICALL Java_TestFast_nativeMethodVoid(JNIEnv*, jclass) {
@@ -94,7 +117,7 @@
     jint i6, jlong l6, jfloat f6, jdouble d6,
     jint i7, jlong l7, jfloat f7, jdouble d7,
     jint i8, jlong l8, jfloat f8, jdouble d8) {
-  bool ok = VerifyManyParameters(
+  return VerifyManyParameters(
       i1, l1, f1, d1,
       i2, l2, f2, d2,
       i3, l3, f3, d3,
@@ -103,7 +126,6 @@
       i6, l6, f6, d6,
       i7, l7, f7, d7,
       i8, l8, f8, d8);
-  return ok ? 42 : -1;
 }
 
 extern "C" JNIEXPORT jint JNICALL Java_TestCritical_nativeMethodVoid() {
@@ -123,7 +145,7 @@
     jint i6, jlong l6, jfloat f6, jdouble d6,
     jint i7, jlong l7, jfloat f7, jdouble d7,
     jint i8, jlong l8, jfloat f8, jdouble d8) {
-  bool ok = VerifyManyParameters(
+  return VerifyManyParameters(
       i1, l1, f1, d1,
       i2, l2, f2, d2,
       i3, l3, f3, d3,
@@ -132,7 +154,6 @@
       i6, l6, f6, d6,
       i7, l7, f7, d7,
       i8, l8, f8, d8);
-  return ok ? 42 : -1;
 }
 
 extern "C" JNIEXPORT jint JNICALL Java_CriticalSignatures_nativeILFFFFD(
@@ -617,6 +638,34 @@
   return 42;
 }
 
+extern "C" JNIEXPORT jint JNICALL Java_CriticalSignatures_nativeDFDFDFDFDFIJ(
+    jdouble d1,
+    jfloat f1,
+    jdouble d2,
+    jfloat f2,
+    jdouble d3,
+    jfloat f3,
+    jdouble d4,
+    jfloat f4,
+    jdouble d5,
+    jfloat f5,
+    jint i,
+    jlong j) {
+  if (d1 != 1.0) return -1;
+  if (f1 != 2.0f) return -2;
+  if (d2 != 3.0) return -3;
+  if (f2 != 4.0f) return -4;
+  if (d3 != 5.0) return -5;
+  if (f3 != 6.0f) return -6;
+  if (d4 != 7.0) return -7;
+  if (f4 != 8.0f) return -8;
+  if (d5 != 9.0) return -9;
+  if (f5 != 10.0f) return -10;
+  if (i != 11) return -11;
+  if (j != 12) return -12;
+  return 42;
+}
+
 extern "C" JNIEXPORT jint JNICALL Java_CriticalClinitCheck_nativeMethodVoid() {
   return 42;
 }
@@ -634,7 +683,7 @@
     jint i6, jlong l6, jfloat f6, jdouble d6,
     jint i7, jlong l7, jfloat f7, jdouble d7,
     jint i8, jlong l8, jfloat f8, jdouble d8) {
-  bool ok = VerifyManyParameters(
+  return VerifyManyParameters(
       i1, l1, f1, d1,
       i2, l2, f2, d2,
       i3, l3, f3, d3,
@@ -643,7 +692,6 @@
       i6, l6, f6, d6,
       i7, l7, f7, d7,
       i8, l8, f8, d8);
-  return ok ? 42 : -1;
 }
 
 extern "C" JNIEXPORT jint JNICALL Java_Main_b189235039CallThrough(JNIEnv* env, jobject m) {
diff --git a/test/178-app-image-native-method/profile b/test/178-app-image-native-method/profile
index 1c25dee..5f3d95b 100644
--- a/test/178-app-image-native-method/profile
+++ b/test/178-app-image-native-method/profile
@@ -14,4 +14,5 @@
 HSPLMain;->$noinline$opt$testMissingFast()V
 HSPLMain;->$noinline$opt$testMissingCritical()V
 HSPLMain;->$noinline$opt$testCriticalSignatures()V
+HSPLMain;->$noinline$opt$testCriticalSignaturesStackMoves()V
 HSPLMain;->$noinline$opt$testCriticalClinitCheck()V
diff --git a/test/178-app-image-native-method/src/Main.java b/test/178-app-image-native-method/src/Main.java
index 877efa4..760f066 100644
--- a/test/178-app-image-native-method/src/Main.java
+++ b/test/178-app-image-native-method/src/Main.java
@@ -201,7 +201,7 @@
         //   for i in {0..84}; \
         //     do echo "        0xf00000000L + $((i*3))L,"; \
         //     echo "        $((i*3+2)),"; \
-        //  done
+        //   done
         0xf00000000L + 0L,
         2,
         0xf00000000L + 3L,
@@ -372,8 +372,206 @@
         251,
         0xf00000000L + 252L,
         254));
+    assertEquals(42, CriticalSignatures.nativeDFDFDFDFDFIJ(
+        1.0, 2.0f, 3.0, 4.0f, 5.0, 6.0f, 7.0, 8.0f, 9.0, 10.0f, 11, 12L));
+    // Exercise spilling args from registers on riscv64.
+    double double9_0 = $noinline$returnDoubleArg(9.0);
+    float float10_0 = $noinline$returnFloatArg(10.0f);
+    int int11 = $noinline$returnIntArg(11);
+    long long12 = $noinline$returnLongArg(12);
+    assertEquals(42, CriticalSignatures.nativeDFDFDFDFDFIJ(
+        1.0, 2.0f, 3.0, 4.0f, 5.0, 6.0f, 7.0, 8.0f, double9_0, float10_0, int11, long12));
+    // Split out the last test to keep this method under the large method threshold.
+    $noinline$opt$testCriticalSignaturesStackMoves();
   }
 
+  public static void $noinline$opt$testCriticalSignaturesStackMoves() {
+    // Exercise moving non-const args to stack by having more non-const args than registers.
+    // At least on riscv64, where we need to properly sign-extend narrow (int) arguments
+    // passed on stack, this covers both register and stack source locations.
+    assertEquals(42, CriticalSignatures.nativeFullArgs(
+        // Generated by script (then modified to close argument list):
+        //   for i in {0..84}; \
+        //     do echo "        \$noinline\$returnLongArg(0xf00000000L + $((i*3))L),"; \
+        //     echo "        \$noinline\$returnIntArg($((i*3+2))),"; \
+        //   done
+        $noinline$returnLongArg(0xf00000000L + 0L),
+        $noinline$returnIntArg(2),
+        $noinline$returnLongArg(0xf00000000L + 3L),
+        $noinline$returnIntArg(5),
+        $noinline$returnLongArg(0xf00000000L + 6L),
+        $noinline$returnIntArg(8),
+        $noinline$returnLongArg(0xf00000000L + 9L),
+        $noinline$returnIntArg(11),
+        $noinline$returnLongArg(0xf00000000L + 12L),
+        $noinline$returnIntArg(14),
+        $noinline$returnLongArg(0xf00000000L + 15L),
+        $noinline$returnIntArg(17),
+        $noinline$returnLongArg(0xf00000000L + 18L),
+        $noinline$returnIntArg(20),
+        $noinline$returnLongArg(0xf00000000L + 21L),
+        $noinline$returnIntArg(23),
+        $noinline$returnLongArg(0xf00000000L + 24L),
+        $noinline$returnIntArg(26),
+        $noinline$returnLongArg(0xf00000000L + 27L),
+        $noinline$returnIntArg(29),
+        $noinline$returnLongArg(0xf00000000L + 30L),
+        $noinline$returnIntArg(32),
+        $noinline$returnLongArg(0xf00000000L + 33L),
+        $noinline$returnIntArg(35),
+        $noinline$returnLongArg(0xf00000000L + 36L),
+        $noinline$returnIntArg(38),
+        $noinline$returnLongArg(0xf00000000L + 39L),
+        $noinline$returnIntArg(41),
+        $noinline$returnLongArg(0xf00000000L + 42L),
+        $noinline$returnIntArg(44),
+        $noinline$returnLongArg(0xf00000000L + 45L),
+        $noinline$returnIntArg(47),
+        $noinline$returnLongArg(0xf00000000L + 48L),
+        $noinline$returnIntArg(50),
+        $noinline$returnLongArg(0xf00000000L + 51L),
+        $noinline$returnIntArg(53),
+        $noinline$returnLongArg(0xf00000000L + 54L),
+        $noinline$returnIntArg(56),
+        $noinline$returnLongArg(0xf00000000L + 57L),
+        $noinline$returnIntArg(59),
+        $noinline$returnLongArg(0xf00000000L + 60L),
+        $noinline$returnIntArg(62),
+        $noinline$returnLongArg(0xf00000000L + 63L),
+        $noinline$returnIntArg(65),
+        $noinline$returnLongArg(0xf00000000L + 66L),
+        $noinline$returnIntArg(68),
+        $noinline$returnLongArg(0xf00000000L + 69L),
+        $noinline$returnIntArg(71),
+        $noinline$returnLongArg(0xf00000000L + 72L),
+        $noinline$returnIntArg(74),
+        $noinline$returnLongArg(0xf00000000L + 75L),
+        $noinline$returnIntArg(77),
+        $noinline$returnLongArg(0xf00000000L + 78L),
+        $noinline$returnIntArg(80),
+        $noinline$returnLongArg(0xf00000000L + 81L),
+        $noinline$returnIntArg(83),
+        $noinline$returnLongArg(0xf00000000L + 84L),
+        $noinline$returnIntArg(86),
+        $noinline$returnLongArg(0xf00000000L + 87L),
+        $noinline$returnIntArg(89),
+        $noinline$returnLongArg(0xf00000000L + 90L),
+        $noinline$returnIntArg(92),
+        $noinline$returnLongArg(0xf00000000L + 93L),
+        $noinline$returnIntArg(95),
+        $noinline$returnLongArg(0xf00000000L + 96L),
+        $noinline$returnIntArg(98),
+        $noinline$returnLongArg(0xf00000000L + 99L),
+        $noinline$returnIntArg(101),
+        $noinline$returnLongArg(0xf00000000L + 102L),
+        $noinline$returnIntArg(104),
+        $noinline$returnLongArg(0xf00000000L + 105L),
+        $noinline$returnIntArg(107),
+        $noinline$returnLongArg(0xf00000000L + 108L),
+        $noinline$returnIntArg(110),
+        $noinline$returnLongArg(0xf00000000L + 111L),
+        $noinline$returnIntArg(113),
+        $noinline$returnLongArg(0xf00000000L + 114L),
+        $noinline$returnIntArg(116),
+        $noinline$returnLongArg(0xf00000000L + 117L),
+        $noinline$returnIntArg(119),
+        $noinline$returnLongArg(0xf00000000L + 120L),
+        $noinline$returnIntArg(122),
+        $noinline$returnLongArg(0xf00000000L + 123L),
+        $noinline$returnIntArg(125),
+        $noinline$returnLongArg(0xf00000000L + 126L),
+        $noinline$returnIntArg(128),
+        $noinline$returnLongArg(0xf00000000L + 129L),
+        $noinline$returnIntArg(131),
+        $noinline$returnLongArg(0xf00000000L + 132L),
+        $noinline$returnIntArg(134),
+        $noinline$returnLongArg(0xf00000000L + 135L),
+        $noinline$returnIntArg(137),
+        $noinline$returnLongArg(0xf00000000L + 138L),
+        $noinline$returnIntArg(140),
+        $noinline$returnLongArg(0xf00000000L + 141L),
+        $noinline$returnIntArg(143),
+        $noinline$returnLongArg(0xf00000000L + 144L),
+        $noinline$returnIntArg(146),
+        $noinline$returnLongArg(0xf00000000L + 147L),
+        $noinline$returnIntArg(149),
+        $noinline$returnLongArg(0xf00000000L + 150L),
+        $noinline$returnIntArg(152),
+        $noinline$returnLongArg(0xf00000000L + 153L),
+        $noinline$returnIntArg(155),
+        $noinline$returnLongArg(0xf00000000L + 156L),
+        $noinline$returnIntArg(158),
+        $noinline$returnLongArg(0xf00000000L + 159L),
+        $noinline$returnIntArg(161),
+        $noinline$returnLongArg(0xf00000000L + 162L),
+        $noinline$returnIntArg(164),
+        $noinline$returnLongArg(0xf00000000L + 165L),
+        $noinline$returnIntArg(167),
+        $noinline$returnLongArg(0xf00000000L + 168L),
+        $noinline$returnIntArg(170),
+        $noinline$returnLongArg(0xf00000000L + 171L),
+        $noinline$returnIntArg(173),
+        $noinline$returnLongArg(0xf00000000L + 174L),
+        $noinline$returnIntArg(176),
+        $noinline$returnLongArg(0xf00000000L + 177L),
+        $noinline$returnIntArg(179),
+        $noinline$returnLongArg(0xf00000000L + 180L),
+        $noinline$returnIntArg(182),
+        $noinline$returnLongArg(0xf00000000L + 183L),
+        $noinline$returnIntArg(185),
+        $noinline$returnLongArg(0xf00000000L + 186L),
+        $noinline$returnIntArg(188),
+        $noinline$returnLongArg(0xf00000000L + 189L),
+        $noinline$returnIntArg(191),
+        $noinline$returnLongArg(0xf00000000L + 192L),
+        $noinline$returnIntArg(194),
+        $noinline$returnLongArg(0xf00000000L + 195L),
+        $noinline$returnIntArg(197),
+        $noinline$returnLongArg(0xf00000000L + 198L),
+        $noinline$returnIntArg(200),
+        $noinline$returnLongArg(0xf00000000L + 201L),
+        $noinline$returnIntArg(203),
+        $noinline$returnLongArg(0xf00000000L + 204L),
+        $noinline$returnIntArg(206),
+        $noinline$returnLongArg(0xf00000000L + 207L),
+        $noinline$returnIntArg(209),
+        $noinline$returnLongArg(0xf00000000L + 210L),
+        $noinline$returnIntArg(212),
+        $noinline$returnLongArg(0xf00000000L + 213L),
+        $noinline$returnIntArg(215),
+        $noinline$returnLongArg(0xf00000000L + 216L),
+        $noinline$returnIntArg(218),
+        $noinline$returnLongArg(0xf00000000L + 219L),
+        $noinline$returnIntArg(221),
+        $noinline$returnLongArg(0xf00000000L + 222L),
+        $noinline$returnIntArg(224),
+        $noinline$returnLongArg(0xf00000000L + 225L),
+        $noinline$returnIntArg(227),
+        $noinline$returnLongArg(0xf00000000L + 228L),
+        $noinline$returnIntArg(230),
+        $noinline$returnLongArg(0xf00000000L + 231L),
+        $noinline$returnIntArg(233),
+        $noinline$returnLongArg(0xf00000000L + 234L),
+        $noinline$returnIntArg(236),
+        $noinline$returnLongArg(0xf00000000L + 237L),
+        $noinline$returnIntArg(239),
+        $noinline$returnLongArg(0xf00000000L + 240L),
+        $noinline$returnIntArg(242),
+        $noinline$returnLongArg(0xf00000000L + 243L),
+        $noinline$returnIntArg(245),
+        $noinline$returnLongArg(0xf00000000L + 246L),
+        $noinline$returnIntArg(248),
+        $noinline$returnLongArg(0xf00000000L + 249L),
+        $noinline$returnIntArg(251),
+        $noinline$returnLongArg(0xf00000000L + 252L),
+        $noinline$returnIntArg(254)));
+  }
+
+  static double $noinline$returnDoubleArg(double d) { return d; }
+  static float $noinline$returnFloatArg(float f) { return f; }
+  static int $noinline$returnIntArg(int i) { return i; }
+  static long $noinline$returnLongArg(long l) { return l; }
+
   static void $noinline$regressionTestB181736463() {
     // Regression test for bug 181736463 (GenericJNI crashing when class initializer throws).
     try {
@@ -820,6 +1018,22 @@
       int i251,
       long l252,
       int i254);
+
+  // This signature exercises passing FP args in core registers on riscv64.
+  @CriticalNative
+  public static native int nativeDFDFDFDFDFIJ(
+      double d1,
+      float f1,
+      double d2,
+      float f2,
+      double d3,
+      float f3,
+      double d4,
+      float f4,
+      double d5,
+      float f5,
+      int i,
+      long j);
 }
 
 class CriticalClinitCheck {
diff --git a/test/180-native-default-method/build.py b/test/180-native-default-method/build.py
index 62aac82..d88008f 100644
--- a/test/180-native-default-method/build.py
+++ b/test/180-native-default-method/build.py
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 def build(ctx):
-  ctx.default_build()
+  ctx.default_build(d8_dex_container=False)
   if ctx.jvm:
     return
   # Change the generated dex file to have a v35 magic number if it is version 38
diff --git a/test/182-method-linking/Android.bp b/test/182-method-linking/Android.bp
index cee24a9..699b75b 100644
--- a/test/182-method-linking/Android.bp
+++ b/test/182-method-linking/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-182-method-linking-src"
+        "art-run-test-182-method-linking-src",
     ],
     data: [
         ":art-run-test-182-method-linking-expected-stdout",
diff --git a/test/183-rmw-stress-test/build.py b/test/183-rmw-stress-test/build.py
new file mode 100644
index 0000000..bafd202
--- /dev/null
+++ b/test/183-rmw-stress-test/build.py
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def build(ctx):
+  ctx.default_build(api_level="var-handles")
diff --git a/test/015-switch/expected-stderr.txt b/test/183-rmw-stress-test/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/183-rmw-stress-test/expected-stderr.txt
diff --git a/test/015-switch/expected-stderr.txt b/test/183-rmw-stress-test/expected-stdout.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/183-rmw-stress-test/expected-stdout.txt
diff --git a/test/183-rmw-stress-test/info.txt b/test/183-rmw-stress-test/info.txt
new file mode 100644
index 0000000..22d04c9
--- /dev/null
+++ b/test/183-rmw-stress-test/info.txt
@@ -0,0 +1 @@
+Stress-test for spurious failures of read-modify-write operations. Bug: 218453177
diff --git a/test/183-rmw-stress-test/run.py b/test/183-rmw-stress-test/run.py
new file mode 100644
index 0000000..e0e7876
--- /dev/null
+++ b/test/183-rmw-stress-test/run.py
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def run(ctx, args):
+  # Limit the Java heap to 16MiB to force more GCs.
+  ctx.default_run(args, runtime_option=["-Xmx16m"])
diff --git a/test/183-rmw-stress-test/smali/AtomicReferenceWrapper.smali b/test/183-rmw-stress-test/smali/AtomicReferenceWrapper.smali
new file mode 100644
index 0000000..91c9860
--- /dev/null
+++ b/test/183-rmw-stress-test/smali/AtomicReferenceWrapper.smali
@@ -0,0 +1,29 @@
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+.class public LAtomicReferenceWrapper;
+.super LAtomicReferenceDispatch;
+
+.method public constructor <init>()V
+  .registers 1
+  invoke-direct {p0}, LAtomicReferenceDispatch;-><init>()V
+  return-void
+.end method
+
+.method public compareAndSet(Ljava/util/concurrent/atomic/AtomicReference;Ljava/lang/Object;Ljava/lang/Object;)Z
+  .registers 5
+  invoke-virtual {p1, p2, p3}, Ljava/util/concurrent/atomic/AtomicReference;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;)Z
+  move-result v0
+  return v0
+.end method
diff --git a/test/183-rmw-stress-test/smali/UnsafeWrapper.smali b/test/183-rmw-stress-test/smali/UnsafeWrapper.smali
new file mode 100644
index 0000000..4502ad3
--- /dev/null
+++ b/test/183-rmw-stress-test/smali/UnsafeWrapper.smali
@@ -0,0 +1,29 @@
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+.class public LUnsafeWrapper;
+.super LUnsafeDispatch;
+
+.method public constructor <init>()V
+  .registers 1
+  invoke-direct {p0}, LUnsafeDispatch;-><init>()V
+  return-void
+.end method
+
+.method public compareAndSwapObject(Lsun/misc/Unsafe;Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z
+  .registers 8
+  invoke-virtual/range {p1..p6}, Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z
+  move-result v0
+  return v0
+.end method
diff --git a/test/183-rmw-stress-test/src/Main.java b/test/183-rmw-stress-test/src/Main.java
new file mode 100644
index 0000000..fa9fe51
--- /dev/null
+++ b/test/183-rmw-stress-test/src/Main.java
@@ -0,0 +1,481 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
+import java.lang.reflect.Field;
+import java.util.concurrent.atomic.AtomicReference;
+import sun.misc.Unsafe;
+
+class Main {
+    public static void main(String args[]) throws Exception {
+        // Stress-test read-modify-write operations in adjacent memory locations.
+        // This is intended to uncover bugs triggered by spurious CAS failures on
+        // architectures where such spurious failures can happen. Bug: 218453177
+        $noinline$testVarHandleBytes();
+        $noinline$testVarHandleInts();
+        $noinline$testVarHandleLongs();
+        $noinline$testVarHandleReferences();
+        $noinline$testUnsafeInts();
+        $noinline$testUnsafeLongs();
+        $noinline$testUnsafeReferences();
+
+        // Stress-test read-modify-write operations on the same memory locations.
+        // This is intended to uncover bugs with false-positive comparison in CAS.
+        $noinline$testAtomicReference();
+    }
+
+    public static void $noinline$testVarHandleBytes() throws Exception {
+        // Prepare `VarHandle` objects.
+        VarHandle[] vhs = new VarHandle[] {
+                MethodHandles.lookup().findVarHandle(FourBytes.class, "b1", byte.class),
+                MethodHandles.lookup().findVarHandle(FourBytes.class, "b2", byte.class),
+                MethodHandles.lookup().findVarHandle(FourBytes.class, "b3", byte.class),
+                MethodHandles.lookup().findVarHandle(FourBytes.class, "b4", byte.class)
+        };
+        // Prepare threads.
+        final FourBytes fourBytes = new FourBytes();
+        final StopFlag stopFlag = new StopFlag();
+        Thread[] threads = new Thread[4];
+        for (int i = 0; i != 4; ++i) {
+            final VarHandle vh = vhs[i];
+            threads[i] = new Thread() {
+                public void run() {
+                    byte value = 0;
+                    while (!stopFlag.stop) {
+                        byte nextValue = (byte) (value + 1);
+                        boolean success = vh.compareAndSet(fourBytes, value, nextValue);
+                        assertTrue(success);
+                        value = nextValue;
+                    }
+                }
+            };
+        }
+        // Start threads.
+        for (int i = 0; i != 4; ++i) {
+            threads[i].start();
+        }
+        // Let the threads run for 5s.
+        Thread.sleep(5000);
+        // Stop threads.
+        stopFlag.stop = true;
+        for (int i = 0; i != 4; ++i) {
+            threads[i].join();
+        }
+    }
+
+    public static void $noinline$testVarHandleInts() throws Exception {
+        // Prepare `VarHandle` objects.
+        VarHandle[] vhs = new VarHandle[] {
+                MethodHandles.lookup().findVarHandle(FourInts.class, "i1", int.class),
+                MethodHandles.lookup().findVarHandle(FourInts.class, "i2", int.class),
+                MethodHandles.lookup().findVarHandle(FourInts.class, "i3", int.class),
+                MethodHandles.lookup().findVarHandle(FourInts.class, "i4", int.class)
+        };
+        // Prepare threads.
+        final FourInts fourInts = new FourInts();
+        final StopFlag stopFlag = new StopFlag();
+        Thread[] threads = new Thread[4];
+        for (int i = 0; i != 4; ++i) {
+            final VarHandle vh = vhs[i];
+            threads[i] = new Thread() {
+                public void run() {
+                    int value = 0;
+                    while (!stopFlag.stop) {
+                        int nextValue = value + 1;
+                        boolean success = vh.compareAndSet(fourInts, value, nextValue);
+                        assertTrue(success);
+                        value = nextValue;
+                    }
+                }
+            };
+        }
+        // Start threads.
+        for (int i = 0; i != 4; ++i) {
+            threads[i].start();
+        }
+        // Let the threads run for 5s.
+        Thread.sleep(5000);
+        // Stop threads.
+        stopFlag.stop = true;
+        for (int i = 0; i != 4; ++i) {
+            threads[i].join();
+        }
+    }
+
+    public static void $noinline$testVarHandleLongs() throws Exception {
+        // Prepare `VarHandle` objects.
+        VarHandle[] vhs = new VarHandle[] {
+                MethodHandles.lookup().findVarHandle(FourLongs.class, "l1", long.class),
+                MethodHandles.lookup().findVarHandle(FourLongs.class, "l2", long.class),
+                MethodHandles.lookup().findVarHandle(FourLongs.class, "l3", long.class),
+                MethodHandles.lookup().findVarHandle(FourLongs.class, "l4", long.class)
+        };
+        // Prepare threads.
+        final FourLongs fourLongs = new FourLongs();
+        final StopFlag stopFlag = new StopFlag();
+        Thread[] threads = new Thread[4];
+        for (int i = 0; i != 4; ++i) {
+            final VarHandle vh = vhs[i];
+            threads[i] = new Thread() {
+                public void run() {
+                    long value = 0;
+                    while (!stopFlag.stop) {
+                        long nextValue = value + 1L;
+                        boolean success = vh.compareAndSet(fourLongs, value, nextValue);
+                        assertTrue(success);
+                        value = nextValue;
+                    }
+                }
+            };
+        }
+        // Start threads.
+        for (int i = 0; i != 4; ++i) {
+            threads[i].start();
+        }
+        // Let the threads run for 5s.
+        Thread.sleep(5000);
+        // Stop threads.
+        stopFlag.stop = true;
+        for (int i = 0; i != 4; ++i) {
+            threads[i].join();
+        }
+    }
+
+    public static void $noinline$testVarHandleReferences() throws Exception {
+        // Prepare `VarHandle` objects.
+        VarHandle[] vhs = new VarHandle[] {
+                MethodHandles.lookup().findVarHandle(FourReferences.class, "r1", Object.class),
+                MethodHandles.lookup().findVarHandle(FourReferences.class, "r2", Object.class),
+                MethodHandles.lookup().findVarHandle(FourReferences.class, "r3", Object.class),
+                MethodHandles.lookup().findVarHandle(FourReferences.class, "r4", Object.class)
+        };
+        // Prepare threads.
+        final FourReferences fourReferences = new FourReferences();
+        Object[] values = new Object[] {
+                null,
+                new Object(),
+                new Object(),
+                new Object()
+        };
+        final StopFlag stopFlag = new StopFlag();
+        Thread[] threads = new Thread[4];
+        for (int i = 0; i != 4; ++i) {
+            final VarHandle vh = vhs[i];
+            threads[i] = new Thread() {
+                public void run() {
+                    int index = 0;
+                    while (!stopFlag.stop) {
+                        Object value = values[index];
+                        index = (index + 1) & 3;
+                        Object nextValue = values[index];
+                        boolean success = vh.compareAndSet(fourReferences, value, nextValue);
+                        assertTrue(success);
+                    }
+                }
+            };
+        }
+        // Start threads.
+        for (int i = 0; i != 4; ++i) {
+            threads[i].start();
+        }
+        // Allocate memory to trigger some GCs
+        for (int i = 0; i != 640 * 1024; ++i) {
+            $noinline$allocateAtLeast1KiB();
+        }
+        // Stop threads.
+        stopFlag.stop = true;
+        for (int i = 0; i != 4; ++i) {
+            threads[i].join();
+        }
+    }
+
+    public static void $noinline$testUnsafeInts() throws Exception {
+        // Prepare Unsafe offsets.
+        final Unsafe unsafe = getUnsafe();
+        long[] offsets = new long[] {
+                unsafe.objectFieldOffset(FourInts.class.getField("i1")),
+                unsafe.objectFieldOffset(FourInts.class.getField("i2")),
+                unsafe.objectFieldOffset(FourInts.class.getField("i3")),
+                unsafe.objectFieldOffset(FourInts.class.getField("i4"))
+        };
+        // Prepare threads.
+        final FourInts fourInts = new FourInts();
+        final StopFlag stopFlag = new StopFlag();
+        Thread[] threads = new Thread[4];
+        for (int i = 0; i != 4; ++i) {
+            final long offset = offsets[i];
+            threads[i] = new Thread() {
+                public void run() {
+                    int value = 0;
+                    while (!stopFlag.stop) {
+                        int nextValue = value + 1;
+                        boolean success = unsafe.compareAndSwapInt(
+                                fourInts, offset, value, nextValue);
+                        assertTrue(success);
+                        value = nextValue;
+                    }
+                }
+            };
+        }
+        // Start threads.
+        for (int i = 0; i != 4; ++i) {
+            threads[i].start();
+        }
+        // Let the threads run for 5s.
+        Thread.sleep(5000);
+        // Stop threads.
+        stopFlag.stop = true;
+        for (int i = 0; i != 4; ++i) {
+            threads[i].join();
+        }
+    }
+
+    public static void $noinline$testUnsafeLongs() throws Exception {
+        // Prepare Unsafe offsets.
+        final Unsafe unsafe = getUnsafe();
+        long[] offsets = new long[] {
+                unsafe.objectFieldOffset(FourLongs.class.getField("l1")),
+                unsafe.objectFieldOffset(FourLongs.class.getField("l2")),
+                unsafe.objectFieldOffset(FourLongs.class.getField("l3")),
+                unsafe.objectFieldOffset(FourLongs.class.getField("l4"))
+        };
+        // Prepare threads.
+        final FourLongs fourLongs = new FourLongs();
+        final StopFlag stopFlag = new StopFlag();
+        Thread[] threads = new Thread[4];
+        for (int i = 0; i != 4; ++i) {
+            final long offset = offsets[i];
+            threads[i] = new Thread() {
+                public void run() {
+                    long value = 0;
+                    while (!stopFlag.stop) {
+                        long nextValue = value + 1L;
+                        boolean success = unsafe.compareAndSwapLong(
+                                fourLongs, offset, value, nextValue);
+                        assertTrue(success);
+                        value = nextValue;
+                    }
+                }
+            };
+        }
+        // Start threads.
+        for (int i = 0; i != 4; ++i) {
+            threads[i].start();
+        }
+        // Let the threads run for 5s.
+        Thread.sleep(5000);
+        // Stop threads.
+        stopFlag.stop = true;
+        for (int i = 0; i != 4; ++i) {
+            threads[i].join();
+        }
+    }
+
+    public static void $noinline$testUnsafeReferences() throws Exception {
+        // Prepare Unsafe offsets.
+        // D8 rewrites the bytecode with a workaround for CAS bug. To test the raw
+        // `Unsafe.compareAndSwapObject()` call, we implement the call in smali
+        // and wrap it in an indirect call.
+        final UnsafeDispatch unsafeDispatch =
+                (UnsafeDispatch) Class.forName("UnsafeWrapper").newInstance();
+        final Unsafe unsafe = getUnsafe();
+        long[] offsets = new long[] {
+                unsafe.objectFieldOffset(FourReferences.class.getField("r1")),
+                unsafe.objectFieldOffset(FourReferences.class.getField("r2")),
+                unsafe.objectFieldOffset(FourReferences.class.getField("r3")),
+                unsafe.objectFieldOffset(FourReferences.class.getField("r4"))
+        };
+        // Prepare threads.
+        final FourReferences fourReferences = new FourReferences();
+        Object[] values = new Object[] {
+                null,
+                new Object(),
+                new Object(),
+                new Object()
+        };
+        final StopFlag stopFlag = new StopFlag();
+        Thread[] threads = new Thread[4];
+        for (int i = 0; i != 4; ++i) {
+            final long offset = offsets[i];
+            threads[i] = new Thread() {
+                public void run() {
+                    int index = 0;
+                    while (!stopFlag.stop) {
+                        Object value = values[index];
+                        index = (index + 1) & 3;
+                        Object nextValue = values[index];
+                        boolean success = unsafeDispatch.compareAndSwapObject(
+                                unsafe, fourReferences, offset, value, nextValue);
+                        assertTrue(success);
+                    }
+                }
+            };
+        }
+        // Start threads.
+        for (int i = 0; i != 4; ++i) {
+            threads[i].start();
+        }
+        // Allocate memory to trigger some GCs
+        for (int i = 0; i != 640 * 1024; ++i) {
+            $noinline$allocateAtLeast1KiB();
+        }
+        // Stop threads.
+        stopFlag.stop = true;
+        for (int i = 0; i != 4; ++i) {
+            threads[i].join();
+        }
+    }
+
+    // Instead of using a `VarHandle` directly, this test uses `AtomicReference` which is
+    // implemented using a `VarHandle`. This is because the normal `VarHandle` checks are
+    // done without read barrier which makes them likely to fail and take the slow-path to
+    // the runtime while the GC is marking (which is the case we're most interested in).
+    // The `AtomicReference` uses a boot-image `VarHandle` which is optimized to avoid
+    // those checks, making it more likely to hit bugs in the raw RMW operation.
+    public static void $noinline$testAtomicReference() throws Exception {
+        // Prepare `AtomicReference` object.
+        // D8 rewrites the bytecode with a workaround for CAS bug. To test the raw
+        // `AtomicReference.compareAndSet()` call, we implement the call in smali
+        // and wrap it in an indirect call.
+        final AtomicReferenceDispatch atomicReferenceDispatch =
+                (AtomicReferenceDispatch) Class.forName("AtomicReferenceWrapper").newInstance();
+        final AtomicReference aref = new AtomicReference(null);
+        // Prepare threads.
+        final Object[] objects = new Object[] {
+                null,
+                new Object(),
+                new Object(),
+                new Object()
+        };
+        final StopFlag stopFlag = new StopFlag();
+        Thread[] threads = new Thread[4];
+        for (int i = 0; i != 4; ++i) {
+            if (i == 0) {
+                threads[i] = new Thread() {
+                    public void run() {
+                        int index = 0;
+                        Object value = objects[index];
+                        while (!stopFlag.stop) {
+                            index = (index + 1) & 3;
+                            Object nextValue = objects[index];
+                            boolean success = atomicReferenceDispatch.compareAndSet(
+                                    aref, value, nextValue);
+                            assertTrue(success);
+                            value = nextValue;
+                        }
+                    }
+                };
+            } else {
+                final Object value = objects[i];
+                assertTrue(value != null);
+                threads[i] = new Thread() {
+                    public void run() {
+                        // This thread is trying to overwrite a value with the same value.
+                        // For a false-positive in CAS compare, it would actually change
+                        // the value and cause the thread `threads[0]` to fail.
+                        assertTrue(value != null);
+                        while (!stopFlag.stop) {
+                            // Do not check the return value.
+                            atomicReferenceDispatch.compareAndSet(aref, value, value);
+                        }
+                    }
+                };
+            }
+        };
+        // Start threads.
+        for (int i = 0; i != 4; ++i) {
+            threads[i].start();
+        }
+        // Allocate memory to trigger some GCs
+        for (int i = 0; i != 640 * 1024; ++i) {
+            $noinline$allocateAtLeast1KiB();
+        }
+        // Stop threads.
+        stopFlag.stop = true;
+        for (int i = 0; i != 4; ++i) {
+            threads[i].join();
+        }
+    }
+
+    public static void assertTrue(boolean value) {
+        if (!value) {
+            throw new Error("Assertion failed!");
+        }
+    }
+
+    public static Unsafe getUnsafe() throws Exception {
+        Class<?> unsafeClass = Class.forName("sun.misc.Unsafe");
+        Field f = unsafeClass.getDeclaredField("theUnsafe");
+        f.setAccessible(true);
+        return (Unsafe) f.get(null);
+    }
+
+    public static void $noinline$allocateAtLeast1KiB() {
+        // Give GC more work by allocating Object arrays.
+        memory[allocationIndex] = new Object[1024 / 4];
+        ++allocationIndex;
+        if (allocationIndex == memory.length) {
+            allocationIndex = 0;
+        }
+    }
+
+    // We shall retain some allocated memory and release old allocations
+    // so that the GC has something to do.
+    public static Object[] memory = new Object[1024];
+    public static int allocationIndex = 0;
+}
+
+class StopFlag {
+    public volatile boolean stop = false;
+}
+
+class FourBytes {
+    public byte b1 = (byte) 0;
+    public byte b2 = (byte) 0;
+    public byte b3 = (byte) 0;
+    public byte b4 = (byte) 0;
+}
+
+class FourInts {
+    public int i1 = 0;
+    public int i2 = 0;
+    public int i3 = 0;
+    public int i4 = 0;
+}
+
+class FourLongs {
+    public long l1 = 0L;
+    public long l2 = 0L;
+    public long l3 = 0L;
+    public long l4 = 0L;
+}
+
+class FourReferences {
+    public Object r1 = null;
+    public Object r2 = null;
+    public Object r3 = null;
+    public Object r4 = null;
+}
+
+abstract class UnsafeDispatch {
+    public abstract boolean compareAndSwapObject(
+            Unsafe unsafe, Object obj, long offset, Object expected, Object new_value);
+}
+
+abstract class AtomicReferenceDispatch {
+    public abstract boolean compareAndSet(AtomicReference aref, Object expected, Object new_value);
+}
diff --git a/test/1919-vminit-thread-start-timing/vminit.cc b/test/1919-vminit-thread-start-timing/vminit.cc
index ddf6649..2318961 100644
--- a/test/1919-vminit-thread-start-timing/vminit.cc
+++ b/test/1919-vminit-thread-start-timing/vminit.cc
@@ -65,7 +65,7 @@
 
 static void JNICALL Test1919AgentThread(jvmtiEnv* jvmti,
                                         JNIEnv* env,
-                                        void* arg ATTRIBUTE_UNUSED) {
+                                        [[maybe_unused]] void* arg) {
   EventList* list = nullptr;
   CheckJvmtiError(jvmti, jvmti->GetEnvironmentLocalStorage(reinterpret_cast<void**>(&list)));
   CheckJvmtiError(jvmti, jvmti->RawMonitorEnter(list->events_mutex));
@@ -140,8 +140,8 @@
 }
 
 jint OnLoad(JavaVM* vm,
-            char* options ATTRIBUTE_UNUSED,
-            void* reserved ATTRIBUTE_UNUSED) {
+            [[maybe_unused]] char* options,
+            [[maybe_unused]] void* reserved) {
   if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0) != 0) {
     printf("Unable to get jvmti env!\n");
     return 1;
diff --git a/test/1922-owned-monitors-info/owned_monitors.cc b/test/1922-owned-monitors-info/owned_monitors.cc
index 66a8368..e95c914 100644
--- a/test/1922-owned-monitors-info/owned_monitors.cc
+++ b/test/1922-owned-monitors-info/owned_monitors.cc
@@ -68,7 +68,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test1922_00024Target_lockNative(
-    JNIEnv* env, jobject thiz ATTRIBUTE_UNUSED, jobject mon, jobject next) {
+    JNIEnv* env, [[maybe_unused]] jobject thiz, jobject mon, jobject next) {
   if (doMonitorEnter(env, mon)) {
     return;
   }
diff --git a/test/1936-thread-end-events/method_trace.cc b/test/1936-thread-end-events/method_trace.cc
index 019b6a9..edfff90 100644
--- a/test/1936-thread-end-events/method_trace.cc
+++ b/test/1936-thread-end-events/method_trace.cc
@@ -52,8 +52,8 @@
   return env->CallStaticObjectMethod(klass, targetMethod);
 }
 
-extern "C" JNIEXPORT void JNICALL Java_art_Test989_doNothingNative(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                                   jclass klass ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT void JNICALL Java_art_Test989_doNothingNative([[maybe_unused]] JNIEnv* env,
+                                                                   [[maybe_unused]] jclass klass) {
   return;
 }
 
diff --git a/test/1945-proxy-method-arguments/get_args.cc b/test/1945-proxy-method-arguments/get_args.cc
index 859e229..c1b6e64 100644
--- a/test/1945-proxy-method-arguments/get_args.cc
+++ b/test/1945-proxy-method-arguments/get_args.cc
@@ -17,7 +17,7 @@
 #include "arch/context.h"
 #include "art_method-inl.h"
 #include "jni.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "scoped_thread_state_change-inl.h"
 #include "stack.h"
 #include "thread.h"
@@ -104,7 +104,7 @@
 }
 
 extern "C" JNIEXPORT jobject JNICALL Java_TestInvocationHandler_getArgument(
-    JNIEnv* env ATTRIBUTE_UNUSED, jobject thiz ATTRIBUTE_UNUSED, int arg_pos, int frame_depth) {
+    [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jobject thiz, int arg_pos, int frame_depth) {
   return GetProxyReferenceArgument(arg_pos, frame_depth);
 }
 
diff --git a/test/1950-unprepared-transform/expected-stdout.txt b/test/1950-unprepared-transform/expected-stdout.txt
index 3be28a5..b3a6f30 100644
--- a/test/1950-unprepared-transform/expected-stdout.txt
+++ b/test/1950-unprepared-transform/expected-stdout.txt
@@ -1,5 +1,5 @@
 Redefine in ClassLoad on current thread.
-Trying to redefine: class Transform. Caught error class java.lang.Exception: Failed to retransform class <LTransform;> due to JVMTI_ERROR_INTERNAL
+Trying to redefine: class Transform. Caught error class java.lang.Exception: Failed to retransform class <LTransform;> due to JVMTI_ERROR_INTERNAL (FAILURE TO RETRANSFORM Modification of class java.lang.Class<Transform> from within the classes ClassLoad callback is not supported to prevent deadlocks. Please use ClassFileLoadHook directly instead.)
 Object out is: NON Transformed Object
 Redefine during ClassLoad on another thread.
 retransformClasses on an unprepared class succeeded
diff --git a/test/1950-unprepared-transform/unprepared_transform.cc b/test/1950-unprepared-transform/unprepared_transform.cc
index 620ede8..93c4b3e 100644
--- a/test/1950-unprepared-transform/unprepared_transform.cc
+++ b/test/1950-unprepared-transform/unprepared_transform.cc
@@ -37,15 +37,15 @@
 jclass kMainClass = nullptr;
 jmethodID kPrepareFunc = nullptr;
 
-extern "C" JNIEXPORT void ClassLoadCallback(jvmtiEnv* jvmti ATTRIBUTE_UNUSED,
-                                               JNIEnv* env,
-                                               jthread thr ATTRIBUTE_UNUSED,
-                                               jclass klass) {
+extern "C" JNIEXPORT void ClassLoadCallback([[maybe_unused]] jvmtiEnv* jvmti,
+                                            JNIEnv* env,
+                                            [[maybe_unused]] jthread thr,
+                                            jclass klass) {
   env->CallStaticVoidMethod(kMainClass, kPrepareFunc, klass);
 }
 
 extern "C" JNIEXPORT void JNICALL Java_Main_clearClassLoadHook(
-    JNIEnv* env, jclass main ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass main, jthread thr) {
   JvmtiErrorToException(env,
                         jvmti_env,
                         jvmti_env->SetEventNotificationMode(JVMTI_DISABLE,
diff --git a/test/1953-pop-frame/pop_frame.cc b/test/1953-pop-frame/pop_frame.cc
index 86345d6..9b3af96 100644
--- a/test/1953-pop-frame/pop_frame.cc
+++ b/test/1953-pop-frame/pop_frame.cc
@@ -44,7 +44,7 @@
 
 extern "C" JNIEXPORT
 void JNICALL Java_art_Test1953_popFrame(JNIEnv* env,
-                                        jclass klass ATTRIBUTE_UNUSED,
+                                        [[maybe_unused]] jclass klass,
                                         jthread thr) {
   JvmtiErrorToException(env, jvmti_env, jvmti_env->PopFrame(thr));
 }
diff --git a/test/1957-error-ext/expected-stdout.txt b/test/1957-error-ext/expected-stdout.txt
index bfe7033..528ee84 100644
--- a/test/1957-error-ext/expected-stdout.txt
+++ b/test/1957-error-ext/expected-stdout.txt
@@ -1,4 +1,4 @@
 LastError is: <call returned error: class java.lang.RuntimeException: JVMTI_ERROR_ABSENT_INFORMATION>
-Got class java.lang.Exception: Failed to redefine class <Lart/Test1957$Transform;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED
+Got class java.lang.Exception: Failed to redefine class <Lart/Test1957$Transform;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED (FAILURE TO REDEFINE Unable to perform redefinition of 'Lart/Test1957$Transform;': Total number of declared methods changed from 2 to 1)
 LastError is: FAILURE TO REDEFINE Unable to perform redefinition of 'Lart/Test1957$Transform;': Total number of declared methods changed from 2 to 1
 LastError is: <call returned error: class java.lang.RuntimeException: JVMTI_ERROR_ABSENT_INFORMATION>
diff --git a/test/1957-error-ext/lasterror.cc b/test/1957-error-ext/lasterror.cc
index 5aa3fbe..41c5f13 100644
--- a/test/1957-error-ext/lasterror.cc
+++ b/test/1957-error-ext/lasterror.cc
@@ -84,7 +84,7 @@
 }
 
 extern "C" JNIEXPORT
-jstring JNICALL Java_art_Test1957_getLastError(JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+jstring JNICALL Java_art_Test1957_getLastError(JNIEnv* env, [[maybe_unused]] jclass klass) {
   GetLastError get_last_error = reinterpret_cast<GetLastError>(
       FindExtensionMethod(env, "com.android.art.misc.get_last_error_message"));
   if (get_last_error == nullptr) {
@@ -99,7 +99,7 @@
 }
 
 extern "C" JNIEXPORT
-void JNICALL Java_art_Test1957_clearLastError(JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+void JNICALL Java_art_Test1957_clearLastError(JNIEnv* env, [[maybe_unused]] jclass klass) {
   ClearLastError clear_last_error = reinterpret_cast<ClearLastError>(
       FindExtensionMethod(env, "com.android.art.misc.clear_last_error_message"));
   if (clear_last_error == nullptr) {
diff --git a/test/1959-redefine-object-instrument/fake_redef_object.cc b/test/1959-redefine-object-instrument/fake_redef_object.cc
index b1201ab..a5b6a7d 100644
--- a/test/1959-redefine-object-instrument/fake_redef_object.cc
+++ b/test/1959-redefine-object-instrument/fake_redef_object.cc
@@ -39,10 +39,10 @@
 // Just pull it out of the dex file but don't bother changing anything.
 static void JNICALL RedefineObjectHook(jvmtiEnv *jvmti_env,
                                        JNIEnv* env,
-                                       jclass class_being_redefined ATTRIBUTE_UNUSED,
-                                       jobject loader ATTRIBUTE_UNUSED,
+                                       [[maybe_unused]] jclass class_being_redefined,
+                                       [[maybe_unused]] jobject loader,
                                        const char* name,
-                                       jobject protection_domain ATTRIBUTE_UNUSED,
+                                       [[maybe_unused]] jobject protection_domain,
                                        jint class_data_len,
                                        const unsigned char* class_data,
                                        jint* new_class_data_len,
@@ -93,7 +93,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_Main_forceRedefine(JNIEnv* env,
-                                                          jclass klass ATTRIBUTE_UNUSED,
+                                                          [[maybe_unused]] jclass klass,
                                                           jclass obj_class,
                                                           jthread thr) {
   if (IsJVM()) {
diff --git a/test/1962-multi-thread-events/multi_thread_events.cc b/test/1962-multi-thread-events/multi_thread_events.cc
index aeb15b0..f27640a 100644
--- a/test/1962-multi-thread-events/multi_thread_events.cc
+++ b/test/1962-multi-thread-events/multi_thread_events.cc
@@ -38,8 +38,8 @@
                    JNIEnv* env,
                    jthread thread,
                    jmethodID method,
-                   jboolean was_exception ATTRIBUTE_UNUSED,
-                   jvalue val ATTRIBUTE_UNUSED) {
+                   [[maybe_unused]] jboolean was_exception,
+                   [[maybe_unused]] jvalue val) {
   BreakpointData* data = nullptr;
   if (JvmtiErrorToException(
           env, jvmti, jvmti->GetThreadLocalStorage(thread, reinterpret_cast<void**>(&data)))) {
@@ -56,7 +56,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test1962_setupTest(JNIEnv* env,
-                                                              jclass klass ATTRIBUTE_UNUSED) {
+                                                              [[maybe_unused]] jclass klass) {
   jvmtiCapabilities caps{
     .can_generate_method_exit_events = 1,
   };
@@ -70,7 +70,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test1962_setupThread(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr, jobject events, jobject target) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jthread thr, jobject events, jobject target) {
   BreakpointData* data = nullptr;
   if (JvmtiErrorToException(
           env, jvmti_env, jvmti_env->Allocate(sizeof(*data), reinterpret_cast<uint8_t**>(&data)))) {
diff --git a/test/1972-jni-id-swap-indices/jni_id.cc b/test/1972-jni-id-swap-indices/jni_id.cc
index 7de7131..f3c2a62 100644
--- a/test/1972-jni-id-swap-indices/jni_id.cc
+++ b/test/1972-jni-id-swap-indices/jni_id.cc
@@ -27,7 +27,7 @@
 namespace art {
 
 extern "C" JNIEXPORT jlong JNICALL Java_Main_GetMethodId(JNIEnv* env,
-                                                         jclass k ATTRIBUTE_UNUSED,
+                                                         [[maybe_unused]] jclass k,
                                                          bool is_static,
                                                          jclass target,
                                                          jstring name,
@@ -42,18 +42,18 @@
   return res;
 }
 
-extern "C" JNIEXPORT jobject JNICALL Java_Main_GetJniType(JNIEnv* env, jclass k ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT jobject JNICALL Java_Main_GetJniType(JNIEnv* env, [[maybe_unused]] jclass k) {
   std::ostringstream oss;
   oss << Runtime::Current()->GetJniIdType();
   return env->NewStringUTF(oss.str().c_str());
 }
 
-extern "C" JNIEXPORT void JNICALL Java_Main_SetToPointerIds(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                            jclass k ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT void JNICALL Java_Main_SetToPointerIds([[maybe_unused]] JNIEnv* env,
+                                                            [[maybe_unused]] jclass k) {
   Runtime::Current()->SetJniIdType(JniIdType::kPointer);
 }
-extern "C" JNIEXPORT void JNICALL Java_Main_SetToIndexIds(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                          jclass k ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT void JNICALL Java_Main_SetToIndexIds([[maybe_unused]] JNIEnv* env,
+                                                          [[maybe_unused]] jclass k) {
   Runtime::Current()->SetJniIdType(JniIdType::kIndices);
 }
 
diff --git a/test/1974-resize-array/resize_array.cc b/test/1974-resize-array/resize_array.cc
index 60037b8..1746821 100644
--- a/test/1974-resize-array/resize_array.cc
+++ b/test/1974-resize-array/resize_array.cc
@@ -110,7 +110,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test1974_ResizeArray(JNIEnv* env,
-                                                                jclass klass ATTRIBUTE_UNUSED,
+                                                                [[maybe_unused]] jclass klass,
                                                                 jobject ref_gen,
                                                                 jint new_size) {
   ChangeArraySize change_array_size = reinterpret_cast<ChangeArraySize>(
@@ -125,24 +125,24 @@
 }
 
 extern "C" JNIEXPORT jobject JNICALL Java_art_Test1974_ReadJniRef(JNIEnv* env,
-                                                                  jclass klass ATTRIBUTE_UNUSED,
+                                                                  [[maybe_unused]] jclass klass,
                                                                   jlong r) {
   return env->NewLocalRef(reinterpret_cast<jobject>(static_cast<intptr_t>(r)));
 }
 
 extern "C" JNIEXPORT jlong JNICALL
-Java_art_Test1974_GetWeakGlobalJniRef(JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject r) {
+Java_art_Test1974_GetWeakGlobalJniRef(JNIEnv* env, [[maybe_unused]] jclass klass, jobject r) {
   return static_cast<jlong>(reinterpret_cast<intptr_t>(env->NewWeakGlobalRef(r)));
 }
 
 extern "C" JNIEXPORT jlong JNICALL Java_art_Test1974_GetGlobalJniRef(JNIEnv* env,
-                                                                     jclass klass ATTRIBUTE_UNUSED,
+                                                                     [[maybe_unused]] jclass klass,
                                                                      jobject r) {
   return static_cast<jlong>(reinterpret_cast<intptr_t>(env->NewGlobalRef(r)));
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL
-Java_art_Test1974_GetObjectsWithTag(JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jlong tag) {
+Java_art_Test1974_GetObjectsWithTag(JNIEnv* env, [[maybe_unused]] jclass klass, jlong tag) {
   jsize cnt = 0;
   jobject* res = nullptr;
   if (JvmtiErrorToException(
@@ -161,7 +161,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test1974_runNativeTest(JNIEnv* env,
-                                                                  jclass klass ATTRIBUTE_UNUSED,
+                                                                  [[maybe_unused]] jclass klass,
                                                                   jobjectArray arr,
                                                                   jobject resize,
                                                                   jobject print,
@@ -181,7 +181,7 @@
 };
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test1974_StartCollectFrees(JNIEnv* env,
-                                                                      jclass k ATTRIBUTE_UNUSED) {
+                                                                      [[maybe_unused]] jclass k) {
   jvmtiEventCallbacks cb{
     .ObjectFree =
         [](jvmtiEnv* jvmti, jlong tag) {
@@ -208,14 +208,14 @@
 }
 
 extern "C" JNIEXPORT void JNICALL
-Java_art_Test1974_StartAssignObsoleteIncrementedId(JNIEnv* env, jclass k ATTRIBUTE_UNUSED) {
+Java_art_Test1974_StartAssignObsoleteIncrementedId(JNIEnv* env, [[maybe_unused]] jclass k) {
   jint id = FindExtensionEvent(env, "com.android.art.heap.obsolete_object_created");
   if (env->ExceptionCheck()) {
     LOG(INFO) << "Could not find extension event!";
     return;
   }
   using ObsoleteEvent = void (*)(jvmtiEnv * env, jlong * obsolete, jlong * non_obsolete);
-  ObsoleteEvent oe = [](jvmtiEnv* env ATTRIBUTE_UNUSED, jlong* obsolete, jlong* non_obsolete) {
+  ObsoleteEvent oe = []([[maybe_unused]] jvmtiEnv* env, jlong* obsolete, jlong* non_obsolete) {
     *non_obsolete = *obsolete;
     *obsolete = *obsolete + 1;
   };
@@ -226,7 +226,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL
-Java_art_Test1974_EndAssignObsoleteIncrementedId(JNIEnv* env, jclass k ATTRIBUTE_UNUSED) {
+Java_art_Test1974_EndAssignObsoleteIncrementedId(JNIEnv* env, [[maybe_unused]] jclass k) {
   jint id = FindExtensionEvent(env, "com.android.art.heap.obsolete_object_created");
   if (env->ExceptionCheck()) {
     LOG(INFO) << "Could not find extension event!";
@@ -236,7 +236,7 @@
 }
 
 extern "C" JNIEXPORT jlongArray JNICALL
-Java_art_Test1974_CollectFreedTags(JNIEnv* env, jclass k ATTRIBUTE_UNUSED) {
+Java_art_Test1974_CollectFreedTags(JNIEnv* env, [[maybe_unused]] jclass k) {
   if (JvmtiErrorToException(
           env,
           jvmti_env,
diff --git a/test/1980-obsolete-object-cleared/expected-stdout.txt b/test/1980-obsolete-object-cleared/expected-stdout.txt
index 8562dcb..fa95e59 100644
--- a/test/1980-obsolete-object-cleared/expected-stdout.txt
+++ b/test/1980-obsolete-object-cleared/expected-stdout.txt
@@ -37,6 +37,8 @@
 public java.lang.Class java.lang.Class.componentType() on (obsolete)class Main$Transform with [] = null
 Calling public java.lang.invoke.TypeDescriptor$OfField java.lang.Class.componentType() with params: []
 public java.lang.invoke.TypeDescriptor$OfField java.lang.Class.componentType() on (obsolete)class Main$Transform with [] = null
+Calling public java.util.Optional java.lang.Class.describeConstable() with params: []
+public java.util.Optional java.lang.Class.describeConstable() on (obsolete)class Main$Transform with [] = Optional[ClassDesc[Main$Transform]]
 Calling public java.lang.String java.lang.Class.descriptorString() with params: []
 public java.lang.String java.lang.Class.descriptorString() on (obsolete)class Main$Transform with [] = LMain$Transform;
 Calling public boolean java.lang.Class.desiredAssertionStatus() with params: []
@@ -246,6 +248,8 @@
 public boolean java.lang.Class.isEnum() with [] throws java.lang.reflect.InvocationTargetException: java.lang.RuntimeException: Obsolete Object!
 Calling public boolean java.lang.Class.isFinalizable() with params: []
 public boolean java.lang.Class.isFinalizable() with [] throws java.lang.reflect.InvocationTargetException: java.lang.RuntimeException: Obsolete Object!
+Calling public boolean java.lang.Class.isHidden() with params: []
+public boolean java.lang.Class.isHidden() on (obsolete)class Main$Transform with [] = false
 Calling public boolean java.lang.Class.isInstance(java.lang.Object) with params: [[null, foo, NOT_USED_STRING, class Main$Transform]]
 public boolean java.lang.Class.isInstance(java.lang.Object) on (obsolete)class Main$Transform with [null] = false
 public boolean java.lang.Class.isInstance(java.lang.Object) on (obsolete)class Main$Transform with [foo] = false
@@ -305,6 +309,8 @@
 public java.lang.Class java.lang.Class.componentType() on class Main$Transform with [] = null
 Calling public java.lang.invoke.TypeDescriptor$OfField java.lang.Class.componentType() with params: []
 public java.lang.invoke.TypeDescriptor$OfField java.lang.Class.componentType() on class Main$Transform with [] = null
+Calling public java.util.Optional java.lang.Class.describeConstable() with params: []
+public java.util.Optional java.lang.Class.describeConstable() on class Main$Transform with [] = Optional[ClassDesc[Main$Transform]]
 Calling public java.lang.String java.lang.Class.descriptorString() with params: []
 public java.lang.String java.lang.Class.descriptorString() on class Main$Transform with [] = LMain$Transform;
 Calling public boolean java.lang.Class.desiredAssertionStatus() with params: []
@@ -514,6 +520,8 @@
 public boolean java.lang.Class.isEnum() on class Main$Transform with [] = false
 Calling public boolean java.lang.Class.isFinalizable() with params: []
 public boolean java.lang.Class.isFinalizable() on class Main$Transform with [] = false
+Calling public boolean java.lang.Class.isHidden() with params: []
+public boolean java.lang.Class.isHidden() on class Main$Transform with [] = false
 Calling public boolean java.lang.Class.isInstance(java.lang.Object) with params: [[null, foo, NOT_USED_STRING, class Main$Transform]]
 public boolean java.lang.Class.isInstance(java.lang.Object) on class Main$Transform with [null] = false
 public boolean java.lang.Class.isInstance(java.lang.Object) on class Main$Transform with [foo] = false
diff --git a/test/2005-pause-all-redefine-multithreaded/pause-all.cc b/test/2005-pause-all-redefine-multithreaded/pause-all.cc
index 37d6c4d..be0428d 100644
--- a/test/2005-pause-all-redefine-multithreaded/pause-all.cc
+++ b/test/2005-pause-all-redefine-multithreaded/pause-all.cc
@@ -35,7 +35,7 @@
 
 extern "C" JNIEXPORT void JNICALL
 Java_art_Test2005_UpdateFieldValuesAndResumeThreads(JNIEnv* env,
-                                                    jclass klass ATTRIBUTE_UNUSED,
+                                                    [[maybe_unused]] jclass klass,
                                                     jobjectArray threads_arr,
                                                     jclass redefined_class,
                                                     jobjectArray new_fields,
@@ -54,10 +54,10 @@
   CHECK_EQ(jvmti_env->IterateOverInstancesOfClass(
                redefined_class,
                JVMTI_HEAP_OBJECT_EITHER,
-               [](jlong class_tag ATTRIBUTE_UNUSED,
-                  jlong size ATTRIBUTE_UNUSED,
+               []([[maybe_unused]] jlong class_tag,
+                  [[maybe_unused]] jlong size,
                   jlong* tag_ptr,
-                  void* user_data ATTRIBUTE_UNUSED) -> jvmtiIterationControl {
+                  [[maybe_unused]] void* user_data) -> jvmtiIterationControl {
                  *tag_ptr = kRedefinedObjectTag;
                  return JVMTI_ITERATION_CONTINUE;
                },
@@ -87,7 +87,7 @@
 }
 
 extern "C" JNIEXPORT jobject JNICALL
-Java_Main_fastNativeSleepAndReturnInteger42(JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+Java_Main_fastNativeSleepAndReturnInteger42(JNIEnv* env, [[maybe_unused]] jclass klass) {
   jclass integer_class = env->FindClass("java/lang/Integer");
   CHECK(integer_class != nullptr);
   jmethodID integer_value_of =
diff --git a/test/2009-structural-local-ref/local-ref.cc b/test/2009-structural-local-ref/local-ref.cc
index 9f6ef0b..5bd3287 100644
--- a/test/2009-structural-local-ref/local-ref.cc
+++ b/test/2009-structural-local-ref/local-ref.cc
@@ -32,7 +32,7 @@
 namespace Test2009StructuralLocalRef {
 
 extern "C" JNIEXPORT jstring JNICALL Java_art_Test2009_NativeLocalCallStatic(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject obj, jobject thnk) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject obj, jobject thnk) {
   jclass obj_klass = env->GetObjectClass(obj);
   jmethodID run_meth = env->GetMethodID(env->FindClass("java/lang/Runnable"), "run", "()V");
   env->CallVoidMethod(thnk, run_meth);
@@ -46,7 +46,7 @@
 }
 
 extern "C" JNIEXPORT jstring JNICALL Java_art_Test2009_NativeLocalCallVirtual(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject obj, jobject thnk) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject obj, jobject thnk) {
   jclass obj_klass = env->GetObjectClass(obj);
   jmethodID run_meth = env->GetMethodID(env->FindClass("java/lang/Runnable"), "run", "()V");
   env->CallVoidMethod(thnk, run_meth);
@@ -58,7 +58,7 @@
   }
 }
 extern "C" JNIEXPORT jstring JNICALL Java_art_Test2009_NativeLocalGetIField(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject obj, jobject thnk) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject obj, jobject thnk) {
   jclass obj_klass = env->GetObjectClass(obj);
   jmethodID run_meth = env->GetMethodID(env->FindClass("java/lang/Runnable"), "run", "()V");
   env->CallVoidMethod(thnk, run_meth);
@@ -71,7 +71,7 @@
   }
 }
 extern "C" JNIEXPORT jstring JNICALL Java_art_Test2009_NativeLocalGetSField(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject obj, jobject thnk) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject obj, jobject thnk) {
   jclass obj_klass = env->GetObjectClass(obj);
   jmethodID run_meth = env->GetMethodID(env->FindClass("java/lang/Runnable"), "run", "()V");
   env->CallVoidMethod(thnk, run_meth);
diff --git a/test/2011-stack-walk-concurrent-instrument/stack_walk_concurrent.cc b/test/2011-stack-walk-concurrent-instrument/stack_walk_concurrent.cc
index 78bb772..9ae1bed 100644
--- a/test/2011-stack-walk-concurrent-instrument/stack_walk_concurrent.cc
+++ b/test/2011-stack-walk-concurrent-instrument/stack_walk_concurrent.cc
@@ -81,14 +81,12 @@
                                                                    jobject target) {
   while (!instrument_waiting) {
   }
-  bool timed_out = false;
   Thread* other = Runtime::Current()->GetThreadList()->SuspendThreadByPeer(
-      target, SuspendReason::kInternal, &timed_out);
-  CHECK(!timed_out);
+      target, SuspendReason::kInternal);
   CHECK(other != nullptr);
   ScopedSuspendAll ssa(__FUNCTION__);
   Runtime::Current()->GetInstrumentation()->InstrumentThreadStack(other,
-                                                                  /* deopt_all_frames= */ false);
+                                                                  /* force_deopt= */ false);
   bool resumed = art::Runtime::Current()->GetThreadList()->Resume(other, SuspendReason::kInternal);
   CHECK(resumed);
   instrumented = true;
diff --git a/test/2012-structural-redefinition-failures-jni-id/set-jni-id-used.cc b/test/2012-structural-redefinition-failures-jni-id/set-jni-id-used.cc
index 4b3dac9..cd740aa 100644
--- a/test/2012-structural-redefinition-failures-jni-id/set-jni-id-used.cc
+++ b/test/2012-structural-redefinition-failures-jni-id/set-jni-id-used.cc
@@ -36,7 +36,7 @@
 namespace Test2012SetJniIdUsed {
 
 extern "C" JNIEXPORT void JNICALL Java_Main_SetPointerIdsUsed(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jclass target) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jclass target) {
   ScopedObjectAccess soa(env);
   StackHandleScope<1> hs(soa.Self());
   Handle<mirror::Class> h(hs.NewHandle(soa.Decode<mirror::Class>(target)));
diff --git a/test/2031-zygote-compiled-frame-deopt/native-wait.cc b/test/2031-zygote-compiled-frame-deopt/native-wait.cc
index fb45345..1c8af24 100644
--- a/test/2031-zygote-compiled-frame-deopt/native-wait.cc
+++ b/test/2031-zygote-compiled-frame-deopt/native-wait.cc
@@ -59,18 +59,12 @@
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test2031_setupJvmti(JNIEnv* env,
                                                                jclass,
-                                                               jstring testdir) {
-  const char* td = env->GetStringUTFChars(testdir, nullptr);
-  std::string testdir_str;
-  testdir_str.resize(env->GetStringUTFLength(testdir));
-  memcpy(testdir_str.data(), td, testdir_str.size());
-  env->ReleaseStringUTFChars(testdir, td);
+                                                               [[maybe_unused]] jstring testdir) {
   std::ostringstream oss;
-  Runtime* runtime = Runtime::Current();
-  oss << testdir_str << (kIsDebugBuild ? "libtiagentd.so" : "libtiagent.so")
+  oss << (kIsDebugBuild ? "libtiagentd.so" : "libtiagent.so")
       << "=2031-zygote-compiled-frame-deopt,art";
   LOG(INFO) << "agent " << oss.str();
-  runtime->AttachAgent(env, oss.str(), nullptr);
+  Runtime::Current()->AttachAgent(env, oss.str(), nullptr);
 }
 extern "C" JNIEXPORT void JNICALL Java_art_Test2031_waitForNativeSleep(JNIEnv*, jclass) {
   while (!native_waiting) {
diff --git a/test/2033-shutdown-mechanics/native_shutdown.cc b/test/2033-shutdown-mechanics/native_shutdown.cc
index 2b7546a..9cfc989 100644
--- a/test/2033-shutdown-mechanics/native_shutdown.cc
+++ b/test/2033-shutdown-mechanics/native_shutdown.cc
@@ -34,7 +34,7 @@
 
 
 extern "C" [[noreturn]] JNIEXPORT void JNICALL Java_Main_monitorShutdown(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass klass) {
   bool found_shutdown = false;
   bool found_runtime_deleted = false;
   JNIEnvExt* const extEnv = down_cast<JNIEnvExt*>(env);
diff --git a/test/2035-structural-native-method/structural-native.cc b/test/2035-structural-native-method/structural-native.cc
index bf51c8b..a47e91c 100644
--- a/test/2035-structural-native-method/structural-native.cc
+++ b/test/2035-structural-native-method/structural-native.cc
@@ -31,12 +31,12 @@
 namespace art {
 namespace Test2035StructuralNativeMethod {
 
-jlong JNICALL TransformNativeMethod(JNIEnv* env ATTRIBUTE_UNUSED, jclass klass ATTRIBUTE_UNUSED) {
+jlong JNICALL TransformNativeMethod([[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass klass) {
   return 42;
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test2035_LinkClassMethods(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jclass target) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jclass target) {
   JNINativeMethod meth{"getValue", "()J", reinterpret_cast<void*>(TransformNativeMethod)};
   env->RegisterNatives(target, &meth, 1);
 }
diff --git a/test/2040-huge-native-alloc/huge_native_buf.cc b/test/2040-huge-native-alloc/huge_native_buf.cc
index 20f629a..71675b2 100644
--- a/test/2040-huge-native-alloc/huge_native_buf.cc
+++ b/test/2040-huge-native-alloc/huge_native_buf.cc
@@ -26,18 +26,18 @@
 static constexpr size_t HUGE_SIZE = 10'000'000;
 
 extern "C" JNIEXPORT jobject JNICALL Java_Main_getHugeNativeBuffer(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass klass) {
   char* buffer = new char[HUGE_SIZE];
   return env->NewDirectByteBuffer(buffer, HUGE_SIZE);
 }
 
 extern "C" JNIEXPORT void JNICALL Java_Main_deleteHugeNativeBuffer(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject jbuffer) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject jbuffer) {
   delete [] static_cast<char*>(env->GetDirectBufferAddress(jbuffer));
 }
 
 extern "C" JNIEXPORT jint JNICALL Java_Main_getGcNum(
-    JNIEnv* env ATTRIBUTE_UNUSED, jclass klass ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass klass) {
   return Runtime::Current()->GetHeap()->GetCurrentGcNum();
 }
 
diff --git a/test/2042-reference-processing/src/Main.java b/test/2042-reference-processing/src/Main.java
index ed67052..1e289f5 100644
--- a/test/2042-reference-processing/src/Main.java
+++ b/test/2042-reference-processing/src/Main.java
@@ -21,7 +21,7 @@
 import java.math.BigInteger;
 import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.atomic.AtomicInteger;
-import java.util.HashMap;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.TreeMap;
 
 /**
@@ -48,7 +48,6 @@
     static volatile boolean pleaseStop;
 
     AtomicInteger totalFinalized = new AtomicInteger(0);
-    Object phantomRefsLock = new Object();
     int maxDropped = 0;
     int liveObjects = 0;
 
@@ -66,7 +65,7 @@
     // Maps from object number to Reference; Cleared references are deleted when queues are
     // processed.
     TreeMap<Integer, MyWeakReference> weakRefs = new TreeMap<>();
-    HashMap<Integer, MyPhantomReference> phantomRefs = new HashMap<>();
+    ConcurrentHashMap<Integer, MyPhantomReference> phantomRefs = new ConcurrentHashMap<>();
 
     class FinalizableObject {
         int n;
@@ -101,16 +100,14 @@
         }
     }
     boolean inPhantomRefs(int n) {
-        synchronized(phantomRefsLock) {
-            MyPhantomReference ref = phantomRefs.get(n);
-            if (ref == null) {
-                return false;
-            }
-            if (ref.n != n) {
-                System.out.println("phantomRef retrieval failed");
-            }
-            return true;
+        MyPhantomReference ref = phantomRefs.get(n);
+        if (ref == null) {
+            return false;
         }
+        if (ref.n != n) {
+            System.out.println("phantomRef retrieval failed");
+        }
+        return true;
     }
 
     void CheckOKToClearWeak(int num) {
@@ -197,9 +194,7 @@
             int me = nextAllocated++;
             listHead = new FinalizableObject(me, listHead);
             weakRefs.put(me, new MyWeakReference(listHead));
-            synchronized(phantomRefsLock) {
-                phantomRefs.put(me, new MyPhantomReference(listHead));
-            }
+            phantomRefs.put(me, new MyPhantomReference(listHead));
         }
         liveObjects += n;
     }
@@ -243,6 +238,10 @@
                 System.out.println("Unexpected live object count");
             }
             dropObjects(DROP_OBJS);
+            if (i % 100 == 0) {
+              // Make sure we don't fall too far behind, otherwise we may run out of memory.
+              System.runFinalization();
+            }
             emptyAndCheckQueues();
         }
         dropObjects(MIN_LIVE_OBJS);
diff --git a/test/2048-bad-native-registry/Android.bp b/test/2048-bad-native-registry/Android.bp
new file mode 100644
index 0000000..b164d33
--- /dev/null
+++ b/test/2048-bad-native-registry/Android.bp
@@ -0,0 +1,40 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `2048-bad-native-registry`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-2048-bad-native-registry",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-no-test-suite-tag-template",
+    srcs: ["src/**/*.java"],
+    data: [
+        ":art-run-test-2048-bad-native-registry-expected-stdout",
+        ":art-run-test-2048-bad-native-registry-expected-stderr",
+    ],
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-2048-bad-native-registry-expected-stdout",
+    out: ["art-run-test-2048-bad-native-registry-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-2048-bad-native-registry-expected-stderr",
+    out: ["art-run-test-2048-bad-native-registry-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/compiler/libart-compiler.map b/test/2048-bad-native-registry/build.py
similarity index 60%
rename from compiler/libart-compiler.map
rename to test/2048-bad-native-registry/build.py
index f66052a..7025b81 100644
--- a/compiler/libart-compiler.map
+++ b/test/2048-bad-native-registry/build.py
@@ -12,23 +12,9 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-#
 
-ART_COMPILER {
-  global:
-    extern "C++" {
-      art::debug::MakeMiniDebugInfo*;
-      *art::debug::WriteDebugInfo*;
-      art::Compiler::Create*;
-      art::CompilerOptions::*;
-      art::CreateTrampoline*;
-      art::IntrinsicObjects::*;
-      art::linker::operator*art::linker::LinkerPatch::Type*;
-      art::operator*art::Whence*;
-    };
 
-    jit_load;
-
-  local:
-    *;
-};
+def build(ctx):
+  if ctx.jvm:
+    return  # The test does not build on JVM
+  ctx.default_build()
diff --git a/test/015-switch/expected-stderr.txt b/test/2048-bad-native-registry/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2048-bad-native-registry/expected-stderr.txt
diff --git a/test/2048-bad-native-registry/expected-stdout.txt b/test/2048-bad-native-registry/expected-stdout.txt
new file mode 100644
index 0000000..48a6058
--- /dev/null
+++ b/test/2048-bad-native-registry/expected-stdout.txt
@@ -0,0 +1,6 @@
+JNI_OnLoad called
+Returning bad finalizer: 0xN
+Returning placeholder object: 0xN
+About to null reference.
+Native finalizer looping
+TimeoutException on FinalizerWatchdogDaemon:ReferenceQueueDaemon timed out while targeting libcore.util.NativeAllocationRegistry$CleanerThunk@N(freeFunction = 0xN, nativePtr = 0xN, size = 666)
diff --git a/test/2048-bad-native-registry/info.txt b/test/2048-bad-native-registry/info.txt
new file mode 100644
index 0000000..79f3192
--- /dev/null
+++ b/test/2048-bad-native-registry/info.txt
@@ -0,0 +1,9 @@
+This is an adaptation of 030-bad-finalizer and 2041-bad-cleaner
+to Java 8 Cleaners created indirectly via NativeAllocationRegistry. These
+run directly in the ReferenceQueueDaemon. The native finalizer never finishes.
+ART is expected to detect this situation and abort the VM (so you should
+see a message to that effect in the log output).
+
+We have this test in addition to 2041-bad-cleaner mostly to test that the output
+includes useful information in this important case. This is also the only test
+of the toString() method provided by that Runnable.
diff --git a/test/2048-bad-native-registry/native_finalizer.cc b/test/2048-bad-native-registry/native_finalizer.cc
new file mode 100644
index 0000000..14b0460
--- /dev/null
+++ b/test/2048-bad-native-registry/native_finalizer.cc
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "jni.h"
+
+#include <cstdint>
+#include <stdio.h>
+#include <unistd.h>
+
+namespace art {
+
+static int nativeObj;
+
+static void BadNativeFinalizer(void *p) {
+  if (p != &nativeObj) {
+    printf("Finalizer was passed unexpected argument: %p, not %p\n", p, &nativeObj);
+  }
+  printf("Native finalizer looping\n");
+  volatile bool always_true = true;
+  while (always_true) { sleep(1); }
+}
+
+extern "C" JNIEXPORT jlong JNICALL Java_Main_getBadFreeFunction(JNIEnv*, jclass) {
+  printf("Returning bad finalizer: %p\n", &BadNativeFinalizer);  // Delete for comparison.
+  return reinterpret_cast<uintptr_t>(&BadNativeFinalizer);
+}
+
+extern "C" JNIEXPORT jlong JNICALL Java_Main_getNativeObj(JNIEnv*, jclass) {
+  printf("Returning placeholder object: %p\n", &nativeObj);
+  return reinterpret_cast<uintptr_t>(&nativeObj);
+}
+
+}  // namespace art
diff --git a/test/2048-bad-native-registry/run.py b/test/2048-bad-native-registry/run.py
new file mode 100644
index 0000000..f5e6e21
--- /dev/null
+++ b/test/2048-bad-native-registry/run.py
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# Copyright 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def run(ctx, args):
+  ctx.default_run(args, android_log_tags="*:f", expected_exit_code=2)
+  # Do not compare addresses, so replace hex numbers with 'N'.
+  ctx.run(fr"sed -i 's/0x[0-9a-f][0-9a-f]*/0xN/g' '{args.stdout_file}'")
+  ctx.run(fr"sed -i 's/@[0-9a-f][0-9a-f]*/@N/g' '{args.stdout_file}'")
diff --git a/test/2048-bad-native-registry/src/Main.java b/test/2048-bad-native-registry/src/Main.java
new file mode 100644
index 0000000..10905fa
--- /dev/null
+++ b/test/2048-bad-native-registry/src/Main.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import dalvik.system.VMRuntime;
+import java.util.concurrent.CountDownLatch;
+import libcore.util.NativeAllocationRegistry;
+import java.util.concurrent.TimeoutException;
+import static java.util.concurrent.TimeUnit.MINUTES;
+
+/**
+ * Test a class with a bad finalizer.
+ *
+ * This test is inherently flaky. It assumes that the system will schedule the finalizer daemon
+ * and finalizer watchdog daemon enough to reach the timeout and throwing the fatal exception.
+ * This uses somewhat simpler logic than 2041-bad-cleaner, since the handshake implemented there
+ * is harder to replicate here. We bump up the timeout below a bit to compensate.
+ */
+public class Main {
+    public static void main(String[] args) throws Exception {
+        System.loadLibrary(args[0]);
+        ClassLoader cl = Main.class.getClassLoader();
+        NativeAllocationRegistry registry =
+            NativeAllocationRegistry.createNonmalloced(cl, getBadFreeFunction(), 666);
+        // Replace the global uncaught exception handler, so the exception shows up on stdout.
+        Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
+            public void uncaughtException(Thread thread, Throwable e) {
+                if (e instanceof TimeoutException) {
+                    System.out.println("TimeoutException on "
+                        + thread.getName() + ":" + e.getMessage());
+                } else {
+                    System.out.println("Unexpected exception " + e);
+                }
+                System.exit(2);
+            }
+        });
+        // A separate method to ensure no dex register keeps the object alive.
+        createBadCleanable(registry);
+
+        // Should have at least two iterations to trigger finalization, but just to make sure run
+        // some more.
+        for (int i = 0; i < 5; i++) {
+            Runtime.getRuntime().gc();
+        }
+
+        // Now fall asleep with a timeout. The timeout is large enough that we expect the
+        // finalizer daemon to have killed the process before the deadline elapses.
+        // The timeout is also large enough to cover the extra 5 seconds we wait
+        // to dump threads, plus potentially substantial gcstress overhead.
+        // The RQ timeout is currently effectively 5 * the finalizer timeout.
+        // Note: the timeout is here (instead of an infinite sleep) to protect the test
+        //       environment (e.g., in case this is run without a timeout wrapper).
+        final long timeout = 150 * 1000 + 5 * VMRuntime.getRuntime().getFinalizerTimeoutMs();
+        long remainingWait = timeout;
+        final long waitStart = System.currentTimeMillis();
+        while (remainingWait > 0) {
+            synchronized (args) {  // Just use an already existing object for simplicity...
+                try {
+                    args.wait(remainingWait);
+                } catch (Exception e) {
+                    System.out.println("UNEXPECTED EXCEPTION");
+                }
+            }
+            remainingWait = timeout - (System.currentTimeMillis() - waitStart);
+        }
+
+        // We should not get here.
+        System.out.println("UNREACHABLE");
+        System.exit(0);
+    }
+
+    private static void createBadCleanable(NativeAllocationRegistry registry) {
+        Object badCleanable = new Object();
+        long nativeObj = getNativeObj();
+        registry.registerNativeAllocation(badCleanable, nativeObj);
+
+        System.out.println("About to null reference.");
+        badCleanable = null;  // Not that this would make a difference, could be eliminated earlier.
+    }
+
+    private static native long getNativeObj();
+    private static native long getBadFreeFunction();
+
+}
diff --git a/test/2048-bad-native-registry/test-metadata.json b/test/2048-bad-native-registry/test-metadata.json
new file mode 100644
index 0000000..75f6c02
--- /dev/null
+++ b/test/2048-bad-native-registry/test-metadata.json
@@ -0,0 +1,5 @@
+{
+  "build-param": {
+    "jvm-supported": "false"
+  }
+}
diff --git a/test/2233-metrics-background-thread/Android.bp b/test/2233-metrics-background-thread/Android.bp
new file mode 100644
index 0000000..e4b63cd
--- /dev/null
+++ b/test/2233-metrics-background-thread/Android.bp
@@ -0,0 +1,40 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `2233-metrics-background-thread`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-2233-metrics-background-thread",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-no-test-suite-tag-template",
+    srcs: ["src/**/*.java"],
+    data: [
+        ":art-run-test-2233-metrics-background-thread-expected-stdout",
+        ":art-run-test-2233-metrics-background-thread-expected-stderr",
+    ],
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-2233-metrics-background-thread-expected-stdout",
+    out: ["art-run-test-2233-metrics-background-thread-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-2233-metrics-background-thread-expected-stderr",
+    out: ["art-run-test-2233-metrics-background-thread-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/test/2233-metrics-background-thread/expected-stderr.txt b/test/2233-metrics-background-thread/expected-stderr.txt
new file mode 100644
index 0000000..d5e4be4
--- /dev/null
+++ b/test/2233-metrics-background-thread/expected-stderr.txt
@@ -0,0 +1,2 @@
+Metrics reporting thread started
+Metrics reporting thread terminating
diff --git a/test/015-switch/expected-stderr.txt b/test/2233-metrics-background-thread/expected-stdout.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2233-metrics-background-thread/expected-stdout.txt
diff --git a/test/2233-metrics-background-thread/info.txt b/test/2233-metrics-background-thread/info.txt
new file mode 100644
index 0000000..3041694
--- /dev/null
+++ b/test/2233-metrics-background-thread/info.txt
@@ -0,0 +1,2 @@
+Tests metrics background reporting thread
+
diff --git a/test/2233-metrics-background-thread/run.py b/test/2233-metrics-background-thread/run.py
new file mode 100644
index 0000000..e0d86ac
--- /dev/null
+++ b/test/2233-metrics-background-thread/run.py
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+def run(ctx, args):
+  ctx.default_run(
+    args,
+    android_log_tags="*:d",
+    diff_min_log_tag="d",
+    runtime_option=["-Xmetrics-reporting-mods:100",]
+  )
+
+  # Check that log messages from the metrics reporting thread appear in stderr.
+  ctx.run(
+    fr"sed -rnie 's/.*(Metrics reporting thread (started|terminating)).*/\1/p' '{args.stderr_file}'"
+  )
+
diff --git a/test/2233-metrics-background-thread/src/Main.java b/test/2233-metrics-background-thread/src/Main.java
new file mode 100644
index 0000000..873e9c3
--- /dev/null
+++ b/test/2233-metrics-background-thread/src/Main.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class Main {
+  public static void main(String[] args) throws InterruptedException {
+    // Sleep for 1.5 seconds to give the metrics reporting thread a chance to report.
+    Thread.sleep(1500);
+  }
+}
diff --git a/test/2235-JdkUnsafeTest/src/Main.java b/test/2235-JdkUnsafeTest/src/Main.java
index ad6202a..7cb88b1 100644
--- a/test/2235-JdkUnsafeTest/src/Main.java
+++ b/test/2235-JdkUnsafeTest/src/Main.java
@@ -303,6 +303,31 @@
       System.out.println("Unexpectedly not succeeding compareAndSetObject(t, objectOffset, 1, 1)");
     }
     check(t.objectVar, objectValue3, "Unsafe.compareAndSetObject(Object, long, Object, Object) - gets set to same");
+
+    // Reset and now try with `compareAndSetReference` which replaced `compareAndSetObject`.
+    unsafe.putObject(t, objectOffset, objectValue);
+
+    if (unsafe.compareAndSetReference(t, objectOffset, new Object(), new Object())) {
+      System.out.println("Unexpectedly succeeding compareAndSetReference(t, objectOffset, 0, 1)");
+    }
+    check(t.objectVar, objectValue, "Unsafe.compareAndSetReference(Object, long, Object, Object) - not set");
+    objectValue2 = new Object();
+    if (!unsafe.compareAndSetReference(t, objectOffset, objectValue, objectValue2)) {
+      System.out.println(
+          "Unexpectedly not succeeding compareAndSetReference(t, objectOffset, objectValue, 0)");
+    }
+    check(t.objectVar, objectValue2, "Unsafe.compareAndSetReference(Object, long, Object, Object) - gets set");
+    objectValue3 = new Object();
+    if (!unsafe.compareAndSetReference(t, objectOffset, objectValue2, objectValue3)) {
+      System.out.println("Unexpectedly not succeeding compareAndSetReference(t, objectOffset, 0, 1)");
+    }
+    check(t.objectVar, objectValue3, "Unsafe.compareAndSetReference(Object, long, Object, Object) - gets re-set");
+    // Exercise jdk.internal.misc.Unsafe.compareAndSetReference using the same
+    // object for the `expectedValue` and `newValue` arguments.
+    if (!unsafe.compareAndSetReference(t, objectOffset, objectValue3, objectValue3)) {
+      System.out.println("Unexpectedly not succeeding compareAndSetReference(t, objectOffset, 1, 1)");
+    }
+    check(t.objectVar, objectValue3, "Unsafe.compareAndSetReference(Object, long, Object, Object) - gets set to same");
  }
 
   private static void testGetAndPutVolatile(Unsafe unsafe) throws NoSuchFieldException {
diff --git a/test/2240-tracing-non-invokable-method/Android.bp b/test/2240-tracing-non-invokable-method/Android.bp
index b3a2c79..d213fb1 100644
--- a/test/2240-tracing-non-invokable-method/Android.bp
+++ b/test/2240-tracing-non-invokable-method/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-no-test-suite-tag-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-2240-tracing-non-invokable-method-src"
+        "art-run-test-2240-tracing-non-invokable-method-src",
     ],
     data: [
         ":art-run-test-2240-tracing-non-invokable-method-expected-stdout",
diff --git a/test/2242-checker-lse-acquire-release-operations/src/Main.java b/test/2242-checker-lse-acquire-release-operations/src/Main.java
index 433a4cd..4db0f35 100644
--- a/test/2242-checker-lse-acquire-release-operations/src/Main.java
+++ b/test/2242-checker-lse-acquire-release-operations/src/Main.java
@@ -24,63 +24,126 @@
 public class Main {
   public static void main(String[] args) {
     // Volatile accesses.
-    assertEquals($noinline$testVolatileAccessesMustBeKept(new TestClass()), 3);
+    assertEquals(3, $noinline$testVolatileAccessesMustBeKept(new TestClass()));
+    assertEquals(3, $noinline$testSingletonVolatileAccessesCanBeRemoved());
 
     // Volatile loads - Different fields shouldn't alias.
-    assertEquals($noinline$testVolatileLoadDifferentFields(new TestClass(), new TestClass()), 3);
+    assertEquals(3, $noinline$testVolatileLoadDifferentFields(new TestClass(), new TestClass()));
     assertEquals(
-            $noinline$testVolatileLoadDifferentFieldsBlocking(new TestClass(), new TestClass()),
-            3);
+            3, $noinline$testVolatileLoadDifferentFieldsBlocking(new TestClass(), new TestClass()));
 
     // Volatile loads - Redundant store.
-    assertEquals($noinline$testVolatileLoadRedundantStore(new TestClass()), 2);
-    assertEquals($noinline$testVolatileLoadRedundantStoreBlocking(new TestClass()), 2);
-    assertEquals($noinline$testVolatileLoadRedundantStoreBlockingOnlyLoad(new TestClass()), 2);
+    assertEquals(2, $noinline$testVolatileLoadRedundantStore(new TestClass()));
+    assertEquals(2, $noinline$testVolatileLoadRedundantStoreBlocking(new TestClass()));
+    assertEquals(2, $noinline$testVolatileLoadRedundantStoreBlockingOnlyLoad(new TestClass()));
 
     // Volatile loads - Set and merge values.
-    assertEquals($noinline$testVolatileLoadSetAndMergeValues(new TestClass(), true), 1);
-    assertEquals($noinline$testVolatileLoadSetAndMergeValues(new TestClass(), false), 2);
-    assertEquals($noinline$testVolatileLoadSetAndMergeValuesBlocking(new TestClass(), true), 1);
-    assertEquals($noinline$testVolatileLoadSetAndMergeValuesBlocking(new TestClass(), false), 2);
+    assertEquals(1, $noinline$testVolatileLoadSetAndMergeValues(new TestClass(), true));
+    assertEquals(2, $noinline$testVolatileLoadSetAndMergeValues(new TestClass(), false));
+    assertEquals(1, $noinline$testVolatileLoadSetAndMergeValuesBlocking(new TestClass(), true));
+    assertEquals(2, $noinline$testVolatileLoadSetAndMergeValuesBlocking(new TestClass(), false));
+
+    // Volatile loads - Removal - Different fields shouldn't alias.
+    assertEquals(3,
+            $noinline$testVolatileLoadDifferentFieldsRemovedSynchronization(
+                    new TestClass(), new TestClass()));
+
+    // Volatile loads - Removal - Redundant store.
+    assertEquals(
+            2, $noinline$testVolatileLoadRedundantStoreRemovedSynchronization(new TestClass()));
+
+    // Volatile loads - Removal - Set and merge values.
+    assertEquals(1,
+            $noinline$testVolatileLoadSetAndMergeValuesRemovedSynchronization(
+                    new TestClass(), true));
+    assertEquals(2,
+            $noinline$testVolatileLoadSetAndMergeValuesRemovedSynchronization(
+                    new TestClass(), false));
+
+    // Volatile loads - Removal - with inlining
+    assertEquals(2, $noinline$testVolatileLoadInlineMethodWithSynchronizedScope(new TestClass()));
 
     // Volatile stores - Different fields shouldn't alias.
-    assertEquals($noinline$testVolatileStoreDifferentFields(new TestClass(), new TestClass()), 3);
-    assertEquals(
-            $noinline$testVolatileStoreDifferentFieldsBlocking(new TestClass(), new TestClass()),
-            3);
+    assertEquals(3, $noinline$testVolatileStoreDifferentFields(new TestClass(), new TestClass()));
+    assertEquals(3,
+            $noinline$testVolatileStoreDifferentFieldsBlocking(new TestClass(), new TestClass()));
 
     // Volatile stores - Redundant store.
-    assertEquals($noinline$testVolatileStoreRedundantStore(new TestClass()), 2);
-    assertEquals($noinline$testVolatileStoreRedundantStoreBlocking(new TestClass()), 2);
-    assertEquals($noinline$testVolatileStoreRedundantStoreBlockingOnlyLoad(new TestClass()), 2);
+    assertEquals(2, $noinline$testVolatileStoreRedundantStore(new TestClass()));
+    assertEquals(2, $noinline$testVolatileStoreRedundantStoreBlocking(new TestClass()));
+    assertEquals(2, $noinline$testVolatileStoreRedundantStoreBlockingOnlyLoad(new TestClass()));
 
     // Volatile stores - Set and merge values.
-    assertEquals($noinline$testVolatileStoreSetAndMergeValues(new TestClass(), true), 1);
-    assertEquals($noinline$testVolatileStoreSetAndMergeValues(new TestClass(), false), 2);
-    assertEquals($noinline$testVolatileStoreSetAndMergeValuesNotBlocking(new TestClass(), true), 1);
-    assertEquals($noinline$testVolatileStoreSetAndMergeValuesNotBlocking(new TestClass(), false), 2);
+    assertEquals(1, $noinline$testVolatileStoreSetAndMergeValues(new TestClass(), true));
+    assertEquals(2, $noinline$testVolatileStoreSetAndMergeValues(new TestClass(), false));
+    assertEquals(1, $noinline$testVolatileStoreSetAndMergeValuesNotBlocking(new TestClass(), true));
+    assertEquals(
+            2, $noinline$testVolatileStoreSetAndMergeValuesNotBlocking(new TestClass(), false));
+
+    // Volatile stores - Removal - Different fields shouldn't alias.
+    assertEquals(3,
+            $noinline$testVolatileStoreDifferentFieldsRemovedSynchronization(
+                    new TestClass(), new TestClass()));
+
+    // Volatile stores - Removal - Redundant store.
+    assertEquals(
+            2, $noinline$testVolatileStoreRedundantStoreRemovedSynchronization(new TestClass()));
+
+    // Volatile stores - Removal - Set and merge values.
+    assertEquals(1,
+            $noinline$testVolatileStoreSetAndMergeValuesRemovedSynchronization(
+                    new TestClass(), true));
+    assertEquals(2,
+            $noinline$testVolatileStoreSetAndMergeValuesRemovedSynchronization(
+                    new TestClass(), false));
+
+    // Volatile stores - Removal - with inlining
+    assertEquals(2, $noinline$testVolatileStoreInlineMethodWithSynchronizedScope(new TestClass()));
 
     // Monitor Operations - Different fields shouldn't alias.
+    // Make sure the static variable used for synchronization is non-null.
+    classForSync = new TestClass();
+
     assertEquals(
-            $noinline$testMonitorOperationDifferentFields(new TestClass(), new TestClass()), 3);
-    assertEquals($noinline$testMonitorOperationDifferentFieldsBlocking(
-                          new TestClass(), new TestClass()),
-            3);
+            3, $noinline$testMonitorOperationDifferentFields(new TestClass(), new TestClass()));
+    assertEquals(3,
+            $noinline$testMonitorOperationDifferentFieldsBlocking(
+                    new TestClass(), new TestClass()));
 
     // Monitor Operations - Redundant store.
-    assertEquals($noinline$testMonitorOperationRedundantStore(new TestClass()), 2);
-    assertEquals($noinline$testMonitorOperationRedundantStoreBlocking(new TestClass()), 2);
-    assertEquals(
-            $noinline$testMonitorOperationRedundantStoreBlockingOnlyLoad(new TestClass()), 2);
-    assertEquals($noinline$testMonitorOperationRedundantStoreBlockingExit(new TestClass()), 2);
+    assertEquals(2, $noinline$testMonitorOperationRedundantStore(new TestClass()));
+    assertEquals(2, $noinline$testMonitorOperationRedundantStoreBlocking(new TestClass()));
+    assertEquals(2, $noinline$testMonitorOperationRedundantStoreBlockingOnlyLoad(new TestClass()));
+    assertEquals(2, $noinline$testMonitorOperationRedundantStoreBlockingExit(new TestClass()));
 
     // Monitor Operations - Set and merge values.
-    assertEquals($noinline$testMonitorOperationSetAndMergeValues(new TestClass(), true), 1);
-    assertEquals($noinline$testMonitorOperationSetAndMergeValues(new TestClass(), false), 2);
+    assertEquals(1, $noinline$testMonitorOperationSetAndMergeValues(new TestClass(), true));
+    assertEquals(2, $noinline$testMonitorOperationSetAndMergeValues(new TestClass(), false));
+    assertEquals(1, $noinline$testMonitorOperationSetAndMergeValuesBlocking(new TestClass(), true));
     assertEquals(
-            $noinline$testMonitorOperationSetAndMergeValuesBlocking(new TestClass(), true), 1);
+            2, $noinline$testMonitorOperationSetAndMergeValuesBlocking(new TestClass(), false));
+
+    // Monitor Operations - Removal - Different fields shouldn't alias.
+    assertEquals(3,
+            $noinline$testMonitorOperationDifferentFieldsRemovedSynchronization(
+                    new TestClass(), new TestClass()));
+
+    // Monitor Operations - Removal - Redundant store.
     assertEquals(
-            $noinline$testMonitorOperationSetAndMergeValuesBlocking(new TestClass(), false), 2);
+            2, $noinline$testMonitorOperationRedundantStoreRemovedSynchronization(new TestClass()));
+
+    // Monitor Operations - Removal - Set and merge values.
+    assertEquals(1,
+            $noinline$testMonitorOperationSetAndMergeValuesRemovedSynchronization(
+                    new TestClass(), true));
+    assertEquals(2,
+            $noinline$testMonitorOperationSetAndMergeValuesRemovedSynchronization(
+                    new TestClass(), false));
+
+    // Monitor Operations - Removal - with inlining
+    assertEquals(2, $noinline$testMonitorOperationInlineSynchronizedMethod(new TestClass()));
+    assertEquals(
+            2, $noinline$testMonitorOperationInlineMethodWithSynchronizedScope(new TestClass()));
   }
 
   public static void assertEquals(int expected, int result) {
@@ -114,6 +177,31 @@
     return result;
   }
 
+  /// CHECK-START: int Main.$noinline$testSingletonVolatileAccessesCanBeRemoved() load_store_elimination (before)
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldGet
+  /// CHECK: InstanceFieldGet
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldGet
+
+  /// CHECK-START: int Main.$noinline$testSingletonVolatileAccessesCanBeRemoved() load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldSet
+
+  /// CHECK-START: int Main.$noinline$testSingletonVolatileAccessesCanBeRemoved() load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldGet
+  static int $noinline$testSingletonVolatileAccessesCanBeRemoved() {
+    Main m = new Main();
+    int result;
+    m.vi = 3;
+    // Redundant load can be removed.
+    result = m.vi;
+    result = m.vi;
+    // Redundant store can be removed.
+    m.vi = 3;
+    result = m.vi;
+    return result;
+  }
+
   /// CHECK-START: int Main.$noinline$testVolatileLoadDifferentFields(TestClass, TestClass) load_store_elimination (before)
   /// CHECK: InstanceFieldGet field_name:TestClass.vi
   /// CHECK: InstanceFieldSet
@@ -288,6 +376,136 @@
     return obj.i;
   }
 
+  /// CHECK-START: int Main.$noinline$testVolatileLoadDifferentFieldsRemovedSynchronization(TestClass, TestClass) load_store_elimination (before)
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldGet field_name:Main.vi
+  /// CHECK: InstanceFieldGet
+  /// CHECK: InstanceFieldGet
+
+  /// CHECK-START: int Main.$noinline$testVolatileLoadDifferentFieldsRemovedSynchronization(TestClass, TestClass) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldGet field_name:Main.vi
+
+  /// CHECK-START: int Main.$noinline$testVolatileLoadDifferentFieldsRemovedSynchronization(TestClass, TestClass) load_store_elimination (after)
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldSet
+
+  /// CHECK-START: int Main.$noinline$testVolatileLoadDifferentFieldsRemovedSynchronization(TestClass, TestClass) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldGet
+
+  static int $noinline$testVolatileLoadDifferentFieldsRemovedSynchronization(
+          TestClass obj1, TestClass obj2) {
+    Main m = new Main();
+
+    obj1.i = 1;
+    obj2.j = 2;
+    int unused = m.vi;
+
+    return obj1.i + obj2.j;
+  }
+
+  /// CHECK-START: int Main.$noinline$testVolatileLoadRedundantStoreRemovedSynchronization(TestClass) load_store_elimination (before)
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldGet field_name:Main.vi
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldGet field_name:Main.vi
+  /// CHECK: InstanceFieldGet
+
+  /// CHECK-START: int Main.$noinline$testVolatileLoadRedundantStoreRemovedSynchronization(TestClass) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldGet field_name:Main.vi
+
+  /// CHECK-START: int Main.$noinline$testVolatileLoadRedundantStoreRemovedSynchronization(TestClass) load_store_elimination (after)
+  /// CHECK: InstanceFieldSet
+  /// CHECK-NOT: InstanceFieldSet
+
+  /// CHECK-START: int Main.$noinline$testVolatileLoadRedundantStoreRemovedSynchronization(TestClass) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldGet
+
+  static int $noinline$testVolatileLoadRedundantStoreRemovedSynchronization(TestClass obj) {
+    Main m = new Main();
+
+    obj.j = 1;
+    int unused = m.vi;
+    obj.j = 2;
+    unused = m.vi;
+
+    return obj.j;
+  }
+
+  /// CHECK-START: int Main.$noinline$testVolatileLoadSetAndMergeValuesRemovedSynchronization(TestClass, boolean) load_store_elimination (before)
+  /// CHECK-DAG: InstanceFieldSet
+  /// CHECK-DAG: InstanceFieldSet
+  /// CHECK-DAG: InstanceFieldGet field_name:Main.vi
+  /// CHECK-DAG: InstanceFieldGet
+  /// CHECK-DAG: Return
+
+  /// CHECK-START: int Main.$noinline$testVolatileLoadSetAndMergeValuesRemovedSynchronization(TestClass, boolean) load_store_elimination (after)
+  /// CHECK-DAG: InstanceFieldSet
+  /// CHECK-DAG: InstanceFieldSet
+  /// CHECK-DAG: Return
+
+  /// CHECK-START: int Main.$noinline$testVolatileLoadSetAndMergeValuesRemovedSynchronization(TestClass, boolean) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldGet field_name:Main.vi
+
+  /// CHECK-START: int Main.$noinline$testVolatileLoadSetAndMergeValuesRemovedSynchronization(TestClass, boolean) load_store_elimination (after)
+  /// CHECK: Phi
+
+  /// CHECK-START: int Main.$noinline$testVolatileLoadSetAndMergeValuesRemovedSynchronization(TestClass, boolean) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldGet
+
+  static int $noinline$testVolatileLoadSetAndMergeValuesRemovedSynchronization(
+          TestClass obj, boolean b) {
+    Main m = new Main();
+
+    if (b) {
+      obj.i = 1;
+    } else {
+      obj.i = 2;
+    }
+    int unused = m.vi;
+    return obj.i;
+  }
+
+  // Can't eliminate the setters, or volatile getters in this method.
+
+  /// CHECK-START: int Main.$inline$SetterWithVolatileLoads(TestClass) load_store_elimination (before)
+  /// CHECK:     InstanceFieldSet field_name:TestClass.j
+  /// CHECK:     InstanceFieldGet field_name:Main.vi
+  /// CHECK:     InstanceFieldSet field_name:TestClass.j
+  /// CHECK:     InstanceFieldGet field_name:Main.vi
+
+  /// CHECK-START: int Main.$inline$SetterWithVolatileLoads(TestClass) load_store_elimination (after)
+  /// CHECK:     InstanceFieldSet field_name:TestClass.j
+  /// CHECK:     InstanceFieldGet field_name:Main.vi
+  /// CHECK:     InstanceFieldSet field_name:TestClass.j
+  /// CHECK:     InstanceFieldGet field_name:Main.vi
+  int $inline$SetterWithVolatileLoads(TestClass obj) {
+    obj.j = 1;
+    int unused = this.vi;
+    obj.j = 2;
+    unused = this.vi;
+    return obj.j;
+  }
+
+  // But we can eliminate once inlined.
+
+  /// CHECK-START: int Main.$noinline$testVolatileLoadInlineMethodWithSynchronizedScope(TestClass) load_store_elimination (before)
+  /// CHECK:     InstanceFieldSet field_name:TestClass.j
+  /// CHECK:     InstanceFieldGet field_name:Main.vi
+  /// CHECK:     InstanceFieldSet field_name:TestClass.j
+  /// CHECK:     InstanceFieldGet field_name:Main.vi
+
+  /// CHECK-START: int Main.$noinline$testVolatileLoadInlineMethodWithSynchronizedScope(TestClass) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldGet field_name:Main.vi
+
+  /// CHECK-START: int Main.$noinline$testVolatileLoadInlineMethodWithSynchronizedScope(TestClass) load_store_elimination (after)
+  /// CHECK:     InstanceFieldSet field_name:TestClass.j
+  /// CHECK-NOT: InstanceFieldSet field_name:TestClass.j
+  static int $noinline$testVolatileLoadInlineMethodWithSynchronizedScope(TestClass obj) {
+    Main m = new Main();
+    return m.$inline$SetterWithVolatileLoads(obj);
+  }
+
   /// CHECK-START: int Main.$noinline$testVolatileStoreDifferentFields(TestClass, TestClass) load_store_elimination (before)
   /// CHECK: InstanceFieldSet field_name:TestClass.vi
   /// CHECK: InstanceFieldSet
@@ -462,6 +680,136 @@
     return obj.i;
   }
 
+  /// CHECK-START: int Main.$noinline$testVolatileStoreDifferentFieldsRemovedSynchronization(TestClass, TestClass) load_store_elimination (before)
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldSet field_name:Main.vi
+  /// CHECK: InstanceFieldGet
+  /// CHECK: InstanceFieldGet
+
+  /// CHECK-START: int Main.$noinline$testVolatileStoreDifferentFieldsRemovedSynchronization(TestClass, TestClass) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldSet field_name:Main.vi
+
+  /// CHECK-START: int Main.$noinline$testVolatileStoreDifferentFieldsRemovedSynchronization(TestClass, TestClass) load_store_elimination (after)
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldSet
+
+  /// CHECK-START: int Main.$noinline$testVolatileStoreDifferentFieldsRemovedSynchronization(TestClass, TestClass) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldGet
+
+  static int $noinline$testVolatileStoreDifferentFieldsRemovedSynchronization(
+          TestClass obj1, TestClass obj2) {
+    Main m = new Main();
+
+    obj1.i = 1;
+    obj2.j = 2;
+    m.vi = 123;
+
+    return obj1.i + obj2.j;
+  }
+
+  /// CHECK-START: int Main.$noinline$testVolatileStoreRedundantStoreRemovedSynchronization(TestClass) load_store_elimination (before)
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldGet
+
+  /// CHECK-START: int Main.$noinline$testVolatileStoreRedundantStoreRemovedSynchronization(TestClass) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldSet field_name:Main.vi
+
+  /// CHECK-START: int Main.$noinline$testVolatileStoreRedundantStoreRemovedSynchronization(TestClass) load_store_elimination (after)
+  /// CHECK: InstanceFieldSet
+  /// CHECK-NOT: InstanceFieldSet
+
+  /// CHECK-START: int Main.$noinline$testVolatileStoreRedundantStoreRemovedSynchronization(TestClass) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldGet
+
+  static int $noinline$testVolatileStoreRedundantStoreRemovedSynchronization(TestClass obj) {
+    Main m = new Main();
+
+    obj.j = 1;
+    m.vi = 123;
+    obj.j = 2;
+    m.vi = 123;
+
+    return obj.j;
+  }
+
+  /// CHECK-START: int Main.$noinline$testVolatileStoreSetAndMergeValuesRemovedSynchronization(TestClass, boolean) load_store_elimination (before)
+  /// CHECK-DAG: InstanceFieldSet
+  /// CHECK-DAG: InstanceFieldSet
+  /// CHECK-DAG: InstanceFieldSet
+  /// CHECK-DAG: InstanceFieldGet
+  /// CHECK-DAG: Return
+
+  /// CHECK-START: int Main.$noinline$testVolatileStoreSetAndMergeValuesRemovedSynchronization(TestClass, boolean) load_store_elimination (after)
+  /// CHECK-DAG: InstanceFieldSet
+  /// CHECK-DAG: InstanceFieldSet
+  /// CHECK-DAG: Return
+
+  /// CHECK-START: int Main.$noinline$testVolatileStoreSetAndMergeValuesRemovedSynchronization(TestClass, boolean) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldSet field_name:Main.vi
+
+  /// CHECK-START: int Main.$noinline$testVolatileStoreSetAndMergeValuesRemovedSynchronization(TestClass, boolean) load_store_elimination (after)
+  /// CHECK: Phi
+
+  /// CHECK-START: int Main.$noinline$testVolatileStoreSetAndMergeValuesRemovedSynchronization(TestClass, boolean) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldGet
+
+  static int $noinline$testVolatileStoreSetAndMergeValuesRemovedSynchronization(
+          TestClass obj, boolean b) {
+    Main m = new Main();
+
+    if (b) {
+      obj.i = 1;
+    } else {
+      obj.i = 2;
+    }
+    m.vi = 123;
+    return obj.i;
+  }
+
+  // Can't eliminate the setters in this method.
+
+  /// CHECK-START: int Main.$inline$SetterWithVolatileStores(TestClass) load_store_elimination (before)
+  /// CHECK:     InstanceFieldSet field_name:TestClass.j
+  /// CHECK:     InstanceFieldSet field_name:Main.vi
+  /// CHECK:     InstanceFieldSet field_name:TestClass.j
+  /// CHECK:     InstanceFieldSet field_name:Main.vi
+
+  /// CHECK-START: int Main.$inline$SetterWithVolatileStores(TestClass) load_store_elimination (after)
+  /// CHECK:     InstanceFieldSet field_name:TestClass.j
+  /// CHECK:     InstanceFieldSet field_name:Main.vi
+  /// CHECK:     InstanceFieldSet field_name:TestClass.j
+  /// CHECK:     InstanceFieldSet field_name:Main.vi
+  int $inline$SetterWithVolatileStores(TestClass obj) {
+    obj.j = 1;
+    this.vi = 123;
+    obj.j = 2;
+    this.vi = 123;
+    return obj.j;
+  }
+
+  // But we can eliminate once inlined.
+
+  /// CHECK-START: int Main.$noinline$testVolatileStoreInlineMethodWithSynchronizedScope(TestClass) load_store_elimination (before)
+  /// CHECK:     InstanceFieldSet field_name:TestClass.j
+  /// CHECK:     InstanceFieldSet field_name:Main.vi
+  /// CHECK:     InstanceFieldSet field_name:TestClass.j
+  /// CHECK:     InstanceFieldSet field_name:Main.vi
+
+  /// CHECK-START: int Main.$noinline$testVolatileStoreInlineMethodWithSynchronizedScope(TestClass) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldSet field_name:Main.vi
+
+  /// CHECK-START: int Main.$noinline$testVolatileStoreInlineMethodWithSynchronizedScope(TestClass) load_store_elimination (after)
+  /// CHECK:     InstanceFieldSet field_name:TestClass.j
+  /// CHECK-NOT: InstanceFieldSet field_name:TestClass.j
+  static int $noinline$testVolatileStoreInlineMethodWithSynchronizedScope(TestClass obj) {
+    Main m = new Main();
+    return m.$inline$SetterWithVolatileStores(obj);
+  }
+
   /// CHECK-START: int Main.$noinline$testMonitorOperationDifferentFields(TestClass, TestClass) load_store_elimination (before)
   /// CHECK: InstanceFieldSet
   /// CHECK: InstanceFieldSet
@@ -483,15 +831,11 @@
 
   // Unrelated monitor operations shouldn't block LSE.
   static int $noinline$testMonitorOperationDifferentFields(TestClass obj1, TestClass obj2) {
-    Main m = new Main();
-    synchronized (m) {}
-
+    synchronized (classForSync) {}
     obj1.i = 1;
     obj2.j = 2;
     int result = obj1.i + obj2.j;
-
-    synchronized (m) {}
-
+    synchronized (classForSync) {}
     return result;
   }
 
@@ -513,11 +857,9 @@
 
   // A synchronized operation blocks loads.
   static int $noinline$testMonitorOperationDifferentFieldsBlocking(TestClass obj1, TestClass obj2) {
-    Main m = new Main();
-
     obj1.i = 1;
     obj2.j = 2;
-    synchronized (m) {
+    synchronized (classForSync) {
       return obj1.i + obj2.j;
     }
   }
@@ -539,12 +881,10 @@
   /// CHECK-NOT: InstanceFieldGet
 
   static int $noinline$testMonitorOperationRedundantStore(TestClass obj) {
-    Main m = new Main();
-    synchronized (m) {
+    synchronized (classForSync) {
       obj.j = 1;
       obj.j = 2;
     }
-
     return obj.j;
   }
 
@@ -565,13 +905,10 @@
   /// CHECK-NOT: InstanceFieldGet
 
   static int $noinline$testMonitorOperationRedundantStoreBlocking(TestClass obj) {
-    Main m = new Main();
-
     // This store must be kept due to the monitor operation.
     obj.j = 1;
-    synchronized (m) {}
+    synchronized (classForSync) {}
     obj.j = 2;
-
     return obj.j;
   }
 
@@ -592,13 +929,10 @@
   /// CHECK: InstanceFieldGet
 
   static int $noinline$testMonitorOperationRedundantStoreBlockingOnlyLoad(TestClass obj) {
-    Main m = new Main();
-
     // This store can be safely removed.
     obj.j = 1;
     obj.j = 2;
-    synchronized (m) {}
-
+    synchronized (classForSync) {}
     // This load remains due to the monitor operation.
     return obj.j;
   }
@@ -622,16 +956,13 @@
   /// CHECK-NOT: InstanceFieldGet
 
   static int $noinline$testMonitorOperationRedundantStoreBlockingExit(TestClass obj) {
-    Main m = new Main();
-
-    synchronized (m) {
+    synchronized (classForSync) {
       // This store can be removed.
       obj.j = 0;
       // This store must be kept due to the monitor exit operation.
       obj.j = 1;
     }
     obj.j = 2;
-
     return obj.j;
   }
 
@@ -658,13 +989,11 @@
   /// CHECK-NOT: InstanceFieldGet
 
   static int $noinline$testMonitorOperationSetAndMergeValues(TestClass obj, boolean b) {
-    Main m = new Main();
-
     if (b) {
-      synchronized (m) {}
+      synchronized (classForSync) {}
       obj.i = 1;
     } else {
-      synchronized (m) {}
+      synchronized (classForSync) {}
       obj.i = 2;
     }
     return obj.i;
@@ -690,6 +1019,102 @@
   /// CHECK: InstanceFieldGet
 
   static int $noinline$testMonitorOperationSetAndMergeValuesBlocking(TestClass obj, boolean b) {
+    if (b) {
+      obj.i = 1;
+    } else {
+      obj.i = 2;
+    }
+    synchronized (classForSync) {}
+    return obj.i;
+  }
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationDifferentFieldsRemovedSynchronization(TestClass, TestClass) load_store_elimination (before)
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldGet
+  /// CHECK: InstanceFieldGet
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationDifferentFieldsRemovedSynchronization(TestClass, TestClass) load_store_elimination (before)
+  /// CHECK: MonitorOperation kind:enter
+  /// CHECK: MonitorOperation kind:exit
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationDifferentFieldsRemovedSynchronization(TestClass, TestClass) load_store_elimination (after)
+  /// CHECK-NOT: MonitorOperation
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationDifferentFieldsRemovedSynchronization(TestClass, TestClass) load_store_elimination (after)
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldSet
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationDifferentFieldsRemovedSynchronization(TestClass, TestClass) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldGet
+
+  static int $noinline$testMonitorOperationDifferentFieldsRemovedSynchronization(
+          TestClass obj1, TestClass obj2) {
+    Main m = new Main();
+
+    obj1.i = 1;
+    obj2.j = 2;
+    synchronized (m) {}
+
+    return obj1.i + obj2.j;
+  }
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationRedundantStoreRemovedSynchronization(TestClass) load_store_elimination (before)
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldSet
+  /// CHECK: InstanceFieldGet
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationRedundantStoreRemovedSynchronization(TestClass) load_store_elimination (before)
+  /// CHECK: MonitorOperation kind:enter
+  /// CHECK: MonitorOperation kind:exit
+  /// CHECK: MonitorOperation kind:enter
+  /// CHECK: MonitorOperation kind:exit
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationRedundantStoreRemovedSynchronization(TestClass) load_store_elimination (after)
+  /// CHECK-NOT: MonitorOperation
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationRedundantStoreRemovedSynchronization(TestClass) load_store_elimination (after)
+  /// CHECK: InstanceFieldSet
+  /// CHECK-NOT: InstanceFieldSet
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationRedundantStoreRemovedSynchronization(TestClass) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldGet
+  static int $noinline$testMonitorOperationRedundantStoreRemovedSynchronization(TestClass obj) {
+    Main m = new Main();
+
+    obj.j = 1;
+    synchronized (m) {}
+    obj.j = 2;
+    synchronized (m) {}
+
+    return obj.j;
+  }
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationSetAndMergeValuesRemovedSynchronization(TestClass, boolean) load_store_elimination (before)
+  /// CHECK-DAG: InstanceFieldSet
+  /// CHECK-DAG: InstanceFieldSet
+  /// CHECK-DAG: InstanceFieldGet
+  /// CHECK-DAG: Return
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationSetAndMergeValuesRemovedSynchronization(TestClass, boolean) load_store_elimination (after)
+  /// CHECK-DAG: InstanceFieldSet
+  /// CHECK-DAG: InstanceFieldSet
+  /// CHECK-DAG: Return
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationSetAndMergeValuesRemovedSynchronization(TestClass, boolean) load_store_elimination (before)
+  /// CHECK-DAG: MonitorOperation kind:enter
+  /// CHECK-DAG: MonitorOperation kind:exit
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationSetAndMergeValuesRemovedSynchronization(TestClass, boolean) load_store_elimination (after)
+  /// CHECK-NOT: MonitorOperation
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationSetAndMergeValuesRemovedSynchronization(TestClass, boolean) load_store_elimination (after)
+  /// CHECK: Phi
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationSetAndMergeValuesRemovedSynchronization(TestClass, boolean) load_store_elimination (after)
+  /// CHECK-NOT: InstanceFieldGet
+  static int $noinline$testMonitorOperationSetAndMergeValuesRemovedSynchronization(
+          TestClass obj, boolean b) {
     Main m = new Main();
 
     if (b) {
@@ -700,4 +1125,75 @@
     synchronized (m) {}
     return obj.i;
   }
+
+  synchronized int $inline$synchronizedSetter(TestClass obj) {
+    obj.j = 1;
+    obj.j = 2;
+    return obj.j;
+  }
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationInlineSynchronizedMethod(TestClass) inliner (before)
+  /// CHECK-NOT: MonitorOperation
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationInlineSynchronizedMethod(TestClass) inliner (after)
+  /// CHECK: MonitorOperation kind:enter
+  /// CHECK: MonitorOperation kind:exit
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationInlineSynchronizedMethod(TestClass) load_store_elimination (before)
+  /// CHECK: MonitorOperation kind:enter
+  /// CHECK: MonitorOperation kind:exit
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationInlineSynchronizedMethod(TestClass) load_store_elimination (before)
+  /// CHECK:     InstanceFieldSet
+  /// CHECK:     InstanceFieldSet
+  /// CHECK-NOT: InstanceFieldSet
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationInlineSynchronizedMethod(TestClass) load_store_elimination (after)
+  /// CHECK-NOT: MonitorOperation
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationInlineSynchronizedMethod(TestClass) load_store_elimination (after)
+  /// CHECK:     InstanceFieldSet
+  /// CHECK-NOT: InstanceFieldSet
+  static int $noinline$testMonitorOperationInlineSynchronizedMethod(TestClass obj) {
+    Main m = new Main();
+    return m.$inline$synchronizedSetter(obj);
+  }
+
+  int $inline$SetterWithSynchronizedScope(TestClass obj) {
+    synchronized (this) {
+      obj.j = 1;
+      obj.j = 2;
+      return obj.j;
+    }
+  }
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationInlineMethodWithSynchronizedScope(TestClass) inliner (before)
+  /// CHECK-NOT: MonitorOperation
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationInlineMethodWithSynchronizedScope(TestClass) inliner (after)
+  /// CHECK: MonitorOperation kind:enter
+  /// CHECK: MonitorOperation kind:exit
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationInlineMethodWithSynchronizedScope(TestClass) load_store_elimination (before)
+  /// CHECK: MonitorOperation kind:enter
+  /// CHECK: MonitorOperation kind:exit
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationInlineMethodWithSynchronizedScope(TestClass) load_store_elimination (before)
+  /// CHECK:     InstanceFieldSet
+  /// CHECK:     InstanceFieldSet
+  /// CHECK-NOT: InstanceFieldSet
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationInlineMethodWithSynchronizedScope(TestClass) load_store_elimination (after)
+  /// CHECK-NOT: MonitorOperation
+
+  /// CHECK-START: int Main.$noinline$testMonitorOperationInlineMethodWithSynchronizedScope(TestClass) load_store_elimination (after)
+  /// CHECK:     InstanceFieldSet
+  /// CHECK-NOT: InstanceFieldSet
+  static int $noinline$testMonitorOperationInlineMethodWithSynchronizedScope(TestClass obj) {
+    Main m = new Main();
+    return m.$inline$SetterWithSynchronizedScope(obj);
+  }
+
+  static TestClass classForSync;
+  volatile int vi;
 }
diff --git a/test/2243-checker-not-inline-into-throw/src/Main.java b/test/2243-checker-not-inline-into-throw/src/Main.java
index 6f1280c..f1d60a1 100644
--- a/test/2243-checker-not-inline-into-throw/src/Main.java
+++ b/test/2243-checker-not-inline-into-throw/src/Main.java
@@ -32,14 +32,18 @@
   // Empty methods are easy to inline anywhere.
   private static void easyToInline() {}
   private static void $inline$easyToInline() {}
+  private static void twoLevelEasyToInline() { easyToInline(); }
 
   /// CHECK-START: int Main.$noinline$testEndsWithThrow() inliner (before)
-  /// CHECK: InvokeStaticOrDirect method_name:Main.easyToInline
+  /// CHECK: InvokeStaticOrDirect method_name:Main.twoLevelEasyToInline
 
   /// CHECK-START: int Main.$noinline$testEndsWithThrow() inliner (after)
-  /// CHECK: InvokeStaticOrDirect method_name:Main.easyToInline
+  /// CHECK: InvokeStaticOrDirect method_name:Main.twoLevelEasyToInline
   static int $noinline$testEndsWithThrow() {
-    easyToInline();
+    // Use two level inlining to avoid a pattern match in the inliner.
+    // The pattern matching is deliberately done before we check if inlining is "encouraged"
+    // which includes checking if the block ends with a `throw`.
+    twoLevelEasyToInline();
     throw new Error("");
   }
 
diff --git a/test/2243-single-step-default/single_step_helper.cc b/test/2243-single-step-default/single_step_helper.cc
index 432e982..3b2d0bd 100644
--- a/test/2243-single-step-default/single_step_helper.cc
+++ b/test/2243-single-step-default/single_step_helper.cc
@@ -29,7 +29,7 @@
                          JNIEnv* env,
                          jthread thr,
                          jmethodID method,
-                         jlocation location ATTRIBUTE_UNUSED) {
+                         [[maybe_unused]] jlocation location) {
   // We haven't reached the default method yet. Continue single stepping
   if (method != interface_default_method) {
     return;
@@ -99,14 +99,14 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test2243_enableSingleStep(JNIEnv* env,
-                                                                     jclass ATTRIBUTE_UNUSED,
+                                                                     [[maybe_unused]] jclass cl,
                                                                      jthread thr) {
   jvmtiError err = jvmti_env->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, thr);
   JvmtiErrorToException(env, jvmti_env, err);
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test2243_setSingleStepUntil(JNIEnv* env,
-                                                                       jclass cl ATTRIBUTE_UNUSED,
+                                                                       [[maybe_unused]] jclass cl,
                                                                        jobject method) {
   interface_default_method = env->FromReflectedMethod(method);
 }
diff --git a/test/2244-checker-remove-try-boundary/src/Main.java b/test/2244-checker-remove-try-boundary/src/Main.java
index 65c40c5..1b616a5 100644
--- a/test/2244-checker-remove-try-boundary/src/Main.java
+++ b/test/2244-checker-remove-try-boundary/src/Main.java
@@ -158,30 +158,29 @@
   }
 
   // The throw gets eliminated by `SimplifyIfs` in DCE, so we can detect that nothing can throw in
-  // the graph and eliminate the `TryBoundary` instructions. It does so in `after_gvn` since it
-  // requires the VisitIf optimization which happens later in the graph.
+  // the graph and eliminate the `TryBoundary` instructions.
 
-  /// CHECK-START: int Main.$noinline$testOptimizeAfterOneBranchDisappears(int, boolean) dead_code_elimination$after_gvn (before)
+  /// CHECK-START: int Main.$noinline$testOptimizeAfterOneBranchDisappears(int, boolean) dead_code_elimination$initial (before)
   /// CHECK:     Throw
 
-  /// CHECK-START: int Main.$noinline$testOptimizeAfterOneBranchDisappears(int, boolean) dead_code_elimination$after_gvn (before)
+  /// CHECK-START: int Main.$noinline$testOptimizeAfterOneBranchDisappears(int, boolean) dead_code_elimination$initial (before)
   /// CHECK:     TryBoundary
   /// CHECK:     TryBoundary
   /// CHECK:     TryBoundary
   /// CHECK:     TryBoundary
   /// CHECK-NOT: TryBoundary
 
-  /// CHECK-START: int Main.$noinline$testOptimizeAfterOneBranchDisappears(int, boolean) dead_code_elimination$after_gvn (before)
+  /// CHECK-START: int Main.$noinline$testOptimizeAfterOneBranchDisappears(int, boolean) dead_code_elimination$initial (before)
   /// CHECK:     flags "catch_block"
   /// CHECK-NOT: flags "catch_block"
 
-  /// CHECK-START: int Main.$noinline$testOptimizeAfterOneBranchDisappears(int, boolean) dead_code_elimination$after_gvn (after)
+  /// CHECK-START: int Main.$noinline$testOptimizeAfterOneBranchDisappears(int, boolean) dead_code_elimination$initial (after)
   /// CHECK-NOT: Throw
 
-  /// CHECK-START: int Main.$noinline$testOptimizeAfterOneBranchDisappears(int, boolean) dead_code_elimination$after_gvn (after)
+  /// CHECK-START: int Main.$noinline$testOptimizeAfterOneBranchDisappears(int, boolean) dead_code_elimination$initial (after)
   /// CHECK-NOT: TryBoundary
 
-  /// CHECK-START: int Main.$noinline$testOptimizeAfterOneBranchDisappears(int, boolean) dead_code_elimination$after_gvn (after)
+  /// CHECK-START: int Main.$noinline$testOptimizeAfterOneBranchDisappears(int, boolean) dead_code_elimination$initial (after)
   /// CHECK-NOT: flags "catch_block"
   public static int $noinline$testOptimizeAfterOneBranchDisappears(int a, boolean val) {
     try {
diff --git a/test/2246-trace-stream/expected-stdout.txt b/test/2246-trace-stream/expected-stdout.txt
index d6ad93c..c0cf36b 100644
--- a/test/2246-trace-stream/expected-stdout.txt
+++ b/test/2246-trace-stream/expected-stdout.txt
@@ -1,7 +1,16 @@
-***** streaming test *******
+JNI_OnLoad called
+***** streaming test - dual clock *******
 .>> TestThread2246 java.lang.Thread run ()V Thread.java
 ..>> TestThread2246 Main$$ExternalSyntheticLambda0 run ()V D8$$SyntheticClass
-...>> TestThread2246 Main lambda$testTracing$0 ()V Main.java
+...>> TestThread2246 Main lambda$testTracing$0 (IZLMain;LBaseTraceParser;I)V Main.java
+....>> TestThread2246 Main$VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+.....>> TestThread2246 java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+......>> TestThread2246 dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+.......>> TestThread2246 dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+.......<< TestThread2246 dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+......<< TestThread2246 dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+.....<< TestThread2246 java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+....<< TestThread2246 Main$VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
 ....>> TestThread2246 Main <init> ()V Main.java
 .....>> TestThread2246 java.lang.Object <init> ()V Object.java
 .....<< TestThread2246 java.lang.Object <init> ()V Object.java
@@ -14,11 +23,169 @@
 .....>> TestThread2246 Main callLeafFunction ()V Main.java
 .....<< TestThread2246 Main callLeafFunction ()V Main.java
 ....<< TestThread2246 Main $noinline$doSomeWork ()V Main.java
-...<< TestThread2246 Main lambda$testTracing$0 ()V Main.java
-..<< TestThread2246 Main$$ExternalSyntheticLambda0 run ()V D8$$SyntheticClass
-.<< TestThread2246 java.lang.Thread run ()V Thread.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main$VMDebug $noinline$stopMethodTracing ()V Main.java
 .>> main Main main ([Ljava/lang/String;)V Main.java
-..>> main Main testTracing (ZLBaseTraceParser;I)V Main.java
+..>> main Main testTracing (ZILBaseTraceParser;I)V Main.java
 ...>> main Main$VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
 ....>> main java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
 .....>> main dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
@@ -27,26 +194,6 @@
 .....<< main dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
 ....<< main java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
 ...<< main Main$VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
-...>> main java.lang.Thread start ()V Thread.java
-....>> main java.lang.ThreadGroup add (Ljava/lang/Thread;)V ThreadGroup.java
-....<< main java.lang.ThreadGroup add (Ljava/lang/Thread;)V ThreadGroup.java
-....>> main java.lang.Thread nativeCreate (Ljava/lang/Thread;JZ)V Thread.java
-....<< main java.lang.Thread nativeCreate (Ljava/lang/Thread;JZ)V Thread.java
-...<< main java.lang.Thread start ()V Thread.java
-...>> main java.lang.Thread join ()V Thread.java
-....>> main java.lang.Thread join (J)V Thread.java
-.....>> main java.lang.System currentTimeMillis ()J System.java
-.....<< main java.lang.System currentTimeMillis ()J System.java
-.....>> main java.lang.Thread isAlive ()Z Thread.java
-.....<< main java.lang.Thread isAlive ()Z Thread.java
-.....>> main java.lang.Object wait (J)V Object.java
-......>> main java.lang.Object wait (JI)V Object.java
-......<< main java.lang.Object wait (JI)V Object.java
-.....<< main java.lang.Object wait (J)V Object.java
-.....>> main java.lang.Thread isAlive ()Z Thread.java
-.....<< main java.lang.Thread isAlive ()Z Thread.java
-....<< main java.lang.Thread join (J)V Thread.java
-...<< main java.lang.Thread join ()V Thread.java
 ...>> main Main $noinline$doSomeWork ()V Main.java
 ....>> main Main callOuterFunction ()V Main.java
 .....>> main Main callLeafFunction ()V Main.java
@@ -55,6 +202,166 @@
 ....>> main Main callLeafFunction ()V Main.java
 ....<< main Main callLeafFunction ()V Main.java
 ...<< main Main $noinline$doSomeWork ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
 ...>> main Main doSomeWorkThrow ()V Main.java
 ....>> main Main callThrowFunction ()V Main.java
 .....>> main java.lang.Exception <init> (Ljava/lang/String;)V Exception.java
@@ -72,85 +379,1143 @@
 ....<<E main Main callThrowFunction ()V Main.java
 ...<< main Main doSomeWorkThrow ()V Main.java
 ...>> main Main$VMDebug $noinline$stopMethodTracing ()V Main.java
-***** non streaming test *******
-.>> TestThread2246 java.lang.Thread	run	()V	Thread.java
-..>> TestThread2246 Main$$ExternalSyntheticLambda0	run	()V	D8$$SyntheticClass
-...>> TestThread2246 Main	lambda$testTracing$0	()V	Main.java
-....>> TestThread2246 Main	<init>	()V	Main.java
-.....>> TestThread2246 java.lang.Object	<init>	()V	Object.java
-.....<< TestThread2246 java.lang.Object	<init>	()V	Object.java
-....<< TestThread2246 Main	<init>	()V	Main.java
-....>> TestThread2246 Main	$noinline$doSomeWork	()V	Main.java
-.....>> TestThread2246 Main	callOuterFunction	()V	Main.java
-......>> TestThread2246 Main	callLeafFunction	()V	Main.java
-......<< TestThread2246 Main	callLeafFunction	()V	Main.java
-.....<< TestThread2246 Main	callOuterFunction	()V	Main.java
-.....>> TestThread2246 Main	callLeafFunction	()V	Main.java
-.....<< TestThread2246 Main	callLeafFunction	()V	Main.java
-....<< TestThread2246 Main	$noinline$doSomeWork	()V	Main.java
-...<< TestThread2246 Main	lambda$testTracing$0	()V	Main.java
-..<< TestThread2246 Main$$ExternalSyntheticLambda0	run	()V	D8$$SyntheticClass
-.<< TestThread2246 java.lang.Thread	run	()V	Thread.java
-.>> TestThread2246 java.lang.ThreadGroup	threadTerminated	(Ljava/lang/Thread;)V	ThreadGroup.java
-..>> TestThread2246 java.lang.ThreadGroup	remove	(Ljava/lang/Thread;)V	ThreadGroup.java
-...>> TestThread2246 java.lang.System	arraycopy	(Ljava/lang/Object;ILjava/lang/Object;II)V	System.java
-...<< TestThread2246 java.lang.System	arraycopy	(Ljava/lang/Object;ILjava/lang/Object;II)V	System.java
-..<< TestThread2246 java.lang.ThreadGroup	remove	(Ljava/lang/Thread;)V	ThreadGroup.java
-.<< TestThread2246 java.lang.ThreadGroup	threadTerminated	(Ljava/lang/Thread;)V	ThreadGroup.java
-.>> main Main	main	([Ljava/lang/String;)V	Main.java
-..>> main Main	testTracing	(ZLBaseTraceParser;I)V	Main.java
-...>> main Main$VMDebug	startMethodTracing	(Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V	Main.java
-....>> main java.lang.reflect.Method	invoke	(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;	Method.java
-.....>> main dalvik.system.VMDebug	startMethodTracing	(Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V	VMDebug.java
-......>> main dalvik.system.VMDebug	startMethodTracingFd	(Ljava/lang/String;IIIZIZ)V	VMDebug.java
-......<< main dalvik.system.VMDebug	startMethodTracingFd	(Ljava/lang/String;IIIZIZ)V	VMDebug.java
-.....<< main dalvik.system.VMDebug	startMethodTracing	(Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V	VMDebug.java
-....<< main java.lang.reflect.Method	invoke	(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;	Method.java
-...<< main Main$VMDebug	startMethodTracing	(Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V	Main.java
-...>> main java.lang.Thread	start	()V	Thread.java
-....>> main java.lang.ThreadGroup	add	(Ljava/lang/Thread;)V	ThreadGroup.java
-....<< main java.lang.ThreadGroup	add	(Ljava/lang/Thread;)V	ThreadGroup.java
-....>> main java.lang.Thread	nativeCreate	(Ljava/lang/Thread;JZ)V	Thread.java
-....<< main java.lang.Thread	nativeCreate	(Ljava/lang/Thread;JZ)V	Thread.java
-...<< main java.lang.Thread	start	()V	Thread.java
-...>> main java.lang.Thread	join	()V	Thread.java
-....>> main java.lang.Thread	join	(J)V	Thread.java
-.....>> main java.lang.System	currentTimeMillis	()J	System.java
-.....<< main java.lang.System	currentTimeMillis	()J	System.java
-.....>> main java.lang.Thread	isAlive	()Z	Thread.java
-.....<< main java.lang.Thread	isAlive	()Z	Thread.java
-.....>> main java.lang.Object	wait	(J)V	Object.java
-......>> main java.lang.Object	wait	(JI)V	Object.java
-......<< main java.lang.Object	wait	(JI)V	Object.java
-.....<< main java.lang.Object	wait	(J)V	Object.java
-.....>> main java.lang.Thread	isAlive	()Z	Thread.java
-.....<< main java.lang.Thread	isAlive	()Z	Thread.java
-....<< main java.lang.Thread	join	(J)V	Thread.java
-...<< main java.lang.Thread	join	()V	Thread.java
-...>> main Main	$noinline$doSomeWork	()V	Main.java
-....>> main Main	callOuterFunction	()V	Main.java
-.....>> main Main	callLeafFunction	()V	Main.java
-.....<< main Main	callLeafFunction	()V	Main.java
-....<< main Main	callOuterFunction	()V	Main.java
-....>> main Main	callLeafFunction	()V	Main.java
-....<< main Main	callLeafFunction	()V	Main.java
-...<< main Main	$noinline$doSomeWork	()V	Main.java
-...>> main Main	doSomeWorkThrow	()V	Main.java
-....>> main Main	callThrowFunction	()V	Main.java
-.....>> main java.lang.Exception	<init>	(Ljava/lang/String;)V	Exception.java
-......>> main java.lang.Throwable	<init>	(Ljava/lang/String;)V	Throwable.java
-.......>> main java.lang.Object	<init>	()V	Object.java
-.......<< main java.lang.Object	<init>	()V	Object.java
-.......>> main java.util.Collections	emptyList	()Ljava/util/List;	Collections.java
-.......<< main java.util.Collections	emptyList	()Ljava/util/List;	Collections.java
-.......>> main java.lang.Throwable	fillInStackTrace	()Ljava/lang/Throwable;	Throwable.java
-........>> main java.lang.Throwable	nativeFillInStackTrace	()Ljava/lang/Object;	Throwable.java
-........<< main java.lang.Throwable	nativeFillInStackTrace	()Ljava/lang/Object;	Throwable.java
-.......<< main java.lang.Throwable	fillInStackTrace	()Ljava/lang/Throwable;	Throwable.java
-......<< main java.lang.Throwable	<init>	(Ljava/lang/String;)V	Throwable.java
-.....<< main java.lang.Exception	<init>	(Ljava/lang/String;)V	Exception.java
-....<<E main Main	callThrowFunction	()V	Main.java
-...<< main Main	doSomeWorkThrow	()V	Main.java
-...>> main Main$VMDebug	$noinline$stopMethodTracing	()V	Main.java
-....>> main java.lang.reflect.Method	invoke	(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;	Method.java
-.....>> main dalvik.system.VMDebug	stopMethodTracing	()V	VMDebug.java
+***** streaming test - wall clock *******
+.>> TestThread2246 java.lang.Thread run ()V Thread.java
+..>> TestThread2246 Main$$ExternalSyntheticLambda0 run ()V D8$$SyntheticClass
+...>> TestThread2246 Main lambda$testTracing$0 (IZLMain;LBaseTraceParser;I)V Main.java
+....>> TestThread2246 Main$VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+.....>> TestThread2246 java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+......>> TestThread2246 dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+.......>> TestThread2246 dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+.......<< TestThread2246 dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+......<< TestThread2246 dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+.....<< TestThread2246 java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+....<< TestThread2246 Main$VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+....>> TestThread2246 Main <init> ()V Main.java
+.....>> TestThread2246 java.lang.Object <init> ()V Object.java
+.....<< TestThread2246 java.lang.Object <init> ()V Object.java
+....<< TestThread2246 Main <init> ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWork ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWork ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main$VMDebug $noinline$stopMethodTracing ()V Main.java
+.>> main Main main ([Ljava/lang/String;)V Main.java
+..>> main Main testTracing (ZILBaseTraceParser;I)V Main.java
+...>> main Main$VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+....>> main java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+.....>> main dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+......>> main dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+......<< main dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+.....<< main dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+....<< main java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+...<< main Main$VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+...>> main Main $noinline$doSomeWork ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWork ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main doSomeWorkThrow ()V Main.java
+....>> main Main callThrowFunction ()V Main.java
+.....>> main java.lang.Exception <init> (Ljava/lang/String;)V Exception.java
+......>> main java.lang.Throwable <init> (Ljava/lang/String;)V Throwable.java
+.......>> main java.lang.Object <init> ()V Object.java
+.......<< main java.lang.Object <init> ()V Object.java
+.......>> main java.util.Collections emptyList ()Ljava/util/List; Collections.java
+.......<< main java.util.Collections emptyList ()Ljava/util/List; Collections.java
+.......>> main java.lang.Throwable fillInStackTrace ()Ljava/lang/Throwable; Throwable.java
+........>> main java.lang.Throwable nativeFillInStackTrace ()Ljava/lang/Object; Throwable.java
+........<< main java.lang.Throwable nativeFillInStackTrace ()Ljava/lang/Object; Throwable.java
+.......<< main java.lang.Throwable fillInStackTrace ()Ljava/lang/Throwable; Throwable.java
+......<< main java.lang.Throwable <init> (Ljava/lang/String;)V Throwable.java
+.....<< main java.lang.Exception <init> (Ljava/lang/String;)V Exception.java
+....<<E main Main callThrowFunction ()V Main.java
+...<< main Main doSomeWorkThrow ()V Main.java
+...>> main Main$VMDebug $noinline$stopMethodTracing ()V Main.java
+***** non streaming test - dual clock *******
+.>> TestThread2246 java.lang.Thread run ()V Thread.java
+..>> TestThread2246 Main$$ExternalSyntheticLambda0 run ()V D8$$SyntheticClass
+...>> TestThread2246 Main lambda$testTracing$0 (IZLMain;LBaseTraceParser;I)V Main.java
+....>> TestThread2246 Main$VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+.....>> TestThread2246 java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+......>> TestThread2246 dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+.......>> TestThread2246 dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+.......<< TestThread2246 dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+......<< TestThread2246 dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+.....<< TestThread2246 java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+....<< TestThread2246 Main$VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+....>> TestThread2246 Main <init> ()V Main.java
+.....>> TestThread2246 java.lang.Object <init> ()V Object.java
+.....<< TestThread2246 java.lang.Object <init> ()V Object.java
+....<< TestThread2246 Main <init> ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWork ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWork ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main$VMDebug $noinline$stopMethodTracing ()V Main.java
+.>> main Main main ([Ljava/lang/String;)V Main.java
+..>> main Main testTracing (ZILBaseTraceParser;I)V Main.java
+...>> main Main$VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+....>> main java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+.....>> main dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+......>> main dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+......<< main dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+.....<< main dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+....<< main java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+...<< main Main$VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+...>> main Main $noinline$doSomeWork ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWork ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main doSomeWorkThrow ()V Main.java
+....>> main Main callThrowFunction ()V Main.java
+.....>> main java.lang.Exception <init> (Ljava/lang/String;)V Exception.java
+......>> main java.lang.Throwable <init> (Ljava/lang/String;)V Throwable.java
+.......>> main java.lang.Object <init> ()V Object.java
+.......<< main java.lang.Object <init> ()V Object.java
+.......>> main java.util.Collections emptyList ()Ljava/util/List; Collections.java
+.......<< main java.util.Collections emptyList ()Ljava/util/List; Collections.java
+.......>> main java.lang.Throwable fillInStackTrace ()Ljava/lang/Throwable; Throwable.java
+........>> main java.lang.Throwable nativeFillInStackTrace ()Ljava/lang/Object; Throwable.java
+........<< main java.lang.Throwable nativeFillInStackTrace ()Ljava/lang/Object; Throwable.java
+.......<< main java.lang.Throwable fillInStackTrace ()Ljava/lang/Throwable; Throwable.java
+......<< main java.lang.Throwable <init> (Ljava/lang/String;)V Throwable.java
+.....<< main java.lang.Exception <init> (Ljava/lang/String;)V Exception.java
+....<<E main Main callThrowFunction ()V Main.java
+...<< main Main doSomeWorkThrow ()V Main.java
+...>> main Main$VMDebug $noinline$stopMethodTracing ()V Main.java
+***** non streaming test - wall clock *******
+.>> TestThread2246 java.lang.Thread run ()V Thread.java
+..>> TestThread2246 Main$$ExternalSyntheticLambda0 run ()V D8$$SyntheticClass
+...>> TestThread2246 Main lambda$testTracing$0 (IZLMain;LBaseTraceParser;I)V Main.java
+....>> TestThread2246 Main$VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+.....>> TestThread2246 java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+......>> TestThread2246 dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+.......>> TestThread2246 dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+.......<< TestThread2246 dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+......<< TestThread2246 dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+.....<< TestThread2246 java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+....<< TestThread2246 Main$VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+....>> TestThread2246 Main <init> ()V Main.java
+.....>> TestThread2246 java.lang.Object <init> ()V Object.java
+.....<< TestThread2246 java.lang.Object <init> ()V Object.java
+....<< TestThread2246 Main <init> ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWork ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWork ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main$VMDebug $noinline$stopMethodTracing ()V Main.java
+.>> main Main main ([Ljava/lang/String;)V Main.java
+..>> main Main testTracing (ZILBaseTraceParser;I)V Main.java
+...>> main Main$VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+....>> main java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+.....>> main dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+......>> main dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+......<< main dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+.....<< main dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+....<< main java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+...<< main Main$VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+...>> main Main $noinline$doSomeWork ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWork ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main doSomeWorkThrow ()V Main.java
+....>> main Main callThrowFunction ()V Main.java
+.....>> main java.lang.Exception <init> (Ljava/lang/String;)V Exception.java
+......>> main java.lang.Throwable <init> (Ljava/lang/String;)V Throwable.java
+.......>> main java.lang.Object <init> ()V Object.java
+.......<< main java.lang.Object <init> ()V Object.java
+.......>> main java.util.Collections emptyList ()Ljava/util/List; Collections.java
+.......<< main java.util.Collections emptyList ()Ljava/util/List; Collections.java
+.......>> main java.lang.Throwable fillInStackTrace ()Ljava/lang/Throwable; Throwable.java
+........>> main java.lang.Throwable nativeFillInStackTrace ()Ljava/lang/Object; Throwable.java
+........<< main java.lang.Throwable nativeFillInStackTrace ()Ljava/lang/Object; Throwable.java
+.......<< main java.lang.Throwable fillInStackTrace ()Ljava/lang/Throwable; Throwable.java
+......<< main java.lang.Throwable <init> (Ljava/lang/String;)V Throwable.java
+.....<< main java.lang.Exception <init> (Ljava/lang/String;)V Exception.java
+....<<E main Main callThrowFunction ()V Main.java
+...<< main Main doSomeWorkThrow ()V Main.java
+...>> main Main$VMDebug $noinline$stopMethodTracing ()V Main.java
diff --git a/test/2246-trace-stream/src/BaseTraceParser.java b/test/2246-trace-stream/src/BaseTraceParser.java
index c4b14aa..80f695a 100644
--- a/test/2246-trace-stream/src/BaseTraceParser.java
+++ b/test/2246-trace-stream/src/BaseTraceParser.java
@@ -24,7 +24,9 @@
 abstract class BaseTraceParser {
     public static final int MAGIC_NUMBER = 0x574f4c53;
     public static final int DUAL_CLOCK_VERSION = 3;
+    public static final int WALL_CLOCK_VERSION = 2;
     public static final int STREAMING_DUAL_CLOCK_VERSION = 0xF3;
+    public static final int STREAMING_WALL_CLOCK_VERSION = 0xF2;
     public static final String START_SECTION_ID = "*";
     public static final String METHODS_SECTION_ID = "*methods";
     public static final String THREADS_SECTION_ID = "*threads";
@@ -36,6 +38,8 @@
         threadIdMap = new HashMap<Integer, String>();
         nestingLevelMap = new HashMap<Integer, Integer>();
         threadEventsMap = new HashMap<String, String>();
+        threadTimestamp1Map = new HashMap<Integer, Integer>();
+        threadTimestamp2Map = new HashMap<Integer, Integer>();
     }
 
     public void closeFile() throws IOException {
@@ -101,12 +105,14 @@
         }
     }
 
-    public int GetEntryHeader() throws IOException {
-        // Read 2-byte thread-id. On host thread-ids can be greater than 16-bit.
+    public int GetThreadID() throws IOException {
+        // Read 2-byte thread-id. On host thread-ids can be greater than 16-bit but it is truncated
+        // to 16-bits in the trace.
         int threadId = readNumber(2);
-        if (threadId != 0) {
-            return threadId;
-        }
+        return threadId;
+    }
+
+    public int GetEntryHeader() throws IOException {
         // Read 1-byte header type
         return readNumber(1);
     }
@@ -134,11 +140,16 @@
         threadIdMap.put(threadId, threadInfo);
     }
 
-    public boolean ShouldIgnoreThread(int threadId) throws Exception {
-        if (threadIdMap.get(threadId).contains("Daemon")) {
-            return true;
+    public boolean ShouldCheckThread(int threadId, String threadName) throws Exception {
+        if (!threadIdMap.containsKey(threadId)) {
+          System.out.println("no threadId -> name  mapping for thread " + threadId);
+          // TODO(b/279547877): Ideally we should throw here, since it isn't expected. Just
+          // continuing to get more logs from the bots to see what's happening here. The
+          // test will fail anyway because the expected output will be different.
+          return true;
         }
-        return false;
+
+        return threadIdMap.get(threadId).equals(threadName);
     }
 
     public String eventTypeToString(int eventType, int threadId) {
@@ -171,7 +182,19 @@
         return str;
     }
 
-    public String ProcessEventEntry(int threadId) throws IOException {
+    public void CheckTimestamp(int timestamp, int threadId,
+            HashMap<Integer, Integer> threadTimestampMap) throws Exception {
+        if (threadTimestampMap.containsKey(threadId)) {
+            int oldTimestamp = threadTimestampMap.get(threadId);
+            if (timestamp < oldTimestamp) {
+                throw new Exception("timestamps are not increasing current: " + timestamp
+                        + "  earlier: " + oldTimestamp);
+            }
+        }
+        threadTimestampMap.put(threadId, timestamp);
+    }
+
+    public String ProcessEventEntry(int threadId) throws IOException, Exception {
         // Read 4-byte method value
         int methodAndEvent = readNumber(4);
         int methodId = methodAndEvent & ~0x3;
@@ -180,10 +203,13 @@
         String str = eventTypeToString(eventType, threadId) + " " + threadIdMap.get(threadId)
                 + " " + methodIdMap.get(methodId);
         // Depending on the version skip either one or two timestamps.
-        // TODO(mythria): Probably add a check that time stamps are always greater than initial
-        // timestamp.
-        int numBytesTimestamp = (traceFormatVersion == 2) ? 4 : 8;
-        dataStream.skipBytes(numBytesTimestamp);
+        int timestamp1 = readNumber(4);
+        CheckTimestamp(timestamp1, threadId, threadTimestamp1Map);
+        if (traceFormatVersion != 2) {
+            // Read second timestamp
+            int timestamp2 = readNumber(4);
+            CheckTimestamp(timestamp2, threadId, threadTimestamp2Map);
+        }
         return str;
     }
 
@@ -196,14 +222,16 @@
         threadEventsMap.put(threadName, threadEventsMap.get(threadName) + "\n" + entry);
     }
 
-    public abstract void CheckTraceFileFormat(File traceFile, int expectedVersion)
-            throws Exception;
+    public abstract void CheckTraceFileFormat(File traceFile,
+        int expectedVersion, String threadName) throws Exception;
 
     DataInputStream dataStream;
     HashMap<Integer, String> methodIdMap;
     HashMap<Integer, String> threadIdMap;
     HashMap<Integer, Integer> nestingLevelMap;
     HashMap<String, String> threadEventsMap;
+    HashMap<Integer, Integer> threadTimestamp1Map;
+    HashMap<Integer, Integer> threadTimestamp2Map;
     int recordSize = 0;
     int traceFormatVersion = 0;
 }
diff --git a/test/2246-trace-stream/src/Main.java b/test/2246-trace-stream/src/Main.java
index daada7d..b800a1e 100644
--- a/test/2246-trace-stream/src/Main.java
+++ b/test/2246-trace-stream/src/Main.java
@@ -23,50 +23,92 @@
 public class Main {
     private static final String TEMP_FILE_NAME_PREFIX = "test";
     private static final String TEMP_FILE_NAME_SUFFIX = ".trace";
+    private static final int WALL_CLOCK_FLAG = 0x010;
     private static File file;
 
     public static void main(String[] args) throws Exception {
+        System.loadLibrary(args[0]);
         String name = System.getProperty("java.vm.name");
         if (!"Dalvik".equals(name)) {
             System.out.println("This test is not supported on " + name);
             return;
         }
-        System.out.println("***** streaming test *******");
+
+        ensureJitCompiled(Main.class, "$noinline$doSomeWorkJIT");
+
+        System.out.println("***** streaming test - dual clock *******");
         StreamTraceParser stream_parser = new StreamTraceParser();
         testTracing(
-                /* streaming=*/true, stream_parser, BaseTraceParser.STREAMING_DUAL_CLOCK_VERSION);
+                /* streaming=*/true, /* flags= */ 0, stream_parser,
+                BaseTraceParser.STREAMING_DUAL_CLOCK_VERSION);
 
-        System.out.println("***** non streaming test *******");
+        System.out.println("***** streaming test - wall clock *******");
+        StreamTraceParser stream_parser_wall_clock = new StreamTraceParser();
+        testTracing(
+                /* streaming=*/true, /* flags= */ WALL_CLOCK_FLAG, stream_parser,
+                BaseTraceParser.STREAMING_WALL_CLOCK_VERSION);
+
+        System.out.println("***** non streaming test - dual clock *******");
         NonStreamTraceParser non_stream_parser = new NonStreamTraceParser();
-        testTracing(/* streaming=*/false, non_stream_parser, BaseTraceParser.DUAL_CLOCK_VERSION);
+        testTracing(/* streaming=*/false, /* flags= */ 0, non_stream_parser,
+                BaseTraceParser.DUAL_CLOCK_VERSION);
+
+        System.out.println("***** non streaming test - wall clock *******");
+        NonStreamTraceParser non_stream_parser_wall_clock = new NonStreamTraceParser();
+        testTracing(/* streaming=*/false, /* flags= */ WALL_CLOCK_FLAG,
+                non_stream_parser_wall_clock, BaseTraceParser.WALL_CLOCK_VERSION);
     }
 
-    public static void testTracing(boolean streaming, BaseTraceParser parser, int expected_version)
-            throws Exception {
-        file = createTempFile();
-        FileOutputStream out_file = new FileOutputStream(file);
+    public static void testTracing(boolean streaming, int flags, BaseTraceParser parser,
+            int expected_version) throws Exception {
         Main m = new Main();
         Thread t = new Thread(() -> {
-            Main m1 = new Main();
-            m1.$noinline$doSomeWork();
+            try {
+                file = createTempFile();
+                FileOutputStream out_file = new FileOutputStream(file);
+                VMDebug.startMethodTracing(
+                        file.getPath(), out_file.getFD(), 0, flags, false, 0, streaming);
+                Main m1 = new Main();
+                m1.$noinline$doSomeWork();
+                // Call JITed code multiple times to flush out any issues with timestamps.
+                for (int i = 0; i < 20; i++) {
+                    m.$noinline$doSomeWorkJIT();
+                }
+                VMDebug.$noinline$stopMethodTracing();
+                out_file.close();
+                parser.CheckTraceFileFormat(file, expected_version, "TestThread2246");
+                file.delete();
+            } catch (Exception e) {
+                System.out.println("Exception in thread " + e);
+                e.printStackTrace();
+            } finally {
+              file.delete();
+            }
         }, "TestThread2246");
         try {
             if (VMDebug.getMethodTracingMode() != 0) {
                 VMDebug.$noinline$stopMethodTracing();
             }
 
-            VMDebug.startMethodTracing(file.getPath(), out_file.getFD(), 0, 0, false, 0, streaming);
             t.start();
             t.join();
+
+            file = createTempFile();
+            FileOutputStream main_out_file = new FileOutputStream(file);
+            VMDebug.startMethodTracing(
+                    file.getPath(), main_out_file.getFD(), 0, flags, false, 0, streaming);
             m.$noinline$doSomeWork();
+            // Call JITed code multiple times to flush out any issues with timestamps.
+            for (int i = 0; i < 20; i++) {
+                m.$noinline$doSomeWorkJIT();
+            }
             m.doSomeWorkThrow();
             VMDebug.$noinline$stopMethodTracing();
-            out_file.close();
-            parser.CheckTraceFileFormat(file, expected_version);
+            main_out_file.close();
+            parser.CheckTraceFileFormat(file, expected_version, "main");
+            file.delete();
         } finally {
-            if (out_file != null) {
-                out_file.close();
-            }
+          file.delete();
         }
     }
 
@@ -95,6 +137,11 @@
         callLeafFunction();
     }
 
+    public void $noinline$doSomeWorkJIT() {
+        callOuterFunction();
+        callLeafFunction();
+    }
+
     public void callThrowFunction() throws Exception {
         throw new Exception("test");
     }
@@ -136,4 +183,6 @@
             return (int) getMethodTracingModeMethod.invoke(null);
         }
     }
+
+    private static native void ensureJitCompiled(Class<?> cls, String methodName);
 }
diff --git a/test/2246-trace-stream/src/NonStreamTraceParser.java b/test/2246-trace-stream/src/NonStreamTraceParser.java
index 7763c9c..f106c49 100644
--- a/test/2246-trace-stream/src/NonStreamTraceParser.java
+++ b/test/2246-trace-stream/src/NonStreamTraceParser.java
@@ -19,7 +19,8 @@
 
 public class NonStreamTraceParser extends BaseTraceParser {
 
-    public void CheckTraceFileFormat(File file, int expectedVersion) throws Exception {
+    public void CheckTraceFileFormat(File file,
+        int expectedVersion, String threadName) throws Exception {
         InitializeParser(file);
 
         // On non-streaming formats, the file starts with information about options and threads and
@@ -65,7 +66,7 @@
         line = readLine();
         while (!line.startsWith(START_SECTION_ID)) {
             String[] methodInfo = line.split("\t", 2);
-            methodIdMap.put(Integer.decode(methodInfo[0]), methodInfo[1]);
+            methodIdMap.put(Integer.decode(methodInfo[0]), methodInfo[1].replace('\t', ' '));
             line = readLine();
         }
 
@@ -79,11 +80,11 @@
         boolean hasEntries = true;
         boolean seenStopTracingMethod = false;
         for (int i = 0; i < numEntries; i++) {
-            int threadId = GetEntryHeader();
+            int threadId = GetThreadID();
             String eventString = ProcessEventEntry(threadId);
             // Ignore daemons (ex: heap task daemon, reference queue daemon) because they may not
             // be deterministic.
-            if (ShouldIgnoreThread(threadId)) {
+            if (!ShouldCheckThread(threadId, threadName)) {
                 continue;
             }
             // Ignore events after method tracing was stopped. The code that is executed
diff --git a/test/2246-trace-stream/src/StreamTraceParser.java b/test/2246-trace-stream/src/StreamTraceParser.java
index c723d3c..3cad4e9 100644
--- a/test/2246-trace-stream/src/StreamTraceParser.java
+++ b/test/2246-trace-stream/src/StreamTraceParser.java
@@ -19,39 +19,44 @@
 
 public class StreamTraceParser extends BaseTraceParser {
 
-    public void CheckTraceFileFormat(File file, int expectedVersion) throws Exception {
+    public void CheckTraceFileFormat(File file,
+        int expectedVersion, String threadName) throws Exception {
         InitializeParser(file);
 
         validateTraceHeader(expectedVersion);
         boolean hasEntries = true;
         boolean seenStopTracingMethod = false;
         while (hasEntries) {
-            int headerType = GetEntryHeader();
-            switch (headerType) {
+            int threadId = GetThreadID();
+            if (threadId != 0) {
+              String eventString = ProcessEventEntry(threadId);
+              if (!ShouldCheckThread(threadId, threadName)) {
+                continue;
+              }
+              // Ignore events after method tracing was stopped. The code that is executed
+              // later could be non-deterministic.
+              if (!seenStopTracingMethod) {
+                UpdateThreadEvents(threadId, eventString);
+              }
+              if (eventString.contains("Main$VMDebug $noinline$stopMethodTracing")) {
+                seenStopTracingMethod = true;
+              }
+            } else {
+              int headerType = GetEntryHeader();
+              switch (headerType) {
                 case 1:
-                    ProcessMethodInfoEntry();
-                    break;
+                  ProcessMethodInfoEntry();
+                  break;
                 case 2:
-                    ProcessThreadInfoEntry();
-                    break;
+                  ProcessThreadInfoEntry();
+                  break;
                 case 3:
-                    // TODO(mythria): Add test to also check format of trace summary.
-                    hasEntries = false;
-                    break;
+                  // TODO(mythria): Add test to also check format of trace summary.
+                  hasEntries = false;
+                  break;
                 default:
-                    int threadId = headerType;
-                    String eventString = ProcessEventEntry(threadId);
-                    if (ShouldIgnoreThread(threadId)) {
-                        break;
-                    }
-                    // Ignore events after method tracing was stopped. The code that is executed
-                    // later could be non-deterministic.
-                    if (!seenStopTracingMethod) {
-                        UpdateThreadEvents(threadId, eventString);
-                    }
-                    if (eventString.contains("Main$VMDebug $noinline$stopMethodTracing")) {
-                        seenStopTracingMethod = true;
-                    }
+                  System.out.println("Unexpected header in the trace " + headerType);
+              }
             }
         }
         closeFile();
diff --git a/test/2246-trace-v2/Android.bp b/test/2246-trace-v2/Android.bp
new file mode 100644
index 0000000..6655926
--- /dev/null
+++ b/test/2246-trace-v2/Android.bp
@@ -0,0 +1,40 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `2246-trace-v2`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-2246-trace-v2",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-no-test-suite-tag-template",
+    srcs: ["src/**/*.java"],
+    data: [
+        ":art-run-test-2246-trace-v2-expected-stdout",
+        ":art-run-test-2246-trace-v2-expected-stderr",
+    ],
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-2246-trace-v2-expected-stdout",
+    out: ["art-run-test-2246-trace-v2-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-2246-trace-v2-expected-stderr",
+    out: ["art-run-test-2246-trace-v2-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/test/2246-trace-v2/dump_trace.cc b/test/2246-trace-v2/dump_trace.cc
new file mode 100644
index 0000000..6a09492
--- /dev/null
+++ b/test/2246-trace-v2/dump_trace.cc
@@ -0,0 +1,233 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+
+#include <map>
+#include <memory>
+
+#include "base/leb128.h"
+#include "base/os.h"
+#include "base/unix_file/fd_file.h"
+#include "jni.h"
+
+namespace art {
+namespace {
+
+static const int kMagicValue = 0x574f4c53;
+static const int kVersionDualClock = 0xf5;
+static const int kThreadInfo = 0;
+static const int kMethodInfo = 1;
+static const int kTraceEntries = 2;
+static const int kTraceActionBits = 2;
+static const int kSummary = 3;
+
+int ReadNumber(int num_bytes, uint8_t* header) {
+  int number = 0;
+  for (int i = 0; i < num_bytes; i++) {
+    number += header[i] << (i * 8);
+  }
+  return number;
+}
+
+bool ProcessThreadOrMethodInfo(std::unique_ptr<File>& file, std::map<int, std::string>& name_map) {
+  uint8_t header[6];
+  if (!file->ReadFully(&header, sizeof(header))) {
+    printf("Couldn't read header\n");
+    return false;
+  }
+  int id = ReadNumber(4, header);
+  int length = ReadNumber(2, header + 4);
+
+  char* name = new char[length];
+  if (!file->ReadFully(name, length)) {
+    delete[] name;
+    return false;
+  }
+  std::string str(name, length);
+  std::replace(str.begin(), str.end(), '\t', ' ');
+  name_map.emplace(id, str);
+  delete[] name;
+  return true;
+}
+
+void print_trace_entry(const std::string& thread_name,
+                       const std::string& method_name,
+                       int* current_depth,
+                       int event_type) {
+  std::string entry;
+  for (int i = 0; i < *current_depth; i++) {
+    entry.push_back('.');
+  }
+  if (event_type == 0) {
+    *current_depth += 1;
+    entry.append(".>> ");
+  } else if (event_type == 1) {
+    *current_depth -= 1;
+    entry.append("<< ");
+  } else if (event_type == 2) {
+    *current_depth -= 1;
+    entry.append("<<E ");
+  } else {
+    entry.append("?? ");
+  }
+  entry.append(thread_name);
+  entry.append(" ");
+  entry.append(method_name);
+  printf("%s", entry.c_str());
+}
+
+bool ProcessTraceEntries(std::unique_ptr<File>& file,
+                         std::map<int, int>& current_depth_map,
+                         std::map<int, std::string>& thread_map,
+                         std::map<int, std::string>& method_map,
+                         bool is_dual_clock,
+                         const char* thread_name_filter) {
+  uint8_t header[20];
+  int header_size = is_dual_clock ? 20 : 16;
+  if (!file->ReadFully(header, header_size)) {
+    return false;
+  }
+
+  uint32_t thread_id = ReadNumber(4, header);
+  uint32_t method_value = ReadNumber(4, header + 4);
+  int offset = 8;
+  if (is_dual_clock) {
+    // Read timestamp.
+    ReadNumber(4, header + offset);
+    offset += 4;
+  }
+  // Read timestamp.
+  ReadNumber(4, header + offset);
+  offset += 4;
+  int num_records = ReadNumber(2, header + offset);
+  offset += 2;
+  int total_size = ReadNumber(2, header + offset);
+  uint8_t* buffer = new uint8_t[total_size];
+  if (!file->ReadFully(buffer, total_size)) {
+    delete[] buffer;
+    return false;
+  }
+
+  const uint8_t* current_buffer_ptr = buffer;
+  int32_t method_id = method_value >> kTraceActionBits;
+  uint8_t event_type = method_value & 0x3;
+  int current_depth = 0;
+  if (current_depth_map.find(thread_id) != current_depth_map.end()) {
+    // Get the current call stack depth. If it is the first method we are seeing on this thread
+    // then this map wouldn't haven an entry we start with the depth of 0.
+    current_depth = current_depth_map[thread_id];
+  }
+  std::string thread_name = thread_map[thread_id];
+  bool print_thread_events = (thread_name.compare(thread_name_filter) == 0);
+  if (method_map.find(method_id) == method_map.end()) {
+    LOG(FATAL) << "No entry for init method " << method_id;
+  }
+  if (print_thread_events) {
+    print_trace_entry(thread_name, method_map[method_id], &current_depth, event_type);
+  }
+  for (int i = 0; i < num_records; i++) {
+    int32_t diff = 0;
+    bool success = DecodeSignedLeb128Checked(&current_buffer_ptr, buffer + total_size - 1, &diff);
+    if (!success) {
+      LOG(FATAL) << "Reading past the buffer???";
+    }
+    int32_t curr_method_value = method_value + diff;
+    method_id = curr_method_value >> kTraceActionBits;
+    event_type = curr_method_value & 0x3;
+    if (print_thread_events) {
+      print_trace_entry(thread_name, method_map[method_id], &current_depth, event_type);
+    }
+    // Read timestamps
+    DecodeUnsignedLeb128(&current_buffer_ptr);
+    if (is_dual_clock) {
+      DecodeUnsignedLeb128(&current_buffer_ptr);
+    }
+  }
+  current_depth_map[thread_id] = current_depth;
+  return true;
+}
+
+extern "C" JNIEXPORT void JNICALL Java_Main_dumpTrace(JNIEnv* env,
+                                                      jclass,
+                                                      jstring fileName,
+                                                      jstring threadName) {
+  const char* file_name = env->GetStringUTFChars(fileName, nullptr);
+  const char* thread_name = env->GetStringUTFChars(threadName, nullptr);
+  std::map<int, std::string> thread_map;
+  std::map<int, std::string> method_map;
+  std::map<int, int> current_depth_map;
+
+  std::unique_ptr<File> file(OS::OpenFileForReading(file_name));
+  if (file == nullptr) {
+    printf("Couldn't open file\n");
+    return;
+  }
+
+  uint8_t header[32];
+  const bool success = file->ReadFully(&header, sizeof(header));
+  if (!success) {
+    printf("Couldn't read header\n");
+    return;
+  }
+  int magic_value = ReadNumber(4, header);
+  if (magic_value != kMagicValue) {
+    printf("Incorrect magic value\n");
+    return;
+  }
+  int version = ReadNumber(2, header + 4);
+  if (success) {
+    printf("version=%0x\n", version);
+  }
+
+  bool is_dual_clock = (version == kVersionDualClock);
+  bool has_entries = true;
+  while (has_entries) {
+    uint8_t entry_header;
+    if (!file->ReadFully(&entry_header, sizeof(entry_header))) {
+      break;
+    }
+    switch (entry_header) {
+      case kThreadInfo:
+        if (!ProcessThreadOrMethodInfo(file, thread_map)) {
+          has_entries = false;
+        }
+        break;
+      case kMethodInfo:
+        if (!ProcessThreadOrMethodInfo(file, method_map)) {
+          has_entries = false;
+        }
+        break;
+      case kTraceEntries:
+        ProcessTraceEntries(
+            file, current_depth_map, thread_map, method_map, is_dual_clock, thread_name);
+        break;
+      case kSummary:
+        has_entries = false;
+        break;
+      default:
+        printf("Invalid Header %d\n", entry_header);
+        has_entries = false;
+        break;
+    }
+  }
+
+  env->ReleaseStringUTFChars(fileName, file_name);
+  env->ReleaseStringUTFChars(threadName, thread_name);
+}
+
+}  // namespace
+}  // namespace art
diff --git a/test/015-switch/expected-stderr.txt b/test/2246-trace-v2/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2246-trace-v2/expected-stderr.txt
diff --git a/test/2246-trace-v2/expected-stdout.txt b/test/2246-trace-v2/expected-stdout.txt
new file mode 100644
index 0000000..53430a6
--- /dev/null
+++ b/test/2246-trace-v2/expected-stdout.txt
@@ -0,0 +1,773 @@
+JNI_OnLoad called
+***** streaming test - dual clock *******
+version=f5
+.>> TestThread2246 java.lang.Thread run ()V Thread.java
+..>> TestThread2246 Main$$ExternalSyntheticLambda0 run ()V D8$$SyntheticClass
+...>> TestThread2246 Main lambda$testTracing$0 (IZLMain;)V Main.java
+....>> TestThread2246 Main$VMDebug startMethodTracingV2 (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+.....>> TestThread2246 java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+......>> TestThread2246 dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+.......>> TestThread2246 dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+.......<< TestThread2246 dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+......<< TestThread2246 dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+.....<< TestThread2246 java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+....<< TestThread2246 Main$VMDebug startMethodTracingV2 (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+....>> TestThread2246 Main <init> ()V Main.java
+.....>> TestThread2246 java.lang.Object <init> ()V Object.java
+.....<< TestThread2246 java.lang.Object <init> ()V Object.java
+....<< TestThread2246 Main <init> ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWork ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWork ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main$VMDebug $noinline$stopMethodTracing ()V Main.java
+.....>> TestThread2246 java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+......>> TestThread2246 dalvik.system.VMDebug stopMethodTracing ()V VMDebug.java
+version=f5
+.>> main Main main ([Ljava/lang/String;)V Main.java
+..>> main Main testTracing (ZII)V Main.java
+...>> main Main$VMDebug startMethodTracingV2 (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+....>> main java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+.....>> main dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+......>> main dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+......<< main dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+.....<< main dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+....<< main java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+...<< main Main$VMDebug startMethodTracingV2 (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+...>> main Main $noinline$doSomeWork ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWork ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main doSomeWorkThrow ()V Main.java
+....>> main Main callThrowFunction ()V Main.java
+.....>> main java.lang.Exception <init> (Ljava/lang/String;)V Exception.java
+......>> main java.lang.Throwable <init> (Ljava/lang/String;)V Throwable.java
+.......>> main java.lang.Object <init> ()V Object.java
+.......<< main java.lang.Object <init> ()V Object.java
+.......>> main java.util.Collections emptyList ()Ljava/util/List; Collections.java
+.......<< main java.util.Collections emptyList ()Ljava/util/List; Collections.java
+.......>> main java.lang.Throwable fillInStackTrace ()Ljava/lang/Throwable; Throwable.java
+........>> main java.lang.Throwable nativeFillInStackTrace ()Ljava/lang/Object; Throwable.java
+........<< main java.lang.Throwable nativeFillInStackTrace ()Ljava/lang/Object; Throwable.java
+.......<< main java.lang.Throwable fillInStackTrace ()Ljava/lang/Throwable; Throwable.java
+......<< main java.lang.Throwable <init> (Ljava/lang/String;)V Throwable.java
+.....<< main java.lang.Exception <init> (Ljava/lang/String;)V Exception.java
+....<<E main Main callThrowFunction ()V Main.java
+...<< main Main doSomeWorkThrow ()V Main.java
+...>> main Main$VMDebug $noinline$stopMethodTracing ()V Main.java
+....>> main java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+.....>> main dalvik.system.VMDebug stopMethodTracing ()V VMDebug.java
+***** streaming test - wall clock *******
+version=f4
+.>> TestThread2246 java.lang.Thread run ()V Thread.java
+..>> TestThread2246 Main$$ExternalSyntheticLambda0 run ()V D8$$SyntheticClass
+...>> TestThread2246 Main lambda$testTracing$0 (IZLMain;)V Main.java
+....>> TestThread2246 Main$VMDebug startMethodTracingV2 (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+.....>> TestThread2246 java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+......>> TestThread2246 dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+.......>> TestThread2246 dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+.......<< TestThread2246 dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+......<< TestThread2246 dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+.....<< TestThread2246 java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+....<< TestThread2246 Main$VMDebug startMethodTracingV2 (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+....>> TestThread2246 Main <init> ()V Main.java
+.....>> TestThread2246 java.lang.Object <init> ()V Object.java
+.....<< TestThread2246 java.lang.Object <init> ()V Object.java
+....<< TestThread2246 Main <init> ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWork ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWork ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+.....>> TestThread2246 Main callOuterFunction ()V Main.java
+......>> TestThread2246 Main callLeafFunction ()V Main.java
+......<< TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callOuterFunction ()V Main.java
+.....>> TestThread2246 Main callLeafFunction ()V Main.java
+.....<< TestThread2246 Main callLeafFunction ()V Main.java
+....<< TestThread2246 Main $noinline$doSomeWorkJIT ()V Main.java
+....>> TestThread2246 Main$VMDebug $noinline$stopMethodTracing ()V Main.java
+.....>> TestThread2246 java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+......>> TestThread2246 dalvik.system.VMDebug stopMethodTracing ()V VMDebug.java
+version=f4
+.>> main Main main ([Ljava/lang/String;)V Main.java
+..>> main Main testTracing (ZII)V Main.java
+...>> main Main$VMDebug startMethodTracingV2 (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+....>> main java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+.....>> main dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+......>> main dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+......<< main dalvik.system.VMDebug startMethodTracingFd (Ljava/lang/String;IIIZIZ)V VMDebug.java
+.....<< main dalvik.system.VMDebug startMethodTracing (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V VMDebug.java
+....<< main java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+...<< main Main$VMDebug startMethodTracingV2 (Ljava/lang/String;Ljava/io/FileDescriptor;IIZIZ)V Main.java
+...>> main Main $noinline$doSomeWork ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWork ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main $noinline$doSomeWorkJIT ()V Main.java
+....>> main Main callOuterFunction ()V Main.java
+.....>> main Main callLeafFunction ()V Main.java
+.....<< main Main callLeafFunction ()V Main.java
+....<< main Main callOuterFunction ()V Main.java
+....>> main Main callLeafFunction ()V Main.java
+....<< main Main callLeafFunction ()V Main.java
+...<< main Main $noinline$doSomeWorkJIT ()V Main.java
+...>> main Main doSomeWorkThrow ()V Main.java
+....>> main Main callThrowFunction ()V Main.java
+.....>> main java.lang.Exception <init> (Ljava/lang/String;)V Exception.java
+......>> main java.lang.Throwable <init> (Ljava/lang/String;)V Throwable.java
+.......>> main java.lang.Object <init> ()V Object.java
+.......<< main java.lang.Object <init> ()V Object.java
+.......>> main java.util.Collections emptyList ()Ljava/util/List; Collections.java
+.......<< main java.util.Collections emptyList ()Ljava/util/List; Collections.java
+.......>> main java.lang.Throwable fillInStackTrace ()Ljava/lang/Throwable; Throwable.java
+........>> main java.lang.Throwable nativeFillInStackTrace ()Ljava/lang/Object; Throwable.java
+........<< main java.lang.Throwable nativeFillInStackTrace ()Ljava/lang/Object; Throwable.java
+.......<< main java.lang.Throwable fillInStackTrace ()Ljava/lang/Throwable; Throwable.java
+......<< main java.lang.Throwable <init> (Ljava/lang/String;)V Throwable.java
+.....<< main java.lang.Exception <init> (Ljava/lang/String;)V Exception.java
+....<<E main Main callThrowFunction ()V Main.java
+...<< main Main doSomeWorkThrow ()V Main.java
+...>> main Main$VMDebug $noinline$stopMethodTracing ()V Main.java
+....>> main java.lang.reflect.Method invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; Method.java
+.....>> main dalvik.system.VMDebug stopMethodTracing ()V VMDebug.java
diff --git a/test/2246-trace-v2/info.txt b/test/2246-trace-v2/info.txt
new file mode 100644
index 0000000..fa93a97
--- /dev/null
+++ b/test/2246-trace-v2/info.txt
@@ -0,0 +1,2 @@
+Tests streaming method tracing. It verifies the format of the generated file is
+as expected.
diff --git a/test/2246-trace-v2/run.py b/test/2246-trace-v2/run.py
new file mode 100644
index 0000000..4c0d858
--- /dev/null
+++ b/test/2246-trace-v2/run.py
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# Copyright (C) 2024 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def run(ctx, args):
+  # The expected output on non debuggable configurations isn't consistent.
+  # TODO(mythria): Investigate why the output is different and update the test to work for
+  # non debuggable runtimes too.
+  ctx.default_run(args,  Xcompiler_option=["--debuggable"])
diff --git a/test/2246-trace-v2/src/Main.java b/test/2246-trace-v2/src/Main.java
new file mode 100644
index 0000000..b5ccb9d
--- /dev/null
+++ b/test/2246-trace-v2/src/Main.java
@@ -0,0 +1,178 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.File;
+import java.io.FileDescriptor;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.lang.reflect.Method;
+
+public class Main {
+    private static final String TEMP_FILE_NAME_PREFIX = "test";
+    private static final String TEMP_FILE_NAME_SUFFIX = ".trace";
+    private static final int WALL_CLOCK_FLAG = 0x010;
+    private static final int TRACE_OUTPUT_V2_FLAG = 0b010;
+    private static final int STREAMING_DUAL_CLOCK_VERSION = 1;
+    private static final int STREAMING_WALL_CLOCK_VERSION = 1;
+    private static File file;
+
+    public static void main(String[] args) throws Exception {
+        System.loadLibrary(args[0]);
+        String name = System.getProperty("java.vm.name");
+        if (!"Dalvik".equals(name)) {
+            System.out.println("This test is not supported on " + name);
+            return;
+        }
+
+        ensureJitCompiled(Main.class, "$noinline$doSomeWorkJIT");
+
+        System.out.println("***** streaming test - dual clock *******");
+        testTracing(
+                /* streaming=*/true, /* flags= */ 0, STREAMING_DUAL_CLOCK_VERSION);
+
+        System.out.println("***** streaming test - wall clock *******");
+        testTracing(
+                /* streaming=*/true, /* flags= */ WALL_CLOCK_FLAG, STREAMING_WALL_CLOCK_VERSION);
+    }
+
+    public static void testTracing(boolean streaming, int flags, int expected_version)
+            throws Exception {
+        Main m = new Main();
+        Thread t = new Thread(() -> {
+            try {
+                file = createTempFile();
+                FileOutputStream out_file = new FileOutputStream(file);
+                VMDebug.startMethodTracingV2(
+                        file.getPath(), out_file.getFD(), 0, flags, false, 0, streaming);
+                Main m1 = new Main();
+                m1.$noinline$doSomeWork();
+                // Call JITed code multiple times to flush out any issues with timestamps.
+                for (int i = 0; i < 20; i++) {
+                    m.$noinline$doSomeWorkJIT();
+                }
+                VMDebug.$noinline$stopMethodTracing();
+                out_file.close();
+                dumpTrace(file.getAbsolutePath(), "TestThread2246");
+                file.delete();
+            } catch (Exception e) {
+                System.out.println("Exception in thread " + e);
+                e.printStackTrace();
+            } finally {
+                file.delete();
+            }
+        }, "TestThread2246");
+        try {
+            if (VMDebug.getMethodTracingMode() != 0) {
+                VMDebug.$noinline$stopMethodTracing();
+            }
+
+            t.start();
+            t.join();
+
+            file = createTempFile();
+            FileOutputStream main_out_file = new FileOutputStream(file);
+            VMDebug.startMethodTracingV2(
+                    file.getPath(), main_out_file.getFD(), 0, flags, false, 0, streaming);
+            m.$noinline$doSomeWork();
+            // Call JITed code multiple times to flush out any issues with timestamps.
+            for (int i = 0; i < 20; i++) {
+                m.$noinline$doSomeWorkJIT();
+            }
+            m.doSomeWorkThrow();
+            VMDebug.$noinline$stopMethodTracing();
+            main_out_file.close();
+            dumpTrace(file.getAbsolutePath(), "main");
+            file.delete();
+        } finally {
+            file.delete();
+        }
+    }
+
+    private static File createTempFile() throws Exception {
+        try {
+            return File.createTempFile(TEMP_FILE_NAME_PREFIX, TEMP_FILE_NAME_SUFFIX);
+        } catch (IOException e) {
+            System.setProperty("java.io.tmpdir", "/data/local/tmp");
+            try {
+                return File.createTempFile(TEMP_FILE_NAME_PREFIX, TEMP_FILE_NAME_SUFFIX);
+            } catch (IOException e2) {
+                System.setProperty("java.io.tmpdir", "/sdcard");
+                return File.createTempFile(TEMP_FILE_NAME_PREFIX, TEMP_FILE_NAME_SUFFIX);
+            }
+        }
+    }
+
+    public void callOuterFunction() {
+        callLeafFunction();
+    }
+
+    public void callLeafFunction() {}
+
+    public void $noinline$doSomeWork() {
+        callOuterFunction();
+        callLeafFunction();
+    }
+
+    public void $noinline$doSomeWorkJIT() {
+        callOuterFunction();
+        callLeafFunction();
+    }
+
+    public void callThrowFunction() throws Exception {
+        throw new Exception("test");
+    }
+
+    public void doSomeWorkThrow() {
+        try {
+            callThrowFunction();
+        } catch (Exception e) {
+        }
+    }
+
+    private static class VMDebug {
+        private static final Method startMethodTracingMethod;
+        private static final Method stopMethodTracingMethod;
+        private static final Method getMethodTracingModeMethod;
+        static {
+            try {
+                Class<?> c = Class.forName("dalvik.system.VMDebug");
+                startMethodTracingMethod = c.getDeclaredMethod("startMethodTracing", String.class,
+                        FileDescriptor.class, Integer.TYPE, Integer.TYPE, Boolean.TYPE,
+                        Integer.TYPE, Boolean.TYPE);
+                stopMethodTracingMethod = c.getDeclaredMethod("stopMethodTracing");
+                getMethodTracingModeMethod = c.getDeclaredMethod("getMethodTracingMode");
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+        }
+
+        public static void startMethodTracingV2(String filename, FileDescriptor fd, int bufferSize,
+                int flags, boolean samplingEnabled, int intervalUs, boolean streaming)
+                throws Exception {
+            startMethodTracingMethod.invoke(null, filename, fd, bufferSize,
+                    flags | TRACE_OUTPUT_V2_FLAG, samplingEnabled, intervalUs, streaming);
+        }
+        public static void $noinline$stopMethodTracing() throws Exception {
+            stopMethodTracingMethod.invoke(null);
+        }
+        public static int getMethodTracingMode() throws Exception {
+            return (int) getMethodTracingModeMethod.invoke(null);
+        }
+    }
+
+    private static native void ensureJitCompiled(Class<?> cls, String methodName);
+    private static native void dumpTrace(String fileName, String threadName);
+}
diff --git a/test/2247-checker-write-barrier-elimination/Android.bp b/test/2247-checker-write-barrier-elimination/Android.bp
index 5848cb4..c9744e9 100644
--- a/test/2247-checker-write-barrier-elimination/Android.bp
+++ b/test/2247-checker-write-barrier-elimination/Android.bp
@@ -15,7 +15,7 @@
 java_test {
     name: "art-run-test-2247-checker-write-barrier-elimination",
     defaults: ["art-run-test-defaults"],
-    test_config_template: ":art-run-test-target-no-test-suite-tag-template",
+    test_config_template: ":art-run-test-target-template",
     srcs: ["src/**/*.java"],
     data: [
         ":art-run-test-2247-checker-write-barrier-elimination-expected-stdout",
diff --git a/test/2247-checker-write-barrier-elimination/src/Main.java b/test/2247-checker-write-barrier-elimination/src/Main.java
index 76fb05a..edf5bc2 100644
--- a/test/2247-checker-write-barrier-elimination/src/Main.java
+++ b/test/2247-checker-write-barrier-elimination/src/Main.java
@@ -50,18 +50,15 @@
         // instructions that can throw.
         $noinline$testInstanceFieldSetsBlocked(
                 new Main(), new Object(), new Object(), new Object());
-        $noinline$testStaticFieldSetsBlocked(new Object(), new Object(), new Object());
-        $noinline$testArraySetsSameRTIBlocked();
+        $noinline$testStaticFieldSetsBlocked(new Main(), new Object(), new Object(), new Object());
+        $noinline$testArraySetsSameRTIBlocked(new Main());
     }
 
     /// CHECK-START: Main Main.$noinline$testInstanceFieldSets(Main, java.lang.Object, java.lang.Object, java.lang.Object) disassembly (after)
-    /// CHECK: InstanceFieldSet field_name:Main.inner field_type:Reference write_barrier_kind:EmitNoNullCheck
+    /// CHECK: InstanceFieldSet field_name:Main.inner field_type:Reference write_barrier_kind:EmitBeingReliedOn
+    /// CHECK: ; card_table
     /// CHECK: InstanceFieldSet field_name:Main.inner2 field_type:Reference write_barrier_kind:DontEmit
     /// CHECK: InstanceFieldSet field_name:Main.inner3 field_type:Reference write_barrier_kind:DontEmit
-
-    /// CHECK-START: Main Main.$noinline$testInstanceFieldSets(Main, java.lang.Object, java.lang.Object, java.lang.Object) disassembly (after)
-    /// CHECK: ; card_table
-    /// CHECK-NOT: ; card_table
     private static Main $noinline$testInstanceFieldSets(Main m, Object o, Object o2, Object o3) {
         m.inner = o;
         m.inner2 = o2;
@@ -70,13 +67,10 @@
     }
 
     /// CHECK-START: void Main.$noinline$testStaticFieldSets(java.lang.Object, java.lang.Object, java.lang.Object) disassembly (after)
-    /// CHECK: StaticFieldSet field_name:Main.inner_static field_type:Reference write_barrier_kind:EmitNoNullCheck
+    /// CHECK: StaticFieldSet field_name:Main.inner_static field_type:Reference write_barrier_kind:EmitBeingReliedOn
+    /// CHECK: ; card_table
     /// CHECK: StaticFieldSet field_name:Main.inner_static2 field_type:Reference write_barrier_kind:DontEmit
     /// CHECK: StaticFieldSet field_name:Main.inner_static3 field_type:Reference write_barrier_kind:DontEmit
-
-    /// CHECK-START: void Main.$noinline$testStaticFieldSets(java.lang.Object, java.lang.Object, java.lang.Object) disassembly (after)
-    /// CHECK: ; card_table
-    /// CHECK-NOT: ; card_table
     private static void $noinline$testStaticFieldSets(Object o, Object o2, Object o3) {
         inner_static = o;
         inner_static2 = o2;
@@ -84,15 +78,12 @@
     }
 
     /// CHECK-START: java.lang.Object[] Main.$noinline$testArraySets(java.lang.Object[], java.lang.Object, java.lang.Object, java.lang.Object) disassembly (after)
-    /// CHECK: ArraySet needs_type_check:true can_trigger_gc:true write_barrier_kind:EmitNoNullCheck
-    /// CHECK: ArraySet needs_type_check:true can_trigger_gc:true write_barrier_kind:EmitNoNullCheck
-    /// CHECK: ArraySet needs_type_check:true can_trigger_gc:true write_barrier_kind:EmitNoNullCheck
-
-    /// CHECK-START: java.lang.Object[] Main.$noinline$testArraySets(java.lang.Object[], java.lang.Object, java.lang.Object, java.lang.Object) disassembly (after)
+    /// CHECK: ArraySet needs_type_check:true can_trigger_gc:true write_barrier_kind:EmitNotBeingReliedOn
     /// CHECK: ; card_table
+    /// CHECK: ArraySet needs_type_check:true can_trigger_gc:true write_barrier_kind:EmitNotBeingReliedOn
     /// CHECK: ; card_table
+    /// CHECK: ArraySet needs_type_check:true can_trigger_gc:true write_barrier_kind:EmitNotBeingReliedOn
     /// CHECK: ; card_table
-    /// CHECK-NOT: ; card_table
     private static java.lang.Object[] $noinline$testArraySets(
             Object[] arr, Object o, Object o2, Object o3) {
         arr[0] = o;
@@ -102,13 +93,10 @@
     }
 
     /// CHECK-START: java.lang.Object[] Main.$noinline$testSwapArray(java.lang.Object[]) disassembly (after)
-    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitNoNullCheck
-    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
-    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
-
-    /// CHECK-START: java.lang.Object[] Main.$noinline$testSwapArray(java.lang.Object[]) disassembly (after)
+    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitBeingReliedOn
     /// CHECK: ; card_table
-    /// CHECK-NOT: ; card_table
+    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
+    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
     private static java.lang.Object[] $noinline$testSwapArray(Object[] arr) {
         arr[0] = arr[1];
         arr[1] = arr[2];
@@ -117,13 +105,10 @@
     }
 
     /// CHECK-START: java.lang.Object[] Main.$noinline$testArraySetsSameRTI() disassembly (after)
-    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitNoNullCheck
-    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
-    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
-
-    /// CHECK-START: java.lang.Object[] Main.$noinline$testArraySetsSameRTI() disassembly (after)
+    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitBeingReliedOn
     /// CHECK: ; card_table
-    /// CHECK-NOT: ; card_table
+    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
+    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
     private static java.lang.Object[] $noinline$testArraySetsSameRTI() {
         Object[] arr = new Object[3];
         arr[0] = inner_static;
@@ -134,12 +119,9 @@
 
     /// CHECK-START: Main Main.$noinline$testNullInstanceFieldSets(Main, java.lang.Object) disassembly (after)
     /// CHECK: InstanceFieldSet field_name:Main.inner field_type:Reference write_barrier_kind:DontEmit
-    /// CHECK: InstanceFieldSet field_name:Main.inner2 field_type:Reference write_barrier_kind:EmitWithNullCheck
-    /// CHECK: InstanceFieldSet field_name:Main.inner3 field_type:Reference write_barrier_kind:DontEmit
-
-    /// CHECK-START: Main Main.$noinline$testNullInstanceFieldSets(Main, java.lang.Object) disassembly (after)
+    /// CHECK: InstanceFieldSet field_name:Main.inner2 field_type:Reference write_barrier_kind:EmitNotBeingReliedOn
     /// CHECK: ; card_table
-    /// CHECK-NOT: ; card_table
+    /// CHECK: InstanceFieldSet field_name:Main.inner3 field_type:Reference write_barrier_kind:DontEmit
     private static Main $noinline$testNullInstanceFieldSets(Main m, Object o) {
         m.inner = null;
         m.inner2 = o;
@@ -149,12 +131,9 @@
 
     /// CHECK-START: void Main.$noinline$testNullStaticFieldSets(java.lang.Object) disassembly (after)
     /// CHECK: StaticFieldSet field_name:Main.inner_static field_type:Reference write_barrier_kind:DontEmit
-    /// CHECK: StaticFieldSet field_name:Main.inner_static2 field_type:Reference write_barrier_kind:EmitWithNullCheck
-    /// CHECK: StaticFieldSet field_name:Main.inner_static3 field_type:Reference write_barrier_kind:DontEmit
-
-    /// CHECK-START: void Main.$noinline$testNullStaticFieldSets(java.lang.Object) disassembly (after)
+    /// CHECK: StaticFieldSet field_name:Main.inner_static2 field_type:Reference write_barrier_kind:EmitNotBeingReliedOn
     /// CHECK: ; card_table
-    /// CHECK-NOT: ; card_table
+    /// CHECK: StaticFieldSet field_name:Main.inner_static3 field_type:Reference write_barrier_kind:DontEmit
     private static void $noinline$testNullStaticFieldSets(Object o) {
         inner_static = null;
         inner_static2 = o;
@@ -163,12 +142,9 @@
 
     /// CHECK-START: java.lang.Object[] Main.$noinline$testNullArraySets(java.lang.Object[], java.lang.Object) disassembly (after)
     /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
-    /// CHECK: ArraySet needs_type_check:true can_trigger_gc:true write_barrier_kind:EmitNoNullCheck
-    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
-
-    /// CHECK-START: java.lang.Object[] Main.$noinline$testNullArraySets(java.lang.Object[], java.lang.Object) disassembly (after)
+    /// CHECK: ArraySet needs_type_check:true can_trigger_gc:true write_barrier_kind:EmitNotBeingReliedOn
     /// CHECK: ; card_table
-    /// CHECK-NOT: ; card_table
+    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
     private static Object[] $noinline$testNullArraySets(Object[] arr, Object o) {
         arr[0] = null;
         arr[1] = o;
@@ -177,18 +153,11 @@
     }
 
     /// CHECK-START: Main Main.$noinline$testInstanceFieldSetsMultipleReceivers(Main, java.lang.Object, java.lang.Object, java.lang.Object) disassembly (after)
-    // There are two extra card_tables for the initialization of the MultipleObject.
-    /// CHECK: InstanceFieldSet field_name:MultipleObject.inner field_type:Reference write_barrier_kind:EmitNoNullCheck
-    /// CHECK: InstanceFieldSet field_name:MultipleObject.inner field_type:Reference write_barrier_kind:EmitWithNullCheck
+    /// CHECK: InstanceFieldSet field_name:MultipleObject.inner field_type:Reference write_barrier_kind:EmitBeingReliedOn
+    /// CHECK: ; card_table
+    /// CHECK: InstanceFieldSet field_name:MultipleObject.inner field_type:Reference write_barrier_kind:EmitNotBeingReliedOn
+    /// CHECK: ; card_table
     /// CHECK: InstanceFieldSet field_name:MultipleObject.inner2 field_type:Reference write_barrier_kind:DontEmit
-
-    // Each one of the two NewInstance instructions have their own `card_table` reference.
-    /// CHECK-START: Main Main.$noinline$testInstanceFieldSetsMultipleReceivers(Main, java.lang.Object, java.lang.Object, java.lang.Object) disassembly (after)
-    /// CHECK: ; card_table
-    /// CHECK: ; card_table
-    /// CHECK: ; card_table
-    /// CHECK: ; card_table
-    /// CHECK-NOT: ; card_table
     private static Main $noinline$testInstanceFieldSetsMultipleReceivers(
             Main m, Object o, Object o2, Object o3) throws Error {
         m.mo = new MultipleObject();
@@ -204,14 +173,11 @@
     }
 
     /// CHECK-START: void Main.$noinline$testStaticFieldSetsMultipleReceivers(java.lang.Object, java.lang.Object, java.lang.Object) disassembly (after)
-    /// CHECK: StaticFieldSet field_name:MultipleObject.inner_static field_type:Reference write_barrier_kind:EmitWithNullCheck
-    /// CHECK: StaticFieldSet field_name:Main.inner_static2 field_type:Reference write_barrier_kind:EmitNoNullCheck
+    /// CHECK: StaticFieldSet field_name:MultipleObject.inner_static field_type:Reference write_barrier_kind:EmitNotBeingReliedOn
+    /// CHECK: ; card_table
+    /// CHECK: StaticFieldSet field_name:Main.inner_static2 field_type:Reference write_barrier_kind:EmitBeingReliedOn
+    /// CHECK: ; card_table
     /// CHECK: StaticFieldSet field_name:Main.inner_static3 field_type:Reference write_barrier_kind:DontEmit
-
-    /// CHECK-START: void Main.$noinline$testStaticFieldSetsMultipleReceivers(java.lang.Object, java.lang.Object, java.lang.Object) disassembly (after)
-    /// CHECK: ; card_table
-    /// CHECK: ; card_table
-    /// CHECK-NOT: ; card_table
     private static void $noinline$testStaticFieldSetsMultipleReceivers(
             Object o, Object o2, Object o3) {
         MultipleObject.inner_static = o;
@@ -221,20 +187,15 @@
 
     /// CHECK-START: java.lang.Object[][] Main.$noinline$testArraySetsMultipleReceiversSameRTI() disassembly (after)
     // Initializing the values
-    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitNoNullCheck
-    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitNoNullCheck
+    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitBeingReliedOn
+    /// CHECK: ; card_table
+    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitNotBeingReliedOn
+    /// CHECK: ; card_table
     /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
     // Setting the `array_of_arrays`.
-    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitNoNullCheck
+    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitBeingReliedOn
+    /// CHECK: ; card_table
     /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
-
-    /// CHECK-START: java.lang.Object[][] Main.$noinline$testArraySetsMultipleReceiversSameRTI() disassembly (after)
-    // Two array sets can't eliminate the write barrier
-    /// CHECK: ; card_table
-    /// CHECK: ; card_table
-    // One write barrier for the array of arrays' sets
-    /// CHECK: ; card_table
-    /// CHECK-NOT: ; card_table
     private static java.lang.Object[][] $noinline$testArraySetsMultipleReceiversSameRTI() {
         Object[] arr = new Object[3];
         Object[] other_arr = new Object[3];
@@ -251,17 +212,14 @@
     private static void $noinline$emptyMethod() {}
 
     /// CHECK-START: Main Main.$noinline$testInstanceFieldSetsBlocked(Main, java.lang.Object, java.lang.Object, java.lang.Object) disassembly (after)
-    /// CHECK: InstanceFieldSet field_name:Main.inner field_type:Reference write_barrier_kind:EmitWithNullCheck
+    /// CHECK: InstanceFieldSet field_name:Main.inner field_type:Reference write_barrier_kind:EmitNotBeingReliedOn
+    /// CHECK: ; card_table
     /// CHECK: InvokeStaticOrDirect method_name:Main.$noinline$emptyMethod
-    /// CHECK: InstanceFieldSet field_name:Main.inner2 field_type:Reference write_barrier_kind:EmitWithNullCheck
+    /// CHECK: InstanceFieldSet field_name:Main.inner2 field_type:Reference write_barrier_kind:EmitNotBeingReliedOn
+    /// CHECK: ; card_table
     /// CHECK: MonitorOperation kind:enter
-    /// CHECK: InstanceFieldSet field_name:Main.inner3 field_type:Reference write_barrier_kind:EmitWithNullCheck
-
-    /// CHECK-START: Main Main.$noinline$testInstanceFieldSetsBlocked(Main, java.lang.Object, java.lang.Object, java.lang.Object) disassembly (after)
+    /// CHECK: InstanceFieldSet field_name:Main.inner3 field_type:Reference write_barrier_kind:EmitNotBeingReliedOn
     /// CHECK: ; card_table
-    /// CHECK: ; card_table
-    /// CHECK: ; card_table
-    /// CHECK-NOT: ; card_table
     private static Main $noinline$testInstanceFieldSetsBlocked(
             Main m, Object o, Object o2, Object o3) {
         m.inner = o;
@@ -273,46 +231,39 @@
         return m;
     }
 
-    /// CHECK-START: void Main.$noinline$testStaticFieldSetsBlocked(java.lang.Object, java.lang.Object, java.lang.Object) disassembly (after)
-    /// CHECK: StaticFieldSet field_name:Main.inner_static field_type:Reference write_barrier_kind:EmitWithNullCheck
+    /// CHECK-START: void Main.$noinline$testStaticFieldSetsBlocked(Main, java.lang.Object, java.lang.Object, java.lang.Object) disassembly (after)
+    /// CHECK: StaticFieldSet field_name:Main.inner_static field_type:Reference write_barrier_kind:EmitNotBeingReliedOn
+    /// CHECK: ; card_table
     /// CHECK: InvokeStaticOrDirect method_name:Main.$noinline$emptyMethod
-    /// CHECK: StaticFieldSet field_name:Main.inner_static2 field_type:Reference write_barrier_kind:EmitWithNullCheck
+    /// CHECK: StaticFieldSet field_name:Main.inner_static2 field_type:Reference write_barrier_kind:EmitNotBeingReliedOn
+    /// CHECK: ; card_table
     /// CHECK: MonitorOperation kind:enter
-    /// CHECK: StaticFieldSet field_name:Main.inner_static3 field_type:Reference write_barrier_kind:EmitWithNullCheck
-
-    /// CHECK-START: void Main.$noinline$testStaticFieldSetsBlocked(java.lang.Object, java.lang.Object, java.lang.Object) disassembly (after)
+    /// CHECK: StaticFieldSet field_name:Main.inner_static3 field_type:Reference write_barrier_kind:EmitNotBeingReliedOn
     /// CHECK: ; card_table
-    /// CHECK: ; card_table
-    /// CHECK: ; card_table
-    /// CHECK-NOT: ; card_table
-    private static void $noinline$testStaticFieldSetsBlocked(Object o, Object o2, Object o3) {
+    private static void $noinline$testStaticFieldSetsBlocked(
+            Main m, Object o, Object o2, Object o3) {
         inner_static = o;
         $noinline$emptyMethod();
         inner_static2 = o2;
-        Main m = new Main();
         synchronized (m) {
             inner_static3 = o3;
         }
     }
 
-    /// CHECK-START: java.lang.Object[] Main.$noinline$testArraySetsSameRTIBlocked() disassembly (after)
-    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitNoNullCheck
+    /// CHECK-START: java.lang.Object[] Main.$noinline$testArraySetsSameRTIBlocked(Main) disassembly (after)
+    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitNotBeingReliedOn
+    /// CHECK: ; card_table
     /// CHECK: InvokeStaticOrDirect method_name:Main.$noinline$emptyMethod
-    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitNoNullCheck
+    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitNotBeingReliedOn
+    /// CHECK: ; card_table
     /// CHECK: MonitorOperation kind:enter
-    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitNoNullCheck
-
-    /// CHECK-START: java.lang.Object[] Main.$noinline$testArraySetsSameRTIBlocked() disassembly (after)
+    /// CHECK: ArraySet needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitNotBeingReliedOn
     /// CHECK: ; card_table
-    /// CHECK: ; card_table
-    /// CHECK: ; card_table
-    /// CHECK-NOT: ; card_table
-    private static java.lang.Object[] $noinline$testArraySetsSameRTIBlocked() {
+    private static java.lang.Object[] $noinline$testArraySetsSameRTIBlocked(Main m) {
         Object[] arr = new Object[3];
         arr[0] = inner_static;
         $noinline$emptyMethod();
         arr[1] = inner_static2;
-        Main m = new Main();
         synchronized (m) {
             arr[2] = inner_static3;
         }
diff --git a/test/2260-checker-inline-unimplemented-intrinsics/src/Main.java b/test/2260-checker-inline-unimplemented-intrinsics/src/Main.java
index 3f125ca..5a00c03 100644
--- a/test/2260-checker-inline-unimplemented-intrinsics/src/Main.java
+++ b/test/2260-checker-inline-unimplemented-intrinsics/src/Main.java
@@ -14,79 +14,37 @@
  * limitations under the License.
  */
 
-import java.lang.reflect.Field;
-
-import sun.misc.Unsafe;
-
 public class Main {
-    private static final Unsafe unsafe = getUnsafe();
-    public int i = 0;
-    public long l = 0;
-
     public static void main(String[] args) {
-        $noinline$testGetAndAdd();
+        $noinline$testDivideUnsignedLong();
     }
 
-    private static void $noinline$testGetAndAdd() {
-        final Main m = new Main();
-        final long intOffset, longOffset;
-        try {
-            Field intField = Main.class.getDeclaredField("i");
-            Field longField = Main.class.getDeclaredField("l");
+    private static void $noinline$testDivideUnsignedLong() {
+        assertEquals(0x1234567800000000L, $noinline$divideUnsignedLong(0x1234567800000000L, 0x1L));
+        assertEquals(0x1234567887654321L, $noinline$divideUnsignedLong(0x1234567887654321L, 0x1L));
+        assertEquals(-0x1234567800000000L,
+                     $noinline$divideUnsignedLong(-0x1234567800000000L, 0x1L));
+        assertEquals(-0x1234567887654321L,
+                     $noinline$divideUnsignedLong(-0x1234567887654321L, 0x1L));
 
-            intOffset = unsafe.objectFieldOffset(intField);
-            longOffset = unsafe.objectFieldOffset(longField);
-
-        } catch (NoSuchFieldException e) {
-            throw new Error("No offset: " + e);
-        }
-
-        $noinline$add(m, intOffset, 11);
-        assertEquals(11, m.i);
-        $noinline$add(m, intOffset, 13);
-        assertEquals(24, m.i);
-
-        $noinline$add(m, longOffset, 11L);
-        assertEquals(11L, m.l);
-        $noinline$add(m, longOffset, 13L);
-        assertEquals(24L, m.l);
+        assertEquals(0x12345678L, $noinline$divideUnsignedLong(0x1234567800000000L, 0x100000000L));
+        assertEquals(0x12345678L, $noinline$divideUnsignedLong(0x1234567887654321L, 0x100000000L));
+        assertEquals(0x100000000L - 0x12345678L,
+                     $noinline$divideUnsignedLong(-0x1234567800000000L, 0x100000000L));
+        assertEquals(0x100000000L-0x12345678L - 1L,
+                     $noinline$divideUnsignedLong(-0x1234567887654321L, 0x100000000L));
     }
 
-    // UnsafeGetAndAddInt/Long are part of core-oj and we will not inline on host.
+    // LongDivideUnsigned is part of core-oj and we will not inline on host.
+    // And it is actually implemented on arm64.
 
-    /// CHECK-START-{ARM,ARM64}: int Main.$noinline$add(java.lang.Object, long, int) inliner (before)
-    /// CHECK:     InvokeVirtual intrinsic:UnsafeGetAndAddInt
+    /// CHECK-START: long Main.$noinline$divideUnsignedLong(long, long) inliner (before)
+    /// CHECK:     InvokeStaticOrDirect intrinsic:LongDivideUnsigned
 
-    /// CHECK-START-{ARM,ARM64}: int Main.$noinline$add(java.lang.Object, long, int) inliner (after)
-    /// CHECK-NOT: InvokeVirtual intrinsic:UnsafeGetAndAddInt
-    private static int $noinline$add(Object o, long offset, int delta) {
-        return unsafe.getAndAddInt(o, offset, delta);
-    }
-
-    /// CHECK-START-{ARM,ARM64}: long Main.$noinline$add(java.lang.Object, long, long) inliner (before)
-    /// CHECK:     InvokeVirtual intrinsic:UnsafeGetAndAddLong
-
-    /// CHECK-START-{ARM,ARM64}: long Main.$noinline$add(java.lang.Object, long, long) inliner (after)
-    /// CHECK-NOT: InvokeVirtual intrinsic:UnsafeGetAndAddLong
-    private static long $noinline$add(Object o, long offset, long delta) {
-        return unsafe.getAndAddLong(o, offset, delta);
-    }
-
-    private static Unsafe getUnsafe() {
-        try {
-            Class<?> unsafeClass = Unsafe.class;
-            Field f = unsafeClass.getDeclaredField("theUnsafe");
-            f.setAccessible(true);
-            return (Unsafe) f.get(null);
-        } catch (Exception e) {
-            throw new Error("Cannot get Unsafe instance");
-        }
-    }
-
-    private static void assertEquals(int expected, int result) {
-        if (expected != result) {
-            throw new Error("Expected: " + expected + ", found: " + result);
-        }
+    /// CHECK-START-ARM: long Main.$noinline$divideUnsignedLong(long, long) inliner (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongDivideUnsigned
+    private static long $noinline$divideUnsignedLong(long dividend, long divisor) {
+        return Long.divideUnsigned(dividend, divisor);
     }
 
     private static void assertEquals(long expected, long result) {
diff --git a/test/2262-checker-return-sinking/Android.bp b/test/2262-checker-return-sinking/Android.bp
new file mode 100644
index 0000000..1eaadd6
--- /dev/null
+++ b/test/2262-checker-return-sinking/Android.bp
@@ -0,0 +1,43 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `2262-checker-return-sinking`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-2262-checker-return-sinking",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-template",
+    srcs: ["src/**/*.java"],
+    data: [
+        ":art-run-test-2262-checker-return-sinking-expected-stdout",
+        ":art-run-test-2262-checker-return-sinking-expected-stderr",
+    ],
+    // Include the Java source files in the test's artifacts, to make Checker assertions
+    // available to the TradeFed test runner.
+    include_srcs: true,
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-2262-checker-return-sinking-expected-stdout",
+    out: ["art-run-test-2262-checker-return-sinking-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-2262-checker-return-sinking-expected-stderr",
+    out: ["art-run-test-2262-checker-return-sinking-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/test/2262-default-conflict-methods/Android.bp b/test/2262-default-conflict-methods/Android.bp
index 8fb2f39..8649a3f 100644
--- a/test/2262-default-conflict-methods/Android.bp
+++ b/test/2262-default-conflict-methods/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-no-test-suite-tag-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-2262-default-conflict-methods-src"
+        "art-run-test-2262-default-conflict-methods-src",
     ],
     data: [
         ":art-run-test-2262-default-conflict-methods-expected-stdout",
diff --git a/test/2262-miranda-methods/Android.bp b/test/2262-miranda-methods/Android.bp
index 0c00467..b2a797e 100644
--- a/test/2262-miranda-methods/Android.bp
+++ b/test/2262-miranda-methods/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-no-test-suite-tag-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-2262-miranda-methods-src"
+        "art-run-test-2262-miranda-methods-src",
     ],
     data: [
         ":art-run-test-2262-miranda-methods-expected-stdout",
diff --git a/test/2262-miranda-methods/jni_invoke.cc b/test/2262-miranda-methods/jni_invoke.cc
index da55f8b..8bef787 100644
--- a/test/2262-miranda-methods/jni_invoke.cc
+++ b/test/2262-miranda-methods/jni_invoke.cc
@@ -22,7 +22,7 @@
 namespace art {
 
 extern "C" JNIEXPORT void JNICALL
-Java_Main_CallNonvirtual(JNIEnv* env, jclass k ATTRIBUTE_UNUSED, jobject o, jclass c, jmethodID m) {
+Java_Main_CallNonvirtual(JNIEnv* env, [[maybe_unused]] jclass k, jobject o, jclass c, jmethodID m) {
   env->CallNonvirtualVoidMethod(o, c, m);
 }
 
diff --git a/test/2263-method-trace-jit/Android.bp b/test/2263-method-trace-jit/Android.bp
index 798d6da..06cabeb 100644
--- a/test/2263-method-trace-jit/Android.bp
+++ b/test/2263-method-trace-jit/Android.bp
@@ -27,7 +27,7 @@
 genrule {
     name: "art-run-test-2263-method-trace-jit-expected-stdout",
     out: ["art-run-test-2263-method-trace-jit-expected-stdout.txt"],
-    srcs: ["expected-stdout.txt"],
+    srcs: [":art-run-test-988-method-trace-expected-stdout"],
     cmd: "cp -f $(in) $(out)",
 }
 
@@ -35,6 +35,6 @@
 genrule {
     name: "art-run-test-2263-method-trace-jit-expected-stderr",
     out: ["art-run-test-2263-method-trace-jit-expected-stderr.txt"],
-    srcs: ["expected-stderr.txt"],
+    srcs: [":art-run-test-988-method-trace-expected-stderr"],
     cmd: "cp -f $(in) $(out)",
 }
diff --git a/test/2264-throwing-systemcleaner/Android.bp b/test/2264-throwing-systemcleaner/Android.bp
new file mode 100644
index 0000000..2041052
--- /dev/null
+++ b/test/2264-throwing-systemcleaner/Android.bp
@@ -0,0 +1,40 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `2264-throwing-systemcleaner`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-2264-throwing-systemcleaner",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-no-test-suite-tag-template",
+    srcs: ["src-art/**/*.java"],
+    data: [
+        ":art-run-test-2264-throwing-systemcleaner-expected-stdout",
+        ":art-run-test-2264-throwing-systemcleaner-expected-stderr",
+    ],
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-2264-throwing-systemcleaner-expected-stdout",
+    out: ["art-run-test-2264-throwing-systemcleaner-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-2264-throwing-systemcleaner-expected-stderr",
+    out: ["art-run-test-2264-throwing-systemcleaner-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/test/015-switch/expected-stderr.txt b/test/2264-throwing-systemcleaner/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2264-throwing-systemcleaner/expected-stderr.txt
diff --git a/test/2264-throwing-systemcleaner/expected-stdout.txt b/test/2264-throwing-systemcleaner/expected-stdout.txt
new file mode 100644
index 0000000..2fb4d2b
--- /dev/null
+++ b/test/2264-throwing-systemcleaner/expected-stdout.txt
@@ -0,0 +1,6 @@
+About to null reference.
+Cleaner started and sleeping briefly...
+Good: Survived first exception
+About to null reference.
+Cleaner started and sleeping briefly...
+Handling uncaught exception
diff --git a/test/2264-throwing-systemcleaner/info.txt b/test/2264-throwing-systemcleaner/info.txt
new file mode 100644
index 0000000..e01623f
--- /dev/null
+++ b/test/2264-throwing-systemcleaner/info.txt
@@ -0,0 +1,2 @@
+Throw an uncaught unchecked exception from a SystemCleaner Runnable. Check that
+this crashes the process, and is not ignored.
diff --git a/test/2264-throwing-systemcleaner/run.py b/test/2264-throwing-systemcleaner/run.py
new file mode 100644
index 0000000..3151272
--- /dev/null
+++ b/test/2264-throwing-systemcleaner/run.py
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Copyright 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def run(ctx, args):
+  ctx.default_run(args, android_log_tags="*:f", expected_exit_code=2)
diff --git a/test/2264-throwing-systemcleaner/src-art/Main.java b/test/2264-throwing-systemcleaner/src-art/Main.java
new file mode 100644
index 0000000..6594683
--- /dev/null
+++ b/test/2264-throwing-systemcleaner/src-art/Main.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import android.system.SystemCleaner;
+import dalvik.system.VMRuntime;
+import java.lang.ref.Cleaner;
+import java.util.concurrent.CountDownLatch;
+
+import static java.util.concurrent.TimeUnit.MINUTES;
+
+/**
+ * Test SystemCleaner with a bad cleaning action.
+ *
+ * This test is inherently very slightly flaky. It assumes that the system will schedule the
+ * finalizer daemon and finalizer watchdog daemon soon and often enough to reach the timeout and
+ * throw the fatal exception before we time out. Since we build in a 20 second buffer, failures
+ * should be very rare.
+ */
+public class Main {
+    static volatile Thread throwingThread;
+    public static void main(String[] args) throws Exception {
+        Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
+            @Override
+            public void uncaughtException(Thread t, Throwable e) {
+                if (t != throwingThread) {
+                  System.out.println("Exception from wrong thread");
+                }
+                if (!(e instanceof AssertionError)) {
+                  System.out.println("Unexpected uncaught exception");
+                }
+                System.out.println("Handling uncaught exception");
+                System.exit(2);
+            }
+        });
+
+        CountDownLatch cleanerWait1 = new CountDownLatch(1);
+        registerBadCleaner(Cleaner.create(), cleanerWait1);
+        gcRepeatedly();
+
+        // Now wait for the finalizer to start running. Give it a minute.
+        cleanerWait1.await(1, MINUTES);
+
+        // Give the cleaner Runnable a chance to finish running. That should do nothing,
+        // since exceptions from standard Cleaners are ignored.
+        snooze(10000);
+
+        System.out.println("Good: Survived first exception");
+        // Now repeat with SystemCleaner.
+        CountDownLatch cleanerWait2 = new CountDownLatch(1);
+        registerBadCleaner(SystemCleaner.cleaner(), cleanerWait2);
+        gcRepeatedly();
+        cleanerWait2.await(1, MINUTES);
+
+        // Now fall asleep. The timeout is large enough that we expect the
+        // FinalizerDaemon to have been killed by the exception.
+        // The timeout is also large enough to cover the extra 5 seconds we wait
+        // to dump on termination, plus potentially substantial gcstress overhead.
+        // Note: the timeout is here (instead of an infinite sleep) to protect the test
+        //       environment (e.g., in case this is run without a timeout wrapper).
+        snooze(20_000);
+
+        // We should not get here.
+        System.out.println("Bad: Unexpectedly survived second exception");
+        System.exit(0);
+    }
+
+    private static void gcRepeatedly() {
+        // Should have at least two iterations to trigger finalization, but just to make sure run
+        // some more.
+        for (int i = 0; i < 5; i++) {
+            Runtime.getRuntime().gc();
+        }
+    }
+
+    private static void registerBadCleaner(Cleaner cleaner, CountDownLatch cleanerWait) {
+        Object obj = new Object();
+        cleaner.register(obj, () -> throwingCleanup(cleanerWait));
+        System.out.println("About to null reference.");
+        obj = null;  // Not that this would make a difference, could be eliminated earlier.
+    }
+
+    public static void snooze(int ms) {
+        try {
+            Thread.sleep(ms);
+        } catch (InterruptedException ie) {
+            System.out.println("Unexpected interrupt");
+        }
+    }
+
+    private static void throwingCleanup(CountDownLatch cleanerWait) {
+        throwingThread = Thread.currentThread();
+        cleanerWait.countDown();
+        System.out.println("Cleaner started and sleeping briefly...");
+        snooze(100);
+        throw new AssertionError("Process-killing exception");
+    }
+}
diff --git a/test/2264-throwing-systemcleaner/test-metadata.json b/test/2264-throwing-systemcleaner/test-metadata.json
new file mode 100644
index 0000000..75f6c02
--- /dev/null
+++ b/test/2264-throwing-systemcleaner/test-metadata.json
@@ -0,0 +1,5 @@
+{
+  "build-param": {
+    "jvm-supported": "false"
+  }
+}
diff --git a/test/2265-checker-select-binary-unary/Android.bp b/test/2265-checker-select-binary-unary/Android.bp
new file mode 100644
index 0000000..5267b1e
--- /dev/null
+++ b/test/2265-checker-select-binary-unary/Android.bp
@@ -0,0 +1,43 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `2265-checker-select-binary-unary`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-2265-checker-select-binary-unary",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-template",
+    srcs: ["src/**/*.java"],
+    data: [
+        ":art-run-test-2265-checker-select-binary-unary-expected-stdout",
+        ":art-run-test-2265-checker-select-binary-unary-expected-stderr",
+    ],
+    // Include the Java source files in the test's artifacts, to make Checker assertions
+    // available to the TradeFed test runner.
+    include_srcs: true,
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-2265-checker-select-binary-unary-expected-stdout",
+    out: ["art-run-test-2265-checker-select-binary-unary-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-2265-checker-select-binary-unary-expected-stderr",
+    out: ["art-run-test-2265-checker-select-binary-unary-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/test/015-switch/expected-stderr.txt b/test/2265-checker-select-binary-unary/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2265-checker-select-binary-unary/expected-stderr.txt
diff --git a/test/015-switch/expected-stderr.txt b/test/2265-checker-select-binary-unary/expected-stdout.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2265-checker-select-binary-unary/expected-stdout.txt
diff --git a/test/2265-checker-select-binary-unary/info.txt b/test/2265-checker-select-binary-unary/info.txt
new file mode 100644
index 0000000..b20b11a
--- /dev/null
+++ b/test/2265-checker-select-binary-unary/info.txt
@@ -0,0 +1,5 @@
+Tests that we can simplify a Select + Binary/UnaryOps if:
+  * Both inputs to the Select instruction are constant, and
+  * The Select instruction is not used in another instruction
+    to avoid duplicating Selects.
+  * In the case of Binary ops, both inputs can't be Select.
diff --git a/test/2265-checker-select-binary-unary/src/Main.java b/test/2265-checker-select-binary-unary/src/Main.java
new file mode 100644
index 0000000..33734fc
--- /dev/null
+++ b/test/2265-checker-select-binary-unary/src/Main.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.lang.reflect.Method;
+
+public class Main {
+    public static void main(String[] args) throws Throwable {
+        assertLongEquals(11L, $noinline$testIntToLong(0, 1));
+        assertLongEquals(12L, $noinline$testIntToLong(1, 0));
+
+        assertFloatEquals(11f, $noinline$testIntToFloat(0, 1));
+        assertFloatEquals(12f, $noinline$testIntToFloat(1, 0));
+
+        assertIntEquals(11, $noinline$testIntToByte(0, 1));
+        assertIntEquals(12, $noinline$testIntToByte(1, 0));
+
+        assertIntEquals(11, $noinline$testLongToInt(0, 1));
+        assertIntEquals(12, $noinline$testLongToInt(1, 0));
+    }
+
+    /// CHECK-START: long Main.$noinline$testIntToLong(int, int) select_generator (after)
+    /// CHECK:     <<Const10:j\d+>> LongConstant 10
+    /// CHECK:     <<Const1:i\d+>>  IntConstant 1
+    /// CHECK:     <<Const2:i\d+>>  IntConstant 2
+    /// CHECK:     <<Sel:i\d+>>     Select [<<Const1>>,<<Const2>>,<<Condition:z\d+>>]
+    /// CHECK:     <<Type:j\d+>>    TypeConversion [<<Sel>>]
+    /// CHECK:                      Add [<<Type>>,<<Const10>>]
+
+    /// CHECK-START: long Main.$noinline$testIntToLong(int, int) constant_folding$after_gvn (after)
+    /// CHECK:     <<Const11:j\d+>> LongConstant 11
+    /// CHECK:     <<Const12:j\d+>> LongConstant 12
+    /// CHECK:                      Select [<<Const11>>,<<Const12>>,<<Condition:z\d+>>]
+
+    /// CHECK-START: long Main.$noinline$testIntToLong(int, int) constant_folding$after_gvn (after)
+    /// CHECK-NOT:                 TypeConversion
+    /// CHECK-NOT:                 Add
+    private static long $noinline$testIntToLong(int a, int b) {
+        long result = 10;
+        int c = 1;
+        int d = 2;
+        return result + (a < b ? c : d);
+    }
+
+    /// CHECK-START: float Main.$noinline$testIntToFloat(int, int) select_generator (after)
+    /// CHECK:     <<Const10:f\d+>> FloatConstant 10
+    /// CHECK:     <<Const1:i\d+>>  IntConstant 1
+    /// CHECK:     <<Const2:i\d+>>  IntConstant 2
+    /// CHECK:     <<Sel:i\d+>>     Select [<<Const1>>,<<Const2>>,<<Condition:z\d+>>]
+    /// CHECK:     <<Type:f\d+>>    TypeConversion [<<Sel>>]
+    /// CHECK:                      Add [<<Type>>,<<Const10>>]
+
+    /// CHECK-START: float Main.$noinline$testIntToFloat(int, int) constant_folding$after_gvn (after)
+    /// CHECK:     <<Const11:f\d+>> FloatConstant 11
+    /// CHECK:     <<Const12:f\d+>> FloatConstant 12
+    /// CHECK:                      Select [<<Const11>>,<<Const12>>,<<Condition:z\d+>>]
+
+    /// CHECK-START: float Main.$noinline$testIntToFloat(int, int) constant_folding$after_gvn (after)
+    /// CHECK-NOT:                 TypeConversion
+    /// CHECK-NOT:                 Add
+    private static float $noinline$testIntToFloat(int a, int b) {
+        float result = 10;
+        int c = 1;
+        int d = 2;
+        return result + (a < b ? c : d);
+    }
+
+    /// CHECK-START: byte Main.$noinline$testIntToByte(int, int) select_generator (after)
+    /// CHECK:     <<Const10:i\d+>>  IntConstant 10
+    /// CHECK:     <<Const257:i\d+>> IntConstant 257
+    /// CHECK:     <<Const258:i\d+>> IntConstant 258
+    /// CHECK:     <<Sel:i\d+>>      Select [<<Const257>>,<<Const258>>,<<Condition:z\d+>>]
+    /// CHECK:     <<Type:b\d+>>     TypeConversion [<<Sel>>]
+    /// CHECK:                       Add [<<Type>>,<<Const10>>]
+
+    /// CHECK-START: byte Main.$noinline$testIntToByte(int, int) constant_folding$after_gvn (after)
+    /// CHECK:     <<Const11:i\d+>>   IntConstant 11
+    /// CHECK:     <<Const12:i\d+>>   IntConstant 12
+    /// CHECK:                        Select [<<Const11>>,<<Const12>>,<<Condition:z\d+>>]
+
+    /// CHECK-START: byte Main.$noinline$testIntToByte(int, int) constant_folding$after_gvn (after)
+    /// CHECK-NOT:                   TypeConversion
+    /// CHECK-NOT:                   Add
+    private static byte $noinline$testIntToByte(int a, int b) {
+        byte result = 10;
+        int c = 257; // equal to 1 in byte
+        int d = 258; // equal to 2 in byte
+        // Due to `+` operating in ints, we need to do an extra cast. We can optimize away both type
+        // conversions.
+        return (byte) (result + (byte) (a < b ? c : d));
+    }
+
+    /// CHECK-START: int Main.$noinline$testLongToInt(int, int) select_generator (after)
+    /// CHECK:     <<Const10:i\d+>> IntConstant 10
+    /// CHECK:     <<Const1:j\d+>>  LongConstant 4294967297
+    /// CHECK:     <<Const2:j\d+>>  LongConstant 4294967298
+    /// CHECK:     <<Sel:j\d+>>     Select [<<Const1>>,<<Const2>>,<<Condition:z\d+>>]
+    /// CHECK:     <<Type:i\d+>>    TypeConversion [<<Sel>>]
+    /// CHECK:                      Add [<<Type>>,<<Const10>>]
+
+    /// CHECK-START: int Main.$noinline$testLongToInt(int, int) constant_folding$after_gvn (after)
+    /// CHECK:     <<Const11:i\d+>> IntConstant 11
+    /// CHECK:     <<Const12:i\d+>> IntConstant 12
+    /// CHECK:                      Select [<<Const11>>,<<Const12>>,<<Condition:z\d+>>]
+
+    /// CHECK-START: int Main.$noinline$testLongToInt(int, int) constant_folding$after_gvn (after)
+    /// CHECK-NOT:                 TypeConversion
+    /// CHECK-NOT:                 Add
+    private static int $noinline$testLongToInt(int a, int b) {
+        int result = 10;
+        long c = (1L << 32) + 1L; // Will be 1, when cast to int
+        long d = (1L << 32) + 2L; // Will be 2, when cast to int
+        return result + (int) (a < b ? c : d);
+    }
+
+    private static void assertIntEquals(int expected, int actual) {
+        if (expected != actual) {
+            throw new AssertionError("Expected " + expected + " got " + actual);
+        }
+    }
+
+    private static void assertLongEquals(long expected, long actual) {
+        if (expected != actual) {
+            throw new AssertionError("Expected " + expected + " got " + actual);
+        }
+    }
+
+    private static void assertFloatEquals(float expected, float actual) {
+        if (expected != actual) {
+            throw new AssertionError("Expected " + expected + " got " + actual);
+        }
+    }
+}
diff --git a/test/2265-const-method-type-cached/build.py b/test/2265-const-method-type-cached/build.py
new file mode 100644
index 0000000..5349524
--- /dev/null
+++ b/test/2265-const-method-type-cached/build.py
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def build(ctx):
+  ctx.bash("./generate-sources")
+  ctx.default_build(api_level="const-method-type")
diff --git a/test/015-switch/expected-stderr.txt b/test/2265-const-method-type-cached/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2265-const-method-type-cached/expected-stderr.txt
diff --git a/test/015-switch/expected-stderr.txt b/test/2265-const-method-type-cached/expected-stdout.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2265-const-method-type-cached/expected-stdout.txt
diff --git a/test/2265-const-method-type-cached/generate-sources b/test/2265-const-method-type-cached/generate-sources
new file mode 100755
index 0000000..85448d47
--- /dev/null
+++ b/test/2265-const-method-type-cached/generate-sources
@@ -0,0 +1,29 @@
+#!/bin/bash
+#
+# Copyright 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# make us exit on a failure
+set -e
+
+export ASM_JAR="${ANDROID_BUILD_TOP}/prebuilts/misc/common/asm/asm-9.2.jar"
+
+# Build the transformer to apply to compiled classes.
+mkdir classes
+${JAVAC:-javac} ${JAVAC_ARGS} -cp "${ASM_JAR}" -d classes $(find src-util -name '*.java')
+${SOONG_ZIP} --jar -o transformer.jar -C classes -D classes
+rm -rf classes
+
+# Add annotation src files to our compiler inputs.
+cp -r src-util/annotations src/
diff --git a/test/2265-const-method-type-cached/info.txt b/test/2265-const-method-type-cached/info.txt
new file mode 100644
index 0000000..ad09993
--- /dev/null
+++ b/test/2265-const-method-type-cached/info.txt
@@ -0,0 +1,3 @@
+const-method-type and MethodType factory methods should use the same intern
+mechanism and return the same object when equal return and parameter types are
+passed.
diff --git a/test/2265-const-method-type-cached/javac_post.sh b/test/2265-const-method-type-cached/javac_post.sh
new file mode 100755
index 0000000..cd62e69
--- /dev/null
+++ b/test/2265-const-method-type-cached/javac_post.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+#
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -e
+
+export ASM_JAR="${ANDROID_BUILD_TOP}/prebuilts/misc/common/asm/asm-9.2.jar"
+
+# Move original classes to intermediate location.
+mv classes intermediate-classes
+mkdir classes
+
+# Transform intermediate classes.
+transformer_args="-cp ${ASM_JAR}:$PWD/transformer.jar transformer.ConstantTransformer"
+for class in intermediate-classes/*.class ; do
+  transformed_class=classes/$(basename ${class})
+  ${JAVA:-java} ${transformer_args} ${class} ${transformed_class}
+done
diff --git a/test/2265-const-method-type-cached/src-util/annotations/ConstantMethodType.java b/test/2265-const-method-type-cached/src-util/annotations/ConstantMethodType.java
new file mode 100644
index 0000000..354cd3e
--- /dev/null
+++ b/test/2265-const-method-type-cached/src-util/annotations/ConstantMethodType.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Methods annotated with this annotation will be replaced with ldc bytecode
+ * with the MethodType described by the annotation.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface ConstantMethodType {
+    Class<?> returnType() default void.class;
+
+    Class<?>[] parameterTypes() default {};
+}
\ No newline at end of file
diff --git a/test/2265-const-method-type-cached/src-util/transformer/ConstantTransformer.java b/test/2265-const-method-type-cached/src-util/transformer/ConstantTransformer.java
new file mode 100644
index 0000000..9eba5fd
--- /dev/null
+++ b/test/2265-const-method-type-cached/src-util/transformer/ConstantTransformer.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package transformer;
+
+import annotations.ConstantMethodType;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.invoke.MethodType;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Handle;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+
+/**
+ * Replaces {@code ConstantMethodType} annotated methods with a load constant bytecode
+ * with a method type in the constant pool.
+ *
+ * Shamelessly copied from test/979-const-method-handle.
+ */
+public class ConstantTransformer {
+
+    static class ConstantBuilder extends ClassVisitor {
+        private final Map<String, ConstantMethodType> constantMethodTypes;
+
+        ConstantBuilder(
+                int api,
+                ClassVisitor cv,
+                Map<String, ConstantMethodType> constantMethodTypes) {
+            super(api, cv);
+            this.constantMethodTypes = constantMethodTypes;
+        }
+
+        @Override
+        public MethodVisitor visitMethod(
+                int access, String name, String desc, String signature, String[] exceptions) {
+            MethodVisitor mv = cv.visitMethod(access, name, desc, signature, exceptions);
+            return new MethodVisitor(this.api, mv) {
+                @Override
+                public void visitMethodInsn(
+                        int opcode, String owner, String name, String desc, boolean itf) {
+                    if (opcode == org.objectweb.asm.Opcodes.INVOKESTATIC) {
+                        ConstantMethodType constantMethodType = constantMethodTypes.get(name);
+                        if (constantMethodType != null) {
+                            insertConstantMethodType(constantMethodType);
+                            return;
+                        }
+                    }
+                    mv.visitMethodInsn(opcode, owner, name, desc, itf);
+                }
+
+                private Type buildMethodType(Class<?> returnType, Class<?>[] parameterTypes) {
+                    Type rType = Type.getType(returnType);
+                    Type[] pTypes = new Type[parameterTypes.length];
+                    for (int i = 0; i < pTypes.length; ++i) {
+                        pTypes[i] = Type.getType(parameterTypes[i]);
+                    }
+                    return Type.getMethodType(rType, pTypes);
+                }
+
+                private void insertConstantMethodType(ConstantMethodType constantMethodType) {
+                    Type methodType =
+                            buildMethodType(
+                                    constantMethodType.returnType(),
+                                    constantMethodType.parameterTypes());
+                    mv.visitLdcInsn(methodType);
+                }
+            };
+        }
+    }
+
+    private static void throwAnnotationError(
+            Method method, Class<?> annotationClass, String reason) {
+        StringBuilder sb = new StringBuilder();
+        sb.append("Error in annotation ")
+                .append(annotationClass)
+                .append(" on method ")
+                .append(method)
+                .append(": ")
+                .append(reason);
+        throw new Error(sb.toString());
+    }
+
+    private static void checkMethodToBeReplaced(
+            Method method, Class<?> annotationClass, Class<?> returnType) {
+        final int PRIVATE_STATIC = Modifier.STATIC | Modifier.PRIVATE;
+        if ((method.getModifiers() & PRIVATE_STATIC) != PRIVATE_STATIC) {
+            throwAnnotationError(method, annotationClass, " method is not private and static");
+        }
+        if (method.getTypeParameters().length != 0) {
+            throwAnnotationError(method, annotationClass, " method expects parameters");
+        }
+        if (!method.getReturnType().equals(returnType)) {
+            throwAnnotationError(method, annotationClass, " wrong return type");
+        }
+    }
+
+    private static void transform(Path inputClassPath, Path outputClassPath) throws Throwable {
+        Path classLoadPath = inputClassPath.toAbsolutePath().getParent();
+        URLClassLoader classLoader =
+                new URLClassLoader(new URL[] {classLoadPath.toUri().toURL()},
+                                   ClassLoader.getSystemClassLoader());
+        String inputClassName = inputClassPath.getFileName().toString().replace(".class", "");
+        Class<?> inputClass = classLoader.loadClass(inputClassName);
+
+        final Map<String, ConstantMethodType> constantMethodTypes = new HashMap<>();
+
+        for (Method m : inputClass.getDeclaredMethods()) {
+            ConstantMethodType constantMethodType = m.getAnnotation(ConstantMethodType.class);
+            if (constantMethodType != null) {
+                checkMethodToBeReplaced(m, ConstantMethodType.class, MethodType.class);
+                constantMethodTypes.put(m.getName(), constantMethodType);
+                continue;
+            }
+        }
+        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
+        try (InputStream is = Files.newInputStream(inputClassPath)) {
+            ClassReader cr = new ClassReader(is);
+            ConstantBuilder cb =
+                    new ConstantBuilder(
+                            Opcodes.ASM7, cw, constantMethodTypes);
+            cr.accept(cb, 0);
+        }
+        try (OutputStream os = Files.newOutputStream(outputClassPath)) {
+            os.write(cw.toByteArray());
+        }
+    }
+
+    public static void main(String[] args) throws Throwable {
+        transform(Paths.get(args[0]), Paths.get(args[1]));
+    }
+}
\ No newline at end of file
diff --git a/test/2265-const-method-type-cached/src/Main.java b/test/2265-const-method-type-cached/src/Main.java
new file mode 100644
index 0000000..b582e99
--- /dev/null
+++ b/test/2265-const-method-type-cached/src/Main.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import annotations.ConstantMethodType;
+
+import java.lang.invoke.MethodType;
+import java.util.Objects;
+
+public class Main {
+    public static void main(String... args) throws Throwable {
+        testEquality();
+        // Subsequent const-method-type call should take value from from .bss.
+        testEquality();
+        testNonEquality();
+        testNonEquality();
+        testWithUninitializableClass();
+    }
+
+    private static void unreachable() {
+        throw new Error("unreachable");
+    }
+
+    @ConstantMethodType(
+        returnType = void.class,
+        parameterTypes = {
+            boolean.class,
+            byte.class,
+            char.class,
+            short.class,
+            int.class,
+            long.class,
+            float.class,
+            double.class,
+            Object.class,
+            int[].class })
+    private static MethodType takesEverythingReturnsVoid() {
+        unreachable();
+        return null;
+    }
+
+    public static void testEquality() throws Throwable {
+        MethodType actual = takesEverythingReturnsVoid();
+
+        MethodType expected = MethodType.methodType(
+            void.class,
+            boolean.class,
+            byte.class,
+            char.class,
+            short.class,
+            int.class,
+            long.class,
+            float.class,
+            double.class,
+            Object.class,
+            int[].class);
+
+        assertSame(expected, actual);
+        assertSame(takesEverythingReturnsVoid(), takesEverythingReturnsVoid());
+    }
+
+    public static void testNonEquality() throws Throwable {
+        MethodType actual = takesEverythingReturnsVoid();
+
+        MethodType expected = MethodType.methodType(
+            boolean.class,
+            boolean.class,
+            byte.class,
+            char.class,
+            short.class,
+            int.class,
+            long.class,
+            float.class,
+            double.class,
+            Object.class,
+            int[].class);
+
+        assertNotEqual(expected, actual);
+    }
+
+    @ConstantMethodType(
+        returnType = void.class,
+        parameterTypes = { UnloadableClass.class })
+    private static MethodType takesUnloadableReturnsVoid() {
+        unreachable();
+        return null;
+    }
+
+    public static volatile int x = 0;
+
+    private static class UnloadableClass {
+        static {
+            if (x == x) {
+                throw new RuntimeException("don't init me");
+            }
+        }
+    }
+
+    public static void testWithUninitializableClass() {
+        MethodType actual = takesUnloadableReturnsVoid();
+
+        MethodType expected = MethodType.methodType(void.class, UnloadableClass.class);
+
+        assertSame(expected, actual);
+    }
+
+    public static void assertNotEqual(Object expected, Object actual) {
+        if (Objects.equals(expected, actual)) {
+            String msg = "Expected to be non equal, but got: " + expected;
+            throw new AssertionError(msg);
+        }
+    }
+
+    public static void assertSame(Object expected, Object actual) {
+        if (actual != expected) {
+            String msg = String.format("Expected: %s(%X), got %s(%X)",
+                                  expected,
+                                  System.identityHashCode(expected),
+                                  actual,
+                                  System.identityHashCode(actual));
+            throw new AssertionError(msg);
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/2266-checker-remove-empty-ifs/Android.bp b/test/2266-checker-remove-empty-ifs/Android.bp
new file mode 100644
index 0000000..197ad30
--- /dev/null
+++ b/test/2266-checker-remove-empty-ifs/Android.bp
@@ -0,0 +1,43 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `2266-checker-remove-empty-ifs`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-2266-checker-remove-empty-ifs",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-template",
+    srcs: ["src/**/*.java"],
+    data: [
+        ":art-run-test-2266-checker-remove-empty-ifs-expected-stdout",
+        ":art-run-test-2266-checker-remove-empty-ifs-expected-stderr",
+    ],
+    // Include the Java source files in the test's artifacts, to make Checker assertions
+    // available to the TradeFed test runner.
+    include_srcs: true,
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-2266-checker-remove-empty-ifs-expected-stdout",
+    out: ["art-run-test-2266-checker-remove-empty-ifs-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-2266-checker-remove-empty-ifs-expected-stderr",
+    out: ["art-run-test-2266-checker-remove-empty-ifs-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/test/015-switch/expected-stderr.txt b/test/2266-checker-remove-empty-ifs/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2266-checker-remove-empty-ifs/expected-stderr.txt
diff --git a/test/015-switch/expected-stderr.txt b/test/2266-checker-remove-empty-ifs/expected-stdout.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2266-checker-remove-empty-ifs/expected-stdout.txt
diff --git a/test/2266-checker-remove-empty-ifs/info.txt b/test/2266-checker-remove-empty-ifs/info.txt
new file mode 100644
index 0000000..2ada78f
--- /dev/null
+++ b/test/2266-checker-remove-empty-ifs/info.txt
@@ -0,0 +1 @@
+Tests that DCE deletes HIfs with empty blocks.
diff --git a/test/2266-checker-remove-empty-ifs/src/Main.java b/test/2266-checker-remove-empty-ifs/src/Main.java
new file mode 100644
index 0000000..975b6b1
--- /dev/null
+++ b/test/2266-checker-remove-empty-ifs/src/Main.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class Main {
+    public static void main(String[] args) {}
+    public static void $inline$empty() {}
+    public static void $inline$empty2() {}
+
+    /// CHECK-START: void Main.andBoolean2(boolean, boolean) dead_code_elimination$after_inlining (before)
+    /// CHECK: If
+    /// CHECK: If
+
+    /// CHECK-START: void Main.andBoolean2(boolean, boolean) dead_code_elimination$after_inlining (after)
+    /// CHECK-NOT: If
+    public static void andBoolean2(boolean a, boolean b) {
+        if (a && b) {
+            $inline$empty();
+        } else {
+            $inline$empty2();
+        }
+    }
+
+    /// CHECK-START: void Main.andBoolean3(boolean, boolean, boolean) dead_code_elimination$after_inlining (before)
+    /// CHECK: If
+    /// CHECK: If
+    /// CHECK: If
+
+    /// CHECK-START: void Main.andBoolean3(boolean, boolean, boolean) dead_code_elimination$after_inlining (after)
+    /// CHECK-NOT: If
+    public static void andBoolean3(boolean a, boolean b, boolean c) {
+        if (a && b && c) {
+            $inline$empty();
+        } else {
+            $inline$empty2();
+        }
+    }
+
+    /// CHECK-START: void Main.andBoolean4(boolean, boolean, boolean, boolean) dead_code_elimination$after_inlining (before)
+    /// CHECK: If
+    /// CHECK: If
+    /// CHECK: If
+    /// CHECK: If
+
+    /// CHECK-START: void Main.andBoolean4(boolean, boolean, boolean, boolean) dead_code_elimination$after_inlining (after)
+    /// CHECK-NOT: If
+    public static void andBoolean4(boolean a, boolean b, boolean c, boolean d) {
+        if (a && b && c && d) {
+            $inline$empty();
+        } else {
+            $inline$empty2();
+        }
+    }
+
+    /// CHECK-START: void Main.orBoolean2(boolean, boolean) dead_code_elimination$after_inlining (before)
+    /// CHECK: If
+    /// CHECK: If
+
+    /// CHECK-START: void Main.orBoolean2(boolean, boolean) dead_code_elimination$after_inlining (after)
+    /// CHECK-NOT: If
+    public static void orBoolean2(boolean a, boolean b) {
+        if (a || b) {
+            $inline$empty();
+        } else {
+            $inline$empty2();
+        }
+    }
+
+    /// CHECK-START: void Main.orBoolean3(boolean, boolean, boolean) dead_code_elimination$after_inlining (before)
+    /// CHECK: If
+    /// CHECK: If
+    /// CHECK: If
+
+    /// CHECK-START: void Main.orBoolean3(boolean, boolean, boolean) dead_code_elimination$after_inlining (after)
+    /// CHECK-NOT: If
+    public static void orBoolean3(boolean a, boolean b, boolean c) {
+        if (a || b || c) {
+            $inline$empty();
+        } else {
+            $inline$empty2();
+        }
+    }
+
+    /// CHECK-START: void Main.orBoolean4(boolean, boolean, boolean, boolean) dead_code_elimination$after_inlining (before)
+    /// CHECK: If
+    /// CHECK: If
+    /// CHECK: If
+    /// CHECK: If
+
+    /// CHECK-START: void Main.orBoolean4(boolean, boolean, boolean, boolean) dead_code_elimination$after_inlining (after)
+    /// CHECK-NOT: If
+    public static void orBoolean4(boolean a, boolean b, boolean c, boolean d) {
+        if (a || b || c || d) {
+            $inline$empty();
+        } else {
+            $inline$empty2();
+        }
+    }
+
+    /// CHECK-START: void Main.andInt(int, int, int, int) dead_code_elimination$after_inlining (before)
+    /// CHECK: If
+    /// CHECK: If
+    /// CHECK: If
+    /// CHECK: If
+    /// CHECK: If
+
+    /// CHECK-START: void Main.andInt(int, int, int, int) dead_code_elimination$after_inlining (after)
+    /// CHECK-NOT: If
+    public static void andInt(int a, int b, int c, int d) {
+        if (a <= b && c <= d && a >= 20 && b <= 78 && c >= 50 && d <= 70) {
+            $inline$empty();
+        } else {
+            $inline$empty2();
+        }
+    }
+
+    class MyObject {
+        boolean inner;
+        boolean inner2;
+    }
+
+    /// CHECK-START: void Main.andObject(Main$MyObject) dead_code_elimination$after_inlining (before)
+    /// CHECK: If
+    /// CHECK: If
+
+    /// CHECK-START: void Main.andObject(Main$MyObject) dead_code_elimination$after_inlining (before)
+    /// CHECK: InstanceFieldGet
+    /// CHECK: InstanceFieldGet
+
+    /// CHECK-START: void Main.andObject(Main$MyObject) dead_code_elimination$after_inlining (after)
+    /// CHECK-NOT: If
+    /// CHECK-NOT: InstanceFieldGet
+    public static void andObject(MyObject o) {
+        if (o != null && o.inner && o.inner2) {
+            $inline$empty();
+        } else {
+            $inline$empty2();
+        }
+    }
+}
diff --git a/test/2267-class-implements-itself/build.py b/test/2267-class-implements-itself/build.py
new file mode 100644
index 0000000..f09bf77
--- /dev/null
+++ b/test/2267-class-implements-itself/build.py
@@ -0,0 +1,18 @@
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def build(ctx):
+  ctx.bash("./generate-sources")
+  ctx.default_build()
diff --git a/test/015-switch/expected-stderr.txt b/test/2267-class-implements-itself/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2267-class-implements-itself/expected-stderr.txt
diff --git a/test/2267-class-implements-itself/expected-stdout.txt b/test/2267-class-implements-itself/expected-stdout.txt
new file mode 100644
index 0000000..b98f963
--- /dev/null
+++ b/test/2267-class-implements-itself/expected-stdout.txt
@@ -0,0 +1,2 @@
+Caught ClassCircularityError
+Done!
diff --git a/test/2267-class-implements-itself/generate-sources b/test/2267-class-implements-itself/generate-sources
new file mode 100755
index 0000000..cb05421
--- /dev/null
+++ b/test/2267-class-implements-itself/generate-sources
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# Copyright 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Avoid D8 merge in the default script since it would reject the class.
+# Use old API level to create DEX file with 035 version. Stricter
+# checking introduced with DEX file version 37 rejects class
+# otherwise (see DexFile::kClassDefinitionOrderEnforcedVersion).
+${SMALI} -JXmx512m assemble --api 13 --output classes.dex `find smali -name '*.smali'`
+${SOONG_ZIP} -o $TEST_NAME.jar -f classes.dex
diff --git a/test/2267-class-implements-itself/info.txt b/test/2267-class-implements-itself/info.txt
new file mode 100644
index 0000000..9903740
--- /dev/null
+++ b/test/2267-class-implements-itself/info.txt
@@ -0,0 +1 @@
+Exercise class linker check for classes implements themselves (b/301108855).
diff --git a/test/2267-class-implements-itself/smali/Main.smali b/test/2267-class-implements-itself/smali/Main.smali
new file mode 100644
index 0000000..0d8bea3
--- /dev/null
+++ b/test/2267-class-implements-itself/smali/Main.smali
@@ -0,0 +1,56 @@
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# We cannot implement Main in Java, as this would require to run
+# dexmerger (to merge the Dex file produced from Smali code and the
+# Dex file produced from Java code), which loops indefinitely when
+# processing class 301108855, as this class implements itself. As
+# a workaround, implement Main using Smali.
+
+.class public LMain;
+.super Ljava/lang/Object;
+
+.method public static main([Ljava/lang/String;)V
+    .registers 3
+    .param p0, "args"
+
+    invoke-static {}, LMain;->test()V
+    sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
+    const-string v1, "Done!"
+    invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
+    return-void
+.end method
+
+.method static test()V
+    .registers 4
+
+    :try_start
+    const-string v2, "301108855"
+    invoke-static {v2}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
+    :try_end
+    .catch Ljava/lang/ClassCircularityError; {:try_start .. :try_end} :catch
+
+    move-result-object v0
+
+    :goto_7
+    return-void
+
+    :catch
+    move-exception v1
+    .local v1, "e":Ljava/lang/ClassCircularityError;
+    sget-object v2, Ljava/lang/System;->out:Ljava/io/PrintStream;
+    const-string v3, "Caught ClassCircularityError"
+    invoke-virtual {v2, v3}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
+    goto :goto_7
+.end method
diff --git a/test/2267-class-implements-itself/smali/b_301108855.smali b/test/2267-class-implements-itself/smali/b_301108855.smali
new file mode 100644
index 0000000..3dce20e
--- /dev/null
+++ b/test/2267-class-implements-itself/smali/b_301108855.smali
@@ -0,0 +1,19 @@
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Regression test for a class inheriting from itself.
+
+.class public L301108855;
+.super Ljava/lang/Object;
+.implements L301108855;
diff --git a/test/2268-checker-remove-dead-phis/Android.bp b/test/2268-checker-remove-dead-phis/Android.bp
new file mode 100644
index 0000000..85d16d1
--- /dev/null
+++ b/test/2268-checker-remove-dead-phis/Android.bp
@@ -0,0 +1,43 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `2268-checker-remove-dead-phis`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-2268-checker-remove-dead-phis",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-template",
+    srcs: ["src/**/*.java"],
+    data: [
+        ":art-run-test-2268-checker-remove-dead-phis-expected-stdout",
+        ":art-run-test-2268-checker-remove-dead-phis-expected-stderr",
+    ],
+    // Include the Java source files in the test's artifacts, to make Checker assertions
+    // available to the TradeFed test runner.
+    include_srcs: true,
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-2268-checker-remove-dead-phis-expected-stdout",
+    out: ["art-run-test-2268-checker-remove-dead-phis-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-2268-checker-remove-dead-phis-expected-stderr",
+    out: ["art-run-test-2268-checker-remove-dead-phis-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/test/015-switch/expected-stderr.txt b/test/2268-checker-remove-dead-phis/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2268-checker-remove-dead-phis/expected-stderr.txt
diff --git a/test/015-switch/expected-stderr.txt b/test/2268-checker-remove-dead-phis/expected-stdout.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2268-checker-remove-dead-phis/expected-stdout.txt
diff --git a/test/2268-checker-remove-dead-phis/info.txt b/test/2268-checker-remove-dead-phis/info.txt
new file mode 100644
index 0000000..1f2080f
--- /dev/null
+++ b/test/2268-checker-remove-dead-phis/info.txt
@@ -0,0 +1 @@
+Tests that DCE deletes dead HPhi instructions.
diff --git a/test/2268-checker-remove-dead-phis/src/Main.java b/test/2268-checker-remove-dead-phis/src/Main.java
new file mode 100644
index 0000000..2adbdd0
--- /dev/null
+++ b/test/2268-checker-remove-dead-phis/src/Main.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class Main {
+    public static void main(String[] args) {}
+
+    /// CHECK-START: int Main.$noinline$doNothing() dead_code_elimination$after_inlining (before)
+    /// CHECK-DAG: Phi
+    /// CHECK-DAG: Add
+    /// CHECK-DAG: Div
+
+    /// CHECK-START: int Main.$noinline$doNothing() dead_code_elimination$after_inlining (after)
+    /// CHECK-NOT: Phi
+    /// CHECK-NOT: Add
+    /// CHECK-NOT: Div
+    private int $noinline$doNothing() {
+        int val1 = b1 ? 1 : 0;
+        int val2 = b2 ? 1 : 0;
+
+        if (condition1) {
+            val1 += 25;
+            val2 += 25;
+        }
+
+        if (condition2) {
+            val1 /= 5;
+            val2 /= 5;
+        }
+
+        if ($inline$returnFalse()) {
+            return val1 + val2;
+        } else {
+            return 0;
+        }
+    }
+
+    private boolean $inline$returnFalse() {
+        return false;
+    }
+
+    boolean b1;
+    boolean b2;
+    boolean condition1;
+    boolean condition2;
+}
diff --git a/test/2269-checker-constant-folding-instrinsics/Android.bp b/test/2269-checker-constant-folding-instrinsics/Android.bp
new file mode 100644
index 0000000..09d7d12
--- /dev/null
+++ b/test/2269-checker-constant-folding-instrinsics/Android.bp
@@ -0,0 +1,43 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `2269-checker-constant-folding-instrinsics`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-2269-checker-constant-folding-instrinsics",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-template",
+    srcs: ["src/**/*.java"],
+    data: [
+        ":art-run-test-2269-checker-constant-folding-instrinsics-expected-stdout",
+        ":art-run-test-2269-checker-constant-folding-instrinsics-expected-stderr",
+    ],
+    // Include the Java source files in the test's artifacts, to make Checker assertions
+    // available to the TradeFed test runner.
+    include_srcs: true,
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-2269-checker-constant-folding-instrinsics-expected-stdout",
+    out: ["art-run-test-2269-checker-constant-folding-instrinsics-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-2269-checker-constant-folding-instrinsics-expected-stderr",
+    out: ["art-run-test-2269-checker-constant-folding-instrinsics-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/test/015-switch/expected-stderr.txt b/test/2269-checker-constant-folding-instrinsics/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2269-checker-constant-folding-instrinsics/expected-stderr.txt
diff --git a/test/015-switch/expected-stderr.txt b/test/2269-checker-constant-folding-instrinsics/expected-stdout.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2269-checker-constant-folding-instrinsics/expected-stdout.txt
diff --git a/test/2269-checker-constant-folding-instrinsics/info.txt b/test/2269-checker-constant-folding-instrinsics/info.txt
new file mode 100644
index 0000000..a767882
--- /dev/null
+++ b/test/2269-checker-constant-folding-instrinsics/info.txt
@@ -0,0 +1 @@
+Tests we properly optimize intrinsics during constant folding
diff --git a/test/2269-checker-constant-folding-instrinsics/src/Main.java b/test/2269-checker-constant-folding-instrinsics/src/Main.java
new file mode 100644
index 0000000..0059db8
--- /dev/null
+++ b/test/2269-checker-constant-folding-instrinsics/src/Main.java
@@ -0,0 +1,1617 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class Main {
+    public static void main(String[] args) {
+        $noinline$testReverseInt();
+        $noinline$testReverseLong();
+        $noinline$testReverseBytesInt();
+        $noinline$testReverseBytesLong();
+        $noinline$testReverseBytesShort();
+        $noinline$testBitCountInt();
+        $noinline$testBitCountLong();
+        $noinline$testDivideUnsignedInt();
+        $noinline$testDivideUnsignedLong();
+        $noinline$testHighestOneBitInt();
+        $noinline$testHighestOneBitLong();
+        $noinline$testLowestOneBitInt();
+        $noinline$testLowestOneBitLong();
+        $noinline$testLeadingZerosInt();
+        $noinline$testLeadingZerosLong();
+        $noinline$testTrailingZerosInt();
+        $noinline$testTrailingZerosLong();
+    }
+
+    /// CHECK-START: void Main.$noinline$testReverseInt() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:IntegerReverse
+
+    /// CHECK-START: void Main.$noinline$testReverseInt() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:IntegerReverse
+    private static void $noinline$testReverseInt() {
+        $noinline$assertIntEquals(-2, Integer.reverse(Integer.MAX_VALUE));
+        $noinline$assertIntEquals(1, Integer.reverse(Integer.MIN_VALUE));
+        $noinline$assertIntEquals(0, Integer.reverse(0));
+        // 0101... to 1010....
+        $noinline$assertIntEquals(0x55555555, Integer.reverse(0xAAAAAAAA));
+        // 1010.... to 0101...
+        $noinline$assertIntEquals(0xAAAAAAAA, Integer.reverse(0x55555555));
+        $noinline$testReverseInt_powerOfTwo();
+    }
+
+    /// CHECK-START: void Main.$noinline$testReverseInt_powerOfTwo() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:IntegerReverse
+
+    /// CHECK-START: void Main.$noinline$testReverseInt_powerOfTwo() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:IntegerReverse
+    private static void $noinline$testReverseInt_powerOfTwo() {
+        $noinline$assertIntEquals(1 << 31, Integer.reverse(1 << 0));
+        $noinline$assertIntEquals(1 << 30, Integer.reverse(1 << 1));
+        $noinline$assertIntEquals(1 << 29, Integer.reverse(1 << 2));
+        $noinline$assertIntEquals(1 << 28, Integer.reverse(1 << 3));
+        $noinline$assertIntEquals(1 << 27, Integer.reverse(1 << 4));
+        $noinline$assertIntEquals(1 << 26, Integer.reverse(1 << 5));
+        $noinline$assertIntEquals(1 << 25, Integer.reverse(1 << 6));
+        $noinline$assertIntEquals(1 << 24, Integer.reverse(1 << 7));
+        $noinline$assertIntEquals(1 << 23, Integer.reverse(1 << 8));
+        $noinline$assertIntEquals(1 << 22, Integer.reverse(1 << 9));
+        $noinline$assertIntEquals(1 << 21, Integer.reverse(1 << 10));
+        $noinline$assertIntEquals(1 << 20, Integer.reverse(1 << 11));
+        $noinline$assertIntEquals(1 << 19, Integer.reverse(1 << 12));
+        $noinline$assertIntEquals(1 << 18, Integer.reverse(1 << 13));
+        $noinline$assertIntEquals(1 << 17, Integer.reverse(1 << 14));
+        $noinline$assertIntEquals(1 << 16, Integer.reverse(1 << 15));
+        $noinline$assertIntEquals(1 << 15, Integer.reverse(1 << 16));
+        $noinline$assertIntEquals(1 << 14, Integer.reverse(1 << 17));
+        $noinline$assertIntEquals(1 << 13, Integer.reverse(1 << 18));
+        $noinline$assertIntEquals(1 << 12, Integer.reverse(1 << 19));
+        $noinline$assertIntEquals(1 << 11, Integer.reverse(1 << 20));
+        $noinline$assertIntEquals(1 << 10, Integer.reverse(1 << 21));
+        $noinline$assertIntEquals(1 << 9, Integer.reverse(1 << 22));
+        $noinline$assertIntEquals(1 << 8, Integer.reverse(1 << 23));
+        $noinline$assertIntEquals(1 << 7, Integer.reverse(1 << 24));
+        $noinline$assertIntEquals(1 << 6, Integer.reverse(1 << 25));
+        $noinline$assertIntEquals(1 << 5, Integer.reverse(1 << 26));
+        $noinline$assertIntEquals(1 << 4, Integer.reverse(1 << 27));
+        $noinline$assertIntEquals(1 << 3, Integer.reverse(1 << 28));
+        $noinline$assertIntEquals(1 << 2, Integer.reverse(1 << 29));
+        $noinline$assertIntEquals(1 << 1, Integer.reverse(1 << 30));
+        $noinline$assertIntEquals(1 << 0, Integer.reverse(1 << 31));
+    }
+
+    /// CHECK-START: void Main.$noinline$testReverseLong() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongReverse
+
+    /// CHECK-START: void Main.$noinline$testReverseLong() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongReverse
+    private static void $noinline$testReverseLong() {
+        $noinline$assertLongEquals(-2L, Long.reverse(Long.MAX_VALUE));
+        $noinline$assertLongEquals(1L, Long.reverse(Long.MIN_VALUE));
+        $noinline$assertLongEquals(0L, Long.reverse(0L));
+        // 0101... to 1010....
+        $noinline$assertLongEquals(0x5555555555555555L, Long.reverse(0xAAAAAAAAAAAAAAAAL));
+        // 1010.... to 0101...
+        $noinline$assertLongEquals(0xAAAAAAAAAAAAAAAAL, Long.reverse(0x5555555555555555L));
+        $noinline$testReverseLongFirst32_powerOfTwo();
+        $noinline$testReverseLongLast32_powerOfTwo();
+    }
+
+    /// CHECK-START: void Main.$noinline$testReverseLongFirst32_powerOfTwo() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongReverse
+
+    /// CHECK-START: void Main.$noinline$testReverseLongFirst32_powerOfTwo() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongReverse
+    private static void $noinline$testReverseLongFirst32_powerOfTwo() {
+        $noinline$assertLongEquals(1L << 63, Long.reverse(1L << 0));
+        $noinline$assertLongEquals(1L << 62, Long.reverse(1L << 1));
+        $noinline$assertLongEquals(1L << 61, Long.reverse(1L << 2));
+        $noinline$assertLongEquals(1L << 60, Long.reverse(1L << 3));
+        $noinline$assertLongEquals(1L << 59, Long.reverse(1L << 4));
+        $noinline$assertLongEquals(1L << 58, Long.reverse(1L << 5));
+        $noinline$assertLongEquals(1L << 57, Long.reverse(1L << 6));
+        $noinline$assertLongEquals(1L << 56, Long.reverse(1L << 7));
+        $noinline$assertLongEquals(1L << 55, Long.reverse(1L << 8));
+        $noinline$assertLongEquals(1L << 54, Long.reverse(1L << 9));
+        $noinline$assertLongEquals(1L << 53, Long.reverse(1L << 10));
+        $noinline$assertLongEquals(1L << 52, Long.reverse(1L << 11));
+        $noinline$assertLongEquals(1L << 51, Long.reverse(1L << 12));
+        $noinline$assertLongEquals(1L << 50, Long.reverse(1L << 13));
+        $noinline$assertLongEquals(1L << 49, Long.reverse(1L << 14));
+        $noinline$assertLongEquals(1L << 48, Long.reverse(1L << 15));
+        $noinline$assertLongEquals(1L << 47, Long.reverse(1L << 16));
+        $noinline$assertLongEquals(1L << 46, Long.reverse(1L << 17));
+        $noinline$assertLongEquals(1L << 45, Long.reverse(1L << 18));
+        $noinline$assertLongEquals(1L << 44, Long.reverse(1L << 19));
+        $noinline$assertLongEquals(1L << 43, Long.reverse(1L << 20));
+        $noinline$assertLongEquals(1L << 42, Long.reverse(1L << 21));
+        $noinline$assertLongEquals(1L << 41, Long.reverse(1L << 22));
+        $noinline$assertLongEquals(1L << 40, Long.reverse(1L << 23));
+        $noinline$assertLongEquals(1L << 39, Long.reverse(1L << 24));
+        $noinline$assertLongEquals(1L << 38, Long.reverse(1L << 25));
+        $noinline$assertLongEquals(1L << 37, Long.reverse(1L << 26));
+        $noinline$assertLongEquals(1L << 36, Long.reverse(1L << 27));
+        $noinline$assertLongEquals(1L << 35, Long.reverse(1L << 28));
+        $noinline$assertLongEquals(1L << 34, Long.reverse(1L << 29));
+        $noinline$assertLongEquals(1L << 33, Long.reverse(1L << 30));
+        $noinline$assertLongEquals(1L << 32, Long.reverse(1L << 31));
+    }
+
+    /// CHECK-START: void Main.$noinline$testReverseLongLast32_powerOfTwo() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongReverse
+
+    /// CHECK-START: void Main.$noinline$testReverseLongLast32_powerOfTwo() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongReverse
+    private static void $noinline$testReverseLongLast32_powerOfTwo() {
+        $noinline$assertLongEquals(1L << 31, Long.reverse(1L << 32));
+        $noinline$assertLongEquals(1L << 30, Long.reverse(1L << 33));
+        $noinline$assertLongEquals(1L << 29, Long.reverse(1L << 34));
+        $noinline$assertLongEquals(1L << 28, Long.reverse(1L << 35));
+        $noinline$assertLongEquals(1L << 27, Long.reverse(1L << 36));
+        $noinline$assertLongEquals(1L << 26, Long.reverse(1L << 37));
+        $noinline$assertLongEquals(1L << 25, Long.reverse(1L << 38));
+        $noinline$assertLongEquals(1L << 24, Long.reverse(1L << 39));
+        $noinline$assertLongEquals(1L << 23, Long.reverse(1L << 40));
+        $noinline$assertLongEquals(1L << 22, Long.reverse(1L << 41));
+        $noinline$assertLongEquals(1L << 21, Long.reverse(1L << 42));
+        $noinline$assertLongEquals(1L << 20, Long.reverse(1L << 43));
+        $noinline$assertLongEquals(1L << 19, Long.reverse(1L << 44));
+        $noinline$assertLongEquals(1L << 18, Long.reverse(1L << 45));
+        $noinline$assertLongEquals(1L << 17, Long.reverse(1L << 46));
+        $noinline$assertLongEquals(1L << 16, Long.reverse(1L << 47));
+        $noinline$assertLongEquals(1L << 15, Long.reverse(1L << 48));
+        $noinline$assertLongEquals(1L << 14, Long.reverse(1L << 49));
+        $noinline$assertLongEquals(1L << 13, Long.reverse(1L << 50));
+        $noinline$assertLongEquals(1L << 12, Long.reverse(1L << 51));
+        $noinline$assertLongEquals(1L << 11, Long.reverse(1L << 52));
+        $noinline$assertLongEquals(1L << 10, Long.reverse(1L << 53));
+        $noinline$assertLongEquals(1L << 9, Long.reverse(1L << 54));
+        $noinline$assertLongEquals(1L << 8, Long.reverse(1L << 55));
+        $noinline$assertLongEquals(1L << 7, Long.reverse(1L << 56));
+        $noinline$assertLongEquals(1L << 6, Long.reverse(1L << 57));
+        $noinline$assertLongEquals(1L << 5, Long.reverse(1L << 58));
+        $noinline$assertLongEquals(1L << 4, Long.reverse(1L << 59));
+        $noinline$assertLongEquals(1L << 3, Long.reverse(1L << 60));
+        $noinline$assertLongEquals(1L << 2, Long.reverse(1L << 61));
+        $noinline$assertLongEquals(1L << 1, Long.reverse(1L << 62));
+        $noinline$assertLongEquals(1L << 0, Long.reverse(1L << 63));
+    }
+
+    /// CHECK-START: void Main.$noinline$testReverseBytesInt() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:IntegerReverseBytes
+
+    /// CHECK-START: void Main.$noinline$testReverseBytesInt() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:IntegerReverseBytes
+    private static void $noinline$testReverseBytesInt() {
+        $noinline$assertIntEquals(-129, Integer.reverseBytes(Integer.MAX_VALUE));
+        $noinline$assertIntEquals(128, Integer.reverseBytes(Integer.MIN_VALUE));
+        $noinline$assertIntEquals(0, Integer.reverseBytes(0));
+        // 0101... to 0101....
+        $noinline$assertIntEquals(0x55555555, Integer.reverseBytes(0x55555555));
+        // 1010.... to 1010...
+        $noinline$assertIntEquals(0xAAAAAAAA, Integer.reverseBytes(0xAAAAAAAA));
+        // Going up/down the hex digits.
+        $noinline$assertIntEquals(0x01234567, Integer.reverseBytes(0x67452301));
+        $noinline$assertIntEquals(0x89ABCDEF, Integer.reverseBytes(0xEFCDAB89));
+        $noinline$assertIntEquals(0xFEDCBA98, Integer.reverseBytes(0x98BADCFE));
+        $noinline$assertIntEquals(0x76543210, Integer.reverseBytes(0x10325476));
+        $noinline$testReverseBytesInt_powerOfTwo();
+    }
+
+    /// CHECK-START: void Main.$noinline$testReverseBytesInt_powerOfTwo() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:IntegerReverseBytes
+
+    /// CHECK-START: void Main.$noinline$testReverseBytesInt_powerOfTwo() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:IntegerReverseBytes
+    private static void $noinline$testReverseBytesInt_powerOfTwo() {
+        $noinline$assertIntEquals(1 << 24, Integer.reverseBytes(1 << 0));
+        $noinline$assertIntEquals(1 << 25, Integer.reverseBytes(1 << 1));
+        $noinline$assertIntEquals(1 << 26, Integer.reverseBytes(1 << 2));
+        $noinline$assertIntEquals(1 << 27, Integer.reverseBytes(1 << 3));
+        $noinline$assertIntEquals(1 << 28, Integer.reverseBytes(1 << 4));
+        $noinline$assertIntEquals(1 << 29, Integer.reverseBytes(1 << 5));
+        $noinline$assertIntEquals(1 << 30, Integer.reverseBytes(1 << 6));
+        $noinline$assertIntEquals(1 << 31, Integer.reverseBytes(1 << 7));
+        $noinline$assertIntEquals(1 << 16, Integer.reverseBytes(1 << 8));
+        $noinline$assertIntEquals(1 << 17, Integer.reverseBytes(1 << 9));
+        $noinline$assertIntEquals(1 << 18, Integer.reverseBytes(1 << 10));
+        $noinline$assertIntEquals(1 << 19, Integer.reverseBytes(1 << 11));
+        $noinline$assertIntEquals(1 << 20, Integer.reverseBytes(1 << 12));
+        $noinline$assertIntEquals(1 << 21, Integer.reverseBytes(1 << 13));
+        $noinline$assertIntEquals(1 << 22, Integer.reverseBytes(1 << 14));
+        $noinline$assertIntEquals(1 << 23, Integer.reverseBytes(1 << 15));
+        $noinline$assertIntEquals(1 << 8, Integer.reverseBytes(1 << 16));
+        $noinline$assertIntEquals(1 << 9, Integer.reverseBytes(1 << 17));
+        $noinline$assertIntEquals(1 << 10, Integer.reverseBytes(1 << 18));
+        $noinline$assertIntEquals(1 << 11, Integer.reverseBytes(1 << 19));
+        $noinline$assertIntEquals(1 << 12, Integer.reverseBytes(1 << 20));
+        $noinline$assertIntEquals(1 << 13, Integer.reverseBytes(1 << 21));
+        $noinline$assertIntEquals(1 << 14, Integer.reverseBytes(1 << 22));
+        $noinline$assertIntEquals(1 << 15, Integer.reverseBytes(1 << 23));
+        $noinline$assertIntEquals(1 << 0, Integer.reverseBytes(1 << 24));
+        $noinline$assertIntEquals(1 << 1, Integer.reverseBytes(1 << 25));
+        $noinline$assertIntEquals(1 << 2, Integer.reverseBytes(1 << 26));
+        $noinline$assertIntEquals(1 << 3, Integer.reverseBytes(1 << 27));
+        $noinline$assertIntEquals(1 << 4, Integer.reverseBytes(1 << 28));
+        $noinline$assertIntEquals(1 << 5, Integer.reverseBytes(1 << 29));
+        $noinline$assertIntEquals(1 << 6, Integer.reverseBytes(1 << 30));
+        $noinline$assertIntEquals(1 << 7, Integer.reverseBytes(1 << 31));
+    }
+
+    /// CHECK-START: void Main.$noinline$testReverseBytesLong() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongReverseBytes
+
+    /// CHECK-START: void Main.$noinline$testReverseBytesLong() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongReverseBytes
+    private static void $noinline$testReverseBytesLong() {
+        $noinline$assertLongEquals(-129L, Long.reverseBytes(Long.MAX_VALUE));
+        $noinline$assertLongEquals(128L, Long.reverseBytes(Long.MIN_VALUE));
+        $noinline$assertLongEquals(0L, Long.reverseBytes(0L));
+        // 0101... to 0101....
+        $noinline$assertLongEquals(0x5555555555555555L, Long.reverseBytes(0x5555555555555555L));
+        // 1010.... to 1010...
+        $noinline$assertLongEquals(0xAAAAAAAAAAAAAAAAL, Long.reverseBytes(0xAAAAAAAAAAAAAAAAL));
+        // Going up/down the hex digits.
+        $noinline$assertLongEquals(0x0123456789ABCDEFL, Long.reverseBytes(0xEFCDAB8967452301L));
+        $noinline$assertLongEquals(0xFEDCBA9876543210L, Long.reverseBytes(0x1032547698BADCFEL));
+        $noinline$testReverseBytesLongFirst32_powerOfTwo();
+        $noinline$testReverseBytesLongLast32_powerOfTwo();
+    }
+
+    /// CHECK-START: void Main.$noinline$testReverseBytesLongFirst32_powerOfTwo() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongReverseBytes
+
+    /// CHECK-START: void Main.$noinline$testReverseBytesLongFirst32_powerOfTwo() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongReverseBytes
+    private static void $noinline$testReverseBytesLongFirst32_powerOfTwo() {
+        $noinline$assertLongEquals(1L << 56, Long.reverseBytes(1L << 0));
+        $noinline$assertLongEquals(1L << 57, Long.reverseBytes(1L << 1));
+        $noinline$assertLongEquals(1L << 58, Long.reverseBytes(1L << 2));
+        $noinline$assertLongEquals(1L << 59, Long.reverseBytes(1L << 3));
+        $noinline$assertLongEquals(1L << 60, Long.reverseBytes(1L << 4));
+        $noinline$assertLongEquals(1L << 61, Long.reverseBytes(1L << 5));
+        $noinline$assertLongEquals(1L << 62, Long.reverseBytes(1L << 6));
+        $noinline$assertLongEquals(1L << 63, Long.reverseBytes(1L << 7));
+        $noinline$assertLongEquals(1L << 48, Long.reverseBytes(1L << 8));
+        $noinline$assertLongEquals(1L << 49, Long.reverseBytes(1L << 9));
+        $noinline$assertLongEquals(1L << 50, Long.reverseBytes(1L << 10));
+        $noinline$assertLongEquals(1L << 51, Long.reverseBytes(1L << 11));
+        $noinline$assertLongEquals(1L << 52, Long.reverseBytes(1L << 12));
+        $noinline$assertLongEquals(1L << 53, Long.reverseBytes(1L << 13));
+        $noinline$assertLongEquals(1L << 54, Long.reverseBytes(1L << 14));
+        $noinline$assertLongEquals(1L << 55, Long.reverseBytes(1L << 15));
+        $noinline$assertLongEquals(1L << 40, Long.reverseBytes(1L << 16));
+        $noinline$assertLongEquals(1L << 41, Long.reverseBytes(1L << 17));
+        $noinline$assertLongEquals(1L << 42, Long.reverseBytes(1L << 18));
+        $noinline$assertLongEquals(1L << 43, Long.reverseBytes(1L << 19));
+        $noinline$assertLongEquals(1L << 44, Long.reverseBytes(1L << 20));
+        $noinline$assertLongEquals(1L << 45, Long.reverseBytes(1L << 21));
+        $noinline$assertLongEquals(1L << 46, Long.reverseBytes(1L << 22));
+        $noinline$assertLongEquals(1L << 47, Long.reverseBytes(1L << 23));
+        $noinline$assertLongEquals(1L << 32, Long.reverseBytes(1L << 24));
+        $noinline$assertLongEquals(1L << 33, Long.reverseBytes(1L << 25));
+        $noinline$assertLongEquals(1L << 34, Long.reverseBytes(1L << 26));
+        $noinline$assertLongEquals(1L << 35, Long.reverseBytes(1L << 27));
+        $noinline$assertLongEquals(1L << 36, Long.reverseBytes(1L << 28));
+        $noinline$assertLongEquals(1L << 37, Long.reverseBytes(1L << 29));
+        $noinline$assertLongEquals(1L << 38, Long.reverseBytes(1L << 30));
+        $noinline$assertLongEquals(1L << 39, Long.reverseBytes(1L << 31));
+    }
+
+    /// CHECK-START: void Main.$noinline$testReverseBytesLongLast32_powerOfTwo() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongReverseBytes
+
+    /// CHECK-START: void Main.$noinline$testReverseBytesLongLast32_powerOfTwo() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongReverseBytes
+    private static void $noinline$testReverseBytesLongLast32_powerOfTwo() {
+        $noinline$assertLongEquals(1L << 24, Long.reverseBytes(1L << 32));
+        $noinline$assertLongEquals(1L << 25, Long.reverseBytes(1L << 33));
+        $noinline$assertLongEquals(1L << 26, Long.reverseBytes(1L << 34));
+        $noinline$assertLongEquals(1L << 27, Long.reverseBytes(1L << 35));
+        $noinline$assertLongEquals(1L << 28, Long.reverseBytes(1L << 36));
+        $noinline$assertLongEquals(1L << 29, Long.reverseBytes(1L << 37));
+        $noinline$assertLongEquals(1L << 30, Long.reverseBytes(1L << 38));
+        $noinline$assertLongEquals(1L << 31, Long.reverseBytes(1L << 39));
+        $noinline$assertLongEquals(1L << 16, Long.reverseBytes(1L << 40));
+        $noinline$assertLongEquals(1L << 17, Long.reverseBytes(1L << 41));
+        $noinline$assertLongEquals(1L << 18, Long.reverseBytes(1L << 42));
+        $noinline$assertLongEquals(1L << 19, Long.reverseBytes(1L << 43));
+        $noinline$assertLongEquals(1L << 20, Long.reverseBytes(1L << 44));
+        $noinline$assertLongEquals(1L << 21, Long.reverseBytes(1L << 45));
+        $noinline$assertLongEquals(1L << 22, Long.reverseBytes(1L << 46));
+        $noinline$assertLongEquals(1L << 23, Long.reverseBytes(1L << 47));
+        $noinline$assertLongEquals(1L << 8, Long.reverseBytes(1L << 48));
+        $noinline$assertLongEquals(1L << 9, Long.reverseBytes(1L << 49));
+        $noinline$assertLongEquals(1L << 10, Long.reverseBytes(1L << 50));
+        $noinline$assertLongEquals(1L << 11, Long.reverseBytes(1L << 51));
+        $noinline$assertLongEquals(1L << 12, Long.reverseBytes(1L << 52));
+        $noinline$assertLongEquals(1L << 13, Long.reverseBytes(1L << 53));
+        $noinline$assertLongEquals(1L << 14, Long.reverseBytes(1L << 54));
+        $noinline$assertLongEquals(1L << 15, Long.reverseBytes(1L << 55));
+        $noinline$assertLongEquals(1L << 0, Long.reverseBytes(1L << 56));
+        $noinline$assertLongEquals(1L << 1, Long.reverseBytes(1L << 57));
+        $noinline$assertLongEquals(1L << 2, Long.reverseBytes(1L << 58));
+        $noinline$assertLongEquals(1L << 3, Long.reverseBytes(1L << 59));
+        $noinline$assertLongEquals(1L << 4, Long.reverseBytes(1L << 60));
+        $noinline$assertLongEquals(1L << 5, Long.reverseBytes(1L << 61));
+        $noinline$assertLongEquals(1L << 6, Long.reverseBytes(1L << 62));
+        $noinline$assertLongEquals(1L << 7, Long.reverseBytes(1L << 63));
+    }
+
+    /// CHECK-START: void Main.$noinline$testReverseBytesShort() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:ShortReverseBytes
+
+    /// CHECK-START: void Main.$noinline$testReverseBytesShort() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:ShortReverseBytes
+    private static void $noinline$testReverseBytesShort() {
+        $noinline$assertShortEquals((short) (-129), Short.reverseBytes(Short.MAX_VALUE));
+        $noinline$assertShortEquals((short) (128), Short.reverseBytes(Short.MIN_VALUE));
+        $noinline$assertShortEquals((short) (0), Short.reverseBytes((short) 0));
+        // 0101... to 0101....
+        $noinline$assertShortEquals((short) (0x5555), Short.reverseBytes((short) 0x5555));
+        // 1010.... to 1010...
+        $noinline$assertShortEquals((short) (0xAAAA), Short.reverseBytes((short) 0xAAAA));
+        // Going up/down the hex digits.
+        $noinline$assertShortEquals((short) (0x0123), Short.reverseBytes((short) 0x2301));
+        $noinline$assertShortEquals((short) (0x4567), Short.reverseBytes((short) 0x6745));
+        $noinline$assertShortEquals((short) (0x89AB), Short.reverseBytes((short) 0xAB89));
+        $noinline$assertShortEquals((short) (0xCDEF), Short.reverseBytes((short) 0xEFCD));
+        $noinline$assertShortEquals((short) (0xFEDC), Short.reverseBytes((short) 0xDCFE));
+        $noinline$assertShortEquals((short) (0xBA98), Short.reverseBytes((short) 0x98BA));
+        $noinline$assertShortEquals((short) (0x7654), Short.reverseBytes((short) 0x5476));
+        $noinline$assertShortEquals((short) (0x3210), Short.reverseBytes((short) 0x1032));
+        $noinline$testReverseBytesShort_powerOfTwo();
+    }
+
+    /// CHECK-START: void Main.$noinline$testReverseBytesShort_powerOfTwo() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:ShortReverseBytes
+
+    /// CHECK-START: void Main.$noinline$testReverseBytesShort_powerOfTwo() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:ShortReverseBytes
+    private static void $noinline$testReverseBytesShort_powerOfTwo() {
+        $noinline$assertShortEquals((short) (1 << 8), Short.reverseBytes((short) (1 << 0)));
+        $noinline$assertShortEquals((short) (1 << 9), Short.reverseBytes((short) (1 << 1)));
+        $noinline$assertShortEquals((short) (1 << 10), Short.reverseBytes((short) (1 << 2)));
+        $noinline$assertShortEquals((short) (1 << 11), Short.reverseBytes((short) (1 << 3)));
+        $noinline$assertShortEquals((short) (1 << 12), Short.reverseBytes((short) (1 << 4)));
+        $noinline$assertShortEquals((short) (1 << 13), Short.reverseBytes((short) (1 << 5)));
+        $noinline$assertShortEquals((short) (1 << 14), Short.reverseBytes((short) (1 << 6)));
+        $noinline$assertShortEquals((short) (1 << 15), Short.reverseBytes((short) (1 << 7)));
+        $noinline$assertShortEquals((short) (1 << 0), Short.reverseBytes((short) (1 << 8)));
+        $noinline$assertShortEquals((short) (1 << 1), Short.reverseBytes((short) (1 << 9)));
+        $noinline$assertShortEquals((short) (1 << 2), Short.reverseBytes((short) (1 << 10)));
+        $noinline$assertShortEquals((short) (1 << 3), Short.reverseBytes((short) (1 << 11)));
+        $noinline$assertShortEquals((short) (1 << 4), Short.reverseBytes((short) (1 << 12)));
+        $noinline$assertShortEquals((short) (1 << 5), Short.reverseBytes((short) (1 << 13)));
+        $noinline$assertShortEquals((short) (1 << 6), Short.reverseBytes((short) (1 << 14)));
+        $noinline$assertShortEquals((short) (1 << 7), Short.reverseBytes((short) (1 << 15)));
+    }
+
+    /// CHECK-START: void Main.$noinline$testBitCountInt() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:IntegerBitCount
+
+    /// CHECK-START: void Main.$noinline$testBitCountInt() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:IntegerBitCount
+    private static void $noinline$testBitCountInt() {
+        $noinline$assertIntEquals(31, Integer.bitCount(Integer.MAX_VALUE));
+        $noinline$assertIntEquals(1, Integer.bitCount(Integer.MIN_VALUE));
+        // 0101... and 1010...
+        $noinline$assertIntEquals(16, Integer.bitCount(0x55555555));
+        $noinline$assertIntEquals(16, Integer.bitCount(0xAAAAAAAA));
+        // 0000... and 1111...
+        $noinline$assertIntEquals(0, Integer.bitCount(0));
+        $noinline$assertIntEquals(32, Integer.bitCount(0xFFFFFFFF));
+        $noinline$testBitCountInt_powerOfTwo();
+        $noinline$testBitCountInt_powerOfTwoMinusOne();
+    }
+
+    /// CHECK-START: void Main.$noinline$testBitCountInt_powerOfTwo() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:IntegerBitCount
+
+    /// CHECK-START: void Main.$noinline$testBitCountInt_powerOfTwo() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:IntegerBitCount
+    private static void $noinline$testBitCountInt_powerOfTwo() {
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 0));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 1));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 2));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 3));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 4));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 5));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 6));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 7));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 8));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 9));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 10));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 11));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 12));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 13));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 14));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 15));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 16));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 17));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 18));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 19));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 20));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 21));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 22));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 23));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 24));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 25));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 26));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 27));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 28));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 29));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 30));
+        $noinline$assertIntEquals(1, Integer.bitCount(1 << 31));
+    }
+
+    /// CHECK-START: void Main.$noinline$testBitCountInt_powerOfTwoMinusOne() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:IntegerBitCount
+
+    /// CHECK-START: void Main.$noinline$testBitCountInt_powerOfTwoMinusOne() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:IntegerBitCount
+    private static void $noinline$testBitCountInt_powerOfTwoMinusOne() {
+        // We start on `(1 << 2) - 1` (i.e. `3`) as the other values are already being tested.
+        $noinline$assertIntEquals(2, Integer.bitCount((1 << 2) - 1));
+        $noinline$assertIntEquals(3, Integer.bitCount((1 << 3) - 1));
+        $noinline$assertIntEquals(4, Integer.bitCount((1 << 4) - 1));
+        $noinline$assertIntEquals(5, Integer.bitCount((1 << 5) - 1));
+        $noinline$assertIntEquals(6, Integer.bitCount((1 << 6) - 1));
+        $noinline$assertIntEquals(7, Integer.bitCount((1 << 7) - 1));
+        $noinline$assertIntEquals(8, Integer.bitCount((1 << 8) - 1));
+        $noinline$assertIntEquals(9, Integer.bitCount((1 << 9) - 1));
+        $noinline$assertIntEquals(10, Integer.bitCount((1 << 10) - 1));
+        $noinline$assertIntEquals(11, Integer.bitCount((1 << 11) - 1));
+        $noinline$assertIntEquals(12, Integer.bitCount((1 << 12) - 1));
+        $noinline$assertIntEquals(13, Integer.bitCount((1 << 13) - 1));
+        $noinline$assertIntEquals(14, Integer.bitCount((1 << 14) - 1));
+        $noinline$assertIntEquals(15, Integer.bitCount((1 << 15) - 1));
+        $noinline$assertIntEquals(16, Integer.bitCount((1 << 16) - 1));
+        $noinline$assertIntEquals(17, Integer.bitCount((1 << 17) - 1));
+        $noinline$assertIntEquals(18, Integer.bitCount((1 << 18) - 1));
+        $noinline$assertIntEquals(19, Integer.bitCount((1 << 19) - 1));
+        $noinline$assertIntEquals(20, Integer.bitCount((1 << 20) - 1));
+        $noinline$assertIntEquals(21, Integer.bitCount((1 << 21) - 1));
+        $noinline$assertIntEquals(22, Integer.bitCount((1 << 22) - 1));
+        $noinline$assertIntEquals(23, Integer.bitCount((1 << 23) - 1));
+        $noinline$assertIntEquals(24, Integer.bitCount((1 << 24) - 1));
+        $noinline$assertIntEquals(25, Integer.bitCount((1 << 25) - 1));
+        $noinline$assertIntEquals(26, Integer.bitCount((1 << 26) - 1));
+        $noinline$assertIntEquals(27, Integer.bitCount((1 << 27) - 1));
+        $noinline$assertIntEquals(28, Integer.bitCount((1 << 28) - 1));
+        $noinline$assertIntEquals(29, Integer.bitCount((1 << 29) - 1));
+        $noinline$assertIntEquals(30, Integer.bitCount((1 << 30) - 1));
+        $noinline$assertIntEquals(31, Integer.bitCount((1 << 31) - 1));
+    }
+
+
+    /// CHECK-START: void Main.$noinline$testBitCountLong() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongBitCount
+
+    /// CHECK-START: void Main.$noinline$testBitCountLong() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongBitCount
+    private static void $noinline$testBitCountLong() {
+        $noinline$assertLongEquals(63L, Long.bitCount(Long.MAX_VALUE));
+        $noinline$assertLongEquals(1L, Long.bitCount(Long.MIN_VALUE));
+        // 0101... and 1010...
+        $noinline$assertLongEquals(32L, Long.bitCount(0x5555555555555555L));
+        $noinline$assertLongEquals(32L, Long.bitCount(0xAAAAAAAAAAAAAAAAL));
+        // 0000... and 1111...
+        $noinline$assertLongEquals(0L, Long.bitCount(0L));
+        $noinline$assertLongEquals(64L, Long.bitCount(0xFFFFFFFFFFFFFFFFL));
+        $noinline$testBitCountLongFirst32_powerOfTwo();
+        $noinline$testBitCountLongLast32_powerOfTwo();
+        $noinline$testBitCountLongFirst32_powerOfTwoMinusOne();
+        $noinline$testBitCountLongLast32_powerOfTwoMinusOne();
+    }
+
+    /// CHECK-START: void Main.$noinline$testBitCountLongFirst32_powerOfTwo() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongBitCount
+
+    /// CHECK-START: void Main.$noinline$testBitCountLongFirst32_powerOfTwo() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongBitCount
+    private static void $noinline$testBitCountLongFirst32_powerOfTwo() {
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 0L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 1L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 2L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 3L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 4L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 5L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 6L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 7L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 8L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 9L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 10L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 11L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 12L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 13L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 14L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 15L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 16L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 17L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 18L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 19L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 20L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 21L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 22L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 23L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 24L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 25L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 26L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 27L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 28L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 29L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 30L));
+    }
+
+    /// CHECK-START: void Main.$noinline$testBitCountLongLast32_powerOfTwo() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongBitCount
+
+    /// CHECK-START: void Main.$noinline$testBitCountLongLast32_powerOfTwo() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongBitCount
+    private static void $noinline$testBitCountLongLast32_powerOfTwo() {
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 31L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 32L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 33L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 34L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 35L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 36L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 37L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 38L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 39L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 40L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 41L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 42L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 43L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 44L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 45L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 46L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 47L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 48L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 49L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 50L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 51L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 52L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 53L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 54L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 55L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 56L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 57L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 58L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 59L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 60L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 61L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 62L));
+        $noinline$assertLongEquals(1L, Long.bitCount(1L << 63L));
+    }
+
+    /// CHECK-START: void Main.$noinline$testBitCountLongFirst32_powerOfTwoMinusOne() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongBitCount
+
+    /// CHECK-START: void Main.$noinline$testBitCountLongFirst32_powerOfTwoMinusOne() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongBitCount
+    private static void $noinline$testBitCountLongFirst32_powerOfTwoMinusOne() {
+        // We start on `(1L << 2) - 1` (i.e. `3L`) as the other values are already being tested.
+        $noinline$assertLongEquals(2L, Long.bitCount((1L << 2) - 1L));
+        $noinline$assertLongEquals(3L, Long.bitCount((1L << 3) - 1L));
+        $noinline$assertLongEquals(4L, Long.bitCount((1L << 4) - 1L));
+        $noinline$assertLongEquals(5L, Long.bitCount((1L << 5) - 1L));
+        $noinline$assertLongEquals(6L, Long.bitCount((1L << 6) - 1L));
+        $noinline$assertLongEquals(7L, Long.bitCount((1L << 7) - 1L));
+        $noinline$assertLongEquals(8L, Long.bitCount((1L << 8) - 1L));
+        $noinline$assertLongEquals(9L, Long.bitCount((1L << 9) - 1L));
+        $noinline$assertLongEquals(10L, Long.bitCount((1L << 10) - 1L));
+        $noinline$assertLongEquals(11L, Long.bitCount((1L << 11) - 1L));
+        $noinline$assertLongEquals(12L, Long.bitCount((1L << 12) - 1L));
+        $noinline$assertLongEquals(13L, Long.bitCount((1L << 13) - 1L));
+        $noinline$assertLongEquals(14L, Long.bitCount((1L << 14) - 1L));
+        $noinline$assertLongEquals(15L, Long.bitCount((1L << 15) - 1L));
+        $noinline$assertLongEquals(16L, Long.bitCount((1L << 16) - 1L));
+        $noinline$assertLongEquals(17L, Long.bitCount((1L << 17) - 1L));
+        $noinline$assertLongEquals(18L, Long.bitCount((1L << 18) - 1L));
+        $noinline$assertLongEquals(19L, Long.bitCount((1L << 19) - 1L));
+        $noinline$assertLongEquals(20L, Long.bitCount((1L << 20) - 1L));
+        $noinline$assertLongEquals(21L, Long.bitCount((1L << 21) - 1L));
+        $noinline$assertLongEquals(22L, Long.bitCount((1L << 22) - 1L));
+        $noinline$assertLongEquals(23L, Long.bitCount((1L << 23) - 1L));
+        $noinline$assertLongEquals(24L, Long.bitCount((1L << 24) - 1L));
+        $noinline$assertLongEquals(25L, Long.bitCount((1L << 25) - 1L));
+        $noinline$assertLongEquals(26L, Long.bitCount((1L << 26) - 1L));
+        $noinline$assertLongEquals(27L, Long.bitCount((1L << 27) - 1L));
+        $noinline$assertLongEquals(28L, Long.bitCount((1L << 28) - 1L));
+        $noinline$assertLongEquals(29L, Long.bitCount((1L << 29) - 1L));
+        $noinline$assertLongEquals(30L, Long.bitCount((1L << 30) - 1L));
+    }
+
+    /// CHECK-START: void Main.$noinline$testBitCountLongLast32_powerOfTwoMinusOne() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongBitCount
+
+    /// CHECK-START: void Main.$noinline$testBitCountLongLast32_powerOfTwoMinusOne() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongBitCount
+    private static void $noinline$testBitCountLongLast32_powerOfTwoMinusOne() {
+        $noinline$assertLongEquals(31L, Long.bitCount((1L << 31) - 1L));
+        $noinline$assertLongEquals(32L, Long.bitCount((1L << 32) - 1L));
+        $noinline$assertLongEquals(33L, Long.bitCount((1L << 33) - 1L));
+        $noinline$assertLongEquals(34L, Long.bitCount((1L << 34) - 1L));
+        $noinline$assertLongEquals(35L, Long.bitCount((1L << 35) - 1L));
+        $noinline$assertLongEquals(36L, Long.bitCount((1L << 36) - 1L));
+        $noinline$assertLongEquals(37L, Long.bitCount((1L << 37) - 1L));
+        $noinline$assertLongEquals(38L, Long.bitCount((1L << 38) - 1L));
+        $noinline$assertLongEquals(39L, Long.bitCount((1L << 39) - 1L));
+        $noinline$assertLongEquals(40L, Long.bitCount((1L << 40) - 1L));
+        $noinline$assertLongEquals(41L, Long.bitCount((1L << 41) - 1L));
+        $noinline$assertLongEquals(42L, Long.bitCount((1L << 42) - 1L));
+        $noinline$assertLongEquals(43L, Long.bitCount((1L << 43) - 1L));
+        $noinline$assertLongEquals(44L, Long.bitCount((1L << 44) - 1L));
+        $noinline$assertLongEquals(45L, Long.bitCount((1L << 45) - 1L));
+        $noinline$assertLongEquals(46L, Long.bitCount((1L << 46) - 1L));
+        $noinline$assertLongEquals(47L, Long.bitCount((1L << 47) - 1L));
+        $noinline$assertLongEquals(48L, Long.bitCount((1L << 48) - 1L));
+        $noinline$assertLongEquals(49L, Long.bitCount((1L << 49) - 1L));
+        $noinline$assertLongEquals(50L, Long.bitCount((1L << 50) - 1L));
+        $noinline$assertLongEquals(51L, Long.bitCount((1L << 51) - 1L));
+        $noinline$assertLongEquals(52L, Long.bitCount((1L << 52) - 1L));
+        $noinline$assertLongEquals(53L, Long.bitCount((1L << 53) - 1L));
+        $noinline$assertLongEquals(54L, Long.bitCount((1L << 54) - 1L));
+        $noinline$assertLongEquals(55L, Long.bitCount((1L << 55) - 1L));
+        $noinline$assertLongEquals(56L, Long.bitCount((1L << 56) - 1L));
+        $noinline$assertLongEquals(57L, Long.bitCount((1L << 57) - 1L));
+        $noinline$assertLongEquals(58L, Long.bitCount((1L << 58) - 1L));
+        $noinline$assertLongEquals(59L, Long.bitCount((1L << 59) - 1L));
+        $noinline$assertLongEquals(60L, Long.bitCount((1L << 60) - 1L));
+        $noinline$assertLongEquals(61L, Long.bitCount((1L << 61) - 1L));
+        $noinline$assertLongEquals(62L, Long.bitCount((1L << 62) - 1L));
+        $noinline$assertLongEquals(63L, Long.bitCount((1L << 63) - 1L));
+    }
+
+    /// CHECK-START: void Main.$noinline$testDivideUnsignedInt() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:IntegerDivideUnsigned
+
+    /// CHECK-START: void Main.$noinline$testDivideUnsignedInt() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:IntegerDivideUnsigned
+    private static void $noinline$testDivideUnsignedInt() {
+        // Positive/Positive division is as normal.
+        $noinline$assertIntEquals(5, Integer.divideUnsigned(10, 2));
+        $noinline$assertIntEquals(0, Integer.divideUnsigned(2, 10));
+        $noinline$assertIntEquals(1, Integer.divideUnsigned(42, 42));
+
+        // Positive/Negative is 0, as negative numbers are bigger (if taking a look as unsigned).
+        $noinline$assertIntEquals(0, Integer.divideUnsigned(10, -2));
+        $noinline$assertIntEquals(0, Integer.divideUnsigned(2, -10));
+        $noinline$assertIntEquals(0, Integer.divideUnsigned(42, -42));
+        $noinline$assertIntEquals(0, Integer.divideUnsigned(Integer.MAX_VALUE, -1));
+
+        // Negative/Positive
+        $noinline$assertIntEquals(2147483643, Integer.divideUnsigned(-10, 2));
+        $noinline$assertIntEquals(429496729, Integer.divideUnsigned(-2, 10));
+        $noinline$assertIntEquals(102261125, Integer.divideUnsigned(-42, 42));
+        $noinline$assertIntEquals(1, Integer.divideUnsigned(Integer.MIN_VALUE, Integer.MAX_VALUE));
+        $noinline$assertIntEquals(-1, Integer.divideUnsigned(-1, 1));
+
+        // Negative/Negative
+        $noinline$assertIntEquals(0, Integer.divideUnsigned(-2, -1));
+        $noinline$assertIntEquals(1, Integer.divideUnsigned(-1, -2));
+        $noinline$assertIntEquals(0, Integer.divideUnsigned(-10, -2));
+        $noinline$assertIntEquals(1, Integer.divideUnsigned(-2, -10));
+
+        // Special cases where we don't constant fold the intrinsic
+        $noinline$testDivideUnsignedInt_divideByZero();
+    }
+
+    /// CHECK-START: void Main.$noinline$testDivideUnsignedInt_divideByZero() constant_folding (before)
+    /// CHECK: InvokeStaticOrDirect intrinsic:IntegerDivideUnsigned
+    /// CHECK: InvokeStaticOrDirect intrinsic:IntegerDivideUnsigned
+
+    /// CHECK-START: void Main.$noinline$testDivideUnsignedInt_divideByZero() constant_folding (after)
+    /// CHECK: InvokeStaticOrDirect intrinsic:IntegerDivideUnsigned
+    /// CHECK: InvokeStaticOrDirect intrinsic:IntegerDivideUnsigned
+    private static void $noinline$testDivideUnsignedInt_divideByZero() {
+        try {
+            $noinline$assertIntEquals(0, Integer.divideUnsigned(1, 0));
+            throw new Error("Tried to divide 1 and 0 but didn't get an exception");
+        } catch (ArithmeticException expected) {
+        }
+
+        try {
+            $noinline$assertIntEquals(0, Integer.divideUnsigned(-1, 0));
+            throw new Error("Tried to divide -1 and 0 but didn't get an exception");
+        } catch (ArithmeticException expected) {
+        }
+    }
+
+    /// CHECK-START: void Main.$noinline$testDivideUnsignedLong() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongDivideUnsigned
+
+    /// CHECK-START: void Main.$noinline$testDivideUnsignedLong() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongDivideUnsigned
+    private static void $noinline$testDivideUnsignedLong() {
+        // Positive/Positive division is as normal.
+        $noinline$assertLongEquals(5L, Long.divideUnsigned(10L, 2L));
+        $noinline$assertLongEquals(0L, Long.divideUnsigned(2L, 10L));
+        $noinline$assertLongEquals(1L, Long.divideUnsigned(42L, 42L));
+
+        // Positive/Negative is 0, as negative numbers are bigger (if taking a look as unsigned).
+        $noinline$assertLongEquals(0L, Long.divideUnsigned(10L, -2L));
+        $noinline$assertLongEquals(0L, Long.divideUnsigned(2L, -10L));
+        $noinline$assertLongEquals(0L, Long.divideUnsigned(42L, -42L));
+        $noinline$assertLongEquals(0L, Long.divideUnsigned(Long.MAX_VALUE, -1L));
+
+        // Negative/Positive
+        $noinline$assertLongEquals(9223372036854775803L, Long.divideUnsigned(-10L, 2L));
+        $noinline$assertLongEquals(1844674407370955161L, Long.divideUnsigned(-2L, 10L));
+        $noinline$assertLongEquals(439208192231179799L, Long.divideUnsigned(-42L, 42L));
+        $noinline$assertLongEquals(1L, Long.divideUnsigned(Long.MIN_VALUE, Long.MAX_VALUE));
+        $noinline$assertLongEquals(-1L, Long.divideUnsigned(-1L, 1L));
+
+        // Negative/Negative
+        $noinline$assertLongEquals(0L, Long.divideUnsigned(-2L, -1L));
+        $noinline$assertLongEquals(1L, Long.divideUnsigned(-1L, -2L));
+        $noinline$assertLongEquals(0L, Long.divideUnsigned(-10L, -2L));
+        $noinline$assertLongEquals(1L, Long.divideUnsigned(-2L, -10L));
+
+        // Special cases where we don't constant fold the intrinsic
+        $noinline$testDivideUnsignedLong_divideByZero();
+    }
+
+    /// CHECK-START: void Main.$noinline$testDivideUnsignedLong_divideByZero() constant_folding (before)
+    /// CHECK: InvokeStaticOrDirect intrinsic:LongDivideUnsigned
+    /// CHECK: InvokeStaticOrDirect intrinsic:LongDivideUnsigned
+
+    /// CHECK-START: void Main.$noinline$testDivideUnsignedLong_divideByZero() constant_folding (after)
+    /// CHECK: InvokeStaticOrDirect intrinsic:LongDivideUnsigned
+    /// CHECK: InvokeStaticOrDirect intrinsic:LongDivideUnsigned
+    private static void $noinline$testDivideUnsignedLong_divideByZero() {
+        try {
+            $noinline$assertLongEquals(0L, Long.divideUnsigned(1L, 0L));
+            throw new Error("Tried to divide 1 and 0 but didn't get an exception");
+        } catch (ArithmeticException expected) {
+        }
+
+        try {
+            $noinline$assertLongEquals(0L, Long.divideUnsigned(-1L, 0L));
+            throw new Error("Tried to divide -1 and 0 but didn't get an exception");
+        } catch (ArithmeticException expected) {
+        }
+    }
+
+    /// CHECK-START: void Main.$noinline$testHighestOneBitInt() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:IntegerHighestOneBit
+
+    /// CHECK-START: void Main.$noinline$testHighestOneBitInt() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:IntegerHighestOneBit
+    private static void $noinline$testHighestOneBitInt() {
+        $noinline$assertIntEquals(1 << 30, Integer.highestOneBit(Integer.MAX_VALUE));
+        $noinline$assertIntEquals(1 << 31, Integer.highestOneBit(Integer.MIN_VALUE));
+        $noinline$testHighestOneBitInt_powerOfTwo();
+        $noinline$testHighestOneBitInt_powerOfTwoMinusOne();
+    }
+
+    /// CHECK-START: void Main.$noinline$testHighestOneBitInt_powerOfTwo() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:IntegerHighestOneBit
+
+    /// CHECK-START: void Main.$noinline$testHighestOneBitInt_powerOfTwo() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:IntegerHighestOneBit
+    private static void $noinline$testHighestOneBitInt_powerOfTwo() {
+        $noinline$assertIntEquals(0, Integer.highestOneBit(0));
+        $noinline$assertIntEquals(1 << 0, Integer.highestOneBit(1 << 0));
+        $noinline$assertIntEquals(1 << 1, Integer.highestOneBit(1 << 1));
+        $noinline$assertIntEquals(1 << 2, Integer.highestOneBit(1 << 2));
+        $noinline$assertIntEquals(1 << 3, Integer.highestOneBit(1 << 3));
+        $noinline$assertIntEquals(1 << 4, Integer.highestOneBit(1 << 4));
+        $noinline$assertIntEquals(1 << 5, Integer.highestOneBit(1 << 5));
+        $noinline$assertIntEquals(1 << 6, Integer.highestOneBit(1 << 6));
+        $noinline$assertIntEquals(1 << 7, Integer.highestOneBit(1 << 7));
+        $noinline$assertIntEquals(1 << 8, Integer.highestOneBit(1 << 8));
+        $noinline$assertIntEquals(1 << 9, Integer.highestOneBit(1 << 9));
+        $noinline$assertIntEquals(1 << 10, Integer.highestOneBit(1 << 10));
+        $noinline$assertIntEquals(1 << 11, Integer.highestOneBit(1 << 11));
+        $noinline$assertIntEquals(1 << 12, Integer.highestOneBit(1 << 12));
+        $noinline$assertIntEquals(1 << 13, Integer.highestOneBit(1 << 13));
+        $noinline$assertIntEquals(1 << 14, Integer.highestOneBit(1 << 14));
+        $noinline$assertIntEquals(1 << 15, Integer.highestOneBit(1 << 15));
+        $noinline$assertIntEquals(1 << 16, Integer.highestOneBit(1 << 16));
+        $noinline$assertIntEquals(1 << 17, Integer.highestOneBit(1 << 17));
+        $noinline$assertIntEquals(1 << 18, Integer.highestOneBit(1 << 18));
+        $noinline$assertIntEquals(1 << 19, Integer.highestOneBit(1 << 19));
+        $noinline$assertIntEquals(1 << 20, Integer.highestOneBit(1 << 20));
+        $noinline$assertIntEquals(1 << 21, Integer.highestOneBit(1 << 21));
+        $noinline$assertIntEquals(1 << 22, Integer.highestOneBit(1 << 22));
+        $noinline$assertIntEquals(1 << 23, Integer.highestOneBit(1 << 23));
+        $noinline$assertIntEquals(1 << 24, Integer.highestOneBit(1 << 24));
+        $noinline$assertIntEquals(1 << 25, Integer.highestOneBit(1 << 25));
+        $noinline$assertIntEquals(1 << 26, Integer.highestOneBit(1 << 26));
+        $noinline$assertIntEquals(1 << 27, Integer.highestOneBit(1 << 27));
+        $noinline$assertIntEquals(1 << 28, Integer.highestOneBit(1 << 28));
+        $noinline$assertIntEquals(1 << 29, Integer.highestOneBit(1 << 29));
+        $noinline$assertIntEquals(1 << 30, Integer.highestOneBit(1 << 30));
+        $noinline$assertIntEquals(1 << 31, Integer.highestOneBit(1 << 31));
+    }
+
+    /// CHECK-START: void Main.$noinline$testHighestOneBitInt_powerOfTwoMinusOne() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:IntegerHighestOneBit
+
+    /// CHECK-START: void Main.$noinline$testHighestOneBitInt_powerOfTwoMinusOne() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:IntegerHighestOneBit
+    private static void $noinline$testHighestOneBitInt_powerOfTwoMinusOne() {
+        // We start on `(1 << 2) - 1` (i.e. `3`) as the other values are already being tested.
+        $noinline$assertIntEquals(1 << (2 - 1), Integer.highestOneBit((1 << 2) - 1));
+        $noinline$assertIntEquals(1 << (3 - 1), Integer.highestOneBit((1 << 3) - 1));
+        $noinline$assertIntEquals(1 << (4 - 1), Integer.highestOneBit((1 << 4) - 1));
+        $noinline$assertIntEquals(1 << (5 - 1), Integer.highestOneBit((1 << 5) - 1));
+        $noinline$assertIntEquals(1 << (6 - 1), Integer.highestOneBit((1 << 6) - 1));
+        $noinline$assertIntEquals(1 << (7 - 1), Integer.highestOneBit((1 << 7) - 1));
+        $noinline$assertIntEquals(1 << (8 - 1), Integer.highestOneBit((1 << 8) - 1));
+        $noinline$assertIntEquals(1 << (9 - 1), Integer.highestOneBit((1 << 9) - 1));
+        $noinline$assertIntEquals(1 << (10 - 1), Integer.highestOneBit((1 << 10) - 1));
+        $noinline$assertIntEquals(1 << (11 - 1), Integer.highestOneBit((1 << 11) - 1));
+        $noinline$assertIntEquals(1 << (12 - 1), Integer.highestOneBit((1 << 12) - 1));
+        $noinline$assertIntEquals(1 << (13 - 1), Integer.highestOneBit((1 << 13) - 1));
+        $noinline$assertIntEquals(1 << (14 - 1), Integer.highestOneBit((1 << 14) - 1));
+        $noinline$assertIntEquals(1 << (15 - 1), Integer.highestOneBit((1 << 15) - 1));
+        $noinline$assertIntEquals(1 << (16 - 1), Integer.highestOneBit((1 << 16) - 1));
+        $noinline$assertIntEquals(1 << (17 - 1), Integer.highestOneBit((1 << 17) - 1));
+        $noinline$assertIntEquals(1 << (18 - 1), Integer.highestOneBit((1 << 18) - 1));
+        $noinline$assertIntEquals(1 << (19 - 1), Integer.highestOneBit((1 << 19) - 1));
+        $noinline$assertIntEquals(1 << (20 - 1), Integer.highestOneBit((1 << 20) - 1));
+        $noinline$assertIntEquals(1 << (21 - 1), Integer.highestOneBit((1 << 21) - 1));
+        $noinline$assertIntEquals(1 << (22 - 1), Integer.highestOneBit((1 << 22) - 1));
+        $noinline$assertIntEquals(1 << (23 - 1), Integer.highestOneBit((1 << 23) - 1));
+        $noinline$assertIntEquals(1 << (24 - 1), Integer.highestOneBit((1 << 24) - 1));
+        $noinline$assertIntEquals(1 << (25 - 1), Integer.highestOneBit((1 << 25) - 1));
+        $noinline$assertIntEquals(1 << (26 - 1), Integer.highestOneBit((1 << 26) - 1));
+        $noinline$assertIntEquals(1 << (27 - 1), Integer.highestOneBit((1 << 27) - 1));
+        $noinline$assertIntEquals(1 << (28 - 1), Integer.highestOneBit((1 << 28) - 1));
+        $noinline$assertIntEquals(1 << (29 - 1), Integer.highestOneBit((1 << 29) - 1));
+        $noinline$assertIntEquals(1 << (30 - 1), Integer.highestOneBit((1 << 30) - 1));
+        $noinline$assertIntEquals(1 << (31 - 1), Integer.highestOneBit((1 << 31) - 1));
+    }
+
+    /// CHECK-START: void Main.$noinline$testHighestOneBitLong() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongHighestOneBit
+
+    /// CHECK-START: void Main.$noinline$testHighestOneBitLong() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongHighestOneBit
+    private static void $noinline$testHighestOneBitLong() {
+        $noinline$assertLongEquals(1L << 62, Long.highestOneBit(Long.MAX_VALUE));
+        $noinline$assertLongEquals(1L << 63, Long.highestOneBit(Long.MIN_VALUE));
+        // We need to do two smaller methods because otherwise we don't compile it due to our
+        // heuristics.
+        $noinline$testHighestOneBitLongFirst32_powerOfTwo();
+        $noinline$testHighestOneBitLongLast32_powerOfTwo();
+        $noinline$testHighestOneBitLongFirst32_powerOfTwoMinusOne();
+        $noinline$testHighestOneBitLongLast32_powerOfTwoMinusOne();
+    }
+
+    /// CHECK-START: void Main.$noinline$testHighestOneBitLongFirst32_powerOfTwo() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongHighestOneBit
+
+    /// CHECK-START: void Main.$noinline$testHighestOneBitLongFirst32_powerOfTwo() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongHighestOneBit
+    private static void $noinline$testHighestOneBitLongFirst32_powerOfTwo() {
+        $noinline$assertLongEquals(0, Long.highestOneBit(0L));
+        $noinline$assertLongEquals(1L << 0L, Long.highestOneBit(1L << 0L));
+        $noinline$assertLongEquals(1L << 1L, Long.highestOneBit(1L << 1L));
+        $noinline$assertLongEquals(1L << 2L, Long.highestOneBit(1L << 2L));
+        $noinline$assertLongEquals(1L << 3L, Long.highestOneBit(1L << 3L));
+        $noinline$assertLongEquals(1L << 4L, Long.highestOneBit(1L << 4L));
+        $noinline$assertLongEquals(1L << 5L, Long.highestOneBit(1L << 5L));
+        $noinline$assertLongEquals(1L << 6L, Long.highestOneBit(1L << 6L));
+        $noinline$assertLongEquals(1L << 7L, Long.highestOneBit(1L << 7L));
+        $noinline$assertLongEquals(1L << 8L, Long.highestOneBit(1L << 8L));
+        $noinline$assertLongEquals(1L << 9L, Long.highestOneBit(1L << 9L));
+        $noinline$assertLongEquals(1L << 10L, Long.highestOneBit(1L << 10L));
+        $noinline$assertLongEquals(1L << 11L, Long.highestOneBit(1L << 11L));
+        $noinline$assertLongEquals(1L << 12L, Long.highestOneBit(1L << 12L));
+        $noinline$assertLongEquals(1L << 13L, Long.highestOneBit(1L << 13L));
+        $noinline$assertLongEquals(1L << 14L, Long.highestOneBit(1L << 14L));
+        $noinline$assertLongEquals(1L << 15L, Long.highestOneBit(1L << 15L));
+        $noinline$assertLongEquals(1L << 16L, Long.highestOneBit(1L << 16L));
+        $noinline$assertLongEquals(1L << 17L, Long.highestOneBit(1L << 17L));
+        $noinline$assertLongEquals(1L << 18L, Long.highestOneBit(1L << 18L));
+        $noinline$assertLongEquals(1L << 19L, Long.highestOneBit(1L << 19L));
+        $noinline$assertLongEquals(1L << 20L, Long.highestOneBit(1L << 20L));
+        $noinline$assertLongEquals(1L << 21L, Long.highestOneBit(1L << 21L));
+        $noinline$assertLongEquals(1L << 22L, Long.highestOneBit(1L << 22L));
+        $noinline$assertLongEquals(1L << 23L, Long.highestOneBit(1L << 23L));
+        $noinline$assertLongEquals(1L << 24L, Long.highestOneBit(1L << 24L));
+        $noinline$assertLongEquals(1L << 25L, Long.highestOneBit(1L << 25L));
+        $noinline$assertLongEquals(1L << 26L, Long.highestOneBit(1L << 26L));
+        $noinline$assertLongEquals(1L << 27L, Long.highestOneBit(1L << 27L));
+        $noinline$assertLongEquals(1L << 28L, Long.highestOneBit(1L << 28L));
+        $noinline$assertLongEquals(1L << 29L, Long.highestOneBit(1L << 29L));
+        $noinline$assertLongEquals(1L << 30L, Long.highestOneBit(1L << 30L));
+    }
+
+    /// CHECK-START: void Main.$noinline$testHighestOneBitLongLast32_powerOfTwo() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongHighestOneBit
+
+    /// CHECK-START: void Main.$noinline$testHighestOneBitLongLast32_powerOfTwo() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongHighestOneBit
+    private static void $noinline$testHighestOneBitLongLast32_powerOfTwo() {
+        $noinline$assertLongEquals(1L << 31L, Long.highestOneBit(1L << 31L));
+        $noinline$assertLongEquals(1L << 32L, Long.highestOneBit(1L << 32L));
+        $noinline$assertLongEquals(1L << 33L, Long.highestOneBit(1L << 33L));
+        $noinline$assertLongEquals(1L << 34L, Long.highestOneBit(1L << 34L));
+        $noinline$assertLongEquals(1L << 35L, Long.highestOneBit(1L << 35L));
+        $noinline$assertLongEquals(1L << 36L, Long.highestOneBit(1L << 36L));
+        $noinline$assertLongEquals(1L << 37L, Long.highestOneBit(1L << 37L));
+        $noinline$assertLongEquals(1L << 38L, Long.highestOneBit(1L << 38L));
+        $noinline$assertLongEquals(1L << 39L, Long.highestOneBit(1L << 39L));
+        $noinline$assertLongEquals(1L << 40L, Long.highestOneBit(1L << 40L));
+        $noinline$assertLongEquals(1L << 41L, Long.highestOneBit(1L << 41L));
+        $noinline$assertLongEquals(1L << 42L, Long.highestOneBit(1L << 42L));
+        $noinline$assertLongEquals(1L << 43L, Long.highestOneBit(1L << 43L));
+        $noinline$assertLongEquals(1L << 44L, Long.highestOneBit(1L << 44L));
+        $noinline$assertLongEquals(1L << 45L, Long.highestOneBit(1L << 45L));
+        $noinline$assertLongEquals(1L << 46L, Long.highestOneBit(1L << 46L));
+        $noinline$assertLongEquals(1L << 47L, Long.highestOneBit(1L << 47L));
+        $noinline$assertLongEquals(1L << 48L, Long.highestOneBit(1L << 48L));
+        $noinline$assertLongEquals(1L << 49L, Long.highestOneBit(1L << 49L));
+        $noinline$assertLongEquals(1L << 50L, Long.highestOneBit(1L << 50L));
+        $noinline$assertLongEquals(1L << 51L, Long.highestOneBit(1L << 51L));
+        $noinline$assertLongEquals(1L << 52L, Long.highestOneBit(1L << 52L));
+        $noinline$assertLongEquals(1L << 53L, Long.highestOneBit(1L << 53L));
+        $noinline$assertLongEquals(1L << 54L, Long.highestOneBit(1L << 54L));
+        $noinline$assertLongEquals(1L << 55L, Long.highestOneBit(1L << 55L));
+        $noinline$assertLongEquals(1L << 56L, Long.highestOneBit(1L << 56L));
+        $noinline$assertLongEquals(1L << 57L, Long.highestOneBit(1L << 57L));
+        $noinline$assertLongEquals(1L << 58L, Long.highestOneBit(1L << 58L));
+        $noinline$assertLongEquals(1L << 59L, Long.highestOneBit(1L << 59L));
+        $noinline$assertLongEquals(1L << 60L, Long.highestOneBit(1L << 60L));
+        $noinline$assertLongEquals(1L << 61L, Long.highestOneBit(1L << 61L));
+        $noinline$assertLongEquals(1L << 62L, Long.highestOneBit(1L << 62L));
+        $noinline$assertLongEquals(1L << 63L, Long.highestOneBit(1L << 63L));
+    }
+
+    /// CHECK-START: void Main.$noinline$testHighestOneBitLongFirst32_powerOfTwoMinusOne() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongHighestOneBit
+
+    /// CHECK-START: void Main.$noinline$testHighestOneBitLongFirst32_powerOfTwoMinusOne() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongHighestOneBit
+    private static void $noinline$testHighestOneBitLongFirst32_powerOfTwoMinusOne() {
+        // We start on `(1L << 2) - 1` (i.e. `3L`) as the other values are already being tested.
+        $noinline$assertLongEquals(1L << (2 - 1), Long.highestOneBit((1L << 2) - 1L));
+        $noinline$assertLongEquals(1L << (3 - 1), Long.highestOneBit((1L << 3) - 1L));
+        $noinline$assertLongEquals(1L << (4 - 1), Long.highestOneBit((1L << 4) - 1L));
+        $noinline$assertLongEquals(1L << (5 - 1), Long.highestOneBit((1L << 5) - 1L));
+        $noinline$assertLongEquals(1L << (6 - 1), Long.highestOneBit((1L << 6) - 1L));
+        $noinline$assertLongEquals(1L << (7 - 1), Long.highestOneBit((1L << 7) - 1L));
+        $noinline$assertLongEquals(1L << (8 - 1), Long.highestOneBit((1L << 8) - 1L));
+        $noinline$assertLongEquals(1L << (9 - 1), Long.highestOneBit((1L << 9) - 1L));
+        $noinline$assertLongEquals(1L << (10 - 1), Long.highestOneBit((1L << 10) - 1L));
+        $noinline$assertLongEquals(1L << (11 - 1), Long.highestOneBit((1L << 11) - 1L));
+        $noinline$assertLongEquals(1L << (12 - 1), Long.highestOneBit((1L << 12) - 1L));
+        $noinline$assertLongEquals(1L << (13 - 1), Long.highestOneBit((1L << 13) - 1L));
+        $noinline$assertLongEquals(1L << (14 - 1), Long.highestOneBit((1L << 14) - 1L));
+        $noinline$assertLongEquals(1L << (15 - 1), Long.highestOneBit((1L << 15) - 1L));
+        $noinline$assertLongEquals(1L << (16 - 1), Long.highestOneBit((1L << 16) - 1L));
+        $noinline$assertLongEquals(1L << (17 - 1), Long.highestOneBit((1L << 17) - 1L));
+        $noinline$assertLongEquals(1L << (18 - 1), Long.highestOneBit((1L << 18) - 1L));
+        $noinline$assertLongEquals(1L << (19 - 1), Long.highestOneBit((1L << 19) - 1L));
+        $noinline$assertLongEquals(1L << (20 - 1), Long.highestOneBit((1L << 20) - 1L));
+        $noinline$assertLongEquals(1L << (21 - 1), Long.highestOneBit((1L << 21) - 1L));
+        $noinline$assertLongEquals(1L << (22 - 1), Long.highestOneBit((1L << 22) - 1L));
+        $noinline$assertLongEquals(1L << (23 - 1), Long.highestOneBit((1L << 23) - 1L));
+        $noinline$assertLongEquals(1L << (24 - 1), Long.highestOneBit((1L << 24) - 1L));
+        $noinline$assertLongEquals(1L << (25 - 1), Long.highestOneBit((1L << 25) - 1L));
+        $noinline$assertLongEquals(1L << (26 - 1), Long.highestOneBit((1L << 26) - 1L));
+        $noinline$assertLongEquals(1L << (27 - 1), Long.highestOneBit((1L << 27) - 1L));
+        $noinline$assertLongEquals(1L << (28 - 1), Long.highestOneBit((1L << 28) - 1L));
+        $noinline$assertLongEquals(1L << (29 - 1), Long.highestOneBit((1L << 29) - 1L));
+        $noinline$assertLongEquals(1L << (30 - 1), Long.highestOneBit((1L << 30) - 1L));
+    }
+
+    /// CHECK-START: void Main.$noinline$testHighestOneBitLongLast32_powerOfTwoMinusOne() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongHighestOneBit
+
+    /// CHECK-START: void Main.$noinline$testHighestOneBitLongLast32_powerOfTwoMinusOne() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongHighestOneBit
+    private static void $noinline$testHighestOneBitLongLast32_powerOfTwoMinusOne() {
+        $noinline$assertLongEquals(1L << (31 - 1), Long.highestOneBit((1L << 31) - 1L));
+        $noinline$assertLongEquals(1L << (32 - 1), Long.highestOneBit((1L << 32) - 1L));
+        $noinline$assertLongEquals(1L << (33 - 1), Long.highestOneBit((1L << 33) - 1L));
+        $noinline$assertLongEquals(1L << (34 - 1), Long.highestOneBit((1L << 34) - 1L));
+        $noinline$assertLongEquals(1L << (35 - 1), Long.highestOneBit((1L << 35) - 1L));
+        $noinline$assertLongEquals(1L << (36 - 1), Long.highestOneBit((1L << 36) - 1L));
+        $noinline$assertLongEquals(1L << (37 - 1), Long.highestOneBit((1L << 37) - 1L));
+        $noinline$assertLongEquals(1L << (38 - 1), Long.highestOneBit((1L << 38) - 1L));
+        $noinline$assertLongEquals(1L << (39 - 1), Long.highestOneBit((1L << 39) - 1L));
+        $noinline$assertLongEquals(1L << (40 - 1), Long.highestOneBit((1L << 40) - 1L));
+        $noinline$assertLongEquals(1L << (41 - 1), Long.highestOneBit((1L << 41) - 1L));
+        $noinline$assertLongEquals(1L << (42 - 1), Long.highestOneBit((1L << 42) - 1L));
+        $noinline$assertLongEquals(1L << (43 - 1), Long.highestOneBit((1L << 43) - 1L));
+        $noinline$assertLongEquals(1L << (44 - 1), Long.highestOneBit((1L << 44) - 1L));
+        $noinline$assertLongEquals(1L << (45 - 1), Long.highestOneBit((1L << 45) - 1L));
+        $noinline$assertLongEquals(1L << (46 - 1), Long.highestOneBit((1L << 46) - 1L));
+        $noinline$assertLongEquals(1L << (47 - 1), Long.highestOneBit((1L << 47) - 1L));
+        $noinline$assertLongEquals(1L << (48 - 1), Long.highestOneBit((1L << 48) - 1L));
+        $noinline$assertLongEquals(1L << (49 - 1), Long.highestOneBit((1L << 49) - 1L));
+        $noinline$assertLongEquals(1L << (50 - 1), Long.highestOneBit((1L << 50) - 1L));
+        $noinline$assertLongEquals(1L << (51 - 1), Long.highestOneBit((1L << 51) - 1L));
+        $noinline$assertLongEquals(1L << (52 - 1), Long.highestOneBit((1L << 52) - 1L));
+        $noinline$assertLongEquals(1L << (53 - 1), Long.highestOneBit((1L << 53) - 1L));
+        $noinline$assertLongEquals(1L << (54 - 1), Long.highestOneBit((1L << 54) - 1L));
+        $noinline$assertLongEquals(1L << (55 - 1), Long.highestOneBit((1L << 55) - 1L));
+        $noinline$assertLongEquals(1L << (56 - 1), Long.highestOneBit((1L << 56) - 1L));
+        $noinline$assertLongEquals(1L << (57 - 1), Long.highestOneBit((1L << 57) - 1L));
+        $noinline$assertLongEquals(1L << (58 - 1), Long.highestOneBit((1L << 58) - 1L));
+        $noinline$assertLongEquals(1L << (59 - 1), Long.highestOneBit((1L << 59) - 1L));
+        $noinline$assertLongEquals(1L << (60 - 1), Long.highestOneBit((1L << 60) - 1L));
+        $noinline$assertLongEquals(1L << (61 - 1), Long.highestOneBit((1L << 61) - 1L));
+        $noinline$assertLongEquals(1L << (62 - 1), Long.highestOneBit((1L << 62) - 1L));
+        $noinline$assertLongEquals(1L << (63 - 1), Long.highestOneBit((1L << 63) - 1L));
+    }
+
+    /// CHECK-START: void Main.$noinline$testLowestOneBitInt() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:IntegerLowestOneBit
+
+    /// CHECK-START: void Main.$noinline$testLowestOneBitInt() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:IntegerLowestOneBit
+    private static void $noinline$testLowestOneBitInt() {
+        $noinline$assertIntEquals(1, Integer.lowestOneBit(Integer.MAX_VALUE));
+        $noinline$assertIntEquals(1 << 31, Integer.lowestOneBit(Integer.MIN_VALUE));
+        $noinline$testHighestOneBitInt_powerOfTwo();
+        $noinline$testHighestOneBitInt_powerOfTwoMinusOne();
+    }
+
+    /// CHECK-START: void Main.$noinline$testLowestOneBitInt_powerOfTwo() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:IntegerLowestOneBit
+
+    /// CHECK-START: void Main.$noinline$testLowestOneBitInt_powerOfTwo() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:IntegerLowestOneBit
+    private static void $noinline$testLowestOneBitInt_powerOfTwo() {
+        $noinline$assertIntEquals(0, Integer.lowestOneBit(0));
+        $noinline$assertIntEquals(1 << 0, Integer.lowestOneBit(1 << 0));
+        $noinline$assertIntEquals(1 << 1, Integer.lowestOneBit(1 << 1));
+        $noinline$assertIntEquals(1 << 2, Integer.lowestOneBit(1 << 2));
+        $noinline$assertIntEquals(1 << 3, Integer.lowestOneBit(1 << 3));
+        $noinline$assertIntEquals(1 << 4, Integer.lowestOneBit(1 << 4));
+        $noinline$assertIntEquals(1 << 5, Integer.lowestOneBit(1 << 5));
+        $noinline$assertIntEquals(1 << 6, Integer.lowestOneBit(1 << 6));
+        $noinline$assertIntEquals(1 << 7, Integer.lowestOneBit(1 << 7));
+        $noinline$assertIntEquals(1 << 8, Integer.lowestOneBit(1 << 8));
+        $noinline$assertIntEquals(1 << 9, Integer.lowestOneBit(1 << 9));
+        $noinline$assertIntEquals(1 << 10, Integer.lowestOneBit(1 << 10));
+        $noinline$assertIntEquals(1 << 11, Integer.lowestOneBit(1 << 11));
+        $noinline$assertIntEquals(1 << 12, Integer.lowestOneBit(1 << 12));
+        $noinline$assertIntEquals(1 << 13, Integer.lowestOneBit(1 << 13));
+        $noinline$assertIntEquals(1 << 14, Integer.lowestOneBit(1 << 14));
+        $noinline$assertIntEquals(1 << 15, Integer.lowestOneBit(1 << 15));
+        $noinline$assertIntEquals(1 << 16, Integer.lowestOneBit(1 << 16));
+        $noinline$assertIntEquals(1 << 17, Integer.lowestOneBit(1 << 17));
+        $noinline$assertIntEquals(1 << 18, Integer.lowestOneBit(1 << 18));
+        $noinline$assertIntEquals(1 << 19, Integer.lowestOneBit(1 << 19));
+        $noinline$assertIntEquals(1 << 20, Integer.lowestOneBit(1 << 20));
+        $noinline$assertIntEquals(1 << 21, Integer.lowestOneBit(1 << 21));
+        $noinline$assertIntEquals(1 << 22, Integer.lowestOneBit(1 << 22));
+        $noinline$assertIntEquals(1 << 23, Integer.lowestOneBit(1 << 23));
+        $noinline$assertIntEquals(1 << 24, Integer.lowestOneBit(1 << 24));
+        $noinline$assertIntEquals(1 << 25, Integer.lowestOneBit(1 << 25));
+        $noinline$assertIntEquals(1 << 26, Integer.lowestOneBit(1 << 26));
+        $noinline$assertIntEquals(1 << 27, Integer.lowestOneBit(1 << 27));
+        $noinline$assertIntEquals(1 << 28, Integer.lowestOneBit(1 << 28));
+        $noinline$assertIntEquals(1 << 29, Integer.lowestOneBit(1 << 29));
+        $noinline$assertIntEquals(1 << 30, Integer.lowestOneBit(1 << 30));
+        $noinline$assertIntEquals(1 << 31, Integer.lowestOneBit(1 << 31));
+    }
+
+    /// CHECK-START: void Main.$noinline$testLowestOneBitInt_powerOfTwoMinusOne() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:IntegerLowestOneBit
+
+    /// CHECK-START: void Main.$noinline$testLowestOneBitInt_powerOfTwoMinusOne() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:IntegerLowestOneBit
+    private static void $noinline$testLowestOneBitInt_powerOfTwoMinusOne() {
+        // We start on `(1 << 2) - 1` (i.e. `3`) as the other values are already being tested.
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 2) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 3) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 4) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 5) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 6) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 7) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 8) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 9) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 10) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 11) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 12) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 13) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 14) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 15) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 16) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 17) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 18) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 19) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 20) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 21) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 22) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 23) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 24) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 25) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 26) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 27) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 28) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 29) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 30) - 1));
+        $noinline$assertIntEquals(1, Integer.lowestOneBit((1 << 31) - 1));
+    }
+
+    /// CHECK-START: void Main.$noinline$testLowestOneBitLong() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongLowestOneBit
+
+    /// CHECK-START: void Main.$noinline$testLowestOneBitLong() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongLowestOneBit
+    private static void $noinline$testLowestOneBitLong() {
+        $noinline$assertLongEquals(1L, Long.lowestOneBit(Long.MAX_VALUE));
+        $noinline$assertLongEquals(1L << 63, Long.lowestOneBit(Long.MIN_VALUE));
+        // We need to do two smaller methods because otherwise we don't compile it due to our
+        // heuristics.
+        $noinline$testLowestOneBitLongFirst32_powerOfTwo();
+        $noinline$testLowestOneBitLongLast32_powerOfTwo();
+        $noinline$testLowestOneBitLongFirst32_powerOfTwoMinusOne();
+        $noinline$testLowestOneBitLongLast32_powerOfTwoMinusOne();
+    }
+
+    /// CHECK-START: void Main.$noinline$testLowestOneBitLongFirst32_powerOfTwo() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongLowestOneBit
+
+    /// CHECK-START: void Main.$noinline$testLowestOneBitLongFirst32_powerOfTwo() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongLowestOneBit
+    private static void $noinline$testLowestOneBitLongFirst32_powerOfTwo() {
+        $noinline$assertLongEquals(0L, Long.lowestOneBit(0L));
+        $noinline$assertLongEquals(1L << 0L, Long.lowestOneBit(1L << 0L));
+        $noinline$assertLongEquals(1L << 1L, Long.lowestOneBit(1L << 1L));
+        $noinline$assertLongEquals(1L << 2L, Long.lowestOneBit(1L << 2L));
+        $noinline$assertLongEquals(1L << 3L, Long.lowestOneBit(1L << 3L));
+        $noinline$assertLongEquals(1L << 4L, Long.lowestOneBit(1L << 4L));
+        $noinline$assertLongEquals(1L << 5L, Long.lowestOneBit(1L << 5L));
+        $noinline$assertLongEquals(1L << 6L, Long.lowestOneBit(1L << 6L));
+        $noinline$assertLongEquals(1L << 7L, Long.lowestOneBit(1L << 7L));
+        $noinline$assertLongEquals(1L << 8L, Long.lowestOneBit(1L << 8L));
+        $noinline$assertLongEquals(1L << 9L, Long.lowestOneBit(1L << 9L));
+        $noinline$assertLongEquals(1L << 10L, Long.lowestOneBit(1L << 10L));
+        $noinline$assertLongEquals(1L << 11L, Long.lowestOneBit(1L << 11L));
+        $noinline$assertLongEquals(1L << 12L, Long.lowestOneBit(1L << 12L));
+        $noinline$assertLongEquals(1L << 13L, Long.lowestOneBit(1L << 13L));
+        $noinline$assertLongEquals(1L << 14L, Long.lowestOneBit(1L << 14L));
+        $noinline$assertLongEquals(1L << 15L, Long.lowestOneBit(1L << 15L));
+        $noinline$assertLongEquals(1L << 16L, Long.lowestOneBit(1L << 16L));
+        $noinline$assertLongEquals(1L << 17L, Long.lowestOneBit(1L << 17L));
+        $noinline$assertLongEquals(1L << 18L, Long.lowestOneBit(1L << 18L));
+        $noinline$assertLongEquals(1L << 19L, Long.lowestOneBit(1L << 19L));
+        $noinline$assertLongEquals(1L << 20L, Long.lowestOneBit(1L << 20L));
+        $noinline$assertLongEquals(1L << 21L, Long.lowestOneBit(1L << 21L));
+        $noinline$assertLongEquals(1L << 22L, Long.lowestOneBit(1L << 22L));
+        $noinline$assertLongEquals(1L << 23L, Long.lowestOneBit(1L << 23L));
+        $noinline$assertLongEquals(1L << 24L, Long.lowestOneBit(1L << 24L));
+        $noinline$assertLongEquals(1L << 25L, Long.lowestOneBit(1L << 25L));
+        $noinline$assertLongEquals(1L << 26L, Long.lowestOneBit(1L << 26L));
+        $noinline$assertLongEquals(1L << 27L, Long.lowestOneBit(1L << 27L));
+        $noinline$assertLongEquals(1L << 28L, Long.lowestOneBit(1L << 28L));
+        $noinline$assertLongEquals(1L << 29L, Long.lowestOneBit(1L << 29L));
+        $noinline$assertLongEquals(1L << 30L, Long.lowestOneBit(1L << 30L));
+    }
+
+    /// CHECK-START: void Main.$noinline$testLowestOneBitLongLast32_powerOfTwo() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongLowestOneBit
+
+    /// CHECK-START: void Main.$noinline$testLowestOneBitLongLast32_powerOfTwo() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongLowestOneBit
+    private static void $noinline$testLowestOneBitLongLast32_powerOfTwo() {
+        $noinline$assertLongEquals(1L << 31L, Long.lowestOneBit(1L << 31L));
+        $noinline$assertLongEquals(1L << 32L, Long.lowestOneBit(1L << 32L));
+        $noinline$assertLongEquals(1L << 33L, Long.lowestOneBit(1L << 33L));
+        $noinline$assertLongEquals(1L << 34L, Long.lowestOneBit(1L << 34L));
+        $noinline$assertLongEquals(1L << 35L, Long.lowestOneBit(1L << 35L));
+        $noinline$assertLongEquals(1L << 36L, Long.lowestOneBit(1L << 36L));
+        $noinline$assertLongEquals(1L << 37L, Long.lowestOneBit(1L << 37L));
+        $noinline$assertLongEquals(1L << 38L, Long.lowestOneBit(1L << 38L));
+        $noinline$assertLongEquals(1L << 39L, Long.lowestOneBit(1L << 39L));
+        $noinline$assertLongEquals(1L << 40L, Long.lowestOneBit(1L << 40L));
+        $noinline$assertLongEquals(1L << 41L, Long.lowestOneBit(1L << 41L));
+        $noinline$assertLongEquals(1L << 42L, Long.lowestOneBit(1L << 42L));
+        $noinline$assertLongEquals(1L << 43L, Long.lowestOneBit(1L << 43L));
+        $noinline$assertLongEquals(1L << 44L, Long.lowestOneBit(1L << 44L));
+        $noinline$assertLongEquals(1L << 45L, Long.lowestOneBit(1L << 45L));
+        $noinline$assertLongEquals(1L << 46L, Long.lowestOneBit(1L << 46L));
+        $noinline$assertLongEquals(1L << 47L, Long.lowestOneBit(1L << 47L));
+        $noinline$assertLongEquals(1L << 48L, Long.lowestOneBit(1L << 48L));
+        $noinline$assertLongEquals(1L << 49L, Long.lowestOneBit(1L << 49L));
+        $noinline$assertLongEquals(1L << 50L, Long.lowestOneBit(1L << 50L));
+        $noinline$assertLongEquals(1L << 51L, Long.lowestOneBit(1L << 51L));
+        $noinline$assertLongEquals(1L << 52L, Long.lowestOneBit(1L << 52L));
+        $noinline$assertLongEquals(1L << 53L, Long.lowestOneBit(1L << 53L));
+        $noinline$assertLongEquals(1L << 54L, Long.lowestOneBit(1L << 54L));
+        $noinline$assertLongEquals(1L << 55L, Long.lowestOneBit(1L << 55L));
+        $noinline$assertLongEquals(1L << 56L, Long.lowestOneBit(1L << 56L));
+        $noinline$assertLongEquals(1L << 57L, Long.lowestOneBit(1L << 57L));
+        $noinline$assertLongEquals(1L << 58L, Long.lowestOneBit(1L << 58L));
+        $noinline$assertLongEquals(1L << 59L, Long.lowestOneBit(1L << 59L));
+        $noinline$assertLongEquals(1L << 60L, Long.lowestOneBit(1L << 60L));
+        $noinline$assertLongEquals(1L << 61L, Long.lowestOneBit(1L << 61L));
+        $noinline$assertLongEquals(1L << 62L, Long.lowestOneBit(1L << 62L));
+        $noinline$assertLongEquals(1L << 63L, Long.lowestOneBit(1L << 63L));
+    }
+
+    /// CHECK-START: void Main.$noinline$testLowestOneBitLongFirst32_powerOfTwoMinusOne() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongLowestOneBit
+
+    /// CHECK-START: void Main.$noinline$testLowestOneBitLongFirst32_powerOfTwoMinusOne() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongLowestOneBit
+    private static void $noinline$testLowestOneBitLongFirst32_powerOfTwoMinusOne() {
+        // We start on `(1L << 2) - 1` (i.e. `3L`) as the other values are already being tested.
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 2) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 3) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 4) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 5) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 6) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 7) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 8) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 9) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 10) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 11) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 12) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 13) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 14) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 15) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 16) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 17) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 18) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 19) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 20) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 21) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 22) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 23) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 24) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 25) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 26) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 27) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 28) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 29) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 30) - 1L));
+    }
+
+    /// CHECK-START: void Main.$noinline$testLowestOneBitLongLast32_powerOfTwoMinusOne() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongLowestOneBit
+
+    /// CHECK-START: void Main.$noinline$testLowestOneBitLongLast32_powerOfTwoMinusOne() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongLowestOneBit
+    private static void $noinline$testLowestOneBitLongLast32_powerOfTwoMinusOne() {
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 31) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 32) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 33) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 34) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 35) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 36) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 37) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 38) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 39) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 40) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 41) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 42) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 43) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 44) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 45) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 46) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 47) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 48) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 49) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 50) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 51) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 52) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 53) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 54) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 55) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 56) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 57) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 58) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 59) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 60) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 61) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 62) - 1L));
+        $noinline$assertLongEquals(1L, Long.lowestOneBit((1L << 63) - 1L));
+    }
+
+    /// CHECK-START: void Main.$noinline$testLeadingZerosInt() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:IntegerNumberOfLeadingZeros
+
+    /// CHECK-START: void Main.$noinline$testLeadingZerosInt() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:IntegerNumberOfLeadingZeros
+    private static void $noinline$testLeadingZerosInt() {
+        $noinline$assertIntEquals(1, Integer.numberOfLeadingZeros(Integer.MAX_VALUE));
+        $noinline$assertIntEquals(0, Integer.numberOfLeadingZeros(Integer.MIN_VALUE));
+        $noinline$assertIntEquals(32, Integer.numberOfLeadingZeros(0));
+        $noinline$assertIntEquals(31, Integer.numberOfLeadingZeros(1 << 0));
+        $noinline$assertIntEquals(30, Integer.numberOfLeadingZeros(1 << 1));
+        $noinline$assertIntEquals(29, Integer.numberOfLeadingZeros(1 << 2));
+        $noinline$assertIntEquals(28, Integer.numberOfLeadingZeros(1 << 3));
+        $noinline$assertIntEquals(27, Integer.numberOfLeadingZeros(1 << 4));
+        $noinline$assertIntEquals(26, Integer.numberOfLeadingZeros(1 << 5));
+        $noinline$assertIntEquals(25, Integer.numberOfLeadingZeros(1 << 6));
+        $noinline$assertIntEquals(24, Integer.numberOfLeadingZeros(1 << 7));
+        $noinline$assertIntEquals(23, Integer.numberOfLeadingZeros(1 << 8));
+        $noinline$assertIntEquals(22, Integer.numberOfLeadingZeros(1 << 9));
+        $noinline$assertIntEquals(21, Integer.numberOfLeadingZeros(1 << 10));
+        $noinline$assertIntEquals(20, Integer.numberOfLeadingZeros(1 << 11));
+        $noinline$assertIntEquals(19, Integer.numberOfLeadingZeros(1 << 12));
+        $noinline$assertIntEquals(18, Integer.numberOfLeadingZeros(1 << 13));
+        $noinline$assertIntEquals(17, Integer.numberOfLeadingZeros(1 << 14));
+        $noinline$assertIntEquals(16, Integer.numberOfLeadingZeros(1 << 15));
+        $noinline$assertIntEquals(15, Integer.numberOfLeadingZeros(1 << 16));
+        $noinline$assertIntEquals(14, Integer.numberOfLeadingZeros(1 << 17));
+        $noinline$assertIntEquals(13, Integer.numberOfLeadingZeros(1 << 18));
+        $noinline$assertIntEquals(12, Integer.numberOfLeadingZeros(1 << 19));
+        $noinline$assertIntEquals(11, Integer.numberOfLeadingZeros(1 << 20));
+        $noinline$assertIntEquals(10, Integer.numberOfLeadingZeros(1 << 21));
+        $noinline$assertIntEquals(9, Integer.numberOfLeadingZeros(1 << 22));
+        $noinline$assertIntEquals(8, Integer.numberOfLeadingZeros(1 << 23));
+        $noinline$assertIntEquals(7, Integer.numberOfLeadingZeros(1 << 24));
+        $noinline$assertIntEquals(6, Integer.numberOfLeadingZeros(1 << 25));
+        $noinline$assertIntEquals(5, Integer.numberOfLeadingZeros(1 << 26));
+        $noinline$assertIntEquals(4, Integer.numberOfLeadingZeros(1 << 27));
+        $noinline$assertIntEquals(3, Integer.numberOfLeadingZeros(1 << 28));
+        $noinline$assertIntEquals(2, Integer.numberOfLeadingZeros(1 << 29));
+        $noinline$assertIntEquals(1, Integer.numberOfLeadingZeros(1 << 30));
+        $noinline$assertIntEquals(0, Integer.numberOfLeadingZeros(1 << 31));
+    }
+
+    /// CHECK-START: void Main.$noinline$testLeadingZerosLong() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongNumberOfLeadingZeros
+
+    /// CHECK-START: void Main.$noinline$testLeadingZerosLong() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongNumberOfLeadingZeros
+    private static void $noinline$testLeadingZerosLong() {
+        $noinline$assertIntEquals(1, Long.numberOfLeadingZeros(Long.MAX_VALUE));
+        $noinline$assertIntEquals(0, Long.numberOfLeadingZeros(Long.MIN_VALUE));
+        // We need to do two smaller methods because otherwise we don't compile it due to our
+        // heuristics.
+        $noinline$testLeadingZerosLongFirst32();
+        $noinline$testLeadingZerosLongLast32();
+    }
+
+    /// CHECK-START: void Main.$noinline$testLeadingZerosLongFirst32() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongNumberOfLeadingZeros
+
+    /// CHECK-START: void Main.$noinline$testLeadingZerosLongFirst32() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongNumberOfLeadingZeros
+    private static void $noinline$testLeadingZerosLongFirst32() {
+        $noinline$assertIntEquals(64, Long.numberOfLeadingZeros(0L));
+        $noinline$assertIntEquals(63, Long.numberOfLeadingZeros(1L << 0L));
+        $noinline$assertIntEquals(62, Long.numberOfLeadingZeros(1L << 1L));
+        $noinline$assertIntEquals(61, Long.numberOfLeadingZeros(1L << 2L));
+        $noinline$assertIntEquals(60, Long.numberOfLeadingZeros(1L << 3L));
+        $noinline$assertIntEquals(59, Long.numberOfLeadingZeros(1L << 4L));
+        $noinline$assertIntEquals(58, Long.numberOfLeadingZeros(1L << 5L));
+        $noinline$assertIntEquals(57, Long.numberOfLeadingZeros(1L << 6L));
+        $noinline$assertIntEquals(56, Long.numberOfLeadingZeros(1L << 7L));
+        $noinline$assertIntEquals(55, Long.numberOfLeadingZeros(1L << 8L));
+        $noinline$assertIntEquals(54, Long.numberOfLeadingZeros(1L << 9L));
+        $noinline$assertIntEquals(53, Long.numberOfLeadingZeros(1L << 10L));
+        $noinline$assertIntEquals(52, Long.numberOfLeadingZeros(1L << 11L));
+        $noinline$assertIntEquals(51, Long.numberOfLeadingZeros(1L << 12L));
+        $noinline$assertIntEquals(50, Long.numberOfLeadingZeros(1L << 13L));
+        $noinline$assertIntEquals(49, Long.numberOfLeadingZeros(1L << 14L));
+        $noinline$assertIntEquals(48, Long.numberOfLeadingZeros(1L << 15L));
+        $noinline$assertIntEquals(47, Long.numberOfLeadingZeros(1L << 16L));
+        $noinline$assertIntEquals(46, Long.numberOfLeadingZeros(1L << 17L));
+        $noinline$assertIntEquals(45, Long.numberOfLeadingZeros(1L << 18L));
+        $noinline$assertIntEquals(44, Long.numberOfLeadingZeros(1L << 19L));
+        $noinline$assertIntEquals(43, Long.numberOfLeadingZeros(1L << 20L));
+        $noinline$assertIntEquals(42, Long.numberOfLeadingZeros(1L << 21L));
+        $noinline$assertIntEquals(41, Long.numberOfLeadingZeros(1L << 22L));
+        $noinline$assertIntEquals(40, Long.numberOfLeadingZeros(1L << 23L));
+        $noinline$assertIntEquals(39, Long.numberOfLeadingZeros(1L << 24L));
+        $noinline$assertIntEquals(38, Long.numberOfLeadingZeros(1L << 25L));
+        $noinline$assertIntEquals(37, Long.numberOfLeadingZeros(1L << 26L));
+        $noinline$assertIntEquals(36, Long.numberOfLeadingZeros(1L << 27L));
+        $noinline$assertIntEquals(35, Long.numberOfLeadingZeros(1L << 28L));
+        $noinline$assertIntEquals(34, Long.numberOfLeadingZeros(1L << 29L));
+        $noinline$assertIntEquals(33, Long.numberOfLeadingZeros(1L << 30L));
+    }
+
+    /// CHECK-START: void Main.$noinline$testLeadingZerosLongLast32() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongNumberOfLeadingZeros
+
+    /// CHECK-START: void Main.$noinline$testLeadingZerosLongLast32() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongNumberOfLeadingZeros
+    private static void $noinline$testLeadingZerosLongLast32() {
+        $noinline$assertIntEquals(32, Long.numberOfLeadingZeros(1L << 31L));
+        $noinline$assertIntEquals(31, Long.numberOfLeadingZeros(1L << 32L));
+        $noinline$assertIntEquals(30, Long.numberOfLeadingZeros(1L << 33L));
+        $noinline$assertIntEquals(29, Long.numberOfLeadingZeros(1L << 34L));
+        $noinline$assertIntEquals(28, Long.numberOfLeadingZeros(1L << 35L));
+        $noinline$assertIntEquals(27, Long.numberOfLeadingZeros(1L << 36L));
+        $noinline$assertIntEquals(26, Long.numberOfLeadingZeros(1L << 37L));
+        $noinline$assertIntEquals(25, Long.numberOfLeadingZeros(1L << 38L));
+        $noinline$assertIntEquals(24, Long.numberOfLeadingZeros(1L << 39L));
+        $noinline$assertIntEquals(23, Long.numberOfLeadingZeros(1L << 40L));
+        $noinline$assertIntEquals(22, Long.numberOfLeadingZeros(1L << 41L));
+        $noinline$assertIntEquals(21, Long.numberOfLeadingZeros(1L << 42L));
+        $noinline$assertIntEquals(20, Long.numberOfLeadingZeros(1L << 43L));
+        $noinline$assertIntEquals(19, Long.numberOfLeadingZeros(1L << 44L));
+        $noinline$assertIntEquals(18, Long.numberOfLeadingZeros(1L << 45L));
+        $noinline$assertIntEquals(17, Long.numberOfLeadingZeros(1L << 46L));
+        $noinline$assertIntEquals(16, Long.numberOfLeadingZeros(1L << 47L));
+        $noinline$assertIntEquals(15, Long.numberOfLeadingZeros(1L << 48L));
+        $noinline$assertIntEquals(14, Long.numberOfLeadingZeros(1L << 49L));
+        $noinline$assertIntEquals(13, Long.numberOfLeadingZeros(1L << 50L));
+        $noinline$assertIntEquals(12, Long.numberOfLeadingZeros(1L << 51L));
+        $noinline$assertIntEquals(11, Long.numberOfLeadingZeros(1L << 52L));
+        $noinline$assertIntEquals(10, Long.numberOfLeadingZeros(1L << 53L));
+        $noinline$assertIntEquals(9, Long.numberOfLeadingZeros(1L << 54L));
+        $noinline$assertIntEquals(8, Long.numberOfLeadingZeros(1L << 55L));
+        $noinline$assertIntEquals(7, Long.numberOfLeadingZeros(1L << 56L));
+        $noinline$assertIntEquals(6, Long.numberOfLeadingZeros(1L << 57L));
+        $noinline$assertIntEquals(5, Long.numberOfLeadingZeros(1L << 58L));
+        $noinline$assertIntEquals(4, Long.numberOfLeadingZeros(1L << 59L));
+        $noinline$assertIntEquals(3, Long.numberOfLeadingZeros(1L << 60L));
+        $noinline$assertIntEquals(2, Long.numberOfLeadingZeros(1L << 61L));
+        $noinline$assertIntEquals(1, Long.numberOfLeadingZeros(1L << 62L));
+        $noinline$assertIntEquals(0, Long.numberOfLeadingZeros(1L << 63L));
+    }
+
+    /// CHECK-START: void Main.$noinline$testTrailingZerosInt() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:IntegerNumberOfTrailingZeros
+
+    /// CHECK-START: void Main.$noinline$testTrailingZerosInt() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:IntegerNumberOfTrailingZeros
+    private static void $noinline$testTrailingZerosInt() {
+        $noinline$assertIntEquals(0, Integer.numberOfTrailingZeros(Integer.MAX_VALUE));
+        $noinline$assertIntEquals(31, Integer.numberOfTrailingZeros(Integer.MIN_VALUE));
+        $noinline$assertIntEquals(32, Integer.numberOfTrailingZeros(0));
+        $noinline$assertIntEquals(0, Integer.numberOfTrailingZeros(1 << 0));
+        $noinline$assertIntEquals(1, Integer.numberOfTrailingZeros(1 << 1));
+        $noinline$assertIntEquals(2, Integer.numberOfTrailingZeros(1 << 2));
+        $noinline$assertIntEquals(3, Integer.numberOfTrailingZeros(1 << 3));
+        $noinline$assertIntEquals(4, Integer.numberOfTrailingZeros(1 << 4));
+        $noinline$assertIntEquals(5, Integer.numberOfTrailingZeros(1 << 5));
+        $noinline$assertIntEquals(6, Integer.numberOfTrailingZeros(1 << 6));
+        $noinline$assertIntEquals(7, Integer.numberOfTrailingZeros(1 << 7));
+        $noinline$assertIntEquals(8, Integer.numberOfTrailingZeros(1 << 8));
+        $noinline$assertIntEquals(9, Integer.numberOfTrailingZeros(1 << 9));
+        $noinline$assertIntEquals(10, Integer.numberOfTrailingZeros(1 << 10));
+        $noinline$assertIntEquals(11, Integer.numberOfTrailingZeros(1 << 11));
+        $noinline$assertIntEquals(12, Integer.numberOfTrailingZeros(1 << 12));
+        $noinline$assertIntEquals(13, Integer.numberOfTrailingZeros(1 << 13));
+        $noinline$assertIntEquals(14, Integer.numberOfTrailingZeros(1 << 14));
+        $noinline$assertIntEquals(15, Integer.numberOfTrailingZeros(1 << 15));
+        $noinline$assertIntEquals(16, Integer.numberOfTrailingZeros(1 << 16));
+        $noinline$assertIntEquals(17, Integer.numberOfTrailingZeros(1 << 17));
+        $noinline$assertIntEquals(18, Integer.numberOfTrailingZeros(1 << 18));
+        $noinline$assertIntEquals(19, Integer.numberOfTrailingZeros(1 << 19));
+        $noinline$assertIntEquals(20, Integer.numberOfTrailingZeros(1 << 20));
+        $noinline$assertIntEquals(21, Integer.numberOfTrailingZeros(1 << 21));
+        $noinline$assertIntEquals(22, Integer.numberOfTrailingZeros(1 << 22));
+        $noinline$assertIntEquals(23, Integer.numberOfTrailingZeros(1 << 23));
+        $noinline$assertIntEquals(24, Integer.numberOfTrailingZeros(1 << 24));
+        $noinline$assertIntEquals(25, Integer.numberOfTrailingZeros(1 << 25));
+        $noinline$assertIntEquals(26, Integer.numberOfTrailingZeros(1 << 26));
+        $noinline$assertIntEquals(27, Integer.numberOfTrailingZeros(1 << 27));
+        $noinline$assertIntEquals(28, Integer.numberOfTrailingZeros(1 << 28));
+        $noinline$assertIntEquals(29, Integer.numberOfTrailingZeros(1 << 29));
+        $noinline$assertIntEquals(30, Integer.numberOfTrailingZeros(1 << 30));
+        $noinline$assertIntEquals(31, Integer.numberOfTrailingZeros(1 << 31));
+    }
+
+    /// CHECK-START: void Main.$noinline$testTrailingZerosLong() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongNumberOfTrailingZeros
+
+    /// CHECK-START: void Main.$noinline$testTrailingZerosLong() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongNumberOfTrailingZeros
+    private static void $noinline$testTrailingZerosLong() {
+        $noinline$assertIntEquals(0, Long.numberOfTrailingZeros(Long.MAX_VALUE));
+        $noinline$assertIntEquals(63, Long.numberOfTrailingZeros(Long.MIN_VALUE));
+        // We need to do two smaller methods because otherwise we don't compile it due to our
+        // heuristics.
+        $noinline$testTrailingZerosLongFirst32();
+        $noinline$testTrailingZerosLongLast32();
+    }
+
+    /// CHECK-START: void Main.$noinline$testTrailingZerosLongFirst32() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongNumberOfTrailingZeros
+
+    /// CHECK-START: void Main.$noinline$testTrailingZerosLongFirst32() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongNumberOfTrailingZeros
+    private static void $noinline$testTrailingZerosLongFirst32() {
+        $noinline$assertIntEquals(64, Long.numberOfTrailingZeros(0L));
+        $noinline$assertIntEquals(0, Long.numberOfTrailingZeros(1L << 0L));
+        $noinline$assertIntEquals(1, Long.numberOfTrailingZeros(1L << 1L));
+        $noinline$assertIntEquals(2, Long.numberOfTrailingZeros(1L << 2L));
+        $noinline$assertIntEquals(3, Long.numberOfTrailingZeros(1L << 3L));
+        $noinline$assertIntEquals(4, Long.numberOfTrailingZeros(1L << 4L));
+        $noinline$assertIntEquals(5, Long.numberOfTrailingZeros(1L << 5L));
+        $noinline$assertIntEquals(6, Long.numberOfTrailingZeros(1L << 6L));
+        $noinline$assertIntEquals(7, Long.numberOfTrailingZeros(1L << 7L));
+        $noinline$assertIntEquals(8, Long.numberOfTrailingZeros(1L << 8L));
+        $noinline$assertIntEquals(9, Long.numberOfTrailingZeros(1L << 9L));
+        $noinline$assertIntEquals(10, Long.numberOfTrailingZeros(1L << 10L));
+        $noinline$assertIntEquals(11, Long.numberOfTrailingZeros(1L << 11L));
+        $noinline$assertIntEquals(12, Long.numberOfTrailingZeros(1L << 12L));
+        $noinline$assertIntEquals(13, Long.numberOfTrailingZeros(1L << 13L));
+        $noinline$assertIntEquals(14, Long.numberOfTrailingZeros(1L << 14L));
+        $noinline$assertIntEquals(15, Long.numberOfTrailingZeros(1L << 15L));
+        $noinline$assertIntEquals(16, Long.numberOfTrailingZeros(1L << 16L));
+        $noinline$assertIntEquals(17, Long.numberOfTrailingZeros(1L << 17L));
+        $noinline$assertIntEquals(18, Long.numberOfTrailingZeros(1L << 18L));
+        $noinline$assertIntEquals(19, Long.numberOfTrailingZeros(1L << 19L));
+        $noinline$assertIntEquals(20, Long.numberOfTrailingZeros(1L << 20L));
+        $noinline$assertIntEquals(21, Long.numberOfTrailingZeros(1L << 21L));
+        $noinline$assertIntEquals(22, Long.numberOfTrailingZeros(1L << 22L));
+        $noinline$assertIntEquals(23, Long.numberOfTrailingZeros(1L << 23L));
+        $noinline$assertIntEquals(24, Long.numberOfTrailingZeros(1L << 24L));
+        $noinline$assertIntEquals(25, Long.numberOfTrailingZeros(1L << 25L));
+        $noinline$assertIntEquals(26, Long.numberOfTrailingZeros(1L << 26L));
+        $noinline$assertIntEquals(27, Long.numberOfTrailingZeros(1L << 27L));
+        $noinline$assertIntEquals(28, Long.numberOfTrailingZeros(1L << 28L));
+        $noinline$assertIntEquals(29, Long.numberOfTrailingZeros(1L << 29L));
+        $noinline$assertIntEquals(30, Long.numberOfTrailingZeros(1L << 30L));
+        $noinline$assertIntEquals(31, Long.numberOfTrailingZeros(1L << 31L));
+    }
+
+    /// CHECK-START: void Main.$noinline$testTrailingZerosLongLast32() constant_folding (before)
+    /// CHECK-DAG: InvokeStaticOrDirect intrinsic:LongNumberOfTrailingZeros
+
+    /// CHECK-START: void Main.$noinline$testTrailingZerosLongLast32() constant_folding (after)
+    /// CHECK-NOT: InvokeStaticOrDirect intrinsic:LongNumberOfTrailingZeros
+    private static void $noinline$testTrailingZerosLongLast32() {
+        $noinline$assertIntEquals(32, Long.numberOfTrailingZeros(1L << 32L));
+        $noinline$assertIntEquals(33, Long.numberOfTrailingZeros(1L << 33L));
+        $noinline$assertIntEquals(34, Long.numberOfTrailingZeros(1L << 34L));
+        $noinline$assertIntEquals(35, Long.numberOfTrailingZeros(1L << 35L));
+        $noinline$assertIntEquals(36, Long.numberOfTrailingZeros(1L << 36L));
+        $noinline$assertIntEquals(37, Long.numberOfTrailingZeros(1L << 37L));
+        $noinline$assertIntEquals(38, Long.numberOfTrailingZeros(1L << 38L));
+        $noinline$assertIntEquals(39, Long.numberOfTrailingZeros(1L << 39L));
+        $noinline$assertIntEquals(40, Long.numberOfTrailingZeros(1L << 40L));
+        $noinline$assertIntEquals(41, Long.numberOfTrailingZeros(1L << 41L));
+        $noinline$assertIntEquals(42, Long.numberOfTrailingZeros(1L << 42L));
+        $noinline$assertIntEquals(43, Long.numberOfTrailingZeros(1L << 43L));
+        $noinline$assertIntEquals(44, Long.numberOfTrailingZeros(1L << 44L));
+        $noinline$assertIntEquals(45, Long.numberOfTrailingZeros(1L << 45L));
+        $noinline$assertIntEquals(46, Long.numberOfTrailingZeros(1L << 46L));
+        $noinline$assertIntEquals(47, Long.numberOfTrailingZeros(1L << 47L));
+        $noinline$assertIntEquals(48, Long.numberOfTrailingZeros(1L << 48L));
+        $noinline$assertIntEquals(49, Long.numberOfTrailingZeros(1L << 49L));
+        $noinline$assertIntEquals(50, Long.numberOfTrailingZeros(1L << 50L));
+        $noinline$assertIntEquals(51, Long.numberOfTrailingZeros(1L << 51L));
+        $noinline$assertIntEquals(52, Long.numberOfTrailingZeros(1L << 52L));
+        $noinline$assertIntEquals(53, Long.numberOfTrailingZeros(1L << 53L));
+        $noinline$assertIntEquals(54, Long.numberOfTrailingZeros(1L << 54L));
+        $noinline$assertIntEquals(55, Long.numberOfTrailingZeros(1L << 55L));
+        $noinline$assertIntEquals(56, Long.numberOfTrailingZeros(1L << 56L));
+        $noinline$assertIntEquals(57, Long.numberOfTrailingZeros(1L << 57L));
+        $noinline$assertIntEquals(58, Long.numberOfTrailingZeros(1L << 58L));
+        $noinline$assertIntEquals(59, Long.numberOfTrailingZeros(1L << 59L));
+        $noinline$assertIntEquals(60, Long.numberOfTrailingZeros(1L << 60L));
+        $noinline$assertIntEquals(61, Long.numberOfTrailingZeros(1L << 61L));
+        $noinline$assertIntEquals(62, Long.numberOfTrailingZeros(1L << 62L));
+        $noinline$assertIntEquals(63, Long.numberOfTrailingZeros(1L << 63L));
+    }
+
+    public static void $noinline$assertIntEquals(int expected, int result) {
+        if (expected != result) {
+            throw new Error("Expected: " + expected + ", found: " + result);
+        }
+    }
+
+    public static void $noinline$assertLongEquals(long expected, long result) {
+        if (expected != result) {
+            throw new Error("Expected: " + expected + ", found: " + result);
+        }
+    }
+
+    public static void $noinline$assertShortEquals(short expected, short result) {
+        if (expected != result) {
+            throw new Error("Expected: " + expected + ", found: " + result);
+        }
+    }
+}
diff --git a/test/2270-mh-internal-hiddenapi-use/Android.bp b/test/2270-mh-internal-hiddenapi-use/Android.bp
new file mode 100644
index 0000000..ad6b52c
--- /dev/null
+++ b/test/2270-mh-internal-hiddenapi-use/Android.bp
@@ -0,0 +1,40 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `2270-mh-internal-hiddenapi-use`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-2270-mh-internal-hiddenapi-use",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-no-test-suite-tag-template",
+    srcs: ["src-art/**/*.java"],
+    data: [
+        ":art-run-test-2270-mh-internal-hiddenapi-use-expected-stdout",
+        ":art-run-test-2270-mh-internal-hiddenapi-use-expected-stderr",
+    ],
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-2270-mh-internal-hiddenapi-use-expected-stdout",
+    out: ["art-run-test-2270-mh-internal-hiddenapi-use-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-2270-mh-internal-hiddenapi-use-expected-stderr",
+    out: ["art-run-test-2270-mh-internal-hiddenapi-use-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/test/015-switch/expected-stderr.txt b/test/2270-mh-internal-hiddenapi-use/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2270-mh-internal-hiddenapi-use/expected-stderr.txt
diff --git a/test/015-switch/expected-stderr.txt b/test/2270-mh-internal-hiddenapi-use/expected-stdout.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2270-mh-internal-hiddenapi-use/expected-stdout.txt
diff --git a/test/2270-mh-internal-hiddenapi-use/info.txt b/test/2270-mh-internal-hiddenapi-use/info.txt
new file mode 100644
index 0000000..096e9a4
--- /dev/null
+++ b/test/2270-mh-internal-hiddenapi-use/info.txt
@@ -0,0 +1,2 @@
+MethodHandles.identity is calling findStatic, which
+tries to find hidden "identity(primitive)" methods reflectively.
diff --git a/test/2270-mh-internal-hiddenapi-use/mh-internal-hidden-api.cc b/test/2270-mh-internal-hiddenapi-use/mh-internal-hidden-api.cc
new file mode 100644
index 0000000..6f91f63
--- /dev/null
+++ b/test/2270-mh-internal-hiddenapi-use/mh-internal-hidden-api.cc
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "base/sdk_version.h"
+#include "dex/art_dex_file_loader.h"
+#include "hidden_api.h"
+#include "jni.h"
+#include "runtime.h"
+#include "ti-agent/scoped_utf_chars.h"
+
+namespace art {
+
+extern "C" JNIEXPORT void JNICALL Java_Main_enableHiddenApiChecks(JNIEnv*, jclass) {
+  Runtime* runtime = Runtime::Current();
+  runtime->SetHiddenApiEnforcementPolicy(hiddenapi::EnforcementPolicy::kEnabled);
+}
+
+}  // namespace art
diff --git a/test/2270-mh-internal-hiddenapi-use/run.py b/test/2270-mh-internal-hiddenapi-use/run.py
new file mode 100644
index 0000000..4c3cfdf
--- /dev/null
+++ b/test/2270-mh-internal-hiddenapi-use/run.py
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def run(ctx, args):
+  ctx.default_run(args, verify_soft_fail=True)
+
+  ctx.run(fr"sed -i -E '/(JNI_OnLoad|JNI_OnUnload)/d' '{args.stdout_file}'")
diff --git a/test/2270-mh-internal-hiddenapi-use/src-art/Main.java b/test/2270-mh-internal-hiddenapi-use/src-art/Main.java
new file mode 100644
index 0000000..6d2aec2
--- /dev/null
+++ b/test/2270-mh-internal-hiddenapi-use/src-art/Main.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.lang.invoke.*;
+import dalvik.system.VMRuntime;
+
+public class Main {
+    public static void main(String... args) throws Throwable {
+        System.loadLibrary(args[0]);
+        enableHiddenApiChecks();
+        // MH.identity(...) methods were marked as hidden in aosp/321456.
+        VMRuntime.getRuntime().setTargetSdkVersion(28);
+
+        MethodHandle intIdentity = MethodHandles.identity(int.class);
+
+        int value = 42;
+        int returnedValue = (int) intIdentity.invokeExact(value);
+
+        if (returnedValue != value) {
+            System.out.printf("Expected: %d, but identity MH returned %d\n",
+                value, returnedValue);
+            throw new AssertionError("identity fail");
+        }
+
+        value = 101;
+        MethodHandle intConstant = MethodHandles.constant(int.class, value);
+        returnedValue = (int) intConstant.invokeExact();
+
+        if (returnedValue != value) {
+            System.out.printf("Expected: %d, but constant MH returned %d\n",
+                value, returnedValue);
+            throw new AssertionError("constant failed");
+        }
+
+        int secondCallValue = (int) intConstant.invokeExact();
+        if (secondCallValue != value) {
+            System.out.printf("Expected: %d, but constant MH returned %d on subsequent call\n",
+                value, returnedValue);
+            throw new AssertionError("constant failed");
+        }
+    }
+
+    private static native void enableHiddenApiChecks();
+}
diff --git a/test/2271-profile-inline-cache/Android.bp b/test/2271-profile-inline-cache/Android.bp
new file mode 100644
index 0000000..76faaf1
--- /dev/null
+++ b/test/2271-profile-inline-cache/Android.bp
@@ -0,0 +1,40 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `2271-profile-inline-cache`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-2271-profile-inline-cache",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-no-test-suite-tag-template",
+    srcs: ["src/**/*.java"],
+    data: [
+        ":art-run-test-2271-profile-inline-cache-expected-stdout",
+        ":art-run-test-2271-profile-inline-cache-expected-stderr",
+    ],
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-2271-profile-inline-cache-expected-stdout",
+    out: ["art-run-test-2271-profile-inline-cache-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-2271-profile-inline-cache-expected-stderr",
+    out: ["art-run-test-2271-profile-inline-cache-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/test/015-switch/expected-stderr.txt b/test/2271-profile-inline-cache/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2271-profile-inline-cache/expected-stderr.txt
diff --git a/test/2271-profile-inline-cache/expected-stdout.txt b/test/2271-profile-inline-cache/expected-stdout.txt
new file mode 100644
index 0000000..6a5618e
--- /dev/null
+++ b/test/2271-profile-inline-cache/expected-stdout.txt
@@ -0,0 +1 @@
+JNI_OnLoad called
diff --git a/test/2271-profile-inline-cache/info.txt b/test/2271-profile-inline-cache/info.txt
new file mode 100644
index 0000000..4867c4b
--- /dev/null
+++ b/test/2271-profile-inline-cache/info.txt
@@ -0,0 +1 @@
+Check that inline caches are saved in the profile.
diff --git a/test/2271-profile-inline-cache/run.py b/test/2271-profile-inline-cache/run.py
new file mode 100644
index 0000000..e77119e
--- /dev/null
+++ b/test/2271-profile-inline-cache/run.py
@@ -0,0 +1,30 @@
+#
+# Copyright 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def run(ctx, args):
+  # Use
+  # --compiler-filter=verify to make sure that the test is not compiled AOT
+  # and to make sure the test is not compiled when loaded (by PathClassLoader)
+  # -Xjitsaveprofilinginfo to enable profile saving
+  # -Xjitinitialsize:32M to prevent profiling info creation failure.
+  ctx.default_run(
+      args,
+      Xcompiler_option=["--compiler-filter=verify"],
+      runtime_option=[
+          "-Xjitinitialsize:32M",
+          "-Xjitsaveprofilinginfo",
+          "-Xps-inline-cache-threshold:3000",
+      ])
diff --git a/test/2271-profile-inline-cache/src/Main.java b/test/2271-profile-inline-cache/src/Main.java
new file mode 100644
index 0000000..a95d4ac
--- /dev/null
+++ b/test/2271-profile-inline-cache/src/Main.java
@@ -0,0 +1,249 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.stream.Collectors;
+
+public class Main {
+    private static File sFile = null;
+    private static Method sMethod1 = null;
+    private static Method sMethod2 = null;
+    private static Method sMethod3 = null;
+    private static Method sMethod4 = null;
+
+    public static void main(String[] args) throws Exception {
+        System.loadLibrary(args[0]);
+
+        if (!hasJit()) {
+            // Test requires JIT for creating profiling infos.
+            return;
+        }
+
+        sMethod1 = Main.class.getDeclaredMethod("$noinline$method1", Base.class);
+        sMethod2 = Main.class.getDeclaredMethod("$noinline$method2", Base.class);
+        sMethod3 = Main.class.getDeclaredMethod("$noinline$method3", Base.class);
+        sMethod4 = Main.class.getDeclaredMethod("$noinline$method4", Base.class);
+
+        sFile = createTempFile();
+        sFile.deleteOnExit();
+        String codePath = System.getenv("DEX_LOCATION") + "/2271-profile-inline-cache.jar";
+        VMRuntime.registerAppInfo("test.app", sFile.getPath(), sFile.getPath(),
+                new String[] {codePath}, VMRuntime.CODE_PATH_TYPE_PRIMARY_APK);
+
+        for (int i = 0; i < 10; i++) {
+            try {
+                test();
+                return;
+            } catch (ScopedAssertNoGc.NoGcAssertionFailure e) {
+                // This should rarely happen. When it happens, reset the state, delete the profile,
+                // and try again.
+                reset();
+                sFile.delete();
+            }
+        }
+
+        // The possibility of hitting this line only exists in theory, unless the test is wrong.
+        throw new RuntimeException("NoGcAssertionFailure occurred 10 times");
+    }
+
+    private static void test() throws Exception {
+        Derived1 derived1 = new Derived1();
+        Derived2 derived2 = new Derived2();
+
+        // This method is below the inline cache threshold.
+        ensureJitBaselineCompiled(sMethod1);
+        try (ScopedAssertNoGc noGc = new ScopedAssertNoGc()) {
+            $noinline$method1(derived1);
+            for (int i = 0; i < 2998; i++) {
+                $noinline$method1(derived2);
+            }
+        }
+        checkMethodHasNoInlineCache(sFile, sMethod1);
+
+        // This method is right on the inline cache threshold.
+        ensureJitBaselineCompiled(sMethod2);
+        try (ScopedAssertNoGc noGc = new ScopedAssertNoGc()) {
+            $noinline$method2(derived1);
+            for (int i = 0; i < 2999; i++) {
+                $noinline$method2(derived2);
+            }
+        }
+        checkMethodHasInlineCache(sFile, sMethod2, Derived1.class, Derived2.class);
+
+        // This method is above the inline cache threshold.
+        ensureJitBaselineCompiled(sMethod3);
+        try (ScopedAssertNoGc noGc = new ScopedAssertNoGc()) {
+            for (int i = 0; i < 10000; i++) {
+                $noinline$method3(derived1);
+            }
+            for (int i = 0; i < 10000; i++) {
+                $noinline$method3(derived2);
+            }
+        }
+        checkMethodHasInlineCache(sFile, sMethod3, Derived1.class, Derived2.class);
+
+        // This method is above the JIT threshold.
+        ensureJitBaselineCompiled(sMethod4);
+        try (ScopedAssertNoGc noGc = new ScopedAssertNoGc()) {
+            $noinline$method4(derived1);
+            $noinline$method4(derived2);
+        }
+        ensureMethodJitCompiled(sMethod4);
+        checkMethodHasInlineCache(sFile, sMethod4, Derived1.class, Derived2.class);
+    }
+
+    private static void reset() {
+        removeJitCompiledMethod(sMethod1, false /* releaseMemory */);
+        removeJitCompiledMethod(sMethod2, false /* releaseMemory */);
+        removeJitCompiledMethod(sMethod3, false /* releaseMemory */);
+        removeJitCompiledMethod(sMethod4, false /* releaseMemory */);
+    }
+
+    public static void $noinline$method1(Base obj) {
+        obj.f();
+    }
+
+    public static void $noinline$method2(Base obj) {
+        obj.f();
+    }
+
+    public static void $noinline$method3(Base obj) {
+        obj.f();
+    }
+
+    public static void $noinline$method4(Base obj) {
+        obj.f();
+    }
+
+    public static class Base {
+        public void f() {}
+    }
+
+    public static class Derived1 extends Base {
+        @Override
+        public void f() {}
+    }
+
+    public static class Derived2 extends Base {
+        @Override
+        public void f() {}
+    }
+
+    private static void checkMethodHasInlineCache(File file, Method m, Class<?>... targetTypes) {
+        ensureProfileProcessing();
+        if (!hasInlineCacheInProfile(file.getPath(), m, targetTypes)) {
+            throw new RuntimeException("Expected method " + m
+                    + " to have inline cache in the profile with target types "
+                    + Arrays.stream(targetTypes)
+                              .map(Class::getName)
+                              .collect(Collectors.joining(", ")));
+        }
+    }
+
+    private static void checkMethodHasNoInlineCache(File file, Method m) {
+        ensureProfileProcessing();
+        if (hasInlineCacheInProfile(file.getPath(), m)) {
+            throw new RuntimeException(
+                    "Expected method " + m + " not to have inline cache in the profile");
+        }
+    }
+
+    public static void ensureJitBaselineCompiled(Method method) {
+        ensureJitBaselineCompiled(method.getDeclaringClass(), method.getName());
+    }
+    public static native void ensureMethodJitCompiled(Method method);
+    public static native void ensureJitBaselineCompiled(Class<?> cls, String methodName);
+    public static native void ensureProfileProcessing();
+    public static native boolean hasInlineCacheInProfile(
+            String profile, Method method, Class<?>... targetTypes);
+    public static native boolean hasJit();
+    public static native int getCurrentGcNum();
+    public static native boolean removeJitCompiledMethod(Method method, boolean releaseMemory);
+
+    private static final String TEMP_FILE_NAME_PREFIX = "temp";
+    private static final String TEMP_FILE_NAME_SUFFIX = "-file";
+
+    private static File createTempFile() throws Exception {
+        try {
+            return File.createTempFile(TEMP_FILE_NAME_PREFIX, TEMP_FILE_NAME_SUFFIX);
+        } catch (IOException e) {
+            System.setProperty("java.io.tmpdir", "/data/local/tmp");
+            try {
+                return File.createTempFile(TEMP_FILE_NAME_PREFIX, TEMP_FILE_NAME_SUFFIX);
+            } catch (IOException e2) {
+                System.setProperty("java.io.tmpdir", "/sdcard");
+                return File.createTempFile(TEMP_FILE_NAME_PREFIX, TEMP_FILE_NAME_SUFFIX);
+            }
+        }
+    }
+
+    private static class VMRuntime {
+        public static final int CODE_PATH_TYPE_PRIMARY_APK = 1 << 0;
+        private static final Method registerAppInfoMethod;
+
+        static {
+            try {
+                Class<? extends Object> c = Class.forName("dalvik.system.VMRuntime");
+                registerAppInfoMethod = c.getDeclaredMethod("registerAppInfo", String.class,
+                        String.class, String.class, String[].class, int.class);
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+        }
+
+        public static void registerAppInfo(String packageName, String curProfile, String refProfile,
+                String[] codePaths, int codePathsType) throws Exception {
+            registerAppInfoMethod.invoke(
+                    null, packageName, curProfile, refProfile, codePaths, codePathsType);
+        }
+    }
+
+    // This scope is intended to guard code that doesn't expect GC to take place. Because we can't
+    // really prevent GC in Java code (calling a native method that enters a GCCriticalSection will
+    // cause the runtime to hang forever when transitioning from native back to Java), this is a
+    // workaround that forces a GC at the beginning so that GC will unlikely take place within the
+    // scope. If a GC still takes place within the scope, this will throw NoGcAssertionFailure.
+    //
+    // The baseline code doesn't update the inline cache if we are marking, so we use this scope to
+    // guard calls to virtual methods for which we want inline cache to be updated.
+    private static class ScopedAssertNoGc implements AutoCloseable {
+        private final int mLastGcNum;
+
+        public ScopedAssertNoGc() {
+            System.gc();
+            mLastGcNum = getCurrentGcNum();
+        }
+
+        @Override
+        public void close() throws NoGcAssertionFailure {
+            int currentGcNum = getCurrentGcNum();
+            if (currentGcNum != mLastGcNum) {
+                throw new NoGcAssertionFailure(
+                        String.format("GC happened within the scope (before: %d, after: %d)",
+                                mLastGcNum, currentGcNum));
+            }
+        }
+
+        public static class NoGcAssertionFailure extends Exception {
+            public NoGcAssertionFailure(String message) {
+                super(message);
+            }
+        }
+    }
+}
diff --git a/test/2272-checker-codegen-honor-write-barrier-kind/Android.bp b/test/2272-checker-codegen-honor-write-barrier-kind/Android.bp
new file mode 100644
index 0000000..dc4292b
--- /dev/null
+++ b/test/2272-checker-codegen-honor-write-barrier-kind/Android.bp
@@ -0,0 +1,43 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `2272-checker-codegen-honor-write-barrier-kind`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-2272-checker-codegen-honor-write-barrier-kind",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-no-test-suite-tag-template",
+    srcs: ["src/**/*.java"],
+    data: [
+        ":art-run-test-2272-checker-codegen-honor-write-barrier-kind-expected-stdout",
+        ":art-run-test-2272-checker-codegen-honor-write-barrier-kind-expected-stderr",
+    ],
+    // Include the Java source files in the test's artifacts, to make Checker assertions
+    // available to the TradeFed test runner.
+    include_srcs: true,
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-2272-checker-codegen-honor-write-barrier-kind-expected-stdout",
+    out: ["art-run-test-2272-checker-codegen-honor-write-barrier-kind-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-2272-checker-codegen-honor-write-barrier-kind-expected-stderr",
+    out: ["art-run-test-2272-checker-codegen-honor-write-barrier-kind-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/test/015-switch/expected-stderr.txt b/test/2272-checker-codegen-honor-write-barrier-kind/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2272-checker-codegen-honor-write-barrier-kind/expected-stderr.txt
diff --git a/test/015-switch/expected-stderr.txt b/test/2272-checker-codegen-honor-write-barrier-kind/expected-stdout.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2272-checker-codegen-honor-write-barrier-kind/expected-stdout.txt
diff --git a/test/2272-checker-codegen-honor-write-barrier-kind/info.txt b/test/2272-checker-codegen-honor-write-barrier-kind/info.txt
new file mode 100644
index 0000000..455bb77
--- /dev/null
+++ b/test/2272-checker-codegen-honor-write-barrier-kind/info.txt
@@ -0,0 +1,3 @@
+Two regression tests:
+1) Regression test to honor the write barrier kind and set the dirty bit.
+2) Regression test for skipping a needed write barrier at runtime.
diff --git a/test/2272-checker-codegen-honor-write-barrier-kind/run.py b/test/2272-checker-codegen-honor-write-barrier-kind/run.py
new file mode 100644
index 0000000..ebdb9b5
--- /dev/null
+++ b/test/2272-checker-codegen-honor-write-barrier-kind/run.py
@@ -0,0 +1,19 @@
+#! /bin/bash
+#
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+def run(ctx, args):
+  # Limit the managed heap to 16 MiB to force more garbage collections.
+  ctx.default_run(args, runtime_option=["-Xmx16m"])
diff --git a/test/2272-checker-codegen-honor-write-barrier-kind/src/Main.java b/test/2272-checker-codegen-honor-write-barrier-kind/src/Main.java
new file mode 100644
index 0000000..7d67249
--- /dev/null
+++ b/test/2272-checker-codegen-honor-write-barrier-kind/src/Main.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class Main {
+    public static void main(String[] args) {
+        $noinline$testHonorWriteBarrier();
+        $noinline$testDontSkipWriteBarrier();
+    }
+
+    public static void $noinline$testHonorWriteBarrier() {
+        String[] arr = {"Hello", "World"};
+        // We first run the gc to make sure the card is clean.
+        Runtime.getRuntime().gc();
+        // Continually call $noinline$testArraySetsHonorWriteBarrier while allocating over 64 MiB of
+        // memory (with heap size limited to 16 MiB), in order to increase memory pressure and
+        // eventually trigger a concurrent garbage collection, which will start by putting the GC in
+        // marking mode to trigger the bug.
+        for (int i = 0; i != 64 * 1024; ++i) {
+            $noinline$allocateAtLeast1KiB();
+            $noinline$testArraySetsHonorWriteBarrier(arr, "Universe");
+        }
+    }
+
+    // When the bug was present, $noinline$testArraySetsHonorWriteBarrier would never set the card
+    // as dirty (which is incorrect). arr[1]'s' write barrier depends on arr[0]'s write barrier. The
+    // disappeared BoundType in prepare_for_register_allocation shouldn't skip marking the card
+    // dirty.
+
+    /// CHECK-START: java.lang.String[] Main.$noinline$testArraySetsHonorWriteBarrier(java.lang.String[], java.lang.String) prepare_for_register_allocation (before)
+    /// CHECK: <<Null:l\d+>>   NullConstant
+    /// CHECK: <<BT:l\d+>>     BoundType [<<Null>>]
+    /// CHECK: ArraySet [<<arr:l\d+>>,<<index:i\d+>>,<<BT>>] value_can_be_null:true needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
+    /// CHECK: ArraySet value_can_be_null:true needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitNotBeingReliedOn
+
+    /// CHECK-START: java.lang.String[] Main.$noinline$testArraySetsHonorWriteBarrier(java.lang.String[], java.lang.String) prepare_for_register_allocation (after)
+    /// CHECK: <<Null:l\d+>>   NullConstant
+    /// CHECK: ArraySet [<<arr:l\d+>>,<<index:i\d+>>,<<Null>>] value_can_be_null:true needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
+    /// CHECK: ArraySet value_can_be_null:true needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitNotBeingReliedOn
+
+    /// CHECK-START: java.lang.String[] Main.$noinline$testArraySetsHonorWriteBarrier(java.lang.String[], java.lang.String) prepare_for_register_allocation (after)
+    /// CHECK-NOT: BoundType
+
+    /// CHECK-START: java.lang.String[] Main.$noinline$testArraySetsHonorWriteBarrier(java.lang.String[], java.lang.String) disassembly (after)
+    /// CHECK: ArraySet value_can_be_null:true needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
+    /// CHECK: ArraySet value_can_be_null:true needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitNotBeingReliedOn
+    private static java.lang.String[] $noinline$testArraySetsHonorWriteBarrier(
+            String[] arr, String o2) {
+        Object o = null;
+        arr[0] = (String) o;
+        arr[1] = o2;
+        return arr;
+    }
+
+    public static void $noinline$testDontSkipWriteBarrier() {
+        String[] arr = {"Hello", "World"};
+        // We first run the gc to make sure the card is clean.
+        Runtime.getRuntime().gc();
+        // Continually call $noinline$testArraySets while allocating over 64 MiB of memory (with
+        // heap size limited to 16 MiB), in order to increase memory pressure and eventually trigger
+        // a concurrent garbage collection, which will start by putting the GC in marking mode to
+        // trigger the bug.
+        for (int i = 0; i != 64 * 1024; ++i) {
+            $noinline$allocateAtLeast1KiB();
+            $noinline$testArraySetsDontSkipWriteBarrier(arr, null, "Universe");
+        }
+    }
+
+    // When the bug was present, $noinline$testArraySetsDontSkipWriteBarrier would never set the
+    // card as dirty (which is incorrect). arr[1]'s write barrier depends on arr[0]'s write barrier.
+    // The code path should mark the card dirty without a null check on `o` in `arr[0] = o`.
+
+    /// CHECK-START: java.lang.String[] Main.$noinline$testArraySetsDontSkipWriteBarrier(java.lang.String[], java.lang.String, java.lang.String) disassembly (after)
+    /// CHECK: ArraySet value_can_be_null:true needs_type_check:false can_trigger_gc:false write_barrier_kind:EmitBeingReliedOn
+    /// CHECK: ArraySet value_can_be_null:true needs_type_check:false can_trigger_gc:false write_barrier_kind:DontEmit
+    private static java.lang.String[] $noinline$testArraySetsDontSkipWriteBarrier(
+            String[] arr, String o, String o2) {
+        arr[0] = o;
+        arr[1] = o2;
+        return arr;
+    }
+
+    // Allocate at least 1 KiB of memory on the managed heap.
+    // Retain some allocated memory and release old allocations so that the
+    // garbage collector has something to do.
+    public static void $noinline$allocateAtLeast1KiB() {
+        memory[allocationIndex] = new Object[1024 / 4];
+        ++allocationIndex;
+        if (allocationIndex == memory.length) {
+            allocationIndex = 0;
+        }
+    }
+
+    public static Object[] memory = new Object[1024];
+    public static int allocationIndex = 0;
+}
diff --git a/test/2273-checker-unreachable-intrinsics/Android.bp b/test/2273-checker-unreachable-intrinsics/Android.bp
new file mode 100644
index 0000000..be4dd29
--- /dev/null
+++ b/test/2273-checker-unreachable-intrinsics/Android.bp
@@ -0,0 +1,43 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `2273-checker-unreachable-intrinsics`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-2273-checker-unreachable-intrinsics",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-template",
+    srcs: ["src/**/*.java"],
+    data: [
+        ":art-run-test-2273-checker-unreachable-intrinsics-expected-stdout",
+        ":art-run-test-2273-checker-unreachable-intrinsics-expected-stderr",
+    ],
+    // Include the Java source files in the test's artifacts, to make Checker assertions
+    // available to the TradeFed test runner.
+    include_srcs: true,
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-2273-checker-unreachable-intrinsics-expected-stdout",
+    out: ["art-run-test-2273-checker-unreachable-intrinsics-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-2273-checker-unreachable-intrinsics-expected-stderr",
+    out: ["art-run-test-2273-checker-unreachable-intrinsics-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/test/015-switch/expected-stderr.txt b/test/2273-checker-unreachable-intrinsics/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2273-checker-unreachable-intrinsics/expected-stderr.txt
diff --git a/test/015-switch/expected-stderr.txt b/test/2273-checker-unreachable-intrinsics/expected-stdout.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2273-checker-unreachable-intrinsics/expected-stdout.txt
diff --git a/test/2273-checker-unreachable-intrinsics/info.txt b/test/2273-checker-unreachable-intrinsics/info.txt
new file mode 100644
index 0000000..ac5b617
--- /dev/null
+++ b/test/2273-checker-unreachable-intrinsics/info.txt
@@ -0,0 +1 @@
+Tests we don't inline intrinsics with specialized HIR
diff --git a/test/2273-checker-unreachable-intrinsics/src/Main.java b/test/2273-checker-unreachable-intrinsics/src/Main.java
new file mode 100644
index 0000000..e764406
--- /dev/null
+++ b/test/2273-checker-unreachable-intrinsics/src/Main.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class Main {
+    public static void main(String[] args) {
+        assertEquals(false, $noinline$testIsEmpty("Hello"));
+        assertEquals(true, $noinline$testIsEmpty(""));
+    }
+
+    // Even though `str` is of type String, we shouldn't have java.lang.String.isEmpty
+    // in the graph since String.IsEmpty is an intrinsic with specialized HIR.
+
+    /// CHECK-START: boolean Main.$noinline$testIsEmpty(java.lang.String) inliner (after)
+    /// CHECK-NOT: method_name:java.lang.String.isEmpty
+    private static boolean $noinline$testIsEmpty(String str) {
+        return $inline$IsEmpty(str);
+    }
+
+    private static boolean $inline$IsEmpty(CharSequence chr) {
+        return chr.isEmpty();
+    }
+
+    private static void assertEquals(boolean expected, boolean actual) {
+        if (expected != actual) {
+            throw new AssertionError("Wrong result: " + expected + " != " + actual);
+        }
+    }
+}
diff --git a/test/015-switch/expected-stderr.txt b/test/2274-checker-bitwise-gvn/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2274-checker-bitwise-gvn/expected-stderr.txt
diff --git a/test/015-switch/expected-stderr.txt b/test/2274-checker-bitwise-gvn/expected-stdout.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/2274-checker-bitwise-gvn/expected-stdout.txt
diff --git a/test/2274-checker-bitwise-gvn/info.txt b/test/2274-checker-bitwise-gvn/info.txt
new file mode 100644
index 0000000..1874dd6
--- /dev/null
+++ b/test/2274-checker-bitwise-gvn/info.txt
@@ -0,0 +1,2 @@
+Tests that GVN doesn't deduplicate HBitwiseNegatedRight
+instructions with different kind.
diff --git a/test/2274-checker-bitwise-gvn/src/Main.java b/test/2274-checker-bitwise-gvn/src/Main.java
new file mode 100644
index 0000000..57cdf15
--- /dev/null
+++ b/test/2274-checker-bitwise-gvn/src/Main.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class Main {
+    public static void main(String[] args) {
+        // Test with even/odd input, and even/odd amount of loop iterations.
+        assertEquals(-33, $noinline$TwoBitwiseOperations(32, 4));
+        assertEquals(1, $noinline$TwoBitwiseOperations(32, 5));
+        assertEquals(-31, $noinline$TwoBitwiseOperations(31, 4));
+        assertEquals(0, $noinline$TwoBitwiseOperations(31, 5));
+    }
+
+    /// CHECK-START-ARM: int Main.$noinline$TwoBitwiseOperations(int, int) instruction_simplifier_arm (after)
+    /// CHECK:       BitwiseNegatedRight kind:And
+    /// CHECK:       BitwiseNegatedRight kind:Or
+
+    /// CHECK-START-ARM64: int Main.$noinline$TwoBitwiseOperations(int, int) instruction_simplifier_arm64 (after)
+    /// CHECK:       BitwiseNegatedRight kind:And
+    /// CHECK:       BitwiseNegatedRight kind:Or
+
+    /// CHECK-START-{ARM,ARM64}: int Main.$noinline$TwoBitwiseOperations(int, int) disassembly (after)
+    /// CHECK:       BitwiseNegatedRight kind:And
+    /// CHECK:       BitwiseNegatedRight kind:Or
+    private static int $noinline$TwoBitwiseOperations(int a, int n) {
+        int result = 0;
+        for (int i = 0; i < n; ++i) {
+            if (i % 2 == 0) {
+                result = (~a) & 1;
+            } else {
+                result = (~a) | 1;
+            }
+        }
+        return result;
+    }
+
+    public static void assertEquals(int expected, int actual) {
+        if (expected != actual) {
+            throw new Error("Expected: " + expected + ", found: " + actual);
+        }
+    }
+}
diff --git a/test/305-other-fault-handler/fault_handler.cc b/test/305-other-fault-handler/fault_handler.cc
index db3f1f4..c78f7d4 100644
--- a/test/305-other-fault-handler/fault_handler.cc
+++ b/test/305-other-fault-handler/fault_handler.cc
@@ -36,7 +36,7 @@
         map_error_(),
         target_map_(MemMap::MapAnonymous("test-305-mmap",
                                          /* addr */ nullptr,
-                                         /* byte_count */ kPageSize,
+                                         /* byte_count */ MemMap::GetPageSize(),
                                          /* prot */ PROT_NONE,
                                          /* low_4gb */ false,
                                          /* reuse */ false,
@@ -52,7 +52,7 @@
     manager_->RemoveHandler(this);
   }
 
-  bool Action(int sig, siginfo_t* siginfo, void* context ATTRIBUTE_UNUSED) override {
+  bool Action(int sig, siginfo_t* siginfo, [[maybe_unused]] void* context) override {
     CHECK_EQ(sig, SIGSEGV);
     CHECK_EQ(reinterpret_cast<uint32_t*>(siginfo->si_addr),
              GetTargetPointer()) << "Segfault on unexpected address!";
diff --git a/test/442-checker-constant-folding/smali/TestCmp.smali b/test/442-checker-constant-folding/smali/TestCmp.smali
index f55c837..419dd92 100644
--- a/test/442-checker-constant-folding/smali/TestCmp.smali
+++ b/test/442-checker-constant-folding/smali/TestCmp.smali
@@ -468,3 +468,45 @@
     sub-int v2, v0, v1
     goto :goto_6
 .end method
+
+## CHECK-START: int TestCmp.And0(int) constant_folding (before)
+## CHECK-DAG:     <<Arg:i\d+>>      ParameterValue
+## CHECK-DAG:     <<Const0:i\d+>>   IntConstant 0
+## CHECK-DAG:     <<And:i\d+>>      And [<<Arg>>,<<Const0>>]
+## CHECK-DAG:                       Return [<<And>>]
+
+## CHECK-START: int TestCmp.And0(int) constant_folding (after)
+## CHECK-DAG:     <<Const0:i\d+>>   IntConstant 0
+## CHECK-DAG:                       Return [<<Const0>>]
+
+## CHECK-START: int TestCmp.And0(int) constant_folding (after)
+## CHECK-NOT:                       And
+.method public static And0(I)I
+    # return arg & 0;
+    .registers 2
+
+    and-int/lit8 v0, p0, 0x0
+
+    return v0
+.end method
+
+## CHECK-START: int TestCmp.OrAllOnes(int) constant_folding (before)
+## CHECK-DAG:     <<Arg:i\d+>>      ParameterValue
+## CHECK-DAG:     <<ConstF:i\d+>>   IntConstant -1
+## CHECK-DAG:     <<Or:i\d+>>       Or [<<Arg>>,<<ConstF>>]
+## CHECK-DAG:                       Return [<<Or>>]
+
+## CHECK-START: int TestCmp.OrAllOnes(int) constant_folding (after)
+## CHECK-DAG:     <<ConstF:i\d+>>   IntConstant -1
+## CHECK-DAG:                       Return [<<ConstF>>]
+
+## CHECK-START: int TestCmp.OrAllOnes(int) constant_folding (after)
+## CHECK-NOT:                       Or
+.method public static OrAllOnes(I)I
+    # return arg | -1;
+    .registers 2
+
+    or-int/lit8 v0, p0, -0x1
+
+    return v0
+.end method
diff --git a/test/442-checker-constant-folding/src/Main.java b/test/442-checker-constant-folding/src/Main.java
index c924fca..13c42d2 100644
--- a/test/442-checker-constant-folding/src/Main.java
+++ b/test/442-checker-constant-folding/src/Main.java
@@ -122,6 +122,15 @@
     return (Integer)m.invoke(null, cond);
   }
 
+  public static int smaliAnd0(int arg) throws Exception {
+    Method m = Class.forName("TestCmp").getMethod("And0", int.class);
+    return (Integer)m.invoke(null, arg);
+  }
+
+  public static int smaliOrAllOnes(int arg) throws Exception {
+    Method m = Class.forName("TestCmp").getMethod("OrAllOnes", int.class);
+    return (Integer)m.invoke(null, arg);
+  }
 
   /**
    * Exercise constant folding on negation.
@@ -877,6 +886,91 @@
     return arg & ~arg;
   }
 
+  /// CHECK-START: int Main.OrSelfNegated(int) constant_folding (before)
+  /// CHECK-DAG:     <<Arg:i\d+>>     ParameterValue
+  /// CHECK-DAG:     <<Not:i\d+>>     Not [<<Arg>>]
+  /// CHECK-DAG:     <<Or:i\d+>>      Or [<<Not>>,<<Arg>>]
+  /// CHECK-DAG:                      Return [<<Or>>]
+
+  /// CHECK-START: int Main.OrSelfNegated(int) constant_folding (after)
+  /// CHECK-DAG:     <<Const:i\d+>>  IntConstant -1
+  /// CHECK-DAG:                     Return [<<Const>>]
+
+  /// CHECK-START: int Main.OrSelfNegated(int) constant_folding (after)
+  /// CHECK-NOT:                      Or
+
+  public static int OrSelfNegated(int arg) {
+    return arg | ~arg;
+  }
+
+  /// CHECK-START: int Main.XorSelfNegated(int) constant_folding (before)
+  /// CHECK-DAG:     <<Arg:i\d+>>     ParameterValue
+  /// CHECK-DAG:     <<Not:i\d+>>     Not [<<Arg>>]
+  /// CHECK-DAG:     <<Xor:i\d+>>     Xor [<<Not>>,<<Arg>>]
+  /// CHECK-DAG:                      Return [<<Xor>>]
+
+  /// CHECK-START: int Main.XorSelfNegated(int) constant_folding (after)
+  /// CHECK-DAG:     <<Const:i\d+>>  IntConstant -1
+  /// CHECK-DAG:                     Return [<<Const>>]
+
+  /// CHECK-START: int Main.XorSelfNegated(int) constant_folding (after)
+  /// CHECK-NOT:                      Xor
+
+  public static int XorSelfNegated(int arg) {
+    return arg ^ ~arg;
+  }
+
+  /// CHECK-START: long Main.AndSelfNegated(long) constant_folding (before)
+  /// CHECK-DAG:     <<Arg:j\d+>>     ParameterValue
+  /// CHECK-DAG:     <<Not:j\d+>>     Not [<<Arg>>]
+  /// CHECK-DAG:     <<And:j\d+>>     And [<<Not>>,<<Arg>>]
+  /// CHECK-DAG:                      Return [<<And>>]
+
+  /// CHECK-START: long Main.AndSelfNegated(long) constant_folding (after)
+  /// CHECK-DAG:     <<Const0:j\d+>>  LongConstant 0
+  /// CHECK-DAG:                      Return [<<Const0>>]
+
+  /// CHECK-START: long Main.AndSelfNegated(long) constant_folding (after)
+  /// CHECK-NOT:                      And
+
+  public static long AndSelfNegated(long arg) {
+    return arg & ~arg;
+  }
+
+  /// CHECK-START: long Main.OrSelfNegated(long) constant_folding (before)
+  /// CHECK-DAG:     <<Arg:j\d+>>     ParameterValue
+  /// CHECK-DAG:     <<Not:j\d+>>     Not [<<Arg>>]
+  /// CHECK-DAG:     <<Or:j\d+>>      Or [<<Not>>,<<Arg>>]
+  /// CHECK-DAG:                      Return [<<Or>>]
+
+  /// CHECK-START: long Main.OrSelfNegated(long) constant_folding (after)
+  /// CHECK-DAG:     <<Const:j\d+>>  LongConstant -1
+  /// CHECK-DAG:                     Return [<<Const>>]
+
+  /// CHECK-START: long Main.OrSelfNegated(long) constant_folding (after)
+  /// CHECK-NOT:                      Or
+
+  public static long OrSelfNegated(long arg) {
+    return arg | ~arg;
+  }
+
+  /// CHECK-START: long Main.XorSelfNegated(long) constant_folding (before)
+  /// CHECK-DAG:     <<Arg:j\d+>>     ParameterValue
+  /// CHECK-DAG:     <<Not:j\d+>>     Not [<<Arg>>]
+  /// CHECK-DAG:     <<Xor:j\d+>>     Xor [<<Not>>,<<Arg>>]
+  /// CHECK-DAG:                      Return [<<Xor>>]
+
+  /// CHECK-START: long Main.XorSelfNegated(long) constant_folding (after)
+  /// CHECK-DAG:     <<Const:j\d+>>  LongConstant -1
+  /// CHECK-DAG:                     Return [<<Const>>]
+
+  /// CHECK-START: long Main.XorSelfNegated(long) constant_folding (after)
+  /// CHECK-NOT:                      Xor
+
+  public static long XorSelfNegated(long arg) {
+    return arg ^ ~arg;
+  }
+
 
   /**
    * Exercise constant folding on logical or.
@@ -1075,24 +1169,6 @@
    * Test optimizations of arithmetic identities yielding a constant result.
    */
 
-  /// CHECK-START: int Main.And0(int) constant_folding (before)
-  /// CHECK-DAG:     <<Arg:i\d+>>      ParameterValue
-  /// CHECK-DAG:     <<Const0:i\d+>>   IntConstant 0
-  /// CHECK-DAG:     <<And:i\d+>>      And [<<Arg>>,<<Const0>>]
-  /// CHECK-DAG:                       Return [<<And>>]
-
-  /// CHECK-START: int Main.And0(int) constant_folding (after)
-  /// CHECK-DAG:     <<Arg:i\d+>>      ParameterValue
-  /// CHECK-DAG:     <<Const0:i\d+>>   IntConstant 0
-  /// CHECK-DAG:                       Return [<<Const0>>]
-
-  /// CHECK-START: int Main.And0(int) constant_folding (after)
-  /// CHECK-NOT:                       And
-
-  public static int And0(int arg) {
-    return arg & 0;
-  }
-
   /// CHECK-START: long Main.Mul0(long) constant_folding (before)
   /// CHECK-DAG:     <<Arg:j\d+>>      ParameterValue
   /// CHECK-DAG:     <<Const0:j\d+>>   LongConstant 0
@@ -1111,23 +1187,6 @@
     return arg * 0;
   }
 
-  /// CHECK-START: int Main.OrAllOnes(int) constant_folding (before)
-  /// CHECK-DAG:     <<Arg:i\d+>>      ParameterValue
-  /// CHECK-DAG:     <<ConstF:i\d+>>   IntConstant -1
-  /// CHECK-DAG:     <<Or:i\d+>>       Or [<<Arg>>,<<ConstF>>]
-  /// CHECK-DAG:                       Return [<<Or>>]
-
-  /// CHECK-START: int Main.OrAllOnes(int) constant_folding (after)
-  /// CHECK-DAG:     <<ConstF:i\d+>>   IntConstant -1
-  /// CHECK-DAG:                       Return [<<ConstF>>]
-
-  /// CHECK-START: int Main.OrAllOnes(int) constant_folding (after)
-  /// CHECK-NOT:                       Or
-
-  public static int OrAllOnes(int arg) {
-    return arg | -1;
-  }
-
   /// CHECK-START: long Main.Rem0(long) constant_folding (before)
   /// CHECK-DAG:     <<Arg:j\d+>>           ParameterValue
   /// CHECK-DAG:     <<Const0:j\d+>>        LongConstant 0
@@ -1577,21 +1636,20 @@
     return (double) imm;
   }
 
-  /// CHECK-START: int Main.$inline$SpecialCaseForZeroInt(int) constant_folding$after_gvn (before)
+  /// CHECK-START: int Main.$inline$SpecialCaseForZeroInt(int) constant_folding (before)
   /// CHECK-DAG:     Add
-  /// CHECK-DAG:     Shl
-  /// CHECK-DAG:     Add
+  /// CHECK-DAG:     Mul
 
-  /// CHECK-START: int Main.$inline$SpecialCaseForZeroInt(int) constant_folding$after_gvn (before)
+  /// CHECK-START: int Main.$inline$SpecialCaseForZeroInt(int) constant_folding (before)
   /// CHECK-NOT:     IntConstant 6
 
-  /// CHECK-START: int Main.$inline$SpecialCaseForZeroInt(int) constant_folding$after_gvn (after)
+  /// CHECK-START: int Main.$inline$SpecialCaseForZeroInt(int) constant_folding (after)
   /// CHECK-NOT:     Add
 
-  /// CHECK-START: int Main.$inline$SpecialCaseForZeroInt(int) constant_folding$after_gvn (after)
-  /// CHECK-NOT:     Shl
+  /// CHECK-START: int Main.$inline$SpecialCaseForZeroInt(int) constant_folding (after)
+  /// CHECK-NOT:     Mul
 
-  /// CHECK-START: int Main.$inline$SpecialCaseForZeroInt(int) constant_folding$after_gvn (after)
+  /// CHECK-START: int Main.$inline$SpecialCaseForZeroInt(int) constant_folding (after)
   /// CHECK-DAG:     <<Const:i\d+>>    IntConstant 6
   /// CHECK-DAG:                       Return [<<Const>>]
   private static int $inline$SpecialCaseForZeroInt(int value) {
@@ -1601,21 +1659,20 @@
     return value;
   }
 
-  /// CHECK-START: long Main.$inline$SpecialCaseForZeroLong(long) constant_folding$after_gvn (before)
+  /// CHECK-START: long Main.$inline$SpecialCaseForZeroLong(long) constant_folding (before)
   /// CHECK-DAG:     Add
-  /// CHECK-DAG:     Shl
-  /// CHECK-DAG:     Add
+  /// CHECK-DAG:     Mul
 
-  /// CHECK-START: long Main.$inline$SpecialCaseForZeroLong(long) constant_folding$after_gvn (before)
+  /// CHECK-START: long Main.$inline$SpecialCaseForZeroLong(long) constant_folding (before)
   /// CHECK-NOT:     LongConstant 6
 
-  /// CHECK-START: long Main.$inline$SpecialCaseForZeroLong(long) constant_folding$after_gvn (after)
+  /// CHECK-START: long Main.$inline$SpecialCaseForZeroLong(long) constant_folding (after)
   /// CHECK-NOT:     Add
 
-  /// CHECK-START: long Main.$inline$SpecialCaseForZeroLong(long) constant_folding$after_gvn (after)
-  /// CHECK-NOT:     Shl
+  /// CHECK-START: long Main.$inline$SpecialCaseForZeroLong(long) constant_folding (after)
+  /// CHECK-NOT:     Mul
 
-  /// CHECK-START: long Main.$inline$SpecialCaseForZeroLong(long) constant_folding$after_gvn (after)
+  /// CHECK-START: long Main.$inline$SpecialCaseForZeroLong(long) constant_folding (after)
   /// CHECK-DAG:     <<Const:j\d+>>    LongConstant 6
   /// CHECK-DAG:                       Return [<<Const>>]
   private static long $inline$SpecialCaseForZeroLong(long value) {
@@ -1625,14 +1682,14 @@
     return value;
   }
 
-  /// CHECK-START: float Main.$noinline$SpecialCaseForZeroFloat(float) constant_folding$after_gvn (before)
+  /// CHECK-START: float Main.$noinline$SpecialCaseForZeroFloat(float) constant_folding (before)
   /// CHECK-DAG:     Add
   /// CHECK-DAG:     Mul
 
-  /// CHECK-START: float Main.$noinline$SpecialCaseForZeroFloat(float) constant_folding$after_gvn (after)
+  /// CHECK-START: float Main.$noinline$SpecialCaseForZeroFloat(float) constant_folding (after)
   /// CHECK-NOT:     FloatConstant 6
 
-  /// CHECK-START: float Main.$noinline$SpecialCaseForZeroFloat(float) constant_folding$after_gvn (after)
+  /// CHECK-START: float Main.$noinline$SpecialCaseForZeroFloat(float) constant_folding (after)
   /// CHECK-DAG:     Add
   /// CHECK-DAG:     Mul
   private static float $noinline$SpecialCaseForZeroFloat(float value) {
@@ -1642,14 +1699,14 @@
     return value;
   }
 
-  /// CHECK-START: double Main.$noinline$SpecialCaseForZeroDouble(double) constant_folding$after_gvn (before)
+  /// CHECK-START: double Main.$noinline$SpecialCaseForZeroDouble(double) constant_folding (before)
   /// CHECK-DAG:     Add
   /// CHECK-DAG:     Mul
 
-  /// CHECK-START: double Main.$noinline$SpecialCaseForZeroDouble(double) constant_folding$after_gvn (after)
+  /// CHECK-START: double Main.$noinline$SpecialCaseForZeroDouble(double) constant_folding (after)
   /// CHECK-NOT:     DoubleConstant 6
 
-  /// CHECK-START: double Main.$noinline$SpecialCaseForZeroDouble(double) constant_folding$after_gvn (after)
+  /// CHECK-START: double Main.$noinline$SpecialCaseForZeroDouble(double) constant_folding (after)
   /// CHECK-DAG:     Add
   /// CHECK-DAG:     Mul
   private static double $noinline$SpecialCaseForZeroDouble(double value) {
@@ -1660,17 +1717,17 @@
   }
 
   // Note that we have Add instead of sub since internally we do `Add(value, -1)`.
-  /// CHECK-START: int Main.$noinline$NotEqualsPropagationInt(int) constant_folding$after_gvn (before)
+  /// CHECK-START: int Main.$noinline$NotEqualsPropagationInt(int) constant_folding (before)
   /// CHECK-DAG:     Add
   /// CHECK-DAG:     Div
 
-  /// CHECK-START: int Main.$noinline$NotEqualsPropagationInt(int) constant_folding$after_gvn (after)
+  /// CHECK-START: int Main.$noinline$NotEqualsPropagationInt(int) constant_folding (after)
   /// CHECK-NOT:     Add
 
-  /// CHECK-START: int Main.$noinline$NotEqualsPropagationInt(int) constant_folding$after_gvn (after)
+  /// CHECK-START: int Main.$noinline$NotEqualsPropagationInt(int) constant_folding (after)
   /// CHECK-NOT:     Div
 
-  /// CHECK-START: int Main.$noinline$NotEqualsPropagationInt(int) constant_folding$after_gvn (after)
+  /// CHECK-START: int Main.$noinline$NotEqualsPropagationInt(int) constant_folding (after)
   /// CHECK-DAG:     <<Const:i\d+>>    IntConstant 1
   /// CHECK-DAG:                       Return [<<Const>>]
   private static int $noinline$NotEqualsPropagationInt(int value) {
@@ -1681,17 +1738,17 @@
     }
   }
 
-  /// CHECK-START: long Main.$noinline$NotEqualsPropagationLong(long) constant_folding$after_gvn (before)
+  /// CHECK-START: long Main.$noinline$NotEqualsPropagationLong(long) constant_folding (before)
   /// CHECK-DAG:     Sub
   /// CHECK-DAG:     Div
 
-  /// CHECK-START: long Main.$noinline$NotEqualsPropagationLong(long) constant_folding$after_gvn (after)
+  /// CHECK-START: long Main.$noinline$NotEqualsPropagationLong(long) constant_folding (after)
   /// CHECK-NOT:     Sub
 
-  /// CHECK-START: long Main.$noinline$NotEqualsPropagationLong(long) constant_folding$after_gvn (after)
+  /// CHECK-START: long Main.$noinline$NotEqualsPropagationLong(long) constant_folding (after)
   /// CHECK-NOT:     Div
 
-  /// CHECK-START: long Main.$noinline$NotEqualsPropagationLong(long) constant_folding$after_gvn (after)
+  /// CHECK-START: long Main.$noinline$NotEqualsPropagationLong(long) constant_folding (after)
   /// CHECK-DAG:     <<Const:j\d+>>    LongConstant 1
   /// CHECK-DAG:                       Return [<<Const>>]
   private static long $noinline$NotEqualsPropagationLong(long value) {
@@ -1702,13 +1759,13 @@
     }
   }
 
-  /// CHECK-START: float Main.$noinline$NotEqualsPropagationFloat(float) constant_folding$after_gvn (before)
+  /// CHECK-START: float Main.$noinline$NotEqualsPropagationFloat(float) constant_folding (before)
   /// CHECK-DAG:     Sub
-  /// CHECK-DAG:     Mul
+  /// CHECK-DAG:     Div
 
-  /// CHECK-START: float Main.$noinline$NotEqualsPropagationFloat(float) constant_folding$after_gvn (after)
+  /// CHECK-START: float Main.$noinline$NotEqualsPropagationFloat(float) constant_folding (after)
   /// CHECK-DAG:     Sub
-  /// CHECK-DAG:     Mul
+  /// CHECK-DAG:     Div
   private static float $noinline$NotEqualsPropagationFloat(float value) {
     if (value != 3F) {
       return value;
@@ -1717,13 +1774,13 @@
     }
   }
 
-  /// CHECK-START: double Main.$noinline$NotEqualsPropagationDouble(double) constant_folding$after_gvn (before)
+  /// CHECK-START: double Main.$noinline$NotEqualsPropagationDouble(double) constant_folding (before)
   /// CHECK-DAG:     Sub
-  /// CHECK-DAG:     Mul
+  /// CHECK-DAG:     Div
 
-  /// CHECK-START: double Main.$noinline$NotEqualsPropagationDouble(double) constant_folding$after_gvn (after)
+  /// CHECK-START: double Main.$noinline$NotEqualsPropagationDouble(double) constant_folding (after)
   /// CHECK-DAG:     Sub
-  /// CHECK-DAG:     Mul
+  /// CHECK-DAG:     Div
   private static double $noinline$NotEqualsPropagationDouble(double value) {
     if (value != 3D) {
       return value;
@@ -1732,46 +1789,32 @@
     }
   }
 
-  /// CHECK-START: int Main.$noinline$InlineCalleeWithSpecialCaseForZeroInt(int) constant_folding$after_gvn (before)
-  /// CHECK-DAG:     Add
-  /// CHECK-DAG:     Shl
-  /// CHECK-DAG:     Add
-
-  /// CHECK-START: int Main.$noinline$InlineCalleeWithSpecialCaseForZeroInt(int) constant_folding$after_gvn (after)
+  /// CHECK-START: int Main.$noinline$InlineCaleeWithSpecialCaseForZeroInt(int) inliner (after)
   /// CHECK-NOT:     Add
 
-  /// CHECK-START: int Main.$noinline$InlineCalleeWithSpecialCaseForZeroInt(int) constant_folding$after_gvn (after)
-  /// CHECK-NOT:     Shl
+  /// CHECK-START: int Main.$noinline$InlineCaleeWithSpecialCaseForZeroInt(int) inliner (after)
+  /// CHECK-NOT:     Mul
 
-  /// CHECK-START: int Main.$noinline$InlineCalleeWithSpecialCaseForZeroInt(int) dead_code_elimination$after_gvn (after)
-  /// CHECK-DAG:     <<Param:i\d+>>    ParameterValue
-  /// CHECK-DAG:     <<Const6:i\d+>>   IntConstant 6
-  /// CHECK-DAG:                       Return [<<Param>>]
-  /// CHECK-DAG:                       Return [<<Const6>>]
-  private static int $noinline$InlineCalleeWithSpecialCaseForZeroInt(int value) {
+  /// CHECK-START: int Main.$noinline$InlineCaleeWithSpecialCaseForZeroInt(int) inliner (after)
+  /// CHECK-DAG:     <<Const:i\d+>>    IntConstant 6
+  /// CHECK-DAG:                       Return [<<Const>>]
+  private static int $noinline$InlineCaleeWithSpecialCaseForZeroInt(int value) {
     if (value == 0) {
       return $inline$SpecialCaseForZeroInt(value);
     }
     return value;
   }
 
-  /// CHECK-START: long Main.$noinline$InlineCalleeWithSpecialCaseForZeroLong(long) constant_folding$after_gvn (before)
-  /// CHECK-DAG:     Add
-  /// CHECK-DAG:     Shl
-  /// CHECK-DAG:     Add
-
-  /// CHECK-START: long Main.$noinline$InlineCalleeWithSpecialCaseForZeroLong(long) constant_folding$after_gvn (after)
+  /// CHECK-START: long Main.$noinline$InlineCaleeWithSpecialCaseForZeroLong(long) inliner (after)
   /// CHECK-NOT:     Add
 
-  /// CHECK-START: long Main.$noinline$InlineCalleeWithSpecialCaseForZeroLong(long) constant_folding$after_gvn (after)
-  /// CHECK-NOT:     Shl
+  /// CHECK-START: long Main.$noinline$InlineCaleeWithSpecialCaseForZeroLong(long) inliner (after)
+  /// CHECK-NOT:     Mul
 
-  /// CHECK-START: long Main.$noinline$InlineCalleeWithSpecialCaseForZeroLong(long) dead_code_elimination$after_gvn (after)
-  /// CHECK-DAG:     <<Param:j\d+>>    ParameterValue
-  /// CHECK-DAG:     <<Const6:j\d+>>   LongConstant 6
-  /// CHECK-DAG:                       Return [<<Param>>]
-  /// CHECK-DAG:                       Return [<<Const6>>]
-  private static long $noinline$InlineCalleeWithSpecialCaseForZeroLong(long value) {
+  /// CHECK-START: long Main.$noinline$InlineCaleeWithSpecialCaseForZeroLong(long) inliner (after)
+  /// CHECK-DAG:     <<Const:j\d+>>    LongConstant 6
+  /// CHECK-DAG:                       Return [<<Const>>]
+  private static long $noinline$InlineCaleeWithSpecialCaseForZeroLong(long value) {
     if (value == 0L) {
       return $inline$SpecialCaseForZeroLong(value);
     }
@@ -1780,11 +1823,11 @@
 
   // Check that don't propagate the value == 3 on `if not true` branch, as the `if true` branch also
   // flows into the same block.
-  /// CHECK-START: int Main.$noinline$NotEqualsImplicitElseInt(int) constant_folding$after_gvn (before)
+  /// CHECK-START: int Main.$noinline$NotEqualsImplicitElseInt(int) constant_folding (before)
   /// CHECK-DAG:     Add
   /// CHECK-DAG:     Div
 
-  /// CHECK-START: int Main.$noinline$NotEqualsImplicitElseInt(int) constant_folding$after_gvn (after)
+  /// CHECK-START: int Main.$noinline$NotEqualsImplicitElseInt(int) constant_folding (after)
   /// CHECK-DAG:     Add
   /// CHECK-DAG:     Div
   private static int $noinline$NotEqualsImplicitElseInt(int value) {
@@ -1794,11 +1837,11 @@
     return (value - 1) / 2;
   }
 
-  /// CHECK-START: long Main.$noinline$NotEqualsImplicitElseLong(long) constant_folding$after_gvn (before)
+  /// CHECK-START: long Main.$noinline$NotEqualsImplicitElseLong(long) constant_folding (before)
   /// CHECK-DAG:     Sub
   /// CHECK-DAG:     Div
 
-  /// CHECK-START: long Main.$noinline$NotEqualsImplicitElseLong(long) constant_folding$after_gvn (after)
+  /// CHECK-START: long Main.$noinline$NotEqualsImplicitElseLong(long) constant_folding (after)
   /// CHECK-DAG:     Sub
   /// CHECK-DAG:     Div
   private static long $noinline$NotEqualsImplicitElseLong(long value) {
@@ -1808,13 +1851,13 @@
     return (value - 1L) / 2L;
   }
 
-  /// CHECK-START: float Main.$noinline$NotEqualsImplicitElseFloat(float) constant_folding$after_gvn (before)
+  /// CHECK-START: float Main.$noinline$NotEqualsImplicitElseFloat(float) constant_folding (before)
   /// CHECK-DAG:     Sub
-  /// CHECK-DAG:     Mul
+  /// CHECK-DAG:     Div
 
-  /// CHECK-START: float Main.$noinline$NotEqualsImplicitElseFloat(float) constant_folding$after_gvn (after)
+  /// CHECK-START: float Main.$noinline$NotEqualsImplicitElseFloat(float) constant_folding (after)
   /// CHECK-DAG:     Sub
-  /// CHECK-DAG:     Mul
+  /// CHECK-DAG:     Div
   private static float $noinline$NotEqualsImplicitElseFloat(float value) {
     if (value != 3F) {
       value += 1F;
@@ -1822,13 +1865,13 @@
     return (value - 1F) / 2F;
   }
 
-  /// CHECK-START: double Main.$noinline$NotEqualsImplicitElseDouble(double) constant_folding$after_gvn (before)
+  /// CHECK-START: double Main.$noinline$NotEqualsImplicitElseDouble(double) constant_folding (before)
   /// CHECK-DAG:     Sub
-  /// CHECK-DAG:     Mul
+  /// CHECK-DAG:     Div
 
-  /// CHECK-START: double Main.$noinline$NotEqualsImplicitElseDouble(double) constant_folding$after_gvn (after)
+  /// CHECK-START: double Main.$noinline$NotEqualsImplicitElseDouble(double) constant_folding (after)
   /// CHECK-DAG:     Sub
-  /// CHECK-DAG:     Mul
+  /// CHECK-DAG:     Div
   private static double $noinline$NotEqualsImplicitElseDouble(double value) {
     if (value != 3D) {
       value += 1D;
@@ -1836,39 +1879,37 @@
     return (value - 1D) / 2D;
   }
 
-  // By propagating the boolean we can eliminate some equality comparisons as we already know their
+  // By propagating the boolean we can elimniate some equality comparisons as we already know their
   // result. In turn, we also enable DeadCodeElimination to eliminate more code.
-  /// CHECK-START: int Main.$noinline$PropagatingParameterValue(boolean, int) constant_folding$after_gvn (before)
-  /// CHECK-DAG:     <<Param:z\d+>>    ParameterValue
-  /// CHECK-DAG:                       Select [{{i\d+}},{{i\d+}},<<Param>>]
-  /// CHECK-DAG:                       Select [{{i\d+}},{{i\d+}},<<Param>>]
+  /// CHECK-START: int Main.$noinline$PropagatingParameterValue(boolean) constant_folding (before)
+  /// CHECK-DAG:     Equal
+  /// CHECK-DAG:     Equal
+  /// CHECK-DAG:     Equal
 
-  /// CHECK-START: int Main.$noinline$PropagatingParameterValue(boolean, int) constant_folding$after_gvn (after)
-  /// CHECK-DAG:     <<Const0:i\d+>>   IntConstant 0
-  /// CHECK-DAG:     <<Const1:i\d+>>   IntConstant 1
-  /// CHECK-DAG:                       Select [{{i\d+}},{{i\d+}},<<Const0>>]
-  /// CHECK-DAG:                       Select [{{i\d+}},{{i\d+}},<<Const1>>]
+  /// CHECK-START: int Main.$noinline$PropagatingParameterValue(boolean) constant_folding (after)
+  /// CHECK:         Equal
+  /// CHECK-NOT:     Equal
 
-  /// CHECK-START: int Main.$noinline$PropagatingParameterValue(boolean, int) dead_code_elimination$after_gvn (before)
+  /// CHECK-START: int Main.$noinline$PropagatingParameterValue(boolean) dead_code_elimination$initial (before)
   /// CHECK-DAG:     IntConstant 1
   /// CHECK-DAG:     IntConstant 2
   /// CHECK-DAG:     IntConstant 3
   /// CHECK-DAG:     IntConstant 4
 
-  /// CHECK-START: int Main.$noinline$PropagatingParameterValue(boolean, int) dead_code_elimination$after_gvn (after)
+  /// CHECK-START: int Main.$noinline$PropagatingParameterValue(boolean) dead_code_elimination$initial (after)
   /// CHECK-DAG:     IntConstant 1
   /// CHECK-DAG:     IntConstant 4
 
-  /// CHECK-START: int Main.$noinline$PropagatingParameterValue(boolean, int) dead_code_elimination$after_gvn (after)
+  /// CHECK-START: int Main.$noinline$PropagatingParameterValue(boolean) dead_code_elimination$initial (after)
   /// CHECK-NOT:     IntConstant 2
 
-  /// CHECK-START: int Main.$noinline$PropagatingParameterValue(boolean, int) dead_code_elimination$after_gvn (after)
+  /// CHECK-START: int Main.$noinline$PropagatingParameterValue(boolean) dead_code_elimination$initial (after)
   /// CHECK-NOT:     IntConstant 3
-  private static int $noinline$PropagatingParameterValue(boolean value, int initial_value) {
+  private static int $noinline$PropagatingParameterValue(boolean value) {
     if (value) {
-      return value ? initial_value + 1 : initial_value + 2;
+      return value ? 1 : 2;
     } else {
-      return value ? initial_value + 3 : initial_value + 4;
+      return value ? 3 : 4;
     }
   }
 
@@ -1934,9 +1975,9 @@
 
     int arbitrary = 123456;  // Value chosen arbitrarily.
 
-    assertIntEquals(0, And0(arbitrary));
+    assertIntEquals(0, Main.smaliAnd0(arbitrary));
     assertLongEquals(0, Mul0(arbitrary));
-    assertIntEquals(-1, OrAllOnes(arbitrary));
+    assertIntEquals(-1, Main.smaliOrAllOnes(arbitrary));
     assertLongEquals(0, Rem0(arbitrary));
     assertIntEquals(0, Rem1(arbitrary));
     assertIntEquals(0, Rem1(0));
@@ -2006,7 +2047,7 @@
     // Tests for propagating known values due to if clauses.
 
     // Propagating within the same method. These are marked $inline$ since we used them in
-    // `InlineCalleeWithSpecialCaseForZeroInt`.
+    // `InlineCaleeWithSpecialCaseForZeroInt`.
     assertIntEquals(6, $inline$SpecialCaseForZeroInt(0));
     assertIntEquals(3, $inline$SpecialCaseForZeroInt(3));
     assertLongEquals(6L, $inline$SpecialCaseForZeroLong(0L));
@@ -2029,10 +2070,10 @@
     assertDoubleEquals(1D, $noinline$NotEqualsPropagationDouble(3D));
 
     // Propagating so that the inliner can use it.
-    assertIntEquals(6, $noinline$InlineCalleeWithSpecialCaseForZeroInt(0));
-    assertIntEquals(3, $noinline$InlineCalleeWithSpecialCaseForZeroInt(3));
-    assertLongEquals(6L, $noinline$InlineCalleeWithSpecialCaseForZeroLong(0L));
-    assertLongEquals(3L, $noinline$InlineCalleeWithSpecialCaseForZeroLong(3L));
+    assertIntEquals(6, $noinline$InlineCaleeWithSpecialCaseForZeroInt(0));
+    assertIntEquals(3, $noinline$InlineCaleeWithSpecialCaseForZeroInt(3));
+    assertLongEquals(6L, $noinline$InlineCaleeWithSpecialCaseForZeroLong(0L));
+    assertLongEquals(3L, $noinline$InlineCaleeWithSpecialCaseForZeroLong(3L));
 
     // Propagating within the same method, with not equals
     assertIntEquals(0, $noinline$NotEqualsImplicitElseInt(0));
@@ -2045,8 +2086,8 @@
     assertDoubleEquals(1D, $noinline$NotEqualsImplicitElseDouble(3D));
 
     // Propagating parameters.
-    assertIntEquals(1, $noinline$PropagatingParameterValue(true, 0));
-    assertIntEquals(4, $noinline$PropagatingParameterValue(false, 0));
+    assertIntEquals(1, $noinline$PropagatingParameterValue(true));
+    assertIntEquals(4, $noinline$PropagatingParameterValue(false));
   }
 
   Main() throws ClassNotFoundException {
diff --git a/test/449-checker-bce/src/Main.java b/test/449-checker-bce/src/Main.java
index 3e41410..f238967 100644
--- a/test/449-checker-bce/src/Main.java
+++ b/test/449-checker-bce/src/Main.java
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+import java.util.Arrays;
+
 public class Main {
 
   /// CHECK-START: int Main.sieve(int) BCE (before)
@@ -1773,6 +1775,87 @@
     }
   }
 
+  // Tests `setZeroToRange` with a range of values. Checks for exceptions as well as the correctness
+  // of setting the right values to zero.
+  static void $noinline$testSetZeroToRange() {
+    for (int start = -2; start < 7; ++start) {
+      for (int len = -2; len < 7; ++len) {
+        int[] array = {1, 2, 3, 4, 5};
+        final int lower = start;
+        final int upper = start + len - 1;
+        // We expect an exception if:
+        //  * The first value is out of range, or
+        //  * The last value is more than the length of the array.
+        // Note that if `upper < 0` it means that we will only do one iteration of the do while in
+        // `setZeroToRange` so we have the exception covered with the `lower` checks.
+        final boolean expected_exception =
+                (lower < 0) || (lower >= array.length) || (upper >= array.length);
+        try {
+          $noinline$setZeroToRange(array, start, len);
+          if (expected_exception) {
+              System.out.println("Missing ArrayIndexOutOfBoundsException for start " + start
+                      + " and len " + len);
+          }
+          $noinline$checkZerosForSetZeroToRange(array, start, len);
+        } catch (ArrayIndexOutOfBoundsException e) {
+          if (!expected_exception) {
+              System.out.println("Unexpected ArrayIndexOutOfBoundsException for start " + start
+                      + " and len " + len);
+          }
+        }
+      }
+    }
+  }
+
+  // TODO(solanes): Improve the code to replace the following BoundsCheck with HDeoptimize
+  // instructions. See b/304967775 and aosp/2804075.
+
+  /// CHECK-START: void Main.$noinline$setZeroToRange(int[], int, int) BCE (before)
+  /// CHECK:     BoundsCheck
+
+  /// CHECK-START: void Main.$noinline$setZeroToRange(int[], int, int) BCE (after)
+  /// CHECK:     BoundsCheck
+
+  // Sets to `0` the values of `arr` in the range `[start, len)`.
+  static void $noinline$setZeroToRange(int[] arr, int start, int len) {
+    int charPos = start;
+    do {
+      arr[charPos++] = 0;
+    } while (charPos < start + len);
+  }
+
+  static void $noinline$checkZerosForSetZeroToRange(int[] arr, int start, int len) {
+    // Non-zeroes before zeroes.
+    int i = 0;
+    for (; i < Math.min(start, arr.length); ++i) {
+      if (arr[i] == 0) {
+        System.out.println("Expected non-zero for arr " + Arrays.toString(arr) + " before zeroes i "
+                + i + " start " + start + " and len " + len);
+      }
+    }
+
+    int bound = start + len;
+    if (bound < 1 || len < 1) {
+      // We always set one zero since it is a do-while.
+      bound = i + 1;
+    }
+
+    for (; i < Math.min(bound, arr.length); ++i) {
+      if (arr[i] != 0) {
+        System.out.println("Expected zero for arr " + Arrays.toString(arr) + " i " + i + " start "
+                + start + " and len " + len);
+      }
+    }
+
+    // Then zeroes until the end.
+    for (; i < arr.length; ++i) {
+      if (arr[i] == 0) {
+        System.out.println("Expected non-zero after zeroes for arr " + Arrays.toString(arr) + " i "
+                + i + " start " + start + " and len " + len);
+      }
+    }
+  }
+
   // Make sure this method is compiled with optimizing.
   /// CHECK-START: void Main.main(java.lang.String[]) register (after)
   /// CHECK: ParallelMove
@@ -1909,10 +1992,12 @@
     int i = 1;
     if (foo() + i != 100) {
       System.out.println("foo failed!");
-    };
+    }
 
     testUnknownBounds();
     new Main().testExceptionMessage();
+
+    $noinline$testSetZeroToRange();
   }
 
   public static native boolean compiledWithOptimizing();
diff --git a/test/454-get-vreg/get_vreg_jni.cc b/test/454-get-vreg/get_vreg_jni.cc
index eb81f3b..bc053be 100644
--- a/test/454-get-vreg/get_vreg_jni.cc
+++ b/test/454-get-vreg/get_vreg_jni.cc
@@ -17,7 +17,7 @@
 #include "arch/context.h"
 #include "art_method-inl.h"
 #include "jni.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "scoped_thread_state_change-inl.h"
 #include "stack.h"
 #include "thread.h"
diff --git a/test/457-regs/regs_jni.cc b/test/457-regs/regs_jni.cc
index 80abb3b..c9b5e2f 100644
--- a/test/457-regs/regs_jni.cc
+++ b/test/457-regs/regs_jni.cc
@@ -17,7 +17,7 @@
 #include "arch/context.h"
 #include "art_method-inl.h"
 #include "jni.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "scoped_thread_state_change-inl.h"
 #include "stack.h"
 #include "thread.h"
@@ -127,7 +127,7 @@
 };
 
 extern "C" JNIEXPORT void JNICALL Java_PhiLiveness_regsNativeCall(
-    JNIEnv*, jclass value ATTRIBUTE_UNUSED) {
+    JNIEnv*, [[maybe_unused]] jclass value) {
   ScopedObjectAccess soa(Thread::Current());
   std::unique_ptr<Context> context(Context::Create());
   TestVisitor visitor(soa.Self(), context.get());
@@ -136,7 +136,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_PhiLiveness_regsNativeCallWithParameters(
-    JNIEnv*, jclass value ATTRIBUTE_UNUSED, jobject main, jint int_value, jfloat float_value) {
+    JNIEnv*, [[maybe_unused]] jclass value, jobject main, jint int_value, jfloat float_value) {
   ScopedObjectAccess soa(Thread::Current());
   std::unique_ptr<Context> context(Context::Create());
   CHECK(soa.Decode<mirror::Object>(main) == nullptr);
diff --git a/test/458-checker-instruct-simplification/src/Main.java b/test/458-checker-instruct-simplification/src/Main.java
index 8ab059d..784acf7 100644
--- a/test/458-checker-instruct-simplification/src/Main.java
+++ b/test/458-checker-instruct-simplification/src/Main.java
@@ -2155,6 +2155,194 @@
     return y + sub;
   }
 
+  // Sub/Add and Sub/Sub simplifications
+
+  /// CHECK-START: int Main.$noinline$testSubAddInt(int, int) instruction_simplifier (before)
+  /// CHECK: <<x:i\d+>>   ParameterValue
+  /// CHECK: <<y:i\d+>>   ParameterValue
+  /// CHECK: <<add:i\d+>> Add [<<x>>,<<y>>]
+  /// CHECK: <<sub:i\d+>> Sub [<<y>>,<<add>>]
+  /// CHECK:              Return [<<sub>>]
+
+  /// CHECK-START: int Main.$noinline$testSubAddInt(int, int) instruction_simplifier (after)
+  /// CHECK: <<x:i\d+>>   ParameterValue
+  /// CHECK: <<y:i\d+>>   ParameterValue
+  /// CHECK: <<add:i\d+>> Add [<<x>>,<<y>>]
+  /// CHECK: <<neg:i\d+>> Neg [<<x>>]
+  /// CHECK:              Return [<<neg>>]
+
+  /// CHECK-START: int Main.$noinline$testSubAddInt(int, int) instruction_simplifier (after)
+  /// CHECK-NOT: Sub
+
+  /// CHECK-START: int Main.$noinline$testSubAddInt(int, int) dead_code_elimination$initial (after)
+  /// CHECK-NOT: Add
+  static int $noinline$testSubAddInt(int x, int y) {
+    return y - (x + y);
+  }
+
+  /// CHECK-START: int Main.$noinline$testSubAddOtherVersionInt(int, int) instruction_simplifier (before)
+  /// CHECK: <<x:i\d+>>   ParameterValue
+  /// CHECK: <<y:i\d+>>   ParameterValue
+  /// CHECK: <<add:i\d+>> Add [<<x>>,<<y>>]
+  /// CHECK: <<sub:i\d+>> Sub [<<x>>,<<add>>]
+  /// CHECK:              Return [<<sub>>]
+
+  /// CHECK-START: int Main.$noinline$testSubAddOtherVersionInt(int, int) instruction_simplifier (after)
+  /// CHECK: <<x:i\d+>>   ParameterValue
+  /// CHECK: <<y:i\d+>>   ParameterValue
+  /// CHECK: <<add:i\d+>> Add [<<x>>,<<y>>]
+  /// CHECK: <<neg:i\d+>> Neg [<<y>>]
+  /// CHECK:              Return [<<neg>>]
+
+  /// CHECK-START: int Main.$noinline$testSubAddOtherVersionInt(int, int) instruction_simplifier (after)
+  /// CHECK-NOT: Sub
+
+  /// CHECK-START: int Main.$noinline$testSubAddOtherVersionInt(int, int) dead_code_elimination$initial (after)
+  /// CHECK-NOT: Add
+  static int $noinline$testSubAddOtherVersionInt(int x, int y) {
+    return x - (x + y);
+  }
+
+  /// CHECK-START: int Main.$noinline$testSubSubInt(int, int) instruction_simplifier (before)
+  /// CHECK: <<x:i\d+>>    ParameterValue
+  /// CHECK: <<y:i\d+>>    ParameterValue
+  /// CHECK: <<sub1:i\d+>> Sub [<<x>>,<<y>>]
+  /// CHECK: <<sub2:i\d+>> Sub [<<sub1>>,<<x>>]
+  /// CHECK:               Return [<<sub2>>]
+
+  /// CHECK-START: int Main.$noinline$testSubSubInt(int, int) instruction_simplifier (after)
+  /// CHECK: <<x:i\d+>>    ParameterValue
+  /// CHECK: <<y:i\d+>>    ParameterValue
+  /// CHECK: <<sub1:i\d+>> Sub [<<x>>,<<y>>]
+  /// CHECK: <<neg:i\d+>>  Neg [<<y>>]
+  /// CHECK:               Return [<<neg>>]
+
+  /// CHECK-START: int Main.$noinline$testSubSubInt(int, int) instruction_simplifier (after)
+  /// CHECK:     Sub
+  /// CHECK-NOT: Sub
+
+  /// CHECK-START: int Main.$noinline$testSubSubInt(int, int) dead_code_elimination$initial (after)
+  /// CHECK-NOT: Sub
+  static int $noinline$testSubSubInt(int x, int y) {
+    return (x - y) - x;
+  }
+
+  /// CHECK-START: int Main.$noinline$testSubSubOtherVersionInt(int, int) instruction_simplifier (before)
+  /// CHECK: <<x:i\d+>>    ParameterValue
+  /// CHECK: <<y:i\d+>>    ParameterValue
+  /// CHECK: <<sub1:i\d+>> Sub [<<x>>,<<y>>]
+  /// CHECK: <<sub2:i\d+>> Sub [<<x>>,<<sub1>>]
+  /// CHECK:               Return [<<sub2>>]
+
+  /// CHECK-START: int Main.$noinline$testSubSubOtherVersionInt(int, int) instruction_simplifier (after)
+  /// CHECK: <<x:i\d+>>    ParameterValue
+  /// CHECK: <<y:i\d+>>    ParameterValue
+  /// CHECK: <<sub1:i\d+>> Sub [<<x>>,<<y>>]
+  /// CHECK:               Return [<<y>>]
+
+  /// CHECK-START: int Main.$noinline$testSubSubOtherVersionInt(int, int) instruction_simplifier (after)
+  /// CHECK:     Sub
+  /// CHECK-NOT: Sub
+
+  /// CHECK-START: int Main.$noinline$testSubSubOtherVersionInt(int, int) dead_code_elimination$initial (after)
+  /// CHECK-NOT: Sub
+  static int $noinline$testSubSubOtherVersionInt(int x, int y) {
+    return x - (x - y);
+  }
+
+  /// CHECK-START: long Main.$noinline$testSubAddLong(long, long) instruction_simplifier (before)
+  /// CHECK: <<x:j\d+>>   ParameterValue
+  /// CHECK: <<y:j\d+>>   ParameterValue
+  /// CHECK: <<add:j\d+>> Add [<<x>>,<<y>>]
+  /// CHECK: <<sub:j\d+>> Sub [<<y>>,<<add>>]
+  /// CHECK:              Return [<<sub>>]
+
+  /// CHECK-START: long Main.$noinline$testSubAddLong(long, long) instruction_simplifier (after)
+  /// CHECK: <<x:j\d+>>   ParameterValue
+  /// CHECK: <<y:j\d+>>   ParameterValue
+  /// CHECK: <<add:j\d+>> Add [<<x>>,<<y>>]
+  /// CHECK: <<neg:j\d+>> Neg [<<x>>]
+  /// CHECK:              Return [<<neg>>]
+
+  /// CHECK-START: long Main.$noinline$testSubAddLong(long, long) instruction_simplifier (after)
+  /// CHECK-NOT: Sub
+
+  /// CHECK-START: long Main.$noinline$testSubAddLong(long, long) dead_code_elimination$initial (after)
+  /// CHECK-NOT: Add
+  static long $noinline$testSubAddLong(long x, long y) {
+    return y - (x + y);
+  }
+
+  /// CHECK-START: long Main.$noinline$testSubAddOtherVersionLong(long, long) instruction_simplifier (before)
+  /// CHECK: <<x:j\d+>>   ParameterValue
+  /// CHECK: <<y:j\d+>>   ParameterValue
+  /// CHECK: <<add:j\d+>> Add [<<x>>,<<y>>]
+  /// CHECK: <<sub:j\d+>> Sub [<<x>>,<<add>>]
+  /// CHECK:              Return [<<sub>>]
+
+  /// CHECK-START: long Main.$noinline$testSubAddOtherVersionLong(long, long) instruction_simplifier (after)
+  /// CHECK: <<x:j\d+>>   ParameterValue
+  /// CHECK: <<y:j\d+>>   ParameterValue
+  /// CHECK: <<add:j\d+>> Add [<<x>>,<<y>>]
+  /// CHECK: <<neg:j\d+>> Neg [<<y>>]
+  /// CHECK:              Return [<<neg>>]
+
+  /// CHECK-START: long Main.$noinline$testSubAddOtherVersionLong(long, long) instruction_simplifier (after)
+  /// CHECK-NOT: Sub
+
+  /// CHECK-START: long Main.$noinline$testSubAddOtherVersionLong(long, long) dead_code_elimination$initial (after)
+  /// CHECK-NOT: Add
+  static long $noinline$testSubAddOtherVersionLong(long x, long y) {
+    return x - (x + y);
+  }
+
+  /// CHECK-START: long Main.$noinline$testSubSubLong(long, long) instruction_simplifier (before)
+  /// CHECK: <<x:j\d+>>    ParameterValue
+  /// CHECK: <<y:j\d+>>    ParameterValue
+  /// CHECK: <<sub1:j\d+>> Sub [<<x>>,<<y>>]
+  /// CHECK: <<sub2:j\d+>> Sub [<<sub1>>,<<x>>]
+  /// CHECK:               Return [<<sub2>>]
+
+  /// CHECK-START: long Main.$noinline$testSubSubLong(long, long) instruction_simplifier (after)
+  /// CHECK: <<x:j\d+>>    ParameterValue
+  /// CHECK: <<y:j\d+>>    ParameterValue
+  /// CHECK: <<sub1:j\d+>> Sub [<<x>>,<<y>>]
+  /// CHECK: <<neg:j\d+>>  Neg [<<y>>]
+  /// CHECK:               Return [<<neg>>]
+
+  /// CHECK-START: long Main.$noinline$testSubSubLong(long, long) instruction_simplifier (after)
+  /// CHECK:     Sub
+  /// CHECK-NOT: Sub
+
+  /// CHECK-START: long Main.$noinline$testSubSubLong(long, long) dead_code_elimination$initial (after)
+  /// CHECK-NOT: Sub
+  static long $noinline$testSubSubLong(long x, long y) {
+    return (x - y) - x;
+  }
+
+  /// CHECK-START: long Main.$noinline$testSubSubOtherVersionLong(long, long) instruction_simplifier (before)
+  /// CHECK: <<x:j\d+>>    ParameterValue
+  /// CHECK: <<y:j\d+>>    ParameterValue
+  /// CHECK: <<sub1:j\d+>> Sub [<<x>>,<<y>>]
+  /// CHECK: <<sub2:j\d+>> Sub [<<x>>,<<sub1>>]
+  /// CHECK:               Return [<<sub2>>]
+
+  /// CHECK-START: long Main.$noinline$testSubSubOtherVersionLong(long, long) instruction_simplifier (after)
+  /// CHECK: <<x:j\d+>>    ParameterValue
+  /// CHECK: <<y:j\d+>>    ParameterValue
+  /// CHECK: <<sub1:j\d+>> Sub [<<x>>,<<y>>]
+  /// CHECK:               Return [<<y>>]
+
+  /// CHECK-START: long Main.$noinline$testSubSubOtherVersionLong(long, long) instruction_simplifier (after)
+  /// CHECK:     Sub
+  /// CHECK-NOT: Sub
+
+  /// CHECK-START: long Main.$noinline$testSubSubOtherVersionLong(long, long) dead_code_elimination$initial (after)
+  /// CHECK-NOT: Sub
+  static long $noinline$testSubSubOtherVersionLong(long x, long y) {
+    return x - (x - y);
+  }
+
   /// CHECK-START: int Main.$noinline$getUint8FromInstanceByteField(Main) instruction_simplifier (before)
   /// CHECK-DAG:      <<Const255:i\d+>> IntConstant 255
   /// CHECK-DAG:      <<Get:b\d+>>      InstanceFieldGet
@@ -2794,6 +2982,916 @@
     return array[0];
   }
 
+  // If a == b returns b (which is equal to a) else returns a. This can be simplified to just
+  // return a.
+
+  /// CHECK-START: int Main.$noinline$returnSecondIfEqualElseFirstInt(int, int) instruction_simplifier$after_gvn (before)
+  /// CHECK:     <<Param1:i\d+>> ParameterValue
+  /// CHECK:     <<Param2:i\d+>> ParameterValue
+  /// CHECK:     <<Select:i\d+>> Select [<<Param2>>,<<Param1>>,<<Cond:z\d+>>]
+  /// CHECK:     <<Return:v\d+>> Return [<<Select>>]
+
+  /// CHECK-START: int Main.$noinline$returnSecondIfEqualElseFirstInt(int, int) instruction_simplifier$after_gvn (after)
+  /// CHECK:     <<Param1:i\d+>> ParameterValue
+  /// CHECK:     <<Param2:i\d+>> ParameterValue
+  /// CHECK:     <<Return:v\d+>> Return [<<Param1>>]
+
+  /// CHECK-START: int Main.$noinline$returnSecondIfEqualElseFirstInt(int, int) instruction_simplifier$after_gvn (after)
+  /// CHECK-NOT: Select
+  private static int $noinline$returnSecondIfEqualElseFirstInt(int a, int b) {
+    return a == b ? b : a;
+  }
+
+  /// CHECK-START: long Main.$noinline$returnSecondIfEqualElseFirstLong(long, long) instruction_simplifier$after_gvn (before)
+  /// CHECK:     <<Param1:j\d+>> ParameterValue
+  /// CHECK:     <<Param2:j\d+>> ParameterValue
+  /// CHECK:     <<Select:j\d+>> Select [<<Param2>>,<<Param1>>,<<Cond:z\d+>>]
+  /// CHECK:     <<Return:v\d+>> Return [<<Select>>]
+
+  /// CHECK-START: long Main.$noinline$returnSecondIfEqualElseFirstLong(long, long) instruction_simplifier$after_gvn (after)
+  /// CHECK:     <<Param1:j\d+>> ParameterValue
+  /// CHECK:     <<Param2:j\d+>> ParameterValue
+  /// CHECK:     <<Return:v\d+>> Return [<<Param1>>]
+
+  /// CHECK-START: long Main.$noinline$returnSecondIfEqualElseFirstLong(long, long) instruction_simplifier$after_gvn (after)
+  /// CHECK-NOT: Select
+  private static long $noinline$returnSecondIfEqualElseFirstLong(long a, long b) {
+    return a == b ? b : a;
+  }
+
+  // Note that we do not do the optimization for Float/Double.
+
+  /// CHECK-START: float Main.$noinline$returnSecondIfEqualElseFirstFloat(float, float) instruction_simplifier$after_gvn (before)
+  /// CHECK:     <<Param1:f\d+>> ParameterValue
+  /// CHECK:     <<Param2:f\d+>> ParameterValue
+  /// CHECK:     <<Select:f\d+>> Select [<<Param2>>,<<Param1>>,<<Cond:z\d+>>]
+  /// CHECK:     <<Return:v\d+>> Return [<<Select>>]
+
+  /// CHECK-START: float Main.$noinline$returnSecondIfEqualElseFirstFloat(float, float) disassembly (after)
+  /// CHECK:     <<Param1:f\d+>> ParameterValue
+  /// CHECK:     <<Param2:f\d+>> ParameterValue
+  /// CHECK:     <<Select:f\d+>> Select [<<Param2>>,<<Param1>>,<<Cond:z\d+>>]
+  /// CHECK:     <<Return:v\d+>> Return [<<Select>>]
+  private static float $noinline$returnSecondIfEqualElseFirstFloat(float a, float b) {
+    return a == b ? b : a;
+  }
+
+  /// CHECK-START: double Main.$noinline$returnSecondIfEqualElseFirstDouble(double, double) instruction_simplifier$after_gvn (before)
+  /// CHECK:     <<Param1:d\d+>> ParameterValue
+  /// CHECK:     <<Param2:d\d+>> ParameterValue
+  /// CHECK:     <<Select:d\d+>> Select [<<Param2>>,<<Param1>>,<<Cond:z\d+>>]
+  /// CHECK:     <<Return:v\d+>> Return [<<Select>>]
+
+  /// CHECK-START: double Main.$noinline$returnSecondIfEqualElseFirstDouble(double, double) disassembly (after)
+  /// CHECK:     <<Param1:d\d+>> ParameterValue
+  /// CHECK:     <<Param2:d\d+>> ParameterValue
+  /// CHECK:     <<Select:d\d+>> Select [<<Param2>>,<<Param1>>,<<Cond:z\d+>>]
+  /// CHECK:     <<Return:v\d+>> Return [<<Select>>]
+  private static double $noinline$returnSecondIfEqualElseFirstDouble(double a, double b) {
+    return a == b ? b : a;
+  }
+
+  // If a != b returns b else returns a (which is equal to b). This can be simplified to just
+  // return b.
+
+  /// CHECK-START: int Main.$noinline$returnSecondIfNotEqualElseFirstInt(int, int) instruction_simplifier$after_gvn (before)
+  /// CHECK:     <<Param1:i\d+>> ParameterValue
+  /// CHECK:     <<Param2:i\d+>> ParameterValue
+  /// CHECK:     <<Select:i\d+>> Select [<<Param2>>,<<Param1>>,<<Cond:z\d+>>]
+  /// CHECK:     <<Return:v\d+>> Return [<<Select>>]
+
+  /// CHECK-START: int Main.$noinline$returnSecondIfNotEqualElseFirstInt(int, int) instruction_simplifier$after_gvn (after)
+  /// CHECK:     <<Param1:i\d+>> ParameterValue
+  /// CHECK:     <<Param2:i\d+>> ParameterValue
+  /// CHECK:     <<Return:v\d+>> Return [<<Param2>>]
+
+  /// CHECK-START: int Main.$noinline$returnSecondIfNotEqualElseFirstInt(int, int) instruction_simplifier$after_gvn (after)
+  /// CHECK-NOT: Select
+  private static int $noinline$returnSecondIfNotEqualElseFirstInt(int a, int b) {
+    return a != b ? b : a;
+  }
+
+  /// CHECK-START: long Main.$noinline$returnSecondIfNotEqualElseFirstLong(long, long) instruction_simplifier$after_gvn (before)
+  /// CHECK:     <<Param1:j\d+>> ParameterValue
+  /// CHECK:     <<Param2:j\d+>> ParameterValue
+  /// CHECK:     <<Select:j\d+>> Select [<<Param2>>,<<Param1>>,<<Cond:z\d+>>]
+  /// CHECK:     <<Return:v\d+>> Return [<<Select>>]
+
+  /// CHECK-START: long Main.$noinline$returnSecondIfNotEqualElseFirstLong(long, long) instruction_simplifier$after_gvn (after)
+  /// CHECK:     <<Param1:j\d+>> ParameterValue
+  /// CHECK:     <<Param2:j\d+>> ParameterValue
+  /// CHECK:     <<Return:v\d+>> Return [<<Param2>>]
+
+  /// CHECK-START: long Main.$noinline$returnSecondIfNotEqualElseFirstLong(long, long) instruction_simplifier$after_gvn (after)
+  /// CHECK-NOT: Select
+  private static long $noinline$returnSecondIfNotEqualElseFirstLong(long a, long b) {
+    return a != b ? b : a;
+  }
+
+  // Note that we do not do the optimization for Float/Double.
+
+  /// CHECK-START: float Main.$noinline$returnSecondIfNotEqualElseFirstFloat(float, float) instruction_simplifier$after_gvn (before)
+  /// CHECK:     <<Param1:f\d+>> ParameterValue
+  /// CHECK:     <<Param2:f\d+>> ParameterValue
+  /// CHECK:     <<Select:f\d+>> Select [<<Param2>>,<<Param1>>,<<Cond:z\d+>>]
+  /// CHECK:     <<Return:v\d+>> Return [<<Select>>]
+
+  /// CHECK-START: float Main.$noinline$returnSecondIfNotEqualElseFirstFloat(float, float) disassembly (after)
+  /// CHECK:     <<Param1:f\d+>> ParameterValue
+  /// CHECK:     <<Param2:f\d+>> ParameterValue
+  /// CHECK:     <<Select:f\d+>> Select [<<Param2>>,<<Param1>>,<<Cond:z\d+>>]
+  /// CHECK:     <<Return:v\d+>> Return [<<Select>>]
+  private static float $noinline$returnSecondIfNotEqualElseFirstFloat(float a, float b) {
+    return a != b ? b : a;
+  }
+
+  /// CHECK-START: double Main.$noinline$returnSecondIfNotEqualElseFirstDouble(double, double) instruction_simplifier$after_gvn (before)
+  /// CHECK:     <<Param1:d\d+>> ParameterValue
+  /// CHECK:     <<Param2:d\d+>> ParameterValue
+  /// CHECK:     <<Select:d\d+>> Select [<<Param2>>,<<Param1>>,<<Cond:z\d+>>]
+  /// CHECK:     <<Return:v\d+>> Return [<<Select>>]
+
+  /// CHECK-START: double Main.$noinline$returnSecondIfNotEqualElseFirstDouble(double, double) disassembly (after)
+  /// CHECK:     <<Param1:d\d+>> ParameterValue
+  /// CHECK:     <<Param2:d\d+>> ParameterValue
+  /// CHECK:     <<Select:d\d+>> Select [<<Param2>>,<<Param1>>,<<Cond:z\d+>>]
+  /// CHECK:     <<Return:v\d+>> Return [<<Select>>]
+  private static double $noinline$returnSecondIfNotEqualElseFirstDouble(double a, double b) {
+    return a != b ? b : a;
+  }
+
+  // Check that (x << N >>> N) and (x << N >> N) are simplified to corresponding TypeConversion.
+
+  // Check T -> int -> Unsigned<T> -> int cases.
+
+  /// CHECK-START: int Main.$noinline$testByteToIntAsUnsigned(byte) instruction_simplifier (before)
+  /// CHECK:     <<Param:b\d+>>   ParameterValue
+  /// CHECK:     <<Const24:i\d+>> IntConstant 24
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const24>>]
+  /// CHECK:     <<UShr:i\d+>>    UShr [<<Shl>>,<<Const24>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<UShr>>]
+
+  /// CHECK-START: int Main.$noinline$testByteToIntAsUnsigned(byte) instruction_simplifier (after)
+  /// CHECK:     <<Param:b\d+>>   ParameterValue
+  /// CHECK:     <<Conv:a\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testByteToIntAsUnsigned(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testByteToIntAsUnsigned(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  UShr
+  private static int $noinline$testByteToIntAsUnsigned(byte arg) {
+    return arg << 24 >>> 24;
+  }
+
+  /// CHECK-START: int Main.$noinline$testShortToIntAsUnsigned(short) instruction_simplifier (before)
+  /// CHECK:     <<Param:s\d+>>   ParameterValue
+  /// CHECK:     <<Const16:i\d+>> IntConstant 16
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const16>>]
+  /// CHECK:     <<UShr:i\d+>>    UShr [<<Shl>>,<<Const16>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<UShr>>]
+
+  /// CHECK-START: int Main.$noinline$testShortToIntAsUnsigned(short) instruction_simplifier (after)
+  /// CHECK:     <<Param:s\d+>>   ParameterValue
+  /// CHECK:     <<Conv:c\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testShortToIntAsUnsigned(short) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testShortToIntAsUnsigned(short) instruction_simplifier (after)
+  /// CHECK-NOT:                  UShr
+  private static int $noinline$testShortToIntAsUnsigned(short arg) {
+    return arg << 16 >>> 16;
+  }
+
+  /// CHECK-START: int Main.$noinline$testCharToIntAsUnsigned(char) instruction_simplifier (before)
+  /// CHECK:     <<Param:c\d+>>   ParameterValue
+  /// CHECK:     <<Const16:i\d+>> IntConstant 16
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const16>>]
+  /// CHECK:     <<UShr:i\d+>>    UShr [<<Shl>>,<<Const16>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<UShr>>]
+
+  /// CHECK-START: int Main.$noinline$testCharToIntAsUnsigned(char) instruction_simplifier (after)
+  /// CHECK:     <<Param:c\d+>>   ParameterValue
+  /// CHECK:     <<Return:v\d+>>  Return [<<Param>>]
+
+  /// CHECK-START: int Main.$noinline$testCharToIntAsUnsigned(char) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testCharToIntAsUnsigned(char) instruction_simplifier (after)
+  /// CHECK-NOT:                  UShr
+  private static int $noinline$testCharToIntAsUnsigned(char arg) {
+    return arg << 16 >>> 16;
+  }
+
+  // Check T -> int -> Signed<T> -> int cases.
+
+  /// CHECK-START: int Main.$noinline$testByteToIntAsSigned(byte) instruction_simplifier (before)
+  /// CHECK:     <<Param:b\d+>>   ParameterValue
+  /// CHECK:     <<Const24:i\d+>> IntConstant 24
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const24>>]
+  /// CHECK:     <<Shr:i\d+>>     Shr [<<Shl>>,<<Const24>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Shr>>]
+
+  /// CHECK-START: int Main.$noinline$testByteToIntAsSigned(byte) instruction_simplifier (after)
+  /// CHECK:     <<Param:b\d+>>   ParameterValue
+  /// CHECK:     <<Return:v\d+>>  Return [<<Param>>]
+
+  /// CHECK-START: int Main.$noinline$testByteToIntAsSigned(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testByteToIntAsSigned(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shr
+  private static int $noinline$testByteToIntAsSigned(byte arg) {
+    return arg << 24 >> 24;
+  }
+
+  /// CHECK-START: int Main.$noinline$testShortToIntAsSigned(short) instruction_simplifier (before)
+  /// CHECK:     <<Param:s\d+>>   ParameterValue
+  /// CHECK:     <<Const16:i\d+>> IntConstant 16
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const16>>]
+  /// CHECK:     <<Shr:i\d+>>     Shr [<<Shl>>,<<Const16>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Shr>>]
+
+  /// CHECK-START: int Main.$noinline$testShortToIntAsSigned(short) instruction_simplifier (after)
+  /// CHECK:     <<Param:s\d+>>   ParameterValue
+  /// CHECK:     <<Return:v\d+>>  Return [<<Param>>]
+
+  /// CHECK-START: int Main.$noinline$testShortToIntAsSigned(short) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testShortToIntAsSigned(short) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shr
+  private static int $noinline$testShortToIntAsSigned(short arg) {
+    return arg << 16 >> 16;
+  }
+
+  /// CHECK-START: int Main.$noinline$testCharToIntAsSigned(char) instruction_simplifier (before)
+  /// CHECK:     <<Param:c\d+>>   ParameterValue
+  /// CHECK:     <<Const16:i\d+>> IntConstant 16
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const16>>]
+  /// CHECK:     <<Shr:i\d+>>     Shr [<<Shl>>,<<Const16>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Shr>>]
+
+  /// CHECK-START: int Main.$noinline$testCharToIntAsSigned(char) instruction_simplifier (after)
+  /// CHECK:     <<Param:c\d+>>   ParameterValue
+  /// CHECK:     <<Conv:s\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testCharToIntAsSigned(char) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testCharToIntAsSigned(char) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shr
+  private static int $noinline$testCharToIntAsSigned(char arg) {
+    return arg << 16 >> 16;
+  }
+
+  // Check T -> U (narrowing) -> int cases where M is unsigned type.
+
+  /// CHECK-START: int Main.$noinline$testShortToByteToIntAsUnsigned(short) instruction_simplifier (before)
+  /// CHECK:     <<Param:s\d+>>   ParameterValue
+  /// CHECK:     <<Const24:i\d+>> IntConstant 24
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const24>>]
+  /// CHECK:     <<UShr:i\d+>>    UShr [<<Shl>>,<<Const24>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<UShr>>]
+
+  /// CHECK-START: int Main.$noinline$testShortToByteToIntAsUnsigned(short) instruction_simplifier (after)
+  /// CHECK:     <<Param:s\d+>>   ParameterValue
+  /// CHECK:     <<Conv:a\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testShortToByteToIntAsUnsigned(short) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testShortToByteToIntAsUnsigned(short) instruction_simplifier (after)
+  /// CHECK-NOT:                  UShr
+  private static int $noinline$testShortToByteToIntAsUnsigned(short arg) {
+    return arg << 24 >>> 24;
+  }
+
+  /// CHECK-START: int Main.$noinline$testCharToByteToIntAsUnsigned(char) instruction_simplifier (before)
+  /// CHECK:     <<Param:c\d+>>   ParameterValue
+  /// CHECK:     <<Const24:i\d+>> IntConstant 24
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const24>>]
+  /// CHECK:     <<UShr:i\d+>>    UShr [<<Shl>>,<<Const24>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<UShr>>]
+
+  /// CHECK-START: int Main.$noinline$testCharToByteToIntAsUnsigned(char) instruction_simplifier (after)
+  /// CHECK:     <<Param:c\d+>>   ParameterValue
+  /// CHECK:     <<Conv:a\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testCharToByteToIntAsUnsigned(char) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testCharToByteToIntAsUnsigned(char) instruction_simplifier (after)
+  /// CHECK-NOT:                  UShr
+  private static int $noinline$testCharToByteToIntAsUnsigned(char arg) {
+    return arg << 24 >>> 24;
+  }
+
+  // Check T -> S (narrowing) -> int cases where S is signed type.
+
+  /// CHECK-START: int Main.$noinline$testShortToByteToIntAsSigned(short) instruction_simplifier (before)
+  /// CHECK:     <<Param:s\d+>>   ParameterValue
+  /// CHECK:     <<Const24:i\d+>> IntConstant 24
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const24>>]
+  /// CHECK:     <<Shr:i\d+>>     Shr [<<Shl>>,<<Const24>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Shr>>]
+
+  /// CHECK-START: int Main.$noinline$testShortToByteToIntAsSigned(short) instruction_simplifier (after)
+  /// CHECK:     <<Param:s\d+>>   ParameterValue
+  /// CHECK:     <<Conv:b\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testShortToByteToIntAsSigned(short) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testShortToByteToIntAsSigned(short) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shr
+  private static int $noinline$testShortToByteToIntAsSigned(short arg) {
+    return arg << 24 >> 24;
+  }
+
+  /// CHECK-START: int Main.$noinline$testCharToByteToIntAsSigned(char) instruction_simplifier (before)
+  /// CHECK:     <<Param:c\d+>>   ParameterValue
+  /// CHECK:     <<Const24:i\d+>> IntConstant 24
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const24>>]
+  /// CHECK:     <<Shr:i\d+>>     Shr [<<Shl>>,<<Const24>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Shr>>]
+
+  /// CHECK-START: int Main.$noinline$testCharToByteToIntAsSigned(char) instruction_simplifier (after)
+  /// CHECK:     <<Param:c\d+>>   ParameterValue
+  /// CHECK:     <<Conv:b\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testCharToByteToIntAsSigned(char) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testCharToByteToIntAsSigned(char) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shr
+  private static int $noinline$testCharToByteToIntAsSigned(char arg) {
+    return arg << 24 >> 24;
+  }
+
+  // Check int -> U -> int cases where U is a unsigned type.
+
+  /// CHECK-START: int Main.$noinline$testIntToUnsignedByteToInt(int) instruction_simplifier (before)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Const24:i\d+>> IntConstant 24
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const24>>]
+  /// CHECK:     <<UShr:i\d+>>    UShr [<<Shl>>,<<Const24>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<UShr>>]
+
+  /// CHECK-START: int Main.$noinline$testIntToUnsignedByteToInt(int) instruction_simplifier (after)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Conv:a\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testIntToUnsignedByteToInt(int) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testIntToUnsignedByteToInt(int) instruction_simplifier (after)
+  /// CHECK-NOT:                  UShr
+  private static int $noinline$testIntToUnsignedByteToInt(int arg) {
+    return arg << 24 >>> 24;
+  }
+
+  /// CHECK-START: int Main.$noinline$testIntToUnsignedShortToInt(int) instruction_simplifier (before)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Const16:i\d+>> IntConstant 16
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const16>>]
+  /// CHECK:     <<UShr:i\d+>>    UShr [<<Shl>>,<<Const16>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<UShr>>]
+
+  /// CHECK-START: int Main.$noinline$testIntToUnsignedShortToInt(int) instruction_simplifier (after)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Conv:c\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testIntToUnsignedShortToInt(int) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testIntToUnsignedShortToInt(int) instruction_simplifier (after)
+  /// CHECK-NOT:                  UShr
+  private static int $noinline$testIntToUnsignedShortToInt(int arg) {
+    return arg << 16 >>> 16;
+  }
+
+  // Check int -> S -> int cases where S is a signed type.
+
+  /// CHECK-START: int Main.$noinline$testIntToSignedByteToInt(int) instruction_simplifier (before)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Const24:i\d+>> IntConstant 24
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const24>>]
+  /// CHECK:     <<Shr:i\d+>>     Shr [<<Shl>>,<<Const24>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Shr>>]
+
+  /// CHECK-START: int Main.$noinline$testIntToSignedByteToInt(int) instruction_simplifier (after)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Conv:b\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testIntToSignedByteToInt(int) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testIntToSignedByteToInt(int) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shr
+  private static int $noinline$testIntToSignedByteToInt(int arg) {
+    return arg << 24 >> 24;
+  }
+
+  /// CHECK-START: int Main.$noinline$testIntToSignedShortToInt(int) instruction_simplifier (before)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Const16:i\d+>> IntConstant 16
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const16>>]
+  /// CHECK:     <<Shr:i\d+>>     Shr [<<Shl>>,<<Const16>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Shr>>]
+
+  /// CHECK-START: int Main.$noinline$testIntToSignedShortToInt(int) instruction_simplifier (after)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Conv:s\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testIntToSignedShortToInt(int) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testIntToSignedShortToInt(int) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shr
+  private static int $noinline$testIntToSignedShortToInt(int arg) {
+    return arg << 16 >> 16;
+  }
+
+  // Check T -> U -> int cases where U is a unsigned type.
+
+  /// CHECK-START: int Main.$noinline$testCharToUnsignedByteToInt(char) instruction_simplifier (before)
+  /// CHECK:     <<Param:c\d+>>   ParameterValue
+  /// CHECK:     <<Const24:i\d+>> IntConstant 24
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const24>>]
+  /// CHECK:     <<UShr:i\d+>>    UShr [<<Shl>>,<<Const24>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<UShr>>]
+
+  /// CHECK-START: int Main.$noinline$testCharToUnsignedByteToInt(char) instruction_simplifier (after)
+  /// CHECK:     <<Param:c\d+>>   ParameterValue
+  /// CHECK:     <<Conv:a\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testCharToUnsignedByteToInt(char) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testCharToUnsignedByteToInt(char) instruction_simplifier (after)
+  /// CHECK-NOT:                  UShr
+  private static int $noinline$testCharToUnsignedByteToInt(char arg) {
+    return arg << 24 >>> 24;
+  }
+
+  /// CHECK-START: int Main.$noinline$testShortToUnsignedByteToInt(short) instruction_simplifier (before)
+  /// CHECK:     <<Param:s\d+>>   ParameterValue
+  /// CHECK:     <<Const24:i\d+>> IntConstant 24
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const24>>]
+  /// CHECK:     <<UShr:i\d+>>    UShr [<<Shl>>,<<Const24>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<UShr>>]
+
+  /// CHECK-START: int Main.$noinline$testShortToUnsignedByteToInt(short) instruction_simplifier (after)
+  /// CHECK:     <<Param:s\d+>>   ParameterValue
+  /// CHECK:     <<Conv:a\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testShortToUnsignedByteToInt(short) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testShortToUnsignedByteToInt(short) instruction_simplifier (after)
+  /// CHECK-NOT:                  UShr
+  private static int $noinline$testShortToUnsignedByteToInt(short arg) {
+    return arg << 24 >>> 24;
+  }
+
+  // Check T -> S -> int cases where S is a signed type.
+
+  /// CHECK-START: int Main.$noinline$testCharToSignedByteToInt(char) instruction_simplifier (before)
+  /// CHECK:     <<Param:c\d+>>   ParameterValue
+  /// CHECK:     <<Const24:i\d+>> IntConstant 24
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const24>>]
+  /// CHECK:     <<Shr:i\d+>>     Shr [<<Shl>>,<<Const24>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Shr>>]
+
+  /// CHECK-START: int Main.$noinline$testCharToSignedByteToInt(char) instruction_simplifier (after)
+  /// CHECK:     <<Param:c\d+>>   ParameterValue
+  /// CHECK:     <<Conv:b\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testCharToSignedByteToInt(char) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testCharToSignedByteToInt(char) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shr
+  private static int $noinline$testCharToSignedByteToInt(char arg) {
+    return arg << 24 >> 24;
+  }
+
+  /// CHECK-START: int Main.$noinline$testShortToSignedByteToInt(short) instruction_simplifier (before)
+  /// CHECK:     <<Param:s\d+>>   ParameterValue
+  /// CHECK:     <<Const24:i\d+>> IntConstant 24
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const24>>]
+  /// CHECK:     <<Shr:i\d+>>     Shr [<<Shl>>,<<Const24>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Shr>>]
+
+  /// CHECK-START: int Main.$noinline$testShortToSignedByteToInt(short) instruction_simplifier (after)
+  /// CHECK:     <<Param:s\d+>>   ParameterValue
+  /// CHECK:     <<Conv:b\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testShortToSignedByteToInt(short) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testShortToSignedByteToInt(short) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shr
+  private static int $noinline$testShortToSignedByteToInt(short arg) {
+    return arg << 24 >> 24;
+  }
+
+  // Check cases with shift amounts > 32.
+
+  /// CHECK-START: int Main.$noinline$testUnsignedPromotionWithHugeShiftAmount(int) instruction_simplifier (before)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Const48:i\d+>> IntConstant 48
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const48>>]
+  /// CHECK:     <<UShr:i\d+>>    UShr [<<Shl>>,<<Const48>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<UShr>>]
+
+  /// CHECK-START: int Main.$noinline$testUnsignedPromotionWithHugeShiftAmount(int) instruction_simplifier (after)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Conv:c\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testUnsignedPromotionWithHugeShiftAmount(int) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testUnsignedPromotionWithHugeShiftAmount(int) instruction_simplifier (after)
+  /// CHECK-NOT:                  UShr
+  private static int $noinline$testUnsignedPromotionWithHugeShiftAmount(int arg) {
+    return arg << 48 >>> 48;
+  }
+
+  /// CHECK-START: int Main.$noinline$testUnsignedPromotionWithHugeMismatchedShiftAmount(int) instruction_simplifier (before)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Const48:i\d+>> IntConstant 48
+  /// CHECK:     <<Const16:i\d+>> IntConstant 16
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const48>>]
+  /// CHECK:     <<UShr:i\d+>>    UShr [<<Shl>>,<<Const16>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<UShr>>]
+
+  /// CHECK-START: int Main.$noinline$testUnsignedPromotionWithHugeMismatchedShiftAmount(int) instruction_simplifier (after)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Conv:c\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testUnsignedPromotionWithHugeMismatchedShiftAmount(int) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testUnsignedPromotionWithHugeMismatchedShiftAmount(int) instruction_simplifier (after)
+  /// CHECK-NOT:                  UShr
+  private static int $noinline$testUnsignedPromotionWithHugeMismatchedShiftAmount(int arg) {
+    return arg << 48 >>> 16;
+  }
+
+  // Negative checks.
+
+  /// CHECK-START: long Main.$noinline$testUnsignedPromotionToLong(long) instruction_simplifier (after)
+  /// CHECK:     <<Param:j\d+>>   ParameterValue
+  /// CHECK:     <<Const56:i\d+>> IntConstant 56
+  /// CHECK:     <<Shl:j\d+>>     Shl [<<Param>>,<<Const56>>]
+  /// CHECK:     <<UShr:j\d+>>    UShr [<<Shl>>,<<Const56>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<UShr>>]
+  private static long $noinline$testUnsignedPromotionToLong(long arg) {
+    // Check that we don't do simplification in the case of unsigned promotion to long.
+    return arg << 56 >>> 56;
+  }
+
+  /// CHECK-START: long Main.$noinline$testSignedPromotionToLong(long) instruction_simplifier (after)
+  /// CHECK:     <<Param:j\d+>>   ParameterValue
+  /// CHECK:     <<Const56:i\d+>> IntConstant 56
+  /// CHECK:     <<Shl:j\d+>>     Shl [<<Param>>,<<Const56>>]
+  /// CHECK:     <<Shr:j\d+>>     Shr [<<Shl>>,<<Const56>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Shr>>]
+  private static long $noinline$testSignedPromotionToLong(long arg) {
+    // Check that we don't do simplification in the case of signed promotion to long.
+    return arg << 56 >> 56;
+  }
+
+  /// CHECK-START: int Main.$noinline$testUnsignedPromotionWithNonConstantShiftAmount(int, int) instruction_simplifier (after)
+  /// CHECK:     <<Param1:i\d+>>  ParameterValue
+  /// CHECK:     <<Param2:i\d+>>  ParameterValue
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param1>>,<<Param2>>]
+  /// CHECK:     <<UShr:i\d+>>    UShr [<<Shl>>,<<Param2>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<UShr>>]
+  private static int
+  $noinline$testUnsignedPromotionWithNonConstantShiftAmount(int value, int shift_amount) {
+    // Check that we don't do simplification in the case of unsigned promotion with
+    // non constant shift amount.
+    return value << shift_amount >>> shift_amount;
+  }
+
+  /// CHECK-START: int Main.$noinline$testSignedPromotionWithNonConstantShiftAmount(int, int) instruction_simplifier (after)
+  /// CHECK:     <<Param1:i\d+>>  ParameterValue
+  /// CHECK:     <<Param2:i\d+>>  ParameterValue
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param1>>,<<Param2>>]
+  /// CHECK:     <<Shr:i\d+>>     Shr [<<Shl>>,<<Param2>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Shr>>]
+  private static int
+  $noinline$testSignedPromotionWithNonConstantShiftAmount(int value, int shift_amount) {
+    // Check that we don't do simplification in the case of signed promotion with
+    // non constant shift amount.
+    return value << shift_amount >> shift_amount;
+  }
+
+  /// CHECK-START: int Main.$noinline$testUnsignedPromotionWithShlUse(int) instruction_simplifier (after)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Const24:i\d+>> IntConstant 24
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const24>>]
+  /// CHECK:     <<UShr:i\d+>>    UShr [<<Shl>>,<<Const24>>]
+  /// CHECK:     <<Add:i\d+>>     Add [<<UShr>>,<<Shl>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Add>>]
+  private static int $noinline$testUnsignedPromotionWithShlUse(int arg) {
+    // Check that we don't do simplification in the case of unsigned promotion
+    // with shl instruction that has more than 1 user.
+    int tmp = arg << 24;
+    return (tmp >>> 24) + tmp;
+  }
+
+  /// CHECK-START: int Main.$noinline$testSignedPromotionWithShlUse(int) instruction_simplifier (after)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Const24:i\d+>> IntConstant 24
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const24>>]
+  /// CHECK:     <<Shr:i\d+>>     Shr [<<Shl>>,<<Const24>>]
+  /// CHECK:     <<Add:i\d+>>     Add [<<Shr>>,<<Shl>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Add>>]
+  private static int $noinline$testSignedPromotionWithShlUse(int arg) {
+    // Check that we don't do simplification in the case of signed promotion
+    // with shl instruction that has more than 1 user.
+    int tmp = arg << 24;
+    return (tmp >> 24) + tmp;
+  }
+
+  /// CHECK-START: int Main.$noinline$testUnsignedPromotionPatternWithIncorrectShiftAmountConstant(int) instruction_simplifier (after)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Const25:i\d+>> IntConstant 25
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const25>>]
+  /// CHECK:     <<UShr:i\d+>>    UShr [<<Shl>>,<<Const25>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<UShr>>]
+
+  private static int
+  $noinline$testUnsignedPromotionPatternWithIncorrectShiftAmountConstant(int arg) {
+    // Check that we don't do simplification in the case of 32 - N doesn't correspond
+    // to the size of an integral type.
+    return arg << 25 >>> 25;
+  }
+
+  /// CHECK-START: int Main.$noinline$testSignedPromotionPatternWithIncorrectShiftAmountConstant(int) instruction_simplifier (after)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Const25:i\d+>> IntConstant 25
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const25>>]
+  /// CHECK:     <<Shr:i\d+>>     Shr [<<Shl>>,<<Const25>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Shr>>]
+
+  private static int
+  $noinline$testSignedPromotionPatternWithIncorrectShiftAmountConstant(int arg) {
+    // Check that we don't do simplification in the case of 32 - N doesn't correspond
+    // to the size of an integral type.
+    return arg << 25 >> 25;
+  }
+
+  /// CHECK-START: int Main.$noinline$testUnsignedPromotionPatternWithDifferentShiftAmountConstants(int) instruction_simplifier (after)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Const24:i\d+>> IntConstant 24
+  /// CHECK:     <<Const16:i\d+>> IntConstant 16
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const24>>]
+  /// CHECK:     <<UShr:i\d+>>    UShr [<<Shl>>,<<Const16>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<UShr>>]
+
+  private static int
+  $noinline$testUnsignedPromotionPatternWithDifferentShiftAmountConstants(int arg) {
+    // Check that we don't do simplification in the case of different shift amounts.
+    return arg << 24 >>> 16;
+  }
+
+  /// CHECK-START: int Main.$noinline$testSignedPromotionPatternWithDifferentShiftAmountConstants(int) instruction_simplifier (after)
+  /// CHECK:     <<Param:i\d+>>   ParameterValue
+  /// CHECK:     <<Const25:i\d+>> IntConstant 25
+  /// CHECK:     <<Const26:i\d+>> IntConstant 26
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const25>>]
+  /// CHECK:     <<Shr:i\d+>>     Shr [<<Shl>>,<<Const26>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Shr>>]
+
+  private static
+  int $noinline$testSignedPromotionPatternWithDifferentShiftAmountConstants(int arg) {
+    // Check that we do not simplification in the case of different shift amounts.
+    return arg << 25 >> 26;
+  }
+
+  // Check that we don't introduce new implicit type conversions so the following pattern
+  // does not occur in the graph:
+  //
+  // <<ImplicitConv>> TypeConversion
+  // <<ExplicitConv>> TypeConversonn [<<ImplicitConv>>]
+  //
+  // That will lead to a crash because InstructionSimplifier removes implicit type conversions
+  // and during visiting TypeConversion instruction expects that its inputs have been already
+  // simplified.
+  //
+  // The structure of the following tests is
+  //
+  //   (T) ((x << N) >> N) or (T) ((x << N) >>> N)
+  //
+  // where
+  //   * K is a type of x
+  //   * Shifts correspond to implicit type conversion K -> M
+  //   * M -> T conversion is explicit
+  //
+  // T itself doesn't matter, the only important thing is that M -> T is explicit.
+  //
+  // We check cases when shifts correspond to the following implicit type conversions:
+  //   byte -> byte
+  //   byte -> short
+  //   unsigned byte -> unsigned byte
+  //   unsigned byte -> short
+  //   unsigned byte -> char
+  //   short -> short
+  //   char -> char
+  //
+  // To produce unsigned byte bitwise AND with 0xFF is used.
+
+  /// CHECK-START: int Main.$noinline$testByteToByteToChar(byte) instruction_simplifier (before)
+  /// CHECK:     <<Param:b\d+>>   ParameterValue
+  /// CHECK:     <<Const24:i\d+>> IntConstant 24
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const24>>]
+  /// CHECK:     <<Shr:i\d+>>     Shr [<<Shl>>,<<Const24>>]
+  /// CHECK:     <<Conv:c\d+>>    TypeConversion [<<Shr>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testByteToByteToChar(byte) instruction_simplifier (after)
+  /// CHECK:     <<Param:b\d+>>   ParameterValue
+  /// CHECK:     <<Conv:c\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testByteToByteToChar(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testByteToByteToChar(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shr
+  private static int $noinline$testByteToByteToChar(byte arg) {
+    return (char) ((arg << 24) >> 24);
+  }
+
+  /// CHECK-START: int Main.$noinline$testByteToShortToByte(byte) instruction_simplifier (before)
+  /// CHECK:     <<Param:b\d+>>   ParameterValue
+  /// CHECK:     <<Const16:i\d+>> IntConstant 16
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const16>>]
+  /// CHECK:     <<Shr:i\d+>>     Shr [<<Shl>>,<<Const16>>]
+  /// CHECK:     <<Conv:b\d+>>    TypeConversion [<<Shr>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testByteToShortToByte(byte) instruction_simplifier (after)
+  /// CHECK:     <<Param:b\d+>>   ParameterValue
+  /// CHECK:     <<Return:v\d+>>  Return [<<Param>>]
+
+  /// CHECK-START: int Main.$noinline$testByteToShortToByte(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testByteToShortToByte(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shr
+
+  /// CHECK-START: int Main.$noinline$testByteToShortToByte(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  TypeConversion
+  private static int $noinline$testByteToShortToByte(byte arg) {
+    return (byte) ((arg << 16) >> 16);
+  }
+
+  /// CHECK-START: int Main.$noinline$testUnsignedByteToUnsignedByteToByte(byte) instruction_simplifier (before)
+  /// CHECK:     <<Param:b\d+>>    ParameterValue
+  /// CHECK:     <<Const255:i\d+>> IntConstant 255
+  /// CHECK:     <<Const24:i\d+>>  IntConstant 24
+  /// CHECK:     <<And:i\d+>>      And [<<Param>>,<<Const255>>]
+  /// CHECK:     <<Shl:i\d+>>      Shl [<<And>>,<<Const24>>]
+  /// CHECK:     <<UShr:i\d+>>     UShr [<<Shl>>,<<Const24>>]
+  /// CHECK:     <<Conv:b\d+>>     TypeConversion [<<UShr>>]
+  /// CHECK:     <<Return:v\d+>>   Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testUnsignedByteToUnsignedByteToByte(byte) instruction_simplifier (after)
+  /// CHECK:     <<Param:b\d+>>   ParameterValue
+  /// CHECK:     <<Return:v\d+>>  Return [<<Param>>]
+
+  /// CHECK-START: int Main.$noinline$testUnsignedByteToUnsignedByteToByte(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testUnsignedByteToUnsignedByteToByte(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shr
+
+  /// CHECK-START: int Main.$noinline$testUnsignedByteToUnsignedByteToByte(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  TypeConversion
+  private static int $noinline$testUnsignedByteToUnsignedByteToByte(byte arg) {
+    return (byte) (((arg & 0xFF) << 24) >>> 24);
+  }
+
+  /// CHECK-START: int Main.$noinline$testUnsignedByteToShortToByte(byte) instruction_simplifier (before)
+  /// CHECK:     <<Param:b\d+>>    ParameterValue
+  /// CHECK:     <<Const255:i\d+>> IntConstant 255
+  /// CHECK:     <<Const16:i\d+>>  IntConstant 16
+  /// CHECK:     <<And:i\d+>>      And [<<Param>>,<<Const255>>]
+  /// CHECK:     <<Shl:i\d+>>      Shl [<<And>>,<<Const16>>]
+  /// CHECK:     <<Shr:i\d+>>      Shr [<<Shl>>,<<Const16>>]
+  /// CHECK:     <<Conv:b\d+>>     TypeConversion [<<Shr>>]
+  /// CHECK:     <<Return:v\d+>>   Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testUnsignedByteToShortToByte(byte) instruction_simplifier (after)
+  /// CHECK:     <<Param:b\d+>>   ParameterValue
+  /// CHECK:     <<Return:v\d+>>  Return [<<Param>>]
+
+  /// CHECK-START: int Main.$noinline$testUnsignedByteToShortToByte(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testUnsignedByteToShortToByte(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shr
+
+  /// CHECK-START: int Main.$noinline$testUnsignedByteToShortToByte(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  TypeConversion
+  private static int $noinline$testUnsignedByteToShortToByte(byte arg) {
+    return (byte) (((arg & 0xFF) << 16) >> 16);
+  }
+
+  /// CHECK-START: int Main.$noinline$testUnsignedByteToCharToByte(byte) instruction_simplifier (before)
+  /// CHECK:     <<Param:b\d+>>    ParameterValue
+  /// CHECK:     <<Const255:i\d+>> IntConstant 255
+  /// CHECK:     <<Const16:i\d+>>  IntConstant 16
+  /// CHECK:     <<And:i\d+>>      And [<<Param>>,<<Const255>>]
+  /// CHECK:     <<Shl:i\d+>>      Shl [<<And>>,<<Const16>>]
+  /// CHECK:     <<UShr:i\d+>>     UShr [<<Shl>>,<<Const16>>]
+  /// CHECK:     <<Conv:b\d+>>     TypeConversion [<<UShr>>]
+  /// CHECK:     <<Return:v\d+>>   Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testUnsignedByteToCharToByte(byte) instruction_simplifier (after)
+  /// CHECK:     <<Param:b\d+>>   ParameterValue
+  /// CHECK:     <<Return:v\d+>>  Return [<<Param>>]
+
+  /// CHECK-START: int Main.$noinline$testUnsignedByteToCharToByte(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testUnsignedByteToCharToByte(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shr
+
+  /// CHECK-START: int Main.$noinline$testUnsignedByteToCharToByte(byte) instruction_simplifier (after)
+  /// CHECK-NOT:                  TypeConversion
+  private static int $noinline$testUnsignedByteToCharToByte(byte arg) {
+    return (byte) (((arg & 0xFF) << 16) >>> 16);
+  }
+
+  /// CHECK-START: int Main.$noinline$testShortToShortToByte(short) instruction_simplifier (before)
+  /// CHECK:     <<Param:s\d+>>   ParameterValue
+  /// CHECK:     <<Const16:i\d+>> IntConstant 16
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const16>>]
+  /// CHECK:     <<Shr:i\d+>>     Shr [<<Shl>>,<<Const16>>]
+  /// CHECK:     <<Conv:b\d+>>    TypeConversion [<<Shr>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testShortToShortToByte(short) instruction_simplifier (after)
+  /// CHECK:     <<Param:s\d+>>   ParameterValue
+  /// CHECK:     <<Conv:b\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testShortToShortToByte(short) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testShortToShortToByte(short) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shr
+  private static int $noinline$testShortToShortToByte(short arg) {
+    return (byte) ((arg << 16) >> 16);
+  }
+
+  /// CHECK-START: int Main.$noinline$testCharToCharToByte(char) instruction_simplifier (before)
+  /// CHECK:     <<Param:c\d+>>   ParameterValue
+  /// CHECK:     <<Const16:i\d+>> IntConstant 16
+  /// CHECK:     <<Shl:i\d+>>     Shl [<<Param>>,<<Const16>>]
+  /// CHECK:     <<UShr:i\d+>>    UShr [<<Shl>>,<<Const16>>]
+  /// CHECK:     <<Conv:b\d+>>    TypeConversion [<<UShr>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testCharToCharToByte(char) instruction_simplifier (after)
+  /// CHECK:     <<Param:c\d+>>   ParameterValue
+  /// CHECK:     <<Conv:b\d+>>    TypeConversion [<<Param>>]
+  /// CHECK:     <<Return:v\d+>>  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$testCharToCharToByte(char) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shl
+
+  /// CHECK-START: int Main.$noinline$testCharToCharToByte(char) instruction_simplifier (after)
+  /// CHECK-NOT:                  Shr
+  private static int $noinline$testCharToCharToByte(char arg) {
+    return (byte) ((arg << 16) >>> 16);
+  }
+
   public static void main(String[] args) throws Exception {
     Class smaliTests2 = Class.forName("SmaliTests2");
     Method $noinline$XorAllOnes = smaliTests2.getMethod("$noinline$XorAllOnes", int.class);
@@ -3005,6 +4103,36 @@
     assertFloatEquals(floatArg, $noinline$floatSubAddSimplifyLeft(floatArg, 654321.125f));
     assertFloatEquals(floatArg, $noinline$floatSubAddSimplifyRight(floatArg, 654321.125f));
 
+    // Sub/Add and Sub/Sub simplifications
+    final int[] int_inputs = {0, 1, -1, Integer.MIN_VALUE, Integer.MAX_VALUE, 42, -9000};
+    for (int x : int_inputs) {
+      for (int y : int_inputs) {
+        // y - (x + y) = -x
+        assertIntEquals(-x, $noinline$testSubAddInt(x, y));
+        // x - (x + y) = -y.
+        assertIntEquals(-y, $noinline$testSubAddOtherVersionInt(x, y));
+        // (x - y) - x = -y.
+        assertIntEquals(-y, $noinline$testSubSubInt(x, y));
+        // x - (x - y) = y.
+        assertIntEquals(y, $noinline$testSubSubOtherVersionInt(x, y));
+      }
+    }
+
+    final long[] long_inputs = {0L, 1L, -1L, Long.MIN_VALUE, Long.MAX_VALUE, 0x100000000L,
+            0x100000001L, -9000L, 0x0123456789ABCDEFL};
+    for (long x : long_inputs) {
+      for (long y : long_inputs) {
+        // y - (x + y) = -x
+        assertLongEquals(-x, $noinline$testSubAddLong(x, y));
+        // x - (x + y) = -y.
+        assertLongEquals(-y, $noinline$testSubAddOtherVersionLong(x, y));
+        // (x - y) - x = -y.
+        assertLongEquals(-y, $noinline$testSubSubLong(x, y));
+        // x - (x - y) = y.
+        assertLongEquals(y, $noinline$testSubSubOtherVersionLong(x, y));
+      }
+    }
+
     Main m = new Main();
     m.instanceByteField = -1;
     assertIntEquals(0xff, $noinline$getUint8FromInstanceByteField(m));
@@ -3103,6 +4231,103 @@
     assertIntEquals(111, $noinline$redundantAndRegressionNotConstant(-1, 0x6f45));
 
     assertIntEquals(50, $noinline$deadAddAfterUnrollingAndSimplification(new int[] { 0 }));
+
+    for (int x : int_inputs) {
+      for (int y : int_inputs) {
+        assertIntEquals(x, $noinline$returnSecondIfEqualElseFirstInt(x, y));
+        assertIntEquals(y, $noinline$returnSecondIfNotEqualElseFirstInt(x, y));
+      }
+    }
+
+    for (long x : long_inputs) {
+      for (long y : long_inputs) {
+        assertLongEquals(x, $noinline$returnSecondIfEqualElseFirstLong(x, y));
+        assertLongEquals(y, $noinline$returnSecondIfNotEqualElseFirstLong(x, y));
+      }
+    }
+
+    assertIntEquals(0xaa, $noinline$testByteToIntAsUnsigned((byte) 0xaa));
+    assertIntEquals(0xaabb, $noinline$testShortToIntAsUnsigned((short) 0xaabb));
+    assertIntEquals(0xaabb, $noinline$testCharToIntAsUnsigned((char) 0xaabb));
+
+    assertIntEquals(0xffffffaa, $noinline$testByteToIntAsSigned((byte) 0xaa));
+    assertIntEquals(0x0a, $noinline$testByteToIntAsSigned((byte) 0x0a));
+    assertIntEquals(0xffffaabb, $noinline$testShortToIntAsSigned((short) 0xaabb));
+    assertIntEquals(0x0abb, $noinline$testShortToIntAsSigned((short) 0x0abb));
+    assertIntEquals(0xffffaabb, $noinline$testCharToIntAsSigned((char) 0xaabb));
+    assertIntEquals(0x0abb, $noinline$testCharToIntAsSigned((char) 0x0abb));
+
+    assertIntEquals(0xbb, $noinline$testShortToByteToIntAsUnsigned((short) 0xaabb));
+    assertIntEquals(0xbb, $noinline$testCharToByteToIntAsUnsigned((char) 0x0abb));
+
+    assertIntEquals(0xffffffbb, $noinline$testShortToByteToIntAsSigned((short) 0xaabb));
+    assertIntEquals(0x0b, $noinline$testShortToByteToIntAsSigned((short) 0xaa0b));
+    assertIntEquals(0xffffffbb, $noinline$testCharToByteToIntAsSigned((char) 0x0abb));
+    assertIntEquals(0x0b, $noinline$testCharToByteToIntAsSigned((char) 0x0a0b));
+
+    assertIntEquals(0xdd, $noinline$testIntToUnsignedByteToInt(0xaabbccdd));
+    assertIntEquals(0xccdd, $noinline$testIntToUnsignedShortToInt(0xaabbccdd));
+
+    assertIntEquals(0xffffffdd, $noinline$testIntToSignedByteToInt(0xaabbccdd));
+    assertIntEquals(0x0a, $noinline$testIntToSignedByteToInt(0x0a));
+    assertIntEquals(0xffffccdd, $noinline$testIntToSignedShortToInt(0xaabbccdd));
+    assertIntEquals(0x0abb, $noinline$testIntToSignedShortToInt(0x0abb));
+
+    assertIntEquals(0xbb, $noinline$testCharToUnsignedByteToInt((char) 0xaabb));
+    assertIntEquals(0xbb, $noinline$testShortToUnsignedByteToInt((short) 0xaabb));
+
+    assertIntEquals(0xffffffbb, $noinline$testCharToSignedByteToInt((char) 0xaabb));
+    assertIntEquals(0xffffffbb, $noinline$testShortToSignedByteToInt((short) 0xaabb));
+    assertIntEquals(0x0b, $noinline$testCharToSignedByteToInt((char) 0xaa0b));
+    assertIntEquals(0x0b, $noinline$testShortToSignedByteToInt((short) 0xaa0b));
+
+    assertIntEquals(0xccdd,
+        $noinline$testUnsignedPromotionWithHugeShiftAmount(0xaabbccdd));
+    assertIntEquals(0xccdd,
+        $noinline$testUnsignedPromotionWithHugeMismatchedShiftAmount(0xaabbccdd));
+
+    assertLongEquals(0xdd, $noinline$testUnsignedPromotionToLong(0x11223344aabbccddL));
+    assertLongEquals(0xffffffffffffffddL,
+        $noinline$testSignedPromotionToLong(0x11223344aabbccddL));
+
+    assertIntEquals(0xccdd,
+        $noinline$testUnsignedPromotionWithNonConstantShiftAmount(0xaabbccdd, 16));
+    assertIntEquals(0xffffffdd,
+        $noinline$testSignedPromotionWithNonConstantShiftAmount(0xaabbccdd, 24));
+
+    assertIntEquals(0xdd0000dd, $noinline$testUnsignedPromotionWithShlUse(0xaabbccdd));
+    assertIntEquals(0xdcffffdd, $noinline$testSignedPromotionWithShlUse(0xaabbccdd));
+
+    assertIntEquals(0x5d,
+        $noinline$testUnsignedPromotionPatternWithIncorrectShiftAmountConstant(0xaabbccdd));
+    assertIntEquals(0xffffffdd,
+        $noinline$testSignedPromotionPatternWithIncorrectShiftAmountConstant(0xaabbccdd));
+
+    assertIntEquals(0xdd00,
+        $noinline$testUnsignedPromotionPatternWithDifferentShiftAmountConstants(0xaabbccdd));
+    assertIntEquals(0xffffffee,
+        $noinline$testSignedPromotionPatternWithDifferentShiftAmountConstants(0xaabbccdd));
+
+    assertIntEquals(0xffaa, $noinline$testByteToByteToChar((byte) 0xaa));
+    assertIntEquals(0x0a, $noinline$testByteToByteToChar((byte) 0x0a));
+
+    assertIntEquals(0x0a, $noinline$testByteToShortToByte((byte) 0x0a));
+    assertIntEquals(0xffffffaa, $noinline$testByteToShortToByte((byte) 0xaa));
+
+    assertIntEquals(0x0a, $noinline$testUnsignedByteToUnsignedByteToByte((byte) 0x0a));
+    assertIntEquals(0xffffffaa, $noinline$testUnsignedByteToUnsignedByteToByte((byte) 0xaa));
+
+    assertIntEquals(0x0a, $noinline$testUnsignedByteToShortToByte((byte) 0x0a));
+    assertIntEquals(0xffffffaa, $noinline$testUnsignedByteToShortToByte((byte) 0xaa));
+
+    assertIntEquals(0x0a, $noinline$testUnsignedByteToCharToByte((byte) 0x0a));
+    assertIntEquals(0xffffffaa, $noinline$testUnsignedByteToCharToByte((byte) 0xaa));
+
+    assertIntEquals(0x0b, $noinline$testShortToShortToByte((short) 0xaa0b));
+    assertIntEquals(0xffffffbb, $noinline$testShortToShortToByte((short) 0xaabb));
+
+    assertIntEquals(0x0b, $noinline$testCharToCharToByte((char) 0xaa0b));
+    assertIntEquals(0xffffffbb, $noinline$testCharToCharToByte((char) 0xaabb));
   }
 
   private static boolean $inline$true() { return true; }
diff --git a/test/461-get-reference-vreg/get_reference_vreg_jni.cc b/test/461-get-reference-vreg/get_reference_vreg_jni.cc
index 0636682..00e7e9b 100644
--- a/test/461-get-reference-vreg/get_reference_vreg_jni.cc
+++ b/test/461-get-reference-vreg/get_reference_vreg_jni.cc
@@ -17,7 +17,7 @@
 #include "arch/context.h"
 #include "art_method-inl.h"
 #include "jni.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "scoped_thread_state_change-inl.h"
 #include "stack.h"
 #include "thread.h"
diff --git a/test/466-get-live-vreg/get_live_vreg_jni.cc b/test/466-get-live-vreg/get_live_vreg_jni.cc
index b1fd6b5..114741f 100644
--- a/test/466-get-live-vreg/get_live_vreg_jni.cc
+++ b/test/466-get-live-vreg/get_live_vreg_jni.cc
@@ -18,7 +18,7 @@
 #include "art_method-inl.h"
 #include "dex/code_item_accessors-inl.h"
 #include "jni.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
 #include "scoped_thread_state_change-inl.h"
 #include "stack.h"
 #include "thread.h"
diff --git a/test/476-checker-ctor-fence-redun-elim/src/Main.java b/test/476-checker-ctor-fence-redun-elim/src/Main.java
index 05f2f7c..b065b13 100644
--- a/test/476-checker-ctor-fence-redun-elim/src/Main.java
+++ b/test/476-checker-ctor-fence-redun-elim/src/Main.java
@@ -32,6 +32,13 @@
   int w2;
   int w3;
 
+  Base() {
+    // Prevent inliner from matching the code pattern when calling this constructor
+    // to test the normal inlining that builds and inserts the callee graph.
+    // (Pattern matching can merge or eliminate constructor barriers.)
+    $inline$nop();
+  }
+
   @Override
   public String toString() {
     return getClass().getName() + "(" + baseString() + ")";
@@ -40,6 +47,8 @@
   protected String baseString() {
     return String.format("w0: %d, w1: %d, w2: %d, w3: %d", w0, w1, w2, w3);
   }
+
+  private void $inline$nop() {}
 }
 
 // This has a final field in its constructor, so there must be a field freeze
diff --git a/test/476-checker-ctor-memory-barrier/src/Main.java b/test/476-checker-ctor-memory-barrier/src/Main.java
index e887cd3..f4ae3a9 100644
--- a/test/476-checker-ctor-memory-barrier/src/Main.java
+++ b/test/476-checker-ctor-memory-barrier/src/Main.java
@@ -61,7 +61,9 @@
   /// CHECK-NOT:  {{[slm]}}fence
   public ClassWithFinals() {
     // Exactly one constructor barrier.
-    x = 0;
+    // Note: Do not store 0 as that can be eliminated together with the constructor
+    // barrier by the code pattern substitution in the inliner.
+    x = 1;
   }
 
   /// CHECK-START: void ClassWithFinals.<init>(int) inliner (after)
diff --git a/test/485-checker-dce-loop-update/smali/TestCase.smali b/test/485-checker-dce-loop-update/smali/TestCase.smali
index 5290bad..3e7bca9 100644
--- a/test/485-checker-dce-loop-update/smali/TestCase.smali
+++ b/test/485-checker-dce-loop-update/smali/TestCase.smali
@@ -224,7 +224,7 @@
 ## CHECK-DAG:                    If [<<ArgY>>]                              loop:<<HeaderY>>
 #
 #                                ### Inner loop ###
-## CHECK-DAG:     <<PhiZ2:i\d+>> Phi [<<PhiZ1>>,<<XorZ>>]                   loop:<<HeaderZ:B\d+>>
+## CHECK-DAG:     <<PhiZ2:i\d+>> Phi [<<PhiZ1>>,<<Cst0>>]                   loop:<<HeaderZ:B\d+>>
 ## CHECK-DAG:     <<XorZ>>       Xor [<<PhiZ2>>,<<Cst1>>]                   loop:<<HeaderZ>>
 ## CHECK-DAG:     <<CondZ:z\d+>> Equal [<<XorZ>>,<<Cst0>>]                  loop:<<HeaderZ>>
 ## CHECK-DAG:                    If [<<CondZ>>]                             loop:<<HeaderZ>>
@@ -246,8 +246,8 @@
 ## CHECK-DAG:     <<Add7>>       Add [<<PhiX>>,<<Cst7>>]                    loop:<<HeaderY>>
 #
 #                                ### Inner loop ###
-## CHECK-DAG:     <<PhiZ:i\d+>>  Phi [<<ArgZ>>,<<XorZ:i\d+>>]               loop:<<HeaderZ:B\d+>>
-## CHECK-DAG:     <<XorZ>>       Xor [<<PhiZ>>,<<Cst1>>]                    loop:<<HeaderZ>>
+## CHECK-DAG:     <<PhiZ:i\d+>>  Phi [<<ArgZ>>,<<Cst0>>]                    loop:<<HeaderZ:B\d+>>
+## CHECK-DAG:     <<XorZ:i\d+>>  Xor [<<PhiZ>>,<<Cst1>>]                    loop:<<HeaderZ>>
 ## CHECK-DAG:     <<CondZ:z\d+>> Equal [<<XorZ>>,<<Cst0>>]                  loop:<<HeaderZ>>
 ## CHECK-DAG:                    If [<<CondZ>>]                             loop:<<HeaderZ>>
 #
diff --git a/test/530-checker-instance-of-simplifier/jasmin/Main.j b/test/530-checker-instance-of-simplifier/jasmin/Main.j
index 83cb4fa..9af04a2 100644
--- a/test/530-checker-instance-of-simplifier/jasmin/Main.j
+++ b/test/530-checker-instance-of-simplifier/jasmin/Main.j
@@ -32,7 +32,6 @@
 ;; CHECK-START: int Main.$noinline$test(boolean) instruction_simplifier$before_codegen (after)
 ;; CHECK-NOT: InstanceFieldSet
 ;; CHECK-NOT: InstanceFieldGet
-;; CHECK-NOT: PredicatedInstanceFieldGet
 
 ; public static int $noinline$test(boolean escape) {
 ;   Foo f = new Foo();
diff --git a/test/530-checker-lse-simd/src/Main.java b/test/530-checker-lse-simd/src/Main.java
index 619ac28..ec2faf5 100644
--- a/test/530-checker-lse-simd/src/Main.java
+++ b/test/530-checker-lse-simd/src/Main.java
@@ -38,10 +38,17 @@
   /// CHECK-NEXT: Sub
   /// CHECK-NEXT: Mul
   /// CHECK-NEXT: ArraySet
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-NEXT: ArrayGet
+  //
+  /// CHECK-FI:
   /// CHECK-NEXT: LessThanOrEqual
   /// CHECK-NEXT: Select
   /// CHECK-NEXT: Add
   /// CHECK-NEXT: Goto loop:{{B\d+}}
+  //
+  // TODO: reenable LSE for graphs with Predicated SIMD.
   static double $noinline$vecgen(double a[], double b[], int n) {
     double norma = 0.0;
     int init = 1325;
@@ -87,10 +94,17 @@
   /// CHECK-NEXT: ArrayGet
   /// CHECK-NEXT: Mul
   /// CHECK-NEXT: ArraySet
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-NEXT: ArrayGet
+  //
+  /// CHECK-FI:
   /// CHECK-NEXT: ArrayLength
   /// CHECK-NEXT: BelowOrEqual
   //
   /// CHECK:      Return
+  //
+  // TODO: reenable LSE for graphs with Predicated SIMD.
   static double $noinline$test02(double a[], int n) {
     double b[] = new double[n];
     a[0] = a[0] / 2;
@@ -120,7 +134,13 @@
   /// CHECK-NEXT: Return
 
   /// CHECK-START: double Main.$noinline$test03(int) load_store_elimination (after)
-  /// CHECK-NOT:  ArrayGet loop:none
+  /// CHECK-IF:     not hasIsaFeature("sve")
+  //
+  ///     CHECK-NOT:  ArrayGet loop:none
+  //
+  /// CHECK-FI:
+  //
+  // TODO: reenable LSE for graphs with Predicated SIMD.
   static double $noinline$test03(int n) {
     double a[] = new double[n];
     double b[] = new double[n];
@@ -164,7 +184,14 @@
   /// CHECK:        Add
   /// CHECK:        Goto loop:{{B\d+}}
   //
-  /// CHECK-NOT:    VecStore
+
+  /// CHECK-IF:     not hasIsaFeature("sve")
+  //
+  ///     CHECK-NOT:    VecStore
+  //
+  /// CHECK-FI:
+  //
+  // TODO: reenable LSE for graphs with Predicated SIMD.
   static double[] $noinline$test04(int n) {
     double a[] = new double[n];
     double b[] = new double[n];
@@ -194,18 +221,14 @@
   /// CHECK:        Goto loop:{{B\d+}}
 
   /// CHECK-START-ARM64: double[] Main.$noinline$test05(int) load_store_elimination (after)
-  /// CHECK-IF:     not hasIsaFeature("sve")
-  //
-  //      In NEON case there is a post-loop which prevents the store to be removed.
-  ///     CHECK:        VecStore
-  //
-  /// CHECK-FI:
-  //
+  /// CHECK:        VecStore
   /// CHECK:        VecStore
   /// CHECK:        Add
   /// CHECK:        Goto loop:{{B\d+}}
   //
   /// CHECK-NOT:    VecStore
+  //
+  // TODO: reenable LSE for graphs with Predicated SIMD.
   static double[] $noinline$test05(int n) {
     double a[] = new double[n];
     double b[] = new double[n];
@@ -249,7 +272,13 @@
   /// CHECK:        VecAdd
   /// CHECK:        VecStore
   //
-  /// CHECK-NOT:    VecStore
+  /// CHECK-IF:     not hasIsaFeature("sve")
+  //
+  ///     CHECK-NOT:    VecStore
+  //
+  /// CHECK-FI:
+  //
+  // TODO: reenable LSE for graphs with Predicated SIMD.
   static double[] $noinline$test06(int n) {
     double a[] = new double[n];
     double b[] = new double[n];
diff --git a/test/536-checker-needs-access-check/Android.bp b/test/536-checker-needs-access-check/Android.bp
index ccf524e..2f2b650 100644
--- a/test/536-checker-needs-access-check/Android.bp
+++ b/test/536-checker-needs-access-check/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-536-checker-needs-access-check-src"
+        "art-run-test-536-checker-needs-access-check-src",
     ],
     data: [
         ":art-run-test-536-checker-needs-access-check-expected-stdout",
diff --git a/test/536-checker-needs-access-check/src/Main.java b/test/536-checker-needs-access-check/src/Main.java
index bb402e5..85db2e0 100644
--- a/test/536-checker-needs-access-check/src/Main.java
+++ b/test/536-checker-needs-access-check/src/Main.java
@@ -26,7 +26,7 @@
         }
 
          try {
-            testInstanceOfNull();
+            testInstanceOfNull(null);
         } catch (IllegalAccessError e) {
             System.out.println("Got expected error instanceof null");
         }
@@ -64,10 +64,10 @@
         return ic instanceof InaccessibleClass;
     }
 
-    /// CHECK-START: boolean Main.testInstanceOfNull() register (after)
+    /// CHECK-START: boolean Main.testInstanceOfNull(java.lang.Object) register (after)
     /// CHECK: LoadClass class_name:other.InaccessibleClass
-    public static boolean testInstanceOfNull() {
-        return null instanceof InaccessibleClass;
+    public static boolean testInstanceOfNull(Object o) {
+        return o instanceof InaccessibleClass;
     }
 
     // TODO: write a test for for CheckCast with not null constant (after RTP can parse arguments).
diff --git a/test/537-checker-inline-and-unverified/Android.bp b/test/537-checker-inline-and-unverified/Android.bp
index 8078e92..cca7486 100644
--- a/test/537-checker-inline-and-unverified/Android.bp
+++ b/test/537-checker-inline-and-unverified/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-537-checker-inline-and-unverified-src"
+        "art-run-test-537-checker-inline-and-unverified-src",
     ],
     data: [
         ":art-run-test-537-checker-inline-and-unverified-expected-stdout",
diff --git a/test/543-checker-dce-trycatch/smali/TestCase.smali b/test/543-checker-dce-trycatch/smali/TestCase.smali
index 7ad9ba8..15eaabb 100644
--- a/test/543-checker-dce-trycatch/smali/TestCase.smali
+++ b/test/543-checker-dce-trycatch/smali/TestCase.smali
@@ -206,6 +206,7 @@
 ## CHECK-START: int TestCase.testCatchPhiInputs_DefinedInTryBlock(int, int, int, int) dead_code_elimination$after_inlining (before)
 ## CHECK-DAG:     <<Arg0:i\d+>>      ParameterValue
 ## CHECK-DAG:     <<Arg1:i\d+>>      ParameterValue
+## CHECK-DAG:     <<Const0x0:i\d+>>  IntConstant 0
 ## CHECK-DAG:     <<Const0xa:i\d+>>  IntConstant 10
 ## CHECK-DAG:     <<Const0xb:i\d+>>  IntConstant 11
 ## CHECK-DAG:     <<Const0xc:i\d+>>  IntConstant 12
@@ -215,7 +216,7 @@
 ## CHECK-DAG:     <<Const0x10:i\d+>> IntConstant 16
 ## CHECK-DAG:     <<Const0x11:i\d+>> IntConstant 17
 ## CHECK-DAG:     <<Add:i\d+>>       Add [<<Arg0>>,<<Arg1>>]
-## CHECK-DAG:     <<Phi:i\d+>>       Phi [<<Add>>,<<Const0xf>>] reg:3 is_catch_phi:false
+## CHECK-DAG:     <<Phi:i\d+>>       Phi [<<Const0x0>>,<<Const0xf>>] reg:3 is_catch_phi:false
 ## CHECK-DAG:                        Phi [<<Const0xa>>,<<Const0xb>>,<<Const0xd>>] reg:1 is_catch_phi:true
 ## CHECK-DAG:                        Phi [<<Add>>,<<Const0xc>>,<<Const0xe>>] reg:2 is_catch_phi:true
 ## CHECK-DAG:                        Phi [<<Phi>>,<<Const0x10>>,<<Const0x11>>] reg:3 is_catch_phi:true
@@ -248,7 +249,8 @@
     if-eqz v3, :define_phi
     const v3, 0xf
     :define_phi
-    # v3 = Phi [Add, 0xf]          # dead catch phi input, defined in the dead block (HPhi)
+    # v3 = Phi [Add, 0xf]          # dead catch phi input, defined in the dead block (HPhi).
+                                   # Note that the Add has to be equal to 0 since we do `if-eqz v3`
     div-int/2addr p0, v2
 
     :else
diff --git a/test/552-checker-x86-avx2-bit-manipulation/src/Main.java b/test/552-checker-x86-avx2-bit-manipulation/src/Main.java
index b8138dd..e795a6c 100644
--- a/test/552-checker-x86-avx2-bit-manipulation/src/Main.java
+++ b/test/552-checker-x86-avx2-bit-manipulation/src/Main.java
@@ -35,17 +35,19 @@
   /// CHECK-DAG:    Not     loop:none
   /// CHECK-DAG:    And     loop:none
 
-  // TODO:re-enable when checker supports isa features
-  // CHECK-START-X86_64: long Main.and_not_64(long, long) instruction_simplifier_x86_64 (after)
-  // CHECK-DAG:      X86AndNot loop:<<Loop:B\d+>> outer_loop:none
-  // CHECK-DAG:      X86AndNot loop:none
+  /// CHECK-START-X86_64: long Main.and_not_64(long, long) instruction_simplifier_x86_64 (after)
+  /// CHECK-IF: hasIsaFeature('avx') or hasIsaFeature('avx2')
+  /// CHECK-DAG:      X86AndNot loop:<<Loop:B\d+>> outer_loop:none
+  /// CHECK-DAG:      X86AndNot loop:none
+  /// CHECK-FI:
 
-  // TODO:re-enable when checker supports isa features
-  // CHECK-START-X86_64: long Main.and_not_64(long, long) instruction_simplifier_x86_64 (after)
-  // CHECK-NOT:      Not       loop:<<Loop>>      outer_loop:none
-  // CHECK-NOT:      And       loop:<<Loop>>      outer_loop:none
-  // CHECK-NOT:      Not       loop:none
-  // CHECK-NOT:      And       loop:none
+  /// CHECK-START-X86_64: long Main.and_not_64(long, long) instruction_simplifier_x86_64 (after)
+  /// CHECK-IF: hasIsaFeature('avx') or hasIsaFeature('avx2')
+  /// CHECK-NOT:      Not       loop:<<Loop>>      outer_loop:none
+  /// CHECK-NOT:      And       loop:<<Loop>>      outer_loop:none
+  /// CHECK-NOT:      Not       loop:none
+  /// CHECK-NOT:      And       loop:none
+  /// CHECK-FI:
   public static long and_not_64( long x, long y) {
     long j = 1;
     long k = 2;
@@ -65,18 +67,20 @@
   /// CHECK-DAG:    Not     loop:none
   /// CHECK-DAG:    And     loop:none
 
-  // TODO:re-enable when checker supports isa features
-  // CHECK-START-X86_64: int Main.and_not_32(int, int) instruction_simplifier_x86_64 (after)
-  // CHECK-DAG:      X86AndNot loop:<<Loop:B\d+>> outer_loop:none
-  // CHECK-DAG:      X86AndNot loop:<<Loop>>      outer_loop:none
-  // CHECK-DAG:      X86AndNot loop:none
+  /// CHECK-START-X86_64: int Main.and_not_32(int, int) instruction_simplifier_x86_64 (after)
+  /// CHECK-IF: hasIsaFeature('avx') or hasIsaFeature('avx2')
+  /// CHECK-DAG:      X86AndNot loop:<<Loop:B\d+>> outer_loop:none
+  /// CHECK-DAG:      X86AndNot loop:<<Loop>>      outer_loop:none
+  /// CHECK-DAG:      X86AndNot loop:none
+  /// CHECK-FI:
 
-  // TODO:re-enable when checker supports isa features
-  // CHECK-START-X86_64: int Main.and_not_32(int, int) instruction_simplifier_x86_64 (after)
-  // CHECK-NOT:      Not       loop:<<Loop>>      outer_loop:none
-  // CHECK-NOT:      And       loop:<<Loop>>      outer_loop:none
-  // CHECK-NOT:      Not       loop:none
-  // CHECK-NOT:      And       loop:none
+  /// CHECK-START-X86_64: int Main.and_not_32(int, int) instruction_simplifier_x86_64 (after)
+  /// CHECK-IF: hasIsaFeature('avx') or hasIsaFeature('avx2')
+  /// CHECK-NOT:      Not       loop:<<Loop>>      outer_loop:none
+  /// CHECK-NOT:      And       loop:<<Loop>>      outer_loop:none
+  /// CHECK-NOT:      Not       loop:none
+  /// CHECK-NOT:      And       loop:none
+  /// CHECK-FI:
   public static int and_not_32( int x, int y) {
     int j = 1;
     int k = 2;
@@ -107,20 +111,22 @@
   /// CHECK-DAG:    And     loop:<<Loop>>      outer_loop:none
 
 
-  // TODO:re-enable when checker supports isa features
-  // CHECK-START-X86_64: int Main.reset_lowest_set_bit_32(int) instruction_simplifier_x86_64 (after)
-  // CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop:B\d+>> outer_loop:none
-  // CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
-  // CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
-  // CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
-  // CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
-  // CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
-  // CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
-  // CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
+  /// CHECK-START-X86_64: int Main.reset_lowest_set_bit_32(int) instruction_simplifier_x86_64 (after)
+  /// CHECK-IF: hasIsaFeature('avx') or hasIsaFeature('avx2')
+  /// CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop:B\d+>> outer_loop:none
+  /// CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
+  /// CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
+  /// CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
+  /// CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
+  /// CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
+  /// CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
+  /// CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
+  /// CHECK-FI:
 
-  // TODO:re-enable when checker supports isa features
-  // CHECK-START-X86_64: int Main.reset_lowest_set_bit_32(int) instruction_simplifier_x86_64 (after)
-  // CHECK-NOT:      And                        loop:<<Loop>> outer_loop:none
+  /// CHECK-START-X86_64: int Main.reset_lowest_set_bit_32(int) instruction_simplifier_x86_64 (after)
+  /// CHECK-IF: hasIsaFeature('avx') or hasIsaFeature('avx2')
+  /// CHECK-NOT:      And                        loop:<<Loop>> outer_loop:none
+  /// CHECK-FI:
   public static int reset_lowest_set_bit_32(int x) {
     int y = x;
     int j = 5;
@@ -149,17 +155,19 @@
   /// CHECK-DAG:    Sub     loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:    And     loop:<<Loop>>      outer_loop:none
 
-  // TODO:re-enable when checker supports isa features
-  // CHECK-START-X86_64: long Main.reset_lowest_set_bit_64(long) instruction_simplifier_x86_64 (after)
-  // CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop:B\d+>> outer_loop:none
-  // CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
-  // CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
-  // CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
+  /// CHECK-START-X86_64: long Main.reset_lowest_set_bit_64(long) instruction_simplifier_x86_64 (after)
+  /// CHECK-IF: hasIsaFeature('avx') or hasIsaFeature('avx2')
+  /// CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop:B\d+>> outer_loop:none
+  /// CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
+  /// CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
+  /// CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:<<Loop>> outer_loop:none
+  /// CHECK-FI:
 
-  // TODO:re-enable when checker supports isa features
-  // CHECK-START-X86_64: long Main.reset_lowest_set_bit_64(long) instruction_simplifier_x86_64 (after)
-  // CHECK-NOT:      And                        loop:<<Loop>> outer_loop:none
-  // CHECK-NOT:      Sub                        loop:<<Loop>> outer_loop:none
+  /// CHECK-START-X86_64: long Main.reset_lowest_set_bit_64(long) instruction_simplifier_x86_64 (after)
+  /// CHECK-IF: hasIsaFeature('avx') or hasIsaFeature('avx2')
+  /// CHECK-NOT:      And                        loop:<<Loop>> outer_loop:none
+  /// CHECK-NOT:      Sub                        loop:<<Loop>> outer_loop:none
+  /// CHECK-FI:
   public static long reset_lowest_set_bit_64(long x) {
     long y = x;
     long j = 5;
@@ -181,14 +189,16 @@
   /// CHECK-DAG:    Add     loop:none
   /// CHECK-DAG:    Xor     loop:none
 
-  // TODO:re-enable when checker supports isa features
-  // CHECK-START-X86_64: int Main.get_mask_lowest_set_bit_32(int) instruction_simplifier_x86_64 (after)
-  // CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:none
+  /// CHECK-START-X86_64: int Main.get_mask_lowest_set_bit_32(int) instruction_simplifier_x86_64 (after)
+  /// CHECK-IF: hasIsaFeature('avx') or hasIsaFeature('avx2')
+  /// CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:none
+  /// CHECK-FI:
 
-  // TODO:re-enable when checker supports isa features
-  // CHECK-START-X86_64: int Main.get_mask_lowest_set_bit_32(int) instruction_simplifier_x86_64 (after)
-  // CHECK-NOT:      Add    loop:none
-  // CHECK-NOT:      Xor    loop:none
+  /// CHECK-START-X86_64: int Main.get_mask_lowest_set_bit_32(int) instruction_simplifier_x86_64 (after)
+  /// CHECK-IF: hasIsaFeature('avx') or hasIsaFeature('avx2')
+  /// CHECK-NOT:      Add    loop:none
+  /// CHECK-NOT:      Xor    loop:none
+  /// CHECK-FI:
   public static int get_mask_lowest_set_bit_32(int x) {
     return (x-1) ^ x;
   }
@@ -197,14 +207,16 @@
   /// CHECK-DAG:    Sub     loop:none
   /// CHECK-DAG:    Xor     loop:none
 
-  // TODO:re-enable when checker supports isa features
-  // CHECK-START-X86_64: long Main.get_mask_lowest_set_bit_64(long) instruction_simplifier_x86_64 (after)
-  // CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:none
+  /// CHECK-START-X86_64: long Main.get_mask_lowest_set_bit_64(long) instruction_simplifier_x86_64 (after)
+  /// CHECK-IF: hasIsaFeature('avx') or hasIsaFeature('avx2')
+  /// CHECK-DAG:      X86MaskOrResetLeastSetBit  loop:none
+  /// CHECK-FI:
 
-  // TODO:re-enable when checker supports isa features
-  // CHECK-START-X86_64: long Main.get_mask_lowest_set_bit_64(long) instruction_simplifier_x86_64 (after)
-  // CHECK-NOT:      Sub    loop:none
-  // CHECK-NOT:      Xor    loop:none
+  /// CHECK-START-X86_64: long Main.get_mask_lowest_set_bit_64(long) instruction_simplifier_x86_64 (after)
+  /// CHECK-IF: hasIsaFeature('avx') or hasIsaFeature('avx2')
+  /// CHECK-NOT:      Sub    loop:none
+  /// CHECK-NOT:      Xor    loop:none
+  /// CHECK-FI:
   public static long get_mask_lowest_set_bit_64(long x) {
     return (x-1) ^ x;
   }
diff --git a/test/554-checker-rtp-checkcast/info.txt b/test/554-checker-rtp-checkcast/info.txt
index 2a60971..352054a 100644
--- a/test/554-checker-rtp-checkcast/info.txt
+++ b/test/554-checker-rtp-checkcast/info.txt
@@ -1 +1 @@
-Tests that phis with check-casted reference type inputs are typed.
+Tests that phis with check-cast reference type inputs are typed.
diff --git a/test/557-checker-instruct-simplifier-ror/src/Main.java b/test/557-checker-instruct-simplifier-ror/src/Main.java
index 5d4bb7a..667b35f 100644
--- a/test/557-checker-instruct-simplifier-ror/src/Main.java
+++ b/test/557-checker-instruct-simplifier-ror/src/Main.java
@@ -503,6 +503,7 @@
   }
 
   //  (j << distance) + (j >>> -distance)
+  // We can't perform the optimization as distance might be `0`, resulting in the wrong value.
 
   /// CHECK-START: long Main.rol_long_reg_v_negv_add(long, int) instruction_simplifier (before)
   /// CHECK:          <<ArgValue:j\d+>>     ParameterValue
@@ -516,19 +517,17 @@
   /// CHECK-START: long Main.rol_long_reg_v_negv_add(long, int) instruction_simplifier (after)
   /// CHECK:          <<ArgValue:j\d+>>     ParameterValue
   /// CHECK:          <<ArgDistance:i\d+>>  ParameterValue
-  /// CHECK:          <<Neg:i\d+>>          Neg [<<ArgDistance>>]
-  /// CHECK:          <<Ror:j\d+>>          Ror [<<ArgValue>>,<<Neg>>]
-  /// CHECK:                                Return [<<Ror>>]
-
-  /// CHECK-START: long Main.rol_long_reg_v_negv_add(long, int) instruction_simplifier (after)
-  /// CHECK-NOT:  Add
-  /// CHECK-NOT:  Shl
-  /// CHECK-NOT:  UShr
+  /// CHECK-DAG:      <<Neg:i\d+>>          Neg [<<ArgDistance>>]
+  /// CHECK-DAG:      <<UShr:j\d+>>         UShr [<<ArgValue>>,<<Neg>>]
+  /// CHECK-DAG:      <<Shl:j\d+>>          Shl [<<ArgValue>>,<<ArgDistance>>]
+  /// CHECK:          <<Add:j\d+>>          Add [<<Shl>>,<<UShr>>]
+  /// CHECK:                                Return [<<Add>>]
   public static long rol_long_reg_v_negv_add(long value, int distance) {
     return (value << distance) + (value >>> -distance);
   }
 
   //  (j << distance) ^ (j >>> -distance)
+  // We can't perform the optimization as distance might be `0`, resulting in the wrong value.
 
   /// CHECK-START: long Main.rol_long_reg_v_negv_xor(long, int) instruction_simplifier (before)
   /// CHECK:          <<ArgValue:j\d+>>     ParameterValue
@@ -542,18 +541,60 @@
   /// CHECK-START: long Main.rol_long_reg_v_negv_xor(long, int) instruction_simplifier (after)
   /// CHECK:          <<ArgValue:j\d+>>     ParameterValue
   /// CHECK:          <<ArgDistance:i\d+>>  ParameterValue
-  /// CHECK:          <<Neg:i\d+>>          Neg [<<ArgDistance>>]
-  /// CHECK:          <<Ror:j\d+>>          Ror [<<ArgValue>>,<<Neg>>]
-  /// CHECK:                                Return [<<Ror>>]
+  /// CHECK-DAG:      <<Neg:i\d+>>          Neg [<<ArgDistance>>]
+  /// CHECK-DAG:      <<UShr:j\d+>>         UShr [<<ArgValue>>,<<Neg>>]
+  /// CHECK-DAG:      <<Shl:j\d+>>          Shl [<<ArgValue>>,<<ArgDistance>>]
+  /// CHECK:          <<Xor:j\d+>>          Xor [<<Shl>>,<<UShr>>]
+  /// CHECK:                                Return [<<Xor>>]
 
-  /// CHECK-START: long Main.rol_long_reg_v_negv_xor(long, int) instruction_simplifier (after)
-  /// CHECK-NOT:  Xor
-  /// CHECK-NOT:  Shl
-  /// CHECK-NOT:  UShr
   public static long rol_long_reg_v_negv_xor(long value, int distance) {
     return (value << distance) ^ (value >>> -distance);
   }
 
+  /// CHECK-START: void Main.$noinline$testDontOptimizeAddIntoRotate_Int() disassembly (after)
+  /// CHECK-NOT: Ror
+  public static void $noinline$testDontOptimizeAddIntoRotate_Int() {
+      int distance = returnFalse() ? 1 : 0;
+      int value = -512667375;
+      int expected_result = 2 * value;
+      int result = (value >>> distance) + (value << -distance);
+      assertIntEquals(expected_result, result);
+  }
+
+  /// CHECK-START: void Main.$noinline$testDontOptimizeAddIntoRotate_Long() disassembly (after)
+  /// CHECK-NOT: Ror
+  public static void $noinline$testDontOptimizeAddIntoRotate_Long() {
+      int distance = returnFalse() ? 1 : 0;
+      long value = -512667375L;
+      long expected_result = 2L * value;
+      long result = (value >>> distance) + (value << -distance);
+      assertLongEquals(expected_result, result);
+  }
+
+  /// CHECK-START: void Main.$noinline$testDontOptimizeXorIntoRotate_Int() disassembly (after)
+  /// CHECK-NOT: Ror
+  public static void $noinline$testDontOptimizeXorIntoRotate_Int() {
+      int distance = returnFalse() ? 1 : 0;
+      int value = -512667375;
+      int expected_result = 0;
+      int result = (value >>> distance) ^ (value << -distance);
+      assertIntEquals(expected_result, result);
+  }
+
+  /// CHECK-START: void Main.$noinline$testDontOptimizeXorIntoRotate_Long() disassembly (after)
+  /// CHECK-NOT: Ror
+  public static void $noinline$testDontOptimizeXorIntoRotate_Long() {
+      int distance = returnFalse() ? 1 : 0;
+      long value = -512667375L;
+      long expected_result = 0;
+      long result = (value >>> distance) ^ (value << -distance);
+      assertLongEquals(expected_result, result);
+  }
+
+  static boolean returnFalse() {
+    return false;
+  }
+
   public static void main(String[] args) {
     assertIntEquals(2, ror_int_constant_c_c(8));
     assertIntEquals(2, ror_int_constant_c_c_0(8));
@@ -581,5 +622,11 @@
 
     assertLongEquals(32L, rol_long_reg_v_negv_add(8L, 2));
     assertLongEquals(32L, rol_long_reg_v_negv_xor(8L, 2));
+
+    $noinline$testDontOptimizeAddIntoRotate_Int();
+    $noinline$testDontOptimizeAddIntoRotate_Long();
+
+    $noinline$testDontOptimizeXorIntoRotate_Int();
+    $noinline$testDontOptimizeXorIntoRotate_Long();
   }
 }
diff --git a/test/566-polymorphic-inlining/polymorphic_inline.cc b/test/566-polymorphic-inlining/polymorphic_inline.cc
index 02ba04c..d98ee5d 100644
--- a/test/566-polymorphic-inlining/polymorphic_inline.cc
+++ b/test/566-polymorphic-inlining/polymorphic_inline.cc
@@ -21,9 +21,9 @@
 #include "jit/profiling_info.h"
 #include "mirror/class.h"
 #include "nativehelper/ScopedUtfChars.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
+#include "oat/stack_map.h"
 #include "scoped_thread_state_change-inl.h"
-#include "stack_map.h"
 
 namespace art {
 
diff --git a/test/566-polymorphic-inlining/src/Main.java b/test/566-polymorphic-inlining/src/Main.java
index 691d48f..79d21dd 100644
--- a/test/566-polymorphic-inlining/src/Main.java
+++ b/test/566-polymorphic-inlining/src/Main.java
@@ -41,6 +41,12 @@
     itfs[1] = mains[1] = new Subclass();
     itfs[2] = mains[2] = new OtherSubclass();
 
+    // Compile methods baseline to start filling inline caches.
+    ensureJitBaselineCompiled(Main.class, "$noinline$testInvokeVirtual");
+    ensureJitBaselineCompiled(Main.class, "$noinline$testInvokeInterface");
+    ensureJitBaselineCompiled(Main.class, "$noinline$testInvokeInterface2");
+    ensureJitBaselineCompiled(Main.class, "$noinline$testInlineToSameTarget");
+
     // Make $noinline$testInvokeVirtual and $noinline$testInvokeInterface hot to get them jitted.
     // We pass Main and Subclass to get polymorphic inlining based on calling
     // the same method.
@@ -130,6 +136,7 @@
   }
 
   public static native boolean ensureJittedAndPolymorphicInline566(String methodName);
+  public static native void ensureJitBaselineCompiled(Class<?> cls, String methodName);
 
   public void increment() {
     field.getClass(); // null check to ensure we get an inlined frame in the CodeInfo
diff --git a/test/567-checker-builder-intrinsics/src/TestSignum.java b/test/567-checker-builder-intrinsics/src/TestSignum.java
index ed3c5fe..818c940 100644
--- a/test/567-checker-builder-intrinsics/src/TestSignum.java
+++ b/test/567-checker-builder-intrinsics/src/TestSignum.java
@@ -92,19 +92,24 @@
   /// CHECK-START: int TestSignum.signBoolean(boolean) select_generator (after)
   /// CHECK-NOT:                     Phi
 
-  /// CHECK-START: int TestSignum.signBoolean(boolean) instruction_simplifier$before_codegen (after)
+  /// CHECK-START: int TestSignum.signBoolean(boolean) instruction_simplifier$after_gvn (after)
   /// CHECK-DAG:     <<Arg:z\d+>>    ParameterValue
-  /// CHECK-DAG:     <<Zero:i\d+>>   IntConstant 0
-  /// CHECK-DAG:     <<Result:i\d+>> Compare [<<Arg>>,<<Zero>>]
-  /// CHECK-DAG:                     Return [<<Result>>]
+  /// CHECK-DAG:                     Return [<<Arg>>]
 
-  /// CHECK-START: int TestSignum.signBoolean(boolean) instruction_simplifier$before_codegen (after)
+  /// CHECK-START: int TestSignum.signBoolean(boolean) instruction_simplifier$after_gvn (after)
   /// CHECK-NOT:                     Select
 
   private static int signBoolean(boolean x) {
     // Note: D8 would replace the ternary expression `x ? 1 : 0` with `x`
     // but explicit `if` is preserved.
-    int src_x;
+
+    // Use `Integer.` here to have the clinit check now instead of later, which would block the
+    // optimization when run without an image.
+    int src_x = 0;
+    if (Integer.signum(src_x) == -1) {
+        return -1;
+    }
+
     if (x) {
       src_x = 1;
     } else {
diff --git a/test/569-checker-pattern-replacement/build.py b/test/569-checker-pattern-replacement/build.py
new file mode 100644
index 0000000..abe80d8
--- /dev/null
+++ b/test/569-checker-pattern-replacement/build.py
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2024 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def build(ctx):
+  if ctx.jvm:
+    return  # The test does not build on JVM
+  ctx.default_build()
diff --git a/test/569-checker-pattern-replacement/src-multidex/Second.java b/test/569-checker-pattern-replacement/src-multidex/Second.java
index 89835c6..6528806 100644
--- a/test/569-checker-pattern-replacement/src-multidex/Second.java
+++ b/test/569-checker-pattern-replacement/src-multidex/Second.java
@@ -14,9 +14,14 @@
  * limitations under the License.
  */
 
+import dalvik.annotation.optimization.NeverInline;
+
 public final class Second {
   public static void staticNop(int unused) { }
 
+  @NeverInline
+  public static void staticNopNeverInline(int unused) { }
+
   public void nop() { }
 
   public static Object staticReturnArg2(int unused1, String arg2) {
diff --git a/test/569-checker-pattern-replacement/src/Main.java b/test/569-checker-pattern-replacement/src/Main.java
index 8951d30..9f4598d 100644
--- a/test/569-checker-pattern-replacement/src/Main.java
+++ b/test/569-checker-pattern-replacement/src/Main.java
@@ -15,6 +15,26 @@
  */
 
 public class Main {
+  static class ExpectedError extends Error {}
+
+  public static void localStaticNopAndThrow() {
+    // Pattern matching replaces the invoke even in a block that ends with a `throw`.
+    $inline$localStaticNop();
+    throw new ExpectedError();
+  }
+
+  public static void $inline$localStaticNop() {}
+
+  /// CHECK-START: void Main.staticNopNeverInline() inliner (before)
+  /// CHECK:                          InvokeStaticOrDirect
+
+  /// CHECK-START: void Main.staticNopNeverInline() inliner (after)
+  /// CHECK:                          InvokeStaticOrDirect
+
+  public static void staticNopNeverInline() {
+    Second.staticNopNeverInline(11);
+  }
+
   /// CHECK-START: void Main.staticNop() inliner (before)
   /// CHECK:                          InvokeStaticOrDirect
 
@@ -1177,6 +1197,8 @@
     // Replaced NOP pattern.
     staticNop();
     nop(s);
+    // Not replaced NOP pattern.
+    staticNopNeverInline();
     // Replaced "return arg" pattern.
     assertEquals("arbitrary string", staticReturnArg2("arbitrary string"));
     assertEquals(4321L, returnArg1(s, 4321L));
@@ -1259,6 +1281,11 @@
     assertEquals(123, constructDerivedInSecondDex(123));
     assertEquals(0, constructDerivedInSecondDexWith0());
     assertEquals(0, constructDerivedInSecondDex(7L));
+
+    try {
+      localStaticNopAndThrow();
+      throw new Error("Unreachable");
+    } catch (ExpectedError expected) {}
   }
 
   private static void assertEquals(int expected, int actual) {
diff --git a/test/570-checker-osr/osr.cc b/test/570-checker-osr/osr.cc
index d1caf3f..de220ce 100644
--- a/test/570-checker-osr/osr.cc
+++ b/test/570-checker-osr/osr.cc
@@ -19,10 +19,10 @@
 #include "jit/jit_code_cache.h"
 #include "jit/profiling_info.h"
 #include "nativehelper/ScopedUtfChars.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_quick_method_header.h"
+#include "oat/stack_map.h"
 #include "scoped_thread_state_change-inl.h"
 #include "stack.h"
-#include "stack_map.h"
 #include "thread-current-inl.h"
 
 namespace art {
@@ -98,21 +98,6 @@
   return in_interpreter;
 }
 
-extern "C" JNIEXPORT void JNICALL Java_Main_ensureHasProfilingInfo(JNIEnv* env,
-                                                                   jclass,
-                                                                   jstring method_name) {
-  if (!Runtime::Current()->UseJitCompilation()) {
-    return;
-  }
-  ProcessMethodWithName(
-      env,
-      method_name,
-      [&](const art::StackVisitor* stack_visitor) REQUIRES_SHARED(Locks::mutator_lock_) {
-        ArtMethod* m = stack_visitor->GetMethod();
-        ProfilingInfo::Create(Thread::Current(), m);
-      });
-}
-
 extern "C" JNIEXPORT void JNICALL Java_Main_ensureHasOsrCode(JNIEnv* env,
                                                              jclass,
                                                              jstring method_name) {
diff --git a/test/570-checker-osr/src/Main.java b/test/570-checker-osr/src/Main.java
index 78f3c32..752d338 100644
--- a/test/570-checker-osr/src/Main.java
+++ b/test/570-checker-osr/src/Main.java
@@ -297,8 +297,11 @@
 
   public static native boolean isInOsrCode(String methodName);
   public static native boolean isInInterpreter(String methodName);
-  public static native void ensureHasProfilingInfo(String methodName);
+  public static void ensureHasProfilingInfo(String methodName) {
+    ensureJitBaselineCompiled(Main.class, methodName);
+  }
   public static native void ensureHasOsrCode(String methodName);
+  public static native void ensureJitBaselineCompiled(Class<?> cls, String methodName);
 }
 
 class SubMain extends Main {
diff --git a/test/570-checker-select/src/Main.java b/test/570-checker-select/src/Main.java
index 0e23b3d..57e4db5 100644
--- a/test/570-checker-select/src/Main.java
+++ b/test/570-checker-select/src/Main.java
@@ -500,7 +500,6 @@
   /// CHECK-START: float Main.$noinline$FloatGtMatCond_FloatVarVar(float, float, float, float) register (after)
   /// CHECK:            <<Cond:z\d+>> GreaterThanOrEqual
   /// CHECK-NEXT:       <<Sel:f\d+>>  Select [{{f\d+}},{{f\d+}},<<Cond>>]
-  /// CHECK-NEXT:                     TypeConversion [<<Cond>>]
 
   /// CHECK-START-ARM64: float Main.$noinline$FloatGtMatCond_FloatVarVar(float, float, float, float) disassembly (after)
   /// CHECK:               GreaterThanOrEqual
diff --git a/test/593-checker-boolean-2-integral-conv/smali/SmaliTests.smali b/test/593-checker-boolean-2-integral-conv/smali/SmaliTests.smali
index f3f52a8..8e84d05 100644
--- a/test/593-checker-boolean-2-integral-conv/smali/SmaliTests.smali
+++ b/test/593-checker-boolean-2-integral-conv/smali/SmaliTests.smali
@@ -187,8 +187,10 @@
 
 ## CHECK-START: long SmaliTests.booleanToLong(boolean) instruction_simplifier$before_codegen (after)
 ## CHECK-DAG:     <<Arg:z\d+>>           ParameterValue
-## CHECK-DAG:     <<ZToJ:j\d+>>          TypeConversion [<<Arg>>]
-## CHECK-DAG:                            Return [<<ZToJ>>]
+## CHECK-DAG:     <<Zero:j\d+>>          LongConstant 0
+## CHECK-DAG:     <<One:j\d+>>           LongConstant 1
+## CHECK-DAG:     <<Sel:j\d+>>           Select [<<Zero>>,<<One>>,<<Arg>>]
+## CHECK-DAG:                            Return [<<Sel>>]
 .method public static booleanToLong(Z)J
     .registers 3
     .param p0, "b"    # Z
diff --git a/test/595-profile-saving/expected-stdout.txt b/test/595-profile-saving/expected-stdout.txt
index 9e28e07..6a5618e 100644
--- a/test/595-profile-saving/expected-stdout.txt
+++ b/test/595-profile-saving/expected-stdout.txt
@@ -1,2 +1 @@
 JNI_OnLoad called
-IsForBootImage: true
diff --git a/test/595-profile-saving/profile-saving.cc b/test/595-profile-saving/profile-saving.cc
index bec4ae9..70b4ccf 100644
--- a/test/595-profile-saving/profile-saving.cc
+++ b/test/595-profile-saving/profile-saving.cc
@@ -14,73 +14,17 @@
  * limitations under the License.
  */
 
-#include "dex/dex_file.h"
-
 #include "art_method-inl.h"
-#include "dex/method_reference.h"
-#include "jit/profile_saver.h"
+#include "art_method.h"
+#include "jit/profiling_info.h"
 #include "jni.h"
-#include "mirror/class-inl.h"
 #include "mirror/executable.h"
-#include "nativehelper/ScopedUtfChars.h"
-#include "oat_file_assistant.h"
-#include "oat_file_manager.h"
-#include "profile/profile_compilation_info.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread.h"
 
 namespace art {
 namespace {
 
-extern "C" JNIEXPORT void JNICALL Java_Main_ensureProfilingInfo(JNIEnv* env,
-                                                                jclass,
-                                                                jobject method) {
-  CHECK(method != nullptr);
-  ScopedObjectAccess soa(env);
-  ObjPtr<mirror::Executable> exec = soa.Decode<mirror::Executable>(method);
-  ArtMethod* art_method = exec->GetArtMethod();
-  if (ProfilingInfo::Create(soa.Self(), art_method) == nullptr) {
-    LOG(ERROR) << "Failed to create profiling info for method " << art_method->PrettyMethod();
-  }
-}
-
-extern "C" JNIEXPORT void JNICALL Java_Main_ensureProfileProcessing(JNIEnv*, jclass) {
-  ProfileSaver::ForceProcessProfiles();
-}
-
-extern "C" JNIEXPORT jboolean JNICALL Java_Main_isForBootImage(JNIEnv* env,
-                                                               jclass,
-                                                               jstring filename) {
-  ScopedUtfChars filename_chars(env, filename);
-  CHECK(filename_chars.c_str() != nullptr);
-
-  ProfileCompilationInfo info(/*for_boot_image=*/ true);
-  bool result = info.Load(std::string(filename_chars.c_str()), /*clear_if_invalid=*/ false);
-  return result ? JNI_TRUE : JNI_FALSE;
-}
-
-extern "C" JNIEXPORT jboolean JNICALL Java_Main_presentInProfile(JNIEnv* env,
-                                                                 jclass c,
-                                                                 jstring filename,
-                                                                 jobject method) {
-  bool for_boot_image = Java_Main_isForBootImage(env, c, filename) == JNI_TRUE;
-  ScopedUtfChars filename_chars(env, filename);
-  CHECK(filename_chars.c_str() != nullptr);
-  ScopedObjectAccess soa(env);
-  ObjPtr<mirror::Executable> exec = soa.Decode<mirror::Executable>(method);
-  ArtMethod* art_method = exec->GetArtMethod();
-  MethodReference ref(art_method->GetDexFile(), art_method->GetDexMethodIndex());
-
-  ProfileCompilationInfo info(Runtime::Current()->GetArenaPool(), for_boot_image);
-  if (!info.Load(filename_chars.c_str(), /*clear_if_invalid=*/false)) {
-    LOG(ERROR) << "Failed to load profile from " << filename;
-    return JNI_FALSE;
-  }
-  const ProfileCompilationInfo::MethodHotness hotness = info.GetMethodHotness(ref);
-  // TODO: Why do we check `hotness.IsHot()` instead of `hotness.IsInProfile()`
-  // in a method named `presentInProfile()`?
-  return hotness.IsHot() ? JNI_TRUE : JNI_FALSE;
-}
 
 }  // namespace
 }  // namespace art
diff --git a/test/595-profile-saving/res/art-gtest-jars-Main.dex b/test/595-profile-saving/res/art-gtest-jars-Main.dex
index 2747919..ed91d72 100644
--- a/test/595-profile-saving/res/art-gtest-jars-Main.dex
+++ b/test/595-profile-saving/res/art-gtest-jars-Main.dex
Binary files differ
diff --git a/test/595-profile-saving/run.py b/test/595-profile-saving/run.py
index 96de281..3375b0e 100644
--- a/test/595-profile-saving/run.py
+++ b/test/595-profile-saving/run.py
@@ -17,18 +17,16 @@
 
 def run(ctx, args):
   # Use
-  # --compiler-filter=quicken to make sure that the test is not compiled AOT
+  # --compiler-filter=verify to make sure that the test is not compiled AOT
   # and to make sure the test is not compiled  when loaded (by PathClassLoader)
   # -Xjitsaveprofilinginfo to enable profile saving
-  # -Xusejit:false to disable jit and only test profiles.
   # -Xjitinitialsize:32M to prevent profiling info creation failure.
   ctx.default_run(
       args,
-      Xcompiler_option=["--compiler-filter=quicken"],
+      Xcompiler_option=["--compiler-filter=verify"],
       runtime_option=[
-          "-Xcompiler-option --compiler-filter=quicken",
+          "-Xcompiler-option --compiler-filter=verify",
           "-Xjitinitialsize:32M",
           "-Xjitsaveprofilinginfo",
-          "-Xusejit:false",
           "-Xps-profile-boot-class-path",
       ])
diff --git a/test/595-profile-saving/src/Main.java b/test/595-profile-saving/src/Main.java
index 3229b53..8fdc4e1 100644
--- a/test/595-profile-saving/src/Main.java
+++ b/test/595-profile-saving/src/Main.java
@@ -23,6 +23,11 @@
   public static void main(String[] args) throws Exception {
     System.loadLibrary(args[0]);
 
+    if (!hasJit()) {
+      // Test requires JIT for creating profiling infos.
+      return;
+    }
+
     File file = null;
     File file2 = null;
     File file3 = null;
@@ -88,7 +93,9 @@
 
       testProfileNotExist(file2);
 
-      System.out.println("IsForBootImage: " + isForBootImage(file.getPath()));
+      if (!isForBootImage(file.getPath())) {
+        throw new Error("Expected profile to be for boot image");
+      }
     } finally {
       if (file != null) {
         file.delete();
@@ -129,13 +136,17 @@
   }
 
   // Ensure a method has a profiling info.
-  public static native void ensureProfilingInfo(Method method);
+  public static void ensureProfilingInfo(Method method) {
+    ensureJitBaselineCompiled(method.getDeclaringClass(), method.getName());
+  }
+  public static native void ensureJitBaselineCompiled(Class<?> cls, String methodName);
   // Ensures the profile saver does its usual processing.
   public static native void ensureProfileProcessing();
   // Checks if the profiles saver knows about the method.
   public static native boolean presentInProfile(String profile, Method method);
   // Returns true if the profile is for the boot image.
   public static native boolean isForBootImage(String profile);
+  public static native boolean hasJit();
 
   private static final String TEMP_FILE_NAME_PREFIX = "temp";
   private static final String TEMP_FILE_NAME_SUFFIX = "-file";
diff --git a/test/596-app-images/app_images.cc b/test/596-app-images/app_images.cc
index 1bc2c1e..f7ea79a 100644
--- a/test/596-app-images/app_images.cc
+++ b/test/596-app-images/app_images.cc
@@ -25,10 +25,10 @@
 #include "gc/heap.h"
 #include "gc/space/image_space.h"
 #include "gc/space/space-inl.h"
-#include "image.h"
 #include "mirror/class.h"
 #include "nativehelper/scoped_utf_chars.h"
-#include "oat_file.h"
+#include "oat/image.h"
+#include "oat/oat_file.h"
 #include "runtime.h"
 #include "scoped_thread_state_change-inl.h"
 
diff --git a/test/597-deopt-new-string/deopt.cc b/test/597-deopt-new-string/deopt.cc
index 06dbca6..b882815 100644
--- a/test/597-deopt-new-string/deopt.cc
+++ b/test/597-deopt-new-string/deopt.cc
@@ -28,7 +28,7 @@
 
 extern "C" JNIEXPORT void JNICALL Java_Main_deoptimizeAll(
     JNIEnv* env,
-    jclass cls ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] jclass cls) {
   ScopedObjectAccess soa(env);
   ScopedThreadSuspension sts(Thread::Current(), ThreadState::kWaitingForDeoptimization);
   gc::ScopedGCCriticalSection gcs(Thread::Current(),
@@ -41,7 +41,7 @@
 
 extern "C" JNIEXPORT void JNICALL Java_Main_undeoptimizeAll(
     JNIEnv* env,
-    jclass cls ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] jclass cls) {
   ScopedObjectAccess soa(env);
   ScopedThreadSuspension sts(Thread::Current(), ThreadState::kWaitingForDeoptimization);
   gc::ScopedGCCriticalSection gcs(Thread::Current(),
diff --git a/test/618-checker-induction/src/Main.java b/test/618-checker-induction/src/Main.java
index 5dc8e98..bcd545c 100644
--- a/test/618-checker-induction/src/Main.java
+++ b/test/618-checker-induction/src/Main.java
@@ -331,7 +331,26 @@
         return closed;  // only needs last-value
     }
 
-    // TODO: taken test around closed form?
+    // closedFormInductionUpN turns into `if n < 0 then 12345 else 12345 + n * 5`.
+
+    /// CHECK-START: int Main.closedFormInductionUpN(int) loop_optimization (before)
+    /// CHECK:                       Phi
+    /// CHECK:                       Phi
+    /// CHECK-NOT:                   Phi
+    //
+    /// CHECK-START: int Main.closedFormInductionUpN(int) loop_optimization (after)
+    /// CHECK-NOT:                   Phi
+    //
+    /// CHECK-START: int Main.closedFormInductionUpN(int) loop_optimization (after)
+    /// CHECK-DAG: <<N:i\d+>>        ParameterValue
+    /// CHECK-DAG: <<Int5:i\d+>>     IntConstant 5
+    /// CHECK-DAG: <<Int12345:i\d+>> IntConstant 12345
+    /// CHECK-DAG: <<Int0:i\d+>>     IntConstant 0
+    /// CHECK-DAG: <<Mul:i\d+>>      Mul [<<Int5>>,<<N>>]
+    /// CHECK-DAG: <<Add:i\d+>>      Add [<<Mul>>,<<Int12345>>]
+    /// CHECK-DAG: <<LT:z\d+>>       LessThan [<<Int0>>,<<N>>]
+    /// CHECK-DAG: <<Sel:i\d+>>      Select [<<Int12345>>,<<Add>>,<<LT>>]
+    /// CHECK-DAG:                   Return [<<Sel>>]
     static int closedFormInductionUpN(int n) {
         int closed = 12345;
         for (int i = 0; i < n; i++) {
@@ -340,7 +359,26 @@
         return closed;  // only needs last value
     }
 
-    // TODO: taken test around closed form?
+    // closedFormInductionInAndDownN turns into `if n < 0 then closed else closed - n * 5`.
+
+    /// CHECK-START: int Main.closedFormInductionInAndDownN(int, int) loop_optimization (before)
+    /// CHECK:                       Phi
+    /// CHECK:                       Phi
+    /// CHECK-NOT:                   Phi
+    //
+    /// CHECK-START: int Main.closedFormInductionInAndDownN(int, int) loop_optimization (after)
+    /// CHECK-NOT:                   Phi
+    //
+    /// CHECK-START: int Main.closedFormInductionInAndDownN(int, int) loop_optimization (after)
+    /// CHECK-DAG: <<Closed:i\d+>>   ParameterValue
+    /// CHECK-DAG: <<N:i\d+>>        ParameterValue
+    /// CHECK-DAG: <<IntNeg5:i\d+>>  IntConstant -5
+    /// CHECK-DAG: <<Int0:i\d+>>     IntConstant 0
+    /// CHECK-DAG: <<Mul:i\d+>>      Mul [<<IntNeg5>>,<<N>>]
+    /// CHECK-DAG: <<Add:i\d+>>      Add [<<Mul>>,<<Closed>>]
+    /// CHECK-DAG: <<LT:z\d+>>       LessThan [<<Int0>>,<<N>>]
+    /// CHECK-DAG: <<Sel:i\d+>>      Select [<<Closed>>,<<Add>>,<<LT>>]
+    /// CHECK-DAG:                   Return [<<Sel>>]
     static int closedFormInductionInAndDownN(int closed, int n) {
         for (int i = 0; i < n; i++) {
             closed -= 5;
@@ -348,7 +386,27 @@
         return closed;  // only needs last value
     }
 
-    // TODO: move closed form even further out?
+    // closedFormNestedN turns into `if (n < 0) then 0 else n * 10`
+
+    /// CHECK-START: int Main.closedFormNestedN(int) loop_optimization (before)
+    /// CHECK:                       Phi
+    /// CHECK:                       Phi
+    /// CHECK:                       Phi
+    /// CHECK:                       Phi
+    /// CHECK-NOT:                   Phi
+    //
+    /// CHECK-START: int Main.closedFormNestedN(int) loop_optimization (after)
+    /// CHECK-NOT:                   Phi
+    //
+    /// CHECK-START: int Main.closedFormNestedN(int) loop_optimization (after)
+    /// CHECK-DAG: <<N:i\d+>>        ParameterValue
+    /// CHECK-DAG: <<Int10:i\d+>>    IntConstant 10
+    /// CHECK-DAG: <<Int0:i\d+>>     IntConstant 0
+    /// CHECK-DAG: <<Mul:i\d+>>      Mul [<<Int10>>,<<N>>]
+    /// CHECK-DAG: <<Add:i\d+>>      Add [<<Mul>>,<<Int0>>]
+    /// CHECK-DAG: <<LT:z\d+>>       LessThan [<<Int0>>,<<N>>]
+    /// CHECK-DAG: <<Sel:i\d+>>      Select [<<Int0>>,<<Add>>,<<LT>>]
+    /// CHECK-DAG:                   Return [<<Sel>>]
     static int closedFormNestedN(int n) {
         int closed = 0;
         for (int i = 0; i < n; i++) {
@@ -359,7 +417,28 @@
         return closed;  // only needs last-value
     }
 
-    // TODO: move closed form even further out?
+    // closedFormNestedNAlt turns into `if (n < 0) then 12345 else 12345 + n * 161`
+
+    /// CHECK-START: int Main.closedFormNestedNAlt(int) loop_optimization (before)
+    /// CHECK:                       Phi
+    /// CHECK:                       Phi
+    /// CHECK:                       Phi
+    /// CHECK:                       Phi
+    /// CHECK-NOT:                   Phi
+    //
+    /// CHECK-START: int Main.closedFormNestedNAlt(int) loop_optimization (after)
+    /// CHECK-NOT:                   Phi
+    //
+    /// CHECK-START: int Main.closedFormNestedNAlt(int) loop_optimization (after)
+    /// CHECK-DAG: <<N:i\d+>>        ParameterValue
+    /// CHECK-DAG: <<Int161:i\d+>>   IntConstant 161
+    /// CHECK-DAG: <<Int12345:i\d+>> IntConstant 12345
+    /// CHECK-DAG: <<Int0:i\d+>>     IntConstant 0
+    /// CHECK-DAG: <<Mul:i\d+>>      Mul [<<Int161>>,<<N>>]
+    /// CHECK-DAG: <<Add:i\d+>>      Add [<<Mul>>,<<Int12345>>]
+    /// CHECK-DAG: <<LT:z\d+>>       LessThan [<<Int0>>,<<N>>]
+    /// CHECK-DAG: <<Sel:i\d+>>      Select [<<Int12345>>,<<Add>>,<<LT>>]
+    /// CHECK-DAG:                   Return [<<Sel>>]
     static int closedFormNestedNAlt(int n) {
         int closed = 12345;
         for (int i = 0; i < n; i++) {
@@ -370,7 +449,30 @@
         return closed;  // only needs last-value
     }
 
-    // TODO: move closed form even further out?
+    // We optimize only the inner loop. It turns into `if (n < 0) then closed else closed + n`.
+    // Potentially we can also update the outer loop turning into if (m < 0) then 0 else if (n < 0)
+    // then 0 else m * n`.
+    /// CHECK-START: int Main.closedFormNestedMN(int, int) loop_optimization (before)
+    /// CHECK:                       Phi
+    /// CHECK:                       Phi
+    /// CHECK:                       Phi
+    /// CHECK:                       Phi
+    /// CHECK-NOT:                   Phi
+    //
+    /// CHECK-START: int Main.closedFormNestedMN(int, int) loop_optimization (after)
+    /// CHECK:                       Phi
+    /// CHECK:                       Phi
+    /// CHECK-NOT:                   Phi
+    //
+    // Inner loop optimization
+    /// CHECK-START: int Main.closedFormNestedMN(int, int) loop_optimization (after)
+    /// CHECK-DAG: <<M:i\d+>>        ParameterValue
+    /// CHECK-DAG: <<N:i\d+>>        ParameterValue
+    /// CHECK-DAG: <<Int0:i\d+>>     IntConstant 0
+    /// CHECK-DAG: <<Phi:i\d+>>      Phi
+    /// CHECK-DAG: <<Add:i\d+>>      Add [<<N>>,<<Phi>>]
+    /// CHECK-DAG: <<LT:z\d+>>       LessThan [<<Int0>>,<<N>>]
+    /// CHECK-DAG: <<Sel:i\d+>>      Select [<<Phi>>,<<Add>>,<<LT>>]
     static int closedFormNestedMN(int m, int n) {
         int closed = 0;
         for (int i = 0; i < m; i++) {
@@ -381,10 +483,36 @@
         return closed;  // only needs last-value
     }
 
-    // TODO: move closed form even further out?
+    // We optimize only the inner loop. It turns into `if (n < 0) then closed else closed + n * 7`.
+    // Potentially we can also update the outer loop turning into if (m < 0) then 0 else if (n < 0)
+    // then 1245 else 12345 + m * n * 7`.
+    /// CHECK-START: int Main.closedFormNestedMNAlt(int, int) loop_optimization (before)
+    /// CHECK:                       Phi
+    /// CHECK:                       Phi
+    /// CHECK:                       Phi
+    /// CHECK:                       Phi
+    /// CHECK-NOT:                   Phi
+    //
+    /// CHECK-START: int Main.closedFormNestedMNAlt(int, int) loop_optimization (after)
+    /// CHECK:                       Phi
+    /// CHECK:                       Phi
+    /// CHECK-NOT:                   Phi
+    //
+    // Inner loop optimization
+    /// CHECK-START: int Main.closedFormNestedMNAlt(int, int) loop_optimization (after)
+    /// CHECK-DAG: <<M:i\d+>>        ParameterValue
+    /// CHECK-DAG: <<N:i\d+>>        ParameterValue
+    /// CHECK-DAG: <<Int7:i\d+>>     IntConstant 7
+    /// CHECK-DAG: <<Int0:i\d+>>     IntConstant 0
+    /// CHECK-DAG: <<Phi:i\d+>>      Phi
+    /// CHECK-DAG: <<Mul:i\d+>>      Mul [<<Int7>>,<<N>>]
+    /// CHECK-DAG: <<Add:i\d+>>      Add [<<Mul>>,<<Phi>>]
+    /// CHECK-DAG: <<LT:z\d+>>       LessThan [<<Int0>>,<<N>>]
+    /// CHECK-DAG: <<Sel:i\d+>>      Select [<<Phi>>,<<Add>>,<<LT>>]
     static int closedFormNestedMNAlt(int m, int n) {
         int closed = 12345;
         for (int i = 0; i < m; i++) {
+            // if n < 0 then closed else closed + n * 7
             for (int j = 0; j < n; j++) {
                 closed += 7;
             }
@@ -481,21 +609,48 @@
         return sum;
     }
 
-    // TODO: handle as closed/empty eventually?
+    // We can generate a select, which then DCE detects it is redundant. Therefore, we eliminate
+    // these loops.
+
+    /// CHECK-START: int Main.mainIndexReturnedN(int) loop_optimization (before)
+    /// CHECK:     Phi
+    /// CHECK-NOT: Phi
+    //
+    /// CHECK-START: int Main.mainIndexReturnedN(int) loop_optimization (after)
+    /// CHECK-NOT: Phi
+    //
+    /// CHECK-START: int Main.mainIndexReturnedN(int) loop_optimization (after)
+    /// CHECK: Select
     static int mainIndexReturnedN(int n) {
         int i;
         for (i = 0; i < n; i++);
         return i;
     }
 
-    // TODO: handle as closed/empty eventually?
+    /// CHECK-START: int Main.mainIndexShort1(short) loop_optimization (before)
+    /// CHECK:     Phi
+    /// CHECK-NOT: Phi
+    //
+    /// CHECK-START: int Main.mainIndexShort1(short) loop_optimization (after)
+    /// CHECK-NOT: Phi
+    //
+    /// CHECK-START: int Main.mainIndexShort1(short) loop_optimization (after)
+    /// CHECK: Select
     static int mainIndexShort1(short s) {
         int i = 0;
         for (i = 0; i < s; i++) { }
         return i;
     }
 
-    // TODO: handle as closed/empty eventually?
+    /// CHECK-START: int Main.mainIndexShort2(short) loop_optimization (before)
+    /// CHECK:     Phi
+    /// CHECK-NOT: Phi
+    //
+    /// CHECK-START: int Main.mainIndexShort2(short) loop_optimization (after)
+    /// CHECK-NOT: Phi
+    //
+    /// CHECK-START: int Main.mainIndexShort2(short) loop_optimization (after)
+    /// CHECK: Select
     static int mainIndexShort2(short s) {
         int i = 0;
         for (i = 0; s > i; i++) { }
@@ -517,6 +672,40 @@
         return k;
     }
 
+    /// CHECK-START: int Main.periodicOverflowTripCountNotOptimized() loop_optimization (before)
+    /// CHECK-DAG: <<Phi1:i\d+>> Phi               loop:<<Loop:B\d+>> outer_loop:none
+    /// CHECK-DAG: {{i\d+}}      Phi               loop:<<Loop>>      outer_loop:none
+    /// CHECK-DAG:               Return [<<Phi1>>] loop:none
+    //
+    /// CHECK-START: int Main.periodicOverflowTripCountNotOptimized() loop_optimization (after)
+    /// CHECK-DAG: <<Phi1:i\d+>> Phi               loop:<<Loop:B\d+>> outer_loop:none
+    /// CHECK-DAG: {{i\d+}}      Phi               loop:<<Loop>>      outer_loop:none
+    /// CHECK-DAG:               Return [<<Phi1>>] loop:none
+    static int periodicOverflowTripCountNotOptimized() {
+        int k = 0;
+        for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE - 81; i += 80) {
+            k = 1 - k;
+        }
+        return k;
+    }
+
+    /// CHECK-START: int Main.periodicCouldOverflowTripCountNotOptimized(int) loop_optimization (before)
+    /// CHECK-DAG: <<Phi1:i\d+>> Phi               loop:<<Loop:B\d+>> outer_loop:none
+    /// CHECK-DAG: {{i\d+}}      Phi               loop:<<Loop>>      outer_loop:none
+    /// CHECK-DAG:               Return [<<Phi1>>] loop:none
+    //
+    /// CHECK-START: int Main.periodicCouldOverflowTripCountNotOptimized(int) loop_optimization (after)
+    /// CHECK-DAG: <<Phi1:i\d+>> Phi               loop:<<Loop:B\d+>> outer_loop:none
+    /// CHECK-DAG: {{i\d+}}      Phi               loop:<<Loop>>      outer_loop:none
+    /// CHECK-DAG:               Return [<<Phi1>>] loop:none
+    static int periodicCouldOverflowTripCountNotOptimized(int start) {
+        int k = 0;
+        for (int i = start; i < Integer.MAX_VALUE - 81; i += 80) {
+            k = 1 - k;
+        }
+        return k;
+    }
+
     // If ever replaced by closed form, last value should be correct!
     private static int getSumN(int n) {
         int k = 0;
@@ -983,6 +1172,9 @@
             expectEquals((tc * (tc + 1)) / 2, getSumN(n));
         }
 
+        expectEquals(1, periodicOverflowTripCountNotOptimized());
+        expectEquals(1, periodicCouldOverflowTripCountNotOptimized(Integer.MIN_VALUE));
+
         expectEquals(10, closedTwice());
         expectEquals(20, closedFeed());
         expectEquals(-10, closedLargeUp());
diff --git a/test/638-checker-inline-cache-intrinsic/src/Main.java b/test/638-checker-inline-cache-intrinsic/src/Main.java
index f25d03a..86430e6 100644
--- a/test/638-checker-inline-cache-intrinsic/src/Main.java
+++ b/test/638-checker-inline-cache-intrinsic/src/Main.java
@@ -36,8 +36,8 @@
   /// CHECK:       InvokeInterface method_name:java.lang.CharSequence.charAt
 
   /// CHECK-START: char Main.$noinline$inlinePolymorphic(java.lang.CharSequence) inliner (after)
-  /// CHECK:       InvokeVirtual method_name:java.lang.String.charAt intrinsic:StringCharAt
-  /// CHECK:       Deoptimize
+  /// CHECK-DAG:   InvokeVirtual method_name:java.lang.String.charAt intrinsic:StringCharAt
+  /// CHECK-DAG:   Deoptimize
 
   /// CHECK-START: char Main.$noinline$inlinePolymorphic(java.lang.CharSequence) instruction_simplifier$after_inlining (after)
   /// CHECK:       Deoptimize
diff --git a/test/639-checker-code-sinking/src/Main.java b/test/639-checker-code-sinking/src/Main.java
index f8c1d9d..6d1cded 100644
--- a/test/639-checker-code-sinking/src/Main.java
+++ b/test/639-checker-code-sinking/src/Main.java
@@ -17,8 +17,14 @@
 public class Main {
   static class ValueHolder {
     int getValue() {
+      // Prevent inliner from matching the code pattern when calling this method to test
+      // the normal inlining path that does not inline in blocks that end with a `throw`.
+      $inline$nop();
+
       return 1;
     }
+
+    private void $inline$nop() {}
   }
 
   public static void main(String[] args) throws Exception {
diff --git a/test/640-checker-integer-valueof/src/Main.java b/test/640-checker-integer-valueof/src/Main.java
index 0837fd1..cf0d7d8 100644
--- a/test/640-checker-integer-valueof/src/Main.java
+++ b/test/640-checker-integer-valueof/src/Main.java
@@ -48,6 +48,178 @@
     return Integer.valueOf(55555);
   }
 
+  /// CHECK-START: byte Main.$noinline$boxUnboxByte(byte) builder (after)
+  /// CHECK: <<Input:b\d+>>       ParameterValue
+  /// CHECK: <<Boxed:l\d+>>       InvokeStaticOrDirect [<<Input>>{{(,[ij]\d+)?}}] method_name:java.lang.Byte.valueOf intrinsic:ByteValueOf
+  /// CHECK-NOT:                  NullCheck [<<Boxed>>]
+  /// CHECK: <<Unboxed:b\d+>>     InvokeVirtual [<<Boxed>>] method_name:java.lang.Byte.byteValue
+  /// CHECK:                      Return [<<Unboxed>>]
+
+  /// CHECK-START: byte Main.$noinline$boxUnboxByte(byte) inliner (after)
+  /// CHECK: <<Input:b\d+>>       ParameterValue
+  /// CHECK: <<Boxed:l\d+>>       InvokeStaticOrDirect [<<Input>>{{(,[ij]\d+)?}}] method_name:java.lang.Byte.valueOf intrinsic:ByteValueOf
+  /// CHECK: <<Unboxed:b\d+>>     InstanceFieldGet [<<Boxed>>] field_name:java.lang.Byte.value
+  /// CHECK:                      Return [<<Unboxed>>]
+
+  /// CHECK-START: byte Main.$noinline$boxUnboxByte(byte) instruction_simplifier$after_inlining (after)
+  /// CHECK: <<Input:b\d+>>       ParameterValue
+  /// CHECK:                      Return [<<Input>>]
+
+  /// CHECK-START: byte Main.$noinline$boxUnboxByte(byte) dead_code_elimination$after_inlining (after)
+  /// CHECK-NOT:                  InvokeStaticOrDirect
+  /// CHECK-NOT:                  InstanceFieldGet
+
+  public static byte $noinline$boxUnboxByte(byte value) {
+    return Byte.valueOf(value).byteValue();
+  }
+
+  /// CHECK-START: short Main.$noinline$boxUnboxShort(short) builder (after)
+  /// CHECK: <<Input:s\d+>>       ParameterValue
+  /// CHECK: <<Boxed:l\d+>>       InvokeStaticOrDirect [<<Input>>{{(,[ij]\d+)?}}] method_name:java.lang.Short.valueOf intrinsic:ShortValueOf
+  /// CHECK-NOT:                  NullCheck [<<Boxed>>]
+  /// CHECK: <<Unboxed:s\d+>>     InvokeVirtual [<<Boxed>>] method_name:java.lang.Short.shortValue
+  /// CHECK:                      Return [<<Unboxed>>]
+
+  /// CHECK-START: short Main.$noinline$boxUnboxShort(short) inliner (after)
+  /// CHECK: <<Input:s\d+>>       ParameterValue
+  /// CHECK: <<Boxed:l\d+>>       InvokeStaticOrDirect [<<Input>>{{(,[ij]\d+)?}}] method_name:java.lang.Short.valueOf intrinsic:ShortValueOf
+  /// CHECK: <<Unboxed:s\d+>>     InstanceFieldGet [<<Boxed>>] field_name:java.lang.Short.value
+  /// CHECK:                      Return [<<Unboxed>>]
+
+  /// CHECK-START: short Main.$noinline$boxUnboxShort(short) instruction_simplifier$after_inlining (after)
+  /// CHECK: <<Input:s\d+>>       ParameterValue
+  /// CHECK:                      Return [<<Input>>]
+
+  /// CHECK-START: short Main.$noinline$boxUnboxShort(short) dead_code_elimination$after_inlining (after)
+  /// CHECK-NOT:                  InvokeStaticOrDirect
+  /// CHECK-NOT:                  InstanceFieldGet
+
+  public static short $noinline$boxUnboxShort(short value) {
+    return Short.valueOf(value).shortValue();
+  }
+
+  /// CHECK-START: char Main.$noinline$boxUnboxCharacter(char) builder (after)
+  /// CHECK: <<Input:c\d+>>       ParameterValue
+  /// CHECK: <<Boxed:l\d+>>       InvokeStaticOrDirect [<<Input>>{{(,[ij]\d+)?}}] method_name:java.lang.Character.valueOf intrinsic:CharacterValueOf
+  /// CHECK-NOT:                  NullCheck [<<Boxed>>]
+  /// CHECK: <<Unboxed:c\d+>>     InvokeVirtual [<<Boxed>>] method_name:java.lang.Character.charValue
+  /// CHECK:                      Return [<<Unboxed>>]
+
+  /// CHECK-START: char Main.$noinline$boxUnboxCharacter(char) inliner (after)
+  /// CHECK: <<Input:c\d+>>       ParameterValue
+  /// CHECK: <<Boxed:l\d+>>       InvokeStaticOrDirect [<<Input>>{{(,[ij]\d+)?}}] method_name:java.lang.Character.valueOf intrinsic:CharacterValueOf
+  /// CHECK: <<Unboxed:c\d+>>     InstanceFieldGet [<<Boxed>>] field_name:java.lang.Character.value
+  /// CHECK:                      Return [<<Unboxed>>]
+
+  /// CHECK-START: char Main.$noinline$boxUnboxCharacter(char) instruction_simplifier$after_inlining (after)
+  /// CHECK: <<Input:c\d+>>       ParameterValue
+  /// CHECK:                      Return [<<Input>>]
+
+  /// CHECK-START: char Main.$noinline$boxUnboxCharacter(char) dead_code_elimination$after_inlining (after)
+  /// CHECK-NOT:                  InvokeStaticOrDirect
+  /// CHECK-NOT:                  InstanceFieldGet
+
+  public static char $noinline$boxUnboxCharacter(char value) {
+    return Character.valueOf(value).charValue();
+  }
+
+  /// CHECK-START: int Main.$noinline$boxUnboxInteger(int) builder (after)
+  /// CHECK: <<Input:i\d+>>       ParameterValue
+  /// CHECK: <<Boxed:l\d+>>       InvokeStaticOrDirect [<<Input>>{{(,[ij]\d+)?}}] method_name:java.lang.Integer.valueOf intrinsic:IntegerValueOf
+  /// CHECK-NOT:                  NullCheck [<<Boxed>>]
+  /// CHECK: <<Unboxed:i\d+>>     InvokeVirtual [<<Boxed>>] method_name:java.lang.Integer.intValue
+  /// CHECK:                      Return [<<Unboxed>>]
+
+  /// CHECK-START: int Main.$noinline$boxUnboxInteger(int) inliner (after)
+  /// CHECK: <<Input:i\d+>>       ParameterValue
+  /// CHECK: <<Boxed:l\d+>>       InvokeStaticOrDirect [<<Input>>{{(,[ij]\d+)?}}] method_name:java.lang.Integer.valueOf intrinsic:IntegerValueOf
+  /// CHECK: <<Unboxed:i\d+>>     InstanceFieldGet [<<Boxed>>] field_name:java.lang.Integer.value
+  /// CHECK:                      Return [<<Unboxed>>]
+
+  /// CHECK-START: int Main.$noinline$boxUnboxInteger(int) instruction_simplifier$after_inlining (after)
+  /// CHECK: <<Input:i\d+>>       ParameterValue
+  /// CHECK:                      Return [<<Input>>]
+
+  /// CHECK-START: int Main.$noinline$boxUnboxInteger(int) dead_code_elimination$after_inlining (after)
+  /// CHECK-NOT:                  InvokeStaticOrDirect
+  /// CHECK-NOT:                  InstanceFieldGet
+
+  public static int $noinline$boxUnboxInteger(int value) {
+    return Integer.valueOf(value).intValue();
+  }
+
+  /// CHECK-START: int Main.$noinline$boxUnboxByteAsUint8(byte) builder (after)
+  /// CHECK-DAG: <<Input:b\d+>>   ParameterValue
+  /// CHECK-DAG: <<Boxed:l\d+>>   InvokeStaticOrDirect [<<Input>>{{(,[ij]\d+)?}}] method_name:java.lang.Byte.valueOf intrinsic:ByteValueOf
+  /// CHECK-DAG: <<Phi:l\d+>>     Phi
+  /// CHECK-DAG: <<NC:l\d+>>      NullCheck [<<Phi>>]
+  /// CHECK-DAG: <<Unboxed:b\d+>> InvokeVirtual [<<NC>>] method_name:java.lang.Byte.byteValue
+  /// CHECK-DAG: <<And:i\d+>>     And
+  /// CHECK-DAG:                  Return [<<And>>]
+
+  /// CHECK-START: int Main.$noinline$boxUnboxByteAsUint8(byte) instruction_simplifier (after)
+  /// CHECK-DAG: <<Input:b\d+>>   ParameterValue
+  /// CHECK-DAG: <<Boxed:l\d+>>   InvokeStaticOrDirect [<<Input>>{{(,[ij]\d+)?}}] method_name:java.lang.Byte.valueOf intrinsic:ByteValueOf
+  /// CHECK-DAG: <<Phi:l\d+>>     Phi
+  /// CHECK-DAG: <<NC:l\d+>>      NullCheck [<<Phi>>]
+  /// CHECK-DAG: <<Unboxed:b\d+>> InvokeVirtual [<<NC>>] method_name:java.lang.Byte.byteValue
+  /// CHECK-DAG: <<Conv:a\d+>>    TypeConversion [<<Unboxed>>]
+  /// CHECK-DAG:                  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$boxUnboxByteAsUint8(byte) inliner (after)
+  /// CHECK-DAG: <<Input:b\d+>>   ParameterValue
+  /// CHECK-DAG: <<Boxed:l\d+>>   InvokeStaticOrDirect [<<Input>>{{(,[ij]\d+)?}}] method_name:java.lang.Byte.valueOf intrinsic:ByteValueOf
+  /// CHECK-DAG: <<Phi:l\d+>>     Phi
+  /// CHECK-DAG: <<NC:l\d+>>      NullCheck [<<Phi>>]
+  /// CHECK-DAG: <<Unboxed:b\d+>> InstanceFieldGet [<<NC>>] field_name:java.lang.Byte.value
+  /// CHECK-DAG: <<Conv:a\d+>>    TypeConversion [<<Unboxed>>]
+  /// CHECK-DAG:                  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$boxUnboxByteAsUint8(byte) instruction_simplifier$after_inlining (after)
+  /// CHECK-DAG: <<Input:b\d+>>   ParameterValue
+  /// CHECK-DAG: <<Boxed:l\d+>>   InvokeStaticOrDirect [<<Input>>{{(,[ij]\d+)?}}] method_name:java.lang.Byte.valueOf intrinsic:ByteValueOf
+  /// CHECK-DAG: <<Phi:l\d+>>     Phi
+  /// CHECK-DAG: <<NC:l\d+>>      NullCheck [<<Phi>>]
+  /// CHECK-DAG: <<Conv:a\d+>>    InstanceFieldGet [<<NC>>] field_name:java.lang.Byte.value
+  /// CHECK-DAG:                  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$boxUnboxByteAsUint8(byte) dead_code_elimination$after_inlining (after)
+  /// CHECK-DAG: <<Input:b\d+>>   ParameterValue
+  /// CHECK-DAG: <<Boxed:l\d+>>   InvokeStaticOrDirect [<<Input>>{{(,[ij]\d+)?}}] method_name:java.lang.Byte.valueOf intrinsic:ByteValueOf
+  /// CHECK-DAG: <<NC:l\d+>>      NullCheck [<<Boxed>>]
+  /// CHECK-DAG: <<Conv:a\d+>>    InstanceFieldGet [<<NC>>] field_name:java.lang.Byte.value
+  /// CHECK-DAG:                  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$boxUnboxByteAsUint8(byte) instruction_simplifier$after_gvn (after)
+  /// CHECK-DAG: <<Input:b\d+>>   ParameterValue
+  /// CHECK-DAG: <<Boxed:l\d+>>   InvokeStaticOrDirect [<<Input>>{{(,[ij]\d+)?}}] method_name:java.lang.Byte.valueOf intrinsic:ByteValueOf
+  /// CHECK-DAG: <<Conv:a\d+>>    InstanceFieldGet [<<Boxed>>] field_name:java.lang.Byte.value
+  /// CHECK-DAG:                  Return [<<Conv>>]
+
+  /// CHECK-START: int Main.$noinline$boxUnboxByteAsUint8(byte) disassembly (after)
+  /// CHECK-DAG: <<Input:b\d+>>   ParameterValue
+  /// CHECK-DAG: <<Boxed:l\d+>>   InvokeStaticOrDirect [<<Input>>{{(,[ij]\d+)?}}] method_name:java.lang.Byte.valueOf intrinsic:ByteValueOf
+  /// CHECK-DAG: <<Conv:a\d+>>    InstanceFieldGet [<<Boxed>>] field_name:java.lang.Byte.value
+  /// CHECK-DAG:                  Return [<<Conv>>]
+
+  public static int $noinline$boxUnboxByteAsUint8(byte value) {
+    Byte boxed = Byte.valueOf(value);
+
+    // Hide the unboxing from the initial instruction simplifier pass or the one after inlining,
+    // so that after inlining we can merge the `TypeConversion` into `InstanceFieldGet` with
+    // a modified type. The Phi shall be eliminated by `dead_code_elimination$after_inlining`.
+    // The null check that shall be eliminated by `instruction_simplifier$after_gvn (after)`
+    Byte merged = $inline$returnTrue() ? boxed : null;
+
+    // Due to the type mismatch, we shall not simplify the unboxing. The boxing and unboxing
+    // shall be kept during subsequent simplifier passes all the way to the disassembly.
+    return merged.byteValue() & 0xff;
+  }
+
+  public static boolean $inline$returnTrue() {
+    return true;
+  }
+
   public static void main(String[] args) {
     assertEqual("42", foo(intField));
     assertEqual(foo(intField), foo(intField2));
@@ -65,6 +237,18 @@
     assertEqual("127", foo(intField127));
     assertEqual(foo(intField127), foo(intField127));
     assertEqual("128", foo(intField128));
+
+    assertEqual(42, (int) $noinline$boxUnboxByte((byte) 42));
+    assertEqual(-42, (int) $noinline$boxUnboxByte((byte) -42));
+    assertEqual(42, (int) $noinline$boxUnboxShort((short) 42));
+    assertEqual(-42, (int) $noinline$boxUnboxShort((short) -42));
+    assertEqual((int) (char) 42, (int) $noinline$boxUnboxCharacter((char) 42));
+    assertEqual((int) (char) -42, (int) $noinline$boxUnboxCharacter((char) -42));
+    assertEqual(42, $noinline$boxUnboxInteger(42));
+    assertEqual(-42, $noinline$boxUnboxInteger(-42));
+
+    assertEqual(42, $noinline$boxUnboxByteAsUint8((byte) 42));
+    assertEqual(-42 & 0xff, $noinline$boxUnboxByteAsUint8((byte) -42));
   }
 
   static void assertEqual(String a, Integer b) {
@@ -79,6 +263,12 @@
     }
   }
 
+  static void assertEqual(int a, int b) {
+    if (a != b) {
+      throw new Error("Expected " + a + ", got " + b);
+    }
+  }
+
   static int intField = 42;
   static int intField2 = 42;
   static int intField3 = 55555;
diff --git a/test/645-checker-abs-simd/src/Main.java b/test/645-checker-abs-simd/src/Main.java
index b1a1b81..43881be 100644
--- a/test/645-checker-abs-simd/src/Main.java
+++ b/test/645-checker-abs-simd/src/Main.java
@@ -122,13 +122,13 @@
     }
   }
 
-  /// CHECK-START: void Main.doitCastedChar(char[]) loop_optimization (before)
+  /// CHECK-START: void Main.doitCastChar(char[]) loop_optimization (before)
   /// CHECK-DAG: Phi       loop:<<Loop:B\d+>> outer_loop:none
   /// CHECK-DAG: ArrayGet  loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG: Abs       loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG: ArraySet  loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START-ARM64: void Main.doitCastedChar(char[]) loop_optimization (after)
+  /// CHECK-START-ARM64: void Main.doitCastChar(char[]) loop_optimization (after)
   /// CHECK-DAG: VecLoad   loop:<<Loop1:B\d+>> outer_loop:none
   /// CHECK-DAG: VecAbs    loop:<<Loop1>>      outer_loop:none
   /// CHECK-DAG: VecStore  loop:<<Loop1>>      outer_loop:none
@@ -148,7 +148,7 @@
   ///     CHECK-EVAL: "<<Loop1>>" != "<<Loop2>>"
   //
   /// CHECK-FI:
-  private static void doitCastedChar(char[] x) {
+  private static void doitCastChar(char[] x) {
     for (int i = 0; i < x.length; i++) {
       x[i] = (char) Math.abs((short) x[i]);
     }
@@ -321,7 +321,7 @@
     for (int i = 0; i < 1024 * 64; i++) {
       xc[i] = (char) i;
     }
-    doitCastedChar(xc);
+    doitCastChar(xc);
     for (int i = 0; i < 1024 * 64; i++) {
       expectEquals32((char) Math.abs((short) i), xc[i]);
     }
diff --git a/test/646-checker-long-const-to-int/src/Main.java b/test/646-checker-long-const-to-int/src/Main.java
index 2133588..491565b 100644
--- a/test/646-checker-long-const-to-int/src/Main.java
+++ b/test/646-checker-long-const-to-int/src/Main.java
@@ -16,7 +16,7 @@
 
 public class Main {
     public static void main(String[] args) {
-        System.out.println(test());
+        System.out.println(test(0L));
     }
 
     public static long testField = 0;
@@ -29,18 +29,18 @@
     public static long longField6 = 0;
     public static long longField7 = 0;
 
-    /// CHECK-START-ARM: int Main.test() register (after)
+    /// CHECK-START-ARM: int Main.test(long) register (after)
     /// CHECK: TypeConversion locations:[#-8690466096623102344]->{{.*}}
-    public static int test() {
+    public static int test(long other) {
         // To avoid constant folding TypeConversion(const), hide the constant in a field. Then, hide
-        // it even more inside a Select that can only be reduced after LSE+InstructionSelector. We
+        // it even more inside a Select that can only be reduced after LSE+InstructionSimplifier. We
         // don't run constant folding after that.
         testField = 0x8765432112345678L;
         long value = testField;
         if (value + 1 == 0x8765432112345679L) {
             value = testField;
         } else {
-            value = 0;
+            value = other;
         }
         // Now, the `value` is in a register because of the store but we need
         // a constant location to trigger the bug, so load a bunch of other fields.
diff --git a/test/646-checker-simd-hadd/src/HaddOther.java b/test/646-checker-simd-hadd/src/HaddOther.java
index 139df83..377ea9a 100644
--- a/test/646-checker-simd-hadd/src/HaddOther.java
+++ b/test/646-checker-simd-hadd/src/HaddOther.java
@@ -72,13 +72,13 @@
 
   //  Should be just add and shift right, not halving add.
   //
-  /// CHECK-START-{ARM,ARM64}: void HaddOther.test_no_hadd_sum_casted(short[], short[], short[]) loop_optimization (after)
+  /// CHECK-START-{ARM,ARM64}: void HaddOther.test_no_hadd_sum_cast(short[], short[], short[]) loop_optimization (after)
   /// CHECK: VecAdd
   /// CHECK: VecShr
 
-  /// CHECK-START-{ARM,ARM64}: void HaddOther.test_no_hadd_sum_casted(short[], short[], short[]) loop_optimization (after)
+  /// CHECK-START-{ARM,ARM64}: void HaddOther.test_no_hadd_sum_cast(short[], short[], short[]) loop_optimization (after)
   /// CHECK-NOT: VecHalvingAdd
-  private static void test_no_hadd_sum_casted(short[] a, short[] b, short[] out) {
+  private static void test_no_hadd_sum_cast(short[] a, short[] b, short[] out) {
     int min_length = Math.min(out.length, Math.min(a.length, b.length));
     for (int i = 0; i < min_length; i++) {
       out[i] = (short) (((short) (a[i] + b[i])) >> 1);
@@ -87,10 +87,10 @@
 
   //  This loop is not vectorized: mismatched packed type size.
   //
-  /// CHECK-START-{ARM,ARM64}: void HaddOther.test_no_hadd_sum_casted_ints(int[], int[], int[]) loop_optimization (after)
+  /// CHECK-START-{ARM,ARM64}: void HaddOther.test_no_hadd_sum_cast_ints(int[], int[], int[]) loop_optimization (after)
   /// CHECK-NOT: VecLoad
   /// CHECK-NOT: VecHalvingAdd
-  private static void test_no_hadd_sum_casted_ints(int[] a, int[] b, int[] out) {
+  private static void test_no_hadd_sum_cast_ints(int[] a, int[] b, int[] out) {
     int min_length = Math.min(out.length, Math.min(a.length, b.length));
     for (int i = 0; i < min_length; i++) {
       out[i] = (short) ((short) (a[i] + b[i]) >> 1);
@@ -99,11 +99,11 @@
 
   //  Should be an add, followed by a halving add.
   //
-  /// CHECK-START-ARM: void HaddOther.test_no_hadd_sum_casted_plus_const(short[], short[], short[]) loop_optimization (after)
+  /// CHECK-START-ARM: void HaddOther.test_no_hadd_sum_cast_plus_const(short[], short[], short[]) loop_optimization (after)
   /// CHECK: VecAdd
   /// CHECK: VecHalvingAdd
   //
-  /// CHECK-START-ARM64: void HaddOther.test_no_hadd_sum_casted_plus_const(short[], short[], short[]) loop_optimization (after)
+  /// CHECK-START-ARM64: void HaddOther.test_no_hadd_sum_cast_plus_const(short[], short[], short[]) loop_optimization (after)
   /// CHECK-IF:     hasIsaFeature("sve")
   //
   //      HalvingAdd idiom is not supported for SVE.
@@ -115,7 +115,7 @@
   ///     CHECK: VecHalvingAdd
   //
   /// CHECK-FI:
-  private static void test_no_hadd_sum_casted_plus_const(short[] a, short[] b, short[] out) {
+  private static void test_no_hadd_sum_cast_plus_const(short[] a, short[] b, short[] out) {
     int min_length = Math.min(out.length, Math.min(a.length, b.length));
     for (int i = 0; i < min_length; i++) {
       out[i] = (short) (((short) (a[i] + b[i]) + 1) >> 1);
@@ -170,17 +170,17 @@
       int e = iA[i] >> 1;
       expectEquals(e, iOut[i]);
     }
-    test_no_hadd_sum_casted(sA, sB, sOut);
+    test_no_hadd_sum_cast(sA, sB, sOut);
     for (int i = 0; i < M; i++) {
       short e = (short) (((short) (sA[i] + sB[i])) >> 1);
       expectEquals(e, sOut[i]);
     }
-    test_no_hadd_sum_casted_ints(iA, iB, iOut);
+    test_no_hadd_sum_cast_ints(iA, iB, iOut);
     for (int i = 0; i < M; i++) {
       int e = (short) ((short) (iA[i] + iB[i]) >> 1);
       expectEquals(e, iOut[i]);
     }
-    test_no_hadd_sum_casted_plus_const(sA, sB, sOut);
+    test_no_hadd_sum_cast_plus_const(sA, sB, sOut);
     for (int i = 0; i < M; i++) {
       short e = (short) (((short) (sA[i] + sB[i]) + 1) >> 1);
       expectEquals(e, sOut[i]);
diff --git a/test/654-checker-periodic/src/Main.java b/test/654-checker-periodic/src/Main.java
index 7a0c98c..0ae0b31 100644
--- a/test/654-checker-periodic/src/Main.java
+++ b/test/654-checker-periodic/src/Main.java
@@ -50,6 +50,21 @@
     return lI;
   }
 
+  /// CHECK-START: int Main.doitDownInt2(int) loop_optimization (before)
+  /// CHECK-DAG: <<Phi:i\d+>> Phi  loop:<<Loop:B\d+>> outer_loop:none
+  /// CHECK-DAG:              Phi  loop:<<Loop>>      outer_loop:none
+  //
+  /// CHECK-START: int Main.doitDownInt2(int) loop_optimization (after)
+  /// CHECK-NOT: Phi
+  static int doitDownInt2(int n) {
+    // Complete loop is replaced by last-value.
+    int lI = 1;
+    for (int i1 = n; i1 > 0; i1--) {
+      lI = (1486662021 - lI);
+    }
+    return lI;
+  }
+
   /// CHECK-START: float Main.doitUpFloat(int) loop_optimization (before)
   /// CHECK-DAG: <<Phi:i\d+>> Phi  loop:<<Loop:B\d+>> outer_loop:none
   /// CHECK-DAG:              Phi  loop:<<Loop>>      outer_loop:none
@@ -122,6 +137,25 @@
     return lF;
   }
 
+  /// CHECK-START: float Main.doitDownFloatAlt2(int) loop_optimization (before)
+  /// CHECK-DAG: <<Phi:i\d+>> Phi  loop:<<Loop:B\d+>> outer_loop:none
+  /// CHECK-DAG:              Phi  loop:<<Loop>>      outer_loop:none
+  //
+  /// CHECK-START: float Main.doitDownFloatAlt2(int) loop_optimization (after)
+  /// CHECK-NOT: Phi
+  static float doitDownFloatAlt2(int n) {
+    // Complete loop is replaced by last-value
+    // since the values are now precise.
+    float lF = 1.0f;
+    float l2 = 1486662020.0f;
+    for (int i1 = n; i1 > 0; i1--) {
+      float old = lF;
+      lF = l2;
+      l2 = old;
+    }
+    return lF;
+  }
+
   // Main driver.
   public static void main(String[] args) {
     for (int i = 0; i < 10; i++) {
@@ -135,6 +169,11 @@
       expectEquals(ei, ci);
     }
     for (int i = 0; i < 10; i++) {
+      int ei = (i & 1) == 0 ? 1 : 1486662020;
+      int ci = doitDownInt2(i);
+      expectEquals(ei, ci);
+    }
+    for (int i = 0; i < 10; i++) {
       float ef = i == 0 ? 1.0f : ((i & 1) == 0 ? 0.0f : 1486662021.0f);
       float cf = doitUpFloat(i);
       expectEquals(ef, cf);
@@ -154,6 +193,11 @@
       float cf = doitDownFloatAlt(i);
       expectEquals(ef, cf);
     }
+    for (int i = 0; i < 10; i++) {
+      float ef = (i & 1) == 0 ? 1.0f : 1486662020.0f;
+      float cf = doitDownFloatAlt2(i);
+      expectEquals(ef, cf);
+    }
     System.out.println("passed");
   }
 
diff --git a/test/656-checker-simd-opt/src/Main.java b/test/656-checker-simd-opt/src/Main.java
index be8c52f..9fc4536 100644
--- a/test/656-checker-simd-opt/src/Main.java
+++ b/test/656-checker-simd-opt/src/Main.java
@@ -28,7 +28,7 @@
   /// CHECK-DAG: <<Mul:f\d+>>  Mul [<<Get>>,<<Cons>>]              loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:               ArraySet [{{l\d+}},<<Phi>>,<<Mul>>] loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START-ARM64: void Main.unroll(float[], float[]) loop_optimization (after)
+  /// CHECK-START-{X86_64,ARM64}: void Main.unroll(float[], float[]) loop_optimization (after)
   /// CHECK-DAG: <<Cons:f\d+>> FloatConstant 2.5                    loop:none
 
   /// CHECK-IF:     hasIsaFeature("sve")
@@ -65,7 +65,7 @@
     }
   }
 
-  /// CHECK-START-ARM64: void Main.stencil(int[], int[], int) loop_optimization (after)
+  /// CHECK-START-{X86_64,ARM64}: void Main.stencil(int[], int[], int) loop_optimization (after)
   /// CHECK-DAG: <<CP1:i\d+>>   IntConstant 1                         loop:none
   /// CHECK-DAG: <<CP2:i\d+>>   IntConstant 2                         loop:none
   /// CHECK-IF:     hasIsaFeature("sve")
@@ -100,6 +100,62 @@
     }
   }
 
+  // Array size is chosen to be such a constant, that the loop trip count (in the test below)
+  // is a multiple of vector length and unroll factor; hence clean up is needed exclusively for
+  // the array references test.
+  public static final int STENCIL_ARRAY_SIZE = 130;
+
+  /// CHECK-START-{X86_64,ARM64}: void Main.$noinline$stencilConstSize(int[], int[]) loop_optimization (after)
+  /// CHECK-DAG: <<C0:i\d+>>    IntConstant 0
+  /// CHECK-DAG: <<CP1:i\d+>>   IntConstant 1
+  /// CHECK-DAG: <<CP2:i\d+>>   IntConstant 2
+  /// CHECK-DAG: <<Arr0:l\d+>>  ParameterValue
+  /// CHECK-DAG: <<Arr1:l\d+>>  ParameterValue
+  /// CHECK-DAG: <<ArrCh:z\d+>> NotEqual [<<Arr0>>,<<Arr1>>]         loop:none
+  /// CHECK-DAG: <<TCSel:i\d+>> Select [<<C0>>,{{i\d+}},<<ArrCh>>]   loop:none
+  /// CHECK-DAG: <<PhiV:i\d+>>  Phi [<<C0>>,{{i\d+}}]                loop:<<LoopV:B\d+>> outer_loop:none
+  //
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-DAG: <<LoopP:j\d+>> VecPredWhile [<<PhiV>>,{{i\d+}}]                loop:<<LoopV>>      outer_loop:none
+  ///     CHECK-DAG: <<Add1:i\d+>>  Add [<<PhiV>>,<<CP1>>]                          loop:<<LoopV>>      outer_loop:none
+  ///     CHECK-DAG: <<Get1:d\d+>>  VecLoad [{{l\d+}},<<PhiV>>,<<LoopP>>]           loop:<<LoopV>>      outer_loop:none
+  ///     CHECK-DAG: <<Get2:d\d+>>  VecLoad [{{l\d+}},<<Add1>>,<<LoopP>>]           loop:<<LoopV>>      outer_loop:none
+  ///     CHECK-DAG: <<Add2:d\d+>>  VecAdd [<<Get1>>,<<Get2>>,<<LoopP>>]            loop:<<LoopV>>      outer_loop:none
+  ///     CHECK-DAG: <<Add3:i\d+>>  Add [<<PhiV>>,<<CP2>>]                          loop:<<LoopV>>      outer_loop:none
+  ///     CHECK-DAG: <<Get3:d\d+>>  VecLoad [{{l\d+}},<<Add3>>,<<LoopP>>]           loop:<<LoopV>>      outer_loop:none
+  ///     CHECK-DAG: <<Add4:d\d+>>  VecAdd [<<Add2>>,<<Get3>>,<<LoopP>>]            loop:<<LoopV>>      outer_loop:none
+  ///     CHECK-DAG:                VecStore [{{l\d+}},<<Add1>>,<<Add4>>,<<LoopP>>] loop:<<LoopV>>      outer_loop:none
+  //
+  /// CHECK-ELSE:
+  //
+  ///     CHECK-DAG: <<Add1:i\d+>>  Add [<<PhiV>>,<<CP1>>]                          loop:<<LoopV>>      outer_loop:none
+  ///     CHECK-DAG: <<Get1:d\d+>>  VecLoad [{{l\d+}},<<PhiV>>]                     loop:<<LoopV>>      outer_loop:none
+  ///     CHECK-DAG: <<Get2:d\d+>>  VecLoad [{{l\d+}},<<Add1>>]                     loop:<<LoopV>>      outer_loop:none
+  ///     CHECK-DAG: <<Add2:d\d+>>  VecAdd [<<Get1>>,<<Get2>>]                      loop:<<LoopV>>      outer_loop:none
+  ///     CHECK-DAG: <<Add3:i\d+>>  Add [<<PhiV>>,<<CP2>>]                          loop:<<LoopV>>      outer_loop:none
+  ///     CHECK-DAG: <<Get3:d\d+>>  VecLoad [{{l\d+}},<<Add3>>]                     loop:<<LoopV>>      outer_loop:none
+  ///     CHECK-DAG: <<Add4:d\d+>>  VecAdd [<<Add2>>,<<Get3>>]                      loop:<<LoopV>>      outer_loop:none
+  ///     CHECK-DAG:                VecStore [{{l\d+}},<<Add1>>,<<Add4>>]           loop:<<LoopV>>      outer_loop:none
+  //
+  /// CHECK-FI:
+  //
+  // Cleanup loop.
+  //
+  /// CHECK-DAG: <<PhiS:i\d+>>   Phi [<<PhiV>>,{{i\d+}}]             loop:<<LoopS:B\d+>> outer_loop:none
+  /// CHECK-DAG:                 ArrayGet                            loop:<<LoopS>>      outer_loop:none
+  /// CHECK-DAG:                 ArrayGet                            loop:<<LoopS>>      outer_loop:none
+  /// CHECK-DAG:                 ArrayGet                            loop:<<LoopS>>      outer_loop:none
+  /// CHECK-DAG:                 ArraySet                            loop:<<LoopS>>      outer_loop:none
+  //
+  // Checks the disambiguation runtime test for array references.
+  //
+  private static void $noinline$stencilConstSize(int[] a, int[] b) {
+    for (int i = 1; i < STENCIL_ARRAY_SIZE - 1; i++) {
+      a[i] = b[i - 1] + b[i] + b[i + 1];
+    }
+  }
+
   /// CHECK-START: void Main.stencilAddInt(int[], int[], int) loop_optimization (before)
   /// CHECK-DAG: <<CP1:i\d+>>   IntConstant 1                        loop:none
   /// CHECK-DAG: <<CM1:i\d+>>   IntConstant -1                       loop:none
@@ -217,7 +273,7 @@
   /// CHECK-DAG: <<Add2>>       Add [<<Phi2>>,<<Get>>]     loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG: <<Add1>>       Add [<<Phi1>>,<<L1>>]      loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START-ARM64: long Main.longInductionReduction(long[]) loop_optimization (after)
+  /// CHECK-START-{X86_64,ARM64}: long Main.longInductionReduction(long[]) loop_optimization (after)
   /// CHECK-DAG: <<L0:j\d+>>    LongConstant 0               loop:none
   /// CHECK-DAG: <<L1:j\d+>>    LongConstant 1               loop:none
   /// CHECK-DAG: <<I0:i\d+>>    IntConstant 0                loop:none
@@ -260,7 +316,7 @@
   /// CHECK-DAG:                ArraySet [{{l\d+}},<<Phi>>,<<Cnv>>] loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG: <<Add>>        Add [<<Phi>>,<<I1>>]                loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START-ARM64: void Main.intVectorLongInvariant(int[], long[]) loop_optimization (after)
+  /// CHECK-START-{X86_64,ARM64}: void Main.intVectorLongInvariant(int[], long[]) loop_optimization (after)
   /// CHECK-DAG: <<I0:i\d+>>    IntConstant 0                       loop:none
   /// CHECK-DAG: <<I1:i\d+>>    IntConstant 1                       loop:none
   /// CHECK-DAG: <<Get:j\d+>>   ArrayGet [{{l\d+}},<<I0>>]          loop:none
@@ -300,7 +356,7 @@
   /// CHECK-DAG:                ArraySet [{{l\d+}},<<Phi>>,<<Cnv2>>] loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG: <<Add>>        Add [<<Phi>>,<<I1>>]                 loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START-ARM64: void Main.longCanBeDoneWithInt(int[], int[]) loop_optimization (after)
+  /// CHECK-START-{X86_64,ARM64}: void Main.longCanBeDoneWithInt(int[], int[]) loop_optimization (after)
   /// CHECK-DAG: <<I0:i\d+>>    IntConstant 0                       loop:none
   /// CHECK-DAG: <<L1:j\d+>>    LongConstant 1                      loop:none
   /// CHECK-DAG: <<Cnv:i\d+>>   TypeConversion [<<L1>>]             loop:none
@@ -345,13 +401,17 @@
     }
   }
 
+  private static void initArrayStencil(int[] arr) {
+    for (int i = 0; i < arr.length; i++) {
+      arr[i] = i;
+    }
+  }
+
   static void testStencil1() {
     int[] a = new int[100];
     int[] b = new int[100];
-    for (int i = 0; i < 100; i++) {
-      a[i] = 0;
-      b[i] = i;
-    }
+    initArrayStencil(b);
+
     stencil(a, b, 100);
     for (int i = 1; i < 99; i++) {
       int e = i + i + i;
@@ -360,13 +420,35 @@
     }
   }
 
+  // Checks the disambiguation runtime test for array references.
+  static void testStencilConstSize() {
+    int[] a = new int[STENCIL_ARRAY_SIZE];
+    int[] b = new int[STENCIL_ARRAY_SIZE];
+    initArrayStencil(b);
+
+    for (int i = 1; i < STENCIL_ARRAY_SIZE - 1; i++) {
+    $noinline$stencilConstSize(a, b);
+      // (i - 1) + i + (i + 1) = 3 * i.
+      int e = i + i + i;
+      expectEquals(e, a[i]);
+      expectEquals(i, b[i]);
+    }
+
+    initArrayStencil(b);
+    $noinline$stencilConstSize(b, b);
+
+    for (int i = 1; i < STENCIL_ARRAY_SIZE - 1; i++) {
+      // The formula of the ith member of recurrent def: b[i] = b[i-1] + (i) + (i+1).
+      int e = i * (i + 2);
+      expectEquals(e, b[i]);
+    }
+  }
+
   static void testStencil2() {
     int[] a = new int[100];
     int[] b = new int[100];
-    for (int i = 0; i < 100; i++) {
-      a[i] = 0;
-      b[i] = i;
-    }
+    initArrayStencil(b);
+
     stencilSubInt(a, b, 100);
     for (int i = 1; i < 99; i++) {
       int e = i + i + i;
@@ -378,10 +460,8 @@
   static void testStencil3() {
     int[] a = new int[100];
     int[] b = new int[100];
-    for (int i = 0; i < 100; i++) {
-      a[i] = 0;
-      b[i] = i;
-    }
+    initArrayStencil(b);
+
     stencilAddInt(a, b, 100);
     for (int i = 1; i < 99; i++) {
       int e = i + i + i;
@@ -408,6 +488,7 @@
   public static void main(String[] args) {
     testUnroll();
     testStencil1();
+    testStencilConstSize();
     testStencil2();
     testStencil3();
     testTypes();
diff --git a/test/660-checker-simd-sad/src/SimdSadShort2.java b/test/660-checker-simd-sad/src/SimdSadShort2.java
index fdc073c..9688f0e 100644
--- a/test/660-checker-simd-sad/src/SimdSadShort2.java
+++ b/test/660-checker-simd-sad/src/SimdSadShort2.java
@@ -17,46 +17,47 @@
 /**
  * Tests for SAD (sum of absolute differences).
  *
- * Special case, char array that is first casted to short, forcing sign extension.
+ * Special case, char array that is first cast to short, forcing sign extension.
  */
 public class SimdSadShort2 {
 
   // TODO: lower precision still coming, b/64091002
 
-  private static short sadCastedChar2Short(char[] s1, char[] s2) {
-    int min_length = Math.min(s1.length, s2.length);
-    short sad = 0;
-    for (int i = 0; i < min_length; i++) {
-      sad += Math.abs(((short) s1[i]) - ((short) s2[i]));
-    }
-    return sad;
+  private static short sadCastChar2Short(char[] s1, char[] s2) {
+      int min_length = Math.min(s1.length, s2.length);
+      short sad = 0;
+      for (int i = 0; i < min_length; i++) {
+          sad += Math.abs(((short) s1[i]) - ((short) s2[i]));
+      }
+      return sad;
   }
 
-  private static short sadCastedChar2ShortAlt(char[] s1, char[] s2) {
-    int min_length = Math.min(s1.length, s2.length);
-    short sad = 0;
-    for (int i = 0; i < min_length; i++) {
-      short s = (short) s1[i];
-      short p = (short) s2[i];
-      sad += s >= p ? s - p : p - s;
-    }
-    return sad;
+  private static short sadCastChar2ShortAlt(char[] s1, char[] s2) {
+      int min_length = Math.min(s1.length, s2.length);
+      short sad = 0;
+      for (int i = 0; i < min_length; i++) {
+          short s = (short) s1[i];
+          short p = (short) s2[i];
+          sad += s >= p ? s - p : p - s;
+      }
+      return sad;
   }
 
-  private static short sadCastedChar2ShortAlt2(char[] s1, char[] s2) {
-    int min_length = Math.min(s1.length, s2.length);
-    short sad = 0;
-    for (int i = 0; i < min_length; i++) {
-      short s = (short) s1[i];
-      short p = (short) s2[i];
-      int x = s - p;
-      if (x < 0) x = -x;
-      sad += x;
-    }
-    return sad;
+  private static short sadCastChar2ShortAlt2(char[] s1, char[] s2) {
+      int min_length = Math.min(s1.length, s2.length);
+      short sad = 0;
+      for (int i = 0; i < min_length; i++) {
+          short s = (short) s1[i];
+          short p = (short) s2[i];
+          int x = s - p;
+          if (x < 0)
+              x = -x;
+          sad += x;
+      }
+      return sad;
   }
 
-  /// CHECK-START: int SimdSadShort2.sadCastedChar2Int(char[], char[]) instruction_simplifier (before)
+  /// CHECK-START: int SimdSadShort2.sadCastChar2Int(char[], char[]) instruction_simplifier (before)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-DAG: <<Cons1:i\d+>>  IntConstant 1                  loop:none
   /// CHECK-DAG: <<Phi2:i\d+>>   Phi [<<Cons0>>,{{i\d+}}]       loop:<<Loop:B\d+>> outer_loop:none
@@ -72,7 +73,7 @@
   /// CHECK-DAG:                 Add [<<Phi2>>,<<Abs>>]         loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:                 Add [<<Phi1>>,<<Cons1>>]       loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START: int SimdSadShort2.sadCastedChar2Int(char[], char[]) loop_optimization (before)
+  /// CHECK-START: int SimdSadShort2.sadCastChar2Int(char[], char[]) loop_optimization (before)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-DAG: <<Cons1:i\d+>>  IntConstant 1                  loop:none
   /// CHECK-DAG: <<Phi2:i\d+>>   Phi [<<Cons0>>,{{i\d+}}]       loop:<<Loop:B\d+>> outer_loop:none
@@ -84,7 +85,7 @@
   /// CHECK-DAG:                 Add [<<Phi2>>,<<Abs>>]         loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:                 Add [<<Phi1>>,<<Cons1>>]       loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START-ARM64: int SimdSadShort2.sadCastedChar2Int(char[], char[]) loop_optimization (after)
+  /// CHECK-START-ARM64: int SimdSadShort2.sadCastChar2Int(char[], char[]) loop_optimization (after)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-IF:     hasIsaFeature("sve")
   //
@@ -103,16 +104,16 @@
   ///     CHECK-DAG:                 Add [<<Phi1>>,<<Cons8>>]       loop:<<Loop>>      outer_loop:none
   //
   /// CHECK-FI:
-  private static int sadCastedChar2Int(char[] s1, char[] s2) {
-    int min_length = Math.min(s1.length, s2.length);
-    int sad = 0;
-    for (int i = 0; i < min_length; i++) {
-      sad += Math.abs(((short) s1[i]) - ((short) s2[i]));
-    }
-    return sad;
+  private static int sadCastChar2Int(char[] s1, char[] s2) {
+      int min_length = Math.min(s1.length, s2.length);
+      int sad = 0;
+      for (int i = 0; i < min_length; i++) {
+          sad += Math.abs(((short) s1[i]) - ((short) s2[i]));
+      }
+      return sad;
   }
 
-  /// CHECK-START: int SimdSadShort2.sadCastedChar2IntAlt(char[], char[]) instruction_simplifier (before)
+  /// CHECK-START: int SimdSadShort2.sadCastChar2IntAlt(char[], char[]) instruction_simplifier (before)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-DAG: <<Cons1:i\d+>>  IntConstant 1                  loop:none
   /// CHECK-DAG: <<Phi2:i\d+>>   Phi [<<Cons0>>,{{i\d+}}]       loop:<<Loop:B\d+>> outer_loop:none
@@ -129,7 +130,7 @@
   /// CHECK-DAG:                 Add [<<Phi2>>,<<Phi3>>]        loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:                 Add [<<Phi1>>,<<Cons1>>]       loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START: int SimdSadShort2.sadCastedChar2IntAlt(char[], char[]) loop_optimization (before)
+  /// CHECK-START: int SimdSadShort2.sadCastChar2IntAlt(char[], char[]) loop_optimization (before)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-DAG: <<Cons1:i\d+>>  IntConstant 1                  loop:none
   /// CHECK-DAG: <<Phi2:i\d+>>   Phi [<<Cons0>>,{{i\d+}}]       loop:<<Loop:B\d+>> outer_loop:none
@@ -141,7 +142,7 @@
   /// CHECK-DAG:                 Add [<<Phi2>>,<<Intrin>>]      loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:                 Add [<<Phi1>>,<<Cons1>>]       loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START-ARM64: int SimdSadShort2.sadCastedChar2IntAlt(char[], char[]) loop_optimization (after)
+  /// CHECK-START-ARM64: int SimdSadShort2.sadCastChar2IntAlt(char[], char[]) loop_optimization (after)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-IF:     hasIsaFeature("sve")
   //
@@ -160,18 +161,18 @@
   ///     CHECK-DAG:                 Add [<<Phi1>>,<<Cons8>>]       loop:<<Loop>>      outer_loop:none
   //
   /// CHECK-FI:
-  private static int sadCastedChar2IntAlt(char[] s1, char[] s2) {
-    int min_length = Math.min(s1.length, s2.length);
-    int sad = 0;
-    for (int i = 0; i < min_length; i++) {
-      short s = (short) s1[i];
-      short p = (short) s2[i];
-      sad += s >= p ? s - p : p - s;
-    }
-    return sad;
+  private static int sadCastChar2IntAlt(char[] s1, char[] s2) {
+      int min_length = Math.min(s1.length, s2.length);
+      int sad = 0;
+      for (int i = 0; i < min_length; i++) {
+          short s = (short) s1[i];
+          short p = (short) s2[i];
+          sad += s >= p ? s - p : p - s;
+      }
+      return sad;
   }
 
-  /// CHECK-START: int SimdSadShort2.sadCastedChar2IntAlt2(char[], char[]) instruction_simplifier (before)
+  /// CHECK-START: int SimdSadShort2.sadCastChar2IntAlt2(char[], char[]) instruction_simplifier (before)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-DAG: <<Cons1:i\d+>>  IntConstant 1                  loop:none
   /// CHECK-DAG: <<Phi2:i\d+>>   Phi [<<Cons0>>,{{i\d+}}]       loop:<<Loop:B\d+>> outer_loop:none
@@ -188,7 +189,7 @@
   /// CHECK-DAG:                 Add [<<Phi2>>,<<Phi3>>]        loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:                 Add [<<Phi1>>,<<Cons1>>]       loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START: int SimdSadShort2.sadCastedChar2IntAlt2(char[], char[]) loop_optimization (before)
+  /// CHECK-START: int SimdSadShort2.sadCastChar2IntAlt2(char[], char[]) loop_optimization (before)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-DAG: <<Cons1:i\d+>>  IntConstant 1                  loop:none
   /// CHECK-DAG: <<Phi2:i\d+>>   Phi [<<Cons0>>,{{i\d+}}]       loop:<<Loop:B\d+>> outer_loop:none
@@ -200,7 +201,7 @@
   /// CHECK-DAG:                 Add [<<Phi2>>,<<Intrin>>]      loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:                 Add [<<Phi1>>,<<Cons1>>]       loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START-ARM64: int SimdSadShort2.sadCastedChar2IntAlt2(char[], char[]) loop_optimization (after)
+  /// CHECK-START-ARM64: int SimdSadShort2.sadCastChar2IntAlt2(char[], char[]) loop_optimization (after)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-IF:     hasIsaFeature("sve")
   //
@@ -219,20 +220,21 @@
   ///     CHECK-DAG:                 Add [<<Phi1>>,<<Cons8>>]       loop:<<Loop>>      outer_loop:none
   //
   /// CHECK-FI:
-  private static int sadCastedChar2IntAlt2(char[] s1, char[] s2) {
-    int min_length = Math.min(s1.length, s2.length);
-    int sad = 0;
-    for (int i = 0; i < min_length; i++) {
-      short s = (short) s1[i];
-      short p = (short) s2[i];
-      int x = s - p;
-      if (x < 0) x = -x;
-      sad += x;
-    }
-    return sad;
+  private static int sadCastChar2IntAlt2(char[] s1, char[] s2) {
+      int min_length = Math.min(s1.length, s2.length);
+      int sad = 0;
+      for (int i = 0; i < min_length; i++) {
+          short s = (short) s1[i];
+          short p = (short) s2[i];
+          int x = s - p;
+          if (x < 0)
+              x = -x;
+          sad += x;
+      }
+      return sad;
   }
 
-  /// CHECK-START: long SimdSadShort2.sadCastedChar2Long(char[], char[]) instruction_simplifier (before)
+  /// CHECK-START: long SimdSadShort2.sadCastChar2Long(char[], char[]) instruction_simplifier (before)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-DAG: <<Cons1:i\d+>>  IntConstant 1                  loop:none
   /// CHECK-DAG: <<ConsL:j\d+>>  LongConstant 0                 loop:none
@@ -251,7 +253,7 @@
   /// CHECK-DAG:                 Add [<<Phi2>>,<<Abs>>]         loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:                 Add [<<Phi1>>,<<Cons1>>]       loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START: long SimdSadShort2.sadCastedChar2Long(char[], char[]) loop_optimization (before)
+  /// CHECK-START: long SimdSadShort2.sadCastChar2Long(char[], char[]) loop_optimization (before)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-DAG: <<Cons1:i\d+>>  IntConstant 1                  loop:none
   /// CHECK-DAG: <<ConsL:j\d+>>  LongConstant 0                 loop:none
@@ -266,7 +268,7 @@
   /// CHECK-DAG:                 Add [<<Phi2>>,<<Abs>>]         loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:                 Add [<<Phi1>>,<<Cons1>>]       loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START-ARM64: long SimdSadShort2.sadCastedChar2Long(char[], char[]) loop_optimization (after)
+  /// CHECK-START-ARM64: long SimdSadShort2.sadCastChar2Long(char[], char[]) loop_optimization (after)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-DAG: <<ConsL:j\d+>>  LongConstant 0                 loop:none
   /// CHECK-IF:     hasIsaFeature("sve")
@@ -286,18 +288,18 @@
   ///     CHECK-DAG:                 Add [<<Phi1>>,<<Cons8>>]       loop:<<Loop>>      outer_loop:none
   //
   /// CHECK-FI:
-  private static long sadCastedChar2Long(char[] s1, char[] s2) {
-    int min_length = Math.min(s1.length, s2.length);
-    long sad = 0;
-    for (int i = 0; i < min_length; i++) {
-      long x = (short) s1[i];
-      long y = (short) s2[i];
-      sad += Math.abs(x - y);
-    }
-    return sad;
+  private static long sadCastChar2Long(char[] s1, char[] s2) {
+      int min_length = Math.min(s1.length, s2.length);
+      long sad = 0;
+      for (int i = 0; i < min_length; i++) {
+          long x = (short) s1[i];
+          long y = (short) s2[i];
+          sad += Math.abs(x - y);
+      }
+      return sad;
   }
 
-  /// CHECK-START: long SimdSadShort2.sadCastedChar2LongAt1(char[], char[]) instruction_simplifier (before)
+  /// CHECK-START: long SimdSadShort2.sadCastChar2LongAt1(char[], char[]) instruction_simplifier (before)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-DAG: <<Cons1:i\d+>>  IntConstant 1                  loop:none
   /// CHECK-DAG: <<ConsL:j\d+>>  LongConstant 1                 loop:none
@@ -316,7 +318,7 @@
   /// CHECK-DAG:                 Add [<<Phi2>>,<<Abs>>]         loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:                 Add [<<Phi1>>,<<Cons1>>]       loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START: long SimdSadShort2.sadCastedChar2LongAt1(char[], char[]) loop_optimization (before)
+  /// CHECK-START: long SimdSadShort2.sadCastChar2LongAt1(char[], char[]) loop_optimization (before)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-DAG: <<Cons1:i\d+>>  IntConstant 1                  loop:none
   /// CHECK-DAG: <<ConsL:j\d+>>  LongConstant 1                 loop:none
@@ -331,7 +333,7 @@
   /// CHECK-DAG:                 Add [<<Phi2>>,<<Abs>>]         loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:                 Add [<<Phi1>>,<<Cons1>>]       loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START-ARM64: long SimdSadShort2.sadCastedChar2LongAt1(char[], char[]) loop_optimization (after)
+  /// CHECK-START-ARM64: long SimdSadShort2.sadCastChar2LongAt1(char[], char[]) loop_optimization (after)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-DAG: <<ConsL:j\d+>>  LongConstant 1                 loop:none
   /// CHECK-IF:     hasIsaFeature("sve")
@@ -351,37 +353,37 @@
   ///     CHECK-DAG:                 Add [<<Phi1>>,<<Cons8>>]       loop:<<Loop>>      outer_loop:none
   //
   /// CHECK-FI:
-  private static long sadCastedChar2LongAt1(char[] s1, char[] s2) {
-    int min_length = Math.min(s1.length, s2.length);
-    long sad = 1;  // starts at 1
-    for (int i = 0; i < min_length; i++) {
-      long x = (short) s1[i];
-      long y = (short) s2[i];
-      sad += Math.abs(x - y);
-    }
-    return sad;
+  private static long sadCastChar2LongAt1(char[] s1, char[] s2) {
+      int min_length = Math.min(s1.length, s2.length);
+      long sad = 1; // starts at 1
+      for (int i = 0; i < min_length; i++) {
+          long x = (short) s1[i];
+          long y = (short) s2[i];
+          sad += Math.abs(x - y);
+      }
+      return sad;
   }
 
   public static void main() {
     // Cross-test the two most extreme values individually.
     char[] s1 = { 0, 0x8000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
     char[] s2 = { 0, 0x7fff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-    expectEquals(-1, sadCastedChar2Short(s1, s2));
-    expectEquals(-1, sadCastedChar2Short(s2, s1));
-    expectEquals(-1, sadCastedChar2ShortAlt(s1, s2));
-    expectEquals(-1, sadCastedChar2ShortAlt(s2, s1));
-    expectEquals(-1, sadCastedChar2ShortAlt2(s1, s2));
-    expectEquals(-1, sadCastedChar2ShortAlt2(s2, s1));
-    expectEquals(65535, sadCastedChar2Int(s1, s2));
-    expectEquals(65535, sadCastedChar2Int(s2, s1));
-    expectEquals(65535, sadCastedChar2IntAlt(s1, s2));
-    expectEquals(65535, sadCastedChar2IntAlt(s2, s1));
-    expectEquals(65535, sadCastedChar2IntAlt2(s1, s2));
-    expectEquals(65535, sadCastedChar2IntAlt2(s2, s1));
-    expectEquals(65535L, sadCastedChar2Long(s1, s2));
-    expectEquals(65535L, sadCastedChar2Long(s2, s1));
-    expectEquals(65536L, sadCastedChar2LongAt1(s1, s2));
-    expectEquals(65536L, sadCastedChar2LongAt1(s2, s1));
+    expectEquals(-1, sadCastChar2Short(s1, s2));
+    expectEquals(-1, sadCastChar2Short(s2, s1));
+    expectEquals(-1, sadCastChar2ShortAlt(s1, s2));
+    expectEquals(-1, sadCastChar2ShortAlt(s2, s1));
+    expectEquals(-1, sadCastChar2ShortAlt2(s1, s2));
+    expectEquals(-1, sadCastChar2ShortAlt2(s2, s1));
+    expectEquals(65535, sadCastChar2Int(s1, s2));
+    expectEquals(65535, sadCastChar2Int(s2, s1));
+    expectEquals(65535, sadCastChar2IntAlt(s1, s2));
+    expectEquals(65535, sadCastChar2IntAlt(s2, s1));
+    expectEquals(65535, sadCastChar2IntAlt2(s1, s2));
+    expectEquals(65535, sadCastChar2IntAlt2(s2, s1));
+    expectEquals(65535L, sadCastChar2Long(s1, s2));
+    expectEquals(65535L, sadCastChar2Long(s2, s1));
+    expectEquals(65536L, sadCastChar2LongAt1(s1, s2));
+    expectEquals(65536L, sadCastChar2LongAt1(s2, s1));
 
     // Use cross-values to test all cases.
     char[] interesting = {
@@ -408,14 +410,14 @@
     }
     s1[k] = 10;
     s2[k] = 2;
-    expectEquals(-18932, sadCastedChar2Short(s1, s2));
-    expectEquals(-18932, sadCastedChar2ShortAlt(s1, s2));
-    expectEquals(-18932, sadCastedChar2ShortAlt2(s1, s2));
-    expectEquals(1291788, sadCastedChar2Int(s1, s2));
-    expectEquals(1291788, sadCastedChar2IntAlt(s1, s2));
-    expectEquals(1291788, sadCastedChar2IntAlt2(s1, s2));
-    expectEquals(1291788L, sadCastedChar2Long(s1, s2));
-    expectEquals(1291789L, sadCastedChar2LongAt1(s1, s2));
+    expectEquals(-18932, sadCastChar2Short(s1, s2));
+    expectEquals(-18932, sadCastChar2ShortAlt(s1, s2));
+    expectEquals(-18932, sadCastChar2ShortAlt2(s1, s2));
+    expectEquals(1291788, sadCastChar2Int(s1, s2));
+    expectEquals(1291788, sadCastChar2IntAlt(s1, s2));
+    expectEquals(1291788, sadCastChar2IntAlt2(s1, s2));
+    expectEquals(1291788L, sadCastChar2Long(s1, s2));
+    expectEquals(1291789L, sadCastChar2LongAt1(s1, s2));
 
     System.out.println("SimdSadShort2 passed");
   }
diff --git a/test/660-checker-simd-sad/src/SimdSadShort3.java b/test/660-checker-simd-sad/src/SimdSadShort3.java
index 5977891..0687d1e 100644
--- a/test/660-checker-simd-sad/src/SimdSadShort3.java
+++ b/test/660-checker-simd-sad/src/SimdSadShort3.java
@@ -17,7 +17,7 @@
 /**
  * Tests for SAD (sum of absolute differences).
  *
- * Some special cases: parameters, constants, invariants, casted computations.
+ * Some special cases: parameters, constants, invariants, cast computations.
  */
 public class SimdSadShort3 {
 
@@ -263,7 +263,7 @@
     return sad;
   }
 
-  /// CHECK-START: int SimdSadShort3.sadShort2IntCastedExprRight(short[]) loop_optimization (before)
+  /// CHECK-START: int SimdSadShort3.sadShort2IntCastExprRight(short[]) loop_optimization (before)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-DAG: <<Cons1:i\d+>>  IntConstant 1                  loop:none
   /// CHECK-DAG: <<ConsI:i\d+>>  IntConstant 110                loop:none
@@ -277,7 +277,7 @@
   /// CHECK-DAG:                 Add [<<Phi2>>,<<Intrin>>]      loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:                 Add [<<Phi1>>,<<Cons1>>]       loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START-ARM64: int SimdSadShort3.sadShort2IntCastedExprRight(short[]) loop_optimization (after)
+  /// CHECK-START-ARM64: int SimdSadShort3.sadShort2IntCastExprRight(short[]) loop_optimization (after)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-DAG: <<ConsI:i\d+>>  IntConstant 110                loop:none
   /// CHECK-IF:     hasIsaFeature("sve")
@@ -298,7 +298,7 @@
   ///     CHECK-DAG:                 Add [<<Phi1>>,<<Cons8>>]       loop:<<Loop>>      outer_loop:none
   //
   /// CHECK-FI:
-  private static int sadShort2IntCastedExprRight(short[] s) {
+  private static int sadShort2IntCastExprRight(short[] s) {
     int sad = 0;
     for (int i = 0; i < s.length; i++) {
       short x = (short) (s[i] + 110);  // narrower part sign extends
@@ -307,7 +307,7 @@
     return sad;
   }
 
-  /// CHECK-START: int SimdSadShort3.sadShort2IntCastedExprLeft(short[]) loop_optimization (before)
+  /// CHECK-START: int SimdSadShort3.sadShort2IntCastExprLeft(short[]) loop_optimization (before)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-DAG: <<Cons1:i\d+>>  IntConstant 1                  loop:none
   /// CHECK-DAG: <<ConsI:i\d+>>  IntConstant 110                loop:none
@@ -321,7 +321,7 @@
   /// CHECK-DAG:                 Add [<<Phi2>>,<<Intrin>>]      loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:                 Add [<<Phi1>>,<<Cons1>>]       loop:<<Loop>>      outer_loop:none
   //
-  /// CHECK-START-ARM64: int SimdSadShort3.sadShort2IntCastedExprLeft(short[]) loop_optimization (after)
+  /// CHECK-START-ARM64: int SimdSadShort3.sadShort2IntCastExprLeft(short[]) loop_optimization (after)
   /// CHECK-DAG: <<Cons0:i\d+>>  IntConstant 0                  loop:none
   /// CHECK-DAG: <<ConsI:i\d+>>  IntConstant 110                loop:none
   /// CHECK-IF:     hasIsaFeature("sve")
@@ -342,7 +342,7 @@
   ///     CHECK-DAG:                 Add [<<Phi1>>,<<Cons8>>]       loop:<<Loop>>      outer_loop:none
   //
   /// CHECK-FI:
-  private static int sadShort2IntCastedExprLeft(short[] s) {
+  private static int sadShort2IntCastExprLeft(short[] s) {
     int sad = 0;
     for (int i = 0; i < s.length; i++) {
       short x = (short) (s[i] + 110);  // narrower part sign extends
@@ -406,8 +406,8 @@
     expectEquals(2635416, sadShort2IntInvariantLeft(s, 0x7ffe));
     expectEquals(1558824, sadShort2IntInvariantLeft(s, 0x7fff));
 
-    expectEquals(268304, sadShort2IntCastedExprLeft(s));
-    expectEquals(268304, sadShort2IntCastedExprRight(s));
+    expectEquals(268304, sadShort2IntCastExprLeft(s));
+    expectEquals(268304, sadShort2IntCastExprRight(s));
 
     System.out.println("SimdSadShort3 passed");
   }
diff --git a/test/661-checker-simd-cf-loops/Android.bp b/test/661-checker-simd-cf-loops/Android.bp
new file mode 100644
index 0000000..8d2c193
--- /dev/null
+++ b/test/661-checker-simd-cf-loops/Android.bp
@@ -0,0 +1,43 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `661-checker-simd-cf-loops`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-661-checker-simd-cf-loops",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-template",
+    srcs: ["src/**/*.java"],
+    data: [
+        ":art-run-test-661-checker-simd-cf-loops-expected-stdout",
+        ":art-run-test-661-checker-simd-cf-loops-expected-stderr",
+    ],
+    // Include the Java source files in the test's artifacts, to make Checker assertions
+    // available to the TradeFed test runner.
+    include_srcs: true,
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-661-checker-simd-cf-loops-expected-stdout",
+    out: ["art-run-test-661-checker-simd-cf-loops-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-661-checker-simd-cf-loops-expected-stderr",
+    out: ["art-run-test-661-checker-simd-cf-loops-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/test/015-switch/expected-stderr.txt b/test/661-checker-simd-cf-loops/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/661-checker-simd-cf-loops/expected-stderr.txt
diff --git a/test/661-checker-simd-cf-loops/expected-stdout.txt b/test/661-checker-simd-cf-loops/expected-stdout.txt
new file mode 100644
index 0000000..b0aad4d
--- /dev/null
+++ b/test/661-checker-simd-cf-loops/expected-stdout.txt
@@ -0,0 +1 @@
+passed
diff --git a/test/661-checker-simd-cf-loops/info.txt b/test/661-checker-simd-cf-loops/info.txt
new file mode 100644
index 0000000..bc7881d
--- /dev/null
+++ b/test/661-checker-simd-cf-loops/info.txt
@@ -0,0 +1 @@
+Functional tests on vectorization of loops with control flow.
diff --git a/test/661-checker-simd-cf-loops/src/Main.java b/test/661-checker-simd-cf-loops/src/Main.java
new file mode 100644
index 0000000..95c0949
--- /dev/null
+++ b/test/661-checker-simd-cf-loops/src/Main.java
@@ -0,0 +1,746 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Tests for autovectorization of loops with control flow.
+ */
+public class Main {
+
+  public static final int ARRAY_LENGTH = 128;
+  public static final int USED_ARRAY_LENGTH = ARRAY_LENGTH - 1;
+
+  public static boolean[] booleanArray = new boolean[ARRAY_LENGTH];
+  public static boolean[] booleanArray2 = new boolean[ARRAY_LENGTH];
+  public static byte[] byteArray = new byte[ARRAY_LENGTH];
+  public static short[] shortArray = new short[ARRAY_LENGTH];
+  public static char[] charArray = new char[ARRAY_LENGTH];
+  public static int[] intArray = new int[ARRAY_LENGTH];
+  public static long[] longArray = new long[ARRAY_LENGTH];
+  public static float[] floatArray = new float[ARRAY_LENGTH];
+  public static double[] doubleArray = new double[ARRAY_LENGTH];
+
+  public static final int MAGIC_VALUE_A = 2;
+  public static final int MAGIC_VALUE_B = 10;
+  public static final int MAGIC_VALUE_C = 100;
+
+  public static final int MAGIC_ADD_CONST = 99;
+
+  public static final float MAGIC_FLOAT_VALUE_A = 2.0f;
+  public static final float MAGIC_FLOAT_VALUE_B = 10.0f;
+  public static final float MAGIC_FLOAT_VALUE_C = 100.0f;
+
+  public static final float MAGIC_FLOAT_ADD_CONST = 99.0f;
+
+  /// CHECK-START-ARM64: int Main.$compile$noinline$FullDiamond(int[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-DAG: <<C0:i\d+>>      IntConstant 0                                         loop:none
+  ///     CHECK-DAG: <<C4:i\d+>>      IntConstant 4                                         loop:none
+  ///     CHECK-DAG: <<C99:i\d+>>     IntConstant 99                                        loop:none
+  ///     CHECK-DAG: <<C100:i\d+>>    IntConstant 100                                       loop:none
+  ///     CHECK-DAG: <<Vec4:d\d+>>    VecReplicateScalar [<<C4>>,{{j\d+}}]                  loop:none
+  ///     CHECK-DAG: <<Vec99:d\d+>>   VecReplicateScalar [<<C99>>,{{j\d+}}]                 loop:none
+  ///     CHECK-DAG: <<Vec100:d\d+>>  VecReplicateScalar [<<C100>>,{{j\d+}}]                loop:none
+  //
+  ///     CHECK-DAG: <<Phi:i\d+>>     Phi [<<C0>>,{{i\d+}}]                                 loop:<<Loop:B\d+>> outer_loop:none
+  ///     CHECK-DAG: <<LoopP:j\d+>>   VecPredWhile [<<Phi>>,{{i\d+}}]                       loop:<<Loop>>      outer_loop:none
+  //
+  ///     CHECK-DAG: <<Load1:d\d+>>   VecLoad [<<Arr:l\d+>>,<<Phi>>,<<LoopP>>]              loop:<<Loop>>      outer_loop:none
+  ///     CHECK-DAG: <<Cond:j\d+>>    VecCondition [<<Load1>>,<<Vec100>>,<<LoopP>>]         loop:<<Loop>>      outer_loop:none
+  ///     CHECK-DAG: <<CondR:j\d+>>   VecPredNot [<<Cond>>,<<LoopP>>]                       loop:<<Loop>>      outer_loop:none
+  ///     CHECK-DAG: <<AddT:d\d+>>    VecAdd [<<Load1>>,<<Vec99>>,<<CondR>>]                loop:<<Loop>>      outer_loop:none
+  ///     CHECK-DAG: <<StT:d\d+>>     VecStore [<<Arr>>,<<Phi>>,<<AddT>>,<<CondR>>]         loop:<<Loop>>      outer_loop:none
+  ///     CHECK-DAG: <<StF:d\d+>>     VecStore [<<Arr>>,<<Phi>>,{{d\d+}},<<Cond>>]          loop:<<Loop>>      outer_loop:none
+  ///     CHECK-DAG: <<Ld2:d\d+>>     VecLoad [<<Arr>>,<<Phi>>,<<LoopP>>]                   loop:<<Loop>>      outer_loop:none
+  ///     CHECK-DAG: <<Add2:d\d+>>    VecAdd [<<Ld2>>,<<Vec4>>,<<LoopP>>]                   loop:<<Loop>>      outer_loop:none
+  ///     CHECK-DAG: <<St21:d\d+>>    VecStore [<<Arr>>,<<Phi>>,<<Add2>>,<<LoopP>>]         loop:<<Loop>>      outer_loop:none
+  //
+  /// CHECK-ELSE:
+  //
+  ///     CHECK-NOT:                      VecLoad
+  //
+  /// CHECK-FI:
+  public static int $compile$noinline$FullDiamond(int[] x) {
+    int i = 0;
+    for (; i < USED_ARRAY_LENGTH; i++) {
+      int val = x[i];
+      if (val != MAGIC_VALUE_C) {
+        x[i] += MAGIC_ADD_CONST;
+      } else {
+        x[i] += 3;
+      }
+      x[i] += 4;
+    }
+    return i;
+  }
+
+  //
+  // Test various types.
+  //
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$SimpleBoolean(boolean[], boolean[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-NOT: VecLoad
+  //
+  /// CHECK-FI:
+  //
+  // TODO: Support extra condition types and boolean comparisons.
+  public static void $compile$noinline$SimpleBoolean(boolean[] x, boolean[] y) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      boolean val = x[i];
+      if (val != y[i]) {
+        x[i] |= y[i];
+      }
+    }
+  }
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$SimpleByte(byte[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-DAG: VecLoad
+  //
+  /// CHECK-FI:
+  public static void $compile$noinline$SimpleByte(byte[] x) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      byte val = x[i];
+      if (val != MAGIC_VALUE_C) {
+        x[i] += MAGIC_ADD_CONST;
+      }
+    }
+  }
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$SimpleUByte(byte[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-DAG: VecLoad
+  //
+  /// CHECK-FI:
+  public static void $compile$noinline$SimpleUByte(byte[] x) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      if ((x[i] & 0xFF) != MAGIC_VALUE_C) {
+        x[i] += MAGIC_ADD_CONST;
+      }
+    }
+  }
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$SimpleShort(short[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-DAG: VecLoad
+  //
+  /// CHECK-FI:
+  public static void $compile$noinline$SimpleShort(short[] x) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      short val = x[i];
+      if (val != MAGIC_VALUE_C) {
+        x[i] += MAGIC_ADD_CONST;
+      }
+    }
+  }
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$SimpleChar(char[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-DAG: VecLoad
+  //
+  /// CHECK-FI:
+  public static void $compile$noinline$SimpleChar(char[] x) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      char val = x[i];
+      if (val != MAGIC_VALUE_C) {
+        x[i] += MAGIC_ADD_CONST;
+      }
+    }
+  }
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$SimpleInt(int[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-DAG: VecLoad
+  //
+  /// CHECK-FI:
+  public static void $compile$noinline$SimpleInt(int[] x) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      int val = x[i];
+      if (val != MAGIC_VALUE_C) {
+        x[i] += MAGIC_ADD_CONST;
+      }
+    }
+  }
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$SimpleLong(long[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-NOT: VecLoad
+  //
+  /// CHECK-FI:
+  //
+  // TODO: Support long comparisons.
+  public static void $compile$noinline$SimpleLong(long[] x) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      long val = x[i];
+      if (val != MAGIC_VALUE_C) {
+        x[i] += MAGIC_ADD_CONST;
+      }
+    }
+  }
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$SimpleFloat(float[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-NOT: VecLoad
+  //
+  /// CHECK-FI:
+  //
+  // TODO: Support FP comparisons.
+  public static void $compile$noinline$SimpleFloat(float[] x) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      float val = x[i];
+      if (val > 10.0f) {
+        x[i] += 99.1f;
+      }
+    }
+  }
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$SimpleDouble(double[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-NOT: VecLoad
+  //
+  /// CHECK-FI:
+  //
+  // TODO: Support FP comparisons.
+  public static void $compile$noinline$SimpleDouble(double[] x) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      double val = x[i];
+      if (val != 10.0) {
+        x[i] += 99.1;
+      }
+    }
+  }
+
+  //
+  // Narrowing types.
+  //
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$ByteConv(byte[], byte[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-DAG: VecLoad
+  //
+  /// CHECK-FI:
+  public static void $compile$noinline$ByteConv(byte[] x, byte[] y) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      byte val = (byte)(x[i] + 1);
+      if (val != y[i]) {
+        x[i] += MAGIC_ADD_CONST;
+      }
+    }
+  }
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$UByteAndWrongConst(byte[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-NOT: VecLoad
+  //
+  /// CHECK-FI:
+  //
+  // 'NarrowerOperands' not met: the constant is not a ubyte one.
+  public static void $compile$noinline$UByteAndWrongConst(byte[] x) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      if ((x[i] & 0xFF) != (MAGIC_VALUE_C | 0x100)) {
+        x[i] += MAGIC_ADD_CONST;
+      }
+    }
+  }
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$ByteNoHiBits(byte[], byte[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-NOT: VecLoad
+  //
+  /// CHECK-FI:
+  //
+  // Check kNoHiBits case when "wider" operations cannot bring in higher order bits.
+  public static void $compile$noinline$ByteNoHiBits(byte[] x, byte[] y) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      byte val = x[i];
+      if ((val >>> 3) != y[i]) {
+        x[i] += MAGIC_ADD_CONST;
+      }
+    }
+  }
+
+  //
+  // Test condition types.
+  //
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$SimpleBelow(int[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-NOT: VecLoad
+  //
+  /// CHECK-FI:
+  //
+  // TODO: Support other conditions.
+  public static void $compile$noinline$SimpleBelow(int[] x) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      int val = x[i];
+      if (val < MAGIC_VALUE_C) {
+        x[i] += MAGIC_ADD_CONST;
+      }
+    }
+  }
+
+  //
+  // Test vectorization idioms.
+  //
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$Select(int[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-NOT: VecLoad
+  //
+  /// CHECK-FI:
+  //
+  // TODO: vectorize loops with select in the body.
+  public static void $compile$noinline$Select(int[] x) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      int val = x[i];
+      if (val != MAGIC_VALUE_C) {
+        val += MAGIC_ADD_CONST;
+      }
+      x[i] = val;
+    }
+  }
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$Phi(int[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-NOT: VecLoad
+  //
+  /// CHECK-FI:
+  //
+  // TODO: vectorize loops with phis in the body.
+  public static void $compile$noinline$Phi(int[] x) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      int val = x[i];
+      if (val != MAGIC_VALUE_C) {
+        val += MAGIC_ADD_CONST;
+        x[i] += val;
+      }
+      x[i] += val;
+    }
+  }
+
+  // TODO: when Phis are supported, test dotprod and sad idioms.
+
+  /// CHECK-START-ARM64: int Main.$compile$noinline$Reduction(int[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-NOT: VecLoad
+  //
+  /// CHECK-FI:
+  //
+  // TODO: vectorize loops with phis and reductions in the body.
+  private static int $compile$noinline$Reduction(int[] x) {
+    int sum = 0;
+    for (int i = 0; i < ARRAY_LENGTH; i++) {
+      int val = x[i];
+      if (val != MAGIC_VALUE_C) {
+        sum += val + x[i];
+      }
+    }
+    return sum;
+  }
+
+  /// CHECK-START-ARM64: int Main.$compile$noinline$ReductionBackEdge(int[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-DAG: VecLoad
+  //
+  /// CHECK-FI:
+  //
+  // Reduction in the back edge block, non-CF-dependent.
+  public static int $compile$noinline$ReductionBackEdge(int[] x) {
+    int sum = 0;
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      int val = x[i];
+      if (val != MAGIC_VALUE_C) {
+        x[i] += MAGIC_ADD_CONST;
+      }
+      sum += x[i];
+    }
+    return sum;
+  }
+
+  //
+  // Negative compile tests.
+  //
+
+  public static final int STENCIL_ARRAY_SIZE = 130;
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$stencilAlike(int[], int[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-NOT: VecLoad
+  //
+  /// CHECK-FI:
+  //
+  // This loop needs a runtime test for array references disambiguation and a scalar cleanup loop.
+  // Currently we can't generate a scalar clean up loop with control flow.
+  private static void $compile$noinline$stencilAlike(int[] a, int[] b) {
+    for (int i = 1; i < STENCIL_ARRAY_SIZE - 1; i++) {
+      int val0 = b[i - 1];
+      int val1 = b[i];
+      int val2 = b[i + 1];
+      int un = a[i];
+      if (val1 != MAGIC_VALUE_C) {
+        a[i] = val0 + val1 + val2;
+      }
+    }
+  }
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$NotDiamondCf(int[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-NOT: VecLoad
+  //
+  /// CHECK-FI:
+  //
+  // Loops with complex CF are not supported.
+  public static void $compile$noinline$NotDiamondCf(int[] x) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      int val = x[i];
+      if (val != MAGIC_VALUE_C) {
+        if (val != 1234) {
+          x[i] += MAGIC_ADD_CONST;
+        }
+      }
+    }
+  }
+
+  /// CHECK-START-ARM64: void Main.$compile$noinline$BrokenInduction(int[]) loop_optimization (after)
+  /// CHECK-IF:     hasIsaFeature("sve")
+  //
+  ///     CHECK-NOT: VecLoad
+  //
+  /// CHECK-FI:
+  public static void $compile$noinline$BrokenInduction(int[] x) {
+    for (int i = 0; i < USED_ARRAY_LENGTH; i++) {
+      int val = x[i];
+      if (val != MAGIC_VALUE_C) {
+        x[i] += MAGIC_ADD_CONST;
+        i++;
+      }
+    }
+  }
+
+  //
+  // Main driver.
+  //
+
+  public static void main(String[] args) {
+    initIntArray(intArray);
+    int final_ind_value = $compile$noinline$FullDiamond(intArray);
+    expectIntEquals(23755, IntArraySum(intArray));
+    expectIntEquals(USED_ARRAY_LENGTH, final_ind_value);
+
+    // Types.
+    initBooleanArray(booleanArray);
+    booleanArray2[12] = true;
+    $compile$noinline$SimpleBoolean(booleanArray, booleanArray2);
+    expectIntEquals(86, BooleanArraySum(booleanArray));
+
+    initByteArray(byteArray);
+    $compile$noinline$SimpleByte(byteArray);
+    expectIntEquals(-64, ByteArraySum(byteArray));
+
+    initByteArray(byteArray);
+    $compile$noinline$SimpleUByte(byteArray);
+    expectIntEquals(-64, ByteArraySum(byteArray));
+
+    initShortArray(shortArray);
+    $compile$noinline$SimpleShort(shortArray);
+    expectIntEquals(23121, ShortArraySum(shortArray));
+
+    initCharArray(charArray);
+    $compile$noinline$SimpleChar(charArray);
+    expectIntEquals(23121, CharArraySum(charArray));
+
+    initIntArray(intArray);
+    $compile$noinline$SimpleInt(intArray);
+    expectIntEquals(23121, IntArraySum(intArray));
+
+    initLongArray(longArray);
+    $compile$noinline$SimpleLong(longArray);
+    expectLongEquals(23121, LongArraySum(longArray));
+
+    initFloatArray(floatArray);
+    $compile$noinline$SimpleFloat(floatArray);
+    expectFloatEquals(18868.2f, FloatArraySum(floatArray));
+
+    initDoubleArray(doubleArray);
+    $compile$noinline$SimpleDouble(doubleArray);
+    expectDoubleEquals(23129.5, DoubleArraySum(doubleArray));
+
+    // Narrowing types.
+    initByteArray(byteArray);
+    $compile$noinline$ByteConv(byteArray, byteArray);
+    expectIntEquals(-2, ByteArraySum(byteArray));
+
+    initByteArray(byteArray);
+    $compile$noinline$UByteAndWrongConst(byteArray);
+    expectIntEquals(-2, ByteArraySum(byteArray));
+
+    initByteArray(byteArray);
+    $compile$noinline$ByteNoHiBits(byteArray, byteArray);
+    expectIntEquals(-2, ByteArraySum(byteArray));
+
+    // Conditions.
+    initIntArray(intArray);
+    $compile$noinline$SimpleBelow(intArray);
+    expectIntEquals(23121, IntArraySum(intArray));
+
+    // Idioms.
+    initIntArray(intArray);
+    $compile$noinline$Select(intArray);
+    expectIntEquals(23121, IntArraySum(intArray));
+
+    initIntArray(intArray);
+    $compile$noinline$Phi(intArray);
+    expectIntEquals(36748, IntArraySum(intArray));
+
+    int reduction_result = 0;
+
+    initIntArray(intArray);
+    reduction_result = $compile$noinline$Reduction(intArray);
+    expectIntEquals(14706, IntArraySum(intArray));
+    expectIntEquals(21012, reduction_result);
+
+    initIntArray(intArray);
+    reduction_result = $compile$noinline$ReductionBackEdge(intArray);
+    expectIntEquals(23121, IntArraySum(intArray));
+    expectIntEquals(13121, reduction_result);
+
+    int[] stencilArrayA = new int[STENCIL_ARRAY_SIZE];
+    int[] stencilArrayB = new int[STENCIL_ARRAY_SIZE];
+    initIntArray(stencilArrayA);
+    initIntArray(stencilArrayB);
+    $compile$noinline$stencilAlike(stencilArrayA, stencilArrayB);
+    expectIntEquals(43602, IntArraySum(stencilArrayA));
+
+    initIntArray(intArray);
+    $compile$noinline$NotDiamondCf(intArray);
+    expectIntEquals(23121, IntArraySum(intArray));
+
+    initIntArray(intArray);
+    $compile$noinline$BrokenInduction(intArray);
+    expectIntEquals(18963, IntArraySum(intArray));
+
+    System.out.println("passed");
+  }
+
+  public static void initBooleanArray(boolean[] a) {
+    for (int i = 0; i < ARRAY_LENGTH; i++) {
+      if (i % 3 != 0) {
+        a[i] = true;
+      }
+    }
+  }
+
+  public static void initByteArray(byte[] a) {
+    for (int i = 0; i < ARRAY_LENGTH; i++) {
+      if (i % 3 == 0) {
+        a[i] = (byte)MAGIC_VALUE_A;
+      } else if (i % 3 == 1) {
+        a[i] = (byte)MAGIC_VALUE_B;
+      } else {
+        a[i] = (byte)MAGIC_VALUE_C;
+      }
+    }
+    a[USED_ARRAY_LENGTH] = 127;
+  }
+
+  public static void initShortArray(short[] a) {
+    for (int i = 0; i < ARRAY_LENGTH; i++) {
+      if (i % 3 == 0) {
+        a[i] = (short)MAGIC_VALUE_A;
+      } else if (i % 3 == 1) {
+        a[i] = (short)MAGIC_VALUE_B;
+      } else {
+        a[i] = (short)MAGIC_VALUE_C;
+      }
+    }
+    a[USED_ARRAY_LENGTH] = 10000;
+  }
+
+  public static void initCharArray(char[] a) {
+    for (int i = 0; i < ARRAY_LENGTH; i++) {
+      if (i % 3 == 0) {
+        a[i] = (char)MAGIC_VALUE_A;
+      } else if (i % 3 == 1) {
+        a[i] = (char)MAGIC_VALUE_B;
+      } else {
+        a[i] = (char)MAGIC_VALUE_C;
+      }
+    }
+    a[USED_ARRAY_LENGTH] = 10000;
+  }
+
+  public static void initIntArray(int[] a) {
+    for (int i = 0; i < ARRAY_LENGTH; i++) {
+      if (i % 3 == 0) {
+        a[i] = MAGIC_VALUE_A;
+      } else if (i % 3 == 1) {
+        a[i] = MAGIC_VALUE_B;
+      } else {
+        a[i] = MAGIC_VALUE_C;
+      }
+    }
+    a[USED_ARRAY_LENGTH] = 10000;
+  }
+
+  public static void initLongArray(long[] a) {
+    for (int i = 0; i < ARRAY_LENGTH; i++) {
+      if (i % 3 == 0) {
+        a[i] = MAGIC_VALUE_A;
+      } else if (i % 3 == 1) {
+        a[i] = MAGIC_VALUE_B;
+      } else {
+        a[i] = MAGIC_VALUE_C;
+      }
+    }
+    a[USED_ARRAY_LENGTH] = 10000;
+  }
+
+  public static void initFloatArray(float[] a) {
+    for (int i = 0; i < ARRAY_LENGTH; i++) {
+      if (i % 3 == 0) {
+        a[i] = MAGIC_FLOAT_VALUE_A;
+      } else if (i % 3 == 1) {
+        a[i] = MAGIC_FLOAT_VALUE_B;
+      } else {
+        a[i] = MAGIC_FLOAT_VALUE_C;
+      }
+    }
+    a[USED_ARRAY_LENGTH] = 10000.0f;
+  }
+
+  public static void initDoubleArray(double[] a) {
+    for (int i = 0; i < ARRAY_LENGTH; i++) {
+      if (i % 3 == 0) {
+        a[i] = MAGIC_FLOAT_VALUE_A;
+      } else if (i % 3 == 1) {
+        a[i] = MAGIC_FLOAT_VALUE_B;
+      } else {
+        a[i] = MAGIC_FLOAT_VALUE_C;
+      }
+    }
+    a[USED_ARRAY_LENGTH] = 10000.0f;
+  }
+
+  public static byte BooleanArraySum(boolean[] a) {
+    byte sum = 0;
+    for (int i = 0; i < a.length; i++) {
+      sum += a[i] ? 1 : 0;
+    }
+    return sum;
+  }
+
+  public static byte ByteArraySum(byte[] a) {
+    byte sum = 0;
+    for (int i = 0; i < a.length; i++) {
+      sum += a[i];
+    }
+    return sum;
+  }
+
+  public static short ShortArraySum(short[] a) {
+    short sum = 0;
+    for (int i = 0; i < a.length; i++) {
+      sum += a[i];
+    }
+    return sum;
+  }
+
+  public static char CharArraySum(char[] a) {
+    char sum = 0;
+    for (int i = 0; i < a.length; i++) {
+      sum += a[i];
+    }
+    return sum;
+  }
+
+  public static int IntArraySum(int[] a) {
+    int sum = 0;
+    for (int i = 0; i < a.length; i++) {
+      sum += a[i];
+    }
+    return sum;
+  }
+
+  public static long LongArraySum(long[] a) {
+    long sum = 0;
+    for (int i = 0; i < a.length; i++) {
+      sum += a[i];
+    }
+    return sum;
+  }
+
+  public static float FloatArraySum(float[] a) {
+    float sum = 0.0f;
+    for (int i = 0; i < a.length; i++) {
+      sum += a[i];
+    }
+    return sum;
+  }
+
+  public static double DoubleArraySum(double[] a) {
+    double sum = 0.0;
+    for (int i = 0; i < a.length; i++) {
+      sum += a[i];
+    }
+    return sum;
+  }
+
+  private static void expectIntEquals(int expected, int result) {
+    if (expected != result) {
+      throw new Error("Expected: " + expected + ", found: " + result);
+    }
+  }
+
+  private static void expectLongEquals(long expected, long result) {
+    if (expected != result) {
+      throw new Error("Expected: " + expected + ", found: " + result);
+    }
+  }
+
+  private static void expectFloatEquals(float expected, float result) {
+    final float THRESHOLD = .1f;
+    if (Math.abs(expected - result) >= THRESHOLD) {
+      throw new Error("Expected: " + expected + ", found: " + result);
+    }
+  }
+
+  private static void expectDoubleEquals(double expected, double result) {
+    final double THRESHOLD = .1;
+    if (Math.abs(expected - result) >= THRESHOLD) {
+      throw new Error("Expected: " + expected + ", found: " + result);
+    }
+  }
+}
diff --git a/test/661-checker-simd-reduc/src/Main.java b/test/661-checker-simd-reduc/src/Main.java
index 379e83e..b480884 100644
--- a/test/661-checker-simd-reduc/src/Main.java
+++ b/test/661-checker-simd-reduc/src/Main.java
@@ -84,7 +84,7 @@
   ///     CHECK-DAG:                    Add [<<I>>,{{i\d+}}]                     loop:<<Loop>>      outer_loop:none
   ///     CHECK-DAG: <<PostLoopP:j\d+>> VecPredSetAll [<<TrueC>>]                loop:none
   ///     CHECK-DAG: <<Red:d\d+>>       VecReduce [<<Phi>>,<<PostLoopP>>]        loop:none
-  ///     CHECK-DAG: <<Extr:i\d+>>      VecExtractScalar [<<Red>>,<<PostLoopP>>] loop:none
+  ///     CHECK-DAG: <<Extr:i\d+>>      VecExtractScalar [<<Red>>,{{j\d+}}]      loop:none
   //
   /// CHECK-ELSE:
   //
diff --git a/test/661-oat-writer-layout/oat_writer_layout.cc b/test/661-oat-writer-layout/oat_writer_layout.cc
index 4dd47a8..6eb056d 100644
--- a/test/661-oat-writer-layout/oat_writer_layout.cc
+++ b/test/661-oat-writer-layout/oat_writer_layout.cc
@@ -22,8 +22,8 @@
 #include "mirror/dex_cache.h"
 #include "mirror/executable.h"
 #include "mirror/object-inl.h"
+#include "oat/oat_file.h"
 #include "obj_ptr.h"
-#include "oat_file.h"
 #include "runtime.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread.h"
diff --git a/test/667-jit-jni-stub/jit_jni_stub_test.cc b/test/667-jit-jni-stub/jit_jni_stub_test.cc
index c21971f..2b8e14c 100644
--- a/test/667-jit-jni-stub/jit_jni_stub_test.cc
+++ b/test/667-jit-jni-stub/jit_jni_stub_test.cc
@@ -25,17 +25,6 @@
 
 namespace art {
 
-// Local class declared as a friend of JitCodeCache so that we can access its internals.
-class JitJniStubTestHelper {
- public:
-  static bool isNextJitGcFull(Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) {
-    CHECK(Runtime::Current()->GetJit() != nullptr);
-    jit::JitCodeCache* cache = Runtime::Current()->GetJit()->GetCodeCache();
-    MutexLock mu(self, *Locks::jit_lock_);
-    return cache->ShouldDoFullCollection();
-  }
-};
-
 // Calls through to a static method with signature "()V".
 extern "C" JNIEXPORT
 void Java_Main_callThrough(JNIEnv* env, jclass, jclass klass, jstring methodName) {
@@ -51,13 +40,15 @@
   CHECK(Runtime::Current()->GetJit() != nullptr);
   jit::JitCodeCache* cache = Runtime::Current()->GetJit()->GetCodeCache();
   ScopedObjectAccess soa(Thread::Current());
+  cache->InvalidateAllCompiledCode();
   cache->GarbageCollectCache(Thread::Current());
 }
 
 extern "C" JNIEXPORT
 jboolean Java_Main_isNextJitGcFull(JNIEnv*, jclass) {
-  ScopedObjectAccess soa(Thread::Current());
-  return JitJniStubTestHelper::isNextJitGcFull(soa.Self());
+  // Because we invalidate all compiled code above, we currently always do a
+  // full GC.
+  return true;
 }
 
 }  // namespace art
diff --git a/test/667-jit-jni-stub/src/Main.java b/test/667-jit-jni-stub/src/Main.java
index 234c5da..179e186 100644
--- a/test/667-jit-jni-stub/src/Main.java
+++ b/test/667-jit-jni-stub/src/Main.java
@@ -43,10 +43,6 @@
     // Also tests stack walk over the JIT-compiled stub.
     callThrough(Main.class, "testGcWithCallThroughStubOnStack");
 
-    // Test that, when marking used methods before a full JIT GC, a single execution
-    // of the GenericJNI trampoline can save the compiled stub from being collected.
-    testSingleInvocationTriggersRecompilation();
-
     // Test that the JNI compiled stub can actually be collected.
     testStubCanBeCollected();
   }
@@ -64,17 +60,6 @@
     assertTrue(hasJitCompiledCode(Main.class, "callThrough"));
   }
 
-  public static void testSingleInvocationTriggersRecompilation() {
-    // After scheduling a full JIT GC, single call through the GenericJNI
-    // trampoline should ensure that the compiled stub is used again.
-    doJitGcsUntilFullJitGcIsScheduled();
-    callThrough(Main.class, "doNothing");
-    ensureCompiledCallThroughEntrypoint(/* call */ false);  // Wait for the compilation task to run.
-    assertTrue(hasJitCompiledEntrypoint(Main.class, "callThrough"));
-    jitGc();  // This JIT GC should not collect the callThrough() stub.
-    assertTrue(hasJitCompiledCode(Main.class, "callThrough"));
-  }
-
   public static void testMixedFramesOnStack() {
     // Starts without a compiled JNI stub for callThrough().
     assertFalse(hasJitCompiledEntrypoint(Main.class, "callThrough"));
diff --git a/test/684-checker-simd-dotprod/src/other/TestByte.java b/test/684-checker-simd-dotprod/src/other/TestByte.java
index 1d5e811..a67b3e9 100644
--- a/test/684-checker-simd-dotprod/src/other/TestByte.java
+++ b/test/684-checker-simd-dotprod/src/other/TestByte.java
@@ -274,7 +274,7 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestByte.testDotProdComplexUnsignedCastedToSigned(byte[], byte[]) loop_optimization (before)
+  /// CHECK-START: int other.TestByte.testDotProdComplexUnsignedCastToSigned(byte[], byte[]) loop_optimization (before)
   /// CHECK-DAG: <<Const0:i\d+>>  IntConstant 0                                         loop:none
   /// CHECK-DAG: <<Const1:i\d+>>  IntConstant 1                                         loop:none
   /// CHECK-DAG: <<Phi1:i\d+>>    Phi [<<Const0>>,{{i\d+}}]                             loop:<<Loop:B\d+>> outer_loop:none
@@ -289,7 +289,7 @@
   /// CHECK-DAG:                  Add [<<Phi2>>,<<Mul>>]                                loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:                  Add [<<Phi1>>,<<Const1>>]                             loop:<<Loop>>      outer_loop:none
 
-  /// CHECK-START-ARM64: int other.TestByte.testDotProdComplexUnsignedCastedToSigned(byte[], byte[]) loop_optimization (after)
+  /// CHECK-START-ARM64: int other.TestByte.testDotProdComplexUnsignedCastToSigned(byte[], byte[]) loop_optimization (after)
   /// CHECK-DAG: <<Const0:i\d+>>  IntConstant 0                                         loop:none
   /// CHECK-DAG: <<Const1:i\d+>>  IntConstant 1                                         loop:none
   /// CHECK-IF:     hasIsaFeature("sve")
@@ -327,7 +327,7 @@
   ///     CHECK-DAG:                  VecExtractScalar [<<Reduce>>]                         loop:none
   //
   /// CHECK-FI:
-  public static final int testDotProdComplexUnsignedCastedToSigned(byte[] a, byte[] b) {
+  public static final int testDotProdComplexUnsignedCastToSigned(byte[] a, byte[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       int temp = ((byte)((a[i] & 0xff) + 1)) * ((byte)((b[i] & 0xff) + 1));
@@ -336,7 +336,7 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestByte.testDotProdComplexSignedCastedToUnsigned(byte[], byte[]) loop_optimization (before)
+  /// CHECK-START: int other.TestByte.testDotProdComplexSignedCastToUnsigned(byte[], byte[]) loop_optimization (before)
   /// CHECK-DAG: <<Const0:i\d+>>  IntConstant 0                                         loop:none
   /// CHECK-DAG: <<Const1:i\d+>>  IntConstant 1                                         loop:none
   /// CHECK-DAG: <<Phi1:i\d+>>    Phi [<<Const0>>,{{i\d+}}]                             loop:<<Loop:B\d+>> outer_loop:none
@@ -351,7 +351,7 @@
   /// CHECK-DAG:                  Add [<<Phi2>>,<<Mul>>]                                loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:                  Add [<<Phi1>>,<<Const1>>]                             loop:<<Loop>>      outer_loop:none
 
-  /// CHECK-START-ARM64: int other.TestByte.testDotProdComplexSignedCastedToUnsigned(byte[], byte[]) loop_optimization (after)
+  /// CHECK-START-ARM64: int other.TestByte.testDotProdComplexSignedCastToUnsigned(byte[], byte[]) loop_optimization (after)
   /// CHECK-DAG: <<Const0:i\d+>>  IntConstant 0                                         loop:none
   /// CHECK-DAG: <<Const1:i\d+>>  IntConstant 1                                         loop:none
   /// CHECK-IF:     hasIsaFeature("sve")
@@ -389,7 +389,7 @@
   ///     CHECK-DAG:                  VecExtractScalar [<<Reduce>>]                         loop:none
   //
   /// CHECK-FI:
-  public static final int testDotProdComplexSignedCastedToUnsigned(byte[] a, byte[] b) {
+  public static final int testDotProdComplexSignedCastToUnsigned(byte[] a, byte[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       int temp = ((a[i] + 1) & 0xff) * ((b[i] + 1) & 0xff);
@@ -457,9 +457,9 @@
 
   // Cases when result of Mul is type-converted are not supported.
 
-  /// CHECK-START: int other.TestByte.testDotProdSimpleCastedToSignedByte(byte[], byte[]) loop_optimization (after)
+  /// CHECK-START: int other.TestByte.testDotProdSimpleCastToSignedByte(byte[], byte[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleCastedToSignedByte(byte[] a, byte[] b) {
+  public static final int testDotProdSimpleCastToSignedByte(byte[] a, byte[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       byte temp = (byte)(a[i] * b[i]);
@@ -468,9 +468,9 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestByte.testDotProdSimpleCastedToUnsignedByte(byte[], byte[]) loop_optimization (after)
+  /// CHECK-START: int other.TestByte.testDotProdSimpleCastToUnsignedByte(byte[], byte[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleCastedToUnsignedByte(byte[] a, byte[] b) {
+  public static final int testDotProdSimpleCastToUnsignedByte(byte[] a, byte[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       s += (a[i] * b[i]) & 0xff;
@@ -478,9 +478,9 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestByte.testDotProdSimpleUnsignedCastedToSignedByte(byte[], byte[]) loop_optimization (after)
+  /// CHECK-START: int other.TestByte.testDotProdSimpleUnsignedCastToSignedByte(byte[], byte[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleUnsignedCastedToSignedByte(byte[] a, byte[] b) {
+  public static final int testDotProdSimpleUnsignedCastToSignedByte(byte[] a, byte[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       byte temp = (byte)((a[i] & 0xff) * (b[i] & 0xff));
@@ -489,9 +489,9 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestByte.testDotProdSimpleUnsignedCastedToUnsignedByte(byte[], byte[]) loop_optimization (after)
+  /// CHECK-START: int other.TestByte.testDotProdSimpleUnsignedCastToUnsignedByte(byte[], byte[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleUnsignedCastedToUnsignedByte(byte[] a, byte[] b) {
+  public static final int testDotProdSimpleUnsignedCastToUnsignedByte(byte[] a, byte[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       s += ((a[i] & 0xff) * (b[i] & 0xff)) & 0xff;
@@ -499,9 +499,9 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestByte.testDotProdSimpleCastedToShort(byte[], byte[]) loop_optimization (after)
+  /// CHECK-START: int other.TestByte.testDotProdSimpleCastToShort(byte[], byte[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleCastedToShort(byte[] a, byte[] b) {
+  public static final int testDotProdSimpleCastToShort(byte[] a, byte[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       short temp = (short)(a[i] * b[i]);
@@ -510,9 +510,9 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestByte.testDotProdSimpleCastedToChar(byte[], byte[]) loop_optimization (after)
+  /// CHECK-START: int other.TestByte.testDotProdSimpleCastToChar(byte[], byte[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleCastedToChar(byte[] a, byte[] b) {
+  public static final int testDotProdSimpleCastToChar(byte[] a, byte[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       char temp = (char)(a[i] * b[i]);
@@ -521,9 +521,9 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestByte.testDotProdSimpleUnsignedCastedToShort(byte[], byte[]) loop_optimization (after)
+  /// CHECK-START: int other.TestByte.testDotProdSimpleUnsignedCastToShort(byte[], byte[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleUnsignedCastedToShort(byte[] a, byte[] b) {
+  public static final int testDotProdSimpleUnsignedCastToShort(byte[] a, byte[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       short temp = (short)((a[i] & 0xff) * (b[i] & 0xff));
@@ -532,9 +532,9 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestByte.testDotProdSimpleUnsignedCastedToChar(byte[], byte[]) loop_optimization (after)
+  /// CHECK-START: int other.TestByte.testDotProdSimpleUnsignedCastToChar(byte[], byte[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleUnsignedCastedToChar(byte[] a, byte[] b) {
+  public static final int testDotProdSimpleUnsignedCastToChar(byte[] a, byte[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       char temp = (char)((a[i] & 0xff) * (b[i] & 0xff));
@@ -543,9 +543,9 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestByte.testDotProdSimpleUnsignedCastedToLong(byte[], byte[]) loop_optimization (after)
+  /// CHECK-START: int other.TestByte.testDotProdSimpleUnsignedCastToLong(byte[], byte[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleUnsignedCastedToLong(byte[] a, byte[] b) {
+  public static final int testDotProdSimpleUnsignedCastToLong(byte[] a, byte[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       long temp = (long)((a[i] & 0xff) * (b[i] & 0xff));
@@ -576,22 +576,22 @@
     expectEquals(results[1], testDotProdComplex(b1, b2));
     expectEquals(results[2], testDotProdSimpleUnsigned(b1, b2));
     expectEquals(results[3], testDotProdComplexUnsigned(b1, b2));
-    expectEquals(results[4], testDotProdComplexUnsignedCastedToSigned(b1, b2));
-    expectEquals(results[5], testDotProdComplexSignedCastedToUnsigned(b1, b2));
+    expectEquals(results[4], testDotProdComplexUnsignedCastToSigned(b1, b2));
+    expectEquals(results[5], testDotProdComplexSignedCastToUnsigned(b1, b2));
     expectEquals(results[6], testDotProdSignedWidening(b1, b2));
     expectEquals(results[7], testDotProdParamSigned(-128, b2));
     expectEquals(results[8], testDotProdParamUnsigned(-128, b2));
     expectEquals(results[9], testDotProdIntParam(-128, b2));
     expectEquals(results[10], testDotProdSignedToChar(b1, b2));
-    expectEquals(results[11], testDotProdSimpleCastedToSignedByte(b1, b2));
-    expectEquals(results[12], testDotProdSimpleCastedToUnsignedByte(b1, b2));
-    expectEquals(results[13], testDotProdSimpleUnsignedCastedToSignedByte(b1, b2));
-    expectEquals(results[14], testDotProdSimpleUnsignedCastedToUnsignedByte(b1, b2));
-    expectEquals(results[15], testDotProdSimpleCastedToShort(b1, b2));
-    expectEquals(results[16], testDotProdSimpleCastedToChar(b1, b2));
-    expectEquals(results[17], testDotProdSimpleUnsignedCastedToShort(b1, b2));
-    expectEquals(results[18], testDotProdSimpleUnsignedCastedToChar(b1, b2));
-    expectEquals(results[19], testDotProdSimpleUnsignedCastedToLong(b1, b2));
+    expectEquals(results[11], testDotProdSimpleCastToSignedByte(b1, b2));
+    expectEquals(results[12], testDotProdSimpleCastToUnsignedByte(b1, b2));
+    expectEquals(results[13], testDotProdSimpleUnsignedCastToSignedByte(b1, b2));
+    expectEquals(results[14], testDotProdSimpleUnsignedCastToUnsignedByte(b1, b2));
+    expectEquals(results[15], testDotProdSimpleCastToShort(b1, b2));
+    expectEquals(results[16], testDotProdSimpleCastToChar(b1, b2));
+    expectEquals(results[17], testDotProdSimpleUnsignedCastToShort(b1, b2));
+    expectEquals(results[18], testDotProdSimpleUnsignedCastToChar(b1, b2));
+    expectEquals(results[19], testDotProdSimpleUnsignedCastToLong(b1, b2));
     expectEquals(results[20], testDotProdUnsignedSigned(b1, b2));
   }
 
diff --git a/test/684-checker-simd-dotprod/src/other/TestCharShort.java b/test/684-checker-simd-dotprod/src/other/TestCharShort.java
index 07a7960..cd07649 100644
--- a/test/684-checker-simd-dotprod/src/other/TestCharShort.java
+++ b/test/684-checker-simd-dotprod/src/other/TestCharShort.java
@@ -209,7 +209,7 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestCharShort.testDotProdComplexUnsignedCastedToSigned(char[], char[]) loop_optimization (before)
+  /// CHECK-START: int other.TestCharShort.testDotProdComplexUnsignedCastToSigned(char[], char[]) loop_optimization (before)
   /// CHECK-DAG: <<Const0:i\d+>>  IntConstant 0                                         loop:none
   /// CHECK-DAG: <<Const1:i\d+>>  IntConstant 1                                         loop:none
   /// CHECK-DAG: <<Phi1:i\d+>>    Phi [<<Const0>>,{{i\d+}}]                             loop:<<Loop:B\d+>> outer_loop:none
@@ -224,7 +224,7 @@
   /// CHECK-DAG:                  Add [<<Phi2>>,<<Mul>>]                                loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:                  Add [<<Phi1>>,<<Const1>>]                             loop:<<Loop>>      outer_loop:none
 
-  /// CHECK-START-{ARM64}: int other.TestCharShort.testDotProdComplexUnsignedCastedToSigned(char[], char[]) loop_optimization (after)
+  /// CHECK-START-{ARM64}: int other.TestCharShort.testDotProdComplexUnsignedCastToSigned(char[], char[]) loop_optimization (after)
   /// CHECK-DAG: <<Const0:i\d+>>  IntConstant 0                                         loop:none
   /// CHECK-DAG: <<Const1:i\d+>>  IntConstant 1                                         loop:none
   /// CHECK-IF:     hasIsaFeature("sve")
@@ -250,7 +250,7 @@
   ///     CHECK-DAG:                  VecExtractScalar [<<Reduce>>]                         loop:none
   //
   /// CHECK-FI:
-  public static final int testDotProdComplexUnsignedCastedToSigned(char[] a, char[] b) {
+  public static final int testDotProdComplexUnsignedCastToSigned(char[] a, char[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       int temp = ((short)(a[i] + 1)) * ((short)(b[i] + 1));
@@ -259,7 +259,7 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestCharShort.testDotProdComplexSignedCastedToUnsigned(short[], short[]) loop_optimization (before)
+  /// CHECK-START: int other.TestCharShort.testDotProdComplexSignedCastToUnsigned(short[], short[]) loop_optimization (before)
   /// CHECK-DAG: <<Const0:i\d+>>  IntConstant 0                                         loop:none
   /// CHECK-DAG: <<Const1:i\d+>>  IntConstant 1                                         loop:none
   /// CHECK-DAG: <<Phi1:i\d+>>    Phi [<<Const0>>,{{i\d+}}]                             loop:<<Loop:B\d+>> outer_loop:none
@@ -274,7 +274,7 @@
   /// CHECK-DAG:                  Add [<<Phi2>>,<<Mul>>]                                loop:<<Loop>>      outer_loop:none
   /// CHECK-DAG:                  Add [<<Phi1>>,<<Const1>>]                             loop:<<Loop>>      outer_loop:none
 
-  /// CHECK-START-{ARM64}: int other.TestCharShort.testDotProdComplexSignedCastedToUnsigned(short[], short[]) loop_optimization (after)
+  /// CHECK-START-{ARM64}: int other.TestCharShort.testDotProdComplexSignedCastToUnsigned(short[], short[]) loop_optimization (after)
   /// CHECK-DAG: <<Const0:i\d+>>  IntConstant 0                                         loop:none
   /// CHECK-DAG: <<Const1:i\d+>>  IntConstant 1                                         loop:none
   /// CHECK-IF:     hasIsaFeature("sve")
@@ -300,7 +300,7 @@
   ///     CHECK-DAG:                  VecExtractScalar [<<Reduce>>]                         loop:none
   //
   /// CHECK-FI:
-  public static final int testDotProdComplexSignedCastedToUnsigned(short[] a, short[] b) {
+  public static final int testDotProdComplexSignedCastToUnsigned(short[] a, short[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       int temp = ((char)(a[i] + 1)) * ((char)(b[i] + 1));
@@ -402,9 +402,9 @@
 
   // Cases when result of Mul is type-converted are not supported.
 
-  /// CHECK-START: int other.TestCharShort.testDotProdSimpleMulCastedToSigned(short[], short[]) loop_optimization (after)
+  /// CHECK-START: int other.TestCharShort.testDotProdSimpleMulCastToSigned(short[], short[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd type:Uint16
-  public static final int testDotProdSimpleMulCastedToSigned(short[] a, short[] b) {
+  public static final int testDotProdSimpleMulCastToSigned(short[] a, short[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       short temp = (short)(a[i] * b[i]);
@@ -413,10 +413,9 @@
     return s - 1;
   }
 
-
-  /// CHECK-START: int other.TestCharShort.testDotProdSimpleMulCastedToUnsigned(short[], short[]) loop_optimization (after)
+  /// CHECK-START: int other.TestCharShort.testDotProdSimpleMulCastToUnsigned(short[], short[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleMulCastedToUnsigned(short[] a, short[] b) {
+  public static final int testDotProdSimpleMulCastToUnsigned(short[] a, short[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       char temp = (char)(a[i] * b[i]);
@@ -425,9 +424,9 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestCharShort.testDotProdSimpleUnsignedMulCastedToSigned(char[], char[]) loop_optimization (after)
+  /// CHECK-START: int other.TestCharShort.testDotProdSimpleUnsignedMulCastToSigned(char[], char[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleUnsignedMulCastedToSigned(char[] a, char[] b) {
+  public static final int testDotProdSimpleUnsignedMulCastToSigned(char[] a, char[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       short temp = (short)(a[i] * b[i]);
@@ -436,9 +435,9 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestCharShort.testDotProdSimpleUnsignedMulCastedToUnsigned(char[], char[]) loop_optimization (after)
+  /// CHECK-START: int other.TestCharShort.testDotProdSimpleUnsignedMulCastToUnsigned(char[], char[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleUnsignedMulCastedToUnsigned(char[] a, char[] b) {
+  public static final int testDotProdSimpleUnsignedMulCastToUnsigned(char[] a, char[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       char temp = (char)(a[i] * b[i]);
@@ -447,9 +446,9 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestCharShort.testDotProdSimpleCastedToShort(short[], short[]) loop_optimization (after)
+  /// CHECK-START: int other.TestCharShort.testDotProdSimpleCastToShort(short[], short[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleCastedToShort(short[] a, short[] b) {
+  public static final int testDotProdSimpleCastToShort(short[] a, short[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       short temp = (short)(a[i] * b[i]);
@@ -458,9 +457,9 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestCharShort.testDotProdSimpleCastedToChar(short[], short[]) loop_optimization (after)
+  /// CHECK-START: int other.TestCharShort.testDotProdSimpleCastToChar(short[], short[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleCastedToChar(short[] a, short[] b) {
+  public static final int testDotProdSimpleCastToChar(short[] a, short[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       char temp = (char)(a[i] * b[i]);
@@ -469,9 +468,9 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestCharShort.testDotProdSimpleUnsignedCastedToShort(char[], char[]) loop_optimization (after)
+  /// CHECK-START: int other.TestCharShort.testDotProdSimpleUnsignedCastToShort(char[], char[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleUnsignedCastedToShort(char[] a, char[] b) {
+  public static final int testDotProdSimpleUnsignedCastToShort(char[] a, char[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       short temp = (short)(a[i] * b[i]);
@@ -480,9 +479,9 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestCharShort.testDotProdSimpleUnsignedCastedToChar(char[], char[]) loop_optimization (after)
+  /// CHECK-START: int other.TestCharShort.testDotProdSimpleUnsignedCastToChar(char[], char[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleUnsignedCastedToChar(char[] a, char[] b) {
+  public static final int testDotProdSimpleUnsignedCastToChar(char[] a, char[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       char temp = (char)(a[i] * b[i]);
@@ -491,9 +490,9 @@
     return s - 1;
   }
 
-  /// CHECK-START: int other.TestCharShort.testDotProdSimpleUnsignedCastedToLong(char[], char[]) loop_optimization (after)
+  /// CHECK-START: int other.TestCharShort.testDotProdSimpleUnsignedCastToLong(char[], char[]) loop_optimization (after)
   /// CHECK-NOT:                  VecDotProd
-  public static final int testDotProdSimpleUnsignedCastedToLong(char[] a, char[] b) {
+  public static final int testDotProdSimpleUnsignedCastToLong(char[] a, char[] b) {
     int s = 1;
     for (int i = 0; i < b.length; i++) {
       long temp = (long)(a[i] * b[i]);
@@ -570,22 +569,22 @@
     expectEquals(results[1], testDotProdComplex(s1, s2));
     expectEquals(results[2], testDotProdSimpleUnsigned(c1, c2));
     expectEquals(results[3], testDotProdComplexUnsigned(c1, c2));
-    expectEquals(results[4], testDotProdComplexUnsignedCastedToSigned(c1, c2));
-    expectEquals(results[5], testDotProdComplexSignedCastedToUnsigned(s1, s2));
+    expectEquals(results[4], testDotProdComplexUnsignedCastToSigned(c1, c2));
+    expectEquals(results[5], testDotProdComplexSignedCastToUnsigned(s1, s2));
     expectEquals(results[6], testDotProdSignedToInt(s1, s2));
     expectEquals(results[7], testDotProdParamSigned(-32768, s2));
     expectEquals(results[8], testDotProdParamUnsigned(-32768, c2));
     expectEquals(results[9], testDotProdIntParam(-32768, s2));
     expectEquals(results[10], testDotProdSignedToChar(s1, s2));
-    expectEquals(results[11], testDotProdSimpleMulCastedToSigned(s1, s2));
-    expectEquals(results[12], testDotProdSimpleMulCastedToUnsigned(s1, s2));
-    expectEquals(results[13], testDotProdSimpleUnsignedMulCastedToSigned(c1, c2));
-    expectEquals(results[14], testDotProdSimpleUnsignedMulCastedToUnsigned(c1, c2));
-    expectEquals(results[15], testDotProdSimpleCastedToShort(s1, s2));
-    expectEquals(results[16], testDotProdSimpleCastedToChar(s1, s2));
-    expectEquals(results[17], testDotProdSimpleUnsignedCastedToShort(c1, c2));
-    expectEquals(results[18], testDotProdSimpleUnsignedCastedToChar(c1, c2));
-    expectEquals(results[19], testDotProdSimpleUnsignedCastedToLong(c1, c2));
+    expectEquals(results[11], testDotProdSimpleMulCastToSigned(s1, s2));
+    expectEquals(results[12], testDotProdSimpleMulCastToUnsigned(s1, s2));
+    expectEquals(results[13], testDotProdSimpleUnsignedMulCastToSigned(c1, c2));
+    expectEquals(results[14], testDotProdSimpleUnsignedMulCastToUnsigned(c1, c2));
+    expectEquals(results[15], testDotProdSimpleCastToShort(s1, s2));
+    expectEquals(results[16], testDotProdSimpleCastToChar(s1, s2));
+    expectEquals(results[17], testDotProdSimpleUnsignedCastToShort(c1, c2));
+    expectEquals(results[18], testDotProdSimpleUnsignedCastToChar(c1, c2));
+    expectEquals(results[19], testDotProdSimpleUnsignedCastToLong(c1, c2));
     expectEquals(results[20], testDotProdSignedNarrowerSigned(s1, s2));
     expectEquals(results[21], testDotProdSignedNarrowerUnsigned(s1, s2));
     expectEquals(results[22], testDotProdUnsignedNarrowerSigned(c1, c2));
diff --git a/test/685-deoptimizeable/src/Main.java b/test/685-deoptimizeable/src/Main.java
index 41dcfd1..674b2fc 100644
--- a/test/685-deoptimizeable/src/Main.java
+++ b/test/685-deoptimizeable/src/Main.java
@@ -74,6 +74,8 @@
           disableStackFrameAsserts();
         }
 
+        // Just declare a new int array so that the int arrays are resolved properly when JITing.
+        int[] tmp = new int[3];
         ensureAllJitCompiled();
 
         final HashMap<SampleObject, Long> map = new HashMap<SampleObject, Long>();
diff --git a/test/692-vdex-inmem-loader/vdex_inmem_loader.cc b/test/692-vdex-inmem-loader/vdex_inmem_loader.cc
index a478f26..8152435 100644
--- a/test/692-vdex-inmem-loader/vdex_inmem_loader.cc
+++ b/test/692-vdex-inmem-loader/vdex_inmem_loader.cc
@@ -18,8 +18,8 @@
 #include "class_loader_utils.h"
 #include "jni.h"
 #include "nativehelper/scoped_utf_chars.h"
-#include "oat_file_assistant.h"
-#include "oat_file_manager.h"
+#include "oat/oat_file_assistant.h"
+#include "oat/oat_file_manager.h"
 #include "scoped_thread_state_change-inl.h"
 #include "thread.h"
 
diff --git a/test/708-jit-cache-churn/jit.cc b/test/708-jit-cache-churn/jit.cc
deleted file mode 100644
index 1b80eb3..0000000
--- a/test/708-jit-cache-churn/jit.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "jni.h"
-
-#include "art_method.h"
-#include "jit/jit.h"
-#include "jit/jit_code_cache.h"
-#include "jni/jni_internal.h"
-#include "mirror/class.h"
-#include "runtime.h"
-#include "scoped_thread_state_change-inl.h"
-#include "thread_list.h"
-
-namespace art {
-
-extern "C" JNIEXPORT
-jboolean
-Java_JitCacheChurnTest_removeJitCompiledMethod(JNIEnv* env,
-                                               jclass,
-                                               jobject javaMethod,
-                                               jboolean releaseMemory) {
-  if (!Runtime::Current()->UseJitCompilation()) {
-    return JNI_FALSE;
-  }
-
-  jit::Jit* jit = Runtime::Current()->GetJit();
-  jit->WaitForCompilationToFinish(Thread::Current());
-
-  ScopedObjectAccess soa(env);
-  ArtMethod* method = ArtMethod::FromReflectedMethod(soa, javaMethod);
-
-  jit::JitCodeCache* code_cache = jit->GetCodeCache();
-
-  // Drop the shared mutator lock
-  ScopedThreadSuspension selfSuspension(Thread::Current(), art::ThreadState::kNative);
-  // Get exclusive mutator lock with suspend all.
-  ScopedSuspendAll suspend("Removing JIT compiled method", /*long_suspend*/true);
-  bool removed = code_cache->RemoveMethod(method, static_cast<bool>(releaseMemory));
-  return removed ? JNI_TRUE : JNI_FALSE;
-}
-
-}  // namespace art
diff --git a/test/708-jit-cache-churn/src/JitCacheChurnTest.java b/test/708-jit-cache-churn/src/JitCacheChurnTest.java
index abc5f35..8902d8d 100644
--- a/test/708-jit-cache-churn/src/JitCacheChurnTest.java
+++ b/test/708-jit-cache-churn/src/JitCacheChurnTest.java
@@ -244,7 +244,7 @@
       System.err.println(e);
       System.exit(-1);
     }
-    removeJitCompiledMethod(method, false);
+    Main.removeJitCompiledMethod(method, false);
   }
 
   private void removeJittedMethods(int mask) {
@@ -274,6 +274,4 @@
       concurrentExecution.shutdown();
     }
   }
-
-  private static native void removeJitCompiledMethod(Method method, boolean releaseMemory);
 }
diff --git a/test/708-jit-cache-churn/src/Main.java b/test/708-jit-cache-churn/src/Main.java
index 0595aae..4d11dae 100644
--- a/test/708-jit-cache-churn/src/Main.java
+++ b/test/708-jit-cache-churn/src/Main.java
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+import java.lang.reflect.Method;
+
 public class Main {
 
   public static void main(String[] args) throws Exception {
@@ -28,4 +30,5 @@
   static native boolean hasJit();
 
   static native void ensureJitCompiled(Class<?> klass, String methodName);
+  static native void removeJitCompiledMethod(Method method, boolean releaseMemory);
 }
diff --git a/test/712-varhandle-invocations/expected-stdout.txt b/test/712-varhandle-invocations/expected-stdout.txt
index 1ff1b30..1c3e0a0 100644
--- a/test/712-varhandle-invocations/expected-stdout.txt
+++ b/test/712-varhandle-invocations/expected-stdout.txt
@@ -1424,6 +1424,68 @@
 ByteArrayViewLEGetAndBitwiseXorAcquireLong...OK
 ByteArrayViewLEGetAndBitwiseXorAcquireFloat...OK
 ByteArrayViewLEGetAndBitwiseXorAcquireDouble...OK
+NarrowByteArrayViewLEGetShort...OK
+NarrowByteArrayViewLEGetChar...OK
+NarrowByteArrayViewLESetShort...OK
+NarrowByteArrayViewLESetChar...OK
+NarrowByteArrayViewLEGetVolatileShort...OK
+NarrowByteArrayViewLEGetVolatileChar...OK
+NarrowByteArrayViewLESetVolatileShort...OK
+NarrowByteArrayViewLESetVolatileChar...OK
+NarrowByteArrayViewLEGetAcquireShort...OK
+NarrowByteArrayViewLEGetAcquireChar...OK
+NarrowByteArrayViewLESetReleaseShort...OK
+NarrowByteArrayViewLESetReleaseChar...OK
+NarrowByteArrayViewLEGetOpaqueShort...OK
+NarrowByteArrayViewLEGetOpaqueChar...OK
+NarrowByteArrayViewLESetOpaqueShort...OK
+NarrowByteArrayViewLESetOpaqueChar...OK
+NarrowByteArrayViewLECompareAndSetShort...OK
+NarrowByteArrayViewLECompareAndSetChar...OK
+NarrowByteArrayViewLECompareAndExchangeShort...OK
+NarrowByteArrayViewLECompareAndExchangeChar...OK
+NarrowByteArrayViewLECompareAndExchangeAcquireShort...OK
+NarrowByteArrayViewLECompareAndExchangeAcquireChar...OK
+NarrowByteArrayViewLECompareAndExchangeReleaseShort...OK
+NarrowByteArrayViewLECompareAndExchangeReleaseChar...OK
+NarrowByteArrayViewLEWeakCompareAndSetPlainShort...OK
+NarrowByteArrayViewLEWeakCompareAndSetPlainChar...OK
+NarrowByteArrayViewLEWeakCompareAndSetShort...OK
+NarrowByteArrayViewLEWeakCompareAndSetChar...OK
+NarrowByteArrayViewLEWeakCompareAndSetAcquireShort...OK
+NarrowByteArrayViewLEWeakCompareAndSetAcquireChar...OK
+NarrowByteArrayViewLEWeakCompareAndSetReleaseShort...OK
+NarrowByteArrayViewLEWeakCompareAndSetReleaseChar...OK
+NarrowByteArrayViewLEGetAndSetShort...OK
+NarrowByteArrayViewLEGetAndSetChar...OK
+NarrowByteArrayViewLEGetAndSetAcquireShort...OK
+NarrowByteArrayViewLEGetAndSetAcquireChar...OK
+NarrowByteArrayViewLEGetAndSetReleaseShort...OK
+NarrowByteArrayViewLEGetAndSetReleaseChar...OK
+NarrowByteArrayViewLEGetAndAddShort...OK
+NarrowByteArrayViewLEGetAndAddChar...OK
+NarrowByteArrayViewLEGetAndAddAcquireShort...OK
+NarrowByteArrayViewLEGetAndAddAcquireChar...OK
+NarrowByteArrayViewLEGetAndAddReleaseShort...OK
+NarrowByteArrayViewLEGetAndAddReleaseChar...OK
+NarrowByteArrayViewLEGetAndBitwiseOrShort...OK
+NarrowByteArrayViewLEGetAndBitwiseOrChar...OK
+NarrowByteArrayViewLEGetAndBitwiseOrReleaseShort...OK
+NarrowByteArrayViewLEGetAndBitwiseOrReleaseChar...OK
+NarrowByteArrayViewLEGetAndBitwiseOrAcquireShort...OK
+NarrowByteArrayViewLEGetAndBitwiseOrAcquireChar...OK
+NarrowByteArrayViewLEGetAndBitwiseAndShort...OK
+NarrowByteArrayViewLEGetAndBitwiseAndChar...OK
+NarrowByteArrayViewLEGetAndBitwiseAndReleaseShort...OK
+NarrowByteArrayViewLEGetAndBitwiseAndReleaseChar...OK
+NarrowByteArrayViewLEGetAndBitwiseAndAcquireShort...OK
+NarrowByteArrayViewLEGetAndBitwiseAndAcquireChar...OK
+NarrowByteArrayViewLEGetAndBitwiseXorShort...OK
+NarrowByteArrayViewLEGetAndBitwiseXorChar...OK
+NarrowByteArrayViewLEGetAndBitwiseXorReleaseShort...OK
+NarrowByteArrayViewLEGetAndBitwiseXorReleaseChar...OK
+NarrowByteArrayViewLEGetAndBitwiseXorAcquireShort...OK
+NarrowByteArrayViewLEGetAndBitwiseXorAcquireChar...OK
 ByteArrayViewBEGetShort...OK
 ByteArrayViewBEGetChar...OK
 ByteArrayViewBEGetInt...OK
@@ -1610,6 +1672,68 @@
 ByteArrayViewBEGetAndBitwiseXorAcquireLong...OK
 ByteArrayViewBEGetAndBitwiseXorAcquireFloat...OK
 ByteArrayViewBEGetAndBitwiseXorAcquireDouble...OK
+NarrowByteArrayViewBEGetShort...OK
+NarrowByteArrayViewBEGetChar...OK
+NarrowByteArrayViewBESetShort...OK
+NarrowByteArrayViewBESetChar...OK
+NarrowByteArrayViewBEGetVolatileShort...OK
+NarrowByteArrayViewBEGetVolatileChar...OK
+NarrowByteArrayViewBESetVolatileShort...OK
+NarrowByteArrayViewBESetVolatileChar...OK
+NarrowByteArrayViewBEGetAcquireShort...OK
+NarrowByteArrayViewBEGetAcquireChar...OK
+NarrowByteArrayViewBESetReleaseShort...OK
+NarrowByteArrayViewBESetReleaseChar...OK
+NarrowByteArrayViewBEGetOpaqueShort...OK
+NarrowByteArrayViewBEGetOpaqueChar...OK
+NarrowByteArrayViewBESetOpaqueShort...OK
+NarrowByteArrayViewBESetOpaqueChar...OK
+NarrowByteArrayViewBECompareAndSetShort...OK
+NarrowByteArrayViewBECompareAndSetChar...OK
+NarrowByteArrayViewBECompareAndExchangeShort...OK
+NarrowByteArrayViewBECompareAndExchangeChar...OK
+NarrowByteArrayViewBECompareAndExchangeAcquireShort...OK
+NarrowByteArrayViewBECompareAndExchangeAcquireChar...OK
+NarrowByteArrayViewBECompareAndExchangeReleaseShort...OK
+NarrowByteArrayViewBECompareAndExchangeReleaseChar...OK
+NarrowByteArrayViewBEWeakCompareAndSetPlainShort...OK
+NarrowByteArrayViewBEWeakCompareAndSetPlainChar...OK
+NarrowByteArrayViewBEWeakCompareAndSetShort...OK
+NarrowByteArrayViewBEWeakCompareAndSetChar...OK
+NarrowByteArrayViewBEWeakCompareAndSetAcquireShort...OK
+NarrowByteArrayViewBEWeakCompareAndSetAcquireChar...OK
+NarrowByteArrayViewBEWeakCompareAndSetReleaseShort...OK
+NarrowByteArrayViewBEWeakCompareAndSetReleaseChar...OK
+NarrowByteArrayViewBEGetAndSetShort...OK
+NarrowByteArrayViewBEGetAndSetChar...OK
+NarrowByteArrayViewBEGetAndSetAcquireShort...OK
+NarrowByteArrayViewBEGetAndSetAcquireChar...OK
+NarrowByteArrayViewBEGetAndSetReleaseShort...OK
+NarrowByteArrayViewBEGetAndSetReleaseChar...OK
+NarrowByteArrayViewBEGetAndAddShort...OK
+NarrowByteArrayViewBEGetAndAddChar...OK
+NarrowByteArrayViewBEGetAndAddAcquireShort...OK
+NarrowByteArrayViewBEGetAndAddAcquireChar...OK
+NarrowByteArrayViewBEGetAndAddReleaseShort...OK
+NarrowByteArrayViewBEGetAndAddReleaseChar...OK
+NarrowByteArrayViewBEGetAndBitwiseOrShort...OK
+NarrowByteArrayViewBEGetAndBitwiseOrChar...OK
+NarrowByteArrayViewBEGetAndBitwiseOrReleaseShort...OK
+NarrowByteArrayViewBEGetAndBitwiseOrReleaseChar...OK
+NarrowByteArrayViewBEGetAndBitwiseOrAcquireShort...OK
+NarrowByteArrayViewBEGetAndBitwiseOrAcquireChar...OK
+NarrowByteArrayViewBEGetAndBitwiseAndShort...OK
+NarrowByteArrayViewBEGetAndBitwiseAndChar...OK
+NarrowByteArrayViewBEGetAndBitwiseAndReleaseShort...OK
+NarrowByteArrayViewBEGetAndBitwiseAndReleaseChar...OK
+NarrowByteArrayViewBEGetAndBitwiseAndAcquireShort...OK
+NarrowByteArrayViewBEGetAndBitwiseAndAcquireChar...OK
+NarrowByteArrayViewBEGetAndBitwiseXorShort...OK
+NarrowByteArrayViewBEGetAndBitwiseXorChar...OK
+NarrowByteArrayViewBEGetAndBitwiseXorReleaseShort...OK
+NarrowByteArrayViewBEGetAndBitwiseXorReleaseChar...OK
+NarrowByteArrayViewBEGetAndBitwiseXorAcquireShort...OK
+NarrowByteArrayViewBEGetAndBitwiseXorAcquireChar...OK
 DirectByteBufferViewLEGetShort...OK
 DirectByteBufferViewLEGetChar...OK
 DirectByteBufferViewLEGetInt...OK
@@ -1796,6 +1920,68 @@
 DirectByteBufferViewLEGetAndBitwiseXorAcquireLong...OK
 DirectByteBufferViewLEGetAndBitwiseXorAcquireFloat...OK
 DirectByteBufferViewLEGetAndBitwiseXorAcquireDouble...OK
+NarrowDirectByteBufferViewLEGetShort...OK
+NarrowDirectByteBufferViewLEGetChar...OK
+NarrowDirectByteBufferViewLESetShort...OK
+NarrowDirectByteBufferViewLESetChar...OK
+NarrowDirectByteBufferViewLEGetVolatileShort...OK
+NarrowDirectByteBufferViewLEGetVolatileChar...OK
+NarrowDirectByteBufferViewLESetVolatileShort...OK
+NarrowDirectByteBufferViewLESetVolatileChar...OK
+NarrowDirectByteBufferViewLEGetAcquireShort...OK
+NarrowDirectByteBufferViewLEGetAcquireChar...OK
+NarrowDirectByteBufferViewLESetReleaseShort...OK
+NarrowDirectByteBufferViewLESetReleaseChar...OK
+NarrowDirectByteBufferViewLEGetOpaqueShort...OK
+NarrowDirectByteBufferViewLEGetOpaqueChar...OK
+NarrowDirectByteBufferViewLESetOpaqueShort...OK
+NarrowDirectByteBufferViewLESetOpaqueChar...OK
+NarrowDirectByteBufferViewLECompareAndSetShort...OK
+NarrowDirectByteBufferViewLECompareAndSetChar...OK
+NarrowDirectByteBufferViewLECompareAndExchangeShort...OK
+NarrowDirectByteBufferViewLECompareAndExchangeChar...OK
+NarrowDirectByteBufferViewLECompareAndExchangeAcquireShort...OK
+NarrowDirectByteBufferViewLECompareAndExchangeAcquireChar...OK
+NarrowDirectByteBufferViewLECompareAndExchangeReleaseShort...OK
+NarrowDirectByteBufferViewLECompareAndExchangeReleaseChar...OK
+NarrowDirectByteBufferViewLEWeakCompareAndSetPlainShort...OK
+NarrowDirectByteBufferViewLEWeakCompareAndSetPlainChar...OK
+NarrowDirectByteBufferViewLEWeakCompareAndSetShort...OK
+NarrowDirectByteBufferViewLEWeakCompareAndSetChar...OK
+NarrowDirectByteBufferViewLEWeakCompareAndSetAcquireShort...OK
+NarrowDirectByteBufferViewLEWeakCompareAndSetAcquireChar...OK
+NarrowDirectByteBufferViewLEWeakCompareAndSetReleaseShort...OK
+NarrowDirectByteBufferViewLEWeakCompareAndSetReleaseChar...OK
+NarrowDirectByteBufferViewLEGetAndSetShort...OK
+NarrowDirectByteBufferViewLEGetAndSetChar...OK
+NarrowDirectByteBufferViewLEGetAndSetAcquireShort...OK
+NarrowDirectByteBufferViewLEGetAndSetAcquireChar...OK
+NarrowDirectByteBufferViewLEGetAndSetReleaseShort...OK
+NarrowDirectByteBufferViewLEGetAndSetReleaseChar...OK
+NarrowDirectByteBufferViewLEGetAndAddShort...OK
+NarrowDirectByteBufferViewLEGetAndAddChar...OK
+NarrowDirectByteBufferViewLEGetAndAddAcquireShort...OK
+NarrowDirectByteBufferViewLEGetAndAddAcquireChar...OK
+NarrowDirectByteBufferViewLEGetAndAddReleaseShort...OK
+NarrowDirectByteBufferViewLEGetAndAddReleaseChar...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseOrShort...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseOrChar...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseOrReleaseShort...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseOrReleaseChar...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseOrAcquireShort...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseOrAcquireChar...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseAndShort...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseAndChar...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseAndReleaseShort...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseAndReleaseChar...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseAndAcquireShort...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseAndAcquireChar...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseXorShort...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseXorChar...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseXorReleaseShort...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseXorReleaseChar...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseXorAcquireShort...OK
+NarrowDirectByteBufferViewLEGetAndBitwiseXorAcquireChar...OK
 DirectByteBufferViewBEGetShort...OK
 DirectByteBufferViewBEGetChar...OK
 DirectByteBufferViewBEGetInt...OK
@@ -1982,6 +2168,68 @@
 DirectByteBufferViewBEGetAndBitwiseXorAcquireLong...OK
 DirectByteBufferViewBEGetAndBitwiseXorAcquireFloat...OK
 DirectByteBufferViewBEGetAndBitwiseXorAcquireDouble...OK
+NarrowDirectByteBufferViewBEGetShort...OK
+NarrowDirectByteBufferViewBEGetChar...OK
+NarrowDirectByteBufferViewBESetShort...OK
+NarrowDirectByteBufferViewBESetChar...OK
+NarrowDirectByteBufferViewBEGetVolatileShort...OK
+NarrowDirectByteBufferViewBEGetVolatileChar...OK
+NarrowDirectByteBufferViewBESetVolatileShort...OK
+NarrowDirectByteBufferViewBESetVolatileChar...OK
+NarrowDirectByteBufferViewBEGetAcquireShort...OK
+NarrowDirectByteBufferViewBEGetAcquireChar...OK
+NarrowDirectByteBufferViewBESetReleaseShort...OK
+NarrowDirectByteBufferViewBESetReleaseChar...OK
+NarrowDirectByteBufferViewBEGetOpaqueShort...OK
+NarrowDirectByteBufferViewBEGetOpaqueChar...OK
+NarrowDirectByteBufferViewBESetOpaqueShort...OK
+NarrowDirectByteBufferViewBESetOpaqueChar...OK
+NarrowDirectByteBufferViewBECompareAndSetShort...OK
+NarrowDirectByteBufferViewBECompareAndSetChar...OK
+NarrowDirectByteBufferViewBECompareAndExchangeShort...OK
+NarrowDirectByteBufferViewBECompareAndExchangeChar...OK
+NarrowDirectByteBufferViewBECompareAndExchangeAcquireShort...OK
+NarrowDirectByteBufferViewBECompareAndExchangeAcquireChar...OK
+NarrowDirectByteBufferViewBECompareAndExchangeReleaseShort...OK
+NarrowDirectByteBufferViewBECompareAndExchangeReleaseChar...OK
+NarrowDirectByteBufferViewBEWeakCompareAndSetPlainShort...OK
+NarrowDirectByteBufferViewBEWeakCompareAndSetPlainChar...OK
+NarrowDirectByteBufferViewBEWeakCompareAndSetShort...OK
+NarrowDirectByteBufferViewBEWeakCompareAndSetChar...OK
+NarrowDirectByteBufferViewBEWeakCompareAndSetAcquireShort...OK
+NarrowDirectByteBufferViewBEWeakCompareAndSetAcquireChar...OK
+NarrowDirectByteBufferViewBEWeakCompareAndSetReleaseShort...OK
+NarrowDirectByteBufferViewBEWeakCompareAndSetReleaseChar...OK
+NarrowDirectByteBufferViewBEGetAndSetShort...OK
+NarrowDirectByteBufferViewBEGetAndSetChar...OK
+NarrowDirectByteBufferViewBEGetAndSetAcquireShort...OK
+NarrowDirectByteBufferViewBEGetAndSetAcquireChar...OK
+NarrowDirectByteBufferViewBEGetAndSetReleaseShort...OK
+NarrowDirectByteBufferViewBEGetAndSetReleaseChar...OK
+NarrowDirectByteBufferViewBEGetAndAddShort...OK
+NarrowDirectByteBufferViewBEGetAndAddChar...OK
+NarrowDirectByteBufferViewBEGetAndAddAcquireShort...OK
+NarrowDirectByteBufferViewBEGetAndAddAcquireChar...OK
+NarrowDirectByteBufferViewBEGetAndAddReleaseShort...OK
+NarrowDirectByteBufferViewBEGetAndAddReleaseChar...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseOrShort...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseOrChar...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseOrReleaseShort...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseOrReleaseChar...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseOrAcquireShort...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseOrAcquireChar...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseAndShort...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseAndChar...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseAndReleaseShort...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseAndReleaseChar...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseAndAcquireShort...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseAndAcquireChar...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseXorShort...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseXorChar...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseXorReleaseShort...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseXorReleaseChar...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseXorAcquireShort...OK
+NarrowDirectByteBufferViewBEGetAndBitwiseXorAcquireChar...OK
 HeapByteBufferViewLEGetShort...OK
 HeapByteBufferViewLEGetChar...OK
 HeapByteBufferViewLEGetInt...OK
@@ -2168,6 +2416,68 @@
 HeapByteBufferViewLEGetAndBitwiseXorAcquireLong...OK
 HeapByteBufferViewLEGetAndBitwiseXorAcquireFloat...OK
 HeapByteBufferViewLEGetAndBitwiseXorAcquireDouble...OK
+NarrowHeapByteBufferViewLEGetShort...OK
+NarrowHeapByteBufferViewLEGetChar...OK
+NarrowHeapByteBufferViewLESetShort...OK
+NarrowHeapByteBufferViewLESetChar...OK
+NarrowHeapByteBufferViewLEGetVolatileShort...OK
+NarrowHeapByteBufferViewLEGetVolatileChar...OK
+NarrowHeapByteBufferViewLESetVolatileShort...OK
+NarrowHeapByteBufferViewLESetVolatileChar...OK
+NarrowHeapByteBufferViewLEGetAcquireShort...OK
+NarrowHeapByteBufferViewLEGetAcquireChar...OK
+NarrowHeapByteBufferViewLESetReleaseShort...OK
+NarrowHeapByteBufferViewLESetReleaseChar...OK
+NarrowHeapByteBufferViewLEGetOpaqueShort...OK
+NarrowHeapByteBufferViewLEGetOpaqueChar...OK
+NarrowHeapByteBufferViewLESetOpaqueShort...OK
+NarrowHeapByteBufferViewLESetOpaqueChar...OK
+NarrowHeapByteBufferViewLECompareAndSetShort...OK
+NarrowHeapByteBufferViewLECompareAndSetChar...OK
+NarrowHeapByteBufferViewLECompareAndExchangeShort...OK
+NarrowHeapByteBufferViewLECompareAndExchangeChar...OK
+NarrowHeapByteBufferViewLECompareAndExchangeAcquireShort...OK
+NarrowHeapByteBufferViewLECompareAndExchangeAcquireChar...OK
+NarrowHeapByteBufferViewLECompareAndExchangeReleaseShort...OK
+NarrowHeapByteBufferViewLECompareAndExchangeReleaseChar...OK
+NarrowHeapByteBufferViewLEWeakCompareAndSetPlainShort...OK
+NarrowHeapByteBufferViewLEWeakCompareAndSetPlainChar...OK
+NarrowHeapByteBufferViewLEWeakCompareAndSetShort...OK
+NarrowHeapByteBufferViewLEWeakCompareAndSetChar...OK
+NarrowHeapByteBufferViewLEWeakCompareAndSetAcquireShort...OK
+NarrowHeapByteBufferViewLEWeakCompareAndSetAcquireChar...OK
+NarrowHeapByteBufferViewLEWeakCompareAndSetReleaseShort...OK
+NarrowHeapByteBufferViewLEWeakCompareAndSetReleaseChar...OK
+NarrowHeapByteBufferViewLEGetAndSetShort...OK
+NarrowHeapByteBufferViewLEGetAndSetChar...OK
+NarrowHeapByteBufferViewLEGetAndSetAcquireShort...OK
+NarrowHeapByteBufferViewLEGetAndSetAcquireChar...OK
+NarrowHeapByteBufferViewLEGetAndSetReleaseShort...OK
+NarrowHeapByteBufferViewLEGetAndSetReleaseChar...OK
+NarrowHeapByteBufferViewLEGetAndAddShort...OK
+NarrowHeapByteBufferViewLEGetAndAddChar...OK
+NarrowHeapByteBufferViewLEGetAndAddAcquireShort...OK
+NarrowHeapByteBufferViewLEGetAndAddAcquireChar...OK
+NarrowHeapByteBufferViewLEGetAndAddReleaseShort...OK
+NarrowHeapByteBufferViewLEGetAndAddReleaseChar...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseOrShort...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseOrChar...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseOrReleaseShort...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseOrReleaseChar...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseOrAcquireShort...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseOrAcquireChar...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseAndShort...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseAndChar...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseAndReleaseShort...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseAndReleaseChar...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseAndAcquireShort...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseAndAcquireChar...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseXorShort...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseXorChar...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseXorReleaseShort...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseXorReleaseChar...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseXorAcquireShort...OK
+NarrowHeapByteBufferViewLEGetAndBitwiseXorAcquireChar...OK
 HeapByteBufferViewBEGetShort...OK
 HeapByteBufferViewBEGetChar...OK
 HeapByteBufferViewBEGetInt...OK
@@ -2354,6 +2664,68 @@
 HeapByteBufferViewBEGetAndBitwiseXorAcquireLong...OK
 HeapByteBufferViewBEGetAndBitwiseXorAcquireFloat...OK
 HeapByteBufferViewBEGetAndBitwiseXorAcquireDouble...OK
+NarrowHeapByteBufferViewBEGetShort...OK
+NarrowHeapByteBufferViewBEGetChar...OK
+NarrowHeapByteBufferViewBESetShort...OK
+NarrowHeapByteBufferViewBESetChar...OK
+NarrowHeapByteBufferViewBEGetVolatileShort...OK
+NarrowHeapByteBufferViewBEGetVolatileChar...OK
+NarrowHeapByteBufferViewBESetVolatileShort...OK
+NarrowHeapByteBufferViewBESetVolatileChar...OK
+NarrowHeapByteBufferViewBEGetAcquireShort...OK
+NarrowHeapByteBufferViewBEGetAcquireChar...OK
+NarrowHeapByteBufferViewBESetReleaseShort...OK
+NarrowHeapByteBufferViewBESetReleaseChar...OK
+NarrowHeapByteBufferViewBEGetOpaqueShort...OK
+NarrowHeapByteBufferViewBEGetOpaqueChar...OK
+NarrowHeapByteBufferViewBESetOpaqueShort...OK
+NarrowHeapByteBufferViewBESetOpaqueChar...OK
+NarrowHeapByteBufferViewBECompareAndSetShort...OK
+NarrowHeapByteBufferViewBECompareAndSetChar...OK
+NarrowHeapByteBufferViewBECompareAndExchangeShort...OK
+NarrowHeapByteBufferViewBECompareAndExchangeChar...OK
+NarrowHeapByteBufferViewBECompareAndExchangeAcquireShort...OK
+NarrowHeapByteBufferViewBECompareAndExchangeAcquireChar...OK
+NarrowHeapByteBufferViewBECompareAndExchangeReleaseShort...OK
+NarrowHeapByteBufferViewBECompareAndExchangeReleaseChar...OK
+NarrowHeapByteBufferViewBEWeakCompareAndSetPlainShort...OK
+NarrowHeapByteBufferViewBEWeakCompareAndSetPlainChar...OK
+NarrowHeapByteBufferViewBEWeakCompareAndSetShort...OK
+NarrowHeapByteBufferViewBEWeakCompareAndSetChar...OK
+NarrowHeapByteBufferViewBEWeakCompareAndSetAcquireShort...OK
+NarrowHeapByteBufferViewBEWeakCompareAndSetAcquireChar...OK
+NarrowHeapByteBufferViewBEWeakCompareAndSetReleaseShort...OK
+NarrowHeapByteBufferViewBEWeakCompareAndSetReleaseChar...OK
+NarrowHeapByteBufferViewBEGetAndSetShort...OK
+NarrowHeapByteBufferViewBEGetAndSetChar...OK
+NarrowHeapByteBufferViewBEGetAndSetAcquireShort...OK
+NarrowHeapByteBufferViewBEGetAndSetAcquireChar...OK
+NarrowHeapByteBufferViewBEGetAndSetReleaseShort...OK
+NarrowHeapByteBufferViewBEGetAndSetReleaseChar...OK
+NarrowHeapByteBufferViewBEGetAndAddShort...OK
+NarrowHeapByteBufferViewBEGetAndAddChar...OK
+NarrowHeapByteBufferViewBEGetAndAddAcquireShort...OK
+NarrowHeapByteBufferViewBEGetAndAddAcquireChar...OK
+NarrowHeapByteBufferViewBEGetAndAddReleaseShort...OK
+NarrowHeapByteBufferViewBEGetAndAddReleaseChar...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseOrShort...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseOrChar...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseOrReleaseShort...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseOrReleaseChar...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseOrAcquireShort...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseOrAcquireChar...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseAndShort...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseAndChar...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseAndReleaseShort...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseAndReleaseChar...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseAndAcquireShort...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseAndAcquireChar...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseXorShort...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseXorChar...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseXorReleaseShort...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseXorReleaseChar...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseXorAcquireShort...OK
+NarrowHeapByteBufferViewBEGetAndBitwiseXorAcquireChar...OK
 HeapByteBufferReadOnlyViewLEGetShort...OK
 HeapByteBufferReadOnlyViewLEGetChar...OK
 HeapByteBufferReadOnlyViewLEGetInt...OK
@@ -2540,6 +2912,68 @@
 HeapByteBufferReadOnlyViewLEGetAndBitwiseXorAcquireLong...OK
 HeapByteBufferReadOnlyViewLEGetAndBitwiseXorAcquireFloat...OK
 HeapByteBufferReadOnlyViewLEGetAndBitwiseXorAcquireDouble...OK
+NarrowHeapByteBufferReadOnlyViewLEGetShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetChar...OK
+NarrowHeapByteBufferReadOnlyViewLESetShort...OK
+NarrowHeapByteBufferReadOnlyViewLESetChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetVolatileShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetVolatileChar...OK
+NarrowHeapByteBufferReadOnlyViewLESetVolatileShort...OK
+NarrowHeapByteBufferReadOnlyViewLESetVolatileChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAcquireShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAcquireChar...OK
+NarrowHeapByteBufferReadOnlyViewLESetReleaseShort...OK
+NarrowHeapByteBufferReadOnlyViewLESetReleaseChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetOpaqueShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetOpaqueChar...OK
+NarrowHeapByteBufferReadOnlyViewLESetOpaqueShort...OK
+NarrowHeapByteBufferReadOnlyViewLESetOpaqueChar...OK
+NarrowHeapByteBufferReadOnlyViewLECompareAndSetShort...OK
+NarrowHeapByteBufferReadOnlyViewLECompareAndSetChar...OK
+NarrowHeapByteBufferReadOnlyViewLECompareAndExchangeShort...OK
+NarrowHeapByteBufferReadOnlyViewLECompareAndExchangeChar...OK
+NarrowHeapByteBufferReadOnlyViewLECompareAndExchangeAcquireShort...OK
+NarrowHeapByteBufferReadOnlyViewLECompareAndExchangeAcquireChar...OK
+NarrowHeapByteBufferReadOnlyViewLECompareAndExchangeReleaseShort...OK
+NarrowHeapByteBufferReadOnlyViewLECompareAndExchangeReleaseChar...OK
+NarrowHeapByteBufferReadOnlyViewLEWeakCompareAndSetPlainShort...OK
+NarrowHeapByteBufferReadOnlyViewLEWeakCompareAndSetPlainChar...OK
+NarrowHeapByteBufferReadOnlyViewLEWeakCompareAndSetShort...OK
+NarrowHeapByteBufferReadOnlyViewLEWeakCompareAndSetChar...OK
+NarrowHeapByteBufferReadOnlyViewLEWeakCompareAndSetAcquireShort...OK
+NarrowHeapByteBufferReadOnlyViewLEWeakCompareAndSetAcquireChar...OK
+NarrowHeapByteBufferReadOnlyViewLEWeakCompareAndSetReleaseShort...OK
+NarrowHeapByteBufferReadOnlyViewLEWeakCompareAndSetReleaseChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndSetShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndSetChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndSetAcquireShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndSetAcquireChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndSetReleaseShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndSetReleaseChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndAddShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndAddChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndAddAcquireShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndAddAcquireChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndAddReleaseShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndAddReleaseChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseOrShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseOrChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseOrReleaseShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseOrReleaseChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseOrAcquireShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseOrAcquireChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseAndShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseAndChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseAndReleaseShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseAndReleaseChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseAndAcquireShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseAndAcquireChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseXorShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseXorChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseXorReleaseShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseXorReleaseChar...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseXorAcquireShort...OK
+NarrowHeapByteBufferReadOnlyViewLEGetAndBitwiseXorAcquireChar...OK
 HeapByteBufferReadOnlyViewBEGetShort...OK
 HeapByteBufferReadOnlyViewBEGetChar...OK
 HeapByteBufferReadOnlyViewBEGetInt...OK
@@ -2726,6 +3160,68 @@
 HeapByteBufferReadOnlyViewBEGetAndBitwiseXorAcquireLong...OK
 HeapByteBufferReadOnlyViewBEGetAndBitwiseXorAcquireFloat...OK
 HeapByteBufferReadOnlyViewBEGetAndBitwiseXorAcquireDouble...OK
+NarrowHeapByteBufferReadOnlyViewBEGetShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetChar...OK
+NarrowHeapByteBufferReadOnlyViewBESetShort...OK
+NarrowHeapByteBufferReadOnlyViewBESetChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetVolatileShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetVolatileChar...OK
+NarrowHeapByteBufferReadOnlyViewBESetVolatileShort...OK
+NarrowHeapByteBufferReadOnlyViewBESetVolatileChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAcquireShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAcquireChar...OK
+NarrowHeapByteBufferReadOnlyViewBESetReleaseShort...OK
+NarrowHeapByteBufferReadOnlyViewBESetReleaseChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetOpaqueShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetOpaqueChar...OK
+NarrowHeapByteBufferReadOnlyViewBESetOpaqueShort...OK
+NarrowHeapByteBufferReadOnlyViewBESetOpaqueChar...OK
+NarrowHeapByteBufferReadOnlyViewBECompareAndSetShort...OK
+NarrowHeapByteBufferReadOnlyViewBECompareAndSetChar...OK
+NarrowHeapByteBufferReadOnlyViewBECompareAndExchangeShort...OK
+NarrowHeapByteBufferReadOnlyViewBECompareAndExchangeChar...OK
+NarrowHeapByteBufferReadOnlyViewBECompareAndExchangeAcquireShort...OK
+NarrowHeapByteBufferReadOnlyViewBECompareAndExchangeAcquireChar...OK
+NarrowHeapByteBufferReadOnlyViewBECompareAndExchangeReleaseShort...OK
+NarrowHeapByteBufferReadOnlyViewBECompareAndExchangeReleaseChar...OK
+NarrowHeapByteBufferReadOnlyViewBEWeakCompareAndSetPlainShort...OK
+NarrowHeapByteBufferReadOnlyViewBEWeakCompareAndSetPlainChar...OK
+NarrowHeapByteBufferReadOnlyViewBEWeakCompareAndSetShort...OK
+NarrowHeapByteBufferReadOnlyViewBEWeakCompareAndSetChar...OK
+NarrowHeapByteBufferReadOnlyViewBEWeakCompareAndSetAcquireShort...OK
+NarrowHeapByteBufferReadOnlyViewBEWeakCompareAndSetAcquireChar...OK
+NarrowHeapByteBufferReadOnlyViewBEWeakCompareAndSetReleaseShort...OK
+NarrowHeapByteBufferReadOnlyViewBEWeakCompareAndSetReleaseChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndSetShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndSetChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndSetAcquireShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndSetAcquireChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndSetReleaseShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndSetReleaseChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndAddShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndAddChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndAddAcquireShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndAddAcquireChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndAddReleaseShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndAddReleaseChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseOrShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseOrChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseOrReleaseShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseOrReleaseChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseOrAcquireShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseOrAcquireChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseAndShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseAndChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseAndReleaseShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseAndReleaseChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseAndAcquireShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseAndAcquireChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseXorShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseXorChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseXorReleaseShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseXorReleaseChar...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseXorAcquireShort...OK
+NarrowHeapByteBufferReadOnlyViewBEGetAndBitwiseXorAcquireChar...OK
 FieldGetWidget...OK
 FieldSetWidget...OK
 FieldGetVolatileWidget...OK
@@ -3339,4 +3835,4 @@
 SupertypeTest...OK
 InterfaceTest...OK
 ImplicitBoxingIntegerTest...OK
-3341 successes, 0 skips, 0 failures.
+3837 successes, 0 skips, 0 failures.
diff --git a/test/712-varhandle-invocations/src/VarHandleUnitTestHelpers.java b/test/712-varhandle-invocations/src/VarHandleUnitTestHelpers.java
index 6f72e99..4cd8636 100644
--- a/test/712-varhandle-invocations/src/VarHandleUnitTestHelpers.java
+++ b/test/712-varhandle-invocations/src/VarHandleUnitTestHelpers.java
@@ -53,6 +53,14 @@
         }
     }
 
+    public static byte[] createFilledByteArray(int size) {
+        byte[] array = new byte[size];
+        for (int i = 0; i != size; ++i) {
+            array[i] = (byte) (i * 47 + 11);
+        }
+        return array;
+    }
+
     public static boolean getBytesAs_boolean(byte[] array, int index, ByteOrder order) {
         return getBytesAs_boolean(ByteBuffer.wrap(array), index, order);
     }
diff --git a/test/712-varhandle-invocations/util-src/generate_java.py b/test/712-varhandle-invocations/util-src/generate_java.py
index 763fb20..e32cee9 100644
--- a/test/712-varhandle-invocations/util-src/generate_java.py
+++ b/test/712-varhandle-invocations/util-src/generate_java.py
@@ -84,6 +84,8 @@
 DOUBLE_TYPE=ValueType("double", "Double", [ "-1.0e-200", "1.11e200", "3.141", "1.1111", "6.022e23", "6.626e-34" ], ordinal=7, width=4, supports_bitwise=False)
 
 VALUE_TYPES = { BOOLEAN_TYPE, BYTE_TYPE, SHORT_TYPE, CHAR_TYPE, INT_TYPE, LONG_TYPE, FLOAT_TYPE, DOUBLE_TYPE }
+VIEW_SUPPORTED_TYPES = list(filter(lambda x : x.width >= 2, VALUE_TYPES))
+VIEW_SUPPORTED_NARROW_TYPES = list(filter(lambda x : x.width == 2, VALUE_TYPES))
 
 WIDENING_CONVERSIONS = {
     BOOLEAN_TYPE : set(),
@@ -104,11 +106,9 @@
     return types_that_widen
 
 class VarHandleKind(object):
-    ALL_SUPPORTED_TYPES = VALUE_TYPES
-    VIEW_SUPPORTED_TYPES = list(filter(lambda x : x.width >= 2, ALL_SUPPORTED_TYPES))
-
-    def __init__(self, name, imports=[], declarations=[], lookup='', coordinates=[], get_value='', may_throw_read_only=False):
+    def __init__(self, name, supported_types=[], imports=[], declarations=[], lookup='', coordinates=[], get_value='', may_throw_read_only=False):
         self.name = name
+        self.supported_types = supported_types
         self.imports = imports
         self.declarations = declarations
         self.lookup = lookup
@@ -132,7 +132,7 @@
         return Template(self.lookup).safe_substitute(dictionary)
 
     def get_supported_types(self):
-        return VarHandleKind.VIEW_SUPPORTED_TYPES if self.is_view() else VarHandleKind.ALL_SUPPORTED_TYPES
+        return self.supported_types
 
     def is_view(self):
         return "View" in self.name
@@ -141,6 +141,7 @@
         return Template(self.get_value_).safe_substitute(dictionary)
 
 FIELD_VAR_HANDLE = VarHandleKind("Field",
+                                 VALUE_TYPES,
                                  [
                                      'java.lang.invoke.MethodHandles',
                                      'java.lang.invoke.VarHandle'
@@ -156,6 +157,7 @@
                                  may_throw_read_only = False)
 
 FINAL_FIELD_VAR_HANDLE = VarHandleKind("FinalField",
+                                       VALUE_TYPES,
                                        [
                                            'java.lang.invoke.MethodHandles',
                                            'java.lang.invoke.VarHandle'
@@ -171,6 +173,7 @@
                                        may_throw_read_only = False)
 
 STATIC_FIELD_VAR_HANDLE = VarHandleKind("StaticField",
+                                        VALUE_TYPES,
                                         [
                                             'java.lang.invoke.MethodHandles',
                                             'java.lang.invoke.VarHandle'
@@ -184,6 +187,7 @@
                                         may_throw_read_only = False)
 
 STATIC_FINAL_FIELD_VAR_HANDLE = VarHandleKind("StaticFinalField",
+                                              VALUE_TYPES,
                                               [
                                                   'java.lang.invoke.MethodHandles',
                                                   'java.lang.invoke.VarHandle'
@@ -197,6 +201,7 @@
                                               may_throw_read_only = False)
 
 ARRAY_ELEMENT_VAR_HANDLE = VarHandleKind("ArrayElement",
+                                         VALUE_TYPES,
                                          [
                                              'java.lang.invoke.MethodHandles',
                                              'java.lang.invoke.VarHandle'
@@ -212,13 +217,14 @@
                                          may_throw_read_only = False)
 
 BYTE_ARRAY_LE_VIEW_VAR_HANDLE = VarHandleKind("ByteArrayViewLE",
+                                              VIEW_SUPPORTED_TYPES,
                                               [
                                                   'java.lang.invoke.MethodHandles',
                                                   'java.lang.invoke.VarHandle',
                                                   'java.nio.ByteOrder'
                                               ],
                                               [
-                                                  "byte[] array = new byte[27]",
+                                                  "byte[] array = VarHandleUnitTestHelpers.createFilledByteArray(27)",
                                                   "int index = 8",
                                                   "{"
                                                   "  index = VarHandleUnitTestHelpers.alignedOffset_${var_type}(array, index);"
@@ -233,14 +239,38 @@
                                               'VarHandleUnitTestHelpers.getBytesAs_${var_type}(array, index, ByteOrder.LITTLE_ENDIAN)',
                                               may_throw_read_only = False)
 
+NARROW_BYTE_ARRAY_LE_VIEW_VAR_HANDLE = VarHandleKind("NarrowByteArrayViewLE",
+                                                     VIEW_SUPPORTED_NARROW_TYPES,
+                                                     [
+                                                         'java.lang.invoke.MethodHandles',
+                                                         'java.lang.invoke.VarHandle',
+                                                         'java.nio.ByteOrder'
+                                                     ],
+                                                     [
+                                                         "byte[] array = VarHandleUnitTestHelpers.createFilledByteArray(27)",
+                                                         "int index = 10",
+                                                         "{"
+                                                         "  index = VarHandleUnitTestHelpers.alignedOffset_${var_type}(array, index);"
+                                                         "  VarHandleUnitTestHelpers.setBytesAs_${var_type}(array, index, ${initial_value}, ByteOrder.LITTLE_ENDIAN);"
+                                                         "}"
+                                                     ],
+                                                     'MethodHandles.byteArrayViewVarHandle(${var_type}[].class, ByteOrder.LITTLE_ENDIAN)',
+                                                     [
+                                                         'array',
+                                                         'index'
+                                                     ],
+                                                     'VarHandleUnitTestHelpers.getBytesAs_${var_type}(array, index, ByteOrder.LITTLE_ENDIAN)',
+                                                     may_throw_read_only = False)
+
 BYTE_ARRAY_BE_VIEW_VAR_HANDLE = VarHandleKind("ByteArrayViewBE",
+                                              VIEW_SUPPORTED_TYPES,
                                               [
                                                   'java.lang.invoke.MethodHandles',
                                                   'java.lang.invoke.VarHandle',
                                                   'java.nio.ByteOrder'
                                               ],
                                               [
-                                                  "byte[] array = new byte[27]",
+                                                  "byte[] array = VarHandleUnitTestHelpers.createFilledByteArray(27)",
                                                   "int index = 8",
                                                   "{"
                                                   "  index = VarHandleUnitTestHelpers.alignedOffset_${var_type}(array, index);"
@@ -255,7 +285,31 @@
                                               'VarHandleUnitTestHelpers.getBytesAs_${var_type}(array, index, ByteOrder.BIG_ENDIAN)',
                                               may_throw_read_only = False)
 
+NARROW_BYTE_ARRAY_BE_VIEW_VAR_HANDLE = VarHandleKind("NarrowByteArrayViewBE",
+                                                     VIEW_SUPPORTED_NARROW_TYPES,
+                                                     [
+                                                         'java.lang.invoke.MethodHandles',
+                                                         'java.lang.invoke.VarHandle',
+                                                         'java.nio.ByteOrder'
+                                                     ],
+                                                     [
+                                                         "byte[] array = VarHandleUnitTestHelpers.createFilledByteArray(27)",
+                                                         "int index = 10",
+                                                         "{"
+                                                         "  index = VarHandleUnitTestHelpers.alignedOffset_${var_type}(array, index);"
+                                                         "  VarHandleUnitTestHelpers.setBytesAs_${var_type}(array, index, ${initial_value}, ByteOrder.BIG_ENDIAN);"
+                                                         "}"
+                                                     ],
+                                                     'MethodHandles.byteArrayViewVarHandle(${var_type}[].class, ByteOrder.BIG_ENDIAN)',
+                                                     [
+                                                         'array',
+                                                         'index'
+                                                     ],
+                                                     'VarHandleUnitTestHelpers.getBytesAs_${var_type}(array, index, ByteOrder.BIG_ENDIAN)',
+                                                     may_throw_read_only = False)
+
 DIRECT_BYTE_BUFFER_LE_VIEW_VAR_HANDLE = VarHandleKind("DirectByteBufferViewLE",
+                                                      VIEW_SUPPORTED_TYPES,
                                                       [
                                                           'java.lang.invoke.MethodHandles',
                                                           'java.lang.invoke.VarHandle',
@@ -278,7 +332,32 @@
                                                       'VarHandleUnitTestHelpers.getBytesAs_${var_type}(bb, index, ByteOrder.LITTLE_ENDIAN)',
                                                       may_throw_read_only = False)
 
+NARROW_DIRECT_BYTE_BUFFER_LE_VIEW_VAR_HANDLE = VarHandleKind("NarrowDirectByteBufferViewLE",
+                                                             VIEW_SUPPORTED_NARROW_TYPES,
+                                                             [
+                                                                 'java.lang.invoke.MethodHandles',
+                                                                 'java.lang.invoke.VarHandle',
+                                                                 'java.nio.ByteBuffer',
+                                                                 'java.nio.ByteOrder'
+                                                             ],
+                                                             [
+                                                                 "ByteBuffer bb = ByteBuffer.allocateDirect(31)",
+                                                                 "int index = 10",
+                                                                 "{"
+                                                                 "  index = VarHandleUnitTestHelpers.alignedOffset_${var_type}(bb, index);"
+                                                                 "  VarHandleUnitTestHelpers.setBytesAs_${var_type}(bb, index, ${initial_value}, ByteOrder.LITTLE_ENDIAN);"
+                                                                 "}"
+                                                             ],
+                                                             'MethodHandles.byteBufferViewVarHandle(${var_type}[].class, ByteOrder.LITTLE_ENDIAN)',
+                                                             [
+                                                                 'bb',
+                                                                 'index'
+                                                             ],
+                                                             'VarHandleUnitTestHelpers.getBytesAs_${var_type}(bb, index, ByteOrder.LITTLE_ENDIAN)',
+                                                             may_throw_read_only = False)
+
 DIRECT_BYTE_BUFFER_BE_VIEW_VAR_HANDLE = VarHandleKind("DirectByteBufferViewBE",
+                                                      VIEW_SUPPORTED_TYPES,
                                                       [
                                                           'java.lang.invoke.MethodHandles',
                                                           'java.lang.invoke.VarHandle',
@@ -301,7 +380,32 @@
                                                       'VarHandleUnitTestHelpers.getBytesAs_${var_type}(bb, index, ByteOrder.BIG_ENDIAN)',
                                                       may_throw_read_only = False)
 
+NARROW_DIRECT_BYTE_BUFFER_BE_VIEW_VAR_HANDLE = VarHandleKind("NarrowDirectByteBufferViewBE",
+                                                             VIEW_SUPPORTED_NARROW_TYPES,
+                                                             [
+                                                                 'java.lang.invoke.MethodHandles',
+                                                                 'java.lang.invoke.VarHandle',
+                                                                 'java.nio.ByteBuffer',
+                                                                 'java.nio.ByteOrder'
+                                                             ],
+                                                             [
+                                                                 "ByteBuffer bb = ByteBuffer.allocateDirect(31)",
+                                                                 "int index = 10",
+                                                                 "{"
+                                                                 "  index = VarHandleUnitTestHelpers.alignedOffset_${var_type}(bb, index);"
+                                                                 "  VarHandleUnitTestHelpers.setBytesAs_${var_type}(bb, index, ${initial_value}, ByteOrder.BIG_ENDIAN);"
+                                                                 "}"
+                                                             ],
+                                                             'MethodHandles.byteBufferViewVarHandle(${var_type}[].class, ByteOrder.BIG_ENDIAN)',
+                                                             [
+                                                                 'bb',
+                                                                 'index'
+                                                             ],
+                                                             'VarHandleUnitTestHelpers.getBytesAs_${var_type}(bb, index, ByteOrder.BIG_ENDIAN)',
+                                                             may_throw_read_only = False)
+
 HEAP_BYTE_BUFFER_LE_VIEW_VAR_HANDLE = VarHandleKind("HeapByteBufferViewLE",
+                                                    VIEW_SUPPORTED_TYPES,
                                                     [
                                                         'java.lang.invoke.MethodHandles',
                                                         'java.lang.invoke.VarHandle',
@@ -309,7 +413,7 @@
                                                         'java.nio.ByteOrder'
                                                     ],
                                                     [
-                                                        "byte[] array = new byte[36]",
+                                                        "byte[] array = VarHandleUnitTestHelpers.createFilledByteArray(36)",
                                                         "int offset = 8",
                                                         "ByteBuffer bb = ByteBuffer.wrap(array, offset, array.length - offset)",
                                                         "int index = 8",
@@ -326,7 +430,34 @@
                                                     'VarHandleUnitTestHelpers.getBytesAs_${var_type}(bb, index, ByteOrder.LITTLE_ENDIAN)',
                                                     may_throw_read_only = False)
 
+NARROW_HEAP_BYTE_BUFFER_LE_VIEW_VAR_HANDLE = VarHandleKind("NarrowHeapByteBufferViewLE",
+                                                           VIEW_SUPPORTED_NARROW_TYPES,
+                                                           [
+                                                               'java.lang.invoke.MethodHandles',
+                                                               'java.lang.invoke.VarHandle',
+                                                               'java.nio.ByteBuffer',
+                                                               'java.nio.ByteOrder'
+                                                           ],
+                                                           [
+                                                               "byte[] array = VarHandleUnitTestHelpers.createFilledByteArray(36)",
+                                                               "int offset = 8",
+                                                               "ByteBuffer bb = ByteBuffer.wrap(array, offset, array.length - offset)",
+                                                               "int index = 10",
+                                                               "{"
+                                                               "  index = VarHandleUnitTestHelpers.alignedOffset_${var_type}(bb, index);"
+                                                               "  VarHandleUnitTestHelpers.setBytesAs_${var_type}(bb, index, ${initial_value}, ByteOrder.LITTLE_ENDIAN);"
+                                                               "}"
+                                                           ],
+                                                           'MethodHandles.byteBufferViewVarHandle(${var_type}[].class, ByteOrder.LITTLE_ENDIAN)',
+                                                           [
+                                                               'bb',
+                                                               'index'
+                                                           ],
+                                                           'VarHandleUnitTestHelpers.getBytesAs_${var_type}(bb, index, ByteOrder.LITTLE_ENDIAN)',
+                                                           may_throw_read_only = False)
+
 HEAP_BYTE_BUFFER_BE_VIEW_VAR_HANDLE = VarHandleKind("HeapByteBufferViewBE",
+                                                    VIEW_SUPPORTED_TYPES,
                                                     [
                                                         'java.lang.invoke.MethodHandles',
                                                         'java.lang.invoke.VarHandle',
@@ -334,7 +465,7 @@
                                                         'java.nio.ByteOrder'
                                                     ],
                                                     [
-                                                        "byte[] array = new byte[47]",
+                                                        "byte[] array = VarHandleUnitTestHelpers.createFilledByteArray(47)",
                                                         "int offset = 8",
                                                         "ByteBuffer bb = ByteBuffer.wrap(array, offset, array.length - offset)",
                                                         "int index = 8",
@@ -351,7 +482,34 @@
                                                     'VarHandleUnitTestHelpers.getBytesAs_${var_type}(bb, index, ByteOrder.BIG_ENDIAN)',
                                                     may_throw_read_only = False)
 
+NARROW_HEAP_BYTE_BUFFER_BE_VIEW_VAR_HANDLE = VarHandleKind("NarrowHeapByteBufferViewBE",
+                                                           VIEW_SUPPORTED_NARROW_TYPES,
+                                                           [
+                                                               'java.lang.invoke.MethodHandles',
+                                                               'java.lang.invoke.VarHandle',
+                                                               'java.nio.ByteBuffer',
+                                                               'java.nio.ByteOrder'
+                                                           ],
+                                                           [
+                                                               "byte[] array = VarHandleUnitTestHelpers.createFilledByteArray(47)",
+                                                               "int offset = 8",
+                                                               "ByteBuffer bb = ByteBuffer.wrap(array, offset, array.length - offset)",
+                                                               "int index = 10",
+                                                               "{"
+                                                               "  index = VarHandleUnitTestHelpers.alignedOffset_${var_type}(bb, index);"
+                                                               "  VarHandleUnitTestHelpers.setBytesAs_${var_type}(bb, index, ${initial_value}, ByteOrder.BIG_ENDIAN);"
+                                                               "}"
+                                                           ],
+                                                           'MethodHandles.byteBufferViewVarHandle(${var_type}[].class, ByteOrder.BIG_ENDIAN)',
+                                                           [
+                                                               'bb',
+                                                               'index'
+                                                           ],
+                                                           'VarHandleUnitTestHelpers.getBytesAs_${var_type}(bb, index, ByteOrder.BIG_ENDIAN)',
+                                                           may_throw_read_only = False)
+
 HEAP_BYTE_BUFFER_RO_LE_VIEW_VAR_HANDLE = VarHandleKind("HeapByteBufferReadOnlyViewLE",
+                                                       VIEW_SUPPORTED_TYPES,
                                                        [
                                                            'java.lang.invoke.MethodHandles',
                                                            'java.lang.invoke.VarHandle',
@@ -360,7 +518,7 @@
                                                            'java.nio.ReadOnlyBufferException'
                                                        ],
                                                        [
-                                                           "byte[] array = new byte[43]",
+                                                           "byte[] array = VarHandleUnitTestHelpers.createFilledByteArray(43)",
                                                            "int index = 8",
                                                            "ByteBuffer bb",
                                                            "{"
@@ -368,7 +526,6 @@
                                                            "  index = VarHandleUnitTestHelpers.alignedOffset_${var_type}(bb, index);"
                                                            "  VarHandleUnitTestHelpers.setBytesAs_${var_type}(array, index, ${initial_value}, ByteOrder.LITTLE_ENDIAN);"
                                                            "  bb = bb.asReadOnlyBuffer();"
-
                                                            "}"
                                                        ],
                                                        'MethodHandles.byteBufferViewVarHandle(${var_type}[].class, ByteOrder.LITTLE_ENDIAN)',
@@ -379,7 +536,36 @@
                                                        'VarHandleUnitTestHelpers.getBytesAs_${var_type}(bb, index, ByteOrder.LITTLE_ENDIAN)',
                                                        may_throw_read_only = True)
 
+NARROW_HEAP_BYTE_BUFFER_RO_LE_VIEW_VAR_HANDLE = VarHandleKind("NarrowHeapByteBufferReadOnlyViewLE",
+                                                              VIEW_SUPPORTED_NARROW_TYPES,
+                                                              [
+                                                                  'java.lang.invoke.MethodHandles',
+                                                                  'java.lang.invoke.VarHandle',
+                                                                  'java.nio.ByteBuffer',
+                                                                  'java.nio.ByteOrder',
+                                                                  'java.nio.ReadOnlyBufferException'
+                                                              ],
+                                                              [
+                                                                  "byte[] array = VarHandleUnitTestHelpers.createFilledByteArray(43)",
+                                                                  "int index = 10",
+                                                                  "ByteBuffer bb",
+                                                                  "{"
+                                                                  "  bb = ByteBuffer.wrap(array).asReadOnlyBuffer();"
+                                                                  "  index = VarHandleUnitTestHelpers.alignedOffset_${var_type}(bb, index);"
+                                                                  "  VarHandleUnitTestHelpers.setBytesAs_${var_type}(array, index, ${initial_value}, ByteOrder.LITTLE_ENDIAN);"
+                                                                  "  bb = bb.asReadOnlyBuffer();"
+                                                                  "}"
+                                                              ],
+                                                              'MethodHandles.byteBufferViewVarHandle(${var_type}[].class, ByteOrder.LITTLE_ENDIAN)',
+                                                              [
+                                                                  'bb',
+                                                                  'index'
+                                                              ],
+                                                              'VarHandleUnitTestHelpers.getBytesAs_${var_type}(bb, index, ByteOrder.LITTLE_ENDIAN)',
+                                                              may_throw_read_only = True)
+
 HEAP_BYTE_BUFFER_RO_BE_VIEW_VAR_HANDLE = VarHandleKind("HeapByteBufferReadOnlyViewBE",
+                                                       VIEW_SUPPORTED_TYPES,
                                                        [
                                                            'java.lang.invoke.MethodHandles',
                                                            'java.lang.invoke.VarHandle',
@@ -388,12 +574,12 @@
                                                            'java.nio.ReadOnlyBufferException'
                                                        ],
                                                        [
-                                                           "byte[] array = new byte[29]",
-                                                           "int index",
+                                                           "byte[] array = VarHandleUnitTestHelpers.createFilledByteArray(29)",
+                                                           "int index = 8",
                                                            "ByteBuffer bb",
                                                            "{"
                                                            "  bb = ByteBuffer.wrap(array);"
-                                                           "  index = VarHandleUnitTestHelpers.alignedOffset_${var_type}(bb, 8);"
+                                                           "  index = VarHandleUnitTestHelpers.alignedOffset_${var_type}(bb, index);"
                                                            "  VarHandleUnitTestHelpers.setBytesAs_${var_type}(array, index, ${initial_value}, ByteOrder.BIG_ENDIAN);"
                                                            "  bb = bb.asReadOnlyBuffer();"
                                                            "}"
@@ -406,6 +592,34 @@
                                                        'VarHandleUnitTestHelpers.getBytesAs_${var_type}(bb, index, ByteOrder.BIG_ENDIAN)',
                                                        may_throw_read_only = True)
 
+NARROW_HEAP_BYTE_BUFFER_RO_BE_VIEW_VAR_HANDLE = VarHandleKind("NarrowHeapByteBufferReadOnlyViewBE",
+                                                              VIEW_SUPPORTED_NARROW_TYPES,
+                                                              [
+                                                                  'java.lang.invoke.MethodHandles',
+                                                                  'java.lang.invoke.VarHandle',
+                                                                  'java.nio.ByteBuffer',
+                                                                  'java.nio.ByteOrder',
+                                                                  'java.nio.ReadOnlyBufferException'
+                                                              ],
+                                                              [
+                                                                  "byte[] array = VarHandleUnitTestHelpers.createFilledByteArray(29)",
+                                                                  "int index = 10",
+                                                                  "ByteBuffer bb",
+                                                                  "{"
+                                                                  "  bb = ByteBuffer.wrap(array);"
+                                                                  "  index = VarHandleUnitTestHelpers.alignedOffset_${var_type}(bb, index);"
+                                                                  "  VarHandleUnitTestHelpers.setBytesAs_${var_type}(array, index, ${initial_value}, ByteOrder.BIG_ENDIAN);"
+                                                                  "  bb = bb.asReadOnlyBuffer();"
+                                                                  "}"
+                                                              ],
+                                                              'MethodHandles.byteBufferViewVarHandle(${var_type}[].class, ByteOrder.BIG_ENDIAN)',
+                                                              [
+                                                                  'bb',
+                                                                  'index'
+                                                              ],
+                                                              'VarHandleUnitTestHelpers.getBytesAs_${var_type}(bb, index, ByteOrder.BIG_ENDIAN)',
+                                                              may_throw_read_only = True)
+
 ALL_FIELD_VAR_HANDLE_KINDS = [
     FIELD_VAR_HANDLE,
     FINAL_FIELD_VAR_HANDLE,
@@ -415,13 +629,21 @@
 
 ALL_BYTE_VIEW_VAR_HANDLE_KINDS = [
     BYTE_ARRAY_LE_VIEW_VAR_HANDLE,
+    NARROW_BYTE_ARRAY_LE_VIEW_VAR_HANDLE,
     BYTE_ARRAY_BE_VIEW_VAR_HANDLE,
+    NARROW_BYTE_ARRAY_BE_VIEW_VAR_HANDLE,
     DIRECT_BYTE_BUFFER_LE_VIEW_VAR_HANDLE,
+    NARROW_DIRECT_BYTE_BUFFER_LE_VIEW_VAR_HANDLE,
     DIRECT_BYTE_BUFFER_BE_VIEW_VAR_HANDLE,
+    NARROW_DIRECT_BYTE_BUFFER_BE_VIEW_VAR_HANDLE,
     HEAP_BYTE_BUFFER_LE_VIEW_VAR_HANDLE,
+    NARROW_HEAP_BYTE_BUFFER_LE_VIEW_VAR_HANDLE,
     HEAP_BYTE_BUFFER_BE_VIEW_VAR_HANDLE,
+    NARROW_HEAP_BYTE_BUFFER_BE_VIEW_VAR_HANDLE,
     HEAP_BYTE_BUFFER_RO_LE_VIEW_VAR_HANDLE,
-    HEAP_BYTE_BUFFER_RO_BE_VIEW_VAR_HANDLE
+    NARROW_HEAP_BYTE_BUFFER_RO_LE_VIEW_VAR_HANDLE,
+    HEAP_BYTE_BUFFER_RO_BE_VIEW_VAR_HANDLE,
+    NARROW_HEAP_BYTE_BUFFER_RO_BE_VIEW_VAR_HANDLE
 ]
 
 ALL_VAR_HANDLE_KINDS = ALL_FIELD_VAR_HANDLE_KINDS + [ ARRAY_ELEMENT_VAR_HANDLE ] + ALL_BYTE_VIEW_VAR_HANDLE_KINDS
diff --git a/test/720-thread-priority/thread_priority.cc b/test/720-thread-priority/thread_priority.cc
index db4a2b2..519a0a1 100644
--- a/test/720-thread-priority/thread_priority.cc
+++ b/test/720-thread-priority/thread_priority.cc
@@ -22,7 +22,7 @@
 #include "jni.h"
 
 extern "C" JNIEXPORT jint JNICALL Java_Main_getThreadPlatformPriority(
-    JNIEnv* env ATTRIBUTE_UNUSED,
-    jclass clazz ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] JNIEnv* env,
+    [[maybe_unused]] jclass clazz) {
   return getpriority(PRIO_PROCESS, art::GetTid());
 }
diff --git a/test/823-cha-inlining/Android.bp b/test/823-cha-inlining/Android.bp
index f174b02..1b94636 100644
--- a/test/823-cha-inlining/Android.bp
+++ b/test/823-cha-inlining/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-no-test-suite-tag-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-823-cha-inlining-src"
+        "art-run-test-823-cha-inlining-src",
     ],
     data: [
         ":art-run-test-823-cha-inlining-expected-stdout",
diff --git a/test/843-default-interface/Android.bp b/test/843-default-interface/Android.bp
index ff942e6..417166f 100644
--- a/test/843-default-interface/Android.bp
+++ b/test/843-default-interface/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-843-default-interface-src"
+        "art-run-test-843-default-interface-src",
     ],
     data: [
         ":art-run-test-843-default-interface-expected-stdout",
diff --git a/test/845-data-image/Android.bp b/test/845-data-image/Android.bp
index 2daae4b..f2556e1 100644
--- a/test/845-data-image/Android.bp
+++ b/test/845-data-image/Android.bp
@@ -11,12 +11,25 @@
     default_applicable_licenses: ["art_license"],
 }
 
+// Library with src-art/ sources for the test.
+java_library {
+    name: "art-run-test-845-data-image-src-art",
+    defaults: ["art-run-test-defaults"],
+    srcs: ["src-art/**/*.java"],
+    lint: {
+        baseline_filename: "lint-baseline.xml",
+    },
+}
+
 // Test's Dex code.
 java_test {
     name: "art-run-test-845-data-image",
     defaults: ["art-run-test-defaults"],
     test_config_template: ":art-run-test-target-no-test-suite-tag-template",
-    srcs: ["src-art/**/*.java"],
+    srcs: ["src2/**/*.java"],
+    static_libs: [
+        "art-run-test-845-data-image-src-art",
+    ],
     data: [
         ":art-run-test-845-data-image-expected-stdout",
         ":art-run-test-845-data-image-expected-stderr",
diff --git a/test/845-data-image/lint-baseline.xml b/test/845-data-image/lint-baseline.xml
new file mode 100644
index 0000000..05a7614
--- /dev/null
+++ b/test/845-data-image/lint-baseline.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<issues format="6" by="lint 8.4.0-alpha01" type="baseline" client="" dependencies="true" name="" variant="all" version="8.4.0-alpha01">
+
+    <issue
+        id="NewApi"
+        message="Call requires API level 34 (current min is 31): `dalvik.system.DexFile.OptimizationInfo#isOptimized`"
+        errorLine1="      if (!info.isOptimized() &amp;&amp; !isInImageSpace(Main.class)) {"
+        errorLine2="                ~~~~~~~~~~~">
+        <location
+            file="art/test/845-data-image/src-art/Main.java"
+            line="165"
+            column="17"/>
+    </issue>
+
+</issues>
\ No newline at end of file
diff --git a/test/845-data-image/src-art/Main.java b/test/845-data-image/src-art/Main.java
index 36cc9d0..eb217d8 100644
--- a/test/845-data-image/src-art/Main.java
+++ b/test/845-data-image/src-art/Main.java
@@ -162,7 +162,7 @@
 
     if (args.length == 2 && "--second-run".equals(args[1])) {
       DexFile.OptimizationInfo info = VMRuntime.getBaseApkOptimizationInfo();
-      if (!info.isOptimized()) {
+      if (!info.isOptimized() && !isInImageSpace(Main.class)) {
         throw new Error("Expected image to be loaded");
       }
     }
@@ -336,6 +336,7 @@
   private static native boolean hasOatFile();
   private static native boolean hasImage();
   private static native String getCompilerFilter(Class<?> cls);
+  private static native boolean isInImageSpace(Class<?> cls);
 
   private static final String TEMP_FILE_NAME_PREFIX = "temp";
   private static final String TEMP_FILE_NAME_SUFFIX = "-file";
diff --git a/test/846-multidex-data-image/src-art/Main.java b/test/846-multidex-data-image/src-art/Main.java
index aea92a4..8e425d1 100644
--- a/test/846-multidex-data-image/src-art/Main.java
+++ b/test/846-multidex-data-image/src-art/Main.java
@@ -48,7 +48,7 @@
 
     if (args.length == 2 && "--second-run".equals(args[1])) {
       DexFile.OptimizationInfo info = VMRuntime.getBaseApkOptimizationInfo();
-      if (!info.isOptimized()) {
+      if (!info.isOptimized() && !isInImageSpace(Main.class)) {
         throw new Error("Expected image to be loaded");
       }
     }
@@ -77,6 +77,7 @@
   private static native boolean hasOatFile();
   private static native boolean hasImage();
   private static native String getCompilerFilter(Class<?> cls);
+  private static native boolean isInImageSpace(Class<?> cls);
 
   private static final String TEMP_FILE_NAME_PREFIX = "temp";
   private static final String TEMP_FILE_NAME_SUFFIX = "-file";
diff --git a/test/848-pattern-match/Android.bp b/test/848-pattern-match/Android.bp
new file mode 100644
index 0000000..12adb0c
--- /dev/null
+++ b/test/848-pattern-match/Android.bp
@@ -0,0 +1,40 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `848-pattern-match`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-848-pattern-match",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-no-test-suite-tag-template",
+    srcs: ["src/**/*.java"],
+    data: [
+        ":art-run-test-848-pattern-match-expected-stdout",
+        ":art-run-test-848-pattern-match-expected-stderr",
+    ],
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-848-pattern-match-expected-stdout",
+    out: ["art-run-test-848-pattern-match-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-848-pattern-match-expected-stderr",
+    out: ["art-run-test-848-pattern-match-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/test/015-switch/expected-stderr.txt b/test/848-pattern-match/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/848-pattern-match/expected-stderr.txt
diff --git a/test/848-pattern-match/expected-stdout.txt b/test/848-pattern-match/expected-stdout.txt
new file mode 100644
index 0000000..6a5618e
--- /dev/null
+++ b/test/848-pattern-match/expected-stdout.txt
@@ -0,0 +1 @@
+JNI_OnLoad called
diff --git a/test/848-pattern-match/info.txt b/test/848-pattern-match/info.txt
new file mode 100644
index 0000000..995bcba
--- /dev/null
+++ b/test/848-pattern-match/info.txt
@@ -0,0 +1 @@
+Tests for the JIT pattern matcher.
diff --git a/test/848-pattern-match/run.py b/test/848-pattern-match/run.py
new file mode 100644
index 0000000..39cdbbf
--- /dev/null
+++ b/test/848-pattern-match/run.py
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# Copyright (C) 2020 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def run(ctx, args):
+  # Force baseline JIT compilation to trigger the pattern matcher.
+  ctx.default_run(args, Xcompiler_option=["--baseline"])
diff --git a/test/848-pattern-match/src/Main.java b/test/848-pattern-match/src/Main.java
new file mode 100644
index 0000000..904a27c
--- /dev/null
+++ b/test/848-pattern-match/src/Main.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class Main {
+  public float myFloatField = 42f;
+  public double myDoubleField = 42d;
+  public boolean myBooleanField = true;
+
+  public float returnFloat() {
+    return myFloatField;
+  }
+
+  public double returnDouble() {
+    return myDoubleField;
+  }
+
+  public boolean returnBoolean() {
+    return myBooleanField;
+  }
+
+  public static void assertEquals(float a, float b) {
+    if (a != b) {
+      throw new Error("Expected " + a + ", got " + b);
+    }
+  }
+
+  public static void assertEquals(double a, double b) {
+    if (a != b) {
+      throw new Error("Expected " + a + ", got " + b);
+    }
+  }
+
+  public static void assertEquals(boolean a, boolean b) {
+    if (a != b) {
+      throw new Error("Expected " + a + ", got " + b);
+    }
+  }
+
+  public static void main(String[] args) {
+    System.loadLibrary(args[0]);
+    ensureJitBaselineCompiled(Main.class, "returnFloat");
+    ensureJitBaselineCompiled(Main.class, "returnDouble");
+    ensureJitBaselineCompiled(Main.class, "returnBoolean");
+    Main m = new Main();
+    assertEquals(m.myFloatField, m.returnFloat());
+    assertEquals(m.myDoubleField, m.returnDouble());
+    assertEquals(m.myBooleanField, m.returnBoolean());
+  }
+
+  public static native void ensureJitBaselineCompiled(Class<?> cls, String methodName);
+}
diff --git a/test/015-switch/expected-stderr.txt b/test/850-checker-branches/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/850-checker-branches/expected-stderr.txt
diff --git a/test/850-checker-branches/expected-stdout.txt b/test/850-checker-branches/expected-stdout.txt
new file mode 100644
index 0000000..6a5618e
--- /dev/null
+++ b/test/850-checker-branches/expected-stdout.txt
@@ -0,0 +1 @@
+JNI_OnLoad called
diff --git a/test/850-checker-branches/info.txt b/test/850-checker-branches/info.txt
new file mode 100644
index 0000000..e38ae41
--- /dev/null
+++ b/test/850-checker-branches/info.txt
@@ -0,0 +1 @@
+Test for branch profiling.
diff --git a/test/850-checker-branches/run.py b/test/850-checker-branches/run.py
new file mode 100644
index 0000000..9bdc033
--- /dev/null
+++ b/test/850-checker-branches/run.py
@@ -0,0 +1,30 @@
+#!/bin/bash
+#
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def run(ctx, args):
+  # Pass --verbose-methods to only generate the CFG of these methods.
+  # The test is for JIT, but we run in "optimizing" (AOT) mode, so that the Checker
+  # stanzas in Main.java will be checked.
+  # Also pass a large JIT code cache size to avoid getting the branch caches GCed.
+  ctx.default_run(
+      args,
+      jit=True,
+      runtime_option=["-Xjitinitialsize:32M"],
+      Xcompiler_option=[
+          "--profile-branches",
+          "--verbose-methods=withBranch"
+      ])
diff --git a/test/850-checker-branches/smali/TestCase.smali b/test/850-checker-branches/smali/TestCase.smali
new file mode 100644
index 0000000..1c9dc50
--- /dev/null
+++ b/test/850-checker-branches/smali/TestCase.smali
@@ -0,0 +1,29 @@
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+.class public LTestCase;
+
+.super Ljava/lang/Object;
+
+## CHECK-START: int TestCase.withBranch(boolean) select_generator (before)
+## CHECK: If true_count:2 false_count:1
+.method public static withBranch(Z)I
+  .registers 2
+  const/4 v0, 0x1
+  if-nez v1, :return_2
+  return v0
+:return_2
+  const/4 v0, 0x2
+  return v0
+.end method
diff --git a/test/850-checker-branches/src/Main.java b/test/850-checker-branches/src/Main.java
new file mode 100644
index 0000000..2bee165
--- /dev/null
+++ b/test/850-checker-branches/src/Main.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.lang.reflect.Method;
+
+class Main {
+  public static void main(String[] args) throws Exception {
+    System.loadLibrary(args[0]);
+    Class<?> cls = Class.forName("TestCase");
+    ensureJitBaselineCompiled(cls, "withBranch");
+    Method m = cls.getDeclaredMethod("withBranch", boolean.class);
+    m.invoke(null, true);
+    m.invoke(null, true);
+    m.invoke(null, false);
+    ensureJitCompiled(cls, "withBranch");
+  }
+
+  public static native void ensureJitBaselineCompiled(Class<?> cls, String methodName);
+  public static native void ensureJitCompiled(Class<?> cls, String methodName);
+}
diff --git a/test/015-switch/Android.bp b/test/851-null-instanceof/Android.bp
similarity index 61%
rename from test/015-switch/Android.bp
rename to test/851-null-instanceof/Android.bp
index 6e66d1e..42efaaa 100644
--- a/test/015-switch/Android.bp
+++ b/test/851-null-instanceof/Android.bp
@@ -1,6 +1,6 @@
 // Generated by `regen-test-files`. Do not edit manually.
 
-// Build rules for ART run-test `015-switch`.
+// Build rules for ART run-test `851-null-instanceof`.
 
 package {
     // See: http://go/android-license-faq
@@ -13,28 +13,28 @@
 
 // Test's Dex code.
 java_test {
-    name: "art-run-test-015-switch",
+    name: "art-run-test-851-null-instanceof",
     defaults: ["art-run-test-defaults"],
     test_config_template: ":art-run-test-target-template",
     srcs: ["src/**/*.java"],
     data: [
-        ":art-run-test-015-switch-expected-stdout",
-        ":art-run-test-015-switch-expected-stderr",
+        ":art-run-test-851-null-instanceof-expected-stdout",
+        ":art-run-test-851-null-instanceof-expected-stderr",
     ],
 }
 
 // Test's expected standard output.
 genrule {
-    name: "art-run-test-015-switch-expected-stdout",
-    out: ["art-run-test-015-switch-expected-stdout.txt"],
+    name: "art-run-test-851-null-instanceof-expected-stdout",
+    out: ["art-run-test-851-null-instanceof-expected-stdout.txt"],
     srcs: ["expected-stdout.txt"],
     cmd: "cp -f $(in) $(out)",
 }
 
 // Test's expected standard error.
 genrule {
-    name: "art-run-test-015-switch-expected-stderr",
-    out: ["art-run-test-015-switch-expected-stderr.txt"],
+    name: "art-run-test-851-null-instanceof-expected-stderr",
+    out: ["art-run-test-851-null-instanceof-expected-stderr.txt"],
     srcs: ["expected-stderr.txt"],
     cmd: "cp -f $(in) $(out)",
 }
diff --git a/test/015-switch/expected-stderr.txt b/test/851-null-instanceof/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/851-null-instanceof/expected-stderr.txt
diff --git a/test/015-switch/expected-stderr.txt b/test/851-null-instanceof/expected-stdout.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/851-null-instanceof/expected-stdout.txt
diff --git a/test/851-null-instanceof/info.txt b/test/851-null-instanceof/info.txt
new file mode 100644
index 0000000..00cec22
--- /dev/null
+++ b/test/851-null-instanceof/info.txt
@@ -0,0 +1,3 @@
+Regression test for the verifier which used to needlessly cast a dex register
+containing null to a type, and then fail when using that dex register with an
+unrelated type.
diff --git a/test/851-null-instanceof/src/Main.java b/test/851-null-instanceof/src/Main.java
new file mode 100644
index 0000000..a303310
--- /dev/null
+++ b/test/851-null-instanceof/src/Main.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class Main {
+
+  static class A {}
+
+  static class B extends A {
+    void foo() {}
+  }
+
+  public static void main(String[] args) {
+    B b = System.currentTimeMillis() == 0 ? null : new B();
+    if (b instanceof A) {
+      b.foo();
+    }
+  }
+}
diff --git a/test/015-switch/expected-stderr.txt b/test/852-invoke-super/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/852-invoke-super/expected-stderr.txt
diff --git a/test/015-switch/expected-stderr.txt b/test/852-invoke-super/expected-stdout.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/852-invoke-super/expected-stdout.txt
diff --git a/test/852-invoke-super/info.txt b/test/852-invoke-super/info.txt
new file mode 100644
index 0000000..38447d4
--- /dev/null
+++ b/test/852-invoke-super/info.txt
@@ -0,0 +1 @@
+Regression test on checking argument types for unresolved invoke-super.
diff --git a/test/852-invoke-super/smali/invoke-super.smali b/test/852-invoke-super/smali/invoke-super.smali
new file mode 100644
index 0000000..6fb9c35
--- /dev/null
+++ b/test/852-invoke-super/smali/invoke-super.smali
@@ -0,0 +1,31 @@
+#
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+.class public LZ;
+.super LA;
+
+.method public constructor <init>()V
+.registers 1
+    invoke-direct {v0}, LA;-><init>()V
+    return-void
+.end method
+
+.method public foo()V
+.registers 3
+    new-instance v0, LY;
+    invoke-direct {v0}, LY;-><init>()V
+    invoke-super {v0, v0}, LY;->foo()V
+    return-void
+.end method
diff --git a/test/852-invoke-super/src/Main.java b/test/852-invoke-super/src/Main.java
new file mode 100644
index 0000000..317dde5
--- /dev/null
+++ b/test/852-invoke-super/src/Main.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+class A {
+  public void foo() { }
+}
+
+class Y extends A {
+  public void foo() { super.foo(); }
+}
+
+public class Main {
+
+  public static void main(String[] args) throws Exception {
+    try {
+      Class.forName("Z");
+      throw new Error("Expected VerifyError");
+    } catch (VerifyError e) {
+      // Expected.
+    }
+  }
+}
diff --git a/test/853-checker-inlining/Android.bp b/test/853-checker-inlining/Android.bp
new file mode 100644
index 0000000..f093855
--- /dev/null
+++ b/test/853-checker-inlining/Android.bp
@@ -0,0 +1,43 @@
+// Generated by `regen-test-files`. Do not edit manually.
+
+// Build rules for ART run-test `853-checker-inlining`.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+// Test's Dex code.
+java_test {
+    name: "art-run-test-853-checker-inlining",
+    defaults: ["art-run-test-defaults"],
+    test_config_template: ":art-run-test-target-template",
+    srcs: ["src/**/*.java"],
+    data: [
+        ":art-run-test-853-checker-inlining-expected-stdout",
+        ":art-run-test-853-checker-inlining-expected-stderr",
+    ],
+    // Include the Java source files in the test's artifacts, to make Checker assertions
+    // available to the TradeFed test runner.
+    include_srcs: true,
+}
+
+// Test's expected standard output.
+genrule {
+    name: "art-run-test-853-checker-inlining-expected-stdout",
+    out: ["art-run-test-853-checker-inlining-expected-stdout.txt"],
+    srcs: ["expected-stdout.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
+
+// Test's expected standard error.
+genrule {
+    name: "art-run-test-853-checker-inlining-expected-stderr",
+    out: ["art-run-test-853-checker-inlining-expected-stderr.txt"],
+    srcs: ["expected-stderr.txt"],
+    cmd: "cp -f $(in) $(out)",
+}
diff --git a/test/015-switch/expected-stderr.txt b/test/853-checker-inlining/expected-stderr.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/853-checker-inlining/expected-stderr.txt
diff --git a/test/015-switch/expected-stderr.txt b/test/853-checker-inlining/expected-stdout.txt
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to test/853-checker-inlining/expected-stdout.txt
diff --git a/test/853-checker-inlining/info.txt b/test/853-checker-inlining/info.txt
new file mode 100644
index 0000000..a74b240
--- /dev/null
+++ b/test/853-checker-inlining/info.txt
@@ -0,0 +1,2 @@
+Test that we can inline when receiver type isn't exact, but the resolved method
+is final.
diff --git a/test/853-checker-inlining/src/Main.java b/test/853-checker-inlining/src/Main.java
new file mode 100644
index 0000000..8b65f5c
--- /dev/null
+++ b/test/853-checker-inlining/src/Main.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+class Square {
+  public int foo() { return 0; }
+}
+
+class Circle extends Square {
+  @Override
+  public final int foo() { return 42; }
+}
+
+public class Main {
+  public static void assertEquals(int expected, int actual) {
+    if (expected != actual) {
+      throw new Error("Expected " + expected + ", got " + actual);
+    }
+  }
+
+  public static void main(String[] args) {
+    assertEquals(42, square(new Circle()));
+    assertEquals(42, circle(new Circle()));
+  }
+
+  /// CHECK-START: int Main.square(Circle) inliner (before)
+  /// CHECK: InvokeVirtual
+
+  /// CHECK-START: int Main.square(Circle) inliner (after)
+  /// CHECK-NOT: InvokeVirtual
+  static int square(Circle c) {
+    Square s = c;
+    return s.foo();
+  }
+
+  /// CHECK-START: int Main.circle(Circle) inliner (before)
+  /// CHECK: InvokeVirtual
+
+  /// CHECK-START: int Main.circle(Circle) inliner (after)
+  /// CHECK-NOT: InvokeVirtual
+  static int circle(Circle c) {
+    Circle s = c;
+    return s.foo();
+  }
+}
diff --git a/test/900-hello-plugin/load_unload.cc b/test/900-hello-plugin/load_unload.cc
index 7121d10..1d83d09 100644
--- a/test/900-hello-plugin/load_unload.cc
+++ b/test/900-hello-plugin/load_unload.cc
@@ -30,7 +30,7 @@
 constexpr uintptr_t ENV_VALUE = 900;
 
 // Allow this library to be used as a plugin too so we can test the stack.
-static jint GetEnvHandler(JavaVMExt* vm ATTRIBUTE_UNUSED, void** new_env, jint version) {
+static jint GetEnvHandler([[maybe_unused]] JavaVMExt* vm, void** new_env, jint version) {
   printf("%s called in test 900\n", __func__);
   if (version != TEST_900_ENV_VERSION_NUMBER) {
     return JNI_EVERSION;
@@ -53,7 +53,7 @@
 
 extern "C" JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM* vm,
                                                char* options,
-                                               void* reserved ATTRIBUTE_UNUSED) {
+                                               [[maybe_unused]] void* reserved) {
   printf("Agent_OnLoad called with options \"%s\"\n", options);
   if (strcmp("test_900_round_2", options) == 0) {
     return 0;
@@ -67,7 +67,7 @@
   return 0;
 }
 
-extern "C" JNIEXPORT void JNICALL Agent_OnUnload(JavaVM* vm ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT void JNICALL Agent_OnUnload([[maybe_unused]] JavaVM* vm) {
   printf("Agent_OnUnload called\n");
 }
 
diff --git a/test/901-hello-ti-agent/basics.cc b/test/901-hello-ti-agent/basics.cc
index 43a1d83..59212de 100644
--- a/test/901-hello-ti-agent/basics.cc
+++ b/test/901-hello-ti-agent/basics.cc
@@ -44,14 +44,14 @@
   return out;
 }
 
-static void JNICALL VMStartCallback(jvmtiEnv *jenv, JNIEnv* jni_env ATTRIBUTE_UNUSED) {
+static void JNICALL VMStartCallback(jvmtiEnv *jenv, [[maybe_unused]] JNIEnv* jni_env) {
   printf("VMStart (phase %d)\n", getPhase(jenv));
   fsync(1);
 }
 
 static void JNICALL VMInitCallback(jvmtiEnv *jvmti_env,
-                                   JNIEnv* jni_env ATTRIBUTE_UNUSED,
-                                   jthread thread ATTRIBUTE_UNUSED) {
+                                   [[maybe_unused]] JNIEnv* jni_env,
+                                   [[maybe_unused]] jthread thread) {
   printf("VMInit (phase %d)\n", getPhase(jvmti_env));
   fsync(1);
 }
@@ -83,8 +83,8 @@
 }
 
 jint OnLoad(JavaVM* vm,
-            char* options ATTRIBUTE_UNUSED,
-            void* reserved ATTRIBUTE_UNUSED) {
+            [[maybe_unused]] char* options,
+            [[maybe_unused]] void* reserved) {
   printf("Loaded Agent for test 901-hello-ti-agent\n");
   fsync(1);
   jvmtiEnv* env = nullptr;
@@ -157,14 +157,14 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test901_setVerboseFlag(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jint iflag, jboolean val) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jint iflag, jboolean val) {
   jvmtiVerboseFlag flag = static_cast<jvmtiVerboseFlag>(iflag);
   jvmtiError result = jvmti_env->SetVerboseFlag(flag, val);
   JvmtiErrorToException(env, jvmti_env, result);
 }
 
 extern "C" JNIEXPORT jboolean JNICALL Java_art_Test901_checkLivePhase(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass) {
   jvmtiPhase current_phase;
   jvmtiError phase_result = jvmti_env->GetPhase(&current_phase);
   if (JvmtiErrorToException(env, jvmti_env, phase_result)) {
@@ -180,7 +180,7 @@
 }
 
 extern "C" JNIEXPORT jboolean JNICALL Java_art_Test901_checkUnattached(
-    JNIEnv* env ATTRIBUTE_UNUSED, jclass Main_klass) {
+    [[maybe_unused]] JNIEnv* env, jclass Main_klass) {
   jvmtiError res = JVMTI_ERROR_NONE;
   std::thread t1(CallJvmtiFunction, jvmti_env, Main_klass, &res);
   t1.join();
@@ -188,7 +188,7 @@
 }
 
 extern "C" JNIEXPORT jstring JNICALL Java_art_Test901_getErrorName(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jint error) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jint error) {
   char* name;
   jvmtiError res = jvmti_env->GetErrorName(static_cast<jvmtiError>(error), &name);
   if (JvmtiErrorToException(env, jvmti_env, res)) {
diff --git a/test/903-hello-tagging/tagging.cc b/test/903-hello-tagging/tagging.cc
index e0a0136..a5eb49c 100644
--- a/test/903-hello-tagging/tagging.cc
+++ b/test/903-hello-tagging/tagging.cc
@@ -134,7 +134,7 @@
 }
 
 extern "C" JNIEXPORT jlongArray JNICALL Java_art_Test903_testTagsInDifferentEnvs(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject obj, jlong base_tag, jint count) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject obj, jlong base_tag, jint count) {
   std::unique_ptr<jvmtiEnv*[]> envs = std::unique_ptr<jvmtiEnv*[]>(new jvmtiEnv*[count]);
   envs[0] = jvmti_env;
   for (int32_t i = 1; i != count; ++i) {
diff --git a/test/904-object-allocation/tracking.cc b/test/904-object-allocation/tracking.cc
index abb6083..4b14932 100644
--- a/test/904-object-allocation/tracking.cc
+++ b/test/904-object-allocation/tracking.cc
@@ -84,7 +84,7 @@
 static std::mutex gEventsMutex;
 static std::vector<EventLog> gEvents;
 
-static void JNICALL ObjectAllocated(jvmtiEnv* ti_env ATTRIBUTE_UNUSED,
+static void JNICALL ObjectAllocated([[maybe_unused]] jvmtiEnv* ti_env,
                                     JNIEnv* jni_env,
                                     jthread thread,
                                     jobject object,
@@ -99,7 +99,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test904_setupObjectAllocCallback(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jboolean enable) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jboolean enable) {
   env->GetJavaVM(&vm);
   jvmtiEventCallbacks callbacks;
   memset(&callbacks, 0, sizeof(jvmtiEventCallbacks));
@@ -119,7 +119,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test904_getTrackingEventMessages(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jobjectArray threads) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jobjectArray threads) {
   std::lock_guard<std::mutex> guard(gEventsMutex);
   std::vector<std::string> real_events;
   std::vector<jthread> thread_lst;
diff --git a/test/905-object-free/tracking_free.cc b/test/905-object-free/tracking_free.cc
index d85d9d3..ae93322 100644
--- a/test/905-object-free/tracking_free.cc
+++ b/test/905-object-free/tracking_free.cc
@@ -64,7 +64,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test905_setupObjectFreeCallback(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass klass) {
   setupObjectFreeCallback(env, jvmti_env, ObjectFree1);
   JavaVM* jvm = nullptr;
   env->GetJavaVM(&jvm);
@@ -74,7 +74,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test905_enableFreeTracking(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jboolean enable) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jboolean enable) {
   jvmtiError ret = jvmti_env->SetEventNotificationMode(
       enable ? JVMTI_ENABLE : JVMTI_DISABLE,
       JVMTI_EVENT_OBJECT_FREE,
@@ -90,7 +90,7 @@
 }
 
 extern "C" JNIEXPORT jlongArray JNICALL Java_art_Test905_getCollectedTags(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jint index) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jint index) {
   std::lock_guard<std::mutex> mu((index == 0) ? ct1_mutex : ct2_mutex);
   std::vector<jlong>& tags = (index == 0) ? collected_tags1 : collected_tags2;
   jlongArray ret = env->NewLongArray(tags.size());
@@ -105,7 +105,7 @@
 }
 
 extern "C" JNIEXPORT jlong JNICALL Java_art_Test905_getTag2(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject obj) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject obj) {
   jlong tag;
   jvmtiError ret = jvmti_env2->GetTag(obj, &tag);
   JvmtiErrorToException(env, jvmti_env, ret);
@@ -113,7 +113,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test905_setTag2(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject obj, jlong tag) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject obj, jlong tag) {
   jvmtiError ret = jvmti_env2->SetTag(obj, tag);
   JvmtiErrorToException(env, jvmti_env, ret);
 }
diff --git a/test/906-iterate-heap/iterate_heap.cc b/test/906-iterate-heap/iterate_heap.cc
index f0a6624..b226eb0 100644
--- a/test/906-iterate-heap/iterate_heap.cc
+++ b/test/906-iterate-heap/iterate_heap.cc
@@ -73,7 +73,7 @@
 
 extern "C" JNIEXPORT jint JNICALL Java_art_Test906_iterateThroughHeapCount(
     JNIEnv* env,
-    jclass klass ATTRIBUTE_UNUSED,
+    [[maybe_unused]] jclass klass,
     jint heap_filter,
     jclass klass_filter,
     jint stop_after) {
@@ -84,10 +84,10 @@
           stop_after(_stop_after) {
     }
 
-    jint Handle(jlong class_tag ATTRIBUTE_UNUSED,
-                jlong size ATTRIBUTE_UNUSED,
-                jlong* tag_ptr ATTRIBUTE_UNUSED,
-                jint length ATTRIBUTE_UNUSED) override {
+    jint Handle([[maybe_unused]] jlong class_tag,
+                [[maybe_unused]] jlong size,
+                [[maybe_unused]] jlong* tag_ptr,
+                [[maybe_unused]] jint length) override {
       counter++;
       if (counter == stop_after) {
         return JVMTI_VISIT_ABORT;
@@ -111,7 +111,7 @@
 
 extern "C" JNIEXPORT jint JNICALL Java_art_Test906_iterateThroughHeapData(
     JNIEnv* env,
-    jclass klass ATTRIBUTE_UNUSED,
+    [[maybe_unused]] jclass klass,
     jint heap_filter,
     jclass klass_filter,
     jlongArray class_tags,
@@ -156,15 +156,15 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test906_iterateThroughHeapAdd(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jint heap_filter, jclass klass_filter) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jint heap_filter, jclass klass_filter) {
   class AddIterationConfig : public IterationConfig {
    public:
     AddIterationConfig() {}
 
-    jint Handle(jlong class_tag ATTRIBUTE_UNUSED,
-                jlong size ATTRIBUTE_UNUSED,
+    jint Handle([[maybe_unused]] jlong class_tag,
+                [[maybe_unused]] jlong size,
                 jlong* tag_ptr,
-                jint length ATTRIBUTE_UNUSED) override {
+                [[maybe_unused]] jint length) override {
       jlong current_tag = *tag_ptr;
       if (current_tag != 0) {
         *tag_ptr = current_tag + 10;
@@ -178,15 +178,15 @@
 }
 
 extern "C" JNIEXPORT jstring JNICALL Java_art_Test906_iterateThroughHeapString(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jlong tag) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jlong tag) {
   struct FindStringCallbacks {
     explicit FindStringCallbacks(jlong t) : tag_to_find(t) {}
 
-    static jint JNICALL HeapIterationCallback(jlong class_tag ATTRIBUTE_UNUSED,
-                                              jlong size ATTRIBUTE_UNUSED,
-                                              jlong* tag_ptr ATTRIBUTE_UNUSED,
-                                              jint length ATTRIBUTE_UNUSED,
-                                              void* user_data ATTRIBUTE_UNUSED) {
+    static jint JNICALL HeapIterationCallback([[maybe_unused]] jlong class_tag,
+                                              [[maybe_unused]] jlong size,
+                                              [[maybe_unused]] jlong* tag_ptr,
+                                              [[maybe_unused]] jint length,
+                                              [[maybe_unused]] void* user_data) {
       return 0;
     }
 
@@ -234,15 +234,15 @@
 }
 
 extern "C" JNIEXPORT jstring JNICALL Java_art_Test906_iterateThroughHeapPrimitiveArray(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jlong tag) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jlong tag) {
   struct FindArrayCallbacks {
     explicit FindArrayCallbacks(jlong t) : tag_to_find(t) {}
 
-    static jint JNICALL HeapIterationCallback(jlong class_tag ATTRIBUTE_UNUSED,
-                                              jlong size ATTRIBUTE_UNUSED,
-                                              jlong* tag_ptr ATTRIBUTE_UNUSED,
-                                              jint length ATTRIBUTE_UNUSED,
-                                              void* user_data ATTRIBUTE_UNUSED) {
+    static jint JNICALL HeapIterationCallback([[maybe_unused]] jlong class_tag,
+                                              [[maybe_unused]] jlong size,
+                                              [[maybe_unused]] jlong* tag_ptr,
+                                              [[maybe_unused]] jint length,
+                                              [[maybe_unused]] void* user_data) {
       return 0;
     }
 
@@ -345,15 +345,15 @@
 }
 
 extern "C" JNIEXPORT jstring JNICALL Java_art_Test906_iterateThroughHeapPrimitiveFields(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jlong tag) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jlong tag) {
   struct FindFieldCallbacks {
     explicit FindFieldCallbacks(jlong t) : tag_to_find(t) {}
 
-    static jint JNICALL HeapIterationCallback(jlong class_tag ATTRIBUTE_UNUSED,
-                                              jlong size ATTRIBUTE_UNUSED,
-                                              jlong* tag_ptr ATTRIBUTE_UNUSED,
-                                              jint length ATTRIBUTE_UNUSED,
-                                              void* user_data ATTRIBUTE_UNUSED) {
+    static jint JNICALL HeapIterationCallback([[maybe_unused]] jlong class_tag,
+                                              [[maybe_unused]] jlong size,
+                                              [[maybe_unused]] jlong* tag_ptr,
+                                              [[maybe_unused]] jint length,
+                                              [[maybe_unused]] void* user_data) {
       return 0;
     }
 
diff --git a/test/907-get-loaded-classes/get_loaded_classes.cc b/test/907-get-loaded-classes/get_loaded_classes.cc
index 87c98e1..58addd1 100644
--- a/test/907-get-loaded-classes/get_loaded_classes.cc
+++ b/test/907-get-loaded-classes/get_loaded_classes.cc
@@ -41,7 +41,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test907_getLoadedClasses(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass klass) {
   jint count = -1;
   jclass* classes = nullptr;
   jvmtiError result = jvmti_env->GetLoadedClasses(&count, &classes);
diff --git a/test/908-gc-start-finish/gc_callbacks.cc b/test/908-gc-start-finish/gc_callbacks.cc
index ddd2ba7..e839a22 100644
--- a/test/908-gc-start-finish/gc_callbacks.cc
+++ b/test/908-gc-start-finish/gc_callbacks.cc
@@ -32,16 +32,16 @@
 static size_t starts = 0;
 static size_t finishes = 0;
 
-static void JNICALL GarbageCollectionFinish(jvmtiEnv* ti_env ATTRIBUTE_UNUSED) {
+static void JNICALL GarbageCollectionFinish([[maybe_unused]] jvmtiEnv* ti_env) {
   finishes++;
 }
 
-static void JNICALL GarbageCollectionStart(jvmtiEnv* ti_env ATTRIBUTE_UNUSED) {
+static void JNICALL GarbageCollectionStart([[maybe_unused]] jvmtiEnv* ti_env) {
   starts++;
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test908_setupGcCallback(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass klass) {
   jvmtiEventCallbacks callbacks;
   memset(&callbacks, 0, sizeof(jvmtiEventCallbacks));
   callbacks.GarbageCollectionFinish = GarbageCollectionFinish;
@@ -52,7 +52,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test908_enableGcTracking(JNIEnv* env,
-                                                                    jclass klass ATTRIBUTE_UNUSED,
+                                                                    [[maybe_unused]] jclass klass,
                                                                     jboolean enable) {
   jvmtiError ret = jvmti_env->SetEventNotificationMode(
       enable ? JVMTI_ENABLE : JVMTI_DISABLE,
@@ -70,15 +70,15 @@
   }
 }
 
-extern "C" JNIEXPORT jint JNICALL Java_art_Test908_getGcStarts(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                               jclass klass ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT jint JNICALL Java_art_Test908_getGcStarts([[maybe_unused]] JNIEnv* env,
+                                                               [[maybe_unused]] jclass klass) {
   jint result = static_cast<jint>(starts);
   starts = 0;
   return result;
 }
 
-extern "C" JNIEXPORT jint JNICALL Java_art_Test908_getGcFinishes(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                                 jclass klass ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT jint JNICALL Java_art_Test908_getGcFinishes([[maybe_unused]] JNIEnv* env,
+                                                                 [[maybe_unused]] jclass klass) {
   jint result = static_cast<jint>(finishes);
   finishes = 0;
   return result;
diff --git a/test/909-attach-agent/attach.cc b/test/909-attach-agent/attach.cc
index 50ab26a..56d6c0f 100644
--- a/test/909-attach-agent/attach.cc
+++ b/test/909-attach-agent/attach.cc
@@ -35,8 +35,8 @@
 static constexpr jint kArtTiVersion = JVMTI_VERSION_1_2 | 0x40000000;
 
 jint OnAttach(JavaVM* vm,
-            char* options ATTRIBUTE_UNUSED,
-            void* reserved ATTRIBUTE_UNUSED) {
+            [[maybe_unused]] char* options,
+            [[maybe_unused]] void* reserved) {
   Println("Attached Agent for test 909-attach-agent");
   jvmtiEnv* env = nullptr;
   jvmtiEnv* env2 = nullptr;
diff --git a/test/909-attach-agent/run.py b/test/909-attach-agent/run.py
index b5e2337..f1742c2 100644
--- a/test/909-attach-agent/run.py
+++ b/test/909-attach-agent/run.py
@@ -19,29 +19,11 @@
   agent = "libtiagent.so" if args.O else "libtiagentd.so"
   plugin = "libopenjdkjvmti.so" if args.O else "libopenjdkjvmtid.so"
 
-  if args.interpreter:
-    # On interpreter we are fully capable of providing the full jvmti api so we
+  if args.switch_interpreter:
+    # On switch interpreter we are fully capable of providing the full jvmti api so we
     # have a slightly different expected output.
     ctx.expected_stdout = ctx.expected_stdout.with_suffix(".interpreter.txt")
 
-  # Provide additional runtime options when running on device.
-  if not args.host:
-    for i, opt in enumerate(args.runtime_option):
-      if opt.startswith("-Djava.library.path="):
-        libpath = opt.split("=")[-1]
-        assert libpath.startswith("/data/nativetest"), libpath
-
-        # The linker configuration used for dalvikvm(64) in the ART APEX requires us
-        # to pass the full path to the agent to the runtime when running on device.
-        agent = f"{libpath}/{agent}"
-
-        # The above agent path is an absolute one; append the root directory to the
-        # library path so that the agent can be found via the `java.library.path`
-        # system property (see method `Main.find` in
-        # test/909-attach-agent/src-art/Main.java).
-        args.runtime_option[i] += ":/"
-        break
-
   ctx.default_run(
       args,
       android_runtime_option=[
@@ -49,7 +31,12 @@
       ],
       test_args=[f"agent:{agent}=909-attach-agent"])
 
-  ctx.default_run(args, test_args=[f"agent:{agent}=909-attach-agent"])
+  ctx.default_run(
+      args,
+      android_runtime_option=[
+          f"-Xcompiler-option", "--debuggable"
+      ],
+      test_args=[f"agent:{agent}=909-attach-agent"])
 
   ctx.default_run(
       args,
diff --git a/test/909-attach-agent/src-art/Main.java b/test/909-attach-agent/src-art/Main.java
index 1f823bd..b6d1e2a 100644
--- a/test/909-attach-agent/src-art/Main.java
+++ b/test/909-attach-agent/src-art/Main.java
@@ -56,65 +56,14 @@
   private static void attachWithClassLoader(String[] args) throws Exception {
     for(String a : args) {
       if(a.startsWith("agent:")) {
-        String agentName = a.substring(6, a.indexOf('='));
-        File tmp = null;
         try {
-          tmp = File.createTempFile("lib", ".so");
-          prepare(agentName, tmp);
-
-          String newAgentName = tmp.getName();
-          String agent = a.substring(6).replace(agentName, newAgentName);
-
-          ClassLoader cl = new PathClassLoader("", tmp.getParentFile().getAbsolutePath(),
-              Main.class.getClassLoader());
-          try {
-            VMDebug.attachAgent(agent, cl);
-          } catch(SecurityException e) {
-            System.out.println(e.getMessage());
-          }
+          VMDebug.attachAgent(a.substring(6), Main.class.getClassLoader());
+        } catch(SecurityException e) {
+          System.out.println(e.getMessage());
         } catch (Exception e) {
           e.printStackTrace(System.out);
-        } finally {
-          if (tmp != null) {
-            tmp.delete();
-          }
         }
       }
     }
   }
-
-  private static void prepare(String in, File tmp) throws Exception {
-    // Find the original.
-    File orig = find(in);
-    if (orig == null) {
-      throw new RuntimeException("Could not find " + in);
-    }
-    // Copy the original.
-    {
-      BufferedInputStream bis = new BufferedInputStream(new FileInputStream(orig));
-      BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(tmp));
-      byte[] buf = new byte[16 * 1024];
-      for (;;) {
-        int r = bis.read(buf, 0, buf.length);
-        if (r < 0) {
-          break;
-        } else if (r > 0) {
-          bos.write(buf, 0, r);
-        }
-      }
-      bos.close();
-      bis.close();
-    }
-  }
-
-  private static File find(String in) {
-    String libraryPath = System.getProperty("java.library.path");
-    for (String path : libraryPath.split(":")) {
-      File f = new File(path + "/" + in);
-      if (f.exists()) {
-        return f;
-      }
-    }
-    return null;
-  }
 }
diff --git a/test/910-methods/methods.cc b/test/910-methods/methods.cc
index 9c726e1..473e875 100644
--- a/test/910-methods/methods.cc
+++ b/test/910-methods/methods.cc
@@ -31,7 +31,7 @@
 namespace Test910Methods {
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test910_getMethodName(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject method) {
   jmethodID id = env->FromReflectedMethod(method);
 
   char* name;
@@ -74,7 +74,7 @@
 }
 
 extern "C" JNIEXPORT jclass JNICALL Java_art_Test910_getMethodDeclaringClass(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject method) {
   jmethodID id = env->FromReflectedMethod(method);
 
   jclass declaring_class;
@@ -87,7 +87,7 @@
 }
 
 extern "C" JNIEXPORT jint JNICALL Java_art_Test910_getMethodModifiers(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject method) {
   jmethodID id = env->FromReflectedMethod(method);
 
   jint modifiers;
@@ -100,7 +100,7 @@
 }
 
 extern "C" JNIEXPORT jint JNICALL Java_art_Test910_getMaxLocals(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject method) {
   jmethodID id = env->FromReflectedMethod(method);
 
   jint max_locals;
@@ -113,7 +113,7 @@
 }
 
 extern "C" JNIEXPORT jint JNICALL Java_art_Test910_getArgumentsSize(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject method) {
   jmethodID id = env->FromReflectedMethod(method);
 
   jint arguments;
@@ -126,7 +126,7 @@
 }
 
 extern "C" JNIEXPORT jlong JNICALL Java_art_Test910_getMethodLocationStart(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject method) {
   jmethodID id = env->FromReflectedMethod(method);
 
   jlong start;
@@ -140,7 +140,7 @@
 }
 
 extern "C" JNIEXPORT jlong JNICALL Java_art_Test910_getMethodLocationEnd(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject method) {
   jmethodID id = env->FromReflectedMethod(method);
 
   jlong start;
@@ -154,7 +154,7 @@
 }
 
 extern "C" JNIEXPORT jboolean JNICALL Java_art_Test910_isMethodNative(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject method) {
   jmethodID id = env->FromReflectedMethod(method);
 
   jboolean is_native;
@@ -167,7 +167,7 @@
 }
 
 extern "C" JNIEXPORT jboolean JNICALL Java_art_Test910_isMethodObsolete(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject method) {
   jmethodID id = env->FromReflectedMethod(method);
 
   jboolean is_obsolete;
@@ -180,7 +180,7 @@
 }
 
 extern "C" JNIEXPORT jboolean JNICALL Java_art_Test910_isMethodSynthetic(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject method) {
   jmethodID id = env->FromReflectedMethod(method);
 
   jboolean is_synthetic;
diff --git a/test/911-get-stack-trace/expected-cts-version.txt b/test/911-get-stack-trace/expected-cts-version.txt
index 25f29aa..88c0afd 100644
--- a/test/911-get-stack-trace/expected-cts-version.txt
+++ b/test/911-get-stack-trace/expected-cts-version.txt
@@ -79,8 +79,8 @@
 From top
 ---------
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -99,8 +99,8 @@
  foo (IIILart/ControlData;)I 0 21
  run ()V 4 28
 ---------
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -120,14 +120,14 @@
  run ()V 4 28
 ---------
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
  foo (IIILart/ControlData;)I 0 21
 ---------
- wait ()V 2 524
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -135,7 +135,7 @@
  baz (IIILart/ControlData;)Ljava/lang/Object; 8 34
  bar (IIILart/ControlData;)J 0 26
 ---------
- wait ()V 2 524
+ wait ()V 2 543
 From bottom
 ---------
  run ()V 4 28
@@ -251,8 +251,8 @@
 ---------
 ThreadListTraces Thread 0
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -261,8 +261,8 @@
 ---------
 ThreadListTraces Thread 2
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -271,8 +271,8 @@
 ---------
 ThreadListTraces Thread 4
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -281,8 +281,8 @@
 ---------
 ThreadListTraces Thread 6
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -291,8 +291,8 @@
 ---------
 ThreadListTraces Thread 8
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -308,8 +308,8 @@
 ---------
 ThreadListTraces Thread 0
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -331,8 +331,8 @@
 ---------
 ThreadListTraces Thread 2
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -354,8 +354,8 @@
 ---------
 ThreadListTraces Thread 4
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -377,8 +377,8 @@
 ---------
 ThreadListTraces Thread 6
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -400,8 +400,8 @@
 ---------
 ThreadListTraces Thread 8
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
diff --git a/test/911-get-stack-trace/expected-stdout.txt b/test/911-get-stack-trace/expected-stdout.txt
index 1109b3f..fac1845 100644
--- a/test/911-get-stack-trace/expected-stdout.txt
+++ b/test/911-get-stack-trace/expected-stdout.txt
@@ -79,8 +79,8 @@
 From top
 ---------
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -99,8 +99,8 @@
  foo (IIILart/ControlData;)I 0 21
  run ()V 4 28
 ---------
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -120,14 +120,14 @@
  run ()V 4 28
 ---------
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
  foo (IIILart/ControlData;)I 0 21
 ---------
- wait ()V 2 524
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -135,7 +135,7 @@
  baz (IIILart/ControlData;)Ljava/lang/Object; 8 34
  bar (IIILart/ControlData;)J 0 26
 ---------
- wait ()V 2 524
+ wait ()V 2 543
 From bottom
 ---------
  run ()V 4 28
@@ -276,8 +276,8 @@
 ---------
 AllTraces Thread 0
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -286,8 +286,8 @@
 ---------
 AllTraces Thread 1
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -296,8 +296,8 @@
 ---------
 AllTraces Thread 2
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -306,8 +306,8 @@
 ---------
 AllTraces Thread 3
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -316,8 +316,8 @@
 ---------
 AllTraces Thread 4
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -326,8 +326,8 @@
 ---------
 AllTraces Thread 5
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -336,8 +336,8 @@
 ---------
 AllTraces Thread 6
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -346,8 +346,8 @@
 ---------
 AllTraces Thread 7
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -356,8 +356,8 @@
 ---------
 AllTraces Thread 8
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -366,8 +366,8 @@
 ---------
 AllTraces Thread 9
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -392,7 +392,7 @@
 Test911
  getAllStackTraces (I)[[Ljava/lang/Object; -1 -2
  printAll (I)V 0 75
- doTest ()V 120 59
+ doTest ()V 122 59
  run ()V 28 44
 
 ---------
@@ -401,8 +401,8 @@
 ---------
 AllTraces Thread 0
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -424,8 +424,8 @@
 ---------
 AllTraces Thread 1
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -447,8 +447,8 @@
 ---------
 AllTraces Thread 2
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -470,8 +470,8 @@
 ---------
 AllTraces Thread 3
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -493,8 +493,8 @@
 ---------
 AllTraces Thread 4
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -516,8 +516,8 @@
 ---------
 AllTraces Thread 5
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -539,8 +539,8 @@
 ---------
 AllTraces Thread 6
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -562,8 +562,8 @@
 ---------
 AllTraces Thread 7
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -585,8 +585,8 @@
 ---------
 AllTraces Thread 8
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -608,8 +608,8 @@
 ---------
 AllTraces Thread 9
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -647,7 +647,7 @@
 Test911
  getAllStackTraces (I)[[Ljava/lang/Object; -1 -2
  printAll (I)V 0 75
- doTest ()V 125 61
+ doTest ()V 127 61
  run ()V 28 44
 
 ---------
@@ -685,8 +685,8 @@
 ---------
 ThreadListTraces Thread 0
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -695,8 +695,8 @@
 ---------
 ThreadListTraces Thread 2
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -705,8 +705,8 @@
 ---------
 ThreadListTraces Thread 4
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -715,8 +715,8 @@
 ---------
 ThreadListTraces Thread 6
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -725,8 +725,8 @@
 ---------
 ThreadListTraces Thread 8
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -742,8 +742,8 @@
 ---------
 ThreadListTraces Thread 0
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -765,8 +765,8 @@
 ---------
 ThreadListTraces Thread 2
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -788,8 +788,8 @@
 ---------
 ThreadListTraces Thread 4
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -811,8 +811,8 @@
 ---------
 ThreadListTraces Thread 6
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
@@ -834,8 +834,8 @@
 ---------
 ThreadListTraces Thread 8
  wait (JI)V -1 -2
- wait (J)V 1 386
- wait ()V 2 524
+ wait (J)V 1 405
+ wait ()V 2 543
  printOrWait (IILart/ControlData;)V 24 47
  baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
  bar (IIILart/ControlData;)J 0 26
diff --git a/test/911-get-stack-trace/stack_trace.cc b/test/911-get-stack-trace/stack_trace.cc
index 2b620b1..3b8210a 100644
--- a/test/911-get-stack-trace/stack_trace.cc
+++ b/test/911-get-stack-trace/stack_trace.cc
@@ -126,7 +126,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_PrintThread_getStackTrace(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thread, jint start, jint max) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jthread thread, jint start, jint max) {
   std::unique_ptr<jvmtiFrameInfo[]> frames(new jvmtiFrameInfo[max]);
 
   jint count;
@@ -141,7 +141,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_AllTraces_getAllStackTraces(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jint max) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jint max) {
   jint thread_count;
   jvmtiStackInfo* stack_infos;
   {
@@ -169,7 +169,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_ThreadListTraces_getThreadListStackTraces(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobjectArray jthreads, jint max) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobjectArray jthreads, jint max) {
   jint thread_count = env->GetArrayLength(jthreads);
   std::unique_ptr<jthread[]> threads(new jthread[thread_count]);
   for (jint i = 0; i != thread_count; ++i) {
@@ -205,7 +205,7 @@
 }
 
 extern "C" JNIEXPORT jint JNICALL Java_art_Frames_getFrameCount(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thread) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jthread thread) {
   jint count;
   jvmtiError result = jvmti_env->GetFrameCount(thread, &count);
   if (JvmtiErrorToException(env, jvmti_env, result)) {
@@ -215,7 +215,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Frames_getFrameLocation(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thread, jint depth) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jthread thread, jint depth) {
   jmethodID method;
   jlocation location;
 
diff --git a/test/912-classes/classes.cc b/test/912-classes/classes.cc
index ff50223..8fa41f9 100644
--- a/test/912-classes/classes.cc
+++ b/test/912-classes/classes.cc
@@ -37,7 +37,7 @@
 namespace Test912Classes {
 
 extern "C" JNIEXPORT jboolean JNICALL Java_art_Test912_isModifiableClass(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jclass klass) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jclass klass) {
   jboolean res = JNI_FALSE;
   jvmtiError result = jvmti_env->IsModifiableClass(klass, &res);
   JvmtiErrorToException(env, jvmti_env, result);
@@ -45,7 +45,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test912_getClassSignature(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jclass klass) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jclass klass) {
   char* sig;
   char* gen;
   jvmtiError result = jvmti_env->GetClassSignature(klass, &sig, &gen);
@@ -74,7 +74,7 @@
 }
 
 extern "C" JNIEXPORT jboolean JNICALL Java_art_Test912_isInterface(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jclass klass) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jclass klass) {
   jboolean is_interface = JNI_FALSE;
   jvmtiError result = jvmti_env->IsInterface(klass, &is_interface);
   JvmtiErrorToException(env, jvmti_env, result);
@@ -82,7 +82,7 @@
 }
 
 extern "C" JNIEXPORT jboolean JNICALL Java_art_Test912_isArrayClass(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jclass klass) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jclass klass) {
   jboolean is_array_class = JNI_FALSE;
   jvmtiError result = jvmti_env->IsArrayClass(klass, &is_array_class);
   JvmtiErrorToException(env, jvmti_env, result);
@@ -90,7 +90,7 @@
 }
 
 extern "C" JNIEXPORT jint JNICALL Java_art_Test912_getClassModifiers(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jclass klass) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jclass klass) {
   jint mod;
   jvmtiError result = jvmti_env->GetClassModifiers(klass, &mod);
   JvmtiErrorToException(env, jvmti_env, result);
@@ -98,7 +98,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test912_getClassFields(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jclass klass) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jclass klass) {
   jint count = 0;
   jfieldID* fields = nullptr;
   jvmtiError result = jvmti_env->GetClassFields(klass, &count, &fields);
@@ -123,7 +123,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test912_getClassMethods(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jclass klass) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jclass klass) {
   jint count = 0;
   jmethodID* methods = nullptr;
   jvmtiError result = jvmti_env->GetClassMethods(klass, &count, &methods);
@@ -148,7 +148,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test912_getImplementedInterfaces(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jclass klass) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jclass klass) {
   jint count = 0;
   jclass* classes = nullptr;
   jvmtiError result = jvmti_env->GetImplementedInterfaces(klass, &count, &classes);
@@ -167,7 +167,7 @@
 }
 
 extern "C" JNIEXPORT jint JNICALL Java_art_Test912_getClassStatus(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jclass klass) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass , jclass klass) {
   jint status;
   jvmtiError result = jvmti_env->GetClassStatus(klass, &status);
   JvmtiErrorToException(env, jvmti_env, result);
@@ -175,7 +175,7 @@
 }
 
 extern "C" JNIEXPORT jobject JNICALL Java_art_Test912_getClassLoader(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jclass klass) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass , jclass klass) {
   jobject classloader;
   jvmtiError result = jvmti_env->GetClassLoader(klass, &classloader);
   JvmtiErrorToException(env, jvmti_env, result);
@@ -183,7 +183,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test912_getClassLoaderClasses(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jobject jclassloader) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass , jobject jclassloader) {
   jint count = 0;
   jclass* classes = nullptr;
   jvmtiError result = jvmti_env->GetClassLoaderClasses(jclassloader, &count, &classes);
@@ -202,7 +202,7 @@
 }
 
 extern "C" JNIEXPORT jintArray JNICALL Java_art_Test912_getClassVersion(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jclass klass) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass , jclass klass) {
   jint major, minor;
   jvmtiError result = jvmti_env->GetClassVersionNumbers(klass, &minor, &major);
   if (JvmtiErrorToException(env, jvmti_env, result)) {
@@ -280,7 +280,7 @@
 static std::vector<std::string> gEvents;
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test912_getClassLoadMessages(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass) {
   std::lock_guard<std::mutex> guard(gEventsMutex);
   jobjectArray ret = CreateObjectArray(env,
                                        static_cast<jint>(gEvents.size()),
@@ -365,7 +365,7 @@
 std::string ClassLoadPreparePrinter::thread_name_filter_;  // NOLINT [runtime/string] [4]
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test912_enableClassLoadPreparePrintEvents(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jboolean enable, jthread thread) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass , jboolean enable, jthread thread) {
   if (thread != nullptr) {
     ClassLoadPreparePrinter::thread_name_filter_ =
         ClassLoadPreparePrinter::GetThreadName(jvmti_env, env, thread);
@@ -432,7 +432,7 @@
   static constexpr const char* kWeakInitSig = "(Ljava/lang/Object;)V";
   static constexpr const char* kWeakGetSig = "()Ljava/lang/Object;";
 
-  static void AgentThreadTest(jvmtiEnv* jvmti ATTRIBUTE_UNUSED,
+  static void AgentThreadTest([[maybe_unused]] jvmtiEnv* jvmti,
                               JNIEnv* env,
                               jobject* obj_global) {
     jobject target = *obj_global;
@@ -449,7 +449,7 @@
 
   static void JNICALL ClassLoadCallback(jvmtiEnv* jenv,
                                         JNIEnv* jni_env,
-                                        jthread thread ATTRIBUTE_UNUSED,
+                                        [[maybe_unused]] jthread thread,
                                         jclass klass) {
     std::string name = GetClassName(jenv, jni_env, klass);
     if (name == kClassName) {
@@ -470,7 +470,7 @@
 
   static void JNICALL ClassPrepareCallback(jvmtiEnv* jenv,
                                            JNIEnv* jni_env,
-                                           jthread thread ATTRIBUTE_UNUSED,
+                                           [[maybe_unused]] jthread thread,
                                            jclass klass) {
     std::string name = GetClassName(jenv, jni_env, klass);
     if (name == kClassName) {
@@ -577,13 +577,13 @@
 bool ClassLoadPrepareEquality::compared_ = false;
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test912_setEqualityEventStorageClass(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jclass klass) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jclass klass) {
   ClassLoadPrepareEquality::storage_class_ =
       reinterpret_cast<jclass>(env->NewGlobalRef(klass));
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test912_enableClassLoadPrepareEqualityEvents(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jboolean b) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jboolean b) {
   EnableEvents(env,
                b,
                ClassLoadPrepareEquality::ClassLoadCallback,
@@ -599,17 +599,17 @@
 // Global to pass information to the ClassPrepare event.
 static jobject gRunnableGlobal = nullptr;
 extern "C" JNIEXPORT void JNICALL Java_art_Test912_runRecursiveClassPrepareEvents(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject runnable) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject runnable) {
   CHECK(gRunnableGlobal == nullptr);
   gRunnableGlobal = env->NewGlobalRef(runnable);
   EnableEvents(
       env,
       true,
       nullptr,
-      [](jvmtiEnv* jenv ATTRIBUTE_UNUSED,
+      []([[maybe_unused]] jvmtiEnv* jenv,
          JNIEnv* jni_env,
-         jthread thread ATTRIBUTE_UNUSED,
-         jclass klass ATTRIBUTE_UNUSED) -> void {
+         [[maybe_unused]] jthread thread,
+         [[maybe_unused]] jclass klass) -> void {
         jclass runnable_class = jni_env->FindClass("java/lang/Runnable");
         jni_env->CallVoidMethod(
             gRunnableGlobal, jni_env->GetMethodID(runnable_class, "run", "()V"));
diff --git a/test/912-classes/classes_art.cc b/test/912-classes/classes_art.cc
index de2e456..a3b4d94 100644
--- a/test/912-classes/classes_art.cc
+++ b/test/912-classes/classes_art.cc
@@ -75,10 +75,10 @@
 }
 
 struct ClassLoadSeen {
-  static void JNICALL ClassLoadSeenCallback(jvmtiEnv* jenv ATTRIBUTE_UNUSED,
-                                            JNIEnv* jni_env ATTRIBUTE_UNUSED,
-                                            jthread thread ATTRIBUTE_UNUSED,
-                                            jclass klass ATTRIBUTE_UNUSED) {
+  static void JNICALL ClassLoadSeenCallback([[maybe_unused]] jvmtiEnv* jenv,
+                                            [[maybe_unused]] JNIEnv* jni_env,
+                                            [[maybe_unused]] jthread thread,
+                                            [[maybe_unused]] jclass klass) {
     saw_event = true;
   }
 
@@ -87,17 +87,17 @@
 bool ClassLoadSeen::saw_event = false;
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test912Art_enableClassLoadSeenEvents(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jboolean b) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jboolean b) {
   EnableEvents(env, b, ClassLoadSeen::ClassLoadSeenCallback, nullptr);
 }
 
 extern "C" JNIEXPORT jboolean JNICALL Java_art_Test912Art_hadLoadEvent(
-    JNIEnv* env ATTRIBUTE_UNUSED, jclass Main_klass ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass Main_klass) {
   return ClassLoadSeen::saw_event ? JNI_TRUE : JNI_FALSE;
 }
 
 extern "C" JNIEXPORT jboolean JNICALL Java_art_Test912Art_isLoadedClass(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jstring class_name) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jstring class_name) {
   ScopedUtfChars name(env, class_name);
 
   jint class_count;
diff --git a/test/912-classes/expected-stdout.txt b/test/912-classes/expected-stdout.txt
index 787efc5..9f09823 100644
--- a/test/912-classes/expected-stdout.txt
+++ b/test/912-classes/expected-stdout.txt
@@ -1,10 +1,10 @@
 [Ljava/lang/Object;, null]
 1
-[Ljava/lang/String;, Ljava/lang/Object;Ljava/io/Serializable;Ljava/lang/Comparable<Ljava/lang/String;>;Ljava/lang/CharSequence;]
+[Ljava/lang/String;, Ljava/lang/Object;Ljava/io/Serializable;Ljava/lang/Comparable<Ljava/lang/String;>;Ljava/lang/CharSequence;Ljava/lang/constant/Constable;Ljava/lang/constant/ConstantDesc;]
 11
 [Ljava/lang/Math;, null]
 11
-[Ljava/util/List;, <E:Ljava/lang/Object;>Ljava/lang/Object;Ljava/util/Collection<TE;>;]
+[Ljava/util/List;, <E:Ljava/lang/Object;>Ljava/lang/Object;Ljava/util/SequencedCollection<TE;>;Ljava/util/Collection<TE;>;]
 601
 [L$Proxy20;, null]
 11
@@ -23,7 +23,7 @@
 [public static final int java.lang.Integer.BYTES, static final byte[] java.lang.Integer.DigitOnes, static final byte[] java.lang.Integer.DigitTens, public static final int java.lang.Integer.MAX_VALUE, public static final int java.lang.Integer.MIN_VALUE, public static final int java.lang.Integer.SIZE, private static final java.lang.String[] java.lang.Integer.SMALL_NEG_VALUES, private static final java.lang.String[] java.lang.Integer.SMALL_NONNEG_VALUES, public static final java.lang.Class java.lang.Integer.TYPE, static final char[] java.lang.Integer.digits, private static final long java.lang.Integer.serialVersionUID, static final int[] java.lang.Integer.sizeTable, private final int java.lang.Integer.value]
 []
 []
-[java.lang.Integer(), public java.lang.Integer(int), public java.lang.Integer(java.lang.String) throws java.lang.NumberFormatException, public static int java.lang.Integer.bitCount(int), public static int java.lang.Integer.compare(int,int), public static int java.lang.Integer.compareUnsigned(int,int), public static java.lang.Integer java.lang.Integer.decode(java.lang.String) throws java.lang.NumberFormatException, public static int java.lang.Integer.divideUnsigned(int,int), private static void java.lang.Integer.formatUnsignedInt(int,int,byte[],int), static void java.lang.Integer.formatUnsignedInt(int,int,byte[],int,int), static void java.lang.Integer.formatUnsignedInt(int,int,char[],int,int), static int java.lang.Integer.getChars(int,int,byte[]), static int java.lang.Integer.getChars(int,int,char[]), public static java.lang.Integer java.lang.Integer.getInteger(java.lang.String), public static java.lang.Integer java.lang.Integer.getInteger(java.lang.String,int), public static java.lang.Integer java.lang.Integer.getInteger(java.lang.String,java.lang.Integer), public static int java.lang.Integer.hashCode(int), public static int java.lang.Integer.highestOneBit(int), public static int java.lang.Integer.lowestOneBit(int), public static int java.lang.Integer.max(int,int), public static int java.lang.Integer.min(int,int), public static int java.lang.Integer.numberOfLeadingZeros(int), public static int java.lang.Integer.numberOfTrailingZeros(int), public static int java.lang.Integer.parseInt(java.lang.CharSequence,int,int,int) throws java.lang.NumberFormatException, public static int java.lang.Integer.parseInt(java.lang.String) throws java.lang.NumberFormatException, public static int java.lang.Integer.parseInt(java.lang.String,int) throws java.lang.NumberFormatException, public static int java.lang.Integer.parseUnsignedInt(java.lang.CharSequence,int,int,int) throws java.lang.NumberFormatException, public static int java.lang.Integer.parseUnsignedInt(java.lang.String) throws java.lang.NumberFormatException, public static int java.lang.Integer.parseUnsignedInt(java.lang.String,int) throws java.lang.NumberFormatException, public static int java.lang.Integer.remainderUnsigned(int,int), public static int java.lang.Integer.reverse(int), public static int java.lang.Integer.reverseBytes(int), public static int java.lang.Integer.rotateLeft(int,int), public static int java.lang.Integer.rotateRight(int,int), public static int java.lang.Integer.signum(int), static int java.lang.Integer.stringSize(int), public static int java.lang.Integer.sum(int,int), public static java.lang.String java.lang.Integer.toBinaryString(int), public static java.lang.String java.lang.Integer.toHexString(int), public static java.lang.String java.lang.Integer.toOctalString(int), public static java.lang.String java.lang.Integer.toString(int), public static java.lang.String java.lang.Integer.toString(int,int), public static long java.lang.Integer.toUnsignedLong(int), public static java.lang.String java.lang.Integer.toUnsignedString(int), public static java.lang.String java.lang.Integer.toUnsignedString(int,int), private static java.lang.String java.lang.Integer.toUnsignedString0(int,int), public static java.lang.Integer java.lang.Integer.valueOf(int), public static java.lang.Integer java.lang.Integer.valueOf(java.lang.String) throws java.lang.NumberFormatException, public static java.lang.Integer java.lang.Integer.valueOf(java.lang.String,int) throws java.lang.NumberFormatException, public byte java.lang.Integer.byteValue(), public int java.lang.Integer.compareTo(java.lang.Integer), public int java.lang.Integer.compareTo(java.lang.Object), public double java.lang.Integer.doubleValue(), public boolean java.lang.Integer.equals(java.lang.Object), public float java.lang.Integer.floatValue(), public int java.lang.Integer.hashCode(), public int java.lang.Integer.intValue(), public long java.lang.Integer.longValue(), public short java.lang.Integer.shortValue(), public java.lang.String java.lang.Integer.toString()]
+[java.lang.Integer(), public java.lang.Integer(int), public java.lang.Integer(java.lang.String) throws java.lang.NumberFormatException, public static int java.lang.Integer.bitCount(int), public static int java.lang.Integer.compare(int,int), public static int java.lang.Integer.compareUnsigned(int,int), public static java.lang.Integer java.lang.Integer.decode(java.lang.String) throws java.lang.NumberFormatException, public static int java.lang.Integer.divideUnsigned(int,int), private static void java.lang.Integer.formatUnsignedInt(int,int,byte[],int), static void java.lang.Integer.formatUnsignedInt(int,int,byte[],int,int), static void java.lang.Integer.formatUnsignedInt(int,int,char[],int,int), static int java.lang.Integer.getChars(int,int,byte[]), static int java.lang.Integer.getChars(int,int,char[]), public static java.lang.Integer java.lang.Integer.getInteger(java.lang.String), public static java.lang.Integer java.lang.Integer.getInteger(java.lang.String,int), public static java.lang.Integer java.lang.Integer.getInteger(java.lang.String,java.lang.Integer), public static int java.lang.Integer.hashCode(int), public static int java.lang.Integer.highestOneBit(int), public static int java.lang.Integer.lowestOneBit(int), public static int java.lang.Integer.max(int,int), public static int java.lang.Integer.min(int,int), public static int java.lang.Integer.numberOfLeadingZeros(int), public static int java.lang.Integer.numberOfTrailingZeros(int), public static int java.lang.Integer.parseInt(java.lang.CharSequence,int,int,int) throws java.lang.NumberFormatException, public static int java.lang.Integer.parseInt(java.lang.String) throws java.lang.NumberFormatException, public static int java.lang.Integer.parseInt(java.lang.String,int) throws java.lang.NumberFormatException, public static int java.lang.Integer.parseUnsignedInt(java.lang.CharSequence,int,int,int) throws java.lang.NumberFormatException, public static int java.lang.Integer.parseUnsignedInt(java.lang.String) throws java.lang.NumberFormatException, public static int java.lang.Integer.parseUnsignedInt(java.lang.String,int) throws java.lang.NumberFormatException, public static int java.lang.Integer.remainderUnsigned(int,int), public static int java.lang.Integer.reverse(int), public static int java.lang.Integer.reverseBytes(int), public static int java.lang.Integer.rotateLeft(int,int), public static int java.lang.Integer.rotateRight(int,int), public static int java.lang.Integer.signum(int), static int java.lang.Integer.stringSize(int), public static int java.lang.Integer.sum(int,int), public static java.lang.String java.lang.Integer.toBinaryString(int), public static java.lang.String java.lang.Integer.toHexString(int), public static java.lang.String java.lang.Integer.toOctalString(int), public static java.lang.String java.lang.Integer.toString(int), public static java.lang.String java.lang.Integer.toString(int,int), public static long java.lang.Integer.toUnsignedLong(int), public static java.lang.String java.lang.Integer.toUnsignedString(int), public static java.lang.String java.lang.Integer.toUnsignedString(int,int), private static java.lang.String java.lang.Integer.toUnsignedString0(int,int), public static java.lang.Integer java.lang.Integer.valueOf(int), public static java.lang.Integer java.lang.Integer.valueOf(java.lang.String) throws java.lang.NumberFormatException, public static java.lang.Integer java.lang.Integer.valueOf(java.lang.String,int) throws java.lang.NumberFormatException, public byte java.lang.Integer.byteValue(), public int java.lang.Integer.compareTo(java.lang.Integer), public int java.lang.Integer.compareTo(java.lang.Object), public java.util.Optional java.lang.Integer.describeConstable(), public double java.lang.Integer.doubleValue(), public boolean java.lang.Integer.equals(java.lang.Object), public float java.lang.Integer.floatValue(), public int java.lang.Integer.hashCode(), public int java.lang.Integer.intValue(), public long java.lang.Integer.longValue(), public java.lang.Integer java.lang.Integer.resolveConstantDesc(java.lang.invoke.MethodHandles$Lookup), public java.lang.Object java.lang.Integer.resolveConstantDesc(java.lang.invoke.MethodHandles$Lookup) throws java.lang.ReflectiveOperationException, public short java.lang.Integer.shortValue(), public java.lang.String java.lang.Integer.toString()]
 []
 []
 int 100000
diff --git a/test/912-classes/src-art/art/Test912.java b/test/912-classes/src-art/art/Test912.java
index 8e6b75f..56c9364 100644
--- a/test/912-classes/src-art/art/Test912.java
+++ b/test/912-classes/src-art/art/Test912.java
@@ -262,6 +262,7 @@
         "java.util.NoSuchElementException",
         "java.io.FileNotFoundException",  // b/63581208
         "java.util.zip.ZipException",     // b/63581208
+        "sun.invoke.util.Wrapper",        // For "ClassEvents" thread in JIT/no-image config.
     };
     for (String s : PRELOAD_FOR_JIT) {
       Class.forName(s);
diff --git a/test/913-heaps/heaps.cc b/test/913-heaps/heaps.cc
index 671cff8..e4c3223 100644
--- a/test/913-heaps/heaps.cc
+++ b/test/913-heaps/heaps.cc
@@ -48,7 +48,7 @@
 static constexpr const char* kThreadReferree = "3000@0";
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test913_forceGarbageCollection(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass klass) {
   jvmtiError ret = jvmti_env->ForceGarbageCollection();
   JvmtiErrorToException(env, jvmti_env, ret);
 }
@@ -68,7 +68,7 @@
 // Register a class (or general object) in the class-data map. The serial number is determined by
 // the order of calls to this function (so stable Java code leads to stable numbering).
 extern "C" JNIEXPORT void JNICALL Java_art_Test913_registerClass(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jlong tag, jobject obj) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jlong tag, jobject obj) {
   ClassData data;
   if (JvmtiErrorToException(env, jvmti_env, jvmti_env->GetObjectSize(obj, &data.size))) {
     return;
@@ -139,7 +139,7 @@
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test913_followReferences(
     JNIEnv* env,
-    jclass klass ATTRIBUTE_UNUSED,
+    [[maybe_unused]] jclass klass,
     jint heap_filter,
     jclass klass_filter,
     jobject initial_object,
@@ -162,7 +162,7 @@
                 jlong* tag_ptr,
                 jlong* referrer_tag_ptr,
                 jint length,
-                void* user_data ATTRIBUTE_UNUSED) override {
+                [[maybe_unused]] void* user_data) override {
       jlong tag = *tag_ptr;
 
       // Ignore any jni-global roots with untagged classes. These can be from the environment,
@@ -570,18 +570,18 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test913_followReferencesString(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject initial_object) {
+    JNIEnv* env, [[maybe_unused]] jclass klass , jobject initial_object) {
   struct FindStringCallbacks {
     static jint JNICALL FollowReferencesCallback(
-        jvmtiHeapReferenceKind reference_kind ATTRIBUTE_UNUSED,
-        const jvmtiHeapReferenceInfo* reference_info ATTRIBUTE_UNUSED,
-        jlong class_tag ATTRIBUTE_UNUSED,
-        jlong referrer_class_tag ATTRIBUTE_UNUSED,
-        jlong size ATTRIBUTE_UNUSED,
-        jlong* tag_ptr ATTRIBUTE_UNUSED,
-        jlong* referrer_tag_ptr ATTRIBUTE_UNUSED,
-        jint length ATTRIBUTE_UNUSED,
-        void* user_data ATTRIBUTE_UNUSED) {
+        [[maybe_unused]] jvmtiHeapReferenceKind reference_kind,
+        [[maybe_unused]] const jvmtiHeapReferenceInfo* reference_info,
+        [[maybe_unused]] jlong class_tag,
+        [[maybe_unused]] jlong referrer_class_tag,
+        [[maybe_unused]] jlong size,
+        [[maybe_unused]] jlong* tag_ptr,
+        [[maybe_unused]] jlong* referrer_tag_ptr,
+        [[maybe_unused]] jint length,
+        [[maybe_unused]] void* user_data) {
       return JVMTI_VISIT_OBJECTS;  // Continue visiting.
     }
 
@@ -633,18 +633,18 @@
 
 
 extern "C" JNIEXPORT jstring JNICALL Java_art_Test913_followReferencesPrimitiveArray(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject initial_object) {
+    JNIEnv* env, [[maybe_unused]] jclass klass , jobject initial_object) {
   struct FindArrayCallbacks {
     static jint JNICALL FollowReferencesCallback(
-        jvmtiHeapReferenceKind reference_kind ATTRIBUTE_UNUSED,
-        const jvmtiHeapReferenceInfo* reference_info ATTRIBUTE_UNUSED,
-        jlong class_tag ATTRIBUTE_UNUSED,
-        jlong referrer_class_tag ATTRIBUTE_UNUSED,
-        jlong size ATTRIBUTE_UNUSED,
-        jlong* tag_ptr ATTRIBUTE_UNUSED,
-        jlong* referrer_tag_ptr ATTRIBUTE_UNUSED,
-        jint length ATTRIBUTE_UNUSED,
-        void* user_data ATTRIBUTE_UNUSED) {
+        [[maybe_unused]] jvmtiHeapReferenceKind reference_kind,
+        [[maybe_unused]] const jvmtiHeapReferenceInfo* reference_info,
+        [[maybe_unused]] jlong class_tag,
+        [[maybe_unused]] jlong referrer_class_tag,
+        [[maybe_unused]] jlong size,
+        [[maybe_unused]] jlong* tag_ptr,
+        [[maybe_unused]] jlong* referrer_tag_ptr,
+        [[maybe_unused]] jint length,
+        [[maybe_unused]] void* user_data) {
       return JVMTI_VISIT_OBJECTS;  // Continue visiting.
     }
 
@@ -749,18 +749,18 @@
 }
 
 extern "C" JNIEXPORT jstring JNICALL Java_art_Test913_followReferencesPrimitiveFields(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject initial_object) {
+    JNIEnv* env, [[maybe_unused]] jclass klass , jobject initial_object) {
   struct FindFieldCallbacks {
     static jint JNICALL FollowReferencesCallback(
-        jvmtiHeapReferenceKind reference_kind ATTRIBUTE_UNUSED,
-        const jvmtiHeapReferenceInfo* reference_info ATTRIBUTE_UNUSED,
-        jlong class_tag ATTRIBUTE_UNUSED,
-        jlong referrer_class_tag ATTRIBUTE_UNUSED,
-        jlong size ATTRIBUTE_UNUSED,
-        jlong* tag_ptr ATTRIBUTE_UNUSED,
-        jlong* referrer_tag_ptr ATTRIBUTE_UNUSED,
-        jint length ATTRIBUTE_UNUSED,
-        void* user_data ATTRIBUTE_UNUSED) {
+        [[maybe_unused]] jvmtiHeapReferenceKind reference_kind,
+        [[maybe_unused]] const jvmtiHeapReferenceInfo* reference_info,
+        [[maybe_unused]] jlong class_tag,
+        [[maybe_unused]] jlong referrer_class_tag,
+        [[maybe_unused]] jlong size,
+        [[maybe_unused]] jlong* tag_ptr,
+        [[maybe_unused]] jlong* referrer_tag_ptr,
+        [[maybe_unused]] jint length,
+        [[maybe_unused]] void* user_data) {
       return JVMTI_VISIT_OBJECTS;  // Continue visiting.
     }
 
@@ -823,16 +823,16 @@
 static size_t starts = 0;
 static size_t finishes = 0;
 
-static void JNICALL GarbageCollectionFinish(jvmtiEnv* ti_env ATTRIBUTE_UNUSED) {
+static void JNICALL GarbageCollectionFinish([[maybe_unused]] jvmtiEnv* ti_env) {
   finishes++;
 }
 
-static void JNICALL GarbageCollectionStart(jvmtiEnv* ti_env ATTRIBUTE_UNUSED) {
+static void JNICALL GarbageCollectionStart([[maybe_unused]] jvmtiEnv* ti_env) {
   starts++;
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test913_setupGcCallback(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass klass) {
   jvmtiEventCallbacks callbacks;
   memset(&callbacks, 0, sizeof(jvmtiEventCallbacks));
   callbacks.GarbageCollectionFinish = GarbageCollectionFinish;
@@ -843,7 +843,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test913_enableGcTracking(JNIEnv* env,
-                                                                    jclass klass ATTRIBUTE_UNUSED,
+                                                                    [[maybe_unused]] jclass klass,
                                                                     jboolean enable) {
   jvmtiError ret = jvmti_env->SetEventNotificationMode(
       enable ? JVMTI_ENABLE : JVMTI_DISABLE,
@@ -861,15 +861,15 @@
   }
 }
 
-extern "C" JNIEXPORT jint JNICALL Java_art_Test913_getGcStarts(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                               jclass klass ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT jint JNICALL Java_art_Test913_getGcStarts([[maybe_unused]] JNIEnv* env,
+                                                               [[maybe_unused]] jclass klass) {
   jint result = static_cast<jint>(starts);
   starts = 0;
   return result;
 }
 
-extern "C" JNIEXPORT jint JNICALL Java_art_Test913_getGcFinishes(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                                 jclass klass ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT jint JNICALL Java_art_Test913_getGcFinishes([[maybe_unused]] JNIEnv* env,
+                                                                 [[maybe_unused]] jclass klass) {
   jint result = static_cast<jint>(finishes);
   finishes = 0;
   return result;
@@ -902,7 +902,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test913_checkForExtensionApis(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass klass) {
   jint extension_count;
   jvmtiExtensionFunctionInfo* extensions;
   jvmtiError result = jvmti_env->GetExtensionFunctions(&extension_count, &extensions);
@@ -993,7 +993,7 @@
 }
 
 extern "C" JNIEXPORT jint JNICALL Java_art_Test913_getObjectHeapId(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jlong tag) {
+    JNIEnv* env, [[maybe_unused]] jclass klass , jlong tag) {
   CHECK(gGetObjectHeapIdFn != nullptr);
   jint heap_id;
   jvmtiError result = gGetObjectHeapIdFn(jvmti_env, tag, &heap_id);
@@ -1002,7 +1002,7 @@
 }
 
 extern "C" JNIEXPORT jstring JNICALL Java_art_Test913_getHeapName(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jint heap_id) {
+    JNIEnv* env, [[maybe_unused]] jclass klass , jint heap_id) {
   CHECK(gGetHeapNameFn != nullptr);
   char* heap_name;
   jvmtiError result = gGetHeapNameFn(jvmti_env, heap_id, &heap_name);
@@ -1015,20 +1015,20 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test913_checkGetObjectHeapIdInCallback(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jlong tag, jint heap_id) {
+    JNIEnv* env, [[maybe_unused]] jclass klass , jlong tag, jint heap_id) {
   CHECK(gGetObjectHeapIdFn != nullptr);
 
   {
     struct GetObjectHeapIdCallbacks {
       static jint JNICALL FollowReferencesCallback(
-          jvmtiHeapReferenceKind reference_kind ATTRIBUTE_UNUSED,
-          const jvmtiHeapReferenceInfo* reference_info ATTRIBUTE_UNUSED,
-          jlong class_tag ATTRIBUTE_UNUSED,
-          jlong referrer_class_tag ATTRIBUTE_UNUSED,
-          jlong size ATTRIBUTE_UNUSED,
+          [[maybe_unused]] jvmtiHeapReferenceKind reference_kind,
+          [[maybe_unused]] const jvmtiHeapReferenceInfo* reference_info,
+          [[maybe_unused]] jlong class_tag,
+          [[maybe_unused]] jlong referrer_class_tag,
+          [[maybe_unused]] jlong size,
           jlong* tag_ptr,
-          jlong* referrer_tag_ptr ATTRIBUTE_UNUSED,
-          jint length ATTRIBUTE_UNUSED,
+          [[maybe_unused]] jlong* referrer_tag_ptr,
+          [[maybe_unused]] jint length,
           void* user_data) {
         if (*tag_ptr != 0) {
           GetObjectHeapIdCallbacks* p = reinterpret_cast<GetObjectHeapIdCallbacks*>(user_data);
@@ -1064,10 +1064,10 @@
 
   {
     struct GetObjectHeapIdCallbacks {
-      static jint JNICALL HeapIterationCallback(jlong class_tag ATTRIBUTE_UNUSED,
-                                                jlong size ATTRIBUTE_UNUSED,
+      static jint JNICALL HeapIterationCallback([[maybe_unused]] jlong class_tag,
+                                                [[maybe_unused]] jlong size,
                                                 jlong* tag_ptr,
-                                                jint length ATTRIBUTE_UNUSED,
+                                                [[maybe_unused]] jint length,
                                                 void* user_data) {
         if (*tag_ptr != 0) {
           GetObjectHeapIdCallbacks* p = reinterpret_cast<GetObjectHeapIdCallbacks*>(user_data);
@@ -1104,11 +1104,11 @@
 
 static bool gFoundExt = false;
 
-static jint JNICALL HeapIterationExtCallback(jlong class_tag ATTRIBUTE_UNUSED,
-                                             jlong size ATTRIBUTE_UNUSED,
+static jint JNICALL HeapIterationExtCallback([[maybe_unused]] jlong class_tag,
+                                             [[maybe_unused]] jlong size,
                                              jlong* tag_ptr,
-                                             jint length ATTRIBUTE_UNUSED,
-                                             void* user_data ATTRIBUTE_UNUSED,
+                                             [[maybe_unused]] jint length,
+                                             [[maybe_unused]] void* user_data,
                                              jint heap_id) {
   // We expect some tagged objects at or above the threshold, where the expected heap id is
   // encoded into lowest byte.
@@ -1123,7 +1123,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test913_iterateThroughHeapExt(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass klass) {
   CHECK(gIterateThroughHeapExt != nullptr);
 
   jvmtiHeapCallbacks callbacks;
diff --git a/test/920-objects/objects.cc b/test/920-objects/objects.cc
index 101ebb9..8fddc4a 100644
--- a/test/920-objects/objects.cc
+++ b/test/920-objects/objects.cc
@@ -28,7 +28,7 @@
 namespace Test920Objects {
 
 extern "C" JNIEXPORT jlong JNICALL Java_art_Test920_getObjectSize(
-    JNIEnv* env ATTRIBUTE_UNUSED, jclass klass ATTRIBUTE_UNUSED, jobject object) {
+    [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass klass, jobject object) {
   jlong size;
 
   jvmtiError result = jvmti_env->GetObjectSize(object, &size);
@@ -44,7 +44,7 @@
 }
 
 extern "C" JNIEXPORT jint JNICALL Java_art_Test920_getObjectHashCode(
-    JNIEnv* env ATTRIBUTE_UNUSED, jclass klass ATTRIBUTE_UNUSED, jobject object) {
+    [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass klass, jobject object) {
   jint hash;
 
   jvmtiError result = jvmti_env->GetObjectHashCode(object, &hash);
diff --git a/test/921-hello-failure/expected-stdout.jvm.txt b/test/921-hello-failure/expected-stdout.jvm.txt
new file mode 100644
index 0000000..f36d1a3
--- /dev/null
+++ b/test/921-hello-failure/expected-stdout.jvm.txt
@@ -0,0 +1,58 @@
+hello - Verification
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_FAILS_VERIFICATION)
+hello - Verification
+hello - NewName
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_NAMES_DONT_MATCH)
+hello - NewName
+hello - DifferentAccess
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED)
+hello - DifferentAccess
+hello2 - NewInterface
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform2;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED)
+hello2 - NewInterface
+hello2 - MissingInterface
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform2;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED)
+hello2 - MissingInterface
+hello2 - ReorderInterface
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform2;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED)
+hello2 - ReorderInterface
+hello - MultiRedef
+hello2 - MultiRedef
+Transformation error : java.lang.Exception(Failed to redefine classes <LTransform2;, LTransform;> due to JVMTI_ERROR_NAMES_DONT_MATCH)
+hello - MultiRedef
+hello2 - MultiRedef
+Transformation error : java.lang.Exception(Failed to redefine classes <LTransform;, LTransform2;> due to JVMTI_ERROR_NAMES_DONT_MATCH)
+hello - MultiRedef
+hello2 - MultiRedef
+hello - MultiRetrans
+hello2 - MultiRetrans
+Transformation error : java.lang.Exception(Failed to retransform classes <LTransform2;, LTransform;> due to JVMTI_ERROR_NAMES_DONT_MATCH)
+hello - MultiRetrans
+hello2 - MultiRetrans
+Transformation error : java.lang.Exception(Failed to retransform classes <LTransform;, LTransform2;> due to JVMTI_ERROR_NAMES_DONT_MATCH)
+hello - MultiRetrans
+hello2 - MultiRetrans
+hello - NewMethod
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED)
+hello - NewMethod
+hello2 - MissingMethod
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform3;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED)
+hello2 - MissingMethod
+hello - MethodChange
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED)
+hello - MethodChange
+hello - NewField
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED)
+hello - NewField
+hello there - MissingField
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform4;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED)
+hello there - MissingField
+hello there again - FieldChange
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform4;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED)
+hello there again - FieldChange
+hello - Unmodifiable
+Transformation error : java.lang.Exception(Failed to redefine class <[LTransform;> due to JVMTI_ERROR_UNMODIFIABLE_CLASS)
+hello - Unmodifiable
+hello - Undefault
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform5;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED)
+hello - Undefault
diff --git a/test/921-hello-failure/expected-stdout.txt b/test/921-hello-failure/expected-stdout.txt
index f36d1a3..d2d4576 100644
--- a/test/921-hello-failure/expected-stdout.txt
+++ b/test/921-hello-failure/expected-stdout.txt
@@ -1,58 +1,58 @@
 hello - Verification
-Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_FAILS_VERIFICATION)
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_FAILS_VERIFICATION (FAILURE TO REDEFINE Unable to perform redefinition of 'LTransform;': Failed to verify class. Error was: Verifier rejected class Transform: void Transform.sayHi(java.lang.String) failed to verify: void Transform.sayHi(java.lang.String): [0x0] return-object not expected))
 hello - Verification
 hello - NewName
-Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_NAMES_DONT_MATCH)
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_NAMES_DONT_MATCH (FAILURE TO REDEFINE Unable to perform redefinition of 'LTransform;': expected file to contain class called 'LTransform;' but found 'LNotTransform;'!))
 hello - NewName
 hello - DifferentAccess
-Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED)
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED (FAILURE TO REDEFINE Unable to perform redefinition of 'LTransform;': Cannot change modifiers of class by redefinition))
 hello - DifferentAccess
 hello2 - NewInterface
-Transformation error : java.lang.Exception(Failed to redefine class <LTransform2;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED)
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform2;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED (FAILURE TO REDEFINE Unable to perform redefinition of 'LTransform2;': Interfaces added or removed))
 hello2 - NewInterface
 hello2 - MissingInterface
-Transformation error : java.lang.Exception(Failed to redefine class <LTransform2;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED)
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform2;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED (FAILURE TO REDEFINE Unable to perform redefinition of 'LTransform2;': Interfaces added or removed))
 hello2 - MissingInterface
 hello2 - ReorderInterface
-Transformation error : java.lang.Exception(Failed to redefine class <LTransform2;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED)
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform2;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED (FAILURE TO REDEFINE Unable to perform redefinition of 'LTransform2;': Interfaces changed or re-ordered))
 hello2 - ReorderInterface
 hello - MultiRedef
 hello2 - MultiRedef
-Transformation error : java.lang.Exception(Failed to redefine classes <LTransform2;, LTransform;> due to JVMTI_ERROR_NAMES_DONT_MATCH)
+Transformation error : java.lang.Exception(Failed to redefine classes <LTransform2;, LTransform;> due to JVMTI_ERROR_NAMES_DONT_MATCH (FAILURE TO REDEFINE Unable to perform redefinition of 'LTransform;': expected file to contain class called 'LTransform;' but found 'LNotTransform;'!))
 hello - MultiRedef
 hello2 - MultiRedef
-Transformation error : java.lang.Exception(Failed to redefine classes <LTransform;, LTransform2;> due to JVMTI_ERROR_NAMES_DONT_MATCH)
+Transformation error : java.lang.Exception(Failed to redefine classes <LTransform;, LTransform2;> due to JVMTI_ERROR_NAMES_DONT_MATCH (FAILURE TO REDEFINE Unable to perform redefinition of 'LTransform;': expected file to contain class called 'LTransform;' but found 'LNotTransform;'!))
 hello - MultiRedef
 hello2 - MultiRedef
 hello - MultiRetrans
 hello2 - MultiRetrans
-Transformation error : java.lang.Exception(Failed to retransform classes <LTransform2;, LTransform;> due to JVMTI_ERROR_NAMES_DONT_MATCH)
+Transformation error : java.lang.Exception(Failed to retransform classes <LTransform2;, LTransform;> due to JVMTI_ERROR_NAMES_DONT_MATCH (FAILURE TO RETRANSFORM Unable to perform redefinition of 'LTransform;': expected file to contain class called 'LTransform;' but found 'LNotTransform;'!))
 hello - MultiRetrans
 hello2 - MultiRetrans
-Transformation error : java.lang.Exception(Failed to retransform classes <LTransform;, LTransform2;> due to JVMTI_ERROR_NAMES_DONT_MATCH)
+Transformation error : java.lang.Exception(Failed to retransform classes <LTransform;, LTransform2;> due to JVMTI_ERROR_NAMES_DONT_MATCH (FAILURE TO RETRANSFORM Unable to perform redefinition of 'LTransform;': expected file to contain class called 'LTransform;' but found 'LNotTransform;'!))
 hello - MultiRetrans
 hello2 - MultiRetrans
 hello - NewMethod
-Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED)
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED (FAILURE TO REDEFINE Unable to perform redefinition of 'LTransform;': Total number of declared methods changed from 2 to 3))
 hello - NewMethod
 hello2 - MissingMethod
-Transformation error : java.lang.Exception(Failed to redefine class <LTransform3;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED)
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform3;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED (FAILURE TO REDEFINE Unable to perform redefinition of 'LTransform3;': Total number of declared methods changed from 3 to 2))
 hello2 - MissingMethod
 hello - MethodChange
-Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED)
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED (FAILURE TO REDEFINE Unable to perform redefinition of 'LTransform;': method 'sayHi' (sig: (Ljava/lang/String;)V) had different access flags))
 hello - MethodChange
 hello - NewField
-Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED)
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED (FAILURE TO REDEFINE Unable to perform redefinition of 'LTransform;': Unknown field 'field' (sig: Ljava/lang/Object;) added!))
 hello - NewField
 hello there - MissingField
-Transformation error : java.lang.Exception(Failed to redefine class <LTransform4;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED)
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform4;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED (FAILURE TO REDEFINE Unable to perform redefinition of 'LTransform4;': Field 'greeting' (sig: Ljava/lang/String;) is missing!))
 hello there - MissingField
 hello there again - FieldChange
-Transformation error : java.lang.Exception(Failed to redefine class <LTransform4;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED)
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform4;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED (FAILURE TO REDEFINE Unable to perform redefinition of 'LTransform4;': Unknown field 'greeting' (sig: Ljava/lang/Object;) added!))
 hello there again - FieldChange
 hello - Unmodifiable
-Transformation error : java.lang.Exception(Failed to redefine class <[LTransform;> due to JVMTI_ERROR_UNMODIFIABLE_CLASS)
+Transformation error : java.lang.Exception(Failed to redefine class <[LTransform;> due to JVMTI_ERROR_UNMODIFIABLE_CLASS (FAILURE TO REDEFINE Modification of Array classes is not supported))
 hello - Unmodifiable
 hello - Undefault
-Transformation error : java.lang.Exception(Failed to redefine class <LTransform5;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED)
+Transformation error : java.lang.Exception(Failed to redefine class <LTransform5;> due to JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED (FAILURE TO REDEFINE Unable to perform redefinition of 'LTransform5;': Total number of declared methods changed from 2 to 3))
 hello - Undefault
diff --git a/test/921-hello-failure/run.py b/test/921-hello-failure/run.py
index 4796039..27daabf 100644
--- a/test/921-hello-failure/run.py
+++ b/test/921-hello-failure/run.py
@@ -16,4 +16,9 @@
 
 
 def run(ctx, args):
+  if args.jvm:
+    # On jvm we don't have a detailed reason for failure so the expected output
+    # is slightly different
+    ctx.expected_stdout = ctx.expected_stdout.with_suffix(".jvm.txt")
+
   ctx.default_run(args, jvmti=True)
diff --git a/test/922-properties/properties.cc b/test/922-properties/properties.cc
index 6af45f5..eed0a00 100644
--- a/test/922-properties/properties.cc
+++ b/test/922-properties/properties.cc
@@ -30,7 +30,7 @@
 namespace Test922Properties {
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test922_getSystemProperties(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass) {
   jint count;
   char** properties;
   jvmtiError result = jvmti_env->GetSystemProperties(&count, &properties);
@@ -55,7 +55,7 @@
 }
 
 extern "C" JNIEXPORT jstring JNICALL Java_art_Test922_getSystemProperty(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jstring key) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jstring key) {
   ScopedUtfChars string(env, key);
   if (string.c_str() == nullptr) {
     return nullptr;
@@ -75,7 +75,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test922_setSystemProperty(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jstring key, jstring value) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jstring key, jstring value) {
   ScopedUtfChars key_string(env, key);
   if (key_string.c_str() == nullptr) {
     return;
diff --git a/test/923-monitors/monitors.cc b/test/923-monitors/monitors.cc
index e4f3860..bfd00f8 100644
--- a/test/923-monitors/monitors.cc
+++ b/test/923-monitors/monitors.cc
@@ -38,7 +38,7 @@
 }
 
 extern "C" JNIEXPORT jlong JNICALL Java_art_Test923_createRawMonitor(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass) {
   jrawMonitorID id;
   jvmtiError result = jvmti_env->CreateRawMonitor("placeholder", &id);
   if (JvmtiErrorToException(env, jvmti_env, result)) {
@@ -48,37 +48,37 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test923_destroyRawMonitor(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jlong l) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jlong l) {
   jvmtiError result = jvmti_env->DestroyRawMonitor(LongToMonitor(l));
   JvmtiErrorToException(env, jvmti_env, result);
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test923_rawMonitorEnter(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jlong l) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jlong l) {
   jvmtiError result = jvmti_env->RawMonitorEnter(LongToMonitor(l));
   JvmtiErrorToException(env, jvmti_env, result);
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test923_rawMonitorExit(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jlong l) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jlong l) {
   jvmtiError result = jvmti_env->RawMonitorExit(LongToMonitor(l));
   JvmtiErrorToException(env, jvmti_env, result);
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test923_rawMonitorWait(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jlong l, jlong millis) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jlong l, jlong millis) {
   jvmtiError result = jvmti_env->RawMonitorWait(LongToMonitor(l), millis);
   JvmtiErrorToException(env, jvmti_env, result);
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test923_rawMonitorNotify(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jlong l) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jlong l) {
   jvmtiError result = jvmti_env->RawMonitorNotify(LongToMonitor(l));
   JvmtiErrorToException(env, jvmti_env, result);
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test923_rawMonitorNotifyAll(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jlong l) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jlong l) {
   jvmtiError result = jvmti_env->RawMonitorNotifyAll(LongToMonitor(l));
   JvmtiErrorToException(env, jvmti_env, result);
 }
diff --git a/test/924-threads/threads.cc b/test/924-threads/threads.cc
index 8caff76..49f805c 100644
--- a/test/924-threads/threads.cc
+++ b/test/924-threads/threads.cc
@@ -41,7 +41,7 @@
 };
 
 extern "C" JNIEXPORT jlong JNICALL Java_art_Test924_nativeWaiterStructAlloc(
-    JNIEnv* env, jclass TestClass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass TestClass) {
   WaiterStruct* s = nullptr;
   if (JvmtiErrorToException(env,
                             jvmti_env,
@@ -55,19 +55,19 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test924_nativeWaiterStructWaitForNative(
-    JNIEnv* env ATTRIBUTE_UNUSED, jclass TestClass ATTRIBUTE_UNUSED, jlong waiter_struct) {
+    [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass TestClass, jlong waiter_struct) {
   WaiterStruct* s = reinterpret_cast<WaiterStruct*>(static_cast<intptr_t>(waiter_struct));
   while (!s->started) { }
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test924_nativeWaiterStructFinish(
-    JNIEnv* env ATTRIBUTE_UNUSED, jclass TestClass ATTRIBUTE_UNUSED, jlong waiter_struct) {
+    [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass TestClass, jlong waiter_struct) {
   WaiterStruct* s = reinterpret_cast<WaiterStruct*>(static_cast<intptr_t>(waiter_struct));
   s->finish = true;
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test924_nativeLoop(JNIEnv* env,
-                                                              jclass TestClass ATTRIBUTE_UNUSED,
+                                                              [[maybe_unused]] jclass TestClass,
                                                               jlong waiter_struct) {
   WaiterStruct* s = reinterpret_cast<WaiterStruct*>(static_cast<intptr_t>(waiter_struct));
   s->started = true;
@@ -79,7 +79,7 @@
 // private static native Object[] getThreadInfo(Thread t);
 
 extern "C" JNIEXPORT jthread JNICALL Java_art_Test924_getCurrentThread(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass) {
   jthread thread = nullptr;
   jvmtiError result = jvmti_env->GetCurrentThread(&thread);
   if (JvmtiErrorToException(env, jvmti_env, result)) {
@@ -89,7 +89,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test924_getThreadInfo(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jthread thread) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jthread thread) {
   jvmtiThreadInfo info;
   memset(&info, 0, sizeof(jvmtiThreadInfo));
 
@@ -137,7 +137,7 @@
 }
 
 extern "C" JNIEXPORT jint JNICALL Java_art_Test924_getThreadState(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jthread thread) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jthread thread) {
   jint state;
   jvmtiError result = jvmti_env->GetThreadState(thread, &state);
   if (JvmtiErrorToException(env, jvmti_env, result)) {
@@ -147,7 +147,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test924_getAllThreads(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass) {
   jint thread_count;
   jthread* threads;
 
@@ -167,7 +167,7 @@
 }
 
 extern "C" JNIEXPORT jlong JNICALL Java_art_Test924_getTLS(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jthread thread) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jthread thread) {
   void* tls;
   jvmtiError result = jvmti_env->GetThreadLocalStorage(thread, &tls);
   if (JvmtiErrorToException(env, jvmti_env, result)) {
@@ -177,7 +177,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test924_setTLS(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jthread thread, jlong val) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jthread thread, jlong val) {
   const void* tls = reinterpret_cast<void*>(static_cast<uintptr_t>(val));
   jvmtiError result = jvmti_env->SetThreadLocalStorage(thread, tls);
   JvmtiErrorToException(env, jvmti_env, result);
@@ -223,7 +223,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test924_enableThreadEvents(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jboolean b) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jboolean b) {
   if (b == JNI_FALSE) {
     jvmtiError ret = jvmti_env->SetEventNotificationMode(JVMTI_DISABLE,
                                                          JVMTI_EVENT_THREAD_START,
@@ -260,7 +260,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test924_getThreadEventMessages(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass) {
   std::lock_guard<std::mutex> guard(gEventsMutex);
   jobjectArray ret = CreateObjectArray(env,
                                        static_cast<jint>(gEvents.size()),
diff --git a/test/925-threadgroups/threadgroups.cc b/test/925-threadgroups/threadgroups.cc
index cc053bc..9154756 100644
--- a/test/925-threadgroups/threadgroups.cc
+++ b/test/925-threadgroups/threadgroups.cc
@@ -36,7 +36,7 @@
 //   private static native Object[] getThreadGroupChildren();
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test925_getTopThreadGroups(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass) {
   jthreadGroup* groups;
   jint group_count;
   jvmtiError result = jvmti_env->GetTopThreadGroups(&group_count, &groups);
@@ -55,7 +55,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test925_getThreadGroupInfo(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jthreadGroup group) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jthreadGroup group) {
   jvmtiThreadGroupInfo info;
   jvmtiError result = jvmti_env->GetThreadGroupInfo(group, &info);
   if (JvmtiErrorToException(env, jvmti_env, result)) {
@@ -87,7 +87,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test925_getThreadGroupChildren(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jthreadGroup group) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jthreadGroup group) {
   jint thread_count;
   jthread* threads;
   jint threadgroup_count;
diff --git a/test/927-timers/timers.cc b/test/927-timers/timers.cc
index 9eaac71..bf20130 100644
--- a/test/927-timers/timers.cc
+++ b/test/927-timers/timers.cc
@@ -32,7 +32,7 @@
 namespace Test926Timers {
 
 extern "C" JNIEXPORT jint JNICALL Java_art_Test927_getAvailableProcessors(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass) {
   jint count;
   jvmtiError result = jvmti_env->GetAvailableProcessors(&count);
   if (JvmtiErrorToException(env, jvmti_env, result)) {
@@ -42,7 +42,7 @@
 }
 
 extern "C" JNIEXPORT jlong JNICALL Java_art_Test927_getTime(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass) {
   jlong time;
   jvmtiError result = jvmti_env->GetTime(&time);
   if (JvmtiErrorToException(env, jvmti_env, result)) {
@@ -52,7 +52,7 @@
 }
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test927_getTimerInfo(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass) {
   jvmtiTimerInfo info;
   jvmtiError result = jvmti_env->GetTimerInfo(&info);
   if (JvmtiErrorToException(env, jvmti_env, result)) {
diff --git a/test/928-jni-table/jni_table.cc b/test/928-jni-table/jni_table.cc
index 1dfe34b..52cd374 100644
--- a/test/928-jni-table/jni_table.cc
+++ b/test/928-jni-table/jni_table.cc
@@ -44,7 +44,6 @@
   CHECK(thr != nullptr);
   if (env->IsInstanceOf(o, thr)) {
     jvmtiThreadInfo jti;
-    // b/146170834: This could cause DCHECK failures.
     CHECK_EQ(jvmti_env->GetThreadInfo(reinterpret_cast<jthread>(o), &jti), JVMTI_ERROR_NONE);
   }
   gOriginalEnv->DeleteGlobalRef(env, o);
diff --git a/test/929-search/search.cc b/test/929-search/search.cc
index 5516105..fb79c6f 100644
--- a/test/929-search/search.cc
+++ b/test/929-search/search.cc
@@ -31,7 +31,7 @@
 namespace Test929Search {
 
 extern "C" JNIEXPORT void JNICALL Java_Main_addToBootClassLoader(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jstring segment) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jstring segment) {
   ScopedUtfChars utf(env, segment);
   if (utf.c_str() == nullptr) {
     return;
@@ -41,7 +41,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_Main_addToSystemClassLoader(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jstring segment) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass, jstring segment) {
   ScopedUtfChars utf(env, segment);
   if (utf.c_str() == nullptr) {
     return;
diff --git a/test/931-agent-thread/agent_thread.cc b/test/931-agent-thread/agent_thread.cc
index 391df4e..16f6b27 100644
--- a/test/931-agent-thread/agent_thread.cc
+++ b/test/931-agent-thread/agent_thread.cc
@@ -90,7 +90,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test931_testAgentThread(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass) {
   // Create a Thread object.
   ScopedLocalRef<jobject> thread_name(env, env->NewStringUTF("Agent Thread"));
   if (thread_name.get() == nullptr) {
diff --git a/test/933-misc-events/misc_events.cc b/test/933-misc-events/misc_events.cc
index d2ae0f4..2182bc0 100644
--- a/test/933-misc-events/misc_events.cc
+++ b/test/933-misc-events/misc_events.cc
@@ -33,13 +33,13 @@
 
 static std::atomic<bool> saw_dump_request(false);
 
-static void DumpRequestCallback(jvmtiEnv* jenv ATTRIBUTE_UNUSED) {
+static void DumpRequestCallback([[maybe_unused]] jvmtiEnv* jenv) {
   printf("Received dump request.\n");
   saw_dump_request.store(true, std::memory_order::memory_order_relaxed);
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test933_testSigQuit(
-    JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass Main_klass) {
   jvmtiEventCallbacks callbacks;
   memset(&callbacks, 0, sizeof(jvmtiEventCallbacks));
   callbacks.DataDumpRequest = DumpRequestCallback;
diff --git a/test/936-search-onload/search_onload.cc b/test/936-search-onload/search_onload.cc
index 23cea83..d693413 100644
--- a/test/936-search-onload/search_onload.cc
+++ b/test/936-search-onload/search_onload.cc
@@ -34,8 +34,8 @@
 namespace Test936SearchOnload {
 
 jint OnLoad(JavaVM* vm,
-            char* options ATTRIBUTE_UNUSED,
-            void* reserved ATTRIBUTE_UNUSED) {
+            [[maybe_unused]] char* options,
+            [[maybe_unused]] void* reserved) {
   if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) {
     printf("Unable to get jvmti env!\n");
     return 1;
diff --git a/test/941-recursive-obsolete-jit/src/Main.java b/test/941-recursive-obsolete-jit/src/Main.java
index e3065a7..f2a397e 100644
--- a/test/941-recursive-obsolete-jit/src/Main.java
+++ b/test/941-recursive-obsolete-jit/src/Main.java
@@ -135,6 +135,12 @@
     do {
       // Run ensureJitCompiled here since it might get GCd
       ensureJitCompiled(Transform.class, "sayHi");
+      // We want to make sure sayHi method gets deoptimized. So we cannot allow any runtime frames
+      // between sayHi and the run method where the transformation is happening. If the run method
+      // is interpreted there will be a runtime frame to transition from JIT to interpreted code.
+      // So ensure the run method is JITed too, so we don't loop for a long time in the hope of
+      // getting the run method JITed.
+      ensureJitCompiled(do_redefinition.getClass(), "run");
       // Clear output.
       reporter.clear();
       t.sayHi(2, reporter, () -> { reporter.accept("Not doing anything here"); });
diff --git a/test/943-private-recursive-jit/src/Main.java b/test/943-private-recursive-jit/src/Main.java
index 09337ba..9fa6607 100644
--- a/test/943-private-recursive-jit/src/Main.java
+++ b/test/943-private-recursive-jit/src/Main.java
@@ -151,6 +151,12 @@
       // Run ensureJitCompiled here since it might get GCd
       ensureJitCompiled(Transform.class, "sayHi");
       ensureJitCompiled(Transform.class, "privateSayHi");
+      // We want to make sure sayHi method gets deoptimized. So we cannot allow any runtime frames
+      // between sayHi and the run method where the transformation is happening. If the run method
+      // is interpreted there will be a runtime frame to transition from JIT to interpreted code.
+      // So ensure the run method is JITed too, so we don't loop for a long time in the hope of
+      // getting the run method JITed.
+      ensureJitCompiled(do_redefinition.getClass(), "run");
       // Clear output.
       reporter.clear();
       t.sayHi(2, reporter, () -> { reporter.accept("Not doing anything here"); });
diff --git a/test/945-obsolete-native/obsolete_native.cc b/test/945-obsolete-native/obsolete_native.cc
index 418ce90..29c7a80 100644
--- a/test/945-obsolete-native/obsolete_native.cc
+++ b/test/945-obsolete-native/obsolete_native.cc
@@ -32,7 +32,7 @@
 namespace Test945ObsoleteNative {
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test945_00024Transform_doExecute(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject runnable) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject runnable) {
   jclass runnable_klass = env->FindClass("java/lang/Runnable");
   jmethodID run_method = env->GetMethodID(runnable_klass, "run", "()V");
   env->CallVoidMethod(runnable, run_method);
diff --git a/test/950-redefine-intrinsic/src/Main.java b/test/950-redefine-intrinsic/src/Main.java
index badf7b9..dd59192 100644
--- a/test/950-redefine-intrinsic/src/Main.java
+++ b/test/950-redefine-intrinsic/src/Main.java
@@ -23,9 +23,20 @@
 public class Main {
 
   // The bytes below define the following java program.
+  // To generate the bytes from the following Long.java file:
+  // 1. Commit your Long.java change: git commit -- libcore/ojluni/src/main/java/java/lang/Long.java
+  // 2. Copy the following java program into libcore/ojluni/src/main/java/java/lang/Long.java
+  // 3. Run this build command: m core-all && d8 --classpath out/soong/.intermediates/libcore/core-all/android_common/javac/classes/  out/soong/.intermediates/libcore/core-all/android_common/javac/classes/java/lang/Long.class && base64 out/soong/.intermediates/libcore/core-all/android_common/javac/classes/java/lang/Long.class > class_Long.txt && base64 classes.dex > dex_Long.txt
+  // 4. Copy class_Long.txt into CLASS_BYTES String and dex_Long.txt into DEX_BYTES
+  // 5. Checkout the original Long.java: croot libcore && git checkout ojluni/src/main/java/java/lang/Long.java
   // package java.lang;
+  // import java.lang.constant.Constable;
+  // import java.lang.constant.ConstantDesc;
+  // import java.lang.invoke.MethodHandles;
   // import java.math.*;
-  // public final class Long extends Number implements Comparable<Long> {
+  //
+  // import java.util.Optional;
+  // public final class Long extends Number implements Comparable<Long>, Constable, ConstantDesc {
   //     public static final long MIN_VALUE = 0;
   //     public static final long MAX_VALUE = 0;
   //     public static final Class<Long> TYPE = null;
@@ -216,242 +227,271 @@
   //       throw new Error("Method redefined away!");
   //     }
   //     private static final long serialVersionUID = 0;
+  //
+  //     /** @hide */
+  //     @Override
+  //     public Optional<? extends ConstantDesc> describeConstable() {
+  //       throw new Error("Method redefined away!");
+  //     }
+  //
+  //     /** @hide */
+  //     @Override
+  //     public Object resolveConstantDesc(MethodHandles.Lookup lookup) {
+  //       throw new Error("Method redefined away!");
+  //     }
   // }
   private static final byte[] CLASS_BYTES = Base64.getDecoder().decode(
-    "LyoKICogQ29weXJpZ2h0IChDKSAyMDIxIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY3QK" +
-    "ICoKICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhl" +
-    "ICJMaWNlbnNlIik7CiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBs" +
-    "aWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBM" +
-    "aWNlbnNlIGF0CiAqCiAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VO" +
-    "U0UtMi4wCiAqCiAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQg" +
-    "dG8gaW4gd3JpdGluZywgc29mdHdhcmUKICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2Ug" +
-    "aXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKICogV0lUSE9VVCBXQVJSQU5USUVT" +
-    "IE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCiAq" +
-    "IFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJt" +
-    "aXNzaW9ucyBhbmQKICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCiAqLwpwYWNrYWdl" +
-    "IGphdmEubGFuZzsKaW1wb3J0IGphdmEubWF0aC4qOwpwdWJsaWMgZmluYWwgY2xhc3MgTG9uZyBl" +
-    "eHRlbmRzIE51bWJlciBpbXBsZW1lbnRzIENvbXBhcmFibGU8TG9uZz4gewogICAgcHVibGljIHN0" +
-    "YXRpYyBmaW5hbCBsb25nIE1JTl9WQUxVRSA9IDA7CiAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGxv" +
-    "bmcgTUFYX1ZBTFVFID0gMDsKICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgQ2xhc3M8TG9uZz4gVFlQ" +
-    "RSA9IG51bGw7CiAgICBzdGF0aWMgeyB9CiAgICAvLyBVc2VkIGZvciBTdHJlYW0uY291bnQgZm9y" +
-    "IHNvbWUgcmVhc29uLgogICAgcHVibGljIHN0YXRpYyBsb25nIHN1bShsb25nIGEsIGxvbmcgYikg" +
-    "ewogICAgICByZXR1cm4gYSArIGI7CiAgICB9CiAgICAvLyBVc2VkIGluIHN0cmVhbS9sYW1iZGEg" +
-    "ZnVuY3Rpb25zLgogICAgcHVibGljIExvbmcobG9uZyB2YWx1ZSkgewogICAgICB0aGlzLnZhbHVl" +
-    "ID0gdmFsdWU7CiAgICB9CiAgICAvLyBVc2VkIGluIHN0cmVhbS9sYW1iZGEgZnVuY3Rpb25zLgog" +
-    "ICAgcHVibGljIHN0YXRpYyBMb25nIHZhbHVlT2YobG9uZyBsKSB7CiAgICAgIHJldHVybiBuZXcg" +
-    "TG9uZyhsKTsKICAgIH0KICAgIC8vIEludHJpbnNpYyEgRG8gc29tZXRoaW5nIGNvb2wuIFJldHVy" +
-    "biBpICsgMQogICAgcHVibGljIHN0YXRpYyBsb25nIGhpZ2hlc3RPbmVCaXQobG9uZyBpKSB7CiAg" +
-    "ICAgIHJldHVybiBpICsgMTsKICAgIH0KICAgIC8vIEludHJpbnNpYyEgRG8gc29tZXRoaW5nIGNv" +
-    "b2wuIFJldHVybiBpIC0gMQogICAgcHVibGljIHN0YXRpYyBsb25nIGxvd2VzdE9uZUJpdChsb25n" +
-    "IGkpIHsKICAgICAgcmV0dXJuIGkgLSAxOwogICAgfQogICAgLy8gSW50cmluc2ljISBEbyBzb21l" +
-    "dGhpbmcgY29vbC4gUmV0dXJuIGkgKyBpCiAgICBwdWJsaWMgc3RhdGljIGludCBudW1iZXJPZkxl" +
-    "YWRpbmdaZXJvcyhsb25nIGkpIHsKICAgICAgcmV0dXJuIChpbnQpKGkgKyBpKTsKICAgIH0KICAg" +
-    "IC8vIEludHJpbnNpYyEgRG8gc29tZXRoaW5nIGNvb2wuIFJldHVybiBpICYgKGkgPj4+IDEpOwog" +
-    "ICAgcHVibGljIHN0YXRpYyBpbnQgbnVtYmVyT2ZUcmFpbGluZ1plcm9zKGxvbmcgaSkgewogICAg" +
-    "ICByZXR1cm4gKGludCkoaSAmIChpID4+PiAxKSk7CiAgICB9CiAgICAvLyBJbnRyaW5zaWMhIERv" +
-    "IHNvbWV0aGluZyBjb29sLiBSZXR1cm4gNQogICAgIHB1YmxpYyBzdGF0aWMgaW50IGJpdENvdW50" +
-    "KGxvbmcgaSkgewogICAgICAgcmV0dXJuIDU7CiAgICAgfQogICAgLy8gSW50cmluc2ljISBEbyBz" +
-    "b21ldGhpbmcgY29vbC4gUmV0dXJuIGkKICAgIHB1YmxpYyBzdGF0aWMgbG9uZyByb3RhdGVMZWZ0" +
-    "KGxvbmcgaSwgaW50IGRpc3RhbmNlKSB7CiAgICAgIHJldHVybiBpOwogICAgfQogICAgLy8gSW50" +
-    "cmluc2ljISBEbyBzb21ldGhpbmcgY29vbC4gUmV0dXJuIDEwICogaQogICAgcHVibGljIHN0YXRp" +
-    "YyBsb25nIHJvdGF0ZVJpZ2h0KGxvbmcgaSwgaW50IGRpc3RhbmNlKSB7CiAgICAgIHJldHVybiAx" +
-    "MCAqIGk7CiAgICB9CiAgICAvLyBJbnRyaW5zaWMhIERvIHNvbWV0aGluZyBjb29sLiBSZXR1cm4g" +
-    "LWkKICAgIHB1YmxpYyBzdGF0aWMgbG9uZyByZXZlcnNlKGxvbmcgaSkgewogICAgICByZXR1cm4g" +
-    "LWk7CiAgICB9CiAgICAvLyBJbnRyaW5zaWMhIERvIHNvbWV0aGluZyBjb29sLiBSZXR1cm4gMAog" +
-    "ICAgcHVibGljIHN0YXRpYyBpbnQgc2lnbnVtKGxvbmcgaSkgewogICAgICByZXR1cm4gMDsKICAg" +
-    "IH0KICAgIC8vIEludHJpbnNpYyEgRG8gc29tZXRoaW5nIGNvb2wuIFJldHVybiAwCiAgICBwdWJs" +
-    "aWMgc3RhdGljIGxvbmcgcmV2ZXJzZUJ5dGVzKGxvbmcgaSkgewogICAgICByZXR1cm4gMDsKICAg" +
-    "IH0KICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CiAgICAgIHJldHVybiAiUmVkZWZpbmVk" +
-    "IExvbmchIHZhbHVlIChhcyBkb3VibGUpPSIgKyAoKGRvdWJsZSl2YWx1ZSk7CiAgICB9CiAgICBw" +
-    "dWJsaWMgc3RhdGljIFN0cmluZyB0b1N0cmluZyhsb25nIGksIGludCByYWRpeCkgewogICAgICB0" +
-    "aHJvdyBuZXcgRXJyb3IoIk1ldGhvZCByZWRlZmluZWQgYXdheSEiKTsKICAgIH0KICAgIHB1Ymxp" +
-    "YyBzdGF0aWMgU3RyaW5nIHRvVW5zaWduZWRTdHJpbmcobG9uZyBpLCBpbnQgcmFkaXgpIHsKICAg" +
-    "ICAgdGhyb3cgbmV3IEVycm9yKCJNZXRob2QgcmVkZWZpbmVkIGF3YXkhIik7CiAgICB9CiAgICBw" +
-    "cml2YXRlIHN0YXRpYyBCaWdJbnRlZ2VyIHRvVW5zaWduZWRCaWdJbnRlZ2VyKGxvbmcgaSkgewog" +
-    "ICAgICB0aHJvdyBuZXcgRXJyb3IoIk1ldGhvZCByZWRlZmluZWQgYXdheSEiKTsKICAgIH0KICAg" +
-    "IHB1YmxpYyBzdGF0aWMgU3RyaW5nIHRvSGV4U3RyaW5nKGxvbmcgaSkgewogICAgICB0aHJvdyBu" +
-    "ZXcgRXJyb3IoIk1ldGhvZCByZWRlZmluZWQgYXdheSEiKTsKICAgIH0KICAgIHB1YmxpYyBzdGF0" +
-    "aWMgU3RyaW5nIHRvT2N0YWxTdHJpbmcobG9uZyBpKSB7CiAgICAgIHRocm93IG5ldyBFcnJvcigi" +
-    "TWV0aG9kIHJlZGVmaW5lZCBhd2F5ISIpOwogICAgfQogICAgcHVibGljIHN0YXRpYyBTdHJpbmcg" +
-    "dG9CaW5hcnlTdHJpbmcobG9uZyBpKSB7CiAgICAgIHRocm93IG5ldyBFcnJvcigiTWV0aG9kIHJl" +
-    "ZGVmaW5lZCBhd2F5ISIpOwogICAgfQogICAgc3RhdGljIFN0cmluZyB0b1Vuc2lnbmVkU3RyaW5n" +
-    "MChsb25nIHZhbCwgaW50IHNoaWZ0KSB7CiAgICAgIHRocm93IG5ldyBFcnJvcigiTWV0aG9kIHJl" +
-    "ZGVmaW5lZCBhd2F5ISIpOwogICAgfQogICAgc3RhdGljIHZvaWQgZm9ybWF0VW5zaWduZWRMb25n" +
-    "MChsb25nIHZhbCwgaW50IHNoaWZ0LCBieXRlW10gYnVmLCBpbnQgb2Zmc2V0LCBpbnQgbGVuKSB7" +
-    "CiAgICAgIHRocm93IG5ldyBFcnJvcigiTWV0aG9kIHJlZGVmaW5lZCBhd2F5ISIpOwogICAgfQog" +
-    "ICAgcHVibGljIHN0YXRpYyBTdHJpbmcgdG9TdHJpbmcobG9uZyBpKSB7CiAgICAgIHRocm93IG5l" +
-    "dyBFcnJvcigiTWV0aG9kIHJlZGVmaW5lZCBhd2F5ISIpOwogICAgfQogICAgcHVibGljIHN0YXRp" +
-    "YyBTdHJpbmcgdG9VbnNpZ25lZFN0cmluZyhsb25nIGkpIHsKICAgICAgdGhyb3cgbmV3IEVycm9y" +
-    "KCJNZXRob2QgcmVkZWZpbmVkIGF3YXkhIik7CiAgICB9CiAgICBzdGF0aWMgaW50IGdldENoYXJz" +
-    "KGxvbmcgaSwgaW50IGluZGV4LCBieXRlW10gYnVmKSB7CiAgICAgIHRocm93IG5ldyBFcnJvcigi" +
-    "TWV0aG9kIHJlZGVmaW5lZCBhd2F5ISIpOwogICAgfQogICAgc3RhdGljIGludCBnZXRDaGFycyhs" +
-    "b25nIGksIGludCBpbmRleCwgY2hhcltdIGJ1ZikgewogICAgICB0aHJvdyBuZXcgRXJyb3IoIk1l" +
-    "dGhvZCByZWRlZmluZWQgYXdheSEiKTsKICAgIH0KICAgIHN0YXRpYyBpbnQgc3RyaW5nU2l6ZShs" +
-    "b25nIHgpIHsKICAgICAgdGhyb3cgbmV3IEVycm9yKCJNZXRob2QgcmVkZWZpbmVkIGF3YXkhIik7" +
-    "CiAgICB9CiAgICBwdWJsaWMgc3RhdGljIGxvbmcgcGFyc2VMb25nKFN0cmluZyBzLCBpbnQgcmFk" +
-    "aXgpIHRocm93cyBOdW1iZXJGb3JtYXRFeGNlcHRpb24gewogICAgICB0aHJvdyBuZXcgRXJyb3Io" +
-    "Ik1ldGhvZCByZWRlZmluZWQgYXdheSEiKTsKICAgIH0KICAgIHB1YmxpYyBzdGF0aWMgbG9uZyBw" +
-    "YXJzZUxvbmcoU3RyaW5nIHMpIHRocm93cyBOdW1iZXJGb3JtYXRFeGNlcHRpb24gewogICAgICB0" +
-    "aHJvdyBuZXcgRXJyb3IoIk1ldGhvZCByZWRlZmluZWQgYXdheSEiKTsKICAgIH0KICAgIHB1Ymxp" +
-    "YyBzdGF0aWMgbG9uZyBwYXJzZUxvbmcoQ2hhclNlcXVlbmNlIHMsIGludCBiZWdpbkluZGV4LCBp" +
-    "bnQgZW5kSW5kZXgsIGludCByYWRpeCkgdGhyb3dzIE51bWJlckZvcm1hdEV4Y2VwdGlvbiB7CiAg" +
-    "ICAgIHRocm93IG5ldyBFcnJvcigiTWV0aG9kIHJlZGVmaW5lZCBhd2F5ISIpOwogICAgfQogICAg" +
-    "cHVibGljIHN0YXRpYyBsb25nIHBhcnNlVW5zaWduZWRMb25nKFN0cmluZyBzLCBpbnQgcmFkaXgp" +
-    "IHRocm93cyBOdW1iZXJGb3JtYXRFeGNlcHRpb24gewogICAgICB0aHJvdyBuZXcgRXJyb3IoIk1l" +
-    "dGhvZCByZWRlZmluZWQgYXdheSEiKTsKICAgIH0KICAgIHB1YmxpYyBzdGF0aWMgbG9uZyBwYXJz" +
-    "ZVVuc2lnbmVkTG9uZyhTdHJpbmcgcykgdGhyb3dzIE51bWJlckZvcm1hdEV4Y2VwdGlvbiB7CiAg" +
-    "ICAgIHRocm93IG5ldyBFcnJvcigiTWV0aG9kIHJlZGVmaW5lZCBhd2F5ISIpOwogICAgfQogICAg" +
-    "cHVibGljIHN0YXRpYyBsb25nIHBhcnNlVW5zaWduZWRMb25nKENoYXJTZXF1ZW5jZSBzLCBpbnQg" +
-    "YmVnaW5JbmRleCwgaW50IGVuZEluZGV4LCBpbnQgcmFkaXgpIHRocm93cyBOdW1iZXJGb3JtYXRF" +
-    "eGNlcHRpb24gewogICAgICB0aHJvdyBuZXcgRXJyb3IoIk1ldGhvZCByZWRlZmluZWQgYXdheSEi" +
-    "KTsKICAgIH0KICAgIHB1YmxpYyBzdGF0aWMgTG9uZyB2YWx1ZU9mKFN0cmluZyBzLCBpbnQgcmFk" +
-    "aXgpIHRocm93cyBOdW1iZXJGb3JtYXRFeGNlcHRpb24gewogICAgICB0aHJvdyBuZXcgRXJyb3Io" +
-    "Ik1ldGhvZCByZWRlZmluZWQgYXdheSEiKTsKICAgIH0KICAgIHB1YmxpYyBzdGF0aWMgTG9uZyB2" +
-    "YWx1ZU9mKFN0cmluZyBzKSB0aHJvd3MgTnVtYmVyRm9ybWF0RXhjZXB0aW9uIHsKICAgICAgdGhy" +
-    "b3cgbmV3IEVycm9yKCJNZXRob2QgcmVkZWZpbmVkIGF3YXkhIik7CiAgICB9CiAgICBwdWJsaWMg" +
-    "c3RhdGljIExvbmcgZGVjb2RlKFN0cmluZyBubSkgdGhyb3dzIE51bWJlckZvcm1hdEV4Y2VwdGlv" +
-    "biB7CiAgICAgIHRocm93IG5ldyBFcnJvcigiTWV0aG9kIHJlZGVmaW5lZCBhd2F5ISIpOwogICAg" +
-    "fQogICAgcHJpdmF0ZSBmaW5hbCBsb25nIHZhbHVlOwogICAgcHVibGljIExvbmcoU3RyaW5nIHMp" +
-    "IHRocm93cyBOdW1iZXJGb3JtYXRFeGNlcHRpb24gewogICAgICB0aGlzKDApOwogICAgICB0aHJv" +
-    "dyBuZXcgRXJyb3IoIk1ldGhvZCByZWRlZmluZWQgYXdheSEiKTsKICAgIH0KICAgIHB1YmxpYyBi" +
-    "eXRlIGJ5dGVWYWx1ZSgpIHsKICAgICAgdGhyb3cgbmV3IEVycm9yKCJNZXRob2QgcmVkZWZpbmVk" +
-    "IGF3YXkhIik7CiAgICB9CiAgICBwdWJsaWMgc2hvcnQgc2hvcnRWYWx1ZSgpIHsKICAgICAgdGhy" +
-    "b3cgbmV3IEVycm9yKCJNZXRob2QgcmVkZWZpbmVkIGF3YXkhIik7CiAgICB9CiAgICBwdWJsaWMg" +
-    "aW50IGludFZhbHVlKCkgewogICAgICB0aHJvdyBuZXcgRXJyb3IoIk1ldGhvZCByZWRlZmluZWQg" +
-    "YXdheSEiKTsKICAgIH0KICAgIHB1YmxpYyBsb25nIGxvbmdWYWx1ZSgpIHsKICAgICAgcmV0dXJu" +
-    "IHZhbHVlOwogICAgfQogICAgcHVibGljIGZsb2F0IGZsb2F0VmFsdWUoKSB7CiAgICAgIHRocm93" +
-    "IG5ldyBFcnJvcigiTWV0aG9kIHJlZGVmaW5lZCBhd2F5ISIpOwogICAgfQogICAgcHVibGljIGRv" +
-    "dWJsZSBkb3VibGVWYWx1ZSgpIHsKICAgICAgdGhyb3cgbmV3IEVycm9yKCJNZXRob2QgcmVkZWZp" +
-    "bmVkIGF3YXkhIik7CiAgICB9CiAgICBwdWJsaWMgaW50IGhhc2hDb2RlKCkgewogICAgICB0aHJv" +
-    "dyBuZXcgRXJyb3IoIk1ldGhvZCByZWRlZmluZWQgYXdheSEiKTsKICAgIH0KICAgIHB1YmxpYyBz" +
-    "dGF0aWMgaW50IGhhc2hDb2RlKGxvbmcgdmFsdWUpIHsKICAgICAgdGhyb3cgbmV3IEVycm9yKCJN" +
-    "ZXRob2QgcmVkZWZpbmVkIGF3YXkhIik7CiAgICB9CiAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMo" +
-    "T2JqZWN0IG9iaikgewogICAgICB0aHJvdyBuZXcgRXJyb3IoIk1ldGhvZCByZWRlZmluZWQgYXdh" +
-    "eSEiKTsKICAgIH0KICAgIHB1YmxpYyBzdGF0aWMgTG9uZyBnZXRMb25nKFN0cmluZyBubSkgewog" +
-    "ICAgICB0aHJvdyBuZXcgRXJyb3IoIk1ldGhvZCByZWRlZmluZWQgYXdheSEiKTsKICAgIH0KICAg" +
-    "IHB1YmxpYyBzdGF0aWMgTG9uZyBnZXRMb25nKFN0cmluZyBubSwgbG9uZyB2YWwpIHsKICAgICAg" +
-    "dGhyb3cgbmV3IEVycm9yKCJNZXRob2QgcmVkZWZpbmVkIGF3YXkhIik7CiAgICB9CiAgICBwdWJs" +
-    "aWMgc3RhdGljIExvbmcgZ2V0TG9uZyhTdHJpbmcgbm0sIExvbmcgdmFsKSB7CiAgICAgIHRocm93" +
-    "IG5ldyBFcnJvcigiTWV0aG9kIHJlZGVmaW5lZCBhd2F5ISIpOwogICAgfQogICAgcHVibGljIGlu" +
-    "dCBjb21wYXJlVG8oTG9uZyBhbm90aGVyTG9uZykgewogICAgICB0aHJvdyBuZXcgRXJyb3IoIk1l" +
-    "dGhvZCByZWRlZmluZWQgYXdheSEiKTsKICAgIH0KICAgIHB1YmxpYyBzdGF0aWMgaW50IGNvbXBh" +
-    "cmUobG9uZyB4LCBsb25nIHkpIHsKICAgICAgdGhyb3cgbmV3IEVycm9yKCJNZXRob2QgcmVkZWZp" +
-    "bmVkIGF3YXkhIik7CiAgICB9CiAgICBwdWJsaWMgc3RhdGljIGludCBjb21wYXJlVW5zaWduZWQo" +
-    "bG9uZyB4LCBsb25nIHkpIHsKICAgICAgdGhyb3cgbmV3IEVycm9yKCJNZXRob2QgcmVkZWZpbmVk" +
-    "IGF3YXkhIik7CiAgICB9CiAgICBwdWJsaWMgc3RhdGljIGxvbmcgZGl2aWRlVW5zaWduZWQobG9u" +
-    "ZyBkaXZpZGVuZCwgbG9uZyBkaXZpc29yKSB7CiAgICAgIHRocm93IG5ldyBFcnJvcigiTWV0aG9k" +
-    "IHJlZGVmaW5lZCBhd2F5ISIpOwogICAgfQogICAgcHVibGljIHN0YXRpYyBsb25nIHJlbWFpbmRl" +
-    "clVuc2lnbmVkKGxvbmcgZGl2aWRlbmQsIGxvbmcgZGl2aXNvcikgewogICAgICB0aHJvdyBuZXcg" +
-    "RXJyb3IoIk1ldGhvZCByZWRlZmluZWQgYXdheSEiKTsKICAgIH0KICAgIHB1YmxpYyBzdGF0aWMg" +
-    "ZmluYWwgaW50IFNJWkUgPSA2NDsKICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEJZVEVTID0g" +
-    "U0laRSAvIEJ5dGUuU0laRTsKICAgIHB1YmxpYyBzdGF0aWMgbG9uZyBtYXgobG9uZyBhLCBsb25n" +
-    "IGIpIHsKICAgICAgdGhyb3cgbmV3IEVycm9yKCJNZXRob2QgcmVkZWZpbmVkIGF3YXkhIik7CiAg" +
-    "ICB9CiAgICBwdWJsaWMgc3RhdGljIGxvbmcgbWluKGxvbmcgYSwgbG9uZyBiKSB7CiAgICAgIHRo" +
-    "cm93IG5ldyBFcnJvcigiTWV0aG9kIHJlZGVmaW5lZCBhd2F5ISIpOwogICAgfQogICAgcHJpdmF0" +
-    "ZSBzdGF0aWMgZmluYWwgbG9uZyBzZXJpYWxWZXJzaW9uVUlEID0gMDsKfQo="
-     );
+    "yv66vgAAAD0AwQcAAgEADmphdmEvbGFuZy9Mb25nBwAEAQAOamF2YS9sYW5nL0J5dGUKAAYABwcA" +
+    "CAwACQAKAQAQamF2YS9sYW5nL051bWJlcgEABjxpbml0PgEAAygpVgkAAQAMDAANAA4BAAV2YWx1" +
+    "ZQEAAUoKAAEAEAwACQARAQAEKEopVgUAAAAAAAAACgcAFQEAF2phdmEvbGFuZy9TdHJpbmdCdWls" +
+    "ZGVyCgAUAAcIABgBACJSZWRlZmluZWQgTG9uZyEgdmFsdWUgKGFzIGRvdWJsZSk9CgAUABoMABsA" +
+    "HAEABmFwcGVuZAEALShMamF2YS9sYW5nL1N0cmluZzspTGphdmEvbGFuZy9TdHJpbmdCdWlsZGVy" +
+    "OwoAFAAeDAAbAB8BABwoRClMamF2YS9sYW5nL1N0cmluZ0J1aWxkZXI7CgAUACEMACIAIwEACHRv" +
+    "U3RyaW5nAQAUKClMamF2YS9sYW5nL1N0cmluZzsHACUBAA9qYXZhL2xhbmcvRXJyb3IIACcBABZN" +
+    "ZXRob2QgcmVkZWZpbmVkIGF3YXkhCgAkACkMAAkAKgEAFShMamF2YS9sYW5nL1N0cmluZzspVgoA" +
+    "AQAsDAAtAC4BAAljb21wYXJlVG8BABMoTGphdmEvbGFuZy9Mb25nOylJCgABADAMADEAMgEAE3Jl" +
+    "c29sdmVDb25zdGFudERlc2MBADkoTGphdmEvbGFuZy9pbnZva2UvTWV0aG9kSGFuZGxlcyRMb29r" +
+    "dXA7KUxqYXZhL2xhbmcvTG9uZzsJAAEANAwANQA2AQAEVFlQRQEAEUxqYXZhL2xhbmcvQ2xhc3M7" +
+    "BwA4AQAUamF2YS9sYW5nL0NvbXBhcmFibGUHADoBABxqYXZhL2xhbmcvY29uc3RhbnQvQ29uc3Rh" +
+    "YmxlBwA8AQAfamF2YS9sYW5nL2NvbnN0YW50L0NvbnN0YW50RGVzYwEACU1JTl9WQUxVRQEADUNv" +
+    "bnN0YW50VmFsdWUFAAAAAAAAAAABAAlNQVhfVkFMVUUBAAlTaWduYXR1cmUBACNMamF2YS9sYW5n" +
+    "L0NsYXNzPExqYXZhL2xhbmcvTG9uZzs+OwEABFNJWkUBAAFJAwAAAEABAAVCWVRFUwMAAAAIAQAQ" +
+    "c2VyaWFsVmVyc2lvblVJRAEAA3N1bQEABShKSilKAQAEQ29kZQEAD0xpbmVOdW1iZXJUYWJsZQEA" +
+    "EkxvY2FsVmFyaWFibGVUYWJsZQEAAWEBAAFiAQAEdGhpcwEAEExqYXZhL2xhbmcvTG9uZzsBAAd2" +
+    "YWx1ZU9mAQATKEopTGphdmEvbGFuZy9Mb25nOwEAAWwBAA1oaWdoZXN0T25lQml0AQAEKEopSgEA" +
+    "AWkBAAxsb3dlc3RPbmVCaXQBABRudW1iZXJPZkxlYWRpbmdaZXJvcwEABChKKUkBABVudW1iZXJP" +
+    "ZlRyYWlsaW5nWmVyb3MBAAhiaXRDb3VudAEACnJvdGF0ZUxlZnQBAAUoSkkpSgEACGRpc3RhbmNl" +
+    "AQALcm90YXRlUmlnaHQBAAdyZXZlcnNlAQAGc2lnbnVtAQAMcmV2ZXJzZUJ5dGVzAQAWKEpJKUxq" +
+    "YXZhL2xhbmcvU3RyaW5nOwEABXJhZGl4AQAQdG9VbnNpZ25lZFN0cmluZwEAFHRvVW5zaWduZWRC" +
+    "aWdJbnRlZ2VyAQAZKEopTGphdmEvbWF0aC9CaWdJbnRlZ2VyOwEAC3RvSGV4U3RyaW5nAQAVKEop" +
+    "TGphdmEvbGFuZy9TdHJpbmc7AQANdG9PY3RhbFN0cmluZwEADnRvQmluYXJ5U3RyaW5nAQARdG9V" +
+    "bnNpZ25lZFN0cmluZzABAAN2YWwBAAVzaGlmdAEAE2Zvcm1hdFVuc2lnbmVkTG9uZzABAAkoSklb" +
+    "QklJKVYBAANidWYBAAJbQgEABm9mZnNldAEAA2xlbgEACGdldENoYXJzAQAHKEpJW0IpSQEABWlu" +
+    "ZGV4AQAHKEpJW0MpSQEAAltDAQAKc3RyaW5nU2l6ZQEAAXgBAAlwYXJzZUxvbmcBABYoTGphdmEv" +
+    "bGFuZy9TdHJpbmc7SSlKAQABcwEAEkxqYXZhL2xhbmcvU3RyaW5nOwEACkV4Y2VwdGlvbnMHAIQB" +
+    "AB9qYXZhL2xhbmcvTnVtYmVyRm9ybWF0RXhjZXB0aW9uAQAVKExqYXZhL2xhbmcvU3RyaW5nOylK" +
+    "AQAeKExqYXZhL2xhbmcvQ2hhclNlcXVlbmNlO0lJSSlKAQAYTGphdmEvbGFuZy9DaGFyU2VxdWVu" +
+    "Y2U7AQAKYmVnaW5JbmRleAEACGVuZEluZGV4AQARcGFyc2VVbnNpZ25lZExvbmcBACUoTGphdmEv" +
+    "bGFuZy9TdHJpbmc7SSlMamF2YS9sYW5nL0xvbmc7AQAkKExqYXZhL2xhbmcvU3RyaW5nOylMamF2" +
+    "YS9sYW5nL0xvbmc7AQAGZGVjb2RlAQACbm0BAAlieXRlVmFsdWUBAAMoKUIBAApzaG9ydFZhbHVl" +
+    "AQADKClTAQAIaW50VmFsdWUBAAMoKUkBAAlsb25nVmFsdWUBAAMoKUoBAApmbG9hdFZhbHVlAQAD" +
+    "KClGAQALZG91YmxlVmFsdWUBAAMoKUQBAAhoYXNoQ29kZQEABmVxdWFscwEAFShMamF2YS9sYW5n" +
+    "L09iamVjdDspWgEAA29iagEAEkxqYXZhL2xhbmcvT2JqZWN0OwEAB2dldExvbmcBACUoTGphdmEv" +
+    "bGFuZy9TdHJpbmc7SilMamF2YS9sYW5nL0xvbmc7AQA0KExqYXZhL2xhbmcvU3RyaW5nO0xqYXZh" +
+    "L2xhbmcvTG9uZzspTGphdmEvbGFuZy9Mb25nOwEAC2Fub3RoZXJMb25nAQAHY29tcGFyZQEABShK" +
+    "SilJAQABeQEAD2NvbXBhcmVVbnNpZ25lZAEADmRpdmlkZVVuc2lnbmVkAQAIZGl2aWRlbmQBAAdk" +
+    "aXZpc29yAQARcmVtYWluZGVyVW5zaWduZWQBAANtYXgBAANtaW4BABFkZXNjcmliZUNvbnN0YWJs" +
+    "ZQEAFigpTGphdmEvdXRpbC9PcHRpb25hbDsBAEAoKUxqYXZhL3V0aWwvT3B0aW9uYWw8TGphdmEv" +
+    "bGFuZy9jb25zdGFudC9EeW5hbWljQ29uc3RhbnREZXNjOz47AQAGbG9va3VwAQAnTGphdmEvbGFu" +
+    "Zy9pbnZva2UvTWV0aG9kSGFuZGxlcyRMb29rdXA7AQAVKExqYXZhL2xhbmcvT2JqZWN0OylJAQA7" +
+    "KExqYXZhL2xhbmcvaW52b2tlL01ldGhvZEhhbmRsZXMkTG9va3VwOylMamF2YS9sYW5nL09iamVj" +
+    "dDsHALYBACZqYXZhL2xhbmcvUmVmbGVjdGl2ZU9wZXJhdGlvbkV4Y2VwdGlvbgEACDxjbGluaXQ+" +
+    "AQB5TGphdmEvbGFuZy9OdW1iZXI7TGphdmEvbGFuZy9Db21wYXJhYmxlPExqYXZhL2xhbmcvTG9u" +
+    "Zzs+O0xqYXZhL2xhbmcvY29uc3RhbnQvQ29uc3RhYmxlO0xqYXZhL2xhbmcvY29uc3RhbnQvQ29u" +
+    "c3RhbnREZXNjOwEAClNvdXJjZUZpbGUBAAlMb25nLmphdmEBAAxJbm5lckNsYXNzZXMHAL0BACVq" +
+    "YXZhL2xhbmcvaW52b2tlL01ldGhvZEhhbmRsZXMkTG9va3VwBwC/AQAeamF2YS9sYW5nL2ludm9r" +
+    "ZS9NZXRob2RIYW5kbGVzAQAGTG9va3VwADEAAQAGAAMANwA5ADsABwAZAD0ADgABAD4AAAACAD8A" +
+    "GQBBAA4AAQA+AAAAAgA/ABkANQA2AAEAQgAAAAIAQwASAA0ADgAAABkARABFAAEAPgAAAAIARgAZ" +
+    "AEcARQABAD4AAAACAEgAGgBJAA4AAQA+AAAAAgA/AD0ACQBKAEsAAQBMAAAAOAAEAAQAAAAEHiBh" +
+    "rQAAAAIATQAAAAYAAQAAABAATgAAABYAAgAAAAQATwAOAAAAAAAEAFAADgACAAEACQARAAEATAAA" +
+    "AEYAAwADAAAACiq3AAUqH7UAC7EAAAACAE0AAAAOAAMAAAATAAQAFAAJABUATgAAABYAAgAAAAoA" +
+    "UQBSAAAAAAAKAA0ADgABAAkAUwBUAAEATAAAADMABAACAAAACbsAAVketwAPsAAAAAIATQAAAAYA" +
+    "AQAAABgATgAAAAwAAQAAAAkAVQAOAAAACQBWAFcAAQBMAAAALgAEAAIAAAAEHgphrQAAAAIATQAA" +
+    "AAYAAQAAABwATgAAAAwAAQAAAAQAWAAOAAAACQBZAFcAAQBMAAAALgAEAAIAAAAEHgplrQAAAAIA" +
+    "TQAAAAYAAQAAACAATgAAAAwAAQAAAAQAWAAOAAAACQBaAFsAAQBMAAAALwAEAAIAAAAFHh5hiKwA" +
+    "AAACAE0AAAAGAAEAAAAkAE4AAAAMAAEAAAAFAFgADgAAAAkAXABbAAEATAAAADEABQACAAAABx4e" +
+    "BH1/iKwAAAACAE0AAAAGAAEAAAAoAE4AAAAMAAEAAAAHAFgADgAAAAkAXQBbAAEATAAAACwAAQAC" +
+    "AAAAAgisAAAAAgBNAAAABgABAAAALABOAAAADAABAAAAAgBYAA4AAAAJAF4AXwABAEwAAAA2AAIA" +
+    "AwAAAAIerQAAAAIATQAAAAYAAQAAADAATgAAABYAAgAAAAIAWAAOAAAAAAACAGAARQACAAkAYQBf" +
+    "AAEATAAAADoABAADAAAABhQAEh5prQAAAAIATQAAAAYAAQAAADQATgAAABYAAgAAAAYAWAAOAAAA" +
+    "AAAGAGAARQACAAkAYgBXAAEATAAAAC0AAgACAAAAAx51rQAAAAIATQAAAAYAAQAAADgATgAAAAwA" +
+    "AQAAAAMAWAAOAAAACQBjAFsAAQBMAAAALAABAAIAAAACA6wAAAACAE0AAAAGAAEAAAA8AE4AAAAM" +
+    "AAEAAAACAFgADgAAAAkAZABXAAEATAAAACwAAgACAAAAAgmtAAAAAgBNAAAABgABAAAAQABOAAAA" +
+    "DAABAAAAAgBYAA4AAAABACIAIwABAEwAAABCAAMAAQAAABi7ABRZtwAWEhe2ABkqtAALirYAHbYA" +
+    "ILAAAAACAE0AAAAGAAEAAABDAE4AAAAMAAEAAAAYAFEAUgAAAAkAIgBlAAEATAAAAD4AAwADAAAA" +
+    "CrsAJFkSJrcAKL8AAAACAE0AAAAGAAEAAABGAE4AAAAWAAIAAAAKAFgADgAAAAAACgBmAEUAAgAJ" +
+    "AGcAZQABAEwAAAA+AAMAAwAAAAq7ACRZEia3ACi/AAAAAgBNAAAABgABAAAASQBOAAAAFgACAAAA" +
+    "CgBYAA4AAAAAAAoAZgBFAAIACgBoAGkAAQBMAAAANAADAAIAAAAKuwAkWRImtwAovwAAAAIATQAA" +
+    "AAYAAQAAAEwATgAAAAwAAQAAAAoAWAAOAAAACQBqAGsAAQBMAAAANAADAAIAAAAKuwAkWRImtwAo" +
+    "vwAAAAIATQAAAAYAAQAAAE8ATgAAAAwAAQAAAAoAWAAOAAAACQBsAGsAAQBMAAAANAADAAIAAAAK" +
+    "uwAkWRImtwAovwAAAAIATQAAAAYAAQAAAFIATgAAAAwAAQAAAAoAWAAOAAAACQBtAGsAAQBMAAAA" +
+    "NAADAAIAAAAKuwAkWRImtwAovwAAAAIATQAAAAYAAQAAAFUATgAAAAwAAQAAAAoAWAAOAAAACABu" +
+    "AGUAAQBMAAAAPgADAAMAAAAKuwAkWRImtwAovwAAAAIATQAAAAYAAQAAAFgATgAAABYAAgAAAAoA" +
+    "bwAOAAAAAAAKAHAARQACAAgAcQByAAEATAAAAFwAAwAGAAAACrsAJFkSJrcAKL8AAAACAE0AAAAG" +
+    "AAEAAABbAE4AAAA0AAUAAAAKAG8ADgAAAAAACgBwAEUAAgAAAAoAcwB0AAMAAAAKAHUARQAEAAAA" +
+    "CgB2AEUABQAJACIAawABAEwAAAA0AAMAAgAAAAq7ACRZEia3ACi/AAAAAgBNAAAABgABAAAAXgBO" +
+    "AAAADAABAAAACgBYAA4AAAAJAGcAawABAEwAAAA0AAMAAgAAAAq7ACRZEia3ACi/AAAAAgBNAAAA" +
+    "BgABAAAAYQBOAAAADAABAAAACgBYAA4AAAAIAHcAeAABAEwAAABIAAMABAAAAAq7ACRZEia3ACi/" +
+    "AAAAAgBNAAAABgABAAAAZABOAAAAIAADAAAACgBYAA4AAAAAAAoAeQBFAAIAAAAKAHMAdAADAAgA" +
+    "dwB6AAEATAAAAEgAAwAEAAAACrsAJFkSJrcAKL8AAAACAE0AAAAGAAEAAABnAE4AAAAgAAMAAAAK" +
+    "AFgADgAAAAAACgB5AEUAAgAAAAoAcwB7AAMACAB8AFsAAQBMAAAANAADAAIAAAAKuwAkWRImtwAo" +
+    "vwAAAAIATQAAAAYAAQAAAGoATgAAAAwAAQAAAAoAfQAOAAAACQB+AH8AAgBMAAAAPgADAAIAAAAK" +
+    "uwAkWRImtwAovwAAAAIATQAAAAYAAQAAAG0ATgAAABYAAgAAAAoAgACBAAAAAAAKAGYARQABAIIA" +
+    "AAAEAAEAgwAJAH4AhQACAEwAAAA0AAMAAQAAAAq7ACRZEia3ACi/AAAAAgBNAAAABgABAAAAcABO" +
+    "AAAADAABAAAACgCAAIEAAACCAAAABAABAIMACQB+AIYAAgBMAAAAUgADAAQAAAAKuwAkWRImtwAo" +
+    "vwAAAAIATQAAAAYAAQAAAHMATgAAACoABAAAAAoAgACHAAAAAAAKAIgARQABAAAACgCJAEUAAgAA" +
+    "AAoAZgBFAAMAggAAAAQAAQCDAAkAigB/AAIATAAAAD4AAwACAAAACrsAJFkSJrcAKL8AAAACAE0A" +
+    "AAAGAAEAAAB2AE4AAAAWAAIAAAAKAIAAgQAAAAAACgBmAEUAAQCCAAAABAABAIMACQCKAIUAAgBM" +
+    "AAAANAADAAEAAAAKuwAkWRImtwAovwAAAAIATQAAAAYAAQAAAHkATgAAAAwAAQAAAAoAgACBAAAA" +
+    "ggAAAAQAAQCDAAkAigCGAAIATAAAAFIAAwAEAAAACrsAJFkSJrcAKL8AAAACAE0AAAAGAAEAAAB8" +
+    "AE4AAAAqAAQAAAAKAIAAhwAAAAAACgCIAEUAAQAAAAoAiQBFAAIAAAAKAGYARQADAIIAAAAEAAEA" +
+    "gwAJAFMAiwACAEwAAAA+AAMAAgAAAAq7ACRZEia3ACi/AAAAAgBNAAAABgABAAAAfwBOAAAAFgAC" +
+    "AAAACgCAAIEAAAAAAAoAZgBFAAEAggAAAAQAAQCDAAkAUwCMAAIATAAAADQAAwABAAAACrsAJFkS" +
+    "JrcAKL8AAAACAE0AAAAGAAEAAACCAE4AAAAMAAEAAAAKAIAAgQAAAIIAAAAEAAEAgwAJAI0AjAAC" +
+    "AEwAAAA0AAMAAQAAAAq7ACRZEia3ACi/AAAAAgBNAAAABgABAAAAhQBOAAAADAABAAAACgCOAIEA" +
+    "AACCAAAABAABAIMAAQAJACoAAgBMAAAARwADAAIAAAAPKgm3AA+7ACRZEia3ACi/AAAAAgBNAAAA" +
+    "CgACAAAAiQAFAIoATgAAABYAAgAAAA8AUQBSAAAAAAAPAIAAgQABAIIAAAAEAAEAgwABAI8AkAAB" +
+    "AEwAAAA0AAMAAQAAAAq7ACRZEia3ACi/AAAAAgBNAAAABgABAAAAjQBOAAAADAABAAAACgBRAFIA" +
+    "AAABAJEAkgABAEwAAAA0AAMAAQAAAAq7ACRZEia3ACi/AAAAAgBNAAAABgABAAAAkABOAAAADAAB" +
+    "AAAACgBRAFIAAAABAJMAlAABAEwAAAA0AAMAAQAAAAq7ACRZEia3ACi/AAAAAgBNAAAABgABAAAA" +
+    "kwBOAAAADAABAAAACgBRAFIAAAABAJUAlgABAEwAAAAvAAIAAQAAAAUqtAALrQAAAAIATQAAAAYA" +
+    "AQAAAJYATgAAAAwAAQAAAAUAUQBSAAAAAQCXAJgAAQBMAAAANAADAAEAAAAKuwAkWRImtwAovwAA" +
+    "AAIATQAAAAYAAQAAAJkATgAAAAwAAQAAAAoAUQBSAAAAAQCZAJoAAQBMAAAANAADAAEAAAAKuwAk" +
+    "WRImtwAovwAAAAIATQAAAAYAAQAAAJwATgAAAAwAAQAAAAoAUQBSAAAAAQCbAJQAAQBMAAAANAAD" +
+    "AAEAAAAKuwAkWRImtwAovwAAAAIATQAAAAYAAQAAAJ8ATgAAAAwAAQAAAAoAUQBSAAAACQCbAFsA" +
+    "AQBMAAAANAADAAIAAAAKuwAkWRImtwAovwAAAAIATQAAAAYAAQAAAKIATgAAAAwAAQAAAAoADQAO" +
+    "AAAAAQCcAJ0AAQBMAAAAPgADAAIAAAAKuwAkWRImtwAovwAAAAIATQAAAAYAAQAAAKUATgAAABYA" +
+    "AgAAAAoAUQBSAAAAAAAKAJ4AnwABAAkAoACMAAEATAAAADQAAwABAAAACrsAJFkSJrcAKL8AAAAC" +
+    "AE0AAAAGAAEAAACoAE4AAAAMAAEAAAAKAI4AgQAAAAkAoAChAAEATAAAAD4AAwADAAAACrsAJFkS" +
+    "JrcAKL8AAAACAE0AAAAGAAEAAACrAE4AAAAWAAIAAAAKAI4AgQAAAAAACgBvAA4AAQAJAKAAogAB" +
+    "AEwAAAA+AAMAAgAAAAq7ACRZEia3ACi/AAAAAgBNAAAABgABAAAArgBOAAAAFgACAAAACgCOAIEA" +
+    "AAAAAAoAbwBSAAEAAQAtAC4AAQBMAAAAPgADAAIAAAAKuwAkWRImtwAovwAAAAIATQAAAAYAAQAA" +
+    "ALEATgAAABYAAgAAAAoAUQBSAAAAAAAKAKMAUgABAAkApAClAAEATAAAAD4AAwAEAAAACrsAJFkS" +
+    "JrcAKL8AAAACAE0AAAAGAAEAAAC0AE4AAAAWAAIAAAAKAH0ADgAAAAAACgCmAA4AAgAJAKcApQAB" +
+    "AEwAAAA+AAMABAAAAAq7ACRZEia3ACi/AAAAAgBNAAAABgABAAAAtwBOAAAAFgACAAAACgB9AA4A" +
+    "AAAAAAoApgAOAAIACQCoAEsAAQBMAAAAPgADAAQAAAAKuwAkWRImtwAovwAAAAIATQAAAAYAAQAA" +
+    "ALoATgAAABYAAgAAAAoAqQAOAAAAAAAKAKoADgACAAkAqwBLAAEATAAAAD4AAwAEAAAACrsAJFkS" +
+    "JrcAKL8AAAACAE0AAAAGAAEAAAC9AE4AAAAWAAIAAAAKAKkADgAAAAAACgCqAA4AAgAJAKwASwAB" +
+    "AEwAAAA+AAMABAAAAAq7ACRZEia3ACi/AAAAAgBNAAAABgABAAAAwgBOAAAAFgACAAAACgBPAA4A" +
+    "AAAAAAoAUAAOAAIACQCtAEsAAQBMAAAAPgADAAQAAAAKuwAkWRImtwAovwAAAAIATQAAAAYAAQAA" +
+    "AMUATgAAABYAAgAAAAoATwAOAAAAAAAKAFAADgACAAEArgCvAAIATAAAADQAAwABAAAACrsAJFkS" +
+    "JrcAKL8AAAACAE0AAAAGAAEAAADMAE4AAAAMAAEAAAAKAFEAUgAAAEIAAAACALAAAQAxADIAAQBM" +
+    "AAAAPgADAAIAAAAKuwAkWRImtwAovwAAAAIATQAAAAYAAQAAANIATgAAABYAAgAAAAoAUQBSAAAA" +
+    "AAAKALEAsgABEEEALQCzAAEATAAAADMAAgACAAAACSorwAABtgArrAAAAAIATQAAAAYAAQAAAAkA" +
+    "TgAAAAwAAQAAAAkAUQBSAAAQQQAxALQAAgBMAAAAMAACAAIAAAAGKiu2AC+wAAAAAgBNAAAABgAB" +
+    "AAAACQBOAAAADAABAAAABgBRAFIAAACCAAAABAABALUACAC3AAoAAQBMAAAAIQABAAAAAAAFAbMA" +
+    "M7EAAAABAE0AAAAKAAIAAAAMAAQADQADAEIAAAACALgAuQAAAAIAugC7AAAACgABALwAvgDAABk="
+    );
+
   private static final byte[] DEX_BYTES = Base64.getDecoder().decode(
-    "ZGV4CjAzNQBK1KDH4XsaDo1wwk5bAfM7SZgyUbgRdcFcFgAAcAAAAHhWNBIAAAAAAAAAAIwVAABn" +
-    "AAAAcAAAABcAAAAMAgAAIgAAAGgCAAAHAAAAAAQAAEAAAAA4BAAAAQAAADgGAAAEEAAAWAYAAOIO" +
-    "AADsDgAA9A4AAPgOAAD7DgAAAg8AAAUPAAAIDwAACw8AAA8PAAAVDwAAGg8AAB4PAAAhDwAAJQ8A" +
-    "ACoPAAAvDwAAMw8AADgPAAA/DwAAQg8AAEYPAABKDwAATw8AAFMPAABYDwAAXQ8AAGIPAACBDwAA" +
-    "nQ8AALcPAADKDwAA3Q8AAPUPAAANEAAAIBAAADIQAABGEAAAaRAAAH0QAACREAAArBAAAMQQAADP" +
-    "EAAA2hAAAOUQAAD9EAAAIREAACQRAAAqEQAAMBEAADMRAAA3EQAAPxEAAEMRAABGEQAAShEAAE4R" +
-    "AABSEQAAWhEAAGQRAABvEQAAeBEAAIMRAACUEQAAnBEAAKwRAAC5EQAAwREAAM0RAADiEQAA7BEA" +
-    "APURAAD/EQAADhIAABgSAAAjEgAAMRIAADYSAAA7EgAAURIAAGgSAABzEgAAhhIAAJkSAACiEgAA" +
-    "sBIAALwSAADJEgAA2xIAAOcSAADvEgAA+xIAAAATAAAQEwAAHRMAACwTAAA2EwAATBMAAF4TAABx" +
-    "EwAAeBMAAIETAAADAAAABQAAAAYAAAAHAAAADAAAABsAAAAcAAAAHQAAAB4AAAAgAAAAIgAAACMA" +
-    "AAAkAAAAJQAAACYAAAAnAAAAKAAAACkAAAAvAAAAMgAAADYAAAA4AAAAOQAAAAMAAAAAAAAAAAAA" +
-    "AAUAAAABAAAAAAAAAAYAAAACAAAAAAAAAAcAAAADAAAAAAAAAAgAAAADAAAAYA4AAAkAAAADAAAA" +
-    "aA4AAAkAAAADAAAAdA4AAAoAAAADAAAAgA4AAAsAAAADAAAAiA4AAAsAAAADAAAAkA4AAAwAAAAE" +
-    "AAAAAAAAAA0AAAAEAAAAYA4AAA4AAAAEAAAAmA4AAA8AAAAEAAAAgA4AABIAAAAEAAAAoA4AABAA" +
-    "AAAEAAAArA4AABEAAAAEAAAAtA4AABUAAAALAAAAYA4AABcAAAALAAAArA4AABgAAAALAAAAtA4A" +
-    "ABkAAAALAAAAvA4AABoAAAALAAAAxA4AABMAAAAPAAAAAAAAABUAAAAPAAAAYA4AABYAAAAPAAAA" +
-    "mA4AABQAAAAQAAAAzA4AABcAAAAQAAAArA4AABUAAAARAAAAYA4AAC8AAAASAAAAAAAAADIAAAAT" +
-    "AAAAAAAAADMAAAATAAAAYA4AADQAAAATAAAA1A4AADUAAAATAAAArA4AADcAAAAUAAAAkA4AAAsA" +
-    "AwAEAAAACwAEACsAAAALAAQALAAAAAsAAwAwAAAACwAIADEAAAALAAQAWAAAAAsABABkAAAACgAg" +
-    "AAEAAAALAB0AAAAAAAsAHgABAAAACwAgAAEAAAALAAQAOwAAAAsAAAA8AAAACwAHAD0AAAALAAgA" +
-    "PgAAAAsACQA+AAAACwAHAD8AAAALABIAQAAAAAsADQBBAAAACwABAEIAAAALACEAQwAAAAsAAgBE" +
-    "AAAACwAfAEUAAAALAAUARgAAAAsABgBGAAAACwASAEcAAAALABQARwAAAAsAFQBHAAAACwADAEgA" +
-    "AAALAAQASAAAAAsACwBJAAAACwADAEoAAAALAAoASwAAAAsACwBMAAAACwANAE0AAAALAA0ATgAA" +
-    "AAsABABPAAAACwAEAFAAAAALAA4AUQAAAAsADwBRAAAACwAQAFEAAAALAA4AUgAAAAsADwBSAAAA" +
-    "CwAQAFIAAAALAA0AUwAAAAsACwBUAAAACwALAFUAAAALAAwAVgAAAAsADABXAAAACwAcAFkAAAAL" +
-    "AAQAWgAAAAsABABbAAAACwANAFwAAAALABcAXQAAAAsAFwBeAAAACwAXAF8AAAALABYAYAAAAAsA" +
-    "FwBgAAAACwAYAGAAAAALABsAYQAAAAsAFwBiAAAACwAYAGIAAAALABgAYwAAAAsAEQBlAAAACwAS" +
-    "AGUAAAALABMAZQAAAAwAHQABAAAAEAAdAAEAAAAQABkAOgAAABAAGgA6AAAAEAAWAGAAAAALAAAA" +
-    "EQAAAAwAAABYDgAAKgAAACQVAAD+EwAA/xQAAAMAAgACAAAAMg4AAAgAAAAiAgoAGgAtAHAgAAAC" +
-    "ACcCAwABAAIAAAAdDgAACAAAACIACgAaAS0AcCAAABAAJwADAAEAAgAAAC0OAAAIAAAAIgAKABoB" +
-    "LQBwIAAAEAAnAAMAAQACAAAAOA4AAAgAAAAiAAoAGgEtAHAgAAAQACcAAgACAAAAAAAAAAAAAgAA" +
-    "ABJQDwAEAAQAAgAAAE0NAAAIAAAAIgAKABoBLQBwIAAAEAAnAAMAAgACAAAAIg4AAAgAAAAiAgoA" +
-    "GgAtAHAgAAACACcCAgACAAIAAAAoDgAABwAAAB8BCwBuIAcAEAAKAQ8BAAAEAAQAAgAAAFQNAAAI" +
-    "AAAAIgAKABoBLQBwIAAAEAAnAAQABAACAAAAcQ0AAAgAAAAiAAoAGgEtAHAgAAAQACcABAAEAAIA" +
-    "AAB4DQAACAAAACIACgAaAS0AcCAAABAAJwADAAEAAgAAAD0OAAAIAAAAIgAKABoBLQBwIAAAEAAn" +
-    "AAIAAgACAAAAkw0AAAgAAAAiAAoAGgEtAHAgAAAQACcAAwABAAIAAABCDgAACAAAACIACgAaAS0A" +
-    "cCAAABAAJwACAAIAAAAAAAAAAAADAAAAuwCEAQ8BAAAEAAIAAAAAAAAAAAAGAAAAEhClAAIAwAKE" +
-    "Iw8DAgACAAAAAAAAAAAAAgAAABIADwACAAIAAgAAANYNAAAIAAAAIgAKABoBLQBwIAAAEAAnAAIA" +
-    "AQACAAAAWw0AAAgAAAAiAQoAGgAtAHAgAAABACcBAgABAAIAAAB/DQAACAAAACIBCgAaAC0AcCAA" +
-    "AAEAJwECAAIAAgAAAIwNAAAIAAAAIgAKABoBLQBwIAAAEAAnAAMAAwACAAAAhQ0AAAgAAAAiAAoA" +
-    "GgEtAHAgAAAQACcAAgABAAIAAAAQDgAACAAAACIBCgAaAC0AcCAAAAEAJwECAAIAAgAAABYOAAAI" +
-    "AAAAIgAKABoBLQBwIAAAEAAnAAMAAgADAAAACw4AAAYAAAAiAAsAcDACABACEQACAAIAAgAAANsN" +
-    "AAAIAAAAIgAKABoBLQBwIAAAEAAnAAIAAgACAAAA4A0AAAgAAAAiAAoAGgEtAHAgAAAQACcAAgAC" +
-    "AAIAAADlDQAACAAAACIACgAaAS0AcCAAABAAJwAEAAEAAwAAAFEOAAAVAAAAIgAQAHAQPAAAABoB" +
-    "LgBuID4AEABTMQYAhhFuMD0AEAJuED8AAAAMABEAAAACAAIAAgAAAOoNAAAIAAAAIgAKABoBLQBw" +
-    "IAAAEAAnAAMAAwACAAAA7w0AAAgAAAAiAAoAGgEtAHAgAAAQACcAAgACAAIAAAD6DQAACAAAACIA" +
-    "CgAaAS0AcCAAABAAJwADAAMAAgAAAP8NAAAIAAAAIgAKABoBLQBwIAAAEAAnAAMAAwACAAAABQ4A" +
-    "AAgAAAAiAAoAGgEtAHAgAAAQACcAAgACAAIAAAD1DQAACAAAACIACgAaAS0AcCAAABAAJwAEAAQA" +
-    "AgAAAGENAAAIAAAAIgAKABoBLQBwIAAAEAAnAAQAAgAAAAAAAAAAAAQAAAAWAAEAuwIQAgMAAQAA" +
-    "AAAARw4AAAMAAABTIAYAEAAAAAQAAgAAAAAAAAAAAAQAAAAWAAEAvAIQAgQABAACAAAAmQ0AAAgA" +
-    "AAAiAAoAGgEtAHAgAAAQACcABAAEAAIAAACgDQAACAAAACIACgAaAS0AcCAAABAAJwAEAAQAAgAA" +
-    "AKcNAAAIAAAAIgAKABoBLQBwIAAAEAAnAAIAAQACAAAArw0AAAgAAAAiAQoAGgAtAHAgAAABACcB" +
-    "AgACAAIAAAC0DQAACAAAACIACgAaAS0AcCAAABAAJwAEAAQAAgAAALoNAAAIAAAAIgAKABoBLQBw" +
-    "IAAAEAAnAAIAAQACAAAAww0AAAgAAAAiAQoAGgAtAHAgAAABACcBAgACAAIAAADJDQAACAAAACIA" +
-    "CgAaAS0AcCAAABAAJwAEAAQAAgAAAM8NAAAIAAAAIgAKABoBLQBwIAAAEAAnAAIAAgAAAAAAAAAA" +
-    "AAIAAAB9ABAAAgACAAAAAAAAAAAAAwAAABYAAAAQAAAAAwADAAAAAAAAAAAAAQAAABAAAAAFAAMA" +
-    "AAAAAAAAAAAFAAAAFgAKAJ0CAgAQAgAABAAEAAAAAAAAAAAAAgAAALsgEAADAAEAAgAAAEwOAAAI" +
-    "AAAAIgAKABoBLQBwIAAAEAAnAAAAAAAAAAAAAAAAAAEAAAAOAAAABAACAAMAAABGDQAADQAAABYA" +
-    "AABwMAIAAgEiAwoAGgAtAHAgAAADACcDAAADAAMAAQAAAEANAAAGAAAAcBA7AAAAWgEGAA4ABgAG" +
-    "AAIAAABoDQAACAAAACIACgAaAS0AcCAAABAAJwAcAQAOPACSAQEALDwAvQECAAAOAMABAgAADgCO" +
-    "AQEADgDDAQIAAA4AZAUAAAAAAA4AbQMAAAAOAHADAAAADgCxAQEADgC0AQIAAA4AtwECAAAOAKsB" +
-    "AQAOAMsBAgAADgDOAQIAAA4AfAQAAAAADgB5AQAOAHYCAAAOAIUBBAAAAAAOAIIBAQAOAH8CAAAO" +
-    "AMYBAgAADgBzAQAOAF4BAA4AWAEADgBbAQAOAGcBAA4ATwIAAA4AVQEADgBqAQAOAFICAAAOAGEC" +
-    "AAAOACEBAA4AiwEBAA4AiAECAAAOAJYBAA4AugEBAA4AEgEADgClAQAOAK4BAQAOAKIBAA4AqAEA" +
-    "DgCcAQAOAJ8BAA4AmQEADgBMAA4AAAAAAQAAAAkAAAABAAAABAAAAAMAAAAEAAMAFQAAAAMAAAAE" +
-    "AAMAFgAAAAIAAAAEAAQAAQAAAAsAAAABAAAADgAAAAIAAAAEAAMABAAAAAcAAwADAAMAAQAAAA8A" +
-    "AAACAAAADwADAAIAAAAPAAQAAgAAAA8ACwABAAAAAQAAAAUAAAAEAAMAFQADAAMACDxjbGluaXQ+" +
-    "AAY8aW5pdD4AAj47AAFCAAVCWVRFUwABRAABRgABSQACSUoABElKSUwAA0lKSgACSUwAAUoAAkpK" +
-    "AANKSkkAA0pKSgACSkwAA0pMSQAFSkxJSUkAAUwAAkxEAAJMSgADTEpJAAJMTAADTExJAANMTEoA" +
-    "A0xMTAAdTGRhbHZpay9hbm5vdGF0aW9uL1NpZ25hdHVyZTsAGkxkYWx2aWsvYW5ub3RhdGlvbi9U" +
-    "aHJvd3M7ABhMamF2YS9sYW5nL0NoYXJTZXF1ZW5jZTsAEUxqYXZhL2xhbmcvQ2xhc3M7ABFMamF2" +
-    "YS9sYW5nL0NsYXNzPAAWTGphdmEvbGFuZy9Db21wYXJhYmxlOwAWTGphdmEvbGFuZy9Db21wYXJh" +
-    "YmxlPAARTGphdmEvbGFuZy9FcnJvcjsAEExqYXZhL2xhbmcvTG9uZzsAEkxqYXZhL2xhbmcvTnVt" +
-    "YmVyOwAhTGphdmEvbGFuZy9OdW1iZXJGb3JtYXRFeGNlcHRpb247ABJMamF2YS9sYW5nL09iamVj" +
-    "dDsAEkxqYXZhL2xhbmcvU3RyaW5nOwAZTGphdmEvbGFuZy9TdHJpbmdCdWlsZGVyOwAWTGphdmEv" +
-    "bWF0aC9CaWdJbnRlZ2VyOwAJTG9uZy5qYXZhAAlNQVhfVkFMVUUACU1JTl9WQUxVRQAWTWV0aG9k" +
-    "IHJlZGVmaW5lZCBhd2F5IQAiUmVkZWZpbmVkIExvbmchIHZhbHVlIChhcyBkb3VibGUpPQABUwAE" +
-    "U0laRQAEVFlQRQABVgACVkoABlZKSUxJSQACVkwAAVoAAlpMAAJbQgACW0MABmFwcGVuZAAIYml0" +
-    "Q291bnQACWJ5dGVWYWx1ZQAHY29tcGFyZQAJY29tcGFyZVRvAA9jb21wYXJlVW5zaWduZWQABmRl" +
-    "Y29kZQAOZGl2aWRlVW5zaWduZWQAC2RvdWJsZVZhbHVlAAZlcXVhbHMACmZsb2F0VmFsdWUAE2Zv" +
-    "cm1hdFVuc2lnbmVkTG9uZzAACGdldENoYXJzAAdnZXRMb25nAAhoYXNoQ29kZQANaGlnaGVzdE9u" +
-    "ZUJpdAAIaW50VmFsdWUACWxvbmdWYWx1ZQAMbG93ZXN0T25lQml0AANtYXgAA21pbgAUbnVtYmVy" +
-    "T2ZMZWFkaW5nWmVyb3MAFW51bWJlck9mVHJhaWxpbmdaZXJvcwAJcGFyc2VMb25nABFwYXJzZVVu" +
-    "c2lnbmVkTG9uZwARcmVtYWluZGVyVW5zaWduZWQAB3JldmVyc2UADHJldmVyc2VCeXRlcwAKcm90" +
-    "YXRlTGVmdAALcm90YXRlUmlnaHQAEHNlcmlhbFZlcnNpb25VSUQACnNob3J0VmFsdWUABnNpZ251" +
-    "bQAKc3RyaW5nU2l6ZQADc3VtAA50b0JpbmFyeVN0cmluZwALdG9IZXhTdHJpbmcADXRvT2N0YWxT" +
-    "dHJpbmcACHRvU3RyaW5nABR0b1Vuc2lnbmVkQmlnSW50ZWdlcgAQdG9VbnNpZ25lZFN0cmluZwAR" +
-    "dG9VbnNpZ25lZFN0cmluZzAABXZhbHVlAAd2YWx1ZU9mAFl+fkQ4eyJjb21waWxhdGlvbi1tb2Rl" +
-    "IjoicmVsZWFzZSIsImhhcy1jaGVja3N1bXMiOmZhbHNlLCJtaW4tYXBpIjoxLCJ2ZXJzaW9uIjoi" +
-    "Mi4xLjctcjEifQACBgFkHAEYDQIFAWQcAxcfFyMXAgIFAWQcBBckFyEXIxcCBgEvCwAZARkBGQEZ" +
-    "ARkBGgYSAYiABMQZAYGABIQaAYGABNgZAQnYDQIJ7A0DCcwOAQn0EAEJrBUECKAaAQjsDgEIjA8B" +
-    "CZQRAQnUEQEJtBECCcwPAQnMFQMJ/BUBCZQWAQm0FgEJjBABCaQQAQnUFgEJ9BYBCZQXAQm0FwEJ" +
-    "1BcBCfQXAQmUGAEJtBgBCcgYAQngGAEJ9BgCCcAQAQjUEAEJkBkBCdASAQnwEgEJkBMCCewTAQmM" +
-    "FAEKjBUBCawUAQnMFAEI7BQBCbQSAQn0EQEJlBIFAfgMAgGMDgHBIKwOBAGYDQEB2AwBAbgNBwGs" +
-    "DwMB7A8BAeQVEQGkGQcBsBMEBAgGAAYABEAAAAAAAQAAANwTAAABAAAA5BMAAAEAAADwEwAAHBUA" +
-    "AAEAAAAKAAAAAAAAAAQAAAAUFQAAAwAAAAwVAAAKAAAADBUAAB8AAAAMFQAAIAAAAAwVAAAhAAAA" +
-    "DBUAACIAAAAMFQAAIwAAAAwVAAAkAAAADBUAADkAAAAMFQAAOgAAAAwVAAARAAAAAAAAAAEAAAAA" +
-    "AAAAAQAAAGcAAABwAAAAAgAAABcAAAAMAgAAAwAAACIAAABoAgAABAAAAAcAAAAABAAABQAAAEAA" +
-    "AAA4BAAABgAAAAEAAAA4BgAAASAAADoAAABYBgAAAyAAAC4AAABADQAAARAAAA8AAABYDgAAAiAA" +
-    "AGcAAADiDgAABCAAAAMAAADcEwAAACAAAAEAAAD+EwAABSAAAAEAAAD/FAAAAxAAAAQAAAAIFQAA" +
-    "BiAAAAEAAAAkFQAAABAAAAEAAACMFQAA"
+    "ZGV4CjAzNQCC6NqF6YcFy4KrMQ61yOakOSk9scYPTAY0GgAAcAAAAHhWNBIAAAAAAAAAAGQZAACI" +
+    "AAAAcAAAABwAAACQAgAAJQAAAAADAAAHAAAAvAQAAEMAAAD0BAAAAQAAAAwHAAAIEwAALAcAAH4Q" +
+    "AACCEAAAjBAAAJQQAACYEAAAmxAAAKIQAAClEAAAqBAAAKsQAACvEAAAtRAAALoQAAC+EAAAwRAA" +
+    "AMUQAADKEAAAzxAAANMQAADYEAAA3xAAAOIQAADmEAAA6hAAAO8QAADzEAAA+BAAAP0QAAACEQAA" +
+    "IREAAD0RAABXEQAAahEAAH0RAACVEQAArREAAMARAADSEQAA5hEAAAkSAAAdEgAARxIAAFsSAAB2" +
+    "EgAAlhIAALkSAADjEgAADBMAACQTAAA6EwAAUBMAAFsTAABmEwAAcRMAAIkTAACtEwAAsBMAALYT" +
+    "AAC8EwAAvxMAAMMTAADLEwAAzxMAANITAADWEwAA2hMAAN4TAADhEwAA7hMAAPYTAAD5EwAABRQA" +
+    "AA8UAAAUFAAAHxQAACgUAAAzFAAARBQAAEwUAABfFAAAaRQAAHkUAACDFAAAjBQAAJkUAACjFAAA" +
+    "qxQAALcUAADMFAAA1hQAAN8UAADpFAAA+BQAAPsUAAACFQAADBUAAA8VAAAUFQAAHxUAACcVAAA1" +
+    "FQAAOhUAAD8VAABDFQAAWRUAAHAVAAB1FQAAfRUAAIgVAACbFQAAohUAALUVAADKFQAA0xUAAOEV" +
+    "AADtFQAA+hUAAP0VAAAPFgAAFhYAACIWAAAqFgAANhYAADsWAABLFgAAWBYAAGcWAABxFgAAhxYA" +
+    "AJkWAACsFgAAsRYAALgWAADBFgAAxBYAAMcWAAAEAAAABgAAAAcAAAAIAAAADQAAABwAAAAdAAAA" +
+    "HgAAAB8AAAAhAAAAIwAAACQAAAAlAAAAJgAAACcAAAAoAAAAKQAAACoAAAArAAAALAAAAC4AAAAv" +
+    "AAAAMAAAADcAAAA6AAAAPgAAAEAAAABBAAAABAAAAAAAAAAAAAAABgAAAAEAAAAAAAAABwAAAAIA" +
+    "AAAAAAAACAAAAAMAAAAAAAAACQAAAAMAAAD0DwAACgAAAAMAAAD8DwAACgAAAAMAAAAIEAAACwAA" +
+    "AAMAAAAUEAAADAAAAAMAAAAcEAAADAAAAAMAAAAkEAAADQAAAAQAAAAAAAAADgAAAAQAAAD0DwAA" +
+    "DwAAAAQAAAAsEAAAEAAAAAQAAAAUEAAAEwAAAAQAAAA0EAAAEQAAAAQAAABAEAAAEgAAAAQAAABI" +
+    "EAAAFgAAAAsAAAD0DwAAGAAAAAsAAABAEAAAGQAAAAsAAABIEAAAGgAAAAsAAABQEAAAGwAAAAsA" +
+    "AABYEAAAGAAAAAsAAABgEAAAGAAAAA4AAABgEAAAFAAAABAAAAAAAAAAFgAAABAAAAD0DwAAFwAA" +
+    "ABAAAAAsEAAAFQAAABEAAABoEAAAGAAAABEAAABAEAAAFgAAABUAAAD0DwAAFAAAABYAAAAAAAAA" +
+    "NwAAABcAAAAAAAAAOgAAABgAAAAAAAAAOwAAABgAAAD0DwAAPAAAABgAAABwEAAAPQAAABgAAABA" +
+    "EAAAPwAAABkAAAAkEAAACwADAAUAAAALAAQAMwAAAAsABAA0AAAACwADADgAAAALAAgAOQAAAAsA" +
+    "BAB1AAAACwAEAIMAAAAKACMAAgAAAAsAIAABAAAACwAhAAIAAAALACMAAgAAAAsABABHAAAACwAA" +
+    "AEkAAAALAAcASgAAAAsACABLAAAACwAJAEsAAAALAAcATAAAAAsAEgBNAAAACwAeAE4AAAALAA0A" +
+    "UAAAAAsAAQBTAAAACwAkAFUAAAALAAIAVgAAAAsAIgBXAAAACwAFAFgAAAALAAYAWAAAAAsAEgBZ" +
+    "AAAACwAUAFkAAAALABUAWQAAAAsAAwBaAAAACwAEAFoAAAALAAsAWwAAAAsAAwBeAAAACwAKAGEA" +
+    "AAALAAsAYwAAAAsADQBkAAAACwANAGUAAAALAAQAZwAAAAsABABoAAAACwAOAGsAAAALAA8AawAA" +
+    "AAsAEABrAAAACwAOAGwAAAALAA8AbAAAAAsAEABsAAAACwANAG4AAAALABYAbwAAAAsAFwBvAAAA" +
+    "CwALAHAAAAALAAsAcQAAAAsADAByAAAACwAMAHMAAAALAB8AdwAAAAsABAB4AAAACwAEAHkAAAAL" +
+    "AA0AegAAAAsAGQB7AAAACwAZAHwAAAALABkAfQAAAAsAGAB+AAAACwAZAH4AAAALABoAfgAAAAsA" +
+    "HQB/AAAACwAZAIAAAAALABoAgAAAAAsAGgCBAAAACwARAIQAAAALABIAhAAAAAsAEwCEAAAADAAg" +
+    "AAIAAAARACAAAgAAABEAGwBEAAAAEQAcAEQAAAARABgAfgAAAAsAAAARAAAADAAAAOgPAAAyAAAA" +
+    "7BgAAKYXAAC0GAAABAACAAIAAACADgAACAAAACIACgAaATUAcCAAABAAJwADAAEAAgAAAIYOAAAI" +
+    "AAAAIgAKABoBNQBwIAAAEAAnAAMAAQACAAAAiw4AAAgAAAAiAAoAGgE1AHAgAAAQACcAAwABAAIA" +
+    "AACQDgAACAAAACIACgAaATUAcCAAABAAJwADAAIAAAAAAJUOAAACAAAAElAPAAYABAACAAAAmg4A" +
+    "AAgAAAAiAAoAGgE1AHAgAAAQACcABAACAAIAAACjDgAACAAAACIACgAaATUAcCAAABAAJwACAAIA" +
+    "AgAAAKkOAAAHAAAAHwELAG4gBwAQAAoBDwEAAAYABAACAAAArg4AAAgAAAAiAAoAGgE1AHAgAAAQ" +
+    "ACcABgAEAAIAAAC3DgAACAAAACIACgAaATUAcCAAABAAJwAGAAQAAgAAAL4OAAAIAAAAIgAKABoB" +
+    "NQBwIAAAEAAnAAMAAQACAAAAxQ4AAAgAAAAiAAoAGgE1AHAgAAAQACcABAACAAIAAADKDgAACAAA" +
+    "ACIACgAaATUAcCAAABAAJwADAAEAAgAAANEOAAAIAAAAIgAKABoBNQBwIAAAEAAnAAQAAgAAAAAA" +
+    "1g4AAAQAAACbAAIChAEPAQQAAgAAAAAA2w4AAAYAAAASEKUAAgDAIIQBDwEDAAIAAAAAAOAOAAAC" +
+    "AAAAEgAPAAQAAgACAAAA5Q4AAAgAAAAiAAoAGgE1AHAgAAAQACcAAwABAAIAAADrDgAACAAAACIA" +
+    "CgAaATUAcCAAABAAJwADAAEAAgAAAPEOAAAIAAAAIgAKABoBNQBwIAAAEAAnAAQAAgACAAAA9w4A" +
+    "AAgAAAAiAAoAGgE1AHAgAAAQACcABQADAAIAAAD/DgAACAAAACIACgAaATUAcCAAABAAJwAEAAIA" +
+    "AgAAAAcPAAAIAAAAIgAKABoBNQBwIAAAEAAnAAMAAQACAAAADQ8AAAgAAAAiAAoAGgE1AHAgAAAQ" +
+    "ACcABAACAAIAAAATDwAACAAAACIACgAaATUAcCAAABAAJwADAAIAAwAAABkPAAAGAAAAIgALAHAw" +
+    "AgAQAhEAAgACAAIAAACpDgAABQAAAG4gJwAQAAwBEQEAAAQAAgACAAAAHg8AAAgAAAAiAAoAGgE1" +
+    "AHAgAAAQACcABAACAAIAAAAjDwAACAAAACIACgAaATUAcCAAABAAJwAEAAIAAgAAACgPAAAIAAAA" +
+    "IgAKABoBNQBwIAAAEAAnAAQAAQADAAAALQ8AABcAAAAiABEAcBA/AAAAGgE2AG4gQQAQAAwAUzEG" +
+    "AIYRbjBAABACDABuEEIAAAAMABEAAAAEAAIAAgAAADEPAAAIAAAAIgAKABoBNQBwIAAAEAAnAAUA" +
+    "AwACAAAANg8AAAgAAAAiAAoAGgE1AHAgAAAQACcABAACAAIAAAA8DwAACAAAACIACgAaATUAcCAA" +
+    "ABAAJwAFAAMAAgAAAEEPAAAIAAAAIgAKABoBNQBwIAAAEAAnAAUAAwACAAAARw8AAAgAAAAiAAoA" +
+    "GgE1AHAgAAAQACcABAACAAIAAABODwAACAAAACIACgAaATUAcCAAABAAJwADAAEAAgAAAFMPAAAI" +
+    "AAAAIgAKABoBNQBwIAAAEAAnAAYABAACAAAAWA8AAAgAAAAiAAoAGgE1AHAgAAAQACcABAACAAAA" +
+    "AABfDwAABAAAABYAAQC7IBAAAwABAAAAAABkDwAAAwAAAFMgBgAQAAAABAACAAAAAABpDwAABQAA" +
+    "ABYAAQCcAAIAEAAAAAYABAACAAAAbg8AAAgAAAAiAAoAGgE1AHAgAAAQACcABgAEAAIAAAB1DwAA" +
+    "CAAAACIACgAaATUAcCAAABAAJwAGAAQAAgAAAHwPAAAIAAAAIgAKABoBNQBwIAAAEAAnAAMAAQAC" +
+    "AAAAhA8AAAgAAAAiAAoAGgE1AHAgAAAQACcABAACAAIAAACJDwAACAAAACIACgAaATUAcCAAABAA" +
+    "JwAGAAQAAgAAAI8PAAAIAAAAIgAKABoBNQBwIAAAEAAnAAMAAQACAAAAlw8AAAgAAAAiAAoAGgE1" +
+    "AHAgAAAQACcABAACAAIAAACcDwAACAAAACIACgAaATUAcCAAABAAJwAGAAQAAgAAAKIPAAAIAAAA" +
+    "IgAKABoBNQBwIAAAEAAnAAQAAgAAAAAAqQ8AAAIAAAB9IBAABAACAAAAAACuDwAAAwAAABYAAAAQ" +
+    "AAAAAwADAAAAAACzDwAAAQAAABAAAAAFAAMAAAAAALkPAAAFAAAAFgAKAJ0AAAIQAAAABgAEAAAA" +
+    "AAC/DwAAAwAAAJsAAgQQAAAAAwABAAIAAADFDwAACAAAACIACgAaATUAcCAAABAAJwABAAAAAAAA" +
+    "AMoPAAAEAAAAEgBpAAQADgAEAAIAAwAAAM8PAAANAAAAFgAAAHAwAgACASIACgAaATUAcCAAABAA" +
+    "JwAAAAMAAwABAAAA1g8AAAYAAABwED4AAABaAQYADgAIAAYAAgAAAN4PAAAIAAAAIgAKABoBNQBw" +
+    "IAAAEAAnAKUBAWoOAI0BAA4AnAEADgCZAQAOACwBXQ4AtAEChgGHAQ4AsQEBRA4ACQEADgC3AQKG" +
+    "AYcBDgBkA11eSQ4AZwNdXkkOAJ8BAA4AogEBhAEOAJMBAA4AJAFdDgAoAV0OADwBXQ4AagGGAQ4A" +
+    "hQEBZw4AqAEBZw4ArgECZ4MBDgCrAQJngwEOANIBAWMOAIIBAXUOAH8CdW4OABgBYA4AVQFdDgBP" +
+    "AV0OAFIBXQ4AQwAOAF4BXQ4ARgJdbg4AYQFdDgBJAl1uDgBYAoMBdw4ATAFdDgDMAQAOALoBAlJT" +
+    "DgAcAV0OAJYBAA4AIAFdDgDCAQJDRg4AxQECQ0YOAHMEdUdVbg4AcAF1DgBtAnVuDgB8BHVHVW4O" +
+    "AHkBdQ4AdgJ1bg4AvQECUlMOADgBXQ4AQAFdDgAwAl1QDgA0Al1QDgAQAkNGDgCQAQAOAAwADjwA" +
+    "iQEBdQ5aABMBhAEOPC0AWwWDAXdJa2EOAAMAAAAJABIAEwAAAAEAAAAEAAAAAwAAAAQAAwAaAAAA" +
+    "AwAAAAQAAwAbAAAAAgAAAAQABAABAAAACwAAAAEAAAAOAAAAAgAAAAQAAwAEAAAABwADAAMAAwAB" +
+    "AAAAEAAAAAIAAAAQAAMAAgAAABAABAACAAAAEAALAAEAAAAUAAAAAQAAAAEAAAAFAAAABAADABoA" +
+    "AwADAAIoKQAIPGNsaW5pdD4ABjxpbml0PgACPjsAAUIABUJZVEVTAAFEAAFGAAFJAAJJSgAESUpJ" +
+    "TAADSUpKAAJJTAABSgACSkoAA0pKSQADSkpKAAJKTAADSkxJAAVKTElJSQABTAACTEQAAkxKAANM" +
+    "SkkAAkxMAANMTEkAA0xMSgADTExMAB1MZGFsdmlrL2Fubm90YXRpb24vU2lnbmF0dXJlOwAaTGRh" +
+    "bHZpay9hbm5vdGF0aW9uL1Rocm93czsAGExqYXZhL2xhbmcvQ2hhclNlcXVlbmNlOwARTGphdmEv" +
+    "bGFuZy9DbGFzczsAEUxqYXZhL2xhbmcvQ2xhc3M8ABZMamF2YS9sYW5nL0NvbXBhcmFibGU7ABZM" +
+    "amF2YS9sYW5nL0NvbXBhcmFibGU8ABFMamF2YS9sYW5nL0Vycm9yOwAQTGphdmEvbGFuZy9Mb25n" +
+    "OwASTGphdmEvbGFuZy9OdW1iZXI7ACFMamF2YS9sYW5nL051bWJlckZvcm1hdEV4Y2VwdGlvbjsA" +
+    "EkxqYXZhL2xhbmcvT2JqZWN0OwAoTGphdmEvbGFuZy9SZWZsZWN0aXZlT3BlcmF0aW9uRXhjZXB0" +
+    "aW9uOwASTGphdmEvbGFuZy9TdHJpbmc7ABlMamF2YS9sYW5nL1N0cmluZ0J1aWxkZXI7AB5MamF2" +
+    "YS9sYW5nL2NvbnN0YW50L0NvbnN0YWJsZTsAIUxqYXZhL2xhbmcvY29uc3RhbnQvQ29uc3RhbnRE" +
+    "ZXNjOwAoTGphdmEvbGFuZy9jb25zdGFudC9EeW5hbWljQ29uc3RhbnREZXNjOwAnTGphdmEvbGFu" +
+    "Zy9pbnZva2UvTWV0aG9kSGFuZGxlcyRMb29rdXA7ABZMamF2YS9tYXRoL0JpZ0ludGVnZXI7ABRM" +
+    "amF2YS91dGlsL09wdGlvbmFsOwAUTGphdmEvdXRpbC9PcHRpb25hbDwACUxvbmcuamF2YQAJTUFY" +
+    "X1ZBTFVFAAlNSU5fVkFMVUUAFk1ldGhvZCByZWRlZmluZWQgYXdheSEAIlJlZGVmaW5lZCBMb25n" +
+    "ISB2YWx1ZSAoYXMgZG91YmxlKT0AAVMABFNJWkUABFRZUEUAAVYAAlZKAAZWSklMSUkAAlZMAAFa" +
+    "AAJaTAACW0IAAltDAAFhAAthbm90aGVyTG9uZwAGYXBwZW5kAAFiAApiZWdpbkluZGV4AAhiaXRD" +
+    "b3VudAADYnVmAAlieXRlVmFsdWUAB2NvbXBhcmUACWNvbXBhcmVUbwAPY29tcGFyZVVuc2lnbmVk" +
+    "AAZkZWNvZGUAEWRlc2NyaWJlQ29uc3RhYmxlAAhkaXN0YW5jZQAOZGl2aWRlVW5zaWduZWQACGRp" +
+    "dmlkZW5kAAdkaXZpc29yAAtkb3VibGVWYWx1ZQAIZW5kSW5kZXgABmVxdWFscwAKZmxvYXRWYWx1" +
+    "ZQATZm9ybWF0VW5zaWduZWRMb25nMAAIZ2V0Q2hhcnMAB2dldExvbmcACGhhc2hDb2RlAA1oaWdo" +
+    "ZXN0T25lQml0AAFpAAVpbmRleAAIaW50VmFsdWUAAWwAA2xlbgAJbG9uZ1ZhbHVlAAZsb29rdXAA" +
+    "DGxvd2VzdE9uZUJpdAADbWF4AANtaW4AAm5tABRudW1iZXJPZkxlYWRpbmdaZXJvcwAVbnVtYmVy" +
+    "T2ZUcmFpbGluZ1plcm9zAANvYmoABm9mZnNldAAJcGFyc2VMb25nABFwYXJzZVVuc2lnbmVkTG9u" +
+    "ZwAFcmFkaXgAEXJlbWFpbmRlclVuc2lnbmVkABNyZXNvbHZlQ29uc3RhbnREZXNjAAdyZXZlcnNl" +
+    "AAxyZXZlcnNlQnl0ZXMACnJvdGF0ZUxlZnQAC3JvdGF0ZVJpZ2h0AAFzABBzZXJpYWxWZXJzaW9u" +
+    "VUlEAAVzaGlmdAAKc2hvcnRWYWx1ZQAGc2lnbnVtAApzdHJpbmdTaXplAANzdW0ADnRvQmluYXJ5" +
+    "U3RyaW5nAAt0b0hleFN0cmluZwANdG9PY3RhbFN0cmluZwAIdG9TdHJpbmcAFHRvVW5zaWduZWRC" +
+    "aWdJbnRlZ2VyABB0b1Vuc2lnbmVkU3RyaW5nABF0b1Vuc2lnbmVkU3RyaW5nMAADdmFsAAV2YWx1" +
+    "ZQAHdmFsdWVPZgABeAABeQCbAX5+RDh7ImJhY2tlbmQiOiJkZXgiLCJjb21waWxhdGlvbi1tb2Rl" +
+    "IjoiZGVidWciLCJoYXMtY2hlY2tzdW1zIjpmYWxzZSwibWluLWFwaSI6MSwic2hhLTEiOiJmZWE0" +
+    "ZmY0ZDg1MWIxMThhZWFjZjMxZDRkODJmZmJjYmNiZWE0ZGVmIiwidmVyc2lvbiI6IjguMi44LWRl" +
+    "diJ9AAIGAYMBHAEYDQIFAYMBHAQXABcxFy0XAwIGAYMBHAEYDwIFAYMBHAMXIBckFwMCBQGDARwG" +
+    "FyUXIhckFwMXKxcsBgEvDgAZARkBGQEZARkBGgYSAYiABIAcAYGABMQcAYGABJgcAQmsDwIJwA8D" +
+    "CaAQAQnIEgIJ4BcECOAcAQjAEAEI4BABCegSAQmoEwEJiBMCCaARAQmAGAMJsBgBCcwYAQnsGAEJ" +
+    "4BEBCfgRAQmMGQEJrBkBCcwZAQnsGQEJjBoBCawaAQnMGgMJ7BoBCYAbAQmYGwEJrBsCCZQSAQio" +
+    "EgEJyBsBCeAUAQmAFQEJoBUCCYAWAQmgFgEKoBcBCcAWAQngFgEIgBcBCagUAQnoEwEJiBQFAcwO" +
+    "AgHgDwHBIIAQAwHAFwIB7A4BAawOAQGMDwcBgBEDAcARAQGYGA0ByBMBwSDEFAUB4BsHAcAVBAQI" +
+    "BgAGAARAAAAAAAAAAAEAAABlFwAAAQAAAG4XAAABAAAAfRcAAAEAAACGFwAAAQAAAJMXAADkGAAA" +
+    "AQAAAAwAAAAAAAAABAAAANwYAAADAAAAxBgAAAoAAADEGAAACwAAAMwYAAAgAAAAxBgAACEAAADE" +
+    "GAAAIgAAAMQYAAAjAAAAxBgAACQAAADEGAAAJQAAAMQYAAAoAAAA1BgAADwAAADEGAAAPQAAAMQY" +
+    "AAARAAAAAAAAAAEAAAAAAAAAAQAAAIgAAABwAAAAAgAAABwAAACQAgAAAwAAACUAAAAAAwAABAAA" +
+    "AAcAAAC8BAAABQAAAEMAAAD0BAAABgAAAAEAAAAMBwAAASAAAD0AAAAsBwAAAyAAADwAAACADgAA" +
+    "ARAAABAAAADoDwAAAiAAAIgAAAB+EAAABCAAAAUAAABlFwAAACAAAAEAAACmFwAABSAAAAEAAAC0" +
+    "GAAAAxAAAAYAAADAGAAABiAAAAEAAADsGAAAABAAAAEAAABkGQAA"
     );
 
   static class FuncCmp implements LongPredicate {
diff --git a/test/965-default-verify/Android.bp b/test/965-default-verify/Android.bp
index 680c3a2..40e51e0 100644
--- a/test/965-default-verify/Android.bp
+++ b/test/965-default-verify/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-965-default-verify-src"
+        "art-run-test-965-default-verify-src",
     ],
     data: [
         ":art-run-test-965-default-verify-expected-stdout",
diff --git a/test/966-default-conflict/Android.bp b/test/966-default-conflict/Android.bp
index 19217fc..cc2a3f8 100644
--- a/test/966-default-conflict/Android.bp
+++ b/test/966-default-conflict/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-no-test-suite-tag-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-966-default-conflict-src"
+        "art-run-test-966-default-conflict-src",
     ],
     data: [
         ":art-run-test-966-default-conflict-expected-stdout",
diff --git a/test/967-default-ame/Android.bp b/test/967-default-ame/Android.bp
index 0268bf5..ee8c864 100644
--- a/test/967-default-ame/Android.bp
+++ b/test/967-default-ame/Android.bp
@@ -25,7 +25,7 @@
     test_config_template: ":art-run-test-target-template",
     srcs: ["src2/**/*.java"],
     static_libs: [
-        "art-run-test-967-default-ame-src"
+        "art-run-test-967-default-ame-src",
     ],
     data: [
         ":art-run-test-967-default-ame-expected-stdout",
diff --git a/test/980-redefine-object/redef_object.cc b/test/980-redefine-object/redef_object.cc
index a8393dc..7607718 100644
--- a/test/980-redefine-object/redef_object.cc
+++ b/test/980-redefine-object/redef_object.cc
@@ -38,10 +38,10 @@
 
 static void JNICALL RedefineObjectHook(jvmtiEnv *jvmti_env,
                                        JNIEnv* env,
-                                       jclass class_being_redefined ATTRIBUTE_UNUSED,
-                                       jobject loader ATTRIBUTE_UNUSED,
+                                       [[maybe_unused]] jclass class_being_redefined,
+                                       [[maybe_unused]] jobject loader,
                                        const char* name,
-                                       jobject protection_domain ATTRIBUTE_UNUSED,
+                                       [[maybe_unused]] jobject protection_domain,
                                        jint class_data_len,
                                        const unsigned char* class_data,
                                        jint* new_class_data_len,
@@ -106,7 +106,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_Main_addMemoryTrackingCall(JNIEnv* env,
-                                                                  jclass klass ATTRIBUTE_UNUSED,
+                                                                  [[maybe_unused]] jclass klass,
                                                                   jclass obj_class,
                                                                   jthread thr) {
   jvmtiCapabilities caps {.can_retransform_classes = 1};
diff --git a/test/983-source-transform-verify/source_transform.cc b/test/983-source-transform-verify/source_transform.cc
index 9e65a99..e778dbb 100644
--- a/test/983-source-transform-verify/source_transform.cc
+++ b/test/983-source-transform-verify/source_transform.cc
@@ -41,16 +41,16 @@
 }
 
 // The hook we are using.
-void JNICALL CheckDexFileHook(jvmtiEnv* jvmti_env ATTRIBUTE_UNUSED,
+void JNICALL CheckDexFileHook([[maybe_unused]] jvmtiEnv* jvmti_env,
                               JNIEnv* env,
                               jclass class_being_redefined,
-                              jobject loader ATTRIBUTE_UNUSED,
+                              [[maybe_unused]] jobject loader,
                               const char* name,
-                              jobject protection_domain ATTRIBUTE_UNUSED,
+                              [[maybe_unused]] jobject protection_domain,
                               jint class_data_len,
                               const unsigned char* class_data,
-                              jint* new_class_data_len ATTRIBUTE_UNUSED,
-                              unsigned char** new_class_data ATTRIBUTE_UNUSED) {
+                              [[maybe_unused]] jint* new_class_data_len,
+                              [[maybe_unused]] unsigned char** new_class_data) {
   if (kSkipInitialLoad && class_being_redefined == nullptr) {
     // Something got loaded concurrently. Just ignore it for now. To make sure the test is
     // repeatable we only care about things that come from RetransformClasses.
diff --git a/test/986-native-method-bind/native_bind.cc b/test/986-native-method-bind/native_bind.cc
index 34e1f35..abb767c 100644
--- a/test/986-native-method-bind/native_bind.cc
+++ b/test/986-native-method-bind/native_bind.cc
@@ -40,22 +40,22 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test986_00024Transform_sayHi__(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass klass) {
   doUpPrintCall(env, "doSayHi");
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test986_00024Transform_sayHi2(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass klass) {
   doUpPrintCall(env, "doSayHi2");
 }
 
-extern "C" JNIEXPORT void JNICALL NoReallySayGoodbye(JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT void JNICALL NoReallySayGoodbye(JNIEnv* env, [[maybe_unused]] jclass klass) {
   doUpPrintCall(env, "doSayBye");
 }
 
-static void doJvmtiMethodBind(jvmtiEnv* jvmtienv ATTRIBUTE_UNUSED,
+static void doJvmtiMethodBind([[maybe_unused]] jvmtiEnv* jvmtienv,
                               JNIEnv* env,
-                              jthread thread ATTRIBUTE_UNUSED,
+                              [[maybe_unused]] jthread thread,
                               jmethodID m,
                               void* address,
                               /*out*/void** out_address) {
@@ -95,7 +95,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test986_setupNativeBindNotify(
-    JNIEnv* env ATTRIBUTE_UNUSED, jclass klass ATTRIBUTE_UNUSED) {
+    [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jclass klass) {
   jvmtiEventCallbacks cb;
   memset(&cb, 0, sizeof(cb));
   cb.NativeMethodBind = doJvmtiMethodBind;
@@ -103,7 +103,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test986_setNativeBindNotify(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jboolean enable) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jboolean enable) {
   jvmtiError res = jvmti_env->SetEventNotificationMode(enable ? JVMTI_ENABLE : JVMTI_DISABLE,
                                                        JVMTI_EVENT_NATIVE_METHOD_BIND,
                                                        nullptr);
@@ -113,7 +113,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test986_rebindTransformClass(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jclass k) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jclass k) {
   JNINativeMethod m[2];
   m[0].name = "sayHi";
   m[0].signature = "()V";
diff --git a/test/987-agent-bind/agent_bind.cc b/test/987-agent-bind/agent_bind.cc
index 7dbdd8e..51fd74e 100644
--- a/test/987-agent-bind/agent_bind.cc
+++ b/test/987-agent-bind/agent_bind.cc
@@ -40,12 +40,12 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test987_00024Transform_sayHi__(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass klass) {
   doUpPrintCall(env, "doSayHi");
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test987_00024Transform_sayHi2(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass klass) {
   doUpPrintCall(env, "doSayHi2");
 }
 
diff --git a/test/989-method-trace-throw/method_trace.cc b/test/989-method-trace-throw/method_trace.cc
index 019b6a9..edfff90 100644
--- a/test/989-method-trace-throw/method_trace.cc
+++ b/test/989-method-trace-throw/method_trace.cc
@@ -52,8 +52,8 @@
   return env->CallStaticObjectMethod(klass, targetMethod);
 }
 
-extern "C" JNIEXPORT void JNICALL Java_art_Test989_doNothingNative(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                                   jclass klass ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT void JNICALL Java_art_Test989_doNothingNative([[maybe_unused]] JNIEnv* env,
+                                                                   [[maybe_unused]] jclass klass) {
   return;
 }
 
diff --git a/test/989-method-trace-throw/src/art/Test989.java b/test/989-method-trace-throw/src/art/Test989.java
index 4feb29c..f18d5ef 100644
--- a/test/989-method-trace-throw/src/art/Test989.java
+++ b/test/989-method-trace-throw/src/art/Test989.java
@@ -145,13 +145,15 @@
 
   public static class ForceGCTracer implements MethodTracer {
     public void methodEntry(Object m) {
-      if (System.getProperty("java.vm.name").equals("Dalvik")) {
-        System.gc();
+      if (System.getProperty("java.vm.name").equals("Dalvik") &&
+          testMethods.contains(m)) {
+        Runtime.getRuntime().gc();
       }
     }
     public void methodExited(Object m, boolean exception, Object result) {
-      if (System.getProperty("java.vm.name").equals("Dalvik")) {
-        System.gc();
+      if (System.getProperty("java.vm.name").equals("Dalvik") &&
+          testMethods.contains(m)) {
+        Runtime.getRuntime().gc();
       }
     }
   }
diff --git a/test/992-source-data/source_file.cc b/test/992-source-data/source_file.cc
index 78687ff..9d98c64 100644
--- a/test/992-source-data/source_file.cc
+++ b/test/992-source-data/source_file.cc
@@ -38,7 +38,7 @@
 
 extern "C" JNIEXPORT
 jstring JNICALL Java_art_Test992_getSourceFileName(JNIEnv* env,
-                                                   jclass klass ATTRIBUTE_UNUSED,
+                                                   [[maybe_unused]] jclass klass,
                                                    jclass target) {
   char* file = nullptr;
   if (JvmtiErrorToException(env, jvmti_env, jvmti_env->GetSourceFileName(target, &file))) {
@@ -51,7 +51,7 @@
 
 extern "C" JNIEXPORT
 jstring JNICALL Java_art_Test992_getSourceDebugExtension(JNIEnv* env,
-                                                         jclass klass ATTRIBUTE_UNUSED,
+                                                         [[maybe_unused]] jclass klass,
                                                          jclass target) {
   char* ext = nullptr;
   if (JvmtiErrorToException(env, jvmti_env, jvmti_env->GetSourceDebugExtension(target, &ext))) {
diff --git a/test/993-breakpoints-non-debuggable/onload.cc b/test/993-breakpoints-non-debuggable/onload.cc
index dbbcadc..f7e7f9d 100644
--- a/test/993-breakpoints-non-debuggable/onload.cc
+++ b/test/993-breakpoints-non-debuggable/onload.cc
@@ -67,7 +67,7 @@
     .can_generate_resource_exhaustion_threads_events = 0,
 };
 
-jint OnLoad(JavaVM* vm, char* options ATTRIBUTE_UNUSED, void* reserved ATTRIBUTE_UNUSED) {
+jint OnLoad(JavaVM* vm, [[maybe_unused]] char* options, [[maybe_unused]] void* reserved) {
   if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), kArtTiVersion) != 0) {
     printf("Unable to get jvmti env!\n");
     return 1;
diff --git a/test/993-breakpoints/breakpoints.cc b/test/993-breakpoints/breakpoints.cc
index e9cf3b3..c0ee392 100644
--- a/test/993-breakpoints/breakpoints.cc
+++ b/test/993-breakpoints/breakpoints.cc
@@ -38,7 +38,7 @@
 
 extern "C" JNIEXPORT
 jobject JNICALL Java_art_Test993_constructNative(JNIEnv* env,
-                                                 jclass klass ATTRIBUTE_UNUSED,
+                                                 [[maybe_unused]] jclass klass,
                                                  jobject target,
                                                  jclass clazz) {
   jmethodID method = env->FromReflectedMethod(target);
@@ -50,7 +50,7 @@
 
 extern "C" JNIEXPORT
 void JNICALL Java_art_Test993_invokeNativeObject(JNIEnv* env,
-                                                 jclass klass ATTRIBUTE_UNUSED,
+                                                 [[maybe_unused]] jclass klass,
                                                  jobject target,
                                                  jclass clazz,
                                                  jobject thizz) {
@@ -67,7 +67,7 @@
 
 extern "C" JNIEXPORT
 void JNICALL Java_art_Test993_invokeNativeBool(JNIEnv* env,
-                                               jclass klass ATTRIBUTE_UNUSED,
+                                               [[maybe_unused]] jclass klass,
                                                jobject target,
                                                jclass clazz,
                                                jobject thizz) {
@@ -84,7 +84,7 @@
 
 extern "C" JNIEXPORT
 void JNICALL Java_art_Test993_invokeNativeLong(JNIEnv* env,
-                                               jclass klass ATTRIBUTE_UNUSED,
+                                               [[maybe_unused]] jclass klass,
                                                jobject target,
                                                jclass clazz,
                                                jobject thizz) {
@@ -101,7 +101,7 @@
 
 extern "C" JNIEXPORT
 void JNICALL Java_art_Test993_invokeNative(JNIEnv* env,
-                                           jclass klass ATTRIBUTE_UNUSED,
+                                           [[maybe_unused]] jclass klass,
                                            jobject target,
                                            jclass clazz,
                                            jobject thizz) {
diff --git a/test/996-breakpoint-obsolete/obsolete_breakpoints.cc b/test/996-breakpoint-obsolete/obsolete_breakpoints.cc
index 820af47..f8f9173 100644
--- a/test/996-breakpoint-obsolete/obsolete_breakpoints.cc
+++ b/test/996-breakpoint-obsolete/obsolete_breakpoints.cc
@@ -65,7 +65,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Test996_setBreakpointOnObsoleteMethod(
-    JNIEnv* env, jclass k ATTRIBUTE_UNUSED, jlong loc) {
+    JNIEnv* env, [[maybe_unused]] jclass k, jlong loc) {
   jmethodID method = GetFirstObsoleteMethod(env, jvmti_env);
   if (method == nullptr) {
     return;
diff --git a/test/998-redefine-use-after-free/src-ex/DexCacheSmash.java b/test/998-redefine-use-after-free/src-ex/DexCacheSmash.java
index 349b73e..58d0b41 100644
--- a/test/998-redefine-use-after-free/src-ex/DexCacheSmash.java
+++ b/test/998-redefine-use-after-free/src-ex/DexCacheSmash.java
@@ -138,7 +138,7 @@
         try {
             Redefinition.doMultiClassRedefinition(TRANSFORM2_INVALID);
         } catch (Exception e) {
-            if (!e.getMessage().endsWith("JVMTI_ERROR_FAILS_VERIFICATION")) {
+            if (!e.getMessage().contains("JVMTI_ERROR_FAILS_VERIFICATION")) {
                 throw new Error(
                         "Unexpected error: Expected failure due to JVMTI_ERROR_FAILS_VERIFICATION",
                         e);
diff --git a/test/Android.bp b/test/Android.bp
index 5fc8cf9..1768340 100644
--- a/test/Android.bp
+++ b/test/Android.bp
@@ -153,13 +153,6 @@
     srcs: ["art-gtests-target-standalone-cts-template.xml"],
 }
 
-// Test configuration template for standalone ART gtests run as root on target (not bundled with
-// the ART APEX).
-filegroup {
-    name: "art-gtests-target-standalone-root-template",
-    srcs: ["art-gtests-target-standalone-root-template.xml"],
-}
-
 // Test configuration template for standalone ART gtests run with a boot image on target (not
 // bundled with the ART APEX).
 filegroup {
@@ -167,6 +160,24 @@
     srcs: ["art-gtests-target-standalone-with-boot-image-template.xml"],
 }
 
+// When soong builds the tests in a sandbox, the targets of symlinks
+// must be declared as inputs to soong modules that use them, or else
+// it will be a dangling symlink in the sandbox.
+filegroup {
+    name: "test_build_symlink_targets",
+    srcs: [
+        "jvmti-common/*.java",
+        "1953-pop-frame/src/art/SuspendEvents.java",
+        "1953-pop-frame/src/art/Test1953.java",
+        "993-breakpoints/src/art/Test993.java",
+        "988-method-trace/src/art/Test988.java",
+        "988-method-trace/src/art/Test988Intrinsics.java",
+    ],
+    visibility: [
+        "//art/test:__subpackages__",
+    ],
+}
+
 art_cc_defaults {
     name: "art_standalone_test_defaults",
     defaults: [
@@ -204,12 +215,32 @@
     gtest: false,
 
     shared_libs: [
-        "libbase",
-        "liblog",
-        "libz",
-    ],
+        // `libnativeloader` must be shared, otherwise host gtests can't load libraries from
+        // "art_common/out/host", which is present in `libnativeloader` RUNPATH.
+        // TODO(b/247108425): modify gtests RUNPATH so that `libnativeloader` can be static linked.
+        "libnativeloader",
 
+        // `libart(d)` (`art/runtime/jni/java_vm_ext.cc`) and `libnativehelper`
+        // (`libnativehelper/JniInvocation.c`) define symbols with the same name
+        // (e.g. `JNI_GetDefaultJavaVMInitArgs`).
+        // `JavaVmExtTest#*` tests require `libart(d)` implementation of these symbols.
+        // At the moment `libart(d)` is linked statically (through `libart(d)-gtest`)
+        // and these symbols are correctly resolved to `libart(d)`.
+        // If `libnativehelper` and `libart(d)` are both linked dynamically,
+        // `libart(d)` must be specified in shared_libs list before `libnativehelper`,
+        // so that its symbols have precedence over `libnativehelper`.
+        "libnativehelper",
+    ],
     target: {
+        android: {
+            shared_libs: [
+                // Dependencies of `libart(d)`, that are not included in *static_defaults.
+                "libdl_android",
+                "libstatspull",
+                "libstatssocket",
+                "heapprofd_client_api",
+            ],
+        },
         linux: {
             ldflags: [
                 // Allow jni_compiler_test to find Java_MyClassNatives_bar
@@ -227,15 +258,21 @@
             ],
         },
         host: {
-            shared_libs: [
-                "libziparchive",
-            ],
             cflags: [
                 "-fsanitize-address-use-after-return=never",
                 "-Wno-unused-command-line-argument",
             ],
         },
     },
+    static_libs: [
+        "libartbase-testing",
+        // `libsigchain` must be static linked into gtests, otherwise some tests fail under
+        // ASAN. ASAN init uses sigaction, which makes `libsigchain.so` initialize earlier than
+        // required and breaks `environ` variable in gtest.
+        // `libsigchain` is not whole-static-linked into `libart(d)-gtest`, because hiding its
+        // symbols with `--exclude-libs` breaks art_standalone_sigchain_tests.
+        "libsigchain",
+    ],
 }
 
 art_cc_defaults {
@@ -245,33 +282,17 @@
         "art_gtest_common_defaults",
         "art_debug_defaults",
     ],
-
     test_suites: ["art-host-tests"],
     test_options: {
         test_suite_tag: ["art-host-gtest"],
     },
-
-    shared_libs: [
-        "libartd",
-        "libartd-disassembler",
+    static_libs: [
         "libartd-gtest",
-        "libdexfiled",
-        "libprofiled",
-        "libartbased",
-        "libartbased-testing",
-
-        // Library `libnativehelper` needs to appear after `libartd` here,
-        // otherwise the following tests from module `libartd-runtime-gtest`
-        // will fail because `art/runtime/jni/java_vm_ext.cc` and
-        // `libnativehelper/JniInvocation.c` define symbols with the same name
-        // (e.g. `JNI_GetDefaultJavaVMInitArgs`) and the link order does matter
-        // for these tests:
-        // - JavaVmExtTest#JNI_GetDefaultJavaVMInitArgs
-        // - JavaVmExtTest#JNI_GetCreatedJavaVMs
-        // - JavaVmExtTest#AttachCurrentThread
-        // - JavaVmExtTest#AttachCurrentThreadAsDaemon
-        // - JavaVmExtTest#AttachCurrentThread_SmallStack
-        "libnativehelper",
+    ],
+    // Reduce test executable size by disabling automatic export of static lib symbols.
+    // Don't use --exclude-libs=ALL, because it breaks tests under ASAN by hiding __asan* symbols.
+    ldflags: [
+        "-Wl,--exclude-libs=libartd-gtest.a",
     ],
 }
 
@@ -285,12 +306,10 @@
         "art_standalone_test_defaults",
         "art_gtest_common_defaults",
     ],
-
     test_suites: [
         "general-tests",
         "mts-art",
     ],
-
     // Support multilib variants (using different suffix per sub-architecture), which is needed on
     // build targets with secondary architectures, as the MTS test suite packaging logic flattens
     // all test artifacts into a single `testcases` directory.
@@ -303,86 +322,22 @@
             suffix: "64",
         },
     },
-
-    // We use the "non-d" variants of libraries, as the Release ART APEX does
-    // not contain the "d" (debug) variants.
-    shared_libs: [
-        "libart",
-        "libart-compiler",
-        "libart-disassembler",
-        "libdexfile",
-        "libprofile",
-        "libartbase",
-
-        // Library `libnativehelper` needs to appear after `libart` here,
-        // otherwise the following tests from module `libart-runtime-gtest`
-        // will fail because `art/runtime/jni/java_vm_ext.cc` and
-        // `libnativehelper/JniInvocation.c` define symbols with the same name
-        // (e.g. `JNI_GetDefaultJavaVMInitArgs`) and the link order does matter
-        // for these tests:
-        // - JavaVmExtTest#JNI_GetDefaultJavaVMInitArgs
-        // - JavaVmExtTest#JNI_GetCreatedJavaVMs
-        // - JavaVmExtTest#AttachCurrentThread
-        // - JavaVmExtTest#AttachCurrentThreadAsDaemon
-        // - JavaVmExtTest#AttachCurrentThread_SmallStack
-        "libnativehelper",
-    ],
     static_libs: [
-        // For now, link `libart-gtest` and `libartbase-testing` statically for
-        // simplicity, to save the added complexity to package it in test suites
-        // (along with other test artifacts) and install it on device during
-        // tests.
-        // TODO(b/192070541): Consider linking `libart-gtest` dynamically.
         "libart-gtest",
-        "libartbase-testing",
     ],
-
+    // Reduce test executable size by disabling automatic export of static lib symbols.
+    // Don't use --exclude-libs=ALL, because it breaks tests under ASAN by hiding __asan* symbols.
+    ldflags: [
+        "-Wl,--exclude-libs=libart-gtest.a",
+    ],
     test_for: [
         "com.android.art",
         "com.android.art.debug",
     ],
 }
 
-// Variant of art_standalone_gtest_defaults that doesn't link dynamically to any
-// internal ART libraries.
 art_cc_defaults {
-    name: "art_cts_gtest_defaults",
-    defaults: [
-        // Note: We don't include "art_debug_defaults" here, as standalone ART
-        // gtests link with the "non-d" versions of the libraries contained in
-        // the ART APEX, so that they can be used with all ART APEX flavors
-        // (including the Release ART APEX).
-        "art_standalone_test_defaults",
-        "art_gtest_common_defaults",
-    ],
-    gtest: true,
-
-    // Support multilib variants (using different suffix per sub-architecture), which is needed on
-    // build targets with secondary architectures, as the MTS test suite packaging logic flattens
-    // all test artifacts into a single `testcases` directory.
-    compile_multilib: "both",
-    multilib: {
-        lib32: {
-            suffix: "32",
-        },
-        lib64: {
-            suffix: "64",
-        },
-    },
-
-    static_libs: [
-        "libartbase",
-    ],
-
-    test_suites: [
-        "general-tests",
-        "mts-art",
-    ],
-}
-
-// Properties common to `libart-gtest-defaults` and `libartd-gtest-defaults`.
-art_cc_defaults {
-    name: "libart-gtest-common-defaults",
+    name: "libart-gtest-defaults",
     defaults: [
         "art_defaults",
     ],
@@ -418,43 +373,6 @@
             enabled: false,
         },
     },
-    apex_available: [
-        "com.android.art.debug",
-        // TODO(b/183882457): This lib doesn't go into com.android.art, but
-        // apex_available lists need to be the same for internal libs to avoid
-        // stubs, and this depends on libdexfiled and others.
-        "com.android.art",
-        "test_broken_com.android.art",
-    ],
-}
-
-art_cc_defaults {
-    name: "libart-gtest-defaults",
-    defaults: [
-        "libart-gtest-common-defaults",
-    ],
-    shared_libs: [
-        "libart",
-        "libart-compiler",
-        "libdexfile",
-        "libprofile",
-        "libartbase",
-    ],
-}
-
-art_cc_defaults {
-    name: "libartd-gtest-defaults",
-    defaults: [
-        "art_debug_defaults",
-        "libart-gtest-common-defaults",
-    ],
-    shared_libs: [
-        "libartd",
-        "libartd-compiler",
-        "libdexfiled",
-        "libprofiled",
-        "libartbased",
-    ],
 }
 
 // Properties common to `libart-gtest` and `libartd-gtest`.
@@ -471,7 +389,6 @@
         "libgtest_isolated",
     ],
     shared_libs: [
-        "libbase",
         "liblog",
     ],
     target: {
@@ -485,17 +402,9 @@
             enabled: false,
         },
     },
-    apex_available: [
-        "com.android.art.debug",
-        // TODO(b/183882457): This lib doesn't go into com.android.art, but
-        // apex_available lists need to be the same for internal libs to avoid
-        // stubs, and this depends on libdexfiled and others.
-        "com.android.art",
-        "test_broken_com.android.art",
-    ],
 }
 
-art_cc_library {
+art_cc_library_static {
     name: "libart-gtest",
     defaults: [
         "libart-gtest-common",
@@ -505,17 +414,9 @@
         "libart-runtime-gtest",
         "libartbase-art-gtest",
     ],
-    shared_libs: [
-        "libart",
-        "libart-compiler",
-        "libdexfile",
-        "libprofile",
-        "libartbase",
-        "libartbase-testing",
-    ],
 }
 
-art_cc_library {
+art_cc_library_static {
     name: "libartd-gtest",
     defaults: [
         "art_debug_defaults",
@@ -526,14 +427,6 @@
         "libartd-runtime-gtest",
         "libartbased-art-gtest",
     ],
-    shared_libs: [
-        "libartd",
-        "libartd-compiler",
-        "libdexfiled",
-        "libprofiled",
-        "libartbased",
-        "libartbased-testing",
-    ],
 }
 
 // ART run-tests.
@@ -603,6 +496,10 @@
         "art-run-test-checker",
     ],
     min_sdk_version: "31",
+
+    compile_data: [
+        ":test_build_symlink_targets",
+    ],
 }
 
 art_cc_test_library {
@@ -789,7 +686,7 @@
         "2005-pause-all-redefine-multithreaded/pause-all.cc",
         "2009-structural-local-ref/local-ref.cc",
         "2035-structural-native-method/structural-native.cc",
-	"2243-single-step-default/single_step_helper.cc"
+        "2243-single-step-default/single_step_helper.cc",
     ],
     // Use NDK-compatible headers for ctstiagent.
     header_libs: [
@@ -1009,7 +906,6 @@
         "667-jit-jni-stub/jit_jni_stub_test.cc",
         "674-hiddenapi/hiddenapi.cc",
         "692-vdex-inmem-loader/vdex_inmem_loader.cc",
-        "708-jit-cache-churn/jit.cc",
         "720-thread-priority/thread_priority.cc",
         "800-smali/jni.cc",
         "817-hiddenapi/test_native.cc",
@@ -1026,8 +922,11 @@
         "2036-jni-filechannel/jni_filechannel.cc",
         "2037-thread-name-inherit/thread_name_inherit.cc",
         "2040-huge-native-alloc/huge_native_buf.cc",
+        "2048-bad-native-registry/native_finalizer.cc",
         "2235-JdkUnsafeTest/unsafe_test.cc",
-	"2262-miranda-methods/jni_invoke.cc",
+        "2246-trace-v2/dump_trace.cc",
+        "2262-miranda-methods/jni_invoke.cc",
+        "2270-mh-internal-hiddenapi-use/mh-internal-hidden-api.cc",
         "common/runtime_state.cc",
         "common/stack_inspect.cc",
     ],
@@ -1045,6 +944,7 @@
         "//art:__subpackages__",
         "//cts/hostsidetests/jvmti:__subpackages__",
     ],
+    javacflags: ["-g"],
     srcs: [
         // shim classes. We use one that exposes the common functionality.
         "jvmti-common/Redefinition.java",
@@ -1776,8 +1676,8 @@
 // Assemble jar file from smali source.
 genrule_defaults {
     name: "art-gtest-jars-smali-defaults",
-    cmd: "$(location smali) assemble --output $(out) $(in)",
-    tools: ["smali"],
+    cmd: "$(location android-smali) assemble --output $(out) $(in)",
+    tools: ["android-smali"],
 }
 
 // A copy of Main with the classes.dex stripped for the oat file assistant tests.
@@ -1925,25 +1825,6 @@
     out: ["art-gtest-jars-Dex2oatVdexPublicSdkDex.dex"],
 }
 
-genrule_defaults {
-    name: "art-run-test-data-defaults",
-    defaults: [
-        // Enable only in source builds, where com.android.art.testing is
-        // available.
-        "art_module_source_build_genrule_defaults",
-    ],
-    tool_files: [
-        "run_test_build.py",
-        ":art-run-test-bootclasspath",
-    ],
-    tools: [
-        "d8",
-        "hiddenapi",
-        "jasmin",
-        "smali",
-    ],
-}
-
 build = [
     "Android.run-test.bp",
 ]
diff --git a/test/Android.run-test.bp b/test/Android.run-test.bp
index b5fed42..d7305e6 100644
--- a/test/Android.run-test.bp
+++ b/test/Android.run-test.bp
@@ -1,10 +1,23 @@
 // This file was generated by Android.run-test.bp.py
 // It is not necessary to regenerate it when tests are added/removed/modified.
 
+TEST_BUILD_COMMON_ARGS = "$(location run_test_build.py) --out $(out) " +
+    "--bootclasspath $(location :art-run-test-bootclasspath) " +
+    "--d8 $(location d8) " +
+    "--jasmin $(location jasmin) " +
+    "--rewrapper $(location rewrapper) " +
+    "--smali $(location android-smali) " +
+    "--soong_zip $(location soong_zip) " +
+    "--zipalign $(location zipalign) "
+
 java_genrule {
     name: "art-run-test-host-data-shard00-tmp",
     out: ["art-run-test-host-data-shard00.zip"],
-    srcs: ["?00-*/**/*", "??00-*/**/*"],
+    srcs: [
+        "?00-*/**/*",
+        "??00-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?00-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -20,7 +33,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard01-tmp",
     out: ["art-run-test-host-data-shard01.zip"],
-    srcs: ["?01-*/**/*", "??01-*/**/*"],
+    srcs: [
+        "?01-*/**/*",
+        "??01-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?01-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -36,7 +53,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard02-tmp",
     out: ["art-run-test-host-data-shard02.zip"],
-    srcs: ["?02-*/**/*", "??02-*/**/*"],
+    srcs: [
+        "?02-*/**/*",
+        "??02-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?02-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -52,7 +73,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard03-tmp",
     out: ["art-run-test-host-data-shard03.zip"],
-    srcs: ["?03-*/**/*", "??03-*/**/*"],
+    srcs: [
+        "?03-*/**/*",
+        "??03-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?03-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -68,7 +93,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard04-tmp",
     out: ["art-run-test-host-data-shard04.zip"],
-    srcs: ["?04-*/**/*", "??04-*/**/*"],
+    srcs: [
+        "?04-*/**/*",
+        "??04-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?04-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -84,7 +113,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard05-tmp",
     out: ["art-run-test-host-data-shard05.zip"],
-    srcs: ["?05-*/**/*", "??05-*/**/*"],
+    srcs: [
+        "?05-*/**/*",
+        "??05-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?05-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -100,7 +133,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard06-tmp",
     out: ["art-run-test-host-data-shard06.zip"],
-    srcs: ["?06-*/**/*", "??06-*/**/*"],
+    srcs: [
+        "?06-*/**/*",
+        "??06-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?06-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -116,7 +153,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard07-tmp",
     out: ["art-run-test-host-data-shard07.zip"],
-    srcs: ["?07-*/**/*", "??07-*/**/*"],
+    srcs: [
+        "?07-*/**/*",
+        "??07-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?07-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -132,7 +173,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard08-tmp",
     out: ["art-run-test-host-data-shard08.zip"],
-    srcs: ["?08-*/**/*", "??08-*/**/*"],
+    srcs: [
+        "?08-*/**/*",
+        "??08-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?08-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -148,7 +193,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard09-tmp",
     out: ["art-run-test-host-data-shard09.zip"],
-    srcs: ["?09-*/**/*", "??09-*/**/*"],
+    srcs: [
+        "?09-*/**/*",
+        "??09-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?09-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -164,7 +213,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard10-tmp",
     out: ["art-run-test-host-data-shard10.zip"],
-    srcs: ["?10-*/**/*", "??10-*/**/*"],
+    srcs: [
+        "?10-*/**/*",
+        "??10-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?10-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -180,7 +233,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard11-tmp",
     out: ["art-run-test-host-data-shard11.zip"],
-    srcs: ["?11-*/**/*", "??11-*/**/*"],
+    srcs: [
+        "?11-*/**/*",
+        "??11-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?11-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -196,7 +253,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard12-tmp",
     out: ["art-run-test-host-data-shard12.zip"],
-    srcs: ["?12-*/**/*", "??12-*/**/*"],
+    srcs: [
+        "?12-*/**/*",
+        "??12-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?12-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -212,7 +273,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard13-tmp",
     out: ["art-run-test-host-data-shard13.zip"],
-    srcs: ["?13-*/**/*", "??13-*/**/*"],
+    srcs: [
+        "?13-*/**/*",
+        "??13-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?13-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -228,7 +293,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard14-tmp",
     out: ["art-run-test-host-data-shard14.zip"],
-    srcs: ["?14-*/**/*", "??14-*/**/*"],
+    srcs: [
+        "?14-*/**/*",
+        "??14-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?14-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -244,7 +313,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard15-tmp",
     out: ["art-run-test-host-data-shard15.zip"],
-    srcs: ["?15-*/**/*", "??15-*/**/*"],
+    srcs: [
+        "?15-*/**/*",
+        "??15-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?15-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -260,7 +333,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard16-tmp",
     out: ["art-run-test-host-data-shard16.zip"],
-    srcs: ["?16-*/**/*", "??16-*/**/*"],
+    srcs: [
+        "?16-*/**/*",
+        "??16-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?16-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -276,7 +353,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard17-tmp",
     out: ["art-run-test-host-data-shard17.zip"],
-    srcs: ["?17-*/**/*", "??17-*/**/*"],
+    srcs: [
+        "?17-*/**/*",
+        "??17-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?17-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -292,7 +373,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard18-tmp",
     out: ["art-run-test-host-data-shard18.zip"],
-    srcs: ["?18-*/**/*", "??18-*/**/*"],
+    srcs: [
+        "?18-*/**/*",
+        "??18-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?18-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -308,7 +393,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard19-tmp",
     out: ["art-run-test-host-data-shard19.zip"],
-    srcs: ["?19-*/**/*", "??19-*/**/*"],
+    srcs: [
+        "?19-*/**/*",
+        "??19-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?19-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -324,7 +413,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard20-tmp",
     out: ["art-run-test-host-data-shard20.zip"],
-    srcs: ["?20-*/**/*", "??20-*/**/*"],
+    srcs: [
+        "?20-*/**/*",
+        "??20-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?20-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -340,7 +433,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard21-tmp",
     out: ["art-run-test-host-data-shard21.zip"],
-    srcs: ["?21-*/**/*", "??21-*/**/*"],
+    srcs: [
+        "?21-*/**/*",
+        "??21-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?21-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -356,7 +453,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard22-tmp",
     out: ["art-run-test-host-data-shard22.zip"],
-    srcs: ["?22-*/**/*", "??22-*/**/*"],
+    srcs: [
+        "?22-*/**/*",
+        "??22-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?22-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -372,7 +473,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard23-tmp",
     out: ["art-run-test-host-data-shard23.zip"],
-    srcs: ["?23-*/**/*", "??23-*/**/*"],
+    srcs: [
+        "?23-*/**/*",
+        "??23-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?23-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -388,7 +493,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard24-tmp",
     out: ["art-run-test-host-data-shard24.zip"],
-    srcs: ["?24-*/**/*", "??24-*/**/*"],
+    srcs: [
+        "?24-*/**/*",
+        "??24-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?24-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -404,7 +513,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard25-tmp",
     out: ["art-run-test-host-data-shard25.zip"],
-    srcs: ["?25-*/**/*", "??25-*/**/*"],
+    srcs: [
+        "?25-*/**/*",
+        "??25-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?25-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -420,7 +533,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard26-tmp",
     out: ["art-run-test-host-data-shard26.zip"],
-    srcs: ["?26-*/**/*", "??26-*/**/*"],
+    srcs: [
+        "?26-*/**/*",
+        "??26-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?26-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -436,7 +553,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard27-tmp",
     out: ["art-run-test-host-data-shard27.zip"],
-    srcs: ["?27-*/**/*", "??27-*/**/*"],
+    srcs: [
+        "?27-*/**/*",
+        "??27-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?27-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -452,7 +573,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard28-tmp",
     out: ["art-run-test-host-data-shard28.zip"],
-    srcs: ["?28-*/**/*", "??28-*/**/*"],
+    srcs: [
+        "?28-*/**/*",
+        "??28-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?28-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -468,7 +593,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard29-tmp",
     out: ["art-run-test-host-data-shard29.zip"],
-    srcs: ["?29-*/**/*", "??29-*/**/*"],
+    srcs: [
+        "?29-*/**/*",
+        "??29-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?29-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -484,7 +613,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard30-tmp",
     out: ["art-run-test-host-data-shard30.zip"],
-    srcs: ["?30-*/**/*", "??30-*/**/*"],
+    srcs: [
+        "?30-*/**/*",
+        "??30-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?30-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -500,7 +633,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard31-tmp",
     out: ["art-run-test-host-data-shard31.zip"],
-    srcs: ["?31-*/**/*", "??31-*/**/*"],
+    srcs: [
+        "?31-*/**/*",
+        "??31-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?31-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -516,7 +653,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard32-tmp",
     out: ["art-run-test-host-data-shard32.zip"],
-    srcs: ["?32-*/**/*", "??32-*/**/*"],
+    srcs: [
+        "?32-*/**/*",
+        "??32-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?32-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -532,7 +673,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard33-tmp",
     out: ["art-run-test-host-data-shard33.zip"],
-    srcs: ["?33-*/**/*", "??33-*/**/*"],
+    srcs: [
+        "?33-*/**/*",
+        "??33-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?33-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -548,7 +693,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard34-tmp",
     out: ["art-run-test-host-data-shard34.zip"],
-    srcs: ["?34-*/**/*", "??34-*/**/*"],
+    srcs: [
+        "?34-*/**/*",
+        "??34-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?34-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -564,7 +713,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard35-tmp",
     out: ["art-run-test-host-data-shard35.zip"],
-    srcs: ["?35-*/**/*", "??35-*/**/*"],
+    srcs: [
+        "?35-*/**/*",
+        "??35-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?35-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -580,7 +733,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard36-tmp",
     out: ["art-run-test-host-data-shard36.zip"],
-    srcs: ["?36-*/**/*", "??36-*/**/*"],
+    srcs: [
+        "?36-*/**/*",
+        "??36-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?36-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -596,7 +753,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard37-tmp",
     out: ["art-run-test-host-data-shard37.zip"],
-    srcs: ["?37-*/**/*", "??37-*/**/*"],
+    srcs: [
+        "?37-*/**/*",
+        "??37-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?37-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -612,7 +773,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard38-tmp",
     out: ["art-run-test-host-data-shard38.zip"],
-    srcs: ["?38-*/**/*", "??38-*/**/*"],
+    srcs: [
+        "?38-*/**/*",
+        "??38-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?38-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -628,7 +793,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard39-tmp",
     out: ["art-run-test-host-data-shard39.zip"],
-    srcs: ["?39-*/**/*", "??39-*/**/*"],
+    srcs: [
+        "?39-*/**/*",
+        "??39-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?39-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -644,7 +813,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard40-tmp",
     out: ["art-run-test-host-data-shard40.zip"],
-    srcs: ["?40-*/**/*", "??40-*/**/*"],
+    srcs: [
+        "?40-*/**/*",
+        "??40-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?40-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -660,7 +833,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard41-tmp",
     out: ["art-run-test-host-data-shard41.zip"],
-    srcs: ["?41-*/**/*", "??41-*/**/*"],
+    srcs: [
+        "?41-*/**/*",
+        "??41-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?41-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -676,7 +853,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard42-tmp",
     out: ["art-run-test-host-data-shard42.zip"],
-    srcs: ["?42-*/**/*", "??42-*/**/*"],
+    srcs: [
+        "?42-*/**/*",
+        "??42-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?42-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -692,7 +873,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard43-tmp",
     out: ["art-run-test-host-data-shard43.zip"],
-    srcs: ["?43-*/**/*", "??43-*/**/*"],
+    srcs: [
+        "?43-*/**/*",
+        "??43-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?43-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -708,7 +893,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard44-tmp",
     out: ["art-run-test-host-data-shard44.zip"],
-    srcs: ["?44-*/**/*", "??44-*/**/*"],
+    srcs: [
+        "?44-*/**/*",
+        "??44-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?44-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -724,7 +913,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard45-tmp",
     out: ["art-run-test-host-data-shard45.zip"],
-    srcs: ["?45-*/**/*", "??45-*/**/*"],
+    srcs: [
+        "?45-*/**/*",
+        "??45-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?45-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -740,7 +933,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard46-tmp",
     out: ["art-run-test-host-data-shard46.zip"],
-    srcs: ["?46-*/**/*", "??46-*/**/*"],
+    srcs: [
+        "?46-*/**/*",
+        "??46-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?46-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -756,7 +953,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard47-tmp",
     out: ["art-run-test-host-data-shard47.zip"],
-    srcs: ["?47-*/**/*", "??47-*/**/*"],
+    srcs: [
+        "?47-*/**/*",
+        "??47-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?47-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -772,7 +973,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard48-tmp",
     out: ["art-run-test-host-data-shard48.zip"],
-    srcs: ["?48-*/**/*", "??48-*/**/*"],
+    srcs: [
+        "?48-*/**/*",
+        "??48-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?48-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -788,7 +993,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard49-tmp",
     out: ["art-run-test-host-data-shard49.zip"],
-    srcs: ["?49-*/**/*", "??49-*/**/*"],
+    srcs: [
+        "?49-*/**/*",
+        "??49-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?49-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -804,7 +1013,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard50-tmp",
     out: ["art-run-test-host-data-shard50.zip"],
-    srcs: ["?50-*/**/*", "??50-*/**/*"],
+    srcs: [
+        "?50-*/**/*",
+        "??50-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?50-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -820,7 +1033,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard51-tmp",
     out: ["art-run-test-host-data-shard51.zip"],
-    srcs: ["?51-*/**/*", "??51-*/**/*"],
+    srcs: [
+        "?51-*/**/*",
+        "??51-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?51-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -836,7 +1053,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard52-tmp",
     out: ["art-run-test-host-data-shard52.zip"],
-    srcs: ["?52-*/**/*", "??52-*/**/*"],
+    srcs: [
+        "?52-*/**/*",
+        "??52-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?52-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -852,7 +1073,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard53-tmp",
     out: ["art-run-test-host-data-shard53.zip"],
-    srcs: ["?53-*/**/*", "??53-*/**/*"],
+    srcs: [
+        "?53-*/**/*",
+        "??53-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?53-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -868,7 +1093,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard54-tmp",
     out: ["art-run-test-host-data-shard54.zip"],
-    srcs: ["?54-*/**/*", "??54-*/**/*"],
+    srcs: [
+        "?54-*/**/*",
+        "??54-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?54-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -884,7 +1113,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard55-tmp",
     out: ["art-run-test-host-data-shard55.zip"],
-    srcs: ["?55-*/**/*", "??55-*/**/*"],
+    srcs: [
+        "?55-*/**/*",
+        "??55-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?55-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -900,7 +1133,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard56-tmp",
     out: ["art-run-test-host-data-shard56.zip"],
-    srcs: ["?56-*/**/*", "??56-*/**/*"],
+    srcs: [
+        "?56-*/**/*",
+        "??56-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?56-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -916,7 +1153,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard57-tmp",
     out: ["art-run-test-host-data-shard57.zip"],
-    srcs: ["?57-*/**/*", "??57-*/**/*"],
+    srcs: [
+        "?57-*/**/*",
+        "??57-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?57-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -932,7 +1173,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard58-tmp",
     out: ["art-run-test-host-data-shard58.zip"],
-    srcs: ["?58-*/**/*", "??58-*/**/*"],
+    srcs: [
+        "?58-*/**/*",
+        "??58-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?58-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -948,7 +1193,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard59-tmp",
     out: ["art-run-test-host-data-shard59.zip"],
-    srcs: ["?59-*/**/*", "??59-*/**/*"],
+    srcs: [
+        "?59-*/**/*",
+        "??59-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?59-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -964,7 +1213,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard60-tmp",
     out: ["art-run-test-host-data-shard60.zip"],
-    srcs: ["?60-*/**/*", "??60-*/**/*"],
+    srcs: [
+        "?60-*/**/*",
+        "??60-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?60-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -980,7 +1233,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard61-tmp",
     out: ["art-run-test-host-data-shard61.zip"],
-    srcs: ["?61-*/**/*", "??61-*/**/*"],
+    srcs: [
+        "?61-*/**/*",
+        "??61-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?61-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -996,7 +1253,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard62-tmp",
     out: ["art-run-test-host-data-shard62.zip"],
-    srcs: ["?62-*/**/*", "??62-*/**/*"],
+    srcs: [
+        "?62-*/**/*",
+        "??62-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?62-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1012,7 +1273,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard63-tmp",
     out: ["art-run-test-host-data-shard63.zip"],
-    srcs: ["?63-*/**/*", "??63-*/**/*"],
+    srcs: [
+        "?63-*/**/*",
+        "??63-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?63-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1028,7 +1293,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard64-tmp",
     out: ["art-run-test-host-data-shard64.zip"],
-    srcs: ["?64-*/**/*", "??64-*/**/*"],
+    srcs: [
+        "?64-*/**/*",
+        "??64-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?64-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1044,7 +1313,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard65-tmp",
     out: ["art-run-test-host-data-shard65.zip"],
-    srcs: ["?65-*/**/*", "??65-*/**/*"],
+    srcs: [
+        "?65-*/**/*",
+        "??65-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?65-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1060,7 +1333,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard66-tmp",
     out: ["art-run-test-host-data-shard66.zip"],
-    srcs: ["?66-*/**/*", "??66-*/**/*"],
+    srcs: [
+        "?66-*/**/*",
+        "??66-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?66-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1076,7 +1353,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard67-tmp",
     out: ["art-run-test-host-data-shard67.zip"],
-    srcs: ["?67-*/**/*", "??67-*/**/*"],
+    srcs: [
+        "?67-*/**/*",
+        "??67-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?67-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1092,7 +1373,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard68-tmp",
     out: ["art-run-test-host-data-shard68.zip"],
-    srcs: ["?68-*/**/*", "??68-*/**/*"],
+    srcs: [
+        "?68-*/**/*",
+        "??68-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?68-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1108,7 +1393,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard69-tmp",
     out: ["art-run-test-host-data-shard69.zip"],
-    srcs: ["?69-*/**/*", "??69-*/**/*"],
+    srcs: [
+        "?69-*/**/*",
+        "??69-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?69-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1124,7 +1413,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard70-tmp",
     out: ["art-run-test-host-data-shard70.zip"],
-    srcs: ["?70-*/**/*", "??70-*/**/*"],
+    srcs: [
+        "?70-*/**/*",
+        "??70-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?70-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1140,7 +1433,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard71-tmp",
     out: ["art-run-test-host-data-shard71.zip"],
-    srcs: ["?71-*/**/*", "??71-*/**/*"],
+    srcs: [
+        "?71-*/**/*",
+        "??71-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?71-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1156,7 +1453,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard72-tmp",
     out: ["art-run-test-host-data-shard72.zip"],
-    srcs: ["?72-*/**/*", "??72-*/**/*"],
+    srcs: [
+        "?72-*/**/*",
+        "??72-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?72-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1172,7 +1473,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard73-tmp",
     out: ["art-run-test-host-data-shard73.zip"],
-    srcs: ["?73-*/**/*", "??73-*/**/*"],
+    srcs: [
+        "?73-*/**/*",
+        "??73-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?73-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1188,7 +1493,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard74-tmp",
     out: ["art-run-test-host-data-shard74.zip"],
-    srcs: ["?74-*/**/*", "??74-*/**/*"],
+    srcs: [
+        "?74-*/**/*",
+        "??74-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?74-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1204,7 +1513,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard75-tmp",
     out: ["art-run-test-host-data-shard75.zip"],
-    srcs: ["?75-*/**/*", "??75-*/**/*"],
+    srcs: [
+        "?75-*/**/*",
+        "??75-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?75-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1220,7 +1533,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard76-tmp",
     out: ["art-run-test-host-data-shard76.zip"],
-    srcs: ["?76-*/**/*", "??76-*/**/*"],
+    srcs: [
+        "?76-*/**/*",
+        "??76-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?76-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1236,7 +1553,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard77-tmp",
     out: ["art-run-test-host-data-shard77.zip"],
-    srcs: ["?77-*/**/*", "??77-*/**/*"],
+    srcs: [
+        "?77-*/**/*",
+        "??77-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?77-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1252,7 +1573,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard78-tmp",
     out: ["art-run-test-host-data-shard78.zip"],
-    srcs: ["?78-*/**/*", "??78-*/**/*"],
+    srcs: [
+        "?78-*/**/*",
+        "??78-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?78-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1268,7 +1593,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard79-tmp",
     out: ["art-run-test-host-data-shard79.zip"],
-    srcs: ["?79-*/**/*", "??79-*/**/*"],
+    srcs: [
+        "?79-*/**/*",
+        "??79-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?79-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1284,7 +1613,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard80-tmp",
     out: ["art-run-test-host-data-shard80.zip"],
-    srcs: ["?80-*/**/*", "??80-*/**/*"],
+    srcs: [
+        "?80-*/**/*",
+        "??80-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?80-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1300,7 +1633,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard81-tmp",
     out: ["art-run-test-host-data-shard81.zip"],
-    srcs: ["?81-*/**/*", "??81-*/**/*"],
+    srcs: [
+        "?81-*/**/*",
+        "??81-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?81-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1316,7 +1653,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard82-tmp",
     out: ["art-run-test-host-data-shard82.zip"],
-    srcs: ["?82-*/**/*", "??82-*/**/*"],
+    srcs: [
+        "?82-*/**/*",
+        "??82-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?82-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1332,7 +1673,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard83-tmp",
     out: ["art-run-test-host-data-shard83.zip"],
-    srcs: ["?83-*/**/*", "??83-*/**/*"],
+    srcs: [
+        "?83-*/**/*",
+        "??83-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?83-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1348,7 +1693,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard84-tmp",
     out: ["art-run-test-host-data-shard84.zip"],
-    srcs: ["?84-*/**/*", "??84-*/**/*"],
+    srcs: [
+        "?84-*/**/*",
+        "??84-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?84-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1364,7 +1713,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard85-tmp",
     out: ["art-run-test-host-data-shard85.zip"],
-    srcs: ["?85-*/**/*", "??85-*/**/*"],
+    srcs: [
+        "?85-*/**/*",
+        "??85-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?85-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1380,7 +1733,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard86-tmp",
     out: ["art-run-test-host-data-shard86.zip"],
-    srcs: ["?86-*/**/*", "??86-*/**/*"],
+    srcs: [
+        "?86-*/**/*",
+        "??86-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?86-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1396,7 +1753,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard87-tmp",
     out: ["art-run-test-host-data-shard87.zip"],
-    srcs: ["?87-*/**/*", "??87-*/**/*"],
+    srcs: [
+        "?87-*/**/*",
+        "??87-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?87-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1412,7 +1773,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard88-tmp",
     out: ["art-run-test-host-data-shard88.zip"],
-    srcs: ["?88-*/**/*", "??88-*/**/*"],
+    srcs: [
+        "?88-*/**/*",
+        "??88-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?88-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1428,7 +1793,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard89-tmp",
     out: ["art-run-test-host-data-shard89.zip"],
-    srcs: ["?89-*/**/*", "??89-*/**/*"],
+    srcs: [
+        "?89-*/**/*",
+        "??89-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?89-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1444,7 +1813,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard90-tmp",
     out: ["art-run-test-host-data-shard90.zip"],
-    srcs: ["?90-*/**/*", "??90-*/**/*"],
+    srcs: [
+        "?90-*/**/*",
+        "??90-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?90-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1460,7 +1833,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard91-tmp",
     out: ["art-run-test-host-data-shard91.zip"],
-    srcs: ["?91-*/**/*", "??91-*/**/*"],
+    srcs: [
+        "?91-*/**/*",
+        "??91-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?91-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1476,7 +1853,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard92-tmp",
     out: ["art-run-test-host-data-shard92.zip"],
-    srcs: ["?92-*/**/*", "??92-*/**/*"],
+    srcs: [
+        "?92-*/**/*",
+        "??92-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?92-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1492,7 +1873,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard93-tmp",
     out: ["art-run-test-host-data-shard93.zip"],
-    srcs: ["?93-*/**/*", "??93-*/**/*"],
+    srcs: [
+        "?93-*/**/*",
+        "??93-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?93-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1508,7 +1893,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard94-tmp",
     out: ["art-run-test-host-data-shard94.zip"],
-    srcs: ["?94-*/**/*", "??94-*/**/*"],
+    srcs: [
+        "?94-*/**/*",
+        "??94-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?94-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1524,7 +1913,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard95-tmp",
     out: ["art-run-test-host-data-shard95.zip"],
-    srcs: ["?95-*/**/*", "??95-*/**/*"],
+    srcs: [
+        "?95-*/**/*",
+        "??95-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?95-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1540,7 +1933,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard96-tmp",
     out: ["art-run-test-host-data-shard96.zip"],
-    srcs: ["?96-*/**/*", "??96-*/**/*"],
+    srcs: [
+        "?96-*/**/*",
+        "??96-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?96-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1556,7 +1953,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard97-tmp",
     out: ["art-run-test-host-data-shard97.zip"],
-    srcs: ["?97-*/**/*", "??97-*/**/*"],
+    srcs: [
+        "?97-*/**/*",
+        "??97-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?97-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1572,7 +1973,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard98-tmp",
     out: ["art-run-test-host-data-shard98.zip"],
-    srcs: ["?98-*/**/*", "??98-*/**/*"],
+    srcs: [
+        "?98-*/**/*",
+        "??98-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?98-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1588,7 +1993,11 @@
 java_genrule {
     name: "art-run-test-host-data-shard99-tmp",
     out: ["art-run-test-host-data-shard99.zip"],
-    srcs: ["?99-*/**/*", "??99-*/**/*"],
+    srcs: [
+        "?99-*/**/*",
+        "??99-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode host --test-dir-regex 'art/test/..?99-' $(in)",
     defaults: ["art-run-test-host-data-defaults"],
 }
 
@@ -1604,18 +2013,13 @@
 java_genrule {
     name: "art-run-test-host-data-shardHiddenApi-tmp",
     out: ["art-run-test-host-data-shardHiddenApi.zip"],
-    srcs: ["???-*hiddenapi*/**/*", "????-*hiddenapi*/**/*"],
+    srcs: [
+        "???-*hiddenapi*/**/*",
+        "????-*hiddenapi*/**/*",
+    ],
     defaults: ["art-run-test-host-data-defaults"],
     tools: ["hiddenapi"],
-    cmd: "$(location run_test_build.py) --out $(out) --mode host " +
-         "--bootclasspath $(location :art-run-test-bootclasspath) " +
-         "--d8 $(location d8) " +
-         "--hiddenapi $(location hiddenapi) " +
-         "--jasmin $(location jasmin) " +
-         "--smali $(location smali) " +
-         "--soong_zip $(location soong_zip) " +
-         "--zipalign $(location zipalign) " +
-         "$(in)",
+    cmd: TEST_BUILD_COMMON_ARGS + "--hiddenapi $(location hiddenapi) --mode host --test-dir-regex 'art/test/....?-[^/]*hiddenapi' $(in)",
 }
 
 // Install in the output directory to make it accessible for tests.
@@ -1638,21 +2042,31 @@
         "run_test_build.py",
         ":art-run-test-bootclasspath",
     ],
+    srcs: [
+        // Since genrules are sandboxed, all the sources they use must be listed in
+        // the Android.bp file. Some tests have symlinks to files from other tests, and
+        // those must also be listed to avoid a dangling symlink in the sandbox.
+        "jvmti-common/*.java",
+        "utils/python/**/*.py",
+        ":development_docs",
+        ":asm-9.2-filegroup",
+        ":ojluni-AbstractCollection",
+        "988-method-trace/expected-stdout.txt",
+        "988-method-trace/expected-stderr.txt",
+        "988-method-trace/src/art/Test988Intrinsics.java",
+        "988-method-trace/src/art/Test988.java",
+        "988-method-trace/trace_fib.cc",
+        "1953-pop-frame/src/art/Test1953.java",
+        "1953-pop-frame/src/art/SuspendEvents.java",
+    ],
     tools: [
+        "android-smali",
         "d8",
         "jasmin",
-        "smali",
+        "rewrapper",
         "soong_zip",
         "zipalign",
     ],
-    cmd: "$(location run_test_build.py) --out $(out) --mode host " +
-         "--bootclasspath $(location :art-run-test-bootclasspath) " +
-         "--d8 $(location d8) " +
-         "--jasmin $(location jasmin) " +
-         "--smali $(location smali) " +
-         "--soong_zip $(location soong_zip) " +
-         "--zipalign $(location zipalign) " +
-         "$(in)",
 }
 
 java_genrule {
@@ -1881,7 +2295,11 @@
 // Phony target used to build all shards
 java_genrule {
     name: "art-run-test-host-data-tmp",
-    defaults: ["art-run-test-data-defaults"],
+    defaults: [
+        // Enable only in source builds, where com.android.art.testing is
+        // available.
+        "art_module_source_build_genrule_defaults",
+    ],
     out: ["art-run-test-host-data.txt"],
     srcs: [
         ":art-run-test-host-data-shard00-tmp",
@@ -2104,7 +2522,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard00-tmp",
     out: ["art-run-test-target-data-shard00.zip"],
-    srcs: ["?00-*/**/*", "??00-*/**/*"],
+    srcs: [
+        "?00-*/**/*",
+        "??00-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?00-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2120,7 +2542,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard01-tmp",
     out: ["art-run-test-target-data-shard01.zip"],
-    srcs: ["?01-*/**/*", "??01-*/**/*"],
+    srcs: [
+        "?01-*/**/*",
+        "??01-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?01-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2136,7 +2562,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard02-tmp",
     out: ["art-run-test-target-data-shard02.zip"],
-    srcs: ["?02-*/**/*", "??02-*/**/*"],
+    srcs: [
+        "?02-*/**/*",
+        "??02-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?02-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2152,7 +2582,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard03-tmp",
     out: ["art-run-test-target-data-shard03.zip"],
-    srcs: ["?03-*/**/*", "??03-*/**/*"],
+    srcs: [
+        "?03-*/**/*",
+        "??03-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?03-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2168,7 +2602,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard04-tmp",
     out: ["art-run-test-target-data-shard04.zip"],
-    srcs: ["?04-*/**/*", "??04-*/**/*"],
+    srcs: [
+        "?04-*/**/*",
+        "??04-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?04-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2184,7 +2622,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard05-tmp",
     out: ["art-run-test-target-data-shard05.zip"],
-    srcs: ["?05-*/**/*", "??05-*/**/*"],
+    srcs: [
+        "?05-*/**/*",
+        "??05-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?05-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2200,7 +2642,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard06-tmp",
     out: ["art-run-test-target-data-shard06.zip"],
-    srcs: ["?06-*/**/*", "??06-*/**/*"],
+    srcs: [
+        "?06-*/**/*",
+        "??06-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?06-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2216,7 +2662,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard07-tmp",
     out: ["art-run-test-target-data-shard07.zip"],
-    srcs: ["?07-*/**/*", "??07-*/**/*"],
+    srcs: [
+        "?07-*/**/*",
+        "??07-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?07-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2232,7 +2682,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard08-tmp",
     out: ["art-run-test-target-data-shard08.zip"],
-    srcs: ["?08-*/**/*", "??08-*/**/*"],
+    srcs: [
+        "?08-*/**/*",
+        "??08-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?08-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2248,7 +2702,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard09-tmp",
     out: ["art-run-test-target-data-shard09.zip"],
-    srcs: ["?09-*/**/*", "??09-*/**/*"],
+    srcs: [
+        "?09-*/**/*",
+        "??09-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?09-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2264,7 +2722,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard10-tmp",
     out: ["art-run-test-target-data-shard10.zip"],
-    srcs: ["?10-*/**/*", "??10-*/**/*"],
+    srcs: [
+        "?10-*/**/*",
+        "??10-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?10-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2280,7 +2742,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard11-tmp",
     out: ["art-run-test-target-data-shard11.zip"],
-    srcs: ["?11-*/**/*", "??11-*/**/*"],
+    srcs: [
+        "?11-*/**/*",
+        "??11-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?11-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2296,7 +2762,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard12-tmp",
     out: ["art-run-test-target-data-shard12.zip"],
-    srcs: ["?12-*/**/*", "??12-*/**/*"],
+    srcs: [
+        "?12-*/**/*",
+        "??12-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?12-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2312,7 +2782,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard13-tmp",
     out: ["art-run-test-target-data-shard13.zip"],
-    srcs: ["?13-*/**/*", "??13-*/**/*"],
+    srcs: [
+        "?13-*/**/*",
+        "??13-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?13-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2328,7 +2802,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard14-tmp",
     out: ["art-run-test-target-data-shard14.zip"],
-    srcs: ["?14-*/**/*", "??14-*/**/*"],
+    srcs: [
+        "?14-*/**/*",
+        "??14-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?14-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2344,7 +2822,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard15-tmp",
     out: ["art-run-test-target-data-shard15.zip"],
-    srcs: ["?15-*/**/*", "??15-*/**/*"],
+    srcs: [
+        "?15-*/**/*",
+        "??15-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?15-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2360,7 +2842,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard16-tmp",
     out: ["art-run-test-target-data-shard16.zip"],
-    srcs: ["?16-*/**/*", "??16-*/**/*"],
+    srcs: [
+        "?16-*/**/*",
+        "??16-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?16-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2376,7 +2862,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard17-tmp",
     out: ["art-run-test-target-data-shard17.zip"],
-    srcs: ["?17-*/**/*", "??17-*/**/*"],
+    srcs: [
+        "?17-*/**/*",
+        "??17-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?17-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2392,7 +2882,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard18-tmp",
     out: ["art-run-test-target-data-shard18.zip"],
-    srcs: ["?18-*/**/*", "??18-*/**/*"],
+    srcs: [
+        "?18-*/**/*",
+        "??18-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?18-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2408,7 +2902,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard19-tmp",
     out: ["art-run-test-target-data-shard19.zip"],
-    srcs: ["?19-*/**/*", "??19-*/**/*"],
+    srcs: [
+        "?19-*/**/*",
+        "??19-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?19-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2424,7 +2922,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard20-tmp",
     out: ["art-run-test-target-data-shard20.zip"],
-    srcs: ["?20-*/**/*", "??20-*/**/*"],
+    srcs: [
+        "?20-*/**/*",
+        "??20-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?20-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2440,7 +2942,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard21-tmp",
     out: ["art-run-test-target-data-shard21.zip"],
-    srcs: ["?21-*/**/*", "??21-*/**/*"],
+    srcs: [
+        "?21-*/**/*",
+        "??21-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?21-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2456,7 +2962,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard22-tmp",
     out: ["art-run-test-target-data-shard22.zip"],
-    srcs: ["?22-*/**/*", "??22-*/**/*"],
+    srcs: [
+        "?22-*/**/*",
+        "??22-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?22-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2472,7 +2982,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard23-tmp",
     out: ["art-run-test-target-data-shard23.zip"],
-    srcs: ["?23-*/**/*", "??23-*/**/*"],
+    srcs: [
+        "?23-*/**/*",
+        "??23-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?23-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2488,7 +3002,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard24-tmp",
     out: ["art-run-test-target-data-shard24.zip"],
-    srcs: ["?24-*/**/*", "??24-*/**/*"],
+    srcs: [
+        "?24-*/**/*",
+        "??24-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?24-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2504,7 +3022,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard25-tmp",
     out: ["art-run-test-target-data-shard25.zip"],
-    srcs: ["?25-*/**/*", "??25-*/**/*"],
+    srcs: [
+        "?25-*/**/*",
+        "??25-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?25-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2520,7 +3042,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard26-tmp",
     out: ["art-run-test-target-data-shard26.zip"],
-    srcs: ["?26-*/**/*", "??26-*/**/*"],
+    srcs: [
+        "?26-*/**/*",
+        "??26-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?26-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2536,7 +3062,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard27-tmp",
     out: ["art-run-test-target-data-shard27.zip"],
-    srcs: ["?27-*/**/*", "??27-*/**/*"],
+    srcs: [
+        "?27-*/**/*",
+        "??27-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?27-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2552,7 +3082,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard28-tmp",
     out: ["art-run-test-target-data-shard28.zip"],
-    srcs: ["?28-*/**/*", "??28-*/**/*"],
+    srcs: [
+        "?28-*/**/*",
+        "??28-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?28-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2568,7 +3102,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard29-tmp",
     out: ["art-run-test-target-data-shard29.zip"],
-    srcs: ["?29-*/**/*", "??29-*/**/*"],
+    srcs: [
+        "?29-*/**/*",
+        "??29-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?29-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2584,7 +3122,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard30-tmp",
     out: ["art-run-test-target-data-shard30.zip"],
-    srcs: ["?30-*/**/*", "??30-*/**/*"],
+    srcs: [
+        "?30-*/**/*",
+        "??30-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?30-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2600,7 +3142,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard31-tmp",
     out: ["art-run-test-target-data-shard31.zip"],
-    srcs: ["?31-*/**/*", "??31-*/**/*"],
+    srcs: [
+        "?31-*/**/*",
+        "??31-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?31-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2616,7 +3162,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard32-tmp",
     out: ["art-run-test-target-data-shard32.zip"],
-    srcs: ["?32-*/**/*", "??32-*/**/*"],
+    srcs: [
+        "?32-*/**/*",
+        "??32-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?32-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2632,7 +3182,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard33-tmp",
     out: ["art-run-test-target-data-shard33.zip"],
-    srcs: ["?33-*/**/*", "??33-*/**/*"],
+    srcs: [
+        "?33-*/**/*",
+        "??33-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?33-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2648,7 +3202,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard34-tmp",
     out: ["art-run-test-target-data-shard34.zip"],
-    srcs: ["?34-*/**/*", "??34-*/**/*"],
+    srcs: [
+        "?34-*/**/*",
+        "??34-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?34-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2664,7 +3222,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard35-tmp",
     out: ["art-run-test-target-data-shard35.zip"],
-    srcs: ["?35-*/**/*", "??35-*/**/*"],
+    srcs: [
+        "?35-*/**/*",
+        "??35-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?35-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2680,7 +3242,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard36-tmp",
     out: ["art-run-test-target-data-shard36.zip"],
-    srcs: ["?36-*/**/*", "??36-*/**/*"],
+    srcs: [
+        "?36-*/**/*",
+        "??36-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?36-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2696,7 +3262,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard37-tmp",
     out: ["art-run-test-target-data-shard37.zip"],
-    srcs: ["?37-*/**/*", "??37-*/**/*"],
+    srcs: [
+        "?37-*/**/*",
+        "??37-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?37-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2712,7 +3282,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard38-tmp",
     out: ["art-run-test-target-data-shard38.zip"],
-    srcs: ["?38-*/**/*", "??38-*/**/*"],
+    srcs: [
+        "?38-*/**/*",
+        "??38-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?38-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2728,7 +3302,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard39-tmp",
     out: ["art-run-test-target-data-shard39.zip"],
-    srcs: ["?39-*/**/*", "??39-*/**/*"],
+    srcs: [
+        "?39-*/**/*",
+        "??39-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?39-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2744,7 +3322,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard40-tmp",
     out: ["art-run-test-target-data-shard40.zip"],
-    srcs: ["?40-*/**/*", "??40-*/**/*"],
+    srcs: [
+        "?40-*/**/*",
+        "??40-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?40-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2760,7 +3342,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard41-tmp",
     out: ["art-run-test-target-data-shard41.zip"],
-    srcs: ["?41-*/**/*", "??41-*/**/*"],
+    srcs: [
+        "?41-*/**/*",
+        "??41-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?41-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2776,7 +3362,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard42-tmp",
     out: ["art-run-test-target-data-shard42.zip"],
-    srcs: ["?42-*/**/*", "??42-*/**/*"],
+    srcs: [
+        "?42-*/**/*",
+        "??42-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?42-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2792,7 +3382,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard43-tmp",
     out: ["art-run-test-target-data-shard43.zip"],
-    srcs: ["?43-*/**/*", "??43-*/**/*"],
+    srcs: [
+        "?43-*/**/*",
+        "??43-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?43-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2808,7 +3402,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard44-tmp",
     out: ["art-run-test-target-data-shard44.zip"],
-    srcs: ["?44-*/**/*", "??44-*/**/*"],
+    srcs: [
+        "?44-*/**/*",
+        "??44-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?44-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2824,7 +3422,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard45-tmp",
     out: ["art-run-test-target-data-shard45.zip"],
-    srcs: ["?45-*/**/*", "??45-*/**/*"],
+    srcs: [
+        "?45-*/**/*",
+        "??45-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?45-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2840,7 +3442,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard46-tmp",
     out: ["art-run-test-target-data-shard46.zip"],
-    srcs: ["?46-*/**/*", "??46-*/**/*"],
+    srcs: [
+        "?46-*/**/*",
+        "??46-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?46-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2856,7 +3462,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard47-tmp",
     out: ["art-run-test-target-data-shard47.zip"],
-    srcs: ["?47-*/**/*", "??47-*/**/*"],
+    srcs: [
+        "?47-*/**/*",
+        "??47-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?47-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2872,7 +3482,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard48-tmp",
     out: ["art-run-test-target-data-shard48.zip"],
-    srcs: ["?48-*/**/*", "??48-*/**/*"],
+    srcs: [
+        "?48-*/**/*",
+        "??48-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?48-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2888,7 +3502,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard49-tmp",
     out: ["art-run-test-target-data-shard49.zip"],
-    srcs: ["?49-*/**/*", "??49-*/**/*"],
+    srcs: [
+        "?49-*/**/*",
+        "??49-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?49-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2904,7 +3522,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard50-tmp",
     out: ["art-run-test-target-data-shard50.zip"],
-    srcs: ["?50-*/**/*", "??50-*/**/*"],
+    srcs: [
+        "?50-*/**/*",
+        "??50-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?50-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2920,7 +3542,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard51-tmp",
     out: ["art-run-test-target-data-shard51.zip"],
-    srcs: ["?51-*/**/*", "??51-*/**/*"],
+    srcs: [
+        "?51-*/**/*",
+        "??51-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?51-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2936,7 +3562,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard52-tmp",
     out: ["art-run-test-target-data-shard52.zip"],
-    srcs: ["?52-*/**/*", "??52-*/**/*"],
+    srcs: [
+        "?52-*/**/*",
+        "??52-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?52-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2952,7 +3582,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard53-tmp",
     out: ["art-run-test-target-data-shard53.zip"],
-    srcs: ["?53-*/**/*", "??53-*/**/*"],
+    srcs: [
+        "?53-*/**/*",
+        "??53-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?53-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2968,7 +3602,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard54-tmp",
     out: ["art-run-test-target-data-shard54.zip"],
-    srcs: ["?54-*/**/*", "??54-*/**/*"],
+    srcs: [
+        "?54-*/**/*",
+        "??54-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?54-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -2984,7 +3622,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard55-tmp",
     out: ["art-run-test-target-data-shard55.zip"],
-    srcs: ["?55-*/**/*", "??55-*/**/*"],
+    srcs: [
+        "?55-*/**/*",
+        "??55-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?55-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3000,7 +3642,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard56-tmp",
     out: ["art-run-test-target-data-shard56.zip"],
-    srcs: ["?56-*/**/*", "??56-*/**/*"],
+    srcs: [
+        "?56-*/**/*",
+        "??56-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?56-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3016,7 +3662,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard57-tmp",
     out: ["art-run-test-target-data-shard57.zip"],
-    srcs: ["?57-*/**/*", "??57-*/**/*"],
+    srcs: [
+        "?57-*/**/*",
+        "??57-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?57-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3032,7 +3682,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard58-tmp",
     out: ["art-run-test-target-data-shard58.zip"],
-    srcs: ["?58-*/**/*", "??58-*/**/*"],
+    srcs: [
+        "?58-*/**/*",
+        "??58-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?58-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3048,7 +3702,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard59-tmp",
     out: ["art-run-test-target-data-shard59.zip"],
-    srcs: ["?59-*/**/*", "??59-*/**/*"],
+    srcs: [
+        "?59-*/**/*",
+        "??59-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?59-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3064,7 +3722,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard60-tmp",
     out: ["art-run-test-target-data-shard60.zip"],
-    srcs: ["?60-*/**/*", "??60-*/**/*"],
+    srcs: [
+        "?60-*/**/*",
+        "??60-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?60-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3080,7 +3742,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard61-tmp",
     out: ["art-run-test-target-data-shard61.zip"],
-    srcs: ["?61-*/**/*", "??61-*/**/*"],
+    srcs: [
+        "?61-*/**/*",
+        "??61-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?61-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3096,7 +3762,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard62-tmp",
     out: ["art-run-test-target-data-shard62.zip"],
-    srcs: ["?62-*/**/*", "??62-*/**/*"],
+    srcs: [
+        "?62-*/**/*",
+        "??62-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?62-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3112,7 +3782,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard63-tmp",
     out: ["art-run-test-target-data-shard63.zip"],
-    srcs: ["?63-*/**/*", "??63-*/**/*"],
+    srcs: [
+        "?63-*/**/*",
+        "??63-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?63-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3128,7 +3802,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard64-tmp",
     out: ["art-run-test-target-data-shard64.zip"],
-    srcs: ["?64-*/**/*", "??64-*/**/*"],
+    srcs: [
+        "?64-*/**/*",
+        "??64-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?64-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3144,7 +3822,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard65-tmp",
     out: ["art-run-test-target-data-shard65.zip"],
-    srcs: ["?65-*/**/*", "??65-*/**/*"],
+    srcs: [
+        "?65-*/**/*",
+        "??65-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?65-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3160,7 +3842,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard66-tmp",
     out: ["art-run-test-target-data-shard66.zip"],
-    srcs: ["?66-*/**/*", "??66-*/**/*"],
+    srcs: [
+        "?66-*/**/*",
+        "??66-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?66-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3176,7 +3862,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard67-tmp",
     out: ["art-run-test-target-data-shard67.zip"],
-    srcs: ["?67-*/**/*", "??67-*/**/*"],
+    srcs: [
+        "?67-*/**/*",
+        "??67-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?67-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3192,7 +3882,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard68-tmp",
     out: ["art-run-test-target-data-shard68.zip"],
-    srcs: ["?68-*/**/*", "??68-*/**/*"],
+    srcs: [
+        "?68-*/**/*",
+        "??68-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?68-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3208,7 +3902,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard69-tmp",
     out: ["art-run-test-target-data-shard69.zip"],
-    srcs: ["?69-*/**/*", "??69-*/**/*"],
+    srcs: [
+        "?69-*/**/*",
+        "??69-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?69-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3224,7 +3922,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard70-tmp",
     out: ["art-run-test-target-data-shard70.zip"],
-    srcs: ["?70-*/**/*", "??70-*/**/*"],
+    srcs: [
+        "?70-*/**/*",
+        "??70-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?70-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3240,7 +3942,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard71-tmp",
     out: ["art-run-test-target-data-shard71.zip"],
-    srcs: ["?71-*/**/*", "??71-*/**/*"],
+    srcs: [
+        "?71-*/**/*",
+        "??71-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?71-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3256,7 +3962,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard72-tmp",
     out: ["art-run-test-target-data-shard72.zip"],
-    srcs: ["?72-*/**/*", "??72-*/**/*"],
+    srcs: [
+        "?72-*/**/*",
+        "??72-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?72-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3272,7 +3982,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard73-tmp",
     out: ["art-run-test-target-data-shard73.zip"],
-    srcs: ["?73-*/**/*", "??73-*/**/*"],
+    srcs: [
+        "?73-*/**/*",
+        "??73-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?73-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3288,7 +4002,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard74-tmp",
     out: ["art-run-test-target-data-shard74.zip"],
-    srcs: ["?74-*/**/*", "??74-*/**/*"],
+    srcs: [
+        "?74-*/**/*",
+        "??74-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?74-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3304,7 +4022,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard75-tmp",
     out: ["art-run-test-target-data-shard75.zip"],
-    srcs: ["?75-*/**/*", "??75-*/**/*"],
+    srcs: [
+        "?75-*/**/*",
+        "??75-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?75-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3320,7 +4042,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard76-tmp",
     out: ["art-run-test-target-data-shard76.zip"],
-    srcs: ["?76-*/**/*", "??76-*/**/*"],
+    srcs: [
+        "?76-*/**/*",
+        "??76-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?76-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3336,7 +4062,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard77-tmp",
     out: ["art-run-test-target-data-shard77.zip"],
-    srcs: ["?77-*/**/*", "??77-*/**/*"],
+    srcs: [
+        "?77-*/**/*",
+        "??77-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?77-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3352,7 +4082,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard78-tmp",
     out: ["art-run-test-target-data-shard78.zip"],
-    srcs: ["?78-*/**/*", "??78-*/**/*"],
+    srcs: [
+        "?78-*/**/*",
+        "??78-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?78-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3368,7 +4102,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard79-tmp",
     out: ["art-run-test-target-data-shard79.zip"],
-    srcs: ["?79-*/**/*", "??79-*/**/*"],
+    srcs: [
+        "?79-*/**/*",
+        "??79-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?79-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3384,7 +4122,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard80-tmp",
     out: ["art-run-test-target-data-shard80.zip"],
-    srcs: ["?80-*/**/*", "??80-*/**/*"],
+    srcs: [
+        "?80-*/**/*",
+        "??80-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?80-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3400,7 +4142,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard81-tmp",
     out: ["art-run-test-target-data-shard81.zip"],
-    srcs: ["?81-*/**/*", "??81-*/**/*"],
+    srcs: [
+        "?81-*/**/*",
+        "??81-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?81-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3416,7 +4162,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard82-tmp",
     out: ["art-run-test-target-data-shard82.zip"],
-    srcs: ["?82-*/**/*", "??82-*/**/*"],
+    srcs: [
+        "?82-*/**/*",
+        "??82-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?82-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3432,7 +4182,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard83-tmp",
     out: ["art-run-test-target-data-shard83.zip"],
-    srcs: ["?83-*/**/*", "??83-*/**/*"],
+    srcs: [
+        "?83-*/**/*",
+        "??83-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?83-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3448,7 +4202,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard84-tmp",
     out: ["art-run-test-target-data-shard84.zip"],
-    srcs: ["?84-*/**/*", "??84-*/**/*"],
+    srcs: [
+        "?84-*/**/*",
+        "??84-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?84-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3464,7 +4222,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard85-tmp",
     out: ["art-run-test-target-data-shard85.zip"],
-    srcs: ["?85-*/**/*", "??85-*/**/*"],
+    srcs: [
+        "?85-*/**/*",
+        "??85-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?85-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3480,7 +4242,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard86-tmp",
     out: ["art-run-test-target-data-shard86.zip"],
-    srcs: ["?86-*/**/*", "??86-*/**/*"],
+    srcs: [
+        "?86-*/**/*",
+        "??86-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?86-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3496,7 +4262,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard87-tmp",
     out: ["art-run-test-target-data-shard87.zip"],
-    srcs: ["?87-*/**/*", "??87-*/**/*"],
+    srcs: [
+        "?87-*/**/*",
+        "??87-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?87-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3512,7 +4282,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard88-tmp",
     out: ["art-run-test-target-data-shard88.zip"],
-    srcs: ["?88-*/**/*", "??88-*/**/*"],
+    srcs: [
+        "?88-*/**/*",
+        "??88-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?88-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3528,7 +4302,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard89-tmp",
     out: ["art-run-test-target-data-shard89.zip"],
-    srcs: ["?89-*/**/*", "??89-*/**/*"],
+    srcs: [
+        "?89-*/**/*",
+        "??89-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?89-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3544,7 +4322,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard90-tmp",
     out: ["art-run-test-target-data-shard90.zip"],
-    srcs: ["?90-*/**/*", "??90-*/**/*"],
+    srcs: [
+        "?90-*/**/*",
+        "??90-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?90-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3560,7 +4342,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard91-tmp",
     out: ["art-run-test-target-data-shard91.zip"],
-    srcs: ["?91-*/**/*", "??91-*/**/*"],
+    srcs: [
+        "?91-*/**/*",
+        "??91-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?91-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3576,7 +4362,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard92-tmp",
     out: ["art-run-test-target-data-shard92.zip"],
-    srcs: ["?92-*/**/*", "??92-*/**/*"],
+    srcs: [
+        "?92-*/**/*",
+        "??92-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?92-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3592,7 +4382,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard93-tmp",
     out: ["art-run-test-target-data-shard93.zip"],
-    srcs: ["?93-*/**/*", "??93-*/**/*"],
+    srcs: [
+        "?93-*/**/*",
+        "??93-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?93-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3608,7 +4402,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard94-tmp",
     out: ["art-run-test-target-data-shard94.zip"],
-    srcs: ["?94-*/**/*", "??94-*/**/*"],
+    srcs: [
+        "?94-*/**/*",
+        "??94-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?94-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3624,7 +4422,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard95-tmp",
     out: ["art-run-test-target-data-shard95.zip"],
-    srcs: ["?95-*/**/*", "??95-*/**/*"],
+    srcs: [
+        "?95-*/**/*",
+        "??95-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?95-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3640,7 +4442,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard96-tmp",
     out: ["art-run-test-target-data-shard96.zip"],
-    srcs: ["?96-*/**/*", "??96-*/**/*"],
+    srcs: [
+        "?96-*/**/*",
+        "??96-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?96-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3656,7 +4462,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard97-tmp",
     out: ["art-run-test-target-data-shard97.zip"],
-    srcs: ["?97-*/**/*", "??97-*/**/*"],
+    srcs: [
+        "?97-*/**/*",
+        "??97-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?97-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3672,7 +4482,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard98-tmp",
     out: ["art-run-test-target-data-shard98.zip"],
-    srcs: ["?98-*/**/*", "??98-*/**/*"],
+    srcs: [
+        "?98-*/**/*",
+        "??98-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?98-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3688,7 +4502,11 @@
 java_genrule {
     name: "art-run-test-target-data-shard99-tmp",
     out: ["art-run-test-target-data-shard99.zip"],
-    srcs: ["?99-*/**/*", "??99-*/**/*"],
+    srcs: [
+        "?99-*/**/*",
+        "??99-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode target --test-dir-regex 'art/test/..?99-' $(in)",
     defaults: ["art-run-test-target-data-defaults"],
 }
 
@@ -3704,18 +4522,13 @@
 java_genrule {
     name: "art-run-test-target-data-shardHiddenApi-tmp",
     out: ["art-run-test-target-data-shardHiddenApi.zip"],
-    srcs: ["???-*hiddenapi*/**/*", "????-*hiddenapi*/**/*"],
+    srcs: [
+        "???-*hiddenapi*/**/*",
+        "????-*hiddenapi*/**/*",
+    ],
     defaults: ["art-run-test-target-data-defaults"],
     tools: ["hiddenapi"],
-    cmd: "$(location run_test_build.py) --out $(out) --mode target " +
-         "--bootclasspath $(location :art-run-test-bootclasspath) " +
-         "--d8 $(location d8) " +
-         "--hiddenapi $(location hiddenapi) " +
-         "--jasmin $(location jasmin) " +
-         "--smali $(location smali) " +
-         "--soong_zip $(location soong_zip) " +
-         "--zipalign $(location zipalign) " +
-         "$(in)",
+    cmd: TEST_BUILD_COMMON_ARGS + "--hiddenapi $(location hiddenapi) --mode target --test-dir-regex 'art/test/....?-[^/]*hiddenapi' $(in)",
 }
 
 // Install in the output directory to make it accessible for tests.
@@ -3738,21 +4551,31 @@
         "run_test_build.py",
         ":art-run-test-bootclasspath",
     ],
+    srcs: [
+        // Since genrules are sandboxed, all the sources they use must be listed in
+        // the Android.bp file. Some tests have symlinks to files from other tests, and
+        // those must also be listed to avoid a dangling symlink in the sandbox.
+        "jvmti-common/*.java",
+        "utils/python/**/*.py",
+        ":development_docs",
+        ":asm-9.2-filegroup",
+        ":ojluni-AbstractCollection",
+        "988-method-trace/expected-stdout.txt",
+        "988-method-trace/expected-stderr.txt",
+        "988-method-trace/src/art/Test988Intrinsics.java",
+        "988-method-trace/src/art/Test988.java",
+        "988-method-trace/trace_fib.cc",
+        "1953-pop-frame/src/art/Test1953.java",
+        "1953-pop-frame/src/art/SuspendEvents.java",
+    ],
     tools: [
+        "android-smali",
         "d8",
         "jasmin",
-        "smali",
+        "rewrapper",
         "soong_zip",
         "zipalign",
     ],
-    cmd: "$(location run_test_build.py) --out $(out) --mode target " +
-         "--bootclasspath $(location :art-run-test-bootclasspath) " +
-         "--d8 $(location d8) " +
-         "--jasmin $(location jasmin) " +
-         "--smali $(location smali) " +
-         "--soong_zip $(location soong_zip) " +
-         "--zipalign $(location zipalign) " +
-         "$(in)",
 }
 
 java_genrule {
@@ -3981,7 +4804,11 @@
 // Phony target used to build all shards
 java_genrule {
     name: "art-run-test-target-data-tmp",
-    defaults: ["art-run-test-data-defaults"],
+    defaults: [
+        // Enable only in source builds, where com.android.art.testing is
+        // available.
+        "art_module_source_build_genrule_defaults",
+    ],
     out: ["art-run-test-target-data.txt"],
     srcs: [
         ":art-run-test-target-data-shard00-tmp",
@@ -4204,7 +5031,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard00-tmp",
     out: ["art-run-test-jvm-data-shard00.zip"],
-    srcs: ["?00-*/**/*", "??00-*/**/*"],
+    srcs: [
+        "?00-*/**/*",
+        "??00-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?00-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4220,7 +5051,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard01-tmp",
     out: ["art-run-test-jvm-data-shard01.zip"],
-    srcs: ["?01-*/**/*", "??01-*/**/*"],
+    srcs: [
+        "?01-*/**/*",
+        "??01-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?01-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4236,7 +5071,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard02-tmp",
     out: ["art-run-test-jvm-data-shard02.zip"],
-    srcs: ["?02-*/**/*", "??02-*/**/*"],
+    srcs: [
+        "?02-*/**/*",
+        "??02-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?02-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4252,7 +5091,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard03-tmp",
     out: ["art-run-test-jvm-data-shard03.zip"],
-    srcs: ["?03-*/**/*", "??03-*/**/*"],
+    srcs: [
+        "?03-*/**/*",
+        "??03-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?03-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4268,7 +5111,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard04-tmp",
     out: ["art-run-test-jvm-data-shard04.zip"],
-    srcs: ["?04-*/**/*", "??04-*/**/*"],
+    srcs: [
+        "?04-*/**/*",
+        "??04-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?04-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4284,7 +5131,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard05-tmp",
     out: ["art-run-test-jvm-data-shard05.zip"],
-    srcs: ["?05-*/**/*", "??05-*/**/*"],
+    srcs: [
+        "?05-*/**/*",
+        "??05-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?05-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4300,7 +5151,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard06-tmp",
     out: ["art-run-test-jvm-data-shard06.zip"],
-    srcs: ["?06-*/**/*", "??06-*/**/*"],
+    srcs: [
+        "?06-*/**/*",
+        "??06-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?06-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4316,7 +5171,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard07-tmp",
     out: ["art-run-test-jvm-data-shard07.zip"],
-    srcs: ["?07-*/**/*", "??07-*/**/*"],
+    srcs: [
+        "?07-*/**/*",
+        "??07-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?07-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4332,7 +5191,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard08-tmp",
     out: ["art-run-test-jvm-data-shard08.zip"],
-    srcs: ["?08-*/**/*", "??08-*/**/*"],
+    srcs: [
+        "?08-*/**/*",
+        "??08-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?08-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4348,7 +5211,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard09-tmp",
     out: ["art-run-test-jvm-data-shard09.zip"],
-    srcs: ["?09-*/**/*", "??09-*/**/*"],
+    srcs: [
+        "?09-*/**/*",
+        "??09-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?09-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4364,7 +5231,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard10-tmp",
     out: ["art-run-test-jvm-data-shard10.zip"],
-    srcs: ["?10-*/**/*", "??10-*/**/*"],
+    srcs: [
+        "?10-*/**/*",
+        "??10-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?10-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4380,7 +5251,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard11-tmp",
     out: ["art-run-test-jvm-data-shard11.zip"],
-    srcs: ["?11-*/**/*", "??11-*/**/*"],
+    srcs: [
+        "?11-*/**/*",
+        "??11-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?11-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4396,7 +5271,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard12-tmp",
     out: ["art-run-test-jvm-data-shard12.zip"],
-    srcs: ["?12-*/**/*", "??12-*/**/*"],
+    srcs: [
+        "?12-*/**/*",
+        "??12-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?12-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4412,7 +5291,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard13-tmp",
     out: ["art-run-test-jvm-data-shard13.zip"],
-    srcs: ["?13-*/**/*", "??13-*/**/*"],
+    srcs: [
+        "?13-*/**/*",
+        "??13-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?13-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4428,7 +5311,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard14-tmp",
     out: ["art-run-test-jvm-data-shard14.zip"],
-    srcs: ["?14-*/**/*", "??14-*/**/*"],
+    srcs: [
+        "?14-*/**/*",
+        "??14-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?14-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4444,7 +5331,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard15-tmp",
     out: ["art-run-test-jvm-data-shard15.zip"],
-    srcs: ["?15-*/**/*", "??15-*/**/*"],
+    srcs: [
+        "?15-*/**/*",
+        "??15-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?15-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4460,7 +5351,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard16-tmp",
     out: ["art-run-test-jvm-data-shard16.zip"],
-    srcs: ["?16-*/**/*", "??16-*/**/*"],
+    srcs: [
+        "?16-*/**/*",
+        "??16-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?16-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4476,7 +5371,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard17-tmp",
     out: ["art-run-test-jvm-data-shard17.zip"],
-    srcs: ["?17-*/**/*", "??17-*/**/*"],
+    srcs: [
+        "?17-*/**/*",
+        "??17-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?17-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4492,7 +5391,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard18-tmp",
     out: ["art-run-test-jvm-data-shard18.zip"],
-    srcs: ["?18-*/**/*", "??18-*/**/*"],
+    srcs: [
+        "?18-*/**/*",
+        "??18-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?18-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4508,7 +5411,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard19-tmp",
     out: ["art-run-test-jvm-data-shard19.zip"],
-    srcs: ["?19-*/**/*", "??19-*/**/*"],
+    srcs: [
+        "?19-*/**/*",
+        "??19-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?19-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4524,7 +5431,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard20-tmp",
     out: ["art-run-test-jvm-data-shard20.zip"],
-    srcs: ["?20-*/**/*", "??20-*/**/*"],
+    srcs: [
+        "?20-*/**/*",
+        "??20-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?20-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4540,7 +5451,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard21-tmp",
     out: ["art-run-test-jvm-data-shard21.zip"],
-    srcs: ["?21-*/**/*", "??21-*/**/*"],
+    srcs: [
+        "?21-*/**/*",
+        "??21-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?21-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4556,7 +5471,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard22-tmp",
     out: ["art-run-test-jvm-data-shard22.zip"],
-    srcs: ["?22-*/**/*", "??22-*/**/*"],
+    srcs: [
+        "?22-*/**/*",
+        "??22-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?22-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4572,7 +5491,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard23-tmp",
     out: ["art-run-test-jvm-data-shard23.zip"],
-    srcs: ["?23-*/**/*", "??23-*/**/*"],
+    srcs: [
+        "?23-*/**/*",
+        "??23-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?23-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4588,7 +5511,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard24-tmp",
     out: ["art-run-test-jvm-data-shard24.zip"],
-    srcs: ["?24-*/**/*", "??24-*/**/*"],
+    srcs: [
+        "?24-*/**/*",
+        "??24-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?24-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4604,7 +5531,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard25-tmp",
     out: ["art-run-test-jvm-data-shard25.zip"],
-    srcs: ["?25-*/**/*", "??25-*/**/*"],
+    srcs: [
+        "?25-*/**/*",
+        "??25-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?25-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4620,7 +5551,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard26-tmp",
     out: ["art-run-test-jvm-data-shard26.zip"],
-    srcs: ["?26-*/**/*", "??26-*/**/*"],
+    srcs: [
+        "?26-*/**/*",
+        "??26-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?26-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4636,7 +5571,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard27-tmp",
     out: ["art-run-test-jvm-data-shard27.zip"],
-    srcs: ["?27-*/**/*", "??27-*/**/*"],
+    srcs: [
+        "?27-*/**/*",
+        "??27-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?27-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4652,7 +5591,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard28-tmp",
     out: ["art-run-test-jvm-data-shard28.zip"],
-    srcs: ["?28-*/**/*", "??28-*/**/*"],
+    srcs: [
+        "?28-*/**/*",
+        "??28-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?28-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4668,7 +5611,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard29-tmp",
     out: ["art-run-test-jvm-data-shard29.zip"],
-    srcs: ["?29-*/**/*", "??29-*/**/*"],
+    srcs: [
+        "?29-*/**/*",
+        "??29-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?29-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4684,7 +5631,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard30-tmp",
     out: ["art-run-test-jvm-data-shard30.zip"],
-    srcs: ["?30-*/**/*", "??30-*/**/*"],
+    srcs: [
+        "?30-*/**/*",
+        "??30-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?30-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4700,7 +5651,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard31-tmp",
     out: ["art-run-test-jvm-data-shard31.zip"],
-    srcs: ["?31-*/**/*", "??31-*/**/*"],
+    srcs: [
+        "?31-*/**/*",
+        "??31-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?31-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4716,7 +5671,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard32-tmp",
     out: ["art-run-test-jvm-data-shard32.zip"],
-    srcs: ["?32-*/**/*", "??32-*/**/*"],
+    srcs: [
+        "?32-*/**/*",
+        "??32-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?32-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4732,7 +5691,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard33-tmp",
     out: ["art-run-test-jvm-data-shard33.zip"],
-    srcs: ["?33-*/**/*", "??33-*/**/*"],
+    srcs: [
+        "?33-*/**/*",
+        "??33-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?33-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4748,7 +5711,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard34-tmp",
     out: ["art-run-test-jvm-data-shard34.zip"],
-    srcs: ["?34-*/**/*", "??34-*/**/*"],
+    srcs: [
+        "?34-*/**/*",
+        "??34-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?34-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4764,7 +5731,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard35-tmp",
     out: ["art-run-test-jvm-data-shard35.zip"],
-    srcs: ["?35-*/**/*", "??35-*/**/*"],
+    srcs: [
+        "?35-*/**/*",
+        "??35-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?35-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4780,7 +5751,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard36-tmp",
     out: ["art-run-test-jvm-data-shard36.zip"],
-    srcs: ["?36-*/**/*", "??36-*/**/*"],
+    srcs: [
+        "?36-*/**/*",
+        "??36-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?36-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4796,7 +5771,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard37-tmp",
     out: ["art-run-test-jvm-data-shard37.zip"],
-    srcs: ["?37-*/**/*", "??37-*/**/*"],
+    srcs: [
+        "?37-*/**/*",
+        "??37-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?37-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4812,7 +5791,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard38-tmp",
     out: ["art-run-test-jvm-data-shard38.zip"],
-    srcs: ["?38-*/**/*", "??38-*/**/*"],
+    srcs: [
+        "?38-*/**/*",
+        "??38-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?38-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4828,7 +5811,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard39-tmp",
     out: ["art-run-test-jvm-data-shard39.zip"],
-    srcs: ["?39-*/**/*", "??39-*/**/*"],
+    srcs: [
+        "?39-*/**/*",
+        "??39-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?39-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4844,7 +5831,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard40-tmp",
     out: ["art-run-test-jvm-data-shard40.zip"],
-    srcs: ["?40-*/**/*", "??40-*/**/*"],
+    srcs: [
+        "?40-*/**/*",
+        "??40-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?40-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4860,7 +5851,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard41-tmp",
     out: ["art-run-test-jvm-data-shard41.zip"],
-    srcs: ["?41-*/**/*", "??41-*/**/*"],
+    srcs: [
+        "?41-*/**/*",
+        "??41-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?41-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4876,7 +5871,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard42-tmp",
     out: ["art-run-test-jvm-data-shard42.zip"],
-    srcs: ["?42-*/**/*", "??42-*/**/*"],
+    srcs: [
+        "?42-*/**/*",
+        "??42-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?42-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4892,7 +5891,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard43-tmp",
     out: ["art-run-test-jvm-data-shard43.zip"],
-    srcs: ["?43-*/**/*", "??43-*/**/*"],
+    srcs: [
+        "?43-*/**/*",
+        "??43-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?43-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4908,7 +5911,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard44-tmp",
     out: ["art-run-test-jvm-data-shard44.zip"],
-    srcs: ["?44-*/**/*", "??44-*/**/*"],
+    srcs: [
+        "?44-*/**/*",
+        "??44-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?44-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4924,7 +5931,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard45-tmp",
     out: ["art-run-test-jvm-data-shard45.zip"],
-    srcs: ["?45-*/**/*", "??45-*/**/*"],
+    srcs: [
+        "?45-*/**/*",
+        "??45-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?45-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4940,7 +5951,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard46-tmp",
     out: ["art-run-test-jvm-data-shard46.zip"],
-    srcs: ["?46-*/**/*", "??46-*/**/*"],
+    srcs: [
+        "?46-*/**/*",
+        "??46-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?46-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4956,7 +5971,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard47-tmp",
     out: ["art-run-test-jvm-data-shard47.zip"],
-    srcs: ["?47-*/**/*", "??47-*/**/*"],
+    srcs: [
+        "?47-*/**/*",
+        "??47-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?47-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4972,7 +5991,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard48-tmp",
     out: ["art-run-test-jvm-data-shard48.zip"],
-    srcs: ["?48-*/**/*", "??48-*/**/*"],
+    srcs: [
+        "?48-*/**/*",
+        "??48-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?48-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -4988,7 +6011,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard49-tmp",
     out: ["art-run-test-jvm-data-shard49.zip"],
-    srcs: ["?49-*/**/*", "??49-*/**/*"],
+    srcs: [
+        "?49-*/**/*",
+        "??49-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?49-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5004,7 +6031,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard50-tmp",
     out: ["art-run-test-jvm-data-shard50.zip"],
-    srcs: ["?50-*/**/*", "??50-*/**/*"],
+    srcs: [
+        "?50-*/**/*",
+        "??50-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?50-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5020,7 +6051,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard51-tmp",
     out: ["art-run-test-jvm-data-shard51.zip"],
-    srcs: ["?51-*/**/*", "??51-*/**/*"],
+    srcs: [
+        "?51-*/**/*",
+        "??51-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?51-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5036,7 +6071,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard52-tmp",
     out: ["art-run-test-jvm-data-shard52.zip"],
-    srcs: ["?52-*/**/*", "??52-*/**/*"],
+    srcs: [
+        "?52-*/**/*",
+        "??52-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?52-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5052,7 +6091,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard53-tmp",
     out: ["art-run-test-jvm-data-shard53.zip"],
-    srcs: ["?53-*/**/*", "??53-*/**/*"],
+    srcs: [
+        "?53-*/**/*",
+        "??53-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?53-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5068,7 +6111,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard54-tmp",
     out: ["art-run-test-jvm-data-shard54.zip"],
-    srcs: ["?54-*/**/*", "??54-*/**/*"],
+    srcs: [
+        "?54-*/**/*",
+        "??54-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?54-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5084,7 +6131,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard55-tmp",
     out: ["art-run-test-jvm-data-shard55.zip"],
-    srcs: ["?55-*/**/*", "??55-*/**/*"],
+    srcs: [
+        "?55-*/**/*",
+        "??55-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?55-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5100,7 +6151,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard56-tmp",
     out: ["art-run-test-jvm-data-shard56.zip"],
-    srcs: ["?56-*/**/*", "??56-*/**/*"],
+    srcs: [
+        "?56-*/**/*",
+        "??56-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?56-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5116,7 +6171,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard57-tmp",
     out: ["art-run-test-jvm-data-shard57.zip"],
-    srcs: ["?57-*/**/*", "??57-*/**/*"],
+    srcs: [
+        "?57-*/**/*",
+        "??57-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?57-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5132,7 +6191,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard58-tmp",
     out: ["art-run-test-jvm-data-shard58.zip"],
-    srcs: ["?58-*/**/*", "??58-*/**/*"],
+    srcs: [
+        "?58-*/**/*",
+        "??58-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?58-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5148,7 +6211,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard59-tmp",
     out: ["art-run-test-jvm-data-shard59.zip"],
-    srcs: ["?59-*/**/*", "??59-*/**/*"],
+    srcs: [
+        "?59-*/**/*",
+        "??59-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?59-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5164,7 +6231,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard60-tmp",
     out: ["art-run-test-jvm-data-shard60.zip"],
-    srcs: ["?60-*/**/*", "??60-*/**/*"],
+    srcs: [
+        "?60-*/**/*",
+        "??60-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?60-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5180,7 +6251,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard61-tmp",
     out: ["art-run-test-jvm-data-shard61.zip"],
-    srcs: ["?61-*/**/*", "??61-*/**/*"],
+    srcs: [
+        "?61-*/**/*",
+        "??61-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?61-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5196,7 +6271,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard62-tmp",
     out: ["art-run-test-jvm-data-shard62.zip"],
-    srcs: ["?62-*/**/*", "??62-*/**/*"],
+    srcs: [
+        "?62-*/**/*",
+        "??62-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?62-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5212,7 +6291,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard63-tmp",
     out: ["art-run-test-jvm-data-shard63.zip"],
-    srcs: ["?63-*/**/*", "??63-*/**/*"],
+    srcs: [
+        "?63-*/**/*",
+        "??63-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?63-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5228,7 +6311,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard64-tmp",
     out: ["art-run-test-jvm-data-shard64.zip"],
-    srcs: ["?64-*/**/*", "??64-*/**/*"],
+    srcs: [
+        "?64-*/**/*",
+        "??64-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?64-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5244,7 +6331,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard65-tmp",
     out: ["art-run-test-jvm-data-shard65.zip"],
-    srcs: ["?65-*/**/*", "??65-*/**/*"],
+    srcs: [
+        "?65-*/**/*",
+        "??65-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?65-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5260,7 +6351,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard66-tmp",
     out: ["art-run-test-jvm-data-shard66.zip"],
-    srcs: ["?66-*/**/*", "??66-*/**/*"],
+    srcs: [
+        "?66-*/**/*",
+        "??66-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?66-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5276,7 +6371,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard67-tmp",
     out: ["art-run-test-jvm-data-shard67.zip"],
-    srcs: ["?67-*/**/*", "??67-*/**/*"],
+    srcs: [
+        "?67-*/**/*",
+        "??67-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?67-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5292,7 +6391,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard68-tmp",
     out: ["art-run-test-jvm-data-shard68.zip"],
-    srcs: ["?68-*/**/*", "??68-*/**/*"],
+    srcs: [
+        "?68-*/**/*",
+        "??68-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?68-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5308,7 +6411,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard69-tmp",
     out: ["art-run-test-jvm-data-shard69.zip"],
-    srcs: ["?69-*/**/*", "??69-*/**/*"],
+    srcs: [
+        "?69-*/**/*",
+        "??69-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?69-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5324,7 +6431,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard70-tmp",
     out: ["art-run-test-jvm-data-shard70.zip"],
-    srcs: ["?70-*/**/*", "??70-*/**/*"],
+    srcs: [
+        "?70-*/**/*",
+        "??70-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?70-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5340,7 +6451,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard71-tmp",
     out: ["art-run-test-jvm-data-shard71.zip"],
-    srcs: ["?71-*/**/*", "??71-*/**/*"],
+    srcs: [
+        "?71-*/**/*",
+        "??71-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?71-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5356,7 +6471,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard72-tmp",
     out: ["art-run-test-jvm-data-shard72.zip"],
-    srcs: ["?72-*/**/*", "??72-*/**/*"],
+    srcs: [
+        "?72-*/**/*",
+        "??72-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?72-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5372,7 +6491,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard73-tmp",
     out: ["art-run-test-jvm-data-shard73.zip"],
-    srcs: ["?73-*/**/*", "??73-*/**/*"],
+    srcs: [
+        "?73-*/**/*",
+        "??73-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?73-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5388,7 +6511,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard74-tmp",
     out: ["art-run-test-jvm-data-shard74.zip"],
-    srcs: ["?74-*/**/*", "??74-*/**/*"],
+    srcs: [
+        "?74-*/**/*",
+        "??74-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?74-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5404,7 +6531,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard75-tmp",
     out: ["art-run-test-jvm-data-shard75.zip"],
-    srcs: ["?75-*/**/*", "??75-*/**/*"],
+    srcs: [
+        "?75-*/**/*",
+        "??75-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?75-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5420,7 +6551,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard76-tmp",
     out: ["art-run-test-jvm-data-shard76.zip"],
-    srcs: ["?76-*/**/*", "??76-*/**/*"],
+    srcs: [
+        "?76-*/**/*",
+        "??76-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?76-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5436,7 +6571,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard77-tmp",
     out: ["art-run-test-jvm-data-shard77.zip"],
-    srcs: ["?77-*/**/*", "??77-*/**/*"],
+    srcs: [
+        "?77-*/**/*",
+        "??77-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?77-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5452,7 +6591,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard78-tmp",
     out: ["art-run-test-jvm-data-shard78.zip"],
-    srcs: ["?78-*/**/*", "??78-*/**/*"],
+    srcs: [
+        "?78-*/**/*",
+        "??78-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?78-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5468,7 +6611,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard79-tmp",
     out: ["art-run-test-jvm-data-shard79.zip"],
-    srcs: ["?79-*/**/*", "??79-*/**/*"],
+    srcs: [
+        "?79-*/**/*",
+        "??79-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?79-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5484,7 +6631,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard80-tmp",
     out: ["art-run-test-jvm-data-shard80.zip"],
-    srcs: ["?80-*/**/*", "??80-*/**/*"],
+    srcs: [
+        "?80-*/**/*",
+        "??80-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?80-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5500,7 +6651,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard81-tmp",
     out: ["art-run-test-jvm-data-shard81.zip"],
-    srcs: ["?81-*/**/*", "??81-*/**/*"],
+    srcs: [
+        "?81-*/**/*",
+        "??81-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?81-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5516,7 +6671,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard82-tmp",
     out: ["art-run-test-jvm-data-shard82.zip"],
-    srcs: ["?82-*/**/*", "??82-*/**/*"],
+    srcs: [
+        "?82-*/**/*",
+        "??82-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?82-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5532,7 +6691,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard83-tmp",
     out: ["art-run-test-jvm-data-shard83.zip"],
-    srcs: ["?83-*/**/*", "??83-*/**/*"],
+    srcs: [
+        "?83-*/**/*",
+        "??83-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?83-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5548,7 +6711,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard84-tmp",
     out: ["art-run-test-jvm-data-shard84.zip"],
-    srcs: ["?84-*/**/*", "??84-*/**/*"],
+    srcs: [
+        "?84-*/**/*",
+        "??84-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?84-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5564,7 +6731,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard85-tmp",
     out: ["art-run-test-jvm-data-shard85.zip"],
-    srcs: ["?85-*/**/*", "??85-*/**/*"],
+    srcs: [
+        "?85-*/**/*",
+        "??85-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?85-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5580,7 +6751,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard86-tmp",
     out: ["art-run-test-jvm-data-shard86.zip"],
-    srcs: ["?86-*/**/*", "??86-*/**/*"],
+    srcs: [
+        "?86-*/**/*",
+        "??86-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?86-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5596,7 +6771,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard87-tmp",
     out: ["art-run-test-jvm-data-shard87.zip"],
-    srcs: ["?87-*/**/*", "??87-*/**/*"],
+    srcs: [
+        "?87-*/**/*",
+        "??87-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?87-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5612,7 +6791,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard88-tmp",
     out: ["art-run-test-jvm-data-shard88.zip"],
-    srcs: ["?88-*/**/*", "??88-*/**/*"],
+    srcs: [
+        "?88-*/**/*",
+        "??88-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?88-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5628,7 +6811,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard89-tmp",
     out: ["art-run-test-jvm-data-shard89.zip"],
-    srcs: ["?89-*/**/*", "??89-*/**/*"],
+    srcs: [
+        "?89-*/**/*",
+        "??89-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?89-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5644,7 +6831,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard90-tmp",
     out: ["art-run-test-jvm-data-shard90.zip"],
-    srcs: ["?90-*/**/*", "??90-*/**/*"],
+    srcs: [
+        "?90-*/**/*",
+        "??90-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?90-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5660,7 +6851,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard91-tmp",
     out: ["art-run-test-jvm-data-shard91.zip"],
-    srcs: ["?91-*/**/*", "??91-*/**/*"],
+    srcs: [
+        "?91-*/**/*",
+        "??91-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?91-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5676,7 +6871,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard92-tmp",
     out: ["art-run-test-jvm-data-shard92.zip"],
-    srcs: ["?92-*/**/*", "??92-*/**/*"],
+    srcs: [
+        "?92-*/**/*",
+        "??92-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?92-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5692,7 +6891,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard93-tmp",
     out: ["art-run-test-jvm-data-shard93.zip"],
-    srcs: ["?93-*/**/*", "??93-*/**/*"],
+    srcs: [
+        "?93-*/**/*",
+        "??93-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?93-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5708,7 +6911,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard94-tmp",
     out: ["art-run-test-jvm-data-shard94.zip"],
-    srcs: ["?94-*/**/*", "??94-*/**/*"],
+    srcs: [
+        "?94-*/**/*",
+        "??94-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?94-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5724,7 +6931,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard95-tmp",
     out: ["art-run-test-jvm-data-shard95.zip"],
-    srcs: ["?95-*/**/*", "??95-*/**/*"],
+    srcs: [
+        "?95-*/**/*",
+        "??95-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?95-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5740,7 +6951,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard96-tmp",
     out: ["art-run-test-jvm-data-shard96.zip"],
-    srcs: ["?96-*/**/*", "??96-*/**/*"],
+    srcs: [
+        "?96-*/**/*",
+        "??96-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?96-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5756,7 +6971,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard97-tmp",
     out: ["art-run-test-jvm-data-shard97.zip"],
-    srcs: ["?97-*/**/*", "??97-*/**/*"],
+    srcs: [
+        "?97-*/**/*",
+        "??97-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?97-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5772,7 +6991,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard98-tmp",
     out: ["art-run-test-jvm-data-shard98.zip"],
-    srcs: ["?98-*/**/*", "??98-*/**/*"],
+    srcs: [
+        "?98-*/**/*",
+        "??98-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?98-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5788,7 +7011,11 @@
 java_genrule {
     name: "art-run-test-jvm-data-shard99-tmp",
     out: ["art-run-test-jvm-data-shard99.zip"],
-    srcs: ["?99-*/**/*", "??99-*/**/*"],
+    srcs: [
+        "?99-*/**/*",
+        "??99-*/**/*",
+    ],
+    cmd: TEST_BUILD_COMMON_ARGS + "--mode jvm --test-dir-regex 'art/test/..?99-' $(in)",
     defaults: ["art-run-test-jvm-data-defaults"],
 }
 
@@ -5804,18 +7031,13 @@
 java_genrule {
     name: "art-run-test-jvm-data-shardHiddenApi-tmp",
     out: ["art-run-test-jvm-data-shardHiddenApi.zip"],
-    srcs: ["???-*hiddenapi*/**/*", "????-*hiddenapi*/**/*"],
+    srcs: [
+        "???-*hiddenapi*/**/*",
+        "????-*hiddenapi*/**/*",
+    ],
     defaults: ["art-run-test-jvm-data-defaults"],
     tools: ["hiddenapi"],
-    cmd: "$(location run_test_build.py) --out $(out) --mode jvm " +
-         "--bootclasspath $(location :art-run-test-bootclasspath) " +
-         "--d8 $(location d8) " +
-         "--hiddenapi $(location hiddenapi) " +
-         "--jasmin $(location jasmin) " +
-         "--smali $(location smali) " +
-         "--soong_zip $(location soong_zip) " +
-         "--zipalign $(location zipalign) " +
-         "$(in)",
+    cmd: TEST_BUILD_COMMON_ARGS + "--hiddenapi $(location hiddenapi) --mode jvm --test-dir-regex 'art/test/....?-[^/]*hiddenapi' $(in)",
 }
 
 // Install in the output directory to make it accessible for tests.
@@ -5838,21 +7060,31 @@
         "run_test_build.py",
         ":art-run-test-bootclasspath",
     ],
+    srcs: [
+        // Since genrules are sandboxed, all the sources they use must be listed in
+        // the Android.bp file. Some tests have symlinks to files from other tests, and
+        // those must also be listed to avoid a dangling symlink in the sandbox.
+        "jvmti-common/*.java",
+        "utils/python/**/*.py",
+        ":development_docs",
+        ":asm-9.2-filegroup",
+        ":ojluni-AbstractCollection",
+        "988-method-trace/expected-stdout.txt",
+        "988-method-trace/expected-stderr.txt",
+        "988-method-trace/src/art/Test988Intrinsics.java",
+        "988-method-trace/src/art/Test988.java",
+        "988-method-trace/trace_fib.cc",
+        "1953-pop-frame/src/art/Test1953.java",
+        "1953-pop-frame/src/art/SuspendEvents.java",
+    ],
     tools: [
+        "android-smali",
         "d8",
         "jasmin",
-        "smali",
+        "rewrapper",
         "soong_zip",
         "zipalign",
     ],
-    cmd: "$(location run_test_build.py) --out $(out) --mode jvm " +
-         "--bootclasspath $(location :art-run-test-bootclasspath) " +
-         "--d8 $(location d8) " +
-         "--jasmin $(location jasmin) " +
-         "--smali $(location smali) " +
-         "--soong_zip $(location soong_zip) " +
-         "--zipalign $(location zipalign) " +
-         "$(in)",
 }
 
 java_genrule {
@@ -6081,7 +7313,11 @@
 // Phony target used to build all shards
 java_genrule {
     name: "art-run-test-jvm-data-tmp",
-    defaults: ["art-run-test-data-defaults"],
+    defaults: [
+        // Enable only in source builds, where com.android.art.testing is
+        // available.
+        "art_module_source_build_genrule_defaults",
+    ],
     out: ["art-run-test-jvm-data.txt"],
     srcs: [
         ":art-run-test-jvm-data-shard00-tmp",
diff --git a/test/Android.run-test.bp.py b/test/Android.run-test.bp.py
index d1e3027..74745b0 100755
--- a/test/Android.run-test.bp.py
+++ b/test/Android.run-test.bp.py
@@ -16,28 +16,45 @@
 
 """ This script generates the Android.run-test.bp build file"""
 
-import os, textwrap
+import glob
+import json
+import os
+import textwrap
+import sys
 
 def main():
-  test_dir = os.path.dirname(__file__)
-  with open(os.path.join(test_dir, "Android.run-test.bp"), mode="wt") as f:
-    f.write(textwrap.dedent("""
-      // This file was generated by {}
+  os.chdir(os.path.dirname(__file__))
+  with open("Android.run-test.bp", mode="wt") as f:
+    f.write(textwrap.dedent(f"""
+      // This file was generated by {os.path.basename(__file__)}
       // It is not necessary to regenerate it when tests are added/removed/modified.
-    """.format(os.path.basename(__file__))).lstrip())
+
+      TEST_BUILD_COMMON_ARGS = "$(location run_test_build.py) --out $(out) " +
+          "--bootclasspath $(location :art-run-test-bootclasspath) " +
+          "--d8 $(location d8) " +
+          "--jasmin $(location jasmin) " +
+          "--rewrapper $(location rewrapper) " +
+          "--smali $(location android-smali) " +
+          "--soong_zip $(location soong_zip) " +
+          "--zipalign $(location zipalign) "
+    """).lstrip())
     for mode in ["host", "target", "jvm"]:
       names = []
       # Group the tests into shards based on the last two digits of the test number.
       # This keeps the number of generated genrules low so we don't overwhelm soong,
       # but it still allows iterating on single test without recompiling all tests.
       for shard in ["{:02}".format(i) for i in range(100)]:
-        name = "art-run-test-{mode}-data-shard{shard}".format(mode=mode, shard=shard)
+        name = f"art-run-test-{mode}-data-shard{shard}"
         names.append(name)
-        f.write(textwrap.dedent("""
+        f.write(textwrap.dedent(f"""
           java_genrule {{
               name: "{name}-tmp",
               out: ["{name}.zip"],
-              srcs: ["?{shard}-*/**/*", "??{shard}-*/**/*"],
+              srcs: [
+                  "?{shard}-*/**/*",
+                  "??{shard}-*/**/*",
+              ],
+              cmd: TEST_BUILD_COMMON_ARGS + "--mode {mode} --test-dir-regex 'art/test/..?{shard}-' $(in)",
               defaults: ["art-run-test-{mode}-data-defaults"],
           }}
 
@@ -49,29 +66,24 @@
               sub_dir: "art",
               filename: "{name}.zip",
           }}
-          """.format(name=name, mode=mode, shard=shard)))
+          """))
 
       # Build all hiddenapi tests in their own shard.
       # This removes the dependency on hiddenapi from all other shards,
       # which in turn removes dependency on ART C++ source code.
       name = "art-run-test-{mode}-data-shardHiddenApi".format(mode=mode)
       names.append(name)
-      f.write(textwrap.dedent("""
+      f.write(textwrap.dedent(f"""
         java_genrule {{
             name: "{name}-tmp",
             out: ["{name}.zip"],
-            srcs: ["???-*hiddenapi*/**/*", "????-*hiddenapi*/**/*"],
+            srcs: [
+                "???-*hiddenapi*/**/*",
+                "????-*hiddenapi*/**/*",
+            ],
             defaults: ["art-run-test-{mode}-data-defaults"],
             tools: ["hiddenapi"],
-            cmd: "$(location run_test_build.py) --out $(out) --mode {mode} " +
-                 "--bootclasspath $(location :art-run-test-bootclasspath) " +
-                 "--d8 $(location d8) " +
-                 "--hiddenapi $(location hiddenapi) " +
-                 "--jasmin $(location jasmin) " +
-                 "--smali $(location smali) " +
-                 "--soong_zip $(location soong_zip) " +
-                 "--zipalign $(location zipalign) " +
-                 "$(in)",
+            cmd: TEST_BUILD_COMMON_ARGS + "--hiddenapi $(location hiddenapi) --mode {mode} --test-dir-regex 'art/test/....?-[^/]*hiddenapi' $(in)",
         }}
 
         // Install in the output directory to make it accessible for tests.
@@ -82,9 +94,9 @@
             sub_dir: "art",
             filename: "{name}.zip",
         }}
-        """.format(name=name, mode=mode)))
+        """))
 
-      f.write(textwrap.dedent("""
+      f.write(textwrap.dedent(f"""
         genrule_defaults {{
             name: "art-run-test-{mode}-data-defaults",
             defaults: [
@@ -96,28 +108,38 @@
                 "run_test_build.py",
                 ":art-run-test-bootclasspath",
             ],
+            srcs: [
+                // Since genrules are sandboxed, all the sources they use must be listed in
+                // the Android.bp file. Some tests have symlinks to files from other tests, and
+                // those must also be listed to avoid a dangling symlink in the sandbox.
+                "jvmti-common/*.java",
+                "utils/python/**/*.py",
+                ":development_docs",
+                ":asm-9.2-filegroup",
+                ":ojluni-AbstractCollection",
+                "988-method-trace/expected-stdout.txt",
+                "988-method-trace/expected-stderr.txt",
+                "988-method-trace/src/art/Test988Intrinsics.java",
+                "988-method-trace/src/art/Test988.java",
+                "988-method-trace/trace_fib.cc",
+                "1953-pop-frame/src/art/Test1953.java",
+                "1953-pop-frame/src/art/SuspendEvents.java",
+            ],
             tools: [
+                "android-smali",
                 "d8",
                 "jasmin",
-                "smali",
+                "rewrapper",
                 "soong_zip",
                 "zipalign",
             ],
-            cmd: "$(location run_test_build.py) --out $(out) --mode {mode} " +
-                 "--bootclasspath $(location :art-run-test-bootclasspath) " +
-                 "--d8 $(location d8) " +
-                 "--jasmin $(location jasmin) " +
-                 "--smali $(location smali) " +
-                 "--soong_zip $(location soong_zip) " +
-                 "--zipalign $(location zipalign) " +
-                 "$(in)",
         }}
-        """).format(mode=mode))
+        """))
 
       name = "art-run-test-{mode}-data-merged".format(mode=mode)
-      srcs = ("\n"+" "*8).join('":{}-tmp",'.format(n) for n in names)
-      deps = ("\n"+" "*8).join('"{}",'.format(n) for n in names)
-      f.write(textwrap.dedent("""
+      srcs = ("\n"+" "*16).join('":{}-tmp",'.format(n) for n in names)
+      deps = ("\n"+" "*16).join('"{}",'.format(n) for n in names)
+      f.write(textwrap.dedent(f"""
         java_genrule {{
             name: "{name}-tmp",
             defaults: ["art_module_source_build_genrule_defaults"],
@@ -140,16 +162,20 @@
             sub_dir: "art",
             filename: "{name}.zip",
         }}
-        """).format(name=name, srcs=srcs, deps=deps))
+        """))
 
       name = "art-run-test-{mode}-data".format(mode=mode)
-      srcs = ("\n"+" "*8).join('":{}-tmp",'.format(n) for n in names)
-      deps = ("\n"+" "*8).join('"{}",'.format(n) for n in names)
-      f.write(textwrap.dedent("""
+      srcs = ("\n"+" "*16).join('":{}-tmp",'.format(n) for n in names)
+      deps = ("\n"+" "*16).join('"{}",'.format(n) for n in names)
+      f.write(textwrap.dedent(f"""
         // Phony target used to build all shards
         java_genrule {{
             name: "{name}-tmp",
-            defaults: ["art-run-test-data-defaults"],
+            defaults: [
+                // Enable only in source builds, where com.android.art.testing is
+                // available.
+                "art_module_source_build_genrule_defaults",
+            ],
             out: ["{name}.txt"],
             srcs: [
                 {srcs}
@@ -168,7 +194,7 @@
             sub_dir: "art",
             filename: "{name}.txt",
         }}
-        """).format(name=name, srcs=srcs, deps=deps))
+        """))
 
 if __name__ == "__main__":
   main()
diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk
index 9dec0c5..42ce1a4 100644
--- a/test/Android.run-test.mk
+++ b/test/Android.run-test.mk
@@ -22,7 +22,7 @@
   $(HOST_OUT_EXECUTABLES)/d8 \
   $(HOST_OUT_EXECUTABLES)/hiddenapi \
   $(HOST_OUT_EXECUTABLES)/jasmin \
-  $(HOST_OUT_EXECUTABLES)/smali
+  $(HOST_OUT_EXECUTABLES)/android-smali
 
 # We need the ART Testing APEX (which is a superset of the Release
 # and Debug APEXes) -- which contains dex2oat, dalvikvm, their
diff --git a/test/MultiDex/Second.java b/test/MultiDex/Second.java
index 5067bcc..ec8849a 100644
--- a/test/MultiDex/Second.java
+++ b/test/MultiDex/Second.java
@@ -16,12 +16,6 @@
 
 class Second {
   public String getSecond() {
-    return "I Second That.";
-  }
-
-  // This method makes sure the second dex file has quickening
-  // instructions.
-  public String callSecond() {
-    return getSecond();
+    return "Original";
   }
 }
diff --git a/test/MultiDexModifiedSecondary/Second.java b/test/MultiDexModifiedSecondary/Second.java
index 3555a7f..08ad625 100644
--- a/test/MultiDexModifiedSecondary/Second.java
+++ b/test/MultiDexModifiedSecondary/Second.java
@@ -15,11 +15,7 @@
  */
 
 class Second {
-  public String getThird() {
-    return "I Third That.";
-  }
-
   public String getSecond() {
-    return "I Second That.";
+    return "Modified";  // Must have the same length as original so that dex size is same.
   }
 }
diff --git a/test/OWNERS b/test/OWNERS
index 7d11748..2e4627e 100644
--- a/test/OWNERS
+++ b/test/OWNERS
@@ -1,3 +1,4 @@
+# Bug component: 86431
 # See also ART owners in the parent directory.
 rpl@google.com
 dsrbecky@google.com
diff --git a/test/README.chroot.md b/test/README.chroot.md
index ce4670a..a46d317 100644
--- a/test/README.chroot.md
+++ b/test/README.chroot.md
@@ -53,33 +53,36 @@
         1. Initialize the environment:
             ```bash
             export SOONG_ALLOW_MISSING_DEPENDENCIES=true
-            export BUILD_BROKEN_DISABLE_BAZEL=true
             . ./build/envsetup.sh
             ```
         2. Select a lunch target corresponding to the architecture you want to
            build and test:
             * For (32-bit) Arm:
                 ```bash
-                lunch arm_krait-eng
+                lunch arm_krait-trunk_staging-eng
                 ```
             * For (64-bit only) Arm64:
                 ```bash
-                lunch armv8-eng
+                lunch armv8-trunk_staging-eng
                 ```
             * For (32- and 64-bit) Arm64:
                 ```bash
-                lunch arm_v7_v8-eng
+                lunch arm_v7_v8-trunk_staging-eng
                 ```
             * For (32-bit) Intel x86:
                 ```bash
-                lunch silvermont-eng
+                lunch silvermont-trunk_staging-eng
+                ```
+            * For (64-bit) RISC-V:
+                ```bash
+                lunch aosp_riscv64-trunk_staging-eng
                 ```
         3. Set up the environment to use a pre-built ADB:
             ```bash
             export PATH="$(pwd)/prebuilts/runtime:$PATH"
             export ADB="$ANDROID_BUILD_TOP/prebuilts/runtime/adb"
             ```
-    * With a full Android (AOSP) `aosp/master` tree:
+    * With a full Android (AOSP) `aosp/main` tree:
         1. Initialize the environment:
             ```bash
             . ./build/envsetup.sh
@@ -88,19 +91,23 @@
            build and test:
             * For (32-bit) Arm:
                 ```bash
-                lunch aosp_arm-eng
+                lunch aosp_arm-trunk_staging-eng
                 ```
             * For (32- and 64-bit) Arm64:
                 ```bash
-                lunch aosp_arm64-eng
+                lunch aosp_arm64-trunk_staging-eng
                 ```
             * For (32-bit) Intel x86:
                 ```bash
-                lunch aosp_x86-eng
+                lunch aosp_x86-trunk_staging-eng
                 ```
             * For (32- and 64-bit) Intel x86-64:
                 ```bash
-                lunch aosp_x86_64-eng
+                lunch aosp_x86_64-trunk_staging-eng
+                ```
+            * For (64-bit) RISC-V:
+                ```bash
+                lunch aosp_riscv64-trunk_staging-eng
                 ```
         3. Build ADB:
             ```bash
diff --git a/test/README.chroot_vm.md b/test/README.chroot_vm.md
index 2f163de..ed80ec0 100644
--- a/test/README.chroot_vm.md
+++ b/test/README.chroot_vm.md
@@ -47,7 +47,7 @@
 export ART_TEST_ON_VM=true
 
 . ./build/envsetup.sh
-lunch armv8-eng  # or aosp_riscv64-userdebug, etc.
+lunch armv8-trunk_staging-eng  # or aosp_riscv64-trunk_staging-userdebug, etc.
 art/tools/buildbot-build.sh --target # --installclean
 
 art/tools/buildbot-cleanup-device.sh
diff --git a/test/README.md b/test/README.md
index dc9e9b7..2890bb9 100644
--- a/test/README.md
+++ b/test/README.md
@@ -177,7 +177,7 @@
 $ art/test.py --target -r
 ```
 
-## Running one run-test on the build host
+## Building and running one run-test on the build host
 
 ```sh
 $ # Build test files
@@ -192,12 +192,16 @@
 $ art/test.py -b --host -r -t 001-HelloWorld
 ```
 
-## Running one run-test on the target device
+## Building and running one run-test on the target device
 
 ```sh
-$ art/test.py --target -r -t 001-HelloWorld
+$ art/test.py --target -b -r -t 001-HelloWorld
 ```
 
+The `-b` option (re)builds the shard for the given test(s) and pushes it to
+device. However the push may not include all necessary dependencies, e.g. test
+`.so` libraries like `libarttest.so`.
+
 ## Running one gtest on the build host
 
 ```sh
diff --git a/test/art-gtests-target-standalone-cts-template.xml b/test/art-gtests-target-standalone-cts-template.xml
index e862f17..42ad284 100644
--- a/test/art-gtests-target-standalone-cts-template.xml
+++ b/test/art-gtests-target-standalone-cts-template.xml
@@ -20,6 +20,8 @@
     <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
     <option name="config-descriptor:metadata" key="parameter" value="multi_abi" />
     <option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
 
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
         <option name="cleanup" value="true" />
diff --git a/test/art-gtests-target-standalone-root-template.xml b/test/art-gtests-target-standalone-root-template.xml
deleted file mode 100644
index d1a489e..0000000
--- a/test/art-gtests-target-standalone-root-template.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2021 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<!-- Note: This test config file for {MODULE} is generated from a template. -->
-<configuration description="Runs {MODULE} as root.">
-    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
-
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="cleanup" value="true" />
-        <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}/{MODULE}" />
-        <option name="append-bitness" value="true" />
-    </target_preparer>
-
-    <test class="com.android.tradefed.testtype.GTest" >
-        <option name="native-test-device-path" value="/data/local/tmp/{MODULE}" />
-        <option name="module-name" value="{MODULE}" />
-        <option name="ld-library-path-32" value="/apex/com.android.art/lib" />
-        <option name="ld-library-path-64" value="/apex/com.android.art/lib64" />
-    </test>
-
-    <!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
-         one of the Mainline modules below is present on the device used for testing. -->
-    <object type="module_controller" class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController">
-        <!-- ART Mainline Module (internal version). -->
-        <option name="mainline-module-package-name" value="com.google.android.art" />
-        <!-- ART Mainline Module (external (AOSP) version). -->
-        <option name="mainline-module-package-name" value="com.android.art" />
-    </object>
-
-    <!-- Only run tests if the device under test is SDK version 31 (Android 12) or above. -->
-    <object type="module_controller" class="com.android.tradefed.testtype.suite.module.Sdk31ModuleController" />
-</configuration>
diff --git a/test/art-gtests-target-standalone-template.xml b/test/art-gtests-target-standalone-template.xml
index 194c1e3..1c21620 100644
--- a/test/art-gtests-target-standalone-template.xml
+++ b/test/art-gtests-target-standalone-template.xml
@@ -16,6 +16,7 @@
 <!-- Note: This test config file for {MODULE} is generated from a template. -->
 <configuration description="Runs {MODULE}.">
     <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
 
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
         <option name="cleanup" value="true" />
@@ -26,8 +27,6 @@
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp/{MODULE}" />
         <option name="module-name" value="{MODULE}" />
-        <option name="ld-library-path-32" value="/apex/com.android.art/lib" />
-        <option name="ld-library-path-64" value="/apex/com.android.art/lib64" />
     </test>
 
     <!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
diff --git a/test/art-gtests-target-standalone-with-boot-image-template.xml b/test/art-gtests-target-standalone-with-boot-image-template.xml
index f028f2f..7f44ba6 100644
--- a/test/art-gtests-target-standalone-with-boot-image-template.xml
+++ b/test/art-gtests-target-standalone-with-boot-image-template.xml
@@ -15,6 +15,9 @@
 -->
 <!-- Note: This test config file for {MODULE} is generated from a template. -->
 <configuration description="Runs {MODULE}.">
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
+
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
         <option name="cleanup" value="true" />
         <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}/{MODULE}" />
@@ -37,8 +40,6 @@
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp/{MODULE}" />
         <option name="module-name" value="{MODULE}" />
-        <option name="ld-library-path-32" value="/apex/com.android.art/lib" />
-        <option name="ld-library-path-64" value="/apex/com.android.art/lib64" />
     </test>
 
     <!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
diff --git a/test/art-run-test-target-cts-template.xml b/test/art-run-test-target-cts-template.xml
index 4ce885c..1e19069 100644
--- a/test/art-run-test-target-cts-template.xml
+++ b/test/art-run-test-target-cts-template.xml
@@ -17,6 +17,7 @@
 <configuration description="Test module config for {MODULE}">
     <option name="test-suite-tag" value="art-target-run-test" />
     <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
 
     <option name="test-suite-tag" value="cts" />
     <option name="config-descriptor:metadata" key="component" value="art" />
diff --git a/test/art-run-test-target-no-test-suite-tag-template.xml b/test/art-run-test-target-no-test-suite-tag-template.xml
index 0544c97..9a4fc1c 100644
--- a/test/art-run-test-target-no-test-suite-tag-template.xml
+++ b/test/art-run-test-target-no-test-suite-tag-template.xml
@@ -15,6 +15,9 @@
 -->
 <!-- Note: This test config for {MODULE} is generated from a template. -->
 <configuration description="Test module config for {MODULE}">
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
+
     <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
         <option name="cleanup" value="true" />
         <!-- TODO: Use option `push-file` instead of deprecated option
diff --git a/test/art-run-test-target-slow-template.xml b/test/art-run-test-target-slow-template.xml
index e1ec8a0..fa29985 100644
--- a/test/art-run-test-target-slow-template.xml
+++ b/test/art-run-test-target-slow-template.xml
@@ -17,6 +17,7 @@
 <configuration description="Test module config for {MODULE}">
     <option name="test-suite-tag" value="art-target-run-test" />
     <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
 
     <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
         <option name="cleanup" value="true" />
diff --git a/test/art-run-test-target-template.xml b/test/art-run-test-target-template.xml
index af53dfc..1f7ad7a 100644
--- a/test/art-run-test-target-template.xml
+++ b/test/art-run-test-target-template.xml
@@ -17,6 +17,7 @@
 <configuration description="Test module config for {MODULE}">
     <option name="test-suite-tag" value="art-target-run-test" />
     <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
+    <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
 
     <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
         <option name="cleanup" value="true" />
diff --git a/test/common/runtime_state.cc b/test/common/runtime_state.cc
index 46f3828..a385f4c 100644
--- a/test/common/runtime_state.cc
+++ b/test/common/runtime_state.cc
@@ -14,8 +14,6 @@
  * limitations under the License.
  */
 
-#include "jni.h"
-
 #include <android-base/logging.h>
 #include <android-base/macros.h>
 #include <sys/resource.h>
@@ -25,17 +23,22 @@
 #include "base/enums.h"
 #include "common_throws.h"
 #include "dex/dex_file-inl.h"
+#include "dex/dex_file_types.h"
+#include "gc/heap.h"
 #include "instrumentation.h"
 #include "jit/jit.h"
 #include "jit/jit_code_cache.h"
+#include "jit/profile_saver.h"
 #include "jit/profiling_info.h"
+#include "jni.h"
 #include "jni/jni_internal.h"
 #include "mirror/class-inl.h"
 #include "mirror/class.h"
+#include "mirror/executable.h"
 #include "nativehelper/ScopedUtfChars.h"
-#include "oat.h"
-#include "oat_file.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat.h"
+#include "oat/oat_file.h"
+#include "oat/oat_quick_method_header.h"
 #include "profile/profile_compilation_info.h"
 #include "runtime.h"
 #include "scoped_thread_state_change-inl.h"
@@ -51,6 +54,7 @@
   bool can_jit =
       runtime != nullptr
       && runtime->GetJit() != nullptr
+      && runtime->UseJitCompilation()
       && runtime->GetInstrumentation()->GetCurrentInstrumentationLevel() !=
             instrumentation::Instrumentation::InstrumentationLevel::kInstrumentWithInterpreter;
   return can_jit ? runtime->GetJit() : nullptr;
@@ -72,7 +76,7 @@
 }
 
 extern "C" JNIEXPORT jobject JNICALL Java_Main_getCompilerFilter(JNIEnv* env,
-                                                                 jclass caller ATTRIBUTE_UNUSED,
+                                                                 [[maybe_unused]] jclass caller,
                                                                  jclass cls) {
   ScopedObjectAccess soa(env);
 
@@ -91,22 +95,22 @@
 
 // public static native boolean runtimeIsSoftFail();
 
-extern "C" JNIEXPORT jboolean JNICALL Java_Main_runtimeIsSoftFail(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                                  jclass cls ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT jboolean JNICALL Java_Main_runtimeIsSoftFail([[maybe_unused]] JNIEnv* env,
+                                                                  [[maybe_unused]] jclass cls) {
   return Runtime::Current()->IsVerificationSoftFail() ? JNI_TRUE : JNI_FALSE;
 }
 
 // public static native boolean hasImage();
 
-extern "C" JNIEXPORT jboolean JNICALL Java_Main_hasImage(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                         jclass cls ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT jboolean JNICALL Java_Main_hasImage([[maybe_unused]] JNIEnv* env,
+                                                         [[maybe_unused]] jclass cls) {
   return Runtime::Current()->GetHeap()->HasBootImageSpace();
 }
 
 // public static native boolean isImageDex2OatEnabled();
 
-extern "C" JNIEXPORT jboolean JNICALL Java_Main_isImageDex2OatEnabled(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                                      jclass cls ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT jboolean JNICALL Java_Main_isImageDex2OatEnabled([[maybe_unused]] JNIEnv* env,
+                                                                      [[maybe_unused]] jclass cls) {
   return Runtime::Current()->IsImageDex2OatEnabled();
 }
 
@@ -269,14 +273,21 @@
   // Update the code cache to make sure the JIT code does not get deleted.
   // Note: this will apply to all JIT compilations.
   code_cache->SetGarbageCollectCode(false);
+  if (jit->JitAtFirstUse()) {
+    ScopedObjectAccess soa(self);
+    jit->CompileMethod(method, self, kind, /*prejit=*/ false);
+  } else if (kind == CompilationKind::kBaseline || jit->GetJitCompiler()->IsBaselineCompiler()) {
+    ScopedObjectAccess soa(self);
+    if (jit->TryPatternMatch(method, CompilationKind::kBaseline)) {
+      return;
+    }
+    jit->MaybeEnqueueCompilation(method, self);
+  } else {
+    jit->EnqueueOptimizedCompilation(method, self);
+  }
   do {
     // Sleep to yield to the compiler thread.
     usleep(1000);
-    ScopedObjectAccess soa(self);
-    // Will either ensure it's compiled or do the compilation itself. We do
-    // this before checking if we will execute JIT code in case the request
-    // is for an 'optimized' compilation.
-    jit->CompileMethod(method, self, kind, /*prejit=*/ false);
     const void* entry_point = method->GetEntryPointFromQuickCompiledCode();
     if (code_cache->ContainsPc(entry_point)) {
       // If we're running baseline or not requesting optimized, we're good to go.
@@ -398,7 +409,7 @@
   std::set<std::string> unused_locations;
   unused_locations.insert("fake_location");
   ScopedObjectAccess soa(Thread::Current());
-  code_cache->GetProfiledMethods(unused_locations, unused_vector);
+  code_cache->GetProfiledMethods(unused_locations, unused_vector, /*inline_cache_threshold=*/0);
 }
 
 extern "C" JNIEXPORT void JNICALL Java_Main_waitForCompilation(JNIEnv*, jclass) {
@@ -453,14 +464,14 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_Main_forceInterpreterOnThread(JNIEnv* env,
-                                                                     jclass cls ATTRIBUTE_UNUSED) {
+                                                                     [[maybe_unused]] jclass cls) {
   ScopedObjectAccess soa(env);
   MutexLock thread_list_mu(soa.Self(), *Locks::thread_list_lock_);
   soa.Self()->IncrementForceInterpreterCount();
 }
 
-extern "C" JNIEXPORT void JNICALL Java_Main_setAsyncExceptionsThrown(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                                     jclass cls ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT void JNICALL Java_Main_setAsyncExceptionsThrown([[maybe_unused]] JNIEnv* env,
+                                                                     [[maybe_unused]] jclass cls) {
   Runtime::Current()->SetAsyncExceptionsThrown();
 }
 
@@ -469,4 +480,127 @@
   setrlimit(RLIMIT_NOFILE, &limit);
 }
 
+extern "C" JNIEXPORT jboolean JNICALL Java_Main_isInImageSpace(JNIEnv* env,
+                                                               [[maybe_unused]] jclass caller,
+                                                               jclass cls) {
+  ScopedObjectAccess soa(env);
+
+  ObjPtr<mirror::Class> klass = soa.Decode<mirror::Class>(cls);
+  gc::space::Space* space =
+      Runtime::Current()->GetHeap()->FindSpaceFromObject(klass, /*fail_ok=*/true);
+  if (space == nullptr) {
+    return JNI_FALSE;
+  }
+  return space->IsImageSpace() ? JNI_TRUE : JNI_FALSE;
+}
+
+// Ensures the profile saver does its usual processing.
+extern "C" JNIEXPORT void JNICALL Java_Main_ensureProfileProcessing(JNIEnv*, jclass) {
+  ProfileSaver::ForceProcessProfiles();
+}
+
+extern "C" JNIEXPORT jboolean JNICALL Java_Main_isForBootImage(JNIEnv* env,
+                                                               jclass,
+                                                               jstring filename) {
+  ScopedUtfChars filename_chars(env, filename);
+  CHECK(filename_chars.c_str() != nullptr);
+
+  ProfileCompilationInfo info(/*for_boot_image=*/true);
+  bool result = info.Load(std::string(filename_chars.c_str()), /*clear_if_invalid=*/false);
+  return result ? JNI_TRUE : JNI_FALSE;
+}
+
+static ProfileCompilationInfo::MethodHotness GetMethodHotnessFromProfile(JNIEnv* env,
+                                                                         jclass c,
+                                                                         jstring filename,
+                                                                         jobject method) {
+  bool for_boot_image = Java_Main_isForBootImage(env, c, filename) == JNI_TRUE;
+  ScopedUtfChars filename_chars(env, filename);
+  CHECK(filename_chars.c_str() != nullptr);
+  ScopedObjectAccess soa(env);
+  ObjPtr<mirror::Executable> exec = soa.Decode<mirror::Executable>(method);
+  ArtMethod* art_method = exec->GetArtMethod();
+  MethodReference ref(art_method->GetDexFile(), art_method->GetDexMethodIndex());
+
+  ProfileCompilationInfo info(Runtime::Current()->GetArenaPool(), for_boot_image);
+  if (!info.Load(filename_chars.c_str(), /*clear_if_invalid=*/false)) {
+    LOG(ERROR) << "Failed to load profile from " << filename;
+    return ProfileCompilationInfo::MethodHotness();
+  }
+  return info.GetMethodHotness(ref);
+}
+
+// Checks if the method is present in the profile.
+extern "C" JNIEXPORT jboolean JNICALL Java_Main_presentInProfile(JNIEnv* env,
+                                                                 jclass c,
+                                                                 jstring filename,
+                                                                 jobject method) {
+  // TODO: Why do we check `hotness.IsHot()` instead of `hotness.IsInProfile()`
+  // in a method named `presentInProfile()`?
+  return GetMethodHotnessFromProfile(env, c, filename, method).IsHot() ? JNI_TRUE : JNI_FALSE;
+}
+
+// Checks if the method has an inline cache in the profile that contains at least the given target
+// types.
+extern "C" JNIEXPORT jboolean JNICALL Java_Main_hasInlineCacheInProfile(
+    JNIEnv* env, jclass c, jstring filename, jobject method, jobjectArray target_types) {
+  ProfileCompilationInfo::MethodHotness hotness =
+      GetMethodHotnessFromProfile(env, c, filename, method);
+  if (hotness.GetInlineCacheMap() == nullptr) {
+    return JNI_FALSE;
+  }
+  ScopedObjectAccess soa(env);
+  ObjPtr<mirror::ObjectArray<mirror::Class>> types =
+      soa.Decode<mirror::ObjectArray<mirror::Class>>(target_types);
+  for (const auto& [dex_pc, dex_pc_data] : *hotness.GetInlineCacheMap()) {
+    bool match = true;
+    for (ObjPtr<mirror::Class> type : *types.Ptr()) {
+      dex::TypeIndex expected_index = type->GetDexTypeIndex();
+      if (!expected_index.IsValid()) {
+        return JNI_FALSE;
+      }
+      if (dex_pc_data.classes.find(expected_index) == dex_pc_data.classes.end()) {
+        match = false;
+        break;
+      }
+    }
+    if (match) {
+      return JNI_TRUE;
+    }
+  }
+  return JNI_FALSE;
+}
+
+extern "C" JNIEXPORT jint JNICALL Java_Main_getCurrentGcNum(JNIEnv* env, jclass) {
+  // Prevent any new GC before getting the current GC num.
+  ScopedObjectAccess soa(env);
+  gc::Heap* heap = Runtime::Current()->GetHeap();
+  heap->WaitForGcToComplete(gc::kGcCauseJitCodeCache, Thread::Current());
+  return heap->GetCurrentGcNum();
+}
+
+extern "C" JNIEXPORT jboolean Java_Main_removeJitCompiledMethod(JNIEnv* env,
+                                                                jclass,
+                                                                jobject java_method,
+                                                                jboolean release_memory) {
+  if (!Runtime::Current()->UseJitCompilation()) {
+    return JNI_FALSE;
+  }
+
+  jit::Jit* jit = Runtime::Current()->GetJit();
+  jit->WaitForCompilationToFinish(Thread::Current());
+
+  ScopedObjectAccess soa(env);
+  ArtMethod* method = ArtMethod::FromReflectedMethod(soa, java_method);
+
+  jit::JitCodeCache* code_cache = jit->GetCodeCache();
+
+  // Drop the shared mutator lock.
+  ScopedThreadSuspension self_suspension(Thread::Current(), art::ThreadState::kNative);
+  // Get exclusive mutator lock with suspend all.
+  ScopedSuspendAll suspend("Removing JIT compiled method", /*long_suspend=*/true);
+  bool removed = code_cache->RemoveMethod(method, static_cast<bool>(release_memory));
+  return removed ? JNI_TRUE : JNI_FALSE;
+}
+
 }  // namespace art
diff --git a/test/common/stack_inspect.cc b/test/common/stack_inspect.cc
index 33f31e2..8be3550 100644
--- a/test/common/stack_inspect.cc
+++ b/test/common/stack_inspect.cc
@@ -24,8 +24,8 @@
 #include "jni/jni_internal.h"
 #include "mirror/class-inl.h"
 #include "nth_caller_visitor.h"
-#include "oat_file.h"
-#include "oat_quick_method_header.h"
+#include "oat/oat_file.h"
+#include "oat/oat_quick_method_header.h"
 #include "runtime.h"
 #include "scoped_thread_state_change-inl.h"
 #include "stack.h"
@@ -38,8 +38,8 @@
 // public static native void disableStackFrameAsserts();
 // Note: to globally disable asserts in unsupported configurations.
 
-extern "C" JNIEXPORT void JNICALL Java_Main_disableStackFrameAsserts(JNIEnv* env ATTRIBUTE_UNUSED,
-                                                                     jclass cls ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT void JNICALL Java_Main_disableStackFrameAsserts([[maybe_unused]] JNIEnv* env,
+                                                                     [[maybe_unused]] jclass cls) {
   asserts_enabled = false;
 }
 
@@ -82,6 +82,8 @@
   StackVisitor::WalkStack(
       [&](const art::StackVisitor* stack_visitor) REQUIRES_SHARED(Locks::mutator_lock_) {
         if (goal == stack_visitor->GetMethod()) {
+          // We don't deoptimize beyond a runtime frame. So if we need the method to be
+          // deoptimizeable we cannot allow the previous frame to be a runtime frame.
           *method_is_interpreted =
               (require_deoptable && prev_was_runtime) || stack_visitor->IsShadowFrame();
           method_found = true;
@@ -98,7 +100,7 @@
 
 // TODO Remove 'require_deoptimizable' option once we have deoptimization through runtime frames.
 extern "C" JNIEXPORT jboolean JNICALL Java_Main_isInterpretedFunction(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method, jboolean require_deoptimizable) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject method, jboolean require_deoptimizable) {
   // Return false if this seems to not be an ART runtime.
   if (Runtime::Current() == nullptr) {
     return JNI_FALSE;
@@ -185,7 +187,7 @@
 }
 
 extern "C" JNIEXPORT jobject JNICALL Java_Main_getThisOfCaller(
-    JNIEnv* env, jclass cls ATTRIBUTE_UNUSED) {
+    JNIEnv* env, [[maybe_unused]] jclass cls) {
   ScopedObjectAccess soa(env);
   std::unique_ptr<art::Context> context(art::Context::Create());
   jobject result = nullptr;
diff --git a/test/csuite-app-compile-launch.xml b/test/csuite-app-compile-launch.xml
index 4ff7098..7e124f9 100644
--- a/test/csuite-app-compile-launch.xml
+++ b/test/csuite-app-compile-launch.xml
@@ -14,22 +14,16 @@
      limitations under the License.
 -->
 <configuration description="Compiles, launches an app, and checks for crashes">
-    <option name="package-name" value="{package}"/>
-    <target_preparer class="com.android.compatibility.targetprep.AppSetupPreparer">
-        <option name="test-file-name" value="app://{package}"/>
-    </target_preparer>
     <target_preparer class="com.android.compatibility.targetprep.CheckGmsPreparer"/>
     <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
-        <!-- We will fail if any command in RunCommandTargetPreparer fails.
-            This is useful to know if we failed to compile a package. -->
-        <option name="throw-if-cmd-fail" value="true"/>
-        <option name="run-command" value="cmd package compile -m speed {package}"/>
         <option name="run-command" value="input keyevent KEYCODE_WAKEUP"/>
         <option name="run-command" value="input keyevent KEYCODE_MENU"/>
         <option name="run-command" value="input keyevent KEYCODE_HOME"/>
     </target_preparer>
     <test class="com.android.tradefed.testtype.HostTest" >
         <option name="set-option" value="package-name:{package}"/>
-        <option name="class" value="com.android.csuite.tests.AppLaunchTest" />
+        <option name="set-option" value="install-apk:app\://{package}"/>
+        <option name="set-option" value="install-arg:-g"/>
+        <option name="class" value="com.android.art.tests.AppCompileLaunchTest" />
     </test>
-</configuration>
\ No newline at end of file
+</configuration>
diff --git a/test/default_run.py b/test/default_run.py
index e3e5d21..5ae0430 100755
--- a/test/default_run.py
+++ b/test/default_run.py
@@ -65,7 +65,7 @@
   argp.add_argument("--gdb", action="store_true")
   argp.add_argument("--gdb-arg", default=[], action="append")
   argp.add_argument("--gdb-dex2oat", action="store_true")
-  argp.add_argument("--gdb-dex2oat-args", default=[], action="append")
+  argp.add_argument("--gdb-dex2oat-args")
   argp.add_argument("--gdbserver", action="store_true")
   argp.add_argument("--gdbserver-bin")
   argp.add_argument("--gdbserver-port", default=":5039")
@@ -73,6 +73,7 @@
   argp.add_argument("--image", default=True, action=opt_bool)
   argp.add_argument("--instruction-set-features", default="")
   argp.add_argument("--interpreter", action="store_true")
+  argp.add_argument("--switch-interpreter", action="store_true")
   argp.add_argument("--invoke-with", default=[], action="append")
   argp.add_argument("--jit", action="store_true")
   argp.add_argument("--jvm", action="store_true")
@@ -88,9 +89,7 @@
   argp.add_argument("--random-profile", action="store_true")
   argp.add_argument("--relocate", default=False, action=opt_bool)
   argp.add_argument("--runtime-dm", action="store_true")
-  argp.add_argument("--runtime-extracted-zipapex", default="")
   argp.add_argument("--runtime-option", default=[], action="append")
-  argp.add_argument("--runtime-zipapex", default="")
   argp.add_argument("--secondary", action="store_true")
   argp.add_argument("--secondary-app-image", default=True, action=opt_bool)
   argp.add_argument("--secondary-class-loader-context", default="")
@@ -237,7 +236,6 @@
   PATH = os.environ.get("PATH", "")
   SANITIZE_HOST = os.environ.get("SANITIZE_HOST", "")
   TEST_NAME = os.environ["TEST_NAME"]
-  USE_EXRACTED_ZIPAPEX = os.environ.get("USE_EXRACTED_ZIPAPEX", "")
 
   assert ANDROID_BUILD_TOP, "Did you forget to run `lunch`?"
 
@@ -265,19 +263,15 @@
   ANDROID_FLAGS = ""
   GDB = ""
   GDB_ARGS = ""
-  GDB_DEX2OAT = ""
-  GDB_DEX2OAT_ARGS = ""
+  GDB_DEX2OAT_EXTRA_ARGS = ""
   GDBSERVER_DEVICE = "gdbserver"
   GDBSERVER_HOST = "gdbserver"
   HAVE_IMAGE = args.image
   HOST = args.host
   BIONIC = args.bionic
   CREATE_ANDROID_ROOT = False
-  USE_ZIPAPEX = (args.runtime_zipapex != "")
-  ZIPAPEX_LOC = args.runtime_zipapex
-  USE_EXTRACTED_ZIPAPEX = (args.runtime_extracted_zipapex != "")
-  EXTRACTED_ZIPAPEX_LOC = args.runtime_extracted_zipapex
   INTERPRETER = args.interpreter
+  SWITCH_INTERPRETER = args.switch_interpreter
   JIT = args.jit
   INVOKE_WITH = " ".join(args.invoke_with)
   USE_JVMTI = args.jvmti
@@ -403,12 +397,6 @@
     # the frameworks/libcore with linux_bionic so we need to use the normal
     # host ones which are in a different location.
     CREATE_ANDROID_ROOT = True
-  if USE_ZIPAPEX:
-    # TODO (b/119942078): Currently apex does not support
-    # symlink_preferred_arch so we will not have a dex2oatd to execute and
-    # need to manually provide
-    # dex2oatd64.
-    DEX2OAT_DEBUG_BINARY = "dex2oatd64"
   if WITH_AGENT:
     USE_JVMTI = True
   if DEBUGGER_AGENT:
@@ -428,8 +416,8 @@
   for arg in args.gdb_arg:
     GDB_ARGS += f" {arg}"
   if args.gdb_dex2oat_args:
-    for arg in arg.split(";"):
-      GDB_DEX2OAT_ARGS += f"{arg} "
+    for arg in args.gdb_dex2oat_args.split(";"):
+      GDB_DEX2OAT_EXTRA_ARGS += f'"{arg}" '
   if args.zygote:
     ZYGOTE = "-Xzygote"
     print("Spawning from zygote")
@@ -654,17 +642,22 @@
       GDB = f"{GDBSERVER_DEVICE} --no-startup-with-shell 127.0.0.1{GDBSERVER_PORT}"
     else:
       GDB = "gdb"
-      GDB_ARGS += f" --args {DALVIKVM}"
+      GDB_ARGS += f" -d '{ANDROID_BUILD_TOP}' --args {DALVIKVM}"
+
+  if SWITCH_INTERPRETER:
+    # run on the slow switch-interpreter enabled with -Xint
+    INT_OPTS += " -Xint"
 
   if INTERPRETER:
-    INT_OPTS += " -Xint"
+    # run on Nterp the fast interpreter, not the slow switch-interpreter enabled with -Xint
+    INT_OPTS += " -Xusejit:false"
 
   if JIT:
     INT_OPTS += " -Xusejit:true"
   else:
     INT_OPTS += " -Xusejit:false"
 
-  if INTERPRETER or JIT:
+  if INTERPRETER or SWITCH_INTERPRETER or JIT:
     if VERIFY == "y":
       INT_OPTS += " -Xcompiler-option --compiler-filter=verify"
       COMPILE_FLAGS += " --compiler-filter=verify"
@@ -732,9 +725,6 @@
   sync_cmdline = "true"
   linkroot_cmdline = "true"
   linkroot_overlay_cmdline = "true"
-  setupapex_cmdline = "true"
-  installapex_cmdline = "true"
-  installapex_test_cmdline = "true"
 
   def linkdirs(host_out: str, root: str):
     dirs = list(filter(os.path.isdir, glob.glob(os.path.join(host_out, "*"))))
@@ -752,20 +742,6 @@
     # Replace the boot image to a location expected by the runtime.
     DALVIKVM_BOOT_OPT = f"-Ximage:{ANDROID_ROOT}/art_boot_images/javalib/boot.art"
 
-  if USE_ZIPAPEX:
-    # TODO Currently this only works for linux_bionic zipapexes because those are
-    # stripped and so small enough that the ulimit doesn't kill us.
-    mkdir_locations += f" {DEX_LOCATION}/zipapex"
-    setupapex_cmdline = f"unzip -o -u {ZIPAPEX_LOC} apex_payload.zip -d {DEX_LOCATION}"
-    installapex_cmdline = f"unzip -o -u {DEX_LOCATION}/apex_payload.zip -d {DEX_LOCATION}/zipapex"
-    ANDROID_ART_BIN_DIR = f"{DEX_LOCATION}/zipapex/bin"
-  elif USE_EXTRACTED_ZIPAPEX:
-    # Just symlink the zipapex binaries
-    ANDROID_ART_BIN_DIR = f"{DEX_LOCATION}/zipapex/bin"
-    # Force since some tests manually run this file twice.
-    # If the {RUN} is executed multiple times we don't need to recreate the link
-    installapex_cmdline = f"ln -sfTv {EXTRACTED_ZIPAPEX_LOC} {DEX_LOCATION}/zipapex"
-
   # PROFILE takes precedence over RANDOM_PROFILE, since PROFILE tests require a
   # specific profile to run properly.
   if PROFILE or RANDOM_PROFILE:
@@ -788,44 +764,6 @@
       profman_cmdline = f"{profman_cmdline} --generate-test-profile={DEX_LOCATION}/{TEST_NAME}.prof \
           --generate-test-profile-seed=0"
 
-  def get_prebuilt_lldb_path():
-    CLANG_BASE = "prebuilts/clang/host"
-    CLANG_VERSION = check_output(
-        f"{ANDROID_BUILD_TOP}/build/soong/scripts/get_clang_version.py"
-    ).strip()
-    uname = check_output("uname -s", shell=True).strip()
-    if uname == "Darwin":
-      PREBUILT_NAME = "darwin-x86"
-    elif uname == "Linux":
-      PREBUILT_NAME = "linux-x86"
-    else:
-      print(
-          "Unknown host $(uname -s). Unsupported for debugging dex2oat with LLDB.",
-          file=sys.stderr)
-      return
-    CLANG_PREBUILT_HOST_PATH = f"{ANDROID_BUILD_TOP}/{CLANG_BASE}/{PREBUILT_NAME}/{CLANG_VERSION}"
-    # If the clang prebuilt directory exists and the reported clang version
-    # string does not, then it is likely that the clang version reported by the
-    # get_clang_version.py script does not match the expected directory name.
-    if isdir(f"{ANDROID_BUILD_TOP}/{CLANG_BASE}/{PREBUILT_NAME}"):
-      assert isdir(CLANG_PREBUILT_HOST_PATH), (
-          "The prebuilt clang directory exists, but the specific "
-          "clang\nversion reported by get_clang_version.py does not exist in "
-          "that path.\nPlease make sure that the reported clang version "
-          "resides in the\nprebuilt clang directory!")
-
-    # The lldb-server binary is a dependency of lldb.
-    os.environ[
-        "LLDB_DEBUGSERVER_PATH"] = f"{CLANG_PREBUILT_HOST_PATH}/runtimes_ndk_cxx/x86_64/lldb-server"
-
-    # Set the current terminfo directory to TERMINFO so that LLDB can read the
-    # termcap database.
-    terminfo = re.search("/.*/terminfo/", check_output("infocmp"))
-    if terminfo:
-      os.environ["TERMINFO"] = terminfo[0]
-
-    return f"{CLANG_PREBUILT_HOST_PATH}/bin/lldb.sh"
-
   def write_dex2oat_cmdlines(name: str):
     nonlocal dex2oat_cmdline, dm_cmdline, vdex_cmdline
 
@@ -854,18 +792,18 @@
     if enable_app_image:
       app_image = f"--app-image-file={DEX_LOCATION}/oat/{ISA}/{name}.art --resolve-startup-const-strings=true"
 
-    nonlocal GDB_DEX2OAT, GDB_DEX2OAT_ARGS
-    if USE_GDB_DEX2OAT:
-      prebuilt_lldb_path = get_prebuilt_lldb_path()
-      GDB_DEX2OAT = f"{prebuilt_lldb_path} -f"
-      GDB_DEX2OAT_ARGS += " -- "
-
     dex2oat_binary = DEX2OAT_DEBUG_BINARY
     if TEST_IS_NDEBUG:
       dex2oat_binary = DEX2OAT_NDEBUG_BINARY
-    dex2oat_cmdline = f"{INVOKE_WITH} {GDB_DEX2OAT} \
-                        {ANDROID_ART_BIN_DIR}/{dex2oat_binary} \
-                        {GDB_DEX2OAT_ARGS} \
+
+    dex2oat_cmdline = f"{INVOKE_WITH} "
+
+    if USE_GDB_DEX2OAT:
+      nonlocal GDB_DEX2OAT_EXTRA_ARGS
+      dex2oat_cmdline += f"gdb {GDB_DEX2OAT_EXTRA_ARGS} \
+                          -d '{ANDROID_BUILD_TOP}' --args "
+
+    dex2oat_cmdline += f"'{ANDROID_ART_BIN_DIR}/{dex2oat_binary}' \
                         {COMPILE_FLAGS} \
                         --boot-image={BOOT_IMAGE} \
                         --dex-file={DEX_LOCATION}/{name}.jar \
@@ -1021,11 +959,12 @@
     #     In particular, unhandled exception is printed using several unterminated printfs.
     ALL_LOG_TAGS = ["V", "D", "I", "W", "E", "F", "S"]
     skip_tag_set = "|".join(ALL_LOG_TAGS[:ALL_LOG_TAGS.index(args.diff_min_log_tag.upper())])
-    skip_reg_exp = fr'[[:alnum:]]+ ({skip_tag_set}) #-# #:#:# [^\n]*\n'.replace('#', '[0-9]+')
+    skip_reg_exp = fr'#-# #:#:# # # ({skip_tag_set}) [^\n]*\n'
+    skip_reg_exp = skip_reg_exp.replace('#', '[0-9.]+').replace(' ', ' +')
     ctx.run(fr"sed -i -z -E 's/{skip_reg_exp}//g' '{args.stderr_file}'")
     if not HAVE_IMAGE:
       message = "(Unable to open file|Could not create image space)"
-      ctx.run(fr"sed -i -E '/^dalvikvm(|32|64) E .* {message}/d' '{args.stderr_file}'")
+      ctx.run(fr"sed -i -E '/^.* E dalvikvm(|32|64): .* {message}/d' '{args.stderr_file}'")
     if ANDROID_LOG_TAGS != "*:i" and "D" in skip_tag_set:
       ctx.run(fr"sed -i -E '/^(Time zone|I18n) APEX ICU file found/d' '{args.stderr_file}'")
     if ON_VM:
@@ -1125,11 +1064,7 @@
 
   else:
     # Host run.
-    if USE_ZIPAPEX or USE_EXRACTED_ZIPAPEX:
-      # Put the zipapex files in front of the ld-library-path
-      LD_LIBRARY_PATH = f"{ANDROID_DATA}/zipapex/{LIBRARY_DIRECTORY}:{ANDROID_ROOT}/{TEST_DIRECTORY}"
-    else:
-      LD_LIBRARY_PATH = f"{ANDROID_ROOT}/{LIBRARY_DIRECTORY}:{ANDROID_ROOT}/{TEST_DIRECTORY}"
+    LD_LIBRARY_PATH = f"{ANDROID_ROOT}/{LIBRARY_DIRECTORY}:{ANDROID_ROOT}/{TEST_DIRECTORY}"
 
     ctx.export(
       ANDROID_PRINTF_LOG = "brief",
@@ -1183,9 +1118,6 @@
     ctx.run(f"rm -rf {DEX_LOCATION}/{{oat,dalvik-cache}}/")
 
     ctx.run(f"mkdir -p {mkdir_locations}")
-    ctx.run(setupapex_cmdline)
-    if USE_EXTRACTED_ZIPAPEX:
-      ctx.run(installapex_cmdline)
     ctx.run(linkroot_cmdline)
     ctx.run(linkroot_overlay_cmdline)
     ctx.run(profman_cmdline)
diff --git a/test/dexpreopt/art_standalone_dexpreopt_tests.xml b/test/dexpreopt/art_standalone_dexpreopt_tests.xml
index 873b6a2..cf459e6 100644
--- a/test/dexpreopt/art_standalone_dexpreopt_tests.xml
+++ b/test/dexpreopt/art_standalone_dexpreopt_tests.xml
@@ -17,6 +17,13 @@
 <configuration description="Runs {MODULE} as root.">
     <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
 
+    <!-- Wipe /data because this test requires a clean state where no APEX is installed.
+         Warning: This test should not be used in a Mainline context (i.e. when a train update
+         has been installed prior to running this test). -->
+    <target_preparer class="com.android.tradefed.targetprep.DeviceWiper">
+      <option name="mode" value="FACTORY_RESET" />
+    </target_preparer>
+
     <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
 
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
@@ -28,19 +35,8 @@
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp/{MODULE}" />
         <option name="module-name" value="{MODULE}" />
-        <option name="ld-library-path-32" value="/apex/com.android.art/lib" />
-        <option name="ld-library-path-64" value="/apex/com.android.art/lib64" />
     </test>
 
-    <!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
-         one of the Mainline modules below is present on the device used for testing. -->
-    <object type="module_controller" class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController">
-        <!-- ART Mainline Module (internal version). -->
-        <option name="mainline-module-package-name" value="com.google.android.art" />
-        <!-- ART Mainline Module (external (AOSP) version). -->
-        <option name="mainline-module-package-name" value="com.android.art" />
-    </object>
-
     <!-- Only run tests if the device under test is SDK version 31 (Android 12) or above. -->
     <object type="module_controller" class="com.android.tradefed.testtype.suite.module.Sdk31ModuleController" />
 </configuration>
diff --git a/test/dexpreopt/dexpreopt_test.cc b/test/dexpreopt/dexpreopt_test.cc
index eac84f5..c5d3400 100644
--- a/test/dexpreopt/dexpreopt_test.cc
+++ b/test/dexpreopt/dexpreopt_test.cc
@@ -41,7 +41,7 @@
 #include "base/os.h"
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
-#include "oat_file_assistant.h"
+#include "oat/oat_file_assistant.h"
 #include "procinfo/process_map.h"
 
 namespace art {
diff --git a/test/generate-boot-image/Android.bp b/test/generate-boot-image/Android.bp
index e03aade..60aac13 100644
--- a/test/generate-boot-image/Android.bp
+++ b/test/generate-boot-image/Android.bp
@@ -28,7 +28,7 @@
     defaults: [
         "art_defaults",
     ],
-    host_supported: false,
+    host_supported: true,
     compile_multilib: "both",
     multilib: {
         lib32: {
@@ -43,13 +43,14 @@
     ],
     srcs: ["generate-boot-image.cc"],
     shared_libs: [
-        "libbase",
         "liblog",
     ],
     static_libs: [
         "libartbase",
         "libartbase-testing",
+        "libbase",
     ],
+    stl: "c++_static",
     tidy: true,
     tidy_flags: [
         "-format-style=file",
diff --git a/test/generate-boot-image/generate-boot-image.cc b/test/generate-boot-image/generate-boot-image.cc
index 1b3eccf..671aa37 100644
--- a/test/generate-boot-image/generate-boot-image.cc
+++ b/test/generate-boot-image/generate-boot-image.cc
@@ -14,31 +14,91 @@
  * limitations under the License.
  */
 
-/** A commandline tool to generate a primary boot image for testing. */
-
 #include <sys/stat.h>
 #include <sysexits.h>
 
 #include <algorithm>
 #include <cstdlib>
+#include <iostream>
 #include <string>
 #include <vector>
 
+#include "android-base/parsebool.h"
 #include "android-base/stringprintf.h"
 #include "android-base/strings.h"
 #include "arch/instruction_set.h"
 #include "base/file_utils.h"
 #include "base/globals.h"
+#include "base/macros.h"
 #include "base/os.h"
 #include "base/testing.h"
 
 namespace art {
+namespace gbi {
 
 namespace {
 
+using ::android::base::ConsumePrefix;
+using ::android::base::ConsumeSuffix;
 using ::android::base::Join;
+using ::android::base::ParseBool;
+using ::android::base::ParseBoolResult;
 using ::android::base::StringPrintf;
 using ::art::testing::GetLibCoreDexFileNames;
+using ::art::testing::GetLibCoreDexLocations;
+
+constexpr const char* kUsage = R"(
+A commandline tool to generate a primary boot image for testing.
+
+Usage: generate-boot-image --output-dir=OUTPUT_DIR [OPTIONS]...
+
+Supported options:
+  --help: Print this text.
+  --output-dir=OUTPUT_DIR: The directory to output the boot image. Required.
+  --compiler-filter=COMPILER_FILTER: The compiler filter option to pass to dex2oat. Default: verify
+  --use-profile=true|false: If true, use a profile. Default: true
+  --dex2oat-bin=DEX2OAT_BIN: The path to the dex2oat binary. Required when running on host. Default
+      on target: /apex/com.android.art/bin/dex2oat{32,64,32d,64d}
+  --android-root=ANDROID_ROOT: The root directory to search for bootclasspath jars. The file
+      structure under the root must be in the form of:
+      /apex
+        /com.android.art
+          /javalib
+            /core-oj.jar
+            ...
+        /com.android.i18n
+          /javalib
+            ...
+        /com.android.conscrypt
+          /javalib
+            ...
+      Required when running on host. Default on target: /
+  --profile-file=PROFILE_FILE: The path to the profile file. Required when running on host and
+      --use-profile is true. Default on target: /apex/com.android.art/etc/boot-image.prof
+  --instruction-set=ISA: The instruction set option to pass to dex2oat. Required when running on
+      host. The default on target is based on the ISA of this binary.
+  --core-only=true|false: If true, only compile ART jars. Otherwise, also compile core-icu4j and
+      conscrypt. Default: false
+)";
+
+struct Options {
+  std::string output_dir = "";
+  // Set the compiler filter to `verify` by default to make test preparation
+  // faster.
+  std::string compiler_filter = "verify";
+  bool use_profile = true;
+  std::string dex2oat_bin = "";
+  std::string android_root = "";
+  std::string profile_file = "";
+  std::string instruction_set = "";
+  bool core_only = false;
+};
+
+[[noreturn]] void Usage(const std::string& message) {
+  LOG(ERROR) << message << '\n';
+  std::cerr << message << "\n" << kUsage << "\n";
+  exit(EX_USAGE);
+}
 
 std::string GetCompilerExecutable() {
   std::string compiler_executable = GetArtBinDir() + "/dex2oat";
@@ -64,23 +124,30 @@
   return command;
 }
 
-int GenerateBootImage(const std::string& dir, const std::string& compiler_filter) {
-  std::string isa = GetInstructionSetString(kRuntimeISA);
-
+int GenerateBootImage(const Options& options) {
   std::vector<std::string> args;
-  args.push_back(GetCompilerExecutable());
+  args.push_back(options.dex2oat_bin);
 
-  std::vector<std::string> dex_files = GetLibCoreDexFileNames(/*core_only=*/true);
+  std::vector<std::string> dex_files =
+      GetLibCoreDexFileNames(options.android_root, options.core_only);
+  std::vector<std::string> dex_locations = GetLibCoreDexLocations(options.core_only);
   args.push_back("--runtime-arg");
   args.push_back("-Xbootclasspath:" + Join(dex_files, ":"));
+  args.push_back("--runtime-arg");
+  args.push_back("-Xbootclasspath-locations:" + Join(dex_locations, ":"));
   for (const std::string& file : dex_files) {
     args.push_back("--dex-file=" + file);
   }
+  for (const std::string& location : dex_locations) {
+    args.push_back("--dex-location=" + location);
+  }
 
-  args.push_back("--instruction-set=" + isa);
+  args.push_back("--instruction-set=" + options.instruction_set);
   args.push_back(StringPrintf("--base=0x%08x", ART_BASE_ADDRESS));
-  args.push_back("--compiler-filter=" + compiler_filter);
-  args.push_back(StringPrintf("--profile-file=%s/etc/boot-image.prof", GetArtRoot().c_str()));
+  args.push_back("--compiler-filter=" + options.compiler_filter);
+  if (options.use_profile) {
+    args.push_back("--profile-file=" + options.profile_file);
+  }
   args.push_back("--avoid-storing-invocation");
   args.push_back("--generate-debug-info");
   args.push_back("--generate-build-id");
@@ -88,7 +155,7 @@
   args.push_back("--strip");
   args.push_back("--android-root=out/empty");
 
-  std::string path = StringPrintf("%s/%s", dir.c_str(), isa.c_str());
+  std::string path = ART_FORMAT("{}/{}", options.output_dir, options.instruction_set);
   if (!OS::DirectoryExists(path.c_str())) {
     CHECK_EQ(mkdir(path.c_str(), S_IRWXU), 0);
   }
@@ -102,32 +169,85 @@
   return exit_code;
 }
 
-}  // namespace
-}  // namespace art
-
-int main(int argc, char** argv) {
+int Main(int argc, char** argv) {
   android::base::InitLogging(argv, android::base::LogdLogger(android::base::SYSTEM));
 
-  std::string dir = "";
-  // Set the compiler filter to `verify` by default to make test preparation
-  // faster.
-  std::string compiler_filter = "verify";
+  Options options;
   for (int i = 1; i < argc; i++) {
     std::string_view arg{argv[i]};
-    if (android::base::ConsumePrefix(&arg, "--output-dir=")) {
-      dir = arg;
-    } else if (android::base::ConsumePrefix(&arg, "--compiler-filter=")) {
-      compiler_filter = arg;
+    if (arg == "--help") {
+      std::cerr << kUsage << "\n";
+      exit(0);
+    } else if (ConsumePrefix(&arg, "--output-dir=")) {
+      options.output_dir = arg;
+    } else if (ConsumePrefix(&arg, "--compiler-filter=")) {
+      options.compiler_filter = arg;
+    } else if (ConsumePrefix(&arg, "--use-profile=")) {
+      ParseBoolResult result = ParseBool(arg);
+      if (result == ParseBoolResult::kError) {
+        Usage(ART_FORMAT("Unrecognized --use-profile value: '{}'", arg));
+      }
+      options.use_profile = result == ParseBoolResult::kTrue;
+    } else if (ConsumePrefix(&arg, "--dex2oat-bin=")) {
+      options.dex2oat_bin = arg;
+    } else if (ConsumePrefix(&arg, "--android-root=")) {
+      ConsumeSuffix(&arg, "/");
+      options.android_root = arg;
+    } else if (ConsumePrefix(&arg, "--profile-file=")) {
+      options.profile_file = arg;
+    } else if (ConsumePrefix(&arg, "--instruction-set=")) {
+      options.instruction_set = arg;
+    } else if (ConsumePrefix(&arg, "--core-only=")) {
+      ParseBoolResult result = ParseBool(arg);
+      if (result == ParseBoolResult::kError) {
+        Usage(ART_FORMAT("Unrecognized --core-only value: '{}'", arg));
+      }
+      options.core_only = result == ParseBoolResult::kTrue;
     } else {
-      LOG(ERROR) << android::base::StringPrintf("Unrecognized argument: '%s'", argv[i]);
-      exit(EX_USAGE);
+      Usage(ART_FORMAT("Unrecognized argument: '{}'", argv[i]));
     }
   }
 
-  if (dir.empty()) {
-    LOG(ERROR) << "--output-dir must be specified";
-    exit(EX_USAGE);
+  if (options.output_dir.empty()) {
+    Usage("--output-dir must be specified");
   }
 
-  return art::GenerateBootImage(dir, compiler_filter);
+  if (options.dex2oat_bin.empty()) {
+    if (kIsTargetBuild) {
+      options.dex2oat_bin = GetCompilerExecutable();
+    } else {
+      Usage("--dex2oat-bin must be specified when running on host");
+    }
+  }
+
+  if (options.android_root.empty()) {
+    if (!kIsTargetBuild) {
+      Usage("--android-root must be specified when running on host");
+    }
+  }
+
+  if (options.use_profile && options.profile_file.empty()) {
+    if (kIsTargetBuild) {
+      options.profile_file = ART_FORMAT("{}/etc/boot-image.prof", GetArtRoot());
+    } else {
+      Usage("--profile-file must be specified when running on host and --use-profile is true");
+    }
+  }
+
+  if (options.instruction_set.empty()) {
+    if (kIsTargetBuild) {
+      options.instruction_set = GetInstructionSetString(kRuntimeISA);
+    } else {
+      Usage("--instruction-set must be specified when running on host");
+    }
+  }
+
+  return GenerateBootImage(options);
 }
+
+}  // namespace
+
+}  // namespace gbi
+}  // namespace art
+
+int main(int argc, char** argv) { return art::gbi::Main(argc, argv); }
diff --git a/test/knownfailures.json b/test/knownfailures.json
index 91cf968..31158e3 100644
--- a/test/knownfailures.json
+++ b/test/knownfailures.json
@@ -1,16 +1,15 @@
 [
     {
-        "tests": "2247-checker-write-barrier-elimination",
-        "description": ["Disable 2247- until we fix the WBE issue."],
-        "bug": "http://b/310755375"
-    },
-    {
         "tests": "153-reference-stress",
         "description": ["Disable 153-reference-stress temporarily until a fix",
                         "arrives."],
         "bug": "http://b/33389022"
     },
     {
+        "tests": "626-checker-arm64-scratch-register",
+        "description": ["Disable 626-checker until we assses whether to keep it"]
+    },
+    {
         "tests": "304-method-tracing",
         "description": ["Disable 304-method-tracing temporarily until a fix",
                         "arrives."],
@@ -59,12 +58,6 @@
                         "loaded systems."]
     },
     {
-        "tests": "569-checker-pattern-replacement",
-        "variant": "target",
-        "description": ["569-checker-pattern-replacement tests behaviour",
-                        "present only on host."]
-    },
-    {
         "tests": ["116-nodex2oat",
                   "118-noimage-dex2oat"],
         "variant": "prebuild",
@@ -125,6 +118,12 @@
                         "non-deterministic. Same for 913."]
     },
     {
+        "tests": "2264-throwing-systemcleaner",
+        "variant": "gcstress | gcverify",
+        "description": ["failing for unknown reasons"],
+        "bug": "http://b/288355042"
+    },
+    {
         "tests": ["1946-list-descriptors"],
         "variant": "gcverify | trace",
         "description": "This test is rather slow and gcverify or trace often cause it to timeout."
@@ -265,9 +264,10 @@
                         "suppressed when tracing."]
     },
     {
-        "tests": "638-checker-inline-cache-intrinsic",
+        "tests": ["638-checker-inline-cache-intrinsic",
+                  "850-checker-branches"],
         "variant": "interpreter | interp-ac",
-        "description": ["Test expects JIT compilation"]
+        "description": ["Tests expect JIT compilation"]
     },
     {
         "tests": "597-deopt-invoke-stub",
@@ -283,22 +283,13 @@
         "variant": "jit"
     },
     {
-        "tests": ["570-checker-select",
-                  "484-checker-register-hints"],
-        "description": ["These tests were based on the linear scan allocator,",
-                        "which makes different decisions than the graph",
-                        "coloring allocator. (These attempt to test for code",
-                        "quality, not correctness.)"],
-        "variant": "regalloc_gc"
-    },
-    {
         "tests": ["454-get-vreg",
                   "457-regs",
                   "602-deoptimizeable",
                   "685-deoptimizeable"],
         "description": ["Tests that should fail when the optimizing compiler ",
                         "compiles them non-debuggable."],
-        "variant": "optimizing & ndebuggable | regalloc_gc & ndebuggable | speed-profile & ndebuggable | jit & ndebuggable | jit-on-first-use & ndebuggable"
+        "variant": "optimizing & ndebuggable | speed-profile & ndebuggable | jit & ndebuggable | jit-on-first-use & ndebuggable"
     },
     {
         "tests": ["596-app-images", "597-app-images-same-classloader"],
@@ -316,13 +307,13 @@
         "variant": "field-stress | jvmti-stress | redefine-stress | step-stress | trace-stress"
     },
     {
-        "tests": "596-app-images",
-        "description": "app images do not initialize classes when debuggable",
+        "tests": ["596-app-images", "597-app-images-same-classloader", "661-oat-writer-layout"],
+        "description": "app images are not loaded when debuggable",
         "variant": "debuggable"
     },
     {
         "tests": "055-enum-performance",
-        "variant": "optimizing | regalloc_gc",
+        "variant": "optimizing",
         "description": ["055: Exceeds run time limits due to heap poisoning ",
                         "instrumentation (on ARM and ARM64 devices)."]
     },
@@ -339,10 +330,11 @@
     },
     {
         "tests": ["000-nop",
-                  "595-profile-saving"],
-        "description": "The doesn't compile anything",
+                  "595-profile-saving",
+                  "2271-profile-inline-cache"],
+        "description": "The test doesn't compile anything",
         "env_vars": {"ART_TEST_BISECTION": "true"},
-        "variant": "optimizing | regalloc_gc"
+        "variant": "optimizing"
     },
     {
         "tests": ["018-stack-overflow",
@@ -352,21 +344,21 @@
                   "137-cfi"],
         "description": "The test run dalvikvm more than once.",
         "env_vars": {"ART_TEST_BISECTION": "true"},
-        "variant": "optimizing | regalloc_gc"
+        "variant": "optimizing"
     },
     {
         "tests": ["115-native-bridge",
                   "088-monitor-verification"],
         "description": "The test assume they are always compiled.",
         "env_vars": {"ART_TEST_BISECTION": "true"},
-        "variant": "optimizing | regalloc_gc"
+        "variant": "optimizing"
     },
     {
         "tests": "055-enum-performance",
         "description": ["The test tests performance which degrades during",
                         "bisecting."],
         "env_vars": {"ART_TEST_BISECTION": "true"},
-        "variant": "optimizing | regalloc_gc"
+        "variant": "optimizing"
     },
     {
         "tests": ["537-checker-arraycopy",
@@ -378,7 +370,9 @@
                   "030-bad-finalizer",
                   "080-oom-throw",
                   "1336-short-finalizer-timeout",
-                  "2041-bad-cleaner"],
+                  "2041-bad-cleaner",
+                  "2048-bad-native-registry",
+                  "2264-throwing-systemcleaner"],
         "bug": "http://b/36377828",
         "variant": "interp-ac"
     },
@@ -435,6 +429,7 @@
     },
     {
         "test_patterns": [
+            ".*const-method-type.*",
             ".*invoke-custom.*",
             ".*invoke-polymorphic.*",
             ".*methodhandle.*",
@@ -443,6 +438,7 @@
             ".*var-handle.*",
             "160-read-barrier-stress",
             "716-jli-jit-samples",
+            "849-records",
             "1002-notify-startup",
             "1975-hello-structural-transformation",
             "1976-hello-structural-static-methods",
@@ -509,7 +505,8 @@
             "924-threads",
             "981-dedup-original-dex",
             "1900-track-alloc",
-            "2230-profile-save-hotness"
+            "2230-profile-save-hotness",
+            "2271-profile-inline-cache"
         ],
         "description": ["Tests that require exact knowledge of the deoptimization state, the ",
                         "number of plugins and agents, or breaks other openjdkjvmti assumptions."],
@@ -546,7 +543,8 @@
             "804-class-extends-itself",
             "842-vdex-hard-failure",
             "921-hello-failure",
-            "999-redefine-hiddenapi"
+            "999-redefine-hiddenapi",
+            "2267-class-implements-itself"
         ],
         "description": [
             "Tests that use illegal dex files or otherwise break dexter assumptions"
@@ -570,7 +568,8 @@
             "817-hiddenapi",
             "944-transform-classloaders",
             "999-redefine-hiddenapi",
-            "2038-hiddenapi-jvmti-ext"
+            "2038-hiddenapi-jvmti-ext",
+            "2270-mh-internal-hiddenapi-use"
         ],
         "description": [
             "Tests that use custom class loaders or other features not supported ",
@@ -861,6 +860,7 @@
           "168-vmstack-annotated",
           "172-app-image-twice",
           "177-visibly-initialized-deadlock",
+          "183-rmw-stress-test",
           "201-built-in-except-detail-messages",
           "203-multi-checkpoint",
           "304-method-tracing",
@@ -941,7 +941,6 @@
           "593-checker-shift-and-simplifier",
           "594-invoke-super",
           "595-error-class",
-          "595-profile-saving",
           "596-app-images",
           "596-checker-dead-phi",
           "596-monitor-inflation",
@@ -1018,6 +1017,8 @@
           "819-verification-runtime",
           "823-cha-inlining",
           "842-vdex-hard-failure",
+          "850-checker-branches",
+          "852-invoke-super",
           "900-hello-plugin",
           "901-hello-ti-agent",
           "903-hello-tagging",
@@ -1079,9 +1080,12 @@
           "1946-list-descriptors",
           "1947-breakpoint-redefine-deopt",
           "2041-bad-cleaner",
+          "2048-bad-native-registry",
           "2230-profile-save-hotness",
           "2245-checker-smali-instance-of-comparison",
-          "2251-checker-irreducible-loop-do-not-inline"
+          "2251-checker-irreducible-loop-do-not-inline",
+          "2264-throwing-systemcleaner",
+          "2267-class-implements-itself"
         ],
         "variant": "jvm",
         "bug": "b/73888836",
@@ -1138,6 +1142,7 @@
     {
         "tests": ["178-app-image-native-method",
                   "530-checker-peel-unroll",
+                  "595-profile-saving",
                   "616-cha-unloading",
                   "674-hiddenapi",
                   "677-fsi2",
@@ -1172,6 +1177,7 @@
                   "845-data-image",
                   "846-multidex-data-image",
                   "847-filled-new-aray",
+                  "848-pattern-match",
                   "999-redefine-hiddenapi",
                   "1000-non-moving-space-stress",
                   "1001-app-image-regions",
@@ -1217,6 +1223,7 @@
                   "2009-structural-local-ref",
                   "2011-stack-walk-concurrent-instrument",
                   "2012-structural-redefinition-failures-jni-id",
+                  "2031-zygote-compiled-frame-deopt",
                   "2033-shutdown-mechanics",
                   "2035-structural-native-method",
                   "2036-structural-subclass-shadow",
@@ -1225,8 +1232,12 @@
                   "2238-checker-polymorphic-recursive-inlining",
                   "2240-tracing-non-invokable-method",
                   "2246-trace-stream",
+                  "2246-trace-v2",
                   "2254-class-value-before-and-after-u",
-                  "2261-badcleaner-in-systemcleaner"],
+                  "2261-badcleaner-in-systemcleaner",
+                  "2263-method-trace-jit",
+                  "2270-mh-internal-hiddenapi-use",
+                  "2271-profile-inline-cache"],
         "variant": "jvm",
         "description": ["Doesn't run on RI."]
     },
@@ -1328,12 +1339,6 @@
         "description": [ "Working as intended tests that don't pass with baseline." ]
     },
     {
-        "tests": ["1004-checker-volatile-ref-load"],
-        "env_vars": {"ART_USE_READ_BARRIER": "false"},
-        "bug": "b/140507091",
-        "description": ["Test containing Checker assertions expecting Baker read barriers."]
-    },
-    {
         "tests": ["2040-huge-native-alloc"],
         "env_vars": {"ART_USE_READ_BARRIER": "false"},
         "variant": "debug",
@@ -1341,32 +1346,12 @@
         "description": ["Test fails due to delay delebrately added in the userfaultfd GC between marking and compaction."]
     },
     {
-        "tests": ["1004-checker-volatile-ref-load"],
-        "env_vars": {"ART_READ_BARRIER_TYPE": "TABLELOOKUP"},
-        "bug": "b/140507091",
-        "description": ["Test containing Checker assertions expecting Baker read barriers."]
-    },
-    {
         "tests": ["689-zygote-jit-deopt"],
         "variant": "gcstress",
         "bug": "b/137887811",
         "description": ["Occasional timeouts."]
     },
     {
-        "tests": ["2031-zygote-compiled-frame-deopt"],
-        "zipapex": true,
-        "bug": "b/144947842",
-        "description": ["This test requires strong knowledge about where the libdir is",
-                        "which the zipapex runner breaks."]
-    },
-    {
-        "tests": ["909-attach-agent", "126-miranda-multidex"],
-        "zipapex": true,
-        "bug": "b/135507613",
-        "description": ["These tests run dalvikvm multiple times, this can mess up the",
-                        "zipapex runner."]
-    },
-    {
         "tests": ["175-alloc-big-bignums"],
         "variant": "interpreter | interp-ac | trace | no-image | debuggable | prebuild",
         "bug": "b/174470490",
@@ -1418,12 +1403,14 @@
         "description": ["Reference.refersTo() not supported on old version of RI."]
     },
     {
-        "tests": ["2232-write-metrics-to-log"],
+        "tests": ["2232-write-metrics-to-log",
+                  "2233-metrics-background-thread"],
         "variant": "jvm",
         "description": ["RI does not support ART metrics."]
     },
     {
-        "tests": ["2232-write-metrics-to-log"],
+        "tests": ["2232-write-metrics-to-log",
+                  "2233-metrics-background-thread"],
         "variant": "target",
         "description": ["Checks LOG_STREAM output, which cannot be captured on target."]
     },
@@ -1520,12 +1507,6 @@
         "description": ["Expected failures when compiling without a boot image"]
     },
     {
-        "tests": ["719-varhandle-concurrency"],
-        "variant": "target & ndebug & 64",
-        "bug": "b/224733324",
-        "description": ["segfault in VarHandle::GetMethodTypeMatchForAccessMode"]
-    },
-    {
         "tests": ["2043-reference-pauses"],
         "env_vars": {"ART_TEST_DEBUG_GC": "true"},
         "description": ["Test timing out on debug gc."]
@@ -1555,24 +1536,51 @@
     },
     {
         "tests": ["1921-suspend-native-recursive-monitor"],
-        "description": ["Change of behavior when used with JDK 17."],
+        "description": ["RawMonitorEnter behaves differently on ART and RI since JDK17"],
         "bug": "b/242985234",
         "variant": "jvm"
     },
     {
-        "tests": ["2246-trace-stream"],
-        "env_vars": {"ART_TEST_DEBUG_GC": "true"},
-        "bug": "b/264844668",
-        "description": ["Test timing out on debug gc."]
-    },
-    {
         "tests": ["845-data-image", "846-multidex-data-image"],
-        "variant": "debuggable",
+        "variant": "debuggable | trace | stream",
         "description": ["Runtime app images are not supported with debuggable."]
     },
     {
         "tests": ["2262-miranda-methods"],
         "variant": "jvm",
         "description": ["jvm doesn't seem to support calling miranda methods via CallNonVirtual."]
+    },
+    {
+        "tests": ["2031-zygote-compiled-frame-deopt"],
+        "variant": "jit-on-first-use",
+        "description": ["Test doesn't work when jitting can happen in parallel."]
+    },
+    {
+        "tests": ["689-zygote-jit-deopt",
+                  "728-imt-conflict-zygote",
+                  "2031-zygote-compiled-frame-deopt"],
+        "bug": "b/137887811",
+        "description": "ASAN issue.",
+        "variant": "host",
+        "env_vars": {"SANITIZE_HOST": "address"}
+    },
+    {
+      "tests": ["2271-profile-inline-cache"],
+      "variant": "jit-on-first-use | debuggable | trace |  stream",
+      "description": ["Test relies on profiling done by baseline compiled code. Meanwhile, it",
+                      "can't use --baseline because it has a test case checking the behavior when",
+                      "a method is optimized compiled."]
+    },
+    {
+      "tests": ["004-ThreadStress",
+                "050-sync-test",
+                "083-compiler-regressions",
+                "137-cfi",
+                "913-heaps",
+                "2043-reference-pauses",
+                "2239-varhandle-perf"],
+      "bug": "b/328023607",
+      "description": ["Fails on QEMU"],
+      "env_vars": {"ART_TEST_ON_VM": "true"}
     }
 ]
diff --git a/test/odsign/AndroidManifest.xml b/test/odsign/AndroidManifest.xml
index b9936fc..b22112d 100644
--- a/test/odsign/AndroidManifest.xml
+++ b/test/odsign/AndroidManifest.xml
@@ -18,7 +18,5 @@
     <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
                      android:targetPackage="com.android.tests.odsign"
                      android:label="test app for on-device signing">
-        <meta-data android:name="listener"
-                   android:value="com.android.cts.runner.CtsTestRunListener" />
     </instrumentation>/>
 </manifest>
diff --git a/test/odsign/odsign-e2e-tests-full.xml b/test/odsign/odsign-e2e-tests-full.xml
index a674721..7ece8e0 100644
--- a/test/odsign/odsign-e2e-tests-full.xml
+++ b/test/odsign/odsign-e2e-tests-full.xml
@@ -19,6 +19,11 @@
 
     <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
 
+    <!-- Disable syncing to prevent overwriting flags during testing. -->
+    <target_preparer class="com.android.tradefed.targetprep.DeviceSetup" >
+      <option name="disable-device-config-sync" value="true" />
+    </target_preparer>
+
     <test class="com.android.tradefed.testtype.HostTest" >
         <option name="jar" value="odsign_e2e_tests_full.jar" />
     </test>
diff --git a/test/odsign/test-src/com/android/tests/odsign/CompOsDenialHostTest.java b/test/odsign/test-src/com/android/tests/odsign/CompOsDenialHostTest.java
index 83e4a39..535cd91 100644
--- a/test/odsign/test-src/com/android/tests/odsign/CompOsDenialHostTest.java
+++ b/test/odsign/test-src/com/android/tests/odsign/CompOsDenialHostTest.java
@@ -56,6 +56,7 @@
         OdsignTestUtils testUtils = new OdsignTestUtils(testInfo);
         CompOsTestUtils compOsTestUtils = new CompOsTestUtils(device);
 
+        compOsTestUtils.assumeNotOnCuttlefish();
         compOsTestUtils.assumeCompOsPresent();
 
         testUtils.installTestApex();
@@ -73,14 +74,16 @@
     public static void afterClassWithDevice(TestInformation testInfo) throws Exception {
         OdsignTestUtils testUtils = new OdsignTestUtils(testInfo);
 
-        // Remove all test states.
-        testInfo.getDevice().executeShellV2Command("rm -rf " + PENDING_ARTIFACTS_DIR);
-        testInfo.getDevice().executeShellV2Command("rm -rf " + PENDING_ARTIFACTS_BACKUP_DIR);
-        testUtils.removeCompilationLogToAvoidBackoff();
-        testUtils.uninstallTestApex();
-
-        // Reboot should restore the device back to a good state.
-        testUtils.reboot();
+        try {
+            // Remove all test states.
+            testInfo.getDevice().executeShellV2Command("rm -rf " + PENDING_ARTIFACTS_DIR);
+            testInfo.getDevice().executeShellV2Command("rm -rf " + PENDING_ARTIFACTS_BACKUP_DIR);
+            testUtils.removeCompilationLogToAvoidBackoff();
+            testUtils.uninstallTestApex();
+        } finally {
+            // Reboot should restore the device back to a good state.
+            testUtils.reboot();
+        }
     }
 
     @Before
diff --git a/test/odsign/test-src/com/android/tests/odsign/CompOsSigningHostTest.java b/test/odsign/test-src/com/android/tests/odsign/CompOsSigningHostTest.java
index 134cff9..cc56736 100644
--- a/test/odsign/test-src/com/android/tests/odsign/CompOsSigningHostTest.java
+++ b/test/odsign/test-src/com/android/tests/odsign/CompOsSigningHostTest.java
@@ -54,32 +54,39 @@
         OdsignTestUtils testUtils = new OdsignTestUtils(testInfo);
         CompOsTestUtils compOsTestUtils = new CompOsTestUtils(device);
 
+        compOsTestUtils.assumeNotOnCuttlefish();
         compOsTestUtils.assumeCompOsPresent();
 
         testInfo.properties().put(ORIGINAL_CHECKSUMS_KEY,
                 compOsTestUtils.checksumDirectoryContentPartial(
                         OdsignTestUtils.ART_APEX_DALVIK_CACHE_DIRNAME));
 
-        testUtils.installTestApex();
+        try {
+            testUtils.installTestApex();
 
-        testInfo.properties().put(TIMESTAMP_VM_START_KEY,
-                        String.valueOf(testUtils.getCurrentTimeMs()));
+            testInfo.properties().put(TIMESTAMP_VM_START_KEY,
+                    String.valueOf(testUtils.getCurrentTimeMs()));
 
-        compOsTestUtils.runCompilationJobEarlyAndWait();
+            compOsTestUtils.runCompilationJobEarlyAndWait();
 
-        testInfo.properties().put(PENDING_CHECKSUMS_KEY,
-                compOsTestUtils.checksumDirectoryContentPartial(PENDING_ARTIFACTS_DIR));
-
-        testInfo.properties().put(TIMESTAMP_REBOOT_KEY,
-                        String.valueOf(testUtils.getCurrentTimeMs()));
-        testUtils.reboot();
+            testInfo.properties().put(PENDING_CHECKSUMS_KEY,
+                    compOsTestUtils.checksumDirectoryContentPartial(PENDING_ARTIFACTS_DIR));
+            testInfo.properties().put(TIMESTAMP_REBOOT_KEY,
+                    String.valueOf(testUtils.getCurrentTimeMs()));
+        } finally {
+            // Make sure to reboot after installTestApex.
+            testUtils.reboot();
+        }
     }
 
     @AfterClassWithInfo
     public static void afterClassWithDevice(TestInformation testInfo) throws Exception {
         OdsignTestUtils testUtils = new OdsignTestUtils(testInfo);
-        testUtils.uninstallTestApex();
-        testUtils.reboot();
+        try {
+            testUtils.uninstallTestApex();
+        } finally {
+            testUtils.reboot();  // must happen
+        }
     }
 
     @Test
diff --git a/test/odsign/test-src/com/android/tests/odsign/CompOsTestUtils.java b/test/odsign/test-src/com/android/tests/odsign/CompOsTestUtils.java
index 60d7642..4521b6f 100644
--- a/test/odsign/test-src/com/android/tests/odsign/CompOsTestUtils.java
+++ b/test/odsign/test-src/com/android/tests/odsign/CompOsTestUtils.java
@@ -29,7 +29,6 @@
 import java.util.concurrent.TimeUnit;
 
 public class CompOsTestUtils {
-    public static final String APEXDATA_DIR = "/data/misc/apexdata/com.android.compos";
 
     public static final String PENDING_ARTIFACTS_DIR =
             "/data/misc/apexdata/com.android.art/compos-pending";
@@ -63,7 +62,7 @@
     public void runCompilationJobEarlyAndWait() throws Exception {
         waitForJobToBeScheduled();
 
-        assertCommandSucceeds("cmd jobscheduler run android " + JOB_ID);
+        assertCommandSucceeds("cmd jobscheduler run -f android " + JOB_ID);
         // It takes time. Just don't spam.
         TimeUnit.SECONDS.sleep(SECONDS_BEFORE_PROGRESS_CHECK);
         // The job runs asynchronously. To wait until it completes.
@@ -74,7 +73,7 @@
         // Sort by filename (second column) to make comparison easier.
         // Filter out compos.info* (which will be deleted at boot) and cache-info.xml
         // compos.info.signature since it's only generated by CompOS.
-        return assertCommandSucceeds("cd " + path + "; find -type f -exec sha256sum {} \\;"
+        return assertCommandSucceeds("cd " + path + " && find -type f -exec sha256sum {} \\;"
                 + "| grep -v cache-info.xml | grep -v compos.info"
                 + "| sort -k2");
     }
@@ -84,12 +83,12 @@
         for (int i = 0; i < JOB_CREATION_MAX_SECONDS; i++) {
             CommandResult result = mDevice.executeShellV2Command(
                     "cmd jobscheduler get-job-state android " + JOB_ID);
-            String state = result.getStdout().toString();
+            String state = result.getStdout();
             if (state.startsWith("unknown")) {
                 // The job hasn't been scheduled yet. So try again.
                 TimeUnit.SECONDS.sleep(1);
             } else if (result.getExitCode() != 0) {
-                fail("Failing due to unexpected job state: " + result);
+                fail("Failing due to unexpected cmd jobscheduler exit code: " + result);
             } else {
                 // The job exists, which is all we care about here
                 return;
@@ -102,14 +101,16 @@
         for (int i = 0; i < timeout; i++) {
             CommandResult result = mDevice.executeShellV2Command(
                     "cmd jobscheduler get-job-state android " + JOB_ID);
-            String state = result.getStdout().toString();
+            String state = result.getStdout();
             if (state.contains("ready") || state.contains("active")) {
                 TimeUnit.SECONDS.sleep(1);
             } else if (state.startsWith("unknown")) {
                 // Job has completed
                 return;
             } else {
-                fail("Failing due to unexpected job state: " + result);
+                String context = (result.getExitCode() == 0) ? result.getStdout()
+                        : result.toString();
+                fail("Failing due to unexpected job state: " + context);
             }
         }
         fail("Timed out waiting for the job to complete");
@@ -125,6 +126,11 @@
         assumeTrue(mDevice.doesFileExist("/apex/com.android.compos/"));
     }
 
+    public void assumeNotOnCuttlefish() throws Exception {
+        String product = mDevice.getProperty("ro.build.product");
+        assumeTrue(product != null && !product.startsWith("vsoc_"));
+    }
+
     private String assertCommandSucceeds(String command) throws DeviceNotAvailableException {
         CommandResult result = mDevice.executeShellV2Command(command);
         assertWithMessage(result.toString()).that(result.getExitCode()).isEqualTo(0);
diff --git a/test/odsign/test-src/com/android/tests/odsign/DeviceState.java b/test/odsign/test-src/com/android/tests/odsign/DeviceState.java
index 53cdaa6..7362d89 100644
--- a/test/odsign/test-src/com/android/tests/odsign/DeviceState.java
+++ b/test/odsign/test-src/com/android/tests/odsign/DeviceState.java
@@ -87,11 +87,6 @@
             }
         }
 
-        if (!mMutatedPhenotypeFlags.isEmpty()) {
-            mTestInfo.getDevice().executeShellV2Command(
-                    "device_config set_sync_disabled_for_tests none");
-        }
-
         for (var entry : mDeletedFiles.entrySet()) {
             mTestInfo.getDevice().executeShellV2Command(
                     String.format("cp '%s' '%s'", entry.getValue(), entry.getKey()));
@@ -156,7 +151,7 @@
     /** Simulates that there is an OTA that updates a boot classpath jar. */
     public void simulateBootClasspathOta() throws Exception {
         File localFile = mTestUtils.copyResourceToFile(TEST_JAR_RESOURCE_NAME);
-        pushAndBindMount(localFile, "/system/framework/framework.jar");
+        pushAndBindMount(localFile, "/system/framework/framework-graphics.jar");
     }
 
     /** Simulates that there is an OTA that updates a system server jar. */
@@ -165,6 +160,13 @@
         pushAndBindMount(localFile, "/system/framework/services.jar");
     }
 
+    /** Simulates that a system server jar is bad. */
+    public void simulateBadSystemServerJar() throws Exception {
+        File tempFile = File.createTempFile("empty", ".jar");
+        tempFile.deleteOnExit();
+        pushAndBindMount(tempFile, "/system/framework/services.jar");
+    }
+
     public void makeDex2oatFail() throws Exception {
         setProperty("dalvik.vm.boot-dex2oat-threads", "-1");
     }
@@ -187,11 +189,6 @@
             mMutatedPhenotypeFlags.put(key, output.equals("null") ? null : output);
         }
 
-        // Disable phenotype flag syncing. Potentially, we can set `set_sync_disabled_for_tests` to
-        // `until_reboot`, but setting it to `persistent` prevents unrelated system crashes/restarts
-        // from affecting the test. `set_sync_disabled_for_tests` is reset in `restore` anyway.
-        mTestUtils.assertCommandSucceeds("device_config set_sync_disabled_for_tests persistent");
-
         if (value != null) {
             mTestUtils.assertCommandSucceeds(String.format(
                     "device_config put '%s' '%s' '%s'", PHENOTYPE_FLAG_NAMESPACE, key, value));
diff --git a/test/odsign/test-src/com/android/tests/odsign/OdrefreshHostTest.java b/test/odsign/test-src/com/android/tests/odsign/OdrefreshHostTest.java
index fe727ca..75f540d 100644
--- a/test/odsign/test-src/com/android/tests/odsign/OdrefreshHostTest.java
+++ b/test/odsign/test-src/com/android/tests/odsign/OdrefreshHostTest.java
@@ -24,6 +24,7 @@
 import com.android.tradefed.testtype.junit4.AfterClassWithInfo;
 import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test;
 import com.android.tradefed.testtype.junit4.BeforeClassWithInfo;
+import com.android.tradefed.util.CommandResult;
 
 import org.junit.After;
 import org.junit.Before;
@@ -420,6 +421,75 @@
         mTestUtils.assertModifiedAfter(Set.of(OdsignTestUtils.CACHE_INFO_FILE), timeMs);
     }
 
+    /**
+     * Regression test of CVE-2021-39689 (b/206090748): if the device doesn't have the odsign
+     * security fix, there's a risk that the existing artifacts may be manipulated, and odsign will
+     * mistakenly sign them. Therefore, odrefresh should clear all artifacts and regenerate them.
+     * I.e., no matter the compilation succeeds or not, no existing artifacts should be left.
+     *
+     * On contrary, if the device has the odsign security fix, odrefresh should keep existing
+     * artifacts (see {@link #verifyMissingArtifactTriggersCompilation}).
+     */
+    @Test
+    public void verifyArtifactsClearedWhenNoPartialCompilation() throws Exception {
+        // Remove arbitrary system server artifacts to trigger compilation.
+        simulateMissingArtifacts();
+
+        // The successful case.
+        mTestUtils.removeCompilationLogToAvoidBackoff();
+        long timeMs = mTestUtils.getCurrentTimeMs();
+        mTestUtils.runOdrefreshNoPartialCompilation();
+
+        // Existing artifacts should be replaced with new ones.
+        mTestUtils.assertModifiedAfter(mTestUtils.getExpectedPrimaryBootImage(), timeMs);
+        mTestUtils.assertModifiedAfter(mTestUtils.getExpectedBootImageMainlineExtension(), timeMs);
+        mTestUtils.assertModifiedAfter(mTestUtils.getSystemServerExpectedArtifacts(), timeMs);
+
+        // Remove arbitrary system server artifacts to trigger compilation again.
+        simulateMissingArtifacts();
+
+        // The failed case.
+        mDeviceState.makeDex2oatFail();
+        mTestUtils.removeCompilationLogToAvoidBackoff();
+        timeMs = mTestUtils.getCurrentTimeMs();
+        mTestUtils.runOdrefreshNoPartialCompilation();
+
+        // Existing artifacts should be gone.
+        mTestUtils.assertFilesNotExist(mTestUtils.getExpectedPrimaryBootImage());
+        mTestUtils.assertFilesNotExist(mTestUtils.getExpectedBootImageMainlineExtension());
+        mTestUtils.assertFilesNotExist(mTestUtils.getSystemServerExpectedArtifacts());
+    }
+
+    /**
+     * If the compilation is skipped because a previous attempt partially failed, odrefresh should
+     * not clear existing artifacts.
+     */
+    @Test
+    public void verifyArtifactsKeptWhenCompilationSkippedNoPartialCompilation() throws Exception {
+        // Simulate that the compilation is partially failed.
+        mDeviceState.simulateBadSystemServerJar();
+        long timeMs = mTestUtils.getCurrentTimeMs();
+        mTestUtils.runOdrefreshNoPartialCompilation();
+
+        // Verify the test setup: boot images are still generated.
+        mTestUtils.assertModifiedAfter(mTestUtils.getExpectedPrimaryBootImage(), timeMs);
+        mTestUtils.assertModifiedAfter(mTestUtils.getExpectedBootImageMainlineExtension(), timeMs);
+
+        // Rerun odrefresh. The compilation is skipped this time.
+        timeMs = mTestUtils.getCurrentTimeMs();
+        CommandResult result = mTestUtils.runOdrefreshNoPartialCompilation();
+
+        // Existing artifacts should be kept.
+        mTestUtils.assertNotModifiedAfter(mTestUtils.getExpectedPrimaryBootImage(), timeMs);
+        mTestUtils.assertNotModifiedAfter(
+                mTestUtils.getExpectedBootImageMainlineExtension(), timeMs);
+
+        // Note that the existing artifacts may be manipulated (CVE-2021-39689). Make sure odrefresh
+        // returns `kOkay` rather than `kCompilationSuccess` or `kCompilationFailed`, so that odsign
+        // only verifies the artifacts but not sign them.
+        assertThat(result.getExitCode()).isEqualTo(0);
+    }
+
     private Set<String> simulateMissingArtifacts() throws Exception {
         Set<String> missingArtifacts = new HashSet<>();
         String sample = mTestUtils.getSystemServerExpectedArtifacts().iterator().next();
diff --git a/test/odsign/test-src/com/android/tests/odsign/OdsignTestUtils.java b/test/odsign/test-src/com/android/tests/odsign/OdsignTestUtils.java
index 5471c1f..8b61905 100644
--- a/test/odsign/test-src/com/android/tests/odsign/OdsignTestUtils.java
+++ b/test/odsign/test-src/com/android/tests/odsign/OdsignTestUtils.java
@@ -480,10 +480,20 @@
         runOdrefresh("" /* extraArgs */);
     }
 
-    public void runOdrefresh(String extraArgs) throws Exception {
+    public CommandResult runOdrefresh(String extraArgs) throws Exception {
         mTestInfo.getDevice().executeShellV2Command(ODREFRESH_BIN + " --check");
-        mTestInfo.getDevice().executeShellV2Command(
-                ODREFRESH_BIN + " --partial-compilation --no-refresh " + extraArgs + " --compile");
+        return mTestInfo.getDevice().executeShellV2Command(ODREFRESH_BIN
+                + " --partial-compilation=true --no-refresh " + extraArgs + " --compile");
+    }
+
+    /**
+     * Simulates how odsign invokes odrefresh on a device that doesn't have the security fix for
+     * CVE-2021-39689 (b/206090748).
+     */
+    public CommandResult runOdrefreshNoPartialCompilation() throws Exception {
+        // Note that odsign doesn't call `odrefresh --check` on such a device.
+        return mTestInfo.getDevice().executeShellV2Command(
+                ODREFRESH_BIN + " --partial-compilation=false --no-refresh --compile");
     }
 
     public boolean areAllApexesFactoryInstalled() throws Exception {
diff --git a/test/run-test b/test/run-test
index f2be1d8..17d5227 100755
--- a/test/run-test
+++ b/test/run-test
@@ -113,14 +113,14 @@
     tmp_dir = f"{TMPDIR}/{test_dir}"
   checker = f"{progdir}/../tools/checker/checker.py"
 
-  ON_VM = os.environ.get("ART_TEST_ON_VM")
-  SSH_USER = os.environ.get("ART_TEST_SSH_USER")
-  SSH_HOST = os.environ.get("ART_TEST_SSH_HOST")
-  SSH_PORT = os.environ.get("ART_TEST_SSH_PORT")
-  SSH_CMD = os.environ.get("ART_SSH_CMD")
-  SCP_CMD = os.environ.get("ART_SCP_CMD")
-  CHROOT = os.environ.get("ART_TEST_CHROOT")
-  CHROOT_CMD = os.environ.get("ART_CHROOT_CMD")
+  ON_VM = env.ART_TEST_ON_VM
+  SSH_USER = env.ART_TEST_SSH_USER
+  SSH_HOST = env.ART_TEST_SSH_HOST
+  SSH_PORT = env.ART_TEST_SSH_PORT
+  SSH_CMD = env.ART_SSH_CMD
+  SCP_CMD = env.ART_SCP_CMD
+  CHROOT = env.ART_TEST_CHROOT
+  CHROOT_CMD = env.ART_CHROOT_CMD
 
   def fail(message: str, caller:Optional[FrameInfo]=None):
     caller = caller or getframeinfo(currentframe().f_back)  # type: ignore
@@ -353,7 +353,7 @@
     elif arg == "--gdb-dex2oat-args":
       shift()
       gdb_dex2oat_args = arg
-      run_args += ['--gdb-dex2oat-args "{gdb_dex2oat_args}"']
+      run_args += [f'--gdb-dex2oat-args="{gdb_dex2oat_args}"']
       shift()
     elif arg == "--debug":
       run_args += ["--debug"]
@@ -409,6 +409,9 @@
     elif arg == "--interpreter":
       run_args += ["--interpreter"]
       shift()
+    elif arg == "--switch-interpreter":
+      run_args += ["--switch-interpreter"]
+      shift()
     elif arg == "--jit":
       run_args += ["--jit"]
       shift()
@@ -517,27 +520,6 @@
       DEX_LOCATION = tmp_dir
       host_lib_root = f"{OUT_DIR}/soong/host/linux_bionic-x86"
       shift()
-    elif arg == "--runtime-extracted-zipapex":
-      shift()
-      # TODO Should we allow the java.library.path to search the zipapex too?
-      # Not needed at the moment and adding it will be complicated so for now
-      # we'll ignore this.
-      run_args += [f'--host --runtime-extracted-zipapex "{arg}"']
-      target_mode = "no"
-      DEX_LOCATION = tmp_dir
-      shift()
-    elif arg == "--runtime-zipapex":
-      shift()
-      # TODO Should we allow the java.library.path to search the zipapex too?
-      # Not needed at the moment and adding it will be complicated so for now
-      # we'll ignore this.
-      run_args += [f'--host --runtime-zipapex "{arg}"']
-      target_mode = "no"
-      DEX_LOCATION = tmp_dir
-      # apex_payload.zip is quite large we need a high enough ulimit to
-      # extract it. 512mb should be good enough.
-      file_ulimit = 512000
-      shift()
     elif arg == "--timeout":
       shift()
       if not arg:
@@ -801,14 +783,14 @@
         "    --with-agent <agent>  Run the test with the given agent loaded with -agentpath:\n"
         "    --debuggable          Whether to compile Java code for a debugger.\n"
         "    --gdb                 Run under gdb; incompatible with some tests.\n"
-        "    --gdb-dex2oat         Run dex2oat under the prebuilt lldb.\n"
+        "    --gdb-dex2oat         Run dex2oat under the prebuilt gdb.\n"
         "    --gdbserver           Start gdbserver (defaults to port :5039).\n"
         "    --gdbserver-port <port>\n"
         "                          Start gdbserver with the given COMM (see man gdbserver).\n"
         "    --gdbserver-bin <binary>\n"
         "                          Use the given binary as gdbserver.\n"
         "    --gdb-arg             Pass an option to gdb or gdbserver.\n"
-        "    --gdb-dex2oat-args    Pass options separated by ';' to lldb for dex2oat.\n"
+        "    --gdb-dex2oat-args    Pass options separated by ';' to gdb for dex2oat.\n"
         "    --simpleperf          Wraps the dalvikvm invocation in 'simpleperf record ...\n"
         "                          ... simpleperf report' and dumps stats to stdout.\n"
         "    --temp-path [path]    Location where to execute the tests.\n"
@@ -843,11 +825,6 @@
         "                          (if applicable) to run the test with.\n"
         "    --64                  Run the test in 64-bit mode\n"
         "    --bionic              Use the (host, 64-bit only) linux_bionic libc runtime\n"
-        "    --runtime-zipapex [file]\n"
-        "                          Use the given zipapex file to provide runtime binaries\n"
-        "    --runtime-extracted-zipapex [dir]\n"
-        "                          Use the given extracted zipapex directory to provide\n"
-        "                          runtime binaries\n"
         "    --timeout n           Test timeout in seconds\n"
         "    --trace               Run with method tracing\n"
         "    --strace              Run with syscall tracing from strace.\n"
@@ -994,6 +971,18 @@
     runner.chmod(0o777)
     return runner
 
+  def do_dump_cfg():
+    assert run_optimizing == "true", ("The CFG can be dumped only in"
+                                      " optimizing mode")
+    if target_mode == "yes":
+      if ON_VM:
+        run(f'{SCP_CMD} "{SSH_USER}@${SSH_HOST}:{CHROOT}/{cfg_output_dir}/'
+            f'{cfg_output} {dump_cfg_path}"')
+      else:
+        run(f"adb pull {chroot}/{cfg_output_dir}/{cfg_output} {dump_cfg_path}")
+    else:
+      run(f"cp {cfg_output_dir}/{cfg_output} {dump_cfg_path}")
+
   # Test might not execute anything but we still expect the output files to exist.
   Path(test_stdout).touch()
   Path(test_stderr).touch()
@@ -1022,13 +1011,18 @@
     else:
       run("adb push {} {}".format(push_files, chroot_dex_location))
 
-    if ON_VM:
-      run(f"{SSH_CMD} {CHROOT_CMD} bash {DEX_LOCATION}/run.sh",
-          fail_message=f"Runner {chroot_dex_location}/run.sh failed")
-    else:
-      chroot_prefix = f"chroot {chroot}" if chroot else ""
-      run(f"adb shell {chroot_prefix} sh {DEX_LOCATION}/run.sh",
-          fail_message=f"Runner {chroot_dex_location}/run.sh failed")
+    try:
+      if ON_VM:
+        run(f"{SSH_CMD} {CHROOT_CMD} bash {DEX_LOCATION}/run.sh",
+            fail_message=f"Runner {chroot_dex_location}/run.sh failed")
+      else:
+        chroot_prefix = f"chroot {chroot}" if chroot else ""
+        run(f"adb shell {chroot_prefix} sh {DEX_LOCATION}/run.sh",
+            fail_message=f"Runner {chroot_dex_location}/run.sh failed")
+    finally:
+      # Copy the generated CFG to the specified path.
+      if dump_cfg == "true":
+        do_dump_cfg()
 
     # Copy the on-device stdout/stderr to host.
     pull_files = [test_stdout, test_stderr, "expected-stdout.txt", "expected-stderr.txt"]
@@ -1069,30 +1063,26 @@
     run(f'''echo "ABI: 'x86_64'" | cat - "{test_stdout}" "{test_stderr}"'''
         f"""| {ANDROID_BUILD_TOP}/development/scripts/stack | tail -n 3000""")
   print("####################", flush=True)
-  if proc_out.returncode != 0 or proc_err.returncode != 0:
-    kind = ((["stdout"] if proc_out.returncode != 0 else []) +
-            (["stderr"] if proc_err.returncode != 0 else []))
-    fail("{} did not match the expected file".format(" and ".join(kind)))
 
-  if run_checker == "yes":
-    if target_mode == "yes":
-      if ON_VM:
-        run(f'{SCP_CMD} "{SSH_USER}@${SSH_HOST}:{CHROOT}/{cfg_output_dir}/{cfg_output}"')
-      else:
-        run(f'adb pull "{chroot}/{cfg_output_dir}/{cfg_output}"')
-    run(f'"{checker}" -q {checker_args} "{cfg_output}" "{tmp_dir}"',
-        fail_message="CFG checker failed")
+  try:
+    if proc_out.returncode != 0 or proc_err.returncode != 0:
+      kind = ((["stdout"] if proc_out.returncode != 0 else []) +
+              (["stderr"] if proc_err.returncode != 0 else []))
+      fail("{} did not match the expected file".format(" and ".join(kind)))
 
-  # Copy the generated CFG to the specified path.
-  if dump_cfg == "true":
-    assert run_optimizing == "true", "The CFG can be dumped only in optimizing mode"
-    if target_mode == "yes":
-      if ON_VM:
-        run(f'{SCP_CMD} "{SSH_USER}@${SSH_HOST}:{CHROOT}/{cfg_output_dir}/{cfg_output} {dump_cfg_output}"')
-      else:
-        run(f"adb pull {chroot}/{cfg_output_dir}/{cfg_output} {dump_cfg_path}")
-    else:
-      run(f"cp {cfg_output_dir}/{cfg_output} {dump_cfg_path}")
+    if run_checker == "yes":
+      if target_mode == "yes":
+        if ON_VM:
+          run(f'{SCP_CMD} "{SSH_USER}@{SSH_HOST}:{CHROOT}/{cfg_output_dir}/'
+              f'{cfg_output}" "{tmp_dir}"')
+        else:
+          run(f'adb pull "{chroot}/{cfg_output_dir}/{cfg_output}"')
+      run(f'"{checker}" -q {checker_args} "{cfg_output}" "{tmp_dir}"',
+          fail_message="CFG checker failed")
+  finally:
+    # Copy the generated CFG to the specified path.
+    if dump_cfg == "true":
+      do_dump_cfg()
 
   clean_up(passed=True)
   print(f"{COLOR_GREEN}{test_dir}: PASSED{COLOR_NORMAL}")
diff --git a/test/run_test_build.py b/test/run_test_build.py
index f7984f6..4929f05 100755
--- a/test/run_test_build.py
+++ b/test/run_test_build.py
@@ -24,6 +24,7 @@
 import glob
 import os
 import pathlib
+import re
 import shlex
 import shutil
 import subprocess
@@ -31,9 +32,9 @@
 import zipfile
 
 from argparse import ArgumentParser
+from concurrent.futures import ThreadPoolExecutor
 from fcntl import lockf, LOCK_EX, LOCK_NB
 from importlib.machinery import SourceFileLoader
-from concurrent.futures import ThreadPoolExecutor
 from os import environ, getcwd, chdir, cpu_count, chmod
 from os.path import relpath
 from pathlib import Path
@@ -48,11 +49,16 @@
 
 lock_file = None  # Keep alive as long as this process is alive.
 
+RBE_COMPARE = False  # Debugging: Check that RBE and local output are identical.
+
 RBE_D8_DISABLED_FOR = {
   "952-invoke-custom",        # b/228312861: RBE uses wrong inputs.
   "979-const-method-handle",  # b/228312861: RBE uses wrong inputs.
 }
 
+# Debug option. Report commands that are taking a lot of user CPU time.
+REPORT_SLOW_COMMANDS = False
+
 class BuildTestContext:
   def __init__(self, args, android_build_top, test_dir):
     self.android_build_top = android_build_top.absolute()
@@ -71,9 +77,12 @@
     self.javac_args = "-g -Xlint:-options"
 
     # Helper functions to execute tools.
+    self.d8_path = args.d8.absolute()
     self.d8 = functools.partial(self.run, args.d8.absolute())
     self.jasmin = functools.partial(self.run, args.jasmin.absolute())
     self.javac = functools.partial(self.run, self.javac_path)
+    self.smali_path = args.smali.absolute()
+    self.rbe_rewrapper = args.rewrapper.absolute()
     self.smali = functools.partial(self.run, args.smali.absolute())
     self.soong_zip = functools.partial(self.run, args.soong_zip.absolute())
     self.zipalign = functools.partial(self.run, args.zipalign.absolute())
@@ -83,8 +92,11 @@
     # RBE wrapper for some of the tools.
     if "RBE_server_address" in os.environ and USE_RBE > (hash(self.test_name) % 100):
       self.rbe_exec_root = os.environ.get("RBE_exec_root")
-      self.rbe_rewrapper = self.android_build_top / "prebuilts/remoteexecution-client/live/rewrapper"
-      if self.test_name not in RBE_D8_DISABLED_FOR:
+
+      # TODO(b/307932183) Regression: RBE produces wrong output for D8 in ART
+      disable_d8 = any((self.test_dir / n).exists() for n in ["classes", "src2", "src-art"])
+
+      if self.test_name not in RBE_D8_DISABLED_FOR and not disable_d8:
         self.d8 = functools.partial(self.rbe_d8, args.d8.absolute())
       self.javac = functools.partial(self.rbe_javac, self.javac_path)
       self.smali = functools.partial(self.rbe_smali, args.smali.absolute())
@@ -114,6 +126,8 @@
   def run(self, executable: pathlib.Path, args: List[Union[pathlib.Path, str]]):
     assert isinstance(executable, pathlib.Path), executable
     cmd: List[Union[pathlib.Path, str]] = []
+    if REPORT_SLOW_COMMANDS:
+      cmd += ["/usr/bin/time"]
     if executable.suffix == ".sh":
       cmd += ["/bin/bash"]
     cmd += [executable]
@@ -136,6 +150,14 @@
                        env=self.bash_env,
                        stderr=subprocess.STDOUT,
                        stdout=subprocess.PIPE)
+    if REPORT_SLOW_COMMANDS:
+      m = re.search("([0-9\.]+)user", p.stdout)
+      assert m, p.stdout
+      t = float(m.group(1))
+      if t > 1.0:
+        cmd_text = " ".join(map(str, cmd[1:]))[:100]
+        print(f"[{self.test_name}] Command took {t:.2f}s: {cmd_text}")
+
     if p.returncode != 0:
       raise Exception("Command failed with exit code {}\n$ {}\n{}".format(
                       p.returncode, " ".join(map(str, cmd)), p.stdout))
@@ -144,6 +166,8 @@
   def rbe_wrap(self, args, inputs: Set[pathlib.Path]=None):
     with NamedTemporaryFile(mode="w+t") as input_list:
       inputs = inputs or set()
+      for i in inputs:
+        assert i.exists(), i
       for i, arg in enumerate(args):
         if isinstance(arg, pathlib.Path):
           assert arg.absolute(), arg
@@ -153,10 +177,11 @@
           inputs.update(arg)
       input_list.writelines([relpath(i, self.rbe_exec_root)+"\n" for i in inputs])
       input_list.flush()
+      dbg_args = ["-compare", "-num_local_reruns=1", "-num_remote_reruns=1"] if RBE_COMPARE else []
       return self.run(self.rbe_rewrapper, [
         "--platform=" + os.environ["RBE_platform"],
         "--input_list_paths=" + input_list.name,
-      ] + args)
+      ] + dbg_args + args)
 
   def rbe_javac(self, javac_path:Path, args):
     output = relpath(Path(args[args.index("-d") + 1]), self.rbe_exec_root)
@@ -171,12 +196,38 @@
       d8_path] + args, inputs)
 
   def rbe_smali(self, smali_path:Path, args):
-    inputs = set([smali_path.parent.parent / "framework/smali.jar"])
-    output = relpath(Path(args[args.index("--output") + 1]), self.rbe_exec_root)
-    return self.rbe_wrap([
-      "--output_files", output,
+    # The output of smali is non-deterministic, so create wrapper script,
+    # which runs D8 on the output to normalize it.
+    api = args[args.index("--api") + 1]
+    output = Path(args[args.index("--output") + 1])
+    wrapper = output.with_suffix(".sh")
+    wrapper.write_text('''
+      set -e
+      {smali} $@
+      mkdir dex_normalize
+      {d8} --min-api {api} --output dex_normalize {output}
+      cp dex_normalize/classes.dex {output}
+      rm -rf dex_normalize
+    '''.strip().format(
+      smali=relpath(self.smali_path, self.test_dir),
+      d8=relpath(self.d8_path, self.test_dir),
+      api=api,
+      output=relpath(output, self.test_dir),
+    ))
+
+    inputs = set([
+      wrapper,
+      self.smali_path,
+      self.smali_path.parent.parent / "framework/android-smali.jar",
+      self.d8_path,
+      self.d8_path.parent.parent / "framework/d8.jar",
+    ])
+    res = self.rbe_wrap([
+      "--output_files", relpath(output, self.rbe_exec_root),
       "--toolchain_inputs=prebuilts/jdk/jdk17/linux-x86/bin/java",
-      smali_path] + args, inputs)
+      "/bin/bash", wrapper] + args, inputs)
+    wrapper.unlink()
+    return res
 
   def build(self) -> None:
     script = self.test_dir / "build.py"
@@ -198,6 +249,7 @@
       javac_args=[],
       javac_classpath: List[Path]=[],
       d8_flags=[],
+      d8_dex_container=True,
       smali_args=[],
       use_smali=True,
       use_jasmin=True,
@@ -227,6 +279,7 @@
         "agents": 26,
         "method-handles": 26,
         "var-handles": 28,
+        "const-method-type": 28,
       }
       api_level = API_LEVEL[api_level]
     assert isinstance(api_level, int), api_level
@@ -258,8 +311,9 @@
     def make_smali(dst_dex: Path, src_dir: Path) -> Optional[Path]:
       if not use_smali or not src_dir.exists():
         return None  # No sources to compile.
-      self.smali(["-JXmx512m", "assemble"] + smali_args + ["--api", str(api_level)] +
-                 ["--output", dst_dex] + sorted(src_dir.glob("**/*.smali")))
+      p = self.smali(["-JXmx512m", "assemble"] + smali_args + ["--api", str(api_level)] +
+                     ["--output", dst_dex] + sorted(src_dir.glob("**/*.smali")))
+      assert dst_dex.exists(), p.stdout  # NB: smali returns 0 exit code even on failure.
       return dst_dex
 
     def make_java(dst_dir: Path, *src_dirs: Path) -> Optional[Path]:
@@ -286,7 +340,10 @@
     # packaged in a jar file.
     def make_dex(src_dir: Path):
       dst_jar = Path(src_dir.name + ".jar")
-      args = d8_flags + ["--min-api", str(api_level), "--output", dst_jar]
+      args = []
+      if d8_dex_container:
+        args += ["-JDcom.android.tools.r8.dexContainerExperiment"]
+      args += d8_flags + ["--min-api", str(api_level), "--output", dst_jar]
       args += ["--lib", self.bootclasspath] if use_desugar else ["--no-desugaring"]
       args += sorted(src_dir.glob("**/*.class"))
       self.d8(args)
@@ -309,7 +366,11 @@
       # It is useful to normalize non-deterministic smali output.
       tmp_dir = self.test_dir / "dexmerge"
       tmp_dir.mkdir()
-      self.d8(["--min-api", str(api_level), "--output", tmp_dir] + srcs)
+      flags = []
+      if d8_dex_container:
+        flags += ["-JDcom.android.tools.r8.dexContainerExperiment"]
+      flags += ["--min-api", str(api_level), "--output", tmp_dir]
+      self.d8(flags + srcs)
       assert not (tmp_dir / "classes2.dex").exists()
       for src_file in srcs:
         src_file.unlink()
@@ -478,15 +539,22 @@
   parser.add_argument("--d8", type=Path)
   parser.add_argument("--hiddenapi", type=Path)
   parser.add_argument("--jasmin", type=Path)
+  parser.add_argument("--rewrapper", type=Path)
   parser.add_argument("--smali", type=Path)
   parser.add_argument("--soong_zip", type=Path)
   parser.add_argument("--zipalign", type=Path)
+  parser.add_argument("--test-dir-regex")
   parser.add_argument("srcs", nargs="+", type=Path)
   args = parser.parse_args()
 
   android_build_top = Path(getcwd()).absolute()
   ziproot = args.out.absolute().parent / "zip"
-  srcdirs = set(s.parents[-4].absolute() for s in args.srcs)
+  test_dir_regex = re.compile(args.test_dir_regex) if args.test_dir_regex else re.compile(".*")
+  srcdirs = set(
+    s.parents[-4].absolute()
+    for s in args.srcs
+    if test_dir_regex.search(str(s))
+  )
 
   # Special hidden-api shard: If the --hiddenapi flag is provided, build only
   # hiddenapi tests. Otherwise exclude all hiddenapi tests from normal shards.
diff --git a/test/testrunner/env.py b/test/testrunner/env.py
index 44d0db6..de24b4c 100644
--- a/test/testrunner/env.py
+++ b/test/testrunner/env.py
@@ -24,7 +24,7 @@
 
 import sys
 sys.path.append(_VAR_CACHE_DIR)
-import var_cache
+import var_cache  # type: ignore
 # end import var_cache.py
 
 _env = dict(os.environ)
@@ -148,4 +148,16 @@
 ART_TEST_RUN_ON_ARM_FVP = _getEnvBoolean('ART_TEST_RUN_ON_ARM_FVP', False)
 
 ART_TEST_ON_VM = _env.get('ART_TEST_ON_VM')
-ART_SSH_CMD = _env.get('ART_SSH_CMD')
+
+ART_TEST_SSH_PORT = _env.get('ART_TEST_SSH_PORT', 10001)
+ART_TEST_SSH_USER = _env.get('ART_TEST_SSH_USER', 'ubuntu')
+ART_TEST_SSH_HOST = _env.get('ART_TEST_SSH_HOST', 'localhost')
+ART_SSH_CONFIG = os.path.join(os.path.dirname(__file__), 'ssh_config')
+ART_SSH_CMD = _env.get('ART_SSH_CMD', f"ssh -q -F {ART_SSH_CONFIG} -p {ART_TEST_SSH_PORT} "
+                                      f"{ART_TEST_SSH_USER}@{ART_TEST_SSH_HOST}")
+ART_SCP_CMD = _env.get('ART_SCP_CMD', f"scp -q -F {ART_SSH_CONFIG} -P {ART_TEST_SSH_PORT} -p -r")
+ART_CHROOT_CMD = _env.get('ART_CHROOT_CMD', "unshare --user --map-root-user chroot art-test-chroot")
+if ART_TEST_ON_VM:
+  ART_TEST_CHROOT = _env.get('ART_TEST_CHROOT', f"/home/{ART_TEST_SSH_USER}/art-test-chroot")
+else:
+  ART_TEST_CHROOT = _env.get('ART_TEST_CHROOT', "/data/local/art-test-chroot")
diff --git a/test/testrunner/run_build_test_target.py b/test/testrunner/run_build_test_target.py
index d271b80..551e8da 100755
--- a/test/testrunner/run_build_test_target.py
+++ b/test/testrunner/run_build_test_target.py
@@ -66,7 +66,6 @@
 n_threads = options.n_threads
 custom_env = target.get('env', {})
 custom_env['SOONG_ALLOW_MISSING_DEPENDENCIES'] = 'true'
-custom_env['BUILD_BROKEN_DISABLE_BAZEL'] = 'true'
 # Switch the build system to unbundled mode in the reduced manifest branch.
 if not os.path.isdir(env.ANDROID_BUILD_TOP + '/frameworks/base'):
   custom_env['TARGET_BUILD_UNBUNDLED'] = 'true'
diff --git a/test/testrunner/ssh_config b/test/testrunner/ssh_config
new file mode 100644
index 0000000..6d847e9
--- /dev/null
+++ b/test/testrunner/ssh_config
@@ -0,0 +1,6 @@
+Host *
+    IdentityFile ~/.ssh/ubuntu
+    StrictHostKeyChecking no
+    ControlMaster auto
+    ControlPersist 10m
+    ControlPath /run/user/%i/ssh-%C
diff --git a/test/testrunner/target_config.py b/test/testrunner/target_config.py
index eaf33b7..38c170d 100644
--- a/test/testrunner/target_config.py
+++ b/test/testrunner/target_config.py
@@ -306,19 +306,4 @@
     'art-golem-linux-x64': {
         'golem' : 'linux-x64'
     },
-    'art-linux-bionic-x64': {
-        'build': '{ANDROID_BUILD_TOP}/art/tools/build_linux_bionic_tests.sh {MAKE_OPTIONS}',
-        'run-test': ['--run-test-option=--bionic',
-                     '--host',
-                     '--64',
-                     '--no-build-dependencies'],
-    },
-    'art-linux-bionic-x64-zipapex': {
-        'build': '{ANDROID_BUILD_TOP}/art/tools/build_linux_bionic_tests.sh {MAKE_OPTIONS} com.android.art.host',
-        'run-test': ['--run-test-option=--bionic',
-                     "--runtime-zipapex={SOONG_OUT_DIR}/host/linux_bionic-x86/apex/com.android.art.host.zipapex",
-                     '--host',
-                     '--64',
-                     '--no-build-dependencies'],
-    },
 }
diff --git a/test/testrunner/testrunner.py b/test/testrunner/testrunner.py
index 4499ffd..ab1098e 100755
--- a/test/testrunner/testrunner.py
+++ b/test/testrunner/testrunner.py
@@ -60,7 +60,6 @@
   sys.stdout.flush()
   raise
 
-import contextlib
 import csv
 import datetime
 import fnmatch
@@ -81,6 +80,8 @@
 import env
 from target_config import target_config
 from device_config import device_config
+from typing import Dict, Set, List
+from functools import lru_cache
 
 # TODO: make it adjustable per tests and for buildbots
 #
@@ -105,13 +106,13 @@
 # The Dict contains the list of all possible variants for a given type. For example,
 # for key TARGET, the value would be target and host. The list is used to parse
 # the test name given as the argument to run.
-VARIANT_TYPE_DICT = {}
+VARIANT_TYPE_DICT: Dict[str, Set[str]] = {}
 
 # The set of all variant sets that are incompatible and will always be skipped.
 NONFUNCTIONAL_VARIANT_SETS = set()
 
 # The set contains all the variants of each time.
-TOTAL_VARIANTS_SET = set()
+TOTAL_VARIANTS_SET: Set[str] = set()
 
 # The colors are used in the output. When a test passes, COLOR_PASS is used,
 # and so on.
@@ -143,19 +144,18 @@
 csv_result = None
 csv_writer = None
 runtime_option = ''
-with_agent = []
-zipapex_loc = None
-run_test_option = []
+with_agent: List[str] = []
+run_test_option: List[str] = []
 dex2oat_jobs = -1   # -1 corresponds to default threads for dex2oat
 run_all_configs = False
 
 # Dict containing extra arguments
-extra_arguments = { "host" : [], "target" : [] }
+extra_arguments: Dict[str, List[str]] = { "host" : [], "target" : [] }
 
 # Dict to store user requested test variants.
 # key: variant_type.
 # value: set of variants user wants to run of type <key>.
-_user_input_variants = collections.defaultdict(set)
+_user_input_variants: collections.defaultdict = collections.defaultdict(set)
 
 
 class ChildProcessTracker(object):
@@ -243,11 +243,7 @@
   VARIANT_TYPE_DICT['jvmti'] = {'no-jvmti', 'jvmti-stress', 'redefine-stress', 'trace-stress',
                                 'field-stress', 'step-stress'}
   VARIANT_TYPE_DICT['compiler'] = {'interp-ac', 'interpreter', 'jit', 'jit-on-first-use',
-                                   'optimizing', 'regalloc_gc',
-                                   'speed-profile', 'baseline'}
-
-  # Regalloc_GC cannot work with prebuild.
-  NONFUNCTIONAL_VARIANT_SETS.add(frozenset({'regalloc_gc', 'prebuild'}))
+                                   'optimizing', 'speed-profile', 'baseline'}
 
   for v_type in VARIANT_TYPE_DICT:
     TOTAL_VARIANTS_SET = TOTAL_VARIANTS_SET.union(VARIANT_TYPE_DICT.get(v_type))
@@ -320,7 +316,8 @@
     device_name = get_device_name()
     if n_thread == 0:
       # Use only part of the cores since fully loading the device tends to lead to timeouts.
-      n_thread = max(1, int(get_target_cpu_count() * 0.75))
+      fraction = 1.0 if env.ART_TEST_ON_VM else 0.75
+      n_thread = max(1, int(get_target_cpu_count() * fraction))
       if device_name == 'fugu':
         n_thread = 1
   else:
@@ -387,7 +384,7 @@
   Args:
     tests: The set of tests to be run.
   """
-  options_all = ''
+  args_all = []
 
   # jvm does not run with all these combinations,
   # or at least it doesn't make sense for most of them.
@@ -412,37 +409,37 @@
   total_test_count *= target_address_combinations
 
   if env.ART_TEST_WITH_STRACE:
-    options_all += ' --strace'
+    args_all += ['--strace']
 
   if env.ART_TEST_RUN_TEST_ALWAYS_CLEAN:
-    options_all += ' --always-clean'
+    args_all += ['--always-clean']
 
   if env.ART_TEST_BISECTION:
-    options_all += ' --bisection-search'
+    args_all += ['--bisection-search']
 
   if gdb:
-    options_all += ' --gdb'
+    args_all += ['--gdb']
     if gdb_arg:
-      options_all += ' --gdb-arg ' + gdb_arg
+      args_all += ['--gdb-arg', gdb_arg]
 
   if dump_cfg:
-    options_all += ' --dump-cfg ' + dump_cfg
+    args_all += ['--dump-cfg', dump_cfg]
   if gdb_dex2oat:
-    options_all += ' --gdb-dex2oat'
+    args_all += ['--gdb-dex2oat']
     if gdb_dex2oat_args:
-      options_all += ' --gdb-dex2oat-args ' + gdb_dex2oat_args
+      args_all += ['--gdb-dex2oat-args', f'{gdb_dex2oat_args}']
 
-  options_all += ' ' + ' '.join(run_test_option)
+  args_all += run_test_option
 
   if runtime_option:
     for opt in runtime_option:
-      options_all += ' --runtime-option ' + opt
+      args_all += ['--runtime-option', opt]
   if with_agent:
     for opt in with_agent:
-      options_all += ' --with-agent ' + opt
+      args_all += ['--with-agent', opt]
 
   if dex2oat_jobs != -1:
-    options_all += ' --dex2oat-jobs ' + str(dex2oat_jobs)
+    args_all += ['--dex2oat-jobs', str(dex2oat_jobs)]
 
   def iter_config(tests, input_variants, user_input_variants):
     config = itertools.product(tests, input_variants, user_input_variants['run'],
@@ -491,161 +488,139 @@
       variant_set = {target, run, prebuild, compiler, relocate, trace, gc, jni,
                      image, debuggable, jvmti, cdex_level, address_size}
 
-      options_test = global_options
+      args_test = global_options.copy()
 
       if target == 'host':
-        options_test += ' --host'
+        args_test += ['--host']
       elif target == 'jvm':
-        options_test += ' --jvm'
+        args_test += ['--jvm']
 
       # Honor ART_TEST_CHROOT, ART_TEST_ANDROID_ROOT, ART_TEST_ANDROID_ART_ROOT,
       # ART_TEST_ANDROID_I18N_ROOT, and ART_TEST_ANDROID_TZDATA_ROOT but only
       # for target tests.
       if target == 'target':
         if env.ART_TEST_CHROOT:
-          options_test += ' --chroot ' + env.ART_TEST_CHROOT
+          args_test += ['--chroot', env.ART_TEST_CHROOT]
         if env.ART_TEST_ANDROID_ROOT:
-          options_test += ' --android-root ' + env.ART_TEST_ANDROID_ROOT
+          args_test += ['--android-root', env.ART_TEST_ANDROID_ROOT]
         if env.ART_TEST_ANDROID_I18N_ROOT:
-            options_test += ' --android-i18n-root ' + env.ART_TEST_ANDROID_I18N_ROOT
+            args_test += ['--android-i18n-root', env.ART_TEST_ANDROID_I18N_ROOT]
         if env.ART_TEST_ANDROID_ART_ROOT:
-          options_test += ' --android-art-root ' + env.ART_TEST_ANDROID_ART_ROOT
+          args_test += ['--android-art-root', env.ART_TEST_ANDROID_ART_ROOT]
         if env.ART_TEST_ANDROID_TZDATA_ROOT:
-          options_test += ' --android-tzdata-root ' + env.ART_TEST_ANDROID_TZDATA_ROOT
+          args_test += ['--android-tzdata-root', env.ART_TEST_ANDROID_TZDATA_ROOT]
 
       if run == 'ndebug':
-        options_test += ' -O'
+        args_test += ['-O']
 
       if prebuild == 'prebuild':
-        options_test += ' --prebuild'
+        args_test += ['--prebuild']
       elif prebuild == 'no-prebuild':
-        options_test += ' --no-prebuild'
+        args_test += ['--no-prebuild']
 
       if cdex_level:
         # Add option and remove the cdex- prefix.
-        options_test += ' --compact-dex-level ' + cdex_level.replace('cdex-','')
+        args_test += ['--compact-dex-level', cdex_level.replace('cdex-','')]
 
       if compiler == 'optimizing':
-        options_test += ' --optimizing'
-      elif compiler == 'regalloc_gc':
-        options_test += ' --optimizing -Xcompiler-option --register-allocation-strategy=graph-color'
+        args_test += ['--optimizing']
       elif compiler == 'interpreter':
-        options_test += ' --interpreter'
+        args_test += ['--interpreter']
       elif compiler == 'interp-ac':
-        options_test += ' --interpreter --verify-soft-fail'
+        args_test += ['--switch-interpreter', '--verify-soft-fail']
       elif compiler == 'jit':
-        options_test += ' --jit'
+        args_test += ['--jit']
       elif compiler == 'jit-on-first-use':
-        options_test += ' --jit --runtime-option -Xjitthreshold:0'
+        args_test += ['--jit', '--runtime-option', '-Xjitthreshold:0']
       elif compiler == 'speed-profile':
-        options_test += ' --random-profile'
+        args_test += ['--random-profile']
       elif compiler == 'baseline':
-        options_test += ' --baseline'
+        args_test += ['--baseline']
 
       if relocate == 'relocate':
-        options_test += ' --relocate'
+        args_test += ['--relocate']
       elif relocate == 'no-relocate':
-        options_test += ' --no-relocate'
+        args_test += ['--no-relocate']
 
       if trace == 'trace':
-        options_test += ' --trace'
+        args_test += ['--trace']
       elif trace == 'stream':
-        options_test += ' --trace --stream'
+        args_test += ['--trace', '--stream']
 
       if gc == 'gcverify':
-        options_test += ' --gcverify'
+        args_test += ['--gcverify']
       elif gc == 'gcstress':
-        options_test += ' --gcstress'
+        args_test += ['--gcstress']
 
       if jni == 'forcecopy':
-        options_test += ' --runtime-option -Xjniopts:forcecopy'
+        args_test += ['--runtime-option', '-Xjniopts:forcecopy']
       elif jni == 'checkjni':
-        options_test += ' --runtime-option -Xcheck:jni'
+        args_test += ['--runtime-option', '-Xcheck:jni']
 
       if image == 'no-image':
-        options_test += ' --no-image'
+        args_test += ['--no-image']
 
       if debuggable == 'debuggable':
-        options_test += ' --debuggable --runtime-option -Xopaque-jni-ids:true'
+        args_test += ['--debuggable', '--runtime-option', '-Xopaque-jni-ids:true']
 
       if jvmti == 'jvmti-stress':
-        options_test += ' --jvmti-trace-stress --jvmti-redefine-stress --jvmti-field-stress'
+        args_test += ['--jvmti-trace-stress', '--jvmti-redefine-stress', '--jvmti-field-stress']
       elif jvmti == 'field-stress':
-        options_test += ' --jvmti-field-stress'
+        args_test += ['--jvmti-field-stress']
       elif jvmti == 'trace-stress':
-        options_test += ' --jvmti-trace-stress'
+        args_test += ['--jvmti-trace-stress']
       elif jvmti == 'redefine-stress':
-        options_test += ' --jvmti-redefine-stress'
+        args_test += ['--jvmti-redefine-stress']
       elif jvmti == 'step-stress':
-        options_test += ' --jvmti-step-stress'
+        args_test += ['--jvmti-step-stress']
 
       if address_size == '64':
-        options_test += ' --64'
+        args_test += ['--64']
 
       # b/36039166: Note that the path lengths must kept reasonably short.
       temp_path = tempfile.mkdtemp(dir=env.ART_HOST_TEST_DIR)
-      options_test = '--temp-path {} '.format(temp_path) + options_test
+      args_test = ['--temp-path', temp_path] + args_test
 
       # Run the run-test script using the prebuilt python.
       python3_bin = env.ANDROID_BUILD_TOP + "/prebuilts/build-tools/path/linux-x86/python3"
-      run_test_sh = python3_bin + ' ' + env.ANDROID_BUILD_TOP + '/art/test/run-test'
-      command = ' '.join((run_test_sh, options_test, ' '.join(extra_arguments[target]), test))
-      return executor.submit(run_test, command, test, variant_set, test_name)
+      run_test_sh = env.ANDROID_BUILD_TOP + '/art/test/run-test'
+      args_test = [python3_bin, run_test_sh] + args_test + extra_arguments[target] + [test]
+      return executor.submit(run_test, args_test, test, variant_set, test_name)
 
-  #  Use a context-manager to handle cleaning up the extracted zipapex if needed.
-  with handle_zipapex(zipapex_loc) as zipapex_opt:
-    options_all += zipapex_opt
-    global n_thread
-    with concurrent.futures.ThreadPoolExecutor(max_workers=n_thread) as executor:
-      test_futures = []
-      for config_tuple in config:
-        target = config_tuple[1]
-        for address_size in _user_input_variants['address_sizes_target'][target]:
-          test_futures.append(start_combination(executor, config_tuple, options_all, address_size))
+  global n_thread
+  with concurrent.futures.ThreadPoolExecutor(max_workers=n_thread) as executor:
+    test_futures = []
+    for config_tuple in config:
+      target = config_tuple[1]
+      for address_size in _user_input_variants['address_sizes_target'][target]:
+        test_futures.append(start_combination(executor, config_tuple, args_all, address_size))
 
-      for config_tuple in uncombinated_config:
-        test_futures.append(
-            start_combination(executor, config_tuple, options_all, ""))  # no address size
+    for config_tuple in uncombinated_config:
+      test_futures.append(
+          start_combination(executor, config_tuple, args_all, ""))  # no address size
 
-      try:
-        tests_done = 0
-        for test_future in concurrent.futures.as_completed(f for f in test_futures if f):
-          (test, status, failure_info, test_time) = test_future.result()
-          tests_done += 1
-          print_test_info(tests_done, test, status, failure_info, test_time)
-          if failure_info and not env.ART_TEST_KEEP_GOING:
-            for f in test_futures:
-              f.cancel()
-            break
-      except KeyboardInterrupt:
-        for f in test_futures:
-          f.cancel()
-        child_process_tracker.kill_all()
-      executor.shutdown(True)
-
-@contextlib.contextmanager
-def handle_zipapex(ziploc):
-  """Extracts the zipapex (if present) and handles cleanup.
-
-  If we are running out of a zipapex we want to unzip it once and have all the tests use the same
-  extracted contents. This extracts the files and handles cleanup if needed. It returns the
-  required extra arguments to pass to the run-test.
-  """
-  if ziploc is not None:
-    with tempfile.TemporaryDirectory() as tmpdir:
-      subprocess.check_call(["unzip", "-qq", ziploc, "apex_payload.zip", "-d", tmpdir])
-      subprocess.check_call(
-        ["unzip", "-qq", os.path.join(tmpdir, "apex_payload.zip"), "-d", tmpdir])
-      yield " --runtime-extracted-zipapex " + tmpdir
-  else:
-    yield ""
+    try:
+      tests_done = 0
+      for test_future in concurrent.futures.as_completed(f for f in test_futures if f):
+        (test, status, failure_info, test_time) = test_future.result()
+        tests_done += 1
+        print_test_info(tests_done, test, status, failure_info, test_time)
+        if failure_info and not env.ART_TEST_KEEP_GOING:
+          for f in test_futures:
+            f.cancel()
+          break
+    except KeyboardInterrupt:
+      for f in test_futures:
+        f.cancel()
+      child_process_tracker.kill_all()
+    executor.shutdown(True)
 
 def _popen(**kwargs):
   if sys.version_info.major == 3 and sys.version_info.minor >= 6:
     return subprocess.Popen(encoding=sys.stdout.encoding, **kwargs)
   return subprocess.Popen(**kwargs)
 
-def run_test(command, test, test_variant, test_name):
+def run_test(args, test, test_variant, test_name):
   """Runs the test.
 
   It invokes art/test/run-test script to run the test. The output of the script
@@ -656,7 +631,7 @@
   tests.
 
   Args:
-    command: The command to be used to invoke the script
+    args: The command to be used to invoke the script
     test: The name of the test without the variant information.
     test_variant: The set of variant for the test.
     test_name: The name of the test along with the variants.
@@ -664,6 +639,8 @@
   Returns: a tuple of testname, status, optional failure info, and test time.
   """
   try:
+    command = ' '.join(args)
+
     if is_test_disabled(test, test_variant):
       test_skipped = True
       test_time = datetime.timedelta()
@@ -672,20 +649,20 @@
       test_start_time = time.monotonic()
       if verbose:
         print_text("Starting %s at %s\n" % (test_name, test_start_time))
-      env = dict(os.environ)
-      env["FULL_TEST_NAME"] = test_name
+      environ = dict(os.environ)
+      environ["FULL_TEST_NAME"] = test_name
       if gdb or gdb_dex2oat:
         proc = _popen(
-          args=command.split(),
-          env=env,
+          args=args,
+          env=environ,
           stderr=subprocess.STDOUT,
           universal_newlines=True,
           start_new_session=True
         )
       else:
         proc = _popen(
-          args=command.split(),
-          env=env,
+          args=args,
+          env=environ,
           stderr=subprocess.STDOUT,
           stdout = subprocess.PIPE,
           universal_newlines=True,
@@ -742,6 +719,12 @@
     failed_tests.append((test_name, str(e)))
     return (test_name, 'FAIL', ('%s\n%s\n\n') % (command, str(e)), datetime.timedelta())
 
+@lru_cache
+def get_console_width(default=100):
+  # NB: The command may fail if we are running under 'nohup'.
+  proc = subprocess.run(['stty', 'size'], capture_output=True)
+  return int(proc.stdout.decode("utf8").split()[1]) if proc.returncode == 0 else default
+
 def print_test_info(test_count, test_name, result, failed_test_info="",
                     test_time=datetime.timedelta()):
   """Print the continous test information
@@ -763,8 +746,7 @@
     # Without --verbose, the testrunner erases passing test info. It
     # does that by overriding the printed text with white spaces all across
     # the console width.
-    console_width = int(os.popen('stty size', 'r').read().split()[1])
-    info = '\r' + ' ' * console_width + '\r'
+    info = '\r' + ' ' * get_console_width() + '\r'
   try:
     percent = (test_count * 100) / total_test_count
     progress_info = ('[ %d%% %d/%d ]') % (
@@ -803,7 +785,7 @@
         total_output_length = 2 # Two spaces
         total_output_length += len(progress_info)
         total_output_length += len(result)
-        allowed_test_length = console_width - total_output_length
+        allowed_test_length = get_console_width() - total_output_length
         test_name_len = len(test_name)
         if allowed_test_length < test_name_len:
           test_name = ('...%s') % (
@@ -827,7 +809,6 @@
       'variant' : (str,),
       'devices': (list, str),
       'env_vars' : (dict,),
-      'zipapex' : (bool,),
   }
   for field in entry:
     field_type = type(entry[field])
@@ -888,16 +869,6 @@
         else:
           disabled_test_info[test] = variants
 
-    zipapex_disable = failure.get("zipapex", False)
-    if zipapex_disable and zipapex_loc is not None:
-      for test in tests:
-        if test not in RUN_TEST_SET:
-          raise ValueError('%s is not a valid run-test' % (test))
-        if test in disabled_test_info:
-          disabled_test_info[test] = disabled_test_info[test].union(variants)
-        else:
-          disabled_test_info[test] = variants
-
   return disabled_test_info
 
 def gather_disabled_test_info():
@@ -982,8 +953,7 @@
     # Without --verbose, the testrunner erases passing test info. It
     # does that by overriding the printed text with white spaces all across
     # the console width.
-    console_width = int(os.popen('stty size', 'r').read().split()[1])
-    eraser_text = '\r' + ' ' * console_width + '\r'
+    eraser_text = '\r' + ' ' * get_console_width() + '\r'
     print_text(eraser_text)
 
   # Prints information about the total tests run.
@@ -1114,7 +1084,6 @@
   global dex2oat_jobs
   global run_all_configs
   global with_agent
-  global zipapex_loc
   global csv_result
 
   parser = argparse.ArgumentParser(description="Runs all or a subset of the ART test suite.")
@@ -1168,8 +1137,6 @@
                             example '--runtime-option=-Xjitthreshold:0'.""")
   global_group.add_argument('--dex2oat-jobs', type=int, dest='dex2oat_jobs',
                             help='Number of dex2oat jobs')
-  global_group.add_argument('--runtime-zipapex', dest='runtime_zipapex', default=None,
-                            help='Location for runtime zipapex.')
   global_group.add_argument('-a', '--all', action='store_true', dest='run_all',
                             help="Run all the possible configurations for the input test set")
   global_group.add_argument('--csv-results', action='store', dest='csv_result', default=None,
@@ -1233,7 +1200,6 @@
   runtime_option = options['runtime_option'];
   with_agent = options['with_agent'];
   run_test_option = sum(map(shlex.split, options['run_test_option']), [])
-  zipapex_loc = options['runtime_zipapex']
 
   timeout = options['timeout']
   if options['dex2oat_jobs']:
diff --git a/test/ti-agent/agent_startup.cc b/test/ti-agent/agent_startup.cc
index d6fd266..5ebc78a 100644
--- a/test/ti-agent/agent_startup.cc
+++ b/test/ti-agent/agent_startup.cc
@@ -26,13 +26,13 @@
 
 // Utility functions for binding jni methods.
 extern "C" JNIEXPORT void JNICALL Java_art_Main_bindAgentJNI(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jstring className, jobject classLoader) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jstring className, jobject classLoader) {
   ScopedUtfChars name(env, className);
   BindFunctions(jvmti_env, env, name.c_str(), classLoader);
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Main_bindAgentJNIForClass(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jclass bindClass) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jclass bindClass) {
   BindFunctionsOnClass(jvmti_env, env, bindClass);
 }
 
diff --git a/test/ti-agent/breakpoint_helper.cc b/test/ti-agent/breakpoint_helper.cc
index 83ba0a6..19134ce 100644
--- a/test/ti-agent/breakpoint_helper.cc
+++ b/test/ti-agent/breakpoint_helper.cc
@@ -60,7 +60,7 @@
 
 extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Breakpoint_getLineNumberTableNative(
     JNIEnv* env,
-    jclass k ATTRIBUTE_UNUSED,
+    [[maybe_unused]] jclass k,
     jobject target) {
   jmethodID method = env->FromReflectedMethod(target);
   if (env->ExceptionCheck()) {
@@ -107,7 +107,7 @@
 }
 
 extern "C" JNIEXPORT jlong JNICALL Java_art_Breakpoint_getStartLocation(JNIEnv* env,
-                                                                        jclass k ATTRIBUTE_UNUSED,
+                                                                        [[maybe_unused]] jclass k,
                                                                         jobject target) {
   jmethodID method = env->FromReflectedMethod(target);
   if (env->ExceptionCheck()) {
@@ -120,7 +120,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Breakpoint_clearBreakpoint(JNIEnv* env,
-                                                                      jclass k ATTRIBUTE_UNUSED,
+                                                                      [[maybe_unused]] jclass k,
                                                                       jobject target,
                                                                       jlocation location) {
   jmethodID method = env->FromReflectedMethod(target);
@@ -131,7 +131,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Breakpoint_setBreakpoint(JNIEnv* env,
-                                                                    jclass k ATTRIBUTE_UNUSED,
+                                                                    [[maybe_unused]] jclass k,
                                                                     jobject target,
                                                                     jlocation location) {
   jmethodID method = env->FromReflectedMethod(target);
@@ -143,7 +143,7 @@
 
 extern "C" JNIEXPORT void JNICALL Java_art_Breakpoint_startBreakpointWatch(
     JNIEnv* env,
-    jclass k ATTRIBUTE_UNUSED,
+    [[maybe_unused]] jclass k,
     jclass method_klass,
     jobject method,
     jboolean allow_recursive,
@@ -190,7 +190,7 @@
 
 extern "C" JNIEXPORT void JNICALL Java_art_Breakpoint_stopBreakpointWatch(
     JNIEnv* env,
-    jclass k ATTRIBUTE_UNUSED,
+    [[maybe_unused]] jclass k,
     jthread thr) {
   if (JvmtiErrorToException(env, jvmti_env,
                             jvmti_env->SetEventNotificationMode(JVMTI_DISABLE,
diff --git a/test/ti-agent/common_load.cc b/test/ti-agent/common_load.cc
index ff8b3a8..1f35aa0 100644
--- a/test/ti-agent/common_load.cc
+++ b/test/ti-agent/common_load.cc
@@ -58,8 +58,8 @@
 
 // A trivial OnLoad implementation that only initializes the global jvmti_env.
 static jint MinimalOnLoad(JavaVM* vm,
-                          char* options ATTRIBUTE_UNUSED,
-                          void* reserved ATTRIBUTE_UNUSED) {
+                          [[maybe_unused]] char* options,
+                          [[maybe_unused]] void* reserved) {
   if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0) != 0) {
     printf("Unable to get jvmti env!\n");
     return 1;
diff --git a/test/ti-agent/early_return_helper.cc b/test/ti-agent/early_return_helper.cc
index e4aa5d0..df2703e 100644
--- a/test/ti-agent/early_return_helper.cc
+++ b/test/ti-agent/early_return_helper.cc
@@ -27,37 +27,37 @@
 namespace common_early_return {
 
 extern "C" JNIEXPORT void JNICALL Java_art_NonStandardExit_popFrame(
-    JNIEnv* env, jclass k ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass k, jthread thr) {
   JvmtiErrorToException(env, jvmti_env, jvmti_env->PopFrame(thr));
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_NonStandardExit_forceEarlyReturnFloat(
-    JNIEnv* env, jclass k ATTRIBUTE_UNUSED, jthread thr, jfloat val) {
+    JNIEnv* env, [[maybe_unused]] jclass k, jthread thr, jfloat val) {
   JvmtiErrorToException(env, jvmti_env, jvmti_env->ForceEarlyReturnFloat(thr, val));
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_NonStandardExit_forceEarlyReturnDouble(
-    JNIEnv* env, jclass k ATTRIBUTE_UNUSED, jthread thr, jdouble val) {
+    JNIEnv* env, [[maybe_unused]] jclass k, jthread thr, jdouble val) {
   JvmtiErrorToException(env, jvmti_env, jvmti_env->ForceEarlyReturnDouble(thr, val));
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_NonStandardExit_forceEarlyReturnLong(
-    JNIEnv* env, jclass k ATTRIBUTE_UNUSED, jthread thr, jlong val) {
+    JNIEnv* env, [[maybe_unused]] jclass k, jthread thr, jlong val) {
   JvmtiErrorToException(env, jvmti_env, jvmti_env->ForceEarlyReturnLong(thr, val));
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_NonStandardExit_forceEarlyReturnInt(
-    JNIEnv* env, jclass k ATTRIBUTE_UNUSED, jthread thr, jint val) {
+    JNIEnv* env, [[maybe_unused]] jclass k, jthread thr, jint val) {
   JvmtiErrorToException(env, jvmti_env, jvmti_env->ForceEarlyReturnInt(thr, val));
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_NonStandardExit_forceEarlyReturnVoid(
-    JNIEnv* env, jclass k ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass k, jthread thr) {
   JvmtiErrorToException(env, jvmti_env, jvmti_env->ForceEarlyReturnVoid(thr));
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_NonStandardExit_forceEarlyReturnObject(
-    JNIEnv* env, jclass k ATTRIBUTE_UNUSED, jthread thr, jobject val) {
+    JNIEnv* env, [[maybe_unused]] jclass k, jthread thr, jobject val) {
   JvmtiErrorToException(env, jvmti_env, jvmti_env->ForceEarlyReturnObject(thr, val));
 }
 
diff --git a/test/ti-agent/exceptions_helper.cc b/test/ti-agent/exceptions_helper.cc
index e56c39b..6095c2e 100644
--- a/test/ti-agent/exceptions_helper.cc
+++ b/test/ti-agent/exceptions_helper.cc
@@ -107,7 +107,7 @@
 
 extern "C" JNIEXPORT void JNICALL Java_art_Exceptions_setupExceptionTracing(
     JNIEnv* env,
-    jclass exception ATTRIBUTE_UNUSED,
+    [[maybe_unused]] jclass exception,
     jclass klass,
     jclass except,
     jobject exception_event,
@@ -158,7 +158,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Exceptions_enableExceptionCatchEvent(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jthread thr) {
   JvmtiErrorToException(env,
                         jvmti_env,
                         jvmti_env->SetEventNotificationMode(JVMTI_ENABLE,
@@ -167,7 +167,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Exceptions_enableExceptionEvent(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jthread thr) {
   JvmtiErrorToException(env,
                         jvmti_env,
                         jvmti_env->SetEventNotificationMode(JVMTI_ENABLE,
@@ -176,7 +176,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Exceptions_disableExceptionCatchEvent(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jthread thr) {
   JvmtiErrorToException(env,
                         jvmti_env,
                         jvmti_env->SetEventNotificationMode(JVMTI_DISABLE,
@@ -185,7 +185,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Exceptions_disableExceptionEvent(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jthread thr) {
   JvmtiErrorToException(env,
                         jvmti_env,
                         jvmti_env->SetEventNotificationMode(JVMTI_DISABLE,
diff --git a/test/ti-agent/frame_pop_helper.cc b/test/ti-agent/frame_pop_helper.cc
index f39e185..45f3a06 100644
--- a/test/ti-agent/frame_pop_helper.cc
+++ b/test/ti-agent/frame_pop_helper.cc
@@ -34,7 +34,7 @@
 static void framePopCB(jvmtiEnv* jvmti,
                        JNIEnv* jnienv,
                        jthread thr,
-                       jmethodID method ATTRIBUTE_UNUSED,
+                       [[maybe_unused]] jmethodID method,
                        jboolean was_popped_by_exception) {
   FramePopData* data = nullptr;
   if (JvmtiErrorToException(jnienv, jvmti,
diff --git a/test/ti-agent/redefinition_helper.cc b/test/ti-agent/redefinition_helper.cc
index 706531e..2a34e9f 100644
--- a/test/ti-agent/redefinition_helper.cc
+++ b/test/ti-agent/redefinition_helper.cc
@@ -45,6 +45,15 @@
                                          jint num_targets,
                                          jclass* target,
                                          jvmtiError res) {
+  // Get the last error message which might give more details on what went wrong.
+  using GetLastError = jvmtiError (*)(jvmtiEnv* env, char** msg);
+  GetLastError get_last_error =
+      GetExtensionFunction<GetLastError>(env, jvmti, "com.android.art.misc.get_last_error_message");
+  char* error_msg = nullptr;
+  if (get_last_error != nullptr) {
+    get_last_error(jvmti_env, &error_msg);
+  }
+
   std::stringstream err;
   char* error = nullptr;
   jvmti->GetErrorName(res, &error);
@@ -65,8 +74,12 @@
     jvmti->Deallocate(reinterpret_cast<unsigned char*>(generic));
   }
   err << "> due to " << error;
+  if (error_msg != nullptr) {
+    err << " (" << error_msg << ")";
+  }
   std::string message = err.str();
   jvmti->Deallocate(reinterpret_cast<unsigned char*>(error));
+  jvmti->Deallocate(reinterpret_cast<unsigned char*>(error_msg));
   env->ThrowNew(env->FindClass("java/lang/Exception"), message.c_str());
 }
 
@@ -259,8 +272,8 @@
 
 // Get all capabilities except those related to retransformation.
 jint OnLoad(JavaVM* vm,
-            char* options ATTRIBUTE_UNUSED,
-            void* reserved ATTRIBUTE_UNUSED) {
+            [[maybe_unused]] char* options,
+            [[maybe_unused]] void* reserved) {
   if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) {
     printf("Unable to get jvmti env!\n");
     return 1;
@@ -322,13 +335,13 @@
 
 // The hook we are using.
 void JNICALL CommonClassFileLoadHookRetransformable(jvmtiEnv* jvmti_env,
-                                                    JNIEnv* jni_env ATTRIBUTE_UNUSED,
-                                                    jclass class_being_redefined ATTRIBUTE_UNUSED,
-                                                    jobject loader ATTRIBUTE_UNUSED,
+                                                    [[maybe_unused]] JNIEnv* jni_env,
+                                                    [[maybe_unused]] jclass class_being_redefined,
+                                                    [[maybe_unused]] jobject loader,
                                                     const char* name,
-                                                    jobject protection_domain ATTRIBUTE_UNUSED,
-                                                    jint class_data_len ATTRIBUTE_UNUSED,
-                                                    const unsigned char* class_dat ATTRIBUTE_UNUSED,
+                                                    [[maybe_unused]] jobject protection_domain,
+                                                    [[maybe_unused]] jint class_data_len,
+                                                    [[maybe_unused]] const unsigned char* class_dat,
                                                     jint* new_class_data_len,
                                                     unsigned char** new_class_data) {
   std::string name_str(name);
@@ -435,8 +448,8 @@
 
 // Get all capabilities except those related to retransformation.
 jint OnLoad(JavaVM* vm,
-            char* options ATTRIBUTE_UNUSED,
-            void* reserved ATTRIBUTE_UNUSED) {
+            [[maybe_unused]] char* options,
+            [[maybe_unused]] void* reserved) {
   if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) {
     printf("Unable to get jvmti env!\n");
     return 1;
@@ -451,8 +464,8 @@
 
 // Get all capabilities except those related to retransformation.
 jint OnLoad(JavaVM* vm,
-            char* options ATTRIBUTE_UNUSED,
-            void* reserved ATTRIBUTE_UNUSED) {
+            [[maybe_unused]] char* options,
+            [[maybe_unused]] void* reserved) {
   if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) {
     printf("Unable to get jvmti env!\n");
     return 1;
diff --git a/test/ti-agent/suspend_event_helper.cc b/test/ti-agent/suspend_event_helper.cc
index cbc54d4..71b8681 100644
--- a/test/ti-agent/suspend_event_helper.cc
+++ b/test/ti-agent/suspend_event_helper.cc
@@ -113,8 +113,8 @@
                               JNIEnv* env,
                               jthread thr,
                               jmethodID method,
-                              jlocation location ATTRIBUTE_UNUSED,
-                              jobject exception ATTRIBUTE_UNUSED) {
+                              [[maybe_unused]] jlocation location,
+                              [[maybe_unused]] jobject exception) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti, jvmti->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -131,10 +131,10 @@
                          JNIEnv* env,
                          jthread thr,
                          jmethodID method,
-                         jlocation location ATTRIBUTE_UNUSED,
-                         jobject exception ATTRIBUTE_UNUSED,
-                         jmethodID catch_method ATTRIBUTE_UNUSED,
-                         jlocation catch_location ATTRIBUTE_UNUSED) {
+                         [[maybe_unused]] jlocation location,
+                         [[maybe_unused]] jobject exception,
+                         [[maybe_unused]] jmethodID catch_method,
+                         [[maybe_unused]] jlocation catch_location) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti, jvmti->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -164,8 +164,8 @@
                           JNIEnv* env,
                           jthread thr,
                           jmethodID method,
-                          jboolean was_popped_by_exception ATTRIBUTE_UNUSED,
-                          jvalue return_value ATTRIBUTE_UNUSED) {
+                          [[maybe_unused]] jboolean was_popped_by_exception,
+                          [[maybe_unused]] jvalue return_value) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti, jvmti->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -181,13 +181,13 @@
 void JNICALL cbFieldModification(jvmtiEnv* jvmti,
                                  JNIEnv* env,
                                  jthread thr,
-                                 jmethodID method ATTRIBUTE_UNUSED,
-                                 jlocation location ATTRIBUTE_UNUSED,
-                                 jclass field_klass ATTRIBUTE_UNUSED,
-                                 jobject object ATTRIBUTE_UNUSED,
+                                 [[maybe_unused]] jmethodID method,
+                                 [[maybe_unused]] jlocation location,
+                                 [[maybe_unused]] jclass field_klass,
+                                 [[maybe_unused]] jobject object,
                                  jfieldID field,
-                                 char signature_type ATTRIBUTE_UNUSED,
-                                 jvalue new_value ATTRIBUTE_UNUSED) {
+                                 [[maybe_unused]] char signature_type,
+                                 [[maybe_unused]] jvalue new_value) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti, jvmti->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -204,10 +204,10 @@
 void JNICALL cbFieldAccess(jvmtiEnv* jvmti,
                            JNIEnv* env,
                            jthread thr,
-                           jmethodID method ATTRIBUTE_UNUSED,
-                           jlocation location ATTRIBUTE_UNUSED,
+                           [[maybe_unused]] jmethodID method,
+                           [[maybe_unused]] jlocation location,
                            jclass field_klass,
-                           jobject object ATTRIBUTE_UNUSED,
+                           [[maybe_unused]] jobject object,
                            jfieldID field) {
   TestData* data;
   if (JvmtiErrorToException(
@@ -247,8 +247,8 @@
 void JNICALL cbFramePop(jvmtiEnv* jvmti,
                         JNIEnv* env,
                         jthread thr,
-                        jmethodID method ATTRIBUTE_UNUSED,
-                        jboolean was_popped_by_exception ATTRIBUTE_UNUSED) {
+                        [[maybe_unused]] jmethodID method,
+                        [[maybe_unused]] jboolean was_popped_by_exception) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti, jvmti->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -281,7 +281,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_SuspendEvents_setupTest(JNIEnv* env,
-                                                                   jclass klass ATTRIBUTE_UNUSED) {
+                                                                   [[maybe_unused]] jclass klass) {
   jvmtiCapabilities caps;
   memset(&caps, 0, sizeof(caps));
   // Most of these will already be there but might as well be complete.
@@ -374,7 +374,7 @@
 
 extern "C" JNIEXPORT void JNICALL
 Java_art_SuspendEvents_setupSuspendClassEvent(JNIEnv* env,
-                                              jclass klass ATTRIBUTE_UNUSED,
+                                              [[maybe_unused]] jclass klass,
                                               jint event_num,
                                               jobjectArray interesting_names,
                                               jthread thr) {
@@ -409,7 +409,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_SuspendEvents_clearSuspendClassEvent(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jthread thr) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -432,7 +432,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_SuspendEvents_setupSuspendSingleStepAt(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject meth, jlocation loc, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jobject meth, jlocation loc, jthread thr) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -453,7 +453,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_SuspendEvents_clearSuspendSingleStepFor(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jthread thr) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -470,7 +470,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_SuspendEvents_setupSuspendPopFrameEvent(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jint offset, jobject breakpoint_func, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jint offset, jobject breakpoint_func, jthread thr) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -501,7 +501,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_SuspendEvents_clearSuspendPopFrameEvent(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass , jthread thr) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -528,7 +528,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_SuspendEvents_setupSuspendBreakpointFor(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject meth, jlocation loc, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass , jobject meth, jlocation loc, jthread thr) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -553,7 +553,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_SuspendEvents_clearSuspendBreakpointFor(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass , jthread thr) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -577,7 +577,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_SuspendEvents_setupSuspendExceptionEvent(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method, jboolean is_catch, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass , jobject method, jboolean is_catch, jthread thr) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -599,7 +599,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_SuspendEvents_clearSuspendExceptionEvent(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass , jthread thr) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -622,7 +622,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_SuspendEvents_setupSuspendMethodEvent(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method, jboolean enter, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass , jobject method, jboolean enter, jthread thr) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -644,7 +644,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_SuspendEvents_clearSuspendMethodEvent(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass , jthread thr) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -668,7 +668,7 @@
 
 extern "C" JNIEXPORT void JNICALL
 Java_art_SuspendEvents_setupFieldSuspendFor(JNIEnv* env,
-                                            jclass klass ATTRIBUTE_UNUSED,
+                                            [[maybe_unused]] jclass klass,
                                             jclass target_klass,
                                             jobject field,
                                             jboolean access,
@@ -706,7 +706,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_SuspendEvents_clearFieldSuspendFor(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass , jthread thr) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -744,7 +744,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_SuspendEvents_setupWaitForNativeCall(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass , jthread thr) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -761,7 +761,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_SuspendEvents_clearWaitForNativeCall(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass , jthread thr) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
@@ -775,7 +775,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL
-Java_art_SuspendEvents_waitForSuspendHit(JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) {
+Java_art_SuspendEvents_waitForSuspendHit(JNIEnv* env, [[maybe_unused]] jclass klass, jthread thr) {
   TestData* data;
   if (JvmtiErrorToException(
           env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) {
diff --git a/test/ti-agent/ti_utf.h b/test/ti-agent/ti_utf.h
index 15fe22c..cfde098 100644
--- a/test/ti-agent/ti_utf.h
+++ b/test/ti-agent/ti_utf.h
@@ -179,7 +179,7 @@
 inline size_t CountModifiedUtf8BytesInUtf16(const uint16_t* chars, size_t char_count) {
   // FIXME: We should not emit 4-byte sequences. Bug: 192935764
   size_t result = 0;
-  auto append = [&](char c ATTRIBUTE_UNUSED) { ++result; };
+  auto append = [&]([[maybe_unused]] char c) { ++result; };
   ConvertUtf16ToUtf8</*kUseShortZero=*/ false,
                      /*kUse4ByteSequence=*/ true,
                      /*kReplaceBadSurrogates=*/ false>(chars, char_count, append);
diff --git a/test/ti-agent/trace_helper.cc b/test/ti-agent/trace_helper.cc
index 11e1c15..58958cb 100644
--- a/test/ti-agent/trace_helper.cc
+++ b/test/ti-agent/trace_helper.cc
@@ -303,7 +303,7 @@
 
 static void classPrepareCB(jvmtiEnv* jvmti,
                            JNIEnv* jnienv,
-                           jthread thr ATTRIBUTE_UNUSED,
+                           [[maybe_unused]] jthread thr,
                            jclass klass) {
   TraceData* data = nullptr;
   if (JvmtiErrorToException(jnienv, jvmti,
@@ -441,7 +441,7 @@
 
 extern "C" JNIEXPORT void JNICALL Java_art_Trace_watchFieldModification(
     JNIEnv* env,
-    jclass trace ATTRIBUTE_UNUSED,
+    [[maybe_unused]] jclass trace,
     jobject field_obj) {
   jfieldID field;
   jclass klass;
@@ -455,7 +455,7 @@
 
 extern "C" JNIEXPORT void JNICALL Java_art_Trace_watchFieldAccess(
     JNIEnv* env,
-    jclass trace ATTRIBUTE_UNUSED,
+    [[maybe_unused]] jclass trace,
     jobject field_obj) {
   jfieldID field;
   jclass klass;
@@ -468,7 +468,7 @@
 
 extern "C" JNIEXPORT void JNICALL Java_art_Trace_enableTracing2(
     JNIEnv* env,
-    jclass trace ATTRIBUTE_UNUSED,
+    [[maybe_unused]] jclass trace,
     jclass klass,
     jobject enter,
     jobject exit,
@@ -610,7 +610,7 @@
 }
 
 extern "C" JNIEXPORT void JNICALL Java_art_Trace_disableTracing(
-    JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) {
+    JNIEnv* env, [[maybe_unused]] jclass klass, jthread thr) {
   TraceData* data = nullptr;
   if (JvmtiErrorToException(
       env, jvmti_env, jvmti_env->GetEnvironmentLocalStorage(reinterpret_cast<void**>(&data)))) {
diff --git a/test/ti-stress/stress.cc b/test/ti-stress/stress.cc
index cd7af10..4ba4564 100644
--- a/test/ti-stress/stress.cc
+++ b/test/ti-stress/stress.cc
@@ -611,11 +611,11 @@
 
 // The hook we are using.
 void JNICALL ClassFileLoadHookSecretNoOp(jvmtiEnv* jvmti,
-                                         JNIEnv* jni_env ATTRIBUTE_UNUSED,
-                                         jclass class_being_redefined ATTRIBUTE_UNUSED,
-                                         jobject loader ATTRIBUTE_UNUSED,
+                                         [[maybe_unused]] JNIEnv* jni_env,
+                                         [[maybe_unused]] jclass class_being_redefined,
+                                         [[maybe_unused]] jobject loader,
                                          const char* name,
-                                         jobject protection_domain ATTRIBUTE_UNUSED,
+                                         [[maybe_unused]] jobject protection_domain,
                                          jint class_data_len,
                                          const unsigned char* class_data,
                                          jint* new_class_data_len,
@@ -679,7 +679,7 @@
 // Do final setup during the VMInit callback. By this time most things are all setup.
 static void JNICALL PerformFinalSetupVMInit(jvmtiEnv *jvmti_env,
                                             JNIEnv* jni_env,
-                                            jthread thread ATTRIBUTE_UNUSED) {
+                                            [[maybe_unused]] jthread thread) {
   // Load the VMClassLoader class. We will get a ClassNotFound exception because we don't have
   // visibility but the class will be loaded behind the scenes.
   LOG(INFO) << "manual load & initialization of class java/lang/VMClassLoader!";
@@ -754,7 +754,7 @@
 
 extern "C" JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM* vm,
                                                char* options,
-                                               void* reserved ATTRIBUTE_UNUSED) {
+                                               [[maybe_unused]] void* reserved) {
   jvmtiEnv* jvmti = nullptr;
   if (vm->GetEnv(reinterpret_cast<void**>(&jvmti), JVMTI_VERSION_1_0)) {
     LOG(ERROR) << "Unable to get jvmti env.";
diff --git a/test/utils/regen-test-files b/test/utils/regen-test-files
index 64846a7..5da8549 100755
--- a/test/utils/regen-test-files
+++ b/test/utils/regen-test-files
@@ -216,12 +216,18 @@
   "2243-single-step-default",
   "2262-miranda-methods",
   "2262-default-conflict-methods",
-  # 2247-checker-write-barrier-elimination: Disabled while we investigate failures
-  "2247-checker-write-barrier-elimination"
+])
+
+# These ART run-tests are new and have not had enough post-submit runs
+# to meet pre-submit SLOs. Monitor their post-submit runs before
+# removing them from this set (in order to promote them to
+# presubmits).
+postsubmit_only_tests = frozenset([
+  "2247-checker-write-barrier-elimination",
+  "2273-checker-unreachable-intrinsics",
 ])
 
 known_failing_on_hwasan_tests = frozenset([
-  "BootImageProfileTest", # b/232012605
   "CtsJdwpTestCases", # times out
 ])
 
@@ -234,6 +240,7 @@
     "art_standalone_dex2oat_tests",
     "art_standalone_dexdump_tests",
     "art_standalone_dexlist_tests",
+    "art_standalone_dexopt_chroot_setup_tests",
     "art_standalone_libartbase_tests",
     "art_standalone_libartpalette_tests",
     "art_standalone_libartservice_tests",
@@ -258,11 +265,33 @@
 # All supported ART gtests.
 art_gtest_module_names = sorted(art_gtest_user_module_names + art_gtest_eng_only_module_names)
 
+# These ART gtests are new and have not had enough post-submit runs
+# to meet pre-submit SLOs. Monitor their post-submit runs before
+# removing them from this set (in order to promote them to
+# presubmits).
+art_gtest_postsubmit_only_module_names = [
+  "art_standalone_dexopt_chroot_setup_tests",
+]
+
 # ART gtests supported in MTS that do not need root access to the device.
 art_gtest_mts_user_module_names = copy.copy(art_gtest_user_module_names)
 
+# ART gtests supported in presubmits.
+art_gtest_presubmit_module_names = [t for t in art_gtest_module_names
+                                    if t not in art_gtest_postsubmit_only_module_names]
+
 # ART gtests supported in Mainline presubmits.
-art_gtests_mainline_presubmit_module_names = copy.copy(art_gtest_module_names)
+art_gtest_mainline_presubmit_module_names = copy.copy(art_gtest_presubmit_module_names)
+
+# ART gtests supported in postsubmits.
+unknown_art_gtest_postsubmit_only_module_names = [t for t in art_gtest_postsubmit_only_module_names
+                                                  if t not in art_gtest_module_names]
+if unknown_art_gtest_postsubmit_only_module_names:
+  logging.error(textwrap.dedent("""\
+  The following `art_gtest_postsubmit_only_module_names` elements are not part of
+  `art_gtest_module_names`: """) + str(unknown_art_gtest_postsubmit_only_module_names))
+  sys.exit(1)
+art_gtest_postsubmit_module_names = copy.copy(art_gtest_postsubmit_only_module_names)
 
 # Tests exhibiting a flaky behavior, currently exluded from MTS for
 # the stake of stability / confidence (b/209958457).
@@ -298,10 +327,24 @@
     ]
 }
 
+# Tests excluded from all test mapping test groups.
+#
+# Example of admissible values in this dictionary:
+#
+#   "art_standalone_cmdline_tests": ["CmdlineParserTest#TestCompilerOption"],
+#   "art_standalone_dexopt_chroot_setup_tests": ["DexoptChrootSetupTest#HelloWorld"],
+#
+failing_tests_excluded_from_test_mapping = {
+  # Empty.
+}
+
 # Tests failing because of linking issues, currently exluded from MTS
 # and Mainline Presubmits to minimize noise in continuous runs while
 # we investigate.
 #
+# Example of admissible values in this dictionary: same as for
+# `failing_tests_excluded_from_test_mapping` (see above).
+#
 # TODO(b/247108425): Address the linking issues and re-enable these
 # tests.
 failing_tests_excluded_from_mts_and_mainline_presubmits = {
@@ -309,6 +352,11 @@
     "art_standalone_libartpalette_tests": ["PaletteClientJniTest*"],
 }
 
+failing_tests_excluded_from_mainline_presubmits = (
+  failing_tests_excluded_from_test_mapping |
+  failing_tests_excluded_from_mts_and_mainline_presubmits
+)
+
 # Is `run_test` a Checker test (i.e. a test containing Checker
 # assertions)?
 def is_checker_test(run_test):
@@ -433,7 +481,7 @@
               """.join(libraries)
     return f"""
           {library_type}: [
-              {libraries_joined}
+              {libraries_joined},
           ],"""
 
   def gen_libs_list(self, libraries):
@@ -505,21 +553,26 @@
     else:
       test_config_template = "art-run-test-target-no-test-suite-tag-template"
 
-    # Define `test_suites`, if present in the test's metadata.
-    test_suites = ""
-    if metadata.get("test_suites"):
-      test_suites = f"""\
+    # Define the `test_suites` property, if test suites are present in
+    # the test's metadata.
+    test_suites_list = metadata.get("test_suites")
+    test_suites_prop = ""
+    if test_suites_list:
+      test_suites_joined = """,
+              """.join([f"\"{s}\"" for s in test_suites_list])
+      test_suites_prop = f"""\
 
-          test_suites: {json.dumps(metadata.get("test_suites"))},"""
+          test_suites: [
+              {test_suites_joined},
+          ],"""
 
+    include_srcs_prop = ""
     if is_checker_test(run_test):
-      include_src = """\
+      include_srcs_prop = """\
 
           // Include the Java source files in the test's artifacts, to make Checker assertions
           // available to the TradeFed test runner.
           include_srcs: true,"""
-    else:
-      include_src = ""
 
     # The default source directory is `src`, except if `src-art` exists.
     if os.path.isdir(os.path.join(run_test_path, "src-art")):
@@ -530,11 +583,9 @@
     src_library_rules = []
     test_libraries = []
     if os.path.isdir(os.path.join(run_test_path, "src2")):
-      src_library_rules.append(self.gen_java_library_rule(
-          f"{run_test_module_name}-{source_dir}",
-          source_dir,
-          test_libraries))
-      test_libraries.append(f"\"{run_test_module_name}-src\"")
+      test_library = f"{run_test_module_name}-{source_dir}"
+      src_library_rules.append(self.gen_java_library_rule(test_library, source_dir, test_libraries))
+      test_libraries.append(f"\"{test_library}\"")
       source_dir = "src2"
 
     with open(bp_file, "w") as f:
@@ -562,50 +613,92 @@
           data: [
               ":{run_test_module_name}-expected-stdout",
               ":{run_test_module_name}-expected-stderr",
-          ],{test_suites}{include_src}
-      }}
-
-      // Test's expected standard output.
-      genrule {{
-          name: "{run_test_module_name}-expected-stdout",
-          out: ["{run_test_module_name}-expected-stdout.txt"],
-          srcs: ["expected-stdout.txt"],
-          cmd: "cp -f $(in) $(out)",
-      }}
-
-      // Test's expected standard error.
-      genrule {{
-          name: "{run_test_module_name}-expected-stderr",
-          out: ["{run_test_module_name}-expected-stderr.txt"],
-          srcs: ["expected-stderr.txt"],
-          cmd: "cp -f $(in) $(out)",
+          ],{test_suites_prop}{include_srcs_prop}
       }}
       """))
 
+      def add_expected_output_genrule(type_str):
+        type_str_long = "standard output" if type_str == "stdout" else "standard error"
+        in_file = os.path.join(run_test_path, f"expected-{type_str}.txt")
+        if os.path.islink(in_file):
+          # Genrules are sandboxed, so if we just added the symlink to the srcs list, it would
+          # be a dangling symlink in the sandbox. Instead, if we see a symlink, depend on the
+          # genrule from the test that the symlink is pointing to instead of the symlink itself.
+          link_target = os.readlink(in_file)
+          basename = os.path.basename(in_file)
+          match = re.fullmatch('\.\./([a-zA-Z0-9_-]+)/' + re.escape(basename), link_target)
+          if not match:
+            sys.exit(f"Error: expected symlink to be '../something/{basename}', got {link_target}")
+          f.write(textwrap.dedent(f"""\
+
+            // Test's expected {type_str_long}.
+            genrule {{
+                name: "{run_test_module_name}-expected-{type_str}",
+                out: ["{run_test_module_name}-expected-{type_str}.txt"],
+                srcs: [":{ART_RUN_TEST_MODULE_NAME_PREFIX}{match.group(1)}-expected-{type_str}"],
+                cmd: "cp -f $(in) $(out)",
+            }}
+          """))
+        else:
+          f.write(textwrap.dedent(f"""\
+
+            // Test's expected {type_str_long}.
+            genrule {{
+                name: "{run_test_module_name}-expected-{type_str}",
+                out: ["{run_test_module_name}-expected-{type_str}.txt"],
+                srcs: ["expected-{type_str}.txt"],
+                cmd: "cp -f $(in) $(out)",
+            }}
+          """))
+
+      add_expected_output_genrule("stdout")
+      add_expected_output_genrule("stderr")
+
+
   def regen_test_mapping_file(self, art_run_tests):
     """Regenerate ART's `TEST_MAPPING`."""
 
-    run_test_module_names = [ART_RUN_TEST_MODULE_NAME_PREFIX + t for t in art_run_tests]
+    # See go/test-mapping#attributes and
+    # https://source.android.com/docs/core/tests/development/test-mapping
+    # for more information about Test Mapping test groups.
+
+    # ART run-tests used in `*presubmit` test groups, used both in pre- and post-submit runs.
+    presubmit_run_test_module_names = [ART_RUN_TEST_MODULE_NAME_PREFIX + t
+                                       for t in art_run_tests
+                                       if t not in postsubmit_only_tests]
+    # ART run-tests used in the `postsubmit` test group, used in post-submit runs only.
+    postsubmit_run_test_module_names = [ART_RUN_TEST_MODULE_NAME_PREFIX + t
+                                        for t in art_run_tests
+                                        if t in postsubmit_only_tests]
+
+    def gen_tests_dict(tests, excluded_test_cases = {}, excluded_test_modules = [], suffix = ""):
+      return [
+          ({"name": t + suffix,
+            "options": [
+                {"exclude-filter": e}
+                for e in excluded_test_cases[t]
+            ]}
+           if t in excluded_test_cases
+           else {"name": t + suffix})
+          for t in tests
+          if t not in excluded_test_modules
+      ]
 
     # Mainline presubmits.
     mainline_presubmit_apex_suffix = "[com.google.android.art.apex]"
     mainline_other_presubmit_tests = []
-    mainline_presubmit_tests = (mainline_other_presubmit_tests + run_test_module_names +
-                                art_gtests_mainline_presubmit_module_names)
-    mainline_presubmit_tests_dict = [
-        ({"name": t + mainline_presubmit_apex_suffix,
-          "options": [
-              {"exclude-filter": e}
-              for e in failing_tests_excluded_from_mts_and_mainline_presubmits[t]
-          ]}
-         if t in failing_tests_excluded_from_mts_and_mainline_presubmits
-         else {"name": t + mainline_presubmit_apex_suffix})
-        for t in mainline_presubmit_tests
-    ]
+    mainline_presubmit_tests = (mainline_other_presubmit_tests + presubmit_run_test_module_names +
+                                art_gtest_mainline_presubmit_module_names)
+    mainline_presubmit_tests_dict = \
+      gen_tests_dict(mainline_presubmit_tests,
+                     failing_tests_excluded_from_mainline_presubmits,
+                     [],
+                     mainline_presubmit_apex_suffix)
 
     # Android Virtualization Framework presubmits
     avf_presubmit_tests = ["ComposHostTestCases"]
-    avf_presubmit_tests_dict = [{"name": t} for t in avf_presubmit_tests]
+    avf_presubmit_tests_dict = gen_tests_dict(avf_presubmit_tests,
+                                              failing_tests_excluded_from_test_mapping)
 
     # Presubmits.
     other_presubmit_tests = [
@@ -615,10 +708,19 @@
         "art-apex-update-rollback",
         "art_standalone_dexpreopt_tests",
     ]
-    presubmit_tests = other_presubmit_tests + run_test_module_names + art_gtest_module_names
-    presubmit_tests_dict = [{"name": t} for t in presubmit_tests]
-    hwasan_presubmit_tests_dict = [{"name": t} for t in presubmit_tests
-                                   if t not in known_failing_on_hwasan_tests]
+    presubmit_tests = (other_presubmit_tests + presubmit_run_test_module_names +
+                       art_gtest_presubmit_module_names)
+    presubmit_tests_dict = gen_tests_dict(presubmit_tests,
+                                          failing_tests_excluded_from_test_mapping)
+    hwasan_presubmit_tests_dict = gen_tests_dict(presubmit_tests,
+                                                 failing_tests_excluded_from_test_mapping,
+                                                 known_failing_on_hwasan_tests)
+
+    # Postsubmits.
+    postsubmit_tests = postsubmit_run_test_module_names + art_gtest_postsubmit_module_names
+    postsubmit_tests_dict = [{"name": t} for t in postsubmit_tests]
+    postsubmit_tests_dict = gen_tests_dict(postsubmit_tests,
+                                           failing_tests_excluded_from_test_mapping)
 
     # Use an `OrderedDict` container to preserve the order in which items are inserted.
     # Do not produce an entry for a test group if it is empty.
@@ -630,6 +732,7 @@
             ("presubmit", presubmit_tests_dict),
             ("hwasan-presubmit", hwasan_presubmit_tests_dict),
             ("avf-presubmit", avf_presubmit_tests_dict),
+            ("postsubmit", postsubmit_tests_dict),
         ]
         if test_group_dict
     ])
@@ -752,6 +855,15 @@
         configuration.appendChild(xml_comment)
       for t in self.tests:
         append_module_controller_configuration(t)
+      for t in self.tests:
+        if t in ["CtsLibcoreTestCases", "CtsLibcoreOjTestCases"]:
+          xml_comment = root.createComment(
+            " core-test-mode=mts tells ExpectationBasedFilter to exclude @NonMts Tests ")
+          configuration.appendChild(xml_comment)
+          option = root.createElement("option")
+          option.setAttribute("name", "compatibility:module-arg")
+          option.setAttribute("value", f"{t}:instrumentation-arg:core-test-mode:=mts")
+          configuration.appendChild(option)
 
       xml_str = root.toprettyxml(indent = XML_INDENT, encoding = "utf-8")
 
@@ -849,6 +961,7 @@
         "CtsLibcoreOjTestCases",
         "CtsLibcoreWycheproofBCTestCases",
         "MtsLibcoreOkHttpTestCases",
+        "MtsLibcoreBouncyCastleTestCases",
     ]
     other_cts_libcore_tests_shard = self.create_mts_test_shard(
         "CTS Libcore OJ tests", other_cts_libcore_tests_shard_tests,
@@ -903,36 +1016,61 @@
     # -------------------------------
 
     # Note: We only include ART run-tests expected to succeed for now.
+    num_expected_succeeding_tests = len(expected_succeeding_tests)
 
-    num_presubmit_run_tests = len(expected_succeeding_tests)
-    num_mainline_presubmit_run_tests = len(expected_succeeding_tests)
+    presubmit_run_tests = set(expected_succeeding_tests).difference(postsubmit_only_tests)
+    num_presubmit_run_tests = len(presubmit_run_tests)
+    presubmit_run_tests_percentage = int(
+        num_presubmit_run_tests * 100 / num_expected_succeeding_tests)
+
+    num_mainline_presubmit_run_tests = num_presubmit_run_tests
+    mainline_presubmit_run_tests_percentage = presubmit_run_tests_percentage
+
+    postsubmit_run_tests = set(expected_succeeding_tests).intersection(postsubmit_only_tests)
+    num_postsubmit_run_tests = len(postsubmit_run_tests)
+    postsubmit_run_tests_percentage = int(
+        num_postsubmit_run_tests * 100 / num_expected_succeeding_tests)
 
     self.regen_test_mapping_file(expected_succeeding_tests)
 
     expected_succeeding_tests_percentage = int(
-        len(expected_succeeding_tests) * 100 / len(run_tests))
+        num_expected_succeeding_tests * 100 / len(run_tests))
 
-    mainline_presubmit_gtests_percentage = int(
-        len(art_gtests_mainline_presubmit_module_names) * 100 / len(art_gtest_module_names))
+    num_gtests = len(art_gtest_module_names)
 
-    print(f"Generated TEST_MAPPING entries for {len(expected_succeeding_tests)} ART run-tests out"
+    num_presubmit_gtests = len(art_gtest_presubmit_module_names)
+    presubmit_gtests_percentage = int(num_presubmit_gtests * 100 / num_gtests)
+
+    num_mainline_presubmit_gtests = len(art_gtest_mainline_presubmit_module_names)
+    mainline_presubmit_gtests_percentage = int(num_mainline_presubmit_gtests * 100 / num_gtests)
+
+    num_postsubmit_gtests = len(art_gtest_postsubmit_module_names)
+    postsubmit_gtests_percentage = int(num_postsubmit_gtests * 100 / num_gtests)
+
+    print(f"Generated TEST_MAPPING entries for {num_expected_succeeding_tests} ART run-tests out"
           f" of {len(run_tests)} ({expected_succeeding_tests_percentage}%):")
     for (num_tests, test_kind, tests_percentage, test_group_name) in [
-        (num_mainline_presubmit_run_tests, "ART run-tests", 100, "mainline-presubmit"),
-        (len(art_gtests_mainline_presubmit_module_names), "ART gtests",
-         mainline_presubmit_gtests_percentage, "mainline-presubmit"),
-        (num_presubmit_run_tests, "ART run-tests", 100, "presubmit"),
-        (len(art_gtest_module_names), "ART gtests", 100, "presubmit"),
+        (num_mainline_presubmit_run_tests, "ART run-tests", mainline_presubmit_run_tests_percentage,
+         "mainline-presubmit"),
+        (num_presubmit_run_tests, "ART run-tests", presubmit_run_tests_percentage, "presubmit"),
+        (num_postsubmit_run_tests, "ART run-tests", postsubmit_run_tests_percentage, "postsubmit"),
+        (num_mainline_presubmit_gtests, "ART gtests", mainline_presubmit_gtests_percentage,
+         "mainline-presubmit"),
+        (num_presubmit_gtests, "ART gtests", presubmit_gtests_percentage, "presubmit"),
+        (num_postsubmit_gtests, "ART gtests", postsubmit_gtests_percentage, "presubmit"),
     ]:
       print(
           f"  {num_tests:3d} {test_kind} ({tests_percentage}%) in `{test_group_name}` test group.")
+    print("""  Note: Tests in `*presubmit` test groups are executed in pre- and
+        post-submit test runs. Tests in the `postsubmit` test group
+        are only executed in post-submit test runs.""")
 
     # Regenerate ART MTS definition (optional).
     # -----------------------------------------
 
     if regen_art_mts:
       self.regen_art_mts_files(expected_succeeding_tests)
-      print(f"Generated ART MTS entries for {len(expected_succeeding_tests)} ART run-tests out"
+      print(f"Generated ART MTS entries for {num_expected_succeeding_tests} ART run-tests out"
             f" of {len(run_tests)} ({expected_succeeding_tests_percentage}%).")
 
 def main():
diff --git a/tools/Android.bp b/tools/Android.bp
index 207a121..5cc579c 100644
--- a/tools/Android.bp
+++ b/tools/Android.bp
@@ -23,6 +23,13 @@
     default_applicable_licenses: ["art_license"],
 }
 
+soong_config_module_type_import {
+    from: "art/build/SoongConfig.bp",
+    module_types: [
+        "art_module_cc_genrule",
+    ],
+}
+
 python_binary_host {
     name: "generate_operator_out",
     srcs: [
@@ -108,3 +115,42 @@
         },
     },
 }
+
+art_module_cc_genrule {
+    name: "check_cfi",
+
+    // disable the target when prebuilt modules are used
+    enabled: false,
+    soong_config_variables: {
+        source_build: {
+            enabled: true,
+        },
+    },
+    tool_files: [
+        "check_cfi.py",
+    ],
+    tools: [
+        "llvm-dwarfdump",
+        "llvm-objdump",
+    ],
+    srcs: [
+        ":libart-unstripped",
+    ],
+    out: [
+        "check_cfi.txt",
+    ],
+    cmd: "$(location check_cfi.py) " +
+        "--dwarfdump $(location llvm-dwarfdump) " +
+        "--objdump $(location llvm-objdump) " +
+        "--out $(out) $(in)",
+
+    target: {
+        windows: {
+            // When the module is enabled globally in the soong_config_variables
+            // stanza above, it gets enabled on windows too. Hence we need to
+            // disable it explicitly.
+            // TODO(b/172480617): Clean up with that.
+            enabled: false,
+        },
+    },
+}
diff --git a/tools/art b/tools/art
index e545fc3..47724de 100755
--- a/tools/art
+++ b/tools/art
@@ -312,9 +312,6 @@
               "$@"
   ret=$?
 
-  # Avoid polluting disk with 'oat' files after dalvikvm has finished.
-  cleanup_oat_directory_for_classpath "$@"
-
   # Forward exit code of dalvikvm.
   return $ret
 }
@@ -333,7 +330,11 @@
 VERBOSE="no"
 CLEAN_OAT_FILES="yes"
 RUN_DEX2OAT="yes"
-EXTRA_OPTIONS=()
+# 'art' script is for benchmarking, so override:
+# - default JIT thresholds that are too conservative for benchmarking
+# - the eagerly releasing memory to the OS on explicit GC, which is more suited
+#   for multi-apps execution than benchmarks.
+EXTRA_OPTIONS=(-Xjitwarmupthreshold:4000 -Xjitthreshold:10000 -XX:+DisableEagerlyReleaseExplicitGC)
 DEX2OAT_FLAGS=()
 DEX2OAT_CLASSPATH=()
 GENERATE_APP_IMAGE="no"
@@ -618,8 +619,10 @@
 fi
 
 if [ "$PERF" != "" ]; then
-  LAUNCH_WRAPPER="perf record -g --call-graph dwarf -F 10000 -o $ANDROID_DATA/perf.data -e cycles:u $LAUNCH_WRAPPER"
+  # -k is for supporting jitted code.
+  LAUNCH_WRAPPER="perf record -k 1 -g --call-graph dwarf -F 10000 -o $ANDROID_DATA/perf.data -e cycles:u $LAUNCH_WRAPPER"
   DEX2OAT_FLAGS+=(--generate-debug-info)
+  EXTRA_OPTIONS+=(-Xcompiler-option --generate-debug-info)
 fi
 
 if [ "$ALLOW_DEFAULT_JDWP" = "no" ]; then
@@ -650,6 +653,9 @@
           &> "$ANDROID_DATA/profile_gen.log"
   EXIT_STATUS=$?
 
+  # Remove generated oat files.
+  cleanup_oat_directory_for_classpath "$@"
+
   if [ $EXIT_STATUS != 0 ]; then
     echo "Profile run failed: " >&2
     cat "$ANDROID_DATA/profile_gen.log" >&2
@@ -685,9 +691,16 @@
 if [ "$PERF" != "" ]; then
   if [ "$PERF" = report ]; then
     perf report -i $ANDROID_DATA/perf.data
+  else
+    # Inject jitted code in perf.data. Keep the old perf.data for debugging.
+    mv $ANDROID_DATA/perf.data $ANDROID_DATA/perf.data.old
+    perf inject -j -i $ANDROID_DATA/perf.data.old -o $ANDROID_DATA/perf.data
+    echo "Perf data saved in: $ANDROID_DATA/perf.data. Generated oat files not removed."
   fi
-  echo "Perf data saved in: $ANDROID_DATA/perf.data"
 else
+  # Perf needs the odex files we generate for proper symbolization, so only remove them
+  # when not running with perf.
+  cleanup_oat_directory_for_classpath "$@"
   # Perf output is placed under $ANDROID_DATA so not cleaned when perf options used.
   clean_android_data
 fi
diff --git a/tools/art_boot.cc b/tools/art_boot.cc
index f725fc8..dd24240 100644
--- a/tools/art_boot.cc
+++ b/tools/art_boot.cc
@@ -22,6 +22,16 @@
 #include "android-base/logging.h"
 #include "android-base/properties.h"
 
+static void SetPropertyAndLog(const std::string& key,
+                              const std::string& value,
+                              const std::string& message = "") {
+  if (android::base::SetProperty(key, value)) {
+    LOG(INFO) << "Set property " << key << " to " << value << " " << message;
+  } else {
+    LOG(ERROR) << "Failed to set property " << key << " to " << value << " " << message;
+  }
+}
+
 // Copies the value of one system property to another if it isn't empty and
 // passes the predicate test_fn.
 static void CopyPropertyIf(const char* src, const char* dst, bool (*test_fn)(const std::string&)) {
@@ -31,11 +41,7 @@
   } else if (!test_fn(prop)) {
     LOG(INFO) << "Property " << src << " has ignored value " << prop;
   } else {
-    if (android::base::SetProperty(dst, prop)) {
-      LOG(INFO) << "Set property " << dst << " to " << prop << " from " << src;
-    } else {
-      LOG(ERROR) << "Failed to set property " << dst << " to " << prop;
-    }
+    SetPropertyAndLog(dst, prop, std::string("from ") + src);
   }
 }
 
@@ -51,5 +57,13 @@
                  // shouldn't override it to true from the P/H property.
                  [](const std::string& prop) { return prop == "false"; });
 
+  // The following system properties are temporarily used as feature flags to indicate whether the
+  // module has a particular change or not.
+  // Note that they don't actually control the runtime behavior within the module. Instead, they are
+  // only used for guarding tests and calls from the platform.
+  // TODO(b/305000383): Clean these up.
+  SetPropertyAndLog("dalvik.vm.features.embedded_profile", "true");
+  SetPropertyAndLog("dalvik.vm.features.art_managed_file_stats", "true");
+
   return 0;
 }
diff --git a/tools/build_linux_bionic.sh b/tools/build_linux_bionic.sh
deleted file mode 100755
index bbe71b6..0000000
--- a/tools/build_linux_bionic.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2018 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# This will build a target using linux_bionic. It can be called with normal make
-# flags.
-
-set -e
-
-if [ ! -d art ]; then
-  echo "Script needs to be run at the root of the android tree"
-  exit 1
-fi
-
-export TARGET_PRODUCT=linux_bionic
-
-# Avoid Soong error about invalid dependencies on disabled libLLVM_android,
-# which we get due to the --soong-only mode. (Another variant is to set
-# SOONG_ALLOW_MISSING_DEPENDENCIES).
-export FORCE_BUILD_LLVM_COMPONENTS=true
-
-# TODO(b/194433871): Set MODULE_BUILD_FROM_SOURCE to disable prebuilt modules,
-# which Soong otherwise can create duplicate install rules for in --soong-only
-# mode.
-export MODULE_BUILD_FROM_SOURCE=true
-
-# Switch the build system to unbundled mode in the reduced manifest branch.
-if [ ! -d frameworks/base ]; then
-  export TARGET_BUILD_UNBUNDLED=true
-fi
-
-vars="$(build/soong/soong_ui.bash --dumpvars-mode --vars="OUT_DIR BUILD_NUMBER")"
-# Assign to a variable and eval that, since bash ignores any error status from
-# the command substitution if it's directly on the eval line.
-eval $vars
-
-# This file is currently not created in --soong-only mode, but some build
-# targets depend on it.
-printf %s "${BUILD_NUMBER}" > ${OUT_DIR}/soong/build_number.txt
-
-build/soong/soong_ui.bash --make-mode --soong-only "$@"
diff --git a/tools/build_linux_bionic_tests.sh b/tools/build_linux_bionic_tests.sh
deleted file mode 100755
index 0470d6d..0000000
--- a/tools/build_linux_bionic_tests.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2018 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -e
-
-if [ ! -d art ]; then
-  echo "Script needs to be run at the root of the android tree"
-  exit 1
-fi
-
-# Switch the build system to unbundled mode in the reduced manifest branch.
-if [ ! -d frameworks/base ]; then
-  export TARGET_BUILD_UNBUNDLED=true
-fi
-
-vars="$(build/soong/soong_ui.bash --dumpvars-mode --vars="OUT_DIR HOST_OUT")"
-# Assign to a variable and eval that, since bash ignores any error status from
-# the command substitution if it's directly on the eval line.
-eval $vars
-
-# First build all the targets still in .mk files (also build normal glibc host
-# targets so we know what's needed to run the tests).
-build/soong/soong_ui.bash --make-mode "$@" test-art-host-run-test-dependencies build-art-host-tests
-
-# Next build the Linux host Bionic targets in --soong-only mode.
-export TARGET_PRODUCT=linux_bionic
-
-# Avoid Soong error about invalid dependencies on disabled libLLVM_android,
-# which we get due to the --soong-only mode. (Another variant is to set
-# SOONG_ALLOW_MISSING_DEPENDENCIES).
-export FORCE_BUILD_LLVM_COMPONENTS=true
-
-soong_out=$OUT_DIR/soong/host/linux_bionic-x86
-declare -a bionic_targets
-# These are the binaries actually used in tests. Since some of the files are
-# java targets or 32 bit we cannot just do the same find for the bin files.
-#
-# We look at what the earlier build generated to figure out what to ask soong to
-# build since we cannot use the .mk defined phony targets.
-bionic_targets=(
-  $soong_out/bin/dalvikvm
-  $soong_out/bin/dalvikvm64
-  $soong_out/bin/dex2oat
-  $soong_out/bin/dex2oatd
-  $soong_out/bin/profman
-  $soong_out/bin/profmand
-  $soong_out/bin/hiddenapi
-  $soong_out/bin/hprof-conv
-  $soong_out/bin/signal_dumper
-  $soong_out/lib64/libclang_rt.ubsan_standalone-x86_64-android.so
-  $(find $HOST_OUT/apex/com.android.art.host.zipapex -type f | sed "s:$HOST_OUT:$soong_out:g")
-  $(find $HOST_OUT/lib64 -type f | sed "s:$HOST_OUT:$soong_out:g")
-  $(find $HOST_OUT/nativetest64 -type f | sed "s:$HOST_OUT:$soong_out:g"))
-
-echo building ${bionic_targets[*]}
-
-build/soong/soong_ui.bash --make-mode --soong-only "$@" ${bionic_targets[*]}
diff --git a/tools/buildbot-build.sh b/tools/buildbot-build.sh
index 41a06cd..2bcb4e6 100755
--- a/tools/buildbot-build.sh
+++ b/tools/buildbot-build.sh
@@ -36,6 +36,30 @@
   out_dir=${OUT_DIR}
 fi
 
+# On master-art, we need to copy ART-local riscv64 prebuilts for conscrypt and
+# statsd into their own repositories, as mainline doesn't support riscv64 yet.
+# Android.bp file changes are stored as patch files which need to be applied
+# afterwards.
+#
+# TODO(b/286551985): Remove this after riscv64 support is added to mainline.
+if [[ $TARGET_ARCH = "riscv64" && ! ( -d frameworks/base ) ]]; then
+  msginfo "Copying prebuilt dependencies for riscv64"
+  cp -u -r prebuilts/runtime/mainline/local_riscv64/prebuilts/module_sdk/conscrypt \
+    prebuilts/module_sdk
+  cp -u -r prebuilts/runtime/mainline/local_riscv64/prebuilts/module_sdk/StatsD \
+    prebuilts/module_sdk
+  for patch_file in $(find prebuilts/module_sdk -name Android.bp.patch) ; do
+    bp_file=${patch_file%.patch}
+    # Only apply the patches if they haven't been applied already. Assume the
+    # patch files contain the bug number, and look for that.
+    if grep -q b/286551985 $bp_file ; then
+      msginfo "Patch for riscv64 already present in $bp_file"
+    else
+      patch -f $bp_file < $patch_file
+    fi
+  done
+fi
+
 java_libraries_dir=${out_dir}/target/common/obj/JAVA_LIBRARIES
 common_targets="vogar core-tests core-ojtests apache-harmony-jdwp-tests-hostdex jsr166-tests libartpalette-system mockito-target"
 # These build targets have different names on device and host.
@@ -100,8 +124,8 @@
   # instead of using prebuilts.
   common_targets="$common_targets ${implementation_libs[*]}"
 else
-  # Allow to build successfully in master-art.
-  extra_args="SOONG_ALLOW_MISSING_DEPENDENCIES=true BUILD_BROKEN_DISABLE_BAZEL=true"
+  # Necessary to build successfully in master-art.
+  extra_args="SOONG_ALLOW_MISSING_DEPENDENCIES=true"
   # Switch the build system to unbundled mode in the reduced manifest branch.
   extra_args="$extra_args TARGET_BUILD_UNBUNDLED=true"
 fi
@@ -144,13 +168,15 @@
   # Targets required to generate a linker configuration for device within the
   # chroot environment. The *.libraries.txt targets are required by
   # the source linkerconfig but not included in the prebuilt one.
-  make_command+=" linkerconfig conv_linker_config sanitizer.libraries.txt vndkcorevariant.libraries.txt"
+  make_command+=" linkerconfig conv_linker_config sanitizer.libraries.txt llndk.libraries.txt"
   # Additional targets needed for the chroot environment.
   make_command+=" event-log-tags"
   # Needed to extract prebuilt APEXes.
   make_command+=" deapexer"
   # Needed to generate the primary boot image for testing.
   make_command+=" generate-boot-image"
+  # Data file needed by the `ArtExecTest.SetTaskProfiles` test.
+  make_command+=" task_profiles.json"
   # Build/install the required APEXes.
   make_command+=" ${apexes[*]}"
   make_command+=" ${specific_targets}"
@@ -181,7 +207,6 @@
   # Extract prebuilt APEXes.
   debugfs=$ANDROID_HOST_OUT/bin/debugfs_static
   fsckerofs=$ANDROID_HOST_OUT/bin/fsck.erofs
-  blkid=$ANDROID_HOST_OUT/bin/blkid_static
   for apex in ${apexes[@]}; do
     dir="$ANDROID_PRODUCT_OUT/system/apex/${apex}"
     apexbase="$ANDROID_PRODUCT_OUT/system/apex/${apex}"
@@ -196,7 +221,7 @@
       rm -rf $dir
       mkdir -p $dir
       $ANDROID_HOST_OUT/bin/deapexer --debugfs_path $debugfs --fsckerofs_path $fsckerofs \
-        --blkid_path $blkid extract $file $dir
+        extract $file $dir
     fi
   done
 
@@ -208,26 +233,25 @@
     if [[ $TARGET_ARCH = arm* ]]; then
       arch32=arm
       arch64=arm64
+    elif [[ $TARGET_ARCH = riscv64 ]]; then
+      arch32=none # there is no 32-bit arch for RISC-V
+      arch64=riscv64
     else
       arch32=x86
       arch64=x86_64
     fi
-    if [ "$TARGET_ARCH" = riscv64 ]; then
-      true # no 32-bit arch for RISC-V
-    else
-      for so in ${implementation_libs[@]}; do
-        if [ -d "$ANDROID_PRODUCT_OUT/system/lib" ]; then
-          cmd="cp -p prebuilts/runtime/mainline/platform/impl/$arch32/${so}.so $ANDROID_PRODUCT_OUT/system/lib/${so}.so"
-          msginfo "Executing" "$cmd"
-          eval "$cmd"
-        fi
-        if [ -d "$ANDROID_PRODUCT_OUT/system/lib64" ]; then
-          cmd="cp -p prebuilts/runtime/mainline/platform/impl/$arch64/${so}.so $ANDROID_PRODUCT_OUT/system/lib64/${so}.so"
-          msginfo "Executing" "$cmd"
-          eval "$cmd"
-        fi
-      done
-    fi
+    for so in ${implementation_libs[@]}; do
+      if [ -d "$ANDROID_PRODUCT_OUT/system/lib" -a $arch32 != none ]; then
+        cmd="cp -p prebuilts/runtime/mainline/platform/impl/$arch32/${so}.so $ANDROID_PRODUCT_OUT/system/lib/${so}.so"
+        msginfo "Executing" "$cmd"
+        eval "$cmd"
+      fi
+      if [ -d "$ANDROID_PRODUCT_OUT/system/lib64" -a $arch64 != none ]; then
+        cmd="cp -p prebuilts/runtime/mainline/platform/impl/$arch64/${so}.so $ANDROID_PRODUCT_OUT/system/lib64/${so}.so"
+        msginfo "Executing" "$cmd"
+        eval "$cmd"
+      fi
+    done
   fi
 
   # Create canonical name -> file name symlink in the symbol directory for the
@@ -411,6 +435,5 @@
   msginfo "Generating linkerconfig" "in $linkerconfig_out"
   rm -rf $linkerconfig_out
   mkdir -p $linkerconfig_out
-  $ANDROID_HOST_OUT/bin/linkerconfig --target $linkerconfig_out --root $linkerconfig_root --vndk $platform_version --product_vndk $platform_version
-  msgnote "Don't be scared by \"Unable to access VNDK APEX\" message, it's not fatal"
+  $ANDROID_HOST_OUT/bin/linkerconfig --target $linkerconfig_out --root $linkerconfig_root
 fi
diff --git a/tools/buildbot-cleanup-device.sh b/tools/buildbot-cleanup-device.sh
index 7fd57b4..45d0d45 100755
--- a/tools/buildbot-cleanup-device.sh
+++ b/tools/buildbot-cleanup-device.sh
@@ -26,6 +26,8 @@
     sudo umount $ART_TEST_CHROOT/dev
     sudo umount $ART_TEST_CHROOT/bin
     sudo umount $ART_TEST_CHROOT/lib
+    sudo umount $ART_TEST_CHROOT/usr/lib
+    sudo umount $ART_TEST_CHROOT/usr/share/gdb
     rm -rf $ART_TEST_CHROOT
   "
   exit 0
diff --git a/tools/buildbot-setup-device.sh b/tools/buildbot-setup-device.sh
index 90d680b..1df5d4f 100755
--- a/tools/buildbot-setup-device.sh
+++ b/tools/buildbot-setup-device.sh
@@ -34,9 +34,7 @@
 
     mkdir $ART_TEST_CHROOT/apex
     mkdir $ART_TEST_CHROOT/bin
-    mkdir $ART_TEST_CHROOT/data
-    mkdir $ART_TEST_CHROOT/data/local
-    mkdir $ART_TEST_CHROOT/data/local/tmp
+    mkdir -p $ART_TEST_CHROOT/data/local/tmp
     mkdir $ART_TEST_CHROOT/dev
     mkdir $ART_TEST_CHROOT/etc
     mkdir $ART_TEST_CHROOT/lib
@@ -45,12 +43,16 @@
     mkdir $ART_TEST_CHROOT/sys
     mkdir $ART_TEST_CHROOT/system
     mkdir $ART_TEST_CHROOT/tmp
+    mkdir -p $ART_TEST_CHROOT/usr/lib
+    mkdir -p $ART_TEST_CHROOT/usr/share/gdb
 
-    sudo mount -t proc /proc art-test-chroot/proc
-    sudo mount -t sysfs /sys art-test-chroot/sys
-    sudo mount --bind /dev art-test-chroot/dev
-    sudo mount --bind /bin art-test-chroot/bin
-    sudo mount --bind /lib art-test-chroot/lib
+    sudo mount -t proc /proc $ART_TEST_CHROOT_BASENAME/proc
+    sudo mount -t sysfs /sys $ART_TEST_CHROOT_BASENAME/sys
+    sudo mount --bind /dev $ART_TEST_CHROOT_BASENAME/dev
+    sudo mount --bind /bin $ART_TEST_CHROOT_BASENAME/bin
+    sudo mount --bind /lib $ART_TEST_CHROOT_BASENAME/lib
+    sudo mount --bind /lib $ART_TEST_CHROOT_BASENAME/usr/lib
+    sudo mount --bind /usr/share/gdb $ART_TEST_CHROOT_BASENAME/usr/share/gdb
     $ART_CHROOT_CMD echo \"Hello from chroot! I am \$(uname -a).\"
   "
   exit 0
@@ -139,7 +141,7 @@
 
 msginfo "Kill stalled dalvikvm processes"
 # 'ps' on M can sometimes hang.
-timeout 2s adb shell "ps" >/dev/null
+timeout 5s adb shell "ps" >/dev/null
 if [[ $? == 124 ]] && [[ "$ART_TEST_RUN_ON_ARM_FVP" != true ]]; then
   msginfo "Rebooting device to fix 'ps'"
   adb reboot
@@ -202,6 +204,11 @@
   # Provide /sys/kernel/debug in chroot.
   adb shell mount | grep -q "^debugfs on $ART_TEST_CHROOT/sys/kernel/debug type debugfs " \
     || adb shell mount -t debugfs debugfs "$ART_TEST_CHROOT/sys/kernel/debug"
+  # Provide /sys/kernel/tracing in chroot. Using a bind mount is important,
+  # otherwise mounting tracefs multiple times confuses the
+  # android.hardware.atrace service.
+  adb shell mount | grep -q "^tracefs on $ART_TEST_CHROOT/sys/kernel/tracing type tracefs " \
+    || adb shell mount -o bind /sys/kernel/tracing "$ART_TEST_CHROOT/sys/kernel/tracing"
 
   # Provide /dev in chroot.
   adb shell mkdir -p "$ART_TEST_CHROOT/dev"
diff --git a/tools/buildbot-sync.sh b/tools/buildbot-sync.sh
index ef9ec8b..62e320b 100755
--- a/tools/buildbot-sync.sh
+++ b/tools/buildbot-sync.sh
@@ -107,7 +107,6 @@
     mkdir -p $src_apex_path
     $ANDROID_HOST_OUT/bin/deapexer --debugfs_path $ANDROID_HOST_OUT/bin/debugfs_static \
       --fsckerofs_path $ANDROID_HOST_OUT/bin/fsck.erofs \
-      --blkid_path $ANDROID_HOST_OUT/bin/blkid_static \
       extract ${src_apex_file} $src_apex_path
   fi
 
@@ -129,34 +128,30 @@
 activate_apex com.android.conscrypt
 activate_apex com.android.os.statsd
 
-if [[ "$TARGET_ARCH" = "riscv64" ]]; then
-  true # Skip boot image generation for RISC-V; it's not supported.
-else
-  # Generate primary boot images on device for testing.
-  for b in {32,64}; do
-    basename="generate-boot-image$b"
-    bin_on_host="$ANDROID_PRODUCT_OUT/system/bin/$basename"
-    bin_on_device="/data/local/tmp/$basename"
-    output_dir="/system/framework/art_boot_images"
-    if [ -f $bin_on_host ]; then
-      msginfo "Generating the primary boot image ($b-bit)..."
-      if [[ -n "$ART_TEST_ON_VM" ]]; then
-        $ART_RSYNC_CMD "$bin_on_host" \
-          "$ART_TEST_SSH_USER@$ART_TEST_SSH_HOST:$ART_TEST_CHROOT$bin_on_device"
-        $ART_SSH_CMD "mkdir -p $ART_TEST_CHROOT$output_dir"
-      else
-        adb push "$bin_on_host" "$ART_TEST_CHROOT$bin_on_device"
-        adb shell mkdir -p "$ART_TEST_CHROOT$output_dir"
-      fi
-      # `compiler-filter=speed-profile` is required because OatDumpTest checks the compiled code in
-      # the boot image.
-      if [[ -n "$ART_TEST_ON_VM" ]]; then
-        $ART_SSH_CMD \
-          "$ART_CHROOT_CMD $bin_on_device --output-dir=$output_dir --compiler-filter=speed-profile"
-      else
-        adb shell chroot "$ART_TEST_CHROOT" \
-          "$bin_on_device" --output-dir=$output_dir --compiler-filter=speed-profile
-      fi
+# Generate primary boot images on device for testing.
+for b in {32,64}; do
+  basename="generate-boot-image$b"
+  bin_on_host="$ANDROID_PRODUCT_OUT/system/bin/$basename"
+  bin_on_device="/data/local/tmp/$basename"
+  output_dir="/system/framework/art_boot_images"
+  if [ -f $bin_on_host ]; then
+    msginfo "Generating the primary boot image ($b-bit)..."
+    if [[ -n "$ART_TEST_ON_VM" ]]; then
+      $ART_RSYNC_CMD "$bin_on_host" \
+        "$ART_TEST_SSH_USER@$ART_TEST_SSH_HOST:$ART_TEST_CHROOT$bin_on_device"
+      $ART_SSH_CMD "mkdir -p $ART_TEST_CHROOT$output_dir"
+    else
+      adb push "$bin_on_host" "$ART_TEST_CHROOT$bin_on_device"
+      adb shell mkdir -p "$ART_TEST_CHROOT$output_dir"
     fi
-  done
-fi
+    # `compiler-filter=speed-profile` is required because OatDumpTest checks the compiled code in
+    # the boot image.
+    if [[ -n "$ART_TEST_ON_VM" ]]; then
+      $ART_SSH_CMD \
+        "$ART_CHROOT_CMD $bin_on_device --output-dir=$output_dir --compiler-filter=speed-profile"
+    else
+      adb shell chroot "$ART_TEST_CHROOT" \
+        "$bin_on_device" --output-dir=$output_dir --compiler-filter=speed-profile
+    fi
+  fi
+done
diff --git a/tools/buildbot-teardown-device.sh b/tools/buildbot-teardown-device.sh
index e71dcbe..e276cf8 100755
--- a/tools/buildbot-teardown-device.sh
+++ b/tools/buildbot-teardown-device.sh
@@ -101,10 +101,11 @@
     remove_filesystem_from_chroot dev/pts devpts false
     remove_filesystem_from_chroot dev tmpfs true
 
-    # Remove /sys/kernel/debug from chroot.
-    # The /sys/kernel/debug directory under the chroot dir cannot be
-    # deleted, as it is part of the host device's /sys filesystem.
+    # Remove /sys/kernel/{debug,tracing} from chroot.
+    # The /sys/kernel/{debug,tracing} directories under the chroot dir cannot be
+    # deleted, as they are part of the host device's /sys filesystem.
     remove_filesystem_from_chroot sys/kernel/debug debugfs false
+    remove_filesystem_from_chroot sys/kernel/tracing tracefs false
     # Remove /sys from chroot.
     remove_filesystem_from_chroot sys sysfs true
 
diff --git a/tools/buildbot-utils.sh b/tools/buildbot-utils.sh
index 6a0714d..1cdd275 100755
--- a/tools/buildbot-utils.sh
+++ b/tools/buildbot-utils.sh
@@ -78,15 +78,16 @@
     msgfatal "ART_TEST_SSH_PORT not set"
   fi
 
-  export ART_TEST_CHROOT="/home/$ART_TEST_SSH_USER/art-test-chroot"
-  export ART_CHROOT_CMD="unshare --user --map-root-user chroot art-test-chroot"
-  export ART_SSH_CMD="ssh -q -p $ART_TEST_SSH_PORT $ART_TEST_SSH_USER@$ART_TEST_SSH_HOST -o IdentityAgent=none"
-  export ART_SCP_CMD="scp -P $ART_TEST_SSH_PORT -p -r -o IdentityAgent=none"
+  export ART_TEST_CHROOT_BASENAME="art-test-chroot"
+  export ART_TEST_CHROOT="/home/$ART_TEST_SSH_USER/$ART_TEST_CHROOT_BASENAME"
+  export ART_CHROOT_CMD="unshare --user --map-root-user chroot $ART_TEST_CHROOT_BASENAME"
+  export ART_SSH_CMD="ssh -q -i ~/.ssh/ubuntu -p $ART_TEST_SSH_PORT -o StrictHostKeyChecking=no $ART_TEST_SSH_USER@$ART_TEST_SSH_HOST"
+  export ART_SCP_CMD="scp -i ~/.ssh/ubuntu -o StrictHostKeyChecking=no -P $ART_TEST_SSH_PORT -p -r"
   export ART_RSYNC_CMD="rsync -az"
-  export RSYNC_RSH="ssh -p $ART_TEST_SSH_PORT -o IdentityAgent=none" # don't prefix with "ART_", rsync expects this name
+  export RSYNC_RSH="ssh -i ~/.ssh/ubuntu -p $ART_TEST_SSH_PORT -o StrictHostKeyChecking=no" # don't prefix with "ART_", rsync expects this name
 
   if [[ "$TARGET_ARCH" =~ ^(arm64|riscv64)$ ]]; then
-    export ART_TEST_VM_IMG="ubuntu-22.04-server-cloudimg-$TARGET_ARCH.img"
+    export ART_TEST_VM_IMG="ubuntu-23.10-server-cloudimg-$TARGET_ARCH.img"
     export ART_TEST_VM_DIR="$ANDROID_BUILD_TOP/vm/$TARGET_ARCH"
     export ART_TEST_VM="$ART_TEST_VM_DIR/$ART_TEST_VM_IMG"
   else
diff --git a/tools/buildbot-vm.sh b/tools/buildbot-vm.sh
index 9574c9f..a15f9e8 100755
--- a/tools/buildbot-vm.sh
+++ b/tools/buildbot-vm.sh
@@ -17,8 +17,9 @@
 set -e
 
 ART_TEST_ON_VM=true . "$(dirname $0)/buildbot-utils.sh"
+SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
 
-known_actions="create|boot|setup-ssh|connect|quit"
+known_actions="create|boot|geniso|install-keys|setup-ssh|connect|quit"
 
 if [[ -z $ANDROID_BUILD_TOP ]]; then
     msgfatal "ANDROID_BUILD_TOP is not set"
@@ -44,24 +45,24 @@
 
     # sudo apt install qemu-system-<arch> qemu-efi cloud-image-utils
 
-    # Get the cloud image for Ubunty 22.04 (Jammy)
-    wget "http://cloud-images.ubuntu.com/releases/22.04/release/$ART_TEST_VM_IMG"
+    # Get the cloud image for Ubunty 23.10 (Mantic Minotaur)
+    wget "http://cloud-images.ubuntu.com/releases/23.10/release/$ART_TEST_VM_IMG"
 
     if [[ "$TARGET_ARCH" = "riscv64" ]]; then
         # Get U-Boot for Ubuntu 22.04 (Jammy)
         get_stable_binary \
-            u/u-boot/u-boot-qemu_2022.01+dfsg-2ubuntu2.3_all.deb \
+            u/u-boot/u-boot-qemu_2023.07+dfsg-1ubuntu2_all.deb \
             usr/lib/u-boot/qemu-riscv64_smode/uboot.elf
 
         # Get OpenSBI for Ubuntu 22.04 (Jammy)
         get_stable_binary \
-            o/opensbi/opensbi_1.1-0ubuntu0.22.04.1_all.deb \
+            o/opensbi/opensbi_1.3-1ubuntu0.23.04.2_all.deb \
             usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf
 
     elif [[ "$TARGET_ARCH" = "arm64" ]]; then
-        # Get EFI (ARM64) for Ubuntu 22.04 (Jammy)
+        # Get EFI (ARM64)
         get_stable_binary \
-            e/edk2/qemu-efi-aarch64_2022.02-3ubuntu0.22.04.1_all.deb \
+            e/edk2/qemu-efi-aarch64_2023.05-2ubuntu0.1_all.deb \
             usr/share/qemu-efi-aarch64/QEMU_EFI.fd
 
         dd if=/dev/zero of=flash0.img bs=1M count=64
@@ -70,38 +71,71 @@
     fi
 
     qemu-img resize "$ART_TEST_VM_IMG" +128G
-
-    # https://help.ubuntu.com/community/CloudInit
+)
+elif [[ $action = geniso ]]; then
+(
+    #https://help.ubuntu.com/community/CloudInit
     cat >user-data <<EOF
 #cloud-config
 ssh_pwauth: true
 chpasswd:
   expire: false
-  list:
-    - $ART_TEST_SSH_USER:ubuntu
+  users:
+    - name: $ART_TEST_SSH_USER
+      password: ubuntu
+      type: text
+users:
+  - default
+  - name: $ART_TEST_SSH_USER
+    ssh-authorized-keys:
+      - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCOYmwd9qoYd7rfYI6Q8zzqoZ3BtLC/SQo0WCvBFoJT6JzwU8F7nkN57KBQPLtvX2OBeDnFbtEY8uLtuNEp1Z19VcDbRd3LhyAMYFz6Ox/vWtPfl0hv0kUMQMAne1Bg0tawlNxawP2HXrLOh/FaXdSBSRUHNqMTQEnkIYw4faArDS/zKjVDs0/+e9mhtjL0akLcK04crlk2KD8Q2csya5givdAD7fVNOx7DtckRR47FLM1bERe0t0FlUESx/x7oLjNEmNUrPXV6GSkCoskmKSZC1vwgAf0VrxFADv1EywQXmlNaa4+rzqS4jMYuwi5QCtQXFFZl5qQ1Sh1rnliTRJvJzjXCeq3QPsPzUJInfVGzrPClfHG7whlJE/Uwv8UOF7WHzUt5OBOsW6nZrplldvfYif/qz6dR+RX2G0zi8tC/2Mzahr6toAqtsqbdp3coYvpi/OjHIV3RhyJxG1FtyGYQRnmGPs8R9ic3pupjLFWM9qIilUCjFrUoiw7QAgfUrUc= ubuntu_user@example.com
+    sudo: ALL=(ALL) NOPASSWD:ALL
+    groups: users, admin
 EOF
-    cloud-localds user-data.img user-data
+    # meta-data is necessary, even if empty.
+    cat >meta-data <<EOF
+EOF
+    genisoimage -output user-data.img -volid cidata -joliet -rock user-data meta-data
+    mv user-data.img "$(dirname $0)/user-data.img"
+    rm user-data meta-data
 )
 elif [[ $action = boot ]]; then
 (
+    cp "$(dirname $0)/user-data.img" "$ART_TEST_VM_DIR/user-data.img"
     cd "$ART_TEST_VM_DIR"
     if [[ "$TARGET_ARCH" = "riscv64" ]]; then
-        qemu-system-riscv64 \
+        (qemu-system-riscv64 \
             -m 16G \
             -smp 8 \
             -M virt \
             -nographic \
             -bios fw_jump.elf \
             -kernel uboot.elf \
+            -cpu rv64,v=true,vlen=256,vext_spec=v1.0 \
             -drive file="$ART_TEST_VM_IMG",if=virtio \
             -drive file=user-data.img,format=raw,if=virtio \
             -device virtio-net-device,netdev=usernet \
-            -netdev user,id=usernet,hostfwd=tcp::$ART_TEST_SSH_PORT-:22
+            -netdev user,id=usernet,hostfwd=tcp::$ART_TEST_SSH_PORT-:22 > $SCRIPT_DIR/boot.out &)
+        echo "Now listening for successful boot"
+        finish_str='.*finished at.*'
+        while IFS= read -d $'\0' -n 1 a ; do
+            line+="${a}"
+            if [[ "$line" =~ $finish_str ]] ; then
+                echo $line
+                echo "VM Successfully booted!"
+                exit 0
+            elif [[ $a = $'\n' ]]
+            then
+                echo $line
+                unset line
+            fi
+        done < <(tail -f $SCRIPT_DIR/boot.out)
+
     elif [[ "$TARGET_ARCH" = "arm64" ]]; then
-        qemu-system-aarch64 \
+        (qemu-system-aarch64 \
             -m 16G \
             -smp 8 \
-            -cpu cortex-a57 \
+            -cpu cortex-a710,sve=on \
             -M virt \
             -nographic \
             -drive if=none,file="$ART_TEST_VM_IMG",id=hd0 \
@@ -110,14 +144,75 @@
             -drive file=user-data.img,format=raw,id=cloud \
             -device virtio-blk-device,drive=hd0 \
             -device virtio-net-device,netdev=usernet \
-            -netdev user,id=usernet,hostfwd=tcp::$ART_TEST_SSH_PORT-:22
+            -netdev user,id=usernet,hostfwd=tcp::$ART_TEST_SSH_PORT-:22 > $SCRIPT_DIR/boot.out &)
+        echo "Now listening for successful boot"
+        finish_str='.*finished at.*'
+        while IFS= read -d $'\0' -n 1 a ; do
+            line+="${a}"
+            if [[ "$line" =~ $finish_str ]] ; then
+                echo $line
+                echo "VM Successfully booted!"
+                exit 0
+            elif [[ $a = $'\n' ]]
+            then
+                echo $line
+                unset line
+            fi
+        done < <(tail -f $SCRIPT_DIR/boot.out)
     fi
 
 )
 elif [[ $action = setup-ssh ]]; then
     # Clean up mentions of this VM from known_hosts
     sed -i -E "/\[$ART_TEST_SSH_HOST.*\]:$ART_TEST_SSH_PORT .*/d" $HOME/.ssh/known_hosts
-    ssh-copy-id -p "$ART_TEST_SSH_PORT" -o IdentityAgent=none "$ART_TEST_SSH_USER@$ART_TEST_SSH_HOST"
+    ssh-copy-id -p "$ART_TEST_SSH_PORT" -o IdentityAgent=none -o StrictHostKeyChecking=no "$ART_TEST_SSH_USER@$ART_TEST_SSH_HOST"
+
+elif [[ $action = install-keys ]]; then
+    if [ -f "$HOME/.ssh/known_hosts" ]; then
+        sed -i -E "/\[$ART_TEST_SSH_HOST.*\]:$ART_TEST_SSH_PORT .*/d" $HOME/.ssh/known_hosts
+    fi
+    # This key is only used to authorize access to a local test VM and does
+    # not pose any security risk.
+    echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCOYmwd9qoYd7rfYI6Q8zzqoZ3BtLC/SQo0WCvBFoJT6JzwU8F7nkN57KBQPLtvX2OBeDnFbtEY8uLtuNEp1Z19VcDbRd3LhyAMYFz6Ox/vWtPfl0hv0kUMQMAne1Bg0tawlNxawP2HXrLOh/FaXdSBSRUHNqMTQEnkIYw4faArDS/zKjVDs0/+e9mhtjL0akLcK04crlk2KD8Q2csya5givdAD7fVNOx7DtckRR47FLM1bERe0t0FlUESx/x7oLjNEmNUrPXV6GSkCoskmKSZC1vwgAf0VrxFADv1EywQXmlNaa4+rzqS4jMYuwi5QCtQXFFZl5qQ1Sh1rnliTRJvJzjXCeq3QPsPzUJInfVGzrPClfHG7whlJE/Uwv8UOF7WHzUt5OBOsW6nZrplldvfYif/qz6dR+RX2G0zi8tC/2Mzahr6toAqtsqbdp3coYvpi/OjHIV3RhyJxG1FtyGYQRnmGPs8R9ic3pupjLFWM9qIilUCjFrUoiw7QAgfUrUc= ubuntu_user@example.com" > ~/.ssh/ubuntu.pub
+    echo "-----BEGIN OPENSSH PRIVATE KEY-----
+b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
+NhAAAAAwEAAQAAAYEAjmJsHfaqGHe632COkPM86qGdwbSwv0kKNFgrwRaCU+ic8FPBe55D
+eeygUDy7b19jgXg5xW7RGPLi7bjRKdWdfVXA20Xdy4cgDGBc+jsf71rT35dIb9JFDEDAJ3
+tQYNLWsJTcWsD9h16yzofxWl3UgUkVBzajE0BJ5CGMOH2gKw0v8yo1Q7NP/nvZobYy9GpC
+3CtOHK5ZNig/ENnLMmuYIr3QA+31TTsew7XJEUeOxSzNWxEXtLdBZVBEsf8e6C4zRJjVKz
+11ehkpAqLJJikmQtb8IAH9Fa8RQA79RMsEF5pTWmuPq86kuIzGLsIuUArUFxRWZeakNUod
+a55Yk0Sbyc41wnqt0D7D81CSJ31Rs6zwpXxxu8IZSRP1ML/FDhe1h81LeTgTrFup2a6ZZX
+b32In/6s+nUfkV9htM4vLQv9jM2oa+raAKrbKm3ad3KGL6YvzoxyFd0YcicRtRbchmEEZ5
+hj7PEfYnN6bqYyxVjPaiIpVAoxa1KIsO0AIH1K1HAAAFmIWXszeFl7M3AAAAB3NzaC1yc2
+EAAAGBAI5ibB32qhh3ut9gjpDzPOqhncG0sL9JCjRYK8EWglPonPBTwXueQ3nsoFA8u29f
+Y4F4OcVu0Rjy4u240SnVnX1VwNtF3cuHIAxgXPo7H+9a09+XSG/SRQxAwCd7UGDS1rCU3F
+rA/Ydess6H8Vpd1IFJFQc2oxNASeQhjDh9oCsNL/MqNUOzT/572aG2MvRqQtwrThyuWTYo
+PxDZyzJrmCK90APt9U07HsO1yRFHjsUszVsRF7S3QWVQRLH/HuguM0SY1Ss9dXoZKQKiyS
+YpJkLW/CAB/RWvEUAO/UTLBBeaU1prj6vOpLiMxi7CLlAK1BcUVmXmpDVKHWueWJNEm8nO
+NcJ6rdA+w/NQkid9UbOs8KV8cbvCGUkT9TC/xQ4XtYfNS3k4E6xbqdmumWV299iJ/+rPp1
+H5FfYbTOLy0L/YzNqGvq2gCq2ypt2ndyhi+mL86MchXdGHInEbUW3IZhBGeYY+zxH2Jzem
+6mMsVYz2oiKVQKMWtSiLDtACB9StRwAAAAMBAAEAAAGAPR8I9G/forM6+Ar2CEkyPDJ2iy
+GqweJzy/aRicjE14pCXHRH2W4d3yfxxZ/cgjm7eGeIvTUN85zIR24P89psSdJXAInkZSsz
+WbzADPb2hYRC8Xd6s+3akCD3m7s2zOmVGaY9VYQFEWhYb4ox1C31PC6IJVmR9YCid5jjHZ
+jn+bMmg0b6KH6/9ylpSh7xjrRS0TqRxIQfbb0nHW+w54sCet9qfVVX+PhJA5B0qMNECWZr
+HQ2gVIZaP0iOxK4UsWyrF3tZH3opA/Zoj/pbFRrxpOO0jtoXaJFy3j9khiVYXyVwLHsRgr
+s8Xybv6UBtZW8L/ebxlH2GkVn0z+GkL06dWY1E6k60WROVAFlOY4dTWntjvLl3xB/vqsSF
+yPlCv+RFfdFbUXzsd50ekERNzMqqgQdgMaIuF039CSAF8qbTxu19KNWTmbGeUKfupCamyZ
+kwyhXtQEZrGSM70Fh/WCpZqBJnOMDpTZuuHeardX22bROLl3TVbEmeUHjtAdG0TFMxAAAA
+wHzkHRTG5zx+fLIwy0uOYx3KhcnoOUMunbAPHq+EWwWHLA8LVKMNPLwITHrV2sjM2xtN03
+ia2KllzqLoiWHHdoNK5GzjDGpfY1NBlBYRijy9yxIo+QSnIb62NXjbyfYKIkxpma9HzkHI
+LD9W5ypk+nOIoLREzRudB3wXF2+QA5Frdv1x4Cl1CkNiW2sgnrJq55Q1Cf2V9T8b4c839d
+0VA9TYZtAHunWOg+pgC6bdKt/ojPPlnlzftEouxuMRjguL2QAAAMEAwClb/X/80tZW8Fnz
+qoGngIqCvDYWiKtLkCxKB7ZL/iuy6ulJiat3oA5Q6AtEi7f/MjEiissXGkdKqphf+S2Ncq
+W9RA/YHDXjlMMQle+WIHuzgZjVzZASR97gRiOJSl7l+4oZek/toxfainLl9xdADaVOhnr/
+wBaBZiY/OcxSXzaB6ml7ScWTw/XCLO7UAlYC/KNhRDriFa/dxzK1azDV2JuBum9cV+yMDr
+UeymSsp6t7vCZvcKv1F0BTzpIscZuJAAAAwQC9r7PBLc1CuXKfMW3aKa+W0Ud90MaPQ34z
+/d1YyAp5Tr9t/wMGfroEp2o8lWJbQ6ZJRndRDl2D+slrU/RRA0IiUepOidvK/A3p5ITrMl
+1G95A4A//UduCIvqLGdP+UAykNFAotWWKEPbh08XvSidZjZ3+GnVz3dqx79v2s9xSmq+II
+0Ch4i0CKTHSeVAXw6wfEfO7V+VDxNQyrG2EMLT6uTu58XDgOgB9KWej4DTDYm+KNoVblkf
+kqu3h4rmEmvk8AAAAjY2F0ZHVuY2FuQGNhdHN0YXRpb24uYy5nb29nbGVycy5jb20=
+-----END OPENSSH PRIVATE KEY-----" > ~/.ssh/ubuntu
+    chmod 600 ~/.ssh/ubuntu
 
 elif [[ $action = connect ]]; then
     $ART_SSH_CMD
diff --git a/tools/check_cfi.py b/tools/check_cfi.py
index ac258c2..55b622d 100755
--- a/tools/check_cfi.py
+++ b/tools/check_cfi.py
@@ -20,22 +20,97 @@
 Fully inferring CFI from disassembly is not possible in general.
 """
 
-import os, re, subprocess, collections, pathlib, bisect, collections
-from typing import List, Optional, Set, Tuple
+import os, re, subprocess, collections, pathlib, bisect, collections, sys
+from argparse import ArgumentParser
+from dataclasses import dataclass
+from functools import cache
+from pathlib import Path
+from typing import Any, List, Optional, Set, Tuple, Dict
 
-Source = collections.namedtuple("Source", ["addr", "file", "line", "flag"])
+arch: str = ""
+ARCHES = ["i386", "x86_64", "arm", "aarch64", "riscv64"]
 
-def get_source(lib: pathlib.Path) -> List[Source]:
+IGNORE : Dict[str, List[str]] = {
+    # Aligns stack.
+    "art_quick_osr_stub": ["i386"],
+    # Intermediate invalid CFI while loading all registers.
+    "art_quick_do_long_jump": ["x86_64"],
+    # Saves/restores SP in other register.
+    "art_quick_generic_jni_trampoline": ["arm", "i386", "x86_64"],
+    # Starts with non-zero offset at the start of the method.
+    "art_quick_throw_null_pointer_exception_from_signal": ARCHES,
+    # Pops stack without static control flow past the opcode.
+    "nterp_op_return": ["arm", "aarch64", "i386", "x86_64", "riscv64"],
+}
+
+SP = {"arm": "SP", "aarch64": "WSP", "i386": "ESP", "x86_64": "RSP", "riscv64": "X2"}
+INITIAL_OFFSET = {"i386": 4, "x86_64": 8}
+
+@cache
+def get_inst_semantics(arch: str) -> List[Any]:
+  """ List of regex expressions for supported instructions and their behaviour """
+
+  rexprs = []
+  def add(rexpr, adjust_offset=lambda m: 0, adjust_pc=None):
+    rexprs.append((re.compile(rexpr), adjust_offset, adjust_pc))
+  if arch in ["i386", "x86_64"]:
+    ptr_size = {"i386": 4, "x86_64": 8}[arch]
+    add(r"push. .*", lambda m: ptr_size)
+    add(r"pop. .*", lambda m: -ptr_size)
+    add(r"sub. \$(\w+), (?:%esp|%rsp)", lambda m: int(m[1], 0))
+    add(r"add. \$(\w+), (?:%esp|%rsp)", lambda m: -int(m[1], 0))
+    add(r"call. (0x\w+) <.*", lambda m: ptr_size, adjust_pc=lambda m: int(m[1], 0))
+    add(r"j[a-z]* (0x\w+) <.*", adjust_pc=lambda m: int(m[1], 0))
+  if arch in ["arm", "aarch64"]:
+    add(r"sub sp,(?: sp,)? #(\w+)", lambda m: int(m[1], 0))
+    add(r"add sp,(?: sp,)? #(\w+)", lambda m: -int(m[1], 0))
+    add(r"str \w+, \[sp, #-(\d+)\]!", lambda m: int(m[1]))
+    add(r"ldr \w+, \[sp\], #(\d+)", lambda m: -int(m[1]))
+    add(r"stp \w+, \w+, \[sp, #-(\w+)\]!", lambda m: int(m[1], 0))
+    add(r"ldp \w+, \w+, \[sp\], #(\w+)", lambda m: -int(m[1], 0))
+    add(r"vpush \{([d0-9, ]*)\}", lambda m: 8 * len(m[1].split(",")))
+    add(r"vpop \{([d0-9, ]*)\}", lambda m: -8 * len(m[1].split(",")))
+    add(r"v?push(?:\.w)? \{([\w+, ]*)\}", lambda m: 4 * len(m[1].split(",")))
+    add(r"v?pop(?:\.w)? \{([\w+, ]*)\}", lambda m: -4 * len(m[1].split(",")))
+    add(r"cb\w* \w+, (0x\w+).*", adjust_pc=lambda m: int(m[1], 0))
+    add(r"(?:b|bl|b\w\w) (0x\w+).*", adjust_pc=lambda m: int(m[1], 0))
+  if arch in ["riscv64"]:
+    add(r"addi sp, sp, (-?\w+)", lambda m: -int(m[1], 0))
+    add(r"b\w* (?:\w+, )+(0x\w+).*", adjust_pc=lambda m: int(m[1], 0))
+    add(r"(?:j|jal) (?:\w+, )?(0x\w+).*", adjust_pc=lambda m: int(m[1], 0))
+  return rexprs
+
+@dataclass(frozen=True)
+class Error(Exception):
+  address: int
+  message: str
+
+def get_arch(lib: pathlib.Path) -> str:
+  """ Get architecture of the given library based on the ELF header. """
+
+  proc = subprocess.run([args.objdump, "--file-headers", lib],
+                        encoding='utf-8',
+                        capture_output=True,
+                        check=True)
+
+  m = re.search("^architecture: *(.*)$", proc.stdout, re.MULTILINE)
+  assert m, "Can not find ABI of ELF file " + str(lib)
+  assert m.group(1) in ARCHES, "Unknown arch: " + m.group(1)
+  return m.group(1)
+
+Source = collections.namedtuple("Source", ["pc", "file", "line", "flag"])
+
+def get_src(lib: pathlib.Path) -> List[Source]:
   """ Get source-file and line-number for all hand-written assembly code. """
 
-  proc = subprocess.run(["llvm-dwarfdump", "--debug-line", lib],
+  proc = subprocess.run([args.dwarfdump, "--debug-line", lib],
                         encoding='utf-8',
                         capture_output=True,
                         check=True)
 
   section_re = re.compile("^debug_line\[0x[0-9a-f]+\]$", re.MULTILINE)
   filename_re = re.compile('file_names\[ *(\d)+\]:\n\s*name: "(.*)"', re.MULTILINE)
-  line_re = re.compile('0x([0-9a-f]{16}) +(\d+) +\d+ +(\d+)'  # addr, line, column, file
+  line_re = re.compile('0x([0-9a-f]{16}) +(\d+) +\d+ +(\d+)'  # pc, line, column, file
                        ' +\d+ +\d +(.*)')                     # isa, discriminator, flag
 
   results = []
@@ -47,12 +122,12 @@
     results.extend([Source(int(a, 16), files[fn], l, fg) for a, l, fn, fg in lines])
   return sorted(filter(lambda line: "end_sequence" not in line.flag, results))
 
-Fde = collections.namedtuple("Fde", ["addr", "end", "data"])
+Fde = collections.namedtuple("Fde", ["pc", "end", "data"])
 
 def get_fde(lib: pathlib.Path) -> List[Fde]:
-  """ Get all unwinding FDE blocks (in dumped text-based format) """
+  """ Get all FDE blocks (in dumped text-based format) """
 
-  proc = subprocess.run(["llvm-dwarfdump", "--debug-frame", lib],
+  proc = subprocess.run([args.dwarfdump, "--debug-frame", lib],
                         encoding='utf-8',
                         capture_output=True,
                         check=True)
@@ -65,19 +140,27 @@
     m = fda_re.match(section)
     if m:
       fde = Fde(int(m[1], 16), int(m[2], 16), section)
-      if fde.addr != 0:
+      if fde.pc != 0:
         results.append(fde)
   return sorted(results)
 
-Asm = collections.namedtuple("Asm", ["addr", "name", "data"])
+Asm = collections.namedtuple("Asm", ["pc", "name", "data"])
 
 def get_asm(lib: pathlib.Path) -> List[Asm]:
-  """ Get disassembly for all methods (in dumped text-based format) """
+  """ Get all ASM blocks (in dumped text-based format) """
 
-  proc = subprocess.run(["llvm-objdump", "--disassemble", lib],
-                        encoding='utf-8',
-                        capture_output=True,
-                        check=True)
+  proc = subprocess.run(
+      [
+          args.objdump,
+          "--disassemble",
+          "--no-show-raw-insn",
+          "--disassemble-zeroes",
+          lib,
+      ],
+      encoding="utf-8",
+      capture_output=True,
+      check=True,
+  )
 
   section_re = re.compile("\n(?! |\n)", re.MULTILINE)  # New-line not followed by indent.
   sym_re = re.compile("([0-9a-f]+) <(.+)>:")
@@ -89,132 +172,106 @@
       results.append(Asm(int(sym[1], 16), sym[2], section))
   return sorted(results)
 
-Cfa = collections.namedtuple("Cfa", ["addr", "cfa"])
-
-def get_cfa(fde: Fde) -> List[Cfa]:
-  """ Extract individual CFA (SP+offset) entries from the FDE block """
-
-  cfa_re = re.compile("0x([0-9a-f]+): CFA=([^\s:]+)")
-  return [Cfa(int(addr, 16), cfa) for addr, cfa in cfa_re.findall(fde.data)]
-
-Inst = collections.namedtuple("Inst", ["addr", "inst", "symbol"])
+Inst = collections.namedtuple("Inst", ["pc", "inst"])
 
 def get_instructions(asm: Asm) -> List[Inst]:
   """ Extract individual instructions from disassembled code block """
 
   data = re.sub(r"[ \t]+", " ", asm.data)
   inst_re = re.compile(r"([0-9a-f]+): +(?:[0-9a-f]{2} +)*(.*)")
-  return [Inst(int(addr, 16), inst, asm.name) for addr, inst in inst_re.findall(data)]
+  return [Inst(int(pc, 16), inst) for pc, inst in inst_re.findall(data)]
 
-CfaOffset = collections.namedtuple("CfaOffset", ["addr", "offset"])
+# PC -> CFA offset (stack size at given PC; None if it not just trivial SP+<integer>)
+CfaOffsets = Dict[int, Optional[int]]
 
-def get_dwarf_cfa_offsets(cfas: List[Cfa]) -> List[CfaOffset]:
-  """ Parse textual CFA entries into integer stack offsets """
+def get_dwarf_cfa_offsets(insts: List[Inst], fde: Fde) -> CfaOffsets:
+  """ Get CFA offsets for all instructions from DWARF """
 
-  result = []
-  for addr, cfa in cfas:
-    if cfa == "WSP" or cfa == "SP":
-      result.append(CfaOffset(addr, 0))
-    elif cfa.startswith("WSP+") or cfa.startswith("SP+"):
-      result.append(CfaOffset(addr, int(cfa.split("+")[1])))
-    else:
-      result.append(CfaOffset(addr, None))
+  # Parse the CFA offset definitions from the FDE.
+  sp = SP[arch]
+  m = re.compile(r"(0x[0-9a-f]+): CFA=(\w*)([^:\n]*)").findall(fde.data)
+  cfa = collections.deque([(int(a, 0), int(o or "0") if r == sp else None) for a, r, o in m])
+  if all(offset is None for add, offset in cfa):
+    # This would create result that never checks anything.
+    raise Error(insts[0].pc, "No trivial CFA offsets. Add function to IGNORE list?")
+
+  # Create map from instruction PCs to corresponding CFA offsets.
+  offset: Optional[int] = INITIAL_OFFSET.get(arch, 0)
+  result: CfaOffsets = {}
+  for pc, inst in insts:
+    while cfa and cfa[0][0] <= pc:
+      offset = cfa.popleft()[1]
+    result[pc] = offset
   return result
 
-def get_infered_cfa_offsets(insts: List[Inst]) -> List[CfaOffset]:
-  """ Heuristic to convert disassembly into stack offsets """
+def get_inferred_cfa_offsets(insts: List[Inst]) -> CfaOffsets:
+  """ Get CFA offsets for all instructions from static analysis """
 
-  # Regular expressions which find instructions that adjust stack pointer.
-  rexprs = []
-  def add(rexpr, adjust_offset):
-    rexprs.append((re.compile(rexpr), adjust_offset))
-  add(r"sub sp,(?: sp,)? #(\d+)", lambda m: int(m[1]))
-  add(r"add sp,(?: sp,)? #(\d+)", lambda m: -int(m[1]))
-  add(r"str \w+, \[sp, #-(\d+)\]!", lambda m: int(m[1]))
-  add(r"ldr \w+, \[sp\], #(\d+)", lambda m: -int(m[1]))
-  add(r"stp \w+, \w+, \[sp, #-(\d+)\]!", lambda m: int(m[1]))
-  add(r"ldp \w+, \w+, \[sp\], #(\d+)", lambda m: -int(m[1]))
-  add(r"vpush \{([d0-9, ]*)\}", lambda m: 8 * len(m[1].split(",")))
-  add(r"vpop \{([d0-9, ]*)\}", lambda m: -8 * len(m[1].split(",")))
-  add(r"v?push(?:\.w)? \{([\w+, ]*)\}", lambda m: 4 * len(m[1].split(",")))
-  add(r"v?pop(?:\.w)? \{([\w+, ]*)\}", lambda m: -4 * len(m[1].split(",")))
+  rexprs = get_inst_semantics(arch)
+  offset: Optional[int] = INITIAL_OFFSET.get(arch, 0)
+  result: CfaOffsets = {}
+  for pc, inst in insts:
+    # Set current offset for PC, unless branch already set it.
+    offset = result.setdefault(pc, offset)
 
-  # Regular expression which identifies branches.
-  jmp_re = re.compile(r"cb\w* \w+, 0x(\w+)|(?:b|bl|b\w\w) 0x(\w+)")
-
-  offset, future_offset = 0, {}
-  result = [CfaOffset(insts[0].addr, offset)]
-  for addr, inst, symbol in insts:
-    # Previous code branched here, so us that offset instead.
-    # This likely identifies slow-path which is after return.
-    if addr in future_offset:
-      offset = future_offset[addr]
-
-    # Add entry to output (only if the offset changed).
-    if result[-1].offset != offset:
-      result.append(CfaOffset(addr, offset))
-
-    # Adjust offset if the instruction modifies stack pointer.
-    for rexpr, adjust_offset in rexprs:
-      m = rexpr.match(inst)
+    # Adjust PC and offset based on the current instruction.
+    for rexpr, adjust_offset, adjust_pc in rexprs:
+      m = rexpr.fullmatch(inst)
       if m:
-        offset += adjust_offset(m)
+        new_offset = offset + adjust_offset(m)
+        if adjust_pc:
+          new_pc = adjust_pc(m)
+          if insts[0].pc <= new_pc <= insts[-1].pc:
+            if new_pc in result and result[new_pc] != new_offset:
+              raise Error(pc, "Inconsistent branch (old={} new={})"
+                              .format(result[new_pc], new_offset))
+            result[new_pc] = new_offset
+        else:
+          offset = new_offset
         break  # First matched pattern wins.
-
-    # Record branches.  We only support forward edges for now.
-    m = jmp_re.match(inst)
-    if m:
-      future_offset[int(m[m.lastindex], 16)] = offset
   return result
 
-def check_fde(fde: Fde, insts: List[Inst], srcs, verbose: bool = False) -> Tuple[str, Set[int]]:
+def check_fde(fde: Fde, insts: List[Inst], srcs) -> None:
   """ Compare DWARF offsets to assembly-inferred offsets. Report differences. """
 
-  error, seen_addrs = None, set()
-  cfas = get_cfa(fde)
-  i, dwarf_cfa = 0, get_dwarf_cfa_offsets(cfas)
-  j, infered_cfa = 0, get_infered_cfa_offsets(insts)
-  for inst in insts:
-    seen_addrs.add(inst.addr)
-    while i+1 < len(dwarf_cfa) and dwarf_cfa[i+1].addr <= inst.addr:
-      i += 1
-    while j+1 < len(infered_cfa) and infered_cfa[j+1].addr <= inst.addr:
-      j += 1
-    if verbose:
-      print("{:08x}: dwarf={:4} infered={:4} {:40} // {}".format(
-                inst.addr, str(dwarf_cfa[i].offset), str(infered_cfa[j].offset),
-                inst.inst.strip(), srcs.get(inst.addr, "")))
-    if dwarf_cfa[i].offset is not None and dwarf_cfa[i].offset != infered_cfa[j].offset:
-      if inst.addr in srcs:  # Only report if it maps to source code (not padding or literals).
-        error = error or "{:08x} {}".format(inst.addr, srcs.get(inst.addr, ""))
-  return error, seen_addrs
+  dwarf_cfa_offsets = get_dwarf_cfa_offsets(insts, fde)
+  inferred_cfa_offsets = get_inferred_cfa_offsets(insts)
 
-def check_lib(lib: pathlib.Path):
+  for pc, inst in insts:
+    if dwarf_cfa_offsets[pc] is not None and dwarf_cfa_offsets[pc] != inferred_cfa_offsets[pc]:
+      if pc in srcs:  # Only report if it maps to source code (not padding or literals).
+        for inst2 in insts:
+          print("0x{:08x} [{}]: dwarf={} inferred={} {}".format(
+                    inst2.pc, srcs.get(inst2.pc, ""),
+                    str(dwarf_cfa_offsets[inst2.pc]), str(inferred_cfa_offsets[inst2.pc]),
+                    inst2.inst.strip()))
+        raise Error(pc, "DWARF offset does not match inferred offset")
+
+def check_lib(lib: pathlib.Path) -> int:
+  global arch
+  arch = get_arch(lib)
+
   assert lib.exists()
-  IGNORE = [
-      "art_quick_throw_null_pointer_exception_from_signal",  # Starts with non-zero offset.
-      "art_quick_generic_jni_trampoline",  # Saves/restores SP in other register.
-      "nterp_op_",  # Uses calculated CFA due to dynamic stack size.
-      "$d.",  # Data (literals) interleaved within code.
-  ]
   fdes = get_fde(lib)
   asms = collections.deque(get_asm(lib))
-  srcs = {src.addr: src.file + ":" + src.line for src in get_source(lib)}
+  srcs = {src.pc: src.file + ":" + src.line for src in get_src(lib)}
   seen = set()  # Used to verify the we have covered all assembly source lines.
+  fail = 0
+  assert srcs, "No sources found"
 
   for fde in fdes:
-    if fde.addr not in srcs:
+    if fde.pc not in srcs:
       continue  # Ignore if it is not hand-written assembly.
 
     # Assembly instructions (one FDE can cover several assembly chunks).
-    all_insts, name = [], None
-    while asms and asms[0].addr < fde.end:
+    all_insts, name = [], ""
+    while asms and asms[0].pc < fde.end:
       asm = asms.popleft()
-      if asm.addr < fde.addr:
+      if asm.pc < fde.pc:
         continue
       insts = get_instructions(asm)
-      if any(asm.name.startswith(i) for i in IGNORE):
-        seen.update([inst.addr for inst in insts])
+      if any(asm.name.startswith(n) and arch in a for n, a in IGNORE.items()):
+        seen.update([inst.pc for inst in insts])
         continue
       all_insts.extend(insts)
       name = name or asm.name
@@ -222,26 +279,41 @@
       continue  # No assembly
 
     # Compare DWARF data to assembly instructions
-    error, seen_addrs = check_fde(fde, all_insts, srcs)
-    if error:
-      print("ERROR at " + name + " " + error)
-      check_fde(fde, all_insts, srcs, True)
-      print("")
-    seen.update(seen_addrs)
-  for addr in sorted(set(srcs.keys()) - seen):
-    print("Missing CFI for {:08x}: {}".format(addr, srcs[addr]))
+    try:
+      check_fde(fde, all_insts, srcs)
+    except Error as e:
+      print("0x{:08x} [{}]: ERROR in {}: {}\n"
+            .format(e.address, srcs.get(e.address, ""), name, e.message))
+      fail += 1
+    seen.update([inst.pc for inst in all_insts])
+  for pc in sorted(set(srcs.keys()) - seen):
+    print("ERROR: Missing CFI for {:08x}: {}".format(pc, srcs[pc]))
+    fail += 1
+  return fail
 
 
 def main(argv):
   """ Check libraries provided on the command line, or use the default build output """
 
-  libs = argv[1:]
+  libs = args.srcs
   if not libs:
-    out = os.environ["OUT"]
-    libs.append(out + "/symbols/apex/com.android.art/lib/libart.so")
-    libs.append(out + "/symbols/apex/com.android.art/lib64/libart.so")
+    apex = Path(os.environ["OUT"]) / "symbols/apex/"
+    libs = list(apex.glob("**/libart.so"))
+    assert libs, "Can not find any libart.so in " + str(apex)
   for lib in libs:
-    check_lib(pathlib.Path(lib))
+    fail = check_lib(pathlib.Path(lib))
+    if fail > 0:
+      print(fail, "ERROR(s) in", str(lib))
+      sys.exit(1)
+  if args.out:
+    args.out.write_bytes(b"")
 
 if __name__ == "__main__":
-  main(os.sys.argv)
+  parser = ArgumentParser(description=__doc__)
+  parser.add_argument("--out", type=Path, help="Output (will just generate empty file)")
+  parser.add_argument("--dwarfdump", type=Path, default="llvm-dwarfdump")
+  parser.add_argument("--objdump", type=Path, default="llvm-objdump")
+  parser.add_argument("srcs", nargs="*", type=Path)
+  args = parser.parse_args()
+
+  main(sys.argv)
diff --git a/tools/checker/README b/tools/checker/README
index b04b0d8..e01f0d0 100644
--- a/tools/checker/README
+++ b/tools/checker/README
@@ -17,15 +17,15 @@
 source file. There are five types of check lines. Branching instructions are
 also supported and documented later in this file.
  - CHECK:      Must match an output line which appears in the output group
-               later than lines matched against any preceeding checks. Output
+               later than lines matched against any preceding checks. Output
                lines must therefore match the check lines in the same order.
                These are referred to as "in-order" checks in the code.
  - CHECK-DAG:  Must match an output line which appears in the output group
-               later than lines matched against any preceeding in-order checks.
+               later than lines matched against any preceding in-order checks.
                In other words, the order of output lines does not matter
                between consecutive DAG checks.
  - CHECK-NOT:  Must not match any output line which appears in the output group
-               later than lines matched against any preceeding checks and
+               later than lines matched against any preceding checks and
                earlier than lines matched against any subsequent checks.
                Surrounding non-negative checks (or boundaries of the group)
                therefore create a scope within which the statement is verified.
diff --git a/tools/checker/common/archs.py b/tools/checker/common/archs.py
index 6781fbf..77babf8 100644
--- a/tools/checker/common/archs.py
+++ b/tools/checker/common/archs.py
@@ -12,4 +12,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-archs_list = ["ARM", "ARM64", "X86", "X86_64"]
+archs_list = ["ARM", "ARM64", "RISCV64", "X86", "X86_64"]
diff --git a/tools/checker/file_format/c1visualizer/parser.py b/tools/checker/file_format/c1visualizer/parser.py
index 55efbd7..26087cf 100644
--- a/tools/checker/file_format/c1visualizer/parser.py
+++ b/tools/checker/file_format/c1visualizer/parser.py
@@ -77,6 +77,12 @@
           features[feature_name] = is_enabled
 
         c1_file.set_isa_features(features)
+
+      # Check what type of read barrier is used
+      match = re.search(r"read_barrier_type:(\w+)", method_name)
+      if match:
+        c1_file.set_read_barrier_type(match.group(1))
+
       else:
         state.last_method_name = method_name
     elif line == "end_compilation":
diff --git a/tools/checker/file_format/c1visualizer/struct.py b/tools/checker/file_format/c1visualizer/struct.py
index 9428a0e..7f30320 100644
--- a/tools/checker/file_format/c1visualizer/struct.py
+++ b/tools/checker/file_format/c1visualizer/struct.py
@@ -25,10 +25,14 @@
     self.full_file_name = filename
     self.passes = []
     self.instruction_set_features = ImmutableDict()
+    self.read_barrier_type = "none"
 
   def set_isa_features(self, features):
     self.instruction_set_features = ImmutableDict(features)
 
+  def set_read_barrier_type(self, read_barrier_type):
+    self.read_barrier_type = read_barrier_type
+
   def add_pass(self, new_pass):
     self.passes.append(new_pass)
 
@@ -41,7 +45,8 @@
   def __eq__(self, other):
     return (isinstance(other, self.__class__)
             and self.passes == other.passes
-            and self.instruction_set_features == other.instruction_set_features)
+            and self.instruction_set_features == other.instruction_set_features
+            and self.read_barrier_type == other.read_barrier_type)
 
 
 class C1visualizerPass(PrintableMixin):
diff --git a/tools/checker/match/file.py b/tools/checker/match/file.py
index a573ccc..33bb9d1 100644
--- a/tools/checker/match/file.py
+++ b/tools/checker/match/file.py
@@ -318,14 +318,21 @@
     self.last_variant = variant
 
 
-def match_test_case(test_case, c1_pass, instruction_set_features):
+def match_test_case(
+    test_case,
+    c1_pass,
+    instruction_set_features,
+    read_barrier_type):
   """ Runs a test case against a C1visualizer graph dump.
 
   Raises MatchFailedException when a statement cannot be satisfied.
   """
   assert test_case.name == c1_pass.name
 
-  initial_variables = {"ISA_FEATURES": instruction_set_features}
+  initial_variables = {
+      "ISA_FEATURES": instruction_set_features,
+      "READ_BARRIER_TYPE": read_barrier_type
+  }
   state = ExecutionState(c1_pass, initial_variables)
   test_statements = test_case.statements + [None]
   for statement in test_statements:
@@ -351,7 +358,11 @@
 
     Logger.start_test(test_case.name)
     try:
-      match_test_case(test_case, c1_pass, c1_file.instruction_set_features)
+      match_test_case(
+          test_case,
+          c1_pass,
+          c1_file.instruction_set_features,
+          c1_file.read_barrier_type)
       Logger.test_passed()
     except MatchFailedException as e:
       line_no = c1_pass.start_line_no + e.line_no
diff --git a/tools/checker/match/line.py b/tools/checker/match/line.py
index 16144e1..987ae61 100644
--- a/tools/checker/match/line.py
+++ b/tools/checker/match/line.py
@@ -129,6 +129,7 @@
   assert checker_line.is_eval_content_statement()
   # Required for eval.
   hasIsaFeature = lambda feature: variables["ISA_FEATURES"].get(feature, False)
+  readBarrierType = lambda barrier_type: variables["READ_BARRIER_TYPE"] == barrier_type
   eval_string = "".join(get_eval_text(expr,
                                       variables,
                                       checker_line) for expr in checker_line.expressions)
diff --git a/tools/checker/match/test.py b/tools/checker/match/test.py
index adebd6d..a2bb6f4 100644
--- a/tools/checker/match/test.py
+++ b/tools/checker/match/test.py
@@ -101,7 +101,10 @@
 
 class MatchFiles_Test(unittest.TestCase):
 
-  def assertMatches(self, checker_string, c1_string, isa=None, instruction_set_features=None):
+  def assertMatches(self, checker_string, c1_string,
+                    isa=None,
+                    instruction_set_features=None,
+                    read_barrier_type="none"):
     checker_string = \
       """
         /// CHECK-START: MyMethod MyPass
@@ -118,6 +121,10 @@
         name if present else "-" + name for name, present in instruction_set_features.items())
       meta_data += "isa_features:" + joined_features
 
+    if meta_data:
+      meta_data += " "
+    meta_data += f"read_barrier_type:{read_barrier_type}"
+
     meta_data_string = ""
     if meta_data:
       meta_data_string = \
@@ -145,11 +152,17 @@
     c1_file = parse_c1_visualizer_stream("<c1-file>", io.StringIO(c1_string))
     assert len(checker_file.test_cases) == 1
     assert len(c1_file.passes) == 1
-    match_test_case(checker_file.test_cases[0], c1_file.passes[0], c1_file.instruction_set_features)
+    match_test_case(checker_file.test_cases[0],
+                    c1_file.passes[0],
+                    c1_file.instruction_set_features,
+                    c1_file.read_barrier_type)
 
-  def assertDoesNotMatch(self, checker_string, c1_string, isa=None, instruction_set_features=None):
+  def assertDoesNotMatch(self, checker_string, c1_string,
+                         isa=None,
+                         instruction_set_features=None,
+                         read_barrier_type="none"):
     with self.assertRaises(MatchFailedException):
-      self.assertMatches(checker_string, c1_string, isa, instruction_set_features)
+      self.assertMatches(checker_string, c1_string, isa, instruction_set_features, read_barrier_type)
 
   def assertBadStructure(self, checker_string, c1_string):
     with self.assertRaises(BadStructureException):
@@ -1009,3 +1022,196 @@
       "some_isa",
       ImmutableDict({"feature1": False, "feature2": True})
     )
+
+  def test_readBarrierType(self):
+    # CheckEval assertions with no read barrier
+    self.assertMatches(
+        """
+          /// CHECK-EVAL: readBarrierType('none')
+        """,
+        """
+        foo
+        """,
+        None,
+        read_barrier_type="none"
+    )
+    self.assertDoesNotMatch(
+        """
+          /// CHECK-EVAL: readBarrierType('none')
+        """,
+        """
+        foo
+        """,
+        None,
+        read_barrier_type="baker"
+    )
+    self.assertDoesNotMatch(
+        """
+          /// CHECK-EVAL: readBarrierType('none')
+        """,
+        """
+        foo
+        """,
+        None,
+        read_barrier_type="tablelookup"
+    )
+
+    # CheckEval assertions with "baker" read barrier
+    self.assertMatches(
+        """
+          /// CHECK-EVAL: readBarrierType('baker')
+        """,
+        """
+        foo
+        """,
+        None,
+        read_barrier_type="baker"
+    )
+    self.assertDoesNotMatch(
+        """
+          /// CHECK-EVAL: readBarrierType('baker')
+        """,
+        """
+        foo
+        """,
+        None,
+        read_barrier_type="none"
+    )
+    self.assertDoesNotMatch(
+        """
+          /// CHECK-EVAL: readBarrierType('baker')
+        """,
+        """
+        foo
+        """,
+        None,
+        read_barrier_type="tablelookup"
+    )
+
+    # CheckEval assertions with "tablelookup" read barrier
+    self.assertMatches(
+        """
+          /// CHECK-EVAL: readBarrierType('tablelookup')
+        """,
+        """
+        foo
+        """,
+        None,
+        read_barrier_type="tablelookup"
+    )
+    self.assertDoesNotMatch(
+        """
+          /// CHECK-EVAL: readBarrierType('tablelookup')
+        """,
+        """
+        foo
+        """,
+        None,
+        read_barrier_type="none"
+    )
+    self.assertDoesNotMatch(
+        """
+          /// CHECK-EVAL: readBarrierType('tablelookup')
+        """,
+        """
+        foo
+        """,
+        None,
+        read_barrier_type="baker"
+    )
+
+    # CheckIf assertions with no read barrier
+    self.assertMatches(
+      """
+        /// CHECK-IF: readBarrierType('none')
+        ///   CHECK: bar1
+        /// CHECK-ELSE:
+        ///   CHECK: bar2
+        /// CHECK-FI:
+      """,
+      """
+      foo
+      bar1
+      """,
+      None,
+      read_barrier_type="none"
+    )
+    self.assertMatches(
+      """
+        /// CHECK-IF: not readBarrierType('none')
+        ///   CHECK: bar1
+        /// CHECK-ELSE:
+        ///   CHECK: bar2
+        /// CHECK-FI:
+      """,
+      """
+      foo
+      bar2
+      """,
+      None,
+      read_barrier_type="none"
+    )
+
+    # CheckIf assertions with 'baker' read barrier
+    self.assertMatches(
+        """
+        /// CHECK-IF: readBarrierType('baker')
+        ///   CHECK: bar1
+        /// CHECK-ELSE:
+        ///   CHECK: bar2
+        /// CHECK-FI:
+        """,
+        """
+        foo
+        bar1
+        """,
+        None,
+        read_barrier_type="baker"
+    )
+    self.assertMatches(
+        """
+        /// CHECK-IF: not readBarrierType('baker')
+        ///   CHECK: bar1
+        /// CHECK-ELSE:
+        ///   CHECK: bar2
+        /// CHECK-FI:
+        """,
+        """
+        foo
+        bar2
+        """,
+        None,
+        read_barrier_type="baker"
+    )
+
+    # CheckIf assertions with 'tablelookup' read barrier
+    self.assertMatches(
+        """
+        /// CHECK-IF: readBarrierType('tablelookup')
+        ///   CHECK: bar1
+        /// CHECK-ELSE:
+        ///   CHECK: bar2
+        /// CHECK-FI:
+        """,
+        """
+        foo
+        bar1
+        """,
+        None,
+        read_barrier_type="tablelookup"
+    )
+    self.assertMatches(
+        """
+        /// CHECK-IF: not readBarrierType('tablelookup')
+        ///   CHECK: bar1
+        /// CHECK-ELSE:
+        ///   CHECK: bar2
+        /// CHECK-FI:
+        """,
+        """
+        foo
+        bar2
+        """,
+        None,
+        read_barrier_type="tablelookup"
+    )
diff --git a/tools/cpp-define-generator/mirror_class.def b/tools/cpp-define-generator/mirror_class.def
index 062a7aa..2f229e4 100644
--- a/tools/cpp-define-generator/mirror_class.def
+++ b/tools/cpp-define-generator/mirror_class.def
@@ -19,48 +19,46 @@
 #include "subtype_check.h"
 #endif
 
-ASM_DEFINE(MIRROR_CLASS_ACCESS_FLAGS_OFFSET,
-           art::mirror::Class::AccessFlagsOffset().Int32Value())
+ASM_DEFINE(MIRROR_CLASS_ACCESS_FLAGS_OFFSET, art::mirror::Class::AccessFlagsOffset().Int32Value())
+ASM_DEFINE(MIRROR_CLASS_CLINIT_THREAD_ID_OFFSET,
+           art::mirror::Class::ClinitThreadIdOffset().Int32Value())
 ASM_DEFINE(MIRROR_CLASS_COMPONENT_TYPE_OFFSET,
            art::mirror::Class::ComponentTypeOffset().Int32Value())
-ASM_DEFINE(MIRROR_CLASS_DEX_CACHE_OFFSET,
-           art::mirror::Class::DexCacheOffset().Int32Value())
-ASM_DEFINE(MIRROR_CLASS_IF_TABLE_OFFSET,
-           art::mirror::Class::IfTableOffset().Int32Value())
-ASM_DEFINE(MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET,
-           art::mirror::Class::PrimitiveTypeOffset().Int32Value())
-ASM_DEFINE(MIRROR_CLASS_OBJECT_SIZE_ALLOC_FAST_PATH_OFFSET,
-           art::mirror::Class::ObjectSizeAllocFastPathOffset().Int32Value())
-ASM_DEFINE(MIRROR_CLASS_OBJECT_SIZE_OFFSET,
-           art::mirror::Class::ObjectSizeOffset().Int32Value())
-ASM_DEFINE(MIRROR_CLASS_STATUS_OFFSET,
-           art::mirror::Class::StatusOffset().Int32Value())
-ASM_DEFINE(PRIMITIVE_TYPE_SIZE_SHIFT_SHIFT,
-           art::mirror::Class::kPrimitiveTypeSizeShiftShift)
-ASM_DEFINE(MIRROR_CLASS_VTABLE_OFFSET_32,
-           art::mirror::Class::EmbeddedVTableOffset(art::PointerSize::k32).Int32Value())
-ASM_DEFINE(MIRROR_CLASS_VTABLE_OFFSET_64,
-           art::mirror::Class::EmbeddedVTableOffset(art::PointerSize::k64).Int32Value())
+ASM_DEFINE(MIRROR_CLASS_DEX_CACHE_OFFSET, art::mirror::Class::DexCacheOffset().Int32Value())
+ASM_DEFINE(MIRROR_CLASS_IF_TABLE_OFFSET, art::mirror::Class::IfTableOffset().Int32Value())
 ASM_DEFINE(MIRROR_CLASS_IMT_PTR_OFFSET_32,
            art::mirror::Class::ImtPtrOffset(art::PointerSize::k32).Int32Value())
 ASM_DEFINE(MIRROR_CLASS_IMT_PTR_OFFSET_64,
            art::mirror::Class::ImtPtrOffset(art::PointerSize::k64).Int32Value())
-ASM_DEFINE(MIRROR_CLASS_SUPER_CLASS_OFFSET,
-           art::mirror::Class::SuperClassOffset().Int32Value())
+ASM_DEFINE(MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET,
+           art::mirror::Class::PrimitiveTypeOffset().Int32Value())
+ASM_DEFINE(MIRROR_CLASS_OBJECT_SIZE_ALLOC_FAST_PATH_OFFSET,
+           art::mirror::Class::ObjectSizeAllocFastPathOffset().Int32Value())
+ASM_DEFINE(MIRROR_CLASS_OBJECT_SIZE_OFFSET, art::mirror::Class::ObjectSizeOffset().Int32Value())
+ASM_DEFINE(MIRROR_CLASS_STATUS_OFFSET, art::mirror::Class::StatusOffset().Int32Value())
+ASM_DEFINE(MIRROR_CLASS_SUPER_CLASS_OFFSET, art::mirror::Class::SuperClassOffset().Int32Value())
+ASM_DEFINE(MIRROR_CLASS_VTABLE_OFFSET_32,
+           art::mirror::Class::EmbeddedVTableOffset(art::PointerSize::k32).Int32Value())
+ASM_DEFINE(MIRROR_CLASS_VTABLE_OFFSET_64,
+           art::mirror::Class::EmbeddedVTableOffset(art::PointerSize::k64).Int32Value())
+
+ASM_DEFINE(MIRROR_CLASS_STATUS_SHIFT, art::SubtypeCheckBits::BitStructSizeOf())
+ASM_DEFINE(PRIMITIVE_TYPE_SIZE_SHIFT_SHIFT, art::mirror::Class::kPrimitiveTypeSizeShiftShift)
+
 ASM_DEFINE(MIRROR_CLASS_IS_INTERFACE_FLAG, art::kAccInterface)
-ASM_DEFINE(MIRROR_CLASS_IS_INTERFACE_FLAG_BIT,
-           art::WhichPowerOf2(art::kAccInterface))
-ASM_DEFINE(MIRROR_CLASS_IS_VISIBLY_INITIALIZED_OFFSET,
-           art::mirror::Class::StatusOffset().SizeValue() +
-               (art::SubtypeCheckBits::BitStructSizeOf() / art::kBitsPerByte))
-ASM_DEFINE(MIRROR_CLASS_IS_VISIBLY_INITIALIZED_VALUE,
-           art::enum_cast<uint32_t>(art::ClassStatus::kVisiblyInitialized) <<
-               (art::SubtypeCheckBits::BitStructSizeOf() % art::kBitsPerByte))
-ASM_DEFINE(MIRROR_CLASS_IS_INITIALIZING_VALUE,
-           art::enum_cast<uint32_t>(art::ClassStatus::kInitializing) <<
-               (art::SubtypeCheckBits::BitStructSizeOf() % art::kBitsPerByte))
-ASM_DEFINE(MIRROR_CLASS_IS_INITIALIZED_VALUE,
-           art::enum_cast<uint32_t>(art::ClassStatus::kInitialized) <<
-               (art::SubtypeCheckBits::BitStructSizeOf() % art::kBitsPerByte))
-ASM_DEFINE(MIRROR_CLASS_CLINIT_THREAD_ID_OFFSET,
-           art::mirror::Class::ClinitThreadIdOffset().Int32Value())
+ASM_DEFINE(MIRROR_CLASS_IS_INTERFACE_FLAG_BIT, art::WhichPowerOf2(art::kAccInterface))
+ASM_DEFINE(MIRROR_CLASS_STATUS_INITIALIZED,
+           art::enum_cast<uint32_t>(art::ClassStatus::kInitialized))
+ASM_DEFINE(MIRROR_CLASS_STATUS_INITIALIZED_SHIFTED,
+           art::enum_cast<uint32_t>(art::ClassStatus::kInitialized)
+               << art::SubtypeCheckBits::BitStructSizeOf())
+ASM_DEFINE(MIRROR_CLASS_STATUS_INITIALIZING,
+           art::enum_cast<uint32_t>(art::ClassStatus::kInitializing))
+ASM_DEFINE(MIRROR_CLASS_STATUS_INITIALIZING_SHIFTED,
+           art::enum_cast<uint32_t>(art::ClassStatus::kInitializing)
+               << art::SubtypeCheckBits::BitStructSizeOf())
+ASM_DEFINE(MIRROR_CLASS_STATUS_VISIBLY_INITIALIZED,
+           art::enum_cast<uint32_t>(art::ClassStatus::kVisiblyInitialized))
+ASM_DEFINE(MIRROR_CLASS_STATUS_VISIBLY_INITIALIZED_SHIFTED,
+           art::enum_cast<uint32_t>(art::ClassStatus::kVisiblyInitialized)
+               << art::SubtypeCheckBits::BitStructSizeOf())
diff --git a/tools/cpp-define-generator/thread.def b/tools/cpp-define-generator/thread.def
index 97033fc..5cc5f71 100644
--- a/tools/cpp-define-generator/thread.def
+++ b/tools/cpp-define-generator/thread.def
@@ -45,8 +45,6 @@
            art::Thread::ThreadLocalAllocStackTopOffset<art::kRuntimePointerSize>().Int32Value())
 ASM_DEFINE(THREAD_LOCAL_END_OFFSET,
            art::Thread::ThreadLocalEndOffset<art::kRuntimePointerSize>().Int32Value())
-ASM_DEFINE(THREAD_LOCAL_OBJECTS_OFFSET,
-           art::Thread::ThreadLocalObjectsOffset<art::kRuntimePointerSize>().Int32Value())
 ASM_DEFINE(THREAD_LOCAL_POS_OFFSET,
            art::Thread::ThreadLocalPosOffset<art::kRuntimePointerSize>().Int32Value())
 ASM_DEFINE(THREAD_ROSALLOC_RUNS_OFFSET,
diff --git a/tools/create_minidebuginfo/create_minidebuginfo.cc b/tools/create_minidebuginfo/create_minidebuginfo.cc
index 506661a..f13b625 100644
--- a/tools/create_minidebuginfo/create_minidebuginfo.cc
+++ b/tools/create_minidebuginfo/create_minidebuginfo.cc
@@ -94,22 +94,20 @@
   auto* debug_frame = builder->GetDebugFrame();
   debug_frame->Start();
   {
-    std::map<std::basic_string_view<uint8_t>, Elf_Addr> cie_dedup;
+    std::map<std::string_view, Elf_Addr> cie_dedup;
     std::unordered_map<const CIE*, Elf_Addr> new_cie_offset;
     std::deque<std::pair<const FDE*, const CIE*>> entries;
     // Read, de-duplicate and write CIE entries.  Read FDE entries.
     reader.VisitDebugFrame(
         [&](const CIE* cie) {
-          std::basic_string_view<uint8_t> key(cie->data(), cie->size());
+          std::string_view key(reinterpret_cast<const char*>(cie->data()), cie->size());
           auto it = cie_dedup.emplace(key, debug_frame->GetPosition());
           if (/* inserted */ it.second) {
             debug_frame->WriteFully(cie->data(), cie->size());
           }
           new_cie_offset[cie] = it.first->second;
         },
-        [&](const FDE* fde, const CIE* cie) {
-          entries.emplace_back(std::make_pair(fde, cie));
-        });
+        [&](const FDE* fde, const CIE* cie) { entries.emplace_back(std::make_pair(fde, cie)); });
     // Sort FDE entries by opcodes to improve locality for compression (saves ~25%).
     std::stable_sort(entries.begin(), entries.end(), [](const auto& lhs, const auto& rhs) {
       constexpr size_t opcode_offset = sizeof(FDE);
diff --git a/tools/dex2oat_wrapper b/tools/dex2oat_wrapper
index 63e2348..c4424ff 100755
--- a/tools/dex2oat_wrapper
+++ b/tools/dex2oat_wrapper
@@ -1,3 +1,4 @@
+#! /bin/sh
 # Copyright (C) 2020 The Android Open Source Project
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,7 +15,11 @@
 
 # This script is used on host and device. It uses a common subset
 # shell dialect that should work on the host (e.g. bash), and
-# Android (e.g. mksh).
+# Android (e.g. mksh). Try to switch to bash if the shebang above
+# has launched a pessimal shell on host.
+if [ -z "$KSH_VERSION" -a -z "$BASH_VERSION" -a -n "$(which bash)" ]; then
+  exec bash -c ". $0" -- "$@"
+fi
 
 # The purpose of this script is to invoke dex2oat with the right
 # boot classpath and bootclasspath locations.
diff --git a/tools/dexfuzz/src/dexfuzz/executors/Executor.java b/tools/dexfuzz/src/dexfuzz/executors/Executor.java
index 0367a83..1706d5b 100644
--- a/tools/dexfuzz/src/dexfuzz/executors/Executor.java
+++ b/tools/dexfuzz/src/dexfuzz/executors/Executor.java
@@ -115,7 +115,7 @@
     commandBuilder.append("--oat-file=output.oat ");
     commandBuilder.append("--android-root=").append(device.getAndroidHostOut()).append(" ");
     commandBuilder.append("--dex-file=").append(programName).append(" ");
-    commandBuilder.append("--compiler-filter=quicken --runtime-arg -Xnorelocate ");
+    commandBuilder.append("--compiler-filter=verify --runtime-arg -Xnorelocate ");
 
     ExecutionResult verificationResult = device.executeCommand(commandBuilder.toString(), true,
         outputConsumer, errorConsumer);
diff --git a/tools/dist_linux_bionic.sh b/tools/dist_linux_bionic.sh
deleted file mode 100755
index f710310..0000000
--- a/tools/dist_linux_bionic.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2018 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -e
-
-# Builds the given targets using linux-bionic and moves the output files to the
-# DIST_DIR. Takes normal make arguments.
-
-if [[ -z $DIST_DIR ]]; then
-  echo "DIST_DIR must be set!"
-  exit 1
-fi
-
-if [ ! -d art ]; then
-  echo "Script needs to be run at the root of the android tree"
-  exit 1
-fi
-
-vars="$(build/soong/soong_ui.bash --dumpvars-mode --vars="OUT_DIR")"
-# Assign to a variable and eval that, since bash ignores any error status from
-# the command substitution if it's directly on the eval line.
-eval $vars
-
-./art/tools/build_linux_bionic.sh "$@"
-
-mkdir -p $DIST_DIR
-cp -R ${OUT_DIR}/soong/host/* $DIST_DIR/
diff --git a/tools/dmtracedump/Android.bp b/tools/dmtracedump/Android.bp
deleted file mode 100644
index 12d4021..0000000
--- a/tools/dmtracedump/Android.bp
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (C) 2015 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Java method trace dump tool
-
-package {
-    // See: http://go/android-license-faq
-    // A large-scale-change added 'default_applicable_licenses' to import
-    // all of the 'license_kinds' from "art_license"
-    // to get the below license kinds:
-    //   SPDX-license-identifier-Apache-2.0
-    default_applicable_licenses: ["art_license"],
-}
-
-art_cc_binary {
-    name: "dmtracedump",
-    host_supported: true,
-    device_supported: false,
-    visibility: ["//development/build"],
-    srcs: ["tracedump.cc"],
-    cflags: [
-        "-O0",
-        "-g",
-        "-Wall",
-        "-Werror",
-    ],
-    target: {
-        windows: {
-            enabled: true,
-        },
-    },
-}
-
-art_cc_binary {
-    name: "create_test_dmtrace",
-    host_supported: true,
-    device_supported: false,
-    srcs: ["createtesttrace.cc"],
-    cflags: [
-        "-O0",
-        "-g",
-        "-Wall",
-        "-Werror",
-    ],
-}
diff --git a/tools/dmtracedump/createtesttrace.cc b/tools/dmtracedump/createtesttrace.cc
deleted file mode 100644
index 7bb5a7f..0000000
--- a/tools/dmtracedump/createtesttrace.cc
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * Copyright 2015, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * Create a test file in the format required by dmtrace.
- */
-#include "profile.h"  // from VM header
-
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <memory>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/time.h>
-#include <time.h>
-#include <unistd.h>
-
-/*
- * Values from the header of the data file.
- */
-typedef struct DataHeader {
-  uint32_t magic;
-  int16_t version;
-  int16_t offsetToData;
-  int64_t startWhen;
-} DataHeader;
-
-#define VERSION 2
-int32_t versionNumber = VERSION;
-int32_t verbose = 0;
-
-DataHeader header = {0x574f4c53, VERSION, sizeof(DataHeader), 0LL};
-
-const char* versionHeader = "*version\n";
-const char* clockDef = "clock=thread-cpu\n";
-
-const char* keyThreads =
-    "*threads\n"
-    "1      main\n"
-    "2      foo\n"
-    "3      bar\n"
-    "4      blah\n";
-
-const char* keyEnd = "*end\n";
-
-typedef struct dataRecord {
-  uint32_t time;
-  int32_t threadId;
-  uint32_t action; /* 0=entry, 1=exit, 2=exception exit */
-  char* fullName;
-  char* className;
-  char* methodName;
-  char* signature;
-  uint32_t methodId;
-} dataRecord;
-
-dataRecord* records;
-
-#define BUF_SIZE 1024
-char buf[BUF_SIZE];
-
-typedef struct stack {
-  dataRecord** frames;
-  int32_t indentLevel;
-} stack;
-
-/* Mac OS doesn't have strndup(), so implement it here.
- */
-char* strndup(const char* src, size_t len) {
-  char* dest = new char[len + 1];
-  strncpy(dest, src, len);
-  dest[len] = 0;
-  return dest;
-}
-
-/*
- * Parse the input file.  It looks something like this:
- * # This is a comment line
- * 4  1 A
- * 6  1  B
- * 8  1  B
- * 10 1 A
- *
- * where the first column is the time, the second column is the thread id,
- * and the third column is the method (actually just the class name).  The
- * number of spaces between the 2nd and 3rd columns is the indentation and
- * determines the call stack.  Each called method must be indented by one
- * more space.  In the example above, A is called at time 4, A calls B at
- * time 6, B returns at time 8, and A returns at time 10.  Thread 1 is the
- * only thread that is running.
- *
- * An alternative file format leaves out the first two columns:
- * A
- *  B
- *  B
- * A
- *
- * In this file format, the thread id is always 1, and the time starts at
- * 2 and increments by 2 for each line.
- */
-void parseInputFile(const char* inputFileName) {
-  FILE* inputFp = fopen(inputFileName, "re");
-  if (inputFp == nullptr) {
-    perror(inputFileName);
-    exit(1);
-  }
-
-  /* Count the number of lines in the buffer */
-  int32_t numRecords = 0;
-  int32_t maxThreadId = 1;
-  int32_t maxFrames = 0;
-  char* indentEnd;
-  while (fgets(buf, BUF_SIZE, inputFp)) {
-    char* cp = buf;
-    if (*cp == '#') continue;
-    numRecords += 1;
-    if (isdigit(*cp)) {
-      while (isspace(*cp)) cp += 1;
-      int32_t threadId = strtoul(cp, &cp, 0);
-      if (maxThreadId < threadId) maxThreadId = threadId;
-    }
-    indentEnd = cp;
-    while (isspace(*indentEnd)) indentEnd += 1;
-    if (indentEnd - cp + 1 > maxFrames) maxFrames = indentEnd - cp + 1;
-  }
-  int32_t numThreads = maxThreadId + 1;
-
-  /* Add space for a sentinel record at the end */
-  numRecords += 1;
-  records = new dataRecord[numRecords];
-  std::unique_ptr<stack[]> callStack(new stack[numThreads]);
-  for (int32_t ii = 0; ii < numThreads; ++ii) {
-    callStack[ii].frames = nullptr;
-    callStack[ii].indentLevel = 0;
-  }
-
-  rewind(inputFp);
-
-  uint32_t time = 0;
-  int32_t linenum = 0;
-  int32_t nextRecord = 0;
-  int32_t indentLevel = 0;
-  while (fgets(buf, BUF_SIZE, inputFp)) {
-    uint32_t threadId;
-    int32_t len;
-    int32_t indent;
-    int32_t action;
-    char* save_cp;
-
-    linenum += 1;
-    char* cp = buf;
-
-    /* Skip lines that start with '#' */
-    if (*cp == '#') continue;
-
-    /* Get time and thread id */
-    if (!isdigit(*cp)) {
-      /* If the line does not begin with a digit, then fill in
-       * default values for the time and threadId.
-       */
-      time += 2;
-      threadId = 1;
-    } else {
-      time = strtoul(cp, &cp, 0);
-      while (isspace(*cp)) cp += 1;
-      threadId = strtoul(cp, &cp, 0);
-      cp += 1;
-    }
-
-    // Allocate space for the thread stack, if necessary
-    if (callStack[threadId].frames == nullptr) {
-      dataRecord** stk = new dataRecord*[maxFrames];
-      callStack[threadId].frames = stk;
-    }
-    indentLevel = callStack[threadId].indentLevel;
-
-    save_cp = cp;
-    while (isspace(*cp)) {
-      cp += 1;
-    }
-    indent = cp - save_cp + 1;
-    records[nextRecord].time = time;
-    records[nextRecord].threadId = threadId;
-
-    save_cp = cp;
-    while (*cp != '\n') cp += 1;
-
-    /* Remove trailing spaces */
-    cp -= 1;
-    while (isspace(*cp)) cp -= 1;
-    cp += 1;
-    len = cp - save_cp;
-    records[nextRecord].fullName = strndup(save_cp, len);
-
-    /* Parse the name to support "class.method signature" */
-    records[nextRecord].className = nullptr;
-    records[nextRecord].methodName = nullptr;
-    records[nextRecord].signature = nullptr;
-    cp = strchr(save_cp, '.');
-    if (cp) {
-      len = cp - save_cp;
-      if (len > 0) records[nextRecord].className = strndup(save_cp, len);
-      save_cp = cp + 1;
-      cp = strchr(save_cp, ' ');
-      if (cp == nullptr) cp = strchr(save_cp, '\n');
-      if (cp && cp > save_cp) {
-        len = cp - save_cp;
-        records[nextRecord].methodName = strndup(save_cp, len);
-        save_cp = cp + 1;
-        cp = strchr(save_cp, ' ');
-        if (cp == nullptr) cp = strchr(save_cp, '\n');
-        if (cp && cp > save_cp) {
-          len = cp - save_cp;
-          records[nextRecord].signature = strndup(save_cp, len);
-        }
-      }
-    }
-
-    if (verbose) {
-      printf("Indent: %d; IndentLevel: %d; Line: %s", indent, indentLevel, buf);
-    }
-
-    action = 0;
-    if (indent == indentLevel + 1) {  // Entering a method
-      if (verbose) printf("  Entering %s\n", records[nextRecord].fullName);
-      callStack[threadId].frames[indentLevel] = &records[nextRecord];
-    } else if (indent == indentLevel) {  // Exiting a method
-      // Exiting method must be currently on top of stack (unless stack is
-      // empty)
-      if (callStack[threadId].frames[indentLevel - 1] == nullptr) {
-        if (verbose)
-          printf("  Exiting %s (past bottom of stack)\n",
-                 records[nextRecord].fullName);
-        callStack[threadId].frames[indentLevel - 1] = &records[nextRecord];
-        action = 1;
-      } else {
-        if (indentLevel < 1) {
-          fprintf(stderr, "Error: line %d: %s", linenum, buf);
-          fprintf(stderr, "  expected positive (>0) indentation, found %d\n",
-                  indent);
-          exit(1);
-        }
-        char* name = callStack[threadId].frames[indentLevel - 1]->fullName;
-        if (strcmp(name, records[nextRecord].fullName) == 0) {
-          if (verbose) printf("  Exiting %s\n", name);
-          action = 1;
-        } else {  // exiting method doesn't match stack's top method
-          fprintf(stderr, "Error: line %d: %s", linenum, buf);
-          fprintf(stderr, "  expected exit from %s\n",
-                  callStack[threadId].frames[indentLevel - 1]->fullName);
-          exit(1);
-        }
-      }
-    } else {
-      if (nextRecord != 0) {
-        fprintf(stderr, "Error: line %d: %s", linenum, buf);
-        fprintf(stderr, "  expected indentation %d [+1], found %d\n",
-                indentLevel, indent);
-        exit(1);
-      }
-
-      if (verbose) {
-        printf("  Nonzero indent at first record\n");
-        printf("  Entering %s\n", records[nextRecord].fullName);
-      }
-
-      // This is the first line of data, so we allow a larger
-      // initial indent.  This allows us to test popping off more
-      // frames than we entered.
-      indentLevel = indent - 1;
-      callStack[threadId].frames[indentLevel] = &records[nextRecord];
-    }
-
-    if (action == 0)
-      indentLevel += 1;
-    else
-      indentLevel -= 1;
-    records[nextRecord].action = action;
-    callStack[threadId].indentLevel = indentLevel;
-
-    nextRecord += 1;
-  }
-
-  /* Mark the last record with a sentinel */
-  memset(&records[nextRecord], 0, sizeof(dataRecord));
-}
-
-/*
- * Write values to the binary data file.
- */
-void write2LE(FILE* fp, uint16_t val) {
-  putc(val & 0xff, fp);
-  putc(val >> 8, fp);
-}
-
-void write4LE(FILE* fp, uint32_t val) {
-  putc(val & 0xff, fp);
-  putc((val >> 8) & 0xff, fp);
-  putc((val >> 16) & 0xff, fp);
-  putc((val >> 24) & 0xff, fp);
-}
-
-void write8LE(FILE* fp, uint64_t val) {
-  putc(val & 0xff, fp);
-  putc((val >> 8) & 0xff, fp);
-  putc((val >> 16) & 0xff, fp);
-  putc((val >> 24) & 0xff, fp);
-  putc((val >> 32) & 0xff, fp);
-  putc((val >> 40) & 0xff, fp);
-  putc((val >> 48) & 0xff, fp);
-  putc((val >> 56) & 0xff, fp);
-}
-
-void writeDataRecord(FILE* dataFp, int32_t threadId, uint32_t methodVal, uint32_t elapsedTime) {
-  if (versionNumber == 1)
-    putc(threadId, dataFp);
-  else
-    write2LE(dataFp, threadId);
-  write4LE(dataFp, methodVal);
-  write4LE(dataFp, elapsedTime);
-}
-
-void writeDataHeader(FILE* dataFp) {
-  struct timeval tv;
-  struct timezone tz;
-
-  gettimeofday(&tv, &tz);
-  uint64_t startTime = tv.tv_sec;
-  startTime = (startTime << 32) | tv.tv_usec;
-  header.version = versionNumber;
-  write4LE(dataFp, header.magic);
-  write2LE(dataFp, header.version);
-  write2LE(dataFp, header.offsetToData);
-  write8LE(dataFp, startTime);
-}
-
-void writeKeyMethods(FILE* keyFp) {
-  const char* methodStr = "*methods\n";
-  fwrite(methodStr, strlen(methodStr), 1, keyFp);
-
-  /* Assign method ids in multiples of 4 */
-  uint32_t methodId = 0;
-  for (dataRecord* pRecord = records; pRecord->fullName; ++pRecord) {
-    if (pRecord->methodId) continue;
-    uint32_t id = ++methodId << 2;
-    pRecord->methodId = id;
-
-    /* Assign this id to all the other records that have the
-     * same name.
-     */
-    for (dataRecord* pNext = pRecord + 1; pNext->fullName; ++pNext) {
-      if (pNext->methodId) continue;
-      if (strcmp(pRecord->fullName, pNext->fullName) == 0) pNext->methodId = id;
-    }
-    if (pRecord->className == nullptr || pRecord->methodName == nullptr) {
-      fprintf(keyFp, "%#x        %s      m       ()\n", pRecord->methodId,
-              pRecord->fullName);
-    } else if (pRecord->signature == nullptr) {
-      fprintf(keyFp, "%#x        %s      %s      ()\n", pRecord->methodId,
-              pRecord->className, pRecord->methodName);
-    } else {
-      fprintf(keyFp, "%#x        %s      %s      %s\n", pRecord->methodId,
-              pRecord->className, pRecord->methodName, pRecord->signature);
-    }
-  }
-}
-
-void writeKeys(FILE* keyFp) {
-  fprintf(keyFp, "%s%d\n%s", versionHeader, versionNumber, clockDef);
-  fwrite(keyThreads, strlen(keyThreads), 1, keyFp);
-  writeKeyMethods(keyFp);
-  fwrite(keyEnd, strlen(keyEnd), 1, keyFp);
-}
-
-void writeDataRecords(FILE* dataFp) {
-  for (dataRecord* pRecord = records; pRecord->fullName; ++pRecord) {
-    uint32_t val = METHOD_COMBINE(pRecord->methodId, pRecord->action);
-    writeDataRecord(dataFp, pRecord->threadId, val, pRecord->time);
-  }
-}
-
-void writeTrace(const char* traceFileName) {
-  FILE* fp = fopen(traceFileName, "we");
-  if (fp == nullptr) {
-    perror(traceFileName);
-    exit(1);
-  }
-  writeKeys(fp);
-  writeDataHeader(fp);
-  writeDataRecords(fp);
-  fclose(fp);
-}
-
-int32_t parseOptions(int32_t argc, char** argv) {
-  int32_t err = 0;
-  while (1) {
-    int32_t opt = getopt(argc, argv, "v:d");
-    if (opt == -1) break;
-    switch (opt) {
-      case 'v':
-        versionNumber = strtoul(optarg, nullptr, 0);
-        if (versionNumber != 1 && versionNumber != 2) {
-          fprintf(stderr, "Error: version number (%d) must be 1 or 2\n", versionNumber);
-          err = 1;
-        }
-        break;
-      case 'd':
-        verbose = 1;
-        break;
-      default:
-        err = 1;
-        break;
-    }
-  }
-  return err;
-}
-
-int32_t main(int32_t argc, char** argv) {
-  char* inputFile;
-  char* traceFileName = nullptr;
-
-  if (parseOptions(argc, argv) || argc - optind != 2) {
-    fprintf(stderr, "Usage: %s [-v version] [-d] input_file trace_prefix\n", argv[0]);
-    exit(1);
-  }
-
-  inputFile = argv[optind++];
-  parseInputFile(inputFile);
-  traceFileName = argv[optind++];
-
-  writeTrace(traceFileName);
-
-  return 0;
-}
diff --git a/tools/dmtracedump/dmtracedump.pl b/tools/dmtracedump/dmtracedump.pl
deleted file mode 100755
index 6e487c6..0000000
--- a/tools/dmtracedump/dmtracedump.pl
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/perl
-
-opendir(DIR, ".") || die "can't opendir $some_dir: $!";
-@traces = grep { /.*\.dmtrace\.data/ } readdir(DIR);
-
-foreach (@traces)
-{
-    $input = $_;
-    $input =~ s/\.data$//;
-
-    $output = "$input.html";
-
-    print("dmtracedump -h -p $input > $output\n");
-    system("dmtracedump -h -p '$input' > '$output'");
-
-}
-
-closedir DIR;
diff --git a/tools/dmtracedump/dumpdir.sh b/tools/dmtracedump/dumpdir.sh
deleted file mode 100644
index 81992a2..0000000
--- a/tools/dmtracedump/dumpdir.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-FILES=`ls $1/*.data | sed "s/^\\(.*\\).data$/\\1/"`
-
-mkdir -p $2
-
-for F in $FILES
-do
-    G=$2/`echo $F | sed "s/.*\\///g"`.html
-    dmtracedump -h -p $F > $G
-done
diff --git a/tools/dmtracedump/profile.h b/tools/dmtracedump/profile.h
deleted file mode 100644
index 8182352..0000000
--- a/tools/dmtracedump/profile.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * Android's method call profiling goodies.
- */
-#ifndef ART_TOOLS_DMTRACEDUMP_PROFILE_H_
-#define ART_TOOLS_DMTRACEDUMP_PROFILE_H_
-
-/*
- * Enumeration for the two "action" bits.
- */
-enum {
-  METHOD_TRACE_ENTER = 0x00,   // method entry
-  METHOD_TRACE_EXIT = 0x01,    // method exit
-  METHOD_TRACE_UNROLL = 0x02,  // method exited by exception unrolling
-  // 0x03 currently unused
-};
-
-#define TOKEN_CHAR '*'
-
-/*
- * Common definitions, shared with the dump tool.
- */
-#define METHOD_ACTION_MASK 0x03 /* two bits */
-#define METHOD_ID(_method) ((_method) & (~METHOD_ACTION_MASK))
-#define METHOD_ACTION(_method) (((unsigned int)(_method)) & METHOD_ACTION_MASK)
-#define METHOD_COMBINE(_method, _action) ((_method) | (_action))
-
-#endif  // ART_TOOLS_DMTRACEDUMP_PROFILE_H_
diff --git a/tools/dmtracedump/tracedump.cc b/tools/dmtracedump/tracedump.cc
deleted file mode 100644
index 3385f4a..0000000
--- a/tools/dmtracedump/tracedump.cc
+++ /dev/null
@@ -1,2618 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * Process dmtrace output.
- *
- * This is the wrong way to go about it -- C is a clumsy language for
- * shuffling data around.  It'll do for a first pass.
- */
-#include "profile.h"  // from VM header
-
-#include <assert.h>
-#include <errno.h>
-#include <inttypes.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-
-/* Version number in the key file.
- * Version 1 uses one byte for the thread id.
- * Version 2 uses two bytes for the thread ids.
- * Version 3 encodes the record size and adds an optional extra timestamp field.
- */
-int32_t versionNumber;
-
-/* arbitrarily limit indentation */
-#define MAX_STACK_DEPTH 10000
-
-/* thread list in key file is not reliable, so just max out */
-#define MAX_THREADS 32768
-
-/* Size of temporary buffers for escaping html strings */
-#define HTML_BUFSIZE 10240
-
-const char* htmlHeader =
-    "<html>\n<head>\n<script type=\"text/javascript\" "
-    "src=\"%ssortable.js\"></script>\n"
-    "<script langugage=\"javascript\">\n"
-    "function toggle(item) {\n"
-    "    obj=document.getElementById(item);\n"
-    "    visible=(obj.style.display!=\"none\" && obj.style.display!=\"\");\n"
-    "    key=document.getElementById(\"x\" + item);\n"
-    "    if (visible) {\n"
-    "        obj.style.display=\"none\";\n"
-    "        key.innerHTML=\"+\";\n"
-    "    } else {\n"
-    "        obj.style.display=\"block\";\n"
-    "        key.innerHTML=\"-\";\n"
-    "    }\n"
-    "}\n"
-    "function onMouseOver(obj) {\n"
-    "    obj.style.background=\"lightblue\";\n"
-    "}\n"
-    "function onMouseOut(obj) {\n"
-    "    obj.style.background=\"white\";\n"
-    "}\n"
-    "</script>\n"
-    "<style type=\"text/css\">\n"
-    "div { font-family: courier; font-size: 13 }\n"
-    "div.parent { margin-left: 15; display: none }\n"
-    "div.leaf { margin-left: 10 }\n"
-    "div.header { margin-left: 10 }\n"
-    "div.link { margin-left: 10; cursor: move }\n"
-    "span.parent { padding-right: 10; }\n"
-    "span.leaf { padding-right: 10; }\n"
-    "a img { border: 0;}\n"
-    "table.sortable th { border-width: 0px 1px 1px 1px; background-color: "
-    "#ccc;}\n"
-    "a { text-decoration: none; }\n"
-    "a:hover { text-decoration: underline; }\n"
-    "table.sortable th, table.sortable td { text-align: left;}"
-    "table.sortable tr.odd td { background-color: #ddd; }\n"
-    "table.sortable tr.even td { background-color: #fff; }\n"
-    "</style>\n"
-    "</head><body>\n\n";
-
-const char* htmlFooter = "\n</body>\n</html>\n";
-const char* profileSeparator =
-    "======================================================================";
-
-const char* tableHeader =
-    "<table class='sortable' id='%s'><tr>\n"
-    "<th>Method</th>\n"
-    "<th>Run 1 (us)</th>\n"
-    "<th>Run 2 (us)</th>\n"
-    "<th>Diff (us)</th>\n"
-    "<th>Diff (%%)</th>\n"
-    "<th>1: # calls</th>\n"
-    "<th>2: # calls</th>\n"
-    "</tr>\n";
-
-const char* tableHeaderMissing =
-    "<table class='sortable' id='%s'>\n"
-    "<th>Method</th>\n"
-    "<th>Exclusive</th>\n"
-    "<th>Inclusive</th>\n"
-    "<th># calls</th>\n";
-
-#define GRAPH_LABEL_VISITED 0x0001
-#define GRAPH_NODE_VISITED 0x0002
-
-/*
- * Values from the header of the data file.
- */
-typedef struct DataHeader {
-  uint32_t magic;
-  int16_t version;
-  int16_t offsetToData;
-  int64_t startWhen;
-  int16_t recordSize;
-} DataHeader;
-
-/*
- * Entry from the thread list.
- */
-typedef struct ThreadEntry {
-  int32_t threadId;
-  const char* threadName;
-} ThreadEntry;
-
-struct MethodEntry;
-typedef struct TimedMethod {
-  struct TimedMethod* next;
-  uint64_t elapsedInclusive;
-  int32_t numCalls;
-  struct MethodEntry* method;
-} TimedMethod;
-
-typedef struct ClassEntry {
-  const char* className;
-  uint64_t elapsedExclusive;
-  int32_t numMethods;
-  struct MethodEntry** methods; /* list of methods in this class */
-  int32_t numCalls[2];              /* 0=normal, 1=recursive */
-} ClassEntry;
-
-typedef struct UniqueMethodEntry {
-  uint64_t elapsedExclusive;
-  int32_t numMethods;
-  struct MethodEntry** methods; /* list of methods with same name */
-  int32_t numCalls[2];              /* 0=normal, 1=recursive */
-} UniqueMethodEntry;
-
-/*
- * Entry from the method list.
- */
-typedef struct MethodEntry {
-  int64_t methodId;
-  const char* className;
-  const char* methodName;
-  const char* signature;
-  const char* fileName;
-  int32_t lineNum;
-  uint64_t elapsedExclusive;
-  uint64_t elapsedInclusive;
-  uint64_t topExclusive; /* non-recursive exclusive time */
-  uint64_t recursiveInclusive;
-  struct TimedMethod* parents[2];  /* 0=normal, 1=recursive */
-  struct TimedMethod* children[2]; /* 0=normal, 1=recursive */
-  int32_t numCalls[2];             /* 0=normal, 1=recursive */
-  int32_t index;                   /* used after sorting to number methods */
-  int32_t recursiveEntries;        /* number of entries on the stack */
-  int32_t graphState; /* used when graphing to see if this method has been visited before */
-} MethodEntry;
-
-/*
- * The parsed contents of the key file.
- */
-typedef struct DataKeys {
-  char* fileData; /* contents of the entire file */
-  int64_t fileLen;
-  int32_t numThreads;
-  ThreadEntry* threads;
-  int32_t numMethods;
-  MethodEntry* methods; /* 2 extra methods: "toplevel" and "unknown" */
-} DataKeys;
-
-#define TOPLEVEL_INDEX 0
-#define UNKNOWN_INDEX 1
-
-typedef struct StackEntry {
-  MethodEntry* method;
-  uint64_t entryTime;
-} StackEntry;
-
-typedef struct CallStack {
-  int32_t top;
-  StackEntry calls[MAX_STACK_DEPTH];
-  uint64_t lastEventTime;
-  uint64_t threadStartTime;
-} CallStack;
-
-typedef struct DiffEntry {
-  MethodEntry* method1;
-  MethodEntry* method2;
-  int64_t differenceExclusive;
-  int64_t differenceInclusive;
-  double differenceExclusivePercentage;
-  double differenceInclusivePercentage;
-} DiffEntry;
-
-// Global options
-typedef struct Options {
-  const char* traceFileName;
-  const char* diffFileName;
-  const char* graphFileName;
-  int32_t keepDotFile;
-  int32_t dump;
-  int32_t outputHtml;
-  const char* sortableUrl;
-  int32_t threshold;
-} Options;
-
-typedef struct TraceData {
-  int32_t numClasses;
-  ClassEntry* classes;
-  CallStack* stacks[MAX_THREADS];
-  int32_t depth[MAX_THREADS];
-  int32_t numUniqueMethods;
-  UniqueMethodEntry* uniqueMethods;
-} TraceData;
-
-static Options gOptions;
-
-/* Escapes characters in the source string that are html special entities.
- * The escaped string is written to "dest" which must be large enough to
- * hold the result.  A pointer to "dest" is returned.  The characters and
- * their corresponding escape sequences are:
- *  '<'  &lt;
- *  '>'  &gt;
- *  '&'  &amp;
- */
-char* htmlEscape(const char* src, char* dest, int32_t len) {
-  char* destStart = dest;
-
-  if (src == nullptr) return nullptr;
-
-  int32_t nbytes = 0;
-  while (*src) {
-    if (*src == '<') {
-      nbytes += 4;
-      if (nbytes >= len) break;
-      *dest++ = '&';
-      *dest++ = 'l';
-      *dest++ = 't';
-      *dest++ = ';';
-    } else if (*src == '>') {
-      nbytes += 4;
-      if (nbytes >= len) break;
-      *dest++ = '&';
-      *dest++ = 'g';
-      *dest++ = 't';
-      *dest++ = ';';
-    } else if (*src == '&') {
-      nbytes += 5;
-      if (nbytes >= len) break;
-      *dest++ = '&';
-      *dest++ = 'a';
-      *dest++ = 'm';
-      *dest++ = 'p';
-      *dest++ = ';';
-    } else {
-      nbytes += 1;
-      if (nbytes >= len) break;
-      *dest++ = *src;
-    }
-    src += 1;
-  }
-  if (nbytes >= len) {
-    fprintf(stderr, "htmlEscape(): buffer overflow\n");
-    exit(1);
-  }
-  *dest = 0;
-
-  return destStart;
-}
-
-/* Initializes a MethodEntry
- */
-void initMethodEntry(MethodEntry* method, int64_t methodId, const char* className,
-                     const char* methodName, const char* signature, const char* fileName,
-                     const char* lineNumStr) {
-  method->methodId = methodId;
-  method->className = className;
-  method->methodName = methodName;
-  method->signature = signature;
-  method->fileName = fileName;
-  method->lineNum = (lineNumStr != nullptr) ? atoi(lineNumStr) : -1;
-  method->elapsedExclusive = 0;
-  method->elapsedInclusive = 0;
-  method->topExclusive = 0;
-  method->recursiveInclusive = 0;
-  method->parents[0] = nullptr;
-  method->parents[1] = nullptr;
-  method->children[0] = nullptr;
-  method->children[1] = nullptr;
-  method->numCalls[0] = 0;
-  method->numCalls[1] = 0;
-  method->index = 0;
-  method->recursiveEntries = 0;
-}
-
-/*
- * This comparison function is called from qsort() to sort
- * methods into decreasing order of exclusive elapsed time.
- */
-int32_t compareElapsedExclusive(const void* a, const void* b) {
-  const MethodEntry* methodA = *(const MethodEntry**) a;
-  const MethodEntry* methodB = *(const MethodEntry**) b;
-  uint64_t elapsed1 = methodA->elapsedExclusive;
-  uint64_t elapsed2 = methodB->elapsedExclusive;
-  if (elapsed1 < elapsed2) return 1;
-  if (elapsed1 > elapsed2) return -1;
-
-  /* If the elapsed times of two methods are equal, then sort them
-   * into alphabetical order.
-   */
-  int32_t result = strcmp(methodA->className, methodB->className);
-  if (result == 0) {
-    if (methodA->methodName == nullptr || methodB->methodName == nullptr) {
-      int64_t idA = methodA->methodId;
-      int64_t idB = methodB->methodId;
-      if (idA < idB) return -1;
-      if (idA > idB) return 1;
-      return 0;
-    }
-    result = strcmp(methodA->methodName, methodB->methodName);
-    if (result == 0) result = strcmp(methodA->signature, methodB->signature);
-  }
-  return result;
-}
-
-/*
- * This comparison function is called from qsort() to sort
- * methods into decreasing order of inclusive elapsed time.
- */
-int32_t compareElapsedInclusive(const void* a, const void* b) {
-  const MethodEntry* methodA = *(MethodEntry const**) a;
-  const MethodEntry* methodB = *(MethodEntry const**) b;
-  uint64_t elapsed1 = methodA->elapsedInclusive;
-  uint64_t elapsed2 = methodB->elapsedInclusive;
-  if (elapsed1 < elapsed2) return 1;
-  if (elapsed1 > elapsed2) return -1;
-
-  /* If the elapsed times of two methods are equal, then sort them
-   * into alphabetical order.
-   */
-  int32_t result = strcmp(methodA->className, methodB->className);
-  if (result == 0) {
-    if (methodA->methodName == nullptr || methodB->methodName == nullptr) {
-      int64_t idA = methodA->methodId;
-      int64_t idB = methodB->methodId;
-      if (idA < idB) return -1;
-      if (idA > idB) return 1;
-      return 0;
-    }
-    result = strcmp(methodA->methodName, methodB->methodName);
-    if (result == 0) result = strcmp(methodA->signature, methodB->signature);
-  }
-  return result;
-}
-
-/*
- * This comparison function is called from qsort() to sort
- * TimedMethods into decreasing order of inclusive elapsed time.
- */
-int32_t compareTimedMethod(const void* a, const void* b) {
-  const TimedMethod* timedA = (TimedMethod const*) a;
-  const TimedMethod* timedB = (TimedMethod const*) b;
-  uint64_t elapsed1 = timedA->elapsedInclusive;
-  uint64_t elapsed2 = timedB->elapsedInclusive;
-  if (elapsed1 < elapsed2) return 1;
-  if (elapsed1 > elapsed2) return -1;
-
-  /* If the elapsed times of two methods are equal, then sort them
-   * into alphabetical order.
-   */
-  MethodEntry* methodA = timedA->method;
-  MethodEntry* methodB = timedB->method;
-  int32_t result = strcmp(methodA->className, methodB->className);
-  if (result == 0) {
-    if (methodA->methodName == nullptr || methodB->methodName == nullptr) {
-      int64_t idA = methodA->methodId;
-      int64_t idB = methodB->methodId;
-      if (idA < idB) return -1;
-      if (idA > idB) return 1;
-      return 0;
-    }
-    result = strcmp(methodA->methodName, methodB->methodName);
-    if (result == 0) result = strcmp(methodA->signature, methodB->signature);
-  }
-  return result;
-}
-
-/*
- * This comparison function is called from qsort() to sort
- * MethodEntry pointers into alphabetical order of class names.
- */
-int32_t compareClassNames(const void* a, const void* b) {
-  const MethodEntry* methodA = *(const MethodEntry**) a;
-  const MethodEntry* methodB = *(const MethodEntry**) b;
-  int32_t result = strcmp(methodA->className, methodB->className);
-  if (result == 0) {
-    int64_t idA = methodA->methodId;
-    int64_t idB = methodB->methodId;
-    if (idA < idB) return -1;
-    if (idA > idB) return 1;
-    return 0;
-  }
-  return result;
-}
-
-/*
- * This comparison function is called from qsort() to sort
- * classes into decreasing order of exclusive elapsed time.
- */
-int32_t compareClassExclusive(const void* a, const void* b) {
-  const ClassEntry* classA = *(const ClassEntry**) a;
-  const ClassEntry* classB = *(const ClassEntry**) b;
-  uint64_t elapsed1 = classA->elapsedExclusive;
-  uint64_t elapsed2 = classB->elapsedExclusive;
-  if (elapsed1 < elapsed2) return 1;
-  if (elapsed1 > elapsed2) return -1;
-
-  /* If the elapsed times of two classs are equal, then sort them
-   * into alphabetical order.
-   */
-  int32_t result = strcmp(classA->className, classB->className);
-  if (result == 0) {
-    /* Break ties with the first method id.  This is probably not
-     * needed.
-     */
-    int64_t idA = classA->methods[0]->methodId;
-    int64_t idB = classB->methods[0]->methodId;
-    if (idA < idB) return -1;
-    if (idA > idB) return 1;
-    return 0;
-  }
-  return result;
-}
-
-/*
- * This comparison function is called from qsort() to sort
- * MethodEntry pointers into alphabetical order by method name,
- * then by class name.
- */
-int32_t compareMethodNames(const void* a, const void* b) {
-  const MethodEntry* methodA = *(const MethodEntry**) a;
-  const MethodEntry* methodB = *(const MethodEntry**) b;
-  if (methodA->methodName == nullptr || methodB->methodName == nullptr) {
-    return compareClassNames(a, b);
-  }
-  int32_t result = strcmp(methodA->methodName, methodB->methodName);
-  if (result == 0) {
-    result = strcmp(methodA->className, methodB->className);
-    if (result == 0) {
-      int64_t idA = methodA->methodId;
-      int64_t idB = methodB->methodId;
-      if (idA < idB) return -1;
-      if (idA > idB) return 1;
-      return 0;
-    }
-  }
-  return result;
-}
-
-/*
- * This comparison function is called from qsort() to sort
- * unique methods into decreasing order of exclusive elapsed time.
- */
-int32_t compareUniqueExclusive(const void* a, const void* b) {
-  const UniqueMethodEntry* uniqueA = *(const UniqueMethodEntry**) a;
-  const UniqueMethodEntry* uniqueB = *(const UniqueMethodEntry**) b;
-  uint64_t elapsed1 = uniqueA->elapsedExclusive;
-  uint64_t elapsed2 = uniqueB->elapsedExclusive;
-  if (elapsed1 < elapsed2) return 1;
-  if (elapsed1 > elapsed2) return -1;
-
-  /* If the elapsed times of two methods are equal, then sort them
-   * into alphabetical order.
-   */
-  int32_t result = strcmp(uniqueA->methods[0]->className, uniqueB->methods[0]->className);
-  if (result == 0) {
-    int64_t idA = uniqueA->methods[0]->methodId;
-    int64_t idB = uniqueB->methods[0]->methodId;
-    if (idA < idB) return -1;
-    if (idA > idB) return 1;
-    return 0;
-  }
-  return result;
-}
-
-/*
- * Free a DataKeys struct.
- */
-void freeDataKeys(DataKeys* pKeys) {
-  if (pKeys == nullptr) return;
-
-  delete[] pKeys->fileData;
-  delete[] pKeys->threads;
-  delete[] pKeys->methods;
-  delete pKeys;
-}
-
-/*
- * Find the offset to the next occurrence of the specified character.
- *
- * "data" should point somewhere within the current line.  "len" is the
- * number of bytes left in the buffer.
- *
- * Returns -1 if we hit the end of the buffer.
- */
-int32_t findNextChar(const char* data, int32_t len, char lookFor) {
-  const char* start = data;
-
-  while (len > 0) {
-    if (*data == lookFor) return data - start;
-
-    data++;
-    len--;
-  }
-
-  return -1;
-}
-
-/*
- * Count the number of lines until the next token.
- *
- * Returns -1 if none found before EOF.
- */
-int32_t countLinesToToken(const char* data, int32_t len) {
-  int32_t count = 0;
-  int32_t next;
-
-  while (*data != TOKEN_CHAR) {
-    next = findNextChar(data, len, '\n');
-    if (next < 0) return -1;
-    count++;
-    data += next + 1;
-    len -= next + 1;
-  }
-
-  return count;
-}
-
-/*
- * Make sure we're at the start of the right section.
- *
- * Returns the length of the token line, or -1 if something is wrong.
- */
-int32_t checkToken(const char* data, int32_t len, const char* cmpStr) {
-  int32_t cmpLen = strlen(cmpStr);
-  int32_t next;
-
-  if (*data != TOKEN_CHAR) {
-    fprintf(stderr, "ERROR: not at start of %s (found '%.10s')\n", cmpStr, data);
-    return -1;
-  }
-
-  next = findNextChar(data, len, '\n');
-  if (next < cmpLen + 1) return -1;
-
-  if (strncmp(data + 1, cmpStr, cmpLen) != 0) {
-    fprintf(stderr, "ERROR: '%s' not found (got '%.7s')\n", cmpStr, data + 1);
-    return -1;
-  }
-
-  return next + 1;
-}
-
-/*
- * Parse the "*version" section.
- */
-int64_t parseVersion(DataKeys* pKeys, int64_t offset, int32_t verbose) {
-  if (offset < 0) return -1;
-
-  char* data = pKeys->fileData + offset;
-  char* dataEnd = pKeys->fileData + pKeys->fileLen;
-  int32_t next = checkToken(data, dataEnd - data, "version");
-  if (next <= 0) return -1;
-
-  data += next;
-
-  /*
-   * Count the number of items in the "version" section.
-   */
-  int32_t count = countLinesToToken(data, dataEnd - data);
-  if (count <= 0) {
-    fprintf(stderr, "ERROR: failed while reading version (found %d)\n", count);
-    return -1;
-  }
-
-  /* find the end of the line */
-  next = findNextChar(data, dataEnd - data, '\n');
-  if (next < 0) return -1;
-
-  data[next] = '\0';
-  versionNumber = strtoul(data, nullptr, 0);
-  if (verbose) printf("VERSION: %d\n", versionNumber);
-
-  data += next + 1;
-
-  /* skip over the rest of the stuff, which is "name=value" lines */
-  for (int32_t i = 1; i < count; i++) {
-    next = findNextChar(data, dataEnd - data, '\n');
-    if (next < 0) return -1;
-    // data[next] = '\0';
-    // printf("IGNORING: '%s'\n", data);
-    data += next + 1;
-  }
-
-  return data - pKeys->fileData;
-}
-
-/*
- * Parse the "*threads" section.
- */
-int64_t parseThreads(DataKeys* pKeys, int64_t offset) {
-  if (offset < 0) return -1;
-
-  char* data = pKeys->fileData + offset;
-  char* dataEnd = pKeys->fileData + pKeys->fileLen;
-  int32_t next = checkToken(data, dataEnd - data, "threads");
-
-  data += next;
-
-  /*
-   * Count the number of thread entries (one per line).
-   */
-  int32_t count = countLinesToToken(data, dataEnd - data);
-  if (count <= 0) {
-    fprintf(stderr, "ERROR: failed while reading threads (found %d)\n", count);
-    return -1;
-  }
-
-  // printf("+++ found %d threads\n", count);
-  pKeys->threads = new ThreadEntry[count];
-  if (pKeys->threads == nullptr) return -1;
-
-  /*
-   * Extract all entries.
-   */
-  for (int32_t i = 0; i < count; i++) {
-    next = findNextChar(data, dataEnd - data, '\n');
-    assert(next > 0);
-    data[next] = '\0';
-
-    int32_t tab = findNextChar(data, next, '\t');
-    data[tab] = '\0';
-
-    pKeys->threads[i].threadId = atoi(data);
-    pKeys->threads[i].threadName = data + tab + 1;
-
-    data += next + 1;
-  }
-
-  pKeys->numThreads = count;
-  return data - pKeys->fileData;
-}
-
-/*
- * Parse the "*methods" section.
- */
-int64_t parseMethods(DataKeys* pKeys, int64_t offset) {
-  if (offset < 0) return -1;
-
-  char* data = pKeys->fileData + offset;
-  char* dataEnd = pKeys->fileData + pKeys->fileLen;
-  int32_t next = checkToken(data, dataEnd - data, "methods");
-  if (next < 0) return -1;
-
-  data += next;
-
-  /*
-   * Count the number of method entries (one per line).
-   */
-  int32_t count = countLinesToToken(data, dataEnd - data);
-  if (count <= 0) {
-    fprintf(stderr, "ERROR: failed while reading methods (found %d)\n", count);
-    return -1;
-  }
-
-  /* Reserve an extra method at location 0 for the "toplevel" method,
-   * and another extra method for all other "unknown" methods.
-   */
-  count += 2;
-  pKeys->methods = new MethodEntry[count];
-  if (pKeys->methods == nullptr) return -1;
-  initMethodEntry(&pKeys->methods[TOPLEVEL_INDEX], -2, "(toplevel)", nullptr, nullptr,
-                  nullptr, nullptr);
-  initMethodEntry(&pKeys->methods[UNKNOWN_INDEX], -1, "(unknown)", nullptr, nullptr,
-                  nullptr, nullptr);
-
-  /*
-   * Extract all entries, starting with index 2.
-   */
-  for (int32_t i = UNKNOWN_INDEX + 1; i < count; i++) {
-    next = findNextChar(data, dataEnd - data, '\n');
-    assert(next > 0);
-    data[next] = '\0';
-
-    int32_t tab1 = findNextChar(data, next, '\t');
-    int32_t tab2 = findNextChar(data + (tab1 + 1), next - (tab1 + 1), '\t');
-    int32_t tab3 = findNextChar(data + (tab1 + tab2 + 2), next - (tab1 + tab2 + 2), '\t');
-    int32_t tab4 = findNextChar(data + (tab1 + tab2 + tab3 + 3),
-                                next - (tab1 + tab2 + tab3 + 3), '\t');
-    int32_t tab5 = findNextChar(data + (tab1 + tab2 + tab3 + tab4 + 4),
-                                next - (tab1 + tab2 + tab3 + tab4 + 4), '\t');
-    if (tab1 < 0) {
-      fprintf(stderr, "ERROR: missing field on method line: '%s'\n", data);
-      return -1;
-    }
-    assert(data[tab1] == '\t');
-    data[tab1] = '\0';
-
-    char* endptr;
-    int64_t id = strtoul(data, &endptr, 0);
-    if (*endptr != '\0') {
-      fprintf(stderr, "ERROR: bad method ID '%s'\n", data);
-      return -1;
-    }
-
-    // Allow files that specify just a function name, instead of requiring
-    // "class \t method \t signature"
-    if (tab2 > 0 && tab3 > 0) {
-      tab2 += tab1 + 1;
-      tab3 += tab2 + 1;
-      assert(data[tab2] == '\t');
-      assert(data[tab3] == '\t');
-      data[tab2] = data[tab3] = '\0';
-
-      // This is starting to get awkward.  Allow filename and line #.
-      if (tab4 > 0 && tab5 > 0) {
-        tab4 += tab3 + 1;
-        tab5 += tab4 + 1;
-
-        assert(data[tab4] == '\t');
-        assert(data[tab5] == '\t');
-        data[tab4] = data[tab5] = '\0';
-
-        initMethodEntry(&pKeys->methods[i], id, data + tab1 + 1,
-                        data + tab2 + 1, data + tab3 + 1, data + tab4 + 1,
-                        data + tab5 + 1);
-      } else {
-        initMethodEntry(&pKeys->methods[i], id, data + tab1 + 1,
-                        data + tab2 + 1, data + tab3 + 1, nullptr, nullptr);
-      }
-    } else {
-      initMethodEntry(&pKeys->methods[i], id, data + tab1 + 1, nullptr, nullptr, nullptr,
-                      nullptr);
-    }
-
-    data += next + 1;
-  }
-
-  pKeys->numMethods = count;
-  return data - pKeys->fileData;
-}
-
-/*
- * Parse the "*end" section.
- */
-int64_t parseEnd(DataKeys* pKeys, int64_t offset) {
-  if (offset < 0) return -1;
-
-  char* data = pKeys->fileData + offset;
-  char* dataEnd = pKeys->fileData + pKeys->fileLen;
-  int32_t next = checkToken(data, dataEnd - data, "end");
-  if (next < 0) return -1;
-
-  data += next;
-
-  return data - pKeys->fileData;
-}
-
-/*
- * Sort the thread list entries.
- */
-static int32_t compareThreads(const void* thread1, const void* thread2) {
-  return ((const ThreadEntry*) thread1)->threadId -
-         ((const ThreadEntry*) thread2)->threadId;
-}
-
-void sortThreadList(DataKeys* pKeys) {
-  qsort(pKeys->threads, pKeys->numThreads, sizeof(pKeys->threads[0]), compareThreads);
-}
-
-/*
- * Sort the method list entries.
- */
-static int32_t compareMethods(const void* meth1, const void* meth2) {
-  int64_t id1 = ((const MethodEntry*) meth1)->methodId;
-  int64_t id2 = ((const MethodEntry*) meth2)->methodId;
-  if (id1 < id2) return -1;
-  if (id1 > id2) return 1;
-  return 0;
-}
-
-void sortMethodList(DataKeys* pKeys) {
-  qsort(pKeys->methods, pKeys->numMethods, sizeof(MethodEntry), compareMethods);
-}
-
-/*
- * Parse the key section, and return a copy of the parsed contents.
- */
-DataKeys* parseKeys(FILE* fp, int32_t verbose) {
-  int64_t offset;
-  DataKeys* pKeys = new DataKeys();
-  if (pKeys == nullptr) return nullptr;
-  memset(pKeys, 0, sizeof(DataKeys));
-
-  /*
-   * We load the entire file into memory.  We do this, rather than memory-
-   * mapping it, because we want to change some whitespace to NULs.
-   */
-  if (fseek(fp, 0L, SEEK_END) != 0) {
-    perror("fseek");
-    freeDataKeys(pKeys);
-    return nullptr;
-  }
-  pKeys->fileLen = ftell(fp);
-  if (pKeys->fileLen == 0) {
-    fprintf(stderr, "Key file is empty.\n");
-    freeDataKeys(pKeys);
-    return nullptr;
-  }
-  rewind(fp);
-
-  pKeys->fileData = new char[pKeys->fileLen];
-  if (pKeys->fileData == nullptr) {
-    fprintf(stderr, "ERROR: unable to alloc %" PRIu64 " bytes\n", pKeys->fileLen);
-    freeDataKeys(pKeys);
-    return nullptr;
-  }
-
-  if (fread(pKeys->fileData, 1, pKeys->fileLen, fp) != static_cast<size_t>(pKeys->fileLen)) {
-    fprintf(stderr, "ERROR: unable to read %" PRIu64 " bytes from trace file\n", pKeys->fileLen);
-    freeDataKeys(pKeys);
-    return nullptr;
-  }
-
-  offset = 0;
-  offset = parseVersion(pKeys, offset, verbose);
-  offset = parseThreads(pKeys, offset);
-  offset = parseMethods(pKeys, offset);
-  offset = parseEnd(pKeys, offset);
-  if (offset < 0) {
-    freeDataKeys(pKeys);
-    return nullptr;
-  }
-
-  /*
-   * Although it is tempting to reduce our allocation now that we know where the
-   * end of the key section is, there is a pitfall. The method names and
-   * signatures in the method list contain pointers into the fileData area.
-   * Realloc or free will result in corruption.
-   */
-
-  /* Leave fp pointing to the beginning of the data section. */
-  fseek(fp, offset, SEEK_SET);
-
-  sortThreadList(pKeys);
-  sortMethodList(pKeys);
-
-  /*
-   * Dump list of threads.
-   */
-  if (verbose) {
-    printf("Threads (%d):\n", pKeys->numThreads);
-    for (int32_t i = 0; i < pKeys->numThreads; i++) {
-      printf("%2d %s\n", pKeys->threads[i].threadId, pKeys->threads[i].threadName);
-    }
-  }
-
-#if 0
-  /*
-   * Dump list of methods.
-   */
-  if (verbose) {
-    printf("Methods (%d):\n", pKeys->numMethods);
-    for (int32_t i = 0; i < pKeys->numMethods; i++) {
-      printf("0x%08x %s : %s : %s\n",
-             pKeys->methods[i].methodId, pKeys->methods[i].className,
-             pKeys->methods[i].methodName, pKeys->methods[i].signature);
-    }
-  }
-#endif
-
-  return pKeys;
-}
-
-/*
- * Read values from the binary data file.
- */
-
-/*
- * Make the return value "uint32_t" instead of "uint16_t" so that we can detect EOF.
- */
-uint32_t read2LE(FILE* fp) {
-  uint32_t val = getc(fp);
-  val |= getc(fp) << 8;
-  return val;
-}
-uint32_t read4LE(FILE* fp) {
-  uint32_t val = getc(fp);
-  val |= getc(fp) << 8;
-  val |= getc(fp) << 16;
-  val |= getc(fp) << 24;
-  return val;
-}
-uint64_t read8LE(FILE* fp) {
-  uint64_t val = getc(fp);
-  val |= (uint64_t) getc(fp) << 8;
-  val |= (uint64_t) getc(fp) << 16;
-  val |= (uint64_t) getc(fp) << 24;
-  val |= (uint64_t) getc(fp) << 32;
-  val |= (uint64_t) getc(fp) << 40;
-  val |= (uint64_t) getc(fp) << 48;
-  val |= (uint64_t) getc(fp) << 56;
-  return val;
-}
-
-/*
- * Parse the header of the data section.
- *
- * Returns with the file positioned at the start of the record data.
- */
-int32_t parseDataHeader(FILE* fp, DataHeader* pHeader) {
-  pHeader->magic = read4LE(fp);
-  pHeader->version = read2LE(fp);
-  pHeader->offsetToData = read2LE(fp);
-  pHeader->startWhen = read8LE(fp);
-  int32_t bytesToRead = pHeader->offsetToData - 16;
-  if (pHeader->version == 1) {
-    pHeader->recordSize = 9;
-  } else if (pHeader->version == 2) {
-    pHeader->recordSize = 10;
-  } else if (pHeader->version == 3) {
-    pHeader->recordSize = read2LE(fp);
-    bytesToRead -= 2;
-  } else {
-    fprintf(stderr, "Unsupported trace file version: %d\n", pHeader->version);
-    return -1;
-  }
-
-  if (fseek(fp, bytesToRead, SEEK_CUR) != 0) {
-    return -1;
-  }
-
-  return 0;
-}
-
-/*
- * Look up a method by it's method ID.
- *
- * Returns nullptr if no matching method was found.
- */
-MethodEntry* lookupMethod(DataKeys* pKeys, int64_t methodId) {
-  int32_t lo = 0;
-  int32_t hi = pKeys->numMethods - 1;
-
-  while (hi >= lo) {
-    int32_t mid = (hi + lo) / 2;
-
-    int64_t id = pKeys->methods[mid].methodId;
-    if (id == methodId) /* match */
-      return &pKeys->methods[mid];
-    else if (id < methodId) /* too low */
-      lo = mid + 1;
-    else /* too high */
-      hi = mid - 1;
-  }
-
-  return nullptr;
-}
-
-/*
- * Reads the next data record, and assigns the data values to threadId,
- * methodVal and elapsedTime.  On end-of-file, the threadId, methodVal,
- * and elapsedTime are unchanged.  Returns 1 on end-of-file, otherwise
- * returns 0.
- */
-int32_t readDataRecord(FILE* dataFp, DataHeader* dataHeader, int32_t* threadId,
-                   uint32_t* methodVal, uint64_t* elapsedTime) {
-  int32_t id;
-  int32_t bytesToRead = dataHeader->recordSize;
-  if (dataHeader->version == 1) {
-    id = getc(dataFp);
-    bytesToRead -= 1;
-  } else {
-    id = read2LE(dataFp);
-    bytesToRead -= 2;
-  }
-  if (id == EOF) return 1;
-  *threadId = id;
-
-  *methodVal = read4LE(dataFp);
-  *elapsedTime = read4LE(dataFp);
-  bytesToRead -= 8;
-
-  while (bytesToRead-- > 0) {
-    getc(dataFp);
-  }
-
-  if (feof(dataFp)) {
-    fprintf(stderr, "WARNING: hit EOF mid-record\n");
-    return 1;
-  }
-  return 0;
-}
-
-/*
- * Read the key file and use it to produce formatted output from the
- * data file.
- */
-void dumpTrace() {
-  static const char* actionStr[] = {"ent", "xit", "unr", "???"};
-  MethodEntry bogusMethod = {
-      0, "???", "???",        "???",        "???",  -1, 0, 0,
-      0, 0,     {nullptr, nullptr}, {nullptr, nullptr}, {0, 0}, 0,  0, -1};
-  char bogusBuf[80];
-  TraceData traceData;
-
-  // printf("Dumping '%s' '%s'\n", dataFileName, keyFileName);
-
-  char spaces[MAX_STACK_DEPTH + 1];
-  memset(spaces, '.', MAX_STACK_DEPTH);
-  spaces[MAX_STACK_DEPTH] = '\0';
-
-  for (int32_t i = 0; i < MAX_THREADS; i++)
-    traceData.depth[i] = 2;  // adjust for return from start function
-
-  FILE* dataFp = fopen(gOptions.traceFileName, "rbe");
-  if (dataFp == nullptr) return;
-
-  DataKeys* pKeys = parseKeys(dataFp, 1);
-  if (pKeys == nullptr) {
-    fclose(dataFp);
-    return;
-  }
-
-  DataHeader dataHeader;
-  if (parseDataHeader(dataFp, &dataHeader) < 0) {
-    fclose(dataFp);
-    freeDataKeys(pKeys);
-    return;
-  }
-
-  printf("Trace (threadID action usecs class.method signature):\n");
-
-  while (1) {
-    /*
-     * Extract values from file.
-     */
-    int32_t threadId;
-    uint32_t methodVal;
-    uint64_t elapsedTime;
-    if (readDataRecord(dataFp, &dataHeader, &threadId, &methodVal, &elapsedTime))
-      break;
-
-    int32_t action = METHOD_ACTION(methodVal);
-    int64_t methodId = METHOD_ID(methodVal);
-
-    /*
-     * Generate a line of output.
-     */
-    int64_t lastEnter = 0;
-    int32_t mismatch = 0;
-    if (action == METHOD_TRACE_ENTER) {
-      traceData.depth[threadId]++;
-      lastEnter = methodId;
-    } else {
-      /* quick test for mismatched adjacent enter/exit */
-      if (lastEnter != 0 && lastEnter != methodId) mismatch = 1;
-    }
-
-    int32_t printDepth = traceData.depth[threadId];
-    char depthNote = ' ';
-    if (printDepth < 0) {
-      printDepth = 0;
-      depthNote = '-';
-    } else if (printDepth > MAX_STACK_DEPTH) {
-      printDepth = MAX_STACK_DEPTH;
-      depthNote = '+';
-    }
-
-    MethodEntry* method = lookupMethod(pKeys, methodId);
-    if (method == nullptr) {
-      method = &bogusMethod;
-      sprintf(bogusBuf, "methodId: %#" PRIx64 "", methodId);
-      method->signature = bogusBuf;
-    }
-
-    if (method->methodName) {
-      printf("%2d %s%c %8" PRIu64 "%c%s%s.%s %s\n", threadId, actionStr[action],
-             mismatch ? '!' : ' ', elapsedTime, depthNote,
-             spaces + (MAX_STACK_DEPTH - printDepth), method->className,
-             method->methodName, method->signature);
-    } else {
-      printf("%2d %s%c %8" PRIu64 "%c%s%s\n", threadId, actionStr[action],
-             mismatch ? '!' : ' ', elapsedTime, depthNote,
-             spaces + (MAX_STACK_DEPTH - printDepth), method->className);
-    }
-
-    if (action != METHOD_TRACE_ENTER) {
-      traceData.depth[threadId]--; /* METHOD_TRACE_EXIT or METHOD_TRACE_UNROLL */
-      lastEnter = 0;
-    }
-
-    mismatch = 0;
-  }
-
-  fclose(dataFp);
-  freeDataKeys(pKeys);
-}
-
-/* This routine adds the given time to the parent and child methods.
- * This is called when the child routine exits, after the child has
- * been popped from the stack.  The elapsedTime parameter is the
- * duration of the child routine, including time spent in called routines.
- */
-void addInclusiveTime(MethodEntry* parent, MethodEntry* child, uint64_t elapsedTime) {
-#if 0
-  bool verbose = false;
-  if (strcmp(child->className, debugClassName) == 0)
-    verbose = true;
-#endif
-
-  int32_t childIsRecursive = (child->recursiveEntries > 0);
-  int32_t parentIsRecursive = (parent->recursiveEntries > 1);
-
-  if (child->recursiveEntries == 0) {
-    child->elapsedInclusive += elapsedTime;
-  } else if (child->recursiveEntries == 1) {
-    child->recursiveInclusive += elapsedTime;
-  }
-  child->numCalls[childIsRecursive] += 1;
-
-#if 0
-  if (verbose) {
-    fprintf(stderr,
-            "%s %d elapsedTime: %lld eI: %lld, rI: %lld\n",
-            child->className, child->recursiveEntries,
-            elapsedTime, child->elapsedInclusive,
-            child->recursiveInclusive);
-  }
-#endif
-
-  /* Find the child method in the parent */
-  TimedMethod* pTimed;
-  TimedMethod* children = parent->children[parentIsRecursive];
-  for (pTimed = children; pTimed; pTimed = pTimed->next) {
-    if (pTimed->method == child) {
-      pTimed->elapsedInclusive += elapsedTime;
-      pTimed->numCalls += 1;
-      break;
-    }
-  }
-  if (pTimed == nullptr) {
-    /* Allocate a new TimedMethod */
-    pTimed = new TimedMethod();
-    pTimed->elapsedInclusive = elapsedTime;
-    pTimed->numCalls = 1;
-    pTimed->method = child;
-
-    /* Add it to the front of the list */
-    pTimed->next = children;
-    parent->children[parentIsRecursive] = pTimed;
-  }
-
-  /* Find the parent method in the child */
-  TimedMethod* parents = child->parents[childIsRecursive];
-  for (pTimed = parents; pTimed; pTimed = pTimed->next) {
-    if (pTimed->method == parent) {
-      pTimed->elapsedInclusive += elapsedTime;
-      pTimed->numCalls += 1;
-      break;
-    }
-  }
-  if (pTimed == nullptr) {
-    /* Allocate a new TimedMethod */
-    pTimed = new TimedMethod();
-    pTimed->elapsedInclusive = elapsedTime;
-    pTimed->numCalls = 1;
-    pTimed->method = parent;
-
-    /* Add it to the front of the list */
-    pTimed->next = parents;
-    child->parents[childIsRecursive] = pTimed;
-  }
-
-#if 0
-  if (verbose) {
-    fprintf(stderr,
-            "  %s %d eI: %lld\n",
-            parent->className, parent->recursiveEntries,
-            pTimed->elapsedInclusive);
-  }
-#endif
-}
-
-/* Sorts a linked list and returns a newly allocated array containing
- * the sorted entries.
- */
-TimedMethod* sortTimedMethodList(TimedMethod* list, int32_t* num) {
-  /* Count the elements */
-  TimedMethod* pTimed;
-  int32_t num_entries = 0;
-  for (pTimed = list; pTimed; pTimed = pTimed->next) num_entries += 1;
-  *num = num_entries;
-  if (num_entries == 0) return nullptr;
-
-  /* Copy all the list elements to a new array and sort them */
-  int32_t ii;
-  TimedMethod* sorted = new TimedMethod[num_entries];
-  for (ii = 0, pTimed = list; pTimed; pTimed = pTimed->next, ++ii)
-    memcpy(&sorted[ii], pTimed, sizeof(TimedMethod));
-  qsort(sorted, num_entries, sizeof(TimedMethod), compareTimedMethod);
-
-  /* Fix up the "next" pointers so that they work. */
-  for (ii = 0; ii < num_entries - 1; ++ii) sorted[ii].next = &sorted[ii + 1];
-  sorted[num_entries - 1].next = nullptr;
-
-  return sorted;
-}
-
-/* Define flag values for printInclusiveMethod() */
-static const int32_t kIsRecursive = 1;
-
-/* This prints the inclusive stats for all the parents or children of a
- * method, depending on the list that is passed in.
- */
-void printInclusiveMethod(MethodEntry* method, TimedMethod* list, int32_t numCalls, int32_t flags) {
-  char buf[80];
-  const char* anchor_close = "";
-  const char* spaces = "      "; /* 6 spaces */
-  int32_t num_spaces = strlen(spaces);
-  const char* space_ptr = &spaces[num_spaces];
-  char classBuf[HTML_BUFSIZE], methodBuf[HTML_BUFSIZE];
-  char signatureBuf[HTML_BUFSIZE];
-
-  if (gOptions.outputHtml) anchor_close = "</a>";
-
-  int32_t num;
-  TimedMethod* sorted = sortTimedMethodList(list, &num);
-  double methodTotal = method->elapsedInclusive;
-  for (TimedMethod* pTimed = sorted; pTimed; pTimed = pTimed->next) {
-    MethodEntry* relative = pTimed->method;
-    const char* className = relative->className;
-    const char* methodName = relative->methodName;
-    const char* signature = relative->signature;
-    double per = 100.0 * pTimed->elapsedInclusive / methodTotal;
-    sprintf(buf, "[%d]", relative->index);
-    if (gOptions.outputHtml) {
-      int32_t len = strlen(buf);
-      if (len > num_spaces) len = num_spaces;
-      sprintf(buf, "<a href=\"#m%d\">[%d]", relative->index, relative->index);
-      space_ptr = &spaces[len];
-      className = htmlEscape(className, classBuf, HTML_BUFSIZE);
-      methodName = htmlEscape(methodName, methodBuf, HTML_BUFSIZE);
-      signature = htmlEscape(signature, signatureBuf, HTML_BUFSIZE);
-    }
-    int32_t nCalls = numCalls;
-    if (nCalls == 0) nCalls = relative->numCalls[0] + relative->numCalls[1];
-    if (relative->methodName) {
-      if (flags & kIsRecursive) {
-        // Don't display percentages for recursive functions
-        printf("%6s %5s   %6s %s%6s%s %6d/%-6d %9" PRIu64 " %s.%s %s\n", "", "",
-               "", space_ptr, buf, anchor_close, pTimed->numCalls, nCalls,
-               pTimed->elapsedInclusive, className, methodName, signature);
-      } else {
-        printf("%6s %5s   %5.1f%% %s%6s%s %6d/%-6d %9" PRIu64 " %s.%s %s\n", "",
-               "", per, space_ptr, buf, anchor_close, pTimed->numCalls, nCalls,
-               pTimed->elapsedInclusive, className, methodName, signature);
-      }
-    } else {
-      if (flags & kIsRecursive) {
-        // Don't display percentages for recursive functions
-        printf("%6s %5s   %6s %s%6s%s %6d/%-6d %9" PRIu64 " %s\n", "", "", "",
-               space_ptr, buf, anchor_close, pTimed->numCalls, nCalls,
-               pTimed->elapsedInclusive, className);
-      } else {
-        printf("%6s %5s   %5.1f%% %s%6s%s %6d/%-6d %9" PRIu64 " %s\n", "", "",
-               per, space_ptr, buf, anchor_close, pTimed->numCalls, nCalls,
-               pTimed->elapsedInclusive, className);
-      }
-    }
-  }
-}
-
-void countRecursiveEntries(CallStack* pStack, int32_t top, MethodEntry* method) {
-  method->recursiveEntries = 0;
-  for (int32_t ii = 0; ii < top; ++ii) {
-    if (pStack->calls[ii].method == method) method->recursiveEntries += 1;
-  }
-}
-
-void stackDump(CallStack* pStack, int32_t top) {
-  for (int32_t ii = 0; ii < top; ++ii) {
-    MethodEntry* method = pStack->calls[ii].method;
-    uint64_t entryTime = pStack->calls[ii].entryTime;
-    if (method->methodName) {
-      fprintf(stderr, "  %2d: %8" PRIu64 " %s.%s %s\n", ii, entryTime,
-              method->className, method->methodName, method->signature);
-    } else {
-      fprintf(stderr, "  %2d: %8" PRIu64 " %s\n", ii, entryTime, method->className);
-    }
-  }
-}
-
-void outputTableOfContents() {
-  printf("<a name=\"contents\"></a>\n");
-  printf("<h2>Table of Contents</h2>\n");
-  printf("<ul>\n");
-  printf("  <li><a href=\"#exclusive\">Exclusive profile</a></li>\n");
-  printf("  <li><a href=\"#inclusive\">Inclusive profile</a></li>\n");
-  printf("  <li><a href=\"#class\">Class/method profile</a></li>\n");
-  printf("  <li><a href=\"#method\">Method/class profile</a></li>\n");
-  printf("</ul>\n\n");
-}
-
-void outputNavigationBar() {
-  printf("<a href=\"#contents\">[Top]</a>\n");
-  printf("<a href=\"#exclusive\">[Exclusive]</a>\n");
-  printf("<a href=\"#inclusive\">[Inclusive]</a>\n");
-  printf("<a href=\"#class\">[Class]</a>\n");
-  printf("<a href=\"#method\">[Method]</a>\n");
-  printf("<br><br>\n");
-}
-
-void printExclusiveProfile(MethodEntry** pMethods, int32_t numMethods, uint64_t sumThreadTime) {
-  char classBuf[HTML_BUFSIZE], methodBuf[HTML_BUFSIZE];
-  char signatureBuf[HTML_BUFSIZE];
-  const char* anchor_close = "";
-  char anchor_buf[80];
-  anchor_buf[0] = 0;
-  if (gOptions.outputHtml) {
-    anchor_close = "</a>";
-    printf("<a name=\"exclusive\"></a>\n");
-    printf("<hr>\n");
-    outputNavigationBar();
-  } else {
-    printf("\n%s\n", profileSeparator);
-  }
-
-  /* First, sort the methods into decreasing order of inclusive
-   * elapsed time so that we can assign the method indices.
-   */
-  qsort(pMethods, numMethods, sizeof(MethodEntry*), compareElapsedInclusive);
-
-  for (int32_t ii = 0; ii < numMethods; ++ii) pMethods[ii]->index = ii;
-
-  /* Sort the methods into decreasing order of exclusive elapsed time. */
-  qsort(pMethods, numMethods, sizeof(MethodEntry*), compareElapsedExclusive);
-
-  printf("Total cycles: %" PRIu64 "\n\n", sumThreadTime);
-  if (gOptions.outputHtml) {
-    printf("<br><br>\n");
-  }
-  printf("Exclusive elapsed times for each method, not including time spent in\n");
-  printf("children, sorted by exclusive time.\n\n");
-  if (gOptions.outputHtml) {
-    printf("<br><br>\n<pre>\n");
-  }
-
-  printf("    Usecs  self %%  sum %%  Method\n");
-
-  double sum = 0;
-  double total = sumThreadTime;
-  for (int32_t ii = 0; ii < numMethods; ++ii) {
-    MethodEntry* method = pMethods[ii];
-    /* Don't show methods with zero cycles */
-    if (method->elapsedExclusive == 0) break;
-    const char* className = method->className;
-    const char* methodName = method->methodName;
-    const char* signature = method->signature;
-    sum += method->elapsedExclusive;
-    double per = 100.0 * method->elapsedExclusive / total;
-    double sum_per = 100.0 * sum / total;
-    if (gOptions.outputHtml) {
-      sprintf(anchor_buf, "<a href=\"#m%d\">", method->index);
-      className = htmlEscape(className, classBuf, HTML_BUFSIZE);
-      methodName = htmlEscape(methodName, methodBuf, HTML_BUFSIZE);
-      signature = htmlEscape(signature, signatureBuf, HTML_BUFSIZE);
-    }
-    if (method->methodName) {
-      printf("%9" PRIu64 "  %6.2f %6.2f  %s[%d]%s %s.%s %s\n",
-             method->elapsedExclusive, per, sum_per, anchor_buf, method->index,
-             anchor_close, className, methodName, signature);
-    } else {
-      printf("%9" PRIu64 "  %6.2f %6.2f  %s[%d]%s %s\n",
-             method->elapsedExclusive, per, sum_per, anchor_buf, method->index,
-             anchor_close, className);
-    }
-  }
-  if (gOptions.outputHtml) {
-    printf("</pre>\n");
-  }
-}
-
-/* check to make sure that the child method meets the threshold of the parent */
-int32_t checkThreshold(MethodEntry* parent, MethodEntry* child) {
-  double parentTime = parent->elapsedInclusive;
-  double childTime = child->elapsedInclusive;
-  int64_t percentage = (childTime / parentTime) * 100.0;
-  return (percentage < gOptions.threshold) ? 0 : 1;
-}
-
-void createLabels(FILE* file, MethodEntry* method) {
-  fprintf(file,
-          "node%d[label = \"[%d] %s.%s (%" PRIu64 ", %" PRIu64 ", %d)\"]\n",
-          method->index, method->index, method->className, method->methodName,
-          method->elapsedInclusive / 1000, method->elapsedExclusive / 1000,
-          method->numCalls[0]);
-
-  method->graphState = GRAPH_LABEL_VISITED;
-
-  for (TimedMethod* child = method->children[0]; child; child = child->next) {
-    MethodEntry* childMethod = child->method;
-
-    if ((childMethod->graphState & GRAPH_LABEL_VISITED) == 0 &&
-        checkThreshold(method, childMethod)) {
-      createLabels(file, child->method);
-    }
-  }
-}
-
-void createLinks(FILE* file, MethodEntry* method) {
-  method->graphState |= GRAPH_NODE_VISITED;
-
-  for (TimedMethod* child = method->children[0]; child; child = child->next) {
-    MethodEntry* childMethod = child->method;
-    if (checkThreshold(method, child->method)) {
-      fprintf(file, "node%d -> node%d\n", method->index, child->method->index);
-      // only visit children that haven't been visited before
-      if ((childMethod->graphState & GRAPH_NODE_VISITED) == 0) {
-        createLinks(file, child->method);
-      }
-    }
-  }
-}
-
-void createInclusiveProfileGraphNew(DataKeys* dataKeys) {
-  // create a temporary file in /tmp
-  char path[FILENAME_MAX];
-  if (gOptions.keepDotFile) {
-    snprintf(path, FILENAME_MAX, "%s.dot", gOptions.graphFileName);
-  } else {
-    snprintf(path, FILENAME_MAX, "dot-%d-%d.dot", (int32_t)time(nullptr), rand());
-  }
-
-  FILE* file = fopen(path, "we+");
-
-  fprintf(file, "digraph g {\nnode [shape = record,height=.1];\n");
-
-  createLabels(file, dataKeys->methods);
-  createLinks(file, dataKeys->methods);
-
-  fprintf(file, "}");
-  fclose(file);
-
-  // now that we have the dot file generate the image
-  char command[1024];
-  snprintf(command, 1024, "dot -Tpng -o \"%s\" \"%s\"", gOptions.graphFileName, path);
-
-  system(command);
-
-  if (!gOptions.keepDotFile) {
-    remove(path);
-  }
-}
-
-void printInclusiveProfile(MethodEntry** pMethods, int32_t numMethods, uint64_t sumThreadTime) {
-  char classBuf[HTML_BUFSIZE], methodBuf[HTML_BUFSIZE];
-  char signatureBuf[HTML_BUFSIZE];
-  char anchor_buf[80];
-  anchor_buf[0] = 0;
-  if (gOptions.outputHtml) {
-    printf("<a name=\"inclusive\"></a>\n");
-    printf("<hr>\n");
-    outputNavigationBar();
-  } else {
-    printf("\n%s\n", profileSeparator);
-  }
-
-  /* Sort the methods into decreasing order of inclusive elapsed time. */
-  qsort(pMethods, numMethods, sizeof(MethodEntry*), compareElapsedInclusive);
-
-  printf("\nInclusive elapsed times for each method and its parents and children,\n");
-  printf("sorted by inclusive time.\n\n");
-
-  if (gOptions.outputHtml) {
-    printf("<br><br>\n<pre>\n");
-  }
-
-  printf("index  %%/total %%/self  index     calls         usecs name\n");
-
-  double total = sumThreadTime;
-  for (int32_t ii = 0; ii < numMethods; ++ii) {
-    char buf[40];
-
-    MethodEntry* method = pMethods[ii];
-    /* Don't show methods with zero cycles */
-    if (method->elapsedInclusive == 0) break;
-
-    const char* className = method->className;
-    const char* methodName = method->methodName;
-    const char* signature = method->signature;
-
-    if (gOptions.outputHtml) {
-      printf("<a name=\"m%d\"></a>", method->index);
-      className = htmlEscape(className, classBuf, HTML_BUFSIZE);
-      methodName = htmlEscape(methodName, methodBuf, HTML_BUFSIZE);
-      signature = htmlEscape(signature, signatureBuf, HTML_BUFSIZE);
-    }
-    printf("----------------------------------------------------\n");
-
-    /* Sort and print the parents */
-    int32_t numCalls = method->numCalls[0] + method->numCalls[1];
-    printInclusiveMethod(method, method->parents[0], numCalls, 0);
-    if (method->parents[1]) {
-      printf("               +++++++++++++++++++++++++\n");
-      printInclusiveMethod(method, method->parents[1], numCalls, kIsRecursive);
-    }
-
-    double per = 100.0 * method->elapsedInclusive / total;
-    sprintf(buf, "[%d]", ii);
-    if (method->methodName) {
-      printf("%-6s %5.1f%%   %5s %6s %6d+%-6d %9" PRIu64 " %s.%s %s\n", buf,
-             per, "", "", method->numCalls[0], method->numCalls[1],
-             method->elapsedInclusive, className, methodName, signature);
-    } else {
-      printf("%-6s %5.1f%%   %5s %6s %6d+%-6d %9" PRIu64 " %s\n", buf, per, "",
-             "", method->numCalls[0], method->numCalls[1],
-             method->elapsedInclusive, className);
-    }
-    double excl_per = 100.0 * method->topExclusive / method->elapsedInclusive;
-    printf("%6s %5s   %5.1f%% %6s %6s %6s %9" PRIu64 "\n", "", "", excl_per,
-           "excl", "", "", method->topExclusive);
-
-    /* Sort and print the children */
-    printInclusiveMethod(method, method->children[0], 0, 0);
-    if (method->children[1]) {
-      printf("               +++++++++++++++++++++++++\n");
-      printInclusiveMethod(method, method->children[1], 0, kIsRecursive);
-    }
-  }
-  if (gOptions.outputHtml) {
-    printf("</pre>\n");
-  }
-}
-
-void createClassList(TraceData* traceData, MethodEntry** pMethods, int32_t numMethods) {
-  /* Sort the methods into alphabetical order to find the unique class
-   * names.
-   */
-  qsort(pMethods, numMethods, sizeof(MethodEntry*), compareClassNames);
-
-  /* Count the number of unique class names. */
-  const char* currentClassName = "";
-  const char* firstClassName = nullptr;
-  traceData->numClasses = 0;
-  for (int32_t ii = 0; ii < numMethods; ++ii) {
-    if (pMethods[ii]->methodName == nullptr) {
-      continue;
-    }
-    if (strcmp(pMethods[ii]->className, currentClassName) != 0) {
-      // Remember the first one
-      if (firstClassName == nullptr) {
-        firstClassName = pMethods[ii]->className;
-      }
-      traceData->numClasses += 1;
-      currentClassName = pMethods[ii]->className;
-    }
-  }
-
-  if (traceData->numClasses == 0) {
-    traceData->classes = nullptr;
-    return;
-  }
-
-  /* Allocate space for all of the unique class names */
-  traceData->classes = new ClassEntry[traceData->numClasses];
-
-  /* Initialize the classes array */
-  memset(traceData->classes, 0, sizeof(ClassEntry) * traceData->numClasses);
-  ClassEntry* pClass = traceData->classes;
-  pClass->className = currentClassName = firstClassName;
-  int32_t prevNumMethods = 0;
-  for (int32_t ii = 0; ii < numMethods; ++ii) {
-    if (pMethods[ii]->methodName == nullptr) {
-      continue;
-    }
-    if (strcmp(pMethods[ii]->className, currentClassName) != 0) {
-      pClass->numMethods = prevNumMethods;
-      (++pClass)->className = currentClassName = pMethods[ii]->className;
-      prevNumMethods = 0;
-    }
-    prevNumMethods += 1;
-  }
-  pClass->numMethods = prevNumMethods;
-
-  /* Create the array of MethodEntry pointers for each class */
-  pClass = nullptr;
-  currentClassName = "";
-  int32_t nextMethod = 0;
-  for (int32_t ii = 0; ii < numMethods; ++ii) {
-    if (pMethods[ii]->methodName == nullptr) {
-      continue;
-    }
-    if (strcmp(pMethods[ii]->className, currentClassName) != 0) {
-      currentClassName = pMethods[ii]->className;
-      if (pClass == nullptr)
-        pClass = traceData->classes;
-      else
-        pClass++;
-      /* Allocate space for the methods array */
-      pClass->methods = new MethodEntry*[pClass->numMethods];
-      nextMethod = 0;
-    }
-    pClass->methods[nextMethod++] = pMethods[ii];
-  }
-}
-
-/* Prints a number of html non-breaking spaces according so that the length
- * of the string "buf" is at least "width" characters wide.  If width is
- * negative, then trailing spaces are added instead of leading spaces.
- */
-void printHtmlField(char* buf, int32_t width) {
-  int32_t leadingSpaces = 1;
-  if (width < 0) {
-    width = -width;
-    leadingSpaces = 0;
-  }
-  int32_t len = strlen(buf);
-  int32_t numSpaces = width - len;
-  if (numSpaces <= 0) {
-    printf("%s", buf);
-    return;
-  }
-  if (leadingSpaces == 0) printf("%s", buf);
-  for (int32_t ii = 0; ii < numSpaces; ++ii) printf("&nbsp;");
-  if (leadingSpaces == 1) printf("%s", buf);
-}
-
-void printClassProfiles(TraceData* traceData, uint64_t sumThreadTime) {
-  char classBuf[HTML_BUFSIZE];
-  char methodBuf[HTML_BUFSIZE];
-  char signatureBuf[HTML_BUFSIZE];
-
-  if (gOptions.outputHtml) {
-    printf("<a name=\"class\"></a>\n");
-    printf("<hr>\n");
-    outputNavigationBar();
-  } else {
-    printf("\n%s\n", profileSeparator);
-  }
-
-  if (traceData->numClasses == 0) {
-    printf("\nNo classes.\n");
-    if (gOptions.outputHtml) {
-      printf("<br><br>\n");
-    }
-    return;
-  }
-
-  printf("\nExclusive elapsed time for each class, summed over all the methods\n");
-  printf("in the class.\n\n");
-  if (gOptions.outputHtml) {
-    printf("<br><br>\n");
-  }
-
-  /* For each class, sum the exclusive times in all of the methods
-   * in that class.  Also sum the number of method calls.  Also
-   * sort the methods so the most expensive appear at the top.
-   */
-  ClassEntry* pClass = traceData->classes;
-  for (int32_t ii = 0; ii < traceData->numClasses; ++ii, ++pClass) {
-    // printf("%s %d methods\n", pClass->className, pClass->numMethods);
-    int32_t numMethods = pClass->numMethods;
-    for (int32_t jj = 0; jj < numMethods; ++jj) {
-      MethodEntry* method = pClass->methods[jj];
-      pClass->elapsedExclusive += method->elapsedExclusive;
-      pClass->numCalls[0] += method->numCalls[0];
-      pClass->numCalls[1] += method->numCalls[1];
-    }
-
-    /* Sort the methods into decreasing order of exclusive time */
-    qsort(pClass->methods, numMethods, sizeof(MethodEntry*), compareElapsedExclusive);
-  }
-
-  /* Allocate an array of pointers to the classes for more efficient sorting. */
-  ClassEntry** pClasses = new ClassEntry*[traceData->numClasses];
-  for (int32_t ii = 0; ii < traceData->numClasses; ++ii)
-    pClasses[ii] = &traceData->classes[ii];
-
-  /* Sort the classes into decreasing order of exclusive time */
-  qsort(pClasses, traceData->numClasses, sizeof(ClassEntry*), compareClassExclusive);
-
-  if (gOptions.outputHtml) {
-    printf(
-        "<div class=\"header\"><span "
-        "class=\"parent\">&nbsp;</span>&nbsp;&nbsp;&nbsp;");
-    printf("Cycles %%/total Cumul.%% &nbsp;Calls+Recur&nbsp; Class</div>\n");
-  } else {
-    printf("   Cycles %%/total Cumul.%%  Calls+Recur  Class\n");
-  }
-
-  double sum = 0;
-  double total = sumThreadTime;
-  for (int32_t ii = 0; ii < traceData->numClasses; ++ii) {
-    /* Skip classes with zero cycles */
-    pClass = pClasses[ii];
-    if (pClass->elapsedExclusive == 0) break;
-
-    sum += pClass->elapsedExclusive;
-    double per = 100.0 * pClass->elapsedExclusive / total;
-    double sum_per = 100.0 * sum / total;
-    const char* className = pClass->className;
-    if (gOptions.outputHtml) {
-      char buf[80];
-
-      className = htmlEscape(className, classBuf, HTML_BUFSIZE);
-      printf(
-          "<div class=\"link\" onClick=\"javascript:toggle('d%d')\" "
-          "onMouseOver=\"javascript:onMouseOver(this)\" "
-          "onMouseOut=\"javascript:onMouseOut(this)\"><span class=\"parent\" "
-          "id=\"xd%d\">+</span>",
-          ii, ii);
-      sprintf(buf, "%" PRIu64, pClass->elapsedExclusive);
-      printHtmlField(buf, 9);
-      printf(" ");
-      sprintf(buf, "%.1f", per);
-      printHtmlField(buf, 7);
-      printf(" ");
-      sprintf(buf, "%.1f", sum_per);
-      printHtmlField(buf, 7);
-      printf(" ");
-      sprintf(buf, "%d", pClass->numCalls[0]);
-      printHtmlField(buf, 6);
-      printf("+");
-      sprintf(buf, "%d", pClass->numCalls[1]);
-      printHtmlField(buf, -6);
-      printf(" ");
-      printf("%s", className);
-      printf("</div>\n");
-      printf("<div class=\"parent\" id=\"d%d\">\n", ii);
-    } else {
-      printf("---------------------------------------------\n");
-      printf("%9" PRIu64 " %7.1f %7.1f %6d+%-6d %s\n", pClass->elapsedExclusive,
-             per, sum_per, pClass->numCalls[0], pClass->numCalls[1], className);
-    }
-
-    int32_t numMethods = pClass->numMethods;
-    double classExclusive = pClass->elapsedExclusive;
-    double sumMethods = 0;
-    for (int32_t jj = 0; jj < numMethods; ++jj) {
-      MethodEntry* method = pClass->methods[jj];
-      const char* methodName = method->methodName;
-      const char* signature = method->signature;
-      per = 100.0 * method->elapsedExclusive / classExclusive;
-      sumMethods += method->elapsedExclusive;
-      sum_per = 100.0 * sumMethods / classExclusive;
-      if (gOptions.outputHtml) {
-        char buf[80];
-
-        methodName = htmlEscape(methodName, methodBuf, HTML_BUFSIZE);
-        signature = htmlEscape(signature, signatureBuf, HTML_BUFSIZE);
-        printf("<div class=\"leaf\"><span class=\"leaf\">&nbsp;</span>");
-        sprintf(buf, "%" PRIu64, method->elapsedExclusive);
-        printHtmlField(buf, 9);
-        printf("&nbsp;");
-        sprintf(buf, "%" PRIu64, method->elapsedInclusive);
-        printHtmlField(buf, 9);
-        printf("&nbsp;");
-        sprintf(buf, "%.1f", per);
-        printHtmlField(buf, 7);
-        printf("&nbsp;");
-        sprintf(buf, "%.1f", sum_per);
-        printHtmlField(buf, 7);
-        printf("&nbsp;");
-        sprintf(buf, "%d", method->numCalls[0]);
-        printHtmlField(buf, 6);
-        printf("+");
-        sprintf(buf, "%d", method->numCalls[1]);
-        printHtmlField(buf, -6);
-        printf("&nbsp;");
-        printf("<a href=\"#m%d\">[%d]</a>&nbsp;%s&nbsp;%s", method->index,
-               method->index, methodName, signature);
-        printf("</div>\n");
-      } else {
-        printf("%9" PRIu64 " %9" PRIu64 " %7.1f %7.1f %6d+%-6d [%d] %s %s\n",
-               method->elapsedExclusive, method->elapsedInclusive, per, sum_per,
-               method->numCalls[0], method->numCalls[1], method->index,
-               methodName, signature);
-      }
-    }
-    if (gOptions.outputHtml) {
-      printf("</div>\n");
-    }
-  }
-}
-
-void createUniqueMethodList(TraceData* traceData, MethodEntry** pMethods, int32_t numMethods) {
-  /* Sort the methods into alphabetical order of method names
-   * to find the unique method names.
-   */
-  qsort(pMethods, numMethods, sizeof(MethodEntry*), compareMethodNames);
-
-  /* Count the number of unique method names, ignoring class and signature. */
-  const char* currentMethodName = "";
-  traceData->numUniqueMethods = 0;
-  for (int32_t ii = 0; ii < numMethods; ++ii) {
-    if (pMethods[ii]->methodName == nullptr) continue;
-    if (strcmp(pMethods[ii]->methodName, currentMethodName) != 0) {
-      traceData->numUniqueMethods += 1;
-      currentMethodName = pMethods[ii]->methodName;
-    }
-  }
-  if (traceData->numUniqueMethods == 0) return;
-
-  /* Allocate space for pointers to all of the unique methods */
-  traceData->uniqueMethods = new UniqueMethodEntry[traceData->numUniqueMethods];
-
-  /* Initialize the uniqueMethods array */
-  memset(traceData->uniqueMethods, 0, sizeof(UniqueMethodEntry) * traceData->numUniqueMethods);
-  UniqueMethodEntry* pUnique = traceData->uniqueMethods;
-  currentMethodName = nullptr;
-  int32_t prevNumMethods = 0;
-  for (int32_t ii = 0; ii < numMethods; ++ii) {
-    if (pMethods[ii]->methodName == nullptr) continue;
-    if (currentMethodName == nullptr) currentMethodName = pMethods[ii]->methodName;
-    if (strcmp(pMethods[ii]->methodName, currentMethodName) != 0) {
-      currentMethodName = pMethods[ii]->methodName;
-      pUnique->numMethods = prevNumMethods;
-      pUnique++;
-      prevNumMethods = 0;
-    }
-    prevNumMethods += 1;
-  }
-  pUnique->numMethods = prevNumMethods;
-
-  /* Create the array of MethodEntry pointers for each unique method */
-  pUnique = nullptr;
-  currentMethodName = "";
-  int32_t nextMethod = 0;
-  for (int32_t ii = 0; ii < numMethods; ++ii) {
-    if (pMethods[ii]->methodName == nullptr) continue;
-    if (strcmp(pMethods[ii]->methodName, currentMethodName) != 0) {
-      currentMethodName = pMethods[ii]->methodName;
-      if (pUnique == nullptr)
-        pUnique = traceData->uniqueMethods;
-      else
-        pUnique++;
-      /* Allocate space for the methods array */
-      pUnique->methods = new MethodEntry*[pUnique->numMethods];
-      nextMethod = 0;
-    }
-    pUnique->methods[nextMethod++] = pMethods[ii];
-  }
-}
-
-void printMethodProfiles(TraceData* traceData, uint64_t sumThreadTime) {
-  char classBuf[HTML_BUFSIZE], methodBuf[HTML_BUFSIZE];
-  char signatureBuf[HTML_BUFSIZE];
-
-  if (traceData->numUniqueMethods == 0) return;
-
-  if (gOptions.outputHtml) {
-    printf("<a name=\"method\"></a>\n");
-    printf("<hr>\n");
-    outputNavigationBar();
-  } else {
-    printf("\n%s\n", profileSeparator);
-  }
-
-  printf("\nExclusive elapsed time for each method, summed over all the classes\n");
-  printf("that contain a method with the same name.\n\n");
-  if (gOptions.outputHtml) {
-    printf("<br><br>\n");
-  }
-
-  /* For each unique method, sum the exclusive times in all of the methods
-   * with the same name.  Also sum the number of method calls.  Also
-   * sort the methods so the most expensive appear at the top.
-   */
-  UniqueMethodEntry* pUnique = traceData->uniqueMethods;
-  for (int32_t ii = 0; ii < traceData->numUniqueMethods; ++ii, ++pUnique) {
-    int32_t numMethods = pUnique->numMethods;
-    for (int32_t jj = 0; jj < numMethods; ++jj) {
-      MethodEntry* method = pUnique->methods[jj];
-      pUnique->elapsedExclusive += method->elapsedExclusive;
-      pUnique->numCalls[0] += method->numCalls[0];
-      pUnique->numCalls[1] += method->numCalls[1];
-    }
-
-    /* Sort the methods into decreasing order of exclusive time */
-    qsort(pUnique->methods, numMethods, sizeof(MethodEntry*), compareElapsedExclusive);
-  }
-
-  /* Allocate an array of pointers to the methods for more efficient sorting. */
-  UniqueMethodEntry** pUniqueMethods = new UniqueMethodEntry*[traceData->numUniqueMethods];
-  for (int32_t ii = 0; ii < traceData->numUniqueMethods; ++ii)
-    pUniqueMethods[ii] = &traceData->uniqueMethods[ii];
-
-  /* Sort the methods into decreasing order of exclusive time */
-  qsort(pUniqueMethods, traceData->numUniqueMethods, sizeof(UniqueMethodEntry*),
-        compareUniqueExclusive);
-
-  if (gOptions.outputHtml) {
-    printf(
-        "<div class=\"header\"><span "
-        "class=\"parent\">&nbsp;</span>&nbsp;&nbsp;&nbsp;");
-    printf("Cycles %%/total Cumul.%% &nbsp;Calls+Recur&nbsp; Method</div>\n");
-  } else {
-    printf("   Cycles %%/total Cumul.%%  Calls+Recur  Method\n");
-  }
-
-  double sum = 0;
-  double total = sumThreadTime;
-  for (int32_t ii = 0; ii < traceData->numUniqueMethods; ++ii) {
-    /* Skip methods with zero cycles */
-    pUnique = pUniqueMethods[ii];
-    if (pUnique->elapsedExclusive == 0) break;
-
-    sum += pUnique->elapsedExclusive;
-    double per = 100.0 * pUnique->elapsedExclusive / total;
-    double sum_per = 100.0 * sum / total;
-    const char* methodName = pUnique->methods[0]->methodName;
-    if (gOptions.outputHtml) {
-      char buf[80];
-
-      methodName = htmlEscape(methodName, methodBuf, HTML_BUFSIZE);
-      printf(
-          "<div class=\"link\" onClick=\"javascript:toggle('e%d')\" "
-          "onMouseOver=\"javascript:onMouseOver(this)\" "
-          "onMouseOut=\"javascript:onMouseOut(this)\"><span class=\"parent\" "
-          "id=\"xe%d\">+</span>",
-          ii, ii);
-      sprintf(buf, "%" PRIu64, pUnique->elapsedExclusive);
-      printHtmlField(buf, 9);
-      printf(" ");
-      sprintf(buf, "%.1f", per);
-      printHtmlField(buf, 7);
-      printf(" ");
-      sprintf(buf, "%.1f", sum_per);
-      printHtmlField(buf, 7);
-      printf(" ");
-      sprintf(buf, "%d", pUnique->numCalls[0]);
-      printHtmlField(buf, 6);
-      printf("+");
-      sprintf(buf, "%d", pUnique->numCalls[1]);
-      printHtmlField(buf, -6);
-      printf(" ");
-      printf("%s", methodName);
-      printf("</div>\n");
-      printf("<div class=\"parent\" id=\"e%d\">\n", ii);
-    } else {
-      printf("---------------------------------------------\n");
-      printf("%9" PRIu64 " %7.1f %7.1f %6d+%-6d %s\n",
-             pUnique->elapsedExclusive, per, sum_per, pUnique->numCalls[0],
-             pUnique->numCalls[1], methodName);
-    }
-    int32_t numMethods = pUnique->numMethods;
-    double methodExclusive = pUnique->elapsedExclusive;
-    double sumMethods = 0;
-    for (int32_t jj = 0; jj < numMethods; ++jj) {
-      MethodEntry* method = pUnique->methods[jj];
-      const char* className = method->className;
-      const char* signature = method->signature;
-      per = 100.0 * method->elapsedExclusive / methodExclusive;
-      sumMethods += method->elapsedExclusive;
-      sum_per = 100.0 * sumMethods / methodExclusive;
-      if (gOptions.outputHtml) {
-        char buf[80];
-
-        className = htmlEscape(className, classBuf, HTML_BUFSIZE);
-        signature = htmlEscape(signature, signatureBuf, HTML_BUFSIZE);
-        printf("<div class=\"leaf\"><span class=\"leaf\">&nbsp;</span>");
-        sprintf(buf, "%" PRIu64, method->elapsedExclusive);
-        printHtmlField(buf, 9);
-        printf("&nbsp;");
-        sprintf(buf, "%" PRIu64, method->elapsedInclusive);
-        printHtmlField(buf, 9);
-        printf("&nbsp;");
-        sprintf(buf, "%.1f", per);
-        printHtmlField(buf, 7);
-        printf("&nbsp;");
-        sprintf(buf, "%.1f", sum_per);
-        printHtmlField(buf, 7);
-        printf("&nbsp;");
-        sprintf(buf, "%d", method->numCalls[0]);
-        printHtmlField(buf, 6);
-        printf("+");
-        sprintf(buf, "%d", method->numCalls[1]);
-        printHtmlField(buf, -6);
-        printf("&nbsp;");
-        printf("<a href=\"#m%d\">[%d]</a>&nbsp;%s.%s&nbsp;%s", method->index,
-               method->index, className, methodName, signature);
-        printf("</div>\n");
-      } else {
-        printf("%9" PRIu64 " %9" PRIu64 " %7.1f %7.1f %6d+%-6d [%d] %s.%s %s\n",
-               method->elapsedExclusive, method->elapsedInclusive, per, sum_per,
-               method->numCalls[0], method->numCalls[1], method->index,
-               className, methodName, signature);
-      }
-    }
-    if (gOptions.outputHtml) {
-      printf("</div>\n");
-    }
-  }
-}
-
-/*
- * Read the key and data files and return the MethodEntries for those files
- */
-DataKeys* parseDataKeys(TraceData* traceData, const char* traceFileName, uint64_t* threadTime) {
-  MethodEntry* caller;
-
-  FILE* dataFp = fopen(traceFileName, "rbe");
-  if (dataFp == nullptr) return nullptr;
-
-  DataKeys* dataKeys = parseKeys(dataFp, 0);
-  if (dataKeys == nullptr) {
-    fclose(dataFp);
-    return nullptr;
-  }
-
-  DataHeader dataHeader;
-  if (parseDataHeader(dataFp, &dataHeader) < 0) {
-    fclose(dataFp);
-    return dataKeys;
-  }
-
-#if 0
-  FILE* dumpStream = fopen("debug", "w");
-#endif
-  while (1) {
-    /*
-     * Extract values from file.
-     */
-    int32_t threadId;
-    uint32_t methodVal;
-    uint64_t currentTime;
-    if (readDataRecord(dataFp, &dataHeader, &threadId, &methodVal, &currentTime))
-      break;
-
-    int32_t action = METHOD_ACTION(methodVal);
-    int64_t methodId = METHOD_ID(methodVal);
-
-    /* Get the call stack for this thread */
-    CallStack* pStack = traceData->stacks[threadId];
-
-    /* If there is no call stack yet for this thread, then allocate one */
-    if (pStack == nullptr) {
-      pStack = new CallStack();
-      pStack->top = 0;
-      pStack->lastEventTime = currentTime;
-      pStack->threadStartTime = currentTime;
-      traceData->stacks[threadId] = pStack;
-    }
-
-    /* Lookup the current method */
-    MethodEntry* method = lookupMethod(dataKeys, methodId);
-    if (method == nullptr) method = &dataKeys->methods[UNKNOWN_INDEX];
-
-#if 0
-    if (method->methodName) {
-      fprintf(dumpStream, "%2d %-8llu %d %8llu r %d c %d %s.%s %s\n",
-              threadId, currentTime, action, pStack->threadStartTime,
-              method->recursiveEntries,
-              pStack->top, method->className, method->methodName,
-              method->signature);
-    } else {
-      fprintf(dumpStream, "%2d %-8llu %d %8llu r %d c %d %s\n",
-              threadId, currentTime, action, pStack->threadStartTime,
-              method->recursiveEntries,
-              pStack->top, method->className);
-    }
-#endif
-
-    if (action == METHOD_TRACE_ENTER) {
-      /* This is a method entry */
-      if (pStack->top >= MAX_STACK_DEPTH) {
-        fprintf(stderr, "Stack overflow (exceeded %d frames)\n",
-                MAX_STACK_DEPTH);
-        exit(1);
-      }
-
-      /* Get the caller method */
-      if (pStack->top >= 1)
-        caller = pStack->calls[pStack->top - 1].method;
-      else
-        caller = &dataKeys->methods[TOPLEVEL_INDEX];
-      countRecursiveEntries(pStack, pStack->top, caller);
-      caller->elapsedExclusive += currentTime - pStack->lastEventTime;
-#if 0
-      if (caller->elapsedExclusive > 10000000)
-        fprintf(dumpStream, "%llu current %llu last %llu diff %llu\n",
-                caller->elapsedExclusive, currentTime,
-                pStack->lastEventTime,
-                currentTime - pStack->lastEventTime);
-#endif
-      if (caller->recursiveEntries <= 1) {
-        caller->topExclusive += currentTime - pStack->lastEventTime;
-      }
-
-      /* Push the method on the stack for this thread */
-      pStack->calls[pStack->top].method = method;
-      pStack->calls[pStack->top++].entryTime = currentTime;
-    } else {
-      /* This is a method exit */
-      uint64_t entryTime = 0;
-
-      /* Pop the method off the stack for this thread */
-      if (pStack->top > 0) {
-        pStack->top -= 1;
-        entryTime = pStack->calls[pStack->top].entryTime;
-        if (method != pStack->calls[pStack->top].method) {
-          if (method->methodName) {
-            fprintf(stderr, "Exit from method %s.%s %s does not match stack:\n",
-                    method->className, method->methodName, method->signature);
-          } else {
-            fprintf(stderr, "Exit from method %s does not match stack:\n",
-                    method->className);
-          }
-          stackDump(pStack, pStack->top + 1);
-          exit(1);
-        }
-      }
-
-      /* Get the caller method */
-      if (pStack->top >= 1)
-        caller = pStack->calls[pStack->top - 1].method;
-      else
-        caller = &dataKeys->methods[TOPLEVEL_INDEX];
-      countRecursiveEntries(pStack, pStack->top, caller);
-      countRecursiveEntries(pStack, pStack->top, method);
-      uint64_t elapsed = currentTime - entryTime;
-      addInclusiveTime(caller, method, elapsed);
-      method->elapsedExclusive += currentTime - pStack->lastEventTime;
-      if (method->recursiveEntries == 0) {
-        method->topExclusive += currentTime - pStack->lastEventTime;
-      }
-    }
-    /* Remember the time of the last entry or exit event */
-    pStack->lastEventTime = currentTime;
-  }
-
-  /* If we have calls on the stack when the trace ends, then clean
-   * up the stack and add time to the callers by pretending that we
-   * are exiting from their methods now.
-   */
-  uint64_t sumThreadTime = 0;
-  for (int32_t threadId = 0; threadId < MAX_THREADS; ++threadId) {
-    CallStack* pStack = traceData->stacks[threadId];
-
-    /* If this thread never existed, then continue with next thread */
-    if (pStack == nullptr) continue;
-
-    /* Also, add up the time taken by all of the threads */
-    sumThreadTime += pStack->lastEventTime - pStack->threadStartTime;
-
-    for (int32_t ii = 0; ii < pStack->top; ++ii) {
-      if (ii == 0)
-        caller = &dataKeys->methods[TOPLEVEL_INDEX];
-      else
-        caller = pStack->calls[ii - 1].method;
-      MethodEntry* method = pStack->calls[ii].method;
-      countRecursiveEntries(pStack, ii, caller);
-      countRecursiveEntries(pStack, ii, method);
-
-      uint64_t entryTime = pStack->calls[ii].entryTime;
-      uint64_t elapsed = pStack->lastEventTime - entryTime;
-      addInclusiveTime(caller, method, elapsed);
-    }
-  }
-  caller = &dataKeys->methods[TOPLEVEL_INDEX];
-  caller->elapsedInclusive = sumThreadTime;
-
-#if 0
-  fclose(dumpStream);
-#endif
-
-  if (threadTime != nullptr) {
-    *threadTime = sumThreadTime;
-  }
-
-  fclose(dataFp);
-  return dataKeys;
-}
-
-MethodEntry** parseMethodEntries(DataKeys* dataKeys) {
-  /* Create a new array of pointers to the methods and sort the pointers
-   * instead of the actual MethodEntry structs.  We need to do this
-   * because there are other lists that contain pointers to the
-   * MethodEntry structs.
-   */
-  MethodEntry** pMethods = new MethodEntry*[dataKeys->numMethods];
-  for (int32_t ii = 0; ii < dataKeys->numMethods; ++ii) {
-    MethodEntry* entry = &dataKeys->methods[ii];
-    pMethods[ii] = entry;
-  }
-
-  return pMethods;
-}
-
-/*
- * Produce a function profile from the following methods
- */
-void profileTrace(TraceData* traceData, MethodEntry** pMethods, int32_t numMethods,
-                  uint64_t sumThreadTime) {
-  /* Print the html header, if necessary */
-  if (gOptions.outputHtml) {
-    printf(htmlHeader, gOptions.sortableUrl);
-    outputTableOfContents();
-  }
-
-  printExclusiveProfile(pMethods, numMethods, sumThreadTime);
-  printInclusiveProfile(pMethods, numMethods, sumThreadTime);
-
-  createClassList(traceData, pMethods, numMethods);
-  printClassProfiles(traceData, sumThreadTime);
-
-  createUniqueMethodList(traceData, pMethods, numMethods);
-  printMethodProfiles(traceData, sumThreadTime);
-
-  if (gOptions.outputHtml) {
-    printf("%s", htmlFooter);
-  }
-}
-
-int32_t compareMethodNamesForDiff(const void* a, const void* b) {
-  const MethodEntry* methodA = *(const MethodEntry**) a;
-  const MethodEntry* methodB = *(const MethodEntry**) b;
-  if (methodA->methodName == nullptr || methodB->methodName == nullptr) {
-    return compareClassNames(a, b);
-  }
-  int32_t result = strcmp(methodA->methodName, methodB->methodName);
-  if (result == 0) {
-    result = strcmp(methodA->signature, methodB->signature);
-    if (result == 0) {
-      return strcmp(methodA->className, methodB->className);
-    }
-  }
-  return result;
-}
-
-int32_t findMatch(MethodEntry** methods, int32_t size, MethodEntry* matchThis) {
-  for (int32_t i = 0; i < size; i++) {
-    MethodEntry* method = methods[i];
-
-    if (method != nullptr && !compareMethodNamesForDiff(&method, &matchThis)) {
-      // printf("%s.%s == %s.%s<br>\n", matchThis->className, matchThis->methodName,
-      //        method->className, method->methodName);
-
-      return i;
-      // if (!compareMethodNames(&method, &matchThis)) return i;
-    }
-  }
-
-  return -1;
-}
-
-int32_t compareDiffEntriesExculsive(const void* a, const void* b) {
-  const DiffEntry* entryA = (const DiffEntry*) a;
-  const DiffEntry* entryB = (const DiffEntry*) b;
-
-  if (entryA->differenceExclusive < entryB->differenceExclusive) {
-    return 1;
-  } else if (entryA->differenceExclusive > entryB->differenceExclusive) {
-    return -1;
-  }
-
-  return 0;
-}
-
-int32_t compareDiffEntriesInculsive(const void* a, const void* b) {
-  const DiffEntry* entryA = (const DiffEntry*) a;
-  const DiffEntry* entryB = (const DiffEntry*) b;
-
-  if (entryA->differenceInclusive < entryB->differenceInclusive) {
-    return 1;
-  } else if (entryA->differenceInclusive > entryB->differenceInclusive) {
-    return -1;
-  }
-
-  return 0;
-}
-
-void printMissingMethod(MethodEntry* method) {
-  char classBuf[HTML_BUFSIZE];
-  char methodBuf[HTML_BUFSIZE];
-
-  char* className = htmlEscape(method->className, classBuf, HTML_BUFSIZE);
-  char* methodName = htmlEscape(method->methodName, methodBuf, HTML_BUFSIZE);
-
-  if (gOptions.outputHtml) printf("<tr><td>\n");
-
-  printf("%s.%s ", className, methodName);
-  if (gOptions.outputHtml) printf("</td><td>");
-
-  printf("%" PRIu64 " ", method->elapsedExclusive);
-  if (gOptions.outputHtml) printf("</td><td>");
-
-  printf("%" PRIu64 " ", method->elapsedInclusive);
-  if (gOptions.outputHtml) printf("</td><td>");
-
-  printf("%d\n", method->numCalls[0]);
-  if (gOptions.outputHtml) printf("</td><td>\n");
-}
-
-void createDiff(DataKeys* d1, DataKeys* d2) {
-  MethodEntry** methods1 = parseMethodEntries(d1);
-  MethodEntry** methods2 = parseMethodEntries(d2);
-
-  // sort and assign the indices
-  qsort(methods1, d1->numMethods, sizeof(MethodEntry*), compareElapsedInclusive);
-  for (int32_t i = 0; i < d1->numMethods; ++i) {
-    methods1[i]->index = i;
-  }
-
-  qsort(methods2, d2->numMethods, sizeof(MethodEntry*), compareElapsedInclusive);
-  for (int32_t i = 0; i < d2->numMethods; ++i) {
-    methods2[i]->index = i;
-  }
-
-  int32_t max = (d1->numMethods < d2->numMethods) ? d2->numMethods : d1->numMethods;
-  max++;
-  DiffEntry* diffs = new DiffEntry[max];
-  memset(diffs, 0, max * sizeof(DiffEntry));
-  DiffEntry* ptr = diffs;
-
-  // printf("<br>d1->numMethods: %d d1->numMethods: %d<br>\n",
-  //        d1->numMethods, d2->numMethods);
-
-  int32_t matches = 0;
-
-  for (int32_t i = 0; i < d1->numMethods; i++) {
-    int32_t match = findMatch(methods2, d2->numMethods, methods1[i]);
-    if (match >= 0) {
-      ptr->method1 = methods1[i];
-      ptr->method2 = methods2[match];
-
-      uint64_t e1 = ptr->method1->elapsedExclusive;
-      uint64_t e2 = ptr->method2->elapsedExclusive;
-      if (e1 > 0) {
-        ptr->differenceExclusive = e2 - e1;
-        ptr->differenceExclusivePercentage = (static_cast<double>(e2) /
-                                              static_cast<double>(e1)) * 100.0;
-      }
-
-      uint64_t i1 = ptr->method1->elapsedInclusive;
-      uint64_t i2 = ptr->method2->elapsedInclusive;
-      if (i1 > 0) {
-        ptr->differenceInclusive = i2 - i1;
-        ptr->differenceInclusivePercentage = (static_cast<double>(i2) /
-                                              static_cast<double>(i1)) * 100.0;
-      }
-
-      // clear these out so we don't find them again and we know which ones
-      // we have left over
-      methods1[i] = nullptr;
-      methods2[match] = nullptr;
-      ptr++;
-
-      matches++;
-    }
-  }
-  ptr->method1 = nullptr;
-  ptr->method2 = nullptr;
-
-  qsort(diffs, matches, sizeof(DiffEntry), compareDiffEntriesExculsive);
-  ptr = diffs;
-
-  if (gOptions.outputHtml) {
-    printf(htmlHeader, gOptions.sortableUrl);
-    printf("<h3>Table of Contents</h3>\n");
-    printf("<ul>\n");
-    printf("<li><a href='#exclusive'>Exclusive</a>\n");
-    printf("<li><a href='#inclusive'>Inclusive</a>\n");
-    printf("</ul>\n");
-    printf("Run 1: %s<br>\n", gOptions.diffFileName);
-    printf("Run 2: %s<br>\n", gOptions.traceFileName);
-    printf("<a name=\"exclusive\"></a><h3 id=\"exclusive\">Exclusive</h3>\n");
-    printf(tableHeader, "exclusive_table");
-  }
-
-  char classBuf[HTML_BUFSIZE];
-  char methodBuf[HTML_BUFSIZE];
-  while (ptr->method1 != nullptr && ptr->method2 != nullptr) {
-    if (gOptions.outputHtml) printf("<tr><td>\n");
-
-    char* className = htmlEscape(ptr->method1->className, classBuf, HTML_BUFSIZE);
-    char* methodName = htmlEscape(ptr->method1->methodName, methodBuf, HTML_BUFSIZE);
-
-    printf("%s.%s ", className, methodName);
-    if (gOptions.outputHtml) printf("</td><td>");
-
-    printf("%" PRIu64 " ", ptr->method1->elapsedExclusive);
-    if (gOptions.outputHtml) printf("</td><td>");
-
-    printf("%" PRIu64 " ", ptr->method2->elapsedExclusive);
-    if (gOptions.outputHtml) printf("</td><td>");
-
-    printf("%" PRIu64 " ", ptr->differenceExclusive);
-    if (gOptions.outputHtml) printf("</td><td>");
-
-    printf("%.2f\n", ptr->differenceExclusivePercentage);
-    if (gOptions.outputHtml) printf("</td><td>\n");
-
-    printf("%d\n", ptr->method1->numCalls[0]);
-    if (gOptions.outputHtml) printf("</td><td>\n");
-
-    printf("%d\n", ptr->method2->numCalls[0]);
-    if (gOptions.outputHtml) printf("</td></tr>\n");
-
-    ptr++;
-  }
-
-  if (gOptions.outputHtml) printf("</table>\n");
-
-  if (gOptions.outputHtml) {
-    printf(htmlHeader, gOptions.sortableUrl);
-    printf("Run 1: %s<br>\n", gOptions.diffFileName);
-    printf("Run 2: %s<br>\n", gOptions.traceFileName);
-    printf("<a name=\"inclusive\"></a><h3 id=\"inculisve\">Inclusive</h3>\n");
-    printf(tableHeader, "inclusive_table");
-  }
-
-  qsort(diffs, matches, sizeof(DiffEntry), compareDiffEntriesInculsive);
-  ptr = diffs;
-
-  while (ptr->method1 != nullptr && ptr->method2 != nullptr) {
-    if (gOptions.outputHtml) printf("<tr><td>\n");
-
-    char* className = htmlEscape(ptr->method1->className, classBuf, HTML_BUFSIZE);
-    char* methodName = htmlEscape(ptr->method1->methodName, methodBuf, HTML_BUFSIZE);
-
-    printf("%s.%s ", className, methodName);
-    if (gOptions.outputHtml) printf("</td><td>");
-
-    printf("%" PRIu64 " ", ptr->method1->elapsedInclusive);
-    if (gOptions.outputHtml) printf("</td><td>");
-
-    printf("%" PRIu64 " ", ptr->method2->elapsedInclusive);
-    if (gOptions.outputHtml) printf("</td><td>");
-
-    printf("%" PRIu64 " ", ptr->differenceInclusive);
-    if (gOptions.outputHtml) printf("</td><td>");
-
-    printf("%.2f\n", ptr->differenceInclusivePercentage);
-    if (gOptions.outputHtml) printf("</td><td>\n");
-
-    printf("%d\n", ptr->method1->numCalls[0]);
-    if (gOptions.outputHtml) printf("</td><td>\n");
-
-    printf("%d\n", ptr->method2->numCalls[0]);
-    if (gOptions.outputHtml) printf("</td></tr>\n");
-
-    ptr++;
-  }
-
-  if (gOptions.outputHtml) {
-    printf("</table>\n");
-    printf("<h3>Run 1 methods not found in Run 2</h3>");
-    printf(tableHeaderMissing, "?");
-  }
-
-  for (int32_t i = 0; i < d1->numMethods; ++i) {
-    if (methods1[i] != nullptr) {
-      printMissingMethod(methods1[i]);
-    }
-  }
-
-  if (gOptions.outputHtml) {
-    printf("</table>\n");
-    printf("<h3>Run 2 methods not found in Run 1</h3>");
-    printf(tableHeaderMissing, "?");
-  }
-
-  for (int32_t i = 0; i < d2->numMethods; ++i) {
-    if (methods2[i] != nullptr) {
-      printMissingMethod(methods2[i]);
-    }
-  }
-
-  if (gOptions.outputHtml) printf("</body></html\n");
-}
-
-int32_t usage(const char* program) {
-  fprintf(stderr, "Copyright (C) 2006 The Android Open Source Project\n\n");
-  fprintf(stderr,
-          "usage: %s [-ho] [-s sortable] [-d trace-file-name] [-g outfile] "
-          "trace-file-name\n",
-          program);
-  fprintf(stderr, "  -d trace-file-name  - Diff with this trace\n");
-  fprintf(stderr, "  -g outfile          - Write graph to 'outfile'\n");
-  fprintf(stderr,
-          "  -k                  - When writing a graph, keep the intermediate "
-          "DOT file\n");
-  fprintf(stderr, "  -h                  - Turn on HTML output\n");
-  fprintf(
-      stderr,
-      "  -o                  - Dump the dmtrace file instead of profiling\n");
-  fprintf(stderr,
-          "  -s                  - URL base to where the sortable javascript "
-          "file\n");
-  fprintf(stderr,
-          "  -t threshold        - Threshold percentage for including nodes in "
-          "the graph\n");
-  return 2;
-}
-
-// Returns true if there was an error
-int32_t parseOptions(int32_t argc, char** argv) {
-  while (1) {
-    int32_t opt = getopt(argc, argv, "d:hg:kos:t:");
-    if (opt == -1) break;
-    switch (opt) {
-      case 'd':
-        gOptions.diffFileName = optarg;
-        break;
-      case 'g':
-        gOptions.graphFileName = optarg;
-        break;
-      case 'k':
-        gOptions.keepDotFile = 1;
-        break;
-      case 'h':
-        gOptions.outputHtml = 1;
-        break;
-      case 'o':
-        gOptions.dump = 1;
-        break;
-      case 's':
-        gOptions.sortableUrl = optarg;
-        break;
-      case 't':
-        gOptions.threshold = atoi(optarg);
-        break;
-      default:
-        return 1;
-    }
-  }
-  return 0;
-}
-
-/*
- * Parse args.
- */
-int32_t main(int32_t argc, char** argv) {
-  gOptions.threshold = -1;
-
-  // Parse the options
-  if (parseOptions(argc, argv) || argc - optind != 1) return usage(argv[0]);
-
-  gOptions.traceFileName = argv[optind];
-
-  if (gOptions.threshold < 0 || 100 <= gOptions.threshold) {
-    gOptions.threshold = 20;
-  }
-
-  if (gOptions.dump) {
-    dumpTrace();
-    return 0;
-  }
-
-  uint64_t sumThreadTime = 0;
-
-  TraceData data1;
-  DataKeys* dataKeys = parseDataKeys(&data1, gOptions.traceFileName, &sumThreadTime);
-  if (dataKeys == nullptr) {
-    fprintf(stderr, "Cannot read \"%s\".\n", gOptions.traceFileName);
-    exit(1);
-  }
-
-  if (gOptions.diffFileName != nullptr) {
-    uint64_t sum2;
-    TraceData data2;
-    DataKeys* d2 = parseDataKeys(&data2, gOptions.diffFileName, &sum2);
-    if (d2 == nullptr) {
-      fprintf(stderr, "Cannot read \"%s\".\n", gOptions.diffFileName);
-      exit(1);
-    }
-
-    createDiff(d2, dataKeys);
-
-    freeDataKeys(d2);
-  } else {
-    MethodEntry** methods = parseMethodEntries(dataKeys);
-    profileTrace(&data1, methods, dataKeys->numMethods, sumThreadTime);
-    if (gOptions.graphFileName != nullptr) {
-      createInclusiveProfileGraphNew(dataKeys);
-    }
-    delete[] methods;
-  }
-
-  freeDataKeys(dataKeys);
-
-  return 0;
-}
diff --git a/tools/fuzzer/Android.bp b/tools/fuzzer/Android.bp
new file mode 100644
index 0000000..ae073a1
--- /dev/null
+++ b/tools/fuzzer/Android.bp
@@ -0,0 +1,1287 @@
+//
+// Copyright (C) 2023 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "art_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["art_license"],
+}
+
+cc_defaults {
+    name: "libart_verify_dex_fuzzer-defaults",
+    srcs: ["libart_verify_dex_fuzzer.cc"],
+
+    defaults: [
+        // To allow the ART module to build correctly.
+        "art_module_source_build_defaults",
+    ],
+
+    // Build and run on x86 too.
+    host_supported: true,
+
+    // Device needs perfetto as a shared lib.
+    target: {
+        android: {
+            shared_libs: [
+                "heapprofd_client_api",
+            ],
+        },
+    },
+
+    dictionary: "dex.dict",
+    fuzz_config: {
+        triage_assignee: "art-perf-team@google.com",
+        cc: [
+            "solanes@google.com",
+            "art-bugs@google.com",
+        ],
+        componentid: 86431,
+        acknowledgement: [
+            "Santiago Aboy Solanes of Google",
+        ],
+    },
+}
+
+cc_fuzz {
+    name: "libart_verify_dex_fuzzer",
+    defaults: [
+        "libart_verify_dex_fuzzer-defaults",
+        "libart_static_defaults",
+    ],
+    // Can not be in defaults due to soong limitations.
+    corpus: [
+        ":art_runtest_corpus",
+        "corpus/*",
+    ],
+}
+
+cc_fuzz {
+    name: "libart_verify_dex_fuzzerd",
+    defaults: [
+        "libart_verify_dex_fuzzer-defaults",
+        "libartd_static_defaults",
+    ],
+    // Can not be in defaults due to soong limitations.
+    corpus: [
+        ":art_runtest_corpus",
+        "corpus/*",
+    ],
+}
+
+// Use run-test dex files to bootstrap the fuzzer.
+// The outputs must have unique names and we have to list them manually.
+// If test is modified or removed, remove the corresponding dex entry.
+// It is not strictly necessary to add new entries for new tests.
+// TODO(b/171429704): Remove this genrule and use the zip directly.
+genrule {
+    name: "art_runtest_corpus",
+    defaults: [
+        // To allow the ART module to build correctly.
+        "art_module_source_build_defaults",
+    ],
+    tool_files: ["create_corpus.py"],
+    cmd: "$(location) $(genDir) $(in)",
+    srcs: [
+        // Exclude the hidden-api shared to speed up builds.
+        ":art-run-test-host-data-shard00-tmp",
+        ":art-run-test-host-data-shard01-tmp",
+        ":art-run-test-host-data-shard02-tmp",
+        ":art-run-test-host-data-shard03-tmp",
+        ":art-run-test-host-data-shard04-tmp",
+        ":art-run-test-host-data-shard05-tmp",
+        ":art-run-test-host-data-shard06-tmp",
+        ":art-run-test-host-data-shard07-tmp",
+        ":art-run-test-host-data-shard08-tmp",
+        ":art-run-test-host-data-shard09-tmp",
+        ":art-run-test-host-data-shard10-tmp",
+        ":art-run-test-host-data-shard11-tmp",
+        ":art-run-test-host-data-shard12-tmp",
+        ":art-run-test-host-data-shard13-tmp",
+        ":art-run-test-host-data-shard14-tmp",
+        ":art-run-test-host-data-shard15-tmp",
+        ":art-run-test-host-data-shard16-tmp",
+        ":art-run-test-host-data-shard17-tmp",
+        ":art-run-test-host-data-shard18-tmp",
+        ":art-run-test-host-data-shard19-tmp",
+        ":art-run-test-host-data-shard20-tmp",
+        ":art-run-test-host-data-shard21-tmp",
+        ":art-run-test-host-data-shard22-tmp",
+        ":art-run-test-host-data-shard23-tmp",
+        ":art-run-test-host-data-shard24-tmp",
+        ":art-run-test-host-data-shard25-tmp",
+        ":art-run-test-host-data-shard26-tmp",
+        ":art-run-test-host-data-shard27-tmp",
+        ":art-run-test-host-data-shard28-tmp",
+        ":art-run-test-host-data-shard29-tmp",
+        ":art-run-test-host-data-shard30-tmp",
+        ":art-run-test-host-data-shard31-tmp",
+        ":art-run-test-host-data-shard32-tmp",
+        ":art-run-test-host-data-shard33-tmp",
+        ":art-run-test-host-data-shard34-tmp",
+        ":art-run-test-host-data-shard35-tmp",
+        ":art-run-test-host-data-shard36-tmp",
+        ":art-run-test-host-data-shard37-tmp",
+        ":art-run-test-host-data-shard38-tmp",
+        ":art-run-test-host-data-shard39-tmp",
+        ":art-run-test-host-data-shard40-tmp",
+        ":art-run-test-host-data-shard41-tmp",
+        ":art-run-test-host-data-shard42-tmp",
+        ":art-run-test-host-data-shard43-tmp",
+        ":art-run-test-host-data-shard44-tmp",
+        ":art-run-test-host-data-shard45-tmp",
+        ":art-run-test-host-data-shard46-tmp",
+        ":art-run-test-host-data-shard47-tmp",
+        ":art-run-test-host-data-shard48-tmp",
+        ":art-run-test-host-data-shard49-tmp",
+        ":art-run-test-host-data-shard50-tmp",
+        ":art-run-test-host-data-shard51-tmp",
+        ":art-run-test-host-data-shard52-tmp",
+        ":art-run-test-host-data-shard53-tmp",
+        ":art-run-test-host-data-shard54-tmp",
+        ":art-run-test-host-data-shard55-tmp",
+        ":art-run-test-host-data-shard56-tmp",
+        ":art-run-test-host-data-shard57-tmp",
+        ":art-run-test-host-data-shard58-tmp",
+        ":art-run-test-host-data-shard59-tmp",
+        ":art-run-test-host-data-shard60-tmp",
+        ":art-run-test-host-data-shard61-tmp",
+        ":art-run-test-host-data-shard62-tmp",
+        ":art-run-test-host-data-shard63-tmp",
+        ":art-run-test-host-data-shard64-tmp",
+        ":art-run-test-host-data-shard65-tmp",
+        ":art-run-test-host-data-shard66-tmp",
+        ":art-run-test-host-data-shard67-tmp",
+        ":art-run-test-host-data-shard68-tmp",
+        ":art-run-test-host-data-shard69-tmp",
+        ":art-run-test-host-data-shard70-tmp",
+        ":art-run-test-host-data-shard71-tmp",
+        ":art-run-test-host-data-shard72-tmp",
+        ":art-run-test-host-data-shard73-tmp",
+        ":art-run-test-host-data-shard74-tmp",
+        ":art-run-test-host-data-shard75-tmp",
+        ":art-run-test-host-data-shard76-tmp",
+        ":art-run-test-host-data-shard77-tmp",
+        ":art-run-test-host-data-shard78-tmp",
+        ":art-run-test-host-data-shard79-tmp",
+        ":art-run-test-host-data-shard80-tmp",
+        ":art-run-test-host-data-shard81-tmp",
+        ":art-run-test-host-data-shard82-tmp",
+        ":art-run-test-host-data-shard83-tmp",
+        ":art-run-test-host-data-shard84-tmp",
+        ":art-run-test-host-data-shard85-tmp",
+        ":art-run-test-host-data-shard86-tmp",
+        ":art-run-test-host-data-shard87-tmp",
+        ":art-run-test-host-data-shard88-tmp",
+        ":art-run-test-host-data-shard89-tmp",
+        ":art-run-test-host-data-shard90-tmp",
+        ":art-run-test-host-data-shard91-tmp",
+        ":art-run-test-host-data-shard92-tmp",
+        ":art-run-test-host-data-shard93-tmp",
+        ":art-run-test-host-data-shard94-tmp",
+        ":art-run-test-host-data-shard95-tmp",
+        ":art-run-test-host-data-shard96-tmp",
+        ":art-run-test-host-data-shard97-tmp",
+        ":art-run-test-host-data-shard98-tmp",
+        ":art-run-test-host-data-shard99-tmp",
+    ],
+    out: [
+        "host_001-HelloWorld_classes.dex",
+        "host_001-Main_classes.dex",
+        "host_002-sleep_classes.dex",
+        "host_003-omnibus-opcodes_classes.dex",
+        "host_004-InterfaceTest_classes.dex",
+        "host_004-JniTest_classes-ex.dex",
+        "host_004-JniTest_classes.dex",
+        "host_004-NativeAllocations_classes.dex",
+        "host_004-ReferenceMap_classes.dex",
+        "host_004-SignalTest_classes.dex",
+        "host_004-StackWalk_classes.dex",
+        "host_004-ThreadStress_classes.dex",
+        "host_004-UnsafeTest_classes.dex",
+        "host_004-checker-UnsafeTest18_classes.dex",
+        "host_005-annotations_classes.dex",
+        "host_006-args_classes.dex",
+        "host_007-count10_classes.dex",
+        "host_008-exceptions_classes.dex",
+        "host_008-exceptions_classes2.dex",
+        "host_009-instanceof_classes.dex",
+        "host_010-instance_classes.dex",
+        "host_011-array-copy_classes.dex",
+        "host_012-math_classes.dex",
+        "host_013-math2_classes.dex",
+        "host_014-math3_classes.dex",
+        "host_015-checker-switch_classes.dex",
+        "host_016-intern_classes.dex",
+        "host_017-float_classes.dex",
+        "host_018-stack-overflow_classes.dex",
+        "host_019-wrong-array-type_classes.dex",
+        "host_020-string_classes.dex",
+        "host_021-string2_classes.dex",
+        "host_022-interface_classes.dex",
+        "host_023-many-interfaces_classes.dex",
+        "host_024-illegal-access_classes.dex",
+        "host_025-access-controller_classes.dex",
+        "host_026-access_classes.dex",
+        "host_027-arithmetic_classes.dex",
+        "host_028-array-write_classes.dex",
+        "host_029-assert_classes.dex",
+        "host_030-bad-finalizer_classes.dex",
+        "host_031-class-attributes_classes.dex",
+        "host_032-concrete-sub_classes.dex",
+        "host_033-class-init-deadlock_classes.dex",
+        "host_034-call-null_classes.dex",
+        "host_035-enum_classes.dex",
+        "host_036-finalizer_classes.dex",
+        "host_037-inherit_classes.dex",
+        "host_038-inner-null_classes.dex",
+        "host_039-join-main_classes.dex",
+        "host_040-miranda_classes.dex",
+        "host_041-narrowing_classes.dex",
+        "host_042-new-instance_classes.dex",
+        "host_043-privates_classes.dex",
+        "host_044-proxy_classes.dex",
+        "host_045-reflect-array_classes.dex",
+        "host_046-reflect_classes.dex",
+        "host_047-returns_classes.dex",
+        "host_048-reflect-v8_classes.dex",
+        "host_049-show-object_classes.dex",
+        "host_050-sync-test_classes.dex",
+        "host_051-thread_classes.dex",
+        "host_052-verifier-fun_classes.dex",
+        "host_053-wait-some_classes.dex",
+        "host_054-uncaught_classes.dex",
+        "host_055-enum-performance_classes.dex",
+        "host_056-const-string-jumbo_classes.dex",
+        "host_058-enum-order_classes.dex",
+        "host_059-finalizer-throw_classes.dex",
+        "host_061-out-of-memory_classes.dex",
+        "host_062-character-encodings_classes.dex",
+        "host_063-process-manager_classes.dex",
+        "host_064-field-access_classes.dex",
+        "host_065-mismatched-implements_classes.dex",
+        "host_066-mismatched-super_classes.dex",
+        "host_067-preemptive-unpark_classes.dex",
+        "host_068-classloader_classes-ex.dex",
+        "host_068-classloader_classes.dex",
+        "host_069-field-type_classes.dex",
+        "host_070-nio-buffer_classes.dex",
+        "host_071-dexfile-get-static-size_classes.dex",
+        "host_071-dexfile-get-static-size_res_test1.dex",
+        "host_071-dexfile-get-static-size_res_test2.dex",
+        "host_071-dexfile-get-static-size_test-jar_classes.dex",
+        "host_071-dexfile-get-static-size_test-jar_classes2.dex",
+        "host_071-dexfile-map-clean_classes-ex.dex",
+        "host_071-dexfile-map-clean_classes.dex",
+        "host_071-dexfile_classes-ex.dex",
+        "host_071-dexfile_classes.dex",
+        "host_072-precise-gc_classes.dex",
+        "host_072-reachability-fence_classes.dex",
+        "host_073-mismatched-field_classes.dex",
+        "host_074-gc-thrash_classes.dex",
+        "host_075-verification-error_classes.dex",
+        "host_076-boolean-put_classes.dex",
+        "host_077-method-override_classes.dex",
+        "host_078-polymorphic-virtual_classes.dex",
+        "host_079-phantom_classes.dex",
+        "host_080-oom-fragmentation_classes.dex",
+        "host_080-oom-throw-with-finalizer_classes.dex",
+        "host_080-oom-throw_classes.dex",
+        "host_081-hot-exceptions_classes.dex",
+        "host_082-inline-execute_classes.dex",
+        "host_083-compiler-regressions_classes.dex",
+        "host_084-class-init_classes.dex",
+        "host_085-old-style-inner-class_classes.dex",
+        "host_086-null-super_classes.dex",
+        "host_087-gc-after-link_classes.dex",
+        "host_088-monitor-verification_classes.dex",
+        "host_090-loop-formation_classes.dex",
+        "host_091-override-package-private-method_classes-ex.dex",
+        "host_091-override-package-private-method_classes.dex",
+        "host_092-locale_classes.dex",
+        "host_093-serialization_classes.dex",
+        "host_094-pattern_classes.dex",
+        "host_095-switch-MAX_INT_classes.dex",
+        "host_096-array-copy-concurrent-gc_classes.dex",
+        "host_097-duplicate-method_classes.dex",
+        "host_099-vmdebug_classes.dex",
+        "host_100-reflect2_classes.dex",
+        "host_1000-non-moving-space-stress_classes.dex",
+        "host_1001-app-image-regions_classes.dex",
+        "host_1002-notify-startup_classes.dex",
+        "host_1003-metadata-section-strings_classes.dex",
+        "host_1004-checker-volatile-ref-load_classes.dex",
+        "host_101-fibonacci_classes.dex",
+        "host_102-concurrent-gc_classes.dex",
+        "host_103-string-append_classes.dex",
+        "host_104-growth-limit_classes.dex",
+        "host_105-invoke_classes.dex",
+        "host_106-exceptions2_classes.dex",
+        "host_107-int-math2_classes.dex",
+        "host_108-check-cast_classes.dex",
+        "host_109-suspend-check_classes.dex",
+        "host_110-field-access_classes.dex",
+        "host_111-unresolvable-exception_classes.dex",
+        "host_112-double-math_classes.dex",
+        "host_113-multidex_classes.dex",
+        "host_113-multidex_classes2.dex",
+        "host_114-ParallelGC_classes.dex",
+        "host_115-native-bridge_classes.dex",
+        "host_116-nodex2oat_classes.dex",
+        "host_118-noimage-dex2oat_classes.dex",
+        "host_120-hashcode_classes.dex",
+        "host_121-modifiers_classes.dex",
+        "host_121-simple-suspend-check_classes.dex",
+        "host_122-npe_classes.dex",
+        "host_123-compiler-regressions-mt_classes.dex",
+        "host_123-inline-execute2_classes.dex",
+        "host_124-missing-classes_classes.dex",
+        "host_125-gc-and-classloading_classes.dex",
+        "host_126-miranda-multidex_classes.dex",
+        "host_126-miranda-multidex_classes2.dex",
+        "host_127-checker-secondarydex_classes-ex.dex",
+        "host_127-checker-secondarydex_classes.dex",
+        "host_128-reg-spill-on-implicit-nullcheck_classes.dex",
+        "host_129-ThreadGetId_classes.dex",
+        "host_130-hprof_classes-ex.dex",
+        "host_130-hprof_classes.dex",
+        "host_132-daemon-locks-shutdown_classes.dex",
+        "host_133-static-invoke-super_classes.dex",
+        "host_1336-short-finalizer-timeout_classes.dex",
+        "host_1337-gc-coverage_classes.dex",
+        "host_1338-gc-no-los_classes.dex",
+        "host_1339-dead-reference-safe_classes.dex",
+        "host_134-reg-promotion_classes.dex",
+        "host_135-MirandaDispatch_classes.dex",
+        "host_136-daemon-jni-shutdown_classes.dex",
+        "host_137-cfi_classes.dex",
+        "host_137-cfi_classes2.dex",
+        "host_138-duplicate-classes-check2_classes-ex.dex",
+        "host_138-duplicate-classes-check2_classes.dex",
+        "host_138-duplicate-classes-check_classes-ex.dex",
+        "host_138-duplicate-classes-check_classes.dex",
+        "host_139-register-natives_classes.dex",
+        "host_140-dce-regression_classes.dex",
+        "host_140-field-packing_classes.dex",
+        "host_141-class-unload_classes-ex.dex",
+        "host_141-class-unload_classes.dex",
+        "host_142-classloader2_classes-ex.dex",
+        "host_142-classloader2_classes.dex",
+        "host_143-string-value_classes.dex",
+        "host_144-static-field-sigquit_classes.dex",
+        "host_145-alloc-tracking-stress_classes.dex",
+        "host_146-bad-interface_classes-ex.dex",
+        "host_146-bad-interface_classes.dex",
+        "host_148-multithread-gc-annotations_classes.dex",
+        "host_149-suspend-all-stress_classes.dex",
+        "host_150-loadlibrary_classes.dex",
+        "host_151-OpenFileLimit_classes.dex",
+        "host_152-dead-large-object_classes.dex",
+        "host_153-reference-stress_classes.dex",
+        "host_154-gc-loop_classes.dex",
+        "host_155-java-set-resolved-type_classes-ex.dex",
+        "host_155-java-set-resolved-type_classes.dex",
+        "host_156-register-dex-file-multi-loader_classes.dex",
+        "host_157-void-class_classes.dex",
+        "host_158-app-image-class-table_classes.dex",
+        "host_159-app-image-fields_classes.dex",
+        "host_160-read-barrier-stress_classes.dex",
+        "host_161-final-abstract-class_classes.dex",
+        "host_162-method-resolution_classes.dex",
+        "host_162-method-resolution_classes2.dex",
+        "host_163-app-image-methods_classes.dex",
+        "host_164-resolution-trampoline-dex-cache_classes-ex.dex",
+        "host_164-resolution-trampoline-dex-cache_classes.dex",
+        "host_165-lock-owner-proxy_classes.dex",
+        "host_166-bad-interface-super_classes.dex",
+        "host_167-visit-locks_classes.dex",
+        "host_168-vmstack-annotated_classes.dex",
+        "host_169-threadgroup-jni_classes.dex",
+        "host_170-interface-init_classes.dex",
+        "host_171-init-aste_classes.dex",
+        "host_172-app-image-twice_classes.dex",
+        "host_173-missing-field-type_classes.dex",
+        "host_174-escaping-instance-of-bad-class_classes.dex",
+        "host_175-alloc-big-bignums_classes.dex",
+        "host_176-app-image-string_classes.dex",
+        "host_177-visibly-initialized-deadlock_classes.dex",
+        "host_178-app-image-native-method_classes.dex",
+        "host_179-nonvirtual-jni_classes.dex",
+        "host_180-native-default-method_classes.dex",
+        "host_181-default-methods_classes.dex",
+        "host_182-method-linking_classes.dex",
+        "host_1900-track-alloc_classes.dex",
+        "host_1901-get-bytecodes_classes.dex",
+        "host_1902-suspend_classes.dex",
+        "host_1903-suspend-self_classes.dex",
+        "host_1904-double-suspend_classes.dex",
+        "host_1905-suspend-native_classes.dex",
+        "host_1906-suspend-list-me-first_classes.dex",
+        "host_1907-suspend-list-self-twice_classes.dex",
+        "host_1908-suspend-native-resume-self_classes.dex",
+        "host_1909-per-agent-tls_classes.dex",
+        "host_1910-transform-with-default_classes.dex",
+        "host_1911-get-local-var-table_classes.dex",
+        "host_1912-get-set-local-primitive_classes.dex",
+        "host_1913-get-set-local-objects_classes.dex",
+        "host_1914-get-local-instance_classes.dex",
+        "host_1915-get-set-local-current-thread_classes.dex",
+        "host_1916-get-set-current-frame_classes.dex",
+        "host_1917-get-stack-frame_classes.dex",
+        "host_1919-vminit-thread-start-timing_classes.dex",
+        "host_1920-suspend-native-monitor_classes.dex",
+        "host_1921-suspend-native-recursive-monitor_classes.dex",
+        "host_1922-owned-monitors-info_classes.dex",
+        "host_1923-frame-pop_classes.dex",
+        "host_1924-frame-pop-toggle_classes.dex",
+        "host_1925-self-frame-pop_classes.dex",
+        "host_1926-missed-frame-pop_classes.dex",
+        "host_1927-exception-event_classes.dex",
+        "host_1928-exception-event-exception_classes.dex",
+        "host_1929-exception-catch-exception_classes.dex",
+        "host_1930-monitor-info_classes.dex",
+        "host_1931-monitor-events_classes.dex",
+        "host_1932-monitor-events-misc_classes.dex",
+        "host_1933-monitor-current-contended_classes.dex",
+        "host_1934-jvmti-signal-thread_classes.dex",
+        "host_1935-get-set-current-frame-jit_classes.dex",
+        "host_1936-thread-end-events_classes.dex",
+        "host_1937-transform-soft-fail_classes.dex",
+        "host_1938-transform-abstract-single-impl_classes.dex",
+        "host_1939-proxy-frames_classes.dex",
+        "host_1940-ddms-ext_classes.dex",
+        "host_1941-dispose-stress_classes.dex",
+        "host_1942-suspend-raw-monitor-exit_classes.dex",
+        "host_1943-suspend-raw-monitor-wait_classes.dex",
+        "host_1945-proxy-method-arguments_classes.dex",
+        "host_1946-list-descriptors_classes.dex",
+        "host_1947-breakpoint-redefine-deopt_classes.dex",
+        "host_1948-obsolete-const-method-handle_classes.dex",
+        "host_1949-short-dex-file_classes.dex",
+        "host_1950-unprepared-transform_classes-ex.dex",
+        "host_1950-unprepared-transform_classes.dex",
+        "host_1951-monitor-enter-no-suspend_classes.dex",
+        "host_1953-pop-frame_classes.dex",
+        "host_1954-pop-frame-jit_classes.dex",
+        "host_1955-pop-frame-jit-called_classes.dex",
+        "host_1956-pop-frame-jit-calling_classes.dex",
+        "host_1957-error-ext_classes.dex",
+        "host_1958-transform-try-jit_classes.dex",
+        "host_1959-redefine-object-instrument_classes.dex",
+        "host_1960-checker-bounds-codegen_classes.dex",
+        "host_1960-obsolete-jit-multithread-native_classes.dex",
+        "host_1961-checker-loop-vectorizer_classes.dex",
+        "host_1961-obsolete-jit-multithread_classes.dex",
+        "host_1962-multi-thread-events_classes.dex",
+        "host_1963-add-to-dex-classloader-in-memory_classes.dex",
+        "host_1964-add-to-dex-classloader-file_classes-ex.dex",
+        "host_1964-add-to-dex-classloader-file_classes.dex",
+        "host_1965-get-set-local-primitive-no-tables_classes.dex",
+        "host_1966-get-set-local-objects-no-table_classes.dex",
+        "host_1967-get-set-local-bad-slot_classes.dex",
+        "host_1968-force-early-return_classes.dex",
+        "host_1969-force-early-return-void_classes.dex",
+        "host_1970-force-early-return-long_classes.dex",
+        "host_1971-multi-force-early-return_classes.dex",
+        "host_1972-jni-id-swap-indices_classes.dex",
+        "host_1973-jni-id-swap-pointer_classes.dex",
+        "host_1974-resize-array_classes.dex",
+        "host_1975-hello-structural-transformation_classes.dex",
+        "host_1976-hello-structural-static-methods_classes.dex",
+        "host_1977-hello-structural-obsolescence_classes.dex",
+        "host_1978-regular-obsolete-then-structural-obsolescence_classes.dex",
+        "host_1979-threaded-structural-transformation_classes.dex",
+        "host_1980-obsolete-object-cleared_classes.dex",
+        "host_1981-structural-redef-private-method-handles_classes.dex",
+        "host_1982-no-virtuals-structural-redefinition_classes.dex",
+        "host_1983-structural-redefinition-failures_classes.dex",
+        "host_1984-structural-redefine-field-trace_classes.dex",
+        "host_1985-structural-redefine-stack-scope_classes.dex",
+        "host_1986-structural-redefine-multi-thread-stack-scope_classes.dex",
+        "host_1987-structural-redefine-recursive-stack-scope_classes.dex",
+        "host_1988-multi-structural-redefine_classes.dex",
+        "host_1989-transform-bad-monitor_classes.dex",
+        "host_1990-structural-bad-verify_classes.dex",
+        "host_1991-hello-structural-retransform_classes.dex",
+        "host_1992-retransform-no-such-field_classes.dex",
+        "host_1993-fallback-non-structural_classes.dex",
+        "host_1994-final-virtual-structural_classes.dex",
+        "host_1995-final-virtual-structural-multithread_classes.dex",
+        "host_1996-final-override-virtual-structural_classes.dex",
+        "host_1997-structural-shadow-method_classes.dex",
+        "host_1998-structural-shadow-field_classes.dex",
+        "host_1999-virtual-structural_classes.dex",
+        "host_2000-virtual-list-structural_classes-ex.dex",
+        "host_2000-virtual-list-structural_classes.dex",
+        "host_2001-virtual-structural-multithread_classes.dex",
+        "host_2002-virtual-structural-initializing_classes.dex",
+        "host_2003-double-virtual-structural_classes.dex",
+        "host_2004-double-virtual-structural-abstract_classes.dex",
+        "host_2005-pause-all-redefine-multithreaded_classes.dex",
+        "host_2006-virtual-structural-finalizing_classes.dex",
+        "host_2007-virtual-structural-finalizable_classes.dex",
+        "host_2008-redefine-then-old-reflect-field_classes.dex",
+        "host_2009-structural-local-ref_classes.dex",
+        "host_201-built-in-except-detail-messages_classes.dex",
+        "host_2011-stack-walk-concurrent-instrument_classes.dex",
+        "host_2012-structural-redefinition-failures-jni-id_classes.dex",
+        "host_2019-constantcalculationsinking_classes.dex",
+        "host_202-thread-oome_classes.dex",
+        "host_2020-InvokeVirtual-Inlining_classes.dex",
+        "host_2021-InvokeStatic-Inlining_classes.dex",
+        "host_2022-Invariantloops_classes.dex",
+        "host_2023-InvariantLoops_typecast_classes.dex",
+        "host_2024-InvariantNegativeLoop_classes.dex",
+        "host_2025-ChangedArrayValue_classes.dex",
+        "host_2026-DifferentMemoryLSCouples_classes.dex",
+        "host_2027-TwiceTheSameMemoryCouple_classes.dex",
+        "host_2028-MultiBackward_classes.dex",
+        "host_2029-contended-monitors_classes.dex",
+        "host_203-multi-checkpoint_classes.dex",
+        "host_2030-long-running-child_classes.dex",
+        "host_2031-zygote-compiled-frame-deopt_classes.dex",
+        "host_2032-default-method-private-override_classes.dex",
+        "host_2033-shutdown-mechanics_classes.dex",
+        "host_2034-spaces-in-SimpleName_classes.dex",
+        "host_2035-structural-native-method_classes.dex",
+        "host_2036-jni-filechannel_classes.dex",
+        "host_2036-structural-subclass-shadow_classes.dex",
+        "host_2037-thread-name-inherit_classes.dex",
+        "host_2039-load-transform-larger_classes-ex.dex",
+        "host_2039-load-transform-larger_classes.dex",
+        "host_2040-huge-native-alloc_classes.dex",
+        "host_2041-bad-cleaner_classes.dex",
+        "host_2042-checker-dce-always-throw_classes.dex",
+        "host_2042-reference-processing_classes.dex",
+        "host_2043-reference-pauses_classes.dex",
+        "host_2044-get-stack-traces_classes.dex",
+        "host_2045-uffd-kernelfault_classes.dex",
+        "host_2046-checker-comparison_classes.dex",
+        "host_2047-checker-const-string-length_classes.dex",
+        "host_2048-bad-native-registry_classes.dex",
+        "host_2230-profile-save-hotness_classes.dex",
+        "host_2231-checker-heap-poisoning_classes.dex",
+        "host_2232-write-metrics-to-log_classes.dex",
+        "host_2233-checker-remove-loop-suspend-check_classes.dex",
+        "host_2233-metrics-background-thread_classes.dex",
+        "host_2234-checker-remove-entry-suspendcheck_classes.dex",
+        "host_2235-JdkUnsafeTest_classes.dex",
+        "host_2236-JdkUnsafeGetLong-regression_classes.dex",
+        "host_2237-checker-inline-multidex_classes.dex",
+        "host_2237-checker-inline-multidex_classes2.dex",
+        "host_2238-checker-polymorphic-recursive-inlining_classes.dex",
+        "host_2239-varhandle-perf_classes.dex",
+        "host_2240-tracing-non-invokable-method_classes.dex",
+        "host_2241-checker-inline-try-catch_classes.dex",
+        "host_2242-checker-lse-acquire-release-operations_classes.dex",
+        "host_2243-checker-not-inline-into-throw_classes.dex",
+        "host_2243-single-step-default_classes.dex",
+        "host_2244-checker-remove-try-boundary_classes.dex",
+        "host_2245-checker-smali-instance-of-comparison_classes.dex",
+        "host_2246-trace-stream_classes.dex",
+        "host_2247-checker-write-barrier-elimination_classes.dex",
+        "host_2248-checker-smali-remove-try-until-the-end_classes.dex",
+        "host_2249-checker-return-try-boundary-exit-in-loop_classes.dex",
+        "host_2250-inline-throw-into-try_classes.dex",
+        "host_2251-checker-irreducible-loop-do-not-inline_classes.dex",
+        "host_2252-rem-optimization-dividend-divisor_classes.dex",
+        "host_2253-checker-devirtualize-always-throws_classes.dex",
+        "host_2254-checker-not-var-analyzed-pathological_classes.dex",
+        "host_2254-class-value-before-and-after-u_classes.dex",
+        "host_2255-checker-branch-redirection_classes.dex",
+        "host_2256-checker-vector-replacement_classes.dex",
+        "host_2257-checker-constant-folding-before-codegen_classes.dex",
+        "host_2258-checker-valid-rti_classes.dex",
+        "host_2259-checker-code-sinking-infinite-try-catch_classes.dex",
+        "host_2260-checker-inline-unimplemented-intrinsics_classes.dex",
+        "host_2261-badcleaner-in-systemcleaner_classes.dex",
+        "host_2262-checker-return-sinking_classes.dex",
+        "host_2262-default-conflict-methods_classes.dex",
+        "host_2262-miranda-methods_classes.dex",
+        "host_2263-method-trace-jit_classes.dex",
+        "host_2264-throwing-systemcleaner_classes.dex",
+        "host_2265-checker-select-binary-unary_classes.dex",
+        "host_2267-class-implements-itself_classes.dex",
+        "host_300-package-override_classes.dex",
+        "host_301-abstract-protected_classes.dex",
+        "host_302-float-conversion_classes.dex",
+        "host_303-verification-stress_classes.dex",
+        "host_304-method-tracing_classes.dex",
+        "host_305-other-fault-handler_classes.dex",
+        "host_370-dex-v37_classes.dex",
+        "host_401-optimizing-compiler_classes.dex",
+        "host_402-optimizing-control-flow_classes.dex",
+        "host_403-optimizing-long_classes.dex",
+        "host_404-optimizing-allocator_classes.dex",
+        "host_405-optimizing-long-allocator_classes.dex",
+        "host_406-fields_classes.dex",
+        "host_407-arrays_classes.dex",
+        "host_408-move-bug_classes.dex",
+        "host_409-materialized-condition_classes.dex",
+        "host_410-floats_classes.dex",
+        "host_411-checker-hdiv-hrem-const_classes.dex",
+        "host_411-checker-hdiv-hrem-pow2_classes.dex",
+        "host_411-checker-instruct-simplifier-hrem_classes.dex",
+        "host_411-optimizing-arith_classes.dex",
+        "host_412-new-array_classes.dex",
+        "host_413-regalloc-regression_classes.dex",
+        "host_414-static-fields_classes.dex",
+        "host_416-optimizing-arith-not_classes.dex",
+        "host_418-const-string_classes.dex",
+        "host_419-long-parameter_classes.dex",
+        "host_420-const-class_classes.dex",
+        "host_421-exceptions_classes.dex",
+        "host_421-large-frame_classes.dex",
+        "host_422-instanceof_classes.dex",
+        "host_422-type-conversion_classes.dex",
+        "host_423-invoke-interface_classes.dex",
+        "host_424-checkcast_classes.dex",
+        "host_425-invoke-super_classes.dex",
+        "host_426-monitor_classes.dex",
+        "host_427-bitwise_classes.dex",
+        "host_427-bounds_classes.dex",
+        "host_429-ssa-builder_classes.dex",
+        "host_430-live-register-slow-path_classes.dex",
+        "host_431-type-propagation_classes.dex",
+        "host_432-optimizing-cmp_classes.dex",
+        "host_433-gvn_classes.dex",
+        "host_434-invoke-direct_classes.dex",
+        "host_434-shifter-operand_classes.dex",
+        "host_435-new-instance_classes.dex",
+        "host_435-try-finally-without-catch_classes.dex",
+        "host_436-rem-float_classes.dex",
+        "host_436-shift-constant_classes.dex",
+        "host_437-inline_classes.dex",
+        "host_438-volatile_classes.dex",
+        "host_439-npe_classes.dex",
+        "host_439-swap-double_classes.dex",
+        "host_440-stmp_classes.dex",
+        "host_441-checker-inliner_classes.dex",
+        "host_442-checker-constant-folding_classes.dex",
+        "host_443-not-bool-inline_classes.dex",
+        "host_444-checker-nce_classes.dex",
+        "host_445-checker-licm_classes.dex",
+        "host_446-checker-inliner2_classes.dex",
+        "host_447-checker-inliner3_classes.dex",
+        "host_448-multiple-returns_classes.dex",
+        "host_449-checker-bce-rem_classes.dex",
+        "host_449-checker-bce_classes.dex",
+        "host_450-checker-types_classes.dex",
+        "host_451-regression-add-float_classes.dex",
+        "host_451-spill-splot_classes.dex",
+        "host_452-multiple-returns2_classes.dex",
+        "host_453-not-byte_classes.dex",
+        "host_454-get-vreg_classes.dex",
+        "host_455-checker-gvn_classes.dex",
+        "host_456-baseline-array-set_classes.dex",
+        "host_457-regs_classes.dex",
+        "host_458-checker-instruct-simplification_classes.dex",
+        "host_458-long-to-fpu_classes.dex",
+        "host_459-dead-phi_classes.dex",
+        "host_460-multiple-returns3_classes.dex",
+        "host_461-get-reference-vreg_classes.dex",
+        "host_462-checker-inlining-dex-files_classes.dex",
+        "host_462-checker-inlining-dex-files_classes2.dex",
+        "host_463-checker-boolean-simplifier_classes.dex",
+        "host_464-checker-inline-sharpen-calls_classes.dex",
+        "host_465-checker-clinit-gvn_classes.dex",
+        "host_466-get-live-vreg_classes.dex",
+        "host_467-regalloc-pair_classes.dex",
+        "host_468-checker-bool-simplif-regression_classes.dex",
+        "host_469-condition-materialization_classes.dex",
+        "host_470-huge-method_classes.dex",
+        "host_471-deopt-environment_classes.dex",
+        "host_471-uninitialized-locals_classes.dex",
+        "host_472-type-propagation_classes.dex",
+        "host_472-unreachable-if-regression_classes.dex",
+        "host_473-checker-inliner-constants_classes.dex",
+        "host_473-remove-dead-block_classes.dex",
+        "host_474-checker-boolean-input_classes.dex",
+        "host_474-fp-sub-neg_classes.dex",
+        "host_475-regression-inliner-ids_classes.dex",
+        "host_475-simplify-mul-zero_classes.dex",
+        "host_476-checker-ctor-fence-redun-elim_classes.dex",
+        "host_476-checker-ctor-memory-barrier_classes.dex",
+        "host_476-clinit-inline-static-invoke_classes.dex",
+        "host_477-checker-bound-type_classes.dex",
+        "host_477-long-2-float-convers-precision_classes.dex",
+        "host_478-checker-clinit-check-pruning_classes.dex",
+        "host_478-checker-inline-noreturn_classes.dex",
+        "host_478-checker-inliner-nested-loop_classes.dex",
+        "host_479-regression-implicit-null-check_classes.dex",
+        "host_480-checker-dead-blocks_classes.dex",
+        "host_481-regression-phi-cond_classes.dex",
+        "host_482-checker-loop-back-edge-use_classes.dex",
+        "host_483-dce-block_classes.dex",
+        "host_484-checker-register-hints_classes.dex",
+        "host_485-checker-dce-loop-update_classes.dex",
+        "host_485-checker-dce-switch_classes.dex",
+        "host_486-checker-must-do-null-check_classes.dex",
+        "host_487-checker-inline-calls_classes.dex",
+        "host_488-checker-inline-recursive-calls_classes.dex",
+        "host_489-current-method-regression_classes.dex",
+        "host_490-checker-inline_classes.dex",
+        "host_491-current-method_classes.dex",
+        "host_492-checker-inline-invoke-interface_classes.dex",
+        "host_493-checker-inline-invoke-interface_classes.dex",
+        "host_494-checker-instanceof-tests_classes.dex",
+        "host_495-checker-checkcast-tests_classes.dex",
+        "host_496-checker-inlining-class-loader_classes.dex",
+        "host_497-inlining-and-class-loader_classes.dex",
+        "host_498-type-propagation_classes.dex",
+        "host_499-bce-phi-array-length_classes.dex",
+        "host_500-instanceof_classes.dex",
+        "host_501-null-constant-dce_classes.dex",
+        "host_501-regression-packed-switch_classes.dex",
+        "host_503-dead-instructions_classes.dex",
+        "host_504-regression-baseline-entry_classes.dex",
+        "host_505-simplifier-type-propagation_classes.dex",
+        "host_506-verify-aput_classes.dex",
+        "host_507-boolean-test_classes.dex",
+        "host_507-referrer_classes.dex",
+        "host_508-checker-disassembly_classes.dex",
+        "host_508-referrer-method_classes.dex",
+        "host_509-pre-header_classes.dex",
+        "host_510-checker-try-catch_classes.dex",
+        "host_511-clinit-interface_classes.dex",
+        "host_513-array-deopt_classes.dex",
+        "host_514-shifts_classes.dex",
+        "host_515-dce-dominator_classes.dex",
+        "host_516-dead-move-result_classes.dex",
+        "host_517-checker-builder-fallthrough_classes.dex",
+        "host_518-null-array-get_classes.dex",
+        "host_519-bound-load-class_classes.dex",
+        "host_520-equivalent-phi_classes.dex",
+        "host_521-checker-array-set-null_classes.dex",
+        "host_521-regression-integer-field-set_classes.dex",
+        "host_522-checker-regression-monitor-exit_classes.dex",
+        "host_523-checker-can-throw-regression_classes.dex",
+        "host_524-boolean-simplifier-regression_classes.dex",
+        "host_525-checker-arrays-fields1_classes.dex",
+        "host_525-checker-arrays-fields2_classes.dex",
+        "host_526-checker-caller-callee-regs_classes.dex",
+        "host_526-long-regalloc_classes.dex",
+        "host_527-checker-array-access-simd_classes.dex",
+        "host_527-checker-array-access-split_classes.dex",
+        "host_528-long-hint_classes.dex",
+        "host_529-checker-unresolved_classes.dex",
+        "host_529-long-split_classes.dex",
+        "host_530-checker-instance-of-simplifier_classes.dex",
+        "host_530-checker-loops-try-catch_classes.dex",
+        "host_530-checker-loops1_classes.dex",
+        "host_530-checker-loops2_classes.dex",
+        "host_530-checker-loops3_classes.dex",
+        "host_530-checker-loops4_classes.dex",
+        "host_530-checker-loops5_classes.dex",
+        "host_530-checker-lse-ctor-fences_classes.dex",
+        "host_530-checker-lse-simd_classes.dex",
+        "host_530-checker-lse-try-catch_classes.dex",
+        "host_530-checker-lse3_classes.dex",
+        "host_530-checker-lse_classes.dex",
+        "host_530-checker-peel-unroll_classes.dex",
+        "host_530-checker-regression-reftyp-final_classes.dex",
+        "host_530-instanceof-checkcast_classes.dex",
+        "host_530-regression-lse_classes.dex",
+        "host_531-regression-debugphi_classes.dex",
+        "host_532-checker-nonnull-arrayset_classes.dex",
+        "host_533-regression-debugphi_classes.dex",
+        "host_534-checker-bce-deoptimization_classes.dex",
+        "host_535-deopt-and-inlining_classes.dex",
+        "host_535-regression-const-val_classes.dex",
+        "host_536-checker-intrinsic-optimization_classes.dex",
+        "host_536-checker-needs-access-check_classes.dex",
+        "host_537-checker-arraycopy_classes.dex",
+        "host_537-checker-debuggable_classes.dex",
+        "host_537-checker-inline-and-unverified_classes.dex",
+        "host_537-checker-jump-over-jump_classes.dex",
+        "host_538-checker-embed-constants_classes.dex",
+        "host_540-checker-rtp-bug_classes.dex",
+        "host_541-regression-inlined-deopt_classes.dex",
+        "host_542-bitfield-rotates_classes.dex",
+        "host_542-inline-trycatch_classes.dex",
+        "host_542-unresolved-access-check_classes.dex",
+        "host_543-checker-dce-trycatch_classes.dex",
+        "host_543-env-long-ref_classes.dex",
+        "host_545-tracing-and-jit_classes.dex",
+        "host_546-regression-simplify-catch_classes.dex",
+        "host_547-regression-trycatch-critic-edge_classes.dex",
+        "host_548-checker-inlining-and-dce_classes.dex",
+        "host_549-checker-types-merge_classes.dex",
+        "host_550-checker-multiply-accumulate_classes.dex",
+        "host_550-checker-regression-wide-store_classes.dex",
+        "host_550-new-instance-clinit_classes.dex",
+        "host_551-checker-clinit_classes.dex",
+        "host_551-checker-shifter-operand_classes.dex",
+        "host_551-implicit-null-checks_classes.dex",
+        "host_551-invoke-super_classes.dex",
+        "host_552-checker-primitive-typeprop_classes.dex",
+        "host_552-checker-sharpening_classes.dex",
+        "host_552-checker-sharpening_classes2.dex",
+        "host_552-checker-x86-avx2-bit-manipulation_classes.dex",
+        "host_552-invoke-non-existent-super_classes.dex",
+        "host_553-invoke-super_classes.dex",
+        "host_554-checker-rtp-checkcast_classes.dex",
+        "host_555-UnsafeGetLong-regression_classes.dex",
+        "host_556-invoke-super_classes.dex",
+        "host_556-invoke-super_classes2.dex",
+        "host_557-checker-instruct-simplifier-ror_classes.dex",
+        "host_557-checker-ref-equivalent_classes.dex",
+        "host_558-switch_classes.dex",
+        "host_559-bce-ssa_classes.dex",
+        "host_559-checker-irreducible-loop_classes.dex",
+        "host_559-checker-rtp-ifnotnull_classes.dex",
+        "host_560-packed-switch_classes.dex",
+        "host_561-divrem_classes.dex",
+        "host_561-shared-slowpaths_classes.dex",
+        "host_562-bce-preheader_classes.dex",
+        "host_562-checker-no-intermediate_classes.dex",
+        "host_563-checker-fakestring_classes.dex",
+        "host_563-checker-invoke-super_classes.dex",
+        "host_564-checker-bitcount_classes.dex",
+        "host_564-checker-inline-loop_classes.dex",
+        "host_564-checker-irreducible-loop_classes.dex",
+        "host_564-checker-negbitwise_classes.dex",
+        "host_565-checker-condition-liveness_classes.dex",
+        "host_565-checker-doublenegbitwise_classes.dex",
+        "host_565-checker-irreducible-loop_classes.dex",
+        "host_566-checker-codegen-select_classes.dex",
+        "host_566-polymorphic-inlining_classes.dex",
+        "host_567-checker-builder-intrinsics_classes.dex",
+        "host_568-checker-onebit_classes.dex",
+        "host_569-checker-pattern-replacement_classes.dex",
+        "host_569-checker-pattern-replacement_classes2.dex",
+        "host_570-checker-osr-locals_classes.dex",
+        "host_570-checker-osr_classes.dex",
+        "host_570-checker-select_classes.dex",
+        "host_571-irreducible-loop_classes.dex",
+        "host_572-checker-array-get-regression_classes.dex",
+        "host_573-checker-checkcast-regression_classes.dex",
+        "host_574-irreducible-and-constant-area_classes.dex",
+        "host_575-checker-string-init-alias_classes.dex",
+        "host_576-polymorphic-inlining_classes.dex",
+        "host_577-checker-fp2int_classes.dex",
+        "host_578-bce-visit_classes.dex",
+        "host_578-polymorphic-inlining_classes.dex",
+        "host_579-inline-infinite_classes.dex",
+        "host_580-checker-fp16_classes.dex",
+        "host_580-checker-round_classes.dex",
+        "host_580-checker-string-fact-intrinsics_classes.dex",
+        "host_580-crc32_classes.dex",
+        "host_581-checker-rtp_classes.dex",
+        "host_582-checker-bce-length_classes.dex",
+        "host_583-checker-zero_classes.dex",
+        "host_584-checker-div-bool_classes.dex",
+        "host_585-inline-unresolved_classes.dex",
+        "host_586-checker-null-array-get_classes.dex",
+        "host_587-inline-class-error_classes.dex",
+        "host_588-checker-irreducib-lifetime-hole_classes.dex",
+        "host_589-super-imt_classes.dex",
+        "host_590-checker-arr-set-null-regression_classes.dex",
+        "host_590-infinite-loop-with-nop_classes.dex",
+        "host_591-checker-regression-dead-loop_classes.dex",
+        "host_591-new-instance-string_classes.dex",
+        "host_592-checker-regression-bool-input_classes.dex",
+        "host_593-checker-boolean-2-integral-conv_classes.dex",
+        "host_593-checker-long-2-float-regression_classes.dex",
+        "host_593-checker-shift-and-simplifier_classes.dex",
+        "host_594-checker-array-alias_classes.dex",
+        "host_594-checker-irreducible-linorder_classes.dex",
+        "host_594-invoke-super_classes.dex",
+        "host_594-load-string-regression_classes.dex",
+        "host_595-error-class_classes.dex",
+        "host_595-profile-saving_classes.dex",
+        "host_595-profile-saving_res_art-gtest-jars-Main.dex",
+        "host_596-app-images_classes-ex.dex",
+        "host_596-app-images_classes.dex",
+        "host_596-checker-dead-phi_classes.dex",
+        "host_596-monitor-inflation_classes.dex",
+        "host_597-app-images-same-classloader_classes-ex.dex",
+        "host_597-app-images-same-classloader_classes.dex",
+        "host_597-deopt-busy-loop_classes.dex",
+        "host_597-deopt-invoke-stub_classes.dex",
+        "host_597-deopt-new-string_classes.dex",
+        "host_598-checker-irreducible-dominance_classes.dex",
+        "host_599-checker-irreducible-loop_classes.dex",
+        "host_600-verifier-fails_classes.dex",
+        "host_601-method-access_classes.dex",
+        "host_602-deoptimizeable_classes.dex",
+        "host_603-checker-instanceof_classes.dex",
+        "host_604-hot-static-interface_classes.dex",
+        "host_605-new-string-from-bytes_classes.dex",
+        "host_606-erroneous-class_classes.dex",
+        "host_606-erroneous-class_classes2.dex",
+        "host_607-daemon-stress_classes.dex",
+        "host_608-checker-unresolved-lse_classes.dex",
+        "host_609-checker-inline-interface_classes.dex",
+        "host_609-checker-x86-bounds-check_classes.dex",
+        "host_610-arraycopy_classes.dex",
+        "host_611-checker-simplify-if_classes.dex",
+        "host_612-jit-dex-cache_classes-ex.dex",
+        "host_612-jit-dex-cache_classes.dex",
+        "host_613-inlining-dex-cache_classes-ex.dex",
+        "host_613-inlining-dex-cache_classes.dex",
+        "host_614-checker-dump-constant-location_classes.dex",
+        "host_615-checker-arm64-store-zero_classes.dex",
+        "host_616-cha-abstract_classes.dex",
+        "host_616-cha-interface-default_classes.dex",
+        "host_616-cha-interface-default_classes2.dex",
+        "host_616-cha-interface_classes.dex",
+        "host_616-cha-miranda_classes.dex",
+        "host_616-cha-native_classes.dex",
+        "host_616-cha-proxy-method-inline_classes.dex",
+        "host_616-cha-proxy-method-inline_classes2.dex",
+        "host_616-cha-regression-proxy-method_classes.dex",
+        "host_616-cha-unloading_classes-ex.dex",
+        "host_616-cha-unloading_classes.dex",
+        "host_616-cha_classes.dex",
+        "host_617-clinit-oome_classes.dex",
+        "host_618-checker-induction_classes.dex",
+        "host_619-checker-current-method_classes.dex",
+        "host_620-checker-bce-intrinsics_classes.dex",
+        "host_622-checker-bce-regressions_classes.dex",
+        "host_622-simplifyifs-exception-edges_classes.dex",
+        "host_623-checker-loop-regressions_classes.dex",
+        "host_624-checker-stringops_classes.dex",
+        "host_625-checker-licm-regressions_classes.dex",
+        "host_626-checker-arm64-scratch-register_classes.dex",
+        "host_626-const-class-linking_classes.dex",
+        "host_626-const-class-linking_classes2.dex",
+        "host_626-set-resolved-string_classes.dex",
+        "host_627-checker-unroll_classes.dex",
+        "host_628-vdex_classes.dex",
+        "host_629-vdex-speed_classes.dex",
+        "host_630-safecast-array_classes.dex",
+        "host_631-checker-get-class_classes.dex",
+        "host_632-checker-char-at-bounds_classes.dex",
+        "host_633-checker-rtp-getclass_classes.dex",
+        "host_634-vdex-duplicate_classes.dex",
+        "host_635-checker-arm64-volatile-load-cc_classes.dex",
+        "host_636-arm64-veneer-pool_classes.dex",
+        "host_636-wrong-static-access_classes-ex.dex",
+        "host_636-wrong-static-access_classes.dex",
+        "host_637-checker-throw-inline_classes.dex",
+        "host_638-checker-inline-cache-intrinsic_classes.dex",
+        "host_638-checker-inline-caches_classes.dex",
+        "host_638-checker-inline-caches_classes2.dex",
+        "host_638-no-line-number_classes.dex",
+        "host_639-checker-code-sinking_classes.dex",
+        "host_640-checker-boolean-simd_classes.dex",
+        "host_640-checker-integer-valueof_classes.dex",
+        "host_640-checker-simd_classes.dex",
+        "host_641-checker-arraycopy_classes.dex",
+        "host_641-irreducible-inline_classes.dex",
+        "host_641-iterations_classes.dex",
+        "host_642-fp-callees_classes.dex",
+        "host_643-checker-bogus-ic_classes.dex",
+        "host_645-checker-abs-simd_classes.dex",
+        "host_646-checker-arraycopy-large-cst-pos_classes.dex",
+        "host_646-checker-long-const-to-int_classes.dex",
+        "host_646-checker-simd-hadd_classes.dex",
+        "host_647-jni-get-field-id_classes.dex",
+        "host_647-sinking-catch_classes.dex",
+        "host_648-inline-caches-unresolved_classes.dex",
+        "host_648-many-direct-methods_classes.dex",
+        "host_649-vdex-duplicate-method_classes.dex",
+        "host_650-checker-inline-access-thunks_classes.dex",
+        "host_652-deopt-intrinsic_classes.dex",
+        "host_654-checker-periodic_classes.dex",
+        "host_655-checker-simd-arm-opt_classes.dex",
+        "host_655-jit-clinit_classes.dex",
+        "host_656-annotation-lookup-generic-jni_classes-ex.dex",
+        "host_656-annotation-lookup-generic-jni_classes.dex",
+        "host_656-checker-simd-opt_classes.dex",
+        "host_656-loop-deopt_classes.dex",
+        "host_657-branches_classes.dex",
+        "host_658-fp-read-barrier_classes.dex",
+        "host_659-unpadded-array_classes.dex",
+        "host_660-checker-sad_classes.dex",
+        "host_660-checker-simd-sad_classes.dex",
+        "host_660-clinit_classes.dex",
+        "host_660-store-8-16_classes.dex",
+        "host_661-checker-simd-cf-loops_classes.dex",
+        "host_661-checker-simd-reduc_classes.dex",
+        "host_661-classloader-allocator_classes-ex.dex",
+        "host_661-classloader-allocator_classes.dex",
+        "host_661-oat-writer-layout_classes.dex",
+        "host_662-regression-alias_classes.dex",
+        "host_663-checker-select-generator_classes.dex",
+        "host_663-odd-dex-size_classes.dex",
+        "host_664-aget-verifier_classes.dex",
+        "host_665-checker-simd-zero_classes.dex",
+        "host_666-dex-cache-itf_classes.dex",
+        "host_667-checker-simd-alignment_classes.dex",
+        "host_667-jit-jni-stub_classes.dex",
+        "host_667-out-of-bounds_classes.dex",
+        "host_668-aiobe_classes.dex",
+        "host_669-checker-break_classes.dex",
+        "host_670-bitstring-type-check_classes.dex",
+        "host_671-npe-field-opts_classes.dex",
+        "host_672-checker-throw-method_classes.dex",
+        "host_673-checker-throw-vmethod_classes.dex",
+        "host_674-HelloWorld-Dm_classes.dex",
+        "host_674-hotness-compiled_classes.dex",
+        "host_674-vdex-uncompress_classes.dex",
+        "host_675-checker-unverified-method_classes.dex",
+        "host_676-proxy-jit-at-first-use_classes.dex",
+        "host_676-resolve-field-type_classes-ex.dex",
+        "host_676-resolve-field-type_classes.dex",
+        "host_677-fsi2_classes.dex",
+        "host_677-fsi_classes.dex",
+        "host_678-quickening_classes.dex",
+        "host_679-locks_classes.dex",
+        "host_680-checker-deopt-dex-pc-0_classes.dex",
+        "host_682-double-catch-phi_classes.dex",
+        "host_683-clinit-inline-static-invoke_classes.dex",
+        "host_683-clinit-inline-static-invoke_classes2.dex",
+        "host_684-checker-simd-dotprod_classes.dex",
+        "host_684-select-condition_classes.dex",
+        "host_685-deoptimizeable_classes.dex",
+        "host_685-shifts_classes.dex",
+        "host_686-get-this_classes.dex",
+        "host_687-deopt_classes.dex",
+        "host_688-shared-library_classes-ex.dex",
+        "host_688-shared-library_classes.dex",
+        "host_689-multi-catch_classes.dex",
+        "host_689-zygote-jit-deopt_classes.dex",
+        "host_692-vdex-inmem-loader_classes-ex.dex",
+        "host_692-vdex-inmem-loader_classes.dex",
+        "host_692-vdex-secondary-loader_classes-ex.dex",
+        "host_692-vdex-secondary-loader_classes.dex",
+        "host_693-vdex-inmem-loader-evict_classes.dex",
+        "host_694-clinit-jit_classes.dex",
+        "host_695-simplify-throws_classes.dex",
+        "host_696-loop_classes.dex",
+        "host_697-checker-string-append_classes.dex",
+        "host_698-selects_classes.dex",
+        "host_699-checker-string-append2_classes.dex",
+        "host_700-LoadArgRegs_classes.dex",
+        "host_701-easy-div-rem_classes.dex",
+        "host_702-LargeBranchOffset_classes.dex",
+        "host_703-floating-point-div_classes.dex",
+        "host_704-multiply-accumulate_classes.dex",
+        "host_705-register-conflict_classes.dex",
+        "host_706-checker-scheduler_classes.dex",
+        "host_707-checker-invalid-profile_classes.dex",
+        "host_708-jit-cache-churn_classes.dex",
+        "host_710-varhandle-creation_classes-ex.dex",
+        "host_710-varhandle-creation_classes.dex",
+        "host_711-checker-type-conversion_classes.dex",
+        "host_712-varhandle-invocations_classes.dex",
+        "host_713-varhandle-invokers_classes.dex",
+        "host_714-invoke-custom-lambda-metafactory_classes.dex",
+        "host_715-clinit-implicit-parameter-annotations_classes.dex",
+        "host_716-jli-jit-samples_classes.dex",
+        "host_717-integer-value-of_classes.dex",
+        "host_718-zipfile-finalizer_classes.dex",
+        "host_719-varhandle-concurrency_classes.dex",
+        "host_720-thread-priority_classes.dex",
+        "host_721-osr_classes.dex",
+        "host_723-string-init-range_classes.dex",
+        "host_724-invoke-super-npe_classes.dex",
+        "host_725-imt-conflict-object_classes.dex",
+        "host_726-array-store_classes.dex",
+        "host_727-checker-unresolved-class_classes-ex.dex",
+        "host_727-checker-unresolved-class_classes.dex",
+        "host_727-checker-unresolved-class_classes2.dex",
+        "host_728-imt-conflict-zygote_classes.dex",
+        "host_729-checker-polymorphic-intrinsic_classes.dex",
+        "host_730-cha-deopt_classes.dex",
+        "host_730-checker-inlining-super_classes.dex",
+        "host_731-bounds-check-slow-path_classes.dex",
+        "host_800-smali_classes.dex",
+        "host_801-VoidCheckCast_classes.dex",
+        "host_802-deoptimization_classes.dex",
+        "host_803-no-super_classes.dex",
+        "host_804-class-extends-itself_classes.dex",
+        "host_805-TooDeepClassInstanceOf_classes.dex",
+        "host_806-TooWideClassInstanceOf_classes.dex",
+        "host_807-method-handle-and-mr_classes.dex",
+        "host_808-checker-invoke-super_classes.dex",
+        "host_808-checker-invoke-super_classes2.dex",
+        "host_809-checker-invoke-super-bss_classes.dex",
+        "host_809-checker-invoke-super-bss_classes2.dex",
+        "host_810-checker-invoke-super-default_classes.dex",
+        "host_811-checker-invoke-super-secondary_classes-ex.dex",
+        "host_811-checker-invoke-super-secondary_classes.dex",
+        "host_812-recursive-default_classes.dex",
+        "host_813-fp-args_classes.dex",
+        "host_814-large-field-offsets_classes.dex",
+        "host_815-invokeinterface-default_classes.dex",
+        "host_816-illegal-new-array_classes.dex",
+        "host_818-clinit-nterp_classes.dex",
+        "host_819-verification-runtime_classes.dex",
+        "host_820-vdex-multidex_classes.dex",
+        "host_820-vdex-multidex_classes2.dex",
+        "host_821-madvise-willneed_classes.dex",
+        "host_821-many-args_classes.dex",
+        "host_823-cha-inlining_classes.dex",
+        "host_824-verification-rethrow_classes.dex",
+        "host_825-unbalanced-lock_classes.dex",
+        "host_826-infinite-loop_classes.dex",
+        "host_827-resolve-method_classes-ex.dex",
+        "host_827-resolve-method_classes.dex",
+        "host_828-partial-lse_classes.dex",
+        "host_829-unresolved-enclosing_classes.dex",
+        "host_830-goto-zero_classes.dex",
+        "host_831-unresolved-field_classes.dex",
+        "host_831-unverified-bcp_classes-ex.dex",
+        "host_831-unverified-bcp_classes.dex",
+        "host_832-cha-recursive_classes.dex",
+        "host_833-background-verification_classes-ex.dex",
+        "host_833-background-verification_classes.dex",
+        "host_834-lse_classes.dex",
+        "host_835-b216762268_classes.dex",
+        "host_836-32768classes_classes.dex",
+        "host_837-deopt_classes.dex",
+        "host_838-override_classes.dex",
+        "host_839-clinit-throw_classes.dex",
+        "host_840-resolution_classes.dex",
+        "host_841-defaults_classes.dex",
+        "host_842-vdex-hard-failure_classes.dex",
+        "host_843-default-interface_classes.dex",
+        "host_844-exception2_classes.dex",
+        "host_844-exception_classes.dex",
+        "host_845-data-image_classes.dex",
+        "host_846-multidex-data-image_classes.dex",
+        "host_846-multidex-data-image_classes2.dex",
+        "host_847-filled-new-aray_classes.dex",
+        "host_848-pattern-match_classes.dex",
+        "host_849-records_classes.dex",
+        "host_850-checker-branches_classes.dex",
+        "host_900-hello-plugin_classes.dex",
+        "host_901-hello-ti-agent_classes.dex",
+        "host_902-hello-transformation_classes.dex",
+        "host_903-hello-tagging_classes.dex",
+        "host_904-object-allocation_classes.dex",
+        "host_905-object-free_classes.dex",
+        "host_906-iterate-heap_classes.dex",
+        "host_907-get-loaded-classes_classes.dex",
+        "host_908-gc-start-finish_classes.dex",
+        "host_909-attach-agent_classes.dex",
+        "host_910-methods_classes.dex",
+        "host_911-get-stack-trace_classes.dex",
+        "host_912-classes_classes.dex",
+        "host_913-heaps_classes.dex",
+        "host_914-hello-obsolescence_classes.dex",
+        "host_915-obsolete-2_classes.dex",
+        "host_916-obsolete-jit_classes.dex",
+        "host_917-fields-transformation_classes.dex",
+        "host_918-fields_classes.dex",
+        "host_919-obsolete-fields_classes.dex",
+        "host_920-objects_classes.dex",
+        "host_921-hello-failure_classes.dex",
+        "host_922-properties_classes.dex",
+        "host_923-monitors_classes.dex",
+        "host_924-threads_classes.dex",
+        "host_925-threadgroups_classes.dex",
+        "host_926-multi-obsolescence_classes.dex",
+        "host_927-timers_classes.dex",
+        "host_928-jni-table_classes.dex",
+        "host_929-search_classes-ex.dex",
+        "host_929-search_classes.dex",
+        "host_930-hello-retransform_classes.dex",
+        "host_931-agent-thread_classes.dex",
+        "host_932-transform-saves_classes.dex",
+        "host_933-misc-events_classes.dex",
+        "host_934-load-transform_classes-ex.dex",
+        "host_934-load-transform_classes.dex",
+        "host_935-non-retransformable_classes-ex.dex",
+        "host_935-non-retransformable_classes.dex",
+        "host_936-search-onload_classes-ex.dex",
+        "host_936-search-onload_classes.dex",
+        "host_937-hello-retransform-package_classes.dex",
+        "host_938-load-transform-bcp_classes-ex.dex",
+        "host_938-load-transform-bcp_classes.dex",
+        "host_939-hello-transformation-bcp_classes.dex",
+        "host_940-recursive-obsolete_classes.dex",
+        "host_941-recursive-obsolete-jit_classes.dex",
+        "host_942-private-recursive_classes.dex",
+        "host_943-private-recursive-jit_classes.dex",
+        "host_944-transform-classloaders_classes.dex",
+        "host_945-obsolete-native_classes.dex",
+        "host_946-obsolete-throw_classes.dex",
+        "host_947-reflect-method_classes.dex",
+        "host_948-change-annotations_classes.dex",
+        "host_949-in-memory-transform_classes.dex",
+        "host_950-redefine-intrinsic_classes.dex",
+        "host_951-threaded-obsolete_classes.dex",
+        "host_952-invoke-custom_classes.dex",
+        "host_953-invoke-polymorphic-compiler_classes.dex",
+        "host_954-invoke-polymorphic-verifier_classes.dex",
+        "host_955-methodhandles-smali_classes.dex",
+        "host_956-methodhandles_classes.dex",
+        "host_957-methodhandle-transforms_classes.dex",
+        "host_958-methodhandle-stackframe_classes.dex",
+        "host_959-invoke-polymorphic-accessors_classes.dex",
+        "host_960-default-smali_classes.dex",
+        "host_961-default-iface-resolution-gen_classes.dex",
+        "host_962-iface-static_classes.dex",
+        "host_963-default-range-smali_classes.dex",
+        "host_964-default-iface-init-gen_classes.dex",
+        "host_965-default-verify_classes.dex",
+        "host_966-default-conflict_classes.dex",
+        "host_967-default-ame_classes.dex",
+        "host_968-default-partial-compile-gen_classes.dex",
+        "host_969-iface-super_classes.dex",
+        "host_970-iface-super-resolution-gen_classes.dex",
+        "host_971-iface-super_classes.dex",
+        "host_972-default-imt-collision_classes.dex",
+        "host_972-iface-super-multidex_classes.dex",
+        "host_972-iface-super-multidex_classes2.dex",
+        "host_973-default-multidex_classes.dex",
+        "host_973-default-multidex_classes2.dex",
+        "host_974-verify-interface-super_classes.dex",
+        "host_975-iface-private_classes.dex",
+        "host_976-conflict-no-methods_classes.dex",
+        "host_978-virtual-interface_classes.dex",
+        "host_979-const-method-handle_classes.dex",
+        "host_980-redefine-object_classes-ex.dex",
+        "host_980-redefine-object_classes.dex",
+        "host_981-dedup-original-dex_classes.dex",
+        "host_982-ok-no-retransform_classes.dex",
+        "host_983-source-transform-verify_classes.dex",
+        "host_984-obsolete-invoke_classes.dex",
+        "host_985-re-obsolete_classes.dex",
+        "host_986-native-method-bind_classes.dex",
+        "host_987-agent-bind_classes.dex",
+        "host_988-method-trace_classes.dex",
+        "host_989-method-trace-throw_classes.dex",
+        "host_990-field-trace_classes.dex",
+        "host_991-field-trace-2_classes.dex",
+        "host_992-source-data_classes.dex",
+        "host_993-breakpoints-non-debuggable_classes.dex",
+        "host_993-breakpoints_classes.dex",
+        "host_994-breakpoint-line_classes.dex",
+        "host_995-breakpoints-throw_classes.dex",
+        "host_996-breakpoint-obsolete_classes.dex",
+        "host_997-single-step_classes.dex",
+        "host_998-redefine-use-after-free_classes-ex.dex",
+        "host_998-redefine-use-after-free_classes.dex",
+    ],
+}
+
+genrule {
+    name: "art-gtest-jars-DexFuzzerFolder",
+    // Zip the corpus folder. To get the folder, we grab the first file
+    // from `in` and use its directory.
+    cmd: "FILES=($(in)) &&" +
+         "$(location soong_zip) -j -L 0 -o $(out) -D $$(dirname $${FILES[0]})",
+    srcs: ["corpus/*"],
+    out: ["fuzzer_corpus.zip"],
+    tools: ["soong_zip"],
+}
diff --git a/tools/fuzzer/corpus/Main.dex b/tools/fuzzer/corpus/Main.dex
new file mode 100644
index 0000000..ec29035
--- /dev/null
+++ b/tools/fuzzer/corpus/Main.dex
Binary files differ
diff --git a/tools/fuzzer/corpus/b323685074.dex b/tools/fuzzer/corpus/b323685074.dex
new file mode 100644
index 0000000..aa26d59
--- /dev/null
+++ b/tools/fuzzer/corpus/b323685074.dex
Binary files differ
diff --git a/tools/fuzzer/corpus/code_item_padding.dex b/tools/fuzzer/corpus/code_item_padding.dex
new file mode 100644
index 0000000..2310d5b
--- /dev/null
+++ b/tools/fuzzer/corpus/code_item_padding.dex
Binary files differ
diff --git a/test/015-switch/expected-stderr.txt b/tools/fuzzer/corpus/empty.dex
similarity index 100%
copy from test/015-switch/expected-stderr.txt
copy to tools/fuzzer/corpus/empty.dex
diff --git a/tools/fuzzer/corpus/encoded_array_value.dex b/tools/fuzzer/corpus/encoded_array_value.dex
new file mode 100644
index 0000000..3079f47
--- /dev/null
+++ b/tools/fuzzer/corpus/encoded_array_value.dex
Binary files differ
diff --git a/tools/fuzzer/corpus/encoded_array_value2.dex b/tools/fuzzer/corpus/encoded_array_value2.dex
new file mode 100644
index 0000000..ed327cc
--- /dev/null
+++ b/tools/fuzzer/corpus/encoded_array_value2.dex
Binary files differ
diff --git a/tools/fuzzer/corpus/hello_world.dex b/tools/fuzzer/corpus/hello_world.dex
new file mode 100644
index 0000000..6e59dd7
--- /dev/null
+++ b/tools/fuzzer/corpus/hello_world.dex
Binary files differ
diff --git a/tools/fuzzer/corpus/recursive_encoded_array.dex b/tools/fuzzer/corpus/recursive_encoded_array.dex
new file mode 100644
index 0000000..c775e74
--- /dev/null
+++ b/tools/fuzzer/corpus/recursive_encoded_array.dex
Binary files differ
diff --git a/tools/fuzzer/create_corpus.py b/tools/fuzzer/create_corpus.py
new file mode 100755
index 0000000..53fdb01
--- /dev/null
+++ b/tools/fuzzer/create_corpus.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import pathlib
+import sys
+import zipfile
+
+""" Extract dex files into flat directory with unique names """
+
+assert len(sys.argv) >= 3, "Usage: " + __file__ + " output_dir input_zip+"
+dst = pathlib.Path(sys.argv[1])
+assert dst.exists()
+srcs = [pathlib.Path(f) for f in sys.argv[2:]]
+assert all(src.exists() for src in srcs)
+
+for src in srcs:
+  with zipfile.ZipFile(src, 'r') as zip:
+    for name in zip.namelist():
+      if name.endswith(".dex"):
+        with zip.open(name) as f:
+          (dst / name.replace("/", "_")).write_bytes(f.read())
diff --git a/tools/fuzzer/dex.dict b/tools/fuzzer/dex.dict
new file mode 100644
index 0000000..e728414
--- /dev/null
+++ b/tools/fuzzer/dex.dict
@@ -0,0 +1,11 @@
+#
+# AFL dictionary for DEX code
+# -----------------------------
+#
+
+# Valid headers: DEX magic word + version
+header_dex_035=\x64\x65\x78\x0a\x30\x33\x35
+header_dex_037=\x64\x65\x78\x0a\x30\x33\x37
+header_dex_038=\x64\x65\x78\x0a\x30\x33\x38
+header_dex_039=\x64\x65\x78\x0a\x30\x33\x39
+header_dex_040=\x64\x65\x78\x0a\x30\x34\x30
diff --git a/tools/fuzzer/libart_verify_dex_fuzzer.cc b/tools/fuzzer/libart_verify_dex_fuzzer.cc
new file mode 100644
index 0000000..1f255c1
--- /dev/null
+++ b/tools/fuzzer/libart_verify_dex_fuzzer.cc
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "dex/dex_file_verifier.h"
+#include "dex/standard_dex_file.h"
+
+extern "C" int LLVMFuzzerInitialize([[maybe_unused]] int* argc, [[maybe_unused]] char*** argv) {
+  // Set logging to error and above to avoid warnings about unexpected checksums.
+  android::base::SetMinimumLogSeverity(android::base::ERROR);
+  return 0;
+}
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  // Do not verify the checksum as we only care about the DEX file contents,
+  // and know that the checksum would probably be erroneous (i.e. random).
+  constexpr bool kVerify = false;
+
+  auto container = std::make_shared<art::MemoryDexFileContainer>(data, size);
+  art::StandardDexFile dex_file(data,
+                                /*location=*/"fuzz.dex",
+                                /*location_checksum=*/0,
+                                /*oat_dex_file=*/nullptr,
+                                container);
+
+  std::string error_msg;
+  art::dex::Verify(&dex_file, dex_file.GetLocation().c_str(), kVerify, &error_msg);
+
+  return 0;
+}
diff --git a/tools/generate_operator_out.py b/tools/generate_operator_out.py
index f3de61c..e4d66be 100755
--- a/tools/generate_operator_out.py
+++ b/tools/generate_operator_out.py
@@ -22,7 +22,7 @@
 
 
 _ENUM_START_RE = re.compile(
-    r'\benum\b\s+(class\s+)?(\S+)\s+:?.*\{(\s+// private)?')
+    r'\benum\b\s+(class\s+)?(?:HIDDEN |EXPORT )?(\S+)\s+:?.*\{(\s+// private)?')
 _ENUM_VALUE_RE = re.compile(r'([A-Za-z0-9_]+)(.*)')
 _ENUM_END_RE = re.compile(r'^\s*\};$')
 _ENUMS = {}
@@ -76,7 +76,7 @@
 
                 # Is this the start or end of an enclosing class or struct?
                 m = re.search(
-                    r'^\s*(?:class|struct)(?: MANAGED)?(?: PACKED\([0-9]\))? (\S+).* \{', raw_line)
+                    r'^\s*(?:class|struct)(?: HIDDEN| EXPORT)?(?: MANAGED)?(?: PACKED\([0-9]\))? (\S+).* \{', raw_line)
                 if m:
                     enclosing_classes.append(m.group(1))
                     continue
diff --git a/tools/golem/build-target.sh b/tools/golem/build-target.sh
index 1ebd7c9..d8ec58b 100755
--- a/tools/golem/build-target.sh
+++ b/tools/golem/build-target.sh
@@ -269,8 +269,6 @@
   execute lunch "$lunch_target"
   # Golem uses master-art repository which is missing a lot of other libraries.
   setenv SOONG_ALLOW_MISSING_DEPENDENCIES true
-  # master-art cannot build with Bazel.
-  setenv BUILD_BROKEN_DISABLE_BAZEL true
   # Let the build system know we're not aiming to do a full platform build.
   if [ ! -d frameworks/base ]; then
     setenv TARGET_BUILD_UNBUNDLED true
diff --git a/tools/hiddenapi/Android.bp b/tools/hiddenapi/Android.bp
index aa7b9f6..fff9492 100644
--- a/tools/hiddenapi/Android.bp
+++ b/tools/hiddenapi/Android.bp
@@ -41,6 +41,7 @@
     stl: "c++_static",
     static_libs: [
         "libbase",
+        "libcrypto",
     ],
 }
 
diff --git a/tools/hiddenapi/hiddenapi.cc b/tools/hiddenapi/hiddenapi.cc
index 5c750af..a1fea05 100644
--- a/tools/hiddenapi/hiddenapi.cc
+++ b/tools/hiddenapi/hiddenapi.cc
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include <openssl/sha.h>
+
 #include <fstream>
 #include <iostream>
 #include <iterator>
@@ -297,14 +299,14 @@
 
     for (const std::string& filename : dex_paths) {
       DexFileLoader dex_file_loader(filename);
+      DexFileLoaderErrorCode error_code;
       bool success = dex_file_loader.Open(/* verify= */ true,
                                           /* verify_checksum= */ true,
+                                          /*allow_no_dex_files=*/ ignore_empty,
+                                          &error_code,
                                           &error_msg,
                                           &dex_files_);
-      // If requested ignore a jar with no classes.dex files.
-      if (!success && ignore_empty && error_msg != "Entry not found") {
-        CHECK(success) << "Open failed for '" << filename << "' " << error_msg;
-      }
+      CHECK(success) << "Open failed for '" << filename << "' " << error_msg;
     }
   }
 
@@ -658,16 +660,15 @@
 
   // Writes the edited dex file into a file.
   void WriteTo(const std::string& path) {
+    CHECK_GT(inputs_.size(), 0u);
     std::vector<uint8_t> output;
 
     // Copy the old dex files into the backing data vector.
-    size_t truncated_size = 0;
     std::vector<size_t> header_offset;
     for (size_t i = 0; i < inputs_.size(); i++) {
       const DexFile* dex = inputs_[i].first;
       header_offset.push_back(output.size());
-      std::copy(
-          dex->Begin(), dex->Begin() + dex->GetHeader().file_size_, std::back_inserter(output));
+      std::copy(dex->Begin(), dex->End(), std::back_inserter(output));
 
       // Clear the old map list (make it into padding).
       const dex::MapList* map = dex->GetMapList();
@@ -676,9 +677,7 @@
       CHECK_LE(map_off, output.size()) << "Map list past the end of file";
       CHECK_EQ(map_size, output.size() - map_off) << "Map list expected at the end of file";
       std::fill_n(output.data() + map_off, map_size, 0);
-      truncated_size = output.size() - map_size;
     }
-    output.resize(truncated_size);  // Truncate last map list.
 
     // Append the hidden api data into the backing data vector.
     std::vector<size_t> hiddenapi_offset;
@@ -689,7 +688,8 @@
       std::copy(hiddenapi_data.begin(), hiddenapi_data.end(), std::back_inserter(output));
     }
 
-    // Update the dex headers and map lists.
+    // Append modified map lists.
+    std::vector<uint32_t> map_list_offset;
     for (size_t i = 0; i < inputs_.size(); i++) {
       output.resize(RoundUp(output.size(), kMapListAlignment));  // Align.
 
@@ -714,16 +714,18 @@
         uint32_t payload_offset = hiddenapi_offset[i];
         items.push_back(dex::MapItem{DexFile::kDexTypeHiddenapiClassData, 0, 1u, payload_offset});
       }
-      uint32_t map_offset = output.size();
-      items.push_back(dex::MapItem{DexFile::kDexTypeMapList, 0, 1u, map_offset});
+      map_list_offset.push_back(output.size());
+      items.push_back(dex::MapItem{DexFile::kDexTypeMapList, 0, 1u, map_list_offset.back()});
       uint32_t item_count = items.size();
       Append(&output, &item_count, 1);
       Append(&output, items.data(), items.size());
+    }
 
-      // Update header.
+    // Update headers.
+    for (size_t i = 0; i < inputs_.size(); i++) {
       uint8_t* begin = output.data() + header_offset[i];
       auto* header = reinterpret_cast<DexFile::Header*>(begin);
-      header->map_off_ = map_offset;
+      header->map_off_ = map_list_offset[i];
       if (i + 1 < inputs_.size()) {
         CHECK_EQ(header->file_size_, header_offset[i + 1] - header_offset[i]);
       } else {
@@ -731,8 +733,10 @@
         header->data_size_ = output.size() - header->data_off_;
         header->file_size_ = output.size() - header_offset[i];
       }
+      header->SetDexContainer(header_offset[i], output.size());
+      size_t sha1_start = offsetof(DexFile::Header, file_size_);
+      SHA1(begin + sha1_start, header->file_size_ - sha1_start, header->signature_.data());
       header->checksum_ = DexFile::CalculateChecksum(begin, header->file_size_);
-      // TODO: We should also update the SHA1 signature.
     }
 
     // Write the output file.
diff --git a/tools/hiddenapi/hiddenapi_test.cc b/tools/hiddenapi/hiddenapi_test.cc
index 36e80c5..fe7677e 100644
--- a/tools/hiddenapi/hiddenapi_test.cc
+++ b/tools/hiddenapi/hiddenapi_test.cc
@@ -114,9 +114,12 @@
       UNREACHABLE();
     }
 
-    ArtDexFileLoader dex_loader(fd.Release(), file.GetFilename());
+    ArtDexFileLoader dex_loader(&fd, file.GetFilename());
     std::unique_ptr<const DexFile> dex_file(dex_loader.Open(
-        /* verify= */ true, /* verify_checksum= */ true, /* mmap_shared= */ false, &error_msg));
+        /*location_checksum=*/0,
+        /*verify=*/true,
+        /*verify_checksum=*/true,
+        &error_msg));
     if (dex_file.get() == nullptr) {
       LOG(FATAL) << "Open failed for '" << file.GetFilename() << "' " << error_msg;
       UNREACHABLE();
diff --git a/tools/jvmti-agents/breakpoint-logger/breakpoint_logger.cc b/tools/jvmti-agents/breakpoint-logger/breakpoint_logger.cc
index 2f8b682..25bf794 100644
--- a/tools/jvmti-agents/breakpoint-logger/breakpoint_logger.cc
+++ b/tools/jvmti-agents/breakpoint-logger/breakpoint_logger.cc
@@ -36,7 +36,7 @@
   std::vector<SingleBreakpointTarget> bps;
 };
 
-static void VMInitCB(jvmtiEnv* jvmti, JNIEnv* env, jthread thr ATTRIBUTE_UNUSED) {
+static void VMInitCB(jvmtiEnv* jvmti, JNIEnv* env, [[maybe_unused]] jthread thr) {
   BreakpointTargets* all_targets = nullptr;
   jvmtiError err = jvmti->GetEnvironmentLocalStorage(reinterpret_cast<void**>(&all_targets));
   if (err != JVMTI_ERROR_NONE || all_targets == nullptr) {
@@ -350,7 +350,7 @@
 static jint AgentStart(StartType start,
                        JavaVM* vm,
                        char* options,
-                       void* reserved ATTRIBUTE_UNUSED) {
+                       [[maybe_unused]] void* reserved) {
   jvmtiEnv* jvmti = nullptr;
   jvmtiError error = JVMTI_ERROR_NONE;
   {
diff --git a/tools/jvmti-agents/dump-jvmti-state/dump-jvmti.cc b/tools/jvmti-agents/dump-jvmti-state/dump-jvmti.cc
index 71a0115..afa8d61 100644
--- a/tools/jvmti-agents/dump-jvmti-state/dump-jvmti.cc
+++ b/tools/jvmti-agents/dump-jvmti-state/dump-jvmti.cc
@@ -88,7 +88,9 @@
 
 }  // namespace
 
-static jint AgentStart(JavaVM* vm, char* options ATTRIBUTE_UNUSED, void* reserved ATTRIBUTE_UNUSED) {
+static jint AgentStart(JavaVM* vm,
+                       [[maybe_unused]] char* options,
+                       [[maybe_unused]] void* reserved) {
   jvmtiEnv* jvmti = nullptr;
   if (SetupJvmtiEnv(vm, &jvmti) != JNI_OK) {
     LOG(ERROR) << "Could not get JVMTI env or ArtTiEnv!";
diff --git a/tools/jvmti-agents/enable-vlog/enablevlog.cc b/tools/jvmti-agents/enable-vlog/enablevlog.cc
index 7bee013..d42b0ff 100644
--- a/tools/jvmti-agents/enable-vlog/enablevlog.cc
+++ b/tools/jvmti-agents/enable-vlog/enablevlog.cc
@@ -89,7 +89,7 @@
 
 }  // namespace
 
-static jint AgentStart(JavaVM* vm, char* options, void* reserved ATTRIBUTE_UNUSED) {
+static jint AgentStart(JavaVM* vm, char* options, [[maybe_unused]] void* reserved) {
   jvmtiEnv* jvmti = nullptr;
   if (SetupJvmtiEnv(vm, &jvmti) != JNI_OK) {
     LOG(ERROR) << "Could not get JVMTI env or ArtTiEnv!";
diff --git a/tools/jvmti-agents/field-counts/fieldcount.cc b/tools/jvmti-agents/field-counts/fieldcount.cc
index 5a4b00e..526d68f 100644
--- a/tools/jvmti-agents/field-counts/fieldcount.cc
+++ b/tools/jvmti-agents/field-counts/fieldcount.cc
@@ -195,7 +195,7 @@
   }
 }
 
-static void VMDeathCb(jvmtiEnv* jvmti, JNIEnv* env ATTRIBUTE_UNUSED) {
+static void VMDeathCb(jvmtiEnv* jvmti, [[maybe_unused]] JNIEnv* env) {
   DataDumpRequestCb(jvmti);
   RequestList* list = nullptr;
   CHECK_JVMTI(jvmti->GetEnvironmentLocalStorage(reinterpret_cast<void**>(&list)));
@@ -211,7 +211,7 @@
   CHECK_JVMTI(jvmti->SetEnvironmentLocalStorage(list));
 }
 
-static void VMInitCb(jvmtiEnv* jvmti, JNIEnv* env, jobject thr ATTRIBUTE_UNUSED) {
+static void VMInitCb(jvmtiEnv* jvmti, JNIEnv* env, [[maybe_unused]] jobject thr) {
   char* args = nullptr;
   CHECK_JVMTI(jvmti->GetEnvironmentLocalStorage(reinterpret_cast<void**>(&args)));
   CHECK_JVMTI(jvmti->SetEnvironmentLocalStorage(nullptr));
@@ -260,14 +260,14 @@
 // Late attachment (e.g. 'am attach-agent').
 extern "C" JNIEXPORT jint JNICALL Agent_OnAttach(JavaVM* vm,
                                                  char* options,
-                                                 void* reserved ATTRIBUTE_UNUSED) {
+                                                 [[maybe_unused]] void* reserved) {
   return AgentStart(vm, options, /*is_onload=*/false);
 }
 
 // Early attachment
 extern "C" JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM* jvm,
                                                char* options,
-                                               void* reserved ATTRIBUTE_UNUSED) {
+                                               [[maybe_unused]] void* reserved) {
   return AgentStart(jvm, options, /*is_onload=*/true);
 }
 
diff --git a/tools/jvmti-agents/field-null-percent/fieldnull.cc b/tools/jvmti-agents/field-null-percent/fieldnull.cc
index 016164f..b2cd13b 100644
--- a/tools/jvmti-agents/field-null-percent/fieldnull.cc
+++ b/tools/jvmti-agents/field-null-percent/fieldnull.cc
@@ -140,7 +140,7 @@
   }
 }
 
-static void VMDeathCb(jvmtiEnv* jvmti, JNIEnv* env ATTRIBUTE_UNUSED) {
+static void VMDeathCb(jvmtiEnv* jvmti, [[maybe_unused]] JNIEnv* env) {
   DataDumpRequestCb(jvmti);
   RequestList* list = nullptr;
   CHECK_JVMTI(jvmti->GetEnvironmentLocalStorage(reinterpret_cast<void**>(&list)));
@@ -154,7 +154,7 @@
   CHECK_JVMTI(jvmti->SetEnvironmentLocalStorage(list));
 }
 
-static void VMInitCb(jvmtiEnv* jvmti, JNIEnv* env, jobject thr ATTRIBUTE_UNUSED) {
+static void VMInitCb(jvmtiEnv* jvmti, JNIEnv* env, [[maybe_unused]] jobject thr) {
   char* args = nullptr;
   CHECK_JVMTI(jvmti->GetEnvironmentLocalStorage(reinterpret_cast<void**>(&args)));
   CHECK_JVMTI(jvmti->SetEnvironmentLocalStorage(nullptr));
@@ -201,16 +201,16 @@
 }
 
 // Late attachment (e.g. 'am attach-agent').
-extern "C" JNIEXPORT jint JNICALL Agent_OnAttach(JavaVM *vm,
+extern "C" JNIEXPORT jint JNICALL Agent_OnAttach(JavaVM* vm,
                                                  char* options,
-                                                 void* reserved ATTRIBUTE_UNUSED) {
+                                                 [[maybe_unused]] void* reserved) {
   return AgentStart(vm, options, /*is_onload=*/false);
 }
 
 // Early attachment
 extern "C" JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM* jvm,
                                                char* options,
-                                               void* reserved ATTRIBUTE_UNUSED) {
+                                               [[maybe_unused]] void* reserved) {
   return AgentStart(jvm, options, /*is_onload=*/true);
 }
 
diff --git a/tools/jvmti-agents/jit-load/jitload.cc b/tools/jvmti-agents/jit-load/jitload.cc
index 6ef7b67..f5d6ff4 100644
--- a/tools/jvmti-agents/jit-load/jitload.cc
+++ b/tools/jvmti-agents/jit-load/jitload.cc
@@ -51,8 +51,8 @@
 }
 
 JNICALL void VmInitCb(jvmtiEnv* jvmti,
-                      JNIEnv* env ATTRIBUTE_UNUSED,
-                      jthread curthread ATTRIBUTE_UNUSED) {
+                      [[maybe_unused]] JNIEnv* env,
+                      [[maybe_unused]] jthread curthread) {
   jthread jit_thread = GetJitThread();
   if (jit_thread != nullptr) {
     CHECK_EQ(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_CLASS_PREPARE, jit_thread),
@@ -72,8 +72,8 @@
 }
 
 JNICALL void ClassPrepareJit(jvmtiEnv* jvmti,
-                             JNIEnv* jni_env ATTRIBUTE_UNUSED,
-                             jthread thr ATTRIBUTE_UNUSED,
+                             [[maybe_unused]] JNIEnv* jni_env,
+                             [[maybe_unused]] jthread thr,
                              jclass klass) {
   AgentOptions* ops;
   CHECK_CALL_SUCCESS(jvmti->GetEnvironmentLocalStorage(reinterpret_cast<void**>(&ops)));
@@ -85,9 +85,7 @@
   CHECK_CALL_SUCCESS(jvmti->Deallocate(reinterpret_cast<unsigned char*>(klass_name)));
 }
 
-JNICALL void VMDeathCb(jvmtiEnv* jvmti, JNIEnv* env ATTRIBUTE_UNUSED) {
-  DataDumpRequestCb(jvmti);
-}
+JNICALL void VMDeathCb(jvmtiEnv* jvmti, [[maybe_unused]] JNIEnv* env) { DataDumpRequestCb(jvmti); }
 
 static jvmtiEnv* SetupJvmti(JavaVM* vm, const char* options) {
   android::base::InitLogging(/* argv= */nullptr);
diff --git a/tools/jvmti-agents/list-extensions/list-extensions.cc b/tools/jvmti-agents/list-extensions/list-extensions.cc
index 6d8237a..cce42e4 100644
--- a/tools/jvmti-agents/list-extensions/list-extensions.cc
+++ b/tools/jvmti-agents/list-extensions/list-extensions.cc
@@ -147,7 +147,7 @@
   return JNI_OK;
 }
 
-jint AgentStart(JavaVM* vm, char* options ATTRIBUTE_UNUSED, void* reserved ATTRIBUTE_UNUSED) {
+jint AgentStart(JavaVM* vm, [[maybe_unused]] char* options, [[maybe_unused]] void* reserved) {
   if (SetupJvmtiEnv(vm) != JNI_OK) {
     LOG(ERROR) << "Could not get JVMTI env or ArtTiEnv!";
     return JNI_ERR;
diff --git a/tools/jvmti-agents/simple-force-redefine/forceredefine.cc b/tools/jvmti-agents/simple-force-redefine/forceredefine.cc
index 3474238..351a517 100644
--- a/tools/jvmti-agents/simple-force-redefine/forceredefine.cc
+++ b/tools/jvmti-agents/simple-force-redefine/forceredefine.cc
@@ -13,23 +13,21 @@
 // limitations under the License.
 //
 
-#include "__mutex_base"
-#include <cstddef>
-#include <fcntl.h>
-#include <fstream>
-#include <memory>
-#include <sstream>
-#include <string>
-#include <unistd.h>
-#include <unordered_set>
-
 #include <android-base/logging.h>
 #include <android-base/macros.h>
-
-#include <nativehelper/scoped_local_ref.h>
-
+#include <fcntl.h>
 #include <jni.h>
 #include <jvmti.h>
+#include <nativehelper/scoped_local_ref.h>
+#include <unistd.h>
+
+#include <cstddef>
+#include <fstream>
+#include <memory>
+#include <mutex>
+#include <sstream>
+#include <string>
+#include <unordered_set>
 
 // Slicer's headers have code that triggers these warnings. b/65298177
 #pragma clang diagnostic push
@@ -134,11 +132,11 @@
 }
 
 static void CbClassFileLoadHook(jvmtiEnv* jvmti,
-                                JNIEnv* env ATTRIBUTE_UNUSED,
-                                jclass classBeingRedefined ATTRIBUTE_UNUSED,
-                                jobject loader ATTRIBUTE_UNUSED,
+                                [[maybe_unused]] JNIEnv* env,
+                                [[maybe_unused]] jclass classBeingRedefined,
+                                [[maybe_unused]] jobject loader,
                                 const char* name,
-                                jobject protectionDomain ATTRIBUTE_UNUSED,
+                                [[maybe_unused]] jobject protectionDomain,
                                 jint classDataLen,
                                 const unsigned char* classData,
                                 jint* newClassDataLen,
@@ -212,7 +210,7 @@
   env->DeleteLocalRef(klass);
 }
 
-static void AgentMain(jvmtiEnv* jvmti, JNIEnv* jni, void* arg ATTRIBUTE_UNUSED) {
+static void AgentMain(jvmtiEnv* jvmti, JNIEnv* jni, [[maybe_unused]] void* arg) {
   AgentInfo* ai = GetAgentInfo(jvmti);
   std::string klass_name;
   jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, nullptr);
@@ -227,7 +225,7 @@
   }
 }
 
-static void CbVmInit(jvmtiEnv* jvmti, JNIEnv* env, jthread thr ATTRIBUTE_UNUSED) {
+static void CbVmInit(jvmtiEnv* jvmti, JNIEnv* env, [[maybe_unused]] jthread thr) {
   // Create a Thread object.
   ScopedLocalRef<jobject> thread_name(env, env->NewStringUTF("Agent Thread"));
   if (thread_name.get() == nullptr) {
@@ -263,7 +261,7 @@
 }  // namespace
 
 template <bool kIsOnLoad>
-static jint AgentStart(JavaVM* vm, char* options, void* reserved ATTRIBUTE_UNUSED) {
+static jint AgentStart(JavaVM* vm, char* options, [[maybe_unused]] void* reserved) {
   jvmtiEnv* jvmti = nullptr;
 
   if (vm->GetEnv(reinterpret_cast<void**>(&jvmti), JVMTI_VERSION_1_1) != JNI_OK ||
diff --git a/tools/jvmti-agents/simple-profile/simple_profile.cc b/tools/jvmti-agents/simple-profile/simple_profile.cc
index 7161142..9ea99d5 100644
--- a/tools/jvmti-agents/simple-profile/simple_profile.cc
+++ b/tools/jvmti-agents/simple-profile/simple_profile.cc
@@ -192,7 +192,7 @@
 
   CHECK_JVMTI(jvmti->RunAgentThread(
       thread.get(),
-      [](jvmtiEnv* jvmti, JNIEnv* jni, void* unused_data ATTRIBUTE_UNUSED) {
+      [](jvmtiEnv* jvmti, JNIEnv* jni, [[maybe_unused]] void* unused_data) {
         SimpleProfileData* data = SimpleProfileData::GetProfileData(jvmti);
         data->RunDumpLoop(jvmti, jni);
       },
@@ -354,7 +354,7 @@
 
 static void MethodEntryCB(jvmtiEnv* jvmti_env,
                           JNIEnv* env,
-                          jthread thread ATTRIBUTE_UNUSED,
+                          [[maybe_unused]] jthread thread,
                           jmethodID method) {
   SimpleProfileData* data = SimpleProfileData::GetProfileData(jvmti_env);
   data->Enter(jvmti_env, env, method);
@@ -418,7 +418,7 @@
 static jint AgentStart(StartType start,
                        JavaVM* vm,
                        const char* options,
-                       void* reserved ATTRIBUTE_UNUSED) {
+                       [[maybe_unused]] void* reserved) {
   if (options == nullptr) {
     options = "";
   }
@@ -476,7 +476,7 @@
   callbacks.VMInit = &VMInitCB;
   callbacks.DataDumpRequest = &DataDumpCb;
   callbacks.VMDeath = &VMDeathCB;
-  callbacks.ThreadEnd = [](jvmtiEnv* env, JNIEnv* jni, jthread thr ATTRIBUTE_UNUSED) {
+  callbacks.ThreadEnd = [](jvmtiEnv* env, JNIEnv* jni, [[maybe_unused]] jthread thr) {
     VMDeathCB(env, jni);
   };
 
diff --git a/tools/jvmti-agents/ti-alloc-sample/ti_alloc_sample.cc b/tools/jvmti-agents/ti-alloc-sample/ti_alloc_sample.cc
index d719db5..1b359b8 100644
--- a/tools/jvmti-agents/ti-alloc-sample/ti_alloc_sample.cc
+++ b/tools/jvmti-agents/ti-alloc-sample/ti_alloc_sample.cc
@@ -310,7 +310,7 @@
 static void JNICALL logVMObjectAlloc(jvmtiEnv* jvmti,
                                      JNIEnv* jni,
                                      jthread thread,
-                                     jobject obj ATTRIBUTE_UNUSED,
+                                     [[maybe_unused]] jobject obj,
                                      jclass klass,
                                      jlong size) {
   // Sample only once out of sampling_rate tries, and prevent recursive allocation tracking,
@@ -407,9 +407,7 @@
   return true;
 }
 
-static jint AgentStart(JavaVM* vm,
-                       char* options,
-                       void* reserved ATTRIBUTE_UNUSED) {
+static jint AgentStart(JavaVM* vm, char* options, [[maybe_unused]] void* reserved) {
   // Handle the sampling rate, depth limit, and output path, if set.
   if (!ProcessOptions(options)) {
     return JNI_ERR;
diff --git a/tools/jvmti-agents/ti-fast/tifast.cc b/tools/jvmti-agents/ti-fast/tifast.cc
index bb49aa1..4c182c8 100644
--- a/tools/jvmti-agents/ti-fast/tifast.cc
+++ b/tools/jvmti-agents/ti-fast/tifast.cc
@@ -37,7 +37,8 @@
 // env.
 static constexpr jint kArtTiVersion = JVMTI_VERSION_1_2 | 0x40000000;
 
-template <typename ...Args> static void Unused(Args... args ATTRIBUTE_UNUSED) {}
+template <typename... Args>
+static void Unused([[maybe_unused]] Args... args) {}
 
 // jthread is a typedef of jobject so we use this to allow the templates to distinguish them.
 struct jthreadContainer { jthread thread; };
@@ -407,7 +408,8 @@
 };
 
 // Base case
-template<> void LogPrinter::PrintRest(jvmtiEnv* jvmti ATTRIBUTE_UNUSED, JNIEnv* jni) {
+template <>
+void LogPrinter::PrintRest([[maybe_unused]] jvmtiEnv* jvmti, JNIEnv* jni) {
   if (jni == nullptr) {
     start_args = "jvmtiEnv*";
   } else {
@@ -668,9 +670,7 @@
 
 }  // namespace
 
-static jint AgentStart(JavaVM* vm,
-                       char* options,
-                       void* reserved ATTRIBUTE_UNUSED) {
+static jint AgentStart(JavaVM* vm, char* options, [[maybe_unused]] void* reserved) {
   jvmtiEnv* jvmti = nullptr;
   jvmtiError error = JVMTI_ERROR_NONE;
   if (SetupJvmtiEnv(vm, &jvmti) != JNI_OK) {
diff --git a/tools/jvmti-agents/titrace/titrace.cc b/tools/jvmti-agents/titrace/titrace.cc
index d9fab25..7178455 100644
--- a/tools/jvmti-agents/titrace/titrace.cc
+++ b/tools/jvmti-agents/titrace/titrace.cc
@@ -207,8 +207,8 @@
 
 struct EventCallbacks {
   static void SingleStep(jvmtiEnv* jvmti_env,
-                         JNIEnv* jni_env ATTRIBUTE_UNUSED,
-                         jthread thread ATTRIBUTE_UNUSED,
+                         [[maybe_unused]] JNIEnv* jni_env,
+                         [[maybe_unused]] jthread thread,
                          jmethodID method,
                          jlocation location) {
     TraceStatistics& stats = TraceStatistics::GetSingleton();
@@ -218,7 +218,7 @@
   // Use "kill -SIGQUIT" to generate a data dump request.
   // Useful when running an android app since it doesn't go through
   // a normal Agent_OnUnload.
-  static void DataDumpRequest(jvmtiEnv* jvmti_env ATTRIBUTE_UNUSED) {
+  static void DataDumpRequest([[maybe_unused]] jvmtiEnv* jvmti_env) {
     TraceStatistics& stats = TraceStatistics::GetSingleton();
     stats.Log();
   }
@@ -305,10 +305,9 @@
 
 // Note: This is not called for normal Android apps,
 // use "kill -SIGQUIT" instead to generate a data dump request.
-JNIEXPORT void JNICALL Agent_OnUnload(JavaVM* vm ATTRIBUTE_UNUSED) {
+JNIEXPORT void JNICALL Agent_OnUnload([[maybe_unused]] JavaVM* vm) {
   using namespace titrace;  // NOLINT [build/namespaces] [5]
   LOG(INFO) << "Agent_OnUnload: Goodbye";
 
   TraceStatistics::GetSingleton().Log();
 }
-
diff --git a/tools/libcore_failures.txt b/tools/libcore_failures.txt
index fc28acd..a3c07cc 100644
--- a/tools/libcore_failures.txt
+++ b/tools/libcore_failures.txt
@@ -290,8 +290,7 @@
   bug: 228441328,
   names: ["test.java.lang.Math.CeilAndFloorTests#nearIntegerTests",
           "test.java.time.chrono.TestEraDisplayName",
-          "test.java.time.format.TestDateTimeFormatterBuilderWithLocale",
-          "test.java.util.TestFormatter"]
+          "test.java.time.format.TestDateTimeFormatterBuilderWithLocale"]
 },
 {
   description: "Fails on armv8 device",
diff --git a/tools/libcore_gcstress_debug_failures.txt b/tools/libcore_gcstress_debug_failures.txt
index c931610..a1c7711 100644
--- a/tools/libcore_gcstress_debug_failures.txt
+++ b/tools/libcore_gcstress_debug_failures.txt
@@ -10,7 +10,6 @@
   modes: [device],
   names: ["jsr166.ExecutorsTest#testTimedCallable",
           "jsr166.RecursiveActionTest#testJoinIgnoresInterruptsOutsideForkJoinPool",
-          "libcore.java.lang.ref.ReferenceQueueTest#testRemoveWithDelayedResultAndTimeout",
           "libcore.java.text.DecimalFormatTest#testWhitespaceError",
           "libcore.java.text.DecimalFormatTest#testWhitespaceTolerated",
           "libcore.java.text.DecimalFormatTest#test_exponentSeparator",
@@ -48,6 +47,9 @@
           "org.apache.harmony.luni.tests.internal.net.www.protocol.http.HttpURLConnectionTest#testUsingProxy",
           "org.apache.harmony.luni.tests.internal.net.www.protocol.http.HttpURLConnectionTest#testUsingProxySelector",
           "org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest#testConsequentProxyConnection",
+          "org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest#testHttpsConnection",
+          "org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest#testProxyAuthConnection",
+          "org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest#testProxyAuthConnection_doOutput",
           "org.apache.harmony.tests.java.lang.ref.ReferenceQueueTest#test_removeJ",
           "org.apache.harmony.tests.java.lang.ProcessManagerTest#testSleep",
           "org.apache.harmony.tests.java.util.TimerTest#testOverdueTaskExecutesImmediately",
@@ -64,6 +66,16 @@
   ]
 },
 {
+  description: "Failure with gcstress and debug.",
+  bug: 313922528,
+  result: ERROR,
+  modes: [host],
+  names: ["libcore.java.util.jar.OldManifestTest#test_equals",
+          "test.java.util.Collection",
+          "test.java.util.TestFormatter"
+  ]
+},
+{
   description: "Time-sensitive test fails check of elapsed time with gcstress",
   result: EXEC_FAILED,
   bug: 205007075,
diff --git a/tools/libcore_gcstress_failures.txt b/tools/libcore_gcstress_failures.txt
index 81d6ca0..de9e520 100644
--- a/tools/libcore_gcstress_failures.txt
+++ b/tools/libcore_gcstress_failures.txt
@@ -29,6 +29,12 @@
   result: EXEC_FAILED,
   modes: [device],
   names: ["jsr166.TimeUnitTest#testConvert",
+          "libcore.java.lang.invoke.MethodHandleCombinersTest#testCollectorMultiThreaded",
+          "libcore.java.lang.invoke.MethodHandleCombinersTest#testCollectArgumentsMultiThreaded",
+          "libcore.java.lang.invoke.MethodHandleCombinersTest#testConstantMultithreaded",
+          "libcore.java.lang.invoke.MethodHandleCombinersTest#testGuardWithTestMultiThreaded",
+          "libcore.java.lang.invoke.MethodHandleCombinersTest#testPermuteArgumentsMultiThreaded",
+          "libcore.java.lang.invoke.MethodHandleCombinersTest#testReferenceArrayGetterMultiThreaded",
           "libcore.java.lang.StringTest#testFastPathString_wellFormedUtf8Sequence",
           "libcore.java.math.BigIntegerTest#test_Constructor_IILjava_util_Random",
           "libcore.java.math.BigIntegerTest#test_probablePrime",
@@ -38,7 +44,9 @@
           "org.apache.harmony.tests.java.lang.String2Test#test_getBytes",
           "org.apache.harmony.tests.java.text.DateFormatTest#test_getAvailableLocales",
           "org.apache.harmony.tests.java.util.TimerTest#testOverdueTaskExecutesImmediately",
-          "org.apache.harmony.tests.java.util.WeakHashMapTest#test_keySet_hasNext"]
+          "org.apache.harmony.tests.java.util.WeakHashMapTest#test_keySet_hasNext",
+          "test.java.math.BigDecimal.DivideMcTests#mcDivideTests",
+          "test.java.util.Collections.RacingCollections#main"]
 },
 {
   description: "Timeouts.",
diff --git a/tools/luci/config/generated/cr-buildbucket.cfg b/tools/luci/config/generated/cr-buildbucket.cfg
index 1da398c..c7d12b7 100644
--- a/tools/luci/config/generated/cr-buildbucket.cfg
+++ b/tools/luci/config/generated/cr-buildbucket.cfg
@@ -2,7 +2,7 @@
 # Do not modify manually.
 #
 # For the schema of this file, see BuildbucketCfg message:
-#   https://luci-config.appspot.com/schemas/projects:buildbucket.cfg
+#   https://config.luci.app/schemas/projects:buildbucket.cfg
 
 buckets {
   name: "ci"
@@ -17,14 +17,19 @@
     builders {
       name: "angler-armv7-debug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "device_type:bonito|oriole|walleye"
       dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:32"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:true"
+        properties_j: "device:\"angler-armv7\""
+        properties_j: "generational_cc:true"
+        properties_j: "product:\"arm_krait\""
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -42,14 +47,19 @@
     builders {
       name: "angler-armv7-ndebug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "device_type:bonito|oriole|walleye"
       dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:32"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:false"
+        properties_j: "device:\"angler-armv7\""
+        properties_j: "generational_cc:true"
+        properties_j: "product:\"arm_krait\""
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -74,7 +84,13 @@
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:32"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:false"
+        properties_j: "debug:true"
+        properties_j: "device:\"angler-armv7\""
+        properties_j: "generational_cc:false"
+        properties_j: "product:\"arm_krait\""
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -92,14 +108,19 @@
     builders {
       name: "angler-armv8-debug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "device_type:bonito|oriole|walleye"
       dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:64"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:true"
+        properties_j: "device:\"angler-armv8\""
+        properties_j: "generational_cc:true"
+        properties_j: "product:\"armv8\""
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -117,14 +138,19 @@
     builders {
       name: "angler-armv8-ndebug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "device_type:bonito|oriole|walleye"
       dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:64"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:false"
+        properties_j: "device:\"angler-armv8\""
+        properties_j: "generational_cc:true"
+        properties_j: "product:\"armv8\""
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -149,7 +175,13 @@
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:64"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:false"
+        properties_j: "debug:true"
+        properties_j: "device:\"angler-armv8\""
+        properties_j: "generational_cc:false"
+        properties_j: "product:\"armv8\""
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -167,14 +199,20 @@
     builders {
       name: "bullhead-armv7-gcstress-ndebug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "device_type:bonito|oriole|walleye"
       dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:32"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:false"
+        properties_j: "device:\"bullhead-armv7\""
+        properties_j: "gcstress:true"
+        properties_j: "generational_cc:true"
+        properties_j: "product:\"arm_krait\""
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -192,14 +230,20 @@
     builders {
       name: "bullhead-armv8-gcstress-debug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "device_type:bonito|oriole|walleye"
       dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:64"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:true"
+        properties_j: "device:\"bullhead-armv8\""
+        properties_j: "gcstress:true"
+        properties_j: "generational_cc:true"
+        properties_j: "product:\"armv8\""
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -217,64 +261,20 @@
     builders {
       name: "bullhead-armv8-gcstress-ndebug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "device_type:bonito|oriole|walleye"
       dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:64"
         properties_j: "builder_group:\"client.art\""
-      }
-      execution_timeout_secs: 108000
-      expiration_secs: 61200
-      caches {
-        name: "art"
-        path: "art"
-      }
-      build_numbers: YES
-      service_account: "art-ci-builder@chops-service-accounts.iam.gserviceaccount.com"
-      experiments {
-        key: "luci.recipes.use_python3"
-        value: 100
-      }
-    }
-    builders {
-      name: "fugu-debug"
-      swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "device_type:fugu"
-      dimensions: "os:Android"
-      dimensions: "pool:luci.art.ci"
-      recipe {
-        name: "art"
-        cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
-        cipd_version: "refs/heads/main"
-        properties_j: "builder_group:\"client.art\""
-      }
-      execution_timeout_secs: 108000
-      expiration_secs: 61200
-      caches {
-        name: "art"
-        path: "art"
-      }
-      build_numbers: YES
-      service_account: "art-ci-builder@chops-service-accounts.iam.gserviceaccount.com"
-      experiments {
-        key: "luci.recipes.use_python3"
-        value: 100
-      }
-    }
-    builders {
-      name: "fugu-ndebug"
-      swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "device_type:fugu"
-      dimensions: "os:Android"
-      dimensions: "pool:luci.art.ci"
-      recipe {
-        name: "art"
-        cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
-        cipd_version: "refs/heads/main"
-        properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:false"
+        properties_j: "device:\"bullhead-armv8\""
+        properties_j: "gcstress:true"
+        properties_j: "generational_cc:true"
+        properties_j: "product:\"armv8\""
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -298,7 +298,11 @@
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:32"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:false"
+        properties_j: "debug:true"
+        properties_j: "generational_cc:false"
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -322,7 +326,11 @@
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:32"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:true"
+        properties_j: "generational_cc:true"
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -346,7 +354,12 @@
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:32"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:true"
+        properties_j: "gcstress:true"
+        properties_j: "generational_cc:true"
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -370,7 +383,11 @@
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:32"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:false"
+        properties_j: "generational_cc:true"
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -394,7 +411,12 @@
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:32"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:true"
+        properties_j: "generational_cc:true"
+        properties_j: "heap_poisoning:true"
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -418,7 +440,13 @@
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:64"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "cdex_level:\"fast\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:true"
+        properties_j: "generational_cc:true"
+        properties_j: "use_props:true"
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -442,7 +470,11 @@
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:64"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:false"
+        properties_j: "debug:true"
+        properties_j: "generational_cc:false"
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -466,7 +498,11 @@
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:64"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:true"
+        properties_j: "generational_cc:true"
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -490,7 +526,11 @@
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:64"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:false"
+        properties_j: "generational_cc:true"
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -514,7 +554,11 @@
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:64"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:true"
+        properties_j: "generational_cc:false"
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -538,7 +582,106 @@
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:64"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:true"
+        properties_j: "generational_cc:true"
+        properties_j: "heap_poisoning:true"
+      }
+      execution_timeout_secs: 108000
+      expiration_secs: 61200
+      caches {
+        name: "art"
+        path: "art"
+      }
+      build_numbers: YES
+      service_account: "art-ci-builder@chops-service-accounts.iam.gserviceaccount.com"
+      experiments {
+        key: "luci.recipes.use_python3"
+        value: 100
+      }
+    }
+    builders {
+      name: "qemu-armv8-ndebug"
+      swarming_host: "chromium-swarm.appspot.com"
+      dimensions: "os:Linux"
+      dimensions: "pool:luci.art.ci"
+      recipe {
+        name: "art"
+        cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
+        cipd_version: "refs/heads/main"
+        properties_j: "bitness:64"
+        properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:false"
+        properties_j: "device:\"qemu-armv8\""
+        properties_j: "generational_cc:true"
+        properties_j: "on_virtual_machine:true"
+        properties_j: "product:\"armv8\""
+      }
+      execution_timeout_secs: 108000
+      expiration_secs: 61200
+      caches {
+        name: "art"
+        path: "art"
+      }
+      build_numbers: YES
+      service_account: "art-ci-builder@chops-service-accounts.iam.gserviceaccount.com"
+      experiments {
+        key: "luci.recipes.use_python3"
+        value: 100
+      }
+    }
+    builders {
+      name: "qemu-riscv64-ndebug"
+      swarming_host: "chromium-swarm.appspot.com"
+      dimensions: "os:Linux"
+      dimensions: "pool:luci.art.ci"
+      recipe {
+        name: "art"
+        cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
+        cipd_version: "refs/heads/main"
+        properties_j: "bitness:64"
+        properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:false"
+        properties_j: "device:\"qemu-riscv64\""
+        properties_j: "generational_cc:true"
+        properties_j: "on_virtual_machine:true"
+        properties_j: "product:\"riscv64\""
+      }
+      execution_timeout_secs: 108000
+      expiration_secs: 61200
+      caches {
+        name: "art"
+        path: "art"
+      }
+      build_numbers: YES
+      service_account: "art-ci-builder@chops-service-accounts.iam.gserviceaccount.com"
+      experiments {
+        key: "luci.recipes.use_python3"
+        value: 100
+      }
+    }
+    builders {
+      name: "qemu-riscv64-ndebug-build_only"
+      swarming_host: "chromium-swarm.appspot.com"
+      dimensions: "os:Linux"
+      dimensions: "pool:luci.art.ci"
+      recipe {
+        name: "art"
+        cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
+        cipd_version: "refs/heads/main"
+        properties_j: "bitness:64"
+        properties_j: "build_only:true"
+        properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:false"
+        properties_j: "device:\"qemu-riscv64\""
+        properties_j: "generational_cc:true"
+        properties_j: "on_virtual_machine:true"
+        properties_j: "product:\"riscv64\""
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -556,14 +699,20 @@
     builders {
       name: "walleye-armv7-poison-debug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "device_type:bonito|oriole|walleye"
       dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:32"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:true"
+        properties_j: "device:\"walleye-armv7\""
+        properties_j: "generational_cc:true"
+        properties_j: "heap_poisoning:true"
+        properties_j: "product:\"arm_krait\""
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -581,14 +730,20 @@
     builders {
       name: "walleye-armv8-poison-debug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "device_type:bonito|oriole|walleye"
       dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:64"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:true"
+        properties_j: "device:\"walleye-armv8\""
+        properties_j: "generational_cc:true"
+        properties_j: "heap_poisoning:true"
+        properties_j: "product:\"armv8\""
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
@@ -606,14 +761,20 @@
     builders {
       name: "walleye-armv8-poison-ndebug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "device_type:bonito|oriole|walleye"
       dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
         cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
         cipd_version: "refs/heads/main"
+        properties_j: "bitness:64"
         properties_j: "builder_group:\"client.art\""
+        properties_j: "concurrent_collector:true"
+        properties_j: "debug:false"
+        properties_j: "device:\"walleye-armv8\""
+        properties_j: "generational_cc:true"
+        properties_j: "heap_poisoning:true"
+        properties_j: "product:\"armv8\""
       }
       execution_timeout_secs: 108000
       expiration_secs: 61200
diff --git a/tools/luci/config/generated/luci-logdog.cfg b/tools/luci/config/generated/luci-logdog.cfg
index adc75be..01a3912 100644
--- a/tools/luci/config/generated/luci-logdog.cfg
+++ b/tools/luci/config/generated/luci-logdog.cfg
@@ -2,7 +2,7 @@
 # Do not modify manually.
 #
 # For the schema of this file, see ProjectConfig message:
-#   https://luci-config.appspot.com/schemas/projects:luci-logdog.cfg
+#   https://config.luci.app/schemas/projects:luci-logdog.cfg
 
 reader_auth_groups: "all"
 writer_auth_groups: "luci-logdog-chromium-writers"
diff --git a/tools/luci/config/generated/luci-milo.cfg b/tools/luci/config/generated/luci-milo.cfg
index 0ca098a..979a5d1 100644
--- a/tools/luci/config/generated/luci-milo.cfg
+++ b/tools/luci/config/generated/luci-milo.cfg
@@ -2,7 +2,7 @@
 # Do not modify manually.
 #
 # For the schema of this file, see Project message:
-#   https://luci-config.appspot.com/schemas/projects:luci-milo.cfg
+#   https://config.luci.app/schemas/projects:luci-milo.cfg
 
 consoles {
   id: "luci"
@@ -56,13 +56,18 @@
     short_name: "ndbg"
   }
   builders {
-    name: "buildbucket/luci.art.ci/fugu-debug"
-    category: "fugu"
+    name: "buildbucket/luci.art.ci/walleye-armv7-poison-debug"
+    category: "walleye|armv7|poison"
     short_name: "dbg"
   }
   builders {
-    name: "buildbucket/luci.art.ci/fugu-ndebug"
-    category: "fugu"
+    name: "buildbucket/luci.art.ci/walleye-armv8-poison-debug"
+    category: "walleye|armv8|poison"
+    short_name: "dbg"
+  }
+  builders {
+    name: "buildbucket/luci.art.ci/walleye-armv8-poison-ndebug"
+    category: "walleye|armv8|poison"
     short_name: "ndbg"
   }
   builders {
@@ -121,19 +126,9 @@
     short_name: "psn"
   }
   builders {
-    name: "buildbucket/luci.art.ci/walleye-armv7-poison-debug"
-    category: "walleye|armv7|poison"
-    short_name: "dbg"
-  }
-  builders {
-    name: "buildbucket/luci.art.ci/walleye-armv8-poison-debug"
-    category: "walleye|armv8|poison"
-    short_name: "dbg"
-  }
-  builders {
-    name: "buildbucket/luci.art.ci/walleye-armv8-poison-ndebug"
-    category: "walleye|armv8|poison"
-    short_name: "ndbg"
+    name: "buildbucket/luci.art.ci/qemu-riscv64-ndebug-build_only"
+    category: "qemu|riscv64"
+    short_name: "bo"
   }
   include_experimental_builds: true
 }
diff --git a/tools/luci/config/generated/luci-notify.cfg b/tools/luci/config/generated/luci-notify.cfg
index c509926..a281a82 100644
--- a/tools/luci/config/generated/luci-notify.cfg
+++ b/tools/luci/config/generated/luci-notify.cfg
@@ -2,7 +2,7 @@
 # Do not modify manually.
 #
 # For the schema of this file, see ProjectConfig message:
-#   https://luci-config.appspot.com/schemas/projects:luci-notify.cfg
+#   https://config.luci.app/schemas/projects:luci-notify.cfg
 
 notifiers {
   notifications {
@@ -131,32 +131,6 @@
   }
   builders {
     bucket: "ci"
-    name: "fugu-debug"
-  }
-}
-notifiers {
-  notifications {
-    on_new_status: FAILURE
-    on_new_status: INFRA_FAILURE
-    email {
-      recipients: "art-team+chromium-buildbot@google.com"
-    }
-  }
-  builders {
-    bucket: "ci"
-    name: "fugu-ndebug"
-  }
-}
-notifiers {
-  notifications {
-    on_new_status: FAILURE
-    on_new_status: INFRA_FAILURE
-    email {
-      recipients: "art-team+chromium-buildbot@google.com"
-    }
-  }
-  builders {
-    bucket: "ci"
     name: "host-x86-cms"
   }
 }
@@ -300,6 +274,45 @@
   }
   builders {
     bucket: "ci"
+    name: "qemu-armv8-ndebug"
+  }
+}
+notifiers {
+  notifications {
+    on_new_status: FAILURE
+    on_new_status: INFRA_FAILURE
+    email {
+      recipients: "art-team+chromium-buildbot@google.com"
+    }
+  }
+  builders {
+    bucket: "ci"
+    name: "qemu-riscv64-ndebug"
+  }
+}
+notifiers {
+  notifications {
+    on_new_status: FAILURE
+    on_new_status: INFRA_FAILURE
+    email {
+      recipients: "art-team+chromium-buildbot@google.com"
+    }
+  }
+  builders {
+    bucket: "ci"
+    name: "qemu-riscv64-ndebug-build_only"
+  }
+}
+notifiers {
+  notifications {
+    on_new_status: FAILURE
+    on_new_status: INFRA_FAILURE
+    email {
+      recipients: "art-team+chromium-buildbot@google.com"
+    }
+  }
+  builders {
+    bucket: "ci"
     name: "walleye-armv7-poison-debug"
   }
 }
diff --git a/tools/luci/config/generated/luci-scheduler.cfg b/tools/luci/config/generated/luci-scheduler.cfg
index ba7bcee..4794473 100644
--- a/tools/luci/config/generated/luci-scheduler.cfg
+++ b/tools/luci/config/generated/luci-scheduler.cfg
@@ -2,7 +2,7 @@
 # Do not modify manually.
 #
 # For the schema of this file, see ProjectConfig message:
-#   https://luci-config.appspot.com/schemas/projects:luci-scheduler.cfg
+#   https://config.luci.app/schemas/projects:luci-scheduler.cfg
 
 job {
   id: "angler-armv7-debug"
@@ -95,26 +95,6 @@
   }
 }
 job {
-  id: "fugu-debug"
-  realm: "ci"
-  acl_sets: "ci"
-  buildbucket {
-    server: "cr-buildbucket.appspot.com"
-    bucket: "ci"
-    builder: "fugu-debug"
-  }
-}
-job {
-  id: "fugu-ndebug"
-  realm: "ci"
-  acl_sets: "ci"
-  buildbucket {
-    server: "cr-buildbucket.appspot.com"
-    bucket: "ci"
-    builder: "fugu-ndebug"
-  }
-}
-job {
   id: "host-x86-cms"
   realm: "ci"
   acl_sets: "ci"
@@ -225,6 +205,36 @@
   }
 }
 job {
+  id: "qemu-armv8-ndebug"
+  realm: "ci"
+  acl_sets: "ci"
+  buildbucket {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "ci"
+    builder: "qemu-armv8-ndebug"
+  }
+}
+job {
+  id: "qemu-riscv64-ndebug"
+  realm: "ci"
+  acl_sets: "ci"
+  buildbucket {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "ci"
+    builder: "qemu-riscv64-ndebug"
+  }
+}
+job {
+  id: "qemu-riscv64-ndebug-build_only"
+  realm: "ci"
+  acl_sets: "ci"
+  buildbucket {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "ci"
+    builder: "qemu-riscv64-ndebug-build_only"
+  }
+}
+job {
   id: "walleye-armv7-poison-debug"
   realm: "ci"
   acl_sets: "ci"
@@ -267,8 +277,6 @@
   triggers: "bullhead-armv7-gcstress-ndebug"
   triggers: "bullhead-armv8-gcstress-debug"
   triggers: "bullhead-armv8-gcstress-ndebug"
-  triggers: "fugu-debug"
-  triggers: "fugu-ndebug"
   triggers: "host-x86-cms"
   triggers: "host-x86-debug"
   triggers: "host-x86-gcstress-debug"
@@ -280,6 +288,9 @@
   triggers: "host-x86_64-ndebug"
   triggers: "host-x86_64-non-gen-cc"
   triggers: "host-x86_64-poison-debug"
+  triggers: "qemu-armv8-ndebug"
+  triggers: "qemu-riscv64-ndebug"
+  triggers: "qemu-riscv64-ndebug-build_only"
   triggers: "walleye-armv7-poison-debug"
   triggers: "walleye-armv8-poison-debug"
   triggers: "walleye-armv8-poison-ndebug"
@@ -301,8 +312,6 @@
   triggers: "bullhead-armv7-gcstress-ndebug"
   triggers: "bullhead-armv8-gcstress-debug"
   triggers: "bullhead-armv8-gcstress-ndebug"
-  triggers: "fugu-debug"
-  triggers: "fugu-ndebug"
   triggers: "host-x86-cms"
   triggers: "host-x86-debug"
   triggers: "host-x86-gcstress-debug"
@@ -314,6 +323,9 @@
   triggers: "host-x86_64-ndebug"
   triggers: "host-x86_64-non-gen-cc"
   triggers: "host-x86_64-poison-debug"
+  triggers: "qemu-armv8-ndebug"
+  triggers: "qemu-riscv64-ndebug"
+  triggers: "qemu-riscv64-ndebug-build_only"
   triggers: "walleye-armv7-poison-debug"
   triggers: "walleye-armv8-poison-debug"
   triggers: "walleye-armv8-poison-ndebug"
@@ -335,8 +347,6 @@
   triggers: "bullhead-armv7-gcstress-ndebug"
   triggers: "bullhead-armv8-gcstress-debug"
   triggers: "bullhead-armv8-gcstress-ndebug"
-  triggers: "fugu-debug"
-  triggers: "fugu-ndebug"
   triggers: "host-x86-cms"
   triggers: "host-x86-debug"
   triggers: "host-x86-gcstress-debug"
@@ -348,6 +358,9 @@
   triggers: "host-x86_64-ndebug"
   triggers: "host-x86_64-non-gen-cc"
   triggers: "host-x86_64-poison-debug"
+  triggers: "qemu-armv8-ndebug"
+  triggers: "qemu-riscv64-ndebug"
+  triggers: "qemu-riscv64-ndebug-build_only"
   triggers: "walleye-armv7-poison-debug"
   triggers: "walleye-armv8-poison-debug"
   triggers: "walleye-armv8-poison-ndebug"
@@ -369,8 +382,6 @@
   triggers: "bullhead-armv7-gcstress-ndebug"
   triggers: "bullhead-armv8-gcstress-debug"
   triggers: "bullhead-armv8-gcstress-ndebug"
-  triggers: "fugu-debug"
-  triggers: "fugu-ndebug"
   triggers: "host-x86-cms"
   triggers: "host-x86-debug"
   triggers: "host-x86-gcstress-debug"
@@ -382,6 +393,9 @@
   triggers: "host-x86_64-ndebug"
   triggers: "host-x86_64-non-gen-cc"
   triggers: "host-x86_64-poison-debug"
+  triggers: "qemu-armv8-ndebug"
+  triggers: "qemu-riscv64-ndebug"
+  triggers: "qemu-riscv64-ndebug-build_only"
   triggers: "walleye-armv7-poison-debug"
   triggers: "walleye-armv8-poison-debug"
   triggers: "walleye-armv8-poison-ndebug"
diff --git a/tools/luci/config/generated/project.cfg b/tools/luci/config/generated/project.cfg
index f9f7877..d517637 100644
--- a/tools/luci/config/generated/project.cfg
+++ b/tools/luci/config/generated/project.cfg
@@ -2,12 +2,12 @@
 # Do not modify manually.
 #
 # For the schema of this file, see ProjectCfg message:
-#   https://luci-config.appspot.com/schemas/projects:project.cfg
+#   https://config.luci.app/schemas/projects:project.cfg
 
 name: "art"
 access: "group:all"
 lucicfg {
-  version: "1.33.7"
+  version: "1.43.4"
   package_dir: ".."
   config_dir: "generated"
   entry_point: "main.star"
diff --git a/tools/luci/config/generated/realms.cfg b/tools/luci/config/generated/realms.cfg
index 777f868..c453176 100644
--- a/tools/luci/config/generated/realms.cfg
+++ b/tools/luci/config/generated/realms.cfg
@@ -2,7 +2,7 @@
 # Do not modify manually.
 #
 # For the schema of this file, see RealmsCfg message:
-#   https://luci-config.appspot.com/schemas/projects:realms.cfg
+#   https://config.luci.app/schemas/projects:realms.cfg
 
 realms {
   name: "@root"
diff --git a/tools/luci/config/main.star b/tools/luci/config/main.star
index b1ecde1..dd7acab 100755
--- a/tools/luci/config/main.star
+++ b/tools/luci/config/main.star
@@ -154,7 +154,15 @@
     refs = ["refs/heads/master-art"],
 )
 
-def ci_builder(name, category, short_name, dimensions):
+def ci_builder(name, category, short_name, dimensions, properties={}, is_fyi=False):
+    default_properties = {
+        "builder_group": "client.art",
+        "concurrent_collector": True,
+        "generational_cc": True,
+    }
+
+    default_properties = default_properties | properties
+
     luci.builder(
         name = name,
         bucket = "ci",
@@ -176,9 +184,7 @@
         expiration_timeout = 17 * time.hour,
         execution_timeout = 30 * time.hour,
         build_numbers = True,
-        properties = {
-            "builder_group": "client.art",
-        },
+        properties = default_properties,
         caches = [
             # Directory called "art" that persists from build to build (one per bot).
             # We can checkout and build in this directory to get fast incremental builds.
@@ -192,44 +198,338 @@
             "vogar",
         ],
     )
-    luci.console_view_entry(
-        console_view = "luci",
-        builder = name,
-        category = category,
-        short_name = short_name,
+    if not is_fyi:
+        luci.console_view_entry(
+            console_view = "luci",
+            builder = name,
+            category = category,
+            short_name = short_name,
+        )
+
+def target_builders():
+    target_dims = {"os": "Android"}
+    # userfault-GC configurations must be run on Pixel 6.
+    userfault_gc_target_dims = target_dims | {"device_type": "oriole"}
+
+    ci_builder(
+        name="angler-armv7-debug",
+        category="angler|armv7",
+        short_name="dbg",
+        dimensions=target_dims,
+        properties={
+            "bitness": 32,
+            "device": "angler-armv7",
+            "debug": True,
+            "product": "arm_krait",
+        }
+    )
+    ci_builder(
+        name="angler-armv7-non-gen-cc",
+        category="angler|armv7",
+        short_name="ngen",
+        dimensions=userfault_gc_target_dims,
+        properties={
+            "bitness": 32,
+            "device": "angler-armv7",
+            "debug": True,
+            "concurrent_collector": False,
+            "generational_cc": False,
+            "product": "arm_krait",
+        }
+    )
+    ci_builder(
+        name="angler-armv7-ndebug",
+        category="angler|armv7",
+        short_name="ndbg",
+        dimensions=target_dims,
+        properties={
+            "bitness": 32,
+            "device": "angler-armv7",
+            "debug": False,
+            "product": "arm_krait",
+        }
+    )
+    ci_builder(
+        name="angler-armv8-debug",
+        category="angler|armv8",
+        short_name="dbg",
+        dimensions=target_dims,
+        properties={
+            "bitness": 64,
+            "device": "angler-armv8",
+            "debug": True,
+            "product": "armv8",
+        }
+    )
+    ci_builder(
+        name="angler-armv8-non-gen-cc",
+        category="angler|armv8",
+        short_name="ngen",
+        dimensions=userfault_gc_target_dims,
+        properties={
+            "bitness": 64,
+            "device": "angler-armv8",
+            "debug": True,
+            "concurrent_collector": False,
+            "generational_cc": False,
+            "product": "armv8",
+        }
+    )
+    ci_builder(
+        name="angler-armv8-ndebug",
+        category="angler|armv8",
+        short_name="ndbg",
+        dimensions=target_dims,
+        properties={
+            "bitness": 64,
+            "device": "angler-armv8",
+            "debug": False,
+            "product": "armv8",
+        }
+    )
+    ci_builder(
+        name="bullhead-armv7-gcstress-ndebug",
+        category="bullhead|armv7|gcstress",
+        short_name="dbg",
+        dimensions=target_dims,
+        properties={
+            "bitness": 32,
+            "device": "bullhead-armv7",
+            "debug": False,
+            "gcstress": True,
+            "product": "arm_krait",
+        }
+    )
+    ci_builder(
+        name="bullhead-armv8-gcstress-debug",
+        category="bullhead|armv8|gcstress",
+        short_name="dbg",
+        dimensions=target_dims,
+        properties={
+            "bitness": 64,
+            "device": "bullhead-armv8",
+            "debug": True,
+            "gcstress": True,
+            "product": "armv8",
+        }
+    )
+    ci_builder(
+        name="bullhead-armv8-gcstress-ndebug",
+        category="bullhead|armv8|gcstress",
+        short_name="ndbg",
+        dimensions=target_dims,
+        properties={
+            "bitness": 64,
+            "device": "bullhead-armv8",
+            "debug": False,
+            "gcstress": True,
+            "product": "armv8",
+        }
+    )
+    ci_builder(
+        name="walleye-armv7-poison-debug",
+        category="walleye|armv7|poison",
+        short_name="dbg",
+        dimensions=target_dims,
+        properties={
+            "bitness": 32,
+            "device": "walleye-armv7",
+            "debug": True,
+            "heap_poisoning": True,
+            "product": "arm_krait",
+        }
+    )
+    ci_builder(
+        name="walleye-armv8-poison-debug",
+        category="walleye|armv8|poison",
+        short_name="dbg",
+        dimensions=target_dims,
+        properties={
+            "bitness": 64,
+            "device": "walleye-armv8",
+            "debug": True,
+            "heap_poisoning": True,
+            "product": "armv8",
+        }
+    )
+    ci_builder(
+        name="walleye-armv8-poison-ndebug",
+        category="walleye|armv8|poison",
+        short_name="ndbg",
+        dimensions=target_dims,
+        properties={
+            "bitness": 64,
+            "device": "walleye-armv8",
+            "debug": False,
+            "heap_poisoning": True,
+            "product": "armv8",
+        }
     )
 
-# Dimensions specify which bots we can run on.
-host_dims = {"os": "Linux"}
-target_dims = {"os": "Android"}
-arm_target_dims = target_dims | {"device_type": "bonito|oriole|walleye"}
-x86_target_dims = target_dims | {"device_type": "fugu"}
+def host_builders():
+    host_dims = {"os": "Linux"}
+    ci_builder(
+        name="host-x86-cms",
+        category="host|x86",
+        short_name="cms",
+        dimensions=host_dims,
+        properties={
+            "debug": True,
+            "bitness": 32,
+            "concurrent_collector": False,
+            "generational_cc": False,
+        }
+    )
+    ci_builder(
+        name="host-x86-debug",
+        category="host|x86",
+        short_name="dbg",
+        dimensions=host_dims,
+        properties={
+            "debug": True,
+            "bitness": 32,
+        }
+    )
+    ci_builder(
+        name="host-x86-ndebug",
+        category="host|x86",
+        short_name="ndbg",
+        dimensions=host_dims,
+        properties={
+            "debug": False,
+            "bitness": 32,
+        }
+    )
+    ci_builder(
+        name="host-x86-gcstress-debug",
+        category="host|x86",
+        short_name="gcs",
+        dimensions=host_dims,
+        properties={
+            "debug": True,
+            "gcstress": True,
+            "bitness": 32,
+        }
+    )
+    ci_builder(
+        name="host-x86-poison-debug",
+        category="host|x86",
+        short_name="psn",
+        dimensions=host_dims,
+        properties={
+            "bitness": 32,
+            "debug": True,
+            "heap_poisoning": True,
+        }
+    )
+    ci_builder(
+        name="host-x86_64-cdex-fast",
+        category="host|x64",
+        short_name="cdx",
+        dimensions=host_dims,
+        properties={
+            "use_props": True,
+            "bitness": 64,
+            "cdex_level": "fast",
+            "debug": True,
+        }
+    )
+    ci_builder(
+        name="host-x86_64-cms",
+        category="host|x64",
+        short_name="cms",
+        dimensions=host_dims,
+        properties={
+            "bitness": 64,
+            "concurrent_collector": False,
+            "debug": True,
+            "generational_cc": False,
+        }
+    )
+    ci_builder(
+        name="host-x86_64-debug",
+        category="host|x64",
+        short_name="dbg",
+        dimensions=host_dims,
+        properties={
+            "bitness": 64,
+            "debug": True,
+        }
+    )
+    ci_builder(
+        name="host-x86_64-non-gen-cc",
+        category="host|x64",
+        short_name="ngen",
+        dimensions=host_dims,
+        properties={
+            "bitness": 64,
+            "debug": True,
+            "generational_cc": False,
+        }
+    )
+    ci_builder(
+        name="host-x86_64-ndebug",
+        category="host|x64",
+        short_name="ndbg",
+        dimensions=host_dims,
+        properties={
+            "bitness": 64,
+            "debug": False,
+        }
+    )
+    ci_builder(
+        name="host-x86_64-poison-debug",
+        category="host|x64",
+        short_name="psn",
+        dimensions=host_dims,
+        properties={
+            "bitness": 64,
+            "debug": True,
+            "heap_poisoning": True,
+        }
+    )
+    ci_builder(
+        name="qemu-armv8-ndebug",
+        category="qemu|armv8",
+        short_name="ndbg",
+        dimensions=host_dims,
+        is_fyi=True,
+        properties={
+            "bitness": 64,
+            "debug": False,
+            "device": "qemu-armv8",
+            "on_virtual_machine": True,
+            "product": "armv8",
+        }
+    )
+    ci_builder(
+        name="qemu-riscv64-ndebug",
+        category="qemu|riscv64",
+        short_name="ndbg",
+        dimensions=host_dims,
+        is_fyi=True,
+        properties={
+            "bitness": 64,
+            "debug": False,
+            "device": "qemu-riscv64",
+            "on_virtual_machine": True,
+            "product": "riscv64",
+        }
+    )
+    ci_builder(
+        name="qemu-riscv64-ndebug-build_only",
+        category="qemu|riscv64",
+        short_name="bo",
+        dimensions=host_dims,
+        properties={
+            "bitness": 64,
+            "build_only": True,
+            "debug": False,
+            "device": "qemu-riscv64",
+            "on_virtual_machine": True,
+            "product": "riscv64",
+        }
+    )
 
-# userfault-GC configurations must be run on Pixel 6.
-userfault_gc_target_dims = target_dims | {"device_type": "oriole"}
-
-ci_builder("angler-armv7-debug", "angler|armv7", "dbg", arm_target_dims)
-ci_builder("angler-armv7-non-gen-cc", "angler|armv7", "ngen", userfault_gc_target_dims)
-ci_builder("angler-armv7-ndebug", "angler|armv7", "ndbg", arm_target_dims)
-ci_builder("angler-armv8-debug", "angler|armv8", "dbg", arm_target_dims)
-ci_builder("angler-armv8-non-gen-cc", "angler|armv8", "ngen", userfault_gc_target_dims)
-ci_builder("angler-armv8-ndebug", "angler|armv8", "ndbg", arm_target_dims)
-ci_builder("bullhead-armv7-gcstress-ndebug", "bullhead|armv7|gcstress", "dbg", arm_target_dims)
-ci_builder("bullhead-armv8-gcstress-debug", "bullhead|armv8|gcstress", "dbg", arm_target_dims)
-ci_builder("bullhead-armv8-gcstress-ndebug", "bullhead|armv8|gcstress", "ndbg", arm_target_dims)
-ci_builder("fugu-debug", "fugu", "dbg", x86_target_dims)
-ci_builder("fugu-ndebug", "fugu", "ndbg", x86_target_dims)
-ci_builder("host-x86-cms", "host|x86", "cms", host_dims)
-ci_builder("host-x86-debug", "host|x86", "dbg", host_dims)
-ci_builder("host-x86-ndebug", "host|x86", "ndbg", host_dims)
-ci_builder("host-x86-gcstress-debug", "host|x86", "gcs", host_dims)
-ci_builder("host-x86-poison-debug", "host|x86", "psn", host_dims)
-ci_builder("host-x86_64-cdex-fast", "host|x64", "cdx", host_dims)
-ci_builder("host-x86_64-cms", "host|x64", "cms", host_dims)
-ci_builder("host-x86_64-debug", "host|x64", "dbg", host_dims)
-ci_builder("host-x86_64-non-gen-cc", "host|x64", "ngen", host_dims)
-ci_builder("host-x86_64-ndebug", "host|x64", "ndbg", host_dims)
-ci_builder("host-x86_64-poison-debug", "host|x64", "psn", host_dims)
-ci_builder("walleye-armv7-poison-debug", "walleye|armv7|poison", "dbg", arm_target_dims)
-ci_builder("walleye-armv8-poison-debug", "walleye|armv8|poison", "dbg", arm_target_dims)
-ci_builder("walleye-armv8-poison-ndebug", "walleye|armv8|poison", "ndbg", arm_target_dims)
+target_builders()
+host_builders()
\ No newline at end of file
diff --git a/tools/run-gtests.sh b/tools/run-gtests.sh
index da61c7e..99ac8df 100755
--- a/tools/run-gtests.sh
+++ b/tools/run-gtests.sh
@@ -61,7 +61,7 @@
 
 run_in_chroot() {
   if [ -n "$ART_TEST_ON_VM" ]; then
-    $ART_SSH_CMD $ART_CHROOT_CMD $@
+    $ART_SSH_CMD $ART_CHROOT_CMD env ANDROID_ROOT=/system $@
   else
     "$adb" shell chroot "$ART_TEST_CHROOT" $@
   fi
diff --git a/tools/run-jdwp-tests.sh b/tools/run-jdwp-tests.sh
index fec969c..699a2e5 100755
--- a/tools/run-jdwp-tests.sh
+++ b/tools/run-jdwp-tests.sh
@@ -386,9 +386,9 @@
 
 if [[ $mode != "ri" ]]; then
   # Because we're running debuggable, we discard any AOT code.
-  # Therefore we run de2oat with 'quicken' to avoid spending time compiling.
-  vm_args="$vm_args --vm-arg -Xcompiler-option --vm-arg --compiler-filter=quicken"
-  debuggee_args="$debuggee_args -Xcompiler-option --compiler-filter=quicken"
+  # Therefore we run dex2oat with 'verify' to avoid spending time compiling.
+  vm_args="$vm_args --vm-arg -Xcompiler-option --vm-arg --compiler-filter=verify"
+  debuggee_args="$debuggee_args -Xcompiler-option --compiler-filter=verify"
 
   if $instant_jit; then
     debuggee_args="$debuggee_args -Xjitthreshold:0"
diff --git a/tools/run-libcore-tests.py b/tools/run-libcore-tests.py
index c6958f1..244f912 100755
--- a/tools/run-libcore-tests.py
+++ b/tools/run-libcore-tests.py
@@ -264,6 +264,8 @@
   "test.java.lang.StrictMath.HypotTests#testAgainstTranslit_shard4",
   "test.java.math.BigDecimal",
   "test.java.math.BigInteger#testConstructor",
+  "test.java.util.TestFormatter",
+  "test.java.util.Collection",
 }
 
 DISABLED_FUGU_TESTS = {
@@ -446,7 +448,7 @@
     cmd.append("--timeout {}".format(get_timeout_secs()))
     cmd.append("--toolchain d8 --language CUR")
     if args.jit:
-      cmd.append("--vm-arg -Xcompiler-option --vm-arg --compiler-filter=quicken")
+      cmd.append("--vm-arg -Xcompiler-option --vm-arg --compiler-filter=verify")
     cmd.append("--vm-arg -Xusejit:{}".format(str(args.jit).lower()))
 
   if args.verbose:
@@ -459,6 +461,14 @@
   cmd.extend("--expectations " + f for f in get_expected_failures())
   cmd.extend("--classpath " + get_jar_filename(cp) for cp in CLASSPATH)
   cmd.append(test_name)
+
+  # vogar target options
+  if not os.path.exists('frameworks/base'):
+    cmd.append("--")
+    # Skip @NonMts test in thin manifest which uses prebuilt Conscrypt and ICU.
+    # It's similar to running libcore tests on the older platforms.
+    # @NonMts means that the test doesn't pass on a older platform version.
+    cmd.append("--exclude-filter libcore.test.annotation.NonMts")
   return cmd
 
 def get_target_cpu_count():
diff --git a/tools/run-libjdwp-tests.sh b/tools/run-libjdwp-tests.sh
index 06e34f9..bb9c300 100755
--- a/tools/run-libjdwp-tests.sh
+++ b/tools/run-libjdwp-tests.sh
@@ -43,6 +43,7 @@
 has_gcstress="no"
 has_timeout="no"
 has_verbose="no"
+has_jdwp_path="no"
 # The bitmap of log messages in libjdwp. See list in the help message for more
 # info on what these are. The default is 'errors | callbacks'
 verbose_level=0xC0
@@ -91,6 +92,9 @@
   elif [[ $1 == *gcstress ]]; then
     has_gcstress="yes"
     shift
+  elif [[ $1 == --jdwp-path* ]]; then
+    has_jdwp_path="yes"
+    shift
   elif [[ "$1" == "" ]]; then
     break
   else
@@ -103,10 +107,23 @@
   args+=(--mode=device)
 fi
 
-if [[ "$has_variant" = "no" ]];  then
+if [[ "$has_variant" = "no" && "$mode" != "ri" ]];  then
+  # --mode=jvm doesn't support variant option.
   args+=(--variant=X32)
 fi
 
+if [[ "$has_jdwp_path" = "no" ]]; then
+  if [[ "$mode" == "ri" ]]; then
+    if [ -z "$ANDROID_BUILD_TOP" ]; then
+      echo "Please set ANDROID_BUILD_TOP"
+      exit 1
+    fi
+    args+=(--jdwp-path  $ANDROID_BUILD_TOP/"prebuilts/jdk/jdk17/linux-x86/lib/libjdwp.so")
+  else
+    args+=(--jdwp-path  "libjdwp.so")
+  fi
+fi
+
 if [[ "$has_timeout" = "no" ]]; then
   # Double the timeout to 20 seconds
   args+=(--test-timeout-ms)
@@ -124,12 +141,14 @@
   args+=(-Djpda.settings.debuggeeAgentExtraOptions=directlog=y,logfile=/proc/self/fd/2,logflags=$verbose_level)
 fi
 
-# We don't use full paths since it is difficult to determine them for device
-# tests and not needed due to resolution rules of dlopen.
-if [[ "$debug" = "yes" ]]; then
-  args+=(-Xplugin:libopenjdkjvmtid.so)
-else
-  args+=(-Xplugin:libopenjdkjvmti.so)
+if [[ "$mode" != "ri" ]]; then
+  # We don't use full paths since it is difficult to determine them for device
+  # tests and not needed due to resolution rules of dlopen.
+  if [[ "$debug" = "yes" ]]; then
+    args+=(-Xplugin:libopenjdkjvmtid.so)
+  else
+    args+=(-Xplugin:libopenjdkjvmti.so)
+  fi
 fi
 
 expectations="--expectations $PWD/art/tools/external_oj_libjdwp_art_failures.txt"
@@ -156,7 +175,6 @@
 
 verbose_run ./art/tools/run-jdwp-tests.sh \
             "${args[@]}"                  \
-            --jdwp-path "libjdwp.so"      \
             --vm-arg -Djpda.settings.debuggeeAgentExtraOptions=coredump=y \
             --vm-arg -Djpda.settings.testSuiteType=libjdwp \
             "$expectations"
diff --git a/tools/signal_dumper/signal_dumper.cc b/tools/signal_dumper/signal_dumper.cc
index bedb8dc..ebbe6ad 100644
--- a/tools/signal_dumper/signal_dumper.cc
+++ b/tools/signal_dumper/signal_dumper.cc
@@ -657,7 +657,7 @@
 }  // namespace
 }  // namespace art
 
-int main(int argc ATTRIBUTE_UNUSED, char** argv) {
+int main([[maybe_unused]] int argc, char** argv) {
   android::base::InitLogging(argv);
 
   int signal = SIGRTMIN + 2;
diff --git a/tools/tracefast-plugin/tracefast.cc b/tools/tracefast-plugin/tracefast.cc
index abc871d..c9c135a 100644
--- a/tools/tracefast-plugin/tracefast.cc
+++ b/tools/tracefast-plugin/tracefast.cc
@@ -43,73 +43,73 @@
  public:
   Tracer() {}
 
-  void MethodEntered(art::Thread* thread ATTRIBUTE_UNUSED,
-                     art::ArtMethod* method ATTRIBUTE_UNUSED) override
+  void MethodEntered([[maybe_unused]] art::Thread* thread,
+                     [[maybe_unused]] art::ArtMethod* method) override
       REQUIRES_SHARED(art::Locks::mutator_lock_) {}
 
-  void MethodExited(art::Thread* thread ATTRIBUTE_UNUSED,
-                    art::ArtMethod* method ATTRIBUTE_UNUSED,
-                    art::instrumentation::OptionalFrame frame ATTRIBUTE_UNUSED,
-                    art::MutableHandle<art::mirror::Object>& return_value ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(art::Locks::mutator_lock_) { }
+  void MethodExited([[maybe_unused]] art::Thread* thread,
+                    [[maybe_unused]] art::ArtMethod* method,
+                    [[maybe_unused]] art::instrumentation::OptionalFrame frame,
+                    [[maybe_unused]] art::MutableHandle<art::mirror::Object>& return_value) override
+      REQUIRES_SHARED(art::Locks::mutator_lock_) {}
 
-  void MethodExited(art::Thread* thread ATTRIBUTE_UNUSED,
-                    art::ArtMethod* method ATTRIBUTE_UNUSED,
-                    art::instrumentation::OptionalFrame frame ATTRIBUTE_UNUSED,
-                    art::JValue& return_value ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(art::Locks::mutator_lock_) { }
+  void MethodExited([[maybe_unused]] art::Thread* thread,
+                    [[maybe_unused]] art::ArtMethod* method,
+                    [[maybe_unused]] art::instrumentation::OptionalFrame frame,
+                    [[maybe_unused]] art::JValue& return_value) override
+      REQUIRES_SHARED(art::Locks::mutator_lock_) {}
 
-  void MethodUnwind(art::Thread* thread ATTRIBUTE_UNUSED,
-                    art::ArtMethod* method ATTRIBUTE_UNUSED,
-                    uint32_t dex_pc ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(art::Locks::mutator_lock_) { }
+  void MethodUnwind([[maybe_unused]] art::Thread* thread,
+                    [[maybe_unused]] art::ArtMethod* method,
+                    [[maybe_unused]] uint32_t dex_pc) override
+      REQUIRES_SHARED(art::Locks::mutator_lock_) {}
 
-  void DexPcMoved(art::Thread* thread ATTRIBUTE_UNUSED,
-                  art::Handle<art::mirror::Object> this_object ATTRIBUTE_UNUSED,
-                  art::ArtMethod* method ATTRIBUTE_UNUSED,
-                  uint32_t new_dex_pc ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(art::Locks::mutator_lock_) { }
+  void DexPcMoved([[maybe_unused]] art::Thread* thread,
+                  [[maybe_unused]] art::Handle<art::mirror::Object> this_object,
+                  [[maybe_unused]] art::ArtMethod* method,
+                  [[maybe_unused]] uint32_t new_dex_pc) override
+      REQUIRES_SHARED(art::Locks::mutator_lock_) {}
 
-  void FieldRead(art::Thread* thread ATTRIBUTE_UNUSED,
-                 art::Handle<art::mirror::Object> this_object ATTRIBUTE_UNUSED,
-                 art::ArtMethod* method ATTRIBUTE_UNUSED,
-                 uint32_t dex_pc ATTRIBUTE_UNUSED,
-                 art::ArtField* field ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(art::Locks::mutator_lock_) { }
+  void FieldRead([[maybe_unused]] art::Thread* thread,
+                 [[maybe_unused]] art::Handle<art::mirror::Object> this_object,
+                 [[maybe_unused]] art::ArtMethod* method,
+                 [[maybe_unused]] uint32_t dex_pc,
+                 [[maybe_unused]] art::ArtField* field) override
+      REQUIRES_SHARED(art::Locks::mutator_lock_) {}
 
-  void FieldWritten(art::Thread* thread ATTRIBUTE_UNUSED,
-                    art::Handle<art::mirror::Object> this_object ATTRIBUTE_UNUSED,
-                    art::ArtMethod* method ATTRIBUTE_UNUSED,
-                    uint32_t dex_pc ATTRIBUTE_UNUSED,
-                    art::ArtField* field ATTRIBUTE_UNUSED,
-                    art::Handle<art::mirror::Object> field_value ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(art::Locks::mutator_lock_) { }
+  void FieldWritten([[maybe_unused]] art::Thread* thread,
+                    [[maybe_unused]] art::Handle<art::mirror::Object> this_object,
+                    [[maybe_unused]] art::ArtMethod* method,
+                    [[maybe_unused]] uint32_t dex_pc,
+                    [[maybe_unused]] art::ArtField* field,
+                    [[maybe_unused]] art::Handle<art::mirror::Object> field_value) override
+      REQUIRES_SHARED(art::Locks::mutator_lock_) {}
 
-  void FieldWritten(art::Thread* thread ATTRIBUTE_UNUSED,
-                    art::Handle<art::mirror::Object> this_object ATTRIBUTE_UNUSED,
-                    art::ArtMethod* method ATTRIBUTE_UNUSED,
-                    uint32_t dex_pc ATTRIBUTE_UNUSED,
-                    art::ArtField* field ATTRIBUTE_UNUSED,
-                    const art::JValue& field_value ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(art::Locks::mutator_lock_) { }
+  void FieldWritten([[maybe_unused]] art::Thread* thread,
+                    [[maybe_unused]] art::Handle<art::mirror::Object> this_object,
+                    [[maybe_unused]] art::ArtMethod* method,
+                    [[maybe_unused]] uint32_t dex_pc,
+                    [[maybe_unused]] art::ArtField* field,
+                    [[maybe_unused]] const art::JValue& field_value) override
+      REQUIRES_SHARED(art::Locks::mutator_lock_) {}
 
-  void ExceptionThrown(art::Thread* thread ATTRIBUTE_UNUSED,
-                       art::Handle<art::mirror::Throwable> exception_object ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(art::Locks::mutator_lock_) { }
+  void ExceptionThrown([[maybe_unused]] art::Thread* thread,
+                       [[maybe_unused]] art::Handle<art::mirror::Throwable> exception_object)
+      override REQUIRES_SHARED(art::Locks::mutator_lock_) {}
 
-  void ExceptionHandled(art::Thread* self ATTRIBUTE_UNUSED,
-                        art::Handle<art::mirror::Throwable> throwable ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(art::Locks::mutator_lock_) { }
+  void ExceptionHandled([[maybe_unused]] art::Thread* self,
+                        [[maybe_unused]] art::Handle<art::mirror::Throwable> throwable) override
+      REQUIRES_SHARED(art::Locks::mutator_lock_) {}
 
-  void Branch(art::Thread* thread ATTRIBUTE_UNUSED,
-              art::ArtMethod* method ATTRIBUTE_UNUSED,
-              uint32_t dex_pc ATTRIBUTE_UNUSED,
-              int32_t dex_pc_offset ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(art::Locks::mutator_lock_) { }
+  void Branch([[maybe_unused]] art::Thread* thread,
+              [[maybe_unused]] art::ArtMethod* method,
+              [[maybe_unused]] uint32_t dex_pc,
+              [[maybe_unused]] int32_t dex_pc_offset) override
+      REQUIRES_SHARED(art::Locks::mutator_lock_) {}
 
-  void WatchedFramePop(art::Thread* thread ATTRIBUTE_UNUSED,
-                       const art::ShadowFrame& frame ATTRIBUTE_UNUSED)
-      override REQUIRES_SHARED(art::Locks::mutator_lock_) { }
+  void WatchedFramePop([[maybe_unused]] art::Thread* thread,
+                       [[maybe_unused]] const art::ShadowFrame& frame) override
+      REQUIRES_SHARED(art::Locks::mutator_lock_) {}
 
  private:
   DISALLOW_COPY_AND_ASSIGN(Tracer);
diff --git a/tools/user-data.img b/tools/user-data.img
new file mode 100644
index 0000000..76a614c
--- /dev/null
+++ b/tools/user-data.img
Binary files differ
diff --git a/tools/veridex/Android.bp b/tools/veridex/Android.bp
index 7b120cf..ada2f6b 100644
--- a/tools/veridex/Android.bp
+++ b/tools/veridex/Android.bp
@@ -63,3 +63,99 @@
     src: "appcompat.sh",
     filename_from_src: true,
 }
+
+genrule {
+    name: "system_stub_dex_d8_input_jar",
+    srcs: [":system_android_jar"],
+    tools: ["zip2zip"],
+    out: ["system_stub_dex_d8_input.jar"],
+    cmd: "$(location zip2zip) " +
+        "-j -i $(in) " +
+        "-o $(out) \"**/*.class\" ",
+}
+
+genrule {
+    name: "system_stub_dex",
+    srcs: [
+        ":system_stub_dex_d8_input_jar",
+    ],
+    tools: [
+        "d8",
+    ],
+    out: [
+        "dex_dir/classes.dex",
+        "dex_dir/classes2.dex",
+    ],
+    cmd: "mkdir -p $(genDir)/dex_dir &&" +
+        "$(location d8) " +
+        "-JXmx4096M -JXX:+TieredCompilation -JXX:TieredStopAtLevel=1 " +
+        "-JDcom.android.tools.r8.emitRecordAnnotationsInDex " +
+        "-JDcom.android.tools.r8.emitPermittedSubclassesAnnotationsInDex " +
+        "-JXX:OnError=\"cat hs_err_pid%p.log\" " +
+        "-JXX:CICompilerCount=6 -JXX:+UseDynamicNumberOfGCThreads " +
+        "--output $(genDir)/dex_dir " +
+        "--min-api 1000 " +
+        "$(in)",
+}
+
+genrule {
+    name: "public_oahl_stub_dex_d8_input_jar",
+    srcs: [":public.org.apache.http.legacy.jar"],
+    tools: ["zip2zip"],
+    out: ["oahl_stub_dex_d8_input.jar"],
+    cmd: "$(location zip2zip) " +
+        "-j -i $(in) " +
+        "-o $(out) \"**/*.class\" ",
+}
+
+genrule {
+    name: "public_oahl_stub_dex",
+    srcs: [
+        ":public_oahl_stub_dex_d8_input_jar",
+    ],
+    tools: [
+        "d8",
+    ],
+    out: [
+        "dex_dir/classes.dex",
+    ],
+    cmd: "mkdir -p $(genDir)/dex_dir &&" +
+        "$(location d8) " +
+        "-JXmx4096M -JXX:+TieredCompilation -JXX:TieredStopAtLevel=1 " +
+        "-JDcom.android.tools.r8.emitRecordAnnotationsInDex " +
+        "-JDcom.android.tools.r8.emitPermittedSubclassesAnnotationsInDex " +
+        "-JXX:OnError=\"cat hs_err_pid%p.log\" " +
+        "-JXX:CICompilerCount=6 -JXX:+UseDynamicNumberOfGCThreads " +
+        "--output $(genDir)/dex_dir " +
+        "--min-api 1000 " +
+        "$(in)",
+}
+
+genrule {
+    name: "veridex_zip",
+    srcs: [
+        "appcompat.sh",
+        ":platform-bootclasspath{hiddenapi-flags.csv}",
+        ":system_stub_dex",
+        ":public_oahl_stub_dex",
+    ],
+    tools: [
+        "soong_zip",
+        "veridex",
+    ],
+    out: ["veridex.zip"],
+    cmd: "mkdir -p $(genDir)/tmp &&" +
+        "ls -1 $(locations :system_stub_dex) | sort > $(genDir)/tmp/system-stubs.zip.list && " +
+        "$(locations soong_zip) -o $(genDir)/tmp/system-stubs.zip" +
+        " -j -l $(genDir)/tmp/system-stubs.zip.list && " +
+        "ls -1 $(locations :public_oahl_stub_dex) | sort > $(genDir)/tmp/org.apache.http.legacy-stubs.zip.list && " +
+        "$(locations soong_zip) -o $(genDir)/tmp/org.apache.http.legacy-stubs.zip " +
+        " -j -l $(genDir)/tmp/org.apache.http.legacy-stubs.zip.list && " +
+        "$(locations soong_zip) -o $(out)" +
+        " -C `dirname $(location appcompat.sh)` -f $(location appcompat.sh)" +
+        " -C `dirname $(location :platform-bootclasspath{hiddenapi-flags.csv})` -f $(location :platform-bootclasspath{hiddenapi-flags.csv})" +
+        " -C `dirname $(location veridex)` -f $(location veridex)" +
+        " -j -f $(genDir)/tmp/system-stubs.zip" +
+        " -j -f $(genDir)/tmp/org.apache.http.legacy-stubs.zip",
+    visibility: ["//visibility:public"],
+}
diff --git a/tools/veridex/Android.mk b/tools/veridex/Android.mk
index 9ea9b3a..3c7a16d 100644
--- a/tools/veridex/Android.mk
+++ b/tools/veridex/Android.mk
@@ -15,7 +15,7 @@
 #
 
 # TODO(b/172480617): Clean up the platform dependencies on this.
-
+# TODO(b/319389869 : Remove the Android.mk after the meta license be resolved.
 LOCAL_PATH := $(call my-dir)
 
 # The veridex tool takes stub dex files as input, so we generate both the system and oahl
diff --git a/tools/veridex/flow_analysis.cc b/tools/veridex/flow_analysis.cc
index 6a4d351..f30eb09 100644
--- a/tools/veridex/flow_analysis.cc
+++ b/tools/veridex/flow_analysis.cc
@@ -760,7 +760,7 @@
   }
 }
 
-void FlowAnalysisCollector::AnalyzeFieldSet(const Instruction& instruction ATTRIBUTE_UNUSED) {
+void FlowAnalysisCollector::AnalyzeFieldSet([[maybe_unused]] const Instruction& instruction) {
   // There are no fields that escape reflection uses.
 }
 
@@ -792,7 +792,7 @@
   return GetReturnType(id);
 }
 
-void FlowAnalysisSubstitutor::AnalyzeFieldSet(const Instruction& instruction ATTRIBUTE_UNUSED) {
+void FlowAnalysisSubstitutor::AnalyzeFieldSet([[maybe_unused]] const Instruction& instruction) {
   // TODO: analyze field sets.
 }
 
diff --git a/tools/veridex/hidden_api_finder.cc b/tools/veridex/hidden_api_finder.cc
index d7ed1e4..0f9ed52 100644
--- a/tools/veridex/hidden_api_finder.cc
+++ b/tools/veridex/hidden_api_finder.cc
@@ -217,7 +217,7 @@
     // Dump potential reflection uses.
     for (const std::string& cls : classes_) {
       for (const std::string& name : strings_) {
-        std::string full_name = cls + "->" + name;
+        std::string full_name = ART_FORMAT("{}->{}", cls, name);
         if (hidden_api_.GetSignatureSource(full_name) != SignatureSource::APP &&
             hidden_api_.ShouldReport(full_name)) {
           hiddenapi::ApiList api_list = hidden_api_.GetApiList(full_name);
diff --git a/tools/veridex/precise_hidden_api_finder.cc b/tools/veridex/precise_hidden_api_finder.cc
index 6f66a33..d9eb271 100644
--- a/tools/veridex/precise_hidden_api_finder.cc
+++ b/tools/veridex/precise_hidden_api_finder.cc
@@ -98,7 +98,7 @@
     for (const ReflectAccessInfo& info : it.second) {
       std::string cls(info.cls.ToString());
       std::string name(info.name.ToString());
-      std::string full_name = cls + "->" + name;
+      std::string full_name = ART_FORMAT("{}->{}", cls, name);
       named_uses[full_name].push_back(ref);
     }
   }
